Skip to content

Commit

Permalink
Merge branch 'vanilla' into cleanup/morelong
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianobelinassi authored Jun 26, 2024
2 parents df1760b + d07e8da commit b619eba
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 70 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Create Development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: "marvinpinto/action-automatic-releases@latest"
uses: "0xDylan/action-auto-releases-n20@v1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -112,7 +112,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Restore cache
id: dep-cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -107,7 +107,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -138,7 +138,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: ilammy/msvc-dev-cmd@v1.12.1
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x86

- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: pwsh
run: |
$gitoutput = git rev-parse --short HEAD
echo "sha_short=${gitoutput}" >> $env:GITHUB_OUTPUT
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -66,7 +69,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand All @@ -86,13 +89,16 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: ilammy/msvc-dev-cmd@v1.12.1
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.platform }}

- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: pwsh
run: |
$gitoutput = git rev-parse --short HEAD
echo "sha_short=${gitoutput}" >> $env:GITHUB_OUTPUT
- name: Set variables
id: vars
Expand Down Expand Up @@ -152,7 +158,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -164,7 +170,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"hidden": true,
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
"VC_CXX_FLAGS": "/Zc:strictStrings;-wd4244;-wd4018;-wd4291;-wd4101;-wd4267",
"VC_CXX_FLAGS": "/Zc:strictStrings;-wd4244;-wd4018;-wd4291;-wd4101;-wd4267;-wd4200",
"CMAKE_CXX_FLAGS_RELEASE": "/Zi /O2 /Ob2 /DNDEBUG",
"CMAKE_EXE_LINKER_FLAGS_RELEASE": "/debug:full /INCREMENTAL:NO",
"CMAKE_MODULE_LINKER_FLAGS_RELEASE": "/debug:full /INCREMENTAL:NO",
Expand Down
3 changes: 0 additions & 3 deletions common/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#include "field.h"
#include "endianness.h"

// ST - 12/18/2018 10:14AM
#pragma warning(disable : 4996)

FieldClass::FieldClass(const char* id, char data)
{
strncpy(ID, id, sizeof(ID));
Expand Down
6 changes: 4 additions & 2 deletions common/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ static void Resolve_File_Single(char* fname)
return;
}

if (ffblk->FindFirst(fname) && strlen(fname) == strlen(ffblk->GetName())) {
strncpy(fname, ffblk->GetName(), strlen(fname) + 1);
size_t name_len = strlen(fname);

if (ffblk->FindFirst(fname) && name_len == strlen(ffblk->GetFullName())) {
strncpy(fname, ffblk->GetFullName(), name_len + 1);
}

delete ffblk;
Expand Down
4 changes: 4 additions & 0 deletions common/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ class Find_File_Data
{
}
virtual const char* GetName() const = 0;
virtual const char* GetFullName() const
{
return nullptr;
};
virtual unsigned int GetTime() const = 0;

virtual bool FindFirst(const char* fname) = 0;
Expand Down
6 changes: 5 additions & 1 deletion common/file_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Find_File_Data_Posix : public Find_File_Data
virtual ~Find_File_Data_Posix();

virtual const char* GetName() const;
virtual const char* GetFullName() const
{
return DirEntry != nullptr ? FullName : nullptr;
}
virtual unsigned int GetTime() const;

virtual bool FindFirst(const char* fname);
Expand Down Expand Up @@ -50,7 +54,7 @@ const char* Find_File_Data_Posix::GetName() const
if (DirEntry == nullptr) {
return nullptr;
}
return FullName;
return DirEntry->d_name;
}

unsigned int Find_File_Data_Posix::GetTime() const
Expand Down
2 changes: 0 additions & 2 deletions common/graphicsviewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,6 @@ unsigned int GraphicViewPortClass::Print(char const* str, int x, int y, int fcol
return (return_code);
}

#pragma warning(disable : 4996)

/***************************************************************************
* GVPC::PRINT -- Stub function to print an integer *
* *
Expand Down
3 changes: 0 additions & 3 deletions common/ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
#include "cstraw.h"
#endif

// Disable the "temporary object used to initialize a non-constant reference" warning.
//#pragma warning 665 9

/***********************************************************************************************
* INIClass::~INIClass -- Destructor for INI handler. *
* *
Expand Down
2 changes: 0 additions & 2 deletions common/int.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ template <class T> T Gcd(const T& a, const T& n)
return g[(i - 1) % 3];
}

//#pragma warning 604 9
//#pragma warning 595 9
template <class T> T Generate_Prime(Straw& rng, int pbits)
{
T minQ = (T(1UL) << (unsigned short)(pbits - (unsigned short)2));
Expand Down
1 change: 0 additions & 1 deletion common/mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ unsigned XMP_Encode(unsigned char* to, unsigned tobytes, digit const* from, int
* HISTORY: *
* 07/01/1996 JLB : Created. *
*=============================================================================================*/
//#pragma warning 364 9
unsigned XMP_Encode(unsigned char* to, digit const* from, int precision)
{
int i;
Expand Down
1 change: 0 additions & 1 deletion common/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ bool PacketClass::Get_Field(const char* id, int& data)
* HISTORY: *
* 04/23/1996 PWG : Created. *
*========================================================================*/
#pragma warning(disable : 4996)
bool PacketClass::Get_Field(const char* id, char* data)
{
FieldClass* field = Find_Field(id);
Expand Down
1 change: 0 additions & 1 deletion common/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ typedef struct
/*
------------------------------- Shape block ---------------------------------
*/
#pragma warning(disable : 4200)
#pragma pack(push, 2)
typedef struct
{
Expand Down
1 change: 1 addition & 0 deletions common/soscodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ unsigned sosCODECDecompressData(_SOS_COMPRESS_INFO* stream, unsigned bytes)
}
#endif
assert(0 && "Unreachable");
return 0;
}

//
Expand Down
6 changes: 0 additions & 6 deletions redalert/dllinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
**
*/

// Exception handling isn't enabled
#pragma warning(disable : 4530) // warning C4530: C++ exception handler used, but unwind semantics are not enabled.

#include <string>
#include <vector>
#include <set>
Expand Down Expand Up @@ -72,9 +69,6 @@ typedef __int64 int64;
**
**
*/
// For compatibility with Watcom in audio enums
#pragma warning(disable : 4091)

// From RedAlert\Audio.cpp
typedef enum
{
Expand Down
3 changes: 0 additions & 3 deletions redalert/ipxmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@

#endif // WINSOCK_IPX

// Turn off "expression is not meaningful".
//#pragma warning 628 9

//#include "WolDebug.h"

/***************************************************************************
Expand Down
6 changes: 3 additions & 3 deletions tiberiandawn/cdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,11 @@ static TemplateTypeClass const Boulder3(TEMPLATE_BOULDER3,
LAND_ROCK,
NULL);
static TemplateTypeClass const
Boulder4(TEMPLATE_BOULDER4, THEATERF_TEMPERATE, "B4", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
Boulder4(TEMPLATE_BOULDER4, THEATERF_DESERT, "B4", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
static TemplateTypeClass const
Boulder5(TEMPLATE_BOULDER5, THEATERF_TEMPERATE, "B5", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
Boulder5(TEMPLATE_BOULDER5, THEATERF_DESERT, "B5", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
static TemplateTypeClass const
Boulder6(TEMPLATE_BOULDER6, THEATERF_TEMPERATE, "B6", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
Boulder6(TEMPLATE_BOULDER6, THEATERF_DESERT, "B6", TXT_SLOPE, LAND_ROCK, 1, 1, LAND_ROCK, NULL);
static TemplateTypeClass const Slope1(TEMPLATE_SLOPE1,
THEATERF_WINTER | THEATERF_DESERT | THEATERF_TEMPERATE,
"S01",
Expand Down
1 change: 0 additions & 1 deletion tiberiandawn/conquer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3613,7 +3613,6 @@ static bool Change_Local_Dir(int cd)
* 07/11/1995 JLB : Created. *
* 05/22/1996 ST : Handles multiple CD drives / CD changers *
*=============================================================================================*/
#pragma warning(disable : 4101)
bool Force_CD_Available(int cd)
{

Expand Down
9 changes: 0 additions & 9 deletions tiberiandawn/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@

#define FOREIGN_VERSION_NUMBER 6

//
// typedef enums with -1 will show this warning, even when the type of the enum is signed. It's a compiler bug,
// apparently ST - 1/8/2019 9:23AM
//
#pragma warning(push)
#pragma warning(disable : 4341)

/**********************************************************************
** These enumerations are used to implement RTTI.
*/
Expand Down Expand Up @@ -3042,6 +3035,4 @@ typedef enum StrategyType : unsigned char

#endif // USE_RA_AI

#pragma warning(pop)

#endif
3 changes: 0 additions & 3 deletions tiberiandawn/dllinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ typedef __int64 int64;
**
**
*/
// For compatibility with Watcom in audio enums
#pragma warning(disable : 4091)

// From TiberianDawn\Audio.cpp
typedef enum
{
Expand Down
12 changes: 8 additions & 4 deletions tiberiandawn/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ bool Init_Game(int, char*[])
MFCD::Cache("CONQUER.MIX");
if (SampleType != 0 && !Debug_Quiet) {
MFCD::Cache("SOUNDS.MIX");
if (Special.IsJuvenile) {
new MFCD("ZOUNDS.MIX"); // Cached.
MFCD::Cache("ZOUNDS.MIX");
}
}
}
Call_Back();
Expand Down Expand Up @@ -618,6 +614,14 @@ bool Init_Game(int, char*[])
*/
Options.Load_Settings();

/*
** Now that conquer.ini has been read, we can check if we need zounds.mix.
*/
if (!Is_Demo() && SampleType != 0 && !Debug_Quiet && Special.IsJuvenile) {
new MFCD("ZOUNDS.MIX");
MFCD::Cache("ZOUNDS.MIX");
}

/*
** Dump a default copy of rules.ini.
*/
Expand Down
2 changes: 0 additions & 2 deletions tiberiandawn/iomap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@

#include "function.h"

#pragma warning(disable : 4302) // Truncation from pointer to TARGET

/***********************************************************************************************
* CellClass::Should_Save -- Should the cell be written to disk? *
* *
Expand Down
2 changes: 0 additions & 2 deletions tiberiandawn/ioobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@

#include "function.h"

#pragma warning(disable : 4302) // Truncation from pointer to TARGET

/***********************************************************************************************
* TeamTypeClass::Load -- Loads from a save game file. *
* *
Expand Down
Loading

0 comments on commit b619eba

Please sign in to comment.