mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 06:41:59 +00:00
- more macOS compilation fixes
Still not complete…
This commit is contained in:
parent
134122335b
commit
fb985d2503
70 changed files with 165 additions and 733 deletions
|
@ -269,6 +269,7 @@ else()
|
|||
|
||||
|
||||
if( APPLE )
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
|
||||
if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
|
||||
# With standard Apple tools -stdlib=libc++ needs to be specified in order to get
|
||||
# C++11 support using SDKs 10.7 and 10.8.
|
||||
|
|
|
@ -27,7 +27,7 @@ endif()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
option( DYN_FLUIDSYNTH "Dynamically load fluidsynth" ON )
|
||||
|
@ -435,7 +435,7 @@ endif()
|
|||
|
||||
# Ugh... These precompiled dependencies need to go.
|
||||
if (WIN32)
|
||||
include_directories( "platform/win32" "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/windows/include/sdl2")
|
||||
include_directories( "platform/win32" "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
@ -522,11 +522,11 @@ if( WIN32 )
|
|||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} platform/win32/gameres.rc )
|
||||
elseif( APPLE )
|
||||
if( OSX_COCOA_BACKEND )
|
||||
#set( SYSTEM_SOURCES_DIR platform/posix posix/cocoa )
|
||||
set( SYSTEM_SOURCES_DIR posix/cocoa )
|
||||
set( SYSTEM_SOURCES ${PLAT_COCOA_SOURCES} )
|
||||
set( OTHER_SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ${PLAT_SDL_SOURCES} ${PLAT_UNIX_SOURCES} )
|
||||
else()
|
||||
set( SYSTEM_SOURCES_DIR platform/posix platform/posix/sdl )
|
||||
set( SYSTEM_SOURCES_DIR platform/posix/sdl )
|
||||
set( SYSTEM_SOURCES ${PLAT_SDL_SOURCES} )
|
||||
set( PLAT_OSX_SOURCES ${PLAT_OSX_SOURCES} platform/posix/sdl/i_system.mm )
|
||||
set( OTHER_SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ${PLAT_COCOA_SOURCES} ${PLAT_UNIX_SOURCES} )
|
||||
|
@ -911,9 +911,13 @@ include_directories(
|
|||
|
||||
${CMAKE_BINARY_DIR}/libraries/gdtoa
|
||||
|
||||
#${SYSTEM_SOURCES_DIR}
|
||||
${SYSTEM_SOURCES_DIR}
|
||||
)
|
||||
|
||||
if (NOT WIN32)
|
||||
include_directories(platform/posix)
|
||||
endif()
|
||||
|
||||
add_dependencies( ${PROJECT_NAME} revision_check )
|
||||
|
||||
# Due to some quirks, we need to do this in this order
|
||||
|
|
|
@ -7,15 +7,15 @@ require_strnicmp()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
||||
|
||||
if (WIN32)
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
|
|
@ -1395,23 +1395,6 @@ RESTART:
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int32_t S_DefineAudioIfSupported(char *fn, const char *name)
|
||||
{
|
||||
#if !defined HAVE_FLAC || !defined HAVE_VORBIS
|
||||
const char *extension = Bstrrchr(name, '.');
|
||||
# if !defined HAVE_FLAC
|
||||
if (extension && !Bstrcasecmp(extension, ".flac"))
|
||||
return -2;
|
||||
# endif
|
||||
# if !defined HAVE_VORBIS
|
||||
if (extension && !Bstrcasecmp(extension, ".ogg"))
|
||||
return -2;
|
||||
# endif
|
||||
#endif
|
||||
Bstrncpy(fn, name, BMAX_PATH);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Returns:
|
||||
// 0: all OK
|
||||
// -1: ID declaration was invalid:
|
||||
|
|
|
@ -100,7 +100,7 @@ struct GameInterface : ::GameInterface
|
|||
bool SaveGame(FSaveGameNode*) override;
|
||||
bool LoadGame(FSaveGameNode*) override;
|
||||
void DoPrintMessage(int prio, const char*) override;
|
||||
void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg);
|
||||
void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg) override;
|
||||
void QuitToTitle() override;
|
||||
FString GetCoordString() override;
|
||||
|
||||
|
|
|
@ -1960,7 +1960,7 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
|||
int nSound = gSuicide[nMessage].at4;
|
||||
if (pVictim == gMe && gMe->handTime <= 0)
|
||||
{
|
||||
sprintf(buffer, GStrings("TXTB_KILLSELF"));
|
||||
strcpy(buffer, GStrings("TXTB_KILLSELF"));
|
||||
if (gGameOptions.nGameType > 0 && nSound >= 0)
|
||||
sndStartSample(nSound, 255, 2, 0);
|
||||
}
|
||||
|
|
|
@ -77,8 +77,6 @@ float debug1, debug2;
|
|||
int32_t mapversion=7; // JBF 20040211: default mapversion to 7
|
||||
int32_t g_loadedMapVersion = -1; // -1: none (e.g. started new)
|
||||
|
||||
static int32_t get_mapversion(void);
|
||||
|
||||
// Handle nonpow2-ysize walls the old way?
|
||||
static FORCE_INLINE int32_t oldnonpow2(void)
|
||||
{
|
||||
|
@ -180,7 +178,6 @@ int32_t showheightindicators=1;
|
|||
int32_t circlewall=-1;
|
||||
|
||||
static void classicScanSector(int16_t startsectnum);
|
||||
static void draw_rainbow_background(void);
|
||||
|
||||
int16_t editstatus = 0;
|
||||
static fix16_t global100horiz; // (-100..300)-scale horiz (the one passed to drawrooms)
|
||||
|
@ -1120,26 +1117,6 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_
|
|||
|
||||
#endif // defined YAX_ENABLE
|
||||
|
||||
// must have writable frame buffer, i.e. done begindrawing()
|
||||
static void draw_rainbow_background(void)
|
||||
{
|
||||
int32_t y, i;
|
||||
const int32_t N = 240; // don't use fullbright colors
|
||||
const int32_t numfull=bytesperline/N, numrest=bytesperline%N;
|
||||
|
||||
const char *const src = palookup[0] + 256*18;
|
||||
char *dst = (char *)frameplace;
|
||||
|
||||
for (y=0; y<ydim; y++)
|
||||
{
|
||||
for (i=0; i<numfull; i++)
|
||||
Bmemcpy(&dst[N*i], src, N);
|
||||
if (numrest > 0)
|
||||
Bmemcpy(&dst[N*i], src, numrest);
|
||||
|
||||
dst += bytesperline;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// setslope
|
||||
|
@ -6249,295 +6226,6 @@ static void renderDrawMaskedWall(int16_t damaskwallcnt)
|
|||
}
|
||||
|
||||
|
||||
static inline int32_t addscaleclamp(int32_t a, int32_t b, int32_t s1, int32_t s2)
|
||||
{
|
||||
// a + scale(b, s1, s1-s2), but without arithmetic exception when the
|
||||
// scale() expression overflows
|
||||
|
||||
int64_t tmp = (int64_t)a + tabledivide64((int64_t)b*s1, s1-s2);
|
||||
|
||||
if (EDUKE32_PREDICT_FALSE(tmp <= INT32_MIN+1))
|
||||
return INT32_MIN+1;
|
||||
if (EDUKE32_PREDICT_FALSE(tmp >= INT32_MAX))
|
||||
return INT32_MAX;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//
|
||||
// clippoly (internal)
|
||||
//
|
||||
static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||
{
|
||||
int32_t z, zz, s1, s2, t, npoints2, start2, z1, z2, z3, z4, splitcnt;
|
||||
int32_t cx1, cy1, cx2, cy2;
|
||||
|
||||
cx1 = windowxy1.x;
|
||||
cy1 = windowxy1.y;
|
||||
cx2 = windowxy2.x+1;
|
||||
cy2 = windowxy2.y+1;
|
||||
cx1 <<= 12; cy1 <<= 12; cx2 <<= 12; cy2 <<= 12;
|
||||
|
||||
if (clipstat&0xa) //Need to clip top or left
|
||||
{
|
||||
npoints2 = 0; start2 = 0; z = 0; splitcnt = 0;
|
||||
do
|
||||
{
|
||||
s2 = cx1-rx1[z];
|
||||
do
|
||||
{
|
||||
zz = xb1[z]; xb1[z] = -1;
|
||||
s1 = s2; s2 = cx1-rx1[zz];
|
||||
if (s1 < 0)
|
||||
{
|
||||
rx2[npoints2] = rx1[z]; ry2[npoints2] = ry1[z];
|
||||
xb2[npoints2] = npoints2+1; npoints2++;
|
||||
}
|
||||
if ((s1^s2) < 0)
|
||||
{
|
||||
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
||||
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
||||
if (s1 < 0) bunchp2[splitcnt++] = npoints2;
|
||||
xb2[npoints2] = npoints2+1;
|
||||
npoints2++;
|
||||
}
|
||||
z = zz;
|
||||
}
|
||||
while (xb1[z] >= 0);
|
||||
|
||||
if (npoints2 >= start2+3)
|
||||
xb2[npoints2-1] = start2, start2 = npoints2;
|
||||
else
|
||||
npoints2 = start2;
|
||||
|
||||
z = 1;
|
||||
while ((z < npoints) && (xb1[z] < 0)) z++;
|
||||
}
|
||||
while (z < npoints);
|
||||
if (npoints2 <= 2) return 0;
|
||||
|
||||
for (z=1; z<splitcnt; z++)
|
||||
for (zz=0; zz<z; zz++)
|
||||
{
|
||||
z1 = bunchp2[z]; z2 = xb2[z1]; z3 = bunchp2[zz]; z4 = xb2[z3];
|
||||
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
||||
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
||||
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
||||
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
||||
if (s2 < s1)
|
||||
{ t = xb2[bunchp2[z]]; xb2[bunchp2[z]] = xb2[bunchp2[zz]]; xb2[bunchp2[zz]] = t; }
|
||||
}
|
||||
|
||||
|
||||
npoints = 0; start2 = 0; z = 0; splitcnt = 0;
|
||||
do
|
||||
{
|
||||
s2 = cy1-ry2[z];
|
||||
do
|
||||
{
|
||||
zz = xb2[z]; xb2[z] = -1;
|
||||
s1 = s2; s2 = cy1-ry2[zz];
|
||||
if (s1 < 0)
|
||||
{
|
||||
rx1[npoints] = rx2[z]; ry1[npoints] = ry2[z];
|
||||
xb1[npoints] = npoints+1; npoints++;
|
||||
}
|
||||
if ((s1^s2) < 0)
|
||||
{
|
||||
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
||||
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
||||
if (s1 < 0) bunchp2[splitcnt++] = npoints;
|
||||
xb1[npoints] = npoints+1;
|
||||
npoints++;
|
||||
}
|
||||
z = zz;
|
||||
}
|
||||
while (xb2[z] >= 0);
|
||||
|
||||
if (npoints >= start2+3)
|
||||
xb1[npoints-1] = start2, start2 = npoints;
|
||||
else
|
||||
npoints = start2;
|
||||
|
||||
z = 1;
|
||||
while ((z < npoints2) && (xb2[z] < 0)) z++;
|
||||
}
|
||||
while (z < npoints2);
|
||||
if (npoints <= 2) return 0;
|
||||
|
||||
for (z=1; z<splitcnt; z++)
|
||||
for (zz=0; zz<z; zz++)
|
||||
{
|
||||
z1 = bunchp2[z]; z2 = xb1[z1]; z3 = bunchp2[zz]; z4 = xb1[z3];
|
||||
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
||||
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
||||
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
||||
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
||||
if (s2 < s1)
|
||||
{ t = xb1[bunchp2[z]]; xb1[bunchp2[z]] = xb1[bunchp2[zz]]; xb1[bunchp2[zz]] = t; }
|
||||
}
|
||||
}
|
||||
if (clipstat&0x5) //Need to clip bottom or right
|
||||
{
|
||||
npoints2 = 0; start2 = 0; z = 0; splitcnt = 0;
|
||||
do
|
||||
{
|
||||
s2 = rx1[z]-cx2;
|
||||
do
|
||||
{
|
||||
zz = xb1[z]; xb1[z] = -1;
|
||||
s1 = s2; s2 = rx1[zz]-cx2;
|
||||
if (s1 < 0)
|
||||
{
|
||||
rx2[npoints2] = rx1[z]; ry2[npoints2] = ry1[z];
|
||||
xb2[npoints2] = npoints2+1; npoints2++;
|
||||
}
|
||||
if ((s1^s2) < 0)
|
||||
{
|
||||
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
||||
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
||||
if (s1 < 0) bunchp2[splitcnt++] = npoints2;
|
||||
xb2[npoints2] = npoints2+1;
|
||||
npoints2++;
|
||||
}
|
||||
z = zz;
|
||||
}
|
||||
while (xb1[z] >= 0);
|
||||
|
||||
if (npoints2 >= start2+3)
|
||||
xb2[npoints2-1] = start2, start2 = npoints2;
|
||||
else
|
||||
npoints2 = start2;
|
||||
|
||||
z = 1;
|
||||
while ((z < npoints) && (xb1[z] < 0)) z++;
|
||||
}
|
||||
while (z < npoints);
|
||||
if (npoints2 <= 2) return 0;
|
||||
|
||||
for (z=1; z<splitcnt; z++)
|
||||
for (zz=0; zz<z; zz++)
|
||||
{
|
||||
z1 = bunchp2[z]; z2 = xb2[z1]; z3 = bunchp2[zz]; z4 = xb2[z3];
|
||||
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
||||
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
||||
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
||||
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
||||
if (s2 < s1)
|
||||
{ t = xb2[bunchp2[z]]; xb2[bunchp2[z]] = xb2[bunchp2[zz]]; xb2[bunchp2[zz]] = t; }
|
||||
}
|
||||
|
||||
|
||||
npoints = 0; start2 = 0; z = 0; splitcnt = 0;
|
||||
do
|
||||
{
|
||||
s2 = ry2[z]-cy2;
|
||||
do
|
||||
{
|
||||
zz = xb2[z]; xb2[z] = -1;
|
||||
s1 = s2; s2 = ry2[zz]-cy2;
|
||||
if (s1 < 0)
|
||||
{
|
||||
rx1[npoints] = rx2[z]; ry1[npoints] = ry2[z];
|
||||
xb1[npoints] = npoints+1; npoints++;
|
||||
}
|
||||
if ((s1^s2) < 0)
|
||||
{
|
||||
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
||||
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
||||
if (s1 < 0) bunchp2[splitcnt++] = npoints;
|
||||
xb1[npoints] = npoints+1;
|
||||
npoints++;
|
||||
}
|
||||
z = zz;
|
||||
}
|
||||
while (xb2[z] >= 0);
|
||||
|
||||
if (npoints >= start2+3)
|
||||
xb1[npoints-1] = start2, start2 = npoints;
|
||||
else
|
||||
npoints = start2;
|
||||
|
||||
z = 1;
|
||||
while ((z < npoints2) && (xb2[z] < 0)) z++;
|
||||
}
|
||||
while (z < npoints2);
|
||||
if (npoints <= 2) return 0;
|
||||
|
||||
for (z=1; z<splitcnt; z++)
|
||||
for (zz=0; zz<z; zz++)
|
||||
{
|
||||
z1 = bunchp2[z]; z2 = xb1[z1]; z3 = bunchp2[zz]; z4 = xb1[z3];
|
||||
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
||||
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
||||
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
||||
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
||||
if (s2 < s1)
|
||||
{ t = xb1[bunchp2[z]]; xb1[bunchp2[z]] = xb1[bunchp2[zz]]; xb1[bunchp2[zz]] = t; }
|
||||
}
|
||||
}
|
||||
return npoints;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// clippoly4 (internal)
|
||||
//
|
||||
//Assume npoints=4 with polygon on &nrx1,&nry1
|
||||
//JBF 20031206: Thanks to Ken's hunting, s/(rx1|ry1|rx2|ry2)/n\1/ in this function
|
||||
static int32_t clippoly4(int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2)
|
||||
{
|
||||
int32_t n, nn, z, zz, x, x1, x2, y, y1, y2, t;
|
||||
|
||||
nn = 0; z = 0;
|
||||
do
|
||||
{
|
||||
zz = ((z+1)&3);
|
||||
x1 = nrx1[z]; x2 = nrx1[zz]-x1;
|
||||
|
||||
if ((cx1 <= x1) && (x1 <= cx2))
|
||||
nrx2[nn] = x1, nry2[nn] = nry1[z], nn++;
|
||||
|
||||
if (x2 <= 0) x = cx2; else x = cx1;
|
||||
t = x-x1;
|
||||
if (((t-x2)^t) < 0)
|
||||
nrx2[nn] = x, nry2[nn] = nry1[z]+scale(t,nry1[zz]-nry1[z],x2), nn++;
|
||||
|
||||
if (x2 <= 0) x = cx1; else x = cx2;
|
||||
t = x-x1;
|
||||
if (((t-x2)^t) < 0)
|
||||
nrx2[nn] = x, nry2[nn] = nry1[z]+scale(t,nry1[zz]-nry1[z],x2), nn++;
|
||||
|
||||
z = zz;
|
||||
}
|
||||
while (z != 0);
|
||||
if (nn < 3) return 0;
|
||||
|
||||
n = 0; z = 0;
|
||||
do
|
||||
{
|
||||
zz = z+1; if (zz == nn) zz = 0;
|
||||
y1 = nry2[z]; y2 = nry2[zz]-y1;
|
||||
|
||||
if ((cy1 <= y1) && (y1 <= cy2))
|
||||
nry1[n] = y1, nrx1[n] = nrx2[z], n++;
|
||||
|
||||
if (y2 <= 0) y = cy2; else y = cy1;
|
||||
t = y-y1;
|
||||
if (((t-y2)^t) < 0)
|
||||
nry1[n] = y, nrx1[n] = nrx2[z]+scale(t,nrx2[zz]-nrx2[z],y2), n++;
|
||||
|
||||
if (y2 <= 0) y = cy1; else y = cy2;
|
||||
t = y-y1;
|
||||
if (((t-y2)^t) < 0)
|
||||
nry1[n] = y, nrx1[n] = nrx2[z]+scale(t,nrx2[zz]-nrx2[z],y2), n++;
|
||||
|
||||
z = zz;
|
||||
}
|
||||
while (z != 0);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
static uint32_t msqrtasm(uint32_t c)
|
||||
{
|
||||
uint32_t a = 0x40000000l, b = 0x20000000l;
|
||||
|
@ -9093,37 +8781,6 @@ int32_t engineLoadBoardV5V6(const char *filename, char fromwhere, vec3_t *dapos,
|
|||
}
|
||||
|
||||
|
||||
#ifdef NEW_MAP_FORMAT
|
||||
LUNATIC_CB int32_t (*saveboard_maptext)(const char *filename, const vec3_t *dapos, int16_t daang, int16_t dacursectnum);
|
||||
#endif
|
||||
|
||||
// Get map version of external map format (<10: old binary format, ==10: new
|
||||
// 'VX' map-text format).
|
||||
static int32_t get_mapversion(void)
|
||||
{
|
||||
#ifdef YAX_ENABLE
|
||||
if (numyaxbunches > 0)
|
||||
# ifdef NEW_MAP_FORMAT
|
||||
return 10;
|
||||
# else
|
||||
return 9;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NEW_MAP_FORMAT
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<numwalls; i++)
|
||||
if (wall[i].blend != 0)
|
||||
return 10;
|
||||
}
|
||||
#endif
|
||||
if (numsectors > MAXSECTORSV7 || numwalls > MAXWALLSV7 || Numsprites > MAXSPRITESV7)
|
||||
return 8;
|
||||
|
||||
return 7;
|
||||
}
|
||||
|
||||
|
||||
#define YSAVES ((xdim*MAXSPRITES)>>7)
|
||||
|
||||
|
@ -11087,33 +10744,6 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall)
|
|||
}
|
||||
|
||||
|
||||
static int32_t printext_checkypos(int32_t ypos, int32_t *yminptr, int32_t *ymaxptr)
|
||||
{
|
||||
int32_t ymin=0, ymax=7;
|
||||
|
||||
if (ypos < 0)
|
||||
{
|
||||
/*
|
||||
ymin = 0-ypos;
|
||||
if (ymin > 7)
|
||||
return 1;
|
||||
*/
|
||||
}
|
||||
else if (ypos+7 >= ydim)
|
||||
{
|
||||
ymax = ydim-ypos-1;
|
||||
if (ymax < 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
*yminptr = ymin;
|
||||
*ymaxptr = ymax;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// setrendermode
|
||||
|
|
|
@ -458,15 +458,6 @@ int32_t md_undefinemodel(int32_t modelid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int32_t hicfxmask(size_t pal)
|
||||
{
|
||||
return globalnoeffect ? 0 : (hictinting[pal].f & HICTINT_IN_MEMORY);
|
||||
}
|
||||
static inline int32_t hicfxid(size_t pal)
|
||||
{
|
||||
return globalnoeffect ? 0 : ((hictinting[pal].f & (HICTINT_GRAYSCALE|HICTINT_INVERT|HICTINT_COLORIZE)) | ((hictinting[pal].f & HICTINT_BLENDMASK)<<3));
|
||||
}
|
||||
|
||||
|
||||
//Note: even though it says md2model, it works for both md2model&md3model
|
||||
FTexture *mdloadskin(idmodel_t *m, int32_t number, int32_t pal, int32_t surf, bool *exact)
|
||||
|
|
|
@ -210,32 +210,6 @@ float* multiplyMatrix4f(float m0[4*4], const float m1[4*4])
|
|||
#undef multMatrix4RowCol
|
||||
}
|
||||
|
||||
static void calcmat(vec3f_t a0, const vec2f_t *offset, float f, float mat[16], int16_t angle)
|
||||
{
|
||||
float g;
|
||||
float k0, k1, k2, k3, k4, k5, k6, k7;
|
||||
|
||||
k0 = a0.y;
|
||||
k1 = a0.x;
|
||||
a0.x += offset->x;
|
||||
a0.z += offset->y;
|
||||
f = gcosang2*gshang;
|
||||
g = gsinang2*gshang;
|
||||
k4 = (float)sintable[(angle+1024)&2047] * (1.f/16384.f);
|
||||
k5 = (float)sintable[(angle+512)&2047] * (1.f/16384.f);
|
||||
k2 = k0*(1-k4)+k1*k5;
|
||||
k3 = k1*(1-k4)-k0*k5;
|
||||
k6 = f*gstang - gsinang*gctang; k7 = g*gstang + gcosang*gctang;
|
||||
mat[0] = k4*k6 + k5*k7; mat[4] = gchang*gstang; mat[ 8] = k4*k7 - k5*k6; mat[12] = k2*k6 + k3*k7;
|
||||
k6 = f*gctang + gsinang*gstang; k7 = g*gctang - gcosang*gstang;
|
||||
mat[1] = k4*k6 + k5*k7; mat[5] = gchang*gctang; mat[ 9] = k4*k7 - k5*k6; mat[13] = k2*k6 + k3*k7;
|
||||
k6 = gcosang2*gchang; k7 = gsinang2*gchang;
|
||||
mat[2] = k4*k6 + k5*k7; mat[6] =-gshang; mat[10] = k4*k7 - k5*k6; mat[14] = k2*k6 + k3*k7;
|
||||
|
||||
mat[12] = (mat[12] + a0.y*mat[0]) + (a0.z*mat[4] + a0.x*mat[ 8]);
|
||||
mat[13] = (mat[13] + a0.y*mat[1]) + (a0.z*mat[5] + a0.x*mat[ 9]);
|
||||
mat[14] = (mat[14] + a0.y*mat[2]) + (a0.z*mat[6] + a0.x*mat[10]);
|
||||
}
|
||||
|
||||
void polymost_glreset()
|
||||
{
|
||||
|
@ -1478,7 +1452,7 @@ skip: ;
|
|||
{
|
||||
int const ni = yax_vsp[yaxbunch][i].n;
|
||||
|
||||
if ((yax_vsp[yaxbunch][i].ctag == yax_vsp[yaxbunch][ni].ctag))
|
||||
if (yax_vsp[yaxbunch][i].ctag == yax_vsp[yaxbunch][ni].ctag)
|
||||
{
|
||||
yax_vsp[yaxbunch][i].cy[1] = yax_vsp[yaxbunch][ni].cy[1];
|
||||
yax_vsdel(yaxbunch, ni);
|
||||
|
|
|
@ -805,7 +805,7 @@ void F2DDrawer::FillPolygon(int *rx1, int *ry1, int *xb1, int32_t npoints, int p
|
|||
{
|
||||
for (auto& pt : polygon[a])
|
||||
{
|
||||
if (pt.first < minx || pt.first == minx && pt.second < miny)
|
||||
if (pt.first < minx || (pt.first == minx && pt.second < miny))
|
||||
{
|
||||
minx = pt.first;
|
||||
miny = pt.second;
|
||||
|
|
|
@ -400,28 +400,6 @@ UCVarValue FBaseCVar::FromFloat (float value, ECVarType type)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static uint8_t HexToByte (const char *hex)
|
||||
{
|
||||
uint8_t v = 0;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
v <<= 4;
|
||||
if (hex[i] >= '0' && hex[i] <= '9')
|
||||
{
|
||||
v += hex[i] - '0';
|
||||
}
|
||||
else if (hex[i] >= 'A' && hex[i] <= 'F')
|
||||
{
|
||||
v += hex[i] - 'A';
|
||||
}
|
||||
else // The string is already verified to contain valid hexits
|
||||
{
|
||||
v += hex[i] - 'a';
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
|
||||
{
|
||||
UCVarValue ret;
|
||||
|
|
|
@ -678,11 +678,11 @@ void FConsoleAlias::PrintAlias ()
|
|||
{
|
||||
if (m_Command[0].IsNotEmpty())
|
||||
{
|
||||
Printf (TEXTCOLOR_YELLOW "%s : %s\n", m_Name, m_Command[0].GetChars());
|
||||
Printf (TEXTCOLOR_YELLOW "%s : %s\n", m_Name.GetChars(), m_Command[0].GetChars());
|
||||
}
|
||||
if (m_Command[1].IsNotEmpty())
|
||||
{
|
||||
Printf (TEXTCOLOR_ORANGE "%s : %s\n", m_Name, m_Command[1].GetChars());
|
||||
Printf (TEXTCOLOR_ORANGE "%s : %s\n", m_Name.GetChars(), m_Command[1].GetChars());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -779,7 +779,7 @@ CCMD (alias)
|
|||
}
|
||||
else
|
||||
{
|
||||
Printf ("%s is a normal command\n", alias->m_Name);
|
||||
Printf ("%s is a normal command\n", alias->m_Name.GetChars());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ CCMD (alias)
|
|||
}
|
||||
else
|
||||
{
|
||||
Printf ("%s is a normal command\n", alias->m_Name);
|
||||
Printf ("%s is a normal command\n", alias->m_Name.GetChars());
|
||||
alias = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -884,7 +884,7 @@ void FConsoleAlias::Run (FCommandLine &args, void *who, int key)
|
|||
{
|
||||
if (bRunning)
|
||||
{
|
||||
Printf ("Alias %s tried to recurse.\n", m_Name);
|
||||
Printf ("Alias %s tried to recurse.\n", m_Name.GetChars());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1080,8 +1080,8 @@ void execLogfile(const char* fn, bool append)
|
|||
{
|
||||
if ((Logfile = fopen(fn, append ? "a" : "w")))
|
||||
{
|
||||
//const char* timestr = myasctime();
|
||||
Printf("Log started\n");// , timestr);
|
||||
const char* timestr = myasctime();
|
||||
Printf("Log started: %s\n", timestr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1094,8 +1094,8 @@ CCMD(logfile)
|
|||
|
||||
if (Logfile)
|
||||
{
|
||||
//const char* timestr = myasctime();
|
||||
Printf("Log stopped: %s\n");// , timestr);
|
||||
const char* timestr = myasctime();
|
||||
Printf("Log stopped: %s\n", timestr);
|
||||
fclose(Logfile);
|
||||
Logfile = NULL;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "resourcefile.h"
|
||||
#include "cmdlib.h"
|
||||
#include "printf.h"
|
||||
//#include "doomtype.h"
|
||||
#include "i_system.h"
|
||||
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
struct FDirectoryLump : public FResourceLump
|
||||
{
|
||||
virtual FileReader NewReader();
|
||||
virtual FileReader NewReader() override;
|
||||
int ValidateCache() override;
|
||||
|
||||
FString mFullPath;
|
||||
|
@ -111,7 +111,6 @@ FDirectory::FDirectory(const char * directory, bool nosubdirflag)
|
|||
}
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
//==========================================================================
|
||||
//
|
||||
// Windows version
|
||||
|
@ -120,14 +119,15 @@ FDirectory::FDirectory(const char * directory, bool nosubdirflag)
|
|||
|
||||
int FDirectory::AddDirectory(const char *dirpath)
|
||||
{
|
||||
auto dirmatch = WideString(dirpath);
|
||||
struct _wfinddata_t fileinfo;
|
||||
intptr_t handle;
|
||||
void * handle;
|
||||
int count = 0;
|
||||
|
||||
FString dirmatch = dirpath;
|
||||
findstate_t find;
|
||||
dirmatch += '*';
|
||||
|
||||
if ((handle = _wfindfirst(dirmatch.c_str(), &fileinfo)) == -1)
|
||||
handle = I_FindFirst(dirmatch.GetChars(), &find);
|
||||
if (handle == ((void *)(-1)))
|
||||
{
|
||||
Printf("Could not scan '%s': %s\n", dirpath, strerror(errno));
|
||||
}
|
||||
|
@ -135,19 +135,20 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
{
|
||||
do
|
||||
{
|
||||
if (fileinfo.attrib & _A_HIDDEN)
|
||||
// I_FindName only returns the file's name and not its full path
|
||||
auto attr = I_FindAttr(&find);
|
||||
if (attr & FA_HIDDEN)
|
||||
{
|
||||
// Skip hidden files and directories. (Prevents SVN bookkeeping
|
||||
// info from being included.)
|
||||
continue;
|
||||
}
|
||||
FString fi = FString(fileinfo.name);
|
||||
if (fileinfo.attrib & _A_SUBDIR)
|
||||
FString fi = I_FindName(&find);
|
||||
if (attr & FA_DIREC)
|
||||
{
|
||||
|
||||
if (nosubdir || (fi[0] == '.' &&
|
||||
(fi[1] == '\0' ||
|
||||
(fi[1] == '.' && fi[2] == '\0'))))
|
||||
(fi[1] == '\0' ||
|
||||
(fi[1] == '.' && fi[2] == '\0'))))
|
||||
{
|
||||
// Movie and music subdirectories must always pass.
|
||||
if (fi.CompareNoCase("movie") && fi.CompareNoCase("music"))
|
||||
|
@ -162,89 +163,24 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
{
|
||||
if (strstr(fi, ".orig") || strstr(fi, ".bak"))
|
||||
{
|
||||
// We shouldn't add backup files to the lump directory
|
||||
// We shouldn't add backup files to the file system
|
||||
continue;
|
||||
}
|
||||
|
||||
AddEntry(FString(dirpath) + fi, fileinfo.size);
|
||||
count++;
|
||||
size_t size = 0;
|
||||
FString fn = FString(dirpath) + fi;
|
||||
if (GetFileInfo(fn, &size, nullptr))
|
||||
{
|
||||
AddEntry(fn, size);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
} while (_wfindnext(handle, &fileinfo) == 0);
|
||||
_findclose(handle);
|
||||
|
||||
} while (I_FindNext (handle, &find) == 0);
|
||||
I_FindClose (handle);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// add_dirs
|
||||
// 4.4BSD version
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FDirectory::AddDirectory(const char *dirpath)
|
||||
{
|
||||
char *argv [2] = { NULL, NULL };
|
||||
argv[0] = new char[strlen(dirpath)+1];
|
||||
strcpy(argv[0], dirpath);
|
||||
FTS *fts;
|
||||
FTSENT *ent;
|
||||
int count = 0;
|
||||
|
||||
fts = fts_open(argv, FTS_LOGICAL, NULL);
|
||||
if (fts == NULL)
|
||||
{
|
||||
Printf("Failed to start directory traversal: %s\n", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const size_t namepos = strlen(FileName);
|
||||
FString pathfix;
|
||||
|
||||
while ((ent = fts_read(fts)) != NULL)
|
||||
{
|
||||
if (ent->fts_info == FTS_D && ent->fts_name[0] == '.')
|
||||
{
|
||||
// Skip hidden directories. (Prevents SVN bookkeeping
|
||||
// info from being included.)
|
||||
fts_set(fts, ent, FTS_SKIP);
|
||||
}
|
||||
if (ent->fts_info == FTS_D && ent->fts_level == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ent->fts_info != FTS_F)
|
||||
{
|
||||
// We're only interested in remembering files.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Some implementations add an extra separator between
|
||||
// root of the hierarchy and entity's path.
|
||||
// It needs to be removed in order to resolve
|
||||
// lumps' relative paths properly.
|
||||
const char* path = ent->fts_path;
|
||||
|
||||
if ('/' == path[namepos])
|
||||
{
|
||||
pathfix = FString(path, namepos);
|
||||
pathfix.AppendCStrPart(&path[namepos + 1], ent->fts_pathlen - namepos - 1);
|
||||
|
||||
path = pathfix.GetChars();
|
||||
}
|
||||
|
||||
AddEntry(path, ent->fts_statp->st_size);
|
||||
count++;
|
||||
}
|
||||
fts_close(fts);
|
||||
delete[] argv[0];
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -72,7 +72,7 @@ struct RFFLump
|
|||
|
||||
struct FRFFLump : public FUncompressedLump
|
||||
{
|
||||
virtual FileReader *GetReader();
|
||||
virtual FileReader *GetReader() override;
|
||||
int ValidateCache() override;
|
||||
|
||||
uint32_t IndexNum;
|
||||
|
|
|
@ -22,13 +22,13 @@ struct FZipLump : public FResourceLump
|
|||
int Position;
|
||||
unsigned CRC32;
|
||||
|
||||
virtual FileReader *GetReader();
|
||||
virtual FileReader *GetReader() override;
|
||||
virtual int ValidateCache() override;
|
||||
|
||||
private:
|
||||
void SetLumpAddress();
|
||||
virtual int GetFileOffset();
|
||||
FCompressedBuffer GetRawData();
|
||||
virtual int GetFileOffset() override;
|
||||
FCompressedBuffer GetRawData() override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -475,7 +475,7 @@ void FileSystem::AddLump(FResourceLump *lump)
|
|||
|
||||
for (int l = 0; l < NumLookupModes; l++)
|
||||
{
|
||||
int hash;
|
||||
int hash = 0;
|
||||
if (l != (int)ELookupMode::IdWithType && lump->LumpName[l] != NAME_None)
|
||||
{
|
||||
hash = int(lump->LumpName[l]) % NumEntries;
|
||||
|
|
|
@ -206,7 +206,7 @@ void FFontChar2::Create8BitPixels(uint8_t *Pixels)
|
|||
{
|
||||
for (int y = GetHeight(); y != 0; --y)
|
||||
{
|
||||
for (int x = GetWidth(); x != 0; )
|
||||
for (int x = GetWidth(); x != 0; --x)
|
||||
{
|
||||
uint8_t color = lump.ReadUInt8();
|
||||
if (color > max)
|
||||
|
|
|
@ -308,7 +308,7 @@ public:
|
|||
|
||||
FHexFont2(const char *fontname, const char *lump)
|
||||
{
|
||||
assert(lump >= 0);
|
||||
assert(lump != nullptr);
|
||||
|
||||
FontName = fontname;
|
||||
|
||||
|
@ -331,7 +331,7 @@ public:
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void LoadTranslations()
|
||||
void LoadTranslations() override
|
||||
{
|
||||
const int spacing = 9;
|
||||
double luminosity[256];
|
||||
|
|
|
@ -121,7 +121,7 @@ protected:
|
|||
|
||||
FSingleLumpFont::FSingleLumpFont (const char *name, const char * lump)
|
||||
{
|
||||
assert(lump >= 0);
|
||||
assert(lump != nullptr);
|
||||
|
||||
FontName = name;
|
||||
|
||||
|
|
|
@ -637,8 +637,7 @@ void G_HandleMemErr(int32_t lineNum, const char* fileName, const char* funcName)
|
|||
|
||||
void G_FatalEngineError(void)
|
||||
{
|
||||
I_FatalError("Fatal Engine Initialization Error",
|
||||
"There was a problem initializing the engine: %s\n\nThe application will now close.", engineerrstr);
|
||||
I_FatalError("There was a problem initializing the engine: %s\n\nThe application will now close.", engineerrstr);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void CONTROL_GetInput(ControlInfo* info)
|
|||
if (in_mouse >= 0)
|
||||
inputState.GetMouseDelta(info);
|
||||
|
||||
if (in_joystick >= 0)
|
||||
if (in_joystick)
|
||||
{
|
||||
// Handle joysticks/game controllers.
|
||||
float joyaxes[NUM_JOYAXIS];
|
||||
|
|
|
@ -54,7 +54,7 @@ void ImageScreen::Drawer()
|
|||
if (mDesc->type == 0)
|
||||
{
|
||||
auto tileindexp = NameToTileIndex.CheckKey(FName(mDesc->text, true));
|
||||
int tileindex;
|
||||
int tileindex = 0;
|
||||
if (tileindexp == nullptr)
|
||||
{
|
||||
// If this isn't a name, try a literal tile index;
|
||||
|
|
|
@ -101,7 +101,7 @@ protected:
|
|||
savegameManager.ReadSaveStrings();
|
||||
}
|
||||
|
||||
void Init(DMenu* parent, FListMenuDescriptor* desc)
|
||||
void Init(DMenu* parent, FListMenuDescriptor* desc) override
|
||||
{
|
||||
Super::Init(parent, desc);
|
||||
int Width43 = screen->GetHeight() * 4 / 3;
|
||||
|
|
|
@ -545,6 +545,7 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
|||
if (ndx == menuClasses.Size())
|
||||
{
|
||||
I_Error("Bad menu class %s\n", ld->mClass.GetChars());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -562,7 +563,7 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
|||
else if ((*desc)->mType == MDESC_OptionsMenu)
|
||||
{
|
||||
FOptionMenuDescriptor *ld = static_cast<FOptionMenuDescriptor*>(*desc);
|
||||
DOptionMenu* newmenu;
|
||||
DOptionMenu* newmenu = nullptr;
|
||||
if (ld->mClass != NAME_None)
|
||||
{
|
||||
auto ndx = menuClasses.FindEx([=](const auto p) { return p->mName == ld->mClass; });
|
||||
|
@ -592,6 +593,7 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
|||
if (ndx == menuClasses.Size())
|
||||
{
|
||||
I_Error("Bad menu class %s\n", ld->mClass.GetChars());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ void S_ParseSndInfo();
|
|||
|
||||
EXTERN_CVAR (Int, snd_samplerate)
|
||||
EXTERN_CVAR (Int, snd_mididevice)
|
||||
EXTERN_CVAR(Float, snd_mastervolume)
|
||||
|
||||
float relative_volume = 1.f, saved_relative_volume = 1.f;
|
||||
|
||||
|
@ -83,7 +84,7 @@ void I_InitMusicWin32();
|
|||
//
|
||||
//==========================================================================
|
||||
EXTERN_CVAR(Bool, cd_enabled);
|
||||
EXTERN_CVAR(Float, snd_mastervolume)
|
||||
|
||||
|
||||
CUSTOM_CVAR(String, cd_drive, "", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
|
@ -242,7 +243,7 @@ void Mus_Init(void)
|
|||
callbacks.NicePath = mus_NicePath;
|
||||
callbacks.PathForSoundfont = mus_pathToSoundFont;
|
||||
callbacks.OpenSoundFont = mus_openSoundFont;
|
||||
//callbacks.DumbVorbisDecode = dumb_decode_vorbis_;
|
||||
callbacks.DumbVorbisDecode = dumb_decode_vorbis_;
|
||||
|
||||
ZMusic_SetCallbacks(&callbacks);
|
||||
timerSetCallback(S_UpdateMusic);
|
||||
|
|
|
@ -193,7 +193,7 @@ private:
|
|||
// Shadow map texture
|
||||
PPGLTexture mShadowMapTexture;
|
||||
PPGLFrameBuffer mShadowMapFB;
|
||||
int mCurrentShadowMapSize = 0;
|
||||
//int mCurrentShadowMapSize = 0;
|
||||
|
||||
PPGLTexture mDitherTexture;
|
||||
|
||||
|
@ -202,4 +202,4 @@ private:
|
|||
friend class GLPPRenderState;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,10 +144,10 @@ public:
|
|||
SetVirtualSize(width, height);
|
||||
}
|
||||
// These methods should never be called.
|
||||
void Update() { DBGBREAK; }
|
||||
bool IsFullscreen() { DBGBREAK; return 0; }
|
||||
int GetClientWidth() { DBGBREAK; return 0; }
|
||||
int GetClientHeight() { DBGBREAK; return 0; }
|
||||
void Update() override { DBGBREAK; }
|
||||
bool IsFullscreen() override { DBGBREAK; return 0; }
|
||||
int GetClientWidth() override { DBGBREAK; return 0; }
|
||||
int GetClientHeight() override { DBGBREAK; return 0; }
|
||||
void InitializeState() override {}
|
||||
|
||||
float Gamma;
|
||||
|
|
|
@ -61,7 +61,7 @@ static FileWriter *opennextfile(const char *fn)
|
|||
return FileWriter::Open(name);
|
||||
}
|
||||
|
||||
static void getScreen(uint8_t* imgBuf)
|
||||
void getScreen(uint8_t* imgBuf)
|
||||
{
|
||||
GLInterface.ReadPixels(xdim, ydim, imgBuf);
|
||||
}
|
||||
|
|
|
@ -606,7 +606,7 @@ static TArray<FileEntry> LoadCRCCache(void)
|
|||
catch (std::runtime_error &err)
|
||||
{
|
||||
// If there's a parsing error, return what we got and discard the rest.
|
||||
OutputDebugStringA(err.what());
|
||||
debugprintf("%s\n", err.what());
|
||||
}
|
||||
return crclist;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ class OpenALSoundStream : public SoundStream
|
|||
ALuint Source;
|
||||
|
||||
std::atomic<bool> Playing;
|
||||
bool Looping;
|
||||
//bool Looping;
|
||||
ALfloat Volume;
|
||||
|
||||
bool SetupSource()
|
||||
|
@ -226,7 +226,7 @@ class OpenALSoundStream : public SoundStream
|
|||
|
||||
public:
|
||||
OpenALSoundStream(OpenALSoundRenderer *renderer)
|
||||
: Renderer(renderer), Source(0), Playing(false), Looping(false), Volume(1.0f)
|
||||
: Renderer(renderer), Source(0), Playing(false), Volume(1.0f)
|
||||
{
|
||||
memset(Buffers, 0, sizeof(Buffers));
|
||||
Renderer->AddStream(this);
|
||||
|
|
|
@ -1766,14 +1766,11 @@ FString SoundEngine::NoiseDebug()
|
|||
listener = this->listener.position;
|
||||
int ch = 0;
|
||||
|
||||
FStringf out("*** SOUND DEBUG INFO ***\nListener: %3.2f %2.3f %2.3f\n"
|
||||
FString out;
|
||||
|
||||
out.Format("*** SOUND DEBUG INFO ***\nListener: %3.2f %2.3f %2.3f\n"
|
||||
"x y z vol dist chan pri flags aud pos name\n", listener.X, listener.Y, listener.Z);
|
||||
|
||||
if (Channels == nullptr)
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
for (auto chan = Channels; chan; chan = chan->NextChan)
|
||||
{
|
||||
if (!(chan->ChanFlags & CHANF_IS3D))
|
||||
|
|
|
@ -364,7 +364,7 @@ void STAT_StartNewGame(const char *episode, int skill)
|
|||
|
||||
void STAT_NewLevel(const char* mapname)
|
||||
{
|
||||
if (!strncmp(mapname, "file://", 7) == 0)
|
||||
if (strncmp(mapname, "file://", 7) == 0)
|
||||
{
|
||||
STAT_StartNewGame("", 0); // reset and deactivate for user maps
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class FArtTexture : public FImageSource
|
|||
|
||||
public:
|
||||
FArtTexture (int width, int height, int p);
|
||||
void CreatePalettedPixels(uint8_t* buffer);
|
||||
void CreatePalettedPixels(uint8_t* buffer) override;
|
||||
int CopyPixels(FBitmap *bmp, int conversion) override;
|
||||
int32_t picanmdisk; // Todo: Get this out again on the other side.
|
||||
};
|
||||
|
|
|
@ -54,7 +54,7 @@ class FPNGTexture : public FImageSource
|
|||
public:
|
||||
FPNGTexture (FileReader &lump, int width, int height, uint8_t bitdepth, uint8_t colortype, uint8_t interlace);
|
||||
|
||||
void CreatePalettedPixels(uint8_t* buffer);
|
||||
void CreatePalettedPixels(uint8_t* buffer) override;
|
||||
int CopyPixels(FBitmap *bmp, int conversion) override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -189,7 +189,7 @@ public:
|
|||
return FilePos - StartPos;
|
||||
}
|
||||
|
||||
virtual long Seek(long offset, int origin)
|
||||
virtual long Seek(long offset, int origin) override
|
||||
{
|
||||
switch (origin)
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
return -1;
|
||||
}
|
||||
|
||||
virtual long Read(void *buffer, long len)
|
||||
virtual long Read(void *buffer, long len) override
|
||||
{
|
||||
assert(len >= 0);
|
||||
if (len <= 0) return 0;
|
||||
|
@ -227,7 +227,7 @@ public:
|
|||
return len;
|
||||
}
|
||||
|
||||
virtual char *Gets(char *strbuf, int len)
|
||||
virtual char *Gets(char *strbuf, int len) override
|
||||
{
|
||||
if (len <= 0 || FilePos >= StartPos + Length) return NULL;
|
||||
char *p = mReader->Gets(strbuf, len);
|
||||
|
|
|
@ -392,13 +392,6 @@ VSMatrix::length(const FLOATTYPE *a) {
|
|||
}
|
||||
|
||||
|
||||
static inline int
|
||||
M3(int i, int j)
|
||||
{
|
||||
return (i*3+j);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// computes the derived normal matrix for the view matrix
|
||||
void
|
||||
|
|
|
@ -52,12 +52,8 @@ int DPrintf (int level, const char *format, ...) ATTRIBUTE((format(printf,2,3)))
|
|||
|
||||
void OSD_Printf(const char *format, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
|
||||
// Sometimes compilers can be really stupid... (but why do I have to globally silence the warning to make the compiler shut up here...???)
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
//#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
template<class... Args>
|
||||
inline void initprintf(const char *format, Args&&... args) //ATTRIBUTE((format(printf,1,2)))
|
||||
{
|
||||
|
@ -70,12 +66,11 @@ inline void buildprintf(const char *format, Args&&... args) //ATTRIBUTE((format(
|
|||
{
|
||||
OSD_Printf(format, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/*
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#else
|
||||
// Sigh... Sometimes a compiler's stubbornness with warnings can really make things worse than necessary...
|
||||
#define initprintf OSD_Printf
|
||||
#define buildprintf OSD_Printf
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
inline void initputs(const char *s)
|
||||
|
|
|
@ -248,7 +248,7 @@ const char *MakeUTF8(const char *outline, int *numchars = nullptr)
|
|||
UTF8String.Push(encode[i]);
|
||||
}
|
||||
}
|
||||
if (numchars) *numchars++;
|
||||
if (numchars) (*numchars)++;
|
||||
}
|
||||
UTF8String.Push(0);
|
||||
return UTF8String.Data();
|
||||
|
|
|
@ -7,15 +7,15 @@ require_strnicmp()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
||||
|
||||
if (WIN32)
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2" )
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../platform/posix")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
@ -41,6 +41,8 @@ include_directories(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/../common/rendering/hwrenderer/postprocessing
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../common/rendering/hwrenderer/utility
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../common/rendering
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../${SYSTEM_SOURCES_DIR}
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -2092,6 +2092,7 @@ void C_UndefineLevel(int32_t vol, int32_t lev)
|
|||
|
||||
LUNATIC_EXTERN int32_t C_SetDefName(const char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
defaultprojectile_t DefaultProjectile;
|
||||
|
|
|
@ -1631,6 +1631,8 @@ static void Net_Disconnect(void)
|
|||
{
|
||||
switch (event.type)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
|
@ -1666,6 +1668,8 @@ static void Net_Disconnect(void)
|
|||
{
|
||||
switch (event.type)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
|
|
|
@ -558,7 +558,7 @@ static int osdcmd_listplayers(osdcmdptr_t parm)
|
|||
continue;
|
||||
|
||||
enet_address_get_host_ip(¤tPeer->address, ipaddr, sizeof(ipaddr));
|
||||
initprintf("%x %s %s\n", currentPeer->address.host, ipaddr,
|
||||
initprintf("%s %s\n", ipaddr,
|
||||
g_player[(intptr_t)currentPeer->data].user_name);
|
||||
}
|
||||
|
||||
|
|
|
@ -1096,10 +1096,6 @@ static void sv_create_lua_state(void)
|
|||
static void sv_postactordata();
|
||||
static void sv_preanimateptrsave();
|
||||
static void sv_postanimateptr();
|
||||
static void sv_prequoteredef();
|
||||
static void sv_quoteredefsave();
|
||||
static void sv_quoteredefload();
|
||||
static void sv_postquoteredef();
|
||||
static void sv_restsave();
|
||||
static void sv_restload();
|
||||
static void sv_preprojectilesave();
|
||||
|
|
|
@ -7,15 +7,15 @@ require_strnicmp()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
||||
|
||||
if (WIN32)
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2" )
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
|
|
@ -92,7 +92,7 @@ class PSMainMenu : public DListMenu
|
|||
PlayLocalSound(StaticSound[kSound31], 0);
|
||||
}
|
||||
|
||||
void Ticker()
|
||||
void Ticker() override
|
||||
{
|
||||
// handle the menu zoom-in
|
||||
if (zoomsize < 0x10000)
|
||||
|
|
|
@ -1018,7 +1018,7 @@ void DrawWeapons(int smooth)
|
|||
{
|
||||
nSeqOffset = var_30 + 3;
|
||||
}
|
||||
else if (nClip > 25)
|
||||
else //if (nClip > 25)
|
||||
{
|
||||
nSeqOffset = var_30 + 4;
|
||||
}
|
||||
|
|
|
@ -792,7 +792,7 @@ void InitWallFace()
|
|||
WallFaceCount = kMaxWallFace;
|
||||
}
|
||||
|
||||
int BuildWallFace(short nChannel, short nWall, short nCount, ...)
|
||||
int BuildWallFace(short nChannel, short nWall, int nCount, ...)
|
||||
{
|
||||
if (WallFaceCount <= 0) {
|
||||
I_Error("Too many wall faces!\n");
|
||||
|
@ -1968,7 +1968,7 @@ void FuncObject(int a, int b, int nRun)
|
|||
if (ObjectList[nObject].nHealth > 0 && sprite[nSprite].cstat & 0x101
|
||||
&& (nStat != kStatExplodeTarget
|
||||
|| sprite[nRadialSpr].statnum == 201
|
||||
|| nRadialBullet != 3 && nRadialBullet > -1
|
||||
|| (nRadialBullet != 3 && nRadialBullet > -1)
|
||||
|| sprite[nRadialSpr].statnum == kStatExplodeTrigger))
|
||||
{
|
||||
int nDamage = runlist_CheckRadialDamage(nSprite);
|
||||
|
|
|
@ -81,7 +81,7 @@ int BuildEnergyBlock(short nSector);
|
|||
int BuildElevC(int arg1, int nChannel, int nSector, int nWallSprite, int arg5, int arg6, int nCount, ...);
|
||||
int BuildElevF(int nChannel, int nSector, int nWallSprite, int arg_4, int arg_5, int nCount, ...);
|
||||
|
||||
int BuildWallFace(short nChannel, short nWall, short nCount, ...);
|
||||
int BuildWallFace(short nChannel, short nWall, int nCount, ...);
|
||||
|
||||
int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3);
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ void feebtag(int x, int y, int z, int nSector, short *nSprite, int nVal2, int nV
|
|||
{
|
||||
int theSqrt = ksqrt(xDiff * xDiff + yDiff * yDiff);
|
||||
|
||||
if (theSqrt < nVal3 && (nStat != 950 && nStat != 949 || !(var_14 & 1)) && (nStat != 912 && nStat != 913 || !(var_20 & 2)))
|
||||
if (theSqrt < nVal3 && ((nStat != 950 && nStat != 949) || !(var_14 & 1)) && ((nStat != 912 && nStat != 913) || !(var_20 & 2)))
|
||||
{
|
||||
nVal3 = theSqrt;
|
||||
*nSprite = i;
|
||||
|
@ -1652,7 +1652,7 @@ do_default:
|
|||
// loc_1B3C7
|
||||
|
||||
// CHECKME - is order of evaluation correct?
|
||||
if (levelnum <= 20 || var_70 >= 25 && (var_70 <= 25 || var_70 == 50))
|
||||
if (levelnum <= 20 || (var_70 >= 25 && (var_70 <= 25 || var_70 == 50)))
|
||||
{
|
||||
DestroyItemAnim(nValB);
|
||||
mydeletesprite(nValB);
|
||||
|
|
|
@ -45,7 +45,7 @@ int RandomBit()
|
|||
randA = (randA >> 1) | (((randA ^ ((randA >> 1) ^ (randA >> 2) ^ (randA >> 31) ^ (randA >> 6) ^ (randA >> 4))) & 1) << 31);
|
||||
randB = (randB >> 1) | ((((randB >> 2) ^ (randB >> 30)) & 1) << 30);
|
||||
randC = (randC >> 1) | ((((randC >> 1) ^ (randC >> 28)) & 1) << 28);
|
||||
return ((randA == 0) & randC | (randB & randA)) & 1;
|
||||
return (((randA == 0) & randC) | (randB & randA)) & 1;
|
||||
}
|
||||
|
||||
char RandomByte()
|
||||
|
|
|
@ -175,7 +175,7 @@ int seq_ReadSequence(const char *seqName)
|
|||
|
||||
short tag;
|
||||
hFile.Read(&tag, sizeof(tag));
|
||||
if (tag < 'HI' || tag > 'HI' && tag != 'SD')
|
||||
if (tag < 'HI' || (tag > 'HI' && tag != 'SD'))
|
||||
{
|
||||
initprintf("Unsupported sequence version!\n");
|
||||
return 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once;
|
||||
#pragma once
|
||||
|
||||
#include "gl_uniform.h"
|
||||
|
||||
|
|
|
@ -39,14 +39,11 @@
|
|||
#include "c_cvars.h"
|
||||
#include "c_dispatch.h"
|
||||
#include "d_event.h"
|
||||
#include "c_buttons.h"
|
||||
#include "d_gui.h"
|
||||
#include "dikeys.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "v_video.h"
|
||||
#include "events.h"
|
||||
#include "g_game.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
|
||||
EXTERN_CVAR(Int, m_use_mouse)
|
||||
|
@ -73,9 +70,6 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
|||
extern int paused, chatmodeon;
|
||||
extern constate_e ConsoleState;
|
||||
|
||||
bool GUICapture;
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -86,18 +80,13 @@ size_t s_skipMouseMoves;
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if 0
|
||||
void CheckGUICapture()
|
||||
{
|
||||
bool wantCapture = (MENU_Off == menuactive)
|
||||
? (c_down == ConsoleState || c_falling == ConsoleState || chatmodeon)
|
||||
: (MENU_On == menuactive || MENU_OnNoPause == menuactive);
|
||||
|
||||
// [ZZ] check active event handlers that want the UI processing
|
||||
if (!wantCapture && primaryLevel->localEventManager->CheckUiProcessors())
|
||||
{
|
||||
wantCapture = true;
|
||||
}
|
||||
|
||||
if (wantCapture != GUICapture)
|
||||
{
|
||||
GUICapture = wantCapture;
|
||||
|
@ -105,6 +94,7 @@ void CheckGUICapture()
|
|||
ResetButtonStates();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void SetCursorPosition(const NSPoint position)
|
||||
{
|
||||
|
@ -154,20 +144,7 @@ void CenterCursor()
|
|||
|
||||
bool IsInGame()
|
||||
{
|
||||
switch (mouse_capturemode)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
return gamestate == GS_LEVEL;
|
||||
|
||||
case 1:
|
||||
return gamestate == GS_LEVEL
|
||||
|| gamestate == GS_INTERMISSION
|
||||
|| gamestate == GS_FINALE;
|
||||
|
||||
case 2:
|
||||
return true;
|
||||
}
|
||||
return gi->CanSave();
|
||||
}
|
||||
|
||||
void CheckNativeMouse()
|
||||
|
@ -188,7 +165,7 @@ void CheckNativeMouse()
|
|||
else
|
||||
{
|
||||
wantNative = (!m_use_mouse || MENU_WaitKey != menuactive)
|
||||
&& (!IsInGame() || GUICapture || paused || demoplayback);
|
||||
&& (!IsInGame() || GUICapture || paused);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -198,9 +175,6 @@ void CheckNativeMouse()
|
|||
&& (MENU_On == menuactive || MENU_OnNoPause == menuactive);
|
||||
}
|
||||
|
||||
if (!wantNative && primaryLevel->localEventManager->CheckRequireMouse())
|
||||
wantNative = true;
|
||||
|
||||
I_SetNativeMouse(wantNative);
|
||||
}
|
||||
|
||||
|
@ -214,7 +188,7 @@ void I_GetEvent()
|
|||
|
||||
void I_StartTic()
|
||||
{
|
||||
CheckGUICapture();
|
||||
//CheckGUICapture();
|
||||
CheckNativeMouse();
|
||||
|
||||
I_ProcessJoysticks();
|
||||
|
|
|
@ -36,12 +36,13 @@
|
|||
#include <IOKit/hid/IOHIDLib.h>
|
||||
|
||||
#include "d_event.h"
|
||||
#include "doomdef.h"
|
||||
#include "i_system.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_joy.h"
|
||||
#include "templates.h"
|
||||
#include "v_text.h"
|
||||
#include "printf.h"
|
||||
#include "keydef.h"
|
||||
|
||||
|
||||
EXTERN_CVAR(Bool, joy_axespolling)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "version.h"
|
||||
#include "printf.h"
|
||||
#include "s_music.h"
|
||||
#include "gamecontrol.h"
|
||||
|
||||
|
||||
#define ZD_UNUSED(VARIABLE) ((void)(VARIABLE))
|
||||
|
@ -170,7 +171,7 @@ int DoMain(int argc, char** argv)
|
|||
progdir = [[exePath stringByDeletingLastPathComponent] UTF8String];
|
||||
progdir += "/";
|
||||
|
||||
auto ret = D_DoomMain();
|
||||
auto ret = GameMain();
|
||||
FConsoleWindow::DeleteInstance();
|
||||
return ret;
|
||||
}
|
||||
|
@ -347,7 +348,7 @@ extern bool AppActive;
|
|||
|
||||
- (void)sendExitEvent:(id)sender
|
||||
{
|
||||
throw CExitEvent(0);
|
||||
throw ExitEvent(0);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -41,21 +41,8 @@
|
|||
#include "i_system.h"
|
||||
#include "st_console.h"
|
||||
#include "v_text.h"
|
||||
#include "x86.h"
|
||||
#include "cmdlib.h"
|
||||
|
||||
|
||||
void I_Tactile(int /*on*/, int /*off*/, int /*total*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ticcmd_t* I_BaseTiccmd()
|
||||
{
|
||||
static ticcmd_t emptycmd;
|
||||
return &emptycmd;
|
||||
}
|
||||
|
||||
#include "printf.h"
|
||||
|
||||
|
||||
double PerfToSec, PerfToMillisec;
|
||||
|
@ -70,7 +57,7 @@ static void CalculateCPUSpeed()
|
|||
PerfToSec = 1.0 / frequency;
|
||||
PerfToMillisec = 1000.0 / frequency;
|
||||
|
||||
if (!batchrun)
|
||||
//if (!batchrun)
|
||||
{
|
||||
Printf("CPU speed: %.0f MHz\n", 0.001 / PerfToMillisec);
|
||||
}
|
||||
|
@ -79,9 +66,7 @@ static void CalculateCPUSpeed()
|
|||
|
||||
void I_Init(void)
|
||||
{
|
||||
CheckCPUID(&CPU);
|
||||
CalculateCPUSpeed();
|
||||
DumpCPUInfo(&CPU);
|
||||
}
|
||||
|
||||
void I_SetIWADInfo()
|
||||
|
|
|
@ -48,15 +48,14 @@
|
|||
#include "i_system.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_png.h"
|
||||
#include "swrenderer/r_swrenderer.h"
|
||||
#include "st_console.h"
|
||||
#include "v_text.h"
|
||||
#include "version.h"
|
||||
#include "doomerrors.h"
|
||||
#include "printf.h"
|
||||
|
||||
#include "gl/system/gl_framebuffer.h"
|
||||
#include "vulkan/system/vk_framebuffer.h"
|
||||
#include "rendering/polyrenderer/backend/poly_framebuffer.h"
|
||||
//#include "vulkan/system/vk_framebuffer.h"
|
||||
//#include "rendering/polyrenderer/backend/poly_framebuffer.h"
|
||||
|
||||
|
||||
@implementation NSWindow(ExitAppOnClose)
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
#include "v_text.h"
|
||||
#include "version.h"
|
||||
#include "i_time.h"
|
||||
|
||||
#include "palentry.h"
|
||||
#include "v_video.h"
|
||||
#include "v_font.h"
|
||||
|
||||
static NSColor* RGB(const uint8_t red, const uint8_t green, const uint8_t blue)
|
||||
{
|
||||
|
@ -47,16 +49,11 @@ static NSColor* RGB(const uint8_t red, const uint8_t green, const uint8_t blue)
|
|||
alpha:1.0f];
|
||||
}
|
||||
|
||||
static NSColor* RGB(const PalEntry& color)
|
||||
static NSColor* RGB(PalEntry color)
|
||||
{
|
||||
return RGB(color.r, color.g, color.b);
|
||||
}
|
||||
|
||||
static NSColor* RGB(const uint32_t color)
|
||||
{
|
||||
return RGB(PalEntry(color));
|
||||
}
|
||||
|
||||
|
||||
static const CGFloat PROGRESS_BAR_HEIGHT = 18.0f;
|
||||
static const CGFloat NET_VIEW_HEIGHT = 88.0f;
|
||||
|
@ -100,7 +97,7 @@ FConsoleWindow::FConsoleWindow()
|
|||
[m_scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
[m_scrollView setDocumentView:m_textView];
|
||||
|
||||
NSString* const title = [NSString stringWithFormat:@"%s %s - Console", GAMESIG, GetVersionString()];
|
||||
NSString* const title = [NSString stringWithFormat:@"%s %s - Console", GAMENAME, GetVersionString()];
|
||||
|
||||
[m_window initWithContentRect:initialRect
|
||||
styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
|
||||
|
@ -334,6 +331,7 @@ void FConsoleWindow::SetTitleText()
|
|||
textViewFrame.size.width,
|
||||
TITLE_TEXT_HEIGHT);
|
||||
|
||||
#if 0
|
||||
// Temporary solution for the same foreground and background colors
|
||||
// It's used in graphical startup screen, with Hexen style in particular
|
||||
// Native OS X backend doesn't implement this yet
|
||||
|
@ -353,8 +351,9 @@ void FConsoleWindow::SetTitleText()
|
|||
[titleText setAutoresizingMask:NSViewWidthSizable | NSViewMinYMargin];
|
||||
[titleText setSelectable:NO];
|
||||
[titleText setBordered:NO];
|
||||
|
||||
[[m_window contentView] addSubview:titleText];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void FConsoleWindow::SetProgressBar(const bool visible)
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "c_cvars.h"
|
||||
#include "st_console.h"
|
||||
#include "st_start.h"
|
||||
#include "doomerrors.h"
|
||||
#include "printf.h"
|
||||
|
||||
|
||||
FStartupScreen *StartScreen;
|
||||
|
@ -165,11 +165,3 @@ FStartupScreen *FStartupScreen::CreateInstance(const int maxProgress)
|
|||
return new FBasicStartupScreen(maxProgress, true);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
void ST_Endoom()
|
||||
{
|
||||
throw CExitEvent(0);
|
||||
}
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "m_misc.h"
|
||||
#endif // __APPLE__
|
||||
|
||||
#include "doomerrors.h"
|
||||
#include "d_main.h"
|
||||
#include "sc_man.h"
|
||||
#include "cmdlib.h"
|
||||
|
||||
|
@ -122,7 +116,8 @@ static TArray<FString> ParseSteamRegistry(const char* path)
|
|||
|
||||
// Read registry data
|
||||
FScanner sc;
|
||||
if (sc.OpenFile(path))
|
||||
sc.OpenFile(path);
|
||||
//if (sc.Sc)
|
||||
{
|
||||
sc.SetCMode(true);
|
||||
|
||||
|
@ -178,7 +173,7 @@ TArray<FString> I_GetSteamPath()
|
|||
{
|
||||
SteamInstallFolders = ParseSteamRegistry(regPath);
|
||||
}
|
||||
catch(class CRecoverableError &error)
|
||||
catch(class std::runtime_error &error)
|
||||
{
|
||||
// If we can't parse for some reason just pretend we can't find anything.
|
||||
return result;
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
#define __solaris__ 1
|
||||
#endif
|
||||
|
||||
#include "doomtype.h"
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
#include "tarray.h"
|
||||
#include "zstring.h"
|
||||
|
||||
struct ticcmd_t;
|
||||
struct WadStuff;
|
||||
|
@ -25,7 +26,7 @@ void I_Init (void);
|
|||
|
||||
// Return a seed value for the RNG.
|
||||
unsigned int I_MakeRNGSeed();
|
||||
|
||||
void I_ShowFatalError(const char* msg);
|
||||
|
||||
void I_StartFrame (void);
|
||||
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
#include "m_argv.h"
|
||||
#include "m_misc.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "doomerrors.h"
|
||||
#include "printf.h"
|
||||
#include "gamecontrol.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <wordexp.h>
|
||||
|
@ -360,7 +361,7 @@ static NSArray* GetKnownExtensions()
|
|||
|
||||
if ( @selector(terminate:) == [menuItem action] )
|
||||
{
|
||||
throw CExitEvent(0);
|
||||
throw ExitEvent(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@ require_strnicmp()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
||||
|
||||
if (WIN32)
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//-------------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 2016 EDuke32 developers and contributors
|
||||
|
||||
|
@ -371,7 +371,7 @@ void G_GameExit(const char *msg)
|
|||
{
|
||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||
{
|
||||
I_Error(msg);
|
||||
I_Error("%s", msg);
|
||||
}
|
||||
}
|
||||
throw ExitEvent(0);
|
||||
|
|
|
@ -1651,7 +1651,7 @@ void Net_DisplaySyncMsg(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
Printf(PRINT_NOTIFY, "%s\n", g_szfirstSyncMsg[i],0);
|
||||
Printf(PRINT_NOTIFY, "%s\n", g_szfirstSyncMsg[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -435,7 +435,7 @@ static int osdcmd_listplayers(osdcmdptr_t parm)
|
|||
continue;
|
||||
|
||||
enet_address_get_host_ip(¤tPeer->address, ipaddr, sizeof(ipaddr));
|
||||
initprintf("%x %s %s\n", currentPeer->address.host, ipaddr,
|
||||
initprintf("%s %s\n", ipaddr,
|
||||
g_player[(intptr_t)currentPeer->data].user_name);
|
||||
}
|
||||
|
||||
|
|
|
@ -823,9 +823,6 @@ static void sv_postspriteext();
|
|||
static void sv_postactordata();
|
||||
static void sv_preanimateptrsave();
|
||||
static void sv_postanimateptr();
|
||||
static void sv_prequote();
|
||||
static void sv_quotesave();
|
||||
static void sv_quoteload();
|
||||
static void sv_restsave();
|
||||
static void sv_restload();
|
||||
static void sv_rrrafog();
|
||||
|
|
|
@ -7,15 +7,15 @@ require_strnicmp()
|
|||
if (MSVC)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
||||
else()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )
|
||||
endif()
|
||||
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
||||
|
||||
if (WIN32)
|
||||
include_directories( "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx")
|
||||
else ()
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
||||
include_directories( "${ZLIB_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
|
|
@ -40,6 +40,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
#include "weapon.h"
|
||||
#include "text.h"
|
||||
#include "menus.h"
|
||||
#include "printf.h"
|
||||
|
||||
BEGIN_SW_NS
|
||||
|
||||
|
|
|
@ -365,7 +365,6 @@ static void DoTimedSound(AmbientSound* amb)
|
|||
}
|
||||
RestartAmbient(amb);
|
||||
}
|
||||
amb->curIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue