I guess this is right

git-svn-id: https://svn.eduke32.com/eduke32@175 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-05-21 00:05:50 +00:00
parent 544bdae42a
commit 51ba738aa0
6 changed files with 96 additions and 96 deletions

View file

@ -2759,11 +2759,11 @@ static void polymost_drawalls (long bunch)
if ((oy < cy0) && (oy < cy1)) domost(x1,oy,x0,oy); if ((oy < cy0) && (oy < cy1)) domost(x1,oy,x0,oy);
else if ((oy < cy0) != (oy < cy1)) else if ((oy < cy0) != (oy < cy1))
{ /* cy1 cy0 { /* cy1 cy0
// / \ // / \
//oy---------- oy--------- //oy---------- oy---------
// / \ // / \
// cy0 cy1 // cy0 cy1
*/ */
ox = (oy-cy0)*(x1-x0)/(cy1-cy0) + x0; ox = (oy-cy0)*(x1-x0)/(cy1-cy0) + x0;
if (oy < cy0) { domost(ox,oy,x0,oy); domost(x1,cy1,ox,oy); } if (oy < cy0) { domost(ox,oy,x0,oy); domost(x1,cy1,ox,oy); }
else { domost(ox,oy,x0,cy0); domost(x1,oy,ox,oy); } else { domost(ox,oy,x0,cy0); domost(x1,oy,ox,oy); }
@ -3353,11 +3353,8 @@ void polymost_drawrooms ()
{ {
short hitsect, hitwall, hitsprite; short hitsect, hitwall, hitsprite;
long vx, vy, vz, hitx, hity, hitz; 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)/1.2; oy2 = (searchy-ghoriz)/ 1.2; oz2 = ghalfx;
ox2 = (searchx-ghalfx)/ratioratio; oy2 = (searchy-ghoriz)/ /*((ratioratio > 1)?*/1.2/*:1)*/; oz2 = ghalfx;
//Tilt rotation //Tilt rotation
ox = ox2*gctang + oy2*gstang; ox = ox2*gctang + oy2*gstang;

View file

@ -240,8 +240,8 @@ void CONFIG_SetDefaults( void )
ud.statusbarmode = 0; ud.statusbarmode = 0;
ud.statusbarscale = 100; ud.statusbarscale = 100;
ud.weaponswitch = 3; // new+empty ud.weaponswitch = 3; // new+empty
UseJoystick = 0; UseJoystick = 0;
UseMouse = 1; UseMouse = 1;
VoiceToggle = 2; VoiceToggle = 2;
Bstrcpy(ud.rtsname, "DUKE.RTS"); Bstrcpy(ud.rtsname, "DUKE.RTS");
@ -677,8 +677,8 @@ void CONFIG_ReadSetup( void )
ps[0].aim_mode = ud.mouseaiming; ps[0].aim_mode = ud.mouseaiming;
SCRIPT_GetNumber( scripthandle, "Controls","MouseFilter",&MouseFilter); SCRIPT_GetNumber( scripthandle, "Controls","MouseFilter",&MouseFilter);
SCRIPT_GetNumber( scripthandle, "Controls","SmoothInput",&SmoothInput); SCRIPT_GetNumber( scripthandle, "Controls","SmoothInput",&SmoothInput);
SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick); SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick);
SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse); SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse);
SCRIPT_GetNumber( scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state 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","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125
SCRIPT_GetNumber( scripthandle, "Controls","AutoAim",&AutoAim); // 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","MouseFilter",MouseFilter,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","SmoothInput",SmoothInput,false,false); SCRIPT_PutNumber( scripthandle, "Controls","SmoothInput",SmoothInput,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false); SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false); SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false);

View file

@ -8541,17 +8541,17 @@ void Startup(void)
exit(1); exit(1);
} }
SetupGameButtons(); SetupGameButtons();
CONFIG_SetupMouse(); CONFIG_SetupMouse();
CONFIG_SetupJoystick(); CONFIG_SetupJoystick();
CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent); CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent);
CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent); CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent);
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too // JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
for (i=0;i<joynumaxes;i++) for (i=0;i<joynumaxes;i++)
setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]); setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]);
inittimer(TICRATE); inittimer(TICRATE);
//initprintf("* Hold Esc to Abort. *\n"); //initprintf("* Hold Esc to Abort. *\n");
initprintf("Loading art header...\n"); initprintf("Loading art header...\n");

View file

@ -3297,10 +3297,10 @@ cheat_for_port_credits:
else l = analog_turning; else l = analog_turning;
JoystickAnalogueAxes[thispage*2+(x==7)] = l; JoystickAnalogueAxes[thispage*2+(x==7)] = l;
CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick); CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick);
{ {
extern int32 mouseyaxismode; // player.c extern int32 mouseyaxismode; // player.c
mouseyaxismode = -1; mouseyaxismode = -1;
} }
break; break;
default:break; default:break;
} }

View file

@ -455,6 +455,8 @@ struct cvarmappings {
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 }, { "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
{ "r_arcorrection", "r_arcorrection: sets amount of aspect ratio correction", (void*)&glratiocorrection, CVAR_INT, 0, 0, 63 },
{ "r_hudcorrect", "r_hudcorrect: enable/disable correct HUD weapon rendering", (void*)&glhudcorrect, CVAR_BOOL, 0, 0, 1 },
{ "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 } { "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 }
}; };
@ -601,24 +603,24 @@ void onvideomodechange(int newmode)
int osdcmd_usemousejoy(const osdfuncparm_t *parm) int osdcmd_usemousejoy(const osdfuncparm_t *parm)
{ {
int showval = (parm->numparms < 1); int showval = (parm->numparms < 1);
if (!Bstrcasecmp(parm->name, "usemouse")) { if (!Bstrcasecmp(parm->name, "usemouse")) {
if (showval) { OSD_Printf("usemouse is %d\n", UseMouse); } if (showval) { OSD_Printf("usemouse is %d\n", UseMouse); }
else { else {
UseMouse = (atoi(parm->parms[0]) != 0); UseMouse = (atoi(parm->parms[0]) != 0);
CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent); CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent);
} }
return OSDCMD_OK; return OSDCMD_OK;
} }
else if (!Bstrcasecmp(parm->name, "usejoystick")) { else if (!Bstrcasecmp(parm->name, "usejoystick")) {
if (showval) { OSD_Printf("usejoystick is %d\n", UseJoystick); } if (showval) { OSD_Printf("usejoystick is %d\n", UseJoystick); }
else { else {
UseJoystick = (atoi(parm->parms[0]) != 0); UseJoystick = (atoi(parm->parms[0]) != 0);
CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent); CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent);
} }
return OSDCMD_OK; return OSDCMD_OK;
} }
return OSDCMD_SHOWHELP; return OSDCMD_SHOWHELP;
} }
int osdcmd_mpmap(const osdfuncparm_t *parm) 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("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("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("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("usejoystick","usejoystick: enables input from the joystick if it is present",osdcmd_usemousejoy);
//baselayer_onvideomodechange = onvideomodechange; //baselayer_onvideomodechange = onvideomodechange;

View file

@ -2705,14 +2705,14 @@ void getinput(short snum)
if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) ) if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) )
{ {
CONTROL_GetInput( &info ); CONTROL_GetInput( &info );
memset(&lastinfo, 0, sizeof(lastinfo)); memset(&lastinfo, 0, sizeof(lastinfo));
loc.fvel = vel = 0; loc.fvel = vel = 0;
loc.svel = svel = 0; loc.svel = svel = 0;
loc.avel = angvel = 0; loc.avel = angvel = 0;
loc.horz = horiz = 0; loc.horz = horiz = 0;
loc.bits = (((long)gamequit)<<26); loc.bits = (((long)gamequit)<<26);
return; return;
} }
if (ud.mouseaiming) if (ud.mouseaiming)
@ -2727,16 +2727,16 @@ void getinput(short snum)
} }
} }
{ {
int32 i; int32 i;
if (myaimmode) i = analog_lookingupanddown; if (myaimmode) i = analog_lookingupanddown;
else i = MouseAnalogueAxes[1]; else i = MouseAnalogueAxes[1];
if (i != mouseyaxismode) { if (i != mouseyaxismode) {
CONTROL_MapAnalogAxis(1, i, controldevice_mouse); CONTROL_MapAnalogAxis(1, i, controldevice_mouse);
mouseyaxismode = i; mouseyaxismode = i;
} }
} }
CONTROL_GetInput( &info ); 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 (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)))) && (aplWeaponClip[p->curr_weapon][snum]) && (((p->ammo_amount[p->curr_weapon]%(aplWeaponClip[p->curr_weapon][snum]))==0))))
{ {
int i; int i = aplWeaponReload[p->curr_weapon][snum] - aplWeaponTotalTime[p->curr_weapon][snum];
i=aplWeaponReload[p->curr_weapon][snum] - aplWeaponTotalTime[p->curr_weapon][snum];
p->reloading = 1; 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]) if( (*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1))
spritesound(aplWeaponReloadSound1[p->curr_weapon][snum],pi); {
} if(aplWeaponReloadSound1[p->curr_weapon][snum])
else if( ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) || spritesound(aplWeaponReloadSound1[p->curr_weapon][snum],pi);
((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) ) }
{ else if( ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) ||
if(aplWeaponReloadSound2[p->curr_weapon][snum]) ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) )
spritesound(aplWeaponReloadSound2[p->curr_weapon][snum],pi); {
} if(aplWeaponReloadSound2[p->curr_weapon][snum])
else if( (*kb) >= (aplWeaponReload[p->curr_weapon][snum]) ) spritesound(aplWeaponReloadSound2[p->curr_weapon][snum],pi);
{ }
*kb=0; else if( (*kb) >= (aplWeaponReload[p->curr_weapon][snum]) )
p->reloading = 0; {
*kb=0;
p->reloading = 0;
}
} }
} }
else else
@ -4949,7 +4952,7 @@ SHOOTINCODE:
else *kb = 0; else *kb = 0;
if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && 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; if( sb_snum&(1<<2) ) *kb = 1;
else *kb = 0; else *kb = 0;
@ -4957,16 +4960,14 @@ SHOOTINCODE:
} }
} }
else if ( *kb >= aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] 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_AUTOMATIC )
{ {
if(!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO)) 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; *kb = 0;
}
if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD) if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD)
{ {
if( ((*(kb))%3) == 0 ) if( ((*(kb))%3) == 0 )
@ -4990,7 +4991,7 @@ SHOOTINCODE:
} }
if(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && if(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET &&
(*kb) > aplWeaponTotalTime[p->curr_weapon][snum]-aplWeaponHoldDelay[p->curr_weapon][snum] && (*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; if( sb_snum&(1<<2) ) *kb = 1;
else *kb = 0; else *kb = 0;