Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 881 → Rev 880

/polymer/build/include/baselayer.h
132,9 → 132,9
int setgamma(void);
double vid_gamma, vid_contrast, vid_brightness;
 
#define DEFAULT_GAMMA 1.0
#define DEFAULT_GAMMA 1.2
#define DEFAULT_CONTRAST 1.2
#define DEFAULT_BRIGHTNESS 0.1
#define DEFAULT_BRIGHTNESS 0.0
 
int switchrendermethod(int,int); // 0 = software, 1 = opengl | bool = reinit
 
/polymer/build/src/polymost.c
174,9 → 174,6
int r_parallaxskyclamping = 1;
int r_parallaxskypanning = 0;
 
// line of sight checks before mddraw()
int r_cullobstructedmodels = 0;
 
static float fogresult, fogcol[4];
 
// making this a macro should speed things up at the expense of code size
4426,7 → 4423,6
int posx,posy;
int oldsizx, oldsizy;
int tsizx, tsizy;
short datempsectnum;
 
tspr = tspriteptr[snum];
if (tspr->owner < 0 || tspr->picnum < 0) return;
4471,46 → 4467,7
{
if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0)
{
if (r_cullobstructedmodels)
{
i = 0;
do // this is so gay
{
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz+6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz-6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
updatesector(tspr->x+384,tspr->y,&datempsectnum);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
updatesector(tspr->x-384,tspr->y,&datempsectnum);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
updatesector(tspr->x,tspr->y+384,&datempsectnum);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
updatesector(tspr->x,tspr->y-384,&datempsectnum);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
break;
} while (1);
} else i = 1;
 
if (i && mddraw(tspr)) return;
if (mddraw(tspr)) return;
break; // else, render as flat sprite
}
if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ])
5906,12 → 5863,6
}
return OSDCMD_OK;
}
else if (!Bstrcasecmp(parm->name, "r_cullobstructedmodels"))
{
if (showval) { OSD_Printf("r_cullobstructedmodels is %d\n", r_cullobstructedmodels); }
else r_cullobstructedmodels = (val != 0);
return OSDCMD_OK;
}
#endif
return OSDCMD_SHOWHELP;
}
5972,7 → 5923,6
OSD_RegisterFunction("r_animsmoothing","r_animsmoothing: enable/disable model animation smoothing",osdcmd_polymostvars);
OSD_RegisterFunction("r_parallaxskyclamping","r_parallaxskyclamping: enable/disable parallaxed floor/ceiling sky texture clamping",osdcmd_polymostvars);
OSD_RegisterFunction("r_parallaxskypanning","r_parallaxskypanning: enable/disable parallaxed floor/ceiling panning when drawing a parallaxed sky",osdcmd_polymostvars);
OSD_RegisterFunction("r_cullobstructedmodels","r_cullobstructedmodels: enable/disable hack to cull \"unseen\" models",osdcmd_polymostvars);
#endif
OSD_RegisterFunction("r_models","r_models: enable/disable model rendering in >8-bit mode",osdcmd_polymostvars);
OSD_RegisterFunction("r_hightile","r_hightile: enable/disable hightile texture rendering in >8-bit mode",osdcmd_polymostvars);
/polymer/eduke32/source/config.c
225,8 → 225,7
ud.brightness = 8;
ud.camerasprite = -1;
ud.color = 0;
ud.crosshair = 1;
ud.crosshairscale = 50;
ud.crosshair = 2;
ud.deathmsgs = 1;
ud.democams = 1;
ud.detail = 1;
706,7 → 705,6
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ForceSetup",&ud.config.ForceSetup);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "RunMode",&ud.config.RunMode);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Crosshairs",&ud.crosshair);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "CrosshairScale",&ud.crosshairscale);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "StatusBarScale",&ud.statusbarscale);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowLevelStats",&ud.levelstats);
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowOpponentWeapons",&ud.config.ShowOpponentWeapons);
859,7 → 857,6
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoVote",ud.autovote,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Color",ud.color,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "CrosshairScale",ud.crosshairscale,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DeathMessages",ud.deathmsgs,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DemoCams",ud.democams,false,false);
ud.executions++;
/polymer/eduke32/source/duke3d.h
407,7 → 407,7
typedef struct {
int const_visibility,uw_framerate;
int camera_time,folfvel,folavel,folx,foly,fola;
int reccnt,crosshairscale;
int reccnt;
 
int runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
int democams,color,msgdisptime,statusbarmode;
/polymer/eduke32/source/game.c
3471,7 → 3471,7
SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek);
OnEvent(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, -1);
if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0)
rotatesprite((160L-(g_player[myconnectindex].ps->look_ang>>1))<<16,100L<<16,scale(65536,ud.crosshairscale,100),0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2);
rotatesprite((160L-(g_player[myconnectindex].ps->look_ang>>1))<<16,100L<<16,ud.crosshair>1?65536L>>(ud.crosshair-1):65536L,0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2);
}
#if 0
if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM)
7823,12 → 7823,12
if (BUTTON(gamefunc_Toggle_Crosshair))
{
CONTROL_ClearButton(gamefunc_Toggle_Crosshair);
ud.crosshair = !ud.crosshair;
ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1;
if (ud.crosshair)
{
// Bsprintf(fta_quotes[122],"%s [%d%%]",fta_quotes[20],size[ud.crosshair-1]);
// FTA(122,g_player[screenpeek].ps);
FTA(20,g_player[screenpeek].ps);
int size[] = { 100, 50, 25 };
Bsprintf(fta_quotes[122],"%s [%d%%]",fta_quotes[20],size[ud.crosshair-1]);
FTA(122,g_player[screenpeek].ps);
}
else FTA(21,g_player[screenpeek].ps);
}
/polymer/eduke32/source/gamedef.c
874,7 → 874,6
{ "angleinterpolation", USERDEFS_ANGLEINTERPOLATION, 0, 0 },
{ "deathmsgs", USERDEFS_DEATHMSGS, 0, 0 },
{ "levelstats", USERDEFS_LEVELSTATS, 0, 0 },
{ "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
 
/polymer/eduke32/source/gamedef.h
341,8 → 341,7
USERDEFS_WEAPONSWAY,
USERDEFS_ANGLEINTERPOLATION,
USERDEFS_DEATHMSGS,
USERDEFS_LEVELSTATS,
USERDEFS_CROSSHAIRSCALE
USERDEFS_LEVELSTATS
};
 
