Skip to content

Commit b39d1eb

Browse files
authored
Merge branch 'main' into feature/icu
2 parents 8de1fe0 + 558e224 commit b39d1eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+366
-392
lines changed

.github/workflows/openw3d.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@ jobs:
2020
include:
2121
- name: MSVC x86
2222
os: windows-latest
23-
cmake-args: -A Win32
23+
cmake-args: -GNinja -DCMAKE_BUILD_TYPE=Release
2424
shell: pwsh
25+
arch: x86
26+
options: "/W4;/WX;/wd4456;/wd4702;/wd4100;/wd4505;/wd4389;/wd5054;/wd4840"
2527
- name: MSVC x64
2628
os: windows-latest
27-
cmake-args: -A x64
29+
cmake-args: -GNinja -DCMAKE_BUILD_TYPE=Release
2830
shell: pwsh
31+
arch: x64
2932
- name: MinGW x86
3033
os: windows-latest
31-
cmake-args: -DW3D_BUILD_OPTION_FFMPEG=ON -GNinja
34+
cmake-args: -DW3D_BUILD_OPTION_FFMPEG=ON -GNinja -DCMAKE_BUILD_TYPE=Release
3235
build-args: --target combat combate renegade renegadeserver ww3d2e wwaudioe wwphyse
3336
msys2: true
3437
msys2-msystem: mingw32
3538
msys2-env: mingw-w64-i686
3639
shell: msys2 {0}
3740
- name: MinGW x64
3841
os: windows-latest
39-
cmake-args: -DW3D_BUILD_OPTION_FFMPEG=ON -GNinja
42+
cmake-args: -DW3D_BUILD_OPTION_FFMPEG=ON -GNinja -DCMAKE_BUILD_TYPE=Release
4043
build-args: --target combat combate renegade renegadeserver ww3d2e wwaudioe wwphyse
4144
msys2: true
4245
msys2-msystem: mingw64
@@ -70,8 +73,15 @@ jobs:
7073
${{ matrix.msys2-env }}-ffmpeg
7174
${{ matrix.msys2-env }}-ninja
7275
${{ matrix.msys2-env }}-pkg-config
76+
- name: 'Set up MSVC dev cmd'
77+
if: ${{ !matrix.msys2 }}
78+
uses: ilammy/msvc-dev-cmd@v1.13.0
79+
with:
80+
arch: ${{ matrix.arch }}
7381
- uses: actions/checkout@v5
7482
- name: 'CMake (configure)'
83+
env:
84+
W3D_COMPILER_FLAGS: ${{ matrix.options }}
7585
run: |
7686
cmake -S . -B build ${{ matrix.cmake-args }}
7787
- name: 'CMake (build)'

