- Two more templates
authorunc0rr
Tue, 23 Jan 2007 21:24:18 +0000
changeset 360 ab6a94334d6d
parent 359 59fbfc65fbda
child 361 c3eebac100c0
- Two more templates - Fix clouds regression - Remove Delphi from the list of compilers - Set version to 0.9.0
CMakeLists.txt
hedgewars/CMakeLists.txt
hedgewars/uGears.pas
hedgewars/uLand.pas
hedgewars/uLandTemplates.pas
--- a/CMakeLists.txt	Tue Jan 23 18:54:09 2007 +0000
+++ b/CMakeLists.txt	Tue Jan 23 21:24:18 2007 +0000
@@ -19,8 +19,8 @@
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a turn-based strategy")
 set(CPACK_PACKAGE_VENDOR "Hedgewars")
 set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "8")
-set(CPACK_PACKAGE_VERSION_PATCH "1")
+set(CPACK_PACKAGE_VERSION_MINOR "9")
+set(CPACK_PACKAGE_VERSION_PATCH "0")
 set(CPACK_PACKAGE_FILE_NAME "hedgewars-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "hedgewars")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
--- a/hedgewars/CMakeLists.txt	Tue Jan 23 18:54:09 2007 +0000
+++ b/hedgewars/CMakeLists.txt	Tue Jan 23 21:24:18 2007 +0000
@@ -1,7 +1,6 @@
 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in 
 	${hedgewars_SOURCE_DIR}/hedgewars/proto.inc) 
 
-set(dcc32_tryexe "delphi!doesnt!work.exe")
 set(fpc_tryexe fpc)
 set(hwengine_project "hwengine.dpr")
 
@@ -42,36 +41,25 @@
 	tunsetborder.inc
 	)
 
-find_program(dcc32_executable ${dcc32_tryexe})
 find_program(fpc_executable ${fpc_tryexe})
 
-if (dcc32_executable)
-	 exec_program(${dcc32_executable} ARGS "--version" OUTPUT_VARIABLE dcc32_output)
-endif (dcc32_executable)
-
 if (fpc_executable)
 	 exec_program(${fpc_executable} ARGS "-h" OUTPUT_VARIABLE fpc_output)
 endif (fpc_executable)
 
-string(REGEX MATCH "[0-9]+\\.[0-9]+" dcc32version "${dcc32_output}")
-if (dcc32version)
-	set(pascal_compiler ${dcc32_executable})
-	set(pascal_compiler_flags "-B" "-va" "-W" "-E${EXECUTABLE_OUTPUT_PATH}" ${hwengine_project})
-else (dcc32version)
-	string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
-	if (fpc_version)
-		string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
-		string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
-		string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
-		math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
-		if (fpc_ver LESS "010904")
-			message("Minimum required version of FreePascal is 1.9.4")
-		else (fpc_ver LESS "010904")
-			set(pascal_compiler ${fpc_executable})
-			set(pascal_compiler_flags "-B" "-FE../bin" "-Cs2000000" "-O2" ${hwengine_project})
-		endif (fpc_ver LESS "010904")
-	endif (fpc_version)
-endif (dcc32version)
+string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
+if (fpc_version)
+	string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
+	string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
+	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
+	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
+	if (fpc_ver LESS "010904")
+		message("Minimum required version of FreePascal is 1.9.4")
+	else (fpc_ver LESS "010904")
+		set(pascal_compiler ${fpc_executable})
+		set(pascal_compiler_flags "-B" "-FE../bin" "-Cs2000000" "-O2" ${hwengine_project})
+	endif (fpc_ver LESS "010904")
+endif (fpc_version)
 
 if (NOT pascal_compiler)
 	message(FATAL_ERROR "No Pascal compiler found!")
--- a/hedgewars/uGears.pas	Tue Jan 23 18:54:09 2007 +0000
+++ b/hedgewars/uGears.pas	Tue Jan 23 21:24:18 2007 +0000
@@ -637,11 +637,17 @@
 
 procedure AddClouds;
 var i: integer;
+    dx, dy: hwFloat;
 begin
 for i:= 0 to cCloudsNumber do
-    AddGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -140, gtCloud, random(4),
-//             (0.5-random)*0.1, ((i mod 2) * 2 - 1) * (0.005 + 0.015*random), 0)
-             0, 0, 0)
+    begin
+    dx.isNegative:= random(2) = 1;
+    dx.QWordValue:= random(214748364);
+    dy.isNegative:= (i and 1) = 1;
+    dy.QWordValue:= 21474836 + random(64424509);
+    AddGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -140,
+             gtCloud, random(4), dx, dy, 0)
+    end
 end;
 
 procedure doMakeExplosion(X, Y, Radius: integer; Mask: LongWord);
--- a/hedgewars/uLand.pas	Tue Jan 23 18:54:09 2007 +0000
+++ b/hedgewars/uLand.pas	Tue Jan 23 21:24:18 2007 +0000
@@ -320,19 +320,19 @@
          end;
          
      if canMirror then
-        if getrandom(16) < 8 then
+        if getrandom(2) = 0 then
            begin
            for i:= 0 to pred(BasePointsCount) do
-               BasePoints^[i].x:= 2047 - BasePoints^[i].x;
+               pa.ar[i].x:= 2047 - pa.ar[i].x;
            for i:= 0 to pred(FillPointsCount) do
                FillPoints^[i].x:= 2047 - FillPoints^[i].x;
            end;
 
      if canFlip then
-        if getrandom(16) < 8 then
+        if getrandom(2) = 0 then
            begin
            for i:= 0 to pred(BasePointsCount) do
-               BasePoints^[i].y:= 1023 - BasePoints^[i].y;
+               pa.ar[i].y:= 1023 - pa.ar[i].y;
            for i:= 0 to pred(FillPointsCount) do
                FillPoints^[i].y:= 1023 - FillPoints^[i].y;
            end;
--- a/hedgewars/uLandTemplates.pas	Tue Jan 23 18:54:09 2007 +0000
+++ b/hedgewars/uLandTemplates.pas	Tue Jan 23 21:24:18 2007 +0000
@@ -57,13 +57,77 @@
        (x: 1023; y:    0)
       );
 
-const EdgeTemplates: array[0..0] of TEdgeTemplate =
+const Template1Points: array[0..14] of TSDL_Rect =
+      (
+       (x:  400; y: 1024; w:   25; h:    1),
+       (x:  284; y:  892; w:  254; h:   58),
+       (x:  492; y:  634; w:  100; h:  200),
+       (x:  274; y:  256; w:  276; h:  400),
+       (x:  620; y:  254; w:  125; h:  270),
+       (x:  680; y:  550; w:   96; h:  390),
+       (x:  826; y:  614; w:  110; h:  350),
+       (x:  800; y:  186; w:  150; h:  380),
+       (x: 1000; y:  186; w:  170; h:  375),
+       (x: 1012; y:  540; w:  188; h:  298),
+       (x: 1240; y:  668; w:  136; h:  172),
+       (x: 1270; y:  194; w:  120; h:  392),
+       (x: 1514; y:  194; w:  364; h:  362),
+       (x: 1450; y:  652; w:  315; h:  232),
+       (x: 1460; y: 1024; w:   25; h:    1)
+      );
+      Template1FPoints: array[0..0] of TPoint =
+      (
+       (x: 1023; y:    0)
+      );
+
+const Template2Points: array[0..20] of TSDL_Rect =
+      (
+       (x:  354; y: 1024; w:    1; h:    1),
+       (x:  232; y:  926; w:  226; h:   60),
+       (x:  120; y:  846; w:  298; h:   62),
+       (x:  280; y:  704; w:  210; h:  102),
+       (x:  208; y:  422; w:  192; h:  248),
+       (x:  292; y:  160; w:  206; h:  240),
+       (x:  526; y:  172; w:   92; h:  334),
+       (x:  462; y:  528; w:  226; h:  126),
+       (x:  556; y:  678; w:  268; h:  156),
+       (x:  722; y:  164; w:  138; h:  500),
+       (x:  890; y:  156; w:   94; h:  352),
+       (x:  898; y:  562; w:  170; h:  264),
+       (x: 1092; y:  384; w:   84; h:  446),
+       (x: 1206; y:  200; w:  158; h:  278),
+       (x: 1300; y:  490; w:  104; h:  336),
+       (x: 1416; y:  546; w:   90; h:  398),
+       (x: 1546; y:  192; w:  134; h:  532),
+       (x: 1702; y:  246; w:  156; h:  258),
+       (x: 1700; y:  548; w:  132; h:  340),
+       (x: 1534; y:  898; w:  252; h:   82),
+       (x: 1604; y: 1024; w:    1; h:    1)
+      );
+      Template2FPoints: array[0..0] of TPoint =
+      (
+       (x: 1023; y:    0)
+      );
+
+const EdgeTemplates: array[0..2] of TEdgeTemplate =
       (
        (BasePoints: @Template0Points;
         BasePointsCount: Succ(High(Template0Points));
         FillPoints: @Template0FPoints;
         FillPointsCount: Succ(High(Template0FPoints));
-        canMirror: false; canFlip: false;
+        canMirror: true; canFlip: false;
+       ),
+       (BasePoints: @Template1Points;
+        BasePointsCount: Succ(High(Template1Points));
+        FillPoints: @Template1FPoints;
+        FillPointsCount: Succ(High(Template1FPoints));
+        canMirror: true; canFlip: false;
+       ),
+       (BasePoints: @Template2Points;
+        BasePointsCount: Succ(High(Template2Points));
+        FillPoints: @Template2FPoints;
+        FillPointsCount: Succ(High(Template2FPoints));
+        canMirror: true; canFlip: false;
        )
       );