src/proto2/Graphics.cc
changeset 162 f760591b7481
parent 161 ea2f295c279f
child 180 bfe1077edab3
--- a/src/proto2/Graphics.cc	Mon Dec 01 21:49:35 2008 +0000
+++ b/src/proto2/Graphics.cc	Mon Dec 01 21:54:22 2008 +0000
@@ -63,44 +63,19 @@
 void Graphics::do_redraw (void) {
     CL_GraphicContext *gc = win.get_gc();
     
-    // white background
+    // White background
     gc->clear(CL_Color::white);
 
-    const float factorX = GRAPHICS_RESOLUTION_WIDTH / MAP_WIDTH;
-    const float factorY = GRAPHICS_RESOLUTION_HEIGHT / MAP_HEIGHT;
+    // Draw terrain
+    state.drawTerrain(gc);
 
-    // draw terrain
-    state.draw(gc);
-    //terrain.draw(gc);
-    /*
-    // Demonstrates digging, but is very slow
-    Vector tmp(0, 0);
-    CL_Color color;
-    CL_PixelBuffer pix(1, 1, 4, CL_PixelFormat::rgba8888);
-    CL_Surface surf(pix);
-    for (tmp.x = 0; tmp.x < MAP_WIDTH; tmp.x++) {
-        for (tmp.y = 0; tmp.y < MAP_HEIGHT; tmp.y++) {
-            if (state.getType(tmp) == EMPTY) {
-                color = CL_Color(86, 41, 0);
-            } else if (state.getType(tmp) == DIRT) {
-                color = CL_Color(144, 82, 23);
-            } else if (state.getType(tmp) == ROCK) {
-                color = CL_Color(132, 136, 135);
-            } else {
-                // Fale
-            }
-            surf.set_color(color);
-            surf.draw(tmp.x, tmp.y, gc);
-        }
-        }*/
-  
-    // draw players
+    // Draw players
     for (std::list<Player*>::iterator it = state.player_list.begin(); it != state.player_list.end(); it++) {
         Player *p = *it;
         p->draw(gc);
     }        
 
-    // flip window buffer, LIEK NAO
+    // Flip window buffer, LIEK NAO
     win.flip(0);
 }