diff --git a/code/redalert/cell.cpp b/code/redalert/cell.cpp index 786ea96..23048b6 100644 --- a/code/redalert/cell.cpp +++ b/code/redalert/cell.cpp @@ -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)) { diff --git a/code/redalert/display.cpp b/code/redalert/display.cpp index 4cc5dcf..ee907cd 100644 --- a/code/redalert/display.cpp +++ b/code/redalert/display.cpp @@ -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); } } } diff --git a/code/redalert/display.h b/code/redalert/display.h index 2217eb6..e1cf10f 100644 --- a/code/redalert/display.h +++ b/code/redalert/display.h @@ -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); diff --git a/code/redalert/radar.cpp b/code/redalert/radar.cpp index 96b0d0e..1f40905 100644 --- a/code/redalert/radar.cpp +++ b/code/redalert/radar.cpp @@ -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); diff --git a/ui/shroud.png b/ui/shroud.png new file mode 100644 index 0000000..d23656a Binary files /dev/null and b/ui/shroud.png differ