remove nonstandard type aliases

This commit is contained in:
scawful
2025-01-19 20:16:40 -05:00
parent fa33be3463
commit 809282edad
35 changed files with 367 additions and 357 deletions

View File

@@ -1,13 +1,13 @@
#ifndef YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
#define YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
#include "app/core/constants.h"
#include "app/core/platform/file_dialog.h"
#include "app/editor/code/memory_editor.h"
#include "app/gui/input.h"
#include "app/rom.h"
#include "imgui/imgui.h"
#include "imgui_memory_editor.h"
#include "util/macro.h"
namespace yaze {
namespace editor {

View File

@@ -2,7 +2,6 @@
#include "absl/status/status.h"
#include "absl/strings/match.h"
#include "app/core/constants.h"
#include "app/core/platform/file_dialog.h"
#include "app/core/project.h"
#include "app/editor/code/assembly_editor.h"
@@ -22,6 +21,7 @@
#include "editor/editor.h"
#include "imgui/imgui.h"
#include "imgui/misc/cpp/imgui_stdlib.h"
#include "util/macro.h"
namespace yaze {
namespace editor {
@@ -62,7 +62,7 @@ absl::Status EditorManager::Update() {
DrawPopups();
if (rom()->is_loaded() && !rom_assets_loaded_) {
auto& sheet_manager = GraphicsSheetManager::GetInstance();
auto &sheet_manager = GraphicsSheetManager::GetInstance();
ASSIGN_OR_RETURN(*sheet_manager.mutable_gfx_sheets(),
LoadAllGraphicsData(*rom()))
RETURN_IF_ERROR(overworld_editor_.LoadGraphics());
@@ -357,15 +357,19 @@ void EditorManager::DrawPopups() {
}
void EditorManager::DrawHomepage() {
TextWrapped("Welcome to the Yet Another Zelda3 Editor (yaze)!");
TextWrapped("This editor is designed to be a comprehensive tool for editing the Legend of Zelda: A Link to the Past.");
TextWrapped("The editor is still in development, so please report any bugs or issues you encounter.");
TextWrapped("Welcome to the Yet Another Zelda3 Editor (yaze)!");
TextWrapped(
"This editor is designed to be a comprehensive tool for editing the "
"Legend of Zelda: A Link to the Past.");
TextWrapped(
"The editor is still in development, so please report any bugs or issues "
"you encounter.");
static bool managed_startup = false;
if (Button("Open ROM", ImVec2(200, 0))) {
LoadRom();
}
static bool managed_startup = false;
if (Button("Open ROM", ImVec2(200, 0))) {
LoadRom();
}
SameLine();
ImGui::Checkbox("Manage Startup", &managed_startup);
Separator();
@@ -467,18 +471,18 @@ void EditorManager::DrawMenuContent() {
flags_menu.DrawSystemFlags();
EndMenu();
}
if (BeginMenu("Overworld Flags")) {
flags_menu.DrawOverworldFlags();
EndMenu();
}
if (BeginMenu("Overworld Flags")) {
flags_menu.DrawOverworldFlags();
EndMenu();
}
if (BeginMenu("Dungeon Flags")) {
flags_menu.DrawDungeonFlags();
EndMenu();
}
if (BeginMenu("Resource Flags")) {
flags_menu.DrawResourceFlags();
EndMenu();
}
if (BeginMenu("Resource Flags")) {
flags_menu.DrawResourceFlags();
EndMenu();
}
EndMenu();
}
@@ -718,7 +722,7 @@ void EditorManager::LoadRom() {
auto file_name = FileDialogWrapper::ShowOpenFileDialog();
auto load_rom = rom()->LoadFromFile(file_name);
if (load_rom.ok()) {
current_rom_ = rom();
current_rom_ = rom();
static RecentFilesManager manager("recent_files.txt");
manager.Load();
manager.AddFile(file_name);
@@ -736,8 +740,8 @@ void EditorManager::SaveRom() {
RETURN_VOID_IF_ERROR(status_);
if (core::ExperimentFlags::get().kSaveGraphicsSheet)
PRINT_IF_ERROR(SaveAllGraphicsData(*rom(),
GraphicsSheetManager::GetInstance().gfx_sheets()));
PRINT_IF_ERROR(SaveAllGraphicsData(
*rom(), GraphicsSheetManager::GetInstance().gfx_sheets()));
status_ = rom()->SaveToFile(backup_rom_, save_new_auto_);
}
@@ -750,13 +754,13 @@ void EditorManager::OpenRomOrProject(const std::string &filename) {
}
} else {
status_ = rom()->LoadFromFile(filename);
current_rom_ = rom();
current_rom_ = rom();
}
}
absl::Status EditorManager::OpenProject() {
RETURN_IF_ERROR(rom()->LoadFromFile(current_project_.rom_filename_));
current_rom_ = rom();
current_rom_ = rom();
if (!rom()->resource_label()->LoadLabels(current_project_.labels_filename_)) {
return absl::InternalError(

View File

@@ -6,7 +6,6 @@
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "app/core/constants.h"
#include "app/core/platform/file_dialog.h"
#include "app/core/platform/renderer.h"
#include "app/gfx/bitmap.h"
@@ -17,6 +16,7 @@
#include "app/gui/icons.h"
#include "app/gui/input.h"
#include "imgui/imgui.h"
#include "util/macro.h"
namespace yaze {
namespace editor {
@@ -128,7 +128,7 @@ absl::Status ScreenEditor::LoadDungeonMaps() {
int pc_ptr_gfx =
core::SnesToPc(ptr_gfx); // Contains data for the next 25 rooms
ASSIGN_OR_RETURN(ushort boss_room_d,
ASSIGN_OR_RETURN(uint16_t boss_room_d,
rom()->ReadWord(zelda3::kDungeonMapBossRooms + (d * 2)));
ASSIGN_OR_RETURN(nbr_basement_d,

View File

@@ -7,7 +7,6 @@
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "app/core/constants.h"
#include "app/core/platform/clipboard.h"
#include "app/core/platform/renderer.h"
#include "app/editor/graphics/palette_editor.h"
@@ -24,6 +23,7 @@
#include "app/zelda3/overworld/overworld.h"
#include "imgui/imgui.h"
#include "imgui_memory_editor.h"
#include "util/macro.h"
namespace yaze {
namespace editor {
@@ -1041,7 +1041,7 @@ absl::Status OverworldEditor::LoadGraphics() {
core::logf("Loading overworld tile16 graphics.");
// Loop through the tiles and copy their pixel data into separate vectors
for (uint i = 0; i < zelda3::kNumTile16Individual; i++) {
for (unsigned int i = 0; i < zelda3::kNumTile16Individual; i++) {
tile16_individual_[i].Create(kTile16Size, kTile16Size, 0x08,
kTile16Size * kTile16Size);
@@ -1214,7 +1214,7 @@ absl::Status OverworldEditor::RefreshTile16Blockset() {
// Loop through the tiles and copy their pixel data into separate vectors
std::vector<std::future<absl::Status>> futures;
for (uint i = 0; i < zelda3::kNumTile16Individual; i++) {
for (unsigned int i = 0; i < zelda3::kNumTile16Individual; i++) {
futures.push_back(std::async(
std::launch::async,
[&](int index) -> absl::Status {
@@ -1241,7 +1241,7 @@ absl::Status OverworldEditor::RefreshTile16Blockset() {
}
// Render the bitmaps of each tile.
for (uint id = 0; id < zelda3::kNumTile16Individual; id++) {
for (unsigned int id = 0; id < zelda3::kNumTile16Individual; id++) {
Renderer::GetInstance().UpdateBitmap(&tile16_individual_[id]);
}

View File

@@ -18,12 +18,12 @@
namespace yaze {
namespace editor {
constexpr uint k4BPP = 4;
constexpr uint kByteSize = 3;
constexpr uint kMessageIdSize = 5;
constexpr uint kNumSheetsToLoad = 223;
constexpr uint kTile8DisplayHeight = 64;
constexpr uint kOverworldMapSize = 0x200;
constexpr unsigned int k4BPP = 4;
constexpr unsigned int kByteSize = 3;
constexpr unsigned int kMessageIdSize = 5;
constexpr unsigned int kNumSheetsToLoad = 223;
constexpr unsigned int kTile8DisplayHeight = 64;
constexpr unsigned int kOverworldMapSize = 0x200;
constexpr float kInputFieldSize = 30.f;
constexpr ImVec2 kOverworldCanvasSize(kOverworldMapSize * 8,
kOverworldMapSize * 8);

View File

@@ -6,8 +6,8 @@
#include <string>
#include <vector>
#include "app/core/constants.h"
#include "absl/status/status.h"
#include "util/macro.h"
namespace yaze {
namespace editor {
@@ -106,8 +106,8 @@ struct ZSprite {
offset += sizeof(int);
for (int j = 0; j < tCount; j++) {
ushort tid = *reinterpret_cast<ushort*>(&buffer[offset]);
offset += sizeof(ushort);
uint16_t tid = *reinterpret_cast<uint16_t*>(&buffer[offset]);
offset += sizeof(uint16_t);
uint8_t tpal = *reinterpret_cast<uint8_t*>(&buffer[offset]);
offset += sizeof(uint8_t);
bool tmx = *reinterpret_cast<bool*>(&buffer[offset]);
@@ -246,7 +246,7 @@ struct ZSprite {
for (int j = 0; j < editor.Frames[i].Tiles.size(); j++) {
fs.write(reinterpret_cast<const char*>(&editor.Frames[i].Tiles[j].id),
sizeof(ushort));
sizeof(uint16_t));
fs.write(
reinterpret_cast<const char*>(&editor.Frames[i].Tiles[j].palette),
sizeof(uint8_t));