updated Engine to use fopen instead of open so that binary files are loaded properly on Windows
git-svn-id: svn://anubis/anaglym/trunk@106 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
fc55b0c3e7
commit
28242e159b
@ -471,12 +471,12 @@ FileLoader::Buffer Engine::EngineFileLoader::load(const Path & path)
|
|||||||
int size = getSize(path);
|
int size = getSize(path);
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
int fd = open(file_path.c_str(), O_RDONLY);
|
FILE * fp = fopen(file_path.c_str(), "rb");
|
||||||
if (fd > 0)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
Buffer buf(size);
|
Buffer buf(size);
|
||||||
int num_read = read(fd, buf.data, size);
|
int num_read = fread(buf.data, size, 1, fp);
|
||||||
close(fd);
|
fclose(fp);
|
||||||
if (num_read > 0)
|
if (num_read > 0)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user