00001 /***************************************************************************** 00002 * $Id: screendump.h,v 1.4 2003/07/16 11:42:15 schou Exp $ 00003 * Author: Jakob Schou Jensen <schou@sourceforge.net> 00004 * Licence: GPL 00005 * 00006 * Description: Screen dump and video recording facilities 00007 * 00008 ****************************************************************************/ 00009 00015 #ifndef SCREENDUMP_H 00016 #define SCREENDUMP_H 00017 00018 #include <SDL/SDL.h> 00019 #include <adsomath.h> 00020 #include <adsotexture.h> 00021 #include "scene.h" 00022 00023 #define REC_ARRAY_SIZE 32768 00024 00025 struct Record { 00026 v3f eye_pos, eye_dir, eye_dup; 00027 v3f vehicle_pos, vehicle_dir, vehicle_norm; 00028 float vehicle_wheel; 00029 }; 00030 00031 class ScreenDump { 00032 public: 00033 Record *rec; 00034 int rec_pointer; 00035 int gen_pointer; 00036 int gen_frame; 00037 float rec_timer; 00038 float pb_time; 00039 int video_edit_mode; 00040 int video_generate; 00041 int video_preview; 00042 float video_frame_rate; 00043 int videoRewind; 00044 int videoForward; 00045 int videoFastRewind; 00046 int videoFastForward; 00047 00048 int keyFrames[256]; 00049 int keyFrameCount; 00050 00051 AdsoFont *font; 00052 00053 void dumpImage(char *filename); 00054 void videoDumpScreen(); 00055 void takeScreenShot(); 00056 int key_down(SDLKey key); 00057 void key_up(SDLKey key); 00058 void video_step(float delta_time, Scene *scene); 00059 void record(float time_step, Scene *scene); 00060 void draw(); 00061 00062 void enableRecording(){ 00063 rec = new Record[REC_ARRAY_SIZE]; 00064 } 00065 00066 void setFont(AdsoFont *f){ 00067 font = f; 00068 } 00069 00070 ScreenDump(); 00071 }; 00072 00073 #endif 00074
1.3.2