Add support for OS native error/warning boxes, only implemented for Mac for now

This commit is contained in:
Chris Taylor 2010-11-28 20:08:29 +08:00
parent 12e26b2d08
commit 4fa20a3d9f
13 changed files with 221 additions and 230 deletions

View file

@ -4,6 +4,7 @@ D2X-Rebirth Changelog
--------
main/multi.c: In multi_new_game when initializing Players structures, also correctly init connected variable which is highly important for spreading pdata to clients and should be set correctly anyways (Thanks to Gold Leader and Flip for help with debugging/testing recent Multiplayer bugs)
main/powerup.c: in do_powerup added check for distance of other players to powerup object to make redundant pickups less likely
arch/carbon/messagebox.c, arch/include/messagebox.h, arch/linux/messagebox.c, arch/sdl/rbaudio.c, arch/win32/messagebox.c, d2x-rebirth.xcodeproj/project.pbxproj, main/editor/med.c, main/game.c, main/inferno.c, SConstruct: Add support for OS native error/warning boxes, only implemented for Mac for now
20101126
--------

View file

@ -308,6 +308,7 @@ if sys.platform == 'win32':
ogldefines = ['OGL']
if (use_ipx == 1):
common_sources += ['arch/win32/ipx.c']
common_sources += ['arch/win32/messagebox.c']
ogllibs = ''
libs += ['glu32', 'wsock32', 'winmm', 'mingw32', 'SDLmain', 'SDL']
lflags = '-mwindows arch/win32/d2xr.res'
@ -319,11 +320,12 @@ elif sys.platform == 'darwin':
asm = 0
env.Append(CPPPATH = ['arch/linux/include'])
ogldefines = ['OGL']
common_sources += 'arch/cocoa/SDLMain.m'
common_sources += ['arch/cocoa/SDLMain.m', 'arch/carbon/messagebox.c']
ogllibs = ''
libs = ''
# Ugly way of linking to frameworks, but kreator has seen uglier
lflags = '-framework Cocoa -framework SDL -framework physfs'
lflags = '-framework ApplicationServices -framework Carbon -framework Cocoa -framework SDL'
libs += '../physfs/build/Debug/libphysfs.dylib'
if (sdl_only == 0):
lflags += ' -framework OpenGL'
if (sdlmixer == 1):
@ -348,6 +350,7 @@ else:
ogldefines = ['OGL']
if (use_ipx == 1):
common_sources += ['arch/linux/ipx.c', 'arch/linux/ipx_kali.c', 'arch/linux/ukali.c']
common_sources += 'arch/linux/messagebox.c'
libs += env['LIBS']
ogllibs = ['GL', 'GLU']
lflags = '-L/usr/X11R6/lib'

View file

