author | koda |
Tue, 04 Jun 2013 23:48:44 +0200 | |
branch | webgl |
changeset 9133 | a269fe7090a0 |
parent 8050 | c82b68016c68 |
child 9260 | 64718974158f |
permissions | -rw-r--r-- |
7983 | 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> |
|
8047
25a4daa6473c
cleanup headers, remove -I . from rtl lib to save a few warnings
koda
parents:
7983
diff
changeset
|
8 |
#include <math.h> |
7983 | 9 |
|
8047
25a4daa6473c
cleanup headers, remove -I . from rtl lib to save a few warnings
koda
parents:
7983
diff
changeset
|
10 |
#include "SysUtils.h" |
7983 | 11 |
#include "system.h" |
12 |
#include "misc.h" |
|
13 |
#include "fileio.h" |
|
14 |
#include "pmath.h" |
|
15 |
||
16 |
#ifndef EMSCRIPTEN |
|
8050 | 17 |
#if __APPLE__ |
18 |
#define main SDL_main |
|
19 |
#endif |
|
7983 | 20 |
#include "GL/glew.h" |
21 |
#endif |
|
22 |
||
23 |
#define fpcrtl_memcpy memcpy |
|
24 |
||
25 |
#define luapas_lua_gettop lua_gettop |
|
26 |
#define luapas_lua_close lua_close |
|
27 |
#define luapas_lua_createtable lua_createtable |
|
28 |
#define luapas_lua_error lua_error |
|
29 |
#define luapas_lua_gc lua_gc |
|
30 |
#define luapas_lua_getfield lua_getfield |
|
31 |
#define luapas_lua_objlen lua_objlen |
|
32 |
#define luapas_lua_call lua_call |
|
33 |
#define luapas_lua_pcall lua_pcall |
|
34 |
#define luapas_lua_pushboolean lua_pushboolean |
|
35 |
#define luapas_lua_pushcclosure lua_pushcclosure |
|
36 |
#define luapas_lua_pushinteger lua_pushinteger |
|
37 |
#define luapas_lua_pushnil lua_pushnil |
|
38 |
#define luapas_lua_pushnumber lua_pushnumber |
|
39 |
#define luapas_lua_pushlstring lua_pushlstring |
|
40 |
#define luapas_lua_pushstring lua_pushstring |
|
41 |
#define luapas_lua_pushvalue lua_pushvalue |
|
42 |
#define luapas_lua_rawgeti lua_rawgeti |
|
43 |
#define luapas_lua_setfield lua_setfield |
|
44 |
#define luapas_lua_settop lua_settop |
|
45 |
#define luapas_lua_toboolean lua_toboolean |
|
46 |
#define luapas_lua_tointeger lua_tointeger |
|
47 |
#define luapas_lua_tolstring lua_tolstring |
|
48 |
#define luapas_lua_tonumber lua_tonumber |
|
49 |
#define luapas_lua_type lua_type |
|
50 |
#define luapas_lua_typename lua_typename |
|
51 |
#define luapas_luaL_argerror luaL_argerror |
|
52 |
#define luapas_luaL_checkinteger luaL_checkinteger |
|
53 |
#define luapas_luaL_checklstring luaL_checklstring |
|
54 |
#define luapas_luaL_loadfile luaL_loadfile |
|
55 |
#define luapas_luaL_loadstring luaL_loadstring |
|
56 |
#define luapas_luaL_newstate luaL_newstate |
|
57 |
#define luapas_luaL_optinteger luaL_optinteger |
|
58 |
#define luapas_luaL_optlstring luaL_optlstring |
|
59 |
#define luapas_luaL_prepbuffer luaL_prepbuffer |
|
60 |
#define luapas_luaL_ref luaL_ref |
|
61 |
#define luapas_luaL_unref luaL_unref |
|
62 |
#define luapas_luaopen_base luaopen_base |
|
63 |
#define luapas_luaopen_math luaopen_math |
|
64 |
#define luapas_luaopen_string luaopen_string |
|
65 |
#define luapas_luaopen_table luaopen_table |
|
66 |
||
67 |
#define sdlh_IMG_Load IMG_Load |
|
68 |
||
69 |
#ifndef EMSCRIPTEN |
|
70 |
#define sdlh_Mix_AllocateChannels Mix_AllocateChannels |
|
71 |
#define sdlh_Mix_CloseAudio Mix_CloseAudio |
|
72 |
#define sdlh_Mix_FadeInChannelTimed Mix_FadeInChannelTimed |
|
73 |
#define sdlh_Mix_FadeInMusic Mix_FadeInMusic |
|
74 |
#define sdlh_Mix_FadeOutChannel Mix_FadeOutChannel |
|
75 |
#define sdlh_Mix_FreeChunk Mix_FreeChunk |
|
76 |
#define sdlh_Mix_FreeMusic Mix_FreeMusic |
|
77 |
#define sdlh_Mix_HaltChannel Mix_HaltChannel |
|
78 |
#define sdlh_Mix_HaltMusic Mix_HaltMusic |
|
79 |
#define sdlh_Mix_LoadMUS Mix_LoadMUS |
|
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_LoadWAV_RW stub_Mix_LoadWAV_RW |
|
100 |
#define sdlh_Mix_OpenAudio stub_Mix_OpenAudio |
|
101 |
#define sdlh_Mix_PauseMusic stub_Mix_PauseMusic |
|
102 |
#define sdlh_Mix_PlayChannelTimed stub_Mix_PlayChannelTimed |
|
103 |
#define sdlh_Mix_Playing stub_Mix_Playing |
|
104 |
#define sdlh_Mix_ResumeMusic stub_Mix_ResumeMusic |
|
105 |
#define sdlh_Mix_Volume stub_Mix_Volume |
|
106 |
#define sdlh_Mix_VolumeMusic stub_Mix_VolumeMusic |
|
107 |
#endif |
|
108 |
||
109 |
#define sdlh_SDL_ConvertSurface SDL_ConvertSurface |
|
110 |
#define sdlh_SDL_CreateRGBSurface SDL_CreateRGBSurface |
|
111 |
#define sdlh_SDL_CreateThread SDL_CreateThread |
|
112 |
#define sdlh_SDL_Delay SDL_Delay |
|
113 |
#define sdlh_SDL_EnableKeyRepeat SDL_EnableKeyRepeat |
|
114 |
#define sdlh_SDL_EnableUNICODE SDL_EnableUNICODE |
|
115 |
#define sdlh_SDL_FillRect SDL_FillRect |
|
116 |
#define sdlh_SDL_FreeSurface SDL_FreeSurface |
|
117 |
#define sdlh_SDL_GetError SDL_GetError |
|
118 |
#define sdlh_SDL_GetKeyName SDL_GetKeyName |
|
119 |
#define sdlh_SDL_GetKeyState SDL_GetKeyState |
|
120 |
#define sdlh_SDL_GetMouseState SDL_GetMouseState |
|
121 |
#define sdlh_SDL_GetRGBA SDL_GetRGBA |
|
122 |
#define sdlh_SDL_GetTicks SDL_GetTicks |
|
123 |
#define sdlh_SDL_GL_SetAttribute SDL_GL_SetAttribute |
|
124 |
#define sdlh_SDL_GL_SwapBuffers SDL_GL_SwapBuffers |
|
125 |
#define sdlh_SDL_Init SDL_Init |
|
126 |
#define sdlh_SDL_InitSubSystem SDL_InitSubSystem |
|
127 |
#define sdlh_SDL_JoystickClose SDL_JoystickClose |
|
128 |
#define sdlh_SDL_JoystickEventState SDL_JoystickEventState |
|
129 |
#define sdlh_SDL_JoystickName SDL_JoystickName |
|
130 |
#define sdlh_SDL_JoystickNumAxes SDL_JoystickNumAxes |
|
131 |
#define sdlh_SDL_JoystickNumButtons SDL_JoystickNumButtons |
|
132 |
#define sdlh_SDL_JoystickNumHats SDL_JoystickNumHats |
|
133 |
#define sdlh_SDL_JoystickOpen SDL_JoystickOpen |
|
134 |
#define sdlh_SDL_LockSurface SDL_LockSurface |
|
135 |
#define sdlh_SDL_MapRGB SDL_MapRGB |
|
136 |
#define sdlh_SDL_MapRGBA SDL_MapRGBA |
|
137 |
#define sdlh_SDL_NumJoysticks SDL_NumJoysticks |
|
138 |
#define sdlh_SDL_PeepEvents SDL_PeepEvents |
|
139 |
#define sdlh_SDL_PumpEvents SDL_PumpEvents |
|
140 |
#define sdlh_SDL_Quit SDL_Quit |
|
141 |
#define sdlh_SDL_RWFromFile SDL_RWFromFile |
|
142 |
#define sdlh_SDL_SetColorKey SDL_SetColorKey |
|
143 |
#define sdlh_SDL_SetVideoMode SDL_SetVideoMode |
|
144 |
#ifndef EMSCRIPTEN |
|
145 |
#define sdlh_SDL_ShowCursor SDL_ShowCursor |
|
146 |
#else |
|
147 |
#define sdlh_SDL_ShowCursor SDL_ShowCursor_patch |
|
148 |
#endif |
|
149 |
#define sdlh_SDL_UnlockSurface SDL_UnlockSurface |
|
150 |
#define sdlh_SDL_UpperBlit SDL_UpperBlit |
|
151 |
#define sdlh_SDL_VideoDriverName SDL_VideoDriverName |
|
152 |
#define sdlh_SDL_WarpMouse SDL_WarpMouse |
|
153 |
#define sdlh_SDL_WM_SetCaption SDL_WM_SetCaption |
|
154 |
#define sdlh_SDL_WM_SetIcon SDL_WM_SetIcon |
|
155 |
#define sdlh_SDLNet_AddSocket SDLNet_AddSocket |
|
156 |
#define sdlh_SDLNet_AllocSocketSet SDLNet_AllocSocketSet |
|
157 |
#define sdlh_SDLNet_CheckSockets SDLNet_CheckSockets |
|
158 |
#define sdlh_SDLNet_FreeSocketSet SDLNet_FreeSocketSet |
|
159 |
#define sdlh_SDLNet_Init SDLNet_Init |
|
160 |
#define sdlh_SDLNet_Quit SDLNet_Quit |
|
161 |
#define sdlh_SDLNet_ResolveHost SDLNet_ResolveHost |
|
162 |
#define sdlh_SDLNet_TCP_Close SDLNet_TCP_Close |
|
163 |
#define sdlh_SDLNet_TCP_Open SDLNet_TCP_Open |
|
164 |
#define sdlh_SDLNet_TCP_Recv SDLNet_TCP_Recv |
|
165 |
#define sdlh_SDLNet_TCP_Send SDLNet_TCP_Send |
|
166 |
#define sdlh_TTF_Init TTF_Init |
|
167 |
#define sdlh_TTF_OpenFont TTF_OpenFont |
|
168 |
#define sdlh_TTF_Quit TTF_Quit |
|
169 |
#define sdlh_TTF_RenderUTF8_Blended TTF_RenderUTF8_Blended |
|
170 |
#define sdlh_TTF_RenderUTF8_Solid TTF_RenderUTF8_Solid |
|
171 |
#define sdlh_TTF_SetFontStyle TTF_SetFontStyle |
|
172 |
#define sdlh_TTF_SizeUTF8 TTF_SizeUTF8 |
|
173 |
||
174 |
#define _strconcat fpcrtl_strconcat |
|
175 |
#define _strappend fpcrtl_strappend |
|
176 |
#define _strprepend fpcrtl_strprepend |
|
177 |
#define _strcompare fpcrtl_strcompare |
|
178 |
#define _strncompare fpcrtl_strncompare |
|
179 |
#define _strcomparec fpcrtl_strcomparec |
|
180 |
#define _chrconcat fpcrtl_chrconcat |
|
181 |
#define _pchar fpcrtl_pchar |
|
182 |
||
183 |
// hooks are implemented in javascript |
|
184 |
void start_hook(void); |
|
185 |
void mainloop_hook(void); |
|
186 |
void clear_filelist_hook(void); |
|
187 |
void add_file_hook(const char* ptr); |
|
188 |
void idb_loader_hook(); |
|
189 |
void showcursor_hook(); |
|
190 |
void hidecursor_hook(); |
|
191 |
void drawworld_init_hook(); |
|
192 |
#endif |