2008-12-02 10:44:39 +00:00
|
|
|
#ifndef ENGINE_PRIV_H
|
|
|
|
#define ENGINE_PRIV_H
|
|
|
|
|
|
|
|
#define MAXCLIPNUM 1024
|
|
|
|
#define MAXPERMS 512
|
|
|
|
#define MAXTILEFILES 256
|
|
|
|
#define MAXYSAVES ((MAXXDIM*MAXSPRITES)>>7)
|
|
|
|
#define MAXNODESPERLINE 42 //Warning: This depends on MAXYSAVES & MAXYDIM!
|
|
|
|
#define MAXCLIPDIST 1024
|
|
|
|
|
2011-01-27 06:35:52 +00:00
|
|
|
extern uint8_t **basepaltableptr;
|
|
|
|
extern uint8_t basepalcount;
|
|
|
|
extern uint8_t curbasepal;
|
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
extern char pow2char[8];
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t pow2int[32];
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int16_t thesector[MAXWALLSB], thewall[MAXWALLSB];
|
|
|
|
extern int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB];
|
|
|
|
extern int16_t maskwall[MAXWALLSB], maskwallcnt;
|
2010-08-21 07:39:12 +00:00
|
|
|
extern spritetype *tspriteptr[MAXSPRITESONSCREEN + 1];
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale, ydimen;
|
2008-12-03 11:07:01 +00:00
|
|
|
extern intptr_t frameoffset;
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t globalposx, globalposy, globalposz, globalhoriz;
|
|
|
|
extern int16_t globalang, globalcursectnum;
|
|
|
|
extern int32_t globalpal, cosglobalang, singlobalang;
|
|
|
|
extern int32_t cosviewingrangeglobalang, sinviewingrangeglobalang;
|
|
|
|
extern int32_t globalvisibility;
|
|
|
|
extern int32_t xyaspect;
|
2008-12-03 11:07:01 +00:00
|
|
|
extern intptr_t asm1, asm2, asm3, asm4;
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t globalshade;
|
|
|
|
extern int16_t globalpicnum;
|
|
|
|
extern int32_t globalx1, globaly2;
|
|
|
|
extern int32_t globalorientation;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int16_t searchit;
|
|
|
|
extern int32_t searchx, searchy;
|
|
|
|
extern int16_t searchsector, searchwall, searchstat;
|
2009-07-25 20:16:22 +00:00
|
|
|
extern int16_t searchbottomwall;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
|
|
|
extern char inpreparemirror;
|
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t curbrightness, gammabrightness;
|
2008-12-02 10:44:39 +00:00
|
|
|
extern char britable[16][256];
|
|
|
|
extern char picsiz[MAXTILES];
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t lastx[MAXYDIM];
|
2008-12-02 10:44:39 +00:00
|
|
|
extern char *transluc;
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int16_t sectorborder[256], sectorbordercnt;
|
|
|
|
extern int32_t qsetmode;
|
|
|
|
extern int32_t hitallsprites;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t xb1[MAXWALLSB];
|
|
|
|
extern int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
|
|
|
extern int16_t p2[MAXWALLSB];
|
|
|
|
extern int16_t numscans, numhits, numbunches;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
|
|
|
#ifdef USE_OPENGL
|
|
|
|
extern palette_t palookupfog[MAXPALOOKUPS];
|
|
|
|
#endif
|
|
|
|
|
2010-06-07 09:03:16 +00:00
|
|
|
// int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dastat);
|
2009-01-10 07:38:50 +00:00
|
|
|
int32_t wallfront(int32_t l1, int32_t l2);
|
|
|
|
int32_t animateoffs(int16_t tilenum, int16_t fakevar);
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern int32_t indrawroomsandmasks;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
|
|
|
|
2009-07-09 02:29:48 +00:00
|
|
|
#if defined(_MSC_VER) && !defined(NOASM)
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
static inline void setgotpic(int32_t a)
|
2008-12-02 10:44:39 +00:00
|
|
|
{
|
|
|
|
_asm {
|
|
|
|
push ebx
|
|
|
|
mov eax, a
|
|
|
|
mov ebx, eax
|
|
|
|
cmp byte ptr walock[eax], 200
|
|
|
|
jae skipit
|
|
|
|
mov byte ptr walock[eax], 199
|
|
|
|
skipit:
|
|
|
|
shr eax, 3
|
|
|
|
and ebx, 7
|
|
|
|
mov dl, byte ptr gotpic[eax]
|
|
|
|
mov bl, byte ptr pow2char[ebx]
|
|
|
|
or dl, bl
|
|
|
|
mov byte ptr gotpic[eax], dl
|
|
|
|
pop ebx
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#elif defined(__GNUC__) && defined(__i386__) && !defined(NOASM) // _MSC_VER
|
|
|
|
|
|
|
|
#define setgotpic(a) \
|
2009-01-10 07:38:50 +00:00
|
|
|
({ int32_t __a=(a); \
|
2008-12-02 10:44:39 +00:00
|
|
|
__asm__ __volatile__ ( \
|
|
|
|
"movl %%eax, %%ebx\n\t" \
|
|
|
|
"cmpb $200, "ASMSYM("walock")"(%%eax)\n\t" \
|
|
|
|
"jae 0f\n\t" \
|
|
|
|
"movb $199, "ASMSYM("walock")"(%%eax)\n\t" \
|
|
|
|
"0:\n\t" \
|
|
|
|
"shrl $3, %%eax\n\t" \
|
|
|
|
"andl $7, %%ebx\n\t" \
|
|
|
|
"movb "ASMSYM("gotpic")"(%%eax), %%dl\n\t" \
|
|
|
|
"movb "ASMSYM("pow2char")"(%%ebx), %%bl\n\t" \
|
|
|
|
"orb %%bl, %%dl\n\t" \
|
|
|
|
"movb %%dl, "ASMSYM("gotpic")"(%%eax)" \
|
|
|
|
: "=a" (__a) : "a" (__a) \
|
|
|
|
: "ebx", "edx", "memory", "cc"); \
|
|
|
|
__a; })
|
|
|
|
|
|
|
|
#else // __GNUC__ && __i386__
|
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
static inline void setgotpic(int32_t tilenume)
|
2008-12-02 10:44:39 +00:00
|
|
|
{
|
|
|
|
if (walock[tilenume] < 200) walock[tilenume] = 199;
|
|
|
|
gotpic[tilenume>>3] |= pow2char[tilenume&7];
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ENGINE_PRIV_H */
|