Code/Combat/backgroundmgr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,14 +1619,14 @@ LightningBoltClass::LightningBoltClass (int branchcount, Matrix3D &m, float leng
16191619
const float amplitudefactor = 0.85f;
16201620

16211621
float oobranchcount;
1622-
int branchcount;
1622+
int lbbranchcount;
16231623
float minlength, maxlength, w, a;
16241624

16251625
Branches = new BranchStruct [BranchCount];
16261626
WWASSERT (Branches != NULL);
16271627
oobranchcount = 1.0f / BranchCount;
16281628
branchrandomness = vertexcount / (BranchCount * 2);
1629-
branchcount = BranchCount * branchfactor;
1629+
lbbranchcount = BranchCount * branchfactor;
16301630
minlength = childlength * minlengthfactor;
16311631
maxlength = childlength * maxlengthfactor;
16321632
w = MAX (minwidth, width * widthfactor);
@@ -1646,7 +1646,7 @@ LightningBoltClass::LightningBoltClass (int branchcount, Matrix3D &m, float leng
16461646

16471647
// If the lightning bolt originates below the horizon don't bother generating it.
16481648
if (m0.Get_Translation().Z > 0.0f) {
1649-
Branches [b].LightningBolt = NEW_REF (LightningBoltClass, (branchcount, m0, l, l, w, a));
1649+
Branches [b].LightningBolt = NEW_REF (LightningBoltClass, (lbbranchcount, m0, l, l, w, a));
16501650
} else {
16511651
Branches [b].LightningBolt = NULL;
16521652
}

Code/Combat/humanstate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,10 +1433,10 @@ void HumanStateClass::Begin_Jump( void )
14331433
void HumanStateClass::Complete_Jump( void )
14341434
{
14351435
Vector3 fall = JumpTM.Get_Translation() - HumanPhys->Get_Transform().Get_Translation();
1436-
GlobalSettingsDef * settings = GlobalSettingsDef::Get_Global_Settings();
1436+
[[maybe_unused]] GlobalSettingsDef * settings = GlobalSettingsDef::Get_Global_Settings();
14371437
// Debug_Say(( "Fall Distance %f\n", fall.Z ));
14381438

1439-
bool add_portal = true;
1439+
[[maybe_unused]] bool add_portal = true;
14401440

14411441
//
14421442
// Don't do this in the level editor

Code/Combat/repairbaygameobj.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,6 @@ RepairBayGameObj::Repair_Vehicle (void)
674674
if ( driver != NULL &&
675675
driver->Get_Player_Type () == BaseController->Get_Player_Type() )
676676
{
677-
PlayerDataClass *player_data = driver->Get_Player_Data ();
678-
679677
float shield_max = vehicle->Get_Defense_Object ()->Get_Shield_Strength_Max ();
680678
float health_max = vehicle->Get_Defense_Object ()->Get_Health_Max ();
681679
float curr_health = vehicle->Get_Defense_Object ()->Get_Health ();
@@ -697,22 +695,16 @@ RepairBayGameObj::Repair_Vehicle (void)
697695
int damage_points = (int)std::min (repair_rate, total_damage);
698696
float repair_cost_per_pt = vehicle_cost / (health_max + shield_max);
699697

700-
//int available_funds = 1000; //player_data->Get_Score ()
701698
// FIXME (TSS) available_funds = 1000 looks suspect...
702-
int available_funds = 1000; //player_data->Get_Money ()
699+
int available_funds = 1000;
703700

704701
int points_restored = int(available_funds / repair_cost_per_pt);
705702
points_restored = std::max (points_restored, 0);
706703
points_restored = std::min (points_restored, damage_points);
707-
float total_cost = points_restored * repair_cost_per_pt;
708704

709705
int health_restored = std::min (int(health_max - curr_health), points_restored);
710706
int shield_restored = std::min (int(shield_max - curr_shield), (points_restored - health_restored));
711707

712-
//
713-
// Debit the player's account
714-
//
715-
//player_data->Purchase_Item (total_cost);
716708
is_repairing = true;
717709

718710
//

Code/Combat/staticnetworkobject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,13 @@ DSAPONetworkObjectClass::Initialize (StaticAnimPhysClass *phys_obj)
799799
// Get a pointer to the object
800800
//
801801
if (PhysObj != NULL) {
802-
DamageableStaticPhysClass *phys_obj = PhysObj->As_DamageableStaticPhysClass ();
803-
if (phys_obj != NULL) {
802+
DamageableStaticPhysClass *dsphys_obj = PhysObj->As_DamageableStaticPhysClass ();
803+
if (dsphys_obj != NULL) {
804804

805805
//
806806
// Copy the object's state
807807
//
808-
Health = phys_obj->DefenseObject.Get_Health ();
808+
Health = dsphys_obj->DefenseObject.Get_Health ();
809809
}
810810
}
811811

Code/Commando/AutoStart.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ void AutoRestartClass::Think(void)
296296
}
297297
LogonAction = (WOLLogonAction) -1;
298298
WOLLogonMgr::Set_Quiet_Mode(true);
299-
RefPtr<WWOnline::Session> WOLSession = WWOnline::Session::GetInstance(true);
300-
if (WOLSession.IsValid()) {
301-
Observer<WWOnline::ServerError>::NotifyMe(*WOLSession);
299+
RefPtr<WWOnline::Session> wol_session = WWOnline::Session::GetInstance(true);
300+
if (wol_session.IsValid()) {
301+
Observer<WWOnline::ServerError>::NotifyMe(*wol_session);
302302
WOLLogonMgr::Logon(this);
303303
RestartState = STATE_LOGIN;
304304
} else {

Code/Commando/WOLBuddyMgr.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,8 +1263,8 @@ void WOLBuddyMgr::HandleNotification(BuddyEvent& event)
12631263
if (listChanged)
12641264
{
12651265
Add_Ref();
1266-
WOLBuddyMgrEvent event(BUDDYLIST_CHANGED, this);
1267-
NotifyObservers(event);
1266+
WOLBuddyMgrEvent change_event(BUDDYLIST_CHANGED, this);
1267+
NotifyObservers(change_event);
12681268
Release_Ref();
12691269
}
12701270
}
@@ -1331,8 +1331,8 @@ void WOLBuddyMgr::HandleNotification(UserEvent& event)
13311331
if (IsBuddy(username))
13321332
{
13331333
Add_Ref();
1334-
WOLBuddyMgrEvent event(BUDDYINFO_CHANGED, this);
1335-
NotifyObservers(event);
1334+
WOLBuddyMgrEvent change_event(BUDDYINFO_CHANGED, this);
1335+
NotifyObservers(change_event);
13361336
Release_Ref();
13371337
}
13381338
}
@@ -1343,8 +1343,8 @@ void WOLBuddyMgr::HandleNotification(UserEvent& event)
13431343
if (IsBuddy(event.Subject()->GetName()))
13441344
{
13451345
Add_Ref();
1346-
WOLBuddyMgrEvent event(BUDDYINFO_CHANGED, this);
1347-
NotifyObservers(event);
1346+
WOLBuddyMgrEvent change_event(BUDDYINFO_CHANGED, this);
1347+
NotifyObservers(change_event);
13481348
Release_Ref();
13491349
}
13501350
break;

Code/Commando/WOLChatMgr.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,8 @@ void WOLChatMgr::HandleNotification(ChannelListEvent& event)
10421042
}
10431043

10441044
Add_Ref();
1045-
WOLChatMgrEvent event = LobbyListChanged;
1046-
NotifyObservers(event);
1045+
WOLChatMgrEvent change_event = LobbyListChanged;
1046+
NotifyObservers(change_event);
10471047
Release_Ref();
10481048
}
10491049
}
@@ -1092,26 +1092,26 @@ void WOLChatMgr::HandleNotification(ChannelEvent& event)
10921092
AddMessage(NULL, message, true, true);
10931093

10941094
Add_Ref();
1095-
WOLChatMgrEvent event = LobbyChanged;
1096-
NotifyObservers(event);
1095+
WOLChatMgrEvent change_event = LobbyChanged;
1096+
NotifyObservers(change_event);
10971097
Release_Ref();
10981098
}
10991099
break;
11001100

11011101
case ChannelBanned:
11021102
{
11031103
Add_Ref();
1104-
WOLChatMgrEvent event = BannedFromChannel;
1105-
NotifyObservers(event);
1104+
WOLChatMgrEvent ban_event = BannedFromChannel;
1105+
NotifyObservers(ban_event);
11061106
Release_Ref();
11071107
}
11081108
break;
11091109

11101110
case ChannelKicked:
11111111
{
11121112
Add_Ref();
1113-
WOLChatMgrEvent event = KickedFromChannel;
1114-
NotifyObservers(event);
1113+
WOLChatMgrEvent kick_event = KickedFromChannel;
1114+
NotifyObservers(kick_event);
11151115
Release_Ref();
11161116
}
11171117
break;

Code/Commando/WebBrowser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,8 @@ bool WebBrowser::LaunchExternal(const char* url)
11041104

11051105
memset(&mProcessInfo, 0, sizeof(mProcessInfo));
11061106

1107-
BOOL createSuccess = CreateProcessA(exeName, commandLine, NULL, NULL, false,
1108-
0, NULL, NULL, &startupInfo, &mProcessInfo);
1107+
bool createSuccess = CreateProcessA(exeName, commandLine, NULL, NULL, false,
1108+
0, NULL, NULL, &startupInfo, &mProcessInfo) != 0;
11091109

11101110
WWASSERT(createSuccess && "Failed to launch external WebBrowser.");
11111111

@@ -1114,7 +1114,7 @@ bool WebBrowser::LaunchExternal(const char* url)
11141114
WaitForInputIdle(mProcessInfo.hProcess, 5000);
11151115
}
11161116

1117-
return (true == createSuccess);
1117+
return createSuccess;
11181118
}
11191119

11201120

Code/Commando/console.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,18 +1702,18 @@ void ConsoleGameModeClass::Update_Memory_Log( void )
17021702
const float OOMEGABYTE = 1.0f / MEGABYTE;
17031703

17041704
StringClass memory_string(2048);
1705-
StringClass working_string(true);
1705+
StringClass temp_string(true);
17061706

17071707
memory_string.Format("Memory Category Current(Mb) Peak(Mb)\n");
17081708
int total = 0;
17091709
for (int i=0; i<WWMemoryLogClass::Get_Category_Count(); i++) {
17101710

17111711
// (gth) to compute Mb should I divide by the nearest power of two to a million?
1712-
working_string.Format("%-18s %-10.2f %-10.2f\r\n",
1712+
temp_string.Format("%-18s %-10.2f %-10.2f\r\n",
17131713
WWMemoryLogClass::Get_Category_Name(i),
17141714
(float)WWMemoryLogClass::Get_Current_Allocated_Memory(i) * OOMEGABYTE,
17151715
(float)WWMemoryLogClass::Get_Peak_Allocated_Memory(i) * OOMEGABYTE);
1716-
memory_string += working_string;
1716+
memory_string += temp_string;
17171717
total += WWMemoryLogClass::Get_Current_Allocated_Memory(i);
17181718
}
17191719

@@ -1724,30 +1724,30 @@ void ConsoleGameModeClass::Update_Memory_Log( void )
17241724
memory_string += working_string;
17251725
#endif
17261726

1727-
working_string.Format("SUB TOTAL: %-10.2f\r\n\r\n",(float)total * OOMEGABYTE);
1728-
memory_string += working_string;
1727+
temp_string.Format("SUB TOTAL: %-10.2f\r\n\r\n",(float)total * OOMEGABYTE);
1728+
memory_string += temp_string;
17291729

17301730
// display the estimated space used by textures residing in system ram
17311731
int tex_size=TextureClass::_Get_Total_Texture_Size();
1732-
working_string.Format("%-18s %-10.2f\r\n","Textures(est)",(float)tex_size * OOMEGABYTE);
1733-
memory_string += working_string;
1732+
temp_string.Format("%-18s %-10.2f\r\n","Textures(est)",(float)tex_size * OOMEGABYTE);
1733+
memory_string += temp_string;
17341734
total+=tex_size;
17351735

17361736
// display estimated vertex buffer space
17371737
unsigned vb_size=VertexBufferClass::Get_Total_Allocated_Memory();
1738-
working_string.Format("%-18s %-10.2f\r\n","Vertex Buffers(est)",(float)vb_size * OOMEGABYTE);
1739-
memory_string += working_string;
1738+
temp_string.Format("%-18s %-10.2f\r\n","Vertex Buffers(est)",(float)vb_size * OOMEGABYTE);
1739+
memory_string += temp_string;
17401740
total+=vb_size;
17411741

17421742
// display estimated index buffer space
17431743
unsigned ib_size=IndexBufferClass::Get_Total_Allocated_Memory();
1744-
working_string.Format("%-18s %-10.2f\r\n","Index Buffers(est)",(float)ib_size * OOMEGABYTE);
1745-
memory_string += working_string;
1744+
temp_string.Format("%-18s %-10.2f\r\n","Index Buffers(est)",(float)ib_size * OOMEGABYTE);
1745+
memory_string += temp_string;
17461746
total+=ib_size;
17471747

17481748
// total!
1749-
working_string.Format("TOTAL: %-10.2f\r\n\r\n",(float)total * OOMEGABYTE);
1750-
memory_string += working_string;
1749+
temp_string.Format("TOTAL: %-10.2f\r\n\r\n",(float)total * OOMEGABYTE);
1750+
memory_string += temp_string;
17511751

17521752
StatisticsDisplayManager::Set_Stat( "memory", memory_string, 0xffffffff );
17531753
}

0 commit comments

Comments
 (0)