Skip to content

Commit

Permalink
Merge branch 'main' into fix-release-build
Browse files Browse the repository at this point in the history
  • Loading branch information
JeodC authored Apr 24, 2024
2 parents a03489c + 155211b commit 3daf5b2
Show file tree
Hide file tree
Showing 125 changed files with 529 additions and 4,426 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ jobs:
run: |
sudo apt update
sudo apt install -y --no-install-recommends \
ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev
ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev zlib1g-dev
- name: Configure CMake
env:
CC: ${{ matrix.os.cc }}
CXX: ${{ matrix.os.cxx }}
VCPKG_ROOT: C:/vcpkg
run: cmake --preset ${{ matrix.os.preset }}

- name: Debug Build
Expand Down
4 changes: 3 additions & 1 deletion 2dlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ set(CPPS
viewport.cpp)

add_library(2dlib STATIC ${HEADERS} ${CPPS})

target_link_libraries(2dlib PRIVATE
cfile
)
2 changes: 1 addition & 1 deletion 2dlib/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#include "renderer.h"
#include "gr.h"
#include "mono.h"
#include "CFILE.H"
#include "cfile.h"
#include "bitmap.h"
#include "mem.h"

Expand Down
3 changes: 3 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ brew "sdl2_image"

brew "cmake"
brew "ninja"

# zlib
brew "zlib"
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.20) # For using CMAKE_<LANG>_BYTE_ORDER

project(Descent3 VERSION 1.5.500)

Expand All @@ -13,6 +13,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
message(STATUS "Big Endian system detected.")
add_definitions("-DOUTRAGE_BIG_ENDIAN")
endif()

if(BUILD_TESTING)
find_package(GTest REQUIRED)
enable_testing()
include(GoogleTest)
add_subdirectory(tests)
endif()

if(NOT MSVC)
# check if this is some kind of clang (Clang, AppleClang, whatever)
# (convert compiler ID to lowercase so we match Clang, clang, AppleClang etc, regardless of case)
Expand Down Expand Up @@ -102,12 +114,19 @@ endif()
add_compile_definitions($<$<CONFIG:Release>:RELEASE>)
add_compile_definitions($<$<CONFIG:Debug>:_DEBUG>)

find_package(ZLIB REQUIRED)

if(LOGGER)
message("Enabling Logging")
add_definitions(-DLOGGER)
endif()

include_directories("lib" "Descent3" ${PLATFORM_INCLUDES})
include_directories(
"cfile" # TODO: Remove after untying all modules
"lib" # TODO: Remove after untying all modules
"Descent3"
${PLATFORM_INCLUDES}
)

