Add OverworldMap tile editing
This commit is contained in:
@@ -83,11 +83,11 @@ void ButtonPipe(absl::string_view button_text, std::function<void()> callback) {
|
||||
}
|
||||
}
|
||||
|
||||
void BitmapCanvasPipeline(int width, int height, int tile_size, bool is_loaded,
|
||||
gfx::Bitmap& bitmap, bool scrollbar, int canvas_id) {
|
||||
gui::Canvas canvas;
|
||||
|
||||
auto draw_canvas = [&]() {
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
|
||||
int height, int tile_size, bool is_loaded,
|
||||
bool scrollbar, int canvas_id) {
|
||||
auto draw_canvas = [](gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
|
||||
int height, int tile_size, bool is_loaded) {
|
||||
canvas.DrawBackground(ImVec2(width + 1, height + 1));
|
||||
canvas.DrawContextMenu();
|
||||
canvas.DrawBitmap(bitmap, 2, is_loaded);
|
||||
@@ -100,11 +100,11 @@ void BitmapCanvasPipeline(int width, int height, int tile_size, bool is_loaded,
|
||||
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)canvas_id);
|
||||
ImGui::BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
|
||||
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
||||
draw_canvas();
|
||||
draw_canvas(canvas, bitmap, width, height, tile_size, is_loaded);
|
||||
}
|
||||
ImGui::EndChild();
|
||||
} else {
|
||||
draw_canvas();
|
||||
draw_canvas(canvas, bitmap, width, height, tile_size, is_loaded);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -28,8 +29,9 @@ void GraphicsBinCanvasPipeline(int width, int height, int tile_size,
|
||||
|
||||
void ButtonPipe(absl::string_view button_text, std::function<void()> callback);
|
||||
|
||||
void BitmapCanvasPipeline(int width, int height, int tile_size, bool is_loaded,
|
||||
gfx::Bitmap& bitmap, bool scrollbar, int canvas_id);
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
|
||||
int height, int tile_size, bool is_loaded,
|
||||
bool scrollbar, int canvas_id);
|
||||
|
||||
void BuildAndRenderBitmapPipeline(int width, int height, int depth, Bytes data,
|
||||
ROM& z3_rom, gfx::Bitmap& bitmap,
|
||||
|
||||
Reference in New Issue
Block a user