Recognizes if input is ogg or not.
[xiph/unicode.git] / planarity / gameboard_logic_push.c
blob95e74c5965eb6578add4cb10da5b91c93fbd7f9a
1 /*
3 * gPlanarity:
4 * The geeky little puzzle game with a big noodly crunch!
5 *
6 * gPlanarity copyright (C) 2005 Monty <monty@xiph.org>
7 * Original Flash game by John Tantalo <john.tantalo@case.edu>
8 * Original game concept by Mary Radcliffe
10 * gPlanarity is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
15 * gPlanarity is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Postfish; see the file COPYING. If not, write to the
22 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 #define _GNU_SOURCE
28 #include <gtk/gtk.h>
29 #include <gtk/gtkmain.h>
30 #include <gdk/gdk.h>
31 #include <gdk/gdkx.h>
32 #include <stdlib.h>
33 #include <math.h>
34 #include <string.h>
36 #include "graph.h"
37 #include "gameboard.h"
39 void update_push(Gameboard *g, cairo_t *c){
41 if(g->pushed_curtain){
42 int w = g->g.width;
43 int h = g->g.height;
45 draw_foreground(g,c,0,0,w,h);
47 // copy in the score and button surfaces
48 cairo_set_source_surface(c,g->forescore,0,0);
49 cairo_rectangle(c, 0,0,w,
50 min(SCOREHEIGHT,h));
51 cairo_fill(c);
53 cairo_set_source_surface(c,g->forebutton,0,h-SCOREHEIGHT);
54 cairo_rectangle(c, 0,0,w,h);
55 cairo_fill(c);
57 if(g->show_intersections)
58 draw_intersections(g,&g->g,c,0,0,w,h);
60 cairo_set_source (c, g->curtainp);
61 cairo_paint(c);
63 if(g->redraw_callback)g->redraw_callback(g);
67 void push_curtain(Gameboard *g,void(*redraw_callback)(Gameboard *g)){
68 if(!g->pushed_curtain){
69 cairo_t *c = cairo_create(g->background);
70 g->pushed_curtain=1;
71 g->redraw_callback=redraw_callback;
73 update_push(g,c);
75 cairo_destroy(c);
76 expose_full(g);
78 //gameboard_draw(g,0,0,w,h);
82 void pop_curtain(Gameboard *g){
83 if(g->pushed_curtain){
84 g->pushed_curtain=0;
85 update_full(g);