mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-06 08:27:27 +02:00
Use std::vector<char> consistently for file operations
This made it possible to get rid of two GameSave constructors. Also clean up Client::LoadSaveFile, Client::ReadFile, and Client::WriteFile in the process, and remove unused SaveRenderer::Render
This commit is contained in:
@@ -916,15 +916,15 @@ int main(int argc, char * argv[])
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> gameSaveData = Client::Ref().ReadFile(arguments["open"]);
|
std::vector<char> gameSaveData;
|
||||||
if (!gameSaveData.size())
|
if (!Client::Ref().ReadFile(gameSaveData, arguments["open"]))
|
||||||
{
|
{
|
||||||
new ErrorMessage("Error", "Could not read file");
|
new ErrorMessage("Error", "Could not read file");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaveFile * newFile = new SaveFile(arguments["open"]);
|
SaveFile * newFile = new SaveFile(arguments["open"]);
|
||||||
GameSave * newSave = new GameSave(gameSaveData);
|
GameSave * newSave = new GameSave(std::move(gameSaveData));
|
||||||
newFile->SetGameSave(newSave);
|
newFile->SetGameSave(newSave);
|
||||||
gameController->LoadSaveFile(newFile);
|
gameController->LoadSaveFile(newFile);
|
||||||
delete newFile;
|
delete newFile;
|
||||||
@@ -976,10 +976,10 @@ int main(int argc, char * argv[])
|
|||||||
SaveInfo * newSave = Client::Ref().GetSave(saveId, 0);
|
SaveInfo * newSave = Client::Ref().GetSave(saveId, 0);
|
||||||
if (!newSave)
|
if (!newSave)
|
||||||
throw std::runtime_error("Could not load save info");
|
throw std::runtime_error("Could not load save info");
|
||||||
std::vector<unsigned char> saveData = Client::Ref().GetSaveData(saveId, 0);
|
auto saveData = Client::Ref().GetSaveData(saveId, 0);
|
||||||
if (!saveData.size())
|
if (!saveData.size())
|
||||||
throw std::runtime_error(("Could not load save\n" + Client::Ref().GetLastError()).ToUtf8());
|
throw std::runtime_error(("Could not load save\n" + Client::Ref().GetLastError()).ToUtf8());
|
||||||
GameSave * newGameSave = new GameSave(saveData);
|
GameSave * newGameSave = new GameSave(std::move(saveData));
|
||||||
newSave->SetGameSave(newGameSave);
|
newSave->SetGameSave(newGameSave);
|
||||||
|
|
||||||
gameController->LoadSave(newSave);
|
gameController->LoadSave(newSave);
|
||||||
|
@@ -406,86 +406,6 @@ bool Client::DoInstallation()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::WriteFile(std::vector<unsigned char> fileData, ByteString filename)
|
|
||||||
{
|
|
||||||
bool saveError = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ofstream fileStream;
|
|
||||||
fileStream.open(filename, std::ios::binary);
|
|
||||||
if(fileStream.is_open())
|
|
||||||
{
|
|
||||||
fileStream.write((char*)&fileData[0], fileData.size());
|
|
||||||
fileStream.close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
saveError = true;
|
|
||||||
}
|
|
||||||
catch (std::exception & e)
|
|
||||||
{
|
|
||||||
std::cerr << "WriteFile:" << e.what() << std::endl;
|
|
||||||
saveError = true;
|
|
||||||
}
|
|
||||||
return saveError;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Client::WriteFile(std::vector<char> fileData, ByteString filename)
|
|
||||||
{
|
|
||||||
bool saveError = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ofstream fileStream;
|
|
||||||
fileStream.open(filename, std::ios::binary);
|
|
||||||
if(fileStream.is_open())
|
|
||||||
{
|
|
||||||
fileStream.write(&fileData[0], fileData.size());
|
|
||||||
fileStream.close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
saveError = true;
|
|
||||||
}
|
|
||||||
catch (std::exception & e)
|
|
||||||
{
|
|
||||||
std::cerr << "WriteFile:" << e.what() << std::endl;
|
|
||||||
saveError = true;
|
|
||||||
}
|
|
||||||
return saveError;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned char> Client::ReadFile(ByteString filename)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ifstream fileStream;
|
|
||||||
fileStream.open(filename, std::ios::binary);
|
|
||||||
if(fileStream.is_open())
|
|
||||||
{
|
|
||||||
fileStream.seekg(0, std::ios::end);
|
|
||||||
size_t fileSize = fileStream.tellg();
|
|
||||||
fileStream.seekg(0);
|
|
||||||
|
|
||||||
unsigned char * tempData = new unsigned char[fileSize];
|
|
||||||
fileStream.read((char *)tempData, fileSize);
|
|
||||||
fileStream.close();
|
|
||||||
|
|
||||||
std::vector<unsigned char> fileData;
|
|
||||||
fileData.insert(fileData.end(), tempData, tempData+fileSize);
|
|
||||||
delete[] tempData;
|
|
||||||
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return std::vector<unsigned char>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(std::exception & e)
|
|
||||||
{
|
|
||||||
std::cerr << "Readfile: " << e.what() << std::endl;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Client::SetMessageOfTheDay(String message)
|
void Client::SetMessageOfTheDay(String message)
|
||||||
{
|
{
|
||||||
messageOfTheDay = message;
|
messageOfTheDay = message;
|
||||||
@@ -1042,7 +962,7 @@ RequestStatus Client::ExecVote(int saveID, int direction)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<unsigned char> Client::GetSaveData(int saveID, int saveDate)
|
std::vector<char> Client::GetSaveData(int saveID, int saveDate)
|
||||||
{
|
{
|
||||||
lastError = "";
|
lastError = "";
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
@@ -1059,9 +979,9 @@ std::vector<unsigned char> Client::GetSaveData(int saveID, int saveDate)
|
|||||||
ParseServerReturn(data, dataStatus, false);
|
ParseServerReturn(data, dataStatus, false);
|
||||||
if (data.size() && dataStatus == 200)
|
if (data.size() && dataStatus == 200)
|
||||||
{
|
{
|
||||||
return std::vector<unsigned char>(data.begin(), data.end());
|
return std::vector<char>(data.begin(), data.end());
|
||||||
}
|
}
|
||||||
return std::vector<unsigned char>();
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
||||||
@@ -1329,21 +1249,39 @@ SaveInfo * Client::GetSave(int saveID, int saveDate)
|
|||||||
|
|
||||||
SaveFile * Client::LoadSaveFile(ByteString filename)
|
SaveFile * Client::LoadSaveFile(ByteString filename)
|
||||||
{
|
{
|
||||||
if (!Platform::FileExists(filename))
|
ByteString err;
|
||||||
return nullptr;
|
SaveFile *file = nullptr;
|
||||||
SaveFile * file = new SaveFile(filename);
|
if (Platform::FileExists(filename))
|
||||||
|
{
|
||||||
|
file = new SaveFile(filename);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GameSave * tempSave = new GameSave(ReadFile(filename));
|
std::vector<char> data;
|
||||||
file->SetGameSave(tempSave);
|
if (ReadFile(data, filename))
|
||||||
|
{
|
||||||
|
file->SetGameSave(new GameSave(std::move(data)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
err = "failed to open";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (const ParseException &e)
|
catch (const ParseException &e)
|
||||||
{
|
{
|
||||||
|
err = e.what();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
err = "does not exist";
|
||||||
|
}
|
||||||
|
if (err.size())
|
||||||
|
{
|
||||||
|
std::cerr << "Client: " << filename << ": " << err << std::endl;
|
||||||
|
file->SetLoadingError(err.FromUtf8());
|
||||||
#ifdef LUACONSOLE
|
#ifdef LUACONSOLE
|
||||||
luacon_ci->SetLastError(ByteString(e.what()).FromUtf8());
|
luacon_ci->SetLastError(err.FromUtf8());
|
||||||
#endif
|
#endif
|
||||||
std::cerr << "Client: Invalid save file '" << filename << "': " << e.what() << std::endl;
|
|
||||||
file->SetLoadingError(ByteString(e.what()).FromUtf8());
|
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@@ -1855,3 +1793,30 @@ void Client::SetPrefUnicode(ByteString prop, String value)
|
|||||||
{
|
{
|
||||||
SetPref(prop, value.ToUtf8());
|
SetPref(prop, value.ToUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Client::ReadFile(std::vector<char> &fileData, ByteString filename)
|
||||||
|
{
|
||||||
|
std::ifstream f(filename, std::ios::binary);
|
||||||
|
if (f) f.seekg(0, std::ios::end);
|
||||||
|
if (f) fileData.resize(f.tellg());
|
||||||
|
if (f) f.seekg(0);
|
||||||
|
if (f) f.read(&fileData[0], fileData.size());
|
||||||
|
if (!f)
|
||||||
|
{
|
||||||
|
std::cerr << "ReadFile: " << filename << ": " << strerror(errno) << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Client::WriteFile(std::vector<char> fileData, ByteString filename)
|
||||||
|
{
|
||||||
|
std::ofstream f(filename, std::ios::binary);
|
||||||
|
if (f) f.write(&fileData[0], fileData.size());
|
||||||
|
if (!f)
|
||||||
|
{
|
||||||
|
std::cerr << "WriteFile: " << filename << ": " << strerror(errno) << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@@ -104,8 +104,6 @@ public:
|
|||||||
|
|
||||||
bool DoInstallation();
|
bool DoInstallation();
|
||||||
|
|
||||||
std::vector<unsigned char> ReadFile(ByteString filename);
|
|
||||||
|
|
||||||
void AddServerNotification(std::pair<String, ByteString> notification);
|
void AddServerNotification(std::pair<String, ByteString> notification);
|
||||||
std::vector<std::pair<String, ByteString> > GetServerNotifications();
|
std::vector<std::pair<String, ByteString> > GetServerNotifications();
|
||||||
|
|
||||||
@@ -115,7 +113,7 @@ public:
|
|||||||
void Initialise(ByteString proxyString, bool disableNetwork);
|
void Initialise(ByteString proxyString, bool disableNetwork);
|
||||||
bool IsFirstRun();
|
bool IsFirstRun();
|
||||||
|
|
||||||
bool WriteFile(std::vector<unsigned char> fileData, ByteString filename);
|
bool ReadFile(std::vector<char> &fileData, ByteString filename);
|
||||||
bool WriteFile(std::vector<char> fileData, ByteString filename);
|
bool WriteFile(std::vector<char> fileData, ByteString filename);
|
||||||
|
|
||||||
void AddListener(ClientListener * listener);
|
void AddListener(ClientListener * listener);
|
||||||
@@ -136,7 +134,7 @@ public:
|
|||||||
|
|
||||||
RequestStatus AddComment(int saveID, String comment);
|
RequestStatus AddComment(int saveID, String comment);
|
||||||
|
|
||||||
std::vector<unsigned char> GetSaveData(int saveID, int saveDate);
|
std::vector<char> GetSaveData(int saveID, int saveDate);
|
||||||
|
|
||||||
LoginStatus Login(ByteString username, ByteString password, User & user);
|
LoginStatus Login(ByteString username, ByteString password, User & user);
|
||||||
std::vector<SaveInfo*> * SearchSaves(int start, int count, String query, ByteString sort, ByteString category, int & resultCount);
|
std::vector<SaveInfo*> * SearchSaves(int start, int count, String query, ByteString sort, ByteString category, int & resultCount);
|
||||||
|
@@ -99,55 +99,6 @@ GameSave::GameSave(std::vector<char> data)
|
|||||||
Collapse();
|
Collapse();
|
||||||
}
|
}
|
||||||
|
|
||||||
GameSave::GameSave(std::vector<unsigned char> data)
|
|
||||||
{
|
|
||||||
blockWidth = 0;
|
|
||||||
blockHeight = 0;
|
|
||||||
|
|
||||||
InitData();
|
|
||||||
InitVars();
|
|
||||||
expanded = false;
|
|
||||||
hasOriginalData = true;
|
|
||||||
originalData = std::vector<char>(data.begin(), data.end());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Expand();
|
|
||||||
}
|
|
||||||
catch(ParseException & e)
|
|
||||||
{
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
dealloc(); //Free any allocated memory
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
Collapse();
|
|
||||||
}
|
|
||||||
|
|
||||||
GameSave::GameSave(char * data, int dataSize)
|
|
||||||
{
|
|
||||||
blockWidth = 0;
|
|
||||||
blockHeight = 0;
|
|
||||||
|
|
||||||
InitData();
|
|
||||||
InitVars();
|
|
||||||
expanded = false;
|
|
||||||
hasOriginalData = true;
|
|
||||||
originalData = std::vector<char>(data, data+dataSize);
|
|
||||||
#ifdef DEBUG
|
|
||||||
std::cout << "Creating Expanded save from data" << std::endl;
|
|
||||||
#endif
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Expand();
|
|
||||||
}
|
|
||||||
catch(ParseException & e)
|
|
||||||
{
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
dealloc(); //Free any allocated memory
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
//Collapse();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called on every new GameSave, including the copy constructor
|
// Called on every new GameSave, including the copy constructor
|
||||||
void GameSave::InitData()
|
void GameSave::InitData()
|
||||||
{
|
{
|
||||||
|
@@ -117,9 +117,7 @@ public:
|
|||||||
GameSave();
|
GameSave();
|
||||||
GameSave(const GameSave & save);
|
GameSave(const GameSave & save);
|
||||||
GameSave(int width, int height);
|
GameSave(int width, int height);
|
||||||
GameSave(char * data, int dataSize);
|
|
||||||
GameSave(std::vector<char> data);
|
GameSave(std::vector<char> data);
|
||||||
GameSave(std::vector<unsigned char> data);
|
|
||||||
~GameSave();
|
~GameSave();
|
||||||
void setSize(int width, int height);
|
void setSize(int width, int height);
|
||||||
char * Serialise(unsigned int & dataSize);
|
char * Serialise(unsigned int & dataSize);
|
||||||
|
@@ -47,10 +47,10 @@ class LoadFilesTask: public Task
|
|||||||
SaveFile * saveFile = new SaveFile(directory + *iter);
|
SaveFile * saveFile = new SaveFile(directory + *iter);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> data = Client::Ref().ReadFile(directory + *iter);
|
std::vector<char> data;
|
||||||
if (data.empty())
|
if (!Client::Ref().ReadFile(data, directory + *iter))
|
||||||
continue;
|
continue;
|
||||||
GameSave * tempSave = new GameSave(data);
|
GameSave * tempSave = new GameSave(std::move(data));
|
||||||
saveFile->SetGameSave(tempSave);
|
saveFile->SetGameSave(tempSave);
|
||||||
saveFiles.push_back(saveFile);
|
saveFiles.push_back(saveFile);
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "common/tpt-minmax.h"
|
#include "common/tpt-minmax.h"
|
||||||
|
|
||||||
BitmapBrush::BitmapBrush(std::vector<unsigned char> newBitmap, ui::Point rectSize_):
|
BitmapBrush::BitmapBrush(unsigned char *newBitmap, ui::Point rectSize_):
|
||||||
Brush(ui::Point(0, 0)),
|
Brush(ui::Point(0, 0)),
|
||||||
origSize(0, 0)
|
origSize(0, 0)
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,7 @@ protected:
|
|||||||
ui::Point origSize;
|
ui::Point origSize;
|
||||||
unsigned char * origBitmap;
|
unsigned char * origBitmap;
|
||||||
public:
|
public:
|
||||||
BitmapBrush(std::vector<unsigned char> newBitmap, ui::Point rectSize);
|
BitmapBrush(unsigned char *newBitmap, ui::Point rectSize);
|
||||||
void GenerateBitmap() override;
|
void GenerateBitmap() override;
|
||||||
virtual ~BitmapBrush();
|
virtual ~BitmapBrush();
|
||||||
};
|
};
|
||||||
|
@@ -1210,7 +1210,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
|
|||||||
std::vector<char> saveData = gameSave->Serialise();
|
std::vector<char> saveData = gameSave->Serialise();
|
||||||
if (saveData.size() == 0)
|
if (saveData.size() == 0)
|
||||||
new ErrorMessage("Error", "Unable to serialize game data.");
|
new ErrorMessage("Error", "Unable to serialize game data.");
|
||||||
else if (Client::Ref().WriteFile(saveData, gameModel->GetSaveFile()->GetName()))
|
else if (!Client::Ref().WriteFile(saveData, gameModel->GetSaveFile()->GetName()))
|
||||||
new ErrorMessage("Error", "Unable to write save file.");
|
new ErrorMessage("Error", "Unable to write save file.");
|
||||||
else
|
else
|
||||||
gameModel->SetInfoTip("Saved Successfully");
|
gameModel->SetInfoTip("Saved Successfully");
|
||||||
|
@@ -481,8 +481,8 @@ void GameModel::BuildBrushList()
|
|||||||
std::vector<ByteString> brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" });
|
std::vector<ByteString> brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" });
|
||||||
for (size_t i = 0; i < brushFiles.size(); i++)
|
for (size_t i = 0; i < brushFiles.size(); i++)
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> brushData = Client::Ref().ReadFile(BRUSH_DIR + ByteString(PATH_SEP) + brushFiles[i]);
|
std::vector<char> brushData;
|
||||||
if(!brushData.size())
|
if (!Client::Ref().ReadFile(brushData, BRUSH_DIR + ByteString(PATH_SEP) + brushFiles[i]))
|
||||||
{
|
{
|
||||||
std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl;
|
std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl;
|
||||||
continue;
|
continue;
|
||||||
@@ -493,7 +493,7 @@ void GameModel::BuildBrushList()
|
|||||||
std::cout << "Brushes: Skipping " << brushFiles[i] << ". Invalid bitmap size" << std::endl;
|
std::cout << "Brushes: Skipping " << brushFiles[i] << ". Invalid bitmap size" << std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
brushList.push_back(new BitmapBrush(brushData, ui::Point(dimension, dimension)));
|
brushList.push_back(new BitmapBrush(reinterpret_cast<unsigned char *>(&brushData[0]), ui::Point(dimension, dimension)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasStoredRadius && (size_t)currentBrush < brushList.size())
|
if (hasStoredRadius && (size_t)currentBrush < brushList.size())
|
||||||
|
@@ -301,7 +301,7 @@ void PreviewModel::Update()
|
|||||||
if (status == 200 && ret.size())
|
if (status == 200 && ret.size())
|
||||||
{
|
{
|
||||||
delete saveData;
|
delete saveData;
|
||||||
saveData = new std::vector<unsigned char>(ret.begin(), ret.end());
|
saveData = new std::vector<char>(ret.begin(), ret.end());
|
||||||
if (saveInfo && saveData)
|
if (saveInfo && saveData)
|
||||||
OnSaveReady();
|
OnSaveReady();
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ class PreviewModel
|
|||||||
bool canOpen;
|
bool canOpen;
|
||||||
std::vector<PreviewView*> observers;
|
std::vector<PreviewView*> observers;
|
||||||
SaveInfo * saveInfo;
|
SaveInfo * saveInfo;
|
||||||
std::vector<unsigned char> * saveData;
|
std::vector<char> * saveData;
|
||||||
std::vector<SaveComment*> * saveComments;
|
std::vector<SaveComment*> * saveComments;
|
||||||
void notifySaveChanged();
|
void notifySaveChanged();
|
||||||
void notifySaveCommentsChanged();
|
void notifySaveCommentsChanged();
|
||||||
|
@@ -115,7 +115,7 @@ void LocalSaveActivity::saveWrite(ByteString finalFilename)
|
|||||||
std::vector<char> saveData = gameSave->Serialise();
|
std::vector<char> saveData = gameSave->Serialise();
|
||||||
if (saveData.size() == 0)
|
if (saveData.size() == 0)
|
||||||
new ErrorMessage("Error", "Unable to serialize game data.");
|
new ErrorMessage("Error", "Unable to serialize game data.");
|
||||||
else if (Client::Ref().WriteFile(saveData, finalFilename))
|
else if (!Client::Ref().WriteFile(saveData, finalFilename))
|
||||||
new ErrorMessage("Error", "Unable to write save file.");
|
new ErrorMessage("Error", "Unable to write save file.");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -165,27 +165,6 @@ VideoBuffer * SaveRenderer::Render(GameSave * save, bool decorations, bool fire,
|
|||||||
return tempThumb;
|
return tempThumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoBuffer * SaveRenderer::Render(unsigned char * saveData, int dataSize, bool decorations, bool fire)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> g(renderMutex);
|
|
||||||
|
|
||||||
GameSave * tempSave;
|
|
||||||
try {
|
|
||||||
tempSave = new GameSave((char*)saveData, dataSize);
|
|
||||||
} catch (std::exception & e) {
|
|
||||||
|
|
||||||
//Todo: make this look a little less shit
|
|
||||||
VideoBuffer * buffer = new VideoBuffer(64, 64);
|
|
||||||
buffer->BlendCharacter(32, 32, 'x', 255, 255, 255, 255);
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
VideoBuffer * thumb = Render(tempSave, decorations, fire);
|
|
||||||
delete tempSave;
|
|
||||||
|
|
||||||
return thumb;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveRenderer::~SaveRenderer()
|
SaveRenderer::~SaveRenderer()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user