fixed chicken messages
[snoogans.git] / d2pointers.h
blob15d0a254209b3b4c714b5b54b2bfafaf6c94ff97
1 /*
2 * Copyright (C) 2010 gonzoj
4 * Please check the CREDITS file for further information.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #pragma once
22 #ifndef D2POINTERS_H_
23 #define D2POINTERS_H_
25 #include "d2structs.h"
26 #include "types.h"
28 #define FUNC(r, a, m, f, p) typedef r a (*m##_##f##_t)p; extern m##_##f##_##t m##_##f;
29 #define VAR(t, m, v) typedef t m##_##v##_t; extern m##_##v##_t *p_##m##_##v;
31 /* function pointers */
33 /* D2Client.dll */
35 FUNC(unit_any *, __attribute__((stdcall)), D2CLIENT, get_player_unit, ())
36 FUNC(void, __attribute__((stdcall)), D2CLIENT, reveal_automap_room, (room1 *room1, DWORD clip_flag, automap_layer *layer))
37 FUNC(automap_layer *, __attribute__((regparm(3))), D2CLIENT, init_automap_layer, (DWORD layer_no))
38 FUNC(void, __attribute__((stdcall)), D2CLIENT, print_game_string, (ms_wchar_t *message, int color))
39 FUNC(DWORD, __attribute__((stdcall)), D2CLIENT, get_automap_size, ())
40 FUNC(ms_wchar_t *, __attribute__((regparm(3))), D2CLIENT, get_unit_name, (unit_any *))
41 FUNC(void, __attribute__((fastcall)), D2CLIENT, add_automap_cell, (automap_cell *cell, automap_cell **node))
42 FUNC(automap_cell *, __attribute__((fastcall)), D2CLIENT, new_automap_cell, ())
43 FUNC(game_info *, __attribute__((stdcall)), D2CLIENT, get_game_info, ())
44 FUNC(unit_any *, __attribute__((stdcall)), D2CLIENT, get_selected_unit, ())
45 FUNC(DWORD, __attribute__((regparm(3))), D2CLIENT, get_ui_var, (DWORD var_no))
46 FUNC(DWORD, __attribute__((fastcall)), D2CLIENT, set_ui_var, (DWORD var_no, DWORD howset, DWORD unknown))
47 FUNC(unit_any *, __attribute__((fastcall)), D2CLIENT, find_server_side_unit, (DWORD id, DWORD type))
48 FUNC(void, __attribute__((fastcall)), D2CLIENT, exit_game, ())
50 /* D2Gfx.dll */
52 FUNC(void, __attribute__((stdcall)), D2GFX, draw_line, (int x1, int y1, int x2, int y2, DWORD color, DWORD unk))
53 FUNC(void, __attribute__((stdcall)), D2GFX, draw_rectangle, (int x1, int y1, int x2, int y2, DWORD color, DWORD trans))
55 /* D2Win.dll */
57 FUNC(DWORD, __attribute__((fastcall)), D2WIN, set_text_size, (DWORD size))
58 FUNC(void, __attribute__((fastcall)), D2WIN, draw_text, (ms_wchar_t *text, int x, int y, int color, DWORD unk))
59 FUNC(DWORD, __attribute__((fastcall)), D2WIN, get_text_width_file_no, (ms_wchar_t *text, int *width, DWORD *file_no))
60 FUNC(void, __attribute__((fastcall)), D2WIN, select_edit_box_text, (vaddr box, ms_wchar_t *text))
61 FUNC(void *, __attribute__((fastcall)), D2WIN, set_control_text, (vaddr box, ms_wchar_t *text))
62 FUNC(void, __attribute__((fastcall)), D2WIN, set_edit_box_proc, (vaddr box, int __attribute__((stdcall)) (*call_back)(vaddr, DWORD, DWORD)))
64 /* D2Lang.dll */
66 FUNC(ms_wchar_t *, __attribute__((fastcall)), D2LANG, get_local_text, (DWORD local_text_no))
68 /* D2Common.dll */
70 FUNC(void, __attribute__((stdcall)), D2COMMON, add_room_data, (act *act, DWORD level_no, int x, int y, room1 *room1))
71 FUNC(void, __attribute__((stdcall)), D2COMMON, remove_room_data, (act *act, DWORD level_no, int x, int y, room1 *room1))
72 FUNC(automap_layer2 *, __attribute__((fastcall)), D2COMMON, get_layer, (DWORD level_no))
73 FUNC(level *, __attribute__((fastcall)), D2COMMON, get_level, (act_misc *misc, DWORD level_no))
74 FUNC(void, __attribute__((stdcall)), D2COMMON, init_level, (level *level))
75 FUNC(object_txt *, __attribute__((stdcall)), D2COMMON, get_object_txt, (DWORD obj_no))
76 FUNC(DWORD, __attribute__((stdcall)), D2COMMON, get_unit_stat, (unit_any *unit, DWORD stat, DWORD stat2))
78 #define _D2FUNCS_START D2CLIENT_get_player_unit
79 #define _D2FUNCS_END D2COMMON_get_unit_stat
81 #undef FUNC
83 /* variable pointers */
85 /* D2Client.dll */
87 VAR(automap_layer *, D2CLIENT, automap_layer)
88 VAR(automap_layer *, D2CLIENT, first_automap_layer)
89 VAR(int, D2CLIENT, divisor)
90 VAR(POINT, D2CLIENT, offset)
91 VAR(DWORD, D2CLIENT, automap_on)
92 VAR(unit_any *, D2CLIENT, player_unit)
93 VAR(DWORD, D2CLIENT, ping)
95 /* D2Win.dll */
97 VAR(DWORD, D2WIN, first_control)
99 #define _D2VARS_START p_D2CLIENT_automap_layer
100 #define _D2VARS_END p_D2WIN_first_control
102 #undef VAR
104 #endif /* D2POINTERS_H_ */