summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2011-03-06 22:42:12 +0000
committerSimon Howard2011-03-06 22:42:12 +0000
commitdbdd53e7734b1166185a9906897d5dc87fd95376 (patch)
tree49d2ba05f5dee53a6aa052ed8027e07cd404d25f
parent97ddedc959ecf361cc7ff2d9055aa4899252bccb (diff)
parent68f51552ff65668deaeef923fc8c496d64ea9a60 (diff)
downloadchocolate-doom-dbdd53e7734b1166185a9906897d5dc87fd95376.tar.gz
chocolate-doom-dbdd53e7734b1166185a9906897d5dc87fd95376.tar.bz2
chocolate-doom-dbdd53e7734b1166185a9906897d5dc87fd95376.zip
Merge from raven-branch.
Subversion-branch: /branches/strife-branch Subversion-revision: 2293
-rw-r--r--NEWS6
-rw-r--r--pkg/osx/IWADController.h4
-rw-r--r--pkg/osx/IWADController.m35
-rw-r--r--pkg/osx/LauncherManager.m24
-rw-r--r--src/doom/d_main.c2
-rw-r--r--src/heretic/d_main.c1
-rw-r--r--src/hexen/h2_main.c1
-rw-r--r--src/i_main.c2
-rw-r--r--src/i_sdlsound.c14
-rw-r--r--src/setup/display.c11
-rw-r--r--src/setup/keyboard.c6
-rw-r--r--src/strife/d_main.c2
12 files changed, 87 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 7e89584c..3983ac76 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
1.6.0 (2011-??-??):
+ Compatibility:
+ * Very short sound effects are not played, to better emulate the
+ behavior of DMX in Vanilla Doom (thanks to Quasar for help in
+ investigating this).
+
Bugs fixed:
* Menu navigation when using joystick/joypad (thanks Alexandre
Xavier).
@@ -7,6 +12,7 @@
right shift, not left shift (thanks AlexXav).
* Default joystick buttons for the setup tool now match Vanilla
(thanks twipley).
+ * Visual Studio project files work again (thanks GhostlyDeath).
libtextscreen:
* It is now possible to type a '+' in input boxes (thanks
diff --git a/pkg/osx/IWADController.h b/pkg/osx/IWADController.h
index 90f44667..fef28918 100644
--- a/pkg/osx/IWADController.h
+++ b/pkg/osx/IWADController.h
@@ -36,6 +36,9 @@
id doom2;
id plutonia;
id tnt;
+
+ id heretic;
+ id hexen;
}
- (void) closeConfigWindow: (id)sender;
@@ -47,6 +50,7 @@
- (void) saveConfig;
- (char *) doomWadPath;
- (void) setEnvironment;
+- (const char *) getGameName;
@end
diff --git a/pkg/osx/IWADController.m b/pkg/osx/IWADController.m
index 3c596850..6cab7ff2 100644
--- a/pkg/osx/IWADController.m
+++ b/pkg/osx/IWADController.m
@@ -33,6 +33,8 @@ typedef enum
IWAD_TNT,
IWAD_PLUTONIA,
IWAD_CHEX,
+ IWAD_HERETIC,
+ IWAD_HEXEN,
NUM_IWAD_TYPES
} IWAD;
@@ -42,7 +44,9 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] =
@"Doom II: Hell on Earth",
@"Final Doom: TNT: Evilution",
@"Final Doom: Plutonia Experiment",
- @"Chex Quest"
+ @"Chex Quest",
+ @"Heretic",
+ @"Hexen"
};
static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] =
@@ -52,6 +56,8 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] =
@"tnt.wad",
@"plutonia.wad",
@"chex.wad",
+ @"heretic.wad",
+ @"hexen.wad",
@"undefined"
};
@@ -64,6 +70,8 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] =
iwadList[IWAD_TNT] = self->tnt;
iwadList[IWAD_PLUTONIA] = self->plutonia;
iwadList[IWAD_CHEX] = self->chex;
+ iwadList[IWAD_HERETIC] = self->heretic;
+ iwadList[IWAD_HEXEN] = self->hexen;
}
- (IWAD) getSelectedIWAD
@@ -102,6 +110,27 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] =
}
}
+// Get the name used for the executable for the selected IWAD.
+
+- (const char *) getGameName
+{
+ IWAD selectedIWAD;
+
+ selectedIWAD = [self getSelectedIWAD];
+
+ switch (selectedIWAD)
+ {
+ case IWAD_HERETIC:
+ return "heretic";
+
+ case IWAD_HEXEN:
+ return "hexen";
+
+ default:
+ return "doom";
+ }
+}
+
- (void) setIWADConfig
{
IWADLocation *iwadList[NUM_IWAD_TYPES];
@@ -250,6 +279,10 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] =
- (void) awakeFromNib
{
+ // TODO: This is temporary:
+ self->heretic = self->doom1;
+ self->hexen = self->doom2;
+
[self->configWindow center];
// Set configuration for all IWADs from configuration file.
diff --git a/pkg/osx/LauncherManager.m b/pkg/osx/LauncherManager.m
index 8c523ab4..36723db5 100644
--- a/pkg/osx/LauncherManager.m
+++ b/pkg/osx/LauncherManager.m
@@ -278,6 +278,8 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName)
{
NSString *iwad;
NSString *args;
+ char *executable_name;
+ const char *game_name;
[self saveConfig];
@@ -294,7 +296,11 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName)
return;
}
- ExecuteProgram(PACKAGE_TARNAME, [iwad UTF8String],
+ game_name = [self->iwadController getGameName];
+ executable_name = malloc(strlen(PROGRAM_PREFIX) + strlen(game_name) + 1);
+ sprintf(executable_name, "%s%s", PROGRAM_PREFIX, game_name);
+
+ ExecuteProgram(executable_name, [iwad UTF8String],
[args UTF8String]);
[NSApp terminate:sender];
}
@@ -303,10 +309,22 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName)
- (void) runSetup: (id)sender
{
- [self saveConfig];
+ const char *game_name;
+ char *arg;
+ [self saveConfig];
[self->iwadController setEnvironment];
- ExecuteProgram("chocolate-setup", NULL, NULL);
+
+ // Provide the -game command line parameter to select the game
+ // to configure, based on the game selected in the dropdown.
+
+ game_name = [self->iwadController getGameName];
+ arg = malloc(strlen(game_name) + 8);
+ sprintf(arg, "-game %s", game_name);
+
+ ExecuteProgram(PROGRAM_PREFIX "setup", NULL, arg);
+
+ free(arg);
}
// Invoked when the "Terminal" option is selected from the menu, to open
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 2f116f1e..991907fa 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1100,8 +1100,6 @@ void D_DoomMain (void)
I_AtExit(D_Endoom, false);
- M_FindResponseFile ();
-
// print banner
I_PrintBanner(PACKAGE_STRING);
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 169a86ea..5c2d5cf2 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -805,7 +805,6 @@ void D_DoomMain(void)
I_AtExit(D_Endoom, false);
- M_FindResponseFile();
nomonsters = M_CheckParm("-nomonsters");
respawnparm = M_CheckParm("-respawn");
ravpic = M_CheckParm("-ravpic");
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index abc58f15..4f9fe312 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -232,7 +232,6 @@ void D_DoomMain(void)
int p;
I_AtExit(D_HexenQuitMessage, false);
- M_FindResponseFile();
startepisode = 1;
autostart = false;
startskill = sk_medium;
diff --git a/src/i_main.c b/src/i_main.c
index 1ccc52c0..fdfa3cbc 100644
--- a/src/i_main.c
+++ b/src/i_main.c
@@ -154,6 +154,8 @@ int main(int argc, char **argv)
LockCPUAffinity();
+ M_FindResponseFile();
+
// start doom
D_DoomMain ();
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 03e9d85b..e3118a82 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -664,11 +664,23 @@ static boolean CacheSFX(sfxinfo_t *sfxinfo)
// If the header specifies that the length of the sound is greater than
// the length of the lump itself, this is an invalid sound lump
- if (length > lumplen - 8)
+ // We also discard sound lumps that are less than 49 samples long,
+ // as this is how DMX behaves - although the actual cut-off length
+ // seems to vary slightly depending on the sample rate. This needs
+ // further investigation to better understand the correct
+ // behavior.
+
+ if (length > lumplen - 8 || length <= 48)
{
return false;
}
+ // The DMX sound library seems to skip the first 16 and last 16
+ // bytes of the lump - reason unknown.
+
+ data += 16;
+ length -= 32;
+
// Sample rate conversion
if (!ExpandSoundData(sfxinfo, data + 8, samplerate, length))
diff --git a/src/setup/display.c b/src/setup/display.c
index f5f190f2..9ed0ae5f 100644
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -257,9 +257,7 @@ static int GetSupportedBPPIndex(char *description)
}
}
- // Shouldn't happen; fall back to the first in the list.
-
- return 0;
+ return -1;
}
// Set selected_bpp to match screen_bpp.
@@ -277,7 +275,11 @@ static int TrySetSelectedBPP(void)
if (pixel_depths[i].bpp == screen_bpp)
{
selected_bpp = GetSupportedBPPIndex(pixel_depths[i].description);
- return 1;
+
+ if (selected_bpp >= 0)
+ {
+ return 1;
+ }
}
}
@@ -715,6 +717,7 @@ void BindDisplayVariables(void)
M_BindVariable("fullscreen", &fullscreen);
M_BindVariable("screen_width", &screen_width);
M_BindVariable("screen_height", &screen_height);
+ M_BindVariable("screen_bpp", &screen_bpp);
M_BindVariable("startup_delay", &startup_delay);
M_BindVariable("video_driver", &video_driver);
M_BindVariable("usegamma", &usegamma);
diff --git a/src/setup/keyboard.c b/src/setup/keyboard.c
index 7ee523bb..46ef05c2 100644
--- a/src/setup/keyboard.c
+++ b/src/setup/keyboard.c
@@ -314,12 +314,6 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
AddKeyControl(table, "- to brown", &key_multi_msgplayer[2]);
AddKeyControl(table, "- to red", &key_multi_msgplayer[3]);
- TXT_AddWidgets(table, TXT_NewStrut(0, 1),
- TXT_NewStrut(0, 1),
- TXT_NewLabel(" - Map - "),
- TXT_NewStrut(0, 0),
- NULL);
-
scrollpane = TXT_NewScrollPane(0, 13, table);
TXT_AddWidget(window, scrollpane);
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index 6367818a..663d2028 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -1377,8 +1377,6 @@ void D_DoomMain (void)
I_AtExit(D_Endoom, false);
- M_FindResponseFile ();
-
// haleyjd 20110206 [STRIFE]: -nograph parameter
//!