yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
macro.h File Reference

Go to the source code of this file.

Macros

#define TAB_ITEM(w)
 
#define END_TAB_ITEM()
 
#define MENU_ITEM(w)
 
#define MENU_ITEM2(w, v)
 
#define BUTTON_COLUMN(w)
 
#define TEXT_COLUMN(w)
 
#define BEGIN_TABLE(l, n, f)
 
#define SETUP_COLUMN(l)
 
#define TABLE_HEADERS()
 
#define NEXT_COLUMN()
 
#define END_TABLE()
 
#define HOVER_HINT(string)
 
#define PRINT_IF_ERROR(expression)
 
#define EXIT_IF_ERROR(expression)
 
#define RETURN_VOID_IF_ERROR(expression)
 
#define RETURN_IF_ERROR(expression)
 
#define ASSIGN_OR_RETURN(type_variable_name, expression)
 
#define ASSIGN_OR_RETURN_IMPL(error_or_value, type_variable_name, expression)
 
#define ASSIGN_OR_LOG_ERROR(type_variable_name, expression)
 
#define ASSIGN_OR_LOG_ERROR_IMPL(error_or_value, type_variable_name, expression)
 
#define APPEND_NUMBER(expression, number)
 
#define APPEND_NUMBER_INNER(expression, number)
 
#define TEXT_WITH_SEPARATOR(text)
 
#define TABLE_BORDERS_RESIZABLE    ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable
 
#define CLEAR_AND_RETURN_STATUS(status)
 
#define RETURN_IF_EXCEPTION(expression)
 
#define SDL_RETURN_IF_ERROR()
 

Macro Definition Documentation

◆ TAB_ITEM

◆ END_TAB_ITEM

◆ MENU_ITEM

#define MENU_ITEM ( w)
Value:
if (ImGui::MenuItem(w))

Definition at line 9 of file macro.h.

Referenced by yaze::editor::EditorManager::DrawMenuContent().

◆ MENU_ITEM2

#define MENU_ITEM2 ( w,
v )
Value:
if (ImGui::MenuItem(w, v))

Definition at line 10 of file macro.h.

Referenced by yaze::editor::EditorManager::DrawMenuContent().

◆ BUTTON_COLUMN

#define BUTTON_COLUMN ( w)
Value:
ImGui::TableNextColumn(); \
ImGui::Button(w);

Definition at line 12 of file macro.h.

Referenced by yaze::editor::ScreenEditor::DrawInventoryToolset(), and yaze::editor::MusicEditor::DrawToolset().

◆ TEXT_COLUMN

#define TEXT_COLUMN ( w)
Value:
ImGui::TableNextColumn(); \
ImGui::Text(w);

Definition at line 16 of file macro.h.

Referenced by yaze::editor::ScreenEditor::DrawInventoryToolset(), and yaze::editor::GraphicsEditor::DrawToolset().

◆ BEGIN_TABLE

#define BEGIN_TABLE ( l,
n,
f )
Value:
if (ImGui::BeginTable(l, n, f, ImVec2(0, 0))) {

Definition at line 20 of file macro.h.

Referenced by yaze::editor::MemoryEditorWithDiffChecker::Update(), and yaze::editor::GraphicsEditor::UpdateScadView().

◆ SETUP_COLUMN

#define SETUP_COLUMN ( l)
Value:
ImGui::TableSetupColumn(l);

Definition at line 21 of file macro.h.

Referenced by yaze::editor::MemoryEditorWithDiffChecker::Update(), and yaze::editor::GraphicsEditor::UpdateScadView().

◆ TABLE_HEADERS

#define TABLE_HEADERS ( )
Value:
ImGui::TableHeadersRow(); \
ImGui::TableNextRow();

Definition at line 23 of file macro.h.

Referenced by yaze::editor::GraphicsEditor::UpdateScadView().

◆ NEXT_COLUMN

◆ END_TABLE

#define END_TABLE ( )
Value:
ImGui::EndTable(); \
}

Definition at line 29 of file macro.h.

Referenced by yaze::editor::MemoryEditorWithDiffChecker::Update(), and yaze::editor::GraphicsEditor::UpdateScadView().

◆ HOVER_HINT

◆ PRINT_IF_ERROR

◆ EXIT_IF_ERROR

#define EXIT_IF_ERROR ( expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
std::cout << error.ToString() << std::endl; \
return EXIT_FAILURE; \
} \
}

Definition at line 44 of file macro.h.

Referenced by main().

◆ RETURN_VOID_IF_ERROR

#define RETURN_VOID_IF_ERROR ( expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
std::cout << error.ToString() << std::endl; \
return; \
} \
}

Definition at line 53 of file macro.h.

Referenced by yaze::editor::ScreenEditor::DrawDungeonMapsEditor(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), and yaze::editor::EditorManager::SaveRom().

◆ RETURN_IF_ERROR

#define RETURN_IF_ERROR ( expression)
Value:
{ \
auto error = expression; \
if (!error.ok()) { \
return error; \
} \
}

Definition at line 62 of file macro.h.

Referenced by yaze::zelda3::OverworldMap::BuildMap(), yaze::zelda3::Inventory::BuildTileset(), yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::gfx::lc_lz2::CompressV2(), yaze::gfx::lc_lz2::CompressV3(), yaze::zelda3::Inventory::Create(), yaze::core::Renderer::CreateAndRenderBitmap(), yaze::core::Controller::CreateGuiContext(), yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::editor::GraphicsEditor::DrawExperimentalFeatures(), yaze::editor::GraphicsEditor::DrawFileImport(), yaze::editor::PaletteEditor::DrawPaletteGroup(), yaze::editor::OverworldEditor::DrawTile16Selector(), yaze::editor::Tile16Editor::DrawTileEditControls(), yaze::gfx::PaletteGroupMap::for_each(), yaze::cli::ApplyPatch::handle(), yaze::cli::AsarPatch::handle(), yaze::cli::Backup::handle(), yaze::cli::Expand::handle(), yaze::cli::Open::handle(), yaze::cli::ReadFromRom::handle(), yaze::cli::Tile16Transfer::handle(), yaze::editor::Tile16Editor::InitBlockset(), yaze::editor::MessageEditor::Initialize(), yaze::zelda3::Overworld::Load(), yaze::LoadAllGraphicsData(), yaze::gfx::LoadAllPalettes(), yaze::zelda3::LoadDungeonMapGfxFromBinary(), yaze::editor::ScreenEditor::LoadDungeonMapTile16(), yaze::zelda3::Overworld::LoadExits(), yaze::Rom::LoadFromData(), yaze::Rom::LoadFromFile(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::LoadLinkGraphics(), yaze::zelda3::Overworld::LoadOverworldMaps(), yaze::core::LoadPackageFonts(), yaze::zelda3::OverworldMap::LoadPalette(), yaze::editor::OverworldEditor::LoadSpriteGraphics(), yaze::zelda3::Overworld::LoadSprites(), yaze::gui::LoadTheme(), yaze::editor::Tile16Editor::LoadTile8(), yaze::Rom::LoadZelda3(), yaze::core::Controller::OnEntry(), yaze::core::Controller::OnLoad(), yaze::core::Controller::OnTestLoad(), yaze::editor::EditorManager::OpenProject(), yaze::editor::DungeonEditor::RefreshGraphics(), yaze::editor::OverworldEditor::RefreshMapPalette(), yaze::editor::OverworldEditor::RefreshTile16Blockset(), yaze::core::ReloadPackageFont(), yaze::editor::MessageEditor::Save(), yaze::editor::OverworldEditor::Save(), yaze::Project::Save(), yaze::zelda3::Overworld::Save(), yaze::zelda3::RoomEntrance::Save(), yaze::Rom::SaveAllPalettes(), yaze::editor::ScreenEditor::SaveDungeonMaps(), yaze::editor::ScreenEditor::SaveDungeonMapTile16(), yaze::zelda3::Overworld::SaveEntrances(), yaze::zelda3::Overworld::SaveExits(), yaze::zelda3::Overworld::SaveItems(), yaze::zelda3::Overworld::SaveLargeMaps(), yaze::zelda3::Overworld::SaveMap16Expanded(), yaze::zelda3::Overworld::SaveMap16Tiles(), yaze::zelda3::Overworld::SaveMap32Expanded(), yaze::zelda3::Overworld::SaveMap32Tiles(), yaze::zelda3::Overworld::SaveMapProperties(), yaze::zelda3::Overworld::SaveOverworldMaps(), yaze::Rom::SavePalette(), yaze::Rom::SaveToFile(), yaze::editor::Tile16Editor::SetCurrentTile(), yaze::editor::DungeonEditor::Update(), yaze::editor::EditorManager::Update(), yaze::editor::MessageEditor::Update(), yaze::editor::OverworldEditor::Update(), yaze::editor::Tile16Editor::Update(), yaze::editor::Tile16Editor::UpdateBlockset(), yaze::editor::GraphicsEditor::UpdatePaletteColumn(), yaze::editor::GraphicsEditor::UpdateScadView(), yaze::editor::Tile16Editor::UpdateTile16Edit(), yaze::editor::Tile16Editor::UpdateTile16Transfer(), yaze::editor::Tile16Editor::UpdateTransferTileCanvas(), yaze::gfx::lc_lz2::ValidateCompressionResult(), yaze::gfx::lc_lz2::ValidateCompressionResultV3(), and yaze::Rom::WriteTile16().

◆ ASSIGN_OR_RETURN

#define ASSIGN_OR_RETURN ( type_variable_name,
expression )
Value:
ASSIGN_OR_RETURN_IMPL(APPEND_NUMBER(error_or_value, __LINE__), \
type_variable_name, expression)
#define APPEND_NUMBER(expression, number)
Definition macro.h:93
#define ASSIGN_OR_RETURN_IMPL(error_or_value, type_variable_name, expression)
Definition macro.h:74

Definition at line 70 of file macro.h.

