mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Clean out remaining changes from tree... this is mostly crap like variable name cleanup
git-svn-id: https://svn.eduke32.com/eduke32@1587 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
15b9665dc6
commit
66e7dd15c2
21 changed files with 551 additions and 959 deletions
|
@ -1,7 +1,7 @@
|
|||
duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(JAUDIOLIBDIR)/include/fx_man.h $(JAUDIOLIBDIR)/include/music.h $(INC)/namesdyn.h $(INC)/funct.h $(INC)/duke3d.h
|
||||
gamedef_h=$(SRC)/gamedef.h
|
||||
|
||||
$(OBJ)/game.$o: $(SRC)/game.c $(SRC)/sync.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h
|
||||
$(OBJ)/game.$o: $(SRC)/game.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h
|
||||
$(OBJ)/actors.$o: $(SRC)/actors.c $(duke3d_h)
|
||||
$(OBJ)/anim.$o: $(SRC)/anim.c $(duke3d_h) $(SRC)/jmact/animlib.h
|
||||
$(OBJ)/gamedef.$o: $(SRC)/gamedef.c $(duke3d_h) $(gamedef_h)
|
||||
|
|
|
@ -480,10 +480,6 @@
|
|||
RelativePath=".\source\startwin.game.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\sync.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\winbits.c"
|
||||
>
|
||||
|
|
|
@ -501,7 +501,7 @@ void A_DeleteSprite(int32_t s)
|
|||
|
||||
void A_AddToDeleteQueue(int32_t i)
|
||||
{
|
||||
if (net_peer || g_spriteDeleteQueueSize == 0)
|
||||
if (g_netClientPeer || g_spriteDeleteQueueSize == 0)
|
||||
{
|
||||
deletesprite(i);
|
||||
return;
|
||||
|
@ -626,7 +626,7 @@ void Sect_ClearInterpolation(int32_t i)
|
|||
}
|
||||
}
|
||||
|
||||
static void ms(int32_t i)
|
||||
static void A_MoveSector(int32_t i)
|
||||
{
|
||||
//T1,T2 and T3 are used for all the sector moving stuff!!!
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ static void G_MovePlayers(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (net_server || (net_server || ud.multimode > 1))
|
||||
if (g_netServer || (g_netServer || ud.multimode > 1))
|
||||
otherp = P_FindOtherPlayer(s->yvel,&otherx);
|
||||
else
|
||||
{
|
||||
|
@ -1055,7 +1055,7 @@ static void G_MovePlayers(void)
|
|||
if (actorscrptr[sprite[i].picnum])
|
||||
A_Execute(i,s->yvel,otherx);
|
||||
|
||||
if (net_server || (net_server || ud.multimode > 1))
|
||||
if (g_netServer || (g_netServer || ud.multimode > 1))
|
||||
if (sprite[g_player[otherp].ps->i].extra > 0)
|
||||
{
|
||||
if (s->yrepeat > 32 && sprite[g_player[otherp].ps->i].yrepeat < 32)
|
||||
|
@ -3743,7 +3743,7 @@ static void G_MoveActors(void)
|
|||
gamelightcount++;
|
||||
#endif // POLYMER
|
||||
|
||||
if (!net_server && (!net_server && ud.multimode < 2))
|
||||
if (!g_netServer && (!g_netServer && ud.multimode < 2))
|
||||
{
|
||||
if (g_noEnemies == 1)
|
||||
{
|
||||
|
@ -3946,7 +3946,7 @@ static void G_MoveActors(void)
|
|||
// case GREENSLIME+7:
|
||||
|
||||
// #ifndef VOLUMEONE
|
||||
if (net_server && (!net_server && ud.multimode < 2))
|
||||
if (g_netServer && (!g_netServer && ud.multimode < 2))
|
||||
{
|
||||
if (g_noEnemies == 1)
|
||||
{
|
||||
|
@ -4770,7 +4770,7 @@ DETONATEB:
|
|||
goto BOLT;
|
||||
}
|
||||
|
||||
if (!net_server && (!net_server && ud.multimode < 2) && A_CheckEnemySprite(s))
|
||||
if (!g_netServer && (!g_netServer && ud.multimode < 2) && A_CheckEnemySprite(s))
|
||||
{
|
||||
if (g_noEnemies == 1)
|
||||
{
|
||||
|
@ -5530,7 +5530,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
|
||||
}
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -5695,7 +5695,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
|
||||
g_player[p].ps->ang += q;
|
||||
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
{
|
||||
g_player[p].ps->oposx = g_player[p].ps->posx;
|
||||
g_player[p].ps->oposy = g_player[p].ps->posy;
|
||||
|
@ -5722,7 +5722,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
|
||||
sprite[j].ang+=q;
|
||||
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
{
|
||||
ActorExtra[j].bposx = sprite[j].x;
|
||||
ActorExtra[j].bposy = sprite[j].y;
|
||||
|
@ -5731,7 +5731,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
j = nextspritesect[j];
|
||||
}
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
|
||||
if ((sc->floorz-sc->ceilingz) < (108<<8))
|
||||
|
@ -5860,7 +5860,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
g_player[p].ps->posx += l;
|
||||
g_player[p].ps->posy += x;
|
||||
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
{
|
||||
g_player[p].ps->oposx = g_player[p].ps->posx;
|
||||
g_player[p].ps->oposy = g_player[p].ps->posy;
|
||||
|
@ -5882,7 +5882,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
{
|
||||
if (sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS)
|
||||
{
|
||||
if (numplayers < 2 && !net_server)
|
||||
if (numplayers < 2 && !g_netServer)
|
||||
{
|
||||
ActorExtra[j].bposx = sprite[j].x;
|
||||
ActorExtra[j].bposy = sprite[j].y;
|
||||
|
@ -5891,7 +5891,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
sprite[j].x += l;
|
||||
sprite[j].y += x;
|
||||
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
{
|
||||
ActorExtra[j].bposx = sprite[j].x;
|
||||
ActorExtra[j].bposy = sprite[j].y;
|
||||
|
@ -5900,7 +5900,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
j = nextspritesect[j];
|
||||
}
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
|
||||
if ((sc->floorz-sc->ceilingz) < (108<<8))
|
||||
|
@ -6014,7 +6014,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
}
|
||||
j = nextj;
|
||||
}
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
}
|
||||
break;
|
||||
|
@ -6194,7 +6194,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
s->z += s->zvel;
|
||||
sc->ceilingz += s->zvel;
|
||||
sector[t[0]].ceilingz += s->zvel;
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
break;
|
||||
|
||||
|
@ -6334,7 +6334,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
k = (SP>>3)*t[3];
|
||||
t[2]-=k;
|
||||
t[4]-=k;
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
goto BOLT;
|
||||
}
|
||||
|
@ -6345,14 +6345,14 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
k = (SP>>3)*t[3];
|
||||
t[2]+=k;
|
||||
t[4]+=k;
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
|
||||
if (t[4] <= -511 || t[4] >= 512)
|
||||
{
|
||||
t[4] = 0;
|
||||
t[2] &= 0xffffff00;
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
break;
|
||||
}
|
||||
|
@ -6518,7 +6518,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
t[3]--;
|
||||
}
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
}
|
||||
break;
|
||||
|
@ -6553,7 +6553,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
if (s->shade) sc->ceilingz+=1024;
|
||||
else sc->ceilingz-=512;
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
|
||||
break;
|
||||
|
@ -6571,12 +6571,12 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
if (sprite[j].statnum == STAT_PLAYER && sprite[j].owner >= 0)
|
||||
{
|
||||
p = sprite[j].yvel;
|
||||
if (numplayers < 2 && !net_server)
|
||||
if (numplayers < 2 && !g_netServer)
|
||||
g_player[p].ps->oposz = g_player[p].ps->posz;
|
||||
g_player[p].ps->posz += q;
|
||||
g_player[p].ps->truefz += q;
|
||||
g_player[p].ps->truecz += q;
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
g_player[p].ps->oposz = g_player[p].ps->posz;
|
||||
}
|
||||
if (sprite[j].statnum != STAT_EFFECTOR)
|
||||
|
@ -7143,7 +7143,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
|||
if (sprite[g_player[p].ps->i].sectnum == s->sectnum && g_player[p].ps->on_ground)
|
||||
g_player[p].ps->posz += s->zvel;
|
||||
|
||||
ms(i);
|
||||
A_MoveSector(i);
|
||||
setsprite(i,(vec3_t *)s);
|
||||
|
||||
break;
|
||||
|
|
|
@ -60,7 +60,7 @@ static int32_t floor_over_floor;
|
|||
// static char *startwin_labeltext = "Starting Mapster32...";
|
||||
static char setupfilename[BMAX_PATH]= "mapster32.cfg";
|
||||
static char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
|
||||
static char *duke3dgrp = defaultduke3dgrp;
|
||||
static char *g_grpNamePtr = defaultduke3dgrp;
|
||||
static int32_t fixmapbeforesaving = 1;
|
||||
static int32_t lastsave = -180*60;
|
||||
static int32_t NoAutoLoad = 0;
|
||||
|
@ -8458,14 +8458,14 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
|||
}
|
||||
if (!Bstrcasecmp(c+1,"nam"))
|
||||
{
|
||||
strcpy(duke3dgrp, "nam.grp");
|
||||
strcpy(g_grpNamePtr, "nam.grp");
|
||||
COPYARG(i);
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (!Bstrcasecmp(c+1,"ww2gi"))
|
||||
{
|
||||
strcpy(duke3dgrp, "ww2gi.grp");
|
||||
strcpy(g_grpNamePtr, "ww2gi.grp");
|
||||
COPYARG(i);
|
||||
i++;
|
||||
continue;
|
||||
|
@ -9857,11 +9857,11 @@ int32_t ExtInit(void)
|
|||
// JBF 20031220: Because it's annoying renaming GRP files whenever I want to test different game data
|
||||
if (getenv("DUKE3DGRP"))
|
||||
{
|
||||
duke3dgrp = getenv("DUKE3DGRP");
|
||||
initprintf("Using %s as main GRP file\n", duke3dgrp);
|
||||
g_grpNamePtr = getenv("DUKE3DGRP");
|
||||
initprintf("Using %s as main GRP file\n", g_grpNamePtr);
|
||||
}
|
||||
|
||||
i = initgroupfile(duke3dgrp);
|
||||
i = initgroupfile(g_grpNamePtr);
|
||||
|
||||
if (!NoAutoLoad)
|
||||
{
|
||||
|
@ -9873,7 +9873,7 @@ int32_t ExtInit(void)
|
|||
while (findfiles) { Bsprintf(tempbuf,"autoload/%s",findfiles->name); initprintf("Using group file '%s'.\n",tempbuf); initgroupfile(tempbuf); findfiles = findfiles->next; }
|
||||
|
||||
if (i != -1)
|
||||
DoAutoload(duke3dgrp);
|
||||
DoAutoload(g_grpNamePtr);
|
||||
}
|
||||
|
||||
if (getenv("DUKE3DDEF"))
|
||||
|
|
|
@ -599,11 +599,11 @@ void CONFIG_SetupJoystick(void)
|
|||
=
|
||||
===================
|
||||
*/
|
||||
extern char *duke3dgrp;
|
||||
extern char *g_grpNamePtr;
|
||||
extern void G_CheckPlayerColor(int32_t *color,int32_t prev_color);
|
||||
extern palette_t CrosshairColors;
|
||||
extern palette_t DefaultCrosshairColors;
|
||||
extern char mod_dir[BMAX_PATH];
|
||||
extern char g_modDir[BMAX_PATH];
|
||||
extern int32_t r_maxfps;
|
||||
extern int32_t g_noSetup;
|
||||
|
||||
|
@ -611,7 +611,7 @@ int32_t CONFIG_ReadSetup(void)
|
|||
{
|
||||
int32_t dummy, i = 0;
|
||||
char commmacro[] = "CommbatMacro# ";
|
||||
extern int32_t CommandWeaponChoice;
|
||||
extern int32_t g_forceWeaponChoice;
|
||||
char tempbuf[1024];
|
||||
|
||||
CONTROL_ClearAssignments();
|
||||
|
@ -667,17 +667,17 @@ int32_t CONFIG_ReadSetup(void)
|
|||
SCRIPT_GetNumber(ud.config.scripthandle, "Setup","NoAutoLoad",&ud.config.NoAutoLoad);
|
||||
|
||||
// #ifdef _WIN32
|
||||
if (g_noSetup == 0 && mod_dir[0] == '/')
|
||||
if (g_noSetup == 0 && g_modDir[0] == '/')
|
||||
{
|
||||
struct stat st;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]);
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
|
||||
|
||||
if (stat(mod_dir, &st))
|
||||
if (stat(g_modDir, &st))
|
||||
{
|
||||
if ((st.st_mode & S_IFDIR) != S_IFDIR)
|
||||
{
|
||||
initprintf("Invalid mod dir in cfg!\n");
|
||||
Bsprintf(mod_dir,"/");
|
||||
Bsprintf(g_modDir,"/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ int32_t CONFIG_ReadSetup(void)
|
|||
{
|
||||
extern char defaultduke3dgrp[BMAX_PATH];
|
||||
if (!Bstrcmp(defaultduke3dgrp,"duke3d.grp"))
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]);
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -880,7 +880,7 @@ int32_t CONFIG_ReadSetup(void)
|
|||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "WeaponSway",&ud.weaponsway);
|
||||
|
||||
// weapon choices are defaulted in G_CheckCommandLine, which may override them
|
||||
if (!CommandWeaponChoice)
|
||||
if (!g_forceWeaponChoice)
|
||||
for (i=0; i<10; i++)
|
||||
{
|
||||
Bsprintf(buf,"WeaponChoice%d",i);
|
||||
|
@ -1233,11 +1233,11 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&szPlayerName[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
|
||||
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
||||
|
||||
// #ifdef _WIN32
|
||||
if (g_noSetup == 0)
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
|
||||
// #endif
|
||||
|
||||
{
|
||||
|
|
|
@ -49,9 +49,9 @@ extern "C" {
|
|||
|
||||
#include "enet/enet.h"
|
||||
|
||||
extern ENetHost * net_server;
|
||||
extern ENetHost * net_client;
|
||||
extern ENetPeer * net_peer;
|
||||
extern ENetHost * g_netServer;
|
||||
extern ENetHost * g_netClient;
|
||||
extern ENetPeer * g_netClientPeer;
|
||||
|
||||
#define APPNAME "EDuke32"
|
||||
#define VERSION " 2.0.0devel"
|
||||
|
@ -1082,8 +1082,8 @@ typedef struct {
|
|||
extern keydef_t ConsoleKeys[];
|
||||
extern char *ConsoleButtons[];
|
||||
|
||||
extern char *duke3dgrp, *duke3dgrpstring;
|
||||
extern char mod_dir[BMAX_PATH];
|
||||
extern char *g_grpNamePtr, *g_gameNamePtr;
|
||||
extern char g_modDir[BMAX_PATH];
|
||||
|
||||
extern hashtable_t gamevarH;
|
||||
extern hashtable_t arrayH;
|
||||
|
|
|
@ -80,7 +80,7 @@ enet_address_set_host (ENetAddress * address, const char * name)
|
|||
char buffer [2048];
|
||||
int errnum;
|
||||
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
|
||||
#else
|
||||
hostEntry = gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & errnum);
|
||||
|
@ -133,7 +133,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng
|
|||
|
||||
in.s_addr = address -> host;
|
||||
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
|
||||
#else
|
||||
hostEntry = gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & errnum);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -106,8 +106,8 @@ extern int32_t qsetmode;
|
|||
char *textptr;
|
||||
int32_t g_numCompilerErrors,g_numCompilerWarnings;
|
||||
|
||||
extern char *duke3dgrpstring;
|
||||
extern char *duke3ddef;
|
||||
extern char *g_gameNamePtr;
|
||||
extern char *g_defNamePtr;
|
||||
|
||||
extern int32_t g_maxSoundPos;
|
||||
|
||||
|
@ -5175,8 +5175,8 @@ repeatcase:
|
|||
}
|
||||
}
|
||||
gamename[i] = '\0';
|
||||
duke3dgrpstring = Bstrdup(gamename);
|
||||
Bsprintf(tempbuf,"%s - " APPNAME,duke3dgrpstring);
|
||||
g_gameNamePtr = Bstrdup(gamename);
|
||||
Bsprintf(tempbuf,"%s - " APPNAME,g_gameNamePtr);
|
||||
wm_setapptitle(tempbuf);
|
||||
}
|
||||
return 0;
|
||||
|
@ -5193,8 +5193,8 @@ repeatcase:
|
|||
j++;
|
||||
}
|
||||
tempbuf[j] = '\0';
|
||||
duke3ddef = Bstrdup(tempbuf);
|
||||
initprintf("Using DEF file: %s.\n",duke3ddef);
|
||||
g_defNamePtr = Bstrdup(tempbuf);
|
||||
initprintf("Using DEF file: %s.\n",g_defNamePtr);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
@ -5221,16 +5221,16 @@ repeatcase:
|
|||
int32_t glrm = glrendmode;
|
||||
#endif
|
||||
|
||||
if (stat(mod_dir, &st) < 0)
|
||||
if (stat(g_modDir, &st) < 0)
|
||||
{
|
||||
if (errno == ENOENT) // path doesn't exist
|
||||
{
|
||||
if (Bmkdir(mod_dir, S_IRWXU) < 0)
|
||||
if (Bmkdir(g_modDir, S_IRWXU) < 0)
|
||||
{
|
||||
OSD_Printf("Failed to create configuration file directory %s\n", mod_dir);
|
||||
OSD_Printf("Failed to create configuration file directory %s\n", g_modDir);
|
||||
return 0;
|
||||
}
|
||||
else OSD_Printf("Created configuration file directory %s\n", mod_dir);
|
||||
else OSD_Printf("Created configuration file directory %s\n", g_modDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5246,8 +5246,8 @@ repeatcase:
|
|||
|
||||
Bstrcpy(temp,tempbuf);
|
||||
CONFIG_WriteSetup();
|
||||
if (mod_dir[0] != '/')
|
||||
Bsprintf(setupfilename,"%s/",mod_dir);
|
||||
if (g_modDir[0] != '/')
|
||||
Bsprintf(setupfilename,"%s/",g_modDir);
|
||||
else setupfilename[0] = 0;
|
||||
Bstrcat(setupfilename,temp);
|
||||
|
||||
|
@ -6007,7 +6007,7 @@ void C_Compile(const char *filenam)
|
|||
"version of Duke Nukem 3D: Atomic Edition immediately for only $5.99 through our partnership with GOG.com.\n\n"
|
||||
"Not a typo; it's less than 6 bucks. Get Duke now?\n\n"
|
||||
"(Clicking yes will bring you to our web store)",
|
||||
duke3dgrp,duke3dgrp);
|
||||
g_grpNamePtr,g_grpNamePtr);
|
||||
|
||||
if (wm_ynbox("Important - Duke Nukem 3D not found - EDuke32",tempbuf))
|
||||
{
|
||||
|
@ -6030,7 +6030,7 @@ void C_Compile(const char *filenam)
|
|||
Bsprintf(tempbuf,"Duke Nukem 3D game data was not found. A valid copy of '%s' or other compatible data is needed to run EDuke32.\n"
|
||||
"You can find '%s' in the 'DN3DINST' or 'ATOMINST' directory on your Duke Nukem 3D installation CD-ROM.\n\n"
|
||||
"EDuke32 will now close.",
|
||||
duke3dgrp,duke3dgrp);
|
||||
g_grpNamePtr,g_grpNamePtr);
|
||||
G_GameExit(tempbuf);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ int32_t A_FurthestVisiblePoint(int32_t iActor,spritetype *ts,int32_t *dax,int32_
|
|||
spritetype *s = &sprite[iActor];
|
||||
hitdata_t hitinfo;
|
||||
|
||||
if ((!net_server && ud.multimode < 2) && ud.player_skill < 3)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.player_skill < 3)
|
||||
angincs = 2048/2;
|
||||
else angincs = 2048/(1+(krand()&1));
|
||||
|
||||
|
@ -613,7 +613,7 @@ static void X_Move(void)
|
|||
}
|
||||
else if (vm.g_sp->picnum != DRONE && vm.g_sp->picnum != SHARK && vm.g_sp->picnum != COMMANDER)
|
||||
{
|
||||
if (ActorExtra[vm.g_i].bposz != vm.g_sp->z || ((!net_server && ud.multimode < 2) && ud.player_skill < 2))
|
||||
if (ActorExtra[vm.g_i].bposz != vm.g_sp->z || ((!g_netServer && ud.multimode < 2) && ud.player_skill < 2))
|
||||
{
|
||||
if ((vm.g_t[0]&1) || g_player[vm.g_p].ps->actorsqu == vm.g_i) return;
|
||||
else daxvel <<= 1;
|
||||
|
@ -919,7 +919,7 @@ skip_check:
|
|||
case CON_IFGOTWEAPONCE:
|
||||
insptr++;
|
||||
|
||||
if ((GametypeFlags[ud.coop]&GAMETYPE_WEAPSTAY) && (net_server || ud.multimode > 1))
|
||||
if ((GametypeFlags[ud.coop]&GAMETYPE_WEAPSTAY) && (g_netServer || ud.multimode > 1))
|
||||
{
|
||||
if (*insptr == 0)
|
||||
{
|
||||
|
@ -977,7 +977,7 @@ skip_check:
|
|||
case CON_PKICK:
|
||||
insptr++;
|
||||
|
||||
if ((net_server || ud.multimode > 1) && vm.g_sp->picnum == APLAYER)
|
||||
if ((g_netServer || ud.multimode > 1) && vm.g_sp->picnum == APLAYER)
|
||||
{
|
||||
if (g_player[otherp].ps->quick_kick == 0)
|
||||
g_player[otherp].ps->quick_kick = 14;
|
||||
|
@ -1747,8 +1747,16 @@ skip_check:
|
|||
Bstrcpy(ScriptQuotes[i],ScriptQuotes[j]);
|
||||
break;
|
||||
case CON_CHANGESPRITESECT:
|
||||
if ((i<0 || i>=MAXSPRITES) /* && g_scriptSanityChecks */) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",g_errorLineNum,keyw[g_tw],i); break;}
|
||||
if ((j<0 || j>=numsectors) /* && g_scriptSanityChecks */) {OSD_Printf(CON_ERROR "Invalid sector %d\n",g_errorLineNum,keyw[g_tw],j); break;}
|
||||
if ((i<0 || i>=MAXSPRITES) /* && g_scriptSanityChecks */)
|
||||
{
|
||||
OSD_Printf(CON_ERROR "Invalid sprite %d\n",g_errorLineNum,keyw[g_tw],i);
|
||||
break;
|
||||
}
|
||||
if ((j<0 || j>=numsectors) /* && g_scriptSanityChecks */)
|
||||
{
|
||||
OSD_Printf(CON_ERROR "Invalid sector %d\n",g_errorLineNum,keyw[g_tw],j);
|
||||
break;
|
||||
}
|
||||
changespritesect(i,j);
|
||||
break;
|
||||
default:
|
||||
|
@ -1825,7 +1833,7 @@ nullquote:
|
|||
|
||||
ud.m_volume_number = ud.volume_number = volnume;
|
||||
ud.m_level_number = ud.level_number = levnume;
|
||||
if (numplayers > 1 && net_server)
|
||||
if (numplayers > 1 && g_netServer)
|
||||
Net_NewGame(volnume,levnume);
|
||||
else
|
||||
{
|
||||
|
@ -2734,7 +2742,7 @@ nullquote:
|
|||
g_screenCapture = 1;
|
||||
G_DrawRooms(myconnectindex,65536);
|
||||
g_screenCapture = 0;
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
G_SavePlayer(-1-(g_lastSaveSlot));
|
||||
else G_SavePlayer(g_lastSaveSlot);
|
||||
|
||||
|
@ -2757,7 +2765,7 @@ nullquote:
|
|||
insptr++;
|
||||
|
||||
//AddLog("resetplayer");
|
||||
if ((!net_server && ud.multimode < 2))
|
||||
if ((!g_netServer && ud.multimode < 2))
|
||||
{
|
||||
if (g_lastSaveSlot >= 0 && ud.recstat != 2)
|
||||
{
|
||||
|
@ -2776,7 +2784,7 @@ nullquote:
|
|||
g_cameraClock = totalclock;
|
||||
}
|
||||
|
||||
if (net_server)
|
||||
if (g_netServer)
|
||||
{
|
||||
P_ResetPlayer(vm.g_p);
|
||||
|
||||
|
@ -2784,7 +2792,7 @@ nullquote:
|
|||
packbuf[1] = vm.g_p;
|
||||
packbuf[2] = 0;
|
||||
|
||||
enet_host_broadcast(net_server, 0 , enet_packet_create(packbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
enet_host_broadcast(g_netServer, 0 , enet_packet_create(packbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
}
|
||||
}
|
||||
P_UpdateScreenPal(g_player[vm.g_p].ps);
|
||||
|
@ -2938,7 +2946,7 @@ nullquote:
|
|||
j = 1;
|
||||
else if ((l&65536L))
|
||||
{
|
||||
if (vm.g_sp->picnum == APLAYER && (net_server || ud.multimode > 1))
|
||||
if (vm.g_sp->picnum == APLAYER && (g_netServer || ud.multimode > 1))
|
||||
j = G_GetAngleDelta(g_player[otherp].ps->ang,getangle(g_player[vm.g_p].ps->posx-g_player[otherp].ps->posx,g_player[vm.g_p].ps->posy-g_player[otherp].ps->posy));
|
||||
else
|
||||
j = G_GetAngleDelta(g_player[vm.g_p].ps->ang,getangle(vm.g_sp->x-g_player[vm.g_p].ps->posx,vm.g_sp->y-g_player[vm.g_p].ps->posy));
|
||||
|
@ -3030,7 +3038,7 @@ nullquote:
|
|||
continue;
|
||||
|
||||
case CON_IFMULTIPLAYER:
|
||||
X_DoConditional((net_server || ud.multimode > 1));
|
||||
X_DoConditional((g_netServer || ud.multimode > 1));
|
||||
continue;
|
||||
|
||||
case CON_OPERATE:
|
||||
|
@ -3855,8 +3863,8 @@ nullquote:
|
|||
{
|
||||
FILE *fil;
|
||||
char temp[BMAX_PATH];
|
||||
if (mod_dir[0] != '/')
|
||||
Bsprintf(temp,"%s/%s",mod_dir,ScriptQuotes[q]);
|
||||
if (g_modDir[0] != '/')
|
||||
Bsprintf(temp,"%s/%s",g_modDir,ScriptQuotes[q]);
|
||||
else Bsprintf(temp,"%s",ScriptQuotes[q]);
|
||||
if ((fil = fopen(temp,"wb")) == 0) continue;
|
||||
|
||||
|
@ -4654,13 +4662,13 @@ void A_LoadActor(int32_t iActor)
|
|||
|
||||
void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist)
|
||||
{
|
||||
if (net_client && A_CheckSpriteFlags(iActor, SPRITE_NULL))
|
||||
if (g_netClient && A_CheckSpriteFlags(iActor, SPRITE_NULL))
|
||||
{
|
||||
deletesprite(iActor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (net_server || net_client)
|
||||
if (g_netServer || g_netClient)
|
||||
randomseed = ticrandomseed;
|
||||
|
||||
vm.g_i = iActor; // Sprite ID
|
||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//-------------------------------------------------------------------------
|
||||
#include "duke3d.h"
|
||||
|
||||
const char *s_buildDate = "20091215";
|
||||
const char *s_buildDate = "20100107";
|
||||
char *MusicPtr = NULL;
|
||||
int32_t g_musicSize;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <sys/stat.h>
|
||||
|
||||
extern char inputloc;
|
||||
extern int32_t recfilep;
|
||||
extern int32_t g_demo_recFilePtr;
|
||||
//extern char vgacompatible;
|
||||
int16_t g_skillSoundID=-1;
|
||||
int32_t probey=0;
|
||||
|
@ -518,7 +518,7 @@ static int32_t getfilenames(const char *path, char kind[])
|
|||
return(0);
|
||||
}
|
||||
|
||||
extern int32_t quittimer;
|
||||
extern int32_t g_quitDeadline;
|
||||
|
||||
void G_CheckPlayerColor(int32_t *color, int32_t prev_color)
|
||||
{
|
||||
|
@ -626,7 +626,7 @@ void M_DisplayMenus(void)
|
|||
x = M_Probe(186,124,0,1);
|
||||
if (x >= -1)
|
||||
{
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -1274,7 +1274,7 @@ void M_DisplayMenus(void)
|
|||
KB_ClearKeyDown(sc_Escape);
|
||||
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -1287,7 +1287,7 @@ void M_DisplayMenus(void)
|
|||
KB_ClearKeysDown();
|
||||
FX_StopAllSounds();
|
||||
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
G_LoadPlayer(-1-g_lastSaveSlot);
|
||||
g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
|
@ -1442,13 +1442,13 @@ void M_DisplayMenus(void)
|
|||
|
||||
KB_FlushKeyboardQueue();
|
||||
KB_ClearKeysDown();
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
}
|
||||
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
if (g_player[myconnectindex].ps->gm&MODE_GAME)
|
||||
{
|
||||
|
@ -1461,10 +1461,10 @@ void M_DisplayMenus(void)
|
|||
tempbuf[1] = g_lastSaveSlot;
|
||||
tempbuf[2] = myconnectindex;
|
||||
|
||||
if (net_client)
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (net_server)
|
||||
enet_host_broadcast(net_server, 0, enet_packet_create(tempbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
if (g_netClient)
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (g_netServer)
|
||||
enet_host_broadcast(g_netServer, 0, enet_packet_create(tempbuf, 3, ENET_PACKET_FLAG_RELIABLE));
|
||||
|
||||
Net_GetPackets();
|
||||
|
||||
|
@ -1493,7 +1493,7 @@ void M_DisplayMenus(void)
|
|||
if (g_player[myconnectindex].ps->gm&MODE_GAME)
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -1519,7 +1519,7 @@ void M_DisplayMenus(void)
|
|||
{
|
||||
KB_ClearKeyDown(sc_N);
|
||||
KB_ClearKeyDown(sc_Escape);
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -1877,7 +1877,7 @@ cheat_for_port_credits:
|
|||
x = M_Probe(c,67,16,6);
|
||||
if (x >= 0)
|
||||
{
|
||||
if ((net_server || ud.multimode > 1) && x == 0 && ud.recstat != 2)
|
||||
if ((g_netServer || ud.multimode > 1) && x == 0 && ud.recstat != 2)
|
||||
{
|
||||
last_zero = 0;
|
||||
ChangeToMenu(600);
|
||||
|
@ -1916,7 +1916,7 @@ cheat_for_port_credits:
|
|||
if (x == -1 && (g_player[myconnectindex].ps->gm&MODE_GAME || ud.recstat == 2))
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -1957,7 +1957,7 @@ cheat_for_port_credits:
|
|||
switch (x)
|
||||
{
|
||||
case 0:
|
||||
if ((!net_server && ud.multimode < 2) || ud.recstat == 2)
|
||||
if ((!g_netServer && ud.multimode < 2) || ud.recstat == 2)
|
||||
ChangeToMenu(1500);
|
||||
else
|
||||
{
|
||||
|
@ -1987,7 +1987,7 @@ cheat_for_port_credits:
|
|||
ChangeToMenu(400);
|
||||
break;
|
||||
case 5:
|
||||
if (numplayers < 2 && !net_server)
|
||||
if (numplayers < 2 && !g_netServer)
|
||||
{
|
||||
last_fifty = 5;
|
||||
ChangeToMenu(501);
|
||||
|
@ -1999,7 +1999,7 @@ cheat_for_port_credits:
|
|||
break;
|
||||
case -1:
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -2023,7 +2023,7 @@ cheat_for_port_credits:
|
|||
{
|
||||
menutext(c,67+16+16+16+16 ,MENUHIGHLIGHT(4),PHX(-6)," HELP");
|
||||
}
|
||||
if (net_server || numplayers > 1)
|
||||
if (g_netServer || numplayers > 1)
|
||||
menutext(c,67+16+16+16+16+16 ,MENUHIGHLIGHT(5),1,"QUIT TO TITLE");
|
||||
else menutext(c,67+16+16+16+16+16 ,MENUHIGHLIGHT(5),PHX(-7),"QUIT TO TITLE");
|
||||
menutext(c,67+16+16+16+16+16+16,MENUHIGHLIGHT(6),PHX(-8),"QUIT GAME");
|
||||
|
@ -2266,7 +2266,7 @@ cheat_for_port_credits:
|
|||
{
|
||||
clearfilenames();
|
||||
boardfilename[0] = 0;
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
Net_SendUserMapName();
|
||||
ChangeToMenu(600);
|
||||
|
@ -2291,7 +2291,7 @@ cheat_for_port_credits:
|
|||
strcat(boardfilename, findfileshigh->name);
|
||||
ud.m_volume_number = 0;
|
||||
ud.m_level_number = 7;
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
Net_SendUserMapName();
|
||||
ChangeToMenu(600);
|
||||
|
@ -2578,7 +2578,7 @@ cheat_for_port_credits:
|
|||
if (g_player[myconnectindex].ps->gm&MODE_GAME && g_currentMenu == 232)
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -3391,7 +3391,7 @@ cheat_for_port_credits:
|
|||
menutext(c+168,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"OFF":"ON");
|
||||
modval(0,1,(int32_t *)&ud.detail,1,probey==5);
|
||||
menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),PHX(-6),"AMBIENT LIGHT");
|
||||
_bar(0,c+185,50+62+16+16+16,&i,128,x==6,MENUHIGHLIGHT(6),net_server || numplayers>1,128,4096);
|
||||
_bar(0,c+185,50+62+16+16+16,&i,128,x==6,MENUHIGHLIGHT(6),g_netServer || numplayers>1,128,4096);
|
||||
Bsprintf(tempbuf,"%.2f",r_ambientlight);
|
||||
mgametextpal(c+185+9,50+62+16+16+16+4, tempbuf, MENUHIGHLIGHT(6), 0);
|
||||
|
||||
|
@ -4431,7 +4431,7 @@ cheat_for_port_credits:
|
|||
if (g_player[myconnectindex].ps->gm&MODE_GAME && g_currentMenu == 701)
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -4689,7 +4689,7 @@ cheat_for_port_credits:
|
|||
{
|
||||
// ReadSaveGameHeaders();
|
||||
g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -4706,13 +4706,13 @@ cheat_for_port_credits:
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
G_SavePlayer(-1-(g_currentMenu-360));
|
||||
else G_SavePlayer(g_currentMenu-360);
|
||||
g_lastSaveSlot = g_currentMenu-360;
|
||||
g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -4786,7 +4786,7 @@ cheat_for_port_credits:
|
|||
else
|
||||
g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -4975,7 +4975,7 @@ VOLUME_ALL_40x:
|
|||
if (x == -1 || KB_KeyPressed(sc_N) || RMB)
|
||||
{
|
||||
KB_ClearKeyDown(sc_N);
|
||||
quittimer = 0;
|
||||
g_quitDeadline = 0;
|
||||
if (g_player[myconnectindex].ps->gm&MODE_DEMO && ud.recstat == 2)
|
||||
g_player[myconnectindex].ps->gm = MODE_DEMO;
|
||||
else
|
||||
|
@ -4988,7 +4988,7 @@ VOLUME_ALL_40x:
|
|||
else if (!(g_player[myconnectindex].ps->gm & MODE_GAME || ud.recstat == 2))
|
||||
ChangeToMenu(0);
|
||||
else g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -5016,7 +5016,7 @@ VOLUME_ALL_40x:
|
|||
if (x == -1 || KB_KeyPressed(sc_N) || RMB)
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if ((!net_server && ud.multimode < 2) && ud.recstat != 2)
|
||||
if ((!g_netServer && ud.multimode < 2) && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
|
@ -5073,10 +5073,10 @@ VOLUME_ALL_40x:
|
|||
tempbuf[0] = PACKET_MAP_VOTE_CANCEL;
|
||||
tempbuf[1] = myconnectindex;
|
||||
|
||||
if (net_client)
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (net_server)
|
||||
enet_host_broadcast(net_server, 0, enet_packet_create(tempbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
if (g_netClient)
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (g_netServer)
|
||||
enet_host_broadcast(g_netServer, 0, enet_packet_create(tempbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
|
||||
voting = -1;
|
||||
}
|
||||
|
@ -5088,9 +5088,9 @@ VOLUME_ALL_40x:
|
|||
plrvotes += g_player[i].vote;
|
||||
j += g_player[i].gotvote;
|
||||
}
|
||||
if (j == numplayers || !g_player[myconnectindex].ps->i || (plrvotes > (numplayers>>1)) || (net_server))
|
||||
if (j == numplayers || !g_player[myconnectindex].ps->i || (plrvotes > (numplayers>>1)) || (g_netServer))
|
||||
{
|
||||
if (plrvotes > (numplayers>>1) || !g_player[myconnectindex].ps->i || (net_server))
|
||||
if (plrvotes > (numplayers>>1) || !g_player[myconnectindex].ps->i || (g_netServer))
|
||||
{
|
||||
if (ud.m_player_skill == 3) ud.m_respawn_monsters = 1;
|
||||
else ud.m_respawn_monsters = 0;
|
||||
|
@ -5109,7 +5109,7 @@ VOLUME_ALL_40x:
|
|||
|
||||
Net_NewGame(ud.m_volume_number,ud.m_level_number);
|
||||
|
||||
if (voting == myconnectindex && !(net_server))
|
||||
if (voting == myconnectindex && !(g_netServer))
|
||||
G_AddUserQuote("VOTE SUCCEEDED");
|
||||
|
||||
G_NewGame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1);
|
||||
|
@ -5132,10 +5132,10 @@ VOLUME_ALL_40x:
|
|||
tempbuf[2] = 1;
|
||||
tempbuf[3] = myconnectindex;
|
||||
|
||||
if (net_client)
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (net_server)
|
||||
enet_host_broadcast(net_server, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
if (g_netClient)
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (g_netServer)
|
||||
enet_host_broadcast(g_netServer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
|
||||
Bsprintf(ScriptQuotes[116],"VOTE FAILED");
|
||||
P_DoQuote(116,g_player[myconnectindex].ps);
|
||||
|
@ -5261,7 +5261,7 @@ VOLUME_ALL_40x:
|
|||
break;
|
||||
case 7:
|
||||
// master does whatever it wants
|
||||
if (net_server)
|
||||
if (g_netServer)
|
||||
{
|
||||
ChangeToMenu(603);
|
||||
break;
|
||||
|
@ -5284,10 +5284,10 @@ VOLUME_ALL_40x:
|
|||
tempbuf[3] = ud.m_level_number;
|
||||
tempbuf[4] = myconnectindex;
|
||||
|
||||
if (net_client)
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (net_server)
|
||||
enet_host_broadcast(net_server, 0, enet_packet_create(tempbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
if (g_netClient)
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
else if (g_netServer)
|
||||
enet_host_broadcast(g_netServer, 0, enet_packet_create(tempbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
}
|
||||
if ((GametypeFlags[ud.m_coop] & GAMETYPE_PLAYERSFRIENDLY) && !(GametypeFlags[ud.m_coop] & GAMETYPE_TDM))
|
||||
ud.m_noexits = 0;
|
||||
|
|
|
@ -103,7 +103,7 @@ static int32_t osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
if (net_server)
|
||||
if (g_netServer)
|
||||
Net_NewGame(volume,level);
|
||||
else if (voting == -1)
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ static int32_t osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
tempbuf[2] = ud.m_volume_number;
|
||||
tempbuf[3] = ud.m_level_number;
|
||||
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
}
|
||||
if ((GametypeFlags[ud.m_coop] & GAMETYPE_PLAYERSFRIENDLY) && !(GametypeFlags[ud.m_coop] & GAMETYPE_TDM))
|
||||
ud.m_noexits = 0;
|
||||
|
@ -251,7 +251,7 @@ static int32_t osdcmd_map(const osdfuncparm_t *parm)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
if (net_server)
|
||||
if (g_netServer)
|
||||
{
|
||||
Net_SendUserMapName();
|
||||
ud.m_volume_number = 0;
|
||||
|
@ -283,7 +283,7 @@ static int32_t osdcmd_map(const osdfuncparm_t *parm)
|
|||
tempbuf[2] = ud.m_volume_number;
|
||||
tempbuf[3] = ud.m_level_number;
|
||||
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(tempbuf, 4, ENET_PACKET_FLAG_RELIABLE));
|
||||
}
|
||||
if ((GametypeFlags[ud.m_coop] & GAMETYPE_PLAYERSFRIENDLY) && !(GametypeFlags[ud.m_coop] & GAMETYPE_TDM))
|
||||
ud.m_noexits = 0;
|
||||
|
@ -1168,14 +1168,14 @@ static int32_t osdcmd_connect(const osdfuncparm_t *parm)
|
|||
|
||||
static int32_t osdcmd_password(const osdfuncparm_t *parm)
|
||||
{
|
||||
extern char g_networkPassword[32];
|
||||
extern char g_netPassword[32];
|
||||
|
||||
if (parm->numparms < 1)
|
||||
{
|
||||
Bmemset(g_networkPassword, 0, sizeof(g_networkPassword));
|
||||
Bmemset(g_netPassword, 0, sizeof(g_netPassword));
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
Bstrncpy(g_networkPassword, (char *)(parm->raw) + 9, sizeof(g_networkPassword)-1);
|
||||
Bstrncpy(g_netPassword, (char *)(parm->raw) + 9, sizeof(g_netPassword)-1);
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -1188,14 +1188,14 @@ static int32_t osdcmd_listplayers(const osdfuncparm_t *parm)
|
|||
if (parm->numparms != 0)
|
||||
return OSDCMD_SHOWHELP;
|
||||
|
||||
if (!net_server)
|
||||
if (!g_netServer)
|
||||
{
|
||||
initprintf("You are not the server.\n");
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
for (currentPeer = net_server -> peers;
|
||||
currentPeer < & net_server -> peers [net_server -> peerCount];
|
||||
for (currentPeer = g_netServer -> peers;
|
||||
currentPeer < & g_netServer -> peers [g_netServer -> peerCount];
|
||||
++ currentPeer)
|
||||
{
|
||||
if (currentPeer -> state != ENET_PEER_STATE_CONNECTED)
|
||||
|
@ -1217,14 +1217,14 @@ static int32_t osdcmd_kick(const osdfuncparm_t *parm)
|
|||
if (parm->numparms != 1)
|
||||
return OSDCMD_SHOWHELP;
|
||||
|
||||
if (!net_server)
|
||||
if (!g_netServer)
|
||||
{
|
||||
initprintf("You are not the server.\n");
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
for (currentPeer = net_server -> peers;
|
||||
currentPeer < & net_server -> peers [net_server -> peerCount];
|
||||
for (currentPeer = g_netServer -> peers;
|
||||
currentPeer < & g_netServer -> peers [g_netServer -> peerCount];
|
||||
++ currentPeer)
|
||||
{
|
||||
if (currentPeer -> state != ENET_PEER_STATE_CONNECTED)
|
||||
|
@ -1253,14 +1253,14 @@ static int32_t osdcmd_kickban(const osdfuncparm_t *parm)
|
|||
if (parm->numparms != 1)
|
||||
return OSDCMD_SHOWHELP;
|
||||
|
||||
if (!net_server)
|
||||
if (!g_netServer)
|
||||
{
|
||||
initprintf("You are not the server.\n");
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
for (currentPeer = net_server -> peers;
|
||||
currentPeer < & net_server -> peers [net_server -> peerCount];
|
||||
for (currentPeer = g_netServer -> peers;
|
||||
currentPeer < & g_netServer -> peers [g_netServer -> peerCount];
|
||||
++ currentPeer)
|
||||
{
|
||||
if (currentPeer -> state != ENET_PEER_STATE_CONNECTED)
|
||||
|
|
|
@ -1049,7 +1049,7 @@ DOSKIPBULLETHOLE:
|
|||
l = j;
|
||||
else l = -1;
|
||||
|
||||
if (numplayers > 1 && net_client) return -1;
|
||||
if (numplayers > 1 && g_netClient) return -1;
|
||||
|
||||
/* j = A_InsertSprite(sect,
|
||||
sx+(sintable[(348+sa+512)&2047]/448),
|
||||
|
@ -1699,7 +1699,7 @@ SKIPBULLETHOLE:
|
|||
l = j;
|
||||
else l = -1;
|
||||
|
||||
if (numplayers > 1 && net_client) return -1;
|
||||
if (numplayers > 1 && g_netClient) return -1;
|
||||
|
||||
if (ActorExtra[i].shootzvel) zvel = ActorExtra[i].shootzvel;
|
||||
j = A_InsertSprite(sect,
|
||||
|
@ -3838,7 +3838,7 @@ void P_FragPlayer(int32_t snum)
|
|||
if (p->dead_flag == 0)
|
||||
p->dead_flag++;
|
||||
|
||||
if (net_server)
|
||||
if (g_netServer)
|
||||
{
|
||||
packbuf[0] = PACKET_FRAG;
|
||||
packbuf[1] = snum;
|
||||
|
@ -3846,7 +3846,7 @@ void P_FragPlayer(int32_t snum)
|
|||
packbuf[3] = ActorExtra[p->i].picnum;
|
||||
packbuf[4] = myconnectindex;
|
||||
|
||||
enet_host_broadcast(net_server, 0, enet_packet_create(packbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
enet_host_broadcast(g_netServer, 0, enet_packet_create(packbuf, 5, ENET_PACKET_FLAG_RELIABLE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3863,7 +3863,7 @@ void P_FragPlayer(int32_t snum)
|
|||
|
||||
if (s->pal != 1 && (s->cstat&32768) == 0) s->cstat = 0;
|
||||
|
||||
if ((net_server || ud.multimode > 1) && (s->pal != 1 || (s->cstat&32768)))
|
||||
if ((g_netServer || ud.multimode > 1) && (s->pal != 1 || (s->cstat&32768)))
|
||||
{
|
||||
if (p->frag_ps != snum)
|
||||
{
|
||||
|
@ -4143,10 +4143,10 @@ void P_ProcessInput(int32_t snum)
|
|||
|
||||
if (s->extra <= 0)
|
||||
{
|
||||
if (ud.recstat == 1 && (!net_server && ud.multimode < 2))
|
||||
if (ud.recstat == 1 && (!g_netServer && ud.multimode < 2))
|
||||
G_CloseDemoWrite();
|
||||
|
||||
if ((numplayers < 2 || net_server) && p->dead_flag == 0)
|
||||
if ((numplayers < 2 || g_netServer) && p->dead_flag == 0)
|
||||
P_FragPlayer(snum);
|
||||
|
||||
if (psectlotag == 2)
|
||||
|
@ -5426,7 +5426,7 @@ SHOOTINCODE:
|
|||
|
||||
p->ammo_amount[p->curr_weapon]--;
|
||||
|
||||
if (numplayers < 2 || net_server)
|
||||
if (numplayers < 2 || g_netServer)
|
||||
{
|
||||
if (p->on_ground && TEST_SYNC_KEY(sb_snum, SK_CROUCH))
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ int16_t SpriteCacheList[MAXTILES][3];
|
|||
static uint8_t precachehightile[2][MAXTILES>>3];
|
||||
static int32_t g_precacheCount;
|
||||
|
||||
extern char *duke3dgrpstring;
|
||||
extern char *g_gameNamePtr;
|
||||
extern int32_t g_levelTextTime;
|
||||
|
||||
static void tloadtile(int32_t tilenume, int32_t type)
|
||||
|
@ -160,7 +160,7 @@ static void G_CacheSpriteNum(int32_t i)
|
|||
break;
|
||||
case APLAYER__STATIC:
|
||||
maxc = 0;
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
maxc = 5;
|
||||
for (j = 1420; j < 1420+106; j++) tloadtile(j,1);
|
||||
|
@ -228,7 +228,7 @@ static void G_PrecacheSprites(void)
|
|||
tloadtile(j,1);
|
||||
}
|
||||
tloadtile(BOTTOMSTATUSBAR,1);
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
tloadtile(FRAGBAR,1);
|
||||
|
||||
tloadtile(VIEWSCREEN,1);
|
||||
|
@ -559,7 +559,7 @@ void G_UpdateScreenArea(void)
|
|||
|
||||
y1 = ss;
|
||||
y2 = 200;
|
||||
if (ud.screen_size > 0 && (GametypeFlags[ud.coop]&GAMETYPE_FRAGBAR) && (net_server || ud.multimode > 1))
|
||||
if (ud.screen_size > 0 && (GametypeFlags[ud.coop]&GAMETYPE_FRAGBAR) && (g_netServer || ud.multimode > 1))
|
||||
{
|
||||
j = 0;
|
||||
TRAVERSE_CONNECT(i)
|
||||
|
@ -594,7 +594,7 @@ void P_RandomSpawnPoint(int32_t snum)
|
|||
int32_t i=snum,j,k;
|
||||
uint32_t dist,pdist = -1;
|
||||
|
||||
if ((net_server || ud.multimode > 1) && !(GametypeFlags[ud.coop] & GAMETYPE_FIXEDRESPAWN))
|
||||
if ((g_netServer || ud.multimode > 1) && !(GametypeFlags[ud.coop] & GAMETYPE_FIXEDRESPAWN))
|
||||
{
|
||||
i = krand()%g_numPlayerSprites;
|
||||
if (GametypeFlags[ud.coop] & GAMETYPE_TDMSPAWN)
|
||||
|
@ -740,7 +740,7 @@ void P_ResetStatus(int32_t snum)
|
|||
p->rapid_fire_hold = 0;
|
||||
p->toggle_key_flag = 0;
|
||||
p->access_spritenum = -1;
|
||||
if ((net_server || ud.multimode > 1) && (GametypeFlags[ud.coop] & GAMETYPE_ACCESSATSTART))
|
||||
if ((g_netServer || ud.multimode > 1) && (GametypeFlags[ud.coop] & GAMETYPE_ACCESSATSTART))
|
||||
p->got_access = 7;
|
||||
else p->got_access = 0;
|
||||
p->random_club_frame= 0;
|
||||
|
@ -887,7 +887,7 @@ static void resetprestat(int32_t snum,int32_t g)
|
|||
g_numInterpolations = 0;
|
||||
startofdynamicinterpolations = 0;
|
||||
|
||||
if (((g&MODE_EOL) != MODE_EOL && numplayers < 2 && !net_server) || (!(GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && numplayers > 1))
|
||||
if (((g&MODE_EOL) != MODE_EOL && numplayers < 2 && !g_netServer) || (!(GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && numplayers > 1))
|
||||
{
|
||||
P_ResetWeapons(snum);
|
||||
P_ResetInventory(snum);
|
||||
|
@ -1297,10 +1297,10 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
|
|||
|
||||
ready2send = 0;
|
||||
|
||||
if (ud.m_recstat != 2 && ud.last_level >= 0 && (net_server || ud.multimode > 1) && (ud.coop&GAMETYPE_SCORESHEET))
|
||||
if (ud.m_recstat != 2 && ud.last_level >= 0 && (g_netServer || ud.multimode > 1) && (ud.coop&GAMETYPE_SCORESHEET))
|
||||
G_BonusScreen(1);
|
||||
|
||||
if (ln == 0 && vn == 3 && (!net_server && ud.multimode < 2) && ud.lockout == 0)
|
||||
if (ln == 0 && vn == 3 && (!g_netServer && ud.multimode < 2) && ud.lockout == 0)
|
||||
{
|
||||
S_PlayMusic(&EnvMusicFilename[1][0],MAXVOLUMES*MAXLEVELS+1);
|
||||
|
||||
|
@ -1390,7 +1390,7 @@ static void resetpspritevars(char g)
|
|||
aimmode[i] = g_player[i].ps->aim_mode;
|
||||
autoaim[i] = g_player[i].ps->auto_aim;
|
||||
weaponswitch[i] = g_player[i].ps->weaponswitch;
|
||||
if ((net_server || ud.multimode > 1) && (GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
|
||||
if ((g_netServer || ud.multimode > 1) && (GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
|
||||
{
|
||||
for (j=0; j<MAX_WEAPONS; j++)
|
||||
{
|
||||
|
@ -1415,7 +1415,7 @@ static void resetpspritevars(char g)
|
|||
g_player[i].ps->aim_mode = aimmode[i];
|
||||
g_player[i].ps->auto_aim = autoaim[i];
|
||||
g_player[i].ps->weaponswitch = weaponswitch[i];
|
||||
if ((net_server || ud.multimode > 1) && (GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
|
||||
if ((g_netServer || ud.multimode > 1) && (GametypeFlags[ud.coop]&GAMETYPE_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
|
||||
{
|
||||
for (j=0; j<MAX_WEAPONS; j++)
|
||||
{
|
||||
|
@ -1478,7 +1478,7 @@ static void resetpspritevars(char g)
|
|||
|
||||
s->yvel = j;
|
||||
|
||||
if (!g_player[j].pcolor && (net_server || ud.multimode > 1) && !(GametypeFlags[ud.coop] & GAMETYPE_TDM))
|
||||
if (!g_player[j].pcolor && (g_netServer || ud.multimode > 1) && !(GametypeFlags[ud.coop] & GAMETYPE_TDM))
|
||||
{
|
||||
if (s->pal == 0)
|
||||
{
|
||||
|
@ -1559,9 +1559,9 @@ void Net_WaitForServer(void)
|
|||
{
|
||||
int32_t server_ready = g_player[0].playerreadyflag;
|
||||
|
||||
if (numplayers < 2 || net_server) return;
|
||||
if (numplayers < 2 || g_netServer) return;
|
||||
|
||||
if ((net_server || ud.multimode > 1))
|
||||
if ((g_netServer || ud.multimode > 1))
|
||||
{
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11);
|
||||
rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1);
|
||||
|
@ -1582,8 +1582,8 @@ void Net_WaitForServer(void)
|
|||
packbuf[0] = PACKET_PLAYER_READY;
|
||||
packbuf[1] = myconnectindex;
|
||||
|
||||
if (net_peer)
|
||||
enet_peer_send(net_peer, 0, enet_packet_create(packbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
if (g_netClientPeer)
|
||||
enet_peer_send(g_netClientPeer, 0, enet_packet_create(packbuf, 2, ENET_PACKET_FLAG_RELIABLE));
|
||||
|
||||
handleevents();
|
||||
Net_GetPackets();
|
||||
|
@ -1742,9 +1742,9 @@ int32_t G_EnterLevel(int32_t g)
|
|||
if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0)
|
||||
{
|
||||
Bstrcpy(levname, boardfilename);
|
||||
Bsprintf(apptitle,"%s - %s - " APPNAME,levname,duke3dgrpstring);
|
||||
Bsprintf(apptitle,"%s - %s - " APPNAME,levname,g_gameNamePtr);
|
||||
}
|
||||
else Bsprintf(apptitle,"%s - %s - " APPNAME,MapInfo[(ud.volume_number*MAXLEVELS)+ud.level_number].name,duke3dgrpstring);
|
||||
else Bsprintf(apptitle,"%s - %s - " APPNAME,MapInfo[(ud.volume_number*MAXLEVELS)+ud.level_number].name,g_gameNamePtr);
|
||||
|
||||
Bstrcpy(tempbuf,apptitle);
|
||||
wm_setapptitle(tempbuf);
|
||||
|
|
|
@ -657,8 +657,8 @@ int32_t G_SavePlayer(int32_t spot)
|
|||
|
||||
{
|
||||
char temp[BMAX_PATH];
|
||||
if (mod_dir[0] != '/')
|
||||
Bsprintf(temp,"%s/%s",mod_dir,fnptr);
|
||||
if (g_modDir[0] != '/')
|
||||
Bsprintf(temp,"%s/%s",g_modDir,fnptr);
|
||||
else Bsprintf(temp,"%s",fnptr);
|
||||
if ((fil = fopen(temp,"wb")) == 0) return(-1);
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ int32_t G_SavePlayer(int32_t spot)
|
|||
|
||||
fclose(fil);
|
||||
|
||||
if ((!net_server && ud.multimode < 2))
|
||||
if ((!g_netServer && ud.multimode < 2))
|
||||
{
|
||||
strcpy(ScriptQuotes[122],"GAME SAVED");
|
||||
P_DoQuote(122,g_player[myconnectindex].ps);
|
||||
|
|
|
@ -226,7 +226,7 @@ int32_t dist(spritetype *s1,spritetype *s2)
|
|||
|
||||
int32_t __fastcall A_FindPlayer(spritetype *s, int32_t *d)
|
||||
{
|
||||
if ((!net_server && ud.multimode < 2))
|
||||
if ((!g_netServer && ud.multimode < 2))
|
||||
{
|
||||
*d = klabs(g_player[myconnectindex].ps->oposx-s->x) + klabs(g_player[myconnectindex].ps->oposy-s->y) + ((klabs(g_player[myconnectindex].ps->oposz-s->z+(28<<8)))>>4);
|
||||
return myconnectindex;
|
||||
|
@ -3230,7 +3230,7 @@ void P_CheckSectors(int32_t snum)
|
|||
if (j >= 0 && wall[j].overpicnum == 0)
|
||||
if (ActorExtra[neartagsprite].temp_data[0] == 0)
|
||||
{
|
||||
if (ud.noexits && (net_server || ud.multimode > 1))
|
||||
if (ud.noexits && (g_netServer || ud.multimode > 1))
|
||||
{
|
||||
// NUKEBUTTON frags the player
|
||||
ActorExtra[p->i].picnum = NUKEBUTTON;
|
||||
|
|
|
@ -459,7 +459,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
|
|||
|
||||
if (g_sounds[num].m&4)
|
||||
{
|
||||
if ((net_server || ud.multimode > 1) && PN == APLAYER && sprite[i].yvel != screenpeek) // other player sound
|
||||
if ((g_netServer || ud.multimode > 1) && PN == APLAYER && sprite[i].yvel != screenpeek) // other player sound
|
||||
{
|
||||
if (!(ud.config.VoiceToggle&4))
|
||||
return -1;
|
||||
|
|
|
@ -826,10 +826,10 @@ int32_t startwin_run(void)
|
|||
settings.fullscreen = ud.config.ScreenMode;
|
||||
settings.usemouse = ud.config.UseMouse;
|
||||
settings.usejoy = ud.config.UseJoystick;
|
||||
settings.custommoddir = mod_dir;
|
||||
settings.custommoddir = g_modDir;
|
||||
settings.forcesetup = ud.config.ForceSetup;
|
||||
settings.game = g_gameType;
|
||||
Bstrncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
|
||||
Bstrncpy(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
|
||||
if (ud.config.NoAutoLoad) settings.autoload = FALSE;
|
||||
else settings.autoload = TRUE;
|
||||
if (glrendmode == RDR_POLYMER)
|
||||
|
@ -853,18 +853,18 @@ int32_t startwin_run(void)
|
|||
ud.config.UseMouse = settings.usemouse;
|
||||
ud.config.UseJoystick = settings.usejoy;
|
||||
ud.config.ForceSetup = settings.forcesetup;
|
||||
duke3dgrp = settings.selectedgrp;
|
||||
g_grpNamePtr = settings.selectedgrp;
|
||||
g_gameType = settings.game;
|
||||
if (settings.custommoddir != NULL)
|
||||
Bstrcpy(mod_dir, settings.custommoddir);
|
||||
else Bsprintf(mod_dir, "/");
|
||||
Bstrcpy(g_modDir, settings.custommoddir);
|
||||
else Bsprintf(g_modDir, "/");
|
||||
|
||||
if (settings.autoload) ud.config.NoAutoLoad = FALSE;
|
||||
else ud.config.NoAutoLoad = TRUE;
|
||||
|
||||
for (i = 0; i<numgrpfiles; i++) if (settings.crcval == grpfiles[i].crcval) break;
|
||||
if (i != numgrpfiles)
|
||||
duke3dgrpstring = (char *)grpfiles[i].name;
|
||||
g_gameNamePtr = (char *)grpfiles[i].name;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -710,8 +710,8 @@ int32_t startwin_run(void)
|
|||
settings.usejoy = ud.config.UseJoystick;
|
||||
settings.game = g_gameType;
|
||||
// settings.crcval = 0;
|
||||
Bstrncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
|
||||
settings.gamedir = mod_dir;
|
||||
Bstrncpy(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
|
||||
settings.gamedir = g_modDir;
|
||||
PopulateForm(-1);
|
||||
|
||||
while (done < 0)
|
||||
|
@ -750,16 +750,16 @@ int32_t startwin_run(void)
|
|||
ud.config.ForceSetup = settings.forcesetup;
|
||||
ud.config.UseMouse = settings.usemouse;
|
||||
ud.config.UseJoystick = settings.usejoy;
|
||||
duke3dgrp = settings.selectedgrp;
|
||||
g_grpNamePtr = settings.selectedgrp;
|
||||
g_gameType = settings.game;
|
||||
|
||||
if (g_noSetup == 0 && settings.gamedir != NULL)
|
||||
Bstrcpy(mod_dir,settings.gamedir);
|
||||
else Bsprintf(mod_dir,"/");
|
||||
Bstrcpy(g_modDir,settings.gamedir);
|
||||
else Bsprintf(g_modDir,"/");
|
||||
|
||||
for (i = 0; i<numgrpfiles; i++) if (settings.crcval == grpfiles[i].crcval) break;
|
||||
if (i != numgrpfiles)
|
||||
duke3dgrpstring = (char *)grpfiles[i].name;
|
||||
g_gameNamePtr = (char *)grpfiles[i].name;
|
||||
}
|
||||
|
||||
if (wavedevs)
|
||||
|
|
|
@ -1,410 +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1997 - Frank Maddin and Jim Norwood
|
||||
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
int32_t g_numSyncBytes = 1;
|
||||
char g_szfirstSyncMsg[MAXSYNCBYTES][60];
|
||||
int32_t g_foundSyncError = 0;
|
||||
|
||||
static int32_t crctable[256];
|
||||
#define updatecrc(dcrc,xz) (dcrc = (crctable[((dcrc)>>8)^((xz)&255)]^((dcrc)<<8)))
|
||||
|
||||
void initsynccrc(void)
|
||||
{
|
||||
int32_t i, j, k, a;
|
||||
|
||||
for (j=0; j<256; j++) //Calculate CRC table
|
||||
{
|
||||
k = (j<<8); a = 0;
|
||||
for (i=7; i>=0; i--)
|
||||
{
|
||||
if (((k^a)&0x8000) > 0)
|
||||
a = ((a<<1)&65535) ^ 0x1021; //0x1021 = genpoly
|
||||
else
|
||||
a = ((a<<1)&65535);
|
||||
k = ((k<<1)&65535);
|
||||
}
|
||||
crctable[j] = (a&65535);
|
||||
}
|
||||
}
|
||||
|
||||
char Net_PlayerSync(void)
|
||||
{
|
||||
int16_t i;
|
||||
uint16_t crc = 0;
|
||||
DukePlayer_t *pp;
|
||||
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
pp = g_player[i].ps;
|
||||
updatecrc(crc, pp->posx & 255);
|
||||
updatecrc(crc, pp->posy & 255);
|
||||
updatecrc(crc, pp->posz & 255);
|
||||
updatecrc(crc, pp->ang & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char Net_PlayerSync2(void)
|
||||
{
|
||||
int32_t i;
|
||||
int32_t j, nextj;
|
||||
uint16_t crc = 0;
|
||||
DukePlayer_t *pp;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
pp = g_player[i].ps;
|
||||
|
||||
updatecrc(crc, pp->horiz & 255);
|
||||
updatecrc(crc, sprite[pp->i].extra & 255);
|
||||
updatecrc(crc, pp->bobcounter & 255);
|
||||
}
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PLAYER], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char Net_ActorSync(void)
|
||||
{
|
||||
uint16_t crc = 0;
|
||||
int32_t j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ACTOR], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->lotag) & 255);
|
||||
updatecrc(crc, (spr->hitag) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
}
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ZOMBIEACTOR], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->lotag) & 255);
|
||||
updatecrc(crc, (spr->hitag) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char Net_WeaponSync(void)
|
||||
{
|
||||
uint16_t crc = 0;
|
||||
int32_t j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PROJECTILE], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char Net_MapSync(void)
|
||||
{
|
||||
uint16_t crc = 0;
|
||||
int32_t j, nextj;
|
||||
spritetype *spr;
|
||||
walltype *wal;
|
||||
sectortype *sect;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_EFFECTOR], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
updatecrc(crc, (spr->lotag) & 255);
|
||||
updatecrc(crc, (spr->hitag) & 255);
|
||||
}
|
||||
|
||||
for (j=numwalls; j>=0; j--)
|
||||
{
|
||||
wal = &wall[j];
|
||||
updatecrc(crc, (wal->x) & 255);
|
||||
updatecrc(crc, (wal->y) & 255);
|
||||
}
|
||||
|
||||
for (j=numsectors; j>=0; j--)
|
||||
{
|
||||
sect = §or[j];
|
||||
updatecrc(crc, (sect->floorz) & 255);
|
||||
updatecrc(crc, (sect->ceilingz) & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char Net_RandomSync(void)
|
||||
{
|
||||
uint16_t crc = 0;
|
||||
|
||||
updatecrc(crc, randomseed & 255);
|
||||
updatecrc(crc, (randomseed >> 8) & 255);
|
||||
updatecrc(crc, g_globalRandom & 255);
|
||||
updatecrc(crc, (g_globalRandom >> 8) & 255);
|
||||
|
||||
if (g_numSyncBytes == 1)
|
||||
{
|
||||
updatecrc(crc,Net_PlayerSync() & 255);
|
||||
updatecrc(crc,Net_PlayerSync2() & 255);
|
||||
updatecrc(crc,Net_WeaponSync() & 255);
|
||||
updatecrc(crc,Net_ActorSync() & 255);
|
||||
updatecrc(crc,Net_MapSync() & 255);
|
||||
}
|
||||
|
||||
return ((uint8_t) crc & 255);
|
||||
}
|
||||
|
||||
char *SyncNames[] =
|
||||
{
|
||||
"Net_CheckRandomSync",
|
||||
"Net_CheckPlayerSync",
|
||||
"Net_CheckPlayerSync2",
|
||||
"Net_CheckWeaponSync",
|
||||
"Net_CheckActorSync",
|
||||
"Net_CheckMapSync",
|
||||
NULL
|
||||
};
|
||||
|
||||
static char(*SyncFunc[MAXSYNCBYTES + 1])(void) =
|
||||
{
|
||||
Net_RandomSync,
|
||||
Net_PlayerSync,
|
||||
Net_PlayerSync2,
|
||||
Net_WeaponSync,
|
||||
Net_ActorSync,
|
||||
Net_MapSync,
|
||||
NULL
|
||||
};
|
||||
|
||||
void Net_GetSyncStat(void)
|
||||
{
|
||||
int32_t i;
|
||||
playerdata_t *pp = &g_player[myconnectindex];
|
||||
uint32_t val;
|
||||
static uint32_t count;
|
||||
|
||||
if (numplayers < 2)
|
||||
return;
|
||||
|
||||
for (i = 0; SyncFunc[i]; i++)
|
||||
{
|
||||
pp->syncval[pp->syncvalhead & (SYNCFIFOSIZ - 1)][i] = (*SyncFunc[i])();
|
||||
}
|
||||
|
||||
val = pp->syncval[pp->syncvalhead & (SYNCFIFOSIZ - 1)][0];
|
||||
count += val;
|
||||
|
||||
pp->syncvalhead++;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Sync Message print
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void Net_DisplaySyncMsg(void)
|
||||
{
|
||||
int32_t i, j;
|
||||
static uint32_t moveCount = 0;
|
||||
extern uint32_t g_moveThingsCount;
|
||||
|
||||
// if (!SyncPrintMode)
|
||||
// return;
|
||||
|
||||
if (numplayers < 2)
|
||||
return;
|
||||
|
||||
for (i = 0; i < g_numSyncBytes; i++)
|
||||
{
|
||||
// syncstat is NON 0 - out of sync
|
||||
if (syncstat[i] != 0)
|
||||
{
|
||||
if (g_numSyncBytes > 1)
|
||||
{
|
||||
Bsprintf(tempbuf, "Out Of Sync - %s", SyncNames[i]);
|
||||
printext256(4L, 100L + (i * 8), 31, 1, tempbuf, 0);
|
||||
}
|
||||
|
||||
if (!g_foundSyncError && g_szfirstSyncMsg[i][0] == '\0')
|
||||
{
|
||||
// g_foundSyncError one so test all of them and then never test again
|
||||
g_foundSyncError = TRUE;
|
||||
|
||||
// save off loop count
|
||||
moveCount = g_moveThingsCount;
|
||||
|
||||
for (j = 0; j < g_numSyncBytes; j++)
|
||||
{
|
||||
if (syncstat[j] != 0 && g_szfirstSyncMsg[j][0] == '\0')
|
||||
{
|
||||
Bsprintf(tempbuf, "Out Of Sync - %s", SyncNames[j]);
|
||||
strcpy(g_szfirstSyncMsg[j], tempbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// print out the g_szfirstSyncMsg message you got
|
||||
for (i = 0; i < g_numSyncBytes; i++)
|
||||
{
|
||||
if (g_szfirstSyncMsg[i][0] != '\0')
|
||||
{
|
||||
if (g_numSyncBytes > 1)
|
||||
{
|
||||
Bsprintf(tempbuf, "FIRST %s", g_szfirstSyncMsg[i]);
|
||||
printext256(4L, 44L + (i * 8), 31, 1, tempbuf, 0);
|
||||
Bsprintf(tempbuf, "moveCount %d",moveCount);
|
||||
printext256(4L, 52L + (i * 8), 31, 1, tempbuf, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printext256(4L,100L,31,0,"Out Of Sync - Please restart game",0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (syncstate != 0)
|
||||
// printext256(68L, 92L, 1, 31, "Missed Network packet!", 0);
|
||||
}
|
||||
|
||||
|
||||
static inline void Net_AddSyncData(int32_t *j)
|
||||
{
|
||||
int32_t sb;
|
||||
int32_t count = 0;
|
||||
|
||||
// sync testing
|
||||
while (g_player[myconnectindex].syncvalhead != syncvaltail && count++ < 4)
|
||||
{
|
||||
for (sb = 0; sb < g_numSyncBytes; sb++)
|
||||
packbuf[(*j)++] = g_player[myconnectindex].syncval[syncvaltail & (SYNCFIFOSIZ - 1)][sb];
|
||||
|
||||
syncvaltail++;
|
||||
}
|
||||
}
|
||||
|
||||
void Net_GetSyncData(char *packbuf, int32_t packbufleng, int32_t *j, int32_t otherconnectindex)
|
||||
{
|
||||
int32_t sb, i;
|
||||
extern int32_t syncvaltail, syncvaltottail;
|
||||
playerdata_t *ppo = &g_player[otherconnectindex];
|
||||
char found = 0;
|
||||
|
||||
// have had problems with this routine crashing when players quit
|
||||
// games.
|
||||
|
||||
// if ready2send is not set then don't try to get sync info
|
||||
|
||||
if (!ready2send)
|
||||
return;
|
||||
|
||||
// Suspect that its trying to traverse the connect list
|
||||
// for a player that does not exist. This tries to take care of that
|
||||
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (otherconnectindex == i)
|
||||
found = 1;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
// sync testing
|
||||
//while ((*j) != packbufleng) // changed this on Kens suggestion
|
||||
while ((*j) < packbufleng)
|
||||
{
|
||||
for (sb = 0; sb < g_numSyncBytes; sb++)
|
||||
{
|
||||
ppo->syncval[ppo->syncvalhead & (SYNCFIFOSIZ - 1)][sb] = packbuf[(*j)++];
|
||||
}
|
||||
ppo->syncvalhead++;
|
||||
}
|
||||
|
||||
// update syncstat
|
||||
// if any of the syncstat vars is non-0 then there is a problem
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (g_player[i].syncvalhead == syncvaltottail)
|
||||
return;
|
||||
}
|
||||
|
||||
//for (sb = 0; sb < g_numSyncBytes; sb++)
|
||||
// syncstat[sb] = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
for (sb = 0; sb < g_numSyncBytes; sb++)
|
||||
{
|
||||
if (g_player[i].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb] != g_player[connecthead].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb])
|
||||
{
|
||||
syncstat[sb] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
syncvaltottail++;
|
||||
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (g_player[i].syncvalhead == syncvaltottail)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue