mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Minor kplib optimizations, DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5077 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
110b713a64
commit
eee8d14a8b
1 changed files with 23 additions and 20 deletions
|
@ -622,13 +622,13 @@ static inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static inline int32_t Paeth686(int32_t a, int32_t b, int32_t c)
|
static inline int32_t Paeth686(int32_t const a, int32_t const b, int32_t c)
|
||||||
{
|
{
|
||||||
const int32_t *ptr = &abstab10[(c-a)-(b-512)];
|
int32_t const * const ptr = &abstab10[(c - a) - (b - 512)];
|
||||||
const int32_t esi = *(ptr+b);
|
int32_t const esi = *(ptr + b);
|
||||||
int32_t edi = *(ptr+c);
|
int32_t edi = *(ptr + c);
|
||||||
if (edi >= esi) edi = esi, c = b;
|
if (edi >= esi) edi = esi, c = b;
|
||||||
return (edi < *(ptr+a)) ? c : a;
|
return (edi < *(ptr + a)) ? c : a;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void rgbhlineasm(int32_t x, int32_t xr1, intptr_t p, int32_t ixstp)
|
static inline void rgbhlineasm(int32_t x, int32_t xr1, intptr_t p, int32_t ixstp)
|
||||||
|
@ -683,32 +683,32 @@ static void putbuf(const uint8_t *buf, int32_t leng)
|
||||||
switch (filt)
|
switch (filt)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
while (i < x) { olinbuf[xplc] = buf[i]; xplc--; i++; }
|
while (i < x) { olinbuf[xplc--] = buf[i++]; }
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
while (i < x)
|
while (i < x)
|
||||||
{
|
{
|
||||||
olinbuf[xplc] = (uint8_t)(opixbuf1[xm] += buf[i]);
|
olinbuf[xplc--] = (uint8_t)(opixbuf1[xm] += buf[i++]);
|
||||||
xm = xmn[xm]; xplc--; i++;
|
xm = xmn[xm];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
while (i < x) { olinbuf[xplc] += (uint8_t)buf[i]; xplc--; i++; }
|
while (i < x) { olinbuf[xplc--] += (uint8_t)buf[i++]; }
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
while (i < x)
|
while (i < x)
|
||||||
{
|
{
|
||||||
opixbuf1[xm] = olinbuf[xplc] = (uint8_t)(((opixbuf1[xm]+olinbuf[xplc])>>1)+buf[i]);
|
opixbuf1[xm] = olinbuf[xplc] = (uint8_t)(((opixbuf1[xm]+olinbuf[xplc])>>1)+buf[i++]);
|
||||||
xm = xmn[xm]; xplc--; i++;
|
xm = xmn[xm]; xplc--;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
while (i < x)
|
while (i < x)
|
||||||
{
|
{
|
||||||
opixbuf1[xm] = (uint8_t)(Paeth686(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i]);
|
opixbuf1[xm] = (uint8_t)(Paeth686(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i++]);
|
||||||
opixbuf0[xm] = olinbuf[xplc];
|
opixbuf0[xm] = olinbuf[xplc];
|
||||||
olinbuf[xplc] = opixbuf1[xm];
|
olinbuf[xplc--] = opixbuf1[xm];
|
||||||
xm = xmn[xm]; xplc--; i++;
|
xm = xmn[xm];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2410,21 +2410,24 @@ int32_t wildmatch(const char *match, const char *wild)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*match && (toupperlookup[*wild] == toupperlookup[*match] || *wild == '?'))
|
int const match_deref = *match, wild_deref = *wild;
|
||||||
|
|
||||||
|
if (match_deref && (toupperlookup[wild_deref] == toupperlookup[match_deref] || wild_deref == '?'))
|
||||||
{
|
{
|
||||||
wild++, match++;
|
wild++, match++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ((*match|*wild) == '\0')
|
else if ((match_deref|wild_deref) == '\0')
|
||||||
return 1;
|
return 1;
|
||||||
else if (*wild == '*')
|
else if (wild_deref == '*')
|
||||||
{
|
{
|
||||||
do { wild++; } while (*wild == '*');
|
do { wild++; } while (*wild == '*');
|
||||||
|
int const wild_deref = *wild;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*wild == '\0')
|
if (wild_deref == '\0')
|
||||||
return 1;
|
return 1;
|
||||||
while (*match && toupperlookup[*match] != toupperlookup[*wild]) match++;
|
while (*match && toupperlookup[*match] != toupperlookup[wild_deref]) match++;
|
||||||
if (*match && *(match+1) && toupperlookup[*(match+1)] != toupperlookup[*(wild+1)])
|
if (*match && *(match+1) && toupperlookup[*(match+1)] != toupperlookup[*(wild+1)])
|
||||||
{
|
{
|
||||||
match++;
|
match++;
|
||||||
|
@ -2433,7 +2436,7 @@ int32_t wildmatch(const char *match, const char *wild)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (1);
|
while (1);
|
||||||
if (toupperlookup[*match] == toupperlookup[*wild])
|
if (toupperlookup[*match] == toupperlookup[wild_deref])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue