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 |
30 // Add all your Pascal units to the "uses" clause below to add them to the program. |
22 // Add all your Pascal units to the "uses" clause below to add them to the program. |
31 // Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using |
23 // Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using |
32 // "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for |
24 // "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for |
33 // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group) |
25 // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group) |
34 // to make these functions available in the C/C++/Objective-C source files |
26 // to make these functions available in the C/C++/Objective-C source files |
35 // (add "#include PascalImports.h" near the top of these files if it's not there yet) |
27 // (add "#include PascalImports.h" near the top of these files if it's not there yet) |
36 uses PascalExports, hwengine{$IFDEF ANDROID},jni{$ENDIF}; |
28 uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF}; |
37 exports Game{$IFNDEF ANDROID}, HW_versionInfo{$ENDIF}; |
29 exports Game, HW_versionInfo; |
38 |
30 |
39 function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
31 function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
40 begin |
32 begin |
41 JNI_HW_versionInfoNet := cNetProtoVersion; |
33 JNI_HW_versionInfoNet := cNetProtoVersion; |
42 end; |
34 end; |
46 JNI_HW_versionInfoVersion := env^.NewStringUTF(env, PChar(cVersionString)); |
38 JNI_HW_versionInfoVersion := env^.NewStringUTF(env, PChar(cVersionString)); |
47 end; |
39 end; |
48 |
40 |
49 |
41 |
50 {$IFDEF ANDROID} |
42 {$IFDEF ANDROID} |
51 exports |
43 exports |
52 JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
44 JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
53 JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |
45 JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |
54 GenLandPreview name Java_Prefix + 'GenLandPreview', |
46 GenLandPreview name Java_Prefix + 'GenLandPreview', |
55 HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons', |
47 HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons', |
56 HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs', |
48 HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs', |