Merge remote-tracking branch 'origin/master' into http-mserv

This commit is contained in:
James R 2020-06-12 23:36:39 -07:00
commit 9b3456a860
21 changed files with 139 additions and 136 deletions

View file

@ -439,6 +439,30 @@ matrix:
# List Ubuntu LTS, newest to oldest # List Ubuntu LTS, newest to oldest
# Then list non-LTS, newest to oldest # Then list non-LTS, newest to oldest
################################ ################################
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=focal
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=focal
- PACKAGE_SUBVERSION=~20.04focal
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux - os: linux
addons: addons:
apt: apt:
@ -463,6 +487,30 @@ matrix:
- PACKAGE_DISTRO=bionic - PACKAGE_DISTRO=bionic
- PACKAGE_SUBVERSION=~18.04bionic - PACKAGE_SUBVERSION=~18.04bionic
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=xenial
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=xenial
- PACKAGE_SUBVERSION=~16.04xenial
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux - os: linux
addons: addons:
apt: apt:
@ -505,59 +553,11 @@ matrix:
AND env(DPL_TERMINATE_MAIN) != "1" AND env(DPL_TERMINATE_MAIN) != "1"
env: env:
- _DPL_JOB_ENABLED=1 - _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=disco - _DPL_JOB_NAME=eoan
- _DPL_DPUT_TARGET=1 - _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1 - _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=disco - PACKAGE_DISTRO=eoan
- PACKAGE_SUBVERSION=~19.04disco - PACKAGE_SUBVERSION=~19.10eoan
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=cosmic
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=cosmic
- PACKAGE_SUBVERSION=~18.10cosmic
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=xenial
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=xenial
- PACKAGE_SUBVERSION=~16.04xenial
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
allow_failures: allow_failures:
- compiler: clang-3.5 - compiler: clang-3.5

View file

@ -543,10 +543,7 @@ static void COM_ExecuteString(char *ptext)
if (!stricmp(com_argv[0], a->name)) if (!stricmp(com_argv[0], a->name))
{ {
if (recursion > MAX_ALIAS_RECURSION) if (recursion > MAX_ALIAS_RECURSION)
{
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n")); CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
recursion = 0;
}
else else
{ {
char buf[1024]; char buf[1024];
@ -578,8 +575,10 @@ static void COM_ExecuteString(char *ptext)
} }
WRITESTRING(write, read); WRITESTRING(write, read);
// Monster Iestyn: keep track of how many levels of recursion we're in
recursion++; recursion++;
COM_BufInsertText(buf); COM_BufInsertText(buf);
recursion--;
} }
return; return;
} }

View file

@ -2505,6 +2505,7 @@ static void Command_ClearBans(void)
return; return;
I_ClearBans(); I_ClearBans();
D_SaveBan();
reasontail = NULL; reasontail = NULL;
while (reasonhead) while (reasonhead)
{ {

View file

@ -144,6 +144,8 @@ boolean advancedemo;
INT32 debugload = 0; INT32 debugload = 0;
#endif #endif
char savegamename[256];
#ifdef _arch_dreamcast #ifdef _arch_dreamcast
char srb2home[256] = "/cd"; char srb2home[256] = "/cd";
char srb2path[256] = "/cd"; char srb2path[256] = "/cd";
@ -186,35 +188,6 @@ UINT8 shiftdown = 0; // 0x1 left, 0x2 right
UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 ctrldown = 0; // 0x1 left, 0x2 right
UINT8 altdown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right
boolean capslock = 0; // gee i wonder what this does. boolean capslock = 0; // gee i wonder what this does.
//
// D_ModifierKeyResponder
// Sets global shift/ctrl/alt variables, never actually eats events
//
static inline void D_ModifierKeyResponder(event_t *ev)
{
if (ev->type == ev_keydown || ev->type == ev_console) switch (ev->data1)
{
case KEY_LSHIFT: shiftdown |= 0x1; return;
case KEY_RSHIFT: shiftdown |= 0x2; return;
case KEY_LCTRL: ctrldown |= 0x1; return;
case KEY_RCTRL: ctrldown |= 0x2; return;
case KEY_LALT: altdown |= 0x1; return;
case KEY_RALT: altdown |= 0x2; return;
case KEY_CAPSLOCK: capslock = !capslock; return;
default: return;
}
else if (ev->type == ev_keyup) switch (ev->data1)
{
case KEY_LSHIFT: shiftdown &= ~0x1; return;
case KEY_RSHIFT: shiftdown &= ~0x2; return;
case KEY_LCTRL: ctrldown &= ~0x1; return;
case KEY_RCTRL: ctrldown &= ~0x2; return;
case KEY_LALT: altdown &= ~0x1; return;
case KEY_RALT: altdown &= ~0x2; return;
default: return;
}
}
// //
// D_ProcessEvents // D_ProcessEvents
@ -303,7 +276,7 @@ static void D_Display(void)
{ {
if (nodrawers) if (nodrawers)
return; // for comparative timing/profiling return; // for comparative timing/profiling
// check for change of screen size (video mode) // check for change of screen size (video mode)
if (setmodeneeded && !wipe) if (setmodeneeded && !wipe)
SCR_SetMode(); // change video mode SCR_SetMode(); // change video mode

View file

@ -768,7 +768,7 @@ void SV_FileSendTicker(void)
if (ram) if (ram)
M_Memcpy(p->data, &f->id.ram[transfer[i].position], size); M_Memcpy(p->data, &f->id.ram[transfer[i].position], size);
else if (fread(p->data, 1, size, transfer[i].currentfile) != size) else if (fread(p->data, 1, size, transfer[i].currentfile) != size)
I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, strerror(ferror(transfer[i].currentfile))); I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transfer[i].currentfile));
p->position = LONG(transfer[i].position); p->position = LONG(transfer[i].position);
// Put flag so receiver knows the total size // Put flag so receiver knows the total size
if (transfer[i].position + size == f->size) if (transfer[i].position + size == f->size)
@ -847,7 +847,7 @@ void Got_Filetxpak(void)
// We can receive packet in the wrong order, anyway all os support gaped file // We can receive packet in the wrong order, anyway all os support gaped file
fseek(file->file, pos, SEEK_SET); fseek(file->file, pos, SEEK_SET);
if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1)
I_Error("Can't write to %s: %s\n",filename, strerror(ferror(file->file))); I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file));
file->currentsize += size; file->currentsize += size;
// Finished? // Finished?

View file

@ -506,7 +506,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG;
// Things that used to be in dstrings.h // Things that used to be in dstrings.h
#define SAVEGAMENAME "srb2sav" #define SAVEGAMENAME "srb2sav"
char savegamename[256]; extern char savegamename[256];
// m_misc.h // m_misc.h
#ifdef GETTEXT #ifdef GETTEXT

View file

@ -407,7 +407,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei
if (angle) // Only needs to be done if there's an altered angle if (angle) // Only needs to be done if there's an altered angle
{ {
angle = (InvAngle(angle)+ANGLE_180)>>ANGLETOFINESHIFT; angle = InvAngle(angle)>>ANGLETOFINESHIFT;
// This needs to be done so that it scrolls in a different direction after rotation like software // This needs to be done so that it scrolls in a different direction after rotation like software
/*tempxsow = FLOAT_TO_FIXED(scrollx); /*tempxsow = FLOAT_TO_FIXED(scrollx);
@ -439,7 +439,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei
tempxsow = FLOAT_TO_FIXED(v3d->s); tempxsow = FLOAT_TO_FIXED(v3d->s);
tempytow = FLOAT_TO_FIXED(v3d->t); tempytow = FLOAT_TO_FIXED(v3d->t);
v3d->s = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); v3d->s = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
v3d->t = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); v3d->t = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
} }
//v3d->s = (float)(v3d->s - flatxref + scrollx); //v3d->s = (float)(v3d->s - flatxref + scrollx);

View file

@ -143,7 +143,7 @@ static const GLfloat byte2float[256] = {
// -----------------+ // -----------------+
#ifdef DEBUG_TO_FILE #ifdef DEBUG_TO_FILE
FILE *gllogstream; FILE *gllogstream = NULL;
#endif #endif
FUNCPRINTF void GL_DBG_Printf(const char *format, ...) FUNCPRINTF void GL_DBG_Printf(const char *format, ...)
@ -152,14 +152,14 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...)
char str[4096] = ""; char str[4096] = "";
va_list arglist; va_list arglist;
if (!gllogstream) if (gllogstream)
gllogstream = fopen("ogllog.txt", "w"); {
va_start(arglist, format);
vsnprintf(str, 4096, format, arglist);
va_end(arglist);
va_start(arglist, format); fwrite(str, strlen(str), 1, gllogstream);
vsnprintf(str, 4096, format, arglist); }
va_end(arglist);
fwrite(str, strlen(str), 1, gllogstream);
#else #else
(void)format; (void)format;
#endif #endif
@ -823,7 +823,7 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
#ifdef GL_SHADERS #ifdef GL_SHADERS
GLuint gl_vertShader, gl_fragShader; GLuint gl_vertShader, gl_fragShader;
GLint i, result; GLint i, result;
if (!pglUseProgram) return false; if (!pglUseProgram) return false;
gl_customvertexshaders[0] = NULL; gl_customvertexshaders[0] = NULL;
@ -2002,11 +2002,11 @@ EXPORT void HWRAPI(RenderBatches) (int *sNumPolys, int *sNumVerts, int *sNumCall
boolean stopFlag = false; boolean stopFlag = false;
boolean changeState = false; boolean changeState = false;
boolean changeShader = false; boolean changeShader = false;
GLuint nextShader; GLuint nextShader = 0U;
boolean changeTexture = false; boolean changeTexture = false;
GLuint nextTexture; GLuint nextTexture = 0U;
boolean changePolyFlags = false; boolean changePolyFlags = false;
FBITFIELD nextPolyFlags; FBITFIELD nextPolyFlags = 0U;
boolean changeSurfaceInfo = false; boolean changeSurfaceInfo = false;
FSurfaceInfo nextSurfaceInfo; FSurfaceInfo nextSurfaceInfo;
@ -2307,7 +2307,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
pglColor4ubv((GLubyte*)&pSurf->PolyColor.s); pglColor4ubv((GLubyte*)&pSurf->PolyColor.s);
} }
// Tint color // Tint color
tint.red = byte2float[pSurf->TintColor.s.red]; tint.red = byte2float[pSurf->TintColor.s.red];
tint.green = byte2float[pSurf->TintColor.s.green]; tint.green = byte2float[pSurf->TintColor.s.green];

View file

@ -8634,7 +8634,7 @@ void K_drawKartFreePlay(UINT32 flashtime)
return; return;
V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy
LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, "FREE PLAY");
} }
static void K_drawDistributionDebugger(void) static void K_drawDistributionDebugger(void)

View file

@ -11,7 +11,7 @@
#define KART_FULLTURN 800 #define KART_FULLTURN 800
UINT8 colortranslations[MAXTRANSLATIONS][16]; extern UINT8 colortranslations[MAXTRANSLATIONS][16];
extern const char *KartColor_Names[MAXSKINCOLORS]; extern const char *KartColor_Names[MAXSKINCOLORS];
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2]; extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);

View file

@ -16,6 +16,7 @@
#include "doomdef.h" #include "doomdef.h"
#include "command.h" #include "command.h"
#include "m_argv.h" #include "m_argv.h"
#include "m_misc.h"
/** \brief number of arg /** \brief number of arg
*/ */
@ -166,7 +167,7 @@ void M_FindResponseFile(void)
if (!file) if (!file)
I_Error("No more free memory for the response file"); I_Error("No more free memory for the response file");
if (fread(file, size, 1, handle) != 1) if (fread(file, size, 1, handle) != 1)
I_Error("Couldn't read response file because %s", strerror(ferror(handle))); I_Error("Couldn't read response file because %s", M_FileError(handle));
fclose(handle); fclose(handle);
// keep all the command line arguments following @responsefile // keep all the command line arguments following @responsefile

View file

@ -23,6 +23,8 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <errno.h>
// Extended map support. // Extended map support.
#include <ctype.h> #include <ctype.h>
@ -2363,3 +2365,13 @@ void M_SetupMemcpy(void)
M_Memcpy = cpu_cpy; M_Memcpy = cpu_cpy;
#endif #endif
} }
/** Return the appropriate message for a file error or end of file.
*/
const char *M_FileError(FILE *fp)
{
if (ferror(fp))
return strerror(errno);
else
return "end-of-file";
}

View file

@ -100,6 +100,8 @@ void strcatbf(char *s1, const char *s2, const char *s3);
void M_SetupMemcpy(void); void M_SetupMemcpy(void);
const char *M_FileError(FILE *handle);
// counting bits, for weapon ammo code, usually // counting bits, for weapon ammo code, usually
FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size); FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size);

View file

@ -1408,7 +1408,7 @@ static void P_LoadRawSideDefs2(void *data)
UINT16 i; UINT16 i;
INT32 num; INT32 num;
size_t j; size_t j;
UINT32 cr, cg, cb; RGBA_t color;
for (i = 0; i < numsides; i++) for (i = 0; i < numsides; i++)
{ {
@ -1490,23 +1490,21 @@ static void P_LoadRawSideDefs2(void *data)
// encore mode colormaps! // encore mode colormaps!
// do it like software by aproximating a color to a palette index, and then convert it to its encore variant and then back to a color code. // do it like software by aproximating a color to a palette index, and then convert it to its encore variant and then back to a color code.
// do this for both the start and fade colormaps. // do this for both the start and fade colormaps.
cr = (HEX2INT(col[1]) << 4) + (HEX2INT(col[2]) << 0); color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
cg = (HEX2INT(col[3]) << 12) + (HEX2INT(col[4]) << 8); color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
cb = (HEX2INT(col[5]) << 20) + (HEX2INT(col[6]) << 16); color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
#ifdef GLENCORE #ifdef GLENCORE
if (encoremap) if (encoremap)
{ {
j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)];
//CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation
cr = pLocalPalette[j].s.red; color = pLocalPalette[j];
cg = pLocalPalette[j].s.green;
cb = pLocalPalette[j].s.blue;
} }
#endif #endif
sec->extra_colormap->rgba = cr + cg + cb; sec->extra_colormap->rgba = color.rgba;
// alpha // alpha
if (msd->toptexture[7]) if (msd->toptexture[7])
@ -1533,23 +1531,21 @@ static void P_LoadRawSideDefs2(void *data)
col = msd->bottomtexture; col = msd->bottomtexture;
// do the exact same thing as above here. // do the exact same thing as above here.
cr = (HEX2INT(col[1]) << 4) + (HEX2INT(col[2]) << 0); color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
cg = (HEX2INT(col[3]) << 12) + (HEX2INT(col[4]) << 8); color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
cb = (HEX2INT(col[5]) << 20) + (HEX2INT(col[6]) << 16); color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
#ifdef GLENCORE #ifdef GLENCORE
if (encoremap) if (encoremap)
{ {
j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)];
//CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation
cr = pLocalPalette[j].s.red; color = pLocalPalette[j];
cg = pLocalPalette[j].s.green;
cb = pLocalPalette[j].s.blue;
} }
#endif #endif
sec->extra_colormap->fadergba = cr + cg + cb; sec->extra_colormap->fadergba = color.rgba;
// alpha // alpha
if (msd->bottomtexture[7]) if (msd->bottomtexture[7])

View file

