diff --git a/src/client/Client.cc b/src/client/Client.cc index 7edcaff..bd341a7 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11,6 +11,19 @@ using namespace std; +static bool load_file(const char *fname, WFObj::Buffer & buff) +{ + unsigned int length; + uint8_t *contents = (uint8_t *) CFS.get_file(fname, &length); + if (contents != NULL) + { + buff.data = contents; + buff.length = length; + return true; + } + return false; +} + Client::Client(bool fullscreen, bool compatibility_context, unsigned int antialias_level) { @@ -52,6 +65,10 @@ Client::Client(bool fullscreen, bool compatibility_context, { cerr << "Error creating obj program" << endl; } + if (!tank_obj.load("models/tank.obj", load_file)) + { + cerr << "Error loading tank model" << endl; + } } void Client::run() diff --git a/src/client/Client.h b/src/client/Client.h index 40d813f..077791f 100755 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -7,6 +7,7 @@ #include "Map.h" #include "Player.h" #include "GLProgram.h" +#include "WFObj.h" class Client { @@ -27,6 +28,7 @@ class Client int m_width; int m_height; GLProgram m_obj_program; + WFObj tank_obj; }; #endif