00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013
00014
00015 #include <irrlicht.h>
00016 #include <strings.h>
00017
00018 #include "Irr2D.h"
00019 #include "IrrSprite.h"
00020
00021 using namespace irr;
00022 using namespace core;
00023 using namespace scene;
00024 using namespace video;
00025 using namespace io;
00026 using namespace gui;
00027
00028 using namespace std;
00029
00030 Irr2D::Irr2D(){
00031 this->numTextures = 0;
00032 this->numLines = 0;
00033
00034 }
00035
00036 Irr2D::~Irr2D(){
00037
00038
00039
00040
00041
00042 }
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 void Irr2D::LoadTexturemap(stringc file){
00055 this->texturemap = driver->getTexture(file.c_str());
00056 }
00057
00058 int Irr2D::LoadTexture(stringc file){
00059
00060 textures.push_back(driver->getTexture(file.c_str()));
00061 this->numTextures++;
00062 return numTextures--;
00063 }
00064
00065 void Irr2D::DrawLine(IrrPos& start, IrrPos& end, const irr::video::SColor& color)
00066 {
00067 this->driver->draw2DLine(start, end, color);
00068 }
00069
00070 void Irr2D::AddLines(IrrPos& start, IrrPos& end, const irr::video::SColor& color)
00071 {
00072 this->start.push_back(start);
00073 this->end.push_back(end);
00074 this->color.push_back(color);
00075 this->numLines++;
00076 }
00077
00078 void Irr2D::DrawLines()
00079 {
00080 for(int i = 0; i < numLines; ++i)
00081 this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
00082 }