Skip to content

Commit

Permalink
More option removals and making them used a forced aproach.
Browse files Browse the repository at this point in the history
  • Loading branch information
death-droid committed Oct 12, 2012
1 parent 344aa6d commit 5711df9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 122 deletions.
68 changes: 1 addition & 67 deletions Config.cpp
Expand Up @@ -84,16 +84,6 @@ char szIniFileName[300];
char szIniSettingsFileName[300];

//=======================================================

const SettingInfo TextureQualitySettings[] =
{
"Default", FORCE_DEFAULT_FILTER,
"32-bit Texture", FORCE_POINT_FILTER,
"16-bit Texture", FORCE_LINEAR_FILTER,
};



const SettingInfo ForceTextureFilterSettings[] =
{
"N64 Default Texture Filter", FORCE_DEFAULT_FILTER,
Expand Down Expand Up @@ -367,9 +357,6 @@ void WriteConfiguration(void)
fprintf(f, "ForceTextureFilter ");
fprintf(f, "%d\n", (uint32)options.forceTextureFilter);

fprintf(f, "TextureQuality ");
fprintf(f, "%d\n", (uint32)options.textureQuality);

fprintf(f, "TexRectOnly ");
fprintf(f, "%d\n", (uint32)options.bTexRectOnly);

Expand All @@ -388,9 +375,6 @@ void WriteConfiguration(void)
fprintf(f, "FullScreenFrequency ");
fprintf(f, "%d\n", (uint32)windowSetting.uFullScreenRefreshRate);

fprintf(f, "InN64Resolution ");
fprintf(f, "%d\n", (uint32)defaultRomOptions.bInN64Resolution);

fprintf(f, "SaveVRAM ");
fprintf(f, "%d\n", (uint32)defaultRomOptions.bSaveVRAM);

Expand Down Expand Up @@ -513,7 +497,6 @@ void ReadConfiguration(void)
options.bEnableSSE = TRUE;
options.bEnableVertexShader = FALSE;
options.forceTextureFilter = 0;
options.textureQuality = TXT_QUALITY_DEFAULT;
options.bTexRectOnly = FALSE;
options.bLoadHiResTextures = FALSE;
// set caching by default to "off"
Expand All @@ -539,7 +522,6 @@ void ReadConfiguration(void)

defaultRomOptions.bNormalBlender = FALSE;
defaultRomOptions.bNormalCombiner = FALSE;
defaultRomOptions.bInN64Resolution = FALSE;
defaultRomOptions.bSaveVRAM = FALSE;
defaultRomOptions.bOverlapAutoWriteBack = FALSE;
defaultRomOptions.bDoubleSizeForSmallTxtrBuf = FALSE;
Expand Down Expand Up @@ -596,7 +578,6 @@ void ReadConfiguration(void)
options.textureEnhancement = ReadRegistryDwordVal("TextureEnhancement");
options.textureEnhancementControl = ReadRegistryDwordVal("TextureEnhancementControl");
options.forceTextureFilter = ReadRegistryDwordVal("ForceTextureFilter");
options.textureQuality = ReadRegistryDwordVal("TextureQuality");
options.bTexRectOnly = ReadRegistryDwordVal("TexRectOnly");
options.bLoadHiResTextures = ReadRegistryDwordVal("LoadHiResTextures");
// load key value for hires caching from registry
Expand All @@ -610,7 +591,6 @@ void ReadConfiguration(void)
options.DirectXMaxFSAA = ReadRegistryDwordVal("DirectXMaxFSAA");
options.FPSColor = ReadRegistryDwordVal("FPSColor");
options.DirectXMaxAnisotropy = ReadRegistryDwordVal("DirectXMaxAnisotropy");
defaultRomOptions.bInN64Resolution = ReadRegistryDwordVal("InN64Resolution");
defaultRomOptions.bSaveVRAM = ReadRegistryDwordVal("SaveVRAM");
defaultRomOptions.bOverlapAutoWriteBack = ReadRegistryDwordVal("OverlapAutoWriteBack");
defaultRomOptions.bDoubleSizeForSmallTxtrBuf = ReadRegistryDwordVal("DoubleSizeForSmallTxtrBuf");
Expand Down Expand Up @@ -1286,14 +1266,6 @@ ToolTipMsg ttmsg[] = {
"This feature is required by certain games. If it is on, Faster_Loading_Tile option will not work, and sprite ucodes may give errors.\n\n"
"Sorry for an non-perfect implementation."
},
{
IDC_IN_N64_RESOLUTION,
"Frame buffer emulation in N64 native resolution",
"Back buffer resolution on PC is usually much higher than the N64 native resolution. Back buffer texture "
"can be saved and used in PC resolution to give the best speed and quality, but this needs large amounts "
"of video card memory. \n\n"
"If your video card has 32MB or less memory, you'd better to enable this option."
},
{
IDC_SAVE_VRAM,
"Try to save video RAM for lower end video cards",
Expand All @@ -1307,13 +1279,6 @@ ToolTipMsg ttmsg[] = {
"If enabled, such render-to-textures or saved back buffer textures will be written back "
"to RDRAM if they are to be covered partially by new textures.\n"
},
{
IDC_TEXTURE_QUALITY,
"Texture Quality",
"Default - Use the same quality as color buffer quality\n"
"32-bit Texture - Always use 32 bit textures\n"
"16-bit Texture - Always use 16 bit textures\n"
},
{
IDC_TXTR_BUF_DOUBLE_SIZE,
"Double Texture Buffer Size for Small Render-to-Textures",
Expand Down Expand Up @@ -2570,13 +2535,6 @@ LRESULT APIENTRY TextureSettingDialogProc(HWND hDlg, unsigned message, LONG wPar
SendDlgItemMessage(hDlg, IDC_TEXTURE_ENHANCEMENT, CB_SETCURSEL, i, 0);
}

SendDlgItemMessage(hDlg, IDC_TEXTURE_QUALITY, CB_RESETCONTENT, 0, 0);
for( i=0; i<sizeof(TextureQualitySettings)/sizeof(SettingInfo); i++ )
{
SendDlgItemMessage(hDlg, IDC_TEXTURE_QUALITY, CB_INSERTSTRING, i, (LPARAM) TextureQualitySettings[i].description);
}
SendDlgItemMessage(hDlg, IDC_TEXTURE_QUALITY, CB_SETCURSEL, options.textureQuality, 0);

SendDlgItemMessage(hDlg, IDC_FORCE_TEXTURE_FILTER, CB_RESETCONTENT, 0, 0);
for( i=0; i<sizeof(ForceTextureFilterSettings)/sizeof(SettingInfo); i++ )
{
Expand Down Expand Up @@ -2630,9 +2588,7 @@ LRESULT APIENTRY TextureSettingDialogProc(HWND hDlg, unsigned message, LONG wPar
options.textureEnhancement = TextureEnhancementSettings[i].setting;
i = SendDlgItemMessage(hDlg, IDC_FORCE_TEXTURE_FILTER, CB_GETCURSEL, 0, 0);
options.forceTextureFilter = ForceTextureFilterSettings[i].setting;
i = SendDlgItemMessage(hDlg, IDC_TEXTURE_QUALITY, CB_GETCURSEL, 0, 0);
options.textureQuality = TextureQualitySettings[i].setting;


options.bFullTMEM = (SendDlgItemMessage(hDlg, IDC_FULL_TMEM, BM_GETCHECK, 0, 0) == BST_CHECKED);
options.bTexRectOnly = (SendDlgItemMessage(hDlg, IDC_TEXRECT_ONLY, BM_GETCHECK, 0, 0) == BST_CHECKED);
{
Expand Down Expand Up @@ -2715,7 +2671,6 @@ LRESULT APIENTRY DefaultSettingDialogProc(HWND hDlg, unsigned message, LONG wPar

SendDlgItemMessage(hDlg, IDC_ALPHA_BLENDER, BM_SETCHECK, defaultRomOptions.bNormalBlender? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg, IDC_NORMAL_COMBINER, BM_SETCHECK, defaultRomOptions.bNormalCombiner ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg, IDC_IN_N64_RESOLUTION, BM_SETCHECK, defaultRomOptions.bInN64Resolution ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg, IDC_SAVE_VRAM, BM_SETCHECK, defaultRomOptions.bSaveVRAM ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg, IDC_AUTO_WRITE_BACK, BM_SETCHECK, defaultRomOptions.bOverlapAutoWriteBack ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg, IDC_TXTR_BUF_DOUBLE_SIZE, BM_SETCHECK, defaultRomOptions.bDoubleSizeForSmallTxtrBuf ? BST_CHECKED : BST_UNCHECKED, 0);
Expand All @@ -2740,13 +2695,6 @@ LRESULT APIENTRY DefaultSettingDialogProc(HWND hDlg, unsigned message, LONG wPar
SendDlgItemMessage(hDlg, IDC_RENDER_TO_TEXTURE_SETTING, CB_INSERTSTRING, i, (LPARAM) renderToTextureSettings[i]);
}
SendDlgItemMessage(hDlg, IDC_RENDER_TO_TEXTURE_SETTING, CB_SETCURSEL, defaultRomOptions.N64RenderToTextureEmuType, 0);

if( defaultRomOptions.bInN64Resolution )
{
item = GetDlgItem(hDlg,IDC_TXTR_BUF_DOUBLE_SIZE);
EnableWindow(item,FALSE);
}

return(TRUE);

//Propertysheet handling
Expand Down Expand Up @@ -2781,26 +2729,12 @@ LRESULT APIENTRY DefaultSettingDialogProc(HWND hDlg, unsigned message, LONG wPar
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_IN_N64_RESOLUTION:
defaultRomOptions.bInN64Resolution = (SendDlgItemMessage(hDlg, IDC_IN_N64_RESOLUTION, BM_GETCHECK, 0, 0) == BST_CHECKED);
if( defaultRomOptions.bInN64Resolution )
{
item = GetDlgItem(hDlg,IDC_TXTR_BUF_DOUBLE_SIZE);
EnableWindow(item,FALSE);
}
else
{
item = GetDlgItem(hDlg,IDC_TXTR_BUF_DOUBLE_SIZE);
EnableWindow(item,TRUE);
}
break;
case IDOK:
defaultRomOptions.bNormalBlender = (SendDlgItemMessage(hDlg, IDC_ALPHA_BLENDER, BM_GETCHECK, 0, 0) == BST_CHECKED);
defaultRomOptions.bNormalCombiner = (SendDlgItemMessage(hDlg, IDC_NORMAL_COMBINER, BM_GETCHECK, 0, 0) == BST_CHECKED);
defaultRomOptions.N64FrameBufferEmuType = SendDlgItemMessage(hDlg, IDC_FRAME_BUFFER_SETTING, CB_GETCURSEL, 0, 0);
defaultRomOptions.N64FrameBufferWriteBackControl = SendDlgItemMessage(hDlg, IDC_FRAME_BUFFER_WRITE_BACK_CONTROL, CB_GETCURSEL, 0, 0);
defaultRomOptions.N64RenderToTextureEmuType = SendDlgItemMessage(hDlg, IDC_RENDER_TO_TEXTURE_SETTING, CB_GETCURSEL, 0, 0);
defaultRomOptions.bInN64Resolution = (SendDlgItemMessage(hDlg, IDC_IN_N64_RESOLUTION, BM_GETCHECK, 0, 0) == BST_CHECKED);
defaultRomOptions.bSaveVRAM = (SendDlgItemMessage(hDlg, IDC_SAVE_VRAM, BM_GETCHECK, 0, 0) == BST_CHECKED);
defaultRomOptions.bOverlapAutoWriteBack = (SendDlgItemMessage(hDlg, IDC_AUTO_WRITE_BACK, BM_GETCHECK, 0, 0) == BST_CHECKED);
defaultRomOptions.bDoubleSizeForSmallTxtrBuf = (SendDlgItemMessage(hDlg, IDC_TXTR_BUF_DOUBLE_SIZE, BM_GETCHECK, 0, 0) == BST_CHECKED);
Expand Down
8 changes: 0 additions & 8 deletions Config.h
Expand Up @@ -54,12 +54,6 @@ enum {
TXT_BUF_WRITE_BACK_AND_RELOAD ,
};

enum {
TXT_QUALITY_DEFAULT,
TXT_QUALITY_32BIT,
TXT_QUALITY_16BIT,
};

enum {
FORCE_DEFAULT_FILTER,
FORCE_POINT_FILTER,
Expand Down Expand Up @@ -165,7 +159,6 @@ typedef struct {
uint32 forceTextureFilter;
uint32 textureEnhancement;
uint32 textureEnhancementControl;
uint32 textureQuality;
BOOL bTexRectOnly;
BOOL bDumpTexturesToFiles;
BOOL bLoadHiResTextures;
Expand Down Expand Up @@ -218,7 +211,6 @@ typedef struct {
uint32 screenUpdateSetting;
BOOL bNormalCombiner;
BOOL bNormalBlender;
BOOL bInN64Resolution;
BOOL bDoubleSizeForSmallTxtrBuf;
BOOL bSaveVRAM;
BOOL bOverlapAutoWriteBack;
Expand Down
7 changes: 1 addition & 6 deletions Device/FrameBuffer.cpp
Expand Up @@ -1283,12 +1283,7 @@ void FrameBufferManager::SetRenderTexture(void)
status.bHandleN64RenderTexture = true;
newRenderTextureInfo.maxUsedHeight = 0;

if( defaultRomOptions.bInN64Resolution )
{
newRenderTextureInfo.bufferWidth = newRenderTextureInfo.N64Width;
newRenderTextureInfo.bufferHeight = newRenderTextureInfo.N64Height;
}
else if( defaultRomOptions.bDoubleSizeForSmallTxtrBuf && newRenderTextureInfo.N64Width<=128 && newRenderTextureInfo.N64Height<=128)
if( defaultRomOptions.bDoubleSizeForSmallTxtrBuf && newRenderTextureInfo.N64Width<=128 && newRenderTextureInfo.N64Height<=128)
{
newRenderTextureInfo.bufferWidth = newRenderTextureInfo.N64Width*2;
newRenderTextureInfo.bufferHeight = newRenderTextureInfo.N64Height*2;
Expand Down
37 changes: 8 additions & 29 deletions Device/FrameBufferDX.cpp
Expand Up @@ -42,39 +42,18 @@ void DXFrameBufferManager::CopyBackBufferToRenderTexture(int idx, RecentCIInfo &

if( pBackBufferToSave )
{
if( defaultRomOptions.bInN64Resolution )
if( pDstRect == NULL )
{
// Need to scale down from PC resolution to N64 resolution
if( pDstRect == NULL )
{
RECT srcrect = {0,0,windowSetting.uDisplayWidth -1,windowSetting.uDisplayHeight-1};
RECT dstrect = {0,0,ciInfo.dwWidth-1,ciInfo.dwHeight-1};
res = D3DXLoadSurfaceFromSurface(pSavedBuffer,NULL,&dstrect,pBackBufferToSave,NULL,&srcrect,D3DX_FILTER_LINEAR,0xFF000000);
}
else
{
float scaleX = windowSetting.uDisplayWidth/(float)ciInfo.dwWidth;
float scaleY = windowSetting.uDisplayHeight/(float)ciInfo.dwHeight;
RECT srcr2 = { uint32(pDstRect->left*scaleX), uint32(pDstRect->top*scaleY),
uint32(pDstRect->right*scaleX), uint32(pDstRect->bottom*scaleY) };
res = D3DXLoadSurfaceFromSurface(pSavedBuffer,NULL,pDstRect,pBackBufferToSave,NULL,&srcr2,D3DX_FILTER_LINEAR,0xFF000000);
}
res = g_pD3DDev->UpdateSurface(pBackBufferToSave,NULL,pSavedBuffer,NULL);
}
else
{
if( pDstRect == NULL )
{
res = g_pD3DDev->UpdateSurface(pBackBufferToSave,NULL,pSavedBuffer,NULL);
}
else
{
float scaleX = windowSetting.uDisplayWidth/(float)ciInfo.dwWidth;
float scaleY = windowSetting.uDisplayHeight/(float)ciInfo.dwHeight;
RECT srcr = { uint32(pDstRect->left*scaleX), uint32(pDstRect->top*scaleY),
uint32(pDstRect->right*scaleX), uint32(pDstRect->bottom*scaleY) };
POINT srcp = {uint32(pDstRect->left*scaleX), uint32(pDstRect->top*scaleY)};
res = g_pD3DDev->UpdateSurface(pBackBufferToSave,&srcr,pSavedBuffer,&srcp);
}
float scaleX = windowSetting.uDisplayWidth/(float)ciInfo.dwWidth;
float scaleY = windowSetting.uDisplayHeight/(float)ciInfo.dwHeight;
RECT srcr = { uint32(pDstRect->left*scaleX), uint32(pDstRect->top*scaleY),
uint32(pDstRect->right*scaleX), uint32(pDstRect->bottom*scaleY) };
POINT srcp = {uint32(pDstRect->left*scaleX), uint32(pDstRect->top*scaleY)};
res = g_pD3DDev->UpdateSurface(pBackBufferToSave,&srcr,pSavedBuffer,&srcp);
}

if( res != S_OK )
Expand Down
10 changes: 2 additions & 8 deletions Texture/DirectXTexture/DirectXTexture.cpp
Expand Up @@ -117,10 +117,7 @@ LPRICETEXTURE CDirectXTexture::CreateTexture(uint32 dwWidth, uint32 dwHeight, Te
pf = D3DFMT_A4R4G4B4;
break;
default:
if( options.textureQuality == TXT_QUALITY_32BIT )
pf = D3DFMT_A8R8G8B8;
else
pf = D3DFMT_A4R4G4B4;
pf = D3DFMT_A4R4G4B4;
break;
}
break;
Expand All @@ -134,10 +131,7 @@ LPRICETEXTURE CDirectXTexture::CreateTexture(uint32 dwWidth, uint32 dwHeight, Te
pf = D3DFMT_A8R8G8B8;
break;
default:
if( options.textureQuality == TXT_QUALITY_16BIT )
pf = D3DFMT_A4R4G4B4;
else
pf = D3DFMT_A8R8G8B8;
pf = D3DFMT_A8R8G8B8;
break;
}
break;
Expand Down
3 changes: 0 additions & 3 deletions Video.rc
Expand Up @@ -121,7 +121,6 @@ BEGIN
GROUPBOX "N64 Frame Buffer Effect Emulation Options",IDC_STATIC,6,54,288,120
LTEXT "Frame Buffer Write Back:",IDC_STATIC,18,104,126,8
COMBOBOX IDC_FRAME_BUFFER_WRITE_BACK_CONTROL,150,102,132,12,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "In N64 Native Resolution",IDC_IN_N64_RESOLUTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,120,126,10
CONTROL "Try to save VRAM",IDC_SAVE_VRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,132,126,10
CONTROL "Automatic Write Back Overlapped Texture",IDC_AUTO_WRITE_BACK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,144,264,10
Expand Down Expand Up @@ -176,8 +175,6 @@ BEGIN
LTEXT "Force Texture Filter:",IDC_STATIC,12,44,96,8
COMBOBOX IDC_FORCE_TEXTURE_FILTER,114,42,174,84,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Full TMEM Emulation",IDC_FULL_TMEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,66,80,10
LTEXT "Texture Quality:",IDC_STATIC,12,26,96,8
COMBOBOX IDC_TEXTURE_QUALITY,114,24,174,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "For TexRect Only",IDC_TEXRECT_ONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,144,120,10
GROUPBOX "Texture Enhancement && Filters",IDC_STATIC,6,90,288,98
CONTROL "Load hi-res textures if available",IDC_LOAD_HIRES_TEXTURE,
Expand Down
1 change: 0 additions & 1 deletion resource.h
Expand Up @@ -117,7 +117,6 @@
#define IDC_DISABLE_CULLING 1119
#define IDC_TXTR_BUF_DOUBLE_SIZE 1121
#define IDC_RENDER_TO_TEXTURE_SETTING 1124
#define IDC_TEXTURE_QUALITY 1125
#define IDC_FRAME_BUFFER_WRITE_BACK_CONTROL 1126
#define IDC_LOG_TEXTURE_BUFFER 1126
#define IDC_LOG_BACK_BUFFER 1127
Expand Down

0 comments on commit 5711df9

Please sign in to comment.