Make the Map field private in C4Landscape

lights3
Armin Burgmeier 2015-06-22 20:24:47 -04:00
parent 92f3a3e749
commit b1e9c3924d
3 changed files with 4 additions and 3 deletions

View File

@ -1326,7 +1326,7 @@ void C4ToolsDlg::State::UpdateLandscapeModeCtrls()
gtk_widget_set_sensitive(landscape_dynamic, iMode==C4LSC_Dynamic);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(landscape_static), iMode==C4LSC_Static);
gtk_widget_set_sensitive(landscape_static, ::Landscape.Map!=NULL);
gtk_widget_set_sensitive(landscape_static, ::Landscape.HasMap());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(landscape_exact), iMode==C4LSC_Exact);

View File

@ -1146,7 +1146,7 @@ void C4ToolsDlg::UpdateLandscapeModeCtrls()
UpdateWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODEDYNAMIC));
// Static: enable only if map available
SendDlgItemMessage(state->hDialog,IDC_BUTTONMODESTATIC,BM_SETSTATE,(iMode==C4LSC_Static),0);
EnableWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC),(::Landscape.Map!=NULL));
EnableWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC),(::Landscape.HasMap()));
UpdateWindow(GetDlgItem(state->hDialog,IDC_BUTTONMODESTATIC));
// Exact: enable always
SendDlgItemMessage(state->hDialog,IDC_BUTTONMODEEXACT,BM_SETSTATE,(iMode==C4LSC_Exact),0);

View File

@ -46,7 +46,6 @@ public:
int32_t Mode;
int32_t Width,Height;
int32_t MapWidth,MapHeight,MapZoom;
CSurface8 * Map;
DWORD MatCount[C4MaxMaterial]; // NoSave //
DWORD EffectiveMatCount[C4MaxMaterial]; // NoSave //
@ -66,6 +65,7 @@ public:
private:
CSurface8 * Surface8;
CSurface8 * Surface8Bkg; // Background material
CSurface8 * Map;
class C4LandscapeRender *pLandscapeRender;
uint8_t *TopRowPix, *BottomRowPix; // array size of landscape width: Filled with 0s for border pixels that are open and MCVehic for pixels that are closed
int32_t Pix2Mat[256], Pix2Dens[256], Pix2Place[256];
@ -99,6 +99,7 @@ public:
bool SaveInitial();
bool SaveTextures(C4Group &hGroup) const;
bool Init(C4Group &hGroup, bool fOverloadCurrent, bool fLoadSky, bool &rfLoaded, bool fSavegame);
bool HasMap() const { return Map != NULL; }
bool MapToLandscape();
bool ApplyDiff(C4Group &hGroup);
bool SetMode(int32_t iMode);