hedgewars/uVisualGears.pas
changeset 5748 70d7f8e40f53
parent 5690 f6e0c5bd8020
child 5800 3a04c30e5ac7
equal deleted inserted replaced
5747:65006a679352 5748:70d7f8e40f53
   315   vgtBulletHit: begin
   315   vgtBulletHit: begin
   316                 dx:= 0;
   316                 dx:= 0;
   317                 dy:= 0;
   317                 dy:= 0;
   318                 FrameTicks:= 350;
   318                 FrameTicks:= 350;
   319                 Frame:= 7;
   319                 Frame:= 7;
   320                 Angle := 0;
   320                 Angle:= 0;
   321                 end;
   321                 end;
   322 vgtSmoothWindBar: Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   322 vgtSmoothWindBar: Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   323  vgtStraightShot: begin
   323  vgtStraightShot: begin
       
   324                 Scale:= 1.0;
   324                 dx:= 0.001 * random(45);
   325                 dx:= 0.001 * random(45);
   325                 dy:= 0.001 * (random(20) + 25);
   326                 dy:= 0.001 * (random(20) + 25);
   326                 State:= ord(sprHealth);
   327                 State:= ord(sprHealth);
   327                 if random(2) = 0 then dx := -dx;
   328                 if random(2) = 0 then dx := -dx;
   328                 Frame:= 0;
   329                 Frame:= 0;
   492 
   493 
   493 procedure DrawVisualGears(Layer: LongWord);
   494 procedure DrawVisualGears(Layer: LongWord);
   494 var Gear: PVisualGear;
   495 var Gear: PVisualGear;
   495     tinted: boolean;
   496     tinted: boolean;
   496     tmp: real;
   497     tmp: real;
       
   498     i: LongInt;
   497 begin
   499 begin
   498 case Layer of
   500 case Layer of
   499     // this layer is very distant in the background when stereo
   501     // this layer is very distant in the background when stereo
   500     0: begin
   502     0: begin
   501        Gear:= VisualGearsLayer0;
   503        Gear:= VisualGearsLayer0;
   590                                    if Gear^.Angle = 0 then DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex)
   592                                    if Gear^.Angle = 0 then DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex)
   591                                    else DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); 
   593                                    else DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); 
   592                                    SetScale(zoom)
   594                                    SetScale(zoom)
   593                                    end
   595                                    end
   594                                end;
   596                                end;
   595     //if Ger^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   597                vgtStraightShot: begin 
   596                vgtStraightShot: DrawRotatedF(TSprite(Gear^.State), round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   598                                 if Gear^.dX < 0 then i:= -1 else i:= 1;
       
   599                                 DrawTextureF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height);
       
   600                                 end;
   597            end;
   601            end;
   598            if (cReducedQuality and rqAntiBoom) = 0 then
   602            if (cReducedQuality and rqAntiBoom) = 0 then
   599                case Gear^.Kind of
   603                case Gear^.Kind of
   600                    vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   604                    vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   601                end;
   605                end;