#include <palette_debug.h>

Public Member Functions | |
| void | LogPaletteLoad (const std::string &location, int palette_id, const gfx::SnesPalette &palette) |
| void | LogPaletteApplication (const std::string &location, int palette_id, bool success, const std::string &reason="") |
| void | LogTextureCreation (const std::string &location, bool has_palette, int color_count) |
| void | LogSurfaceState (const std::string &location, SDL_Surface *surface) |
| void | SetCurrentPalette (const gfx::SnesPalette &palette) |
| void | SetCurrentRenderPalette (const std::vector< SDL_Color > &palette) |
| void | SetCurrentBitmap (gfx::Bitmap *bitmap) |
| ColorComparison | SamplePixelAt (int x, int y) const |
| std::vector< ColorComparison > | GetColorComparisons () const |
| void | AddComparison (const ColorComparison &comp) |
| void | ClearComparisons () |
| uint32_t | ComputePaletteChecksum (const gfx::SnesPalette &palette) const |
| const std::vector< PaletteDebugEvent > & | GetEvents () const |
| void | Clear () |
Static Public Member Functions | |
| static PaletteDebugger & | Get () |
Static Public Attributes | |
| static constexpr size_t | kMaxEvents = 1000 |
| static constexpr size_t | kMaxComparisons = 500 |
Private Member Functions | |
| PaletteDebugger ()=default | |
| void | AddEvent (const PaletteDebugEvent &event) |
| void | AddComparisonLimited (const ColorComparison &comp) |
Private Attributes | |
| std::vector< PaletteDebugEvent > | events_ |
| std::vector< ColorComparison > | comparisons_ |
| gfx::SnesPalette | current_palette_ |
| std::vector< SDL_Color > | current_render_palette_ |
| gfx::Bitmap * | current_bitmap_ = nullptr |
| int | sequence_counter_ = 0 |
Definition at line 35 of file palette_debug.h.
|
privatedefault |
|
static |
Definition at line 49 of file palette_debug.cc.
Referenced by yaze::editor::DungeonCanvasViewer::BuildDrawIssueReport(), clearPaletteDebugEvents(), getColorComparisons(), yaze::zelda3::Room::GetCompositeBitmap(), getDiagnosticSummary(), getDungeonPaletteEvents(), getEventTimeline(), getFullPaletteState(), getHypothesisAnalysis(), getPaletteData(), yaze::gfx::Arena::ProcessTextureQueue(), yaze::zelda3::Room::RenderRoomGraphics(), and samplePixelAt().
| void yaze::zelda3::PaletteDebugger::LogPaletteLoad | ( | const std::string & | location, |
| int | palette_id, | ||
| const gfx::SnesPalette & | palette ) |
Definition at line 54 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::PaletteDebugEvent::color_count, yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, yaze::zelda3::PaletteDebugEvent::sample_colors, sequence_counter_, and yaze::gfx::SnesPalette::size().
Referenced by yaze::zelda3::Room::RenderRoomGraphics().

| void yaze::zelda3::PaletteDebugger::LogPaletteApplication | ( | const std::string & | location, |
| int | palette_id, | ||
| bool | success, | ||
| const std::string & | reason = "" ) |
Definition at line 87 of file palette_debug.cc.
References AddEvent(), current_palette_, current_render_palette_, yaze::zelda3::ERROR, yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, sequence_counter_, and yaze::gfx::SnesPalette::size().
Referenced by yaze::gfx::Arena::ProcessTextureQueue(), and yaze::zelda3::Room::RenderRoomGraphics().

| void yaze::zelda3::PaletteDebugger::LogTextureCreation | ( | const std::string & | location, |
| bool | has_palette, | ||
| int | color_count ) |
Definition at line 108 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, sequence_counter_, and yaze::zelda3::WARNING.
Referenced by yaze::gfx::Arena::ProcessTextureQueue().

| void yaze::zelda3::PaletteDebugger::LogSurfaceState | ( | const std::string & | location, |
| SDL_Surface * | surface ) |
Definition at line 128 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::ERROR, yaze::platform::GetSurfaceFormat(), yaze::platform::GetSurfacePalette(), yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, sequence_counter_, and yaze::zelda3::WARNING.
Referenced by yaze::gfx::Arena::ProcessTextureQueue(), and yaze::zelda3::Room::RenderRoomGraphics().

