mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-25 06:06:53 +01:00
25 lines
894 B
C++
25 lines
894 B
C++
#include <common/plugin_defines.h>
|
|
#include "PluginDataPersistence.h"
|
|
#include "PluginData.h"
|
|
|
|
bool PluginDataPersistence::save(plugin_data_t *pluginDataStruct, PluginData &plugin) {
|
|
if(pluginDataStruct == NULL){
|
|
return false;
|
|
}
|
|
pluginDataStruct->buffer = (char *) plugin.buffer;
|
|
pluginDataStruct->bufferLength = plugin.length;
|
|
pluginDataStruct->memoryType = plugin.memoryType;
|
|
pluginDataStruct->heapHandle = (int) plugin.heapHandle;
|
|
return true;
|
|
}
|
|
|
|
PluginData PluginDataPersistence::load(plugin_data_t *pluginDataStruct) {
|
|
PluginData pluginData;
|
|
|
|
pluginData.buffer = pluginDataStruct->buffer;
|
|
pluginData.length = pluginDataStruct->bufferLength;
|
|
pluginData.memoryType = (eMemoryTypes) pluginDataStruct->memoryType;
|
|
pluginData.heapHandle = (MEMHeapHandle) pluginDataStruct->heapHandle;
|
|
pluginData.loadReader();
|
|
return pluginData;
|
|
} |