Allow hires Mac demo graphics, fix endian issue with reading GameBitmapXlat (fixing crash on PowerPC Macs using PC demo), put a return on the end of an error message

This commit is contained in:
kreatordxx 2008-10-31 13:09:30 +00:00
parent 23a2d3f9dc
commit 76ddc8559d
4 changed files with 25 additions and 11 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog
20081031
--------
main/bm.c, main/inferno.c, main/piggy.c: Allow hires Mac demo graphics, fix endian issue with reading GameBitmapXlat (fixing crash on PowerPC Macs using PC demo), put a return on the end of an error message
20081030
--------
INSTALL.txt, README.txt: Docs update: Infos about Jukebox over SDL_mixer, SDL_mixer is not experimental anymore, yet another .de->.com change

View file

@ -140,7 +140,7 @@ int gamedata_init()
// but *may* be useful for loading Descent 1 Shareware texture properties.
if (!gamedata_read_tbl(0))
#endif
Error("Cannot open ham file");
Error("Cannot open ham file\n");
#ifdef EDITOR
gamedata_read_tbl(0); // doesn't matter if it doesn't find it, given the ham file exists

View file

@ -272,13 +272,6 @@ int main(int argc, char *argv[])
"\tIn a subdirectory called 'Data'\n"
"Or use the -hogdir option to specify an alternate location.");
}
else // deal with interactive demo
{
GameArg.GfxHiresGFXAvailable = 0;
GameArg.GfxHiresFNTAvailable = 0;
GameArg.SysLowMem = 1;
GameArg.SndDigiSampleRate = SAMPLE_RATE_11K;
}
}
load_text();

View file

@ -945,6 +945,7 @@ int read_hamfile()
CFILE * ham_fp = NULL;
int ham_id;
int sound_offset = 0;
int shareware = 0;
ham_fp = PHYSFSX_openDataFile(DEFAULT_HAMFILE_REGISTERED);
@ -955,6 +956,11 @@ int read_hamfile()
Must_write_hamfile = 1;
return 0;
}
else
{
shareware = 1;
GameArg.SndDigiSampleRate = SAMPLE_RATE_11K;
}
//make sure ham is valid type file & is up-to-date
ham_id = cfile_read_int(ham_fp);
@ -969,15 +975,26 @@ int read_hamfile()
}
#endif
if (Piggy_hamfile_version < 3) // hamfile contains sound info
if (Piggy_hamfile_version < 3) // hamfile contains sound info, probably PC demo
{
sound_offset = cfile_read_int(ham_fp);
if (shareware) // deal with interactive PC demo
{
GameArg.GfxHiresGFXAvailable = 0;
//GameArg.GfxHiresFNTAvailable = 0; // fonts are in the hog
GameArg.SysLowMem = 1;
}
}
#if 1 //ndef EDITOR
{
//int i;
int i;
bm_read_all(ham_fp);
cfread( GameBitmapXlat, sizeof(ushort)*MAX_BITMAP_FILES, 1, ham_fp );
//cfread( GameBitmapXlat, sizeof(ushort)*MAX_BITMAP_FILES, 1, ham_fp );
for (i = 0; i < MAX_BITMAP_FILES; i++)
GameBitmapXlat[i] = cfile_read_short(ham_fp);
}
#endif