/* Irrlicht Library Wrapper Created by: Nathan Adams Denzel Morris Copyright (C) 2007 This software is licensed under the GNU/GPL. This software may not be used for commerical purposes. */ #include //#include "IrrLib.h" //#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment! #include #include #include "Irr2D.h" #include "IrrSprite.h" using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; using namespace std; Irr2D::Irr2D(){ this->numTextures = 0; this->numLines = 0; //NA Should we set textures to new } Irr2D::~Irr2D(){ /*for(int i = 0; i < numTextures; ++i) delete this->textures[i]; delete this->textures;*/ //No more dynamic memory business yay! NA } void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){ this->smgr = smgr; Sprite.SetSmgr(smgr); } void Irr2D::SetDriver(irr::video::IVideoDriver* driver){ this->driver = driver; Sprite.SetDriver(driver); } void Irr2D::LoadTexturemap(std::string file){ this->texturemap = driver->getTexture(file.c_str()); } int Irr2D::LoadTexture(std::string file){ //this->textures[this->numTextures] = driver->getTexture(file.c_str()); textures.push_back(driver->getTexture(file.c_str())); this->numTextures++; return numTextures--; } void Irr2D::DrawLine(irr::core::position2d& start, irr::core::position2d& end, irr::video::SColor& color) { this->driver->draw2DLine(start, end, color); } void Irr2D::AddLines(irr::core::position2d& start, irr::core::position2d& end, irr::video::SColor& color) { this->start.push_back(start); this->end.push_back(end); this->color.push_back(color); this->numLines++; } void Irr2D::DrawLines() { for(int i = 0; i < numLines; ++i) this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]); }