From e188794aa3f5c8572517662d1e8cacf8c884de05 Mon Sep 17 00:00:00 2001 From: Pontus Fransson Date: Mon, 27 Jan 2014 10:14:02 +0100 Subject: [PATCH] GL - Load level in LevelParser --- Code/Game/GameLogic/LevelParser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Code/Game/GameLogic/LevelParser.cpp b/Code/Game/GameLogic/LevelParser.cpp index 1f6a9398..5a709316 100644 --- a/Code/Game/GameLogic/LevelParser.cpp +++ b/Code/Game/GameLogic/LevelParser.cpp @@ -1,5 +1,7 @@ #include "LevelParser.h" +#include "Loader.h" + using namespace GameLogic; using namespace ::LevelFileLoader; @@ -15,6 +17,8 @@ LevelParser::~LevelParser() std::vector LevelParser::Parse(std::string filename) { //Read entire level file. + Loader loader; + unsigned char* buffer = (unsigned char*)loader.LoadFile(filename.c_str()); std::vector objects; @@ -25,6 +29,7 @@ std::vector LevelParser::Parse(std::string filename) //Get typeID int typeID = 0; + //Unpack ID switch(typeID) { @@ -50,6 +55,8 @@ std::vector LevelParser::Parse(std::string filename) ObjectTypeHeader LevelParser::ParseHeader(std::string filename) { //Read entire level file. + Loader loader; + unsigned char* buffer = (unsigned char*)loader.LoadFile(filename.c_str()); //Find the header in the returned string. unsigned int counter = 0; @@ -65,7 +72,8 @@ ObjectTypeHeader LevelParser::ParseHeader(std::string filename) { case TypeID_LevelHeader: //Call function - + + counter += LevelHeaderSize; break; case TypeID_Object: //Call function