# HG changeset patch
# User Peter Wortmann
# Date 1314468690 -3600
# Branch devel
# Node ID caf1b69e507234d99957c6d5892813e81b2a829d
# Parent  14c542eae9a9fbcc59a4d1214595b1bfd5092f1c
Removed exact landscape mode

That's not the way to do it... There's always an exact landscape,
and having an exact map is a huge waste. Note that this breaks the
assumptions of the developer mode tools, and therefore probably
quite a bit of code.

diff -r 14c542eae9a9 -r caf1b69e5072 src/C4Game.cpp
--- a/src/C4Game.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/C4Game.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -3162,20 +3162,10 @@
 		// store landscape, if desired (w/o material enumeration - that's assumed to stay consistent during the game)
 		if (dwFlags & C4S_SAVE_LANDSCAPE)
 		{
-			// storing the landscape implies storing the scenario core
-			// otherwise, the ExactLandscape-flag would be lost
-			// maybe imply exact landscapes by the existance of Landscape.png-files?
-			C4Scenario rC4S = C4S;
-			rC4S.SetExactLandscape();
-			if (!rC4S.Save(*pGrp, true))
-			{
-				DebugLog("LoadScenarioSection: Error saving C4S");
-				return false;
-			}
 			// landscape
 			{
 				C4DebugRecOff DBGRECOFF;
-				if (!Landscape.Save(*pGrp))
+				if (!Landscape.SaveDiff(*pGrp, true))
 				{
 					DebugLog("LoadScenarioSection: Error saving Landscape");
 					return false;
diff -r 14c542eae9a9 -r caf1b69e5072 src/c4group/C4Components.h
--- a/src/c4group/C4Components.h	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/c4group/C4Components.h	Sat Aug 27 19:11:30 2011 +0100
@@ -59,8 +59,6 @@
 #endif
 
 #define C4CFN_Map             "Map.bmp"
-#define C4CFN_Landscape       "Landscape.bmp"
-#define C4CFN_LandscapePNG    "Landscape.png"
 #define C4CFN_DiffLandscape   "DiffLandscape.bmp"
 #define C4CFN_Sky             "Sky"
 #define C4CFN_Script          "Script.c|Script%s.c|C4Script%s.c"
diff -r 14c542eae9a9 -r caf1b69e5072 src/control/C4GameSave.cpp
--- a/src/control/C4GameSave.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/control/C4GameSave.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -149,15 +149,11 @@
 bool C4GameSave::SaveLandscape()
 {
 	// exact?
-	if (::Landscape.Mode == C4LSC_Exact || GetForceExactLandscape())
+	if (GetForceExactLandscape())
 	{
 		C4DebugRecOff DBGRECOFF;
 		// Landscape
-		bool fSuccess;
-		if (::Landscape.Mode == C4LSC_Exact)
-			fSuccess = !!::Landscape.Save(*pSaveGroup);
-		else
-			fSuccess = !!::Landscape.SaveDiff(*pSaveGroup, !IsSynced());
+		bool fSuccess = !!::Landscape.SaveDiff(*pSaveGroup, !IsSynced());
 		if (!fSuccess) return false;
 		DBGRECOFF.Clear();
 		// PXS
@@ -172,9 +168,6 @@
 	// static / dynamic
 	if (::Landscape.Mode == C4LSC_Static)
 	{
-		// static map
-		// remove old-style landscape.bmp
-		pSaveGroup->DeleteEntry(C4CFN_Landscape);
 		// save materials if not already done
 		if (!GetForceExactLandscape())
 		{
@@ -184,7 +177,7 @@
 			if (!::Landscape.SaveTextures(*pSaveGroup)) return false;
 		}
 	}
-	else if (::Landscape.Mode != C4LSC_Exact)
+	else
 	{
 		// dynamic map by landscape.txt or scenario core: nothing to save
 		// in fact, it doesn't even make much sense to save the Objects.txt
diff -r 14c542eae9a9 -r caf1b69e5072 src/editor/C4Console.cpp
--- a/src/editor/C4Console.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/editor/C4Console.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -217,7 +217,7 @@
 	SetCursor(C4ConsoleGUI::CURSOR_Wait);
 
 	bool fOkay=true;
-	C4GameSave *pGameSave = new C4GameSaveScenario(!Console.Active || ::Landscape.Mode==C4LSC_Exact, false);
+	C4GameSave *pGameSave = new C4GameSaveScenario(!Console.Active, false);
 	if (!pGameSave->Save(Game.ScenarioFile, false))
 		{ Out("Game::Save failed"); fOkay=false; }
 	delete pGameSave;
diff -r 14c542eae9a9 -r caf1b69e5072 src/editor/C4ConsoleWin32.cpp
--- a/src/editor/C4ConsoleWin32.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/editor/C4ConsoleWin32.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -457,10 +457,6 @@
 			Console.ToolsDlg.SetLandscapeMode(C4LSC_Static);
 			return true;
 			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-		case IDC_BUTTONMODEEXACT:
-			Console.ToolsDlg.SetLandscapeMode(C4LSC_Exact);
-			return true;
-			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 		case IDC_BUTTONBRUSH:
 			Console.ToolsDlg.SetTool(C4TLS_Brush, false);
 			return true;
@@ -1021,15 +1017,14 @@
 	SendDlgItemMessage(state->hDialog,IDC_COMBOTEXTURE,CB_RESETCONTENT,0,(LPARAM)0);
 	// bottom-most: any invalid textures
 	bool fAnyEntry = false; int32_t cnt; const char *szTexture;
-	if (::Landscape.Mode!=C4LSC_Exact)
-		for (cnt=0; (szTexture=::TextureMap.GetTexture(cnt)); cnt++)
+	for (cnt=0; (szTexture=::TextureMap.GetTexture(cnt)); cnt++)
+	{
+		if (!::TextureMap.GetIndex(Material, szTexture, false))
 		{
-			if (!::TextureMap.GetIndex(Material, szTexture, false))
-			{
-				fAnyEntry = true;
-				SendDlgItemMessage(state->hDialog,IDC_COMBOTEXTURE,CB_INSERTSTRING,0,GetWideLPARAM(szTexture));
-			}
+			fAnyEntry = true;
+			SendDlgItemMessage(state->hDialog,IDC_COMBOTEXTURE,CB_INSERTSTRING,0,GetWideLPARAM(szTexture));
 		}
+	}
 	// separator
 	if (fAnyEntry)
 	{
@@ -1039,8 +1034,8 @@
 	// atop: valid textures
 	for (cnt=0; (szTexture=::TextureMap.GetTexture(cnt)); cnt++)
 	{
-		// Current material-texture valid? Always valid for exact mode
-		if (::TextureMap.GetIndex(Material,szTexture,false) || ::Landscape.Mode==C4LSC_Exact)
+		// Current material-texture valid?
+		if (::TextureMap.GetIndex(Material,szTexture,false))
 		{
 			SendDlgItemMessage(state->hDialog,IDC_COMBOTEXTURE,CB_INSERTSTRING,0,GetWideLPARAM(szTexture));
 		}
@@ -1168,7 +1163,7 @@
 	EnableWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC),(::Landscape.Map!=NULL));
 	UpdateWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC));
 	// Exact: enable always
-	SendDlgItemMessage(state->hDialog,IDC_BUTTONMODEEXACT,BM_SETSTATE,(iMode==C4LSC_Exact),0);
+	EnableWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC),0);
 	UpdateWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODEEXACT));
 	// Set dialog caption
 	SetWindowTextW(state->hDialog,LoadResStrW(iMode==C4LSC_Dynamic ? "IDS_DLG_DYNAMIC" : iMode==C4LSC_Static ? "IDS_DLG_STATIC" : "IDS_DLG_EXACT"));
