Removed RenderedFrameObjects and replaced with lastFrameRendered.

This commit is contained in:
Justin Marshall
2020-07-23 11:26:08 -07:00
parent e55af30b13
commit 2c94154079
3 changed files with 5 additions and 9 deletions
+2 -4
View File
@@ -84,10 +84,8 @@
*/
#include "SidebarGlyphx.h"
std::vector<const ObjectClass*> renderedFrameObjects;
bool HasRenderedObject(const ObjectClass* technoClass) {
return std::find(renderedFrameObjects.begin(), renderedFrameObjects.end(), technoClass) != renderedFrameObjects.end();
return technoClass->lastRenderTime == g_startFrameTime;
}
/***********************************************************************************************
@@ -1445,7 +1443,7 @@ void CellClass::Draw_It(int x, int y, bool objects)
continue;
}
renderedFrameObjects.push_back(object);
object->lastRenderTime = g_startFrameTime;
int xx,yy;
if (object->IsToDisplay && (!object->Is_Techno() || ((TechnoClass *)object)->Visual_Character() == VISUAL_NORMAL) && Map.Coord_To_Pixel(object->Render_Coord(), xx, yy)) {
{
+2
View File
@@ -55,6 +55,8 @@ class TriggerClass;
class ObjectClass : public AbstractClass
{
public:
int lastRenderTime;
/*
** The object can be in one of two states -- placed down on the map, or not. If the
** object is placed down on the map, then this flag will be true.
+1 -5
View File
@@ -81,8 +81,6 @@ SDL_GLContext game_context;
int OverlappedVideoBlits = 0;
float animFrameNum = 0;
extern std::vector<const ObjectClass*> renderedFrameObjects;
bool renderConsole = false;
void (*Misc_Focus_Loss_Function)(void) = nullptr;
@@ -606,9 +604,7 @@ void ImGui_NewFrame(void) {
ImGui_ImplOpenGL3_NewFrame();
ImGui::NewFrame(show_oldframebuffer);
ImGui_ImplSDL2_NewFrame(game_window);
renderedFrameObjects.clear();
ImGui_ImplSDL2_NewFrame(game_window);
}
void Device_Present(void) {