enum sectorlabels
/polymer/eduke32/source/gameexec.c
865,15 → 865,6
SetGameVarID(lVar2, ud.levelstats, g_i, g_p);
return;
 
case USERDEFS_CROSSHAIRSCALE:
if (iSet)
{
ud.crosshairscale = lValue;
return;
}
SetGameVarID(lVar2, ud.crosshairscale, g_i, g_p);
return;
 
default:
return;
}
/polymer/eduke32/source/menus.c
2638,11 → 2638,10
char *opts[] =
{
"Show crosshair",
"Crosshair size",
"Show level stats",
"-",
"Screen size",
"Status bar size",
"Show level stats",
"-",
"Allow walk with autorun",
"-",
2655,6 → 2654,8
"-",
"-",
"-",
"-",
"-",
"More...",
NULL
};
2671,7 → 2672,7
io++;
}
 
onbar = (probey == 1 || probey == 2 || probey == 3);
onbar = (probey == 2 || probey == 3);
x = probesm(c,yy+5,0,io);
 
if (x == -1)
2692,19 → 2693,18
switch (io)
{
case 0:
if (x==io) ud.crosshair = !ud.crosshair;
modval(0,1,(int *)&ud.crosshair,1,probey==io);
if (x==io) ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1;
modval(0,3,(int *)&ud.crosshair,1,probey==io);
{
gametextpal(d,yy,ud.crosshair?"Yes":"No", MENUHIGHLIGHT(io), 0);
char *s[] = { "OFF", "ON [100%]", "ON [50%]", "ON [25%]" };
gametextpal(d,yy,s[ud.crosshair], MENUHIGHLIGHT(io), 0);
break;
}
case 1:
{
int sbs = ud.crosshairscale;
_bar(1,d+8,yy+7, &sbs,15,x==io,MENUHIGHLIGHT(io),0,25,100);
ud.crosshairscale = min(100,max(10,sbs));
}
break;
if (x==io) ud.levelstats = 1-ud.levelstats;
modval(0,1,(int *)&ud.levelstats,1,probey==io);
gametextpal(d,yy, ud.levelstats ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break;
case 2:
{
int i;
2739,38 → 2739,33
}
break;
case 4:
if (x==io) ud.levelstats = 1-ud.levelstats;
modval(0,1,(int *)&ud.levelstats,1,probey==io);
gametextpal(d,yy, ud.levelstats ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break;
case 5:
if (x==io) ud.runkey_mode = 1-ud.runkey_mode;
modval(0,1,(int *)&ud.runkey_mode,1,probey==io);
gametextpal(d,yy, ud.runkey_mode ? "No" : "Yes", MENUHIGHLIGHT(io), 0);
break;
case 6:
case 5:
if (x==io) ud.shadows = 1-ud.shadows;
modval(0,1,(int *)&ud.shadows,1,probey==io);
gametextpal(d,yy, ud.shadows ? "On" : "Off", MENUHIGHLIGHT(io), 0);
break;
case 7:
case 6:
if (x==io) ud.screen_tilting = 1-ud.screen_tilting;
if (!ud.screen_tilting)setrollangle(0);
modval(0,1,(int *)&ud.screen_tilting,1,probey==io);
gametextpal(d,yy, ud.screen_tilting ? "On" : "Off", MENUHIGHLIGHT(io), 0);
break; // original had a 'full' option
case 8:
case 7:
if (x==io) ud.showweapons = 1-ud.showweapons;
modval(0,1,(int *)&ud.showweapons,1,probey==io);
ud.config.ShowOpponentWeapons = ud.showweapons;
gametextpal(d,yy, ud.config.ShowOpponentWeapons ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break;
case 9:
case 8:
if (x==io) ud.democams = 1-ud.democams;
modval(0,1,(int *)&ud.democams,1,probey==io);
gametextpal(d,yy, ud.democams ? "On" : "Off", MENUHIGHLIGHT(io), 0);
break;
case 10:
case 9:
if (x==io)
{
enabled = !((g_player[myconnectindex].ps->gm&MODE_GAME) && ud.m_recstat != 1);
2781,7 → 2776,7
enabled = 0;
gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && g_player[myconnectindex].ps->gm&MODE_GAME)?"Running":"On"):"Off",enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE,enabled?0:1);
break;
case 11:
case 10:
if (x==io) cmenu(201);
break;
default:
2851,7 → 2846,7
if (x == -1)
{
cmenu(200);
probey = 11;
probey = 10;
break;
}
 
3844,7 → 3839,6
case 5:
case 6:
gametext(160,144+9+9,"DIGITAL AXES ARE NOT FOR MOUSE LOOK",0,2+8+16);
gametext(160,144+9+9+9,"OR FOR AIMING UP AND DOWN",0,2+8+16);
break;
}
 
4393,7 → 4387,7
menutext(c,50+16+16+16+16,MENUHIGHLIGHT(4),(ud.config.FXDevice<0)||ud.config.SoundToggle==0,"DUKE TALK");
menutext(c,50+16+16+16+16+16,MENUHIGHLIGHT(5),(ud.config.FXDevice<0)||ud.config.SoundToggle==0,"AMBIENCE");
 
menutext(c,50+16+16+16+16+16+16,MENUHIGHLIGHT(6),(ud.config.FXDevice<0)||ud.config.SoundToggle==0,"REVERSE STEREO");
menutext(c,50+16+16+16+16+16+16,MENUHIGHLIGHT(6),(ud.config.FXDevice<0)||ud.config.SoundToggle==0,"FLIP STEREO");
 
{
char *s[] = { "OFF", "LOCAL", "ALL" };
/polymer/eduke32/source/osdcmds.c
631,7 → 631,7
 
cvarmappings cvar[] =
{
{ "crosshair", "crosshair: enable/disable crosshair", (void*)&ud.crosshair, CVAR_BOOL, 0, 0, 1 },
{ "crosshair", "crosshair: enable/disable crosshair", (void*)&ud.crosshair, CVAR_INT, 0, 0, 3 },
 
{ "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&ud.config.AutoAim, CVAR_INT|CVAR_MULTI, 0, 0, 2 },
{ "cl_automsg", "cl_automsg: enable/disable automatically sending messages to all players", (void*)&ud.automsg, CVAR_BOOL, 0, 0, 1 },
1273,20 → 1273,6
return OSDCMD_OK;
}
 
static int osdcmd_setcrosshairscale(const osdfuncparm_t *parm)
{
if (parm->numparms == 0)
{
OSD_Printf("\"cl_crosshairscale\" is \"%d\"\n", ud.crosshairscale);
return OSDCMD_SHOWHELP;
}
else if (parm->numparms != 1) return OSDCMD_SHOWHELP;
 
ud.crosshairscale = min(100,max(10,Batol(parm->parms[0])));
OSD_Printf("cl_statusbarscale %d\n", ud.crosshairscale);
return OSDCMD_OK;
}
 
int registerosdcommands(void)
{
unsigned int i;
1311,7 → 1297,6
OSD_RegisterFunction("bind","bind <key> <string>: associates a keypress with a string of console input. Type \"bind showkeys\" for a list of keys and \"listsymbols\" for a list of valid console commands.", osdcmd_bind);
 
OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale);
OSD_RegisterFunction("cl_crosshairscale","cl_crosshairscale: changes the crosshair scale", osdcmd_setcrosshairscale);
OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu);
 
OSD_RegisterFunction("echo","echo [text]: echoes text to the console", osdcmd_echo);