2424#include " Deployment.h"
2525#include " BunkerAssemblyScheme.h"
2626
27+ #include " GLResourceMan.h"
28+
2729#include < array>
2830#include < string>
2931
@@ -1188,6 +1190,9 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
11881190 if (m_EditorGUIMode == DONEEDITING)
11891191 return ;
11901192
1193+ BITMAP* temp = create_bitmap_ex (bitmap_color_depth (pTargetBitmap), pTargetBitmap->w , pTargetBitmap->h );
1194+ clear_to_color (temp, 0 );
1195+
11911196 // The get a std::list of the currently edited set of placed objects in the Scene
11921197 const std::list<SceneObject*>* pSceneObjectList = 0 ;
11931198 if (m_FeatureSet == ONLOADEDIT)
@@ -1197,22 +1202,22 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
11971202 // Draw the 'original' set of placed scene objects as solid before the blueprints
11981203 const std::list<SceneObject*>* pOriginalsList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::PLACEONLOAD);
11991204 for (std::list<SceneObject*>::const_iterator itr = pOriginalsList->begin (); itr != pOriginalsList->end (); ++itr) {
1200- (*itr)->Draw (pTargetBitmap , targetPos);
1205+ (*itr)->Draw (temp , targetPos);
12011206 // Draw basic HUD if an actor
12021207 Actor* pActor = dynamic_cast <Actor*>(*itr);
12031208 // if (pActor)
1204- // pActor->DrawHUD(pTargetBitmap , targetPos);
1209+ // pActor->DrawHUD(temp , targetPos);
12051210 }
12061211 } else if (m_FeatureSet == AIPLANEDIT) {
12071212 pSceneObjectList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::AIPLAN);
12081213 // Draw the 'original' set of placed scene objects as solid before the planned base
12091214 const std::list<SceneObject*>* pOriginalsList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::PLACEONLOAD);
12101215 for (std::list<SceneObject*>::const_iterator itr = pOriginalsList->begin (); itr != pOriginalsList->end (); ++itr) {
1211- (*itr)->Draw (pTargetBitmap , targetPos);
1216+ (*itr)->Draw (temp , targetPos);
12121217 // Draw basic HUD if an actor
12131218 Actor* pActor = dynamic_cast <Actor*>(*itr);
12141219 // if (pActor)
1215- // pActor->DrawHUD(pTargetBitmap , targetPos);
1220+ // pActor->DrawHUD(temp , targetPos);
12161221 }
12171222 }
12181223
@@ -1226,7 +1231,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
12261231 // Draw the currently held object into the order of the std::list if it is to be placed inside
12271232 if (m_pCurrentObject && m_DrawCurrentObject && i == m_ObjectListOrder) {
12281233 g_FrameMan.SetTransTableFromPreset (m_BlinkTimer.AlternateReal (333 ) || m_EditorGUIMode == PLACINGOBJECT ? TransparencyPreset::LessTrans : TransparencyPreset::HalfTrans);
1229- m_pCurrentObject->Draw (pTargetBitmap , targetPos, g_DrawTrans);
1234+ m_pCurrentObject->Draw (temp , targetPos, g_DrawTrans);
12301235 pActor = dynamic_cast <Actor*>(m_pCurrentObject);
12311236 if (pActor)
12321237 pActor->DrawHUD (pTargetBitmap, targetPos);
@@ -1239,7 +1244,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
12391244 // Blink trans if we are supposed to blink this one
12401245 if ((*itr) == m_pObjectToBlink) {
12411246 g_FrameMan.SetTransTableFromPreset (m_BlinkTimer.AlternateReal (333 ) ? TransparencyPreset::LessTrans : TransparencyPreset::HalfTrans);
1242- (*itr)->Draw (pTargetBitmap , targetPos, g_DrawTrans);
1247+ (*itr)->Draw (temp , targetPos, g_DrawTrans);
12431248 }
12441249 // Drawing of already placed objects that aren't highlighted or anything
12451250 else {
@@ -1250,15 +1255,15 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
12501255 // Animate the ghosted into appearing solid in the build order to make the order clear
12511256 if (i >= m_RevealIndex) {
12521257 g_FrameMan.SetTransTableFromPreset (pActor ? TransparencyPreset::MoreTrans : TransparencyPreset::HalfTrans);
1253- (*itr)->Draw (pTargetBitmap , targetPos, g_DrawTrans);
1258+ (*itr)->Draw (temp , targetPos, g_DrawTrans);
12541259 }
12551260 // Show as non-transparent half the time to still give benefits of WYSIWYG
12561261 else
1257- (*itr)->Draw (pTargetBitmap , targetPos);
1262+ (*itr)->Draw (temp , targetPos);
12581263 }
12591264 // In full scene edit mode, we want to give a WYSIWYG view
12601265 else {
1261- (*itr)->Draw (pTargetBitmap , targetPos);
1266+ (*itr)->Draw (temp , targetPos);
12621267
12631268 // Draw team marks for doors, deployments and assemblies
12641269 Deployment* pDeployment = dynamic_cast <Deployment*>(*itr);
@@ -1299,7 +1304,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
12991304 if ((m_pCurrentObject && !m_pCurrentObject->IsInGroup (" Brains" )) && m_EditorGUIMode != INSTALLINGBRAIN && !(m_EditorGUIMode == PLACINGOBJECT && m_PreviousMode == INSTALLINGBRAIN)) {
13001305 SceneObject* pBrain = g_SceneMan.GetScene ()->GetResidentBrain (m_pController->GetPlayer ());
13011306 if (pBrain) {
1302- pBrain->Draw (pTargetBitmap , targetPos);
1307+ pBrain->Draw (temp , targetPos);
13031308 // Draw basic HUD if an actor
13041309 Actor* pActor = dynamic_cast <Actor*>(pBrain);
13051310 if (pActor)
@@ -1319,7 +1324,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
13191324 // If the held object will be placed at the end of the std::list, draw it last to the scene, transperent blinking
13201325 else if (m_pCurrentObject && (m_ObjectListOrder < 0 || (pSceneObjectList && m_ObjectListOrder == pSceneObjectList->size ()))) {
13211326 g_FrameMan.SetTransTableFromPreset (m_BlinkTimer.AlternateReal (333 ) || m_EditorGUIMode == PLACINGOBJECT ? TransparencyPreset::LessTrans : TransparencyPreset::HalfTrans);
1322- m_pCurrentObject->Draw (pTargetBitmap , targetPos, g_DrawTrans);
1327+ m_pCurrentObject->Draw (temp , targetPos, g_DrawTrans);
13231328 Actor* pActor = dynamic_cast <Actor*>(m_pCurrentObject);
13241329 if (pActor && m_FeatureSet != BLUEPRINTEDIT && m_FeatureSet != AIPLANEDIT)
13251330 pActor->DrawHUD (pTargetBitmap, targetPos);
@@ -1329,6 +1334,16 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
13291334
13301335 // Draw the pie menu
13311336 m_PieMenu->Draw (pTargetBitmap, targetPos);
1337+
1338+ Texture2D tempTexture = g_GLResourceMan.GetStaticTextureFromBitmap (temp);
1339+
1340+ rlZDepth (3 );
1341+ DrawTexture (tempTexture, 0 , 0 , {255 , 255 , 255 , 255 });
1342+ rlZDepth (0 .0f );
1343+ rlDrawRenderBatchActive ();
1344+
1345+ g_GLResourceMan.DestroyBitmapInfo (temp);
1346+ destroy_bitmap (temp);
13321347}
13331348
13341349void SceneEditorGUI::UpdateBrainSkyPathAndCost (Vector brainPos) {
0 commit comments