hedgewars/PascalExports.pas
author smxx
Thu, 04 Feb 2010 20:45:03 +0000
changeset 2747 7889a3a9724f
parent 2716 b9ca1bfca24f
child 2754 ad4f81fbfb76
permissions -rw-r--r--
Server: * Added support for flags (this still needs further adjustments to restore compatibility with older versions (team datasets)!) Engine: * Added support for flags * Added weapon tooltips * Moved SplitBySpace to uMisc * Set file operations to readonly to avoid conflicts running multiple copies networked and synced on one (fast) machine * Flash active team while green arrow is shown (waiting for input or camera centered on active hog) * Updated English locale Frontend: * Added support for flags * Added flag selection to edit team page * Added checkbox for weapon tooltips in options * "Random team" button may now be translated * Disabled "official server" button till protocol is handled for all versions (see above; nemo's server is updated to new protocol) Graphics: * Added basic set of example flags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     1
(*
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     2
 *  PascalExports.pas
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     3
 *  hwengine
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     4
 *
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     5
 *  Created by Vittorio on 09/01/10.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     6
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     7
 *
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     8
 *)
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
     9
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    10
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    11
{$INCLUDE "options.inc"}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    12
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    13
unit PascalExports;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    14
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    15
interface
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    16
uses uKeys, uConsole;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    17
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    18
{$INCLUDE "proto.inc"}
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    19
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    20
{$IFDEF IPHONEOS}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    21
// called by pascal code, they deal with the objc code
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    22
function  IPH_getDocumentsPath: PChar; cdecl; external;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    23
procedure IPH_showControls; cdecl; external;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    24
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    25
// retrieve protocol information
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    26
function  HW_protoVer: LongInt; cdecl; export;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    27
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    28
// called by the touch functions (SDL_uikitview.m)
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    29
// they emulate user interaction from mouse or keyboard
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    30
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    31
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    32
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    33
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    34
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    35
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    36
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    37
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    38
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    39
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    40
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    41
procedure HW_whereIsHog; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    42
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    43
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    44
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    45
implementation
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    46
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    47
{$IFDEF IPHONEOS}
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    48
function HW_protoVer: LongInt; cdecl; export;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    49
begin
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    50
	HW_protoVer:= cNetProtoVersion;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    51
end;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    52
2698
90585aba87ad objc/pascal finally working
koda
parents: 2692
diff changeset
    53
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    54
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    55
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    56
	leftClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    57
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    58
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    59
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    60
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    61
	wheelUp:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    62
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    63
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    64
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    65
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    66
	wheelDown:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    67
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    68
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    69
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    70
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    71
	middleClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    72
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    73
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    74
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    75
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    76
	rightClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    77
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    78
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    79
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    80
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    81
	upKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    82
	downKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    83
	leftKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    84
	rightKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    85
	spaceKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    86
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    87
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    88
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    89
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    90
	leftKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    91
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    92
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    93
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    94
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    95
	rightKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    96
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    97
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    98
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    99
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   100
	upKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   101
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   102
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   103
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   104
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   105
	downKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   106
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   107
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   108
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   109
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   110
	spaceKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   111
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   112
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   113
procedure HW_whereIsHog; cdecl; export;
2698
90585aba87ad objc/pascal finally working
koda
parents: 2692
diff changeset
   114
//var Xcoord, Ycoord: LongInt;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   115
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   116
	//Xcoord:= Gear^.dX + WorldDx;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   117
	WriteLnToConsole('HW - hog is at x: ' + ' y:');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   118
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   119
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   120
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   121
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   122
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   123
end.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   124