mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 00:11:19 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
7e562a3ca5
7 changed files with 118 additions and 118 deletions
|
@ -395,7 +395,7 @@ static void readPlayer(MYFILE *f, INT32 num)
|
|||
// It works down here, though.
|
||||
{
|
||||
INT32 numline = 0;
|
||||
for (i = 0; i < MAXLINELEN-1; i++)
|
||||
for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++)
|
||||
{
|
||||
if (numline < 20 && description[num].notes[i] == '\n')
|
||||
numline++;
|
||||
|
@ -1265,7 +1265,7 @@ static void readgametype(MYFILE *f, char *gtname)
|
|||
// It works down here, though.
|
||||
{
|
||||
INT32 numline = 0;
|
||||
for (i = 0; i < MAXLINELEN-1; i++)
|
||||
for (i = 0; (size_t)i < sizeof(gtdescription)-1; i++)
|
||||
{
|
||||
if (numline < 20 && gtdescription[i] == '\n')
|
||||
numline++;
|
||||
|
|
10
src/g_demo.c
10
src/g_demo.c
|
@ -765,7 +765,7 @@ void G_GhostTicker(void)
|
|||
if (xziptic & EZT_THOKMASK)
|
||||
{ // Let's only spawn ONE of these per frame, thanks.
|
||||
mobj_t *mobj;
|
||||
INT32 type = -1;
|
||||
UINT32 type = MT_NULL;
|
||||
if (g->mo->skin)
|
||||
{
|
||||
skin_t *skin = (skin_t *)g->mo->skin;
|
||||
|
@ -997,7 +997,11 @@ void G_ReadMetalTic(mobj_t *metal)
|
|||
// Read changes from the tic
|
||||
if (ziptic & GZT_XYZ)
|
||||
{
|
||||
P_TeleportMove(metal, READFIXED(metal_p), READFIXED(metal_p), READFIXED(metal_p));
|
||||
// make sure the values are read in the right order
|
||||
oldmetal.x = READFIXED(metal_p);
|
||||
oldmetal.y = READFIXED(metal_p);
|
||||
oldmetal.z = READFIXED(metal_p);
|
||||
P_TeleportMove(metal, oldmetal.x, oldmetal.y, oldmetal.z);
|
||||
oldmetal.x = metal->x;
|
||||
oldmetal.y = metal->y;
|
||||
oldmetal.z = metal->z;
|
||||
|
@ -1052,7 +1056,7 @@ void G_ReadMetalTic(mobj_t *metal)
|
|||
if (xziptic & EZT_THOKMASK)
|
||||
{ // Let's only spawn ONE of these per frame, thanks.
|
||||
mobj_t *mobj;
|
||||
INT32 type = -1;
|
||||
UINT32 type = MT_NULL;
|
||||
if (metal->skin)
|
||||
{
|
||||
skin_t *skin = (skin_t *)metal->skin;
|
||||
|
|
|
@ -1771,7 +1771,7 @@ void P_XYMovement(mobj_t *mo)
|
|||
fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls
|
||||
boolean moved;
|
||||
pslope_t *oldslope = NULL;
|
||||
vector3_t slopemom;
|
||||
vector3_t slopemom = {0,0,0};
|
||||
fixed_t predictedz = 0;
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
|
|
|
@ -1042,7 +1042,7 @@ static boolean Polyobj_moveXY(polyobj_t *po, fixed_t x, fixed_t y, boolean check
|
|||
// The formula for this can be found here:
|
||||
// http://www.inversereality.org/tutorials/graphics%20programming/2dtransformations.html
|
||||
// It is, of course, just a vector-matrix multiplication.
|
||||
static inline void Polyobj_rotatePoint(vertex_t *v, const vertex_t *c, angle_t ang)
|
||||
static inline void Polyobj_rotatePoint(vertex_t *v, const vector2_t *c, angle_t ang)
|
||||
{
|
||||
vertex_t tmp = *v;
|
||||
|
||||
|
@ -1095,7 +1095,7 @@ static void Polyobj_rotateLine(line_t *ld)
|
|||
}
|
||||
|
||||
// Causes objects resting on top of the rotating polyobject to 'ride' with its movement.
|
||||
static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta, UINT8 turnthings)
|
||||
static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta, UINT8 turnthings)
|
||||
{
|
||||
static INT32 pomovecount = 10000;
|
||||
INT32 x, y;
|
||||
|
@ -1175,7 +1175,7 @@ static boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, bo
|
|||
{
|
||||
size_t i;
|
||||
angle_t angle;
|
||||
vertex_t origin;
|
||||
vector2_t origin;
|
||||
INT32 hitflags = 0;
|
||||
|
||||
// don't move bad polyobjects
|
||||
|
|
171
src/sdl/i_main.c
171
src/sdl/i_main.c
|
@ -103,6 +103,93 @@ static inline VOID MakeCodeWritable(VOID)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOGMESSAGES
|
||||
static VOID InitLogging(VOID)
|
||||
{
|
||||
const char *logdir = NULL;
|
||||
time_t my_time;
|
||||
struct tm * timeinfo;
|
||||
const char *format;
|
||||
const char *reldir;
|
||||
int left;
|
||||
boolean fileabs;
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
const char *link;
|
||||
#endif
|
||||
|
||||
logdir = D_Home();
|
||||
|
||||
my_time = time(NULL);
|
||||
timeinfo = localtime(&my_time);
|
||||
|
||||
if (M_CheckParm("-logfile") && M_IsNextParm())
|
||||
{
|
||||
format = M_GetNextParm();
|
||||
fileabs = M_IsPathAbsolute(format);
|
||||
}
|
||||
else
|
||||
{
|
||||
format = "log-%Y-%m-%d_%H-%M-%S.txt";
|
||||
fileabs = false;
|
||||
}
|
||||
|
||||
if (fileabs)
|
||||
{
|
||||
strftime(logfilename, sizeof logfilename, format, timeinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-logdir") && M_IsNextParm())
|
||||
reldir = M_GetNextParm();
|
||||
else
|
||||
reldir = "logs";
|
||||
|
||||
if (M_IsPathAbsolute(reldir))
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"%s"PATHSEP, reldir);
|
||||
}
|
||||
else
|
||||
#ifdef DEFAULTDIR
|
||||
if (logdir)
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"%s"PATHSEP DEFAULTDIR PATHSEP"%s"PATHSEP, logdir, reldir);
|
||||
}
|
||||
else
|
||||
#endif/*DEFAULTDIR*/
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"."PATHSEP"%s"PATHSEP, reldir);
|
||||
}
|
||||
|
||||
strftime(&logfilename[left], sizeof logfilename - left,
|
||||
format, timeinfo);
|
||||
}
|
||||
|
||||
M_MkdirEachUntil(logfilename,
|
||||
M_PathParts(logdir) - 1,
|
||||
M_PathParts(logfilename) - 1, 0755);
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
logstream = fopen(logfilename, "w");
|
||||
#ifdef DEFAULTDIR
|
||||
if (logdir)
|
||||
link = va("%s/"DEFAULTDIR"/latest-log.txt", logdir);
|
||||
else
|
||||
#endif/*DEFAULTDIR*/
|
||||
link = "latest-log.txt";
|
||||
unlink(link);
|
||||
if (symlink(logfilename, link) == -1)
|
||||
{
|
||||
I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno));
|
||||
}
|
||||
#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
logstream = fopen("latest-log.txt", "wt+");
|
||||
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** \brief The main function
|
||||
|
||||
|
@ -121,7 +208,6 @@ int SDL_main(int argc, char **argv)
|
|||
int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
const char *logdir = NULL;
|
||||
myargc = argc;
|
||||
myargv = argv; /// \todo pull out path to exe from this string
|
||||
|
||||
|
@ -135,90 +221,9 @@ int main(int argc, char **argv)
|
|||
|
||||
#ifdef LOGMESSAGES
|
||||
if (!M_CheckParm("-nolog"))
|
||||
{
|
||||
time_t my_time;
|
||||
struct tm * timeinfo;
|
||||
const char *format;
|
||||
const char *reldir;
|
||||
int left;
|
||||
boolean fileabs;
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
const char *link;
|
||||
#endif
|
||||
|
||||
logdir = D_Home();
|
||||
|
||||
my_time = time(NULL);
|
||||
timeinfo = localtime(&my_time);
|
||||
|
||||
if (M_CheckParm("-logfile") && M_IsNextParm())
|
||||
{
|
||||
format = M_GetNextParm();
|
||||
fileabs = M_IsPathAbsolute(format);
|
||||
}
|
||||
else
|
||||
{
|
||||
format = "log-%Y-%m-%d_%H-%M-%S.txt";
|
||||
fileabs = false;
|
||||
}
|
||||
|
||||
if (fileabs)
|
||||
{
|
||||
strftime(logfilename, sizeof logfilename, format, timeinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-logdir") && M_IsNextParm())
|
||||
reldir = M_GetNextParm();
|
||||
else
|
||||
reldir = "logs";
|
||||
|
||||
if (M_IsPathAbsolute(reldir))
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"%s"PATHSEP, reldir);
|
||||
}
|
||||
else
|
||||
#ifdef DEFAULTDIR
|
||||
if (logdir)
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"%s"PATHSEP DEFAULTDIR PATHSEP"%s"PATHSEP, logdir, reldir);
|
||||
}
|
||||
else
|
||||
#endif/*DEFAULTDIR*/
|
||||
{
|
||||
left = snprintf(logfilename, sizeof logfilename,
|
||||
"."PATHSEP"%s"PATHSEP, reldir);
|
||||
}
|
||||
InitLogging();
|
||||
#endif/*LOGMESSAGES*/
|
||||
|
||||
strftime(&logfilename[left], sizeof logfilename - left,
|
||||
format, timeinfo);
|
||||
}
|
||||
|
||||
M_MkdirEachUntil(logfilename,
|
||||
M_PathParts(logdir) - 1,
|
||||
M_PathParts(logfilename) - 1, 0755);
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
logstream = fopen(logfilename, "w");
|
||||
#ifdef DEFAULTDIR
|
||||
if (logdir)
|
||||
link = va("%s/"DEFAULTDIR"/latest-log.txt", logdir);
|
||||
else
|
||||
#endif/*DEFAULTDIR*/
|
||||
link = "latest-log.txt";
|
||||
unlink(link);
|
||||
if (symlink(logfilename, link) == -1)
|
||||
{
|
||||
I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno));
|
||||
}
|
||||
#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
logstream = fopen("latest-log.txt", "wt+");
|
||||
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||
}
|
||||
|
||||
//I_OutputMsg("I_StartupSystem() ...\n");
|
||||
I_StartupSystem();
|
||||
#if defined (_WIN32)
|
||||
|
|
|
@ -3710,7 +3710,7 @@ void V_Init(void)
|
|||
|
||||
#ifdef DEBUG
|
||||
CONS_Debug(DBG_RENDER, "V_Init done:\n");
|
||||
for (i = 0; i < NUMSCREENS+1; i++)
|
||||
for (i = 0; i < NUMSCREENS; i++)
|
||||
CONS_Debug(DBG_RENDER, " screens[%d] = %x\n", i, screens[i]);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -643,37 +643,28 @@ int WINAPI WinMain (HINSTANCE hInstance,
|
|||
int nCmdShow)
|
||||
{
|
||||
int Result = -1;
|
||||
|
||||
#if 0
|
||||
// Win95 and NT <4 don't have this, so link at runtime.
|
||||
p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"),"IsDebuggerPresent");
|
||||
#endif
|
||||
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
UNREFERENCED_PARAMETER(nCmdShow);
|
||||
|
||||
#if 0
|
||||
#ifdef BUGTRAP
|
||||
// Try BugTrap first.
|
||||
if((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) && InitBugTrap())
|
||||
Result = HandledWinMain(hInstance);
|
||||
else
|
||||
{
|
||||
#endif
|
||||
// Try Dr MinGW's exception handler.
|
||||
if (!pfnIsDebuggerPresent || !pfnIsDebuggerPresent())
|
||||
#endif
|
||||
LoadLibraryA("exchndl.dll");
|
||||
|
||||
#ifndef __MINGW32__
|
||||
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
|
||||
#endif
|
||||
|
||||
Result = HandledWinMain(hInstance);
|
||||
#if 0
|
||||
p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"),"IsDebuggerPresent");
|
||||
if((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent())
|
||||
#ifdef BUGTRAP
|
||||
&& !InitBugTrap()
|
||||
#endif
|
||||
)
|
||||
#endif
|
||||
{
|
||||
LoadLibraryA("exchndl.dll");
|
||||
}
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
|
||||
#endif
|
||||
Result = HandledWinMain(hInstance);
|
||||
#ifdef BUGTRAP
|
||||
} // BT failure clause.
|
||||
|
||||
// This is safe even if BT didn't start.
|
||||
ShutdownBugTrap();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue