From ea6bc745c64b7832d3cea2d5ae3748c0f81109c3 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 26 May 2014 14:11:25 -0400 Subject: setup: Add default config for Xbox360 on Linux. The Xbox360 controller is handled differently by different operating systems, and the layout is different on Linux to Windows. Detect the Linux layout and set some appropriate defaults. --- src/setup/joystick.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src') diff --git a/src/setup/joystick.c b/src/setup/joystick.c index b57667f4..4cc62fe1 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -206,6 +206,26 @@ static const joystick_config_t xbox360_controller[] = {NULL, 0}, }; +// Xbox 360 controller under Linux. +static const joystick_config_t xbox360_controller_linux[] = +{ + {"joystick_x_axis", CREATE_HAT_AXIS(0, HAT_AXIS_HORIZONTAL)}, + {"joystick_y_axis", CREATE_HAT_AXIS(0, HAT_AXIS_VERTICAL)}, + // Ideally we'd like the trigger buttons to be strafe left/right + // But Linux presents each trigger button as its own axis, which + // we can't really work with. So we have to settle for a + // suboptimal setup. + {"joyb_fire", 2}, // X + {"joyb_speed", 0}, // A + {"joyb_jump", 3}, // Y + {"joyb_use", 1}, // B + {"joyb_strafeleft", 4}, // LB + {"joyb_straferight", 5}, // RB + {"joyb_menu_activate", 7}, // Start + {"joyb_prevweapon", 6}, // Back + {NULL, 0}, +}; + // Logitech Dual Action (F310, F710). Thanks to Brad Harding for details. static const joystick_config_t logitech_f310_controller[] = { @@ -249,6 +269,13 @@ static const known_joystick_t known_joysticks[] = xbox360_controller, }, + // Xbox 360 controller as it appears on Linux. + { + "Microsoft X-Box 360 pad", + 6, 11, 1, + xbox360_controller_linux, + }, + { "Logitech Dual Action", 4, 12, 1, -- cgit v1.2.3 From 46dbe96efd039d49a4a43603f823340520eccfaa Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 12 Jun 2014 18:03:39 -0700 Subject: Add desktop entries for all the games, make the Setup launch generic The same icon is used for all four games, even though it's designed to resemble Doom's logo and looks a bit silly with all of them lined up. Also the Setup Desktop Entry now only launches chocolate-setup, which then prompts for the game to configure. This avoids cluttering up a DE's Preferences menu, control panel, or however it will be displayed. --- src/Makefile.am | 15 ++++++++++++++- src/doom-screensaver.desktop.in | 6 ++---- src/doom.desktop.in | 2 +- src/heretic.desktop.in | 7 +++++++ src/hexen.desktop.in | 7 +++++++ src/setup/setup.desktop.in | 6 +++--- src/strife.desktop.in | 7 +++++++ 7 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 src/heretic.desktop.in create mode 100644 src/hexen.desktop.in create mode 100644 src/strife.desktop.in (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 5c9d15f4..16496d88 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -218,11 +218,24 @@ EXTRA_DIST = \ manifest.xml appdir = $(prefix)/share/applications -app_DATA = @PROGRAM_PREFIX@doom.desktop +app_DATA = \ + @PROGRAM_PREFIX@doom.desktop \ + @PROGRAM_PREFIX@heretic.desktop \ + @PROGRAM_PREFIX@hexen.desktop \ + @PROGRAM_PREFIX@strife.desktop @PROGRAM_PREFIX@doom.desktop : doom.desktop cp doom.desktop $@ +@PROGRAM_PREFIX@heretic.desktop : heretic.desktop + cp heretic.desktop $@ + +@PROGRAM_PREFIX@hexen.desktop : hexen.desktop + cp hexen.desktop $@ + +@PROGRAM_PREFIX@strife.desktop : strife.desktop + cp strife.desktop $@ + screensaverdir = $(prefix)/share/applications/screensavers screensaver_DATA = @PROGRAM_PREFIX@doom-screensaver.desktop diff --git a/src/doom-screensaver.desktop.in b/src/doom-screensaver.desktop.in index 315f964c..deb7274a 100644 --- a/src/doom-screensaver.desktop.in +++ b/src/doom-screensaver.desktop.in @@ -1,12 +1,10 @@ - [Desktop Entry] -Name=@PACKAGE_NAME@ +Name=@PACKAGE_SHORTNAME@ Doom Comment=@PACKAGE_SHORTDESC@ TryExec=@PROGRAM_PREFIX@doom Exec=@PROGRAM_PREFIX@doom StartupNotify=false Terminal=false Type=Application -OnlyShowIn=GNOME; +OnlyShowIn=GNOME;MATE; Categories=Screensaver; - diff --git a/src/doom.desktop.in b/src/doom.desktop.in index 44b76e62..e554a244 100644 --- a/src/doom.desktop.in +++ b/src/doom.desktop.in @@ -1,5 +1,5 @@ [Desktop Entry] -Name=@PACKAGE_NAME@ +Name=@PACKAGE_SHORTNAME@ Doom Exec=@PROGRAM_PREFIX@doom Icon=@PROGRAM_PREFIX@doom Type=Application diff --git a/src/heretic.desktop.in b/src/heretic.desktop.in new file mode 100644 index 00000000..54ef6a83 --- /dev/null +++ b/src/heretic.desktop.in @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=@PACKAGE_SHORTNAME@ Heretic +Exec=@PROGRAM_PREFIX@heretic +Icon=@PROGRAM_PREFIX@doom +Type=Application +Comment=@PACKAGE_SHORTDESC@ +Categories=Game;ActionGame; diff --git a/src/hexen.desktop.in b/src/hexen.desktop.in new file mode 100644 index 00000000..14603840 --- /dev/null +++ b/src/hexen.desktop.in @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=@PACKAGE_SHORTNAME@ Hexen +Exec=@PROGRAM_PREFIX@hexen +Icon=@PROGRAM_PREFIX@doom +Type=Application +Comment=@PACKAGE_SHORTDESC@ +Categories=Game;ActionGame; diff --git a/src/setup/setup.desktop.in b/src/setup/setup.desktop.in index 4b1cf69c..91decb41 100644 --- a/src/setup/setup.desktop.in +++ b/src/setup/setup.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] -Name=@PACKAGE_NAME@ Setup -Exec=@PROGRAM_PREFIX@doom-setup +Name=@PACKAGE_SHORTNAME@ Setup +Exec=@PROGRAM_PREFIX@setup Icon=@PROGRAM_PREFIX@setup Type=Application -Comment=Setup tool for @PACKAGE_NAME@ +Comment=Setup tool for @PACKAGE_SHORTNAME@ Categories=Settings diff --git a/src/strife.desktop.in b/src/strife.desktop.in new file mode 100644 index 00000000..eb44c61d --- /dev/null +++ b/src/strife.desktop.in @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=@PACKAGE_SHORTNAME@ Strife +Exec=@PROGRAM_PREFIX@strife +Icon=@PROGRAM_PREFIX@doom +Type=Application +Comment=@PACKAGE_SHORTDESC@ +Categories=Game;ActionGame; -- cgit v1.2.3 From c4332b7691a7ce639bb55bfae12024b7e8f9bccb Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 12 Jun 2014 18:13:37 -0700 Subject: Ignore some more autogenerated files --- src/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/.gitignore b/src/.gitignore index aa8a4c05..a0cf15b4 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -6,6 +6,11 @@ chocolate-doom chocolate-heretic chocolate-hexen chocolate-server +chocolate-strife +chocolate-doom-setup +chocolate-heretic-setup +chocolate-hexen-setup +chocolate-strife-setup chocolate-setup *.exe *.desktop -- cgit v1.2.3 From 0632e537f9277e7c3c0cbc2874be94531ff50134 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 18 Jun 2014 13:06:25 +0200 Subject: Move extern definitions for p_map.c to p_local.h This fixes conflicting array sizes for the variable "spechit" as reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748393. Fixes #414 --- src/doom/p_enemy.c | 5 ----- src/doom/p_local.h | 14 ++++++++++++++ src/doom/p_map.c | 11 ----------- 3 files changed, 14 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c index ba2b011b..a7df6a01 100644 --- a/src/doom/p_enemy.c +++ b/src/doom/p_enemy.c @@ -257,11 +257,6 @@ boolean P_CheckMissileRange (mobj_t* actor) fixed_t xspeed[8] = {FRACUNIT,47000,0,-47000,-FRACUNIT,-47000,0,47000}; fixed_t yspeed[8] = {0,47000,FRACUNIT,47000,0,-47000,-FRACUNIT,-47000}; -#define MAXSPECIALCROSS 8 - -extern line_t* spechit[MAXSPECIALCROSS]; -extern int numspechit; - boolean P_Move (mobj_t* actor) { fixed_t tryx; diff --git a/src/doom/p_local.h b/src/doom/p_local.h index fea6f1ea..95fa4053 100644 --- a/src/doom/p_local.h +++ b/src/doom/p_local.h @@ -208,6 +208,20 @@ extern fixed_t tmceilingz; extern line_t* ceilingline; +// fraggle: I have increased the size of this buffer. In the original Doom, +// overrunning past this limit caused other bits of memory to be overwritten, +// affecting demo playback. However, in doing so, the limit was still +// exceeded. So we have to support more than 8 specials. +// +// We keep the original limit, to detect what variables in memory were +// overwritten (see SpechitOverrun()) + +#define MAXSPECIALCROSS 20 +#define MAXSPECIALCROSS_ORIGINAL 8 + +extern line_t* spechit[MAXSPECIALCROSS]; +extern int numspechit; + boolean P_CheckPosition (mobj_t *thing, fixed_t x, fixed_t y); boolean P_TryMove (mobj_t* thing, fixed_t x, fixed_t y); boolean P_TeleportMove (mobj_t* thing, fixed_t x, fixed_t y); diff --git a/src/doom/p_map.c b/src/doom/p_map.c index bf92fcea..e371869a 100644 --- a/src/doom/p_map.c +++ b/src/doom/p_map.c @@ -82,17 +82,6 @@ line_t* ceilingline; // keep track of special lines as they are hit, // but don't process them until the move is proven valid -// fraggle: I have increased the size of this buffer. In the original Doom, -// overrunning past this limit caused other bits of memory to be overwritten, -// affecting demo playback. However, in doing so, the limit was still -// exceeded. So we have to support more than 8 specials. -// -// We keep the original limit, to detect what variables in memory were -// overwritten (see SpechitOverrun()) - -#define MAXSPECIALCROSS 20 -#define MAXSPECIALCROSS_ORIGINAL 8 - line_t* spechit[MAXSPECIALCROSS]; int numspechit; -- cgit v1.2.3 From 94419f9f915682f584153cb3797c0ed08eb83500 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 15 Jul 2014 18:24:22 +0200 Subject: free() some allocated bytes Thanks valgrind!--- src/deh_io.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/deh_io.c b/src/deh_io.c index 9f76563d..778170fd 100644 --- a/src/deh_io.c +++ b/src/deh_io.c @@ -137,6 +137,7 @@ void DEH_CloseFile(deh_context_t *context) W_ReleaseLumpNum(context->lumpnum); } + free(context->filename); Z_Free(context->readbuffer); Z_Free(context); } -- cgit v1.2.3 From e03f775902d666e65f1d06332871a80b0e3cc10f Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 5 Aug 2014 17:46:06 +0200 Subject: call InitializeSections() in DEH_LoadLump() apparently, this has been forgotten before, so DEH_PointerInit() was not executed which meant that *some* DEHACKED patches would not work when loaded from within a PWAD but would work when extracted from that WAD and loaded via -deh. fixes #421 --- src/deh_main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/deh_main.c b/src/deh_main.c index ff0236b1..c98962a9 100644 --- a/src/deh_main.c +++ b/src/deh_main.c @@ -346,6 +346,12 @@ int DEH_LoadLump(int lumpnum, boolean allow_long) deh_context_t *context; boolean long_strings, long_cheats; + if (!deh_initialized) + { + InitializeSections(); + deh_initialized = true; + } + if (allow_long) { long_strings = deh_allow_long_strings; -- cgit v1.2.3