Referenced by yaze::gfx::Bitmap::ApplyPalette(), yaze::gfx::Bitmap::ApplyPaletteFromPaletteGroup(), yaze::gfx::Bitmap::ApplyPaletteWithTransparent(), yaze::zelda3::Overworld::AssembleMap16Tiles(), yaze::zelda3::Overworld::AssembleMap32Tiles(), yaze::zelda3::Inventory::BuildTileset(), yaze::zelda3::Inventory::Create(), yaze::editor::GraphicsEditor::DecompressImportData(), yaze::editor::GraphicsEditor::DecompressSuperDonkey(), yaze::editor::DisplayPalette(), yaze::gui::DisplayPalette(), yaze::editor::PaletteEditor::DrawPaletteGroup(), yaze::editor::PaletteEditor::EditColorInPalette(), yaze::zelda3::Overworld::GetTile16ForTile32(), yaze::cli::Tile16Transfer::handle(), yaze::editor::DungeonEditor::Initialize(), yaze::Load2BppGraphics(), yaze::LoadAllGraphicsData(), yaze::editor::ScreenEditor::LoadDungeonMaps(), yaze::editor::ScreenEditor::LoadDungeonMapTile16(), yaze::zelda3::Overworld::LoadEntrances(), yaze::zelda3::LoadEntranceTileTypes(), yaze::Rom::LoadGfxGroups(), yaze::zelda3::Overworld::LoadHoles(), yaze::zelda3::Overworld::LoadItems(), yaze::LoadLinkGraphics(), yaze::zelda3::OverworldMap::LoadPalette(), yaze::zelda3::Overworld::LoadSpritesFromMap(), yaze::Rom::ReadHelper(), yaze::Rom::ReadTile16(), yaze::editor::PaletteEditor::ResetColorToOriginal(), yaze::Rom::SaveGroupsToRom(), yaze::editor::EditorManager::Update(), yaze::editor::OverworldEditor::Update(), yaze::editor::GraphicsEditor::UpdateLinkGfxView(), yaze::editor::Tile16Editor::UpdateTransferTileCanvas(), yaze::gfx::lc_lz2::ValidateCompressionResult(), and yaze::gfx::lc_lz2::ValidateCompressionResultV3().

◆ ASSIGN_OR_RETURN_IMPL

#define ASSIGN_OR_RETURN_IMPL ( error_or_value,
type_variable_name,
expression )
Value:
auto error_or_value = expression; \
if (!error_or_value.ok()) { \
return error_or_value.status(); \
} \
type_variable_name = std::move(*error_or_value);

Definition at line 74 of file macro.h.

◆ ASSIGN_OR_LOG_ERROR

#define ASSIGN_OR_LOG_ERROR ( type_variable_name,
expression )
Value:
ASSIGN_OR_LOG_ERROR_IMPL(APPEND_NUMBER(error_or_value, __LINE__), \
type_variable_name, expression)
#define ASSIGN_OR_LOG_ERROR_IMPL(error_or_value, type_variable_name, expression)
Definition macro.h:85

Definition at line 81 of file macro.h.

Referenced by yaze::zelda3::RoomObject::AddTiles().

◆ ASSIGN_OR_LOG_ERROR_IMPL

#define ASSIGN_OR_LOG_ERROR_IMPL ( error_or_value,
type_variable_name,
expression )
Value:
auto error_or_value = expression; \
if (!error_or_value.ok()) { \
std::cout << error_or_value.status().ToString() << std::endl; \
} \
type_variable_name = std::move(*error_or_value);

Definition at line 85 of file macro.h.

◆ APPEND_NUMBER

#define APPEND_NUMBER ( expression,
number )
Value:
APPEND_NUMBER_INNER(expression, number)
#define APPEND_NUMBER_INNER(expression, number)
Definition macro.h:96

Definition at line 93 of file macro.h.

◆ APPEND_NUMBER_INNER

#define APPEND_NUMBER_INNER ( expression,
number )
Value:
expression##number

Definition at line 96 of file macro.h.

◆ TEXT_WITH_SEPARATOR

#define TEXT_WITH_SEPARATOR ( text)
Value:
ImGui::Text(text); \
ImGui::Separator();

Definition at line 98 of file macro.h.

Referenced by yaze::editor::DisplayPalette().

◆ TABLE_BORDERS_RESIZABLE

#define TABLE_BORDERS_RESIZABLE    ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable

◆ CLEAR_AND_RETURN_STATUS

#define CLEAR_AND_RETURN_STATUS ( status)
Value:
if (!status.ok()) { \
auto temp = status; \
status = absl::OkStatus(); \
return temp; \
}

Definition at line 105 of file macro.h.

Referenced by yaze::editor::GraphicsEditor::Update(), and yaze::editor::PaletteEditor::Update().

◆ RETURN_IF_EXCEPTION

#define RETURN_IF_EXCEPTION ( expression)
Value:
try { \
expression; \
} catch (const std::exception &e) { \
std::cerr << e.what() << std::endl; \
return EXIT_FAILURE; \
}

Definition at line 112 of file macro.h.

Referenced by main(), and main().

◆ SDL_RETURN_IF_ERROR

#define SDL_RETURN_IF_ERROR ( )
Value:
if (SDL_GetError() != nullptr) { \
return absl::InternalError(SDL_GetError()); \
}

Definition at line 120 of file macro.h.