Files
pico-launcher/arm9/source/cheats/GameCheats.h
Gericom b7d7f9f352 Change cheat implementation to show cheats in database order, fix some bugs
- AdvancedPaletteManager incorrectly handled negative y positions
- FocusManager still had a pointer to a view that was destroyed in the cheats panel. After changing focus, memory got corrupted.
2026-03-15 13:28:59 +01:00

33 lines
1.0 KiB
C++

#pragma once
#include "CheatEntry.h"
/// @brief Class holding the cheats for a game.
class GameCheats : public CheatEntry
{
public:
GameCheats(std::unique_ptr<u8[]> cheatData, u32 cheatDataLength, u32 fileOffset, const char* gameName,
CheatEntry* subEntries, u32 numberOfSubEntries)
: CheatEntry(gameName, "", false, subEntries, numberOfSubEntries)
, _cheatData(std::move(cheatData)), _cheatDataLength(cheatDataLength)
, _fileOffset(fileOffset) { }
/// @brief Gets a pointer to the cheat data.
/// @param cheatDataLength The length of the cheat data is returned in this reference.
/// @return A pointer to the cheat data. This pointer is only valid for the lifetime of this \see GameCheats instance.
u8* GetCheatData(u32& cheatDataLength) const
{
cheatDataLength = _cheatDataLength;
return _cheatData.get();
}
u32 GetFileOffset() const
{
return _fileOffset;
}
private:
std::unique_ptr<u8[]> _cheatData;
u32 _cheatDataLength;
u32 _fileOffset;
};