Old DM spell controlls?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Rasmus
Ee Master
Posts: 714
Joined: 7-May-09 23:44
Location: Sweden
Contact:

Old DM spell controlls?

Post by Rasmus » 7-Dec-10 01:41

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()..
Last edited by Rasmus on 7-Dec-10 01:55, edited 1 time in total.

User avatar
Rasmus
Ee Master
Posts: 714
Joined: 7-May-09 23:44
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post by Rasmus » 7-Dec-10 01:53

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);
};

User avatar
Paul Stevens
CSBwin Guru
Posts: 4100
Joined: 8-Apr-01 16:00
Location: Madison, Wisconsin, USA

Re: Old DM spell controlls?

Post by Paul Stevens » 7-Dec-10 03:48

Thanks. That is interesting. Cyberarcheology.

User avatar
Bit
Mon Master
Posts: 1021
Joined: 3-Mar-08 09:53
Location: Nuts trees

Re: Old DM spell controlls?

Post by Bit » 7-Dec-10 04:02

Had to fight with that box more than one time... :P

User avatar
Rasmus
Ee Master
Posts: 714
Joined: 7-May-09 23:44
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post by Rasmus » 7-Dec-10 17:06

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?

User avatar
Gambit37
Should eat more pies
Posts: 13251
Joined: 31-May-00 11:57
Location: Location, Location
Contact:

Re: Old DM spell controlls?

Post by Gambit37 » 7-Dec-10 17:35

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....?

User avatar
Paul Stevens
CSBwin Guru
Posts: 4100
Joined: 8-Apr-01 16:00
Location: Madison, Wisconsin, USA

Re: Old DM spell controlls?

Post by Paul Stevens » 7-Dec-10 19:16

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

User avatar
Gambit37
Should eat more pies
Posts: 13251
Joined: 31-May-00 11:57
Location: Location, Location
Contact:

Re: Old DM spell controlls?

Post by Gambit37 » 7-Dec-10 19:19

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...

User avatar
Rasmus
Ee Master
Posts: 714
Joined: 7-May-09 23:44
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post by Rasmus » 7-Dec-10 21:12

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
}

Post Reply