00001 /* 00002 * playfli.cc - Play Autodesk Animator FLIs 00003 * 00004 * Copyright (C) 2000-2001 The Exult Team 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 00022 #ifndef PLAYFLI_H 00023 #define PLAYFLI_H 00024 00025 #include "databuf.h" 00026 #include "imagewin.h" 00027 class Palette; 00028 00029 class playfli { 00030 public: 00031 struct fliinfo { 00032 int frames; 00033 int width; 00034 int height; 00035 int depth; 00036 int speed; 00037 }; 00038 private: 00039 DataSource *fli_data; 00040 int fli_size; 00041 int fli_magic; 00042 int fli_frames; 00043 int fli_width; 00044 int fli_height; 00045 int fli_depth; 00046 int fli_flags; 00047 int fli_speed; 00048 Image_buffer *fli_buf; 00049 int streamstart; 00050 int streampos; 00051 int frame; 00052 Palette *palette; 00053 public: 00054 playfli(const char *fli_name); 00055 playfli(char *buffer, std::size_t len); 00056 ~playfli(); 00057 void info(fliinfo *fi = NULL); 00058 int play(Image_window *win, int first_frame = 0, int last_frame = -1, unsigned long ticks = 0, int brightness = 100); 00059 void put_buffer(Image_window *win); 00060 inline Palette *get_palette () { return palette; } 00061 private: 00062 void initfli(); 00063 int nextpal; 00064 int thispal; 00065 int changepal; 00066 }; 00067 00068 00069 #endif