mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-17 08:50:29 +02:00
Patch 1.01 Merge branch 'master' of https://github.com/electronicarts/CnC_Remastered_Collection
# Conflicts, ignored these upstream changes: # REDALERT/MiscAsm.cpp # REDALERT/WIN32LIB/DrawMisc.cpp
This commit is contained in:
+40
-7
@@ -260,6 +260,24 @@ void AnimClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
void const * transtable = NULL;
|
||||
int shapenum = Class->Start + Fetch_Stage();
|
||||
void const * remap = NULL;
|
||||
ShapeFlags_Type flags = SHAPE_CENTER|SHAPE_WIN_REL;
|
||||
bool alt = false;
|
||||
|
||||
/*
|
||||
** Some animations require special fixups.
|
||||
*/
|
||||
switch (Class->Type) {
|
||||
case ANIM_ATOM_BLAST:
|
||||
transtable = Map.UnitShadow;
|
||||
break;
|
||||
|
||||
case ANIM_FLAG:
|
||||
x += (ICON_PIXEL_W / 2) - 2;
|
||||
y += (3 * ICON_PIXEL_H / 4) - Get_Build_Frame_Height(shapefile);
|
||||
transtable = Map.UnitShadow;
|
||||
alt = true;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** If the translucent table hasn't been determined yet, then check to see if it
|
||||
@@ -267,13 +285,19 @@ void AnimClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
*/
|
||||
if (transtable == NULL && Class->IsWhiteTrans) transtable = DisplayClass::WhiteTranslucentTable;
|
||||
if (transtable == NULL && Class->IsTranslucent) transtable = DisplayClass::TranslucentTable;
|
||||
if (Class->Type == ANIM_ATOM_BLAST) transtable = Map.UnitShadow;
|
||||
|
||||
/*
|
||||
** Set the shape flags to properly take into account any fading or ghosting
|
||||
** table necessary.
|
||||
*/
|
||||
ShapeFlags_Type flags = SHAPE_CENTER|SHAPE_WIN_REL;
|
||||
if (alt) {
|
||||
flags = flags | SHAPE_FADING;
|
||||
if (OwnerHouse != HOUSE_NONE) {
|
||||
remap = HouseClass::As_Pointer(OwnerHouse)->Remap_Table(false);
|
||||
} else {
|
||||
remap = ColorRemaps[PCOLOR_GOLD].RemapTable;
|
||||
}
|
||||
}
|
||||
if (transtable != NULL) flags = flags | SHAPE_GHOST;
|
||||
|
||||
/*
|
||||
@@ -357,6 +381,7 @@ short const * AnimClass::Overlap_List(void) const
|
||||
( MAP_CELL_W * 2) - 1, ( MAP_CELL_W * 2), ( MAP_CELL_W * 2) + 1,
|
||||
REFRESH_EOL
|
||||
};
|
||||
static short const OverlapFlag[] = { 0, 1, -MAP_CELL_W, -(MAP_CELL_W-1), MAP_CELL_W, MAP_CELL_W+1, REFRESH_EOL };
|
||||
|
||||
if (IsToDelete) {
|
||||
static short const _list[] = {REFRESH_EOL};
|
||||
@@ -367,6 +392,10 @@ short const * AnimClass::Overlap_List(void) const
|
||||
return(OverlapAtom);
|
||||
}
|
||||
|
||||
if (Class->Type == ANIM_FLAG) {
|
||||
return(OverlapFlag);
|
||||
}
|
||||
|
||||
#ifdef PARTIAL
|
||||
IsTheaterShape = Class->IsTheater;
|
||||
if (Class->Get_Image_Data() != NULL) {
|
||||
@@ -512,7 +541,7 @@ void AnimClass::operator delete(void * ptr)
|
||||
* 05/31/1994 JLB : Created. *
|
||||
* 08/03/1994 JLB : Added a delayed affect parameter. *
|
||||
*=============================================================================================*/
|
||||
AnimClass::AnimClass(AnimType animnum, COORDINATE coord, unsigned char timedelay, unsigned char loop) :
|
||||
AnimClass::AnimClass(AnimType animnum, COORDINATE coord, unsigned char timedelay, char loop) :
|
||||
ObjectClass(RTTI_ANIM, Anims.ID(this)),
|
||||
Class(AnimTypes.Ptr((int)animnum)),
|
||||
xObject(TARGET_NONE),
|
||||
@@ -559,8 +588,12 @@ IsTheaterShape = false;
|
||||
Map.Sight_From(Coord_Cell(coord), Rule.DropZoneRadius / CELL_LEPTON_W, PlayerPtr, false);
|
||||
}
|
||||
|
||||
Loops = (unsigned char)(max(loop, 1) * Class->Loops);
|
||||
Loops = (unsigned char)max(Loops, 1);
|
||||
if (Class->Loops >= 0) {
|
||||
Loops = (char)(max(loop, 1) * Class->Loops);
|
||||
Loops = (char)max(Loops, 1);
|
||||
} else {
|
||||
Loops = Class->Loops;
|
||||
}
|
||||
|
||||
/*
|
||||
** If the animation starts immediately, then play the associated sound effect now.
|
||||
@@ -812,8 +845,8 @@ void AnimClass::AI(void)
|
||||
** Determine if this animation should loop another time. If so, then start the loop
|
||||
** but if not, then proceed into the animation termination handler.
|
||||
*/
|
||||
if (Loops) Loops--;
|
||||
if (Loops) {
|
||||
if (Loops > 0) Loops--;
|
||||
if (Loops != 0) {
|
||||
Set_Stage(Class->LoopStart);
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user