1 #include "WorldMapBuilder.h"
2 #include "MapImageColor.h"
3 #include "mof/ConsoleIO.h"
6 et::WorldMapBuilder::WorldMapBuilder(et::AreaPowerLevelMap &map , mof::TextureManager* pTextureManager , float scale)
7 : et::MapBuilder( pTextureManager , scale , map.getWidth() , map.getHeight()) , m_map(map)
9 m_pTexture = m_pTextureManager->getResource(_T("image/worldtip.png"));
12 et::WorldMapBuilder::~WorldMapBuilder(void)
16 void et::WorldMapBuilder::addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y){
18 const float SCALE = getScale();
19 et::VertexTypeDungeon vertex;
21 float t = 0.0001f;//
\83e
\83N
\83X
\83`
\83\83\8b«
\8aE
\95â
\90³
22 const float tmpTexel = 32.0f / (float)m_pTexture->getWidth();
23 vertex.color = mof::createColor(255 , 255 , 255);
24 float tableX[]={ 0.0f , SCALE , SCALE , SCALE , 0.0f , 0.0f};
25 float tableZ[]={ 0.0f , 0.0f , -SCALE , -SCALE , -SCALE , 0.0f};
26 float tableTU[]={ 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t , 0.0f+t};
27 float tableTV[]={ 0.0f+t, 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t};
30 float toForestLevelTable[] = {0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 5 };
31 for(int i = 0 ; i < 6 ; i++){
32 vertex.x = tableX[i] + SCALE * x;
33 vertex.z = tableZ[i] - SCALE * y;
34 vertex.tu = tableTU[i] + toForestLevelTable[getMap().get(x , y).forest] * tmpTexel;
35 vertex.tv = tableTV[i];
36 vertices.push_back(vertex);