Last change
on this file since 6325 was
6325,
checked in by hdavid, 18 years ago
|
branches\avi_play: the frames are created faster with glTexSubImage2D, implemented custom speed setting
|
File size:
1.6 KB
|
Rev | Line | |
---|
[6286] | 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 | |
---|
[6290] | 20 | #include "framework.h" |
---|
| 21 | #include "movie_player.h" |
---|
[6286] | 22 | |
---|
[6289] | 23 | MoviePlayer* movie_player; |
---|
[6286] | 24 | |
---|
| 25 | void Framework::moduleInit(int argc, char** argv) |
---|
| 26 | { |
---|
[6289] | 27 | movie_player = new MoviePlayer(argv[1]); |
---|
[6286] | 28 | |
---|
[6289] | 29 | movie_player->printInformation(); |
---|
[6286] | 30 | } |
---|
| 31 | |
---|
| 32 | void Framework::moduleEventHandler(SDL_Event* event) |
---|
| 33 | { |
---|
[6318] | 34 | switch (event->type) |
---|
| 35 | { |
---|
| 36 | case SDL_KEYDOWN: |
---|
| 37 | switch (event->key.keysym.sym) |
---|
| 38 | { |
---|
| 39 | case SDLK_1: |
---|
[6321] | 40 | movie_player->start(0); |
---|
| 41 | break; |
---|
| 42 | case SDLK_2: |
---|
[6318] | 43 | movie_player->resume(); |
---|
| 44 | break; |
---|
[6321] | 45 | case SDLK_3: |
---|
[6318] | 46 | movie_player->pause(); |
---|
| 47 | break; |
---|
[6321] | 48 | case SDLK_4: |
---|
[6318] | 49 | movie_player->stop(); |
---|
| 50 | break; |
---|
[6325] | 51 | case SDLK_9: |
---|
| 52 | movie_player->setSpeed(movie_player->getSpeed() - 0.5); |
---|
| 53 | PRINTF(0)("speed: %f\n", movie_player->getSpeed()); |
---|
| 54 | break; |
---|
| 55 | case SDLK_0: |
---|
| 56 | movie_player->setSpeed(movie_player->getSpeed() + 0.5); |
---|
| 57 | PRINTF(0)("speed: %f\n", movie_player->getSpeed()); |
---|
| 58 | break; |
---|
[6318] | 59 | } |
---|
| 60 | } |
---|
[6286] | 61 | } |
---|
| 62 | |
---|
| 63 | void Framework::moduleTick(float dt) |
---|
[6318] | 64 | { |
---|
[6290] | 65 | movie_player->tick(dt); |
---|
[6286] | 66 | } |
---|
| 67 | |
---|
| 68 | void Framework::moduleDraw(void) const |
---|
| 69 | { |
---|
[6290] | 70 | movie_player->draw(); |
---|
[6286] | 71 | } |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | void Framework::moduleHelp(void) const |
---|
| 75 | { |
---|
| 76 | |
---|
| 77 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.