Skip to content

Commit

Permalink
Fixed level preview not working from zip
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Mar 6, 2024
1 parent 684ee5b commit f8ed1e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions engine/source/core/tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "core/tokenizer.h"
#include "platform/platform.h"
#include "core/fileStream.h"
#include "core/resManager.h"

Tokenizer::Tokenizer()
{
Expand Down Expand Up @@ -44,8 +45,10 @@ bool Tokenizer::openFile(const char* pFileName)
{
AssertFatal(mFileName[0] == '\0', "Reuse of Tokenizers not allowed!");

FileStream* pStream = new FileStream;
if (pStream->open(pFileName, FileStream::Read) == false)
Stream* pStream = ResourceManager->openStream(pFileName);
//FileStream* pStream = new FileStream;
//if (pStream->open(pFileName, FileStream::Read) == false)
if (!pStream || pStream->getStatus() != Stream::Ok)
{
delete pStream;
return false;
Expand All @@ -55,7 +58,7 @@ bool Tokenizer::openFile(const char* pFileName)
mBufferSize = pStream->getStreamSize();
mpBuffer = new char[mBufferSize];
pStream->read(mBufferSize, mpBuffer);
pStream->close();
//pStream->close();
delete pStream;

// Not really necessary, but couldn't hurt...
Expand Down

0 comments on commit f8ed1e0

Please sign in to comment.