Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kevinbentley/Descent3 into linux-build
Browse files Browse the repository at this point in the history
  • Loading branch information
ei-grad committed Apr 17, 2024
2 parents bacf598 + 9af13e4 commit 4708607
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 190 deletions.
137 changes: 0 additions & 137 deletions #.clang-format#

This file was deleted.

63 changes: 31 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
build:
strategy:
fail-fast: false

matrix:
os:
- {runner: windows-latest, preset: win}
Expand All @@ -21,34 +20,34 @@ jobs:
runs-on: ${{ matrix.os.runner }}

steps:
- uses: actions/checkout@v4

- name: Install macOS dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: |
# Install packages from Homebrew
brew bundle install
- name: Install Linux dependencies
if: ${{ matrix.os.preset == 'linux' }}
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y --no-install-recommends \
make cmake g++ libsdl1.2-dev libsdl-image1.2-dev \
libaudio-dev libaa1-dev libdirectfb-dev \
libncurses-dev \
libxext6:i386 # for ./scripts/hogutils/hogUtils-i686 binary
mkdir ~/Descent3
- name: Configure CMake
run: cmake --preset ${{matrix.os.preset}} -B ${{github.workspace}}/build

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}

- name: 'Upload Artifacts'
uses: actions/upload-artifact@v4
with:
name: build_${{matrix.build_type}}
path: ${{github.workspace}}/build/Descent3/${{matrix.build_type}}
- uses: actions/checkout@v4

- name: Install macOS dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: |
# Install packages from Homebrew
brew bundle install
- name: Install Linux dependencies
if: ${{ matrix.os.preset == 'linux' }}
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y --no-install-recommends \
make cmake g++ libsdl1.2-dev libsdl-image1.2-dev \
libaudio-dev libaa1-dev libdirectfb-dev \
libncurses-dev \
libxext6:i386 # for ./scripts/hogutils/hogUtils-i686 binary
mkdir ~/Descent3
- name: Configure CMake
run: cmake --preset ${{ matrix.os.preset }} -B ${{ github.workspace }}/build

- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build_${{ matrix.os.preset }}_${{ matrix.build_type }}
path: ${{ github.workspace }}/build/Descent3/${{ matrix.build_type }}
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '17'
clang-format-version: '18'
4 changes: 2 additions & 2 deletions Descent3/Mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1836,8 +1836,8 @@ bool mn3_Open(const char *mn3file) {
// concatanate the mn3 extension if it isn't there.
char tempMn3File[PSPATHNAME_LEN];
if (!IS_MN3_FILE(mn3file)) {
strncpy(tempMn3File, mn3file, sizeof(tempMn3File) - 1);
tempMn3File[sizeof(tempMn3File) - 1] = 0;
strncpy(tempMn3File, mn3file, sizeof(tempMn3File) - 1);
tempMn3File[sizeof(tempMn3File) - 1] = 0;
strcat(tempMn3File, ".mn3");
mn3file = tempMn3File;
}
Expand Down
12 changes: 6 additions & 6 deletions Descent3/cockpit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@
#define BUFFET_PERIOD 0.25f
#define COCKPIT_SHIFT_DELTA 0.02f
typedef struct tCockpitCfgInfo {
char modelname[PSFILENAME_LEN+1];
char shieldrings[NUM_SHIELD_GAUGE_FRAMES][PSFILENAME_LEN+1];
char shipimg[PSFILENAME_LEN+1];
char burnimg[PSFILENAME_LEN+1];
char energyimg[PSFILENAME_LEN+1];
char invpulseimg[PSFILENAME_LEN+1];
char modelname[PSFILENAME_LEN + 1];
char shieldrings[NUM_SHIELD_GAUGE_FRAMES][PSFILENAME_LEN + 1];
char shipimg[PSFILENAME_LEN + 1];
char burnimg[PSFILENAME_LEN + 1];
char energyimg[PSFILENAME_LEN + 1];
char invpulseimg[PSFILENAME_LEN + 1];
} tCockpitCfgInfo;
typedef struct tCockpitInfo {
int state; // current state of cockpit on screen.
Expand Down
2 changes: 1 addition & 1 deletion Descent3/gamesave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void QuickSaveGame() {
SaveGameDialog();
} else {
// verify savegame still exists in the appropriate slot, if not just run dialog, if so then save
char filename[PSFILENAME_LEN+1];
char filename[PSFILENAME_LEN + 1];
char pathname[PSPATHNAME_LEN];
char desc[GAMESAVE_DESCLEN + 1];
FILE *fp;
Expand Down
2 changes: 1 addition & 1 deletion Descent3/scorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void AddScorch(int roomnum, int facenum, vector *pos, int texture_handle, float
float size = (float)sp->size / 16.0;

// Increment count, and stop drawing if hit limit
if (sp->roomface == roomface) { // Found one!
if (sp->roomface == roomface) { // Found one!
count += std::max((int)size, 1); // count large marks more
if (count >= MAX_VIS_COUNT)
return;
Expand Down
8 changes: 4 additions & 4 deletions lib/hogfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ typedef struct tHogHeader {
} tHogHeader;

typedef struct tHogFileEntry {
char name[HOG_FILENAME_LEN]; // file name
unsigned flags; // extra info
unsigned len; // length of file
unsigned long timestamp; // time of file.
char name[HOG_FILENAME_LEN]; // file name
unsigned flags; // extra info
unsigned len; // length of file
unsigned long timestamp; // time of file.
} tHogFileEntry;

#define HOGMAKER_ERROR 0 // Incorrect number of files passed in
Expand Down
12 changes: 6 additions & 6 deletions model/newstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,19 +1158,19 @@ float ComputeDefaultSizeFunc(int handle, float *size_ptr, vector *offset_ptr, bo
vector max_xyz;
bool first_pnt = true;

for(frame_index = start_frame; frame_index <= end_frame; frame_index++) {
for (frame_index = start_frame; frame_index <= end_frame; frame_index++) {
// Because size changes with animation, we need the worst case point -- so, check every keyframe
// NOTE: This code does not currently account for all $turret and $rotate positions

SetNormalizedTimeAnim(frame_index, normalized_time, pm);

SetModelAnglesAndPos(pm, normalized_time);

for (model_index = 0;model_index < pm->n_models; model_index++) {
for (model_index = 0; model_index < pm->n_models; model_index++) {
bsp_info *sm = &pm->submodel[model_index];

// For every vertex
for(sm_vert_index = 0; sm_vert_index < sm->nverts; sm_vert_index++) {
for (sm_vert_index = 0; sm_vert_index < sm->nverts; sm_vert_index++) {
vector pnt;
int mn;

Expand Down Expand Up @@ -1228,19 +1228,19 @@ float ComputeDefaultSizeFunc(int handle, float *size_ptr, vector *offset_ptr, bo
*offset_ptr = geometric_center;
}

for(frame_index = start_frame; frame_index <= end_frame; frame_index++) {
for (frame_index = start_frame; frame_index <= end_frame; frame_index++) {
// Because size changes with animation, we need the worst case point -- so, check every keyframe
// NOTE: This code does not currently account for all $turret and $rotate positions

SetNormalizedTimeAnim(frame_index, normalized_time, pm);

SetModelAnglesAndPos(pm, normalized_time);

for(model_index = 0; model_index < pm->n_models; model_index++) {
for (model_index = 0; model_index < pm->n_models; model_index++) {
bsp_info *sm = &pm->submodel[model_index];

// For every vertex
for(sm_vert_index = 0; sm_vert_index < sm->nverts; sm_vert_index++) {
for (sm_vert_index = 0; sm_vert_index < sm->nverts; sm_vert_index++) {
vector pnt;
int mn;

Expand Down

0 comments on commit 4708607

Please sign in to comment.