mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 22:59:58 -06:00
Allow AREngine
to be used independently of ARCodeFile
(#2108)
* Make `EmuInstance::cheatFile` use a `unique_ptr` - Fixes a memory leak, as the cheat file wasn't cleaned up in the destructor * Split `AREngine` and `ARCodeFile` apart - Suitable for frontends that have their own way of storing cheats - Store the cheats in `AREngine` in a `std::vector` - Apparently cheats are _supposed_ to be executed each frame; I didn't understand this until recently
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#ifndef ARENGINE_H
|
||||
#define ARENGINE_H
|
||||
|
||||
#include <vector>
|
||||
#include "ARCodeFile.h"
|
||||
|
||||
namespace melonDS
|
||||
@ -29,14 +30,13 @@ class AREngine
|
||||
public:
|
||||
AREngine(melonDS::NDS& nds);
|
||||
|
||||
ARCodeFile* GetCodeFile() { return CodeFile; }
|
||||
void SetCodeFile(ARCodeFile* file) { CodeFile = file; }
|
||||
|
||||
std::vector<ARCode> Cheats {};
|
||||
private:
|
||||
friend class ARM;
|
||||
void RunCheats();
|
||||
void RunCheat(const ARCode& arcode);
|
||||
private:
|
||||
|
||||
melonDS::NDS& NDS;
|
||||
ARCodeFile* CodeFile; // AR code file - frontend is responsible for managing this
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user