author | Xeli |
Fri, 25 Nov 2011 19:36:03 +0100 | |
changeset 6432 | ffb18b44415d |
parent 6035 | bdd0528ee8a6 |
child 6700 | e04da46ee43c |
permissions | -rw-r--r-- |
4930 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
3 |
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
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 |
|
17 |
*) |
|
2698 | 18 |
|
19 |
Library hwLibrary; |
|
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
20 |
{$INCLUDE "options.inc"} |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
21 |
|
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
22 |
// Add all your Pascal units to the 'uses' clause below to add them to the program. |
2698 | 23 |
// Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using |
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
24 |
// 'cdecl; export;' (see the fpclogo.pas unit for an example), and then add C-declarations for |
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
25 |
// these procedures/functions to the PascalImports.h file (also in the 'Pascal Sources' group) |
2698 | 26 |
// to make these functions available in the C/C++/Objective-C source files |
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
27 |
// (add '#include PascalImports.h' near the top of these files if it is not there yet) |
6025
cac1d5601d7c
reviewed the build system and parts of the previous merge, performed some code cleanup
koda
parents:
5452
diff
changeset
|
28 |
uses PascalExports, hwengine{$IFDEF ANDROID}, jni{$ENDIF}; |
cac1d5601d7c
reviewed the build system and parts of the previous merge, performed some code cleanup
koda
parents:
5452
diff
changeset
|
29 |
exports Game, HW_versionInfo; |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
30 |
|
6027 | 31 |
{$IFDEF ANDROID} |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
32 |
function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl; |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
33 |
begin |
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
34 |
env:= env; // avoid hint |
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
35 |
obj:= obj; // avoid hint |
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
36 |
JNI_HW_versionInfoNet:= cNetProtoVersion; |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
37 |
end; |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
38 |
|
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
39 |
function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl; |
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
40 |
var envderef : JNIEnv; |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
41 |
begin |
6033
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
42 |
obj:= obj; // avoid hint |
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
43 |
envderef:= @env; |
6bcc36225162
fix compiling for android, strip out all delphi code, objfpc ftw
koda
parents:
6027
diff
changeset
|
44 |
JNI_HW_versionInfoVersion := envderef^.NewStringUTF(env, PChar(cVersionString)); |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
45 |
end; |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
46 |
|
6025
cac1d5601d7c
reviewed the build system and parts of the previous merge, performed some code cleanup
koda
parents:
5452
diff
changeset
|
47 |
exports |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
48 |
JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
49 |
JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
50 |
GenLandPreview name Java_Prefix + 'GenLandPreview', |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
51 |
HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons', |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
52 |
HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs', |
6035
bdd0528ee8a6
Close a game without leaking memory. It should be noted that sending an SDL Quit event leaks memory
Xeli
parents:
6033
diff
changeset
|
53 |
HW_getMaxNumberOfTeams name Java_Prefix + 'HWgetMaxNumberOfTeams', |
bdd0528ee8a6
Close a game without leaking memory. It should be noted that sending an SDL Quit event leaks memory
Xeli
parents:
6033
diff
changeset
|
54 |
HW_terminate name Java_Prefix + 'HWterminate'; |
5452
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
55 |
{$ENDIF} |
3edc3e3b8cdc
Created callbacks to give the frontend information of maxteams/hogs
Xeli
parents:
5166
diff
changeset
|
56 |
|
4187 | 57 |
begin |
4850 | 58 |
|
2698 | 59 |
end. |
60 |