From 7d8048482a2d49f638ddc44b6631c360a7c75162 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 30 Apr 2006 21:14:12 +0000 Subject: [PATCH] Peer-to-peer multiplayer with > 2 players now works, some other minor changes git-svn-id: https://svn.eduke32.com/eduke32@129 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/build.c | 2 +- polymer/build/src/config.c | 2 +- polymer/build/src/mmulti.c | 3 ++- polymer/build/src/winlayer.c | 2 +- polymer/eduke32/source/game.c | 4 ++-- polymer/eduke32/source/mapster32.h | 2 +- polymer/eduke32/source/menus.c | 8 ++++---- polymer/eduke32/source/osdcmds.c | 22 +++++++++++----------- polymer/eduke32/source/player.c | 4 +--- 9 files changed, 24 insertions(+), 25 deletions(-) diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 978688c50..f6aac8e10 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -60,7 +60,7 @@ char buildkeys[NUMBUILDKEYS] = { 0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39, 0x1e,0x2c,0xd1,0xc9,0x33,0x34, - 0x9c,0x1c,0xd,0xc,0xf,0x45 + 0x9c,0x1c,0xd,0xc,0xf,0x29 }; long posx, posy, posz, horiz = 100; diff --git a/polymer/build/src/config.c b/polymer/build/src/config.c index b5e727d1f..572d762fd 100644 --- a/polymer/build/src/config.c +++ b/polymer/build/src/config.c @@ -176,7 +176,7 @@ if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); if (readconfig(fp, "key2dzoomin", val, VL) > 0) keys[16] = Bstrtol(val, NULL, 16); if (readconfig(fp, "key2dzoomout", val, VL) > 0) keys[17] = Bstrtol(val, NULL, 16); if (readconfig(fp, "keychat", val, VL) > 0) keys[18] = Bstrtol(val, NULL, 16); -if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); } + if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); } if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL); diff --git a/polymer/build/src/mmulti.c b/polymer/build/src/mmulti.c index 01640de9b..770b16d5d 100644 --- a/polymer/build/src/mmulti.c +++ b/polymer/build/src/mmulti.c @@ -361,7 +361,8 @@ if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP for(i=0;i= 2)) || (numplayers == 2)); +// return (((!danetmode) && (numplayers >= 2)) || (numplayers == 2)); + return (numplayers >= 2); } long initmultiplayerscycle(void) diff --git a/polymer/build/src/winlayer.c b/polymer/build/src/winlayer.c index 3df32a01e..1022cda04 100644 --- a/polymer/build/src/winlayer.c +++ b/polymer/build/src/winlayer.c @@ -121,7 +121,7 @@ char inputdevices=0; char quitevent=0, appactive=1; long mousex=0, mousey=0, mouseb=0; static unsigned long mousewheel[2] = { 0,0 }; -#define MouseWheelFakePressTime (100) // getticks() is a 1000Hz timer, and the button press is faked for 100ms +#define MouseWheelFakePressTime (25) // getticks() is a 1000Hz timer, and the button press is faked for 100ms long *joyaxis = NULL, joyb=0, *joyhat = NULL; char joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index bc53356fd..ea46e7c65 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1344,7 +1344,7 @@ void orderweaponnum(short ind,long x,long y,char ha) rotatesprite(sbarx(x-7),sbary(y),sbarsc(65536L),0,THREEBYFIVE+ind+1,ha-10,7,10,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x-3),sbary(y),sbarsc(65536L),0,THREEBYFIVE+10,ha,0,10,0,0,xdim-1,ydim-1); - minitextshade(x+1,y-4,"ORDER",26,6,2+8+16+128 + 256); + minitextshade(x+1,y-4,"ORDER",26,6,2+8+16); } void weaponnum(short ind,long x,long y,long num1, long num2,char ha) @@ -9615,7 +9615,7 @@ FAKEHORIZONLY: } if(p->aim_mode) - myhoriz += syn->horz>>1; + myhoriz += syn->horz/2; else { if( myhoriz > 95 && myhoriz < 105) myhoriz = 100; diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index a5610dbea..1baf06781 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -54,7 +54,7 @@ char keys[NUMBUILDKEYS] = { 0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39, 0x1e,0x2c,0xd1,0xc9,0x47,0x49, - 0x9c,0x1c,0xd,0xc,0xf,0x45 + 0x9c,0x1c,0xd,0xc,0xf,0x29 }; int nextvoxid = 0; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 4ea8ecc42..053fd6dc2 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2870,16 +2870,16 @@ cheat_for_port_credits: { short sense; - sense = CONTROL_GetMouseSensitivity(); - barsm(248,128,&sense,1,x==(MAXMOUSEBUTTONS-2)*2+2,MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2),PHX(-7)); - CONTROL_SetMouseSensitivity( sense ); + sense = CONTROL_GetMouseSensitivity()-1; + barsm(248,128,&sense,2,x==(MAXMOUSEBUTTONS-2)*2+2,MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2),PHX(-7)); + CONTROL_SetMouseSensitivity( sense+1 ); } if (!ud.mouseaiming) modval(0,1,(int *)&myaimmode,1,probey == (MAXMOUSEBUTTONS-2)*2+2+1); modval(0,1,(int *)&ud.mouseflip,1,probey == (MAXMOUSEBUTTONS-2)*2+2+2); gametextpal(240,122+9, myaimmode && !ud.mouseaiming ? "On" : "Off", !ud.mouseaiming?MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2+1):15, 0); - gametextpal(240,122+9+9, ud.mouseflip ? "On" : "Off", MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2+2), 0); + gametextpal(240,122+9+9, !ud.mouseflip ? "On" : "Off", MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2+2), 0); if (probey < (MAXMOUSEBUTTONS-2)*2+2) { gametext(160,164,"UP/DOWN = SELECT BUTTON",0,2+8+16); diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 9cdf99876..4acfd7105 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -262,25 +262,25 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm) static int osdcmd_setstatusbarscale(const osdfuncparm_t *parm) { if (parm->numparms == 0) { - OSD_Printf("setstatusbarscale: scale is %d%%\n", ud.statusbarscale); - return OSDCMD_OK; + OSD_Printf("\"cl_statusbarscale\" is \"%d\"\n", ud.statusbarscale); + return OSDCMD_SHOWHELP; } else if (parm->numparms != 1) return OSDCMD_SHOWHELP; setstatusbarscale(Batol(parm->parms[0])); - OSD_Printf("setstatusbarscale: new scale is %d%%\n", ud.statusbarscale); + OSD_Printf("cl_statusbarscale %d\n", ud.statusbarscale); return OSDCMD_OK; } static int osdcmd_setstatusbarmode(const osdfuncparm_t *parm) { if (parm->numparms == 0) { - OSD_Printf("cl_statusbarmode: \"%d\"\n", ud.statusbarmode); - return OSDCMD_OK; + OSD_Printf("\"cl_statusbarmode\" is \"%d\"\n", ud.statusbarmode); + return OSDCMD_SHOWHELP; } else if (parm->numparms != 1) return OSDCMD_SHOWHELP; ud.statusbarmode = Batol(parm->parms[0]); vscrn(); - OSD_Printf("cl_statusbarmode: \"%d\"\n", ud.statusbarmode); + OSD_Printf("cl_statusbarmode %d\n", ud.statusbarmode); return OSDCMD_OK; } @@ -503,8 +503,8 @@ int osdcmd_cvar_set(const osdfuncparm_t *parm) int osdcmd_sensitivity(const osdfuncparm_t *parm) { if (parm->numparms != 1) { - OSD_Printf("sensitivity %d\n",CONTROL_GetMouseSensitivity()); - return OSDCMD_OK; + OSD_Printf("\"sensitivity\" is \"%d\"\n",CONTROL_GetMouseSensitivity()); + return OSDCMD_SHOWHELP; } CONTROL_SetMouseSensitivity(atoi(parm->parms[0])); OSD_Printf("sensitivity %d\n",CONTROL_GetMouseSensitivity()); @@ -514,12 +514,12 @@ int osdcmd_sensitivity(const osdfuncparm_t *parm) int osdcmd_gamma(const osdfuncparm_t *parm) { if (parm->numparms != 1) { - OSD_Printf("gamma %d\n",ud.brightness>>2); - return OSDCMD_OK; + OSD_Printf("\"gamma\" \"%d\"\n",ud.brightness>>2); + return OSDCMD_SHOWHELP; } ud.brightness = atoi(parm->parms[0])<<2; setbrightness(ud.brightness>>2,&ps[screenpeek].palette[0],0); - OSD_Printf("\n"); + OSD_Printf("gamma %d\n",ud.brightness>>2); return OSDCMD_OK; } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 03194bc3c..4dffeee85 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2832,8 +2832,6 @@ void getinput(short snum) horiz = -(info.dz+lastinfo.dz)/(314-128); else horiz = (info.dz+lastinfo.dz)/(314-128); - if(horiz > -1) - horiz++; lastinfo.dz = (lastinfo.dz+info.dz) % (314-128); info.dz = 0; } else { @@ -4390,7 +4388,7 @@ HORIZONLY: } if(p->aim_mode) - p->horiz += sync[snum].horz>>1; + p->horiz += sync[snum].horz/2; else { if( p->horiz > 95 && p->horiz < 105) p->horiz = 100;