-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimations.p
executable file
·133 lines (118 loc) · 3.15 KB
/
Animations.p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
unit animations;
interface
uses
Sound, QDOffScreen, Tools, Globals, GameGlobals, GameTools,
Dialogs,ToolUtils,QDOffScreen,Resources, Palettes;
procedure Animate (ID: integer; where: Rect);
procedure DoAnimations;
implementation
procedure DoPolice;
begin
PlaySound(1208);
KillEngine;
UnlockPixels(GetGWorldPixMap(Screenworld));
SetGDevice(TheScreen);
SetGworld(CGrafPtr(Racewindow),TheScreen);
if Alert(1004, nil) = 1 then
begin
Score := Score - 500;
if Score < 0 then
Score := 0;
DrawInstr;
end
else
if random >10000 then
begin
Dead := true;
PlaySound(1207);
Animate(1002,CarRect);
end;
SetGworld(ScreenWorld, nil);
if not LockPixels(GetGworldPixMap(ScreenWorld)) then
DoError(QDError);
if BitTst(@GamePrefs^^.GrafFlags,1) then
ReHideMenuBar;
LKey := False;
RKey := False;
Brakkey := False;
AccKey := false;
UDSpeed := 0;
LRSpeed := 0;
end;
procedure Animate (ID: integer; where: Rect);
type
FrameList = record
Scroll: Boolean;
Sound: integer;
Frames: array[1..10] of integer;
end;
FramePtr = ^FrameList;
FrameHandle = ^FramePtr;
var
i: integer;
begin
if ID <> 1 then
for i := 1 to 10 do
begin
if Animations[i].on = False then
begin
if ID = 0 then
if BitTst(@MyRoad^^.Flags, 0) then
ID := 1020
else
ID := 1021;
Animations[i].On := True;
Animations[i].Frame := 1;
Animations[i].Pos := where;
Animations[i].Data := GetResource('ANIM', ID);
PlaySound(FrameHandle(Animations[i].Data)^^.Sound);
Exit(Animate);
end;
end
else
DoPolice;
end;
procedure DoAnimations;
label
1;
type
FrameList = record
Scroll: Boolean;
Sound: integer;
Frames: array[1..30] of integer;
end;
FramePtr = ^FrameList;
FrameHandle = ^FramePtr;
var
i: integer;
begin
StandartCLUT:=TRUE;
for i := 1 to 10 do
if Animations[i].on = true then
begin
1:
if Animations[i].Frame < (GetHandleSize(Animations[i].Data) - 4) div 2 then
begin
if FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame]< 1000 then
begin
if FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame] = -1 then
SetCLUT;
if FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame] = 0 then
RemoveBlood(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame+1])
else
ScreenBlood(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame+1],BTST(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame],0),BTST(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame],1),BTST(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame],2));
Animations[i].Frame := Animations[i].Frame + 2;
goto 1;
end;
PlotSprite(FrameHandle(Animations[i].data)^^.Frames[Animations[i].Frame], Animations[i].Pos);
OffsetRect(Animations[i].Pos, 0, UDSpeed);
end
else
begin
Animations[i].on := False;
ReleaseResource(Animations[i].data);
end;
Animations[i].Frame := Animations[i].Frame + 1;
end;
end;
end.