You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(147) |
Oct
(219) |
Nov
(189) |
Dec
(380) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(301) |
Feb
(369) |
Mar
(155) |
Apr
(61) |
May
(77) |
Jun
(101) |
Jul
(191) |
Aug
(107) |
Sep
(180) |
Oct
(37) |
Nov
(7) |
Dec
(28) |
2004 |
Jan
(34) |
Feb
(45) |
Mar
(7) |
Apr
(17) |
May
(6) |
Jun
(59) |
Jul
(4) |
Aug
(8) |
Sep
(6) |
Oct
(18) |
Nov
(11) |
Dec
(15) |
2005 |
Jan
(148) |
Feb
(146) |
Mar
(73) |
Apr
(154) |
May
(192) |
Jun
(11) |
Jul
(23) |
Aug
(23) |
Sep
(26) |
Oct
(68) |
Nov
(109) |
Dec
(294) |
2006 |
Jan
(172) |
Feb
(22) |
Mar
(81) |
Apr
(79) |
May
(83) |
Jun
(23) |
Jul
(35) |
Aug
(66) |
Sep
(39) |
Oct
(133) |
Nov
(125) |
Dec
(90) |
2007 |
Jan
(49) |
Feb
(21) |
Mar
(3) |
Apr
(33) |
May
(19) |
Jun
(26) |
Jul
(32) |
Aug
(18) |
Sep
(14) |
Oct
(2) |
Nov
(8) |
Dec
(22) |
2008 |
Jan
(23) |
Feb
(14) |
Mar
(28) |
Apr
(11) |
May
(55) |
Jun
(8) |
Jul
(1) |
Aug
(36) |
Sep
(8) |
Oct
(20) |
Nov
(6) |
Dec
|
2009 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(46) |
Jul
(15) |
Aug
(1) |
Sep
(3) |
Oct
(88) |
Nov
(108) |
Dec
(119) |
2010 |
Jan
(31) |
Feb
(3) |
Mar
(5) |
Apr
(1) |
May
(5) |
Jun
(5) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(23) |
Mar
(1) |
Apr
(20) |
May
(27) |
Jun
(2) |
Jul
(40) |
Aug
(14) |
Sep
(17) |
Oct
(5) |
Nov
|
Dec
(28) |
2012 |
Jan
(31) |
Feb
(19) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <av...@us...> - 2011-04-22 18:25:58
|
Revision: 3582 http://sc2.svn.sourceforge.net/sc2/?rev=3582&view=rev Author: avolkov Date: 2011-04-22 18:25:51 +0000 (Fri, 22 Apr 2011) Log Message: ----------- Uniform energy and life generation conditions and algorithms Modified Paths: -------------- trunk/sc2/src/uqm/planets/generate/genand.c trunk/sc2/src/uqm/planets/generate/genburv.c trunk/sc2/src/uqm/planets/generate/gendru.c trunk/sc2/src/uqm/planets/generate/genilw.c trunk/sc2/src/uqm/planets/generate/genmyc.c trunk/sc2/src/uqm/planets/generate/genorz.c trunk/sc2/src/uqm/planets/generate/genpet.c trunk/sc2/src/uqm/planets/generate/genpku.c trunk/sc2/src/uqm/planets/generate/gensol.c trunk/sc2/src/uqm/planets/generate/genspa.c trunk/sc2/src/uqm/planets/generate/gensup.c trunk/sc2/src/uqm/planets/generate/genthrad.c trunk/sc2/src/uqm/planets/generate/genutw.c trunk/sc2/src/uqm/planets/generate/genvault.c trunk/sc2/src/uqm/planets/generate/genvux.c trunk/sc2/src/uqm/planets/generate/genwreck.c trunk/sc2/src/uqm/planets/generate/genyeh.c trunk/sc2/src/uqm/planets/generate/genzoq.c trunk/sc2/src/uqm/planets/sundata.h trunk/sc2/src/uqm/planets/surface.c Modified: trunk/sc2/src/uqm/planets/generate/genand.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -124,26 +124,14 @@ GenerateAndrosynth_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - DWORD rand_val; - DWORD old_rand; - if (matchWorld (solarSys, world, 1, MATCH_PLANET)) { COUNT i; - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + GenerateRandomRuins (&solarSys->SysInfo, 0, whichNode); for (i = 0; i < 16; ++i) { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 0; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { // Retrieval status is cleared to keep the node on the map @@ -169,13 +157,8 @@ } } } - - if (i >= *whichNode) - break; } - *whichNode = i; - - TFB_SeedRandom (old_rand); + return true; } Modified: trunk/sc2/src/uqm/planets/generate/genburv.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -139,61 +139,36 @@ GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - DWORD rand_val; DWORD old_rand; if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } - if (matchWorld (solarSys, world, 0, 0) - && !GET_GAME_STATE (BURVIXESE_BROADCASTERS)) + if (matchWorld (solarSys, world, 0, 0)) { + if (GET_GAME_STATE (BURVIXESE_BROADCASTERS)) + { // already picked up + *whichNode = 0; + return true; + } + old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - *whichNode = 1; + SET_GAME_STATE (BURVIXESE_BROADCASTERS, 1); + SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 1); } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (BURVIXESE_BROADCASTERS, 1); - SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 1); - } - } TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/gendru.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -132,25 +132,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - DWORD rand_val; - DWORD old_rand; + COUNT type; - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + type = GET_GAME_STATE (ROSY_SPHERE) ? 1 : 0; + GenerateRandomRuins (&solarSys->SysInfo, type, whichNode); for (i = 0; i < 16; ++i) { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - if (!GET_GAME_STATE (ROSY_SPHERE)) - solarSys->SysInfo.PlanetInfo.CurType = 0; - else - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { // Retrieval status is cleared to keep the node on the map @@ -164,19 +152,12 @@ SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1); } } - - if (i >= *whichNode) - break; } - *whichNode = i; - TFB_SeedRandom (old_rand); - return true; } *whichNode = 0; - return true; } Modified: trunk/sc2/src/uqm/planets/generate/genilw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -123,28 +123,7 @@ { if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - DWORD rand_val; - DWORD old_rand; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } Modified: trunk/sc2/src/uqm/planets/generate/genmyc.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -185,69 +185,74 @@ GenerateMycon_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (CurStarDescPtr->Index != MYCON_DEFINED - && matchWorld (solarSys, world, 0, MATCH_PLANET)) + DWORD old_rand; + + if (CurStarDescPtr->Index == SUN_DEVICE_DEFINED + && matchWorld (solarSys, world, 0, MATCH_PLANET)) { - DWORD rand_val; - DWORD old_rand; + if (GET_GAME_STATE (SUN_DEVICE)) + { // already picked up + *whichNode = 0; + return true; + } old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (CurStarDescPtr->Index == SUN_DEVICE_DEFINED) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) - { - *whichNode = 1; - } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (SUN_DEVICE, 1); - SET_GAME_STATE (SUN_DEVICE_ON_SHIP, 1); - SET_GAME_STATE (MYCON_VISITS, 0); - } - } + SET_GAME_STATE (SUN_DEVICE, 1); + SET_GAME_STATE (SUN_DEVICE_ON_SHIP, 1); + SET_GAME_STATE (MYCON_VISITS, 0); } - else + + TFB_SeedRandom (old_rand); + return true; + } + + if ((CurStarDescPtr->Index == EGG_CASE0_DEFINED + || CurStarDescPtr->Index == EGG_CASE1_DEFINED + || CurStarDescPtr->Index == EGG_CASE2_DEFINED) + && matchWorld (solarSys, world, 0, MATCH_PLANET)) + { + // XXX: DiscoveryString is set by generateOrbital() only when the + // node has not been picked up yet + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) + && !solarSys->SysInfo.PlanetInfo.DiscoveryString) + { // already picked up + *whichNode = 0; + return true; + } + + old_rand = TFB_SeedRandom ( + solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + + GenerateRandomLocation (&solarSys->SysInfo); + solarSys->SysInfo.PlanetInfo.CurDensity = 0; + solarSys->SysInfo.PlanetInfo.CurType = 0; + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + switch (CurStarDescPtr->Index) { - *whichNode = 1; + case EGG_CASE0_DEFINED: + SET_GAME_STATE (EGG_CASE0_ON_SHIP, 1); + break; + case EGG_CASE1_DEFINED: + SET_GAME_STATE (EGG_CASE1_ON_SHIP, 1); + break; + case EGG_CASE2_DEFINED: + SET_GAME_STATE (EGG_CASE2_ON_SHIP, 1); + break; } - else - { - *whichNode = 0; - // XXX: Why does this also test the PlanetInfo.DiscoveryString? - // No other similar code ever tests the DiscoveryString. - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && solarSys->SysInfo.PlanetInfo.DiscoveryString) - { - switch (CurStarDescPtr->Index) - { - case EGG_CASE0_DEFINED: - SET_GAME_STATE (EGG_CASE0_ON_SHIP, 1); - break; - case EGG_CASE1_DEFINED: - SET_GAME_STATE (EGG_CASE1_ON_SHIP, 1); - break; - case EGG_CASE2_DEFINED: - SET_GAME_STATE (EGG_CASE2_ON_SHIP, 1); - break; - } - } - } } TFB_SeedRandom (old_rand); Modified: trunk/sc2/src/uqm/planets/generate/genorz.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -165,66 +165,40 @@ GenerateOrz_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - DWORD rand_val; DWORD old_rand; - if (CurStarDescPtr->Index != ORZ_DEFINED - && matchWorld (solarSys, world, 1, 2) - && !GET_GAME_STATE (TAALO_PROTECTOR)) + if (CurStarDescPtr->Index == TAALO_PROTECTOR_DEFINED + && matchWorld (solarSys, world, 1, 2)) { + if (GET_GAME_STATE (TAALO_PROTECTOR)) + { // already picked up + *whichNode = 0; + return true; + } + old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - *whichNode = 1; + SET_GAME_STATE (TAALO_PROTECTOR, 1); + SET_GAME_STATE (TAALO_PROTECTOR_ON_SHIP, 1); } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (TAALO_PROTECTOR, 1); - SET_GAME_STATE (TAALO_PROTECTOR_ON_SHIP, 1); - } - } TFB_SeedRandom (old_rand); - return true; } if (CurStarDescPtr->Index == ORZ_DEFINED && matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } Modified: trunk/sc2/src/uqm/planets/generate/genpet.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -160,28 +160,7 @@ { if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - DWORD rand_val; - COUNT old_rand; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } Modified: trunk/sc2/src/uqm/planets/generate/genpku.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -122,25 +122,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - DWORD rand_val; - DWORD old_rand; + COUNT type; - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + type = GET_GAME_STATE (CLEAR_SPINDLE) ? 1 : 0; + GenerateRandomRuins (&solarSys->SysInfo, type, whichNode); for (i = 0; i < 16; ++i) { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - if (!GET_GAME_STATE (CLEAR_SPINDLE)) - solarSys->SysInfo.PlanetInfo.CurType = 0; - else - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { // Retrieval status is cleared to keep the node on the map @@ -154,13 +142,8 @@ SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1); } } - - if (i >= *whichNode) - break; } - *whichNode = i; - TFB_SeedRandom (old_rand); return true; } Modified: trunk/sc2/src/uqm/planets/generate/gensol.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -516,51 +516,54 @@ if (matchWorld (solarSys, world, 8, MATCH_PLANET)) { /* Pluto */ - if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI)) - { - solarSys->SysInfo.PlanetInfo.CurPt.x = 20; - solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT - 8; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - solarSys->SysInfo.PlanetInfo.CurType = 2; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (FOUND_PLUTO_SPATHI, 1); - // Retrieval status is cleared to keep the node on the map - // while the lander is taking off. FOUND_PLUTO_SPATHI bit - // will keep the node from showing up on subsequent visits. - setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0); - SetLanderTakeoff (); - // XXX: This does NOT set *whichNode when the node is - // retrieved. Other similar pieces of code return the node - // count. See just below. AFAICT, the returned value is ignored. - } - else if (*whichNode == (COUNT)~0) - *whichNode = 1; + if (GET_GAME_STATE (FOUND_PLUTO_SPATHI)) + { // already picked up + *whichNode = 0; return true; } + + solarSys->SysInfo.PlanetInfo.CurPt.x = 20; + solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT - 8; + solarSys->SysInfo.PlanetInfo.CurDensity = 0; + solarSys->SysInfo.PlanetInfo.CurType = 2; + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) + { + SET_GAME_STATE (FOUND_PLUTO_SPATHI, 1); + // Retrieval status is cleared to keep the node on the map + // while the lander is taking off. FOUND_PLUTO_SPATHI bit + // will keep the node from showing up on subsequent visits. + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0); + SetLanderTakeoff (); + } + + return true; } - else if (matchWorld (solarSys, world, 2, 1) - && !GET_GAME_STATE (MOONBASE_DESTROYED)) + + if (matchWorld (solarSys, world, 2, 1)) { /* Earth Moon */ + if (GET_GAME_STATE (MOONBASE_DESTROYED)) + { // already picked up + *whichNode = 0; + return true; + } + solarSys->SysInfo.PlanetInfo.CurPt.x = MAP_WIDTH * 3 / 4; solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT * 1 / 4; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - *whichNode = 1; + SET_GAME_STATE (MOONBASE_DESTROYED, 1); + SET_GAME_STATE (MOONBASE_ON_SHIP, 1); } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (MOONBASE_DESTROYED, 1); - SET_GAME_STATE (MOONBASE_ON_SHIP, 1); - } - } + return true; } @@ -572,35 +575,15 @@ GenerateSol_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (!matchWorld (solarSys, world, 2, 1)) + if (matchWorld (solarSys, world, 2, 1)) { - *whichNode = 0; + /* Earth Moon */ + GenerateRandomNodes (&solarSys->SysInfo, BIOLOGICAL_SCAN, 10, + NUM_CREATURE_TYPES + 1, whichNode); + return true; } - else /* Earth Moon */ - { - COUNT i; - DWORD old_rand; - DWORD rand_val; - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - - for (i = 0; i < 10; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); - } - + *whichNode = 0; return true; } Modified: trunk/sc2/src/uqm/planets/generate/genspa.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -194,36 +194,30 @@ GenerateSpathi_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (matchWorld (solarSys, world, 0, 0) - && !GET_GAME_STATE (UMGAH_BROADCASTERS)) + if (matchWorld (solarSys, world, 0, 0)) { - DWORD rand_val; DWORD old_rand; + if (GET_GAME_STATE (UMGAH_BROADCASTERS)) + { // already picked up + *whichNode = 0; + return true; + } + old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - *whichNode = 1; + SET_GAME_STATE (UMGAH_BROADCASTERS, 1); + SET_GAME_STATE (UMGAH_BROADCASTERS_ON_SHIP, 1); } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (UMGAH_BROADCASTERS, 1); - SET_GAME_STATE (UMGAH_BROADCASTERS_ON_SHIP, 1); - } - } TFB_SeedRandom (old_rand); return true; @@ -237,28 +231,18 @@ GenerateSpathi_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (matchWorld (solarSys, world, 0, MATCH_PLANET) - && !GET_GAME_STATE (SPATHI_SHIELDED_SELVES)) + if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - DWORD old_rand; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - - for (i = 0; i < 32; ++i) - { - DWORD rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES; - if (i >= *whichNode) - break; + if (GET_GAME_STATE (SPATHI_CREATURES_ELIMINATED) + || GET_GAME_STATE (SPATHI_SHIELDED_SELVES)) + { // no creatures left + *whichNode = 0; + return true; } - *whichNode = i; + GenerateRandomNodes (&solarSys->SysInfo, BIOLOGICAL_SCAN, 32, + NUM_CREATURE_TYPES, whichNode); + if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]) { SET_GAME_STATE (SPATHI_CREATURES_EXAMINED, 1); @@ -267,7 +251,6 @@ SET_GAME_STATE (SPATHI_CREATURES_ELIMINATED, 1); } - TFB_SeedRandom (old_rand); return true; } Modified: trunk/sc2/src/uqm/planets/generate/gensup.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -125,25 +125,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - DWORD rand_val; - DWORD old_rand; + COUNT type; - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + type = GET_GAME_STATE (ULTRON_CONDITION) ? 1 : 0; + GenerateRandomRuins (&solarSys->SysInfo, type, whichNode); for (i = 0; i < 16; ++i) { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - if (!GET_GAME_STATE (ULTRON_CONDITION)) - solarSys->SysInfo.PlanetInfo.CurType = 0; - else - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { // Retrieval status is cleared to keep the node on the map @@ -156,13 +144,8 @@ SET_GAME_STATE (ULTRON_CONDITION, 1); } } - - if (i >= *whichNode) - break; } - *whichNode = i; - TFB_SeedRandom (old_rand); return true; } Modified: trunk/sc2/src/uqm/planets/generate/genthrad.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -158,68 +158,43 @@ GenerateThraddash_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (matchWorld (solarSys, world, 0, MATCH_PLANET)) + DWORD old_rand; + + if (CurStarDescPtr->Index == THRADD_DEFINED + && matchWorld (solarSys, world, 0, MATCH_PLANET)) { - DWORD rand_val; - DWORD old_rand; + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); + return true; + } - if (CurStarDescPtr->Index != AQUA_HELIX_DEFINED) - { - COUNT i; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + if (CurStarDescPtr->Index == AQUA_HELIX_DEFINED + && matchWorld (solarSys, world, 0, MATCH_PLANET)) + { + if (GET_GAME_STATE (AQUA_HELIX)) + { // already picked up + *whichNode = 0; return true; } - if (!GET_GAME_STATE (AQUA_HELIX)) - { - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); + old_rand = TFB_SeedRandom ( + solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) - { - *whichNode = 1; - } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (HELIX_VISITS, 0); - SET_GAME_STATE (AQUA_HELIX, 1); - SET_GAME_STATE (AQUA_HELIX_ON_SHIP, 1); - SET_GAME_STATE (HELIX_UNPROTECTED, 1); - } - } + GenerateRandomLocation (&solarSys->SysInfo); + solarSys->SysInfo.PlanetInfo.CurDensity = 0; + solarSys->SysInfo.PlanetInfo.CurType = 0; - TFB_SeedRandom (old_rand); - return true; + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) + { + SET_GAME_STATE (HELIX_VISITS, 0); + SET_GAME_STATE (AQUA_HELIX, 1); + SET_GAME_STATE (AQUA_HELIX_ON_SHIP, 1); + SET_GAME_STATE (HELIX_UNPROTECTED, 1); } + + TFB_SeedRandom (old_rand); + return true; } *whichNode = 0; Modified: trunk/sc2/src/uqm/planets/generate/genutw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -209,66 +209,41 @@ GenerateUtwig_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - DWORD rand_val; DWORD old_rand; if (CurStarDescPtr->Index == UTWIG_DEFINED && matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } if (CurStarDescPtr->Index == BOMB_DEFINED - && matchWorld (solarSys, world, 5, 1) - && !GET_GAME_STATE (UTWIG_BOMB)) + && matchWorld (solarSys, world, 5, 1)) { + if (GET_GAME_STATE (UTWIG_BOMB)) + { // already picked up + *whichNode = 0; + return true; + } + old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) + + *whichNode = 1; // only matters when count is requested + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - *whichNode = 1; + SET_GAME_STATE (UTWIG_BOMB, 1); + SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 1); + SET_GAME_STATE (DRUUGE_MANNER, 1); + SET_GAME_STATE (DRUUGE_VISITS, 0); + SET_GAME_STATE (DRUUGE_HOME_VISITS, 0); } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (UTWIG_BOMB, 1); - SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 1); - SET_GAME_STATE (DRUUGE_MANNER, 1); - SET_GAME_STATE (DRUUGE_VISITS, 0); - SET_GAME_STATE (DRUUGE_HOME_VISITS, 0); - } - } TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genvault.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvault.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genvault.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -80,27 +80,20 @@ { if (matchWorld (solarSys, world, 0, 0)) { - DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; if (!GET_GAME_STATE (SHIP_VAULT_UNLOCKED)) solarSys->SysInfo.PlanetInfo.CurType = 0; else solarSys->SysInfo.PlanetInfo.CurType = 1; - // XXX: This node is always present, even after it is "picked up". - // Other similar pieces return the current node index when called - // by GeneratePlanetSide() to get the node info, and in that - // case the returned value is ignored AFAICT. - *whichNode = 1; + + // This node is always present, even after it is "picked up". + *whichNode = 1; // only matters when count is requested if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { Modified: trunk/sc2/src/uqm/planets/generate/genvux.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -207,61 +207,38 @@ GenerateVux_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world, COUNT *whichNode) { - if (matchWorld (solarSys, world, 0, MATCH_PLANET) - && CurStarDescPtr->Index != VUX_BEAST_DEFINED) + if (CurStarDescPtr->Index == MAIDENS_DEFINED + && matchWorld (solarSys, world, 0, MATCH_PLANET)) { - if (CurStarDescPtr->Index == MAIDENS_DEFINED - && !GET_GAME_STATE (SHOFIXTI_MAIDENS)) - { - solarSys->SysInfo.PlanetInfo.CurPt.x = MAP_WIDTH / 3; - solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT * 5 / 8; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) - && *whichNode == (COUNT)~0) - { - *whichNode = 1; - } - else - { - *whichNode = 0; - if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) - { - SET_GAME_STATE (SHOFIXTI_MAIDENS, 1); - SET_GAME_STATE (MAIDENS_ON_SHIP, 1); - } - } + if (GET_GAME_STATE (SHOFIXTI_MAIDENS)) + { // already picked up + *whichNode = 0; return true; } - if (CurStarDescPtr->Index == VUX_DEFINED) - { - COUNT i; - DWORD rand_val; - DWORD old_rand; + solarSys->SysInfo.PlanetInfo.CurPt.x = MAP_WIDTH / 3; + solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT * 5 / 8; + solarSys->SysInfo.PlanetInfo.CurDensity = 0; + solarSys->SysInfo.PlanetInfo.CurType = 0; + + *whichNode = 1; // only matters when count is requested - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); - return true; + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) + { + SET_GAME_STATE (SHOFIXTI_MAIDENS, 1); + SET_GAME_STATE (MAIDENS_ON_SHIP, 1); } + + return true; } + if (CurStarDescPtr->Index == VUX_DEFINED + && matchWorld (solarSys, world, 0, MATCH_PLANET)) + { + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); + return true; + } + *whichNode = 0; return true; } @@ -279,23 +256,18 @@ old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - for (i = 0; i < 12; ++i) + for (i = 0; i <= *whichNode && i < 12; ++i) { - DWORD rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); if (i < 4) solarSys->SysInfo.PlanetInfo.CurType = 9; else if (i < 8) solarSys->SysInfo.PlanetInfo.CurType = 14; else /* if (i < 12) */ solarSys->SysInfo.PlanetInfo.CurType = 18; - if (i >= *whichNode) - break; } - *whichNode = i; + + *whichNode = 12; // only matters when count is requested TFB_SeedRandom (old_rand); return true; @@ -310,14 +282,10 @@ old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - for (i = 0; i < 11; ++i) + for (i = 0; i <= *whichNode && i < 11; ++i) { - DWORD rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - if (i == 0) + GenerateRandomLocation (&solarSys->SysInfo); + if (i == 0) /* VUX Beast */ solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 2; else if (i <= 5) /* {SPEED_MOTIONLESS | DANGER_NORMAL, MAKE_BYTE (5, 3)}, */ @@ -325,27 +293,21 @@ else /* if (i <= 10) */ /* {BEHAVIOR_UNPREDICTABLE | SPEED_SLOW | DANGER_NORMAL, MAKE_BYTE (3, 8)}, */ solarSys->SysInfo.PlanetInfo.CurType = 8; + } + + *whichNode = 11; // only matters when count is requested - // XXX: This currently does not need to be done in a loop. When a - // node is retrieved, the func is called with *whichNode==~0 - if (i == 0 - && isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, - BIOLOGICAL_SCAN, 0) - && !GET_GAME_STATE (VUX_BEAST)) - { - UnbatchGraphics (); - DoDiscoveryReport (MenuSounds); - BatchGraphics (); - SetLanderTakeoff (); + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, BIOLOGICAL_SCAN, 0) + && !GET_GAME_STATE (VUX_BEAST)) + { // Picked up Zex' Beauty + UnbatchGraphics (); + DoDiscoveryReport (MenuSounds); + BatchGraphics (); + SetLanderTakeoff (); - SET_GAME_STATE (VUX_BEAST, 1); - SET_GAME_STATE (VUX_BEAST_ON_SHIP, 1); - } - - if (i >= *whichNode) - break; + SET_GAME_STATE (VUX_BEAST, 1); + SET_GAME_STATE (VUX_BEAST_ON_SHIP, 1); } - *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genwreck.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genwreck.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genwreck.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -74,28 +74,21 @@ { if (matchWorld (solarSys, world, 6, MATCH_PLANET)) { - DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (&solarSys->SysInfo); solarSys->SysInfo.PlanetInfo.CurDensity = 0; if (!GET_GAME_STATE (PORTAL_KEY)) solarSys->SysInfo.PlanetInfo.CurType = 0; else solarSys->SysInfo.PlanetInfo.CurType = 1; - // XXX: This node is always present, even after it is "picked up". - // Other similar pieces return the current node index when called - // by GeneratePlanetSide() to get the node info, and in that - // case the returned value is ignored AFAICT. - *whichNode = 1; + // This node is always present, even after it is "picked up". + *whichNode = 1; // only matters when count is requested + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { // Retrieval status is cleared to keep the node on the map Modified: trunk/sc2/src/uqm/planets/generate/genyeh.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -113,28 +113,7 @@ { if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - DWORD rand_val; - DWORD old_rand; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } Modified: trunk/sc2/src/uqm/planets/generate/genzoq.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -143,28 +143,7 @@ { if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT i; - DWORD rand_val; - DWORD old_rand; - - old_rand = TFB_SeedRandom ( - solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - - for (i = 0; i < 16; ++i) - { - rand_val = TFB_Random (); - solarSys->SysInfo.PlanetInfo.CurPt.x = - (LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurPt.y = - (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; - solarSys->SysInfo.PlanetInfo.CurType = 1; - solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (i >= *whichNode) - break; - } - *whichNode = i; - - TFB_SeedRandom (old_rand); + GenerateRandomRuins (&solarSys->SysInfo, 1, whichNode); return true; } Modified: trunk/sc2/src/uqm/planets/sundata.h =================================================================== --- trunk/sc2/src/uqm/planets/sundata.h 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/sundata.h 2011-04-22 18:25:51 UTC (rev 3582) @@ -43,6 +43,10 @@ extern DWORD GenerateMineralDeposits (SYSTEM_INFO *SysInfoPtr, COUNT *pwhich_deposit); extern DWORD GenerateLifeForms (SYSTEM_INFO *SysInfoPtr, COUNT *pwhich_life); +extern void GenerateRandomLocation (SYSTEM_INFO *); +extern DWORD GenerateRandomNodes (SYSTEM_INFO *, COUNT scan, COUNT numNodes, + COUNT type, COUNT *whichNode); +extern DWORD GenerateRandomRuins (SYSTEM_INFO *, COUNT type, COUNT *whichNode); #define DWARF_ELEMENT_DENSITY 1 #define GIANT_ELEMENT_DENSITY 3 Modified: trunk/sc2/src/uqm/planets/surface.c =================================================================== --- trunk/sc2/src/uqm/planets/surface.c 2011-04-21 21:27:18 UTC (rev 3581) +++ trunk/sc2/src/uqm/planets/surface.c 2011-04-22 18:25:51 UTC (rev 3582) @@ -47,8 +47,6 @@ { #define MEDIUM_DEPOSIT_THRESHOLD 150 #define LARGE_DEPOSIT_THRESHOLD 225 - DWORD rand_val; - UWORD loword, hiword; COUNT deposit_quality_fine, deposit_quality_gross; @@ -64,13 +62,7 @@ else deposit_quality_gross = 2; - rand_val = TFB_Random (); - loword = LOWORD (rand_val); - hiword = HIWORD (rand_val); - SysInfoPtr->PlanetInfo.CurPt.x = - (LOBYTE (loword) % (MAP_WIDTH - (8 << 1))) + 8; - SysInfoPtr->PlanetInfo.CurPt.y = - (HIBYTE (loword) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (SysInfoPtr); SysInfoPtr->PlanetInfo.CurDensity = MAKE_WORD ( @@ -219,11 +211,7 @@ num_creatures = (BYTE)((HIBYTE (rand_val) % 10) + 1); do { - rand_val = (UWORD)TFB_Random (); - SysInfoPtr->PlanetInfo.CurPt.x = - (LOBYTE (rand_val) % (MAP_WIDTH - (8 << 1))) + 8; - SysInfoPtr->PlanetInfo.CurPt.y = - (HIBYTE (rand_val) % (MAP_HEIGHT - (8 << 1))) + 8; + GenerateRandomLocation (SysInfoPtr); SysInfoPtr->PlanetInfo.CurType = index; if (num_life_forms >= which_life @@ -256,5 +244,44 @@ return (TFB_SeedRandom (old_rand)); } +void +GenerateRandomLocation (SYSTEM_INFO *SysInfoPtr) +{ + UWORD rand_val; + rand_val = (UWORD)TFB_Random (); + SysInfoPtr->PlanetInfo.CurPt.x = + (LOBYTE (rand_val) % (MAP_WIDTH - (8 << 1))) + 8; + SysInfoPtr->PlanetInfo.CurPt.y = + (HIBYTE (rand_val) % (MAP_HEIGHT - (8 << 1))) + 8; +} +DWORD +GenerateRandomNodes (SYSTEM_INFO *SysInfoPtr, COUNT scan, COUNT numNodes, + COUNT type, COUNT *whichNode) +{ + DWORD old_rand; + COUNT i; + + old_rand = TFB_SeedRandom (SysInfoPtr->PlanetInfo.ScanSeed[scan]); + + for (i = 0; i < numNodes; ++i) + { + GenerateRandomLocation (SysInfoPtr); + SysInfoPtr->PlanetInfo.CurType = type; + SysInfoPtr->PlanetInfo.CurDensity = 0; + + if (i >= *whichNode) + break; + } + + *whichNode = i; // only matters when count is requested + + return (TFB_SeedRandom (old_rand)); +} + +DWORD +GenerateRandomRuins (SYSTEM_INFO *SysInfoPtr, COUNT type, COUNT *whichNode) +{ + return GenerateRandomNodes (SysInfoPtr, ENERGY_SCAN, 16, type, whichNode); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-21 21:27:25
|
Revision: 3581 http://sc2.svn.sourceforge.net/sc2/?rev=3581&view=rev Author: avolkov Date: 2011-04-21 21:27:18 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Use isNodeRetrieved(), setNodeRetrieved(), and setNodeNotRetrieved() Modified Paths: -------------- trunk/sc2/src/uqm/planets/generate/genand.c trunk/sc2/src/uqm/planets/generate/genburv.c trunk/sc2/src/uqm/planets/generate/gendru.c trunk/sc2/src/uqm/planets/generate/genmyc.c trunk/sc2/src/uqm/planets/generate/genorz.c trunk/sc2/src/uqm/planets/generate/genpku.c trunk/sc2/src/uqm/planets/generate/gensol.c trunk/sc2/src/uqm/planets/generate/genspa.c trunk/sc2/src/uqm/planets/generate/gensup.c trunk/sc2/src/uqm/planets/generate/genthrad.c trunk/sc2/src/uqm/planets/generate/genutw.c trunk/sc2/src/uqm/planets/generate/genvault.c trunk/sc2/src/uqm/planets/generate/genvux.c trunk/sc2/src/uqm/planets/generate/genwreck.c trunk/sc2/src/uqm/planets/generate.h trunk/sc2/src/uqm/planets/lander.c Modified: trunk/sc2/src/uqm/planets/generate/genand.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../globdata.h" #include "../../nameref.h" #include "../../resinst.h" @@ -71,7 +72,8 @@ { if (matchWorld (solarSys, world, 1, MATCH_PLANET)) { - UWORD retval; + COUNT i; + COUNT visits = 0; LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo); solarSys->PlanetSideFrame[1] = @@ -79,26 +81,29 @@ solarSys->SysInfo.PlanetInfo.DiscoveryString = CaptureStringTable ( LoadStringTable (ANDROSYNTH_RUINS_STRTAB)); - retval = HIWORD ( - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]); - while (retval) + // Androsynth ruins are a special case. The DiscoveryString contains + // several lander reports which form a story. Each report is given + // when the player collides with a new city ruin. Ruins previously + // visited are marked in the upper 16 bits of ScanRetrieveMask, and + // the lower bits are cleared to keep the ruin nodes on the map. + for (i = 16; i < 32; ++i) { - if (retval & 1) - { - solarSys->SysInfo.PlanetInfo.DiscoveryString = - SetRelStringTableIndex ( - solarSys->SysInfo.PlanetInfo.DiscoveryString, 1); - if (GetStringTableIndex ( - solarSys->SysInfo.PlanetInfo.DiscoveryString) == 0) - { - DestroyStringTable (ReleaseStringTable ( - solarSys->SysInfo.PlanetInfo.DiscoveryString)); - solarSys->SysInfo.PlanetInfo.DiscoveryString = 0; - } - } - - retval >>= 1; + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) + ++visits; } + if (visits >= GetStringTableCount ( + solarSys->SysInfo.PlanetInfo.DiscoveryString)) + { // All the reports were already given + DestroyStringTable (ReleaseStringTable ( + solarSys->SysInfo.PlanetInfo.DiscoveryString)); + solarSys->SysInfo.PlanetInfo.DiscoveryString = 0; + } + else + { // Advance the report sequence to the first unread + solarSys->SysInfo.PlanetInfo.DiscoveryString = + SetRelStringTableIndex ( + solarSys->SysInfo.PlanetInfo.DiscoveryString, visits); + } } GenerateDefault_generateOrbital (solarSys, world); @@ -139,23 +144,24 @@ solarSys->SysInfo.PlanetInfo.CurType = 0; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << i); - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << (i + 16)))) + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i); + // Ruins previously visited are marked in the upper 16 bits + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, + i + 16)) { SET_GAME_STATE (PLANETARY_CHANGE, 1); - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - |= (1L << (i + 16)); + setNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, + i + 16); if (solarSys->SysInfo.PlanetInfo.DiscoveryString) { UnbatchGraphics (); DoDiscoveryReport (MenuSounds); BatchGraphics (); + // Advance to the next report solarSys->SysInfo.PlanetInfo.DiscoveryString = SetRelStringTableIndex ( solarSys->SysInfo.PlanetInfo.DiscoveryString, Modified: trunk/sc2/src/uqm/planets/generate/genburv.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -18,6 +18,7 @@ #include "genall.h" #include "../planets.h" +#include "../scan.h" #include "../../globdata.h" #include "../../nameref.h" #include "../../resinst.h" @@ -179,8 +180,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -188,8 +188,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (BURVIXESE_BROADCASTERS, 1); SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 1); Modified: trunk/sc2/src/uqm/planets/generate/gendru.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../globdata.h" @@ -149,11 +150,11 @@ else solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i)) + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << i); + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i); if (!GET_GAME_STATE (ROSY_SPHERE)) { @@ -163,6 +164,7 @@ SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1); } } + if (i >= *whichNode) break; } Modified: trunk/sc2/src/uqm/planets/generate/genmyc.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -18,6 +18,7 @@ #include "genall.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../encount.h" @@ -161,8 +162,8 @@ if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) == 0) SET_GAME_STATE (KNOW_ABOUT_SHATTERED, 1); - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0))) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, + ENERGY_SCAN, 0)) { LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo); solarSys->PlanetSideFrame[1] = @@ -202,8 +203,7 @@ solarSys->SysInfo.PlanetInfo.CurType = 0; if (CurStarDescPtr->Index == SUN_DEVICE_DEFINED) { - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -211,8 +211,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (SUN_DEVICE, 1); SET_GAME_STATE (SUN_DEVICE_ON_SHIP, 1); @@ -222,8 +221,7 @@ } else { - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -233,8 +231,7 @@ *whichNode = 0; // XXX: Why does this also test the PlanetInfo.DiscoveryString? // No other similar code ever tests the DiscoveryString. - if ((solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && solarSys->SysInfo.PlanetInfo.DiscoveryString) { switch (CurStarDescPtr->Index) Modified: trunk/sc2/src/uqm/planets/generate/genorz.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -18,6 +18,7 @@ #include "genall.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../encount.h" @@ -181,8 +182,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -190,8 +190,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (TAALO_PROTECTOR, 1); SET_GAME_STATE (TAALO_PROTECTOR_ON_SHIP, 1); Modified: trunk/sc2/src/uqm/planets/generate/genpku.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../globdata.h" @@ -139,11 +140,11 @@ else solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i)) + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << i); + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i); if (!GET_GAME_STATE (CLEAR_SPINDLE)) { @@ -153,6 +154,7 @@ SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1); } } + if (i >= *whichNode) break; } Modified: trunk/sc2/src/uqm/planets/generate/gensol.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -20,6 +20,7 @@ #include "../lander.h" #include "../lifeform.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../encount.h" #include "../../globdata.h" @@ -521,13 +522,17 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT - 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 2; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (FOUND_PLUTO_SPATHI, 1); - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << 0); + // Retrieval status is cleared to keep the node on the map + // while the lander is taking off. FOUND_PLUTO_SPATHI bit + // will keep the node from showing up on subsequent visits. + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0); SetLanderTakeoff (); + // XXX: This does NOT set *whichNode when the node is + // retrieved. Other similar pieces of code return the node + // count. See just below. AFAICT, the returned value is ignored. } else if (*whichNode == (COUNT)~0) *whichNode = 1; @@ -542,8 +547,7 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT * 1 / 4; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -551,8 +555,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (MOONBASE_DESTROYED, 1); SET_GAME_STATE (MOONBASE_ON_SHIP, 1); Modified: trunk/sc2/src/uqm/planets/generate/genspa.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lifeform.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../globdata.h" @@ -209,8 +210,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -218,8 +218,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (UMGAH_BROADCASTERS, 1); SET_GAME_STATE (UMGAH_BROADCASTERS_ON_SHIP, 1); Modified: trunk/sc2/src/uqm/planets/generate/gensup.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../globdata.h" @@ -142,11 +143,11 @@ else solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i)) + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << i); + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, i); if (!GET_GAME_STATE (ULTRON_CONDITION)) { @@ -155,6 +156,7 @@ SET_GAME_STATE (ULTRON_CONDITION, 1); } } + if (i >= *whichNode) break; } Modified: trunk/sc2/src/uqm/planets/generate/genthrad.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -18,6 +18,7 @@ #include "genall.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../encount.h" @@ -199,16 +200,15 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) && *whichNode == (COUNT)~0) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) + && *whichNode == (COUNT)~0) { *whichNode = 1; } else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (HELIX_VISITS, 0); SET_GAME_STATE (AQUA_HELIX, 1); Modified: trunk/sc2/src/uqm/planets/generate/genutw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -18,6 +18,7 @@ #include "genall.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../encount.h" @@ -251,8 +252,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -260,8 +260,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (UTWIG_BOMB, 1); SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 1); Modified: trunk/sc2/src/uqm/planets/generate/genvault.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvault.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genvault.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../globdata.h" #include "../../nameref.h" #include "../../resinst.h" @@ -95,13 +96,17 @@ solarSys->SysInfo.PlanetInfo.CurType = 0; else solarSys->SysInfo.PlanetInfo.CurType = 1; + // XXX: This node is always present, even after it is "picked up". + // Other similar pieces return the current node index when called + // by GeneratePlanetSide() to get the node info, and in that + // case the returned value is ignored AFAICT. *whichNode = 1; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << 0); + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0); + if (GET_GAME_STATE (SYREEN_SHUTTLE_ON_SHIP)) { SetLanderTakeoff (); Modified: trunk/sc2/src/uqm/planets/generate/genvux.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -20,6 +20,7 @@ #include "../lander.h" #include "../lifeform.h" #include "../planets.h" +#include "../scan.h" #include "../../build.h" #include "../../comm.h" #include "../../encount.h" @@ -216,8 +217,7 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = MAP_HEIGHT * 5 / 8; solarSys->SysInfo.PlanetInfo.CurDensity = 0; solarSys->SysInfo.PlanetInfo.CurType = 0; - if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (!isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0) && *whichNode == (COUNT)~0) { *whichNode = 1; @@ -225,8 +225,7 @@ else { *whichNode = 0; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { SET_GAME_STATE (SHOFIXTI_MAIDENS, 1); SET_GAME_STATE (MAIDENS_ON_SHIP, 1); @@ -326,9 +325,12 @@ else /* if (i <= 10) */ /* {BEHAVIOR_UNPREDICTABLE | SPEED_SLOW | DANGER_NORMAL, MAKE_BYTE (3, 8)}, */ solarSys->SysInfo.PlanetInfo.CurType = 8; + + // XXX: This currently does not need to be done in a loop. When a + // node is retrieved, the func is called with *whichNode==~0 if (i == 0 - && (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << i)) + && isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, + BIOLOGICAL_SCAN, 0) && !GET_GAME_STATE (VUX_BEAST)) { UnbatchGraphics (); @@ -339,6 +341,7 @@ SET_GAME_STATE (VUX_BEAST, 1); SET_GAME_STATE (VUX_BEAST_ON_SHIP, 1); } + if (i >= *whichNode) break; } Modified: trunk/sc2/src/uqm/planets/generate/genwreck.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genwreck.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate/genwreck.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -19,6 +19,7 @@ #include "genall.h" #include "../lander.h" #include "../planets.h" +#include "../scan.h" #include "../../globdata.h" #include "../../nameref.h" #include "../../resinst.h" @@ -89,12 +90,16 @@ solarSys->SysInfo.PlanetInfo.CurType = 0; else solarSys->SysInfo.PlanetInfo.CurType = 1; + // XXX: This node is always present, even after it is "picked up". + // Other similar pieces return the current node index when called + // by GeneratePlanetSide() to get the node info, and in that + // case the returned value is ignored AFAICT. *whichNode = 1; - if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << 0)) + + if (isNodeRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0)) { - solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - &= ~(1L << 0); + // Retrieval status is cleared to keep the node on the map + setNodeNotRetrieved (&solarSys->SysInfo.PlanetInfo, ENERGY_SCAN, 0); if (!GET_GAME_STATE (PORTAL_KEY)) { Modified: trunk/sc2/src/uqm/planets/generate.h =================================================================== --- trunk/sc2/src/uqm/planets/generate.h 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/generate.h 2011-04-21 21:27:18 UTC (rev 3581) @@ -43,8 +43,6 @@ * solarSys->genFuncs->..., but use a function for this, which first * checks for solar system dependent handlers, and if this does not exist, * or returns false, calls the default function. - * - use isNodeRetrieved, setNodeRetrieved, and setNodeNotRetrieved instead - * of manually messing with bit shifts, etc. */ // Any of these functions returning true means that the action has been Modified: trunk/sc2/src/uqm/planets/lander.c =================================================================== --- trunk/sc2/src/uqm/planets/lander.c 2011-04-21 14:33:32 UTC (rev 3580) +++ trunk/sc2/src/uqm/planets/lander.c 2011-04-21 21:27:18 UTC (rev 3581) @@ -858,15 +858,15 @@ } which_node = HIBYTE (ElementPtr->scan_node) - 1; - pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] |= - (1L << which_node); + setNodeRetrieved (&pSolarSysState->SysInfo.PlanetInfo, scan, + which_node); allNodes = (COUNT)~0; callGenerateForScanType (pSolarSysState, pSolarSysState->pOrbitalDesc, &allNodes, scan); - if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] & - (1L << which_node))) + if (!isNodeRetrieved (&pSolarSysState->SysInfo.PlanetInfo, scan, + which_node)) { /* If our discovery strings have cycled, we're done */ if (GetStringTableIndex ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-21 14:33:39
|
Revision: 3580 http://sc2.svn.sourceforge.net/sc2/?rev=3580&view=rev Author: avolkov Date: 2011-04-21 14:33:32 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Get rid of dual identical counters in generation code and reformat the loops Modified Paths: -------------- trunk/sc2/src/uqm/planets/generate/genand.c trunk/sc2/src/uqm/planets/generate/genburv.c trunk/sc2/src/uqm/planets/generate/gendru.c trunk/sc2/src/uqm/planets/generate/genilw.c trunk/sc2/src/uqm/planets/generate/genorz.c trunk/sc2/src/uqm/planets/generate/genpet.c trunk/sc2/src/uqm/planets/generate/genpku.c trunk/sc2/src/uqm/planets/generate/gensol.c trunk/sc2/src/uqm/planets/generate/genspa.c trunk/sc2/src/uqm/planets/generate/gensup.c trunk/sc2/src/uqm/planets/generate/genthrad.c trunk/sc2/src/uqm/planets/generate/genutw.c trunk/sc2/src/uqm/planets/generate/genvux.c trunk/sc2/src/uqm/planets/generate/genyeh.c trunk/sc2/src/uqm/planets/generate/genzoq.c Modified: trunk/sc2/src/uqm/planets/generate/genand.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -125,14 +125,11 @@ if (matchWorld (solarSys, world, 1, MATCH_PLANET)) { COUNT i; - COUNT nodeI; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -167,11 +164,10 @@ } } - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genburv.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -143,15 +143,12 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { - COUNT nodeI; COUNT i; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -160,11 +157,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/gendru.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -131,16 +131,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -166,11 +163,10 @@ SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1); } } - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); Modified: trunk/sc2/src/uqm/planets/generate/genilw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -124,16 +124,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -142,11 +139,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genorz.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -207,14 +207,11 @@ && matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -223,11 +220,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genpet.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -161,16 +161,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; COUNT old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -179,11 +176,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genpku.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -121,16 +121,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -156,11 +153,10 @@ SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1); } } - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/gensol.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -576,16 +576,13 @@ else /* Earth Moon */ { COUNT i; - COUNT nodeI; DWORD old_rand; DWORD rand_val; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 10; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -593,11 +590,10 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 10); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); } Modified: trunk/sc2/src/uqm/planets/generate/genspa.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -242,15 +242,12 @@ && !GET_GAME_STATE (SPATHI_SHIELDED_SELVES)) { COUNT i; - COUNT nodeI; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 32; ++i) { DWORD rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -258,11 +255,10 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 32); - *whichNode = nodeI; + } + *whichNode = i; if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]) { Modified: trunk/sc2/src/uqm/planets/generate/gensup.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -124,16 +124,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -158,11 +155,10 @@ SET_GAME_STATE (ULTRON_CONDITION, 1); } } - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genthrad.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -165,14 +165,11 @@ if (CurStarDescPtr->Index != AQUA_HELIX_DEFINED) { COUNT i; - COUNT nodeI; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -181,11 +178,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genutw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -215,14 +215,11 @@ && matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -231,11 +228,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genvux.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -238,16 +238,13 @@ if (CurStarDescPtr->Index == VUX_DEFINED) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -256,11 +253,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; @@ -284,8 +280,7 @@ old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - i = 0; - do + for (i = 0; i < 12; ++i) { DWORD rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -300,7 +295,7 @@ solarSys->SysInfo.PlanetInfo.CurType = 18; if (i >= *whichNode) break; - } while (++i < 12); + } *whichNode = i; TFB_SeedRandom (old_rand); @@ -316,8 +311,7 @@ old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]); - i = 0; - do + for (i = 0; i < 11; ++i) { DWORD rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -347,7 +341,7 @@ } if (i >= *whichNode) break; - } while (++i < 11); + } *whichNode = i; TFB_SeedRandom (old_rand); Modified: trunk/sc2/src/uqm/planets/generate/genyeh.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -114,16 +114,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -132,11 +129,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; Modified: trunk/sc2/src/uqm/planets/generate/genzoq.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-21 00:18:18 UTC (rev 3579) +++ trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-21 14:33:32 UTC (rev 3580) @@ -144,16 +144,13 @@ if (matchWorld (solarSys, world, 0, MATCH_PLANET)) { COUNT i; - COUNT nodeI; DWORD rand_val; DWORD old_rand; old_rand = TFB_SeedRandom ( solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]); - nodeI = 0; - i = 0; - do + for (i = 0; i < 16; ++i) { rand_val = TFB_Random (); solarSys->SysInfo.PlanetInfo.CurPt.x = @@ -162,11 +159,10 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode) + if (i >= *whichNode) break; - ++nodeI; - } while (++i < 16); - *whichNode = nodeI; + } + *whichNode = i; TFB_SeedRandom (old_rand); return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-21 00:18:25
|
Revision: 3579 http://sc2.svn.sourceforge.net/sc2/?rev=3579&view=rev Author: avolkov Date: 2011-04-21 00:18:18 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Removed a moot test for node retrieval status from generation funcs (never called this way for retrieved nodes); some readability { } Modified Paths: -------------- trunk/sc2/src/uqm/planets/generate/genand.c trunk/sc2/src/uqm/planets/generate/genburv.c trunk/sc2/src/uqm/planets/generate/gendru.c trunk/sc2/src/uqm/planets/generate/genilw.c trunk/sc2/src/uqm/planets/generate/genmyc.c trunk/sc2/src/uqm/planets/generate/genorz.c trunk/sc2/src/uqm/planets/generate/genpet.c trunk/sc2/src/uqm/planets/generate/genpku.c trunk/sc2/src/uqm/planets/generate/gensol.c trunk/sc2/src/uqm/planets/generate/genspa.c trunk/sc2/src/uqm/planets/generate/gensup.c trunk/sc2/src/uqm/planets/generate/genthrad.c trunk/sc2/src/uqm/planets/generate/genutw.c trunk/sc2/src/uqm/planets/generate/genvux.c trunk/sc2/src/uqm/planets/generate/genyeh.c trunk/sc2/src/uqm/planets/generate/genzoq.c trunk/sc2/src/uqm/planets/surface.c Modified: trunk/sc2/src/uqm/planets/generate/genand.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genand.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -167,9 +167,7 @@ } } - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genburv.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genburv.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -160,9 +160,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); @@ -188,7 +186,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; Modified: trunk/sc2/src/uqm/planets/generate/gendru.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/gendru.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -166,9 +166,7 @@ SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1); } } - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genilw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genilw.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -142,9 +142,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genmyc.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genmyc.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -205,7 +205,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; @@ -223,10 +225,14 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; + // XXX: Why does this also test the PlanetInfo.DiscoveryString? + // No other similar code ever tests the DiscoveryString. if ((solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && solarSys->SysInfo.PlanetInfo.DiscoveryString) Modified: trunk/sc2/src/uqm/planets/generate/genorz.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genorz.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -184,7 +184,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; @@ -221,9 +223,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode && - !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genpet.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genpet.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -179,9 +179,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genpku.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genpku.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -156,9 +156,7 @@ SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1); } } - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/gensol.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/gensol.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -593,9 +593,7 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 10); Modified: trunk/sc2/src/uqm/planets/generate/genspa.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genspa.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -212,7 +212,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; @@ -256,9 +258,7 @@ solarSys->SysInfo.PlanetInfo.CurPt.y = (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 32); Modified: trunk/sc2/src/uqm/planets/generate/gensup.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/gensup.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -158,9 +158,7 @@ SET_GAME_STATE (ULTRON_CONDITION, 1); } } - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genthrad.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genthrad.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -181,9 +181,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); @@ -207,7 +205,9 @@ solarSys->SysInfo.PlanetInfo.CurType = 0; if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; Modified: trunk/sc2/src/uqm/planets/generate/genutw.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genutw.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -231,9 +231,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); @@ -260,7 +258,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; Modified: trunk/sc2/src/uqm/planets/generate/genvux.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genvux.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -219,7 +219,9 @@ if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << 0)) && *whichNode == (COUNT)~0) + { *whichNode = 1; + } else { *whichNode = 0; @@ -254,9 +256,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); @@ -298,9 +298,7 @@ solarSys->SysInfo.PlanetInfo.CurType = 14; else /* if (i < 12) */ solarSys->SysInfo.PlanetInfo.CurType = 18; - if (i >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << i))) + if (i >= *whichNode) break; } while (++i < 12); *whichNode = i; @@ -334,11 +332,7 @@ else /* if (i <= 10) */ /* {BEHAVIOR_UNPREDICTABLE | SPEED_SLOW | DANGER_NORMAL, MAKE_BYTE (3, 8)}, */ solarSys->SysInfo.PlanetInfo.CurType = 8; - if (i >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << i))) - break; - else if (i == 0 + if (i == 0 && (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] & (1L << i)) && !GET_GAME_STATE (VUX_BEAST)) @@ -351,6 +345,8 @@ SET_GAME_STATE (VUX_BEAST, 1); SET_GAME_STATE (VUX_BEAST_ON_SHIP, 1); } + if (i >= *whichNode) + break; } while (++i < 11); *whichNode = i; Modified: trunk/sc2/src/uqm/planets/generate/genyeh.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genyeh.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -132,9 +132,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/generate/genzoq.c =================================================================== --- trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/generate/genzoq.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -162,9 +162,7 @@ (HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8; solarSys->SysInfo.PlanetInfo.CurType = 1; solarSys->SysInfo.PlanetInfo.CurDensity = 0; - if (nodeI >= *whichNode - && !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] - & (1L << i))) + if (nodeI >= *whichNode) break; ++nodeI; } while (++i < 16); Modified: trunk/sc2/src/uqm/planets/surface.c =================================================================== --- trunk/sc2/src/uqm/planets/surface.c 2011-04-21 00:05:24 UTC (rev 3578) +++ trunk/sc2/src/uqm/planets/surface.c 2011-04-21 00:18:18 UTC (rev 3579) @@ -82,9 +82,7 @@ SysInfoPtr->PlanetInfo.CurDensity, Elements[eptr->ElementType].name); #endif /* DEBUG_SURFACE */ - if ((num_deposits >= which_deposit - && !(SysInfoPtr->PlanetInfo.ScanRetrieveMask[MINERAL_SCAN] - & (1L << num_deposits))) + if (num_deposits >= which_deposit || ++num_deposits == sizeof (DWORD) * 8) goto ExitCalcMinerals; } @@ -228,9 +226,7 @@ (HIBYTE (rand_val) % (MAP_HEIGHT - (8 << 1))) + 8; SysInfoPtr->PlanetInfo.CurType = index; - if ((num_life_forms >= which_life - && !(SysInfoPtr->PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN] - & (1L << num_life_forms))) + if (num_life_forms >= which_life || ++num_life_forms == sizeof (DWORD) * 8) { num_types = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-21 00:05:30
|
Revision: 3578 http://sc2.svn.sourceforge.net/sc2/?rev=3578&view=rev Author: avolkov Date: 2011-04-21 00:05:24 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Added the rest of lander upgrades to debug code Modified Paths: -------------- trunk/sc2/src/uqm/uqmdebug.c Modified: trunk/sc2/src/uqm/uqmdebug.c =================================================================== --- trunk/sc2/src/uqm/uqmdebug.c 2011-04-20 18:54:27 UTC (rev 3577) +++ trunk/sc2/src/uqm/uqmdebug.c 2011-04-21 00:05:24 UTC (rev 3578) @@ -281,6 +281,10 @@ (1 << BIOLOGICAL_DISASTER) | (1 << LIGHTNING_DISASTER) | (1 << LAVASPOT_DISASTER)); + // Lander upgrades: + SET_GAME_STATE (IMPROVED_LANDER_SPEED, 1); + SET_GAME_STATE (IMPROVED_LANDER_CARGO, 1); + SET_GAME_STATE (IMPROVED_LANDER_SHOT, 1); // Modules: if (GET_GAME_STATE (CHMMR_BOMB_STATE) < 2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-20 18:54:33
|
Revision: 3577 http://sc2.svn.sourceforge.net/sc2/?rev=3577&view=rev Author: avolkov Date: 2011-04-20 18:54:27 +0000 (Wed, 20 Apr 2011) Log Message: ----------- Removed SOLARSYS_STATE.CurNode; uniform usage of callGenerateForScanType() Modified Paths: -------------- trunk/sc2/src/uqm/planets/lander.c trunk/sc2/src/uqm/planets/planets.h trunk/sc2/src/uqm/planets/scan.c trunk/sc2/src/uqm/uqmdebug.c Modified: trunk/sc2/src/uqm/planets/lander.c =================================================================== --- trunk/sc2/src/uqm/planets/lander.c 2011-04-20 18:23:17 UTC (rev 3576) +++ trunk/sc2/src/uqm/planets/lander.c 2011-04-20 18:54:27 UTC (rev 3577) @@ -718,6 +718,7 @@ { COUNT scan, NumRetrieved; SIZE which_node; + COUNT allNodes; scan = LOBYTE (ElementPtr->scan_node); if (pLanderPrim == 0) @@ -859,10 +860,10 @@ which_node = HIBYTE (ElementPtr->scan_node) - 1; pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] |= (1L << which_node); - pSolarSysState->CurNode = (COUNT)~0; + allNodes = (COUNT)~0; callGenerateForScanType (pSolarSysState, pSolarSysState->pOrbitalDesc, - &pSolarSysState->CurNode, scan); + &allNodes, scan); if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] & (1L << which_node))) Modified: trunk/sc2/src/uqm/planets/planets.h =================================================================== --- trunk/sc2/src/uqm/planets/planets.h 2011-04-20 18:23:17 UTC (rev 3576) +++ trunk/sc2/src/uqm/planets/planets.h 2011-04-20 18:54:27 UTC (rev 3577) @@ -204,7 +204,6 @@ SYSTEM_INFO SysInfo; - COUNT CurNode; const GenerateFunctions *genFuncs; // Functions to call to fill in various parts of this structure. // See generate.h, doc/devel/generate Modified: trunk/sc2/src/uqm/planets/scan.c =================================================================== --- trunk/sc2/src/uqm/planets/scan.c 2011-04-20 18:23:17 UTC (rev 3576) +++ trunk/sc2/src/uqm/planets/scan.c 2011-04-20 18:54:27 UTC (rev 3577) @@ -1337,15 +1337,15 @@ f = SetAbsFrameIndex (MiscDataFrame, NUM_SCANDOT_TRANSITIONS * (scan - ENERGY_SCAN)); - pSolarSysState->CurNode = (COUNT)~0; + num_nodes = (COUNT)~0; callGenerateForScanType (pSolarSysState, - pSolarSysState->pOrbitalDesc, &pSolarSysState->CurNode, scan); + pSolarSysState->pOrbitalDesc, &num_nodes, scan); - num_nodes = pSolarSysState->CurNode; while (num_nodes--) { HELEMENT hNodeElement; ELEMENT *NodeElementPtr; + COUNT whichNode; if (isNodeRetrieved (&pSolarSysState->SysInfo.PlanetInfo, scan, num_nodes)) @@ -1357,9 +1357,9 @@ LockElement (hNodeElement, &NodeElementPtr); - pSolarSysState->CurNode = num_nodes; + whichNode = num_nodes; callGenerateForScanType (pSolarSysState, - pSolarSysState->pOrbitalDesc, &pSolarSysState->CurNode, + pSolarSysState->pOrbitalDesc, &whichNode, scan); NodeElementPtr->scan_node = MAKE_WORD (scan, num_nodes + 1); Modified: trunk/sc2/src/uqm/uqmdebug.c =================================================================== --- trunk/sc2/src/uqm/uqmdebug.c 2011-04-20 18:23:17 UTC (rev 3576) +++ trunk/sc2/src/uqm/uqmdebug.c 2011-04-20 18:54:27 UTC (rev 3577) @@ -31,6 +31,7 @@ #include "gendef.h" #include "globdata.h" #include "planets/lifeform.h" +#include "planets/scan.h" #include "races.h" #include "setup.h" #include "state.h" @@ -1054,17 +1055,16 @@ assert (system->pOrbitalDesc == world); - ((SOLARSYS_STATE *) system)->CurNode = (COUNT)~0; - (*system->genFuncs->generateLife) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); - numBio = system->CurNode; + numBio = (COUNT)~0; + callGenerateForScanType ((SOLARSYS_STATE *) system, (PLANET_DESC *) world, + &numBio, BIOLOGICAL_SCAN); result = 0; for (i = 0; i < numBio; i++) { - ((SOLARSYS_STATE *) system)->CurNode = i; - (*system->genFuncs->generateLife) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); + COUNT whichNode = i; + callGenerateForScanType ((SOLARSYS_STATE *) system, + (PLANET_DESC *) world, &whichNode, BIOLOGICAL_SCAN); result += BIO_CREDIT_VALUE * LONIBBLE (CreatureData[ system->SysInfo.PlanetInfo.CurType].ValueAndHitPoints); } @@ -1080,19 +1080,18 @@ assert (system->pOrbitalDesc == world); - ((SOLARSYS_STATE *) system)->CurNode = (COUNT)~0; - (*system->genFuncs->generateLife) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); - numBio = system->CurNode; + numBio = (COUNT)~0; + callGenerateForScanType ((SOLARSYS_STATE *) system, (PLANET_DESC *) world, + &numBio, BIOLOGICAL_SCAN); for (i = 0; i < NUM_CREATURE_TYPES + NUM_SPECIAL_CREATURE_TYPES; i++) bio[i] = 0; for (i = 0; i < numBio; i++) { - ((SOLARSYS_STATE *) system)->CurNode = i; - (*system->genFuncs->generateLife) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); + COUNT whichNode = i; + callGenerateForScanType ((SOLARSYS_STATE *) system, + (PLANET_DESC *) world, &whichNode, BIOLOGICAL_SCAN); bio[system->SysInfo.PlanetInfo.CurType]++; } } @@ -1106,17 +1105,16 @@ assert (system->pOrbitalDesc == world); - ((SOLARSYS_STATE *) system)->CurNode = (COUNT)~0; - (*system->genFuncs->generateMinerals) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); - numDeposits = system->CurNode; + numDeposits = (COUNT)~0; + callGenerateForScanType ((SOLARSYS_STATE *) system, (PLANET_DESC *) world, + &numDeposits, MINERAL_SCAN); result = 0; for (i = 0; i < numDeposits; i++) { - ((SOLARSYS_STATE *) system)->CurNode = i; - (*system->genFuncs->generateMinerals) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); + COUNT whichNode = i; + callGenerateForScanType ((SOLARSYS_STATE *) system, + (PLANET_DESC *) world, &whichNode, MINERAL_SCAN); result += HIBYTE (system->SysInfo.PlanetInfo.CurDensity) * GLOBAL (ElementWorth[ElementCategory ( system->SysInfo.PlanetInfo.CurType)]); @@ -1133,19 +1131,18 @@ assert (system->pOrbitalDesc == world); - ((SOLARSYS_STATE *) system)->CurNode = (COUNT)~0; - (*system->genFuncs->generateMinerals) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); - numDeposits = system->CurNode; + numDeposits = (COUNT)~0; + callGenerateForScanType ((SOLARSYS_STATE *) system, (PLANET_DESC *) world, + &numDeposits, MINERAL_SCAN); for (i = 0; i < NUM_ELEMENT_CATEGORIES; i++) minerals[i] = 0; for (i = 0; i < numDeposits; i++) { - ((SOLARSYS_STATE *) system)->CurNode = i; - (*system->genFuncs->generateMinerals) ((SOLARSYS_STATE *) system, - (PLANET_DESC *) world, &((SOLARSYS_STATE *) system)->CurNode); + COUNT whichNode = i; + callGenerateForScanType ((SOLARSYS_STATE *) system, + (PLANET_DESC *) world, &whichNode, MINERAL_SCAN); minerals[ElementCategory(system->SysInfo.PlanetInfo.CurType)] += HIBYTE (system->SysInfo.PlanetInfo.CurDensity); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-04-20 18:23:24
|
Revision: 3576 http://sc2.svn.sourceforge.net/sc2/?rev=3576&view=rev Author: avolkov Date: 2011-04-20 18:23:17 +0000 (Wed, 20 Apr 2011) Log Message: ----------- Removed obsolete call to generation funcs from ScanPlanet() Modified Paths: -------------- trunk/sc2/src/uqm/planets/scan.c Modified: trunk/sc2/src/uqm/planets/scan.c =================================================================== --- trunk/sc2/src/uqm/planets/scan.c 2011-03-02 18:50:05 UTC (rev 3575) +++ trunk/sc2/src/uqm/planets/scan.c 2011-04-20 18:23:17 UTC (rev 3576) @@ -1003,10 +1003,6 @@ t.align = ALIGN_CENTER; t.CharCount = (COUNT)~0; - pSolarSysState->CurNode = (COUNT)~0; - callGenerateForScanType (pSolarSysState, - pSolarSysState->pOrbitalDesc, &pSolarSysState->CurNode, - scan); t.pStr = GAME_STRING (SCAN_STRING_BASE + scan); LockMutex (GraphicsLock); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-03-02 18:50:11
|
Revision: 3575 http://sc2.svn.sourceforge.net/sc2/?rev=3575&view=rev Author: avolkov Date: 2011-03-02 18:50:05 +0000 (Wed, 02 Mar 2011) Log Message: ----------- Updated user manual for v0.7 Modified Paths: -------------- trunk/sc2/doc/users/manual.txt Modified: trunk/sc2/doc/users/manual.txt =================================================================== --- trunk/sc2/doc/users/manual.txt 2011-02-28 20:08:09 UTC (rev 3574) +++ trunk/sc2/doc/users/manual.txt 2011-03-02 18:50:05 UTC (rev 3575) @@ -1,4 +1,4 @@ -THE UR-QUAN MASTERS v0.6 -- homepage: http://sc2.sf.net/ +THE UR-QUAN MASTERS v0.7 -- homepage: http://sc2.sf.net/ Welcome to the sixth release of the Ur-Quan Masters port. This document will tell you everything you need to play, even if you've @@ -225,7 +225,14 @@ Use 3DO style throbbing slave shield graphic. This somewhat increases the load on CPU while in orbit. Do not use if your CPU cannot handle that. + --safe (no short version) +Start the game in safe mode. Safe mode will ignore stored user settings, +like resolution, fullscreen mode, sound driver, etc. This is useful if +you have somehow wrecked your configuration files and cannot get to the +in-game setup menu to change the settings. + + NOT OFFICIALLY SUPPORTED OPTIONS The following options may not exist in all builds and can change without @@ -675,6 +682,7 @@ Arrow Keys: Scroll through selections ENTER or RIGHT CTRL: Make selection SPACE or RIGHT SHIFT: Up one level + or ESCAPE Conversations @@ -768,18 +776,24 @@ As of version 0.3, The Ur-Quan Masters has basic support for add-on packages. Though it is not very elaborate yet, you can install some -content add-ons. +content add-ons. Add-ons created for UQM releases prior to v0.7 are not +compatible with this release. To continue using your current add-ons, +you will have to obtain or create new add-on packages. -Inside the directory where the content is installed, in the content/packages/ +Inside the directory where the content is installed, in the content/ directory, there is a directory 'addons/'. In this directory, you can +place add-on packages, like 3domusic, 3dovoice, remix and others, or create new directories with .zip files to be used in addition to the -standard content .zip files. +standard content .zip files. Each add-on must contain at least one .rmp +file to tell the game which resources the add-on provides. When you specify the command-line option '--addon <addon>', the .zip files -inside the directory content/packages/addons/<addon> will be included +inside the directory content/addons/<addon> will be included in the game. '--addon' may be specified more than once to enable multiple add-ons. -The Precursors UQM Remix project is intended to be used as an addon. -If you installed UQM 0.6 from the Windows installer, the remix packs -are available as options. Installing any of them will cause the -default shortcuts to include the "remix" addon by default. +Formerly standard packages, 3domusic and 3dovoice are now standard add-ons, +and can be turned on and off from the in-game setup menu. +The Precursors UQM Remix project is intended to be used as an add-on. +If you install UQM 0.7 from the Windows installer, the remix packs +are available as options. The remix add-on can also be turned on and off +from the in-game setup menu. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-28 20:08:15
|
Revision: 3574 http://sc2.svn.sourceforge.net/sc2/?rev=3574&view=rev Author: avolkov Date: 2011-02-28 20:08:09 +0000 (Mon, 28 Feb 2011) Log Message: ----------- v0.7.0 Release Candidate 1 Modified Paths: -------------- trunk/sc2/src/uqmversion.h Modified: trunk/sc2/src/uqmversion.h =================================================================== --- trunk/sc2/src/uqmversion.h 2011-02-28 20:04:09 UTC (rev 3573) +++ trunk/sc2/src/uqmversion.h 2011-02-28 20:08:09 UTC (rev 3574) @@ -19,11 +19,11 @@ #define UQM_MAJOR_VERSION 0 #define UQM_MAJOR_VERSION_S "0" -#define UQM_MINOR_VERSION 6 -#define UQM_MINOR_VERSION_S "6" -#define UQM_PATCH_VERSION 9 -#define UQM_PATCH_VERSION_S "9" -#define UQM_EXTRA_VERSION "" +#define UQM_MINOR_VERSION 7 +#define UQM_MINOR_VERSION_S "7" +#define UQM_PATCH_VERSION 0 +#define UQM_PATCH_VERSION_S "0" +#define UQM_EXTRA_VERSION "-rc1" /* The final version is interpreted as: * printf ("%d.%d.%d%s", UQM_MAJOR_VERSION, UQM_MINOR_VERSION, * UQM_PATCH_VERSION, UQM_EXTRA_VERSION); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-28 20:04:15
|
Revision: 3573 http://sc2.svn.sourceforge.net/sc2/?rev=3573&view=rev Author: avolkov Date: 2011-02-28 20:04:09 +0000 (Mon, 28 Feb 2011) Log Message: ----------- Update (C) years (has it really been 4 years since last release?!) Modified Paths: -------------- trunk/sc2/src/res/UrQuanMasters.rc Modified: trunk/sc2/src/res/UrQuanMasters.rc =================================================================== --- trunk/sc2/src/res/UrQuanMasters.rc 2011-02-28 20:02:38 UTC (rev 3572) +++ trunk/sc2/src/res/UrQuanMasters.rc 2011-02-28 20:04:09 UTC (rev 3573) @@ -42,7 +42,7 @@ VALUE "FileDescription", "The Ur-Quan Masters main executable\0" VALUE "FileVersion", UQM_STRING_VERSION "\0" VALUE "InternalName", "uqm\0" - VALUE "LegalCopyright", "(C) 1992-1993, 2002-2007 by respective authors\0" + VALUE "LegalCopyright", "(C) 1992-1993, 2002-2011 by respective authors\0" #ifdef _DEBUG VALUE "OriginalFilename", "uqmdebug.exe\0" #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-28 20:02:44
|
Revision: 3572 http://sc2.svn.sourceforge.net/sc2/?rev=3572&view=rev Author: avolkov Date: 2011-02-28 20:02:38 +0000 (Mon, 28 Feb 2011) Log Message: ----------- Basic content sanity checks and exit w/o crashing on check failure Modified Paths: -------------- trunk/sc2/src/uqm/setup.c trunk/sc2/src/uqm/starcon.c trunk/sc2/src/uqm.c Modified: trunk/sc2/src/uqm/setup.c =================================================================== --- trunk/sc2/src/uqm/setup.c 2011-02-23 08:08:21 UTC (rev 3571) +++ trunk/sc2/src/uqm/setup.c 2011-02-28 20:02:38 UTC (rev 3572) @@ -110,7 +110,8 @@ return FALSE; /* Load base content. */ - loadIndices (contentDir); + if (loadIndices (contentDir) == 0) + return FALSE; // Must have at least one index in content dir /* Load addons demanded by the current configuration. */ if (opt3doMusic) @@ -139,6 +140,8 @@ COLORMAP ColorMapTab; ColorMapTab = CaptureColorMap (LoadColorMap (STARCON_COLOR_MAP)); + if (ColorMapTab == NULL) + return FALSE; // The most basic resource is missing SetColorMap (GetColorMapAddress (ColorMapTab)); DestroyColorMap (ReleaseColorMap (ColorMapTab)); } Modified: trunk/sc2/src/uqm/starcon.c =================================================================== --- trunk/sc2/src/uqm/starcon.c 2011-02-23 08:08:21 UTC (rev 3571) +++ trunk/sc2/src/uqm/starcon.c 2011-02-28 20:02:38 UTC (rev 3572) @@ -177,10 +177,13 @@ if (!LoadKernel (0,0)) { log_add (log_Fatal, "\n *** FATAL ERROR: Could not load basic content ***\n\nUQM requires at least the base content pack to run properly."); - log_add (log_Fatal, "This file is typically called uqm-%d.%d.0.uqm. UQM was expecting it", UQM_MAJOR_VERSION, UQM_MINOR_VERSION); - log_add (log_Fatal, "in the %s/packages directory.", baseContentPath); + log_add (log_Fatal, "This file is typically called uqm-%d.%d.0-content.uqm. UQM was expecting", UQM_MAJOR_VERSION, UQM_MINOR_VERSION); + log_add (log_Fatal, "it in the %s/packages directory.", baseContentPath); log_add (log_Fatal, "Either your installation did not install the content pack at all, or it\ninstalled it in a different directory.\n\nFix your installation and rerun UQM.\n\n *******************\n"); - exit (EXIT_FAILURE); + log_showBox (true, true); + + MainExited = TRUE; + return EXIT_FAILURE; } log_add (log_Info, "We've loaded the Kernel"); @@ -300,6 +303,7 @@ FreeMasterShipList (); FreeKernel (); + log_showBox (false, false); MainExited = TRUE; (void) threadArg; /* Satisfying compiler (unused parameter) */ Modified: trunk/sc2/src/uqm.c =================================================================== --- trunk/sc2/src/uqm.c 2011-02-23 08:08:21 UTC (rev 3571) +++ trunk/sc2/src/uqm.c 2011-02-28 20:02:38 UTC (rev 3572) @@ -476,8 +476,6 @@ UnInitThreadSystem (); mem_uninit (); } - - log_showBox (false, false); return EXIT_SUCCESS; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcm...@us...> - 2011-02-23 08:08:30
|
Revision: 3571 http://sc2.svn.sourceforge.net/sc2/?rev=3571&view=rev Author: mcmartin Date: 2011-02-23 08:08:21 +0000 (Wed, 23 Feb 2011) Log Message: ----------- Update Windows installer for 0.7.0 RC1. Modified Paths: -------------- trunk/sc2/build/win32_install/uqm-installer.nsi Modified: trunk/sc2/build/win32_install/uqm-installer.nsi =================================================================== --- trunk/sc2/build/win32_install/uqm-installer.nsi 2011-02-21 14:41:18 UTC (rev 3570) +++ trunk/sc2/build/win32_install/uqm-installer.nsi 2011-02-23 08:08:21 UTC (rev 3571) @@ -77,7 +77,7 @@ ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "uqm-0.6.2-installer.exe" +OutFile "uqm-0.7.0-installer.exe" InstallDir "$PROGRAMFILES\The Ur-Quan Masters\" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show @@ -283,7 +283,7 @@ SetOverwrite try File "AUTHORS.txt" File "COPYING.txt" - File "libpng12.dll" + File "libpng12-0.dll" File "Manual.txt" File "ogg.dll" File "OpenAL32.dll" @@ -299,19 +299,12 @@ File "zlib1.dll" SetOverwrite off SetOutPath $UQMUSERDATA - File "keys.cfg" File "uqm.cfg" SetOverwrite try File "uqm-pc.cfg" File "uqm-3do.cfg" - IfFileExists "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" 0 DelOldContent - StrCpy $MD5SUM "a20cacc8e66f5ff1fdf5e1d3a3b93fd2" - md5dll::GetFileMD5 "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" - Pop $0 - StrCmp $MD5SUM $0 0 DelOldContent - CopyFiles "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" "$INSTDIR\content\packages\uqm-0.6.0-3domusic.uqm" -DelOldContent: + # Delete old content Delete "$INSTDIR\content\packages\uqm-0.3-3domusic.zip" Delete "$INSTDIR\content\packages\uqm-0.3-voice.zip" Delete "$INSTDIR\content\packages\uqm-0.3-content.zip" @@ -321,6 +314,9 @@ Delete "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" Delete "$INSTDIR\content\packages\uqm-0.5.0-voice.uqm" Delete "$INSTDIR\content\packages\uqm-0.5.0-content.uqm" + Delete "$INSTDIR\content\packages\uqm-0.6.0-3domusic.uqm" + Delete "$INSTDIR\content\packages\uqm-0.6.0-voice.uqm" + Delete "$INSTDIR\content\packages\uqm-0.6.0-content.uqm" ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -334,9 +330,9 @@ SetOverwrite ifnewer AddSize 12261 StrCpy $MANDATORY 1 - StrCpy $MD5SUM "7e8f0ed8490e24231431420ea2ba6a03" + StrCpy $MD5SUM "5c9114112ed84bd372755f881e235f61" File "content\version" - Push "uqm-0.6.0-content.uqm" + Push "uqm-0.7.0-content.uqm" Push "$INSTDIR\content\packages" Call HandlePackage @@ -356,9 +352,9 @@ SectionIn 1 4 6 AddSize 18536 StrCpy $MANDATORY 0 - StrCpy $MD5SUM "a20cacc8e66f5ff1fdf5e1d3a3b93fd2" - Push "uqm-0.6.0-3domusic.uqm" - Push "$INSTDIR\content\packages" + StrCpy $MD5SUM "86a5e376d9b76888add1d10818f0ab9f" + Push "uqm-0.7.0-3domusic.uqm" + Push "$INSTDIR\content\addons" Call HandlePackage ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -369,9 +365,9 @@ SectionIn 1 4 6 AddSize 112291 StrCpy $MANDATORY 0 - StrCpy $MD5SUM "d31577b896be935cc2238afd07299b8b" - Push "uqm-0.6.0-voice.uqm" - Push "$INSTDIR\content\packages" + StrCpy $MD5SUM "320bd2f278ea06c443048b9fa1e40dbf" + Push "uqm-0.7.0-voice.uqm" + Push "$INSTDIR\content\addons" Call HandlePackage ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -384,11 +380,10 @@ SectionIn 6 AddSize 49012 StrCpy $MANDATORY 0 - StrCpy $MD5SUM "2df402b2951c0187604a81c3997fbb9d" - Push "uqm-remix-pack1.zip" - Push "$INSTDIR\content\packages\addons\remix\" + StrCpy $MD5SUM "09f242d8d72166d1d5ccbd3d99c93e7d" + Push "uqm-remix-disc1.uqm" + Push "$INSTDIR\content\addons\" Call HandlePackage - StrCpy $UQMARGS "--addon remix" ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_END @@ -398,11 +393,10 @@ SectionIn 6 AddSize 58869 StrCpy $MANDATORY 0 - StrCpy $MD5SUM "d5a9fb72b369bf5a5dbca3db9f1e1ea3" - Push "uqm-remix-pack2.zip" - Push "$INSTDIR\content\packages\addons\remix\" + StrCpy $MD5SUM "fbc8bdcb709939d559d8c7216ad15cc2" + Push "uqm-remix-disc2.uqm" + Push "$INSTDIR\content\addons\" Call HandlePackage - StrCpy $UQMARGS "--addon remix" ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_END @@ -412,11 +406,10 @@ SectionIn 6 AddSize 38989 StrCpy $MANDATORY 0 - StrCpy $MD5SUM "567bc2d9e3ca067d21170c5ac5538441" - Push "uqm-remix-pack3.zip" - Push "$INSTDIR\content\packages\addons\remix\" + StrCpy $MD5SUM "5ccc6d4ac301ae98e172ac6835dcdead" + Push "uqm-remix-disc3.uqm" + Push "$INSTDIR\content\addons\" Call HandlePackage - StrCpy $UQMARGS "--addon remix" ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_END @@ -427,9 +420,8 @@ # AddSize 50000 # ESTIMATE: Update later # StrCpy $MANDATORY 0 # Push "uqm-remix-pack4.zip" -# Push "$INSTDIR\content\packages\addons\remix\" +# Push "$INSTDIR\content\addons" # Call HandlePackage -# StrCpy $UQMARGS "--addon remix" # ; Shortcuts # !insertmacro MUI_STARTMENU_WRITE_BEGIN Application # !insertmacro MUI_STARTMENU_WRITE_END @@ -522,9 +514,13 @@ Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack3.zip" Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack2.zip" Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack1.zip" - Delete "$INSTDIR\content\packages\uqm-0.6.0-voice.uqm" - Delete "$INSTDIR\content\packages\uqm-0.6.0-3domusic.uqm" - Delete "$INSTDIR\content\packages\uqm-0.6.0-content.uqm" + Delete "$INSTDIR\content\addons\uqm-remix-disc4.uqm" + Delete "$INSTDIR\content\addons\uqm-remix-disc3.uqm" + Delete "$INSTDIR\content\addons\uqm-remix-disc2.uqm" + Delete "$INSTDIR\content\addons\uqm-remix-disc1.uqm" + Delete "$INSTDIR\content\addons\uqm-0.7.0-voice.uqm" + Delete "$INSTDIR\content\addons\uqm-0.7.0-3domusic.uqm" + Delete "$INSTDIR\content\packages\uqm-0.7.0-content.uqm" Delete "$INSTDIR\content\version" Delete "$INSTDIR\zlib.dll" Delete "$INSTDIR\zlib1.dll" @@ -542,6 +538,7 @@ Delete "$INSTDIR\Manual.txt" Delete "$INSTDIR\libpng13.dll" Delete "$INSTDIR\libpng12.dll" + Delete "$INSTDIR\libpng12-0.dll" Delete "$INSTDIR\COPYING.txt" Delete "$INSTDIR\AUTHORS.txt" Delete "$INSTDIR\stderr.txt" @@ -563,6 +560,7 @@ RMDir "$SMPROGRAMS\$ICONS_GROUP\Documentation" RMDir "$SMPROGRAMS\$ICONS_GROUP" + RMDir "$INSTDIR\content\addons" RMDir "$INSTDIR\content\packages\addons\remix" RMDir "$INSTDIR\content\packages\addons" RMDir "$INSTDIR\content\packages" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-21 14:41:27
|
Revision: 3570 http://sc2.svn.sourceforge.net/sc2/?rev=3570&view=rev Author: avolkov Date: 2011-02-21 14:41:18 +0000 (Mon, 21 Feb 2011) Log Message: ----------- Build fleet queues and name captains in the same exact order on both net sides; fixes bugs 1081 and 989 Modified Paths: -------------- trunk/sc2/ChangeLog trunk/sc2/src/uqm/supermelee/pickmele.c Modified: trunk/sc2/ChangeLog =================================================================== --- trunk/sc2/ChangeLog 2011-02-21 03:42:01 UTC (rev 3569) +++ trunk/sc2/ChangeLog 2011-02-21 14:41:18 UTC (rev 3570) @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Same captain names are used on both net sides (bug #989) - Alex +- Fixed sync loss in netplay games having duplicate ships (bug #1081) - Alex - Fixed loading of melee.cfg (bug #1099) - Alex - Fixed the 64KB size limitation on key-value files (bug #1112) - Alex - Update download paths for the new SourceForge File Release system - Michael Modified: trunk/sc2/src/uqm/supermelee/pickmele.c =================================================================== --- trunk/sc2/src/uqm/supermelee/pickmele.c 2011-02-21 03:42:01 UTC (rev 3569) +++ trunk/sc2/src/uqm/supermelee/pickmele.c 2011-02-21 14:41:18 UTC (rev 3570) @@ -507,20 +507,22 @@ void FillPickMeleeFrame (MeleeSetup *setup) { - COUNT sideI; + COUNT i; CONTEXT OldContext; OldContext = SetContext (OffScreenContext); - for (sideI = 0; sideI < NUM_SIDES; ++sideI) + for (i = 0; i < NUM_SIDES; ++i) { COUNT side; + COUNT sideI; RECT r; TEXT t; STAMP s; UNICODE buf[30]; FleetShipIndex index; + sideI = GetPlayerOrder (i); side = !sideI; s.frame = SetAbsFrameIndex (PickMeleeFrame, side); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcm...@us...> - 2011-02-21 03:42:07
|
Revision: 3569 http://sc2.svn.sourceforge.net/sc2/?rev=3569&view=rev Author: mcmartin Date: 2011-02-21 03:42:01 +0000 (Mon, 21 Feb 2011) Log Message: ----------- add addon info data to the core addon packs Added Paths: ----------- trunk/sc2/content/addons/3domusic/uqmpack.nfo trunk/sc2/content/addons/3dovideo/uqmpack.nfo trunk/sc2/content/addons/3dovoice/uqmpack.nfo Added: trunk/sc2/content/addons/3domusic/uqmpack.nfo =================================================================== --- trunk/sc2/content/addons/3domusic/uqmpack.nfo (rev 0) +++ trunk/sc2/content/addons/3domusic/uqmpack.nfo 2011-02-21 03:42:01 UTC (rev 3569) @@ -0,0 +1,6 @@ +name=3DO Music Pack +author=Toys For Bob +version=2 +description=Alternate musical tracks from the 3DO version of the game. +year=1992 +min_uqm_version=0.7 Added: trunk/sc2/content/addons/3dovideo/uqmpack.nfo =================================================================== --- trunk/sc2/content/addons/3dovideo/uqmpack.nfo (rev 0) +++ trunk/sc2/content/addons/3dovideo/uqmpack.nfo 2011-02-21 03:42:01 UTC (rev 3569) @@ -0,0 +1,6 @@ +name=3DO Video Pack +author=Crystal Dynamics +version=2 +description=Video resources from the 3DO version of the game. +year=1992 +min_uqm_version=0.7 Added: trunk/sc2/content/addons/3dovoice/uqmpack.nfo =================================================================== --- trunk/sc2/content/addons/3dovoice/uqmpack.nfo (rev 0) +++ trunk/sc2/content/addons/3dovoice/uqmpack.nfo 2011-02-21 03:42:01 UTC (rev 3569) @@ -0,0 +1,6 @@ +name=3DO Voice Pack +author=Toys for Bob +version=2 +description=Voiceovers from the 3DO version of the game. +year=1992 +min_uqm_version=0.7 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Mee...@us...> - 2011-02-16 18:05:32
|
Revision: 3568 http://sc2.svn.sourceforge.net/sc2/?rev=3568&view=rev Author: Meep-Eep Date: 2011-02-16 18:05:26 +0000 (Wed, 16 Feb 2011) Log Message: ----------- Typo. Modified Paths: -------------- trunk/sc2/WhatsNew Modified: trunk/sc2/WhatsNew =================================================================== --- trunk/sc2/WhatsNew 2011-02-16 11:44:06 UTC (rev 3567) +++ trunk/sc2/WhatsNew 2011-02-16 18:05:26 UTC (rev 3568) @@ -79,7 +79,7 @@ - Ending a battle with a simultaneous death no longer triggers an assertion - Fixed a crash on startup if uqm.cfg did not exist -- Extremely rapid will no longer be lost at low framerates +- Extremely rapid key presses will no longer be lost at low framerates - 3DO videos now work after a resolution change - OpenGL texture loading uses surface pitch instead of screen width, improving compatibility across older graphics cards. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-16 11:44:15
|
Revision: 3567 http://sc2.svn.sourceforge.net/sc2/?rev=3567&view=rev Author: avolkov Date: 2011-02-16 11:44:06 +0000 (Wed, 16 Feb 2011) Log Message: ----------- Update instructions for new library versions and download locations Modified Paths: -------------- trunk/sc2/INSTALL.msvc Modified: trunk/sc2/INSTALL.msvc =================================================================== --- trunk/sc2/INSTALL.msvc 2011-02-16 08:40:34 UTC (rev 3566) +++ trunk/sc2/INSTALL.msvc 2011-02-16 11:44:06 UTC (rev 3567) @@ -40,16 +40,16 @@ packages. 3.2 Install the SDL SDK: -- Download SDL-devel-1.2.11-VC6.zip from +- Download SDL-devel-1.2.14-VC6.zip from http://www.libsdl.org/download-1.2.php - Use WinZip to Extract the .zip file in "C:\Build" - A folder "SDL-1.2.11" will be created. + A folder "SDL-1.2.14" will be created. 3.3 Install the SDL_image SDK: -- Download SDL_image-devel-1.2.5-VC6.zip from +- Download SDL_image-devel-1.2.10-VC.zip from http://www.libsdl.org/projects/SDL_image/ - Use WinZip to Extract the .zip file in "C:\Build" - A folder "SDL_image-1.2.5" will be created. + A folder "SDL_image-1.2.10" will be created. 3.4 Install the Ogg Vorbis SDK - Download @@ -64,10 +64,10 @@ - Extract "zlib123-dll.zip" in C:\Build\zlib-1.2.3\" 3.6 Install OpenAL -- Download http://developer.creative.com/articles/article.asp?aid=45&file=OpenAL11CoreSDK.exe -- Run the installer and follow the instructions +- Download http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip +- Unzip and run the installer and follow the instructions - Create a directory "AL" in "C:\Program Files\OpenAL 1.1 SDK\include" -- Move all the .h files from "C:\Program Files\OpenAL 1.1 SDK\include" +- Copy all the .h files from "C:\Program Files\OpenAL 1.1 SDK\include" into the newly created "AL" directory. @@ -86,12 +86,12 @@ 4.2. Copy the runtime libraries where they can be found by UQM when run from MSVC++. - Copy the following files to "C:\Build\sc2\": - - "C:\Build\SDL-1.2.11\lib\SDL.dll" - - "C:\Build\SDL_image-1.2.5\lib\jpeg.dll" - - "C:\Build\SDL_image-1.2.5\lib\libpng12.dll" - - "C:\Build\SDL_image-1.2.5\lib\libtiff.dll" - - "C:\Build\SDL_image-1.2.5\lib\SDL_image.dll" - - "C:\Build\SDL_image-1.2.5\lib\zlib1.dll" + - "C:\Build\SDL-1.2.14\lib\SDL.dll" + - "C:\Build\SDL_image-1.2.10\lib\jpeg.dll" + - "C:\Build\SDL_image-1.2.10\lib\libpng12-0.dll" + - "C:\Build\SDL_image-1.2.10\lib\libtiff-3.dll" + - "C:\Build\SDL_image-1.2.10\lib\SDL_image.dll" + - "C:\Build\SDL_image-1.2.10\lib\zlib1.dll" - "C:\Build\oggvorbis-win32sdk-1.0.1\bin\ogg.dll" - "C:\Build\oggvorbis-win32sdk-1.0.1\bin\ogg_d.dll" - "C:\Build\oggvorbis-win32sdk-1.0.1\bin\vorbis.dll" @@ -119,8 +119,8 @@ - Add the paths to the "include" folders of all of the dependency libraries: - "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include" - - "C:\Build\SDL-1.2.11\include" - - "C:\Build\SDL_image-1.2.5\include" + - "C:\Build\SDL-1.2.14\include" + - "C:\Build\SDL_image-1.2.10\include" - "C:\Build\oggvorbis-win32sdk-1.0.1\include" - "C:\Program Files\OpenAL 1.1 SDK\include" - "C:\Build\zlib-1.2.3\include" @@ -133,8 +133,8 @@ - Add the paths to the "lib" folders of all of the dependency libraries: - "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - - "C:\Build\SDL-1.2.11\lib" - - "C:\Build\SDL_image-1.2.5\lib" + - "C:\Build\SDL-1.2.14\lib" + - "C:\Build\SDL_image-1.2.10\lib" - "C:\Build\oggvorbis-win32sdk-1.0.1\lib" - "C:\Program Files\OpenAL 1.1 SDK\libs\Win32" - "C:\Build\zlib-1.2.3\lib" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcm...@us...> - 2011-02-16 08:40:41
|
Revision: 3566 http://sc2.svn.sourceforge.net/sc2/?rev=3566&view=rev Author: mcmartin Date: 2011-02-16 08:40:34 +0000 (Wed, 16 Feb 2011) Log Message: ----------- Update WhatsNew, summarizing the changelog Modified Paths: -------------- trunk/sc2/WhatsNew Modified: trunk/sc2/WhatsNew =================================================================== --- trunk/sc2/WhatsNew 2011-02-16 07:02:49 UTC (rev 3565) +++ trunk/sc2/WhatsNew 2011-02-16 08:40:34 UTC (rev 3566) @@ -12,6 +12,91 @@ unlikely to be of interest to you unless you plan on coding extensions. + Version 0.7 + ------------- + +NEW FEATURES + +- Remixes are now selectable from the setup menu +- "Safe mode", which will ignore settings. Useful if you've somehow + wrecked your configuration files. +- Added --addondir commandline option - Mika +- Added --keepaspectratio to keep correct aspect ratio when using + custom resolutions in OpenGL mode - Mika +- New addon machanism allows greater flexibility for selecting which + resource goes with which game element. +- Joystick text input improved +- Unicode strings now could theoretically support UCS-4 on all platforms +- Experimental support for Symbian S60 3rd edition - Mika & SvdB +- Support for Windows CE. - SvdB with Pavel Chernikov +- Added fullscreen/windowed toggle key F11 (bug #578) - Mika +- Support for 3do "ship spin" videos + +BALANCE/GAME FLOW CHANGES +- Do not match singular stars when given a prefix in star search +- Properly account for simultaneous destruction in SuperMelee. +- Druuge no longer turn hostile after attempting a salvage +- Canceling load from the main menu returns to main menu +- Better location description in savegame summaries +- Fixed Mmrnmhrm's X-Form transformation without energy use (bug #1004) - Alex +- 999.9:999.9 is now reachable in HyperSpace +- Fuel and distance estimates are now more accurate +- Analog joysticks less sensitive to jitter +- Gas giants can no longer have negative masses +- Fixed enemy ships getting recrewed between encounters in HyperSpace +- Fixed wrong Sa-Matra guards icons after Kohr-Ah win (bug #1001) - Alex +- Cancel key will now quit out of the Manifest Menu (Bug #838) - Michael +- Error boxes on MacOSX are now actually native to the OS - no need to check + Console.app anymore. + +BUGFIXES + +- Old Windows installer was horribly obsolete; fixed now. +- Fixed rendering error when entering the orbit of a shielded planet +- Fixed planet blinking when exiting scan +- Menu sounds restored after editing a control set name. +- Fixed a freeze when quickly escaping melee. +- Fixed misaligned cargo count +- Fixed a crash when filling fuel tanks over 10 +- Comm code rewrite, fixing a lot of minor annoyances +- Team configuration in netplay no longer desyncs +- Fixed Melee menu timeout when both sides are Cyborgs +- Fixed AI ship not moving on warp in +- Revert gfx settings entirely when a mode switch fails +- Fix for weird colors problem on MacOSX w/ SDL 1.2.14 +- Lander will no longer hang when killed on planets with a lot of + natural disasters +- Fixed crash when saving a game into the last slot while having + too many devices on board +- Fixed crashes and potential weirdness when loading savegames from + a Homeworld encounter screen +- Fixed a crash when conversing with music disabled +- Extremely busy battle sequences (Orz vs. Orz with many space marines + out, for instance) no longer introduces graphical glitches +- Fixed rendering bug that would occasionally make a ship just be solid + blue all the time +- Objects in melee made of multiple "parts" no longer jitter during zoom +- Ending a battle with a simultaneous death no longer triggers an + assertion +- Fixed a crash on startup if uqm.cfg did not exist +- Extremely rapid will no longer be lost at low framerates +- 3DO videos now work after a resolution change +- OpenGL texture loading uses surface pitch instead of screen width, + improving compatibility across older graphics cards. +- Miscellaneous conversational typo and timing fixes + +INTERNAL CHANGES + +- Code cleanup; many warnings removed +- Massive changes to the way the resource system works. This is + mostly interesting in that 3DO voices, 3DO videos, and 3DO music + are now addon packs like any other. +- Code reorganization; old stuff removed, new stuff better set-up +- 32-bit graphics everywhere internally. +- Refactored universe generation +- Pthread support - Mika +- Removed the 256-frame limit on .ani files - Michael + Version 0.6 ------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcm...@us...> - 2011-02-16 07:02:55
|
Revision: 3565 http://sc2.svn.sourceforge.net/sc2/?rev=3565&view=rev Author: mcmartin Date: 2011-02-16 07:02:49 +0000 (Wed, 16 Feb 2011) Log Message: ----------- Add Escape as another alternative for menu.cancel Modified Paths: -------------- trunk/sc2/content/menu.key Modified: trunk/sc2/content/menu.key =================================================================== --- trunk/sc2/content/menu.key 2011-02-15 20:30:05 UTC (rev 3564) +++ trunk/sc2/content/menu.key 2011-02-16 07:02:49 UTC (rev 3565) @@ -25,6 +25,7 @@ select.2 = STRING:key RightControl cancel.1 = STRING:key Space cancel.2 = STRING:key RightShift +cancel.3 = STRING:key Escape # ... and the number pad. Note that zoom controls on the starmap are # different from the paging controls in Super Melee. @@ -39,7 +40,7 @@ zoomin.2 = STRING:key Keypad-+ zoomout.2 = STRING:key Keypad-- select.3 = STRING:key Keypad-Enter -cancel.3 = STRING:key Keypad-0 +cancel.4 = STRING:key Keypad-0 # System utility keys. delete.1 = STRING:key Delete @@ -67,7 +68,7 @@ left.4 = STRING:joystick 0 hat 0 left right.4 = STRING:joystick 0 hat 0 right -cancel.4 = STRING:joystick 0 button 1 +cancel.5 = STRING:joystick 0 button 1 select.4 = STRING:joystick 0 button 0 up.5 = STRING:joystick 1 axis 1 negative @@ -80,5 +81,5 @@ left.6 = STRING:joystick 1 hat 0 left right.6 = STRING:joystick 1 hat 0 right -cancel.5 = STRING:joystick 1 button 1 +cancel.6 = STRING:joystick 1 button 1 select.5 = STRING:joystick 1 button 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Mee...@us...> - 2011-02-15 20:30:11
|
Revision: 3564 http://sc2.svn.sourceforge.net/sc2/?rev=3564&view=rev Author: Meep-Eep Date: 2011-02-15 20:30:05 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Forgot to commit this one. Added Paths: ----------- trunk/sc2/build/unix/recurse Added: trunk/sc2/build/unix/recurse =================================================================== --- trunk/sc2/build/unix/recurse (rev 0) +++ trunk/sc2/build/unix/recurse 2011-02-15 20:30:05 UTC (rev 3564) @@ -0,0 +1,88 @@ +#!/bin/sh + +# Generic code for traversing the source code directory structure according to +# the Makeinfo files. + +usage() { + cat << EOF +Usage: + recurse <project> <root> + +With the parameters: + <project> + The name identifying the project, used as prefix in variables in + 'Makeproject' and 'Makeinfo'. + + <root> + The root directory, containing 'Makeproject'. +EOF +} + +if [ $# -ne 2 ]; then + usage >&2 + exit 1 +fi + +BUILD_PROJECT=$1 +BUILD_ROOT=${2%/}/ + +# $1 - The prefix up to this point +# $2 - The name of the current subdir +recurse_subdir() { + local REC_PREFIX SUBDIRS SUBDIR CFILES CXXFILES HFILES MFILES RCFILES FILE + eval local ${BUILD_PROJECT}_CFILES \ + ${BUILD_PROJECT}_CXXFILES \ + ${BUILD_PROJECT}_HFILES \ + ${BUILD_PROJECT}_MFILES \ + ${BUILD_PROJECT}_RCFILES \ + ${BUILD_PROJECT}_SUBDIRS + + REC_PREFIX="$1$2/" + if [ "$REC_PREFIX" = "/" ]; then + REC_PREFIX= + fi + + eval ${BUILD_PROJECT}_CFILES= + eval ${BUILD_PROJECT}_CXXFILES= + eval ${BUILD_PROJECT}_HFILES= + eval ${BUILD_PROJECT}_MFILES= + eval ${BUILD_PROJECT}_RCFILES= + eval ${BUILD_PROJECT}_SUBDIRS= + + . "${BUILD_ROOT}${REC_PREFIX}Makeinfo" + + eval CFILES=\$${BUILD_PROJECT}_CFILES + eval CXXFILES=\$${BUILD_PROJECT}_CXXFILES + eval HFILES=\$${BUILD_PROJECT}_HFILES + eval MFILES=\$${BUILD_PROJECT}_MFILES + eval RCFILES=\$${BUILD_PROJECT}_RCFILES + + for FILE in $CFILES; do + echo "C ${OBJDIR}${REC_PREFIX}$FILE" + done + for FILE in $CXXFILES; do + echo "CXX ${OBJDIR}${REC_PREFIX}$FILE" + done + for FILE in $HFILES; do + echo "H ${OBJDIR}${REC_PREFIX}$FILE" + done + for FILE in $MFILES; do + echo "M ${OBJDIR}${REC_PREFIX}$FILE" + done + for FILE in $RCFILES; do + echo "RC ${OBJDIR}${REC_PREFIX}$FILE" + done + + eval SUBDIRS=\$${BUILD_PROJECT}_SUBDIRS + + for SUBDIR in $SUBDIRS; do + echo "DIRIN ${OBJDIR}${REC_PREFIX}$SUBDIR" + recurse_subdir "$REC_PREFIX" "$SUBDIR" + echo "DIROUT ${OBJDIR}${REC_PREFIX}$SUBDIR" + done +} + +. "${BUILD_ROOT}Makeproject" + +recurse_subdir "" "" + Property changes on: trunk/sc2/build/unix/recurse ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 18:06:48
|
Revision: 3563 http://sc2.svn.sourceforge.net/sc2/?rev=3563&view=rev Author: avolkov Date: 2011-02-15 18:06:42 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Re-add config.h to dsp Modified Paths: -------------- trunk/sc2/build/msvc6/UrQuanMasters.dsp Modified: trunk/sc2/build/msvc6/UrQuanMasters.dsp =================================================================== --- trunk/sc2/build/msvc6/UrQuanMasters.dsp 2011-02-15 17:56:10 UTC (rev 3562) +++ trunk/sc2/build/msvc6/UrQuanMasters.dsp 2011-02-15 18:06:42 UTC (rev 3563) @@ -3655,6 +3655,10 @@ # End Group # Begin Source File +SOURCE=..\..\src\config.h +# End Source File +# Begin Source File + SOURCE=..\..\src\config_vc6.h # End Source File # Begin Source File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 17:56:16
|
Revision: 3562 http://sc2.svn.sourceforge.net/sc2/?rev=3562&view=rev Author: avolkov Date: 2011-02-15 17:56:10 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Correct the include guard in config_vc6.h to reflect its actual name Modified Paths: -------------- trunk/sc2/src/config_vc6.h Modified: trunk/sc2/src/config_vc6.h =================================================================== --- trunk/sc2/src/config_vc6.h 2011-02-15 17:49:41 UTC (rev 3561) +++ trunk/sc2/src/config_vc6.h 2011-02-15 17:56:10 UTC (rev 3562) @@ -7,8 +7,8 @@ * config_win.h is generated from src/config_win.h.in. */ -#ifndef _CONFIG_H -#define _CONFIG_H +#ifndef _CONFIG_VC6_H +#define _CONFIG_VC6_H /* Directory where the UQM game data is located */ #define CONTENTDIR "../content/" @@ -57,5 +57,5 @@ /* Defined if your system has wint_t of its own */ #define HAVE_WINT_T -#endif /* _CONFIG_H */ +#endif /* _CONFIG_VC6_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 17:49:47
|
Revision: 3561 http://sc2.svn.sourceforge.net/sc2/?rev=3561&view=rev Author: avolkov Date: 2011-02-15 17:49:41 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Fix broken link to config.h and change to actual config_vc6.h while at it Modified Paths: -------------- trunk/sc2/build/msvc6/UrQuanMasters.dsp Modified: trunk/sc2/build/msvc6/UrQuanMasters.dsp =================================================================== --- trunk/sc2/build/msvc6/UrQuanMasters.dsp 2011-02-15 14:15:07 UTC (rev 3560) +++ trunk/sc2/build/msvc6/UrQuanMasters.dsp 2011-02-15 17:49:41 UTC (rev 3561) @@ -3655,7 +3655,7 @@ # End Group # Begin Source File -SOURCE=config.h +SOURCE=..\..\src\config_vc6.h # End Source File # Begin Source File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 14:15:13
|
Revision: 3560 http://sc2.svn.sourceforge.net/sc2/?rev=3560&view=rev Author: avolkov Date: 2011-02-15 14:15:07 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Give fades an own mutex instead of sharing one with colormap xforms; decreases console spam during Slylandro comm Modified Paths: -------------- trunk/sc2/src/libs/graphics/cmap.c Modified: trunk/sc2/src/libs/graphics/cmap.c =================================================================== --- trunk/sc2/src/libs/graphics/cmap.c 2011-02-15 13:05:00 UTC (rev 3559) +++ trunk/sc2/src/libs/graphics/cmap.c 2011-02-15 14:15:07 UTC (rev 3560) @@ -50,6 +50,7 @@ static int fadeDelta; static TimeCount fadeStartTime; static sint32 fadeInterval; +static Mutex fadeLock; #define SPARE_COLORMAPS 20 @@ -60,7 +61,7 @@ static TFB_ColorMap * colormaps[MAX_COLORMAPS]; static int mapcount; -Mutex maplock; +static Mutex maplock; void @@ -76,6 +77,8 @@ XFormControl.Lock = CreateMutex ("Transform Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO); for (i = 0; i < MAX_XFORMS; ++i) XFormControl.TaskControl[i].CMapIndex = -1; + + fadeLock = CreateMutex ("Fade Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO); } void @@ -90,6 +93,7 @@ HFree (poolhead); } + DestroyMutex (fadeLock); // uninit xform control DestroyMutex (XFormControl.Lock); @@ -317,7 +321,7 @@ { int newAmount; - LockMutex (XFormControl.Lock); + LockMutex (fadeLock); if (fadeInterval) { // have a pending fade @@ -341,7 +345,7 @@ newAmount = fadeAmount; } - UnlockMutex (XFormControl.Lock); + UnlockMutex (fadeLock); return newAmount; } @@ -359,9 +363,9 @@ static void FlushFadeXForms (void) { - LockMutex (XFormControl.Lock); + LockMutex (fadeLock); finishPendingFade (); - UnlockMutex (XFormControl.Lock); + UnlockMutex (fadeLock); } DWORD @@ -392,7 +396,7 @@ if (QuitPosted) TimeInterval = 0; - LockMutex (XFormControl.Lock); + LockMutex (fadeLock); finishPendingFade (); @@ -411,7 +415,7 @@ TimeOut = fadeStartTime + TimeInterval + 1; } - UnlockMutex (XFormControl.Lock); + UnlockMutex (fadeLock); return TimeOut; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 13:05:07
|
Revision: 3559 http://sc2.svn.sourceforge.net/sc2/?rev=3559&view=rev Author: avolkov Date: 2011-02-15 13:05:00 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Fix melee.cfg loading: correct check for file size, calc fleet value after loading; bug #1099 Modified Paths: -------------- trunk/sc2/ChangeLog trunk/sc2/src/uqm/supermelee/melee.c trunk/sc2/src/uqm/supermelee/meleesetup.c trunk/sc2/src/uqm/supermelee/meleesetup.h Modified: trunk/sc2/ChangeLog =================================================================== --- trunk/sc2/ChangeLog 2011-02-15 12:04:28 UTC (rev 3558) +++ trunk/sc2/ChangeLog 2011-02-15 13:05:00 UTC (rev 3559) @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Fixed loading of melee.cfg (bug #1099) - Alex - Fixed the 64KB size limitation on key-value files (bug #1112) - Alex - Update download paths for the new SourceForge File Release system - Michael - Fix UAC issues with installer for cleaner Vista/Win7 installs - Michael Modified: trunk/sc2/src/uqm/supermelee/melee.c =================================================================== --- trunk/sc2/src/uqm/supermelee/melee.c 2011-02-15 12:04:28 UTC (rev 3558) +++ trunk/sc2/src/uqm/supermelee/melee.c 2011-02-15 13:05:00 UTC (rev 3559) @@ -2004,7 +2004,7 @@ if (uio_fstat(uio_streamHandle(stream), &sb) == -1) goto err; - if ((size_t) sb.st_size != (1 + MeleeTeam_size) * NUM_SIDES) + if ((size_t) sb.st_size != (1 + MeleeTeam_serialSize) * NUM_SIDES) goto err; } Modified: trunk/sc2/src/uqm/supermelee/meleesetup.c =================================================================== --- trunk/sc2/src/uqm/supermelee/meleesetup.c 2011-02-15 12:04:28 UTC (rev 3558) +++ trunk/sc2/src/uqm/supermelee/meleesetup.c 2011-02-15 13:05:00 UTC (rev 3559) @@ -25,7 +25,8 @@ /////////////////////////////////////////////////////////////////////////// // Temporary -const size_t MeleeTeam_size = sizeof (MeleeTeam); +const size_t MeleeTeam_serialSize = MELEE_FLEET_SIZE + + sizeof (((MeleeTeam*)0)->name); void MeleeTeam_init (MeleeTeam *team) @@ -323,7 +324,10 @@ uio_Stream *stream) { MeleeTeam *team = &setup->teams[teamNr]; - return MeleeTeam_deserialize (team, stream); + int ret = MeleeTeam_deserialize (team, stream); + if (ret == 0) + setup->fleetValue[teamNr] = MeleeTeam_getValue (team); + return ret; } int Modified: trunk/sc2/src/uqm/supermelee/meleesetup.h =================================================================== --- trunk/sc2/src/uqm/supermelee/meleesetup.h 2011-02-15 12:04:28 UTC (rev 3558) +++ trunk/sc2/src/uqm/supermelee/meleesetup.h 2011-02-15 13:05:00 UTC (rev 3559) @@ -64,7 +64,7 @@ #endif /* MELEESETUP_INTERNAL */ -extern const size_t MeleeTeam_size; +extern const size_t MeleeTeam_serialSize; void MeleeTeam_init (MeleeTeam *team); void MeleeTeam_uninit (MeleeTeam *team); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-02-15 12:04:34
|
Revision: 3558 http://sc2.svn.sourceforge.net/sc2/?rev=3558&view=rev Author: avolkov Date: 2011-02-15 12:04:28 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Change ReadResFile/WriteResFile interface to take size_t args; removes 64KB size limitation on key-value files; bug #1112 Modified Paths: -------------- trunk/sc2/ChangeLog trunk/sc2/src/libs/reslib.h trunk/sc2/src/libs/resource/filecntl.c trunk/sc2/src/libs/resource/getres.c trunk/sc2/src/libs/resource/loadres.c trunk/sc2/src/libs/resource/propfile.c trunk/sc2/src/libs/strings/getstr.c trunk/sc2/src/uqm/load.c trunk/sc2/src/uqm/save.c Modified: trunk/sc2/ChangeLog =================================================================== --- trunk/sc2/ChangeLog 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/ChangeLog 2011-02-15 12:04:28 UTC (rev 3558) @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Fixed the 64KB size limitation on key-value files (bug #1112) - Alex - Update download paths for the new SourceForge File Release system - Michael - Fix UAC issues with installer for cleaner Vista/Win7 installs - Michael - Fixed compilation with Netplay disabled (bug #1091), from Sze Howe Koh Modified: trunk/sc2/src/libs/reslib.h =================================================================== --- trunk/sc2/src/libs/reslib.h 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/reslib.h 2011-02-15 12:04:28 UTC (rev 3558) @@ -48,14 +48,14 @@ void *LoadResourceFromPath(const char *pathname, ResourceLoadFileFun fn); uio_Stream *res_OpenResFile (uio_DirHandle *dir, const char *filename, const char *mode); -int ReadResFile (void *lpBuf, COUNT size, COUNT count, uio_Stream *fp); -int WriteResFile (const void *lpBuf, COUNT size, COUNT count, uio_Stream *fp); +size_t ReadResFile (void *lpBuf, size_t size, size_t count, uio_Stream *fp); +size_t WriteResFile (const void *lpBuf, size_t size, size_t count, uio_Stream *fp); int GetResFileChar (uio_Stream *fp); int PutResFileChar (char ch, uio_Stream *fp); int PutResFileNewline (uio_Stream *fp); long SeekResFile (uio_Stream *fp, long offset, int whence); long TellResFile (uio_Stream *fp); -long LengthResFile (uio_Stream *fp); +size_t LengthResFile (uio_Stream *fp); BOOLEAN res_CloseResFile (uio_Stream *fp); BOOLEAN DeleteResFile (uio_DirHandle *dir, const char *filename); Modified: trunk/sc2/src/libs/resource/filecntl.c =================================================================== --- trunk/sc2/src/libs/resource/filecntl.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/resource/filecntl.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -60,8 +60,8 @@ return (uio_unlink (dir, filename) == 0); } -int -ReadResFile (void *lpBuf, COUNT size, COUNT count, uio_Stream *fp) +size_t +ReadResFile (void *lpBuf, size_t size, size_t count, uio_Stream *fp) { int retval; @@ -70,8 +70,8 @@ return (retval); } -int -WriteResFile (const void *lpBuf, COUNT size, COUNT count, uio_Stream *fp) +size_t +WriteResFile (const void *lpBuf, size_t size, size_t count, uio_Stream *fp) { int retval; @@ -131,7 +131,7 @@ return (retval); } -long +size_t LengthResFile (uio_Stream *fp) { struct stat sb; Modified: trunk/sc2/src/libs/resource/getres.c =================================================================== --- trunk/sc2/src/libs/resource/getres.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/resource/getres.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -43,7 +43,7 @@ LoadResourceFromPath (const char *path, ResourceLoadFileFun *loadFun) { uio_Stream *stream; - long dataLen; + unsigned long dataLen; void *resdata; stream = res_OpenResFile (contentDir, path, "rb"); Modified: trunk/sc2/src/libs/resource/loadres.c =================================================================== --- trunk/sc2/src/libs/resource/loadres.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/resource/loadres.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -17,56 +17,38 @@ */ #include "resintrn.h" -#include "libs/declib.h" #include "libs/memlib.h" +#include "libs/log.h" void * GetResourceData (uio_Stream *fp, DWORD length) { - BYTE *RDPtr; void *result; - DECODE_REF fh = 0; + DWORD compLen; - if (length == ~(DWORD)0) - length = LengthResFile (fp); - else if ((fh = copen (fp, FILE_STREAM, STREAM_READ))) - cfilelength (fh, &length); - else - length -= sizeof (DWORD); + // Resource data used to be prefixed by its length in package files. + // A valid length prefix indicated compressed data, and + // a length prefix ~0 meant uncompressed. + // Currently, .ct and .xlt files still carry a ~0 length prefix. + if (ReadResFile (&compLen, sizeof (compLen), 1, fp) != 1) + return NULL; + if (compLen != ~(DWORD)0) + { + log_add (log_Warning, "LZ-compressed binary data not supported"); + return NULL; + } + length -= sizeof (DWORD); result = AllocResourceData (length); - RDPtr = result; - if (RDPtr) - { - COUNT num_read; + if (!result) + return NULL; - do - { -#define READ_LENGTH 0x00007FFFL - num_read = length >= READ_LENGTH ? - (COUNT)READ_LENGTH : (COUNT)length; - if (fh) - { - if (cread (RDPtr, 1, num_read, fh) != num_read) - break; - } - else - { - if ((int)(ReadResFile (RDPtr, 1, num_read, fp)) != (int)num_read) - break; - } - RDPtr += num_read; - } while (length -= num_read); - - if (length > 0) - { - FreeResourceData (result); - result = NULL; - } + if (ReadResFile (result, 1, length, fp) != length) + { + FreeResourceData (result); + result = NULL; } - cclose (fh); - return result; } Modified: trunk/sc2/src/libs/resource/propfile.c =================================================================== --- trunk/sc2/src/libs/resource/propfile.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/resource/propfile.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -98,7 +98,7 @@ void PropFile_from_file (uio_Stream *f, PROPERTY_HANDLER handler, const char *prefix) { - long flen; + size_t flen; char *data; flen = LengthResFile (f); @@ -108,6 +108,8 @@ return; } + // We may end up with less bytes than we asked for due to the + // DOS->Unix newline conversion flen = ReadResFile (data, 1, flen, f); data[flen] = '\0'; Modified: trunk/sc2/src/libs/strings/getstr.c =================================================================== --- trunk/sc2/src/libs/strings/getstr.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/libs/strings/getstr.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -65,7 +65,7 @@ _GetConversationData (const char *path, RESOURCE_DATA *resdata) { uio_Stream *fp; - long dataLen; + unsigned long dataLen; void *result; int n, path_len, num_data_sets; DWORD opos, Modified: trunk/sc2/src/uqm/load.c =================================================================== --- trunk/sc2/src/uqm/load.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/uqm/load.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -107,7 +107,7 @@ return cread (ar, 1, count, fh) == count; } -static inline COUNT +static inline size_t read_8 (void *fp, BYTE *v) { BYTE t; @@ -116,7 +116,7 @@ return ReadResFile (v, 1, 1, fp); } -static inline COUNT +static inline size_t read_16 (void *fp, UWORD *v) { UWORD t; @@ -125,7 +125,7 @@ return ReadResFile (v, 2, 1, fp); } -static inline COUNT +static inline size_t read_32 (void *fp, DWORD *v) { DWORD t; @@ -134,7 +134,7 @@ return ReadResFile (v, 4, 1, fp); } -static inline COUNT +static inline size_t read_32s (void *fp, SDWORD *v) { DWORD t; @@ -147,28 +147,28 @@ return ret; } -static inline COUNT +static inline size_t read_ptr (void *fp) { DWORD t; return read_32 (fp, &t); /* ptrs are useless in saves */ } -static inline COUNT +static inline size_t read_a8 (void *fp, BYTE *ar, COUNT count) { assert (ar != NULL); return ReadResFile (ar, 1, count, fp) == count; } -static inline COUNT +static inline size_t read_str (void *fp, char *str, COUNT count) { // no type conversion needed for strings return read_a8 (fp, (BYTE *)str, count); } -static inline COUNT +static inline size_t read_a16 (void *fp, UWORD *ar, COUNT count) { assert (ar != NULL); Modified: trunk/sc2/src/uqm/save.c =================================================================== --- trunk/sc2/src/uqm/save.c 2011-02-14 08:00:27 UTC (rev 3557) +++ trunk/sc2/src/uqm/save.c 2011-02-15 12:04:28 UTC (rev 3558) @@ -74,44 +74,44 @@ return cwrite (ar, 1, count, fh) == count; } -static inline COUNT +static inline size_t write_8 (void *fp, BYTE v) { return WriteResFile (&v, 1, 1, fp); } -static inline COUNT +static inline size_t write_16 (void *fp, UWORD v) { return WriteResFile (&v, 2, 1, fp); } -static inline COUNT +static inline size_t write_32 (void *fp, DWORD v) { return WriteResFile (&v, 4, 1, fp); } -static inline COUNT +static inline size_t write_ptr (void *fp) { return write_32 (fp, 0); /* ptrs are useless in saves */ } -static inline COUNT +static inline size_t write_a8 (void *fp, const BYTE *ar, COUNT count) { return WriteResFile (ar, 1, count, fp) == count; } -static inline COUNT +static inline size_t write_str (void *fp, const char *str, COUNT count) { // no type conversion needed for strings return write_a8 (fp, (const BYTE *)str, count); } -static inline COUNT +static inline size_t write_a16 (void *fp, const UWORD *ar, COUNT count) { for ( ; count > 0; --count, ++ar) @@ -838,8 +838,7 @@ success = SaveSummary (SummPtr, out_fp); // Then write the rest of the data. - if (success && WriteResFile (h, (COUNT)flen, 1, - out_fp) == 0) + if (success && WriteResFile (h, flen, 1, out_fp) != 1) success = FALSE; if (res_CloseResFile ((uio_Stream *)out_fp) == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |