housekeeping
This commit is contained in:
@@ -233,7 +233,11 @@ void OverworldEditor::DrawTileSelector() {
|
|||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginTabItem("Current Graphics")) {
|
if (ImGui::BeginTabItem("Current Graphics")) {
|
||||||
DrawAreaGraphics();
|
if (ImGui::BeginChild("#Tile16Child", ImGui::GetContentRegionAvail(),
|
||||||
|
true, ImGuiWindowFlags_NoScrollbar)) {
|
||||||
|
DrawAreaGraphics();
|
||||||
|
}
|
||||||
|
ImGui::EndChild();
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
|
|||||||
@@ -54,7 +54,14 @@ class OverworldEditor {
|
|||||||
bool all_gfx_loaded_ = false;
|
bool all_gfx_loaded_ = false;
|
||||||
bool map_blockset_loaded_ = false;
|
bool map_blockset_loaded_ = false;
|
||||||
|
|
||||||
std::unordered_map<unsigned int, SDL_Texture *> all_texture_sheet_;
|
ImVec4 current_palette_[8];
|
||||||
|
|
||||||
|
ImGuiTableFlags toolset_table_flags = ImGuiTableFlags_SizingFixedFit;
|
||||||
|
ImGuiTableFlags ow_map_flags = ImGuiTableFlags_Borders;
|
||||||
|
ImGuiTableFlags ow_edit_flags = ImGuiTableFlags_Reorderable |
|
||||||
|
ImGuiTableFlags_Resizable |
|
||||||
|
ImGuiTableFlags_SizingStretchSame;
|
||||||
|
|
||||||
std::unordered_map<unsigned int, gfx::Bitmap> graphics_bin_;
|
std::unordered_map<unsigned int, gfx::Bitmap> graphics_bin_;
|
||||||
|
|
||||||
ROM rom_;
|
ROM rom_;
|
||||||
@@ -69,14 +76,6 @@ class OverworldEditor {
|
|||||||
gui::Canvas current_gfx_canvas_;
|
gui::Canvas current_gfx_canvas_;
|
||||||
gui::Canvas blockset_canvas_;
|
gui::Canvas blockset_canvas_;
|
||||||
gui::Canvas graphics_bin_canvas_;
|
gui::Canvas graphics_bin_canvas_;
|
||||||
|
|
||||||
ImVec4 current_palette_[8];
|
|
||||||
|
|
||||||
ImGuiTableFlags toolset_table_flags = ImGuiTableFlags_SizingFixedFit;
|
|
||||||
ImGuiTableFlags ow_map_flags = ImGuiTableFlags_Borders;
|
|
||||||
ImGuiTableFlags ow_edit_flags = ImGuiTableFlags_Reorderable |
|
|
||||||
ImGuiTableFlags_Resizable |
|
|
||||||
ImGuiTableFlags_SizingStretchSame;
|
|
||||||
};
|
};
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|||||||
@@ -76,17 +76,16 @@ void ROM::LoadAllGraphicsData() {
|
|||||||
data = Decompress(gfx_addr, core::UncompressedSheetSize);
|
data = Decompress(gfx_addr, core::UncompressedSheetSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto converted_sheet = SNES3bppTo8bppSheet(data);
|
|
||||||
gfx::Bitmap tilesheet_bmp(core::kTilesheetWidth, core::kTilesheetHeight,
|
gfx::Bitmap tilesheet_bmp(core::kTilesheetWidth, core::kTilesheetHeight,
|
||||||
core::kTilesheetDepth, converted_sheet);
|
core::kTilesheetDepth, SNES3bppTo8bppSheet(data));
|
||||||
tilesheet_bmp.CreateTexture(sdl_renderer_);
|
tilesheet_bmp.CreateTexture(sdl_renderer_);
|
||||||
graphics_bin_[i] = tilesheet_bmp;
|
graphics_bin_[i] = tilesheet_bmp;
|
||||||
|
|
||||||
for (int j = 0; j < sizeof(converted_sheet); j++) {
|
for (int j = 0; j < sizeof(data); j++) {
|
||||||
buffer[j + buffer_pos] = converted_sheet[j];
|
buffer[j + buffer_pos] = data[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_pos += sizeof(converted_sheet);
|
buffer_pos += sizeof(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
master_gfx_bin_ = buffer;
|
master_gfx_bin_ = buffer;
|
||||||
|
|||||||
@@ -14,16 +14,14 @@ void Overworld::Load(ROM &rom, uchar *ow_blockset, uchar *current_gfx) {
|
|||||||
AssembleMap16Tiles();
|
AssembleMap16Tiles();
|
||||||
DecompressAllMapTiles();
|
DecompressAllMapTiles();
|
||||||
|
|
||||||
// Map Initialization
|
|
||||||
for (int i = 0; i < core::NumberOfOWMaps; i++) {
|
for (int i = 0; i < core::NumberOfOWMaps; i++) {
|
||||||
overworld_maps_.emplace_back(i, rom_, tiles16);
|
overworld_maps_.emplace_back(i, rom_, tiles16);
|
||||||
}
|
}
|
||||||
FetchLargeMaps();
|
FetchLargeMaps();
|
||||||
|
|
||||||
auto size = tiles16.size();
|
|
||||||
for (int i = 0; i < core::NumberOfOWMaps; i++) {
|
for (int i = 0; i < core::NumberOfOWMaps; i++) {
|
||||||
overworld_maps_[i].BuildMap(size, game_state_, map_parent_, ow_blockset,
|
overworld_maps_[i].BuildMap(tiles16.size(), game_state_, map_parent_,
|
||||||
current_gfx, map_tiles_);
|
ow_blockset, current_gfx, map_tiles_);
|
||||||
}
|
}
|
||||||
|
|
||||||
is_loaded_ = true;
|
is_loaded_ = true;
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ void OverworldMap::BuildTileset(int game_state, uchar* current_gfx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto all_gfx_data = rom_.GetMasterGraphicsBin();
|
auto all_gfx_data = rom_.GetMasterGraphicsBin();
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
for (int j = 0; j < 2048; j++) {
|
for (int j = 0; j < 2048; j++) {
|
||||||
uchar mapByte = all_gfx_data[j + (static_graphics_[i] * 2048)];
|
uchar mapByte = all_gfx_data[j + (static_graphics_[i] * 2048)];
|
||||||
|
|||||||
Reference in New Issue
Block a user