Toteutin viel? yhen funktion Terrainiin. Jos joku ehtii huomenna ennen mua toteuttamaan loputkin (l?hinn? noi collidet)
niin saa suorittaa.
--- a/src/proto2/Terrain.cc Sun Nov 30 00:23:44 2008 +0000
+++ b/src/proto2/Terrain.cc Sun Nov 30 00:28:12 2008 +0000
@@ -18,11 +18,11 @@
return !(terrain[coor.x][coor.y] == EMPTY);
}
-bool collides(const Vector &begin, const Vector &end) const {
+bool Terrain::collides(const Vector &begin, const Vector &end) const {
// TODO: Implement. Bresenhams line algorithm could be usefull
}
-void removeGround(const Vector &pos, const float r) {
+void Terrain::removeGround(const Vector &pos, const float r) {
// TODO: Implement. Some circle algoritmh should be usefull here.
}
@@ -61,3 +61,8 @@
}
}
}
+
+void Terrain::draw(CL_GraphicContext *gc) {
+ CL_Surface surf(this->pixbuf);
+ surf.draw(0,0,gc);
+}
--- a/src/proto2/Terrain.hh Sun Nov 30 00:23:44 2008 +0000
+++ b/src/proto2/Terrain.hh Sun Nov 30 00:28:12 2008 +0000
@@ -130,7 +130,7 @@
*
* @param gc CL_GraphicContext
*/
- void draw(CL_GraphicContext &gc) const;
+ void draw(CL_GraphicContext *gc) const;
/**
* Draw part of the terrain for given graphiscontext.
*