ref: b9b0c2abfbe194baf6d497f1c4a2165769f64ab3
parent: 0ec9859ec8cf39ce1223516161fb39ea44ed5c33
parent: acd1a13a4f70973d7616df3f6de43f8f79b8e392
author: Simon Howard <[email protected]>
date: Sat Dec 20 15:25:22 EST 2008
Merge from trunk. Subversion-branch: /branches/raven-branch Subversion-revision: 1423
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,276 @@
+2008-12-10 20:20:10 fraggle
+
+ Fix crash when playing Doom 1 levels.
+
+2008-12-10 01:06:08 fraggle
+
+ Bump version to 1.2.0, update NEWS and ChangeLog.
+
+2008-12-10 01:01:19 fraggle
+
+ Undo previous change.
+
+2008-12-10 00:42:49 fraggle
+
+ Set icon before calling TXT_Init, for setup and ENDOOM screens.
+
+2008-12-10 00:00:55 fraggle
+
+ Fix window icon/title under Windows XP Luna theme.
+
+2008-12-09 23:32:19 fraggle
+
+ Make intermission screen work on MAP33, to be consistent with Vanilla
+ Doom. Also, make levels after MAP33 trigger a V_DrawPatch error.
+
+2008-12-09 20:35:17 fraggle
+
+ Add check for sched_setaffinity to configure and only use it if it is
+ found. Display a message if we don't have any way to set processor
+ affinity.
+
+2008-12-09 19:56:43 fraggle
+
+ Add SDL_CFLAGS, SDL_LDFLAGS to default compile flags, and check for
+ SDL in configure before checking for libraries and headers, to fix
+ Windows.
+
+2008-12-03 22:09:22 fraggle
+
+ Use FILE_MAP_COPY instead of FILE_MAP_ALL_ACCESS for mapping files
+ (thanks to Christian Chech).
+
+2008-12-01 21:08:23 fraggle
+
+ Don't try to read SDL events until initialised.
+
+2008-10-01 21:22:09 fraggle
+
+ Add .lvimrc local vim project settings.
+
+2008-09-21 19:20:32 fraggle
+
+ Don't play DEMO4 if gameversion is emulating chex.exe - it only plays
+ demos 1-3.
+
+2008-09-20 19:18:06 fraggle
+
+ Set processor affinity under non-Windows platforms using the POSIX
+ API.
+
+2008-09-16 01:17:20 rtc_marine
+
+ - Force use of dwarf-2 debugging information - Fix an age-old problem
+ of not being able to find -lpcsound, the debug target was looking for
+ it rather than -lpcsound-dbg
+
+2008-09-14 19:14:46 fraggle
+
+ Add -nocheat command line parameter to disable applying cheats from
+ dehacked files.
+
+2008-09-07 18:47:08 fraggle
+
+ Strip out NUL characters from dehacked files; this makes the dehacked
+ patch with portal.wad load properly.
+
+2008-08-29 00:31:53 fraggle
+
+ Update TODO.
+
+2008-08-24 03:06:26 fraggle
+
+ Update INSTALL to include some notes about Chex Quest.
+
+2008-08-24 02:58:57 fraggle
+
+ Update missing chex.deh to reference its location in the idgames
+ repository.
+
+2008-08-20 19:27:56 fraggle
+
+ Use / as a path separator, to allow cross-compiling of resource files
+ (thanks Anonymous bug reporter)
+
+2008-08-19 20:51:41 fraggle
+
+ Fix crash related to A_BFGSpray with NULL target when using dehacked
+ patches - discovered with insaned2.deh (thanks CSonicGo)
+
+2008-08-09 18:09:23 fraggle
+
+ Don't modify level lumps when loading levels.
+
+2008-08-08 23:38:25 fraggle
+
+ Use FILE_MAP_ALL_ACCESS rather than FILE_MAP_READ when mmapping files
+ under Windows (thanks entryway)
+
+2008-08-02 14:29:37 fraggle
+
+ Search for chex.deh in WAD path.
+
+2008-07-31 23:01:38 fraggle
+
+ Update netcode to allow chex quest gameversion.
+
+2008-07-31 22:29:20 fraggle
+
+ Update Chocolate Setup to support chex.wad.
+
+2008-07-31 21:21:58 fraggle
+
+ Fix crash on Chex Quest intermission screen (thanks entryway)
+
+2008-07-31 21:06:42 fraggle
+
+ Automatically load chex.deh on startup if playing in chex mode.
+
+2008-07-31 20:43:45 fraggle
+
+ Fix mistake in exit confirmation string that was breaking dehacked
+ patches that replace it.
+
+2008-07-31 12:55:35 rtc_marine
+
+ Update codeblocks project to locate setup manifest
+
+2008-07-29 19:06:04 fraggle
+
+ Don't do the Final Doom teleport quirk with Chex Quest, as chex.exe
+ doesn't do it.
+
+2008-07-29 19:05:16 fraggle
+
+ Monsters don't drop ammo in Chex Quest.
+
+2008-07-29 01:50:56 fraggle
+
+ Add magic dehacked comment to enable long cheat sequences (also for
+ Chex Quest support)
+
+2008-07-27 00:51:25 fraggle
+
+ In chex mode, always warp to an episode 1 level, and display the level
+ title in the automap for the equivalent episode 1 level.
+
+2008-07-26 16:45:52 fraggle
+
+ Allow magic comments in dehacked files that disable the DOS dehacked
+ text replacement limit, so that we can use a dehacked patch to emulate
+ chex.exe.
+
+2008-07-26 16:29:08 fraggle
+
+ Chex Quest's chex.exe is based on the Final Doom exe, not the Ultimate
+ Doom exe.
+
+2008-07-26 16:23:06 fraggle
+
+ Fix "dimensional shambler waiting at the dos prompt" quit message to
+ match the one in doom2.exe precisely.
+
+2008-07-25 20:56:39 fraggle
+
+ Initial chex.exe emulation.
+
+2008-07-10 00:22:34 fraggle
+
+ Fix dehacked replacements for the "press y to quit to dos" string.
+
+2008-07-07 10:10:26 fraggle
+
+ Fix quit screen confirm message to say "quit to dos" rather than just
+ "quit" (thanks MikeRS)
+
+2008-06-14 18:42:06 fraggle
+
+ Add a helpful message for people trying to play with the wrong IWAD.
+
+2008-06-11 01:14:07 fraggle
+
+ Only apply dehacked green armor class to the green armor shirt, not
+ the armor helmets as well.
+
+2008-06-09 19:11:24 fraggle
+
+ Always set armor class to 2 when picking up a megasphere (thanks
+ entryway).
+
+2008-05-05 04:52:08 GhostlyDeath
+
+ Updated Code::Blocks project for new files
+
+2008-05-05 04:48:45 fraggle
+
+ Add setup-manifest.xml to dist.
+
+2008-05-05 04:44:28 GhostlyDeath
+
+ Updated VC++ Project for added files; Manifest should have version
+ 1.1.1.0 not 1.0.0.0; the rc files in the codeblocks folder have been
+ updated
+
+2008-05-05 04:11:29 fraggle
+
+ (Hopefully) fix for Windows Vista asking for security elevation when
+ running chocolate-setup.
+
+2008-05-04 22:43:38 fraggle
+
+ Remove Vanilla Doom reload hack.
+
+2008-05-04 18:09:51 fraggle
+
+ Add command line option to disable mmapped WAD I/O.
+
+2008-05-04 17:45:10 fraggle
+
+ Fix win32 mmap driver and add to build.
+
+2008-05-02 23:52:00 fraggle
+
+ Add Windows memory mapping backend.
+
+2008-05-02 20:19:38 fraggle
+
+ Memory-mapped WAD access.
+
+2008-05-02 20:18:52 fraggle
+
+ Fix up some more code calling Z_Free instead of W_ReleaseLumpNum.
+
+2008-05-02 19:48:43 fraggle
+
+ Add W_CacheLumpNum,Name API to WAD code for releasing a lump back to
+ cache when it is no longer needed. Switch existing code to use the
+ new API instead of Z_ChangeTag.
+
+2008-05-02 18:32:09 fraggle
+
+ Add WAD I/O abstraction layer - first step for mmapped WAD access.
+
+2008-04-26 17:31:47 fraggle
+
+ "Python Image Library" -> "Python Imaging Library" (thanks exp(x)).
+
+2008-04-26 15:33:14 fraggle
+
+ Add new Chocolate Doom icon.
+
+2008-04-26 00:33:00 fraggle
+
+ Generate transparency mask for the application icon from black parts
+ of the image.
+
+2008-04-23 08:44:17 GhostlyDeath
+
+ VC++ Project now builds
+
+2008-04-20 02:00:11 fraggle
+
+ Bump version to 1.1.1, update ChangeLog and NEWS.
+
2008-04-19 17:41:58 fraggle
Fix build problem when libsamplerate support is enabled.
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,45 @@
+1.2.1 (2008-12-10):
+
+ This version just fixes a crash at the intermission screen when
+ playing Doom 1 levels.
+
+1.2.0 (2008-12-10):
+
+ Happy 15th Birthday, Doom!
+
+ * Chocolate Doom now has an icon that is not based on the proprietary
+ Doom artwork.
+ * There is now memory-mapped WAD I/O support, which should be useful
+ on some embedded systems.
+ * Chex quest emulation support is now included, although an
+ auxiliary dehacked patch is needed (chexdeh.zip in the idgames
+ archive).
+
+ Compatibility:
+ * The armor class is always set to 2 when picking up a megasphere
+ (thanks entryway).
+ * The quit screen prompts to quit "to dos" instead of just to quit
+ (thanks MikeRS)
+ * The "dimensional shambler" quit message was fixed.
+ * Fix crash related to A_BFGSpray with NULL target when using
+ dehacked patches - discovered with insaned2.deh
+ (thanks CSonicGo)
+ * NUL characters are stripped from dehacked files, to ensure correct
+ behavior with some dehacked patches (eg. the one with portal.wad).
+
+ Bugs fixed:
+ * "Python Image Library" should have been "Python Imaging Library"
+ (thanks exp(x)).
+ * The setup tool should no longer ask for elevated permissions
+ on Windows Vista (this fix possibly may not work).
+ * The application icon is set properly when running under Windows
+ XP with the "Luna" theme.
+ * Fix compilation under Cygwin to detect libraries and headers from
+ the correct environment.
+ * The video code does not try to read SDL events before SDL has
+ been properly initialised - this was causing problems with some
+ older versions of SDL.
+
1.1.1 (2008-04-20):
The previous release (v1.1.0) included a bug that broke compilation
--- a/codeblocks/config.h
+++ b/codeblocks/config.h
@@ -9,19 +9,19 @@
#define PACKAGE_NAME "Chocolate Doom"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Chocolate Doom 1.1.1"
+#define PACKAGE_STRING "Chocolate Doom 1.2.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "chocolate-doom"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.1.1"
+#define PACKAGE_VERSION "1.2.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "1.1.1"
+#define VERSION "1.2.1"
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
--- a/codeblocks/game-res.rc
+++ b/codeblocks/game-res.rc
@@ -1,8 +1,8 @@
1 ICON "../data/doom.ico"
1 VERSIONINFO
-PRODUCTVERSION 1,1,1,0
-FILEVERSION 1,1,1,0
+PRODUCTVERSION 1,2,1,0
+FILEVERSION 1,2,1,0
FILETYPE 1
{
BLOCK "StringFileInfo"
@@ -9,13 +9,13 @@
{
BLOCK "040904E4"
{
- VALUE "FileVersion", "1.1.1"
- VALUE "FileDescription", "1.1.1"
+ VALUE "FileVersion", "1.2.1"
+ VALUE "FileDescription", "1.2.1"
VALUE "InternalName", "Chocolate-Doom"
VALUE "CompanyName", "Chocolate-Doom"
VALUE "LegalCopyright", "GNU General Public License"
VALUE "ProductName", "Chocolate-Doom"
- VALUE "ProductVersion", "1.1.1"
+ VALUE "ProductVersion", "1.2.1"
}
}
}
--- a/codeblocks/setup-res.rc
+++ b/codeblocks/setup-res.rc
@@ -3,8 +3,8 @@
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "setup-manifest.xml"
1 VERSIONINFO
-PRODUCTVERSION 1,1,1,0
-FILEVERSION 1,1,1,0
+PRODUCTVERSION 1,2,1,0
+FILEVERSION 1,2,1,0
FILETYPE 1
{
BLOCK "StringFileInfo"
@@ -11,13 +11,13 @@
{
BLOCK "040904E4"
{
- VALUE "FileVersion", "1.1.1"
+ VALUE "FileVersion", "1.2.1"
VALUE "FileDescription", "Chocolate-Doom Setup"
VALUE "InternalName", "chocolate-setup"
VALUE "CompanyName", "[email protected]"
VALUE "LegalCopyright", "GNU General Public License"
VALUE "ProductName", "Chocolate-Doom Setup"
- VALUE "ProductVersion", "1.1.1"
+ VALUE "ProductVersion", "1.2.1"
}
}
}
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-AC_INIT(Chocolate Doom, 1.1.1, [email protected], chocolate-doom)
+AC_INIT(Chocolate Doom, 1.2.1, [email protected], chocolate-doom)
AC_CONFIG_AUX_DIR(autotools)
@@ -7,7 +7,6 @@
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
-AC_CHECK_FUNCS(mmap)
OPT_LEVEL=2
@@ -25,17 +24,27 @@
CFLAGS="-O$OPT_LEVEL -g -Wall $orig_CFLAGS"
fi
-AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h])
+dnl Search for SDL ...
AM_PATH_SDL(1.1.3)
+# Add the SDL compiler flags to the default compiler flag variables.
+# It is important to do this now, before checking for headers and
+# library functions. The reason being that on Windows, sdl-config
+# sets the -mno-cygwin compiler option in order to generate MinGW
+# executables. If we don't do this now, we might end up discovering
+# header files that are not actually available to us when we come
+# to compile.
+
+CFLAGS="$CFLAGS $SDL_CFLAGS"
+LDFLAGS="$LDFLAGS $SDL_LIBS"
+
AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[
-dnl AC_DEFINE(HAVE_LIBSDL_MIXER)
SDLMIXER_LIBS="$SDLMIXER_LIBS -lSDL_mixer"
],[
echo "*** Could not find SDL_mixer. Please install it."
exit -1
-],$SDL_LIBS $SDLMIXER_LIBS)
+])
AC_CHECK_LIB(SDL_net,SDLNet_UDP_Send,[
SDLNET_LIBS="$SDLNET_LIBS -lSDL_net"
@@ -42,7 +51,10 @@
],[
echo "*** Could not find SDL_net. Please install it."
exit -1
-] ,$SDL_LIBS $SDLNET_LIBS)
+])
+
+AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h])
+AC_CHECK_FUNCS(mmap sched_setaffinity)
# DWF 2008-02-10: FIXME
AC_CHECK_LIB(samplerate, src_new)
--- a/msvc/config.h
+++ b/msvc/config.h
@@ -11,16 +11,16 @@
#define PACKAGE_NAME "Chocolate Doom"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Chocolate Doom 1.1.1"
+#define PACKAGE_STRING "Chocolate Doom 1.2.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "chocolate-doom"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.1.1"
+#define PACKAGE_VERSION "1.2.1"
/* Version number of package */
-#define VERSION "1.1.1"
+#define VERSION "1.2.1"
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
--- a/msvc/win32.rc
+++ b/msvc/win32.rc
@@ -32,8 +32,8 @@
#endif
1 VERSIONINFO
-PRODUCTVERSION 1,1,1,0
-FILEVERSION 1,1,1,0
+PRODUCTVERSION 1,2,1,0
+FILEVERSION 1,2,1,0
FILETYPE 1
BEGIN
BLOCK "StringFileInfo"
@@ -40,13 +40,13 @@
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "FileVersion", "1.1.1"
- VALUE "FileDescription", "Chocolate Doom 1.1.1"
+ VALUE "FileVersion", "1.2.1"
+ VALUE "FileDescription", "Chocolate Doom 1.2.1"
VALUE "InternalName", "chocolate-doom"
VALUE "CompanyName", "[email protected]"
VALUE "LegalCopyright", "GNU General Public License"
VALUE "ProductName", "Chocolate Doom"
- VALUE "ProductVersion", "1.1.1"
+ VALUE "ProductVersion", "1.2.1"
END
END
END
--- a/pcsound/Makefile.am
+++ b/pcsound/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS= @SDL_CFLAGS@ @SDLMIXER_CFLAGS@
+AM_CFLAGS=@SDLMIXER_CFLAGS@
noinst_LIBRARIES=libpcsound.a
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,7 +9,7 @@
chocolate-server \
chocolate-setup
-AM_CFLAGS = -Idoom -I../textscreen -I../pcsound @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
+AM_CFLAGS = -I../textscreen -I../pcsound @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
# Common source files used by absolutely everything:
@@ -35,7 +35,7 @@
z_native.c z_zone.h
chocolate_server_SOURCES=$(COMMON_SOURCE_FILES) $(DEDSERV_FILES)
-chocolate_server_LDADD = @LDFLAGS@ @SDL_LIBS@ @SDLNET_LIBS@
+chocolate_server_LDADD = @LDFLAGS@ @SDLNET_LIBS@
# Source files used by the game binaries (chocolate-doom, etc.)
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -422,10 +422,10 @@
TryRunTics();
+ I_SetWindowTitle(gamedescription);
I_InitGraphics();
I_EnableLoadingDisk();
I_SetGrabMouseCallback(D_GrabMouseCallback);
- I_SetWindowTitle(gamedescription);
V_RestoreBuffer();
R_ExecuteSetViewSize();
--- a/src/doom/wi_stuff.c
+++ b/src/doom/wi_stuff.c
@@ -424,17 +424,31 @@
{
int y = WI_TITLEY;
- // draw <LevelName>
- V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2,
- y,
- lnames[wbs->last]);
+ if (gamemode != commercial || wbs->last < NUMCMAPS)
+ {
+ // draw <LevelName>
+ V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2,
+ y, lnames[wbs->last]);
- // draw "Finished!"
- y += (5*SHORT(lnames[wbs->last]->height))/4;
-
- V_DrawPatch((SCREENWIDTH - SHORT(finished->width))/2,
- y,
- finished);
+ // draw "Finished!"
+ y += (5*SHORT(lnames[wbs->last]->height))/4;
+ }
+ else if (wbs->last == NUMCMAPS)
+ {
+ // MAP33 - nothing is displayed!
+ }
+ else if (wbs->last > NUMCMAPS)
+ {
+ // > MAP33. Doom bombs out here with a Bad V_DrawPatch error.
+ // I'm pretty sure that doom2.exe is just reading into random
+ // bits of memory at this point, but let's try to be accurate
+ // anyway. This deliberately triggers a V_DrawPatch error.
+
+ patch_t tmp = { SCREENWIDTH, SCREENHEIGHT, 1, 1,
+ { 0, 0, 0, 0, 0, 0, 0, 0 } };
+
+ V_DrawPatch(0, y, &tmp);
+ }
}
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -237,8 +237,8 @@
sprintf(filename, "debug%i.txt", consoleplayer);
debugfile = fopen(filename, "w");
}
- I_InitGraphics();
I_SetWindowTitle(gamedescription);
+ I_InitGraphics();
I_SetGrabMouseCallback(D_GrabMouseCallback);
while (1)
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -532,9 +532,9 @@
sprintf(filename, "debug%i.txt", consoleplayer);
debugfile = fopen(filename, "w");
}
+ I_SetWindowTitle("Hexen");
I_InitGraphics();
I_SetGrabMouseCallback(D_GrabMouseCallback);
- I_SetWindowTitle("Hexen");
while (1)
{
--- a/src/i_endoom.c
+++ b/src/i_endoom.c
@@ -40,11 +40,6 @@
TXT_Init();
- // Make sure the new window has the right title and icon
-
- I_SetWindowTitle("Exit screen");
- I_SetWindowIcon();
-
// Write the data to the screen memory
screendata = TXT_GetScreenData();
--- a/src/i_main.c
+++ b/src/i_main.c
@@ -25,6 +25,8 @@
//-----------------------------------------------------------------------------
+#include "config.h"
+
#include "SDL.h"
#include <signal.h>
@@ -32,7 +34,9 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#else
+#endif
+
+#ifdef HAVE_SCHED_SETAFFINITY
#include <unistd.h>
#include <sched.h>
#endif
@@ -49,26 +53,35 @@
void D_DoomMain (void);
-int main(int argc, char **argv)
-{
+#if !defined(_WIN32) && !defined(HAVE_SCHED_SETAFFINITY)
+#warning No known way to set processor affinity on this platform.
+#warning You may experience crashes due to SDL_mixer.
+#endif
+
+int main(int argc, char **argv)
+{
// save arguments
- myargc = argc;
- myargv = argv;
+ myargc = argc;
+ myargv = argv;
+#ifdef _WIN32
+
// Set the process affinity mask so that all threads
- // run on the same processor. This is a workaround for a bug in
+ // run on the same processor. This is a workaround for a bug in
// SDL_mixer that causes occasional crashes.
-#ifdef _WIN32
if (!SetProcessAffinityMask(GetCurrentProcess(), 1))
{
fprintf(stderr, "Failed to set process affinity mask (%d)\n",
(int) GetLastError());
}
-#elif !defined(__APPLE__)
- // POSIX version:
+#endif
+#ifdef HAVE_SCHED_SETAFFINITY
+
+ // Linux version:
+
{
cpu_set_t set;
@@ -77,12 +90,13 @@
sched_setaffinity(getpid(), sizeof(set), &set);
}
+
#endif
// start doom
-
- D_DoomMain ();
+ D_DoomMain ();
+
return 0;
-}
+}
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -20,7 +20,7 @@
// 02111-1307, USA.
//
// DESCRIPTION:
-// Low level graphics code using SDL.
+// DOOM graphics stuff for SDL.
//
//-----------------------------------------------------------------------------
@@ -128,8 +128,14 @@
char *video_driver = "";
+// SDL surface for the screen.
+
static SDL_Surface *screen;
+// Window title
+
+static char *window_title = "";
+
// palette
static SDL_Color palette[256];
@@ -752,6 +758,11 @@
//
void I_StartTic (void)
{
+ if (!initialised)
+ {
+ return;
+ }
+
I_GetEvent();
if (usemouse && !nomouse)
@@ -999,11 +1010,21 @@
void I_SetWindowTitle(char *title)
{
+ window_title = title;
+}
+
+//
+// Call the SDL function to set the window title, based on
+// the title set with I_SetWindowTitle.
+//
+
+static void I_InitWindowTitle(void)
+{
char *buf;
- buf = Z_Malloc(strlen(title) + strlen(PACKAGE_STRING) + 5,
+ buf = Z_Malloc(strlen(window_title) + strlen(PACKAGE_STRING) + 5,
PU_STATIC, NULL);
- sprintf(buf, "%s - %s", title, PACKAGE_STRING);
+ sprintf(buf, "%s - %s", window_title, PACKAGE_STRING);
SDL_WM_SetCaption(buf, NULL);
@@ -1012,7 +1033,7 @@
// Set the application icon
-void I_SetWindowIcon(void)
+static void I_InitWindowIcon(void)
{
SDL_Surface *surface;
Uint8 *mask;
@@ -1669,6 +1690,12 @@
}
}
+ // Set up title and icon. Windows cares about the ordering; this
+ // has to be done before the call to SDL_SetVideoMode.
+
+ I_InitWindowTitle();
+ I_InitWindowIcon();
+
// Set the video mode.
flags |= SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF;
@@ -1705,8 +1732,6 @@
I_SetPalette(doompal);
SDL_SetColors(screen, palette, 0, 256);
-
- I_SetWindowIcon();
CreateCursors();
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -91,7 +91,6 @@
void I_EndRead (void);
void I_SetWindowTitle(char *title);
-void I_SetWindowIcon(void);
void I_CheckIsScreensaver(void);
void I_SetGrabMouseCallback(grabmouse_callback_t func);
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -34,7 +34,6 @@
#include "config.h"
-#include "d_englsh.h"
#include "doomtype.h"
#include "doomkeys.h"
#include "doomfeatures.h"
--- a/src/w_file_win32.c
+++ b/src/w_file_win32.c
@@ -1,187 +1,185 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright(C) 1993-1996 Id Software, Inc.
-// Copyright(C) 2008 Simon Howard
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
-//
-// DESCRIPTION:
-// WAD I/O functions.
-//
-//-----------------------------------------------------------------------------
-
-#include "config.h"
-
-#ifdef _WIN32
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include <stdio.h>
-
-#include "i_system.h"
-#include "w_file.h"
-#include "z_zone.h"
-
-typedef struct
-{
- wad_file_t wad;
- HANDLE handle;
- HANDLE handle_map;
-} win32_wad_file_t;
-
-extern wad_file_class_t win32_wad_file;
-
-static void MapFile(win32_wad_file_t *wad, char *filename)
-{
- wad->handle_map = CreateFileMapping(wad->handle,
- NULL,
- PAGE_WRITECOPY,
- 0,
- 0,
- NULL);
-
- if (wad->handle_map == NULL)
- {
- fprintf(stderr, "W_Win32_OpenFile: Unable to CreateFileMapping() "
- "for %s\n", filename);
- return;
- }
-
- wad->wad.mapped = MapViewOfFile(wad->handle_map,
- FILE_MAP_COPY,
- 0, 0, 0);
-
- if (wad->wad.mapped == NULL)
- {
- fprintf(stderr, "W_Win32_OpenFile: Unable to MapViewOfFile() for %s\n",
- filename);
- }
-}
-
-unsigned int GetFileLength(HANDLE handle)
-{
- DWORD result;
-
- result = SetFilePointer(handle, 0, NULL, FILE_END);
-
- if (result == INVALID_SET_FILE_POINTER)
- {
- I_Error("W_Win32_OpenFile: Failed to read file length");
- }
-
- return result;
-}
-
-static wad_file_t *W_Win32_OpenFile(char *path)
-{
- win32_wad_file_t *result;
- HANDLE handle;
- OFSTRUCT fileinfo;
-
- handle = (HANDLE) OpenFile(path, &fileinfo, OF_READ);
-
- if (handle == (HANDLE) HFILE_ERROR)
- {
- return NULL;
- }
-
- // Create a new win32_wad_file_t to hold the file handle.
-
- result = Z_Malloc(sizeof(win32_wad_file_t), PU_STATIC, 0);
- result->wad.file_class = &win32_wad_file;
- result->wad.length = GetFileLength(handle);
- result->handle = handle;
-
- // Try to map the file into memory with mmap:
-
- MapFile(result, path);
-
- return &result->wad;
-}
-
-static void W_Win32_CloseFile(wad_file_t *wad)
-{
- win32_wad_file_t *win32_wad;
-
- win32_wad = (win32_wad_file_t *) wad;
-
- // If mapped, unmap it.
-
- if (win32_wad->wad.mapped != NULL)
- {
- UnmapViewOfFile(win32_wad->wad.mapped);
- }
-
- if (win32_wad->handle_map != NULL)
- {
- CloseHandle(win32_wad->handle_map);
- }
-
- // Close the file
-
- if (win32_wad->handle != NULL)
- {
- CloseHandle(win32_wad->handle);
- }
-
- Z_Free(win32_wad);
-}
-
-// Read data from the specified position in the file into the
-// provided buffer. Returns the number of bytes read.
-
-size_t W_Win32_Read(wad_file_t *wad, unsigned int offset,
- void *buffer, size_t buffer_len)
-{
- win32_wad_file_t *win32_wad;
- DWORD bytes_read;
- DWORD result;
-
- win32_wad = (win32_wad_file_t *) wad;
-
- // Jump to the specified position in the file.
-
- result = SetFilePointer(win32_wad->handle, offset, NULL, FILE_BEGIN);
-
- if (result == INVALID_SET_FILE_POINTER)
- {
- I_Error("W_Win32_Read: Failed to set file pointer to %i",
- offset);
- }
-
- // Read into the buffer.
-
- if (!ReadFile(win32_wad->handle, buffer, buffer_len, &bytes_read, NULL))
- {
- I_Error("W_Win32_Read: Error reading from file");
- }
-
- return bytes_read;
-}
-
-
-wad_file_class_t win32_wad_file =
-{
- W_Win32_OpenFile,
- W_Win32_CloseFile,
- W_Win32_Read,
-};
-
-
-#endif /* #ifdef _WIN32 */
-
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 1993-1996 Id Software, Inc.
+// Copyright(C) 2008 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+// DESCRIPTION:
+// WAD I/O functions.
+//
+//-----------------------------------------------------------------------------
+
+#include "config.h"
+
+#ifdef _WIN32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "i_system.h"
+#include "w_file.h"
+#include "z_zone.h"
+
+typedef struct
+{
+ wad_file_t wad;
+ HANDLE handle;
+ HANDLE handle_map;
+} win32_wad_file_t;
+
+extern wad_file_class_t win32_wad_file;
+
+static void MapFile(win32_wad_file_t *wad, char *filename)
+{
+ wad->handle_map = CreateFileMapping(wad->handle,
+ NULL,
+ PAGE_WRITECOPY,
+ 0,
+ 0,
+ NULL);
+
+ if (wad->handle_map == NULL)
+ {
+ fprintf(stderr, "W_Win32_OpenFile: Unable to CreateFileMapping() "
+ "for %s\n", filename);
+ return;
+ }
+
+ wad->wad.mapped = MapViewOfFile(wad->handle_map,
+ FILE_MAP_COPY,
+ 0, 0, 0);
+
+ if (wad->wad.mapped == NULL)
+ {
+ fprintf(stderr, "W_Win32_OpenFile: Unable to MapViewOfFile() for %s\n",
+ filename);
+ }
+}
+
+unsigned int GetFileLength(HANDLE handle)
+{
+ DWORD result;
+
+ result = SetFilePointer(handle, 0, NULL, FILE_END);
+
+ if (result == INVALID_SET_FILE_POINTER)
+ {
+ I_Error("W_Win32_OpenFile: Failed to read file length");
+ }
+
+ return result;
+}
+
+static wad_file_t *W_Win32_OpenFile(char *path)
+{
+ win32_wad_file_t *result;
+ HANDLE handle;
+ OFSTRUCT fileinfo;
+
+ handle = (HANDLE) OpenFile(path, &fileinfo, OF_READ);
+
+ if (handle == (HANDLE) HFILE_ERROR)
+ {
+ return NULL;
+ }
+
+ // Create a new win32_wad_file_t to hold the file handle.
+
+ result = Z_Malloc(sizeof(win32_wad_file_t), PU_STATIC, 0);
+ result->wad.file_class = &win32_wad_file;
+ result->wad.length = GetFileLength(handle);
+ result->handle = handle;
+
+ // Try to map the file into memory with mmap:
+
+ MapFile(result, path);
+
+ return &result->wad;
+}
+
+static void W_Win32_CloseFile(wad_file_t *wad)
+{
+ win32_wad_file_t *win32_wad;
+
+ win32_wad = (win32_wad_file_t *) wad;
+
+ // If mapped, unmap it.
+
+ if (win32_wad->wad.mapped != NULL)
+ {
+ UnmapViewOfFile(win32_wad->wad.mapped);
+ }
+
+ if (win32_wad->handle_map != NULL)
+ {
+ CloseHandle(win32_wad->handle_map);
+ }
+
+ // Close the file
+
+ if (win32_wad->handle != NULL)
+ {
+ CloseHandle(win32_wad->handle);
+ }
+
+ Z_Free(win32_wad);
+}
+
+// Read data from the specified position in the file into the
+// provided buffer. Returns the number of bytes read.
+
+size_t W_Win32_Read(wad_file_t *wad, unsigned int offset,
+ void *buffer, size_t buffer_len)
+{
+ win32_wad_file_t *win32_wad;
+ DWORD bytes_read;
+ DWORD result;
+
+ win32_wad = (win32_wad_file_t *) wad;
+
+ // Jump to the specified position in the file.
+
+ result = SetFilePointer(win32_wad->handle, offset, NULL, FILE_BEGIN);
+
+ if (result == INVALID_SET_FILE_POINTER)
+ {
+ I_Error("W_Win32_Read: Failed to set file pointer to %i",
+ offset);
+ }
+
+ // Read into the buffer.
+
+ if (!ReadFile(win32_wad->handle, buffer, buffer_len, &bytes_read, NULL))
+ {
+ I_Error("W_Win32_Read: Error reading from file");
+ }
+
+ return bytes_read;
+}
+
+
+wad_file_class_t win32_wad_file =
+{
+ W_Win32_OpenFile,
+ W_Win32_CloseFile,
+ W_Win32_Read,
+};
+
+
+#endif /* #ifdef _WIN32 */
+
--- a/textscreen/Makefile.am
+++ b/textscreen/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = @SDL_CFLAGS@ -I../src
+AM_CFLAGS = -I../src
# build this directory before the examples directory.
--- a/textscreen/examples/Makefile.am
+++ b/textscreen/examples/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = @SDL_CFLAGS@ -I.. -I../../src
+AM_CFLAGS = -I.. -I../../src
noinst_PROGRAMS=guitest calculator