hedgewars/PascalExports.pas
author koda
Sat, 09 Jan 2010 01:34:23 +0000
changeset 2690 8e83c7e31720
child 2691 c0da3a98c01c
permissions -rw-r--r--
move mixed functions in PascalExports
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
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    18
{$IFDEF IPHONEOS}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    19
// called by pascal code, they deal with the objc code
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    20
function  IPH_getDocumentsPath: PChar; cdecl; external;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    21
procedure IPH_showControls; cdecl; external;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    22
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    23
// called by the touch functions (SDL_uikitview.m)
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    24
// they emulate user interaction from mouse or keyboard
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    25
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    26
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    27
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    28
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    29
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    30
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    31
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    32
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    33
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    34
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    35
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    36
procedure HW_whereIsHog; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    37
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    38
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    39
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    40
implementation
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    41
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    42
{$IFDEF IPHONEOS}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    43
procedure HW_click; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    44
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    45
	WriteLnToConsole('HW - left click');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    46
	leftClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    47
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    48
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    49
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    50
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    51
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    52
	WriteLnToConsole('HW - zooming in');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    53
	wheelUp:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    54
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    55
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    56
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    57
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    58
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    59
	WriteLnToConsole('HW - zooming out');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    60
	wheelDown:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    61
	exit
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_zoomReset; 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
	WriteLnToConsole('HW - reset zoom');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    67
	middleClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    68
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    69
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    70
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    71
procedure HW_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    72
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    73
	WriteLnToConsole('HW - right click');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    74
	rightClick:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    75
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    76
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    77
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    78
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    79
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    80
	WriteLnToConsole('HW - resetting keyboard');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    81
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    82
	upKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    83
	downKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    84
	leftKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    85
	rightKey:= false;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    86
	spaceKey:= false;
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_walkLeft; 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 - walking left');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    93
	leftKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    94
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    95
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    96
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    97
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    98
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    99
	WriteLnToConsole('HW - walking right');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   100
	rightKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   101
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   102
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   103
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   104
procedure HW_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   105
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   106
	WriteLnToConsole('HW - aiming upwards');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   107
	upKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   108
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   109
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   110
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   111
procedure HW_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   112
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   113
	WriteLnToConsole('HW - aiming downwards');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   114
	downKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   115
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   116
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   117
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   118
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   119
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   120
	WriteLnToConsole('HW - shooting');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   121
	spaceKey:= true;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   122
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   123
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   124
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   125
procedure HW_whereIsHog; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   126
var Xcoord, Ycoord: LongInt;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   127
begin
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   128
	//Xcoord:= Gear^.dX + WorldDx;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   129
	WriteLnToConsole('HW - hog is at x: ' + ' y:');
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   130
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   131
	exit
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   132
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   133
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   134
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   135
end.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   136