feat(editor): hand pick per base, z-sort, amaga entitats en TILE, HUD 2-files centrat
This commit is contained in:
1 parent
c0362abf67
commit
a254fdd669
4 files changed
+94
-35
No files matched your search
@@ -1294,11 +1294,22 @@ void GameScene::render() {
|
||||
#else
|
||||
constexpr bool EDITOR_ACTIVE = false;
|
||||
#endif
|
||||
if (EDITOR_ACTIVE) {
|
||||
// Render barat de les entitats sense z-sort entre elles ni amb
|
||||
// jugadors: ja no hi ha actors mòbils. L'ordre és el d'inserció
|
||||
// del manager — suficient per editar.
|
||||
entity_manager_.renderAll();
|
||||
#ifdef _DEBUG
|
||||
const bool SHOW_ENTITIES_IN_EDITOR = editor_.shouldShowEntities();
|
||||
#else
|
||||
constexpr bool SHOW_ENTITIES_IN_EDITOR = false;
|
||||
#endif
|
||||
if (SHOW_ENTITIES_IN_EDITOR) {
|
||||
// Render de les entitats amb el mateix y-sort que el joc normal
|
||||
// (sense jugadors): així una mòmia situada davant d'un sarc en
|
||||
// falsa perspectiva queda dibuixada per damunt — i no a l'inrevés
|
||||
// segons l'ordre del YAML. Reusem `EntityManager::renderEntity`
|
||||
// (estàtic) i sortegem per `getFeetY()` ascendent.
|
||||
auto sorted = entity_manager_.getEntities();
|
||||
std::ranges::stable_sort(sorted, [](const Entity* a, const Entity* b) {
|
||||
return a->getFeetY() < b->getFeetY();
|
||||
});
|
||||
for (const auto* e : sorted) { EntityManager::renderEntity(*e); }
|
||||
}
|
||||
// Capa de pintat: va entre el tilemap base i els actors, perquè els
|
||||
// sarcòfags i el jugador la tapen. S'amaga al mode editor (decisió
|
||||
|
||||
Reference in new issue
Block a user