mirror of
https://github.com/kevinbentley/Descent3.git
synced 2026-04-04 11:00:04 -04:00
clang-format on everything.
This commit is contained in:
116
mac/macdebug.cpp
116
mac/macdebug.cpp
@@ -10,28 +10,28 @@
|
||||
* Revision 1.1.1.1 2003/08/26 03:58:15 kevinb
|
||||
* initial 1.5 import
|
||||
*
|
||||
*
|
||||
*
|
||||
* 4 4/12/00 7:08p Matt
|
||||
* From Duane for 1.4
|
||||
*
|
||||
*
|
||||
* 3 10/21/99 1:55p Kevin
|
||||
* Mac Merge!
|
||||
*
|
||||
*
|
||||
* 2 7/28/99 2:51p Kevin
|
||||
*
|
||||
*
|
||||
* 4 5/15/97 1:51 AM Jeremy
|
||||
* made osMessage/Error box correctly handle newlines and added some error
|
||||
* checking for strings which are too long to fit into pascal strings
|
||||
*
|
||||
*
|
||||
* 3 5/9/97 8:04 PM Jeremy
|
||||
* changed include of <Strings.h> to <TextUtils.h>
|
||||
*
|
||||
*
|
||||
* 2 3/21/97 6:53 PM Jeremy
|
||||
* First crack at implementing debugging and console io routines.
|
||||
* Currently the functions display a mac dialog box for errors and
|
||||
* messages and send all console messages through the macintosh's modem
|
||||
* port.
|
||||
*
|
||||
*
|
||||
* 1 2/28/97 12:16 PM Jeremy
|
||||
* MacOS specific Debug object libraries
|
||||
*
|
||||
@@ -49,21 +49,20 @@
|
||||
|
||||
extern int debug_level;
|
||||
|
||||
void setup_sioux(void)
|
||||
{
|
||||
SIOUXSettings.standalone = true;
|
||||
SIOUXSettings.setupmenus = true;
|
||||
SIOUXSettings.asktosaveonclose = false;
|
||||
SIOUXSettings.toppixel = 526;
|
||||
SIOUXSettings.leftpixel =10;
|
||||
SIOUXSettings.rows = 20;
|
||||
SIOUXSettings.columns = 120;
|
||||
void setup_sioux(void) {
|
||||
SIOUXSettings.standalone = true;
|
||||
SIOUXSettings.setupmenus = true;
|
||||
SIOUXSettings.asktosaveonclose = false;
|
||||
SIOUXSettings.toppixel = 526;
|
||||
SIOUXSettings.leftpixel = 10;
|
||||
SIOUXSettings.rows = 20;
|
||||
SIOUXSettings.columns = 120;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool Debug_break=false;
|
||||
bool Debug_mono=false;
|
||||
bool Debug_break = false;
|
||||
bool Debug_mono = false;
|
||||
|
||||
char *Debug_DumpInfo();
|
||||
#include "stringtable.h"
|
||||
@@ -73,66 +72,61 @@ char *Debug_DumpInfo();
|
||||
#include "renderer.h"
|
||||
|
||||
// if we are running under a debugger, then pass true
|
||||
bool Debug_Init(bool debugger, bool mono_debug)
|
||||
{
|
||||
bool Debug_Init(bool debugger, bool mono_debug) {
|
||||
#ifdef DAJ_DEBUG
|
||||
//#ifndef RELEASE
|
||||
Debug_break = debugger;
|
||||
//#ifndef RELEASE
|
||||
Debug_break = debugger;
|
||||
|
||||
if (mono_debug) {
|
||||
if (mono_debug) {
|
||||
|
||||
mprintf((0, "Linux system.\n"));
|
||||
}
|
||||
mprintf((0, "Linux system.\n"));
|
||||
}
|
||||
|
||||
if (Debug_break)
|
||||
mprintf((0, "Debug Break enabled.\n"));
|
||||
if (Debug_break)
|
||||
mprintf((0, "Debug Break enabled.\n"));
|
||||
|
||||
#endif //ifndef RELEASE
|
||||
#endif // ifndef RELEASE
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Does a messagebox with a stack dump
|
||||
//Messagebox shows topstring, then stack dump, then bottomstring
|
||||
//Return types are the same as the Windows return values
|
||||
int Debug_ErrorBox(int type,const char *title,const char *topstring,const char *bottomstring)
|
||||
{
|
||||
int answer = 0;
|
||||
// char *dumptext = Debug_DumpInfo();
|
||||
|
||||
Str255 debug_str;
|
||||
sprintf((char *)debug_str,"%s:%s\r\n%s",title,topstring,bottomstring);
|
||||
// Does a messagebox with a stack dump
|
||||
// Messagebox shows topstring, then stack dump, then bottomstring
|
||||
// Return types are the same as the Windows return values
|
||||
int Debug_ErrorBox(int type, const char *title, const char *topstring, const char *bottomstring) {
|
||||
int answer = 0;
|
||||
// char *dumptext = Debug_DumpInfo();
|
||||
|
||||
Str255 debug_str;
|
||||
sprintf((char *)debug_str, "%s:%s\r\n%s", title, topstring, bottomstring);
|
||||
#ifdef DAJ_DEBUG
|
||||
DebugStr(debug_str);
|
||||
DebugStr(debug_str);
|
||||
#else
|
||||
// if (GetFunctionMode() > INIT_MODE) {
|
||||
rend_Close();
|
||||
::ShowCursor();
|
||||
::ParamText(c2pstr(topstring), c2pstr(bottomstring), NULL, NULL);
|
||||
::Alert(911, NULL);
|
||||
// } else {
|
||||
// DoMessageBox(TXT_ERROR, (char *)debug_str, MSGBOX_OK, UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL);
|
||||
// }
|
||||
exit(0);
|
||||
// if (GetFunctionMode() > INIT_MODE) {
|
||||
rend_Close();
|
||||
::ShowCursor();
|
||||
::ParamText(c2pstr(topstring), c2pstr(bottomstring), NULL, NULL);
|
||||
::Alert(911, NULL);
|
||||
// } else {
|
||||
// DoMessageBox(TXT_ERROR, (char *)debug_str, MSGBOX_OK, UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL);
|
||||
// }
|
||||
exit(0);
|
||||
// fprintf(stderr,"%s:%s\r\n\r\n%s\r\n\r\n%s",title,topstring,dumptext,bottomstring);
|
||||
#endif
|
||||
// debug_break();
|
||||
// debug_break();
|
||||
|
||||
return answer;
|
||||
return answer;
|
||||
}
|
||||
|
||||
// displays an message box
|
||||
// displays an message box
|
||||
// Returns the same values as the Win32 MessageBox() function
|
||||
int Debug_MessageBox(int type, const char *title, const char *str)
|
||||
{
|
||||
return Debug_ErrorBox(type,str,"Descent 3 Message","");
|
||||
int Debug_MessageBox(int type, const char *title, const char *str) {
|
||||
return Debug_ErrorBox(type, str, "Descent 3 Message", "");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
char *Debug_DumpInfo(void)
|
||||
{
|
||||
static char e[]= "System Error";
|
||||
return e;
|
||||
}
|
||||
|
||||
char *Debug_DumpInfo(void) {
|
||||
static char e[] = "System Error";
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user