hedgewars/uWorld.pas
changeset 3123 b0a02930a1dc
parent 3113 2829ea0dd47c
child 3129 81abbf6eab4a
equal deleted inserted replaced
3122:e005359efc59 3123:b0a02930a1dc
   800    end;
   800    end;
   801 
   801 
   802 if GameState = gsConfirm then
   802 if GameState = gsConfirm then
   803     DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
   803     DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
   804 
   804 
   805 SetScale(zoom);
       
   806 
       
   807 // Cursor
       
   808 if isCursorVisible then
       
   809    begin
       
   810    if not bShowAmmoMenu then
       
   811      with CurrentHedgehog^ do
       
   812        if (Gear^.State and gstHHChooseTarget) <> 0 then
       
   813          begin
       
   814          i:= Ammo^[CurSlot, CurAmmo].Pos;
       
   815          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
       
   816            if PosCount > 1 then
       
   817               DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1),
       
   818                                     cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),
       
   819                                     i);
       
   820          end;
       
   821    DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
       
   822    end;
       
   823 
       
   824 glDisable(GL_TEXTURE_2D);
   805 glDisable(GL_TEXTURE_2D);
   825 
   806 
   826 if ScreenFade <> sfNone then
   807 if ScreenFade <> sfNone then
   827     begin
   808     begin
   828     if not isFirstFrame then
   809     if not isFirstFrame then
   829         case ScreenFade of
   810         case ScreenFade of
   830             sfToBlack, sfToWhite:     if ScreenFadeValue + Lag * ScreenFadeSpeed < sfMax then
   811             sfToBlack, sfToWhite:     if ScreenFadeValue + Lag * ScreenFadeSpeed < sfMax then
   831                                           inc(ScreenFadeValue, Lag * ScreenFadeSpeed)
   812                                           inc(ScreenFadeValue, Lag * ScreenFadeSpeed)
   832                                       else
   813                                       else
   833                                           ScreenFade:= sfNone;
   814                                           ScreenFadeValue:= sfMax;
   834             sfFromBlack, sfFromWhite: if ScreenFadeValue - Lag * ScreenFadeSpeed > 0 then
   815             sfFromBlack, sfFromWhite: if ScreenFadeValue - Lag * ScreenFadeSpeed > 0 then
   835                                           dec(ScreenFadeValue, Lag * ScreenFadeSpeed)
   816                                           dec(ScreenFadeValue, Lag * ScreenFadeSpeed)
   836                                       else
   817                                       else
   837                                           ScreenFade:= sfNone;
   818                                           ScreenFadeValue:= 0;
   838             end;
   819             end;
   839     if ScreenFade <> sfNone then
   820     if ScreenFade <> sfNone then
   840         begin
   821         begin
   841         case ScreenFade of
   822         case ScreenFade of
   842             sfToBlack, sfFromBlack: glColor4f(0, 0, 0, ScreenFadeValue / 1000);
   823             sfToBlack, sfFromBlack: glColor4f(0, 0, 0, ScreenFadeValue / 1000);
   856         glEnableClientState(GL_VERTEX_ARRAY);
   837         glEnableClientState(GL_VERTEX_ARRAY);
   857         glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
   838         glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
   858         glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
   839         glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
   859         glDisableClientState(GL_VERTEX_ARRAY);
   840         glDisableClientState(GL_VERTEX_ARRAY);
   860          
   841          
   861         glColor4f(1, 1, 1, 1)
   842         glColor4f(1, 1, 1, 1);
       
   843         if not isFirstFrame and ((ScreenFadeValue = 0) or (ScreenFadeValue = sfMax)) then ScreenFade:= sfNone
   862         end
   844         end
   863     end;
   845     end;
   864 
   846 
       
   847 SetScale(zoom);
       
   848 glEnable(GL_TEXTURE_2D);
       
   849 
       
   850 // Cursor
       
   851 if isCursorVisible then
       
   852    begin
       
   853    if not bShowAmmoMenu then
       
   854      with CurrentHedgehog^ do
       
   855        if (Gear^.State and gstHHChooseTarget) <> 0 then
       
   856          begin
       
   857          i:= Ammo^[CurSlot, CurAmmo].Pos;
       
   858          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
       
   859            if PosCount > 1 then
       
   860               DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1),
       
   861                                     cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),
       
   862                                     i);
       
   863          end;
       
   864    DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
       
   865    end;
       
   866 
       
   867 glDisable(GL_TEXTURE_2D);
   865 glDisable(GL_BLEND);
   868 glDisable(GL_BLEND);
   866 isFirstFrame:= false
   869 isFirstFrame:= false
   867 end;
   870 end;
   868 
   871 
   869 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
   872 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);