Added DSP routines.
[cantaveria.git] / splash.c
blob86ed01270cd78248349c8172dc6ac08ed7c61941
1 /*
2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
22 evanrinehart@gmail.com
25 #include <stdlib.h>
27 #include "util.h"
28 #include "backend.h"
29 #include "graphics.h"
30 #include "game.h"
31 #include "splash.h"
32 #include "intro.h"
33 #include "title.h"
35 static struct {
36 int gfx;
37 int counter;
38 int t1, t2, t3;
39 } my;
41 void splash_keydown(int key){
42 title_setup();
44 void splash_keyup(int key){}
45 void splash_joymovex(int joy, int x){}
46 void splash_joymovey(int joy, int y){}
47 void splash_joypress(int joy, int button){
48 title_setup();
50 void splash_joyrelease(int joy, int button){}
52 struct handler splash_handler = {
53 splash_keydown,splash_keyup,splash_joymovex,
54 splash_joymovey,splash_joypress,splash_joyrelease
57 void splash_setup(){
58 set_handler(splash_handler);
59 game.update = splash_update;
60 game.draw = splash_draw;
62 my.counter = 0;
63 my.t1 = 1000/dt;
64 my.t2 = 5000/dt;
65 my.t3 = 6000/dt;
66 my.gfx = load_gfx("splash.tga");
69 void splash_update(){
70 my.counter++;
72 if(my.counter > my.t3){
73 intro_setup();
77 void splash_draw(){
78 if(my.counter > my.t1 && my.counter < my.t2){
79 draw_gfx(my.gfx,(320-256)/2,0,0,0,256,256);