Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Other Apogee/3D Realms Games > Rise of the Triad (1995) Source Code
Blogs FAQ Members List Social Groups Calendar Mark Forums Read


Thread Tools
Old 06-16-2003, 12:04 PM   #1
Saving shatters all windows...
Has anyone else noticed that when restoring a saved game, all the glass walls and windows in the level are broken? You can see this happening by saving while in front of a glass wall. When restoring, you'll see the windows break spontaneously... Probably a problem in the save routines, or does it only happen in the OSX port?
DrLex is offline  
Old 06-17-2003, 10:13 PM   #2

Flaose's Avatar
Re: Saving shatters all windows...
Are you sure you didn't break the window before you saved? Because I seem to remember the game loading all the windows, then shattering the ones you'd already broken.
Cerebral Cortex 314 - For All of your Commander Keen Needs.
Eat at Joes
Flaose is offline  
Old 06-18-2003, 09:16 AM   #3
Re: Saving shatters all windows...
Nope, all windows break, even the ones in rooms I didn't enter yet before saving... You should try it, e.g. in the large secret room in the first level of the commercial version, or the glass wall in the first level of the shareware version.
DrLex is offline  
Old 06-21-2003, 05:46 PM   #4
Re: Saving shatters all windows...

It was indeed a problem specific to big endian machines. I'll save you the details and just post the fixed piece of code from LoadMaskedWalls() in rt_door.c, the comments speak for themselves:

</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> for (i=0;i<maskednum;i++)
// Yet another endianness problem: the flags are stored in different byte
// order depending on the platform. This is bad, but I guess not many people
// will exchange game files anyway.
// Worse is that the original code here checked for the first byte of each
// flag, which only makes sense on little endian platforms. This can be
// fixed elegantly by using bit masks.
word flags; // used to be a byte

if ((flags&0x00FF)!=(mw->flags&0x00FF)) // only check the 8 LSBs.
if (mw->flags&MW_SWITCHON)
} [/code]</blockquote><font size="2" face="Verdana, Arial">This also fixes a dirty practice in the original code: a char was declared but then an int was memcopy'd into it.
DrLex is offline  


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 05:34 AM.

Page generated in 0.13444710 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

Website is 1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.