housekeeping
This commit is contained in:
@@ -83,11 +83,11 @@ void ButtonPipe(absl::string_view button_text, std::function<void()> callback) {
|
||||
}
|
||||
}
|
||||
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
|
||||
int height, int tile_size, bool is_loaded,
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, const 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) {
|
||||
auto draw_canvas = [](gui::Canvas& canvas, const 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);
|
||||
|
||||
@@ -29,7 +29,7 @@ void GraphicsBinCanvasPipeline(int width, int height, int tile_size,
|
||||
|
||||
void ButtonPipe(absl::string_view button_text, std::function<void()> callback);
|
||||
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
|
||||
void BitmapCanvasPipeline(gui::Canvas& canvas, const gfx::Bitmap& bitmap, int width,
|
||||
int height, int tile_size, bool is_loaded,
|
||||
bool scrollbar, int canvas_id);
|
||||
|
||||
|
||||
@@ -33,8 +33,7 @@ absl::Status OverworldEditor::Update() {
|
||||
if (rom()->isLoaded() && !all_gfx_loaded_) {
|
||||
RETURN_IF_ERROR(LoadGraphics())
|
||||
tile16_editor_.InitBlockset(tile16_blockset_bmp_);
|
||||
gfx_group_editor_.InitBlockset(tile16_blockset_bmp_, graphics_bin_,
|
||||
palette_);
|
||||
gfx_group_editor_.InitBlockset(tile16_blockset_bmp_);
|
||||
all_gfx_loaded_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
class SpriteEditor {
|
||||
public:
|
||||
absl::Status Update();
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace gfx {
|
||||
@@ -113,7 +115,7 @@ class Bitmap {
|
||||
std::shared_ptr<SDL_Surface> surface_ = nullptr;
|
||||
};
|
||||
|
||||
using BitmapTable = std::unordered_map<int, gfx::Bitmap>;
|
||||
using BitmapTable = absl::flat_hash_map<int, gfx::Bitmap>;
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace app
|
||||
|
||||
@@ -11,8 +11,8 @@ Sprite::Sprite() {
|
||||
}
|
||||
}
|
||||
|
||||
void Sprite::InitSprite(Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
|
||||
int map_x, int map_y) {
|
||||
void Sprite::InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x,
|
||||
uchar y, int map_x, int map_y) {
|
||||
current_gfx_ = src;
|
||||
overworld_ = true;
|
||||
map_id_ = mapid;
|
||||
|
||||
@@ -23,7 +23,7 @@ class Sprite {
|
||||
Sprite();
|
||||
Sprite(Bytes src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
|
||||
int map_y);
|
||||
void InitSprite(Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
|
||||
void InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
|
||||
int map_x, int map_y);
|
||||
void updateBBox();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user