16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
17 *) |
17 *) |
18 |
18 |
19 Library hwLibrary; |
19 Library hwLibrary; |
20 |
20 |
|
21 {$IFDEF fpc} |
|
22 {$MODE delphi} |
|
23 {$ENDIF} |
|
24 |
|
25 {$IFDEF ANDROID} |
|
26 {$MACRO ON} |
|
27 {$DEFINE Java_Prefix := 'Java_org_hedgewars_mobile_EngineProtocol_PascalExports_'} |
|
28 {$ENDIF} |
|
29 |
21 // Add all your Pascal units to the "uses" clause below to add them to the program. |
30 // Add all your Pascal units to the "uses" clause below to add them to the program. |
22 // Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using |
31 // Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using |
23 // "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for |
32 // "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for |
24 // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group) |
33 // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group) |
25 // to make these functions available in the C/C++/Objective-C source files |
34 // to make these functions available in the C/C++/Objective-C source files |
26 // (add "#include PascalImports.h" near the top of these files if it's not there yet) |
35 // (add "#include PascalImports.h" near the top of these files if it's not there yet) |
27 uses PascalExports, hwengine; |
36 uses PascalExports, hwengine{$IFDEF ANDROID},jni{$ENDIF}; |
28 exports Game, HW_versionInfo; |
37 exports Game{$IFNDEF ANDROID}, HW_versionInfo{$ENDIF}; |
|
38 |
|
39 function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
|
40 begin |
|
41 JNI_HW_versionInfoNet := cNetProtoVersion; |
|
42 end; |
|
43 |
|
44 function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl; |
|
45 begin |
|
46 JNI_HW_versionInfoVersion := env^.NewStringUTF(env, PChar(cVersionString)); |
|
47 end; |
|
48 |
|
49 |
|
50 {$IFDEF ANDROID} |
|
51 exports |
|
52 JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
|
53 JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |
|
54 GenLandPreview name Java_Prefix + 'GenLandPreview', |
|
55 HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons', |
|
56 HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs', |
|
57 HW_getMaxNumberOfTeams name Java_Prefix + 'HWgetMaxNumberOfTeams'; |
|
58 {$ENDIF} |
|
59 |
29 begin |
60 begin |
30 |
61 |
31 end. |
62 end. |
32 |
63 |