Subversion Repositories sssnakesss

Compare Revisions

Ignore whitespace Rev 6 → Rev 4

/include/sssnakesss.hpp
20,15 → 20,11
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,6 → 19,4
int halfHeight;
};
 
void drawTexture(Texture *texture, int x, int y);
 
#endif // TEXTURE_HPP
/src/sssnakesss.cpp
3,8 → 3,6
#include "SDL/SDL_opengl.h"
 
#include <iostream>
#include <vector>
#include <map>
 
using namespace std;
 
79,17 → 77,6
 
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()
130,10 → 117,3
void SSSNAKESSS::end()
{
}
 
vector<string> SSSNAKESSS::listDir(string dir)
{
vector<string> list;
return list;
}
/src/texture.cpp
102,11 → 102,3
glEnd();
}
}
 
void drawTexture(Texture *texture, int x, int y)
{
if (texture)
{
texture->draw(x, y);
}
}