Page 1 of 1

Old DM spell controlls?

Posted: Tue Dec 07, 2010 2:41 am
by Rasmus
I found something fun when mixing around with the CSBWin code.
I was working on replacing the spell controlls with my own graphics, but when I removed the drawing code for the original CSBWin spellcontrolls I got this on my screen instead of nothing!
This graphic was hiding behind the original graphic, and it does seems like it have had some kind of function because it has arrows up and down..
Maybe DM handled the spells by listing them before the runes came into action..

Image

I found this interesting I would like to share it :)

To get this image in CSBWin you have to remove all calls to DrawSpellControls() and TAG01b408()..

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 2:53 am
by Rasmus
It seems to be this code inside SelectMagicCaster(i16 chIdx) that displays it..

Code: Select all

if (d.MagicCaster == -1)
{
    STHideCursor(HC36);
    BLT2Screen((pnt)GetBasicGraphicAddress(9), (RectPos *)d.Word12, 48, -1);
    STShowCursor(HC36);
};

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 4:48 am
by Paul Stevens
Thanks. That is interesting. Cyberarcheology.

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 5:02 am
by Bit
Had to fight with that box more than one time... :P

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 6:06 pm
by Rasmus
Thanks. That is interesting. Cyberarcheology.
hehe, that's a good one :D

@bit: Explain more, did it come up before you got the spellcontrolls working?

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 6:35 pm
by Gambit37
That arrow interface has been viewable in the graphics.dat for years, so it's not really new..... but I guess this is the first time anyone has seen it in the actual game. I wonder if they originally meant to switch between magic casters using the arrows, but realised it was too many clicks? Even so, it seems odd to leave part of an old interface in there and then draw something different over the top of it....?

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 8:16 pm
by Paul Stevens
it seems odd to leave part
I don't find it at all odd.

Someone did not like the old interface. But he
did not want to delete it in case he could not
do better. So his attempts went right on top
of what existed. He tried this and that...many hours
of work. Finally got something nice. Went
out to celebrate over a beer. Job done.

I am sure that all my big software projects
have unreachable code. Functions that are
never called. Redundant code. Such things are not
too obvious. One I see a lot in other's code:

if ( (a) || ((!a) && b) )

if a is true
OR
a is not true AND b is true

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 8:19 pm
by Gambit37
True enough. Now you mention it, I do similar things when coding up websites. It makes one wonder how much redundant code there must be out there...

Re: Old DM spell controlls?

Posted: Tue Dec 07, 2010 10:12 pm
by Rasmus
To bad he only left the graphics and not the mechanics :)
I would be pleased if I were to find a code that looked something like this:

if (useNewSpellMechanics)
{
// Current graphics and mechanics
}
else
{
// Old graphics and mechanics
}