@ -1,134 +0,0 @@
/*
* findfile.c
* D2X (Descent2)
*
* Created by Chris Taylor on Tue Jun 22 2004.
*
*/
#include "pstypes.h"
#include "findfile.h"
#include "u_mem.h"
#include "strutil.h"
#ifdef macintosh
#include <Files.h>
extern void macify_posix_path(char *posix_path, char *mac_path);
#else
#include <CoreServices/CoreServices.h>
#endif
// Global Variables
FSIterator iterator;
int path_len;
FSRef *refs;
int i;
char type[5];
ItemCount num_new_files;
// Functions
int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
{
FSRef parent;
char path[_MAX_PATH];
OSStatus myErr;
for (path_len = 0; *search_str && *search_str != '*'; path_len ++)
path[path_len] = *search_str++;
path[path_len] = 0;
if (*search_str == '*')
search_str++;
strcpy(type, search_str);
#ifdef macintosh
// Convert the search directory to an FSRef in a way that OS 9 can handle
{
FSSpec parentSpec;
Str255 pascalPath;
macify_posix_path(path, path);
CopyCStringToPascal(path, pascalPath);
if (FSMakeFSSpec(0, 0, pascalPath, &parentSpec) != noErr)
return 1;
if (FSpMakeFSRef(&parentSpec, &parent) != noErr)
return 1;
}
#else
// "This function, though available through Carbon on Mac OS 8 and 9, is only implemented on Mac OS X."
if ((myErr = FSPathMakeRef((unsigned char const *) (path_len? path : "."), &parent, NULL)) != noErr)
return 1;
#endif
if (FSRefMakePath(&parent, (unsigned char *) path, _MAX_PATH) != noErr) // Get the full path, to get the length
return 1;
path_len = strlen(path)
#ifndef macintosh
+ 1 // For the '/'
#endif
;
if (FSOpenIterator(&parent, kFSIterateFlat, &iterator) != noErr)
return 1;
MALLOC(refs, FSRef, 256);
myErr = FSGetCatalogInfoBulk(iterator, 256, &num_new_files, NULL, kFSCatInfoNone, NULL, refs, NULL, NULL);
i = 0;
do {
char *p = path + path_len;
if (i >= num_new_files) {
if (!myErr) {
myErr = FSGetCatalogInfoBulk(iterator, 256, &num_new_files, NULL, kFSCatInfoNone, NULL, refs, NULL, NULL);
i = 0;
} else
return 1; // The last file
}
FSRefMakePath (refs + i, (unsigned char *) path, 255);
i++;
if (!stricmp(p + strlen(p) - strlen(search_str), search_str)) {
strncpy(ffstruct->name, p, 256);
return 0; // Found one
}
} while (1);
}
int FileFindNext(FILEFINDSTRUCT *ffstruct)
{
OSErr myErr;
do {
char path[_MAX_PATH];
char *p = path + path_len;
if (i >= num_new_files) {
if (!myErr) {
myErr = FSGetCatalogInfoBulk(iterator, 256, &num_new_files, NULL, kFSCatInfoNone, NULL, refs, NULL, NULL);
i = 0;
} else
return 1; // The last file
}
FSRefMakePath (refs + i, (unsigned char *) path, 255);
i++;
if (!stricmp(p + strlen(p) - strlen(type), type)) {
strncpy(ffstruct->name, p, 256);
return 0; // Found one
}
} while (1);
}
int FileFindClose(void)
{
d_free(refs);
if (FSCloseIterator(iterator) != noErr)
return 1;
return 0;
}

View file

@ -1,34 +0,0 @@
/*
* gui.c
* D2X (Descent2)
*
* Created by Chris Taylor on Sat Jul 03 2004.
*
*/
#ifdef __APPLE__
#include <Carbon/Carbon.h>
#else
#include <Carbon.h>
#endif
void ErrorDialog(char *message)
{
Str255 pascal_message;
short itemHit; // Insists on returning this
CopyCStringToPascal(message, pascal_message);
ShowCursor();
StandardAlert(kAlertStopAlert, pascal_message, NULL, 0, &itemHit);
}
void WarningDialog(char *s)
{
Str255 pascal_message;
short itemHit; // Insists on returning this
CopyCStringToPascal(s, pascal_message);
ShowCursor();
StandardAlert(kAlertCautionAlert, pascal_message, NULL, 0, &itemHit);
HideCursor();
}

83
arch/carbon/messagebox.c Normal file
View file

@ -0,0 +1,83 @@
/*
* messagebox.c
* d1x-rebirth
*
* Display an error or warning messagebox using the OS's window server.
*
*/
#ifdef __APPLE__
#include <Carbon/Carbon.h>
#else
#include <Carbon.h>
#endif
#include "window.h"
#include "event.h"
#include "messagebox.h"
void display_mac_alert(char *message, int error)
{
int16_t itemHit;
uint response;
bool osX = FALSE;
d_event event = { EVENT_WINDOW_DEACTIVATED };
window *wind;
// Handle Descent's windows properly
if ((wind = window_get_front()))
window_send_event(window_get_front(), &event);
event.type = EVENT_WINDOW_ACTIVATED;
osX = ( Gestalt(gestaltSystemVersion, (long *) &response) == noErr)
&& (response >= 0x01000 );
if (osX)
{
#ifdef TARGET_API_MAC_CARBON
DialogRef alert;
CFStringRef error_text = CFSTR("Sorry, a critical error has occurred.");
CFStringRef text = NULL;
text = CFStringCreateWithCString(CFAllocatorGetDefault(), message, kCFStringEncodingMacRoman);
if (!text)
{
if (wind) window_send_event(window_get_front(), &event);
return;
}
if (CreateStandardAlert(error ? kAlertStopAlert : kAlertNoteAlert, error ? error_text : text, error ? text : NULL, 0, &alert) != noErr)
{
CFRelease(text);
if (wind) window_send_event(window_get_front(), &event);
return;
}
RunStandardAlert(alert, 0, &itemHit);
CFRelease(text);
#endif
}
else
{
Str255 error_text = "\pSorry, a critical error has occurred.";
Str255 text;
#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4) // kill warning
CopyCStringToPascal(message, text);
#endif
StandardAlert(error ? kAlertStopAlert : kAlertNoteAlert, error ? error_text : text, error ? text : NULL, 0, &itemHit);
}
if (wind)
window_send_event(window_get_front(), &event);
}
void msgbox_warning(char *message)
{
display_mac_alert(message, 0);
}
void msgbox_error(char *message)
{
display_mac_alert(message, 1);
}

