00001 /* 00002 Copyright Remco Bras and Michael de Lang 2007. 00003 This file is part of RPGE. 00004 00005 RPGE is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 3 of the License, or 00008 (at your option) any later version. 00009 00010 RPGE is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program. If not, see <http://www.gnu.org/licenses/> 00017 */ 00018 00019 /* 00020 imagestack.h: Define imagestack structs and declare imagestack functions so images can be loaded only once. 00021 */ 00022 #ifndef IMGSTACK_H 00023 #define IMGSTACK_H 00024 #include "video.h" 00025 #include <SDL/SDL.h> 00026 #include <string.h> 00027 #include "sequence.h" 00028 #include "xalloc.h" 00029 #include "path.h" 00030 00031 typedef struct 00032 { 00033 SDL_Surface* data; 00034 char* filename; 00035 int count; 00036 char permanence; /*In a similar vein as guile's capability to force the GC to always mark an object, this forces the imagestack to never release an image, unless explicitly asked*/ 00037 } image; 00038 00039 extern sequence images; 00040 00041 void images_init(void); 00042 image make_image (SDL_Surface* data, char* filename); 00043 int push_image_on_stack(char* filename); 00044 int find_image(char* filename); 00045 void release_image(int index); 00046 void remove_image(char* filename); 00047 char* get_image_name(int index); 00048 #endif