Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/avi_play/src/story_entities/movie_loader.cc @ 6570

Last change on this file since 6570 was 6570, checked in by stefalie, 18 years ago

branches/avi_play: …

File size: 1.5 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, Stefan Lienhard
13   co-programmer:
14*/
15
16#include "movie_loader.h"
17#include "movie_player.h"
18#include "resource_manager.h"
19
20using namespace std;
21
22
23MovieLoader::MovieLoader()
24{
25  this->setClassID(CL_MOVIE_LOADER, "MovieLoader");
26}
27
28MovieLoader::~MovieLoader()
29{
30  PRINTF(4)("Deleted MoviePlayer\n");
31}
32
33
34
35void MovieLoader::loadParams(const TiXmlElement* root)
36{
37
38}
39
40
41ErrorMessage MovieLoader::init()
42{
43
44}
45
46
47ErrorMessage MovieLoader::loadData()
48{
49
50}
51
52
53ErrorMessage MovieLoader::unloadData()
54{
55
56}
57
58
59
60bool MovieLoader::start()
61{
62
63}
64
65
66bool MovieLoader::stop()
67{
68
69}
70
71
72bool MovieLoader::pause()
73{
74
75}
76
77
78bool MovieLoader::resume()
79{
80
81}
82
83
84void MovieLoader::run()
85{
86  // first timestamp for t = 0
87  this->lastFrame = SDL_GetTicks ();
88
89  while( this->isRunning)
90  {
91
92    this->tick();
93
94    movie_player->draw();
95  }
96}
97
98void MovieLoader::draw() const
99{
100
101}
102
103void MovieLoader::tick()
104{
105  // get timestamp
106  Uint32 currentFrame = SDL_GetTicks();
107
108  // calculate time difference in milliseconds (Uint32)
109  this->dt = currentFrame - this->lastFrame;
110  // calculate time difference in seconds (float)
111  this->dts = (float)this->dt / 1000.0f;
112
113  movie_player->tick(dts);
114
115  this->lastFrame = currentFrame;
116}
Note: See TracBrowser for help on using the repository browser.