src/Terrain.cc
branchnew_graphics
changeset 412 721c60072091
parent 409 1a03ff151abc
child 417 c503e0c6a740
--- a/src/Terrain.cc	Wed Jan 21 03:33:35 2009 +0200
+++ b/src/Terrain.cc	Wed Jan 21 23:07:22 2009 +0200
@@ -1,5 +1,5 @@
+
 #include "Terrain.hh"
-#include "Graphics.hh"
 #include "Engine.hh"
 
 #include <cmath>
@@ -20,7 +20,7 @@
 
 Terrain::Terrain (const TerrainConfig &config) :
     terrain_buf(NULL),
-    width(config.dimensions.x), height(config.dimensions.y)
+    width(config.dimensions.width), height(config.dimensions.height)
 {
     // allocate terrain_buf
     terrain_buf = new TerrainPixel[width * height];
@@ -410,13 +410,13 @@
     return normal;
 }
 
-void Terrain::draw (Graphics *g, PixelCoordinate camera) {
+void Terrain::draw (graphics::Display &display, PixelCoordinate camera) {
     // XXX: can we optimize this somehow?
     
     // load the terrain pixbuf as a surface
     CL_Surface surf (pixbuf);
     
     // draw it onto the graphics, offset by camera position
-    surf.draw(-camera.x, -camera.y, g->get_gc());
+    surf.draw(-camera.x, -camera.y, display.get_gc());
 }