mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-07 08:21:45 +00:00
8-bit classic renderer works on my system now in 64 bit. (at least no crashes)
git-svn-id: https://svn.eduke32.com/eduke32@714 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b63ef25d6e
commit
48dae664b8
7 changed files with 90 additions and 75 deletions
|
@ -192,47 +192,48 @@ extern void _cdecl stretchhline(int,int,int,int,int,int);
|
||||||
#else // _MSC_VER
|
#else // _MSC_VER
|
||||||
|
|
||||||
#define ENGINE_USING_A_C
|
#define ENGINE_USING_A_C
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
void setvlinebpl(int dabpl);
|
void setvlinebpl(int dabpl);
|
||||||
void fixtransluscence(int datransoff);
|
void fixtransluscence(intptr_t datransoff);
|
||||||
void settransnormal(void);
|
void settransnormal(void);
|
||||||
void settransreverse(void);
|
void settransreverse(void);
|
||||||
|
|
||||||
void sethlinesizes(int logx, int logy, int bufplc);
|
void sethlinesizes(int logx, int logy, intptr_t bufplc);
|
||||||
void setpalookupaddress(char *paladdr);
|
void setpalookupaddress(char *paladdr);
|
||||||
void setuphlineasm4(int bxinc, int byinc);
|
void setuphlineasm4(int bxinc, int byinc);
|
||||||
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, int p);
|
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, intptr_t p);
|
||||||
|
|
||||||
void setupslopevlin(int logylogx, int bufplc, int pinc);
|
void setupslopevlin(int logylogx, intptr_t bufplc, int pinc);
|
||||||
void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by);
|
void slopevlin(intptr_t p, int i, intptr_t slopaloffs, int cnt, int bx, int by);
|
||||||
|
|
||||||
void setupvlineasm(int neglogy);
|
void setupvlineasm(int neglogy);
|
||||||
void vlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
void vlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void setupmvlineasm(int neglogy);
|
void setupmvlineasm(int neglogy);
|
||||||
void mvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
void mvlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void setuptvlineasm(int neglogy);
|
void setuptvlineasm(int neglogy);
|
||||||
void tvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
void tvlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void msethlineshift(int logx, int logy);
|
void msethlineshift(int logx, int logy);
|
||||||
void mhline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p);
|
void mhline(intptr_t bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, intptr_t p);
|
||||||
|
|
||||||
void tsethlineshift(int logx, int logy);
|
void tsethlineshift(int logx, int logy);
|
||||||
void thline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p);
|
void thline(intptr_t bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, intptr_t p);
|
||||||
|
|
||||||
void setupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
void setupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz);
|
||||||
void spritevline(int bx, int by, int cnt, int bufplc, int p);
|
void spritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void msetupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
void msetupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz);
|
||||||
void mspritevline(int bx, int by, int cnt, int bufplc, int p);
|
void mspritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void tsetupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
void tsetupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz);
|
||||||
void tspritevline(int bx, int by, int cnt, int bufplc, int p);
|
void tspritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p);
|
||||||
|
|
||||||
void setupdrawslab (int dabpl, int pal);
|
void setupdrawslab (int dabpl, intptr_t pal);
|
||||||
void drawslab (int dx, int v, int dy, int vi, int vptr, int p);
|
void drawslab (int dx, int v, int dy, int vi, intptr_t vptr, intptr_t p);
|
||||||
void stretchhline (int p0, int u, int cnt, int uinc, int rptr, int p);
|
void stretchhline (intptr_t p0, int u, int cnt, int uinc, intptr_t rptr, intptr_t p);
|
||||||
|
|
||||||
void mmxoverlay();
|
void mmxoverlay();
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ static inline uint64 B_SWAP64(uint64 l) { return (l>>56)|((l>>40)&0xff00)|((l>>2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FP_OFF
|
#ifndef FP_OFF
|
||||||
# define FP_OFF(__p) ((unsigned)(__p))
|
# define FP_OFF(__p) ((uintptr_t)(__p))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __compat_h_macrodef__
|
#ifdef __compat_h_macrodef__
|
||||||
|
|
|
@ -3712,8 +3712,8 @@ static inline int boundmulscale(int a, int d, int c)
|
||||||
#undef by
|
#undef by
|
||||||
#undef _scaler
|
#undef _scaler
|
||||||
|
|
||||||
void qinterpolatedown16 (int bufptr, int num, int val, int add);
|
void qinterpolatedown16 (intptr_t bufptr, int num, int val, int add);
|
||||||
void qinterpolatedown16short (int bufptr, int num, int val, int add);
|
void qinterpolatedown16short (intptr_t bufptr, int num, int val, int add);
|
||||||
|
|
||||||
void clearbuf(void* d, int c, int a);
|
void clearbuf(void* d, int c, int a);
|
||||||
void copybuf(void* s, void* d, int c);
|
void copybuf(void* s, void* d, int c);
|
||||||
|
|
|
@ -15,7 +15,8 @@ int krecip(int num); // from engine.c
|
||||||
#define BITSOFPRECISION 3
|
#define BITSOFPRECISION 3
|
||||||
#define BITSOFPRECISIONPOW 8
|
#define BITSOFPRECISIONPOW 8
|
||||||
|
|
||||||
extern int asm1, asm2, asm3, asm4, fpuasm, globalx3, globaly3;
|
extern intptr_t asm1, asm2, asm3, asm4;
|
||||||
|
extern int fpuasm, globalx3, globaly3;
|
||||||
extern void *reciptable;
|
extern void *reciptable;
|
||||||
|
|
||||||
static int bpl, transmode = 0;
|
static int bpl, transmode = 0;
|
||||||
|
@ -24,17 +25,17 @@ static char *gbuf, *gpal, *ghlinepal, *gtrans;
|
||||||
|
|
||||||
//Global variable functions
|
//Global variable functions
|
||||||
void setvlinebpl(int dabpl) { bpl = dabpl; }
|
void setvlinebpl(int dabpl) { bpl = dabpl; }
|
||||||
void fixtransluscence(int datransoff) { gtrans = (char *)datransoff; }
|
void fixtransluscence(intptr_t datransoff) { gtrans = (char *)datransoff; }
|
||||||
void settransnormal(void) { transmode = 0; }
|
void settransnormal(void) { transmode = 0; }
|
||||||
void settransreverse(void) { transmode = 1; }
|
void settransreverse(void) { transmode = 1; }
|
||||||
|
|
||||||
|
|
||||||
//Ceiling/floor horizontal line functions
|
//Ceiling/floor horizontal line functions
|
||||||
void sethlinesizes(int logx, int logy, int bufplc)
|
void sethlinesizes(int logx, int logy, intptr_t bufplc)
|
||||||
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
||||||
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
||||||
void setuphlineasm4(int bxinc, int byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
void setuphlineasm4(int bxinc, int byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
||||||
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, int p)
|
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, intptr_t p)
|
||||||
{
|
{
|
||||||
char *palptr;
|
char *palptr;
|
||||||
|
|
||||||
|
@ -51,12 +52,12 @@ void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned
|
||||||
|
|
||||||
|
|
||||||
//Sloped ceiling/floor vertical line functions
|
//Sloped ceiling/floor vertical line functions
|
||||||
void setupslopevlin(int logylogx, int bufplc, int pinc)
|
void setupslopevlin(int logylogx, intptr_t bufplc, int pinc)
|
||||||
{
|
{
|
||||||
glogx = (logylogx&255); glogy = (logylogx>>8);
|
glogx = (logylogx&255); glogy = (logylogx>>8);
|
||||||
gbuf = (char *)bufplc; gpinc = pinc;
|
gbuf = (char *)bufplc; gpinc = pinc;
|
||||||
}
|
}
|
||||||
void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by)
|
void slopevlin(intptr_t p, int i, intptr_t slopaloffs, int cnt, int bx, int by)
|
||||||
{
|
{
|
||||||
int *slopalptr, bz, bzinc;
|
int *slopalptr, bz, bzinc;
|
||||||
unsigned int u, v;
|
unsigned int u, v;
|
||||||
|
@ -68,7 +69,7 @@ void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by)
|
||||||
i = krecip(bz>>6); bz += bzinc;
|
i = krecip(bz>>6); bz += bzinc;
|
||||||
u = bx+globalx3*i;
|
u = bx+globalx3*i;
|
||||||
v = by+globaly3*i;
|
v = by+globaly3*i;
|
||||||
(*(char *)p) = *(char *)(slopalptr[0]+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);
|
(*(char *)p) = *(char *)(((intptr_t)slopalptr[0])+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);
|
||||||
slopalptr--;
|
slopalptr--;
|
||||||
p += gpinc;
|
p += gpinc;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +78,7 @@ void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by)
|
||||||
|
|
||||||
//Wall,face sprite/wall sprite vertical line functions
|
//Wall,face sprite/wall sprite vertical line functions
|
||||||
void setupvlineasm(int neglogy) { glogy = neglogy; }
|
void setupvlineasm(int neglogy) { glogy = neglogy; }
|
||||||
void vlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
void vlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
|
@ -90,7 +91,7 @@ void vlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, in
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupmvlineasm(int neglogy) { glogy = neglogy; }
|
void setupmvlineasm(int neglogy) { glogy = neglogy; }
|
||||||
void mvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
void mvlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ void mvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, i
|
||||||
}
|
}
|
||||||
|
|
||||||
void setuptvlineasm(int neglogy) { glogy = neglogy; }
|
void setuptvlineasm(int neglogy) { glogy = neglogy; }
|
||||||
void tvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
void tvlineasm1(int vinc, intptr_t paloffs, int cnt, unsigned int vplc, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ void tvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, i
|
||||||
|
|
||||||
//Floor sprite horizontal line functions
|
//Floor sprite horizontal line functions
|
||||||
void msethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
void msethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
||||||
void mhline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p)
|
void mhline(intptr_t bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -152,7 +153,7 @@ void mhline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by,
|
||||||
}
|
}
|
||||||
|
|
||||||
void tsethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
void tsethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
||||||
void thline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p)
|
void thline(intptr_t bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -184,14 +185,14 @@ void thline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by,
|
||||||
|
|
||||||
|
|
||||||
//Rotatesprite vertical line functions
|
//Rotatesprite vertical line functions
|
||||||
void setupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
void setupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void spritevline(int bx, int by, int cnt, int bufplc, int p)
|
void spritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
for (;cnt>1;cnt--)
|
for (;cnt>1;cnt--)
|
||||||
|
@ -204,14 +205,14 @@ void spritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rotatesprite vertical line functions
|
//Rotatesprite vertical line functions
|
||||||
void msetupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
void msetupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void mspritevline(int bx, int by, int cnt, int bufplc, int p)
|
void mspritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -226,14 +227,14 @@ void mspritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tsetupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
void tsetupspritevline(intptr_t paloffs, int bxinc, int byinc, int ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void tspritevline(int bx, int by, int cnt, int bufplc, int p)
|
void tspritevline(int bx, int by, int cnt, intptr_t bufplc, intptr_t p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
|
@ -262,10 +263,10 @@ void tspritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupdrawslab(int dabpl, int pal)
|
void setupdrawslab(int dabpl, intptr_t pal)
|
||||||
{ bpl = dabpl; gpal = (char *)pal; }
|
{ bpl = dabpl; gpal = (char *)pal; }
|
||||||
|
|
||||||
void drawslab(int dx, int v, int dy, int vi, int vptr, int p)
|
void drawslab(int dx, int v, int dy, int vi, intptr_t vptr, intptr_t p)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
@ -276,7 +277,7 @@ void drawslab(int dx, int v, int dy, int vi, int vptr, int p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stretchhline(int p0, int u, int cnt, int uinc, int rptr, int p)
|
void stretchhline(intptr_t p0, int u, int cnt, int uinc, intptr_t rptr, intptr_t p)
|
||||||
{
|
{
|
||||||
p0 = p-(cnt<<2);
|
p0 = p-(cnt<<2);
|
||||||
do
|
do
|
||||||
|
|
|
@ -61,7 +61,7 @@ int editorgridextent = 131072;
|
||||||
#define MAXYSIZ 256
|
#define MAXYSIZ 256
|
||||||
#define MAXZSIZ 255
|
#define MAXZSIZ 255
|
||||||
#define MAXVOXMIPS 5
|
#define MAXVOXMIPS 5
|
||||||
int voxoff[MAXVOXELS][MAXVOXMIPS]; char voxlock[MAXVOXELS][MAXVOXMIPS];
|
intptr_t voxoff[MAXVOXELS][MAXVOXMIPS]; char voxlock[MAXVOXELS][MAXVOXMIPS];
|
||||||
int voxscale[MAXVOXELS];
|
int voxscale[MAXVOXELS];
|
||||||
|
|
||||||
static int ggxinc[MAXXSIZ+1], ggyinc[MAXXSIZ+1];
|
static int ggxinc[MAXXSIZ+1], ggyinc[MAXXSIZ+1];
|
||||||
|
@ -581,7 +581,7 @@ static int swplc[MAXXDIM], lplc[MAXXDIM];
|
||||||
static int swall[MAXXDIM], lwall[MAXXDIM+4];
|
static int swall[MAXXDIM], lwall[MAXXDIM+4];
|
||||||
int xdimen = -1, xdimenrecip, halfxdimen, xdimenscale, xdimscale;
|
int xdimen = -1, xdimenrecip, halfxdimen, xdimenscale, xdimscale;
|
||||||
int wx1, wy1, wx2, wy2, ydimen;
|
int wx1, wy1, wx2, wy2, ydimen;
|
||||||
int /*viewoffset,*/ frameoffset;
|
intptr_t /*viewoffset,*/ frameoffset;
|
||||||
|
|
||||||
static int nrx1[8], nry1[8], nrx2[8], nry2[8]; // JBF 20031206: Thanks Ken
|
static int nrx1[8], nry1[8], nrx2[8], nry2[8]; // JBF 20031206: Thanks Ken
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ char globparaceilclip, globparaflorclip;
|
||||||
|
|
||||||
int xyaspect, viewingrangerecip;
|
int xyaspect, viewingrangerecip;
|
||||||
|
|
||||||
int asm1, asm2, asm3, asm4;
|
intptr_t asm1, asm2, asm3, asm4;
|
||||||
int vplce[4], vince[4], palookupoffse[4], bufplce[4];
|
int vplce[4], vince[4], palookupoffse[4], bufplce[4];
|
||||||
char globalxshift, globalyshift;
|
char globalxshift, globalyshift;
|
||||||
int globalxpanning, globalypanning, globalshade;
|
int globalxpanning, globalypanning, globalshade;
|
||||||
|
@ -868,8 +868,9 @@ skipitaddwall:
|
||||||
//
|
//
|
||||||
static void maskwallscan(int x1, int x2, short *uwal, short *dwal, int *swal, int *lwal)
|
static void maskwallscan(int x1, int x2, short *uwal, short *dwal, int *swal, int *lwal)
|
||||||
{
|
{
|
||||||
int i, x, startx, xnice, ynice, fpalookup;
|
int i, x,/* startx,*/ xnice, ynice, fpalookup;
|
||||||
int y1ve[4], y2ve[4], u4, d4, dax, z, p, tsizx, tsizy;
|
intptr_t startx, p;
|
||||||
|
int y1ve[4], y2ve[4], u4, d4, dax, z,/* p,*/ tsizx, tsizy;
|
||||||
char bad;
|
char bad;
|
||||||
|
|
||||||
tsizx = tilesizx[globalpicnum];
|
tsizx = tilesizx[globalpicnum];
|
||||||
|
@ -1177,7 +1178,7 @@ static void slowhline(int xr, int yp)
|
||||||
asm1 = globalx1*r;
|
asm1 = globalx1*r;
|
||||||
asm2 = globaly2*r;
|
asm2 = globaly2*r;
|
||||||
|
|
||||||
asm3 = (int)globalpalwritten + ((int)getpalookup((int)mulscale16(r,globvis),globalshade)<<8);
|
asm3 = (intptr_t)globalpalwritten + ((intptr_t)getpalookup((int)mulscale16(r,globvis),globalshade)<<8);
|
||||||
if (!(globalorientation&256))
|
if (!(globalorientation&256))
|
||||||
{
|
{
|
||||||
mhline(globalbufplc,globaly1*r+globalxpanning-asm1*(xr-xl),(xr-xl)<<16,0L,
|
mhline(globalbufplc,globaly1*r+globalxpanning-asm1*(xr-xl),(xr-xl)<<16,0L,
|
||||||
|
@ -1376,7 +1377,7 @@ static int owallmost(short *mostbuf, int w, int z)
|
||||||
|
|
||||||
y = (scale(z,xdimenscale,iy1)<<4);
|
y = (scale(z,xdimenscale,iy1)<<4);
|
||||||
yinc = ((scale(z,xdimenscale,iy2)<<4)-y) / (ix2-ix1+1);
|
yinc = ((scale(z,xdimenscale,iy2)<<4)-y) / (ix2-ix1+1);
|
||||||
qinterpolatedown16short((int)&mostbuf[ix1],ix2-ix1+1,y+(globalhoriz<<16),yinc);
|
qinterpolatedown16short((intptr_t)&mostbuf[ix1],ix2-ix1+1,y+(globalhoriz<<16),yinc);
|
||||||
|
|
||||||
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
||||||
if (mostbuf[ix1] > ydimen) mostbuf[ix1] = ydimen;
|
if (mostbuf[ix1] > ydimen) mostbuf[ix1] = ydimen;
|
||||||
|
@ -1534,7 +1535,7 @@ static int wallmost(short *mostbuf, int w, int sectnum, char dastat)
|
||||||
|
|
||||||
y = (scale(z1,xdimenscale,iy1)<<4);
|
y = (scale(z1,xdimenscale,iy1)<<4);
|
||||||
yinc = ((scale(z2,xdimenscale,iy2)<<4)-y) / (ix2-ix1+1);
|
yinc = ((scale(z2,xdimenscale,iy2)<<4)-y) / (ix2-ix1+1);
|
||||||
qinterpolatedown16short((int)&mostbuf[ix1],ix2-ix1+1,y+(globalhoriz<<16),yinc);
|
qinterpolatedown16short((intptr_t)&mostbuf[ix1],ix2-ix1+1,y+(globalhoriz<<16),yinc);
|
||||||
|
|
||||||
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
||||||
if (mostbuf[ix1] > ydimen) mostbuf[ix1] = ydimen;
|
if (mostbuf[ix1] > ydimen) mostbuf[ix1] = ydimen;
|
||||||
|
@ -2045,7 +2046,9 @@ static void wallscan(int x1, int x2, short *uwal, short *dwal, int *swal, int *l
|
||||||
//
|
//
|
||||||
static void transmaskvline(int x)
|
static void transmaskvline(int x)
|
||||||
{
|
{
|
||||||
int vplc, vinc, p, i, palookupoffs, bufplc;
|
int vplc, vinc, i;
|
||||||
|
intptr_t palookupoffs;
|
||||||
|
intptr_t bufplc,p;
|
||||||
short y1v, y2v;
|
short y1v, y2v;
|
||||||
|
|
||||||
if ((x < 0) || (x >= xdimen)) return;
|
if ((x < 0) || (x >= xdimen)) return;
|
||||||
|
@ -2387,7 +2390,7 @@ static void grouscan(int dax1, int dax2, int sectnum, char dastat)
|
||||||
globalx3 = (globalx2>>10);
|
globalx3 = (globalx2>>10);
|
||||||
globaly3 = (globaly2>>10);
|
globaly3 = (globaly2>>10);
|
||||||
asm3 = mulscale16(y2,globalzd) + (globalzx>>6);
|
asm3 = mulscale16(y2,globalzd) + (globalzx>>6);
|
||||||
slopevlin(ylookup[y2]+x+frameoffset,krecipasm(asm3>>3),(int)nptr2,y2-y1+1,globalx1,globaly1);
|
slopevlin(ylookup[y2]+x+frameoffset,krecipasm(asm3>>3),(intptr_t)nptr2,y2-y1+1,globalx1,globaly1);
|
||||||
|
|
||||||
if ((x&15) == 0) faketimerhandler();
|
if ((x&15) == 0) faketimerhandler();
|
||||||
}
|
}
|
||||||
|
@ -2916,7 +2919,8 @@ static void drawvox(int dasprx, int daspry, int dasprz, int dasprang,
|
||||||
int cosang, sinang, sprcosang, sprsinang, backx, backy, gxinc, gyinc;
|
int cosang, sinang, sprcosang, sprsinang, backx, backy, gxinc, gyinc;
|
||||||
int daxsiz, daysiz, dazsiz, daxpivot, daypivot, dazpivot;
|
int daxsiz, daysiz, dazsiz, daxpivot, daypivot, dazpivot;
|
||||||
int daxscalerecip, dayscalerecip, cnt, gxstart, gystart, odayscale;
|
int daxscalerecip, dayscalerecip, cnt, gxstart, gystart, odayscale;
|
||||||
int l1, l2, slabxoffs, xyvoxoffs, *longptr;
|
int l1, l2, /*slabxoffs,*/ xyvoxoffs, *longptr;
|
||||||
|
intptr_t slabxoffs;
|
||||||
int lx, rx, nx, ny, x1=0, y1=0, z1, x2=0, y2=0, z2, yplc, yinc=0;
|
int lx, rx, nx, ny, x1=0, y1=0, z1, x2=0, y2=0, z2, yplc, yinc=0;
|
||||||
int yoff, xs=0, ys=0, xe, ye, xi=0, yi=0, cbackx, cbacky, dagxinc, dagyinc;
|
int yoff, xs=0, ys=0, xe, ye, xi=0, yi=0, cbackx, cbacky, dagxinc, dagyinc;
|
||||||
short *shortptr;
|
short *shortptr;
|
||||||
|
@ -3086,7 +3090,7 @@ static void drawvox(int dasprx, int daspry, int dasprz, int dasprang,
|
||||||
|
|
||||||
for (x=xs;x!=xe;x+=xi)
|
for (x=xs;x!=xe;x+=xi)
|
||||||
{
|
{
|
||||||
slabxoffs = (int)&davoxptr[B_LITTLE32(longptr[x])];
|
slabxoffs = (intptr_t)&davoxptr[B_LITTLE32(longptr[x])];
|
||||||
shortptr = (short *)&davoxptr[((x*(daysiz+1))<<1)+xyvoxoffs];
|
shortptr = (short *)&davoxptr[((x*(daysiz+1))<<1)+xyvoxoffs];
|
||||||
|
|
||||||
nx = mulscale16(ggxstart+ggxinc[x],viewingrangerecip)+x1;
|
nx = mulscale16(ggxstart+ggxinc[x],viewingrangerecip)+x1;
|
||||||
|
@ -3147,7 +3151,7 @@ static void drawvox(int dasprx, int daspry, int dasprz, int dasprang,
|
||||||
if (z2 > dadmost[lx]) z2 = dadmost[lx];
|
if (z2 > dadmost[lx]) z2 = dadmost[lx];
|
||||||
z2 -= z1; if (z2 <= 0) continue;
|
z2 -= z1; if (z2 <= 0) continue;
|
||||||
|
|
||||||
drawslab(rx,yplc,z2,yinc,(int)&voxptr[3],ylookup[z1]+lx+frameoffset);
|
drawslab(rx,yplc,z2,yinc,(intptr_t)&voxptr[3],ylookup[z1]+lx+frameoffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3396,7 +3400,7 @@ static void drawsprite(int snum)
|
||||||
globalzd = (((globalposz-z2)*globalyscale)<<8);
|
globalzd = (((globalposz-z2)*globalyscale)<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
qinterpolatedown16((int)&lwall[lx],rx-lx+1,linum,linuminc);
|
qinterpolatedown16((intptr_t)&lwall[lx],rx-lx+1,linum,linuminc);
|
||||||
clearbuf(&swall[lx],rx-lx+1,mulscale19(yp,xdimscale));
|
clearbuf(&swall[lx],rx-lx+1,mulscale19(yp,xdimscale));
|
||||||
|
|
||||||
if ((cstat&2) == 0)
|
if ((cstat&2) == 0)
|
||||||
|
@ -3858,7 +3862,7 @@ static void drawsprite(int snum)
|
||||||
{
|
{
|
||||||
yinc = divscale16(ysi[zz]-ysi[z],xsi[zz]-xsi[z]);
|
yinc = divscale16(ysi[zz]-ysi[z],xsi[zz]-xsi[z]);
|
||||||
y = ysi[z] + mulscale16((dax1<<16)-xsi[z],yinc);
|
y = ysi[z] + mulscale16((dax1<<16)-xsi[z],yinc);
|
||||||
qinterpolatedown16short((int)(&uwall[dax1]),dax2-dax1,y,yinc);
|
qinterpolatedown16short((intptr_t)(&uwall[dax1]),dax2-dax1,y,yinc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3873,7 +3877,7 @@ static void drawsprite(int snum)
|
||||||
{
|
{
|
||||||
yinc = divscale16(ysi[zz]-ysi[z],xsi[zz]-xsi[z]);
|
yinc = divscale16(ysi[zz]-ysi[z],xsi[zz]-xsi[z]);
|
||||||
y = ysi[zz] + mulscale16((dax1<<16)-xsi[zz],yinc);
|
y = ysi[zz] + mulscale16((dax1<<16)-xsi[zz],yinc);
|
||||||
qinterpolatedown16short((int)(&dwall[dax1]),dax2-dax1,y,yinc);
|
qinterpolatedown16short((intptr_t)(&dwall[dax1]),dax2-dax1,y,yinc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4229,8 +4233,9 @@ static void drawmaskwall(short damaskwallcnt)
|
||||||
static void fillpolygon(int npoints)
|
static void fillpolygon(int npoints)
|
||||||
{
|
{
|
||||||
int z, zz, x1, y1, x2, y2, miny, maxy, y, xinc, cnt;
|
int z, zz, x1, y1, x2, y2, miny, maxy, y, xinc, cnt;
|
||||||
int ox, oy, bx, by, p, day1, day2;
|
int ox, oy, bx, by, day1, day2;
|
||||||
short *ptr, *ptr2;
|
short *ptr, *ptr2;
|
||||||
|
intptr_t p;
|
||||||
|
|
||||||
#if defined POLYMOST && defined USE_OPENGL
|
#if defined POLYMOST && defined USE_OPENGL
|
||||||
if (rendmode >= 3) { polymost_fillpolygon(npoints); return; }
|
if (rendmode >= 3) { polymost_fillpolygon(npoints); return; }
|
||||||
|
@ -4612,7 +4617,8 @@ static int clippoly4(int cx1, int cy1, int cx2, int cy2)
|
||||||
static void dorotatesprite(int sx, int sy, int z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2, int uniqid)
|
static void dorotatesprite(int sx, int sy, int z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2, int uniqid)
|
||||||
{
|
{
|
||||||
int cosang, sinang, v, nextv, dax1, dax2, oy, bx, by, ny1, ny2;
|
int cosang, sinang, v, nextv, dax1, dax2, oy, bx, by, ny1, ny2;
|
||||||
int i, x, y, x1, y1, x2, y2, gx1, gy1, p, bufplc, palookupoffs;
|
int i, x, y, x1, y1, x2, y2, gx1, gy1 ;
|
||||||
|
intptr_t p, bufplc, palookupoffs;
|
||||||
int xsiz, ysiz, xoff, yoff, npoints, yplc, yinc, lx, rx, xx, xend;
|
int xsiz, ysiz, xoff, yoff, npoints, yplc, yinc, lx, rx, xx, xend;
|
||||||
int xv, yv, xv2, yv2, qlinemode=0, y1ve[4], y2ve[4], u4, d4;
|
int xv, yv, xv2, yv2, qlinemode=0, y1ve[4], y2ve[4], u4, d4;
|
||||||
char bad;
|
char bad;
|
||||||
|
@ -4706,12 +4712,12 @@ static void dorotatesprite(int sx, int sy, int z, short a, short picnum, signed
|
||||||
if (dax2 > dax1)
|
if (dax2 > dax1)
|
||||||
{
|
{
|
||||||
yplc = y1 + mulscale16((dax1<<16)+65535-x1,yinc);
|
yplc = y1 + mulscale16((dax1<<16)+65535-x1,yinc);
|
||||||
qinterpolatedown16short((int)(&uplc[dax1]),dax2-dax1,yplc,yinc);
|
qinterpolatedown16short((intptr_t)(&uplc[dax1]),dax2-dax1,yplc,yinc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yplc = y2 + mulscale16((dax2<<16)+65535-x2,yinc);
|
yplc = y2 + mulscale16((dax2<<16)+65535-x2,yinc);
|
||||||
qinterpolatedown16short((int)(&dplc[dax2]),dax1-dax2,yplc,yinc);
|
qinterpolatedown16short((intptr_t)(&dplc[dax2]),dax1-dax2,yplc,yinc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextv = v;
|
nextv = v;
|
||||||
|
@ -10019,7 +10025,8 @@ void setpalettefade(char r, char g, char b, char offset)
|
||||||
//
|
//
|
||||||
void clearview(int dacol)
|
void clearview(int dacol)
|
||||||
{
|
{
|
||||||
int p, y, dx;
|
intptr_t p;
|
||||||
|
int y, dx;
|
||||||
|
|
||||||
if (qsetmode != 200) return;
|
if (qsetmode != 200) return;
|
||||||
|
|
||||||
|
@ -10273,7 +10280,8 @@ void preparemirror(int dax, int day, int daz, short daang, int dahoriz, short da
|
||||||
//
|
//
|
||||||
void completemirror(void)
|
void completemirror(void)
|
||||||
{
|
{
|
||||||
int i, dy, p;
|
int i, dy;
|
||||||
|
intptr_t p;
|
||||||
|
|
||||||
#ifdef POLYMOST
|
#ifdef POLYMOST
|
||||||
if (rendmode) return;
|
if (rendmode) return;
|
||||||
|
@ -10508,7 +10516,8 @@ void setfirstwall(short sectnum, short newfirstwall)
|
||||||
//
|
//
|
||||||
void drawline256(int x1, int y1, int x2, int y2, char col)
|
void drawline256(int x1, int y1, int x2, int y2, char col)
|
||||||
{
|
{
|
||||||
int dx, dy, i, j, p, inc, plc, daend;
|
int dx, dy, i, j, inc, plc, daend;
|
||||||
|
intptr_t p;
|
||||||
|
|
||||||
col = palookup[0][col];
|
col = palookup[0][col];
|
||||||
|
|
||||||
|
@ -10621,8 +10630,9 @@ unsigned int drawlinepat = 0xffffffff;
|
||||||
|
|
||||||
void drawline16(int x1, int y1, int x2, int y2, char col)
|
void drawline16(int x1, int y1, int x2, int y2, char col)
|
||||||
{
|
{
|
||||||
int i, dx, dy, p, pinc, d;
|
int i, dx, dy, pinc, d;
|
||||||
unsigned int patc=0;
|
unsigned int patc=0;
|
||||||
|
intptr_t p;
|
||||||
|
|
||||||
dx = x2-x1; dy = y2-y1;
|
dx = x2-x1; dy = y2-y1;
|
||||||
if (dx >= 0)
|
if (dx >= 0)
|
||||||
|
@ -10705,7 +10715,8 @@ void drawline16(int x1, int y1, int x2, int y2, char col)
|
||||||
void drawcircle16(int x1, int y1, int r, char col)
|
void drawcircle16(int x1, int y1, int r, char col)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
int p, xp, yp, xpbpl, ypbpl, d, de, dse, patc=0;
|
intptr_t p;
|
||||||
|
int xp, yp, xpbpl, ypbpl, d, de, dse, patc=0;
|
||||||
|
|
||||||
if (r < 0) r = -r;
|
if (r < 0) r = -r;
|
||||||
if (x1+r < 0 || x1-r >= xres) return;
|
if (x1+r < 0 || x1-r >= xres) return;
|
||||||
|
@ -10992,7 +11003,8 @@ char spritecol2d[MAXTILES][2];
|
||||||
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
|
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
|
||||||
{
|
{
|
||||||
walltype *wal;
|
walltype *wal;
|
||||||
int i, j, xp1, yp1, xp2, yp2, tempint;
|
int i, j, xp1, yp1, xp2, yp2;
|
||||||
|
intptr_t tempint;
|
||||||
char col;
|
char col;
|
||||||
|
|
||||||
if (qsetmode == 200) return;
|
if (qsetmode == 200) return;
|
||||||
|
|
|
@ -181,14 +181,14 @@ void copybufreverse(void *S, void *D, int c)
|
||||||
// Generic C version
|
// Generic C version
|
||||||
//
|
//
|
||||||
|
|
||||||
void qinterpolatedown16(int bufptr, int num, int val, int add)
|
void qinterpolatedown16(intptr_t bufptr, int num, int val, int add)
|
||||||
{
|
{
|
||||||
// gee, I wonder who could have provided this...
|
// gee, I wonder who could have provided this...
|
||||||
int i, *lptr = (int *)bufptr;
|
int i, *lptr = (int *)bufptr;
|
||||||
for (i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
|
for (i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
|
||||||
}
|
}
|
||||||
|
|
||||||
void qinterpolatedown16short(int bufptr, int num, int val, int add)
|
void qinterpolatedown16short(intptr_t bufptr, int num, int val, int add)
|
||||||
{
|
{
|
||||||
// ...maybe the same person who provided this too?
|
// ...maybe the same person who provided this too?
|
||||||
int i; short *sptr = (short *)bufptr;
|
int i; short *sptr = (short *)bufptr;
|
||||||
|
|
|
@ -104,7 +104,8 @@ static void ProcessMouse(void);
|
||||||
// video
|
// video
|
||||||
static int desktopxdim=0,desktopydim=0,desktopbpp=0,modesetusing=-1;
|
static int desktopxdim=0,desktopydim=0,desktopbpp=0,modesetusing=-1;
|
||||||
int xres=-1, yres=-1, fullscreen=0, bpp=0, bytesperline=0, imageSize=0;
|
int xres=-1, yres=-1, fullscreen=0, bpp=0, bytesperline=0, imageSize=0;
|
||||||
int frameplace=0, lockcount=0;
|
intptr frameplace=0;
|
||||||
|
int lockcount=0;
|
||||||
static int curvidmode = -1;
|
static int curvidmode = -1;
|
||||||
static int customxdim = 640, customydim = 480, custombpp = 8, customfs = 0;
|
static int customxdim = 640, customydim = 480, custombpp = 8, customfs = 0;
|
||||||
static unsigned modeschecked=0;
|
static unsigned modeschecked=0;
|
||||||
|
@ -2300,11 +2301,11 @@ void begindrawing(void)
|
||||||
|
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
{
|
{
|
||||||
frameplace = (int)lpPixels;
|
frameplace = (intptr_t)lpPixels;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frameplace = (int)lpOffscreen;
|
frameplace = (intptr_t)lpOffscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!modechange) return;
|
if (!modechange) return;
|
||||||
|
|
Loading…
Reference in a new issue