Subversion Repositories sssnakesss

Compare Revisions

Ignore whitespace Rev 4 → Rev 6

/include/sssnakesss.hpp
20,11 → 20,15
void draw();
void end();
vector<string> listDir(string dir);
private:
bool running;
SDL_Surface *screen;
map<string, Texture *> textures;
};
 
#endif // SSSNAKESSS_HPP
/include/texture.hpp
19,4 → 19,6
int halfHeight;
};
 
void drawTexture(Texture *texture, int x, int y);
 
#endif // TEXTURE_HPP
/src/sssnakesss.cpp
3,6 → 3,8
#include "SDL/SDL_opengl.h"
 
#include <iostream>
#include <vector>
#include <map>
 
using namespace std;
 
77,6 → 79,17
 
void SSSNAKESSS::initData()
{
string dataDir = "data/";
string graphicsDir = dataDir + "graphics/";
vector<string> graphicsList = listDir(graphicsDir);
for (unsigned int i = 0; i < graphicsList.size(); i++)
{
string file = graphicsList[i];
string fullfilename = graphicsDir + file;
textures[file] = new Texture(fullfilename);
}
}
 
void SSSNAKESSS::run()
117,3 → 130,10
void SSSNAKESSS::end()
{
}
 
vector<string> SSSNAKESSS::listDir(string dir)
{
vector<string> list;
return list;
}
/src/texture.cpp
102,3 → 102,11
glEnd();
}
}
 
void drawTexture(Texture *texture, int x, int y)
{
if (texture)
{
texture->draw(x, y);
}
}