This commit is contained in:
Christoph Oelckers 2015-07-15 13:03:12 +02:00
commit 02c3828e8d
6 changed files with 40 additions and 7 deletions

View file

@ -533,6 +533,10 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
Printf (TEXTCOLOR_RED "Unloading scripts cannot exit the level again.\n");
return;
}
if (gameaction == ga_completed) // do not exit multiple times.
{
return;
}
if (levelname == NULL || *levelname == 0)
{

View file

@ -318,7 +318,7 @@ FString level_info_t::LookupLevelName()
checkstring[0] = '\0';
}
thename = strstr (lookedup, checkstring);
if (thename == NULL || thename == lookedup)
if (thename == NULL)
{
thename = lookedup;
}

View file

@ -1064,8 +1064,8 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm)
{
unblocking = true;
}
else if (abs(thing->x - tm.thing->x) < (thing->radius+tm.thing->radius)/2 &&
abs(thing->y - tm.thing->y) < (thing->radius+tm.thing->radius)/2)
else if (abs(thing->x - tm.thing->x) < (thing->radius+tm.thing->radius) &&
abs(thing->y - tm.thing->y) < (thing->radius+tm.thing->radius))
{
fixed_t newdist = P_AproxDistance(thing->x - tm.x, thing->y - tm.y);

View file

@ -98,7 +98,7 @@ void FTagManager::AddSectorTag(int sector, int tag)
void FTagManager::RemoveSectorTags(int sect)
{
if (startForSector.Size() > sect)
if (startForSector.Size() > (unsigned int)sect)
{
int start = startForSector[sect];
if (start >= 0)

View file

@ -106,6 +106,7 @@ LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
void CreateCrashLog (char *custominfo, DWORD customsize, HWND richedit);
void DisplayCrashLog ();
extern BYTE *ST_Util_BitsForBitmap (BITMAPINFO *bitmap_info);
void I_FlushBufferedConsoleStuff();
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
@ -128,6 +129,7 @@ HANDLE MainThread;
DWORD MainThreadID;
HANDLE StdOut;
bool FancyStdOut, AttachedStdOut;
bool ConWindowHidden;
// The main window
HWND Window;
@ -644,6 +646,7 @@ void I_SetWndProc()
SetWindowLongPtr (Window, GWLP_USERDATA, 1);
SetWindowLongPtr (Window, GWLP_WNDPROC, (WLONG_PTR)WndProc);
ShowWindow (ConWindow, SW_HIDE);
ConWindowHidden = true;
ShowWindow (GameTitleWindow, SW_HIDE);
I_InitInput (Window);
}
@ -675,8 +678,10 @@ void RestoreConView()
SetWindowLongPtr (Window, GWLP_WNDPROC, (WLONG_PTR)LConProc);
ShowWindow (ConWindow, SW_SHOW);
ConWindowHidden = false;
ShowWindow (GameTitleWindow, SW_SHOW);
I_ShutdownInput (); // Make sure the mouse pointer is available.
I_FlushBufferedConsoleStuff();
// Make sure the progress bar isn't visible.
if (StartScreen != NULL)
{

View file

@ -132,6 +132,7 @@ extern bool FancyStdOut;
extern HINSTANCE g_hInst;
extern FILE *Logfile;
extern bool NativeMouse;
extern bool ConWindowHidden;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
@ -912,12 +913,11 @@ void ToEditControl(HWND edit, const char *buf, wchar_t *wbuf, int bpos)
//
//==========================================================================
void I_PrintStr(const char *cp)
static void DoPrintStr(const char *cp, HWND edit, HANDLE StdOut)
{
if (ConWindow == NULL && StdOut == NULL)
if (edit == NULL && StdOut == NULL)
return;
HWND edit = ConWindow;
char buf[256];
wchar_t wbuf[countof(buf)];
int bpos = 0;
@ -1049,6 +1049,30 @@ void I_PrintStr(const char *cp)
}
}
static TArray<FString> bufferedConsoleStuff;
void I_PrintStr(const char *cp)
{
if (ConWindowHidden)
{
bufferedConsoleStuff.Push(cp);
DoPrintStr(cp, NULL, StdOut);
}
else
{
DoPrintStr(cp, ConWindow, StdOut);
}
}
void I_FlushBufferedConsoleStuff()
{
for (unsigned i = 0; i < bufferedConsoleStuff.Size(); i++)
{
DoPrintStr(bufferedConsoleStuff[i], ConWindow, NULL);
}
bufferedConsoleStuff.Clear();
}
//==========================================================================
//
// SetQueryIWAD