mostly multiplayer fixes among other things

git-svn-id: https://svn.eduke32.com/eduke32@1672 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2010-07-19 15:14:00 +00:00
parent 2335302486
commit 1102b74a35
28 changed files with 315 additions and 548 deletions

View file

@ -98,8 +98,7 @@ else
EOBJ=eobj
endif
JMACTOBJ=$(OBJ)/util_lib.$o \
$(OBJ)/file_lib.$o \
JMACTOBJ=$(OBJ)/file_lib.$o \
$(OBJ)/control.$o \
$(OBJ)/keyboard.$o \
$(OBJ)/mouse.$o \

View file

@ -1,4 +1,4 @@
duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(JAUDIOLIBDIR)/include/fx_man.h $(JAUDIOLIBDIR)/include/music.h $(INC)/namesdyn.h $(INC)/funct.h $(INC)/duke3d.h
duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(JAUDIOLIBDIR)/include/fx_man.h $(JAUDIOLIBDIR)/include/music.h $(INC)/namesdyn.h $(INC)/funct.h $(INC)/duke3d.h
gamedef_h=$(SRC)/gamedef.h
$(OBJ)/game.$o: $(SRC)/game.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h
@ -36,14 +36,13 @@ $(OBJ)/startgtk.game.$o: $(SRC)/startgtk.game.c $(duke3d_h) $(EINC)/dynamicgtk.h
# jMACT objects
$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/util_lib.h $(SRC)/jmact/animlib.h $(EINC)/compat.h
$(OBJ)/util_lib.$o: $(SRC)/jmact/util_lib.c $(SRC)/jmact/util_lib.h $(EINC)/compat.h
$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/animlib.h $(EINC)/compat.h
$(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h
$(OBJ)/control.$o: $(SRC)/jmact/control.c $(SRC)/jmact/control.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
$(OBJ)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/keyboard.h $(EINC)/compat.h $(EINC)/baselayer.h
$(OBJ)/mouse.$o: $(SRC)/jmact/mouse.c $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
$(OBJ)/mathutil.$o: $(SRC)/jmact/mathutil.c
$(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/_scrplib.h $(EINC)/compat.h
$(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/_scrplib.h $(EINC)/compat.h
# jAudioLib objects

View file

@ -60,8 +60,7 @@ LIBS=$(LIBS) msvcrtd.lib
LIBS=$(LIBS) msvcrt.lib msvcrt_winxp.obj
!endif
JMACTOBJ=$(OBJ)\util_lib.$o \
$(OBJ)\file_lib.$o \
JMACTOBJ=$(OBJ)\file_lib.$o \
$(OBJ)\control.$o \
$(OBJ)\keyboard.$o \
$(OBJ)\mouse.$o \

View file

@ -151,8 +151,8 @@ int32_t loadsetup(const char *fn)
if (readconfig(fp, "rendmode", val, VL) > 0) { i = Batoi(val); glrendmode = i; }
#endif
if (readconfig(fp, "vid_gamma", val, VL) > 0) vid_gamma = Bstrtod(val, NULL);
if (readconfig(fp, "vid_brightness", val, VL) > 0) vid_brightness = Bstrtod(val, NULL);
if (readconfig(fp, "vid_contrast", val, VL) > 0) vid_contrast = Bstrtod(val, NULL);
if (readconfig(fp, "vid_brightness", val, VL) > 0) vid_brightness = Bstrtod(val, NULL);
if (readconfig(fp, "vid_contrast", val, VL) > 0) vid_contrast = Bstrtod(val, NULL);
#ifdef RENDERTYPEWIN
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val);
#endif
@ -352,9 +352,9 @@ int32_t writesetup(const char *fn)
"\n"
#endif
"; 3D mode brightness setting\n"
"vid_gamma = %f\n"
"vid_brightness = %f\n"
"vid_contrast = %f\n"
"vid_gamma = %g\n"
"vid_brightness = %g\n"
"vid_contrast = %g\n"
"\n"
"; Game executable used for map testing\n"
"gameexecutable = %s\n"

View file

@ -152,7 +152,6 @@
<ClInclude Include="source\jmact\mathutil.h" />
<ClInclude Include="source\jmact\mouse.h" />
<ClInclude Include="source\jmact\scriplib.h" />
<ClInclude Include="source\jmact\util_lib.h" />
<ClInclude Include="source\enet\include\enet\callbacks.h" />
<ClInclude Include="source\enet\include\enet\enet.h" />
<ClInclude Include="source\enet\include\enet\list.h" />
@ -248,7 +247,6 @@
<ClCompile Include="source\jmact\mathutil.c" />
<ClCompile Include="source\jmact\mouse.c" />
<ClCompile Include="source\jmact\scriplib.c" />
<ClCompile Include="source\jmact\util_lib.c" />
<ClCompile Include="source\enet\src\callbacks.c" />
<ClCompile Include="source\enet\src\host.c" />
<ClCompile Include="source\enet\src\list.c" />

View file

@ -279,9 +279,6 @@
<ClInclude Include="source\jmact\scriplib.h">
<Filter>jmact\headers</Filter>
</ClInclude>
<ClInclude Include="source\jmact\util_lib.h">
<Filter>jmact\headers</Filter>
</ClInclude>
<ClInclude Include="source\enet\include\enet\callbacks.h">
<Filter>enet\headers</Filter>
</ClInclude>
@ -569,9 +566,6 @@
<ClCompile Include="source\jmact\scriplib.c">
<Filter>jmact\source</Filter>
</ClCompile>
<ClCompile Include="source\jmact\util_lib.c">
<Filter>jmact\source</Filter>
</ClCompile>
<ClCompile Include="source\enet\src\callbacks.c">
<Filter>enet\source</Filter>
</ClCompile>

View file

@ -9321,29 +9321,6 @@ static void Keys2d3d(void)
if (getmessageleng > 0)
{
// charsperline = 64;
//if (dimensionmode[snum] == 2) charsperline = 80;
/* if (qsetmode == 200)
{
for (i=0;i<=getmessageleng;i+=charsperline)
{
for (j=0;j<charsperline;j++)
tempbuf[j] = getmessage[i+j];
if (getmessageleng < i+charsperline)
tempbuf[(getmessageleng-i)] = 0;
else
tempbuf[charsperline] = 0;
begindrawing();
if (tempbuf[charsperline] != 0)
{
printext256((MESSAGEX*(xdimgame/320.))+2,(MESSAGEY*(ydimgame/200.))+2,0,-1,tempbuf,xdimgame>640?0:1);
printext256(MESSAGEX*(xdimgame/320.),MESSAGEY*(ydimgame/200.),
(totalclock > (lastmessagetime + 120*5))?whitecol:256-5,-1,tempbuf,xdimgame>640?0:1);
}
enddrawing();
}
}
else */
if (qsetmode != 200)
printmessage16(getmessage);
if (totalclock > getmessagetimeoff)
@ -9463,16 +9440,7 @@ void ExtCheckKeys(void)
void faketimerhandler(void)
{
int32_t i, dist, angdiff;
int32_t hiz, hihit, loz, lohit, oposx, oposy;
int16_t hitwall, daang;
// counter++;
// if (counter>=5) counter=0;
sampletimer();
// if (totalclock < ototalclock+TICSPERFRAME || qsetmode != 200)
// return;
}
void SetBOSS1Palette(void)

View file

@ -110,7 +110,6 @@ extern int32_t g_scriptVersion, g_Shareware, g_gameType;
#include "file_lib.h"
#include "gamedefs.h"
#include "keyboard.h"
#include "util_lib.h"
#include "mathutil.h"
#include "function.h"
#include "fx_man.h"
@ -594,7 +593,7 @@ extern int32_t animatevel[MAXANIMATES];
extern int16_t neartagsector, neartagwall, neartagsprite;
extern int32_t neartaghitdist;
extern int16_t animatesect[MAXANIMATES];
extern int32_t movefifoplc, vel,svel,angvel,horiz;
extern int32_t vel,svel,angvel,horiz;
extern int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
@ -650,10 +649,6 @@ extern vec3_t my, omy, myvel;
extern int16_t myhoriz, omyhoriz, myhorizoff, omyhorizoff, g_skillSoundID;
extern int16_t myang, omyang, mycursectnum, myjumpingcounter;
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
extern int32_t predictfifoplc;
extern int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
extern int32_t myhorizbak[MOVEFIFOSIZ];
extern int16_t myangbak[MOVEFIFOSIZ];
extern int16_t BlimpSpawnSprites[15];
@ -670,40 +665,26 @@ typedef struct {
#pragma pack(push,1)
extern DukeStatus_t sbar;
extern int32_t g_cameraDistance, g_cameraClock, g_playerFriction,g_showShareware;
extern int32_t g_cameraDistance, g_cameraClock, g_playerFriction, g_showShareware;
extern int32_t g_gameQuit;
extern int32_t playerswhenstarted;
extern int8_t multiwho, multipos, multiwhat, multiflag;
extern char pus,pub;
extern int32_t 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.
#define MAXSYNCBYTES 16
#define SYNCFIFOSIZ 1024
extern char syncstat[MAXSYNCBYTES];
extern int8_t multiwho, multipos, multiwhat, multiflag;
extern int32_t syncvaltail, syncvaltottail;
extern int32_t g_numFreezeBounces,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius;
extern int32_t g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
extern int32_t everyothertime;
extern int32_t mymaxlag, otherminlag, bufferjitter;
extern int32_t g_numInterpolations, startofdynamicinterpolations;
extern int32_t g_interpolationLock;
extern int32_t oldipos[MAXINTERPOLATIONS];
extern int32_t bakipos[MAXINTERPOLATIONS];
extern int32_t *curipos[MAXINTERPOLATIONS];
extern int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
extern int32_t cloudtotalclock,totalmemory;
extern int32_t stereomode, stereowidth, stereopixelwidth;
extern int32_t cloudtotalclock;
extern int32_t g_myAimMode, g_myAimStat, g_oldAimStat;
extern uint32_t g_moveThingsCount;
#define IFISGLMODE if (getrendermode() >= 3)
@ -1060,14 +1041,13 @@ typedef struct {
DukePlayer_t *ps;
input_t *sync;
int32_t movefifoend, syncvalhead;
int32_t netsynctime;
int16_t ping, filler;
int32_t pcolor, pteam;
uint8_t frags[MAXPLAYERS], wchoice[MAX_WEAPONS];
char vote, gotvote, playerreadyflag, playerquitflag;
char user_name[32];
char syncval[SYNCFIFOSIZ][MAXSYNCBYTES];
} playerdata_t;
extern input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];

View file

@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gamedef.h"
#include "kplib.h"
#include "crc32.h"
#include "util_lib.h"
#include "hightile.h"
#include "control.h"
@ -59,6 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#ifdef _WIN32
#include "winlayer.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
@ -83,7 +83,9 @@ int32_t g_netDisconnect = 0;
int8_t g_netStatnums[] = { STAT_PROJECTILE, STAT_STANDABLE, STAT_ACTIVATOR, STAT_TRANSPORT,
STAT_EFFECTOR, STAT_ACTOR, STAT_ZOMBIEACTOR, STAT_MISC };
char g_netPassword[32];
int32_t g_netSync = 0;
int32_t g_quitDeadline = 0;
int32_t g_netPlayersWaiting = 0;
int32_t g_scriptSanityChecks = 1;
@ -822,7 +824,7 @@ void Net_NewGame(int32_t volume, int32_t level)
static mapstate_t *g_multiMapState = NULL;
static int32_t spritecrc[MAXSPRITES], lastupdate[MAXSPRITES], sectcrc[MAXSECTORS], lastsectupdate[MAXSECTORS];
static int32_t wallcrc[MAXWALLS], lastwallupdate[MAXWALLS];
static int32_t peractorvals[MAXGAMEVARS][MAXSPRITES], perplayervals[MAXGAMEVARS][MAXPLAYERS];
static int32_t peractorvals[MAXSPRITES][MAXGAMEVARS], perplayervals[MAXPLAYERS][MAXGAMEVARS];
// sends a simple crc32 of the current password, verified by the server before the connection can continue
static void Net_SendChallenge(void)
@ -891,24 +893,23 @@ void Net_SyncPlayer(ENetEvent * event)
{
int32_t i, j;
g_netPlayersWaiting++;
S_PlaySound(DUKE_GETWEAPON2);
TRAVERSE_CONNECT(i)
if (!g_player[i].playerquitflag)
if (g_player[i].playerquitflag == 0)
break;
// open a new slot if necessary
event->peer->data = (void *)((intptr_t) (i = (i == -1 ? playerswhenstarted++ : i)));
clearbufbyte(&g_player[i].playerquitflag,1,0x01010101);
g_player[i].movefifoend = 1;
g_player[i].netsynctime = totalclock;
g_player[i].playerquitflag = 1;
for (j=0; j<playerswhenstarted-1; j++) connectpoint2[j] = j+1;
connectpoint2[playerswhenstarted-1] = -1;
numplayers++;
ud.multimode++;
TRAVERSE_CONNECT(j)
{
if (!g_player[j].ps) g_player[j].ps = (DukePlayer_t *) Bcalloc(1, sizeof(DukePlayer_t));
@ -916,9 +917,9 @@ void Net_SyncPlayer(ENetEvent * event)
}
packbuf[0] = PACKET_NUM_PLAYERS;
packbuf[1] = numplayers;
packbuf[1] = ++numplayers;
packbuf[2] = playerswhenstarted;
packbuf[3] = ud.multimode;
packbuf[3] = ++ud.multimode;
packbuf[4] = i;
packbuf[5] = myconnectindex;
enet_host_broadcast(g_netServer, CHAN_GAMESTATE, enet_packet_create(packbuf, 6, ENET_PACKET_FLAG_RELIABLE));
@ -936,23 +937,11 @@ void Net_SyncPlayer(ENetEvent * event)
if (g_multiMapState == NULL) g_multiMapState = Bcalloc(1, sizeof(mapstate_t));
if (g_multiMapState)
{
char * buf = Bmalloc(sizeof(mapstate_t)<<1);
char * buf = (char *)Bmalloc(sizeof(mapstate_t)<<1);
j = g_player[i].ps->i;
Bmemcpy(g_player[i].ps, g_player[0].ps, sizeof(DukePlayer_t));
g_player[i].ps->i = j;
changespritestat(j, STAT_PLAYER);
P_ResetStatus(i);
P_ResetWeapons(i);
P_ResetInventory(i);
g_player[i].ps->last_extra = g_player[i].ps->max_player_health;
sprite[g_player[i].ps->i].extra = g_player[i].ps->max_player_health;
sprite[g_player[i].ps->i].cstat = 1+256;
sprite[g_player[i].ps->i].cstat = 32768;
g_player[i].ps->runspeed = g_playerFriction;
g_player[i].ps->frag_ps = i;
g_player[i].ps->last_extra = sprite[g_player[i].ps->i].extra = g_player[i].ps->max_player_health;
G_SaveMapState(g_multiMapState);
j = qlz_compress((char *)g_multiMapState, buf, sizeof(mapstate_t), state_compress);
@ -964,9 +953,11 @@ void Net_SyncPlayer(ENetEvent * event)
enet_packet_create((char *)(buf)+qlz_size_compressed(buf)-j, SYNCPACKETSIZE, ENET_PACKET_FLAG_RELIABLE));
j -= SYNCPACKETSIZE;
}
// ...except for this one. A non-SYNCPACKETSIZE packet on CHAN_SYNC doubles as the signal that the transfer is done.
enet_peer_send(event->peer, CHAN_SYNC,
enet_packet_create((char *)(buf)+qlz_size_compressed(buf)-j, j, ENET_PACKET_FLAG_RELIABLE));
Bfree(buf);
Bfree(g_multiMapState);
g_multiMapState = NULL;
@ -988,12 +979,12 @@ void Net_ParseServerPacket(ENetEvent * event)
switch (packbuf[0])
{
case PACKET_MASTER_TO_SLAVE: //[0] (receive master sync buffer)
if (!(g_player[myconnectindex].ps->gm & MODE_GAME)) return;
if (!(g_player[myconnectindex].ps->gm & MODE_GAME) || g_netSync) return;
j = 0;
packbufleng = qlz_size_decompressed((char *)&packbuf[1]);
packbuf = Bcalloc(1, packbufleng+1);
packbuf = (uint8_t *)Bcalloc(1, packbufleng+1);
packbufleng = qlz_decompress((char *)&event->packet->data[1], (char *)(packbuf), state_decompress);
ticrandomseed = *(int32_t *)&packbuf[j];
@ -1005,6 +996,8 @@ void Net_ParseServerPacket(ENetEvent * event)
g_player[i].ps->dead_flag = *(int16_t *)&packbuf[j];
j += sizeof(int16_t);
g_player[i].playerquitflag = packbuf[j++];
if (i == myconnectindex && !g_player[i].ps->dead_flag)
{
j += offsetof(input_t, filler) +
@ -1018,16 +1011,19 @@ void Net_ParseServerPacket(ENetEvent * event)
Bmemcpy(&nsyn[i], &packbuf[j], offsetof(input_t, filler));
j += offsetof(input_t, filler);
if (TEST_SYNC_KEY(nsyn[i].bits,SK_GAMEQUIT)) g_player[i].playerquitflag = 0;
g_player[i].movefifoend++;
//if (g_player[i].playerquitflag == 0) continue;
// if (TEST_SYNC_KEY(nsyn[i].bits,SK_GAMEQUIT)) g_player[i].playerquitflag = 0;
if (g_player[i].playerquitflag == 0) continue;
// Bmemcpy(&g_player[i].ps->opos.x, &g_player[i].ps->pos.x, sizeof(vec3_t));
Bmemcpy(&g_player[i].ps->pos.x, &packbuf[j], sizeof(vec3_t) * 2);
updatesectorz(g_player[i].ps->pos.x, g_player[i].ps->pos.y, g_player[i].ps->pos.z,
&g_player[i].ps->cursectnum);
changespritesect(g_player[i].ps->i, g_player[i].ps->cursectnum);
if (g_player[i].ps->cursectnum >= 0 && g_player[i].ps->cursectnum < numsectors)
{
updatesectorz(g_player[i].ps->pos.x, g_player[i].ps->pos.y, g_player[i].ps->pos.z,
&g_player[i].ps->cursectnum);
changespritesect(g_player[i].ps->i, g_player[i].ps->cursectnum);
}
Bmemcpy(&sprite[g_player[i].ps->i], &packbuf[j], sizeof(vec3_t));
sprite[g_player[i].ps->i].z += PHEIGHT;
j += sizeof(vec3_t) * 2;
@ -1103,7 +1099,6 @@ process:
do
{
int16_t var_id = *(int16_t *)&packbuf[j];
j += sizeof(int16_t);
if (var_id == MAXGAMEVARS) break;
@ -1118,7 +1113,6 @@ process:
do
{
int16_t var_id = *(int16_t *)&packbuf[j];
j += sizeof(int16_t);
if (var_id == MAXGAMEVARS) break;
@ -1278,7 +1272,6 @@ process:
ud.coop = ud.m_coop;
if (G_EnterLevel(MODE_GAME)) G_BackToMenu();
break;
case PACKET_VERSION:
@ -1300,7 +1293,7 @@ process:
ud.multimode = packbuf[3];
if (packbuf[4]) // ID of new player
{
clearbufbyte(&g_player[packbuf[4]].playerquitflag,1,0x01010101);
g_player[packbuf[4]].playerquitflag = 1;
if (!g_player[packbuf[4]].ps) g_player[packbuf[4]].ps = (DukePlayer_t *) Bcalloc(1,sizeof(DukePlayer_t));
if (!g_player[packbuf[4]].sync) g_player[packbuf[4]].sync = (input_t *) Bcalloc(1,sizeof(input_t));
@ -1319,19 +1312,20 @@ process:
// receive client player index from server
case PACKET_PLAYER_INDEX:
myconnectindex = packbuf[1];
clearbufbyte(&g_player[myconnectindex].playerquitflag,1,0x01010101);
g_player[myconnectindex].playerquitflag = 1;
Net_SendClientInfo();
break;
case PACKET_PLAYER_DISCONNECTED:
numplayers--;
ud.multimode--;
P_RemovePlayer(packbuf[1]);
if ((g_player[myconnectindex].ps->gm & MODE_GAME) && !g_netSync)
P_RemovePlayer(packbuf[1]);
numplayers = packbuf[2];
ud.multimode = packbuf[3];
playerswhenstarted = packbuf[4];
break;
case PACKET_PLAYER_SPAWN:
if (!(g_player[myconnectindex].ps->gm & MODE_GAME) || g_netSync) break;
P_ResetPlayer(packbuf[1]);
break;
@ -1340,8 +1334,10 @@ process:
return;
case PACKET_FRAG:
if (!(g_player[myconnectindex].ps->gm & MODE_GAME) || g_netSync) break;
g_player[packbuf[1]].ps->frag_ps = packbuf[2];
actor[g_player[packbuf[1]].ps->i].picnum = packbuf[3];
ticrandomseed = *(int32_t *)&packbuf[4];
P_FragPlayer(packbuf[1]);
break;
@ -1360,6 +1356,8 @@ process:
j = i;
for (; i-j<10; i++) g_player[other].wchoice[i-j] = packbuf[i];
g_player[other].playerquitflag = 1;
break;
@ -1452,34 +1450,6 @@ process:
G_LoadPlayer(multipos);
multiflag = 0;
break;
case PACKET_REQUEST_GAMESTATE:
if (g_netServer && g_player[0].ps->gm & MODE_GAME)
{
packbuf[0] = PACKET_NEW_GAME;
packbuf[1] = ud.level_number;
packbuf[2] = ud.volume_number;
packbuf[3] = ud.player_skill+1;
packbuf[4] = ud.monsters_off;
packbuf[5] = ud.respawn_monsters;
packbuf[6] = ud.respawn_items;
packbuf[7] = ud.respawn_inventory;
packbuf[8] = ud.coop;
packbuf[9] = ud.marker;
packbuf[10] = ud.ffire;
packbuf[11] = ud.noexits;
packbuf[12] = myconnectindex;
enet_peer_send(event->peer, CHAN_GAMESTATE, enet_packet_create(packbuf, 13, ENET_PACKET_FLAG_RELIABLE));
// a player connecting is a good time to mark everything as needing to be updated
Bmemset(spritecrc, 0, sizeof(spritecrc));
Bmemset(sectcrc, 0, sizeof(sectcrc));
Bmemset(wallcrc, 0, sizeof(wallcrc));
Bmemset(peractorvals, 0, sizeof(peractorvals));
Bmemset(perplayervals, 0, sizeof(perplayervals));
}
break;
}
}
@ -1509,8 +1479,6 @@ void Net_ParseClientPacket(ENetEvent * event)
j += offsetof(input_t, filler);
g_player[other].movefifoend++;
// anyone the server thinks is dead can go fuck themselves
if (g_player[other].ps->dead_flag)
{
@ -1744,11 +1712,47 @@ void Net_ParseClientPacket(ENetEvent * event)
enet_peer_send(event->peer, CHAN_GAMESTATE, enet_packet_create(packbuf, 13, ENET_PACKET_FLAG_RELIABLE));
// a player connecting is a good time to mark everything as needing to be updated
Bmemset(spritecrc, 0, sizeof(spritecrc));
Bmemset(sectcrc, 0, sizeof(sectcrc));
Bmemset(wallcrc, 0, sizeof(wallcrc));
Bmemset(peractorvals, 0, sizeof(peractorvals));
j = g_player[other].ps->i;
Bmemcpy(g_player[other].ps, g_player[0].ps, sizeof(DukePlayer_t));
g_player[other].ps->i = j;
changespritestat(j, STAT_PLAYER);
P_ResetStatus(other);
P_ResetWeapons(other);
P_ResetInventory(other);
g_player[other].ps->last_extra = sprite[g_player[other].ps->i].extra = g_player[other].ps->max_player_health;
sprite[g_player[other].ps->i].cstat = 1+256;
actor[g_player[other].ps->i].t_data[2] = actor[g_player[other].ps->i].t_data[3] = actor[g_player[other].ps->i].t_data[4] = 0;
g_netPlayersWaiting--;
// a player connecting is a good time to mark things as needing to be updated
// we invalidate everything that has changed since we started sending the snapshot of the map to the new player
{
int32_t zz, i, nexti;
for (zz = 0; (unsigned)zz < (sizeof(g_netStatnums)/sizeof(g_netStatnums[0])); zz++)
TRAVERSE_SPRITE_STAT(headspritestat[g_netStatnums[zz]], i, nexti)
{
if (lastupdate[i] >= g_player[other].netsynctime)
{
spritecrc[i] = 0xdeadbeef;
Bmemset(peractorvals[i], 0, sizeof(int32_t) * g_gameVarCount);
}
}
}
for (i=numwalls-1; i>=0; i--)
if (lastwallupdate[i] >= g_player[other].netsynctime)
wallcrc[i] = 0xdeadbeef;
for (i=numsectors-1; i>=0; i--)
if (lastsectupdate[i] >= g_player[other].netsynctime)
sectcrc[i] = 0xdeadbeef;
Bmemset(perplayervals, 0, sizeof(perplayervals));
}
break;
@ -1798,6 +1802,7 @@ void Net_GetPackets(void)
}
Net_SendVersion(event.peer);
break;
case ENET_EVENT_TYPE_RECEIVE:
/*
initprintf ("A packet of length %u containing %s was received from player %d on channel %u.\n",
@ -1812,14 +1817,15 @@ void Net_GetPackets(void)
if ((event.channelID == CHAN_GAMESTATE && event.packet->data[0] > PACKET_BROADCAST) || event.channelID == CHAN_CHAT)
{
event.peer->state = ENET_PEER_STATE_DISCONNECTED;
enet_host_broadcast(g_netServer, event.channelID, event.packet);
enet_host_broadcast(g_netServer, event.channelID,
enet_packet_create(event.packet->data, event.packet->dataLength, event.packet->flags));
event.peer->state = ENET_PEER_STATE_CONNECTED;
}
else enet_packet_destroy(event.packet);
enet_packet_destroy(event.packet);
g_player[(intptr_t)event.peer->data].ping = (event.peer->lastRoundTripTime + event.peer->roundTripTime)/2;
break;
case ENET_EVENT_TYPE_DISCONNECT:
numplayers--;
ud.multimode--;
@ -1828,12 +1834,17 @@ void Net_GetPackets(void)
packbuf[0] = PACKET_PLAYER_DISCONNECTED;
packbuf[1] = (intptr_t)event.peer->data;
packbuf[2] = myconnectindex;
enet_host_broadcast(g_netServer, CHAN_GAMESTATE, enet_packet_create(packbuf, 3, ENET_PACKET_FLAG_RELIABLE));
packbuf[2] = numplayers;
packbuf[3] = ud.multimode;
packbuf[4] = playerswhenstarted;
packbuf[5] = myconnectindex;
enet_host_broadcast(g_netServer, CHAN_GAMESTATE, enet_packet_create(packbuf, 6, ENET_PACKET_FLAG_RELIABLE));
initprintf("%s disconnected.\n", g_player[(intptr_t)event.peer->data].user_name);
event.peer->data = NULL;
break;
default:
break;
}
@ -1867,13 +1878,12 @@ void Net_GetPackets(void)
if (buf == NULL)
{
datasiz = 0;
if (g_multiMapState == NULL)
g_multiMapState = (mapstate_t *)Bcalloc(1, sizeof(mapstate_t));
g_netSync = 1;
buf = Bcalloc(1, sizeof(mapstate_t)<<1);
}
g_multiMapState = (mapstate_t *)Brealloc(g_multiMapState, sizeof(mapstate_t));
if (buf && event.packet->dataLength == SYNCPACKETSIZE)
{
Bmemcpy((uint8_t *)(buf)+datasiz, event.packet->data, event.packet->dataLength);
@ -1884,9 +1894,12 @@ void Net_GetPackets(void)
{
Bmemcpy((uint8_t *)(buf)+datasiz, event.packet->data, event.packet->dataLength);
datasiz = 0;
g_netSync = 0;
if (qlz_size_decompressed((const char *)buf) == sizeof(mapstate_t))
{
qlz_decompress((const char *)buf, g_multiMapState, state_decompress);
Bfree(buf);
buf = NULL;
packbuf[0] = PACKET_REQUEST_GAMESTATE;
packbuf[1] = myconnectindex;
@ -1895,21 +1908,22 @@ void Net_GetPackets(void)
else
{
initprintf("Invalid map state from server!\n");
Bfree(buf);
buf = NULL;
g_netDisconnect = 1;
return;
}
}
else
{
initprintf("Error allocating buffer for map state!\n");
g_netDisconnect = 1;
return;
}
}
else Net_ParseServerPacket(&event);
enet_packet_destroy(event.packet);
break;
case ENET_EVENT_TYPE_DISCONNECT:
g_netDisconnect = 1;
numplayers = playerswhenstarted = ud.multimode = 1;
@ -1946,6 +1960,7 @@ void Net_UpdateClients(void)
if (!g_netServer || numplayers < 2)
{
ticrandomseed = randomseed;
if (g_netServer)
Bmemcpy(&osyn[0], &nsyn[0], sizeof(input_t));
return;
@ -1965,9 +1980,12 @@ void Net_UpdateClients(void)
*(int16_t *)&packbuf[j] = g_player[i].ps->dead_flag;
j += sizeof(int16_t);
packbuf[j++] = g_player[i].playerquitflag;
Bmemcpy(&packbuf[j], &nsyn[i], offsetof(input_t, filler));
j += offsetof(input_t, filler);
//if (g_player[i].playerquitflag == 0) continue;
if (g_player[i].playerquitflag == 0) continue;
Bmemcpy(&packbuf[j], &g_player[i].ps->pos.x, sizeof(vec3_t) * 2);
j += sizeof(vec3_t) * 2;
@ -2053,9 +2071,9 @@ void Net_UpdateClients(void)
{
if ((aGameVars[ii].dwFlags & (GAMEVAR_PERACTOR|GAMEVAR_NOMULTI)) == GAMEVAR_PERACTOR && aGameVars[ii].val.plValues)
{
if (peractorvals[ii][i] != aGameVars[ii].val.plValues[i])
if (peractorvals[i][ii] != aGameVars[ii].val.plValues[i])
{
peractorvals[ii][i] = aGameVars[ii].val.plValues[i];
peractorvals[i][ii] = aGameVars[ii].val.plValues[i];
*(int16_t *)&packbuf[j] = ii;
j += sizeof(int16_t);
@ -2077,9 +2095,9 @@ void Net_UpdateClients(void)
{
if ((aGameVars[ii].dwFlags & (GAMEVAR_PERPLAYER|GAMEVAR_NOMULTI)) == GAMEVAR_PERPLAYER && aGameVars[ii].val.plValues)
{
if (perplayervals[ii][i] != aGameVars[ii].val.plValues[i])
if (perplayervals[i][ii] != aGameVars[ii].val.plValues[i])
{
perplayervals[ii][i] = aGameVars[ii].val.plValues[i];
perplayervals[i][ii] = aGameVars[ii].val.plValues[i];
*(int16_t *)&packbuf[j] = ii;
j += sizeof(int16_t);
@ -2155,9 +2173,9 @@ void Net_UpdateClients(void)
{
if ((aGameVars[ii].dwFlags & GAMEVAR_PERACTOR) && aGameVars[ii].val.plValues)
{
if (peractorvals[ii][i] != aGameVars[ii].val.plValues[i])
if (peractorvals[i][ii] != aGameVars[ii].val.plValues[i])
{
peractorvals[ii][i] = aGameVars[ii].val.plValues[i];
peractorvals[i][ii] = aGameVars[ii].val.plValues[i];
*(int16_t *)&packbuf[j] = ii;
j += sizeof(int16_t);
@ -2240,12 +2258,14 @@ void Net_UpdateClients(void)
packbuf[j++] = myconnectindex;
enet_host_broadcast(g_netServer, CHAN_MOVE, enet_packet_create(packbuf, j, 0));
movefifosendplc++;
}
}
void faketimerhandler(void)
{
if (g_netServer)
enet_host_service(g_netServer, NULL, 0);
else if (g_netClient)
enet_host_service(g_netClient, NULL, 0);
}
extern int32_t cacnum;
@ -2288,8 +2308,9 @@ int32_t A_CheckInventorySprite(spritetype *s)
case HOLODUKE__STATIC:
case AIRTANK__STATIC:
return 1;
default:
return 0;
}
return 0;
}
void G_DrawTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation)
@ -4326,7 +4347,8 @@ static void G_ShowScores(void)
for (i=playerswhenstarted-1; i>=0; i--)
{
if (!g_player[i].playerquitflag) continue;
if (!g_player[i].playerquitflag)
continue;
minitext(70,SCORESHEETOFFSET+90+t,g_player[i].user_name,g_player[i].ps->palookup,2+8+16+128);
@ -11105,7 +11127,11 @@ void app_main(int32_t argc,const char **argv)
int32_t i = 0, j;
char cwd[BMAX_PATH];
// extern char datetimestring[];
#ifdef NEDMALLOC
ENetCallbacks callbacks = { Bmalloc, Bfree, NULL };
#else
ENetCallbacks callbacks = { NULL, NULL, NULL };
#endif
#ifdef RENDERTYPEWIN
if (argc > 1)
@ -11156,9 +11182,6 @@ void app_main(int32_t argc,const char **argv)
wm_setapptitle(tempbuf);
initprintf(HEAD2 " %s\n", s_buildDate);
// initprintf("Compiled %s\n",datetimestring);
// initprintf("Copyright (c) 1996, 2003 3D Realms Entertainment\n");
// initprintf("Copyright (c) 2008 EDuke32 team and contributors\n");
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
addsearchpath("/usr/share/games/jfduke3d");
@ -11570,10 +11593,7 @@ CLEAN_DIRECTORY:
if (g_scriptDebug)
initprintf("CON debugging activated (level %d).\n",g_scriptDebug);
RegisterShutdownFunction(G_Shutdown);
numplayers = 1;
connectpoint2[0] = -1;
Net_GetPackets();
@ -11584,7 +11604,7 @@ CLEAN_DIRECTORY:
{
if (!g_player[i].ps) g_player[i].ps = (DukePlayer_t *) Bcalloc(1,sizeof(DukePlayer_t));
if (!g_player[i].sync) g_player[i].sync = (input_t *) Bcalloc(1,sizeof(input_t));
clearbufbyte(&g_player[i].playerquitflag,1,0x01010101);
g_player[i].playerquitflag = 1;
}
g_player[myconnectindex].ps->palette = (uint8_t *) &palette[0];
@ -11862,20 +11882,23 @@ MAIN_LOOP_RESTART:
}
*/
j = 0;
do
{
sampletimer();
if ((totalclock < ototalclock+TICSPERFRAME) || (ready2send == 0)) break;
if (ready2send == 0) break;
ototalclock += TICSPERFRAME;
g_player[myconnectindex].movefifoend++;
if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
(g_player[myconnectindex].ps->gm&MODE_GAME) && G_MoveLoop())
j++;
}
while (!(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO)) && totalclock >= ototalclock+TICSPERFRAME);
}
if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
(g_player[myconnectindex].ps->gm&MODE_GAME) && G_MoveLoop())
continue;
if (j) continue;
}
G_DoCheats();
@ -12389,7 +12412,6 @@ nextdemo:
TRAVERSE_CONNECT(j)
{
copybufbyte(&recsync[bigi], &inputfifo[0][j], sizeof(input_t));
g_player[j].movefifoend++;
bigi++;
ud.reccnt--;
}
@ -12584,8 +12606,7 @@ GAME_STATIC GAME_INLINE int32_t G_MoveLoop()
{
Net_GetPackets();
while (g_player[myconnectindex].movefifoend-movefifoplc > 0)
if (G_DoMoveThings()) return 1;
if (G_DoMoveThings()) return 1;
return 0;
}
@ -12660,8 +12681,6 @@ GAME_STATIC int32_t G_DoMoveThings(void)
TRAVERSE_CONNECT(i)
copybufbyte(&inputfifo[(g_netServer && myconnectindex == i) ? 1 : 0][i],g_player[i].sync,sizeof(input_t));
movefifoplc++;
G_UpdateInterpolations();
j = -1;
@ -12765,7 +12784,6 @@ GAME_STATIC int32_t G_DoMoveThings(void)
enet_peer_send(g_netClientPeer, CHAN_MOVE, enet_packet_create(packbuf, j, 0));
movefifosendplc++;
}
return 0;

View file

@ -506,7 +506,7 @@ GAMEEXEC_STATIC void VM_Move(void)
moveptr = (intptr_t *)vm.g_t[1];
if (a&geth) vm.g_sp->xvel += (*moveptr-vm.g_sp->xvel)>>1;
if (a&geth) vm.g_sp->xvel += ((*moveptr)-vm.g_sp->xvel)>>1;
if (a&getv) vm.g_sp->zvel += ((*(moveptr+1)<<4)-vm.g_sp->zvel)>>1;
if (a&dodgebullet && !deadflag)
@ -2021,11 +2021,12 @@ nullquote:
insptr++;
{
int32_t j = Gv_GetVarX(*insptr++);
if (g_timerTicsPerSecond == j)
continue;
uninittimer();
inittimer(j);
g_timerTicsPerSecond = j;
inittimer((g_timerTicsPerSecond = j));
}
continue;

View file

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "duke3d.h"
const char *s_buildDate = "20100704";
const char *s_buildDate = "20100714";
char *MusicPtr = NULL;
int32_t g_musicSize;
@ -92,8 +92,6 @@ PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
user_defs ud;
char pus, pub;
char syncstat[MAXSYNCBYTES];
int32_t syncvaltail, syncvaltottail;
input_t loc;
input_t recsync[RECSYNCBUFSIZ];
@ -155,9 +153,7 @@ int16_t myang, omyang, mycursectnum, myjumpingcounter;
char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
int8_t multiwho, multipos, multiwhat, multiflag;
int32_t predictfifoplc,movefifoplc;
int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
int32_t myhorizbak[MOVEFIFOSIZ],g_playerFriction = 0xcc00, g_showShareware;
int32_t g_playerFriction = 0xcc00, g_showShareware;
int16_t myangbak[MOVEFIFOSIZ];
char szPlayerName[32];
@ -167,9 +163,8 @@ int32_t g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBl
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
DukeStatus_t sbar;
int32_t mymaxlag, otherminlag, bufferjitter = 1;
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
int32_t cloudtotalclock = 0,totalmemory = 0;
int32_t cloudtotalclock = 0;
int32_t g_numInterpolations = 0, startofdynamicinterpolations = 0;
int32_t g_interpolationLock = 0;
int32_t oldipos[MAXINTERPOLATIONS];

View file

@ -26,8 +26,6 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
//-------------------------------------------------------------------------
#include "compat.h"
#include "util_lib.h"
#include "animlib.h"
//****************************************************************************

View file

@ -12,7 +12,6 @@
#include "mouse.h"
#include "control.h"
#include "_control.h"
#include "util_lib.h"
#include "baselayer.h"
#include "osd.h"

View file

@ -40,8 +40,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "compat.h"
#include "file_lib.h"
#include "util_lib.h"
#include "cache1d.h"
#include "baselayer.h"
#ifndef O_BINARY
#define O_BINARY 0
@ -61,7 +61,11 @@ int32_t SafeOpen(const char *filename, int32_t mode, int32_t sharemode)
int32_t h;
h = openfrompath(filename, mode, sharemode);
if (h < 0) Error("Error opening %s: %s", filename, strerror(errno));
if (h < 0)
{
initprintf("Error opening %s: %s", filename, strerror(errno));
return h;
}
if (h < MaxFiles)
{
@ -82,7 +86,7 @@ int32_t SafeOpenRead(const char *filename, int32_t filetype)
case filetype_text:
return SafeOpen(filename, O_RDONLY|O_TEXT, S_IREAD);
default:
Error("SafeOpenRead: Illegal filetype specified");
initprintf("SafeOpenRead: Illegal filetype specified");
return -1;
}
}
@ -93,9 +97,10 @@ void SafeClose(int32_t handle)
if (close(handle) < 0)
{
if (handle < MaxFiles)
Error("Unable to close file %s", FileNames[handle]);
initprintf("Unable to close file %s", FileNames[handle]);
else
Error("Unable to close file");
initprintf("Unable to close file");
return;
}
if (handle < MaxFiles && FileNames[handle])
@ -126,11 +131,12 @@ void SafeRead(int32_t handle, void *buffer, int32_t count)
{
close(handle);
if (handle < MaxFiles)
Error("File read failure %s reading %d bytes from file %s.",
initprintf("File read failure %s reading %d bytes from file %s.",
strerror(errno), count, FileNames[handle]);
else
Error("File read failure %s reading %d bytes.",
initprintf("File read failure %s reading %d bytes.",
strerror(errno), count);
return;
}
}

View file

@ -39,10 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int32_t FindDistance2D(int32_t x, int32_t y)
{
x= klabs(x);
y= klabs(y);
if (x<y) swaplong(&x,&y);
if ((x=klabs(x)) < (y=klabs(y))) swaplong(&x,&y);
{
int32_t t = y + (y>>1);
@ -52,12 +49,8 @@ int32_t FindDistance2D(int32_t x, int32_t y)
int32_t FindDistance3D(int32_t x, int32_t y, int32_t z)
{
x= klabs(x);
y= klabs(y);
z= klabs(z);
if (x<y) swaplong(&x,&y);
if (x<z) swaplong(&x,&z);
if ((x=klabs(x)) < (y=klabs(y))) swaplong(&x,&y);
if (x < (z=klabs(z))) swaplong(&x,&z);
{
int32_t t = y + z;

View file

@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "compat.h"
#include "scriplib.h"
#include "util_lib.h"
#include "file_lib.h"
#include "_scrplib.h"
#include <string.h>

View file

@ -1,129 +0,0 @@
/*
* util_lib.c
* Utility functions to emulate MACT
*
* by Jonathon Fowler
*
* Since we weren't given the source for MACT386.LIB so I've had to do some
* creative interpolation here.
*
*/
//-------------------------------------------------------------------------
/*
Duke Nukem Copyright (C) 1996, 2003 3D Realms Entertainment
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
#include "util_lib.h"
#include "baselayer.h"
//#define MOTOROLA
static void (*ShutDown)(void) = NULL; // this is defined by whoever links us
void RegisterShutdownFunction(void (* sh)(void))
{
ShutDown = sh;
}
#ifndef RENDERTYPEWIN
void Error(char *error, ...)
{
va_list va;
if (ShutDown) ShutDown();
if (error)
{
va_start(va, error);
vprintf(error, va);
va_end(va);
printf("\n\n");
}
exit((error != NULL));
}
#endif
char CheckParm(char *check)
{
int32_t c;
for (c=1; c<_buildargc; c++)
{
if (_buildargv[c][0] == '/' || _buildargv[c][0] == '-')
if (!Bstrcasecmp(&_buildargv[c][1], check)) return c;
}
return 0;
}
int32_t ParseHex(char *hex)
{
return strtol(hex, NULL, 16);
}
int32_t ParseNum(char *str)
{
return strtol(str, NULL, 10);
}
int16_t MotoShort(int16_t l)
{
#if B_LITTLE_ENDIAN != 0
return l;
#else
return ((l & 0x00ff) << 8) | ((l & 0xff00) >> 8);
#endif
}
int16_t IntelShort(int16_t l)
{
#if B_BIG_ENDIAN != 0
return ((l & 0x00ff) << 8) | ((l & 0xff00) >> 8);
#else
return l;
#endif
}
int32_t MotoLong(int32_t l)
{
#if B_LITTLE_ENDIAN != 0
return l;
#else
int32_t t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8);
return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16);
#endif
}
int32_t IntelLong(int32_t l)
{
#if B_BIG_ENDIAN != 0
int32_t t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8);
return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16);
#else
return l;
#endif
}

View file

@ -1,61 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
*/
//-------------------------------------------------------------------------
//***************************************************************************
//
// UTIL_LIB.C - various utils
//
//***************************************************************************
#ifndef _util_lib_public
#define _util_lib_public
#ifdef __cplusplus
extern "C" {
#endif
#if RENDERTYPEWIN
#include "winlayer.h"
#endif
void RegisterShutdownFunction( void (* sh) (void) );
void Error (char *error, ...);
char CheckParm (char *check);
int32_t ParseHex (char *hex);
int32_t ParseNum (char *str);
int16_t MotoShort (int16_t l);
int16_t IntelShort (int16_t l);
int32_t MotoLong (int32_t l);
int32_t IntelLong (int32_t l);
void HeapSort(char * base, int32_t nel, int32_t width, int32_t (*compare)(), void (*switcher)());
#ifdef __cplusplus
};
#endif
#endif

View file

@ -48,8 +48,6 @@ extern int16_t searchbottomwall;
#define COLOR_RED 248
#define COLOR_WHITE 31
static int32_t ototalclock = 0;
#define NUMOPTIONS 9
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
@ -94,7 +92,6 @@ static int32_t ppointhighlight;
//static int32_t counter=0;
static uint8_t nosprites=0,purpleon=0,skill=4;
static uint8_t framerateon=1,shadepreview=0;
static int32_t xvel, yvel, timoff;
int32_t autosave=180;
static int32_t autosavetimer;

View file

@ -537,6 +537,7 @@ void G_CheckPlayerColor(int32_t *color, int32_t prev_color)
void M_DisplayMenus(void)
{
extern int32_t g_netSync;
CACHE1D_FIND_REC *dir;
int32_t c,x,i;
int32_t l,m;
@ -544,6 +545,22 @@ void M_DisplayMenus(void)
Net_GetPackets();
if (g_netSync)
{
P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11);
rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1);
rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1);
rotatesprite(160<<16,(129)<<16,30<<11,0,THREEDEE,0,0,2+8,0,0,xdim-1,ydim-1);
if (PLUTOPAK) // JBF 20030804
rotatesprite(160<<16,(151)<<16,30<<11,0,PLUTOPAKSPRITE+1,0,0,2+8,0,0,xdim-1,ydim-1);
gametext(160,190,"Transferring gamestate",14,2);
nextpage();
return;
}
{
if (buttonstat != 0 && !onbar)
{
@ -3678,6 +3695,7 @@ cheat_for_port_credits:
{
int32_t sense = (int32_t)(CONTROL_MouseSensitivity * 4.0f);
sense = clamp(sense, 0, 63);
barsm(248,126,&sense,2,x==(MAXMOUSEBUTTONS-2)*2+2,MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2),PHX(-7));
CONTROL_MouseSensitivity = sense / 4.0f;
}

View file

@ -34,9 +34,6 @@ int32_t g_kb;
int32_t g_looking_angSR1;
int32_t g_weapon_xoffset;
int32_t turnheldtime; //MED
int32_t lastcontroltime; //MED
extern int32_t g_levelTextTime, ticrandomseed;
int32_t g_numObituaries = 0;
@ -308,7 +305,7 @@ static int32_t A_FindTargetSprite(spritetype *s,int32_t aang,int32_t atwith)
int32_t A_Shoot(int32_t i,int32_t atwith)
{
int16_t l, sa, p, j, k=-1, wh, scount;
int16_t l, sa, p, j, k=-1;
int32_t vel, zvel = 0, x, oldzvel, dal;
hitdata_t hitinfo;
vec3_t srcvect;
@ -392,9 +389,8 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
if (ProjectileData[atwith].workslike & PROJECTILE_BLOOD)
{
if (p >= 0)
sa += 64 - (krand()&127);
else sa += 1024 + 64 - (krand()&127);
sa += 64 - (krand()&127);
if (p < 0) sa += 1024;
zvel = 1024-(krand()&2047);
}
@ -426,13 +422,15 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
ProjectileData[atwith].range = 1024;
if (FindDistance2D(srcvect.x-hitinfo.pos.x,srcvect.y-hitinfo.pos.y) < ProjectileData[atwith].range)
if (FindDistance2D(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x,wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y) > (mulscale(ProjectileData[atwith].xrepeat+8,tilesizx[ProjectileData[atwith].decal],3)))
if (FindDistance2D(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x,wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y) >
(mulscale(ProjectileData[atwith].xrepeat+8,tilesizx[ProjectileData[atwith].decal],3)))
if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].overpicnum != BIGFORCE)
if ((wall[hitinfo.hitwall].nextsector >= 0 && hitinfo.hitsect >= 0 &&
sector[wall[hitinfo.hitwall].nextsector].lotag == 0 &&
sector[hitinfo.hitsect].lotag == 0 &&
sector[wall[hitinfo.hitwall].nextsector].lotag == 0 &&
(sector[hitinfo.hitsect].floorz-sector[wall[hitinfo.hitwall].nextsector].floorz) > (mulscale(ProjectileData[atwith].yrepeat,tilesizy[ProjectileData[atwith].decal],3)<<8)) ||
(sector[hitinfo.hitsect].floorz-sector[wall[hitinfo.hitwall].nextsector].floorz) >
(mulscale(ProjectileData[atwith].yrepeat,tilesizy[ProjectileData[atwith].decal],3)<<8)) ||
(wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag == 0))
if ((wall[hitinfo.hitwall].cstat&16) == 0)
{
@ -471,7 +469,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
*/
if (ProjectileData[atwith].workslike & PROJECTILE_RANDDECALSIZE)
{
wh = (krand()&ProjectileData[atwith].xrepeat);
int32_t wh = (krand()&ProjectileData[atwith].xrepeat);
if (wh < ProjectileData[atwith].yrepeat)
wh = ProjectileData[atwith].yrepeat;
sprite[k].xrepeat = wh;
@ -486,16 +484,18 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
// sprite[k].cstat = 16+(krand()&12);
sprite[k].cstat = 16;
wh = (krand()&1);
if (wh == 1)
sprite[k].cstat |= 4;
{
int32_t wh = (krand()&1);
if (wh == 1)
sprite[k].cstat |= 4;
wh = (krand()&1);
if (wh == 1)
sprite[k].cstat |= 8;
wh = (krand()&1);
if (wh == 1)
sprite[k].cstat |= 8;
wh = sprite[k].sectnum;
sprite[k].shade = sector[wh].floorshade;
wh = sprite[k].sectnum;
sprite[k].shade = sector[wh].floorshade;
}
sprite[k].x -= mulscale13(1,sintable[(sprite[k].ang+2560)&2047]);
sprite[k].y -= mulscale13(1,sintable[(sprite[k].ang+2048)&2047]);
@ -737,7 +737,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
}
if (ProjectileData[atwith].spawns >= 0)
{
wh=A_Spawn(k,ProjectileData[atwith].spawns);
int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns);
if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat;
if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat;
actor[wh].t_data[6] = hitinfo.hitwall;
@ -749,7 +749,9 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
if (hitinfo.hitsprite >= 0)
{
A_DamageObject(hitinfo.hitsprite,k);
if (sprite[hitinfo.hitsprite].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) && g_player[sprite[hitinfo.hitsprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team)))
if (sprite[hitinfo.hitsprite].picnum == APLAYER &&
(ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) &&
g_player[sprite[hitinfo.hitsprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team)))
{
l = A_Spawn(k,JIBS6);
sprite[k].xrepeat = sprite[k].yrepeat = 0;
@ -762,7 +764,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
{
if (ProjectileData[atwith].spawns >= 0)
{
wh=A_Spawn(k,ProjectileData[atwith].spawns);
int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns);
if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat;
if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat;
actor[wh].t_data[6] = hitinfo.hitwall;
@ -788,7 +790,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
{
if (ProjectileData[atwith].spawns >= 0)
{
wh=A_Spawn(k,ProjectileData[atwith].spawns);
int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns);
if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat;
if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat;
actor[wh].t_data[6] = hitinfo.hitwall;
@ -851,7 +853,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512;
if (ProjectileData[atwith].workslike & PROJECTILE_RANDDECALSIZE)
{
wh = (krand()&ProjectileData[atwith].xrepeat);
int32_t wh = (krand()&ProjectileData[atwith].xrepeat);
if (wh < ProjectileData[atwith].yrepeat)
wh = ProjectileData[atwith].yrepeat;
sprite[l].xrepeat = wh;
@ -899,7 +901,7 @@ DOSKIPBULLETHOLE:
{
if (ProjectileData[atwith].spawns >= 0)
{
wh=A_Spawn(k,ProjectileData[atwith].spawns);
int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns);
if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat;
if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat;
actor[wh].t_data[6] = hitinfo.hitwall;
@ -927,7 +929,6 @@ DOSKIPBULLETHOLE:
if (s->extra >= 0) s->shade = ProjectileData[atwith].shade;
scount = 1;
vel = ProjectileData[atwith].vel;
j = -1;
@ -1046,10 +1047,8 @@ DOSKIPBULLETHOLE:
case BLOODSPLAT2__STATIC:
case BLOODSPLAT3__STATIC:
case BLOODSPLAT4__STATIC:
if (p >= 0)
sa += 64 - (krand()&127);
else sa += 1024 + 64 - (krand()&127);
sa += 64 - (krand()&127);
if (p < 0) sa += 1024;
zvel = 1024-(krand()&2047);
case KNEE__STATIC:
if (atwith == KNEE)
@ -1173,7 +1172,6 @@ DOSKIPBULLETHOLE:
}
}
break;
case SHOTSPARK1__STATIC:
@ -1468,7 +1466,6 @@ SKIPBULLETHOLE:
if (s->extra >= 0) s->shade = -96;
scount = 1;
if (atwith == SPIT) vel = 292;
else
{
@ -1522,62 +1519,47 @@ SKIPBULLETHOLE:
if (atwith == SPIT)
{
sizx = 18;
sizy = 18,srcvect.z -= (10<<8);
sizx = sizy = 18;
srcvect.z -= (10<<8);
}
else if (p >= 0)
sizx = sizy = 7;
else
{
if (atwith == FIRELASER)
{
if (p >= 0)
{
sizx = 34;
sizy = 34;
}
sizx = sizy = 34;
else
{
sizx = 18;
sizy = 18;
}
sizx = sizy = 18;
}
else
{
sizx = 18;
sizy = 18;
}
sizx = sizy = 18;
}
if (p >= 0) sizx = 7,sizy = 7;
j = A_InsertSprite(sect,srcvect.x,srcvect.y,srcvect.z,
atwith,-127,sizx,sizy,sa,vel,zvel,i,4);
sprite[j].extra += (krand()&7);
while (scount > 0)
if (atwith == COOLEXPLOSION1)
{
j = A_InsertSprite(sect,srcvect.x,srcvect.y,srcvect.z,
atwith,-127,sizx,sizy,sa,vel,zvel,i,4);
sprite[j].extra += (krand()&7);
if (atwith == COOLEXPLOSION1)
sprite[j].shade = 0;
if (PN == BOSS2)
{
sprite[j].shade = 0;
if (PN == BOSS2)
{
l = sprite[j].xvel;
sprite[j].xvel = 1024;
A_SetSprite(j,CLIPMASK0);
sprite[j].xvel = l;
sprite[j].ang += 128-(krand()&255);
}
l = sprite[j].xvel;
sprite[j].xvel = 1024;
A_SetSprite(j,CLIPMASK0);
sprite[j].xvel = l;
sprite[j].ang += 128-(krand()&255);
}
sprite[j].cstat = 128;
sprite[j].clipdist = 4;
sa = s->ang+32-(krand()&63);
zvel = oldzvel+512-(krand()&1023);
scount--;
}
sprite[j].cstat = 128;
sprite[j].clipdist = 4;
sa = s->ang+32-(krand()&63);
zvel = oldzvel+512-(krand()&1023);
return j;
case FREEZEBLAST__STATIC:
@ -1586,7 +1568,6 @@ SKIPBULLETHOLE:
if (s->extra >= 0) s->shade = -96;
scount = 1;
vel = 644;
j = -1;
@ -2982,8 +2963,10 @@ void getinput(int32_t snum)
{
int32_t j, daang;
static ControlInfo info[2];
int32_t tics;
int32_t running;
static int32_t turnheldtime; //MED
static int32_t lastcontroltime; //MED
int32_t tics, running;
int32_t turnamount;
int32_t keymove;
int32_t momx = 0,momy = 0;
@ -3105,6 +3088,7 @@ void getinput(int32_t snum)
info[1].dz = info[0].dz % (1<<6);
vel = -info[0].dz>>6;
// OSD_Printf("running: %d\n", running);
if (running)
{
turnamount = NORMALTURN<<1;
@ -3820,7 +3804,8 @@ void P_FragPlayer(int32_t snum)
DukePlayer_t *p = g_player[snum].ps;
spritetype *s = &sprite[p->i];
randomseed = ticrandomseed;
if (g_netServer || g_netClient)
randomseed = ticrandomseed;
if (s->pal != 1)
{
@ -3841,9 +3826,10 @@ void P_FragPlayer(int32_t snum)
packbuf[1] = snum;
packbuf[2] = p->frag_ps;
packbuf[3] = actor[p->i].picnum;
packbuf[4] = myconnectindex;
*(int32_t *)&packbuf[4] = ticrandomseed;
packbuf[8] = myconnectindex;
enet_host_broadcast(g_netServer, CHAN_GAMESTATE, enet_packet_create(packbuf, 5, ENET_PACKET_FLAG_RELIABLE));
enet_host_broadcast(g_netServer, CHAN_GAMESTATE, enet_packet_create(packbuf, 9, ENET_PACKET_FLAG_RELIABLE));
}
}

View file

@ -1597,16 +1597,8 @@ void clearfifo(void)
int32_t i = 0;
extern int32_t jump_timer;
syncvaltail = 0L;
syncvaltottail = 0L;
memset(&syncstat, 0, sizeof(syncstat));
bufferjitter = 1;
mymaxlag = otherminlag = 0;
jump_timer = 0;
movefifoplc = movefifosendplc = predictfifoplc = 0;
avg.fvel = avg.svel = avg.avel = avg.horz = avg.bits = avg.extbits = 0;
otherminlag = mymaxlag = 0;
clearbufbyte(&loc,sizeof(input_t),0L);
clearbufbyte(&inputfifo,sizeof(input_t)*MOVEFIFOSIZ*MAXPLAYERS,0L);
@ -1616,8 +1608,6 @@ void clearfifo(void)
// Bmemset(g_player[i].inputfifo,0,sizeof(g_player[i].inputfifo));
if (g_player[i].sync != NULL)
Bmemset(g_player[i].sync,0,sizeof(input_t));
Bmemset(&g_player[i].movefifoend,0,sizeof(g_player[i].movefifoend));
Bmemset(&g_player[i].syncvalhead,0,sizeof(g_player[i].syncvalhead));
g_player[i].vote = 0;
g_player[i].gotvote = 0;
}

View file

@ -33,6 +33,16 @@ static int32_t RTS_Started = FALSE;
char lumplockbyte[11];
int32_t IntelLong(int32_t l)
{
#if B_BIG_ENDIAN != 0
int32_t t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8);
return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16);
#else
return l;
#endif
}
/*
============================================================================
@ -186,7 +196,12 @@ int32_t RTS_SoundLength(int32_t lump)
{
lump++;
if (lump >= numlumps)
Error("RTS_SoundLength: %i >= numlumps",lump);
{
initprintf("RTS_SoundLength: %i >= numlumps",lump);
RTS_Started = FALSE;
numlumps = 0;
return 0;
}
return lumpinfo[lump].size;
}
@ -202,7 +217,13 @@ const char * RTS_GetSoundName(int32_t i)
{
i++;
if (i>=numlumps)
Error("RTS_GetSoundName: %i >= numlumps",i);
{
initprintf("RTS_GetSoundName: %i >= numlumps",i);
RTS_Started = FALSE;
numlumps = 0;
return 0;
}
return &(lumpinfo[i].name[0]);
}
@ -220,9 +241,21 @@ void RTS_ReadLump(int32_t lump, void *dest)
lumpinfo_t *l;
if (lump >= numlumps)
Error("RTS_ReadLump: %i >= numlumps",lump);
{
initprintf("RTS_ReadLump: %i >= numlumps",lump);
RTS_Started = FALSE;
numlumps = 0;
return;
}
if (lump < 0)
Error("RTS_ReadLump: %i < 0",lump);
{
initprintf("RTS_ReadLump: %i < 0",lump);
RTS_Started = FALSE;
numlumps = 0;
return;
}
l = lumpinfo+lump;
klseek(l->handle, l->position, SEEK_SET);
kread(l->handle,dest,l->size);
@ -239,7 +272,13 @@ void *RTS_GetSound(int32_t lump)
{
lump++;
if ((uint32_t)lump >= (uint32_t)numlumps)
Error("RTS_GetSound: %i >= %i\n",lump,numlumps);
{
initprintf("RTS_GetSound: %i >= %i\n",lump,numlumps);
RTS_Started = FALSE;
numlumps = 0;
return 0;
}
if (lumpcache[lump] == NULL)
{

View file

@ -37,7 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "music.h"
#if !defined _WIN32 // fork/exec based external midi player
#include <malloc.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>

View file

@ -308,7 +308,6 @@ void G_DoSectorAnimations(void)
{
my.z += v;
myvel.z = 0;
myzbak[0] = g_player[p].ps->pos.z;
}
}
@ -331,10 +330,7 @@ int32_t GetAnimationGoal(int32_t *animptr)
for (; i>=0; i--)
if (animptr == (int32_t *)animateptr[i])
{
j = i;
break;
}
return j;
return(j);
}

View file

@ -27,9 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "fx_man.h"
#include "music.h"
#include "duke3d.h"
#include "util_lib.h"
#include "osd.h"
#ifdef WIN32
#include "winlayer.h"
#endif
#define LOUDESTVOLUME 150
int32_t backflag,g_numEnvSoundsPlaying,g_maxSoundPos = 0;
@ -43,7 +46,7 @@ static int32_t MusicVoice = -1;
static int32_t MusicPaused = 0;
static mutex_t s_mutex;
static uint32_t dq[128], dnum = 0;
static volatile uint32_t dq[128], dnum = 0;
/*
===================
@ -145,7 +148,7 @@ void S_MusicShutdown(void)
S_StopMusic();
if (MUSIC_Shutdown() != MUSIC_Ok)
Error(MUSIC_ErrorString(MUSIC_ErrorCode));
initprintf(MUSIC_ErrorString(MUSIC_ErrorCode));
}
void S_PauseMusic(int32_t onf)
@ -251,8 +254,7 @@ int32_t S_PlayMusic(const char *fn, const int32_t sel)
S_StopMusic();
MusicLen = kfilelength(fp);
MusicPtr = (char *) Bmalloc(MusicLen);
MusicPtr = (char *) Bmalloc((MusicLen = kfilelength(fp)));
if ((g_musicSize = kread(fp, (char *)MusicPtr, MusicLen)) != MusicLen)
{
@ -313,7 +315,7 @@ void S_Cleanup(void)
return;
}
Bmemcpy(ldq, dq, sizeof(int32_t) * (ldnum = dnum));
Bmemcpy(ldq, (void *)dq, sizeof(int32_t) * (ldnum = dnum));
dnum = 0;
mutex_unlock(&s_mutex);

View file

@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "fx_man.h"
//#include "music.h"
//#include "duke3d.h"
#include "util_lib.h"
#include "osd.h"
#include "cache1d.h"
@ -39,6 +38,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mathutil.h"
#include "build.h" // vec3_t
#ifdef WIN32
#include "winlayer.h"
#endif
#include "sounds_mapster32.h"
#define LOUDESTVOLUME 150

View file

@ -34,27 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "winlayer.h"
// this replaces the Error() function in jmact/util_lib.c
extern void G_Shutdown(void); // game.c
void Error(char *error, ...)
{
char buf[1000];
va_list va;
G_Shutdown();
if (error)
{
va_start(va, error);
vsprintf(buf, error, va);
va_end(va);
MessageBox((HWND)win_gethwnd(),buf,"Fatal Error",MB_OK|MB_ICONERROR|MB_TASKMODAL);
}
exit((error != NULL));
}
int32_t G_GetVersionFromWebsite(char *buffer)
{
int32_t wsainitialized = 0;