add header comments to editor classes

This commit is contained in:
scawful
2024-04-14 00:04:17 -05:00
parent f653517026
commit 96defd6e5e
6 changed files with 93 additions and 5 deletions

View File

@@ -32,6 +32,16 @@ constexpr ImGuiTableFlags kDungeonTableFlags =
ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter |
ImGuiTableFlags_BordersV; ImGuiTableFlags_BordersV;
/**
* @brief DungeonEditor class for editing dungeons.
*
* This class is currently a work in progress and is used for editing dungeons.
* It provides various functions for updating, cutting, copying, pasting,
* undoing, and redoing. It also includes methods for drawing the toolset, room
* selector, entrance selector, dungeon tab view, dungeon canvas, room graphics,
* tile selector, and object renderer. Additionally, it handles loading room
* entrances, calculating usage statistics, and rendering set usage.
*/
class DungeonEditor : public Editor, class DungeonEditor : public Editor,
public SharedROM, public SharedROM,
public core::ExperimentFlags { public core::ExperimentFlags {

View File

@@ -60,8 +60,19 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable |
ImGuiTableFlags_SizingStretchSame; ImGuiTableFlags_SizingStretchSame;
/** /**
* @brief Manages the games graphical content. * @class GraphicsEditor
*/ * @brief Allows the user to edit graphics sheets from the game or view
* prototype graphics of Link to the Past from the CGX, SCR, and OBJ formats.
*
* The GraphicsEditor class is responsible for providing functionality to edit
* graphics sheets from the game or view prototype graphics of Link to the Past
* from the CGX, SCR, and OBJ formats. It provides various methods to update
* different components of the graphics editor, such as the graphics edit tab,
* link graphics view, and prototype graphics viewer. It also includes import
* functions for different file formats, as well as other utility functions for
* drawing toolsets, palette controls, clipboard imports, experimental features,
* and memory editor.
*/
class GraphicsEditor : public SharedROM { class GraphicsEditor : public SharedROM {
public: public:
absl::Status Update(); absl::Status Update();

View File

@@ -12,7 +12,6 @@
#include "absl/status/status.h" #include "absl/status/status.h"
#include "app/core/common.h" #include "app/core/common.h"
#include "app/core/constants.h" #include "app/core/constants.h"
#include "app/gui/pipeline.h"
#include "app/editor/context/gfx_context.h" #include "app/editor/context/gfx_context.h"
#include "app/editor/dungeon_editor.h" #include "app/editor/dungeon_editor.h"
#include "app/editor/graphics_editor.h" #include "app/editor/graphics_editor.h"
@@ -28,12 +27,31 @@
#include "app/gui/canvas.h" #include "app/gui/canvas.h"
#include "app/gui/icons.h" #include "app/gui/icons.h"
#include "app/gui/input.h" #include "app/gui/input.h"
#include "app/gui/pipeline.h"
#include "app/rom.h" #include "app/rom.h"
namespace yaze { namespace yaze {
namespace app { namespace app {
namespace editor { namespace editor {
/**
* @class MasterEditor
* @brief The MasterEditor class represents the main editor for a ROM in the
* Yaze application.
*
* This class inherits from SharedROM, GfxContext, and ExperimentFlags, and
* provides functionality for setting up the screen, updating the editor, and
* shutting down the editor. It also includes methods for drawing various menus
* and popups, saving the ROM, and managing editor-specific flags.
*
* The MasterEditor class contains instances of various editor classes such as
* AssemblyEditor, DungeonEditor, GraphicsEditor, MusicEditor, OverworldEditor,
* PaletteEditor, ScreenEditor, and SpriteEditor. The current_editor_ member
* variable points to the currently active editor in the tab view.
*
* @note This class assumes the presence of an SDL_Renderer object for rendering
* graphics.
*/
class MasterEditor : public SharedROM, class MasterEditor : public SharedROM,
public context::GfxContext, public context::GfxContext,
public core::ExperimentFlags { public core::ExperimentFlags {

View File

@@ -62,6 +62,17 @@ constexpr absl::string_view kTileSelectorTab = "##TileSelectorTabBar";
constexpr absl::string_view kOWEditTable = "##OWEditTable"; constexpr absl::string_view kOWEditTable = "##OWEditTable";
constexpr absl::string_view kOWMapTable = "#MapSettingsTable"; constexpr absl::string_view kOWMapTable = "#MapSettingsTable";
/**
* @class OverworldEditor
* @brief Represents an editor for the overworld in a game.
*
* The `OverworldEditor` class is responsible for managing the editing and
* manipulation of the overworld in a game. It inherits from various base
* classes and provides functionality for updating, drawing, and handling user
* interactions with the overworld. It also includes methods for loading
* graphics, refreshing map data, and performing various editing operations.
*
*/
class OverworldEditor : public Editor, class OverworldEditor : public Editor,
public SharedROM, public SharedROM,
public context::GfxContext, public context::GfxContext,

View File

@@ -22,6 +22,20 @@ namespace yaze {
namespace app { namespace app {
namespace editor { namespace editor {
/**
* @brief The ScreenEditor class allows the user to edit a variety of screens in
* the game or create a custom menu.
*
* This class is currently a work in progress (WIP) and provides functionality
* for updating the screens, saving dungeon maps, drawing different types of
* screens, loading dungeon maps, and managing various properties related to the
* editor.
*
* The screens that can be edited include the title screen, naming screen,
* overworld map, inventory menu, and more.
*
* The class inherits from the SharedROM class.
*/
class ScreenEditor : public SharedROM { class ScreenEditor : public SharedROM {
public: public:
ScreenEditor(); ScreenEditor();

View File

@@ -9,17 +9,41 @@ namespace yaze {
namespace app { namespace app {
namespace editor { namespace editor {
/**
* @brief The SpriteEditor class represents a sprite editor that inherits from
* SharedROM.
*
* This class provides functionality for updating the sprite editor, drawing the
* editor table, drawing the sprite canvas, and drawing the current sheets.
*/
class SpriteEditor : public SharedROM { class SpriteEditor : public SharedROM {
public: public:
/**
* @brief Updates the sprite editor.
*
* @return An absl::Status indicating the success or failure of the update.
*/
absl::Status Update(); absl::Status Update();
private: private:
/**
* @brief Draws the editor table.
*/
void DrawEditorTable(); void DrawEditorTable();
/**
* @brief Draws the sprite canvas.
*/
void DrawSpriteCanvas(); void DrawSpriteCanvas();
/**
* @brief Draws the current sheets.
*/
void DrawCurrentSheets(); void DrawCurrentSheets();
uint8_t current_sheets_[8]; uint8_t current_sheets_[8]; /**< Array to store the current sheets. */
bool sheets_loaded_ = false; bool sheets_loaded_ =
false; /**< Flag indicating whether the sheets are loaded or not. */
}; };
} // namespace editor } // namespace editor