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: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Old DM spell controlls?

Post 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()..
Last edited by Rasmus on Tue Dec 07, 2010 2:55 am, edited 1 time in total.
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post 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);
};
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Old DM spell controlls?

Post by Paul Stevens »

Thanks. That is interesting. Cyberarcheology.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Old DM spell controlls?

Post by Bit »

Had to fight with that box more than one time... :P
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post 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?
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Old DM spell controlls?

Post 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....?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Old DM spell controlls?

Post 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
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Old DM spell controlls?

Post 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...
User avatar
Rasmus
Ee Master
Posts: 714
Joined: Fri May 08, 2009 1:44 am
Location: Sweden
Contact:

Re: Old DM spell controlls?

Post 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
}
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”