From 3389e5974f214e514cd1bc7f2c900fc3fde8a8e4 Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 2 Jan 2013 00:42:42 +0000 Subject: [PATCH] GFX3D: - User settings for 3D rendering states now control all 3D renderers. --- desmume/src/gfx3d.cpp | 9 ++++++++- desmume/src/rasterize.cpp | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index c6a1c5fdc..67b88fe8b 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -2075,10 +2075,17 @@ static void gfx3d_doFlush() gfx3d.state.wbuffer = BIT1(gfx3d.state.activeFlushCommand); gfx3d.renderState = gfx3d.state; - + + // Override render states per user settings if(!CommonSettings.GFX3D_Texture) gfx3d.renderState.enableTexturing = false; + if(!CommonSettings.GFX3D_EdgeMark) + gfx3d.renderState.enableEdgeMarking = false; + + if(!CommonSettings.GFX3D_Fog) + gfx3d.renderState.enableFog = false; + gfx3d.state.activeFlushCommand = gfx3d.state.pendingFlushCommand; int polycount = polylist->count; diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index c8a4c6f95..e4e5cc181 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -1325,7 +1325,7 @@ void SoftRasterizerEngine::framebufferProcess() // - the edges are completely sharp/opaque on the very brief title screen intro, // - the level-start intro gets a pseudo-antialiasing effect around the silhouette, // - the character edges in-level are clearly transparent, and also show well through shield powerups. - if(gfx3d.renderState.enableEdgeMarking && CommonSettings.GFX3D_EdgeMark) + if(gfx3d.renderState.enableEdgeMarking) { //TODO - need to test and find out whether these get grabbed at flush time, or at render time //we can do this by rendering a 3d frame and then freezing the system, but only changing the edge mark colors @@ -1398,7 +1398,7 @@ void SoftRasterizerEngine::framebufferProcess() } } - if(gfx3d.renderState.enableFog && CommonSettings.GFX3D_Fog) + if(gfx3d.renderState.enableFog) { u32 r = GFX3D_5TO6((gfx3d.renderState.fogColor)&0x1F); u32 g = GFX3D_5TO6((gfx3d.renderState.fogColor>>5)&0x1F); @@ -1610,7 +1610,7 @@ static void SoftRastRender() mainSoftRasterizer.height = 192; //setup fog variables (but only if fog is enabled) - if(gfx3d.renderState.enableFog && CommonSettings.GFX3D_Fog) + if(gfx3d.renderState.enableFog) mainSoftRasterizer.updateFogTable(); mainSoftRasterizer.initFramebuffer(256,192,gfx3d.renderState.enableClearImage?true:false);