- Fixed slow sprite blt
authorunc0rr
Tue, 27 Dec 2005 10:19:21 +0000
changeset 30 794e98e11b66
parent 29 9311259d5242
child 31 99888245a4e8
- Fixed slow sprite blt - More and better land templates
hedgewars/uLandObjects.pas
hedgewars/uLandTemplates.pas
hedgewars/uStore.pas
--- a/hedgewars/uLandObjects.pas	Fri Dec 23 23:14:31 2005 +0000
+++ b/hedgewars/uLandObjects.pas	Tue Dec 27 10:19:21 2005 +0000
@@ -145,7 +145,7 @@
        inc(x2, 2)
      until (x2 > 1900) or (k = 0) or (k = 16) or (x2 > i);
      if (x2 < 1900) and (k = 16) and (x2 - x1 > 250)
-        and not CheckIntersect(x1, y, x2 - x1, 16) then break;
+        and not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144) then break;
      end;
 x1:= 0;
 until y > 900;
@@ -166,7 +166,7 @@
    r.h:= 16;
    SDL_UpperBlit(tmpsurf, @r, Surface, @rr);
    SDL_FreeSurface(tmpsurf);
-   AddRect(x1 - 8, y - 8, x2 - x1 + 16, 72);
+   AddRect(x1 - 8, y - 32, x2 - x1 + 16, 80);
    for k:= y to y + 15 do
        for i:= x1 to x2 do Land[k, i]:= $FFFFFF
    end else Result:= false
--- a/hedgewars/uLandTemplates.pas	Fri Dec 23 23:14:31 2005 +0000
+++ b/hedgewars/uLandTemplates.pas	Tue Dec 27 10:19:21 2005 +0000
@@ -30,12 +30,18 @@
        (x: 1023; y: 1023)
       );
 
-const Template1Points: array[0..6] of TPoint =
+const Template1Points: array[0..12] of TPoint =
       (
        (x:  300; y: 1500),
        (x:  300; y: 1000),
        (x:  250; y:  750),
+       (x:  550; y:  480),
+       (x:  650; y:  780),
+       (x:  810; y:  780),
+       (x:  800; y:  500),
        (x: 1200; y:  500),
+       (x: 1300; y:  800),
+       (x: 1500; y:  500),
        (x: 1800; y:  750),
        (x: 1750; y: 1000),
        (x: 1750; y: 1500)
@@ -45,7 +51,7 @@
        (x: 1023; y: 1023)
       );
 
-const Template2Points: array[0..21] of TPoint =
+const Template2Points: array[0..28] of TPoint =
       (
        (x:  350; y: 1500),
        (x:  350; y: 1000),
@@ -54,21 +60,28 @@
        (x:  520; y:  450),
        (x:  190; y:  600),
        (x:  210; y:  260),
-       (x: 1650; y:  220),
-       (x: 1650; y:  460),
-       (x:  900; y:  410),
+       (x:  800; y:  310),
+       (x: 1350; y:  220),
+       (x: 1250; y:  360),
+       (x: 1550; y:  520),
+       (x: 1100; y:  400),
+       (x:  900; y:  470),
        (x:  650; y:  400),
+       (x:  900; y:  750),
+       (x:  600; y:  750),
+       (x:  600; y:  850),
+       (x: 1100; y:  900),
        (x: 1200; y: 1000),
-       (x: 1200; y: 1200),
-       (x: 1400; y: 1200),
+       (x: 1200; y: 1300),
+       (x: 1400; y: 1300),
        (x: 1400; y: 1000),
-       (x: 1280; y:  750),
-       (x: 1150; y:  530),
-       (x: 1700; y:  750),
+       (x: 1280; y:  850),
+       (x: 1150; y:  630),
+       (x: 1600; y:  850),
        (x: 1800; y:  600),
        (x: 1900; y:  600),
        (x: 1700; y: 1010),
-       (x: 1700; y: 1200)
+       (x: 1700; y: 1500)
       );
       Template2FPoints: array[0..1] of TPoint =
       (
@@ -156,8 +169,27 @@
        (x:  500; y: 1023),
        (x: 1500; y: 1023)
       );
+    
+const Template5Points: array[0..10] of TPoint =
+      (
+       (x:  225; y: 1260),
+       (x:  254; y:  226),
+       (x:  729; y:  238),
+       (x:  658; y:  441),
+       (x:  661; y:  651),
+       (x: 1023; y:  759),
+       (x: 1374; y:  648),
+       (x: 1473; y:  285),
+       (x: 1803; y:  207),
+       (x: 1839; y:  801),
+       (x: 1674; y: 1239)
+      );
+      Template5FPoints: array[0..0] of TPoint =
+      (
+       (x: 1023; y: 1023)
+      );
 
-const EdgeTemplates: array[0..4] of TEdgeTemplate =
+const EdgeTemplates: array[0..5] of TEdgeTemplate =
       (
        (BasePoints: @Template0Points;
         BasePointsCount: Succ(High(Template0Points));
@@ -171,7 +203,7 @@
        ),
        (BasePoints: @Template1Points;
         BasePointsCount: Succ(High(Template1Points));
-        BezPassCnt: 4;
+        BezPassCnt: 3;
         PassMin: 10; PassDelta: 2;
         WaveAmplMin:    25; WaveAmplDelta: 15;
         WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
@@ -208,9 +240,22 @@
         FillPoints: @Template4FPoints;
         FillPointsCount: Succ(High(Template4FPoints));
         canMirror: true; canFlip: false;
+       ),       
+       (BasePoints: @Template5Points;
+        BasePointsCount: Succ(High(Template5Points));
+        BezPassCnt: 4;
+        PassMin: 15; PassDelta: 1;
+        WaveAmplMin:    15; WaveAmplDelta: 14;
+        WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
+        FillPoints: @Template5FPoints;
+        FillPointsCount: Succ(High(Template5FPoints));
+        canMirror: true; canFlip: false;
        )
+       
       );
 
+
+
 implementation
 
 end.
--- a/hedgewars/uStore.pas	Fri Dec 23 23:14:31 2005 +0000
+++ b/hedgewars/uStore.pas	Tue Dec 27 10:19:21 2005 +0000
@@ -539,7 +539,7 @@
 end;
 
 procedure RenderHealth(var Hedgehog: THedgehog);
-var s: string;
+var s: string[15];
 begin
 str(Hedgehog.Gear.Health, s);
 Hedgehog.HealthRect:= WriteInRoundRect(TempSurface, Hedgehog.HealthRect.x, Hedgehog.HealthRect.y, Hedgehog.Team.Color, fnt16, s);
@@ -584,10 +584,16 @@
 end;
 
 function  LoadImage(filename: string): PSDL_Surface;
+var tmpsurf: PSDL_Surface;
 begin
 WriteToConsole(msgLoading + filename + '... ');
-Result:= IMG_Load(PChar(filename));
-TryDo(Result <> nil, msgFailed, true);
+tmpsurf:= IMG_Load(PChar(filename));
+TryDo(tmpsurf <> nil, msgFailed, true);
+if cFullScreen then
+   begin
+   Result:= SDL_DisplayFormat(tmpsurf);
+   SDL_FreeSurface(tmpsurf);
+   end else Result:= tmpsurf;
 WriteLnToConsole(msgOK)
 end;