Last change
on this file since 9389 was
6532,
checked in by bensch, 19 years ago
|
orxonox/trunk: merged branches/movie_play to the trunk. no conflicts, but a minor virtual function
|
File size:
1.8 KB
|
Line | |
---|
1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: David Hasenfratz |
---|
13 | co-programmer: ... |
---|
14 | |
---|
15 | this file extends the framework file, so it renders what i want. |
---|
16 | */ |
---|
17 | |
---|
18 | #include <stdlib.h> |
---|
19 | |
---|
20 | #include "framework.h" |
---|
21 | #include "movie_player.h" |
---|
22 | |
---|
23 | MoviePlayer* movie_player; |
---|
24 | |
---|
25 | void Framework::moduleInit(int argc, char** argv) |
---|
26 | { |
---|
27 | if( argc <= 1) |
---|
28 | { |
---|
29 | printf("Wrong arguments try following notations:\n"); |
---|
30 | printf("./movie_player_test [media_file]\n"); |
---|
31 | exit(0); |
---|
32 | } |
---|
33 | |
---|
34 | movie_player = new MoviePlayer(argv[1]); |
---|
35 | |
---|
36 | |
---|
37 | movie_player->printInformation(); |
---|
38 | } |
---|
39 | |
---|
40 | void Framework::moduleEventHandler(SDL_Event* event) |
---|
41 | { |
---|
42 | switch (event->type) |
---|
43 | { |
---|
44 | case SDL_KEYDOWN: |
---|
45 | switch (event->key.keysym.sym) |
---|
46 | { |
---|
47 | case SDLK_1: |
---|
48 | movie_player->start(0); |
---|
49 | break; |
---|
50 | case SDLK_2: |
---|
51 | movie_player->resume(); |
---|
52 | break; |
---|
53 | case SDLK_3: |
---|
54 | movie_player->pause(); |
---|
55 | break; |
---|
56 | case SDLK_4: |
---|
57 | movie_player->stop(); |
---|
58 | break; |
---|
59 | case SDLK_9: |
---|
60 | movie_player->setFPS(movie_player->getFPS() - 1); |
---|
61 | PRINTF(0)("fps: %0.2f\n", movie_player->getFPS()); |
---|
62 | break; |
---|
63 | case SDLK_0: |
---|
64 | movie_player->setFPS(movie_player->getFPS() + 1); |
---|
65 | PRINTF(0)("fps: %0.2f\n", movie_player->getFPS()); |
---|
66 | break; |
---|
67 | } |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | void Framework::moduleTick(float dt) |
---|
72 | { |
---|
73 | movie_player->tick(dt); |
---|
74 | } |
---|
75 | |
---|
76 | void Framework::moduleDraw(void) const |
---|
77 | { |
---|
78 | movie_player->draw(); |
---|
79 | } |
---|
80 | |
---|
81 | |
---|
82 | void Framework::moduleHelp(void) const |
---|
83 | { |
---|
84 | |
---|
85 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.