- removed unused code. (MDA screen hack - huh???)

- Shadow Warrior updates from SWP.
This commit is contained in:
Christoph Oelckers 2019-11-17 18:02:17 +01:00
parent dc60c7f72e
commit 557bd201fb
37 changed files with 657 additions and 1012 deletions

View file

@ -64,7 +64,6 @@ set( PCH_SOURCES
src/lava.cpp src/lava.cpp
src/light.cpp src/light.cpp
src/mclip.cpp src/mclip.cpp
src/mdastr.cpp
src/menus.cpp src/menus.cpp
src/miscactr.cpp src/miscactr.cpp
src/morph.cpp src/morph.cpp
@ -102,6 +101,7 @@ set( PCH_SOURCES
src/weapon.cpp src/weapon.cpp
src/zilla.cpp src/zilla.cpp
src/zombie.cpp src/zombie.cpp
src/swcvar.cpp
) )

View file

@ -25,6 +25,10 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" #include "ns.h"
// Added Ninja Sliced fix
// Fixed Ninja sliced dead and rotation
// Added s_NinjaDieSlicedHack[]
//
#include "build.h" #include "build.h"
@ -36,6 +40,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "weapon.h" #include "weapon.h"
#include "sprite.h" #include "sprite.h"
#include "actor.h" #include "actor.h"
#include "swcvar.h"
BEGIN_SW_NS BEGIN_SW_NS
@ -46,6 +51,7 @@ extern STATE s_DebrisRat[];
extern STATE s_DebrisCrab[]; extern STATE s_DebrisCrab[];
extern STATE s_DebrisStarFish[]; extern STATE s_DebrisStarFish[];
extern STATE s_NinjaDieSliced[]; extern STATE s_NinjaDieSliced[];
extern STATE s_NinjaDieSlicedHack[];
extern STATEp sg_NinjaGrabThroat[]; extern STATEp sg_NinjaGrabThroat[];
@ -141,11 +147,15 @@ DoActorDie(short SpriteNum, short weapon)
if (User[weapon]->WeaponNum != WPN_FIST) if (User[weapon]->WeaponNum != WPN_FIST)
{ {
//SpawnBlood(SpriteNum, SpriteNum, -1, -1, -1, -1); if (sw_ninjahack)
SpawnBlood(SpriteNum, SpriteNum, -1, -1, -1, -1);
InitPlasmaFountain(wp, sp); InitPlasmaFountain(wp, sp);
InitPlasmaFountain(wp, sp); InitPlasmaFountain(wp, sp);
PlaySound(DIGI_NINJAINHALF,&sp->x,&sp->y,&sp->z,v3df_none); PlaySound(DIGI_NINJAINHALF,&sp->x,&sp->y,&sp->z,v3df_none);
ChangeState(SpriteNum, &s_NinjaDieSliced[0]); if (sw_ninjahack)
ChangeState(SpriteNum, &s_NinjaDieSlicedHack[5]);
else
ChangeState(SpriteNum, &s_NinjaDieSliced[0]);
} }
else else
{ {
@ -179,7 +189,8 @@ DoActorDie(short SpriteNum, short weapon)
u->ActorActionFunc = NULL; u->ActorActionFunc = NULL;
//u->ActorActionFunc = NullAnimator; //u->ActorActionFunc = NullAnimator;
sprite[SpriteNum].ang = sprite[weapon].ang; if (!sw_ninjahack)
sprite[SpriteNum].ang = sprite[weapon].ang;
break; break;
case COOLG_RUN_R0: case COOLG_RUN_R0:

View file

@ -24,6 +24,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" #include "ns.h"
// Added improved crosshair accuracy
// Added UsingMenus for fragbar
//
#include "build.h" #include "build.h"
@ -35,9 +38,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "common_game.h" #include "common_game.h"
#include "network.h" #include "network.h"
#include "text.h" #include "text.h"
#include "menus.h"
BEGIN_SW_NS BEGIN_SW_NS
#define BAR_HEIGHT 48 #define BAR_HEIGHT 48
#define XDIM 320 #define XDIM 320
#define YDIM 200 #define YDIM 200
@ -418,8 +424,7 @@ void DrawPanelBorderSides(PLAYERp pp, short x, short y, short x2, short y2, shor
} }
} }
static static void BorderSetView(PLAYERp, int *Xdim, int *Ydim, int *ScreenSize)
void BorderSetView(PLAYERp UNUSED(pp), int *Xdim, int *Ydim, int *ScreenSize)
{ {
int x, x2, y, y2; int x, x2, y, y2;
BORDER_INFO *b; BORDER_INFO *b;
@ -565,7 +570,6 @@ void
SetRedrawScreen(PLAYERp pp) SetRedrawScreen(PLAYERp pp)
{ {
int i, j; int i, j;
//int x, x2, y, y2;
BORDER_INFO *b; BORDER_INFO *b;
if (pp != Player + myconnectindex) if (pp != Player + myconnectindex)

View file

@ -444,15 +444,21 @@ static int CompareBreakInfo(void const * a, void const * b)
return break_info1->picnum - break_info2->picnum; return break_info1->picnum - break_info2->picnum;
} }
int CompareSearchBreakInfo(short *picnum, BREAK_INFOp break_info)
{
// will return a number less than 0 if picnum < break_info->picnum
return(*picnum - break_info->picnum);
}
BREAK_INFOp FindWallBreakInfo(short picnum) BREAK_INFOp FindWallBreakInfo(short picnum)
{ {
return (BREAK_INFOp)bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), CompareBreakInfo); return(BREAK_INFOp)(bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
} }
BREAK_INFOp FindSpriteBreakInfo(short picnum) BREAK_INFOp FindSpriteBreakInfo(short picnum)
{ {
return (BREAK_INFOp)bsearch(&picnum, &SpriteBreakInfo, SIZ(SpriteBreakInfo), sizeof(BREAK_INFO), CompareBreakInfo); return(BREAK_INFOp)(bsearch(&picnum, &SpriteBreakInfo, SIZ(SpriteBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
} }
////////////////////////////////////////////// //////////////////////////////////////////////
// SETUP // SETUP
@ -661,7 +667,7 @@ int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, short ang, short
return TRUE; return TRUE;
} }
SWBOOL UserBreakWall(WALLp wp, short UNUSED(ang)) SWBOOL UserBreakWall(WALLp wp, short)
{ {
short SpriteNum; short SpriteNum;
SPRITEp sp; SPRITEp sp;

View file

@ -23,6 +23,15 @@ Original Source: 1997 - Frank Maddin and Jim Norwood
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// From SWP:
// Added SWKEYS
// Added SWGUN# and SWGOD
// Added SWMEDIC (25%)
// Added Full name key cheats - swbluecard - swgoldkey
// Added swquit
// Added 2 uzi's for swgimme
//
#include "ns.h" #include "ns.h"
#include "build.h" #include "build.h"
@ -45,61 +54,61 @@ char CheatInputString[256];
SWBOOL EveryCheat = FALSE; SWBOOL EveryCheat = FALSE;
SWBOOL ResCheat = FALSE; SWBOOL ResCheat = FALSE;
void ResCheatOn(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) const char *CheatKeyType;
void KeysCheat(PLAYERp pp, const char *cheat_string);
void ResCheatOn(PLAYERp, const char *)
{ {
ResCheat = TRUE; ResCheat = TRUE;
} }
void VoxCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void VoxCheat(PLAYERp, const char *)
{ {
//gs.Voxel ^= 1; //gs.Voxel ^= 1;
} }
void RestartCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void RestartCheat(PLAYERp, const char *)
{ {
ExitLevel = TRUE; ExitLevel = TRUE;
} }
void RoomCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void RoomCheat(PLAYERp, const char *)
{ {
extern SWBOOL FAF_DebugView; extern SWBOOL FAF_DebugView;
FAF_DebugView ^= 1; FAF_DebugView ^= 1;
} }
void SecretCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void SecretCheat(PLAYERp pp, const char *)
{ {
hud_stats = !hud_stats; hud_stats = !hud_stats;
} }
void NextCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void NextCheat(PLAYERp pp, const char *)
{ {
Level++; Level++;
ExitLevel = TRUE; ExitLevel = TRUE;
} }
void PrevCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) void PrevCheat(PLAYERp pp, const char *)
{ {
Level--; Level--;
ExitLevel = TRUE; ExitLevel = TRUE;
} }
static int32_t showallmap; void MapCheat(PLAYERp pp, const char *)
void MapCheat(PLAYERp pp, char *UNUSED(cheat_string))
{ {
showallmap ^= 1; automapping ^= 1;
if (showallmap) if (automapping)
MapSetAll2D(0); MapSetAll2D(0);
else else
MapSetAll2D(0xFF); MapSetAll2D(0xFF);
sprintf(ds, "SHOWALLMAP %s", showallmap ? "ON" : "OFF"); sprintf(ds, "AUTOMAPPING %s", automapping ? "ON" : "OFF" );
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }
void LocCheat(PLAYERp pp, const char *)
void LocCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string))
{ {
extern SWBOOL LocationInfo; extern SWBOOL LocationInfo;
LocationInfo++; LocationInfo++;
@ -107,8 +116,46 @@ void LocCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string))
LocationInfo = 0; LocationInfo = 0;
} }
void GunsCheat(PLAYERp pp, const char *cheat_string)
{
PLAYERp p;
short pnum;
unsigned int i;
short gAmmo[10] = {0,9,12,20,3,6,5,5,10,1};
const char *cp = cheat_string;
const char *str = "GIVEN WEAPON %1d";
int gunnum, x;
USERp u;
void WeaponCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string)) cp += sizeof("swgun")-1;
gunnum = atol(cp);
if (gunnum == 0)
gunnum = 10;
if (gunnum < 2 || gunnum > 10)
return;
TRAVERSE_CONNECT(pnum)
{
p = &Player[pnum];
u = User[p->PlayerSprite];
x = gAmmo[gunnum-1];
if (TEST(p->WpnFlags, BIT(gunnum-1)) == 0)
p->WpnFlags += BIT(gunnum-2) << 1;
else
str = "ADD AMMO TO WEAPON %1d";
p->WpnAmmo[gunnum-1] += x;
if (p->WpnAmmo[gunnum-1] > DamageData[gunnum-1].max_ammo)
{
p->WpnAmmo[gunnum-1] = DamageData[gunnum-1].max_ammo;
str = "";
}
PlayerUpdateWeapon(p, u->WeaponNum);
}
sprintf(ds, str, gunnum);
PutStringInfo(pp, ds);
}
void WeaponCheat(PLAYERp pp, const char *)
{ {
PLAYERp p; PLAYERp p;
short pnum; short pnum;
@ -135,8 +182,7 @@ void WeaponCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string))
} }
} }
void GodCheat(PLAYERp pp, const char *)
void GodCheat(PLAYERp pp, char *UNUSED(cheat_string))
{ {
// //
// GOD mode // GOD mode
@ -147,7 +193,7 @@ void GodCheat(PLAYERp pp, char *UNUSED(cheat_string))
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }
void ClipCheat(PLAYERp pp, char *UNUSED(cheat_string)) void ClipCheat(PLAYERp pp, const char *)
{ {
FLIP(pp->Flags, PF_CLIP_CHEAT); FLIP(pp->Flags, PF_CLIP_CHEAT);
@ -155,9 +201,9 @@ void ClipCheat(PLAYERp pp, char *UNUSED(cheat_string))
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }
void WarpCheat(PLAYERp pp, char *cheat_string) void WarpCheat(PLAYERp pp, const char *cheat_string)
{ {
char *cp = cheat_string; const char *cp = cheat_string;
int episode_num; int episode_num;
int level_num; int level_num;
@ -185,7 +231,7 @@ void WarpCheat(PLAYERp pp, char *cheat_string)
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }
void ItemCheat(PLAYERp pp, char *cheat_string) void ItemCheat(PLAYERp pp, const char *cheat_string)
{ {
// //
// Get all ITEMS // Get all ITEMS
@ -236,7 +282,121 @@ void ItemCheat(PLAYERp pp, char *cheat_string)
PlayerUpdateKeys(pp); PlayerUpdateKeys(pp);
} }
void EveryCheatToggle(PLAYERp pp, char *cheat_string) VOID HealCheat(PLAYERp pp, const char *cheat_string)
{
short pnum;
const char *str = "";
TRAVERSE_CONNECT(pnum)
{
if (User[Player[pnum].PlayerSprite]->Health < pp->MaxHealth)
str = "ADDED HEALTH";
User[Player[pnum].PlayerSprite]->Health += 25;
}
PutStringInfo(pp, str);
}
VOID SortKeyCheat(PLAYERp pp, const char *sKey)
{
const char *sTemp = "";
CheatKeyType = "";
if (Bstrncasecmp(sKey, "swredcard",9) == 0)
{
sTemp = "swkey1";
CheatKeyType = "Red Cardkey";
}
else
if (Bstrncasecmp(sKey, "swbluecard",10) == 0)
{
sTemp = "swkey2";
CheatKeyType = "Blue Cardkey";
}
else
if (Bstrncasecmp(sKey, "swgreencard",11) == 0)
{
sTemp = "swkey3";
CheatKeyType = "Green Cardkey";
}
else
if (Bstrncasecmp(sKey, "swyellowcard",12) == 0)
{
sTemp = "swkey4";
CheatKeyType = "Yellow Cardkey";
}
else
if (Bstrncasecmp(sKey, "swgoldkey",9) == 0)
{
sTemp = "swkey5";
CheatKeyType = "Gold Key";
}
else
if (Bstrncasecmp(sKey, "swsilverkey",11) == 0)
{
sTemp = "swkey6";
CheatKeyType = "Silver Key";
}
else
if (Bstrncasecmp(sKey, "swbronzekey",11) == 0)
{
sTemp = "swkey7";
CheatKeyType = "Bronze Key";
}
else
if (Bstrncasecmp(sKey, "swredkey",8) == 0)
{
sTemp = "swkey8";
CheatKeyType = "Red Key";
}
if (Bstrncmp(sTemp, "", 1) != 0)
KeysCheat(pp, sTemp);
}
VOID KeysCheat(PLAYERp pp, const char *cheat_string)
{
// Get KEYS
PLAYERp p;
short pnum;
const char *cp = cheat_string;
const char *str = "Given all keys";
int keynum = 0;
cp += sizeof("swkey")-1;
keynum = atol(cp);
TRAVERSE_CONNECT(pnum)
{
p = &Player[pnum];
if (keynum < 1 || keynum > 8)
{
memset(p->HasKey, TRUE, sizeof(p->HasKey));
keynum = 0;
}
else
{
if (p->HasKey[keynum-1] == FALSE)
{
p->HasKey[keynum-1] = TRUE; // cards: 0=red 1=blue 2=green 3=yellow | keys: 4=gold 5=silver 6=bronze 7=red
str = "Given %s";
}
else
{
p->HasKey[keynum-1] = FALSE;
str = "Removed %s";
}
}
}
PlayerUpdateKeys(pp);
if (keynum == 0)
sprintf(ds, str);
else
sprintf(ds, str, CheatKeyType);
PutStringInfo(pp, ds);
}
void EveryCheatToggle(PLAYERp pp, const char *cheat_string)
{ {
EveryCheat ^= 1; EveryCheat ^= 1;
@ -248,16 +408,12 @@ void EveryCheatToggle(PLAYERp pp, char *cheat_string)
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }
void SaveCheat(PLAYERp pp, char *UNUSED(cheat_string)) void GeorgeFunc(PLAYERp pp, char *)
{
}
void GeorgeFunc(PLAYERp pp, char *UNUSED(cheat_string))
{ {
PlayerSound(DIGI_TAUNTAI9,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp); PlayerSound(DIGI_TAUNTAI9,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp);
} }
void BlackburnFunc(PLAYERp pp, char *UNUSED(cheat_string)) void BlackburnFunc(PLAYERp pp, char *)
{ {
PlayerSound(DIGI_TAUNTAI3,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp); PlayerSound(DIGI_TAUNTAI3,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp);
} }
@ -290,15 +446,27 @@ int cheatcmp(const char *str1, const char *str2, int len)
typedef struct typedef struct
{ {
const char *CheatInputCode; const char *CheatInputCode;
void (*CheatInputFunc)(PLAYERp, char *); void (*CheatInputFunc)(PLAYERp, const char *);
char flags; char flags;
} CHEAT_INFO, *CHEAT_INFOp; }CHEAT_INFO, *CHEAT_INFOp;
CHEAT_INFO ci[] = CHEAT_INFO ci[] =
{ {
{"swchan", GodCheat, 0}, {"swgod", GodCheat, 0},
{"swgimme", ItemCheat, 0}, {"swchan", GodCheat, 0},
{"swgimme", ItemCheat, 0},
{"swmedic", HealCheat, 0},
{"swkeys", KeysCheat, 0},
{"swredcard", SortKeyCheat, 0},
{"swbluecard", SortKeyCheat, 0},
{"swgreencard", SortKeyCheat, 0},
{"swyellowcard", SortKeyCheat, 0},
{"swgoldkey", SortKeyCheat, 0},
{"swsilverkey", SortKeyCheat, 0},
{"swbronzekey", SortKeyCheat, 0},
{"swredkey", SortKeyCheat, 0},
{"swgun#", GunsCheat, 0},
{"swtrek##", WarpCheat, 0}, {"swtrek##", WarpCheat, 0},
{"swgreed", EveryCheatToggle, 0}, {"swgreed", EveryCheatToggle, 0},
{"swghost", ClipCheat, 0}, {"swghost", ClipCheat, 0},
@ -308,7 +476,6 @@ CHEAT_INFO ci[] =
{"swres", ResCheatOn, 0}, {"swres", ResCheatOn, 0},
{"swloc", LocCheat, 0}, {"swloc", LocCheat, 0},
{"swmap", MapCheat, 0}, {"swmap", MapCheat, 0},
{"swsave", SaveCheat, CF_ALL},
{"swroom", RoomCheat, CF_NOTSW}, // Room above room dbug {"swroom", RoomCheat, CF_NOTSW}, // Room above room dbug
#if DEBUG #if DEBUG
{"swsecret", SecretCheat, CF_ALL}, {"swsecret", SecretCheat, CF_ALL},
@ -375,100 +542,7 @@ void CheatInput(void)
if (!match) if (!match)
{ {
////DSPRINTF(ds,"Lost A Match %s", CheatInputString);
//MONO_PRINT(ds);
CheatInputMode = FALSE; CheatInputMode = FALSE;
} }
} }
/* OLD CODE
void CheatInput(void)
{
static SWBOOL cur_show;
signed char MNU_InputString(char *, short);
int ret;
SWBOOL match = FALSE;
short i;
// don't use InputMode here - its set for CheatInputMode
if (MessageInputMode || MenuInputMode)
return;
if (!CheatInputMode)
{
if (inputState.GetKeyStatus(KEYSC_S))
{
//inputState.GetKeyStatus(KEYSC_S) = FALSE;
CheatInputMode = TRUE;
strcpy(CheatInputString,"s");
}
}
if (CheatInputMode)
{
// get new chars
ret = MNU_InputString(CheatInputString, 320-20);
// quick check input
switch (ret)
{
case FALSE: // Input finished (RETURN)
case -1: // Cancel Input (pressed ESC) or Err
CheatInputMode = FALSE;
inputState.keyFlushChars();
return;
case TRUE: // Got input
break;
}
// make sure string is lower cased
Bstrlwr(CheatInputString);
// check for at least one single match
for (i = 0; i < SIZ(ci); i++)
{
// compare without the NULL
if (cheatcmp(CheatInputString, ci[i].CheatInputCode, strlen(CheatInputString)) == 0)
{
////DSPRINTF(ds,"%s",CheatInputString);
//MONO_PRINT(ds);
// if they are equal in length then its a complet match
if (strlen(CheatInputString) == strlen(ci[i].CheatInputCode))
{
////DSPRINTF(ds,"Found A Match %s", CheatInputString);
//MONO_PRINT(ds);
match = TRUE;
CheatInputMode = FALSE;
inputState.keyFlushChars();
if (ci[i].CheatInputFunc)
(*ci[i].CheatInputFunc)(Player, CheatInputString);
return;
}
else
{
match = TRUE;
break;
}
}
}
if (!match)
{
////DSPRINTF(ds,"Lost A Match %s", CheatInputString);
//MONO_PRINT(ds);
CheatInputMode = FALSE;
inputState.keyFlushChars();
}
}
}
*/
END_SW_NS END_SW_NS

View file

@ -280,20 +280,21 @@ InitPalette(void)
// //
// Dive palettes // Dive palettes
// //
#define FOG_AMT 60 // is 15 in SWP.
#define LAVA_AMT 44 // is 11 in SWP.
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
tempbuf[i] = i; tempbuf[i] = i;
// palette for underwater // palette for underwater
paletteMakeLookupTable(PALETTE_DIVE, tempbuf, 0, 0, 60, TRUE); paletteMakeLookupTable(PALETTE_DIVE, tempbuf, 0, 0, FOG_AMT, TRUE);
#define FOG_AMT 60
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
tempbuf[i] = i; tempbuf[i] = i;
paletteMakeLookupTable(PALETTE_FOG, tempbuf, FOG_AMT, FOG_AMT, FOG_AMT, TRUE); paletteMakeLookupTable(PALETTE_FOG, tempbuf, FOG_AMT, FOG_AMT, FOG_AMT, TRUE);
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
tempbuf[i] = i; tempbuf[i] = i;
paletteMakeLookupTable(PALETTE_DIVE_LAVA, tempbuf, 44, 0, 0, TRUE); paletteMakeLookupTable(PALETTE_DIVE_LAVA, tempbuf, LAVA_AMT, 0, 0, TRUE);
// //
// 1 Range changes // 1 Range changes
@ -385,9 +386,9 @@ do
4 bytes and RGB are backwards.Here are the function 4 bytes and RGB are backwards.Here are the function
prototypes: prototypes:
VBE_setPalette(long palstart, long palnum, char *dapal); VBE_setPalette(int palstart, int palnum, char *dapal);
VBE_getPalette(long palstart, long palnum, char *dapal); VBE_getPalette(int palstart, int palnum, char *dapal);
palstart is the offset of the first palette to set palstart is the offset of the first palette to set
palnum is the number of the palette entries to set palnum is the number of the palette entries to set
dapal is a pointer to the palette buffer.The palette dapal is a pointer to the palette buffer.The palette

View file

@ -147,6 +147,7 @@ CON_COMMAND pre_commands[] =
{"help", CON_GetHelp}, {"help", CON_GetHelp},
//{"quit", CON_Quit}, //{"quit", CON_Quit},
#endif #endif
{"swgod", CheatInput},
{"swchan", CheatInput}, {"swchan", CheatInput},
{"swgimme", CheatInput}, {"swgimme", CheatInput},
{"swtrek##", CheatInput}, {"swtrek##", CheatInput},
@ -157,6 +158,19 @@ CON_COMMAND pre_commands[] =
{"swloc", CheatInput}, {"swloc", CheatInput},
{"swmap", CheatInput}, {"swmap", CheatInput},
{"swsave", CheatInput}, {"swsave", CheatInput},
{"swmedic", CheatInput},
{"swkeys", CheatInput},
{"swredcard", CheatInput},
{"swbluecard", CheatInput},
{"swgreencard", CheatInput},
{"swyellowcard", CheatInput},
{"swgoldkey", CheatInput},
{"swsilverkey", CheatInput},
{"swbronzekey", CheatInput},
{"swredkey", CheatInput},
{"swgun#", CheatInput},
{"swquit", CheatInput},
{"swexit", CheatInput},
{"sound", CON_SoundTest}, {"sound", CON_SoundTest},
{"winpachinko", CON_WinPachinko}, {"winpachinko", CON_WinPachinko},
{"config", CON_LoadSetup}, {"config", CON_LoadSetup},
@ -212,7 +226,7 @@ uint8_t CON_CommandCmp(const char *str1, const char *str2, int len)
return TRUE; return TRUE;
} }
SWBOOL IsCommand(char *str) SWBOOL IsCommand(const char *str)
{ {
int i; int i;
char first[512]; char first[512];

View file

@ -343,6 +343,11 @@ STATEp sg_CoolieDead[] =
s_CoolieDead s_CoolieDead
}; };
STATE s_CoolieDeadHead[] =
{
{COOLIE_DEAD_HEAD, COOLIE_DIE_RATE, DoActorDebris, &s_CoolieDeadHead[0]}
};
/* /*
typedef struct typedef struct
{ {
@ -572,7 +577,11 @@ int SpawnCoolg(short SpriteNum)
USERp u = User[SpriteNum]; USERp u = User[SpriteNum];
// Don't do a ghost every time // Don't do a ghost every time
if (RANDOM_RANGE(1000) > 700) return 0; if (RANDOM_RANGE(1000) > 700)
{
ChangeState(SpriteNum,&s_CoolieDeadHead[0]);
return(0);
}
NewCoolg(SpriteNum); NewCoolg(SpriteNum);

View file

@ -36,6 +36,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS BEGIN_SW_NS
extern int GlobSpeedSO;
void CopySectorWalls(short dest_sectnum, short src_sectnum) void CopySectorWalls(short dest_sectnum, short src_sectnum)
{ {
short dest_wall_num, src_wall_num, start_wall; short dest_wall_num, src_wall_num, start_wall;
@ -167,7 +169,6 @@ void CopySectorMatch(short match)
if (TEST(sector[dest_sp->sectnum].extra, SECTFX_SECTOR_OBJECT)) if (TEST(sector[dest_sp->sectnum].extra, SECTFX_SECTOR_OBJECT))
{ {
SECTOR_OBJECTp sop; SECTOR_OBJECTp sop;
extern int GlobSpeedSO;
// find and add sprite to SO // find and add sprite to SO
sop = DetectSectorObject(&sector[sprite[src_move].sectnum]); sop = DetectSectorObject(&sector[sprite[src_move].sectnum]);

View file

@ -1602,7 +1602,7 @@ void ResChange(void)
for (i = 0; i < numpages; i++) for (i = 0; i < numpages; i++)
{ {
clearview(0); clearview(0);
nextpage(); videoNextPage();
} }
// needs to be called from drawscreen - crashes otherwise // needs to be called from drawscreen - crashes otherwise
@ -1654,7 +1654,7 @@ void ResChange(void)
for (i = 0; i < numpages; i++) for (i = 0; i < numpages; i++)
{ {
clearview(0); clearview(0);
nextpage(); videoNextPage();
} }
SetupAspectRatio(); SetupAspectRatio();
@ -1806,63 +1806,6 @@ void DrawCrosshair(PLAYERp pp)
if (dimensionmode == 6) if (dimensionmode == 6)
return; return;
// wdx = 160;
// wdy = 100;
#if 0
if (cl_autoaim)
{
int daz;
short hit_sprite, daang;
static int handle=-1;
daz = pp->posz + pp->bob_z;
daang = 32;
if ((hit_sprite = WeaponAutoAimHitscan(pp->SpriteP, &daz, &daang, FALSE)) != -1)
{
SPRITEp hp = &sprite[hit_sprite];
USERp hu = User[hit_sprite];
vec2_t const zero = { 0, 0 };
// Find the delta coordinates from player to monster that is targeted
vec2_t dxy = { hp->x - pp->posx, hp->y - pp->posy };
int dz = ((hp->z - (SPRITE_SIZE_Z(hit_sprite)/2)) - pp->posz) >> 4;
rotatepoint(zero, dxy, (-pp->pang)&2047, &dxy);
if (dxy.x == 0) return;
wdx = windowxy1.x + ((windowxy2.x-windowxy1.x)/2);
wdy = windowxy1.y + ((windowxy2.y-windowxy1.y)/2);
x = (dxy.y * wdx << 8) / dxy.x + (wdx << 8);
y = (dz * wdx << 8) / dxy.x + (wdy << 8);
y -= 100;
y += (pp->horiz*wdx)/160;
if (pp->CurWpn == pp->Wpn[WPN_RAIL])
{
if (!FX_SoundActive(handle))
handle = PlaySound(DIGI_RAILLOCKED, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan);
}
}
else
{
// It didn't target anything.
if (pp->CurWpn == pp->Wpn[WPN_RAIL])
{
if (FX_SoundActive(handle))
FX_StopSound(handle);
}
goto NORMALXHAIR;
}
rotatesprite(x << 8, y << 8, (1 << 16), 0,
2326, 10, 0,
ROTATE_SPRITE_VIEW_CLIP|ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1);
}
else
#endif
{ {
//NORMALXHAIR: //NORMALXHAIR:
rotatesprite(CrosshairX, CrosshairY, (1 << 16), 0, rotatesprite(CrosshairX, CrosshairY, (1 << 16), 0,
@ -2234,6 +2177,7 @@ short ScreenSavePic = FALSE;
SWBOOL PicInView(short, SWBOOL); SWBOOL PicInView(short, SWBOOL);
void DoPlayerDiveMeter(PLAYERp pp); void DoPlayerDiveMeter(PLAYERp pp);
void MoveScrollMode2D(PLAYERp pp);
void void
drawscreen(PLAYERp pp) drawscreen(PLAYERp pp)
@ -2272,13 +2216,13 @@ drawscreen(PLAYERp pp)
{ {
#define TEN_PIC 5109 #define TEN_PIC 5109
flushperms(); renderFlushPerms();
// note - could put Order Info Pages at the top like this also // note - could put Order Info Pages at the top like this also
rotatesprite(0,0,65536L,0,TEN_PIC,0,0, rotatesprite(0,0,65536L,0,TEN_PIC,0,0,
(ROTATE_SPRITE_CORNER|ROTATE_SPRITE_SCREEN_CLIP|ROTATE_SPRITE_NON_MASK|ROTATE_SPRITE_IGNORE_START_MOST), (ROTATE_SPRITE_CORNER|ROTATE_SPRITE_SCREEN_CLIP|ROTATE_SPRITE_NON_MASK|ROTATE_SPRITE_IGNORE_START_MOST),
0, 0, xdim-1, ydim-1); 0, 0, xdim-1, ydim-1);
nextpage(); videoNextPage();
return; return;
} }
#endif #endif
@ -2471,7 +2415,6 @@ drawscreen(PLAYERp pp)
if ((dimensionmode == 5 || dimensionmode == 6) && pp == Player+myconnectindex) if ((dimensionmode == 5 || dimensionmode == 6) && pp == Player+myconnectindex)
{ {
void MoveScrollMode2D(PLAYERp pp);
extern SWBOOL ScrollMode2D; extern SWBOOL ScrollMode2D;
if (ScrollMode2D) if (ScrollMode2D)

View file

@ -102,7 +102,7 @@ BEGIN_SW_NS
void pClearSpriteList(PLAYERp pp); void pClearSpriteList(PLAYERp pp);
signed char MNU_InputSmallString(char*, short); signed char MNU_InputSmallString(char*, short);
signed char MNU_InputString(char*, short); signed char MNU_InputString(char*, short);
SWBOOL IsCommand(char* str); SWBOOL IsCommand(const char* str);
SWBOOL MNU_StartNetGame(void); SWBOOL MNU_StartNetGame(void);
const char* AppProperName = "VoidSW"; const char* AppProperName = "VoidSW";
@ -245,7 +245,7 @@ extern int bufferjitter;
SWBOOL CameraTestMode = FALSE; SWBOOL CameraTestMode = FALSE;
char ds[512]; // debug string char ds[645]; // debug string
extern short NormalVisibility; extern short NormalVisibility;
@ -366,37 +366,6 @@ int krand1(void)
#endif #endif
/*
void HeapCheck(char *file, int line)
{
switch( _heapchk() )
{
case _HEAPOK:
//printf( "OK - heap is good\n" );
break;
case _HEAPEMPTY:
//printf( "OK - heap is empty\n" );
break;
case _HEAPBADBEGIN:
sprintf(ds, "ERROR - heap is damaged: %s, %d", file, line);
MONO_PRINT(ds);
DebugWriteString(ds);
setvmode(0x3);
printf( "%s\n", ds);
exit(0);
break;
case _HEAPBADNODE:
sprintf(ds, "ERROR - bad node in heap: %s, %d", file, line);
MONO_PRINT(ds);
DebugWriteString(ds);
setvmode(0x3);
printf( "%s\n", ds);
exit(0);
break;
}
}
*/
#if DEBUG #if DEBUG
SWBOOL SWBOOL
ValidPtr(void *ptr) ValidPtr(void *ptr)
@ -645,8 +614,7 @@ setup2dscreen(void)
void void TerminateGame(void)
TerminateGame(void)
{ {
int i,j; int i,j;
int oldtotalclock; int oldtotalclock;
@ -675,8 +643,7 @@ TerminateGame(void)
} }
void void LoadLevel(const char *filename)
LoadLevel(const char *filename)
{ {
int pos; int pos;
@ -840,8 +807,7 @@ static void SW_FatalEngineError(void)
I_Error("There was a problem initialising the Build engine: %s", engineerrstr); I_Error("There was a problem initialising the Build engine: %s", engineerrstr);
} }
void void InitGame()
InitGame()
{ {
extern int MovesPerPacket; extern int MovesPerPacket;
//void *ReserveMem=NULL; //void *ReserveMem=NULL;
@ -935,7 +901,7 @@ InitGame()
// LoadImages will now proceed to steal all the remaining heap space // LoadImages will now proceed to steal all the remaining heap space
//_outtext("\n\n\n\n\n\n\n\n"); //_outtext("\n\n\n\n\n\n\n\n");
//AnimateCacheCursor(); //AnimateCacheCursor();
buildputs("Loading sound and graphics...\n"); initprintf("Loading sound and graphics...\n");
TileFiles.LoadArtSet("tiles%03d.art"); TileFiles.LoadArtSet("tiles%03d.art");
// Now free it up for later use // Now free it up for later use
@ -1067,22 +1033,41 @@ LEVEL_INFO LevelInfo[MAX_LEVELS+2] = // Shareware
}; };
#endif*/ #endif*/
char EpisodeNames[2][MAX_EPISODE_NAME_LEN+2] = const char *ThemeSongs[6] =
{ {
"^Enter the Wang", "THEME.MID",
"^Code of Honor" "ENDLEV3.VOC",
"SERPENT.MID",
"SUMO.MID",
"ZILLA.MID"
"ENDING.MID"
}; };
char EpisodeSubtitles[2][MAX_EPISODE_SUBTITLE_LEN+1] =
int ThemeTrack[6] =
{ {
"Four levels (Shareware Version)", 2,3,13,13,13,14
"Eighteen levels (Full Version Only)"
}; };
char EpisodeNames[3][MAX_EPISODE_NAME_LEN+2] =
{
"^Enter the Wang",
"^Code of Honor",
"^User Maps",
};
char EpisodeSubtitles[3][MAX_EPISODE_SUBTITLE_LEN+1] =
{
"Four levels (Shareware Version)",
"Eighteen levels (Full Version Only)",
"Select a user map to play",
};
char SkillNames[4][MAX_SKILL_NAME_LEN+2] = char SkillNames[4][MAX_SKILL_NAME_LEN+2] =
{ {
"^Tiny grasshopper", "^Tiny grasshopper",
"^I Have No Fear", "^I Have No Fear",
"^Who Wants Wang", "^Who Wants Wang",
"^No Pain, No Gain" "^No Pain, No Gain"
}; };
void InitNewGame(void) void InitNewGame(void)
@ -1502,8 +1487,7 @@ TerminateLevel(void)
//HEAP_CHECK(); //HEAP_CHECK();
} }
void void NewLevel(void)
NewLevel(void)
{ {
DSPRINTF(ds,"NewLevel"); DSPRINTF(ds,"NewLevel");
@ -1590,8 +1574,8 @@ ResetKeys(void)
inputState.ClearAllKeyStatus(); inputState.ClearAllKeyStatus();
} }
SWBOOL
KeyPressed(void) SWBOOL KeyPressed(void)
{ {
int i; int i;
@ -1604,8 +1588,7 @@ KeyPressed(void)
return FALSE; return FALSE;
} }
uint8_t* uint8_t* KeyPressedRange(uint8_t* kb, uint8_t* ke)
KeyPressedRange(uint8_t* kb, uint8_t* ke)
{ {
uint8_t* k; uint8_t* k;
@ -1618,8 +1601,7 @@ KeyPressedRange(uint8_t* kb, uint8_t* ke)
return NULL; return NULL;
} }
void void ResetKeyRange(uint8_t* kb, uint8_t* ke)
ResetKeyRange(uint8_t* kb, uint8_t* ke)
{ {
uint8_t* k; uint8_t* k;
@ -1639,8 +1621,7 @@ void PlayTheme()
MONO_PRINT(ds); MONO_PRINT(ds);
} }
void void LogoLevel(void)
LogoLevel(void)
{ {
char called; char called;
int fin; int fin;
@ -1713,8 +1694,7 @@ LogoLevel(void)
} }
void void CreditsLevel(void)
CreditsLevel(void)
{ {
char called; char called;
int fin; int fin;
@ -1804,8 +1784,7 @@ CreditsLevel(void)
} }
void void SybexScreen(void)
SybexScreen(void)
{ {
if (!SW_SHAREWARE) return; if (!SW_SHAREWARE) return;
@ -1819,75 +1798,6 @@ SybexScreen(void)
while (!KeyPressed() && !quitevent) handleevents(); while (!KeyPressed() && !quitevent) handleevents();
} }
// CTW REMOVED
/*
void
TenScreen(void)
{
char called;
int fin;
char backup_pal[256*3];
char pal[PAL_SIZE];
char tempbuf[256];
char *palook_bak = palookup[0];
int i;
uint32_t bak;
int bakready2send;
if (CommEnabled)
return;
bak = totalclock;
flushperms();
clearview(0);
nextpage();
for (i = 0; i < 256; i++)
tempbuf[i] = i;
palookup[0] = tempbuf;
GetPaletteFromVESA(pal);
memcpy(backup_pal, pal, PAL_SIZE);
if ((fin = k open4load("ten.pal", 0)) != -1)
{
k read(fin, pal, PAL_SIZE);
k close(fin);
}
// palette to black
FadeOut(0, 0);
bakready2send = ready2send;
//totalclock = 0;
//ototalclock = 0;
flushperms();
// draw it
rotatesprite(0, 0, RS_SCALE, 0, TEN_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
// bring to the front - still back palette
nextpage();
// set pal
SetPaletteToVESA(pal);
//FadeIn(0, 3);
ResetKeys();
while (!KeyPressed());
palookup[0] = palook_bak;
clearview(0);
nextpage();
SetPaletteToVESA(backup_pal);
// put up a blank screen while loading
clearview(0);
nextpage();
ready2send = bakready2send;
totalclock = bak;
}
*/
// CTW REMOVED END // CTW REMOVED END
void void
@ -1983,16 +1893,14 @@ void DrawLoadLevelScreen(void)
short PlayerQuitMenuLevel = -1; short PlayerQuitMenuLevel = -1;
void void IntroAnimLevel(void)
IntroAnimLevel(void)
{ {
DSPRINTF(ds,"IntroAnimLevel"); DSPRINTF(ds,"IntroAnimLevel");
MONO_PRINT(ds); MONO_PRINT(ds);
playanm(0); playanm(0);
} }
void void MenuLevel(void)
MenuLevel(void)
{ {
char called; char called;
int fin; int fin;
@ -2001,35 +1909,6 @@ MenuLevel(void)
DSPRINTF(ds,"MenuLevel..."); DSPRINTF(ds,"MenuLevel...");
MONO_PRINT(ds); MONO_PRINT(ds);
if (AutoNet)
{
DrawMenuLevelScreen();
if (CommEnabled)
{
sprintf(ds,"Lo Wang is waiting for other players...");
MNU_MeasureString(ds, &w, &h);
MNU_DrawString(TEXT_TEST_COL(w), 170, ds, 1, 16);
sprintf(ds,"They are afraid!");
MNU_MeasureString(ds, &w, &h);
MNU_DrawString(TEXT_TEST_COL(w), 180, ds, 1, 16);
}
videoNextPage();
waitforeverybody();
FirstTimeIntoGame = TRUE;
MNU_StartNetGame();
FirstTimeIntoGame = FALSE;
waitforeverybody();
ExitLevel = FALSE;
FinishedLevel = FALSE;
BorderAdjust = TRUE;
UsingMenus = FALSE;
InMenuLevel = FALSE;
return;
}
// do demos only if not playing multi play // do demos only if not playing multi play
if (!CommEnabled && numplayers <= 1 && !FinishAnim && !NoDemoStartup) if (!CommEnabled && numplayers <= 1 && !FinishAnim && !NoDemoStartup)
@ -2173,8 +2052,7 @@ MenuLevel(void)
videoNextPage(); videoNextPage();
} }
void void SceneLevel(void)
SceneLevel(void)
{ {
SWBOOL dp_bak; SWBOOL dp_bak;
SWBOOL dm_bak; SWBOOL dm_bak;
@ -2204,8 +2082,7 @@ SceneLevel(void)
DemoPlaying = dp_bak; DemoPlaying = dp_bak;
} }
void void LoadingLevelScreen(char *level_name)
LoadingLevelScreen(char *level_name)
{ {
short w,h; short w,h;
extern SWBOOL DemoMode; extern SWBOOL DemoMode;
@ -2231,8 +2108,7 @@ LoadingLevelScreen(char *level_name)
videoNextPage(); videoNextPage();
} }
void void gNextState(STATEp *State)
gNextState(STATEp *State)
{ {
// Transition to the next state // Transition to the next state
*State = (*State)->NextState; *State = (*State)->NextState;
@ -2245,8 +2121,7 @@ gNextState(STATEp *State)
} }
// Generic state control // Generic state control
void void gStateControl(STATEp *State, int *tics)
gStateControl(STATEp *State, int *tics)
{ {
*tics += synctics; *tics += synctics;
@ -2284,8 +2159,7 @@ int BonusGrabSound(short SpriteNum)
return 0; return 0;
} }
void void BonusScreen(PLAYERp pp)
BonusScreen(PLAYERp pp)
{ {
int minutes,seconds,second_tics; int minutes,seconds,second_tics;
extern SWBOOL FinishedLevel; extern SWBOOL FinishedLevel;
@ -2563,8 +2437,7 @@ void EndGameSequence(void)
} }
} }
void void StatScreen(PLAYERp mpp)
StatScreen(PLAYERp mpp)
{ {
int minutes,seconds,second_tics; int minutes,seconds,second_tics;
extern SWBOOL FinishedLevel; extern SWBOOL FinishedLevel;
@ -2745,8 +2618,7 @@ StatScreen(PLAYERp mpp)
Terminate3DSounds(); Terminate3DSounds();
} }
void void GameIntro(void)
GameIntro(void)
{ {
DSPRINTF(ds,"GameIntro..."); DSPRINTF(ds,"GameIntro...");
@ -2779,8 +2651,7 @@ GameIntro(void)
MenuLevel(); MenuLevel();
} }
void void Control()
Control()
{ {
InitGame(); InitGame();
@ -2788,7 +2659,6 @@ Control()
MNU_InitMenus(); MNU_InitMenus();
InGame = TRUE; InGame = TRUE;
GameIntro(); GameIntro();
//NewGame = TRUE;
while (!QuitFlag) while (!QuitFlag)
{ {
@ -2805,8 +2675,7 @@ Control()
} }
void void _Assert(const char *expr, const char *strFile, unsigned uLine)
_Assert(const char *expr, const char *strFile, unsigned uLine)
{ {
sprintf(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine); sprintf(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine);
MONO_PRINT(ds); MONO_PRINT(ds);
@ -2820,8 +2689,7 @@ _Assert(const char *expr, const char *strFile, unsigned uLine)
} }
void void _ErrMsg(const char *strFile, unsigned uLine, const char *format, ...)
_ErrMsg(const char *strFile, unsigned uLine, const char *format, ...)
{ {
va_list arglist; va_list arglist;
@ -2850,8 +2718,7 @@ _ErrMsg(const char *strFile, unsigned uLine, const char *format, ...)
exit(0); exit(0);
} }
void void dsprintf(char *str, const char *format, ...)
dsprintf(char *str, char *format, ...)
{ {
va_list arglist; va_list arglist;
@ -2860,8 +2727,7 @@ dsprintf(char *str, char *format, ...)
va_end(arglist); va_end(arglist);
} }
void void dsprintf_null(char *str, const char *format, ...)
dsprintf_null(char *str, const char *format, ...)
{ {
va_list arglist; va_list arglist;
} }
@ -3033,8 +2899,7 @@ void InitRunLevel(void)
StartAmbientSound(); StartAmbientSound();
} }
void void RunLevel(void)
RunLevel(void)
{ {
int i; int i;
InitRunLevel(); InitRunLevel();
@ -3087,7 +2952,7 @@ void DosScreen(void)
void AlphaMessage(void) void AlphaMessage(void)
{ {
Global_PLock = TRUE; // Set the hardwired parental lock mode! Global_PLock = TRUE; // Set the hardwired parental lock mode!
buildputs("" initprintf(""
" SHADOW WARRIOR(tm) Version 1.2 \n" " SHADOW WARRIOR(tm) Version 1.2 \n"
"Copyright (c) 1997 3D Realms Entertainment\n" "Copyright (c) 1997 3D Realms Entertainment\n"
"\n\n" "\n\n"
@ -3103,7 +2968,7 @@ void AlphaMessage(void)
#if 0 //UK_VERSION #if 0 //UK_VERSION
void AlphaMessage(void) void AlphaMessage(void)
{ {
buildputs("" initprintf(""
" SHADOW WARRIOR(tm) Version 1.2 (UK Version) \n" " SHADOW WARRIOR(tm) Version 1.2 (UK Version) \n"
"Copyright (c) 1997 3D Realms Entertainment\n" "Copyright (c) 1997 3D Realms Entertainment\n"
"\n\n" "\n\n"
@ -3118,15 +2983,15 @@ void AlphaMessage(void)
#if 1 //!UK_VERSION && !PLOCK_VERSION #if 1 //!UK_VERSION && !PLOCK_VERSION
void AlphaMessage(void) void AlphaMessage(void)
{ {
if (SW_SHAREWARE) if (SW_SHAREWARE)
{ {
buildputs("SHADOW WARRIOR(tm) Version 1.2 (Shareware Version)\n"); initprintf("SHADOW WARRIOR(tm) Version 1.2 (Shareware Version)\n");
}
else
{
initprintf("SHADOW WARRIOR(tm) Version 1.2\n");
} }
else initprintf("Copyright (c) 1997 3D Realms Entertainment\n\n");
{
buildputs("SHADOW WARRIOR(tm) Version 1.2\n");
}
buildputs("Copyright (c) 1997 3D Realms Entertainment\n\n\n");
} }
#endif #endif
@ -3194,18 +3059,18 @@ CLI_ARG cli_arg[] =
}; };
#if 0 #if 0
Map->User Map Name Map -> User Map Name
Auto->Auto Start Game Auto -> Auto Start Game
Rules->0=WangBang 1=WangBang(No Respawn) 2=CoOperative Rules -> 0=WangBang 1=WangBang (No Respawn) 2=CoOperative
Level->0 to 24 (?) Level -> 0 to 24(?)
Enemy->0=None 1=Easy 2=Norm 3=Hard 4=Insane Enemy -> 0=None 1=Easy 2=Norm 3=Hard 4=Insane
Markers->0=Off 1=On Markers -> 0=Off 1=On
Team->0=Off 1=On Team -> 0=Off 1=On
HurtTeam->0=Off 1=On HurtTeam -> 0=Off 1=On
KillLimit->0=Infinite 1=10 2=20 3=30 4=40 5=50 6=60 7=70 8=80 9=90 10=100 KillLimit -> 0=Infinite 1=10 2=20 3=30 4=40 5=50 6=60 7=70 8=80 9=90 10=100
TimeLimit->0=Infinite 1=3 2=5 3=10 4=20 5=30 6=45 7=60 TimeLimit -> 0=Infinite 1=3 2=5 3=10 4=20 5=30 6=45 7=60
Color->0=Brown 1=Purple 2=Red 3=Yellow 4=Olive 5=Green Color -> 0=Brown 1=Purple 2=Red 3=Yellow 4=Olive 5=Green
Nuke->0=Off 1=On Nuke -> 0=Off 1=On
Example Command Line : Example Command Line :
sw -map testmap.map -autonet 0,0,1,1,1,0,3,2,1,1 -f4 -name 1234567890 -net 12345678 sw -map testmap.map -autonet 0,0,1,1,1,0,3,2,1,1 -f4 -name 1234567890 -net 12345678
@ -3239,49 +3104,6 @@ int DetectShareware(void)
void CommandLineHelp(char const * const * argv) void CommandLineHelp(char const * const * argv)
{ {
int i;
#ifdef RENDERTYPEWIN
char *str;
int strl;
strl = 30 + 70;
for (i=0; i < (int)SIZ(cli_arg); i++)
if (cli_arg[i].arg_fmt && (!SW_SHAREWARE || (!cli_arg[i].notshareware && SW_SHAREWARE)))
strl += strlen(cli_arg[i].arg_fmt) + 1 + strlen(cli_arg[i].arg_descr) + 1;
str = (char *)malloc(strl);
if (str)
{
strcpy(str,"Usage: sw [options]\n");
strcat(str,"options: ('/' may be used instead of '-', <> text is optional)\n\n");
for (i=0; i < (int)SIZ(cli_arg); i++)
{
if (cli_arg[i].arg_fmt && (!SW_SHAREWARE || (!cli_arg[i].notshareware && SW_SHAREWARE)))
{
strcat(str, cli_arg[i].arg_fmt);
strcat(str, "\t");
strcat(str, cli_arg[i].arg_descr);
strcat(str, "\n");
}
}
wm_msgbox("Shadow Warrior Help",str);
free(str);
}
#else
if (SW_SHAREWARE)
printf("Usage: %s [options]\n", argv[0]);
else
printf("Usage: %s [options] [map]\n", argv[0]);
printf("options: ('/' may be used instead of '-', <> text is optional)\n\n");
for (i = 0; i < (int)SIZ(cli_arg); i++)
{
if (cli_arg[i].arg_fmt && (!SW_SHAREWARE || (!cli_arg[i].notshareware && SW_SHAREWARE)))
{
printf(" %-20s %-30s\n",cli_arg[i].arg_fmt, cli_arg[i].arg_descr);
}
}
#endif
} }
int32_t GameInterface::app_main() int32_t GameInterface::app_main()
@ -3333,8 +3155,7 @@ int32_t GameInterface::app_main()
return 0; return 0;
} }
void void ManualPlayerInsert(PLAYERp pp)
ManualPlayerInsert(PLAYERp pp)
{ {
PLAYERp npp = Player + numplayers; PLAYERp npp = Player + numplayers;
int i; int i;
@ -3365,8 +3186,7 @@ ManualPlayerInsert(PLAYERp pp)
} }
void void BotPlayerInsert(PLAYERp pp)
BotPlayerInsert(PLAYERp pp)
{ {
PLAYERp npp = Player + numplayers; PLAYERp npp = Player + numplayers;
int i; int i;
@ -3398,8 +3218,7 @@ BotPlayerInsert(PLAYERp pp)
// SetFragBar(pp); // SetFragBar(pp);
} }
void void ManualPlayerDelete(PLAYERp cur_pp)
ManualPlayerDelete(PLAYERp cur_pp)
{ {
short i, nexti; short i, nexti;
USERp u; USERp u;
@ -3433,8 +3252,7 @@ ManualPlayerDelete(PLAYERp cur_pp)
} }
#if DEBUG #if DEBUG
void void SinglePlayInput(PLAYERp pp)
SinglePlayInput(PLAYERp pp)
{ {
int pnum = myconnectindex; int pnum = myconnectindex;
uint8_t* kp; uint8_t* kp;
@ -3470,8 +3288,7 @@ SinglePlayInput(PLAYERp pp)
} }
void void DebugKeys(PLAYERp pp)
DebugKeys(PLAYERp pp)
{ {
short w, h; short w, h;
@ -3539,8 +3356,7 @@ DebugKeys(PLAYERp pp)
#endif #endif
void void ConKey(void)
ConKey(void)
{ {
#if DEBUG #if DEBUG
// Console Input Panel // Console Input Panel
@ -3580,8 +3396,7 @@ ConKey(void)
#endif #endif
} }
void void FunctionKeys(PLAYERp pp)
FunctionKeys(PLAYERp pp)
{ {
extern SWBOOL GamePaused; extern SWBOOL GamePaused;
extern short QuickLoadNum; extern short QuickLoadNum;
@ -4116,8 +3931,7 @@ void GetHelpInput(PLAYERp pp)
short MirrorDelay; short MirrorDelay;
int MouseYAxisMode = -1; int MouseYAxisMode = -1;
void void getinput(SW_PACKET *loc)
getinput(SW_PACKET *loc)
{ {
SWBOOL found = FALSE; SWBOOL found = FALSE;
int i; int i;
@ -4652,7 +4466,7 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
continue; continue;
if (sector[i].floorshade != sector[wal->nextsector].floorshade) if (sector[i].floorshade != sector[wal->nextsector].floorshade)
continue; continue;
col = 12; col = 12; // 1=white / 31=black / 44=green / 56=pink / 128=yellow / 210=blue / 248=orange / 255=purple
} }
ox = wal->x - cposx; ox = wal->x - cposx;
@ -4691,7 +4505,7 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
SHOWSPRITE: SHOWSPRITE:
spr = &sprite[j]; spr = &sprite[j];
col = 56; col = 56; // 1=white / 31=black / 44=green / 56=pink / 128=yellow / 210=blue / 248=orange / 255=purple
if ((spr->cstat & 1) > 0) if ((spr->cstat & 1) > 0)
col = 248; col = 248;
if (j == k) if (j == k)
@ -4908,8 +4722,7 @@ SHOWSPRITE:
#if RANDOM_DEBUG #if RANDOM_DEBUG
int int RandomRange(int range, char *file, unsigned line)
RandomRange(int range, char *file, unsigned line)
{ {
uint32_t rand_num; uint32_t rand_num;
uint32_t value; uint32_t value;
@ -4939,8 +4752,7 @@ RandomRange(int range, char *file, unsigned line)
return value; return value;
} }
#else #else
int int RandomRange(int range)
RandomRange(int range)
{ {
uint32_t rand_num; uint32_t rand_num;
uint32_t value; uint32_t value;
@ -4963,8 +4775,7 @@ RandomRange(int range)
} }
#endif #endif
int int StdRandomRange(int range)
StdRandomRange(int range)
{ {
uint32_t rand_num; uint32_t rand_num;
uint32_t value; uint32_t value;
@ -5030,5 +4841,4 @@ bool GameInterface::mouseInactiveConditional(bool condition)
} }
// vim:ts=4:sw=4:expandtab:
END_SW_NS END_SW_NS

View file

@ -383,7 +383,7 @@ extern char MessageOutputString[256];
#define TRAVERSE_SPRITE_SECT(l, o, n) for ((o) = (l); (n) = nextspritesect[o], (o) != -1; (o) = (n)) #define TRAVERSE_SPRITE_SECT(l, o, n) for ((o) = (l); (n) = nextspritesect[o], (o) != -1; (o) = (n))
#define TRAVERSE_SPRITE_STAT(l, o, n) for ((o) = (l); (n) = nextspritestat[o], (o) != -1; (o) = (n)) #define TRAVERSE_SPRITE_STAT(l, o, n) for ((o) = (l); (n) = nextspritestat[o], (o) != -1; (o) = (n))
#define TRAVERSE_CONNECT(i) for (i = connecthead; i != -1 && i != connectpoint2[i]; i = connectpoint2[i]) #define TRAVERSE_CONNECT(i) for (i = connecthead; i != -1; i = connectpoint2[i])
#define NORM_ANGLE(ang) ((ang) & 2047) #define NORM_ANGLE(ang) ((ang) & 2047)
@ -853,7 +853,7 @@ int minitextshade(int x,int y,char *t,char s,char p,char sb);
void operatefta(void); void operatefta(void);
void adduserquote(const char *daquote); void adduserquote(const char *daquote);
void operateconfta(void); void operateconfta(void);
void addconquote(char *daquote); void addconquote(const char *daquote);
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// //
@ -962,12 +962,14 @@ typedef struct
} LEVEL_INFO, *LEVEL_INFOp, * *LEVEL_INFOpp; } LEVEL_INFO, *LEVEL_INFOp, * *LEVEL_INFOpp;
extern LEVEL_INFO LevelInfo[MAX_LEVELS_REG+2]; extern LEVEL_INFO LevelInfo[MAX_LEVELS_REG+2];
extern int ThemeTrack[6]; // w
extern const char *ThemeSongs[6]; //
#define MAX_EPISODE_NAME_LEN 24 #define MAX_EPISODE_NAME_LEN 24
extern char EpisodeNames[2][MAX_EPISODE_NAME_LEN+2]; // +2 = leading '^' and trailing NULL extern char EpisodeNames[3][MAX_EPISODE_NAME_LEN+2];
#define MAX_EPISODE_SUBTITLE_LEN 40 #define MAX_EPISODE_SUBTITLE_LEN 40
extern char EpisodeSubtitles[2][MAX_EPISODE_SUBTITLE_LEN+1]; extern char EpisodeSubtitles[3][MAX_EPISODE_SUBTITLE_LEN+1];
#define MAX_SKILL_NAME_LEN 24 #define MAX_SKILL_NAME_LEN 24
extern char SkillNames[4][MAX_SKILL_NAME_LEN+2]; extern char SkillNames[4][MAX_SKILL_NAME_LEN+2];
@ -2326,7 +2328,7 @@ void LoadKVXFromScript(const char *filename); // scrip2.c
void LoadPLockFromScript(const char *filename); // scrip2.c void LoadPLockFromScript(const char *filename); // scrip2.c
void LoadCustomInfoFromScript(const char *filename); // scrip2.c void LoadCustomInfoFromScript(const char *filename); // scrip2.c
void EveryCheatToggle(PLAYERp pp,char *cheat_string); // cheats.c void EveryCheatToggle(PLAYERp pp,const char *cheat_string); // cheats.c
int PlayerInitChemBomb(PLAYERp pp); // jweapon.c int PlayerInitChemBomb(PLAYERp pp); // jweapon.c
int PlayerInitFlashBomb(PLAYERp pp); // jweapon.c int PlayerInitFlashBomb(PLAYERp pp); // jweapon.c

View file

@ -354,10 +354,10 @@ int DoHornetMatchPlayerZ(short SpriteNum)
SPRITEp sp = &sprite[SpriteNum]; SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum]; USERp u = User[SpriteNum];
SPRITEp tsp = User[SpriteNum]->tgt_sp; SPRITEp tsp = User[SpriteNum]->tgt_sp;
long zdiff,zdist; int zdiff,zdist;
long loz,hiz; int loz,hiz;
long bound; int bound;
// actor does a sine wave about u->sz - this is the z mid point // actor does a sine wave about u->sz - this is the z mid point
@ -408,11 +408,11 @@ int DoHornetMatchPlayerZ(short SpriteNum)
u->sz = bound; u->sz = bound;
} }
u->sz = min(long(u->sz), long(loz - u->floor_dist)); u->sz = min(u->sz, loz - u->floor_dist);
u->sz = max(long(u->sz), long(hiz + u->ceiling_dist)); u->sz = max(u->sz, hiz + u->ceiling_dist);
u->Counter = (u->Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047; u->Counter = (u->Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
sp->z = u->sz + ((HORNET_BOB_AMT * (long)sintable[u->Counter]) >> 14); sp->z = u->sz + ((HORNET_BOB_AMT * (int)sintable[u->Counter]) >> 14);
bound = u->hiz + u->ceiling_dist + HORNET_BOB_AMT; bound = u->hiz + u->ceiling_dist + HORNET_BOB_AMT;
if (sp->z < bound) if (sp->z < bound)
@ -461,12 +461,12 @@ int DoHornetCircle(short SpriteNum)
SPRITEp sp = &sprite[SpriteNum]; SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum]; USERp u = User[SpriteNum];
SPRITEp tsp = User[SpriteNum]->tgt_sp; SPRITEp tsp = User[SpriteNum]->tgt_sp;
long nx,ny,bound; int nx,ny,bound;
sp->ang = NORM_ANGLE(sp->ang + u->Counter2); sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
nx = sp->xvel * (long) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14;
ny = sp->xvel * (long) sintable[sp->ang] >> 14; ny = sp->xvel * (int) sintable[sp->ang] >> 14;
if (!move_actor(SpriteNum, nx, ny, 0L)) if (!move_actor(SpriteNum, nx, ny, 0L))
{ {
@ -475,8 +475,8 @@ int DoHornetCircle(short SpriteNum)
// try moving in the opposite direction // try moving in the opposite direction
u->Counter2 = -u->Counter2; u->Counter2 = -u->Counter2;
sp->ang = NORM_ANGLE(sp->ang + 1024); sp->ang = NORM_ANGLE(sp->ang + 1024);
nx = sp->xvel * (long) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14;
ny = sp->xvel * (long) sintable[sp->ang] >> 14; ny = sp->xvel * (int) sintable[sp->ang] >> 14;
if (!move_actor(SpriteNum, nx, ny, 0L)) if (!move_actor(SpriteNum, nx, ny, 0L))
{ {
@ -514,7 +514,7 @@ DoHornetDeath(short SpriteNum)
{ {
SPRITEp sp = &sprite[SpriteNum]; SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum]; USERp u = User[SpriteNum];
long nx, ny; int nx, ny;
if (TEST(u->Flags, SPR_FALLING)) if (TEST(u->Flags, SPR_FALLING))
{ {
@ -535,8 +535,8 @@ DoHornetDeath(short SpriteNum)
DoActorSlide(SpriteNum); DoActorSlide(SpriteNum);
// slide while falling // slide while falling
nx = sp->xvel * (long) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14;
ny = sp->xvel * (long) sintable[sp->ang] >> 14; ny = sp->xvel * (int) sintable[sp->ang] >> 14;
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, 1, ACTORMOVETICS); u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, 1, ACTORMOVETICS);
@ -559,7 +559,7 @@ int DoCheckSwarm(short SpriteNum)
short i,nexti; short i,nexti;
SPRITEp sp = &sprite[SpriteNum], tsp; SPRITEp sp = &sprite[SpriteNum], tsp;
USERp u = User[SpriteNum], tu; USERp u = User[SpriteNum], tu;
long dist, pdist, a,b,c; int dist, pdist, a,b,c;
PLAYERp pp; PLAYERp pp;
if (!MoveSkip8) return 0; // Don't over check if (!MoveSkip8) return 0; // Don't over check

View file

@ -180,8 +180,7 @@ void UpdateMiniBar(PLAYERp pp)
} }
void void PanelInvTestSuicide(PANEL_SPRITEp psp)
PanelInvTestSuicide(PANEL_SPRITEp psp)
{ {
if (TEST(psp->flags, PANF_SUICIDE)) if (TEST(psp->flags, PANF_SUICIDE))
{ {
@ -189,8 +188,7 @@ PanelInvTestSuicide(PANEL_SPRITEp psp)
} }
} }
PANEL_SPRITEp PANEL_SPRITEp SpawnInventoryIcon(PLAYERp pp, short InventoryNum)
SpawnInventoryIcon(PLAYERp pp, short InventoryNum)
{ {
PANEL_SPRITEp psp; PANEL_SPRITEp psp;
short x,y; short x,y;
@ -221,8 +219,7 @@ SpawnInventoryIcon(PLAYERp pp, short InventoryNum)
return psp; return psp;
} }
void void KillPanelInv(PLAYERp pp, short InventoryNum)
KillPanelInv(PLAYERp pp, short InventoryNum)
{ {
ASSERT(pp->InventorySprite[InventoryNum]); ASSERT(pp->InventorySprite[InventoryNum]);
ASSERT(InventoryNum < MAX_INVENTORY); ASSERT(InventoryNum < MAX_INVENTORY);
@ -232,15 +229,13 @@ KillPanelInv(PLAYERp pp, short InventoryNum)
pp->InventorySprite[InventoryNum] = NULL; pp->InventorySprite[InventoryNum] = NULL;
} }
void void KillPlayerIcon(PLAYERp pp, PANEL_SPRITEp *pspp)
KillPlayerIcon(PLAYERp pp, PANEL_SPRITEp *pspp)
{ {
SET((*pspp)->flags, PANF_SUICIDE); SET((*pspp)->flags, PANF_SUICIDE);
(*pspp) = NULL; (*pspp) = NULL;
} }
void void KillAllPanelInv(PLAYERp pp)
KillAllPanelInv(PLAYERp pp)
{ {
short i; short i;
@ -256,8 +251,7 @@ KillAllPanelInv(PLAYERp pp)
} }
} }
PANEL_SPRITEp PANEL_SPRITEp SpawnIcon(PLAYERp pp, PANEL_STATEp state)
SpawnIcon(PLAYERp pp, PANEL_STATEp state)
{ {
PANEL_SPRITEp psp; PANEL_SPRITEp psp;
short i; short i;
@ -304,8 +298,7 @@ void AutoPickInventory(PLAYERp pp)
} }
} }
void void UseInventoryMedkit(PLAYERp pp)
UseInventoryMedkit(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short diff; short diff;
@ -353,8 +346,7 @@ UseInventoryMedkit(PLAYERp pp)
// CHEMICAL WARFARE CANISTERS // CHEMICAL WARFARE CANISTERS
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void void UseInventoryChemBomb(PLAYERp pp)
UseInventoryChemBomb(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short diff; short diff;
@ -379,8 +371,7 @@ UseInventoryChemBomb(PLAYERp pp)
// FLASH BOMBS // FLASH BOMBS
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void void UseInventoryFlashBomb(PLAYERp pp)
UseInventoryFlashBomb(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short diff; short diff;
@ -405,8 +396,7 @@ UseInventoryFlashBomb(PLAYERp pp)
// CALTROPS // CALTROPS
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void void UseInventoryCaltrops(PLAYERp pp)
UseInventoryCaltrops(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short diff; short diff;
@ -432,8 +422,7 @@ UseInventoryCaltrops(PLAYERp pp)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void void UseInventoryRepairKit(PLAYERp pp)
UseInventoryRepairKit(PLAYERp pp)
{ {
SPRITEp sp = pp->SpriteP; SPRITEp sp = pp->SpriteP;
short inv = INVENTORY_REPAIR_KIT; short inv = INVENTORY_REPAIR_KIT;
@ -462,8 +451,7 @@ UseInventoryRepairKit(PLAYERp pp)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void void UseInventoryCloak(PLAYERp pp)
UseInventoryCloak(PLAYERp pp)
{ {
SPRITEp sp = pp->SpriteP; SPRITEp sp = pp->SpriteP;
@ -489,8 +477,7 @@ UseInventoryCloak(PLAYERp pp)
PlayerSound(DIGI_IAMSHADOW,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); PlayerSound(DIGI_IAMSHADOW,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp);
} }
void void StopInventoryCloak(PLAYERp pp, short InventoryNum)
StopInventoryCloak(PLAYERp pp, short InventoryNum)
{ {
SPRITEp sp = pp->SpriteP; SPRITEp sp = pp->SpriteP;
@ -518,8 +505,7 @@ StopInventoryCloak(PLAYERp pp, short InventoryNum)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#if 0 #if 0
void void UseInventoryEnvironSuit(PLAYERp pp)
UseInventoryEnvironSuit(PLAYERp pp)
{ {
SPRITEp sp = pp->SpriteP; SPRITEp sp = pp->SpriteP;
short inv = INVENTORY_ENVIRON_SUIT; short inv = INVENTORY_ENVIRON_SUIT;
@ -533,8 +519,7 @@ UseInventoryEnvironSuit(PLAYERp pp)
} }
} }
void void StopInventoryEnvironSuit(PLAYERp pp, short InventoryNum)
StopInventoryEnvironSuit(PLAYERp pp, short InventoryNum)
{ {
SPRITEp sp = pp->SpriteP; SPRITEp sp = pp->SpriteP;
short inv = INVENTORY_ENVIRON_SUIT; short inv = INVENTORY_ENVIRON_SUIT;
@ -908,7 +893,7 @@ void InventoryBarUpdatePosition(PLAYERp pp)
pp->InventorySelectionBox->x = x - 5; pp->InventorySelectionBox->x = x - 5;
pp->InventorySelectionBox->y = y - 5; pp->InventorySelectionBox->y = y - 5;
for (id = InventoryData; id->Name; id++, inv++) for (id = InventoryData; id->Name && inv < MAX_INVENTORY; id++, inv++)
{ {
x = InventoryBarXpos[gs.BorderNum] + (inv * INVENTORY_ICON_WIDTH); x = InventoryBarXpos[gs.BorderNum] + (inv * INVENTORY_ICON_WIDTH);
y = InventoryBarYpos[gs.BorderNum]; y = InventoryBarYpos[gs.BorderNum];
@ -960,8 +945,7 @@ void (*InventoryDisplayString)(PLAYERp, short, short, short, const char *);
#define INVENTORY_STATE_XOFF 19 #define INVENTORY_STATE_XOFF 19
#define INVENTORY_STATE_YOFF 1 #define INVENTORY_STATE_YOFF 1
void void PlayerUpdateInventory(PLAYERp pp, short InventoryNum)
PlayerUpdateInventory(PLAYERp pp, short InventoryNum)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short w,h; short w,h;
@ -974,9 +958,13 @@ PlayerUpdateInventory(PLAYERp pp, short InventoryNum)
PANEL_SPRITEp psp; PANEL_SPRITEp psp;
// Go translucent if used // Go translucent if used
for (id = InventoryData; id->Name; id++, inv++) for (id = InventoryData; id->Name && inv < MAX_INVENTORY; id++, inv++)
{ {
psp = pp->InventorySprite[inv]; psp = pp->InventorySprite[inv];
if (!psp)
continue;
if (!pp->InventoryAmount[inv]) if (!pp->InventoryAmount[inv])
{ {
//SET(psp->flags, PANF_TRANSLUCENT); //SET(psp->flags, PANF_TRANSLUCENT);
@ -1043,8 +1031,7 @@ PlayerUpdateInventory(PLAYERp pp, short InventoryNum)
} }
} }
void void PlayerUpdateInventoryPercent(PLAYERp pp)
PlayerUpdateInventoryPercent(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -1065,8 +1052,7 @@ PlayerUpdateInventoryPercent(PLAYERp pp)
} }
} }
void void PlayerUpdateInventoryPic(PLAYERp pp)
PlayerUpdateInventoryPic(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
PANEL_SPRITEp psp; PANEL_SPRITEp psp;
@ -1084,8 +1070,7 @@ PlayerUpdateInventoryPic(PLAYERp pp)
psp->scale = id->Scale; psp->scale = id->Scale;
} }
void void PlayerUpdateInventoryState(PLAYERp pp)
PlayerUpdateInventoryState(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;

View file

@ -44,7 +44,7 @@ typedef struct
PANEL_STATEp State; PANEL_STATEp State;
short DecPerSec; short DecPerSec;
short MaxInv; short MaxInv;
long Scale; int Scale;
short Flags; short Flags;
} INVENTORY_DATA, *INVENTORY_DATAp; } INVENTORY_DATA, *INVENTORY_DATAp;

View file

@ -276,7 +276,7 @@ void operatefta(void)
int conbot, conbotgoal; int conbot, conbotgoal;
char con_quote[MAXCONQUOTES][256]; char con_quote[MAXCONQUOTES][256];
void addconquote(char *daquote) void addconquote(const char *daquote)
{ {
int i; int i;

View file

@ -78,8 +78,7 @@ extern ParentalStruct aVoxelArray[MAXTILES];
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// SpawnWallSound // SpawnWallSound
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
void void SpawnWallSound(short sndnum, short i)
SpawnWallSound(short sndnum, short i)
{ {
short SpriteNum; short SpriteNum;
vec3_t mid; vec3_t mid;
@ -315,8 +314,7 @@ JS_SpriteSetup(void)
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// Initialize the mirrors // Initialize the mirrors
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
void void JS_InitMirrors(void)
JS_InitMirrors(void)
{ {
short startwall, endwall, dasector; short startwall, endwall, dasector;
int i, j, k, s, dax, day, daz, dax2, day2; int i, j, k, s, dax, day, daz, dax2, day2;
@ -483,7 +481,6 @@ JS_InitMirrors(void)
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// Draw a 3d screen to a specific tile // Draw a 3d screen to a specific tile
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
#if 1
void drawroomstotile(int daposx, int daposy, int daposz, void drawroomstotile(int daposx, int daposy, int daposz,
short daang, int dahoriz, short dacursectnum, short tilenume) short daang, int dahoriz, short dacursectnum, short tilenume)
{ {
@ -501,94 +498,6 @@ void drawroomstotile(int daposx, int daposy, int daposz,
tileInvalidate(tilenume, -1, -1); tileInvalidate(tilenume, -1, -1);
} }
#else
void
drawroomstotile(int daposx, int daposy, int daposz,
short daang, int dahoriz, short dacursectnum, short tilenume)
{
int i, j, k, bakchainnumpages, bakvidoption;
intptr_t bakframeplace;
vec2_t bakwindowxy1, bakwindowxy2;
int xsiz, ysiz;
char *ptr1, *ptr2;
// DRAWROOMS TO TILE BACKUP&SET CODE
xsiz = tilesiz[tilenume].x;
ysiz = tilesiz[tilenume].y;
// bakchainnumpages = chainnumpages;
bakchainnumpages = numpages;
// chainnumpages = 0;
numpages = 0;
bakvidoption = vidoption;
vidoption = 1;
if (waloff[tilenume] == 0)
loadtile(tilenume);
bakframeplace = frameplace;
frameplace = waloff[tilenume];
bakwindowxy1 = windowxy1;
bakwindowxy2 = windowxy2;
setview(0, 0, xsiz - 1, ysiz - 1);
setvlinebpl(xsiz);
j = 0;
for (i = 0; i <= ysiz; i++)
{
ylookup[i] = j, j += xsiz;
}
// DRAWS TO TILE HERE
drawrooms(daposx, daposy, daposz, daang, dahoriz, dacursectnum + MAXSECTORS);
analyzesprites(daposx, daposy, daposz, FALSE);
renderDrawMasks();
setviewback();
// ROTATE TILE (supports square tiles only for rotation part)
if (xsiz == ysiz)
{
k = (xsiz << 1);
for (i = xsiz - 1; i >= 0; i--)
{
ptr1 = (char *)(waloff[tilenume] + i * (xsiz + 1));
ptr2 = ptr1;
if ((i & 1) != 0)
{
ptr1--;
ptr2 -= xsiz;
swapchar(ptr1, ptr2);
}
for (j = (i >> 1) - 1; j >= 0; j--)
{
ptr1 -= 2;
ptr2 -= k;
swapchar2(ptr1, ptr2, xsiz);
// swapchar(ptr1,ptr2);
// swapchar(ptr1+1,ptr2+xsiz);
}
}
}
// DRAWROOMS TO TILE RESTORE CODE
setview(bakwindowxy1.x, bakwindowxy1.y, bakwindowxy2.x, bakwindowxy2.y);
// chainnumpages = bakchainnumpages;
numpages = bakchainnumpages;
vidoption = bakvidoption;
frameplace = bakframeplace;
j = 0;
// if (chainnumpages >= 2)
if (numpages >= 2)
{
for (i = 0; i <= ysiz; i++)
ylookup[i] = j, j += (xdim >> 2);
}
else
{
for (i = 0; i <= ysiz; i++)
ylookup[i] = j, j += xdim;
}
setvlinebpl(ylookup[1]);
}
#endif
void void
JS_ProcessEchoSpot() JS_ProcessEchoSpot()
@ -648,7 +557,7 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
char ch, *ptr, *ptr2, *ptr3, *ptr4; char ch, *ptr, *ptr2, *ptr3, *ptr4;
char tvisibility, palok; char tvisibility, palok;
// long tx, ty, tz, tpang; // Interpolate so mirror doesn't // int tx, ty, tz, tpang; // Interpolate so mirror doesn't
// drift! // drift!
SWBOOL bIsWallMirror = FALSE; SWBOOL bIsWallMirror = FALSE;
@ -1065,8 +974,7 @@ DoAutoSize(uspritetype * tspr)
// Rotation angles for sprites // Rotation angles for sprites
short rotang = 0; short rotang = 0;
void void JAnalyzeSprites(uspritetype * tspr)
JAnalyzeSprites(uspritetype * tspr)
{ {
int i, currsprite; int i, currsprite;

View file

@ -1,87 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1997, 2005 - 3D Realms Entertainment
This file is part of Shadow Warrior version 1.2
Shadow Warrior is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Original Source: 1997 - Frank Maddin and Jim Norwood
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include "build.h"
#include "mytypes.h"
#include "keys.h"
#include "names2.h"
//#include "panel.h"
#include "game.h"
BEGIN_SW_NS
// macros this function needs
//#define MK_FP(seg,ofs) ((void _seg *)(seg)+(void near *)(ofs))
//#define PokeByte(a,b,c) (*((char far *)MK_FP((a),(b)))=(char)(c))
//#if DEBUG
void
PokeStringMono(uint8_t Attr, uint8_t* String)
{
fprintf(stderr,"MONO: %s\n",String);
#if 0
// Scrolls the monochrome display up one line, then prints the
// string with the desired attribute on the bottom line.
// EXAMPLE: PokeStringMono(MDA_NORMAL, "Hello, world.");
uint8_t* Src, Dest;
int32_t* s,d;
static char MonoBuf[4000];
#define BASE (MonoBuf)
#define LINE_SIZE 160
#define LINE_OFFSET(num) ((80*2)*(num))
// First scroll the screen up one line.
// copy lines 1-24 up to 0
s = (int32_t*)(BASE + LINE_SIZE);
d = (int32_t*)BASE;
memmove(d,s,LINE_OFFSET(24));
// clear bottom line
Dest = BASE + LINE_OFFSET(24);
//memset(Dest,0,LINE_SIZE);
memset(Dest,'.',LINE_SIZE);
// Now print the string on the bottom line.
Src = String;
Dest = BASE + LINE_OFFSET(24);
while (*Src)
{
*Dest++ = *Src++;
*Dest++ = Attr;
}
memcpy((char *)0xB0000, MonoBuf, sizeof(MonoBuf));
#endif
}
//#endif
END_SW_NS

View file

@ -1944,8 +1944,7 @@ static char lg_xlat_num[] = {0,1,2,3,4,5,6,7,8,9};
#define FONT_LARGE_ALPHA 3706 #define FONT_LARGE_ALPHA 3706
#define FONT_LARGE_DIGIT 3732 #define FONT_LARGE_DIGIT 3732
void void MNU_MeasureStringLarge(const char *string, short *w, short *h)
MNU_MeasureStringLarge(const char *string, short *w, short *h)
{ {
short ndx, width, height; short ndx, width, height;
char c; char c;
@ -1987,8 +1986,7 @@ MNU_MeasureStringLarge(const char *string, short *w, short *h)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw a string using a graphic font // Draw a string using a graphic font
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_DrawStringLarge(short x, short y, const char *string)
MNU_DrawStringLarge(short x, short y, const char *string)
{ {
int ndx, offset; int ndx, offset;
char c; char c;
@ -2027,8 +2025,7 @@ MNU_DrawStringLarge(short x, short y, const char *string)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Measure the pixel width of a graphic string // Measure the pixel width of a graphic string
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_MeasureString(const char *string, short *w, short *h)
MNU_MeasureString(const char *string, short *w, short *h)
{ {
short ndx, width, height; short ndx, width, height;
char c; char c;
@ -2068,8 +2065,7 @@ MNU_MeasureString(const char *string, short *w, short *h)
// //
// MenuTextShade and MenuDrawFlags // MenuTextShade and MenuDrawFlags
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_DrawString(short x, short y, const char *string, short shade, short pal)
MNU_DrawString(short x, short y, const char *string, short shade, short pal)
{ {
int ndx, offset; int ndx, offset;
char c; char c;
@ -2131,8 +2127,7 @@ MNU_DrawString(short x, short y, char *string)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Measure the pixel width of a small font string // Measure the pixel width of a small font string
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_MeasureSmallString(const char *string, short *w, short *h)
MNU_MeasureSmallString(const char *string, short *w, short *h)
{ {
short ndx, width, height; short ndx, width, height;
char c; char c;
@ -2164,8 +2159,7 @@ MNU_MeasureSmallString(const char *string, short *w, short *h)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw a string using a small graphic font // Draw a string using a small graphic font
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_DrawSmallString(short x, short y, const char *string, short shade, short pal)
MNU_DrawSmallString(short x, short y, const char *string, short shade, short pal)
{ {
int ndx; int ndx;
char c; char c;
@ -2199,8 +2193,7 @@ MNU_DrawSmallString(short x, short y, const char *string, short shade, short pal
// Get an input string from user using small font // Get an input string from user using small font
//////////////////////////////////////////////// ////////////////////////////////////////////////
signed char signed char MNU_InputSmallString(char *name, short pix_width)
MNU_InputSmallString(char *name, short pix_width)
{ {
char ch; char ch;
short w, h; short w, h;
@ -2274,8 +2267,7 @@ MNU_InputSmallString(char *name, short pix_width)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw dialog text on screen // Draw dialog text on screen
//////////////////////////////////////////////// ////////////////////////////////////////////////
static SWBOOL static SWBOOL MNU_Dialog(void)
MNU_Dialog(void)
{ {
short ndx, linecnt, w[MAXDIALOG], h, x, y; short ndx, linecnt, w[MAXDIALOG], h, x, y;
@ -2312,8 +2304,7 @@ MNU_Dialog(void)
// Get an input string from user // Get an input string from user
//////////////////////////////////////////////// ////////////////////////////////////////////////
signed char signed char MNU_InputString(char *name, short pix_width)
MNU_InputString(char *name, short pix_width)
{ {
char ch; char ch;
short w, h; short w, h;
@ -2397,8 +2388,7 @@ void LoadSaveMsg(const char *msg)
// I'm figuring it need to do the following: // I'm figuring it need to do the following:
// . Load the game if there is one by calling: MNU_LoadGameCustom. // . Load the game if there is one by calling: MNU_LoadGameCustom.
//////////////////////////////////////////////// ////////////////////////////////////////////////
SWBOOL SWBOOL MNU_GetLoadCustom(void)
MNU_GetLoadCustom(void)
{ {
short load_num; short load_num;
@ -2464,8 +2454,7 @@ MNU_GetLoadCustom(void)
// . Call MNU_GetInput to allow string input of description. // . Call MNU_GetInput to allow string input of description.
// . Save the game if there is one by calling: MNU_SaveGameCustom. // . Save the game if there is one by calling: MNU_SaveGameCustom.
//////////////////////////////////////////////// ////////////////////////////////////////////////
SWBOOL SWBOOL MNU_GetSaveCustom(void)
MNU_GetSaveCustom(void)
{ {
short save_num; short save_num;
extern SWBOOL InMenuLevel, LoadGameOutsideMoveLoop; extern SWBOOL InMenuLevel, LoadGameOutsideMoveLoop;
@ -2518,8 +2507,7 @@ MNU_GetSaveCustom(void)
// This function gets called each frame by DrawMenus // This function gets called each frame by DrawMenus
//////////////////////////////////////////////// ////////////////////////////////////////////////
static SWBOOL static SWBOOL MNU_DrawLoadSave(short game_num)
MNU_DrawLoadSave(short game_num)
{ {
// screen border // screen border
rotatesprite(SS_XSTART << 16, SS_YSTART << 16, MZ, 0, pic_loadsavescreen, rotatesprite(SS_XSTART << 16, SS_YSTART << 16, MZ, 0, pic_loadsavescreen,
@ -2539,8 +2527,8 @@ MNU_DrawLoadSave(short game_num)
static char SaveGameInfo1[80]; static char SaveGameInfo1[80];
static char SaveGameInfo2[80]; static char SaveGameInfo2[80];
SWBOOL
MNU_LoadSaveMove(UserCall call, MenuItem_p item) SWBOOL MNU_LoadSaveMove(UserCall call, MenuItem_p item)
{ {
short i; short i;
short game_num; short game_num;
@ -2648,8 +2636,7 @@ MNU_LoadSaveMove(UserCall call, MenuItem_p item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_LoadSaveDraw(UserCall call, MenuItem_p item)
MNU_LoadSaveDraw(UserCall call, MenuItem_p item)
{ {
short i; short i;
short game_num; short game_num;
@ -2715,8 +2702,7 @@ MNU_LoadSaveDraw(UserCall call, MenuItem_p item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_ShareWareCheck(MenuItem *item)
MNU_ShareWareCheck(MenuItem *item)
{ {
if (SW_SHAREWARE) if (SW_SHAREWARE)
{ {
@ -2726,8 +2712,7 @@ MNU_ShareWareCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_CheckUserMap(MenuItem *item)
MNU_CheckUserMap(MenuItem *item)
{ {
if (UserMapName[0] == '\0') if (UserMapName[0] == '\0')
RESET(item->flags, mf_disabled); RESET(item->flags, mf_disabled);
@ -2736,8 +2721,7 @@ MNU_CheckUserMap(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_ShareWareMessage(MenuItem *item)
MNU_ShareWareMessage(MenuItem *item)
{ {
const char *extra_text; const char *extra_text;
short w,h; short w,h;
@ -2767,8 +2751,7 @@ MNU_ShareWareMessage(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_SaveGameCheck(MenuItem *item)
MNU_SaveGameCheck(MenuItem *item)
{ {
extern SWBOOL InMenuLevel; extern SWBOOL InMenuLevel;
extern SWBOOL DemoMode; extern SWBOOL DemoMode;
@ -2799,8 +2782,7 @@ MNU_SaveGameCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_TenCheck(MenuItem *item)
MNU_TenCheck(MenuItem *item)
{ {
if (CommEnabled || numplayers > 1) if (CommEnabled || numplayers > 1)
{ {
@ -2811,8 +2793,7 @@ MNU_TenCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_LoadGameCheck(MenuItem *item)
MNU_LoadGameCheck(MenuItem *item)
{ {
if (0) // JBF: Until we fix the symbol table dilemma, loading is off limits if (0) // JBF: Until we fix the symbol table dilemma, loading is off limits
@ -2830,8 +2811,7 @@ MNU_LoadGameCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_StatCheck(MenuItem *item)
MNU_StatCheck(MenuItem *item)
{ {
if (CommEnabled || numplayers > 1) if (CommEnabled || numplayers > 1)
{ {
@ -2842,8 +2822,7 @@ MNU_StatCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_HurtTeammateCheck(MenuItem *item)
MNU_HurtTeammateCheck(MenuItem *item)
{ {
switch (gs.NetGameType+1) switch (gs.NetGameType+1)
{ {
@ -2864,8 +2843,7 @@ MNU_HurtTeammateCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_TeamPlayCheck(MenuItem *item)
MNU_TeamPlayCheck(MenuItem *item)
{ {
switch (gs.NetGameType+1) switch (gs.NetGameType+1)
{ {
@ -2881,8 +2859,7 @@ MNU_TeamPlayCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_CoopPlayCheck(MenuItem *item)
MNU_CoopPlayCheck(MenuItem *item)
{ {
switch (gs.NetGameType+1) switch (gs.NetGameType+1)
{ {
@ -2906,8 +2883,7 @@ MNU_TeamPlayChange(void)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_MouseCheck(MenuItem *item)
MNU_MouseCheck(MenuItem *item)
{ {
if (!CONTROL_MousePresent) if (!CONTROL_MousePresent)
{ {
@ -2956,15 +2932,13 @@ MNU_MusicCheck(MenuItem *item)
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_FxCheck(MenuItem *item)
MNU_FxCheck(MenuItem *item)
{ {
RESET(item->flags, mf_disabled); RESET(item->flags, mf_disabled);
return TRUE; return TRUE;
} }
SWBOOL SWBOOL MNU_MusicFxCheck(MenuItem *item)
MNU_MusicFxCheck(MenuItem *item)
{ {
RESET(item->flags, mf_disabled); RESET(item->flags, mf_disabled);
return TRUE; return TRUE;
@ -2973,8 +2947,7 @@ MNU_MusicFxCheck(MenuItem *item)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Do a toggle button // Do a toggle button
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_DoButton(MenuItem_p item, SWBOOL draw)
MNU_DoButton(MenuItem_p item, SWBOOL draw)
{ {
int x, y; int x, y;
SWBOOL state; SWBOOL state;
@ -3708,8 +3681,7 @@ MNU_SetupMenu(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw an item // Draw an item
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_ClearFlags(MenuGroup * node)
MNU_ClearFlags(MenuGroup *node)
{ {
MenuItem *i; MenuItem *i;
@ -3727,8 +3699,7 @@ MNU_ClearFlags(MenuGroup *node)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Pop a group off the menu stack // Pop a group off the menu stack
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_PopGroup(void)
MNU_PopGroup(void)
{ {
if (!menuarrayptr) if (!menuarrayptr)
return; return;
@ -3742,8 +3713,7 @@ MNU_PopGroup(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Push a group on to the menu stack // Push a group on to the menu stack
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_PushGroup(MenuGroup * node)
MNU_PushGroup(MenuGroup *node)
{ {
if (menuarrayptr == MaxLayers - 1) if (menuarrayptr == MaxLayers - 1)
return; return;
@ -3756,15 +3726,13 @@ MNU_PushGroup(MenuGroup *node)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Setup a new menu subgroup // Setup a new menu subgroup
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_SetupGroup(void)
MNU_SetupGroup(void)
{ {
MNU_SelectItem(currentmenu, currentmenu->cursor, FALSE); MNU_SelectItem(currentmenu, currentmenu->cursor, FALSE);
MNU_DrawMenu(); MNU_DrawMenu();
} }
static void static VOID MNU_ItemPreProcess(MenuGroup * group)
MNU_ItemPreProcess(MenuGroup *group)
{ {
MenuItem *item; MenuItem *item;
@ -3780,8 +3748,7 @@ MNU_ItemPreProcess(MenuGroup *group)
} }
} }
void void MNU_ItemPostProcess(MenuGroup *group)
MNU_ItemPostProcess(MenuGroup *group)
{ {
MenuItem *item; MenuItem *item;
int zero = 0; int zero = 0;
@ -3800,8 +3767,7 @@ MNU_ItemPostProcess(MenuGroup *group)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Go to next menu subgroup // Go to next menu subgroup
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_DownLevel(MenuGroup * group)
MNU_DownLevel(MenuGroup *group)
{ {
if (!group) if (!group)
@ -3829,15 +3795,14 @@ MNU_DownLevel(MenuGroup *group)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Go to previous menu subgroup // Go to previous menu subgroup
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_UpLevel(void)
MNU_UpLevel(void)
{ {
int zero = 0; int zero = 0;
static int handle1=0; static int handle1=0;
// if run out of menus then EXIT // if run out of menus then EXIT
if (!menuarrayptr) if (!menuarrayptr)
{ {
if (!FX_SoundActive(handle1)) if(!FX_SoundActive(handle1))
handle1 = PlaySound(DIGI_STARCLINK,&zero,&zero,&zero,v3df_dontpan); handle1 = PlaySound(DIGI_STARCLINK,&zero,&zero,&zero,v3df_dontpan);
ExitMenus(); ExitMenus();
return; return;
@ -3854,8 +3819,8 @@ MNU_UpLevel(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Do a menu item action // Do a menu item action
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void
MNU_DoItem(void) static void MNU_DoItem(void)
{ {
MenuItem *item; MenuItem *item;
@ -3896,8 +3861,7 @@ MNU_DoItem(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw an item icon or cursor // Draw an item icon or cursor
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_DrawItemIcon(MenuItem * item)
MNU_DrawItemIcon(MenuItem *item)
{ {
//void BorderRefreshClip(PLAYERp pp, short x, short y, short x2, short y2); //void BorderRefreshClip(PLAYERp pp, short x, short y, short x2, short y2);
int x = item->x, y = item->y; int x = item->x, y = item->y;
@ -3927,8 +3891,7 @@ MNU_DrawItemIcon(MenuItem *item)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw an item // Draw an item
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_DrawItem(MenuItem * item)
MNU_DrawItem(MenuItem *item)
{ {
char *ptr; char *ptr;
short px, py; short px, py;
@ -3970,8 +3933,7 @@ MNU_DrawItem(MenuItem *item)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw the menu contents // Draw the menu contents
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_DrawMenuContents(void)
MNU_DrawMenuContents(void)
{ {
MenuItem *item; MenuItem *item;
short w,h; short w,h;
@ -4035,8 +3997,7 @@ MNU_DrawMenuContents(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Draw the menu // Draw the menu
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_DrawMenu(void)
MNU_DrawMenu(void)
{ {
if (cust_callback != NULL) if (cust_callback != NULL)
{ {
@ -4053,8 +4014,7 @@ MNU_DrawMenu(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Select a menu item // Select a menu item
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_SelectItem(MenuGroup * group, short index, SWBOOL draw)
MNU_SelectItem(MenuGroup *group, short index, SWBOOL draw)
{ {
MenuItem *item; MenuItem *item;
@ -4068,6 +4028,7 @@ MNU_SelectItem(MenuGroup *group, short index, SWBOOL draw)
group->cursor = index; group->cursor = index;
item = &group->items[group->cursor]; item = &group->items[group->cursor];
item->flags |= mf_selected; item->flags |= mf_selected;
if (draw) if (draw)
MNU_DrawItem(item); MNU_DrawItem(item);
@ -4076,8 +4037,7 @@ MNU_SelectItem(MenuGroup *group, short index, SWBOOL draw)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Toggle a menu radio button on/off // Toggle a menu radio button on/off
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_PushItem(MenuItem * item, SWBOOL draw)
MNU_PushItem(MenuItem *item, SWBOOL draw)
{ {
if (item->type != mt_button) if (item->type != mt_button)
return; return;
@ -4085,14 +4045,13 @@ MNU_PushItem(MenuItem *item, SWBOOL draw)
buttonsettings[item->button] ^= 1; buttonsettings[item->button] ^= 1;
// if (draw) // if (draw)
MNU_DoButton(item, draw); MNU_DoButton(item, draw);
} }
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Go to next item on menu // Go to next item on menu
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_NextItem(void)
MNU_NextItem(void)
{ {
MenuTag type; MenuTag type;
MenuFlags flag; MenuFlags flag;
@ -4115,8 +4074,7 @@ MNU_NextItem(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Go to previous item on menu // Go to previous item on menu
//////////////////////////////////////////////// ////////////////////////////////////////////////
static void static void MNU_PrevItem(void)
MNU_PrevItem(void)
{ {
MenuTag type; MenuTag type;
MenuFlags flag; MenuFlags flag;
@ -4135,8 +4093,7 @@ MNU_PrevItem(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Find hotkey press on current menu, if any. // Find hotkey press on current menu, if any.
//////////////////////////////////////////////// ////////////////////////////////////////////////
static SWBOOL static SWBOOL MNU_DoHotkey(void)
MNU_DoHotkey(void)
{ {
MenuItem_p item; MenuItem_p item;
short index; short index;
@ -4160,8 +4117,7 @@ MNU_DoHotkey(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Setup Menus // Setup Menus
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void SetupMenu(void)
SetupMenu(void)
{ {
if (!UsingMenus && !ConPanel) // Doing this check for multiplay if (!UsingMenus && !ConPanel) // Doing this check for multiplay
// menus // menus
@ -4182,7 +4138,7 @@ SetupMenu(void)
//////////////////////////////////////////////// ////////////////////////////////////////////////
#define MNU_SENSITIVITY 10 // The menu's mouse sensitivity, should be real low #define MNU_SENSITIVITY 10 // The menu's mouse sensitivity, should be real low
void MNU_DoMenu(CTLType type, PLAYERp pp) void MNU_DoMenu( CTLType type, PLAYERp pp )
{ {
SWBOOL resetitem; SWBOOL resetitem;
unsigned char key; unsigned char key;
@ -4280,8 +4236,7 @@ void MNU_DoMenu(CTLType type, PLAYERp pp)
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Checks to see if we should be in menus // Checks to see if we should be in menus
//////////////////////////////////////////////// ////////////////////////////////////////////////
void void MNU_CheckForMenus(void)
MNU_CheckForMenus(void)
{ {
extern SWBOOL GamePaused; extern SWBOOL GamePaused;
@ -4305,8 +4260,7 @@ MNU_CheckForMenus(void)
} }
} }
void void MNU_CheckForMenusAnyKey(void)
MNU_CheckForMenusAnyKey(void)
{ {
if (UsingMenus) if (UsingMenus)
{ {
@ -4386,8 +4340,7 @@ unsigned char palette_data[256][3]; // Global palette array
// WaitForVsync // WaitForVsync
// Waits for a vertical retrace to occur. If one is in progress, it waits for the next one. // Waits for a vertical retrace to occur. If one is in progress, it waits for the next one.
///////////////////////////////////////////////// /////////////////////////////////////////////////
void void WaitForVsync(void)
WaitForVsync(void)
{ {
while (inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK) ; while (inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK) ;
// Retrace in progress, wait. // Retrace in progress, wait.
@ -4396,8 +4349,7 @@ WaitForVsync(void)
while (!inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK) ; while (!inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK) ;
} }
void void Get_Palette(unsigned char *pal)
Get_Palette(unsigned char *pal)
{ {
int i; int i;
@ -4405,8 +4357,8 @@ Get_Palette(unsigned char *pal)
for (i = 0; i < 768; i++) for (i = 0; i < 768; i++)
pal[i] = inp(PALETTE_DATA); pal[i] = inp(PALETTE_DATA);
} }
void
Set_Palette(unsigned char *buff) void Set_Palette(unsigned char *buff)
{ {
int i; int i;
@ -4429,8 +4381,7 @@ Set_Palette(unsigned char *buff)
// Heres some temp timer junk for this routine. Replace it with game timer stuff later. // Heres some temp timer junk for this routine. Replace it with game timer stuff later.
//unsigned int *clock = (unsigned int *)0x046C; //unsigned int *clock = (unsigned int *)0x046C;
void void Fade_Timer(int clicks)
Fade_Timer(int clicks)
{ {
// unsigned int now; // unsigned int now;
int now; int now;
@ -4440,8 +4391,7 @@ Fade_Timer(int clicks)
while (abs((int32_t) totalclock - now) < clicks) handleevents(); while (abs((int32_t) totalclock - now) < clicks) handleevents();
} }
void void FadeIn(unsigned char startcolor, unsigned int clicks)
FadeIn(unsigned char startcolor, unsigned int clicks)
{ {
int i, palreg, usereg, tmpreg1 = 0, tmpreg2 = 0; int i, palreg, usereg, tmpreg1 = 0, tmpreg2 = 0;
RGB_color color; RGB_color color;
@ -4498,8 +4448,7 @@ FadeIn(unsigned char startcolor, unsigned int clicks)
} }
} }
void void FadeOut(unsigned char targetcolor, unsigned int clicks)
FadeOut(unsigned char targetcolor, unsigned int clicks)
{ {
int i, palreg, usereg = 0, tmpreg1 = 0, tmpreg2 = 0; int i, palreg, usereg = 0, tmpreg1 = 0, tmpreg2 = 0;
RGB_color color; RGB_color color;
@ -4601,8 +4550,7 @@ unsigned char ppalette[MAX_SW_PLAYERS_REG][768];
// Set the amount of redness for damage // Set the amount of redness for damage
// the player just took // the player just took
////////////////////////////////////////// //////////////////////////////////////////
void void SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor)
SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor)
{ {
int palreg, usereg = 0, tmpreg1 = 0, tmpreg2 = 0; int palreg, usereg = 0, tmpreg1 = 0, tmpreg2 = 0;
short fadedamage=0; short fadedamage=0;
@ -4721,8 +4669,7 @@ SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor)
// Do the screen reddness based on damage // Do the screen reddness based on damage
////////////////////////////////////////// //////////////////////////////////////////
#define MAXFADETICS 5 #define MAXFADETICS 5
void void DoPaletteFlash(PLAYERp pp)
DoPaletteFlash(PLAYERp pp)
{ {
int i, palreg, tmpreg1 = 0, tmpreg2 = 0; int i, palreg, tmpreg1 = 0, tmpreg2 = 0;
unsigned char *pal_ptr = &ppalette[screenpeek][0]; unsigned char *pal_ptr = &ppalette[screenpeek][0];

View file

@ -277,7 +277,7 @@ typedef struct MenuGroup
short cursor; // This is the current menu item the short cursor; // This is the current menu item the
// cursor is resting on. // cursor is resting on.
} MenuGroup, *MenuGroup_p; } *MenuGroup_p;
// Custom Routine Prototypes //////////////////////////////////////////////////////////////////// // Custom Routine Prototypes ////////////////////////////////////////////////////////////////////

View file

@ -456,6 +456,7 @@ enum STAT_ENUMS
#define COOLG_PAIN_R4 COOLG_PAIN_R0 //+ (COOLIE_PAIN_FRAMES * 4) #define COOLG_PAIN_R4 COOLG_PAIN_R0 //+ (COOLIE_PAIN_FRAMES * 4)
#define COOLIE_DEAD_NOHEAD 1440 #define COOLIE_DEAD_NOHEAD 1440
#define COOLIE_DEAD_HEAD 4267
#define COOLIE_DIE 4260 #define COOLIE_DIE 4260
#define COOLIE_DEAD 4268 #define COOLIE_DEAD 4268
@ -657,6 +658,7 @@ enum STAT_ENUMS
#define NINJA_SLICED 4227 #define NINJA_SLICED 4227
#define NINJA_DEAD_SLICED NINJA_SLICED+9 #define NINJA_DEAD_SLICED NINJA_SLICED+9
#define NINJA_SLICED_HACK 4211
#define NINJA_Head_FRAMES 1 #define NINJA_Head_FRAMES 1
#define NINJA_Head_R0 1142 #define NINJA_Head_R0 1142

View file

@ -140,15 +140,9 @@ void netsendpacket(int ind, uint8_t* buf, int len)
{ {
if ((unsigned)len > sizeof(packbuf)) if ((unsigned)len > sizeof(packbuf))
{ {
buildprintf("netsendpacket(): packet length > %d!\n",(int)sizeof(packbuf));
len = sizeof(packbuf); len = sizeof(packbuf);
} }
buildprintf("netsendpacket() sends proxy to %d\nPlayerIndex=%d Contents:",connecthead,ind);
for (i=0; i<len; i++)
buildprintf(" %02x", buf[i]);
buildputs("\n");
prx->PacketType = PACKET_TYPE_PROXY; prx->PacketType = PACKET_TYPE_PROXY;
prx->PlayerIndex = (uint8_t)ind; prx->PlayerIndex = (uint8_t)ind;
memcpy(&prx[1], buf, len); // &prx[1] == (char*)prx + sizeof(PACKET_PROXY) memcpy(&prx[1], buf, len); // &prx[1] == (char*)prx + sizeof(PACKET_PROXY)
@ -160,10 +154,6 @@ void netsendpacket(int ind, uint8_t* buf, int len)
//sendpacket(ind, buf, len); //sendpacket(ind, buf, len);
buildprintf("netsendpacket() sends normal to %d\nContents:",ind);
for (i=0; i<len; i++)
buildprintf(" %02x", buf[i]);
buildputs("\n");
} }
void netbroadcastpacket(uint8_t* buf, int len) void netbroadcastpacket(uint8_t* buf, int len)
@ -177,14 +167,9 @@ void netbroadcastpacket(uint8_t* buf, int len)
{ {
if ((unsigned)len > sizeof(packbuf)) if ((unsigned)len > sizeof(packbuf))
{ {
buildprintf("netbroadcastpacket(): packet length > %d!\n",(int)sizeof(packbuf));
len = sizeof(packbuf); len = sizeof(packbuf);
} }
buildprintf("netbroadcastpacket() sends proxy to %d\nPlayerIndex=255 Contents:",connecthead);
for (i=0; i<len; i++)
buildprintf(" %02x", buf[i]);
buildputs("\n");
prx->PacketType = PACKET_TYPE_PROXY; prx->PacketType = PACKET_TYPE_PROXY;
prx->PlayerIndex = (uint8_t)(-1); prx->PlayerIndex = (uint8_t)(-1);
@ -218,20 +203,12 @@ int netgetpacket(int *ind, uint8_t* buf)
{ {
if (len > 0) if (len > 0)
{ {
buildprintf("netgetpacket() gets normal from %d\nContents:",*ind);
for (i=0; i<len; i++)
buildprintf(" %02x", buf[i]);
buildputs("\n");
} }
return len; return len;
} }
prx = (PACKET_PROXYp)buf; prx = (PACKET_PROXYp)buf;
buildprintf("netgetpacket() got proxy from %d\nPlayerIndex=%d Contents:",*ind,prx->PlayerIndex);
for (i=0; i<len-(int)sizeof(PACKET_PROXY); i++)
buildprintf(" %02x", *(((char *)&prx[1])+i));
buildputs("\n");
if (myconnectindex == connecthead) if (myconnectindex == connecthead)
{ {
@ -1606,7 +1583,6 @@ getpackets(void)
break; break;
case PACKET_TYPE_PROXY: case PACKET_TYPE_PROXY:
buildputs("getpackets(): nested proxy packets!?\n");
break; break;
default: default:

View file

@ -24,6 +24,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" #include "ns.h"
// Added Ninja Sliced fix
// Fixed Ninja sliced dead and rotation
// Added s_NinjaDieSlicedHack[]
// Fixed Saved Game
// Added GrabThroat Hack
//
#include "build.h" #include "build.h"
@ -41,6 +47,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "actor.h" #include "actor.h"
#include "ninja.h" #include "ninja.h"
#include "sprite.h" #include "sprite.h"
#include "swcvar.h"
BEGIN_SW_NS BEGIN_SW_NS
@ -1501,7 +1508,23 @@ STATE s_NinjaDieSliced[] =
{NINJA_SLICED + 8, NINJA_DIESLICED_RATE-5, NullNinja, &s_NinjaDieSliced[10]}, {NINJA_SLICED + 8, NINJA_DIESLICED_RATE-5, NullNinja, &s_NinjaDieSliced[10]},
{NINJA_SLICED + 9, SF_QUICK_CALL, QueueFloorBlood, &s_NinjaDieSliced[11]}, {NINJA_SLICED + 9, SF_QUICK_CALL, QueueFloorBlood, &s_NinjaDieSliced[11]},
{NINJA_SLICED + 9, NINJA_DIESLICED_RATE, DoActorDebris, &s_NinjaDieSliced[11]}, {NINJA_SLICED + 9, NINJA_DIESLICED_RATE, DoActorDebris, &s_NinjaDieSliced[11]},
}; };
STATE s_NinjaDieSlicedHack[] =
{
{NINJA_SLICED_HACK + 0, NINJA_DIESLICED_RATE*6, NullNinja, &s_NinjaDieSlicedHack[1]},
{NINJA_SLICED_HACK + 1, NINJA_DIESLICED_RATE, NullNinja, &s_NinjaDieSlicedHack[2]},
{NINJA_SLICED_HACK + 2, NINJA_DIESLICED_RATE, NullNinja, &s_NinjaDieSlicedHack[3]},
{NINJA_SLICED_HACK + 3, NINJA_DIESLICED_RATE, NullNinja, &s_NinjaDieSlicedHack[4]},
{NINJA_SLICED_HACK + 4, NINJA_DIESLICED_RATE-1, NullNinja, &s_NinjaDieSlicedHack[5]},
{NINJA_SLICED_HACK + 4, NINJA_DIESLICED_RATE-2, NullNinja, &s_NinjaDieSlicedHack[6]},
{NINJA_SLICED_HACK + 5, NINJA_DIESLICED_RATE-3, NullNinja, &s_NinjaDieSlicedHack[7]},
{NINJA_SLICED_HACK + 5, NINJA_DIESLICED_RATE-4, NullNinja, &s_NinjaDieSlicedHack[8]},
{NINJA_SLICED_HACK + 6, SF_QUICK_CALL , DoNinjaSpecial, &s_NinjaDieSlicedHack[9]},
{NINJA_SLICED_HACK + 6, NINJA_DIESLICED_RATE-5, NullNinja, &s_NinjaDieSlicedHack[10]},
{NINJA_SLICED_HACK + 7, SF_QUICK_CALL , QueueFloorBlood, &s_NinjaDieSlicedHack[11]},
{NINJA_SLICED_HACK + 7, NINJA_DIESLICED_RATE-6, DoActorDebris, &s_NinjaDieSlicedHack[11]},
};
STATE s_NinjaDead[] = STATE s_NinjaDead[] =
{ {
@ -1559,6 +1582,11 @@ STATEp sg_NinjaDieSliced[] =
s_NinjaDieSliced s_NinjaDieSliced
}; };
STATEp sg_NinjaDieSlicedHack[] =
{
s_NinjaDieSlicedHack
};
STATEp sg_NinjaDead[] = STATEp sg_NinjaDead[] =
{ {
s_NinjaDead s_NinjaDead
@ -1997,7 +2025,10 @@ DoNinjaMove(short SpriteNum)
if (TEST(u->Flags2, SPR2_DYING)) if (TEST(u->Flags2, SPR2_DYING))
{ {
NewStateGroup(SpriteNum, sg_NinjaGrabThroat); if (sw_ninjahack)
NewStateGroup(SpriteNum, sg_NinjaHariKari);
else
NewStateGroup(SpriteNum, sg_NinjaGrabThroat);
return 0; return 0;
} }
@ -2095,7 +2126,10 @@ int DoNinjaPain(short SpriteNum)
if (TEST(u->Flags2, SPR2_DYING)) if (TEST(u->Flags2, SPR2_DYING))
{ {
NewStateGroup(SpriteNum, sg_NinjaGrabThroat); if (sw_ninjahack)
NewStateGroup(SpriteNum, sg_NinjaHariKari);
else
NewStateGroup(SpriteNum, sg_NinjaGrabThroat);
return 0; return 0;
} }

View file

@ -118,8 +118,7 @@ int ChangeWeapon(PLAYERp);
ANIMATOR InitFire; ANIMATOR InitFire;
int int NullAnimator(short SpriteNum)
NullAnimator(short SpriteNum)
{ {
return 0; return 0;
} }
@ -129,8 +128,7 @@ void pNullAnimator(PANEL_SPRITEp psp)
return; return;
} }
PANEL_SPRITEp PANEL_SPRITEp pFindMatchingSprite(PLAYERp pp, int x, int y, short pri)
pFindMatchingSprite(PLAYERp pp, int x, int y, short pri)
{ {
PANEL_SPRITEp nsp; PANEL_SPRITEp nsp;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -150,8 +148,7 @@ pFindMatchingSprite(PLAYERp pp, int x, int y, short pri)
return NULL; return NULL;
} }
PANEL_SPRITEp PANEL_SPRITEp pFindMatchingSpriteID(PLAYERp pp, short id, int x, int y, short pri)
pFindMatchingSpriteID(PLAYERp pp, short id, int x, int y, short pri)
{ {
PANEL_SPRITEp nsp; PANEL_SPRITEp nsp;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -171,8 +168,7 @@ pFindMatchingSpriteID(PLAYERp pp, short id, int x, int y, short pri)
return NULL; return NULL;
} }
SWBOOL SWBOOL pKillScreenSpiteIDs(PLAYERp pp, short id)
pKillScreenSpiteIDs(PLAYERp pp, short id)
{ {
PANEL_SPRITEp nsp=NULL; PANEL_SPRITEp nsp=NULL;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -194,8 +190,7 @@ pKillScreenSpiteIDs(PLAYERp pp, short id)
// Used to sprites in the view at correct aspect ratio and x,y location. // Used to sprites in the view at correct aspect ratio and x,y location.
PANEL_SPRITEp PANEL_SPRITEp pSpawnFullViewSprite(PLAYERp pp, short pic, short pri, int x, int y)
pSpawnFullViewSprite(PLAYERp pp, short pic, short pri, int x, int y)
{ {
PANEL_SPRITEp nsp; PANEL_SPRITEp nsp;
@ -219,8 +214,7 @@ pSpawnFullViewSprite(PLAYERp pp, short pic, short pri, int x, int y)
// Used to display panel info at correct aspect ratio and x,y location on the // Used to display panel info at correct aspect ratio and x,y location on the
// status panel. Sprites will kill themselves after writing to all pages. // status panel. Sprites will kill themselves after writing to all pages.
PANEL_SPRITEp PANEL_SPRITEp pSpawnFullScreenSprite(PLAYERp pp, short pic, short pri, int x, int y)
pSpawnFullScreenSprite(PLAYERp pp, short pic, short pri, int x, int y)
{ {
PANEL_SPRITEp nsp; PANEL_SPRITEp nsp;
@ -294,8 +288,7 @@ void ArmorCalc(int damage_amt, int *armor_damage, int *player_damage)
} }
void void PlayerUpdateHealth(PLAYERp pp, short value)
PlayerUpdateHealth(PLAYERp pp, short value)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -421,8 +414,7 @@ PlayerUpdateHealth(PLAYERp pp, short value)
} }
void void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -488,8 +480,7 @@ PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
DisplayPanelNumber(pp, x, y, pp->WpnAmmo[WeaponNum]); DisplayPanelNumber(pp, x, y, pp->WpnAmmo[WeaponNum]);
} }
void void PlayerUpdateWeaponSummary(PLAYERp pp, short UpdateWeaponNum)
PlayerUpdateWeaponSummary(PLAYERp pp, short UpdateWeaponNum)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -568,8 +559,7 @@ void PlayerUpdateWeaponSummaryAll(PLAYERp pp)
} }
} }
void void PlayerUpdateWeapon(PLAYERp pp, short WeaponNum)
PlayerUpdateWeapon(PLAYERp pp, short WeaponNum)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
@ -586,8 +576,7 @@ PlayerUpdateWeapon(PLAYERp pp, short WeaponNum)
PlayerUpdateWeaponSummaryAll(pp); PlayerUpdateWeaponSummaryAll(pp);
} }
void void PlayerUpdateKills(PLAYERp pp, short value)
PlayerUpdateKills(PLAYERp pp, short value)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
@ -635,8 +624,7 @@ PlayerUpdateKills(PLAYERp pp, short value)
DisplayFragNumbers(pp); DisplayFragNumbers(pp);
} }
void void PlayerUpdateArmor(PLAYERp pp, short value)
PlayerUpdateArmor(PLAYERp pp, short value)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -671,8 +659,7 @@ PlayerUpdateArmor(PLAYERp pp, short value)
} }
void void PlayerUpdateKeys(PLAYERp pp)
PlayerUpdateKeys(PLAYERp pp)
{ {
#define PANEL_KEYS_BOX_X 276 #define PANEL_KEYS_BOX_X 276
#define PANEL_KEYS_XOFF 0 #define PANEL_KEYS_XOFF 0
@ -754,8 +741,7 @@ PlayerUpdateKeys(PLAYERp pp)
} }
} }
void void PlayerUpdateTimeLimit(PLAYERp pp)
PlayerUpdateTimeLimit(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
short x,y; short x,y;
@ -781,8 +767,7 @@ PlayerUpdateTimeLimit(PLAYERp pp)
DisplaySummaryString(pp, PANEL_KEYS_BOX_X+1, PANEL_BOX_Y+6, 0, 0, ds); DisplaySummaryString(pp, PANEL_KEYS_BOX_X+1, PANEL_BOX_Y+6, 0, 0, ds);
} }
void void PlayerUpdatePanelInfo(PLAYERp pp)
PlayerUpdatePanelInfo(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
int i; int i;
@ -790,6 +775,9 @@ PlayerUpdatePanelInfo(PLAYERp pp)
if (Prediction) if (Prediction)
return; return;
if (UsingMenus)
return;
PlayerUpdateHealth(pp, 0); PlayerUpdateHealth(pp, 0);
PlayerUpdateInventory(pp, pp->InventoryNum); PlayerUpdateInventory(pp, pp->InventoryNum);
PlayerUpdateAmmo(pp, u->WeaponNum, 0); PlayerUpdateAmmo(pp, u->WeaponNum, 0);
@ -800,8 +788,7 @@ PlayerUpdatePanelInfo(PLAYERp pp)
PlayerUpdateTimeLimit(pp); PlayerUpdateTimeLimit(pp);
} }
int int WeaponOperate(PLAYERp pp)
WeaponOperate(PLAYERp pp)
{ {
short weapon; short weapon;
int DoPlayerSpriteReset(short SpriteNum); int DoPlayerSpriteReset(short SpriteNum);
@ -896,6 +883,7 @@ WeaponOperate(PLAYERp pp)
if (TEST(pp->Flags, PF_TWO_UZI)) if (TEST(pp->Flags, PF_TWO_UZI))
{ {
pp->WpnUziType++; pp->WpnUziType++;
PlaySound(DIGI_UZI_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow);
if (pp->WpnUziType > 1) if (pp->WpnUziType > 1)
pp->WpnUziType = 0; pp->WpnUziType = 0;
} }
@ -908,6 +896,7 @@ WeaponOperate(PLAYERp pp)
if (u->WeaponNum == WPN_MICRO) if (u->WeaponNum == WPN_MICRO)
{ {
pp->WpnRocketType++; pp->WpnRocketType++;
PlaySound(DIGI_ROCKET_UP, &pp->posx, &pp->posy, &pp->posz, v3df_follow);
if (pp->WpnRocketType > 2) if (pp->WpnRocketType > 2)
pp->WpnRocketType = 0; pp->WpnRocketType = 0;
if (pp->WpnRocketType == 2 && pp->WpnRocketNuke == 0) if (pp->WpnRocketType == 2 && pp->WpnRocketNuke == 0)
@ -1017,11 +1006,19 @@ WeaponOperate(PLAYERp pp)
SWBOOL SWBOOL
WeaponOK(PLAYERp pp) WeaponOK(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u;
short min_ammo, WeaponNum, FindWeaponNum; short min_ammo, WeaponNum, FindWeaponNum;
static char wpn_order[] = {2,3,4,5,6,7,8,9,1,0}; static char wpn_order[] = {2,3,4,5,6,7,8,9,1,0};
unsigned wpn_ndx=0; unsigned wpn_ndx=0;
if ((unsigned)pp->PlayerSprite >= MAXSPRITES)
return(FALSE);
u = User[pp->PlayerSprite];
if (u == NULL)
return(FALSE);
// sword // sword
if (DamageData[u->WeaponNum].max_ammo == -1) if (DamageData[u->WeaponNum].max_ammo == -1)
return TRUE; return TRUE;
@ -1262,8 +1259,7 @@ void SpecialUziRetractFunc(PANEL_SPRITEp psp)
} }
} }
void void RetractCurWpn(PLAYERp pp)
RetractCurWpn(PLAYERp pp)
{ {
// Retract old weapon // Retract old weapon
if (pp->CurWpn) if (pp->CurWpn)
@ -6277,9 +6273,11 @@ pChopsWait(PANEL_SPRITEp psp)
} }
} }
void void ChopsSetRetract(PLAYERp pp)
ChopsSetRetract(PLAYERp pp) {
{ if (pp == NULL || pp->Chops == NULL)
return;
pSetState(pp->Chops, pp->Chops->RetractState); pSetState(pp->Chops, pp->Chops->RetractState);
} }
@ -7450,6 +7448,7 @@ pDisplaySprites(PLAYERp pp)
break; break;
case STAR_REST: case STAR_REST:
case 2510:
if (!useDarts) if (!useDarts)
picnum = 2138; picnum = 2138;
else else

View file

@ -6368,8 +6368,8 @@ char *KilledPlayerMessage(PLAYERp pp, PLAYERp killer)
{ {
#define MAX_KILL_NOTES 16 #define MAX_KILL_NOTES 16
short rnd = STD_RANDOM_RANGE(MAX_KILL_NOTES); short rnd = STD_RANDOM_RANGE(MAX_KILL_NOTES);
char *p1 = pp->PlayerName; const char *p1 = pp->PlayerName;
char *p2 = killer->PlayerName; const char *p2 = killer->PlayerName;
if (pp->HitBy == killer->PlayerSprite) if (pp->HitBy == killer->PlayerSprite)
{ {
@ -7511,14 +7511,20 @@ DoPlayerRun(PLAYERp pp)
} }
int void
PlayerStateControl(int16_t SpriteNum) PlayerStateControl(int16_t SpriteNum)
{ {
USERp u; USERp u;
if ((unsigned)SpriteNum >= MAXSPRITES)
return;
// Convienience var // Convienience var
u = User[SpriteNum]; u = User[SpriteNum];
if (u == NULL)
return;
u->Tics += synctics; u->Tics += synctics;
// Skip states if too much time has passed // Skip states if too much time has passed
@ -7562,7 +7568,7 @@ PlayerStateControl(int16_t SpriteNum)
if (u->State->Animator) if (u->State->Animator)
(*u->State->Animator)(SpriteNum); (*u->State->Animator)(SpriteNum);
return 0; return;
} }
void void
@ -7599,9 +7605,15 @@ MoveSkipSavePos(void)
{ {
TRAVERSE_SPRITE_STAT(headspritestat[stat], i, nexti) TRAVERSE_SPRITE_STAT(headspritestat[stat], i, nexti)
{ {
if ((unsigned)i >= MAXSPRITES)
continue;
sp = &sprite[i]; sp = &sprite[i];
u = User[i]; u = User[i];
if (sp == NULL || u == NULL)
continue;
u->ox = sp->x; u->ox = sp->x;
u->oy = sp->y; u->oy = sp->y;
u->oz = sp->z; u->oz = sp->z;
@ -7618,9 +7630,13 @@ MoveSkipSavePos(void)
{ {
TRAVERSE_SPRITE_STAT(headspritestat[stat], i, nexti) TRAVERSE_SPRITE_STAT(headspritestat[stat], i, nexti)
{ {
if ((unsigned)i >= MAXSPRITES)
continue;
sp = &sprite[i]; sp = &sprite[i];
u = User[i]; u = User[i];
if (sp == NULL || u == NULL)
continue;
u->ox = sp->x; u->ox = sp->x;
u->oy = sp->y; u->oy = sp->y;
u->oz = sp->z; u->oz = sp->z;

View file

@ -110,8 +110,7 @@ extern STATE s_NotRestored[];
OrgTileListP otlist[] = {&orgwalllist, &orgwalloverlist, &orgsectorceilinglist, &orgsectorfloorlist}; OrgTileListP otlist[] = {&orgwalllist, &orgwalloverlist, &orgsectorceilinglist, &orgsectorfloorlist};
int int PanelSpriteToNdx(PLAYERp pp, PANEL_SPRITEp psprite)
PanelSpriteToNdx(PLAYERp pp, PANEL_SPRITEp psprite)
{ {
short ndx = 0; short ndx = 0;
PANEL_SPRITEp psp=NULL, next=NULL; PANEL_SPRITEp psp=NULL, next=NULL;
@ -132,8 +131,7 @@ PanelSpriteToNdx(PLAYERp pp, PANEL_SPRITEp psprite)
} }
PANEL_SPRITEp PANEL_SPRITEp PanelNdxToSprite(PLAYERp pp, int ndx)
PanelNdxToSprite(PLAYERp pp, int ndx)
{ {
short count = 0; short count = 0;
PANEL_SPRITEp psp, next; PANEL_SPRITEp psp, next;
@ -176,6 +174,7 @@ int SaveSymDataInfo(MFILE_WRITE fil, void *ptr)
return 0; return 0;
} }
static int SaveSymCodeInfo_raw(MFILE_WRITE fil, void *ptr) static int SaveSymCodeInfo_raw(MFILE_WRITE fil, void *ptr)
{ {
savedcodesym sym; savedcodesym sym;

View file

@ -154,7 +154,7 @@ void GetToken(SWBOOL crossline)
if (script_p >= scriptend_p) if (script_p >= scriptend_p)
{ {
if (!crossline) if (!crossline)
buildprintf("Error: Line %i is incomplete\n",scriptline); initprintf("Error: Line %i is incomplete\n",scriptline);
endofscript = TRUE; endofscript = TRUE;
return; return;
} }
@ -168,14 +168,14 @@ skipspace:
if (script_p >= scriptend_p) if (script_p >= scriptend_p)
{ {
if (!crossline) if (!crossline)
buildprintf("Error: Line %i is incomplete\n",scriptline); initprintf("Error: Line %i is incomplete\n",scriptline);
endofscript = TRUE; endofscript = TRUE;
return; return;
} }
if (*script_p++ == '\n') if (*script_p++ == '\n')
{ {
if (!crossline) if (!crossline)
buildprintf("Error: Line %i is incomplete\n",scriptline); initprintf("Error: Line %i is incomplete\n",scriptline);
scriptline++; scriptline++;
} }
} }
@ -183,7 +183,7 @@ skipspace:
if (script_p >= scriptend_p) if (script_p >= scriptend_p)
{ {
if (!crossline) if (!crossline)
buildprintf("Error: Line %i is incomplete\n",scriptline); initprintf("Error: Line %i is incomplete\n",scriptline);
endofscript = TRUE; endofscript = TRUE;
return; return;
} }
@ -191,7 +191,7 @@ skipspace:
if (*script_p == '#') // # is comment field if (*script_p == '#') // # is comment field
{ {
if (!crossline) if (!crossline)
buildprintf("Error: Line %i is incomplete\n",scriptline); initprintf("Error: Line %i is incomplete\n",scriptline);
while (*script_p++ != '\n') while (*script_p++ != '\n')
if (script_p >= scriptend_p) if (script_p >= scriptend_p)
{ {
@ -212,7 +212,7 @@ skipspace:
if (script_p == scriptend_p) if (script_p == scriptend_p)
break; break;
ASSERT(token_p != &token[MAXTOKEN]); ASSERT(token_p != &token[MAXTOKEN]);
// buildprintf("Error: Token too large on line %i\n",scriptline); // initprintf("Error: Token too large on line %i\n",scriptline);
} }
*token_p = 0; *token_p = 0;
@ -495,7 +495,6 @@ static int cm_transtok(const char *tok, const struct _tokset *set, const unsigne
return -1; return -1;
} }
// Load custom map and episode information
// level # { // level # {
// title "Map Name" // title "Map Name"
// filename "filename.map" // filename "filename.map"
@ -613,7 +612,7 @@ void LoadCustomInfoFromScript(const char *filename)
// first map file in LevelInfo[] is bogus, last map file is NULL // first map file in LevelInfo[] is bogus, last map file is NULL
if (curmap < 1 || curmap > MAX_LEVELS_REG) if (curmap < 1 || curmap > MAX_LEVELS_REG)
{ {
buildprintf("Error: map number %d not in range 1-%d on line %s:%d\n", initprintf("Error: map number %d not in range 1-%d on line %s:%d\n",
curmap, MAX_LEVELS_REG, script->filename, curmap, MAX_LEVELS_REG, script->filename,
scriptfile_getlinum(script,mapnumptr)); scriptfile_getlinum(script,mapnumptr));
script->textptr = braceend; script->textptr = braceend;
@ -687,7 +686,7 @@ void LoadCustomInfoFromScript(const char *filename)
break; break;
} }
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;
@ -706,7 +705,7 @@ void LoadCustomInfoFromScript(const char *filename)
// first map file in LevelInfo[] is bogus, last map file is NULL // first map file in LevelInfo[] is bogus, last map file is NULL
if ((unsigned)--curmap >= 2u) if ((unsigned)--curmap >= 2u)
{ {
buildprintf("Error: episode number %d not in range 1-2 on line %s:%d\n", initprintf("Error: episode number %d not in range 1-2 on line %s:%d\n",
curmap, script->filename, curmap, script->filename,
scriptfile_getlinum(script,epnumptr)); scriptfile_getlinum(script,epnumptr));
script->textptr = braceend; script->textptr = braceend;
@ -738,7 +737,7 @@ void LoadCustomInfoFromScript(const char *filename)
break; break;
} }
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;
@ -757,7 +756,7 @@ void LoadCustomInfoFromScript(const char *filename)
// first map file in LevelInfo[] is bogus, last map file is NULL // first map file in LevelInfo[] is bogus, last map file is NULL
if ((unsigned)--curmap >= 4u) if ((unsigned)--curmap >= 4u)
{ {
buildprintf("Error: skill number %d not in range 1-4 on line %s:%d\n", initprintf("Error: skill number %d not in range 1-4 on line %s:%d\n",
curmap, script->filename, curmap, script->filename,
scriptfile_getlinum(script,epnumptr)); scriptfile_getlinum(script,epnumptr));
script->textptr = braceend; script->textptr = braceend;
@ -780,7 +779,7 @@ void LoadCustomInfoFromScript(const char *filename)
break; break;
} }
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;
@ -859,7 +858,7 @@ void LoadCustomInfoFromScript(const char *filename)
if ((unsigned)--in >= (unsigned)InvDecl_TOTAL) if ((unsigned)--in >= (unsigned)InvDecl_TOTAL)
{ {
buildprintf("Error: inventory item number not in range 1-%d on line %s:%d\n", initprintf("Error: inventory item number not in range 1-%d on line %s:%d\n",
InvDecl_TOTAL, script->filename, InvDecl_TOTAL, script->filename,
scriptfile_getlinum(script,invnumptr)); scriptfile_getlinum(script,invnumptr));
script->textptr = braceend; script->textptr = braceend;
@ -879,7 +878,7 @@ void LoadCustomInfoFromScript(const char *filename)
if (scriptfile_getnumber(script, &amt)) break; if (scriptfile_getnumber(script, &amt)) break;
break; break;
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;
@ -911,7 +910,7 @@ void LoadCustomInfoFromScript(const char *filename)
if ((unsigned)--in >= (unsigned)SIZ(weaponmap)) if ((unsigned)--in >= (unsigned)SIZ(weaponmap))
{ {
buildprintf("Error: weapon number not in range 1-%d on line %s:%d\n", initprintf("Error: weapon number not in range 1-%d on line %s:%d\n",
(int)SIZ(weaponmap), script->filename, (int)SIZ(weaponmap), script->filename,
scriptfile_getlinum(script,wpnnumptr)); scriptfile_getlinum(script,wpnnumptr));
script->textptr = braceend; script->textptr = braceend;
@ -946,7 +945,7 @@ void LoadCustomInfoFromScript(const char *filename)
if (scriptfile_getnumber(script, &wpickup)) break; if (scriptfile_getnumber(script, &wpickup)) break;
break; break;
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;
@ -984,7 +983,7 @@ void LoadCustomInfoFromScript(const char *filename)
case CM_SECRET: case CM_SECRET:
case CM_QUIT: case CM_QUIT:
default: default:
buildprintf("Error on line %s:%d\n", initprintf("Error on line %s:%d\n",
script->filename, script->filename,
scriptfile_getlinum(script,script->ltextptr)); scriptfile_getlinum(script,script->ltextptr));
break; break;

View file

@ -792,7 +792,7 @@ DoSpringBoardDown(void)
{ {
int destz; int destz;
destz = sector[nextsectorneighborz(sbp->Sector, sector[sbp->Sector].floorz, 1, 1)].floorz; destz = sector[nextsectorneighborz(sbp->Sector, sector[sbp->Sector].floorz, SEARCH_FLOOR, SEARCH_DOWN)].floorz;
AnimSet(&sector[sbp->Sector].floorz, destz, 256); AnimSet(&sector[sbp->Sector].floorz, destz, 256);

View file

@ -583,8 +583,7 @@ StopSound(void)
#define MAXLEVLDIST 19000 // The higher the number, the further away you can hear sound #define MAXLEVLDIST 19000 // The higher the number, the further away you can hear sound
short short SoundDist(int x, int y, int z, int basedist)
SoundDist(int x, int y, int z, int basedist)
{ {
double tx, ty, tz; double tx, ty, tz;
double sqrdist,retval; double sqrdist,retval;
@ -637,8 +636,7 @@ SoundDist(int x, int y, int z, int basedist)
// Angle calcuations - may need to be checked to make sure they are right // Angle calcuations - may need to be checked to make sure they are right
// //
short short SoundAngle(int x, int y)
SoundAngle(int x, int y)
{ {
extern short screenpeek; extern short screenpeek;
@ -783,8 +781,7 @@ SWBOOL CacheSound(int num, int type)
#define SOUND_UNIT MAXLEVLDIST/255 #define SOUND_UNIT MAXLEVLDIST/255
// NOTE: If v3df_follow == 1, x,y,z are considered literal coordinates // NOTE: If v3df_follow == 1, x,y,z are considered literal coordinates
int int PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags)
PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags)
{ {
VOC_INFOp vp; VOC_INFOp vp;
VOC3D_INFOp v3p; VOC3D_INFOp v3p;
@ -1221,8 +1218,7 @@ void COVER_SetReverb(int amt)
=================== ===================
*/ */
void void MusicShutdown(void)
MusicShutdown(void)
{ {
StopSong(); StopSong();
@ -1980,5 +1976,4 @@ PlaySpriteSound(short spritenum, int attrib_ndx, Voc3D_Flags flags)
PlaySound(u->Attrib->Sounds[attrib_ndx], &sp->x, &sp->y, &sp->z, flags); PlaySound(u->Attrib->Sounds[attrib_ndx], &sp->x, &sp->y, &sp->z, flags);
} }
// vim:ts=4:sw=4:expandtab:
END_SW_NS END_SW_NS

View file

@ -777,7 +777,7 @@ KillSprite(int16_t SpriteNum)
{ {
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ENEMY], i, nexti) TRAVERSE_SPRITE_STAT(headspritestat[STAT_ENEMY], i, nexti)
{ {
if (User[i]->tgt_sp == sp) if ((unsigned)i < MAXSPRITES && User[i] != NULL && User[i]->tgt_sp == sp)
{ {
DoActorPickClosePlayer(i); DoActorPickClosePlayer(i);
} }
@ -957,6 +957,9 @@ SpawnSprite(short stat, short id, STATEp state, short sectnum, int x, int y, int
int16_t SpriteNum; int16_t SpriteNum;
USERp u; USERp u;
if (sectnum < 0)
return -1;
ASSERT(!Prediction); ASSERT(!Prediction);
PRODUCTION_ASSERT(sectnum >= 0 && sectnum < MAXSECTORS); PRODUCTION_ASSERT(sectnum >= 0 && sectnum < MAXSECTORS);
@ -1083,7 +1086,7 @@ ActorTestSpawn(SPRITEp sp)
case ZILLA_RUN_R0: c = "zilla"; break; case ZILLA_RUN_R0: c = "zilla"; break;
default: c = "?"; break; default: c = "?"; break;
} }
buildprintf("WARNING: skill-masked %s at %d,%d,%d not being killed because it " initprintf("WARNING: skill-masked %s at %d,%d,%d not being killed because it "
"activates something\n", c, TrackerCast(sp->x), TrackerCast(sp->y), TrackerCast(sp->z)); "activates something\n", c, TrackerCast(sp->x), TrackerCast(sp->y), TrackerCast(sp->z));
return TRUE; return TRUE;
} }
@ -5953,11 +5956,8 @@ KeyMain:
if (pp->WpnAmmo[WPN_STAR] >= DamageData[WPN_STAR].max_ammo) if (pp->WpnAmmo[WPN_STAR] >= DamageData[WPN_STAR].max_ammo)
break; break;
#ifdef UK_VERSION //if (useDarts) sprintf(ds,"Darts");
sprintf(ds,"Darts"); //else sprintf(ds,"Shurikens");
#else
//sprintf(ds,"Shurikens");
#endif
PutStringInfo(Player+pnum, DamageData[WPN_STAR].weapon_name); PutStringInfo(Player+pnum, DamageData[WPN_STAR].weapon_name);
PlayerUpdateAmmo(pp, WPN_STAR, DamageData[WPN_STAR].weapon_pickup); PlayerUpdateAmmo(pp, WPN_STAR, DamageData[WPN_STAR].weapon_pickup);
SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup
@ -6937,6 +6937,8 @@ SpriteControl(void)
{ {
u = User[i]; u = User[i];
if (u == 0)
continue;
if (u->Tics) if (u->Tics)
{ {
if ((u->Tics -= synctics) <= 0) if ((u->Tics -= synctics) <= 0)
@ -6966,6 +6968,9 @@ SpriteControl(void)
if (!TEST(u->Flags, SPR_ACTIVE)) if (!TEST(u->Flags, SPR_ACTIVE))
continue; continue;
if (i == 69 && nexti == -1)
continue;
(*User[i]->ActorActionFunc)(i); (*User[i]->ActorActionFunc)(i);
} }

View file

@ -884,7 +884,7 @@ BossHealthMeter(void)
serpwasseen = TRUE; serpwasseen = TRUE;
if (!SW_SHAREWARE && MusicEnabled()) if (!SW_SHAREWARE && MusicEnabled())
{ {
PlaySong(0, 13, TRUE, TRUE); PlaySong(0, ThemeTrack[2], TRUE, TRUE);
} }
} }
else if (i == 1 && !sumowasseen) else if (i == 1 && !sumowasseen)
@ -892,7 +892,7 @@ BossHealthMeter(void)
sumowasseen = TRUE; sumowasseen = TRUE;
if (!SW_SHAREWARE && MusicEnabled()) if (!SW_SHAREWARE && MusicEnabled())
{ {
PlaySong(0, 13, TRUE, TRUE); PlaySong(0, ThemeTrack[3], TRUE, TRUE);
} }
} }
else if (i == 2 && !zillawasseen) else if (i == 2 && !zillawasseen)
@ -900,7 +900,7 @@ BossHealthMeter(void)
zillawasseen = TRUE; zillawasseen = TRUE;
if (!SW_SHAREWARE && MusicEnabled()) if (!SW_SHAREWARE && MusicEnabled())
{ {
PlaySong(0, 13, TRUE, TRUE); PlaySong(0, ThemeTrack[4], TRUE, TRUE);
} }
} }
} }
@ -922,7 +922,7 @@ BossHealthMeter(void)
// This is needed because of possible saved game situation // This is needed because of possible saved game situation
if (!SW_SHAREWARE && !triedplay) if (!SW_SHAREWARE && !triedplay)
{ {
PlaySong(0, 13, TRUE, FALSE); PlaySong(0, ThemeTrack[i+2], TRUE, FALSE);
triedplay = TRUE; // Only try once, then give up triedplay = TRUE; // Only try once, then give up
} }

3
source/sw/src/swcvar.cpp Normal file
View file

@ -0,0 +1,3 @@
#include "swcvars.h"
CVAR(Bool, sw_ninjahack, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);

4
source/sw/src/swcvar.h Normal file
View file

@ -0,0 +1,4 @@
#include "c_cvars.h"
EXTERN_CVAR(Bool, sw_ninjahack)

View file

@ -61,8 +61,7 @@ const char *KeyDoorMessage[MAX_KEYS] =
"You need a RED key for this door." "You need a RED key for this door."
}; };
void void DisplaySummaryString(PLAYERp pp, short xs, short ys, short color, short shade, const char *buffer)
DisplaySummaryString(PLAYERp pp, short xs, short ys, short color, short shade, const char *buffer)
{ {
short size,x; short size,x;
const char *ptr; const char *ptr;
@ -98,8 +97,7 @@ DisplaySummaryString(PLAYERp pp, short xs, short ys, short color, short shade, c
} }
} }
PANEL_SPRITEp PANEL_SPRITEp pClearTextLineID(PLAYERp pp, short id, int y, short pri)
pClearTextLineID(PLAYERp pp, short id, long y, short pri)
{ {
PANEL_SPRITEp nsp=NULL; PANEL_SPRITEp nsp=NULL;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -122,8 +120,7 @@ pClearTextLineID(PLAYERp pp, short id, long y, short pri)
} }
// only call this from menu code - it does a pKillSprite // only call this from menu code - it does a pKillSprite
PANEL_SPRITEp PANEL_SPRITEp pMenuClearTextLineID(PLAYERp pp, short id, int y, short pri)
pMenuClearTextLineID(PLAYERp pp, short id, long y, short pri)
{ {
PANEL_SPRITEp nsp=NULL; PANEL_SPRITEp nsp=NULL;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -146,15 +143,13 @@ pMenuClearTextLineID(PLAYERp pp, short id, long y, short pri)
} }
void void pClearTextLine(PLAYERp pp, int y)
pClearTextLine(PLAYERp pp, long y)
{ {
SetRedrawScreen(pp); SetRedrawScreen(pp);
pClearTextLineID(pp, ID_TEXT, y, PRI_FRONT_MAX); pClearTextLineID(pp, ID_TEXT, y, PRI_FRONT_MAX);
} }
void void StringTimer(PANEL_SPRITEp psp)
StringTimer(PANEL_SPRITEp psp)
{ {
if ((psp->kill_tics -= synctics) <= 0) if ((psp->kill_tics -= synctics) <= 0)
{ {
@ -165,8 +160,7 @@ StringTimer(PANEL_SPRITEp psp)
} }
} }
void void PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds)
PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds)
{ {
int ndx, offset; int ndx, offset;
char c; char c;
@ -213,14 +207,12 @@ PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds)
} }
} }
void void KillString(PLAYERp pp, short y)
KillString(PLAYERp pp, short y)
{ {
pClearTextLineID(pp, ID_TEXT, y, PRI_FRONT_MAX); pClearTextLineID(pp, ID_TEXT, y, PRI_FRONT_MAX);
} }
PANEL_SPRITEp PANEL_SPRITEp pClearSpriteXY(PLAYERp pp, short x, short y)
pClearSpriteXY(PLAYERp pp, short x, short y)
{ {
PANEL_SPRITEp nsp=NULL; PANEL_SPRITEp nsp=NULL;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -234,8 +226,7 @@ pClearSpriteXY(PLAYERp pp, short x, short y)
return NULL; return NULL;
} }
PANEL_SPRITEp PANEL_SPRITEp pClearSpriteID(PLAYERp pp, short id)
pClearSpriteID(PLAYERp pp, short id)
{ {
PANEL_SPRITEp nsp=NULL; PANEL_SPRITEp nsp=NULL;
PANEL_SPRITEp psp=NULL, next; PANEL_SPRITEp psp=NULL, next;
@ -250,8 +241,7 @@ pClearSpriteID(PLAYERp pp, short id)
} }
void void DisplayPanelNumber(PLAYERp pp, short xs, short ys, int number)
DisplayPanelNumber(PLAYERp pp, short xs, short ys, int number)
{ {
char buffer[32]; char buffer[32];
char *ptr; char *ptr;
@ -273,8 +263,7 @@ DisplayPanelNumber(PLAYERp pp, short xs, short ys, int number)
} }
} }
void void DisplayMiniBarNumber(PLAYERp pp, short xs, short ys, int number)
DisplayMiniBarNumber(PLAYERp pp, short xs, short ys, int number)
{ {
char buffer[32]; char buffer[32];
char *ptr; char *ptr;
@ -301,8 +290,7 @@ DisplayMiniBarNumber(PLAYERp pp, short xs, short ys, int number)
} }
} }
void void DisplayMiniBarSmString(PLAYERp pp, short xs, short ys, short pal, const char *buffer)
DisplayMiniBarSmString(PLAYERp pp, short xs, short ys, short pal, const char *buffer)
{ {
short size=4,x; short size=4,x;
const char *ptr; const char *ptr;
@ -321,14 +309,12 @@ DisplayMiniBarSmString(PLAYERp pp, short xs, short ys, short pal, const char *bu
pic = FRAG_FIRST_TILE + (*ptr - FRAG_FIRST_ASCII); pic = FRAG_FIRST_TILE + (*ptr - FRAG_FIRST_ASCII);
rotatesprite((long)x << 16, (long)ys << 16, (1 << 16), 0, rotatesprite((int)x << 16, (int)ys << 16, (1 << 16), 0, pic, 0, pal,
pic, 0, pal,
ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1);
} }
} }
void void DisplaySmString(PLAYERp pp, short xs, short ys, short pal, const char *buffer)
DisplaySmString(PLAYERp pp, short xs, short ys, short pal, const char *buffer)
{ {
short size=4,x; short size=4,x;
const char *ptr; const char *ptr;
@ -352,8 +338,7 @@ DisplaySmString(PLAYERp pp, short xs, short ys, short pal, const char *buffer)
} }
} }
void void DisplayFragString(PLAYERp pp, short xs, short ys, const char *buffer)
DisplayFragString(PLAYERp pp, short xs, short ys, const char *buffer)
{ {
short size=4,x; short size=4,x;
const char *ptr; const char *ptr;
@ -383,8 +368,7 @@ DisplayFragString(PLAYERp pp, short xs, short ys, const char *buffer)
} }
} }
void void DisplayFragNumbers(PLAYERp pp)
DisplayFragNumbers(PLAYERp pp)
{ {
char buffer[32]; char buffer[32];
char *ptr; char *ptr;
@ -423,8 +407,7 @@ DisplayFragNumbers(PLAYERp pp)
DisplayFragString(pp, xs, ys, buffer); DisplayFragString(pp, xs, ys, buffer);
} }
void void DisplayFragNames(PLAYERp pp)
DisplayFragNames(PLAYERp pp)
{ {
char *ptr; char *ptr;
short x, xs, ys, size; short x, xs, ys, size;
@ -508,8 +491,7 @@ void PutStringInfoLine2(PLAYERp pp, const char *string)
PutStringTimer(pp, x, y, string, GlobInfoStringTime); PutStringTimer(pp, x, y, string, GlobInfoStringTime);
} }
void void pMenuClearTextLine(PLAYERp pp)
pMenuClearTextLine(PLAYERp pp)
{ {
pMenuClearTextLineID(pp, ID_TEXT, TEXT_INFO_LINE(0), PRI_FRONT_MAX); pMenuClearTextLineID(pp, ID_TEXT, TEXT_INFO_LINE(0), PRI_FRONT_MAX);
pMenuClearTextLineID(pp, ID_TEXT, TEXT_INFO_LINE(1), PRI_FRONT_MAX); pMenuClearTextLineID(pp, ID_TEXT, TEXT_INFO_LINE(1), PRI_FRONT_MAX);

View file

@ -42,6 +42,6 @@ void DisplayPanelNumber(PLAYERp pp,short xs,short ys,int number);
void PutStringInfo(PLAYERp pp, const char *string); void PutStringInfo(PLAYERp pp, const char *string);
void PutStringInfoLine(PLAYERp pp, const char *string); void PutStringInfoLine(PLAYERp pp, const char *string);
void PutStringInfoLine2(PLAYERp pp, const char *string); void PutStringInfoLine2(PLAYERp pp, const char *string);
void pClearTextLine(PLAYERp pp,long y); void pClearTextLine(PLAYERp pp,int y);
void pMenuClearTextLine(PLAYERp pp); void pMenuClearTextLine(PLAYERp pp);
END_SW_NS END_SW_NS

View file

@ -1936,8 +1936,7 @@ PlayerPart:
} }
} }
void void RefreshPoints(SECTOR_OBJECTp sop, int nx, int ny, SWBOOL dynamic)
RefreshPoints(SECTOR_OBJECTp sop, int nx, int ny, SWBOOL dynamic)
{ {
short wallcount = 0, j, k, startwall, endwall, delta_ang_from_orig; short wallcount = 0, j, k, startwall, endwall, delta_ang_from_orig;
SECTORp *sectp; SECTORp *sectp;

View file

@ -38,6 +38,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "network.h" #include "network.h"
#include "pal.h" #include "pal.h"
#include "vis.h" #include "vis.h"
#include "swcvar.h"
#include "ai.h" #include "ai.h"
#include "weapon.h" #include "weapon.h"
@ -5402,6 +5403,7 @@ ActorHealth(short SpriteNum, short amt)
case NINJA_RUN_R0: case NINJA_RUN_R0:
{ {
extern STATEp sg_NinjaGrabThroat[]; extern STATEp sg_NinjaGrabThroat[];
extern STATEp sg_NinjaHariKari[];
if (TEST(u->Flags2, SPR2_DYING)) return TRUE; if (TEST(u->Flags2, SPR2_DYING)) return TRUE;
if (TEST(u->Flags, SPR_FALLING | SPR_JUMPING | SPR_CLIMBING)) return TRUE; if (TEST(u->Flags, SPR_FALLING | SPR_JUMPING | SPR_CLIMBING)) return TRUE;
@ -5421,6 +5423,9 @@ ActorHealth(short SpriteNum, short amt)
InitBloodSpray(SpriteNum,FALSE,105); InitBloodSpray(SpriteNum,FALSE,105);
sp->ang = NORM_ANGLE(getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y) + 1024); sp->ang = NORM_ANGLE(getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y) + 1024);
RESET(sp->cstat, CSTAT_SPRITE_YFLIP); RESET(sp->cstat, CSTAT_SPRITE_YFLIP);
if (sw_ninjahack)
NewStateGroup(SpriteNum, sg_NinjaHariKari);
else
NewStateGroup(SpriteNum, sg_NinjaGrabThroat); NewStateGroup(SpriteNum, sg_NinjaGrabThroat);
} }
break; break;
@ -17893,7 +17898,7 @@ InitUzi(PLAYERp pp)
static int uziclock=0; static int uziclock=0;
int clockdiff=0; int clockdiff=0;
SWBOOL FireSnd = FALSE; SWBOOL FireSnd = FALSE;
#define UZIFIRE_WAIT 20 #define UZIFIRE_WAIT 20
void InitUziShell(PLAYERp); void InitUziShell(PLAYERp);
@ -20641,7 +20646,6 @@ SWBOOL TestDontStick(short SpriteNum, short hit_sect, short hit_wall, int hit_z)
{ {
ASSERT(SpriteNum>=0); ASSERT(SpriteNum>=0);
hit_wall = NORM_WALL(u->ret); hit_wall = NORM_WALL(u->ret);
hit_sect = sp->sectnum;
} }
wp = &wall[hit_wall]; wp = &wall[hit_wall];