forked from pool/dsda-doom
Accepting request 1126473 from games
- Update to release 0.27.3 OBS-URL: https://build.opensuse.org/request/show/1126473 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dsda-doom?expand=0&rev=2
This commit is contained in:
commit
bf6fa1cec9
35
cmake-path-suffix.diff
Normal file
35
cmake-path-suffix.diff
Normal file
@ -0,0 +1,35 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: 2023-11-01 14:19:29.990929358 +0100
|
||||
References: https://github.com/kraflab/dsda-doom/issues/434
|
||||
|
||||
[ 6s] src/CMakeFiles/dsda-doom.dir/build.make:3952: warning: overriding recipe for target 'dsda-doom'
|
||||
[ 6s] src/CMakeFiles/dsda-doom.dir/build.make:3943: warning: ignoring old recipe for target 'dsda-doom'
|
||||
[ 6s] src/CMakeFiles/dsda-doom.dir/build.make:3952: warning: overriding recipe for target 'dsda-doom'
|
||||
[ 6s] src/CMakeFiles/dsda-doom.dir/build.make:3943: warning: ignoring old recipe for target 'dsda-doom'
|
||||
[ 6s] make[2]: *** No rule to make target 'optimized', needed by 'dsda-doom'. Stop.
|
||||
[ 6s] make[1]: *** [CMakeFiles/Makefile2:172: src/CMakeFiles/dsda-doom.dir/all] Error 2
|
||||
|
||||
---
|
||||
prboom2/cmake/FindLibMad.cmake | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
Index: dsda-doom-0.27.2/prboom2/cmake/FindLibMad.cmake
|
||||
===================================================================
|
||||
--- dsda-doom-0.27.2.orig/prboom2/cmake/FindLibMad.cmake
|
||||
+++ dsda-doom-0.27.2/prboom2/cmake/FindLibMad.cmake
|
||||
@@ -59,13 +59,13 @@ select_dll_configurations(LibMad)
|
||||
find_library(
|
||||
LibMad_LIBRARY_RELEASE
|
||||
NAMES mad
|
||||
- PATH_SUFFIXES ../../lib
|
||||
+ PATH_SUFFIXES ${CMAKE_CURRENT_BINARY_DIR}/../../lib
|
||||
)
|
||||
|
||||
find_library(
|
||||
LibMad_LIBRARY_DEBUG
|
||||
NAMES mad
|
||||
- PATH_SUFFIXES ../debug/lib
|
||||
+ PATH_SUFFIXES ${CMAKE_CURRENT_BINARY_DIR}/../debug/lib
|
||||
)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
@ -1,3 +1,23 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 5 22:26:17 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
- Update to release 0.27.3
|
||||
* New indexed light mode (software fidelity in OpenGL).
|
||||
* Improved controller support.
|
||||
* A new HUD system with new components.
|
||||
* New console commands and better usability.
|
||||
* UDMF support, MAPINFO support
|
||||
* ZIP file loading
|
||||
* Improved Heretic and Hexen suport
|
||||
* Upgraded to OPL3 emulation
|
||||
* You can switch back to OPL2 with config option mus_opl_opl3mode
|
||||
- Delete prboom-nodatetime.diff, fluidsynth1.diff
|
||||
- Add cmake-path-suffix.diff
|
||||
- Note: If you updated from an old dsda-doom and use the same
|
||||
config file, your default complevel may have been reset to 0. If
|
||||
you run into an issue, check it out (suggested value is 21 /
|
||||
mbf21, if you don't know what to pick).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 30 18:39:27 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package dsda-doom
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -17,29 +17,33 @@
|
||||
|
||||
|
||||
Name: dsda-doom
|
||||
Version: 0.24.3
|
||||
Version: 0.27.3
|
||||
Release: 0
|
||||
Summary: DOOM source port with Hexen support and demo compatibility
|
||||
License: GPL-2.0-or-later
|
||||
Group: Amusements/Games/3D/Shoot
|
||||
URL: https://github.com/kraflab/dsda-doom
|
||||
|
||||
#Changelog: https://github.com/kraflab/dsda-doom/blob/v0.24.3/patch_notes/v0.24.md
|
||||
#Changelog: https://github.com/kraflab/dsda-doom/tree/master/patch_notes
|
||||
#Announce: https://www.doomworld.com/forum/topic/118074-dsda-doom-source-port-v0243/
|
||||
Source: https://github.com/kraflab/dsda-doom/archive/refs/tags/v%version.tar.gz
|
||||
Patch1: prboom-nodatetime.diff
|
||||
Patch1: cmake-path-suffix.diff
|
||||
Patch2: prboom-hbar-all.diff
|
||||
Patch3: prboom-hbar-gradient.diff
|
||||
Patch4: fluidsynth1.diff
|
||||
BuildRequires: Mesa-devel
|
||||
BuildRequires: c++_compiler
|
||||
BuildRequires: cmake
|
||||
BuildRequires: fluidsynth
|
||||
BuildRequires: fluidsynth-devel
|
||||
BuildRequires: hicolor-icon-theme
|
||||
BuildRequires: libmad-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libvorbis-devel
|
||||
BuildRequires: libzip-devel
|
||||
BuildRequires: libzip-tools
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: portmidi-devel
|
||||
BuildRequires: portmidi-java
|
||||
BuildRequires: update-desktop-files
|
||||
BuildRequires: pkgconfig(SDL2_image)
|
||||
BuildRequires: pkgconfig(SDL2_mixer)
|
||||
@ -58,15 +62,11 @@ It features:
|
||||
* MBFv21, UMAPINFO and DSDHacked specification support
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch -P 1 -P 2 -P 3 -p0
|
||||
%if 0%{?sle_version} < 150400
|
||||
%patch -P 4 -p0
|
||||
%endif
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
pushd prboom2/
|
||||
%cmake -DDOOMWADDIR="%_datadir/doom"
|
||||
%cmake -DDOOMWADDIR="%_datadir/doom" -DDSDAPWADDIR="%_datadir/doom"
|
||||
%cmake_build
|
||||
popd
|
||||
|
||||
@ -76,7 +76,6 @@ pushd prboom2/
|
||||
b="%buildroot"
|
||||
install -Dm0644 ICONS/dsda-doom.png "$b/%_datadir/icons/hicolor/apps/dsda-doom.png"
|
||||
install -Dm0644 ICONS/dsda-doom.desktop "$b/%_datadir/applications/dsda-doom.desktop"
|
||||
install -Dm0644 ICONS/dsda-doom.bash "$b/%_datadir/bash-completion/completions/dsda-doom.bash"
|
||||
popd
|
||||
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1550
|
||||
@ -94,7 +93,6 @@ popd
|
||||
%_datadir/doom/
|
||||
%_datadir/applications/*.desktop
|
||||
%_datadir/icons/hicolor/apps/
|
||||
%_datadir/bash-completion/
|
||||
%doc docs/*.md
|
||||
|
||||
%changelog
|
||||
|
@ -1,55 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Wed, 30 Mar 2022 21:13:50 +0200
|
||||
Subject: [PATCH] Continue supporting fluidsynth1 API
|
||||
Upstream: probably not worth, given Leap 15.4 (FL2) is around the corner
|
||||
|
||||
Platforms such as openSUSE Leap 15.3 still only have FL1, owing
|
||||
to the branch having set off in 2017.
|
||||
---
|
||||
prboom2/src/MUSIC/flplayer.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/prboom2/src/MUSIC/flplayer.c b/prboom2/src/MUSIC/flplayer.c
|
||||
index 27cd31aa..282714e8 100644
|
||||
--- prboom2/src/MUSIC/flplayer.c
|
||||
+++ prboom2/src/MUSIC/flplayer.c
|
||||
@@ -231,17 +231,19 @@ static int fl_init (int samplerate)
|
||||
}
|
||||
|
||||
{
|
||||
- int lumpnum;
|
||||
+ int lumpnum = -1;
|
||||
int checked_file = false;
|
||||
dboolean replaced_soundfont = false;
|
||||
const char *checked_f_font = NULL;
|
||||
|
||||
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
|
||||
lumpnum = W_CheckNumForName("SNDFONT");
|
||||
|
||||
if (lumpnum >= 0)
|
||||
{
|
||||
replaced_soundfont = !W_LumpNumInPortWad(lumpnum);
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!replaced_soundfont && snd_soundfont && snd_soundfont[0])
|
||||
{
|
||||
@@ -251,6 +253,7 @@ static int fl_init (int samplerate)
|
||||
f_font = fluid_synth_sfload (f_syn, filename, 1);
|
||||
}
|
||||
|
||||
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
|
||||
if ((!checked_file || f_font == FLUID_FAILED) && lumpnum >= 0)
|
||||
{
|
||||
fluid_sfloader_t *sfloader;
|
||||
@@ -262,6 +265,7 @@ static int fl_init (int samplerate)
|
||||
fluid_synth_add_sfloader(f_syn, sfloader);
|
||||
f_font = fluid_synth_sfload(f_syn, "SNDFONT", 1);
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!checked_f_font)
|
||||
{
|
||||
--
|
||||
2.35.1
|
@ -1,76 +1,153 @@
|
||||
From f8dc397539f27c601aa6f1f3ea0f6c1f177efd97 Mon Sep 17 00:00:00 2001
|
||||
From 882bcbe9f612b2bcc0daab095d73c7fb5e9723be Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Wed, 1 May 2013 09:53:49 +0200
|
||||
Subject: [PATCH 1/2] Add option to show health bar for all destructible mobjs
|
||||
References: https://github.com/coelckers/prboom-plus/pull/274
|
||||
Origin: https://github.com/jengelh/dsda-doom
|
||||
|
||||
The current health bar fails to show for Lost Souls.
|
||||
In addition, showing it for other destructible objects (such as
|
||||
barrels - or DEH modifications in that spirit) can be used to gauge
|
||||
the objects' remaining life.
|
||||
The current health bar fails to show for Lost Souls. In addition,
|
||||
showing it for other destructible objects (such as barrels - or DEH
|
||||
modifications in that spirit) can be used to gauge the objects'
|
||||
remaining life.
|
||||
---
|
||||
prboom2/src/gl_main.c | 10 +++++++++-
|
||||
prboom2/src/dsda/configuration.c | 4 ++++
|
||||
prboom2/src/dsda/configuration.h | 1 +
|
||||
prboom2/src/dsda/settings.c | 5 +++++
|
||||
prboom2/src/dsda/settings.h | 1 +
|
||||
prboom2/src/gl_intern.h | 1 +
|
||||
prboom2/src/gl_main.c | 13 ++++++++++---
|
||||
prboom2/src/m_menu.c | 1 +
|
||||
prboom2/src/m_misc.c | 1 +
|
||||
prboom2/src/r_things.c | 1 +
|
||||
prboom2/src/r_things.h | 1 +
|
||||
4 files changed, 12 insertions(+), 1 deletion(-)
|
||||
8 files changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: prboom2/src/gl_main.c
|
||||
===================================================================
|
||||
--- prboom2/src/gl_main.c.orig
|
||||
+++ prboom2/src/gl_main.c
|
||||
@@ -2467,9 +2467,17 @@ static void gld_DrawSprite(GLSprite *spr
|
||||
}
|
||||
diff --git a/prboom2/src/dsda/configuration.c b/prboom2/src/dsda/configuration.c
|
||||
index e0fe40ecf..b1197ee17 100644
|
||||
--- a/prboom2/src/dsda/configuration.c
|
||||
+++ b/prboom2/src/dsda/configuration.c
|
||||
@@ -597,6 +597,10 @@ dsda_config_t dsda_config[dsda_config_count] = {
|
||||
"gl_health_bar", dsda_config_gl_health_bar,
|
||||
CONF_BOOL(0), NULL, STRICT_INT(0)
|
||||
},
|
||||
+ [dsda_config_gl_health_bar_shootables] = {
|
||||
+ "gl_health_bar_shootables", dsda_config_gl_health_bar_shootables,
|
||||
+ CONF_BOOL(0), NULL, NOT_STRICT
|
||||
+ },
|
||||
[dsda_config_gl_usevbo] = {
|
||||
"gl_usevbo", dsda_config_gl_usevbo,
|
||||
CONF_BOOL(1), NULL, NOT_STRICT
|
||||
diff --git a/prboom2/src/dsda/configuration.h b/prboom2/src/dsda/configuration.h
|
||||
index 4bf8531b4..f32f4c6b2 100644
|
||||
--- a/prboom2/src/dsda/configuration.h
|
||||
+++ b/prboom2/src/dsda/configuration.h
|
||||
@@ -119,6 +119,7 @@ typedef enum {
|
||||
dsda_config_gl_render_multisampling,
|
||||
dsda_config_gl_render_fov,
|
||||
dsda_config_gl_health_bar,
|
||||
+ dsda_config_gl_health_bar_shootables,
|
||||
dsda_config_gl_usevbo,
|
||||
dsda_config_gl_fade_mode,
|
||||
dsda_config_use_mouse,
|
||||
diff --git a/prboom2/src/dsda/settings.c b/prboom2/src/dsda/settings.c
|
||||
index c417705bd..6019ed07d 100644
|
||||
--- a/prboom2/src/dsda/settings.c
|
||||
+++ b/prboom2/src/dsda/settings.c
|
||||
@@ -248,6 +248,11 @@ dboolean dsda_ShowHealthBars(void) {
|
||||
return dsda_IntConfig(dsda_config_gl_health_bar);
|
||||
}
|
||||
|
||||
+static int gld_EvaluateShowBar(mobj_t* thing)
|
||||
+dboolean dsda_ShowHealthBarsForShootables(void)
|
||||
+{
|
||||
+ if (health_bar_shootables)
|
||||
+ return thing->flags & MF_SHOOTABLE;
|
||||
+ return (thing->flags & (MF_COUNTKILL | MF_CORPSE)) == MF_COUNTKILL;
|
||||
+ return dsda_IntConfig(dsda_config_gl_health_bar_shootables);
|
||||
+}
|
||||
+
|
||||
dboolean dsda_WipeAtFullSpeed(void) {
|
||||
return dsda_IntConfig(dsda_config_wipe_at_full_speed);
|
||||
}
|
||||
diff --git a/prboom2/src/dsda/settings.h b/prboom2/src/dsda/settings.h
|
||||
index a2fc9bf95..1988c5140 100644
|
||||
--- a/prboom2/src/dsda/settings.h
|
||||
+++ b/prboom2/src/dsda/settings.h
|
||||
@@ -50,6 +50,7 @@ dboolean dsda_ShowMinimap(void);
|
||||
dboolean dsda_ShowLevelSplits(void);
|
||||
dboolean dsda_ShowDemoAttempts(void);
|
||||
dboolean dsda_ShowHealthBars(void);
|
||||
+dboolean dsda_ShowHealthBarsForShootables(void);
|
||||
dboolean dsda_MapCoordinates(void);
|
||||
dboolean dsda_MapTotals(void);
|
||||
dboolean dsda_MapTime(void);
|
||||
diff --git a/prboom2/src/gl_intern.h b/prboom2/src/gl_intern.h
|
||||
index 0040edd1d..f55c66049 100644
|
||||
--- a/prboom2/src/gl_intern.h
|
||||
+++ b/prboom2/src/gl_intern.h
|
||||
@@ -218,6 +218,7 @@ typedef enum
|
||||
health_bar_null,
|
||||
health_bar_red,
|
||||
health_bar_yellow,
|
||||
+ health_bar_green,
|
||||
} health_bar_color_t;
|
||||
|
||||
typedef struct
|
||||
diff --git a/prboom2/src/gl_main.c b/prboom2/src/gl_main.c
|
||||
index e2458fd9f..92e5a7b38 100644
|
||||
--- a/prboom2/src/gl_main.c
|
||||
+++ b/prboom2/src/gl_main.c
|
||||
@@ -2033,12 +2033,18 @@ static void gld_DrawSprite(GLSprite *sprite)
|
||||
|
||||
static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
{
|
||||
- if (((thing->flags & (MF_COUNTKILL | MF_CORPSE)) == MF_COUNTKILL) && (thing->health > 0))
|
||||
+ if (thing->info->spawnhealth > 0 && thing->health > 0 &&
|
||||
+ gld_EvaluateShowBar(thing))
|
||||
+ bool all_shoot = dsda_ShowHealthBarsForShootables();
|
||||
+ int init_color = all_shoot ? health_bar_green : health_bar_null;
|
||||
+ bool show_bar = all_shoot ?
|
||||
+ thing->flags & MF_SHOOTABLE :
|
||||
+ (thing->flags & (MF_COUNTKILL | MF_CORPSE)) == MF_COUNTKILL;
|
||||
+
|
||||
+ if (thing->health > 0 && show_bar)
|
||||
{
|
||||
GLHealthBar hbar;
|
||||
int health_percent = thing->health * 100 / thing->info->spawnhealth;
|
||||
Index: prboom2/src/m_misc.c
|
||||
===================================================================
|
||||
--- prboom2/src/m_misc.c.orig
|
||||
+++ prboom2/src/m_misc.c
|
||||
@@ -997,6 +997,7 @@ default_t defaults[] =
|
||||
{ "screenshot_dir", { NULL, &screenshot_dir }, { 0, "" }, UL, UL, def_str, ss_none },
|
||||
{ "health_bar", { &health_bar }, { 0 }, 0, 1, def_bool, ss_stat },
|
||||
{ "health_bar_full_length", { &health_bar_full_length }, { 1 }, 0, 1, def_bool, ss_stat },
|
||||
+ { "health_bar_shootables", { &health_bar_shootables }, { 0 }, 0, 1, def_bool, ss_stat },
|
||||
{ "health_bar_red", { &health_bar_red }, { 50 }, 0, 100, def_int, ss_stat },
|
||||
{ "health_bar_yellow", { &health_bar_yellow }, { 99 }, 0, 100, def_int, ss_stat },
|
||||
{ "health_bar_green", { &health_bar_green }, { 0 }, 0, 100, def_int, ss_stat },
|
||||
Index: prboom2/src/r_things.c
|
||||
===================================================================
|
||||
--- prboom2/src/r_things.c.orig
|
||||
+++ prboom2/src/r_things.c
|
||||
@@ -75,6 +75,7 @@ int sprites_doom_order;
|
||||
int health_percent = thing->health * 100 / P_MobjSpawnHealth(thing);
|
||||
|
||||
int health_bar;
|
||||
int health_bar_full_length;
|
||||
+int health_bar_shootables;
|
||||
int health_bar_red;
|
||||
int health_bar_yellow;
|
||||
int health_bar_green;
|
||||
Index: prboom2/src/r_things.h
|
||||
===================================================================
|
||||
--- prboom2/src/r_things.h.orig
|
||||
+++ prboom2/src/r_things.h
|
||||
@@ -75,6 +75,7 @@ extern int sprites_doom_order;
|
||||
- hbar.color = health_bar_null;
|
||||
+ hbar.color = init_color;
|
||||
if (health_percent <= 50)
|
||||
hbar.color = health_bar_red;
|
||||
else if (health_percent <= 99)
|
||||
@@ -2065,10 +2071,11 @@ static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
-static GLfloat health_bar_rgb[3][3] = {
|
||||
+static GLfloat health_bar_rgb[][3] = {
|
||||
[health_bar_null] = { 0.0f, 0.0f, 0.0f },
|
||||
[health_bar_red] = { 1.0f, 0.0f, 0.0f },
|
||||
[health_bar_yellow] = { 1.0f, 1.0f, 0.0f },
|
||||
+ [health_bar_green] = { 0.0f, 1.0f, 0.0f },
|
||||
};
|
||||
|
||||
static void gld_DrawHealthBars(void)
|
||||
diff --git a/prboom2/src/m_menu.c b/prboom2/src/m_menu.c
|
||||
index fc3d22c82..7bc30508b 100644
|
||||
--- a/prboom2/src/m_menu.c
|
||||
+++ b/prboom2/src/m_menu.c
|
||||
@@ -3052,6 +3052,7 @@ setup_menu_t demo_settings[] = {
|
||||
{ "Casual Play Settings", S_SKIP | S_TITLE, m_null, G_X},
|
||||
{ "Allow Jumping", S_YESNO, m_conf, G_X, dsda_config_allow_jumping },
|
||||
{ "OpenGL Show Health Bars", S_YESNO, m_conf, G_X, dsda_config_gl_health_bar },
|
||||
+ { "All Shootables have Health Bar", S_YESNO, m_conf, G_X, dsda_config_gl_health_bar_shootables },
|
||||
|
||||
PREV_PAGE(mapping_settings),
|
||||
NEXT_PAGE(tas_settings),
|
||||
diff --git a/prboom2/src/m_misc.c b/prboom2/src/m_misc.c
|
||||
index 62b7160a1..b7cc44a72 100644
|
||||
--- a/prboom2/src/m_misc.c
|
||||
+++ b/prboom2/src/m_misc.c
|
||||
@@ -169,6 +169,7 @@ cfg_def_t cfg_defs[] =
|
||||
MIGRATED_SETTING(dsda_config_gl_render_fov),
|
||||
MIGRATED_SETTING(dsda_config_gl_skymode),
|
||||
MIGRATED_SETTING(dsda_config_gl_health_bar),
|
||||
+ MIGRATED_SETTING(dsda_config_gl_health_bar_shootables),
|
||||
MIGRATED_SETTING(dsda_config_gl_usevbo),
|
||||
MIGRATED_SETTING(dsda_config_gl_fade_mode),
|
||||
|
||||
--
|
||||
2.42.1
|
||||
|
||||
extern int health_bar;
|
||||
extern int health_bar_full_length;
|
||||
+extern int health_bar_shootables;
|
||||
extern int health_bar_red;
|
||||
extern int health_bar_yellow;
|
||||
extern int health_bar_green;
|
||||
|
@ -1,85 +1,128 @@
|
||||
From be1128c66a342ca381532ac3c6bcd286d871fdc3 Mon Sep 17 00:00:00 2001
|
||||
From bef62d87d8de7236d2a6b306c588440b885f579b Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Wed, 1 May 2013 09:53:49 +0200
|
||||
Subject: [PATCH 2/2] Implement color gradient for health bar
|
||||
References: https://github.com/coelckers/prboom-plus/pull/274
|
||||
Subject: [PATCH] Implement color gradient for health bar
|
||||
|
||||
I drew inspiration from the gradient bars from Fire Fight.
|
||||
---
|
||||
prboom2/src/gl_intern.h | 2 +-
|
||||
prboom2/src/gl_main.c | 31 +++++++++++++++++--------------
|
||||
2 files changed, 18 insertions(+), 15 deletions(-)
|
||||
prboom2/src/gl_intern.h | 11 +--------
|
||||
prboom2/src/gl_main.c | 52 ++++++++++++++++++++++++-----------------
|
||||
2 files changed, 31 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git prboom2/src/gl_intern.h prboom2/src/gl_intern.h
|
||||
index b4be8d56..8c44d9a7 100644
|
||||
--- prboom2/src/gl_intern.h
|
||||
+++ prboom2/src/gl_intern.h
|
||||
@@ -219,7 +219,7 @@ typedef struct
|
||||
diff --git a/prboom2/src/gl_intern.h b/prboom2/src/gl_intern.h
|
||||
index f55c66049..b5a0d7f83 100644
|
||||
--- a/prboom2/src/gl_intern.h
|
||||
+++ b/prboom2/src/gl_intern.h
|
||||
@@ -213,18 +213,9 @@ typedef struct
|
||||
float light;
|
||||
} GLShadow;
|
||||
|
||||
-typedef enum
|
||||
-{
|
||||
- health_bar_null,
|
||||
- health_bar_red,
|
||||
- health_bar_yellow,
|
||||
- health_bar_green,
|
||||
-} health_bar_color_t;
|
||||
-
|
||||
typedef struct
|
||||
{
|
||||
- int cm;
|
||||
+ float r,g;
|
||||
|
||||
- health_bar_color_t color;
|
||||
-
|
||||
+ float cr, cg;
|
||||
float x1, x2, x3;
|
||||
float z1, z2, z3;
|
||||
diff --git prboom2/src/gl_main.c prboom2/src/gl_main.c
|
||||
index 763bcbae..8dcb03fd 100644
|
||||
--- prboom2/src/gl_main.c
|
||||
+++ prboom2/src/gl_main.c
|
||||
@@ -2340,16 +2340,24 @@ static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
float y;
|
||||
diff --git a/prboom2/src/gl_main.c b/prboom2/src/gl_main.c
|
||||
index 92e5a7b38..b5f023c60 100644
|
||||
--- a/prboom2/src/gl_main.c
|
||||
+++ b/prboom2/src/gl_main.c
|
||||
@@ -2034,24 +2034,41 @@ static void gld_DrawSprite(GLSprite *sprite)
|
||||
static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
{
|
||||
bool all_shoot = dsda_ShowHealthBarsForShootables();
|
||||
- int init_color = all_shoot ? health_bar_green : health_bar_null;
|
||||
bool show_bar = all_shoot ?
|
||||
thing->flags & MF_SHOOTABLE :
|
||||
(thing->flags & (MF_COUNTKILL | MF_CORPSE)) == MF_COUNTKILL;
|
||||
+ /*
|
||||
+ * These were called "health_bar_red", "health_bar_yellow" and
|
||||
+ * "health_bar_green", respectively, in prboom-plus. I have given
|
||||
+ * them some better names. —j.eng
|
||||
+ */
|
||||
+ static const int orange_ramp_end = 50;
|
||||
+ static const int chartreuse_ramp_end = 99;
|
||||
+ static const int green_end = 100;
|
||||
|
||||
if (thing->health > 0 && show_bar)
|
||||
{
|
||||
GLHealthBar hbar;
|
||||
int health_percent = thing->health * 100 / thing->info->spawnhealth;
|
||||
+ int yr = health_bar_yellow - health_bar_red;
|
||||
int health_percent = thing->health * 100 / P_MobjSpawnHealth(thing);
|
||||
+ int yr = chartreuse_ramp_end - orange_ramp_end;
|
||||
|
||||
- hbar.cm = -1;
|
||||
- if (health_percent <= health_bar_red)
|
||||
- hbar.cm = CR_RED;
|
||||
- else if (health_percent <= health_bar_yellow)
|
||||
- hbar.cm = CR_YELLOW;
|
||||
- else if (health_percent <= health_bar_green)
|
||||
- hbar.cm = CR_GREEN;
|
||||
+ hbar.r = hbar.g = -1.0f;
|
||||
+ if (health_percent <= 0) {
|
||||
+ hbar.r = 1.0f;
|
||||
+ hbar.g = 0.0f;
|
||||
+ } else if (health_percent <= health_bar_red) {
|
||||
+ hbar.r = 1.0f;
|
||||
+ hbar.g = yr == 0 ? 0 : (float)health_percent / yr;
|
||||
+ } else if (health_percent <= health_bar_yellow) {
|
||||
+ hbar.r = yr == 0 ? 1 : (float)(health_bar_yellow - health_percent) / yr;
|
||||
+ hbar.g = 1.0f;
|
||||
+ } else if (health_percent <= health_bar_green) {
|
||||
+ hbar.r = 0.0f;
|
||||
+ hbar.g = 1.0f;
|
||||
- hbar.color = init_color;
|
||||
- if (health_percent <= 50)
|
||||
- hbar.color = health_bar_red;
|
||||
- else if (health_percent <= 99)
|
||||
- hbar.color = health_bar_yellow;
|
||||
+ hbar.cr = -1;
|
||||
+ if (!all_shoot && health_percent == 100) {
|
||||
+ } else if (health_percent <= 0) {
|
||||
+ hbar.cr = 1;
|
||||
+ hbar.cg = 0;
|
||||
+ } else if (health_percent <= orange_ramp_end) {
|
||||
+ hbar.cr = 1;
|
||||
+ hbar.cg = yr == 0 ? 0 : (float)health_percent / yr;
|
||||
+ } else if (health_percent <= chartreuse_ramp_end) {
|
||||
+ hbar.cr = yr == 0 ? 1 : (float)(chartreuse_ramp_end - health_percent) / yr;
|
||||
+ hbar.cg = 1;
|
||||
+ } else if (health_percent <= green_end) {
|
||||
+ hbar.cr = 0;
|
||||
+ hbar.cg = 1;
|
||||
+ }
|
||||
|
||||
- if (hbar.cm >= 0)
|
||||
+ if (hbar.r >= 0 && hbar.g >= 0)
|
||||
{
|
||||
- if (hbar.color != health_bar_null)
|
||||
- {
|
||||
+ if (hbar.cr >= 0) {
|
||||
float sx2 = (float)thing->radius / 2.0f / MAP_SCALE;
|
||||
float sx1 = sx2 - (float)health_percent * (float)thing->radius / 100.0f / MAP_SCALE;
|
||||
@@ -2373,7 +2381,6 @@ static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
float sx3 = -sx2;
|
||||
@@ -2071,17 +2088,10 @@ static void gld_AddHealthBar(mobj_t* thing, GLSprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
-static GLfloat health_bar_rgb[][3] = {
|
||||
- [health_bar_null] = { 0.0f, 0.0f, 0.0f },
|
||||
- [health_bar_red] = { 1.0f, 0.0f, 0.0f },
|
||||
- [health_bar_yellow] = { 1.0f, 1.0f, 0.0f },
|
||||
- [health_bar_green] = { 0.0f, 1.0f, 0.0f },
|
||||
-};
|
||||
-
|
||||
static void gld_DrawHealthBars(void)
|
||||
{
|
||||
int i, count;
|
||||
- int cm = -1;
|
||||
- int color = health_bar_null;
|
||||
+ float cr = -1, cg = -1;
|
||||
|
||||
count = gld_drawinfo.num_items[GLDIT_HBAR];
|
||||
if (count > 0)
|
||||
@@ -2384,11 +2391,7 @@ static void gld_DrawHealthBars(void)
|
||||
@@ -2092,12 +2102,10 @@ static void gld_DrawHealthBars(void)
|
||||
for (i = count - 1; i >= 0; i--)
|
||||
{
|
||||
GLHealthBar *hbar = gld_drawinfo.items[GLDIT_HBAR][i].item.hbar;
|
||||
- if (hbar->cm != cm)
|
||||
- if (hbar->color != color)
|
||||
- {
|
||||
- cm = hbar->cm;
|
||||
- glColor4f(cm2RGB[cm][0], cm2RGB[cm][1], cm2RGB[cm][2], 1.0f);
|
||||
- }
|
||||
+ glColor4f(hbar->r, hbar->g, 0.0f, 1.0f);
|
||||
- color = hbar->color;
|
||||
- glColor4f(health_bar_rgb[color][0],
|
||||
- health_bar_rgb[color][1],
|
||||
- health_bar_rgb[color][2], 1.0f);
|
||||
+ if (hbar->cr != cr || hbar->cg != cg) {
|
||||
+ cr = hbar->cr;
|
||||
+ cg = hbar->cg;
|
||||
+ glColor4f(cr, cg, 0, 1);
|
||||
}
|
||||
|
||||
glVertex3f(hbar->x1, hbar->y, hbar->z1);
|
||||
glVertex3f(hbar->x2, hbar->y, hbar->z2);
|
||||
--
|
||||
2.31.1
|
||||
2.42.1
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 2bf8068e0cd916b39fd2c57f3c9bf582b0fc45d8 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sun, 19 Feb 2012 07:16:45 +0100
|
||||
Subject: [PATCH] Drop __DATE__/__TIME__ / enable reproducible builds
|
||||
|
||||
---
|
||||
prboom2/src/version.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git prboom2/src/version.c prboom2/src/version.c
|
||||
index 1f5401f2..2cc173f6 100644
|
||||
--- prboom2/src/version.c
|
||||
+++ prboom2/src/version.c
|
||||
@@ -37,11 +37,11 @@
|
||||
#include "version.h"
|
||||
|
||||
#ifndef BUILD_DATE
|
||||
-#define BUILD_DATE __DATE__
|
||||
+#define BUILD_DATE ""
|
||||
#endif
|
||||
|
||||
#ifndef BUILD_TIME
|
||||
-#define BUILD_TIME __TIME__
|
||||
+#define BUILD_TIME ""
|
||||
#endif
|
||||
|
||||
const char version_date[] = BUILD_DATE " " BUILD_TIME;
|
||||
--
|
||||
2.30.2
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4cfc82eea029068329d6b6a2dcbe0b316b31a60af12e6dc5ad3e1d2c359d913
|
||||
size 5605081
|
3
v0.27.3.tar.gz
Normal file
3
v0.27.3.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:956194c5dbbd8be5b62ca93cb975a6dbacdfc3ca97165c4da65a07843092b297
|
||||
size 11112601
|
Loading…
Reference in New Issue
Block a user