[Freeciv-Dev] (PR#18466) Gfx problem with two sea types
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#18466) Gfx problem with two sea types |
From: |
"Marko Lindqvist" <cazfi74@xxxxxxxxx> |
Date: |
Mon, 10 Jul 2006 11:08:47 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=18466 >
This is just a quick test I made.
- Removed special case not to insert specials to ocean squares from
mapgenerator.
- Modified terrain.ruleset to contain both shallow "Sea" and deep
"Ocean". They are identical, except that "Ocean" has no specials.
I would be quite happy with the results for my own use, except
graphics. I don't think it's possible with current codebase to create
graphics that actually work with two separate ocean types. Either coast
gets drawn between ocean types or coast is not drawn correctly.
- ML
diff -Nurd -X.diff_ignore freeciv/data/default/terrain.ruleset
freeciv/data/default/terrain.ruleset
--- freeciv/data/default/terrain.ruleset 2006-07-10 20:45:08.625000000
+0300
+++ freeciv/data/default/terrain.ruleset 2006-07-10 20:59:09.359375000
+0300
@@ -453,7 +453,6 @@
food = 1
shield = 0
trade = 2
-resources = "Fish", "Whales"
road_trade_incr = 0
road_time = 0
irrigation_result = "no"
@@ -474,7 +473,7 @@
cooler_wetter_result = "no"
cooler_drier_result = "no"
flags = "Oceanic", "NoPollution", "UnsafeCoast", "NoCities"
-property_ocean_depth = 10
+property_ocean_depth = 25
helptext = _("\
Oceans cover much of the world, and only sea units (Triremes and\
other boats) can travel on them.\
@@ -482,6 +481,44 @@
Ocean squares can never be polluted or subjected to fallout.\
")
+[terrain_sea]
+name = _("Sea")
+graphic = "sea"
+graphic_alt = "ocean"
+identifier = "e"
+movement_cost = 1
+defense_bonus = 0
+food = 1
+shield = 0
+trade = 2
+resources = "Fish", "Whales"
+road_trade_incr = 0
+road_time = 0
+irrigation_result = "no"
+irrigation_food_incr = 0
+irrigation_time = 0
+mining_result = "no"
+mining_shield_incr = 0
+mining_time = 0
+transform_result = "Swamp"
+transform_time = 36
+rail_time = 3
+airbase_time = 3
+fortress_time = 3
+clean_pollution_time = 3
+clean_fallout_time = 3
+warmer_wetter_result = "no"
+warmer_drier_result = "no"
+cooler_wetter_result = "no"
+cooler_drier_result = "no"
+flags = "Oceanic", "NoPollution", "UnsafeCoast", "NoCities"
+property_ocean_depth = 10
+helptext = _("\
+Only sea units (Triremes and other boats) can travel on sea squares.\
+\n\n\
+Sea squares can never be polluted or subjected to fallout.\
+")
+
[terrain_plains]
name = _("Plains")
graphic = "plains"
diff -Nurd -X.diff_ignore freeciv/server/generator/mapgen.c
freeciv/server/generator/mapgen.c
--- freeciv/server/generator/mapgen.c 2006-07-10 20:47:20.406250000 +0300
+++ freeciv/server/generator/mapgen.c 2006-07-10 20:52:53.500000000 +0300
@@ -1290,21 +1290,6 @@
(map.temperature * 15 - 250 + (100 - map.wetness) * 10)) ;
}
-/****************************************************************************
- Return TRUE if a safe tile is in a radius of 1. This function is used to
- test where to place specials on the sea.
-****************************************************************************/
-static bool near_safe_tiles(struct tile *ptile)
-{
- square_iterate(ptile, 1, tile1) {
- if (!terrain_has_flag(tile_get_terrain(tile1), TER_UNSAFE_COAST)) {
- return TRUE;
- }
- } square_iterate_end;
-
- return FALSE;
-}
-
/**************************************************************************
this function spreads out huts on the map, a position can be used for a
hut if there isn't another hut close and if it's not on the ocean.
@@ -1355,22 +1340,20 @@
{
whole_map_iterate(ptile) {
const struct terrain *pterrain = tile_get_terrain(ptile);
+ int i = 0;
+ const struct resource **r;
if (is_resource_close (ptile) || myrand (1000) > prob) {
continue;
}
- if (!is_ocean(pterrain) || near_safe_tiles (ptile)) {
- int i = 0;
- const struct resource **r;
- for (r = pterrain->resources; *r; r++) {
- /* This is a standard way to get a random element from the
- * pterrain->resources list, without computing its length in
- * advance. Note that if *(pterrain->resources) == NULL, then
- * this loop is a no-op. */
- if (!myrand (++i)) {
- tile_set_resource(ptile, *r);
- }
+ for (r = pterrain->resources; *r; r++) {
+ /* This is a standard way to get a random element from the
+ * pterrain->resources list, without computing its length in
+ * advance. Note that if *(pterrain->resources) == NULL, then
+ * this loop is a no-op. */
+ if (!myrand (++i)) {
+ tile_set_resource(ptile, *r);
}
}
} whole_map_iterate_end;
@@ -1516,7 +1499,7 @@
/****************************************************************************
Return TRUE if the ocean position is near land. This is used in the
- creation of islands, so it differs logically from near_safe_tiles().
+ creation of islands.
****************************************************************************/
static bool is_near_land(struct tile *ptile)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#18466) Gfx problem with two sea types,
Marko Lindqvist <=
|
|