mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
Minor classic mode optimization
git-svn-id: https://svn.eduke32.com/eduke32@6228 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bcb6d3830b
commit
d1c0366916
1 changed files with 40 additions and 97 deletions
|
@ -497,31 +497,17 @@ int32_t tvlineasm1(int32_t vinc, intptr_t paloffs, bssize_t cnt, uint32_t vplc,
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
|
|
||||||
if (transm)
|
uint8_t const shift = transm<<3;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
do
|
ch = getpix(logy, buf, vplc);
|
||||||
{
|
if (ch != 255) *pp = trans[((*pp)<<(8-shift))|(pal[ch]<<shift)];
|
||||||
ch = getpix(logy, buf, vplc);
|
pp += ourbpl;
|
||||||
if (ch != 255)
|
vplc += vinc;
|
||||||
*pp = trans[(*pp)|(pal[ch]<<8)];
|
saturate_vplc_trans(vplc, vinc);
|
||||||
pp += ourbpl;
|
|
||||||
vplc += vinc;
|
|
||||||
saturate_vplc_trans(vplc, vinc);
|
|
||||||
}
|
|
||||||
while (--cnt);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
ch = getpix(logy, buf, vplc);
|
|
||||||
if (ch != 255) *pp = trans[((*pp)<<8)|pal[ch]];
|
|
||||||
pp += ourbpl;
|
|
||||||
vplc += vinc;
|
|
||||||
saturate_vplc_trans(vplc, vinc);
|
|
||||||
}
|
|
||||||
while (--cnt);
|
|
||||||
}
|
}
|
||||||
|
while (--cnt);
|
||||||
|
|
||||||
return vplc;
|
return vplc;
|
||||||
}
|
}
|
||||||
|
@ -553,42 +539,23 @@ void tvlineasm2(uint32_t vplc2, int32_t vinc1, intptr_t bufplc1, intptr_t bufplc
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
|
|
||||||
if (transm)
|
uint8_t const shift = transm<<3;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
do
|
ch = getpix(logy, buf1, vplc1);
|
||||||
{
|
if (ch != 255) pp[0] = gtrans[(pp[0]<<(8-shift))|(gpal[ch]<<shift)];
|
||||||
ch = getpix(logy, buf1, vplc1);
|
vplc1 += vinc1;
|
||||||
if (ch != 255) pp[0] = gtrans[pp[0]|(gpal[ch]<<8)];
|
saturate_vplc_trans(vplc1, vinc1);
|
||||||
vplc1 += vinc1;
|
|
||||||
saturate_vplc_trans(vplc1, vinc1);
|
|
||||||
|
|
||||||
ch = getpix(logy, buf2, vplc2);
|
ch = getpix(logy, buf2, vplc2);
|
||||||
if (ch != 255) pp[1] = gtrans[pp[1]|(gpal2[ch]<<8)];
|
if (ch != 255) pp[1] = gtrans[(pp[1]<<(8-shift))|(gpal2[ch]<<shift)];
|
||||||
vplc2 += vinc2;
|
vplc2 += vinc2;
|
||||||
saturate_vplc_trans(vplc2, vinc2);
|
saturate_vplc_trans(vplc2, vinc2);
|
||||||
|
|
||||||
pp += ourbpl;
|
pp += ourbpl;
|
||||||
}
|
|
||||||
while (--cnt > 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
ch = getpix(logy, buf1, vplc1);
|
|
||||||
if (ch != 255) pp[0] = gtrans[(pp[0]<<8)|gpal[ch]];
|
|
||||||
vplc1 += vinc1;
|
|
||||||
saturate_vplc_trans(vplc1, vinc1);
|
|
||||||
|
|
||||||
ch = getpix(logy, buf2, vplc2);
|
|
||||||
if (ch != 255) pp[1] = gtrans[(pp[1]<<8)|gpal2[ch]];
|
|
||||||
vplc2 += vinc2;
|
|
||||||
saturate_vplc_trans(vplc2, vinc2);
|
|
||||||
|
|
||||||
pp += ourbpl;
|
|
||||||
}
|
|
||||||
while (--cnt);
|
|
||||||
}
|
}
|
||||||
|
while (--cnt > 0);
|
||||||
|
|
||||||
asm1 = vplc1;
|
asm1 = vplc1;
|
||||||
asm2 = vplc2;
|
asm2 = vplc2;
|
||||||
|
@ -638,30 +605,17 @@ void thline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_
|
||||||
cntup16>>=16;
|
cntup16>>=16;
|
||||||
cntup16++;
|
cntup16++;
|
||||||
|
|
||||||
if (transmode)
|
uint8_t const shift = transmode<<3;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
do
|
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||||
{
|
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<(8-shift))|(gpal[ch]<<shift)];
|
||||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
bx += xinc;
|
||||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))|(gpal[ch]<<8)];
|
by += yinc;
|
||||||
bx += xinc;
|
p++;
|
||||||
by += yinc;
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
while (--cntup16);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
|
||||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)|gpal[ch]];
|
|
||||||
bx += xinc;
|
|
||||||
by += yinc;
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
while (--cntup16);
|
|
||||||
}
|
}
|
||||||
|
while (--cntup16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -720,27 +674,16 @@ void tspritevline(int32_t bx, int32_t by, bssize_t cnt, intptr_t bufplc, intptr_
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
if (transmode)
|
|
||||||
|
uint8_t const shift = transmode<<3;
|
||||||
|
|
||||||
|
for (; cnt>1; cnt--)
|
||||||
{
|
{
|
||||||
for (; cnt>1; cnt--)
|
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||||
{
|
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<(8-shift))+(gpal[ch]<<shift)];
|
||||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
bx += gbxinc;
|
||||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
by += gbyinc;
|
||||||
bx += gbxinc;
|
p += bpl;
|
||||||
by += gbyinc;
|
|
||||||
p += bpl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (; cnt>1; cnt--)
|
|
||||||
{
|
|
||||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
|
||||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
|
||||||
bx += gbxinc;
|
|
||||||
by += gbyinc;
|
|
||||||
p += bpl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue