[Glide64] Remove TEXTURE_FILTER check
This commit is contained in:
parent
4305890799
commit
2ed3a57917
|
@ -105,7 +105,6 @@ void ConfigCleanup(void)
|
|||
|
||||
void CloseConfig();
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint32_t texfltr[] =
|
||||
{
|
||||
NO_FILTER, //"None"
|
||||
|
@ -145,7 +144,6 @@ uint32_t texhirs[] =
|
|||
// GHQ_HIRESTEXTURES, //"GlideHQ format"
|
||||
// JABO_HIRESTEXTURES, //"Jabo format"
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
|
@ -870,13 +868,11 @@ void CALL DllConfig(HWND hParent)
|
|||
ReleaseGfx();
|
||||
rdp_reset();
|
||||
}
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
if (g_settings->ghq_use)
|
||||
{
|
||||
ext_ghq_shutdown();
|
||||
g_settings->ghq_use = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -60,10 +60,8 @@
|
|||
#include "DepthBufferRender.h"
|
||||
#include "trace.h"
|
||||
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
#include <stdarg.h>
|
||||
int ghq_dmptex_toggle_key = 0;
|
||||
#endif
|
||||
|
||||
GFX_INFO gfx;
|
||||
|
||||
|
@ -406,7 +404,6 @@ void guLoadTextures()
|
|||
free(cursorTex.data);
|
||||
}
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
void DisplayLoadProgress(const wchar_t *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -431,7 +428,6 @@ void DisplayLoadProgress(const wchar_t *format, ...)
|
|||
grColorMask(FXTRUE, FXTRUE);
|
||||
grBufferClear(0, 0, 0xFFFF);
|
||||
}
|
||||
#endif
|
||||
|
||||
int InitGfx()
|
||||
{
|
||||
|
@ -660,7 +656,6 @@ int InitGfx()
|
|||
grClipWindow(0, 0, g_settings->scr_res_x, g_settings->scr_res_y);
|
||||
rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
|
||||
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
if (!g_settings->ghq_use)
|
||||
{
|
||||
g_settings->ghq_use = g_settings->ghq_fltr || g_settings->ghq_enht /*|| g_settings->ghq_cmpr*/ || g_settings->ghq_hirs;
|
||||
|
@ -705,7 +700,6 @@ int InitGfx()
|
|||
}
|
||||
if (g_settings->ghq_use && strstr(extensions, "TEXMIRROR"))
|
||||
voodoo.sup_mirroring = 1;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -919,15 +913,11 @@ void CALL CloseDLL(void)
|
|||
{
|
||||
WriteTrace(TraceGlide64, TraceDebug, "-");
|
||||
|
||||
//CLOSELOG ();
|
||||
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
if (g_settings->ghq_use)
|
||||
{
|
||||
ext_ghq_shutdown();
|
||||
g_settings->ghq_use = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_settings)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@ swapmode(0),
|
|||
lodmode(0),
|
||||
aspectmode(0),
|
||||
use_hotkeys(0),
|
||||
#ifdef TEXTURE_FILTER
|
||||
//Texture filtering options
|
||||
texture_dir(""),
|
||||
ghq_fltr(0),
|
||||
|
@ -55,7 +54,6 @@ ghq_cache_save(0),
|
|||
ghq_cache_size(0),
|
||||
ghq_hirs_let_texartists_fly(0),
|
||||
ghq_hirs_dump(0),
|
||||
#endif
|
||||
autodetect_ucode(0),
|
||||
ucode(0),
|
||||
logging(0),
|
||||
|
@ -282,7 +280,6 @@ void CSettings::ReadSettings()
|
|||
this->unk_clear = FALSE;
|
||||
#endif
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
char texture_dir[260];
|
||||
memset(texture_dir, 0, sizeof(texture_dir));
|
||||
GetSystemSettingSz(Set_texture_dir, texture_dir, sizeof(texture_dir));
|
||||
|
@ -305,7 +302,6 @@ void CSettings::ReadSettings()
|
|||
this->ghq_cache_size = GetSetting(Set_ghq_cache_size);
|
||||
this->ghq_hirs_let_texartists_fly = GetSetting(Set_ghq_hirs_let_texartists_fly);
|
||||
this->ghq_hirs_dump = GetSetting(Set_ghq_hirs_dump);
|
||||
#endif
|
||||
|
||||
if (Set_log_dir != 0)
|
||||
{
|
||||
|
@ -500,7 +496,6 @@ void WriteSettings(void)
|
|||
SetSetting(Set_unk_clear, g_settings->unk_clear);
|
||||
#endif //_ENDUSER_RELEASE_
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
SetSetting(Set_ghq_fltr, g_settings->ghq_fltr);
|
||||
SetSetting(Set_ghq_cmpr, g_settings->ghq_cmpr);
|
||||
SetSetting(Set_ghq_enht, g_settings->ghq_enht);
|
||||
|
@ -519,7 +514,6 @@ void WriteSettings(void)
|
|||
SetSetting(Set_ghq_cache_size, g_settings->ghq_cache_size);
|
||||
SetSetting(Set_ghq_hirs_let_texartists_fly, g_settings->ghq_hirs_let_texartists_fly);
|
||||
SetSetting(Set_ghq_hirs_dump, g_settings->ghq_hirs_dump);
|
||||
#endif
|
||||
|
||||
SetSetting(g_romopen ? Set_filtering : Set_filtering_default, g_settings->filtering);
|
||||
SetSetting(g_romopen ? Set_fog : Set_fog_default, g_settings->fog);
|
||||
|
|
|
@ -61,7 +61,6 @@ public:
|
|||
inline const char * log_dir(void) const { return m_log_dir; }
|
||||
inline bool FlushLogs(void) const { return m_FlushLogs; }
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
//Texture filtering options
|
||||
std::string texture_dir;
|
||||
int ghq_fltr;
|
||||
|
@ -83,7 +82,6 @@ public:
|
|||
int ghq_cache_size;
|
||||
int ghq_hirs_let_texartists_fly;
|
||||
int ghq_hirs_dump;
|
||||
#endif
|
||||
|
||||
//Debug
|
||||
int autodetect_ucode;
|
||||
|
|
|
@ -59,9 +59,8 @@ uint8_t *texture_buffer = tex1;
|
|||
#include "TexMod.h"
|
||||
#include "TexModCI.h"
|
||||
#include "CRC.h"
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
|
||||
extern int ghq_dmptex_toggle_key;
|
||||
#endif
|
||||
|
||||
typedef struct TEXINFO_t {
|
||||
int real_image_width, real_image_height; // FOR ALIGNMENT PURPOSES ONLY!!!
|
||||
|
@ -72,21 +71,17 @@ typedef struct TEXINFO_t {
|
|||
uint32_t crc;
|
||||
uint32_t flags;
|
||||
int splits, splitheight;
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint64 ricecrc;
|
||||
#endif
|
||||
} TEXINFO;
|
||||
|
||||
TEXINFO texinfo[2];
|
||||
int tex_found[2][MAX_TMU];
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
typedef struct HIRESTEX_t {
|
||||
int width, height;
|
||||
uint16_t format;
|
||||
uint8_t *data;
|
||||
} HIRESTEX;
|
||||
#endif
|
||||
|
||||
//****************************************************************
|
||||
// List functions
|
||||
|
@ -940,7 +935,6 @@ void TexCache()
|
|||
WriteTrace(TraceRDP, TraceDebug, " | +- TexCache End");
|
||||
}
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
/** cite from RiceVideo */
|
||||
inline uint32_t CalculateDXT(uint32_t txl2words)
|
||||
{
|
||||
|
@ -974,7 +968,6 @@ inline uint32_t ReverseDXT(uint32_t val, uint32_t /*lrs*/, uint32_t width, uint3
|
|||
return (low + high) / 2;
|
||||
}
|
||||
/** end RiceVideo cite */
|
||||
#endif
|
||||
|
||||
//****************************************************************
|
||||
// LoadTex - does the actual texture loading after everything is prepared
|
||||
|
@ -1032,10 +1025,8 @@ void LoadTex(int id, int tmu)
|
|||
cache->f_mirror_t = FALSE;
|
||||
cache->f_wrap_s = FALSE;
|
||||
cache->f_wrap_t = FALSE;
|
||||
#ifdef TEXTURE_FILTER
|
||||
cache->is_hires_tex = FALSE;
|
||||
cache->ricecrc = texinfo[id].ricecrc;
|
||||
#endif
|
||||
|
||||
// Add this cache to the list
|
||||
AddToList(&cachelut[cache->crc >> 16], cache->crc, uintptr_t(cache), tmu, rdp.n_cached[tmu]);
|
||||
|
@ -1261,7 +1252,6 @@ void LoadTex(int id, int tmu)
|
|||
// when we get passed the texture ram cache and texture buffers for
|
||||
// minimal calculation overhead.
|
||||
//
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
GHQTexInfo ghqTexInfo;
|
||||
memset(&ghqTexInfo, 0, sizeof(GHQTexInfo));
|
||||
uint32_t g64_crc = cache->crc;
|
||||
|
@ -1337,7 +1327,6 @@ void LoadTex(int id, int tmu)
|
|||
if (ghqTexInfo.data)
|
||||
;//do nothing
|
||||
else
|
||||
#endif
|
||||
if (splits > 1)
|
||||
{
|
||||
cache->scale_y = 0.125f;
|
||||
|
@ -1469,11 +1458,7 @@ void LoadTex(int id, int tmu)
|
|||
memcpy(rdp.pal_8, tmp_pal, 512);
|
||||
}
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
if (mod && !modifyPalette && !ghqTexInfo.data)
|
||||
#else
|
||||
if (mod && !modifyPalette)
|
||||
#endif
|
||||
{
|
||||
// Convert the texture to ARGB 4444
|
||||
if (LOWORD(result) == GR_TEXFMT_ARGB_1555)
|
||||
|
@ -1594,7 +1579,6 @@ void LoadTex(int id, int tmu)
|
|||
|
||||
if (GfxInitDone)
|
||||
{
|
||||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
if (g_settings->ghq_use)
|
||||
{
|
||||
if (!ghqTexInfo.data && ghq_dmptex_toggle_key) {
|
||||
|
@ -1753,7 +1737,6 @@ void LoadTex(int id, int tmu)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load the texture into texture memory
|
||||
GrTexInfo *t_info = &cache->t_info;
|
||||
|
|
|
@ -746,13 +746,11 @@ EXPORT void CALL ProcessDList(void)
|
|||
{
|
||||
ReleaseGfx ();
|
||||
rdp_reset();
|
||||
#ifdef TEXTURE_FILTER
|
||||
if (g_settings->ghq_use)
|
||||
{
|
||||
ext_ghq_shutdown();
|
||||
g_settings->ghq_use = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
@ -1124,14 +1122,12 @@ static void rdp_texrect()
|
|||
|
||||
if (((rdp.cmd0 >> 24) & 0xFF) == 0xE5) //texrectflip
|
||||
{
|
||||
#ifdef TEXTURE_FILTER
|
||||
if (rdp.cur_cache[0]->is_hires_tex)
|
||||
{
|
||||
off_size_x = (float)((lr_y - ul_y) * dsdx);
|
||||
off_size_y = (float)((lr_x - ul_x) * dtdy);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
off_size_x = (lr_y - ul_y - 1) * dsdx;
|
||||
off_size_y = (lr_x - ul_x - 1) * dtdy;
|
||||
|
@ -1139,14 +1135,12 @@ static void rdp_texrect()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef TEXTURE_FILTER
|
||||
if (rdp.cur_cache[0]->is_hires_tex)
|
||||
{
|
||||
off_size_x = (float)((lr_x - ul_x) * dsdx);
|
||||
off_size_y = (float)((lr_y - ul_y) * dtdy);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
off_size_x = (lr_x - ul_x - 1) * dsdx;
|
||||
off_size_y = (lr_y - ul_y - 1) * dtdy;
|
||||
|
@ -1564,9 +1558,7 @@ void load_palette(uint32_t addr, uint16_t start, uint16_t count)
|
|||
WriteTrace(TraceRDP, TraceDebug, "Loading palette... ");
|
||||
uint16_t *dpal = rdp.pal_8 + start;
|
||||
uint16_t end = start + count;
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint16_t *spal = (uint16_t*)(gfx.RDRAM + (addr & BMASK));
|
||||
#endif
|
||||
|
||||
for (uint16_t i = start; i < end; i++)
|
||||
{
|
||||
|
@ -1575,12 +1567,10 @@ void load_palette(uint32_t addr, uint16_t start, uint16_t count)
|
|||
|
||||
WriteTrace(TraceTLUT, TraceDebug, "%d: %08lx", i, *(uint16_t *)(gfx.RDRAM + (addr ^ 2)));
|
||||
}
|
||||
#ifdef TEXTURE_FILTER
|
||||
if (g_settings->ghq_hirs)
|
||||
{
|
||||
memcpy((uint8_t*)(rdp.pal_8_rice + start), spal, count << 1);
|
||||
}
|
||||
#endif
|
||||
start >>= 4;
|
||||
end = start + (count >> 4);
|
||||
if (end == start) // it can be if count < 16
|
||||
|
@ -1885,11 +1875,9 @@ static void rdp_loadblock()
|
|||
|
||||
rdp.timg.set_by = 0; // load block
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem];
|
||||
info.tile_width = lr_s;
|
||||
info.dxt = dxt;
|
||||
#endif
|
||||
|
||||
// do a quick boundary check before copying to eliminate the possibility for exception
|
||||
if (ul_s >= 512) {
|
||||
|
@ -2108,7 +2096,6 @@ static void rdp_loadtile()
|
|||
uint32_t height = lr_t - ul_t + 1; // get height
|
||||
uint32_t width = lr_s - ul_s + 1;
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem];
|
||||
info.tile_ul_s = ul_s;
|
||||
info.tile_ul_t = ul_t;
|
||||
|
@ -2122,7 +2109,6 @@ static void rdp_loadtile()
|
|||
}
|
||||
info.tex_width = rdp.timg.width;
|
||||
info.tex_size = rdp.timg.size;
|
||||
#endif
|
||||
|
||||
int line_n = rdp.timg.width << rdp.tiles[tile].size >> 1;
|
||||
uint32_t offs = ul_t * line_n;
|
||||
|
|
|
@ -47,10 +47,7 @@ extern char out_buf[2048];
|
|||
extern uint32_t frame_count; // frame counter
|
||||
|
||||
//GlideHQ support
|
||||
#define TEXTURE_FILTER
|
||||
#ifdef TEXTURE_FILTER
|
||||
#include "Ext_TxFilter.h"
|
||||
#endif
|
||||
|
||||
#define MAX_CACHE 1024*4
|
||||
#define MAX_TRI_CACHE 768 // this is actually # of vertices, not triangles
|
||||
|
@ -167,7 +164,6 @@ typedef struct {
|
|||
uint32_t lr_y;
|
||||
} SCISSOR;
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
extern uint32_t texfltr[];
|
||||
extern uint32_t texenht[];
|
||||
extern uint32_t texcmpr[];
|
||||
|
@ -182,7 +178,6 @@ typedef struct {
|
|||
uint16_t tex_size;
|
||||
uint32_t dxt;
|
||||
} LOAD_TILE_INFO;
|
||||
#endif
|
||||
|
||||
enum rdpBitmapType
|
||||
{
|
||||
|
@ -318,10 +313,8 @@ typedef struct {
|
|||
float c_scl_y; // scale to lower-right center-texel y
|
||||
|
||||
uint32_t mod, mod_color, mod_color1, mod_color2, mod_factor;
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint64 ricecrc;
|
||||
int is_hires_tex;
|
||||
#endif
|
||||
} CACHE_LUT;
|
||||
|
||||
// Lights
|
||||
|
@ -496,9 +489,7 @@ struct RDP_Base{
|
|||
TILE tiles[8]; // 8 tile descriptors
|
||||
uint8_t tmem[4096]; // 4k tmem
|
||||
uint32_t addr[512]; // 512 addresses (used to determine address loaded from)
|
||||
#ifdef TEXTURE_FILTER
|
||||
LOAD_TILE_INFO load_info[512]; // 512 addresses. inforamation about tile loading.
|
||||
#endif
|
||||
|
||||
int cur_tile; // current tile
|
||||
int mipmap_level;
|
||||
|
@ -519,9 +510,7 @@ struct RDP_Base{
|
|||
int Persp_en;
|
||||
int persp_supported;
|
||||
int force_wrap;
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint16_t pal_8_rice[512];
|
||||
#endif
|
||||
|
||||
// Lighting
|
||||
uint32_t num_lights;
|
||||
|
|
Loading…
Reference in New Issue