mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 19:20:46 +00:00
Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!) git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2cea43f150
commit
3ff46c02b2
61 changed files with 710 additions and 510 deletions
|
@ -208,7 +208,7 @@ endif
|
||||||
# compiler flags etc.
|
# compiler flags etc.
|
||||||
BASECFLAGS= -Wno-attributes
|
BASECFLAGS= -Wno-attributes
|
||||||
BASECONLYFLAGS=-Wimplicit -Wdeclaration-after-statement
|
BASECONLYFLAGS=-Wimplicit -Wdeclaration-after-statement
|
||||||
BASECXXFLAGS= -fno-exceptions -fno-rtti -fpermissive
|
BASECXXFLAGS= -fno-exceptions -fno-rtti -fpermissive -Wno-write-strings -Wno-narrowing
|
||||||
BASEASFLAGS=-s #-g
|
BASEASFLAGS=-s #-g
|
||||||
BASELDFLAGS=
|
BASELDFLAGS=
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# EDuke32 Makefile for Microsoft NMake
|
# EDuke32 Makefile for Microsoft NMake
|
||||||
|
CPLUSPLUS=1
|
||||||
SRC=source
|
SRC=source
|
||||||
OBJ=obj_win
|
OBJ=obj_win
|
||||||
EROOT=build
|
EROOT=build
|
||||||
|
@ -25,16 +25,20 @@ DXROOT="H:\Microsoft DirectX SDK (February 2010)"
|
||||||
|
|
||||||
!ifdef DEBUG
|
!ifdef DEBUG
|
||||||
# debugging options
|
# debugging options
|
||||||
flags_cl= /Od /Zi
|
flags_cl=/Od /Zi
|
||||||
flags_link=/DEBUG
|
flags_link=/DEBUG
|
||||||
!else
|
!else
|
||||||
# release options
|
# release options
|
||||||
flags_cl=/O2 /GL /arch:SSE /MP /I$(WDKROOT)\inc\crt
|
flags_cl=/O2 /GL /arch:SSE /MP # /I$(WDKROOT)\inc\crt /I$(WDKROOT)\inc\api
|
||||||
flags_link=/RELEASE /LTCG /LIBPATH:$(WDKROOT)\lib\wxp\i386 /LIBPATH:$(WDKROOT)\lib\Crt\i386
|
flags_link=/RELEASE /LTCG # /LIBPATH:$(WDKROOT)\lib\wxp\i386 /LIBPATH:$(WDKROOT)\lib\Crt\i386
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
ENGINEOPTS=/DUSE_OPENGL /DPOLYMER
|
ENGINEOPTS=/DUSE_OPENGL /DPOLYMER
|
||||||
|
|
||||||
|
!ifdef CPLUSPLUS
|
||||||
|
ENGINEOPTS=$(ENGINEOPTS) /TP
|
||||||
|
!endif
|
||||||
|
|
||||||
CC=cl
|
CC=cl
|
||||||
AS=ml
|
AS=ml
|
||||||
LINK=link /nologo /opt:ref
|
LINK=link /nologo /opt:ref
|
||||||
|
@ -57,7 +61,7 @@ CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS /D "_CRT_SECURE_NO_DEPRECATE"
|
||||||
LIBS=$(LIBS) msvcrtd.lib
|
LIBS=$(LIBS) msvcrtd.lib
|
||||||
!else
|
!else
|
||||||
# comment msvcrt_winxp.obj if not using the WDK
|
# comment msvcrt_winxp.obj if not using the WDK
|
||||||
LIBS=$(LIBS) msvcrt.lib msvcrt_winxp.obj
|
LIBS=$(LIBS) msvcrt.lib # msvcrt_winxp.obj
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
JMACTOBJ=$(OBJ)\file_lib.$o \
|
JMACTOBJ=$(OBJ)\file_lib.$o \
|
||||||
|
@ -71,7 +75,9 @@ JMACTOBJ=$(OBJ)\file_lib.$o \
|
||||||
AUDIOLIBOBJ=$(OBJ)\midi.$o $(OBJ)\music.$o $(OBJ)\mpu401.$o
|
AUDIOLIBOBJ=$(OBJ)\midi.$o $(OBJ)\music.$o $(OBJ)\mpu401.$o
|
||||||
|
|
||||||
GAMEOBJS=$(OBJ)\game.$o \
|
GAMEOBJS=$(OBJ)\game.$o \
|
||||||
|
$(OBJ)\game_inline.$o \
|
||||||
$(OBJ)\actors.$o \
|
$(OBJ)\actors.$o \
|
||||||
|
$(OBJ)\actors_inline.$o \
|
||||||
$(OBJ)\anim.$o \
|
$(OBJ)\anim.$o \
|
||||||
$(OBJ)\common.$o \
|
$(OBJ)\common.$o \
|
||||||
$(OBJ)\demo.$o \
|
$(OBJ)\demo.$o \
|
||||||
|
@ -87,6 +93,7 @@ GAMEOBJS=$(OBJ)\game.$o \
|
||||||
$(OBJ)\premap.$o \
|
$(OBJ)\premap.$o \
|
||||||
$(OBJ)\savegame.$o \
|
$(OBJ)\savegame.$o \
|
||||||
$(OBJ)\sector.$o \
|
$(OBJ)\sector.$o \
|
||||||
|
$(OBJ)\sector_inline.$o \
|
||||||
$(OBJ)\rts.$o \
|
$(OBJ)\rts.$o \
|
||||||
$(OBJ)\config.$o \
|
$(OBJ)\config.$o \
|
||||||
$(OBJ)\animlib.$o\
|
$(OBJ)\animlib.$o\
|
||||||
|
|
|
@ -35,8 +35,8 @@ flags_link=/DEBUG
|
||||||
flags_lib=
|
flags_lib=
|
||||||
!else
|
!else
|
||||||
# release options
|
# release options
|
||||||
flags_cl=/O2 /GL /arch:SSE /MP /I$(WDKROOT)\inc\crt
|
flags_cl=/O2 /GL /arch:SSE /MP # /I$(WDKROOT)\inc\crt
|
||||||
flags_link=/RELEASE /LTCG /LIBPATH:$(WDKROOT)\lib\Crt\i386 /LIBPATH:$(WDKROOT)\lib\wxp\i386
|
flags_link=/RELEASE /LTCG # /LIBPATH:$(WDKROOT)\lib\Crt\i386 /LIBPATH:$(WDKROOT)\lib\wxp\i386
|
||||||
flags_lib=/LTCG
|
flags_lib=/LTCG
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ void yax_updategrays(int32_t posze);
|
||||||
|
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
// more user tag hijacking: lotag/extra :/
|
// more user tag hijacking: lotag/extra :/
|
||||||
# define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(&Ptr[Wall].lotag + 2*Cf))
|
# define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(int16_t *)(&Ptr[Wall].lotag + 2*Cf))
|
||||||
# define YAX_NEXTWALL(Wall, Cf) YAX_PTRNEXTWALL(wall, Wall, Cf)
|
# define YAX_NEXTWALL(Wall, Cf) YAX_PTRNEXTWALL(wall, Wall, Cf)
|
||||||
# define YAX_NEXTWALLDEFAULT(Cf) (((Cf)==YAX_CEILING) ? 0 : -1)
|
# define YAX_NEXTWALLDEFAULT(Cf) (((Cf)==YAX_CEILING) ? 0 : -1)
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
Tracker(Sector, int16_t) wallptr, wallnum;
|
Tracker(Sector, int16_t) wallptr, wallnum;
|
||||||
Tracker(Sector, int32_t) ceilingz, floorz;
|
Tracker(Sector, int32_t) ceilingz, floorz;
|
||||||
Tracker(Sector, int16_t) ceilingstat, floorstat;
|
Tracker(Sector, uint16_t) ceilingstat, floorstat;
|
||||||
Tracker(Sector, int16_t) ceilingpicnum, ceilingheinum;
|
Tracker(Sector, int16_t) ceilingpicnum, ceilingheinum;
|
||||||
Tracker(Sector, int8_t) ceilingshade;
|
Tracker(Sector, int8_t) ceilingshade;
|
||||||
Tracker(Sector, uint8_t) ceilingpal, ceilingxpanning, ceilingypanning;
|
Tracker(Sector, uint8_t) ceilingpal, ceilingxpanning, ceilingypanning;
|
||||||
|
@ -236,7 +236,8 @@ typedef struct
|
||||||
Tracker(Sector, int8_t) floorshade;
|
Tracker(Sector, int8_t) floorshade;
|
||||||
Tracker(Sector, uint8_t) floorpal, floorxpanning, floorypanning;
|
Tracker(Sector, uint8_t) floorpal, floorxpanning, floorypanning;
|
||||||
Tracker(Sector, uint8_t) visibility, filler;
|
Tracker(Sector, uint8_t) visibility, filler;
|
||||||
Tracker(Sector, int16_t) lotag, hitag, extra;
|
Tracker(Sector, uint16_t) lotag, hitag;
|
||||||
|
Tracker(Sector, int16_t) extra;
|
||||||
} sectortype;
|
} sectortype;
|
||||||
|
|
||||||
//cstat:
|
//cstat:
|
||||||
|
@ -257,11 +258,13 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
Tracker(Wall, int32_t) x, y;
|
Tracker(Wall, int32_t) x, y;
|
||||||
Tracker(Wall, int16_t) point2, nextwall, nextsector, cstat;
|
Tracker(Wall, int16_t) point2, nextwall, nextsector;
|
||||||
|
Tracker(Wall, uint16_t) cstat;
|
||||||
Tracker(Wall, int16_t) picnum, overpicnum;
|
Tracker(Wall, int16_t) picnum, overpicnum;
|
||||||
Tracker(Wall, int8_t) shade;
|
Tracker(Wall, int8_t) shade;
|
||||||
Tracker(Wall, uint8_t) pal, xrepeat, yrepeat, xpanning, ypanning;
|
Tracker(Wall, uint8_t) pal, xrepeat, yrepeat, xpanning, ypanning;
|
||||||
Tracker(Wall, int16_t) lotag, hitag, extra;
|
Tracker(Wall, uint16_t) lotag, hitag;
|
||||||
|
Tracker(Wall, int16_t) extra;
|
||||||
} walltype;
|
} walltype;
|
||||||
|
|
||||||
//cstat:
|
//cstat:
|
||||||
|
@ -287,14 +290,16 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
Tracker(Sprite, int32_t) x, y, z;
|
Tracker(Sprite, int32_t) x, y, z;
|
||||||
Tracker(Sprite, int16_t) cstat, picnum;
|
Tracker(Sprite, uint16_t) cstat;
|
||||||
|
Tracker(Sprite, int16_t) picnum;
|
||||||
Tracker(Sprite, int8_t) shade;
|
Tracker(Sprite, int8_t) shade;
|
||||||
Tracker(Sprite, uint8_t) pal, clipdist, filler;
|
Tracker(Sprite, uint8_t) pal, clipdist, filler;
|
||||||
Tracker(Sprite, uint8_t) xrepeat, yrepeat;
|
Tracker(Sprite, uint8_t) xrepeat, yrepeat;
|
||||||
Tracker(Sprite, int8_t) xoffset, yoffset;
|
Tracker(Sprite, int8_t) xoffset, yoffset;
|
||||||
Tracker(Sprite, int16_t) sectnum, statnum;
|
Tracker(Sprite, int16_t) sectnum, statnum;
|
||||||
Tracker(Sprite, int16_t) ang, owner, xvel, yvel, zvel;
|
Tracker(Sprite, int16_t) ang, owner, xvel, yvel, zvel;
|
||||||
Tracker(Sprite, int16_t) lotag, hitag, extra;
|
Tracker(Sprite, uint16_t) lotag, hitag;
|
||||||
|
Tracker(Sprite, int16_t) extra;
|
||||||
} spritetype;
|
} spritetype;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -407,7 +412,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 +480,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
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,13 @@
|
||||||
# define ATTRIBUTE(attrlist)
|
# define ATTRIBUTE(attrlist)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef min
|
||||||
|
#define min(x,y) ((x) < (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
#ifndef max
|
||||||
|
#define max(x,y) ((x) > (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
// This gives us access to 'intptr_t' and 'uintptr_t', which are
|
// This gives us access to 'intptr_t' and 'uintptr_t', which are
|
||||||
// abstractions to the size of a pointer on a given platform
|
// abstractions to the size of a pointer on a given platform
|
||||||
// (ie, they're guaranteed to be the same size as a pointer)
|
// (ie, they're guaranteed to be the same size as a pointer)
|
||||||
|
@ -100,6 +107,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
|
#include <direct.h>
|
||||||
# define inline __inline
|
# define inline __inline
|
||||||
# define longlong(x) x##i64
|
# define longlong(x) x##i64
|
||||||
static inline float nearbyintf(float x)
|
static inline float nearbyintf(float x)
|
||||||
|
@ -500,7 +508,13 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
|
||||||
# else
|
# else
|
||||||
# define Btell tell
|
# define Btell tell
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef _MSC_VER
|
||||||
# define Bstat stat
|
# define Bstat stat
|
||||||
|
# define Bfstat fstat
|
||||||
|
# else
|
||||||
|
# define Bstat stat
|
||||||
|
# define Bfstat fstat
|
||||||
|
# endif
|
||||||
# define Bfopen fopen
|
# define Bfopen fopen
|
||||||
# define Bfclose fclose
|
# define Bfclose fclose
|
||||||
# define Bfflush fflush
|
# define Bfflush fflush
|
||||||
|
@ -653,5 +667,38 @@ char *Bstrupr(char *);
|
||||||
if (fileptr) { Bfclose(fileptr); fileptr=NULL; } \
|
if (fileptr) { Bfclose(fileptr); fileptr=NULL; } \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define NOWARN(print_func, fmt, ...) do { \
|
||||||
|
print_func(fmt, ## __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define NOWARN_RETURN(print_func, var, fmt, ...) do { \
|
||||||
|
var = print_func(fmt, ## __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
// TODO: add MSVC pragmas to disable equivalent warning, if necessary later
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#ifdef _WIN32
|
||||||
|
// MinGW's _Pragma is completely broken so our GCC NOWARN macro is useless there
|
||||||
|
#pragma GCC diagnostic ignored "-Wformat"
|
||||||
|
#else
|
||||||
|
#undef NOWARN
|
||||||
|
#undef NOWARN_RETURN
|
||||||
|
|
||||||
|
#define NOWARN(print_func, fmt, ...) do { _Pragma("GCC diagnostic ignored \"-Wformat\"") \
|
||||||
|
print_func(fmt, ## __VA_ARGS__); \
|
||||||
|
_Pragma("GCC diagnostic warning \"-Wformat\"") } while (0)
|
||||||
|
|
||||||
|
#define NOWARN_RETURN(print_func, var, fmt, ...) do { _Pragma("GCC diagnostic ignored \"-Wformat\"") \
|
||||||
|
var = print_func(fmt, ## __VA_ARGS__); \
|
||||||
|
_Pragma("GCC diagnostic warning \"-Wformat\"") } while (0)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define OSD_Printf_nowarn(fmt, ...) NOWARN(OSD_Printf, fmt, ## __VA_ARGS__)
|
||||||
|
#define Bsprintf_nowarn(fmt, ...) NOWARN(Bsprintf, fmt, ## __VA_ARGS__)
|
||||||
|
#define Bsprintf_nowarn_return(x, fmt, ...) NOWARN_RETURN(Bsprintf, x, fmt, ## __VA_ARGS__)
|
||||||
|
#define initprintf_nowarn(fmt, ...) NOWARN(initprintf, fmt, ## __VA_ARGS__)
|
||||||
|
#define message_nowarn(fmt, ...) NOWARN(message, fmt, ## __VA_ARGS__)
|
||||||
|
|
||||||
#endif // __compat_h__
|
#endif // __compat_h__
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
#ifndef _MSC_VER // [
|
#ifndef _MSC_VER // [
|
||||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||||
#endif // _MSC_VER ]
|
#endif // _MSC_VER ]
|
||||||
|
#ifndef _STDINT
|
||||||
|
#define _STDINT
|
||||||
#ifndef _MSC_STDINT_H_ // [
|
#ifndef _MSC_STDINT_H_ // [
|
||||||
#define _MSC_STDINT_H_
|
#define _MSC_STDINT_H_
|
||||||
|
|
||||||
|
@ -245,3 +246,4 @@ typedef uint64_t uintmax_t;
|
||||||
|
|
||||||
|
|
||||||
#endif // _MSC_STDINT_H_ ]
|
#endif // _MSC_STDINT_H_ ]
|
||||||
|
#endif
|
|
@ -595,7 +595,7 @@ NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmemalign(nedpo
|
||||||
/*! \ingroup v2malloc
|
/*! \ingroup v2malloc
|
||||||
\brief Allocates a block of memory sized \em size from pool \em p, aligned to \em alignment and according to the flags \em flags.
|
\brief Allocates a block of memory sized \em size from pool \em p, aligned to \em alignment and according to the flags \em flags.
|
||||||
*/
|
*/
|
||||||
NEDMALLOCDEPRECATED NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmalloc2(nedpool *p, size_t size, size_t alignment=0, unsigned flags=0) THROWSPEC;
|
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmalloc2(nedpool *p, size_t size, size_t alignment=0, unsigned flags=0) THROWSPEC;
|
||||||
/*! \ingroup v2malloc
|
/*! \ingroup v2malloc
|
||||||
\brief Resizes the block of memory at \em mem in pool \em p to size \em size, aligned to \em alignment and according to the flags \em flags.
|
\brief Resizes the block of memory at \em mem in pool \em p to size \em size, aligned to \em alignment and according to the flags \em flags.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -85,8 +85,8 @@ enum osdflags_t
|
||||||
OSD_CAPS = 0x00000040
|
OSD_CAPS = 0x00000040
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OSD_ALIAS (void *)0x1337
|
#define OSD_ALIAS (int32_t (*)(const osdfuncparm_t*))0x1337
|
||||||
#define OSD_UNALIASED (void *)0xDEAD
|
#define OSD_UNALIASED (int32_t (*)(const osdfuncparm_t*))0xDEAD
|
||||||
|
|
||||||
#define OSDCMD_OK 0
|
#define OSDCMD_OK 0
|
||||||
#define OSDCMD_SHOWHELP 1
|
#define OSDCMD_SHOWHELP 1
|
||||||
|
|
|
@ -8,31 +8,31 @@ class __TRACKER_NAME
|
||||||
public:
|
public:
|
||||||
inline TrackedType* operator & ()
|
inline TrackedType* operator & ()
|
||||||
{
|
{
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return &this->TrackedValue;
|
return &this->TrackedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline TrackedType operator ++ ()
|
inline TrackedType operator ++ ()
|
||||||
{
|
{
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return ++this->TrackedValue;
|
return ++this->TrackedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline TrackedType operator ++ (int)
|
inline TrackedType operator ++ (int)
|
||||||
{
|
{
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return this->TrackedValue++;
|
return this->TrackedValue++;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline TrackedType operator -- ()
|
inline TrackedType operator -- ()
|
||||||
{
|
{
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return --this->TrackedValue;
|
return --this->TrackedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline TrackedType operator -- (int)
|
inline TrackedType operator -- (int)
|
||||||
{
|
{
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return this->TrackedValue--;
|
return this->TrackedValue--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ inline TrackedType __TRACKER_NAME<TrackedType>::operator __TRACKER_OPERATOR (__T
|
||||||
|
|
||||||
if (!isNoop) {
|
if (!isNoop) {
|
||||||
|
|
||||||
__TRACKER_GLOBAL_HOOK((int)&this->TrackedValue);
|
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
|
||||||
return (this->TrackedValue __TRACKER_OPERATOR __TRACKER_RIGHTHAND);
|
return (this->TrackedValue __TRACKER_OPERATOR __TRACKER_RIGHTHAND);
|
||||||
} else {
|
} else {
|
||||||
return this->TrackedValue;
|
return this->TrackedValue;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -383,10 +383,16 @@ int32_t baselayer_init(void)
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(NOASM) && !defined(GEKKO) && !defined(__ANDROID__)
|
||||||
|
extern "C" {
|
||||||
|
extern int32_t dep_begin, dep_end;
|
||||||
|
};
|
||||||
|
#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))
|
||||||
|
|
|
@ -1580,19 +1580,19 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate temp storage
|
// allocate temp storage
|
||||||
ptrs[np++] = mapinfo->sector = Bmalloc(highlightsectorcnt * sizeof(sectortype));
|
ptrs[np++] = mapinfo->sector = (sectortype *)Bmalloc(highlightsectorcnt * sizeof(sectortype));
|
||||||
if (!mapinfo->sector) return -2;
|
if (!mapinfo->sector) return -2;
|
||||||
|
|
||||||
ptrs[np++] = mapinfo->wall = Bmalloc(tmpnumwalls * sizeof(walltype));
|
ptrs[np++] = mapinfo->wall = (walltype *)Bmalloc(tmpnumwalls * sizeof(walltype));
|
||||||
if (!mapinfo->wall) { free_n_ptrs(ptrs, np-1); return -2; }
|
if (!mapinfo->wall) { free_n_ptrs(ptrs, np-1); return -2; }
|
||||||
|
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
if (mapinfo->numyaxbunches > 0)
|
if (mapinfo->numyaxbunches > 0)
|
||||||
{
|
{
|
||||||
ptrs[np++] = mapinfo->bunchnum = Bmalloc(highlightsectorcnt*2*sizeof(int16_t));
|
ptrs[np++] = mapinfo->bunchnum = (int16_t *)Bmalloc(highlightsectorcnt*2*sizeof(int16_t));
|
||||||
if (!mapinfo->bunchnum) { free_n_ptrs(ptrs, np-1); return -2; }
|
if (!mapinfo->bunchnum) { free_n_ptrs(ptrs, np-1); return -2; }
|
||||||
|
|
||||||
ptrs[np++] = mapinfo->ynextwall = Bmalloc(tmpnumwalls*2*sizeof(int16_t));
|
ptrs[np++] = mapinfo->ynextwall = (int16_t *)Bmalloc(tmpnumwalls*2*sizeof(int16_t));
|
||||||
if (!mapinfo->ynextwall) { free_n_ptrs(ptrs, np-1); return -2; }
|
if (!mapinfo->ynextwall) { free_n_ptrs(ptrs, np-1); return -2; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1603,7 +1603,7 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo)
|
||||||
|
|
||||||
if (tmpnumsprites>0)
|
if (tmpnumsprites>0)
|
||||||
{
|
{
|
||||||
ptrs[np++] = mapinfo->sprite = Bmalloc(tmpnumsprites * sizeof(spritetype));
|
ptrs[np++] = mapinfo->sprite = (spritetype *)Bmalloc(tmpnumsprites * sizeof(spritetype));
|
||||||
if (!mapinfo->sprite) { free_n_ptrs(ptrs, np-1); return -2; }
|
if (!mapinfo->sprite) { free_n_ptrs(ptrs, np-1); return -2; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1640,7 +1640,7 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo)
|
||||||
{
|
{
|
||||||
// if a bunch was discarded
|
// if a bunch was discarded
|
||||||
sectortype *const sec = &mapinfo->sector[i];
|
sectortype *const sec = &mapinfo->sector[i];
|
||||||
int16_t *const cs = j==YAX_CEILING ? &sec->ceilingstat : &sec->floorstat;
|
uint16_t *const cs = j==YAX_CEILING ? &sec->ceilingstat : &sec->floorstat;
|
||||||
uint8_t *const xp = j==YAX_CEILING ? &sec->ceilingxpanning : &sec->floorxpanning;
|
uint8_t *const xp = j==YAX_CEILING ? &sec->ceilingxpanning : &sec->floorxpanning;
|
||||||
|
|
||||||
*cs &= ~YAX_BIT;
|
*cs &= ~YAX_BIT;
|
||||||
|
@ -2181,7 +2181,7 @@ void fade_editor_screen(int32_t keepcol)
|
||||||
{
|
{
|
||||||
char blackcol=0, greycol=whitecol-25, *cp;
|
char blackcol=0, greycol=whitecol-25, *cp;
|
||||||
int32_t pix, i, threecols = (keepcol >= 256);
|
int32_t pix, i, threecols = (keepcol >= 256);
|
||||||
char cols[3] = {keepcol&0xff, (keepcol>>8)&0xff, (keepcol>>16)&0xff};
|
char cols[3] = {(char)(keepcol&0xff), (char)((keepcol>>8)&0xff), (char)((keepcol>>16)&0xff)};
|
||||||
|
|
||||||
begindrawing();
|
begindrawing();
|
||||||
cp = (char *)frameplace;
|
cp = (char *)frameplace;
|
||||||
|
@ -2445,7 +2445,7 @@ static int32_t backup_drawn_walls(int32_t restore)
|
||||||
if (newnumwalls <= numwalls) // shouldn't happen
|
if (newnumwalls <= numwalls) // shouldn't happen
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
tmpwall = Bmalloc((newnumwalls-numwalls) * sizeof(walltype));
|
tmpwall = (walltype *)Bmalloc((newnumwalls-numwalls) * sizeof(walltype));
|
||||||
if (!tmpwall)
|
if (!tmpwall)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -2732,7 +2732,7 @@ static int32_t bakframe_fillandfade(char **origframeptr, int32_t sectnum, const
|
||||||
{
|
{
|
||||||
if (!*origframeptr)
|
if (!*origframeptr)
|
||||||
{
|
{
|
||||||
*origframeptr = Bmalloc(xdim*ydim);
|
*origframeptr = (char *)Bmalloc(xdim*ydim);
|
||||||
if (*origframeptr)
|
if (*origframeptr)
|
||||||
{
|
{
|
||||||
begindrawing();
|
begindrawing();
|
||||||
|
@ -4221,7 +4221,7 @@ rotate_hlsect_out:
|
||||||
// ^ |
|
// ^ |
|
||||||
// minfloorz ---|
|
// minfloorz ---|
|
||||||
|
|
||||||
ulz[0] = oldfz - swsecheight*((double)(oldfz-maxceilz)/(minfloorz-maxceilz));
|
ulz[0] = (int32_t)(oldfz - swsecheight*((double)(oldfz-maxceilz)/(minfloorz-maxceilz)));
|
||||||
ulz[0] &= ~255;
|
ulz[0] &= ~255;
|
||||||
ulz[1] = ulz[0] + swsecheight;
|
ulz[1] = ulz[0] + swsecheight;
|
||||||
|
|
||||||
|
@ -4969,8 +4969,8 @@ end_yax: ;
|
||||||
sector[refsect].wallnum += n;
|
sector[refsect].wallnum += n;
|
||||||
if (refsect != numsectors-1)
|
if (refsect != numsectors-1)
|
||||||
{
|
{
|
||||||
walltype *tmpwall = Bmalloc(n * sizeof(walltype));
|
walltype *tmpwall = (walltype *)Bmalloc(n * sizeof(walltype));
|
||||||
int16_t *tmponw = Bmalloc(n * sizeof(int16_t));
|
int16_t *tmponw = (int16_t *)Bmalloc(n * sizeof(int16_t));
|
||||||
|
|
||||||
if (!tmpwall || !tmponw)
|
if (!tmpwall || !tmponw)
|
||||||
{
|
{
|
||||||
|
@ -5836,9 +5836,9 @@ end_point_dragging:
|
||||||
|
|
||||||
if (!delayerr)
|
if (!delayerr)
|
||||||
message("Outer wall coordinates must coincide for both components");
|
message("Outer wall coordinates must coincide for both components");
|
||||||
OSD_Printf("wal0:%d (%d,%d)--(%d,%d)\n",(int)(wal0-wall),
|
OSD_Printf_nowarn("wal0:%d (%d,%d)--(%d,%d)\n",(int)(wal0-wall),
|
||||||
wal0->x,wal0->y, wal0p2->x,wal0p2->y);
|
wal0->x,wal0->y, wal0p2->x,wal0p2->y);
|
||||||
OSD_Printf("wal1:%d (%d,%d)--(%d,%d)\n",(int)(wal1-wall),
|
OSD_Printf_nowarn("wal1:%d (%d,%d)--(%d,%d)\n",(int)(wal1-wall),
|
||||||
wal1->x,wal1->y, wal1p2->x,wal1p2->y);
|
wal1->x,wal1->y, wal1p2->x,wal1p2->y);
|
||||||
|
|
||||||
goto end_join_sectors;
|
goto end_join_sectors;
|
||||||
|
@ -8572,7 +8572,7 @@ int32_t fixspritesectors(void)
|
||||||
initprintf("--------------------\n");
|
initprintf("--------------------\n");
|
||||||
printfirsttime = 1;
|
printfirsttime = 1;
|
||||||
}
|
}
|
||||||
initprintf("Changed sectnum of sprite %d from %d to %d\n", i, sprite[i].sectnum, j);
|
initprintf_nowarn("Changed sectnum of sprite %d from %d to %d\n", i, sprite[i].sectnum, j);
|
||||||
changespritesect(i, j);
|
changespritesect(i, j);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10021,9 +10021,10 @@ void printcoords16(int32_t posxe, int32_t posye, int16_t ange)
|
||||||
printext16(264, ydim-STATUS2DSIZ+128, v8?editorcolors[10]:whitecol, -1, snotbuf,0);
|
printext16(264, ydim-STATUS2DSIZ+128, v8?editorcolors[10]:whitecol, -1, snotbuf,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DOPRINT(Yofs, fmt, ...) \
|
#define DOPRINT(Yofs, fmt, ...) do { \
|
||||||
Bsprintf(snotbuf, fmt, ## __VA_ARGS__); \
|
Bsprintf_nowarn(snotbuf, fmt, ## __VA_ARGS__); \
|
||||||
printext16(8+col*200, ydim/*-(row*96)*/-STATUS2DSIZ+Yofs, color, -1, snotbuf, 0);
|
printext16(8+col*200, ydim/*-(row*96)*/-STATUS2DSIZ+Yofs, color, -1, snotbuf, 0); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
void showsectordata(int16_t sectnum, int16_t small)
|
void showsectordata(int16_t sectnum, int16_t small)
|
||||||
{
|
{
|
||||||
|
@ -10547,9 +10548,9 @@ void test_map(int32_t mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
fullparam = Bstrrchr(mapster32_fullpath, '\\');
|
fullparam = (char *)Bstrrchr(mapster32_fullpath, '\\');
|
||||||
#else
|
#else
|
||||||
fullparam = Bstrrchr(mapster32_fullpath, '/');
|
fullparam = (char *)Bstrrchr(mapster32_fullpath, '/');
|
||||||
#endif
|
#endif
|
||||||
if (fullparam)
|
if (fullparam)
|
||||||
{
|
{
|
||||||
|
@ -10572,7 +10573,7 @@ void test_map(int32_t mode)
|
||||||
// and a possible extra space not in testplay_addparam,
|
// and a possible extra space not in testplay_addparam,
|
||||||
// the length should be Bstrlen(game_executable)+Bstrlen(param)+(slen+1)+2+1.
|
// the length should be Bstrlen(game_executable)+Bstrlen(param)+(slen+1)+2+1.
|
||||||
|
|
||||||
fullparam = Bmalloc(Bstrlen(game_executable)+Bstrlen(param)+slen+4);
|
fullparam = (char *)Bmalloc(Bstrlen(game_executable)+Bstrlen(param)+slen+4);
|
||||||
Bsprintf(fullparam,"\"%s\"",game_executable);
|
Bsprintf(fullparam,"\"%s\"",game_executable);
|
||||||
|
|
||||||
if (testplay_addparam)
|
if (testplay_addparam)
|
||||||
|
|
|
@ -315,7 +315,7 @@ char *listsearchpath(int32_t initp)
|
||||||
|
|
||||||
int32_t addsearchpath(const char *p)
|
int32_t addsearchpath(const char *p)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct Bstat st;
|
||||||
char *s;
|
char *s;
|
||||||
searchpath_t *srch;
|
searchpath_t *srch;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#define _WIN32_IE 0x0400
|
//#define _WIN32_IE 0x0400
|
||||||
#define _WIN32_WINNT 0x0501
|
#define _WIN32_WINNT 0x0501
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
@ -570,8 +570,8 @@ char *Bgetsystemdrives(void)
|
||||||
|
|
||||||
int32_t Bfilelength(int32_t fd)
|
int32_t Bfilelength(int32_t fd)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct Bstat st;
|
||||||
if (fstat(fd, &st) < 0) return -1;
|
if (Bfstat(fd, &st) < 0) return -1;
|
||||||
return(int32_t)(st.st_size);
|
return(int32_t)(st.st_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,7 +643,7 @@ struct Bdirent *Breaddir(BDIR *dir)
|
||||||
{
|
{
|
||||||
BDIR_real *dirr = (BDIR_real *)dir;
|
BDIR_real *dirr = (BDIR_real *)dir;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
struct stat st;
|
struct Bstat st;
|
||||||
char *fn;
|
char *fn;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
|
@ -163,9 +163,9 @@ static void tile_from_truecolpic(int32_t tile, const palette_t *picptr, int32_t
|
||||||
const int32_t xsiz = tilesizx[tile], ysiz = tilesizy[tile];
|
const int32_t xsiz = tilesizx[tile], ysiz = tilesizy[tile];
|
||||||
int32_t i, j;
|
int32_t i, j;
|
||||||
|
|
||||||
char *ftd = Bmalloc(xsiz*ysiz);
|
char *ftd = (char *)Bmalloc(xsiz*ysiz);
|
||||||
|
|
||||||
faketiledata[tile] = Bmalloc(xsiz*ysiz + 400);
|
faketiledata[tile] = (char *)Bmalloc(xsiz*ysiz + 400);
|
||||||
|
|
||||||
for (i=xsiz-1; i>=0; i--)
|
for (i=xsiz-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
|
@ -1484,7 +1484,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
fd = kopen4load(fn, 0);
|
fd = kopen4load(fn, 0);
|
||||||
|
|
||||||
// load the highpalookup and send it to polymer
|
// load the highpalookup and send it to polymer
|
||||||
highpaldata = Bmalloc(PR_HIGHPALOOKUP_DATA_SIZE);
|
highpaldata = (char *)Bmalloc(PR_HIGHPALOOKUP_DATA_SIZE);
|
||||||
|
|
||||||
{
|
{
|
||||||
char *filebuf;
|
char *filebuf;
|
||||||
|
@ -1492,7 +1492,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
|
|
||||||
filesize = kfilelength(fd);
|
filesize = kfilelength(fd);
|
||||||
|
|
||||||
filebuf = Bmalloc(filesize);
|
filebuf = (char *)Bmalloc(filesize);
|
||||||
if (!filebuf) { kclose(fd); Bfree(highpaldata); break; }
|
if (!filebuf) { kclose(fd); Bfree(highpaldata); break; }
|
||||||
|
|
||||||
klseek(fd, 0, SEEK_SET);
|
klseek(fd, 0, SEEK_SET);
|
||||||
|
|
|
@ -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];
|
||||||
|
@ -850,8 +863,8 @@ void yax_preparedrawrooms(void)
|
||||||
if (getrendermode()==0 && ymostallocsize < xdimen*numyaxbunches)
|
if (getrendermode()==0 && ymostallocsize < xdimen*numyaxbunches)
|
||||||
{
|
{
|
||||||
ymostallocsize = xdimen*numyaxbunches;
|
ymostallocsize = xdimen*numyaxbunches;
|
||||||
yumost = Brealloc(yumost, ymostallocsize*sizeof(int16_t));
|
yumost = (int16_t *)Brealloc(yumost, ymostallocsize*sizeof(int16_t));
|
||||||
ydmost = Brealloc(ydmost, ymostallocsize*sizeof(int16_t));
|
ydmost = (int16_t *)Brealloc(ydmost, ymostallocsize*sizeof(int16_t));
|
||||||
|
|
||||||
if (!yumost || !ydmost)
|
if (!yumost || !ydmost)
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
|
@ -1318,9 +1332,9 @@ int32_t clipmapinfo_load(void)
|
||||||
|
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
loadsector = Bmalloc(MAXSECTORS * sizeof(sectortype));
|
loadsector = (sectortype *)Bmalloc(MAXSECTORS * sizeof(sectortype));
|
||||||
loadwall = Bmalloc(MAXWALLS * sizeof(walltype));
|
loadwall = (walltype *)Bmalloc(MAXWALLS * sizeof(walltype));
|
||||||
loadsprite = Bmalloc(MAXSPRITES * sizeof(spritetype));
|
loadsprite = (spritetype *)Bmalloc(MAXSPRITES * sizeof(spritetype));
|
||||||
|
|
||||||
if (!loadsector || !loadwall || !loadsprite)
|
if (!loadsector || !loadwall || !loadsprite)
|
||||||
{
|
{
|
||||||
|
@ -1394,8 +1408,8 @@ int32_t clipmapinfo_load(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// shrink
|
// shrink
|
||||||
loadsector = Brealloc(loadsector, ournumsectors*sizeof(sectortype));
|
loadsector = (sectortype *)Brealloc(loadsector, ournumsectors*sizeof(sectortype));
|
||||||
loadwall = Brealloc(loadwall, ournumwalls*sizeof(walltype));
|
loadwall = (walltype *)Brealloc(loadwall, ournumwalls*sizeof(walltype));
|
||||||
|
|
||||||
Bmemcpy(sector, loadsector, ournumsectors*sizeof(sectortype));
|
Bmemcpy(sector, loadsector, ournumsectors*sizeof(sectortype));
|
||||||
Bmemcpy(wall, loadwall, ournumwalls*sizeof(walltype));
|
Bmemcpy(wall, loadwall, ournumwalls*sizeof(walltype));
|
||||||
|
@ -1405,7 +1419,7 @@ int32_t clipmapinfo_load(void)
|
||||||
|
|
||||||
// vvvv don't use headsprite[sect,stat]! vvvv
|
// vvvv don't use headsprite[sect,stat]! vvvv
|
||||||
|
|
||||||
sectoidx = Bmalloc(numsectors*sizeof(sectoidx[0]));
|
sectoidx = (int16_t *)Bmalloc(numsectors*sizeof(sectoidx[0]));
|
||||||
if (!sectoidx || !sector || !wall)
|
if (!sectoidx || !sector || !wall)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
@ -1447,8 +1461,8 @@ int32_t clipmapinfo_load(void)
|
||||||
int16_t ns, outersect;
|
int16_t ns, outersect;
|
||||||
int32_t pn,scnt, x,y,z, maxdist;
|
int32_t pn,scnt, x,y,z, maxdist;
|
||||||
|
|
||||||
sectq = Bmalloc(numsectors*sizeof(sectq[0]));
|
sectq = (int16_t *)Bmalloc(numsectors*sizeof(sectq[0]));
|
||||||
tempictoidx = Bmalloc(MAXTILES*sizeof(tempictoidx[0]));
|
tempictoidx = (int16_t *)Bmalloc(MAXTILES*sizeof(tempictoidx[0]));
|
||||||
if (!sectq || !tempictoidx)
|
if (!sectq || !tempictoidx)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
@ -1687,7 +1701,7 @@ int32_t clipmapinfo_load(void)
|
||||||
Bmemcpy(loadwall, wall, ournumwalls*sizeof(walltype));
|
Bmemcpy(loadwall, wall, ournumwalls*sizeof(walltype));
|
||||||
|
|
||||||
// loadwallinv will contain all walls with inverted orientation for x/y-flip handling
|
// loadwallinv will contain all walls with inverted orientation for x/y-flip handling
|
||||||
loadwallinv = Bmalloc(ournumwalls*sizeof(walltype));
|
loadwallinv = (walltype *)Bmalloc(ournumwalls*sizeof(walltype));
|
||||||
if (!loadwallinv)
|
if (!loadwallinv)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -4354,7 +4362,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i
|
||||||
|
|
||||||
int32_t dapyscale;
|
int32_t dapyscale;
|
||||||
int16_t dapskybits;
|
int16_t dapskybits;
|
||||||
static const int16_t zeropskyoff[MAXPSKYTILES];
|
static const int16_t zeropskyoff[MAXPSKYTILES] = { 0 };
|
||||||
const int16_t *dapskyoff;
|
const int16_t *dapskyoff;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(dax1);
|
UNREFERENCED_PARAMETER(dax1);
|
||||||
|
@ -7569,14 +7577,14 @@ static int32_t loadtables(void)
|
||||||
reciptable[i] = divscale30(2048, i+2048);
|
reciptable[i] = divscale30(2048, i+2048);
|
||||||
|
|
||||||
for (i=0; i<=512; i++)
|
for (i=0; i<=512; i++)
|
||||||
sintable[i] = 16384*sin(i*BANG2RAD);
|
sintable[i] = (int16_t)(16384*sin(i*BANG2RAD));
|
||||||
for (i=513; i<1024; i++)
|
for (i=513; i<1024; i++)
|
||||||
sintable[i] = sintable[1024-i];
|
sintable[i] = sintable[1024-i];
|
||||||
for (i=1024; i<2048; i++)
|
for (i=1024; i<2048; i++)
|
||||||
sintable[i] = -sintable[i-1024];
|
sintable[i] = -sintable[i-1024];
|
||||||
|
|
||||||
for (i=0; i<640; i++)
|
for (i=0; i<640; i++)
|
||||||
radarang[i] = -64*atan((640-0.5-i)/160)/BANG2RAD;
|
radarang[i] = (int16_t)(-64*atan((640-0.5-i)/160)/BANG2RAD);
|
||||||
for (i=0; i<640; i++)
|
for (i=0; i<640; i++)
|
||||||
radarang[1279-i] = -radarang[i];
|
radarang[1279-i] = -radarang[i];
|
||||||
|
|
||||||
|
@ -7670,8 +7678,8 @@ static int32_t loadpalette(void)
|
||||||
kread(fil,palette,768);
|
kread(fil,palette,768);
|
||||||
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
|
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
|
||||||
|
|
||||||
palookup[0] = Bmalloc(numshades<<8);
|
palookup[0] = (char *)Bmalloc(numshades<<8);
|
||||||
transluc = Bmalloc(65536);
|
transluc = (char *)Bmalloc(65536);
|
||||||
if (palookup[0] == NULL || transluc == NULL)
|
if (palookup[0] == NULL || transluc == NULL)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
|
@ -8256,7 +8264,7 @@ int32_t initengine(void)
|
||||||
#if !defined _WIN32 && defined DEBUGGINGAIDS && !defined GEKKO
|
#if !defined _WIN32 && defined DEBUGGINGAIDS && !defined GEKKO
|
||||||
struct sigaction sigact, oldact;
|
struct sigaction sigact, oldact;
|
||||||
memset(&sigact, 0, sizeof(sigact));
|
memset(&sigact, 0, sizeof(sigact));
|
||||||
sigact.sa_sigaction = (void *)sighandler;
|
sigact.sa_sigaction = (void (*)(int, siginfo_t*, void*))sighandler;
|
||||||
sigact.sa_flags = SA_SIGINFO;
|
sigact.sa_flags = SA_SIGINFO;
|
||||||
sigaction(SIGFPE, &sigact, &oldact);
|
sigaction(SIGFPE, &sigact, &oldact);
|
||||||
#endif
|
#endif
|
||||||
|
@ -9396,7 +9404,7 @@ static void check_sprite(int32_t i)
|
||||||
{
|
{
|
||||||
if ((unsigned)sprite[i].sectnum >= MYMAXSECTORS())
|
if ((unsigned)sprite[i].sectnum >= MYMAXSECTORS())
|
||||||
{
|
{
|
||||||
initprintf(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal sector (%d). Map is corrupt!\n",
|
initprintf_nowarn(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal sector (%d). Map is corrupt!\n",
|
||||||
i, sprite[i].x, sprite[i].y, sprite[i].sectnum);
|
i, sprite[i].x, sprite[i].y, sprite[i].sectnum);
|
||||||
|
|
||||||
updatesector(sprite[i].x, sprite[i].y, &sprite[i].sectnum);
|
updatesector(sprite[i].x, sprite[i].y, &sprite[i].sectnum);
|
||||||
|
@ -9407,14 +9415,14 @@ static void check_sprite(int32_t i)
|
||||||
|
|
||||||
if ((unsigned)sprite[i].statnum >= MAXSTATUS)
|
if ((unsigned)sprite[i].statnum >= MAXSTATUS)
|
||||||
{
|
{
|
||||||
initprintf(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal statnum (%d). Map is corrupt!\n",
|
initprintf_nowarn(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal statnum (%d). Map is corrupt!\n",
|
||||||
i, sprite[i].x, sprite[i].y, sprite[i].statnum);
|
i, sprite[i].x, sprite[i].y, sprite[i].statnum);
|
||||||
sprite[i].statnum = 0;
|
sprite[i].statnum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((unsigned)sprite[i].picnum >= MAXTILES)
|
if ((unsigned)sprite[i].picnum >= MAXTILES)
|
||||||
{
|
{
|
||||||
initprintf(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal picnum (%d). Map is corrupt!\n",
|
initprintf_nowarn(OSD_ERROR "Map error: sprite #%d (%d,%d) with illegal picnum (%d). Map is corrupt!\n",
|
||||||
i, sprite[i].x, sprite[i].y, sprite[i].picnum);
|
i, sprite[i].x, sprite[i].y, sprite[i].picnum);
|
||||||
sprite[i].picnum = 0;
|
sprite[i].picnum = 0;
|
||||||
}
|
}
|
||||||
|
@ -10070,14 +10078,14 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int1
|
||||||
{
|
{
|
||||||
if ((unsigned)sprite[j].statnum > MAXSTATUS)
|
if ((unsigned)sprite[j].statnum > MAXSTATUS)
|
||||||
{
|
{
|
||||||
initprintf("Map error: sprite #%d(%d,%d) with an illegal statnum(%d)\n",
|
initprintf_nowarn("Map error: sprite #%d(%d,%d) with an illegal statnum(%d)\n",
|
||||||
j,sprite[j].x,sprite[j].y,sprite[j].statnum);
|
j,sprite[j].x,sprite[j].y,sprite[j].statnum);
|
||||||
changespritestat(j,0);
|
changespritestat(j,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((unsigned)sprite[j].sectnum > MAXSECTORS)
|
if ((unsigned)sprite[j].sectnum > MAXSECTORS)
|
||||||
{
|
{
|
||||||
initprintf("Map error: sprite #%d(%d,%d) with an illegal sectnum(%d)\n",
|
initprintf_nowarn("Map error: sprite #%d(%d,%d) with an illegal sectnum(%d)\n",
|
||||||
j,sprite[j].x,sprite[j].y,sprite[j].sectnum);
|
j,sprite[j].x,sprite[j].y,sprite[j].sectnum);
|
||||||
changespritesect(j,0);
|
changespritesect(j,0);
|
||||||
}
|
}
|
||||||
|
@ -10301,7 +10309,7 @@ int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t da
|
||||||
Bfree(lookups);
|
Bfree(lookups);
|
||||||
|
|
||||||
j = ydim*4; //Leave room for horizlookup&horizlookup2
|
j = ydim*4; //Leave room for horizlookup&horizlookup2
|
||||||
lookups = Bmalloc(2*j*sizeof(lookups[0]));
|
lookups = (int32_t *)Bmalloc(2*j*sizeof(lookups[0]));
|
||||||
|
|
||||||
if (lookups == NULL)
|
if (lookups == NULL)
|
||||||
{
|
{
|
||||||
|
@ -10514,7 +10522,7 @@ int32_t loadpics(const char *filename, int32_t askedsize)
|
||||||
if (filegrp[fil] == 254) // from zip
|
if (filegrp[fil] == 254) // from zip
|
||||||
{
|
{
|
||||||
i = kfilelength(fil);
|
i = kfilelength(fil);
|
||||||
artptrs[tilefilei] = Brealloc(artptrs[tilefilei], i);
|
artptrs[tilefilei] = (char *)Brealloc(artptrs[tilefilei], i);
|
||||||
klseek(fil, 0, BSEEK_SET);
|
klseek(fil, 0, BSEEK_SET);
|
||||||
kread(fil, artptrs[tilefilei], i);
|
kread(fil, artptrs[tilefilei], i);
|
||||||
}
|
}
|
||||||
|
@ -13606,7 +13614,7 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
|
||||||
if (palookup[palnum] == NULL || (palnum!=0 && palookup[palnum] == palookup[0]))
|
if (palookup[palnum] == NULL || (palnum!=0 && palookup[palnum] == palookup[0]))
|
||||||
{
|
{
|
||||||
//Allocate palookup buffer
|
//Allocate palookup buffer
|
||||||
palookup[palnum] = Bmalloc(numshades<<8);
|
palookup[palnum] = (char *)Bmalloc(numshades<<8);
|
||||||
if (palookup[palnum] == NULL)
|
if (palookup[palnum] == NULL)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -14307,7 +14315,7 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall)
|
||||||
|
|
||||||
if ((newfirstwall < startwall) || (newfirstwall >= startwall+danumwalls)) return;
|
if ((newfirstwall < startwall) || (newfirstwall >= startwall+danumwalls)) return;
|
||||||
|
|
||||||
tmpwall = Bmalloc(danumwalls * sizeof(walltype));
|
tmpwall = (walltype *)Bmalloc(danumwalls * sizeof(walltype));
|
||||||
if (!tmpwall)
|
if (!tmpwall)
|
||||||
{
|
{
|
||||||
initprintf("setfirstwall: OUT OF MEMORY!\n");
|
initprintf("setfirstwall: OUT OF MEMORY!\n");
|
||||||
|
@ -15937,7 +15945,7 @@ static int32_t screencapture_png(const char *filename, char inverseit, const cha
|
||||||
text = (png_textp)png_malloc(png_ptr, 2*png_sizeof(png_text));
|
text = (png_textp)png_malloc(png_ptr, 2*png_sizeof(png_text));
|
||||||
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
text[0].key = "Title";
|
text[0].key = "Title";
|
||||||
text[0].text = editstatus ? "Mapster32 screenshot" : "EDuke32 screenshot";
|
text[0].text = (png_charp)(editstatus ? "Mapster32 screenshot" : "EDuke32 screenshot");
|
||||||
|
|
||||||
text[1].compression = PNG_TEXT_COMPRESSION_NONE;
|
text[1].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
text[1].key = "Software";
|
text[1].key = "Software";
|
||||||
|
@ -16250,7 +16258,7 @@ void setpolymost2dview(void)
|
||||||
void hash_init(hashtable_t *t)
|
void hash_init(hashtable_t *t)
|
||||||
{
|
{
|
||||||
hash_free(t);
|
hash_free(t);
|
||||||
t->items=Bcalloc(1, t->size * sizeof(hashitem_t));
|
t->items=(hashitem_t **)Bcalloc(1, t->size * sizeof(hashitem_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void hash_free(hashtable_t *t)
|
void hash_free(hashtable_t *t)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -294,7 +294,7 @@ bwglSetPixelFormatProcPtr bwglSetPixelFormat;
|
||||||
bwglSwapIntervalEXTProcPtr bwglSwapIntervalEXT;
|
bwglSwapIntervalEXTProcPtr bwglSwapIntervalEXT;
|
||||||
bwglCreateContextAttribsARBProcPtr bwglCreateContextAttribsARB;
|
bwglCreateContextAttribsARBProcPtr bwglCreateContextAttribsARB;
|
||||||
|
|
||||||
static HANDLE hGLDLL, hGLUDLL;
|
static HMODULE hGLDLL, hGLUDLL;
|
||||||
#else
|
#else
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ static const int32_t pow2long[32] =
|
||||||
0x00010000,0x00020000,0x00040000,0x00080000,
|
0x00010000,0x00020000,0x00040000,0x00080000,
|
||||||
0x00100000,0x00200000,0x00400000,0x00800000,
|
0x00100000,0x00200000,0x00400000,0x00800000,
|
||||||
0x01000000,0x02000000,0x04000000,0x08000000,
|
0x01000000,0x02000000,0x04000000,0x08000000,
|
||||||
0x10000000,0x20000000,0x40000000,0x80000000,
|
0x10000000,0x20000000,0x40000000,(int32_t)0x80000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
//Hack for peekbits,getbits,suckbits (to prevent lots of duplicate code)
|
//Hack for peekbits,getbits,suckbits (to prevent lots of duplicate code)
|
||||||
|
|
|
@ -369,7 +369,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *
|
||||||
ma.fpssc = fpssc;
|
ma.fpssc = fpssc;
|
||||||
ma.flags = flags;
|
ma.flags = flags;
|
||||||
|
|
||||||
map = Bmalloc(sizeof(mdanim_t));
|
map = (mdanim_t *)Bmalloc(sizeof(mdanim_t));
|
||||||
if (!map) return(-4);
|
if (!map) return(-4);
|
||||||
Bmemcpy(map, &ma, sizeof(ma));
|
Bmemcpy(map, &ma, sizeof(ma));
|
||||||
|
|
||||||
|
@ -721,7 +721,7 @@ static int32_t mdloadskin_cached(int32_t fil, const texcacheheader *head, int32_
|
||||||
if (!picc) goto failure; else midbuf = picc;
|
if (!picc) goto failure; else midbuf = picc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dedxtfilter(fil, &pict, pic, midbuf, packbuf, (head->flags&4)==4)) goto failure;
|
if (dedxtfilter(fil, &pict, (char *)pic, (char *)midbuf, (char *)packbuf, (head->flags&4)==4)) goto failure;
|
||||||
|
|
||||||
bglCompressedTexImage2DARB(GL_TEXTURE_2D,level,pict.format,pict.xdim,pict.ydim,pict.border,
|
bglCompressedTexImage2DARB(GL_TEXTURE_2D,level,pict.format,pict.xdim,pict.ydim,pict.border,
|
||||||
pict.size,pic);
|
pict.size,pic);
|
||||||
|
@ -1156,7 +1156,7 @@ static void mdloadvbos(md3model_t *m)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
||||||
m->vbos = Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
m->vbos = (GLuint *)Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
||||||
bglGenBuffersARB(m->head.numsurfs, m->vbos);
|
bglGenBuffersARB(m->head.numsurfs, m->vbos);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -1412,9 +1412,9 @@ static md2model_t *md2load(int32_t fil, const char *filnam)
|
||||||
m3->skinmap = sk;
|
m3->skinmap = sk;
|
||||||
}
|
}
|
||||||
|
|
||||||
m3->indexes = Bmalloc(sizeof(uint16_t) * s->numtris);
|
m3->indexes = (uint16_t *)Bmalloc(sizeof(uint16_t) * s->numtris);
|
||||||
m3->vindexes = Bmalloc(sizeof(uint16_t) * s->numtris * 3);
|
m3->vindexes = (uint16_t *)Bmalloc(sizeof(uint16_t) * s->numtris * 3);
|
||||||
m3->maxdepths = Bmalloc(sizeof(float) * s->numtris);
|
m3->maxdepths = (float *)Bmalloc(sizeof(float) * s->numtris);
|
||||||
|
|
||||||
if (!m3->indexes || !m3->vindexes || !m3->maxdepths)
|
if (!m3->indexes || !m3->vindexes || !m3->maxdepths)
|
||||||
QuitOnFatalError("OUT OF MEMORY in md2load!");
|
QuitOnFatalError("OUT OF MEMORY in md2load!");
|
||||||
|
@ -1634,9 +1634,9 @@ static md3model_t *md3load(int32_t fil)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m->indexes = Bmalloc(sizeof(uint16_t) * maxtrispersurf);
|
m->indexes = (uint16_t *)Bmalloc(sizeof(uint16_t) * maxtrispersurf);
|
||||||
m->vindexes = Bmalloc(sizeof(uint16_t) * maxtrispersurf * 3);
|
m->vindexes = (uint16_t *)Bmalloc(sizeof(uint16_t) * maxtrispersurf * 3);
|
||||||
m->maxdepths = Bmalloc(sizeof(float) * maxtrispersurf);
|
m->maxdepths = (float *)Bmalloc(sizeof(float) * maxtrispersurf);
|
||||||
|
|
||||||
if (!m->indexes || !m->vindexes || !m->maxdepths)
|
if (!m->indexes || !m->vindexes || !m->maxdepths)
|
||||||
QuitOnFatalError("OUT OF MEMORY in md3load!");
|
QuitOnFatalError("OUT OF MEMORY in md3load!");
|
||||||
|
@ -1852,9 +1852,9 @@ int md3postload_polymer(md3model_t *m)
|
||||||
initprintf("size %d (%d fr, %d v): md %s surf %d/%d\n", i, m->head.numframes, s->numverts,
|
initprintf("size %d (%d fr, %d v): md %s surf %d/%d\n", i, m->head.numframes, s->numverts,
|
||||||
m->head.nam, surfi, m->head.numsurfs);
|
m->head.nam, surfi, m->head.numsurfs);
|
||||||
#endif
|
#endif
|
||||||
s->geometry = Bcalloc(m->head.numframes * s->numverts * sizeof(float), 15);
|
s->geometry = (float *)Bcalloc(m->head.numframes * s->numverts * sizeof(float), 15);
|
||||||
|
|
||||||
numtris = Bcalloc(s->numverts, sizeof(int));
|
numtris = (int *)Bcalloc(s->numverts, sizeof(int));
|
||||||
|
|
||||||
if (!s->geometry || !numtris)
|
if (!s->geometry || !numtris)
|
||||||
QuitOnFatalError("OUT OF MEMORY in md3postload_polymer!");
|
QuitOnFatalError("OUT OF MEMORY in md3postload_polymer!");
|
||||||
|
@ -3468,8 +3468,8 @@ int32_t mddraw(const spritetype *tspr)
|
||||||
|
|
||||||
if (r_vbos && (r_vbocount > allocvbos))
|
if (r_vbos && (r_vbocount > allocvbos))
|
||||||
{
|
{
|
||||||
indexvbos = Brealloc(indexvbos, sizeof(GLuint) * r_vbocount);
|
indexvbos = (GLuint *)Brealloc(indexvbos, sizeof(GLuint) * r_vbocount);
|
||||||
vertvbos = Brealloc(vertvbos, sizeof(GLuint) * r_vbocount);
|
vertvbos = (GLuint *)Brealloc(vertvbos, sizeof(GLuint) * r_vbocount);
|
||||||
|
|
||||||
bglGenBuffersARB(r_vbocount - allocvbos, &(indexvbos[allocvbos]));
|
bglGenBuffersARB(r_vbocount - allocvbos, &(indexvbos[allocvbos]));
|
||||||
bglGenBuffersARB(r_vbocount - allocvbos, &(vertvbos[allocvbos]));
|
bglGenBuffersARB(r_vbocount - allocvbos, &(vertvbos[allocvbos]));
|
||||||
|
|
|
@ -782,9 +782,7 @@ void polymer_uninit(void)
|
||||||
void polymer_setaspect(int32_t ang)
|
void polymer_setaspect(int32_t ang)
|
||||||
{
|
{
|
||||||
float aspect;
|
float aspect;
|
||||||
float fang = ang;
|
float fang = (float)ang * atanf((float)viewingrange/65536.0f)/(PI/4);
|
||||||
|
|
||||||
fang *= atanf((float)viewingrange/65536.0f)/(PI/4);
|
|
||||||
|
|
||||||
if (pr_customaspect != 0.0f)
|
if (pr_customaspect != 0.0f)
|
||||||
aspect = pr_customaspect;
|
aspect = pr_customaspect;
|
||||||
|
@ -1171,7 +1169,7 @@ void polymer_editorpick(void)
|
||||||
GLfloat dadepth;
|
GLfloat dadepth;
|
||||||
|
|
||||||
int16_t k, bestk=0;
|
int16_t k, bestk=0;
|
||||||
GLfloat bestwdistsq = 3.4e38, wdistsq;
|
GLfloat bestwdistsq = (GLfloat)3.4e38, wdistsq;
|
||||||
GLfloat w1[2], w2[2], w21[2], pw1[2], pw2[2];
|
GLfloat w1[2], w2[2], w21[2], pw1[2], pw2[2];
|
||||||
GLfloat ptonline[2];
|
GLfloat ptonline[2];
|
||||||
GLfloat scrvxz[2];
|
GLfloat scrvxz[2];
|
||||||
|
@ -1574,7 +1572,7 @@ void polymer_texinvalidate(void)
|
||||||
|
|
||||||
void polymer_definehighpalookup(char basepalnum, char palnum, char *data)
|
void polymer_definehighpalookup(char basepalnum, char palnum, char *data)
|
||||||
{
|
{
|
||||||
prhighpalookups[basepalnum][palnum].data = Bmalloc(PR_HIGHPALOOKUP_DATA_SIZE);
|
prhighpalookups[basepalnum][palnum].data = (char *)Bmalloc(PR_HIGHPALOOKUP_DATA_SIZE);
|
||||||
|
|
||||||
Bmemcpy(prhighpalookups[basepalnum][palnum].data, data, PR_HIGHPALOOKUP_DATA_SIZE);
|
Bmemcpy(prhighpalookups[basepalnum][palnum].data, data, PR_HIGHPALOOKUP_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -1634,8 +1632,8 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
|
|
||||||
mirrorcount = 0;
|
mirrorcount = 0;
|
||||||
|
|
||||||
localsectormasks = Bmalloc(sizeof(int16_t) * numsectors);
|
localsectormasks = (int16_t *)Bmalloc(sizeof(int16_t) * numsectors);
|
||||||
localsectormaskcount = Bcalloc(sizeof(int16_t), 1);
|
localsectormaskcount = (int16_t *)Bcalloc(sizeof(int16_t), 1);
|
||||||
cursectormasks = localsectormasks;
|
cursectormasks = localsectormasks;
|
||||||
cursectormaskcount = localsectormaskcount;
|
cursectormaskcount = localsectormaskcount;
|
||||||
|
|
||||||
|
@ -2176,17 +2174,17 @@ static int32_t polymer_initsector(int16_t sectnum)
|
||||||
if (pr_verbosity >= 2) OSD_Printf("PR : Initializing sector %i...\n", sectnum);
|
if (pr_verbosity >= 2) OSD_Printf("PR : Initializing sector %i...\n", sectnum);
|
||||||
|
|
||||||
sec = §or[sectnum];
|
sec = §or[sectnum];
|
||||||
s = Bcalloc(1, sizeof(_prsector));
|
s = (_prsector *)Bcalloc(1, sizeof(_prsector));
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
{
|
{
|
||||||
if (pr_verbosity >= 1) OSD_Printf("PR : Cannot initialize sector %i : Bmalloc failed.\n", sectnum);
|
if (pr_verbosity >= 1) OSD_Printf("PR : Cannot initialize sector %i : Bmalloc failed.\n", sectnum);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
s->verts = Bcalloc(sec->wallnum, sizeof(GLdouble) * 3);
|
s->verts = (GLdouble *)Bcalloc(sec->wallnum, sizeof(GLdouble) * 3);
|
||||||
s->floor.buffer = Bcalloc(sec->wallnum, sizeof(GLfloat) * 5);
|
s->floor.buffer = (GLfloat *)Bcalloc(sec->wallnum, sizeof(GLfloat) * 5);
|
||||||
s->floor.vertcount = sec->wallnum;
|
s->floor.vertcount = sec->wallnum;
|
||||||
s->ceil.buffer = Bcalloc(sec->wallnum, sizeof(GLfloat) * 5);
|
s->ceil.buffer = (GLfloat *)Bcalloc(sec->wallnum, sizeof(GLfloat) * 5);
|
||||||
s->ceil.vertcount = sec->wallnum;
|
s->ceil.vertcount = sec->wallnum;
|
||||||
if ((s->verts == NULL) || (s->floor.buffer == NULL) || (s->ceil.buffer == NULL))
|
if ((s->verts == NULL) || (s->floor.buffer == NULL) || (s->ceil.buffer == NULL))
|
||||||
{
|
{
|
||||||
|
@ -2356,9 +2354,9 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
heidiff = (int32_t)(curbuffer[(i*5)+1] - curbuffer[1]);
|
heidiff = (int32_t)(curbuffer[(i*5)+1] - curbuffer[1]);
|
||||||
// don't forget the sign, tey could be negative with concave sectors
|
// don't forget the sign, tey could be negative with concave sectors
|
||||||
if (tey >= 0)
|
if (tey >= 0)
|
||||||
tey = (int32_t)sqrt((tey * tey) + (heidiff * heidiff));
|
tey = (int32_t)sqrt((double)((tey * tey) + (heidiff * heidiff)));
|
||||||
else
|
else
|
||||||
tey = -(int32_t)sqrt((tey * tey) + (heidiff * heidiff));
|
tey = -(int32_t)sqrt((double)((tey * tey) + (heidiff * heidiff)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curstat & 4)
|
if (curstat & 4)
|
||||||
|
@ -2516,8 +2514,8 @@ void PR_CALLBACK polymer_tessvertex(void* vertex, void* sector)
|
||||||
{
|
{
|
||||||
if (pr_verbosity >= 2) OSD_Printf("PR : Indice overflow, extending the indices list... !\n");
|
if (pr_verbosity >= 2) OSD_Printf("PR : Indice overflow, extending the indices list... !\n");
|
||||||
s->indicescount++;
|
s->indicescount++;
|
||||||
s->floor.indices = Brealloc(s->floor.indices, s->indicescount * sizeof(GLushort));
|
s->floor.indices = (GLushort *)Brealloc(s->floor.indices, s->indicescount * sizeof(GLushort));
|
||||||
s->ceil.indices = Brealloc(s->ceil.indices, s->indicescount * sizeof(GLushort));
|
s->ceil.indices = (GLushort *)Brealloc(s->ceil.indices, s->indicescount * sizeof(GLushort));
|
||||||
}
|
}
|
||||||
s->ceil.indices[s->curindice] = (intptr_t)vertex;
|
s->ceil.indices[s->curindice] = (intptr_t)vertex;
|
||||||
s->curindice++;
|
s->curindice++;
|
||||||
|
@ -2541,15 +2539,15 @@ static int32_t polymer_buildfloor(int16_t sectnum)
|
||||||
if (s->floor.indices == NULL)
|
if (s->floor.indices == NULL)
|
||||||
{
|
{
|
||||||
s->indicescount = (max(3, sec->wallnum) - 2) * 3;
|
s->indicescount = (max(3, sec->wallnum) - 2) * 3;
|
||||||
s->floor.indices = Bcalloc(s->indicescount, sizeof(GLushort));
|
s->floor.indices = (GLushort *)Bcalloc(s->indicescount, sizeof(GLushort));
|
||||||
s->ceil.indices = Bcalloc(s->indicescount, sizeof(GLushort));
|
s->ceil.indices = (GLushort *)Bcalloc(s->indicescount, sizeof(GLushort));
|
||||||
}
|
}
|
||||||
|
|
||||||
s->curindice = 0;
|
s->curindice = 0;
|
||||||
|
|
||||||
bgluTessCallback(prtess, GLU_TESS_VERTEX_DATA, polymer_tessvertex);
|
bgluTessCallback(prtess, GLU_TESS_VERTEX_DATA, (void (PR_CALLBACK *)(void))polymer_tessvertex);
|
||||||
bgluTessCallback(prtess, GLU_TESS_EDGE_FLAG, polymer_tessedgeflag);
|
bgluTessCallback(prtess, GLU_TESS_EDGE_FLAG, (void (PR_CALLBACK *)(void))polymer_tessedgeflag);
|
||||||
bgluTessCallback(prtess, GLU_TESS_ERROR, polymer_tesserror);
|
bgluTessCallback(prtess, GLU_TESS_ERROR, (void (PR_CALLBACK *)(void))polymer_tesserror);
|
||||||
|
|
||||||
bgluTessProperty(prtess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE);
|
bgluTessProperty(prtess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE);
|
||||||
|
|
||||||
|
@ -2686,7 +2684,7 @@ static int32_t polymer_initwall(int16_t wallnum)
|
||||||
|
|
||||||
if (pr_verbosity >= 2) OSD_Printf("PR : Initializing wall %i...\n", wallnum);
|
if (pr_verbosity >= 2) OSD_Printf("PR : Initializing wall %i...\n", wallnum);
|
||||||
|
|
||||||
w = Bcalloc(1, sizeof(_prwall));
|
w = (_prwall *)Bcalloc(1, sizeof(_prwall));
|
||||||
if (w == NULL)
|
if (w == NULL)
|
||||||
{
|
{
|
||||||
if (pr_verbosity >= 1) OSD_Printf("PR : Cannot initialize wall %i : Bmalloc failed.\n", wallnum);
|
if (pr_verbosity >= 1) OSD_Printf("PR : Cannot initialize wall %i : Bmalloc failed.\n", wallnum);
|
||||||
|
@ -2694,13 +2692,13 @@ static int32_t polymer_initwall(int16_t wallnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->mask.buffer == NULL) {
|
if (w->mask.buffer == NULL) {
|
||||||
w->mask.buffer = Bmalloc(4 * sizeof(GLfloat) * 5);
|
w->mask.buffer = (GLfloat *)Bmalloc(4 * sizeof(GLfloat) * 5);
|
||||||
w->mask.vertcount = 4;
|
w->mask.vertcount = 4;
|
||||||
}
|
}
|
||||||
if (w->bigportal == NULL)
|
if (w->bigportal == NULL)
|
||||||
w->bigportal = Bmalloc(4 * sizeof(GLfloat) * 5);
|
w->bigportal = (GLfloat *)Bmalloc(4 * sizeof(GLfloat) * 5);
|
||||||
if (w->cap == NULL)
|
if (w->cap == NULL)
|
||||||
w->cap = Bmalloc(4 * sizeof(GLfloat) * 3);
|
w->cap = (GLfloat *)Bmalloc(4 * sizeof(GLfloat) * 3);
|
||||||
|
|
||||||
bglGenBuffersARB(1, &w->wall.vbo);
|
bglGenBuffersARB(1, &w->wall.vbo);
|
||||||
bglGenBuffersARB(1, &w->over.vbo);
|
bglGenBuffersARB(1, &w->over.vbo);
|
||||||
|
@ -2794,7 +2792,7 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->wall.buffer == NULL) {
|
if (w->wall.buffer == NULL) {
|
||||||
w->wall.buffer = Bcalloc(4, sizeof(GLfloat) * 5); // XXX
|
w->wall.buffer = (GLfloat *)Bcalloc(4, sizeof(GLfloat) * 5); // XXX
|
||||||
w->wall.vertcount = 4;
|
w->wall.vertcount = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2995,7 +2993,7 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
if ((overwall) || (wal->cstat & 16) || (wal->cstat & 32))
|
if ((overwall) || (wal->cstat & 16) || (wal->cstat & 32))
|
||||||
{
|
{
|
||||||
if (w->over.buffer == NULL) {
|
if (w->over.buffer == NULL) {
|
||||||
w->over.buffer = Bmalloc(4 * sizeof(GLfloat) * 5);
|
w->over.buffer = (GLfloat *)Bmalloc(4 * sizeof(GLfloat) * 5);
|
||||||
w->over.vertcount = 4;
|
w->over.vertcount = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3467,7 +3465,7 @@ void polymer_updatesprite(int32_t snum)
|
||||||
{
|
{
|
||||||
int32_t curpicnum, xsize, ysize, tilexoff, tileyoff, xoff, yoff, i, j, cs;
|
int32_t curpicnum, xsize, ysize, tilexoff, tileyoff, xoff, yoff, i, j, cs;
|
||||||
spritetype *tspr = tspriteptr[snum];
|
spritetype *tspr = tspriteptr[snum];
|
||||||
float xratio, yratio, ang;
|
float xratio, yratio, ang, f;
|
||||||
float spos[3];
|
float spos[3];
|
||||||
const GLfloat *inbuffer;
|
const GLfloat *inbuffer;
|
||||||
uint8_t flipu, flipv;
|
uint8_t flipu, flipv;
|
||||||
|
@ -3485,7 +3483,7 @@ void polymer_updatesprite(int32_t snum)
|
||||||
|
|
||||||
if (prsprites[tspr->owner] == NULL)
|
if (prsprites[tspr->owner] == NULL)
|
||||||
{
|
{
|
||||||
if (pr_verbosity >= 1) OSD_Printf("PR : Cannot initialize sprite %i : Bmalloc failed.\n", tspr->owner);
|
if (pr_verbosity >= 1) OSD_Printf_nowarn("PR : Cannot initialize sprite %i : Bmalloc failed.\n", tspr->owner);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3523,7 +3521,8 @@ void polymer_updatesprite(int32_t snum)
|
||||||
s->plane.material.diffusemodulation[3] = 0xAA;
|
s->plane.material.diffusemodulation[3] = 0xAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->plane.material.diffusemodulation[3] *= (1.0f - spriteext[tspr->owner].alpha);
|
f = s->plane.material.diffusemodulation[3] * (1.0f - spriteext[tspr->owner].alpha);
|
||||||
|
s->plane.material.diffusemodulation[3] = (GLubyte)f;
|
||||||
|
|
||||||
if (searchit == 2)
|
if (searchit == 2)
|
||||||
{
|
{
|
||||||
|
@ -4098,7 +4097,7 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
color = mdspritematerial.diffusemodulation;
|
color = mdspritematerial.diffusemodulation;
|
||||||
|
|
||||||
color[0] = color[1] = color[2] =
|
color[0] = color[1] = color[2] =
|
||||||
((float)(numshades-min(max((tspr->shade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades) * 0xFF;
|
(GLubyte)(((float)(numshades-min(max((tspr->shade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades) * 0xFF);
|
||||||
|
|
||||||
usinghighpal = (pr_highpalookups &&
|
usinghighpal = (pr_highpalookups &&
|
||||||
prhighpalookups[curbasepal][tspr->pal].map);
|
prhighpalookups[curbasepal][tspr->pal].map);
|
||||||
|
@ -4109,9 +4108,14 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
{
|
{
|
||||||
if (!(m->flags&1) || (!(tspr->owner >= MAXSPRITES) && sector[sprite[tspr->owner].sectnum].floorpal!=0))
|
if (!(m->flags&1) || (!(tspr->owner >= MAXSPRITES) && sector[sprite[tspr->owner].sectnum].floorpal!=0))
|
||||||
{
|
{
|
||||||
color[0] *= (float)hictinting[tspr->pal].r / 255.0;
|
double f;
|
||||||
color[1] *= (float)hictinting[tspr->pal].g / 255.0;
|
|
||||||
color[2] *= (float)hictinting[tspr->pal].b / 255.0;
|
f = color[0] * (float)hictinting[tspr->pal].r / 255.0;
|
||||||
|
color[0] = (GLubyte)f;
|
||||||
|
f = color[1] * (float)hictinting[tspr->pal].g / 255.0;
|
||||||
|
color[1] = (GLubyte)f;
|
||||||
|
f = color[2] * (float)hictinting[tspr->pal].b / 255.0;
|
||||||
|
color[2] = (GLubyte)f;
|
||||||
}
|
}
|
||||||
else globalnoeffect=1; //mdloadskin reads this
|
else globalnoeffect=1; //mdloadskin reads this
|
||||||
}
|
}
|
||||||
|
@ -4122,9 +4126,14 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
hictinting[MAXPALOOKUPS-1].g != 255 ||
|
hictinting[MAXPALOOKUPS-1].g != 255 ||
|
||||||
hictinting[MAXPALOOKUPS-1].b != 255))
|
hictinting[MAXPALOOKUPS-1].b != 255))
|
||||||
{
|
{
|
||||||
color[0] *= hictinting[MAXPALOOKUPS-1].r / 255.0;
|
double f;
|
||||||
color[1] *= hictinting[MAXPALOOKUPS-1].g / 255.0;
|
|
||||||
color[2] *= hictinting[MAXPALOOKUPS-1].b / 255.0;
|
f = color[0] * hictinting[MAXPALOOKUPS-1].r / 255.0;
|
||||||
|
color[0] = (GLubyte)f;
|
||||||
|
f = color[1] * hictinting[MAXPALOOKUPS-1].g / 255.0;
|
||||||
|
color[1] = (GLubyte)f;
|
||||||
|
f = color[2] * hictinting[MAXPALOOKUPS-1].b / 255.0;
|
||||||
|
color[2] = (GLubyte)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tspr->cstat & 2)
|
if (tspr->cstat & 2)
|
||||||
|
@ -4136,7 +4145,10 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
} else
|
} else
|
||||||
color[3] = 0xFF;
|
color[3] = 0xFF;
|
||||||
|
|
||||||
color[3] *= (1.0f - spriteext[tspr->owner].alpha);
|
{
|
||||||
|
double f = color[3] * (1.0f - spriteext[tspr->owner].alpha);
|
||||||
|
color[3] = (GLubyte)f;
|
||||||
|
}
|
||||||
|
|
||||||
if (searchit == 2)
|
if (searchit == 2)
|
||||||
{
|
{
|
||||||
|
@ -4373,9 +4385,9 @@ static void polymer_loadmodelvbos(md3model_t* m)
|
||||||
int32_t i;
|
int32_t i;
|
||||||
md3surf_t *s;
|
md3surf_t *s;
|
||||||
|
|
||||||
m->indices = Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
m->indices = (GLuint *)Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
||||||
m->texcoords = Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
m->texcoords = (GLuint *)Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
||||||
m->geometry = Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
m->geometry = (GLuint *)Bmalloc(m->head.numsurfs * sizeof(GLuint));
|
||||||
|
|
||||||
bglGenBuffersARB(m->head.numsurfs, m->indices);
|
bglGenBuffersARB(m->head.numsurfs, m->indices);
|
||||||
bglGenBuffersARB(m->head.numsurfs, m->texcoords);
|
bglGenBuffersARB(m->head.numsurfs, m->texcoords);
|
||||||
|
@ -4481,24 +4493,34 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
|
||||||
material->diffusemodulation[0] =
|
material->diffusemodulation[0] =
|
||||||
material->diffusemodulation[1] =
|
material->diffusemodulation[1] =
|
||||||
material->diffusemodulation[2] =
|
material->diffusemodulation[2] =
|
||||||
((float)(numshades-min(max((shade * shadescale),0),numshades)))/((float)numshades) * 0xFF;
|
(GLubyte)(((float)(numshades-min(max((shade * shadescale),0),numshades)))/((float)numshades) * 0xFF);
|
||||||
|
|
||||||
if (pth->flags & 2)
|
if (pth->flags & 2)
|
||||||
{
|
{
|
||||||
if (pth->palnum != pal)
|
if (pth->palnum != pal)
|
||||||
{
|
{
|
||||||
material->diffusemodulation[0] *= (float)hictinting[pal].r / 255.0;
|
double f;
|
||||||
material->diffusemodulation[1] *= (float)hictinting[pal].g / 255.0;
|
|
||||||
material->diffusemodulation[2] *= (float)hictinting[pal].b / 255.0;
|
f = material->diffusemodulation[0] * (float)hictinting[pal].r / 255.0;
|
||||||
|
material->diffusemodulation[0] = (GLubyte)f;
|
||||||
|
f = material->diffusemodulation[1] * (float)hictinting[pal].g / 255.0;
|
||||||
|
material->diffusemodulation[1] = (GLubyte)f;
|
||||||
|
f = material->diffusemodulation[2] * (float)hictinting[pal].b / 255.0;
|
||||||
|
material->diffusemodulation[2] = (GLubyte)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fullscreen tint on global palette change... this is used for nightvision and underwater tinting
|
// fullscreen tint on global palette change... this is used for nightvision and underwater tinting
|
||||||
// if ((hictinting[MAXPALOOKUPS-1].r + hictinting[MAXPALOOKUPS-1].g + hictinting[MAXPALOOKUPS-1].b) != 0x2FD)
|
// if ((hictinting[MAXPALOOKUPS-1].r + hictinting[MAXPALOOKUPS-1].g + hictinting[MAXPALOOKUPS-1].b) != 0x2FD)
|
||||||
if (!usinghighpal && ((uint32_t)hictinting[MAXPALOOKUPS-1].r & 0xFFFFFF00) != 0xFFFFFF00)
|
if (!usinghighpal && ((uint32_t)hictinting[MAXPALOOKUPS-1].r & 0xFFFFFF00) != 0xFFFFFF00)
|
||||||
{
|
{
|
||||||
material->diffusemodulation[0] *= hictinting[MAXPALOOKUPS-1].r / 255.0;
|
double f;
|
||||||
material->diffusemodulation[1] *= hictinting[MAXPALOOKUPS-1].g / 255.0;
|
|
||||||
material->diffusemodulation[2] *= hictinting[MAXPALOOKUPS-1].b / 255.0;
|
f = material->diffusemodulation[0] * hictinting[MAXPALOOKUPS-1].r / 255.0;
|
||||||
|
material->diffusemodulation[0] = (GLubyte)f;
|
||||||
|
f = material->diffusemodulation[1] * hictinting[MAXPALOOKUPS-1].g / 255.0;
|
||||||
|
material->diffusemodulation[1] = (GLubyte)f;
|
||||||
|
f = material->diffusemodulation[2] * hictinting[MAXPALOOKUPS-1].b / 255.0;
|
||||||
|
material->diffusemodulation[2] = (GLubyte)f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5227,7 +5249,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
oldhead = prlights[lighti].planelist;
|
oldhead = prlights[lighti].planelist;
|
||||||
prlights[lighti].planelist = Bmalloc(sizeof(_prplanelist));
|
prlights[lighti].planelist = (_prplanelist *)Bmalloc(sizeof(_prplanelist));
|
||||||
prlights[lighti].planelist->n = oldhead;
|
prlights[lighti].planelist->n = oldhead;
|
||||||
|
|
||||||
prlights[lighti].planelist->plane = plane;
|
prlights[lighti].planelist->plane = plane;
|
||||||
|
@ -5653,7 +5675,7 @@ static void polymer_initrendertargets(int32_t count)
|
||||||
ocount = count;
|
ocount = count;
|
||||||
//////////
|
//////////
|
||||||
|
|
||||||
prrts = Bcalloc(count, sizeof(_prrt));
|
prrts = (_prrt *)Bcalloc(count, sizeof(_prrt));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < count)
|
while (i < count)
|
||||||
|
|
|
@ -1544,14 +1544,14 @@ void writexcache(const char *fn, int32_t len, int32_t dameth, char effect, texca
|
||||||
|
|
||||||
if (alloclen < miplen)
|
if (alloclen < miplen)
|
||||||
{
|
{
|
||||||
void *picc = Brealloc(pic, miplen);
|
char *picc = (char *)Brealloc(pic, miplen);
|
||||||
if (!picc) goto failure; else pic = picc;
|
if (!picc) goto failure; else pic = picc;
|
||||||
alloclen = miplen;
|
alloclen = miplen;
|
||||||
|
|
||||||
picc = Brealloc(packbuf, alloclen+400);
|
picc = (char *)Brealloc(packbuf, alloclen+400);
|
||||||
if (!picc) goto failure; else packbuf = picc;
|
if (!picc) goto failure; else packbuf = picc;
|
||||||
|
|
||||||
picc = Brealloc(midbuf, miplen);
|
picc = (char *)Brealloc(midbuf, miplen);
|
||||||
if (!picc) goto failure; else midbuf = picc;
|
if (!picc) goto failure; else midbuf = picc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1666,14 +1666,14 @@ static int32_t gloadtile_cached(int32_t fil, const texcacheheader *head, int32_t
|
||||||
|
|
||||||
if (alloclen < pict.size)
|
if (alloclen < pict.size)
|
||||||
{
|
{
|
||||||
void *picc = Brealloc(pic, pict.size);
|
char *picc = (char *)Brealloc(pic, pict.size);
|
||||||
if (!picc) goto failure; else pic = picc;
|
if (!picc) goto failure; else pic = picc;
|
||||||
alloclen = pict.size;
|
alloclen = pict.size;
|
||||||
|
|
||||||
picc = Brealloc(packbuf, alloclen+16);
|
picc = (char *)Brealloc(packbuf, alloclen+16);
|
||||||
if (!picc) goto failure; else packbuf = picc;
|
if (!picc) goto failure; else packbuf = picc;
|
||||||
|
|
||||||
picc = Brealloc(midbuf, pict.size);
|
picc = (char *)Brealloc(midbuf, pict.size);
|
||||||
if (!picc) goto failure; else midbuf = picc;
|
if (!picc) goto failure; else midbuf = picc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1831,13 +1831,13 @@ static int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicre
|
||||||
lastfn = fn; // careful...
|
lastfn = fn; // careful...
|
||||||
if (!lastpic)
|
if (!lastpic)
|
||||||
{
|
{
|
||||||
lastpic = Bmalloc(xsiz*ysiz*sizeof(coltype));
|
lastpic = (coltype *)Bmalloc(xsiz*ysiz*sizeof(coltype));
|
||||||
lastsize = xsiz*ysiz;
|
lastsize = xsiz*ysiz;
|
||||||
}
|
}
|
||||||
else if (lastsize < xsiz*ysiz)
|
else if (lastsize < xsiz*ysiz)
|
||||||
{
|
{
|
||||||
Bfree(lastpic);
|
Bfree(lastpic);
|
||||||
lastpic = Bmalloc(xsiz*ysiz*sizeof(coltype));
|
lastpic = (coltype *)Bmalloc(xsiz*ysiz*sizeof(coltype));
|
||||||
}
|
}
|
||||||
if (lastpic)
|
if (lastpic)
|
||||||
Bmemcpy(lastpic, pic, xsiz*ysiz*sizeof(coltype));
|
Bmemcpy(lastpic, pic, xsiz*ysiz*sizeof(coltype));
|
||||||
|
@ -3372,7 +3372,7 @@ static void polymost_drawalls(int32_t bunch)
|
||||||
int32_t i, x, y, z, cz, fz, wallnum, sectnum, nextsectnum;
|
int32_t i, x, y, z, cz, fz, wallnum, sectnum, nextsectnum;
|
||||||
|
|
||||||
int16_t dapskybits;
|
int16_t dapskybits;
|
||||||
static const int16_t zeropskyoff[MAXPSKYTILES];
|
static const int16_t zeropskyoff[MAXPSKYTILES] = { 0 };
|
||||||
const int16_t *dapskyoff;
|
const int16_t *dapskyoff;
|
||||||
|
|
||||||
sectnum = thesector[bunchfirst[bunch]]; sec = §or[sectnum];
|
sectnum = thesector[bunchfirst[bunch]]; sec = §or[sectnum];
|
||||||
|
@ -6547,7 +6547,7 @@ int32_t dxtfilter(int32_t fil, const texcachepicture *pict, const char *pic, voi
|
||||||
if (stride == 16) //If DXT3...
|
if (stride == 16) //If DXT3...
|
||||||
{
|
{
|
||||||
//alpha_4x4
|
//alpha_4x4
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (k=0; k<8; k++) *cptr++ = pic[k];
|
for (k=0; k<8; k++) *cptr++ = pic[k];
|
||||||
for (j=stride; (unsigned)j<miplen; j+=stride)
|
for (j=stride; (unsigned)j<miplen; j+=stride)
|
||||||
for (k=0; k<8; k++) *cptr++ = pic[j+k];
|
for (k=0; k<8; k++) *cptr++ = pic[j+k];
|
||||||
|
@ -6573,7 +6573,7 @@ int32_t dxtfilter(int32_t fil, const texcachepicture *pict, const char *pic, voi
|
||||||
}
|
}
|
||||||
|
|
||||||
//rgb0,rgb1
|
//rgb0,rgb1
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (k=0; k<=2; k+=2)
|
for (k=0; k<=2; k+=2)
|
||||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||||
{ *(int16_t *)cptr = hicosub(*(int16_t *)(&pic[offs+j+k])); cptr += 2; }
|
{ *(int16_t *)cptr = hicosub(*(int16_t *)(&pic[offs+j+k])); cptr += 2; }
|
||||||
|
@ -6598,7 +6598,7 @@ int32_t dxtfilter(int32_t fil, const texcachepicture *pict, const char *pic, voi
|
||||||
Bwrite(fil,writebuf,cleng);
|
Bwrite(fil,writebuf,cleng);
|
||||||
|
|
||||||
//index_4x4
|
//index_4x4
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||||
{
|
{
|
||||||
const char *c2 = &pic[j+offs+4];
|
const char *c2 = &pic[j+offs+4];
|
||||||
|
@ -6689,7 +6689,7 @@ int32_t dedxtfilter(int32_t fil, const texcachepicture *pict, char *pic, void *m
|
||||||
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (k=0; k<8; k++) pic[k] = *cptr++;
|
for (k=0; k<8; k++) pic[k] = *cptr++;
|
||||||
for (j=stride; j<pict->size; j+=stride)
|
for (j=stride; j<pict->size; j+=stride)
|
||||||
for (k=0; k<8; k++) pic[j+k] = (*cptr++);
|
for (k=0; k<8; k++) pic[j+k] = (*cptr++);
|
||||||
|
@ -6736,7 +6736,7 @@ int32_t dedxtfilter(int32_t fil, const texcachepicture *pict, char *pic, void *m
|
||||||
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (k=0; k<=2; k+=2)
|
for (k=0; k<=2; k+=2)
|
||||||
{
|
{
|
||||||
for (j=0; j<pict->size; j+=stride)
|
for (j=0; j<pict->size; j+=stride)
|
||||||
|
@ -6787,7 +6787,7 @@ int32_t dedxtfilter(int32_t fil, const texcachepicture *pict, char *pic, void *m
|
||||||
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
if (qlz_decompress(packbuf,midbuf,state_decompress) == 0) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cptr = midbuf;
|
cptr = (char *)midbuf;
|
||||||
for (j=0; j<pict->size; j+=stride)
|
for (j=0; j<pict->size; j+=stride)
|
||||||
{
|
{
|
||||||
pic[j+offs+4] = ((cptr[0]>>0)&3) + (((cptr[1]>>0)&3)<<2) + (((cptr[2]>>0)&3)<<4) + (((cptr[3]>>0)&3)<<6);
|
pic[j+offs+4] = ((cptr[0]>>0)&3) + (((cptr[1]>>0)&3)<<2) + (((cptr[2]>>0)&3)<<4) + (((cptr[3]>>0)&3)<<6);
|
||||||
|
|
|
@ -341,14 +341,14 @@ void qinterpolatedown16short(intptr_t bufptr, int32_t num, int32_t val, int32_t
|
||||||
|
|
||||||
void clearbuf(void *d, int32_t c, int32_t a)
|
void clearbuf(void *d, int32_t c, int32_t a)
|
||||||
{
|
{
|
||||||
int32_t *p = d;
|
int32_t *p = (int32_t *)d;
|
||||||
|
|
||||||
while ((c--) > 0) *(p++) = a;
|
while ((c--) > 0) *(p++) = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybuf(const void *s, void *d, int32_t c)
|
void copybuf(const void *s, void *d, int32_t c)
|
||||||
{
|
{
|
||||||
const int32_t *p = s;
|
const int32_t *p = (const int32_t *)s;
|
||||||
int32_t *q = (int32_t *)d;
|
int32_t *q = (int32_t *)d;
|
||||||
|
|
||||||
while ((c--) > 0) *(q++) = *(p++);
|
while ((c--) > 0) *(q++) = *(p++);
|
||||||
|
@ -371,7 +371,7 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
|
||||||
{
|
{
|
||||||
// Cringe City
|
// Cringe City
|
||||||
char *p = (char *)D;
|
char *p = (char *)D;
|
||||||
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,(int32_t)0xff000000l };
|
||||||
int32_t n[4] = { 0,8,16,24 };
|
int32_t n[4] = { 0,8,16,24 };
|
||||||
int32_t z=0;
|
int32_t z=0;
|
||||||
while ((c--) > 0)
|
while ((c--) > 0)
|
||||||
|
@ -383,16 +383,16 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
|
||||||
|
|
||||||
void copybufbyte(const void *S, void *D, int32_t c)
|
void copybufbyte(const void *S, void *D, int32_t c)
|
||||||
{
|
{
|
||||||
const char *p = S;
|
const char *p = (const char *)S;
|
||||||
char *q = D;
|
char *q = (char *)D;
|
||||||
|
|
||||||
while ((c--) > 0) *(q++) = *(p++);
|
while ((c--) > 0) *(q++) = *(p++);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybufreverse(const void *S, void *D, int32_t c)
|
void copybufreverse(const void *S, void *D, int32_t c)
|
||||||
{
|
{
|
||||||
const char *p = S;
|
const char *p = (const char *)S;
|
||||||
char *q = D;
|
char *q = (char *)D;
|
||||||
|
|
||||||
while ((c--) > 0) *(q++) = *(p--);
|
while ((c--) > 0) *(q++) = *(p--);
|
||||||
}
|
}
|
||||||
|
|
|
@ -527,7 +527,7 @@ int32_t initinput(void)
|
||||||
for (i=0; i<SDLK_LAST; i++)
|
for (i=0; i<SDLK_LAST; i++)
|
||||||
{
|
{
|
||||||
if (!keytranslation[i]) continue;
|
if (!keytranslation[i]) continue;
|
||||||
Bstrncpyz(key_names[ keytranslation[i] ], SDL_GetKeyName(i), sizeof(key_names[i]));
|
Bstrncpyz(key_names[ keytranslation[i] ], SDL_GetKeyName((SDLKey)i), sizeof(key_names[i]));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (i=0; i<SDL_NUM_SCANCODES; i++)
|
for (i=0; i<SDL_NUM_SCANCODES; i++)
|
||||||
|
|
|
@ -192,9 +192,9 @@ static void PopulateForm(void)
|
||||||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||||
if (i == mode3d)
|
if (i == mode3d)
|
||||||
{
|
{
|
||||||
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_block_by_func(box3d, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||||
gtk_combo_box_set_active_iter(box3d, &iter);
|
gtk_combo_box_set_active_iter(box3d, &iter);
|
||||||
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_unblock_by_func(box3d, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// only 8-bit modes get used for 2D
|
// only 8-bit modes get used for 2D
|
||||||
|
@ -204,9 +204,9 @@ static void PopulateForm(void)
|
||||||
gtk_list_store_set(modes2d, &iter, 0,buf, 1,i, -1);
|
gtk_list_store_set(modes2d, &iter, 0,buf, 1,i, -1);
|
||||||
if (i == mode2d)
|
if (i == mode2d)
|
||||||
{
|
{
|
||||||
g_signal_handlers_block_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
g_signal_handlers_block_by_func(box2d, (gpointer)on_vmode2dcombo_changed, NULL);
|
||||||
gtk_combo_box_set_active_iter(box2d, &iter);
|
gtk_combo_box_set_active_iter(box2d, &iter);
|
||||||
g_signal_handlers_unblock_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
g_signal_handlers_unblock_by_func(box2d, (gpointer)on_vmode2dcombo_changed, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ static GtkWidget *create_window(void)
|
||||||
// 2D video mode label
|
// 2D video mode label
|
||||||
stwidgets.vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
|
stwidgets.vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
|
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||||
|
|
||||||
// 2D video mode combo
|
// 2D video mode combo
|
||||||
{
|
{
|
||||||
|
@ -268,14 +268,15 @@ static GtkWidget *create_window(void)
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, FALSE);
|
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, FALSE);
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, "text", 0, NULL);
|
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, "text", 0, NULL);
|
||||||
}
|
}
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 6);
|
||||||
gtk_widget_add_accelerator(stwidgets.vmode2dcombo, "grab_focus", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.vmode2dcombo, "grab_focus", stwidgets.accel_group,
|
||||||
GDK_2, GDK_MOD1_MASK,
|
GDK_2, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
|
||||||
// Fullscreen checkbox
|
// Fullscreen checkbox
|
||||||
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, 0, 4, 6);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||||
gtk_widget_add_accelerator(stwidgets.fullscreencheck, "grab_focus", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.fullscreencheck, "grab_focus", stwidgets.accel_group,
|
||||||
GDK_F, GDK_MOD1_MASK,
|
GDK_F, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
@ -283,7 +284,7 @@ static GtkWidget *create_window(void)
|
||||||
// 3D video mode label
|
// 3D video mode label
|
||||||
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
|
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, 0, 4, 6);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||||
|
|
||||||
// 3D video mode combo
|
// 3D video mode combo
|
||||||
{
|
{
|
||||||
|
@ -297,17 +298,19 @@ static GtkWidget *create_window(void)
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE);
|
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE);
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL);
|
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL);
|
||||||
}
|
}
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||||
gtk_widget_add_accelerator(stwidgets.vmode3dcombo, "grab_focus", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.vmode3dcombo, "grab_focus", stwidgets.accel_group,
|
||||||
GDK_3, GDK_MOD1_MASK,
|
GDK_3, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
// Empty horizontal layout
|
// Empty horizontal layout
|
||||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, (GtkAttachOptions)0,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
|
||||||
|
|
||||||
// Always show config checkbox
|
// Always show config checkbox
|
||||||
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
|
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, 0, 4, 6);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||||
gtk_widget_add_accelerator(stwidgets.alwaysshowcheck, "grab_focus", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.alwaysshowcheck, "grab_focus", stwidgets.accel_group,
|
||||||
GDK_A, GDK_MOD1_MASK,
|
GDK_A, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
@ -348,7 +351,7 @@ static GtkWidget *create_window(void)
|
||||||
GDK_C, GDK_MOD1_MASK,
|
GDK_C, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
gtk_widget_add_accelerator(stwidgets.cancelbutton, "clicked", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.cancelbutton, "clicked", stwidgets.accel_group,
|
||||||
GDK_Escape, 0,
|
GDK_Escape, (GdkModifierType)0,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
|
||||||
stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||||
|
@ -371,7 +374,7 @@ static GtkWidget *create_window(void)
|
||||||
GDK_S, GDK_MOD1_MASK,
|
GDK_S, GDK_MOD1_MASK,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
gtk_widget_add_accelerator(stwidgets.startbutton, "clicked", stwidgets.accel_group,
|
gtk_widget_add_accelerator(stwidgets.startbutton, "clicked", stwidgets.accel_group,
|
||||||
GDK_Return, 0,
|
GDK_Return, (GdkModifierType)0,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
|
||||||
stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||||
|
|
|
@ -8,10 +8,25 @@
|
||||||
#define CINTERFACE
|
#define CINTERFACE
|
||||||
|
|
||||||
// bug in the dx headers
|
// bug in the dx headers
|
||||||
|
#if defined (_MSC_VER) || !defined(__cplusplus)
|
||||||
|
#define bDIPROP_BUFFERSIZE MAKEDIPROP(1)
|
||||||
|
#define bDIPROP_DEADZONE MAKEDIPROP(5)
|
||||||
|
#define bDIPROP_SATURATION MAKEDIPROP(6)
|
||||||
|
#else
|
||||||
#define bMAKEDIPROP(prop) ((REFGUID)(prop))
|
#define bMAKEDIPROP(prop) ((REFGUID)(prop))
|
||||||
#define bDIPROP_BUFFERSIZE bMAKEDIPROP(1)
|
#define bDIPROP_BUFFERSIZE bMAKEDIPROP(1)
|
||||||
#define bDIPROP_DEADZONE bMAKEDIPROP(5)
|
#define bDIPROP_DEADZONE bMAKEDIPROP(5)
|
||||||
#define bDIPROP_SATURATION bMAKEDIPROP(6)
|
#define bDIPROP_SATURATION bMAKEDIPROP(6)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// wtf, Microsoft?
|
||||||
|
#if defined (_MSC_VER) && defined(__cplusplus)
|
||||||
|
# define bREFGUID (REFGUID)
|
||||||
|
# define bREFIID (REFIID)
|
||||||
|
#else
|
||||||
|
# define bREFGUID &
|
||||||
|
# define bREFIID &
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
@ -22,6 +37,10 @@
|
||||||
|
|
||||||
#include <math.h> // pow
|
#include <math.h> // pow
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include <algorithm>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,7 +78,7 @@ static int32_t winlayer_have_ATI = 0;
|
||||||
int32_t _buildargc = 0;
|
int32_t _buildargc = 0;
|
||||||
const char **_buildargv = NULL;
|
const char **_buildargv = NULL;
|
||||||
static char *argvbuf = NULL;
|
static char *argvbuf = NULL;
|
||||||
extern int32_t app_main(int32_t argc, const char *argv[]);
|
extern int32_t app_main(int32_t argc, const char **argv);
|
||||||
extern void app_crashhandler(void);
|
extern void app_crashhandler(void);
|
||||||
|
|
||||||
// Windows crud
|
// Windows crud
|
||||||
|
@ -362,9 +381,13 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
|
||||||
#ifndef DEBUGGINGAIDS
|
#ifndef DEBUGGINGAIDS
|
||||||
if ((nedhandle = LoadLibrary("nedmalloc.dll")))
|
if ((nedhandle = LoadLibrary("nedmalloc.dll")))
|
||||||
{
|
{
|
||||||
nedpool *(WINAPI *nedcreatepool)(size_t, int);
|
#ifdef __cplusplus
|
||||||
|
nedalloc::nedpool_t *(WINAPI *nedcreatepool)(size_t, int);
|
||||||
|
if ((nedcreatepool = (nedalloc::nedpool_t *(WINAPI *)(size_t, int))GetProcAddress(nedhandle, "nedcreatepool")))
|
||||||
|
#else
|
||||||
|
nedpool_t *(WINAPI *nedcreatepool)(size_t, int);
|
||||||
if ((nedcreatepool = (void *)GetProcAddress(nedhandle, "nedcreatepool")))
|
if ((nedcreatepool = (void *)GetProcAddress(nedhandle, "nedcreatepool")))
|
||||||
|
#endif
|
||||||
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -964,7 +987,7 @@ void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur)
|
||||||
dipdw.diph.dwHow = DIPH_BYOFFSET;
|
dipdw.diph.dwHow = DIPH_BYOFFSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = IDirectInputDevice7_GetProperty(lpDID, bDIPROP_DEADZONE, &dipdw.diph);
|
result = IDirectInputDevice7_GetProperty(lpDID, bDIPROP_DEADZONE, (LPDIPROPHEADER)&dipdw.diph);
|
||||||
if (FAILED(result))
|
if (FAILED(result))
|
||||||
{
|
{
|
||||||
//ShowDInputErrorBox("Failed getting joystick dead zone", result);
|
//ShowDInputErrorBox("Failed getting joystick dead zone", result);
|
||||||
|
@ -1110,7 +1133,7 @@ static BOOL InitDirectInput(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aDirectInputCreateA = (void *)GetProcAddress(hDInputDLL, "DirectInputCreateA");
|
aDirectInputCreateA = (HRESULT(WINAPI *)(HINSTANCE, DWORD, LPDIRECTINPUT7A *, LPUNKNOWN))GetProcAddress(hDInputDLL, "DirectInputCreateA");
|
||||||
if (!aDirectInputCreateA) ShowErrorBox("Error fetching DirectInputCreateA()");
|
if (!aDirectInputCreateA) ShowErrorBox("Error fetching DirectInputCreateA()");
|
||||||
|
|
||||||
result = aDirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &lpDI, NULL);
|
result = aDirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &lpDI, NULL);
|
||||||
|
@ -1133,11 +1156,12 @@ static BOOL InitDirectInput(void)
|
||||||
*devicedef.did = NULL;
|
*devicedef.did = NULL;
|
||||||
|
|
||||||
// initprintf(" - Creating %s device\n", devicedef.name);
|
// initprintf(" - Creating %s device\n", devicedef.name);
|
||||||
result = IDirectInput7_CreateDeviceEx(lpDI, &guidDevs, &IID_IDirectInputDevice7, (void *)&dev, NULL);
|
result = IDirectInput7_CreateDeviceEx(lpDI, bREFGUID guidDevs, bREFIID IID_IDirectInputDevice7, (LPVOID *)&dev, NULL);
|
||||||
|
|
||||||
if (FAILED(result)) { HorribleDInputDeath("Failed creating device", result); }
|
if (FAILED(result)) { HorribleDInputDeath("Failed creating device", result); }
|
||||||
else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result));
|
else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result));
|
||||||
|
|
||||||
result = IDirectInputDevice7_QueryInterface(dev, &IID_IDirectInputDevice7, (LPVOID *)&dev2);
|
result = IDirectInputDevice7_QueryInterface(dev, bREFIID IID_IDirectInputDevice7, (LPVOID *)&dev2);
|
||||||
IDirectInputDevice7_Release(dev);
|
IDirectInputDevice7_Release(dev);
|
||||||
if (FAILED(result)) { HorribleDInputDeath("Failed querying DirectInput7 interface for device", result); }
|
if (FAILED(result)) { HorribleDInputDeath("Failed querying DirectInput7 interface for device", result); }
|
||||||
else if (result != DI_OK) initprintf(" Queried IDirectInputDevice7 interface with warning: %s\n",GetDInputError(result));
|
else if (result != DI_OK) initprintf(" Queried IDirectInputDevice7 interface with warning: %s\n",GetDInputError(result));
|
||||||
|
@ -1683,7 +1707,7 @@ static void ToggleDesktopComposition(BOOL compEnable)
|
||||||
static HRESULT(WINAPI *aDwmEnableComposition)(UINT);
|
static HRESULT(WINAPI *aDwmEnableComposition)(UINT);
|
||||||
|
|
||||||
if (!hDWMApiDLL && (hDWMApiDLL = LoadLibrary("DWMAPI.DLL")))
|
if (!hDWMApiDLL && (hDWMApiDLL = LoadLibrary("DWMAPI.DLL")))
|
||||||
aDwmEnableComposition = (void *)GetProcAddress(hDWMApiDLL, "DwmEnableComposition");
|
aDwmEnableComposition = (HRESULT(WINAPI *)(UINT))GetProcAddress(hDWMApiDLL, "DwmEnableComposition");
|
||||||
|
|
||||||
if (aDwmEnableComposition)
|
if (aDwmEnableComposition)
|
||||||
{
|
{
|
||||||
|
@ -2271,7 +2295,7 @@ static int32_t setgammaramp(WORD gt[3][256])
|
||||||
|
|
||||||
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
||||||
|
|
||||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, &IID_IDirectDrawGammaControl, (LPVOID)&gam);
|
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, bREFIID IID_IDirectDrawGammaControl, (LPVOID *)&gam);
|
||||||
if (hr != DD_OK)
|
if (hr != DD_OK)
|
||||||
{
|
{
|
||||||
// ShowDDrawErrorBox("Error querying gamma control", hr);
|
// ShowDDrawErrorBox("Error querying gamma control", hr);
|
||||||
|
@ -2343,7 +2367,7 @@ static int32_t getgammaramp(WORD gt[3][256])
|
||||||
|
|
||||||
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
||||||
|
|
||||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, &IID_IDirectDrawGammaControl, (LPVOID)&gam);
|
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, bREFIID IID_IDirectDrawGammaControl, (LPVOID *)&gam);
|
||||||
if (hr != DD_OK)
|
if (hr != DD_OK)
|
||||||
{
|
{
|
||||||
ShowDDrawErrorBox("Error querying gamma control", hr);
|
ShowDDrawErrorBox("Error querying gamma control", hr);
|
||||||
|
@ -2403,7 +2427,7 @@ static BOOL InitDirectDraw(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the pointer to DirectDrawEnumerate
|
// get the pointer to DirectDrawEnumerate
|
||||||
aDirectDrawEnumerate = (void *)GetProcAddress(hDDrawDLL, "DirectDrawEnumerateA");
|
aDirectDrawEnumerate = (HRESULT(WINAPI *)(LPDDENUMCALLBACK, LPVOID))GetProcAddress(hDDrawDLL, "DirectDrawEnumerateA");
|
||||||
if (!aDirectDrawEnumerate)
|
if (!aDirectDrawEnumerate)
|
||||||
{
|
{
|
||||||
ShowErrorBox("Error fetching DirectDrawEnumerate()");
|
ShowErrorBox("Error fetching DirectDrawEnumerate()");
|
||||||
|
@ -2416,7 +2440,7 @@ static BOOL InitDirectDraw(void)
|
||||||
aDirectDrawEnumerate(InitDirectDraw_enum, NULL);
|
aDirectDrawEnumerate(InitDirectDraw_enum, NULL);
|
||||||
|
|
||||||
// get the pointer to DirectDrawCreate
|
// get the pointer to DirectDrawCreate
|
||||||
aDirectDrawCreate = (void *)GetProcAddress(hDDrawDLL, "DirectDrawCreate");
|
aDirectDrawCreate = (HRESULT(WINAPI *)(GUID *, LPDIRECTDRAW *, IUnknown *))GetProcAddress(hDDrawDLL, "DirectDrawCreate");
|
||||||
if (!aDirectDrawCreate)
|
if (!aDirectDrawCreate)
|
||||||
{
|
{
|
||||||
ShowErrorBox("Error fetching DirectDrawCreate()");
|
ShowErrorBox("Error fetching DirectDrawCreate()");
|
||||||
|
@ -3812,13 +3836,13 @@ static BOOL RegisterWindowClass(void)
|
||||||
wcx.cbClsExtra = 0;
|
wcx.cbClsExtra = 0;
|
||||||
wcx.cbWndExtra = 0;
|
wcx.cbWndExtra = 0;
|
||||||
wcx.hInstance = hInstance;
|
wcx.hInstance = hInstance;
|
||||||
wcx.hIcon = LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
wcx.hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||||
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
|
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
|
||||||
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wcx.hbrBackground = (HBRUSH)COLOR_GRAYTEXT;
|
wcx.hbrBackground = (HBRUSH)COLOR_GRAYTEXT;
|
||||||
wcx.lpszMenuName = NULL;
|
wcx.lpszMenuName = NULL;
|
||||||
wcx.lpszClassName = WindowClass;
|
wcx.lpszClassName = WindowClass;
|
||||||
wcx.hIconSm = LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
wcx.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||||
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
|
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
|
||||||
if (!RegisterClassEx(&wcx))
|
if (!RegisterClassEx(&wcx))
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,12 +104,16 @@
|
||||||
<ClInclude Include="build\include\scriptfile.h" />
|
<ClInclude Include="build\include\scriptfile.h" />
|
||||||
<ClInclude Include="build\include\sdlayer.h" />
|
<ClInclude Include="build\include\sdlayer.h" />
|
||||||
<ClInclude Include="build\include\startwin.editor.h" />
|
<ClInclude Include="build\include\startwin.editor.h" />
|
||||||
|
<ClInclude Include="build\include\tracker.hpp" />
|
||||||
|
<ClInclude Include="build\include\tracker_operator.hpp" />
|
||||||
|
<ClInclude Include="build\include\tracker_operators.hpp" />
|
||||||
<ClInclude Include="build\include\winlayer.h" />
|
<ClInclude Include="build\include\winlayer.h" />
|
||||||
<ClInclude Include="build\include\msvc\inttypes.h" />
|
<ClInclude Include="build\include\msvc\inttypes.h" />
|
||||||
<ClInclude Include="build\include\msvc\stdint.h" />
|
<ClInclude Include="build\include\msvc\stdint.h" />
|
||||||
<ClInclude Include="build\src\engine_priv.h" />
|
<ClInclude Include="build\src\engine_priv.h" />
|
||||||
<ClInclude Include="source\actors.h" />
|
<ClInclude Include="source\actors.h" />
|
||||||
<ClInclude Include="source\anim.h" />
|
<ClInclude Include="source\anim.h" />
|
||||||
|
<ClInclude Include="source\animvpx.h" />
|
||||||
<ClInclude Include="source\demo.h" />
|
<ClInclude Include="source\demo.h" />
|
||||||
<ClInclude Include="source\game.h" />
|
<ClInclude Include="source\game.h" />
|
||||||
<ClInclude Include="source\gameexec.h" />
|
<ClInclude Include="source\gameexec.h" />
|
||||||
|
@ -215,9 +219,11 @@
|
||||||
<ClCompile Include="build\src\winlayer.c" />
|
<ClCompile Include="build\src\winlayer.c" />
|
||||||
<ClCompile Include="source\actors.c" />
|
<ClCompile Include="source\actors.c" />
|
||||||
<ClCompile Include="source\anim.c" />
|
<ClCompile Include="source\anim.c" />
|
||||||
|
<ClCompile Include="source\animvpx.c" />
|
||||||
<ClCompile Include="source\astub.c" />
|
<ClCompile Include="source\astub.c" />
|
||||||
<ClCompile Include="source\config.c" />
|
<ClCompile Include="source\config.c" />
|
||||||
<ClCompile Include="source\demo.c" />
|
<ClCompile Include="source\demo.c" />
|
||||||
|
<ClCompile Include="source\enet\src\compress.c" />
|
||||||
<ClCompile Include="source\game.c" />
|
<ClCompile Include="source\game.c" />
|
||||||
<ClCompile Include="source\gamedef.c" />
|
<ClCompile Include="source\gamedef.c" />
|
||||||
<ClCompile Include="source\gameexec.c" />
|
<ClCompile Include="source\gameexec.c" />
|
||||||
|
|
|
@ -390,6 +390,18 @@
|
||||||
<ClInclude Include="source\input.h">
|
<ClInclude Include="source\input.h">
|
||||||
<Filter>eduke32\headers</Filter>
|
<Filter>eduke32\headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="build\include\tracker_operator.hpp">
|
||||||
|
<Filter>build\headers</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="build\include\tracker_operators.hpp">
|
||||||
|
<Filter>build\headers</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="build\include\tracker.hpp">
|
||||||
|
<Filter>build\headers</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="source\animvpx.h">
|
||||||
|
<Filter>eduke32\headers</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="build\src\a-c.c">
|
<ClCompile Include="build\src\a-c.c">
|
||||||
|
@ -677,6 +689,12 @@
|
||||||
<ClCompile Include="source\input.c">
|
<ClCompile Include="source\input.c">
|
||||||
<Filter>eduke32\source</Filter>
|
<Filter>eduke32\source</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\animvpx.c">
|
||||||
|
<Filter>eduke32\source</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\enet\src\compress.c">
|
||||||
|
<Filter>enet\source</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Makefile.msvc">
|
<None Include="Makefile.msvc">
|
||||||
|
|
|
@ -1362,10 +1362,10 @@ ACTOR_STATIC void G_MoveFallers(void)
|
||||||
}
|
}
|
||||||
else if (T1 == 1)
|
else if (T1 == 1)
|
||||||
{
|
{
|
||||||
if (s->lotag > 0)
|
if (s->lotag < INT16_MAX)
|
||||||
{
|
{
|
||||||
s->lotag-=3;
|
s->lotag-=3;
|
||||||
if (s->lotag <= 0)
|
if (s->lotag > INT16_MAX)
|
||||||
{
|
{
|
||||||
s->xvel = (32+(krand()&63));
|
s->xvel = (32+(krand()&63));
|
||||||
s->zvel = -(1024+(krand()&1023));
|
s->zvel = -(1024+(krand()&1023));
|
||||||
|
@ -1905,7 +1905,7 @@ ACTOR_STATIC void G_MoveStandables(void)
|
||||||
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
A_PlaySound(PIPEBOMB_EXPLODE,j);
|
||||||
A_PlaySound(GLASS_HEAVYBREAK,j);
|
A_PlaySound(GLASS_HEAVYBREAK,j);
|
||||||
|
|
||||||
if (s->hitag > 0)
|
if (s->hitag < INT16_MAX)
|
||||||
{
|
{
|
||||||
j = headspritestat[STAT_STANDABLE];
|
j = headspritestat[STAT_STANDABLE];
|
||||||
while (j >= 0)
|
while (j >= 0)
|
||||||
|
@ -1959,10 +1959,10 @@ ACTOR_STATIC void G_MoveStandables(void)
|
||||||
{
|
{
|
||||||
if (s->shade == -32)
|
if (s->shade == -32)
|
||||||
{
|
{
|
||||||
if (s->lotag > 0)
|
if (s->lotag < INT16_MAX)
|
||||||
{
|
{
|
||||||
s->lotag-=3;
|
s->lotag-=3;
|
||||||
if (s->lotag <= 0) s->lotag = -99;
|
if (s->lotag > INT16_MAX) s->lotag = UINT16_MAX-99;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s->shade = -33;
|
s->shade = -33;
|
||||||
|
@ -2023,7 +2023,7 @@ DETONATE:
|
||||||
if (s->xrepeat)
|
if (s->xrepeat)
|
||||||
for (x=0; x<8; x++) RANDOMSCRAP;
|
for (x=0; x<8; x++) RANDOMSCRAP;
|
||||||
|
|
||||||
if ((t[3] == 1 && s->xrepeat) || s->lotag == -99)
|
if ((t[3] == 1 && s->xrepeat) || s->lotag == UINT16_MAX-99)
|
||||||
{
|
{
|
||||||
int32_t j = A_Spawn(i,EXPLOSION2);
|
int32_t j = A_Spawn(i,EXPLOSION2);
|
||||||
x = s->extra;
|
x = s->extra;
|
||||||
|
@ -2042,7 +2042,7 @@ DETONATE:
|
||||||
if (s->yvel == 1)
|
if (s->yvel == 1)
|
||||||
{
|
{
|
||||||
s->hitag--;
|
s->hitag--;
|
||||||
if (s->hitag <= 0)
|
if (s->hitag == UINT16_MAX)
|
||||||
{
|
{
|
||||||
G_OperateSectors(sect,i);
|
G_OperateSectors(sect,i);
|
||||||
|
|
||||||
|
@ -2264,7 +2264,7 @@ CLEAR_THE_BOLT:
|
||||||
goto BOLT;
|
goto BOLT;
|
||||||
|
|
||||||
case TOUCHPLATE__STATIC:
|
case TOUCHPLATE__STATIC:
|
||||||
if (t[1] == 1 && s->hitag >= 0) //Move the sector floor
|
if (t[1] == 1 && s->hitag != UINT16_MAX) //Move the sector floor
|
||||||
{
|
{
|
||||||
x = sector[sect].floorz;
|
x = sector[sect].floorz;
|
||||||
|
|
||||||
|
@ -2317,7 +2317,7 @@ CLEAR_THE_BOLT:
|
||||||
t[3] = !t[3];
|
t[3] = !t[3];
|
||||||
G_OperateMasterSwitches(s->lotag);
|
G_OperateMasterSwitches(s->lotag);
|
||||||
G_OperateActivators(s->lotag,p);
|
G_OperateActivators(s->lotag,p);
|
||||||
if (s->hitag > 0)
|
if (s->hitag < INT16_MAX)
|
||||||
{
|
{
|
||||||
s->hitag--;
|
s->hitag--;
|
||||||
if (s->hitag == 0) t[5] = 1;
|
if (s->hitag == 0) t[5] = 1;
|
||||||
|
@ -5541,7 +5541,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
|
||||||
|
|
||||||
j = s->owner;
|
j = s->owner;
|
||||||
|
|
||||||
if (sprite[j].lotag == (int16_t) 65535)
|
if (sprite[j].lotag == UINT16_MAX)
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
|
|
||||||
q = sc->extra>>3;
|
q = sc->extra>>3;
|
||||||
|
@ -6421,7 +6421,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
|
||||||
|
|
||||||
case SE_10_DOOR_AUTO_CLOSE:
|
case SE_10_DOOR_AUTO_CLOSE:
|
||||||
// XXX: 32791, what the hell?
|
// XXX: 32791, what the hell?
|
||||||
if ((sc->lotag&0xff) == ST_27_STRETCH_BRIDGE || (sc->floorz > sc->ceilingz && (sc->lotag&0xff) != ST_23_SWINGING_DOOR) || sc->lotag == (int16_t) 32791)
|
if ((sc->lotag&0xff) == ST_27_STRETCH_BRIDGE || (sc->floorz > sc->ceilingz && (sc->lotag&0xff) != ST_23_SWINGING_DOOR) || sc->lotag == 32791)
|
||||||
{
|
{
|
||||||
int32_t p;
|
int32_t p;
|
||||||
|
|
||||||
|
@ -7760,7 +7760,7 @@ static void G_DoEffectorLights(void) // STATNUM 14
|
||||||
actor[i].lightptr->color[1] = sprite[i].yvel;
|
actor[i].lightptr->color[1] = sprite[i].yvel;
|
||||||
actor[i].lightptr->color[2] = sprite[i].zvel;
|
actor[i].lightptr->color[2] = sprite[i].zvel;
|
||||||
}
|
}
|
||||||
if (!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
|
if ((int)!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
|
||||||
actor[i].lightptr->publicflags.negative = !!(CS & 128);
|
actor[i].lightptr->publicflags.negative = !!(CS & 128);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7850,10 +7850,10 @@ static void G_DoEffectorLights(void) // STATNUM 14
|
||||||
actor[i].lightptr->horiz = SH;
|
actor[i].lightptr->horiz = SH;
|
||||||
actor[i].lightptr->flags.invalidate = 1;
|
actor[i].lightptr->flags.invalidate = 1;
|
||||||
}
|
}
|
||||||
if (!(CS & 64) != actor[i].lightptr->publicflags.emitshadow) {
|
if ((int)!(CS & 64) != actor[i].lightptr->publicflags.emitshadow) {
|
||||||
actor[i].lightptr->publicflags.emitshadow = !(CS & 64);
|
actor[i].lightptr->publicflags.emitshadow = !(CS & 64);
|
||||||
}
|
}
|
||||||
if (!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
|
if ((int)!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
|
||||||
actor[i].lightptr->publicflags.negative = !!(CS & 128);
|
actor[i].lightptr->publicflags.negative = !!(CS & 128);
|
||||||
}
|
}
|
||||||
actor[i].lightptr->tilenum = actor[i].picnum;
|
actor[i].lightptr->tilenum = actor[i].picnum;
|
||||||
|
|
|
@ -172,7 +172,7 @@ typedef struct {
|
||||||
|
|
||||||
uint32_t flags; // formerly SpriteFlags, ActorType
|
uint32_t flags; // formerly SpriteFlags, ActorType
|
||||||
|
|
||||||
int16_t cacherange[2]; // formerly SpriteCache
|
int16_t cacherange; // formerly SpriteCache
|
||||||
|
|
||||||
// todo: make this a pointer and allocate at runtime
|
// todo: make this a pointer and allocate at runtime
|
||||||
projectile_t defproj;
|
projectile_t defproj;
|
||||||
|
|
|
@ -102,7 +102,7 @@ int32_t animvpx_init_codec(const animvpx_ivf_header_t *info, int32_t inhandle, a
|
||||||
|
|
||||||
//
|
//
|
||||||
codec->inhandle = inhandle;
|
codec->inhandle = inhandle;
|
||||||
codec->pic = Bcalloc(info->width*info->height,4);
|
codec->pic = (uint8_t *)Bcalloc(info->width*info->height,4);
|
||||||
|
|
||||||
codec->compbuflen = codec->compbufallocsiz = 0;
|
codec->compbuflen = codec->compbufallocsiz = 0;
|
||||||
codec->compbuf = NULL;
|
codec->compbuf = NULL;
|
||||||
|
@ -173,14 +173,14 @@ static int32_t animvpx_read_frame(int32_t inhandle, uint8_t **bufptr, uint32_t *
|
||||||
|
|
||||||
if (!*bufptr)
|
if (!*bufptr)
|
||||||
{
|
{
|
||||||
*bufptr = Bmalloc(hdr.framesiz);
|
*bufptr = (uint8_t *)Bmalloc(hdr.framesiz);
|
||||||
if (!*bufptr)
|
if (!*bufptr)
|
||||||
return 2;
|
return 2;
|
||||||
*bufallocsizptr = hdr.framesiz;
|
*bufallocsizptr = hdr.framesiz;
|
||||||
}
|
}
|
||||||
else if (*bufallocsizptr < hdr.framesiz)
|
else if (*bufallocsizptr < hdr.framesiz)
|
||||||
{
|
{
|
||||||
*bufptr = Brealloc(*bufptr, hdr.framesiz);
|
*bufptr = (uint8_t *)Brealloc(*bufptr, hdr.framesiz);
|
||||||
if (!*bufptr)
|
if (!*bufptr)
|
||||||
return 2;
|
return 2;
|
||||||
*bufallocsizptr = hdr.framesiz;
|
*bufallocsizptr = hdr.framesiz;
|
||||||
|
|
|
@ -415,12 +415,12 @@ static void create_compressed_block(int32_t idx, const void *srcdata, uint32_t s
|
||||||
uint32_t j;
|
uint32_t j;
|
||||||
|
|
||||||
// allocate
|
// allocate
|
||||||
mapstate->sws[idx] = Bmalloc(4 + size + QADDNSZ);
|
mapstate->sws[idx] = (char *)Bmalloc(4 + size + QADDNSZ);
|
||||||
if (!mapstate->sws[idx]) { initprintf("OUT OF MEM in undo/redo\n"); osdcmd_quit(NULL); }
|
if (!mapstate->sws[idx]) { initprintf("OUT OF MEM in undo/redo\n"); osdcmd_quit(NULL); }
|
||||||
|
|
||||||
// compress & realloc
|
// compress & realloc
|
||||||
j = qlz_compress(srcdata, mapstate->sws[idx]+4, size, state_compress);
|
j = qlz_compress(srcdata, mapstate->sws[idx]+4, size, state_compress);
|
||||||
mapstate->sws[idx] = Brealloc(mapstate->sws[idx], 4 + j);
|
mapstate->sws[idx] = (char *)Brealloc(mapstate->sws[idx], 4 + j);
|
||||||
if (!mapstate->sws[idx]) { initprintf("COULD not realloc in undo/redo\n"); osdcmd_quit(NULL); }
|
if (!mapstate->sws[idx]) { initprintf("COULD not realloc in undo/redo\n"); osdcmd_quit(NULL); }
|
||||||
|
|
||||||
// write refcount
|
// write refcount
|
||||||
|
@ -474,7 +474,7 @@ void create_map_snapshot(void)
|
||||||
|
|
||||||
map_revision = 1;
|
map_revision = 1;
|
||||||
|
|
||||||
mapstate = Bcalloc(1, sizeof(mapundo_t));
|
mapstate = (mapundo_t *)Bcalloc(1, sizeof(mapundo_t));
|
||||||
mapstate->revision = map_revision;
|
mapstate->revision = map_revision;
|
||||||
mapstate->prev = mapstate->next = NULL;
|
mapstate->prev = mapstate->next = NULL;
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ void create_map_snapshot(void)
|
||||||
// now, have no successors
|
// now, have no successors
|
||||||
|
|
||||||
// calloc because not everything may be set in the following:
|
// calloc because not everything may be set in the following:
|
||||||
mapstate->next = Bcalloc(1, sizeof(mapundo_t));
|
mapstate->next = (mapundo_t *)Bcalloc(1, sizeof(mapundo_t));
|
||||||
mapstate->next->prev = mapstate;
|
mapstate->next->prev = mapstate;
|
||||||
|
|
||||||
mapstate = mapstate->next;
|
mapstate = mapstate->next;
|
||||||
|
@ -524,7 +524,7 @@ void create_map_snapshot(void)
|
||||||
if (!try_match_with_prev(2, Numsprites, tempcrc))
|
if (!try_match_with_prev(2, Numsprites, tempcrc))
|
||||||
{
|
{
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
spritetype *const tspri = Bmalloc(Numsprites*sizeof(spritetype) + 4);
|
spritetype *const tspri = (spritetype *)Bmalloc(Numsprites*sizeof(spritetype) + 4);
|
||||||
spritetype *spri = tspri;
|
spritetype *spri = tspri;
|
||||||
|
|
||||||
if (!tspri) { initprintf("OUT OF MEM in undo/redo (2)\n"); osdcmd_quit(NULL); }
|
if (!tspri) { initprintf("OUT OF MEM in undo/redo (2)\n"); osdcmd_quit(NULL); }
|
||||||
|
@ -897,7 +897,7 @@ int32_t taglab_load(const char *filename, int32_t flags)
|
||||||
|
|
||||||
len = kfilelength(fil);
|
len = kfilelength(fil);
|
||||||
|
|
||||||
filebuf = Bmalloc(len+1);
|
filebuf = (char *)Bmalloc(len+1);
|
||||||
if (!filebuf)
|
if (!filebuf)
|
||||||
{
|
{
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
|
@ -1315,9 +1315,9 @@ const char *ExtGetSectorCaption(int16_t sectnum)
|
||||||
{
|
{
|
||||||
Bstrcpy(lo, ExtGetSectorType(sector[sectnum].lotag));
|
Bstrcpy(lo, ExtGetSectorType(sector[sectnum].lotag));
|
||||||
if (qsetmode != 200)
|
if (qsetmode != 200)
|
||||||
Bsprintf(tempbuf,"%hu,%hu %s", sector[sectnum].hitag, sector[sectnum].lotag, lo);
|
Bsprintf_nowarn(tempbuf,"%hu,%hu %s", sector[sectnum].hitag, sector[sectnum].lotag, lo);
|
||||||
else
|
else
|
||||||
Bsprintf(tempbuf,"%hu %s", sector[sectnum].lotag, lo);
|
Bsprintf_nowarn(tempbuf,"%hu %s", sector[sectnum].lotag, lo);
|
||||||
}
|
}
|
||||||
return(tempbuf);
|
return(tempbuf);
|
||||||
}
|
}
|
||||||
|
@ -1350,8 +1350,8 @@ const char *ExtGetWallCaption(int16_t wallnum)
|
||||||
int32_t lt = taglab_linktags(0, wallnum);
|
int32_t lt = taglab_linktags(0, wallnum);
|
||||||
char histr[TAGLAB_MAX+16], lostr[TAGLAB_MAX+16];
|
char histr[TAGLAB_MAX+16], lostr[TAGLAB_MAX+16];
|
||||||
|
|
||||||
lt &= ~(wall[wallnum].lotag<=0);
|
lt &= ~(int)(wall[wallnum].lotag<=0);
|
||||||
lt &= ~((wall[wallnum].hitag<=0)<<1);
|
lt &= ~(int)((wall[wallnum].hitag<=0)<<1);
|
||||||
|
|
||||||
taglab_handle1(lt&2, wall[wallnum].hitag, histr);
|
taglab_handle1(lt&2, wall[wallnum].hitag, histr);
|
||||||
|
|
||||||
|
@ -1491,8 +1491,8 @@ const char *ExtGetSpriteCaption(int16_t spritenum)
|
||||||
return tempbuf;
|
return tempbuf;
|
||||||
|
|
||||||
lt = taglab_linktags(1, spritenum);
|
lt = taglab_linktags(1, spritenum);
|
||||||
lt &= ~(sprite[spritenum].lotag<=0);
|
lt &= ~(int)(sprite[spritenum].lotag<=0);
|
||||||
lt &= ~((sprite[spritenum].hitag<=0)<<1);
|
lt &= ~(int)((sprite[spritenum].hitag<=0)<<1);
|
||||||
|
|
||||||
if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
|
if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
|
||||||
{
|
{
|
||||||
|
@ -1527,7 +1527,7 @@ const char *ExtGetSpriteCaption(int16_t spritenum)
|
||||||
|
|
||||||
SpriteName(spritenum,lo);
|
SpriteName(spritenum,lo);
|
||||||
if (sprite[spritenum].extra != -1)
|
if (sprite[spritenum].extra != -1)
|
||||||
Bsprintf(tempbuf,"%s,%s,%d %s", histr, lostr, sprite[spritenum].extra, lo);
|
Bsprintf_nowarn(tempbuf,"%s,%s,%d %s", histr, lostr, sprite[spritenum].extra, lo);
|
||||||
else
|
else
|
||||||
Bsprintf(tempbuf,"%s,%s %s", histr, lostr, lo);
|
Bsprintf(tempbuf,"%s,%s %s", histr, lostr, lo);
|
||||||
}
|
}
|
||||||
|
@ -1754,7 +1754,7 @@ void ExtShowWallData(int16_t wallnum) //F6
|
||||||
if (runi==1 && sprite[i].picnum!=RESPAWN)
|
if (runi==1 && sprite[i].picnum!=RESPAWN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pic = (runi==0) ? sprite[i].picnum : sprite[i].hitag;
|
pic = (runi==0) ? (int)sprite[i].picnum : (int)sprite[i].hitag;
|
||||||
if (pic<0 || pic>=MAXTILES)
|
if (pic<0 || pic>=MAXTILES)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1948,7 +1948,7 @@ static void ReadHelpFile(const char *name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
helppage=Bmalloc(IHELP_INITPAGES * sizeof(helppage_t *));
|
helppage=(helppage_t **)Bmalloc(IHELP_INITPAGES * sizeof(helppage_t *));
|
||||||
numallocpages=IHELP_INITPAGES;
|
numallocpages=IHELP_INITPAGES;
|
||||||
if (!helppage) goto HELPFILE_ERROR;
|
if (!helppage) goto HELPFILE_ERROR;
|
||||||
|
|
||||||
|
@ -1968,7 +1968,7 @@ static void ReadHelpFile(const char *name)
|
||||||
|
|
||||||
if (Bfeof(fp) || charsread<=0) break;
|
if (Bfeof(fp) || charsread<=0) break;
|
||||||
|
|
||||||
hp=Bcalloc(1,sizeof(helppage_t) + IHELP_INITLINES*80);
|
hp=(helppage_t *)Bcalloc(1,sizeof(helppage_t) + IHELP_INITLINES*80);
|
||||||
if (!hp) goto HELPFILE_ERROR;
|
if (!hp) goto HELPFILE_ERROR;
|
||||||
hp->numlines = IHELP_INITLINES;
|
hp->numlines = IHELP_INITLINES;
|
||||||
|
|
||||||
|
@ -1979,7 +1979,7 @@ static void ReadHelpFile(const char *name)
|
||||||
{
|
{
|
||||||
if (j >= hp->numlines)
|
if (j >= hp->numlines)
|
||||||
{
|
{
|
||||||
hp=Brealloc(hp, sizeof(helppage_t) + 2*hp->numlines*80);
|
hp=(helppage_t *)Brealloc(hp, sizeof(helppage_t) + 2*hp->numlines*80);
|
||||||
if (!hp) goto HELPFILE_ERROR;
|
if (!hp) goto HELPFILE_ERROR;
|
||||||
hp->numlines *= 2;
|
hp->numlines *= 2;
|
||||||
}
|
}
|
||||||
|
@ -2012,13 +2012,13 @@ static void ReadHelpFile(const char *name)
|
||||||
}
|
}
|
||||||
while (!newpage(tempbuf) && !Bfeof(fp) && charsread>0);
|
while (!newpage(tempbuf) && !Bfeof(fp) && charsread>0);
|
||||||
|
|
||||||
hp=Brealloc(hp, sizeof(helppage_t) + j*80);
|
hp=(helppage_t *)Brealloc(hp, sizeof(helppage_t) + j*80);
|
||||||
if (!hp) goto HELPFILE_ERROR;
|
if (!hp) goto HELPFILE_ERROR;
|
||||||
hp->numlines=j;
|
hp->numlines=j;
|
||||||
|
|
||||||
if (i >= numallocpages)
|
if (i >= numallocpages)
|
||||||
{
|
{
|
||||||
helppage = Brealloc(helppage, 2*numallocpages*sizeof(helppage_t *));
|
helppage = (helppage_t **)Brealloc(helppage, 2*numallocpages*sizeof(helppage_t *));
|
||||||
numallocpages *= 2;
|
numallocpages *= 2;
|
||||||
if (!helppage) goto HELPFILE_ERROR;
|
if (!helppage) goto HELPFILE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -2026,7 +2026,7 @@ static void ReadHelpFile(const char *name)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
helppage = Brealloc(helppage, i*sizeof(helppage_t *));
|
helppage =(helppage_t **) Brealloc(helppage, i*sizeof(helppage_t *));
|
||||||
if (!helppage) goto HELPFILE_ERROR;
|
if (!helppage) goto HELPFILE_ERROR;
|
||||||
numhelppages = i;
|
numhelppages = i;
|
||||||
|
|
||||||
|
@ -2335,7 +2335,7 @@ static int32_t sort_sounds(int32_t how)
|
||||||
|
|
||||||
n = g_numsounds;
|
n = g_numsounds;
|
||||||
src = source = g_sndnum;
|
src = source = g_sndnum;
|
||||||
dest = Bmalloc(sizeof(int16_t) * n);
|
dest = (int16_t *)Bmalloc(sizeof(int16_t) * n);
|
||||||
dst = dest;
|
dst = dest;
|
||||||
if (!dest) return -1;
|
if (!dest) return -1;
|
||||||
|
|
||||||
|
@ -3748,7 +3748,7 @@ static int32_t OnSaveTileGroup(void)
|
||||||
Bfprintf(fp, "tilegroup \"%s\""OURNEWL"{"OURNEWL, name);
|
Bfprintf(fp, "tilegroup \"%s\""OURNEWL"{"OURNEWL, name);
|
||||||
Bfprintf(fp, TTAB "hotkey \"%c\""OURNEWL OURNEWL, hotkey);
|
Bfprintf(fp, TTAB "hotkey \"%c\""OURNEWL OURNEWL, hotkey);
|
||||||
|
|
||||||
if (!(s_TileGroups[tile_groups].pIds = Bmalloc(n * sizeof(s_TileGroups[tile_groups].pIds[0]))))
|
if (!(s_TileGroups[tile_groups].pIds = (int32_t *)Bmalloc(n * sizeof(s_TileGroups[tile_groups].pIds[0]))))
|
||||||
TMPERRMSG_RETURN("Out of memory.");
|
TMPERRMSG_RETURN("Out of memory.");
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
|
@ -4269,8 +4269,8 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
|
||||||
if (small)
|
if (small)
|
||||||
x1 /= 2;
|
x1 /= 2;
|
||||||
|
|
||||||
x1 *= 320.0/xdimgame;
|
x1 = (int32_t)(x1 * 320.0/xdimgame);
|
||||||
scale /= (max(tilesizx[picnum],tilesizy[picnum])/24.0);
|
scale = (int32_t)(max(tilesizx[picnum],tilesizy[picnum])/24.0);
|
||||||
|
|
||||||
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
|
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
|
||||||
// +1024: prevents rotatesprite from setting aspect itself
|
// +1024: prevents rotatesprite from setting aspect itself
|
||||||
|
@ -4278,8 +4278,8 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
|
||||||
setaspect(oviewingrange, oyxaspect);
|
setaspect(oviewingrange, oyxaspect);
|
||||||
}
|
}
|
||||||
|
|
||||||
x *= xdimgame/320.0;
|
x = (int32_t)(x * xdimgame/320.0);
|
||||||
y *= ydimgame/200.0;
|
y = (int32_t)(y * ydimgame/200.0);
|
||||||
|
|
||||||
begindrawing();
|
begindrawing();
|
||||||
printext256(x+2,y+2,0,-1,title,small);
|
printext256(x+2,y+2,0,-1,title,small);
|
||||||
|
@ -4384,16 +4384,16 @@ static void getnumberptr256(const char *namestart, void *num, int32_t bytes, int
|
||||||
switch (bytes)
|
switch (bytes)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
getnumber_dochar(num, danum);
|
getnumber_dochar((char *)num, danum);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
getnumber_doint16_t(num, danum);
|
getnumber_doint16_t((int16_t *)num, danum);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
getnumber_doint32(num, danum);
|
getnumber_doint32((int32_t *)num, danum);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
getnumber_doint64(num, danum);
|
getnumber_doint64((int64_t *)num, danum);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4405,16 +4405,16 @@ static void getnumberptr256(const char *namestart, void *num, int32_t bytes, int
|
||||||
switch (bytes)
|
switch (bytes)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
getnumber_dochar(num, oldnum);
|
getnumber_dochar((char *)num, oldnum);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
getnumber_doint16_t(num, oldnum);
|
getnumber_doint16_t((int16_t *)num, oldnum);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
getnumber_doint32(num, oldnum);
|
getnumber_doint32((int32_t *)num, oldnum);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
getnumber_doint64(num, oldnum);
|
getnumber_doint64((int64_t *)num, oldnum);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4489,7 +4489,7 @@ ENDFOR1:
|
||||||
sprite[startspr].xoffset = -(((picanm[t])>>8)&255);
|
sprite[startspr].xoffset = -(((picanm[t])>>8)&255);
|
||||||
sprite[startspr].yoffset = -(((picanm[t])>>16)&255);
|
sprite[startspr].yoffset = -(((picanm[t])>>16)&255);
|
||||||
|
|
||||||
spritenums = Bmalloc(stackallocsize * sizeof(int16_t));
|
spritenums = (int16_t *)Bmalloc(stackallocsize * sizeof(int16_t));
|
||||||
if (!spritenums) goto ERROR_NOMEMORY;
|
if (!spritenums) goto ERROR_NOMEMORY;
|
||||||
|
|
||||||
cursor = insertsprite(sprite[startspr].sectnum,0);
|
cursor = insertsprite(sprite[startspr].sectnum,0);
|
||||||
|
@ -4556,7 +4556,7 @@ ENDFOR1:
|
||||||
ExtCheckKeys();
|
ExtCheckKeys();
|
||||||
|
|
||||||
printmessage256(0,0,"^251Text entry mode.^31 Navigation keys change vars.");
|
printmessage256(0,0,"^251Text entry mode.^31 Navigation keys change vars.");
|
||||||
Bsprintf(buffer, "Hgap=%d, Vgap=%d, SPCgap=%d, Shd=%d, Pal=%d",
|
Bsprintf_nowarn(buffer, "Hgap=%d, Vgap=%d, SPCgap=%d, Shd=%d, Pal=%d",
|
||||||
hgap, vgap, spcgap[alphidx], sprite[linebegspr].shade, sprite[linebegspr].pal);
|
hgap, vgap, spcgap[alphidx], sprite[linebegspr].shade, sprite[linebegspr].pal);
|
||||||
printmessage256(0, 9, buffer);
|
printmessage256(0, 9, buffer);
|
||||||
showframe(1);
|
showframe(1);
|
||||||
|
@ -4624,7 +4624,7 @@ ENDFOR1:
|
||||||
if (numletters >= stackallocsize)
|
if (numletters >= stackallocsize)
|
||||||
{
|
{
|
||||||
stackallocsize *= 2;
|
stackallocsize *= 2;
|
||||||
spritenums = Brealloc(spritenums, stackallocsize*sizeof(int16_t));
|
spritenums = (int16_t *)Brealloc(spritenums, stackallocsize*sizeof(int16_t));
|
||||||
if (!spritenums) goto ERROR_NOMEMORY;
|
if (!spritenums) goto ERROR_NOMEMORY;
|
||||||
}
|
}
|
||||||
spritenums[numletters++] = i;
|
spritenums[numletters++] = i;
|
||||||
|
@ -4818,7 +4818,7 @@ static void toggle_cf_flipping(int32_t sectnum, int32_t floorp)
|
||||||
|
|
||||||
static const int16_t orient[8] = { 360, -360, -180, 180, -270, 270, 90, -90 };
|
static const int16_t orient[8] = { 360, -360, -180, 180, -270, 270, 90, -90 };
|
||||||
|
|
||||||
int16_t *stat = &SECTORFLD(sectnum,stat, floorp);
|
uint16_t *stat = &SECTORFLD(sectnum,stat, floorp);
|
||||||
int32_t i = *stat;
|
int32_t i = *stat;
|
||||||
|
|
||||||
i = (i&0x4)+((i>>4)&3);
|
i = (i&0x4)+((i>>4)&3);
|
||||||
|
@ -4925,9 +4925,9 @@ static void Keys3d(void)
|
||||||
height3 = sector[nextsect].ceilingz - sector[searchsector].ceilingz;
|
height3 = sector[nextsect].ceilingz - sector[searchsector].ceilingz;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bsprintf(lines[num++],"Panning: %d, %d", wall[w].xpanning, wall[w].ypanning);
|
Bsprintf_nowarn(lines[num++],"Panning: %d, %d", wall[w].xpanning, wall[w].ypanning);
|
||||||
Bsprintf(lines[num++],"Repeat: %d, %d", wall[searchwall].xrepeat, wall[searchwall].yrepeat);
|
Bsprintf_nowarn(lines[num++],"Repeat: %d, %d", wall[searchwall].xrepeat, wall[searchwall].yrepeat);
|
||||||
Bsprintf(lines[num++],"Overpic: %d", wall[searchwall].overpicnum);
|
Bsprintf_nowarn(lines[num++],"Overpic: %d", wall[searchwall].overpicnum);
|
||||||
lines[num++][0]=0;
|
lines[num++][0]=0;
|
||||||
|
|
||||||
if (getmessageleng)
|
if (getmessageleng)
|
||||||
|
@ -4966,7 +4966,7 @@ static void Keys3d(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Bsprintf(lines[num++],"^251Sector %d^31 %s, Lotag:%s", searchsector, typestr[searchstat], ExtGetSectorCaption(searchsector));
|
Bsprintf(lines[num++],"^251Sector %d^31 %s, Lotag:%s", searchsector, typestr[searchstat], ExtGetSectorCaption(searchsector));
|
||||||
Bsprintf(lines[num++],"Height: %d, Visibility:%d", height2, sector[searchsector].visibility);
|
Bsprintf_nowarn(lines[num++],"Height: %d, Visibility:%d", height2, sector[searchsector].visibility);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEARCH_SPRITE:
|
case SEARCH_SPRITE:
|
||||||
|
@ -4974,10 +4974,10 @@ static void Keys3d(void)
|
||||||
sprite[searchwall].pal, sprite[searchwall].cstat, sprite[searchwall].lotag,
|
sprite[searchwall].pal, sprite[searchwall].cstat, sprite[searchwall].lotag,
|
||||||
sprite[searchwall].hitag, sprite[searchwall].extra,0);
|
sprite[searchwall].hitag, sprite[searchwall].extra,0);
|
||||||
|
|
||||||
Bsprintf(lines[num++], "Repeat: %d,%d", sprite[searchwall].xrepeat, sprite[searchwall].yrepeat);
|
Bsprintf_nowarn(lines[num++], "Repeat: %d,%d", sprite[searchwall].xrepeat, sprite[searchwall].yrepeat);
|
||||||
Bsprintf(lines[num++], "PosXY: %d,%d%s", sprite[searchwall].x, sprite[searchwall].y,
|
Bsprintf_nowarn(lines[num++], "PosXY: %d,%d%s", sprite[searchwall].x, sprite[searchwall].y,
|
||||||
sprite[searchwall].xoffset|sprite[searchwall].yoffset ? " ^251*":"");
|
sprite[searchwall].xoffset|sprite[searchwall].yoffset ? " ^251*":"");
|
||||||
Bsprintf(lines[num++], "PosZ: "" %d", sprite[searchwall].z);// prevents tab character
|
Bsprintf_nowarn(lines[num++], "PosZ: "" %d", sprite[searchwall].z);// prevents tab character
|
||||||
lines[num++][0]=0;
|
lines[num++][0]=0;
|
||||||
|
|
||||||
if (getmessageleng)
|
if (getmessageleng)
|
||||||
|
@ -4991,9 +4991,9 @@ static void Keys3d(void)
|
||||||
if (sprite[searchwall].picnum==SECTOREFFECTOR)
|
if (sprite[searchwall].picnum==SECTOREFFECTOR)
|
||||||
Bsprintf(lines[num++],"^251Sprite %d^31 %s", searchwall, SectorEffectorText(searchwall));
|
Bsprintf(lines[num++],"^251Sprite %d^31 %s", searchwall, SectorEffectorText(searchwall));
|
||||||
else
|
else
|
||||||
Bsprintf(lines[num++],"^251Sprite %d^31 %s", searchwall, names[sprite[searchwall].picnum]);
|
Bsprintf_nowarn(lines[num++],"^251Sprite %d^31 %s", searchwall, names[sprite[searchwall].picnum]);
|
||||||
}
|
}
|
||||||
else Bsprintf(lines[num++],"^251Sprite %d^31, picnum %d", searchwall, sprite[searchwall].picnum);
|
else Bsprintf_nowarn(lines[num++],"^251Sprite %d^31, picnum %d", searchwall, sprite[searchwall].picnum);
|
||||||
|
|
||||||
Bsprintf(lines[num++], "Elevation:%d",
|
Bsprintf(lines[num++], "Elevation:%d",
|
||||||
getflorzofslope(searchsector, sprite[searchwall].x, sprite[searchwall].y) - sprite[searchwall].z);
|
getflorzofslope(searchsector, sprite[searchwall].x, sprite[searchwall].y) - sprite[searchwall].z);
|
||||||
|
@ -5001,8 +5001,8 @@ static void Keys3d(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x = WIND1X*(xdimgame/320.);
|
x = (int32_t)(WIND1X*(xdimgame/320.));
|
||||||
y = WIND1Y*(ydimgame/200.);
|
y = (int32_t)(WIND1Y*(ydimgame/200.));
|
||||||
y += (ydimgame>>6)*8;
|
y += (ydimgame>>6)*8;
|
||||||
|
|
||||||
if (getmessageleng)
|
if (getmessageleng)
|
||||||
|
@ -5111,7 +5111,7 @@ static void Keys3d(void)
|
||||||
if (AIMING_AT_WALL_OR_MASK)
|
if (AIMING_AT_WALL_OR_MASK)
|
||||||
{
|
{
|
||||||
wall[searchwall].cstat &= YAX_NEXTWALLBITS;
|
wall[searchwall].cstat &= YAX_NEXTWALLBITS;
|
||||||
message("Wall %d cstat = %d", searchwall, wall[searchwall].cstat);
|
message_nowarn("Wall %d cstat = %d", searchwall, wall[searchwall].cstat);
|
||||||
}
|
}
|
||||||
else if (AIMING_AT_SPRITE)
|
else if (AIMING_AT_SPRITE)
|
||||||
{
|
{
|
||||||
|
@ -5277,7 +5277,7 @@ static void Keys3d(void)
|
||||||
{
|
{
|
||||||
sprite[searchwall].ang += tsign<<(!eitherSHIFT*7);
|
sprite[searchwall].ang += tsign<<(!eitherSHIFT*7);
|
||||||
sprite[searchwall].ang &= 2047;
|
sprite[searchwall].ang &= 2047;
|
||||||
message("Sprite %d angle: %d", searchwall, sprite[searchwall].ang);
|
message_nowarn("Sprite %d angle: %d", searchwall, sprite[searchwall].ang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5545,9 +5545,9 @@ static void Keys3d(void)
|
||||||
if (eitherCTRL) //CTRL
|
if (eitherCTRL) //CTRL
|
||||||
{
|
{
|
||||||
if (tsign==1)
|
if (tsign==1)
|
||||||
visibility <<= (visibility < 16384);
|
visibility <<= (int)(visibility < 16384);
|
||||||
else
|
else
|
||||||
visibility >>= (visibility > 32);
|
visibility >>= (int)(visibility > 32);
|
||||||
silentmessage("Global visibility %d", visibility);
|
silentmessage("Global visibility %d", visibility);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -6218,21 +6218,21 @@ static void Keys3d(void)
|
||||||
else if (AIMING_AT_CEILING_OR_FLOOR)
|
else if (AIMING_AT_CEILING_OR_FLOOR)
|
||||||
{
|
{
|
||||||
sector[searchsector].lotag =
|
sector[searchsector].lotag =
|
||||||
_getnumber256("Sector lotag: ", sector[searchsector].lotag, BTAG_MAX, 0, (void *)ExtGetSectorType);
|
_getnumber256("Sector lotag: ", sector[searchsector].lotag, BTAG_MAX, 0, (void *(*)(int32_t))ExtGetSectorType);
|
||||||
}
|
}
|
||||||
else if (AIMING_AT_SPRITE)
|
else if (AIMING_AT_SPRITE)
|
||||||
{
|
{
|
||||||
if (sprite[searchwall].picnum == SECTOREFFECTOR)
|
if (sprite[searchwall].picnum == SECTOREFFECTOR)
|
||||||
{
|
{
|
||||||
sprite[searchwall].lotag =
|
sprite[searchwall].lotag =
|
||||||
_getnumber256("Sprite lotag: ", sprite[searchwall].lotag, BTAG_MAX, 0+j, (void *)SectorEffectorTagText);
|
_getnumber256("Sprite lotag: ", sprite[searchwall].lotag, BTAG_MAX, 0+j, (void *(*)(int32_t))SectorEffectorTagText);
|
||||||
}
|
}
|
||||||
else if (sprite[searchwall].picnum == MUSICANDSFX)
|
else if (sprite[searchwall].picnum == MUSICANDSFX)
|
||||||
{
|
{
|
||||||
int16_t oldtag = sprite[searchwall].lotag;
|
int16_t oldtag = sprite[searchwall].lotag;
|
||||||
|
|
||||||
sprite[searchwall].lotag =
|
sprite[searchwall].lotag =
|
||||||
_getnumber256("Sprite lotag: ", sprite[searchwall].lotag, BTAG_MAX, 0+j, (void *)MusicAndSFXTagText);
|
_getnumber256("Sprite lotag: ", sprite[searchwall].lotag, BTAG_MAX, 0+j, (void *(*)(int32_t))MusicAndSFXTagText);
|
||||||
|
|
||||||
if ((sprite[searchwall].filler&1) && sprite[searchwall].lotag != oldtag)
|
if ((sprite[searchwall].filler&1) && sprite[searchwall].lotag != oldtag)
|
||||||
{
|
{
|
||||||
|
@ -6388,7 +6388,7 @@ static void Keys3d(void)
|
||||||
if (AIMING_AT_CEILING_OR_FLOOR) //Set masked/transluscent ceilings/floors
|
if (AIMING_AT_CEILING_OR_FLOOR) //Set masked/transluscent ceilings/floors
|
||||||
{
|
{
|
||||||
int32_t nexti[4] = { 128, 256, 384, 0 };
|
int32_t nexti[4] = { 128, 256, 384, 0 };
|
||||||
int16_t *stat = &AIMED_CEILINGFLOOR(stat);
|
uint16_t *stat = &AIMED_CEILINGFLOOR(stat);
|
||||||
const char *statmsg[4] = {"normal", "masked", "translucent", "translucent (2)"};
|
const char *statmsg[4] = {"normal", "masked", "translucent", "translucent (2)"};
|
||||||
|
|
||||||
i = (*stat&(128+256))>>7;
|
i = (*stat&(128+256))>>7;
|
||||||
|
@ -7870,7 +7870,7 @@ static void Keys2d(void)
|
||||||
j = 4*(j&1);
|
j = 4*(j&1);
|
||||||
Bsprintf(buffer,"Sprite (%d) Lo-tag: ", i);
|
Bsprintf(buffer,"Sprite (%d) Lo-tag: ", i);
|
||||||
sprite[i].lotag = _getnumber16(buffer, sprite[i].lotag, BTAG_MAX, 0+j, sprite[i].picnum==SECTOREFFECTOR ?
|
sprite[i].lotag = _getnumber16(buffer, sprite[i].lotag, BTAG_MAX, 0+j, sprite[i].picnum==SECTOREFFECTOR ?
|
||||||
(void *)SectorEffectorTagText : NULL);
|
(void *(*)(int32_t))SectorEffectorTagText : NULL);
|
||||||
}
|
}
|
||||||
else if (linehighlight >= 0)
|
else if (linehighlight >= 0)
|
||||||
{
|
{
|
||||||
|
@ -7894,7 +7894,7 @@ static void Keys2d(void)
|
||||||
{
|
{
|
||||||
Bsprintf(buffer,"Sector (%d) Lo-tag: ", tcursectornum);
|
Bsprintf(buffer,"Sector (%d) Lo-tag: ", tcursectornum);
|
||||||
sector[tcursectornum].lotag =
|
sector[tcursectornum].lotag =
|
||||||
_getnumber16(buffer, sector[tcursectornum].lotag, BTAG_MAX, 0, (void *)ExtGetSectorType);
|
_getnumber16(buffer, sector[tcursectornum].lotag, BTAG_MAX, 0, (void *(*)(int32_t))ExtGetSectorType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8477,7 +8477,7 @@ int32_t ExtPreSaveMap(void)
|
||||||
if (wall[j].point2 < startwall)
|
if (wall[j].point2 < startwall)
|
||||||
startwall = wall[j].point2;
|
startwall = wall[j].point2;
|
||||||
if (sector[i].wallptr != startwall)
|
if (sector[i].wallptr != startwall)
|
||||||
initprintf("Warning: set sector %d's wallptr to %d (was %d)\n", i,
|
initprintf_nowarn("Warning: set sector %d's wallptr to %d (was %d)\n", i,
|
||||||
sector[i].wallptr, startwall);
|
sector[i].wallptr, startwall);
|
||||||
sector[i].wallptr = startwall;
|
sector[i].wallptr = startwall;
|
||||||
}
|
}
|
||||||
|
@ -8570,14 +8570,14 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
if (argc <= 1)
|
if (argc <= 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lengths = Bmalloc(argc*sizeof(int32_t));
|
lengths = (int32_t *)Bmalloc(argc*sizeof(int32_t));
|
||||||
for (j=1; j<argc; j++)
|
for (j=1; j<argc; j++)
|
||||||
{
|
{
|
||||||
lengths[j] = Bstrlen(argv[j]);
|
lengths[j] = Bstrlen(argv[j]);
|
||||||
maxlen += lengths[j];
|
maxlen += lengths[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
testplay_addparam = Bmalloc(maxlen+argc);
|
testplay_addparam = (char *)Bmalloc(maxlen+argc);
|
||||||
testplay_addparam[0] = 0;
|
testplay_addparam[0] = 0;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
|
@ -8867,7 +8867,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
if (j > 0)
|
if (j > 0)
|
||||||
{
|
{
|
||||||
testplay_addparam[j-1] = 0;
|
testplay_addparam[j-1] = 0;
|
||||||
testplay_addparam = Brealloc(testplay_addparam, j*sizeof(char));
|
testplay_addparam = (char *)Brealloc(testplay_addparam, j*sizeof(char));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -9015,9 +9015,9 @@ static int32_t osdcmd_testplay_addparam(const osdfuncparm_t *parm)
|
||||||
if (slen > 0)
|
if (slen > 0)
|
||||||
{
|
{
|
||||||
if (!testplay_addparam)
|
if (!testplay_addparam)
|
||||||
testplay_addparam = Bmalloc(slen+1);
|
testplay_addparam = (char *)Bmalloc(slen+1);
|
||||||
else
|
else
|
||||||
testplay_addparam = Brealloc(testplay_addparam, slen+1);
|
testplay_addparam = (char *)Brealloc(testplay_addparam, slen+1);
|
||||||
|
|
||||||
Bmemcpy(testplay_addparam, parm->parms[0], slen);
|
Bmemcpy(testplay_addparam, parm->parms[0], slen);
|
||||||
testplay_addparam[slen] = 0;
|
testplay_addparam[slen] = 0;
|
||||||
|
@ -9369,7 +9369,7 @@ static int32_t osdcmd_do(const osdfuncparm_t *parm)
|
||||||
|
|
||||||
ofs = 2*(parm->numparms>0); // true if "do" command
|
ofs = 2*(parm->numparms>0); // true if "do" command
|
||||||
slen = Bstrlen(parm->raw+ofs);
|
slen = Bstrlen(parm->raw+ofs);
|
||||||
tp = Bmalloc(slen+2);
|
tp = (char *)Bmalloc(slen+2);
|
||||||
if (!tp) goto OUTOFMEM;
|
if (!tp) goto OUTOFMEM;
|
||||||
Bmemcpy(tp, parm->raw+ofs, slen);
|
Bmemcpy(tp, parm->raw+ofs, slen);
|
||||||
|
|
||||||
|
@ -9893,7 +9893,7 @@ int32_t parsetilegroups(scriptfile *script)
|
||||||
if (scriptfile_getstring(script,&name)) break;
|
if (scriptfile_getstring(script,&name)) break;
|
||||||
if (scriptfile_getbraces(script,&end)) break;
|
if (scriptfile_getbraces(script,&end)) break;
|
||||||
|
|
||||||
s_TileGroups[tile_groups].pIds = Bcalloc(MAX_TILE_GROUP_ENTRIES, sizeof(int32_t));
|
s_TileGroups[tile_groups].pIds = (int32_t *)Bcalloc(MAX_TILE_GROUP_ENTRIES, sizeof(int32_t));
|
||||||
s_TileGroups[tile_groups].szText = Bstrdup(name);
|
s_TileGroups[tile_groups].szText = Bstrdup(name);
|
||||||
|
|
||||||
while (script->textptr < end)
|
while (script->textptr < end)
|
||||||
|
@ -9968,7 +9968,7 @@ int32_t parsetilegroups(scriptfile *script)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s_TileGroups[tile_groups].pIds = Brealloc(s_TileGroups[tile_groups].pIds,
|
s_TileGroups[tile_groups].pIds = (int32_t *)Brealloc(s_TileGroups[tile_groups].pIds,
|
||||||
s_TileGroups[tile_groups].nIds*sizeof(int32_t));
|
s_TileGroups[tile_groups].nIds*sizeof(int32_t));
|
||||||
tile_groups++;
|
tile_groups++;
|
||||||
break;
|
break;
|
||||||
|
@ -10122,7 +10122,7 @@ static int32_t loadtilegroups(const char *fn)
|
||||||
#if 0
|
#if 0
|
||||||
// ---------- Init hardcoded tile group consisting of all named tiles
|
// ---------- Init hardcoded tile group consisting of all named tiles
|
||||||
s_TileGroups[0].szText = Bstrdup("All named");
|
s_TileGroups[0].szText = Bstrdup("All named");
|
||||||
s_TileGroups[0].pIds = Bmalloc(MAXTILES * sizeof(s_TileGroups[0].pIds[0]));
|
s_TileGroups[0].pIds = (int32_t *)Bmalloc(MAXTILES * sizeof(s_TileGroups[0].pIds[0]));
|
||||||
if (!s_TileGroups[0].pIds)
|
if (!s_TileGroups[0].pIds)
|
||||||
return -1;
|
return -1;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
@ -10282,7 +10282,7 @@ static int32_t parseconsounds(scriptfile *script)
|
||||||
duplicate = 1;
|
duplicate = 1;
|
||||||
Bfree(g_sounds[sndnum].filename);
|
Bfree(g_sounds[sndnum].filename);
|
||||||
}
|
}
|
||||||
g_sounds[sndnum].filename = Bcalloc(slen+1,sizeof(uint8_t));
|
g_sounds[sndnum].filename = (char *)Bcalloc(slen+1,sizeof(uint8_t));
|
||||||
// Hopefully noone does memcpy(..., g_sounds[].filename, BMAX_PATH)
|
// Hopefully noone does memcpy(..., g_sounds[].filename, BMAX_PATH)
|
||||||
if (!g_sounds[sndnum].filename)
|
if (!g_sounds[sndnum].filename)
|
||||||
{
|
{
|
||||||
|
@ -10762,7 +10762,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
}
|
}
|
||||||
if (check_prlight_colors(i))
|
if (check_prlight_colors(i))
|
||||||
copy_prlight_colors(spritelightptr[i], i);
|
copy_prlight_colors(spritelightptr[i], i);
|
||||||
if (!!(CS & 128) != spritelightptr[i]->publicflags.negative)
|
if ((int)!!(CS & 128) != spritelightptr[i]->publicflags.negative)
|
||||||
{
|
{
|
||||||
spritelightptr[i]->publicflags.negative = !!(CS & 128);
|
spritelightptr[i]->publicflags.negative = !!(CS & 128);
|
||||||
}
|
}
|
||||||
|
@ -10816,11 +10816,11 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
spritelightptr[i]->horiz = SH;
|
spritelightptr[i]->horiz = SH;
|
||||||
spritelightptr[i]->flags.invalidate = 1;
|
spritelightptr[i]->flags.invalidate = 1;
|
||||||
}
|
}
|
||||||
if (!(CS & 64) != spritelightptr[i]->publicflags.emitshadow)
|
if ((int)!(CS & 64) != spritelightptr[i]->publicflags.emitshadow)
|
||||||
{
|
{
|
||||||
spritelightptr[i]->publicflags.emitshadow = !(CS & 64);
|
spritelightptr[i]->publicflags.emitshadow = !(CS & 64);
|
||||||
}
|
}
|
||||||
if (!!(CS & 128) != spritelightptr[i]->publicflags.negative)
|
if ((int)!!(CS & 128) != spritelightptr[i]->publicflags.negative)
|
||||||
{
|
{
|
||||||
spritelightptr[i]->publicflags.negative = !!(CS & 128);
|
spritelightptr[i]->publicflags.negative = !!(CS & 128);
|
||||||
}
|
}
|
||||||
|
@ -11020,7 +11020,7 @@ void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr
|
||||||
if (showinvisibility && (tspr->cstat&32768))
|
if (showinvisibility && (tspr->cstat&32768))
|
||||||
{
|
{
|
||||||
tspr->pal = 6;
|
tspr->pal = 6;
|
||||||
tspr->cstat &= ~32768;
|
tspr->cstat &= (uint16_t)~32768;
|
||||||
tspr->cstat |= 2+512;
|
tspr->cstat |= 2+512;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11444,6 +11444,7 @@ void ExtCheckKeys(void)
|
||||||
//#define CCHKPREF OSDTEXT_RED "^O"
|
//#define CCHKPREF OSDTEXT_RED "^O"
|
||||||
#define CCHK_CORRECTED OSDTEXT_GREEN " -> "
|
#define CCHK_CORRECTED OSDTEXT_GREEN " -> "
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#define CORRUPTCHK_PRINT(errlev, what, fmt, ...) do \
|
#define CORRUPTCHK_PRINT(errlev, what, fmt, ...) do \
|
||||||
{ \
|
{ \
|
||||||
bad = max(bad, errlev); \
|
bad = max(bad, errlev); \
|
||||||
|
@ -11453,7 +11454,17 @@ void ExtCheckKeys(void)
|
||||||
if (errlev >= printfromlev) \
|
if (errlev >= printfromlev) \
|
||||||
OSD_Printf("#%d: " fmt "\n", numcorruptthings, ## __VA_ARGS__); \
|
OSD_Printf("#%d: " fmt "\n", numcorruptthings, ## __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define CORRUPTCHK_PRINT(errlev, what, fmt, ...) do \
|
||||||
|
{ \
|
||||||
|
bad = max(bad, errlev); \
|
||||||
|
if (numcorruptthings>=MAXCORRUPTTHINGS) \
|
||||||
|
goto too_many_errors; \
|
||||||
|
corruptthings[numcorruptthings++] = (what); \
|
||||||
|
if (errlev >= printfromlev) \
|
||||||
|
OSD_Printf_nowarn("#%d: " fmt "\n", numcorruptthings, ## __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
static int32_t walls_have_equal_endpoints(int32_t w1, int32_t w2)
|
static int32_t walls_have_equal_endpoints(int32_t w1, int32_t w2)
|
||||||
{
|
{
|
||||||
|
@ -11728,9 +11739,9 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
|
||||||
|
|
||||||
if (!corruptcheck_noalreadyrefd)
|
if (!corruptcheck_noalreadyrefd)
|
||||||
{
|
{
|
||||||
seen_nextwalls = Bcalloc((numwalls+7)>>3,1);
|
seen_nextwalls = (uint8_t *)Bcalloc((numwalls+7)>>3,1);
|
||||||
if (!seen_nextwalls) return 5;
|
if (!seen_nextwalls) return 5;
|
||||||
lastnextwallsource = Bmalloc(numwalls*sizeof(lastnextwallsource[0]));
|
lastnextwallsource = (int16_t *)Bmalloc(numwalls*sizeof(lastnextwallsource[0]));
|
||||||
if (!lastnextwallsource) { Bfree(seen_nextwalls); return 5; }
|
if (!lastnextwallsource) { Bfree(seen_nextwalls); return 5; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12339,7 +12350,8 @@ static void EditSectorData(int16_t sectnum)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)pan: %d, %d",sector[sectnum].ceilingxpanning,sector[sectnum].ceilingypanning); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)pan: %d, %d",sector[sectnum].ceilingxpanning,sector[sectnum].ceilingypanning);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Sector %d Ceiling X Pan: ",sectnum);
|
Bsprintf(med_edittext,"Sector %d Ceiling X Pan: ",sectnum);
|
||||||
|
@ -12389,7 +12401,8 @@ static void EditSectorData(int16_t sectnum)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)pan: %d, %d",sector[sectnum].floorxpanning,sector[sectnum].floorypanning); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)pan: %d, %d",sector[sectnum].floorxpanning,sector[sectnum].floorypanning);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Sector %d Floor X Pan: ",sectnum);
|
Bsprintf(med_edittext,"Sector %d Floor X Pan: ",sectnum);
|
||||||
|
@ -12478,7 +12491,8 @@ static void EditWallData(int16_t wallnum)
|
||||||
sizeof(wall[wallnum].pal), M32_MAXPALOOKUPS, 0);
|
sizeof(wall[wallnum].pal), M32_MAXPALOOKUPS, 0);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)repeat: %d, %d",wall[wallnum].xrepeat,wall[wallnum].yrepeat); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)repeat: %d, %d",wall[wallnum].xrepeat,wall[wallnum].yrepeat);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Wall %d X Repeat: ",wallnum);
|
Bsprintf(med_edittext,"Wall %d X Repeat: ",wallnum);
|
||||||
|
@ -12490,7 +12504,8 @@ static void EditWallData(int16_t wallnum)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)pan: %d, %d",wall[wallnum].xpanning,wall[wallnum].ypanning); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)pan: %d, %d",wall[wallnum].xpanning,wall[wallnum].ypanning);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Wall %d X Pan: ",wallnum);
|
Bsprintf(med_edittext,"Wall %d X Pan: ",wallnum);
|
||||||
|
@ -12669,7 +12684,8 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)repeat: %d, %d",sprite[spritenum].xrepeat,sprite[spritenum].yrepeat); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)repeat: %d, %d",sprite[spritenum].xrepeat,sprite[spritenum].yrepeat);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Sprite %d X Repeat: ",spritenum);
|
Bsprintf(med_edittext,"Sprite %d X Repeat: ",spritenum);
|
||||||
|
@ -12683,7 +12699,8 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
for (i=Bsprintf(med_disptext,"(X,Y)offset: %d, %d",sprite[spritenum].xoffset,sprite[spritenum].yoffset); i < med_dispwidth; i++) med_disptext[i] = ' ';
|
Bsprintf_nowarn_return(i, med_disptext,"(X,Y)offset: %d, %d",sprite[spritenum].xoffset,sprite[spritenum].yoffset);
|
||||||
|
for (; i < med_dispwidth; i++) med_disptext[i] = ' ';
|
||||||
if (med_editval)
|
if (med_editval)
|
||||||
{
|
{
|
||||||
Bsprintf(med_edittext,"Sprite %d X Offset: ",spritenum);
|
Bsprintf(med_edittext,"Sprite %d X Offset: ",spritenum);
|
||||||
|
@ -13125,7 +13142,7 @@ static void FuncMenu(void)
|
||||||
{
|
{
|
||||||
char *statename = statesinfo[funcMenuStatenum[(col-1)*8 + row]].name;
|
char *statename = statesinfo[funcMenuStatenum[(col-1)*8 + row]].name;
|
||||||
int32_t snlen = Bstrlen(statename);
|
int32_t snlen = Bstrlen(statename);
|
||||||
char *tmpscript = Bmalloc(1+5+1+snlen+1);
|
char *tmpscript = (char *)Bmalloc(1+5+1+snlen+1);
|
||||||
|
|
||||||
if (!tmpscript)
|
if (!tmpscript)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -146,7 +146,7 @@ void G_AddGroup(const char *buffer)
|
||||||
{
|
{
|
||||||
char buf[BMAX_PATH];
|
char buf[BMAX_PATH];
|
||||||
|
|
||||||
struct strllist *s = Bcalloc(1,sizeof(struct strllist));
|
struct strllist *s = (struct strllist *)Bcalloc(1,sizeof(struct strllist));
|
||||||
|
|
||||||
Bstrcpy(buf, buffer);
|
Bstrcpy(buf, buffer);
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ void G_AddGroup(const char *buffer)
|
||||||
|
|
||||||
void G_AddPath(const char *buffer)
|
void G_AddPath(const char *buffer)
|
||||||
{
|
{
|
||||||
struct strllist *s = Bcalloc(1,sizeof(struct strllist));
|
struct strllist *s = (struct strllist *)Bcalloc(1,sizeof(struct strllist));
|
||||||
s->str = Bstrdup(buffer);
|
s->str = Bstrdup(buffer);
|
||||||
|
|
||||||
if (CommandPaths)
|
if (CommandPaths)
|
||||||
|
@ -311,7 +311,7 @@ void G_DoAutoload(const char *dirname)
|
||||||
// returns a buffer of size BMAX_PATH
|
// returns a buffer of size BMAX_PATH
|
||||||
char *dup_filename(const char *fn)
|
char *dup_filename(const char *fn)
|
||||||
{
|
{
|
||||||
char *buf = Bmalloc(BMAX_PATH);
|
char *buf = (char *)Bmalloc(BMAX_PATH);
|
||||||
|
|
||||||
return Bstrncpyz(buf, fn, BMAX_PATH);
|
return Bstrncpyz(buf, fn, BMAX_PATH);
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,7 +603,7 @@ int32_t CONFIG_ReadSetup(void)
|
||||||
// #ifdef _WIN32
|
// #ifdef _WIN32
|
||||||
if (g_noSetup == 0 && g_modDir[0] == '/')
|
if (g_noSetup == 0 && g_modDir[0] == '/')
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct Bstat st;
|
||||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
|
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
|
||||||
|
|
||||||
if (Bstat(g_modDir, &st))
|
if (Bstat(g_modDir, &st))
|
||||||
|
@ -792,7 +792,7 @@ void CONFIG_WriteSetup(uint32_t flags)
|
||||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,FALSE,FALSE); // JBF 20031206
|
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,FALSE,FALSE); // JBF 20031206
|
||||||
|
|
||||||
|
|
||||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",g_grpNamePtr);
|
||||||
|
|
||||||
// XXX: should be "if compiled without startup GUI"
|
// XXX: should be "if compiled without startup GUI"
|
||||||
#if !defined __linux || defined HAVE_GTK2
|
#if !defined __linux || defined HAVE_GTK2
|
||||||
|
|
|
@ -728,7 +728,7 @@ nextdemo_nomenu:
|
||||||
|
|
||||||
if (Demo_IsProfiling())
|
if (Demo_IsProfiling())
|
||||||
{
|
{
|
||||||
int32_t t = gethitickms();
|
int32_t t = (int32_t)gethitickms();
|
||||||
G_DoMoveThings();
|
G_DoMoveThings();
|
||||||
Demo_GToc(t);
|
Demo_GToc(t);
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ enet_symbol_rescale (ENetSymbol * symbol)
|
||||||
if((encodeLow ^ (encodeLow + encodeRange)) >= ENET_RANGE_CODER_TOP) \
|
if((encodeLow ^ (encodeLow + encodeRange)) >= ENET_RANGE_CODER_TOP) \
|
||||||
{ \
|
{ \
|
||||||
if(encodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
if(encodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
||||||
encodeRange = -encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
encodeRange = -(signed)encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||||
} \
|
} \
|
||||||
ENET_RANGE_CODER_OUTPUT (encodeLow >> 24); \
|
ENET_RANGE_CODER_OUTPUT (encodeLow >> 24); \
|
||||||
encodeRange <<= 8; \
|
encodeRange <<= 8; \
|
||||||
|
@ -360,7 +360,7 @@ enet_range_coder_compress (void * context, const ENetBuffer * inBuffers, size_t
|
||||||
if((decodeLow ^ (decodeLow + decodeRange)) >= ENET_RANGE_CODER_TOP) \
|
if((decodeLow ^ (decodeLow + decodeRange)) >= ENET_RANGE_CODER_TOP) \
|
||||||
{ \
|
{ \
|
||||||
if(decodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
if(decodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
||||||
decodeRange = -decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
decodeRange = -(signed)decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||||
} \
|
} \
|
||||||
decodeCode <<= 8; \
|
decodeCode <<= 8; \
|
||||||
if (inData < inEnd) \
|
if (inData < inEnd) \
|
||||||
|
|
|
@ -430,7 +430,7 @@ enet_peer_ping (ENetPeer * peer)
|
||||||
void
|
void
|
||||||
enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
|
enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
|
||||||
{
|
{
|
||||||
peer -> pingInterval = pingInterval ? pingInterval : ENET_PEER_PING_INTERVAL;
|
peer -> pingInterval = pingInterval ? pingInterval : (enet_uint32)ENET_PEER_PING_INTERVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the timeout parameters for a peer.
|
/** Sets the timeout parameters for a peer.
|
||||||
|
@ -453,9 +453,9 @@ enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
|
||||||
void
|
void
|
||||||
enet_peer_timeout (ENetPeer * peer, enet_uint32 timeoutLimit, enet_uint32 timeoutMinimum, enet_uint32 timeoutMaximum)
|
enet_peer_timeout (ENetPeer * peer, enet_uint32 timeoutLimit, enet_uint32 timeoutMinimum, enet_uint32 timeoutMaximum)
|
||||||
{
|
{
|
||||||
peer -> timeoutLimit = timeoutLimit ? timeoutLimit : ENET_PEER_TIMEOUT_LIMIT;
|
peer -> timeoutLimit = timeoutLimit ? timeoutLimit : (enet_uint32)ENET_PEER_TIMEOUT_LIMIT;
|
||||||
peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : ENET_PEER_TIMEOUT_MINIMUM;
|
peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : (enet_uint32)ENET_PEER_TIMEOUT_MINIMUM;
|
||||||
peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : ENET_PEER_TIMEOUT_MAXIMUM;
|
peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : (enet_uint32)ENET_PEER_TIMEOUT_MAXIMUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Force an immediate disconnection from a peer.
|
/** Force an immediate disconnection from a peer.
|
||||||
|
|
|
@ -61,6 +61,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "common_game.h"
|
#include "common_game.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#ifdef LUNATIC
|
#ifdef LUNATIC
|
||||||
# include "lunatic_game.h"
|
# include "lunatic_game.h"
|
||||||
|
@ -1725,7 +1726,7 @@ static void G_PrintCoords(int32_t snum)
|
||||||
Bsprintf(tempbuf,"OG= %d SBRIDGE=%d SBS=%d",ps->on_ground, ps->spritebridge, ps->sbs);
|
Bsprintf(tempbuf,"OG= %d SBRIDGE=%d SBS=%d",ps->on_ground, ps->spritebridge, ps->sbs);
|
||||||
printext256(x,y+27,31,-1,tempbuf,0);
|
printext256(x,y+27,31,-1,tempbuf,0);
|
||||||
if (sectnum >= 0)
|
if (sectnum >= 0)
|
||||||
Bsprintf(tempbuf,"SECT= %d (LO=%d EX=%d)",sectnum,sector[sectnum].lotag,sector[sectnum].extra);
|
Bsprintf_nowarn(tempbuf,"SECT= %d (LO=%d EX=%d)",sectnum,sector[sectnum].lotag,sector[sectnum].extra);
|
||||||
else
|
else
|
||||||
Bsprintf(tempbuf,"SECT= %d", sectnum);
|
Bsprintf(tempbuf,"SECT= %d", sectnum);
|
||||||
printext256(x,y+36,31,-1,tempbuf,0);
|
printext256(x,y+36,31,-1,tempbuf,0);
|
||||||
|
@ -3584,8 +3585,8 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
// If the view is rotated (not 0 or 180 degrees modulo 360 degrees),
|
// If the view is rotated (not 0 or 180 degrees modulo 360 degrees),
|
||||||
// we render onto a square tile and display a portion of that
|
// we render onto a square tile and display a portion of that
|
||||||
// rotated on-screen later on.
|
// rotated on-screen later on.
|
||||||
const int32_t viewtilexsiz = ((tang&1023) ? tiltcx : tiltcy)>>!ud.detail;
|
const int32_t viewtilexsiz = ((tang&1023) ? tiltcx : tiltcy)>>(int)!ud.detail;
|
||||||
const int32_t viewtileysiz = tiltcx>>!ud.detail;
|
const int32_t viewtileysiz = tiltcx>>(int)!ud.detail;
|
||||||
|
|
||||||
walock[TILE_TILT] = 255;
|
walock[TILE_TILT] = 255;
|
||||||
if (waloff[TILE_TILT] == 0)
|
if (waloff[TILE_TILT] == 0)
|
||||||
|
@ -3597,8 +3598,8 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
if ((tang&1023) == 512)
|
if ((tang&1023) == 512)
|
||||||
{
|
{
|
||||||
//Block off unscreen section of 90ø tilted screen
|
//Block off unscreen section of 90ø tilted screen
|
||||||
j = ((tiltcx-(60*tiltcs))>>!ud.detail);
|
j = ((tiltcx-(60*tiltcs))>>(int)!ud.detail);
|
||||||
for (i=((60*tiltcs)>>!ud.detail)-1; i>=0; i--)
|
for (i=((60*tiltcs)>>(int)!ud.detail)-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
startumost[i] = 1;
|
startumost[i] = 1;
|
||||||
startumost[i+j] = 1;
|
startumost[i+j] = 1;
|
||||||
|
@ -3802,7 +3803,7 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
// NOTE: maybe need to move this to the engine...
|
// NOTE: maybe need to move this to the engine...
|
||||||
begindrawing();
|
begindrawing();
|
||||||
{
|
{
|
||||||
palette_t *const frame = Bcalloc(xdim*ydim, 4);
|
palette_t *const frame = (palette_t *const)Bcalloc(xdim*ydim, 4);
|
||||||
char *const pic = (char *)waloff[TILE_SAVESHOT];
|
char *const pic = (char *)waloff[TILE_SAVESHOT];
|
||||||
|
|
||||||
int32_t x, y;
|
int32_t x, y;
|
||||||
|
@ -3907,12 +3908,13 @@ static void G_DumpDebugInfo(void)
|
||||||
}
|
}
|
||||||
OSD_Printf("\n");
|
OSD_Printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x=0; x<MAXSTATUS; x++)
|
for (x=0; x<MAXSTATUS; x++)
|
||||||
{
|
{
|
||||||
j = headspritestat[x];
|
j = headspritestat[x];
|
||||||
while (j >= 0)
|
while (j >= 0)
|
||||||
{
|
{
|
||||||
OSD_Printf("Sprite %d (%d,%d,%d) (picnum: %d)\n",j,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].picnum);
|
OSD_Printf_nowarn("Sprite %d (%d,%d,%d) (picnum: %d)\n",j,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].picnum);
|
||||||
for (i=0; i<g_gameVarCount; i++)
|
for (i=0; i<g_gameVarCount; i++)
|
||||||
{
|
{
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_PERACTOR))
|
if (aGameVars[i].dwFlags & (GAMEVAR_PERACTOR))
|
||||||
|
@ -3969,7 +3971,7 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
{
|
{
|
||||||
G_DumpDebugInfo();
|
G_DumpDebugInfo();
|
||||||
OSD_Printf("Failed spawning pic %d spr from pic %d spr %d at x:%d,y:%d,z:%d,sect:%d\n",
|
OSD_Printf_nowarn("Failed spawning pic %d spr from pic %d spr %d at x:%d,y:%d,z:%d,sect:%d\n",
|
||||||
s_pn,sprite[s_ow].picnum,s_ow,s_x,s_y,s_z,whatsect);
|
s_pn,sprite[s_ow].picnum,s_ow,s_x,s_y,s_z,whatsect);
|
||||||
G_GameExit("Too many sprites spawned.");
|
G_GameExit("Too many sprites spawned.");
|
||||||
}
|
}
|
||||||
|
@ -4984,7 +4986,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
if (sp->hitag && sp->picnum == WATERBUBBLEMAKER)
|
if (sp->hitag && sp->picnum == WATERBUBBLEMAKER)
|
||||||
{
|
{
|
||||||
// JBF 20030913: Pisses off X_Move(), eg. in bobsp2
|
// JBF 20030913: Pisses off X_Move(), eg. in bobsp2
|
||||||
OSD_Printf(OSD_ERROR "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
OSD_Printf_nowarn(OSD_ERROR "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
||||||
i,sp->x,sp->y);
|
i,sp->x,sp->y);
|
||||||
sp->hitag = 0;
|
sp->hitag = 0;
|
||||||
}
|
}
|
||||||
|
@ -5590,7 +5592,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// XXX: we should return to the menu for this and similar failures
|
// XXX: we should return to the menu for this and similar failures
|
||||||
Bsprintf(tempbuf, "SE 17 (warp elevator) setup failed: sprite %d at (%d, %d)",
|
Bsprintf_nowarn(tempbuf, "SE 17 (warp elevator) setup failed: sprite %d at (%d, %d)",
|
||||||
i, sprite[i].x, sprite[i].y);
|
i, sprite[i].x, sprite[i].y);
|
||||||
G_GameExit(tempbuf);
|
G_GameExit(tempbuf);
|
||||||
}
|
}
|
||||||
|
@ -5795,7 +5797,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
}
|
}
|
||||||
if (j == -1)
|
if (j == -1)
|
||||||
{
|
{
|
||||||
OSD_Printf(OSD_ERROR "Found lonely Sector Effector (lotag 0) at (%d,%d)\n",sp->x,sp->y);
|
OSD_Printf_nowarn(OSD_ERROR "Found lonely Sector Effector (lotag 0) at (%d,%d)\n",sp->x,sp->y);
|
||||||
changespritestat(i, STAT_ACTOR);
|
changespritestat(i, STAT_ACTOR);
|
||||||
if (apScriptGameEvent[EVENT_SPAWN])
|
if (apScriptGameEvent[EVENT_SPAWN])
|
||||||
{
|
{
|
||||||
|
@ -5818,7 +5820,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
tempwallptr++;
|
tempwallptr++;
|
||||||
if (tempwallptr > 2047)
|
if (tempwallptr > 2047)
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Too many moving sectors at (%d,%d).\n",wall[s].x,wall[s].y);
|
Bsprintf_nowarn(tempbuf,"Too many moving sectors at (%d,%d).\n",wall[s].x,wall[s].y);
|
||||||
G_GameExit(tempbuf);
|
G_GameExit(tempbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5831,7 +5833,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
startwall = sector[sect].wallptr;
|
startwall = sector[sect].wallptr;
|
||||||
endwall = startwall+sector[sect].wallnum;
|
endwall = startwall+sector[sect].wallnum;
|
||||||
|
|
||||||
if (sector[sect].hitag == -1)
|
if (sector[sect].hitag == UINT16_MAX)
|
||||||
sp->extra = 0;
|
sp->extra = 0;
|
||||||
else sp->extra = 1;
|
else sp->extra = 1;
|
||||||
|
|
||||||
|
@ -5876,7 +5878,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
#endif
|
#endif
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Subway found no zero'd sectors with locators\nat (%d,%d).\n",sp->x,sp->y);
|
Bsprintf_nowarn(tempbuf,"Subway found no zero'd sectors with locators\nat (%d,%d).\n",sp->x,sp->y);
|
||||||
G_GameExit(tempbuf);
|
G_GameExit(tempbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7672,7 +7674,7 @@ void G_HandleLocalKeys(void)
|
||||||
if (KB_KeyPressed(sc_kpad_6))
|
if (KB_KeyPressed(sc_kpad_6))
|
||||||
{
|
{
|
||||||
KB_ClearKeyDown(sc_kpad_6);
|
KB_ClearKeyDown(sc_kpad_6);
|
||||||
j = (15<<ALT_IS_PRESSED)<<(2*SHIFTS_IS_PRESSED);
|
j = (15<<(int)ALT_IS_PRESSED)<<(2*(int)SHIFTS_IS_PRESSED);
|
||||||
g_demo_goalCnt = g_demo_paused ? g_demo_cnt+1 : g_demo_cnt+REALGAMETICSPERSEC*j;
|
g_demo_goalCnt = g_demo_paused ? g_demo_cnt+1 : g_demo_cnt+REALGAMETICSPERSEC*j;
|
||||||
g_demo_rewind = 0;
|
g_demo_rewind = 0;
|
||||||
|
|
||||||
|
@ -7684,7 +7686,7 @@ void G_HandleLocalKeys(void)
|
||||||
else if (KB_KeyPressed(sc_kpad_4))
|
else if (KB_KeyPressed(sc_kpad_4))
|
||||||
{
|
{
|
||||||
KB_ClearKeyDown(sc_kpad_4);
|
KB_ClearKeyDown(sc_kpad_4);
|
||||||
j = (15<<ALT_IS_PRESSED)<<(2*SHIFTS_IS_PRESSED);
|
j = (15<<(int)ALT_IS_PRESSED)<<(2*(int)SHIFTS_IS_PRESSED);
|
||||||
g_demo_goalCnt = g_demo_paused ? g_demo_cnt-1 : g_demo_cnt-REALGAMETICSPERSEC*j;
|
g_demo_goalCnt = g_demo_paused ? g_demo_cnt-1 : g_demo_cnt-REALGAMETICSPERSEC*j;
|
||||||
g_demo_rewind = 1;
|
g_demo_rewind = 1;
|
||||||
|
|
||||||
|
@ -8424,7 +8426,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preload)
|
if (!preload)
|
||||||
anim_hi_sounds[animnum] = Bcalloc(allocsz, 2*sizeof(anim_hi_sounds[0]));
|
anim_hi_sounds[animnum] = (uint16_t *)Bcalloc(allocsz, 2*sizeof(anim_hi_sounds[0]));
|
||||||
while (script->textptr < animsoundsend)
|
while (script->textptr < animsoundsend)
|
||||||
{
|
{
|
||||||
int32_t framenum, soundnum;
|
int32_t framenum, soundnum;
|
||||||
|
@ -8485,7 +8487,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload)
|
||||||
newptr = Brealloc(anim_hi_sounds[animnum], allocsz*2*sizeof(anim_hi_sounds[0]));
|
newptr = Brealloc(anim_hi_sounds[animnum], allocsz*2*sizeof(anim_hi_sounds[0]));
|
||||||
|
|
||||||
if (!newptr) break;
|
if (!newptr) break;
|
||||||
anim_hi_sounds[animnum] = newptr;
|
anim_hi_sounds[animnum] = (uint16_t *)newptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bad=0;
|
bad=0;
|
||||||
|
@ -8968,7 +8970,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
{
|
{
|
||||||
char *colon = Bstrchr(c, ':');
|
char * colon = (char *)Bstrchr(c, ':');
|
||||||
int32_t framespertic=-1, numrepeats=1;
|
int32_t framespertic=-1, numrepeats=1;
|
||||||
|
|
||||||
c++;
|
c++;
|
||||||
|
@ -9511,8 +9513,8 @@ static void G_CompileScripts(void)
|
||||||
char *newlabel;
|
char *newlabel;
|
||||||
int32_t *newlabelcode;
|
int32_t *newlabelcode;
|
||||||
|
|
||||||
newlabel = Bmalloc(g_numLabels<<6);
|
newlabel = (char *)Bmalloc(g_numLabels<<6);
|
||||||
newlabelcode = Bmalloc(g_numLabels*sizeof(int32_t));
|
newlabelcode = (int32_t *)Bmalloc(g_numLabels*sizeof(int32_t));
|
||||||
|
|
||||||
if (!newlabel || !newlabelcode)
|
if (!newlabel || !newlabelcode)
|
||||||
G_GameExit("Error: out of memory retaining labels\n");
|
G_GameExit("Error: out of memory retaining labels\n");
|
||||||
|
@ -9949,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__)
|
||||||
|
@ -10397,7 +10405,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
if (g_networkMode != NET_DEDICATED_SERVER)
|
if (g_networkMode != NET_DEDICATED_SERVER)
|
||||||
{
|
{
|
||||||
if (CONTROL_Startup(1, &GetTime, TICRATE))
|
if (CONTROL_Startup(controltype_keyboardandmouse, &GetTime, TICRATE))
|
||||||
{
|
{
|
||||||
ERRprintf("There was an error initializing the CONTROL system.\n");
|
ERRprintf("There was an error initializing the CONTROL system.\n");
|
||||||
uninitengine();
|
uninitengine();
|
||||||
|
|
|
@ -1206,7 +1206,7 @@ static int32_t C_SetScriptSize(int32_t newsize)
|
||||||
char *scriptptrs;
|
char *scriptptrs;
|
||||||
char *newbitptr;
|
char *newbitptr;
|
||||||
|
|
||||||
scriptptrs = Bcalloc(1, g_scriptSize * sizeof(uint8_t));
|
scriptptrs = (char *)Bcalloc(1, g_scriptSize * sizeof(uint8_t));
|
||||||
|
|
||||||
for (i=g_scriptSize-1; i>=0; i--)
|
for (i=g_scriptSize-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
|
@ -1231,7 +1231,7 @@ static int32_t C_SetScriptSize(int32_t newsize)
|
||||||
initprintf("Resizing code buffer to %d*%d bytes\n",newsize, (int32_t)sizeof(intptr_t));
|
initprintf("Resizing code buffer to %d*%d bytes\n",newsize, (int32_t)sizeof(intptr_t));
|
||||||
|
|
||||||
newscript = (intptr_t *)Brealloc(script, newsize * sizeof(intptr_t));
|
newscript = (intptr_t *)Brealloc(script, newsize * sizeof(intptr_t));
|
||||||
newbitptr = Bcalloc(1,(((newsize+7)>>3)+1) * sizeof(uint8_t));
|
newbitptr = (char *)Bcalloc(1,(((newsize+7)>>3)+1) * sizeof(uint8_t));
|
||||||
|
|
||||||
if (newscript == NULL || newbitptr == NULL)
|
if (newscript == NULL || newbitptr == NULL)
|
||||||
{
|
{
|
||||||
|
@ -2504,9 +2504,9 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
tempbuf[j+1] = '\0';
|
tempbuf[j+1] = '\0';
|
||||||
|
|
||||||
if (MapInfo[(k*MAXLEVELS)+i].musicfn == NULL)
|
if (MapInfo[(k*MAXLEVELS)+i].musicfn == NULL)
|
||||||
MapInfo[(k*MAXLEVELS)+i].musicfn = Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
MapInfo[(k*MAXLEVELS)+i].musicfn = (char *)Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
||||||
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[(k*MAXLEVELS)+i].musicfn))
|
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[(k*MAXLEVELS)+i].musicfn))
|
||||||
MapInfo[(k*MAXLEVELS)+i].musicfn = Brealloc(MapInfo[(k*MAXLEVELS)+i].musicfn,(Bstrlen(tempbuf)+1));
|
MapInfo[(k*MAXLEVELS)+i].musicfn = (char *)Brealloc(MapInfo[(k*MAXLEVELS)+i].musicfn,(Bstrlen(tempbuf)+1));
|
||||||
|
|
||||||
Bstrcpy(MapInfo[(k*MAXLEVELS)+i].musicfn,tempbuf);
|
Bstrcpy(MapInfo[(k*MAXLEVELS)+i].musicfn,tempbuf);
|
||||||
|
|
||||||
|
@ -4147,7 +4147,6 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
g_tile[*g_scriptPtr].flags |= SPRITE_NOPAL;
|
g_tile[*g_scriptPtr].flags |= SPRITE_NOPAL;
|
||||||
break;
|
break;
|
||||||
case CON_PRECACHE:
|
case CON_PRECACHE:
|
||||||
g_tile[*g_scriptPtr].flags |= SPRITE_CACHE;
|
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
g_scriptPtr--;
|
g_scriptPtr--;
|
||||||
i = *g_scriptPtr;
|
i = *g_scriptPtr;
|
||||||
|
@ -4156,16 +4155,13 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
C_ReportError(ERROR_EXCEEDSMAXTILES);
|
C_ReportError(ERROR_EXCEEDSMAXTILES);
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
}
|
}
|
||||||
g_tile[j].cacherange[0] = i;
|
g_tile[j].cacherange = i;
|
||||||
|
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
g_scriptPtr--;
|
g_scriptPtr--;
|
||||||
i = *g_scriptPtr;
|
if (*g_scriptPtr)
|
||||||
if ((unsigned)i >= MAXTILES)
|
g_tile[j].flags |= SPRITE_CACHE;
|
||||||
{
|
|
||||||
C_ReportError(ERROR_EXCEEDSMAXTILES);
|
|
||||||
g_numCompilerErrors++;
|
|
||||||
}
|
|
||||||
g_tile[j].cacherange[1] = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -5101,7 +5097,7 @@ repeatcase:
|
||||||
if (Bstrcmp(setupfilename,SETUPFILENAME) == 0) // not set to something else via -cfg
|
if (Bstrcmp(setupfilename,SETUPFILENAME) == 0) // not set to something else via -cfg
|
||||||
{
|
{
|
||||||
char temp[BMAX_PATH];
|
char temp[BMAX_PATH];
|
||||||
struct stat st;
|
struct Bstat st;
|
||||||
int32_t fullscreen = ud.config.ScreenMode;
|
int32_t fullscreen = ud.config.ScreenMode;
|
||||||
int32_t xdim = ud.config.ScreenWidth, ydim = ud.config.ScreenHeight, bpp = ud.config.ScreenBPP;
|
int32_t xdim = ud.config.ScreenWidth, ydim = ud.config.ScreenHeight, bpp = ud.config.ScreenBPP;
|
||||||
int32_t usemouse = ud.config.UseMouse, usejoy = ud.config.UseJoystick;
|
int32_t usemouse = ud.config.UseMouse, usejoy = ud.config.UseJoystick;
|
||||||
|
@ -5243,9 +5239,9 @@ repeatcase:
|
||||||
Bcorrectfilename(tempbuf,0);
|
Bcorrectfilename(tempbuf,0);
|
||||||
|
|
||||||
if (MapInfo[j *MAXLEVELS+k].filename == NULL)
|
if (MapInfo[j *MAXLEVELS+k].filename == NULL)
|
||||||
MapInfo[j *MAXLEVELS+k].filename = Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
MapInfo[j *MAXLEVELS+k].filename = (char *)Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
||||||
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[j*MAXLEVELS+k].filename))
|
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[j*MAXLEVELS+k].filename))
|
||||||
MapInfo[j *MAXLEVELS+k].filename = Brealloc(MapInfo[j*MAXLEVELS+k].filename,(Bstrlen(tempbuf)+1));
|
MapInfo[j *MAXLEVELS+k].filename = (char *)Brealloc(MapInfo[j*MAXLEVELS+k].filename,(Bstrlen(tempbuf)+1));
|
||||||
|
|
||||||
Bstrcpy(MapInfo[j*MAXLEVELS+k].filename,tempbuf);
|
Bstrcpy(MapInfo[j*MAXLEVELS+k].filename,tempbuf);
|
||||||
|
|
||||||
|
@ -5284,9 +5280,9 @@ repeatcase:
|
||||||
tempbuf[i] = '\0';
|
tempbuf[i] = '\0';
|
||||||
|
|
||||||
if (MapInfo[j*MAXLEVELS+k].name == NULL)
|
if (MapInfo[j*MAXLEVELS+k].name == NULL)
|
||||||
MapInfo[j*MAXLEVELS+k].name = Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
MapInfo[j*MAXLEVELS+k].name = (char *)Bcalloc(Bstrlen(tempbuf)+1,sizeof(uint8_t));
|
||||||
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[j*MAXLEVELS+k].name))
|
else if ((Bstrlen(tempbuf)+1) > sizeof(MapInfo[j*MAXLEVELS+k].name))
|
||||||
MapInfo[j *MAXLEVELS+k].name = Brealloc(MapInfo[j*MAXLEVELS+k].name,(Bstrlen(tempbuf)+1));
|
MapInfo[j *MAXLEVELS+k].name = (char *)Brealloc(MapInfo[j*MAXLEVELS+k].name,(Bstrlen(tempbuf)+1));
|
||||||
|
|
||||||
/* initprintf("level name string len: %d\n",Bstrlen(tempbuf)); */
|
/* initprintf("level name string len: %d\n",Bstrlen(tempbuf)); */
|
||||||
|
|
||||||
|
@ -5312,7 +5308,7 @@ repeatcase:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ScriptQuotes[k] == NULL)
|
if (ScriptQuotes[k] == NULL)
|
||||||
ScriptQuotes[k] = Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
ScriptQuotes[k] = (char *)Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
||||||
|
|
||||||
if (!ScriptQuotes[k])
|
if (!ScriptQuotes[k])
|
||||||
{
|
{
|
||||||
|
@ -5332,7 +5328,7 @@ repeatcase:
|
||||||
if (tw == CON_REDEFINEQUOTE)
|
if (tw == CON_REDEFINEQUOTE)
|
||||||
{
|
{
|
||||||
if (ScriptQuoteRedefinitions[g_numQuoteRedefinitions] == NULL)
|
if (ScriptQuoteRedefinitions[g_numQuoteRedefinitions] == NULL)
|
||||||
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = (char *)Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
||||||
if (!ScriptQuoteRedefinitions[g_numQuoteRedefinitions])
|
if (!ScriptQuoteRedefinitions[g_numQuoteRedefinitions])
|
||||||
{
|
{
|
||||||
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = NULL;
|
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = NULL;
|
||||||
|
@ -5431,7 +5427,7 @@ repeatcase:
|
||||||
C_SkipComments();
|
C_SkipComments();
|
||||||
|
|
||||||
if (g_sounds[k].filename == NULL)
|
if (g_sounds[k].filename == NULL)
|
||||||
g_sounds[k].filename = Bcalloc(BMAX_PATH,sizeof(uint8_t));
|
g_sounds[k].filename = (char *)Bcalloc(BMAX_PATH,sizeof(uint8_t));
|
||||||
if (!g_sounds[k].filename)
|
if (!g_sounds[k].filename)
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Failed allocating %" PRIdPTR " byte buffer.",sizeof(uint8_t) * BMAX_PATH);
|
Bsprintf(tempbuf,"Failed allocating %" PRIdPTR " byte buffer.",sizeof(uint8_t) * BMAX_PATH);
|
||||||
|
@ -5816,8 +5812,9 @@ static void C_InitProjectiles(void)
|
||||||
|
|
||||||
defaultprojectile_t DefaultProjectile =
|
defaultprojectile_t DefaultProjectile =
|
||||||
{
|
{
|
||||||
1, -1, 2048, 0, 0, SMALLSMOKE, -1, -1, 600, BULLETHOLE, -1, 0, 0, 448, g_numFreezeBounces, PIPEBOMB_BOUNCE, 1,
|
1, -1, 2048, 0, 0, (int16_t)SMALLSMOKE, -1, -1, 600, (int16_t)BULLETHOLE, -1, 0, 0, 448,
|
||||||
100, -1, -1, -1, -1, -1, -96, 18, 18, 0, 1, 32, {0,0,0,0,0,0},
|
(int16_t)g_numFreezeBounces, (int16_t)PIPEBOMB_BOUNCE, 1, 100, -1, -1, -1, -1, -1, -96, 18, 18,
|
||||||
|
0, 1, 32, {0,0,0,0,0,0},
|
||||||
};
|
};
|
||||||
|
|
||||||
// this will only happen if I forget to update this function...
|
// this will only happen if I forget to update this function...
|
||||||
|
@ -6045,7 +6042,7 @@ void C_Compile(const char *filenam)
|
||||||
|
|
||||||
for (i=127; i>=0; i--)
|
for (i=127; i>=0; i--)
|
||||||
if (ScriptQuotes[i] == NULL)
|
if (ScriptQuotes[i] == NULL)
|
||||||
ScriptQuotes[i] = Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
ScriptQuotes[i] = (char *)Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
||||||
|
|
||||||
for (i=MAXQUOTELEN-7; i>=0; i--)
|
for (i=MAXQUOTELEN-7; i>=0; i--)
|
||||||
if (Bstrncmp(&ScriptQuotes[13][i],"SPACE",5) == 0)
|
if (Bstrncmp(&ScriptQuotes[13][i],"SPACE",5) == 0)
|
||||||
|
@ -6127,7 +6124,7 @@ void C_Compile(const char *filenam)
|
||||||
{
|
{
|
||||||
if (ScriptQuotes[i+OBITQUOTEINDEX] == NULL)
|
if (ScriptQuotes[i+OBITQUOTEINDEX] == NULL)
|
||||||
{
|
{
|
||||||
ScriptQuotes[i+OBITQUOTEINDEX] = Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
ScriptQuotes[i+OBITQUOTEINDEX] = (char *)Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
||||||
Bstrcpy(ScriptQuotes[i+OBITQUOTEINDEX],PlayerObituaries[i]);
|
Bstrcpy(ScriptQuotes[i+OBITQUOTEINDEX],PlayerObituaries[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6137,7 +6134,7 @@ void C_Compile(const char *filenam)
|
||||||
{
|
{
|
||||||
if (ScriptQuotes[i+SUICIDEQUOTEINDEX] == NULL)
|
if (ScriptQuotes[i+SUICIDEQUOTEINDEX] == NULL)
|
||||||
{
|
{
|
||||||
ScriptQuotes[i+SUICIDEQUOTEINDEX] = Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
ScriptQuotes[i+SUICIDEQUOTEINDEX] = (char *)Bcalloc(MAXQUOTELEN,sizeof(uint8_t));
|
||||||
Bstrcpy(ScriptQuotes[i+SUICIDEQUOTEINDEX],PlayerSelfObituaries[i]);
|
Bstrcpy(ScriptQuotes[i+SUICIDEQUOTEINDEX],PlayerSelfObituaries[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h> // sqrt
|
#include <math.h> // sqrt
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
#include "gamedef.h"
|
#include "gamedef.h"
|
||||||
#include "gameexec.h"
|
#include "gameexec.h"
|
||||||
|
@ -87,7 +89,7 @@ void VM_ScriptInfo(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.g_i)
|
if (vm.g_i)
|
||||||
initprintf("current actor: %d (%d)\n",vm.g_i,vm.g_sp->picnum);
|
initprintf_nowarn("current actor: %d (%d)\n",vm.g_i,vm.g_sp->picnum);
|
||||||
|
|
||||||
initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw);
|
initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw);
|
||||||
}
|
}
|
||||||
|
@ -442,7 +444,7 @@ GAMEEXEC_STATIC void VM_AlterAng(int32_t a)
|
||||||
|
|
||||||
{
|
{
|
||||||
vm.g_t[1] = 0;
|
vm.g_t[1] = 0;
|
||||||
OSD_Printf(OSD_ERROR "bad moveptr for actor %d (%d)!\n", vm.g_i, vm.g_sp->picnum);
|
OSD_Printf_nowarn(OSD_ERROR "bad moveptr for actor %d (%d)!\n", vm.g_i, vm.g_sp->picnum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,7 +593,7 @@ dead:
|
||||||
if ((unsigned)vm.g_t[1] >= (unsigned)g_scriptSize-1)
|
if ((unsigned)vm.g_t[1] >= (unsigned)g_scriptSize-1)
|
||||||
{
|
{
|
||||||
vm.g_t[1] = 0;
|
vm.g_t[1] = 0;
|
||||||
OSD_Printf(OSD_ERROR "clearing bad moveptr for actor %d (%d)\n", vm.g_i, vm.g_sp->picnum);
|
OSD_Printf_nowarn(OSD_ERROR "clearing bad moveptr for actor %d (%d)\n", vm.g_i, vm.g_sp->picnum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3306,7 +3308,7 @@ nullquote:
|
||||||
|
|
||||||
case CON_SAVEMAPSTATE:
|
case CON_SAVEMAPSTATE:
|
||||||
if (MapInfo[ud.volume_number *MAXLEVELS+ud.level_number].savedstate == NULL)
|
if (MapInfo[ud.volume_number *MAXLEVELS+ud.level_number].savedstate == NULL)
|
||||||
MapInfo[ud.volume_number *MAXLEVELS+ud.level_number].savedstate = Bcalloc(1,sizeof(mapstate_t));
|
MapInfo[ud.volume_number *MAXLEVELS+ud.level_number].savedstate = (mapstate_t *)Bcalloc(1,sizeof(mapstate_t));
|
||||||
G_SaveMapState(MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
G_SaveMapState(MapInfo[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
||||||
insptr++;
|
insptr++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -4165,7 +4167,8 @@ nullquote:
|
||||||
|
|
||||||
if (j<0 || j >= g_gameArrayCount || index >= aGameArrays[j].size || index < 0)
|
if (j<0 || j >= g_gameArrayCount || index >= aGameArrays[j].size || index < 0)
|
||||||
{
|
{
|
||||||
OSD_Printf(OSD_ERROR "Gv_SetVar(): tried to set invalid array ID (%d) or index out of bounds from sprite %d (%d), player %d\n",j,vm.g_i,sprite[vm.g_i].picnum,vm.g_p);
|
OSD_Printf_nowarn(OSD_ERROR "Gv_SetVar(): tried to set invalid array ID (%d) or index out of bounds from sprite %d (%d), player %d\n",
|
||||||
|
j,vm.g_i,sprite[vm.g_i].picnum,vm.g_p);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
aGameArrays[j].plValues[index]=value;
|
aGameArrays[j].plValues[index]=value;
|
||||||
|
@ -4199,7 +4202,7 @@ nullquote:
|
||||||
{
|
{
|
||||||
/*OSD_Printf(OSDTEXT_GREEN "CON_RESIZEARRAY: resizing array %s from %d to %d\n",
|
/*OSD_Printf(OSDTEXT_GREEN "CON_RESIZEARRAY: resizing array %s from %d to %d\n",
|
||||||
aGameArrays[j].szLabel, aGameArrays[j].size, asize / GAR_ELTSZ);*/
|
aGameArrays[j].szLabel, aGameArrays[j].size, asize / GAR_ELTSZ);*/
|
||||||
aGameArrays[j].plValues=Brealloc(aGameArrays[j].plValues, asize);
|
aGameArrays[j].plValues = (intptr_t *)Brealloc(aGameArrays[j].plValues, asize);
|
||||||
aGameArrays[j].size = asize / GAR_ELTSZ;
|
aGameArrays[j].size = asize / GAR_ELTSZ;
|
||||||
kread(fil, aGameArrays[j].plValues, asize);
|
kread(fil, aGameArrays[j].plValues, asize);
|
||||||
}
|
}
|
||||||
|
@ -4250,7 +4253,7 @@ nullquote:
|
||||||
if (asize > 0)
|
if (asize > 0)
|
||||||
{
|
{
|
||||||
/*OSD_Printf(OSDTEXT_GREEN "CON_RESIZEARRAY: resizing array %s from %d to %d\n", aGameArrays[j].szLabel, aGameArrays[j].size, asize);*/
|
/*OSD_Printf(OSDTEXT_GREEN "CON_RESIZEARRAY: resizing array %s from %d to %d\n", aGameArrays[j].szLabel, aGameArrays[j].size, asize);*/
|
||||||
aGameArrays[j].plValues=Brealloc(aGameArrays[j].plValues, GAR_ELTSZ * asize);
|
aGameArrays[j].plValues = (intptr_t *)Brealloc(aGameArrays[j].plValues, GAR_ELTSZ * asize);
|
||||||
aGameArrays[j].size = asize;
|
aGameArrays[j].size = asize;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -4978,7 +4981,8 @@ nullquote:
|
||||||
if (vm.g_sp->yvel) G_OperateRespawns(vm.g_sp->yvel);
|
if (vm.g_sp->yvel) G_OperateRespawns(vm.g_sp->yvel);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (vm.g_sp->hitag >= 0) G_OperateRespawns(vm.g_sp->hitag);
|
// if (vm.g_sp->hitag >= 0)
|
||||||
|
G_OperateRespawns(vm.g_sp->hitag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -5309,13 +5313,13 @@ void G_SaveMapState(mapstate_t *save)
|
||||||
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
||||||
{
|
{
|
||||||
if (!save->vars[i])
|
if (!save->vars[i])
|
||||||
save->vars[i] = Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
save->vars[i] = (intptr_t *)Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
||||||
Bmemcpy(&save->vars[i][0],&aGameVars[i].val.plValues[0],sizeof(intptr_t) * MAXPLAYERS);
|
Bmemcpy(&save->vars[i][0],&aGameVars[i].val.plValues[0],sizeof(intptr_t) * MAXPLAYERS);
|
||||||
}
|
}
|
||||||
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
||||||
{
|
{
|
||||||
if (!save->vars[i])
|
if (!save->vars[i])
|
||||||
save->vars[i] = Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
save->vars[i] = (intptr_t *)Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
||||||
Bmemcpy(&save->vars[i][0],&aGameVars[i].val.plValues[0],sizeof(intptr_t) * MAXSPRITES);
|
Bmemcpy(&save->vars[i][0],&aGameVars[i].val.plValues[0],sizeof(intptr_t) * MAXSPRITES);
|
||||||
}
|
}
|
||||||
else save->vars[i] = (intptr_t *)aGameVars[i].val.lValue;
|
else save->vars[i] = (intptr_t *)aGameVars[i].val.lValue;
|
||||||
|
|
|
@ -151,7 +151,7 @@ int32_t VM_OnEvent(int32_t iEventID,int32_t iActor,int32_t iPlayer,int32_t lDist
|
||||||
void VM_ScriptInfo(void);
|
void VM_ScriptInfo(void);
|
||||||
|
|
||||||
#define CON_ERRPRINTF(Text, ...) do { \
|
#define CON_ERRPRINTF(Text, ...) do { \
|
||||||
OSD_Printf("Line %d, %s: " Text, g_errorLineNum, keyw[g_tw], ## __VA_ARGS__); \
|
OSD_Printf_nowarn("Line %d, %s: " Text, g_errorLineNum, keyw[g_tw], ## __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -127,18 +127,18 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
|
||||||
for (i=0; i<g_gameVarCount; i++)
|
for (i=0; i<g_gameVarCount; i++)
|
||||||
{
|
{
|
||||||
if (kdfread(&(aGameVars[i]),sizeof(gamevar_t),1,fil) != 1) goto corrupt;
|
if (kdfread(&(aGameVars[i]),sizeof(gamevar_t),1,fil) != 1) goto corrupt;
|
||||||
aGameVars[i].szLabel=Bcalloc(MAXVARLABEL,sizeof(uint8_t));
|
aGameVars[i].szLabel = (char *)Bcalloc(MAXVARLABEL,sizeof(uint8_t));
|
||||||
if (kdfread(aGameVars[i].szLabel,sizeof(uint8_t) * MAXVARLABEL, 1, fil) != 1) goto corrupt;
|
if (kdfread(aGameVars[i].szLabel,sizeof(uint8_t) * MAXVARLABEL, 1, fil) != 1) goto corrupt;
|
||||||
hash_add(&h_gamevars, aGameVars[i].szLabel,i, 1);
|
hash_add(&h_gamevars, aGameVars[i].szLabel,i, 1);
|
||||||
|
|
||||||
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
||||||
{
|
{
|
||||||
aGameVars[i].val.plValues=Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
aGameVars[i].val.plValues = (intptr_t*)Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
||||||
if (kdfread(aGameVars[i].val.plValues,sizeof(intptr_t) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
if (kdfread(aGameVars[i].val.plValues,sizeof(intptr_t) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
||||||
}
|
}
|
||||||
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
||||||
{
|
{
|
||||||
aGameVars[i].val.plValues=Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
aGameVars[i].val.plValues = (intptr_t*)Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
||||||
if (kdfread(&aGameVars[i].val.plValues[0],sizeof(intptr_t), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
if (kdfread(&aGameVars[i].val.plValues[0],sizeof(intptr_t), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,11 +155,11 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
|
||||||
for (i=0; i<g_gameArrayCount; i++)
|
for (i=0; i<g_gameArrayCount; i++)
|
||||||
{
|
{
|
||||||
if (kdfread(&(aGameArrays[i]),sizeof(gamearray_t),1,fil) != 1) goto corrupt;
|
if (kdfread(&(aGameArrays[i]),sizeof(gamearray_t),1,fil) != 1) goto corrupt;
|
||||||
aGameArrays[i].szLabel=Bcalloc(MAXARRAYLABEL,sizeof(uint8_t));
|
aGameArrays[i].szLabel = (char *)Bcalloc(MAXARRAYLABEL,sizeof(uint8_t));
|
||||||
if (kdfread(aGameArrays[i].szLabel,sizeof(uint8_t) * MAXARRAYLABEL, 1, fil) != 1) goto corrupt;
|
if (kdfread(aGameArrays[i].szLabel,sizeof(uint8_t) * MAXARRAYLABEL, 1, fil) != 1) goto corrupt;
|
||||||
hash_add(&h_arrays, aGameArrays[i].szLabel, i, 1);
|
hash_add(&h_arrays, aGameArrays[i].szLabel, i, 1);
|
||||||
|
|
||||||
aGameArrays[i].plValues=Bcalloc(aGameArrays[i].size, GAR_ELTSZ);
|
aGameArrays[i].plValues = (intptr_t *)Bcalloc(aGameArrays[i].size, GAR_ELTSZ);
|
||||||
if (kdfread(aGameArrays[i].plValues, GAR_ELTSZ * aGameArrays[i].size, 1, fil) < 1) goto corrupt;
|
if (kdfread(aGameArrays[i].plValues, GAR_ELTSZ * aGameArrays[i].size, 1, fil) < 1) goto corrupt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
|
||||||
if (savedstate[i])
|
if (savedstate[i])
|
||||||
{
|
{
|
||||||
if (MapInfo[i].savedstate == NULL)
|
if (MapInfo[i].savedstate == NULL)
|
||||||
MapInfo[i].savedstate = Bcalloc(1,sizeof(mapstate_t));
|
MapInfo[i].savedstate = (mapstate_t *)Bcalloc(1,sizeof(mapstate_t));
|
||||||
if (kdfread(MapInfo[i].savedstate,sizeof(mapstate_t),1,fil) != sizeof(mapstate_t)) goto corrupt;
|
if (kdfread(MapInfo[i].savedstate,sizeof(mapstate_t),1,fil) != sizeof(mapstate_t)) goto corrupt;
|
||||||
for (j=0; j<g_gameVarCount; j++)
|
for (j=0; j<g_gameVarCount; j++)
|
||||||
{
|
{
|
||||||
|
@ -186,13 +186,13 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
|
||||||
if (aGameVars[j].dwFlags & GAMEVAR_PERPLAYER)
|
if (aGameVars[j].dwFlags & GAMEVAR_PERPLAYER)
|
||||||
{
|
{
|
||||||
// if (!MapInfo[i].savedstate->vars[j])
|
// if (!MapInfo[i].savedstate->vars[j])
|
||||||
MapInfo[i].savedstate->vars[j] = Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
MapInfo[i].savedstate->vars[j] = (intptr_t *)Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
||||||
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
||||||
}
|
}
|
||||||
else if (aGameVars[j].dwFlags & GAMEVAR_PERACTOR)
|
else if (aGameVars[j].dwFlags & GAMEVAR_PERACTOR)
|
||||||
{
|
{
|
||||||
// if (!MapInfo[i].savedstate->vars[j])
|
// if (!MapInfo[i].savedstate->vars[j])
|
||||||
MapInfo[i].savedstate->vars[j] = Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
MapInfo[i].savedstate->vars[j] = (intptr_t *)Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
||||||
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -478,7 +478,7 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
|
||||||
if ((aGameVars[i].dwFlags & GAMEVAR_SYSTEM) == 0)
|
if ((aGameVars[i].dwFlags & GAMEVAR_SYSTEM) == 0)
|
||||||
{
|
{
|
||||||
if (aGameVars[i].szLabel == NULL)
|
if (aGameVars[i].szLabel == NULL)
|
||||||
aGameVars[i].szLabel=Bcalloc(MAXVARLABEL,sizeof(uint8_t));
|
aGameVars[i].szLabel = (char *)Bcalloc(MAXVARLABEL,sizeof(uint8_t));
|
||||||
if (aGameVars[i].szLabel != pszLabel)
|
if (aGameVars[i].szLabel != pszLabel)
|
||||||
Bstrcpy(aGameVars[i].szLabel,pszLabel);
|
Bstrcpy(aGameVars[i].szLabel,pszLabel);
|
||||||
aGameVars[i].dwFlags=dwFlags;
|
aGameVars[i].dwFlags=dwFlags;
|
||||||
|
@ -505,14 +505,14 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
|
||||||
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
|
||||||
{
|
{
|
||||||
if (!aGameVars[i].val.plValues)
|
if (!aGameVars[i].val.plValues)
|
||||||
aGameVars[i].val.plValues=Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
aGameVars[i].val.plValues = (intptr_t *)Bcalloc(MAXPLAYERS,sizeof(intptr_t));
|
||||||
for (j=MAXPLAYERS-1; j>=0; j--)
|
for (j=MAXPLAYERS-1; j>=0; j--)
|
||||||
aGameVars[i].val.plValues[j]=lValue;
|
aGameVars[i].val.plValues[j]=lValue;
|
||||||
}
|
}
|
||||||
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
else if (aGameVars[i].dwFlags & GAMEVAR_PERACTOR)
|
||||||
{
|
{
|
||||||
if (!aGameVars[i].val.plValues)
|
if (!aGameVars[i].val.plValues)
|
||||||
aGameVars[i].val.plValues=Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
aGameVars[i].val.plValues = (intptr_t *)Bcalloc(MAXSPRITES,sizeof(intptr_t));
|
||||||
for (j=MAXSPRITES-1; j>=0; j--)
|
for (j=MAXSPRITES-1; j>=0; j--)
|
||||||
aGameVars[i].val.plValues[j]=lValue;
|
aGameVars[i].val.plValues[j]=lValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
struct grpfile grpfiles[NUMGRPFILES] =
|
struct grpfile grpfiles[NUMGRPFILES] =
|
||||||
{
|
{
|
||||||
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D", (int32_t)0xBBC9CE44, 26524524, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D (South Korean Censored)", 0xAA4F6A40, 26385383, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D (South Korean Censored)", (int32_t)0xAA4F6A40, 26385383, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D: Atomic Edition", (int32_t)0xFD3DCFF1, 44356548, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D: Atomic Edition (Censored)", 0xF514A6AC, 44348015, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D: Plutonium Pak", (int32_t)0xF514A6AC, 44348015, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D Shareware", (int32_t)0x983AD923, 11035779, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAMEFLAG_DUKE, NULL },
|
{ "Duke Nukem 3D Mac Shareware", (int32_t)0xC5F71561, 10444391, GAMEFLAG_DUKE, NULL },
|
||||||
{ "NAM", 0x75C1F07B, 43448927, GAMEFLAG_NAM, NULL },
|
{ "NAM", (int32_t)0x75C1F07B, 43448927, GAMEFLAG_NAM, NULL },
|
||||||
{ "Napalm", 0x3DE1589A, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, NULL },
|
{ "Napalm", (int32_t)0x3DE1589A, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, NULL },
|
||||||
{ "WWII GI", 0x907B82BF, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, NULL },
|
{ "WWII GI", (int32_t)0x907B82BF, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, NULL },
|
||||||
};
|
};
|
||||||
struct grpfile *foundgrps = NULL;
|
struct grpfile *foundgrps = NULL;
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ static int32_t LoadGroupsCache(void)
|
||||||
if (scriptfile_getnumber(script, &fmtime)) break; // modification time
|
if (scriptfile_getnumber(script, &fmtime)) break; // modification time
|
||||||
if (scriptfile_getnumber(script, &fcrcval)) break; // crc checksum
|
if (scriptfile_getnumber(script, &fcrcval)) break; // crc checksum
|
||||||
|
|
||||||
fg = Bcalloc(1, sizeof(struct grpcache));
|
fg = (struct grpcache *)Bcalloc(1, sizeof(struct grpcache));
|
||||||
fg->next = grpcache;
|
fg->next = grpcache;
|
||||||
grpcache = fg;
|
grpcache = fg;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ int32_t ScanGroups(void)
|
||||||
char *fn;
|
char *fn;
|
||||||
struct Bstat st;
|
struct Bstat st;
|
||||||
#define BUFFER_SIZE (1024 * 1024 * 8)
|
#define BUFFER_SIZE (1024 * 1024 * 8)
|
||||||
uint8_t *buf = Bmalloc(BUFFER_SIZE);
|
uint8_t *buf = (uint8_t *)Bmalloc(BUFFER_SIZE);
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
{
|
{
|
||||||
|
@ -165,7 +165,7 @@ int32_t ScanGroups(void)
|
||||||
|
|
||||||
fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD);
|
fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD);
|
||||||
if (fh < 0) continue;
|
if (fh < 0) continue;
|
||||||
if (fstat(fh, &st)) continue;
|
if (Bfstat(fh, &st)) continue;
|
||||||
|
|
||||||
initprintf(" Checksumming %s...", sidx->name);
|
initprintf(" Checksumming %s...", sidx->name);
|
||||||
crc32init((uint32_t *)&crcval);
|
crc32init((uint32_t *)&crcval);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
void ClearBuffer_DW( void *ptr, unsigned data, int32_t length )
|
void ClearBuffer_DW( void *ptr, unsigned data, int32_t length )
|
||||||
{
|
{
|
||||||
unsigned *ptrdw = ptr;
|
unsigned *ptrdw = (unsigned *)ptr;
|
||||||
while (length--) {
|
while (length--) {
|
||||||
*(ptrdw++) = data;
|
*(ptrdw++) = data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ void ANIM_LoadAnim(char * buffer)
|
||||||
{
|
{
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
anim = Brealloc(anim, sizeof(anim_t));
|
anim = (anim_t *)Brealloc(anim, sizeof(anim_t));
|
||||||
|
|
||||||
anim->curlpnum = 0xffff;
|
anim->curlpnum = 0xffff;
|
||||||
anim->currentframe = -1;
|
anim->currentframe = -1;
|
||||||
|
|
|
@ -122,7 +122,7 @@ void SCRIPT_FreeSection(ScriptSectionType * section)
|
||||||
|
|
||||||
#define AllocSection(s) \
|
#define AllocSection(s) \
|
||||||
{ \
|
{ \
|
||||||
(s) = Bmalloc(sizeof(ScriptSectionType)); \
|
(s) = (ScriptSectionType *)Bmalloc(sizeof(ScriptSectionType)); \
|
||||||
(s)->name = NULL; \
|
(s)->name = NULL; \
|
||||||
(s)->entries = NULL; \
|
(s)->entries = NULL; \
|
||||||
(s)->lastline = NULL; \
|
(s)->lastline = NULL; \
|
||||||
|
@ -131,7 +131,7 @@ void SCRIPT_FreeSection(ScriptSectionType * section)
|
||||||
}
|
}
|
||||||
#define AllocEntry(e) \
|
#define AllocEntry(e) \
|
||||||
{ \
|
{ \
|
||||||
(e) = Bmalloc(sizeof(ScriptEntryType)); \
|
(e) = (ScriptEntryType *)Bmalloc(sizeof(ScriptEntryType)); \
|
||||||
(e)->name = NULL; \
|
(e)->name = NULL; \
|
||||||
(e)->value = NULL; \
|
(e)->value = NULL; \
|
||||||
(e)->nextentry = (e); \
|
(e)->nextentry = (e); \
|
||||||
|
@ -827,7 +827,7 @@ void SCRIPT_PutString
|
||||||
if (*q == '\r' || *q == '\n' || *q == '\t' || *q == '\\' || *q == '"') len+=2;
|
if (*q == '\r' || *q == '\n' || *q == '\t' || *q == '\\' || *q == '"') len+=2;
|
||||||
else if (*q >= ' ') len++;
|
else if (*q >= ' ') len++;
|
||||||
}
|
}
|
||||||
p = raw = Bmalloc(len);
|
p = raw = (char *)Bmalloc(len);
|
||||||
*(p++) = '"';
|
*(p++) = '"';
|
||||||
for (q=string; *q; q++)
|
for (q=string; *q; q++)
|
||||||
{
|
{
|
||||||
|
@ -868,7 +868,7 @@ void SCRIPT_PutDoubleString
|
||||||
if (*q == '\r' || *q == '\n' || *q == '\t' || *q == '\\' || *q == '"') len+=2;
|
if (*q == '\r' || *q == '\n' || *q == '\t' || *q == '\\' || *q == '"') len+=2;
|
||||||
else if (*q >= ' ') len++;
|
else if (*q >= ' ') len++;
|
||||||
}
|
}
|
||||||
p = raw = Bmalloc(len);
|
p = raw = (char *)Bmalloc(len);
|
||||||
*(p++) = '"';
|
*(p++) = '"';
|
||||||
for (q=string1; *q; q++)
|
for (q=string1; *q; q++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -787,9 +787,9 @@ static int32_t C_CopyLabel(void)
|
||||||
{
|
{
|
||||||
if (g_numLabels >= label_allocsize)
|
if (g_numLabels >= label_allocsize)
|
||||||
{
|
{
|
||||||
label = Brealloc(label, 2*label_allocsize*MAXLABELLEN*sizeof(char));
|
label = (char *)Brealloc(label, 2*label_allocsize*MAXLABELLEN*sizeof(char));
|
||||||
labelval = Brealloc(labelval, 2*label_allocsize*sizeof(labelval[0]));
|
labelval = (int32_t *)Brealloc(labelval, 2*label_allocsize*sizeof(labelval[0]));
|
||||||
labeltype = Brealloc(labeltype, 2*label_allocsize*sizeof(labeltype[0]));
|
labeltype = (uint8_t *)Brealloc(labeltype, 2*label_allocsize*sizeof(labeltype[0]));
|
||||||
|
|
||||||
if (label==NULL || labelval==NULL || labeltype==NULL)
|
if (label==NULL || labelval==NULL || labeltype==NULL)
|
||||||
{
|
{
|
||||||
|
@ -1025,7 +1025,7 @@ static void C_GetNextVarType(int32_t type)
|
||||||
if (i>=constants_allocsize)
|
if (i>=constants_allocsize)
|
||||||
{
|
{
|
||||||
constants_allocsize *= 2;
|
constants_allocsize *= 2;
|
||||||
constants = Brealloc(constants, constants_allocsize * sizeof(constants[0]));
|
constants = (int32_t *)Brealloc(constants, constants_allocsize * sizeof(constants[0]));
|
||||||
if (!constants)
|
if (!constants)
|
||||||
{
|
{
|
||||||
initprintf("C_GetNextVarType(): ERROR: out of memory!\n");
|
initprintf("C_GetNextVarType(): ERROR: out of memory!\n");
|
||||||
|
@ -1826,7 +1826,7 @@ static int32_t C_ParseCommand(void)
|
||||||
if (g_stateCount >= statesinfo_allocsize)
|
if (g_stateCount >= statesinfo_allocsize)
|
||||||
{
|
{
|
||||||
statesinfo_allocsize *= 2;
|
statesinfo_allocsize *= 2;
|
||||||
statesinfo = Brealloc(statesinfo, statesinfo_allocsize * sizeof(statesinfo[0]));
|
statesinfo = (statesinfo_t *)Brealloc(statesinfo, statesinfo_allocsize * sizeof(statesinfo[0]));
|
||||||
if (!statesinfo)
|
if (!statesinfo)
|
||||||
{
|
{
|
||||||
initprintf("C_ParseCommand(): ERROR: out of memory!\n");
|
initprintf("C_ParseCommand(): ERROR: out of memory!\n");
|
||||||
|
@ -3220,7 +3220,7 @@ repeatcase:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ScriptQuotes[k] == NULL)
|
if (ScriptQuotes[k] == NULL)
|
||||||
ScriptQuotes[k] = Bcalloc(MAXQUOTELEN, sizeof(uint8_t));
|
ScriptQuotes[k] = (char *)Bcalloc(MAXQUOTELEN, sizeof(uint8_t));
|
||||||
|
|
||||||
if (!ScriptQuotes[k])
|
if (!ScriptQuotes[k])
|
||||||
{
|
{
|
||||||
|
@ -3238,7 +3238,7 @@ repeatcase:
|
||||||
if (tw == CON_REDEFINEQUOTE)
|
if (tw == CON_REDEFINEQUOTE)
|
||||||
{
|
{
|
||||||
if (ScriptQuoteRedefinitions[g_numQuoteRedefinitions] == NULL)
|
if (ScriptQuoteRedefinitions[g_numQuoteRedefinitions] == NULL)
|
||||||
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = Bcalloc(MAXQUOTELEN, sizeof(uint8_t));
|
ScriptQuoteRedefinitions[g_numQuoteRedefinitions] = (char *)Bcalloc(MAXQUOTELEN, sizeof(uint8_t));
|
||||||
if (!ScriptQuoteRedefinitions[g_numQuoteRedefinitions])
|
if (!ScriptQuoteRedefinitions[g_numQuoteRedefinitions])
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Failed allocating %d byte quote text buffer.", MAXQUOTELEN);
|
Bsprintf(tempbuf,"Failed allocating %d byte quote text buffer.", MAXQUOTELEN);
|
||||||
|
@ -3680,13 +3680,13 @@ void C_Compile(const char *filenameortext, int32_t isfilename)
|
||||||
|
|
||||||
if (firstime)
|
if (firstime)
|
||||||
{
|
{
|
||||||
label = Bmalloc(label_allocsize * MAXLABELLEN * sizeof(char));
|
label = (char *)Bmalloc(label_allocsize * MAXLABELLEN * sizeof(char));
|
||||||
labelval = Bmalloc(label_allocsize * sizeof(int32_t));
|
labelval = (int32_t *)Bmalloc(label_allocsize * sizeof(int32_t));
|
||||||
labeltype = Bmalloc(label_allocsize * sizeof(uint8_t));
|
labeltype = (uint8_t *)Bmalloc(label_allocsize * sizeof(uint8_t));
|
||||||
|
|
||||||
constants = Bmalloc(constants_allocsize * sizeof(int32_t));
|
constants = (int32_t *)Bmalloc(constants_allocsize * sizeof(int32_t));
|
||||||
|
|
||||||
statesinfo = Bmalloc(statesinfo_allocsize * sizeof(statesinfo_t));
|
statesinfo = (statesinfo_t *)Bmalloc(statesinfo_allocsize * sizeof(statesinfo_t));
|
||||||
|
|
||||||
for (i=0; i<MAXEVENTS; i++)
|
for (i=0; i<MAXEVENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -3699,7 +3699,7 @@ void C_Compile(const char *filenameortext, int32_t isfilename)
|
||||||
Gv_Init();
|
Gv_Init();
|
||||||
C_AddDefaultDefinitions();
|
C_AddDefaultDefinitions();
|
||||||
|
|
||||||
script = Bcalloc(g_scriptSize, sizeof(instype));
|
script = (instype *)Bcalloc(g_scriptSize, sizeof(instype));
|
||||||
// initprintf("script: %d\n",script);
|
// initprintf("script: %d\n",script);
|
||||||
if (!script || !label || !labelval || !labeltype || !constants)
|
if (!script || !label || !labelval || !labeltype || !constants)
|
||||||
{
|
{
|
||||||
|
@ -3719,7 +3719,7 @@ void C_Compile(const char *filenameortext, int32_t isfilename)
|
||||||
if (isfilename)
|
if (isfilename)
|
||||||
{
|
{
|
||||||
fs = Bstrlen(filenameortext);
|
fs = Bstrlen(filenameortext);
|
||||||
mptr = Bmalloc(fs+1+4);
|
mptr = (char *)Bmalloc(fs+1+4);
|
||||||
if (!mptr)
|
if (!mptr)
|
||||||
{
|
{
|
||||||
initprintf("C_Compile(): ERROR: out of memory!\n");
|
initprintf("C_Compile(): ERROR: out of memory!\n");
|
||||||
|
@ -3810,13 +3810,13 @@ void C_Compile(const char *filenameortext, int32_t isfilename)
|
||||||
{
|
{
|
||||||
if (aGameVars[i].val.plValues)
|
if (aGameVars[i].val.plValues)
|
||||||
{
|
{
|
||||||
aGameVars[i].val.plValues = Brealloc(aGameVars[i].val.plValues, (1+MAXEVENTS+g_stateCount)*sizeof(int32_t));
|
aGameVars[i].val.plValues = (int32_t *)Brealloc(aGameVars[i].val.plValues, (1+MAXEVENTS+g_stateCount)*sizeof(int32_t));
|
||||||
for (j=ostateCount; j<g_stateCount; j++)
|
for (j=ostateCount; j<g_stateCount; j++)
|
||||||
aGameVars[i].val.plValues[1+MAXEVENTS+j] = aGameVars[i].lDefault;
|
aGameVars[i].val.plValues[1+MAXEVENTS+j] = aGameVars[i].lDefault;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aGameVars[i].val.plValues = Bmalloc((1+MAXEVENTS+g_stateCount)*sizeof(int32_t));
|
aGameVars[i].val.plValues = (int32_t *)Bmalloc((1+MAXEVENTS+g_stateCount)*sizeof(int32_t));
|
||||||
for (j=0; j<(1+MAXEVENTS+g_stateCount); j++)
|
for (j=0; j<(1+MAXEVENTS+g_stateCount); j++)
|
||||||
aGameVars[i].val.plValues[j] = aGameVars[i].lDefault;
|
aGameVars[i].val.plValues[j] = aGameVars[i].lDefault;
|
||||||
}
|
}
|
||||||
|
@ -4006,7 +4006,7 @@ void C_PrintErrorPosition()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
char *buf = Bmalloc(nchars+1);
|
char *buf = (char *)Bmalloc(nchars+1);
|
||||||
|
|
||||||
Bmemcpy(buf, b, nchars);
|
Bmemcpy(buf, b, nchars);
|
||||||
buf[nchars]=0;
|
buf[nchars]=0;
|
||||||
|
|
|
@ -1183,7 +1183,7 @@ skip_check:
|
||||||
int32_t o_g_st=vm.g_st, arsize = aGameArrays[aridx].size;
|
int32_t o_g_st=vm.g_st, arsize = aGameArrays[aridx].size;
|
||||||
instype *end=insptr;
|
instype *end=insptr;
|
||||||
int32_t sectcnt, numsects=0;
|
int32_t sectcnt, numsects=0;
|
||||||
int16_t *sectlist = aGameArrays[aridx].vals; // actually an int32_t array
|
int16_t *sectlist = (int16_t *)aGameArrays[aridx].vals; // actually an int32_t array
|
||||||
int32_t *sectlist32 = (int32_t *)sectlist;
|
int32_t *sectlist32 = (int32_t *)sectlist;
|
||||||
int32_t j, startwall, endwall, ns;
|
int32_t j, startwall, endwall, ns;
|
||||||
static uint8_t sectbitmap[MAXSECTORS>>3];
|
static uint8_t sectbitmap[MAXSECTORS>>3];
|
||||||
|
|
|
@ -118,12 +118,12 @@ int32_t Gv_NewArray(const char *pszLabel, void *arrayptr, intptr_t asize, uint32
|
||||||
i = g_gameArrayCount;
|
i = g_gameArrayCount;
|
||||||
|
|
||||||
if (aGameArrays[i].szLabel == NULL)
|
if (aGameArrays[i].szLabel == NULL)
|
||||||
aGameArrays[i].szLabel = Bcalloc(MAXARRAYLABEL, sizeof(char));
|
aGameArrays[i].szLabel = (char *)Bcalloc(MAXARRAYLABEL, sizeof(char));
|
||||||
if (aGameArrays[i].szLabel != pszLabel)
|
if (aGameArrays[i].szLabel != pszLabel)
|
||||||
Bstrcpy(aGameArrays[i].szLabel, pszLabel);
|
Bstrcpy(aGameArrays[i].szLabel, pszLabel);
|
||||||
|
|
||||||
if (!(dwFlags & GAMEARRAY_TYPE_MASK))
|
if (!(dwFlags & GAMEARRAY_TYPE_MASK))
|
||||||
aGameArrays[i].vals = Bcalloc(asize, sizeof(int32_t));
|
aGameArrays[i].vals = (int32_t *)Bcalloc(asize, sizeof(int32_t));
|
||||||
else
|
else
|
||||||
aGameArrays[i].vals = arrayptr;
|
aGameArrays[i].vals = arrayptr;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
|
||||||
if ((aGameVars[i].dwFlags & GAMEVAR_SYSTEM) == 0)
|
if ((aGameVars[i].dwFlags & GAMEVAR_SYSTEM) == 0)
|
||||||
{
|
{
|
||||||
if (aGameVars[i].szLabel == NULL)
|
if (aGameVars[i].szLabel == NULL)
|
||||||
aGameVars[i].szLabel = Bcalloc(MAXVARLABEL, sizeof(uint8_t));
|
aGameVars[i].szLabel = (char *)Bcalloc(MAXVARLABEL, sizeof(uint8_t));
|
||||||
if (aGameVars[i].szLabel != pszLabel)
|
if (aGameVars[i].szLabel != pszLabel)
|
||||||
Bstrcpy(aGameVars[i].szLabel,pszLabel);
|
Bstrcpy(aGameVars[i].szLabel,pszLabel);
|
||||||
aGameVars[i].dwFlags = dwFlags;
|
aGameVars[i].dwFlags = dwFlags;
|
||||||
|
@ -208,7 +208,7 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
|
||||||
if (aGameVars[i].dwFlags & GAMEVAR_PERBLOCK)
|
if (aGameVars[i].dwFlags & GAMEVAR_PERBLOCK)
|
||||||
{
|
{
|
||||||
if (!aGameVars[i].val.plValues)
|
if (!aGameVars[i].val.plValues)
|
||||||
aGameVars[i].val.plValues = Bcalloc(1+MAXEVENTS+g_stateCount, sizeof(int32_t));
|
aGameVars[i].val.plValues = (int32_t *)Bcalloc(1+MAXEVENTS+g_stateCount, sizeof(int32_t));
|
||||||
for (j=0; j<1+MAXEVENTS+g_stateCount; j++)
|
for (j=0; j<1+MAXEVENTS+g_stateCount; j++)
|
||||||
aGameVars[i].val.plValues[j] = lValue;
|
aGameVars[i].val.plValues[j] = lValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//#define NUMOPTIONS 9
|
//#define NUMOPTIONS 9
|
||||||
//char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
//char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
||||||
|
|
||||||
uint8_t default_buildkeys[NUMBUILDKEYS] =
|
char default_buildkeys[NUMBUILDKEYS] =
|
||||||
{
|
{
|
||||||
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
||||||
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
|
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
|
||||||
|
|
|
@ -661,7 +661,7 @@ static void M_DrawBackground(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void M_DrawTopBar(char *caption)
|
static void M_DrawTopBar(const char *caption)
|
||||||
{
|
{
|
||||||
rotatesprite_fs(160<<16,19<<16,65536L,0,MENUBAR,16,0,10);
|
rotatesprite_fs(160<<16,19<<16,65536L,0,MENUBAR,16,0,10);
|
||||||
menutext(160,24,0,0,caption);
|
menutext(160,24,0,0,caption);
|
||||||
|
@ -2669,7 +2669,7 @@ cheat_for_port_credits2:
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float ratios[] = { 0.0, 1.33, 1.66, 1.78, 1.85, 2.35 };
|
double ratios[] = { 0.0, 1.33, 1.66, 1.78, 1.85, 2.35 };
|
||||||
|
|
||||||
int32_t j = (sizeof(ratios)/sizeof(ratios[0]));
|
int32_t j = (sizeof(ratios)/sizeof(ratios[0]));
|
||||||
|
|
||||||
|
|
|
@ -1243,7 +1243,7 @@ int32_t MIDI_PlaySong
|
||||||
}
|
}
|
||||||
|
|
||||||
_MIDI_TrackMemSize = _MIDI_NumTracks * sizeof(track);
|
_MIDI_TrackMemSize = _MIDI_NumTracks * sizeof(track);
|
||||||
_MIDI_TrackPtr = Bmalloc(_MIDI_TrackMemSize);
|
_MIDI_TrackPtr = (track *)Bmalloc(_MIDI_TrackMemSize);
|
||||||
if (_MIDI_TrackPtr == NULL)
|
if (_MIDI_TrackPtr == NULL)
|
||||||
{
|
{
|
||||||
return(MIDI_NoMemory);
|
return(MIDI_NoMemory);
|
||||||
|
|
|
@ -45,7 +45,7 @@ uint32_t g_netMapRevision = 0;
|
||||||
ENetHost *g_netServer = NULL;
|
ENetHost *g_netServer = NULL;
|
||||||
ENetHost *g_netClient = NULL;
|
ENetHost *g_netClient = NULL;
|
||||||
ENetPeer *g_netClientPeer = NULL;
|
ENetPeer *g_netClientPeer = NULL;
|
||||||
int32_t g_netPort = 23513;
|
enet_uint16 g_netPort = 23513;
|
||||||
int32_t g_netDisconnect = 0;
|
int32_t g_netDisconnect = 0;
|
||||||
char g_netPassword[32];
|
char g_netPassword[32];
|
||||||
int32_t g_netPlayersWaiting = 0;
|
int32_t g_netPlayersWaiting = 0;
|
||||||
|
@ -71,14 +71,14 @@ static void alloc_multimapstate(int32_t i)
|
||||||
{
|
{
|
||||||
if (g_multiMapState[i] == NULL)
|
if (g_multiMapState[i] == NULL)
|
||||||
{
|
{
|
||||||
g_multiMapState[i] = Bcalloc(1, sizeof(netmapstate_t));
|
g_multiMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
|
||||||
if (g_multiMapState[i] == NULL)
|
if (g_multiMapState[i] == NULL)
|
||||||
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_pendingMapState[i] == NULL)
|
if (g_pendingMapState[i] == NULL)
|
||||||
{
|
{
|
||||||
g_pendingMapState[i] = Bcalloc(1, sizeof(netmapstate_t));
|
g_pendingMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
|
||||||
if (g_pendingMapState[i] == NULL)
|
if (g_pendingMapState[i] == NULL)
|
||||||
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ extern ENetPeer *g_netClientPeer;
|
||||||
extern char g_netPassword[32];
|
extern char g_netPassword[32];
|
||||||
extern int32_t g_netDisconnect;
|
extern int32_t g_netDisconnect;
|
||||||
extern int32_t g_netPlayersWaiting;
|
extern int32_t g_netPlayersWaiting;
|
||||||
extern int32_t g_netPort;
|
extern enet_uint16 g_netPort;
|
||||||
extern int32_t g_networkMode;
|
extern int32_t g_networkMode;
|
||||||
extern int32_t lastsectupdate[MAXSECTORS];
|
extern int32_t lastsectupdate[MAXSECTORS];
|
||||||
extern int32_t lastupdate[MAXSPRITES];
|
extern int32_t lastupdate[MAXSPRITES];
|
||||||
|
|
|
@ -88,8 +88,8 @@ static void G_CacheSpriteNum(int32_t i)
|
||||||
|
|
||||||
maxc = 1;
|
maxc = 1;
|
||||||
|
|
||||||
if (A_CheckSpriteTileFlags(PN, SPRITE_CACHE) && g_tile[PN].cacherange[1])
|
if (g_tile[PN].cacherange >= PN)
|
||||||
for (j = g_tile[PN].cacherange[0]; j <= g_tile[PN].cacherange[1]; j++)
|
for (j = PN; j <= g_tile[PN].cacherange; j++)
|
||||||
tloadtile(j,1);
|
tloadtile(j,1);
|
||||||
|
|
||||||
switch (DYNAMICTILEMAP(PN))
|
switch (DYNAMICTILEMAP(PN))
|
||||||
|
@ -227,8 +227,8 @@ static void G_PrecacheSprites(void)
|
||||||
if (g_tile[i].flags & SPRITE_PROJECTILE)
|
if (g_tile[i].flags & SPRITE_PROJECTILE)
|
||||||
tloadtile(i,1);
|
tloadtile(i,1);
|
||||||
|
|
||||||
if (A_CheckSpriteTileFlags(i, SPRITE_CACHE) && g_tile[i].cacherange[1])
|
if (A_CheckSpriteTileFlags(i, SPRITE_CACHE))
|
||||||
for (j = g_tile[i].cacherange[0]; j <= g_tile[i].cacherange[1]; j++)
|
for (j = i; j <= g_tile[i].cacherange; j++)
|
||||||
tloadtile(j,1);
|
tloadtile(j,1);
|
||||||
}
|
}
|
||||||
tloadtile(BOTTOMSTATUSBAR,1);
|
tloadtile(BOTTOMSTATUSBAR,1);
|
||||||
|
@ -1139,7 +1139,7 @@ static inline void prelevel(char g)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sector[i].lotag == -1)
|
if (sector[i].lotag == UINT16_MAX)
|
||||||
{
|
{
|
||||||
g_player[0].ps->exitx = wall[sector[i].wallptr].x;
|
g_player[0].ps->exitx = wall[sector[i].wallptr].x;
|
||||||
g_player[0].ps->exity = wall[sector[i].wallptr].y;
|
g_player[0].ps->exity = wall[sector[i].wallptr].y;
|
||||||
|
@ -1154,7 +1154,7 @@ static inline void prelevel(char g)
|
||||||
A_ResetVars(i);
|
A_ResetVars(i);
|
||||||
A_LoadActor(i);
|
A_LoadActor(i);
|
||||||
VM_OnEvent(EVENT_LOADACTOR, i, -1, -1, 0);
|
VM_OnEvent(EVENT_LOADACTOR, i, -1, -1, 0);
|
||||||
if (sprite[i].lotag == -1 && (sprite[i].cstat&16))
|
if (sprite[i].lotag == UINT16_MAX && (sprite[i].cstat&16))
|
||||||
{
|
{
|
||||||
g_player[0].ps->exitx = SX;
|
g_player[0].ps->exitx = SX;
|
||||||
g_player[0].ps->exity = SY;
|
g_player[0].ps->exity = SY;
|
||||||
|
@ -1799,7 +1799,7 @@ static void realloc_and_copy_musicfn(int32_t level_number, const char *levnamebu
|
||||||
char **musicfn = altp ? &MapInfo[level_number].alt_musicfn : &MapInfo[level_number].musicfn;
|
char **musicfn = altp ? &MapInfo[level_number].alt_musicfn : &MapInfo[level_number].musicfn;
|
||||||
int32_t dastrlen = Bstrlen(levnamebuf);
|
int32_t dastrlen = Bstrlen(levnamebuf);
|
||||||
|
|
||||||
*musicfn = Brealloc(*musicfn, dastrlen+1);
|
*musicfn = (char *)Brealloc(*musicfn, dastrlen+1);
|
||||||
Bstrcpy(*musicfn, levnamebuf);
|
Bstrcpy(*musicfn, levnamebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1902,7 +1902,7 @@ int32_t G_EnterLevel(int32_t g)
|
||||||
if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0)
|
if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0)
|
||||||
{
|
{
|
||||||
if (MapInfo[mii].filename == NULL)
|
if (MapInfo[mii].filename == NULL)
|
||||||
MapInfo[mii].filename = Bcalloc(BMAX_PATH, sizeof(uint8_t));
|
MapInfo[mii].filename = (char *)Bcalloc(BMAX_PATH, sizeof(uint8_t));
|
||||||
if (MapInfo[mii].name == NULL)
|
if (MapInfo[mii].name == NULL)
|
||||||
MapInfo[mii].name = Bstrdup("User Map");
|
MapInfo[mii].name = Bstrdup("User Map");
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ int32_t RTS_AddFile(const char *filename)
|
||||||
//
|
//
|
||||||
// Fill in lumpinfo
|
// Fill in lumpinfo
|
||||||
//
|
//
|
||||||
lump_p = Brealloc(rts_lumpinfo, (rts_numlumps + header.numlumps)*sizeof(lumpinfo_t));
|
lump_p = (lumpinfo_t *)Brealloc(rts_lumpinfo, (rts_numlumps + header.numlumps)*sizeof(lumpinfo_t));
|
||||||
if (!lump_p)
|
if (!lump_p)
|
||||||
{
|
{
|
||||||
kclose(handle);
|
kclose(handle);
|
||||||
|
@ -163,7 +163,7 @@ void RTS_Init(const char *filename)
|
||||||
// set up caching
|
// set up caching
|
||||||
//
|
//
|
||||||
length = (rts_numlumps) * sizeof(*rts_lumpcache);
|
length = (rts_numlumps) * sizeof(*rts_lumpcache);
|
||||||
rts_lumpcache = Bmalloc(length);
|
rts_lumpcache = (void **)Bmalloc(length);
|
||||||
memset(rts_lumpcache,0,length);
|
memset(rts_lumpcache,0,length);
|
||||||
RTS_Started = TRUE;
|
RTS_Started = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ uint8_t g_oldverSavegame[10];
|
||||||
void G_Util_PtrToIdx(void *ptr, int32_t count, const void *base, int32_t mode)
|
void G_Util_PtrToIdx(void *ptr, int32_t count, const void *base, int32_t mode)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
intptr_t *iptr = ptr;
|
intptr_t *iptr = (intptr_t *)ptr;
|
||||||
intptr_t ibase = (intptr_t)base;
|
intptr_t ibase = (intptr_t)base;
|
||||||
int32_t back_p = mode&P2I_BACK_BIT;
|
int32_t back_p = mode&P2I_BACK_BIT;
|
||||||
int32_t onlynon0_p = mode&P2I_ONLYNON0_BIT;
|
int32_t onlynon0_p = mode&P2I_ONLYNON0_BIT;
|
||||||
|
@ -485,7 +485,7 @@ static uint8_t *writespecdata(const dataspec_t *spec, FILE *fil, uint8_t *dump)
|
||||||
|
|
||||||
if (sp->flags&DS_STRING)
|
if (sp->flags&DS_STRING)
|
||||||
{
|
{
|
||||||
fwrite(sp->ptr, Bstrlen(sp->ptr), 1, fil); // not null-terminated!
|
fwrite(sp->ptr, Bstrlen((const char *)sp->ptr), 1, fil); // not null-terminated!
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ static int32_t readspecdata(const dataspec_t *spec, int32_t fil, uint8_t **dumpv
|
||||||
if (sp->flags&(DS_STRING|DS_CMP)) // DS_STRING and DS_CMP is for static data only
|
if (sp->flags&(DS_STRING|DS_CMP)) // DS_STRING and DS_CMP is for static data only
|
||||||
{
|
{
|
||||||
if (sp->flags&(DS_STRING))
|
if (sp->flags&(DS_STRING))
|
||||||
i = Bstrlen(sp->ptr);
|
i = Bstrlen((const char *)sp->ptr);
|
||||||
else
|
else
|
||||||
i = sp->size*sp->cnt;
|
i = sp->size*sp->cnt;
|
||||||
|
|
||||||
|
@ -559,7 +559,7 @@ static int32_t readspecdata(const dataspec_t *spec, int32_t fil, uint8_t **dumpv
|
||||||
|
|
||||||
if (fil>=0)
|
if (fil>=0)
|
||||||
{
|
{
|
||||||
mem = (dump && (sp->flags&DS_NOCHK)==0) ? dump : ptr;
|
mem = (dump && (sp->flags&DS_NOCHK)==0) ? dump : (uint8_t *)ptr;
|
||||||
|
|
||||||
if ((sp->flags&DS_CNTMASK)==0 && sp->size*cnt<=savegame_comprthres)
|
if ((sp->flags&DS_CNTMASK)==0 && sp->size*cnt<=savegame_comprthres)
|
||||||
{
|
{
|
||||||
|
@ -642,8 +642,8 @@ static void docmpsd(const void *ptr, void *dump, uint32_t size, uint32_t cnt, ui
|
||||||
|
|
||||||
#define CPDATA(Datbits) do \
|
#define CPDATA(Datbits) do \
|
||||||
{ \
|
{ \
|
||||||
const UINT(Datbits) *p=ptr; \
|
const UINT(Datbits) *p=(UINT(Datbits) *)ptr; \
|
||||||
UINT(Datbits) *op=dump; \
|
UINT(Datbits) *op=(UINT(Datbits) *)dump; \
|
||||||
uint32_t i, nelts=(size*cnt)/BYTES(Datbits); \
|
uint32_t i, nelts=(size*cnt)/BYTES(Datbits); \
|
||||||
if (nelts>65536) \
|
if (nelts>65536) \
|
||||||
CPELTS(32,Datbits); \
|
CPELTS(32,Datbits); \
|
||||||
|
@ -685,7 +685,7 @@ static void cmpspecdata(const dataspec_t *spec, uint8_t **dumpvar, uint8_t **dif
|
||||||
void *ptr;
|
void *ptr;
|
||||||
uint8_t *dump=*dumpvar, *diff=*diffvar, *tmptr;
|
uint8_t *dump=*dumpvar, *diff=*diffvar, *tmptr;
|
||||||
const dataspec_t *sp=spec;
|
const dataspec_t *sp=spec;
|
||||||
int32_t cnt, eltnum=0, nbytes=(getnumvar(spec)+7)>>3, l=Bstrlen(spec->ptr);
|
int32_t cnt, eltnum=0, nbytes=(getnumvar(spec)+7)>>3, l=Bstrlen((const char *)spec->ptr);
|
||||||
|
|
||||||
Bmemcpy(diff, spec->ptr, l);
|
Bmemcpy(diff, spec->ptr, l);
|
||||||
diff+=l;
|
diff+=l;
|
||||||
|
@ -728,7 +728,7 @@ static int32_t applydiff(const dataspec_t *spec, uint8_t **dumpvar, uint8_t **di
|
||||||
{
|
{
|
||||||
uint8_t *dumptr=*dumpvar, *diffptr=*diffvar;
|
uint8_t *dumptr=*dumpvar, *diffptr=*diffvar;
|
||||||
const dataspec_t *sp=spec;
|
const dataspec_t *sp=spec;
|
||||||
int32_t cnt, eltnum=-1, nbytes=(getnumvar(spec)+7)>>3, l=Bstrlen(spec->ptr);
|
int32_t cnt, eltnum=-1, nbytes=(getnumvar(spec)+7)>>3, l=Bstrlen((const char *)spec->ptr);
|
||||||
|
|
||||||
if (Bmemcmp(diffptr, spec->ptr, l)) // check STRING magic (sync check)
|
if (Bmemcmp(diffptr, spec->ptr, l)) // check STRING magic (sync check)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -882,7 +882,7 @@ static uint8_t savegame_restdata[SVARDATALEN];
|
||||||
|
|
||||||
static const dataspec_t svgm_udnetw[] =
|
static const dataspec_t svgm_udnetw[] =
|
||||||
{
|
{
|
||||||
{ DS_STRING, "blK:udnt", 0, 1 },
|
{ DS_STRING, (void *)"blK:udnt", 0, 1 },
|
||||||
{ 0, &ud.multimode, sizeof(ud.multimode), 1 },
|
{ 0, &ud.multimode, sizeof(ud.multimode), 1 },
|
||||||
{ 0, &g_numPlayerSprites, sizeof(g_numPlayerSprites), 1 },
|
{ 0, &g_numPlayerSprites, sizeof(g_numPlayerSprites), 1 },
|
||||||
{ 0, &g_playerSpawnPoints, sizeof(g_playerSpawnPoints), 1 },
|
{ 0, &g_playerSpawnPoints, sizeof(g_playerSpawnPoints), 1 },
|
||||||
|
@ -925,7 +925,7 @@ static const dataspec_t svgm_udnetw[] =
|
||||||
|
|
||||||
static const dataspec_t svgm_secwsp[] =
|
static const dataspec_t svgm_secwsp[] =
|
||||||
{
|
{
|
||||||
{ DS_STRING, "blK:swsp", 0, 1 },
|
{ DS_STRING, (void *)"blK:swsp", 0, 1 },
|
||||||
{ DS_NOCHK, &numwalls, sizeof(numwalls), 1 },
|
{ DS_NOCHK, &numwalls, sizeof(numwalls), 1 },
|
||||||
{ DS_MAINAR|DS_CNT(numwalls), &wall, sizeof(walltype), (intptr_t)&numwalls },
|
{ DS_MAINAR|DS_CNT(numwalls), &wall, sizeof(walltype), (intptr_t)&numwalls },
|
||||||
{ DS_NOCHK, &numsectors, sizeof(numsectors), 1 },
|
{ DS_NOCHK, &numsectors, sizeof(numsectors), 1 },
|
||||||
|
@ -969,7 +969,7 @@ static const dataspec_t svgm_secwsp[] =
|
||||||
|
|
||||||
static const dataspec_t svgm_script[] =
|
static const dataspec_t svgm_script[] =
|
||||||
{
|
{
|
||||||
{ DS_STRING, "blK:scri", 0, 1 },
|
{ DS_STRING, (void *)"blK:scri", 0, 1 },
|
||||||
{ DS_NOCHK, &g_scriptSize, sizeof(g_scriptSize), 1 },
|
{ DS_NOCHK, &g_scriptSize, sizeof(g_scriptSize), 1 },
|
||||||
{ DS_SAVEFN|DS_LOADFN|DS_NOCHK, (void *)&sv_calcbitptrsize, 0, 1 },
|
{ DS_SAVEFN|DS_LOADFN|DS_NOCHK, (void *)&sv_calcbitptrsize, 0, 1 },
|
||||||
{ DS_DYNAMIC|DS_CNT(savegame_bitptrsize)|DS_NOCHK, &bitptr, sizeof(bitptr[0]), (intptr_t)&savegame_bitptrsize },
|
{ DS_DYNAMIC|DS_CNT(savegame_bitptrsize)|DS_NOCHK, &bitptr, sizeof(bitptr[0]), (intptr_t)&savegame_bitptrsize },
|
||||||
|
@ -990,7 +990,7 @@ static const dataspec_t svgm_script[] =
|
||||||
|
|
||||||
static const dataspec_t svgm_anmisc[] =
|
static const dataspec_t svgm_anmisc[] =
|
||||||
{
|
{
|
||||||
{ DS_STRING, "blK:anms", 0, 1 },
|
{ DS_STRING, (void *)"blK:anms", 0, 1 },
|
||||||
{ 0, &g_animateCount, sizeof(g_animateCount), 1 },
|
{ 0, &g_animateCount, sizeof(g_animateCount), 1 },
|
||||||
{ 0, &animatesect[0], sizeof(animatesect[0]), MAXANIMATES },
|
{ 0, &animatesect[0], sizeof(animatesect[0]), MAXANIMATES },
|
||||||
{ 0, &animategoal[0], sizeof(animategoal[0]), MAXANIMATES },
|
{ 0, &animategoal[0], sizeof(animategoal[0]), MAXANIMATES },
|
||||||
|
@ -1031,7 +1031,7 @@ static const dataspec_t svgm_anmisc[] =
|
||||||
{ 0, savegame_restdata, 1, sizeof(savegame_restdata) }, // sz/cnt swapped for kdfread
|
{ 0, savegame_restdata, 1, sizeof(savegame_restdata) }, // sz/cnt swapped for kdfread
|
||||||
{ DS_LOADFN, (void *)&sv_restload, 0, 1 },
|
{ DS_LOADFN, (void *)&sv_restload, 0, 1 },
|
||||||
|
|
||||||
{ DS_STRING, "savegame_end", 0, 1 },
|
{ DS_STRING, (void *)"savegame_end", 0, 1 },
|
||||||
{ DS_END, 0, 0, 0 }
|
{ DS_END, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1062,7 +1062,7 @@ static void sv_makevarspec()
|
||||||
for (i=0; i<g_gameVarCount; i++)
|
for (i=0; i<g_gameVarCount; i++)
|
||||||
numsavedvars += (aGameVars[i].dwFlags&SV_SKIPMASK) ? 0 : 1;
|
numsavedvars += (aGameVars[i].dwFlags&SV_SKIPMASK) ? 0 : 1;
|
||||||
|
|
||||||
svgm_vars = Bmalloc((numsavedvars+g_gameArrayCount+2)*sizeof(dataspec_t));
|
svgm_vars = (dataspec_t *)Bmalloc((numsavedvars+g_gameArrayCount+2)*sizeof(dataspec_t));
|
||||||
|
|
||||||
svgm_vars[0].flags = DS_STRING;
|
svgm_vars[0].flags = DS_STRING;
|
||||||
svgm_vars[0].ptr = magic;
|
svgm_vars[0].ptr = magic;
|
||||||
|
@ -1111,11 +1111,11 @@ static int32_t doallocsnap(int32_t allocinit)
|
||||||
{
|
{
|
||||||
sv_freemem();
|
sv_freemem();
|
||||||
|
|
||||||
svsnapshot = Bmalloc(svsnapsiz);
|
svsnapshot = (uint8_t *)Bmalloc(svsnapsiz);
|
||||||
if (allocinit)
|
if (allocinit)
|
||||||
svinitsnap = Bmalloc(svsnapsiz);
|
svinitsnap = (uint8_t *)Bmalloc(svsnapsiz);
|
||||||
svdiffsiz = svsnapsiz; // theoretically it's less than could be needed in the worst case, but practically it's overkill
|
svdiffsiz = svsnapsiz; // theoretically it's less than could be needed in the worst case, but practically it's overkill
|
||||||
svdiff = Bmalloc(svdiffsiz);
|
svdiff = (uint8_t *)Bmalloc(svdiffsiz);
|
||||||
if (svsnapshot==NULL || (allocinit && svinitsnap==NULL) || svdiff==NULL)
|
if (svsnapshot==NULL || (allocinit && svinitsnap==NULL) || svdiff==NULL)
|
||||||
{
|
{
|
||||||
sv_freemem();
|
sv_freemem();
|
||||||
|
@ -1499,7 +1499,7 @@ static void sv_prescriptload_once()
|
||||||
{
|
{
|
||||||
if (script)
|
if (script)
|
||||||
Bfree(script);
|
Bfree(script);
|
||||||
script = Bmalloc(g_scriptSize * sizeof(script[0]));
|
script = (intptr_t *)Bmalloc(g_scriptSize * sizeof(script[0]));
|
||||||
}
|
}
|
||||||
static void sv_postscript_once()
|
static void sv_postscript_once()
|
||||||
{
|
{
|
||||||
|
@ -1551,7 +1551,7 @@ static void sv_postanimateptr()
|
||||||
static void sv_prequote()
|
static void sv_prequote()
|
||||||
{
|
{
|
||||||
if (!savegame_quotes)
|
if (!savegame_quotes)
|
||||||
savegame_quotes = Bcalloc(MAXQUOTES, MAXQUOTELEN);
|
savegame_quotes = (char (*)[MAXQUOTELEN])Bcalloc(MAXQUOTES, MAXQUOTELEN);
|
||||||
}
|
}
|
||||||
static void sv_quotesave()
|
static void sv_quotesave()
|
||||||
{
|
{
|
||||||
|
@ -1572,7 +1572,7 @@ static void sv_quoteload()
|
||||||
if (savegame_quotedef[i>>3]&(1<<(i&7)))
|
if (savegame_quotedef[i>>3]&(1<<(i&7)))
|
||||||
{
|
{
|
||||||
if (!ScriptQuotes[i])
|
if (!ScriptQuotes[i])
|
||||||
ScriptQuotes[i] = Bcalloc(1, MAXQUOTELEN);
|
ScriptQuotes[i] = (char *)Bcalloc(1, MAXQUOTELEN);
|
||||||
Bmemcpy(ScriptQuotes[i], savegame_quotes[i], MAXQUOTELEN);
|
Bmemcpy(ScriptQuotes[i], savegame_quotes[i], MAXQUOTELEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1580,7 +1580,7 @@ static void sv_quoteload()
|
||||||
static void sv_prequoteredef()
|
static void sv_prequoteredef()
|
||||||
{
|
{
|
||||||
// "+1" needed for dfwrite which doesn't handle the src==NULL && cnt==0 case
|
// "+1" needed for dfwrite which doesn't handle the src==NULL && cnt==0 case
|
||||||
savegame_quoteredefs = Bcalloc(g_numQuoteRedefinitions+1, MAXQUOTELEN);
|
savegame_quoteredefs = (char (*)[MAXQUOTELEN])Bcalloc(g_numQuoteRedefinitions+1, MAXQUOTELEN);
|
||||||
}
|
}
|
||||||
static void sv_quoteredefsave()
|
static void sv_quoteredefsave()
|
||||||
{
|
{
|
||||||
|
@ -1595,7 +1595,7 @@ static void sv_quoteredefload()
|
||||||
for (i=0; i<g_numQuoteRedefinitions; i++)
|
for (i=0; i<g_numQuoteRedefinitions; i++)
|
||||||
{
|
{
|
||||||
if (!ScriptQuoteRedefinitions[i])
|
if (!ScriptQuoteRedefinitions[i])
|
||||||
ScriptQuoteRedefinitions[i] = Bcalloc(1,MAXQUOTELEN);
|
ScriptQuoteRedefinitions[i] = (char *)Bcalloc(1,MAXQUOTELEN);
|
||||||
Bmemcpy(ScriptQuoteRedefinitions[i], savegame_quoteredefs[i], MAXQUOTELEN);
|
Bmemcpy(ScriptQuoteRedefinitions[i], savegame_quoteredefs[i], MAXQUOTELEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3031,7 +3031,7 @@ void P_CheckSectors(int32_t snum)
|
||||||
P_DoQuote(QUOTE_FOUND_SECRET,p);
|
P_DoQuote(QUOTE_FOUND_SECRET,p);
|
||||||
p->secret_rooms++;
|
p->secret_rooms++;
|
||||||
return;
|
return;
|
||||||
case -1:
|
case UINT16_MAX:
|
||||||
for (TRAVERSE_CONNECT(i))
|
for (TRAVERSE_CONNECT(i))
|
||||||
g_player[i].ps->gm = MODE_EOL;
|
g_player[i].ps->gm = MODE_EOL;
|
||||||
sector[p->cursectnum].lotag = 0;
|
sector[p->cursectnum].lotag = 0;
|
||||||
|
@ -3049,7 +3049,7 @@ void P_CheckSectors(int32_t snum)
|
||||||
ud.m_level_number = ud.level_number;
|
ud.m_level_number = ud.level_number;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case -2:
|
case UINT16_MAX-1:
|
||||||
sector[p->cursectnum].lotag = 0;
|
sector[p->cursectnum].lotag = 0;
|
||||||
p->timebeforeexit = GAMETICSPERSEC*8;
|
p->timebeforeexit = GAMETICSPERSEC*8;
|
||||||
p->customexitsound = sector[p->cursectnum].hitag;
|
p->customexitsound = sector[p->cursectnum].hitag;
|
||||||
|
|
|
@ -354,9 +354,9 @@ static void PopulateForm(unsigned char pgs)
|
||||||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||||
if (i == mode3d)
|
if (i == mode3d)
|
||||||
{
|
{
|
||||||
g_signal_handlers_block_by_func(stwidgets.vmode3dcombo, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_block_by_func(stwidgets.vmode3dcombo, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||||
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(stwidgets.vmode3dcombo), &iter);
|
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(stwidgets.vmode3dcombo), &iter);
|
||||||
g_signal_handlers_unblock_by_func(stwidgets.vmode3dcombo, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_unblock_by_func(stwidgets.vmode3dcombo, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -461,9 +461,9 @@ static void PopulateForm(unsigned char pgs)
|
||||||
if (!Bstrcasecmp(fg->name, settings.selectedgrp))
|
if (!Bstrcasecmp(fg->name, settings.selectedgrp))
|
||||||
{
|
{
|
||||||
GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist);
|
GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist);
|
||||||
g_signal_handlers_block_by_func(sel, on_gamelist_selection_changed, NULL);
|
g_signal_handlers_block_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL);
|
||||||
gtk_tree_selection_select_iter(sel, &iter);
|
gtk_tree_selection_select_iter(sel, &iter);
|
||||||
g_signal_handlers_unblock_by_func(sel, on_gamelist_selection_changed, NULL);
|
g_signal_handlers_unblock_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,9 +524,9 @@ static GtkWidget *create_window(void)
|
||||||
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:");
|
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||||
#else
|
#else
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 7);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// 3D video mode combo
|
// 3D video mode combo
|
||||||
|
@ -543,17 +543,18 @@ static GtkWidget *create_window(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||||
#else
|
#else
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 7);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fullscreen checkbox
|
// Fullscreen checkbox
|
||||||
stwidgets.displayvlayout = gtk_vbox_new(TRUE, 0);
|
stwidgets.displayvlayout = gtk_vbox_new(TRUE, 0);
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||||
#else
|
#else
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, 0, 4, 7);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||||
|
@ -568,7 +569,7 @@ static GtkWidget *create_window(void)
|
||||||
// Input devices LabelText
|
// Input devices LabelText
|
||||||
stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:");
|
stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.inputdevlabel), 0.3, 0);
|
gtk_misc_set_alignment(GTK_MISC(stwidgets.inputdevlabel), 0.3, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 1,2, GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 1,2, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||||
|
|
||||||
// Input devices combo
|
// Input devices combo
|
||||||
{
|
{
|
||||||
|
@ -582,12 +583,13 @@ static GtkWidget *create_window(void)
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, FALSE);
|
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, FALSE);
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, "text", 0, NULL);
|
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, "text", 0, NULL);
|
||||||
}
|
}
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||||
|
|
||||||
// Custom mod LabelText
|
// Custom mod LabelText
|
||||||
stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _game:");
|
stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _game:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0);
|
gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, 0, 4, 7);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||||
|
|
||||||
// Custom mod combo
|
// Custom mod combo
|
||||||
{
|
{
|
||||||
|
@ -601,19 +603,21 @@ static GtkWidget *create_window(void)
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, FALSE);
|
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, FALSE);
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, "text", 0, NULL);
|
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, "text", 0, NULL);
|
||||||
}
|
}
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodcombo, 1,2, 2,3, GTK_EXPAND | GTK_FILL, 0, 4, 7);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodcombo, 1,2, 2,3,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 7);
|
||||||
|
|
||||||
// Empty horizontal layout
|
// Empty horizontal layout
|
||||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,3, 3,4, 0, GTK_EXPAND | GTK_FILL, 4, 0);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,3, 3,4, (GtkAttachOptions)0,
|
||||||
|
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 4, 0);
|
||||||
|
|
||||||
// Autoload checkbox
|
// Autoload checkbox
|
||||||
stwidgets.autoloadcheck = gtk_check_button_new_with_mnemonic("_Enable \"autoload\" folder");
|
stwidgets.autoloadcheck = gtk_check_button_new_with_mnemonic("_Enable \"autoload\" folder");
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.autoloadcheck, 0,3, 4,5, GTK_FILL, 0, 2, 2);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.autoloadcheck, 0,3, 4,5, GTK_FILL, (GtkAttachOptions)0, 2, 2);
|
||||||
|
|
||||||
// Always show config checkbox
|
// Always show config checkbox
|
||||||
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show this window at startup");
|
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show this window at startup");
|
||||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,3, 5,6, GTK_FILL, 0, 2, 2);
|
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,3, 5,6, GTK_FILL, (GtkAttachOptions)0, 2, 2);
|
||||||
|
|
||||||
// Configuration tab
|
// Configuration tab
|
||||||
stwidgets.configtab = gtk_label_new("Configuration");
|
stwidgets.configtab = gtk_label_new("Configuration");
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
typedef signed int ssize_t;
|
typedef signed int ssize_t;
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
||||||
typedef unsigned long uint32_t;
|
typedef unsigned __int32 uint32_t;
|
||||||
typedef ULONGLONG uint64_t;
|
typedef ULONGLONG uint64_t;
|
||||||
#else
|
#else
|
||||||
/* mingw32, lcc and watcom provide a proper header */
|
/* mingw32, lcc and watcom provide a proper header */
|
||||||
|
|
Loading…
Reference in a new issue