Skip to content

Commit 329a958

Browse files
committed
Merge branch 'main' of https://github.com/TheSuperHackers/GeneralsGameCode into weekly-release
2 parents a801bfb + db0730f commit 329a958

File tree

392 files changed

+3274
-2900
lines changed

Some content is hidden

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

392 files changed

+3274
-2900
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ if (IS_VS6_BUILD)
6363
# If there is a desire to make this work, then a fixed max sdk needs to be created.
6464
add_subdirectory(Dependencies/MaxSDK)
6565
endif()
66-
add_subdirectory(Dependencies/SafeDisc)
6766
add_subdirectory(Dependencies/Utility)
6867
add_subdirectory(resources)
6968

Core/GameEngine/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ set(GAMEENGINE_SRC
2121
# Include/Common/CDManager.h
2222
# Include/Common/ClientUpdateModule.h
2323
# Include/Common/CommandLine.h
24-
# Include/Common/CopyProtection.h
2524
# Include/Common/crc.h
2625
# Include/Common/CRCDebug.h
2726
# Include/Common/CriticalSection.h
@@ -43,6 +42,7 @@ set(GAMEENGINE_SRC
4342
# Include/Common/FunctionLexicon.h
4443
# Include/Common/GameAudio.h
4544
# Include/Common/GameCommon.h
45+
Include/Common/GameDefines.h
4646
# Include/Common/GameEngine.h
4747
# Include/Common/GameLOD.h
4848
# Include/Common/GameMemory.h
@@ -631,7 +631,6 @@ set(GAMEENGINE_SRC
631631
# Source/Common/System/AsciiString.cpp
632632
# Source/Common/System/BuildAssistant.cpp
633633
# Source/Common/System/CDManager.cpp
634-
# Source/Common/System/CopyProtection.cpp
635634
# Source/Common/System/CriticalSection.cpp
636635
# Source/Common/System/DataChunk.cpp
637636
# Source/Common/System/Debug.cpp
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
** Command & Conquer Generals Zero Hour(tm)
3+
** Copyright 2025 TheSuperHackers
4+
**
5+
** This program is free software: you can redistribute it and/or modify
6+
** it under the terms of the GNU General Public License as published by
7+
** the Free Software Foundation, either version 3 of the License, or
8+
** (at your option) any later version.
9+
**
10+
** This program is distributed in the hope that it will be useful,
11+
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
** GNU General Public License for more details.
14+
**
15+
** You should have received a copy of the GNU General Public License
16+
** along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#pragma once
20+
21+
// Note: Retail compatibility must not be broken before this project officially does.
22+
// Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes.
23+
24+
#ifndef RETAIL_COMPATIBLE_CRC
25+
#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04
26+
#endif
27+
28+
#ifndef RETAIL_COMPATIBLE_XFER_SAVE
29+
#define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04
30+
#endif
31+
32+
#ifndef ENABLE_GAMETEXT_SUBSTITUTES
33+
#define ENABLE_GAMETEXT_SUBSTITUTES (1) // The code can provide substitute texts when labels and strings are missing in the STR or CSF translation file
34+
#endif

Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Is_In_Param_List
228228
// OutputDebugString( "\n" );
229229

230230
// if ( stricmp( string.Peek_Buffer(), param_to_check ) == 0 ) // Breaks with whitespaces
231-
if ( strstr( string.Peek_Buffer(), param_to_check ) != 0 )
231+
if ( strstr( string.str(), param_to_check ) != 0 )
232232
{
233233
return( true );
234234
}
@@ -447,7 +447,7 @@ AnimatedSoundMgrClass::Get_Embedded_Sound_Name (HAnimClass *anim)
447447
return NULL;
448448
}
449449

450-
return list->BoneName.Peek_Buffer();
450+
return list->BoneName.str();
451451
}
452452

453453

@@ -527,7 +527,7 @@ AnimatedSoundMgrClass::Trigger_Sound
527527
//
528528
// Stop the audio
529529
//
530-
SoundLibrary->Stop_Playing_Audio( sound_list->List[index]->SoundName.Peek_Buffer() );
530+
SoundLibrary->Stop_Playing_Audio( sound_list->List[index]->SoundName.str() );
531531
}
532532
else
533533
{
@@ -536,11 +536,11 @@ AnimatedSoundMgrClass::Trigger_Sound
536536
//
537537
if (sound_list->List[index]->Is2D == true)
538538
{
539-
SoundLibrary->Play_2D_Audio(sound_list->List[index]->SoundName.Peek_Buffer());
539+
SoundLibrary->Play_2D_Audio(sound_list->List[index]->SoundName.str());
540540
}
541541
else
542542
{
543-
SoundLibrary->Play_3D_Audio(sound_list->List[index]->SoundName.Peek_Buffer(), tm);
543+
SoundLibrary->Play_3D_Audio(sound_list->List[index]->SoundName.str(), tm);
544544
}
545545
}
546546

Core/Libraries/Source/WWVegas/WW3D2/rendobj.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
452452
virtual void Scale(float scale) { };
453453
virtual void Scale(float scalex, float scaley, float scalez) { };
454454
virtual void Set_ObjectScale(float scale) { ObjectScale=scale;} //set's a scale factor that's factored into transform matrix. {ScaleFactor=scale; };
455-
const float Get_ObjectScale( void ) const { return ObjectScale; };
455+
float Get_ObjectScale( void ) const { return ObjectScale; };
456456
void Set_ObjectColor(unsigned int color) { ObjectColor=color;} //the color that was used to modify the asset for player team color (for Generals). -MW
457-
const unsigned int Get_ObjectColor( void ) const { return ObjectColor; };
457+
unsigned int Get_ObjectColor( void ) const { return ObjectColor; };
458458

459459
virtual int Get_Sort_Level(void) const { return 0; /* SORT_LEVEL_NONE */ }
460460
virtual void Set_Sort_Level(int level) { }

Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void Record_Texture_End()
113113
// if (tfc->Get_Texture_Flash()) flash="F";
114114
// }
115115

116-
working_string.Format("%4.4d %3.3d %3.3d %s ",id,texture_statistics[a].usage_count,texture_statistics[a].change_count,flash.Peek_Buffer());
116+
working_string.Format("%4.4d %3.3d %3.3d %s ",id,texture_statistics[a].usage_count,texture_statistics[a].change_count,flash.str());
117117
texture_statistics_string+=working_string;
118118

119119
StringClass error="";

Core/Libraries/Source/WWVegas/WW3D2/w3dexclusionlist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ bool W3DExclusionListClass::Is_Excluded(HAnimClass * hanim) const
8686
{
8787
// For HAnims, the name to check is the one trailing the '.'
8888
StringClass copy = hanim->Get_Name();
89-
char * root_name = copy.Peek_Buffer();
89+
const char * root_name = copy.str();
9090

91-
char * tmp = strchr(root_name,'.');
91+
const char * tmp = strchr(root_name,'.');
9292
if (tmp) {
9393
return Is_Excluded(tmp + 1);
9494
} else {

Core/Libraries/Source/WWVegas/WWAudio/WWAudio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ class WWAudioClass
386386
// Note: The cache sizes are in kilo-bytes. The default
387387
// is currently set to 1MB.
388388
//
389-
bool Set_Cache_Size (int kbytes = DEF_CACHE_SIZE) { m_MaxCacheSize = (kbytes * 1024); }
389+
void Set_Cache_Size (int kbytes = DEF_CACHE_SIZE) { m_MaxCacheSize = (kbytes * 1024); }
390390
int Get_Cache_Size (void) const { return m_MaxCacheSize / 1024; }
391391
int Get_Current_Cache_Size (void) const { return m_CurrentCacheSize; }
392392

Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void WWProfileHierachyNodeClass::Write_To_File(FileClass* file,int recursion)
202202
for (i=0;i<recursion;++i) { string+="\t"; }
203203
work.Format("%s\t%d\t%f\r\n",Name,TotalCalls,TotalTime*1000.0f);
204204
string+=work;
205-
file->Write(string.Peek_Buffer(),string.Get_Length());
205+
file->Write(string.str(),string.Get_Length());
206206
}
207207
if (Child) {
208208
Child->Write_To_File(file,recursion+1);
@@ -577,7 +577,7 @@ void WWProfileManager::End_Collecting(const char* filename)
577577
"Total frames: %d, average frame time: %fms\r\n"
578578
"All frames taking more than twice the average frame time are marked with keyword SPIKE.\r\n\r\n",
579579
ProfileCollectVector.Count(),avg_frame_time*1000.0f);
580-
file->Write(str.Peek_Buffer(),str.Get_Length());
580+
file->Write(str.str(),str.Get_Length());
581581

582582
HashTemplateIterator<StringClass,unsigned> ite(ProfileStringHash);
583583
for (ite.First();!ite.Is_Done();ite.Next()) {
@@ -591,18 +591,18 @@ void WWProfileManager::End_Collecting(const char* filename)
591591
if (name[i]==';') name[i]=':';
592592
}
593593
str.Format("ID: %d %s\r\n",ite.Peek_Value(),name);
594-
file->Write(str.Peek_Buffer(),str.Get_Length());
594+
file->Write(str.str(),str.Get_Length());
595595
}
596596

597597
str.Format("\r\n\r\n");
598-
file->Write(str.Peek_Buffer(),str.Get_Length());
598+
file->Write(str.str(),str.Get_Length());
599599

600600
for (i=0;i<ProfileCollectVector.Count();++i) {
601601
float frame_time=ProfileCollectVector[i]->Get_Total_Time();
602602
str.Format("FRAME: %d %2.2f %s ",i,frame_time*1000.0f,frame_time>avg_frame_time*2.0f ? "SPIKE" : "OK");
603603
ProfileCollectVector[i]->Add_To_String_Compact(str,0);
604604
str+="\r\n";
605-
file->Write(str.Peek_Buffer(),str.Get_Length());
605+
file->Write(str.str(),str.Get_Length());
606606
}
607607

608608
//

Core/Libraries/Source/WWVegas/WWLib/always.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#include <Utility/compat.h>
4848
#include <Utility/stdint_adapter.h>
4949

50+
#include <Utility/CppMacros.h>
51+
5052
// Disable warning about exception handling not being enabled. It's used as part of STL - in a part of STL we don't use.
5153
#pragma warning(disable : 4530)
5254

0 commit comments

Comments
 (0)