[Glide64] Change capture_screen to g_capture_screen

This commit is contained in:
zilmar 2017-03-13 20:28:34 +11:00
parent e2fcb24529
commit 80e8944d2f
4 changed files with 21 additions and 26 deletions

View File

@ -41,7 +41,6 @@
#include <Common/StdString.h> #include <Common/StdString.h>
#include "Gfx_1.3.h" #include "Gfx_1.3.h"
#include "Version.h" #include "Version.h"
#include <Settings/Settings.h>
#include <Common/CriticalSection.h> #include <Common/CriticalSection.h>
#include <Common/DateTimeClass.h> #include <Common/DateTimeClass.h>
#include <Common/path.h> #include <Common/path.h>
@ -116,8 +115,8 @@ uint32_t offset_textures = 0;
uint32_t offset_texbuf1 = 0; uint32_t offset_texbuf1 = 0;
bool g_ghq_use = false; bool g_ghq_use = false;
int capture_screen = 0; bool g_capture_screen = false;
std::string capture_path; std::string g_capture_path;
#ifdef _WIN32 #ifdef _WIN32
HWND g_hwnd_win = NULL; HWND g_hwnd_win = NULL;
@ -841,8 +840,8 @@ output: none
*******************************************************************/ *******************************************************************/
EXPORT void CALL CaptureScreen(char * Directory) EXPORT void CALL CaptureScreen(char * Directory)
{ {
capture_screen = 1; g_capture_screen = true;
capture_path = Directory; g_capture_path = Directory;
} }
/****************************************************************** /******************************************************************
@ -1176,15 +1175,6 @@ void CALL RomOpen(void)
if (evoodoo) if (evoodoo)
InitGfx(); InitGfx();
if (strstr(extensions, "ROMNAME"))
{
char strSetRomName[] = "grSetRomName";
void (FX_CALL *grSetRomName)(char*);
grSetRomName = (void (FX_CALL *)(char*))grGetProcAddress(strSetRomName);
grSetRomName(name);
}
// **
} }
/****************************************************************** /******************************************************************
@ -1205,9 +1195,8 @@ void CALL ShowCFB(void)
void drawViRegBG() void drawViRegBG()
{ {
WriteTrace(TraceGlide64, TraceDebug, "start"); WriteTrace(TraceGlide64, TraceDebug, "start");
const uint32_t VIwidth = *gfx.VI_WIDTH_REG;
FB_TO_SCREEN_INFO fb_info; FB_TO_SCREEN_INFO fb_info;
fb_info.width = VIwidth; fb_info.width = *gfx.VI_WIDTH_REG;
fb_info.height = (uint32_t)rdp.vi_height; fb_info.height = (uint32_t)rdp.vi_height;
if (fb_info.height == 0) if (fb_info.height == 0)
{ {
@ -1216,7 +1205,7 @@ void drawViRegBG()
} }
fb_info.ul_x = 0; fb_info.ul_x = 0;
fb_info.lr_x = VIwidth - 1; fb_info.lr_x = fb_info.width - 1;
// fb_info.lr_x = (uint32_t)rdp.vi_width - 1; // fb_info.lr_x = (uint32_t)rdp.vi_width - 1;
fb_info.ul_y = 0; fb_info.ul_y = 0;
fb_info.lr_y = fb_info.height - 1; fb_info.lr_y = fb_info.height - 1;
@ -1452,9 +1441,9 @@ void newSwapBuffers()
grDepthMask(FXFALSE); grDepthMask(FXFALSE);
grCullMode(GR_CULL_DISABLE); grCullMode(GR_CULL_DISABLE);
if (capture_screen) if (g_capture_screen)
{ {
CPath path(capture_path); CPath path(g_capture_path);
if (!path.DirectoryExists()) if (!path.DirectoryExists())
{ {
path.DirectoryCreate(); path.DirectoryCreate();
@ -1525,7 +1514,7 @@ void newSwapBuffers()
// Unlock the backbuffer // Unlock the backbuffer
grLfbUnlock(GR_LFB_READ_ONLY, GR_BUFFER_BACKBUFFER); grLfbUnlock(GR_LFB_READ_ONLY, GR_BUFFER_BACKBUFFER);
write_png_file(path, image_width, image_height, ssimg); write_png_file(path, image_width, image_height, ssimg);
capture_screen = 0; g_capture_screen = false;
} }
} }

View File

@ -573,7 +573,6 @@ void CSettings::ReadSettings()
m_wrpAnisotropic = GetSetting(Set_wrpAnisotropic) != 0; m_wrpAnisotropic = GetSetting(Set_wrpAnisotropic) != 0;
m_autodetect_ucode = GetSetting(Set_autodetect_ucode) != 0; m_autodetect_ucode = GetSetting(Set_autodetect_ucode) != 0;
m_unk_as_red = GetSetting(Set_unk_as_red) != 0;
m_wireframe = GetSetting(Set_wireframe) != 0; m_wireframe = GetSetting(Set_wireframe) != 0;
m_wfmode = (wfmode_t)GetSetting(Set_wfmode); m_wfmode = (wfmode_t)GetSetting(Set_wfmode);
m_ucode = ucode_F3DEX2; m_ucode = ucode_F3DEX2;
@ -845,7 +844,6 @@ void CSettings::WriteSettings(void)
SetSetting(Set_wireframe, m_wireframe); SetSetting(Set_wireframe, m_wireframe);
SetSetting(Set_wfmode, m_wfmode); SetSetting(Set_wfmode, m_wfmode);
SetSetting(Set_unk_as_red, m_unk_as_red);
SetSetting(Set_ucode, (int)m_ucode); SetSetting(Set_ucode, (int)m_ucode);
SetSetting(Set_ghq_fltr, m_ghq_fltr); SetSetting(Set_ghq_fltr, m_ghq_fltr);
@ -914,3 +912,10 @@ void CSettings::SettingsChanged(void)
{ {
m_ScreenRes = GetSetting(Set_Resolution); m_ScreenRes = GetSetting(Set_Resolution);
} }
void UseUnregisteredSetting(int /*SettingID*/)
{
#ifdef _WIN32
DebugBreak();
#endif
}

