mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Shroud now renders with a circle alpha image, shrouded terrain no longer renders and is no longer simply covered with a black rectangle. Creating skirmish maps in multiplayer no longer causes a crash.
This commit is contained in:
@@ -1421,6 +1421,7 @@ void CellClass::Draw_It(int x, int y, bool objects)
|
||||
if (HasRenderedObject(object)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
renderedFrameObjects.push_back(object);
|
||||
int xx,yy;
|
||||
if (object->IsToDisplay && (!object->Is_Techno() || ((TechnoClass *)object)->Visual_Character() == VISUAL_NORMAL) && Map.Coord_To_Pixel(object->Render_Coord(), xx, yy)) {
|
||||
|
||||
+26
-25
@@ -116,7 +116,7 @@ unsigned char DisplayClass::UnitShadow[(USHADOW_COL_COUNT+1)*256];
|
||||
unsigned char DisplayClass::UnitShadowAir[(USHADOW_COL_COUNT+1)*256];
|
||||
unsigned char DisplayClass::SpecialGhost[2*256];
|
||||
|
||||
void const * DisplayClass::ShadowShapes;
|
||||
Image_t *DisplayClass::ShadowShapes;
|
||||
unsigned char DisplayClass::ShadowTrans[(SHADOW_COL_COUNT+1)*256];
|
||||
|
||||
/*
|
||||
@@ -236,18 +236,9 @@ void DisplayClass::One_Time(void)
|
||||
TransIconsetHD[0] = Image_LoadImage("ui/trans/trans0.png");
|
||||
TransIconsetHD[1] = Image_LoadImage("ui/trans/trans1.png");
|
||||
TransIconsetHD[2] = Image_LoadImage("ui/trans/trans2.png");
|
||||
// jmarshall end
|
||||
|
||||
#ifndef NDEBUG
|
||||
RawFileClass file("SHADOW.SHP");
|
||||
if (file.Is_Available()) {
|
||||
ShadowShapes = Load_Alloc_Data(file);
|
||||
} else {
|
||||
ShadowShapes = MFCD::Retrieve("SHADOW.SHP");
|
||||
}
|
||||
#else
|
||||
ShadowShapes = MFCD::Retrieve("SHADOW.SHP");
|
||||
#endif
|
||||
ShadowShapes = Image_LoadImage("ui/shroud.png");
|
||||
// jmarshall end
|
||||
|
||||
Set_View_Dimensions(0, 0);
|
||||
}
|
||||
@@ -2275,7 +2266,12 @@ ObjectClass * DisplayClass::Cell_Object(CELL cell, int x, int y) const
|
||||
// continue;
|
||||
// }
|
||||
assert(ptr->IsActive);
|
||||
ptr->Render(forced);
|
||||
// jmarshall - added a Is_Mapped check here so we don't see the trees through shrouded terrain.
|
||||
CellClass* cellptr = &(*this)[ptr->Coord];
|
||||
if (cellptr->Is_Mapped(PlayerPtr) || Debug_Unshroud) {
|
||||
ptr->Render(forced);
|
||||
}
|
||||
// jmarshall end
|
||||
}
|
||||
}
|
||||
BEnd(BENCH_OBJECTS);
|
||||
@@ -2356,6 +2352,9 @@ void DisplayClass::Redraw_Icons(void)
|
||||
CELL cell = Coord_Cell(coord);
|
||||
coord = Coord_Whole(Cell_Coord(cell));
|
||||
|
||||
if (Cell_Shadow(cell, PlayerPtr) >= 0 && !Debug_Unshroud)
|
||||
continue;
|
||||
|
||||
/*
|
||||
** Only cells flagged to be redraw are examined.
|
||||
*/
|
||||
@@ -2399,6 +2398,9 @@ void DisplayClass::Redraw_OIcons(void)
|
||||
CELL cell = Coord_Cell(coord);
|
||||
coord = Coord_Whole(Cell_Coord(cell));
|
||||
|
||||
if (Cell_Shadow(cell, PlayerPtr) >= 0 && !Debug_Unshroud)
|
||||
continue;
|
||||
|
||||
/*
|
||||
** Only cells flagged to be redraw are examined.
|
||||
*/
|
||||
@@ -2465,20 +2467,19 @@ void DisplayClass::Redraw_Shadow(void)
|
||||
if (cellptr->Is_Visible(PlayerPtr)) continue; // Use PlayerPtr since we won't be rendering in MP. ST - 8/6/2019 10:44AM
|
||||
int shadow = -2;
|
||||
//if (cellptr->IsMapped) {
|
||||
if (cellptr->Is_Mapped(PlayerPtr)) { // Use PlayerPtr since we won't be rendering in MP. ST - 8/6/2019 10:44AM
|
||||
shadow = Cell_Shadow(cell, PlayerPtr); // Use PlayerPtr since we won't be rendering in MP. ST - 8/6/2019 10:44AM
|
||||
if (cellptr->Is_Mapped(PlayerPtr)) {
|
||||
shadow = Cell_Shadow(cell, PlayerPtr);
|
||||
}
|
||||
if (shadow >= 0) {
|
||||
CC_Draw_Shape(ShadowShapes, shadow, xpixel, ypixel, WINDOW_TACTICAL, SHAPE_GHOST, NULL, ShadowTrans);
|
||||
} else {
|
||||
if (shadow != -1) {
|
||||
int ww = CELL_PIXEL_W;
|
||||
int hh = CELL_PIXEL_H;
|
||||
|
||||
if (Clip_Rect(&xpixel, &ypixel, &ww, &hh, Lepton_To_Pixel(TacLeptonWidth), Lepton_To_Pixel(TacLeptonHeight)) >= 0) {
|
||||
LogicPage->Fill_Rect(TacPixelX+xpixel, TacPixelY+ypixel, TacPixelX+xpixel+ww-1, TacPixelY+ypixel+hh-1, BLACK);
|
||||
}
|
||||
}
|
||||
int ww = CELL_PIXEL_W;
|
||||
int hh = CELL_PIXEL_H;
|
||||
|
||||
//if (Clip_Rect(&xpixel, &ypixel, &ww, &hh, Lepton_To_Pixel(TacLeptonWidth), Lepton_To_Pixel(TacLeptonHeight)) >= 0) {
|
||||
// LogicPage->Fill_Rect(TacPixelX + xpixel, TacPixelY + ypixel, TacPixelX + xpixel + ww - 1, TacPixelY + ypixel + hh - 1, BLACK);
|
||||
//}
|
||||
|
||||
if (shadow >= 0) {
|
||||
CC_DrawHD_Shape(ShadowShapes, 0, xpixel, ypixel, WINDOW_TACTICAL, SHAPE_GHOST, NULL, ShadowTrans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ public: //ST - 1/21/2019 11:59AM
|
||||
int BandX,BandY;
|
||||
int NewX,NewY;
|
||||
|
||||
static void const *ShadowShapes;
|
||||
static Image_t *ShadowShapes;
|
||||
static unsigned char ShadowTrans[(SHADOW_COL_COUNT+1)*256];
|
||||
|
||||
void Redraw_Icons(void);
|
||||
|
||||
@@ -393,7 +393,7 @@ void RadarClass::Draw_It(bool forced)
|
||||
|
||||
// strcpy(name, "NATORADR.SHP" );
|
||||
// if (Session.Type == GAME_NORMAL) {
|
||||
strcpy(name, _hiresradarnames[PlayerPtr->ActLike]);
|
||||
strcpy(name, _hiresradarnames[PlayerPtr->ActLike % HOUSE_BAD]);
|
||||
// }
|
||||
#ifndef NDEBUG
|
||||
RawFileClass file(name);
|
||||
@@ -409,12 +409,12 @@ void RadarClass::Draw_It(bool forced)
|
||||
} else {
|
||||
RadarPulse = MFCD::Retrieve(name);
|
||||
}
|
||||
strcpy(name, _frames[PlayerPtr->ActLike]);
|
||||
strcpy(name, _frames[PlayerPtr->ActLike % HOUSE_BAD]);
|
||||
RawFileClass file3(name);
|
||||
if (file3.Is_Available()) {
|
||||
RadarFrame = Load_Alloc_Data(file3);
|
||||
} else {
|
||||
RadarFrame = MFCD::Retrieve(_frames[PlayerPtr->ActLike]);
|
||||
RadarFrame = MFCD::Retrieve(_frames[PlayerPtr->ActLike % HOUSE_BAD]);
|
||||
}
|
||||
#else
|
||||
RadarAnim = MFCD::Retrieve(name);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user