mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Core texture mapping functions cleanup.
- forgot a glogy --> logy in a-c.c - comment out stretchhline and slopevlin2 in a.nasm, the former also in a-c.c - make transmaskvline2 use a uintptr_t where appropriate git-svn-id: https://svn.eduke32.com/eduke32@2448 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ea9ecf0735
commit
6dd048dc84
3 changed files with 22 additions and 14 deletions
|
@ -147,7 +147,7 @@ void tvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intp
|
|||
{
|
||||
do
|
||||
{
|
||||
ch = buf[vplc>>glogy];
|
||||
ch = buf[vplc>>logy];
|
||||
if (ch != 255) *pp = trans[(*pp)|(pal[ch]<<8)];
|
||||
pp += ourbpl;
|
||||
vplc += vinc;
|
||||
|
@ -330,6 +330,7 @@ void drawslab(int32_t dx, int32_t v, int32_t dy, int32_t vi, intptr_t vptr, intp
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void stretchhline(intptr_t p0, int32_t u, int32_t cnt, int32_t uinc, intptr_t rptr, intptr_t p)
|
||||
{
|
||||
p0 = p-(cnt<<2);
|
||||
|
@ -340,7 +341,7 @@ void stretchhline(intptr_t p0, int32_t u, int32_t cnt, int32_t uinc, intptr_t rp
|
|||
}
|
||||
while (p > p0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void mmxoverlay() { }
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ SECTION .text
|
|||
%define setuptvlineasm2 _setuptvlineasm2
|
||||
%define tvlineasm2 _tvlineasm2
|
||||
%define setupslopevlin2 _setupslopevlin2
|
||||
%define slopevlin2 _slopevlin2
|
||||
;%define slopevlin2 _slopevlin2
|
||||
%define setupslopevlin _setupslopevlin
|
||||
%define slopevlin _slopevlin
|
||||
%define setuprhlineasm4 _setuprhlineasm4
|
||||
|
@ -76,7 +76,7 @@ SECTION .text
|
|||
%define qrhlineasm4 _qrhlineasm4
|
||||
%define setupdrawslab _setupdrawslab
|
||||
%define drawslab _drawslab
|
||||
%define stretchhline _stretchhline
|
||||
;%define stretchhline _stretchhline
|
||||
%define mmxoverlay _mmxoverlay
|
||||
|
||||
%define dep_begin _dep_begin
|
||||
|
@ -213,7 +213,7 @@ SECTION .text
|
|||
GLOBAL setuptvlineasm2
|
||||
GLOBAL tvlineasm2
|
||||
GLOBAL setupslopevlin2
|
||||
GLOBAL slopevlin2
|
||||
; GLOBAL slopevlin2
|
||||
GLOBAL setupslopevlin
|
||||
GLOBAL slopevlin
|
||||
GLOBAL setuprhlineasm4
|
||||
|
@ -224,7 +224,7 @@ SECTION .text
|
|||
GLOBAL qrhlineasm4 ;4 pixels in 9 cycles! 2.25 cycles/pixel
|
||||
GLOBAL setupdrawslab
|
||||
GLOBAL drawslab
|
||||
GLOBAL stretchhline
|
||||
; GLOBAL stretchhline
|
||||
GLOBAL mmxoverlay
|
||||
|
||||
GLOBAL dep_begin
|
||||
|
@ -1880,6 +1880,8 @@ CDECLENDSET 6
|
|||
BITSOFPRECISION equ 3
|
||||
BITSOFPRECISIONPOW equ 8
|
||||
|
||||
%if 0 ; SLOPEVLIN2 is unused as of 2012-02-26
|
||||
|
||||
;Double-texture mapping with palette lookup
|
||||
;eax: ylo1------------|----dat|----dat
|
||||
;ebx: ylo2--------------------|----cnt
|
||||
|
@ -1949,7 +1951,7 @@ slop9: lea edi, [edi+88888888h] ;pinc
|
|||
|
||||
CDECLENDSET 6
|
||||
ret
|
||||
|
||||
%endif ; SLOPEVLIN2 %if 0
|
||||
|
||||
ALIGN 16
|
||||
setupslopevlin:
|
||||
|
@ -2592,6 +2594,8 @@ voxskipslab5:
|
|||
CDECLENDSET 6
|
||||
ret
|
||||
|
||||
|
||||
%if 0 ; STRETCHHLINE is unused as of 2012-02-26
|
||||
;modify: loinc
|
||||
;eax: | dat | dat | dat | dat |
|
||||
;ebx: | loplc1 |
|
||||
|
@ -2659,6 +2663,7 @@ loinc4: sub ecx, 88888888h
|
|||
|
||||
CDECLENDSET 6
|
||||
ret
|
||||
%endif ; %if 0 of STRETCHHLINE
|
||||
|
||||
|
||||
mmxoverlay:
|
||||
|
|
|
@ -3831,6 +3831,8 @@ static void transmaskvline2(int32_t x)
|
|||
int32_t i, y1, y2, x2;
|
||||
int16_t y1ve[2], y2ve[2];
|
||||
|
||||
uintptr_t p;
|
||||
|
||||
if ((x < 0) || (x >= xdimen)) return;
|
||||
if (x == xdimen-1) { transmaskvline(x); return; }
|
||||
|
||||
|
@ -3864,21 +3866,21 @@ static void transmaskvline2(int32_t x)
|
|||
y1 = max(y1ve[0],y1ve[1]);
|
||||
y2 = min(y2ve[0],y2ve[1]);
|
||||
|
||||
i = x+frameoffset;
|
||||
p = x+frameoffset;
|
||||
|
||||
if (y1ve[0] != y1ve[1])
|
||||
{
|
||||
if (y1ve[0] < y1)
|
||||
vplce[0] = tvlineasm1(vince[0],palookupoffse[0],y1-y1ve[0]-1,vplce[0],bufplce[0],ylookup[y1ve[0]]+i);
|
||||
vplce[0] = tvlineasm1(vince[0],palookupoffse[0],y1-y1ve[0]-1,vplce[0],bufplce[0],ylookup[y1ve[0]]+p);
|
||||
else
|
||||
vplce[1] = tvlineasm1(vince[1],palookupoffse[1],y1-y1ve[1]-1,vplce[1],bufplce[1],ylookup[y1ve[1]]+i+1);
|
||||
vplce[1] = tvlineasm1(vince[1],palookupoffse[1],y1-y1ve[1]-1,vplce[1],bufplce[1],ylookup[y1ve[1]]+p+1);
|
||||
}
|
||||
|
||||
if (y2 > y1)
|
||||
{
|
||||
asm1 = vince[1];
|
||||
asm2 = ylookup[y2]+i+1;
|
||||
tvlineasm2(vplce[1],vince[0],bufplce[0],bufplce[1],vplce[0],ylookup[y1]+i);
|
||||
asm2 = ylookup[y2]+p+1;
|
||||
tvlineasm2(vplce[1],vince[0],bufplce[0],bufplce[1],vplce[0],ylookup[y1]+p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3887,9 +3889,9 @@ static void transmaskvline2(int32_t x)
|
|||
}
|
||||
|
||||
if (y2ve[0] > y2ve[1])
|
||||
tvlineasm1(vince[0],palookupoffse[0],y2ve[0]-y2-1,asm1,bufplce[0],ylookup[y2+1]+i);
|
||||
tvlineasm1(vince[0],palookupoffse[0],y2ve[0]-y2-1,asm1,bufplce[0],ylookup[y2+1]+p);
|
||||
else if (y2ve[0] < y2ve[1])
|
||||
tvlineasm1(vince[1],palookupoffse[1],y2ve[1]-y2-1,asm2,bufplce[1],ylookup[y2+1]+i+1);
|
||||
tvlineasm1(vince[1],palookupoffse[1],y2ve[1]-y2-1,asm2,bufplce[1],ylookup[y2+1]+p+1);
|
||||
|
||||
faketimerhandler();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue