#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 | 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_ |
| gfx::Bitmap * | current_bitmap_ = nullptr |
| int | sequence_counter_ = 0 |
Definition at line 39 of file palette_debug.h.
|
privatedefault |
|
static |
Definition at line 24 of file palette_debug.cc.
Referenced by clearPaletteDebugEvents(), getColorComparisons(), 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 29 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::PaletteDebugEvent::color_count, yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, LOG_INFO, yaze::zelda3::PaletteDebugEvent::message, 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 62 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::ERROR, yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, LOG_ERROR, LOG_INFO, yaze::zelda3::PaletteDebugEvent::message, and sequence_counter_.
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 84 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, LOG_WARN, yaze::zelda3::PaletteDebugEvent::message, 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 106 of file palette_debug.cc.
References AddEvent(), yaze::zelda3::ERROR, yaze::platform::GetSurfaceFormat(), yaze::platform::GetSurfacePalette(), yaze::zelda3::INFO, yaze::zelda3::PaletteDebugEvent::location, LOG_ERROR, LOG_INFO, yaze::zelda3::PaletteDebugEvent::message, 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 167 of file palette_debug.cc.
References current_palette_.
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::zelda3::PaletteDebugger::SetCurrentBitmap | ( | gfx::Bitmap * | bitmap | ) |
Definition at line 171 of file palette_debug.cc.
References current_bitmap_.
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| ColorComparison yaze::zelda3::PaletteDebugger::SamplePixelAt | ( | int | x, |
| int | y ) const |
Definition at line 175 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_, 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.
|
inline |
Definition at line 61 of file palette_debug.h.
References comparisons_.
|
inline |
Definition at line 62 of file palette_debug.h.
References AddComparisonLimited().

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

|
inline |
Definition at line 68 of file palette_debug.h.
References events_.
|
inline |
Definition at line 69 of file palette_debug.h.
References comparisons_, and events_.
Referenced by clearPaletteDebugEvents().
|
inlineprivate |
Definition at line 91 of file palette_debug.h.
References events_, and kMaxEvents.
Referenced by LogPaletteApplication(), LogPaletteLoad(), LogSurfaceState(), and LogTextureCreation().
|
inlineprivate |
Definition at line 100 of file palette_debug.h.
References comparisons_, and kMaxComparisons.
Referenced by AddComparison().
|
staticconstexpr |
Definition at line 42 of file palette_debug.h.
Referenced by AddEvent().
|
staticconstexpr |
Definition at line 43 of file palette_debug.h.
Referenced by AddComparisonLimited().
|
private |
Definition at line 107 of file palette_debug.h.
Referenced by AddEvent(), Clear(), and GetEvents().
|
private |
Definition at line 108 of file palette_debug.h.
Referenced by AddComparisonLimited(), Clear(), ClearComparisons(), and GetColorComparisons().
|
private |
Definition at line 109 of file palette_debug.h.
Referenced by SamplePixelAt(), and SetCurrentPalette().
|
private |
Definition at line 110 of file palette_debug.h.
Referenced by SamplePixelAt(), and SetCurrentBitmap().
|
private |
Definition at line 111 of file palette_debug.h.
Referenced by LogPaletteApplication(), LogPaletteLoad(), LogSurfaceState(), and LogTextureCreation().