Debian Codegraph @

src/gfx_tiles.h

raw
1 /**
2 * Draw background from tiles
3
4 * Copyright (C) 2007, 2008 Sylvain Beucler
5
6 * This file is part of GNU FreeDink
7
8 * GNU FreeDink is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 3 of the
11 * License, or (at your option) any later version.
12
13 * GNU FreeDink is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 */
22
23 #ifndef _GFX_TILES_H
24 #define _GFX_TILES_H
25
26 /* #include <ddraw.h> */
27 #include "SDL.h"
28 #include "IOGfxSurface.h"
29
30 #define GFX_TILES_NB_SETS 41
31
32 /* 96 = 12 * 8 tile squares; 1 tile square = 50x50 pixels */
33 #define GFX_TILES_SCREEN_W 12
34 #define GFX_TILES_SCREEN_H 8
35 #define GFX_TILES_PER_SCREEN (GFX_TILES_SCREEN_W * GFX_TILES_SCREEN_H)
36 #define GFX_TILES_SQUARE_SIZE 50
37 /* 96 tiles per tileset but indexed in slots of 128 in the code (aka memory holes)
38 so 128*(41-1)+12*8=5216 indexes used, instead of 12*8*41=3936 */
39 #define GFX_TILES_NB_SQUARES (128*(GFX_TILES_NB_SETS-1)+GFX_TILES_SCREEN_W*GFX_TILES_SCREEN_H)
40
41 extern void process_animated_tiles(IOGfxSurface** gfx_tiles, struct editor_screen_tilerefs* tilerefs, Uint32 thisTickCount);
42 extern void gfx_tiles_draw_screen(IOGfxSurface** gfx_tiles, struct editor_screen_tilerefs* tilerefs);
43 extern void gfx_tiles_draw(int srctileset_idx0, int srctile_square_idx0, int dsttile_square_idx0);
44 extern int gfx_tiles_memusage(IOGfxSurface** gfx_tiles);
45
46 #endif