Merge pull request #845 from raven02/master

Put PPGeDraw into CalculateFPS() and add enableColorDoubling alias
This commit is contained in:
Henrik Rydgård 2013-03-03 00:42:50 -08:00
commit 2211711164
3 changed files with 24 additions and 22 deletions

View File

@ -189,7 +189,7 @@ void __DisplayFireVblank() {
}
}
float calculateFPS()
void CalculateFPS()
{
static double highestFps = 0.0;
static int lastFpsFrame = 0;
@ -208,7 +208,22 @@ float calculateFPS()
lastFpsFrame = gpuStats.numFrames;
lastFpsTime = now;
}
return fps;
char stats[50];
sprintf(stats, "%0.1f", fps);
#ifdef USING_GLES2
float zoom = 0.7f; /// g_Config.iWindowZoom;
float soff = 0.7f;
#else
float zoom = 0.5f; /// g_Config.iWindowZoom;
float soff = 0.5f;
#endif
PPGeBegin();
PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
PPGeDrawText(stats, 476, 4, PPGE_ALIGN_RIGHT, zoom, 0xFF30FF30);
PPGeEnd();
}
void DebugStats()
@ -371,22 +386,7 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
}
if (g_Config.bShowFPSCounter) {
char stats[50];
sprintf(stats, "%0.1f", calculateFPS());
#ifdef USING_GLES2
float zoom = 0.7f; /// g_Config.iWindowZoom;
float soff = 0.7f;
#else
float zoom = 0.5f; /// g_Config.iWindowZoom;
float soff = 0.5f;
#endif
PPGeBegin();
PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
PPGeDrawText(stats, 476, 4, PPGE_ALIGN_RIGHT, zoom, 0xFF30FF30);
PPGeEnd();
CalculateFPS();
}
// Draw screen overlays before blitting. Saves and restores the Ge context.

View File

@ -209,7 +209,7 @@ void __IoInit() {
_splitpath_s(path_buffer, drive, dir, file, ext );
// Mount a couple of filesystems
sprintf(memstickpath, "%s%sMemStick\\", drive, dir);
sprintf(memstickpath, "%s%smemstick\\", drive, dir);
sprintf(flash0path, "%s%sflash0\\", drive, dir);
#else

View File

@ -88,6 +88,7 @@ void GenerateFragmentShader(char *buffer)
bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough() && !gstate.isModeClear();
bool enableAlphaTest = (gstate.alphaTestEnable & 1) && !gstate.isModeClear();
bool enableColorTest = (gstate.colorTestEnable & 1) && !gstate.isModeClear();
bool enableColorDoubling = gstate.texfunc & 0x10000;
if (doTexture)
@ -170,8 +171,8 @@ void GenerateFragmentShader(char *buffer)
// No texture mapping
WRITE(p, " vec4 v = v_color0 %s;\n", secondary);
}
// Color doubling
if (gstate.texfunc & 0x10000) {
if (enableColorDoubling) {
WRITE(p, " v = v * 2.0;\n");
}
@ -191,7 +192,8 @@ void GenerateFragmentShader(char *buffer)
int colorTestMask = gstate.colormask;
if (colorTestFuncs[colorTestFunc][0] != '#')
WRITE(p, "if (!(v.rgb %s (u_alphacolorref.rgb & u_colormask.rgb)) discard;\n", colorTestFuncs[colorTestFunc]);
}*/
}*/
if (enableFog) {
WRITE(p, " float fogCoef = clamp(v_fogdepth, 0.0, 1.0);\n");
WRITE(p, " gl_FragColor = mix(vec4(u_fogcolor, v.a), v, fogCoef);\n");