hack in overbright into d3d path, isolate d3 map support into MAP_PROC define so hopefully minimal can build again

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3743 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2011-03-03 13:32:27 +00:00
parent 85fc11e682
commit c75305f9bf
6 changed files with 36 additions and 1 deletions

View File

@ -1,4 +1,6 @@
#include "quakedef.h"
#ifdef MAP_PROC
#ifndef SERVERONLY
#include "shader.h"
#endif
@ -559,3 +561,5 @@ qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf)
#endif
return true;
}
#endif

View File

@ -2161,11 +2161,13 @@ void Surf_DrawWorld (void)
}
else
#endif
#ifdef MAP_PROC
if (cl.worldmodel->fromgame == fg_doom3)
{
vis = D3_CalcVis(cl.worldmodel, r_refdef.vieworg);
}
else
#endif
{
//extern cvar_t temp1;
if (0)//temp1.value)

View File

@ -626,6 +626,29 @@ static void SelectPassTexture(unsigned int tu, shaderpass_t *pass)
// IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
break;
case PBM_OVERBRIGHT:
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_COLORARG1, D3DTA_TEXTURE);
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_COLORARG2, D3DTA_CURRENT);
{
extern cvar_t gl_overbright;
switch (gl_overbright.ival)
{
case 1:
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_COLOROP, D3DTOP_MODULATE2X);
break;
case 2:
case 3:
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_COLOROP, D3DTOP_MODULATE4X);
break;
default:
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_COLOROP, D3DTOP_MODULATE);
break;
}
}
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
break;
default:
case PBM_MODULATE:
forcemod:

View File

@ -735,8 +735,10 @@ static void (D3D9_R_NewMap) (void)
R_AnimateLight();
Surf_BuildLightmaps();
#ifdef MAP_PROC
if (cl.worldmodel && cl.worldmodel->fromgame == fg_doom3)
D3_GenerateAreas(cl.worldmodel);
#endif
/*wipe any lingering particles*/
P_ClearParticles();

View File

@ -973,8 +973,10 @@ TRACE(("dbg: GLR_NewMap: tp\n"));
TP_NewMap();
R_SetSky(cl.skyname);
#ifdef MAP_PROC
if (cl.worldmodel->fromgame == fg_doom3)
D3_GenerateAreas(cl.worldmodel);
#endif
#ifdef RTLIGHTS
if (r_shadow_realtime_dlight.ival || r_shadow_realtime_world.ival)

View File

@ -354,9 +354,11 @@ qboolean GL_LoadHeightmapModel (model_t *mod, void *buffer);
#ifdef MAP_DOOM
void GLR_DoomWorld();
#endif
#ifdef MAP_PROC
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf);
unsigned char *D3_CalcVis(model_t *mod, vec3_t org);
void D3_GenerateAreas(model_t *mod);
#endif
//gl_bloom.c
#ifdef GLQUAKE