Skip to content

Commit cfb2f20

Browse files
committed
Update TS++
1 parent 8e778a9 commit cfb2f20

15 files changed

Lines changed: 79 additions & 82 deletions

src/extensions/animtype/animtypeext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ bool AnimTypeClassExtension::Read_INI(CCINIClass &ini)
415415
* A special value of "-1" will set the biggest frame to the actual middle frame
416416
* of the shape file. This behavior was observed in Red Alert 2.
417417
*/
418-
if (This()->Image && This()->Image->Get_Frame_Count() > 0) {
419-
MiddleFrame = ini.Get_Int_Clamp(ini_name, "MiddleFrame", -1, This()->Image->Get_Frame_Count() - 1, MiddleFrame);
418+
if (This()->Image && This()->Image->Get_Count() > 0) {
419+
MiddleFrame = ini.Get_Int_Clamp(ini_name, "MiddleFrame", -1, This()->Image->Get_Count() - 1, MiddleFrame);
420420
}
421421

422422
ExplosionDamage = ini.Get_Int(ini_name, "ExplosionDamage", ExplosionDamage);
@@ -434,8 +434,8 @@ bool AnimTypeClassExtension::Read_INI(CCINIClass &ini)
434434
*/
435435
void AnimTypeClassExtension::Set_Biggest_Frame()
436436
{
437-
if (MiddleFrame < 0 && This()->Image && This()->Image->Get_Frame_Count() >= 2) {
438-
This()->Biggest = This()->Image->Get_Frame_Count() / 2;
437+
if (MiddleFrame < 0 && This()->Image && This()->Image->Get_Count() >= 2) {
438+
This()->Biggest = This()->Image->Get_Count() / 2;
439439
} else {
440440
This()->Biggest = MiddleFrame;
441441
}

src/extensions/animtype/animtypeext_hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ DECLARE_PATCH(_AnimTypeClass_SDDTOR_Free_Image_Patch) { GET_REGISTER_STATIC(Anim
100100
DECLARE_PATCH(_AnimTypeClass_Get_Image_Data_Assertion_Patch)
101101
{
102102
GET_REGISTER_STATIC(AnimTypeClass *, this_ptr, esi);
103-
GET_REGISTER_STATIC(const ShapeFileStruct *, image, eax);
103+
GET_REGISTER_STATIC(const ShapeSet *, image, eax);
104104

105105
if (image == nullptr) {
106106
DEBUG_WARNING("Anim %s has NULL image data!\n", this_ptr->Name());

src/extensions/building/buildingext_hooks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ DECLARE_PATCH(_BuildingClass_Draw_Spied_Cameo_Palette_Patch)
855855
GET_REGISTER_STATIC(Rect *, window_rect, ebp);
856856
static TechnoTypeClass *technotype;
857857
static TechnoTypeClassExtension *technotypeext;
858-
static const ShapeFileStruct *cameo_shape;
858+
static const ShapeSet *cameo_shape;
859859
static Surface *pcx_image;
860860
static Rect pcxrect;
861861

@@ -891,7 +891,7 @@ DECLARE_PATCH(_BuildingClass_Draw_Spied_Cameo_Palette_Patch)
891891
* Original code used NormalDrawer, which is the old Red Alert shape
892892
* drawer, so we need to use CameoDrawer here for the correct palette.
893893
*/
894-
Draw_Shape(LogicSurface, CameoDrawer, cameo_shape, 0, pos_xy, window_rect, ShapeFlagsType(SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_ALPHA|SHAPE_NORMAL));
894+
Draw_Shape(*LogicSurface, *CameoDrawer, cameo_shape, 0, *pos_xy, *window_rect, SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_ALPHA|SHAPE_NORMAL);
895895
}
896896

897897
JMP(0x00428B13);

src/extensions/buildingtype/buildingtypeext_hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ DECLARE_PATCH(_BuildingTypeClass_DTOR_Free_Image_Patch) { GET_REGISTER_STATIC(Bu
207207
DECLARE_PATCH(_BuildingTypeClass_Get_Image_Data_Assertion_Patch)
208208
{
209209
GET_REGISTER_STATIC(BuildingTypeClass *, this_ptr, esi);
210-
GET_REGISTER_STATIC(const ShapeFileStruct *, image, eax);
210+
GET_REGISTER_STATIC(const ShapeSet *, image, eax);
211211

212212
if (image == nullptr) {
213213
DEBUG_WARNING("Building %s has NULL image data!\n", this_ptr->Name());

src/extensions/cell/cellext_hooks.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
DECLARE_PATCH(_CellClass_Draw_Shroud_Fog_Patch)
5252
{
5353
static bool _shroud_one_time = false;
54-
static const ShapeFileStruct *_shroud_shape;
55-
static const ShapeFileStruct *_fog_shape;
54+
static const ShapeSet *_shroud_shape;
55+
static const ShapeSet *_fog_shape;
5656

5757
/**
5858
* Stolen bytes/code.
@@ -63,17 +63,17 @@ DECLARE_PATCH(_CellClass_Draw_Shroud_Fog_Patch)
6363
* Perform a one-time load of the shroud and fog shape data.
6464
*/
6565
if (!_shroud_one_time) {
66-
_shroud_shape = (const ShapeFileStruct *)MFCC::Retrieve("SHROUD.SHP");
67-
_fog_shape = (const ShapeFileStruct *)MFCC::Retrieve("FOG.SHP");
66+
_shroud_shape = (const ShapeSet *)MFCC::Retrieve("SHROUD.SHP");
67+
_fog_shape = (const ShapeSet *)MFCC::Retrieve("FOG.SHP");
6868
_shroud_one_time = true;
6969
}
7070

7171
/**
7272
* If we are playing a multiplayer game, use the hardcoded shape data.
7373
*/
7474
if (!Session.Singleplayer_Game()) {
75-
Cell_ShroudShape = (const ShapeFileStruct *)&ShroudShapeBinary;
76-
Cell_FogShape = (const ShapeFileStruct *)&FogShapeBinary;
75+
Cell_ShroudShape = (const ShapeSet *)&ShroudShapeBinary;
76+
Cell_FogShape = (const ShapeSet *)&FogShapeBinary;
7777

7878
} else {
7979
Cell_ShroudShape = _shroud_shape;
@@ -98,7 +98,7 @@ DECLARE_PATCH(_CellClass_Draw_Shroud_Fog_Patch)
9898
DECLARE_PATCH(_CellClass_Draw_Fog_Patch)
9999
{
100100
static bool _fog_one_time = false;
101-
static const ShapeFileStruct *_fog_shape;
101+
static const ShapeSet *_fog_shape;
102102

103103
/**
104104
* Stolen bytes/code.
@@ -109,15 +109,15 @@ DECLARE_PATCH(_CellClass_Draw_Fog_Patch)
109109
* Perform a one-time load of the fog shape data.
110110
*/
111111
if (!_fog_one_time) {
112-
_fog_shape = (const ShapeFileStruct *)MFCC::Retrieve("FOG.SHP");
112+
_fog_shape = (const ShapeSet *)MFCC::Retrieve("FOG.SHP");
113113
_fog_one_time = true;
114114
}
115115

116116
/**
117117
* If we are playing a multiplayer game, use the hardcoded shape data.
118118
*/
119119
if (!Session.Singleplayer_Game()) {
120-
Cell_FixupFogShape = (const ShapeFileStruct *)&FogShapeBinary;
120+
Cell_FixupFogShape = (const ShapeSet *)&FogShapeBinary;
121121

122122
} else {
123123
Cell_FixupFogShape = _fog_shape;

src/extensions/infantry/infantryext_hooks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
static class InfantryClassExt : public InfantryClass
6969
{
7070
public:
71-
const ShapeFileStruct* _Get_Image_Data() const;
71+
const ShapeSet* _Get_Image_Data() const;
7272
};
7373

7474

@@ -82,7 +82,7 @@ static class InfantryClassExt : public InfantryClass
8282
*
8383
* @author: ZivDero
8484
*/
85-
const ShapeFileStruct* InfantryClassExt::_Get_Image_Data() const
85+
const ShapeSet* InfantryClassExt::_Get_Image_Data() const
8686
{
8787
if (Doing == DO_STRUGGLE && Rule->WebbedInfantry) {
8888
return Rule->WebbedInfantry->Get_Image_Data();

src/extensions/isotiletype/isotiletypeext_hooks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
static class IsometricTileTypeClassExt : public IsometricTileTypeClass
4848
{
4949
public:
50-
const ShapeFileStruct * _Get_Image_Data();
50+
const ShapeSet * _Get_Image_Data();
5151
};
5252

5353

@@ -56,7 +56,7 @@ static class IsometricTileTypeClassExt : public IsometricTileTypeClass
5656
*
5757
* @author: CCHyper
5858
*/
59-
const ShapeFileStruct * IsometricTileTypeClassExt::_Get_Image_Data()
59+
const ShapeSet * IsometricTileTypeClassExt::_Get_Image_Data()
6060
{
6161
if (Image) {
6262
return Image;

src/extensions/objecttype/objecttypeext_hooks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static class ObjectTypeClassExt : public ObjectTypeClass
5959
{
6060
public:
6161
void _Assign_Theater_Name(char *buffer, TheaterType theater);
62-
const ShapeFileStruct * _Get_Image_Data() const;
62+
const ShapeSet * _Get_Image_Data() const;
6363
void _Fetch_Voxel_Image();
6464
static void _Clear_Voxel_Indexes();
6565
};
@@ -150,7 +150,7 @@ DECLARE_PATCH(_ObjectTypeClass_Load_Theater_Art_Assign_Theater_Name_Theater_Patc
150150
*
151151
* @author: CCHyper
152152
*/
153-
const ShapeFileStruct * ObjectTypeClassExt::_Get_Image_Data() const
153+
const ShapeSet * ObjectTypeClassExt::_Get_Image_Data() const
154154
{
155155
if (Image == nullptr) {
156156
DEBUG_WARNING("Object %s has NULL image data!\n", Name());

src/extensions/overlaytype/overlaytypeext_hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ DECLARE_PATCH(_OverlayTypeClass_SDDTOR_Free_Image_Patch) { GET_REGISTER_STATIC(O
8888
DECLARE_PATCH(_OverlayTypeClass_Get_Image_Data_Assertion_Patch)
8989
{
9090
GET_REGISTER_STATIC(OverlayTypeClass *, this_ptr, esi);
91-
GET_REGISTER_STATIC(const ShapeFileStruct *, image, eax);
91+
GET_REGISTER_STATIC(const ShapeSet *, image, eax);
9292

9393
if (image == nullptr) {
9494
DEBUG_WARNING("Overlay %s has NULL image data!\n", this_ptr->Name());

0 commit comments

Comments
 (0)