hedgewars/PascalExports.pas
author smxx
Sun, 28 Mar 2010 11:34:06 +0000
changeset 3134 430c1e96c80f
parent 3063 0092dc37fbd6
child 3245 252be02536ab
permissions -rw-r--r--
CMake: * Run FindLua every time, even if LUA_LIBRARY is already set
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
3063
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
    16
uses uKeys, uConsole, hwengine;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    17
2924
908851e59958 Engine:
smxx
parents: 2905
diff changeset
    18
{$INCLUDE "config.inc"}
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    19
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    20
implementation
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    21
2803
1f446fc5c8ec allow to compile engine as library with HWLIBRARY symbol
koda
parents: 2799
diff changeset
    22
{$IFDEF HWLIBRARY}
3063
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
    23
// retrieve protocol information
2799
558b29bf00c5 add a new way to fetch version info from pascal to c
koda
parents: 2754
diff changeset
    24
procedure HW_versionInfo(netProto: PShortInt; versionStr: PString); cdecl; export;
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    25
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    26
    if netProto <> nil then netProto^:= cNetProtoVersion;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    27
    if versionStr <> nil then versionStr^:= shortstring(cVersionString);
2691
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    28
end;
c0da3a98c01c initial support for engine protocol
koda
parents: 2690
diff changeset
    29
2690
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
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    32
    leftClick:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    33
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    34
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    35
procedure HW_zoomIn; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    36
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    37
    wheelUp:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    38
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    39
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    40
procedure HW_zoomOut; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    41
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    42
    wheelDown:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    43
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    44
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    45
procedure HW_zoomReset; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    46
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    47
    middleClick:= true;
2690
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_ammoMenu; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    51
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    52
    rightClick:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    53
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    54
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    55
procedure HW_allKeysUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    56
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    57
    // set all keys to released
3040
3e7f4a30e18a Insert commit message here (to get along with palewolf)
koda
parents: 3015
diff changeset
    58
    uKeys.initModule;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    59
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    60
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    61
procedure HW_walkLeft; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    62
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    63
    leftKey:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    64
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    65
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    66
procedure HW_walkRight; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    67
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    68
    rightKey:= true;
2690
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_aimUp; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    72
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    73
    upKey:= true;
2690
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_aimDown; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    77
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    78
    downKey:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    79
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    80
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    81
procedure HW_shoot; cdecl; export;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    82
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    83
    spaceKey:= true;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    84
end;
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
    85
3015
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    86
procedure HW_jump; cdecl; export;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    87
begin
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    88
    enterKey:= true;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    89
end;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    90
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    91
procedure HW_backjump; cdecl; export;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    92
begin
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    93
    backspaceKey:= true;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    94
end;
20a9c8160e82 add jump and backjump controls
koda
parents: 2948
diff changeset
    95
2754
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
    96
procedure HW_chat; cdecl; export;
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
    97
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
    98
    chatAction:= true;
2754
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
    99
end;
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
   100
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
   101
procedure HW_tab; cdecl; export;
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
   102
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
   103
    switchAction:= true;
2754
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
   104
end;
ad4f81fbfb76 touchinput works, invisible buttons added and initial support for chat
koda
parents: 2716
diff changeset
   105
2805
36a8cebb91e8 new menupage ingame for common actions
koda
parents: 2803
diff changeset
   106
procedure HW_pause; cdecl; export;
36a8cebb91e8 new menupage ingame for common actions
koda
parents: 2803
diff changeset
   107
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
   108
    pauseAction:= true;
2805
36a8cebb91e8 new menupage ingame for common actions
koda
parents: 2803
diff changeset
   109
end;
36a8cebb91e8 new menupage ingame for common actions
koda
parents: 2803
diff changeset
   110
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   111
procedure HW_whereIsHog; cdecl; export;
2698
90585aba87ad objc/pascal finally working
koda
parents: 2692
diff changeset
   112
//var Xcoord, Ycoord: LongInt;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   113
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
   114
    //Xcoord:= Gear^.dX + WorldDx;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
   115
    WriteLnToConsole('HW - hog is at x: ' + ' y:');
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   116
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2924
diff changeset
   117
    exit
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   118
end;
3063
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   119
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   120
procedure HW_terminate(closeFrontend: boolean); cdecl; export;
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   121
begin
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   122
    isTerminated:= true;
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   123
    if closeFrontend then alsoShutdownFrontend:= true;
0092dc37fbd6 reworked interaction of engine/frontend when closing
koda
parents: 3040
diff changeset
   124
end;
2690
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   125
{$ENDIF}
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   126
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   127
end.
8e83c7e31720 move mixed functions in PascalExports
koda
parents:
diff changeset
   128