Toteutin viel? yhen funktion Terrainiin. Jos joku ehtii huomenna ennen mua toteuttamaan loputkin (l?hinn? noi collidet)
authorsaiam
Sun, 30 Nov 2008 00:28:12 +0000
changeset 139 77220921ae7d
parent 138 cc326b64ae20
child 140 b264b39224e5
Toteutin viel? yhen funktion Terrainiin. Jos joku ehtii huomenna ennen mua toteuttamaan loputkin (l?hinn? noi collidet)
niin saa suorittaa.
src/proto2/Terrain.cc
src/proto2/Terrain.hh
--- 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.
      *