mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
b3e3c68f15
+ minor fixes
42 lines
900 B
C++
42 lines
900 B
C++
#include "stdafx.h"
|
|
#include "restore_new.h"
|
|
#include "Utilities/Log.h"
|
|
#pragma warning(push)
|
|
#pragma message("TODO: remove wx dependency: <wx/image.h>")
|
|
#pragma warning(disable : 4996)
|
|
#include <wx/image.h>
|
|
#pragma warning(pop)
|
|
#include "define_new_memleakdetect.h"
|
|
|
|
#ifndef _WIN32
|
|
#include <dirent.h>
|
|
#endif
|
|
|
|
#include "rPlatform.h"
|
|
|
|
rImage::rImage()
|
|
{
|
|
handle = static_cast<void*>(new wxImage());
|
|
}
|
|
|
|
rImage::~rImage()
|
|
{
|
|
delete static_cast<wxImage*>(handle);
|
|
}
|
|
|
|
void rImage::Create(int width, int height, void *data, void *alpha)
|
|
{
|
|
static_cast<wxImage*>(handle)->Create(width, height, static_cast<unsigned char*>(data), static_cast<unsigned char*>(alpha));
|
|
}
|
|
void rImage::SaveFile(const std::string& name, rImageType type)
|
|
{
|
|
if (type == rBITMAP_TYPE_PNG)
|
|
{
|
|
static_cast<wxImage*>(handle)->SaveFile(fmt::FromUTF8(name),wxBITMAP_TYPE_PNG);
|
|
}
|
|
else
|
|
{
|
|
throw EXCEPTION("unsupported type");
|
|
}
|
|
}
|