2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
29 #ifndef __CINEMATIC_H__
30 #define __CINEMATIC_H__
33 ===============================================================================
37 Multiple idCinematics can run simultaniously.
38 A single idCinematic can be reused for multiple files if desired.
40 ===============================================================================
47 FMV_EOF, // all other conditions, i.e. stop/EOF/abort
54 // a cinematic stream generates an image buffer, which the caller will upload to a texture
56 int imageWidth, imageHeight; // will be a power of 2
57 const byte * image; // RGBA format, alpha will be 255
63 // initialize cinematic play back data
64 static void InitCinematic( void );
66 // shutdown cinematic play back data
67 static void ShutdownCinematic( void );
69 // allocates and returns a private subclass that implements the methods
70 // This should be used instead of new
71 static idCinematic *Alloc();
73 // frees all allocated memory
74 virtual ~idCinematic();
76 // returns false if it failed to load
77 virtual bool InitFromFile( const char *qpath, bool looping );
79 // returns the length of the animation in milliseconds
80 virtual int AnimationLength();
82 // the pointers in cinData_t will remain valid until the next UpdateForTime() call
83 virtual cinData_t ImageForTime( int milliseconds );
85 // closes the file and frees all allocated memory
88 // closes the file and frees all allocated memory
89 virtual void ResetTime(int time);
93 ===============================================
97 ===============================================
100 class idSndWindow : public idCinematic {
103 idSndWindow() { showWaveform = false; }
106 bool InitFromFile( const char *qpath, bool looping );
107 cinData_t ImageForTime( int milliseconds );
108 int AnimationLength();
114 #endif /* !__CINEMATIC_H__ */