@@ -1183,7 +1178,7 @@
 	SendDlgItemMessage(hDialog,IDC_BUTTONBRUSH,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)((iLandscapeMode>=C4LSC_Static) ? state->hbmBrush : state->hbmBrush2));
 	SendDlgItemMessage(hDialog,IDC_BUTTONLINE,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)((iLandscapeMode>=C4LSC_Static) ? state->hbmLine : state->hbmLine2));
 	SendDlgItemMessage(hDialog,IDC_BUTTONRECT,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)((iLandscapeMode>=C4LSC_Static) ? state->hbmRect : state->hbmRect2));
-	SendDlgItemMessage(hDialog,IDC_BUTTONFILL,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)((iLandscapeMode>=C4LSC_Exact) ? state->hbmFill : state->hbmFill2));
+	SendDlgItemMessage(hDialog,IDC_BUTTONFILL,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)(state->hbmFill2));
 	SendDlgItemMessage(hDialog,IDC_BUTTONPICKER,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)((iLandscapeMode>=C4LSC_Static) ? state->hbmPicker : state->hbmPicker2));
 	SendDlgItemMessage(hDialog,IDC_BUTTONIFT,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)state->hbmIFT);
 	SendDlgItemMessage(hDialog,IDC_BUTTONNOIFT,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)state->hbmNoIFT);
@@ -1194,7 +1189,7 @@
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONBRUSH),(iLandscapeMode>=C4LSC_Static));
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONLINE),(iLandscapeMode>=C4LSC_Static));
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONRECT),(iLandscapeMode>=C4LSC_Static));
-	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONFILL),(iLandscapeMode>=C4LSC_Exact));
+	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONFILL),FALSE);
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONPICKER),(iLandscapeMode>=C4LSC_Static));
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONIFT),(iLandscapeMode>=C4LSC_Static));
 	EnableWindow(GetDlgItem(hDialog,IDC_BUTTONNOIFT),(iLandscapeMode>=C4LSC_Static));
diff -r 14c542eae9a9 -r caf1b69e5072 src/editor/C4EditCursor.cpp
--- a/src/editor/C4EditCursor.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/editor/C4EditCursor.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -751,16 +751,6 @@
 		else
 			Console.ToolsDlg.SelectMaterial(C4TLS_MatSky);
 		break;
-	case C4LSC_Exact:
-		// Material only from landscape
-		if (MatValid(iMaterial=GBackMat(X,Y)))
-		{
-			Console.ToolsDlg.SelectMaterial(::MaterialMap.Map[iMaterial].Name);
-			Console.ToolsDlg.SetIFT(!!GBackIFT(X,Y));
-		}
-		else
-			Console.ToolsDlg.SelectMaterial(C4TLS_MatSky);
-		break;
 	}
 	Hold=false;
 }
