remove app namespace
This commit is contained in:
@@ -31,7 +31,7 @@ typedef struct z3_overworld_map {
|
|||||||
* @brief Primitive of the overworld.
|
* @brief Primitive of the overworld.
|
||||||
*/
|
*/
|
||||||
typedef struct z3_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 *tile32_data; /**< Pointer to the 32x32 tile data. */
|
||||||
uint8_t *tile16_data; /**< Pointer to the 16x16 tile data. */
|
uint8_t *tile16_data; /**< Pointer to the 16x16 tile data. */
|
||||||
|
|||||||
@@ -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
|
|
||||||
126
incl/yaze.h
126
incl/yaze.h
@@ -19,9 +19,6 @@ typedef struct yaze_project yaze_project;
|
|||||||
typedef struct yaze_command_registry yaze_command_registry;
|
typedef struct yaze_command_registry yaze_command_registry;
|
||||||
typedef struct yaze_event_dispatcher yaze_event_dispatcher;
|
typedef struct yaze_event_dispatcher yaze_event_dispatcher;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Extension editor context.
|
|
||||||
*/
|
|
||||||
typedef struct yaze_editor_context {
|
typedef struct yaze_editor_context {
|
||||||
z3_rom* rom;
|
z3_rom* rom;
|
||||||
yaze_project* project;
|
yaze_project* project;
|
||||||
@@ -30,19 +27,10 @@ typedef struct yaze_editor_context {
|
|||||||
yaze_event_dispatcher* event_dispatcher;
|
yaze_event_dispatcher* event_dispatcher;
|
||||||
} yaze_editor_context;
|
} yaze_editor_context;
|
||||||
|
|
||||||
/**
|
void yaze_check_version(const char* version);
|
||||||
* @brief Initialize the Yaze library.
|
|
||||||
*/
|
|
||||||
int yaze_init(yaze_editor_context*);
|
int yaze_init(yaze_editor_context*);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Clean up the Yaze library.
|
|
||||||
*/
|
|
||||||
void yaze_cleanup(yaze_editor_context*);
|
void yaze_cleanup(yaze_editor_context*);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Primitive of a Yaze project.
|
|
||||||
*/
|
|
||||||
struct yaze_project {
|
struct yaze_project {
|
||||||
const char* name;
|
const char* name;
|
||||||
const char* filepath;
|
const char* filepath;
|
||||||
@@ -53,29 +41,16 @@ struct yaze_project {
|
|||||||
|
|
||||||
yaze_project yaze_load_project(const char* filename);
|
yaze_project yaze_load_project(const char* filename);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Primitive of a Zelda3 ROM.
|
|
||||||
*/
|
|
||||||
struct z3_rom {
|
struct z3_rom {
|
||||||
const char* filename;
|
const char* filename;
|
||||||
const uint8_t* data;
|
const uint8_t* data;
|
||||||
size_t size;
|
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);
|
z3_rom* yaze_load_rom(const char* filename);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Unload a Zelda3 ROM.
|
|
||||||
*/
|
|
||||||
void yaze_unload_rom(z3_rom* rom);
|
void yaze_unload_rom(z3_rom* rom);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Primitive of a Bitmap
|
|
||||||
*/
|
|
||||||
typedef struct yaze_bitmap {
|
typedef struct yaze_bitmap {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
@@ -83,41 +58,98 @@ typedef struct yaze_bitmap {
|
|||||||
uint8_t* data;
|
uint8_t* data;
|
||||||
} yaze_bitmap;
|
} yaze_bitmap;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Load a bitmap from a file.
|
|
||||||
*/
|
|
||||||
yaze_bitmap yaze_load_bitmap(const char* filename);
|
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,
|
snes_color yaze_get_color_from_paletteset(const z3_rom* rom, int palette_set,
|
||||||
int palette, int color);
|
int palette, int color);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Load the overworld from a Zelda3 ROM.
|
|
||||||
*/
|
|
||||||
z3_overworld* yaze_load_overworld(const z3_rom* 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 {
|
struct yaze_command_registry {
|
||||||
void (*register_command)(const char* name, void (*command)(void));
|
void (*register_command)(const char* name, void (*command)(void));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Event dispatcher.
|
|
||||||
*/
|
|
||||||
struct yaze_event_dispatcher {
|
struct yaze_event_dispatcher {
|
||||||
void (*register_event_hook)(void (*event_hook)(void));
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -329,5 +328,5 @@ absl::StatusOr<std::string> CheckVersion(const char *version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -12,10 +12,9 @@
|
|||||||
#include "absl/container/flat_hash_map.h"
|
#include "absl/container/flat_hash_map.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace yaze::app::core
|
* @namespace yaze::core
|
||||||
* @brief Core application logic and utilities.
|
* @brief Core application logic and utilities.
|
||||||
*/
|
*/
|
||||||
namespace core {
|
namespace core {
|
||||||
@@ -313,7 +312,7 @@ constexpr std::string_view kYazeVersion = "0.2.1";
|
|||||||
absl::StatusOr<std::string> CheckVersion(const char *version);
|
absl::StatusOr<std::string> CheckVersion(const char *version);
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -278,5 +277,5 @@ absl::Status Controller::LoadConfigFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
int main(int argc, char **argv);
|
int main(int argc, char **argv);
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +70,7 @@ class Controller : public ExperimentFlags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_CONTROLLER_H
|
#endif // YAZE_APP_CORE_CONTROLLER_H
|
||||||
|
|||||||
@@ -206,8 +206,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)openFileAction:(id)sender {
|
- (void)openFileAction:(id)sender {
|
||||||
if (!yaze::app::SharedRom::shared_rom_
|
if (!yaze::SharedRom::shared_rom_
|
||||||
->LoadFromFile(yaze::app::core::FileDialogWrapper::ShowOpenFileDialog())
|
->LoadFromFile(yaze::core::FileDialogWrapper::ShowOpenFileDialog())
|
||||||
.ok()) {
|
.ok()) {
|
||||||
NSAlert *alert = [[NSAlert alloc] init];
|
NSAlert *alert = [[NSAlert alloc] init];
|
||||||
[alert setMessageText:@"Error"];
|
[alert setMessageText:@"Error"];
|
||||||
@@ -238,7 +238,7 @@ extern "C" void yaze_initialize_cococa() {
|
|||||||
|
|
||||||
extern "C" void yaze_run_cocoa_app_delegate(const char *filename) {
|
extern "C" void yaze_run_cocoa_app_delegate(const char *filename) {
|
||||||
yaze_initialize_cococa();
|
yaze_initialize_cococa();
|
||||||
yaze::app::core::Controller controller;
|
yaze::core::Controller controller;
|
||||||
RETURN_VOID_IF_ERROR(controller.OnEntry(filename));
|
RETURN_VOID_IF_ERROR(controller.OnEntry(filename));
|
||||||
while (controller.IsActive()) {
|
while (controller.IsActive()) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
void CopyImageToClipboard(const std::vector<uint8_t>& data) {}
|
void CopyImageToClipboard(const std::vector<uint8_t>& data) {}
|
||||||
@@ -12,5 +11,4 @@ void GetImageFromClipboard(std::vector<uint8_t>& data, int& width,
|
|||||||
int& height) {}
|
int& height) {}
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -5,14 +5,12 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
void CopyImageToClipboard(const std::vector<uint8_t> &data);
|
void CopyImageToClipboard(const std::vector<uint8_t> &data);
|
||||||
void GetImageFromClipboard(std::vector<uint8_t> &data, int &width, int &height);
|
void GetImageFromClipboard(std::vector<uint8_t> &data, int &width, int &height);
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H
|
#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifdef TARGET_OS_MAC
|
#ifdef TARGET_OS_MAC
|
||||||
#import <Cocoa/Cocoa.h>
|
#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()];
|
NSData* data = [NSData dataWithBytes:pngData.data() length:pngData.size()];
|
||||||
NSImage* image = [[NSImage alloc] initWithData:data];
|
NSImage* image = [[NSImage alloc] initWithData:data];
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ void yaze::app::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData)
|
|||||||
[pasteboard writeObjects:@[ image ]];
|
[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];
|
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
|
||||||
NSArray* classArray = [NSArray arrayWithObject:[NSImage class]];
|
NSArray* classArray = [NSArray arrayWithObject:[NSImage class]];
|
||||||
NSDictionary* options = [NSDictionary dictionary];
|
NSDictionary* options = [NSDictionary dictionary];
|
||||||
|
|||||||
@@ -7,12 +7,11 @@
|
|||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
std::string FileDialogWrapper::ShowOpenFileDialog() {
|
std::string FileDialogWrapper::ShowOpenFileDialog() {
|
||||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
||||||
|
|
||||||
IFileDialog *pfd = NULL;
|
IFileDialog *pfd = NULL;
|
||||||
@@ -44,7 +43,7 @@ namespace core {
|
|||||||
return file_path_windows;
|
return file_path_windows;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FileDialogWrapper::ShowOpenFolderDialog() {
|
std::string FileDialogWrapper::ShowOpenFolderDialog() {
|
||||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
||||||
|
|
||||||
IFileDialog *pfd = NULL;
|
IFileDialog *pfd = NULL;
|
||||||
@@ -141,5 +140,4 @@ std::vector<std::string> FileDialogWrapper::GetFilesInFolder(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
class FileDialogWrapper {
|
class FileDialogWrapper {
|
||||||
@@ -28,7 +27,6 @@ class FileDialogWrapper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_PLATFORM_FILE_DIALOG_H
|
#endif // YAZE_APP_CORE_PLATFORM_FILE_DIALOG_H
|
||||||
|
|||||||
@@ -37,20 +37,18 @@ std::string ShowOpenFileDialogSync() {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
|
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() { return ShowOpenFileDialogSync(); }
|
||||||
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) {
|
const std::string &folder) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
|
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
|
||||||
const std::string &folder) {
|
const std::string &folder) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -60,7 +58,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesIn
|
|||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
|
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() {
|
||||||
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
|
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
|
||||||
[openPanel setCanChooseFiles:YES];
|
[openPanel setCanChooseFiles:YES];
|
||||||
[openPanel setCanChooseDirectories:NO];
|
[openPanel setCanChooseDirectories:NO];
|
||||||
@@ -75,7 +73,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
|
std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() {
|
||||||
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
|
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
|
||||||
[openPanel setCanChooseFiles:NO];
|
[openPanel setCanChooseFiles:NO];
|
||||||
[openPanel setCanChooseDirectories:YES];
|
[openPanel setCanChooseDirectories:YES];
|
||||||
@@ -90,7 +88,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
|
std::vector<std::string> yaze::core::FileDialogWrapper::GetFilesInFolder(
|
||||||
const std::string& folder) {
|
const std::string& folder) {
|
||||||
std::vector<std::string> filenames;
|
std::vector<std::string> filenames;
|
||||||
NSFileManager* fileManager = [NSFileManager defaultManager];
|
NSFileManager* fileManager = [NSFileManager defaultManager];
|
||||||
@@ -106,7 +104,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
|
|||||||
return filenames;
|
return filenames;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
|
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
|
||||||
const std::string& folder) {
|
const std::string& folder) {
|
||||||
std::vector<std::string> subdirectories;
|
std::vector<std::string> subdirectories;
|
||||||
NSFileManager* fileManager = [NSFileManager defaultManager];
|
NSFileManager* fileManager = [NSFileManager defaultManager];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,7 +13,6 @@ namespace core {
|
|||||||
std::string GetBundleResourcePath();
|
std::string GetBundleResourcePath();
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_PLATFORM_FILE_PATH_H
|
#endif // YAZE_APP_CORE_PLATFORM_FILE_PATH_H
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
#include <TargetConditionals.h>
|
#include <TargetConditionals.h>
|
||||||
|
|
||||||
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
|
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
|
||||||
std::string yaze::app::core::GetBundleResourcePath() {
|
std::string yaze::core::GetBundleResourcePath() {
|
||||||
NSBundle* bundle = [NSBundle mainBundle];
|
NSBundle* bundle = [NSBundle mainBundle];
|
||||||
NSString* resourceDirectoryPath = [bundle bundlePath];
|
NSString* resourceDirectoryPath = [bundle bundlePath];
|
||||||
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
|
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
|
||||||
return [path UTF8String];
|
return [path UTF8String];
|
||||||
}
|
}
|
||||||
#elif TARGET_OS_MAC == 1
|
#elif TARGET_OS_MAC == 1
|
||||||
std::string yaze::app::core::GetBundleResourcePath() {
|
std::string yaze::core::GetBundleResourcePath() {
|
||||||
NSBundle* bundle = [NSBundle mainBundle];
|
NSBundle* bundle = [NSBundle mainBundle];
|
||||||
NSString* resourceDirectoryPath = [bundle bundlePath];
|
NSString* resourceDirectoryPath = [bundle bundlePath];
|
||||||
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
|
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
absl::Status LoadPackageFonts() {
|
absl::Status LoadPackageFonts() {
|
||||||
@@ -240,5 +239,4 @@ void LoadSystemFonts() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -4,14 +4,12 @@
|
|||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
void LoadSystemFonts();
|
void LoadSystemFonts();
|
||||||
absl::Status LoadPackageFonts();
|
absl::Status LoadPackageFonts();
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_PLATFORM_FONTLOADER_H
|
#endif // YAZE_APP_CORE_PLATFORM_FONTLOADER_H
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
#if TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1
|
#if TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1
|
||||||
/* iOS */
|
/* iOS */
|
||||||
void yaze::app::core::LoadSystemFonts() {}
|
void yaze::core::LoadSystemFonts() {}
|
||||||
|
|
||||||
#elif TARGET_OS_MAC == 1
|
#elif TARGET_OS_MAC == 1
|
||||||
/* macOS */
|
/* macOS */
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
void yaze::app::core::LoadSystemFonts() {
|
void yaze::core::LoadSystemFonts() {
|
||||||
NSArray *fontNames = @[ @"Helvetica", @"Times New Roman", @"Courier", @"Arial", @"Verdana" ];
|
NSArray *fontNames = @[ @"Helvetica", @"Times New Roman", @"Courier", @"Arial", @"Verdana" ];
|
||||||
|
|
||||||
for (NSString *fontName in fontNames) {
|
for (NSString *fontName in fontNames) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +76,6 @@ class Renderer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@end
|
@end
|
||||||
#else
|
#else
|
||||||
@interface AppViewController : UIViewController <MTKViewDelegate>
|
@interface AppViewController : UIViewController <MTKViewDelegate>
|
||||||
@property(nonatomic) yaze::app::core::Controller *controller;
|
@property(nonatomic) yaze::core::Controller *controller;
|
||||||
@property(nonatomic) UIHoverGestureRecognizer *hoverGestureRecognizer;
|
@property(nonatomic) UIHoverGestureRecognizer *hoverGestureRecognizer;
|
||||||
@property(nonatomic) UIPinchGestureRecognizer *pinchRecognizer;
|
@property(nonatomic) UIPinchGestureRecognizer *pinchRecognizer;
|
||||||
@property(nonatomic) UISwipeGestureRecognizer *swipeRecognizer;
|
@property(nonatomic) UISwipeGestureRecognizer *swipeRecognizer;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "imgui/misc/cpp/imgui_stdlib.h"
|
#include "imgui/misc/cpp/imgui_stdlib.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
absl::Status Project::Open(const std::string& project_path) {
|
absl::Status Project::Open(const std::string& project_path) {
|
||||||
filepath = project_path;
|
filepath = project_path;
|
||||||
@@ -185,5 +184,5 @@ std::string ResourceLabelManager::CreateOrGetLabel(
|
|||||||
return labels_[type][key];
|
return labels_[type][key];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "app/core/utils/file_util.h"
|
#include "app/core/utils/file_util.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
const std::string kRecentFilesFilename = "recent_files.txt";
|
const std::string kRecentFilesFilename = "recent_files.txt";
|
||||||
constexpr char kEndOfProjectFile[] = "EndOfProjectFile";
|
constexpr char kEndOfProjectFile[] = "EndOfProjectFile";
|
||||||
@@ -130,7 +129,7 @@ class RecentFilesManager {
|
|||||||
std::vector<std::string> recent_files_;
|
std::vector<std::string> recent_files_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_PROJECT_H
|
#endif // YAZE_APP_CORE_PROJECT_H
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
std::string GetFileExtension(const std::string &filename) {
|
std::string GetFileExtension(const std::string &filename) {
|
||||||
@@ -70,5 +69,4 @@ std::string GetConfigDirectory(Platform platform) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
enum class Platform { kUnknown, kMacOS, kiOS, kWindows, kLinux };
|
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,
|
void SaveFile(const std::string &filename, const std::string &data,
|
||||||
Platform platform);
|
Platform platform);
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
} // namespace yaze
|
||||||
} // namespace yaze
|
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_UTILS_FILE_UTIL_H
|
#endif // YAZE_APP_CORE_UTILS_FILE_UTIL_H
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,22 +18,17 @@ struct SDL_Deleter {
|
|||||||
* @brief Deleter for SDL_Texture.
|
* @brief Deleter for SDL_Texture.
|
||||||
*/
|
*/
|
||||||
struct SDL_Texture_Deleter {
|
struct SDL_Texture_Deleter {
|
||||||
void operator()(SDL_Texture *p) const {
|
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
|
||||||
SDL_DestroyTexture(p);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deleter for SDL_Surface.
|
* @brief Deleter for SDL_Surface.
|
||||||
*/
|
*/
|
||||||
struct SDL_Surface_Deleter {
|
struct SDL_Surface_Deleter {
|
||||||
void operator()(SDL_Surface *p) const {
|
void operator()(SDL_Surface *p) const { SDL_FreeSurface(p); }
|
||||||
SDL_FreeSurface(p);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace core
|
} // namespace core
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_UTILS_SDL_DELETER_H_
|
#endif // YAZE_APP_CORE_UTILS_SDL_DELETER_H_
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/gui/icons.h"
|
#include "app/gui/icons.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::FileDialogWrapper;
|
using core::FileDialogWrapper;
|
||||||
@@ -364,5 +363,4 @@ absl::Status AssemblyEditor::Redo() {
|
|||||||
absl::Status AssemblyEditor::Update() { return absl::OkStatus(); }
|
absl::Status AssemblyEditor::Update() { return absl::OkStatus(); }
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "app/gui/style.h"
|
#include "app/gui/style.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,7 +68,6 @@ class AssemblyEditor : public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::SameLine;
|
using ImGui::SameLine;
|
||||||
@@ -78,7 +77,6 @@ struct MemoryEditorWithDiffChecker : public SharedRom {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
|
#endif // YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "zelda3/dungeon/room.h"
|
#include "zelda3/dungeon/room.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -72,6 +71,7 @@ absl::Status DungeonEditor::Update() {
|
|||||||
|
|
||||||
absl::Status DungeonEditor::Initialize() {
|
absl::Status DungeonEditor::Initialize() {
|
||||||
auto dungeon_man_pal_group = rom()->palette_group().dungeon_main;
|
auto dungeon_man_pal_group = rom()->palette_group().dungeon_main;
|
||||||
|
|
||||||
for (int i = 0; i < 0x100 + 40; i++) {
|
for (int i = 0; i < 0x100 + 40; i++) {
|
||||||
rooms_.emplace_back(zelda3::dungeon::Room(/*room_id=*/i));
|
rooms_.emplace_back(zelda3::dungeon::Room(/*room_id=*/i));
|
||||||
rooms_[i].LoadHeader();
|
rooms_[i].LoadHeader();
|
||||||
@@ -123,7 +123,24 @@ absl::Status DungeonEditor::RefreshGraphics() {
|
|||||||
current_palette_group_[current_palette_id_], 0));
|
current_palette_group_[current_palette_id_], 0));
|
||||||
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
|
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;
|
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++) {
|
for (int i = 9; i < 16; i++) {
|
||||||
int block = rooms_[current_room_id_].blocks()[i];
|
int block = rooms_[current_room_id_].blocks()[i];
|
||||||
RETURN_IF_ERROR(graphics_bin_[block].ApplyPaletteWithTransparent(
|
RETURN_IF_ERROR(graphics_bin_[block].ApplyPaletteWithTransparent(
|
||||||
@@ -135,13 +152,13 @@ absl::Status DungeonEditor::RefreshGraphics() {
|
|||||||
|
|
||||||
void DungeonEditor::LoadDungeonRoomSize() {
|
void DungeonEditor::LoadDungeonRoomSize() {
|
||||||
std::map<int, std::vector<int>> rooms_by_bank;
|
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;
|
int bank = room.second >> 16;
|
||||||
rooms_by_bank[bank].push_back(room.second);
|
rooms_by_bank[bank].push_back(room.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process and calculate room sizes within each bank
|
// 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
|
// Sort the rooms within this bank
|
||||||
std::sort(bank_rooms.second.begin(), bank_rooms.second.end());
|
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
|
// Identify the room ID for the current room pointer
|
||||||
int room_id =
|
int room_id =
|
||||||
std::find_if(room_size_addresses_.begin(), room_size_addresses_.end(),
|
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;
|
return entry.second == room_ptr;
|
||||||
})
|
})
|
||||||
->first;
|
->first;
|
||||||
@@ -315,7 +332,7 @@ void DungeonEditor::DrawRoomSelector() {
|
|||||||
gui::InputHexWord("Room ID", ¤t_room_id_);
|
gui::InputHexWord("Room ID", ¤t_room_id_);
|
||||||
gui::InputHex("Palette ID", ¤t_palette_id_);
|
gui::InputHex("Palette ID", ¤t_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,
|
BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
|
||||||
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -421,7 +438,7 @@ void DungeonEditor::DrawDungeonTabView() {
|
|||||||
// Room is already open
|
// Room is already open
|
||||||
next_tab_id++;
|
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
|
// Submit our regular tabs
|
||||||
@@ -514,7 +531,7 @@ void DungeonEditor::DrawRoomGraphics() {
|
|||||||
void DungeonEditor::DrawTileSelector() {
|
void DungeonEditor::DrawTileSelector() {
|
||||||
if (BeginTabBar("##TabBar", ImGuiTabBarFlags_FittingPolicyScroll)) {
|
if (BeginTabBar("##TabBar", ImGuiTabBarFlags_FittingPolicyScroll)) {
|
||||||
if (BeginTabItem("Room Graphics")) {
|
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,
|
BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
|
||||||
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
||||||
DrawRoomGraphics();
|
DrawRoomGraphics();
|
||||||
@@ -577,7 +594,7 @@ void DungeonEditor::DrawObjectRenderer() {
|
|||||||
if (object_loaded_) {
|
if (object_loaded_) {
|
||||||
ImGui::Begin("Memory Viewer", &object_loaded_, 0);
|
ImGui::Begin("Memory Viewer", &object_loaded_, 0);
|
||||||
static MemoryEditor mem_edit;
|
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());
|
object_renderer_.mutable_memory()->size());
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
@@ -586,7 +603,7 @@ void DungeonEditor::DrawObjectRenderer() {
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
void DungeonEditor::CalculateUsageStats() {
|
void DungeonEditor::CalculateUsageStats() {
|
||||||
for (const auto& room : rooms_) {
|
for (const auto &room : rooms_) {
|
||||||
if (blockset_usage_.find(room.blockset) == blockset_usage_.end()) {
|
if (blockset_usage_.find(room.blockset) == blockset_usage_.end()) {
|
||||||
blockset_usage_[room.blockset] = 1;
|
blockset_usage_[room.blockset] = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -608,15 +625,15 @@ void DungeonEditor::CalculateUsageStats() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DungeonEditor::RenderSetUsage(
|
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) {
|
int spriteset_offset) {
|
||||||
// Sort the usage map by set number
|
// Sort the usage map by set number
|
||||||
std::vector<std::pair<uint16_t, int>> sorted_usage(usage_map.begin(),
|
std::vector<std::pair<uint16_t, int>> sorted_usage(usage_map.begin(),
|
||||||
usage_map.end());
|
usage_map.end());
|
||||||
std::sort(sorted_usage.begin(), sorted_usage.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;
|
std::string display_str;
|
||||||
if (spriteset_offset != 0x00) {
|
if (spriteset_offset != 0x00) {
|
||||||
display_str = absl::StrFormat("%#02x, %#02x: %d", set,
|
display_str = absl::StrFormat("%#02x, %#02x: %d", set,
|
||||||
@@ -626,7 +643,7 @@ void DungeonEditor::RenderSetUsage(
|
|||||||
absl::StrFormat("%#02x: %d", (set + spriteset_offset), count);
|
absl::StrFormat("%#02x: %d", (set + spriteset_offset), count);
|
||||||
}
|
}
|
||||||
if (ImGui::Selectable(display_str.c_str(), selected_set == set)) {
|
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 spritesets 0-0x8F
|
||||||
// Range for palettes 0-0x47
|
// Range for palettes 0-0x47
|
||||||
template <typename T>
|
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) {
|
int spriteset_offset = 0x00) {
|
||||||
std::vector<int> unused_sets;
|
std::vector<int> unused_sets;
|
||||||
for (int i = 0; i < max_set; i++) {
|
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);
|
unused_sets.push_back(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& set : unused_sets) {
|
for (const auto &set : unused_sets) {
|
||||||
if (spriteset_offset != 0x00) {
|
if (spriteset_offset != 0x00) {
|
||||||
Text("%#02x, %#02x", set, (set + spriteset_offset));
|
Text("%#02x, %#02x", set, (set + spriteset_offset));
|
||||||
} else {
|
} else {
|
||||||
@@ -653,7 +670,7 @@ void RenderUnusedSets(const absl::flat_hash_map<T, int>& usage_map, int max_set,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void DungeonEditor::DrawUsageStats() {
|
void DungeonEditor::DrawUsageStats() {
|
||||||
if (Button("Refresh")) {
|
if (Button("Refresh")) {
|
||||||
@@ -744,7 +761,7 @@ void DungeonEditor::DrawUsageGrid() {
|
|||||||
int totalSquares = 296;
|
int totalSquares = 296;
|
||||||
int squaresWide = 16;
|
int squaresWide = 16;
|
||||||
int squaresTall = (totalSquares + squaresWide - 1) /
|
int squaresTall = (totalSquares + squaresWide - 1) /
|
||||||
squaresWide; // Ceiling of totalSquares/squaresWide
|
squaresWide; // Ceiling of totalSquares/squaresWide
|
||||||
|
|
||||||
for (int row = 0; row < squaresTall; ++row) {
|
for (int row = 0; row < squaresTall; ++row) {
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
@@ -755,7 +772,7 @@ void DungeonEditor::DrawUsageGrid() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Determine if this square should be highlighted
|
// 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
|
// Create a button or selectable for each square
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
@@ -765,10 +782,10 @@ void DungeonEditor::DrawUsageGrid() {
|
|||||||
color.z = color.z / 255;
|
color.z = color.z / 255;
|
||||||
color.w = 1.0f;
|
color.w = 1.0f;
|
||||||
if (rooms_[row * squaresWide + col].room_size() > 0xFFFF) {
|
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) {
|
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);
|
ImGui::PushStyleColor(ImGuiCol_Button, color);
|
||||||
// Make the button text darker
|
// Make the button text darker
|
||||||
@@ -782,7 +799,7 @@ void DungeonEditor::DrawUsageGrid() {
|
|||||||
if (highlight) {
|
if (highlight) {
|
||||||
ImGui::PushStyleColor(
|
ImGui::PushStyleColor(
|
||||||
ImGuiCol_Button,
|
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",
|
if (Button(absl::StrFormat("%#x",
|
||||||
rooms_[row * squaresWide + col].room_size())
|
rooms_[row * squaresWide + col].room_size())
|
||||||
@@ -827,6 +844,6 @@ void DungeonEditor::DrawUsageGrid() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#include "zelda3/dungeon/room_object.h"
|
#include "zelda3/dungeon/room_object.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
constexpr ImGuiTabItemFlags kDungeonTabFlags =
|
constexpr ImGuiTabItemFlags kDungeonTabFlags =
|
||||||
@@ -143,7 +142,6 @@ class DungeonEditor : public Editor,
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
absl::Status DrawEditor(EditorLayoutParams *params) {
|
absl::Status DrawEditor(EditorLayoutParams *params) {
|
||||||
@@ -48,5 +47,5 @@ absl::Status DrawEditor(EditorLayoutParams *params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -11,10 +11,9 @@
|
|||||||
#include "app/editor/system/resource_manager.h"
|
#include "app/editor/system/resource_manager.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace yaze::app::editor
|
* @namespace yaze::editor
|
||||||
* @brief Editors are the view controllers for the application.
|
* @brief Editors are the view controllers for the application.
|
||||||
*/
|
*/
|
||||||
namespace editor {
|
namespace editor {
|
||||||
@@ -99,7 +98,6 @@ typedef struct EditorLayoutParams {
|
|||||||
absl::Status DrawEditor(EditorLayoutParams *params);
|
absl::Status DrawEditor(EditorLayoutParams *params);
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_EDITOR_H
|
#endif // YAZE_APP_CORE_EDITOR_H
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "imgui/misc/cpp/imgui_stdlib.h"
|
#include "imgui/misc/cpp/imgui_stdlib.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using namespace ImGui;
|
using namespace ImGui;
|
||||||
@@ -816,5 +815,4 @@ absl::Status EditorManager::OpenProject() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,7 +109,6 @@ class EditorManager : public SharedRom, public core::ExperimentFlags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H
|
#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::BeginChild;
|
using ImGui::BeginChild;
|
||||||
@@ -297,5 +296,4 @@ void GfxGroupEditor::DrawPaletteViewer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,6 +42,5 @@ class GfxGroupEditor : public SharedRom {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
#endif // YAZE_APP_EDITOR_GFX_GROUP_EDITOR_H
|
#endif // YAZE_APP_EDITOR_GFX_GROUP_EDITOR_H
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -844,5 +843,4 @@ absl::Status GraphicsEditor::DecompressSuperDonkey() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
// "99973","A3D80",
|
// "99973","A3D80",
|
||||||
@@ -196,7 +195,6 @@ class GraphicsEditor : public SharedRom, public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_GRAPHICS_EDITOR_H
|
#endif // YAZE_APP_EDITOR_GRAPHICS_EDITOR_H
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::AcceptDragDropPayload;
|
using ImGui::AcceptDragDropPayload;
|
||||||
@@ -472,5 +471,4 @@ absl::Status PaletteEditor::ResetColorToOriginal(
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
namespace palette_internal {
|
namespace palette_internal {
|
||||||
@@ -120,7 +119,6 @@ class PaletteEditor : public SharedRom, public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -392,6 +391,22 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
sheets_.emplace(1, rom()->gfx_sheets()[213]);
|
sheets_.emplace(1, rom()->gfx_sheets()[213]);
|
||||||
sheets_.emplace(2, rom()->gfx_sheets()[214]);
|
sheets_.emplace(2, rom()->gfx_sheets()[214]);
|
||||||
sheets_.emplace(3, rom()->gfx_sheets()[215]);
|
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;
|
dungeon_maps_loaded_ = true;
|
||||||
} else {
|
} else {
|
||||||
ImGui::Text("Failed to load dungeon map tile16");
|
ImGui::Text("Failed to load dungeon map tile16");
|
||||||
@@ -470,8 +485,12 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Separator();
|
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();
|
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,
|
current_tile_canvas_.DrawBitmap(tile16_individual_[selected_tile16_], 2,
|
||||||
4.0f);
|
4.0f);
|
||||||
current_tile_canvas_.DrawGrid(16.f);
|
current_tile_canvas_.DrawGrid(16.f);
|
||||||
@@ -589,5 +608,4 @@ void ScreenEditor::DrawToolset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,12 +85,13 @@ private:
|
|||||||
bool copy_button_pressed = false;
|
bool copy_button_pressed = false;
|
||||||
bool paste_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::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<zelda3::screen::DungeonMap> dungeon_maps_;
|
||||||
std::vector<std::vector<std::array<std::string, 25>>> dungeon_map_labels_;
|
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_;
|
absl::Status status_;
|
||||||
|
|
||||||
@@ -100,18 +100,18 @@ private:
|
|||||||
gfx::Tilesheet tile16_sheet_;
|
gfx::Tilesheet tile16_sheet_;
|
||||||
gfx::InternalTile16 current_tile16_info;
|
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 screen_canvas_;
|
||||||
gui::Canvas tilesheet_canvas_;
|
gui::Canvas tilesheet_canvas_;
|
||||||
gui::Canvas tilemap_canvas_{"##TilemapCanvas",
|
gui::Canvas tilemap_canvas_{"##TilemapCanvas", ImVec2(128 + 2, (192) + 4),
|
||||||
ImVec2(128 + 2, (192) + 4),
|
|
||||||
gui::CanvasGridSize::k8x8, 2.f};
|
gui::CanvasGridSize::k8x8, 2.f};
|
||||||
|
|
||||||
zelda3::screen::Inventory inventory_;
|
zelda3::screen::Inventory inventory_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -251,7 +250,7 @@ absl::Status Tile16Editor::DrawTileEditControls() {
|
|||||||
gui::InputHexByte("Palette", ¬ify_palette.mutable_get());
|
gui::InputHexByte("Palette", ¬ify_palette.mutable_get());
|
||||||
notify_palette.apply_changes();
|
notify_palette.apply_changes();
|
||||||
if (notify_palette.modified()) {
|
if (notify_palette.modified()) {
|
||||||
auto palette = palettesets_[current_palette_].main;
|
auto palette = palettesets_[current_palette_].main_;
|
||||||
auto value = notify_palette.get();
|
auto value = notify_palette.get();
|
||||||
if (notify_palette.get() > 0x04 && notify_palette.get() < 0x06) {
|
if (notify_palette.get() > 0x04 && notify_palette.get() < 0x06) {
|
||||||
palette = palettesets_[current_palette_].aux1;
|
palette = palettesets_[current_palette_].aux1;
|
||||||
@@ -400,5 +399,4 @@ absl::Status Tile16Editor::UpdateTransferTileCanvas() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +99,5 @@ class Tile16Editor : public GfxContext, public SharedRom {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
#endif // YAZE_APP_EDITOR_TILE16EDITOR_H
|
#endif // YAZE_APP_EDITOR_TILE16EDITOR_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include "app/core/common.h"
|
#include "app/core/common.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
uint8_t FindMatchingCharacter(char value) {
|
uint8_t FindMatchingCharacter(char value) {
|
||||||
@@ -145,7 +144,7 @@ std::vector<uint8_t> ParseMessageToData(std::string str) {
|
|||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom) {
|
std::vector<DictionaryEntry> BuildDictionaryEntries(Rom* rom) {
|
||||||
std::vector<DictionaryEntry> AllDictionaries;
|
std::vector<DictionaryEntry> AllDictionaries;
|
||||||
for (int i = 0; i < kNumDictionaryEntries; i++) {
|
for (int i = 0; i < kNumDictionaryEntries; i++) {
|
||||||
std::vector<uint8_t> bytes;
|
std::vector<uint8_t> bytes;
|
||||||
@@ -178,5 +177,4 @@ std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
const uint8_t kMessageTerminator = 0x7F;
|
const uint8_t kMessageTerminator = 0x7F;
|
||||||
@@ -78,7 +77,7 @@ constexpr int kTextDataEnd = 0xE7FFF;
|
|||||||
constexpr int kNumDictionaryEntries = 97;
|
constexpr int kNumDictionaryEntries = 97;
|
||||||
constexpr int kPointersDictionaries = 0x74703;
|
constexpr int kPointersDictionaries = 0x74703;
|
||||||
|
|
||||||
std::vector<DictionaryEntry> BuildDictionaryEntries(app::Rom* rom);
|
std::vector<DictionaryEntry> BuildDictionaryEntries(Rom* rom);
|
||||||
|
|
||||||
std::string ReplaceAllDictionaryWords(std::string str,
|
std::string ReplaceAllDictionaryWords(std::string str,
|
||||||
std::vector<DictionaryEntry> dictionary);
|
std::vector<DictionaryEntry> dictionary);
|
||||||
@@ -278,7 +277,6 @@ ParsedElement FindMatchingElement(const std::string& str);
|
|||||||
std::string ParseTextDataByte(uint8_t value);
|
std::string ParseTextDataByte(uint8_t value);
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
#endif // YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include "imgui/misc/cpp/imgui_stdlib.h"
|
#include "imgui/misc/cpp/imgui_stdlib.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -700,5 +699,4 @@ void MessageEditor::SelectAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
constexpr int kGfxFont = 0x70000; // 2bpp format
|
constexpr int kGfxFont = 0x70000; // 2bpp format
|
||||||
@@ -163,7 +162,6 @@ class MessageEditor : public Editor, public SharedRom {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
#endif // YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
absl::Status MusicEditor::Update() {
|
absl::Status MusicEditor::Update() {
|
||||||
@@ -218,5 +217,4 @@ void MusicEditor::DrawToolset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
static const char* kGameSongs[] = {"Title",
|
static const char* kGameSongs[] = {"Title",
|
||||||
@@ -85,7 +84,6 @@ class MusicEditor : public SharedRom, public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "app/gui/style.h"
|
#include "app/gui/style.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::BeginChild;
|
using ImGui::BeginChild;
|
||||||
@@ -489,5 +488,4 @@ bool DrawSpriteEditorPopup(zelda3::Sprite &sprite) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/zelda3/overworld/overworld.h"
|
#include "app/zelda3/overworld/overworld.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity,
|
bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity,
|
||||||
@@ -81,7 +80,6 @@ void DrawSpriteInserterPopup();
|
|||||||
bool DrawSpriteEditorPopup(zelda3::Sprite &sprite);
|
bool DrawSpriteEditorPopup(zelda3::Sprite &sprite);
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
#endif // YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
@@ -1530,5 +1529,4 @@ void OverworldEditor::InitializeZeml() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
constexpr uint k4BPP = 4;
|
constexpr uint k4BPP = 4;
|
||||||
@@ -309,7 +308,6 @@ class OverworldEditor : public Editor,
|
|||||||
absl::Status status_;
|
absl::Status status_;
|
||||||
};
|
};
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/zelda3/sprite/sprite.h"
|
#include "app/zelda3/sprite/sprite.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::BeginTable;
|
using ImGui::BeginTable;
|
||||||
@@ -275,5 +274,4 @@ void SpriteEditor::DrawCustomSpritesMetadata() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
constexpr ImGuiTabItemFlags kSpriteTabFlags =
|
constexpr ImGuiTabItemFlags kSpriteTabFlags =
|
||||||
@@ -111,7 +110,6 @@ class SpriteEditor : public SharedRom, public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H
|
#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
/**
|
/**
|
||||||
* @brief Namespace for the ZSprite format from Zarby's ZSpriteMaker.
|
* @brief Namespace for the ZSprite format from Zarby's ZSpriteMaker.
|
||||||
@@ -390,7 +389,6 @@ struct ZSprite {
|
|||||||
|
|
||||||
} // namespace zsprite
|
} // namespace zsprite
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SPRITE_ZSPRITE_H
|
#endif // YAZE_APP_EDITOR_SPRITE_ZSPRITE_H
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
ImGuiKey MapKeyToImGuiKey(char key) {
|
ImGuiKey MapKeyToImGuiKey(char key) {
|
||||||
@@ -139,5 +138,4 @@ void CommandManager::LoadKeybindings(const std::string &filepath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -7,17 +7,15 @@
|
|||||||
|
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {namespace editor {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
|
||||||
|
|
||||||
ImGuiKey MapKeyToImGuiKey(char key);
|
ImGuiKey MapKeyToImGuiKey(char key);
|
||||||
|
|
||||||
class CommandManager {
|
class CommandManager {
|
||||||
public:
|
public:
|
||||||
CommandManager() = default;
|
CommandManager() = default;
|
||||||
~CommandManager() = default;
|
~CommandManager() = default;
|
||||||
|
|
||||||
using Command = std::function<void()>;
|
using Command = std::function<void()>;
|
||||||
|
|
||||||
struct CommandInfo {
|
struct CommandInfo {
|
||||||
@@ -27,7 +25,9 @@ public:
|
|||||||
std::string desc;
|
std::string desc;
|
||||||
CommandInfo(Command command, char mnemonic, const std::string &name,
|
CommandInfo(Command command, char mnemonic, const std::string &name,
|
||||||
const std::string &desc)
|
const std::string &desc)
|
||||||
: command(std::move(command)), mnemonic(mnemonic), name(name),
|
: command(std::move(command)),
|
||||||
|
mnemonic(mnemonic),
|
||||||
|
name(name),
|
||||||
desc(desc) {}
|
desc(desc) {}
|
||||||
CommandInfo() = default;
|
CommandInfo() = default;
|
||||||
};
|
};
|
||||||
@@ -72,12 +72,10 @@ public:
|
|||||||
void SaveKeybindings(const std::string &filepath);
|
void SaveKeybindings(const std::string &filepath);
|
||||||
void LoadKeybindings(const std::string &filepath);
|
void LoadKeybindings(const std::string &filepath);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unordered_map<std::string, CommandInfoOrPrefix> commands_;
|
std::unordered_map<std::string, CommandInfoOrPrefix> commands_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor} // namespace yaze
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H
|
#endif // YAZE_APP_EDITOR_SYSTEM_COMMAND_MANAGER_H
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
class ConstantManager {
|
class ConstantManager {
|
||||||
@@ -71,7 +70,6 @@ class ConstantManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H
|
#endif // YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H
|
||||||
|
|||||||
@@ -5,13 +5,12 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <system/extension.h>
|
#include <yaze.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
void ExtensionManager::LoadExtension(const std::string& filename,
|
void ExtensionManager::LoadExtension(const std::string& filename,
|
||||||
@@ -81,5 +80,4 @@ void ExtensionManager::ExecuteExtensionUI(yaze_editor_context* context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
|
#ifndef YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
|
||||||
#define 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 <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {namespace editor {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
|
||||||
|
|
||||||
class ExtensionManager {
|
class ExtensionManager {
|
||||||
public:
|
public:
|
||||||
@@ -22,8 +20,6 @@ class ExtensionManager {
|
|||||||
std::vector<yaze_extension*> extensions_;
|
std::vector<yaze_extension*> extensions_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor} // namespace yaze
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
|
#endif // YAZE_APP_EDITOR_SYSTEM_EXTENSION_MANAGER_H
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::BeginMenu;
|
using ImGui::BeginMenu;
|
||||||
@@ -58,7 +57,6 @@ struct FlagsMenu : public core::ExperimentFlags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_UTILS_FLAGS_H_
|
#endif // YAZE_APP_EDITOR_UTILS_FLAGS_H_
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
// System history manager, undo and redo.
|
// System history manager, undo and redo.
|
||||||
@@ -26,7 +25,6 @@ class HistoryManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
|
#endif // YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
PopupManager::PopupManager() {
|
PopupManager::PopupManager() {
|
||||||
@@ -15,5 +14,5 @@ PopupManager::~PopupManager() {
|
|||||||
|
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#define YAZE_APP_EDITOR_POPUP_MANAGER_H
|
#define YAZE_APP_EDITOR_POPUP_MANAGER_H
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
// ImGui popup manager.
|
// ImGui popup manager.
|
||||||
@@ -15,7 +14,7 @@ class PopupManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_POPUP_MANAGER_H
|
#endif // YAZE_APP_EDITOR_POPUP_MANAGER_H
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
// System resource manager.
|
// System resource manager.
|
||||||
@@ -24,7 +23,7 @@ class ResourceManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SYSTEM_RESOURCE_MANAGER_H
|
#endif // YAZE_APP_EDITOR_SYSTEM_RESOURCE_MANAGER_H
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
using ImGui::BeginChild;
|
using ImGui::BeginChild;
|
||||||
@@ -79,5 +78,4 @@ absl::Status SettingsEditor::DrawKeyboardShortcuts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/editor/editor.h"
|
#include "app/editor/editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
// Simple representation for a tree
|
// Simple representation for a tree
|
||||||
@@ -226,7 +225,6 @@ class SettingsEditor : public Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EDITOR_SETTINGS_EDITOR_H_
|
#endif // YAZE_APP_EDITOR_SETTINGS_EDITOR_H_
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -203,5 +202,5 @@ void Apu::SpcIdle(bool waiting) { Cycle(); }
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -95,7 +94,7 @@ class Apu {
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -633,5 +632,5 @@ void Dsp::GetSamples(int16_t* sample_data, int samples_per_frame,
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -157,7 +156,7 @@ class Dsp {
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_AUDIO_S_DSP_H
|
#endif // YAZE_APP_EMU_AUDIO_S_DSP_H
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "app/emu/audio/spc700.h"
|
#include "app/emu/audio/spc700.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -148,5 +147,5 @@ uint16_t Spc700::addr_plus_i_indexed() {
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "app/emu/audio/spc700.h"
|
#include "app/emu/audio/spc700.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -483,5 +482,5 @@ void Spc700::STOP() {}
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "app/emu/audio/internal/opcodes.h"
|
#include "app/emu/audio/internal/opcodes.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -1326,5 +1325,5 @@ void Spc700::LogInstruction(uint16_t initial_pc, uint8_t opcode) {
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
@@ -339,6 +338,6 @@ class Spc700 {
|
|||||||
|
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
#endif // YAZE_APP_EMU_SPC700_H
|
#endif // YAZE_APP_EMU_SPC700_H
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
class Clock {
|
class Clock {
|
||||||
@@ -57,7 +56,7 @@ class ClockImpl : public Clock {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_CLOCK_H_
|
#endif // YAZE_APP_EMU_CLOCK_H_
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "app/emu/cpu/internal/opcodes.h"
|
#include "app/emu/cpu/internal/opcodes.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
void Cpu::Reset(bool hard) {
|
void Cpu::Reset(bool hard) {
|
||||||
@@ -2260,5 +2259,5 @@ uint8_t Cpu::GetInstructionLength(uint8_t opcode) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
class InstructionEntry {
|
class InstructionEntry {
|
||||||
@@ -799,7 +798,7 @@ class Cpu : public core::ExperimentFlags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_CPU_H_
|
#endif // YAZE_APP_EMU_CPU_H_
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "app/emu/cpu/cpu.h"
|
#include "app/emu/cpu/cpu.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
void Cpu::AdrImp() {
|
void Cpu::AdrImp() {
|
||||||
@@ -186,5 +185,5 @@ uint16_t Cpu::StackRelative() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "app/emu/cpu/cpu.h"
|
#include "app/emu/cpu/cpu.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -398,5 +397,5 @@ void Cpu::ORA(uint32_t low, uint32_t high) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
using namespace yaze::app;
|
using namespace yaze;
|
||||||
using yaze::app::core::SDL_Deleter;
|
using yaze::core::SDL_Deleter;
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
absl::InitializeSymbolizer(argv[0]);
|
absl::InitializeSymbolizer(argv[0]);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "imgui_memory_editor.h"
|
#include "imgui_memory_editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -540,5 +539,5 @@ void Emulator::RenderCpuInstructionLog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -10,10 +10,9 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace yaze::app::emu
|
* @namespace yaze::emu
|
||||||
* @brief SNES Emulation and debugging tools.
|
* @brief SNES Emulation and debugging tools.
|
||||||
*/
|
*/
|
||||||
namespace emu {
|
namespace emu {
|
||||||
@@ -190,7 +189,7 @@ class Emulator : public SharedRom {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_CORE_EMULATOR_H
|
#endif // YAZE_APP_CORE_EMULATOR_H
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "app/emu/cpu/internal/opcodes.h"
|
#include "app/emu/cpu/internal/opcodes.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
enum class AddressingMode {
|
enum class AddressingMode {
|
||||||
@@ -444,5 +443,5 @@ class AsmParser {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
namespace dma {
|
namespace dma {
|
||||||
@@ -372,5 +371,5 @@ void StartDma(MemoryImpl* memory, uint8_t val, bool hdma) {
|
|||||||
} // namespace dma
|
} // namespace dma
|
||||||
} // namespace memory
|
} // namespace memory
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/emu/snes.h"
|
#include "app/emu/snes.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
namespace dma {
|
namespace dma {
|
||||||
@@ -31,7 +30,7 @@ void DoDma(SNES* snes, MemoryImpl* memory, int cycles);
|
|||||||
} // namespace dma
|
} // namespace dma
|
||||||
} // namespace memory
|
} // namespace memory
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_MEMORY_DMA_H
|
#endif // YAZE_APP_EMU_MEMORY_DMA_H
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ typedef struct DmaChannel {
|
|||||||
|
|
||||||
} // namespace memory
|
} // namespace memory
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_MEMORY_DMA_CHANNEL_H
|
#endif // YAZE_APP_EMU_MEMORY_DMA_CHANNEL_H
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
|
|
||||||
@@ -167,5 +166,5 @@ uint32_t MemoryImpl::GetMappedAddress(uint32_t address) const {
|
|||||||
|
|
||||||
} // namespace memory
|
} // namespace memory
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -27,7 +27,6 @@
|
|||||||
// 7F 0000-FFFF System RAM
|
// 7F 0000-FFFF System RAM
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
|
|
||||||
@@ -309,7 +308,7 @@ class MemoryImpl : public Memory {
|
|||||||
|
|
||||||
} // namespace memory
|
} // namespace memory
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // MEM_H
|
#endif // MEM_H
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -574,5 +573,5 @@ void SNES::InitAccessTime(bool recalc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "app/emu/video/ppu.h"
|
#include "app/emu/video/ppu.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
|
||||||
struct Input {
|
struct Input {
|
||||||
@@ -131,7 +130,7 @@ class SNES {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_SNES_H
|
#endif // YAZE_APP_EMU_SNES_H
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "app/emu/memory/memory.h"
|
#include "app/emu/memory/memory.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace video {
|
namespace video {
|
||||||
|
|
||||||
@@ -1056,5 +1055,5 @@ void Ppu::PutPixels(uint8_t* pixels) {
|
|||||||
|
|
||||||
} // namespace video
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace video {
|
namespace video {
|
||||||
|
|
||||||
@@ -458,7 +457,7 @@ class Ppu : public SharedRom {
|
|||||||
|
|
||||||
} // namespace video
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_PPU_H
|
#endif // YAZE_APP_EMU_PPU_H
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace emu {
|
namespace emu {
|
||||||
namespace video {
|
namespace video {
|
||||||
namespace PpuRegisters {
|
namespace PpuRegisters {
|
||||||
@@ -416,7 +415,7 @@ struct STAT78 {
|
|||||||
} // namespace PpuRegisters
|
} // namespace PpuRegisters
|
||||||
} // namespace video
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_EMU_VIDEO_PPU_REGISTERS_H
|
#endif // YAZE_APP_EMU_VIDEO_PPU_REGISTERS_H
|
||||||
@@ -18,7 +18,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
||||||
using core::SDL_Surface_Deleter;
|
using core::SDL_Surface_Deleter;
|
||||||
@@ -483,5 +482,5 @@ void Bitmap::WriteColor(int position, const ImVec4 &color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace gfx
|
} // namespace gfx
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -12,10 +12,9 @@
|
|||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace yaze::app::gfx
|
* @namespace yaze::gfx
|
||||||
* @brief Contains classes for handling graphical data.
|
* @brief Contains classes for handling graphical data.
|
||||||
*/
|
*/
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
@@ -214,7 +213,7 @@ class Bitmap {
|
|||||||
using BitmapTable = std::unordered_map<int, gfx::Bitmap>;
|
using BitmapTable = std::unordered_map<int, gfx::Bitmap>;
|
||||||
|
|
||||||
} // namespace gfx
|
} // namespace gfx
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|
||||||
#endif // YAZE_APP_GFX_BITMAP_H
|
#endif // YAZE_APP_GFX_BITMAP_H
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#define DEBUG_LOG(msg) std::cout << msg << std::endl
|
#define DEBUG_LOG(msg) std::cout << msg << std::endl
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
||||||
namespace lc_lz2 {
|
namespace lc_lz2 {
|
||||||
@@ -1473,5 +1472,5 @@ absl::StatusOr<std::vector<uint8_t>> DecompressOverworld(
|
|||||||
|
|
||||||
} // namespace lc_lz2
|
} // namespace lc_lz2
|
||||||
} // namespace gfx
|
} // namespace gfx
|
||||||
} // namespace app
|
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user