yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::zelda3::PaletteDebugger Class Reference

#include <palette_debug.h>

Collaboration diagram for yaze::zelda3::PaletteDebugger:

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< ColorComparisonGetColorComparisons () 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 PaletteDebuggerGet ()
 

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< PaletteDebugEventevents_
 
std::vector< ColorComparisoncomparisons_
 
gfx::SnesPalette current_palette_
 
gfx::Bitmapcurrent_bitmap_ = nullptr
 
int sequence_counter_ = 0
 

Detailed Description

Definition at line 39 of file palette_debug.h.

Constructor & Destructor Documentation

◆ PaletteDebugger()

yaze::zelda3::PaletteDebugger::PaletteDebugger ( )
privatedefault

Member Function Documentation

◆ Get()

◆ LogPaletteLoad()

void yaze::zelda3::PaletteDebugger::LogPaletteLoad ( const std::string & location,
int palette_id,
const gfx::SnesPalette & palette )

◆ LogPaletteApplication()

void yaze::zelda3::PaletteDebugger::LogPaletteApplication ( const std::string & location,
int palette_id,
bool success,
const std::string & reason = "" )

◆ LogTextureCreation()

void yaze::zelda3::PaletteDebugger::LogTextureCreation ( const std::string & location,
bool has_palette,
int color_count )

◆ LogSurfaceState()

void yaze::zelda3::PaletteDebugger::LogSurfaceState ( const std::string & location,
SDL_Surface * surface )

◆ SetCurrentPalette()

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().

◆ SetCurrentBitmap()

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().

◆ SamplePixelAt()

◆ GetColorComparisons()

std::vector< ColorComparison > yaze::zelda3::PaletteDebugger::GetColorComparisons ( ) const
inline

Definition at line 61 of file palette_debug.h.

References comparisons_.

◆ AddComparison()

void yaze::zelda3::PaletteDebugger::AddComparison ( const ColorComparison & comp)
inline

Definition at line 62 of file palette_debug.h.

References AddComparisonLimited().

Here is the call graph for this function:

◆ ClearComparisons()

void yaze::zelda3::PaletteDebugger::ClearComparisons ( )
inline

Definition at line 63 of file palette_debug.h.

References comparisons_.

◆ ComputePaletteChecksum()

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().

Here is the call graph for this function:

◆ GetEvents()

const std::vector< PaletteDebugEvent > & yaze::zelda3::PaletteDebugger::GetEvents ( ) const
inline

Definition at line 68 of file palette_debug.h.

References events_.

◆ Clear()

void yaze::zelda3::PaletteDebugger::Clear ( )
inline

Definition at line 69 of file palette_debug.h.

References comparisons_, and events_.

Referenced by clearPaletteDebugEvents().

◆ AddEvent()

void yaze::zelda3::PaletteDebugger::AddEvent ( const PaletteDebugEvent & event)
inlineprivate

Definition at line 91 of file palette_debug.h.

References events_, and kMaxEvents.

Referenced by LogPaletteApplication(), LogPaletteLoad(), LogSurfaceState(), and LogTextureCreation().

◆ AddComparisonLimited()

void yaze::zelda3::PaletteDebugger::AddComparisonLimited ( const ColorComparison & comp)
inlineprivate

Definition at line 100 of file palette_debug.h.

References comparisons_, and kMaxComparisons.

Referenced by AddComparison().

Member Data Documentation

◆ kMaxEvents

constexpr size_t yaze::zelda3::PaletteDebugger::kMaxEvents = 1000
staticconstexpr

Definition at line 42 of file palette_debug.h.

Referenced by AddEvent().

◆ kMaxComparisons

constexpr size_t yaze::zelda3::PaletteDebugger::kMaxComparisons = 500
staticconstexpr

Definition at line 43 of file palette_debug.h.

Referenced by AddComparisonLimited().

◆ events_

std::vector<PaletteDebugEvent> yaze::zelda3::PaletteDebugger::events_
private

Definition at line 107 of file palette_debug.h.

Referenced by AddEvent(), Clear(), and GetEvents().

◆ comparisons_

std::vector<ColorComparison> yaze::zelda3::PaletteDebugger::comparisons_
private

◆ current_palette_

gfx::SnesPalette yaze::zelda3::PaletteDebugger::current_palette_
private

Definition at line 109 of file palette_debug.h.

Referenced by SamplePixelAt(), and SetCurrentPalette().

◆ current_bitmap_

gfx::Bitmap* yaze::zelda3::PaletteDebugger::current_bitmap_ = nullptr
private

Definition at line 110 of file palette_debug.h.

Referenced by SamplePixelAt(), and SetCurrentBitmap().

◆ sequence_counter_

int yaze::zelda3::PaletteDebugger::sequence_counter_ = 0
private

The documentation for this class was generated from the following files: