Debian Codegraph @

src/editor_screen.h

raw
1 /**
2 * Editor screen
3
4 * Copyright (C) 1997, 1998, 1999, 2002, 2003 Seth A. Robinson
5 * Copyright (C) 2005, 2007, 2008, 2009, 2014, 2015 Sylvain Beucler
6
7 * This file is part of GNU FreeDink
8
9 * GNU FreeDink is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 3 of the
12 * License, or (at your option) any later version.
13
14 * GNU FreeDink is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see
21 * <http://www.gnu.org/licenses/>.
22 */
23
24 #ifndef _SCREEN_H
25 #define _SCREEN_H
26
27 #include "rect.h"
28 #include "gfx_tiles.h"
29 #include "io_util.h"
30
31 #define MAX_SPRITES_EDITOR 99
32
33
34 struct editor_sprite
35 {
36 int x, y;
37 int seq, frame, type; /* DinkC: editor_seq, editor_frame, editor_type */
38 int size;
39 BOOL_1BYTE active;
40 int special, brain;
41
42 char script[13+1]; /* attached DinkC script */
43 int speed, base_walk, base_idle, base_attack, timing, que;
44 int hard;
45 rect alt; /* trim left/top/right/bottom */
46 int is_warp;
47 int warp_map;
48 int warp_x;
49 int warp_y;
50 int parm_seq;
51
52 int base_die, hitpoints, strength, defense, exp, sound, vision, nohit, touch_damage;
53
54 int rotation; /* unused */
55 int base_hit; /* default spr[].base_hit, unused but exported to undocumented sp_base_hit() */
56 int gold; /* default spr[].gold; unused but exported to sp_gold() */
57 };
58
59
60 /* Background square in a screen */
61 struct editor_screen_tilerefs
62 {
63 short square_full_idx0; /* bg tile index */
64 short althard; /* hardness tile index, 0 = bg tile's default hardness tile */
65 };
66
67 /* one screen from map.dat */
68 struct editor_screen
69 {
70 struct editor_screen_tilerefs t[12*8+1]; // 97 background tile refs
71 struct editor_sprite sprite[100+1];
72 char script[20+1]; /* script to run when entering the script */
73 char ts_script_id; /* script to run when entering the script (pre-loaded for testsuite) */
74 };
75
76 extern int load_screen_to(const char* path, const int num, struct editor_screen* screen);
77 extern void save_screen(const char* path, const int num);
78 extern void screen_rank_editor_sprites(int rank[]);
79 extern int realhard(int tile);
80
81 #endif