diff -r 14c542eae9a9 -r caf1b69e5072 src/editor/C4ToolsDlg.cpp
--- a/src/editor/C4ToolsDlg.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/editor/C4ToolsDlg.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -122,12 +122,6 @@
 bool C4ToolsDlg::SetLandscapeMode(int32_t iMode, bool fThroughControl)
 {
 	int32_t iLastMode=::Landscape.Mode;
-	// Exact to static: confirm data loss warning
-	if (iLastMode==C4LSC_Exact)
-		if (iMode==C4LSC_Static)
-			if (!fThroughControl)
-				if (!Console.Message(LoadResStr("IDS_CNS_EXACTTOSTATIC"),true))
-					return false;
 	// send as control
 	if (!fThroughControl)
 	{
@@ -136,14 +130,9 @@
 	}
 	// Set landscape mode
 	::Landscape.SetMode(iMode);
-	// Exact to static: redraw landscape from map
-	if (iLastMode==C4LSC_Exact)
-		if (iMode==C4LSC_Static)
-			::Landscape.MapToLandscape();
 	// Assert valid tool
-	if (iMode!=C4LSC_Exact)
-		if (SelectedTool==C4TLS_Fill)
-			SetTool(C4TLS_Brush, false);
+	if (SelectedTool==C4TLS_Fill)
+		SetTool(C4TLS_Brush, false);
 	// Update controls
 	UpdateLandscapeModeCtrls();
 	EnableControls();
diff -r 14c542eae9a9 -r caf1b69e5072 src/game/landscape/C4Landscape.cpp
--- a/src/game/landscape/C4Landscape.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/game/landscape/C4Landscape.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -1080,12 +1080,14 @@
 
 	// map and landscape must be initialized with fixed random, so runtime joining clients may recreate it
 	// with same seed
+	Game.FixRandom(MapSeed);
+
 	// after map/landscape creation, the seed must be fixed again, so there's no difference between clients creating
 	// and not creating the map
 	// this, however, would cause syncloss to DebugRecs
-	C4DebugRecOff DBGRECOFF(!!Game.C4S.Landscape.ExactLandscape);
-
-	Game.FixRandom(Game.RandomSeed);
+	// -- I don't understand this comment, therefore commented out. Note that ExactLandscape flag
+	//    was never meant to be an indication for a runtime join. -- PMW
+	// C4DebugRecOff DBGRECOFF(!!::Network.IsJoin);
 
 	// map is like it's loaded for regular gamestart
 	// but it's changed and would have to be saved if a new section is loaded
@@ -1094,88 +1096,63 @@
 	// don't change landscape mode in runtime joins
 	bool fLandscapeModeSet = (Mode != C4LSC_Undefined);
 
+	// Static map from scenario
 	Game.SetInitProgress(60);
-	// create map if necessary
-	if (!Game.C4S.Landscape.ExactLandscape)
+	CSurface8 * sfcMap=NULL;
+	if (hGroup.AccessEntry(C4CFN_Map))
+		if ((sfcMap=GroupReadSurface8(hGroup)))
+			if (!fLandscapeModeSet) Mode=C4LSC_Static;
+
+	// dynamic map from file
+	if (!sfcMap)
+		if ((sfcMap=CreateMapS2(hGroup)))
+			if (!fLandscapeModeSet) Mode=C4LSC_Dynamic;
+
+	// Dynamic map by scenario
+	if (!sfcMap && !fOverloadCurrent)
+		if ((sfcMap=CreateMap()))
+			if (!fLandscapeModeSet) Mode=C4LSC_Dynamic;
+
+
+	// No map failure
+	if (!sfcMap)
 	{
-		CSurface8 * sfcMap=NULL;
-		// Static map from scenario
-		if (hGroup.AccessEntry(C4CFN_Map))
-			if ((sfcMap=GroupReadSurface8(hGroup)))
-				if (!fLandscapeModeSet) Mode=C4LSC_Static;
-
-		// allow C4CFN_Landscape as map for downwards compatibility
-		if (!sfcMap)
-			if (hGroup.AccessEntry(C4CFN_Landscape))
-				if ((sfcMap=GroupReadSurface8(hGroup)))
-				{
-					if (!fLandscapeModeSet) Mode=C4LSC_Static;
-					fMapChanged = true;
-				}
-
-		// dynamic map from file
-		if (!sfcMap)
-			if ((sfcMap=CreateMapS2(hGroup)))
-				if (!fLandscapeModeSet) Mode=C4LSC_Dynamic;
-
-		// Dynamic map by scenario
-		if (!sfcMap && !fOverloadCurrent)
-			if ((sfcMap=CreateMap()))
-				if (!fLandscapeModeSet) Mode=C4LSC_Dynamic;
-
-
-		// No map failure
-		if (!sfcMap)
-		{
-			// no problem if only overloading
-			if (!fOverloadCurrent) return false;
-			if (fLoadSky) if (!Sky.Init(fSavegame)) return false;
-			return true;
-		}
+		// no problem if only overloading
+		if (!fOverloadCurrent) return false;
+		if (fLoadSky) if (!Sky.Init(fSavegame)) return false;
+		return true;
+	}
 
 #ifdef DEBUGREC
-		AddDbgRec(RCT_Block, "|---MAP---|", 12);
-		AddDbgRec(RCT_Map, sfcMap->Bits, sfcMap->Pitch*sfcMap->Hgt);
+	AddDbgRec(RCT_Block, "|---MAP---|", 12);
+	AddDbgRec(RCT_Map, sfcMap->Bits, sfcMap->Pitch*sfcMap->Hgt);
 #endif
 
-		// Store map size and calculate map zoom
-		int iWdt, iHgt;
-		sfcMap->GetSurfaceSize(iWdt,iHgt);
-		MapWidth = iWdt; MapHeight = iHgt;
-		MapZoom = Game.C4S.Landscape.MapZoom.Evaluate();
-
-		// Calculate landscape size
-		Width = MapZoom * MapWidth;
-		Height = MapZoom * MapHeight;
-		Width = Max<int32_t>(Width,100);
-		Height = Max<int32_t>(Height,100);
+	// Store map size and calculate map zoom
+	int iWdt, iHgt;
+	sfcMap->GetSurfaceSize(iWdt,iHgt);
+	MapWidth = iWdt; MapHeight = iHgt;
+	MapZoom = Game.C4S.Landscape.MapZoom.Evaluate();
+
+	// Calculate landscape size
+	Width = MapZoom * MapWidth;
+	Height = MapZoom * MapHeight;
+	Width = Max<int32_t>(Width,100);
+	Height = Max<int32_t>(Height,100);
 //    Width = (Width/8)*8;
 
-		// if overloading, clear current landscape (and sections, etc.)
-		// must clear, of course, before new sky is eventually read
-		if (fOverloadCurrent) Clear(!Game.C4S.Landscape.KeepMapCreator, fLoadSky);
-
-		// assign new map
-		Map = sfcMap;
-
-		// Sky (might need to know landscape height)
-		if (fLoadSky)
-		{
-			Game.SetInitProgress(70);
-			if (!Sky.Init(fSavegame)) return false;
-		}
-	}
-
-	// Exact landscape from scenario (no map or exact recreation)
-	else /* if (Game.C4S.Landscape.ExactLandscape) */
+	// if overloading, clear current landscape (and sections, etc.)
+	// must clear, of course, before new sky is eventually read
+	if (fOverloadCurrent) Clear(!Game.C4S.Landscape.KeepMapCreator, fLoadSky);
+
+	// assign new map
+	Map = sfcMap;
+
+	// Sky (might need to know landscape height)
+	if (fLoadSky)
 	{
-		C4DebugRecOff DBGRECOFF;
-		// if overloading, clear current
-		if (fOverloadCurrent) Clear(!Game.C4S.Landscape.KeepMapCreator, fLoadSky);
-		// load it
-		if (!fLandscapeModeSet) Mode=C4LSC_Exact;
-		rfLoaded=true;
-		if (!Load(hGroup, fLoadSky, fSavegame)) return false;
+		Game.SetInitProgress(70);
+		if (!Sky.Init(fSavegame)) return false;
 	}
 
 	// Make pixel maps