# file(GLOB_RECURSE INCS "*.h")

Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"architecture": "Win32"
"architecture": "Win32",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "mac",
Expand Down
4 changes: 2 additions & 2 deletions Descent3/BriefingParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "CFILE.H"
#include "cfile.h"
#include "pserror.h"
#include "game.h"
#include "mem.h"
Expand Down Expand Up @@ -242,7 +242,7 @@ int ReadFullLine(char **data, CFILE *ifile) {
// read in a byte
c = cfgetc(ifile);

if ((c == EOF) || (!(ifile->flags & CF_TEXT) && (c == 0)) || ((ifile->flags & CF_TEXT) && (c == '\n'))) {
if ((c == EOF) || (!(ifile->flags & CFF_TEXT) && (c == 0)) || ((ifile->flags & CFF_TEXT) && (c == '\n'))) {
// we've hit the end of the line
done = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion Descent3/ConfigItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#include "ddio.h"
#include "gamefont.h"
#include "multi_ui.h"
#include "CFILE.H"
#include "cfile.h"
#include "mem.h"
#include "game.h"
#include "stringtable.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/DllWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "DllWrappers.h"
#include "pserror.h"
#include "pstring.h"
#include "CFILE.H"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/DllWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define DLLWRAPPERS_H_

#include "pserror.h"
#include "CFILE.H"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/Inventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
#define __INVENTORY_H__

#include "pstypes.h"
#include "CFILE.H"
#include "cfile.h"

struct object;

Expand Down
2 changes: 1 addition & 1 deletion Descent3/LoadLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@

#include "LoadLevel.h"

#include "CFILE.H"
#include "cfile.h"

#include "descent.h"
#include "object.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/LoadLevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
* $NoKeywords: $
*/

#include "CFILE.H"
#include "cfile.h"
#include "room.h"

// Chunk types
Expand Down
2 changes: 1 addition & 1 deletion Descent3/Mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
#include "3d.h"
#include "LoadLevel.h"
#include "pserror.h"
#include "CFILE.H"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"
Expand Down
6 changes: 3 additions & 3 deletions Descent3/OsirisLoadandBind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
#include "osiris_dll.h"
#include "pserror.h"
#include "mono.h"
#include "CFILE.H"
#include "cfile.h"
#include "ddio.h"
#include "manage.h"
#include <stdlib.h>
Expand Down Expand Up @@ -917,11 +917,11 @@ int _get_full_path_to_module(char *module_name, char *fullpath, char *basename)

int exist = cfexist(modfilename);
switch (exist) {
case CF_ON_DISK:
case CFES_ON_DISK:
ddio_MakePath(fullpath, LocalScriptDir, modfilename, NULL);
return -1;
break;
case CF_IN_LIBRARY: {
case CFES_IN_LIBRARY: {
ASSERT(OSIRIS_Extracted_script_dir);
if (!OSIRIS_Extracted_script_dir)
return -2;
Expand Down
2 changes: 1 addition & 1 deletion Descent3/PilotPicsAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#include "bitmap.h"
#include "player.h"
#include "pilot.h"
#include "CFILE.H"
#include "cfile.h"
#include "mono.h"
#include "ddio.h"
#include "manage.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/TelCom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "CFILE.H"
#include "cfile.h"
#include "application.h"
#include "TelCom.h"
#include "TelComEffects.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/TelComAutoMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
#include <string.h>
#include <ctype.h>

#include "CFILE.H"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/TelComCargo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#include <string.h>
#include <ctype.h>

#include "CFILE.H"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/TelComGoals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
#include <string.h>
#include <ctype.h>

#include "CFILE.H"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"
Expand Down
4 changes: 2 additions & 2 deletions Descent3/aiambient.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdlib.h>
#include "aiambient.h"
#include "string.h"
#include "objinfo.h"
#include <stdlib.h>
#include "game.h"
#include "psrand.h"

Expand Down
2 changes: 1 addition & 1 deletion Descent3/aiambient.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef _AIAMBIENT_H_
#define _AIAMBIENT_H_

#include "CFILE.H"
#include "cfile.h"

#define MAX_AL_TYPES 6
#define MAX_ALS_PER_TYPE 130
Expand Down
1 change: 0 additions & 1 deletion Descent3/ambient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ void InitAmbientSounds() {
}

#include "ddio.h"
#include "CFILE.H"
#include "soundload.h"
#include "descent.h"
#include "mem.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/audiotaunts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "pserror.h"
#include "pstypes.h"
#include "audiotaunts.h"
#include "CFILE.H"
#include "cfile.h"
#include "audio_encode.h"
#include "byteswap.h"
#include "mem.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#include "list.h"
#include "vecmat.h"
#include "CFILE.H"
#include "cfile.h"

#define BSP_IN_FRONT 1
#define BSP_BEHIND 2
Expand Down
2 changes: 1 addition & 1 deletion Descent3/buddymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "CFILE.H"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion Descent3/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
#include "cinematics.h"
#include "hlsoundlib.h"
#include "terrain.h"
#include "CFILE.H"
#include "cfile.h"
#include "mem.h"
#include "lighting.h"
#include "PHYSICS.H"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/d3serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#include "descent.h"
#include <time.h>
#include "mono.h"
#include "CFILE.H"
#include "cfile.h"
#include "program.h"

#include <fcntl.h>
Expand Down
4 changes: 2 additions & 2 deletions Descent3/dedicated_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ typedef int socklen_t;
#include "pstypes.h"
#include "pserror.h"
#include "pstring.h"
#include "CFILE.H"
#include "InfFile.h"
#include "cfile.h"
#include "inffile.h"
#include "dedicated_server.h"
#include "multi.h"
#include "args.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/demofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
*/

#include <stdio.h>
#include "CFILE.H"
#include "cfile.h"
#include "objinfo.h"
#include "ship.h"
#include "ui.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/descent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
#include "pserror.h"
#include "grdefs.h"
#include "mono.h"
#include "CFILE.H"
#include "cfile.h"

#include "init.h"
#include "game.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
#include "cinematics.h"
#include "SmallViews.h"
#include "Mission.h"
#include "CFILE.H"
#include "cfile.h"
#include "gameloop.h"
#include "cockpit.h"
#include "game2dll.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/gamesave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
#include "gamesave.h"
#include "descent.h"
#include "newui.h"
#include "CFILE.H"
#include "cfile.h"
#include "Mission.h"
#include "gamesequence.h"
#include "gameevent.h"
Expand Down
2 changes: 1 addition & 1 deletion Descent3/gamesave.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
#define GAMESAVE_H

#include "pstypes.h"
#include "CFILE.H"
#include "cfile.h"
#include "object.h"
#include "objinfo.h"

Expand Down
2 changes: 1 addition & 1 deletion Descent3/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "CFILE.H"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion Descent3/hotspotmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "CFILE.H"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>
Expand Down
Loading

0 comments on commit 3daf5b2

Please sign in to comment.