Skip to content

Commit c1ad232

Browse files
committed
housekeeping
1 parent 61d235c commit c1ad232

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

Diff for: src/app/core/pipeline.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ void ButtonPipe(absl::string_view button_text, std::function<void()> callback) {
8383
}
8484
}
8585

86-
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
87-
int height, int tile_size, bool is_loaded,
86+
void BitmapCanvasPipeline(gui::Canvas& canvas, const gfx::Bitmap& bitmap,
87+
int width, int height, int tile_size, bool is_loaded,
8888
bool scrollbar, int canvas_id) {
89-
auto draw_canvas = [](gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
90-
int height, int tile_size, bool is_loaded) {
89+
auto draw_canvas = [](gui::Canvas& canvas, const gfx::Bitmap& bitmap,
90+
int width, int height, int tile_size, bool is_loaded) {
9191
canvas.DrawBackground(ImVec2(width + 1, height + 1));
9292
canvas.DrawContextMenu();
9393
canvas.DrawBitmap(bitmap, 2, is_loaded);

Diff for: src/app/core/pipeline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void GraphicsBinCanvasPipeline(int width, int height, int tile_size,
2929

3030
void ButtonPipe(absl::string_view button_text, std::function<void()> callback);
3131

32-
void BitmapCanvasPipeline(gui::Canvas& canvas, gfx::Bitmap& bitmap, int width,
32+
void BitmapCanvasPipeline(gui::Canvas& canvas, const gfx::Bitmap& bitmap, int width,
3333
int height, int tile_size, bool is_loaded,
3434
bool scrollbar, int canvas_id);
3535

Diff for: src/app/editor/overworld_editor.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ absl::Status OverworldEditor::Update() {
3333
if (rom()->isLoaded() && !all_gfx_loaded_) {
3434
RETURN_IF_ERROR(LoadGraphics())
3535
tile16_editor_.InitBlockset(tile16_blockset_bmp_);
36-
gfx_group_editor_.InitBlockset(tile16_blockset_bmp_, graphics_bin_,
37-
palette_);
36+
gfx_group_editor_.InitBlockset(tile16_blockset_bmp_);
3837
all_gfx_loaded_ = true;
3938
}
4039

Diff for: src/app/editor/sprite_editor.h

+2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
namespace yaze {
77
namespace app {
88
namespace editor {
9+
910
class SpriteEditor {
1011
public:
1112
absl::Status Update();
1213
};
14+
1315
} // namespace editor
1416
} // namespace app
1517
} // namespace yaze

Diff for: src/app/gfx/bitmap.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
#include <cstdint>
77
#include <memory>
88

9+
#include "absl/container/flat_hash_map.h"
910
#include "absl/status/status.h"
1011
#include "absl/status/statusor.h"
1112
#include "absl/strings/str_cat.h"
1213
#include "app/core/constants.h"
1314
#include "app/gfx/snes_palette.h"
1415

16+
1517
namespace yaze {
1618
namespace app {
1719
namespace gfx {
@@ -113,7 +115,7 @@ class Bitmap {
113115
std::shared_ptr<SDL_Surface> surface_ = nullptr;
114116
};
115117

116-
using BitmapTable = std::unordered_map<int, gfx::Bitmap>;
118+
using BitmapTable = absl::flat_hash_map<int, gfx::Bitmap>;
117119

118120
} // namespace gfx
119121
} // namespace app

Diff for: src/app/zelda3/sprite/sprite.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Sprite::Sprite() {
1111
}
1212
}
1313

14-
void Sprite::InitSprite(Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
15-
int map_x, int map_y) {
14+
void Sprite::InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x,
15+
uchar y, int map_x, int map_y) {
1616
current_gfx_ = src;
1717
overworld_ = true;
1818
map_id_ = mapid;

Diff for: src/app/zelda3/sprite/sprite.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Sprite {
2323
Sprite();
2424
Sprite(Bytes src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
2525
int map_y);
26-
void InitSprite(Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
26+
void InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
2727
int map_x, int map_y);
2828
void updateBBox();
2929

0 commit comments

Comments
 (0)