15 * along with this program; if not, write to the Free Software |
15 * along with this program; if not, write to the Free Software |
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 {$INCLUDE "options.inc"} |
20 |
21 |
21 |
22 // 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. |
|
23 // 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 |
24 // "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 |
25 // 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) |
26 // 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 |
27 // (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 is not there yet) |
28 uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF}; |
28 uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF}; |
29 exports Game, HW_versionInfo; |
29 exports Game, HW_versionInfo; |
30 |
30 |
31 {$IFDEF ANDROID} |
31 {$IFDEF ANDROID} |
32 function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
32 function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
33 begin |
33 begin |
34 JNI_HW_versionInfoNet := cNetProtoVersion; |
34 env:= env; // avoid hint |
|
35 obj:= obj; // avoid hint |
|
36 JNI_HW_versionInfoNet:= cNetProtoVersion; |
35 end; |
37 end; |
36 |
38 |
37 function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl; |
39 function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl; |
|
40 var envderef : JNIEnv; |
38 begin |
41 begin |
39 JNI_HW_versionInfoVersion := env^.NewStringUTF(env, PChar(cVersionString)); |
42 obj:= obj; // avoid hint |
|
43 envderef:= @env; |
|
44 JNI_HW_versionInfoVersion := envderef^.NewStringUTF(env, PChar(cVersionString)); |
40 end; |
45 end; |
41 |
46 |
42 exports |
47 exports |
43 JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
48 JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
44 JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |
49 JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |