remove app namespace

This commit is contained in:
scawful
2024-12-28 21:28:51 -05:00
parent 3ebe17c7bd
commit e05e7c35db
174 changed files with 475 additions and 658 deletions

View File

@@ -31,7 +31,7 @@ typedef struct z3_overworld_map {
* @brief Primitive of the overworld.
*/
typedef struct z3_overworld {
void *impl; // yaze::app::Overworld*
void *impl; // yaze::Overworld*
uint8_t *tile32_data; /**< Pointer to the 32x32 tile data. */
uint8_t *tile16_data; /**< Pointer to the 16x16 tile data. */

View File

@@ -1,91 +0,0 @@
#ifndef EXTENSION_INTERFACE_H
#define EXTENSION_INTERFACE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "yaze.h"
typedef void (*yaze_initialize_func)(yaze_editor_context* context);
typedef void (*yaze_cleanup_func)(void);
typedef void (*yaze_extend_ui_func)(yaze_editor_context* context);
typedef void (*yaze_manipulate_rom_func)(z3_rom* rom);
typedef void (*yaze_command_func)(void);
typedef void (*yaze_event_hook_func)(void);
typedef enum {
YAZE_EVENT_ROM_LOADED,
YAZE_EVENT_ROM_SAVED,
YAZE_EVENT_SPRITE_MODIFIED,
YAZE_EVENT_PALETTE_CHANGED,
} yaze_event_type;
/**
* @brief Extension interface for Yaze.
*
* @details Yaze extensions can be written in C or Python.
*/
typedef struct yaze_extension {
const char* name;
const char* version;
/**
* @brief Function to initialize the extension.
*
* @details This function is called when the extension is loaded. It can be
* used to set up any resources or state needed by the extension.
*/
yaze_initialize_func initialize;
/**
* @brief Function to clean up the extension.
*
* @details This function is called when the extension is unloaded. It can be
* used to clean up any resources or state used by the extension.
*/
yaze_cleanup_func cleanup;
/**
* @brief Function to manipulate the ROM.
*
* @param rom The ROM to manipulate.
*
*/
yaze_manipulate_rom_func manipulate_rom;
/**
* @brief Function to extend the UI.
*
* @param context The editor context.
*
* @details This function is called when the extension is loaded. It can be
* used to add custom UI elements to the editor. The context parameter
* provides access to the project, command registry, event dispatcher, and
* ImGui context.
*/
yaze_extend_ui_func extend_ui;
/**
* @brief Register commands in the yaze_command_registry.
*/
yaze_command_func register_commands;
/**
* @brief Register custom tools in the yaze_command_registry.
*/
yaze_command_func register_custom_tools;
/**
* @brief Register event hooks in the yaze_event_dispatcher.
*/
void (*register_event_hooks)(yaze_event_type event,
yaze_event_hook_func hook);
} yaze_extension;
#ifdef __cplusplus
}
#endif
#endif // EXTENSION_INTERFACE_H

View File

@@ -19,9 +19,6 @@ typedef struct yaze_project yaze_project;
typedef struct yaze_command_registry yaze_command_registry;
typedef struct yaze_event_dispatcher yaze_event_dispatcher;
/**
* @brief Extension editor context.
*/
typedef struct yaze_editor_context {
z3_rom* rom;
yaze_project* project;
@@ -30,19 +27,10 @@ typedef struct yaze_editor_context {
yaze_event_dispatcher* event_dispatcher;
} yaze_editor_context;
/**
* @brief Initialize the Yaze library.
*/
void yaze_check_version(const char* version);
int yaze_init(yaze_editor_context*);
/**
* @brief Clean up the Yaze library.
*/
void yaze_cleanup(yaze_editor_context*);
/**
* @brief Primitive of a Yaze project.
*/
struct yaze_project {
const char* name;
const char* filepath;
@@ -53,29 +41,16 @@ struct yaze_project {
yaze_project yaze_load_project(const char* filename);
/**
* @brief Primitive of a Zelda3 ROM.
*/
struct z3_rom {
const char* filename;
const uint8_t* data;
size_t size;
void* impl; // yaze::app::Rom*
void* impl; // yaze::Rom*
};
/**
* @brief Load a Zelda3 ROM from a file.
*/
z3_rom* yaze_load_rom(const char* filename);
/**
* @brief Unload a Zelda3 ROM.
*/
void yaze_unload_rom(z3_rom* rom);
/**
* @brief Primitive of a Bitmap
*/
typedef struct yaze_bitmap {
int width;
int height;
@@ -83,41 +58,98 @@ typedef struct yaze_bitmap {
uint8_t* data;
} yaze_bitmap;
/**
* @brief Load a bitmap from a file.
*/
yaze_bitmap yaze_load_bitmap(const char* filename);
/**
* @brief Get a color from a palette set.
*/
snes_color yaze_get_color_from_paletteset(const z3_rom* rom, int palette_set,
int palette, int color);
/**
* @brief Load the overworld from a Zelda3 ROM.
*/
z3_overworld* yaze_load_overworld(const z3_rom* rom);
/**
* @brief Check the version of the Yaze library.
*/
void yaze_check_version(const char* version);
/**
* @brief Command registry.
*/
struct yaze_command_registry {
void (*register_command)(const char* name, void (*command)(void));
};
/**
* @brief Event dispatcher.
*/
struct yaze_event_dispatcher {
void (*register_event_hook)(void (*event_hook)(void));
};
typedef void (*yaze_initialize_func)(yaze_editor_context* context);
typedef void (*yaze_cleanup_func)(void);
typedef void (*yaze_extend_ui_func)(yaze_editor_context* context);
typedef void (*yaze_manipulate_rom_func)(z3_rom* rom);
typedef void (*yaze_command_func)(void);
typedef void (*yaze_event_hook_func)(void);
typedef enum {
YAZE_EVENT_ROM_LOADED,
YAZE_EVENT_ROM_SAVED,
YAZE_EVENT_SPRITE_MODIFIED,
YAZE_EVENT_PALETTE_CHANGED,
} yaze_event_type;
/**
* @brief Extension interface for Yaze.
*
* @details Yaze extensions can be written in C or Python.
*/
typedef struct yaze_extension {
const char* name;
const char* version;
/**
* @brief Function to initialize the extension.
*
* @details This function is called when the extension is loaded. It can be
* used to set up any resources or state needed by the extension.
*/
yaze_initialize_func initialize;
/**
* @brief Function to clean up the extension.
*
* @details This function is called when the extension is unloaded. It can be
* used to clean up any resources or state used by the extension.
*/
yaze_cleanup_func cleanup;
/**
* @brief Function to manipulate the ROM.
*
* @param rom The ROM to manipulate.
*
*/
yaze_manipulate_rom_func manipulate_rom;
/**
* @brief Function to extend the UI.
*
* @param context The editor context.
*
* @details This function is called when the extension is loaded. It can be
* used to add custom UI elements to the editor. The context parameter
* provides access to the project, command registry, event dispatcher, and
* ImGui context.
*/
yaze_extend_ui_func extend_ui;
/**
* @brief Register commands in the yaze_command_registry.
*/
yaze_command_func register_commands;
/**
* @brief Register custom tools in the yaze_command_registry.
*/
yaze_command_func register_custom_tools;
/**
* @brief Register event hooks in the yaze_event_dispatcher.
*/
void (*register_event_hooks)(yaze_event_type event,
yaze_event_hook_func hook);
} yaze_extension;
#ifdef __cplusplus
}
#endif

View File

@@ -13,7 +13,6 @@
#include "absl/strings/string_view.h"
namespace yaze {
namespace app {
namespace core {
namespace {
@@ -329,5 +328,5 @@ absl::StatusOr<std::string> CheckVersion(const char *version) {
}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -12,10 +12,9 @@
#include "absl/container/flat_hash_map.h"
namespace yaze {
namespace app {
/**
* @namespace yaze::app::core
* @namespace yaze::core
* @brief Core application logic and utilities.
*/
namespace core {
@@ -313,7 +312,7 @@ constexpr std::string_view kYazeVersion = "0.2.1";
absl::StatusOr<std::string> CheckVersion(const char *version);
} // namespace core
} // namespace app
} // namespace yaze
#endif

View File

@@ -16,7 +16,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace core {
namespace {
@@ -278,5 +277,5 @@ absl::Status Controller::LoadConfigFiles() {
}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -18,7 +18,6 @@
int main(int argc, char **argv);
namespace yaze {
namespace app {
namespace core {
/**
@@ -71,7 +70,7 @@ class Controller : public ExperimentFlags {
};
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_CONTROLLER_H

View File

@@ -206,8 +206,8 @@
}
- (void)openFileAction:(id)sender {
if (!yaze::app::SharedRom::shared_rom_
->LoadFromFile(yaze::app::core::FileDialogWrapper::ShowOpenFileDialog())
if (!yaze::SharedRom::shared_rom_
->LoadFromFile(yaze::core::FileDialogWrapper::ShowOpenFileDialog())
.ok()) {
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Error"];
@@ -238,7 +238,7 @@ extern "C" void yaze_initialize_cococa() {
extern "C" void yaze_run_cocoa_app_delegate(const char *filename) {
yaze_initialize_cococa();
yaze::app::core::Controller controller;
yaze::core::Controller controller;
RETURN_VOID_IF_ERROR(controller.OnEntry(filename));
while (controller.IsActive()) {
@autoreleasepool {

View File

@@ -4,7 +4,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
void CopyImageToClipboard(const std::vector<uint8_t>& data) {}
@@ -12,5 +11,4 @@ void GetImageFromClipboard(std::vector<uint8_t>& data, int& width,
int& height) {}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -5,14 +5,12 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
void CopyImageToClipboard(const std::vector<uint8_t> &data);
void GetImageFromClipboard(std::vector<uint8_t> &data, int &width, int &height);
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H

View File

@@ -6,7 +6,7 @@
#ifdef TARGET_OS_MAC
#import <Cocoa/Cocoa.h>
void yaze::app::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData) {
void yaze::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData) {
NSData* data = [NSData dataWithBytes:pngData.data() length:pngData.size()];
NSImage* image = [[NSImage alloc] initWithData:data];
@@ -15,7 +15,7 @@ void yaze::app::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData)
[pasteboard writeObjects:@[ image ]];
}
void yaze::app::core::GetImageFromClipboard(std::vector<uint8_t>& pixel_data, int& width, int& height) {
void yaze::core::GetImageFromClipboard(std::vector<uint8_t>& pixel_data, int& width, int& height) {
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
NSArray* classArray = [NSArray arrayWithObject:[NSImage class]];
NSDictionary* options = [NSDictionary dictionary];

View File

@@ -7,12 +7,11 @@
#endif // _WIN32
namespace yaze {
namespace app {
namespace core {
#ifdef _WIN32
std::string FileDialogWrapper::ShowOpenFileDialog() {
std::string FileDialogWrapper::ShowOpenFileDialog() {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
IFileDialog *pfd = NULL;
@@ -44,7 +43,7 @@ namespace core {
return file_path_windows;
}
std::string FileDialogWrapper::ShowOpenFolderDialog() {
std::string FileDialogWrapper::ShowOpenFolderDialog() {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
IFileDialog *pfd = NULL;
@@ -141,5 +140,4 @@ std::vector<std::string> FileDialogWrapper::GetFilesInFolder(
#endif
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -5,7 +5,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
class FileDialogWrapper {
@@ -28,7 +27,6 @@ class FileDialogWrapper {
};
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FILE_DIALOG_H

View File

@@ -37,20 +37,18 @@ std::string ShowOpenFileDialogSync() {
return result;
}
}
} // namespace
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
return ShowOpenFileDialogSync();
}
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() { return ShowOpenFileDialogSync(); }
std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() { return ""; }
std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() { return ""; }
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetFilesInFolder(
const std::string &folder) {
return {};
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
const std::string &folder) {
return {};
}
@@ -60,7 +58,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesIn
#import <Cocoa/Cocoa.h>
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:YES];
[openPanel setCanChooseDirectories:NO];
@@ -75,7 +73,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
return "";
}
std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:NO];
[openPanel setCanChooseDirectories:YES];
@@ -90,7 +88,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
return "";
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetFilesInFolder(
const std::string& folder) {
std::vector<std::string> filenames;
NSFileManager* fileManager = [NSFileManager defaultManager];
@@ -106,7 +104,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
return filenames;
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
const std::string& folder) {
std::vector<std::string> subdirectories;
NSFileManager* fileManager = [NSFileManager defaultManager];

View File

@@ -4,7 +4,6 @@
#include <string>
namespace yaze {
namespace app {
namespace core {
/**
@@ -14,7 +13,6 @@ namespace core {
std::string GetBundleResourcePath();
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FILE_PATH_H

View File

@@ -8,14 +8,14 @@
#include <TargetConditionals.h>
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
std::string yaze::app::core::GetBundleResourcePath() {
std::string yaze::core::GetBundleResourcePath() {
NSBundle* bundle = [NSBundle mainBundle];
NSString* resourceDirectoryPath = [bundle bundlePath];
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
return [path UTF8String];
}
#elif TARGET_OS_MAC == 1
std::string yaze::app::core::GetBundleResourcePath() {
std::string yaze::core::GetBundleResourcePath() {
NSBundle* bundle = [NSBundle mainBundle];
NSString* resourceDirectoryPath = [bundle bundlePath];
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];

View File

@@ -13,7 +13,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace core {
absl::Status LoadPackageFonts() {
@@ -240,5 +239,4 @@ void LoadSystemFonts() {
#endif
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -4,14 +4,12 @@
#include "absl/status/status.h"
namespace yaze {
namespace app {
namespace core {
void LoadSystemFonts();
absl::Status LoadPackageFonts();
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FONTLOADER_H

View File

@@ -8,13 +8,13 @@
#if TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1
/* iOS */
void yaze::app::core::LoadSystemFonts() {}
void yaze::core::LoadSystemFonts() {}
#elif TARGET_OS_MAC == 1
/* macOS */
#import <Cocoa/Cocoa.h>
void yaze::app::core::LoadSystemFonts() {
void yaze::core::LoadSystemFonts() {
NSArray *fontNames = @[ @"Helvetica", @"Times New Roman", @"Courier", @"Arial", @"Verdana" ];
for (NSString *fontName in fontNames) {

View File

@@ -11,7 +11,6 @@
#include "app/gfx/bitmap.h"
namespace yaze {
namespace app {
namespace core {
/**
@@ -77,7 +76,6 @@ class Renderer {
};
} // namespace core
} // namespace app
} // namespace yaze
#endif

View File

@@ -10,7 +10,7 @@
@end
#else
@interface AppViewController : UIViewController <MTKViewDelegate>
@property(nonatomic) yaze::app::core::Controller *controller;
@property(nonatomic) yaze::core::Controller *controller;
@property(nonatomic) UIHoverGestureRecognizer *hoverGestureRecognizer;
@property(nonatomic) UIPinchGestureRecognizer *pinchRecognizer;
@property(nonatomic) UISwipeGestureRecognizer *swipeRecognizer;

View File

@@ -9,7 +9,6 @@
#include "imgui/misc/cpp/imgui_stdlib.h"
namespace yaze {
namespace app {
absl::Status Project::Open(const std::string& project_path) {
filepath = project_path;
@@ -185,5 +184,5 @@ std::string ResourceLabelManager::CreateOrGetLabel(
return labels_[type][key];
}
} // namespace app
} // namespace yaze

View File

@@ -11,7 +11,6 @@
#include "app/core/utils/file_util.h"
namespace yaze {
namespace app {
const std::string kRecentFilesFilename = "recent_files.txt";
constexpr char kEndOfProjectFile[] = "EndOfProjectFile";
@@ -130,7 +129,7 @@ class RecentFilesManager {
std::vector<std::string> recent_files_;
};
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PROJECT_H

View File

@@ -11,7 +11,6 @@
#include <sstream>
namespace yaze {
namespace app {
namespace core {
std::string GetFileExtension(const std::string &filename) {
@@ -70,5 +69,4 @@ std::string GetConfigDirectory(Platform platform) {
}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -4,7 +4,6 @@
#include <string>
namespace yaze {
namespace app {
namespace core {
enum class Platform { kUnknown, kMacOS, kiOS, kWindows, kLinux };
@@ -17,8 +16,7 @@ std::string GetConfigDirectory(Platform platform);
void SaveFile(const std::string &filename, const std::string &data,
Platform platform);
} // namespace core
} // namespace app
} // namespace yaze
} // namespace core
} // namespace yaze
#endif // YAZE_APP_CORE_UTILS_FILE_UTIL_H
#endif // YAZE_APP_CORE_UTILS_FILE_UTIL_H

View File

@@ -4,7 +4,6 @@
#include <SDL.h>
namespace yaze {
namespace app {
namespace core {
/**
@@ -19,22 +18,17 @@ struct SDL_Deleter {
* @brief Deleter for SDL_Texture.
*/
struct SDL_Texture_Deleter {
void operator()(SDL_Texture *p) const {
SDL_DestroyTexture(p);
}
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
};
/**
* @brief Deleter for SDL_Surface.
*/
struct SDL_Surface_Deleter {
void operator()(SDL_Surface *p) const {
SDL_FreeSurface(p);
}
void operator()(SDL_Surface *p) const { SDL_FreeSurface(p); }
};
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_UTILS_SDL_DELETER_H_

View File

@@ -7,7 +7,6 @@
#include "app/gui/icons.h"
namespace yaze {
namespace app {
namespace editor {
using core::FileDialogWrapper;
@@ -364,5 +363,4 @@ absl::Status AssemblyEditor::Redo() {
absl::Status AssemblyEditor::Update() { return absl::OkStatus(); }
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -9,7 +9,6 @@
#include "app/gui/style.h"
namespace yaze {
namespace app {
namespace editor {
/**
@@ -69,7 +68,6 @@ class AssemblyEditor : public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -28,7 +28,6 @@
#include "imgui_memory_editor.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::SameLine;
@@ -78,7 +77,6 @@ struct MemoryEditorWithDiffChecker : public SharedRom {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H

View File

@@ -13,7 +13,6 @@
#include "zelda3/dungeon/room.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -72,6 +71,7 @@ absl::Status DungeonEditor::Update() {
absl::Status DungeonEditor::Initialize() {
auto dungeon_man_pal_group = rom()->palette_group().dungeon_main;
for (int i = 0; i < 0x100 + 40; i++) {
rooms_.emplace_back(zelda3::dungeon::Room(/*room_id=*/i));
rooms_[i].LoadHeader();
@@ -123,7 +123,24 @@ absl::Status DungeonEditor::RefreshGraphics() {
current_palette_group_[current_palette_id_], 0));
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
}
std::for_each_n(rooms_[current_room_id_].blocks().begin(), 8,
[this](int block) -> absl::Status {
RETURN_IF_ERROR(
graphics_bin_[block].ApplyPaletteWithTransparent(
current_palette_group_[current_palette_id_], 0));
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
return absl::OkStatus();
});
auto sprites_aux1_pal_group = rom()->palette_group().sprites_aux1;
std::for_each_n(rooms_[current_room_id_].blocks().begin() + 8, 8,
[this, &sprites_aux1_pal_group](int block) -> absl::Status {
RETURN_IF_ERROR(
graphics_bin_[block].ApplyPaletteWithTransparent(
sprites_aux1_pal_group[current_palette_id_], 0));
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
return absl::OkStatus();
});
for (int i = 9; i < 16; i++) {
int block = rooms_[current_room_id_].blocks()[i];
RETURN_IF_ERROR(graphics_bin_[block].ApplyPaletteWithTransparent(
@@ -135,13 +152,13 @@ absl::Status DungeonEditor::RefreshGraphics() {
void DungeonEditor::LoadDungeonRoomSize() {
std::map<int, std::vector<int>> rooms_by_bank;
for (const auto& room : room_size_addresses_) {
for (const auto &room : room_size_addresses_) {
int bank = room.second >> 16;
rooms_by_bank[bank].push_back(room.second);
}
// Process and calculate room sizes within each bank
for (auto& bank_rooms : rooms_by_bank) {
for (auto &bank_rooms : rooms_by_bank) {
// Sort the rooms within this bank
std::sort(bank_rooms.second.begin(), bank_rooms.second.end());
@@ -151,7 +168,7 @@ void DungeonEditor::LoadDungeonRoomSize() {
// Identify the room ID for the current room pointer
int room_id =
std::find_if(room_size_addresses_.begin(), room_size_addresses_.end(),
[room_ptr](const auto& entry) {
[room_ptr](const auto &entry) {
return entry.second == room_ptr;
})
->first;
@@ -315,7 +332,7 @@ void DungeonEditor::DrawRoomSelector() {
gui::InputHexWord("Room ID", &current_room_id_);
gui::InputHex("Palette ID", &current_palette_id_);
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)9);
if (ImGuiID child_id = ImGui::GetID((void *)(intptr_t)9);
BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
int i = 0;
@@ -421,7 +438,7 @@ void DungeonEditor::DrawDungeonTabView() {
// Room is already open
next_tab_id++;
}
active_rooms_.push_back(next_tab_id++); // Add new tab
active_rooms_.push_back(next_tab_id++); // Add new tab
}
// Submit our regular tabs
@@ -514,7 +531,7 @@ void DungeonEditor::DrawRoomGraphics() {
void DungeonEditor::DrawTileSelector() {
if (BeginTabBar("##TabBar", ImGuiTabBarFlags_FittingPolicyScroll)) {
if (BeginTabItem("Room Graphics")) {
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)3);
if (ImGuiID child_id = ImGui::GetID((void *)(intptr_t)3);
BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
DrawRoomGraphics();
@@ -577,7 +594,7 @@ void DungeonEditor::DrawObjectRenderer() {
if (object_loaded_) {
ImGui::Begin("Memory Viewer", &object_loaded_, 0);
static MemoryEditor mem_edit;
mem_edit.DrawContents((void*)object_renderer_.mutable_memory(),
mem_edit.DrawContents((void *)object_renderer_.mutable_memory(),
object_renderer_.mutable_memory()->size());
ImGui::End();
}
@@ -586,7 +603,7 @@ void DungeonEditor::DrawObjectRenderer() {
// ============================================================================
void DungeonEditor::CalculateUsageStats() {
for (const auto& room : rooms_) {
for (const auto &room : rooms_) {
if (blockset_usage_.find(room.blockset) == blockset_usage_.end()) {
blockset_usage_[room.blockset] = 1;
} else {
@@ -608,15 +625,15 @@ void DungeonEditor::CalculateUsageStats() {
}
void DungeonEditor::RenderSetUsage(
const absl::flat_hash_map<uint16_t, int>& usage_map, uint16_t& selected_set,
const absl::flat_hash_map<uint16_t, int> &usage_map, uint16_t &selected_set,
int spriteset_offset) {
// Sort the usage map by set number
std::vector<std::pair<uint16_t, int>> sorted_usage(usage_map.begin(),
usage_map.end());
std::sort(sorted_usage.begin(), sorted_usage.end(),
[](const auto& a, const auto& b) { return a.first < b.first; });
[](const auto &a, const auto &b) { return a.first < b.first; });
for (const auto& [set, count] : sorted_usage) {
for (const auto &[set, count] : sorted_usage) {
std::string display_str;
if (spriteset_offset != 0x00) {
display_str = absl::StrFormat("%#02x, %#02x: %d", set,
@@ -626,7 +643,7 @@ void DungeonEditor::RenderSetUsage(
absl::StrFormat("%#02x: %d", (set + spriteset_offset), count);
}
if (ImGui::Selectable(display_str.c_str(), selected_set == set)) {
selected_set = set; // Update the selected set when clicked
selected_set = set; // Update the selected set when clicked
}
}
}
@@ -637,7 +654,7 @@ namespace {
// Range for spritesets 0-0x8F
// Range for palettes 0-0x47
template <typename T>
void RenderUnusedSets(const absl::flat_hash_map<T, int>& usage_map, int max_set,
void RenderUnusedSets(const absl::flat_hash_map<T, int> &usage_map, int max_set,
int spriteset_offset = 0x00) {
std::vector<int> unused_sets;
for (int i = 0; i < max_set; i++) {
@@ -645,7 +662,7 @@ void RenderUnusedSets(const absl::flat_hash_map<T, int>& usage_map, int max_set,
unused_sets.push_back(i);
}
}
for (const auto& set : unused_sets) {
for (const auto &set : unused_sets) {
if (spriteset_offset != 0x00) {
Text("%#02x, %#02x", set, (set + spriteset_offset));
} else {
@@ -653,7 +670,7 @@ void RenderUnusedSets(const absl::flat_hash_map<T, int>& usage_map, int max_set,
}
}
}
} // namespace
} // namespace
void DungeonEditor::DrawUsageStats() {
if (Button("Refresh")) {
@@ -744,7 +761,7 @@ void DungeonEditor::DrawUsageGrid() {
int totalSquares = 296;
int squaresWide = 16;
int squaresTall = (totalSquares + squaresWide - 1) /
squaresWide; // Ceiling of totalSquares/squaresWide
squaresWide; // Ceiling of totalSquares/squaresWide
for (int row = 0; row < squaresTall; ++row) {
ImGui::NewLine();
@@ -755,7 +772,7 @@ void DungeonEditor::DrawUsageGrid() {
break;
}
// Determine if this square should be highlighted
const auto& room = rooms_[row * squaresWide + col];
const auto &room = rooms_[row * squaresWide + col];
// Create a button or selectable for each square
ImGui::BeginGroup();
@@ -765,10 +782,10 @@ void DungeonEditor::DrawUsageGrid() {
color.z = color.z / 255;
color.w = 1.0f;
if (rooms_[row * squaresWide + col].room_size() > 0xFFFF) {
color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); // Or any highlight color
color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); // Or any highlight color
}
if (rooms_[row * squaresWide + col].room_size() == 0) {
color = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // Or any highlight color
color = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // Or any highlight color
}
ImGui::PushStyleColor(ImGuiCol_Button, color);
// Make the button text darker
@@ -782,7 +799,7 @@ void DungeonEditor::DrawUsageGrid() {
if (highlight) {
ImGui::PushStyleColor(
ImGuiCol_Button,
ImVec4(1.0f, 0.5f, 0.0f, 1.0f)); // Or any highlight color
ImVec4(1.0f, 0.5f, 0.0f, 1.0f)); // Or any highlight color
}
if (Button(absl::StrFormat("%#x",
rooms_[row * squaresWide + col].room_size())
@@ -827,6 +844,6 @@ void DungeonEditor::DrawUsageGrid() {
}
}
} // namespace editor
} // namespace app
} // namespace yaze
} // namespace editor
} // namespace yaze

View File

@@ -14,7 +14,6 @@
#include "zelda3/dungeon/room_object.h"
namespace yaze {
namespace app {
namespace editor {
constexpr ImGuiTabItemFlags kDungeonTabFlags =
@@ -143,7 +142,6 @@ class DungeonEditor : public Editor,
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -4,7 +4,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
absl::Status DrawEditor(EditorLayoutParams *params) {
@@ -48,5 +47,5 @@ absl::Status DrawEditor(EditorLayoutParams *params) {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -11,10 +11,9 @@
#include "app/editor/system/resource_manager.h"
namespace yaze {
namespace app {
/**
* @namespace yaze::app::editor
* @namespace yaze::editor
* @brief Editors are the view controllers for the application.
*/
namespace editor {
@@ -99,7 +98,6 @@ typedef struct EditorLayoutParams {
absl::Status DrawEditor(EditorLayoutParams *params);
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_EDITOR_H

View File

@@ -24,7 +24,6 @@
#include "imgui/misc/cpp/imgui_stdlib.h"
namespace yaze {
namespace app {
namespace editor {
using namespace ImGui;
@@ -816,5 +815,4 @@ absl::Status EditorManager::OpenProject() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -21,7 +21,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace editor {
/**
@@ -110,7 +109,6 @@ class EditorManager : public SharedRom, public core::ExperimentFlags {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H

View File

@@ -11,7 +11,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::BeginChild;
@@ -297,5 +296,4 @@ void GfxGroupEditor::DrawPaletteViewer() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -7,7 +7,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace editor {
/**
@@ -43,6 +42,5 @@ class GfxGroupEditor : public SharedRom {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_GFX_GROUP_EDITOR_H

View File

@@ -23,7 +23,6 @@
#include "imgui_memory_editor.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -844,5 +843,4 @@ absl::Status GraphicsEditor::DecompressSuperDonkey() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -16,7 +16,6 @@
#include "imgui_memory_editor.h"
namespace yaze {
namespace app {
namespace editor {
// "99973","A3D80",
@@ -196,7 +195,6 @@ class GraphicsEditor : public SharedRom, public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_GRAPHICS_EDITOR_H

View File

@@ -8,7 +8,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::AcceptDragDropPayload;
@@ -472,5 +471,4 @@ absl::Status PaletteEditor::ResetColorToOriginal(
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -14,7 +14,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
namespace palette_internal {
@@ -120,7 +119,6 @@ class PaletteEditor : public SharedRom, public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -18,7 +18,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -392,6 +391,22 @@ void ScreenEditor::DrawDungeonMapsEditor() {
sheets_.emplace(1, rom()->gfx_sheets()[213]);
sheets_.emplace(2, rom()->gfx_sheets()[214]);
sheets_.emplace(3, rom()->gfx_sheets()[215]);
int current_tile8 = 0;
int tile_data_offset = 0;
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 32; j++) {
std::vector<uint8_t> tile_data(64, 0); // 8x8 tile (64 bytes
int tile_index = current_tile8 + j;
int x = (j % 8) * 8;
int y = (j / 8) * 8;
sheets_[i].Get8x8Tile(tile_index, 0, 0, tile_data, tile_data_offset);
tile8_individual_.emplace_back(gfx::Bitmap(8, 8, 4, tile_data));
RETURN_VOID_IF_ERROR(tile8_individual_.back().ApplyPalette(
*rom()->mutable_dungeon_palette(3)));
Renderer::GetInstance().RenderBitmap(&tile8_individual_.back());
}
tile_data_offset = 0;
}
dungeon_maps_loaded_ = true;
} else {
ImGui::Text("Failed to load dungeon map tile16");
@@ -470,8 +485,12 @@ void ScreenEditor::DrawDungeonMapsEditor() {
}
ImGui::Separator();
current_tile_canvas_.DrawBackground(ImVec2(64 * 2 + 2, 64 * 2 + 4));
current_tile_canvas_.DrawBackground(); // ImVec2(64 * 2 + 2, 64 * 2 + 4));
current_tile_canvas_.DrawContextMenu();
if (current_tile_canvas_.DrawTilePainter(
tile8_individual_[selected_tile8_], 16)) {
// Modify the tile16 based on the selected tile and current_tile16_info
}
current_tile_canvas_.DrawBitmap(tile16_individual_[selected_tile16_], 2,
4.0f);
current_tile_canvas_.DrawGrid(16.f);
@@ -589,5 +608,4 @@ void ScreenEditor::DrawToolset() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -15,7 +15,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
/**
@@ -86,12 +85,13 @@ private:
bool copy_button_pressed = false;
bool paste_button_pressed = false;
std::vector<uint8_t> all_gfx_;
std::array<uint16_t, 4> current_tile16_data_;
std::unordered_map<int, gfx::Bitmap> tile16_individual_;
std::vector<gfx::Bitmap> tile8_individual_;
std::vector<uint8_t> all_gfx_;
std::vector<uint8_t> gfx_bin_data_;
std::vector<zelda3::screen::DungeonMap> dungeon_maps_;
std::vector<std::vector<std::array<std::string, 25>>> dungeon_map_labels_;
std::array<uint16_t, 4> current_tile16_data_;
std::vector<uint8_t> gfx_bin_data_;
absl::Status status_;
@@ -100,18 +100,18 @@ private:
gfx::Tilesheet tile16_sheet_;
gfx::InternalTile16 current_tile16_info;
gui::Canvas current_tile_canvas_{"##CurrentTileCanvas"};
gui::Canvas current_tile_canvas_{"##CurrentTileCanvas", ImVec2(32, 32),
gui::CanvasGridSize::k16x16, 2.0f};
gui::Canvas screen_canvas_;
gui::Canvas tilesheet_canvas_;
gui::Canvas tilemap_canvas_{"##TilemapCanvas",
ImVec2(128 + 2, (192) + 4),
gui::Canvas tilemap_canvas_{"##TilemapCanvas", ImVec2(128 + 2, (192) + 4),
gui::CanvasGridSize::k8x8, 2.f};
zelda3::screen::Inventory inventory_;
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -21,7 +21,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -251,7 +250,7 @@ absl::Status Tile16Editor::DrawTileEditControls() {
gui::InputHexByte("Palette", &notify_palette.mutable_get());
notify_palette.apply_changes();
if (notify_palette.modified()) {
auto palette = palettesets_[current_palette_].main;
auto palette = palettesets_[current_palette_].main_;
auto value = notify_palette.get();
if (notify_palette.get() > 0x04 && notify_palette.get() < 0x06) {
palette = palettesets_[current_palette_].aux1;
@@ -400,5 +399,4 @@ absl::Status Tile16Editor::UpdateTransferTileCanvas() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -13,7 +13,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
/**
@@ -100,6 +99,5 @@ class Tile16Editor : public GfxContext, public SharedRom {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_TILE16EDITOR_H

View File

@@ -3,7 +3,6 @@
#include "app/core/common.h"
namespace yaze {
namespace app {
namespace editor {
uint8_t FindMatchingCharacter(char value) {
@@ -145,7 +144,7 @@ std::vector<uint8_t> ParseMessageToData(std::string str) {
return bytes;
}
std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom) {
std::vector<DictionaryEntry> BuildDictionaryEntries(Rom* rom) {
std::vector<DictionaryEntry> AllDictionaries;
for (int i = 0; i < kNumDictionaryEntries; i++) {
std::vector<uint8_t> bytes;
@@ -178,5 +177,4 @@ std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom) {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -11,7 +11,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace editor {
const uint8_t kMessageTerminator = 0x7F;
@@ -78,7 +77,7 @@ constexpr int kTextDataEnd = 0xE7FFF;
constexpr int kNumDictionaryEntries = 97;
constexpr int kPointersDictionaries = 0x74703;
std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom);
std::vector<DictionaryEntry> BuildDictionaryEntries(Rom* rom);
std::string ReplaceAllDictionaryWords(std::string str,
std::vector<DictionaryEntry> dictionary);
@@ -278,7 +277,6 @@ ParsedElement FindMatchingElement(const std::string& str);
std::string ParseTextDataByte(uint8_t value);
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H

View File

@@ -18,7 +18,6 @@
#include "imgui/misc/cpp/imgui_stdlib.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -700,5 +699,4 @@ void MessageEditor::SelectAll() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -12,7 +12,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace editor {
constexpr int kGfxFont = 0x70000; // 2bpp format
@@ -163,7 +162,6 @@ class MessageEditor : public Editor, public SharedRom {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_MESSAGE_EDITOR_H

View File

@@ -9,7 +9,6 @@
#include "app/gui/input.h"
namespace yaze {
namespace app {
namespace editor {
absl::Status MusicEditor::Update() {
@@ -218,5 +217,4 @@ void MusicEditor::DrawToolset() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -12,7 +12,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
static const char* kGameSongs[] = {"Title",
@@ -85,7 +84,6 @@ class MusicEditor : public SharedRom, public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -5,7 +5,6 @@
#include "app/gui/style.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::BeginChild;
@@ -489,5 +488,4 @@ bool DrawSpriteEditorPopup(zelda3::Sprite &sprite) {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -7,7 +7,6 @@
#include "app/zelda3/overworld/overworld.h"
namespace yaze {
namespace app {
namespace editor {
bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity,
@@ -81,7 +80,6 @@ void DrawSpriteInserterPopup();
bool DrawSpriteEditorPopup(zelda3::Sprite &sprite);
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_OVERWORLD_ENTITY_H

View File

@@ -24,7 +24,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using core::Renderer;
@@ -1530,5 +1529,4 @@ void OverworldEditor::InitializeZeml() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -15,7 +15,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
constexpr uint k4BPP = 4;
@@ -309,7 +308,6 @@ class OverworldEditor : public Editor,
absl::Status status_;
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif

View File

@@ -7,7 +7,6 @@
#include "app/zelda3/sprite/sprite.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::BeginTable;
@@ -275,5 +274,4 @@ void SpriteEditor::DrawCustomSpritesMetadata() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -8,7 +8,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace editor {
constexpr ImGuiTabItemFlags kSpriteTabFlags =
@@ -111,7 +110,6 @@ class SpriteEditor : public SharedRom, public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H

View File

@@ -13,7 +13,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
/**
* @brief Namespace for the ZSprite format from Zarby's ZSpriteMaker.
@@ -390,7 +389,6 @@ struct ZSprite {
} // namespace zsprite
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SPRITE_ZSPRITE_H

View File

@@ -5,7 +5,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
ImGuiKey MapKeyToImGuiKey(char key) {
@@ -139,5 +138,4 @@ void CommandManager::LoadKeybindings(const std::string &filepath) {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -7,17 +7,15 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
namespace yaze {namespace editor {
ImGuiKey MapKeyToImGuiKey(char key);
class CommandManager {
public:
public:
CommandManager() = default;
~CommandManager() = default;
using Command = std::function<void()>;
struct CommandInfo {
@@ -27,7 +25,9 @@ public:
std::string desc;
CommandInfo(Command command, char mnemonic, const std::string &name,
const std::string &desc)
: command(std::move(command)), mnemonic(mnemonic), name(name),
: command(std::move(command)),
mnemonic(mnemonic),
name(name),
desc(desc) {}
CommandInfo() = default;
};
@@ -72,12 +72,10 @@ public:
void SaveKeybindings(const std::string &filepath);
void LoadKeybindings(const std::string &filepath);
private:
private:
std::unordered_map<std::string, CommandInfoOrPrefix> commands_;
};
} // namespace editor
} // namespace app
} // namespace yaze
} // namespace editor} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H
#endif // YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H

View File

@@ -7,7 +7,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
class ConstantManager {
@@ -71,7 +70,6 @@ class ConstantManager {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H

View File

@@ -5,13 +5,12 @@
#include <dlfcn.h>
#endif
#include <system/extension.h>
#include <yaze.h>
#include <iostream>
#include <vector>
namespace yaze {
namespace app {
namespace editor {
void ExtensionManager::LoadExtension(const std::string& filename,
@@ -81,5 +80,4 @@ void ExtensionManager::ExecuteExtensionUI(yaze_editor_context* context) {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -1,14 +1,12 @@
#ifndef YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
#define YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
#include <system/extension.h>
#include <yaze.h>
#include <string>
#include <vector>
namespace yaze {
namespace app {
namespace editor {
namespace yaze {namespace editor {
class ExtensionManager {
public:
@@ -22,8 +20,6 @@ class ExtensionManager {
std::vector<yaze_extension*> extensions_;
};
} // namespace editor
} // namespace app
} // namespace yaze
} // namespace editor} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H

View File

@@ -5,7 +5,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::BeginMenu;
@@ -58,7 +57,6 @@ struct FlagsMenu : public core::ExperimentFlags {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_UTILS_FLAGS_H_

View File

@@ -6,7 +6,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace editor {
// System history manager, undo and redo.
@@ -26,7 +25,6 @@ class HistoryManager {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H

View File

@@ -3,7 +3,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
PopupManager::PopupManager() {
@@ -15,5 +14,5 @@ PopupManager::~PopupManager() {
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -2,7 +2,6 @@
#define YAZE_APP_EDITOR_POPUP_MANAGER_H
namespace yaze {
namespace app {
namespace editor {
// ImGui popup manager.
@@ -15,7 +14,7 @@ class PopupManager {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_POPUP_MANAGER_H

View File

@@ -4,7 +4,6 @@
#include <cstddef>
namespace yaze {
namespace app {
namespace editor {
// System resource manager.
@@ -24,7 +23,7 @@ class ResourceManager {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_RESOURCE_MANAGER_H

View File

@@ -6,7 +6,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace editor {
using ImGui::BeginChild;
@@ -79,5 +78,4 @@ absl::Status SettingsEditor::DrawKeyboardShortcuts() {
}
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -7,7 +7,6 @@
#include "app/editor/editor.h"
namespace yaze {
namespace app {
namespace editor {
// Simple representation for a tree
@@ -226,7 +225,6 @@ class SettingsEditor : public Editor {
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SETTINGS_EDITOR_H_

View File

@@ -13,7 +13,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -203,5 +202,5 @@ void Apu::SpcIdle(bool waiting) { Cycle(); }
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -11,7 +11,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -95,7 +94,7 @@ class Apu {
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze
#endif

View File

@@ -5,7 +5,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -633,5 +632,5 @@ void Dsp::GetSamples(int16_t* sample_data, int samples_per_frame,
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -9,7 +9,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -157,7 +156,7 @@ class Dsp {
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_AUDIO_S_DSP_H

View File

@@ -1,7 +1,6 @@
#include "app/emu/audio/spc700.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -148,5 +147,5 @@ uint16_t Spc700::addr_plus_i_indexed() {
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -1,7 +1,6 @@
#include "app/emu/audio/spc700.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -483,5 +482,5 @@ void Spc700::STOP() {}
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -9,7 +9,6 @@
#include "app/emu/audio/internal/opcodes.h"
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -1326,5 +1325,5 @@ void Spc700::LogInstruction(uint16_t initial_pc, uint8_t opcode) {
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -8,7 +8,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace emu {
namespace audio {
@@ -339,6 +338,6 @@ class Spc700 {
} // namespace audio
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_SPC700_H

View File

@@ -4,7 +4,6 @@
#include <cstdint>
namespace yaze {
namespace app {
namespace emu {
class Clock {
@@ -57,7 +56,7 @@ class ClockImpl : public Clock {
};
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_CLOCK_H_

View File

@@ -9,7 +9,6 @@
#include "app/emu/cpu/internal/opcodes.h"
namespace yaze {
namespace app {
namespace emu {
void Cpu::Reset(bool hard) {
@@ -2260,5 +2259,5 @@ uint8_t Cpu::GetInstructionLength(uint8_t opcode) {
*/
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -13,7 +13,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
class InstructionEntry {
@@ -799,7 +798,7 @@ class Cpu : public core::ExperimentFlags {
};
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_CPU_H_

View File

@@ -1,7 +1,6 @@
#include "app/emu/cpu/cpu.h"
namespace yaze {
namespace app {
namespace emu {
void Cpu::AdrImp() {
@@ -186,5 +185,5 @@ uint16_t Cpu::StackRelative() {
}
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -5,7 +5,6 @@
#include "app/emu/cpu/cpu.h"
namespace yaze {
namespace app {
namespace emu {
/**
@@ -398,5 +397,5 @@ void Cpu::ORA(uint32_t low, uint32_t high) {
}
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -27,8 +27,8 @@
#include "imgui/imgui.h"
#include "imgui_memory_editor.h"
using namespace yaze::app;
using yaze::app::core::SDL_Deleter;
using namespace yaze;
using yaze::core::SDL_Deleter;
int main(int argc, char **argv) {
absl::InitializeSymbolizer(argv[0]);

View File

@@ -15,7 +15,6 @@
#include "imgui_memory_editor.h"
namespace yaze {
namespace app {
namespace emu {
namespace {
@@ -540,5 +539,5 @@ void Emulator::RenderCpuInstructionLog(
}
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -10,10 +10,9 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
/**
* @namespace yaze::app::emu
* @namespace yaze::emu
* @brief SNES Emulation and debugging tools.
*/
namespace emu {
@@ -190,7 +189,7 @@ class Emulator : public SharedRom {
};
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_EMULATOR_H

View File

@@ -13,7 +13,6 @@
#include "app/emu/cpu/internal/opcodes.h"
namespace yaze {
namespace app {
namespace emu {
enum class AddressingMode {
@@ -444,5 +443,5 @@ class AsmParser {
};
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -3,7 +3,6 @@
#include <iostream>
namespace yaze {
namespace app {
namespace emu {
namespace memory {
namespace dma {
@@ -372,5 +371,5 @@ void StartDma(MemoryImpl* memory, uint8_t val, bool hdma) {
} // namespace dma
} // namespace memory
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -7,7 +7,6 @@
#include "app/emu/snes.h"
namespace yaze {
namespace app {
namespace emu {
namespace memory {
namespace dma {
@@ -31,7 +30,7 @@ void DoDma(SNES* snes, MemoryImpl* memory, int cycles);
} // namespace dma
} // namespace memory
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_MEMORY_DMA_H

View File

@@ -4,7 +4,6 @@
#include <cstdint>
namespace yaze {
namespace app {
namespace emu {
namespace memory {
@@ -31,7 +30,7 @@ typedef struct DmaChannel {
} // namespace memory
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_MEMORY_DMA_CHANNEL_H

View File

@@ -8,7 +8,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace emu {
namespace memory {
@@ -167,5 +166,5 @@ uint32_t MemoryImpl::GetMappedAddress(uint32_t address) const {
} // namespace memory
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -27,7 +27,6 @@
// 7F 0000-FFFF System RAM
namespace yaze {
namespace app {
namespace emu {
namespace memory {
@@ -309,7 +308,7 @@ class MemoryImpl : public Memory {
} // namespace memory
} // namespace emu
} // namespace app
} // namespace yaze
#endif // MEM_H

View File

@@ -15,7 +15,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace emu {
namespace {
@@ -574,5 +573,5 @@ void SNES::InitAccessTime(bool recalc) {
}
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -10,7 +10,6 @@
#include "app/emu/video/ppu.h"
namespace yaze {
namespace app {
namespace emu {
struct Input {
@@ -131,7 +130,7 @@ class SNES {
};
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_SNES_H

View File

@@ -7,7 +7,6 @@
#include "app/emu/memory/memory.h"
namespace yaze {
namespace app {
namespace emu {
namespace video {
@@ -1056,5 +1055,5 @@ void Ppu::PutPixels(uint8_t* pixels) {
} // namespace video
} // namespace emu
} // namespace app
} // namespace yaze

View File

@@ -11,7 +11,6 @@
#include "app/rom.h"
namespace yaze {
namespace app {
namespace emu {
namespace video {
@@ -458,7 +457,7 @@ class Ppu : public SharedRom {
} // namespace video
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_PPU_H

View File

@@ -6,7 +6,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace emu {
namespace video {
namespace PpuRegisters {
@@ -416,7 +415,7 @@ struct STAT78 {
} // namespace PpuRegisters
} // namespace video
} // namespace emu
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EMU_VIDEO_PPU_REGISTERS_H

View File

@@ -18,7 +18,6 @@
}
namespace yaze {
namespace app {
namespace gfx {
using core::SDL_Surface_Deleter;
@@ -483,5 +482,5 @@ void Bitmap::WriteColor(int position, const ImVec4 &color) {
}
} // namespace gfx
} // namespace app
} // namespace yaze

View File

@@ -12,10 +12,9 @@
#include "app/gfx/snes_palette.h"
namespace yaze {
namespace app {
/**
* @namespace yaze::app::gfx
* @namespace yaze::gfx
* @brief Contains classes for handling graphical data.
*/
namespace gfx {
@@ -214,7 +213,7 @@ class Bitmap {
using BitmapTable = std::unordered_map<int, gfx::Bitmap>;
} // namespace gfx
} // namespace app
} // namespace yaze
#endif // YAZE_APP_GFX_BITMAP_H

View File

@@ -13,7 +13,6 @@
#define DEBUG_LOG(msg) std::cout << msg << std::endl
namespace yaze {
namespace app {
namespace gfx {
namespace lc_lz2 {
@@ -1473,5 +1472,5 @@ absl::StatusOr<std::vector<uint8_t>> DecompressOverworld(
} // namespace lc_lz2
} // namespace gfx
} // namespace app
} // namespace yaze

Some files were not shown because too many files have changed in this diff Show More