@@ -1265,14 +1242,6 @@
 	return true;
 }
 
-bool C4Landscape::Save(C4Group &hGroup)
-{
-	C4SolidMask::RemoveSolidMasks();
-	bool r = SaveInternal(hGroup);
-	C4SolidMask::PutSolidMasks();
-	return r;
-}
-
 bool C4Landscape::DebugSave(const char *szFilename)
 {
 	// debug: Save 8 bit data landscape only, without doing any SolidMask-removal-stuff
@@ -1284,35 +1253,6 @@
 	return fSuccess;
 }
 
-bool C4Landscape::SaveInternal(C4Group &hGroup)
-{
-	// Save members
-	if (!Sky.Save(hGroup))
-		return false;
-
-	// Save landscape surface
-	char szTempLandscape[_MAX_PATH+1];
-	SCopy(Config.AtTempPath(C4CFN_TempLandscape), szTempLandscape);
-	MakeTempFilename(szTempLandscape);
-	if (!Surface8->Save(szTempLandscape))
-		return false;
-
-	// Move temp file to group
-	if (!hGroup.Move( szTempLandscape, C4CFN_Landscape ))
-		return false;
-
-	// Save map
-	if (fMapChanged && Map)
-		if (!SaveMap(hGroup))
-			return false;
-
-	// save textures (if changed)
-	if (!SaveTextures(hGroup))
-		return false;
-
-	return true;
-}
-
 bool C4Landscape::SaveDiff(C4Group &hGroup, bool fSyncSave)
 {
 	C4SolidMask::RemoveSolidMasks();
@@ -1381,69 +1321,6 @@
 	return true;
 }
 
