author | unc0rr |
Sun, 11 Nov 2018 00:14:13 +0100 | |
changeset 14218 | 3e551b0535fb |
parent 11400 | fac466eb0c4d |
child 15376 | 5c0479d0ed5b |
permissions | -rw-r--r-- |
10015 | 1 |
#ifndef _FPCRTL_H_ |
2 |
#define _FPCRTL_H_ |
|
3 |
||
4 |
#include <stdio.h> |
|
5 |
#include <stdlib.h> |
|
6 |
#include <string.h> |
|
7 |
#include <unistd.h> |
|
8 |
#include <math.h> |
|
9 |
||
10 |
#include "SysUtils.h" |
|
11 |
#include "system.h" |
|
12 |
#include "misc.h" |
|
13 |
#include "fileio.h" |
|
14 |
#include "pmath.h" |
|
15 |
||
16 |
#ifndef EMSCRIPTEN |
|
17 |
#include "GL/glew.h" |
|
18 |
#endif |
|
19 |
||
20 |
#define fpcrtl_memcpy memcpy |
|
21 |
||
22 |
#define luapas_lua_gettop lua_gettop |
|
23 |
#define luapas_lua_close lua_close |
|
24 |
#define luapas_lua_createtable lua_createtable |
|
25 |
#define luapas_lua_error lua_error |
|
26 |
#define luapas_lua_gc lua_gc |
|
27 |
#define luapas_lua_getfield lua_getfield |
|
28 |
#define luapas_lua_objlen lua_objlen |
|
29 |
#define luapas_lua_call lua_call |
|
30 |
#define luapas_lua_pcall lua_pcall |
|
31 |
#define luapas_lua_pushboolean lua_pushboolean |
|
32 |
#define luapas_lua_pushcclosure lua_pushcclosure |
|
33 |
#define luapas_lua_pushinteger lua_pushinteger |
|
34 |
#define luapas_lua_pushnil lua_pushnil |
|
35 |
#define luapas_lua_pushnumber lua_pushnumber |
|
36 |
#define luapas_lua_pushlstring lua_pushlstring |
|
37 |
#define luapas_lua_pushstring lua_pushstring |
|
38 |
#define luapas_lua_pushvalue lua_pushvalue |
|
39 |
#define luapas_lua_rawgeti lua_rawgeti |
|
40 |
#define luapas_lua_setfield lua_setfield |
|
41 |
#define luapas_lua_settop lua_settop |
|
42 |
#define luapas_lua_toboolean lua_toboolean |
|
43 |
#define luapas_lua_tointeger lua_tointeger |
|
44 |
#define luapas_lua_tolstring lua_tolstring |
|
45 |
#define luapas_lua_tonumber lua_tonumber |
|
46 |
#define luapas_lua_type lua_type |
|
47 |
#define luapas_lua_typename lua_typename |
|
48 |
#define luapas_luaL_argerror luaL_argerror |
|
49 |
#define luapas_luaL_checkinteger luaL_checkinteger |
|
50 |
#define luapas_luaL_checklstring luaL_checklstring |
|
51 |
#define luapas_luaL_loadfile luaL_loadfile |
|
52 |
#define luapas_luaL_loadstring luaL_loadstring |
|
53 |
#define luapas_luaL_newstate luaL_newstate |
|
54 |
#define luapas_luaL_optinteger luaL_optinteger |
|
55 |
#define luapas_luaL_optlstring luaL_optlstring |
|
56 |
#define luapas_luaL_prepbuffer luaL_prepbuffer |
|
57 |
#define luapas_luaL_ref luaL_ref |
|
58 |
#define luapas_luaL_unref luaL_unref |
|
59 |
#define luapas_luaopen_base luaopen_base |
|
60 |
#define luapas_luaopen_math luaopen_math |
|
61 |
#define luapas_luaopen_string luaopen_string |
|
62 |
#define luapas_luaopen_table luaopen_table |
|
63 |
#define luapas_lua_load lua_load |
|
64 |
||
65 |
#define sdlh_IMG_Load IMG_Load |
|
66 |
#define sdlh_IMG_Load_RW IMG_Load_RW |
|
67 |
||
68 |
#ifndef EMSCRIPTEN |
|
69 |
#define sdlh_Mix_AllocateChannels Mix_AllocateChannels |
|
70 |
#define sdlh_Mix_CloseAudio Mix_CloseAudio |
|
71 |
#define sdlh_Mix_FadeInChannelTimed Mix_FadeInChannelTimed |
|
72 |
#define sdlh_Mix_FadeInMusic Mix_FadeInMusic |
|
73 |
#define sdlh_Mix_FadeOutChannel Mix_FadeOutChannel |
|
74 |
#define sdlh_Mix_FreeChunk Mix_FreeChunk |
|
75 |
#define sdlh_Mix_FreeMusic Mix_FreeMusic |
|
76 |
#define sdlh_Mix_HaltChannel Mix_HaltChannel |
|
77 |
#define sdlh_Mix_HaltMusic Mix_HaltMusic |
|
78 |
#define sdlh_Mix_LoadMUS Mix_LoadMUS |
|
79 |
#define sdlh_Mix_LoadMUS_RW Mix_LoadMUS_RW |
|
80 |
#define sdlh_Mix_LoadWAV_RW Mix_LoadWAV_RW |
|
81 |
#define sdlh_Mix_OpenAudio Mix_OpenAudio |
|
82 |
#define sdlh_Mix_PauseMusic Mix_PauseMusic |
|
83 |
#define sdlh_Mix_PlayChannelTimed Mix_PlayChannelTimed |
|
84 |
#define sdlh_Mix_Playing Mix_Playing |
|
85 |
#define sdlh_Mix_ResumeMusic Mix_ResumeMusic |
|
86 |
#define sdlh_Mix_Volume Mix_Volume |
|
87 |
#define sdlh_Mix_VolumeMusic Mix_VolumeMusic |
|
88 |
#else |
|
89 |
#define sdlh_Mix_AllocateChannels stub_Mix_AllocateChannels |
|
90 |
#define sdlh_Mix_CloseAudio stub_Mix_CloseAudio |
|
91 |
#define sdlh_Mix_FadeInChannelTimed stub_Mix_FadeInChannelTimed |
|
92 |
#define sdlh_Mix_FadeInMusic stub_Mix_FadeInMusic |
|
93 |
#define sdlh_Mix_FadeOutChannel stub_Mix_FadeOutChannel |
|
94 |
#define sdlh_Mix_FreeChunk stub_Mix_FreeChunk |
|
95 |
#define sdlh_Mix_FreeMusic stub_Mix_FreeMusic |
|
96 |
#define sdlh_Mix_HaltChannel stub_Mix_HaltChannel |
|
97 |
#define sdlh_Mix_HaltMusic stub_Mix_HaltMusic |
|
98 |
#define sdlh_Mix_LoadMUS stub_Mix_LoadMUS |
|
99 |
#define sdlh_Mix_LoadMUS_RW stub_Mix_LoadMUS_RW |
|
100 |
#define sdlh_Mix_LoadWAV_RW stub_Mix_LoadWAV_RW |
|
101 |
#define sdlh_Mix_OpenAudio stub_Mix_OpenAudio |
|
102 |
#define sdlh_Mix_PauseMusic stub_Mix_PauseMusic |
|
103 |
#define sdlh_Mix_PlayChannelTimed stub_Mix_PlayChannelTimed |
|
104 |
#define sdlh_Mix_Playing stub_Mix_Playing |
|
105 |
#define sdlh_Mix_ResumeMusic stub_Mix_ResumeMusic |
|
106 |
#define sdlh_Mix_Volume stub_Mix_Volume |
|
107 |
#define sdlh_Mix_VolumeMusic stub_Mix_VolumeMusic |
|
108 |
#endif |
|
109 |
||
11368
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
10129
diff
changeset
|
110 |
#define sdlh_SDL_free SDL_free |
10015 | 111 |
#define sdlh_SDL_ConvertSurface SDL_ConvertSurface |
112 |
#define sdlh_SDL_CreateRGBSurface SDL_CreateRGBSurface |
|
113 |
#define sdlh_SDL_CreateThread SDL_CreateThread |
|
114 |
#define sdlh_SDL_Delay SDL_Delay |
|
115 |
#define sdlh_SDL_EnableKeyRepeat SDL_EnableKeyRepeat |
|
116 |
#define sdlh_SDL_EnableUNICODE SDL_EnableUNICODE |
|
117 |
#define sdlh_SDL_FillRect SDL_FillRect |
|
118 |
#define sdlh_SDL_FreeSurface SDL_FreeSurface |
|
119 |
#define sdlh_SDL_GetError SDL_GetError |
|
120 |
#define sdlh_SDL_GetKeyName SDL_GetKeyName |
|
11368
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
10129
diff
changeset
|
121 |
#define sdlh_SDL_GetKeyboardState SDL_GetKeyboardState |
10015 | 122 |
#define sdlh_SDL_GetMouseState SDL_GetMouseState |
123 |
#define sdlh_SDL_GetRGBA SDL_GetRGBA |
|
124 |
#define sdlh_SDL_GetTicks SDL_GetTicks |
|
125 |
#define sdlh_SDL_GL_SetAttribute SDL_GL_SetAttribute |
|
126 |
#define sdlh_SDL_GL_SwapBuffers SDL_GL_SwapBuffers |
|
127 |
#define sdlh_SDL_Init SDL_Init |
|
128 |
#define sdlh_SDL_InitSubSystem SDL_InitSubSystem |
|
129 |
#define sdlh_SDL_JoystickClose SDL_JoystickClose |
|
130 |
#define sdlh_SDL_JoystickEventState SDL_JoystickEventState |
|
131 |
#define sdlh_SDL_JoystickName SDL_JoystickName |
|
132 |
#define sdlh_SDL_JoystickNumAxes SDL_JoystickNumAxes |
|
133 |
#define sdlh_SDL_JoystickNumButtons SDL_JoystickNumButtons |
|
134 |
#define sdlh_SDL_JoystickNumHats SDL_JoystickNumHats |
|
135 |
#define sdlh_SDL_JoystickOpen SDL_JoystickOpen |
|
136 |
#define sdlh_SDL_LockSurface SDL_LockSurface |
|
137 |
#define sdlh_SDL_MapRGB SDL_MapRGB |
|
138 |
#define sdlh_SDL_MapRGBA SDL_MapRGBA |
|
139 |
#define sdlh_SDL_NumJoysticks SDL_NumJoysticks |
|
140 |
#define sdlh_SDL_PeepEvents SDL_PeepEvents |
|
141 |
#define sdlh_SDL_PumpEvents SDL_PumpEvents |
|
142 |
#define sdlh_SDL_Quit SDL_Quit |
|
143 |
#define sdlh_SDL_RWFromFile SDL_RWFromFile |
|
144 |
#define sdlh_SDL_SetColorKey SDL_SetColorKey |
|
145 |
#define sdlh_SDL_SetVideoMode SDL_SetVideoMode |
|
146 |
#define sdlh_SDL_WaitThread SDL_WaitThread |
|
147 |
#define sdlh_SDL_CreateMutex SDL_CreateMutex |
|
148 |
#define sdlh_SDL_DestroyMutex SDL_DestroyMutex |
|
11368
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
10129
diff
changeset
|
149 |
#define sdlh_SDL_LockMutex SDL_LockMutex |
c481d087f653
cmake tweaks. make pas2c build with sdl2 (keycodes or something still missing)
sheepluva
parents:
10129
diff
changeset
|
150 |
#define sdlh_SDL_UnlockMutex SDL_UnlockMutex |
10015 | 151 |
#ifndef EMSCRIPTEN |
152 |
#define sdlh_SDL_ShowCursor SDL_ShowCursor |
|
153 |
#else |
|
154 |
#define sdlh_SDL_ShowCursor SDL_ShowCursor_patch |
|
155 |
#endif |
|
156 |
#define sdlh_SDL_UnlockSurface SDL_UnlockSurface |
|
157 |
#define sdlh_SDL_UpperBlit SDL_UpperBlit |
|
158 |
#define sdlh_SDL_VideoDriverName SDL_VideoDriverName |
|
159 |
#define sdlh_SDL_WarpMouse SDL_WarpMouse |
|
160 |
#define sdlh_SDL_WM_SetCaption SDL_WM_SetCaption |
|
161 |
#define sdlh_SDL_WM_SetIcon SDL_WM_SetIcon |
|
162 |
#define sdlh_SDLNet_AddSocket SDLNet_AddSocket |
|
163 |
#define sdlh_SDLNet_AllocSocketSet SDLNet_AllocSocketSet |
|
164 |
#define sdlh_SDLNet_CheckSockets SDLNet_CheckSockets |
|
165 |
#define sdlh_SDLNet_FreeSocketSet SDLNet_FreeSocketSet |
|
166 |
#define sdlh_SDLNet_Init SDLNet_Init |
|
167 |
#define sdlh_SDLNet_Quit SDLNet_Quit |
|
168 |
#define sdlh_SDLNet_ResolveHost SDLNet_ResolveHost |
|
169 |
#define sdlh_SDLNet_TCP_Close SDLNet_TCP_Close |
|
170 |
#define sdlh_SDLNet_TCP_Open SDLNet_TCP_Open |
|
171 |
#define sdlh_SDLNet_TCP_Recv SDLNet_TCP_Recv |
|
172 |
#define sdlh_SDLNet_TCP_Send SDLNet_TCP_Send |
|
173 |
#define sdlh_TTF_Init TTF_Init |
|
174 |
#define sdlh_TTF_OpenFont TTF_OpenFont |
|
175 |
#define sdlh_TTF_OpenFontRW TTF_OpenFontRW |
|
176 |
#define sdlh_TTF_Quit TTF_Quit |
|
177 |
#define sdlh_TTF_RenderUTF8_Blended TTF_RenderUTF8_Blended |
|
178 |
#define sdlh_TTF_RenderUTF8_Solid TTF_RenderUTF8_Solid |
|
179 |
#define sdlh_TTF_SetFontStyle TTF_SetFontStyle |
|
180 |
#define sdlh_TTF_SizeUTF8 TTF_SizeUTF8 |
|
181 |
||
10129
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
182 |
#define uphysfslayer_physfsReaderSetBuffer physfsReaderSetBuffer |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
183 |
#define uphysfslayer_physfsReader physfsReader |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
184 |
#define uphysfslayer_hedgewarsMountPackage hedgewarsMountPackage |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
185 |
#define uphysfslayer_hedgewarsMountPackages hedgewarsMountPackages |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
186 |
|
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
187 |
#define uphysfslayer_PHYSFSRWOPS_openRead PHYSFSRWOPS_openRead |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
188 |
#define uphysfslayer_PHYSFSRWOPS_openWrite PHYSFSRWOPS_openWrite |
cd2a64a1f4aa
- Pas2C: make use of 'external' function decorator
unc0rr
parents:
10128
diff
changeset
|
189 |
|
10015 | 190 |
#define _strconcat fpcrtl_strconcat |
191 |
#define _strappend fpcrtl_strappend |
|
192 |
#define _strprepend fpcrtl_strprepend |
|
193 |
#define _strcompare fpcrtl_strcompare |
|
194 |
#define _strncompare fpcrtl_strncompare |
|
195 |
#define _strcomparec fpcrtl_strcomparec |
|
196 |
#define _chrconcat fpcrtl_chrconcat |
|
197 |
#define _pchar fpcrtl_pchar |
|
10124
aabd1b75d5a3
Even more explicit type conversions and other stuff to help pas2c use ansistrings
unc0rr
parents:
10015
diff
changeset
|
198 |
#define _strconcatA fpcrtl_strconcatA |
10127 | 199 |
#define _strncompareA fpcrtl_strncompareA |
10128 | 200 |
#define _strappendA fpcrtl_strappendA |
10015 | 201 |
|
202 |
// hooks are implemented in javascript |
|
203 |
void start_hook(void); |
|
204 |
void mainloop_hook(void); |
|
205 |
void clear_filelist_hook(void); |
|
206 |
void add_file_hook(const char* ptr); |
|
207 |
void idb_loader_hook(); |
|
208 |
void showcursor_hook(); |
|
209 |
void hidecursor_hook(); |
|
210 |
void drawworld_init_hook(); |
|
211 |
#endif |