18
arch/include/messagebox.h Normal file
View file

@ -0,0 +1,18 @@
/*
* messagebox.h
* d1x-rebirth
*
* Display an error or warning messagebox using the OS's window server.
*
*/
#ifndef _MESSAGEBOX_H
#define _MESSAGEBOX_H
// Display a warning in a messagebox
extern void msgbox_warning(char *message);
// Display an error in a messagebox
extern void msgbox_error(char *message);
#endif

37
arch/linux/messagebox.c Normal file
View file

@ -0,0 +1,37 @@
/*
* messagebox.c
* d1x-rebirth
*
* Display an error or warning messagebox using the OS's window server.
*
*/
#include "window.h"
#include "event.h"
#include "messagebox.h"
void display_linux_alert(char *message, int error)
{
d_event event = { EVENT_WINDOW_DEACTIVATED };
window *wind;
// Handle Descent's windows properly
if ((wind = window_get_front()))
window_send_event(window_get_front(), &event);
event.type = EVENT_WINDOW_ACTIVATED;
// TODO: insert messagebox code...
if (wind)
window_send_event(window_get_front(), &event);
}
void msgbox_warning(char *message)
{
display_linux_alert(message, 0);
}
void msgbox_error(char *message)
{
display_linux_alert(message, 1);
}

View file

