Added Google Abseil library
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <imgui/imgui_memory_editor.h>
|
||||
#include <imgui/misc/cpp/imgui_stdlib.h>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/editor/assembly_editor.h"
|
||||
#include "app/editor/dungeon_editor.h"
|
||||
@@ -22,15 +23,6 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
MasterEditor::MasterEditor() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
current_palette_[i].x = (i * 0.21f);
|
||||
current_palette_[i].y = (i * 0.21f);
|
||||
current_palette_[i].z = (i * 0.21f);
|
||||
current_palette_[i].w = 1.f;
|
||||
}
|
||||
}
|
||||
|
||||
MasterEditor::~MasterEditor() { rom_.Close(); }
|
||||
|
||||
void MasterEditor::SetupScreen(std::shared_ptr<SDL_Renderer> renderer) {
|
||||
@@ -59,6 +51,10 @@ void MasterEditor::UpdateScreen() {
|
||||
DrawScreenEditor();
|
||||
END_TAB_BAR()
|
||||
|
||||
if (!status_.ok()) {
|
||||
gui::widgets::DisplayStatus(status_);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
@@ -75,6 +71,7 @@ void MasterEditor::DrawYazeMenu() {
|
||||
std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
|
||||
std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath();
|
||||
rom_.LoadFromFile(filePathName);
|
||||
status_ = rom_.OpenFromFile(filePathName);
|
||||
overworld_editor_.SetupROM(rom_);
|
||||
}
|
||||
ImGuiFileDialog::Instance()->Close();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <imgui/imgui_memory_editor.h>
|
||||
#include <imgui/misc/cpp/imgui_stdlib.h>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/editor/assembly_editor.h"
|
||||
#include "app/editor/dungeon_editor.h"
|
||||
@@ -25,7 +26,6 @@ namespace editor {
|
||||
|
||||
class MasterEditor {
|
||||
public:
|
||||
MasterEditor();
|
||||
~MasterEditor();
|
||||
void SetupScreen(std::shared_ptr<SDL_Renderer> renderer);
|
||||
void UpdateScreen();
|
||||
@@ -48,6 +48,8 @@ class MasterEditor {
|
||||
DungeonEditor dungeon_editor_;
|
||||
ScreenEditor screen_editor_;
|
||||
|
||||
absl::Status status_;
|
||||
|
||||
ImVec4 current_palette_[8];
|
||||
|
||||
ImGuiWindowFlags main_editor_flags_ =
|
||||
|
||||
@@ -198,26 +198,26 @@ void OverworldEditor::DrawOverworldCanvas() {
|
||||
overworld_map_canvas_.DrawBackground();
|
||||
overworld_map_canvas_.UpdateContext();
|
||||
overworld_map_canvas_.DrawGrid(64.f);
|
||||
if (all_gfx_loaded_) {
|
||||
static bool tiles_made = false;
|
||||
static std::vector<gfx::Bitmap> tiles;
|
||||
if (!tiles_made) {
|
||||
tiles = graphics_bin_.at(0).CreateTiles();
|
||||
auto renderer = rom_.Renderer();
|
||||
for (auto &tile : tiles) {
|
||||
tile.CreateTexture(renderer);
|
||||
}
|
||||
}
|
||||
// if (all_gfx_loaded_) {
|
||||
// static bool tiles_made = false;
|
||||
// static std::vector<gfx::Bitmap> tiles;
|
||||
// if (!tiles_made) {
|
||||
// tiles = graphics_bin_.at(0).CreateTiles();
|
||||
// auto renderer = rom_.Renderer();
|
||||
// for (auto &tile : tiles) {
|
||||
// tile.CreateTexture(renderer);
|
||||
// }
|
||||
// }
|
||||
|
||||
overworld_map_canvas_.GetDrawList()->AddImage(
|
||||
(void *)tiles[0].GetTexture(),
|
||||
ImVec2(overworld_map_canvas_.GetZeroPoint().x + 2,
|
||||
overworld_map_canvas_.GetZeroPoint().y + 2),
|
||||
ImVec2(
|
||||
overworld_map_canvas_.GetZeroPoint().x + (tiles[0].GetWidth() * 2),
|
||||
overworld_map_canvas_.GetZeroPoint().y +
|
||||
(tiles[0].GetHeight() * 2)));
|
||||
}
|
||||
// overworld_map_canvas_.GetDrawList()->AddImage(
|
||||
// (void *)tiles[0].GetTexture(),
|
||||
// ImVec2(overworld_map_canvas_.GetZeroPoint().x + 2,
|
||||
// overworld_map_canvas_.GetZeroPoint().y + 2),
|
||||
// ImVec2(
|
||||
// overworld_map_canvas_.GetZeroPoint().x + (tiles[0].GetWidth() *
|
||||
// 2), overworld_map_canvas_.GetZeroPoint().y +
|
||||
// (tiles[0].GetHeight() * 2)));
|
||||
// }
|
||||
overworld_map_canvas_.DrawOverlay();
|
||||
}
|
||||
|
||||
@@ -309,6 +309,13 @@ void OverworldEditor::DrawAreaGraphics() {
|
||||
}
|
||||
|
||||
void OverworldEditor::LoadGraphics() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
current_palette_[i].x = (i * 0.21f);
|
||||
current_palette_[i].y = (i * 0.21f);
|
||||
current_palette_[i].z = (i * 0.21f);
|
||||
current_palette_[i].w = 1.f;
|
||||
}
|
||||
|
||||
rom_.LoadAllGraphicsData();
|
||||
graphics_bin_ = rom_.GetGraphicsBin();
|
||||
tile16_blockset_bmp_.Create(128 * 2, 8192 * 2, 8, 1048576);
|
||||
|
||||
Reference in New Issue
Block a user