|
From: Greg <evo...@us...> - 2005-12-22 16:35:31
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18982/Evolution/Ulysses Modified Files: EWorldview.cpp EWorldview.h GameScreen.cpp GovernorDlg.cpp Log Message: ADD : Spot returns buildings localisations ADD : WorldView options Index: EWorldview.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EWorldview.cpp 19 Dec 2005 20:31:38 -0000 1.11 --- EWorldview.cpp 22 Dec 2005 16:35:22 -0000 1.12 *************** *** 14,17 **** --- 14,32 ---- ////////////////////////////////////////////////////////////////////// + WorldViewOptions::WorldViewOptions() + { + ResetDefaults(); + } + + + void WorldViewOptions::ResetDefaults() + { + bInfosLimitedToOneProvince = false ; + bDisplayPopulatedPlaces = true ; + bDisplayOneActivitySector = false ; + } + + + EWorldview::EWorldview() { *************** *** 497,517 **** if( sqInfos.bDiscovered ) { ! // Paint cities ! if( sqInfos.population > 0 ) { ! int xScreen; ! int yScreen; ! GeoCode gcRelative( GEOCODE_LOW, (Coord) x, (Coord) y ); ! ! if( m_Landscape.ConvertRelGeocodeInScreenCoord( gl, gcRelative, & xScreen, & yScreen ) ) { ! Bitmap& bmpCity = evoBmp.GetBitmap( "map_items", "city" ); ! glRotatef( (float) m_Landscape.GetMapRadius(),1.0f,0.0f,0.0f); ! gl.PaintBitmap( xScreen, yScreen, bmpCity ); ! glRotatef( (float) - m_Landscape.GetMapRadius(),1.0f,0.0f,0.0f); } } - } } --- 512,553 ---- if( sqInfos.bDiscovered ) { ! if( m_options.bDisplayPopulatedPlaces || m_options.bDisplayOneActivitySector ) { ! // Paint cities ! if( sqInfos.population > 0 ) { ! // Have we to display a square ? ! bool bDisplayASquare = m_options.bDisplayPopulatedPlaces; ! ! if( m_options.bDisplayOneActivitySector ) ! { ! std::list<ActivitySectorInfos>::iterator it; ! FOREACH( it, sqInfos.lstActivitySector ) ! { ! if( (it->ecoSector == m_options.idSector) && (it->size != 0 ) ) ! bDisplayASquare = true; ! } ! } ! ! // ! ! if( bDisplayASquare ) ! { ! int xScreen; ! int yScreen; ! GeoCode gcRelative( GEOCODE_LOW, (Coord) x, (Coord) y ); ! ! if( m_Landscape.ConvertRelGeocodeInScreenCoord( gl, gcRelative, & xScreen, & yScreen ) ) ! { ! Bitmap& bmpCity = evoBmp.GetBitmap( "map_items", "city" ); ! ! glRotatef( (float) m_Landscape.GetMapRadius(),1.0f,0.0f,0.0f); ! gl.PaintBitmap( xScreen, yScreen, bmpCity ); ! glRotatef( (float) - m_Landscape.GetMapRadius(),1.0f,0.0f,0.0f); ! } ! } } } } } *************** *** 594,596 **** --- 630,660 ---- } + void EWorldview::SetOptions( WorldViewOptions options ) + { + m_options = options; + + UpdateSpotConfigWithWordViewOptions(); + } + + void EWorldview::UpdateSpotConfigWithWordViewOptions() + { + // Make sure that the Spot configuration (what information we have from the world) + // correspond to the WorldView configuration (what we have to display) + + AiInterface aiInterface; + Order oGetSpotConfig; + OSpotConfig& oConfig = (OSpotConfig&) aiInterface.SendOrder( e_orderGetSpotConfig, oGetSpotConfig, m_spotId ); + + if( m_options.bDisplayOneActivitySector ) + oConfig.m_bEcoSquareSwitch = true; + else + oConfig.m_bEcoSquareSwitch = false; + + aiInterface.SendOrder( e_orderSetSpotConfig, oConfig, m_spotId ); + + Invalidate(); + } + + + Index: EWorldview.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EWorldview.h 19 Dec 2005 20:31:38 -0000 1.8 --- EWorldview.h 22 Dec 2005 16:35:22 -0000 1.9 *************** *** 21,24 **** --- 21,40 ---- #include "ELandscape.h" + class WorldViewOptions + { + public: + bool bInfosLimitedToOneProvince; + provinceId idProvince; + + bool bDisplayPopulatedPlaces; + bool bDisplayOneActivitySector; + ecoSectorId idSector; + + WorldViewOptions(); + + void ResetDefaults(); + }; + + class EWorldview : public ECanvas { *************** *** 51,54 **** --- 67,72 ---- void UpdateSelectionAgent( AgentIdentifier agentSelected ); + WorldViewOptions GetOptions() { return m_options; } + void SetOptions( WorldViewOptions options ); private: *************** *** 61,68 **** private: ! void OnDiscoverUnknowTerritory( ONotification& order ); private: // Evolution terrain --- 79,89 ---- private: ! ! void UpdateSpotConfigWithWordViewOptions(); private: + void OnDiscoverUnknowTerritory( ONotification& order ); + private: // Evolution terrain *************** *** 79,82 **** --- 100,106 ---- AgentIdentifier m_agentSelected; + // Options + WorldViewOptions m_options; + std::map<countryId, COLORREF> m_mapCountryColors; Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GameScreen.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** GameScreen.cpp 18 Dec 2005 21:37:03 -0000 1.91 --- GameScreen.cpp 22 Dec 2005 16:35:22 -0000 1.92 *************** *** 665,668 **** --- 665,672 ---- m_Worldview.SetPosition( 0, 0 ); m_Worldview.SetDimension( GetWidth(), GetHeight() ); + + WorldViewOptions options = m_Worldview.GetOptions(); + options.ResetDefaults(); + m_Worldview.SetOptions( options ); } Index: GovernorDlg.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GovernorDlg.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** GovernorDlg.cpp 18 Dec 2005 21:37:03 -0000 1.50 --- GovernorDlg.cpp 22 Dec 2005 16:35:22 -0000 1.51 *************** *** 47,50 **** --- 47,54 ---- m_pWorldview->ZoomToSeeRect( oGeoInfos.dimWestEast, oGeoInfos.dimNorthSouth ); + WorldViewOptions options = m_pWorldview->GetOptions(); + options.ResetDefaults(); + m_pWorldview->SetOptions( options ); + EDialog::Create( pParent ); } |