git-svn-id: https://svn.eduke32.com/eduke32@933 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-08-06 11:50:34 +00:00
parent 524db3d755
commit 0caeecaf9a
10 changed files with 116 additions and 138 deletions

View file

@ -121,6 +121,7 @@ int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const o
#define OSDTEXT_DARKBLUE "^16"
#define OSDTEXT_RED "^21"
#define OSDTEXT_YELLOW "^23"
#define OSDTEXT_BRIGHT "^S0"
#define OSD_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT

View file

@ -5299,7 +5299,7 @@ static void loadpalette(void)
//
// getclosestcol (internal)
//
static int getclosestcol(int r, int g, int b)
int getclosestcol(int r, int g, int b)
{
int i, j, k, dist, mindist, retcol;
char *pal1;

View file

@ -3,6 +3,8 @@
#include <string.h>
#include <ctype.h>
#include "compat.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
@ -27,7 +29,6 @@
#define ioctlsocket ioctl
#define LPHOSTENT struct hostent *
#include "compat.h"
#include <sys/time.h>
static int GetTickCount(void)
{

View file

@ -106,7 +106,7 @@ extern int g_ScriptVersion, g_Shareware, g_GameType;
// #define GC (TICSPERFRAME*44)
#define MAXSOUNDS 1536
#define MAXSOUNDS 2560
/*
#pragma aux sgn =\
@ -172,7 +172,7 @@ enum gamemodes {
// Defines the motion characteristics of an actor
enum actormotion {
enum actormotion_flags {
face_player = 1,
geth = 2,
getv = 4,
@ -193,7 +193,7 @@ enum actormotion {
// Defines for 'useractor' keyword
enum useractortypes {
enum useractor_types {
notenemy,
enemy,
enemystayput
@ -201,7 +201,7 @@ enum useractortypes {
// Player Actions.
enum playeractions {
enum player_action_flags {
pstanding = 1,
pwalking = 2,
prunning = 4,
@ -221,7 +221,7 @@ enum playeractions {
pfacing = 65536
};
enum inventory {
enum inventory_indexes {
GET_STEROIDS,
GET_SHIELD,
GET_SCUBA,
@ -235,7 +235,7 @@ enum inventory {
#define TRAND krand()
enum weapons {
enum weapon_indexes {
KNEE_WEAPON,
PISTOL_WEAPON,
SHOTGUN_WEAPON,
@ -276,12 +276,6 @@ void deletespriteEVENT(int s);
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)
#define IFSKILL1 if(player_skill<1)
#define IFSKILL2 if(player_skill<2)
#define IFSKILL3 if(player_skill<3)
#define IFSKILL4 if(player_skill<4)
#define rnd(X) ((TRAND>>8)>=(255-(X)))
#define __USRHOOKS_H
@ -296,10 +290,10 @@ typedef struct {
unsigned int bits, extbits;
short fvel, svel;
signed char avel, horz;
} input;
} input_t;
#define sync dsync // JBF 20040604: sync is a function on some platforms
extern input recsync[RECSYNCBUFSIZ];
extern input_t recsync[RECSYNCBUFSIZ];
extern int movefifosendplc;
@ -576,8 +570,8 @@ typedef struct {
extern actordata_t hittype[MAXSPRITES];
extern input loc;
extern input recsync[RECSYNCBUFSIZ];
extern input_t loc;
extern input_t recsync[RECSYNCBUFSIZ];
extern int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
extern int numplayers, myconnectindex;
@ -1043,7 +1037,7 @@ extern map_t map[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing"
typedef struct {
player_struct *ps;
input *sync;
input_t *sync;
int movefifoend, syncvalhead, myminlag;
int pcolor, pteam, frags[MAXPLAYERS], wchoice[MAX_WEAPONS];
@ -1052,7 +1046,7 @@ typedef struct {
char user_name[32], syncval[MOVEFIFOSIZ];
} playerdata_t;
extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
extern input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
extern playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
extern playerdata_t g_player[MAXPLAYERS];
#include "funct.h"

View file

@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "fx_man.h"
#include "sounds.h"
#include "config.h"
#include "osd.h"
#include "osdfuncs.h"
#include "osdcmds.h"
@ -44,9 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "grpscan.h"
#include "gamedef.h"
#include "kplib.h"
//#include "crc32.h"
#include "util_lib.h"
#ifdef _WIN32
@ -54,9 +51,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <shellapi.h>
extern int getversionfromwebsite(char *buffer);
#define BUILDDATE 20080729 // this is checked against http://eduke32.com/VERSION
#define BUILDDATE 20080806 // this is checked against http://eduke32.com/VERSION
#define UPDATEINTERVAL 604800 // 1w
#endif
#else
static int usecwd = 0;
#endif /* _WIN32 */
#define IDFSIZE 479985668
#define IDFILENAME "DUKE3D.IDF"
@ -66,9 +65,6 @@ extern int getversionfromwebsite(char *buffer);
int cameradist = 0, cameraclock = 0;
static int playerswhenstarted;
static int qe,cp;
#if !defined(_WIN32)
static int usecwd = 0;
#endif
static int g_CommandSetup = 0;
static int g_NoSetup = 0;
static int g_NoAutoLoad = 0;
@ -130,11 +126,7 @@ static int user_quote_time[MAXUSERQUOTES];
static char user_quote[MAXUSERQUOTES][178];
// char typebuflen,typebuf[41];
#ifdef JFAUD
static int MAXCACHE1DSIZE = (16*1048576);
#else
static int MAXCACHE1DSIZE = (32*1048576);
#endif
int tempwallptr;
@ -150,7 +142,7 @@ static int playback(void);
static char recbuf[180];
extern void computergetinput(int snum, input *syn);
extern void computergetinput(int snum, input_t *syn);
#define USERQUOTE_LEFTOFFSET 5
#define USERQUOTE_RIGHTOFFSET 14
@ -248,34 +240,10 @@ void setgamepalette(player_struct *player, char *pal, int set)
return;
}
#if 0
if (getrendermode() < 3)
{
// 8-bit mode
player->palette = pal;
setbrightness(ud.brightness>>2, pal, set);
//pub = pus = NUMPAGES;
return;
}
if (pal == palette || pal == waterpal || pal == slimepal)
{
if (player->palette != palette && player->palette != waterpal && player->palette != slimepal)
setbrightness(ud.brightness>>2, palette, set);
else setpalettefade(0,0,0,0);
}
else
{
if (pal != titlepal && pal != drealms && pal != endingpal && pal != animpal)
pal = palette;
setbrightness(ud.brightness>>2, pal, set);
}
#else
if (!(pal == palette || pal == waterpal || pal == slimepal || pal == drealms || pal == titlepal || pal == endingpal || pal == animpal))
pal = palette;
setbrightness(ud.brightness>>2, pal, set);
#endif
player->palette = pal;
}
@ -467,16 +435,6 @@ int minitext_(int x,int y,const char *t,int s,int p,int sb)
return (x);
}
#if 0
static void gamenumber(int x,int y,int n,char s)
{
char b[10];
//ltoa(n,b,10);
Bsnprintf(b,10,"%d",n);
gametext(x,y,b,s,2+8+16);
}
#endif
static void allowtimetocorrecterrorswhenquitting(void)
{
int i, j, oldtotalclock;
@ -525,7 +483,7 @@ void getpackets(void)
{
int i, j, k, l;
int other, packbufleng;
input *osyn, *nsyn;
input_t *osyn, *nsyn;
sampletimer();
AudioUpdate();
@ -586,8 +544,8 @@ void getpackets(void)
j++;
}
osyn = (input *)&inputfifo[(g_player[connecthead].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input *)&inputfifo[(g_player[connecthead].movefifoend)&(MOVEFIFOSIZ-1)][0];
osyn = (input_t *)&inputfifo[(g_player[connecthead].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input_t *)&inputfifo[(g_player[connecthead].movefifoend)&(MOVEFIFOSIZ-1)][0];
k = j;
for (i=connecthead;i>=0;i=connectpoint2[i])
@ -605,7 +563,7 @@ void getpackets(void)
continue;
}
copybufbyte(&osyn[i],&nsyn[i],sizeof(input));
copybufbyte(&osyn[i],&nsyn[i],sizeof(input_t));
if (l&1) nsyn[i].fvel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (l&2) nsyn[i].svel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (l&4) nsyn[i].avel = (signed char)packbuf[j++];
@ -638,7 +596,7 @@ void getpackets(void)
if (i != myconnectindex)
for (j=1;j<movesperpacket;j++)
{
copybufbyte(&nsyn[i],&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input));
copybufbyte(&nsyn[i],&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input_t));
g_player[i].movefifoend++;
}
@ -649,10 +607,10 @@ void getpackets(void)
j = 3;
k = packbuf[1] + (int)(packbuf[2]<<8);
osyn = (input *)&inputfifo[(g_player[other].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input *)&inputfifo[(g_player[other].movefifoend)&(MOVEFIFOSIZ-1)][0];
osyn = (input_t *)&inputfifo[(g_player[other].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input_t *)&inputfifo[(g_player[other].movefifoend)&(MOVEFIFOSIZ-1)][0];
copybufbyte(&osyn[other],&nsyn[other],sizeof(input));
copybufbyte(&osyn[other],&nsyn[other],sizeof(input_t));
if (k&1) nsyn[other].fvel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (k&2) nsyn[other].svel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (k&4) nsyn[other].avel = (signed char)packbuf[j++];
@ -675,7 +633,7 @@ void getpackets(void)
for (i=1;i<movesperpacket;i++)
{
copybufbyte(&nsyn[other],&inputfifo[g_player[other].movefifoend&(MOVEFIFOSIZ-1)][other],sizeof(input));
copybufbyte(&nsyn[other],&inputfifo[g_player[other].movefifoend&(MOVEFIFOSIZ-1)][other],sizeof(input_t));
g_player[other].movefifoend++;
}
@ -696,10 +654,10 @@ void getpackets(void)
j++;
}
osyn = (input *)&inputfifo[(g_player[other].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input *)&inputfifo[(g_player[other].movefifoend)&(MOVEFIFOSIZ-1)][0];
osyn = (input_t *)&inputfifo[(g_player[other].movefifoend-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input_t *)&inputfifo[(g_player[other].movefifoend)&(MOVEFIFOSIZ-1)][0];
copybufbyte(&osyn[other],&nsyn[other],sizeof(input));
copybufbyte(&osyn[other],&nsyn[other],sizeof(input_t));
k = packbuf[j++];
k += (int)(packbuf[j++]<<8);
@ -719,7 +677,7 @@ void getpackets(void)
for (i=1;i<movesperpacket;i++)
{
copybufbyte(&nsyn[other],&inputfifo[g_player[other].movefifoend&(MOVEFIFOSIZ-1)][other],sizeof(input));
copybufbyte(&nsyn[other],&inputfifo[g_player[other].movefifoend&(MOVEFIFOSIZ-1)][other],sizeof(input_t));
g_player[other].movefifoend++;
}
@ -1023,7 +981,7 @@ void faketimerhandler(void)
{
int i, j, k;
// short who;
input *osyn, *nsyn;
input_t *osyn, *nsyn;
if (qe == 0 && KB_KeyPressed(sc_LeftControl) && KB_KeyPressed(sc_LeftAlt) && KB_KeyPressed(sc_Delete))
{
@ -1054,7 +1012,7 @@ void faketimerhandler(void)
if (g_player[myconnectindex].movefifoend&(movesperpacket-1))
{
copybufbyte(&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex],
&inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex],sizeof(input));
&inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex],sizeof(input_t));
g_player[myconnectindex].movefifoend++;
return;
}
@ -1073,7 +1031,7 @@ void faketimerhandler(void)
if (ud.multimode > 1) for (i=connecthead;i>=0;i=connectpoint2[i])
if (i != myconnectindex)
{
//clearbufbyte(&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input),0L);
//clearbufbyte(&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input_t),0L);
if (ud.playerai)
computergetinput(i,&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i]);
inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i].svel++;
@ -1128,8 +1086,8 @@ void faketimerhandler(void)
g_player[i].myminlag = 0x7fffffff;
}
osyn = (input *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex];
nsyn = (input *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex];
osyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex];
nsyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex];
k = j;
packbuf[j++] = 0;
@ -1203,8 +1161,8 @@ void faketimerhandler(void)
packbuf[2] = 0;
j = 3;
osyn = (input *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex];
nsyn = (input *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex];
osyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex];
nsyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex];
if (nsyn[0].fvel != osyn[0].fvel)
{
@ -1263,8 +1221,8 @@ void faketimerhandler(void)
for (i=connecthead;i>=0;i=connectpoint2[i])
if (g_player[i].playerquitflag && (g_player[i].movefifoend <= movefifosendplc)) return;
osyn = (input *)&inputfifo[(movefifosendplc-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input *)&inputfifo[(movefifosendplc)&(MOVEFIFOSIZ-1)][0];
osyn = (input_t *)&inputfifo[(movefifosendplc-1)&(MOVEFIFOSIZ-1)][0];
nsyn = (input_t *)&inputfifo[(movefifosendplc)&(MOVEFIFOSIZ-1)][0];
//MASTER -> SLAVE packet
packbuf[0] = 0;
@ -2355,28 +2313,26 @@ static void coolgaugetext(int snum)
}
}
static void tics(void)
{
#define AVERAGEFRAMES 128
#define COLOR_RED 248
#define COLOR_WHITE 31
int i = totalclock;
static void ShowFrameRate(void)
{
static int frameval[AVERAGEFRAMES], framecnt = 0;
if (i != frameval[framecnt])
if (totalclock != frameval[framecnt])
{
framerate=(timer*AVERAGEFRAMES)/(i-frameval[framecnt]);
if (ud.tickrate /*&& !(g_player[myconnectindex].ps->gm&MODE_MENU)*/)
framerate=(timer*AVERAGEFRAMES)/(totalclock-frameval[framecnt]);
frameval[framecnt] = totalclock;
if (ud.tickrate)
{
int p = 32;
int x = (xdim <= 640);
int p = 32>>x;
Bsprintf(tempbuf,"%4d",max(framerate,0));
if (xdim <= 640) p >>= 1;
printext256(windowx2-p+1,windowy1+2,0,-1,tempbuf,!(xdim > 640));
printext256(windowx2-p,windowy1+1,framerate<40?COLOR_RED:COLOR_WHITE,-1,tempbuf,!(xdim > 640));
printext256(windowx2-p+1,windowy1+2,0,-1,tempbuf,x);
printext256(windowx2-p,windowy1+1,(framerate < 40) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x);
if (numplayers > 1)
if ((totalclock - lastpackettime) > 1)
@ -2384,14 +2340,12 @@ static void tics(void)
for (p = (totalclock - lastpackettime);p>0 && p<(xdim>>2);p--)
printext256(4L*p,0,31,-1,".",0);
}
}
frameval[framecnt] = i;
}
framecnt = ((framecnt+1)&(AVERAGEFRAMES-1));
}
static void coords(int snum)
static void ShowCoordinates(int snum)
{
int y = 8;
@ -3271,7 +3225,7 @@ void displayrest(int smoothratio)
}
#endif
}
#endif
#endif /* USE_OPENGL && POLYMOST */
// this does pain tinting etc from the CON
if (pp->pals_time >= 0 && pp->loogcnt == 0) // JBF 20040101: pals_time > 0 now >= 0
{
@ -3509,7 +3463,7 @@ void displayrest(int smoothratio)
menus();
if (ud.coords)
coords(screenpeek);
ShowCoordinates(screenpeek);
#if defined(POLYMOST) && defined(USE_OPENGL)
{
@ -3521,7 +3475,7 @@ void displayrest(int smoothratio)
}
#endif
tics();
ShowFrameRate();
// JBF 20040124: display level stats in screen corner
if ((ud.overhead_on != 2 && ud.levelstats) && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
@ -3934,7 +3888,7 @@ void se40code(int x,int y,int z,int a,int h, int smoothratio)
i = nextspritestat[i];
}
}
#endif
#endif /* SE40 */
static int oyrepeat=-1;
extern float r_ambientlight;
@ -10265,7 +10219,7 @@ void app_main(int argc,const char **argv)
checkcommandline(argc,argv);
g_player[0].ps = (player_struct *) Bcalloc(1, sizeof(player_struct));
g_player[0].sync = (input *) Bcalloc(1, sizeof(input));
g_player[0].sync = (input_t *) Bcalloc(1, sizeof(input_t));
if (getcwd(cwd,BMAX_PATH)) addsearchpath(cwd);
@ -10544,7 +10498,7 @@ void app_main(int argc,const char **argv)
for (i=1;i<ud.multimode;i++)
{
g_player[i].ps = (player_struct *) Bcalloc(1,sizeof(player_struct));
g_player[i].sync = (input *) Bcalloc(1,sizeof(input));
g_player[i].sync = (input_t *) Bcalloc(1,sizeof(input_t));
}
g_player[myconnectindex].ps->palette = (char *) &palette[0];
@ -10643,7 +10597,7 @@ void app_main(int argc,const char **argv)
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
// ESCESCAPE;
// if(KB_KeyPressed( sc_Escape ) ) gameexit(" ");
FX_StopAllSounds();
clearsoundlocks();
@ -10934,7 +10888,7 @@ static int opendemoread(int which_demo) // 0 = mine
if (!g_player[i].ps)
g_player[i].ps = (player_struct *) Bcalloc(1,sizeof(player_struct));
if (!g_player[i].sync)
g_player[i].sync = (input *) Bcalloc(1,sizeof(input));
g_player[i].sync = (input_t *) Bcalloc(1,sizeof(input_t));
if (kread(recfilep,(char *)g_player[i].user_name,sizeof(g_player[i].user_name)) != sizeof(g_player[i].user_name)) goto corrupt;
OSD_Printf("ud.user_name: %s\n",g_player[i].user_name);
@ -11008,12 +10962,12 @@ static void record(void)
for (i=connecthead;i>=0;i=connectpoint2[i])
{
copybufbyte(g_player[i].sync,&recsync[ud.reccnt],sizeof(input));
copybufbyte(g_player[i].sync,&recsync[ud.reccnt],sizeof(input_t));
ud.reccnt++;
totalreccnt++;
if (ud.reccnt >= RECSYNCBUFSIZ)
{
dfwrite(recsync,sizeof(input)*ud.multimode,ud.reccnt/ud.multimode,frecfilep);
dfwrite(recsync,sizeof(input_t)*ud.multimode,ud.reccnt/ud.multimode,frecfilep);
ud.reccnt = 0;
}
}
@ -11025,7 +10979,7 @@ void closedemowrite(void)
{
if (ud.reccnt > 0)
{
dfwrite(recsync,sizeof(input)*ud.multimode,ud.reccnt/ud.multimode,frecfilep);
dfwrite(recsync,sizeof(input_t)*ud.multimode,ud.reccnt/ud.multimode,frecfilep);
fseek(frecfilep,SEEK_SET,0L);
fwrite(&totalreccnt,sizeof(int),1,frecfilep);
@ -11104,7 +11058,7 @@ RECHECK:
{
i = 0;
l = min(ud.reccnt,RECSYNCBUFSIZ);
if (kdfread(recsync,sizeof(input)*ud.multimode,l/ud.multimode,recfilep) != l/ud.multimode)
if (kdfread(recsync,sizeof(input_t)*ud.multimode,l/ud.multimode,recfilep) != l/ud.multimode)
{
OSD_Printf(OSD_ERROR "Demo %d is corrupt.\n", which_demo-1);
foundemo = 0;
@ -11117,7 +11071,7 @@ RECHECK:
for (j=connecthead;j>=0;j=connectpoint2[j])
{
copybufbyte(&recsync[i],&inputfifo[g_player[j].movefifoend&(MOVEFIFOSIZ-1)][j],sizeof(input));
copybufbyte(&recsync[i],&inputfifo[g_player[j].movefifoend&(MOVEFIFOSIZ-1)][j],sizeof(input_t));
g_player[j].movefifoend++;
i++;
ud.reccnt--;
@ -11286,14 +11240,14 @@ static void fakedomovethingscorrect(void)
static void fakedomovethings(void)
{
input *syn;
input_t *syn;
player_struct *p;
int i, j, k, doubvel, fz, cz, hz, lz, x, y;
unsigned int sb_snum;
short psect, psectlotag, tempsect, backcstat;
char shrunk, spritebridge;
syn = (input *)&inputfifo[fakemovefifoplc&(MOVEFIFOSIZ-1)][myconnectindex];
syn = (input_t *)&inputfifo[fakemovefifoplc&(MOVEFIFOSIZ-1)][myconnectindex];
p = g_player[myconnectindex].ps;
@ -11835,7 +11789,7 @@ static int domovethings(void)
everyothertime++;
for (i=connecthead;i>=0;i=connectpoint2[i])
copybufbyte(&inputfifo[movefifoplc&(MOVEFIFOSIZ-1)][i],g_player[i].sync,sizeof(input));
copybufbyte(&inputfifo[movefifoplc&(MOVEFIFOSIZ-1)][i],g_player[i].sync,sizeof(input_t));
movefifoplc++;
updateinterpolations();

View file

@ -81,7 +81,7 @@ char numplayersprites,loadfromgrouponly=0,earthquaketime;
int fricxv,fricyv;
playerdata_t g_player[MAXPLAYERS];
input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
user_defs ud;
@ -89,8 +89,8 @@ char pus, pub;
char syncstat;
int syncvaltail, syncvaltottail;
input loc;
input recsync[RECSYNCBUFSIZ];
input_t loc;
input_t recsync[RECSYNCBUFSIZ];
int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
int movefifosendplc;

View file

@ -1,6 +1,6 @@
#include <cstdio>
#include "mdump.h"
#include <tchar.H>
#include <tchar.h>
LPCSTR MiniDumper::m_szAppName;
MiniDumper g_dumper("eduke32");

View file

@ -46,6 +46,7 @@ static int function, whichkey;
static int changesmade, newvidmode, curvidmode, newfullscreen;
static int vidsets[16] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 };
static int curvidset, newvidset = 0;
static int soundbits, soundvoices, soundrate;
static char *mousebuttonnames[] = { "Left", "Right", "Middle", "Thumb", "Wheel Up", "Wheel Down" };
@ -4404,6 +4405,13 @@ cheat_for_port_credits:
rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
menutext(320>>1,24,0,0,"SOUND SETUP");
if (!(changesmade & 8))
{
soundrate = ud.config.MixRate;
soundvoices = ud.config.NumVoices;
soundbits = ud.config.NumBits;
}
{
int io, ii, yy, d=c+160+40, enabled, j;
char *opts[] =
@ -4415,6 +4423,7 @@ cheat_for_port_credits:
"Music volume",
"-",
"Sample rate",
"Sample size",
"Number of voices",
"-",
"Restart sound system",
@ -4443,6 +4452,10 @@ cheat_for_port_credits:
if (x == -1)
{
ud.config.MixRate = soundrate;
ud.config.NumVoices = soundvoices;
ud.config.NumBits = soundbits;
if (g_player[myconnectindex].ps->gm&MODE_GAME && current_menu == 701)
{
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
@ -4565,6 +4578,21 @@ cheat_for_port_credits:
}
break;
case 5:
i = ud.config.NumBits;
if (x==io)
{
if (ud.config.NumBits == 8)
ud.config.NumBits = 16;
else if (ud.config.NumBits == 16)
ud.config.NumBits = 8;
}
modval(8,16,(int *)&ud.config.NumBits,8,probey==io);
if (ud.config.NumBits != i)
changesmade |= 8;
Bsprintf(tempbuf,"%d-bit",ud.config.NumBits);
mgametextpal(d,yy, tempbuf, MENUHIGHLIGHT(io), 0);
break;
case 6:
i = ud.config.NumVoices;
if (x==io)
{
@ -4578,7 +4606,7 @@ cheat_for_port_credits:
Bsprintf(tempbuf,"%d",ud.config.NumVoices);
mgametextpal(d,yy, tempbuf, MENUHIGHLIGHT(io), 0);
break;
case 6:
case 7:
enabled = (changesmade&8);
if (!enabled) break;
if (x == io)
@ -4606,7 +4634,7 @@ cheat_for_port_credits:
changesmade &= ~8;
}
break;
case 7:
case 8:
enabled = (ud.config.SoundToggle && ud.config.FXDevice >= 0);
i = j = (ud.config.VoiceToggle&1);
modval(0,1,(int *)&i,1,enabled && probey==io);
@ -4614,7 +4642,7 @@ cheat_for_port_credits:
ud.config.VoiceToggle ^= 1;
mgametextpal(d,yy, ud.config.VoiceToggle&1? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, enabled?0:1);
break;
case 8:
case 9:
enabled = (ud.config.SoundToggle && ud.config.FXDevice >= 0);
i = j = (ud.config.VoiceToggle&4);
modval(0,1,(int *)&i,1,enabled && probey==io);
@ -4622,14 +4650,14 @@ cheat_for_port_credits:
ud.config.VoiceToggle ^= 4;
mgametextpal(d,yy, ud.config.VoiceToggle&4? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, enabled?0:1);
break;
case 9:
case 10:
enabled = (ud.config.SoundToggle && ud.config.FXDevice >= 0);
modval(0,1,(int *)&ud.config.AmbienceToggle,1,enabled && probey==io);
if (enabled && x == io)
ud.config.AmbienceToggle = 1-ud.config.AmbienceToggle;
mgametextpal(d,yy, ud.config.AmbienceToggle? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, enabled?0:1);
break;
case 10:
case 11:
enabled = (ud.config.SoundToggle && ud.config.FXDevice >= 0);
modval(0,1,(int *)&ud.config.ReverseStereo,1,enabled && probey==io);
if (enabled && x == io)

View file

@ -3412,7 +3412,6 @@ void processinput(int snum)
if (ud.level_number > MAXLEVELS-1)
ud.level_number = 0;
ud.m_level_number = ud.level_number;
}
}
for (i=connecthead;i>=0;i=connectpoint2[i])
@ -3558,12 +3557,13 @@ void processinput(int snum)
i = 9;
else
{
switch (dynamictostatic[hittype[p->i].picnum])
// temp_data[1] on a player's APLAYER actor means the player is frozen
if (hittype[p->i].temp_data[1] == 1)
i = 7;
else switch (dynamictostatic[hittype[p->i].picnum])
{
case KNEE__STATIC:
if (hittype[p->i].temp_data[1] == 1)
i = 7;
else i = 0;
i = 0;
break;
case SHOTSPARK1__STATIC:
switch (g_player[p->frag_ps].ps->curr_weapon)
@ -5238,7 +5238,7 @@ static int goalsect[MAXPLAYERS], goalwall[MAXPLAYERS], goalsprite[MAXPLAYERS], g
static int goalplayer[MAXPLAYERS], clipmovecount[MAXPLAYERS];
short searchsect[MAXSECTORS], searchparent[MAXSECTORS];
char dashow2dsector[(MAXSECTORS+7)>>3];
void computergetinput(int snum, input *syn)
void computergetinput(int snum, input_t *syn)
{
int i, j, k, l, x1, y1, z1, x2, y2, z2, x3, y3, z3, dx, dy;
int dist, daang, zang, fightdist, damyang, damysect;

View file

@ -1548,13 +1548,13 @@ void clearfifo(void)
avgfvel = avgsvel = avgavel = avghorz = avgbits = avgextbits = 0;
otherminlag = mymaxlag = 0;
clearbufbyte(&loc,sizeof(input),0L);
clearbufbyte(&inputfifo,sizeof(input)*MOVEFIFOSIZ*MAXPLAYERS,0L);
clearbufbyte(&loc,sizeof(input_t),0L);
clearbufbyte(&inputfifo,sizeof(input_t)*MOVEFIFOSIZ*MAXPLAYERS,0L);
for (;i<MAXPLAYERS;i++)
{
// 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));
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));
Bmemset(&g_player[i].myminlag,0,sizeof(g_player[i].myminlag));