Split r3159..r3161, part 6: code conditional on __cplusplus.

Note the type change of vplce[] in engine.c: int32_t -> uint32_t.

git-svn-id: https://svn.eduke32.com/eduke32@3172 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-15 14:28:11 +00:00
parent 5485206c03
commit 6d5d415ea5
6 changed files with 58 additions and 13 deletions

View file

@ -407,7 +407,13 @@ EXTERN spritetype *tspriteptr[MAXSPRITESONSCREEN + 1];
EXTERN int32_t xdim, ydim, numpages; EXTERN int32_t xdim, ydim, numpages;
EXTERN int32_t yxaspect, viewingrange; EXTERN int32_t yxaspect, viewingrange;
#ifdef __cplusplus
extern "C" {
#endif
EXTERN intptr_t ylookup[MAXYDIM+1]; EXTERN intptr_t ylookup[MAXYDIM+1];
#ifdef __cplusplus
};
#endif
#define MAXVALIDMODES 256 #define MAXVALIDMODES 256
EXTERN int32_t validmodecnt; EXTERN int32_t validmodecnt;
@ -469,8 +475,14 @@ EXTERN int16_t nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
EXTERN int16_t tilesizx[MAXTILES], tilesizy[MAXTILES]; EXTERN int16_t tilesizx[MAXTILES], tilesizy[MAXTILES];
EXTERN char picsiz[MAXTILES]; EXTERN char picsiz[MAXTILES];
EXTERN char walock[MAXTILES]; EXTERN char walock[MAXTILES];
#ifdef __cplusplus
extern "C" {
#endif
EXTERN char pow2char[8]; EXTERN char pow2char[8];
EXTERN int32_t pow2long[32]; EXTERN int32_t pow2long[32];
#ifdef __cplusplus
};
#endif
EXTERN int32_t picanm[MAXTILES]; EXTERN int32_t picanm[MAXTILES];
EXTERN intptr_t waloff[MAXTILES]; // stores pointers to cache -- SA EXTERN intptr_t waloff[MAXTILES]; // stores pointers to cache -- SA

View file

@ -132,7 +132,8 @@ int32_t vlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, in
extern intptr_t palookupoffse[4]; extern intptr_t palookupoffse[4];
extern int32_t vplce[4], vince[4]; extern uint32_t vplce[4];
extern int32_t vince[4];
extern intptr_t bufplce[4]; extern intptr_t bufplce[4];
// cnt >= 1 // cnt >= 1

View file

@ -383,10 +383,20 @@ int32_t baselayer_init(void)
# include <sys/mman.h> # include <sys/mman.h>
#endif #endif
#if !defined(NOASM) && !defined(GEKKO) && !defined(__ANDROID__)
#ifdef __cplusplus
extern "C" {
#endif
extern int32_t dep_begin, dep_end;
#ifdef __cplusplus
};
#endif
#endif
void makeasmwriteable(void) void makeasmwriteable(void)
{ {
#if !defined(NOASM) && !defined(GEKKO) && !defined(__ANDROID__) #if !defined(NOASM) && !defined(GEKKO) && !defined(__ANDROID__)
extern int32_t dep_begin, dep_end; // extern int32_t dep_begin, dep_end;
# if defined _WIN32 # if defined _WIN32
DWORD oldprot; DWORD oldprot;
if (!VirtualProtect((LPVOID)&dep_begin, (SIZE_T)&dep_end - (SIZE_T)&dep_begin, PAGE_EXECUTE_READWRITE, &oldprot)) if (!VirtualProtect((LPVOID)&dep_begin, (SIZE_T)&dep_end - (SIZE_T)&dep_begin, PAGE_EXECUTE_READWRITE, &oldprot))

View file

@ -130,7 +130,22 @@ static int16_t *dotp1[MAXYDIM], *dotp2[MAXYDIM];
static int8_t tempbuf[MAXWALLS]; static int8_t tempbuf[MAXWALLS];
// referenced from asm
#ifdef __cplusplus
extern "C" {
#endif
int32_t ebpbak, espbak; int32_t ebpbak, espbak;
int32_t reciptable[2048], fpuasm;
intptr_t asm1, asm2, asm3, asm4, palookupoffse[4];
uint32_t vplce[4];
int32_t vince[4];
intptr_t bufplce[4];
int32_t globaltilesizy;
int32_t globalx1, globaly2, globalx3, globaly3;
#ifdef __cplusplus
};
#endif
static intptr_t slopalookup[16384]; // was 2048 static intptr_t slopalookup[16384]; // was 2048
#if defined(USE_OPENGL) #if defined(USE_OPENGL)
palette_t palookupfog[MAXPALOOKUPS]; palette_t palookupfog[MAXPALOOKUPS];
@ -198,8 +213,6 @@ void initialize_engine_globals(void)
pow2long[31] = 2147483647L; pow2long[31] = 2147483647L;
} }
int32_t reciptable[2048], fpuasm;
char britable[16][256]; // JBF 20040207: full 8bit precision char britable[16][256]; // JBF 20040207: full 8bit precision
extern char textfont[2048], smalltextfont[2048]; extern char textfont[2048], smalltextfont[2048];
@ -1252,6 +1265,7 @@ static walltype *loadwall, *loadwallinv;
static spritetype *loadsprite; static spritetype *loadsprite;
// sectoidx bits // sectoidx bits
#undef CM_NONE
#define CM_NONE (CM_MAX<<1) #define CM_NONE (CM_MAX<<1)
#define CM_SOME (CM_NONE-1) #define CM_SOME (CM_NONE-1)
#define CM_OUTER (CM_MAX) // sector surrounds clipping sector #define CM_OUTER (CM_MAX) // sector surrounds clipping sector
@ -2265,9 +2279,6 @@ static int32_t globalhisibility, globalpisibility, globalcisibility;
int32_t xyaspect; int32_t xyaspect;
static int32_t viewingrangerecip; static int32_t viewingrangerecip;
intptr_t asm1, asm2, asm3, asm4, palookupoffse[4];
int32_t vplce[4], vince[4];
intptr_t bufplce[4];
static char globalxshift, globalyshift; static char globalxshift, globalyshift;
static int32_t globalxpanning, globalypanning; static int32_t globalxpanning, globalypanning;
int32_t globalshade, globalorientation; int32_t globalshade, globalorientation;
@ -2277,9 +2288,6 @@ static int32_t globalzd, globalyscale;
static int32_t globalxspan, globalyspan, globalispow2=1; // true if texture has power-of-two x and y size static int32_t globalxspan, globalyspan, globalispow2=1; // true if texture has power-of-two x and y size
static intptr_t globalbufplc; static intptr_t globalbufplc;
int32_t globaltilesizy;
int32_t globalx1, globaly2, globalx3, globaly3;
static int32_t globaly1, globalx2, globalzx; static int32_t globaly1, globalx2, globalzx;
static int32_t globalx, globaly, globalz; static int32_t globalx, globaly, globalz;

View file

@ -17,6 +17,15 @@
# define YAX_MAXDRAWS 8 # define YAX_MAXDRAWS 8
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
extern intptr_t asm1, asm2, asm3, asm4;
extern int32_t globalx1, globaly2;
#ifdef __cplusplus
};
#endif
//#define OBSOLETE_RENDMODES //#define OBSOLETE_RENDMODES
extern uint8_t basepalcount; extern uint8_t basepalcount;
@ -34,10 +43,9 @@ extern int32_t globalpal, cosglobalang, singlobalang;
extern int32_t cosviewingrangeglobalang, sinviewingrangeglobalang; extern int32_t cosviewingrangeglobalang, sinviewingrangeglobalang;
extern int32_t globalvisibility; extern int32_t globalvisibility;
extern int32_t xyaspect; extern int32_t xyaspect;
extern intptr_t asm1, asm2, asm3, asm4;
extern int32_t globalshade; extern int32_t globalshade;
extern int16_t globalpicnum; extern int16_t globalpicnum;
extern int32_t globalx1, globaly2;
extern int32_t globalorientation; extern int32_t globalorientation;
extern int16_t editstatus; extern int16_t editstatus;

View file

@ -9951,7 +9951,13 @@ int32_t app_main(int32_t argc, const char **argv)
wm_setapptitle(tempbuf); wm_setapptitle(tempbuf);
//initprintf("sizeof(mapstate_t)=%d\n", (int32_t)sizeof(mapstate_t)); //initprintf("sizeof(mapstate_t)=%d\n", (int32_t)sizeof(mapstate_t));
initprintf(HEAD2 " %s\n", s_buildRev); initprintf(HEAD2 " %s %s\n", s_buildRev,
#ifdef __cplusplus
"C++ build"
#else
""
#endif
);
initprintf("Compiled %s\n", __DATE__" "__TIME__); initprintf("Compiled %s\n", __DATE__" "__TIME__);
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)