From 51ba738aa095baf95f6d374a0559e4064274bc16 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 21 May 2006 00:05:50 +0000 Subject: [PATCH] I guess this is right git-svn-id: https://svn.eduke32.com/eduke32@175 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/polymost.c | 15 +++--- polymer/eduke32/source/config.c | 12 ++--- polymer/eduke32/source/game.c | 20 +++---- polymer/eduke32/source/menus.c | 8 +-- polymer/eduke32/source/osdcmds.c | 48 ++++++++--------- polymer/eduke32/source/player.c | 89 ++++++++++++++++---------------- 6 files changed, 96 insertions(+), 96 deletions(-) diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index ad28dcecf..91a5a23dc 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -2759,11 +2759,11 @@ static void polymost_drawalls (long bunch) if ((oy < cy0) && (oy < cy1)) domost(x1,oy,x0,oy); else if ((oy < cy0) != (oy < cy1)) { /* cy1 cy0 - // / \ - //oy---------- oy--------- - // / \ - // cy0 cy1 - */ + // / \ + //oy---------- oy--------- + // / \ + // cy0 cy1 + */ ox = (oy-cy0)*(x1-x0)/(cy1-cy0) + x0; if (oy < cy0) { domost(ox,oy,x0,oy); domost(x1,cy1,ox,oy); } else { domost(ox,oy,x0,cy0); domost(x1,oy,ox,oy); } @@ -3353,11 +3353,8 @@ void polymost_drawrooms () { short hitsect, hitwall, hitsprite; long vx, vy, vz, hitx, hity, hitz; - float ratioratio = 1.0; - ratioratio = 1.2; //1.6 / (((float)(windowx2-windowx1+1)) / (windowy2-windowy1)); // computes the ratio between 16/10 and current resolution ratio - - ox2 = (searchx-ghalfx)/ratioratio; oy2 = (searchy-ghoriz)/ /*((ratioratio > 1)?*/1.2/*:1)*/; oz2 = ghalfx; + ox2 = (searchx-ghalfx)/1.2; oy2 = (searchy-ghoriz)/ 1.2; oz2 = ghalfx; //Tilt rotation ox = ox2*gctang + oy2*gstang; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 13f9c1720..a2a834943 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -240,8 +240,8 @@ void CONFIG_SetDefaults( void ) ud.statusbarmode = 0; ud.statusbarscale = 100; ud.weaponswitch = 3; // new+empty - UseJoystick = 0; - UseMouse = 1; + UseJoystick = 0; + UseMouse = 1; VoiceToggle = 2; Bstrcpy(ud.rtsname, "DUKE.RTS"); @@ -677,8 +677,8 @@ void CONFIG_ReadSetup( void ) ps[0].aim_mode = ud.mouseaiming; SCRIPT_GetNumber( scripthandle, "Controls","MouseFilter",&MouseFilter); SCRIPT_GetNumber( scripthandle, "Controls","SmoothInput",&SmoothInput); - SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick); - SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse); + SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick); + SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse); SCRIPT_GetNumber( scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state SCRIPT_GetNumber( scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125 SCRIPT_GetNumber( scripthandle, "Controls","AutoAim",&AutoAim); // JBF 20031125 @@ -720,8 +720,8 @@ void CONFIG_WriteSetup( void ) SCRIPT_PutNumber( scripthandle, "Controls","MouseFilter",MouseFilter,false,false); SCRIPT_PutNumber( scripthandle, "Controls","SmoothInput",SmoothInput,false,false); SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false); + SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false); + SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false); SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 0af0c0a9d..c4a2287f4 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8541,17 +8541,17 @@ void Startup(void) exit(1); } SetupGameButtons(); - CONFIG_SetupMouse(); - CONFIG_SetupJoystick(); - - CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent); - CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent); + CONFIG_SetupMouse(); + CONFIG_SetupJoystick(); - // JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too - for (i=0;inumparms < 1); - if (!Bstrcasecmp(parm->name, "usemouse")) { - if (showval) { OSD_Printf("usemouse is %d\n", UseMouse); } - else { - UseMouse = (atoi(parm->parms[0]) != 0); - CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent); - } - return OSDCMD_OK; - } - else if (!Bstrcasecmp(parm->name, "usejoystick")) { - if (showval) { OSD_Printf("usejoystick is %d\n", UseJoystick); } - else { - UseJoystick = (atoi(parm->parms[0]) != 0); - CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent); - } - return OSDCMD_OK; - } - return OSDCMD_SHOWHELP; -} +int osdcmd_usemousejoy(const osdfuncparm_t *parm) +{ + int showval = (parm->numparms < 1); + if (!Bstrcasecmp(parm->name, "usemouse")) { + if (showval) { OSD_Printf("usemouse is %d\n", UseMouse); } + else { + UseMouse = (atoi(parm->parms[0]) != 0); + CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent); + } + return OSDCMD_OK; + } + else if (!Bstrcasecmp(parm->name, "usejoystick")) { + if (showval) { OSD_Printf("usejoystick is %d\n", UseJoystick); } + else { + UseJoystick = (atoi(parm->parms[0]) != 0); + CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent); + } + return OSDCMD_OK; + } + return OSDCMD_SHOWHELP; +} int osdcmd_mpmap(const osdfuncparm_t *parm) { @@ -708,8 +710,8 @@ int registerosdcommands(void) OSD_RegisterFunction("restartvid","restartvid: reinitialised the video mode",osdcmd_restartvid); OSD_RegisterFunction("vidmode","vidmode [xdim ydim] [bpp] [fullscreen]: immediately change the video mode",osdcmd_vidmode); - OSD_RegisterFunction("usemouse","usemouse: enables input from the mouse if it is present",osdcmd_usemousejoy); - OSD_RegisterFunction("usejoystick","usejoystick: enables input from the joystick if it is present",osdcmd_usemousejoy); + OSD_RegisterFunction("usemouse","usemouse: enables input from the mouse if it is present",osdcmd_usemousejoy); + OSD_RegisterFunction("usejoystick","usejoystick: enables input from the joystick if it is present",osdcmd_usemousejoy); //baselayer_onvideomodechange = onvideomodechange; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 9a61fb714..509faa5fb 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2703,17 +2703,17 @@ void getinput(short snum) momx = momy = 0; p = &ps[snum]; - if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) ) - { - CONTROL_GetInput( &info ); - memset(&lastinfo, 0, sizeof(lastinfo)); - loc.fvel = vel = 0; - loc.svel = svel = 0; - loc.avel = angvel = 0; - loc.horz = horiz = 0; - loc.bits = (((long)gamequit)<<26); - return; - } + if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) ) + { + CONTROL_GetInput( &info ); + memset(&lastinfo, 0, sizeof(lastinfo)); + loc.fvel = vel = 0; + loc.svel = svel = 0; + loc.avel = angvel = 0; + loc.horz = horiz = 0; + loc.bits = (((long)gamequit)<<26); + return; + } if (ud.mouseaiming) myaimmode = BUTTON(gamefunc_Mouse_Aiming); @@ -2727,16 +2727,16 @@ void getinput(short snum) } } - { - int32 i; - if (myaimmode) i = analog_lookingupanddown; - else i = MouseAnalogueAxes[1]; - - if (i != mouseyaxismode) { - CONTROL_MapAnalogAxis(1, i, controldevice_mouse); - mouseyaxismode = i; - } - } + { + int32 i; + if (myaimmode) i = analog_lookingupanddown; + else i = MouseAnalogueAxes[1]; + + if (i != mouseyaxismode) { + CONTROL_MapAnalogAxis(1, i, controldevice_mouse); + mouseyaxismode = i; + } + } CONTROL_GetInput( &info ); @@ -4912,25 +4912,28 @@ SHOOTINCODE: (aplWeaponReload[p->curr_weapon][snum] > aplWeaponTotalTime[p->curr_weapon][snum] && p->ammo_amount[p->curr_weapon] > 0 && (aplWeaponClip[p->curr_weapon][snum]) && (((p->ammo_amount[p->curr_weapon]%(aplWeaponClip[p->curr_weapon][snum]))==0)))) { - int i; - i=aplWeaponReload[p->curr_weapon][snum] - aplWeaponTotalTime[p->curr_weapon][snum]; + int i = aplWeaponReload[p->curr_weapon][snum] - aplWeaponTotalTime[p->curr_weapon][snum]; + p->reloading = 1; - if( (*kb) == (aplWeaponTotalTime[p->curr_weapon][snum])); - else if( (*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1)) + + if( (*kb) != (aplWeaponTotalTime[p->curr_weapon][snum])) { - if(aplWeaponReloadSound1[p->curr_weapon][snum]) - spritesound(aplWeaponReloadSound1[p->curr_weapon][snum],pi); - } - else if( ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) || - ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) ) - { - if(aplWeaponReloadSound2[p->curr_weapon][snum]) - spritesound(aplWeaponReloadSound2[p->curr_weapon][snum],pi); - } - else if( (*kb) >= (aplWeaponReload[p->curr_weapon][snum]) ) - { - *kb=0; - p->reloading = 0; + if( (*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1)) + { + if(aplWeaponReloadSound1[p->curr_weapon][snum]) + spritesound(aplWeaponReloadSound1[p->curr_weapon][snum],pi); + } + else if( ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) || + ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) ) + { + if(aplWeaponReloadSound2[p->curr_weapon][snum]) + spritesound(aplWeaponReloadSound2[p->curr_weapon][snum],pi); + } + else if( (*kb) >= (aplWeaponReload[p->curr_weapon][snum]) ) + { + *kb=0; + p->reloading = 0; + } } } else @@ -4949,7 +4952,7 @@ SHOOTINCODE: else *kb = 0; if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && - ((aplWeaponWorksLike[p->curr_weapon][snum] & KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) + ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { if( sb_snum&(1<<2) ) *kb = 1; else *kb = 0; @@ -4957,16 +4960,14 @@ SHOOTINCODE: } } else if ( *kb >= aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] - && ((aplWeaponWorksLike[p->curr_weapon][snum] & KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) + && ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AUTOMATIC ) { if(!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO)) { - if(( sb_snum&(1<<2) ) == 0 ) - { + if(( sb_snum&(1<<2) ) == 0 && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RANDOMRESTART)) *kb = 0; - } if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD) { if( ((*(kb))%3) == 0 ) @@ -4990,7 +4991,7 @@ SHOOTINCODE: } if(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && (*kb) > aplWeaponTotalTime[p->curr_weapon][snum]-aplWeaponHoldDelay[p->curr_weapon][snum] && - ((aplWeaponWorksLike[p->curr_weapon][snum] & KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) + ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { if( sb_snum&(1<<2) ) *kb = 1; else *kb = 0;