@ -53,7 +53,7 @@ void RBAInit()
num_cds = SDL_CDNumDrives();
if (num_cds < 1)
{
Warning("No cdrom drives found!\n");
con_printf(CON_NORMAL, "No cdrom drives found!\n");
#if defined(__APPLE__) || defined(macintosh)
SDL_QuitSubSystem(SDL_INIT_CDROM); // necessary for rescanning CDROMs
#endif
@ -83,7 +83,7 @@ void RBAInit()
if (i == num_cds)
{
Warning("No audio CDs found\n");
con_printf(CON_NORMAL, "No audio CDs found\n");
if (s_cd) // if there's no audio CD, say that there's no redbook and hence play MIDI instead
{
SDL_CDClose(s_cd);

37
arch/win32/messagebox.c Normal file
View file

@ -0,0 +1,37 @@
/*
* messagebox.c
* d1x-rebirth
*
* Display an error or warning messagebox using the OS's window server.
*
*/
#include "window.h"
#include "event.h"
#include "messagebox.h"
void display_win32_alert(char *message, int error)
{
d_event event = { EVENT_WINDOW_DEACTIVATED };
window *wind;
// Handle Descent's windows properly
if ((wind = window_get_front()))
window_send_event(window_get_front(), &event);
event.type = EVENT_WINDOW_ACTIVATED;
// TODO: insert messagebox code...
if (wind)
window_send_event(window_get_front(), &event);
}
void msgbox_warning(char *message)
{
display_win32_alert(message, 0);
}
void msgbox_error(char *message)
{
display_win32_alert(message, 1);
}

View file

@ -340,6 +340,8 @@
67F6FED3066B13B400443922 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 67F6FED1066B13B400443922 /* SDLMain.m */; };
67F6FED4066B13B400443922 /* SDLMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 67F6FED0066B13B400443922 /* SDLMain.h */; };
67F6FED5066B13B400443922 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 67F6FED1066B13B400443922 /* SDLMain.m */; };
EB092A8012A25AFB004D9A79 /* messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = EB092A7F12A25AFB004D9A79 /* messagebox.c */; };
EB092A8112A25AFB004D9A79 /* messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = EB092A7F12A25AFB004D9A79 /* messagebox.c */; };
EB1405E9121044B5002B1CC6 /* physfsx.c in Sources */ = {isa = PBXBuildFile; fileRef = EB1405E8121044B5002B1CC6 /* physfsx.c */; };
EB1405EA121044B5002B1CC6 /* physfsx.c in Sources */ = {isa = PBXBuildFile; fileRef = EB1405E8121044B5002B1CC6 /* physfsx.c */; };
EB28D9A30ECEAF1C00E68E9B /* init.c in Sources */ = {isa = PBXBuildFile; fileRef = EB28D9A20ECEAF1C00E68E9B /* init.c */; };
@ -640,6 +642,16 @@
EB0421040A341042002CC961 /* ai.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ai.h; sourceTree = "<group>"; };
EB0421050A341042002CC961 /* controls.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = "<group>"; };
EB0421060A341042002CC961 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
EB092A7F12A25AFB004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = "<group>"; };
EB092A8412A25EB1004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = "<group>"; };
EB092A8512A25EC8004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = "<group>"; };
EB092A8712A25EE4004D9A79 /* d3dhelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = d3dhelp.h; sourceTree = "<group>"; };
EB092A8812A25EE4004D9A79 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
EB092A8912A25EE4004D9A79 /* pch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pch.h; sourceTree = "<group>"; };
EB092A8A12A25EE4004D9A79 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; };
EB092A8B12A25EE4004D9A79 /* scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = "<group>"; };
EB092A8C12A25EE4004D9A79 /* texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = texture.h; sourceTree = "<group>"; };
EB092A8D12A25EE4004D9A79 /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = "<group>"; };
EB1405E8121044B5002B1CC6 /* physfsx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = physfsx.c; sourceTree = "<group>"; };
EB28D9A20ECEAF1C00E68E9B /* init.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = "<group>"; };
EB91A437126175ED009E0095 /* libphysfs.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libphysfs.dylib; path = ../physfs/build/Release/libphysfs.dylib; sourceTree = SOURCE_ROOT; };
@ -661,8 +673,6 @@
EBAFC24B088E4C53006329AD /* physfsrwops.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = physfsrwops.h; sourceTree = "<group>"; };
EBAFC269088E508D006329AD /* conf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = conf.h; sourceTree = "<group>"; };
EBAFC26A088E508D006329AD /* descent.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = descent.r; sourceTree = "<group>"; };
EBAFC26B088E508D006329AD /* findfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = findfile.c; sourceTree = "<group>"; };
EBAFC26C088E508D006329AD /* gui.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = gui.c; sourceTree = "<group>"; };
EBAFC26D088E508D006329AD /* SDL_main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_main.c; sourceTree = "<group>"; };
EBAFC28F088E67CD006329AD /* digiobj.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digiobj.c; sourceTree = "<group>"; };
EBAFC2B0088E695F006329AD /* ignorecase.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ignorecase.c; sourceTree = "<group>"; };
@ -673,15 +683,6 @@
EBB9E5330D8E82B3003466E6 /* clip.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = clip.h; sourceTree = "<group>"; };
EBB9E5380D8E82FF003466E6 /* clipper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = clipper.h; sourceTree = "<group>"; };
EBB9E5390D8E82FF003466E6 /* globvars.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = globvars.h; sourceTree = "<group>"; };
EBB9E53B0D8E8378003466E6 /* hmpfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hmpfile.c; sourceTree = "<group>"; };
EBB9E53D0D8E8378003466E6 /* d3dhelp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = d3dhelp.h; sourceTree = "<group>"; };
EBB9E53E0D8E8378003466E6 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
EBB9E53F0D8E8378003466E6 /* hmpfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hmpfile.h; sourceTree = "<group>"; };
EBB9E5400D8E8378003466E6 /* pch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pch.h; sourceTree = "<group>"; };
EBB9E5410D8E8378003466E6 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; };
EBB9E5420D8E8378003466E6 /* scene.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = "<group>"; };
EBB9E5430D8E8378003466E6 /* texture.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = texture.h; sourceTree = "<group>"; };
EBB9E5450D8E8378003466E6 /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = "<group>"; };
EBB9E5480D8E83F2003466E6 /* internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
EBB9E5490D8E83F2003466E6 /* loadgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loadgl.h; sourceTree = "<group>"; };
EBB9E54B0D8E8429003466E6 /* decoders.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = decoders.h; sourceTree = "<group>"; };
@ -689,7 +690,6 @@
EBB9E54D0D8E8429003466E6 /* mvelib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mvelib.h; sourceTree = "<group>"; };
EBB9E5620D8E8690003466E6 /* alsadigi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = alsadigi.c; sourceTree = "<group>"; };
EBB9E5630D8E8691003466E6 /* hmiplay.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hmiplay.c; sourceTree = "<group>"; };
EBB9E5640D8E8691003466E6 /* hmistub.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hmistub.c; sourceTree = "<group>"; };
EBB9E5670D8E8691003466E6 /* music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = music.h; sourceTree = "<group>"; };
EBB9E5680D8E8691003466E6 /* ukali.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ukali.h; sourceTree = "<group>"; };
EBB9E56C0D8E8691003466E6 /* ukali.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ukali.c; sourceTree = "<group>"; };
@ -923,13 +923,6 @@
name = Frameworks;
sourceTree = "<group>";
};
67603357066B3AE0008A67A3 /* include */ = {
isa = PBXGroup;
children = (
);
path = include;
sourceTree = "<group>";
};
676AC04B0668A814007173EB /* ogl */ = {
isa = PBXGroup;
children = (
@ -1005,14 +998,13 @@
67B44193066879B000DF26D8 /* linux */ = {
isa = PBXGroup;
children = (
EB092A8412A25EB1004D9A79 /* messagebox.c */,
EBB9E5620D8E8690003466E6 /* alsadigi.c */,
EBB9E5630D8E8691003466E6 /* hmiplay.c */,
EBB9E5640D8E8691003466E6 /* hmistub.c */,
EBB9E5650D8E8691003466E6 /* include */,
EBF6589B0F936BA200CB5C73 /* ipx.c */,
EBF6589C0F936BA200CB5C73 /* ipx_kali.c */,
EBB9E56C0D8E8691003466E6 /* ukali.c */,
67603357066B3AE0008A67A3 /* include */,
);
name = linux;
path = arch/linux;
@ -1324,13 +1316,26 @@
path = include;
sourceTree = SOURCE_ROOT;
};
EB092A8612A25EE4004D9A79 /* include */ = {
isa = PBXGroup;
children = (
EB092A8712A25EE4004D9A79 /* d3dhelp.h */,
EB092A8812A25EE4004D9A79 /* debug.h */,
EB092A8912A25EE4004D9A79 /* pch.h */,
EB092A8A12A25EE4004D9A79 /* resource.h */,
EB092A8B12A25EE4004D9A79 /* scene.h */,
EB092A8C12A25EE4004D9A79 /* texture.h */,
EB092A8D12A25EE4004D9A79 /* wsipx.h */,
);
path = include;
sourceTree = "<group>";
};
EBAFC268088E508D006329AD /* carbon */ = {
isa = PBXGroup;
children = (
EB092A7F12A25AFB004D9A79 /* messagebox.c */,
EBAFC269088E508D006329AD /* conf.h */,
EBAFC26A088E508D006329AD /* descent.r */,
EBAFC26B088E508D006329AD /* findfile.c */,
EBAFC26C088E508D006329AD /* gui.c */,
EBAFC26D088E508D006329AD /* SDL_main.c */,
);
name = carbon;
@ -1340,29 +1345,14 @@
EBB9E53A0D8E8378003466E6 /* win32 */ = {
isa = PBXGroup;
children = (
EBB9E53B0D8E8378003466E6 /* hmpfile.c */,
EBB9E53C0D8E8378003466E6 /* include */,
EB092A8612A25EE4004D9A79 /* include */,
EB092A8512A25EC8004D9A79 /* messagebox.c */,
EBF6589D0F936BD800CB5C73 /* ipx.c */,
);
name = win32;
path = arch/win32;
sourceTree = "<group>";
};
EBB9E53C0D8E8378003466E6 /* include */ = {
isa = PBXGroup;
children = (
EBB9E53D0D8E8378003466E6 /* d3dhelp.h */,
EBB9E53E0D8E8378003466E6 /* debug.h */,
EBB9E53F0D8E8378003466E6 /* hmpfile.h */,
EBB9E5400D8E8378003466E6 /* pch.h */,
EBB9E5410D8E8378003466E6 /* resource.h */,
EBB9E5420D8E8378003466E6 /* scene.h */,
EBB9E5430D8E8378003466E6 /* texture.h */,
EBB9E5450D8E8378003466E6 /* wsipx.h */,
);
path = include;
sourceTree = "<group>";
};
EBB9E5650D8E8691003466E6 /* include */ = {
isa = PBXGroup;
children = (
@ -1838,6 +1828,7 @@
17DFA6B910C1A2D100674D11 /* net_udp.c in Sources */,
179E6ECE11F37C0500175C54 /* hmp.c in Sources */,
EB1405EA121044B5002B1CC6 /* physfsx.c in Sources */,
EB092A8112A25AFB004D9A79 /* messagebox.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1980,6 +1971,7 @@
EB2EEB5810C50CE2005256F2 /* net_udp.c in Sources */,
179E6ECF11F37C0500175C54 /* hmp.c in Sources */,
EB1405E9121044B5002B1CC6 /* physfsx.c in Sources */,
EB092A8012A25AFB004D9A79 /* messagebox.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -1350,7 +1350,7 @@ void editor(void)
// _MARK_("end of editor");//Nuked to compile -KRB
clear_warn_func(med_show_warning);
set_warn_func(msgbox_warning);
//kill our camera object

View file

@ -193,11 +193,6 @@ void reset_palette_add()
}
void game_show_warning(char *s)
{
nm_messagebox( TXT_WARNING, 1, TXT_OK, s );
}
u_int32_t Game_screen_mode = SM(640,480);
//initialize the various canvases on the game screen
@ -1128,7 +1123,6 @@ window *game_setup(void)
return NULL;
reset_palette_add();
set_warn_func(game_show_warning);
init_cockpit();
init_gauges();
@ -1238,7 +1232,6 @@ int game_handler(window *wind, d_event *event, void *data)
songs_play_song( SONG_TITLE, 1 );
clear_warn_func(game_show_warning); //don't use this func anymore
game_disable_cheats();
Game_mode = GM_GAME_OVER;
show_menus();
@ -1274,7 +1267,6 @@ void close_game()
close_gauges();
restore_effect_bitmap_icons();
clear_warn_func(game_show_warning); //don't use this func anymore
}

View file

@ -87,6 +87,7 @@ char copyright[] = "DESCENT II COPYRIGHT (C) 1994-1996 PARALLAX SOFTWARE CORPOR
#include "../texmap/scanline.h" //for select_tmap -MM
#include "event.h"
#include "rbaudio.h"
#include "messagebox.h"
#ifdef EDITOR
#include "editor/editor.h"
@ -323,7 +324,8 @@ char Auto_file[128] = "";
int main(int argc, char *argv[])
{
mem_init();
error_init(NULL, NULL);
error_init(msgbox_error, NULL);
set_warn_func(msgbox_warning);
PHYSFSX_init(argc, argv);
con_init(); // Initialise the console
@ -343,7 +345,7 @@ int main(int argc, char *argv[])
printf("\nType %s -help' for a list of command-line options.\n\n", PROGNAME);
PHYSFSX_listSearchPathContent();
if (!PHYSFSX_checkSupportedArchiveTypes())
return(0);
@ -383,10 +385,7 @@ int main(int argc, char *argv[])
con_printf(CON_NORMAL, " Copyright (c) 2005 Christian Beckhaeuser\n\n");
if (GameArg.DbgVerbose)
{
con_printf(CON_VERBOSE,"%s", TXT_VERBOSE_1);
con_printf(CON_VERBOSE,"%s", "\n");
}
con_printf(CON_VERBOSE,"%s%s", TXT_VERBOSE_1, "\n");
ReadConfigFile();
@ -430,8 +429,6 @@ int main(int argc, char *argv[])
if (GameArg.DbgNoRun)
return(0);
error_init(error_messagebox, NULL);
con_printf( CON_DEBUG, "\nInitializing texture caching system..." );
texmerge_init( 10 ); // 10 cache bitmaps
@ -499,7 +496,6 @@ int main(int argc, char *argv[])
show_order_form();
con_printf( CON_DEBUG, "\nCleanup...\n" );
error_init(NULL, NULL); // clear error func (won't have newmenu stuff loaded)
close_game();
texmerge_close();
gamedata_close();