- Fixed: The VC++ project was not set up to redefine RM using del in

wadsrc/Makefile, nor did it use the makefile for cleaning.
- Added ST_NetMessage() for mixing miscellaneous messages with the network
  startup meter, since they get mixed in the same space on the Linux terminal
  and must be handled properly to avoid looking bad.


SVN r429 (trunk)
This commit is contained in:
Randy Heit 2006-12-29 02:21:47 +00:00
commit ff65f75a8c
6 changed files with 319 additions and 169 deletions

View file

@ -54,6 +54,14 @@ int MaxPos, CurPos;
int NetMaxPos, NetCurPos;
LRESULT NetMarqueeMode;
//===========================================================================
//
// ST_Init
//
// Sets the size of the progress bar and displays the startup screen.
//
//===========================================================================
void ST_Init(int maxProgress)
{
ProgressBar = CreateWindowEx(0, PROGRESS_CLASS,
@ -66,6 +74,15 @@ void ST_Init(int maxProgress)
CurPos = 0;
}
//===========================================================================
//
// ST_Done
//
// Called just before entering graphics mode to deconstruct the startup
// screen.
//
//===========================================================================
void ST_Done()
{
if (ProgressBar != NULL)
@ -76,6 +93,14 @@ void ST_Done()
}
}
//===========================================================================
//
// ST_Progress
//
// Bumps the progress meter one notch.
//
//===========================================================================
void ST_Progress()
{
if (CurPos < MaxPos)
@ -156,6 +181,14 @@ void ST_NetInit(const char *message, int numplayers)
ST_NetProgress(1); // You always know about yourself
}
//===========================================================================
//
// ST_NetDone
//
// Removes the network startup pane.
//
//===========================================================================
void ST_NetDone()
{
if (NetStartPane != NULL)
@ -166,6 +199,36 @@ void ST_NetDone()
}
}
//===========================================================================
//
// ST_NetMessage
//
// Call this between ST_NetInit() and ST_NetDone() instead of Printf() to
// display messages, in case the progress meter is mixed in the same output
// stream as normal messages.
//
//===========================================================================
void ST_NetMessage(const char *format, ...)
{
FString str;
va_list argptr;
va_start (argptr, format);
str.VFormat (format, argptr);
va_end (argptr);
Printf ("%s\n", str.GetChars());
}
//===========================================================================
//
// ST_NetProgress
//
// Sets the network progress meter. If count is 0, it gets bumped by 1.
// Otherwise, it is set to count.
//
//===========================================================================
void ST_NetProgress(int count)
{
if (count == 0)
@ -199,7 +262,7 @@ void ST_NetProgress(int count)
//
// ST_NetLoop
//
// The timer_callback function is called approximately two times per second
// The timer_callback function is called at least two times per second
// and passed the userdata value. It should return true to stop the loop and
// return control to the caller or false to continue the loop.
//
@ -247,6 +310,15 @@ bool ST_NetLoop(bool (*timer_callback)(void *), void *userdata)
return false;
}
//===========================================================================
//
// NetStartPaneProc
//
// DialogProc for the network startup pane. It just waits for somebody to
// click a button, and the only button available is the abort one.
//
//===========================================================================
INT_PTR CALLBACK NetStartPaneProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED)