hedgewars/PascalExports.pas
author koda
Tue, 12 Jan 2010 07:32:15 +0000
changeset 2692 ce9992075118
parent 2691 c0da3a98c01c
child 2698 90585aba87ad
permissions -rw-r--r--
better network support + initial work for returning to frontend
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;
2692
ce9992075118 better network support + initial work for returning to frontend
koda
parents: 2691
diff changeset
    24
procedure IPH_returnFrontend; cdecl; external; 
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    25
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    26
// retrieve protocol information
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    27
function  HW_protoVer: LongInt; cdecl; export;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    28
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    29
// called by the touch functions (SDL_uikitview.m)
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    30
// they emulate user interaction from mouse or keyboard
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    31
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    32
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    33
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    34
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    35
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    36
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    37
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    38
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    39
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    40
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    41
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    42
procedure HW_whereIsHog; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    43
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    44
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    45
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    46
implementation
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    47
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    48
{$IFDEF IPHONEOS}
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    49
function HW_protoVer: LongInt; cdecl; export;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    50
begin
2692
ce9992075118 better network support + initial work for returning to frontend
koda
parents: 2691
diff changeset
    51
	WriteLnToConsole('HW - protocol version');
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    52
	HW_protoVer:= cNetProtoVersion;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    53
end;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    54
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    55
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    56
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    57
	WriteLnToConsole('HW - left click');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    58
	leftClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    59
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    60
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    61
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    62
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    63
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    64
	WriteLnToConsole('HW - zooming in');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    65
	wheelUp:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    66
	exit
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_zoomOut; 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
	WriteLnToConsole('HW - zooming out');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    72
	wheelDown:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    73
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    74
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    75
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    76
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    77
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    78
	WriteLnToConsole('HW - reset zoom');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    79
	middleClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    80
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    81
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    82
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    83
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    84
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    85
	WriteLnToConsole('HW - right click');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    86
	rightClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    87
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    88
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    89
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    90
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    91
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    92
	WriteLnToConsole('HW - resetting keyboard');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    93
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    94
	upKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    95
	downKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    96
	leftKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    97
	rightKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    98
	spaceKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    99
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   100
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   101
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   102
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   103
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   104
	WriteLnToConsole('HW - walking left');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   105
	leftKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   106
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   107
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   108
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   109
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   110
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   111
	WriteLnToConsole('HW - walking right');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   112
	rightKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   113
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   114
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   115
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   116
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   117
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   118
	WriteLnToConsole('HW - aiming upwards');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   119
	upKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   120
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   121
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   122
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   123
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   124
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   125
	WriteLnToConsole('HW - aiming downwards');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   126
	downKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   127
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   128
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   129
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   130
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   131
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   132
	WriteLnToConsole('HW - shooting');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   133
	spaceKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   134
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   135
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   136
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   137
procedure HW_whereIsHog; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   138
var Xcoord, Ycoord: LongInt;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   139
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   140
	//Xcoord:= Gear^.dX + WorldDx;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   141
	WriteLnToConsole('HW - hog is at x: ' + ' y:');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   142
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   143
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   144
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   145
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   146
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   147
end.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   148