Reduce number of link errors webgl
authorunc0rr
Wed, 19 Jun 2013 00:19:33 +0400
branchwebgl
changeset 9260 64718974158f
parent 9256 5a2e94a4c2d0
child 9264 21df1a0ec9ed
Reduce number of link errors
hedgewars/pas2cSystem.pas
hedgewars/uPhysFSLayer.pas
project_files/hwc/rtl/fpcrtl.h
--- a/hedgewars/pas2cSystem.pas	Tue Jun 18 22:10:51 2013 +0200
+++ b/hedgewars/pas2cSystem.pas	Wed Jun 19 00:19:33 2013 +0400
@@ -126,4 +126,9 @@
     clear_filelist_hook, add_file_hook, idb_loader_hook, mainloop_hook, drawworld_hook : procedure;
     SDL_InitPatch : procedure;
 
-  
+    PHYSFS_init, PHYSFS_deinit, PHYSFS_mount, PHYSFS_readBytes : function : LongInt;
+    PHYSFSRWOPS_openRead, PHYSFSRWOPS_openWrite, PHYSFS_openRead : function : pointer;
+    PHYSFS_eof, PHYSFS_close, PHYSFS_exists : function : boolean;
+
+    hedgewarsMountPackages, physfsReaderSetBuffer, hedgewarsMountPackage : procedure;
+    physfsReader : function : pointer;
--- a/hedgewars/uPhysFSLayer.pas	Tue Jun 18 22:10:51 2013 +0200
+++ b/hedgewars/uPhysFSLayer.pas	Wed Jun 19 00:19:33 2013 +0400
@@ -29,16 +29,16 @@
 
 function pfsExists(fname: shortstring): boolean;
 
+{ $IFNDEF PAS2C}
 function  physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName;
 procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName;
 procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName;
+{ $ENDIF}
+
+implementation
+uses uUtils, uVariables;
 
 {$IFNDEF PAS2C}
-//apparently pas2c doesn't render the functions below if it finds 'implementation' first
-implementation
-uses uUtils, uVariables, sysutils;
-{$ENDIF}
-
 function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName;
 function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName;
 function PHYSFSRWOPS_openRead(fname: PChar): PSDL_RWops; cdecl; external PhyslayerLibName;
@@ -52,10 +52,6 @@
 function PHYSFS_exists(fname: PChar): LongBool; cdecl; external PhysfsLibName;
 
 procedure hedgewarsMountPackages(); cdecl; external PhyslayerLibName;
-
-{$IFDEF PAS2C}
-implementation
-uses uUtils, uVariables;
 {$ENDIF}
 
 (*****************************************************************)
--- a/project_files/hwc/rtl/fpcrtl.h	Tue Jun 18 22:10:51 2013 +0200
+++ b/project_files/hwc/rtl/fpcrtl.h	Wed Jun 19 00:19:33 2013 +0400
@@ -65,6 +65,7 @@
 #define luapas_luaopen_table                luaopen_table
 
 #define sdlh_IMG_Load                       IMG_Load
+#define sdlh_IMG_Load_RW                    IMG_Load_RW
 
 #ifndef EMSCRIPTEN
 #define sdlh_Mix_AllocateChannels           Mix_AllocateChannels
@@ -77,6 +78,7 @@
 #define sdlh_Mix_HaltChannel                Mix_HaltChannel
 #define sdlh_Mix_HaltMusic                  Mix_HaltMusic
 #define sdlh_Mix_LoadMUS                    Mix_LoadMUS
+#define sdlh_Mix_LoadMUS_RW                 Mix_LoadMUS_RW
 #define sdlh_Mix_LoadWAV_RW                 Mix_LoadWAV_RW
 #define sdlh_Mix_OpenAudio                  Mix_OpenAudio
 #define sdlh_Mix_PauseMusic                 Mix_PauseMusic
@@ -96,6 +98,7 @@
 #define sdlh_Mix_HaltChannel                stub_Mix_HaltChannel
 #define sdlh_Mix_HaltMusic                  stub_Mix_HaltMusic
 #define sdlh_Mix_LoadMUS                    stub_Mix_LoadMUS
+#define sdlh_Mix_LoadMUS_RW                 stub_Mix_LoadMUS_RW
 #define sdlh_Mix_LoadWAV_RW                 stub_Mix_LoadWAV_RW
 #define sdlh_Mix_OpenAudio                  stub_Mix_OpenAudio
 #define sdlh_Mix_PauseMusic                 stub_Mix_PauseMusic
@@ -141,6 +144,11 @@
 #define sdlh_SDL_RWFromFile                 SDL_RWFromFile
 #define sdlh_SDL_SetColorKey                SDL_SetColorKey
 #define sdlh_SDL_SetVideoMode               SDL_SetVideoMode
+#define sdlh_SDL_WaitThread                 SDL_WaitThread
+#define sdlh_SDL_CreateMutex                SDL_CreateMutex
+#define sdlh_SDL_DestroyMutex               SDL_DestroyMutex
+#define sdlh_SDL_LockMutex                  SDL_mutexP
+#define sdlh_SDL_UnlockMutex                SDL_mutexV
 #ifndef EMSCRIPTEN
 #define sdlh_SDL_ShowCursor                 SDL_ShowCursor
 #else
@@ -165,6 +173,7 @@
 #define sdlh_SDLNet_TCP_Send                SDLNet_TCP_Send
 #define sdlh_TTF_Init                       TTF_Init
 #define sdlh_TTF_OpenFont                   TTF_OpenFont
+#define sdlh_TTF_OpenFontRW                 TTF_OpenFontRW
 #define sdlh_TTF_Quit                       TTF_Quit
 #define sdlh_TTF_RenderUTF8_Blended         TTF_RenderUTF8_Blended
 #define sdlh_TTF_RenderUTF8_Solid           TTF_RenderUTF8_Solid