24
24
#include " Deployment.h"
25
25
#include " BunkerAssemblyScheme.h"
26
26
27
+ #include " GLResourceMan.h"
28
+
27
29
#include < array>
28
30
#include < string>
29
31
@@ -1188,6 +1190,9 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1188
1190
if (m_EditorGUIMode == DONEEDITING)
1189
1191
return ;
1190
1192
1193
+ BITMAP* temp = create_bitmap_ex (bitmap_color_depth (pTargetBitmap), pTargetBitmap->w , pTargetBitmap->h );
1194
+ clear_to_color (temp, 0 );
1195
+
1191
1196
// The get a std::list of the currently edited set of placed objects in the Scene
1192
1197
const std::list<SceneObject*>* pSceneObjectList = 0 ;
1193
1198
if (m_FeatureSet == ONLOADEDIT)
@@ -1197,22 +1202,22 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1197
1202
// Draw the 'original' set of placed scene objects as solid before the blueprints
1198
1203
const std::list<SceneObject*>* pOriginalsList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::PLACEONLOAD);
1199
1204
for (std::list<SceneObject*>::const_iterator itr = pOriginalsList->begin (); itr != pOriginalsList->end (); ++itr) {
1200
- (*itr)->Draw (pTargetBitmap , targetPos);
1205
+ (*itr)->Draw (temp , targetPos);
1201
1206
// Draw basic HUD if an actor
1202
1207
Actor* pActor = dynamic_cast <Actor*>(*itr);
1203
1208
// if (pActor)
1204
- // pActor->DrawHUD(pTargetBitmap , targetPos);
1209
+ // pActor->DrawHUD(temp , targetPos);
1205
1210
}
1206
1211
} else if (m_FeatureSet == AIPLANEDIT) {
1207
1212
pSceneObjectList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::AIPLAN);
1208
1213
// Draw the 'original' set of placed scene objects as solid before the planned base
1209
1214
const std::list<SceneObject*>* pOriginalsList = g_SceneMan.GetScene ()->GetPlacedObjects (Scene::PLACEONLOAD);
1210
1215
for (std::list<SceneObject*>::const_iterator itr = pOriginalsList->begin (); itr != pOriginalsList->end (); ++itr) {
1211
- (*itr)->Draw (pTargetBitmap , targetPos);
1216
+ (*itr)->Draw (temp , targetPos);
1212
1217
// Draw basic HUD if an actor
1213
1218
Actor* pActor = dynamic_cast <Actor*>(*itr);
1214
1219
// if (pActor)
1215
- // pActor->DrawHUD(pTargetBitmap , targetPos);
1220
+ // pActor->DrawHUD(temp , targetPos);
1216
1221
}
1217
1222
}
1218
1223
@@ -1226,7 +1231,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1226
1231
// Draw the currently held object into the order of the std::list if it is to be placed inside
1227
1232
if (m_pCurrentObject && m_DrawCurrentObject && i == m_ObjectListOrder) {
1228
1233
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);
1230
1235
pActor = dynamic_cast <Actor*>(m_pCurrentObject);
1231
1236
if (pActor)
1232
1237
pActor->DrawHUD (pTargetBitmap, targetPos);
@@ -1239,7 +1244,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1239
1244
// Blink trans if we are supposed to blink this one
1240
1245
if ((*itr) == m_pObjectToBlink) {
1241
1246
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);
1243
1248
}
1244
1249
// Drawing of already placed objects that aren't highlighted or anything
1245
1250
else {
@@ -1250,15 +1255,15 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1250
1255
// Animate the ghosted into appearing solid in the build order to make the order clear
1251
1256
if (i >= m_RevealIndex) {
1252
1257
g_FrameMan.SetTransTableFromPreset (pActor ? TransparencyPreset::MoreTrans : TransparencyPreset::HalfTrans);
1253
- (*itr)->Draw (pTargetBitmap , targetPos, g_DrawTrans);
1258
+ (*itr)->Draw (temp , targetPos, g_DrawTrans);
1254
1259
}
1255
1260
// Show as non-transparent half the time to still give benefits of WYSIWYG
1256
1261
else
1257
- (*itr)->Draw (pTargetBitmap , targetPos);
1262
+ (*itr)->Draw (temp , targetPos);
1258
1263
}
1259
1264
// In full scene edit mode, we want to give a WYSIWYG view
1260
1265
else {
1261
- (*itr)->Draw (pTargetBitmap , targetPos);
1266
+ (*itr)->Draw (temp , targetPos);
1262
1267
1263
1268
// Draw team marks for doors, deployments and assemblies
1264
1269
Deployment* pDeployment = dynamic_cast <Deployment*>(*itr);
@@ -1299,7 +1304,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1299
1304
if ((m_pCurrentObject && !m_pCurrentObject->IsInGroup (" Brains" )) && m_EditorGUIMode != INSTALLINGBRAIN && !(m_EditorGUIMode == PLACINGOBJECT && m_PreviousMode == INSTALLINGBRAIN)) {
1300
1305
SceneObject* pBrain = g_SceneMan.GetScene ()->GetResidentBrain (m_pController->GetPlayer ());
1301
1306
if (pBrain) {
1302
- pBrain->Draw (pTargetBitmap , targetPos);
1307
+ pBrain->Draw (temp , targetPos);
1303
1308
// Draw basic HUD if an actor
1304
1309
Actor* pActor = dynamic_cast <Actor*>(pBrain);
1305
1310
if (pActor)
@@ -1319,7 +1324,7 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1319
1324
// If the held object will be placed at the end of the std::list, draw it last to the scene, transperent blinking
1320
1325
else if (m_pCurrentObject && (m_ObjectListOrder < 0 || (pSceneObjectList && m_ObjectListOrder == pSceneObjectList->size ()))) {
1321
1326
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);
1323
1328
Actor* pActor = dynamic_cast <Actor*>(m_pCurrentObject);
1324
1329
if (pActor && m_FeatureSet != BLUEPRINTEDIT && m_FeatureSet != AIPLANEDIT)
1325
1330
pActor->DrawHUD (pTargetBitmap, targetPos);
@@ -1329,6 +1334,16 @@ void SceneEditorGUI::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) const
1329
1334
1330
1335
// Draw the pie menu
1331
1336
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);
1332
1347
}
1333
1348
1334
1349
void SceneEditorGUI::UpdateBrainSkyPathAndCost (Vector brainPos) {
0 commit comments