Mouse smoothing changes to winlayer that I forgot to commit earlier & a little optional status bar hack for 16 and 32 bit modes that someone requested

git-svn-id: https://svn.eduke32.com/eduke32@128 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-30 01:39:58 +00:00
parent aa042016b7
commit 301a6eefd5
9 changed files with 35 additions and 8 deletions

View file

@ -1621,8 +1621,8 @@ static void ProcessInputDevices(void)
if (result == DI_OK) { if (result == DI_OK) {
// process the mouse events // process the mouse events
mousex=0; // mousex=0;
mousey=0; // mousey=0;
for (i=0; i<dwElements; i++) { for (i=0; i<dwElements; i++) {
switch (didod[i].dwOfs) { switch (didod[i].dwOfs) {
case DIMOFS_BUTTON0: case DIMOFS_BUTTON0:
@ -1650,9 +1650,9 @@ static void ProcessInputDevices(void)
mousepresscallback(4, (mouseb&8)==8); mousepresscallback(4, (mouseb&8)==8);
break; break;
case DIMOFS_X: case DIMOFS_X:
mousex = (short)didod[i].dwData; break; mousex += (short)didod[i].dwData; break;
case DIMOFS_Y: case DIMOFS_Y:
mousey = (short)didod[i].dwData; break; mousey += (short)didod[i].dwData; break;
case DIMOFS_Z: case DIMOFS_Z:
if ((int)didod[i].dwData > 0) { // wheel up if ((int)didod[i].dwData > 0) { // wheel up
if (mousewheel[1] > 0 && mousepresscallback) mousepresscallback(6,0); if (mousewheel[1] > 0 && mousepresscallback) mousepresscallback(6,0);

View file

@ -234,6 +234,7 @@ void CONFIG_SetDefaults( void )
ud.color = 0; ud.color = 0;
ud.msgdisptime = 640; ud.msgdisptime = 640;
ud.brightness = 16; ud.brightness = 16;
ud.statusbarmode = 0;
ShowOpponentWeapons = 0; ShowOpponentWeapons = 0;
Bstrcpy(ud.rtsname, "DUKE.RTS"); Bstrcpy(ud.rtsname, "DUKE.RTS");
@ -608,6 +609,7 @@ void CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Misc", "ShowFPS",&ud.tickrate); SCRIPT_GetNumber( scripthandle, "Misc", "ShowFPS",&ud.tickrate);
SCRIPT_GetNumber( scripthandle, "Misc", "Color",&ud.color); SCRIPT_GetNumber( scripthandle, "Misc", "Color",&ud.color);
SCRIPT_GetNumber( scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime); SCRIPT_GetNumber( scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime);
SCRIPT_GetNumber( scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode);
ps[0].palookup = ud.pcolor[0] = ud.color; ps[0].palookup = ud.pcolor[0] = ud.color;
dummy = useprecache; SCRIPT_GetNumber( scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0; dummy = useprecache; SCRIPT_GetNumber( scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0;
@ -733,6 +735,7 @@ void CONFIG_WriteSetup( void )
SCRIPT_PutNumber( scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Color",ud.color,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "Color",ud.color,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false); SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false); SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
//SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false); //SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false);

View file

@ -338,7 +338,7 @@ struct user_defs {
long reccnt; long reccnt;
int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125 int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
int32 brightskins,democams,color,pcolor[MAXPLAYERS],msgdisptime; int32 brightskins,democams,color,pcolor[MAXPLAYERS],msgdisptime,statusbarmode;
int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run; int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair; int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;

View file

@ -343,6 +343,7 @@ void getpackets(void)
else ScreenMode = !ScreenMode; else ScreenMode = !ScreenMode;
KB_ClearKeyDown(sc_Enter); KB_ClearKeyDown(sc_Enter);
restorepalette = 1; restorepalette = 1;
vscrn();
} }
// only dispatch commands here when not in a game // only dispatch commands here when not in a game

View file

@ -802,6 +802,7 @@ LABELS userdefslabels[]= {
{ "democams", USERDEFS_DEMOCAMS, 0, 0 }, { "democams", USERDEFS_DEMOCAMS, 0, 0 },
{ "color", USERDEFS_COLOR, 0, 0 }, { "color", USERDEFS_COLOR, 0, 0 },
{ "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 }, { "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 },
{ "statusbarmode", USERDEFS_STATUSBARMODE, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };

View file

@ -284,7 +284,8 @@ enum userdefslabels {
USERDEFS_BRIGHTSKINS, USERDEFS_BRIGHTSKINS,
USERDEFS_DEMOCAMS, USERDEFS_DEMOCAMS,
USERDEFS_COLOR, USERDEFS_COLOR,
USERDEFS_MSGDISPTIME USERDEFS_MSGDISPTIME,
USERDEFS_STATUSBARMODE
}; };
enum sectorlabels { enum sectorlabels {

View file

@ -617,6 +617,13 @@ void DoUserDef(char bSet, long lLabelID, long lVar2, short sActor, short sPlayer
SetGameVarID((int)lVar2, ud.msgdisptime, sActor, sPlayer); SetGameVarID((int)lVar2, ud.msgdisptime, sActor, sPlayer);
break; break;
case USERDEFS_STATUSBARMODE:
if(bSet)
ud.statusbarmode = lValue;
else
SetGameVarID((int)lVar2, ud.statusbarmode, sActor, sPlayer);
break;
default: default:
break; break;
} }

View file

@ -271,6 +271,19 @@ static int osdcmd_setstatusbarscale(const osdfuncparm_t *parm)
return OSDCMD_OK; 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;
} else if (parm->numparms != 1) return OSDCMD_SHOWHELP;
ud.statusbarmode = Batol(parm->parms[0]);
vscrn();
OSD_Printf("cl_statusbarmode: \"%d\"\n", ud.statusbarmode);
return OSDCMD_OK;
}
static int osdcmd_spawn(const osdfuncparm_t *parm) static int osdcmd_spawn(const osdfuncparm_t *parm)
{ {
long x=0,y=0,z=0; long x=0,y=0,z=0;
@ -624,6 +637,7 @@ int registerosdcommands(void)
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);
OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale); OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale);
OSD_RegisterFunction("cl_statusbarmode","cl_statusbarmode: enable/disable status bar drawing hack", osdcmd_setstatusbarmode);
OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity); OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity);
OSD_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); OSD_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn);
OSD_RegisterFunction("setvar","setvar <gamevar> <value>: sets the value of a gamevar", osdcmd_setvar); OSD_RegisterFunction("setvar","setvar <gamevar> <value>: sets the value of a gamevar", osdcmd_setvar);

View file

@ -395,7 +395,7 @@ void vscrn(void)
if (j >= 12) y1 += 8; if (j >= 12) y1 += 8;
} }
if (ud.screen_size >= 8) y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100)); if (ud.screen_size >= 8 && !(ud.screen_size == 8 && ud.statusbarmode && bpp > 8)) y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100));
y1 = scale(y1,ydim,200); y1 = scale(y1,ydim,200);
y2 = scale(y2,ydim,200); y2 = scale(y2,ydim,200);