Commit 0cdfaaa5 by James R.

Merge remote-tracking branch 'lat/awful-mix' into awful-mix-fucked

parents 273b20d8 aad2401b
......@@ -1871,7 +1871,7 @@ boolean G_Responder(event_t *ev)
// allow spy mode changes even during the demo
if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]) && !demo.freecam)
&& (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
{
if (!demo.playback && (splitscreen || !netgame))
displayplayers[0] = consoleplayer;
......
......@@ -223,6 +223,8 @@ typedef struct GLMipmap_s FTextureInfo;
struct FLightInfo
{
FUINT light_level;
FUINT fade_start;
FUINT fade_end;
};
typedef struct FLightInfo FLightInfo;
......@@ -241,9 +243,6 @@ enum hwdsetspecialstate
{
HWD_SET_SHADERS,
HWD_SET_FOG_MODE,
HWD_SET_FOG_DENSITY,
HWD_SET_TEXTUREFILTERMODE,
HWD_SET_TEXTUREANISOTROPICMODE,
......@@ -251,8 +250,8 @@ enum hwdsetspecialstate
};
typedef enum hwdsetspecialstate hwdspecialstate_t;
#define GL_NORMALFOG 0x00000000
#define GL_FADEFOG 0x19000000
#define GL_DEFAULTMIX 0x00000000
#define GL_DEFAULTFOG 0xFF000000
enum hwdfiltermode
{
......
......@@ -74,11 +74,9 @@ EXPORT void HWRAPI(UnSetShader) (void);
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment);
EXPORT void HWRAPI(InitCustomShaders) (void);
EXPORT void HWRAPI(StartBatching) (void);
EXPORT void HWRAPI(RenderBatches) (int *sNumPolys, int *sNumVerts, int *sNumCalls, int *sNumShaders, int *sNumTextures, int *sNumPolyFlags, int *sNumColors);
// ==========================================================================
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
// ==========================================================================
......
......@@ -47,9 +47,6 @@ GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump);
GLPatch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum);
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
// hardware driver
extern INT32 gl_leveltime;
// --------
// hw_draw.c
// --------
......
......@@ -69,11 +69,8 @@ void HWR_AddCommands(void);
// into files like hw_bsp.c, hw_sprites.c...
// hw_main.c: Lighting and fog
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, UINT32 mixcolor, UINT32 fadecolor);
void HWR_NoColormapLighting(FSurfaceInfo *Surface, INT32 light_level, UINT32 mixcolor, UINT32 fadecolor);
UINT8 HWR_FogBlockAlpha(INT32 light, UINT32 color); // Let's see if this can work
void HWR_FoggingOn(void);
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap);
UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap); // Let's see if this can work
FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf);
......@@ -149,6 +146,7 @@ extern consvar_t cv_grcorrecttricks;
extern consvar_t cv_grfovchange;
extern consvar_t cv_grsolvetjoin;
extern consvar_t cv_grspritebillboarding;
extern consvar_t cv_grfakecontrast;
extern consvar_t cv_grfallbackplayermodel;
extern CV_PossibleValue_t granisotropicmode_cons_t[];
......
......@@ -26,6 +26,8 @@
#include "r_opengl.h"
#include "r_vbo.h"
#include "../../p_tick.h" // for leveltime (NOTE: THIS IS BAD, FIGURE OUT HOW TO PROPERLY IMPLEMENT gl_leveltime)
#if defined (HWRENDER) && !defined (NOROPENGL)
struct GLRGBAFloat
......@@ -482,11 +484,6 @@ boolean SetupGLfunc(void)
return true;
}
static INT32 glstate_fog_mode = 0;
static float glstate_fog_density = 0;
INT32 gl_leveltime = 0;
#ifdef GL_SHADERS
typedef GLuint (APIENTRY *PFNglCreateShader) (GLenum);
typedef void (APIENTRY *PFNglShaderSource) (GLuint, GLsizei, const GLchar**, GLint*);
......@@ -552,10 +549,8 @@ typedef enum
gluniform_tint_color,
gluniform_fade_color,
gluniform_lighting,
// fog
gluniform_fog_mode,
gluniform_fog_density,
gluniform_fade_start,
gluniform_fade_end,
// misc. (custom shaders)
gluniform_leveltime,
......@@ -579,9 +574,6 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
// GLSL Software fragment shader
//
// (new shader stuff taken from srb2 shader branch)
// this is missing support for fade_start and fade_end
#define GLSL_DOOM_COLORMAP \
"float R_DoomColormap(float light, float z)\n" \
"{\n" \
......@@ -611,6 +603,12 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
#define GLSL_SOFTWARE_FADE_EQUATION \
"float darkness = R_DoomLightingEquation(lighting);\n" \
"if (fade_start != 0.0 || fade_end != 31.0) {\n" \
"float fs = fade_start / 31.0;\n" \
"float fe = fade_end / 31.0;\n" \
"float fd = fe - fs;\n" \
"darkness = clamp((darkness - fs) * (1.0 / fd), 0.0, 1.0);\n" \
"}\n" \
"final_color = mix(final_color, fade_color, darkness);\n"
#define GLSL_SOFTWARE_FRAGMENT_SHADER \
......@@ -619,6 +617,8 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
"uniform vec4 tint_color;\n" \
"uniform vec4 fade_color;\n" \
"uniform float lighting;\n" \
"uniform float fade_start;\n" \
"uniform float fade_end;\n" \
GLSL_DOOM_COLORMAP \
GLSL_DOOM_LIGHT_EQUATION \
"void main(void) {\n" \
......@@ -631,9 +631,44 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
"gl_FragColor = final_color;\n" \
"}\0"
//
// Water surface shader
//
// Mostly guesstimated, rather than the rest being built off Software science.
// Still needs to distort things underneath/around the water...
//
#define GLSL_WATER_FRAGMENT_SHADER \
"uniform sampler2D tex;\n" \
"uniform vec4 poly_color;\n" \
"uniform vec4 tint_color;\n" \
"uniform vec4 fade_color;\n" \
"uniform float lighting;\n" \
"uniform float fade_start;\n" \
"uniform float fade_end;\n" \
"uniform float leveltime;\n" \
"const float freq = 0.025;\n" \
"const float amp = 0.025;\n" \
"const float speed = 2.0;\n" \
"const float pi = 3.14159;\n" \
GLSL_DOOM_COLORMAP \
GLSL_DOOM_LIGHT_EQUATION \
"void main(void) {\n" \
"float z = (gl_FragCoord.z / gl_FragCoord.w) / 2.0;\n" \
"float a = -pi * (z * freq) + (leveltime * speed);\n" \
"float sdistort = sin(a) * amp;\n" \
"float cdistort = cos(a) * amp;\n" \
"vec4 texel = texture2D(tex, vec2(gl_TexCoord[0].s - sdistort, gl_TexCoord[0].t - cdistort));\n" \
"vec4 base_color = texel * poly_color;\n" \
"vec4 final_color = base_color;\n" \
GLSL_SOFTWARE_TINT_EQUATION \
GLSL_SOFTWARE_FADE_EQUATION \
"final_color.a = texel.a * poly_color.a;\n" \
"gl_FragColor = final_color;\n" \
"}\0"
//
// Fog block shader (Taken from srb2 shader branch)
// Fog block shader
//
// Alpha of the planes themselves are still slightly off -- see HWR_FogBlockAlpha
//
......@@ -642,6 +677,8 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
"uniform vec4 tint_color;\n" \
"uniform vec4 fade_color;\n" \
"uniform float lighting;\n" \
"uniform float fade_start;\n" \
"uniform float fade_end;\n" \
GLSL_DOOM_COLORMAP \
GLSL_DOOM_LIGHT_EQUATION \
"void main(void) {\n" \
......@@ -652,16 +689,15 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
"gl_FragColor = final_color;\n" \
"}\0"
//
// GLSL generic fragment shader
//
#define GLSL_DEFAULT_FRAGMENT_SHADER \
"uniform sampler2D tex;\n" \
"uniform vec4 mix_color;\n" \
"uniform vec4 poly_color;\n" \
"void main(void) {\n" \
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * mix_color;\n" \
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * poly_color;\n" \
"}\0"
static const char *fragment_shaders[] = {
......@@ -681,7 +717,7 @@ static const char *fragment_shaders[] = {
GLSL_SOFTWARE_FRAGMENT_SHADER,
// Water fragment shader
GLSL_SOFTWARE_FRAGMENT_SHADER,
GLSL_WATER_FRAGMENT_SHADER,
// Fog fragment shader
GLSL_FOG_FRAGMENT_SHADER,
......@@ -689,7 +725,7 @@ static const char *fragment_shaders[] = {
// Sky fragment shader
"uniform sampler2D tex;\n"
"void main(void) {\n"
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n" \
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
"}\0",
NULL,
......@@ -709,7 +745,7 @@ static const char *fragment_shaders[] = {
"gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;\n" \
"gl_FrontColor = gl_Color;\n" \
"gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;\n" \
"gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex;\n" \
"gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;\n" \
"}\0"
static const char *vertex_shaders[] = {
......@@ -885,10 +921,8 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
shader->uniforms[gluniform_tint_color] = GETUNI("tint_color");
shader->uniforms[gluniform_fade_color] = GETUNI("fade_color");
shader->uniforms[gluniform_lighting] = GETUNI("lighting");
// fog
shader->uniforms[gluniform_fog_mode] = GETUNI("fog_mode");
shader->uniforms[gluniform_fog_density] = GETUNI("fog_density");
shader->uniforms[gluniform_fade_start] = GETUNI("fade_start");
shader->uniforms[gluniform_fade_end] = GETUNI("fade_end");
// misc. (custom shaders)
shader->uniforms[gluniform_leveltime] = GETUNI("leveltime");
......@@ -899,6 +933,9 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
return true;
}
//
// Custom shader loading
//
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment)
{
#ifdef GL_SHADERS
......@@ -1689,19 +1726,10 @@ static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *
{
if (!custom)
{
if (glstate_fog_mode == 0) // disabled
{
// Nevermind!
pglUseProgram(0);
return;
}
else // enabled
if (gl_shaderprogramchanged)
{
if (gl_shaderprogramchanged)
{
pglUseProgram(gl_shaderprograms[gl_currentshaderprogram].program);
gl_shaderprogramchanged = false;
}
pglUseProgram(gl_shaderprograms[gl_currentshaderprogram].program);
gl_shaderprogramchanged = false;
}
}
else // always load custom shaders
......@@ -1735,26 +1763,11 @@ static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *
// polygon
UNIFORM_4(shader->uniforms[gluniform_poly_color], poly->red, poly->green, poly->blue, poly->alpha, pglUniform4f);
UNIFORM_4(shader->uniforms[gluniform_tint_color], tint->red, tint->green, tint->blue, tint->alpha, pglUniform4f);
// 13062019
// Check for fog
if (glstate_fog_mode == 1)
{
// glstate
UNIFORM_1(shader->uniforms[gluniform_fog_density], glstate_fog_density, pglUniform1f);
// polygon
UNIFORM_4(shader->uniforms[gluniform_fade_color], fade->red, fade->green, fade->blue, fade->alpha, pglUniform4f);
UNIFORM_1(shader->uniforms[gluniform_lighting], Surface->LightInfo.light_level, pglUniform1f);
// Custom shader uniforms
if (custom)
{
UNIFORM_1(shader->uniforms[gluniform_fog_mode], glstate_fog_mode, pglUniform1i);
UNIFORM_1(shader->uniforms[gluniform_leveltime], (float)gl_leveltime, pglUniform1f);
}
}
UNIFORM_4(shader->uniforms[gluniform_fade_color], fade->red, fade->green, fade->blue, fade->alpha, pglUniform4f);
UNIFORM_1(shader->uniforms[gluniform_lighting], Surface->LightInfo.light_level, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_start], Surface->LightInfo.fade_start, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_end], Surface->LightInfo.fade_end, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_leveltime], ((float)leveltime) / TICRATE, pglUniform1f);
#undef UNIFORM_1
#undef UNIFORM_2
......@@ -2592,14 +2605,6 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
}
break;
case HWD_SET_FOG_MODE:
glstate_fog_mode = Value;
break;
case HWD_SET_FOG_DENSITY:
glstate_fog_density = FIXED_TO_FLOAT(Value);
break;
case HWD_SET_TEXTUREFILTERMODE:
switch (Value)
{
......
......@@ -409,7 +409,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
// 0.0722 to blue
// (See this same define in hw_md2.c!)
#define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3)
brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
/** \brief Generates the rainbow colourmaps that are used when a player has the invincibility power
......@@ -8781,8 +8781,11 @@ void K_drawKartHUD(void)
if (!demo.title && (!battlefullscreen || splitscreen))
{
// Draw the CHECK indicator before the other items, so it's overlapped by everything else
if (cv_kartcheck.value && !splitscreen && !players[displayplayers[0]].exiting && !freecam)
K_drawKartPlayerCheck();
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_check)) // delete lua when?
#endif
if (cv_kartcheck.value && !splitscreen && !players[displayplayers[0]].exiting && !freecam)
K_drawKartPlayerCheck();
// Draw WANTED status
if (G_BattleGametype())
......
......@@ -19,6 +19,7 @@ enum hud {
hud_minimap,
hud_item,
hud_position,
hud_check, // "CHECK" f-zero indicator
hud_minirankings, // Rankings to the left
hud_battlebumpers, // mini rankings battle bumpers.
hud_battlefullscreen, // battle huge text (WAIT, WIN, LOSE ...) + karma comeback time
......
......@@ -46,6 +46,7 @@ static const char *const hud_disable_options[] = {
"minimap",
"item",
"position",
"check", // "CHECK" f-zero indicator
"minirankings", // Gametype rankings to the left
"battlerankingsbumpers", // bumper drawer for battle. Useful if you want to make a custom battle gamemode without bumpers being involved.
"battlefullscreen", // battlefullscreen func (WAIT, ATTACK OR PROTECT ...)
......
......@@ -279,7 +279,7 @@ static void M_ResetControls(INT32 choice);
// Video & Sound
menu_t OP_VideoOptionsDef, OP_VideoModeDef;
#ifdef HWRENDER
menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef;
menu_t OP_OpenGLOptionsDef, OP_OpenGLColorDef;
#endif
menu_t OP_SoundOptionsDef;
//static void M_RestartAudio(void);
......@@ -346,7 +346,6 @@ static void M_DrawHUDOptions(void);
static void M_DrawVideoMode(void);
static void M_DrawMonitorToggles(void);
#ifdef HWRENDER
static void M_OGL_DrawFogMenu(void);
static void M_OGL_DrawColorMenu(void);
#endif
static void M_DrawMPMainMenu(void);
......@@ -1241,15 +1240,13 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55},
//{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65},
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 65},
{IT_STRING | IT_CVAR, NULL, "Field of View", &cv_fov, 75},
{IT_STRING | IT_CVAR, NULL, "Field of View", &cv_fov, 75},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100},
#ifdef HWRENDER
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmdls, 115},
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 125},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 135},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 120},
#endif
};
......@@ -1268,8 +1265,6 @@ enum
op_video_fps,
op_video_vsync,
#ifdef HWRENDER
op_video_md2,
op_video_kartman,
op_video_ogl,
#endif
};
......@@ -1282,24 +1277,19 @@ static menuitem_t OP_VideoModeMenu[] =
#ifdef HWRENDER
static menuitem_t OP_OpenGLOptionsMenu[] =
{
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 10},
{IT_STRING|IT_CVAR, NULL, "Software Perspective", &cv_grshearing, 20},
{IT_STRING|IT_CVAR, NULL, "Sprite Billboarding", &cv_grspritebillboarding,30},
{IT_STRING | IT_CVAR, NULL, "3D Models", &cv_grmdls, 10},
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 20},
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 30},
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 50},
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 60},
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 70},
#ifdef _WINDOWS
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 80},
#endif
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 100},
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 110},
};
{IT_STRING|IT_CVAR, NULL, "Texture Quality", &cv_scr_depth, 50},
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 60},
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 70},
static menuitem_t OP_OpenGLFogMenu[] =
{
{IT_STRING|IT_CVAR, NULL, "Fog", &cv_grfog, 10},
{IT_STRING|IT_CVAR, NULL, "Fog density", &cv_grfogdensity, 20},
{IT_STRING|IT_CVAR, NULL, "Wall Contrast Style", &cv_grfakecontrast, 90},
{IT_STRING|IT_CVAR, NULL, "Sprite Billboarding", &cv_grspritebillboarding, 100},
{IT_STRING|IT_CVAR, NULL, "Software Perspective", &cv_grshearing, 110},
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 130},
};
static menuitem_t OP_OpenGLColorMenu[] =
......@@ -2063,17 +2053,6 @@ menu_t OP_MonitorToggleDef =
#ifdef HWRENDER
menu_t OP_OpenGLOptionsDef = DEFAULTMENUSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30);
menu_t OP_OpenGLFogDef =
{
"M_VIDEO",
sizeof (OP_OpenGLFogMenu)/sizeof (menuitem_t),
&OP_OpenGLOptionsDef,
OP_OpenGLFogMenu,
M_OGL_DrawFogMenu,
60, 40,
0,
NULL
};
menu_t OP_OpenGLColorDef =
{
"M_VIDEO",
......@@ -3449,9 +3428,7 @@ void M_Init(void)
#ifdef HWRENDER
// Permanently hide some options based on render mode
if (rendermode == render_soft)
OP_VideoOptionsMenu[op_video_ogl].status =
OP_VideoOptionsMenu[op_video_kartman].status =
OP_VideoOptionsMenu[op_video_md2] .status = IT_DISABLED;
OP_VideoOptionsMenu[op_video_ogl].status = IT_DISABLED;
#endif
#ifndef NONET
......@@ -11098,21 +11075,6 @@ static void M_QuitSRB2(INT32 choice)
// OpenGL specific options
// =====================================================================
#define FOG_DENSITY_ITEM 1
// ===================
// M_OGL_DrawFogMenu()
// ===================
static void M_OGL_DrawFogMenu(void)
{
INT32 mx, my;
mx = currentMenu->x;
my = currentMenu->y;
M_DrawGenericMenu(); // use generic drawer for cursor, items and title
V_DrawString(BASEVIDWIDTH - mx - V_StringWidth(cv_grfogdensity.string, 0),
my + currentMenu->menuitems[FOG_DENSITY_ITEM].alphaKey, V_YELLOWMAP, cv_grfogdensity.string);
}
// =====================
// M_OGL_DrawColorMenu()
// =====================
......
......@@ -7314,6 +7314,10 @@ static ticcmd_t *P_CameraCmd(camera_t *cam)
if (InputDown(gc_aimbackward, 1) || (usejoystick && axis > 0))
forward -= forwardmove[1];
// fire with any button/key
axis = JoyAxis(AXISFIRE, 1);
if (InputDown(gc_fire, 1) || (usejoystick && axis > 0))
cmd->buttons |= BT_ATTACK;
// spectator aiming shit, ahhhh...
player_invert = invertmouse ? -1 : 1;
......@@ -7380,6 +7384,7 @@ void P_DemoCameraMovement(camera_t *cam)
ticcmd_t *cmd;
angle_t thrustangle;
mobj_t *awayviewmobj_hack;
player_t *lastp;
// update democam stuff with what we got here:
democam.cam = cam;
......@@ -7399,6 +7404,14 @@ void P_DemoCameraMovement(camera_t *cam)
else if (cmd->buttons & BT_BRAKE)
cam->z -= 32*mapobjectscale;
// if you hold item, you will lock on to displayplayer. (The last player you were ""f12-ing"")
if (cmd->buttons & BT_ATTACK)
{
lastp = &players[displayplayers[0]]; // Fun fact, I was trying displayplayers[0]->mo as if it was Lua like an absolute idiot.
cam->angle = R_PointToAngle2(cam->x, cam->y, lastp->mo->x, lastp->mo->y);
cam->aiming = R_PointToAngle2(0, cam->z, R_PointToDist2(cam->x, cam->y, lastp->mo->x, lastp->mo->y), lastp->mo->z + lastp->mo->scale*128*P_MobjFlip(lastp->mo)); // This is still unholy. Aim a bit above their heads.
}
cam->momx = cam->momy = cam->momz = 0;
if (cmd->forwardmove != 0)
......
......@@ -1550,8 +1550,6 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_grgammagreen);
CV_RegisterVar(&cv_grgammared);
CV_RegisterVar(&cv_grfovchange);
CV_RegisterVar(&cv_grfog);
//CV_RegisterVar(&cv_grfogcolor);
#ifdef ALAM_LIGHTING
CV_RegisterVar(&cv_grstaticlighting);
CV_RegisterVar(&cv_grdynamiclighting);
......@@ -1560,8 +1558,8 @@ void R_RegisterEngineStuff(void)
#endif
CV_RegisterVar(&cv_grmdls);
CV_RegisterVar(&cv_grfallbackplayermodel);
CV_RegisterVar(&cv_grfogdensity);
CV_RegisterVar(&cv_grspritebillboarding);
CV_RegisterVar(&cv_grfakecontrast);
CV_RegisterVar(&cv_grshearing);
CV_RegisterVar(&cv_grshaders);
#endif
......
......@@ -692,7 +692,7 @@ static inline void I_ShutdownConsole(void){}
//
// StartupKeyboard
//
void I_RegisterSignals (void)
static void I_RegisterSignals (void)
{
#ifdef SIGINT
signal(SIGINT , quit_handler);
......
......@@ -1870,7 +1870,7 @@ void I_StartupGraphics(void)
HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL);
HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL);
HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL);
HWD.pfnRenderSkyDome = hwSym("RenderSkyDome",NULL);
HWD.pfnLoadShaders = hwSym("LoadShaders",NULL);
......@@ -1880,7 +1880,7 @@ void I_StartupGraphics(void)
HWD.pfnLoadCustomShader = hwSym("LoadCustomShader",NULL);
HWD.pfnInitCustomShaders = hwSym("InitCustomShaders",NULL);
HWD.pfnStartBatching = hwSym("StartBatching",NULL);
HWD.pfnRenderBatches = hwSym("RenderBatches",NULL);
......
......@@ -58,11 +58,9 @@ static void CV_Gammaxxx_ONChange(void);
// - You can change them in software,
// but they won't do anything.
static CV_PossibleValue_t grgamma_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
static CV_PossibleValue_t grfogdensity_cons_t[] = {{FRACUNIT/8, "MIN"}, {FRACUNIT*2, "MAX"}, {0, NULL}};
static CV_PossibleValue_t grfakecontrast_cons_t[] = {{0, "Off"}, {1, "Standard"}, {2, "Smooth"}, {0, NULL}};
consvar_t cv_grshaders = {"gr_shaders", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfog = {"gr_fog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfogdensity = {"gr_fogdensity", "0.30", CV_SAVE|CV_FLOAT, grfogdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grgammared = {"gr_gammared", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
......@@ -78,6 +76,7 @@ consvar_t cv_grfallbackplayermodel = {"gr_fallbackplayermodel", "Off", CV_SAVE,
consvar_t cv_grshearing = {"gr_shearing", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfakecontrast = {"gr_fakecontrast", "Standard", CV_SAVE, grfakecontrast_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
const UINT8 gammatable[5][256] =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment