tavli

diff src/game.cc @ 14:283eb6e9f0a3

scenery
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 28 Jun 2015 07:44:23 +0300
parents a8e26f163f99
children b1a195c3ee16
line diff
     1.1 --- a/src/game.cc	Sat Jun 27 22:33:27 2015 +0300
     1.2 +++ b/src/game.cc	Sun Jun 28 07:44:23 2015 +0300
     1.3 @@ -2,10 +2,12 @@
     1.4  #include <GL/glew.h>
     1.5  #include "game.h"
     1.6  #include "board.h"
     1.7 +#include "scenery.h"
     1.8  
     1.9  static void draw_backdrop();
    1.10  
    1.11  int win_width, win_height;
    1.12 +bool wireframe;
    1.13  
    1.14  static Board board;
    1.15  
    1.16 @@ -30,12 +32,17 @@
    1.17  		return false;
    1.18  	}
    1.19  
    1.20 +	if(!init_scenery()) {
    1.21 +		return false;
    1.22 +	}
    1.23 +
    1.24  	return true;
    1.25  }
    1.26  
    1.27  void game_cleanup()
    1.28  {
    1.29  	board.destroy();
    1.30 +	destroy_scenery();
    1.31  }
    1.32  
    1.33  void game_update(unsigned long time_msec)
    1.34 @@ -56,6 +63,7 @@
    1.35  	glLightfv(GL_LIGHT0, GL_POSITION, ldir);
    1.36  
    1.37  	draw_backdrop();
    1.38 +	draw_scenery();
    1.39  	board.draw();
    1.40  }
    1.41  
    1.42 @@ -104,6 +112,11 @@
    1.43  		switch(bn) {
    1.44  		case 27:
    1.45  			quit();
    1.46 +
    1.47 +		case 'w':
    1.48 +			wireframe = !wireframe;
    1.49 +			redisplay();
    1.50 +			break;
    1.51  		}
    1.52  	}
    1.53  }