-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
67 lines (54 loc) · 1.79 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// *************************************************************************
// main.c
// This is a component of Acid Rain, Pre ALPHA non-distribution version
//
// -By Insomnia (Steaphan Greene) (Copyright 2002 Steaphan Greene)
// ([email protected])
// No waranty stated or implied, I am not responsible for any damage
// caused directly or indirectly by this software.
// Permision granted for use/distribution/modification by anyone,
// provided this header remains intact, and modified versions are marked
// as so immediately below this header.
// Products utilizing the code or methods within may be distributed
// freely along with this licence, but any sales for profit of such products
// must have the author's permission, and may be subject to a royaltee fee.
// *************************************************************************
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <SDL/SDL.h>
#include "settings.h"
#include "renderer.h"
#include "input.h"
#include "scene.h"
int main(int argc, char **argv) {
int ixs=832, iys=624;
int player_number = 1;
scene *current_scene = NULL;
srand(time(NULL));
if(argc == 2 && (!strcmp(argv[1], "--fullscreen"))) {
fullscreen_mode = 1;
ixs = 1024;
iys = 768;
}
if(!init_renderer(ixs, iys)) {
fprintf(stderr, "Renderer failed to initialize!\n");
exit(1);
}
init_scenes();
while(!user_quit) {
current_scene = get_current_scene();
if(!render_scene(current_scene, player_number)) {
fprintf(stderr, "Render of scene failed!\n");
exit(1);
}
if(!input_process(current_scene, player_number)) {
fprintf(stderr, "Input processing failed!\n");
exit(1);
}
}
exit(0);
return 0;
}