diff --git a/Config.h b/Config.h index 876ae559..108ae109 100644 --- a/Config.h +++ b/Config.h @@ -20,7 +20,6 @@ struct Config struct { u32 maxAnisotropy; - u32 textureBitDepth; u32 forceBilinear; u32 maxBytes; } texture; diff --git a/Textures.cpp b/Textures.cpp index 8e9acfc1..830f1208 100644 --- a/Textures.cpp +++ b/Textures.cpp @@ -431,7 +431,6 @@ void TextureCache::init() { u32 dummyTexture[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - m_bitDepth = config.texture.textureBitDepth; m_maxBytes = config.texture.maxBytes; m_pDummy = addFrameBufferTexture(); // we don't want to remove dummy texture @@ -752,7 +751,7 @@ void TextureCache::_loadBackground(CachedTexture *pTexture) GLenum glType; const TextureLoadParameters & loadParams = imageFormat[pTexture->format == 2 ? G_TT_RGBA16 : G_TT_NONE][pTexture->size][pTexture->format]; - if (((loadParams.autoFormat == GL_RGBA) || (m_bitDepth == 2)) && (m_bitDepth != 0)) { + if (loadParams.autoFormat == GL_RGBA) { pTexture->textureBytes = (pTexture->realWidth * pTexture->realHeight) << 2; GetTexel = loadParams.Get32; glInternalFormat = loadParams.glInternalFormat32; @@ -884,7 +883,7 @@ void TextureCache::_load(u32 _tile, CachedTexture *_pTexture) u32 sizeShift; const TextureLoadParameters & loadParams = imageFormat[gDP.otherMode.textureLUT][_pTexture->size][_pTexture->format]; - if (((loadParams.autoFormat == GL_RGBA) || (m_bitDepth == 2)) && (m_bitDepth != 0)) { + if (loadParams.autoFormat == GL_RGBA) { sizeShift = 2; _pTexture->textureBytes = (_pTexture->realWidth * _pTexture->realHeight) << sizeShift; GetTexel = loadParams.Get32; @@ -1239,12 +1238,6 @@ void _updateShiftScale(u32 _t, CachedTexture *_pTexture) void TextureCache::update(u32 _t) { - if (m_bitDepth != config.texture.textureBitDepth) - { - destroy(); - init(); - } - switch(gSP.textureTile[_t]->textureMode) { case TEXTUREMODE_BGIMAGE: _updateBackground(); diff --git a/Textures.h b/Textures.h index 89dc4041..37ad1cd0 100644 --- a/Textures.h +++ b/Textures.h @@ -64,7 +64,7 @@ struct TextureCache } private: - TextureCache() : m_pDummy(NULL), m_hits(0), m_misses(0), m_bitDepth(0), m_maxBytes(0), m_cachedBytes(0) + TextureCache() : m_pDummy(NULL), m_hits(0), m_misses(0), m_maxBytes(0), m_cachedBytes(0) { current[0] = NULL; current[1] = NULL; @@ -85,7 +85,6 @@ private: Textures m_fbTextures; CachedTexture * m_pDummy; u32 m_hits, m_misses; - u32 m_bitDepth; u32 m_maxBytes; u32 m_cachedBytes; }; diff --git a/mupenplus/Config_mupenplus.cpp b/mupenplus/Config_mupenplus.cpp index 43f2b9ee..46478144 100644 --- a/mupenplus/Config_mupenplus.cpp +++ b/mupenplus/Config_mupenplus.cpp @@ -51,8 +51,6 @@ bool Config_SetDefault() assert(res == M64ERR_SUCCESS); res = ConfigSetDefaultInt(g_configVideoGliden64, "CacheSize", 500, "Size of texture cache in megabytes. Good value is VRAM*3/4"); assert(res == M64ERR_SUCCESS); - res = ConfigSetDefaultInt(g_configVideoGliden64, "TextureBitDepth", 1, "Texture bit depth (0=16bit only, 1=16 and 32 bit, 2=32bit only)"); - assert(res == M64ERR_SUCCESS); //#Emulation Settings res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFog", 1, "Enable fog emulation."); assert(res == M64ERR_SUCCESS); @@ -144,7 +142,6 @@ void Config_LoadConfig() //#Texture Settings config.texture.forceBilinear = ConfigGetParamBool(g_configVideoGliden64, "ForceBilinear"); config.texture.maxBytes = ConfigGetParamInt(g_configVideoGliden64, "CacheSize") * uMegabyte; - config.texture.textureBitDepth = ConfigGetParamInt(g_configVideoGliden64, "TextureBitDepth"); //#Emulation Settings config.generalEmulation.enableFog = ConfigGetParamBool(g_configVideoGliden64, "EnableFog"); config.generalEmulation.enableNoise = ConfigGetParamBool(g_configVideoGliden64, "EnableNoise"); @@ -217,7 +214,6 @@ Option configOptions[] = {"#Texture Settings:", NULL, 0}, {"force bilinear", &config.texture.forceBilinear, 0}, {"cache size", &config.texture.maxBytes, 64 * uMegabyte}, - {"texture bit depth", &config.texture.textureBitDepth, 1}, {"#Emulation Settings:", NULL, 0}, {"enable fog", &config.generalEmulation.enableFog, 1}, {"enable noise", &config.generalEmulation.enableNoise, 1}, diff --git a/posix/Config_posix.cpp b/posix/Config_posix.cpp index d51174b4..22ff63b0 100644 --- a/posix/Config_posix.cpp +++ b/posix/Config_posix.cpp @@ -21,14 +21,6 @@ static GtkWidget *textureDepthCombo; static GtkWidget *textureCacheEntry; static const char *pluginDir = 0; -static const char *textureBitDepth[] = -{ - "16-bit only (faster)", - "16-bit and 32-bit (normal)", - "32-bit only (best for 2xSaI)", - 0 -}; - static void okButton_clicked( GtkWidget *widget, void *data ) { const char *text; @@ -81,12 +73,6 @@ static void okButton_clicked( GtkWidget *widget, void *data ) config.frameBufferEmulation.enable = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableHardwareFBCheck) ); config.generalEmulation.enableHWLighting = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableHardwareLighting) ); const char *depth = gtk_entry_get_text( GTK_ENTRY(GTK_COMBO(textureDepthCombo)->entry) ); - config.texture.textureBitDepth = 1; - for (i = 0; textureBitDepth[i] != 0; i++) - { - if (!strcmp( depth, textureBitDepth[i] )) - config.texture.textureBitDepth = i; - } config.texture.maxBytes = atoi( gtk_entry_get_text( GTK_ENTRY(textureCacheEntry) ) ) * 1048576; // write configuration @@ -115,7 +101,6 @@ static void okButton_clicked( GtkWidget *widget, void *data ) fprintf( f, "enable fog=%d\n", config.generalEmulation.enableFog ); fprintf( f, "enable HardwareFB=%d\n", config.frameBufferEmulation.enable ); fprintf( f, "enable hardware lighting=%d\n", config.generalEmulation.enableHWLighting ); - fprintf( f, "texture depth=%d\n", config.texture.textureBitDepth ); fprintf( f, "cache size=%d\n", config.texture.maxBytes / 1048576 ); fclose( f ); @@ -156,7 +141,6 @@ static void configWindow_show( GtkWidget *widget, void *data ) // textures gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableHardwareFBCheck), (config.frameBufferEmulation.enable) ); - gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(textureDepthCombo)->entry), textureBitDepth[config.texture.textureBitDepth] ); sprintf( text, "%d", config.texture.maxBytes / 1048576 ); gtk_entry_set_text( GTK_ENTRY(textureCacheEntry), text ); } @@ -315,20 +299,6 @@ static int Config_CreateWindow() gtk_table_set_row_spacings( GTK_TABLE(texturesTable), 3 ); gtk_container_add( GTK_CONTAINER(texturesFrame), texturesTable ); - textureDepthLabel = gtk_label_new( "Texture bit depth" ); - textureDepthCombo = gtk_combo_new(); - if (!textureDepthList) - { - i = 0; - while (textureBitDepth[i] != 0) - { - textureDepthList = g_list_append( textureDepthList, (void *)textureBitDepth[i] ); - i++; - } - } - gtk_combo_set_popdown_strings( GTK_COMBO(textureDepthCombo), textureDepthList ); - gtk_combo_set_value_in_list( GTK_COMBO(textureDepthCombo), TRUE, FALSE ); - textureCacheLabel = gtk_label_new( "Texture cache size (MB)" ); textureCacheEntry = gtk_entry_new(); gtk_entry_set_text( GTK_ENTRY(textureCacheEntry), "0" ); @@ -373,7 +343,6 @@ void Config_LoadConfig() config.texture.forceBilinear = 0; config.frameBufferEmulation.copyDepthToRDRAM = 0; config.generalEmulation.enableFog = 1; - config.texture.textureBitDepth = 1; // normal (16 & 32 bits) config.frameBufferEmulation.enable = 0; config.generalEmulation.enableHWLighting = 0; config.texture.maxBytes = 32 * 1048576; @@ -456,10 +425,6 @@ void Config_LoadConfig() { config.generalEmulation.enableHWLighting = atoi( val ); } - else if (!strcasecmp( line, "texture depth" )) - { - config.texture.textureBitDepth = atoi( val ); - } else { printf( "Unknown config option: %s\n", line ); diff --git a/windows/Config_windows.cpp b/windows/Config_windows.cpp index ab3f5bb6..652e604e 100644 --- a/windows/Config_windows.cpp +++ b/windows/Config_windows.cpp @@ -92,9 +92,6 @@ void Config_LoadConfig() RegQueryValueEx( hKey, "Hardware lighting", 0, NULL, (BYTE*)&value, &size ); config.generalEmulation.enableHWLighting = value ? TRUE : FALSE; - RegQueryValueEx( hKey, "Texture Bit Depth", 0, NULL, (BYTE*)&value, &size ); - config.texture.textureBitDepth = value; - RegCloseKey( hKey ); } else @@ -110,7 +107,6 @@ void Config_LoadConfig() config.texture.maxBytes = 192 * uMegabyte; config.frameBufferEmulation.enable = FALSE; config.frameBufferEmulation.copyDepthToRDRAM = FALSE; - config.texture.textureBitDepth = 1; config.generalEmulation.enableHWLighting = FALSE; } @@ -158,9 +154,6 @@ void Config_SaveConfig() value = config.generalEmulation.enableHWLighting ? 1 : 0; RegSetValueEx( hKey, "Hardware lighting", 0, REG_DWORD, (BYTE*)&value, 4 ); - value = config.texture.textureBitDepth; - RegSetValueEx( hKey, "Texture Bit Depth", 0, REG_DWORD, (BYTE*)&value, 4 ); - RegCloseKey( hKey ); } @@ -182,9 +175,6 @@ void Config_ApplyDlgConfig( HWND hWndDlg ) config.video.fullscreenHeight = fullscreen.resolution[i].height; config.video.fullscreenRefresh = fullscreen.refreshRate[SendDlgItemMessage( hWndDlg, IDC_FULLSCREENREFRESH, CB_GETCURSEL, 0, 0 )]; - i = SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_GETCURSEL, 0, 0 ); - config.texture.textureBitDepth = (int)i; - i = SendDlgItemMessage( hWndDlg, IDC_WINDOWEDRES, CB_GETCURSEL, 0, 0 ); config.video.windowedWidth = windowedModes[i].width; config.video.windowedHeight = windowedModes[i].height; @@ -340,7 +330,7 @@ BOOL CALLBACK ConfigDlgProc( HWND hWndDlg, UINT message, WPARAM wParam, LPARAM l SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_ADDSTRING, 0, (LPARAM)"16-bit only (faster)" ); SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_ADDSTRING, 0, (LPARAM)"16-bit and 32-bit (normal)" ); SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_ADDSTRING, 0, (LPARAM)"32-bit only (best for 2xSaI)" ); - SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_SETCURSEL, config.texture.textureBitDepth, 0 ); + SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_SETCURSEL, 1, 0 ); // Enable/disable fog SendDlgItemMessage( hWndDlg, IDC_FOG, BM_SETCHECK, config.generalEmulation.enableFog ? (LPARAM)BST_CHECKED : (LPARAM)BST_UNCHECKED, NULL ); SendDlgItemMessage( hWndDlg, IDC_FRAMEBUFFER, BM_SETCHECK, config.frameBufferEmulation.enable ? (LPARAM)BST_CHECKED : (LPARAM)BST_UNCHECKED, NULL );