mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Ignore r_downsize for textures with nocompress and some other minor crap
git-svn-id: https://svn.eduke32.com/eduke32@990 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1a39458bb5
commit
28fedd72e8
11 changed files with 45 additions and 31 deletions
|
@ -971,9 +971,10 @@ static void uploadtexture(int doalloc, int xsiz, int ysiz, int intexfmt, int tex
|
|||
{
|
||||
coltype *wpptr, *rpptr;
|
||||
int x2, y2, j, js=0, x3, y3, y, x, r, g, b, a, k;
|
||||
int hi = (dameth&8192);
|
||||
int hi = (dameth&8192)?1:0;
|
||||
int nocompress = (dameth&4096)?1:0;
|
||||
|
||||
dameth &= ~8192;
|
||||
dameth &= ~(8192|4096);
|
||||
|
||||
if (gltexmaxsize <= 0)
|
||||
{
|
||||
|
@ -991,7 +992,7 @@ static void uploadtexture(int doalloc, int xsiz, int ysiz, int intexfmt, int tex
|
|||
gltexmiplevel = js;
|
||||
while ((xsiz>>js) > (1<<gltexmaxsize) || (ysiz>>js) > (1<<gltexmaxsize)) js++;
|
||||
|
||||
if (hi) js = r_downsize;
|
||||
if (hi && !nocompress) js = r_downsize;
|
||||
|
||||
/*
|
||||
OSD_Printf("Uploading %dx%d %s as %s\n", xsiz,ysiz,
|
||||
|
@ -1250,7 +1251,7 @@ int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head
|
|||
if ((head->flags & 4) && !glusetexcachecompression) goto failure;
|
||||
if (!(head->flags & 4) && glusetexcachecompression) goto failure;
|
||||
|
||||
if (head->quality != r_downsize) goto failure;
|
||||
if (!(head->flags & 8) && head->quality != r_downsize) goto failure; // handle nocompress
|
||||
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
||||
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
||||
|
||||
|
@ -1658,7 +1659,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
|
|||
cachefil=0;
|
||||
}
|
||||
fixtransparency(pic,tsizx,tsizy,xsiz,ysiz,dameth);
|
||||
uploadtexture(doalloc,xsiz,ysiz,intexfmt,texfmt,pic,-1,tsizy,dameth|8192);
|
||||
uploadtexture(doalloc,xsiz,ysiz,intexfmt,texfmt,pic,-1,tsizy,dameth|8192|(hicr->flags & 1?4096:0));
|
||||
}
|
||||
|
||||
// precalculate scaling parameters for replacement
|
||||
|
@ -1707,7 +1708,8 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
|
|||
if (cachefil < 0)
|
||||
{
|
||||
// save off the compressed version
|
||||
cachead.quality = r_downsize;
|
||||
if (hicr->flags & 1) cachead.quality = 0;
|
||||
else cachead.quality = r_downsize;
|
||||
cachead.xdim = tsizx>>cachead.quality;
|
||||
cachead.ydim = tsizy>>cachead.quality;
|
||||
x = 0;
|
||||
|
@ -1716,7 +1718,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
|
|||
if (xsiz == pow2long[j]) { x |= 1; }
|
||||
if (ysiz == pow2long[j]) { x |= 2; }
|
||||
}
|
||||
cachead.flags = (x!=3) | (hasalpha != 255 ? 2 : 0);
|
||||
cachead.flags = (x!=3) | (hasalpha != 255 ? 2 : 0) | (hicr->flags & 1?8:0); // handle nocompress
|
||||
OSD_Printf("No cached tex for tile %d pal %d.\n",dapic,dapalnum);
|
||||
writexcache(fn, picfillen+(dapalnum<<8), dameth, effect, &cachead);
|
||||
}
|
||||
|
|
|
@ -255,6 +255,7 @@ void CONFIG_SetDefaults(void)
|
|||
ud.config.UseJoystick = 0;
|
||||
ud.config.UseMouse = 1;
|
||||
ud.config.VoiceToggle = 5; // bitfield, 1 = local, 2 = dummy, 4 = other players in DM
|
||||
ud.display_bonus_screen = 1;
|
||||
|
||||
Bstrcpy(ud.rtsname, "DUKE.RTS");
|
||||
Bstrcpy(myname, "Duke");
|
||||
|
@ -650,6 +651,7 @@ int32 CONFIG_ReadSetup(void)
|
|||
SCRIPT_GetString(ud.config.scripthandle, "Misc","SelectedGRP",&duke3dgrp[0]);
|
||||
}
|
||||
|
||||
if (mod_dir[0] == '/')
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Misc","ModDir",&mod_dir[0]);
|
||||
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Shadows",&ud.shadows);
|
||||
|
|
|
@ -426,6 +426,7 @@ typedef struct {
|
|||
char ridecule[10][40];
|
||||
char savegame[10][22];
|
||||
char pwlockout[128],rtsname[128];
|
||||
char display_bonus_screen;
|
||||
|
||||
config_t config;
|
||||
} user_defs;
|
||||
|
|
|
@ -84,7 +84,6 @@ static struct strllist
|
|||
char boardfilename[BMAX_PATH] = {0};
|
||||
char waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768], animpal[768];
|
||||
static char firstdemofile[80] = { '\0' };
|
||||
int display_bonus_screen = 1;
|
||||
static int userconfiles = 0;
|
||||
|
||||
static int netparamcount = 0;
|
||||
|
@ -11073,7 +11072,7 @@ MAIN_LOOP_RESTART:
|
|||
|
||||
ready2send = 0;
|
||||
|
||||
if (display_bonus_screen == 1)
|
||||
if (ud.display_bonus_screen == 1)
|
||||
{
|
||||
i = ud.screen_size;
|
||||
ud.screen_size = 0;
|
||||
|
@ -11102,7 +11101,7 @@ MAIN_LOOP_RESTART:
|
|||
}
|
||||
}
|
||||
}
|
||||
display_bonus_screen = 1;
|
||||
ud.display_bonus_screen = 1;
|
||||
ready2send = 0;
|
||||
if (numplayers > 1) g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
if (enterlevel(g_player[myconnectindex].ps->gm))
|
||||
|
|
|
@ -888,6 +888,7 @@ const memberlabel_t userdefslabels[]=
|
|||
{ "levelstats", USERDEFS_LEVELSTATS, 0, 0 },
|
||||
{ "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 },
|
||||
{ "althud", USERDEFS_ALTHUD, 0, 0 },
|
||||
{ "display_bonus_screen", USERDEFS_DISPLAY_BONUS_SCREEN, 0, 0 },
|
||||
{ "", -1, 0, 0 } // END OF LIST
|
||||
};
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ extern int g_weapon_xoffset;
|
|||
extern int g_gs;
|
||||
extern int g_kb;
|
||||
extern int g_looking_angSR1;
|
||||
extern int display_bonus_screen;
|
||||
extern int lastvisinc;
|
||||
extern char cheatstrings[][MAXCHEATLEN];
|
||||
extern char compilefile[BMAX_PATH];
|
||||
|
@ -343,7 +342,8 @@ enum userdefslabels
|
|||
USERDEFS_OBITUARIES,
|
||||
USERDEFS_LEVELSTATS,
|
||||
USERDEFS_CROSSHAIRSCALE,
|
||||
USERDEFS_ALTHUD
|
||||
USERDEFS_ALTHUD,
|
||||
USERDEFS_DISPLAY_BONUS_SCREEN
|
||||
};
|
||||
|
||||
enum sectorlabels
|
||||
|
|
|
@ -886,6 +886,15 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2)
|
|||
SetGameVarID(lVar2, ud.althud, g_i, g_p);
|
||||
return;
|
||||
|
||||
case USERDEFS_DISPLAY_BONUS_SCREEN:
|
||||
if (iSet)
|
||||
{
|
||||
ud.display_bonus_screen = lValue;
|
||||
return;
|
||||
}
|
||||
SetGameVarID(lVar2, ud.display_bonus_screen, g_i, g_p);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -5478,7 +5487,7 @@ static int parse(void)
|
|||
else
|
||||
{
|
||||
g_player[myconnectindex].ps->gm |= MODE_EOL;
|
||||
display_bonus_screen = 0;
|
||||
ud.display_bonus_screen = 0;
|
||||
} // MODE_RESTART;
|
||||
|
||||
break;
|
||||
|
|
|
@ -186,10 +186,10 @@ static void PopulateForm(int pgs)
|
|||
(void)ComboBox_SetCurSel(hwnd, j);
|
||||
for (dirs=finddirs,i=1; dirs != NULL; dirs=dirs->next,i++)
|
||||
{
|
||||
if (Bstrcmp(TEXCACHEDIR,dirs->name) == 0) continue;
|
||||
if (Bstrcasecmp(TEXCACHEDIR,dirs->name) == 0) continue;
|
||||
j = ComboBox_AddString(hwnd, dirs->name);
|
||||
(void)ComboBox_SetItemData(hwnd, j, i);
|
||||
if (Bstrcmp(dirs->name,settings.gamedir) == 0)
|
||||
if (Bstrcasecmp(dirs->name,settings.gamedir) == 0)
|
||||
(void)ComboBox_SetCurSel(hwnd, j);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue