diff --git a/code/redalert/cell.h b/code/redalert/cell.h index d117ee8..a2af276 100644 --- a/code/redalert/cell.h +++ b/code/redalert/cell.h @@ -187,6 +187,7 @@ class CellClass int x_screen_pos; int y_screen_pos; int debug_select; + bool inShadow; /* ** Per-player view of whether a cell is mapped. One bit for each house type. ST - 8/2/2019 3:00PM diff --git a/code/redalert/display.cpp b/code/redalert/display.cpp index 6f66e39..910814b 100644 --- a/code/redalert/display.cpp +++ b/code/redalert/display.cpp @@ -1935,12 +1935,14 @@ void DisplayClass::CacheVisibleCells(void) { cellptr->visibleFrame = g_startFrameTime; cellptr->x_world_pos = xpixel; cellptr->y_world_pos = ypixel; + cellptr->inShadow = false; cellDisplayCache[numCachedDisplayCells++].ptr = cellptr; } else { if (Cell_Shadow(cell, PlayerPtr) >= 0) { cellptr->visibleFrame = g_startFrameTime; cellptr->x_world_pos = xpixel; + cellptr->inShadow = true; cellptr->y_world_pos = ypixel; cellDisplayCache[numCachedDisplayCells++].ptr = cellptr; } @@ -2274,6 +2276,9 @@ void DisplayClass::Redraw_OIcons(void) { for (int i = 0; i < numCachedDisplayCells; i++) { CellClass* cellptr = cellDisplayCache[i].ptr; + if (cellptr->inShadow) { + continue; + } cellptr->Draw_It(cellptr->x_world_pos, cellptr->y_world_pos, true); } } @@ -2333,7 +2338,9 @@ void DisplayClass::Redraw_Shadow(void) //} if (shadow >= 0) { + CCGlobalShroudRender = true; CC_DrawHD_Shape(ShadowShapes, shadow, xpixel, ypixel, WINDOW_TACTICAL, SHAPE_GHOST, NULL, ShadowTrans); + CCGlobalShroudRender = false; } } } diff --git a/code/redalert/externs.h b/code/redalert/externs.h index 8271d0a..a39a722 100644 --- a/code/redalert/externs.h +++ b/code/redalert/externs.h @@ -323,6 +323,7 @@ extern HouseClass * PlayerPtr; extern PaletteClass CCPalette; extern void* CCGlobalOveridePalette; extern bool CCGlobalShadowRender; +extern bool CCGlobalShroudRender; extern int CCPaletteHouseColor; extern HSVClass HSVColors[8]; extern PaletteClass BlackPalette; diff --git a/code/redalert/shape.cpp b/code/redalert/shape.cpp index bc16ae2..395495e 100644 --- a/code/redalert/shape.cpp +++ b/code/redalert/shape.cpp @@ -434,6 +434,27 @@ long Buffer_Frame_To_Page(int shapeNum, int x, int y, int width, int height, str xstart = xstart + WindowList[Window][WINDOWX];// + LogicPage->Get_XPos(); ystart = ystart + WindowList[Window][WINDOWY];// + LogicPage->Get_YPos(); + if (CCGlobalShroudRender) { + //if ((shapeNum % 3) == 0) { + // xstart = xstart - 2; + // ystart = ystart - 2; + // width = width + 2; + // height = height + 2; + //} + //else { + xstart = xstart - 2; + ystart = ystart - 2; + width = width + 2; + height = height + 2; + //} + //char tmp[128]; + //sprintf(tmp, "%d", shapeNum); + //GL_DrawForegroundText(6, xstart, ystart, tmp); + + //width = width + 2; + //height = height + 2; + } + //GL_SetClipRect(WindowList[Window][WINDOWX], WindowList[Window][WINDOWY], WindowList[Window][WINDOWWIDTH], WindowList[Window][WINDOWWIDTH]); if(renderHDTexture) GL_RenderImage(shape_image, xstart, ystart, width, height, (int)fade_table, shapeNum);