2014-01-24 10:22:18 +01:00
|
|
|
//////////////////////////////////
|
|
|
|
// Created by Sam Svensson 2013 //
|
|
|
|
//////////////////////////////////
|
|
|
|
|
|
|
|
#include "Loader.h"
|
2014-01-28 16:15:10 +01:00
|
|
|
#include <fstream>
|
2014-01-24 10:22:18 +01:00
|
|
|
|
2014-01-24 10:42:19 +01:00
|
|
|
using namespace GameLogic::LevelFileLoader;
|
2014-01-24 10:22:18 +01:00
|
|
|
using namespace Oyster::Resource;
|
|
|
|
using namespace std;
|
|
|
|
|
2014-01-28 16:15:10 +01:00
|
|
|
char* Loader::LoadFile(std::string fileName, int &size)
|
2014-01-24 10:22:18 +01:00
|
|
|
{
|
|
|
|
//convert from string to wstring
|
|
|
|
std::wstring temp(fileName.begin(), fileName.end());
|
|
|
|
|
|
|
|
//convert from wstring to wchar then loads the file
|
2014-01-28 16:15:10 +01:00
|
|
|
char* buffer = (char*)OysterResource::LoadResource(temp.c_str(), Oyster::Resource::ResourceType::ResourceType_Byte_Raw, -1 , false);
|
2014-01-28 11:29:35 +01:00
|
|
|
|
2014-01-27 14:57:18 +01:00
|
|
|
size = OysterResource::GetResourceSize(buffer);
|
|
|
|
return buffer;
|
2014-01-24 10:22:18 +01:00
|
|
|
}
|