-bool C4Landscape::Load(C4Group &hGroup, bool fLoadSky, bool fSavegame)
-{
-	// Load exact landscape from group
-	if (!hGroup.AccessEntry(C4CFN_Landscape)) return false;
-	if (!(Surface8=GroupReadSurfaceOwnPal8(hGroup))) return false;
-	int iWidth, iHeight;
-	Surface8->GetSurfaceSize(iWidth,iHeight);
-	Width = iWidth; Height = iHeight;
-	// adjust pal
-	if (!Mat2Pal()) return false;
-	// no PNG: convert old-style landscapes
-	if (!Game.C4S.Landscape.NewStyleLandscape)
-	{
-		// convert all pixels
-		for (int32_t y=0; y<Height; ++y) for (int32_t x=0; x<Width; ++x)
-			{
-				BYTE byPix = Surface8->GetPix(x, y);
-				int32_t iMat = PixCol2MatOld(byPix); BYTE byIFT = PixColIFTOld(byPix);
-				if (byIFT) byIFT = IFT;
-				// set pixel in 8bpp-surface only, so old-style landscapes won't be screwed up!
-				Surface8->SetPix(x, y, Mat2PixColDefault(iMat)+byIFT);
-			}
-		// NewStyleLandscape-flag will be set in C4Landscape::Init later
-	}
-	// New style landscape first generation: just correct
-	if (Game.C4S.Landscape.NewStyleLandscape == 1)
-	{
-		// convert all pixels
-		for (int32_t y=0; y<Height; ++y) for (int32_t x=0; x<Width; ++x)
-			{
-				// get material
-				BYTE byPix = Surface8->GetPix(x, y);
-				int32_t iMat = PixCol2MatOld2(byPix);
-				if (MatValid(iMat))
-					// insert pixel
-					Surface8->SetPix(x, y, Mat2PixColDefault(iMat) + (byPix & IFT));
-				else
-					Surface8->SetPix(x, y, 0);
-			}
-	}
-	else
-	{
-		// Landscape should be in correct format: Make sure it is!
-		for (int32_t y=0; y<Height; ++y) for (int32_t x=0; x<Width; ++x)
-			{
-				BYTE byPix = Surface8->GetPix(x, y);
-				int32_t iMat = PixCol2Mat(byPix);
-				if (byPix && !MatValid(iMat))
-				{
-					LogFatal(FormatString("Landscape loading error at (%d/%d): Pixel value %d not a valid material!", (int) x, (int) y, (int) byPix).getData());
-					return false;
-				}
-			}
-	}
-	// Init sky
-	if (fLoadSky)
-	{
-		Game.SetInitProgress(70);
-		if (!Sky.Init(fSavegame)) return false;
-	}
-	// Success
-	return true;
-}
 bool C4Landscape::ApplyDiff(C4Group &hGroup)
 {
 	CSurface8 *pDiff;
@@ -2654,7 +2531,7 @@
 bool C4Landscape::SetMode(int32_t iMode)
 {
 	// Invalid mode
-	if (!Inside<int32_t>(iMode,C4LSC_Dynamic,C4LSC_Exact)) return false;
+	if (!Inside<int32_t>(iMode,C4LSC_Dynamic,C4LSC_Static)) return false;
 	// Set mode
 	Mode=iMode;
 	// Done
@@ -2676,7 +2553,7 @@
 	return true;
 }
 
-bool C4Landscape::DrawBrush(int32_t iX, int32_t iY, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT)
+bool C4Landscape::DrawBrush(int32_t iX, int32_t iY, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact)
 {
 	BYTE byCol;
 	// Get map color index by material-texture
@@ -2689,6 +2566,16 @@
 		shape_wdt = MaterialMap.Map[mat].CustomShape->max_poly_width/MapZoom;
 		shape_hgt = MaterialMap.Map[mat].CustomShape->max_poly_height/MapZoom;
 	}
+	// Exact: draw directly to landscape by color & pattern
+	if (fExact)
+	{
+		C4Rect BoundingBox(iX-iGrade-1, iY-iGrade-1, iGrade*2+2, iGrade*2+2);
+		// Draw to landscape
+		PrepareChange(BoundingBox);
+		Surface8->Circle(iX,iY,iGrade, byCol);
+		FinishChange(BoundingBox);
+		return true;
+	}
 	// Draw
 	switch (Mode)
 	{
@@ -2702,17 +2589,10 @@
 		if (iRadius==1) { if (Map) Map->SetPix(iX/MapZoom,iY/MapZoom,byCol); }
 		else Map->Circle(iX/MapZoom,iY/MapZoom,iRadius,byCol);
 		// Update landscape
-		MapToLandscape(Map,iX/MapZoom-iRadius-1-shape_wdt,iY/MapZoom-iRadius-1-shape_hgt,2*iRadius+2+shape_wdt*2,2*iRadius+2+shape_hgt*2);
+		if (!fExact)
+			MapToLandscape(Map,iX/MapZoom-iRadius-1-shape_wdt,iY/MapZoom-iRadius-1-shape_hgt,2*iRadius+2+shape_wdt*2,2*iRadius+2+shape_hgt*2);
 		SetMapChanged();
 		break;
-		// Exact: draw directly to landscape by color & pattern
-	case C4LSC_Exact:
-		C4Rect BoundingBox(iX-iGrade-1, iY-iGrade-1, iGrade*2+2, iGrade*2+2);
-		// Draw to landscape
-		PrepareChange(BoundingBox);
-		Surface8->Circle(iX,iY,iGrade, byCol);
-		FinishChange(BoundingBox);
-		break;
 	}
 	return true;
 }
@@ -2732,7 +2612,7 @@
 	return true;
 }
 
-bool C4Landscape::DrawLine(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT)
+bool C4Landscape::DrawLine(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact)
 {
 	// Get map color index by material-texture
 	if (!GetMapColorIndex(szMaterial,szTexture,fIFT,DrawLineCol)) return false;
@@ -2744,6 +2624,17 @@
 		shape_wdt = MaterialMap.Map[mat].CustomShape->max_poly_width/MapZoom;
 		shape_hgt = MaterialMap.Map[mat].CustomShape->max_poly_height/MapZoom;
 	}
+	// Exact: draw directly to landscape by color & pattern
+	if (fExact)
+	{
+		// Set texture pattern & get material color
+		C4Rect BoundingBox(iX1 - iGrade, iY1 - iGrade, iGrade*2+1, iGrade*2+1);
+		BoundingBox.Add(C4Rect(iX2 - iGrade, iY2 - iGrade, iGrade*2+1, iGrade*2+1));
+		// Draw to landscape
+		PrepareChange(BoundingBox);
+		ForLine(iX1,iY1,iX2,iY2,&DrawLineLandscape,iGrade);
+		FinishChange(BoundingBox);
+	}
 	// Draw
 	switch (Mode)
 	{
@@ -2760,24 +2651,15 @@
 		int32_t iUpX,iUpY,iUpWdt,iUpHgt;
 		iUpX=Min(iX1,iX2)-iRadius-1; iUpY=Min(iY1,iY2)-iRadius-1;
 		iUpWdt=Abs(iX2-iX1)+2*iRadius+2; iUpHgt=Abs(iY2-iY1)+2*iRadius+2;
-		MapToLandscape(Map,iUpX-shape_wdt,iUpY-shape_hgt,iUpWdt+shape_wdt*2,iUpHgt+shape_hgt*2);
+		if (!fExact)
+			MapToLandscape(Map,iUpX-shape_wdt,iUpY-shape_hgt,iUpWdt+shape_wdt*2,iUpHgt+shape_hgt*2);
 		SetMapChanged();
 		break;
-		// Exact: draw directly to landscape by color & pattern
-	case C4LSC_Exact:
-		// Set texture pattern & get material color
-		C4Rect BoundingBox(iX1 - iGrade, iY1 - iGrade, iGrade*2+1, iGrade*2+1);
-		BoundingBox.Add(C4Rect(iX2 - iGrade, iY2 - iGrade, iGrade*2+1, iGrade*2+1));
-		// Draw to landscape
-		PrepareChange(BoundingBox);
-		ForLine(iX1,iY1,iX2,iY2,&DrawLineLandscape,iGrade);
-		FinishChange(BoundingBox);
-		break;
 	}
 	return true;
 }
 
-bool C4Landscape::DrawBox(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT)
+bool C4Landscape::DrawBox(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact)
 {
 	// get upper-left/lower-right - corners
 	int32_t iX0=Min(iX1, iX2); int32_t iY0=Min(iY1, iY2);
@@ -2793,6 +2675,15 @@
 		shape_wdt = MaterialMap.Map[mat].CustomShape->max_poly_width/MapZoom;
 		shape_hgt = MaterialMap.Map[mat].CustomShape->max_poly_height/MapZoom;
 	}
+	// Exact: draw directly to landscape by color & pattern
+	if (fExact)
+	{
+		C4Rect BoundingBox(iX1, iY1, iX2 - iX1+1, iY2 - iY1+1);
+		// Draw to landscape
+		PrepareChange(BoundingBox);
+		Surface8->Box(iX1,iY1,iX2,iY2,byCol);
+		FinishChange(BoundingBox);
+	}
 	// Draw
 	switch (Mode)
 	{
@@ -2805,17 +2696,10 @@
 		iX1/=MapZoom; iY1/=MapZoom; iX2/=MapZoom; iY2/=MapZoom;
 		Map->Box(iX1,iY1,iX2,iY2,byCol);
 		// Update landscape
-		MapToLandscape(Map,iX1-1-shape_wdt,iY1-1-shape_hgt,iX2-iX1+3+shape_wdt*2,iY2-iY1+3+shape_hgt*2);
+		if (!fExact)
+			MapToLandscape(Map,iX1-1-shape_wdt,iY1-1-shape_hgt,iX2-iX1+3+shape_wdt*2,iY2-iY1+3+shape_hgt*2);
 		SetMapChanged();
 		break;
-		// Exact: draw directly to landscape by color & pattern
-	case C4LSC_Exact:
-		C4Rect BoundingBox(iX1, iY1, iX2 - iX1+1, iY2 - iY1+1);
-		// Draw to landscape
-		PrepareChange(BoundingBox);
-		Surface8->Box(iX1,iY1,iX2,iY2,byCol);
-		FinishChange(BoundingBox);
-		break;
 	}
 	return true;
 }
diff -r 14c542eae9a9 -r caf1b69e5072 src/game/landscape/C4Landscape.h
--- a/src/game/landscape/C4Landscape.h	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/game/landscape/C4Landscape.h	Sat Aug 27 19:11:30 2011 +0100
@@ -44,8 +44,7 @@
 
 const int32_t C4LSC_Undefined = 0,
               C4LSC_Dynamic = 1,
-              C4LSC_Static = 2,
-              C4LSC_Exact = 3;
+              C4LSC_Static = 2;
 
 const int32_t C4LS_MaxRelights = 50;
 
@@ -101,8 +100,6 @@
 	void RaiseTerrain(int32_t tx, int32_t ty, int32_t wdt);
 	void FindMatTop(int32_t mat, int32_t &x, int32_t &y);
 	BYTE GetMapIndex(int32_t iX, int32_t iY);
-	bool Load(C4Group &hGroup, bool fLoadSky, bool fSavegame);
-	bool Save(C4Group &hGroup);
 	bool SaveDiff(C4Group &hGroup, bool fSyncSave);
 	bool SaveMap(C4Group &hGroup);
 	bool SaveInitial();
@@ -121,9 +118,9 @@
 	bool FindMatPathPush(int32_t &fx, int32_t &fy, int32_t mdens, int32_t mslide, bool liquid);
 	bool FindMatPathPull(int32_t &fx, int32_t &fy, int32_t mdens, int32_t mslide, bool liquid);
 	bool Incinerate(int32_t x, int32_t y);
-	bool DrawBrush(int32_t iX, int32_t iY, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT);
-	bool DrawLine(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT);
-	bool DrawBox(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT);
+	bool DrawBrush(int32_t iX, int32_t iY, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact = false);
+	bool DrawLine(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact = false);
+	bool DrawBox(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iGrade, const char *szMaterial, const char *szTexture, bool fIFT, bool fExact = false);
 	bool DrawChunks(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, int32_t icntx, int32_t icnty, const char *szMaterial, const char *szTexture, bool bIFT);
 	bool DrawQuad(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iX3, int32_t iY3, int32_t iX4, int32_t iY4, const char *szMaterial, bool bIFT, bool fDrawBridge);
 	bool DrawPolygon(int *vtcs, int length, const char *szMaterial, bool bIFT, bool fDrawBridge);
@@ -232,7 +229,6 @@
 	void FinishChange(C4Rect BoundingBox);
 	static bool DrawLineLandscape(int32_t iX, int32_t iY, int32_t iGrade);
 	uint8_t *GetBridgeMatConversion(int for_material);
-	bool SaveInternal(C4Group &hGroup);
 	bool SaveDiffInternal(C4Group &hGroup, bool fSyncSave);
 
 public:
diff -r 14c542eae9a9 -r caf1b69e5072 src/game/landscape/C4Scenario.cpp
--- a/src/game/landscape/C4Scenario.cpp	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/game/landscape/C4Scenario.cpp	Sat Aug 27 19:11:30 2011 +0100
@@ -286,7 +286,6 @@
 	Layers.Clear();
 	SCopy("Earth",Material,C4M_MaxName);
 	SCopy("Water",Liquid,C4M_MaxName);
-	ExactLandscape=0;
 	Gravity.Set(100,0,10,200);
 	NoScan=0;
 	KeepMapCreator=0;
@@ -306,7 +305,6 @@
 
 void C4SLandscape::CompileFunc(StdCompiler *pComp)
 {
-	pComp->Value(mkNamingAdapt(ExactLandscape,          "ExactLandscape",        false));
 	pComp->Value(mkNamingAdapt(Vegetation,              "Vegetation",            C4IDList()));
 	pComp->Value(mkNamingAdapt(VegLevel,                "VegetationLevel",       C4SVal(50,30,0,100), true));
 	pComp->Value(mkNamingAdapt(InEarth,                 "InEarth",               C4IDList()));
@@ -394,28 +392,6 @@
 
 }
 
-void C4Scenario::SetExactLandscape()
-{
-	if (Landscape.ExactLandscape) return;
-	//int32_t iMapZoom = Landscape.MapZoom.Std;
-	// Set landscape
-	Landscape.ExactLandscape = 1;
-	/*FIXME: warum ist das auskommentiert?
-	// - because Map and Landscape are handled differently in NET2 (Map.bmp vs Landscape.bmp), and the zoomed Map.bmp may be used
-	//   to reconstruct the textures on the Landscape.bmp in case of e.g. runtime joins. In this sense, C4S.Landscape.ExactLandscape
-	//   only marks that the landscape.bmp is an exact one, and there may or may not be an accompanying Map.bmp
-	Landscape.MapZoom.Set(1,0,1,1);
-	// Zoom player starting positions
-	for (int32_t cnt=0; cnt<C4S_MaxPlayer; cnt++)
-	  {
-	  if (PlrStart[cnt].PositionX >= -1)
-	    PlrStart[cnt].PositionX = PlrStart[cnt].PositionX * iMapZoom;
-	  if (PlrStart[cnt].PositionY >= -1)
-	    PlrStart[cnt].PositionY = PlrStart[cnt].PositionY * iMapZoom;
-	  }
-	  */
-}
-
 bool C4SDefinitions::GetModules(StdStrBuf *psOutModules) const
 {
 	// Local only
diff -r 14c542eae9a9 -r caf1b69e5072 src/game/landscape/C4Scenario.h
--- a/src/game/landscape/C4Scenario.h	Sat Aug 27 17:10:31 2011 +0100
+++ b/src/game/landscape/C4Scenario.h	Sat Aug 27 19:11:30 2011 +0100
@@ -168,7 +168,6 @@
 class C4SLandscape
 {
 public:
-	bool ExactLandscape;
 	C4SVal VegLevel;
 	C4IDList Vegetation;
 	C4SVal InEarthLevel;
@@ -245,7 +244,6 @@
 	C4SWeather      Weather;
 	C4SEnvironment  Environment;
 public:
-	void SetExactLandscape();
 	void Clear();
 	void Default();
 	bool Load(C4Group &hGroup, bool fLoadSection=false);
