better reset 3d code. fix boneheaded mistake which caused alpha blending never to be enabled.
This commit is contained in:
parent
c1435f875b
commit
8ee198006f
|
@ -540,6 +540,7 @@ void NDS_Reset( void)
|
|||
|
||||
GPU_Reset(MainScreen.gpu, 0);
|
||||
GPU_Reset(SubScreen.gpu, 1);
|
||||
gfx3d_reset();
|
||||
gpu3D->NDS_3D_Reset();
|
||||
SPU_Reset();
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
bool (*oglrender_init)() = 0;
|
||||
bool (*oglrender_beginOpenGL)() = 0;
|
||||
|
@ -239,12 +240,17 @@ static void Reset()
|
|||
{
|
||||
int i;
|
||||
|
||||
//reset the texture cache
|
||||
memset(&texcache,0,sizeof(texcache));
|
||||
texcache_count=0;
|
||||
for (i = 0; i < MAX_TEXTURE; i++)
|
||||
texcache[i].id=oglTempTextureID[i];
|
||||
texcache_start=0;
|
||||
texcache_stop=MAX_TEXTURE<<1;
|
||||
|
||||
//clear the framebuffers
|
||||
memset(GPU_screenStencil,0,sizeof(GPU_screenStencil));
|
||||
memset(GPU_screen3D,0,sizeof(GPU_screen3D));
|
||||
}
|
||||
|
||||
static char Init(void)
|
||||
|
@ -780,7 +786,7 @@ void setTexture(unsigned int format, unsigned int texpal)
|
|||
texcache[i].sizeX, texcache[i].sizeY, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, texMAP);
|
||||
|
||||
//DebugDumpTexture(i);
|
||||
DebugDumpTexture(i);
|
||||
|
||||
//============================================================================================
|
||||
|
||||
|
@ -869,7 +875,6 @@ static void BeginRenderPoly()
|
|||
}
|
||||
}
|
||||
} else {
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, texEnv[envMode]);
|
||||
xglEnable(GL_STENCIL_TEST);
|
||||
if(stencilStateSet!=2) {
|
||||
stencilStateSet=2;
|
||||
|
@ -879,6 +884,8 @@ static void BeginRenderPoly()
|
|||
}
|
||||
}
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, texEnv[envMode]);
|
||||
|
||||
//handle toon rendering
|
||||
#ifdef _WIN32
|
||||
if(glUseProgram) {
|
||||
|
|
|
@ -187,9 +187,16 @@ static void makeTables() {
|
|||
|
||||
void gfx3d_init()
|
||||
{
|
||||
twiddleLists();
|
||||
|
||||
makeTables();
|
||||
gfx3d_reset();
|
||||
}
|
||||
|
||||
void gfx3d_reset()
|
||||
{
|
||||
gfx3d = GFX3D();
|
||||
|
||||
listTwiddle = 1;
|
||||
twiddleLists();
|
||||
|
||||
MatrixStackSetMaxSize(&mtxStack[0], 1); // Projection stack
|
||||
MatrixStackSetMaxSize(&mtxStack[1], 31); // Coordinate stack
|
||||
|
@ -1426,16 +1433,16 @@ void gfx3d_Control(unsigned long v)
|
|||
else gfx3d.shading = GFX3D::TOON;
|
||||
|
||||
if((v>>2)&1) gfx3d.enableAlphaTest = true;
|
||||
gfx3d.enableAlphaTest = false;
|
||||
else gfx3d.enableAlphaTest = false;
|
||||
|
||||
if((v>>3)&1) gfx3d.enableAlphaBlending = true;
|
||||
gfx3d.enableAlphaBlending = false;
|
||||
else gfx3d.enableAlphaBlending = false;
|
||||
|
||||
if((v>>4)&1) gfx3d.enableAntialiasing = true;
|
||||
gfx3d.enableAntialiasing = false;
|
||||
else gfx3d.enableAntialiasing = false;
|
||||
|
||||
if((v>>5)&1) gfx3d.enableEdgeMarking = true;
|
||||
gfx3d.enableEdgeMarking = false;
|
||||
else gfx3d.enableEdgeMarking = false;
|
||||
|
||||
//other junk
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "types.h"
|
||||
|
||||
void gfx3d_init();
|
||||
void gfx3d_reset();
|
||||
|
||||
struct POLY {
|
||||
int type; //tri or quad
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////// Console
|
||||
#ifdef BETA_VERSION
|
||||
|
@ -55,6 +58,12 @@ void OpenConsole()
|
|||
SetConsoleOutputCP(GetACP());
|
||||
printlog("DeSmuME v%s BETA\n",VERSION);
|
||||
printlog("- compiled: %s %s\n\n",__DATE__,__TIME__);
|
||||
|
||||
//redirect stdio
|
||||
long lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
int hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
||||
FILE *fp = _fdopen( hConHandle, "w" );
|
||||
*stdout = *fp;
|
||||
}
|
||||
|
||||
void CloseConsole() {
|
||||
|
|
Loading…
Reference in New Issue