@ -1142,7 +1142,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
aimingangle = player->aiming; aimingangle = player->aiming;
viewangle = viewmobj->angle; viewangle = viewmobj->angle;
if (/*!demo.playback && */player->playerstate != PST_DEAD) if (!demo.playback && player->playerstate != PST_DEAD)
{ {
if (player == &players[consoleplayer]) if (player == &players[consoleplayer])
{ {

View file

@ -402,7 +402,7 @@ static visplane_t *new_visplane(unsigned hash)
visplane_t *check = freetail; visplane_t *check = freetail;
if (!check) if (!check)
{ {
check = calloc(2, sizeof (*check)); check = calloc(1, sizeof (*check));
if (check == NULL) I_Error("%s: Out of memory", "new_visplane"); // FIXME: ugly if (check == NULL) I_Error("%s: Out of memory", "new_visplane"); // FIXME: ugly
} }
else else

View file

@ -236,7 +236,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum);
#ifdef MUSICSLOT_COMPATIBILITY #ifdef MUSICSLOT_COMPATIBILITY
// For compatibility with code/scripts relying on older versions // For compatibility with code/scripts relying on older versions
// This is a list of all the "special" slot names and their associated numbers // This is a list of all the "special" slot names and their associated numbers
const char *compat_special_music_slots[16]; extern const char *compat_special_music_slots[16];
#endif #endif
#endif #endif

View file

@ -33,6 +33,7 @@
#endif #endif
#include "../doomdef.h" #include "../doomdef.h"
#include "../d_main.h"
#ifdef HWRENDER #ifdef HWRENDER
#include "../hardware/r_opengl/r_opengl.h" #include "../hardware/r_opengl/r_opengl.h"
@ -154,11 +155,26 @@ boolean OglSdlSurface(INT32 w, INT32 h)
{ {
INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value;
static boolean first_init = false; static boolean first_init = false;
const char *gllogdir = NULL;
oglflags = 0; oglflags = 0;
if (!first_init) if (!first_init)
{ {
if (!gllogstream)
{
gllogdir = D_Home();
#ifdef DEBUG_TO_FILE
#ifdef DEFAULTDIR
if (gllogdir)
gllogstream = fopen(va("%s/"DEFAULTDIR"/ogllog.txt",gllogdir), "wt");
else
#endif
gllogstream = fopen("./ogllog.txt", "wt");
#endif
}
gl_version = pglGetString(GL_VERSION); gl_version = pglGetString(GL_VERSION);
gl_renderer = pglGetString(GL_RENDERER); gl_renderer = pglGetString(GL_RENDERER);
gl_extensions = pglGetString(GL_EXTENSIONS); gl_extensions = pglGetString(GL_EXTENSIONS);

View file

@ -1173,7 +1173,10 @@ void I_StartupSound(void)
const char *sdrv_name = NULL; const char *sdrv_name = NULL;
#endif #endif
#ifndef HAVE_MIXER #ifndef HAVE_MIXER
midi_disabled = digital_disabled = true; #ifndef NO_MIDI
midi_disabled =
#endif
digital_disabled = true;
#endif #endif
memset(channels, 0, sizeof (channels)); //Alam: Clean it memset(channels, 0, sizeof (channels)); //Alam: Clean it

View file

@ -1435,7 +1435,7 @@ static boolean LoadSong(void *data, size_t lumplength, size_t selectpos)
if (fwrite(data, lumplength, 1, midfile) == 0) if (fwrite(data, lumplength, 1, midfile) == 0)
{ {
CONS_Printf(M_GetText("Couldn't write music into file %s because %s\n"), tempname, strerror(ferror(midfile))); CONS_Printf(M_GetText("Couldn't write music into file %s because %s\n"), tempname, M_FileError(midfile));
Z_Free(data); Z_Free(data);
fclose(midfile); fclose(midfile);
return false; return false;

View file

@ -366,7 +366,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
// read the header // read the header
if (fread(&header, 1, sizeof header, handle) < sizeof header) if (fread(&header, 1, sizeof header, handle) < sizeof header)
{ {
CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), strerror(ferror(handle))); CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), M_FileError(handle));
return NULL; return NULL;
} }
@ -389,7 +389,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
if (fseek(handle, header.infotableofs, SEEK_SET) == -1 if (fseek(handle, header.infotableofs, SEEK_SET) == -1
|| fread(fileinfo, 1, i, handle) < i) || fread(fileinfo, 1, i, handle) < i)
{ {
CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), strerror(ferror(handle))); CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), M_FileError(handle));
free(fileinfov); free(fileinfov);
return NULL; return NULL;
} }
@ -410,7 +410,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
handle) < sizeof realsize) handle) < sizeof realsize)
{ {
I_Error("corrupt compressed file: %s; maybe %s", /// \todo Avoid the bailout? I_Error("corrupt compressed file: %s; maybe %s", /// \todo Avoid the bailout?
filename, strerror(ferror(handle))); filename, M_FileError(handle));
} }
realsize = LONG(realsize); realsize = LONG(realsize);
if (realsize != 0) if (realsize != 0)
@ -548,7 +548,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
fseek(handle, -4, SEEK_CUR); fseek(handle, -4, SEEK_CUR);
if (fread(&zend, 1, sizeof zend, handle) < sizeof zend) if (fread(&zend, 1, sizeof zend, handle) < sizeof zend)
{ {
CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", strerror(ferror(handle))); CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", M_FileError(handle));
return NULL; return NULL;
} }
numlumps = zend.entries; numlumps = zend.entries;
@ -565,7 +565,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
if (fread(zentry, 1, sizeof(zentry_t), handle) < sizeof(zentry_t)) if (fread(zentry, 1, sizeof(zentry_t), handle) < sizeof(zentry_t))
{ {
CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle))); CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", M_FileError(handle));
Z_Free(lumpinfo); Z_Free(lumpinfo);
free(zentry); free(zentry);
return NULL; return NULL;
@ -585,7 +585,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
fullname = malloc(zentry->namelen + 1); fullname = malloc(zentry->namelen + 1);
if (fgets(fullname, zentry->namelen + 1, handle) != fullname) if (fgets(fullname, zentry->namelen + 1, handle) != fullname)
{ {
CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle))); CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", M_FileError(handle));
Z_Free(lumpinfo); Z_Free(lumpinfo);
free(zentry); free(zentry);
free(fullname); free(fullname);