Fixes the skybox problem, the problem with the default keyboard configuration, and adds cl_viewbob and cl_weaponsway

git-svn-id: https://svn.eduke32.com/eduke32@506 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-02-23 22:27:22 +00:00
parent eb35e8b927
commit 0dfc03afa0
7 changed files with 48 additions and 64 deletions

View file

@ -1650,7 +1650,7 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
// texture scale by parkar request
if (pth && pth->hicr && ((pth->hicr->xscale != 1.0f) || (pth->hicr->yscale != 1.0f)))
if (pth && pth->hicr && ((pth->hicr->xscale != 1.0f) || (pth->hicr->yscale != 1.0f)) && !drawingskybox)
{
bglMatrixMode(GL_TEXTURE);
bglLoadIdentity();

View file

@ -62,9 +62,6 @@ char *Help2d[]= {
" 'L = Adjust sprite/wall coords",
" 'S = Sprite size",
" '3 = Caption mode",
#ifdef VULGARITY
" '4 = MIN FRAMERATE",
#endif
" '7 = Swap tags",
" 'F = Special functions",
" X = Horiz. flip selected sects",
@ -110,19 +107,6 @@ char *SPRDSPMODE[MAXNOSPRITES]= {
"Sprite display: NO EFFECTORS OR ACTORS"
};
#ifdef VULGARITY
char *Slow[8]= {
"SALES = 0,000,000 ***********************",
"100% OF NOTHING IS !! ********************",
"RENDER IN PROGRESS ***********************",
"YOUR MOTHER IS A WHORE *******************",
"YOU SUCK DONKEY **************************",
"FUCKIN PISS ANT **************************",
"PISS ANT *********************************",
"SLOW *************************************"
};
#endif
#define MAXHELP3D (signed int)(sizeof(Help3d)/sizeof(Help3d[0]))
char *Help3d[]= {
"Mapster32 3D mode help",
@ -2978,23 +2962,18 @@ static void Keys3d(void)
rate=(120<<4)/(i-clockval[clockcnt])-1;
if (framerateon)
{
int p = 8;
Bsprintf(tempbuf,"%ld",rate);
#ifdef VULGARITY
if (rate<MinRate)
{
Bsprintf(tempbuf,"%ld WARNING : %s",rate,Slow[rate/MinD]);
begindrawing();
printext256(0*8,0*8,whitecol,-1,tempbuf,1);
enddrawing();
}
else
#endif
{
Bsprintf(tempbuf,"%ld",rate);
begindrawing();
printext256(0,0,whitecol,-1,tempbuf,!(xdimgame > 640));
enddrawing();
}
if (rate > 9) p += 8;
if (rate > 99) p += 8;
if (rate > 999) p += 8;
if (xdimgame <= 640) p >>= 1;
begindrawing();
printext256(xdimgame-p-1,2,0,-1,tempbuf,!(xdimgame > 640));
printext256(xdimgame-p-2,1,rate < 40?248:whitecol,-1,tempbuf,!(xdimgame > 640));
enddrawing();
}
}
clockval[clockcnt] = i;
@ -3977,25 +3956,6 @@ static void Keys2d(void)
}
// Ver();
#ifdef VULGARITY
if (keystatus[KEYSC_QUOTE]==1 && keystatus[0x05]==1) // ' 4
{
keystatus[0x05]=0;
MinRate=getnumber16("Enter Min Frame Rate : ", MinRate, 128L,0);
printmessage16("");
/*
if(MinRate==40)
{MinRate=24; MinD=3;
}
else
{MinRate=40; MinD=5;
}
*/
MinRate &= ~7;
MinD = MinRate/8;
}
#endif
/*
if(keystatus[KEYSC_QUOTE]==1 && keystatus[0x06]==1) // ' 5
{
@ -4476,7 +4436,7 @@ int loadgroupfiles(char *fn)
initprintf("Warning: Failed including %s on line %s:%d\n",
fn, script->filename,scriptfile_getlinum(script,cmdtokptr));
} else {
loadgroupfiles((const char *)included);
loadgroupfiles((char *)included);
scriptfile_close(included);
}
}

View file

@ -288,6 +288,8 @@ void CONFIG_SetDefaults(void)
ud.statusbarmode = 0;
ud.statusbarscale = 100;
ud.team = 0;
ud.viewbob = 1;
ud.weaponsway = 1;
ud.weaponswitch = 3; // new+empty
UseJoystick = 0;
UseMouse = 1;
@ -309,6 +311,8 @@ void CONFIG_SetDefaults(void)
// JBF 20031211
CONFIG_SetDefaultKeys(0);
memset(MouseFunctions, -1, sizeof(MouseFunctions));
for (i=0; i<MAXMOUSEBUTTONS; i++)
{
@ -712,6 +716,8 @@ int32 CONFIG_ReadSetup(void)
SCRIPT_GetNumber(scripthandle, "Misc", "AutoVote",&ud.autovote);
SCRIPT_GetNumber(scripthandle, "Misc", "AutoMsg",&ud.automsg);
SCRIPT_GetNumber(scripthandle, "Misc", "IDPlayers",&ud.automsg);
SCRIPT_GetNumber(scripthandle, "Misc", "ViewBobbing",&ud.viewbob);
SCRIPT_GetNumber(scripthandle, "Misc", "WeaponSway",&ud.weaponsway);
dummy = useprecache;
SCRIPT_GetNumber(scripthandle, "Misc", "UsePrecache",&dummy);
@ -818,6 +824,8 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutNumber(scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false);
SCRIPT_PutNumber(scripthandle, "Misc", "Team",ud.team,false,false);
SCRIPT_PutNumber(scripthandle, "Misc", "UsePrecache",useprecache,false,false);
SCRIPT_PutNumber(scripthandle, "Misc", "ViewBobbing",ud.viewbob,false,false);
SCRIPT_PutNumber(scripthandle, "Misc", "WeaponSway",ud.weaponsway,false,false);
SCRIPT_PutNumber(scripthandle, "Screen Setup", "Detail",ud.detail,false,false);
#if defined(POLYMOST) && defined(USE_OPENGL)

View file

@ -362,7 +362,7 @@ struct user_defs {
int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
int32 democams,color,pcolor[MAXPLAYERS],msgdisptime,statusbarmode;
int32 m_noexits,noexits,autovote,automsg,idplayers;
int32 team, pteam[MAXPLAYERS];
int32 team, pteam[MAXPLAYERS], viewbob, weaponsway;
int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;

View file

@ -2325,7 +2325,7 @@ static void tics(void)
j=(timer*AVERAGEFRAMES)/(i-frameval[framecnt]);
if (ud.tickrate && !(ps[myconnectindex].gm&MODE_MENU))
{
int ii, k = 0;
int ii, k = 0, p = 8;
if (ud.screen_size != 0 && GTFLAGS(GAMETYPE_FLAG_FRAGBAR) && ud.multimode > 1)
{
@ -2336,10 +2336,15 @@ static void tics(void)
Bsprintf(b,"%ld",max(j,0));
// minitext(scale(windowx1,320,xdim)+1,scale(windowy1,200,ydim)+1,b,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26);
ii = scale(k,ydim,200)+windowy1;
printext256(windowx1+2,ii+2,0,-1,b,!(xdim > 640));
printext256(windowx1+1,ii+1,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?248:31,-1,b,!(xdim > 640));
if (j > 9) p += 8;
if (j > 99) p += 8;
if (j > 999) p += 8;
if (xdim <= 640) p >>= 1;
printext256(windowx2-p+1,ii+2,0,-1,b,!(xdim > 640));
printext256(windowx2-p,ii+1,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?248:31,-1,b,!(xdim > 640));
if (numplayers > 1)
if ((totalclock - lastpackettime) > 1)
@ -4001,7 +4006,10 @@ void displayrooms(int snum,long smoothratio)
}
else if (p->over_shoulder_on == 0)
ud.cameraz += p->opyoff+mulscale16((long)(p->pyoff-p->opyoff),smoothratio);
{
if (ud.viewbob)
ud.cameraz += p->opyoff+mulscale16((long)(p->pyoff-p->opyoff),smoothratio);
}
else view(p,&ud.camerax,&ud.cameray,&ud.cameraz,&ud.camerasect,ud.cameraang,ud.camerahoriz);
cz = hittype[p->i].ceilingz;

View file

@ -639,7 +639,10 @@ cvar[] =
{ "cl_showcoords", "cl_showcoords: show your position in the game world", (void*)&ud.coords, CVAR_BOOL, 0, 0, 1 },
{ "cl_showfps", "cl_showfps: show the frame rate counter", (void*)&ud.tickrate, CVAR_BOOL, 0, 0, 1 },
{ "cl_smoothinput", "cl_smoothinput: enable/disable input smoothing\n", (void*)&SmoothInput, CVAR_BOOL, 0, 0, 1 },
{ "cl_viewbob", "cl_viewbob: enable/disable player head bobbing\n", (void*)&ud.viewbob, CVAR_BOOL, 0, 0, 1 },
{ "cl_weaponsway", "cl_weaponsway: enable/disable player weapon swaying\n", (void*)&ud.weaponsway, CVAR_BOOL, 0, 0, 1 },
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
#if defined(POLYMOST) && defined(USE_OPENGL)
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 0, 1 },

View file

@ -2137,12 +2137,17 @@ void displayweapon(int snum)
gun_pos = 80-(p->weapon_pos*p->weapon_pos);
weapon_xoffset = (160)-90;
weapon_xoffset -= (sintable[((p->weapon_sway>>1)+512)&2047]/(1024+512));
weapon_xoffset -= 58 + p->weapon_ang;
if (sprite[p->i].xrepeat < 32)
gun_pos -= klabs(sintable[(p->weapon_sway<<2)&2047]>>9);
else gun_pos -= klabs(sintable[(p->weapon_sway>>1)&2047]>>10);
if (ud.weaponsway)
{
weapon_xoffset -= (sintable[((p->weapon_sway>>1)+512)&2047]/(1024+512));
if (sprite[p->i].xrepeat < 32)
gun_pos -= klabs(sintable[(p->weapon_sway<<2)&2047]>>9);
else gun_pos -= klabs(sintable[(p->weapon_sway>>1)&2047]>>10);
} else gun_pos -= 16;
weapon_xoffset -= 58 + p->weapon_ang;
gun_pos -= (p->hard_landing<<3);
if (p->last_weapon >= 0)