mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 18:50:47 +00:00
source code rape
git-svn-id: https://svn.eduke32.com/eduke32@1143 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f169d5584f
commit
4910928877
41 changed files with 9860 additions and 9720 deletions
|
@ -291,14 +291,14 @@ endif
|
|||
enginelib editorlib:
|
||||
-mkdir -p $(EOBJ)
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m.\033[0m\n"
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" \
|
||||
SUPERBUILD=$(SUPERBUILD) POLYMOST=$(POLYMOST) \
|
||||
USE_OPENGL=$(USE_OPENGL) BUILD32_ON_64=$(BUILD32_ON_64) \
|
||||
NOASM=$(NOASM) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) RANCID_NETWORKING=$(RANCID_NETWORKING) $@
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m.\033[0m\n"
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
|
||||
$(EOBJ)/$(ENGINELIB): enginelib
|
||||
|
|
|
@ -194,10 +194,10 @@ ifeq ($(PRETTY_OUTPUT),1)
|
|||
BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)\"\033[0m\n"
|
||||
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n"
|
||||
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
|
||||
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m.\033[0m\n"
|
||||
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
|
||||
COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
|
||||
LINK_STATUS = printf "\033[K\033[0;0mLinking executable \033[1m$@\033[0;0m...\033[0m\r"
|
||||
LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m.\033[0m\n"
|
||||
LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m \033[0m\n"
|
||||
LINK_FAILED = printf "\033[K\033[0;31mFailed linking executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
|
||||
else
|
||||
BUILD_STARTED =
|
||||
|
|
|
@ -9611,7 +9611,8 @@ void getmousevalues(int *mousx, int *mousy, int *bstatus)
|
|||
//
|
||||
int krand(void)
|
||||
{
|
||||
randomseed = (randomseed*27584621)+1;
|
||||
// randomseed = (randomseed*27584621)+1;
|
||||
randomseed = (randomseed * 1664525ul) + 221297ul;
|
||||
return(((unsigned int)randomseed)>>16);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h> //HACK, for id generation
|
||||
|
||||
#include "mmulti_unstable.h"
|
||||
// #include <enet/enet.h>
|
||||
|
@ -73,6 +72,8 @@ int connecthead, connectpoint2[MAXPLAYERS];
|
|||
char syncstate = 0;
|
||||
|
||||
#define MAXPACKETSIZE 2048
|
||||
#define PACKET_START_GAME 0x1337
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// short intnum; /* communication between Game and the driver */
|
||||
|
@ -127,6 +128,11 @@ enum ECommitCMDs
|
|||
COMMIT_CMD_SCORE = 5,
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
int host;
|
||||
unsigned short port;
|
||||
} allowed_addresses[MAXPLAYERS]; /* only respond to these IPs. */
|
||||
|
||||
// Queue of out going packets.
|
||||
//PacketQueue outgoingPacketQueue;
|
||||
|
@ -180,6 +186,8 @@ void initmultiplayers(int argc, char **argv)
|
|||
outcntplc[i] = 0L;
|
||||
outcntend[i] = 0L;
|
||||
bakpacketlen[i][255] = -1;
|
||||
allowed_addresses[i].host = 0;
|
||||
allowed_addresses[i].port = 0;
|
||||
}
|
||||
|
||||
// clear out the packet ordering
|
||||
|
@ -544,7 +552,7 @@ int getpacket(int *other, char *bufptr)
|
|||
|
||||
void flushpackets()
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
int i;
|
||||
|
||||
if (numplayers < 2) return;
|
||||
|
@ -629,12 +637,6 @@ void genericmultifunction(int other, char *bufptr, int messleng, int command)
|
|||
static sockettype udpsocket = -1;
|
||||
static unsigned short udpport = BUILD_DEFAULT_UDP_PORT;
|
||||
|
||||
static struct
|
||||
{
|
||||
int host;
|
||||
unsigned short port;
|
||||
} allowed_addresses[MAXPLAYERS]; /* only respond to these IPs. */
|
||||
|
||||
#if PLATFORM_WIN32
|
||||
/*
|
||||
* Figure out what the last failing Win32 API call was, and
|
||||
|
@ -1121,7 +1123,7 @@ static int wait_for_other_players(gcomtype *gcom, int myip)
|
|||
// greeting with 0x1337 id starts the game for clients
|
||||
send_peer_greeting(allowed_addresses[j].host,
|
||||
allowed_addresses[j].port,
|
||||
0x1337);
|
||||
PACKET_START_GAME);
|
||||
}
|
||||
|
||||
/* ok, now everyone is talking to you. Sort them into player numbers... */
|
||||
|
@ -1217,9 +1219,10 @@ static int connect_to_server(gcomtype *gcom, int myip)
|
|||
|
||||
while (my_id == 0) /* player number is based on id, low to high. */
|
||||
{
|
||||
struct timeval tv;
|
||||
/* struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
my_id = (unsigned short)tv.tv_usec; //HACK
|
||||
my_id = (unsigned short)tv.tv_usec; //HACK */
|
||||
my_id = (unsigned short) rand();
|
||||
}
|
||||
|
||||
initprintf("mmulti_unstable: Using 0x%X as client ID\n", my_id);
|
||||
|
@ -1285,7 +1288,7 @@ static int connect_to_server(gcomtype *gcom, int myip)
|
|||
if (!heard_from[i] || heard_from[i] == B_SWAP16(packet.id)) break; // only increase once
|
||||
|
||||
// greeting with 0x1337 id starts the game
|
||||
if (B_SWAP16(packet.id) == 0x1337)
|
||||
if (B_SWAP16(packet.id) == PACKET_START_GAME)
|
||||
{
|
||||
remaining = 0;
|
||||
continue;
|
||||
|
@ -1427,9 +1430,10 @@ static int connect_to_everyone(gcomtype *gcom, int myip, int bcast)
|
|||
|
||||
while (my_id == 0) /* player number is based on id, low to high. */
|
||||
{
|
||||
struct timeval tv;
|
||||
/* struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
my_id = (unsigned short)tv.tv_usec; //HACK
|
||||
my_id = (unsigned short)tv.tv_usec; //HACK */
|
||||
my_id = (unsigned short) rand();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -456,6 +456,10 @@
|
|||
RelativePath=".\source\startwin.game.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\sync.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\testcd.c"
|
||||
>
|
||||
|
@ -552,6 +556,10 @@
|
|||
RelativePath=".\source\startwin.game.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\swmacros.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
|
|
@ -89,12 +89,13 @@ char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] =
|
|||
"Quick_Kick",
|
||||
"Next_Weapon",
|
||||
"Previous_Weapon",
|
||||
"Show_Console"
|
||||
"Show_Console",
|
||||
"Show_DukeMatch_Scores"
|
||||
};
|
||||
|
||||
#ifdef __SETUP__
|
||||
|
||||
#define NUMKEYENTRIES 53
|
||||
#define NUMKEYENTRIES 54
|
||||
|
||||
char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] =
|
||||
{
|
||||
|
@ -150,7 +151,8 @@ char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] =
|
|||
"Quick_Kick", "Q", "",
|
||||
"Next_Weapon", "'", "",
|
||||
"Previous_Weapon", ";", "",
|
||||
"Show_Console", "`", ""
|
||||
"Show_Console", "`", "",
|
||||
"Show_DukeMatch_Scores," "", ""
|
||||
};
|
||||
|
||||
const char oldkeydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] =
|
||||
|
@ -207,7 +209,8 @@ const char oldkeydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] =
|
|||
"Quick_Kick", "`", "",
|
||||
"Next_Weapon", "'", "",
|
||||
"Previous_Weapon", ";", "",
|
||||
"Show_Console", "`", ""
|
||||
"Show_Console", "`", "",
|
||||
"Show_DukeMatch_Scores", "", ""
|
||||
};
|
||||
|
||||
static char * mousedefaults[] =
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,31 +37,31 @@ void endanimsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(WIND_AMBIENCE);
|
||||
S_PlaySound(WIND_AMBIENCE);
|
||||
break;
|
||||
case 26:
|
||||
sound(ENDSEQVOL2SND1);
|
||||
S_PlaySound(ENDSEQVOL2SND1);
|
||||
break;
|
||||
case 36:
|
||||
sound(ENDSEQVOL2SND2);
|
||||
S_PlaySound(ENDSEQVOL2SND2);
|
||||
break;
|
||||
case 54:
|
||||
sound(THUD);
|
||||
S_PlaySound(THUD);
|
||||
break;
|
||||
case 62:
|
||||
sound(ENDSEQVOL2SND3);
|
||||
S_PlaySound(ENDSEQVOL2SND3);
|
||||
break;
|
||||
case 75:
|
||||
sound(ENDSEQVOL2SND4);
|
||||
S_PlaySound(ENDSEQVOL2SND4);
|
||||
break;
|
||||
case 81:
|
||||
sound(ENDSEQVOL2SND5);
|
||||
S_PlaySound(ENDSEQVOL2SND5);
|
||||
break;
|
||||
case 115:
|
||||
sound(ENDSEQVOL2SND6);
|
||||
S_PlaySound(ENDSEQVOL2SND6);
|
||||
break;
|
||||
case 124:
|
||||
sound(ENDSEQVOL2SND7);
|
||||
S_PlaySound(ENDSEQVOL2SND7);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -69,23 +69,23 @@ void endanimsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(WIND_REPEAT);
|
||||
S_PlaySound(WIND_REPEAT);
|
||||
break;
|
||||
case 98:
|
||||
sound(DUKE_GRUNT);
|
||||
S_PlaySound(DUKE_GRUNT);
|
||||
break;
|
||||
case 82+20:
|
||||
sound(THUD);
|
||||
sound(SQUISHED);
|
||||
S_PlaySound(THUD);
|
||||
S_PlaySound(SQUISHED);
|
||||
break;
|
||||
case 104+20:
|
||||
sound(ENDSEQVOL3SND3);
|
||||
S_PlaySound(ENDSEQVOL3SND3);
|
||||
break;
|
||||
case 114+20:
|
||||
sound(ENDSEQVOL3SND2);
|
||||
S_PlaySound(ENDSEQVOL3SND2);
|
||||
break;
|
||||
case 158:
|
||||
sound(PIPEBOMB_EXPLODE);
|
||||
S_PlaySound(PIPEBOMB_EXPLODE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -97,10 +97,10 @@ void logoanimsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(FLY_BY);
|
||||
S_PlaySound(FLY_BY);
|
||||
break;
|
||||
case 19:
|
||||
sound(PIPEBOMB_EXPLODE);
|
||||
S_PlaySound(PIPEBOMB_EXPLODE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -110,14 +110,14 @@ void intro4animsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(INTRO4_B);
|
||||
S_PlaySound(INTRO4_B);
|
||||
break;
|
||||
case 12:
|
||||
case 34:
|
||||
sound(SHORT_CIRCUIT);
|
||||
S_PlaySound(SHORT_CIRCUIT);
|
||||
break;
|
||||
case 18:
|
||||
sound(INTRO4_5);
|
||||
S_PlaySound(INTRO4_5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -127,16 +127,16 @@ void first4animsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(INTRO4_1);
|
||||
S_PlaySound(INTRO4_1);
|
||||
break;
|
||||
case 12:
|
||||
sound(INTRO4_2);
|
||||
S_PlaySound(INTRO4_2);
|
||||
break;
|
||||
case 7:
|
||||
sound(INTRO4_3);
|
||||
S_PlaySound(INTRO4_3);
|
||||
break;
|
||||
case 26:
|
||||
sound(INTRO4_4);
|
||||
S_PlaySound(INTRO4_4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void intro42animsounds(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 10:
|
||||
sound(INTRO4_6);
|
||||
S_PlaySound(INTRO4_6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -156,10 +156,10 @@ void endanimvol41(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 3:
|
||||
sound(DUKE_UNDERWATER);
|
||||
S_PlaySound(DUKE_UNDERWATER);
|
||||
break;
|
||||
case 35:
|
||||
sound(VOL4ENDSND1);
|
||||
S_PlaySound(VOL4ENDSND1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -169,13 +169,13 @@ void endanimvol42(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 11:
|
||||
sound(DUKE_UNDERWATER);
|
||||
S_PlaySound(DUKE_UNDERWATER);
|
||||
break;
|
||||
case 20:
|
||||
sound(VOL4ENDSND1);
|
||||
S_PlaySound(VOL4ENDSND1);
|
||||
break;
|
||||
case 39:
|
||||
sound(VOL4ENDSND2);
|
||||
S_PlaySound(VOL4ENDSND2);
|
||||
break;
|
||||
case 50:
|
||||
FX_StopAllSounds();
|
||||
|
@ -188,19 +188,19 @@ void endanimvol43(int fr)
|
|||
switch (fr)
|
||||
{
|
||||
case 1:
|
||||
sound(BOSS4_DEADSPEECH);
|
||||
S_PlaySound(BOSS4_DEADSPEECH);
|
||||
break;
|
||||
case 40:
|
||||
sound(VOL4ENDSND1);
|
||||
sound(DUKE_UNDERWATER);
|
||||
S_PlaySound(VOL4ENDSND1);
|
||||
S_PlaySound(DUKE_UNDERWATER);
|
||||
break;
|
||||
case 50:
|
||||
sound(BIGBANG);
|
||||
S_PlaySound(BIGBANG);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void playanm(const char *fn,char t)
|
||||
void G_PlayAnim(const char *fn,char t)
|
||||
{
|
||||
char *animbuf;
|
||||
unsigned char *palptr;
|
||||
|
@ -250,7 +250,7 @@ void playanm(const char *fn,char t)
|
|||
|
||||
//setpalette(0L,256L,tempbuf);
|
||||
//setbrightness(ud.brightness>>2,tempbuf,2);
|
||||
setgamepalette(g_player[myconnectindex].ps,animpal,10);
|
||||
SetGamePalette(g_player[myconnectindex].ps,animpal,10);
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
gltexfiltermode = 0;
|
||||
|
@ -275,10 +275,10 @@ void playanm(const char *fn,char t)
|
|||
goto ENDOFANIMLOOP;
|
||||
handleevents();
|
||||
getpackets();
|
||||
if (restorepalette == 1)
|
||||
if (g_restorePalette == 1)
|
||||
{
|
||||
setgamepalette(g_player[myconnectindex].ps,animpal,0);
|
||||
restorepalette = 0;
|
||||
SetGamePalette(g_player[myconnectindex].ps,animpal,0);
|
||||
g_restorePalette = 0;
|
||||
}
|
||||
idle();
|
||||
}
|
||||
|
|
|
@ -7331,7 +7331,7 @@ static void comlinehelp(void)
|
|||
wm_msgbox("Mapster32"VERSION BUILDDATE,s);
|
||||
}
|
||||
|
||||
static void addgamepath(const char *buffer)
|
||||
static void AddGamePath(const char *buffer)
|
||||
{
|
||||
struct strllist *s;
|
||||
s = (struct strllist *)Bcalloc(1,sizeof(struct strllist));
|
||||
|
@ -7347,7 +7347,7 @@ static void addgamepath(const char *buffer)
|
|||
CommandPaths = s;
|
||||
}
|
||||
|
||||
static void addgroup(const char *buffer)
|
||||
static void G_AddGroup(const char *buffer)
|
||||
{
|
||||
struct strllist *s;
|
||||
s = (struct strllist *)Bcalloc(1,sizeof(struct strllist));
|
||||
|
@ -7374,7 +7374,7 @@ static void addgroup(const char *buffer)
|
|||
extern char forcegl;
|
||||
#endif
|
||||
|
||||
static void checkcommandline(int argc, const char **argv)
|
||||
static void G_CheckCommandLine(int argc, const char **argv)
|
||||
{
|
||||
int i = 1, j, maxlen=0, *lengths;
|
||||
char *c, *k;
|
||||
|
@ -7406,7 +7406,7 @@ static void checkcommandline(int argc, const char **argv)
|
|||
{
|
||||
if (argc > i+1)
|
||||
{
|
||||
addgroup(argv[i+1]);
|
||||
G_AddGroup(argv[i+1]);
|
||||
COPYARG(i);
|
||||
COPYARG(i+1);
|
||||
i++;
|
||||
|
@ -7419,7 +7419,7 @@ static void checkcommandline(int argc, const char **argv)
|
|||
{
|
||||
if (argc > i+1)
|
||||
{
|
||||
addgamepath(argv[i+1]);
|
||||
AddGamePath(argv[i+1]);
|
||||
COPYARG(i);
|
||||
COPYARG(i+1);
|
||||
i++;
|
||||
|
@ -7516,14 +7516,14 @@ static void checkcommandline(int argc, const char **argv)
|
|||
case 'J':
|
||||
c++;
|
||||
if (!*c) break;
|
||||
addgamepath(c);
|
||||
AddGamePath(c);
|
||||
COPYARG(i);
|
||||
break;
|
||||
case 'g':
|
||||
case 'G':
|
||||
c++;
|
||||
if (!*c) break;
|
||||
addgroup(c);
|
||||
G_AddGroup(c);
|
||||
COPYARG(i);
|
||||
break;
|
||||
}
|
||||
|
@ -7535,7 +7535,7 @@ static void checkcommandline(int argc, const char **argv)
|
|||
{
|
||||
if (!Bstrcasecmp(k,".grp") || !Bstrcasecmp(k,".zip"))
|
||||
{
|
||||
addgroup(argv[i++]);
|
||||
G_AddGroup(argv[i++]);
|
||||
COPYARG(i);
|
||||
continue;
|
||||
}
|
||||
|
@ -7582,7 +7582,7 @@ int ExtPreInit(int argc,const char **argv)
|
|||
initprintf("Mapster32"VERSION BUILDDATE"\n");
|
||||
initprintf("Copyright (c) 2008 EDuke32 team\n");
|
||||
|
||||
checkcommandline(argc,argv);
|
||||
G_CheckCommandLine(argc,argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -8015,7 +8015,7 @@ static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens)
|
|||
return T_ERROR;
|
||||
}
|
||||
|
||||
static void autoloadgrps(const char *fn)
|
||||
static void DoAutoload(const char *fn)
|
||||
{
|
||||
Bsprintf(tempbuf,"autoload/%s",fn);
|
||||
getfilenames(tempbuf,"*.grp");
|
||||
|
@ -8062,7 +8062,7 @@ int parsegroupfiles(scriptfile *script)
|
|||
{
|
||||
initprintf("Using group file '%s'.\n",fn);
|
||||
if (!NoAutoLoad)
|
||||
autoloadgrps(fn);
|
||||
DoAutoload(fn);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8529,7 +8529,7 @@ int 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)
|
||||
autoloadgrps(duke3dgrp);
|
||||
DoAutoload(duke3dgrp);
|
||||
}
|
||||
|
||||
if (getenv("DUKE3DDEF"))
|
||||
|
@ -8553,7 +8553,7 @@ int ExtInit(void)
|
|||
{
|
||||
initprintf("Using group file '%s'.\n",CommandGrps->str);
|
||||
if (!NoAutoLoad)
|
||||
autoloadgrps(CommandGrps->str);
|
||||
DoAutoload(CommandGrps->str);
|
||||
}
|
||||
|
||||
free(CommandGrps->str);
|
||||
|
|
|
@ -202,7 +202,7 @@ void CONFIG_SetDefaults(void)
|
|||
ud.config.MusicDevice = 0;
|
||||
ud.config.MusicToggle = 1;
|
||||
ud.config.MusicVolume = 200;
|
||||
myaimmode = g_player[0].ps->aim_mode = 1;
|
||||
g_myAimMode = g_player[0].ps->aim_mode = 1;
|
||||
ud.config.NumBits = 16;
|
||||
ud.config.NumChannels = 2;
|
||||
ud.config.NumVoices = 32;
|
||||
|
@ -253,7 +253,7 @@ void CONFIG_SetDefaults(void)
|
|||
ud.textscale = 100;
|
||||
|
||||
Bstrcpy(ud.rtsname, "DUKE.RTS");
|
||||
Bstrcpy(myname, "Duke");
|
||||
Bstrcpy(szPlayerName, "Duke");
|
||||
|
||||
Bstrcpy(ud.ridecule[0], "An inspiration for birth control.");
|
||||
Bstrcpy(ud.ridecule[1], "You're gonna die for that!");
|
||||
|
@ -587,12 +587,12 @@ void CONFIG_SetupJoystick(void)
|
|||
===================
|
||||
*/
|
||||
extern char *duke3dgrp;
|
||||
extern void check_valid_color(int *color,int prev_color);
|
||||
extern palette_t crosshair_colors;
|
||||
extern palette_t default_crosshair_colors;
|
||||
extern void G_CheckPlayerColor(int *color,int prev_color);
|
||||
extern palette_t CrosshairColors;
|
||||
extern palette_t DefaultCrosshairColors;
|
||||
extern char mod_dir[BMAX_PATH];
|
||||
extern int r_maxfps;
|
||||
extern int g_NoSetup;
|
||||
extern int g_noSetup;
|
||||
|
||||
int32 CONFIG_ReadSetup(void)
|
||||
{
|
||||
|
@ -637,8 +637,8 @@ int32 CONFIG_ReadSetup(void)
|
|||
while (Bstrlen(stripcolorcodes(dummybuf,tempbuf)) > 10)
|
||||
tempbuf[Bstrlen(tempbuf)-1] = '\0';
|
||||
|
||||
Bstrncpy(myname,tempbuf,sizeof(myname)-1);
|
||||
myname[sizeof(myname)-1] = '\0';
|
||||
Bstrncpy(szPlayerName,tempbuf,sizeof(szPlayerName)-1);
|
||||
szPlayerName[sizeof(szPlayerName)-1] = '\0';
|
||||
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
|
||||
|
||||
|
@ -648,152 +648,208 @@ int32 CONFIG_ReadSetup(void)
|
|||
packetrate = min(max(packetrate,50),1000);
|
||||
#endif
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Setup","ConfigVersion",&ud.configversion);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Setup","ForceSetup",&ud.config.ForceSetup);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (g_noSetup == 0 && mod_dir[0] == '/')
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]);
|
||||
#endif
|
||||
|
||||
{
|
||||
extern char defaultduke3dgrp[BMAX_PATH];
|
||||
if (!Bstrcmp(defaultduke3dgrp,"duke3d.grp"))
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (g_NoSetup == 0 && mod_dir[0] == '/')
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]);
|
||||
#endif
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Shadows",&ud.shadows);
|
||||
|
||||
if (!NAM)
|
||||
{
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup","Password",&ud.pwlockout[0]);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Out",&ud.lockout);
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "AmbientLight",&tempbuf[0]);
|
||||
if (atof(tempbuf))
|
||||
{
|
||||
r_ambientlight = atof(tempbuf);
|
||||
r_ambientlightrecip = 1.f/r_ambientlight;
|
||||
}
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Detail",&ud.detail);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Tilt",&ud.screen_tilting);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Messages",&ud.fta_on);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",&ud.config.ScreenWidth);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenHeight",&ud.config.ScreenHeight);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenMode",&ud.config.ScreenMode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size);
|
||||
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidGamma",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_gamma = atof(tempbuf);
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidBrightness",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_brightness = atof(tempbuf);
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidContrast",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_contrast = atof(tempbuf);
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "AmbientLight",&tempbuf[0]);
|
||||
if (atof(tempbuf))
|
||||
{
|
||||
r_ambientlight = atof(tempbuf);
|
||||
r_ambientlightrecip = 1.f/r_ambientlight;
|
||||
}
|
||||
extern int g_frameDelay;
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS",&r_maxfps);
|
||||
r_maxfps = max(0,min(1000,r_maxfps));
|
||||
{
|
||||
extern int g_FrameDelay;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS",&r_maxfps);
|
||||
r_maxfps = max(0,min(1000,r_maxfps));
|
||||
|
||||
if (r_maxfps)
|
||||
g_FrameDelay = (1000/r_maxfps);
|
||||
else g_FrameDelay = 0;
|
||||
g_frameDelay = (1000/r_maxfps);
|
||||
else g_frameDelay = 0;
|
||||
}
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP);
|
||||
if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Messages",&ud.fta_on);
|
||||
|
||||
if (!NAM)
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Out",&ud.lockout);
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup","Password",&ud.pwlockout[0]);
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenHeight",&ud.config.ScreenHeight);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenMode",&ud.config.ScreenMode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",&ud.config.ScreenWidth);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Shadows",&ud.shadows);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Tilt",&ud.screen_tilting);
|
||||
|
||||
{
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidGamma",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_gamma = atof(tempbuf);
|
||||
}
|
||||
|
||||
{
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidBrightness",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_brightness = atof(tempbuf);
|
||||
}
|
||||
|
||||
{
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidContrast",&tempbuf[0]);
|
||||
if (tempbuf[0]) vid_contrast = atof(tempbuf);
|
||||
}
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", (int32 *)&windowpos);
|
||||
windowx = -1;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32 *)&windowx);
|
||||
windowy = -1;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32 *)&windowy);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
#ifdef _WIN32
|
||||
dummy = 0;
|
||||
#else
|
||||
dummy = 1;
|
||||
#endif
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",&dummy);
|
||||
OSD_SetTextMode(dummy);
|
||||
}
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq);
|
||||
#endif
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen", &glwidescreen);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", &glusetexcachecompression);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", &r_fullbrights);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", &r_detailmapping);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", &r_glowmapping);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", &r_vertexarrays);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", &r_vbos);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", &r_vbocount);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVSync", &vsync);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing", &r_animsmoothing);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", &r_detailmapping);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", &r_fullbrights);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", &r_glowmapping);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", &r_modelocclusionchecking);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping", &r_parallaxskyclamping);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning", &r_parallaxskypanning);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", &r_modelocclusionchecking);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", &r_downsize);
|
||||
dummy = usemodels;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseModels",&dummy);
|
||||
usemodels = dummy != 0;
|
||||
dummy = usehightile;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseHightile",&dummy);
|
||||
usehightile = dummy != 0;
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
dummy = 0;
|
||||
#else
|
||||
dummy = 1;
|
||||
#endif
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",&dummy);
|
||||
OSD_SetTextMode(dummy);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", &glusetexcachecompression);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", &r_vbocount);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", &r_vbos);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", &r_vertexarrays);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVSync", &vsync);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen", &glwidescreen);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "OSDHightile",&osdhightile);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Executions",&ud.executions);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ForceSetup",&ud.config.ForceSetup);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "RunMode",&ud.config.RunMode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Crosshairs",&ud.crosshair);
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP);
|
||||
if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32;
|
||||
}
|
||||
|
||||
{
|
||||
dummy = usehightile;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseHightile",&dummy);
|
||||
usehightile = dummy != 0;
|
||||
}
|
||||
|
||||
{
|
||||
dummy = usemodels;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseModels",&dummy);
|
||||
usemodels = dummy != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AltHud",&ud.althud);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc","AngleInterpolation",&ud.angleinterpolation);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AutoMsg",&ud.automsg);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AutoVote",&ud.autovote);
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Color",&ud.color);
|
||||
G_CheckPlayerColor((int *)&ud.color,-1);
|
||||
g_player[0].ps->palookup = g_player[0].pcolor = ud.color;
|
||||
}
|
||||
|
||||
{
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Misc", "CrosshairColor",&tempbuf[0]);
|
||||
if (tempbuf[0])
|
||||
{
|
||||
char *ptr = strtok(tempbuf,",");
|
||||
palette_t temppal;
|
||||
char *palptr = (char *)&temppal;
|
||||
|
||||
i = 0;
|
||||
while (ptr != NULL && i < 3)
|
||||
{
|
||||
palptr[i++] = atoi(ptr);
|
||||
ptr = strtok(NULL,",");
|
||||
}
|
||||
if (i == 3)
|
||||
{
|
||||
Bmemcpy(&CrosshairColors,&temppal,sizeof(palette_t));
|
||||
DefaultCrosshairColors.f = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "CrosshairScale",&ud.crosshairscale);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "StatusBarScale",&ud.statusbarscale);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowLevelStats",&ud.levelstats);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowOpponentWeapons",&ud.config.ShowOpponentWeapons);
|
||||
ud.showweapons = ud.config.ShowOpponentWeapons;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowViewWeapon",&ud.drawweapon);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Crosshairs",&ud.crosshair);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "DeathMessages",&ud.obituaries);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "DemoCams",&ud.democams);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowFPS",&ud.tickrate);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Color",&ud.color);
|
||||
check_valid_color((int *)&ud.color,-1);
|
||||
g_player[0].ps->palookup = g_player[0].pcolor = ud.color;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Team",&dummy);
|
||||
ud.team = 0;
|
||||
if (dummy < 4 && dummy > -1) ud.team = dummy;
|
||||
g_player[0].pteam = ud.team;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AutoVote",&ud.autovote);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AutoMsg",&ud.automsg);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Executions",&ud.executions);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "IDPlayers",&ud.idplayers);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ViewBobbing",&ud.viewbob);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "WeaponSway",&ud.weaponsway);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AltHud",&ud.althud);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "RunMode",&ud.config.RunMode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowFPS",&ud.tickrate);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowLevelStats",&ud.levelstats);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowOpponentWeapons",&ud.config.ShowOpponentWeapons); ud.showweapons = ud.config.ShowOpponentWeapons;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowViewWeapon",&ud.drawweapon);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "StatusBarScale",&ud.statusbarscale);
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Team",&dummy);
|
||||
ud.team = 0;
|
||||
if (dummy < 4 && dummy > -1) ud.team = dummy;
|
||||
g_player[0].pteam = ud.team;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "TextScale",&ud.textscale);
|
||||
dummy = ud.config.useprecache;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "UsePrecache",&dummy);
|
||||
ud.config.useprecache = dummy != 0;
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc","AngleInterpolation",&ud.angleinterpolation);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ViewBobbing",&ud.viewbob);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "WeaponScale",&ud.weaponscale);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "TextScale",&ud.textscale);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "WeaponSway",&ud.weaponsway);
|
||||
|
||||
// weapon choices are defaulted in checkcommandline, which may override them
|
||||
// weapon choices are defaulted in G_CheckCommandLine, which may override them
|
||||
if (!CommandWeaponChoice)
|
||||
for (i=0;i<10;i++)
|
||||
{
|
||||
|
@ -803,68 +859,60 @@ int32 CONFIG_ReadSetup(void)
|
|||
if (dummy >= 0) g_player[0].wchoice[i] = dummy;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Setup","ConfigVersion",&ud.configversion);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "FXDevice",&ud.config.FXDevice);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicDevice",&ud.config.MusicDevice);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "FXVolume",&ud.config.FXVolume);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicVolume",&ud.config.MusicVolume);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",&ud.config.SoundToggle);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicToggle",&ud.config.MusicToggle);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",&ud.config.VoiceToggle);
|
||||
if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "AmbienceToggle",&ud.config.AmbienceToggle);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumVoices",&ud.config.NumVoices);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumChannels",&ud.config.NumChannels);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumBits",&ud.config.NumBits);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "FXDevice",&ud.config.FXDevice);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "FXVolume",&ud.config.FXVolume);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MixRate",&ud.config.MixRate);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicDevice",&ud.config.MusicDevice);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicToggle",&ud.config.MusicToggle);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "MusicVolume",&ud.config.MusicVolume);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumBits",&ud.config.NumBits);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumChannels",&ud.config.NumChannels);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "NumVoices",&ud.config.NumVoices);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "ReverseStereo",&ud.config.ReverseStereo);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",&ud.config.SoundToggle);
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",&ud.config.VoiceToggle);
|
||||
if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32 *)&g_myAimMode); // (if toggle mode) gives state
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AutoAim",&ud.config.AutoAim); // JBF 20031125
|
||||
g_player[0].ps->auto_aim = ud.config.AutoAim;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip); // mouse aiming inverted
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle
|
||||
g_player[0].ps->aim_mode = ud.mouseaiming;
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle
|
||||
g_player[0].ps->aim_mode = ud.mouseaiming;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseBias",&ud.config.MouseBias);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseDeadZone",&ud.config.MouseDeadZone);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","SmoothInput",&ud.config.SmoothInput);
|
||||
control_smoothmouse = ud.config.SmoothInput;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","SmoothInput",&ud.config.SmoothInput);
|
||||
control_smoothmouse = ud.config.SmoothInput;
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","UseJoystick",&ud.config.UseJoystick);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","UseMouse",&ud.config.UseMouse);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AutoAim",&ud.config.AutoAim); // JBF 20031125
|
||||
g_player[0].ps->auto_aim = ud.config.AutoAim;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",&ud.weaponswitch);
|
||||
g_player[0].ps->weaponswitch = ud.weaponswitch;
|
||||
|
||||
{
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",&ud.weaponswitch);
|
||||
g_player[0].ps->weaponswitch = ud.weaponswitch;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", &ud.config.CheckForUpdates);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", &ud.config.LastUpdateCheck);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", (int32 *)&windowpos);
|
||||
windowx = -1;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32 *)&windowx);
|
||||
windowy = -1;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32 *)&windowy);
|
||||
#endif
|
||||
tempbuf[0] = 0;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Misc", "CrosshairColor",&tempbuf[0]);
|
||||
if (tempbuf[0])
|
||||
{
|
||||
char *ptr = strtok(tempbuf,",");
|
||||
palette_t temppal;
|
||||
char *palptr = (char *)&temppal;
|
||||
|
||||
i = 0;
|
||||
while (ptr != NULL && i < 3)
|
||||
{
|
||||
palptr[i++] = atoi(ptr);
|
||||
ptr = strtok(NULL,",");
|
||||
}
|
||||
if (i == 3)
|
||||
{
|
||||
Bmemcpy(&crosshair_colors,&temppal,sizeof(palette_t));
|
||||
default_crosshair_colors.f = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CONFIG_ReadKeys();
|
||||
|
@ -934,28 +982,36 @@ void CONFIG_WriteSetup(void)
|
|||
if (ud.config.scripthandle < 0)
|
||||
ud.config.scripthandle = SCRIPT_Init(setupfilename);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(int) myaimmode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(int) g_myAimMode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AutoAim",ud.config.AutoAim,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseBias",ud.config.MouseBias,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseDeadZone",ud.config.MouseDeadZone,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","SmoothInput",ud.config.SmoothInput,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","SmoothInput",ud.config.SmoothInput,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseJoystick",ud.config.UseJoystick,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseMouse",ud.config.UseMouse,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AltHud",ud.althud,false,false);
|
||||
// SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AngleInterpolation",ud.angleinterpolation,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoMsg",ud.automsg,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoVote",ud.autovote,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Color",ud.color,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
|
||||
|
||||
if (CrosshairColors.r != DefaultCrosshairColors.r || CrosshairColors.g != DefaultCrosshairColors.g
|
||||
|| CrosshairColors.b != DefaultCrosshairColors.b)
|
||||
{
|
||||
Bsprintf(tempbuf,"%d,%d,%d",CrosshairColors.r,CrosshairColors.g,CrosshairColors.b);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Misc", "CrosshairColor",tempbuf);
|
||||
}
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "CrosshairScale",ud.crosshairscale,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DeathMessages",ud.obituaries,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DemoCams",ud.democams,false,false);
|
||||
ud.executions++;
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Executions",ud.executions,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Executions",++ud.executions,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "IDPlayers",ud.idplayers,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "RunMode",ud.config.RunMode,false,false);
|
||||
|
@ -966,49 +1022,60 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Team",ud.team,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "TextScale",ud.textscale,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "UsePrecache",ud.config.useprecache,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ViewBobbing",ud.viewbob,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponSway",ud.weaponsway,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AltHud",ud.althud,false,false);
|
||||
// SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AngleInterpolation",ud.angleinterpolation,false,false);
|
||||
|
||||
for (dummy=0;dummy<10;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"WeaponChoice%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc",buf,g_player[myconnectindex].wchoice[dummy],false,false);
|
||||
}
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponScale",ud.weaponscale,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "TextScale",ud.textscale,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponSway",ud.weaponsway,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Setup","ConfigVersion",BYTEVERSION_JF,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,false,false);
|
||||
|
||||
{
|
||||
Bsprintf(tempbuf,"%.2f",r_ambientlight);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "AmbientLight",tempbuf);
|
||||
}
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Detail",ud.detail,false,false);
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing",r_animsmoothing,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", r_modelocclusionchecking,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", r_vbos,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", r_vbocount,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", r_vbos,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVSync", vsync,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing",r_animsmoothing,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", r_modelocclusionchecking,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,false,false);
|
||||
#endif
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS", r_maxfps, false, false);
|
||||
#ifdef RENDERTYPEWIN
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);
|
||||
#endif
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDHightile",osdhightile,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",OSD_GetTextMode(),false,false);
|
||||
|
||||
if (!NAM)
|
||||
{
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Out",ud.lockout,false,false);
|
||||
|
@ -1023,12 +1090,27 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,false,false); // JBF 20031206
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false);
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseHightile",usehightile,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseModels",usemodels,false,false);
|
||||
#endif
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",OSD_GetTextMode(),false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDHightile",osdhightile,false,false);
|
||||
|
||||
{
|
||||
Bsprintf(tempbuf,"%.2f",vid_brightness);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidBrightness",tempbuf);
|
||||
Bsprintf(tempbuf,"%.2f",vid_contrast);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidContrast",tempbuf);
|
||||
Bsprintf(tempbuf,"%.2f",vid_gamma);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidGamma",tempbuf);
|
||||
}
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", windowpos, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", windowx, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", windowy, false, false);
|
||||
#endif
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "AmbienceToggle",ud.config.AmbienceToggle,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "FXVolume",ud.config.FXVolume,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MusicToggle",ud.config.MusicToggle,false,false);
|
||||
|
@ -1041,30 +1123,11 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",ud.config.SoundToggle,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",ud.config.VoiceToggle,false,false);
|
||||
|
||||
Bsprintf(tempbuf,"%.2f",vid_gamma);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidGamma",tempbuf);
|
||||
Bsprintf(tempbuf,"%.2f",vid_brightness);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidBrightness",tempbuf);
|
||||
Bsprintf(tempbuf,"%.2f",vid_contrast);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidContrast",tempbuf);
|
||||
Bsprintf(tempbuf,"%.2f",r_ambientlight);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "AmbientLight",tempbuf);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS", r_maxfps, false, false);
|
||||
#ifdef _WIN32
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", ud.config.CheckForUpdates, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", ud.config.LastUpdateCheck, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", windowpos, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", windowx, false, false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", windowy, false, false);
|
||||
#endif
|
||||
|
||||
if (crosshair_colors.r != default_crosshair_colors.r || crosshair_colors.g != default_crosshair_colors.g
|
||||
|| crosshair_colors.b != default_crosshair_colors.b)
|
||||
{
|
||||
Bsprintf(tempbuf,"%d,%d,%d",crosshair_colors.r,crosshair_colors.g,crosshair_colors.b);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Misc", "CrosshairColor",tempbuf);
|
||||
}
|
||||
|
||||
// JBF 20031211
|
||||
for (dummy=0;dummy<NUMGAMEFUNCTIONS;dummy++)
|
||||
{
|
||||
|
@ -1072,14 +1135,6 @@ void CONFIG_WriteSetup(void)
|
|||
KB_ScanCodeToString(ud.config.KeyboardKeys[dummy][0]), KB_ScanCodeToString(ud.config.KeyboardKeys[dummy][1]));
|
||||
}
|
||||
|
||||
for (dummy=0;dummy<10;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"WeaponChoice%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc",buf,g_player[myconnectindex].wchoice[dummy],false,false);
|
||||
}
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Setup","ConfigVersion",BYTEVERSION_JF,false,false);
|
||||
|
||||
for (dummy=0;dummy<MAXMOUSEBUTTONS;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"MouseButton%d",dummy);
|
||||
|
@ -1137,7 +1192,7 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueSaturate[dummy], false, false);
|
||||
}
|
||||
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&myname[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&szPlayerName[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
|
||||
|
||||
#ifndef RANCID_NETWORKING
|
||||
|
@ -1149,7 +1204,7 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (g_NoSetup == 0)
|
||||
if (g_noSetup == 0)
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -55,20 +55,22 @@ extern "C" {
|
|||
|
||||
#include "function.h"
|
||||
|
||||
#include "swmacros.h"
|
||||
|
||||
#define HORIZ_MIN -99
|
||||
#define HORIZ_MAX 299
|
||||
|
||||
extern int g_ScriptVersion, g_Shareware, g_GameType;
|
||||
extern int g_scriptVersion, g_Shareware, g_gameType;
|
||||
|
||||
#define GAMEDUKE 0
|
||||
#define GAMENAM 1
|
||||
#define GAMEWW2 3
|
||||
|
||||
#define VOLUMEALL (g_Shareware==0)
|
||||
#define PLUTOPAK (g_ScriptVersion==14)
|
||||
#define PLUTOPAK (g_scriptVersion==14)
|
||||
#define VOLUMEONE (g_Shareware==1)
|
||||
#define NAM (g_GameType&1)
|
||||
#define WW2GI (g_GameType&2)
|
||||
#define NAM (g_gameType&1)
|
||||
#define WW2GI (g_gameType&2)
|
||||
|
||||
#define MAXSLEEPDIST 16384
|
||||
#define SLEEPTIME 24*64
|
||||
|
@ -110,7 +112,7 @@ extern int g_ScriptVersion, g_Shareware, g_GameType;
|
|||
|
||||
#include "namesdyn.h"
|
||||
|
||||
#define TICRATE (120)
|
||||
#define TICRATE g_timerTicsPerSecond
|
||||
#define TICSPERFRAME (TICRATE/26)
|
||||
|
||||
// #define GC (TICSPERFRAME*44)
|
||||
|
@ -126,13 +128,28 @@ extern int g_ScriptVersion, g_Shareware, g_GameType;
|
|||
parm [ebx]\
|
||||
*/
|
||||
|
||||
#define STAT_DEFAULT 0
|
||||
#define STAT_ACTOR 1
|
||||
#define STAT_ZOMBIEACTOR 2
|
||||
#define STAT_EFFECTOR 3
|
||||
#define STAT_PROJECTILE 4
|
||||
#define STAT_MISC 5
|
||||
#define STAT_STANDABLE 6
|
||||
#define STAT_LOCATOR 7
|
||||
#define STAT_ACTIVATOR 8
|
||||
#define STAT_TRANSPORT 9
|
||||
#define STAT_PLAYER 10
|
||||
#define STAT_FX 11
|
||||
#define STAT_FALLER 12
|
||||
#define STAT_DUMMYPLAYER 13
|
||||
|
||||
#define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
|
||||
#define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
|
||||
#define RANDOMSCRAP EGS(s->sectnum,s->x+(TRAND&255)-128,s->y+(TRAND&255)-128,s->z-(8<<8)-(TRAND&8191),SCRAP6+(TRAND&15),-8,48,48,TRAND&2047,(TRAND&63)+64,-512-(TRAND&2047),i,5)
|
||||
#define RANDOMSCRAP A_InsertSprite(s->sectnum,s->x+(krand()&255)-128,s->y+(krand()&255)-128,s->z-(8<<8)-(krand()&8191),SCRAP6+(krand()&15),-8,48,48,krand()&2047,(krand()&63)+64,-512-(krand()&2047),i,5)
|
||||
|
||||
#define PHEIGHT (38<<8)
|
||||
|
||||
enum gamemodes {
|
||||
enum GameMode_t {
|
||||
MODE_MENU = 1,
|
||||
MODE_DEMO = 2,
|
||||
MODE_GAME = 4,
|
||||
|
@ -148,38 +165,16 @@ enum gamemodes {
|
|||
|
||||
#define MAXQUOTES 16384
|
||||
|
||||
#define PPDEATHSTRINGS MAXQUOTES-128
|
||||
#define PSDEATHSTRINGS MAXQUOTES-32
|
||||
#define FIRST_OBITUARY_QUOTE MAXQUOTES-128
|
||||
#define FIRST_SUICIDE_QUOTE MAXQUOTES-32
|
||||
|
||||
#define MAXCYCLERS 1024
|
||||
|
||||
#define MAXANIMATES 256
|
||||
|
||||
#define SP sprite[i].yvel
|
||||
#define SX sprite[i].x
|
||||
#define SY sprite[i].y
|
||||
#define SZ sprite[i].z
|
||||
#define SS sprite[i].shade
|
||||
#define PN sprite[i].picnum
|
||||
#define SA sprite[i].ang
|
||||
#define SV sprite[i].xvel
|
||||
#define ZV sprite[i].zvel
|
||||
#define RX sprite[i].xrepeat
|
||||
#define RY sprite[i].yrepeat
|
||||
#define OW sprite[i].owner
|
||||
#define CS sprite[i].cstat
|
||||
#define SH sprite[i].extra
|
||||
#define CX sprite[i].xoffset
|
||||
#define CY sprite[i].yoffset
|
||||
#define CD sprite[i].clipdist
|
||||
#define PL sprite[i].pal
|
||||
#define SLT sprite[i].lotag
|
||||
#define SHT sprite[i].hitag
|
||||
#define SECT sprite[i].sectnum
|
||||
|
||||
// Defines the motion characteristics of an actor
|
||||
|
||||
enum actormotion_flags {
|
||||
enum ActorMoveFlags_t {
|
||||
face_player = 1,
|
||||
geth = 2,
|
||||
getv = 4,
|
||||
|
@ -200,7 +195,7 @@ enum actormotion_flags {
|
|||
|
||||
// Defines for 'useractor' keyword
|
||||
|
||||
enum useractor_types {
|
||||
enum UserActorTypes_t {
|
||||
notenemy,
|
||||
enemy,
|
||||
enemystayput
|
||||
|
@ -208,7 +203,7 @@ enum useractor_types {
|
|||
|
||||
// Player Actions.
|
||||
|
||||
enum player_action_flags {
|
||||
enum PlayerActionFlags_t {
|
||||
pstanding = 1,
|
||||
pwalking = 2,
|
||||
prunning = 4,
|
||||
|
@ -228,7 +223,7 @@ enum player_action_flags {
|
|||
pfacing = 65536
|
||||
};
|
||||
|
||||
enum inventory_indexes {
|
||||
enum InventoryItem_t {
|
||||
GET_STEROIDS,
|
||||
GET_SHIELD,
|
||||
GET_SCUBA,
|
||||
|
@ -240,9 +235,7 @@ enum inventory_indexes {
|
|||
GET_BOOTS
|
||||
};
|
||||
|
||||
#define TRAND krand()
|
||||
|
||||
enum weapon_indexes {
|
||||
enum DukeWeapon_t {
|
||||
KNEE_WEAPON,
|
||||
PISTOL_WEAPON,
|
||||
SHOTGUN_WEAPON,
|
||||
|
@ -258,31 +251,8 @@ enum weapon_indexes {
|
|||
MAX_WEAPONS
|
||||
};
|
||||
|
||||
#define T1 hittype[i].temp_data[0]
|
||||
#define T2 hittype[i].temp_data[1]
|
||||
#define T3 hittype[i].temp_data[2]
|
||||
#define T4 hittype[i].temp_data[3]
|
||||
#define T5 hittype[i].temp_data[4]
|
||||
#define T6 hittype[i].temp_data[5]
|
||||
#define T7 hittype[i].temp_data[6]
|
||||
#define T8 hittype[i].temp_data[7]
|
||||
#define T9 hittype[i].temp_data[8]
|
||||
|
||||
#define ESCESCAPE if(KB_KeyPressed( sc_Escape ) ) gameexit(" ");
|
||||
|
||||
#define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E))
|
||||
|
||||
#define deletesprite deletesprite_
|
||||
void deletesprite_(int s);
|
||||
#define KILLIT(KX) {deletesprite(KX);goto BOLT;}
|
||||
|
||||
|
||||
#define IFMOVING if(ssp(i,CLIPMASK0))
|
||||
#define IFHIT j=ifhitbyweapon(i);if(j >= 0)
|
||||
|
||||
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)
|
||||
|
||||
#define rnd(X) ((TRAND>>8)>=(255-(X)))
|
||||
#define deletesprite A_DeleteSprite
|
||||
void A_DeleteSprite(int s);
|
||||
|
||||
#define __USRHOOKS_H
|
||||
|
||||
|
@ -326,15 +296,15 @@ typedef struct {
|
|||
|
||||
extern animwalltype animwall[MAXANIMWALLS];
|
||||
|
||||
extern short numanimwalls;
|
||||
extern short g_numAnimWalls;
|
||||
extern int probey;
|
||||
|
||||
extern char typebuflen,typebuf[141];
|
||||
extern char *MusicPtr;
|
||||
extern int Musicsize;
|
||||
extern int msx[2048],msy[2048];
|
||||
extern short cyclers[MAXCYCLERS][6],numcyclers;
|
||||
extern char myname[32];
|
||||
extern short cyclers[MAXCYCLERS][6],g_numCyclers;
|
||||
extern char szPlayerName[32];
|
||||
|
||||
struct savehead {
|
||||
char name[19];
|
||||
|
@ -446,12 +416,16 @@ typedef struct {
|
|||
typedef struct {
|
||||
int ox,oy,oz;
|
||||
short oa,os;
|
||||
} playerspawn_t;
|
||||
} PlayerSpawn_t;
|
||||
|
||||
extern char numplayersprites;
|
||||
extern char g_numPlayerSprites;
|
||||
|
||||
extern int fricxv,fricyv;
|
||||
|
||||
// TODO: make a dummy player struct for interpolation and sort the first members
|
||||
// of this struct into the same order so we can just memcpy it and get rid of the
|
||||
// mywhatever type globals
|
||||
|
||||
typedef struct {
|
||||
int zoom,exitx,exity;
|
||||
int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
|
||||
|
@ -513,40 +487,38 @@ typedef struct {
|
|||
char walking_snd_toggle, palookup, hard_landing;
|
||||
char /*fire_flag,*/pals[3];
|
||||
char return_to_center, reloading, name[32];
|
||||
} player_struct;
|
||||
} DukePlayer_t;
|
||||
|
||||
extern char tempbuf[2048], packbuf[576], menutextbuf[128];
|
||||
|
||||
extern int gc;
|
||||
extern int SpriteGravity;
|
||||
|
||||
extern int impact_damage,respawnactortime,respawnitemtime;
|
||||
extern int start_armour_amount;
|
||||
extern int g_impactDamage,g_actorRespawnTime,g_itemRespawnTime;
|
||||
extern int g_startArmorAmount;
|
||||
|
||||
#define MOVFIFOSIZ 256
|
||||
|
||||
extern short spriteq[1024],spriteqloc,spriteqamount;
|
||||
extern short SpriteDeletionQueue[1024],g_spriteDeleteQueuePos,g_spriteDeleteQueueSize;
|
||||
extern user_defs ud;
|
||||
extern short int moustat;
|
||||
extern short int global_random;
|
||||
extern short int g_globalRandom;
|
||||
extern char buf[1024]; //My own generic input buffer
|
||||
|
||||
#define MAXQUOTELEN 128
|
||||
|
||||
extern char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
|
||||
extern char *ScriptQuotes[MAXQUOTES],*ScriptQuoteRedefinitions[MAXQUOTES];
|
||||
extern char ready2send;
|
||||
|
||||
void scriptinfo(void);
|
||||
extern intptr_t *script,*scriptptr,*insptr,*labelcode,*labeltype;
|
||||
extern int labelcnt,defaultlabelcnt;
|
||||
extern int g_ScriptSize;
|
||||
void X_ScriptInfo(void);
|
||||
extern intptr_t *script,*insptr,*labelcode,*labeltype;
|
||||
extern int g_numLabels,g_numDefaultLabels;
|
||||
extern int g_scriptSize;
|
||||
extern char *label;
|
||||
extern intptr_t *actorscrptr[MAXTILES],*parsing_actor;
|
||||
extern intptr_t *actorscrptr[MAXTILES],*g_parsingActorPtr;
|
||||
extern intptr_t *actorLoadEventScrptr[MAXTILES];
|
||||
extern char actortype[MAXTILES];
|
||||
extern char *music_pointer;
|
||||
extern char ActorType[MAXTILES];
|
||||
|
||||
extern char music_select;
|
||||
extern char env_music_fn[MAXVOLUMES+1][BMAX_PATH];
|
||||
extern char g_musicIndex;
|
||||
extern char EnvMusicFilename[MAXVOLUMES+1][BMAX_PATH];
|
||||
extern short camsprite;
|
||||
|
||||
typedef struct {
|
||||
|
@ -577,7 +549,7 @@ typedef struct {
|
|||
projectile_t projectile;
|
||||
} actordata_t;
|
||||
|
||||
extern actordata_t hittype[MAXSPRITES];
|
||||
extern actordata_t ActorExtra[MAXSPRITES];
|
||||
|
||||
extern input_t loc;
|
||||
extern input_t recsync[RECSYNCBUFSIZ];
|
||||
|
@ -587,13 +559,13 @@ extern int numplayers, myconnectindex;
|
|||
extern int connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers)
|
||||
extern int screenpeek;
|
||||
|
||||
extern int current_menu;
|
||||
extern int tempwallptr,animatecnt;
|
||||
extern int g_currentMenu;
|
||||
extern int tempwallptr,g_animateCount;
|
||||
extern int lockclock;
|
||||
extern intptr_t frameplace;
|
||||
extern char display_mirror,loadfromgrouponly,rtsplaying;
|
||||
extern char display_mirror,g_loadFromGroupOnly,g_RTSPlaying;
|
||||
|
||||
extern int groupfile;
|
||||
extern int g_groupFileHandle;
|
||||
extern int ototalclock;
|
||||
|
||||
extern int *animateptr[MAXANIMATES];
|
||||
|
@ -605,48 +577,48 @@ extern int neartaghitdist;
|
|||
extern short animatesect[MAXANIMATES];
|
||||
extern int movefifoplc, vel,svel,angvel,horiz;
|
||||
|
||||
extern short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
||||
extern short g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
||||
|
||||
#include "funct.h"
|
||||
|
||||
extern int screencapt;
|
||||
extern char volume_names[MAXVOLUMES][33];
|
||||
extern char skill_names[5][33];
|
||||
extern int g_screenCapture;
|
||||
extern char EpisodeNames[MAXVOLUMES][33];
|
||||
extern char SkillNames[5][33];
|
||||
|
||||
extern int framerate;
|
||||
extern int g_currentFrameRate;
|
||||
|
||||
#define MAXGAMETYPES 16
|
||||
extern char gametype_names[MAXGAMETYPES][33];
|
||||
extern int gametype_flags[MAXGAMETYPES];
|
||||
extern char num_gametypes;
|
||||
extern char GametypeNames[MAXGAMETYPES][33];
|
||||
extern int GametypeFlags[MAXGAMETYPES];
|
||||
extern char g_numGametypes;
|
||||
|
||||
enum gametypeflags {
|
||||
GAMETYPE_FLAG_COOP = 1,
|
||||
GAMETYPE_FLAG_WEAPSTAY = 2,
|
||||
GAMETYPE_FLAG_FRAGBAR = 4,
|
||||
GAMETYPE_FLAG_SCORESHEET = 8,
|
||||
GAMETYPE_FLAG_DMSWITCHES = 16,
|
||||
GAMETYPE_FLAG_COOPSPAWN = 32,
|
||||
GAMETYPE_FLAG_ACCESSCARDSPRITES = 64,
|
||||
GAMETYPE_FLAG_COOPVIEW = 128,
|
||||
GAMETYPE_FLAG_COOPSOUND = 256,
|
||||
GAMETYPE_FLAG_OTHERPLAYERSINMAP = 512,
|
||||
GAMETYPE_FLAG_ITEMRESPAWN = 1024,
|
||||
GAMETYPE_FLAG_MARKEROPTION = 2048,
|
||||
GAMETYPE_FLAG_PLAYERSFRIENDLY = 4096,
|
||||
GAMETYPE_FLAG_FIXEDRESPAWN = 8192,
|
||||
GAMETYPE_FLAG_ACCESSATSTART = 16384,
|
||||
GAMETYPE_FLAG_PRESERVEINVENTORYDEATH = 32768,
|
||||
GAMETYPE_FLAG_TDM = 65536,
|
||||
GAMETYPE_FLAG_TDMSPAWN = 131072
|
||||
enum GametypeFlags_t {
|
||||
GAMETYPE_COOP = 1,
|
||||
GAMETYPE_WEAPSTAY = 2,
|
||||
GAMETYPE_FRAGBAR = 4,
|
||||
GAMETYPE_SCORESHEET = 8,
|
||||
GAMETYPE_DMSWITCHES = 16,
|
||||
GAMETYPE_COOPSPAWN = 32,
|
||||
GAMETYPE_ACCESSCARDSPRITES = 64,
|
||||
GAMETYPE_COOPVIEW = 128,
|
||||
GAMETYPE_COOPSOUND = 256,
|
||||
GAMETYPE_OTHERPLAYERSINMAP = 512,
|
||||
GAMETYPE_ITEMRESPAWN = 1024,
|
||||
GAMETYPE_MARKEROPTION = 2048,
|
||||
GAMETYPE_PLAYERSFRIENDLY = 4096,
|
||||
GAMETYPE_FIXEDRESPAWN = 8192,
|
||||
GAMETYPE_ACCESSATSTART = 16384,
|
||||
GAMETYPE_PRESERVEINVENTORYDEATH = 32768,
|
||||
GAMETYPE_TDM = 65536,
|
||||
GAMETYPE_TDMSPAWN = 131072
|
||||
};
|
||||
|
||||
#define GTFLAGS(x) (gametype_flags[ud.coop] & x)
|
||||
#define GTFLAGS(x) (GametypeFlags[ud.coop] & x)
|
||||
|
||||
extern char num_volumes;
|
||||
extern char g_numVolumes;
|
||||
|
||||
extern int lastsavedpos;
|
||||
extern int restorepalette;
|
||||
extern int g_lastSaveSlot;
|
||||
extern int g_restorePalette;
|
||||
#ifndef RANCID_NETWORKING
|
||||
extern int packetrate;
|
||||
#endif
|
||||
|
@ -654,21 +626,22 @@ extern int packetrate;
|
|||
extern int cachecount;
|
||||
extern char boardfilename[BMAX_PATH],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],animpal[768];
|
||||
extern char currentboardfilename[BMAX_PATH];
|
||||
extern char cachedebug,earthquaketime;
|
||||
extern int networkmode;
|
||||
extern char cachedebug,g_earthquakeTime;
|
||||
// 0: master/slave, 1: peer-to-peer
|
||||
extern int g_networkBroadcastMode;
|
||||
extern char lumplockbyte[11];
|
||||
|
||||
//DUKE3D.H - replace the end "my's" with this
|
||||
extern int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound;
|
||||
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, g_skillSoundID;
|
||||
extern short myang, omyang, mycursectnum, myjumpingcounter;
|
||||
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
|
||||
extern int fakemovefifoplc;
|
||||
extern int predictfifoplc;
|
||||
extern int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
extern int myhorizbak[MOVEFIFOSIZ];
|
||||
extern short myangbak[MOVEFIFOSIZ];
|
||||
|
||||
extern short weaponsandammosprites[15];
|
||||
extern short BlimpSpawnSprites[15];
|
||||
|
||||
//DUKE3D.H:
|
||||
typedef struct {
|
||||
|
@ -681,12 +654,12 @@ typedef struct {
|
|||
} STATUSBARTYPE;
|
||||
|
||||
extern STATUSBARTYPE sbar;
|
||||
extern int cameradist, cameraclock, dukefriction,show_shareware;
|
||||
extern int networkmode, movesperpacket;
|
||||
extern int gamequit;
|
||||
extern int g_cameraDistance, g_cameraClock, g_playerFriction,g_showShareware;
|
||||
extern int g_networkBroadcastMode, g_movesPerPacket;
|
||||
extern int g_gameQuit;
|
||||
|
||||
extern char pus,pub;
|
||||
extern int camerashitable,freezerhurtowner,lasermode;
|
||||
extern int g_damageCameras,g_freezerSelfDamage,g_tripbombLaserMode;
|
||||
|
||||
// TENSW: on really bad network connections, the sync FIFO queue can overflow if it is the
|
||||
// same size as the move fifo.
|
||||
|
@ -696,23 +669,24 @@ extern int camerashitable,freezerhurtowner,lasermode;
|
|||
extern char syncstat[MAXSYNCBYTES];
|
||||
extern signed char multiwho, multipos, multiwhat, multiflag;
|
||||
extern int syncvaltail, syncvaltottail;
|
||||
extern int numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
extern int g_numFreezeBounces,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius;
|
||||
extern int g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
||||
extern int everyothertime;
|
||||
extern int mymaxlag, otherminlag, bufferjitter;
|
||||
|
||||
extern int numinterpolations, startofdynamicinterpolations;
|
||||
extern int g_numInterpolations, startofdynamicinterpolations;
|
||||
extern int oldipos[MAXINTERPOLATIONS];
|
||||
extern int bakipos[MAXINTERPOLATIONS];
|
||||
extern int *curipos[MAXINTERPOLATIONS];
|
||||
|
||||
extern short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
extern short g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
||||
extern int cloudtotalclock,totalmemory;
|
||||
|
||||
extern int stereomode, stereowidth, stereopixelwidth;
|
||||
|
||||
extern int myaimmode, myaimstat, omyaimstat;
|
||||
extern int g_myAimMode, g_myAimStat, g_oldAimStat;
|
||||
|
||||
extern unsigned int MoveThingsCount;
|
||||
extern unsigned int g_moveThingsCount;
|
||||
|
||||
#define IFISGLMODE if (getrendermode() >= 3)
|
||||
#define IFISSOFTMODE if (getrendermode() < 3)
|
||||
|
@ -723,7 +697,7 @@ extern unsigned int MoveThingsCount;
|
|||
#define TILE_ANIM (MAXTILES-4)
|
||||
#define TILE_VIEWSCR (MAXTILES-5)
|
||||
|
||||
enum events {
|
||||
enum GameEvent_t {
|
||||
EVENT_INIT,
|
||||
EVENT_ENTERLEVEL,
|
||||
EVENT_RESETWEAPONS,
|
||||
|
@ -815,7 +789,7 @@ enum events {
|
|||
MAXEVENTS
|
||||
};
|
||||
|
||||
enum sysstrs {
|
||||
enum SystemString_t {
|
||||
STR_MAPNAME,
|
||||
STR_MAPFILENAME,
|
||||
STR_PLAYERNAME,
|
||||
|
@ -827,30 +801,30 @@ enum sysstrs {
|
|||
|
||||
|
||||
|
||||
enum gamevarflags {
|
||||
enum GamevarFlags_t {
|
||||
MAXGAMEVARS = 2048, // must be a power of two
|
||||
MAXVARLABEL = 26,
|
||||
GAMEVAR_FLAG_NORMAL = 0, // normal
|
||||
GAMEVAR_FLAG_PERPLAYER = 1, // per-player variable
|
||||
GAMEVAR_FLAG_PERACTOR = 2, // per-actor variable
|
||||
GAMEVAR_FLAG_USER_MASK = 3,
|
||||
GAMEVAR_FLAG_DEFAULT = 256, // allow override
|
||||
GAMEVAR_FLAG_SECRET = 512, // don't dump...
|
||||
GAMEVAR_FLAG_NODEFAULT = 1024, // don't reset on actor spawn
|
||||
GAMEVAR_FLAG_SYSTEM = 2048, // cannot change mode flags...(only default value)
|
||||
GAMEVAR_FLAG_READONLY = 4096, // values are read-only (no setvar allowed)
|
||||
GAMEVAR_FLAG_INTPTR = 8192, // plValue is a pointer to an int
|
||||
GAMEVAR_FLAG_SYNCCHECK = 16384, // check event sync when translating
|
||||
GAMEVAR_FLAG_SHORTPTR = 32768, // plValue is a pointer to a short
|
||||
GAMEVAR_FLAG_CHARPTR = 65536, // plValue is a pointer to a char
|
||||
GAMEVAR_FLAG_NORESET = 131072, // var values are not reset when restoring map state
|
||||
GAMEVAR_NORMAL = 0, // normal
|
||||
GAMEVAR_PERPLAYER = 1, // per-player variable
|
||||
GAMEVAR_PERACTOR = 2, // per-actor variable
|
||||
GAMEVAR_USER_MASK = 3,
|
||||
GAMEVAR_DEFAULT = 256, // allow override
|
||||
GAMEVAR_SECRET = 512, // don't dump...
|
||||
GAMEVAR_NODEFAULT = 1024, // don't reset on actor spawn
|
||||
GAMEVAR_SYSTEM = 2048, // cannot change mode flags...(only default value)
|
||||
GAMEVAR_READONLY = 4096, // values are read-only (no setvar allowed)
|
||||
GAMEVAR_INTPTR = 8192, // plValue is a pointer to an int
|
||||
GAMEVAR_SYNCCHECK = 16384, // check event sync when translating
|
||||
GAMEVAR_SHORTPTR = 32768, // plValue is a pointer to a short
|
||||
GAMEVAR_CHARPTR = 65536, // plValue is a pointer to a char
|
||||
GAMEVAR_NORESET = 131072, // var values are not reset when restoring map state
|
||||
};
|
||||
|
||||
enum gamearrayflags {
|
||||
enum GamearrayFlags_t {
|
||||
MAXGAMEARRAYS = (MAXGAMEVARS>>2), // must be lower than MAXGAMEVARS
|
||||
MAXARRAYLABEL = MAXVARLABEL,
|
||||
GAMEARRAY_FLAG_NORMAL = 0,
|
||||
GAMEARRAY_FLAG_NORESET = 1,
|
||||
GAMEARRAY_NORMAL = 0,
|
||||
GAMEARRAY_NORESET = 1,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -871,22 +845,22 @@ typedef struct {
|
|||
|
||||
extern gamevar_t aGameVars[MAXGAMEVARS];
|
||||
extern gamearray_t aGameArrays[MAXGAMEARRAYS];
|
||||
extern int iGameVarCount;
|
||||
extern int iGameArrayCount;
|
||||
extern int g_gameVarCount;
|
||||
extern int g_gameArrayCount;
|
||||
|
||||
extern int spriteflags[MAXTILES];
|
||||
extern int SpriteFlags[MAXTILES];
|
||||
|
||||
enum spriteflags {
|
||||
SPRITE_FLAG_SHADOW = 1,
|
||||
SPRITE_FLAG_NVG = 2,
|
||||
SPRITE_FLAG_NOSHADE = 4,
|
||||
SPRITE_FLAG_PROJECTILE = 8,
|
||||
SPRITE_FLAG_DECAL = 16,
|
||||
SPRITE_FLAG_BADGUY = 32,
|
||||
SPRITE_FLAG_NOPAL = 64
|
||||
enum SpriteFlags_t {
|
||||
SPRITE_SHADOW = 1,
|
||||
SPRITE_NVG = 2,
|
||||
SPRITE_NOSHADE = 4,
|
||||
SPRITE_PROJECTILE = 8,
|
||||
SPRITE_DECAL = 16,
|
||||
SPRITE_BADGUY = 32,
|
||||
SPRITE_NOPAL = 64
|
||||
};
|
||||
|
||||
extern short spritecache[MAXTILES][3];
|
||||
extern short SpriteCacheList[MAXTILES][3];
|
||||
|
||||
extern int g_iReturnVarID;
|
||||
extern int g_iWeaponVarID;
|
||||
|
@ -922,28 +896,29 @@ extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
|
|||
extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
|
||||
extern intptr_t *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
|
||||
extern intptr_t *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
|
||||
extern intptr_t *aplWeaponSelectSound[MAX_WEAPONS]; // Sound for weapon selection
|
||||
|
||||
extern short timer;
|
||||
extern short g_timerTicsPerSecond;
|
||||
|
||||
enum weaponflags {
|
||||
WEAPON_FLAG_HOLSTER_CLEARS_CLIP = 1, // 'holstering' clears the current clip
|
||||
WEAPON_FLAG_GLOWS = 2, // weapon 'glows' (shrinker and grower)
|
||||
WEAPON_FLAG_AUTOMATIC = 4, // automatic fire (continues while 'fire' is held down
|
||||
WEAPON_FLAG_FIREEVERYOTHER = 8, // during 'hold time' fire every frame
|
||||
WEAPON_FLAG_FIREEVERYTHIRD = 16, // during 'hold time' fire every third frame
|
||||
WEAPON_FLAG_RANDOMRESTART = 32, // restart for automatic is 'randomized' by RND 3
|
||||
WEAPON_FLAG_AMMOPERSHOT = 64, // uses ammo for each shot (for automatic)
|
||||
WEAPON_FLAG_BOMB_TRIGGER = 128, // weapon is the 'bomb' trigger
|
||||
WEAPON_FLAG_NOVISIBLE = 256, // weapon use does not cause user to become 'visible'
|
||||
WEAPON_FLAG_THROWIT = 512, // weapon 'throws' the 'shoots' item...
|
||||
WEAPON_FLAG_CHECKATRELOAD = 1024, // check weapon availability at 'reload' time
|
||||
WEAPON_FLAG_STANDSTILL = 2048, // player stops jumping before actual fire (like tripbomb in duke)
|
||||
WEAPON_FLAG_SPAWNTYPE1 = 0, // just spawn
|
||||
WEAPON_FLAG_SPAWNTYPE2 = 4096, // spawn like shotgun shells
|
||||
WEAPON_FLAG_SPAWNTYPE3 = 8192, // spawn like chaingun shells
|
||||
WEAPON_FLAG_SEMIAUTO = 16384, // cancel button press after each shot
|
||||
WEAPON_FLAG_RELOAD_TIMING = 32768, // special casing for pistol reload sounds
|
||||
WEAPON_FLAG_RESET = 65536 // cycle weapon back to frame 1 if fire is held, 0 if not
|
||||
enum WeaponFlags_t {
|
||||
WEAPON_HOLSTER_CLEARS_CLIP = 1, // 'holstering' clears the current clip
|
||||
WEAPON_GLOWS = 2, // weapon 'glows' (shrinker and grower)
|
||||
WEAPON_AUTOMATIC = 4, // automatic fire (continues while 'fire' is held down
|
||||
WEAPON_FIREEVERYOTHER = 8, // during 'hold time' fire every frame
|
||||
WEAPON_FIREEVERYTHIRD = 16, // during 'hold time' fire every third frame
|
||||
WEAPON_RANDOMRESTART = 32, // restart for automatic is 'randomized' by RND 3
|
||||
WEAPON_AMMOPERSHOT = 64, // uses ammo for each shot (for automatic)
|
||||
WEAPON_BOMB_TRIGGER = 128, // weapon is the 'bomb' trigger
|
||||
WEAPON_NOVISIBLE = 256, // weapon use does not cause user to become 'visible'
|
||||
WEAPON_THROWIT = 512, // weapon 'throws' the 'shoots' item...
|
||||
WEAPON_CHECKATRELOAD = 1024, // check weapon availability at 'reload' time
|
||||
WEAPON_STANDSTILL = 2048, // player stops jumping before actual fire (like tripbomb in duke)
|
||||
WEAPON_SPAWNTYPE1 = 0, // just spawn
|
||||
WEAPON_SPAWNTYPE2 = 4096, // spawn like shotgun shells
|
||||
WEAPON_SPAWNTYPE3 = 8192, // spawn like chaingun shells
|
||||
WEAPON_SEMIAUTO = 16384, // cancel button press after each shot
|
||||
WEAPON_RELOAD_TIMING = 32768, // special casing for pistol reload sounds
|
||||
WEAPON_RESET = 65536 // cycle weapon back to frame 1 if fire is held, 0 if not
|
||||
};
|
||||
|
||||
#define TRIPBOMB_TRIPWIRE 1
|
||||
|
@ -954,57 +929,57 @@ enum weaponflags {
|
|||
|
||||
// custom projectiles
|
||||
|
||||
enum projectileflags {
|
||||
PROJECTILE_FLAG_HITSCAN = 1,
|
||||
PROJECTILE_FLAG_RPG = 2,
|
||||
PROJECTILE_FLAG_BOUNCESOFFWALLS = 4,
|
||||
PROJECTILE_FLAG_BOUNCESOFFMIRRORS = 8,
|
||||
PROJECTILE_FLAG_KNEE = 16,
|
||||
PROJECTILE_FLAG_WATERBUBBLES = 32,
|
||||
PROJECTILE_FLAG_TIMED = 64,
|
||||
PROJECTILE_FLAG_BOUNCESOFFSPRITES = 128,
|
||||
PROJECTILE_FLAG_SPIT = 256,
|
||||
PROJECTILE_FLAG_COOLEXPLOSION1 = 512,
|
||||
PROJECTILE_FLAG_BLOOD = 1024,
|
||||
PROJECTILE_FLAG_LOSESVELOCITY = 2048,
|
||||
PROJECTILE_FLAG_NOAIM = 4096,
|
||||
PROJECTILE_FLAG_RANDDECALSIZE = 8192,
|
||||
PROJECTILE_FLAG_EXPLODEONTIMER = 16384,
|
||||
PROJECTILE_FLAG_RPG_IMPACT = 32768,
|
||||
PROJECTILE_FLAG_RADIUS_PICNUM = 65536,
|
||||
PROJECTILE_FLAG_ACCURATE_AUTOAIM = 131072,
|
||||
PROJECTILE_FLAG_FORCEIMPACT = 262144
|
||||
enum ProjectileFlags_t {
|
||||
PROJECTILE_HITSCAN = 1,
|
||||
PROJECTILE_RPG = 2,
|
||||
PROJECTILE_BOUNCESOFFWALLS = 4,
|
||||
PROJECTILE_BOUNCESOFFMIRRORS = 8,
|
||||
PROJECTILE_KNEE = 16,
|
||||
PROJECTILE_WATERBUBBLES = 32,
|
||||
PROJECTILE_TIMED = 64,
|
||||
PROJECTILE_BOUNCESOFFSPRITES = 128,
|
||||
PROJECTILE_SPIT = 256,
|
||||
PROJECTILE_COOLEXPLOSION1 = 512,
|
||||
PROJECTILE_BLOOD = 1024,
|
||||
PROJECTILE_LOSESVELOCITY = 2048,
|
||||
PROJECTILE_NOAIM = 4096,
|
||||
PROJECTILE_RANDDECALSIZE = 8192,
|
||||
PROJECTILE_EXPLODEONTIMER = 16384,
|
||||
PROJECTILE_RPG_IMPACT = 32768,
|
||||
PROJECTILE_RADIUS_PICNUM = 65536,
|
||||
PROJECTILE_ACCURATE_AUTOAIM = 131072,
|
||||
PROJECTILE_FORCEIMPACT = 262144
|
||||
};
|
||||
|
||||
extern projectile_t projectile[MAXTILES], defaultprojectile[MAXTILES];
|
||||
extern projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES];
|
||||
|
||||
// logo control
|
||||
|
||||
enum logoflags {
|
||||
LOGO_FLAG_ENABLED = 1,
|
||||
LOGO_FLAG_PLAYANIM = 2,
|
||||
LOGO_FLAG_PLAYMUSIC = 4,
|
||||
LOGO_FLAG_3DRSCREEN = 8,
|
||||
LOGO_FLAG_TITLESCREEN = 16,
|
||||
LOGO_FLAG_DUKENUKEM = 32,
|
||||
LOGO_FLAG_THREEDEE = 64,
|
||||
LOGO_FLAG_PLUTOPAKSPRITE = 128,
|
||||
LOGO_FLAG_SHAREWARESCREENS = 256,
|
||||
LOGO_FLAG_TENSCREEN = 512
|
||||
enum LogoFlags_t {
|
||||
LOGO_ENABLED = 1,
|
||||
LOGO_PLAYANIM = 2,
|
||||
LOGO_PLAYMUSIC = 4,
|
||||
LOGO_3DRSCREEN = 8,
|
||||
LOGO_TITLESCREEN = 16,
|
||||
LOGO_DUKENUKEM = 32,
|
||||
LOGO_THREEDEE = 64,
|
||||
LOGO_PLUTOPAKSPRITE = 128,
|
||||
LOGO_SHAREWARESCREENS = 256,
|
||||
LOGO_TENSCREEN = 512
|
||||
};
|
||||
|
||||
extern int g_NumPalettes;
|
||||
extern int g_ScriptDebug;
|
||||
extern int g_numPalettes;
|
||||
extern int g_scriptDebug;
|
||||
|
||||
#define MAXCHEATLEN 20
|
||||
#define NUMCHEATCODES (signed int)(sizeof(cheatstrings)/sizeof(cheatstrings[0]))
|
||||
#define NUMCHEATCODES (signed int)(sizeof(CheatStrings)/sizeof(CheatStrings[0]))
|
||||
|
||||
extern char cheatkey[2];
|
||||
extern char cheatstrings[][MAXCHEATLEN];
|
||||
extern char CheatKeys[2];
|
||||
extern char CheatStrings[][MAXCHEATLEN];
|
||||
|
||||
extern short weapon_sprites[MAX_WEAPONS];
|
||||
extern short WeaponPickupSprites[MAX_WEAPONS];
|
||||
|
||||
extern int redefined_quote_count;
|
||||
extern int g_numQuoteRedefinitions;
|
||||
|
||||
extern char setupfilename[BMAX_PATH];
|
||||
|
||||
|
@ -1023,26 +998,26 @@ typedef struct {
|
|||
short headspritestat[MAXSTATUS+1];
|
||||
short prevspritestat[MAXSPRITES];
|
||||
short nextspritestat[MAXSPRITES];
|
||||
short numcyclers;
|
||||
short g_numCyclers;
|
||||
short cyclers[MAXCYCLERS][6];
|
||||
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
|
||||
short numanimwalls;
|
||||
short spriteq[1024],spriteqloc;
|
||||
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
||||
short g_numAnimWalls;
|
||||
short SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
|
||||
animwalltype animwall[MAXANIMWALLS];
|
||||
int msx[2048], msy[2048];
|
||||
short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
||||
short g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
||||
char show2dsector[(MAXSECTORS+7)>>3];
|
||||
short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
actordata_t hittype[MAXSPRITES];
|
||||
short g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
||||
actordata_t ActorExtra[MAXSPRITES];
|
||||
short pskyoff[MAXPSKYTILES], pskybits;
|
||||
|
||||
int animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
|
||||
int animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
||||
short animatesect[MAXANIMATES];
|
||||
int animateptr[MAXANIMATES];
|
||||
char numplayersprites;
|
||||
char earthquaketime;
|
||||
char g_numPlayerSprites;
|
||||
char g_earthquakeTime;
|
||||
int lockclock;
|
||||
int randomseed, global_random;
|
||||
int randomseed, g_globalRandom;
|
||||
char scriptptrs[MAXSPRITES];
|
||||
intptr_t *vars[MAXGAMEVARS];
|
||||
} mapstate_t;
|
||||
|
@ -1053,10 +1028,10 @@ typedef struct {
|
|||
mapstate_t *savedstate;
|
||||
} map_t;
|
||||
|
||||
extern map_t map[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
||||
extern map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
||||
|
||||
typedef struct {
|
||||
player_struct *ps;
|
||||
DukePlayer_t *ps;
|
||||
input_t *sync;
|
||||
|
||||
int32 movefifoend, syncvalhead, myminlag;
|
||||
|
@ -1068,7 +1043,7 @@ typedef struct {
|
|||
} playerdata_t;
|
||||
|
||||
extern input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
||||
extern playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
|
||||
extern PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
||||
extern playerdata_t g_player[MAXPLAYERS];
|
||||
#include "funct.h"
|
||||
|
||||
|
@ -1089,6 +1064,37 @@ extern struct HASH_table arrayH;
|
|||
extern struct HASH_table keywH;
|
||||
extern struct HASH_table gamefuncH;
|
||||
|
||||
enum DukePacket_t
|
||||
{
|
||||
PACKET_TYPE_MASTER_TO_SLAVE,
|
||||
PACKET_TYPE_SLAVE_TO_MASTER,
|
||||
PACKET_TYPE_BROADCAST,
|
||||
SERVER_GENERATED_BROADCAST,
|
||||
PACKET_TYPE_VERSION,
|
||||
|
||||
/* don't change anything above this line */
|
||||
|
||||
PACKET_TYPE_MESSAGE,
|
||||
|
||||
PACKET_TYPE_NEW_GAME,
|
||||
PACKET_TYPE_RTS,
|
||||
PACKET_TYPE_MENU_LEVEL_QUIT,
|
||||
PACKET_TYPE_WEAPON_CHOICE,
|
||||
PACKET_TYPE_PLAYER_OPTIONS,
|
||||
PACKET_TYPE_PLAYER_NAME,
|
||||
|
||||
PACKET_TYPE_USER_MAP,
|
||||
|
||||
PACKET_TYPE_MAP_VOTE,
|
||||
PACKET_TYPE_MAP_VOTE_INITIATE,
|
||||
PACKET_TYPE_MAP_VOTE_CANCEL,
|
||||
|
||||
PACKET_TYPE_LOAD_GAME,
|
||||
PACKET_TYPE_NULL_PACKET,
|
||||
PACKET_TYPE_PLAYER_READY,
|
||||
PACKET_TYPE_QUIT = 255 // should match mmulti I think
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -26,50 +26,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define __funct_h__
|
||||
|
||||
extern void sendscore(const char *s);
|
||||
extern void SoundStartup(void);
|
||||
extern void SoundShutdown(void);
|
||||
extern void MusicStartup(void);
|
||||
extern void MusicShutdown(void);
|
||||
extern void intomenusounds(void);
|
||||
extern int playmusic(const char *fn, const int sel);
|
||||
extern int loadsound(unsigned num);
|
||||
extern int xyzsound(int num,int i,int x,int y,int z);
|
||||
extern void sound(int num);
|
||||
extern int spritesound(unsigned int num,int i);
|
||||
extern void stopsound(int num);
|
||||
extern void stopenvsound(int num,int i);
|
||||
extern void S_SoundStartup(void);
|
||||
extern void S_SoundShutdown(void);
|
||||
extern void S_MusicStartup(void);
|
||||
extern void S_MusicShutdown(void);
|
||||
extern void S_MenuSound(void);
|
||||
extern int S_PlayMusic(const char *fn, const int sel);
|
||||
extern int S_LoadSound(unsigned num);
|
||||
extern int S_PlaySoundXYZ(int num,int i,int x,int y,int z);
|
||||
extern void S_PlaySound(int num);
|
||||
extern int A_PlaySound(unsigned int num,int i);
|
||||
extern void S_StopSound(int num);
|
||||
extern void S_StopEnvSound(int num,int i);
|
||||
extern void pan3dsound(void);
|
||||
extern void testcallback(unsigned int num);
|
||||
extern void clearsoundlocks(void);
|
||||
extern int callsound(int sn,int whatsprite);
|
||||
extern void S_TestSoundCallback(unsigned int num);
|
||||
extern void S_ClearSoundLocks(void);
|
||||
extern int A_CallSound(int sn,int whatsprite);
|
||||
extern int check_activator_motion(int lotag);
|
||||
extern int isadoorwall(int dapic);
|
||||
extern int CheckDoorTile(int dapic);
|
||||
extern int isanunderoperator(int lotag);
|
||||
extern int isanearoperator(int lotag);
|
||||
extern inline int checkcursectnums(int sect);
|
||||
extern inline int CheckPlayerInSector(int sect);
|
||||
extern int ldist(spritetype *s1,spritetype *s2);
|
||||
extern int dist(spritetype *s1,spritetype *s2);
|
||||
extern int findplayer(spritetype *s,int *d);
|
||||
extern int findotherplayer(int p,int *d);
|
||||
extern void doanimations(void);
|
||||
extern int getanimationgoal(int *animptr);
|
||||
extern int setanimation(int animsect,int *animptr,int thegoal,int thevel);
|
||||
extern void animatecamsprite(void);
|
||||
extern void animatewalls(void);
|
||||
extern int activatewarpelevators(int s,int d);
|
||||
extern void operatesectors(int sn,int ii);
|
||||
extern void operaterespawns(int low);
|
||||
extern void operateactivators(int low,int snum);
|
||||
extern void operatemasterswitches(int low);
|
||||
extern void operateforcefields(int s,int low);
|
||||
extern int checkhitswitch(int snum,int w,int switchtype);
|
||||
extern int A_FindPlayer(spritetype *s,int *d);
|
||||
extern int P_FindOtherPlayer(int p,int *d);
|
||||
extern void G_DoSectorAnimations(void);
|
||||
extern int GetAnimationGoal(int *animptr);
|
||||
extern int SetAnimation(int animsect,int *animptr,int thegoal,int thevel);
|
||||
extern void G_AnimateCamSprite(void);
|
||||
extern void G_AnimateWalls(void);
|
||||
extern int G_ActivateWarpElevators(int s,int d);
|
||||
extern void G_OperateSectors(int sn,int ii);
|
||||
extern void G_OperateRespawns(int low);
|
||||
extern void G_OperateActivators(int low,int snum);
|
||||
extern void G_OperateMasterSwitches(int low);
|
||||
extern void G_OperateForceFields(int s,int low);
|
||||
extern int P_ActivateSwitch(int snum,int w,int switchtype);
|
||||
extern void activatebysector(int sect,int j);
|
||||
extern void checkhitwall(int spr,int dawallnum,int x,int y,int z,int atwith);
|
||||
extern void checkplayerhurt(player_struct *p,int j);
|
||||
extern int checkhitceiling(int sn);
|
||||
extern void checkhitsprite(int i,int sn);
|
||||
extern void A_DamageWall(int spr,int dawallnum,int x,int y,int z,int atwith);
|
||||
extern void P_CheckTouchDamage(DukePlayer_t *p,int j);
|
||||
extern int Sect_DamageCeiling(int sn);
|
||||
extern void A_DamageObject(int i,int sn);
|
||||
extern void allignwarpelevators(void);
|
||||
extern void sharedkeys(int snum);
|
||||
extern void G_HandleSharedKeys(int snum);
|
||||
extern void checksectors(int snum);
|
||||
extern int32 RTS_AddFile(const char *filename);
|
||||
extern void RTS_Init(const char *filename);
|
||||
|
@ -78,76 +78,75 @@ extern int32 RTS_SoundLength(int32 lump);
|
|||
extern const char *RTS_GetSoundName(int32 i);
|
||||
extern void RTS_ReadLump(int32 lump,void *dest);
|
||||
extern void *RTS_GetSound(int32 lump);
|
||||
extern void docacheit(void);
|
||||
extern void G_CacheMapData(void);
|
||||
extern void xyzmirror(int i,int wn);
|
||||
extern void vscrn(void);
|
||||
extern void pickrandomspot(int snum);
|
||||
extern void resetweapons(int snum);
|
||||
extern void resetinventory(int snum);
|
||||
extern void newgame(int vn,int ln,int sk);
|
||||
extern void resettimevars(void);
|
||||
extern void G_UpdateScreenArea(void);
|
||||
extern void P_RandomSpawnPoint(int snum);
|
||||
extern void P_ResetWeapons(int snum);
|
||||
extern void P_ResetInventory(int snum);
|
||||
extern void G_NewGame(int vn,int ln,int sk);
|
||||
extern void G_ResetTimers(void);
|
||||
extern void waitforeverybody(void);
|
||||
extern void cacheit(void);
|
||||
extern void clearfifo(void);
|
||||
extern void resetmys(void);
|
||||
extern int enterlevel(int g);
|
||||
extern void backtomenu(void);
|
||||
extern void setpal(player_struct *p);
|
||||
extern void quickkill(player_struct *p);
|
||||
extern int hits(int i);
|
||||
extern int hitasprite(int i,short *hitsp);
|
||||
extern int shoot(int i,int atwith);
|
||||
extern void displaymasks(int snum);
|
||||
extern void displayweapon(int snum);
|
||||
extern void Net_ResetPrediction(void);
|
||||
extern int G_EnterLevel(int g);
|
||||
extern void G_BackToMenu(void);
|
||||
extern void P_UpdateScreenPal(DukePlayer_t *p);
|
||||
extern void P_QuickKill(DukePlayer_t *p);
|
||||
extern int A_GetHitscanRange(int i);
|
||||
extern int A_CheckHitSprite(int i,short *hitsp);
|
||||
extern int A_Shoot(int i,int atwith);
|
||||
extern void P_DisplayScubaMask(int snum);
|
||||
extern void P_DisplayWeapons(int snum);
|
||||
extern void getinput(int snum);
|
||||
extern void checkweapons(player_struct *p);
|
||||
extern void processinput(int snum);
|
||||
extern void cmenu(int cm);
|
||||
extern void savetemp(const char *fn,int daptr,int dasiz);
|
||||
// extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
|
||||
extern int loadplayer(int spot);
|
||||
extern int saveplayer(int spot);
|
||||
extern void P_DropWeapon(DukePlayer_t *p);
|
||||
extern void P_ProcessInput(int snum);
|
||||
extern void ChangeToMenu(int cm);
|
||||
// extern void savetemp(const char *fn,int daptr,int dasiz);
|
||||
// extern int G_LoadSaveHeader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
|
||||
extern int G_LoadPlayer(int spot);
|
||||
extern int G_SavePlayer(int spot);
|
||||
extern int menutext_(int x,int y,int s,int p,char *t,int bits);
|
||||
#define menutext(x,y,s,p,t) menutext_(x,y,s,p,(char *)stripcolorcodes(menutextbuf,t),10+16)
|
||||
extern void menus(void);
|
||||
extern void palto(int r,int g,int b,int e);
|
||||
extern void playanm(const char *fn,char);
|
||||
extern int getincangle(int a,int na);
|
||||
extern void getglobalz(int iActor);
|
||||
extern void makeitfall(int iActor);
|
||||
extern void loadefs(const char *fn);
|
||||
extern int furthestangle(int iActor,int angs);
|
||||
extern void execute(int iActor,int iPlayer,int lDist);
|
||||
extern void M_DisplayMenus(void);
|
||||
extern void G_FadePalette(int r,int g,int b,int e);
|
||||
extern void G_PlayAnim(const char *fn,char);
|
||||
extern int G_GetAngleDelta(int a,int na);
|
||||
extern void A_GetZLimits(int iActor);
|
||||
extern void A_Fall(int iActor);
|
||||
extern void C_Compile(const char *fn);
|
||||
extern int A_GetFurthestAngle(int iActor,int angs);
|
||||
extern void A_Execute(int iActor,int iPlayer,int lDist);
|
||||
extern void overwritesprite(int thex,int they,int tilenum,int shade,int stat,int dapalnum);
|
||||
extern void gamenumber(int x,int y,int n,int s);
|
||||
extern void Shutdown(void);
|
||||
extern void G_Shutdown(void);
|
||||
extern void getpackets(void);
|
||||
extern void check_fta_sounds(int i);
|
||||
extern inline int inventory(spritetype *s);
|
||||
extern inline int badguy(spritetype *s);
|
||||
extern int badguypic(int pn);
|
||||
extern void myos(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void myospal(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void displayfragbar(void);
|
||||
extern void FTA(int q,player_struct *p);
|
||||
extern void gameexit(const char *t);
|
||||
extern inline int strget(int x,int y,char *t,int dalen,int c);
|
||||
extern void displayrest(int smoothratio);
|
||||
extern void A_PlayAlertSound(int i);
|
||||
extern inline int A_CheckInventorySprite(spritetype *s);
|
||||
extern inline int A_CheckEnemySprite(spritetype *s);
|
||||
extern int A_CheckEnemyTile(int pn);
|
||||
extern void G_DrawTile(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void G_DrawTilePal(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void G_DrawFrags(void);
|
||||
extern void P_DoQuote(int q,DukePlayer_t *p);
|
||||
extern void G_GameExit(const char *t);
|
||||
extern inline int G_EnterText(int x,int y,char *t,int dalen,int c);
|
||||
extern void G_DisplayRest(int smoothratio);
|
||||
extern void updatesectorz(int x,int y,int z,short *sectnum);
|
||||
extern void drawbackground(void);
|
||||
extern void displayrooms(int snum,int smoothratio);
|
||||
extern int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr,int s_a,int s_ve,int s_zv,int s_ow,int s_ss);
|
||||
extern int wallswitchcheck(int i);
|
||||
extern int spawn(int j,int pn);
|
||||
extern void animatesprites(int x,int y,int a,int smoothratio);
|
||||
extern void G_DrawBackground(void);
|
||||
extern void G_DrawRooms(int snum,int smoothratio);
|
||||
extern int A_InsertSprite(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr,int s_a,int s_ve,int s_zv,int s_ow,int s_ss);
|
||||
extern int A_CheckSwitchTile(int i);
|
||||
extern int A_Spawn(int j,int pn);
|
||||
extern void G_DoSpriteAnimations(int x,int y,int a,int smoothratio);
|
||||
extern int main(int argc,char **argv);
|
||||
extern void opendemowrite(void);
|
||||
extern void closedemowrite(void);
|
||||
extern void dobonus(int bonusonly);
|
||||
extern void lotsofglass(int i,int wallnum,int n);
|
||||
extern void spriteglass(int i,int n);
|
||||
extern void ceilingglass(int i,int sectnum,int n);
|
||||
extern void lotsofcolourglass(int i,int wallnum,int n);
|
||||
extern void G_OpenDemoWrite(void);
|
||||
extern void G_CloseDemoWrite(void);
|
||||
extern void G_BonusScreen(int bonusonly);
|
||||
extern void A_SpawnWallGlass(int i,int wallnum,int n);
|
||||
extern void A_SpawnGlass(int i,int n);
|
||||
extern void A_SpawnCeilingGlass(int i,int sectnum,int n);
|
||||
extern void A_SpawnRandomGlass(int i,int wallnum,int n);
|
||||
extern inline int GetTime(void);
|
||||
extern void CONFIG_GetSetupFilename(void);
|
||||
extern int32 CONFIG_FunctionNameToNum(char *func);
|
||||
|
@ -156,46 +155,46 @@ extern int32 CONFIG_AnalogNameToNum(char *func);
|
|||
extern char *CONFIG_AnalogNumToName(int32 func);
|
||||
extern void CONFIG_SetDefaults(void);
|
||||
extern void CONFIG_ReadKeys(void);
|
||||
extern void readsavenames(void);
|
||||
extern void ReadSaveGameHeaders(void);
|
||||
extern int32 CONFIG_ReadSetup(void);
|
||||
extern void CONFIG_WriteSetup(void);
|
||||
extern inline void updateinterpolations(void);
|
||||
extern void setinterpolation(int *posptr);
|
||||
extern void stopinterpolation(int *posptr);
|
||||
extern void dointerpolations(int smoothratio);
|
||||
extern inline void restoreinterpolations(void);
|
||||
extern inline int ceilingspace(int sectnum);
|
||||
extern inline int floorspace(int sectnum);
|
||||
extern void addammo(int weapon,player_struct *p,int amount);
|
||||
extern void addweaponnoswitch(player_struct *p,int weapon);
|
||||
extern void addweapon(player_struct *p,int weapon);
|
||||
extern void checkavailinven(player_struct *p);
|
||||
extern void checkavailweapon(player_struct *p);
|
||||
extern void hitradius(int i,int r,int hp1,int hp2,int hp3,int hp4);
|
||||
extern int movesprite(int spritenum,int xchange,int ychange,int zchange,unsigned int cliptype);
|
||||
extern inline int ssp(int i,unsigned int cliptype);
|
||||
extern void insertspriteq(int i);
|
||||
extern void lotsofmoneymailpaper(int sp,int n,int pic);
|
||||
extern void guts(int sp,int gtype,int n);
|
||||
extern void setsectinterpolate(int i);
|
||||
extern void clearsectinterpolate(int i);
|
||||
extern int ifhitbyweapon(int sn);
|
||||
extern void moveobjects(void);
|
||||
extern void movecyclers(void);
|
||||
extern void movedummyplayers(void);
|
||||
extern inline void G_UpdateInterpolations(void);
|
||||
extern void G_SetInterpolation(int *posptr);
|
||||
extern void G_StopInterpolation(int *posptr);
|
||||
extern void G_DoInterpolations(int smoothratio);
|
||||
extern inline void G_RestoreInterpolations(void);
|
||||
extern inline int G_CheckForSpaceCeiling(int sectnum);
|
||||
extern inline int G_CheckForSpaceFloor(int sectnum);
|
||||
extern void P_AddAmmo(int weapon,DukePlayer_t *p,int amount);
|
||||
extern void P_AddWeaponNoSwitch(DukePlayer_t *p,int weapon);
|
||||
extern void P_AddWeapon(DukePlayer_t *p,int weapon);
|
||||
extern void P_SelectNextInventoryItem(DukePlayer_t *p);
|
||||
extern void P_CheckWeapon(DukePlayer_t *p);
|
||||
extern void A_RadiusDamage(int i,int r,int hp1,int hp2,int hp3,int hp4);
|
||||
extern int A_MoveSprite(int spritenum,int xchange,int ychange,int zchange,unsigned int cliptype);
|
||||
extern inline int A_SetSprite(int i,unsigned int cliptype);
|
||||
extern void A_AddToDeleteQueue(int i);
|
||||
extern void A_SpawnMultiple(int sp,int pic,int n);
|
||||
extern void A_DoGuts(int sp,int gtype,int n);
|
||||
extern void Sect_SetInterpolation(int i);
|
||||
extern void Sect_ClearInterpolation(int i);
|
||||
extern int A_IncurDamage(int sn);
|
||||
extern void G_MoveWorld(void);
|
||||
extern void A_MoveCyclers(void);
|
||||
extern void A_MoveDummyPlayers(void);
|
||||
|
||||
// game.c
|
||||
extern inline void setstatusbarscale(int sc);
|
||||
extern inline void G_SetStatusBarScale(int sc);
|
||||
|
||||
extern void setgamepalette(player_struct *player, char *pal, int set);
|
||||
extern void SetGamePalette(DukePlayer_t *player, char *pal, int set);
|
||||
extern void fadepal(int r, int g, int b, int start, int end, int step);
|
||||
|
||||
extern inline int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,int orientation,int x1, int y1, int x2, int y2,int z);
|
||||
extern void txdigitalnumberz(int starttile, int x,int y,int n,int s,int pal,int cs,int x1, int y1, int x2, int y2, int z);
|
||||
extern void myosx(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void myospalx(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void ResetGameVars(void);
|
||||
extern void ResetActorGameVars(int iActor);
|
||||
extern void G_DrawTXDigiNumZ(int starttile, int x,int y,int n,int s,int pal,int cs,int x1, int y1, int x2, int y2, int z);
|
||||
extern void G_DrawTileSmall(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void G_DrawTilePalSmall(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void Gv_ResetVarsToDefault(void);
|
||||
extern void A_ResetGameVars(int iActor);
|
||||
|
||||
extern int minitext_(int x,int y,const char *t,int s,int p,int sb);
|
||||
|
||||
|
@ -207,54 +206,55 @@ extern int minitext_(int x,int y,const char *t,int s,int p,int sb);
|
|||
#define gametextpal(x,y,t,s,p) gametext_z(0,STARTALPHANUM, x,y,t,s,p,26,0, 0, xdim-1, ydim-1, 65536)
|
||||
#define gametextpalbits(x,y,t,s,p,dabits) gametext_z(0,STARTALPHANUM, x,y,t,s,p,dabits,0, 0, xdim-1, ydim-1, 65536)
|
||||
|
||||
extern void setupdynamictostatic();
|
||||
extern void processnames(const char *szLabel, int lValue);
|
||||
extern void G_InitDynamicTiles();
|
||||
extern void G_ProcessDynamicTileMapping(const char *szLabel, int lValue);
|
||||
|
||||
extern void LoadActor(int sActor);
|
||||
extern void A_LoadActor(int sActor);
|
||||
|
||||
extern int GetGameVar(const char *szGameLabel, int lDefault, int iActor, int iPlayer);
|
||||
extern void DumpGameVars(FILE *fp);
|
||||
extern int Gv_GetVarByLabel(const char *szGameLabel, int lDefault, int iActor, int iPlayer);
|
||||
extern void Gv_DumpValues(FILE *fp);
|
||||
// extern void AddLog(const char *psz, ...);
|
||||
|
||||
extern void ResetSystemDefaults(void);
|
||||
extern void InitGameVarPointers(void);
|
||||
extern void InitGameVars(void);
|
||||
extern void SaveGameVars(FILE *fil);
|
||||
extern int ReadGameVars(int fil);
|
||||
extern void Gv_ResetSystemDefaults(void);
|
||||
extern void Gv_InitWeaponPointers(void);
|
||||
extern void Gv_Init(void);
|
||||
extern void Gv_WriteSave(FILE *fil);
|
||||
extern int Gv_ReadSave(int fil);
|
||||
|
||||
extern int GetGameVarID(int id, int iActor, int iPlayer);
|
||||
extern void SetGameVarID(int id, int lValue, int iActor, int iPlayer);
|
||||
extern int Gv_GetVar(int id, int iActor, int iPlayer);
|
||||
extern void Gv_SetVar(int id, int lValue, int iActor, int iPlayer);
|
||||
// extern void SetGameArrayID(int id,int index, int lValue);
|
||||
|
||||
extern int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags);
|
||||
extern int AddGameArray(const char *pszLabel, int asize);
|
||||
extern void ReportError(int iError);
|
||||
extern int Gv_SetupVar(const char *pszLabel, int lValue, unsigned int dwFlags);
|
||||
extern int Gv_AddArray(const char *pszLabel, int asize);
|
||||
extern void C_ReportError(int iError);
|
||||
|
||||
extern void onvideomodechange(int newmode);
|
||||
|
||||
extern void OnEvent(int iEventID, int sActor, int sPlayer, int lDist);
|
||||
extern void X_OnEvent(int iEventID, int sActor, int sPlayer, int lDist);
|
||||
|
||||
extern int isspritemakingsound(int i, int num);
|
||||
extern int issoundplaying(int i, int num);
|
||||
extern void stopspritesound(int num, int i);
|
||||
extern void updateplayer(void);
|
||||
extern void sendboardname(void);
|
||||
extern void sendquit(void);
|
||||
extern int A_CheckSoundPlaying(int i, int num);
|
||||
extern int S_CheckSoundPlaying(int i, int num);
|
||||
extern void A_StopSound(int num, int i);
|
||||
extern void G_UpdatePlayerFromMenu(void);
|
||||
extern void Net_SendPlayerName(void);
|
||||
extern void Net_SendUserMapName(void);
|
||||
extern void Net_SendQuit(void);
|
||||
|
||||
extern void adduserquote(const char *daquote);
|
||||
extern void mpchangemap(int volume, int level);
|
||||
extern void G_AddUserQuote(const char *daquote);
|
||||
extern void Net_NewGame(int volume, int level);
|
||||
|
||||
extern inline int checkspriteflags(int iActor, int iType);
|
||||
extern inline int checkspriteflagsp(int iPicnum, int iType);
|
||||
extern inline int A_CheckSpriteFlags(int iActor, int iType);
|
||||
extern inline int A_CheckSpriteTileFlags(int iPicnum, int iType);
|
||||
|
||||
extern int getteampal(int team);
|
||||
extern int G_GetTeamPalette(int team);
|
||||
|
||||
extern void se40code(int x,int y,int z,int a,int h, int smoothratio);
|
||||
|
||||
extern void FreeMapState(int mapnum);
|
||||
extern void getlevelfromfilename(const char *fn, char *volume, char *level);
|
||||
extern void G_FreeMapState(int mapnum);
|
||||
extern void G_FindLevelForFilename(const char *fn, char *volume, char *level);
|
||||
|
||||
extern void GetCrosshairColor(void);
|
||||
extern void SetCrosshairColor(int r, int g, int b);
|
||||
extern void G_GetCrosshairColor(void);
|
||||
extern void G_SetCrosshairColor(int r, int g, int b);
|
||||
extern int kopen4loadfrommod(char *filename, char searchfirst);
|
||||
#endif // __funct_h__
|
||||
|
|
|
@ -36,14 +36,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NUMKEYENTRIES 53
|
||||
#define NUMGAMEFUNCTIONS 53
|
||||
#define NUMKEYENTRIES 54
|
||||
#define NUMGAMEFUNCTIONS 54
|
||||
#define MAXGAMEFUNCLEN 32
|
||||
|
||||
extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
|
||||
extern char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN];
|
||||
|
||||
enum gamefuncs
|
||||
enum GameFunction_t
|
||||
{
|
||||
gamefunc_Move_Forward,
|
||||
gamefunc_Move_Backward,
|
||||
|
@ -97,7 +97,8 @@ enum gamefuncs
|
|||
gamefunc_Quick_Kick,
|
||||
gamefunc_Next_Weapon,
|
||||
gamefunc_Previous_Weapon,
|
||||
gamefunc_Show_Console
|
||||
gamefunc_Show_Console,
|
||||
gamefunc_Show_DukeMatch_Scores
|
||||
};
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -51,10 +51,10 @@ extern int g_gs;
|
|||
extern int g_kb;
|
||||
extern int g_looking_angSR1;
|
||||
extern int lastvisinc;
|
||||
extern char cheatstrings[][MAXCHEATLEN];
|
||||
extern char compilefile[BMAX_PATH];
|
||||
extern int total_lines,line_number;
|
||||
extern int error,warning;
|
||||
extern char CheatStrings[][MAXCHEATLEN];
|
||||
extern char g_szScriptFileName[BMAX_PATH];
|
||||
extern int g_totalLines,g_lineNumber;
|
||||
extern int g_numCompilerErrors,g_numCompilerWarnings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -64,36 +64,36 @@ typedef struct
|
|||
int maxParm2;
|
||||
} memberlabel_t;
|
||||
|
||||
extern const memberlabel_t sectorlabels[];
|
||||
extern const memberlabel_t walllabels[];
|
||||
extern const memberlabel_t actorlabels[];
|
||||
extern const memberlabel_t playerlabels[];
|
||||
extern const memberlabel_t projectilelabels[];
|
||||
extern const memberlabel_t SectorLabels[];
|
||||
extern const memberlabel_t WallLabels[];
|
||||
extern const memberlabel_t ActorLabels[];
|
||||
extern const memberlabel_t PlayerLabels[];
|
||||
extern const memberlabel_t ProjectileLabels[];
|
||||
extern const memberlabel_t userdeflabels[];
|
||||
extern const memberlabel_t inputlabels[];
|
||||
extern const memberlabel_t tsprlabels[];
|
||||
extern const memberlabel_t InputLabels[];
|
||||
extern const memberlabel_t TsprLabels[];
|
||||
|
||||
extern void DoUserDef(int iSet, int lLabelID, int lVar2);
|
||||
extern void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2);
|
||||
extern void DoInput(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void DoWall(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void DoSector(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2);
|
||||
extern void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessUserdef(int iSet, int lLabelID, int lVar2);
|
||||
extern void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2);
|
||||
extern void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2);
|
||||
extern void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
extern void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2);
|
||||
|
||||
#define CON_ERROR OSD_ERROR "Line %d, %s: "
|
||||
|
||||
extern int g_i,g_p;
|
||||
extern int checkCON;
|
||||
extern int g_scriptSanityChecks;
|
||||
|
||||
extern int line_num;
|
||||
extern int g_errorLineNum;
|
||||
extern int g_tw;
|
||||
extern const char *keyw[];
|
||||
extern spritetype *g_sp;
|
||||
|
||||
enum errors
|
||||
enum ScriptError_t
|
||||
{
|
||||
ERROR_CLOSEBRACKET,
|
||||
ERROR_EVENTONLY,
|
||||
|
@ -123,7 +123,7 @@ enum errors
|
|||
WARNING_REVEVENTSYNC
|
||||
};
|
||||
|
||||
enum playerlabels
|
||||
enum PlayerLabel_t
|
||||
{
|
||||
PLAYER_ZOOM,
|
||||
PLAYER_EXITX,
|
||||
|
@ -274,7 +274,7 @@ enum playerlabels
|
|||
PLAYER_END
|
||||
};
|
||||
|
||||
enum userdefslabels
|
||||
enum UserdefsLabel_t
|
||||
{
|
||||
USERDEFS_GOD,
|
||||
USERDEFS_WARP_ON,
|
||||
|
@ -374,7 +374,7 @@ enum userdefslabels
|
|||
USERDEFS_END
|
||||
};
|
||||
|
||||
enum sectorlabels
|
||||
enum SectorLabel_t
|
||||
{
|
||||
SECTOR_WALLPTR,
|
||||
SECTOR_WALLNUM,
|
||||
|
@ -402,7 +402,7 @@ enum sectorlabels
|
|||
SECTOR_END
|
||||
};
|
||||
|
||||
enum walllabels
|
||||
enum WallLabel_t
|
||||
{
|
||||
WALL_X,
|
||||
WALL_Y,
|
||||
|
@ -424,7 +424,7 @@ enum walllabels
|
|||
WALL_END
|
||||
};
|
||||
|
||||
enum actorlabels
|
||||
enum ActorLabel_t
|
||||
{
|
||||
ACTOR_X,
|
||||
ACTOR_Y,
|
||||
|
@ -480,7 +480,7 @@ enum actorlabels
|
|||
ACTOR_END
|
||||
};
|
||||
|
||||
enum inputlabels
|
||||
enum InputLabel_t
|
||||
{
|
||||
INPUT_AVEL,
|
||||
INPUT_HORZ,
|
||||
|
@ -491,7 +491,7 @@ enum inputlabels
|
|||
INPUT_END
|
||||
};
|
||||
|
||||
enum projectilelabels
|
||||
enum ProjectileLabel_t
|
||||
{
|
||||
PROJ_WORKSLIKE,
|
||||
PROJ_SPAWNS,
|
||||
|
@ -524,7 +524,7 @@ enum projectilelabels
|
|||
PROJ_END
|
||||
};
|
||||
|
||||
enum keywords
|
||||
enum ScriptKeywords_t
|
||||
{
|
||||
CON_DEFINELEVELNAME, // 0
|
||||
CON_ACTOR, // 1
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -27,63 +27,61 @@ char *s_builddate = "20081116";
|
|||
char *MusicPtr = NULL;
|
||||
int Musicsize;
|
||||
|
||||
short global_random;
|
||||
short g_globalRandom;
|
||||
short neartagsector, neartagwall, neartagsprite;
|
||||
|
||||
int neartaghitdist,lockclock,start_armour_amount;
|
||||
// JBF: gc modified to default to Atomic ed. default when using 1.3d CONs
|
||||
int gc=176;
|
||||
int neartaghitdist,lockclock,g_startArmorAmount;
|
||||
// JBF: SpriteGravity modified to default to Atomic ed. default when using 1.3d CONs
|
||||
int SpriteGravity=176;
|
||||
|
||||
// int temp_data[MAXSPRITES][6];
|
||||
actordata_t hittype[MAXSPRITES];
|
||||
actordata_t ActorExtra[MAXSPRITES];
|
||||
|
||||
short spriteq[1024],spriteqloc,spriteqamount=64;
|
||||
short SpriteDeletionQueue[1024],g_spriteDeleteQueuePos,g_spriteDeleteQueueSize=64;
|
||||
animwalltype animwall[MAXANIMWALLS];
|
||||
short numanimwalls;
|
||||
short g_numAnimWalls;
|
||||
int *animateptr[MAXANIMATES];
|
||||
int animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
|
||||
int animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
||||
// int oanimateval[MAXANIMATES];
|
||||
short animatesect[MAXANIMATES];
|
||||
int msx[2048],msy[2048];
|
||||
short cyclers[MAXCYCLERS][6],numcyclers;
|
||||
short cyclers[MAXCYCLERS][6],g_numCyclers;
|
||||
|
||||
char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
|
||||
char *ScriptQuotes[MAXQUOTES], *ScriptQuoteRedefinitions[MAXQUOTES];
|
||||
|
||||
char tempbuf[2048], packbuf[576], menutextbuf[128];
|
||||
|
||||
char buf[1024];
|
||||
|
||||
short camsprite;
|
||||
short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
||||
short g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
||||
|
||||
int current_menu;
|
||||
int g_currentMenu;
|
||||
|
||||
map_t map[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
||||
map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
||||
|
||||
char volume_names[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
||||
char skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
||||
char EpisodeNames[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
||||
char SkillNames[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
||||
|
||||
char gametype_names[MAXGAMETYPES][33] = { "DUKEMATCH (SPAWN)","COOPERATIVE PLAY","DUKEMATCH (NO SPAWN)","TEAM DM (SPAWN)","TEAM DM (NO SPAWN)"};
|
||||
int gametype_flags[MAXGAMETYPES] = {4+8+16+1024+2048+16384,1+2+32+64+128+256+512+4096+8192+32768,2+4+8+16+16384,4+8+16+1024+2048+16384+65536+131072,2+4+8+16+16384+65536+131072};
|
||||
char num_gametypes = 5;
|
||||
char GametypeNames[MAXGAMETYPES][33] = { "DUKEMATCH (SPAWN)","COOPERATIVE PLAY","DUKEMATCH (NO SPAWN)","TEAM DM (SPAWN)","TEAM DM (NO SPAWN)"};
|
||||
int GametypeFlags[MAXGAMETYPES] = {4+8+16+1024+2048+16384,1+2+32+64+128+256+512+4096+8192+32768,2+4+8+16+16384,4+8+16+1024+2048+16384+65536+131072,2+4+8+16+16384+65536+131072};
|
||||
char g_numGametypes = 5;
|
||||
|
||||
short title_zoom;
|
||||
int g_currentFrameRate;
|
||||
|
||||
int framerate;
|
||||
char g_numVolumes = 3;
|
||||
|
||||
char num_volumes = 3;
|
||||
|
||||
short timer=120;
|
||||
short g_timerTicsPerSecond=120;
|
||||
//fx_device device;
|
||||
|
||||
sound_t g_sounds[ MAXSOUNDS ];
|
||||
|
||||
char numplayersprites,loadfromgrouponly=0,earthquaketime;
|
||||
char g_numPlayerSprites,g_loadFromGroupOnly=0,g_earthquakeTime;
|
||||
|
||||
int fricxv,fricyv;
|
||||
playerdata_t g_player[MAXPLAYERS];
|
||||
input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
||||
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
|
||||
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
||||
user_defs ud;
|
||||
|
||||
char pus, pub;
|
||||
|
@ -102,26 +100,25 @@ int screenpeek;
|
|||
//Game recording variables
|
||||
|
||||
char ready2send;
|
||||
int vel, svel, angvel, horiz, ototalclock, respawnactortime=768, respawnitemtime=768, groupfile;
|
||||
int vel, svel, angvel, horiz, ototalclock, g_actorRespawnTime=768, g_itemRespawnTime=768, g_groupFileHandle;
|
||||
|
||||
intptr_t *scriptptr,*insptr,*labelcode,*labeltype;
|
||||
int labelcnt,defaultlabelcnt;
|
||||
intptr_t *actorscrptr[MAXTILES],*parsing_actor;
|
||||
intptr_t *g_scriptPtr,*insptr,*labelcode,*labeltype;
|
||||
int g_numLabels,g_numDefaultLabels;
|
||||
intptr_t *actorscrptr[MAXTILES],*g_parsingActorPtr;
|
||||
char *label;
|
||||
char *music_pointer;
|
||||
char actortype[MAXTILES];
|
||||
char ActorType[MAXTILES];
|
||||
intptr_t *script = NULL;
|
||||
|
||||
int g_ScriptSize = 16384;
|
||||
int g_scriptSize = 16384;
|
||||
|
||||
char typebuflen,typebuf[141];
|
||||
|
||||
char *music_fn[MAXVOLUMES+1][MAXLEVELS],music_select;
|
||||
char env_music_fn[MAXVOLUMES+1][BMAX_PATH];
|
||||
char rtsplaying;
|
||||
char g_musicIndex;
|
||||
char EnvMusicFilename[MAXVOLUMES+1][BMAX_PATH];
|
||||
char g_RTSPlaying;
|
||||
|
||||
|
||||
short weaponsandammosprites[15] =
|
||||
short BlimpSpawnSprites[15] =
|
||||
{
|
||||
RPGSPRITE__STATIC,
|
||||
CHAINGUNSPRITE__STATIC,
|
||||
|
@ -140,8 +137,8 @@ short weaponsandammosprites[15] =
|
|||
FREEZEAMMO__STATIC
|
||||
};
|
||||
|
||||
int impact_damage;
|
||||
int g_ScriptDebug;
|
||||
int g_impactDamage;
|
||||
int g_scriptDebug;
|
||||
|
||||
//GLOBAL.C - replace the end "my's" with this
|
||||
int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
|
@ -151,35 +148,36 @@ short myang, omyang, mycursectnum, myjumpingcounter;
|
|||
char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
|
||||
signed char multiwho, multipos, multiwhat, multiflag;
|
||||
|
||||
int fakemovefifoplc,movefifoplc;
|
||||
int predictfifoplc,movefifoplc;
|
||||
int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
int myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
|
||||
int myhorizbak[MOVEFIFOSIZ],g_playerFriction = 0xcc00, g_showShareware;
|
||||
|
||||
short myangbak[MOVEFIFOSIZ];
|
||||
char myname[32];
|
||||
int camerashitable,freezerhurtowner=0,lasermode=0;
|
||||
int networkmode = 255, movesperpacket = 1,gamequit = 0,everyothertime;
|
||||
int numfreezebounces=3,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
char szPlayerName[32];
|
||||
int g_damageCameras,g_freezerSelfDamage=0,g_tripbombLaserMode=0;
|
||||
int g_networkBroadcastMode = 255, g_movesPerPacket = 1,g_gameQuit = 0,everyothertime;
|
||||
int g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius,
|
||||
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
||||
STATUSBARTYPE sbar;
|
||||
|
||||
int mymaxlag, otherminlag, bufferjitter = 1;
|
||||
short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
short g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
||||
int cloudtotalclock = 0,totalmemory = 0;
|
||||
int numinterpolations = 0, startofdynamicinterpolations = 0;
|
||||
int g_numInterpolations = 0, startofdynamicinterpolations = 0;
|
||||
int oldipos[MAXINTERPOLATIONS];
|
||||
int bakipos[MAXINTERPOLATIONS];
|
||||
int *curipos[MAXINTERPOLATIONS];
|
||||
|
||||
int nextvoxid = 0;
|
||||
|
||||
int spriteflags[MAXTILES];
|
||||
int SpriteFlags[MAXTILES];
|
||||
|
||||
projectile_t projectile[MAXTILES], thisprojectile[MAXSPRITES], defaultprojectile[MAXTILES];
|
||||
projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES];
|
||||
|
||||
char cheatkey[2] = { sc_D, sc_N };
|
||||
char CheatKeys[2] = { sc_D, sc_N };
|
||||
char setupfilename[BMAX_PATH]= "duke3d.cfg";
|
||||
// char datetimestring[] = ""__DATE__" "__TIME__"";
|
||||
|
||||
int doquicksave = 0;
|
||||
unsigned int MoveThingsCount = 0;
|
||||
int g_doQuickSave = 0;
|
||||
unsigned int g_moveThingsCount = 0;
|
||||
|
||||
|
|
|
@ -490,5 +490,5 @@ void MUSIC_RegisterTimbreBank
|
|||
void MUSIC_Update(void)
|
||||
{}
|
||||
|
||||
void PlayMusic(char *_filename, int loopflag)
|
||||
void MUSIC_PlayMusic(char *_filename, int loopflag)
|
||||
{}
|
||||
|
|
|
@ -2977,7 +2977,7 @@ int MV_Shutdown(void)
|
|||
// Stop the sound playback engine
|
||||
MV_StopPlayback();
|
||||
|
||||
// Shutdown the sound card
|
||||
// G_Shutdown the sound card
|
||||
#if defined(_WIN32)
|
||||
DSOUND_Shutdown();
|
||||
#else
|
||||
|
|
|
@ -158,9 +158,9 @@ int MUSIC_Init
|
|||
// no AL support so shitcan the ogg definitions
|
||||
for (i=(MAXLEVELS*(MAXVOLUMES+1))-1;i>=0;i--) // +1 volume for "intro", "briefing" music
|
||||
{
|
||||
if (map[i].musicfn1 != NULL)
|
||||
Bfree(map[i].musicfn1);
|
||||
map[i].musicfn1 = NULL;
|
||||
if (MapInfo[i].musicfn1 != NULL)
|
||||
Bfree(MapInfo[i].musicfn1);
|
||||
MapInfo[i].musicfn1 = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -304,7 +304,7 @@ int MUSIC_StopSong(void)
|
|||
} // MUSIC_StopSong
|
||||
|
||||
// Duke3D-specific. --ryan.
|
||||
void PlayMusic(char *_filename)
|
||||
void MUSIC_PlayMusic(char *_filename)
|
||||
{
|
||||
int handle;
|
||||
int size;
|
||||
|
|
|
@ -306,7 +306,7 @@ int32 SCRIPT_ParseBuffer(int32 scripthandle, char *data, int32 length)
|
|||
if (!(expect & ExpectingEntry))
|
||||
{
|
||||
// Unexpected name start
|
||||
printf("Unexpected entry label on line %d.\n", linenum);
|
||||
printf("Unexpected entry LabelText on line %d.\n", linenum);
|
||||
SETRV(-1);
|
||||
EATLINE(sp);
|
||||
continue;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1517,9 +1517,9 @@ int RESERVEDSLOT10 = 6141;
|
|||
int RESERVEDSLOT11 = 6142;
|
||||
int RESERVEDSLOT12 = 6143;
|
||||
|
||||
short dynamictostatic[MAXTILES];
|
||||
short DynamicTileMap[MAXTILES];
|
||||
|
||||
void processnames(const char *szLabel, int lValue)
|
||||
void G_ProcessDynamicTileMapping(const char *szLabel, int lValue)
|
||||
{
|
||||
int i;
|
||||
if (lValue >= MAXTILES || !szLabel)
|
||||
|
@ -1542,42 +1542,42 @@ void freehashnames()
|
|||
HASH_free(&dynnamesH);
|
||||
}
|
||||
|
||||
void setupdynamictostatic(void)
|
||||
void G_InitDynamicTiles(void)
|
||||
{
|
||||
int i = 0;
|
||||
clearbufbyte(dynamictostatic,MAXTILES,0);
|
||||
clearbufbyte(DynamicTileMap,MAXTILES,0);
|
||||
while (list[i].val)
|
||||
{
|
||||
dynamictostatic[list[i].val]=list[i].vstat;
|
||||
DynamicTileMap[list[i].val]=list[i].vstat;
|
||||
i++;
|
||||
}
|
||||
|
||||
weaponsandammosprites[0] = RPGSPRITE;
|
||||
weaponsandammosprites[1] = CHAINGUNSPRITE;
|
||||
weaponsandammosprites[2] = DEVISTATORAMMO;
|
||||
weaponsandammosprites[3] = RPGAMMO;
|
||||
weaponsandammosprites[4] = RPGAMMO;
|
||||
weaponsandammosprites[5] = JETPACK;
|
||||
weaponsandammosprites[6] = SHIELD;
|
||||
weaponsandammosprites[7] = FIRSTAID;
|
||||
weaponsandammosprites[8] = STEROIDS;
|
||||
weaponsandammosprites[9] = RPGAMMO;
|
||||
weaponsandammosprites[10] = RPGAMMO;
|
||||
weaponsandammosprites[11] = RPGSPRITE;
|
||||
weaponsandammosprites[12] = RPGAMMO;
|
||||
weaponsandammosprites[13] = FREEZESPRITE;
|
||||
weaponsandammosprites[14] = FREEZEAMMO;
|
||||
BlimpSpawnSprites[0] = RPGSPRITE;
|
||||
BlimpSpawnSprites[1] = CHAINGUNSPRITE;
|
||||
BlimpSpawnSprites[2] = DEVISTATORAMMO;
|
||||
BlimpSpawnSprites[3] = RPGAMMO;
|
||||
BlimpSpawnSprites[4] = RPGAMMO;
|
||||
BlimpSpawnSprites[5] = JETPACK;
|
||||
BlimpSpawnSprites[6] = SHIELD;
|
||||
BlimpSpawnSprites[7] = FIRSTAID;
|
||||
BlimpSpawnSprites[8] = STEROIDS;
|
||||
BlimpSpawnSprites[9] = RPGAMMO;
|
||||
BlimpSpawnSprites[10] = RPGAMMO;
|
||||
BlimpSpawnSprites[11] = RPGSPRITE;
|
||||
BlimpSpawnSprites[12] = RPGAMMO;
|
||||
BlimpSpawnSprites[13] = FREEZESPRITE;
|
||||
BlimpSpawnSprites[14] = FREEZEAMMO;
|
||||
|
||||
weapon_sprites[0] = KNEE;
|
||||
weapon_sprites[1] = FIRSTGUNSPRITE;
|
||||
weapon_sprites[2] = SHOTGUNSPRITE;
|
||||
weapon_sprites[3] = CHAINGUNSPRITE;
|
||||
weapon_sprites[4] = RPGSPRITE;
|
||||
weapon_sprites[5] = HEAVYHBOMB;
|
||||
weapon_sprites[6] = SHRINKERSPRITE;
|
||||
weapon_sprites[7] = DEVISTATORSPRITE;
|
||||
weapon_sprites[8] = TRIPBOMBSPRITE;
|
||||
weapon_sprites[9] = FREEZESPRITE;
|
||||
weapon_sprites[10] = HEAVYHBOMB;
|
||||
weapon_sprites[11] = SHRINKERSPRITE;
|
||||
WeaponPickupSprites[0] = KNEE;
|
||||
WeaponPickupSprites[1] = FIRSTGUNSPRITE;
|
||||
WeaponPickupSprites[2] = SHOTGUNSPRITE;
|
||||
WeaponPickupSprites[3] = CHAINGUNSPRITE;
|
||||
WeaponPickupSprites[4] = RPGSPRITE;
|
||||
WeaponPickupSprites[5] = HEAVYHBOMB;
|
||||
WeaponPickupSprites[6] = SHRINKERSPRITE;
|
||||
WeaponPickupSprites[7] = DEVISTATORSPRITE;
|
||||
WeaponPickupSprites[8] = TRIPBOMBSPRITE;
|
||||
WeaponPickupSprites[9] = FREEZESPRITE;
|
||||
WeaponPickupSprites[10] = HEAVYHBOMB;
|
||||
WeaponPickupSprites[11] = SHRINKERSPRITE;
|
||||
}
|
||||
|
|
|
@ -1496,4 +1496,4 @@ extern int RESERVEDSLOT11;
|
|||
#define RESERVEDSLOT11__STATIC 6142
|
||||
extern int RESERVEDSLOT12;
|
||||
#define RESERVEDSLOT12__STATIC 6143
|
||||
extern short dynamictostatic[MAXTILES];
|
||||
extern short DynamicTileMap[MAXTILES];
|
||||
|
|
|
@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
|
||||
extern int voting, doquicksave;
|
||||
extern int voting, g_doQuickSave;
|
||||
struct osdcmd_cheatsinfo osdcmd_cheatsinfo_stat;
|
||||
float r_ambientlight = 1.0, r_ambientlightrecip = 1.0;
|
||||
extern int althud_numbertile, althud_numberpal, althud_shadows, althud_flashing, hud_glowingquotes;
|
||||
|
@ -42,7 +42,7 @@ extern int r_maxfps;
|
|||
static inline int osdcmd_quit(const osdfuncparm_t *parm)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
sendquit();
|
||||
Net_SendQuit();
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -86,14 +86,14 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
|
||||
if (!VOLUMEONE)
|
||||
{
|
||||
if (volume > num_volumes)
|
||||
if (volume > g_numVolumes)
|
||||
{
|
||||
OSD_Printf("changelevel: invalid volume number (range 1-%d)\n",num_volumes);
|
||||
OSD_Printf("changelevel: invalid volume number (range 1-%d)\n",g_numVolumes);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if (level > MAXLEVELS || map[volume*MAXLEVELS+level].filename == NULL)
|
||||
if (level > MAXLEVELS || MapInfo[volume*MAXLEVELS+level].filename == NULL)
|
||||
{
|
||||
OSD_Printf("changelevel: invalid level number\n");
|
||||
return OSDCMD_SHOWHELP;
|
||||
|
@ -101,8 +101,8 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
if (myconnectindex == connecthead && networkmode == 0)
|
||||
mpchangemap(volume,level);
|
||||
if (myconnectindex == connecthead && g_networkBroadcastMode == 0)
|
||||
Net_NewGame(volume,level);
|
||||
else if (voting == -1)
|
||||
{
|
||||
ud.m_volume_number = volume;
|
||||
|
@ -122,23 +122,22 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
|
||||
voting = myconnectindex;
|
||||
|
||||
tempbuf[0] = 18;
|
||||
tempbuf[1] = 1;
|
||||
tempbuf[2] = myconnectindex;
|
||||
tempbuf[3] = ud.m_volume_number;
|
||||
tempbuf[4] = ud.m_level_number;
|
||||
tempbuf[0] = PACKET_TYPE_MAP_VOTE_INITIATE;
|
||||
tempbuf[1] = myconnectindex;
|
||||
tempbuf[2] = ud.m_volume_number;
|
||||
tempbuf[3] = ud.m_level_number;
|
||||
|
||||
for (i=connecthead;i>=0;i=connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (i != myconnectindex) sendpacket(i,tempbuf,5);
|
||||
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||
if (i != myconnectindex) sendpacket(i,tempbuf,4);
|
||||
if ((!g_networkBroadcastMode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||
}
|
||||
}
|
||||
if ((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) && !(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_TDM))
|
||||
if ((GametypeFlags[ud.m_coop] & GAMETYPE_PLAYERSFRIENDLY) && !(GametypeFlags[ud.m_coop] & GAMETYPE_TDM))
|
||||
ud.m_noexits = 0;
|
||||
|
||||
g_player[myconnectindex].ps->gm |= MODE_MENU;
|
||||
cmenu(603);
|
||||
ChangeToMenu(603);
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -164,8 +163,8 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm)
|
|||
|
||||
ud.multimode = 1;
|
||||
|
||||
newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill);
|
||||
if (enterlevel(MODE_GAME)) backtomenu();
|
||||
G_NewGame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill);
|
||||
if (G_EnterLevel(MODE_GAME)) G_BackToMenu();
|
||||
}
|
||||
|
||||
return OSDCMD_OK;
|
||||
|
@ -254,14 +253,16 @@ static int osdcmd_map(const osdfuncparm_t *parm)
|
|||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
if (myconnectindex == connecthead && networkmode == 0)
|
||||
if (myconnectindex == connecthead && g_networkBroadcastMode == 0)
|
||||
{
|
||||
sendboardname();
|
||||
mpchangemap(0,7);
|
||||
Net_SendUserMapName();
|
||||
ud.m_volume_number = 0;
|
||||
ud.m_level_number = 7;
|
||||
Net_NewGame(ud.m_volume_number, ud.m_level_number);
|
||||
}
|
||||
else if (voting == -1)
|
||||
{
|
||||
sendboardname();
|
||||
Net_SendUserMapName();
|
||||
|
||||
ud.m_volume_number = 0;
|
||||
ud.m_level_number = 7;
|
||||
|
@ -279,23 +280,22 @@ static int osdcmd_map(const osdfuncparm_t *parm)
|
|||
g_player[myconnectindex].vote = g_player[myconnectindex].gotvote = 1;
|
||||
voting = myconnectindex;
|
||||
|
||||
tempbuf[0] = 18;
|
||||
tempbuf[1] = 1;
|
||||
tempbuf[2] = myconnectindex;
|
||||
tempbuf[3] = ud.m_volume_number;
|
||||
tempbuf[4] = ud.m_level_number;
|
||||
tempbuf[0] = PACKET_TYPE_MAP_VOTE_INITIATE;
|
||||
tempbuf[1] = myconnectindex;
|
||||
tempbuf[2] = ud.m_volume_number;
|
||||
tempbuf[3] = ud.m_level_number;
|
||||
|
||||
for (i=connecthead;i>=0;i=connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (i != myconnectindex) sendpacket(i,tempbuf,5);
|
||||
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||
if (i != myconnectindex) sendpacket(i,tempbuf,4);
|
||||
if ((!g_networkBroadcastMode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||
}
|
||||
}
|
||||
if ((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) && !(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_TDM))
|
||||
if ((GametypeFlags[ud.m_coop] & GAMETYPE_PLAYERSFRIENDLY) && !(GametypeFlags[ud.m_coop] & GAMETYPE_TDM))
|
||||
ud.m_noexits = 0;
|
||||
|
||||
g_player[myconnectindex].ps->gm |= MODE_MENU;
|
||||
cmenu(603);
|
||||
ChangeToMenu(603);
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -311,8 +311,8 @@ static int osdcmd_map(const osdfuncparm_t *parm)
|
|||
|
||||
ud.multimode = 1;
|
||||
|
||||
newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill);
|
||||
if (enterlevel(MODE_GAME)) backtomenu();
|
||||
G_NewGame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill);
|
||||
if (G_EnterLevel(MODE_GAME)) G_BackToMenu();
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -410,25 +410,25 @@ static int osdcmd_rate(const osdfuncparm_t *parm)
|
|||
static int osdcmd_restartsound(const osdfuncparm_t *parm)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
SoundShutdown();
|
||||
MusicShutdown();
|
||||
S_SoundShutdown();
|
||||
S_MusicShutdown();
|
||||
|
||||
initprintf("Initializing music...\n");
|
||||
MusicStartup();
|
||||
S_MusicStartup();
|
||||
initprintf("Initializing sound...\n");
|
||||
SoundStartup();
|
||||
S_SoundStartup();
|
||||
|
||||
FX_StopAllSounds();
|
||||
clearsoundlocks();
|
||||
S_ClearSoundLocks();
|
||||
|
||||
if (ud.config.MusicToggle == 1)
|
||||
{
|
||||
if (ud.recstat != 2 && g_player[myconnectindex].ps->gm&MODE_GAME)
|
||||
{
|
||||
if (map[(unsigned char)music_select].musicfn != NULL)
|
||||
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
|
||||
if (MapInfo[(unsigned char)g_musicIndex].musicfn != NULL)
|
||||
S_PlayMusic(&MapInfo[(unsigned char)g_musicIndex].musicfn[0],g_musicIndex);
|
||||
}
|
||||
else playmusic(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
|
||||
else S_PlayMusic(&EnvMusicFilename[0][0],MAXVOLUMES*MAXLEVELS);
|
||||
}
|
||||
|
||||
return OSDCMD_OK;
|
||||
|
@ -439,9 +439,9 @@ static int osdcmd_restartvid(const osdfuncparm_t *parm)
|
|||
UNREFERENCED_PARAMETER(parm);
|
||||
resetvideomode();
|
||||
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP))
|
||||
gameexit("restartvid: Reset failed...\n");
|
||||
G_GameExit("restartvid: Reset failed...\n");
|
||||
onvideomodechange(ud.config.ScreenBPP>8);
|
||||
vscrn();
|
||||
G_UpdateScreenArea();
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -475,14 +475,14 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
|
|||
{
|
||||
initprintf("vidmode: Mode change failed!\n");
|
||||
if (setgamemode(ud.config.ScreenMode, ud.config.ScreenWidth, ud.config.ScreenHeight, ud.config.ScreenBPP))
|
||||
gameexit("vidmode: Reset failed!\n");
|
||||
G_GameExit("vidmode: Reset failed!\n");
|
||||
}
|
||||
ud.config.ScreenBPP = newbpp;
|
||||
ud.config.ScreenWidth = newwidth;
|
||||
ud.config.ScreenHeight = newheight;
|
||||
ud.config.ScreenMode = newfs;
|
||||
onvideomodechange(ud.config.ScreenBPP>8);
|
||||
vscrn();
|
||||
G_UpdateScreenArea();
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ static int osdcmd_setstatusbarscale(const osdfuncparm_t *parm)
|
|||
}
|
||||
else if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||
|
||||
setstatusbarscale(Batol(parm->parms[0]));
|
||||
G_SetStatusBarScale(Batol(parm->parms[0]));
|
||||
OSD_Printf("hud_scale %d\n", ud.statusbarscale);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ static int osdcmd_spawn(const osdfuncparm_t *parm)
|
|||
int i,j;
|
||||
for (j=0; j<2; j++)
|
||||
{
|
||||
for (i=0; i<labelcnt; i++)
|
||||
for (i=0; i<g_numLabels; i++)
|
||||
{
|
||||
if (
|
||||
(j == 0 && !Bstrcmp(label+(i<<6), parm->parms[0])) ||
|
||||
|
@ -564,9 +564,9 @@ static int osdcmd_spawn(const osdfuncparm_t *parm)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (i<labelcnt) break;
|
||||
if (i<g_numLabels) break;
|
||||
}
|
||||
if (i==labelcnt)
|
||||
if (i==g_numLabels)
|
||||
{
|
||||
OSD_Printf("spawn: Invalid tile label given\n");
|
||||
return OSDCMD_OK;
|
||||
|
@ -583,7 +583,7 @@ static int osdcmd_spawn(const osdfuncparm_t *parm)
|
|||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
|
||||
idx = spawn(g_player[myconnectindex].ps->i, (short)picnum);
|
||||
idx = A_Spawn(g_player[myconnectindex].ps->i, (short)picnum);
|
||||
if (set & 1) sprite[idx].pal = (char)pal;
|
||||
if (set & 2) sprite[idx].cstat = (short)cstat;
|
||||
if (set & 4) sprite[idx].ang = ang;
|
||||
|
@ -616,12 +616,12 @@ static int osdcmd_setvar(const osdfuncparm_t *parm)
|
|||
varval = Batol(varname);
|
||||
i = HASH_find(&gamevarH,varname);
|
||||
if (i >= 0)
|
||||
varval=GetGameVarID(i, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
varval=Gv_GetVar(i, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
|
||||
strcpy(varname,parm->parms[0]);
|
||||
i = HASH_find(&gamevarH,varname);
|
||||
if (i >= 0)
|
||||
SetGameVarID(i, varval, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
Gv_SetVar(i, varval, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ static int osdcmd_addlogvar(const osdfuncparm_t *parm)
|
|||
strcpy(varname,parm->parms[0]);
|
||||
i = HASH_find(&gamevarH,varname);
|
||||
if (i >= 0)
|
||||
OSD_Printf("%s = %d\n", varname, GetGameVarID(i, g_player[myconnectindex].ps->i, myconnectindex));
|
||||
OSD_Printf("%s = %d\n", varname, Gv_GetVar(i, g_player[myconnectindex].ps->i, myconnectindex));
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -670,12 +670,12 @@ static int osdcmd_setactorvar(const osdfuncparm_t *parm)
|
|||
varval = Batol(varname);
|
||||
i = HASH_find(&gamevarH,varname);
|
||||
if (i >= 0)
|
||||
varval=GetGameVarID(i, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
varval=Gv_GetVar(i, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
|
||||
strcpy(varname,parm->parms[1]);
|
||||
i = HASH_find(&gamevarH,varname);
|
||||
if (i >= 0)
|
||||
SetGameVarID(i, varval, ID, -1);
|
||||
Gv_SetVar(i, varval, ID, -1);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ static int osdcmd_cmenu(const osdfuncparm_t *parm)
|
|||
}
|
||||
else
|
||||
{
|
||||
cmenu(Batol(parm->parms[0]));
|
||||
ChangeToMenu(Batol(parm->parms[0]));
|
||||
}
|
||||
|
||||
return OSDCMD_OK;
|
||||
|
@ -844,7 +844,7 @@ static int osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
break;
|
||||
}
|
||||
if (cvar[i].type&CVAR_MULTI)
|
||||
updateplayer();
|
||||
G_UpdatePlayerFromMenu();
|
||||
}
|
||||
}
|
||||
OSD_Printf("\n");
|
||||
|
@ -909,7 +909,7 @@ static int osdcmd_give(const osdfuncparm_t *parm)
|
|||
else if (!Bstrcasecmp(parm->parms[0], "ammo"))
|
||||
{
|
||||
for (i=MAX_WEAPONS-(VOLUMEONE?6:1)-1;i>=PISTOL_WEAPON;i--)
|
||||
addammo(i,g_player[myconnectindex].ps,g_player[myconnectindex].ps->max_ammo_amount[i]);
|
||||
P_AddAmmo(i,g_player[myconnectindex].ps,g_player[myconnectindex].ps->max_ammo_amount[i]);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
else if (!Bstrcasecmp(parm->parms[0], "armor"))
|
||||
|
@ -954,7 +954,7 @@ void onvideomodechange(int newmode)
|
|||
}
|
||||
|
||||
setbrightness(ud.brightness>>2, pal, 0);
|
||||
restorepalette = 1;
|
||||
g_restorePalette = 1;
|
||||
crosshair_sum = 0;
|
||||
}
|
||||
|
||||
|
@ -996,7 +996,7 @@ static int osdcmd_name(const osdfuncparm_t *parm)
|
|||
|
||||
if (parm->numparms != 1)
|
||||
{
|
||||
OSD_Printf("\"name\" is \"%s\"\n",myname);
|
||||
OSD_Printf("\"name\" is \"%s\"\n",szPlayerName);
|
||||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
|
||||
|
@ -1005,12 +1005,12 @@ static int osdcmd_name(const osdfuncparm_t *parm)
|
|||
while (Bstrlen(stripcolorcodes(namebuf,tempbuf)) > 10)
|
||||
tempbuf[Bstrlen(tempbuf)-1] = '\0';
|
||||
|
||||
Bstrncpy(myname,tempbuf,sizeof(myname)-1);
|
||||
myname[sizeof(myname)-1] = '\0';
|
||||
Bstrncpy(szPlayerName,tempbuf,sizeof(szPlayerName)-1);
|
||||
szPlayerName[sizeof(szPlayerName)-1] = '\0';
|
||||
|
||||
OSD_Printf("name %s\n",myname);
|
||||
OSD_Printf("name %s\n",szPlayerName);
|
||||
|
||||
updateplayer();
|
||||
Net_SendPlayerName();
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -1285,7 +1285,7 @@ static int osdcmd_quicksave(const osdfuncparm_t *parm)
|
|||
UNREFERENCED_PARAMETER(parm);
|
||||
if (!(g_player[myconnectindex].ps->gm & MODE_GAME))
|
||||
OSD_Printf("quicksave: not in a game.\n");
|
||||
else doquicksave = 1;
|
||||
else g_doQuickSave = 1;
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -1294,7 +1294,7 @@ static int osdcmd_quickload(const osdfuncparm_t *parm)
|
|||
UNREFERENCED_PARAMETER(parm);
|
||||
if (!(g_player[myconnectindex].ps->gm & MODE_GAME))
|
||||
OSD_Printf("quickload: not in a game.\n");
|
||||
else doquicksave = 2;
|
||||
else g_doQuickSave = 2;
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -1306,24 +1306,24 @@ static int osdcmd_screenshot(const osdfuncparm_t *parm)
|
|||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
extern void savemapstate(mapstate_t *save);
|
||||
extern void restoremapstate(mapstate_t *save);
|
||||
extern void G_SaveMapState(mapstate_t *save);
|
||||
extern void G_RestoreMapState(mapstate_t *save);
|
||||
|
||||
/*
|
||||
static int osdcmd_savestate(const osdfuncparm_t *parm)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
if (map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate == NULL)
|
||||
map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate = Bcalloc(1,sizeof(mapstate_t));
|
||||
savemapstate(map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
||||
if (MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate == NULL)
|
||||
MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate = Bcalloc(1,sizeof(mapstate_t));
|
||||
G_SaveMapState(MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
static int osdcmd_restorestate(const osdfuncparm_t *parm)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
if (map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate)
|
||||
restoremapstate(map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
||||
if (MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate)
|
||||
G_RestoreMapState(MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
*/
|
||||
|
@ -1383,8 +1383,8 @@ static int osdcmd_setcrosshairscale(const osdfuncparm_t *parm)
|
|||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
extern void SetCrosshairColor(int r, int g, int b);
|
||||
extern palette_t crosshair_colors;
|
||||
extern void G_SetCrosshairColor(int r, int g, int b);
|
||||
extern palette_t CrosshairColors;
|
||||
|
||||
static int osdcmd_crosshaircolor(const osdfuncparm_t *parm)
|
||||
{
|
||||
|
@ -1392,13 +1392,13 @@ static int osdcmd_crosshaircolor(const osdfuncparm_t *parm)
|
|||
|
||||
if (parm->numparms != 3)
|
||||
{
|
||||
OSD_Printf("crosshaircolor: r:%d g:%d b:%d\n",crosshair_colors.r,crosshair_colors.g,crosshair_colors.b);
|
||||
OSD_Printf("crosshaircolor: r:%d g:%d b:%d\n",CrosshairColors.r,CrosshairColors.g,CrosshairColors.b);
|
||||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
r = atol(parm->parms[0]);
|
||||
g = atol(parm->parms[1]);
|
||||
b = atol(parm->parms[2]);
|
||||
SetCrosshairColor(r,g,b);
|
||||
G_SetCrosshairColor(r,g,b);
|
||||
OSD_Printf("%s\n", parm->raw);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -1421,7 +1421,7 @@ static int osdcmd_visibility(const osdfuncparm_t *parm)
|
|||
|
||||
static int osdcmd_maxfps(const osdfuncparm_t *parm)
|
||||
{
|
||||
extern int g_FrameDelay;
|
||||
extern int g_frameDelay;
|
||||
|
||||
if (parm->numparms != 1)
|
||||
{
|
||||
|
@ -1429,8 +1429,8 @@ static int osdcmd_maxfps(const osdfuncparm_t *parm)
|
|||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
r_maxfps = max(0,min(1000,atol(parm->parms[0])));
|
||||
if (r_maxfps) g_FrameDelay = (1000/r_maxfps);
|
||||
else g_FrameDelay = 0;
|
||||
if (r_maxfps) g_frameDelay = (1000/r_maxfps);
|
||||
else g_frameDelay = 0;
|
||||
OSD_Printf("%s\n",parm->raw);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -1441,16 +1441,16 @@ static int osdcmd_inittimer(const osdfuncparm_t *parm)
|
|||
|
||||
if (parm->numparms != 1)
|
||||
{
|
||||
OSD_Printf("%dHz timer\n",timer);
|
||||
OSD_Printf("%dHz timer\n",g_timerTicsPerSecond);
|
||||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
|
||||
j = atol(parm->parms[0]);
|
||||
if (timer == j)
|
||||
if (g_timerTicsPerSecond == j)
|
||||
return OSDCMD_OK;
|
||||
uninittimer();
|
||||
inittimer(j);
|
||||
timer = j;
|
||||
g_timerTicsPerSecond = j;
|
||||
|
||||
OSD_Printf("%s\n",parm->raw);
|
||||
return OSDCMD_OK;
|
||||
|
@ -1490,11 +1490,13 @@ int registerosdcommands(void)
|
|||
|
||||
OSD_RegisterFunction("fileinfo","fileinfo <file>: gets a file's information", osdcmd_fileinfo);
|
||||
|
||||
for (i=0;i<NUMGAMEFUNCTIONS-1;i++)
|
||||
for (i=0;i<NUMGAMEFUNCTIONS;i++)
|
||||
{
|
||||
char *t;
|
||||
int j;
|
||||
|
||||
if (!Bstrcmp(gamefunctions[i],"Show_Console")) continue;
|
||||
|
||||
Bsprintf(tempbuf,"gamefunc_%s",gamefunctions[i]);
|
||||
t = Bstrdup(tempbuf);
|
||||
for (j=Bstrlen(t);j>=0;j--)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __osdcmds_h__
|
||||
|
||||
struct osdcmd_cheatsinfo {
|
||||
int cheatnum; // -1 = none, else = see cheats()
|
||||
int cheatnum; // -1 = none, else = see DoCheats()
|
||||
int volume,level;
|
||||
};
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ void GAME_onshowosd(int shown)
|
|||
picsiz[BGTILE] += ((char)(j<<4));
|
||||
}
|
||||
|
||||
vscrn();
|
||||
G_UpdateScreenArea();
|
||||
if (numplayers == 1)
|
||||
if ((shown && !ud.pause_on) || (!shown && ud.pause_on))
|
||||
KB_KeyDown[sc_Pause] = 1;
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -28,7 +28,7 @@ extern char *bitptr;
|
|||
|
||||
#define BITPTR_POINTER 1
|
||||
|
||||
void readsavenames(void)
|
||||
void ReadSaveGameHeaders(void)
|
||||
{
|
||||
int dummy,j;
|
||||
int i;
|
||||
|
@ -74,7 +74,7 @@ void readsavenames(void)
|
|||
}
|
||||
}
|
||||
|
||||
int loadpheader(char spot,struct savehead *saveh)
|
||||
int G_LoadSaveHeader(char spot,struct savehead *saveh)
|
||||
{
|
||||
char fn[13];
|
||||
int fil;
|
||||
|
@ -95,7 +95,7 @@ int loadpheader(char spot,struct savehead *saveh)
|
|||
if (kdfread(&bv,4,1,fil) != 1) goto corrupt;
|
||||
/* if (bv != BYTEVERSION)
|
||||
{
|
||||
FTA(114,g_player[myconnectindex].ps);
|
||||
P_DoQuote(114,g_player[myconnectindex].ps);
|
||||
kclose(fil);
|
||||
return 1;
|
||||
}*/
|
||||
|
@ -122,7 +122,7 @@ corrupt:
|
|||
return 1;
|
||||
}
|
||||
|
||||
int loadplayer(int spot)
|
||||
int G_LoadPlayer(int spot)
|
||||
{
|
||||
int k;
|
||||
char fn[13];
|
||||
|
@ -173,7 +173,7 @@ int loadplayer(int spot)
|
|||
if (kdfread(&bv,4,1,fil) != 1) return -1;
|
||||
if (bv != BYTEVERSION)
|
||||
{
|
||||
FTA(114,g_player[myconnectindex].ps);
|
||||
P_DoQuote(114,g_player[myconnectindex].ps);
|
||||
kclose(fil);
|
||||
ototalclock = totalclock;
|
||||
ready2send = 1;
|
||||
|
@ -186,7 +186,7 @@ int loadplayer(int spot)
|
|||
kclose(fil);
|
||||
ototalclock = totalclock;
|
||||
ready2send = 1;
|
||||
FTA(124,g_player[myconnectindex].ps);
|
||||
P_DoQuote(124,g_player[myconnectindex].ps);
|
||||
return 1;
|
||||
}
|
||||
else ud.multimode = nump;
|
||||
|
@ -195,8 +195,8 @@ int loadplayer(int spot)
|
|||
{
|
||||
pub = NUMPAGES;
|
||||
pus = NUMPAGES;
|
||||
vscrn();
|
||||
drawbackground();
|
||||
G_UpdateScreenArea();
|
||||
G_DrawBackground();
|
||||
menutext(160,100,0,0,"LOADING...");
|
||||
nextpage();
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ int loadplayer(int spot)
|
|||
waitforeverybody();
|
||||
|
||||
FX_StopAllSounds();
|
||||
clearsoundlocks();
|
||||
S_ClearSoundLocks();
|
||||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
|
@ -248,43 +248,43 @@ int loadplayer(int spot)
|
|||
if (kdfread(&headspritesect[0],2,MAXSECTORS+1,fil) != MAXSECTORS+1) goto corrupt;
|
||||
if (kdfread(&prevspritesect[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&nextspritesect[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&headspritestat[0],2,MAXSTATUS+1,fil) != MAXSTATUS+1) goto corrupt;
|
||||
if (kdfread(&prevspritestat[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&nextspritestat[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&numcyclers,sizeof(numcyclers),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&headspritestat[STAT_DEFAULT],2,MAXSTATUS+1,fil) != MAXSTATUS+1) goto corrupt;
|
||||
if (kdfread(&prevspritestat[STAT_DEFAULT],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&nextspritestat[STAT_DEFAULT],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&g_numCyclers,sizeof(g_numCyclers),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&cyclers[0][0],12,MAXCYCLERS,fil) != MAXCYCLERS) goto corrupt;
|
||||
for (i=0;i<nump;i++)
|
||||
if (kdfread(g_player[i].ps,sizeof(player_struct),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_PlayerSpawnPoints,sizeof(g_PlayerSpawnPoints),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&numanimwalls,sizeof(numanimwalls),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(g_player[i].ps,sizeof(DukePlayer_t),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_playerSpawnPoints,sizeof(g_playerSpawnPoints),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_numAnimWalls,sizeof(g_numAnimWalls),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&animwall,sizeof(animwall),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&msx[0],sizeof(int),sizeof(msx)/sizeof(int),fil) != sizeof(msx)/sizeof(int)) goto corrupt;
|
||||
if (kdfread(&msy[0],sizeof(int),sizeof(msy)/sizeof(int),fil) != sizeof(msy)/sizeof(int)) goto corrupt;
|
||||
if (kdfread((short *)&spriteqloc,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread((short *)&spriteqamount,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread((short *)&spriteq[0],sizeof(short),spriteqamount,fil) != spriteqamount) goto corrupt;
|
||||
if (kdfread(&mirrorcnt,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&mirrorwall[0],sizeof(short),64,fil) != 64) goto corrupt;
|
||||
if (kdfread(&mirrorsector[0],sizeof(short),64,fil) != 64) goto corrupt;
|
||||
if (kdfread((short *)&g_spriteDeleteQueuePos,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread((short *)&g_spriteDeleteQueueSize,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread((short *)&SpriteDeletionQueue[0],sizeof(short),g_spriteDeleteQueueSize,fil) != g_spriteDeleteQueueSize) goto corrupt;
|
||||
if (kdfread(&g_mirrorCount,sizeof(short),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_mirrorWall[0],sizeof(short),64,fil) != 64) goto corrupt;
|
||||
if (kdfread(&g_mirrorSector[0],sizeof(short),64,fil) != 64) goto corrupt;
|
||||
if (kdfread(&show2dsector[0],sizeof(char),MAXSECTORS>>3,fil) != (MAXSECTORS>>3)) goto corrupt;
|
||||
if (kdfread(&actortype[0],sizeof(char),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&ActorType[0],sizeof(char),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&numclouds,sizeof(numclouds),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_numClouds,sizeof(g_numClouds),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&clouds[0],sizeof(short)<<7,1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&cloudx[0],sizeof(short)<<7,1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&cloudy[0],sizeof(short)<<7,1,fil) != 1) goto corrupt;
|
||||
|
||||
if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt;
|
||||
if (!g_ScriptSize) goto corrupt;
|
||||
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs));
|
||||
if (kdfread(&g_scriptSize,sizeof(g_scriptSize),1,fil) != 1) goto corrupt;
|
||||
if (!g_scriptSize) goto corrupt;
|
||||
scriptptrs = Bcalloc(1,g_scriptSize * sizeof(scriptptrs));
|
||||
Bfree(bitptr);
|
||||
bitptr = Bcalloc(1,(((g_ScriptSize+7)>>3)+1) * sizeof(char));
|
||||
if (kdfread(&bitptr[0],sizeof(char),(g_ScriptSize+7)>>3,fil) != ((g_ScriptSize+7)>>3)) goto corrupt;
|
||||
bitptr = Bcalloc(1,(((g_scriptSize+7)>>3)+1) * sizeof(char));
|
||||
if (kdfread(&bitptr[0],sizeof(char),(g_scriptSize+7)>>3,fil) != ((g_scriptSize+7)>>3)) goto corrupt;
|
||||
if (script != NULL)
|
||||
Bfree(script);
|
||||
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
|
||||
if (kdfread(&script[0],sizeof(script),g_ScriptSize,fil) != g_ScriptSize) goto corrupt;
|
||||
for (i=0;i<g_ScriptSize;i++)
|
||||
script = Bcalloc(1,g_scriptSize * sizeof(intptr_t));
|
||||
if (kdfread(&script[0],sizeof(script),g_scriptSize,fil) != g_scriptSize) goto corrupt;
|
||||
for (i=0;i<g_scriptSize;i++)
|
||||
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||
{
|
||||
j = (intptr_t)script[i]+(intptr_t)&script[0];
|
||||
|
@ -309,7 +309,7 @@ int loadplayer(int spot)
|
|||
scriptptrs = Brealloc(scriptptrs, MAXSPRITES * sizeof(scriptptrs));
|
||||
|
||||
if (kdfread(&scriptptrs[0],sizeof(scriptptrs),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&hittype[0],sizeof(actordata_t),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&ActorExtra[0],sizeof(actordata_t),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||
|
||||
for (i=0;i<MAXSPRITES;i++)
|
||||
{
|
||||
|
@ -323,14 +323,14 @@ int loadplayer(int spot)
|
|||
if (kdfread(&pskybits,sizeof(pskybits),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&pskyoff[0],sizeof(pskyoff[0]),MAXPSKYTILES,fil) != MAXPSKYTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&animatecnt,sizeof(animatecnt),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_animateCount,sizeof(g_animateCount),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&animatesect[0],2,MAXANIMATES,fil) != MAXANIMATES) goto corrupt;
|
||||
if (kdfread(&animateptr[0],sizeof(int),MAXANIMATES,fil) != MAXANIMATES) goto corrupt;
|
||||
for (i = animatecnt-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]+(intptr_t)(§or[0]));
|
||||
for (i = g_animateCount-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]+(intptr_t)(§or[0]));
|
||||
if (kdfread(&animategoal[0],4,MAXANIMATES,fil) != MAXANIMATES) goto corrupt;
|
||||
if (kdfread(&animatevel[0],4,MAXANIMATES,fil) != MAXANIMATES) goto corrupt;
|
||||
|
||||
if (kdfread(&earthquaketime,sizeof(earthquaketime),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_earthquakeTime,sizeof(g_earthquakeTime),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&ud.from_bonus,sizeof(ud.from_bonus),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&ud.secretlevel,sizeof(ud.secretlevel),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&ud.respawn_monsters,sizeof(ud.respawn_monsters),1,fil) != 1) goto corrupt;
|
||||
|
@ -358,75 +358,75 @@ int loadplayer(int spot)
|
|||
if (kdfread(&camsprite,sizeof(camsprite),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&connecthead,sizeof(connecthead),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(connectpoint2,sizeof(connectpoint2),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&numplayersprites,sizeof(numplayersprites),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_numPlayerSprites,sizeof(g_numPlayerSprites),1,fil) != 1) goto corrupt;
|
||||
for (i=0;i<MAXPLAYERS;i++)
|
||||
if (kdfread((short *)&g_player[i].frags[0],sizeof(g_player[i].frags),1,fil) != 1) goto corrupt;
|
||||
|
||||
if (kdfread(&randomseed,sizeof(randomseed),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&global_random,sizeof(global_random),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_globalRandom,sizeof(g_globalRandom),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(¶llaxyscale,sizeof(parallaxyscale),1,fil) != 1) goto corrupt;
|
||||
|
||||
if (kdfread(&projectile[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&defaultprojectile[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&spriteflags[0],sizeof(spriteflags[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&SpriteFlags[0],sizeof(SpriteFlags[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&spritecache[0],sizeof(spritecache[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&SpriteCacheList[0],sizeof(SpriteCacheList[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&i,sizeof(int),1,fil) != 1) goto corrupt;
|
||||
|
||||
while (i != MAXQUOTES)
|
||||
{
|
||||
if (fta_quotes[i] != NULL)
|
||||
Bfree(fta_quotes[i]);
|
||||
if (ScriptQuotes[i] != NULL)
|
||||
Bfree(ScriptQuotes[i]);
|
||||
|
||||
fta_quotes[i] = Bcalloc(MAXQUOTELEN,sizeof(char));
|
||||
ScriptQuotes[i] = Bcalloc(MAXQUOTELEN,sizeof(char));
|
||||
|
||||
if (kdfread((char *)fta_quotes[i],MAXQUOTELEN,1,fil) != 1) goto corrupt;
|
||||
if (kdfread((char *)ScriptQuotes[i],MAXQUOTELEN,1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&i,sizeof(int),1,fil) != 1) goto corrupt;
|
||||
}
|
||||
|
||||
if (kdfread(&redefined_quote_count,sizeof(redefined_quote_count),1,fil) != 1) goto corrupt;
|
||||
if (kdfread(&g_numQuoteRedefinitions,sizeof(g_numQuoteRedefinitions),1,fil) != 1) goto corrupt;
|
||||
|
||||
for (i=0;i<redefined_quote_count;i++)
|
||||
for (i=0;i<g_numQuoteRedefinitions;i++)
|
||||
{
|
||||
if (redefined_quotes[i] != NULL)
|
||||
Bfree(redefined_quotes[i]);
|
||||
if (ScriptQuoteRedefinitions[i] != NULL)
|
||||
Bfree(ScriptQuoteRedefinitions[i]);
|
||||
|
||||
redefined_quotes[i] = Bcalloc(MAXQUOTELEN,sizeof(char));
|
||||
ScriptQuoteRedefinitions[i] = Bcalloc(MAXQUOTELEN,sizeof(char));
|
||||
|
||||
if (kdfread((char *)redefined_quotes[i],MAXQUOTELEN,1,fil) != 1) goto corrupt;
|
||||
if (kdfread((char *)ScriptQuoteRedefinitions[i],MAXQUOTELEN,1,fil) != 1) goto corrupt;
|
||||
}
|
||||
|
||||
if (kdfread(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
if (kdfread(&DynamicTileMap[0],sizeof(DynamicTileMap[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
if (kdfread(&ud.noexits,sizeof(ud.noexits),1,fil) != 1) goto corrupt;
|
||||
ud.m_noexits = ud.noexits;
|
||||
|
||||
|
||||
if (ReadGameVars(fil)) goto corrupt;
|
||||
if (Gv_ReadSave(fil)) goto corrupt;
|
||||
|
||||
kclose(fil);
|
||||
|
||||
if (g_player[myconnectindex].ps->over_shoulder_on != 0)
|
||||
{
|
||||
cameradist = 0;
|
||||
cameraclock = 0;
|
||||
g_cameraDistance = 0;
|
||||
g_cameraClock = 0;
|
||||
g_player[myconnectindex].ps->over_shoulder_on = 1;
|
||||
}
|
||||
|
||||
screenpeek = myconnectindex;
|
||||
|
||||
clearbufbyte(gotpic,sizeof(gotpic),0L);
|
||||
clearsoundlocks();
|
||||
cacheit();
|
||||
S_ClearSoundLocks();
|
||||
G_CacheMapData();
|
||||
|
||||
i = music_select;
|
||||
music_select = (ud.volume_number*MAXLEVELS) + ud.level_number;
|
||||
if (map[(unsigned char)music_select].musicfn != NULL && (i != music_select || map[MAXVOLUMES*MAXLEVELS+2].musicfn1))
|
||||
i = g_musicIndex;
|
||||
g_musicIndex = (ud.volume_number*MAXLEVELS) + ud.level_number;
|
||||
if (MapInfo[(unsigned char)g_musicIndex].musicfn != NULL && (i != g_musicIndex || MapInfo[MAXVOLUMES*MAXLEVELS+2].musicfn1))
|
||||
{
|
||||
MUSIC_StopSong();
|
||||
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
|
||||
S_PlayMusic(&MapInfo[(unsigned char)g_musicIndex].musicfn[0],g_musicIndex);
|
||||
}
|
||||
MUSIC_Continue();
|
||||
|
||||
|
@ -434,24 +434,24 @@ int loadplayer(int spot)
|
|||
ud.recstat = 0;
|
||||
|
||||
if (g_player[myconnectindex].ps->jetpack_on)
|
||||
spritesound(DUKE_JETPACK_IDLE,g_player[myconnectindex].ps->i);
|
||||
A_PlaySound(DUKE_JETPACK_IDLE,g_player[myconnectindex].ps->i);
|
||||
|
||||
restorepalette = 1;
|
||||
setpal(g_player[myconnectindex].ps);
|
||||
vscrn();
|
||||
g_restorePalette = 1;
|
||||
P_UpdateScreenPal(g_player[myconnectindex].ps);
|
||||
G_UpdateScreenArea();
|
||||
|
||||
FX_SetReverb(0);
|
||||
|
||||
if (ud.lockout == 0)
|
||||
{
|
||||
for (x=0;x<numanimwalls;x++)
|
||||
for (x=0;x<g_numAnimWalls;x++)
|
||||
if (wall[animwall[x].wallnum].extra >= 0)
|
||||
wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (x=0;x<numanimwalls;x++)
|
||||
switch (dynamictostatic[wall[animwall[x].wallnum].picnum])
|
||||
for (x=0;x<g_numAnimWalls;x++)
|
||||
switch (DynamicTileMap[wall[animwall[x].wallnum].picnum])
|
||||
{
|
||||
case FEMPIC1__STATIC:
|
||||
wall[animwall[x].wallnum].picnum = BLANKSCREEN;
|
||||
|
@ -463,27 +463,27 @@ int loadplayer(int spot)
|
|||
}
|
||||
}
|
||||
|
||||
numinterpolations = 0;
|
||||
g_numInterpolations = 0;
|
||||
startofdynamicinterpolations = 0;
|
||||
|
||||
k = headspritestat[3];
|
||||
k = headspritestat[STAT_EFFECTOR];
|
||||
while (k >= 0)
|
||||
{
|
||||
switch (sprite[k].lotag)
|
||||
{
|
||||
case 31:
|
||||
setinterpolation(§or[sprite[k].sectnum].floorz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].floorz);
|
||||
break;
|
||||
case 32:
|
||||
setinterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
break;
|
||||
case 25:
|
||||
setinterpolation(§or[sprite[k].sectnum].floorz);
|
||||
setinterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].floorz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
break;
|
||||
case 17:
|
||||
setinterpolation(§or[sprite[k].sectnum].floorz);
|
||||
setinterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].floorz);
|
||||
G_SetInterpolation(§or[sprite[k].sectnum].ceilingz);
|
||||
break;
|
||||
case 0:
|
||||
case 5:
|
||||
|
@ -494,18 +494,18 @@ int loadplayer(int spot)
|
|||
case 16:
|
||||
case 26:
|
||||
case 30:
|
||||
setsectinterpolate(k);
|
||||
Sect_SetInterpolation(k);
|
||||
break;
|
||||
}
|
||||
|
||||
k = nextspritestat[k];
|
||||
}
|
||||
|
||||
for (i=numinterpolations-1;i>=0;i--) bakipos[i] = *curipos[i];
|
||||
for (i = animatecnt-1;i>=0;i--)
|
||||
setinterpolation(animateptr[i]);
|
||||
for (i=g_numInterpolations-1;i>=0;i--) bakipos[i] = *curipos[i];
|
||||
for (i = g_animateCount-1;i>=0;i--)
|
||||
G_SetInterpolation(animateptr[i]);
|
||||
|
||||
show_shareware = 0;
|
||||
g_showShareware = 0;
|
||||
everyothertime = 0;
|
||||
|
||||
// clearbufbyte(playerquitflag,MAXPLAYERS,0x01010101);
|
||||
|
@ -513,7 +513,7 @@ int loadplayer(int spot)
|
|||
for (i=0;i<MAXPLAYERS;i++)
|
||||
clearbufbyte(&g_player[i].playerquitflag,1,0x01010101);
|
||||
|
||||
resetmys();
|
||||
Net_ResetPrediction();
|
||||
|
||||
ready2send = 1;
|
||||
|
||||
|
@ -521,16 +521,16 @@ int loadplayer(int spot)
|
|||
clearfifo();
|
||||
waitforeverybody();
|
||||
|
||||
resettimevars();
|
||||
G_ResetTimers();
|
||||
|
||||
return(0);
|
||||
corrupt:
|
||||
Bsprintf(tempbuf,"Save game file \"%s\" is corrupt or of the wrong version.",fnptr);
|
||||
gameexit(tempbuf);
|
||||
G_GameExit(tempbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int saveplayer(int spot)
|
||||
int G_SavePlayer(int spot)
|
||||
{
|
||||
int i;
|
||||
intptr_t j;
|
||||
|
@ -624,35 +624,35 @@ int saveplayer(int spot)
|
|||
dfwrite(&headspritesect[0],2,MAXSECTORS+1,fil);
|
||||
dfwrite(&prevspritesect[0],2,MAXSPRITES,fil);
|
||||
dfwrite(&nextspritesect[0],2,MAXSPRITES,fil);
|
||||
dfwrite(&headspritestat[0],2,MAXSTATUS+1,fil);
|
||||
dfwrite(&prevspritestat[0],2,MAXSPRITES,fil);
|
||||
dfwrite(&nextspritestat[0],2,MAXSPRITES,fil);
|
||||
dfwrite(&numcyclers,sizeof(numcyclers),1,fil);
|
||||
dfwrite(&headspritestat[STAT_DEFAULT],2,MAXSTATUS+1,fil);
|
||||
dfwrite(&prevspritestat[STAT_DEFAULT],2,MAXSPRITES,fil);
|
||||
dfwrite(&nextspritestat[STAT_DEFAULT],2,MAXSPRITES,fil);
|
||||
dfwrite(&g_numCyclers,sizeof(g_numCyclers),1,fil);
|
||||
dfwrite(&cyclers[0][0],12,MAXCYCLERS,fil);
|
||||
for (i=0;i<ud.multimode;i++)
|
||||
dfwrite(g_player[i].ps,sizeof(player_struct),1,fil);
|
||||
dfwrite(&g_PlayerSpawnPoints,sizeof(g_PlayerSpawnPoints),1,fil);
|
||||
dfwrite(&numanimwalls,sizeof(numanimwalls),1,fil);
|
||||
dfwrite(g_player[i].ps,sizeof(DukePlayer_t),1,fil);
|
||||
dfwrite(&g_playerSpawnPoints,sizeof(g_playerSpawnPoints),1,fil);
|
||||
dfwrite(&g_numAnimWalls,sizeof(g_numAnimWalls),1,fil);
|
||||
dfwrite(&animwall,sizeof(animwall),1,fil);
|
||||
dfwrite(&msx[0],sizeof(int),sizeof(msx)/sizeof(int),fil);
|
||||
dfwrite(&msy[0],sizeof(int),sizeof(msy)/sizeof(int),fil);
|
||||
dfwrite(&spriteqloc,sizeof(short),1,fil);
|
||||
dfwrite(&spriteqamount,sizeof(short),1,fil);
|
||||
dfwrite(&spriteq[0],sizeof(short),spriteqamount,fil);
|
||||
dfwrite(&mirrorcnt,sizeof(short),1,fil);
|
||||
dfwrite(&mirrorwall[0],sizeof(short),64,fil);
|
||||
dfwrite(&mirrorsector[0],sizeof(short),64,fil);
|
||||
dfwrite(&g_spriteDeleteQueuePos,sizeof(short),1,fil);
|
||||
dfwrite(&g_spriteDeleteQueueSize,sizeof(short),1,fil);
|
||||
dfwrite(&SpriteDeletionQueue[0],sizeof(short),g_spriteDeleteQueueSize,fil);
|
||||
dfwrite(&g_mirrorCount,sizeof(short),1,fil);
|
||||
dfwrite(&g_mirrorWall[0],sizeof(short),64,fil);
|
||||
dfwrite(&g_mirrorSector[0],sizeof(short),64,fil);
|
||||
dfwrite(&show2dsector[0],sizeof(char),MAXSECTORS>>3,fil);
|
||||
dfwrite(&actortype[0],sizeof(char),MAXTILES,fil);
|
||||
dfwrite(&ActorType[0],sizeof(char),MAXTILES,fil);
|
||||
|
||||
dfwrite(&numclouds,sizeof(numclouds),1,fil);
|
||||
dfwrite(&g_numClouds,sizeof(g_numClouds),1,fil);
|
||||
dfwrite(&clouds[0],sizeof(short)<<7,1,fil);
|
||||
dfwrite(&cloudx[0],sizeof(short)<<7,1,fil);
|
||||
dfwrite(&cloudy[0],sizeof(short)<<7,1,fil);
|
||||
|
||||
dfwrite(&g_ScriptSize,sizeof(g_ScriptSize),1,fil);
|
||||
scriptptrs = Bcalloc(1, g_ScriptSize * sizeof(scriptptrs));
|
||||
for (i=0;i<g_ScriptSize;i++)
|
||||
dfwrite(&g_scriptSize,sizeof(g_scriptSize),1,fil);
|
||||
scriptptrs = Bcalloc(1, g_scriptSize * sizeof(scriptptrs));
|
||||
for (i=0;i<g_scriptSize;i++)
|
||||
{
|
||||
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||
{
|
||||
|
@ -663,11 +663,11 @@ int saveplayer(int spot)
|
|||
// else scriptptrs[i] = 0;
|
||||
}
|
||||
|
||||
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil);
|
||||
dfwrite(&bitptr[0],sizeof(char),(g_ScriptSize+7)>>3,fil);
|
||||
dfwrite(&script[0],sizeof(script),g_ScriptSize,fil);
|
||||
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_scriptSize,fil);
|
||||
dfwrite(&bitptr[0],sizeof(char),(g_scriptSize+7)>>3,fil);
|
||||
dfwrite(&script[0],sizeof(script),g_scriptSize,fil);
|
||||
|
||||
for (i=0;i<g_ScriptSize;i++)
|
||||
for (i=0;i<g_scriptSize;i++)
|
||||
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||
{
|
||||
j = script[i]+(intptr_t)&script[0];
|
||||
|
@ -713,17 +713,17 @@ int saveplayer(int spot)
|
|||
|
||||
j = (intptr_t)&script[0];
|
||||
|
||||
if (T2 >= j && T2 < (intptr_t)(&script[g_ScriptSize]))
|
||||
if (T2 >= j && T2 < (intptr_t)(&script[g_scriptSize]))
|
||||
{
|
||||
scriptptrs[i] |= 1;
|
||||
T2 -= j;
|
||||
}
|
||||
if (T5 >= j && T5 < (intptr_t)(&script[g_ScriptSize]))
|
||||
if (T5 >= j && T5 < (intptr_t)(&script[g_scriptSize]))
|
||||
{
|
||||
scriptptrs[i] |= 2;
|
||||
T5 -= j;
|
||||
}
|
||||
if (T6 >= j && T6 < (intptr_t)(&script[g_ScriptSize]))
|
||||
if (T6 >= j && T6 < (intptr_t)(&script[g_scriptSize]))
|
||||
{
|
||||
scriptptrs[i] |= 4;
|
||||
T6 -= j;
|
||||
|
@ -731,7 +731,7 @@ int saveplayer(int spot)
|
|||
}
|
||||
|
||||
dfwrite(&scriptptrs[0],sizeof(scriptptrs),MAXSPRITES,fil);
|
||||
dfwrite(&hittype[0],sizeof(actordata_t),MAXSPRITES,fil);
|
||||
dfwrite(&ActorExtra[0],sizeof(actordata_t),MAXSPRITES,fil);
|
||||
|
||||
for (i=0;i<MAXSPRITES;i++)
|
||||
{
|
||||
|
@ -749,15 +749,15 @@ int saveplayer(int spot)
|
|||
dfwrite(&lockclock,sizeof(lockclock),1,fil);
|
||||
dfwrite(&pskybits,sizeof(pskybits),1,fil);
|
||||
dfwrite(&pskyoff[0],sizeof(pskyoff[0]),MAXPSKYTILES,fil);
|
||||
dfwrite(&animatecnt,sizeof(animatecnt),1,fil);
|
||||
dfwrite(&g_animateCount,sizeof(g_animateCount),1,fil);
|
||||
dfwrite(&animatesect[0],2,MAXANIMATES,fil);
|
||||
for (i = animatecnt-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]-(intptr_t)(§or[0]));
|
||||
for (i = g_animateCount-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]-(intptr_t)(§or[0]));
|
||||
dfwrite(&animateptr[0],4,MAXANIMATES,fil);
|
||||
for (i = animatecnt-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]+(intptr_t)(§or[0]));
|
||||
for (i = g_animateCount-1;i>=0;i--) animateptr[i] = (int *)((intptr_t)animateptr[i]+(intptr_t)(§or[0]));
|
||||
dfwrite(&animategoal[0],4,MAXANIMATES,fil);
|
||||
dfwrite(&animatevel[0],4,MAXANIMATES,fil);
|
||||
|
||||
dfwrite(&earthquaketime,sizeof(earthquaketime),1,fil);
|
||||
dfwrite(&g_earthquakeTime,sizeof(g_earthquakeTime),1,fil);
|
||||
dfwrite(&ud.from_bonus,sizeof(ud.from_bonus),1,fil);
|
||||
dfwrite(&ud.secretlevel,sizeof(ud.secretlevel),1,fil);
|
||||
dfwrite(&ud.respawn_monsters,sizeof(ud.respawn_monsters),1,fil);
|
||||
|
@ -775,50 +775,50 @@ int saveplayer(int spot)
|
|||
dfwrite(&camsprite,sizeof(camsprite),1,fil);
|
||||
dfwrite(&connecthead,sizeof(connecthead),1,fil);
|
||||
dfwrite(connectpoint2,sizeof(connectpoint2),1,fil);
|
||||
dfwrite(&numplayersprites,sizeof(numplayersprites),1,fil);
|
||||
dfwrite(&g_numPlayerSprites,sizeof(g_numPlayerSprites),1,fil);
|
||||
for (i=0;i<MAXPLAYERS;i++)
|
||||
dfwrite((short *)&g_player[i].frags[0],sizeof(g_player[i].frags),1,fil);
|
||||
|
||||
dfwrite(&randomseed,sizeof(randomseed),1,fil);
|
||||
dfwrite(&global_random,sizeof(global_random),1,fil);
|
||||
dfwrite(&g_globalRandom,sizeof(g_globalRandom),1,fil);
|
||||
dfwrite(¶llaxyscale,sizeof(parallaxyscale),1,fil);
|
||||
|
||||
dfwrite(&projectile[0],sizeof(projectile_t),MAXTILES,fil);
|
||||
dfwrite(&defaultprojectile[0],sizeof(projectile_t),MAXTILES,fil);
|
||||
dfwrite(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
||||
dfwrite(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
||||
|
||||
dfwrite(&spriteflags[0],sizeof(spriteflags[0]),MAXTILES,fil);
|
||||
dfwrite(&SpriteFlags[0],sizeof(SpriteFlags[0]),MAXTILES,fil);
|
||||
|
||||
dfwrite(&spritecache[0],sizeof(spritecache[0]),MAXTILES,fil);
|
||||
dfwrite(&SpriteCacheList[0],sizeof(SpriteCacheList[0]),MAXTILES,fil);
|
||||
|
||||
for (i=0;i<MAXQUOTES;i++)
|
||||
{
|
||||
if (fta_quotes[i] != NULL)
|
||||
if (ScriptQuotes[i] != NULL)
|
||||
{
|
||||
dfwrite(&i,sizeof(int),1,fil);
|
||||
dfwrite(fta_quotes[i],MAXQUOTELEN, 1, fil);
|
||||
dfwrite(ScriptQuotes[i],MAXQUOTELEN, 1, fil);
|
||||
}
|
||||
}
|
||||
dfwrite(&i,sizeof(int),1,fil);
|
||||
|
||||
dfwrite(&redefined_quote_count,sizeof(redefined_quote_count),1,fil);
|
||||
for (i=0;i<redefined_quote_count;i++)
|
||||
dfwrite(&g_numQuoteRedefinitions,sizeof(g_numQuoteRedefinitions),1,fil);
|
||||
for (i=0;i<g_numQuoteRedefinitions;i++)
|
||||
{
|
||||
if (redefined_quotes[i] != NULL)
|
||||
dfwrite(redefined_quotes[i],MAXQUOTELEN, 1, fil);
|
||||
if (ScriptQuoteRedefinitions[i] != NULL)
|
||||
dfwrite(ScriptQuoteRedefinitions[i],MAXQUOTELEN, 1, fil);
|
||||
}
|
||||
|
||||
dfwrite(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil);
|
||||
dfwrite(&DynamicTileMap[0],sizeof(DynamicTileMap[0]),MAXTILES,fil);
|
||||
|
||||
dfwrite(&ud.noexits,sizeof(ud.noexits),1,fil);
|
||||
|
||||
SaveGameVars(fil);
|
||||
Gv_WriteSave(fil);
|
||||
|
||||
fclose(fil);
|
||||
|
||||
if (ud.multimode < 2)
|
||||
{
|
||||
strcpy(fta_quotes[122],"GAME SAVED");
|
||||
FTA(122,g_player[myconnectindex].ps);
|
||||
strcpy(ScriptQuotes[122],"GAME SAVED");
|
||||
P_DoQuote(122,g_player[myconnectindex].ps);
|
||||
}
|
||||
|
||||
ready2send = 1;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define LOUDESTVOLUME 150
|
||||
|
||||
int backflag,numenvsnds;
|
||||
int backflag,g_numEnvSoundsPlaying;
|
||||
|
||||
/*
|
||||
===================
|
||||
|
@ -50,7 +50,7 @@ int backflag,numenvsnds;
|
|||
===================
|
||||
*/
|
||||
|
||||
void SoundStartup(void)
|
||||
void S_SoundStartup(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -65,13 +65,13 @@ void SoundStartup(void)
|
|||
{
|
||||
FX_SetReverseStereo(!FX_GetReverseStereo());
|
||||
}
|
||||
status = FX_SetCallBack(testcallback);
|
||||
status = FX_SetCallBack(S_TestSoundCallback);
|
||||
}
|
||||
|
||||
if (status != FX_Ok)
|
||||
{
|
||||
sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString(FX_Error));
|
||||
gameexit(tempbuf);
|
||||
G_GameExit(tempbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ void SoundStartup(void)
|
|||
===================
|
||||
*/
|
||||
|
||||
void SoundShutdown(void)
|
||||
void S_SoundShutdown(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -95,7 +95,7 @@ void SoundShutdown(void)
|
|||
if (status != FX_Ok)
|
||||
{
|
||||
sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString(FX_Error));
|
||||
gameexit(tempbuf);
|
||||
G_GameExit(tempbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ void SoundShutdown(void)
|
|||
===================
|
||||
*/
|
||||
|
||||
void MusicStartup(void)
|
||||
void S_MusicStartup(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -125,7 +125,7 @@ void MusicStartup(void)
|
|||
{
|
||||
initprintf("Couldn't find selected sound card, or, error w/ sound card itself.\n");
|
||||
|
||||
SoundShutdown();
|
||||
S_SoundShutdown();
|
||||
uninittimer();
|
||||
uninitengine();
|
||||
CONTROL_Shutdown();
|
||||
|
@ -145,7 +145,7 @@ void MusicStartup(void)
|
|||
===================
|
||||
*/
|
||||
|
||||
void MusicShutdown(void)
|
||||
void S_MusicShutdown(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -165,11 +165,10 @@ void MusicUpdate(void)
|
|||
MUSIC_Update();
|
||||
}
|
||||
|
||||
unsigned char menunum=0;
|
||||
|
||||
void intomenusounds(void)
|
||||
void S_MenuSound(void)
|
||||
{
|
||||
short menusnds[] =
|
||||
static int SoundNum=0;
|
||||
static short menusnds[] =
|
||||
{
|
||||
LASERTRIP_EXPLODE,
|
||||
DUKE_GRUNT,
|
||||
|
@ -189,8 +188,8 @@ void intomenusounds(void)
|
|||
RPG_SHOOT,
|
||||
SELECT_WEAPON
|
||||
};
|
||||
sound(menusnds[menunum++]);
|
||||
menunum %= 17;
|
||||
S_PlaySound(menusnds[SoundNum++]);
|
||||
SoundNum %= 17;
|
||||
}
|
||||
|
||||
void _playmusic(const char *fn)
|
||||
|
@ -198,7 +197,7 @@ void _playmusic(const char *fn)
|
|||
#if defined(_WIN32)
|
||||
int fp, l;
|
||||
#else
|
||||
extern void PlayMusic(char *_filename);
|
||||
extern void MUSIC_PlayMusic(char *_filename);
|
||||
#endif
|
||||
|
||||
if (fn == NULL) return;
|
||||
|
@ -224,15 +223,15 @@ void _playmusic(const char *fn)
|
|||
#else
|
||||
// FIXME: I need this to get the music volume initialized (not sure why) -- Jim Bentler
|
||||
MUSIC_SetVolume(ud.config.MusicVolume);
|
||||
PlayMusic((char *)fn);
|
||||
MUSIC_PlayMusic((char *)fn);
|
||||
#endif
|
||||
}
|
||||
|
||||
int playmusic(const char *fn, const int sel)
|
||||
int S_PlayMusic(const char *fn, const int sel)
|
||||
{
|
||||
Musicsize=0;
|
||||
if (map[sel].musicfn1 != NULL)
|
||||
_playmusic(map[sel].musicfn1);
|
||||
if (MapInfo[sel].musicfn1 != NULL)
|
||||
_playmusic(MapInfo[sel].musicfn1);
|
||||
if (!Musicsize)
|
||||
{
|
||||
_playmusic(fn);
|
||||
|
@ -241,7 +240,7 @@ int playmusic(const char *fn, const int sel)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int loadsound(unsigned int num)
|
||||
int S_LoadSound(unsigned int num)
|
||||
{
|
||||
int fp = -1, l;
|
||||
|
||||
|
@ -254,13 +253,13 @@ int loadsound(unsigned int num)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (g_sounds[num].filename1)fp = kopen4loadfrommod(g_sounds[num].filename1,loadfromgrouponly);
|
||||
if (fp == -1)fp = kopen4loadfrommod(g_sounds[num].filename,loadfromgrouponly);
|
||||
if (g_sounds[num].filename1)fp = kopen4loadfrommod(g_sounds[num].filename1,g_loadFromGroupOnly);
|
||||
if (fp == -1)fp = kopen4loadfrommod(g_sounds[num].filename,g_loadFromGroupOnly);
|
||||
if (fp == -1)
|
||||
{
|
||||
// Bsprintf(fta_quotes[113],"g_sounds %s(#%d) not found.",sounds[num],num);
|
||||
// FTA(113,g_player[myconnectindex].ps);
|
||||
OSD_Printf(OSDTEXT_RED "Sound %s(#%d) not found.\n",g_sounds[num].filename,num);
|
||||
// Bsprintf(ScriptQuotes[113],"g_sounds %s(#%d) not found.",sounds[num],num);
|
||||
// P_DoQuote(113,g_player[myconnectindex].ps);
|
||||
OSD_Printf(OSDTEXT_RED "Sound %s(#%d) not found!\n",g_sounds[num].filename,num);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -275,7 +274,7 @@ int loadsound(unsigned int num)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int xyzsound(int num,int i,int x,int y,int z)
|
||||
int S_PlaySoundXYZ(int num,int i,int x,int y,int z)
|
||||
{
|
||||
int sndist, cx, cy, cz, j,k;
|
||||
int pitche,pitchs,cs;
|
||||
|
@ -294,7 +293,7 @@ int xyzsound(int num,int i,int x,int y,int z)
|
|||
|
||||
if (g_sounds[num].m&128)
|
||||
{
|
||||
sound(num);
|
||||
S_PlaySound(num);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -363,9 +362,9 @@ int xyzsound(int num,int i,int x,int y,int z)
|
|||
|
||||
if (g_sounds[num].num > 0 && PN != MUSICANDSFX)
|
||||
{
|
||||
if (g_sounds[num].SoundOwner[0].i == i) stopsound(num);
|
||||
else if (g_sounds[num].num > 1) stopsound(num);
|
||||
else if (badguy(&sprite[i]) && sprite[i].extra <= 0) stopsound(num);
|
||||
if (g_sounds[num].SoundOwner[0].i == i) S_StopSound(num);
|
||||
else if (g_sounds[num].num > 1) S_StopSound(num);
|
||||
else if (A_CheckEnemySprite(&sprite[i]) && sprite[i].extra <= 0) S_StopSound(num);
|
||||
}
|
||||
|
||||
if (PN == APLAYER && sprite[i].yvel == screenpeek)
|
||||
|
@ -381,7 +380,7 @@ int xyzsound(int num,int i,int x,int y,int z)
|
|||
|
||||
if (g_sounds[num].ptr == 0)
|
||||
{
|
||||
if (loadsound(num) == 0) return 0;
|
||||
if (S_LoadSound(num) == 0) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -435,7 +434,7 @@ int xyzsound(int num,int i,int x,int y,int z)
|
|||
return (voice);
|
||||
}
|
||||
|
||||
void sound(int num)
|
||||
void S_PlaySound(int num)
|
||||
{
|
||||
int pitch,pitche,pitchs,cx;
|
||||
int voice;
|
||||
|
@ -466,7 +465,7 @@ void sound(int num)
|
|||
|
||||
if (g_sounds[num].ptr == 0)
|
||||
{
|
||||
if (loadsound(num) == 0) return;
|
||||
if (S_LoadSound(num) == 0) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -512,34 +511,34 @@ void sound(int num)
|
|||
g_sounds[num].lock--;
|
||||
}
|
||||
|
||||
int spritesound(unsigned int num, int i)
|
||||
int A_PlaySound(unsigned int num, int i)
|
||||
{
|
||||
if (num >= MAXSOUNDS) return -1;
|
||||
if (i < 0)
|
||||
{
|
||||
sound(num);
|
||||
S_PlaySound(num);
|
||||
return 0;
|
||||
}
|
||||
return xyzsound(num,i,SX,SY,SZ);
|
||||
return S_PlaySoundXYZ(num,i,SX,SY,SZ);
|
||||
}
|
||||
|
||||
void stopspritesound(int num, int i)
|
||||
void A_StopSound(int num, int i)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(i);
|
||||
if (num >= 0 && num < MAXSOUNDS) stopsound(num);
|
||||
if (num >= 0 && num < MAXSOUNDS) S_StopSound(num);
|
||||
}
|
||||
|
||||
void stopsound(int num)
|
||||
void S_StopSound(int num)
|
||||
{
|
||||
if (num >= 0 && num < MAXSOUNDS)
|
||||
if (g_sounds[num].num > 0)
|
||||
{
|
||||
FX_StopSound(g_sounds[num].SoundOwner[g_sounds[num].num-1].voice);
|
||||
testcallback(num);
|
||||
S_TestSoundCallback(num);
|
||||
}
|
||||
}
|
||||
|
||||
void stopenvsound(int num,int i)
|
||||
void S_StopEnvSound(int num,int i)
|
||||
{
|
||||
int j, k;
|
||||
|
||||
|
@ -561,7 +560,7 @@ void pan3dsound(void)
|
|||
int sndist, sx, sy, sz, cx, cy, cz;
|
||||
int sndang,ca,j,k,i,cs;
|
||||
|
||||
numenvsnds = 0;
|
||||
g_numEnvSoundsPlaying = 0;
|
||||
|
||||
if (ud.camerasprite == -1)
|
||||
{
|
||||
|
@ -609,7 +608,7 @@ void pan3dsound(void)
|
|||
sndist += sndist>>5;
|
||||
|
||||
if (PN == MUSICANDSFX && SLT < 999)
|
||||
numenvsnds++;
|
||||
g_numEnvSoundsPlaying++;
|
||||
|
||||
switch (j)
|
||||
{
|
||||
|
@ -621,12 +620,12 @@ void pan3dsound(void)
|
|||
default:
|
||||
if (sndist > 31444 && PN != MUSICANDSFX)
|
||||
{
|
||||
stopsound(j);
|
||||
S_StopSound(j);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_sounds[j].ptr == 0 && loadsound(j) == 0) continue;
|
||||
if (g_sounds[j].ptr == 0 && S_LoadSound(j) == 0) continue;
|
||||
if (g_sounds[j].m&16) sndist = 0;
|
||||
|
||||
if (sndist < ((255-LOUDESTVOLUME)<<6))
|
||||
|
@ -636,7 +635,7 @@ void pan3dsound(void)
|
|||
}
|
||||
}
|
||||
|
||||
void testcallback(unsigned int num)
|
||||
void S_TestSoundCallback(unsigned int num)
|
||||
{
|
||||
int tempi,tempj,tempk;
|
||||
|
||||
|
@ -657,7 +656,7 @@ void testcallback(unsigned int num)
|
|||
tempi = g_sounds[num].SoundOwner[tempj].i;
|
||||
if (sprite[tempi].picnum == MUSICANDSFX && sector[sprite[tempi].sectnum].lotag < 3 && sprite[tempi].lotag < 999)
|
||||
{
|
||||
hittype[tempi].temp_data[0] = 0;
|
||||
ActorExtra[tempi].temp_data[0] = 0;
|
||||
if ((tempj + 1) < tempk)
|
||||
{
|
||||
g_sounds[num].SoundOwner[tempj].voice = g_sounds[num].SoundOwner[tempk-1].voice;
|
||||
|
@ -674,7 +673,7 @@ void testcallback(unsigned int num)
|
|||
g_sounds[num].lock--;
|
||||
}
|
||||
|
||||
void clearsoundlocks(void)
|
||||
void S_ClearSoundLocks(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -687,14 +686,14 @@ void clearsoundlocks(void)
|
|||
lumplockbyte[i] = 199;
|
||||
}
|
||||
|
||||
int isspritemakingsound(int i, int num)
|
||||
int A_CheckSoundPlaying(int i, int num)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(i);
|
||||
if (num < 0) num=0; // FIXME
|
||||
return (g_sounds[num].num > 0);
|
||||
}
|
||||
|
||||
int issoundplaying(int i, int num)
|
||||
int S_CheckSoundPlaying(int i, int num)
|
||||
{
|
||||
if (i == -1)
|
||||
{
|
||||
|
|
|
@ -31,10 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifndef _sounds_public_
|
||||
#define _sounds_public_
|
||||
|
||||
void SoundStartup( void );
|
||||
void SoundShutdown( void );
|
||||
void MusicStartup( void );
|
||||
void MusicShutdown( void );
|
||||
void S_SoundStartup( void );
|
||||
void S_SoundShutdown( void );
|
||||
void S_MusicStartup( void );
|
||||
void S_MusicShutdown( void );
|
||||
void AudioUpdate(void);
|
||||
|
||||
struct audioenumdev {
|
||||
|
|
|
@ -351,7 +351,7 @@ static GtkWidget *create_window(void)
|
|||
GDK_F, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// 3D video mode label
|
||||
// 3D video mode LabelText
|
||||
vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:");
|
||||
gtk_widget_show(vmode3dlabel);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), vmode3dlabel, 0, 0);
|
||||
|
@ -432,7 +432,7 @@ static GtkWidget *create_window(void)
|
|||
gtk_container_add(GTK_CONTAINER(tabs), gamevlayout);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(gamevlayout), 4);
|
||||
|
||||
// Game data field label
|
||||
// Game data field LabelText
|
||||
gamelabel = gtk_label_new_with_mnemonic("_Game or addon:");
|
||||
gtk_widget_show(gamelabel);
|
||||
gtk_box_pack_start(GTK_BOX(gamevlayout), gamelabel, FALSE, FALSE, 0);
|
||||
|
@ -759,7 +759,7 @@ int startwin_run(void)
|
|||
settings.forcesetup = ud.config.ForceSetup;
|
||||
settings.usemouse = ud.config.UseMouse;
|
||||
settings.usejoy = ud.config.UseJoystick;
|
||||
settings.game = g_GameType;
|
||||
settings.game = g_gameType;
|
||||
strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
|
||||
PopulateForm(-1);
|
||||
|
||||
|
@ -778,7 +778,7 @@ int startwin_run(void)
|
|||
ud.config.UseMouse = settings.usemouse;
|
||||
ud.config.UseJoystick = settings.usejoy;
|
||||
duke3dgrp = settings.selectedgrp;
|
||||
g_GameType = settings.game;
|
||||
g_gameType = settings.game;
|
||||
|
||||
for (i = 0; i<numgrpfiles; i++) if (settings.crcval == grpfiles[i].crcval) break;
|
||||
if (i != numgrpfiles)
|
||||
|
|
|
@ -77,7 +77,7 @@ static int getfilenames(char *path)
|
|||
extern char TEXCACHEDIR[];
|
||||
#endif
|
||||
|
||||
extern int g_NoSetup;
|
||||
extern int g_noSetup;
|
||||
|
||||
static void PopulateForm(int pgs)
|
||||
{
|
||||
|
@ -632,7 +632,7 @@ int startwin_run(void)
|
|||
settings.forcesetup = ud.config.ForceSetup;
|
||||
settings.usemouse = ud.config.UseMouse;
|
||||
settings.usejoy = ud.config.UseJoystick;
|
||||
settings.game = g_GameType;
|
||||
settings.game = g_gameType;
|
||||
// settings.crcval = 0;
|
||||
strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
|
||||
settings.gamedir = mod_dir;
|
||||
|
@ -669,9 +669,9 @@ int startwin_run(void)
|
|||
ud.config.UseMouse = settings.usemouse;
|
||||
ud.config.UseJoystick = settings.usejoy;
|
||||
duke3dgrp = settings.selectedgrp;
|
||||
g_GameType = settings.game;
|
||||
g_gameType = settings.game;
|
||||
|
||||
if (g_NoSetup == 0 && settings.gamedir != NULL)
|
||||
if (g_noSetup == 0 && settings.gamedir != NULL)
|
||||
Bstrcpy(mod_dir,settings.gamedir);
|
||||
else Bsprintf(mod_dir,"/");
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
int NumSyncBytes = 1;
|
||||
int NumSyncBytes = 6;
|
||||
char sync_first[MAXSYNCBYTES][60];
|
||||
int sync_found = 0;
|
||||
|
||||
|
@ -54,9 +54,9 @@ char PlayerSync(void)
|
|||
{
|
||||
short i;
|
||||
unsigned short crc = 0;
|
||||
player_struct *pp;
|
||||
DukePlayer_t *pp;
|
||||
|
||||
for (i = connecthead; i >= 0; i = connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
pp = g_player[i].ps;
|
||||
updatecrc(crc, pp->posx & 255);
|
||||
|
@ -70,11 +70,13 @@ char PlayerSync(void)
|
|||
|
||||
char PlayerSync2(void)
|
||||
{
|
||||
short i;
|
||||
int i;
|
||||
int j, nextj;
|
||||
unsigned short crc = 0;
|
||||
player_struct *pp;
|
||||
DukePlayer_t *pp;
|
||||
spritetype *spr;
|
||||
|
||||
for (i = connecthead; i >= 0; i = connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
pp = g_player[i].ps;
|
||||
|
||||
|
@ -83,40 +85,7 @@ char PlayerSync2(void)
|
|||
updatecrc(crc, pp->bobcounter & 255);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
/*
|
||||
char SOSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
SECTOR_OBJECTp sop;
|
||||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
// if (sop->xmid == MAXLONG)
|
||||
// continue;
|
||||
|
||||
updatecrc(crc, (sop->xmid) & 255);
|
||||
updatecrc(crc, (sop->ymid) & 255);
|
||||
updatecrc(crc, (sop->zmid) & 255);
|
||||
updatecrc(crc, (sop->vel) & 255);
|
||||
updatecrc(crc, (sop->ang) & 255);
|
||||
updatecrc(crc, (sop->ang_moving) & 255);
|
||||
updatecrc(crc, (sop->spin_ang) & 255);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
|
||||
char EnemySync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
short j, nextj;
|
||||
spritetype *spr;
|
||||
extern char DemoTmpName[];
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ENEMY], j, nextj)
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PLAYER], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
|
@ -128,13 +97,44 @@ char EnemySync(void)
|
|||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
char MissileSync(void)
|
||||
char ActorSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
short j, nextj;
|
||||
int j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_MISSILE], j, nextj)
|
||||
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 ((char) crc & 255);
|
||||
}
|
||||
|
||||
char WeaponSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
int j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PROJECTILE], j, nextj)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
|
@ -146,107 +146,70 @@ char MissileSync(void)
|
|||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
char MissileSkip4Sync(void)
|
||||
char MapSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
short j, nextj;
|
||||
int j, nextj;
|
||||
spritetype *spr;
|
||||
walltype *wal;
|
||||
sectortype *sect;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_MISSILE_SKIP4], j, nextj)
|
||||
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);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
char ShrapSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
short j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_SHRAP], j, nextj)
|
||||
for (j=numwalls;j>=0;j--)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
wal = &wall[j];
|
||||
updatecrc(crc, (wal->x) & 255);
|
||||
updatecrc(crc, (wal->y) & 255);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
char MiscSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
short j, nextj;
|
||||
spritetype *spr;
|
||||
|
||||
TRAVERSE_SPRITE_STAT(headspritestat[STAT_MISC], j, nextj)
|
||||
for (j=numsectors;j>=0;j--)
|
||||
{
|
||||
spr = &sprite[j];
|
||||
updatecrc(crc, (spr->x) & 255);
|
||||
updatecrc(crc, (spr->y) & 255);
|
||||
updatecrc(crc, (spr->z) & 255);
|
||||
updatecrc(crc, (spr->ang) & 255);
|
||||
sect = §or[j];
|
||||
updatecrc(crc, (sect->floorz) & 255);
|
||||
updatecrc(crc, (sect->ceilingz) & 255);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
*/
|
||||
|
||||
char RandomSync(void)
|
||||
{
|
||||
unsigned short crc = 0;
|
||||
|
||||
updatecrc(crc, randomseed & 255);
|
||||
updatecrc(crc, (randomseed >> 8) & 255);
|
||||
updatecrc(crc, g_globalRandom & 255);
|
||||
updatecrc(crc, (g_globalRandom >> 8) & 255);
|
||||
|
||||
if (NumSyncBytes == 1)
|
||||
{
|
||||
updatecrc(crc,PlayerSync() & 255);
|
||||
updatecrc(crc,PlayerSync2() & 255);
|
||||
// updatecrc(crc,WeaponSync() & 255);
|
||||
updatecrc(crc,WeaponSync() & 255);
|
||||
updatecrc(crc,ActorSync() & 255);
|
||||
}
|
||||
|
||||
return ((char) crc & 255);
|
||||
}
|
||||
|
||||
/*
|
||||
movefta(); //ST 2
|
||||
moveweapons(); //ST 4
|
||||
movetransports(); //ST 9
|
||||
|
||||
moveplayers(); //ST 10
|
||||
movefallers(); //ST 12
|
||||
moveexplosions(); //ST 5
|
||||
|
||||
moveactors(); //ST 1
|
||||
moveeffectors(); //ST 3
|
||||
|
||||
movestandables(); //ST 6
|
||||
movefx(); //ST 11
|
||||
*/
|
||||
|
||||
char *SyncNames[] =
|
||||
{
|
||||
"RandomSync",
|
||||
"PlayerSync",
|
||||
"PlayerSync2",
|
||||
/* "FTASync",
|
||||
"WeaponSync",
|
||||
"TransportSync",
|
||||
"FallerSync",
|
||||
"ExplosionSync",
|
||||
"ActorSync",
|
||||
"EffectorSync",
|
||||
"StandableSync",
|
||||
"FXSync", */
|
||||
"Net_CheckRandomSync",
|
||||
"Net_CheckPlayerSync",
|
||||
"Net_CheckPlayerSync2",
|
||||
"Net_CheckWeaponSync",
|
||||
"Net_CheckActorSync",
|
||||
"Net_CheckMapSync",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -255,15 +218,9 @@ static char(*SyncFunc[MAXSYNCBYTES + 1])(void) =
|
|||
RandomSync,
|
||||
PlayerSync,
|
||||
PlayerSync2,
|
||||
/* FTASync,
|
||||
WeaponSync,
|
||||
TransportSync,
|
||||
FallerSync,
|
||||
ExplosionSync,
|
||||
ActorSync,
|
||||
EffectorSync,
|
||||
StandableSync,
|
||||
FXSync, */
|
||||
WeaponSync,
|
||||
ActorSync,
|
||||
MapSync,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -299,7 +256,7 @@ void SyncStatMessage(void)
|
|||
{
|
||||
int i, j;
|
||||
static unsigned int MoveCount = 0;
|
||||
extern unsigned int MoveThingsCount;
|
||||
extern unsigned int g_moveThingsCount;
|
||||
|
||||
// if (!SyncPrintMode)
|
||||
// return;
|
||||
|
@ -314,8 +271,8 @@ void SyncStatMessage(void)
|
|||
{
|
||||
if (NumSyncBytes > 1)
|
||||
{
|
||||
sprintf(tempbuf, "GAME OUT OF SYNC - %s", SyncNames[i]);
|
||||
printext256(68L, 68L + (i * 8), 1, 31, tempbuf, 0);
|
||||
sprintf(tempbuf, "Out Of Sync - %s", SyncNames[i]);
|
||||
printext256(4L, 100L + (i * 8), 31, 1, tempbuf, 0);
|
||||
}
|
||||
|
||||
if (!sync_found && sync_first[i][0] == '\0')
|
||||
|
@ -324,13 +281,13 @@ void SyncStatMessage(void)
|
|||
sync_found = TRUE;
|
||||
|
||||
// save off loop count
|
||||
MoveCount = MoveThingsCount;
|
||||
MoveCount = g_moveThingsCount;
|
||||
|
||||
for (j = 0; j < NumSyncBytes; j++)
|
||||
{
|
||||
if (syncstat[j] != 0 && sync_first[j][0] == '\0')
|
||||
{
|
||||
sprintf(tempbuf, "OUT OF SYNC - %s", SyncNames[j]);
|
||||
sprintf(tempbuf, "Out Of Sync - %s", SyncNames[j]);
|
||||
strcpy(sync_first[j], tempbuf);
|
||||
}
|
||||
}
|
||||
|
@ -346,24 +303,13 @@ void SyncStatMessage(void)
|
|||
if (NumSyncBytes > 1)
|
||||
{
|
||||
sprintf(tempbuf, "FIRST %s", sync_first[i]);
|
||||
printext256(50L, 0L, 1, 31, tempbuf, 0);
|
||||
printext256(4L, 44L + (i * 8), 31, 1, tempbuf, 0);
|
||||
sprintf(tempbuf, "MoveCount %d",MoveCount);
|
||||
printext256(50L, 10L, 1, 31, tempbuf, 0);
|
||||
printext256(4L, 52L + (i * 8), 31, 1, tempbuf, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// short w,h;
|
||||
// production out of sync error
|
||||
|
||||
// sprintf(tempbuf,"GAME OUT OF SYNC!");
|
||||
// MNU_MeasureString(tempbuf, &w, &h);
|
||||
// MNU_DrawString(TEXT_TEST_COL(w), 20, tempbuf, 0, 19);
|
||||
|
||||
// sprintf(tempbuf,"Restart the game.");
|
||||
// MNU_MeasureString(tempbuf, &w, &h);
|
||||
// MNU_DrawString(TEXT_TEST_COL(w), 30, tempbuf, 0, 19);
|
||||
printext256(4L,130L,31,0,"Out Of Sync - Please restart game",0);
|
||||
printext256(4L,138L,31,0,"RUN DN3DHELP.EXE for information.",0);
|
||||
printext256(4L,100L,31,0,"Out Of Sync - Please restart game",0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -406,7 +352,7 @@ void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconn
|
|||
// Suspect that its trying to traverse the connect list
|
||||
// for a player that does not exist. This tries to take care of that
|
||||
|
||||
for (i=connecthead;i>=0;i=connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (otherconnectindex == i)
|
||||
found = 1;
|
||||
|
@ -428,7 +374,7 @@ void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconn
|
|||
|
||||
// update syncstat
|
||||
// if any of the syncstat vars is non-0 then there is a problem
|
||||
for (i=connecthead;i>=0;i=connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (g_player[i].syncvalhead == syncvaltottail)
|
||||
return;
|
||||
|
@ -452,7 +398,7 @@ void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconn
|
|||
|
||||
syncvaltottail++;
|
||||
|
||||
for (i=connecthead;i>=0;i=connectpoint2[i])
|
||||
TRAVERSE_CONNECT(i)
|
||||
{
|
||||
if (g_player[i].syncvalhead == syncvaltottail)
|
||||
return;
|
||||
|
|
|
@ -65,13 +65,13 @@ int Win_MsgBox(char *name, char *fmt, ...)
|
|||
|
||||
|
||||
// this replaces the Error() function in jmact/util_lib.c
|
||||
extern void Shutdown(void); // game.c
|
||||
extern void G_Shutdown(void); // game.c
|
||||
void Error(char *error, ...)
|
||||
{
|
||||
char buf[1000];
|
||||
va_list va;
|
||||
|
||||
Shutdown();
|
||||
G_Shutdown();
|
||||
|
||||
if (error)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue