Skip to content

Commit 7a6717e

Browse files
committed
cleanup and documentation
1 parent 920e062 commit 7a6717e

File tree

14 files changed

+106
-116
lines changed

14 files changed

+106
-116
lines changed

Source/Entities/MOSParticle.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,9 @@ void MOSParticle::Draw(BITMAP* targetBitmap, const Vector& targetPos, DrawMode m
203203
break;
204204
case g_DrawTrans:
205205
DrawTexture(m_aSprite[m_Frame], spriteX, spriteY, {255, 255, 255, g_FrameMan.GetCurrentAlpha()});
206-
// draw_trans_sprite(targetBitmap, m_aSprite[m_Frame], spriteX, spriteY);
207206
break;
208207
case g_DrawAlpha:
209208
DrawTexture(m_aSprite[m_Frame], spriteX, spriteY, {255, 255, 255, 255});
210-
// set_alpha_blender();
211-
// draw_trans_sprite(targetBitmap, m_aSprite[m_Frame], spriteX, spriteY);
212209
break;
213210
case g_DrawMOID:
214211
break;

Source/Entities/MOSRotating.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,13 +1669,6 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
16691669
}
16701670

16711671
if (mode == g_DrawTrans) {
1672-
clear_to_color(pTempBitmap, keyColor);
1673-
1674-
// Draw the rotated thing onto the intermediate bitmap so its COM position aligns with the middle of the temp bitmap.
1675-
// The temp bitmap should be able to hold the full size since it is larger than the max diameter.
1676-
// Take into account the h-flipped pivot point
1677-
pivot_scaled_sprite(pTempBitmap, pFlipBitmap, pTempBitmap->w / 2, pTempBitmap->h / 2, pFlipBitmap->w + m_SpriteOffset.m_X, -(m_SpriteOffset.m_Y), ftofix(m_Rotation.GetAllegroAngle()), ftofix(m_Scale));
1678-
16791672
// Draw the now rotated object's temporary bitmap onto the final drawing bitmap with transperency
16801673
// Do the passes loop in here so the intermediate drawing doesn't get done multiple times
16811674
for (int i = 0; i < passes; ++i) {
@@ -1686,7 +1679,6 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
16861679
{aDrawPos[i].m_X, aDrawPos[i].m_Y, static_cast<float>(m_aSprite[m_Frame]->w), static_cast<float>(m_aSprite[m_Frame]->h)},
16871680
{m_aSprite[m_Frame]->w + m_SpriteOffset.m_X , -m_SpriteOffset.m_Y}, m_Rotation.GetRadAngle(), {255, 255, 255, g_FrameMan.GetCurrentAlpha()});
16881681
g_SceneMan.RegisterDrawing(pTargetBitmap, g_NoMOID, spriteX, spriteY, spriteX + pTempBitmap->w, spriteY + pTempBitmap->h);
1689-
//draw_trans_sprite(pTargetBitmap, pTempBitmap, spriteX, spriteY);
16901682
}
16911683
} else {
16921684
// Do the passes loop in here so the flipping operation doesn't get done multiple times
@@ -1704,13 +1696,6 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
17041696
}
17051697
} else {
17061698
if (mode == g_DrawTrans) {
1707-
clear_to_color(pTempBitmap, keyColor);
1708-
1709-
// Draw the rotated thing onto the intermediate bitmap so its COM position aligns with the middle of the temp bitmap.
1710-
// The temp bitmap should be able to hold the full size since it is larger than the max diameter.
1711-
// Take into account the h-flipped pivot point
1712-
pivot_scaled_sprite(pTempBitmap, m_aSprite[m_Frame], pTempBitmap->w / 2, pTempBitmap->h / 2, -m_SpriteOffset.GetFloorIntX(), -m_SpriteOffset.GetFloorIntY(), ftofix(m_Rotation.GetAllegroAngle()), ftofix(m_Scale));
1713-
17141699
// Draw the now rotated object's temporary bitmap onto the final drawing bitmap with transperency
17151700
// Do the passes loop in here so the intermediate drawing doesn't get done multiple times
17161701
for (int i = 0; i < passes; ++i) {
@@ -1721,7 +1706,6 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
17211706
int spriteX = aDrawPos[i].GetFloorIntX() - (pTempBitmap->w / 2);
17221707
int spriteY = aDrawPos[i].GetFloorIntY() - (pTempBitmap->h / 2);
17231708
g_SceneMan.RegisterDrawing(pTargetBitmap, g_NoMOID, spriteX, spriteY, spriteX + pTempBitmap->w, spriteY + pTempBitmap->h);
1724-
// draw_trans_sprite(pTargetBitmap, pTempBitmap, spriteX, spriteY);
17251709
}
17261710
} else {
17271711
for (int i = 0; i < passes; ++i) {

Source/Entities/PieMenu.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,9 @@ void PieMenu::Draw(BITMAP* targetBitmap, const Vector& targetPos) const {
638638
if (m_EnabledState != EnabledState::Disabled) {
639639
if (m_DrawBackgroundTransparent && !g_FrameMan.IsInMultiplayerMode()) {
640640
g_FrameMan.SetTransTableFromPreset(TransparencyPreset::MoreTrans);
641-
//draw_trans_sprite(targetBitmap, m_BGBitmap, drawPos.GetFloorIntX() - m_BGBitmap->w / 2, drawPos.GetFloorIntY() - m_BGBitmap->h / 2);
642641
g_GLResourceMan.UpdateDynamicBitmap(m_BGBitmap, true);
643642
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(m_BGBitmap), drawPos.GetFloorIntX() - m_BGBitmap->w / 2, drawPos.GetFloorIntY() - m_BGBitmap->h / 2, {255, 255, 255, g_FrameMan.GetCurrentAlpha()});
644643
} else {
645-
//draw_sprite(targetBitmap, m_BGBitmap, drawPos.GetFloorIntX() - m_BGBitmap->w / 2, drawPos.GetFloorIntY() - m_BGBitmap->h / 2);
646644
g_GLResourceMan.UpdateDynamicBitmap(m_BGBitmap, true);
647645
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(m_BGBitmap), drawPos.GetFloorIntX() - m_BGBitmap->w / 2, drawPos.GetFloorIntY() - m_BGBitmap->h / 2, {255, 255, 255, 255});
648646
}
@@ -959,59 +957,6 @@ void PieMenu::CalculateDrawPosition(const BITMAP* targetBitmap, const Vector& ta
959957
}
960958
}
961959

962-
void PieMenu::DrawMenuBackground() {
963-
int centerX = IsSubPieMenu() ? 0 : m_BGBitmap->w / 2;
964-
int centerY = IsSubPieMenu() ? 0 : m_BGBitmap->h / 2;
965-
if (m_DirectionIfSubPieMenu == Directions::Up || m_DirectionIfSubPieMenu == Directions::Left) {
966-
centerX = m_BGBitmap->w;
967-
}
968-
if (m_DirectionIfSubPieMenu == Directions::Up || m_DirectionIfSubPieMenu == Directions::Right) {
969-
centerY = m_BGBitmap->h;
970-
}
971-
if (m_DirectionIfSubPieMenu == Directions::Down) {
972-
centerX = -2;
973-
centerY = -2;
974-
}
975-
if (m_DirectionIfSubPieMenu == Directions::Left) {
976-
centerY = -2;
977-
}
978-
float subPieMenuRotationOffset = IsSubPieMenu() ? c_QuarterPI : 0;
979-
980-
bool pieMenuNeedsToBeDrawnRotated = GetRotAngle() - subPieMenuRotationOffset != 0;
981-
BITMAP* bitmapToDrawTo = pieMenuNeedsToBeDrawnRotated ? m_BGRotationBitmap : m_BGBitmap;
982-
983-
bool hasPieSliceWithSubPieMenu = false;
984-
for (const PieSlice* pieSlice: m_CurrentPieSlices) {
985-
if (pieSlice->GetSubPieMenu()) {
986-
hasPieSliceWithSubPieMenu = true;
987-
break;
988-
}
989-
}
990-
991-
DrawRing(Vector2(centerX, centerY), m_CurrentInnerRadius, m_CurrentInnerRadius + m_BackgroundThickness, 0, 2*PI, 36, {255, 255, 255, 75});
992-
993-
if (m_EnabledState == EnabledState::Enabled) {
994-
if (hasPieSliceWithSubPieMenu) {
995-
clear_to_color(m_BGPieSlicesWithSubPieMenuBitmap, ColorKeys::g_MaskColor);
996-
circlefill(m_BGPieSlicesWithSubPieMenuBitmap, centerX, centerY, m_CurrentInnerRadius + m_BackgroundThickness + c_PieSliceWithSubPieMenuExtraThickness, m_BackgroundColor);
997-
}
998-
DrawBackgroundPieSliceSeparators(bitmapToDrawTo, centerX, centerY, subPieMenuRotationOffset);
999-
if (hasPieSliceWithSubPieMenu) {
1000-
circlefill(m_BGPieSlicesWithSubPieMenuBitmap, centerX, centerY, m_CurrentInnerRadius + m_BackgroundThickness, ColorKeys::g_MaskColor);
1001-
draw_sprite(m_BGPieSlicesWithSubPieMenuBitmap, bitmapToDrawTo, 0, 0);
1002-
clear_to_color(bitmapToDrawTo, ColorKeys::g_MaskColor);
1003-
draw_sprite(bitmapToDrawTo, m_BGPieSlicesWithSubPieMenuBitmap, 0, 0);
1004-
}
1005-
}
1006-
1007-
if (bitmapToDrawTo != m_BGBitmap) {
1008-
clear_to_color(m_BGBitmap, ColorKeys::g_MaskColor);
1009-
float rotationAsAllegroAngle = ((GetRotAngle() - subPieMenuRotationOffset) / c_PI) * -128.0F;
1010-
pivot_sprite(m_BGBitmap, bitmapToDrawTo, m_BGBitmap->w / 2, m_BGBitmap->h / 2, centerX, centerY, ftofix(rotationAsAllegroAngle));
1011-
}
1012-
m_BGBitmapNeedsRedrawing = false;
1013-
m_BGPieSlicesWithSubPieMenuBitmapNeedsRedrawing = false;
1014-
}
1015960
void PieMenu::DrawPieIcons(BITMAP* targetBitmap, const Vector& drawPos) const {
1016961
for (const PieSlice* pieSlice: m_CurrentPieSlices) {
1017962
BITMAP* pieSliceIcon = pieSlice->GetAppropriateIcon(pieSlice == m_HoveredPieSlice);

Source/Entities/PieMenu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,6 @@ namespace RTE {
404404
/// @param drawPos Out parameter, a Vector to be filled in with the position at which the PieMenu should be drawn.
405405
void CalculateDrawPosition(const BITMAP* targetBitmap, const Vector& targetPos, Vector& drawPos) const;
406406

407-
408-
void DrawMenuBackground();
409407
/// Handles drawing icons for PieSlices' visual representation in the PieMenu.
410408
/// @param targetBitmap A pointer to the BITMAP to draw on. Generally a screen BITMAP.
411409
/// @param drawPos The seam corrected position at which the PieMenu is being drawn.

Source/Entities/SLBackground.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,31 +222,21 @@ void SLBackground::Draw(const Box& targetDimensions, Box& targetBox, bool offset
222222
int targetBoxWidth = static_cast<int>(targetBox.GetWidth());
223223
int targetBoxHeight = static_cast<int>(targetBox.GetHeight());
224224

225-
//rlDrawRenderBatchActive();
226-
//rlEnableScissorTest();
227-
//glScissor(targetBoxCornerX, targetBoxCornerY, targetBoxCornerX + targetBoxWidth - 1, targetBoxCornerY + targetBoxHeight - 1);
228-
229225
// Detect if non-wrapping layer dimensions can't cover the whole target area with its main bitmap. If so, fill in the gap with appropriate solid color sampled from the hanging edge.
230226
if (!m_WrapX && bitmapWidth <= targetBoxWidth) {
231227
if (m_FillColorLeft != ColorKeys::g_MaskColor && m_Offset.GetFloorIntX() != 0) {
232228
DrawRectangle(targetBoxCornerX, targetBoxCornerY, -m_Offset.m_X, targetBoxHeight, {static_cast<unsigned char>(m_FillColorLeft), 0, 0, 255});
233-
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY, targetBoxCornerX - m_Offset.GetFloorIntX(), targetBoxCornerY + targetBoxHeight, m_FillColorLeft);
234229
}
235230
if (m_FillColorRight != ColorKeys::g_MaskColor) {
236231
DrawRectangle(targetBoxCornerX + bitmapWidth - m_Offset.m_X, targetBoxCornerY, targetBoxWidth - bitmapWidth + m_Offset.m_X, targetBoxHeight, {static_cast<unsigned char>(m_FillColorRight), 0, 0, 255});
237-
// rectfill(targetBitmap, targetBoxCornerX + bitmapWidth - m_Offset.GetFloorIntX(), targetBoxCornerY, targetBoxCornerX + targetBoxWidth, targetBoxCornerY + targetBoxHeight, m_FillColorRight);
238232
}
239233
}
240234
if (!m_WrapY && bitmapHeight <= targetBoxHeight) {
241235
if (m_FillColorUp != ColorKeys::g_MaskColor && m_Offset.GetFloorIntY() != 0) {
242236
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, - m_Offset.m_Y, {static_cast<unsigned char>(m_FillColorUp), 0, 0, 255});
243-
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY, targetBoxCornerX + targetBoxWidth, targetBoxCornerY - m_Offset.GetFloorIntY(), m_FillColorUp);
244237
}
245238
if (m_FillColorDown != ColorKeys::g_MaskColor) {
246239
DrawRectangle(targetBoxCornerX, targetBoxCornerY + bitmapHeight - m_Offset.m_Y, targetBoxWidth, targetBoxHeight - bitmapHeight + m_Offset.m_Y, {static_cast<unsigned char>(m_FillColorDown), 0, 0, 255});
247-
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY + bitmapHeight - m_Offset.GetFloorIntY(), targetBoxCornerX + targetBoxWidth, targetBoxCornerY + targetBoxHeight, m_FillColorDown);
248240
}
249241
}
250-
//rlDrawRenderBatchActive();
251-
//rlDisableScissorTest();
252242
}

Source/Entities/SLTerrain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace RTE {
186186
void Update() override;
187187

188188
/// Draws this SLTerrain's current scrolled position to a bitmap.
189-
/// @param targetBitmap The bitmap to draw to.
189+
/// @param targetDimensions Dimensions of the draw target.
190190
/// @param targetBox The box on the target bitmap to limit drawing to, with the corner of box being where the scroll position lines up.
191191
/// @param offsetNeedsScrollRatioAdjustment Whether the offset of this SceneLayer or the passed in offset override need to be adjusted to scroll ratio.
192192
void Draw(const Box& targetDimensions, Box& targetBox, bool offsetNeedsScrollRatioAdjustment = false) override;

Source/Entities/SceneLayer.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace RTE {
195195
virtual void Update() {}
196196

197197
/// Draws this SceneLayer's current scrolled position to a bitmap.
198-
/// @param targetBitmap The bitmap to draw to.
198+
/// @param targetDimensions Dimensions of the draw target.
199199
/// @param targetBox The box on the target bitmap to limit drawing to, with the corner of box being where the scroll position lines up.
200200
/// @param offsetNeedsScrollRatioAdjustment Whether the offset of this SceneLayer or the passed in offset override need to be adjusted to scroll ratio.
201201
virtual void Draw(const Box& targetDimensions, Box& targetBox, bool offsetNeedsScrollRatioAdjustment = false);
@@ -204,7 +204,7 @@ namespace RTE {
204204
protected:
205205
ContentFile m_BitmapFile; //!< ContentFile containing the path to this SceneLayer's sprite file.
206206

207-
std::unique_ptr<BigTexture> m_MainTexture;
207+
std::unique_ptr<BigTexture> m_MainTexture; //!< The Main texture of this SceneLayer, may be tiled for very large scenes.
208208
BITMAP* m_MainBitmap; //!< The main BITMAP of this SceneLayer.
209209
BITMAP* m_BackBitmap; //!< The backbuffer BITMAP of this SceneLayer.
210210

@@ -214,7 +214,7 @@ namespace RTE {
214214
std::vector<IntRect> m_Drawings; //!< All the areas drawn within on this SceneLayer since the last clear.
215215

216216
bool m_MainBitmapOwned; //!< Whether the main bitmap is owned by this.
217-
bool m_MainBitmapUpdated;
217+
bool m_MainBitmapUpdated; //!< Whether the main bitmap was updated since the last draw.
218218
bool m_DrawMasked; //!< Whether pixels marked as transparent (index 0, magenta) are skipped when drawing or not (masked drawing).
219219

220220
bool m_WrapX; //!< Whether wrapping is enabled on the X axis.
@@ -240,6 +240,9 @@ namespace RTE {
240240
bool ForceBoundsOrWrapPosition(Vector& pos, bool forceBounds) const;
241241

242242
#pragma region Draw Breakdown
243+
244+
/// @brief Update the target region of the current frontbuffer texture.
245+
/// @param targetBox The region to update (will be wrapped if neccessary)
243246
void UpdateTargetRegion(const Box& targetBox);
244247

245248
/// Performs tiled drawing of this SceneLayer's bitmap to the screen in cases where the target bitmap is larger in some dimension.
@@ -303,6 +306,7 @@ namespace RTE {
303306
static Entity::ClassInfo m_sClass; //!< ClassInfo for this class.
304307
};
305308

309+
/// SceneLayer that promises to never update its MainBitmap.
306310
class StaticSceneLayer : public SceneLayerImpl<false, true> {
307311
public:
308312
EntityAllocation(StaticSceneLayer);

Source/Managers/FrameMan.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void FrameMan::ResetSplitScreens(bool hSplit, bool vSplit) {
269269
clear_to_color(m_PlayerScreen8.get(), 0);
270270
set_clip_state(m_PlayerScreen8.get(), 1);
271271

272-
m_PlayerScreen = std::make_unique<RenderTarget>(FloatRect(0, 0, g_WindowMan.GetResX() / (m_VSplit ? 2 : 1), g_WindowMan.GetResY() / (m_HSplit ? 2 : 1)), FloatRect(0, 0, g_WindowMan.GetResX() / (m_VSplit ? 2 : 1), g_WindowMan.GetResY() / (m_HSplit ? 2 : 1)), 8, g_GLResourceMan.GetStaticTextureFromBitmap(m_PlayerScreen8.get()));
272+
m_PlayerScreen = std::make_unique<RenderTarget>(FloatRect(0, 0, g_WindowMan.GetResX() / (m_VSplit ? 2 : 1), g_WindowMan.GetResY() / (m_HSplit ? 2 : 1)), FloatRect(0, 0, g_WindowMan.GetResX() / (m_VSplit ? 2 : 1), g_WindowMan.GetResY() / (m_HSplit ? 2 : 1)), 32, g_GLResourceMan.GetStaticTextureFromBitmap(m_PlayerScreen8.get()));
273273

274274
// Update these to represent the split screens
275275
m_PlayerScreenWidth = m_PlayerScreen->GetSize().w;
@@ -811,14 +811,7 @@ void FrameMan::Draw() {
811811
g_PresetMan.GetEntityPreset("Shader", "Background")->Clone(&backgroundShader);
812812
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
813813
clear_to_color(m_BackBuffer8.get(), 0);
814-
rlEnableColorBlend();
815-
rlSetBlendMode(RL_BLEND_ALPHA);
816-
rlEnableDepthTest();
817814
m_BackBuffer->Begin(true);
818-
backgroundShader.Begin();
819-
backgroundShader.Enable();
820-
rlSetUniformSampler(backgroundShader.GetUniformLocation("rtePalette"), g_PostProcessMan.GetPaletteTexture());
821-
backgroundShader.SetInt("drawMasked", 1);
822815

823816
// Count how many split screens we'll need
824817
int screenCount = (m_HSplit ? 2 : 1) * (m_VSplit ? 2 : 1);
@@ -835,9 +828,16 @@ void FrameMan::Draw() {
835828
for (int playerScreen = 0; playerScreen < screenCount; ++playerScreen) {
836829
screenRelativeEffects.clear();
837830
screenRelativeGlowBoxes.clear();
831+
rlEnableColorBlend();
832+
rlSetBlendMode(RL_BLEND_ALPHA);
833+
rlEnableDepthTest();
838834

839835
m_PlayerScreen->Begin(true);
840-
836+
backgroundShader.Begin();
837+
backgroundShader.Enable();
838+
rlSetUniformSampler(backgroundShader.GetUniformLocation("rtePalette"), g_PostProcessMan.GetPaletteTexture());
839+
backgroundShader.SetInt("drawMasked", 1);
840+
841841
//rlSetUniformSampler(backgroundShader.GetUniformLocation("rtePalette"), g_PostProcessMan.GetPaletteTexture());
842842
BITMAP* drawScreen = (screenCount == 1) ? m_BackBuffer8.get() : m_PlayerScreen8.get();
843843
BITMAP* drawScreenGUI = (screenCount == 1) ? m_BackBuffer8.get() : m_PlayerScreen8.get();
@@ -920,8 +920,12 @@ void FrameMan::Draw() {
920920
// Draw the intermediate draw splitscreen to the appropriate spot on the back buffer
921921
blit(drawScreen, m_BackBuffer8.get(), 0, 0, screenOffset.GetFloorIntX(), screenOffset.GetFloorIntY(), drawScreen->w, drawScreen->h);
922922
m_PlayerScreen->End();
923-
m_BackBuffer->Begin(false);
924-
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(m_PlayerScreen8.get()), screenOffset.m_X, screenOffset.m_Y, {255, 255, 255, 255});
923+
backgroundShader.End();
924+
if (screenCount > 1) {
925+
m_BackBuffer->Begin(false);
926+
DrawTextureRec(g_GLResourceMan.GetStaticTextureFromBitmap(m_PlayerScreen8.get()), {0, 0, static_cast<float>(m_PlayerScreen8->w), -static_cast<float>(m_PlayerScreen8->h)}, {screenOffset.m_X, screenOffset.m_Y}, {255, 255, 255, 255});
927+
m_BackBuffer->End();
928+
}
925929
g_PostProcessMan.AdjustEffectsPosToPlayerScreen(playerScreen, drawScreen, screenOffset, screenRelativeEffects, screenRelativeGlowBoxes);
926930
}
927931
}
@@ -960,9 +964,14 @@ void FrameMan::Draw() {
960964
}
961965
rlDisableDepthTest();
962966
g_GLResourceMan.UpdateDynamicBitmap(m_BackBuffer8.get(), true);
967+
backgroundShader.Begin();
968+
backgroundShader.Enable();
969+
rlSetUniformSampler(backgroundShader.GetUniformLocation("rtePalette"), g_PostProcessMan.GetPaletteTexture());
970+
backgroundShader.SetInt("drawMasked", 1);
971+
m_BackBuffer->Begin(false);
963972
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(m_BackBuffer8.get()), 0.0f, 0.0f, {255, 255, 255, 255});
964-
backgroundShader.End();
965973
m_BackBuffer->End();
974+
backgroundShader.End();
966975
if (g_ActivityMan.IsInActivity()) {
967976
g_PostProcessMan.PostProcess();
968977
}

Source/Managers/FrameMan.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ namespace RTE {
335335
/// @return An reference to a ContentFile which described the palette location.
336336
const ContentFile& GetPaletteFile() const { return m_PaletteFile; }
337337

338+
/// Getter for the default palette for image loading purposes, etc.
339+
/// @return Const reference to the default palette.
338340
const PALETTE& GetDefaultPalette() const { return m_DefaultPalette; }
339341

340342
/// Fades the palette in from black at a specified speed.
@@ -400,7 +402,7 @@ namespace RTE {
400402
/// The key is an array of the RGBA values. The value is a pair of the color table itself and a time stamp of when it was last accessed for use during color table pruning.
401403
std::array<std::unordered_map<std::array<int, 4>, std::pair<COLOR_MAP, long long>>, DrawBlendMode::BlendModeCount> m_ColorTables;
402404
Timer m_ColorTablePruneTimer; //!< Timer for pruning unused color tables to prevent ridiculous memory usage.
403-
int m_CurrentAlpha;
405+
int m_CurrentAlpha; //!< Current alpha level for emulating trans colortables.
404406

405407
std::shared_ptr<BITMAP> m_PlayerScreen8; //!< Intermediary split screen bitmap.
406408
std::shared_ptr<RenderTarget> m_PlayerScreen; //!< Intermediary split screen bitmap.
@@ -438,7 +440,7 @@ namespace RTE {
438440
std::unique_ptr<BITMAP, BitmapDeleter> m_NetworkBackBufferFinal8[2][c_MaxScreenCount]; //!< Per-player allocated frame buffer to copy Intermediate before sending.
439441
std::unique_ptr<BITMAP, BitmapDeleter> m_NetworkBackBufferFinalGUI8[2][c_MaxScreenCount]; //!< Per-player allocated frame buffer to copy Intermediate before sending. Used to draw UI only.
440442

441-
std::shared_ptr<RenderTarget> m_BackBuffer;
443+
std::shared_ptr<RenderTarget> m_BackBuffer; //!< Main render backbuffer.
442444

443445
Vector m_TargetPos[2][c_MaxScreenCount]; //!< Frame target position for network players.
444446

0 commit comments

Comments
 (0)