Skip to content

Commit

Permalink
Merge branch 'master' into example/damage-skins
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Aug 18, 2024
2 parents 7e43dac + 87ea5a0 commit 7334782
Show file tree
Hide file tree
Showing 29 changed files with 750 additions and 134 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build
on: [push, pull_request]

jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Compile
run: make release
env:
ARCHIVE: 1
- uses: actions/upload-artifact@v4
with:
name: Linux
path: build/*.zip
windows:
name: Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Compile
run: |
choco install zip
make release
env:
ARCHIVE: 1
- uses: actions/upload-artifact@v4
with:
name: Windows
path: build/*.zip
macos:
name: macOS
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Compile
run: make release
env:
ARCHIVE: 1
- uses: actions/upload-artifact@v4
with:
name: macOS
path: build/*.zip
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

53 changes: 48 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ endif
ifndef BUILD_BASEGAME
BUILD_BASEGAME =
endif
ifndef USE_BASEGAME_MP_HUD
USE_BASEGAME_MP_HUD =
endif
ifndef BUILD_MISSIONPACK
BUILD_MISSIONPACK=
endif
ifndef USE_MISSIONPACK_Q3_UI
USE_MISSIONPACK_Q3_UI =
endif
ifndef USE_MISSIONPACK_MP_HUD
USE_MISSIONPACK_MP_HUD = 1
endif
ifndef BUILD_FINAL
BUILD_FINAL =0
endif
Expand Down Expand Up @@ -115,6 +121,10 @@ endif

ifndef BASEGAME_CFLAGS
BASEGAME_CFLAGS=

ifeq ($(USE_BASEGAME_MP_HUD), 1)
BASEGAME_CFLAGS+=-DMISSIONPACK_HUD
endif
endif

BASEGAME_CFLAGS+=-DMODDIR=\"$(BASEGAME)\" -DBASETA=\"$(MISSIONPACK)\"
Expand All @@ -124,10 +134,10 @@ MISSIONPACK=missionpack
endif

ifndef MISSIONPACK_CFLAGS
ifeq ($(USE_MISSIONPACK_Q3_UI), 1)
MISSIONPACK_CFLAGS=-DMISSIONPACK
else
MISSIONPACK_CFLAGS=-DMISSIONPACK -DMISSIONPACK_HUD

ifeq ($(USE_MISSIONPACK_MP_HUD), 1)
MISSIONPACK_CFLAGS+=-DMISSIONPACK_HUD
endif
endif

Expand Down Expand Up @@ -423,7 +433,19 @@ ifdef MINGW

ifeq ($(COMPILE_PLATFORM),cygwin)
TOOLS_BINEXT=.exe
TOOLS_CC=$(CC)

# Under cygwin the default of using gcc for TOOLS_CC won't work, so
# we need to figure out the appropriate compiler to use, based on the
# host architecture that we're running under (as tools run on the host)
ifeq ($(COMPILE_ARCH),x86_64)
TOOLS_MINGW_PREFIXES=x86_64-w64-mingw32 amd64-mingw32msvc
endif
ifeq ($(COMPILE_ARCH),x86)
TOOLS_MINGW_PREFIXES=i686-w64-mingw32 i586-mingw32msvc i686-pc-mingw32
endif

TOOLS_CC=$(firstword $(strip $(foreach TOOLS_MINGW_PREFIX, $(TOOLS_MINGW_PREFIXES), \
$(call bin_path, $(TOOLS_MINGW_PREFIX)-gcc))))
endif

LIBS= -lws2_32 -lwinmm -lpsapi
Expand All @@ -442,6 +464,8 @@ else # ifdef MINGW
#############################################################################

ifeq ($(PLATFORM),freebsd)
# Use the default C compiler
TOOLS_CC=cc

# flags
BASE_CFLAGS = \
Expand Down Expand Up @@ -648,7 +672,6 @@ endif

ifneq ($(HAVE_VM_COMPILED),true)
BASE_CFLAGS += -DNO_VM_COMPILED
BUILD_GAME_QVM=0
endif

TARGETS =
Expand Down Expand Up @@ -823,6 +846,9 @@ endif
@echo " CFLAGS:"
$(call print_wrapped, $(CFLAGS) $(OPTIMIZE))
@echo ""
@echo " TOOLS_CFLAGS:"
$(call print_wrapped, $(TOOLS_CFLAGS))
@echo ""
@echo " LDFLAGS:"
$(call print_wrapped, $(LDFLAGS))
@echo ""
Expand All @@ -849,6 +875,7 @@ makedirs:
@$(MKDIR) $(B)/$(BASEGAME)/botlib
@$(MKDIR) $(B)/$(BASEGAME)/game
@$(MKDIR) $(B)/$(BASEGAME)/ui
@$(MKDIR) $(B)/$(BASEGAME)/mpui
@$(MKDIR) $(B)/$(BASEGAME)/qcommon
@$(MKDIR) $(B)/$(BASEGAME)/vm
@$(MKDIR) $(B)/$(MISSIONPACK)/cgame
Expand Down Expand Up @@ -1134,6 +1161,11 @@ Q3CGOBJ = \
$(B)/$(BASEGAME)/qcommon/q_shared.o \
$(B)/$(BASEGAME)/qcommon/q_unicode.o

ifeq ($(USE_BASEGAME_MP_HUD), 1)
Q3CGOBJ += \
$(B)/$(BASEGAME)/mpui/ui_shared.o
endif

Q3CGVMOBJ = $(Q3CGOBJ:%.o=%.asm)

$(B)/$(BASEGAME)/$(VM_PREFIX)cgame_$(SHLIBNAME): $(Q3CGOBJ)
Expand Down Expand Up @@ -1232,6 +1264,11 @@ MPCGOBJ += \
$(B)/$(MISSIONPACK)/q3ui/ui_team.o \
$(B)/$(MISSIONPACK)/q3ui/ui_teamorders.o \
$(B)/$(MISSIONPACK)/q3ui/ui_video.o

ifeq ($(USE_MISSIONPACK_MP_HUD), 1)
MPCGOBJ += \
$(B)/$(MISSIONPACK)/ui/ui_shared.o
endif
else
MPCGOBJ += \
$(B)/$(MISSIONPACK)/ui/ui_main.o \
Expand Down Expand Up @@ -1442,6 +1479,9 @@ $(B)/$(BASEGAME)/cgame/%.o: $(CGDIR)/%.c
$(B)/$(BASEGAME)/ui/%.o: $(Q3UIDIR)/%.c
$(DO_CGAME_CC)

$(B)/$(BASEGAME)/mpui/%.o: $(UIDIR)/%.c
$(DO_CGAME_CC)

$(B)/$(BASEGAME)/cgame/bg_%.asm: $(GDIR)/bg_%.c $(Q3LCC)
$(DO_CGAME_Q3LCC)

Expand All @@ -1451,6 +1491,9 @@ $(B)/$(BASEGAME)/cgame/%.asm: $(CGDIR)/%.c $(Q3LCC)
$(B)/$(BASEGAME)/ui/%.asm: $(Q3UIDIR)/%.c $(Q3LCC)
$(DO_CGAME_Q3LCC)

$(B)/$(BASEGAME)/mpui/%.asm: $(UIDIR)/%.c $(Q3LCC)
$(DO_CGAME_Q3LCC)

$(B)/$(MISSIONPACK)/cgame/bg_%.o: $(GDIR)/bg_%.c
$(DO_CGAME_CC_MISSIONPACK)

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ If you put both projects in the same directory you can launch the game using;

On Linux and OS X you'll need to put `./` before the command and substitute the correct platform and architecture (look in the build directory).

## License

mint-arena is licensed under a [modified version of the GNU GPLv3](COPYING.txt#L625) (or at your option, any later version). This is due to including code from Return to Castle Wolfenstein and Wolfenstein: Enemy Territory.

Submitted contributions must be given with permission to use as GPLv**2** (two) and any later version; unless the file is under a license besides the GPL, in which case that license applies. This allows me to potentially change the license to GPLv2 or later in the future.
2 changes: 1 addition & 1 deletion code/botlib/be_aas.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ typedef struct aas_predictroute_s
int endcontents; //contents at the end of movement prediction
int endtravelflags; //end travel flags
int numareas; //number of areas predicted ahead
int time; //time predicted ahead (in hundreth of a sec)
int time; //time predicted ahead (in hundredths of a sec)
} aas_predictroute_t;
2 changes: 1 addition & 1 deletion code/botlib/be_aas_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void AAS_FileInfo(void)
aasworld.reachabilitysize * sizeof(aas_reachability_t) +
aasworld.numportals * sizeof(aas_portal_t) +
aasworld.numclusters * sizeof(aas_cluster_t);
botimport.Print(PRT_MESSAGE, "optimzed size %d KB\n", optimized >> 10);
botimport.Print(PRT_MESSAGE, "optimized size %d KB\n", optimized >> 10);
} //end of the function AAS_FileInfo
#endif //AASFILEDEBUG
//===========================================================================
Expand Down
17 changes: 15 additions & 2 deletions code/cgame/cg_consolecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Suite 120, Rockville, Maryland 20850 USA.

#include "cg_local.h"
#include "../ui/ui_public.h"
#ifdef MISSIONPACK
#if defined MISSIONPACK || defined MISSIONPACK_HUD
#include "../ui/ui_shared.h"
#endif
#ifdef MISSIONPACK_HUD
Expand Down Expand Up @@ -754,29 +754,37 @@ static void CG_VoiceTellAttacker_f( int localPlayerNum ) {
Com_sprintf( command, sizeof( command ), "%s %i %s", Com_LocalPlayerCvarName( localPlayerNum, "vtell" ), playerNum, message );
trap_SendClientCommand( command );
}
#endif

#ifdef MISSIONPACK_HUD
static void CG_NextTeamMember_f( int localPlayerNum ) {
CG_SelectNextPlayer( localPlayerNum );
}

static void CG_PrevTeamMember_f( int localPlayerNum ) {
CG_SelectPrevPlayer( localPlayerNum );
}
#endif

#ifdef MISSIONPACK

// ASS U ME's enumeration order as far as task specific orders, OFFENSE is zero, CAMP is last
//
static void CG_NextOrder_f( int localPlayerNum ) {
localPlayer_t *player;
#ifdef MISSIONPACK_HUD
playerInfo_t *pi;
int playerNum;
int team;
#endif

player = &cg.localPlayers[ localPlayerNum ];

if ( player->playerNum == -1 ) {
return;
}

#ifdef MISSIONPACK_HUD
playerNum = cg.snap->pss[ localPlayerNum ].playerNum;
team = cg.snap->pss[ localPlayerNum ].persistant[PERS_TEAM];

Expand All @@ -787,6 +795,7 @@ static void CG_NextOrder_f( int localPlayerNum ) {
return;
}
}
#endif
if (player->currentOrder < TEAMTASK_CAMP) {
player->currentOrder++;

Expand Down Expand Up @@ -1574,9 +1583,9 @@ static consoleCommand_t cg_commands[] = {
#ifdef MISSIONPACK
{ "spWin", CG_spWin_f, CMD_INGAME },
{ "spLose", CG_spLose_f, CMD_INGAME },
#endif
#ifdef MISSIONPACK_HUD
{ "loadhud", CG_LoadHud_f, CMD_INGAME },
#endif
#endif
{ "startOrbit", CG_StartOrbit_f, CMD_INGAME },
//{ "camera", CG_Camera_f, CMD_INGAME },
Expand Down Expand Up @@ -1684,8 +1693,12 @@ static playerConsoleCommand_t playerCommands[] = {
#ifdef MISSIONPACK
{ "vtell_target", CG_VoiceTellTarget_f, CMD_INGAME, CG_VoiceSayComplete },
{ "vtell_attacker", CG_VoiceTellAttacker_f, CMD_INGAME, CG_VoiceSayComplete },
#endif
#ifdef MISSIONPACK_HUD
{ "nextTeamMember", CG_NextTeamMember_f, CMD_INGAME },
{ "prevTeamMember", CG_PrevTeamMember_f, CMD_INGAME },
#endif
#ifdef MISSIONPACK
{ "nextOrder", CG_NextOrder_f, CMD_INGAME },
{ "confirmOrder", CG_ConfirmOrder_f, CMD_INGAME },
{ "denyOrder", CG_DenyOrder_f, CMD_INGAME },
Expand Down
2 changes: 2 additions & 0 deletions code/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2787,13 +2787,15 @@ CG_DrawTimedMenus
=================
*/
void CG_DrawTimedMenus( qboolean *voiceMenuOpen ) {
#ifdef MISSIONPACK
if ( cg.cur_lc->voiceTime && cg.cur_lc->voiceTime >= cg.time && cg.cur_lc->playerNum != cg.cur_lc->currentVoicePlayerNum ) {
Menus_OpenByName("voiceMenu");
*voiceMenuOpen = qtrue;
} else {
Menus_CloseByName("voiceMenu");
*voiceMenuOpen = qfalse;
}
#endif
}
#endif
/*
Expand Down
Loading

0 comments on commit 7334782

Please sign in to comment.