View File

@ -737,10 +737,10 @@ EXPORT void CALL ProcessDList(void)
{ {
ReleaseGfx (); ReleaseGfx ();
rdp_reset(); rdp_reset();
if (g_settings->ghq_use) if (g_ghq_use)
{ {
ext_ghq_shutdown(); ext_ghq_shutdown();
g_settings->ghq_use = 0; g_ghq_use = false;
} }
} }
if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO) if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO)

View File

@ -231,7 +231,6 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
GR_ASPECT_LOG2_1x1, GR_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); GR_ASPECT_LOG2_1x1, GR_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH);
grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
grAuxBufferExt(GR_BUFFER_AUXBUFFER); grAuxBufferExt(GR_BUFFER_AUXBUFFER);
grSstOrigin(GR_ORIGIN_UPPER_LEFT);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grDrawTriangle(&v[0], &v[2], &v[1]); grDrawTriangle(&v[0], &v[2], &v[1]);
grDrawTriangle(&v[2], &v[3], &v[1]); grDrawTriangle(&v[2], &v[3], &v[1]);
@ -287,7 +286,9 @@ void DrawImage(DRAWIMAGE & d)
{ {
if (d.imageW == 0 || d.imageH == 0 || d.frameH == 0) return; if (d.imageW == 0 || d.imageH == 0 || d.frameH == 0) return;
int x_size, y_size, x_shift, y_shift, line; int x_shift, y_shift;
uint16_t x_size, y_size, line;
// choose optimum size for the format/size // choose optimum size for the format/size
switch (d.imageSiz) switch (d.imageSiz)
{ {