Refactor OverworldEditor to use constexpr for map settings column names
This commit is contained in:
@@ -299,11 +299,13 @@ absl::Status OverworldEditor::DrawToolset() {
|
|||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr std::array<const char *, 8> kMapSettingsColumnNames = {
|
||||||
|
"##WorldId", "##GfxId", "##PalId", "##SprGfxId",
|
||||||
|
"##5thCol", "##6thCol", "##7thCol", "##8thCol"};
|
||||||
|
|
||||||
void OverworldEditor::DrawOverworldMapSettings() {
|
void OverworldEditor::DrawOverworldMapSettings() {
|
||||||
if (BeginTable(kOWMapTable.data(), 8, kOWMapFlags, ImVec2(0, 0), -1)) {
|
if (BeginTable(kOWMapTable.data(), 8, kOWMapFlags, ImVec2(0, 0), -1)) {
|
||||||
for (const auto &name :
|
for (const auto &name : kMapSettingsColumnNames)
|
||||||
{"##1stCol", "##gfxCol", "##palCol", "##sprgfxCol", "##sprpalCol",
|
|
||||||
"##msgidCol", "##2ndCol", "##mosaic"})
|
|
||||||
ImGui::TableSetupColumn(name);
|
ImGui::TableSetupColumn(name);
|
||||||
|
|
||||||
TableNextColumn();
|
TableNextColumn();
|
||||||
@@ -1023,13 +1025,9 @@ absl::Status OverworldEditor::LoadGraphics() {
|
|||||||
|
|
||||||
// Add the vector for the current tile to the vector of tile pixel data
|
// Add the vector for the current tile to the vector of tile pixel data
|
||||||
tile16_individual_data_.push_back(tile_data);
|
tile16_individual_data_.push_back(tile_data);
|
||||||
}
|
|
||||||
|
|
||||||
// Render the bitmaps of each tile.
|
|
||||||
for (int id = 0; id < 4096; id++) {
|
|
||||||
tile16_individual_.emplace_back();
|
tile16_individual_.emplace_back();
|
||||||
RETURN_IF_ERROR(Renderer::GetInstance().CreateAndRenderBitmap(
|
RETURN_IF_ERROR(Renderer::GetInstance().CreateAndRenderBitmap(
|
||||||
0x10, 0x10, 0x80, tile16_individual_data_[id], tile16_individual_[id],
|
0x10, 0x10, 0x80, tile16_individual_data_[i], tile16_individual_[i],
|
||||||
palette_));
|
palette_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H
|
#ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H
|
||||||
#define YAZE_APP_EDITOR_OVERWORLDEDITOR_H
|
#define YAZE_APP_EDITOR_OVERWORLDEDITOR_H
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
@@ -25,6 +23,7 @@
|
|||||||
#include "app/gui/zeml.h"
|
#include "app/gui/zeml.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "app/zelda3/overworld/overworld.h"
|
#include "app/zelda3/overworld/overworld.h"
|
||||||
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
@@ -101,8 +100,8 @@ class EntranceContext {
|
|||||||
*/
|
*/
|
||||||
class OverworldEditor : public Editor,
|
class OverworldEditor : public Editor,
|
||||||
public SharedRom,
|
public SharedRom,
|
||||||
public context::GfxContext,
|
|
||||||
public EntranceContext,
|
public EntranceContext,
|
||||||
|
public context::GfxContext,
|
||||||
public core::ExperimentFlags {
|
public core::ExperimentFlags {
|
||||||
public:
|
public:
|
||||||
OverworldEditor() { type_ = EditorType::kOverworld; }
|
OverworldEditor() { type_ = EditorType::kOverworld; }
|
||||||
@@ -110,12 +109,14 @@ class OverworldEditor : public Editor,
|
|||||||
void InitializeZeml();
|
void InitializeZeml();
|
||||||
|
|
||||||
absl::Status Update() final;
|
absl::Status Update() final;
|
||||||
absl::Status Undo() { return absl::UnimplementedError("Undo"); }
|
absl::Status Undo() override { return absl::UnimplementedError("Undo"); }
|
||||||
absl::Status Redo() { return absl::UnimplementedError("Redo"); }
|
absl::Status Redo() override { return absl::UnimplementedError("Redo"); }
|
||||||
absl::Status Cut() { return absl::UnimplementedError("Cut"); }
|
absl::Status Cut() override { return absl::UnimplementedError("Cut"); }
|
||||||
absl::Status Copy() { return absl::UnimplementedError("Copy"); }
|
absl::Status Copy() override { return absl::UnimplementedError("Copy"); }
|
||||||
absl::Status Paste() { return absl::UnimplementedError("Paste"); }
|
absl::Status Paste() override { return absl::UnimplementedError("Paste"); }
|
||||||
absl::Status Find() { return absl::UnimplementedError("Find Unused Tiles"); }
|
absl::Status Find() override {
|
||||||
|
return absl::UnimplementedError("Find Unused Tiles");
|
||||||
|
}
|
||||||
|
|
||||||
auto overworld() { return &overworld_; }
|
auto overworld() { return &overworld_; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user