Skip to content

Commit

Permalink
Merge branch 'master' into nughud_additions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed May 1, 2024
2 parents d783ee1 + b6042c9 commit e17f589
Show file tree
Hide file tree
Showing 98 changed files with 4,329 additions and 4,237 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
libsndfile1-dev \
libfluidsynth-dev \
libxmp-dev
sudo sed -e 's/jammy/lunar/g;s/22/23/g' -i /etc/apt/sources.list /etc/apt/sources.list.d/*
sudo apt-get update
sudo apt-get install \
libflac-dev \
libsndfile1-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/win_msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Latest CMake and Ninja
uses: lukka/get-cmake@latest

- name: Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -45,9 +48,6 @@ jobs:
set -euo pipefail
cd "${{ env.VCPKG_DIR }}"
git fetch --tags
LATESTTAG=$(git describe --tags --abbrev=0)
git checkout $LATESTTAG
NUGET=$(vcpkg fetch nuget | tail -n 1)
GH_PACKAGES_URL="https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## New Features

- **Merged changes from [Woof! 14.5.0](https://github.com/fabiangreffrath/woof/releases/tag/woof_14.5.0)**, note:
- Removed Nugget's `all` autoload folder in favor of Woof's `all-all`
- Changed `nughud_secret_y` default to match default Boom HUD
- **_Level Stats Format_** settings
- Removed _Kills % in Stats display_ setting in favor of them
- **Minimap zooming** (keyboard only)
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ find_package(SDL2 2.0.18 REQUIRED)
find_package(SDL2_net REQUIRED)
find_package(OpenAL REQUIRED)
find_package(SndFile 1.0.29 REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(ALSA REQUIRED)
endif()

if(ALSA_FOUND)
set(HAVE_ALSA TRUE)
endif()

if(OPENAL_VERSION_STRING VERSION_GREATER_EQUAL "1.22.0")
set(HAVE_AL_BUFFER_CALLBACK TRUE)
Expand Down
33 changes: 33 additions & 0 deletions autoload/all-all/woofhud.lmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
hud 0
rate topleft
monsec topleft
sttime topleft
powers topright
coord topright
fps topright

hud 1
rate topleft
armor bottomleft
health bottomleft
ammo bottomleft
weapon bottomleft
keys bottomleft
monsec bottomleft
sttime bottomleft
powers topright
coord topright
fps topright

hud 2
rate topleft
health topright
armor topright
ammo bottomright
weapon bottomright
keys bottomleft
monsec bottomleft
sttime bottomleft
powers topright
coord topright
fps topright
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#cmakedefine HAVE_DIRENT_H
#cmakedefine01 HAVE_DECL_STRCASECMP
#cmakedefine01 HAVE_DECL_STRNCASECMP
#cmakedefine HAVE_ALSA
#cmakedefine HAVE_FLUIDSYNTH
#cmakedefine HAVE_LIBXMP
#cmakedefine HAVE_SNDFILE_MPEG
Expand Down
2 changes: 1 addition & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
string(TIMESTAMP PROJECT_DATE "%Y-%m-%d")
string(TIMESTAMP PROJECT_DATE "%Y-%m-%d" UTC)

configure_file(io.github.MrAlaux.Nugget-Doom.metainfo.in
io.github.MrAlaux.Nugget-Doom.metainfo.xml
Expand Down
2 changes: 1 addition & 1 deletion docs/nughud.lmp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ nughud_message_defx 1

; Secret Message/Milestone Completion display
nughud_secret_x 160
nughud_secret_y 84
nughud_secret_y 42
nughud_secret_wide 0
nughud_secret_align 0
nughud_secret_stack 1
Expand Down
2 changes: 1 addition & 1 deletion setup/multiplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef enum
// Fallback IWADs to use if no IWADs are detected.

static const iwad_t fallback_iwads[] = {
{ "doom.wad", doom, retail, vanilla, "Doom" }
{ "doom.wad", doom, retail, "Doom" }
};

// Array of IWADs found to be installed
Expand Down
13 changes: 10 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(NUGGETDOOM_SOURCES
i_input.c i_input.h
i_main.c
i_mbfsound.c
i_midimusic.c
i_oalmusic.c
i_oalsound.c i_oalsound.h
i_oalstream.h
Expand Down Expand Up @@ -68,6 +69,7 @@ set(NUGGETDOOM_SOURCES
memio.c memio.h
midifallback.c midifallback.h
midifile.c midifile.h
midiout.c midiout.h
mus2mid.c mus2mid.h
nano_bsp.c nano_bsp.h
net_client.c net_client.h
Expand Down Expand Up @@ -187,7 +189,6 @@ if(HAVE_AL_BUFFER_CALLBACK)
endif()

if(WIN32)
target_sources(nugget-doom PRIVATE i_winmusic.c)
target_include_directories(nugget-doom PRIVATE "../win32")
target_link_libraries(nugget-doom PRIVATE winmm)
if(MSVC)
Expand All @@ -197,9 +198,15 @@ if(WIN32)
endif()

if(APPLE)
target_sources(nugget-doom PRIVATE i_macmusic.c)
target_link_libraries(nugget-doom PRIVATE
-Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices)
-Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit
-Wl,-framework,CoreServices -Wl,-framework,CoreAudio
-Wl,-framework,CoreMIDI)
endif()

if(ALSA_FOUND)
target_include_directories(nugget-doom PRIVATE ${ALSA_INCLUDE_DIR})
target_link_libraries(nugget-doom PRIVATE ALSA::ALSA)
endif()

if(FluidSynth_FOUND)
Expand Down
34 changes: 30 additions & 4 deletions src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ static void AM_initScreenSize(void)
if (automapoverlay && scaledviewheight == SCREENHEIGHT)
f_h = video.height;
else
f_h = video.height - V_ScaleY(ST_HEIGHT);
f_h = V_ScaleY(SCREENHEIGHT - ST_HEIGHT);
}

void AM_ResetScreenSize(void)
Expand Down Expand Up @@ -1801,6 +1801,17 @@ static int AM_DoorColor(int type)
// jff 4/3/98 changed mapcolor_xxxx=-1 to disable drawing line completely
//

#define M_ARRAY_INIT_CAPACITY 500
#include "m_array.h"

typedef struct
{
mline_t l;
int color;
} am_line_t;

static am_line_t *lines_1S = NULL;

// [Nugget] Tag Finder from PrBoomX: Prototype this function
static void AM_drawLineCharacter(mline_t*, int, fixed_t, angle_t, int, fixed_t, fixed_t);

Expand Down Expand Up @@ -1893,16 +1904,25 @@ static void AM_drawWalls(void)
P_IsSecret(lines[i].frontsector)
)
)
AM_drawMline(&l, mapcolor_secr); // line bounding secret sector
{
// line bounding secret sector
array_push(lines_1S, ((am_line_t){l, mapcolor_secr}));
}
else if (mapcolor_revsecr &&
(
P_WasSecret(lines[i].frontsector) &&
!P_IsSecret(lines[i].frontsector)
)
)
AM_drawMline(&l, mapcolor_revsecr); // line bounding revealed secret sector
{
// line bounding revealed secret sector
array_push(lines_1S, ((am_line_t){l, mapcolor_revsecr}));
}
else //jff 2/16/98 fixed bug
AM_drawMline(&l, mapcolor_wall); // special was cleared
{
// special was cleared
array_push(lines_1S, ((am_line_t){l, mapcolor_wall}));
}
}
else
{
Expand Down Expand Up @@ -2023,6 +2043,12 @@ static void AM_drawWalls(void)
}
}
}

for (int i = 0; i < array_size(lines_1S); ++i)
{
AM_drawMline(&lines_1S[i].l, lines_1S[i].color);
}
array_clear(lines_1S);
}

//
Expand Down
36 changes: 33 additions & 3 deletions src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,10 +2375,10 @@ void deh_procSounds(DEHFILE *fpin, FILE* fpout, char *line)
; // ignored
else
if (!strcasecmp(key,deh_sfxinfo[4])) // Zero 2
S_sfx[indexnum].pitch = value;
; // ignored
else
if (!strcasecmp(key,deh_sfxinfo[5])) // Zero 3
S_sfx[indexnum].volume = value;
; // ignored
else
if (!strcasecmp(key,deh_sfxinfo[6])) // Zero 4
; // ignored
Expand Down Expand Up @@ -2601,7 +2601,7 @@ void deh_procPars(DEHFILE *fpin, FILE* fpout, char *line) // extension
while (!dehfeof(fpin) && *inbuffer && (*inbuffer != ' '))
{
if (!dehfgets(inbuffer, sizeof(inbuffer), fpin)) break;
M_ForceLowercase(inbuffer); // lowercase it
M_StringToLower(inbuffer); // lowercase it
lfstrip(inbuffer);
if (!*inbuffer) break; // killough 11/98
if (3 != sscanf(inbuffer,"par %i %i %i",&episode, &level, &partime))
Expand Down Expand Up @@ -2970,6 +2970,32 @@ void deh_procError(DEHFILE *fpin, FILE* fpout, char *line)
return;
}

// [FG] Obituaries
static boolean deh_procObituarySub(char *key, char *newstring)
{
boolean found = false;
int actor = -1;

if (sscanf(key, "Obituary_Deh_Actor_%d", &actor) == 1)
{
if (actor >= 0 && actor < num_mobj_types)
{
if (M_StringEndsWith(key, "_Melee"))
{
mobjinfo[actor].obituary_melee = strdup(newstring);
}
else
{
mobjinfo[actor].obituary = strdup(newstring);
}

found = true;
}
}

return found;
}

// ====================================================================
// deh_procStrings
// Purpose: Handle BEX [STRINGS] extension
Expand Down Expand Up @@ -3039,6 +3065,10 @@ void deh_procStrings(DEHFILE *fpin, FILE* fpout, char *line)
// go process the current string
found = deh_procStringSub(key, NULL, holdstring, fpout); // supply keyand not search string

// [FG] Obituaries
if (!found)
found = deh_procObituarySub(key, holdstring);

if (!found)
if (fpout) fprintf(fpout,
"Invalid string key '%s', substitution skipped.\n",key);
Expand Down
44 changes: 25 additions & 19 deletions src/d_iwad.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,17 @@
#include "m_misc.h"

static const iwad_t iwads[] = {
{"doom2.wad", doom2, commercial, vanilla, "Doom II" },
{"plutonia.wad", pack_plut, commercial, vanilla,
"Final Doom: Plutonia Experiment" },
{"tnt.wad", pack_tnt, commercial, vanilla, "Final Doom: TNT: Evilution"},
// "doom.wad" may be retail or registered
{"doom.wad", doom, indetermined, vanilla, "Doom" },
{"doom1.wad", doom, indetermined, vanilla, "Doom Shareware" },
{"doom2f.wad", doom2, commercial, vanilla, "Doom II: L'Enfer sur Terre"},
{"chex.wad", pack_chex, retail, vanilla, "Chex Quest" },
{"hacx.wad", pack_hacx, commercial, vanilla, "Hacx" },
{"freedoom2.wad", doom2, commercial, freedoom, "Freedoom: Phase 2" },
{"freedoom1.wad", doom, retail, freedoom, "Freedoom: Phase 1" },
{"freedm.wad", doom2, commercial, freedoom, "FreeDM" },
{"rekkrsa.wad", pack_rekkr, retail, vanilla, "REKKR" },
{"rekkrsl.wad", pack_rekkr, retail, vanilla, "REKKR: Sunken Land" },
{"miniwad.wad", doom2, commercial, miniwad, "miniwad" }
{"doom2.wad", doom2, commercial, "Doom II" },
{"plutonia.wad", pack_plut, commercial, "Final Doom: Plutonia Experiment"},
{"tnt.wad", pack_tnt, commercial, "Final Doom: TNT: Evilution" },
// "doom.wad" may be retail or registered
{"doom.wad", doom, indetermined, "Doom" },
{"doom1.wad", doom, indetermined, "Doom Shareware" },
{"doom2f.wad", doom2, commercial, "Doom II: L'Enfer sur Terre" },
{"chex.wad", pack_chex, retail, "Chex Quest" },
{"hacx.wad", pack_hacx, commercial, "Hacx" },
{"rekkrsa.wad", pack_rekkr, retail, "REKKR" },
{"rekkrsl.wad", pack_rekkr, retail, "REKKR: Sunken Land" },
};

// "128 IWAD search directories should be enough for anybody".
Expand Down Expand Up @@ -727,8 +722,7 @@ char *D_TryFindWADByName(const char *filename)
// D_FindIWADFile
//

char *D_FindIWADFile(GameMode_t *mode, GameMission_t *mission,
GameVariant_t *variant)
char *D_FindIWADFile(GameMode_t *mode, GameMission_t *mission)
{
char *result;

Expand Down Expand Up @@ -784,7 +778,6 @@ char *D_FindIWADFile(GameMode_t *mode, GameMission_t *mission,
{
*mode = iwads[i].mode;
*mission = iwads[i].mission;
*variant = iwads[i].variant;
break;
}
}
Expand Down Expand Up @@ -837,3 +830,16 @@ const iwad_t **D_GetIwads(void)

return result;
}

GameMission_t D_GetGameMissionByIWADName(const char *name)
{
for (int i = 0; i < arrlen(iwads); ++i)
{
if (!strcasecmp(name, iwads[i].name))
{
return iwads[i].mission;
}
}

return none;
}
5 changes: 2 additions & 3 deletions src/d_iwad.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ typedef struct
const char *name;
GameMission_t mission;
GameMode_t mode;
GameVariant_t variant;
const char *description;
} iwad_t;

char *D_DoomExeDir(void); // killough 2/16/98: path to executable's dir
char *D_FindWADByName(const char *filename);
char *D_TryFindWADByName(const char *filename);
char *D_FindIWADFile(GameMode_t *mode, GameMission_t *mission,
GameVariant_t *variant);
char *D_FindIWADFile(GameMode_t *mode, GameMission_t *mission);
boolean D_IsIWADName(const char *name);
const iwad_t **D_GetIwads(void);
GameMission_t D_GetGameMissionByIWADName(const char *name);

#endif
Loading

0 comments on commit e17f589

Please sign in to comment.