From a62060bacfee18eaadd2908b4f3f59680c41d902 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Tue, 8 Apr 2008 12:51:21 +0000 Subject: [PATCH] show a messagebox if there's an error and graphics are initialised, update Xcode project --- CHANGELOG.txt | 4 ++++ d2x-rebirth.xcodeproj/project.pbxproj | 24 ------------------------ include/cfile.h | 10 +++++----- main/inferno.c | 8 ++++++++ main/newmenu.c | 2 ++ misc/error.c | 20 +++----------------- ui/gadget.c | 3 ++- ui/window.c | 4 ++-- 8 files changed, 26 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ca6d86619..51198c165 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20080408 +-------- +d2x-rebirth.xcodeproj, include/cfile.h, main/inferno.c, main/newmenu.c, misc/error.c, ui/gadget.c, ui/window.c: show a messagebox if there's an error and graphics are initialised, update Xcode project + 20080406 -------- d2x.ini, SConstruct, main/config.c, main/config.h, main/console.c, main/console.h + various: Implemented Console-style game logging system to print graphics, to stdout and gamelog.txt; Added structure to keep values for descent.cfg; Added aspect and Texture Filtering to descent.cfg; Removed mono code - printing important stuff over console; Removed some obsolete or very common defines; Code cleanup and small fixes diff --git a/d2x-rebirth.xcodeproj/project.pbxproj b/d2x-rebirth.xcodeproj/project.pbxproj index f90ee8882..e59602eeb 100755 --- a/d2x-rebirth.xcodeproj/project.pbxproj +++ b/d2x-rebirth.xcodeproj/project.pbxproj @@ -38,7 +38,6 @@ 676AC1C60668A938007173EB /* pstypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 676C5D030668840200D9FA2D /* pstypes.h */; }; 676AC1C70668A938007173EB /* byteswap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CE4F0668852C00056A5A /* byteswap.h */; }; 676AC1C80668A938007173EB /* rle.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CE500668852C00056A5A /* rle.h */; }; - 676AC1C90668A938007173EB /* mono.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CE650668854700056A5A /* mono.h */; }; 676AC1CA0668A938007173EB /* u_dpmi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF090668878F00056A5A /* u_dpmi.h */; }; 676AC1CB0668A938007173EB /* cfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF20066887CE00056A5A /* cfile.h */; }; 676AC1CC0668A938007173EB /* makesig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF2D066887E500056A5A /* makesig.h */; }; @@ -61,7 +60,6 @@ 676AC1DE0668A938007173EB /* maths.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D08F06688A9C00056A5A /* maths.h */; }; 676AC1E00668A938007173EB /* strutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D0A306688AB900056A5A /* strutil.h */; }; 676AC1E10668A938007173EB /* iff.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D0BD06688AE800056A5A /* iff.h */; }; - 676AC1E20668A938007173EB /* cmd.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D0ED06688B6200056A5A /* cmd.h */; }; 676AC1E40668A938007173EB /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D12906688EB500056A5A /* hash.h */; }; 676AC1E50668A938007173EB /* strio.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D1550668903B00056A5A /* strio.h */; }; 676AC1E60668A938007173EB /* pa_enabl.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D1D30668950400056A5A /* pa_enabl.h */; }; @@ -109,7 +107,6 @@ 676AC2180668A938007173EB /* aipath.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D206687CF400DF26D8 /* aipath.c */; }; 676AC2190668A938007173EB /* automap.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D406687CF400DF26D8 /* automap.c */; }; 676AC21A0668A938007173EB /* bm.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D606687CF400DF26D8 /* bm.c */; }; - 676AC21B0668A938007173EB /* cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DA06687CF400DF26D8 /* cmd.c */; }; 676AC21C0668A938007173EB /* cntrlcen.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DB06687CF400DF26D8 /* cntrlcen.c */; }; 676AC21D0668A938007173EB /* collide.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DD06687CF400DF26D8 /* collide.c */; }; 676AC21E0668A938007173EB /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446E006687CF400DF26D8 /* config.c */; }; @@ -196,7 +193,6 @@ 676AC2780668A939007173EB /* args.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D00B066889CD00056A5A /* args.h */; }; 676AC2790668A939007173EB /* byteswap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CE4F0668852C00056A5A /* byteswap.h */; }; 676AC27A0668A939007173EB /* cfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF20066887CE00056A5A /* cfile.h */; }; - 676AC27B0668A939007173EB /* cmd.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D0ED06688B6200056A5A /* cmd.h */; }; 676AC27C0668A939007173EB /* console.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D00C066889CD00056A5A /* console.h */; }; 676AC27E0668A939007173EB /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = 67B44913066880C400DF26D8 /* error.h */; }; 676AC2800668A939007173EB /* fix.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF420668881F00056A5A /* fix.h */; }; @@ -209,7 +205,6 @@ 676AC2870668A939007173EB /* libmve.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D0D106688B1100056A5A /* libmve.h */; }; 676AC2880668A939007173EB /* makesig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF2D066887E500056A5A /* makesig.h */; }; 676AC2890668A939007173EB /* maths.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D08F06688A9C00056A5A /* maths.h */; }; - 676AC28A0668A939007173EB /* mono.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CE650668854700056A5A /* mono.h */; }; 676AC28B0668A939007173EB /* pa_enabl.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791D1D30668950400056A5A /* pa_enabl.h */; }; 676AC28C0668A939007173EB /* pcx.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF620668885500056A5A /* pcx.h */; }; 676AC28D0668A939007173EB /* palette.h in Headers */ = {isa = PBXBuildFile; fileRef = 6791CF4E0668883900056A5A /* palette.h */; }; @@ -273,7 +268,6 @@ 676AC2CF0668A939007173EB /* aipath.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D206687CF400DF26D8 /* aipath.c */; }; 676AC2D00668A939007173EB /* automap.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D406687CF400DF26D8 /* automap.c */; }; 676AC2D10668A939007173EB /* bm.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446D606687CF400DF26D8 /* bm.c */; }; - 676AC2D20668A939007173EB /* cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DA06687CF400DF26D8 /* cmd.c */; }; 676AC2D30668A939007173EB /* cntrlcen.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DB06687CF400DF26D8 /* cntrlcen.c */; }; 676AC2D40668A939007173EB /* collide.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446DD06687CF400DF26D8 /* collide.c */; }; 676AC2D50668A939007173EB /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B446E006687CF400DF26D8 /* config.c */; }; @@ -426,7 +420,6 @@ 676C5D030668840200D9FA2D /* pstypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pstypes.h; sourceTree = ""; }; 6791CE4F0668852C00056A5A /* byteswap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = byteswap.h; sourceTree = ""; }; 6791CE500668852C00056A5A /* rle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rle.h; sourceTree = ""; }; - 6791CE650668854700056A5A /* mono.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mono.h; sourceTree = ""; }; 6791CF090668878F00056A5A /* u_dpmi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = u_dpmi.h; sourceTree = ""; }; 6791CF20066887CE00056A5A /* cfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cfile.h; sourceTree = ""; }; 6791CF2D066887E500056A5A /* makesig.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = makesig.h; sourceTree = ""; }; @@ -450,7 +443,6 @@ 6791D0A306688AB900056A5A /* strutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = strutil.h; sourceTree = ""; }; 6791D0BD06688AE800056A5A /* iff.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = iff.h; sourceTree = ""; }; 6791D0D106688B1100056A5A /* libmve.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = libmve.h; sourceTree = ""; }; - 6791D0ED06688B6200056A5A /* cmd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cmd.h; sourceTree = ""; }; 6791D12906688EB500056A5A /* hash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hash.h; sourceTree = ""; }; 6791D1550668903B00056A5A /* strio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = strio.h; sourceTree = ""; }; 6791D1D30668950400056A5A /* pa_enabl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pa_enabl.h; sourceTree = ""; }; @@ -501,7 +493,6 @@ 67B446D206687CF400DF26D8 /* aipath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = aipath.c; sourceTree = ""; }; 67B446D406687CF400DF26D8 /* automap.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = automap.c; sourceTree = ""; }; 67B446D606687CF400DF26D8 /* bm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = bm.c; sourceTree = ""; }; - 67B446DA06687CF400DF26D8 /* cmd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cmd.c; sourceTree = ""; }; 67B446DB06687CF400DF26D8 /* cntrlcen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cntrlcen.c; sourceTree = ""; }; 67B446DD06687CF400DF26D8 /* collide.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = collide.c; sourceTree = ""; }; 67B446E006687CF400DF26D8 /* config.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = config.c; sourceTree = ""; }; @@ -692,9 +683,7 @@ EBB9E5410D8E8378003466E6 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; EBB9E5420D8E8378003466E6 /* scene.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = ""; }; EBB9E5430D8E8378003466E6 /* texture.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = texture.h; sourceTree = ""; }; - EBB9E5440D8E8378003466E6 /* winmain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = winmain.h; sourceTree = ""; }; EBB9E5450D8E8378003466E6 /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = ""; }; - EBB9E5460D8E8378003466E6 /* mono.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mono.c; sourceTree = ""; }; EBB9E5470D8E8378003466E6 /* netdrv_ipx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_ipx.c; sourceTree = ""; }; EBB9E5480D8E83F2003466E6 /* internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; EBB9E5490D8E83F2003466E6 /* loadgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loadgl.h; sourceTree = ""; }; @@ -712,7 +701,6 @@ EBB9E5640D8E8691003466E6 /* hmistub.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hmistub.c; sourceTree = ""; }; EBB9E5670D8E8691003466E6 /* music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = music.h; sourceTree = ""; }; EBB9E5680D8E8691003466E6 /* ukali.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ukali.h; sourceTree = ""; }; - EBB9E5690D8E8691003466E6 /* mono.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mono.c; sourceTree = ""; }; EBB9E56A0D8E8691003466E6 /* netdrv_ipx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_ipx.c; sourceTree = ""; }; EBB9E56B0D8E8691003466E6 /* netdrv_kali.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_kali.c; sourceTree = ""; }; EBB9E56C0D8E8691003466E6 /* ukali.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ukali.c; sourceTree = ""; }; @@ -1020,7 +1008,6 @@ EBB9E5630D8E8691003466E6 /* hmiplay.c */, EBB9E5640D8E8691003466E6 /* hmistub.c */, EBB9E5650D8E8691003466E6 /* include */, - EBB9E5690D8E8691003466E6 /* mono.c */, EBB9E56A0D8E8691003466E6 /* netdrv_ipx.c */, EBB9E56B0D8E8691003466E6 /* netdrv_kali.c */, EBB9E56C0D8E8691003466E6 /* ukali.c */, @@ -1097,7 +1084,6 @@ 67B446D406687CF400DF26D8 /* automap.c */, 67B446D606687CF400DF26D8 /* bm.c */, EBC652010890D632004FCAA3 /* bmread.c */, - 67B446DA06687CF400DF26D8 /* cmd.c */, 67B446DB06687CF400DF26D8 /* cntrlcen.c */, 67B446DD06687CF400DF26D8 /* collide.c */, 67B446E006687CF400DF26D8 /* config.c */, @@ -1298,7 +1284,6 @@ 6791CE4F0668852C00056A5A /* byteswap.h */, 6791CF20066887CE00056A5A /* cfile.h */, EBB9E5830D8E89C3003466E6 /* checker.h */, - 6791D0ED06688B6200056A5A /* cmd.h */, 6791D00C066889CD00056A5A /* console.h */, EB92BE680CDD69830045A32C /* dl_list.h */, 67B44913066880C400DF26D8 /* error.h */, @@ -1317,7 +1302,6 @@ EBB9E5490D8E83F2003466E6 /* loadgl.h */, 6791CF2D066887E500056A5A /* makesig.h */, 6791D08F06688A9C00056A5A /* maths.h */, - 6791CE650668854700056A5A /* mono.h */, EBB9E54A0D8E83F2003466E6 /* netdrv.h */, EBC6525B0890F79B004FCAA3 /* nocfile.h */, 676AC0E10668A86F007173EB /* ogl_init.h */, @@ -1359,7 +1343,6 @@ children = ( EBB9E53B0D8E8378003466E6 /* hmpfile.c */, EBB9E53C0D8E8378003466E6 /* include */, - EBB9E5460D8E8378003466E6 /* mono.c */, EBB9E5470D8E8378003466E6 /* netdrv_ipx.c */, ); name = win32; @@ -1376,7 +1359,6 @@ EBB9E5410D8E8378003466E6 /* resource.h */, EBB9E5420D8E8378003466E6 /* scene.h */, EBB9E5430D8E8378003466E6 /* texture.h */, - EBB9E5440D8E8378003466E6 /* winmain.h */, EBB9E5450D8E8378003466E6 /* wsipx.h */, ); path = include; @@ -1509,7 +1491,6 @@ 676AC1C60668A938007173EB /* pstypes.h in Headers */, 676AC1C70668A938007173EB /* byteswap.h in Headers */, 676AC1C80668A938007173EB /* rle.h in Headers */, - 676AC1C90668A938007173EB /* mono.h in Headers */, 676AC1CA0668A938007173EB /* u_dpmi.h in Headers */, 676AC1CB0668A938007173EB /* cfile.h in Headers */, 676AC1CC0668A938007173EB /* makesig.h in Headers */, @@ -1532,7 +1513,6 @@ 676AC1DE0668A938007173EB /* maths.h in Headers */, 676AC1E00668A938007173EB /* strutil.h in Headers */, 676AC1E10668A938007173EB /* iff.h in Headers */, - 676AC1E20668A938007173EB /* cmd.h in Headers */, 676AC1E40668A938007173EB /* hash.h in Headers */, 676AC1E50668A938007173EB /* strio.h in Headers */, 676AC1E60668A938007173EB /* pa_enabl.h in Headers */, @@ -1564,7 +1544,6 @@ 676AC2780668A939007173EB /* args.h in Headers */, 676AC2790668A939007173EB /* byteswap.h in Headers */, 676AC27A0668A939007173EB /* cfile.h in Headers */, - 676AC27B0668A939007173EB /* cmd.h in Headers */, 676AC27C0668A939007173EB /* console.h in Headers */, 676AC27E0668A939007173EB /* error.h in Headers */, 676AC2800668A939007173EB /* fix.h in Headers */, @@ -1577,7 +1556,6 @@ 676AC2870668A939007173EB /* libmve.h in Headers */, 676AC2880668A939007173EB /* makesig.h in Headers */, 676AC2890668A939007173EB /* maths.h in Headers */, - 676AC28A0668A939007173EB /* mono.h in Headers */, 676AC28B0668A939007173EB /* pa_enabl.h in Headers */, 676AC28C0668A939007173EB /* pcx.h in Headers */, 676AC28D0668A939007173EB /* palette.h in Headers */, @@ -1776,7 +1754,6 @@ 676AC2180668A938007173EB /* aipath.c in Sources */, 676AC2190668A938007173EB /* automap.c in Sources */, 676AC21A0668A938007173EB /* bm.c in Sources */, - 676AC21B0668A938007173EB /* cmd.c in Sources */, 676AC21C0668A938007173EB /* cntrlcen.c in Sources */, 676AC21D0668A938007173EB /* collide.c in Sources */, 676AC21E0668A938007173EB /* config.c in Sources */, @@ -1922,7 +1899,6 @@ 676AC2CF0668A939007173EB /* aipath.c in Sources */, 676AC2D00668A939007173EB /* automap.c in Sources */, 676AC2D10668A939007173EB /* bm.c in Sources */, - 676AC2D20668A939007173EB /* cmd.c in Sources */, 676AC2D30668A939007173EB /* cntrlcen.c in Sources */, 676AC2D40668A939007173EB /* collide.c in Sources */, 676AC2D50668A939007173EB /* config.c in Sources */, diff --git a/include/cfile.h b/include/cfile.h index 17ddd30d3..8440151cc 100644 --- a/include/cfile.h +++ b/include/cfile.h @@ -207,7 +207,7 @@ static inline int cfile_read_int(PHYSFS_file *file) if (!PHYSFS_readSLE32(file, &i)) { - con_printf(CON_CRITICAL,"Error reading int in cfile_read_int()"); + Error("Error reading int in cfile_read_int()"); exit(1); } @@ -220,7 +220,7 @@ static inline short cfile_read_short(PHYSFS_file *file) if (!PHYSFS_readSLE16(file, &s)) { - con_printf(CON_CRITICAL,"Error reading short in cfile_read_short()"); + Error("Error reading short in cfile_read_short()"); exit(1); } @@ -233,7 +233,7 @@ static inline sbyte cfile_read_byte(PHYSFS_file *file) if (PHYSFS_read(file, &b, sizeof(b), 1) != 1) { - con_printf(CON_CRITICAL,"Error reading byte in cfile_read_byte()"); + Error("Error reading byte in cfile_read_byte()"); exit(1); } @@ -246,7 +246,7 @@ static inline fix cfile_read_fix(PHYSFS_file *file) if (!PHYSFS_readSLE32(file, &f)) { - con_printf(CON_CRITICAL,"Error reading fix in cfile_read_fix()"); + Error("Error reading fix in cfile_read_fix()"); exit(1); } @@ -259,7 +259,7 @@ static inline fixang cfile_read_fixang(PHYSFS_file *file) if (!PHYSFS_readSLE16(file, &f)) { - con_printf(CON_CRITICAL,"Error reading fixang in cfile_read_fixang()"); + Error("Error reading fixang in cfile_read_fixang()"); exit(1); } diff --git a/main/inferno.c b/main/inferno.c index 84b912a76..2526ae210 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -241,6 +241,11 @@ void print_commandline_help() printf( "\n\n"); } +void error_messagebox(char *s) +{ + nm_messagebox( TXT_SORRY, 1, TXT_OK, s ); +} + void sdl_close() { SDL_Quit(); @@ -410,6 +415,8 @@ int main(int argc, char *argv[]) if (GameArg.DbgNoRun) return(0); + error_init(error_messagebox, NULL); + con_printf( CON_DEBUG, "\nInitializing 3d system..." ); g3_init(); @@ -519,6 +526,7 @@ int main(int argc, char *argv[]) show_order_form(); + error_init(NULL, NULL); // clear error func (won't have newmenu stuff loaded) piggy_close(); return(0); //presumably successful exit diff --git a/main/newmenu.c b/main/newmenu.c index cef9fbb29..af38b83e7 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -191,6 +191,8 @@ void nm_draw_background(int x1, int y1, int x2, int y2 ) if ( x1 < 0 ) x1 = 0; if ( y1 < 0 ) y1 = 0; + if ( x2 > SWIDTH - 1) x2 = SWIDTH - 1; + if ( y2 > SHEIGHT - 1) y2 = SHEIGHT - 1; w = x2-x1; h = y2-y1; diff --git a/misc/error.c b/misc/error.c index 72efcf516..5897ee537 100644 --- a/misc/error.c +++ b/misc/error.c @@ -87,17 +87,7 @@ void print_exit_message(void) { (*ErrorPrintFunc)(exit_message); } - else - { -#if (defined(MACINTOSH) && defined(NDEBUG) && defined(RELEASE)) - c2pstr(exit_message); - ShowCursor(); - ParamText(exit_message, "\p", "\p", "\p"); - StopAlert(ERROR_ALERT, nil); -#else - con_printf(CON_CRITICAL, "%s\n",exit_message); -#endif - } + con_printf(CON_CRITICAL, "\n%s\n",exit_message); } } @@ -106,11 +96,7 @@ void Error(char *fmt,...) { va_list arglist; -#if (defined(MACINTOSH) && defined(NDEBUG) && defined(RELEASE)) strcpy(exit_message,"Error: "); // don't put the new line in for dialog output -#else - strcpy(exit_message,"\nError: "); -#endif va_start(arglist,fmt); vsprintf(exit_message+strlen(exit_message),fmt,arglist); con_printf(CON_CRITICAL,"%s",exit_message); @@ -118,7 +104,7 @@ void Error(char *fmt,...) Int3(); - if (!err_initialized) print_exit_message(); + /*if (!err_initialized)*/ print_exit_message(); exit(1); } @@ -148,7 +134,7 @@ int error_init(void (*func)(char *), char *fmt, ...) va_list arglist; int len; - atexit(print_exit_message); //last thing at exit is print message + //atexit(print_exit_message); //last thing at exit is print message CHRIS: Removed to allow newmenu dialog ErrorPrintFunc = func; // Set Error Print Functions diff --git a/ui/gadget.c b/ui/gadget.c index ff49bacf6..3aa94c7e8 100644 --- a/ui/gadget.c +++ b/ui/gadget.c @@ -28,6 +28,7 @@ static char rcsid[] = "$Id: gadget.c,v 1.1.1.1 2006/03/17 19:52:21 zicodxx Exp $ #include "pstypes.h" #include "gr.h" #include "ui.h" +#include "error.h" #include "key.h" @@ -38,7 +39,7 @@ UI_GADGET * ui_gadget_add( UI_WINDOW * wnd, short kind, short x1, short y1, shor UI_GADGET * gadget; gadget = (UI_GADGET *) d_malloc(sizeof(UI_GADGET)); - if (gadget==NULL) exit(1); + if (gadget==NULL) Error("Could not create gadget: Out of memory"); if (wnd->gadget == NULL ) { diff --git a/ui/window.c b/ui/window.c index 5e55a2adf..a57ba55dc 100644 --- a/ui/window.c +++ b/ui/window.c @@ -28,7 +28,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "key.h" #include "timer.h" #include "mouse.h" - +#include "error.h" #define W_BACKGROUND (wnd->background ) #define W_X (wnd->x) @@ -201,7 +201,7 @@ UI_WINDOW * ui_open_window( short x, short y, short w, short h, int flags ) int sw, sh, req_w, req_h; wnd = (UI_WINDOW *) d_malloc(sizeof(UI_WINDOW)); - if (wnd==NULL) exit(1); + if (wnd==NULL) Error("Could not create window: Out of memory"); W_NEXT = NULL; W_PREV = NULL;