hedgewars/uWorld.pas
changeset 3025 01682ec58eb0
parent 2999 30c4d62cd0c3
child 3032 9c190d3c165b
equal deleted inserted replaced
3024:bcbd910c797f 3025:01682ec58eb0
   514 SetScale(scale);
   514 SetScale(scale);
   515 
   515 
   516 
   516 
   517 // Turn time
   517 // Turn time
   518 {$IFDEF IPHONEOS}
   518 {$IFDEF IPHONEOS}
   519 offset:= 313;
   519 offsetX:= cScreenHeight - 13;
   520 {$ELSE}
   520 {$ELSE}
   521 offset:= 48;
   521 offsetX:= 48;
   522 {$ENDIF}
   522 {$ENDIF}
   523 if TurnTimeLeft <> 0 then
   523 if TurnTimeLeft <> 0 then
   524    begin
   524    begin
   525    i:= Succ(Pred(TurnTimeLeft) div 1000);
   525    i:= Succ(Pred(TurnTimeLeft) div 1000);
   526    if i>99 then t:= 112
   526    if i>99 then t:= 112
   527       else if i>9 then t:= 96
   527       else if i>9 then t:= 96
   528                   else t:= 80;
   528                   else t:= 80;
   529    DrawSprite(sprFrame, -cScreenWidth div 2 + t, cScreenHeight - offset, 1);
   529    DrawSprite(sprFrame, -(cScreenWidth shr 1) + t, cScreenHeight - offsetX, 1);
   530    while i > 0 do
   530    while i > 0 do
   531          begin
   531          begin
   532          dec(t, 32);
   532          dec(t, 32);
   533          DrawSprite(sprBigDigit, -cScreenWidth div 2 + t, cScreenHeight - offset, i mod 10);
   533          DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t, cScreenHeight - offsetX, i mod 10);
   534          i:= i div 10
   534          i:= i div 10
   535          end;
   535          end;
   536    DrawSprite(sprFrame, -cScreenWidth div 2 + t - 4, cScreenHeight - offset, 0);
   536    DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4, cScreenHeight - offsetX, 0);
   537    end;
   537    end;
   538 
   538 
   539 {$IFNDEF IPHONEOS}
   539 {$IFNDEF IPHONEOS}
   540 // Timetrial
   540 // Timetrial
   541 if ((TrainingFlags and tfTimeTrial) <> 0) and (TimeTrialStartTime > 0) then
   541 if ((TrainingFlags and tfTimeTrial) <> 0) and (TimeTrialStartTime > 0) then
   603                     EndTime:= 0
   603                     EndTime:= 0
   604                 end;
   604                 end;
   605             end;
   605             end;
   606 
   606 
   607 // Teams Healths
   607 // Teams Healths
   608 
       
   609 for t:= 0 to Pred(TeamsCount) do
   608 for t:= 0 to Pred(TeamsCount) do
   610    with TeamsArray[t]^ do
   609    with TeamsArray[t]^ do
   611       begin
   610       begin
   612       highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
   611       highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
   613       
   612       
   657 // Lag alert
   656 // Lag alert
   658 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
   657 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
   659 
   658 
   660 // Wind bar
   659 // Wind bar
   661 {$IFDEF IPHONEOS}
   660 {$IFDEF IPHONEOS}
   662 offsetX:= 305;
   661 offsetX:= cScreenHeight - 13;
   663 offsetY:= 315;
   662 offsetY:= (cScreenWidth shr 1) + 74;
   664 {$ELSE}
   663 {$ELSE}
   665 offsetX:= 30;
   664 offsetX:= 30;
   666 offsetY:= 180;
   665 offsetY:= 180;
   667 {$ENDIF}
   666 {$ENDIF}
   668 DrawSprite(sprWindBar, (cScreenWidth shr 1) - offsetY, cScreenHeight - offsetX, 0);
   667 DrawSprite(sprWindBar, (cScreenWidth shr 1) - offsetY, cScreenHeight - offsetX, 0);
   707         DrawCentered(0, min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
   706         DrawCentered(0, min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
   708     end;
   707     end;
   709 
   708 
   710 // fps
   709 // fps
   711 {$IFDEF IPHONEOS}
   710 {$IFDEF IPHONEOS}
   712 offset:= 300;
   711 offset:= 8;
   713 {$ELSE}
   712 {$ELSE}
   714 offset:= 10;
   713 offset:= 10;
   715 {$ENDIF}
   714 {$ENDIF}
   716 inc(Frames);
   715 inc(Frames);
   717 
   716 
   766       AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume)
   765       AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume)
   767       end
   766       end
   768    end;
   767    end;
   769 
   768 
   770 if GameState = gsConfirm then
   769 if GameState = gsConfirm then
   771     DrawCentered(0, cScreenHeight div 2, ConfirmTexture);
   770     DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
   772 
   771 
   773 SetScale(zoom);
   772 SetScale(zoom);
   774 
   773 
   775 // Cursor
   774 // Cursor
   776 if isCursorVisible then
   775 if isCursorVisible then
   780        if (Gear^.State and gstHHChooseTarget) <> 0 then
   779        if (Gear^.State and gstHHChooseTarget) <> 0 then
   781          begin
   780          begin
   782          i:= Ammo^[CurSlot, CurAmmo].Pos;
   781          i:= Ammo^[CurSlot, CurAmmo].Pos;
   783          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
   782          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
   784            if PosCount > 1 then
   783            if PosCount > 1 then
   785               DrawSprite(PosSprite, CursorPoint.X - SpritesData[PosSprite].Width div 2,
   784               DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1),
   786                                     cScreenHeight - CursorPoint.Y - SpritesData[PosSprite].Height div 2,
   785                                     cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),
   787                                     i);
   786                                     i);
   788          end;
   787          end;
   789    DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   788    DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   790    end;
   789    end;
   791 
   790 
   921     end;
   920     end;
   922 end;
   921 end;
   923 
   922 
   924 procedure HideMission;
   923 procedure HideMission;
   925 begin
   924 begin
   926 missionTimer:= 0
   925     missionTimer:= 0
   927 end;
   926 end;
   928 
   927 
   929 procedure init_uWorld;
   928 procedure init_uWorld;
   930 begin
   929 begin
   931     fpsTexture:= nil;
   930     fpsTexture:= nil;
   948     FillChar(Captions, sizeof(Captions), 0)
   947     FillChar(Captions, sizeof(Captions), 0)
   949 end;
   948 end;
   950 
   949 
   951 procedure free_uWorld;
   950 procedure free_uWorld;
   952 begin
   951 begin
   953 if missionTex <> nil then FreeTexture(missionTex);
   952     if missionTex <> nil then FreeTexture(missionTex);
   954 end;
   953 end;
   955 
   954 
   956 end.
   955 end.