mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-26 00:40:56 +00:00
Patch from hunter_rus
git-svn-id: https://svn.eduke32.com/eduke32@698 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
dff876f1d0
commit
65d095f88a
2 changed files with 36 additions and 34 deletions
|
@ -944,7 +944,8 @@ static int mdloadskin(md2model *m, int number, int pal, int surf)
|
||||||
{
|
{
|
||||||
osizx = cachead.xdim;
|
osizx = cachead.xdim;
|
||||||
osizy = cachead.ydim;
|
osizy = cachead.ydim;
|
||||||
m->usesalpha = hasalpha = (cachead.flags & 2) ? 1 : 0;
|
hasalpha = (cachead.flags & 2) ? 1 : 0;
|
||||||
|
if (pal < (MAXPALOOKUPS - RESERVEDPALS))m->usesalpha = hasalpha;
|
||||||
kclose(cachefil);
|
kclose(cachefil);
|
||||||
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
||||||
// cachefil >= 0, so it won't be rewritten
|
// cachefil >= 0, so it won't be rewritten
|
||||||
|
@ -963,7 +964,7 @@ static int mdloadskin(md2model *m, int number, int pal, int surf)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
else kclose(filh);
|
else kclose(filh);
|
||||||
m->usesalpha = hasalpha;
|
if (pal < (MAXPALOOKUPS - RESERVEDPALS))m->usesalpha = hasalpha;
|
||||||
if (pal>=SPECPAL&&pal<=REDPAL)
|
if (pal>=SPECPAL&&pal<=REDPAL)
|
||||||
{
|
{
|
||||||
//_initprintf("%cLoaded palmap %d(%dx%d)",sk->palmap?'+':'-',pal,xsiz,ysiz);
|
//_initprintf("%cLoaded palmap %d(%dx%d)",sk->palmap?'+':'-',pal,xsiz,ysiz);
|
||||||
|
@ -1590,27 +1591,27 @@ static md3model *md3load(int fil)
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
char *buf, st[BMAX_PATH+2], bst[BMAX_PATH+2];
|
char *buf, st[BMAX_PATH+2], bst[BMAX_PATH+2];
|
||||||
int j, bsc;
|
int j, bsc;
|
||||||
|
|
||||||
strcpy(st,filnam);
|
strcpy(st,filnam);
|
||||||
for (i=0,j=0;st[i];i++) if ((st[i] == '/') || (st[i] == '\\')) j = i+1;
|
for (i=0,j=0;st[i];i++) if ((st[i] == '/') || (st[i] == '\\')) j = i+1;
|
||||||
st[j] = '*'; st[j+1] = 0;
|
st[j] = '*'; st[j+1] = 0;
|
||||||
kzfindfilestart(st); bsc = -1;
|
kzfindfilestart(st); bsc = -1;
|
||||||
while (kzfindfile(st))
|
while (kzfindfile(st))
|
||||||
{
|
|
||||||
if (st[0] == '\\') continue;
|
|
||||||
|
|
||||||
for (i=0,j=0;st[i];i++) if (st[i] == '.') j = i+1;
|
|
||||||
if ((!stricmp(&st[j],"JPG")) || (!stricmp(&st[j],"PNG")) || (!stricmp(&st[j],"GIF")) ||
|
|
||||||
(!stricmp(&st[j],"PCX")) || (!stricmp(&st[j],"TGA")) || (!stricmp(&st[j],"BMP")) ||
|
|
||||||
(!stricmp(&st[j],"CEL")))
|
|
||||||
{
|
{
|
||||||
for (i=0;st[i];i++) if (st[i] != filnam[i]) break;
|
if (st[0] == '\\') continue;
|
||||||
if (i > bsc) { bsc = i; strcpy(bst,st); }
|
|
||||||
|
for (i=0,j=0;st[i];i++) if (st[i] == '.') j = i+1;
|
||||||
|
if ((!stricmp(&st[j],"JPG")) || (!stricmp(&st[j],"PNG")) || (!stricmp(&st[j],"GIF")) ||
|
||||||
|
(!stricmp(&st[j],"PCX")) || (!stricmp(&st[j],"TGA")) || (!stricmp(&st[j],"BMP")) ||
|
||||||
|
(!stricmp(&st[j],"CEL")))
|
||||||
|
{
|
||||||
|
for (i=0;st[i];i++) if (st[i] != filnam[i]) break;
|
||||||
|
if (i > bsc) { bsc = i; strcpy(bst,st); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!mdloadskin(&m->texid,&m->usesalpha,bst)) ;//bad!
|
||||||
if (!mdloadskin(&m->texid,&m->usesalpha,bst)) ;//bad!
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1748,19 +1749,19 @@ static int md3draw(md3model *m, spritetype *tspr)
|
||||||
pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * shadescale)+m->shadeoff,0),numpalookups)))/((float)numpalookups);
|
pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * shadescale)+m->shadeoff,0),numpalookups)))/((float)numpalookups);
|
||||||
if (!(hictinting[globalpal].f&4))
|
if (!(hictinting[globalpal].f&4))
|
||||||
{
|
{
|
||||||
if (!(m->flags&1)||sector[sprite[tspr->owner].sectnum].floorpal!=0)
|
if (!(m->flags&1)||sector[sprite[tspr->owner].sectnum].floorpal!=0)
|
||||||
{
|
|
||||||
pc[0] *= (float)hictinting[globalpal].r / 255.0;
|
|
||||||
pc[1] *= (float)hictinting[globalpal].g / 255.0;
|
|
||||||
pc[2] *= (float)hictinting[globalpal].b / 255.0;
|
|
||||||
if (hictinting[MAXPALOOKUPS-1].r != 255 || hictinting[MAXPALOOKUPS-1].g != 255 || hictinting[MAXPALOOKUPS-1].b != 255)
|
|
||||||
{
|
{
|
||||||
pc[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0;
|
pc[0] *= (float)hictinting[globalpal].r / 255.0;
|
||||||
pc[1] *= (float)hictinting[MAXPALOOKUPS-1].g / 255.0;
|
pc[1] *= (float)hictinting[globalpal].g / 255.0;
|
||||||
pc[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0;
|
pc[2] *= (float)hictinting[globalpal].b / 255.0;
|
||||||
|
if (hictinting[MAXPALOOKUPS-1].r != 255 || hictinting[MAXPALOOKUPS-1].g != 255 || hictinting[MAXPALOOKUPS-1].b != 255)
|
||||||
|
{
|
||||||
|
pc[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0;
|
||||||
|
pc[1] *= (float)hictinting[MAXPALOOKUPS-1].g / 255.0;
|
||||||
|
pc[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else globalnoeffect=1;
|
||||||
else globalnoeffect=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66; else pc[3] = 0.33; }
|
if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66; else pc[3] = 0.33; }
|
||||||
|
|
|
@ -811,6 +811,7 @@ DWORD WINAPI MouseFunc()
|
||||||
{
|
{
|
||||||
while (moustat&&lpDID[MOUSE])
|
while (moustat&&lpDID[MOUSE])
|
||||||
{
|
{
|
||||||
|
if (!appactive)Sleep(50);else
|
||||||
if ((WaitForSingleObject(inputevt[MOUSE], INFINITE)) == WAIT_OBJECT_0)
|
if ((WaitForSingleObject(inputevt[MOUSE], INFINITE)) == WAIT_OBJECT_0)
|
||||||
{
|
{
|
||||||
ProcessMouse();
|
ProcessMouse();
|
||||||
|
@ -829,6 +830,7 @@ int initmouse(void)
|
||||||
|
|
||||||
initprintf("Initializing mouse... ");
|
initprintf("Initializing mouse... ");
|
||||||
|
|
||||||
|
moustat=1;
|
||||||
mousethread = CreateThread
|
mousethread = CreateThread
|
||||||
(
|
(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -850,7 +852,6 @@ int initmouse(void)
|
||||||
initprintf("OK\n");
|
initprintf("OK\n");
|
||||||
|
|
||||||
// grab input
|
// grab input
|
||||||
moustat=1;
|
|
||||||
grabmouse(1);
|
grabmouse(1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1492,11 +1493,11 @@ static void ProcessMouse()
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
t = getticks();
|
t = getticks();
|
||||||
|
if (!mousegrab) break;
|
||||||
result = IDirectInputDevice2_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA),
|
result = IDirectInputDevice2_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA),
|
||||||
(LPDIDEVICEOBJECTDATA)&didod, &dwElements, 0);
|
(LPDIDEVICEOBJECTDATA)&didod, &dwElements, 0);
|
||||||
|
|
||||||
if (FAILED(result) || !dwElements)break;
|
if (FAILED(result) || !dwElements)break;
|
||||||
if (!mousegrab) break;
|
|
||||||
|
|
||||||
if (result == DI_OK)
|
if (result == DI_OK)
|
||||||
{
|
{
|
||||||
|
@ -1572,7 +1573,7 @@ static void ProcessInputDevices(void)
|
||||||
|
|
||||||
for (t = 0; t < NUM_INPUTS; t++)
|
for (t = 0; t < NUM_INPUTS; t++)
|
||||||
{
|
{
|
||||||
if (*devicedef[t].did)
|
if (*devicedef[t].did&&t!=MOUSE)
|
||||||
{
|
{
|
||||||
result = IDirectInputDevice2_Poll(*devicedef[t].did);
|
result = IDirectInputDevice2_Poll(*devicedef[t].did);
|
||||||
if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED)
|
if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED)
|
||||||
|
|
Loading…
Reference in a new issue