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);
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;

View file

@ -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);

View file

@ -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;i<joynumaxes;i++)
setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]);
inittimer(TICRATE);
CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent);
CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent);
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
for (i=0;i<joynumaxes;i++)
setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]);
inittimer(TICRATE);
//initprintf("* Hold Esc to Abort. *\n");
initprintf("Loading art header...\n");

View file

@ -3297,10 +3297,10 @@ cheat_for_port_credits:
else l = analog_turning;
JoystickAnalogueAxes[thispage*2+(x==7)] = l;
CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick);
{
extern int32 mouseyaxismode; // player.c
mouseyaxismode = -1;
}
{
extern int32 mouseyaxismode; // player.c
mouseyaxismode = -1;
}
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 },
{ "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 }
};
@ -599,27 +601,27 @@ void onvideomodechange(int newmode)
restorepalette = 1;
}
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_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;

View file

@ -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;