equal
deleted
inserted
replaced
18 |
18 |
19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uVisualGears; |
21 unit uVisualGears; |
22 interface |
22 interface |
23 uses SDLh, uConsts, uFloat, Math, GLunit; |
23 uses uConsts, uFloat, Math, GLunit; |
24 |
24 |
25 type PVisualGear = ^TVisualGear; |
25 type PVisualGear = ^TVisualGear; |
26 TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword); |
26 TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword); |
27 TVisualGear = record |
27 TVisualGear = record |
28 NextGear, PrevGear: PVisualGear; |
28 NextGear, PrevGear: PVisualGear; |
373 if (Gear^.Timer and 15) = 0 then |
373 if (Gear^.Timer and 15) = 0 then |
374 for i:= 0 to Pred(TeamsCount) do |
374 for i:= 0 to Pred(TeamsCount) do |
375 with thexchar[i] do |
375 with thexchar[i] do |
376 begin |
376 begin |
377 {$WARNINGS OFF} |
377 {$WARNINGS OFF} |
378 team^.DrawHealthY:= ny + dy * Gear^.Timer div 640; |
378 team^.DrawHealthY:= ny + dy * LongInt(Gear^.Timer div 640); |
379 team^.TeamHealthBarWidth:= team^.NewTeamHealthBarWidth + dw * Gear^.Timer div cSorterWorkTime; |
379 team^.TeamHealthBarWidth:= team^.NewTeamHealthBarWidth + dw * LongInt(Gear^.Timer div cSorterWorkTime); |
380 {$WARNINGS ON} |
380 {$WARNINGS ON} |
381 end; |
381 end; |
382 |
382 |
383 if (Gear^.Timer = 0) or (currsorter <> Gear) then |
383 if (Gear^.Timer = 0) or (currsorter <> Gear) then |
384 begin |
384 begin |
392 procedure doStepTeamHealthSorter(Gear: PVisualGear; Steps: Longword); |
392 procedure doStepTeamHealthSorter(Gear: PVisualGear; Steps: Longword); |
393 var i: Longword; |
393 var i: Longword; |
394 b: boolean; |
394 b: boolean; |
395 t: LongInt; |
395 t: LongInt; |
396 begin |
396 begin |
|
397 Steps:= Steps; // avoid compiler hint |
397 for t:= 0 to Pred(TeamsCount) do |
398 for t:= 0 to Pred(TeamsCount) do |
398 with thexchar[t] do |
399 with thexchar[t] do |
399 begin |
400 begin |
400 dy:= TeamsArray[t]^.DrawHealthY; |
401 dy:= TeamsArray[t]^.DrawHealthY; |
401 dw:= TeamsArray[t]^.TeamHealthBarWidth - TeamsArray[t]^.NewTeamHealthBarWidth; |
402 dw:= TeamsArray[t]^.TeamHealthBarWidth - TeamsArray[t]^.NewTeamHealthBarWidth; |
451 end; |
452 end; |
452 end; |
453 end; |
453 |
454 |
454 procedure doStepSpeechBubble(Gear: PVisualGear; Steps: Longword); |
455 procedure doStepSpeechBubble(Gear: PVisualGear; Steps: Longword); |
455 begin |
456 begin |
|
457 Steps:= Steps; // avoid compiler hint |
|
458 |
456 with PHedgehog(Gear^.Hedgehog)^ do |
459 with PHedgehog(Gear^.Hedgehog)^ do |
457 if SpeechGear <> nil then SpeechGear^.Timer:= 0; |
460 if SpeechGear <> nil then SpeechGear^.Timer:= 0; |
458 |
461 |
459 PHedgehog(Gear^.Hedgehog)^.SpeechGear:= Gear; |
462 PHedgehog(Gear^.Hedgehog)^.SpeechGear:= Gear; |
460 |
463 |