author | koda |
Tue, 04 Jan 2011 12:53:46 +0100 | |
branch | experimental3D |
changeset 4812 | f924be23ffb4 |
parent 4347 | 0ddb100fea61 |
parent 4810 | 76315fdfb7a5 |
child 4816 | c2575faeac3d |
permissions | -rw-r--r-- |
4 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
3236
4ab3917d7d44
Update (c) lines to 2010 as unc0rr requested - they all had varying values so I just took the first year mentioned, then tacked on -2010
nemo
parents:
3204
diff
changeset
|
3 |
* Copyright (c) 2004-2010 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 4 |
* |
183 | 5 |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
4 | 8 |
* |
183 | 9 |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
4 | 13 |
* |
183 | 14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
4 | 17 |
*) |
18 |
||
2630 | 19 |
{$INCLUDE "options.inc"} |
20 |
||
4 | 21 |
unit uWorld; |
22 |
interface |
|
4357
a1fcfc341a52
Introduce unit uTypes in order to remove some cyclic unit dependencies
unC0Rr
parents:
4248
diff
changeset
|
23 |
uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes; |
3697 | 24 |
|
3038 | 25 |
procedure initModule; |
26 |
procedure freeModule; |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
27 |
|
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
28 |
procedure InitWorld; |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
29 |
procedure DrawWorld(Lag: LongInt); |
3692 | 30 |
procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode); |
2905 | 31 |
procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt); |
2786 | 32 |
procedure HideMission; |
3032 | 33 |
procedure ShakeCamera(amount: LongWord); |
3638
33ee433749ba
touch overlay reworked, improvements to zoom and confirmation
koda
parents:
3629
diff
changeset
|
34 |
procedure MoveCamera; |
4 | 35 |
|
36 |
implementation |
|
4359 | 37 |
uses |
38 |
uStore, |
|
39 |
uMisc, |
|
40 |
uIO, |
|
41 |
uLocale, |
|
42 |
uSound, |
|
43 |
uAmmos, |
|
44 |
uVisualGears, |
|
45 |
uChat, |
|
46 |
uLandTexture, |
|
47 |
GLunit, |
|
4374 | 48 |
uVariables, |
4375 | 49 |
uUtils, |
4378 | 50 |
uTextures, |
4380 | 51 |
uRender, |
4393 | 52 |
uCaptions |
4359 | 53 |
; |
4 | 54 |
|
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
55 |
var cWaveWidth, cWaveHeight: LongInt; |
3434 | 56 |
AMSlotSize, AMxOffset, AMyOffset, AMWidth, AMxShift, SlotsNum: LongInt; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2682
diff
changeset
|
57 |
tmpSurface: PSDL_Surface; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2682
diff
changeset
|
58 |
fpsTexture: PTexture; |
2850
f6f8db825ce7
A little clock for convenience in finding things in demos
nemo
parents:
2839
diff
changeset
|
59 |
timeTexture: PTexture; |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
60 |
FPS: Longword; |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
61 |
CountTicks: Longword; |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
62 |
SoundTimerTicks: Longword; |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
63 |
prevPoint: TPoint; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
64 |
amSel: TAmmoType = amNothing; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
65 |
missionTex: PTexture; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
66 |
missionTimer: LongInt; |
3692 | 67 |
stereoDepth: GLfloat = 0; |
68 |
||
4345
2c93d6a10869
use a gentler positive parallax for background effect
koda
parents:
4343
diff
changeset
|
69 |
const cStereo_Sky = 0.0500; |
3692 | 70 |
cStereo_Horizon = 0.0250; |
71 |
cStereo_Water = 0.0125; |
|
4 | 72 |
|
73 |
procedure InitWorld; |
|
2704
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
74 |
var i, t: LongInt; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
75 |
cp: PClan; |
2863 | 76 |
g: ansistring; |
77 |
||
2904 | 78 |
// helper functions to create the goal/game mode string |
2908 | 79 |
function AddGoal(s: ansistring; gf: longword; si: TGoalStrId; i: LongInt): ansistring; |
2905 | 80 |
var t: ansistring; |
2904 | 81 |
begin |
82 |
if (GameFlags and gf) <> 0 then |
|
83 |
begin |
|
84 |
t:= inttostr(i); |
|
85 |
s:= s + format(trgoal[si], t) + '|' |
|
86 |
end; |
|
87 |
AddGoal:= s; |
|
88 |
end; |
|
89 |
||
2908 | 90 |
function AddGoal(s: ansistring; gf: longword; si: TGoalStrId): ansistring; |
2863 | 91 |
begin |
2904 | 92 |
if (GameFlags and gf) <> 0 then |
93 |
s:= s + trgoal[si] + '|'; |
|
2863 | 94 |
AddGoal:= s; |
95 |
end; |
|
4 | 96 |
begin |
3764 | 97 |
missionTimer:= 0; |
2786 | 98 |
|
2704
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
99 |
if (GameFlags and gfRandomOrder) <> 0 then // shuffle them up a bit |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
100 |
begin |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
101 |
for i:= 0 to ClansCount * 4 do |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
102 |
begin |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
103 |
t:= GetRandom(ClansCount); |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
104 |
if t <> 0 then |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
105 |
begin |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
106 |
cp:= ClansArray[0]; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
107 |
ClansArray[0]:= ClansArray[t]; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
108 |
ClansArray[t]:= cp; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
109 |
ClansArray[t]^.ClanIndex:= t; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
110 |
ClansArray[0]^.ClanIndex:= 0; |
2856
cc70797a0b75
Adjust LocalClan when shuffling, set to -1 in case all local clans are bots.
nemo
parents:
2855
diff
changeset
|
111 |
if (LocalClan = t) then LocalClan:= 0 |
cc70797a0b75
Adjust LocalClan when shuffling, set to -1 in case all local clans are bots.
nemo
parents:
2855
diff
changeset
|
112 |
else if (LocalClan = 0) then LocalClan:= t |
2704
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
113 |
end; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
114 |
end; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
115 |
CurrentTeam:= ClansArray[0]^.Teams[0]; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
116 |
end; |
51cda17b7c3b
Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it.
nemo
parents:
2699
diff
changeset
|
117 |
|
2908 | 118 |
// if special game flags/settings are changed, add them to the game mode notice window and then show it |
2863 | 119 |
g:= ''; // no text/things to note yet |
2908 | 120 |
|
2958 | 121 |
// check different game flags (goals/game modes first for now) |
122 |
g:= AddGoal(g, gfKing, gidKing); // king? |
|
123 |
||
124 |
// other important flags |
|
125 |
g:= AddGoal(g, gfForts, gidForts); // forts? |
|
126 |
g:= AddGoal(g, gfLowGravity, gidLowGravity); // low gravity? |
|
127 |
g:= AddGoal(g, gfInvulnerable, gidInvulnerable); // invulnerability? |
|
128 |
g:= AddGoal(g, gfVampiric, gidVampiric); // vampirism? |
|
129 |
g:= AddGoal(g, gfKarma, gidKarma); // karma? |
|
130 |
g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement? |
|
131 |
g:= AddGoal(g, gfArtillery, gidArtillery); // artillery? |
|
132 |
g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land? |
|
133 |
g:= AddGoal(g, gfSharedAmmo, gidSharedAmmo); // shared ammo? |
|
4132 | 134 |
g:= AddGoal(g, gfResetHealth, gidResetHealth); |
135 |
g:= AddGoal(g, gfAISurvival, gidAISurvival); |
|
136 |
g:= AddGoal(g, gfInfAttack, gidInfAttack); |
|
137 |
g:= AddGoal(g, gfResetWeps, gidResetWeps); |
|
138 |
g:= AddGoal(g, gfPerHogAmmo, gidPerHogAmmo); |
|
2958 | 139 |
|
2908 | 140 |
// modified damage modificator? |
141 |
if cDamagePercent <> 100 then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
142 |
g:= AddGoal(g, gfAny, gidDamageModifier, cDamagePercent); |
2908 | 143 |
|
3107 | 144 |
// fade in |
145 |
ScreenFade:= sfFromBlack; |
|
146 |
ScreenFadeValue:= sfMax; |
|
147 |
ScreenFadeSpeed:= 1; |
|
148 |
||
2908 | 149 |
// modified mine timers? |
4482 | 150 |
if cMinesTime <> 3000 then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
151 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
152 |
if cMinesTime = 0 then |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3976
diff
changeset
|
153 |
g:= AddGoal(g, gfAny, gidNoMineTimer) |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
154 |
else if cMinesTime < 0 then |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3976
diff
changeset
|
155 |
g:= AddGoal(g, gfAny, gidRandomMineTimer) |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
156 |
else |
4482 | 157 |
g:= AddGoal(g, gfAny, gidMineTimer, cMinesTime div 1000); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
158 |
end; |
2908 | 159 |
|
2863 | 160 |
// if the string has been set, show it for (default timeframe) seconds |
161 |
if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0); |
|
162 |
||
1825 | 163 |
cWaveWidth:= SpritesData[sprWater].Width; |
2268
053eb81e60ee
little experiment to see if this improve appearance of laser/ufo/cake/laser guided missile - of course, can't actually see it until unc0rr restores waves
nemo
parents:
2226
diff
changeset
|
164 |
//cWaveHeight:= SpritesData[sprWater].Height; |
053eb81e60ee
little experiment to see if this improve appearance of laser/ufo/cake/laser guided missile - of course, can't actually see it until unc0rr restores waves
nemo
parents:
2226
diff
changeset
|
165 |
cWaveHeight:= 32; |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
166 |
|
284 | 167 |
cGearScrEdgesDist:= Min(cScreenWidth div 2 - 100, cScreenHeight div 2 - 50); |
74 | 168 |
SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2); |
2197 | 169 |
prevPoint.X:= 0; |
74 | 170 |
prevPoint.Y:= cScreenHeight div 2; |
1760 | 171 |
WorldDx:= - (LAND_WIDTH div 2) + cScreenWidth div 2; |
2139
5a083e71a71d
Properly decrement sniper rifle if timed out. Try to get camera position straight for once.
nemo
parents:
2119
diff
changeset
|
172 |
WorldDy:= - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2); |
3434 | 173 |
AMSlotSize:= 33; |
174 |
{$IFDEF IPHONEOS} |
|
175 |
AMxOffset:= 10; |
|
3464 | 176 |
AMyOffset:= 10 + 123; // moved downwards |
3434 | 177 |
AMWidth:= (cMaxSlotAmmoIndex + 1) * AMSlotSize + AMxOffset; |
178 |
{$ELSE} |
|
179 |
AMxOffset:= 10; |
|
180 |
AMyOffset:= 60; |
|
181 |
AMWidth:= (cMaxSlotAmmoIndex + 2) * AMSlotSize + AMxOffset; |
|
182 |
{$ENDIF} |
|
183 |
AMxShift:= AMWidth; |
|
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
184 |
SkyOffset:= 0; |
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
185 |
HorizontOffset:= 0; |
161 | 186 |
end; |
187 |
||
3405 | 188 |
|
956 | 189 |
procedure ShowAmmoMenu; |
161 | 190 |
const MENUSPEED = 15; |
3434 | 191 |
const BORDERSIZE = 2; |
192 |
var x, y, i, t, g: LongInt; |
|
193 |
Slot, Pos, STurns: LongInt; |
|
2855
7e6adeb57427
Show the ammo menu of the last local non-bot team when not local turn. needs testing
nemo
parents:
2851
diff
changeset
|
194 |
Ammo: PHHAmmo; |
161 | 195 |
begin |
3952
d6412423da45
moved some utilities to a separate column with round buttons
koda
parents:
3890
diff
changeset
|
196 |
if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then |
d6412423da45
moved some utilities to a separate column with round buttons
koda
parents:
3890
diff
changeset
|
197 |
bShowAmmoMenu:= false; |
3434 | 198 |
if bShowAmmoMenu then |
199 |
begin |
|
200 |
FollowGear:= nil; |
|
201 |
if AMxShift = AMWidth then prevPoint.X:= 0; |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
202 |
if (cReducedQuality and rqSlowMenu) <> 0 then |
3434 | 203 |
AMxShift:= 0 |
204 |
else |
|
205 |
if AMxShift > MENUSPEED then |
|
206 |
dec(AMxShift, MENUSPEED) |
|
207 |
else |
|
208 |
AMxShift:= 0; |
|
209 |
end else |
|
210 |
begin |
|
211 |
if AMxShift = 0 then |
|
212 |
begin |
|
213 |
CursorPoint.X:= cScreenWidth shr 1; |
|
214 |
CursorPoint.Y:= cScreenHeight shr 1; |
|
215 |
prevPoint:= CursorPoint; |
|
216 |
SDL_WarpMouse(CursorPoint.X + cScreenWidth div 2, cScreenHeight - CursorPoint.Y) |
|
217 |
end; |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
218 |
if (cReducedQuality and rqSlowMenu) <> 0 then |
3434 | 219 |
AMxShift:= AMWidth |
220 |
else |
|
221 |
if AMxShift < (AMWidth - MENUSPEED) then |
|
222 |
inc(AMxShift, MENUSPEED) |
|
223 |
else |
|
224 |
AMxShift:= AMWidth; |
|
225 |
end; |
|
226 |
Ammo:= nil; |
|
227 |
if (CurrentTeam <> nil) and (CurrentHedgehog <> nil) and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then |
|
228 |
Ammo:= CurrentHedgehog^.Ammo |
|
229 |
else if (LocalAmmo <> -1) then |
|
230 |
Ammo:= GetAmmoByNum(LocalAmmo); |
|
231 |
Pos:= -1; |
|
232 |
if Ammo = nil then |
|
2971 | 233 |
begin |
3434 | 234 |
bShowAmmoMenu:= false; |
235 |
exit |
|
2971 | 236 |
end; |
3434 | 237 |
SlotsNum:= 0; |
238 |
x:= (cScreenWidth shr 1) - AMWidth + AMxShift; |
|
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
239 |
|
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
240 |
{$IFDEF IPHONEOS} |
3434 | 241 |
Slot:= cMaxSlotIndex; |
3463 | 242 |
x:= x - cOffsetY; |
3464 | 243 |
y:= AMyOffset; |
3434 | 244 |
dec(y, BORDERSIZE); |
245 |
DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); |
|
246 |
for i:= 0 to cMaxSlotAmmoIndex do |
|
247 |
DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); |
|
248 |
DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); |
|
249 |
inc(y, BORDERSIZE); |
|
250 |
||
251 |
for i:= 0 to cMaxSlotIndex do |
|
252 |
if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then |
|
253 |
begin |
|
3961
cf0ca1ff6c1a
Constrain to <= to avoid a bug on bottom edge reported by Henek
nemo
parents:
3890
diff
changeset
|
254 |
if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i; |
3434 | 255 |
inc(SlotsNum); |
256 |
DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); |
|
257 |
t:= 0; |
|
258 |
g:= 0; |
|
259 |
while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do |
|
260 |
begin |
|
261 |
DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); |
|
262 |
if (Ammo^[i, t].AmmoType <> amNothing) then |
|
263 |
begin |
|
264 |
STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; |
|
265 |
||
266 |
if STurns >= 0 then |
|
267 |
begin |
|
268 |
DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
|
269 |
if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); |
|
270 |
end else |
|
271 |
DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
|
272 |
if (Slot = i) |
|
273 |
and (CursorPoint.X >= x + g * AMSlotSize) |
|
3967 | 274 |
and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then |
3434 | 275 |
begin |
276 |
if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); |
|
277 |
Pos:= t; |
|
278 |
end; |
|
279 |
inc(g) |
|
280 |
end; |
|
281 |
inc(t) |
|
282 |
end; |
|
283 |
for g:= g to cMaxSlotAmmoIndex do |
|
284 |
DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); |
|
285 |
DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); |
|
286 |
inc(y, AMSlotSize); |
|
287 |
end; |
|
3697 | 288 |
|
3434 | 289 |
DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); |
290 |
for i:= 0 to cMaxSlotAmmoIndex do |
|
291 |
DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); |
|
292 |
DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); |
|
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
293 |
{$ELSE} |
3434 | 294 |
Slot:= 0; |
295 |
y:= cScreenHeight - AMyOffset; |
|
296 |
DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); |
|
297 |
for i:= 0 to cMaxSlotAmmoIndex + 1 do |
|
298 |
DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); |
|
299 |
DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); |
|
300 |
dec(y, AMSlotSize); |
|
301 |
DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); |
|
302 |
for i:= 0 to cMaxSlotAmmoIndex do |
|
303 |
DrawSprite(sprAMSlot, x + i * AMSlotSize, y, 2); |
|
304 |
DrawSprite(sprAMSlot, x + (cMaxSlotAmmoIndex + 1) * AMSlotSize, y, 1); |
|
305 |
DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); |
|
306 |
||
307 |
for i:= cMaxSlotIndex downto 0 do |
|
308 |
if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then |
|
309 |
begin |
|
3961
cf0ca1ff6c1a
Constrain to <= to avoid a bug on bottom edge reported by Henek
nemo
parents:
3890
diff
changeset
|
310 |
if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i; |
3434 | 311 |
dec(y, AMSlotSize); |
312 |
inc(SlotsNum); |
|
313 |
DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); |
|
314 |
DrawSprite(sprAMSlot, x, y, 1); |
|
315 |
DrawSprite(sprAMSlotKeys, x, y + 1, i); |
|
316 |
t:= 0; |
|
317 |
g:= 1; |
|
318 |
while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do |
|
319 |
begin |
|
320 |
DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); |
|
321 |
if (Ammo^[i, t].AmmoType <> amNothing) then |
|
322 |
begin |
|
323 |
STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; |
|
324 |
||
325 |
if STurns >= 0 then |
|
326 |
begin |
|
327 |
DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
|
328 |
if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); |
|
329 |
end else |
|
330 |
DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
|
331 |
if (Slot = i) |
|
332 |
and (CursorPoint.X >= x + g * AMSlotSize) |
|
3967 | 333 |
and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then |
3434 | 334 |
begin |
335 |
if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); |
|
336 |
Pos:= t; |
|
337 |
end; |
|
338 |
inc(g) |
|
339 |
end; |
|
340 |
inc(t) |
|
341 |
end; |
|
342 |
for g:= g to cMaxSlotAmmoIndex + 1 do |
|
343 |
DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); |
|
344 |
DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); |
|
345 |
end; |
|
3697 | 346 |
|
3434 | 347 |
dec(y, BORDERSIZE); |
348 |
DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); |
|
349 |
for i:= 0 to cMaxSlotAmmoIndex + 1 do |
|
350 |
DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); |
|
351 |
DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); |
|
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
352 |
{$ENDIF} |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
353 |
|
3434 | 354 |
if (Pos >= 0) then |
355 |
begin |
|
356 |
if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then |
|
3967 | 357 |
begin |
3434 | 358 |
if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
359 |
begin |
3434 | 360 |
amSel:= Ammo^[Slot, Pos].AmmoType; |
361 |
RenderWeaponTooltip(amSel) |
|
362 |
end; |
|
3697 | 363 |
|
3629
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
364 |
{$IFDEF IPHONEOS} |
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
365 |
DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); |
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
366 |
|
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
367 |
if Ammo^[Slot, Pos].Count < AMMO_INFINITE then |
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
368 |
DrawTexture(cScreenWidth div 2 + AMxOffset - 45, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); |
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
369 |
{$ELSE} |
3434 | 370 |
DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); |
371 |
if Ammo^[Slot, Pos].Count < AMMO_INFINITE then |
|
372 |
DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); |
|
3629
86212d2b116a
redo spinning wheel, redo fix for detail selection, redo ammo quantity and name in ammomenu
koda
parents:
3611
diff
changeset
|
373 |
{$ENDIF} |
1529
3bc916b419cd
Don't hide ammo menu when user clicks on not yet available weapon
unc0rr
parents:
1439
diff
changeset
|
374 |
|
3434 | 375 |
if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then |
376 |
begin |
|
377 |
bShowAmmoMenu:= false; |
|
378 |
SetWeapon(Ammo^[Slot, Pos].AmmoType); |
|
379 |
bSelected:= false; |
|
380 |
FreeWeaponTooltip; |
|
381 |
exit |
|
3405 | 382 |
end; |
3967 | 383 |
end |
3434 | 384 |
end |
385 |
else |
|
386 |
FreeWeaponTooltip; |
|
3663
8c28abf427f5
reduce the number of keywords used and switch to BMP format for screenshots
koda
parents:
3641
diff
changeset
|
387 |
if (WeaponTooltipTex <> nil) and (AMxShift = 0) then |
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
388 |
{$IFDEF IPHONEOS} |
3434 | 389 |
ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, AMyOffset - 1); |
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
390 |
{$ELSE} |
4374 | 391 |
ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, Min(y + 1, cScreenHeight - WeaponTooltipTex^.h - 40)); |
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3390
diff
changeset
|
392 |
{$ENDIF} |
961
a9a349b2b3fa
Use turnsleft sprites to indicate turns left to activate ammo
unc0rr
parents:
956
diff
changeset
|
393 |
|
3434 | 394 |
bSelected:= false; |
395 |
if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) |
|
4 | 396 |
end; |
397 |
||
3104 | 398 |
procedure DrawWater(Alpha: byte; OffsetY: LongInt); |
1915 | 399 |
var VertexBuffer: array [0..3] of TVertex2f; |
400 |
r: TSDL_Rect; |
|
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
401 |
lw, lh: GLfloat; |
1915 | 402 |
begin |
4748 | 403 |
if SuddenDeathDmg then |
404 |
begin |
|
405 |
SDWaterColorArray[0].a := Alpha; |
|
406 |
SDWaterColorArray[1].a := Alpha; |
|
407 |
SDWaterColorArray[2].a := Alpha; |
|
408 |
SDWaterColorArray[3].a := Alpha |
|
409 |
end |
|
410 |
else |
|
411 |
begin |
|
412 |
WaterColorArray[0].a := Alpha; |
|
413 |
WaterColorArray[1].a := Alpha; |
|
414 |
WaterColorArray[2].a := Alpha; |
|
415 |
WaterColorArray[3].a := Alpha |
|
416 |
end; |
|
2269
00f5704f5f39
add extra semi-opaque layer of water to discolour objects in the water.
nemo
parents:
2268
diff
changeset
|
417 |
|
3463 | 418 |
lw:= cScreenWidth / cScaleFactor; |
419 |
lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16; |
|
3697 | 420 |
|
3405 | 421 |
// Water |
422 |
r.y:= OffsetY + WorldDy + cWaterLine; |
|
3463 | 423 |
if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
424 |
begin |
3405 | 425 |
if r.y < 0 then |
426 |
r.y:= 0; |
|
1915 | 427 |
|
3405 | 428 |
glDisable(GL_TEXTURE_2D); |
429 |
VertexBuffer[0].X:= -lw; |
|
430 |
VertexBuffer[0].Y:= r.y; |
|
431 |
VertexBuffer[1].X:= lw; |
|
432 |
VertexBuffer[1].Y:= r.y; |
|
433 |
VertexBuffer[2].X:= lw; |
|
434 |
VertexBuffer[2].Y:= lh; |
|
435 |
VertexBuffer[3].X:= -lw; |
|
436 |
VertexBuffer[3].Y:= lh; |
|
1915 | 437 |
|
3641 | 438 |
glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
439 |
glEnableClientState(GL_COLOR_ARRAY); |
|
4748 | 440 |
if SuddenDeathDmg then |
441 |
glColorPointer(4, GL_UNSIGNED_BYTE, 0, @SDWaterColorArray[0]) |
|
442 |
else |
|
443 |
glColorPointer(4, GL_UNSIGNED_BYTE, 0, @WaterColorArray[0]); |
|
1915 | 444 |
|
3405 | 445 |
glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
2171
8208946331ba
Smaxx refactor of LoadImage to use flags, iphone changes by koda (mostly use of rgba instead of rgb)
nemo
parents:
2162
diff
changeset
|
446 |
|
3405 | 447 |
glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
1915 | 448 |
|
3405 | 449 |
glDisableClientState(GL_COLOR_ARRAY); |
3641 | 450 |
glEnableClientState(GL_TEXTURE_COORD_ARRAY); |
3407 | 451 |
glColor4ub($FF, $FF, $FF, $FF); // must not be Tint() as color array seems to stay active and color reset is required |
3405 | 452 |
glEnable(GL_TEXTURE_2D); |
453 |
end; |
|
1915 | 454 |
end; |
455 |
||
3376 | 456 |
procedure DrawWaves(Dir, dX, dY: LongInt; tnt: Byte); |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
457 |
var VertexBuffer, TextureBuffer: array [0..3] of TVertex2f; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
458 |
lw, waves, shift: GLfloat; |
4748 | 459 |
sprite: TSprite; |
2288 | 460 |
begin |
4748 | 461 |
if SuddenDeathDmg then |
462 |
sprite:= sprSDWater |
|
463 |
else |
|
464 |
sprite:= sprWater; |
|
465 |
||
466 |
cWaveWidth:= SpritesData[sprite].Width; |
|
467 |
||
3463 | 468 |
lw:= cScreenWidth / cScaleFactor; |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
469 |
waves:= lw * 2 / cWaveWidth; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
470 |
|
4748 | 471 |
if SuddenDeathDmg then |
472 |
Tint(LongInt(tnt) * SDWaterColorArray[2].r div 255 + 255 - tnt, |
|
473 |
LongInt(tnt) * SDWaterColorArray[2].g div 255 + 255 - tnt, |
|
474 |
LongInt(tnt) * SDWaterColorArray[2].b div 255 + 255 - tnt, |
|
475 |
255 |
|
476 |
) |
|
477 |
else |
|
478 |
Tint(LongInt(tnt) * WaterColorArray[2].r div 255 + 255 - tnt, |
|
479 |
LongInt(tnt) * WaterColorArray[2].g div 255 + 255 - tnt, |
|
480 |
LongInt(tnt) * WaterColorArray[2].b div 255 + 255 - tnt, |
|
481 |
255 |
|
482 |
); |
|
3089 | 483 |
|
4748 | 484 |
glBindTexture(GL_TEXTURE_2D, SpritesData[sprite].Texture^.id); |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
485 |
|
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
486 |
VertexBuffer[0].X:= -lw; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
487 |
VertexBuffer[0].Y:= cWaterLine + WorldDy + dY; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
488 |
VertexBuffer[1].X:= lw; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
489 |
VertexBuffer[1].Y:= VertexBuffer[0].Y; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
490 |
VertexBuffer[2].X:= lw; |
4748 | 491 |
VertexBuffer[2].Y:= VertexBuffer[0].Y + SpritesData[sprite].Height; |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
492 |
VertexBuffer[3].X:= -lw; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
493 |
VertexBuffer[3].Y:= VertexBuffer[2].Y; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
494 |
|
2374 | 495 |
shift:= - lw / cWaveWidth; |
2495 | 496 |
TextureBuffer[0].X:= shift + (( - WorldDx + LongInt(RealTicks shr 6) * Dir + dX) mod cWaveWidth) / (cWaveWidth - 1); |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
497 |
TextureBuffer[0].Y:= 0; |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
498 |
TextureBuffer[1].X:= TextureBuffer[0].X + waves; |
2447
08d623a494e6
Smaxx's updated german translation + texture gap fixes + updated room list
koda
parents:
2434
diff
changeset
|
499 |
TextureBuffer[1].Y:= TextureBuffer[0].Y; |
08d623a494e6
Smaxx's updated german translation + texture gap fixes + updated room list
koda
parents:
2434
diff
changeset
|
500 |
TextureBuffer[2].X:= TextureBuffer[1].X; |
4748 | 501 |
TextureBuffer[2].Y:= SpritesData[sprite].Texture^.ry; |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
502 |
TextureBuffer[3].X:= TextureBuffer[0].X; |
2447
08d623a494e6
Smaxx's updated german translation + texture gap fixes + updated room list
koda
parents:
2434
diff
changeset
|
503 |
TextureBuffer[3].Y:= TextureBuffer[2].Y; |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
504 |
|
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
505 |
|
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
506 |
glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
507 |
glTexCoordPointer(2, GL_FLOAT, 0, @TextureBuffer[0]); |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
508 |
glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
509 |
|
3390 | 510 |
Tint($FF, $FF, $FF, $FF); |
2292
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
511 |
|
87af4ad0ec98
New waves rendering procedure based on using texture coodrinates > 1.0
unc0rr
parents:
2290
diff
changeset
|
512 |
{for i:= -1 to cWaterSprCount do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
513 |
DrawSprite(sprWater, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
514 |
i * cWaveWidth + ((WorldDx + (RealTicks shr 6) * Dir + dX) mod cWaveWidth) - (cScreenWidth div 2), |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
515 |
cWaterLine + WorldDy + dY, |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
516 |
0)} |
2288 | 517 |
end; |
518 |
||
3089 | 519 |
procedure DrawRepeated(spr, sprL, sprR: TSprite; Shift, OffsetY: LongInt); |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
520 |
var i, w, h, lw, lh, rw, rh, sw: LongInt; |
2426 | 521 |
begin |
3405 | 522 |
sw:= round(cScreenWidth / cScaleFactor); |
523 |
if (SpritesData[sprL].Texture = nil) or (SpritesData[sprR].Texture = nil) then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
524 |
begin |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
525 |
w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
526 |
h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale; |
3405 | 527 |
i:= Shift mod w; |
528 |
if i > 0 then dec(i, w); |
|
529 |
dec(i, w * (sw div w + 1)); |
|
530 |
repeat |
|
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
531 |
DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale); |
3405 | 532 |
inc(i, w) |
533 |
until i > sw |
|
534 |
end |
|
535 |
else |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
536 |
begin |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
537 |
w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
538 |
h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
539 |
lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
540 |
lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
541 |
rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
542 |
rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale; |
3405 | 543 |
dec(Shift, w div 2); |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
544 |
DrawTexture(Shift, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale); |
3697 | 545 |
|
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
546 |
i:= Shift - lw; |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
547 |
while i >= -sw - lw do |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
548 |
begin |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
549 |
DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale); |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
550 |
dec(i, lw); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
551 |
end; |
3697 | 552 |
|
3405 | 553 |
i:= Shift + w; |
554 |
while i <= sw do |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
555 |
begin |
3537
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
556 |
DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale); |
8f5b3108f29c
New approach to the low-res problem. Basically, we already have a 1024 minimum, and the tallest maps are restricting themselves to 2048 maximum. All backgrounds are scaled down 50%, then scaled up on draw. Saves memory, and backgrounds are already deliberately fuzzed for depth of field anyway.
nemo
parents:
3523
diff
changeset
|
557 |
inc(i, rw) |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
558 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
559 |
end |
2426 | 560 |
end; |
561 |
||
562 |
||
956 | 563 |
procedure DrawWorld(Lag: LongInt); |
4 | 564 |
begin |
3523 | 565 |
if not isPaused then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
566 |
begin |
3523 | 567 |
if ZoomValue < zoom then |
3444 | 568 |
begin |
3523 | 569 |
zoom:= zoom - 0.002 * Lag; |
3697 | 570 |
if ZoomValue > zoom then |
3523 | 571 |
zoom:= ZoomValue |
3697 | 572 |
end |
3774 | 573 |
else |
3523 | 574 |
if ZoomValue > zoom then |
3444 | 575 |
begin |
3523 | 576 |
zoom:= zoom + 0.002 * Lag; |
577 |
if ZoomValue < zoom then |
|
578 |
zoom:= ZoomValue |
|
3611 | 579 |
end |
3444 | 580 |
end |
3611 | 581 |
else |
582 |
ZoomValue:= zoom; |
|
2376 | 583 |
|
3611 | 584 |
// Sky |
585 |
glClear(GL_COLOR_BUFFER_BIT); |
|
586 |
//glPushMatrix; |
|
587 |
//glScalef(1.0, 1.0, 1.0); |
|
756 | 588 |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
589 |
if not isPaused then |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
590 |
MoveCamera; |
162 | 591 |
|
3696 | 592 |
if cStereoMode = smNone then |
593 |
begin |
|
3692 | 594 |
glClear(GL_COLOR_BUFFER_BIT); |
595 |
DrawWorldStereo(Lag, rmDefault) |
|
3696 | 596 |
end |
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
597 |
{$IFNDEF S3D_DISABLED} |
3696 | 598 |
else if (cStereoMode = smAFR) then |
599 |
begin |
|
600 |
AFRToggle:= not AFRToggle; |
|
601 |
glClear(GL_COLOR_BUFFER_BIT); |
|
602 |
if AFRToggle then |
|
603 |
DrawWorldStereo(Lag, rmLeftEye) |
|
604 |
else |
|
605 |
DrawWorldStereo(Lag, rmRightEye) |
|
606 |
end |
|
607 |
else if (cStereoMode = smHorizontal) or (cStereoMode = smVertical) then |
|
608 |
begin |
|
3692 | 609 |
// create left fb |
610 |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framel); |
|
611 |
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); |
|
612 |
DrawWorldStereo(Lag, rmLeftEye); |
|
613 |
||
614 |
// create right fb |
|
615 |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framer); |
|
616 |
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); |
|
617 |
DrawWorldStereo(0, rmRightEye); |
|
618 |
||
619 |
// detatch drawing from fbs |
|
620 |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); |
|
621 |
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); |
|
622 |
SetScale(cDefaultZoomLevel); |
|
623 |
||
624 |
// draw left frame |
|
625 |
glBindTexture(GL_TEXTURE_2D, texl); |
|
626 |
glBegin(GL_QUADS); |
|
3696 | 627 |
if cStereoMode = smHorizontal then |
628 |
begin |
|
629 |
glTexCoord2f(0.0, 0.0); |
|
630 |
glVertex2d(cScreenWidth / -2, cScreenHeight); |
|
631 |
glTexCoord2f(1.0, 0.0); |
|
632 |
glVertex2d(0, cScreenHeight); |
|
633 |
glTexCoord2f(1.0, 1.0); |
|
634 |
glVertex2d(0, 0); |
|
635 |
glTexCoord2f(0.0, 1.0); |
|
636 |
glVertex2d(cScreenWidth / -2, 0); |
|
637 |
end |
|
638 |
else |
|
639 |
begin |
|
640 |
glTexCoord2f(0.0, 0.0); |
|
641 |
glVertex2d(cScreenWidth / -2, cScreenHeight / 2); |
|
642 |
glTexCoord2f(1.0, 0.0); |
|
643 |
glVertex2d(cScreenWidth / 2, cScreenHeight / 2); |
|
644 |
glTexCoord2f(1.0, 1.0); |
|
645 |
glVertex2d(cScreenWidth / 2, 0); |
|
646 |
glTexCoord2f(0.0, 1.0); |
|
647 |
glVertex2d(cScreenWidth / -2, 0); |
|
648 |
end; |
|
3692 | 649 |
glEnd(); |
650 |
||
651 |
// draw right frame |
|
652 |
glBindTexture(GL_TEXTURE_2D, texr); |
|
653 |
glBegin(GL_QUADS); |
|
3696 | 654 |
if cStereoMode = smHorizontal then |
655 |
begin |
|
656 |
glTexCoord2f(0.0, 0.0); |
|
657 |
glVertex2d(0, cScreenHeight); |
|
658 |
glTexCoord2f(1.0, 0.0); |
|
659 |
glVertex2d(cScreenWidth / 2, cScreenHeight); |
|
660 |
glTexCoord2f(1.0, 1.0); |
|
661 |
glVertex2d(cScreenWidth / 2, 0); |
|
662 |
glTexCoord2f(0.0, 1.0); |
|
663 |
glVertex2d(0, 0); |
|
664 |
end |
|
665 |
else |
|
666 |
begin |
|
667 |
glTexCoord2f(0.0, 0.0); |
|
668 |
glVertex2d(cScreenWidth / -2, cScreenHeight); |
|
669 |
glTexCoord2f(1.0, 0.0); |
|
670 |
glVertex2d(cScreenWidth / 2, cScreenHeight); |
|
671 |
glTexCoord2f(1.0, 1.0); |
|
672 |
glVertex2d(cScreenWidth / 2, cScreenHeight / 2); |
|
673 |
glTexCoord2f(0.0, 1.0); |
|
674 |
glVertex2d(cScreenWidth / -2, cScreenHeight / 2); |
|
675 |
end; |
|
3692 | 676 |
glEnd(); |
677 |
SetScale(zoom); |
|
3696 | 678 |
end |
679 |
else |
|
680 |
begin |
|
681 |
// clear scene |
|
682 |
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
|
683 |
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); |
|
684 |
// draw left eye in red channel only |
|
685 |
if cStereoMode = smGreenRed then |
|
686 |
glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_TRUE) |
|
687 |
else if cStereoMode = smBlueRed then |
|
688 |
glColorMask(GL_FALSE, GL_FALSE, GL_TRUE, GL_TRUE) |
|
689 |
else if cStereoMode = smCyanRed then |
|
690 |
glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE) |
|
691 |
else |
|
692 |
glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE); |
|
693 |
DrawWorldStereo(Lag, rmLeftEye); |
|
694 |
// draw right eye in selected channel(s) only |
|
695 |
if cStereoMode = smRedGreen then |
|
696 |
glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_TRUE) |
|
697 |
else if cStereoMode = smRedBlue then |
|
698 |
glColorMask(GL_FALSE, GL_FALSE, GL_TRUE, GL_TRUE) |
|
699 |
else if cStereoMode = smRedCyan then |
|
700 |
glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE) |
|
701 |
else |
|
702 |
glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE); |
|
703 |
DrawWorldStereo(Lag, rmRightEye); |
|
704 |
end |
|
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
705 |
{$ENDIF} |
3692 | 706 |
end; |
707 |
||
708 |
procedure ChangeDepth(rm: TRenderMode; d: GLfloat); |
|
709 |
begin |
|
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
710 |
{$IFDEF S3D_DISABLED} |
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
711 |
exit; |
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
712 |
{$ELSE} |
3696 | 713 |
d:= d / 5; |
3692 | 714 |
if rm = rmDefault then exit |
3696 | 715 |
else if rm = rmLeftEye then d:= -d; |
3692 | 716 |
stereoDepth:= stereoDepth + d; |
717 |
glMatrixMode(GL_PROJECTION); |
|
718 |
glTranslatef(d, 0, 0); |
|
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
719 |
glMatrixMode(GL_MODELVIEW); |
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
720 |
{$ENDIF} |
3692 | 721 |
end; |
722 |
||
723 |
procedure ResetDepth(rm: TRenderMode); |
|
724 |
begin |
|
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
725 |
{$IFDEF S3D_DISABLED} |
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
726 |
exit; |
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
727 |
{$ELSE} |
3692 | 728 |
if rm = rmDefault then exit; |
729 |
glMatrixMode(GL_PROJECTION); |
|
730 |
glTranslatef(-stereoDepth, 0, 0); |
|
731 |
glMatrixMode(GL_MODELVIEW); |
|
732 |
stereoDepth:= 0; |
|
4347
0ddb100fea61
add a S3D_DISABLED symbol to disable/enable stereo rendering at compilation time
koda
parents:
4345
diff
changeset
|
733 |
{$ENDIF} |
3692 | 734 |
end; |
735 |
||
736 |
procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode); |
|
737 |
var i, t: LongInt; |
|
738 |
r: TSDL_Rect; |
|
739 |
tdx, tdy: Double; |
|
740 |
grp: TCapGroup; |
|
741 |
s: string[15]; |
|
742 |
highlight: Boolean; |
|
743 |
offset, offsetX, offsetY, screenBottom: LongInt; |
|
744 |
VertexBuffer: array [0..3] of TVertex2f; |
|
745 |
begin |
|
3611 | 746 |
if (cReducedQuality and rqNoBackground) = 0 then |
1812 | 747 |
begin |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
748 |
// Offsets relative to camera - spare them to wimpier cpus, no bg or flakes for them anyway |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
749 |
ScreenBottom:= (WorldDy - trunc(cScreenHeight/cScaleFactor) - (cScreenHeight div 2) + cWaterLine); |
4374 | 750 |
offsetY:= 10 * Min(0, -145 - ScreenBottom); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
751 |
SkyOffset:= offsetY div 35 + cWaveHeight; |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
752 |
HorizontOffset:= SkyOffset; |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
753 |
if ScreenBottom > SkyOffset then |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
754 |
HorizontOffset:= HorizontOffset + ((ScreenBottom-SkyOffset) div 20); |
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
755 |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
756 |
// background |
3688 | 757 |
ChangeDepth(RM, cStereo_Sky); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
758 |
DrawRepeated(sprSky, sprSkyL, sprSkyR, (WorldDx + LAND_WIDTH div 2) * 3 div 8, SkyOffset); |
3688 | 759 |
ChangeDepth(RM, -cStereo_Horizon); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
760 |
DrawRepeated(sprHorizont, sprHorizontL, sprHorizontR, (WorldDx + LAND_WIDTH div 2) * 3 div 5, HorizontOffset); |
3611 | 761 |
end; |
4 | 762 |
|
3611 | 763 |
DrawVisualGears(0); |
3697 | 764 |
|
3611 | 765 |
if (cReducedQuality and rq2DWater) = 0 then |
766 |
begin |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
767 |
// Waves |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
768 |
DrawWater(255, SkyOffset); |
3688 | 769 |
ChangeDepth(RM, -cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
770 |
DrawWaves( 1, 0 - WorldDx div 32, - cWaveHeight + offsetY div 35, 64); |
3688 | 771 |
ChangeDepth(RM, -cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
772 |
DrawWaves( -1, 25 + WorldDx div 25, - cWaveHeight + offsetY div 38, 48); |
3688 | 773 |
ChangeDepth(RM, -cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
774 |
DrawWaves( 1, 75 - WorldDx div 19, - cWaveHeight + offsetY div 45, 32); |
3688 | 775 |
ChangeDepth(RM, -cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
776 |
DrawWaves(-1, 100 + WorldDx div 14, - cWaveHeight + offsetY div 70, 24); |
3688 | 777 |
ResetDepth(RM); |
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
778 |
end |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
779 |
else |
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
780 |
DrawWaves(-1, 100, - (cWaveHeight + (cWaveHeight shr 1)), 0); |
4 | 781 |
|
3611 | 782 |
DrawLand(WorldDx, WorldDy); |
1911 | 783 |
|
3611 | 784 |
DrawWater(255, 0); |
4 | 785 |
|
1660 | 786 |
// Attack bar |
3611 | 787 |
if CurrentTeam <> nil then |
788 |
case AttackBar of |
|
1660 | 789 |
(* 1: begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
790 |
r:= StuffPoz[sPowerBar]; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
791 |
{$WARNINGS OFF} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
792 |
r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
793 |
{$WARNINGS ON} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
794 |
DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
795 |
end;*) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
796 |
2: with CurrentHedgehog^ do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
797 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
798 |
tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
799 |
tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
800 |
for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
801 |
DrawSprite(sprPower, |
4159
64e677349124
REmove stupid int64 conversions, provide real fixes to compiler hints
unc0rr
parents:
4132
diff
changeset
|
802 |
hwRound(Gear^.X) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + LongInt(round(WorldDx + tdx * (24 + i * 2))) - 16, |
64e677349124
REmove stupid int64 conversions, provide real fixes to compiler hints
unc0rr
parents:
4132
diff
changeset
|
803 |
hwRound(Gear^.Y) + GetLaunchY(CurAmmoType, Gear^.Angle) + LongInt(round(WorldDy + tdy * (24 + i * 2))) - 16, |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
804 |
i) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
805 |
end |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
806 |
end; |
1660 | 807 |
|
3611 | 808 |
DrawVisualGears(1); |
2713 | 809 |
|
3611 | 810 |
DrawGears; |
4 | 811 |
|
3611 | 812 |
DrawVisualGears(2); |
1045 | 813 |
|
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
814 |
if SuddenDeathDmg then |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
815 |
DrawWater(cSDWaterOpacity, 0) |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
816 |
else |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
817 |
DrawWater(cWaterOpacity, 0); |
2269
00f5704f5f39
add extra semi-opaque layer of water to discolour objects in the water.
nemo
parents:
2268
diff
changeset
|
818 |
|
3611 | 819 |
// Waves |
3688 | 820 |
ChangeDepth(RM, cStereo_Water); |
3611 | 821 |
DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 12); |
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
822 |
|
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
823 |
if (cReducedQuality and rq2DWater) = 0 then |
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
824 |
begin |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
825 |
//DrawWater(cWaterOpacity, - offsetY div 40); |
3688 | 826 |
ChangeDepth(RM, cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
827 |
DrawWaves(-1, 50 + WorldDx div 6, - cWaveHeight - offsetY div 40, 8); |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
828 |
if SuddenDeathDmg then |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
829 |
DrawWater(cSDWaterOpacity, - offsetY div 20) |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
830 |
else |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
831 |
DrawWater(cWaterOpacity, - offsetY div 20); |
3688 | 832 |
ChangeDepth(RM, cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
833 |
DrawWaves( 1, 75 - WorldDx div 4, - cWaveHeight - offsetY div 20, 2); |
4792
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
834 |
if SuddenDeathDmg then |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
835 |
DrawWater(cSDWaterOpacity, - offsetY div 10) |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
836 |
else |
68f9b331014a
sudden death changes: only change visual bit on health decrease and support for water transparancy change and clouds number change
Henek
parents:
4748
diff
changeset
|
837 |
DrawWater(cWaterOpacity, - offsetY div 10); |
3688 | 838 |
ChangeDepth(RM, cStereo_Water); |
3594
aeca3d8f1b29
turn cReducedQuality into a LongInt and provide a series of quality flags (and best of all, this is still compatible with current frontend)
koda
parents:
3582
diff
changeset
|
839 |
DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0); |
3688 | 840 |
ResetDepth(RM); |
3265
5fe62296fdea
- Parallax effect for horizont when water is out of sight
palewolf
parents:
3249
diff
changeset
|
841 |
end |
3611 | 842 |
else |
843 |
DrawWaves(-1, 50, - (cWaveHeight shr 1), 0); |
|
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
844 |
|
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
845 |
|
2288 | 846 |
{$WARNINGS OFF} |
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
847 |
// Target |
3104 | 848 |
if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
849 |
begin |
|
850 |
with PHedgehog(CurrentHedgehog)^ do |
|
851 |
begin |
|
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3811
diff
changeset
|
852 |
if (CurAmmoType = amBee) then |
3110 | 853 |
DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
854 |
else |
|
3104 | 855 |
DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
856 |
end; |
|
857 |
end; |
|
4 | 858 |
{$WARNINGS ON} |
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
859 |
|
3523 | 860 |
// this scale is used to keep the various widgets at the same dimension at all zoom levels |
861 |
SetScale(cDefaultZoomLevel); |
|
2724 | 862 |
|
863 |
||
864 |
// Turn time |
|
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2786
diff
changeset
|
865 |
{$IFDEF IPHONEOS} |
3025 | 866 |
offsetX:= cScreenHeight - 13; |
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2786
diff
changeset
|
867 |
{$ELSE} |
3025 | 868 |
offsetX:= 48; |
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2786
diff
changeset
|
869 |
{$ENDIF} |
3463 | 870 |
offsetY:= cOffsetY; |
3890
e4b7b30232fd
Extend time limit to 9999, remove ready timer if time is over 999 and stop drawing time if it is over 999 (draws wrong over 999 anyway) - this has the effect of allowing an "unlimited" time appearance if turns are over a quarter hour or so. This can be used to add an unlimited time scheme or button to ipad
nemo
parents:
3836
diff
changeset
|
871 |
if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then |
3774 | 872 |
begin |
873 |
if ReadyTimeLeft <> 0 then |
|
874 |
i:= Succ(Pred(ReadyTimeLeft) div 1000) |
|
875 |
else |
|
876 |
i:= Succ(Pred(TurnTimeLeft) div 1000); |
|
877 |
||
4 | 878 |
if i>99 then t:= 112 |
879 |
else if i>9 then t:= 96 |
|
880 |
else t:= 80; |
|
3463 | 881 |
DrawSprite(sprFrame, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, 1); |
4 | 882 |
while i > 0 do |
883 |
begin |
|
884 |
dec(t, 32); |
|
3463 | 885 |
DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10); |
4 | 886 |
i:= i div 10 |
887 |
end; |
|
3463 | 888 |
DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0); |
4 | 889 |
end; |
79 | 890 |
|
4 | 891 |
// Captions |
4393 | 892 |
DrawCaptions; |
4 | 893 |
|
47 | 894 |
// Teams Healths |
547 | 895 |
for t:= 0 to Pred(TeamsCount) do |
896 |
with TeamsArray[t]^ do |
|
47 | 897 |
begin |
2839 | 898 |
highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500); |
3697 | 899 |
|
2747 | 900 |
if highlight then |
4810 | 901 |
Tint(Clan^.Color shl 8 or $FF); |
2839 | 902 |
|
903 |
// draw name |
|
904 |
DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY, NameTagTex); |
|
3697 | 905 |
|
2839 | 906 |
// draw flag |
907 |
DrawTexture(-14, cScreenHeight + DrawHealthY, FlagTex); |
|
3697 | 908 |
|
2839 | 909 |
// draw health bar |
690 | 910 |
r.x:= 0; |
911 |
r.y:= 0; |
|
547 | 912 |
r.w:= 2 + TeamHealthBarWidth; |
764
7513452b1d51
Now game looks almost like it did before switching to OpenGL
unc0rr
parents:
762
diff
changeset
|
913 |
r.h:= HealthTex^.h; |
2747 | 914 |
DrawFromRect(14, cScreenHeight + DrawHealthY, @r, HealthTex); |
690 | 915 |
|
2839 | 916 |
// draw health bar's right border |
83 | 917 |
inc(r.x, cTeamHealthWidth + 2); |
918 |
r.w:= 3; |
|
2839 | 919 |
DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY, @r, HealthTex); |
3770 | 920 |
|
921 |
// draw ai kill counter for gfAISurvival |
|
922 |
if (GameFlags and gfAISurvival) <> 0 then begin |
|
923 |
DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY, |
|
3773 | 924 |
AIKillsTex); |
3770 | 925 |
end; |
926 |
||
2839 | 927 |
// if highlighted, draw flag and other contents again to keep their colors |
928 |
// this approach should be faster than drawing all borders one by one tinted or not |
|
929 |
if highlight then |
|
930 |
begin |
|
3390 | 931 |
Tint($FF, $FF, $FF, $FF); |
690 | 932 |
|
2839 | 933 |
// draw name |
2747 | 934 |
r.x:= 2; |
935 |
r.y:= 2; |
|
2839 | 936 |
r.w:= NameTagTex^.w - 4; |
937 |
r.h:= NameTagTex^.h - 4; |
|
938 |
DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + 2, @r, NameTagTex); |
|
939 |
// draw flag |
|
2747 | 940 |
r.w:= 22; |
941 |
r.h:= 15; |
|
942 |
DrawFromRect(-12, cScreenHeight + DrawHealthY + 2, @r, FlagTex); |
|
2839 | 943 |
// draw health bar |
944 |
r.w:= TeamHealthBarWidth + 1; |
|
945 |
r.h:= HealthTex^.h - 4; |
|
946 |
DrawFromRect(16, cScreenHeight + DrawHealthY + 2, @r, HealthTex); |
|
2747 | 947 |
end; |
47 | 948 |
end; |
949 |
||
5 | 950 |
// Lag alert |
2567 | 951 |
if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12); |
4 | 952 |
|
5 | 953 |
// Wind bar |
2567 | 954 |
{$IFDEF IPHONEOS} |
3405 | 955 |
offsetX:= cScreenHeight - 13; |
956 |
offsetY:= (cScreenWidth shr 1) + 74; |
|
2567 | 957 |
{$ELSE} |
3405 | 958 |
offsetX:= 30; |
959 |
offsetY:= 180; |
|
2567 | 960 |
{$ENDIF} |
3405 | 961 |
DrawSprite(sprWindBar, (cScreenWidth shr 1) - offsetY, cScreenHeight - offsetX, 0); |
962 |
if WindBarWidth > 0 then |
|
963 |
begin |
|
964 |
{$WARNINGS OFF} |
|
965 |
r.x:= 8 - (RealTicks shr 6) mod 8; |
|
966 |
{$WARNINGS ON} |
|
967 |
r.y:= 0; |
|
968 |
r.w:= WindBarWidth; |
|
969 |
r.h:= 13; |
|
970 |
DrawSpriteFromRect(sprWindR, r, (cScreenWidth shr 1) - offsetY + 77, cScreenHeight - offsetX + 2, 13, 0); |
|
971 |
end |
|
972 |
else |
|
973 |
if WindBarWidth < 0 then |
|
974 |
begin |
|
975 |
{$WARNINGS OFF} |
|
3407 | 976 |
r.x:= (Longword(WindBarWidth) + RealTicks shr 6) mod 8; |
3405 | 977 |
{$WARNINGS ON} |
978 |
r.y:= 0; |
|
979 |
r.w:= - WindBarWidth; |
|
980 |
r.h:= 13; |
|
981 |
DrawSpriteFromRect(sprWindL, r, (cScreenWidth shr 1) - offsetY + 74 + WindBarWidth, cScreenHeight - offsetX + 2, 13, 0); |
|
982 |
end; |
|
5 | 983 |
|
161 | 984 |
// AmmoMenu |
3434 | 985 |
if (AMxShift < AMWidth) or bShowAmmoMenu then ShowAmmoMenu; |
161 | 986 |
|
2287 | 987 |
// Cursor |
988 |
if isCursorVisible and bShowAmmoMenu then |
|
989 |
DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8); |
|
942 | 990 |
|
2287 | 991 |
DrawChat; |
4 | 992 |
|
2567 | 993 |
if fastUntilLag then DrawCentered(0, (cScreenHeight shr 1), SyncTexture); |
994 |
if isPaused then DrawCentered(0, (cScreenHeight shr 1), PauseTexture); |
|
3774 | 995 |
if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
996 |
begin |
3774 | 997 |
if (ReadyTimeLeft = 0) and (missionTimer > 0) then dec(missionTimer, Lag); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
998 |
if missionTimer < 0 then missionTimer:= 0; // avoid subtracting below 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
999 |
if missionTex <> nil then |
4374 | 1000 |
DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1001 |
end; |
2786 | 1002 |
|
2724 | 1003 |
// fps |
1004 |
{$IFDEF IPHONEOS} |
|
3463 | 1005 |
offsetX:= 8; |
2724 | 1006 |
{$ELSE} |
3463 | 1007 |
offsetX:= 10; |
2724 | 1008 |
{$ENDIF} |
3463 | 1009 |
offsetY:= cOffsetY; |
3696 | 1010 |
if (RM = rmDefault) or (RM = rmRightEye) then |
3692 | 1011 |
begin |
1012 |
inc(Frames); |
|
2850
f6f8db825ce7
A little clock for convenience in finding things in demos
nemo
parents:
2839
diff
changeset
|
1013 |
|
3692 | 1014 |
if cShowFPS or (GameType = gmtDemo) then |
1015 |
inc(CountTicks, Lag); |
|
1016 |
if (GameType = gmtDemo) and (CountTicks >= 1000) then |
|
1017 |
begin |
|
1018 |
i:=GameTicks div 1000; |
|
1019 |
t:= i mod 60; |
|
1020 |
s:= inttostr(t); |
|
1021 |
if t < 10 then s:= '0' + s; |
|
1022 |
i:= i div 60; |
|
1023 |
t:= i mod 60; |
|
1024 |
s:= inttostr(t) + ':' + s; |
|
1025 |
if t < 10 then s:= '0' + s; |
|
1026 |
s:= inttostr(i div 60) + ':' + s; |
|
3407 | 1027 |
|
3692 | 1028 |
if timeTexture <> nil then |
1029 |
FreeTexture(timeTexture); |
|
1030 |
timeTexture:= nil; |
|
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3483
diff
changeset
|
1031 |
|
3692 | 1032 |
tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels); |
1033 |
tmpSurface:= doSurfaceConversion(tmpSurface); |
|
1034 |
timeTexture:= Surface2Tex(tmpSurface, false); |
|
1035 |
SDL_FreeSurface(tmpSurface) |
|
1036 |
end; |
|
2850
f6f8db825ce7
A little clock for convenience in finding things in demos
nemo
parents:
2839
diff
changeset
|
1037 |
|
3692 | 1038 |
if timeTexture <> nil then |
1039 |
DrawTexture((cScreenWidth shr 1) - 20 - timeTexture^.w - offsetY, offsetX + timeTexture^.h+5, timeTexture); |
|
2850
f6f8db825ce7
A little clock for convenience in finding things in demos
nemo
parents:
2839
diff
changeset
|
1040 |
|
3692 | 1041 |
if cShowFPS then |
1042 |
begin |
|
1043 |
if CountTicks >= 1000 then |
|
1044 |
begin |
|
1045 |
FPS:= Frames; |
|
1046 |
Frames:= 0; |
|
1047 |
CountTicks:= 0; |
|
1048 |
s:= inttostr(FPS) + ' fps'; |
|
1049 |
if fpsTexture <> nil then |
|
1050 |
FreeTexture(fpsTexture); |
|
1051 |
fpsTexture:= nil; |
|
1052 |
tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels); |
|
1053 |
tmpSurface:= doSurfaceConversion(tmpSurface); |
|
1054 |
fpsTexture:= Surface2Tex(tmpSurface, false); |
|
1055 |
SDL_FreeSurface(tmpSurface) |
|
1056 |
end; |
|
1057 |
if fpsTexture <> nil then |
|
1058 |
DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture); |
|
1059 |
end; |
|
174 | 1060 |
|
3692 | 1061 |
if CountTicks >= 1000 then CountTicks:= 0; |
2850
f6f8db825ce7
A little clock for convenience in finding things in demos
nemo
parents:
2839
diff
changeset
|
1062 |
|
3692 | 1063 |
// lag warning (?) |
1064 |
inc(SoundTimerTicks, Lag); |
|
1065 |
end; |
|
1066 |
||
174 | 1067 |
if SoundTimerTicks >= 50 then |
1068 |
begin |
|
1069 |
SoundTimerTicks:= 0; |
|
1070 |
if cVolumeDelta <> 0 then |
|
1071 |
begin |
|
1072 |
str(ChangeVolume(cVolumeDelta), s); |
|
2619 | 1073 |
AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume) |
174 | 1074 |
end |
756 | 1075 |
end; |
1076 |
||
2724 | 1077 |
if GameState = gsConfirm then |
3025 | 1078 |
DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture); |
2161
0c8634241fa4
Some work on zooming. Hedgewars are now unplayable.
unc0rr
parents:
2152
diff
changeset
|
1079 |
|
3107 | 1080 |
if ScreenFade <> sfNone then |
1081 |
begin |
|
1082 |
if not isFirstFrame then |
|
1083 |
case ScreenFade of |
|
1084 |
sfToBlack, sfToWhite: if ScreenFadeValue + Lag * ScreenFadeSpeed < sfMax then |
|
1085 |
inc(ScreenFadeValue, Lag * ScreenFadeSpeed) |
|
1086 |
else |
|
3123 | 1087 |
ScreenFadeValue:= sfMax; |
3107 | 1088 |
sfFromBlack, sfFromWhite: if ScreenFadeValue - Lag * ScreenFadeSpeed > 0 then |
1089 |
dec(ScreenFadeValue, Lag * ScreenFadeSpeed) |
|
1090 |
else |
|
3123 | 1091 |
ScreenFadeValue:= 0; |
3107 | 1092 |
end; |
1093 |
if ScreenFade <> sfNone then |
|
1094 |
begin |
|
1095 |
case ScreenFade of |
|
3376 | 1096 |
sfToBlack, sfFromBlack: Tint(0, 0, 0, ScreenFadeValue * 255 div 1000); |
1097 |
sfToWhite, sfFromWhite: Tint($FF, $FF, $FF, ScreenFadeValue * 255 div 1000); |
|
3107 | 1098 |
end; |
3697 | 1099 |
|
3113 | 1100 |
VertexBuffer[0].X:= -cScreenWidth; |
1101 |
VertexBuffer[0].Y:= cScreenHeight; |
|
1102 |
VertexBuffer[1].X:= -cScreenWidth; |
|
1103 |
VertexBuffer[1].Y:= 0; |
|
1104 |
VertexBuffer[2].X:= cScreenWidth; |
|
1105 |
VertexBuffer[2].Y:= 0; |
|
1106 |
VertexBuffer[3].X:= cScreenWidth; |
|
1107 |
VertexBuffer[3].Y:= cScreenHeight; |
|
3697 | 1108 |
|
3376 | 1109 |
glDisable(GL_TEXTURE_2D); |
3641 | 1110 |
|
3113 | 1111 |
glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
1112 |
glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
3641 | 1113 |
|
3376 | 1114 |
glEnable(GL_TEXTURE_2D); |
3390 | 1115 |
Tint($FF, $FF, $FF, $FF); |
3123 | 1116 |
if not isFirstFrame and ((ScreenFadeValue = 0) or (ScreenFadeValue = sfMax)) then ScreenFade:= sfNone |
3107 | 1117 |
end |
1118 |
end; |
|
1119 |
||
3123 | 1120 |
SetScale(zoom); |
1121 |
||
1122 |
// Cursor |
|
1123 |
if isCursorVisible then |
|
1124 |
begin |
|
1125 |
if not bShowAmmoMenu then |
|
3204 | 1126 |
begin |
3123 | 1127 |
with CurrentHedgehog^ do |
3582
4debed8656d7
fix segfault on HH-gear being 0 (e.g. after drowning) in cursor/target selection mode, thanks "ivze" for the heads-up!
sheepluva
parents:
3580
diff
changeset
|
1128 |
if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then |
3123 | 1129 |
begin |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3811
diff
changeset
|
1130 |
i:= GetAmmoEntry(CurrentHedgehog^)^.Pos; |
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3811
diff
changeset
|
1131 |
with Ammoz[CurAmmoType] do |
3123 | 1132 |
if PosCount > 1 then |
3204 | 1133 |
DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i); |
3123 | 1134 |
end; |
3204 | 1135 |
DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) |
1136 |
end |
|
3123 | 1137 |
end; |
3107 | 1138 |
isFirstFrame:= false |
4 | 1139 |
end; |
1140 |
||
79 | 1141 |
procedure MoveCamera; |
2428 | 1142 |
var EdgesDist, wdy: LongInt; |
3638
33ee433749ba
touch overlay reworked, improvements to zoom and confirmation
koda
parents:
3629
diff
changeset
|
1143 |
PrevSentPointTime: LongWord = 0; |
4 | 1144 |
begin |
3551 | 1145 |
{$IFNDEF IPHONEOS} |
2970
011075f93746
Let's try this too (override following remote if in ammo menu)
nemo
parents:
2959
diff
changeset
|
1146 |
if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus then |
3551 | 1147 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1148 |
SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1149 |
CursorPoint.X:= CursorPoint.X - (cScreenWidth shr 1); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1150 |
CursorPoint.Y:= cScreenHeight - CursorPoint.Y; |
3551 | 1151 |
end; |
1152 |
{$ENDIF} |
|
678 | 1153 |
|
2762
2fbc8d35eb52
Mode to place hogs at start of game. Will probably need a bit more testing.
nemo
parents:
2747
diff
changeset
|
1154 |
if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1155 |
if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then |
3680 | 1156 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1157 |
FollowGear:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1158 |
prevPoint:= CursorPoint; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1159 |
exit |
3680 | 1160 |
end |
1161 |
else |
|
1162 |
begin |
|
2970
011075f93746
Let's try this too (override following remote if in ammo menu)
nemo
parents:
2959
diff
changeset
|
1163 |
CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100 + WorldDx) div 8; |
011075f93746
Let's try this too (override following remote if in ammo menu)
nemo
parents:
2959
diff
changeset
|
1164 |
CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + WorldDy)) div 8; |
3680 | 1165 |
end; |
4 | 1166 |
|
2375 | 1167 |
wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater; |
1168 |
if WorldDy < wdy then WorldDy:= wdy; |
|
1169 |
||
2197 | 1170 |
if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then exit; |
4 | 1171 |
|
3434 | 1172 |
if AMxShift < AMWidth then |
3680 | 1173 |
begin |
3463 | 1174 |
{$IFDEF IPHONEOS} |
3434 | 1175 |
if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth; |
1176 |
if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset; |
|
1177 |
if CursorPoint.Y < cScreenHeight - AMyOffset - SlotsNum * AMSlotSize then CursorPoint.Y:= cScreenHeight - AMyOffset - SlotsNum * AMSlotSize; |
|
1178 |
if CursorPoint.Y > cScreenHeight - AMyOffset then CursorPoint.Y:= cScreenHeight - AMyOffset; |
|
3463 | 1179 |
{$ELSE} |
3434 | 1180 |
if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth + AMSlotSize then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth + AMSlotSize; |
1181 |
if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset; |
|
1182 |
if CursorPoint.Y > AMyOffset + (SlotsNum + 1) * AMSlotSize then CursorPoint.Y:= AMyOffset + (SlotsNum + 1) * AMSlotSize; |
|
1183 |
if CursorPoint.Y < AMyOffset + AMSlotSize then CursorPoint.Y:= AMyOffset + AMSlotSize; |
|
3463 | 1184 |
{$ENDIF} |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1185 |
prevPoint:= CursorPoint; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1186 |
if cHasFocus then SDL_WarpMouse(CursorPoint.X + cScreenWidth div 2, cScreenHeight - CursorPoint.Y); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1187 |
exit |
3680 | 1188 |
end; |
162 | 1189 |
|
4 | 1190 |
if isCursorVisible then |
3680 | 1191 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1192 |
if (not CurrentTeam^.ExtDriven) and (GameTicks >= PrevSentPointTime + cSendCursorPosTime) then |
3680 | 1193 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1194 |
SendIPCXY('P', CursorPoint.X - WorldDx, cScreenHeight - CursorPoint.Y - WorldDy); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1195 |
PrevSentPointTime:= GameTicks |
3680 | 1196 |
end; |
1197 |
EdgesDist:= cCursorEdgesDist |
|
1198 |
end |
|
1199 |
else |
|
1200 |
EdgesDist:= cGearScrEdgesDist; |
|
1201 |
||
1202 |
// this generates the border around the screen that moves the camera when cursor is near it |
|
1203 |
if isCursorVisible or (FollowGear <> nil) then |
|
1204 |
begin |
|
1205 |
if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then |
|
1206 |
begin |
|
1207 |
WorldDx:= WorldDx - CursorPoint.X - cScreenWidth div 2 + EdgesDist; |
|
1208 |
CursorPoint.X:= - cScreenWidth div 2 + EdgesDist |
|
1209 |
end |
|
1210 |
else |
|
1211 |
if CursorPoint.X > cScreenWidth div 2 - EdgesDist then |
|
1212 |
begin |
|
1213 |
WorldDx:= WorldDx - CursorPoint.X + cScreenWidth div 2 - EdgesDist; |
|
1214 |
CursorPoint.X:= cScreenWidth div 2 - EdgesDist |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1215 |
end; |
3680 | 1216 |
if CursorPoint.Y < EdgesDist then |
1217 |
begin |
|
1218 |
WorldDy:= WorldDy + CursorPoint.Y - EdgesDist; |
|
1219 |
CursorPoint.Y:= EdgesDist |
|
1220 |
end |
|
1221 |
else |
|
1222 |
if CursorPoint.Y > cScreenHeight - EdgesDist then |
|
1223 |
begin |
|
1224 |
WorldDy:= WorldDy + CursorPoint.Y - cScreenHeight + EdgesDist; |
|
1225 |
CursorPoint.Y:= cScreenHeight - EdgesDist |
|
1226 |
end; |
|
1227 |
end |
|
1228 |
else |
|
1229 |
if cHasFocus then |
|
1230 |
begin |
|
1231 |
WorldDx:= WorldDx - CursorPoint.X + prevPoint.X; |
|
1232 |
WorldDy:= WorldDy + CursorPoint.Y - prevPoint.Y; |
|
1233 |
CursorPoint.X:= 0; |
|
1234 |
CursorPoint.Y:= cScreenHeight div 2; |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1235 |
end; |
351 | 1236 |
|
3680 | 1237 |
// this moves the camera according to CursorPoint X and Y |
4 | 1238 |
prevPoint:= CursorPoint; |
2567 | 1239 |
if cHasFocus then SDL_WarpMouse(CursorPoint.X + (cScreenWidth shr 1), cScreenHeight - CursorPoint.Y); |
1760 | 1240 |
if WorldDy > LAND_HEIGHT + 1024 then WorldDy:= LAND_HEIGHT + 1024; |
2375 | 1241 |
if WorldDy < wdy then WorldDy:= wdy; |
2426 | 1242 |
if WorldDx < - LAND_WIDTH - 1024 then WorldDx:= - LAND_WIDTH - 1024; |
1243 |
if WorldDx > 1024 then WorldDx:= 1024; |
|
4 | 1244 |
end; |
1245 |
||
2905 | 1246 |
procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt); |
2786 | 1247 |
var r: TSDL_Rect; |
1248 |
begin |
|
1249 |
r.w:= 32; |
|
1250 |
r.h:= 32; |
|
1251 |
||
1252 |
if time = 0 then time:= 5000; |
|
1253 |
missionTimer:= time; |
|
3697 | 1254 |
if missionTex <> nil then |
3513
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3483
diff
changeset
|
1255 |
FreeTexture(missionTex); |
f589230fa21b
now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents:
3483
diff
changeset
|
1256 |
missionTex:= nil; |
2786 | 1257 |
|
1258 |
if icon > -1 then |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1259 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1260 |
r.x:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1261 |
r.y:= icon * 32; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1262 |
missionTex:= RenderHelpWindow(caption, subcaption, text, '', 0, MissionIcons, @r) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1263 |
end |
2786 | 1264 |
else |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1265 |
begin |
4626
775f43e90383
fixed showmission so it actually displays the right icons
Henek
parents:
4482
diff
changeset
|
1266 |
r.x:= ((-icon - 1) shr 4) * 32; |
775f43e90383
fixed showmission so it actually displays the right icons
Henek
parents:
4482
diff
changeset
|
1267 |
r.y:= ((-icon - 1) mod 16) * 32; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1268 |
missionTex:= RenderHelpWindow(caption, subcaption, text, '', 0, SpritesData[sprAMAmmos].Surface, @r) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1269 |
end; |
2786 | 1270 |
end; |
1271 |
||
1272 |
procedure HideMission; |
|
1273 |
begin |
|
3045 | 1274 |
missionTimer:= 0; |
1275 |
if missionTex <> nil then FreeTexture(missionTex); |
|
2786 | 1276 |
end; |
1277 |
||
3032 | 1278 |
procedure ShakeCamera(amount: LongWord); |
1279 |
begin |
|
4374 | 1280 |
amount:= Max(1, amount); |
3032 | 1281 |
WorldDx:= WorldDx - amount + LongInt(getRandom(1 + amount * 2)); |
1282 |
WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2)); |
|
1283 |
end; |
|
1284 |
||
3038 | 1285 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2682
diff
changeset
|
1286 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1287 |
fpsTexture:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1288 |
FollowGear:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1289 |
WindBarWidth:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1290 |
bShowAmmoMenu:= false; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1291 |
bSelected:= false; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1292 |
bShowFinger:= false; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1293 |
Frames:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1294 |
WorldDx:= -512; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1295 |
WorldDy:= -256; |
3697 | 1296 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1297 |
FPS:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1298 |
CountTicks:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1299 |
SoundTimerTicks:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1300 |
prevPoint.X:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1301 |
prevPoint.Y:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2931
diff
changeset
|
1302 |
missionTimer:= 0; |
3240 | 1303 |
missionTex:= nil; |
3463 | 1304 |
cOffsetY:= 0; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2682
diff
changeset
|
1305 |
end; |
4 | 1306 |
|
3038 | 1307 |
procedure freeModule; |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
1308 |
begin |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
1309 |
end; |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2713
diff
changeset
|
1310 |
|
4 | 1311 |
end. |