| void yaze::zelda3::PaletteDebugger::SetCurrentPalette | ( | const gfx::SnesPalette & | palette | ) |
Definition at line 189 of file palette_debug.cc.
References current_palette_.
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::zelda3::PaletteDebugger::SetCurrentRenderPalette | ( | const std::vector< SDL_Color > & | palette | ) |
Definition at line 193 of file palette_debug.cc.
References current_render_palette_.
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::zelda3::PaletteDebugger::SetCurrentBitmap | ( | gfx::Bitmap * | bitmap | ) |
Definition at line 198 of file palette_debug.cc.
References current_bitmap_.
Referenced by yaze::zelda3::Room::GetCompositeBitmap(), and yaze::zelda3::Room::RenderRoomGraphics().
| ColorComparison yaze::zelda3::PaletteDebugger::SamplePixelAt | ( | int | x, |
| int | y ) const |
Definition at line 202 of file palette_debug.cc.
References yaze::zelda3::ColorComparison::actual_b, yaze::zelda3::ColorComparison::actual_g, yaze::zelda3::ColorComparison::actual_r, current_bitmap_, current_palette_, current_render_palette_, yaze::gfx::Bitmap::data(), yaze::zelda3::ColorComparison::expected_b, yaze::zelda3::ColorComparison::expected_g, yaze::zelda3::ColorComparison::expected_r, yaze::platform::GetSurfacePalette(), yaze::gfx::Bitmap::height(), yaze::zelda3::ColorComparison::matches, yaze::zelda3::ColorComparison::palette_index, yaze::gfx::Bitmap::size(), yaze::gfx::SnesPalette::size(), yaze::gfx::Bitmap::surface(), yaze::gfx::Bitmap::width(), yaze::zelda3::ColorComparison::x, and yaze::zelda3::ColorComparison::y.
Referenced by yaze::editor::anonymous_namespace{dungeon_canvas_issue_report.cc}::ChooseObjectTracePaletteSample().
|
inline |
Definition at line 58 of file palette_debug.h.
References comparisons_.
|
inline |
Definition at line 61 of file palette_debug.h.
References AddComparisonLimited().

|
inline |
Definition at line 64 of file palette_debug.h.
References comparisons_.
| uint32_t yaze::zelda3::PaletteDebugger::ComputePaletteChecksum | ( | const gfx::SnesPalette & | palette | ) | const |
Definition at line 269 of file palette_debug.cc.
References yaze::gfx::SnesPalette::size().

|
inline |
Definition at line 69 of file palette_debug.h.
References events_.
Referenced by yaze::editor::DungeonCanvasViewer::BuildDrawIssueReport().
|
inline |
Definition at line 70 of file palette_debug.h.
References yaze::gfx::SnesPalette::clear(), comparisons_, current_bitmap_, current_palette_, current_render_palette_, and events_.
Referenced by clearPaletteDebugEvents().

|
inlineprivate |
Definition at line 98 of file palette_debug.h.
References events_, and kMaxEvents.
Referenced by LogPaletteApplication(), LogPaletteLoad(), LogSurfaceState(), and LogTextureCreation().
|
inlineprivate |
Definition at line 107 of file palette_debug.h.
References comparisons_, and kMaxComparisons.
Referenced by AddComparison().
|
staticconstexpr |
Definition at line 38 of file palette_debug.h.
Referenced by AddEvent().
|
staticconstexpr |
Definition at line 39 of file palette_debug.h.
Referenced by AddComparisonLimited().
|
private |
Definition at line 115 of file palette_debug.h.
Referenced by AddEvent(), Clear(), and GetEvents().
|
private |
Definition at line 116 of file palette_debug.h.
Referenced by AddComparisonLimited(), Clear(), ClearComparisons(), and GetColorComparisons().
|
private |
Definition at line 117 of file palette_debug.h.
Referenced by Clear(), LogPaletteApplication(), SamplePixelAt(), and SetCurrentPalette().
|
private |
Definition at line 118 of file palette_debug.h.
Referenced by Clear(), LogPaletteApplication(), SamplePixelAt(), and SetCurrentRenderPalette().
|
private |
Definition at line 119 of file palette_debug.h.
Referenced by Clear(), SamplePixelAt(), and SetCurrentBitmap().
|
private |
Definition at line 120 of file palette_debug.h.
Referenced by LogPaletteApplication(), LogPaletteLoad(), LogSurfaceState(), and LogTextureCreation().