r230 - trunk/rott
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat May 24 02:34:56 EDT 2008
Author: jwrdegoede
Date: 2008-05-24 02:34:55 -0400 (Sat, 24 May 2008)
New Revision: 230
Modified:
trunk/rott/_rt_ted.h
trunk/rott/byteordr.c
trunk/rott/byteordr.h
trunk/rott/cin_efct.c
trunk/rott/fx_man.c
trunk/rott/fx_man.h
trunk/rott/myprint.h
trunk/rott/rt_cfg.c
trunk/rott/rt_cfg.h
trunk/rott/rt_com.c
trunk/rott/rt_def.h
trunk/rott/rt_door.c
trunk/rott/rt_draw.c
trunk/rott/rt_error.c
trunk/rott/rt_floor.c
trunk/rott/rt_game.c
trunk/rott/rt_in.c
trunk/rott/rt_main.c
trunk/rott/rt_main.h
trunk/rott/rt_map.c
trunk/rott/rt_menu.c
trunk/rott/rt_menu.h
trunk/rott/rt_net.c
trunk/rott/rt_playr.c
trunk/rott/rt_rand.c
trunk/rott/rt_scale.c
trunk/rott/rt_sound.c
trunk/rott/rt_stat.c
trunk/rott/rt_str.c
trunk/rott/rt_str.h
trunk/rott/rt_ted.c
trunk/rott/rt_ted.h
trunk/rott/rt_util.c
trunk/rott/rt_util.h
trunk/rott/rt_view.c
trunk/rott/sndcards.h
trunk/rott/w_wad.c
trunk/rott/z_zone.c
Log:
Assorted fixes from the debian package
Modified: trunk/rott/_rt_ted.h
===================================================================
--- trunk/rott/_rt_ted.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/_rt_ted.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -36,6 +36,7 @@
{
int lump;
int cachelevel;
+ int type; // To make precaching possible on big endian machines
} cachetype;
//========================================
Modified: trunk/rott/byteordr.c
===================================================================
--- trunk/rott/byteordr.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/byteordr.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -52,7 +52,33 @@
Debug("No-op endian converter on %p.\n", lmp);
}
-void CvtFixme(void *lmp, int num)
+// Returns converter for the designated type
+converter_t CvtForType(int type)
{
- Debug("FIXME endian converter on %p.\n", lmp);
+ switch(type) {
+ case cache_pic_t:
+ return Cvt_pic_t;
+ break;
+ case cache_lpic_t:
+ return Cvt_lpic_t;
+ break;
+ case cache_font_t:
+ return Cvt_font_t;
+ break;
+ case cache_lbm_t:
+ return Cvt_lbm_t;
+ break;
+ case cache_patch_t:
+ return Cvt_patch_t;
+ break;
+ case cache_transpatch_t:
+ return Cvt_transpatch_t;
+ break;
+ case cache_cfont_t:
+ return Cvt_cfont_t;
+ break;
+ default:
+ return CvtNull;
+ break;
+ }
}
Modified: trunk/rott/byteordr.h
===================================================================
--- trunk/rott/byteordr.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/byteordr.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -38,6 +38,6 @@
DECLARE_CONVERTER(transpatch_t);
DECLARE_CONVERTER(cfont_t);
void CvtNull(void *lmp, int num);
-void CvtFixme(void *lmp, int num);
+converter_t CvtForType(int type);
#endif
Modified: trunk/rott/cin_efct.c
===================================================================
--- trunk/rott/cin_efct.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/cin_efct.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -331,7 +331,7 @@
{
if (flic->usefile==false)
{
- W_CacheLumpName(flic->name,PU_CACHE, CvtFixme, 1);
+ W_CacheLumpName(flic->name,PU_CACHE, CvtNull, 1);
}
}
@@ -513,7 +513,7 @@
*/
void PrecacheBack ( backevent * back )
{
- W_CacheLumpName( back->name, PU_CACHE, CvtFixme, 1);
+ W_CacheLumpName( back->name, PU_CACHE, CvtNull, 1);
}
@@ -616,7 +616,7 @@
{
byte * pal;
- pal=W_CacheLumpName(event->name,PU_CACHE, CvtFixme, 1);
+ pal=W_CacheLumpName(event->name,PU_CACHE, CvtNull, 1);
XFlipPage ();
CinematicSetPalette (pal);
}
@@ -631,7 +631,7 @@
void PrecachePalette (paletteevent * event)
{
- W_CacheLumpName(event->name,PU_CACHE, CvtFixme, 1);
+ W_CacheLumpName(event->name,PU_CACHE, CvtNull, 1);
}
Modified: trunk/rott/fx_man.c
===================================================================
--- trunk/rott/fx_man.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/fx_man.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -141,6 +141,7 @@
// go to the file that is specified in that variable. Otherwise, they
// are ignored for the expense of the function call. If DUKESND_DEBUG is
// set to "-" (without the quotes), then the output goes to stdout.
+static void snddebug(const char *fmt, ...) __attribute__((format(printf,1,2)));
static void snddebug(const char *fmt, ...)
{
va_list ap;
@@ -159,6 +160,7 @@
// FIXME: Consolidate this code.
// Same as snddebug(), but a different tag is put on each line.
+static void musdebug(const char *fmt, ...) __attribute__((format(printf,1,2)));
static void musdebug(const char *fmt, ...)
{
va_list ap;
@@ -298,22 +300,6 @@
snddebug("Error message set to [%s].", errorMessage);
} // setErrorMessage
-
-int FX_GetBlasterSettings(fx_blaster_config *blaster)
-{
- setErrorMessage("No SoundBlaster cards available.");
- return(FX_Error);
-} // FX_GetBlasterSettings
-
-
-int FX_SetupSoundBlaster(fx_blaster_config blaster, int *MaxVoices,
- int *MaxSampleBits, int *MaxChannels)
-{
- setErrorMessage("No SoundBlaster cards available.");
- return(FX_Error);
-} // FX_SetupSoundBlaster
-
-
int FX_SetupCard( int SoundCard, fx_device *device )
{
init_debugging();
Modified: trunk/rott/fx_man.h
===================================================================
--- trunk/rott/fx_man.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/fx_man.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -1,3 +1,4 @@
+
/*
Copyright (C) 1994-1995 Apogee Software, Ltd.
@@ -43,17 +44,6 @@
#define MonoFx 1
#define StereoFx 2
-typedef struct
- {
- unsigned long Address;
- unsigned long Type;
- unsigned long Interrupt;
- unsigned long Dma8;
- unsigned long Dma16;
- unsigned long Midi;
- unsigned long Emu;
- } fx_blaster_config;
-
enum FX_ERRORS
{
FX_Warning = -2,
@@ -67,6 +57,7 @@
FX_DPMI_Error
};
+#ifdef DOS
enum fx_BLASTER_Types
{
fx_SB = 1,
@@ -75,12 +66,11 @@
fx_SBPro2 = 4,
fx_SB16 = 6
};
+#endif
char *FX_ErrorString( int ErrorNumber );
int FX_SetupCard( int SoundCard, fx_device *device );
-int FX_GetBlasterSettings( fx_blaster_config *blaster );
-int FX_SetupSoundBlaster( fx_blaster_config blaster, int *MaxVoices, int *MaxSampleBits, int *MaxChannels );
int FX_Init( int SoundCard, int numvoices, int numchannels, int samplebits, unsigned mixrate );
int FX_Shutdown( void );
int FX_SetCallBack( void ( *function )( unsigned long ) );
Modified: trunk/rott/myprint.h
===================================================================
--- trunk/rott/myprint.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/myprint.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -38,6 +38,6 @@
int printstring( char *string );
int printnum( int number );
int printunsigned( unsigned long number, int radix );
-int myprintf( char *fmt, ... );
+int myprintf( char *fmt, ... ) __attribute__((format(printf,1,2)));
#endif
Modified: trunk/rott/rt_cfg.c
===================================================================
--- trunk/rott/rt_cfg.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_cfg.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -101,10 +101,12 @@
int MUvolume = 196;
int FXvolume = 196;
+#ifdef DOS
fx_blaster_config SBSettings =
{
0x220, fx_SB, 7, 1, 5, 0x330, 0x620
};
+#endif
boolean mouseenabled = 1;
boolean usemouselook = 0;
@@ -120,7 +122,9 @@
int NumVoices = 4;
int NumChannels = 1;
int NumBits = 8;
+#ifdef DOS
int MidiAddress = 0x330;
+#endif
boolean cybermanenabled = false;
boolean assassinenabled = false;
boolean spaceballenabled = false;
@@ -296,14 +300,17 @@
ReadInt ("NumBits",&NumBits);
+#ifdef DOS
// Read in Midi Address
ReadInt ("MidiAddress",&MidiAddress);
+#endif
// Read in stereo reversal
ReadBoolean ("StereoReverse",&stereoreversed);
+#ifdef DOS
// Read in Sound Blaster info
ReadUnsigned ("SBType", &SBSettings.Type );
ReadUnsigned ("SBPort", &SBSettings.Address );
@@ -312,6 +319,7 @@
ReadUnsigned ("SBDma16", &SBSettings.Dma16 );
ReadUnsigned ("SBMidi", &SBSettings.Midi );
ReadUnsigned ("SBEmu", &SBSettings.Emu );
+#endif
}
else
retval = false;
@@ -332,7 +340,9 @@
)
{
+#ifdef DOS
fx_blaster_config blaster;
+#endif
int status;
//
@@ -345,7 +355,6 @@
NumVoices = 8;
NumChannels = 2;
NumBits = 16;
- MidiAddress = 0x330;
stereoreversed = false;
#else
MusicMode = 0;
@@ -355,7 +364,6 @@
NumBits = 8;
MidiAddress = 0x330;
stereoreversed = false;
- #endif
status = FX_GetBlasterSettings( &blaster );
if ( status == FX_Ok )
@@ -368,6 +376,7 @@
SBSettings.Midi = blaster.Midi;
SBSettings.Emu = blaster.Emu;
}
+ #endif
}
@@ -1560,6 +1569,7 @@
SafeWriteString(file,"\n;\n");
SafeWriteString(file,"; Music Modes\n");
SafeWriteString(file,"; 0 - Off\n");
+#ifdef DOS
SafeWriteString(file,"; 1 - UltraSound\n");
SafeWriteString(file,"; 2 - Sound Blaster\n");
SafeWriteString(file,"; 3 - Sound Man 16\n");
@@ -1570,6 +1580,9 @@
SafeWriteString(file,"; 8 - General Midi\n");
SafeWriteString(file,"; 9 - Sound Canvas\n");
SafeWriteString(file,"; 10 - Adlib\n");
+#else
+ SafeWriteString(file,"; 6 - On\n");
+#endif
WriteParameter(file,"MusicMode ",MusicMode);
// Write out FX Mode
@@ -1577,6 +1590,7 @@
SafeWriteString(file,"\n;\n");
SafeWriteString(file,"; FX Modes\n");
SafeWriteString(file,"; 0 - Off\n");
+#ifdef DOS
SafeWriteString(file,"; 1 - UltraSound\n");
SafeWriteString(file,"; 2 - Sound Blaster\n");
SafeWriteString(file,"; 3 - Sound Man 16\n");
@@ -1587,6 +1601,9 @@
SafeWriteString(file,"; 8 - Disney Sound Source\n");
SafeWriteString(file,"; 9 - Tandy Sound Source\n");
SafeWriteString(file,"; 10 - PC Speaker\n");
+#else
+ SafeWriteString(file,"; 6 - On\n");
+#endif
WriteParameter(file,"FXMode ",FXMode);
// Write in Music Volume
@@ -1626,6 +1643,7 @@
SafeWriteString(file,"; 16 bit\n");
WriteParameter(file,"NumBits ",NumBits);
+#ifdef DOS
// Write out Midi Address
SafeWriteString(file,"\n;\n");
@@ -1640,6 +1658,7 @@
SafeWriteString(file,"; $370\n");
SafeWriteString(file,"; $380\n");
WriteParameterHex(file,"MidiAddress ",MidiAddress);
+#endif
// Write out stereo reversal
@@ -1649,6 +1668,7 @@
SafeWriteString(file,"; 1 reverse stereo\n");
WriteParameter (file,"StereoReverse ",stereoreversed);
+#ifdef DOS
// Write out Sound Blaster info
SafeWriteString(file,"\n;\n");
@@ -1660,6 +1680,7 @@
WriteParameter(file, "SBDma16 ", SBSettings.Dma16 );
WriteParameterHex(file, "SBMidi ", SBSettings.Midi );
WriteParameterHex(file, "SBEmu ", SBSettings.Emu );
+#endif
close (file);
}
Modified: trunk/rott/rt_cfg.h
===================================================================
--- trunk/rott/rt_cfg.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_cfg.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -46,7 +46,9 @@
extern int NumVoices;
extern int NumChannels;
extern int NumBits;
+#ifdef DOS
extern int MidiAddress;
+#endif
extern boolean stereoreversed;
extern boolean cybermanenabled;
extern boolean assassinenabled;
Modified: trunk/rott/rt_com.c
===================================================================
--- trunk/rott/rt_com.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_com.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -247,7 +247,7 @@
if (crc!=sentcrc)
{
badpacket=1;
- SoftError("BADPKT at %ld\n",GetTicCount());
+ SoftError("BADPKT at %d\n",GetTicCount());
}
if (networkgame==false)
{
Modified: trunk/rott/rt_def.h
===================================================================
--- trunk/rott/rt_def.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_def.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -444,6 +444,18 @@
ex_battledone
} exit_t;
+// Types for cache lumps (for endian converters)
+enum {
+ cache_other,
+ cache_pic_t,
+ cache_lpic_t,
+ cache_font_t,
+ cache_lbm_t,
+ cache_patch_t,
+ cache_transpatch_t,
+ cache_cfont_t
+};
+
////////////////////////////////////////////////////////////////////////////
///////////////// GLOBAL STRUCTURE TYPES //////////////////////////
Modified: trunk/rott/rt_door.c
===================================================================
--- trunk/rott/rt_door.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_door.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -476,7 +476,7 @@
{memcpy(&dummy,buffer,sizeof(saved_touch_type));
temp = (touchplatetype*)Z_LevelMalloc(sizeof(touchplatetype),PU_LEVELSTRUCT,NULL);
if (!temp)
- Error("LoadTouchplates: Failed on allocation of touchplates %ld of %ld",i,savedactions);
+ Error("LoadTouchplates: Failed on allocation of touchplates %d of %d",i,savedactions);
memset(temp,0,sizeof(*temp));
temp->tictime = dummy.tictime;
@@ -1194,7 +1194,7 @@
doorobjlist[doornum]=(doorobj_t*)Z_LevelMalloc(sizeof(doorobj_t),PU_LEVELSTRUCT,NULL);
if (!doorobjlist[doornum])
- Error("SpawnDoor: Failed on allocation of door %ld ",doornum);
+ Error("SpawnDoor: Failed on allocation of door %d ",doornum);
memset(doorobjlist[doornum],0,sizeof(doorobj_t));
lastdoorobj=doorobjlist[doornum];
@@ -1374,8 +1374,8 @@
if ((lock>0) && (lock<5))
lastdoorobj->sidepic = W_GetNumForName("lock1")+lock-1;
- PreCacheLump(lastdoorobj->sidepic,PU_CACHEWALLS);
- PreCacheLump(lastdoorobj->alttexture,PU_CACHEWALLS);
+ PreCacheLump(lastdoorobj->sidepic,PU_CACHEWALLS,cache_pic_t);
+ PreCacheLump(lastdoorobj->alttexture,PU_CACHEWALLS,cache_pic_t);
if (lastdoorobj->vertical==true)
{
@@ -1400,8 +1400,9 @@
lastdoorobj->flags|=DF_MULTI;
}
- for (i=0;i<9;i++)
- PreCacheLump(lastdoorobj->texture+i,PU_CACHEWALLS);
+ PreCacheLump(lastdoorobj->texture,PU_CACHEWALLS,cache_pic_t);
+ for (i=1;i<9;i++) // only first texture is pic_t!
+ PreCacheLump(lastdoorobj->texture+i,PU_CACHEWALLS,cache_patch_t);
doornum++;
lastdoorobj++;
if (doornum==MAXDOORS)
@@ -1534,7 +1535,7 @@
else if (lt)
MAPSPOT(tilex,tiley,0) = MAPSPOT(tilex-1,tiley,0);
else
- Error("FixDoors: Couldn't fix up area at x=%ld y=%ld\n",tilex,tiley);
+ Error("FixDoors: Couldn't fix up area at x=%d y=%d\n",tilex,tiley);
}
else
{
@@ -1543,7 +1544,7 @@
else if (up)
MAPSPOT(tilex,tiley,0) = MAPSPOT(tilex,tiley-1,0);
else
- Error("FixDoors: Couldn't fix up area at x=%ld y=%ld\n",tilex,tiley);
+ Error("FixDoors: Couldn't fix up area at x=%d y=%d\n",tilex,tiley);
}
if (IsDoorLinked(i))
UtilizeDoor(i,LockLinkedDoor);
@@ -2585,20 +2586,20 @@
for (i=1;i<AMW_NUMFRAMES;i++)
{
- PreCacheLump(lastmaskobj->bottomtexture+i,PU_CACHEWALLS);
+ PreCacheLump(lastmaskobj->bottomtexture+i,PU_CACHEWALLS,cache_transpatch_t);
}
SD_PreCacheSound(SD_GLASSBREAKSND);
}
if (sidepic==true)
{
- PreCacheLump(lastmaskobj->sidepic,PU_CACHEWALLS);
+ PreCacheLump(lastmaskobj->sidepic,PU_CACHEWALLS,cache_pic_t);
}
if (lastmaskobj->bottomtexture>=0)
- PreCacheLump(lastmaskobj->bottomtexture,PU_CACHEWALLS);
+ PreCacheLump(lastmaskobj->bottomtexture,PU_CACHEWALLS,cache_transpatch_t);
if (lastmaskobj->toptexture>=0)
- PreCacheLump(lastmaskobj->toptexture,PU_CACHEWALLS);
+ PreCacheLump(lastmaskobj->toptexture,PU_CACHEWALLS,cache_patch_t);
if (lastmaskobj->midtexture>=0)
- PreCacheLump(lastmaskobj->midtexture,PU_CACHEWALLS);
+ PreCacheLump(lastmaskobj->midtexture,PU_CACHEWALLS,cache_patch_t);
maskednum++;
lastmaskobj++;
if (maskednum==MAXMASKED)
@@ -2652,7 +2653,7 @@
else if (dn)
MAPSPOT(tilex,tiley,0) = MAPSPOT(tilex,tiley+1,0);
else
- Error("FixMaskedWalls: Couldn't fix up area at x=%ld y=%ld\n",tilex,tiley);
+ Error("FixMaskedWalls: Couldn't fix up area at x=%d y=%d\n",tilex,tiley);
}
else
{
@@ -2665,7 +2666,7 @@
else if (lt)
MAPSPOT(tilex,tiley,0) = MAPSPOT(tilex-1,tiley,0);
else
- Error("FixMaskedWalls: Couldn't fix up area at x=%ld y=%ld\n",tilex,tiley);
+ Error("FixMaskedWalls: Couldn't fix up area at x=%d y=%d\n",tilex,tiley);
}
maskobjlist[i]->areanumber = MAPSPOT(tilex,tiley,0)-AREATILE;
if ((maskobjlist[i]->areanumber <0) || (maskobjlist[i]->areanumber > NUMAREAS))
@@ -3309,7 +3310,7 @@
else if (rt)
return rt;
else
- Error("Cannot find an area number for tile at x=%ld y=%ld\n",tilex,tiley);
+ Error("Cannot find an area number for tile at x=%d y=%d\n",tilex,tiley);
return -1;
}
@@ -3352,7 +3353,7 @@
lastpwallobj->texture = texture;
if (!texture&0x1000)
- PreCacheLump(texture,PU_CACHEWALLS);
+ PreCacheLump(texture,PU_CACHEWALLS,cache_pic_t);
lastpwallobj->areanumber = GetAreaNumber(tilex,tiley,lastpwallobj->dir);
MAPSPOT (tilex, tiley, 0)=(word)(lastpwallobj->areanumber+AREATILE);
@@ -3911,7 +3912,7 @@
VW_UpdateScreen ();
I_Delay (2000);
}
- Error ("PushWall Attempting to escape off the edge of the map\nIt is located at x=%ld y=%ld\nI'm Free!!!!\n",
+ Error ("PushWall Attempting to escape off the edge of the map\nIt is located at x=%d y=%d\nI'm Free!!!!\n",
pw->tilex, pw->tiley);
}
}
@@ -4037,7 +4038,7 @@
num=sz/unitsize;
if (pwallnum!=num)
- Error("Different number of Push Walls when trying to load a game\npwallnum=%ld num=%ld",pwallnum,num);
+ Error("Different number of Push Walls when trying to load a game\npwallnum=%d num=%d",pwallnum,num);
for (i=0;i<pwallnum;i++)
{
@@ -4201,7 +4202,7 @@
num=sz/unitsize;
if (maskednum!=num)
- Error("Different number of Masked Walls when trying to load a game\nmaskednum=%ld num=%ld",maskednum,num);
+ Error("Different number of Masked Walls when trying to load a game\nmaskednum=%d num=%d",maskednum,num);
for (i=0;i<maskednum;i++)
{
@@ -4317,7 +4318,7 @@
num=size/unitsize;
if (doornum!=num)
- Error("Different number of Doors when trying to load a game\ndoornum=%ld num=%ld",doornum,num);
+ Error("Different number of Doors when trying to load a game\ndoornum=%d num=%d",doornum,num);
for (door = 0; door < doornum; door++)
{
Modified: trunk/rott/rt_draw.c
===================================================================
--- trunk/rott/rt_draw.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_draw.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -1453,7 +1453,7 @@
#endif
default:
- Error("Illegal weapon value = %ld\n",locplayerstate->weapon);
+ Error("Illegal weapon value = %d\n",locplayerstate->weapon);
break;
}
}
@@ -2243,7 +2243,7 @@
else
viewangle = player->angle;
if ((viewangle<0) && (viewangle>=FINEANGLES))
- Error ("View angle out of range = %ld\n",viewangle);
+ Error ("View angle out of range = %d\n",viewangle);
viewx = player->x;
viewy = player->y;
pheight = player->z + locplayerstate->playerheight + locplayerstate->heightoffset;
Modified: trunk/rott/rt_error.c
===================================================================
--- trunk/rott/rt_error.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_error.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -121,7 +121,7 @@
//
//******************************************************************************
-void UL_UserMessage (int x, int y, char *str, ...)
+void UL_UserMessage (int x, int y, char *str, ...) __attribute__((format(printf,3,4)))
{
va_list strptr;
char buf[128];
Modified: trunk/rott/rt_floor.c
===================================================================
--- trunk/rott/rt_floor.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_floor.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -357,7 +357,7 @@
lump=W_GetNumForName("FLRCL16\0");
break;
default:
- Error("Illegal Floor/Ceiling Tile = %ld\n",num);
+ Error("Illegal Floor/Ceiling Tile = %d\n",num);
break;
}
return lump;
@@ -417,7 +417,7 @@
word crud;
sky = (MAPSPOT(1,0,0) - 233);
if ((sky<1) || (sky>6))
- Error("Illegal Sky Tile = %ld\n",sky);
+ Error("Illegal Sky Tile = %d\n",sky);
ceilingnum=1;
crud=(word)MAPSPOT(1,0,1);
if ((crud>=90) && (crud<=97))
@@ -425,7 +425,7 @@
else if ((crud>=450) && (crud<=457))
horizonheight=crud-450+9;
else
- Error("You must specify a valid horizon height sprite icon over the sky at (2,0) on map %ld\n",gamestate.mapon);
+ Error("You must specify a valid horizon height sprite icon over the sky at (2,0) on map %d\n",gamestate.mapon);
// Check for lightnign icon
Modified: trunk/rott/rt_game.c
===================================================================
--- trunk/rott/rt_game.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_game.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -4846,7 +4846,7 @@
int myticcount;
if (num > 15 || num < 0)
- Error("Illegal Saved game value=%ld\n",num);
+ Error("Illegal Saved game value=%d\n",num);
//
// Save Alternate Game Level information for reloading game
@@ -5168,7 +5168,7 @@
int myticcount;
if (num>15 || num<0)
- Error("Illegal Load game value=%ld\n",num);
+ Error("Illegal Load game value=%d\n",num);
// Create the proper file name
@@ -5241,6 +5241,9 @@
DoLoadGameAction ();
SetupGameLevel();
+ // This prevents a nasty glitch when loading some saved games
+ PreCacheGroup(W_GetNumForName("BULLETHO"),W_GetNumForName("ALTBHO"),cache_transpatch_t);
+
// Door Tag
size=4;
@@ -5517,7 +5520,7 @@
int size;
if (num>15 || num<0)
- Error("Illegal Load game value=%ld\n",num);
+ Error("Illegal Load game value=%d\n",num);
// Create the proper file name
@@ -5559,7 +5562,7 @@
int size;
if (num>15 || num<0)
- Error("Illegal Load game value=%ld\n",num);
+ Error("Illegal Load game value=%d\n",num);
// Create the proper file name
Modified: trunk/rott/rt_in.c
===================================================================
--- trunk/rott/rt_in.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_in.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -1101,6 +1101,7 @@
scancodes[SDLK_LALT] = sc_Alt;
scancodes[SDLK_RALT] = sc_Alt;
+ scancodes[SDLK_MODE] = sc_Alt;
scancodes[SDLK_RCTRL] = sc_Control;
scancodes[SDLK_SPACE] = sc_Space;
scancodes[SDLK_CAPSLOCK] = sc_CapsLock;
Modified: trunk/rott/rt_main.c
===================================================================
--- trunk/rott/rt_main.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_main.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -116,7 +116,9 @@
boolean newlevel = false;
boolean infopause;
+#ifdef DOS
boolean SOUNDSETUP=false;
+#endif
boolean quiet = false;
#if (DEVELOPMENT == 1)
@@ -308,6 +310,7 @@
printf( "Sound FX disabled.\n" );
}
+#ifdef DOS
if ( status1 || status2 || status3 )
{
printf( "\n\nROTT was unable to initialize your " );
@@ -331,6 +334,7 @@
"Now entering sound setup.\n" );
SOUNDSETUP = true;
}
+#endif
Init_Tables ();
InitializeRNG ();
@@ -375,11 +379,13 @@
// SetBorderColor(155);
SetViewSize(8);
+#ifdef DOS
if ( SOUNDSETUP )
{
SwitchPalette( origpal, 35 );
CP_SoundSetup();
}
+#endif
playstate = ex_titles;
@@ -450,8 +456,10 @@
{
SetTextMode();
TurnOffTextCursor ();
+#ifdef DOS
if (CheckParm ("SOUNDSETUP") == 0)
{
+#endif
#ifdef ANSIESC
printf("\n\n\n");
#endif
@@ -501,6 +509,7 @@
#endif
UL_ColorBox (0, 0, 80, 2, 0x1e);
+#ifdef DOS
}
else
{
@@ -517,6 +526,7 @@
UL_ColorBox (0, 0, 80, 1, 0x1e);
}
+#endif
}
else
{
@@ -535,7 +545,9 @@
int i,n;
infopause=false;
+#ifdef DOS
SOUNDSETUP = false;
+#endif
tedlevel=false;
NoWait=false;
NoSound=false;
@@ -597,7 +609,9 @@
printf (" MONO - Enable mono-monitor support.\n");
printf (" SCREENSHOTS- Clean screen capture for shots.\n");
printf (" PAUSE - Pauses startup screen information.\n");
+#ifdef DOS
printf (" SOUNDSETUP - Setup sound for ROTT\n");
+#endif
printf (" ENABLEVR - Enable VR helmet input devices\n");
printf (" NOECHO - Turn off sound reverb\n");
printf (" DEMOEXIT - Exit program when demo is terminated\n");
@@ -763,7 +777,9 @@
infopause=true;
break;
case 13:
+#ifdef DOS
SOUNDSETUP = true;
+#endif
break;
case 14:
startlevel = (ParseNum(_argv[i + 1])-1);
@@ -1175,8 +1191,9 @@
I_Delay(30);
SD_Play (SD_ACTORSQUISHSND);
tempbuf=bufferofs;
- bufferofs=displayofs;
+ bufferofs=page1start; // fixed, was displayofs
DrawNormalSprite(320-94,200-41,W_GetNumForName("rsac"));
+ VW_UpdateScreen(); // fixed, was missing
bufferofs=tempbuf;
I_Delay(30);
@@ -1608,7 +1625,11 @@
void ShutDown ( void )
{
- if ( ( standalone == false ) || ( SOUNDSETUP ) )
+ if ( ( standalone == false )
+#ifdef DOS
+ || ( SOUNDSETUP )
+#endif
+ )
{
WriteConfig ();
}
@@ -1700,8 +1721,10 @@
printf("LIGHTRATE =%ld\n",GetLightRateTile());
printf("\nCENTERY=%ld\n",centery);
#else
+#ifdef DOS
if ( !SOUNDSETUP )
{
+#endif
#if (SHAREWARE==0)
txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("regend"), PU_CACHE, CvtNull, 1);
#else
@@ -1728,15 +1751,19 @@
UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
#endif
+#ifdef DOS
}
#endif
+#endif
+#ifdef DOS
if ( SOUNDSETUP )
{
printf( "\nSound setup complete.\n"
"Type ROTT to run the game.\n" );
}
ShutDown();
+#endif
exit(0);
}
Modified: trunk/rott/rt_main.h
===================================================================
--- trunk/rott/rt_main.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_main.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -158,7 +158,9 @@
extern boolean MAPSTATS;
extern boolean TILESTATS;
extern boolean HUD;
+#ifdef DOS
extern boolean SOUNDSETUP;
+#endif
extern char CWD[40];
Modified: trunk/rott/rt_map.c
===================================================================
--- trunk/rott/rt_map.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_map.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -394,26 +394,40 @@
=======================
*/
+/* Indices: mapscale, reduced coordinate */
+static const int arrowscale[4][5] =
+{{ 1,17,32,47,63}, /* Mapscale 0: 64 pixels/sprite */
+ { 1, 9,16,23,31}, /* Mapscale 1: 32 pixels/sprite */
+ { 1, 5, 8,11,15}, /* Mapscale 2: 16 pixels/sprite */
+ { 1, 3, 4, 5, 7}}; /* Mapscale 3: 8 pixels/sprite */
+
void DrawMap_PlayerArrow (int x, int y, int dir)
{
int i;
-
+
x*=tilesize;
y*=tilesize;
+ /* You can't draw a 4x4 arrow */
+ if(mapscale == 4)
+ {
+ VL_Bar(x+1,y+1,2,2,244);
+ return;
+ }
+
for (i=0;i<6;i++)
{
- VL_DrawLine ((arrows[dir][i].x<<(4-mapscale))+x,
- (arrows[dir][i].y<<(4-mapscale))+y,
- (arrows[dir][i+1].x<<(4-mapscale))+x,
- (arrows[dir][i+1].y<<(4-mapscale))+y,
+ VL_DrawLine (arrowscale[mapscale][arrows[dir][i].x]+x,
+ arrowscale[mapscale][arrows[dir][i].y]+y,
+ arrowscale[mapscale][arrows[dir][i+1].x]+x,
+ arrowscale[mapscale][arrows[dir][i+1].y]+y,
244
);
}
- VL_DrawLine ( (arrows[dir][6].x<<(4-mapscale))+x,
- (arrows[dir][6].y<<(4-mapscale))+y,
- (arrows[dir][0].x<<(4-mapscale))+x,
- (arrows[dir][0].y<<(4-mapscale))+y,
+ VL_DrawLine ( arrowscale[mapscale][arrows[dir][6].x]+x,
+ arrowscale[mapscale][arrows[dir][6].y]+y,
+ arrowscale[mapscale][arrows[dir][0].x]+x,
+ arrowscale[mapscale][arrows[dir][0].y]+y,
244
);
}
@@ -560,7 +574,7 @@
DrawMap_Actor(i,j,a);
break;
default:
- SoftError("Unable to resolve actorat at x=%ld y=%ld which=%ld\n",mapx,mapy,a->which);
+ SoftError("Unable to resolve actorat at x=%d y=%d which=%d\n",mapx,mapy,a->which);
break;
}
}
@@ -729,7 +743,7 @@
*(buf)=egacolor[MAP_SPRITECOLOR];
break;
default:
- SoftError("Unable to resolve actorat at x=%ld y=%ld which=%ld\n",mapx,mapy,a->which);
+ SoftError("Unable to resolve actorat at x=%d y=%d which=%d\n",mapx,mapy,a->which);
break;
}
}
Modified: trunk/rott/rt_menu.c
===================================================================
--- trunk/rott/rt_menu.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_menu.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -5107,19 +5107,25 @@
)
{
+#ifdef DOS
extern boolean SOUNDSETUP;
+#endif
SliderMenu( &MUvolume, 254, 0, 33, 81, 225, 8, "block3", MUSIC_SetVolume,
"Music Volume", "Low", "High" );
+#ifdef DOS
if ( SOUNDSETUP )
{
DrawSoundSetupMainMenu();
}
else
{
+#endif
DrawControlMenu();
+#ifdef DOS
}
+#endif
}
@@ -5135,7 +5141,9 @@
)
{
+#ifdef DOS
extern boolean SOUNDSETUP;
+#endif
int oldvolume;
oldvolume = FXvolume;
@@ -5143,14 +5151,18 @@
SliderMenu( &FXvolume, 254, 0, 33, 81, 225, 8, "block3", FX_SetVolume,
"Sound Volume", "Low", "High" );
+#ifdef DOS
if ( SOUNDSETUP )
{
DrawSoundSetupMainMenu();
}
else
{
+#endif
DrawControlMenu();
+#ifdef DOS
}
+#endif
}
@@ -8705,6 +8717,7 @@
}
}
+#ifdef DOS
void SS_DrawSBTypeMenu( void );
void SS_SBTypeMenu( void );
void SS_DrawPortMenu( void );
@@ -9454,6 +9467,7 @@
handlewhich = -1;
}
+#endif
//******************************************************************************
@@ -9589,6 +9603,8 @@
MN_PlayMenuSnd( SD_ESCPRESSEDSND );
}
+#ifdef DOS
+
//****************************************************************************
//
// DrawSoundSetupMainMenu ()
@@ -10313,3 +10329,4 @@
FlipMenuBuf();
}
+#endif
Modified: trunk/rott/rt_menu.h
===================================================================
--- trunk/rott/rt_menu.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_menu.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -205,7 +205,9 @@
int HandleMultiPageCustomMenu( char **names, int amount, int curpos, char *title, void ( *routine )( int w ), void ( *redrawfunc )( void ), boolean exitonselect );
int CP_LevelSelectionMenu ( void );
int CP_EnterCodeNameMenu ( void );
+#ifdef DOS
void CP_SoundSetup( void );
+#endif
void QuickSaveGame (void);
void UndoQuickSaveGame (void);
void CP_CaptureTheTriadError( void );
Modified: trunk/rott/rt_net.c
===================================================================
--- trunk/rott/rt_net.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_net.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -505,7 +505,7 @@
if (modemgame==true)
{
controlupdatetime=controlsynctime+(VBLCOUNTER*2);
- SoftError("Controls started at %ld\n",controlupdatetime);
+ SoftError("Controls started at %d\n",controlupdatetime);
}
else if (demoplayback || demorecord)
{
@@ -1084,7 +1084,7 @@
size=sizeof(MoveType)+sizeof(COM_SoundType);
break;
default:
- Error("Unhandled packet type in GetPacketSize type=%ld",((MoveType *)pkt)->type);
+ Error("Unhandled packet type in GetPacketSize type=%d",((MoveType *)pkt)->type);
break;
}
@@ -1217,7 +1217,7 @@
if (pkt->time!=time)
{
- Error( "CLIENT: Could not find packet to resend\ntime=%ld packettime=%ld controlupdatetime=%ld\n",
+ Error( "CLIENT: Could not find packet to resend\ntime=%d packettime=%d controlupdatetime=%d\n",
time, pkt->time, controlupdatetime);
}
else
@@ -1291,7 +1291,7 @@
if (serverpkt->time!=time)
{
- Error( "SERVER: Could not find packet to resend\ntime=%ld packettime=%ld serverupdatetime=%ld\n",
+ Error( "SERVER: Could not find packet to resend\ntime=%d packettime=%d serverupdatetime=%d\n",
time, serverpkt->time,serverupdatetime);
}
else
@@ -1362,18 +1362,18 @@
request=(COM_RequestType * )pkt;
time=request->time;
- ComError( "RESEND request received at %ld\n packet time=%ld dest=%ld numpackets=%ld\n",
+ ComError( "RESEND request received at %d\n packet time=%d dest=%d numpackets=%d\n",
GetTicCount(), time, dest, request->numpackets);
if (IsServer==true)
{
if ((dest==server) && (standalone==false))
Error("Trying to resend packets to client on top of server\n");
- ComError( "RESEND SERVER serverupdatetime=%ld\n",serverupdatetime);
+ ComError( "RESEND SERVER serverupdatetime=%d\n",serverupdatetime);
if (IsServerCommandReady ( time ) == true)
ResendServerPackets(time,dest,request->numpackets);
else
- ComError( "RESEND SERVER time=%ld is not ready\n",time);
+ ComError( "RESEND SERVER time=%d is not ready\n",time);
}
else
{
@@ -1396,7 +1396,7 @@
fix=(COM_FixupType *)pkt;
- ComError( "Fixup received at %ld, time=%ld numpackets=%ld\n", GetTicCount(), fix->time, fix->numpackets);
+ ComError( "Fixup received at %d, time=%d numpackets=%d\n", GetTicCount(), fix->time, fix->numpackets);
#if 0
if (networkgame==false)
FixingPackets=false;
@@ -1413,7 +1413,7 @@
{
if (ClientCommandStatus(src, time)!=cs_fixing)
{
- ComError("Server Received fixup with no bad packet time=%ld from %ld\n",time,src);
+ ComError("Server Received fixup with no bad packet time=%d from %d\n",time,src);
}
else
{
@@ -1425,7 +1425,7 @@
{
if (ServerCommandStatus(time)!=cs_fixing)
{
- ComError("Client Received fixup with no bad packet time=%ld from %ld\n",time,src);
+ ComError("Client Received fixup with no bad packet time=%d from %d\n",time,src);
}
else
{
@@ -1473,7 +1473,7 @@
}
if (oldpolltime>lastsynccheck)
{
- Error("Missed a player sync check time=%ld\n",oldpolltime);
+ Error("Missed a player sync check time=%d\n",oldpolltime);
}
}
}
@@ -1513,40 +1513,40 @@
}
if (sync->randomindex!=PlayerSync[0].randomindex)
{
- Error("Player %ld is unsynced localindex=%ld remoteindex=%ld\n"
- "Unsynced Player x=%x y=%x a=%ld z=%ld name=%s\n",
+ Error("Player %d is unsynced localindex=%d remoteindex=%d\n"
+ "Unsynced Player x=%x y=%x a=%d z=%d name=%s\n",
src, PlayerSync[0].randomindex, sync->randomindex,
PlayerSync[src].x, PlayerSync[src].y, PlayerSync[src].angle,
PlayerSync[src].z,PLAYERSTATE[src].codename);
}
if (sync->x!=PlayerSync[src].x)
{
- Error("Player %ld is unsynced local x=%ld remote x=%ld\n"
- "Unsynced Player x=%x y=%x a=%ld z=%ld name=%s\n",
+ Error("Player %d is unsynced local x=%d remote x=%d\n"
+ "Unsynced Player x=%x y=%x a=%d z=%d name=%s\n",
src,PlayerSync[src].x,sync->x,
PlayerSync[src].x, PlayerSync[src].y, PlayerSync[src].angle,
PlayerSync[src].z,PLAYERSTATE[src].codename);
}
if (sync->y!=PlayerSync[src].y)
{
- Error("Player %ld is unsynced local y=%ld remote y=%ld\n"
- "Unsynced Player x=%x y=%x a=%ld z=%ld name=%s\n",
+ Error("Player %d is unsynced local y=%d remote y=%d\n"
+ "Unsynced Player x=%x y=%x a=%d z=%d name=%s\n",
src,PlayerSync[src].y,sync->y,
PlayerSync[src].x, PlayerSync[src].y, PlayerSync[src].angle,
PlayerSync[src].z,PLAYERSTATE[src].codename);
}
if (sync->z!=PlayerSync[src].z)
{
- Error("Player %ld is unsynced local z=%ld remote z=%ld\n"
- "Unsynced Player x=%x y=%x a=%ld z=%ld name=%s\n",
+ Error("Player %d is unsynced local z=%d remote z=%d\n"
+ "Unsynced Player x=%x y=%x a=%d z=%d name=%s\n",
src,PlayerSync[src].z,sync->z,
PlayerSync[src].x, PlayerSync[src].y, PlayerSync[src].angle,
PlayerSync[src].z,PLAYERSTATE[src].codename);
}
if (sync->angle!=PlayerSync[src].angle)
{
- Error("Player %ld is unsynced local angle=%ld remote angle=%ld\n"
- "Unsynced Player x=%x y=%x a=%ld z=%ld name=%s\n",
+ Error("Player %d is unsynced local angle=%d remote angle=%d\n"
+ "Unsynced Player x=%x y=%x a=%d z=%d name=%s\n",
src,PlayerSync[src].angle,sync->angle,
PlayerSync[src].x, PlayerSync[src].y, PlayerSync[src].angle,
PlayerSync[src].z,PLAYERSTATE[src].codename);
@@ -1773,7 +1773,7 @@
break;
default:
- Error("ProcessPacket: Unknown packet type=%ld\n",((MoveType *)pkt)->type);
+ Error("ProcessPacket: Unknown packet type=%d\n",((MoveType *)pkt)->type);
}
}
@@ -1836,7 +1836,7 @@
if (src!=server)
{
- Error("Received server packet from non-server src=%ld\n",src);
+ Error("Received server packet from non-server src=%d\n",src);
}
serverpkt=(COM_ServerHeaderType *)pkt;
@@ -1855,7 +1855,7 @@
{
RequestPacket ( LastCommandTime[src] , src , numpackets );
- ComError("AddServerPacket: Request packet time=%ld lct=%ld numpackets=%ld\n",
+ ComError("AddServerPacket: Request packet time=%d lct=%d numpackets=%d\n",
serverpkt->time, LastCommandTime[src], numpackets
);
}
@@ -1901,7 +1901,7 @@
ProcessSoundAndDeltaPacket(packet, src);
break;
default:
- Error("AddClientPacket: Unknown packet type = %ld\n",packet->type);
+ Error("AddClientPacket: Unknown packet type = %d\n",packet->type);
}
}
@@ -1970,7 +1970,7 @@
{
RequestPacket ( LastCommandTime[src] , src , numpackets );
- ComError("AddPacket: Request packet time=%ld lct=%ld numpackets=%ld\n",
+ ComError("AddPacket: Request packet time=%d lct=%d numpackets=%d\n",
packet->time, LastCommandTime[src], numpackets
);
}
@@ -2569,7 +2569,7 @@
{
ProcessPlayerCommand (num);
if (demoplayback||demorecord) {
- SoftError("x=%4lx y=%4lx a=%4lx time=%5ld\n",player->x,player->y,player->angle,oldpolltime);
+ SoftError("x=%4x y=%4x a=%4x time=%5d\n",player->x,player->y,player->angle,oldpolltime);
}
break;
}
@@ -2588,7 +2588,7 @@
if (GetTicCount()>savetime)
{
- SoftError("Client timeout oldpolltime=%ld\n",oldpolltime);
+ SoftError("Client timeout oldpolltime=%d\n",oldpolltime);
if (IsServer==false)
RequestPacket(oldpolltime, server, controldivisor);
if (networkgame==true)
@@ -2687,7 +2687,7 @@
pstate->topspeed=MaxSpeedForCharacter(pstate);
if (demoplayback||demorecord) {
- SoftError(" dmx=%4lx dmy=%4lx da=%4lx time=%5ld\n",pstate->dmomx,pstate->dmomy,pstate->angle>>11,oldpolltime);
+ SoftError(" dmx=%4x dmy=%4x da=%4x time=%5d\n",pstate->dmomx,pstate->dmomy,pstate->angle>>11,oldpolltime);
}
#if 0
#if (DEVELOPMENT == 1)
@@ -3260,7 +3260,7 @@
{
DemoType * dtime;
- SoftError("Demo command recorded at %ld\n",controlupdatetime);
+ SoftError("Demo command recorded at %d\n",controlupdatetime);
dtime=(DemoType *)demoptr;
dtime->time = controlupdatetime;
dtime->momx = (controlbuf[0]>>1);
@@ -3287,7 +3287,7 @@
// get info from demo buffer
//
- SoftError("Demo command played at %ld\n",controlupdatetime);
+ SoftError("Demo command played at %d\n",controlupdatetime);
if (demoplayback==true)
{
dtime=(DemoType *)demoptr;
Modified: trunk/rott/rt_playr.c
===================================================================
--- trunk/rott/rt_playr.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_playr.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -614,7 +614,7 @@
if ((x<=0) || (y<=0))
{
- SoftError("SpawnGunSmoke: xy below angle=%ld\n",angle);
+ SoftError("SpawnGunSmoke: xy below angle=%d\n",angle);
return;
}
@@ -692,7 +692,7 @@
NewState(new,&s_bloodspurt1);
if ((new->x<=0) || (new->y<=0))
- Error("SpawnBlood: bad x,y obj->obclass=%ld\n",ob->obclass);
+ Error("SpawnBlood: bad x,y obj->obclass=%d\n",ob->obclass);
}
void SpawnMetalSparks(objtype * ob, int angle)
@@ -722,7 +722,7 @@
else
SD_PlaySoundRTP(SD_RICOCHET3SND,new->x,new->y);
if ((new->x<=0) || (new->y<=0))
- Error("SpawnMetalSparks: bad x,y obj->obclass=%ld\n",ob->obclass);
+ Error("SpawnMetalSparks: bad x,y obj->obclass=%d\n",ob->obclass);
}
/*
Modified: trunk/rott/rt_rand.c
===================================================================
--- trunk/rott/rt_rand.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_rand.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -73,7 +73,7 @@
{
rndindex=i;
//#if (DEVELOPMENT == 1)
- SoftError("RNG index set at %ld\n",i);
+ SoftError("RNG index set at %d\n",i);
//#endif
}
@@ -98,7 +98,7 @@
int GameRNG ( char * string, int val )
{
rndindex = (rndindex+1)&(SIZE_OF_RANDOM_TABLE-1);
- SoftError("RNG - num=%3ld called from=%s val=%ld\n",RandomTable[rndindex],string,val);
+ SoftError("RNG - num=%3d called from=%s val=%d\n",RandomTable[rndindex],string,val);
return RandomTable[rndindex];
}
#else
Modified: trunk/rott/rt_scale.c
===================================================================
--- trunk/rott/rt_scale.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_scale.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -1030,7 +1030,7 @@
shadingtable=colormap+(1<<12);
centeryclipped=y;
xcent=x;
- shape=W_CacheLumpNum(shapenum,PU_CACHE, Cvt_transpatch_t, 1);
+ shape=W_CacheLumpNum(shapenum,PU_CACHE, Cvt_patch_t, 1); // was transpatch, fixed
p=(patch_t *)shape;
tp=(transpatch_t *)shape;
@@ -1324,9 +1324,9 @@
p = (patch_t *)shape;
if (((x-p->leftoffset)<0) || ((x-p->leftoffset+p->width)>iGLOBAL_SCREENWIDTH))
- Error ("DrawNormalSprite: x is out of range x=%ld\n",x-p->leftoffset+p->width);
+ Error ("DrawNormalSprite: x is out of range x=%d\n",x-p->leftoffset+p->width);
if (((y-p->topoffset)<0) || ((y-p->topoffset+p->height)>iGLOBAL_SCREENHEIGHT))
- Error ("DrawNormalSprite: y is out of range y=%ld\n",y-p->topoffset+p->height);
+ Error ("DrawNormalSprite: y is out of range y=%d\n",y-p->topoffset+p->height);
startx=x-p->leftoffset;
buffer = (byte*)bufferofs+ylookup[y-p->topoffset];
Modified: trunk/rott/rt_sound.c
===================================================================
--- trunk/rott/rt_sound.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_sound.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -66,6 +66,7 @@
static int remotestart;
static boolean SoundsRemapped = false;
+#ifdef DOS
int musicnums[ 11 ] = {
-1, UltraSound, SoundBlaster, SoundMan16, ProAudioSpectrum,
Awe32, SoundScape, WaveBlaster, GenMidi, SoundCanvas, Adlib
@@ -75,8 +76,19 @@
-1, UltraSound, SoundBlaster, SoundMan16, ProAudioSpectrum,
Awe32, SoundScape, Adlib, SoundSource, TandySoundSource, PC
};
+#else
+int musicnums[ 11 ] = {
+ -1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
+ };
+int fxnums[ 11 ] = {
+ -1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
+ };
+#endif
+
+#if 0
void MU_SetupGUSInitFile( void );
+#endif
int MUSIC_GetPosition( void ) {
songposition pos;
@@ -127,7 +139,7 @@
if (sounds[sndnum].count>0)
return;
else
- W_CacheLumpNum(SoundNumber(sndnum),PU_CACHE, CvtFixme, 1);
+ W_CacheLumpNum(SoundNumber(sndnum),PU_CACHE, CvtNull, 1);
}
#if 0
@@ -174,6 +186,7 @@
card = fxnums[ FXMode ];
if (card==-1) // Check if it is off
return (0);
+#ifdef DOS
if ( ( card == SoundBlaster ) || ( card == Awe32 ) )
{
extern fx_blaster_config SBSettings;
@@ -183,6 +196,7 @@
}
else
{
+#endif
status=FX_SetupCard( card, &device );
if ( status == FX_Ok )
{
@@ -190,7 +204,9 @@
*numbits=device.MaxSampleBits;
*numchannels=device.MaxChannels;
}
+#ifdef DOS
}
+#endif
return (status);
}
@@ -224,6 +240,7 @@
switch (card)
{
+#ifdef DOS
case UltraSound:
case SoundBlaster:
case SoundMan16:
@@ -231,10 +248,12 @@
case Awe32:
case SoundSource:
case TandySoundSource:
+#endif
case SoundScape:
soundstart=W_GetNumForName("digistrt")+1;
soundtype=fx_digital;
break;
+#ifdef DOS
case Adlib:
soundstart=W_GetNumForName("adstart")+1;
soundtype=fx_muse;
@@ -243,6 +262,7 @@
soundstart=W_GetNumForName("pcstart")+1;
soundtype=fx_muse;
break;
+#endif
default:
Error("FX: Unsupported Card number %d",FXMode);
break;
@@ -843,7 +863,7 @@
if ( SD_SoundOkay ( num ) == false )
return;
- PreCacheLump(SoundNumber(num),PU_CACHESOUNDS+sounds[num].priority);
+ PreCacheLump(SoundNumber(num),PU_CACHESOUNDS+sounds[num].priority,cache_other);
}
//***************************************************************************
@@ -1033,6 +1053,7 @@
if (card==-1) // Check if it is off
return (0);
+#ifdef DOS
if ( ( card == SoundBlaster ) || ( card == Awe32 ) || ( card == WaveBlaster ) )
{
if ( SD_Started == false )
@@ -1053,7 +1074,12 @@
}
status=MUSIC_Init( card, MidiAddress );
+#else
+ /* Not DOS, no address config needed */
+ status=MUSIC_Init( card, 0 );
+#endif
+
if (status != MUSIC_Ok) {
if (bombonerror)
{
@@ -1086,6 +1112,8 @@
MUSIC_Shutdown();
MU_Started=false;
}
+
+#ifdef DOS
//***************************************************************************
//
// MU_SetupGUSInitFile - initialize GUS stuff
@@ -1107,6 +1135,8 @@
}
}
+#endif
+
//***************************************************************************
//
// MU_GetNumForType - returns number of song in rottsongs of specific type
@@ -1152,9 +1182,9 @@
lump = W_GetNumForName(rottsongs[num].lumpname);
size = W_LumpLength(lump);
-
- currentsong=W_CacheLumpNum(lump,PU_STATIC, CvtFixme, 1);
+ currentsong=W_CacheLumpNum(lump,PU_STATIC, CvtNull, 1);
+
#ifdef PLATFORM_DOS
if (rottsongs[num].loopflag == loop_yes)
MUSIC_PlaySong(currentsong,size,MUSIC_LoopSong);
@@ -1184,7 +1214,7 @@
MUSIC_StopSong ();
if (currentsong)
{
- W_CacheLumpName(rottsongs[lastsongnumber].lumpname,PU_CACHE, CvtFixme, 1);
+ W_CacheLumpName(rottsongs[lastsongnumber].lumpname,PU_CACHE, CvtNull, 1);
currentsong=0;
}
}
Modified: trunk/rott/rt_stat.c
===================================================================
--- trunk/rott/rt_stat.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_stat.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -627,12 +627,12 @@
if (DoPanicMapping()==true)
{
- PreCacheLump(aw->basetexture,PU_CACHEWALLS);
+ PreCacheLump(aw->basetexture,PU_CACHEWALLS,cache_pic_t);
}
else
{
for (i=aw->basetexture;i<aw->basetexture+animwallsinfo[which].numanims;i++)
- PreCacheLump(i,PU_CACHEWALLS);
+ PreCacheLump(i,PU_CACHEWALLS,cache_pic_t);
}
}
@@ -846,29 +846,33 @@
int z,start,stop;
int female=0,black=0;
- PreCacheLump(temp->shapenum+shapestart,PU_CACHESPRITES);
+ if (temp->itemnumber != stat_bullethole &&
+ ((temp->itemnumber < stat_touch1) || (temp->itemnumber > stat_touch4)))
+ PreCacheLump(temp->shapenum+shapestart,PU_CACHESPRITES,cache_patch_t);
+ else
+ PreCacheLump(temp->shapenum+shapestart,PU_CACHESPRITES,cache_transpatch_t);
for (z=0;z<temp->numanims;z++)
- PreCacheLump(temp->shapenum+shapestart+z,PU_CACHESPRITES);
+ PreCacheLump(temp->shapenum+shapestart+z,PU_CACHESPRITES,cache_patch_t);
if (temp->flags & FL_ROTATING)
{
for (z=1;z<8;z++)
- PreCacheLump(temp->shapenum+shapestart+z,PU_CACHESPRITES);
+ PreCacheLump(temp->shapenum+shapestart+z,PU_CACHESPRITES,cache_patch_t);
}
if (temp->flags & FL_WOODEN)
{
start = W_GetNumForName("WFRAG1");
stop = W_GetNumForName("WFRAG14");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
}
if (temp->flags & FL_METALLIC)
{
- PreCacheLump(W_GetNumForName("MSHARDS"),PU_CACHESPRITES);
+ PreCacheLump(W_GetNumForName("MSHARDS"),PU_CACHESPRITES,cache_patch_t);
start = W_GetNumForName("ROBODIE1");
stop = W_GetNumForName("ROBODEAD");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
}
female = ((locplayerstate->player == 1) || (locplayerstate->player == 3));
@@ -890,7 +894,7 @@
stop = W_GetNumForName("MPIST13");
}
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
switch (temp->itemnumber)
{
@@ -899,18 +903,18 @@
case stat_pedsilverkey:
case stat_pedironkey:
case stat_pedcrystalkey:
- PreCacheLump(W_GetNumForName("PEDESTA"),PU_CACHESPRITES);
+ PreCacheLump(W_GetNumForName("PEDESTA"),PU_CACHESPRITES,cache_patch_t);
break;
case stat_bat:
start = W_GetNumForName("EXBAT1");
stop = W_GetNumForName("EXBAT7");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_knifestatue:
start = W_GetNumForName("KNIFE1");
stop = W_GetNumForName("KNIFE10");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_twopistol:
if (female)
@@ -928,64 +932,66 @@
start = W_GetNumForName("RMPIST1");
stop = W_GetNumForName("LMPIST3");
}
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_mp40:
start = W_GetNumForName("MP401");
stop = W_GetNumForName("MP403");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_bazooka:
start = W_GetNumForName("BAZOOKA1");
stop = W_GetNumForName("BAZOOKA4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_firebomb:
start = W_GetNumForName("FBOMB1");
stop = W_GetNumForName("FBOMB4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_heatseeker:
start = W_GetNumForName("HSEEK1");
stop = W_GetNumForName("HSEEK4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_drunkmissile:
start = W_GetNumForName("DRUNK1");
stop = W_GetNumForName("DRUNK4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_firewall:
start = W_GetNumForName("FIREW1");
stop = W_GetNumForName("FIREW3");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_splitmissile:
start = W_GetNumForName("SPLIT1");
stop = W_GetNumForName("SPLIT4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_kes:
start = W_GetNumForName("KES1");
stop = W_GetNumForName("KES6");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
case stat_godmode:
start = W_GetNumForName("GODHAND1");
stop = W_GetNumForName("GODHAND8");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
PreCacheGroup(W_GetNumForName("VAPO1"),
- W_GetNumForName("LITSOUL"));
+ W_GetNumForName("LITSOUL"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("GODFIRE1"),
- W_GetNumForName("GODFIRE4"));
+ W_GetNumForName("GODFIRE4"),
+ cache_patch_t);
break;
case stat_dogmode:
start = W_GetNumForName("DOGNOSE1");
stop = W_GetNumForName("DOGPAW4");
- PreCacheGroup(start,stop);
+ PreCacheGroup(start,stop,cache_patch_t);
break;
default:
@@ -1021,7 +1027,7 @@
{
temp = (statobj_t*)Z_LevelMalloc(sizeof(statobj_t),PU_LEVELSTRUCT,NULL);
if (!temp)
- Error("LoadStatics: Failed on allocation of static %ld of %ld",i,stcount);
+ Error("LoadStatics: Failed on allocation of static %d of %d",i,stcount);
memset(temp,0,sizeof(*temp));
memcpy(&(dummy.x),buffer,sizeof(saved_stat_type));
temp->whichstat = statcount++;
@@ -1094,7 +1100,7 @@
else
{
if (z>levelheight)
- Error ("You specified a height of %lx for the %s at tilex=%ld tiley=%ld when\n the level is only %ld high\n",
+ Error ("You specified a height of %x for the %s at tilex=%d tiley=%d when\n the level is only %d high\n",
zoffset,errorstr,tilex,tiley,levelheight);
else
*newz = nominalheight-(z<<6)-(zf<<2);
@@ -1228,7 +1234,7 @@
temp->areanumber = MAPSPOT(tilex,tiley,0)-AREATILE;
temp->linked_to = -1;
if ((temp->areanumber<=0) || (temp->areanumber>NUMAREAS))
- Error ("Sprite at x=%ld y=%ld type=%ld has an illegal areanumber\n",tilex,tiley,mtype);
+ Error ("Sprite at x=%d y=%d type=%d has an illegal areanumber\n",tilex,tiley,mtype);
if ( mtype == stat_mine )
{
temp->z = nominalheight;
@@ -1928,5 +1934,5 @@
new->speed = 0;
new->flags = (FL_NEVERMARK|FL_ABP);
if ((new->x<=0) || (new->y<=0))
- Error("SpawnStaticDamage: bad x,y itemnumber=%ld\n",stat->itemnumber);
+ Error("SpawnStaticDamage: bad x,y itemnumber=%d\n",stat->itemnumber);
}
Modified: trunk/rott/rt_str.c
===================================================================
--- trunk/rott/rt_str.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_str.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -1517,8 +1517,8 @@
dest = origdest;
ch -= 31;
- width = IFont->width[ (unsigned int)ch ];
- source = ( ( byte * )IFont ) + IFont->charofs[ (unsigned int)ch ];
+ width = IFont->width[ (unsigned char)ch ];
+ source = ( ( byte * )IFont ) + IFont->charofs[ (unsigned char)ch ];
mask = 1 << ( px & 3 );
Modified: trunk/rott/rt_str.h
===================================================================
--- trunk/rott/rt_str.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_str.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -78,7 +78,7 @@
void VWB_DrawPropString (const char *string);
void VW_MeasurePropString (const char *string, int *width, int *height);
-void US_MeasureStr (int *width, int *height, const char * s, ...);
+void US_MeasureStr (int *width, int *height, const char * s, ...) __attribute__((format(printf,3,4)));
void VW_DrawPropString (const char *string);
Modified: trunk/rott/rt_ted.c
===================================================================
--- trunk/rott/rt_ted.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_ted.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -258,7 +258,7 @@
=
======================
*/
-void PreCacheLump( int lump, int level )
+void PreCacheLump( int lump, int level, int type ) // added type
{
int i;
@@ -275,7 +275,8 @@
if (cachelist[i].lump==lump)
return;
cachelist[cacheindex].lump=lump;
- cachelist[cacheindex++].cachelevel=level;
+ cachelist[cacheindex].cachelevel=level;
+ cachelist[cacheindex++].type=type;
if (cacheindex==MAXPRECACHE)
Error("MaxPreCache reached\n");
}
@@ -290,7 +291,7 @@
=
======================
*/
-void PreCacheGroup( int start, int end )
+void PreCacheGroup( int start, int end, int type ) // added type
{
int i;
int j;
@@ -319,7 +320,8 @@
if (found==0)
{
cachelist[cacheindex].lump=j;
- cachelist[cacheindex++].cachelevel=PU_CACHEACTORS;
+ cachelist[cacheindex].cachelevel=PU_CACHEACTORS;
+ cachelist[cacheindex++].type=type;
if (cacheindex==MAXPRECACHE)
Error("MaxPreCache reached\n");
@@ -349,7 +351,7 @@
{pstate = &PLAYERSTATE[i];
start=W_GetNumForName("CASSHO11")+(pstate->player*REMOTEOFFSET);
end =W_GetNumForName("CASWDEAD")+(pstate->player*REMOTEOFFSET);
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
}
}
}
@@ -465,10 +467,10 @@
start=W_GetNumForName("OBBOLO1");
end =W_GetNumForName("OBBOLO4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("NET1");
end =W_GetNumForName("NET4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start = SD_OVERP1SEESND;
end = SD_OVERPDIESND;
@@ -543,7 +545,7 @@
start=W_GetNumForName("TEGREN1");
end =W_GetNumForName("TGRENF6");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("TRISHOO1");
end =W_GetNumForName("TRIWDEAD");
//end =W_GetNumForName("TRIUSE28");
@@ -569,7 +571,7 @@
start = W_GetNumForName("MONFIRE1");
end = W_GetNumForName("MONFIRE4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
if (IS_ALTERNATE_ACTOR(new))
@@ -619,7 +621,7 @@
start=W_GetNumForName("MINE1");
end =W_GetNumForName("MINE4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("HSIT1");
end =W_GetNumForName("HDOPE8");
break;
@@ -632,7 +634,7 @@
start=W_GetNumForName("LIGNING1");
end =W_GetNumForName("FSPARK4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("TOMS1");
end =W_GetNumForName("TOHRH8");
break;
@@ -667,7 +669,7 @@
start=W_GetNumForName("GUNEMP1");
end =W_GetNumForName("GUNEMPF8");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("GRISE11");
end =W_GetNumForName("GDEAD2");
break;
@@ -675,7 +677,7 @@
case wallopobj:
start=W_GetNumForName("BSTAR1");
end =W_GetNumForName("BSTAR4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
start=W_GetNumForName("BCRAFT1");
end =W_GetNumForName("BCRAFT16");
break;
@@ -824,7 +826,7 @@
break;
}
if ((start>=0) && (end>=0))
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
}
@@ -862,7 +864,7 @@
// cache in bullet hole graphics
start=W_GetNumForName("BULLETHO");
end=W_GetNumForName("ALTBHO");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_transpatch_t);
// cache in explosions
@@ -871,24 +873,24 @@
{
start=W_GetNumForName("EXPLOS1");
end =W_GetNumForName("EXPLOS20");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
}
else
{
start=W_GetNumForName("EXPLOS1");
end =W_GetNumForName("GREXP25");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
}
// cache in misc player sprites
start=W_GetNumForName("BLOODS1");
end =W_GetNumForName("PLATFRM5");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
// cache in missile smoke
start=W_GetNumForName("MISSMO11");
end =W_GetNumForName("MISSMO14");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
#if (DEVELOPMENT == 1)
// cache in all weapon sounds
@@ -898,26 +900,28 @@
#if (SHAREWARE == 0)
start=W_GetNumForName("KNIFE1");
end =W_GetNumForName("DOGPAW4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
// cache in kinetic sphere
start=W_GetNumForName("KSPHERE1");
end =W_GetNumForName("KSPHERE4");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
#else
start=W_GetNumForName("MPIST11");
end =W_GetNumForName("GODHAND8");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
#endif
// cache in god mode stuff
PreCacheGroup(W_GetNumForName("VAPO1"),
- W_GetNumForName("LITSOUL"));
+ W_GetNumForName("LITSOUL"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("GODFIRE1"),
- W_GetNumForName("GODFIRE4"));
+ W_GetNumForName("GODFIRE4"),
+ cache_patch_t);
#endif
@@ -926,17 +930,17 @@
// cache in rubble
start=W_GetNumForName("RUBBLE1");
end =W_GetNumForName("RUBBLE10");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
// cache in guts
start=W_GetNumForName("GUTS1");
end =W_GetNumForName("GUTS12");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
// cache in player missile
start=W_GetNumForName("BJMISS1");
end =W_GetNumForName("BJMISS16");
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
if (gamestate.violence >= vl_high)
{ // cache in all gibs
@@ -950,7 +954,7 @@
start = W_GetNumForName("PART1");
end = W_GetNumForName("GEYE3");
}
- PreCacheGroup(start,end);
+ PreCacheGroup(start,end,cache_patch_t);
}
}
@@ -1158,13 +1162,6 @@
#define PRECACHELED2Y 12
*/
-#if defined(PLATFORM_MACOSX) || defined(__sparc__)
-#warning "Precaching is disabled. Fix."
-// Precaching confuses the byteswapping code, since we have
-// no simple way of knowing the type of each resource.
- return;
-#endif
-
if (CachingStarted==false)
{
if (loadedgame==false)
@@ -1185,11 +1182,11 @@
total=0;
tempbuf=bufferofs;
- bufferofs=displayofs;
+ bufferofs=page1start; // fixed, was displayofs
ticdelay=CACHETICDELAY;
for (i=1;i<cacheindex;i++)
{
- dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtFixme, 1);
+ dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtForType(cachelist[i].type), 1);
total+=W_LumpLength(cachelist[i].lump);
newheap=Z_UsedHeap();
currentmem=(newheap*MAXLEDS)/maxheapsize;
@@ -1212,6 +1209,7 @@
}
lastmem++;
+ VW_UpdateScreen (); // was missing, fixed
}
currentcache=(i*MAXLEDS)/(cacheindex+1);
while (lastcache<=currentcache)
@@ -1247,6 +1245,7 @@
}
ticdelay=CACHETICDELAY;
}
+ VW_UpdateScreen (); // was missing, fixed
}
}
DisableScreenStretch();//bna++
@@ -1314,7 +1313,7 @@
{
for (i=1;i<cacheindex;i++)
{
- dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtNull, 1);
+ dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtForType(cachelist[i].type), 1);
DoLoadGameAction ();
}
ShutdownPreCache ();
@@ -1323,8 +1322,8 @@
{
OpenMapDebug();
- MapDebug("Map Number %ld\n",gamestate.mapon);
- MapDebug("sizeoflevel=%ld\n",Z_UsedLevelHeap());
+ MapDebug("Map Number %d\n",gamestate.mapon);
+ MapDebug("sizeoflevel=%d\n",Z_UsedLevelHeap());
}
#if (PRECACHETEST == 1)
SoftError("<<<<<<<<<<<<<<<<<<<<<<<Precaching done\n");
@@ -1718,7 +1717,7 @@
void GetAlternateMapInfo (mapfileinfo_t * mapinfo, AlternateInformation *info)
{
if (UL_ChangeDirectory (info->path) == false)
- Error ("ERROR : Can't change to alternate directory %s!\n");
+ Error ("ERROR : Can't change to alternate directory %s!\n", info->path);
GetMapFileInfo (mapinfo, info->file);
@@ -1864,7 +1863,7 @@
if ( close( maphandle ) )
{
- Error( "Error closing Ted file Error #%ld", errno );
+ Error( "Error closing Ted file Error #%d", errno );
}
}
@@ -1945,10 +1944,10 @@
#define InitWall(lump,index,newx,newy) \
{ \
- PreCacheLump(lump,PU_CACHEWALLS); \
- if (W_LumpLength(lump) == 0) \
- Error("%s being used in shareware at %ld %ld", \
- W_GetNameForNum(lump),newx,newy); \
+ PreCacheLump(lump,PU_CACHEWALLS,cache_pic_t); \
+ if (W_LumpLength(lump) == 0) \
+ Error("%s being used in shareware at %d %d",\
+ W_GetNameForNum(lump),newx,newy); \
actorat[newx][newy]= &walls[index]; \
tempwall = (wall_t*)actorat[newx][newy]; \
tempwall->which = WALL; \
@@ -2022,10 +2021,10 @@
if ((tile > 75) && (tile <= 79))
{
lump = tilemap[i][j] = GetLumpForTile(tile);
- PreCacheLump(lump,PU_CACHEWALLS);
- PreCacheLump(elevatorstart+5,PU_CACHEWALLS);
- PreCacheLump(elevatorstart+6,PU_CACHEWALLS);
- PreCacheLump(elevatorstart+7,PU_CACHEWALLS);
+ PreCacheLump(lump,PU_CACHEWALLS,cache_pic_t);
+ PreCacheLump(elevatorstart+5,PU_CACHEWALLS,cache_pic_t);
+ PreCacheLump(elevatorstart+6,PU_CACHEWALLS,cache_pic_t);
+ PreCacheLump(elevatorstart+7,PU_CACHEWALLS,cache_pic_t);
tilemap[i][j]|=0x2000;
if (MAPSPOT(i,j,2)==0)
MAPSPOT(i,j,2)=21;
@@ -2828,7 +2827,7 @@
SpawnMaskedWall(i,j,mw_platform7,MW_ABOVEPASSABLE);
break;
default:
- Error ("Illegal Maskedwall platform value at x=%ld y=%ld\n",i,j);
+ Error ("Illegal Maskedwall platform value at x=%d y=%d\n",i,j);
break;
}
#if 0
@@ -2845,7 +2844,7 @@
#endif
}
else
- Error("You have what appears to be a platform ontop\n a wall at x=%ld y=%ld\n",i,j);
+ Error("You have what appears to be a platform ontop\n a wall at x=%d y=%d\n",i,j);
}
}
}
@@ -2949,7 +2948,7 @@
temp=tilemap[i][j]&0x1fff;
tilemap[i][j] = pwallnum;
if (MAPSPOT(i,j,2))
- Error("You cannot link a pushwall which has no direction associated\n with it at x=%ld y=%ld\n",i,j);
+ Error("You cannot link a pushwall which has no direction associated\n with it at x=%d y=%d\n",i,j);
else
SpawnPushWall(i,j,0,temp,nodir,0);
}
@@ -3010,7 +3009,7 @@
for (i=0;i<pwallnum;i++)
if ( (pwallobjlist[i]->tilex==tx) && (pwallobjlist[i]->tiley==ty))
return i;
- Error ("Could not find a push wall at x=%ld y=%ld\n",tx,ty);
+ Error ("Could not find a push wall at x=%d y=%d\n",tx,ty);
return -1;
}
@@ -3061,7 +3060,7 @@
Link_To_Touchplate(touchx,touchy,ActivatePushWall,NULL,GetPushWallNumber(i,j),0);
}
else
- Error("tried to link a pushwall at x=%ld y=%ld to a non-existent touchplate\n",i,j);
+ Error("tried to link a pushwall at x=%d y=%d to a non-existent touchplate\n",i,j);
}
}
break;
@@ -3071,7 +3070,7 @@
{
if (MAPSPOT(i,j,2))
{
- Error("You shouldn't be linking a nondirectional-push wall at x=%ld y=%ld\n",i,j);
+ Error("You shouldn't be linking a nondirectional-push wall at x=%d y=%d\n",i,j);
}
}
break;
@@ -3096,7 +3095,7 @@
Link_To_Touchplate(touchx,touchy,ActivateMoveWall,NULL,GetPushWallNumber(i,j),0);
}
else
- Error("tried to link a turbomovewall at x=%ld y=%ld to a non-existent touchplate\n",i,j);
+ Error("tried to link a turbomovewall at x=%d y=%d to a non-existent touchplate\n",i,j);
}
}
break;
@@ -3122,7 +3121,7 @@
Link_To_Touchplate(touchx,touchy,ActivateMoveWall,NULL,GetPushWallNumber(i,j),0);
}
else
- Error("tried to link a movewall at x=%ld y=%ld to a non-existent touchplate\n",i,j);
+ Error("tried to link a movewall at x=%d y=%d to a non-existent touchplate\n",i,j);
}
}
break;
@@ -3342,7 +3341,7 @@
for (i=0;i<doornum;i++)
if ( (doorobjlist[i]->tilex==tx) && (doorobjlist[i]->tiley==ty))
return i;
- Error ("Could not find a door at x=%ld y=%ld\n",tx,ty);
+ Error ("Could not find a door at x=%d y=%d\n",tx,ty);
return -1;
}
@@ -3411,7 +3410,7 @@
LinkedOpenDoor, doornumber, 0);
}
else
- Error ("tried to link a door at x=%ld y=%ld to a non-existent touchplate",i,j);
+ Error ("tried to link a door at x=%d y=%d to a non-existent touchplate",i,j);
}
}
}
@@ -3453,7 +3452,7 @@
*y=yy-1;
return;
}
- Error ("Could not find an end time for a clock linked item\nat x=%ld y=%ld\n",*x,*y);
+ Error ("Could not find an end time for a clock linked item\nat x=%d y=%d\n",*x,*y);
}
@@ -3681,7 +3680,7 @@
}
}
else
- Error("tried to link an object at x=%ld y=%ld to a non-existent touchplate supposedly at x=%ld y=%ld",tilex,tiley,touchx,touchy);
+ Error("tried to link an object at x=%d y=%d to a non-existent touchplate supposedly at x=%d y=%d",tilex,tiley,touchx,touchy);
}
if (tilemap[tilex][tiley])
@@ -4114,7 +4113,7 @@
sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
}
else
- Error("tried to link a light at x=%ld y=%ld to a non-existent touchplate",i,j);
+ Error("tried to link a light at x=%d y=%d to a non-existent touchplate",i,j);
}
else
{if (touchindices[touchx][touchy])
@@ -4122,7 +4121,7 @@
sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
}
else
- Error("tried to link a light at x=%ld y=%ld to a non-existent touchplate",i,j);
+ Error("tried to link a light at x=%d y=%d to a non-existent touchplate",i,j);
sprites[i][j]->flags |= FL_LIGHTON;
}
}
@@ -4132,7 +4131,7 @@
sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
}
else
- Error("tried to link a light at x=%ld y=%ld to a non-existent touchplate",i,j);
+ Error("tried to link a light at x=%d y=%d to a non-existent touchplate",i,j);
sprites[i][j]->flags |= FL_LIGHTON;
}
@@ -4164,31 +4163,31 @@
OpenMapDebug();
total=0;
- MapDebug("MAP STATS Map Number %ld\n",gamestate.mapon);
+ MapDebug("MAP STATS Map Number %d\n",gamestate.mapon);
MapDebug("=======================\n");
size=pwallnum*sizeof(pwallobj_t);
total+=size;
- MapDebug("Number of PushWalls : %4ld size = %6ld\n",pwallnum,size);
+ MapDebug("Number of PushWalls : %4d size = %6d\n",pwallnum,size);
size=maskednum*sizeof(maskedwallobj_t);
total+=size;
- MapDebug("Number of MaskedWalls : %4ld size = %6ld\n",maskednum,size);
+ MapDebug("Number of MaskedWalls : %4d size = %6d\n",maskednum,size);
size=doornum*sizeof(doorobj_t);
total+=size;
- MapDebug("Number of Doors : %4ld size = %6ld\n",doornum,size);
+ MapDebug("Number of Doors : %4d size = %6d\n",doornum,size);
size=lasttouch*sizeof(touchplatetype);
total+=size;
- MapDebug("Number of TouchPlates : %4ld size = %6ld\n",lasttouch,size);
+ MapDebug("Number of TouchPlates : %4d size = %6d\n",lasttouch,size);
size=_numelevators*sizeof(elevator_t);
total+=size;
- MapDebug("Number of Elevators : %4ld size = %6ld\n",_numelevators,size);
+ MapDebug("Number of Elevators : %4d size = %6d\n",_numelevators,size);
size=statcount*sizeof(statobj_t);
total+=size;
- MapDebug("Number of Sprites : %4ld size = %6ld\n",statcount,size);
+ MapDebug("Number of Sprites : %4d size = %6d\n",statcount,size);
size=objcount*sizeof(objtype);
total+=size;
- MapDebug("Number of Actors : %4ld size = %6ld\n",objcount,size);
- MapDebug("Number of Clocks : %4ld\n",numclocks);
- MapDebug("\nTotal size of level : %6ld\n",total);
+ MapDebug("Number of Actors : %4d size = %6d\n",objcount,size);
+ MapDebug("Number of Clocks : %4d\n",numclocks);
+ MapDebug("\nTotal size of level : %6d\n",total);
}
@@ -4461,7 +4460,7 @@
OpenMapDebug();
- MapDebug("TILE STATS Map Number %ld\n",gamestate.mapon);
+ MapDebug("TILE STATS Map Number %d\n",gamestate.mapon);
MapDebug("=======================\n\n");
@@ -4500,7 +4499,7 @@
MapDebug("-----------------------\n");
for (i=0;i<1000;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
// Doors
memset(tally,0,sizeof(tally));
@@ -4521,7 +4520,7 @@
MapDebug("-----------------------\n");
for (i=0;i<1000;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
// MaskedWalls
memset(tally,0,sizeof(tally));
@@ -4543,7 +4542,7 @@
MapDebug("-----------------------\n");
for (i=0;i<1000;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
// Platforms
memset(tally,0,sizeof(tally));
MapDebug("=======================\n");
@@ -4563,7 +4562,7 @@
MapDebug("-----------------------\n");
for (i=0;i<1000;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
// Actors
memset(tally,0,sizeof(tally));
@@ -4590,9 +4589,9 @@
hardtotal+=tally[i];
MapDebug("\nLowGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Sneaky Low Guards
easytotal=0;
@@ -4603,9 +4602,9 @@
hardtotal+=tally[i];
MapDebug("\nSneakyLowGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// High Guards
easytotal=0;
@@ -4616,9 +4615,9 @@
hardtotal+=tally[i];
MapDebug("\nHighGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// OverPatrol Guards
easytotal=0;
@@ -4629,9 +4628,9 @@
hardtotal+=tally[i];
MapDebug("\nOverPatrolGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Strike Guards
easytotal=0;
@@ -4642,9 +4641,9 @@
hardtotal+=tally[i];
MapDebug("\nStrikeGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// TriadEnforcer Guards
easytotal=0;
@@ -4655,9 +4654,9 @@
hardtotal+=tally[i];
MapDebug("\nTriadEnforcer Guards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Lightning Guards
easytotal=0;
@@ -4668,9 +4667,9 @@
hardtotal+=tally[i];
MapDebug("\nLightningGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Random Actors
easytotal=0;
@@ -4679,7 +4678,7 @@
easytotal+=tally[i];
MapDebug("\nRandom Actors\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",easytotal);
+ MapDebug(" Total=%4d\n",easytotal);
// Monks
easytotal=0;
@@ -4690,9 +4689,9 @@
hardtotal+=tally[i];
MapDebug("\nMonks\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Fire Monks
easytotal=0;
@@ -4703,9 +4702,9 @@
hardtotal+=tally[i];
MapDebug("\nFire Monks\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Robo Guards
easytotal=0;
@@ -4716,9 +4715,9 @@
hardtotal+=tally[i];
MapDebug("\nRoboGuards\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Ballistikrafts
easytotal=0;
@@ -4729,9 +4728,9 @@
hardtotal+=tally[i];
MapDebug("\nBallistikrafts\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Boulders
easytotal=0;
@@ -4742,8 +4741,8 @@
hardtotal+=tally[i];
MapDebug("\nBoulders\n");
MapDebug("-----------------------\n");
- MapDebug("Boulders=%4ld\n",easytotal);
- MapDebug("BoulderHoles=%4ld\n",hardtotal);
+ MapDebug("Boulders=%4d\n",easytotal);
+ MapDebug("BoulderHoles=%4d\n",hardtotal);
// PushColumns
easytotal=0;
@@ -4760,7 +4759,7 @@
easytotal+=tally[i];
MapDebug("\nPushColumns\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",easytotal);
+ MapDebug(" Total=%4d\n",easytotal);
// Gun Emplacements
easytotal=0;
@@ -4771,9 +4770,9 @@
hardtotal+=tally[i];
MapDebug("\nGun Emplacements\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// 4-way guns
easytotal=0;
@@ -4784,49 +4783,49 @@
hardtotal+=tally[i];
MapDebug("\n4-way guns\n");
MapDebug("-----------------------\n");
- MapDebug("EasyTotal=%4ld\n",easytotal);
- MapDebug("HardTotal=%4ld\n",hardtotal);
- MapDebug(" Total=%4ld\n",easytotal+hardtotal);
+ MapDebug("EasyTotal=%4d\n",easytotal);
+ MapDebug("HardTotal=%4d\n",hardtotal);
+ MapDebug(" Total=%4d\n",easytotal+hardtotal);
// Stabbers from above
MapDebug("\nStabbers from above\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[412]);
+ MapDebug(" Total=%4d\n",tally[412]);
// Stabbers from below
MapDebug("\nStabbers from below\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[430]);
+ MapDebug(" Total=%4d\n",tally[430]);
// Crushing pillar from above
MapDebug("\nCrushing pillar from above\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[413]);
+ MapDebug(" Total=%4d\n",tally[413]);
// Crushing pillar from below
MapDebug("\nCrushing pillar from below\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[431]);
+ MapDebug(" Total=%4d\n",tally[431]);
// Above Spinner
MapDebug("\nAbove Spinner\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[156]);
+ MapDebug(" Total=%4d\n",tally[156]);
// Ground Spinner
MapDebug("\nGround Spinner\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[174]);
+ MapDebug(" Total=%4d\n",tally[174]);
// Spinner from above
MapDebug("\nSpinner from above\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[157]);
+ MapDebug(" Total=%4d\n",tally[157]);
// Spinner from below
MapDebug("\nSpinner from below\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[175]);
+ MapDebug(" Total=%4d\n",tally[175]);
// Bosses
easytotal=0;
@@ -4834,12 +4833,12 @@
easytotal+=tally[i];
MapDebug("\nBosses\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",easytotal);
+ MapDebug(" Total=%4d\n",easytotal);
// Spring Boards
MapDebug("\nSpring Boards\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",tally[193]);
+ MapDebug(" Total=%4d\n",tally[193]);
// Above FlameJets
easytotal=0;
@@ -4850,8 +4849,8 @@
hardtotal+=tally[i];
MapDebug("\nFlameJets\n");
MapDebug("-----------------------\n");
- MapDebug(" Above=%4ld\n",easytotal);
- MapDebug(" Ground=%4ld\n",hardtotal);
+ MapDebug(" Above=%4d\n",easytotal);
+ MapDebug(" Ground=%4d\n",hardtotal);
// Fire Chutes
easytotal=0;
@@ -4859,7 +4858,7 @@
easytotal+=tally[i];
MapDebug("\nFireChutes\n");
MapDebug("-----------------------\n");
- MapDebug(" Total=%4ld\n",easytotal);
+ MapDebug(" Total=%4d\n",easytotal);
// Sprites
MapDebug("=======================\n");
@@ -4869,22 +4868,22 @@
MapDebug("-----------------------\n");
for (i=1;i<=72;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
for (i=210;i<=210;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
for (i=228;i<=233;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
for (i=246;i<=255;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
for (i=260;i<=273;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
for (i=282;i<=284;i++)
if (tally[i]!=0)
- MapDebug(" %4ld %4ld\n",i,tally[i]);
+ MapDebug(" %4d %4d\n",i,tally[i]);
}
//***************************************************************************
@@ -5805,7 +5804,7 @@
nominalheight = maxheight-32;
}
else
- Error("You must specify a valid height sprite icon at (2,0) on map %ld\n",gamestate.mapon);
+ Error("You must specify a valid height sprite icon at (2,0) on map %d\n",gamestate.mapon);
/*
if ( ( BATTLEMODE ) && ( !gamestate.BattleOptions.SpawnDangers ) )
@@ -6630,7 +6629,8 @@
PreCacheGroup(W_GetNumForName("EXBAT1"),
- W_GetNumForName("EXBAT7"));
+ W_GetNumForName("EXBAT7"),
+ cache_patch_t);
@@ -6640,9 +6640,11 @@
break;
case 47:
PreCacheGroup(W_GetNumForName("KNIFE1"),
- W_GetNumForName("KNIFE10"));
+ W_GetNumForName("KNIFE10"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("ESTATUE1"),
- W_GetNumForName("ESTATUE8"));
+ W_GetNumForName("ESTATUE8"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
break;
@@ -6652,15 +6654,18 @@
if ((locplayerstate->player == 1) || (locplayerstate->player == 3))
PreCacheGroup(W_GetNumForName("RFPIST1"),
- W_GetNumForName("LFPIST3"));
+ W_GetNumForName("LFPIST3"),
+ cache_patch_t);
else if (locplayerstate->player == 2)
PreCacheGroup(W_GetNumForName("RBMPIST1"),
- W_GetNumForName("LBMPIST3"));
+ W_GetNumForName("LBMPIST3"),
+ cache_patch_t);
else
PreCacheGroup(W_GetNumForName("RMPIST1"),
- W_GetNumForName("LMPIST3"));
+ W_GetNumForName("LMPIST3"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
@@ -6669,7 +6674,8 @@
SD_PreCacheSound(SD_ATKMP40SND);
PreCacheGroup(W_GetNumForName("MP401"),
- W_GetNumForName("MP403"));
+ W_GetNumForName("MP403"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
break;
@@ -6678,7 +6684,8 @@
SD_PreCacheSound(SD_MISSILEFLYSND);
SD_PreCacheSound(SD_BAZOOKAFIRESND);
PreCacheGroup(W_GetNumForName("BAZOOKA1"),
- W_GetNumForName("BAZOOKA4"));
+ W_GetNumForName("BAZOOKA4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6690,7 +6697,8 @@
SD_PreCacheSound(SD_MISSILEFLYSND);
SD_PreCacheSound(SD_FIREBOMBFIRESND);
PreCacheGroup(W_GetNumForName("FBOMB1"),
- W_GetNumForName("FBOMB4"));
+ W_GetNumForName("FBOMB4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6700,7 +6708,8 @@
SD_PreCacheSound(SD_MISSILEFLYSND);
SD_PreCacheSound(SD_HEATSEEKFIRESND);
PreCacheGroup(W_GetNumForName("HSEEK1"),
- W_GetNumForName("HSEEK4"));
+ W_GetNumForName("HSEEK4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6710,7 +6719,8 @@
SD_PreCacheSound(SD_MISSILEFLYSND);
SD_PreCacheSound(SD_DRUNKFIRESND);
PreCacheGroup(W_GetNumForName("DRUNK1"),
- W_GetNumForName("DRUNK4"));
+ W_GetNumForName("DRUNK4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6721,11 +6731,14 @@
SD_PreCacheSound(SD_FLAMEWALLFIRESND);
SD_PreCacheSound(SD_FLAMEWALLSND);
PreCacheGroup(W_GetNumForName("FIREW1"),
- W_GetNumForName("FIREW3"));
+ W_GetNumForName("FIREW3"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("FWALL1"),
- W_GetNumForName("FWALL15"));
+ W_GetNumForName("FWALL15"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("SKEL1"),
- W_GetNumForName("SKEL48"));
+ W_GetNumForName("SKEL48"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6739,7 +6752,8 @@
SD_PreCacheSound(SD_SPLITFIRESND);
SD_PreCacheSound(SD_SPLITSND);
PreCacheGroup(W_GetNumForName("SPLIT1"),
- W_GetNumForName("SPLIT4"));
+ W_GetNumForName("SPLIT4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6757,9 +6771,11 @@
SD_PreCacheSound(SD_GRAVBUILDSND);
PreCacheGroup(W_GetNumForName("KES1"),
- W_GetNumForName("KES6"));
+ W_GetNumForName("KES6"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("KSPHERE1"),
- W_GetNumForName("KSPHERE4"));
+ W_GetNumForName("KSPHERE4"),
+ cache_patch_t);
SpawnStatic(i,j,tile-23,spawnz);
if (loadedgame == false)
gamestate.missiletotal ++;
@@ -6859,13 +6875,16 @@
PreCacheGroup(W_GetNumForName("GODHAND1"),
- W_GetNumForName("GODHAND8"));
+ W_GetNumForName("GODHAND8"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("VAPO1"),
- W_GetNumForName("LITSOUL"));
+ W_GetNumForName("LITSOUL"),
+ cache_patch_t);
PreCacheGroup(W_GetNumForName("GODFIRE1"),
- W_GetNumForName("GODFIRE4"));
+ W_GetNumForName("GODFIRE4"),
+ cache_patch_t);
SpawnStatic(i,j,stat_godmode,spawnz);
if (loadedgame == false)
@@ -6875,7 +6894,7 @@
case 253:
#if (SHAREWARE == 1)
- Error("DogMode Power up in shareware at x=%ld y=%ld\n",i,j);
+ Error("DogMode Power up in shareware at x=%d y=%d\n",i,j);
#endif
SD_PreCacheSoundGroup(SD_DOGMODEPANTSND,SD_DOGMODELICKSND);
@@ -6887,7 +6906,8 @@
PreCacheGroup(W_GetNumForName("DOGNOSE1"),
- W_GetNumForName("DOGPAW4"));
+ W_GetNumForName("DOGPAW4"),
+ cache_patch_t);
SpawnStatic(i,j,stat_dogmode,spawnz);
if (loadedgame == false)
gamestate.supertotal ++;
@@ -6998,7 +7018,7 @@
else if (ActorIsSpring(x+(dx*count),y+(dy*count)))
d=0;
else
- Error("Cannot find a spring board around a ramp ascension near x=%ld y=%ld\n",x,y);
+ Error("Cannot find a spring board around a ramp ascension near x=%d y=%d\n",x,y);
hc=((maxheight+20)<<16)/(count+1);
h=hc<<1;
@@ -7030,7 +7050,7 @@
while (StaticUndefined(x+count,y))
count++;
if (count<3)
- Error ("Are You kidding me? You are trying to loft <3 sprites in an arc??? \n x=%ld y=%ld\n",x,y);
+ Error ("Are You kidding me? You are trying to loft <3 sprites in an arc??? \n x=%d y=%d\n",x,y);
RaiseSprites(x,y,count,1);
}
else if (StaticUndefined(x,y+1))
@@ -7039,11 +7059,11 @@
while (StaticUndefined(x,y+count))
count++;
if (count<3)
- Error ("Are You kidding me? You are trying to loft <3 sprites??? \n x=%ld y=%ld\n",x,y);
+ Error ("Are You kidding me? You are trying to loft <3 sprites??? \n x=%d y=%d\n",x,y);
RaiseSprites(x,y,count,0);
}
else
- Error ("Sprite Lofter is confused around x=%ld y=%ld\n",x,y);
+ Error ("Sprite Lofter is confused around x=%d y=%d\n",x,y);
}
}
}
Modified: trunk/rott/rt_ted.h
===================================================================
--- trunk/rott/rt_ted.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_ted.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -138,12 +138,12 @@
extern char LevelName[80];
extern boolean ISRTL;
-void PreCacheGroup(int,int);
+void PreCacheGroup(int,int,int); // added type
void AssignTeams(void);
void LoadTedMap( const char *extension, int mapnum );
void SetupGameLevel(void);
void ScanInfoPlane(void);
-void PreCacheLump( int lump, int level );
+void PreCacheLump( int lump, int level, int type ); // added type
void SetupGameLevelAgain (void);
void ScanInfoPlaneAgain (void);
void PreCacheActor( int actor, int which );
Modified: trunk/rott/rt_util.c
===================================================================
--- trunk/rott/rt_util.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_util.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -333,7 +333,7 @@
inerror++;
if (inerror > 1)
- return;
+ abort();
SetTextMode ();
@@ -435,13 +435,14 @@
}
close(handle);
-#endif
if ( SOUNDSETUP )
{
getch();
}
+#endif
+
#if USE_SDL
SDL_Quit();
#endif
Modified: trunk/rott/rt_util.h
===================================================================
--- trunk/rott/rt_util.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_util.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -44,7 +44,7 @@
void GetPalette(char * pal);
void ClearGraphicsScreen( void );
void ClearBuffer( char * buf, int size );
-void Error (char *error, ...);
+void Error (char *error, ...) __attribute__((noreturn,format(printf,1,2)));
void StartupSoftError ( void );
void ShutdownSoftError ( void );
int CheckParm (char *check);
@@ -88,7 +88,7 @@
void VL_GetPalette (byte *palette);
void UL_printf (byte *str);
void VL_NormalizePalette (byte *palette);
-void MapDebug (char *error, ...);
+void MapDebug (char *error, ...) __attribute__((format(printf,1,2)));
void OpenMapDebug ( void );
void UL_ColorBox (int x, int y, int w, int h, int color);
@@ -149,11 +149,11 @@
#if (SOFTERROR==1)
-void SoftwareError (char *error, ...);
+void SoftwareError (char *error, ...) __attribute__((format(printf,1,2)));
#define SoftError SoftwareError
#else
-void SoftwareError (char *error, ...);
+void SoftwareError (char *error, ...) __attribute__((format(printf,1,2)));
//#define SoftError SoftwareError
#define SoftError if (1) {} else SoftwareError
@@ -164,12 +164,12 @@
#if (DEBUG==1)
-void DebugError (char *error, ...);
+void DebugError (char *error, ...) __attribute__((format(printf,1,2)));
#define Debug DebugError
#else
-void DebugError (char *error, ...);
+void DebugError (char *error, ...) __attribute__((format(printf,1,2)));
#define Debug DebugError
//#define Debug
Modified: trunk/rott/rt_view.c
===================================================================
--- trunk/rott/rt_view.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/rt_view.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -248,7 +248,7 @@
//Hey, isn't this stuff already loaded in?
//Why don't we make this a lump?
- table=W_CacheLumpName("tables",PU_STATIC, CvtFixme, 1);
+ table=W_CacheLumpName("tables",PU_STATIC, CvtNull, 1);
ptr=table;
//
@@ -271,7 +271,7 @@
pixelangle[centerx+i] =(short) -intang;
frac+=(length*65536/centerx);
}
- table=W_CacheLumpName("tables",PU_CACHE, CvtFixme, 1);
+ table=W_CacheLumpName("tables",PU_CACHE, CvtNull, 1);
SafeFree(pangle);
}
@@ -580,7 +580,7 @@
if (((word)MAPSPOT(2,0,1)>=104) && ((word)MAPSPOT(2,0,1)<=105))
fog=(word)MAPSPOT(2,0,1)-104;
else
- Error ("There is no Fog icon on map %ld\n",gamestate.mapon);
+ Error ("There is no Fog icon on map %d\n",gamestate.mapon);
if ((word)MAPSPOT(3,0,1)==139)
{
if (fog==0)
@@ -590,14 +590,14 @@
memset (lights,0,MAPSIZE*MAPSIZE*(sizeof(unsigned long)));
}
else
- Error("You cannot use light sourcing on a level with fog on map %ld\n",gamestate.mapon);
+ Error("You cannot use light sourcing on a level with fog on map %d\n",gamestate.mapon);
}
else if ((word)MAPSPOT(3,0,1))
- Error("You must use the lightsource icon or nothing at all at (3,0) in plane 1 on map %ld\n",gamestate.mapon);
+ Error("You must use the lightsource icon or nothing at all at (3,0) in plane 1 on map %d\n",gamestate.mapon);
if (((word)MAPSPOT(2,0,0)>=LIGHTLEVELBASE) && ((word)MAPSPOT(2,0,0)<=LIGHTLEVELEND))
glevel=(MAPSPOT(2,0,0)-LIGHTLEVELBASE);
else
- Error("You must specify a valid darkness level icon at (2,0) on map %ld\n",gamestate.mapon);
+ Error("You must specify a valid darkness level icon at (2,0) on map %d\n",gamestate.mapon);
SetLightLevels ( glevel );
Modified: trunk/rott/sndcards.h
===================================================================
--- trunk/rott/sndcards.h 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/sndcards.h 2008-05-24 06:34:55 UTC (rev 230)
@@ -38,6 +38,7 @@
{
// ASS_NoSound,
SoundBlaster,
+#ifdef DOS
ProAudioSpectrum,
SoundMan16,
Adlib,
@@ -45,11 +46,14 @@
SoundCanvas,
Awe32,
WaveBlaster,
+#endif
SoundScape,
UltraSound,
+#ifdef DOS
SoundSource,
TandySoundSource,
PC,
+#endif
NumSoundCards
} soundcardnames;
Modified: trunk/rott/w_wad.c
===================================================================
--- trunk/rott/w_wad.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/w_wad.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -242,7 +242,7 @@
//
lumpcache = calloc (numlumps, sizeof(*lumpcache));
if (!lumpcache)
- Error("W_InitFiles: lumpcache malloc failed size=%ld\n",numlumps<<2);
+ Error("W_InitFiles: lumpcache malloc failed size=%d\n",numlumps<<2);
if (!quiet)
printf("W_Wad: Wad Manager Started NUMLUMPS=%ld\n",(long int)numlumps);
@@ -250,7 +250,9 @@
lumpcheck=SafeMalloc(numlumps);
memset(lumpcheck,255,numlumps);
#endif
+#ifdef DOS
if (!SOUNDSETUP)
+#endif
W_CheckWADIntegrity ();
}
@@ -495,7 +497,7 @@
#else
Z_Malloc (W_LumpLength (lump), tag, &lumpcache[lump]);
W_ReadLump (lump, lumpcache[lump]);
- Debug("Invoking endian converter on %p, %i records\n", lump, numrec);
+ Debug("Invoking endian converter on %p, %i records\n", lumpcache[lump], numrec);
converter(lumpcache[lump], numrec);
#endif
}
Modified: trunk/rott/z_zone.c
===================================================================
--- trunk/rott/z_zone.c 2008-05-24 06:34:21 UTC (rev 229)
+++ trunk/rott/z_zone.c 2008-05-24 06:34:55 UTC (rev 230)
@@ -122,7 +122,7 @@
header = malloc (size+sizeof(memzone_t));
if (!header)
- Error ("Z_AllocateZone: Couldn't malloc %i bytes avail=%ld\n",
+ Error ("Z_AllocateZone: Couldn't malloc %zd bytes avail=%d\n",
size+sizeof(memzone_t), Z_AvailHeap());
header->size = size;
Z_ClearZone (header);
@@ -542,7 +542,7 @@
SoftError("ERROR: two consecutive free blocks\n");
}
}
- SoftError("Total Size of blocks = %ld\n",totalsize);
+ SoftError("Total Size of blocks = %d\n",totalsize);
SoftError("LEVEL ZONE\n");
SoftError("zone size: %i location: %p\n",levelzone->size,levelzone);
@@ -571,7 +571,7 @@
SoftError("ERROR: two consecutive free blocks\n");
}
}
- SoftError("Total Size of blocks = %ld\n",totalsize);
+ SoftError("Total Size of blocks = %d\n",totalsize);
}
More information about the rott-commits
mailing list