-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathun.Structs.pas
More file actions
123 lines (109 loc) · 4.77 KB
/
un.Structs.pas
File metadata and controls
123 lines (109 loc) · 4.77 KB
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
{*****************************************************************************
Copyright (C) 2026 NormalUser
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*****************************************************************************}
unit un.Structs;
{$Mode objfpc} {$H+}
{$COPERATORS OFF}
// ******************** interface *************************
interface
USES SDL2, SDL2_Mixer,
un.Defs;
TYPE PAtlasImage = ^TAtlasImage;
TAtlasImage = RECORD
FNam : String;
Rec : TSDL_Rect;
Rot : Integer;
Tex : PSDL_Texture;
next : PAtlasImage;
end;
PSprite = ^TSprite;
TSprite = RECORD { Sprite }
Textur : PAtlasImage;
x, y : Single;
Rect : TSDL_Rect;
end;
PTextur = ^TTexture;
TTexture = RECORD
namen1 : ARRAY[0..MAX_LINE_LENGTH] of Char;
Texture : PSDL_Texture;
next : PTextur;
end;
TAI = RECORD
difference, vdiff, max_y, target : Single;
pad, distance, direction, state : Integer;
end;
TLevel = RECORD
landing_x, landing_y, landing_w, landing_score : ARRAY[0..ANZ] of LongInt;
landing_speed : ARRAY[0..ANZ] of Single;
landing_color : ARRAY[0..ANZ] of TSDL_Color;
difficulty, fuel, num_landings : Integer;
end;
TGame_def = RECORD
ai : TAI;
curr_lev : TLevel;
gravity, x_vel, y_vel : Single;
Boden, BodenGrey, TBack, thruster_m, thruster_l, thruster_r,
crosshairs, miniship, miniship1, miniship2,
magigames, logo, Background, lander1, lander2 : TSprite;
maxscoreShip, ships_remaining, score, levelscore, difficulty, nr,
landing_pad, Timeout, fuel, SoundVol, MusicVol, beacon_x, beacon_y : Integer;
fullscreen : UInt32;
opt_fancy_Terrain, opt_lp_warn, opt_lp_bonus, opt_prog_grav,
B_thrust_m, B_thrust_l, B_thrust_r, startGame, endGame, newGame,
title, newRound, menue, won, loose, destroy, landed, exitloop,
pause, director, manual, autopilot, demoMode : Boolean;
end;
TDelegating = PROCEDURE;
TDelegate = RECORD
logic, draw : TDelegating;
end;
TApp = RECORD
Window : PSDL_Window;
Renderer : PSDL_Renderer;
keyboard : ARRAY[0..MAX_KEYBOARD_KEYS] OF Integer;
delegate : TDelegate;
end;
AtlasArr = ARRAY[0..NUMATLASBUCKETS] of PAtlasImage;
VAR app : TApp;
SDL_Event : TSDL_Event;
RGB : TSDL_Color;
game : TGame_def;
gTicks : UInt32;
menu_Grav : Single;
gravity_Pr : Byte;
gRemainder : Double;
speedTex : PSDL_Texture;
Eagle,
Rocket,
BodenRect : TSprite;
backPic : TSprite;
Explo : ARRAY[1..Max_Exp] of TSprite;
backPicNam : ARRAY[1..Max_Back] of String;
BodenArr : ARRAY[0..xSize] of Integer;
EagleArr : ARRAY of ARRAY of Byte;
engine_on,
engine_on_past,
Anz_Back : Byte;
atlasTex : PSDL_Texture;
atlases : AtlasArr;
sounds : ARRAY[1..SND_MAX] OF PMix_Chunk;
music : PMix_Music;
anz,
_left,
_right,
_down,
tick : Integer;
// ******************** implementation ********************
implementation
end.