You can subscribe to this list here.
| 2002 |
Jan
|
Feb
(12) |
Mar
(3) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2004 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
(20) |
Feb
|
Mar
(137) |
Apr
(86) |
May
(52) |
Jun
(125) |
Jul
(169) |
Aug
(56) |
Sep
(21) |
Oct
(20) |
Nov
(8) |
Dec
(41) |
|
From: Greg <evo...@us...> - 2005-12-22 16:35:36
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18982/Evolution/Agamemnon Modified Files: ASpot.cpp SpotOrders.cpp SpotOrders.h Log Message: ADD : Spot returns buildings localisations ADD : WorldView options Index: ASpot.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/ASpot.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ASpot.cpp 15 Dec 2005 17:11:51 -0000 1.16 --- ASpot.cpp 22 Dec 2005 16:35:22 -0000 1.17 *************** *** 195,198 **** --- 195,204 ---- infos.population = ecosquare->GetActivePopulation(); + if( m_watchConfig.m_bEcoSquareSwitch ) + { + infos.lstActivitySector = ecosquare->GetActivitySectorInfos(); + } + + // Add current province to "list of displayed provinces" if( idProv != INVALID_ID ) { Index: SpotOrders.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/SpotOrders.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpotOrders.cpp 23 Jul 2005 23:23:31 -0000 1.7 --- SpotOrders.cpp 22 Dec 2005 16:35:22 -0000 1.8 *************** *** 3,6 **** --- 3,21 ---- #include "SpotOrders.h" + OSpotConfig::OSpotConfig() + { + m_iNbrAltIteration = 1; + + m_bAltitudeSwitch =true ; + m_bSquareSwitch =true ; + m_bEcoSquareSwitch =false ; + m_bProvinceInfosSwitch =true ; + m_bArmySwitch =true ; + m_max_width =1 ; + m_max_height =1 ; + + } + + OSpotResult::OSpotResult() { Index: SpotOrders.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/SpotOrders.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SpotOrders.h 18 Dec 2005 21:37:03 -0000 1.9 --- SpotOrders.h 22 Dec 2005 16:35:22 -0000 1.10 *************** *** 10,16 **** --- 10,20 ---- { public: + + OSpotConfig(); + int m_iNbrAltIteration; // hi-resol altitude precision (number of iterations) bool m_bAltitudeSwitch; // the altitude map bool m_bSquareSwitch; // infos for each square + bool m_bEcoSquareSwitch; // economic infos for each square bool m_bProvinceInfosSwitch; // retrieve basic province informations (name, pop) bool m_bArmySwitch; // the army in the spot scope *************** *** 40,43 **** --- 44,50 ---- Population population; + + // Economic detailled infos + std::list<ActivitySectorInfos> lstActivitySector; }; |
|
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 ); } |
|
From: Greg <evo...@us...> - 2005-12-22 16:35:30
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18982/Evolution/Protogonos Modified Files: EcoDefinitions.h IEcoSquare.h Log Message: ADD : Spot returns buildings localisations ADD : WorldView options Index: EcoDefinitions.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/EcoDefinitions.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EcoDefinitions.h 4 Dec 2005 17:35:41 -0000 1.4 --- EcoDefinitions.h 22 Dec 2005 16:35:22 -0000 1.5 *************** *** 39,42 **** --- 39,44 ---- }; + + #include "EcoSector.h" *************** *** 45,47 **** --- 47,55 ---- typedef unsigned __int16 ecoSectorSize; + struct ActivitySectorInfos + { + ecoSectorId ecoSector; + ecoSectorSize size; + }; + #endif // __ECODEFINITIONS_H_ Index: IEcoSquare.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/IEcoSquare.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IEcoSquare.h 15 Dec 2005 17:11:52 -0000 1.2 --- IEcoSquare.h 22 Dec 2005 16:35:22 -0000 1.3 *************** *** 17,20 **** --- 17,22 ---- virtual void OnBuildingSiteComplete( Event *pEvent ) = 0; virtual Population GetActivePopulation() = 0; + virtual std::list<ActivitySectorInfos> GetActivitySectorInfos() = 0; + }; |
|
From: Greg <evo...@us...> - 2005-12-22 16:35:30
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18982/Evolution/Ploutos Modified Files: EcoSquare.cpp EcoSquare.h Log Message: ADD : Spot returns buildings localisations ADD : WorldView options Index: EcoSquare.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EcoSquare.cpp 16 Dec 2005 16:43:23 -0000 1.4 --- EcoSquare.cpp 22 Dec 2005 16:35:22 -0000 1.5 *************** *** 66,69 **** --- 66,87 ---- } + std::list<ActivitySectorInfos> EcoSquare::GetActivitySectorInfos() + { + std::list<ActivitySectorInfos> result; + + std::list<SquareActivitySector>::iterator it; + FOREACH( it, m_lstSectors ) + { + ActivitySectorInfos item; + item.ecoSector = it->GetSector(); + item.size = it->GetSize(); + + result.push_back( item ); + } + + return result; + } + + void EcoSquare::ToXml( XmlNode xmlParent ) const { Index: EcoSquare.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EcoSquare.h 16 Dec 2005 16:43:23 -0000 1.4 --- EcoSquare.h 22 Dec 2005 16:35:22 -0000 1.5 *************** *** 23,26 **** --- 23,28 ---- Population GetActivePopulation(); + std::list<ActivitySectorInfos> GetActivitySectorInfos(); + void ToXml( XmlNode xmlParent ) const; void FromXml( XmlNode xmlParent ); |
|
From: Greg <evo...@us...> - 2005-12-19 20:31:54
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10860/Evolution/Ulysses Modified Files: ELandscape.cpp ELandscape.h EWorldview.cpp EWorldview.h Log Message: ADD : Province fit the governor minimap (end) & some zoom improvements Index: ELandscape.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ELandscape.cpp 19 Dec 2005 17:53:52 -0000 1.6 --- ELandscape.cpp 19 Dec 2005 20:31:38 -0000 1.7 *************** *** 406,410 **** --- 406,418 ---- } + GeoCode ELandscape::GetMapCenter() + { + AiInterface aiInterface; + Order oGetSpotCenter; + OGeoCode& oSpotCenter = (OGeoCode&) aiInterface.SendOrder( e_orderGetSpotCenter, oGetSpotCenter, m_spotId ); + + return oSpotCenter.value; + } void ELandscape::Zoom( bool bUnzoom ) *************** *** 420,423 **** --- 428,437 ---- } + void ELandscape::Zoom( double dRatio ) + { + SetZoom( m_config.m_fTileSizeRatio * dRatio ); + } + + void ELandscape::SetZoom( double fZoom ) { *************** *** 488,493 **** // number of iterations to show a dimLength x dimHeight rect. ! double dHorizontalSquareSizeToReach = ( (double) GetWidth() ) / (double) dimLength; ! double dVerticalSquareSizeToReach = ( (double) GetHeight() ) / (double) dimHeight / cos( m_config.m_fMapPlaneRadius * PI / 180.0f ); // Take the minimum of the two => we are sure to display the rect even if Landscape --- 502,508 ---- // number of iterations to show a dimLength x dimHeight rect. ! double dMargin = 0.6f; ! double dHorizontalSquareSizeToReach = ( (double) GetWidth() ) / ( (double) dimLength + 2.0f ); ! double dVerticalSquareSizeToReach = ( (double) GetHeight() ) / ( (double) dimHeight + 2.0f ) / cos( m_config.m_fMapPlaneRadius * PI / 180.0f ); // Take the minimum of the two => we are sure to display the rect even if Landscape *************** *** 495,498 **** --- 510,515 ---- double dSquareSizeToReach = min( dHorizontalSquareSizeToReach, dVerticalSquareSizeToReach ); + dSquareSizeToReach *= dMargin; + // Now, we adjust the number of iteration in order TileSize is between 1/2 max and max *************** *** 957,963 **** } ! void ELandscape::OnResize( ) { ! EControl::OnResize(); if( m_poCurrentSpot ) --- 974,980 ---- } ! void ELandscape::OnResize( int iOldWidth, int iOldHeight ) { ! EControl::OnResize( iOldWidth, iOldHeight ); if( m_poCurrentSpot ) Index: ELandscape.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ELandscape.h 19 Dec 2005 17:53:52 -0000 1.7 --- ELandscape.h 19 Dec 2005 20:31:38 -0000 1.8 *************** *** 61,64 **** --- 61,65 ---- virtual void OnRButtonDown( int x, int y ) { GetParent()->OnRButtonDown( x, y ); } virtual void OnRButtonUp( int x, int y ) { GetParent()->OnRButtonUp( x, y ); } + virtual void OnResize( int iOldWidth, int iOldHeight ); void Invalidate(); *************** *** 74,79 **** --- 75,83 ---- void Zoom( bool bUnzoom ); + void Zoom( double dRatio ); + int GetSquareSizeInTile() { return m_iSquareSizeInTile; } double GetMapRadius() { return m_config.m_fMapPlaneRadius; } + GeoCode GetMapCenter(); void SetSpotValues( OSpotResult *pSpot ) { m_poCurrentSpot = pSpot; } *************** *** 88,92 **** bool ConvertRelGeocodeInScreenCoord( OpenGl &gl, GeoCode gc, int *x, int *y ); - virtual void OnResize( ); private: --- 92,95 ---- Index: EWorldview.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EWorldview.cpp 19 Dec 2005 17:53:52 -0000 1.10 --- EWorldview.cpp 19 Dec 2005 20:31:38 -0000 1.11 *************** *** 112,116 **** - void EWorldview::PaintProvinceInfos( OpenGl &gl ) { --- 112,115 ---- *************** *** 550,560 **** } ! void EWorldview::OnResize( ) { ! ECanvas::OnResize(); if( m_poCurrentSpot ) { m_Landscape.SetDimension( GetWidth(), GetHeight() ); Invalidate(); } --- 549,573 ---- } ! void EWorldview::OnResize( int iOldWidth, int iOldHeight ) { ! ECanvas::OnResize( iOldWidth, iOldHeight ); if( m_poCurrentSpot ) { m_Landscape.SetDimension( GetWidth(), GetHeight() ); + + // Ajust zoom in order new view show exactly the same + + if( (iOldWidth!=0) && (iOldHeight!=0) ) + { + double dHorizontalRatio = (double) GetWidth() / (double) iOldWidth; + double dVerticalRatio = (double) GetHeight() / (double) iOldHeight; + + double dZoomRatio = min( dHorizontalRatio, dVerticalRatio ); + // we take the minimum, thus we always have the entire old scene in the new view + + m_Landscape.Zoom( dZoomRatio ); + } + Invalidate(); } Index: EWorldview.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EWorldview.h 18 Dec 2005 21:37:03 -0000 1.7 --- EWorldview.h 19 Dec 2005 20:31:38 -0000 1.8 *************** *** 36,40 **** virtual void OnRButtonDown( int x, int y ) { GetParent()->OnRButtonDown( x, y ); } virtual void OnRButtonUp( int x, int y ) { GetParent()->OnRButtonUp( x, y ); } ! MainMapScreenItem * GetMainMapScreenItem( int x, int y ); --- 36,41 ---- virtual void OnRButtonDown( int x, int y ) { GetParent()->OnRButtonDown( x, y ); } virtual void OnRButtonUp( int x, int y ) { GetParent()->OnRButtonUp( x, y ); } ! virtual void OnResize( int iOldWidth, int iOldHeight ); ! MainMapScreenItem * GetMainMapScreenItem( int x, int y ); *************** *** 50,54 **** void UpdateSelectionAgent( AgentIdentifier agentSelected ); - virtual void OnResize( ); private: --- 51,54 ---- |
|
From: Greg <evo...@us...> - 2005-12-19 20:31:54
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Sphinx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10860/Evolution/Sphinx Modified Files: EControl.cpp EControl.h Log Message: ADD : Province fit the governor minimap (end) & some zoom improvements Index: EControl.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Sphinx/EControl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EControl.cpp 17 Aug 2005 21:12:10 -0000 1.1 --- EControl.cpp 19 Dec 2005 20:31:38 -0000 1.2 *************** *** 88,95 **** void EControl::SetDimension( int w, int h ) { m_rect.bottom = m_rect.top + h; m_rect.right = m_rect.left + w; ! OnResize(); } --- 88,98 ---- void EControl::SetDimension( int w, int h ) { + int iOldHeight = m_rect.bottom - m_rect.top; + int iOldWidth= m_rect.right - m_rect.left; + m_rect.bottom = m_rect.top + h; m_rect.right = m_rect.left + w; ! OnResize( iOldWidth, iOldHeight ); } Index: EControl.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Sphinx/EControl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EControl.h 18 Aug 2005 13:05:48 -0000 1.2 --- EControl.h 19 Dec 2005 20:31:38 -0000 1.3 *************** *** 124,128 **** virtual void OnCreate( ); virtual void OnPaint( OpenGl &gl, SDL_Rect rect ) {}; ! virtual void OnResize( ) {}; virtual void OnDrag( int dx, int dy ) {}; --- 124,128 ---- virtual void OnCreate( ); virtual void OnPaint( OpenGl &gl, SDL_Rect rect ) {}; ! virtual void OnResize( int iOldWidth, int iOldHeight ) {}; virtual void OnDrag( int dx, int dy ) {}; |
|
From: Greg <evo...@us...> - 2005-12-19 17:54:34
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv460/Evolution/Ulysses Modified Files: ELandscape.cpp ELandscape.h EWorldview.cpp Log Message: CHG : code refactoring (rename zoom with more explicit value) ADD : Province fit the governor minimap (in dev) Index: ELandscape.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ELandscape.cpp 18 Dec 2005 21:37:03 -0000 1.5 --- ELandscape.cpp 19 Dec 2005 17:53:52 -0000 1.6 *************** *** 10,16 **** #define PTZ( x, y ) ( m_pCoordinates[ 3 * ( (x) + (y) * m_iAltWidth) + 2 ] ) ! #define SQX( x, y ) ( PTX( (x)*( (int)m_fZoom ), (y)*( (int)m_fZoom ) ) ) ! #define SQY( x, y ) ( PTY( (x)*( (int)m_fZoom ), (y)*( (int)m_fZoom ) ) ) ! #define SQZ( x, y ) ( PTZ( (x)*( (int)m_fZoom ), (y)*( (int)m_fZoom ) ) ) #define SQZP( x, y ) ( min( 0, SQZ( (x),(y) ) ) ) --- 10,16 ---- #define PTZ( x, y ) ( m_pCoordinates[ 3 * ( (x) + (y) * m_iAltWidth) + 2 ] ) ! #define SQX( x, y ) ( PTX( (x)*( m_iSquareSizeInTile ), (y)*( m_iSquareSizeInTile ) ) ) ! #define SQY( x, y ) ( PTY( (x)*( m_iSquareSizeInTile ), (y)*( m_iSquareSizeInTile ) ) ) ! #define SQZ( x, y ) ( PTZ( (x)*( m_iSquareSizeInTile ), (y)*( m_iSquareSizeInTile ) ) ) #define SQZP( x, y ) ( min( 0, SQZ( (x),(y) ) ) ) *************** *** 25,29 **** m_fMapPlaneRadius = 30.0f; m_fTileSize = m_fMaxTileSize = 30.0f; ! m_fZoom = 1.0f; m_fVerticalInflation = 2.0f; --- 25,29 ---- m_fMapPlaneRadius = 30.0f; m_fTileSize = m_fMaxTileSize = 30.0f; ! m_fTileSizeRatio = 1.0f; m_fVerticalInflation = 2.0f; *************** *** 130,134 **** OSpotConfig& oSpotConfig = (OSpotConfig&) aiInterface.SendOrder( e_orderGetSpotConfig, oGetSpotConfig, m_spotId ); ! m_fZoom = ( 1 << oSpotConfig.m_iNbrAltIteration ); --- 130,134 ---- OSpotConfig& oSpotConfig = (OSpotConfig&) aiInterface.SendOrder( e_orderGetSpotConfig, oGetSpotConfig, m_spotId ); ! m_iSquareSizeInTile = ( 1 << oSpotConfig.m_iNbrAltIteration ); *************** *** 176,180 **** // Screen items MainMapScreenItem *pMapScreenItem = new MainMapScreenItem; ! pMapScreenItem->m_squareSize = m_fZoom * m_config.m_fTileSize; pMapScreenItem->m_xMapUpLeft = SQX(0,0); pMapScreenItem->m_yMapUpLeft = SQY(0,0); --- 176,180 ---- // Screen items MainMapScreenItem *pMapScreenItem = new MainMapScreenItem; ! pMapScreenItem->m_squareSize = m_iSquareSizeInTile * m_config.m_fTileSize; pMapScreenItem->m_xMapUpLeft = SQX(0,0); pMapScreenItem->m_yMapUpLeft = SQY(0,0); *************** *** 210,214 **** int iAltWidth = oSpotResult.GetAltMapWidth(); int iAltHeight = oSpotResult.GetAltMapHeight(); ! double fZoom = m_fZoom; if( ! m_bTerrainListUpToDate ) --- 210,215 ---- int iAltWidth = oSpotResult.GetAltMapWidth(); int iAltHeight = oSpotResult.GetAltMapHeight(); ! ! double fZoom = (double) m_iSquareSizeInTile; if( ! m_bTerrainListUpToDate ) *************** *** 343,347 **** if( dx != 0 ) { ! double fRealScroll = ( (double) dx ) / m_config.m_fZoom; m_config.m_fXScroll += fRealScroll; --- 344,348 ---- if( dx != 0 ) { ! double fRealScroll = ( (double) dx ) / m_config.m_fTileSizeRatio; m_config.m_fXScroll += fRealScroll; *************** *** 353,357 **** if( dy != 0 ) { ! double fRealScroll = ( (double) dy ) / m_config.m_fZoom; m_config.m_fYScroll += fRealScroll; --- 354,358 ---- if( dy != 0 ) { ! double fRealScroll = ( (double) dy ) / m_config.m_fTileSizeRatio; m_config.m_fYScroll += fRealScroll; *************** *** 411,419 **** if( !bUnzoom ) { ! SetZoom( m_config.m_fZoom * 1.1f ); } else { ! SetZoom( m_config.m_fZoom * 0.9f ); } } --- 412,420 ---- if( !bUnzoom ) { ! SetZoom( m_config.m_fTileSizeRatio * 1.1f ); } else { ! SetZoom( m_config.m_fTileSizeRatio * 0.9f ); } } *************** *** 421,425 **** void ELandscape::SetZoom( double fZoom ) { ! m_config.m_fZoom = fZoom; // Process the tile size & the iteration number --- 422,426 ---- void ELandscape::SetZoom( double fZoom ) { ! m_config.m_fTileSizeRatio = fZoom; // Process the tile size & the iteration number *************** *** 482,485 **** --- 483,516 ---- + void ELandscape::SetZoomToViewRect( GeoDimension dimLength, GeoDimension dimHeight ) + { + // The goal is to find the good m_fTileSizeRatio associated with the good + // number of iterations to show a dimLength x dimHeight rect. + + double dHorizontalSquareSizeToReach = ( (double) GetWidth() ) / (double) dimLength; + double dVerticalSquareSizeToReach = ( (double) GetHeight() ) / (double) dimHeight / cos( m_config.m_fMapPlaneRadius * PI / 180.0f ); + + // Take the minimum of the two => we are sure to display the rect even if Landscape + // doesn't match exactly the same ratio width/height than dimLength/dimHeight + double dSquareSizeToReach = min( dHorizontalSquareSizeToReach, dVerticalSquareSizeToReach ); + + // Now, we adjust the number of iteration in order TileSize is between 1/2 max and max + + double dSquareSizeInTileToReach = dSquareSizeToReach / m_config.m_fMaxTileSize; + + int iSquareSizeInTile, iNbrIteration; + for( iNbrIteration = 1, iSquareSizeInTile = 1;; iNbrIteration ++, iSquareSizeInTile *= 2 ) + { + if( (double)iSquareSizeInTile >= dSquareSizeInTileToReach ) + { + break ; + } + } + + // last, we compute the exact value of tile size to match what we want + + double dFinalTileSizeInTile = dSquareSizeInTileToReach / (double)iSquareSizeInTile ; + SetZoom( dFinalTileSizeInTile ); + } double ELandscape::sqx( int x, int y ) *************** *** 514,519 **** int iAltHeight = m_poCurrentSpot->GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_fZoom ); ! int iSquareWidth = (int)( iAltWidth / m_fZoom ); int lon = gc.LonLow(); --- 545,550 ---- int iAltHeight = m_poCurrentSpot->GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_iSquareSizeInTile ); ! int iSquareWidth = (int)( iAltWidth / m_iSquareSizeInTile ); int lon = gc.LonLow(); *************** *** 566,570 **** m_pCoordinates = new int[ 3 * iAltHeight * iAltWidth ]; // x,y,z ! double fAltMult = m_config.m_fVerticalInflation * m_config.m_fZoom; double fTile = m_config.m_fTileSize; --- 597,601 ---- m_pCoordinates = new int[ 3 * iAltHeight * iAltWidth ]; // x,y,z ! double fAltMult = m_config.m_fVerticalInflation * m_config.m_fTileSizeRatio; double fTile = m_config.m_fTileSize; *************** *** 627,632 **** for( x = 0; x < iAltWidth; x++ ) { ! int xSquare = (int)( x / m_fZoom ); ! int ySquare = (int)( y / m_fZoom ); if( ! oSpotResult.GetSquareInfo( xSquare, ySquare ).bDiscovered ) --- 658,663 ---- for( x = 0; x < iAltWidth; x++ ) { ! int xSquare = (int)( x / m_iSquareSizeInTile ); ! int ySquare = (int)( y / m_iSquareSizeInTile ); if( ! oSpotResult.GetSquareInfo( xSquare, ySquare ).bDiscovered ) *************** *** 722,726 **** int iSquareSize = min( ( 512 / height ), ( 512 / width ) ); ! double fTextureRatio = 6.0f / m_config.m_fZoom; m_iTileSizeOnSurface = iSquareSize; --- 753,757 ---- int iSquareSize = min( ( 512 / height ), ( 512 / width ) ); ! double fTextureRatio = 6.0f / m_config.m_fTileSizeRatio; m_iTileSizeOnSurface = iSquareSize; *************** *** 807,812 **** int iAltHeight = oSpotResult.GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_fZoom ); ! int iSquareWidth = (int)( iAltWidth / m_fZoom ); --- 838,843 ---- int iAltHeight = oSpotResult.GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_iSquareSizeInTile ); ! int iSquareWidth = (int)( iAltWidth / m_iSquareSizeInTile ); *************** *** 818,822 **** for( int y = 0; y < (iSquareHeight-1); y++ ) { ! int iAltY = (int)( y * m_fZoom ); double fTexCoordY1 = ( (double) (y) ) * (double)m_iTileSizeOnSurface / 20.0f; --- 849,853 ---- for( int y = 0; y < (iSquareHeight-1); y++ ) { ! int iAltY = (int)( y * m_iSquareSizeInTile ); double fTexCoordY1 = ( (double) (y) ) * (double)m_iTileSizeOnSurface / 20.0f; *************** *** 825,829 **** for( int x = 0; x < (iSquareWidth-1); x++ ) { ! int iZoom = (int) m_fZoom; int iAltX = x * iZoom; --- 856,860 ---- for( int x = 0; x < (iSquareWidth-1); x++ ) { ! int iZoom = (int) m_iSquareSizeInTile; int iAltX = x * iZoom; *************** *** 914,919 **** int iScreenCenterY = GetHeight() /2; ! *fOffsetX = ( (double)iScreenCenterX - m_fZoom * ( (double)iMapCenterX ) * m_config.m_fTileSize ); ! *fOffsetY = ( (double)iScreenCenterY - m_fZoom * ( (double)iMapCenterY ) * m_config.m_fTileSize ); SDL_Rect rctControl = GetAbsRect(); --- 945,950 ---- int iScreenCenterY = GetHeight() /2; ! *fOffsetX = ( (double)iScreenCenterX - m_iSquareSizeInTile * ( (double)iMapCenterX ) * m_config.m_fTileSize ); ! *fOffsetY = ( (double)iScreenCenterY - m_iSquareSizeInTile * ( (double)iMapCenterY ) * m_config.m_fTileSize ); SDL_Rect rctControl = GetAbsRect(); *************** *** 922,927 **** // Screen scroll ! *fOffsetX -= m_config.m_fXScroll * m_config.m_fTileSize * m_fZoom; ! *fOffsetY -= m_config.m_fYScroll * m_config.m_fTileSize * m_fZoom; } --- 953,958 ---- // Screen scroll ! *fOffsetX -= m_config.m_fXScroll * m_config.m_fTileSize * m_iSquareSizeInTile; ! *fOffsetY -= m_config.m_fYScroll * m_config.m_fTileSize * m_iSquareSizeInTile; } *************** *** 950,985 **** } - void ELandscape::SetZoomToViewRect( GeoDimension dimLength, GeoDimension dimHeight ) - { - // 1. Process nbIteration and TileSize for the requested dimensions - // 2. Set up m_config - - int iNbrIteration; - GeoDimension dimCurrentWidth, dimCurrentHeight; - m_config.m_fTileSize = m_config.m_fMaxTileSize / 2; - - // We have set the TileSize to minimum ( max/2 ) - // Now, we try to find the NbrIteration need to have an area with the requested size - - for( iNbrIteration = 1; iNbrIteration < 999; iNbrIteration ++ ) // 999 is a protection ... - { - GetMapDimFromNbIteration( iNbrIteration, & dimCurrentWidth, & dimCurrentHeight ); - - if( (dimCurrentWidth >= dimLength) && (dimCurrentHeight >= dimHeight ) ) - { - // With iNbrIteration, we have a bigger area than requested - // Now, we increase m_fTileSize to fit exactly what we want - // rmq : m_fTileSize = zoom * m_fMaxTileSize - - double fHorZoom = ( (double) dimCurrentWidth ) / ( (double)dimLength ); // >= 1 - double fVerZoom = ( (double) dimCurrentHeight ) / ( (double)dimHeight ); // >= 1 - - SetZoom( min( fHorZoom, fVerZoom ) ); - return ; - } - } - - assert( false ); - } - - --- 981,982 ---- Index: ELandscape.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ELandscape.h 18 Dec 2005 21:37:03 -0000 1.6 --- ELandscape.h 19 Dec 2005 17:53:52 -0000 1.7 *************** *** 29,33 **** // Zoom stuff double m_fMaxTileSize; ! double m_fZoom; // Configuration --- 29,34 ---- // Zoom stuff double m_fMaxTileSize; ! double m_fTileSizeRatio; // tile size = m_fTileSizeRatio * m_fMaxTileSize ! // (this ratio is between 1/2 and 1) // Configuration *************** *** 73,77 **** void Zoom( bool bUnzoom ); ! double GetZoom() { return m_fZoom; } double GetMapRadius() { return m_config.m_fMapPlaneRadius; } --- 74,78 ---- void Zoom( bool bUnzoom ); ! int GetSquareSizeInTile() { return m_iSquareSizeInTile; } double GetMapRadius() { return m_config.m_fMapPlaneRadius; } *************** *** 138,142 **** int * m_pCoordinates; int m_iAltWidth; ! double m_fZoom; // Last terrain processed --- 139,143 ---- int * m_pCoordinates; int m_iAltWidth; ! int m_iSquareSizeInTile; // Last terrain processed Index: EWorldview.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EWorldview.cpp 18 Dec 2005 21:37:03 -0000 1.9 --- EWorldview.cpp 19 Dec 2005 17:53:52 -0000 1.10 *************** *** 126,130 **** OSpotResult::ProvInfos infos = it->second; ! if( m_Landscape.GetZoom() >= m_fZoomMinForProvinceNames ) { int xScreen; --- 126,130 ---- OSpotResult::ProvInfos infos = it->second; ! if( (double)m_Landscape.GetSquareSizeInTile() >= m_fZoomMinForProvinceNames ) { int xScreen; *************** *** 359,364 **** int iAltHeight = oSpotResult.GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_Landscape.GetZoom() ); ! int iSquareWidth = (int)( iAltWidth / m_Landscape.GetZoom() ); glDisable(GL_DEPTH_TEST); --- 359,364 ---- int iAltHeight = oSpotResult.GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_Landscape.GetSquareSizeInTile() ); ! int iSquareWidth = (int)( iAltWidth / m_Landscape.GetSquareSizeInTile() ); glDisable(GL_DEPTH_TEST); *************** *** 482,487 **** int iAltHeight = m_poCurrentSpot->GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_Landscape.GetZoom() ); ! int iSquareWidth = (int)( iAltWidth / m_Landscape.GetZoom() ); --- 482,487 ---- int iAltHeight = m_poCurrentSpot->GetAltMapHeight(); ! int iSquareHeight = (int)( iAltHeight / m_Landscape.GetSquareSizeInTile() ); ! int iSquareWidth = (int)( iAltWidth / m_Landscape.GetSquareSizeInTile() ); |
|
From: Greg <evo...@us...> - 2005-12-18 21:37:20
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446/Evolution/Ulysses Modified Files: AiInterface.cpp AiInterface.h ELandscape.cpp ELandscape.h EWorldview.cpp EWorldview.h GameScreen.cpp GovernorDlg.cpp GovernorDlg.h Ulysses.dsp Log Message: ADD : process province dimensions ADD : adjust governor map to province (in dev) Index: AiInterface.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/AiInterface.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AiInterface.cpp 18 Aug 2005 13:05:48 -0000 1.14 --- AiInterface.cpp 18 Dec 2005 21:37:03 -0000 1.15 *************** *** 163,164 **** --- 163,176 ---- } } + + AgentIdentifier AiInterface::GetCartographer() + { + CommandDomain cdSearchDomain; + cdSearchDomain.SetDomain( eDomainType_country, 0 ); // country 0 (player) + cdSearchDomain.SetDomain( eDomainType_power, e_powerCartograph ); + + AiInterface aiInterface; + return aiInterface.FindInstitution( cdSearchDomain ); + + } + Index: AiInterface.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/AiInterface.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AiInterface.h 22 Jul 2005 08:10:26 -0000 1.10 --- AiInterface.h 18 Dec 2005 21:37:03 -0000 1.11 *************** *** 30,33 **** --- 30,34 ---- institutionId GetAgentPanel(); + AgentIdentifier GetCartographer(); void SubscribeNotificationsFrom( EControl *pControl, AgentIdentifier source ); Index: ELandscape.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ELandscape.cpp 13 Sep 2005 13:29:05 -0000 1.4 --- ELandscape.cpp 18 Dec 2005 21:37:03 -0000 1.5 *************** *** 481,484 **** --- 481,486 ---- } + + double ELandscape::sqx( int x, int y ) { *************** *** 948,951 **** --- 950,985 ---- } + void ELandscape::SetZoomToViewRect( GeoDimension dimLength, GeoDimension dimHeight ) + { + // 1. Process nbIteration and TileSize for the requested dimensions + // 2. Set up m_config + + int iNbrIteration; + GeoDimension dimCurrentWidth, dimCurrentHeight; + m_config.m_fTileSize = m_config.m_fMaxTileSize / 2; + + // We have set the TileSize to minimum ( max/2 ) + // Now, we try to find the NbrIteration need to have an area with the requested size + + for( iNbrIteration = 1; iNbrIteration < 999; iNbrIteration ++ ) // 999 is a protection ... + { + GetMapDimFromNbIteration( iNbrIteration, & dimCurrentWidth, & dimCurrentHeight ); + + if( (dimCurrentWidth >= dimLength) && (dimCurrentHeight >= dimHeight ) ) + { + // With iNbrIteration, we have a bigger area than requested + // Now, we increase m_fTileSize to fit exactly what we want + // rmq : m_fTileSize = zoom * m_fMaxTileSize + + double fHorZoom = ( (double) dimCurrentWidth ) / ( (double)dimLength ); // >= 1 + double fVerZoom = ( (double) dimCurrentHeight ) / ( (double)dimHeight ); // >= 1 + + SetZoom( min( fHorZoom, fVerZoom ) ); + return ; + } + } + + assert( false ); + } Index: ELandscape.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ELandscape.h 16 Dec 2005 15:46:47 -0000 1.5 --- ELandscape.h 18 Dec 2005 21:37:03 -0000 1.6 *************** *** 70,73 **** --- 70,74 ---- void ScrollView( int dx, int dy ); void ChangeMapCenter( GeoCode gc ); + void SetZoomToViewRect( GeoDimension dimLength, GeoDimension dimHeight ); void Zoom( bool bUnzoom ); *************** *** 99,103 **** void GetMapDimFromNbIteration( int iNbrIteration, GeoDimension *piMaxWidth, GeoDimension *piMaxHeight ); - // Terrain drawing methods --- 100,103 ---- Index: EWorldview.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EWorldview.cpp 16 Dec 2005 15:46:47 -0000 1.8 --- EWorldview.cpp 18 Dec 2005 21:37:03 -0000 1.9 *************** *** 535,538 **** --- 535,545 ---- } + void EWorldview::ZoomToSeeRect( GeoDimension width, GeoDimension height ) + { + m_Landscape.SetZoomToViewRect( width, height ); + Invalidate(); + } + + void EWorldview::UpdateSelectionAgent( AgentIdentifier agentSelected ) { Index: EWorldview.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EWorldview.h 16 Dec 2005 15:46:47 -0000 1.6 --- EWorldview.h 18 Dec 2005 21:37:03 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- void ScrollView( int dx, int dy ); void ChangeMapCenter( GeoCode gc ); + void ZoomToSeeRect( GeoDimension width, GeoDimension height ); void Zoom( bool bUnzoom ); Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GameScreen.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** GameScreen.cpp 16 Dec 2005 16:20:13 -0000 1.90 --- GameScreen.cpp 18 Dec 2005 21:37:03 -0000 1.91 *************** *** 855,859 **** CGovernorDlg *pGovernorDlg = new CGovernorDlg; pNewDialog = pGovernorDlg; - pGovernorDlg->Create( this, mainAgentid ); m_dlgMinimap.Hide(); --- 855,858 ---- *************** *** 862,876 **** m_cvSystemButtons.Hide(); ! m_Worldview.SetPosition( 180, 470 ); ! m_Worldview.SetDimension( 670, 300 ); ! ! Kernel *pKernel = Kernel::LockKernel(); ! ! provinceId idProvince = mainAgentid.GetProvince(); ! assert( idProvince != INVALID_ID ); ! GeoCode gcProvinceCenter = pKernel->world.GetIProvince( idProvince )->GetIGeoProvince()->GetGeoCenter(); ! m_Worldview.ChangeMapCenter( gcProvinceCenter ); ! ! pKernel->Unlock(); break; --- 861,865 ---- m_cvSystemButtons.Hide(); ! pGovernorDlg->Create( this, mainAgentid, & m_Worldview ); break; Index: GovernorDlg.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GovernorDlg.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** GovernorDlg.cpp 4 Dec 2005 17:35:41 -0000 1.49 --- GovernorDlg.cpp 18 Dec 2005 21:37:03 -0000 1.50 *************** *** 8,11 **** --- 8,12 ---- #include "ESliderDlg.h" #include "AGeneral.h" + #include "EWorldView.h" #define ADDBUILDINGMENU_SIZEFACTOR 512 *************** *** 19,22 **** --- 20,24 ---- Invalidate(); m_idMenuAddBuilding = INVALID_ID; + m_pWorldview = NULL; } *************** *** 25,32 **** } ! void CGovernorDlg::Create( ECanvas *pParent, AgentIdentifier agentId ) { m_agentId = agentId; m_mode = eGovernorMode_general; EDialog::Create( pParent ); --- 27,49 ---- } ! void CGovernorDlg::Create( ECanvas *pParent, AgentIdentifier agentId, EWorldview *pWorldview ) { m_agentId = agentId; m_mode = eGovernorMode_general; + m_pWorldview = pWorldview; + + // Center the wordview on the hole / on the province + + m_pWorldview->SetPosition( 180, 470 ); + m_pWorldview->SetDimension( 670, 300 ); + + AiInterface aiInterface; + + OInt oGetProvinceGeographicInfos; + oGetProvinceGeographicInfos.value = agentId.GetProvince(); + OProvinceGeoInfos& oGeoInfos = (OProvinceGeoInfos&) aiInterface.SendOrder( e_orderGetProvinceGeographicInfos, oGetProvinceGeographicInfos, aiInterface.GetCartographer() ); + + m_pWorldview->ChangeMapCenter( oGeoInfos.gcCenter ); + m_pWorldview->ZoomToSeeRect( oGeoInfos.dimWestEast, oGeoInfos.dimNorthSouth ); EDialog::Create( pParent ); Index: GovernorDlg.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GovernorDlg.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GovernorDlg.h 4 Dec 2005 17:35:41 -0000 1.24 --- GovernorDlg.h 18 Dec 2005 21:37:03 -0000 1.25 *************** *** 16,19 **** --- 16,20 ---- #include "ELabel.h" + class EWorldview; enum eGovernorMode *************** *** 31,35 **** virtual ~CGovernorDlg(); ! void Create( ECanvas *pParent, AgentIdentifier agentId ); void OnCreate( ); virtual void OnPaint( OpenGl &gl, SDL_Rect rect ); --- 32,36 ---- virtual ~CGovernorDlg(); ! void Create( ECanvas *pParent, AgentIdentifier agentId, EWorldview * pWorldView ); void OnCreate( ); virtual void OnPaint( OpenGl &gl, SDL_Rect rect ); *************** *** 64,67 **** --- 65,70 ---- private: + EWorldview * m_pWorldview; + eGovernorMode m_mode; Index: Ulysses.dsp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/Ulysses.dsp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Ulysses.dsp 18 Aug 2005 13:05:48 -0000 1.37 --- Ulysses.dsp 18 Dec 2005 21:37:03 -0000 1.38 *************** *** 70,74 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../Sphinx" /I "../../ELib" /I "../Agamemnon" /I "../protogonos" /I "../kerberos" /I "../Ares" /I "../Atlas" /I "../Hestia" /I "../Ploutos" /I "../Apollon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 70,74 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../Sphinx" /I "../../ELib" /I "../Agamemnon" /I "../protogonos" /I "../kerberos" /I "../Ares" /I "../Atlas" /I "../Hestia" /I "../Ploutos" /I "../Apollon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 |
|
From: Greg <evo...@us...> - 2005-12-18 21:37:20
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446/Evolution/Atlas Modified Files: Atlas.dsp GeoProvince.cpp GeoProvince.h GeoWorld.cpp GeoWorld.h Log Message: ADD : process province dimensions ADD : adjust governor map to province (in dev) Index: Atlas.dsp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/Atlas.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Atlas.dsp 22 Jul 2005 23:29:55 -0000 1.6 --- Atlas.dsp 18 Dec 2005 21:37:03 -0000 1.7 *************** *** 65,69 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c ! # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../../ELib/" /I "../Protogonos" /I "../Eris" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" --- 65,69 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c ! # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../../ELib/" /I "../Protogonos" /I "../Eris" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" Index: GeoProvince.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/GeoProvince.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GeoProvince.cpp 17 Aug 2005 16:12:10 -0000 1.3 --- GeoProvince.cpp 18 Dec 2005 21:37:03 -0000 1.4 *************** *** 26,29 **** --- 26,32 ---- xmlObj.AddToXmlStdVector( "adj_prov", m_vecAdjacentProvinces ); xmlObj.AddToXml( "size", m_iSquareNumber ); + + xmlObj.AddAttribute( "dimns", m_dimNorthSouth ); + xmlObj.AddAttribute( "dimwe", m_dimWestEast ); } *************** *** 35,38 **** --- 38,44 ---- xmlObj.GetIntVecFromXml( "adj_prov", & m_vecAdjacentProvinces ); m_iSquareNumber = xmlObj.GetIntFromXml( "size" ); + + m_dimNorthSouth = (GeoDimension) xmlObj.GetAttribute( "dimns" ).ToInt(); + m_dimWestEast = (GeoDimension) xmlObj.GetAttribute( "dimwe" ).ToInt(); } *************** *** 71,73 **** { return m_iSquareNumber; ! } \ No newline at end of file --- 77,87 ---- { return m_iSquareNumber; ! } ! ! void GeoProvince::_SetGeoDatas( GeoCode gc, GeoDimension dimNorthSouth, GeoDimension dimWestEast ) ! { ! m_geoGeoCenter = gc; ! ! m_dimNorthSouth = dimNorthSouth; ! m_dimWestEast = dimWestEast; ! } Index: GeoProvince.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/GeoProvince.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GeoProvince.h 17 Aug 2005 16:12:10 -0000 1.3 --- GeoProvince.h 18 Dec 2005 21:37:03 -0000 1.4 *************** *** 17,22 **** void FromXml( XmlNode xmlParent ); ! void _SetGeoCenter( GeoCode gc ) { m_geoGeoCenter = gc; } GeoCode GetGeoCenter() { return m_geoGeoCenter; } virtual void _OnAddSquare(); --- 17,26 ---- void FromXml( XmlNode xmlParent ); ! void _SetGeoDatas( GeoCode gc, GeoDimension dimNorthSouth, GeoDimension dimWestEast ); ! GeoCode GetGeoCenter() { return m_geoGeoCenter; } + GeoDimension GetDimensionNorthSouth() { return m_dimNorthSouth; } + GeoDimension GetDimensionWestEast() { return m_dimWestEast; } + virtual void _OnAddSquare(); *************** *** 30,33 **** --- 34,38 ---- GeoCode m_geoGeoCenter; + GeoDimension m_dimNorthSouth, m_dimWestEast; int m_iSquareNumber; std::vector<provinceId> m_vecAdjacentProvinces; Index: GeoWorld.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/GeoWorld.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GeoWorld.cpp 9 Nov 2005 14:56:34 -0000 1.16 --- GeoWorld.cpp 18 Dec 2005 21:37:03 -0000 1.17 *************** *** 110,114 **** ComputeProvinces( world, pCallBack ); ! ComputeProvinceCenters(); ComputeProvinceAdjacency(); } --- 110,114 ---- ComputeProvinces( world, pCallBack ); ! ComputeProvinceGeographicDatas(); ComputeProvinceAdjacency(); } *************** *** 602,607 **** ! void GeoWorld::ComputeProvinceCenters() { IWorld &world = IWorld::GetInstance(); --- 602,609 ---- ! void GeoWorld::ComputeProvinceGeographicDatas() { + // Compute provinces centers and geographic dimensions + IWorld &world = IWorld::GetInstance(); *************** *** 611,614 **** --- 613,618 ---- std::vector<float> vecYCoord( iProvinceNbr, 0.0f ); std::vector<int> vecNbrSquare( iProvinceNbr, 0 ); + + std::vector<ProvinceExtremities> vecExtremities( iProvinceNbr ); int iWorldWidth = world.GetWorldWidth(); *************** *** 640,657 **** } float fNbrSquare = (float) vecNbrSquare[ idProv ]; vecXCoord[ idProv ] = ( vecXCoord[ idProv ] * fNbrSquare + iRealLon ) / ( fNbrSquare + 1.0f ); vecYCoord[ idProv ] = ( vecYCoord[ idProv ] * fNbrSquare + coLat ) / ( fNbrSquare + 1.0f ); vecNbrSquare[ idProv ] ++; } } } ! // Set province centers for( provinceId provId = 0; provId < iProvinceNbr; provId ++ ) { EvoRef<IGeoProvince> province = world.GetIProvince( provId )->GetIGeoProvince(); ! province->_SetGeoCenter( GeoCode( GEOCODE_LOW, (Coord) vecXCoord[ provId ], (Coord) vecYCoord[ provId ] ) ); } } --- 644,680 ---- } + // Compute province center : + // compute the average latitude and the average longitude term by terms : + // average with N+1 terms = ( (average with N terms )*N + term ) / ( N+1 ) + float fNbrSquare = (float) vecNbrSquare[ idProv ]; vecXCoord[ idProv ] = ( vecXCoord[ idProv ] * fNbrSquare + iRealLon ) / ( fNbrSquare + 1.0f ); vecYCoord[ idProv ] = ( vecYCoord[ idProv ] * fNbrSquare + coLat ) / ( fNbrSquare + 1.0f ); vecNbrSquare[ idProv ] ++; + + // Store province extremities + vecExtremities[ idProv ].coLatMax = max( vecExtremities[ idProv ].coLatMax, coLat ); + vecExtremities[ idProv ].coLatMin = min( vecExtremities[ idProv ].coLatMin, coLat ); + vecExtremities[ idProv ].coLonMax = max( vecExtremities[ idProv ].coLonMax, (Coord) iRealLon ); + vecExtremities[ idProv ].coLonMin = min( vecExtremities[ idProv ].coLonMin, (Coord) iRealLon ); } } } ! // Set province centers & dimensions for( provinceId provId = 0; provId < iProvinceNbr; provId ++ ) { EvoRef<IGeoProvince> province = world.GetIProvince( provId )->GetIGeoProvince(); ! ! Coord lonCenter = (Coord)( ( vecExtremities[ provId ].coLonMax + vecExtremities[ provId ].coLonMin ) / 2 ); ! Coord latCenter = (Coord)( ( vecExtremities[ provId ].coLatMax + vecExtremities[ provId ].coLatMin ) / 2 ); ! ! GeoCode gcCenter( GEOCODE_LOW, lonCenter, latCenter ) ; ! ! GeoDimension dimNorthSouth = (GeoDimension)( vecExtremities[ provId ].coLatMax - vecExtremities[ provId ].coLatMin + 1 ); ! GeoDimension dimWestEast = (GeoDimension)( vecExtremities[ provId ].coLonMax - vecExtremities[ provId ].coLonMin + 1 ); ! ! province->_SetGeoDatas( gcCenter, dimNorthSouth, dimWestEast ); } } Index: GeoWorld.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/GeoWorld.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GeoWorld.h 9 Nov 2005 14:56:34 -0000 1.8 --- GeoWorld.h 18 Dec 2005 21:37:03 -0000 1.9 *************** *** 48,52 **** void ComputeProvinces( IWorld &world, void (*pCallBack)(float, const char*) ); ! void ComputeProvinceCenters(); void ComputeProvinceAdjacency(); --- 48,52 ---- void ComputeProvinces( IWorld &world, void (*pCallBack)(float, const char*) ); ! void ComputeProvinceGeographicDatas(); void ComputeProvinceAdjacency(); *************** *** 56,59 **** --- 56,74 ---- private: + class ProvinceExtremities + { + public: + ProvinceExtremities( Coord coLon, Coord coLat ) + : coLatMax( coLat ), coLatMin( coLat ), coLonMax( coLon ), coLonMin( coLon ) + {} + + ProvinceExtremities() + : coLatMax( 0 ), coLatMin( COORD_LOW_MAX ), coLonMax( 0 ), coLonMin( COORD_LOW_MAX ) + {} + + Coord coLatMax, coLatMin, coLonMax, coLonMin; + }; + + private: Altitude m_SeaLevel; |
|
From: Greg <evo...@us...> - 2005-12-18 21:37:19
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446/Evolution/Agamemnon Modified Files: ACartographer.cpp GeoOrders.h SpotOrders.h Log Message: ADD : process province dimensions ADD : adjust governor map to province (in dev) Index: ACartographer.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/ACartographer.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ACartographer.cpp 5 Aug 2005 17:06:35 -0000 1.9 --- ACartographer.cpp 18 Dec 2005 21:37:03 -0000 1.10 *************** *** 177,180 **** --- 177,183 ---- pResult->vecProvinces = province->GetIGeoProvince()->_GetAdjacentProvinces(); + pResult->dimNorthSouth = province->GetIGeoProvince()->GetDimensionNorthSouth(); + pResult->dimWestEast = province->GetIGeoProvince()->GetDimensionWestEast(); + pKernel->Unlock(); return *pResult; Index: GeoOrders.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/GeoOrders.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GeoOrders.h 5 Aug 2005 17:06:35 -0000 1.5 --- GeoOrders.h 18 Dec 2005 21:37:03 -0000 1.6 *************** *** 37,40 **** --- 37,41 ---- EString esName; GeoCode gcCenter; + GeoDimension dimNorthSouth, dimWestEast; std::vector<provinceId> vecProvinces; Index: SpotOrders.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/SpotOrders.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpotOrders.h 15 Dec 2005 17:11:51 -0000 1.8 --- SpotOrders.h 18 Dec 2005 21:37:03 -0000 1.9 *************** *** 16,21 **** bool m_bArmySwitch; // the army in the spot scope ! GeoDimension m_max_width; // the maximum width the spot can display ! GeoDimension m_max_height; // the maximum height the spot can display }; --- 16,21 ---- bool m_bArmySwitch; // the army in the spot scope ! GeoDimension m_max_width; // the maximum width the spot can display (in square) ! GeoDimension m_max_height; // the maximum height the spot can display (in square) }; |
|
From: Greg <evo...@us...> - 2005-12-18 21:37:17
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446/Evolution/Protogonos Modified Files: Coordinates.h IGeoProvince.h Log Message: ADD : process province dimensions ADD : adjust governor map to province (in dev) Index: Coordinates.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/Coordinates.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Coordinates.h 17 Aug 2005 16:12:12 -0000 1.4 --- Coordinates.h 18 Dec 2005 21:37:03 -0000 1.5 *************** *** 26,29 **** --- 26,31 ---- #define COORD_LORESOL_NIBTS 9 + #define COORD_LOW_MAX ( (Coord) 512 ) + enum GeoMode { Index: IGeoProvince.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/IGeoProvince.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IGeoProvince.h 25 Jun 2005 17:32:56 -0000 1.2 --- IGeoProvince.h 18 Dec 2005 21:37:03 -0000 1.3 *************** *** 15,20 **** virtual ~IGeoProvince(); ! virtual void _SetGeoCenter( GeoCode gc ) = 0 ; virtual GeoCode GetGeoCenter() = 0 ; virtual void _OnAddSquare() = 0; --- 15,23 ---- virtual ~IGeoProvince(); ! virtual void _SetGeoDatas( GeoCode gc, GeoDimension dimNorthSouth, GeoDimension dimWestEast ) = 0; ! virtual GeoCode GetGeoCenter() = 0 ; + virtual GeoDimension GetDimensionNorthSouth() = 0; + virtual GeoDimension GetDimensionWestEast() = 0; virtual void _OnAddSquare() = 0; |
|
From: Greg <evo...@us...> - 2005-12-16 16:43:39
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/Evolution/Atlas Modified Files: GeoSquare.cpp Log Message: CHG : All list & vector are cleared before beiing loaded FIX : Misses in save/load of some classes Index: GeoSquare.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Atlas/GeoSquare.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GeoSquare.cpp 9 Nov 2005 14:56:34 -0000 1.8 --- GeoSquare.cpp 16 Dec 2005 16:43:22 -0000 1.9 *************** *** 182,185 **** --- 182,186 ---- xmlParent.AddAttribute( "temp", EString( m_temperature ) ); xmlParent.AddAttribute( "clim", EString( (int)m_climate ) ); + xmlParent.AddAttribute( "slop", EString( (int)m_slope ) ); } *************** *** 191,194 **** --- 192,196 ---- m_temperature = (Temperature) xmlParent.GetAttribute( "temp" ).ToInt(); m_climate = (Climate) xmlParent.GetAttribute( "clim" ).ToInt(); + m_slope = (Slope) xmlParent.GetAttribute( "slop" ).ToInt(); } |
|
From: Greg <evo...@us...> - 2005-12-16 16:43:35
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/Evolution/Ploutos Modified Files: EcoProvince.cpp EcoSquare.cpp EcoSquare.h SquareActivitySector.cpp SquareActivitySector.h Log Message: CHG : All list & vector are cleared before beiing loaded FIX : Misses in save/load of some classes Index: EcoProvince.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoProvince.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** EcoProvince.cpp 15 Dec 2005 15:03:37 -0000 1.19 --- EcoProvince.cpp 16 Dec 2005 16:43:22 -0000 1.20 *************** *** 164,171 **** void EcoProvince::FromXml( XmlNode xmlParent ) { - m_lstActivitySectors.clear(); - m_production.clear(); - m_stocks.clear(); - XmlNode xmlObj = xmlParent.GetChild( "EcoProvince" ); --- 164,167 ---- Index: EcoSquare.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EcoSquare.cpp 15 Dec 2005 17:11:51 -0000 1.3 --- EcoSquare.cpp 16 Dec 2005 16:43:23 -0000 1.4 *************** *** 65,66 **** --- 65,78 ---- return result; } + + void EcoSquare::ToXml( XmlNode xmlParent ) const + { + xmlParent.AddToXml( "sectors", m_lstSectors ); + xmlParent.AddToXml( "buildsite", m_lstBuildingSite ); + } + + void EcoSquare::FromXml( XmlNode xmlParent ) + { + xmlParent.GetListFromXml( "sectors", & m_lstSectors ); + xmlParent.GetListFromXml( "buildsite", & m_lstBuildingSite ); + } Index: EcoSquare.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EcoSquare.h 15 Dec 2005 17:11:51 -0000 1.3 --- EcoSquare.h 16 Dec 2005 16:43:23 -0000 1.4 *************** *** 23,26 **** --- 23,30 ---- Population GetActivePopulation(); + void ToXml( XmlNode xmlParent ) const; + void FromXml( XmlNode xmlParent ); + + private: Index: SquareActivitySector.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/SquareActivitySector.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SquareActivitySector.cpp 15 Dec 2005 15:03:37 -0000 1.2 --- SquareActivitySector.cpp 16 Dec 2005 16:43:23 -0000 1.3 *************** *** 36,37 **** --- 36,49 ---- m_size = (ecoSectorSize) iNewSize; } + + void SquareActivitySector::ToXml( XmlNode xmlParent ) const + { + xmlParent.AddAttribute( "id", m_sector ); + xmlParent.AddAttribute( "size", m_size ); + } + + void SquareActivitySector::FromXml( XmlNode xmlParent ) + { + m_sector = (ecoSectorId) xmlParent.GetAttribute( "id" ).ToInt(); + m_size = (ecoSectorSize) xmlParent.GetAttribute( "size" ).ToInt(); + } Index: SquareActivitySector.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/SquareActivitySector.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SquareActivitySector.h 15 Dec 2005 15:03:37 -0000 1.2 --- SquareActivitySector.h 16 Dec 2005 16:43:23 -0000 1.3 *************** *** 24,27 **** --- 24,30 ---- void ModifySize( int iDelta ); + void ToXml( XmlNode xmlParent ) const; + void FromXml( XmlNode xmlParent ); + private: |
|
From: Greg <evo...@us...> - 2005-12-16 16:43:35
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Kerberos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/Evolution/Kerberos Modified Files: Square.cpp Log Message: CHG : All list & vector are cleared before beiing loaded FIX : Misses in save/load of some classes Index: Square.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Kerberos/Square.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Square.cpp 21 Oct 2005 15:51:54 -0000 1.4 --- Square.cpp 16 Dec 2005 16:43:22 -0000 1.5 *************** *** 16,19 **** --- 16,21 ---- xmlObj.AddToXml( "Geo", & m_geoSquare ); + xmlObj.AddToXml( "Eco", & m_ecoSquare ); + m_visibility.ToXml( xmlObj ); } *************** *** 24,27 **** --- 26,31 ---- xmlObj.GetFromXml( "Geo", & m_geoSquare ); + xmlObj.GetFromXml( "Eco", & m_ecoSquare ); + m_visibility.FromXml( xmlObj ); } |
|
From: Greg <evo...@us...> - 2005-12-16 16:43:32
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/ELib/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/ELib/Xml Modified Files: XmlNode.h Log Message: CHG : All list & vector are cleared before beiing loaded FIX : Misses in save/load of some classes Index: XmlNode.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/ELib/Xml/XmlNode.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** XmlNode.h 18 Aug 2005 13:05:48 -0000 1.8 --- XmlNode.h 16 Dec 2005 16:43:22 -0000 1.9 *************** *** 50,103 **** template <class T> void GetListFromXml( EString esListName, std::vector<T> *pList ) { XmlNode xmlObj = GetChild( esListName ); - XmlNode xmlCursor = xmlObj.GetFirstChild(); ! while( xmlCursor.Valid() ) { ! T newT; ! newT.FromXml( xmlCursor ); ! pList->push_back( newT ); ! xmlCursor = xmlCursor.GetNextSibling(); } } template <class T> void GetListFromXml( EString esListName, std::list<T> *pList ) { ! XmlNode xmlObj = GetChild( esListName ); ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! while( xmlCursor.Valid() ) { ! T newT; ! newT.FromXml( xmlCursor ); ! pList->push_back( newT ); ! xmlCursor = xmlCursor.GetNextSibling(); } } template <class T> void GetIntVecFromXml( EString esVecName, std::vector<T> *pVec ) { ! XmlNode xmlObj = GetChild( esVecName ); ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! while( xmlCursor.Valid() ) { ! XmlNode xmlValue = xmlCursor.GetChild( "int" ); ! assert( xmlValue.Valid() ); ! pVec->push_back( (T)( xmlValue.GetValue().ToInt() ) ); ! ! xmlCursor = xmlCursor.GetNextSibling(); } } template <class T> void GetIntListFromXml( EString esListName, std::list<T> *pList ) { ! XmlNode xmlObj = GetChild( esListName ); ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! while( xmlCursor.Valid() ) { ! XmlNode xmlValue = xmlCursor.GetChild( "int" ); ! assert( xmlValue.Valid() ); ! pList->push_back( (T) xmlValue.GetValue().ToInt() ); ! ! xmlCursor = xmlCursor.GetNextSibling(); } } --- 50,124 ---- template <class T> void GetListFromXml( EString esListName, std::vector<T> *pList ) { + pList->clear(); + XmlNode xmlObj = GetChild( esListName ); ! if( xmlObj.Valid() ) { ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! ! while( xmlCursor.Valid() ) ! { ! T newT; ! newT.FromXml( xmlCursor ); ! pList->push_back( newT ); ! xmlCursor = xmlCursor.GetNextSibling(); ! } } } template <class T> void GetListFromXml( EString esListName, std::list<T> *pList ) { ! pList->clear(); ! XmlNode xmlObj = GetChild( esListName ); ! if( xmlObj.Valid() ) { ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! ! while( xmlCursor.Valid() ) ! { ! T newT; ! newT.FromXml( xmlCursor ); ! pList->push_back( newT ); ! xmlCursor = xmlCursor.GetNextSibling(); ! } } } template <class T> void GetIntVecFromXml( EString esVecName, std::vector<T> *pVec ) { ! pVec->clear(); ! XmlNode xmlObj = GetChild( esVecName ); ! if( xmlObj.Valid() ) { ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! ! while( xmlCursor.Valid() ) ! { ! XmlNode xmlValue = xmlCursor.GetChild( "int" ); ! assert( xmlValue.Valid() ); ! pVec->push_back( (T)( xmlValue.GetValue().ToInt() ) ); ! ! xmlCursor = xmlCursor.GetNextSibling(); ! } } } template <class T> void GetIntListFromXml( EString esListName, std::list<T> *pList ) { ! pList->clear(); ! XmlNode xmlObj = GetChild( esListName ); ! if( xmlObj.Valid() ) { ! XmlNode xmlCursor = xmlObj.GetFirstChild(); ! ! while( xmlCursor.Valid() ) ! { ! XmlNode xmlValue = xmlCursor.GetChild( "int" ); ! assert( xmlValue.Valid() ); ! pList->push_back( (T) xmlValue.GetValue().ToInt() ); ! ! xmlCursor = xmlCursor.GetNextSibling(); ! } } } *************** *** 121,131 **** // Add to Xml a vector of object with a ToXml method ! XmlNode xmlObj = AddChild( esListName ); ! std::vector<T>::iterator it; ! ! for( it = list.begin(); it != list.end(); ++ it ) { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! it->ToXml( xmlItem ); } } --- 142,155 ---- // Add to Xml a vector of object with a ToXml method ! if( ! list.empty() ) { ! XmlNode xmlObj = AddChild( esListName ); ! std::vector<T>::iterator it; ! ! for( it = list.begin(); it != list.end(); ++ it ) ! { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! it->ToXml( xmlItem ); ! } } } *************** *** 134,144 **** // Add to Xml a list of object with a ToXml method ! XmlNode xmlObj = AddChild( esListName ); ! std::list<T>::iterator it; ! ! for( it = list.begin(); it != list.end(); ++ it ) { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! it->ToXml( xmlItem ); } } --- 158,171 ---- // Add to Xml a list of object with a ToXml method ! if( ! list.empty() ) { ! XmlNode xmlObj = AddChild( esListName ); ! std::list<T>::iterator it; ! ! for( it = list.begin(); it != list.end(); ++ it ) ! { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! it->ToXml( xmlItem ); ! } } } *************** *** 147,158 **** // Add to Xml a map with a ToXml method ! XmlNode xmlObj = AddChild( esMapName, xmlNode ); ! std::map<K,T>::iterator it; ! ! for( it = map.begin(); it != map.end(); ++ it ) { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! AddAttribute( "key", it->first, xmlItem ); ! it->second.ToXml( xmlItem ); } } --- 174,188 ---- // Add to Xml a map with a ToXml method ! if( ! map.empty() ) { ! XmlNode xmlObj = AddChild( esMapName, xmlNode ); ! std::map<K,T>::iterator it; ! ! for( it = map.begin(); it != map.end(); ++ it ) ! { ! XmlNode xmlItem = xmlObj.AddChild( "item" ); ! AddAttribute( "key", it->first, xmlItem ); ! it->second.ToXml( xmlItem ); ! } } } *************** *** 160,169 **** { // Add to Xml a vector of standard element like EString, int,... ! XmlNode xmlObj = AddChild( esListName ); ! std::vector<T>::iterator it; ! ! for( it = vector.begin(); it != vector.end(); ++ it ) { ! xmlObj.AddToXml( "item", (int)*it ); } } --- 190,203 ---- { // Add to Xml a vector of standard element like EString, int,... ! ! if( ! vector.empty() ) { ! XmlNode xmlObj = AddChild( esListName ); ! std::vector<T>::iterator it; ! ! for( it = vector.begin(); it != vector.end(); ++ it ) ! { ! xmlObj.AddToXml( "item", (int)*it ); ! } } } *************** *** 171,180 **** { // Add to Xml a list of standard element like EString, int,... - XmlNode xmlObj = AddChild( esListName ); - std::list<T>::iterator it; ! for( it = list.begin(); it != list.end(); ++ it ) { ! xmlObj.AddToXml( "item", *it ); } } --- 205,218 ---- { // Add to Xml a list of standard element like EString, int,... ! if( ! list.empty() ) { ! XmlNode xmlObj = AddChild( esListName ); ! std::list<T>::iterator it; ! ! for( it = list.begin(); it != list.end(); ++ it ) ! { ! xmlObj.AddToXml( "item", *it ); ! } } } |
|
From: Greg <evo...@us...> - 2005-12-16 16:20:54
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4353/Evolution/Protogonos Modified Files: evalue.cpp timeline.h Log Message: FIX : Compilation issue in release (name collision) Index: evalue.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/evalue.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** evalue.cpp 17 Aug 2005 16:12:12 -0000 1.6 --- evalue.cpp 16 Dec 2005 16:20:12 -0000 1.7 *************** *** 30,34 **** { m_instantaneous_duration = tDuration; ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().GetCurrentTime() + tDuration, pFinalEvent ); } else --- 30,34 ---- { m_instantaneous_duration = tDuration; ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().CurrentTime() + tDuration, pFinalEvent ); } else *************** *** 60,64 **** if( new_instantaneous_duration != INVALID_DURATION ) { ! evoTime tNewEnd = (int)(( 1.0 - GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().GetCurrentTime(); m_instantaneous_duration = new_instantaneous_duration; --- 60,64 ---- if( new_instantaneous_duration != INVALID_DURATION ) { ! evoTime tNewEnd = (int)(( 1.0 - GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().CurrentTime(); m_instantaneous_duration = new_instantaneous_duration; *************** *** 96,100 **** { if( m_instantaneous_duration != INVALID_DURATION ) ! return (__int16)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().GetCurrentTime() ); else return INVALID_DURATION; --- 96,100 ---- { if( m_instantaneous_duration != INVALID_DURATION ) ! return (__int16)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().CurrentTime() ); else return INVALID_DURATION; *************** *** 105,109 **** { if( m_instantaneous_duration != INVALID_DURATION ) ! return 1 - ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().GetCurrentTime() ) ) / ( (float) m_instantaneous_duration ) ); else { --- 105,109 ---- { if( m_instantaneous_duration != INVALID_DURATION ) ! return 1 - ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().CurrentTime() ) ) / ( (float) m_instantaneous_duration ) ); else { *************** *** 160,164 **** m_instantaneous_duration = tDuration; pFinalEvent->m_bPositiveEvent = bIncrease; ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().GetCurrentTime() + tDuration, pFinalEvent ); } else --- 160,164 ---- m_instantaneous_duration = tDuration; pFinalEvent->m_bPositiveEvent = bIncrease; ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().CurrentTime() + tDuration, pFinalEvent ); } else *************** *** 168,172 **** // store the Event in TimeEvent... and cancel it ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().GetCurrentTime() + tDuration, pFinalEvent ); m_fStoppedProgression = 0.0f; --- 168,172 ---- // store the Event in TimeEvent... and cancel it ! m_pFinalEvent = Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().CurrentTime() + tDuration, pFinalEvent ); m_fStoppedProgression = 0.0f; *************** *** 198,207 **** if( bIncrease ) // goal: value = 1.0f { ! tNewEnd = (int)(( 1.0 - GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().GetCurrentTime(); m_fStoppedProgression = 1.0f; } else // goal: value = -1.0f { ! tNewEnd = (int)(( 1.0 + GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().GetCurrentTime(); m_fStoppedProgression = -1.0f; } --- 198,207 ---- if( bIncrease ) // goal: value = 1.0f { ! tNewEnd = (int)(( 1.0 - GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().CurrentTime(); m_fStoppedProgression = 1.0f; } else // goal: value = -1.0f { ! tNewEnd = (int)(( 1.0 + GetProgression() ) * (float)new_instantaneous_duration) + Kronos::Get().TimeLine().CurrentTime(); m_fStoppedProgression = -1.0f; } *************** *** 241,245 **** { if( m_instantaneous_duration != INVALID_DURATION ) ! return (__int16)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().GetCurrentTime() ); else return INVALID_DURATION; --- 241,245 ---- { if( m_instantaneous_duration != INVALID_DURATION ) ! return (__int16)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().CurrentTime() ); else return INVALID_DURATION; *************** *** 260,266 **** { if( m_fStoppedProgression == 1.0f ) ! return (float)( 1.0f - ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().GetCurrentTime() ) ) / ( (float) m_instantaneous_duration ) ) ); else ! return (float)( - 1.0f + ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().GetCurrentTime() ) ) / ( (float) m_instantaneous_duration ) ) ); } else --- 260,266 ---- { if( m_fStoppedProgression == 1.0f ) ! return (float)( 1.0f - ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().CurrentTime() ) ) / ( (float) m_instantaneous_duration ) ) ); else ! return (float)( - 1.0f + ( ( (float)( m_pFinalEvent->GetTime() - Kronos::Get().TimeLine().CurrentTime() ) ) / ( (float) m_instantaneous_duration ) ) ); } else *************** *** 310,314 **** { m_fLastValue = fInitialValue; ! m_tLastComputation = Kronos::Get().TimeLine().GetCurrentTime(); m_fEvolutionSpeed = fEvolutionSpeed; } --- 310,314 ---- { m_fLastValue = fInitialValue; ! m_tLastComputation = Kronos::Get().TimeLine().CurrentTime(); m_fEvolutionSpeed = fEvolutionSpeed; } *************** *** 323,327 **** { m_fLastValue = GetCurrentValue(); ! m_tLastComputation = Kronos::Get().TimeLine().GetCurrentTime(); m_fEvolutionSpeed = fEvolutionSpeed; } --- 323,327 ---- { m_fLastValue = GetCurrentValue(); ! m_tLastComputation = Kronos::Get().TimeLine().CurrentTime(); m_fEvolutionSpeed = fEvolutionSpeed; } *************** *** 329,333 **** float EValueRamp::GetCurrentValue() const { ! return (float)( Kronos::Get().TimeLine().GetCurrentTime() - m_tLastComputation ) * m_fEvolutionSpeed + m_fLastValue; } --- 329,333 ---- float EValueRamp::GetCurrentValue() const { ! return (float)( Kronos::Get().TimeLine().CurrentTime() - m_tLastComputation ) * m_fEvolutionSpeed + m_fLastValue; } *************** *** 335,339 **** { m_fLastValue = fNewValue; ! m_tLastComputation = Kronos::Get().TimeLine().GetCurrentTime(); } --- 335,339 ---- { m_fLastValue = fNewValue; ! m_tLastComputation = Kronos::Get().TimeLine().CurrentTime(); } Index: timeline.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/timeline.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** timeline.h 17 Aug 2005 16:12:12 -0000 1.2 --- timeline.h 16 Dec 2005 16:20:12 -0000 1.3 *************** *** 32,36 **** void SetTimeOrigin( evoTime time ); // Set time origin. Events previously added are deleted ! evoTime GetCurrentTime() const { return m_currentTime; } TimeEvent * AddEvent( evoTime time, Event *pEvent ); --- 32,36 ---- void SetTimeOrigin( evoTime time ); // Set time origin. Events previously added are deleted ! evoTime CurrentTime() const { return m_currentTime; } TimeEvent * AddEvent( evoTime time, Event *pEvent ); |
|
From: Greg <evo...@us...> - 2005-12-16 16:20:35
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4353/Evolution/Ulysses Modified Files: GameScreen.cpp Log Message: FIX : Compilation issue in release (name collision) Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/GameScreen.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** GameScreen.cpp 20 Oct 2005 16:43:28 -0000 1.89 --- GameScreen.cpp 16 Dec 2005 16:20:13 -0000 1.90 *************** *** 913,921 **** { Kernel *pKernel = Kernel::LockKernel(); ! evoTime tOld = pKernel->kronos.TimeLine().GetCurrentTime(); OnJumpNextEvent(); ! evoTime tNew = pKernel->kronos.TimeLine().GetCurrentTime(); pKernel->Unlock(); --- 913,921 ---- { Kernel *pKernel = Kernel::LockKernel(); ! evoTime tOld = pKernel->kronos.TimeLine().CurrentTime(); OnJumpNextEvent(); ! evoTime tNew = pKernel->kronos.TimeLine().CurrentTime(); pKernel->Unlock(); |
|
From: Greg <evo...@us...> - 2005-12-16 16:20:25
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4353/Evolution/Agamemnon Modified Files: ACalendar.cpp Log Message: FIX : Compilation issue in release (name collision) Index: ACalendar.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/ACalendar.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ACalendar.cpp 21 Jul 2005 14:39:33 -0000 1.3 --- ACalendar.cpp 16 Dec 2005 16:20:12 -0000 1.4 *************** *** 48,52 **** Kernel *pKernel = Kernel::LockKernel(); ! pResult->value = pKernel->kronos.TimeLine().GetCurrentTime(); pKernel->Unlock(); --- 48,52 ---- Kernel *pKernel = Kernel::LockKernel(); ! pResult->value = pKernel->kronos.TimeLine().CurrentTime() ; pKernel->Unlock(); |
|
From: Greg <evo...@us...> - 2005-12-16 16:20:25
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Kerberos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4353/Evolution/Kerberos Modified Files: World.cpp Log Message: FIX : Compilation issue in release (name collision) Index: World.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Kerberos/World.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** World.cpp 15 Dec 2005 15:03:37 -0000 1.13 --- World.cpp 16 Dec 2005 16:20:12 -0000 1.14 *************** *** 175,179 **** pEvnt->idCountry = 0; pEvnt->bNewGame = false; ! Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().GetCurrentTime(), pEvnt ); } --- 175,179 ---- pEvnt->idCountry = 0; pEvnt->bNewGame = false; ! Kronos::Get().TimeLine().AddEvent( Kronos::Get().TimeLine().CurrentTime(), pEvnt ); } |
|
From: Greg <evo...@us...> - 2005-12-16 15:46:56
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30246/Evolution/Ulysses Modified Files: ELandscape.h EWorldview.cpp EWorldview.h rules.xml Log Message: ADD : Squares with positive population are visible on the map Index: ELandscape.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/ELandscape.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ELandscape.h 13 Sep 2005 13:29:05 -0000 1.4 --- ELandscape.h 16 Dec 2005 15:46:47 -0000 1.5 *************** *** 122,125 **** --- 122,126 ---- // Spot position + GeoCode m_gcUpperLeftCorner; ScreenItems m_screenItems; Index: EWorldview.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EWorldview.cpp 21 Oct 2005 15:51:54 -0000 1.7 --- EWorldview.cpp 16 Dec 2005 15:46:47 -0000 1.8 *************** *** 105,109 **** --- 105,112 ---- PaintProvincesLimits( gl ); + PaintSquareItems( gl ); + PaintProvinceInfos( gl ); + } *************** *** 125,131 **** if( m_Landscape.GetZoom() >= m_fZoomMinForProvinceNames ) { - int x = infos.gcGeoCenter.LonLow(); - int y = infos.gcGeoCenter.LatLow(); - int xScreen; int yScreen; --- 128,131 ---- *************** *** 138,148 **** esProvName = "Terra incognita"; - gl.Convert3DCoordIn2D( m_Landscape.sqx(x,y), m_Landscape.sqy(x,y), m_Landscape.sqz(x,y), &xScreen, &yScreen ); - // Display the text with 0° rotation glRotatef( (float) m_Landscape.GetMapRadius(),1.0f,0.0f,0.0f); gl.TextOut( fonts::std14, col::white, xScreen, yScreen, esProvName, ALIGN_LEFT, esProvName ); glRotatef( (float)( - m_Landscape.GetMapRadius() ),1.0f,0.0f,0.0f); - } } --- 138,145 ---- *************** *** 473,478 **** --- 470,527 ---- glRotatef( (float)( m_Landscape.GetMapRadius() ),1.0f,0.0f,0.0f); + } + void EWorldview::PaintSquareItems( OpenGl &gl ) + { + // Display square infos + + EvoBitmaps& evoBmp = EvoBitmaps::GetInstance(); + + int iAltWidth = m_poCurrentSpot->GetAltMapWidth(); + int iAltHeight = m_poCurrentSpot->GetAltMapHeight(); + + int iSquareHeight = (int)( iAltHeight / m_Landscape.GetZoom() ); + int iSquareWidth = (int)( iAltWidth / m_Landscape.GetZoom() ); + + + // test : afficher un square sur le square 6x3 + + glRotatef( (float)( - m_Landscape.GetMapRadius() ),1.0f,0.0f,0.0f); + + + for( int y = 0; y < (iSquareHeight-1); y++ ) + { + for( int x = 0; x < (iSquareWidth-1); x++ ) + { + OSpotResult::SquareInfos sqInfos = m_poCurrentSpot->GetSquareInfo( x, y ); + 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); + } + } + + } + } + } + + glRotatef( (float)( m_Landscape.GetMapRadius() ),1.0f,0.0f,0.0f); + + } + + MainMapScreenItem * EWorldview::GetMainMapScreenItem( int x, int y ) { Index: EWorldview.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/EWorldview.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EWorldview.h 20 Oct 2005 16:43:28 -0000 1.5 --- EWorldview.h 16 Dec 2005 15:46:47 -0000 1.6 *************** *** 57,60 **** --- 57,61 ---- void PaintArmies( OpenGl &gl ); void PaintProvinceArmies( OpenGl &gl, countryId countryId, provinceId idProvince, int iScreenX, int iScreenY ); + void PaintSquareItems( OpenGl &gl ); private: Index: rules.xml =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/rules.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rules.xml 9 Nov 2005 17:12:09 -0000 1.8 --- rules.xml 16 Dec 2005 15:46:47 -0000 1.9 *************** *** 1 **** ! <xml> <Zeus> <climates> <climate> <id>0</id> <name>jungle</name> </climate> <climate> <id>1</id> <name>monsoon</name> </climate> <climate> <id>2</id> <name>savanna</name> </climate> <climate> <id>3</id> <name>desert</name> </climate> <climate> <id>4</id> <name>steppe</name> </climate> <climate> <id>5</id> <name>subtropical</name> </climate> <climate> <id>6</id> <name>mediterranean</name> </climate> <climate> <id>7</id> <name>temperate</name> </climate> <climate> <id>8</id> <name>marine temperate</name> </climate> <climate> <id>9</id> <name>midlatitude desert</name> </climate> <climate> <id>10</id> <name>midlatitude steppe</name> </climate> <climate> <id>11</id> <name>cold</name> </climate> <climate> <id>12</id> <name>tundra</name> </climate> <climate> <id>13</id> <name>icecap</name> </climate> </climates> <ecosectors> <ecosector> <sectorname>hunting</sectorname> <workername>hunter</workername> <buildingname>hunterhut</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="2" qt="10"/> </equation> <equationModificator> <slopeModificator>2</slopeModificator> <climateModificator> <modificator>80</modificator> <modificator>80</modificator> <modificator>75</modificator> <modificator>50</modificator> <modificator>50</modificator> <modificator>50</modificator> <modificator>60</modificator> <modificator>100</modificator> <modificator>100</modificator> <modificator>30</modificator> <modificator>60</modificator> <modificator>80</modificator> <modificator>40</modificator> <modificator>10</modificator> </climateModificator> </equationModificator> </production> <cost> <duration> <int>1</int> </duration> </cost> </ecosector> <ecosector> <sectorname>farming</sectorname> <workername>farmer</workername> <buildingname>farm</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="0" qt="15"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>logging</sectorname> <workername>logger</workername> <buildingname>woodcutterhut</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="1" qt="10"/> </equation> </production> <cost> <m ress="4" qt="50"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>forging</sectorname> <workername>smith</workername> <buildingname>forge</buildingname> <production> <workers> <int>10</int> </workers> <equation> <m ress="5" qt="-5"/> <m ress="3" qt="5"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>quarrying</sectorname> <workername>stone miner</workername> <buildingname>quarry</buildingname> <production> <workers> <int>20</int> </workers> <equation> <m ress="4" qt="100"/> </equation> </production> <cost> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>iron mining</sectorname> <workername>iron miner</workername> <buildingname>iron mine</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="5" qt="10"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>horse breeding</sectorname> <workername>horse breeder</workername> <buildingname>ranch</buildingname> <production> <workers> <int>10</int> </workers> <equation> <m ress="8" qt="10"/> <m ress="0" qt="-3"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>fishing</sectorname> <workername>fisherman</workername> <buildingname>fishery</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="7" qt="15"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>ship building</sectorname> <workername>ship builder</workername> <buildingname>shipyard</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="1" qt="-10"/> <m ress="6" qt="1"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> </ecosectors> <ressources> <ressource> <id>0</id> <name>wheat</name> <type>f</type> </ressource> <ressource> <id>1</id> <name>wood</name> </ressource> <ressource> <id>2</id> <name>meat</name> <type>f</type> </ressource> <ressource> <id>3</id> <name>sword</name> <type>s</type> </ressource> <ressource> <id>4</id> <name>stone</name> </ressource> <ressource> <id>5</id> <name>iron</name> </ressource> <ressource> <id>6</id> <name>sail</name> <type>s</type> </ressource> <ressource> <id>7</id> <name>fish</name> <type>f</type> </ressource> <ressource> <id>8</id> <name>horse</name> <type>s</type> </ressource> </ressources> <militaryUnits> <militaryUnit> <id>0</id> <name>settlers</name> <workers> <int>1</int> </workers> </militaryUnit> <militaryUnit> <id>1</id> <name>warrior</name> <workers> <int>1</int> </workers> <ressources> <m ress="3" qt="1"/> </ressources> </militaryUnit> <militaryUnit> <id>2</id> <name>horseman</name> <workers> <int>1</int> </workers> <ressources> <m ress="3" qt="1"/> <m ress="8" qt="1"/> </ressources> </militaryUnit> <militaryUnit> <id>3</id> <name>sail</name> <workers> <int>10</int> </workers> <ressources> <m ress="6" qt="1"/> </ressources> </militaryUnit> </militaryUnits> </Zeus> </xml> \ No newline at end of file --- 1 ---- ! <xml> <Zeus> <climates> <climate> <id>0</id> <name>jungle</name> </climate> <climate> <id>1</id> <name>monsoon</name> </climate> <climate> <id>2</id> <name>savanna</name> </climate> <climate> <id>3</id> <name>desert</name> </climate> <climate> <id>4</id> <name>steppe</name> </climate> <climate> <id>5</id> <name>subtropical</name> </climate> <climate> <id>6</id> <name>mediterranean</name> </climate> <climate> <id>7</id> <name>temperate</name> </climate> <climate> <id>8</id> <name>marine temperate</name> </climate> <climate> <id>9</id> <name>midlatitude desert</name> </climate> <climate> <id>10</id> <name>midlatitude steppe</name> </climate> <climate> <id>11</id> <name>cold</name> </climate> <climate> <id>12</id> <name>tundra</name> </climate> <climate> <id>13</id> <name>icecap</name> </climate> </climates> <ecosectors> <ecosector> <sectorname>hunting</sectorname> <workername>hunter</workername> <buildingname>hunterhut</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="2" qt="10"/> </equation> <equationModificator> <slopeModificator>5</slopeModificator> <climateModificator> <modificator>80</modificator> <modificator>80</modificator> <modificator>75</modificator> <modificator>50</modificator> <modificator>50</modificator> <modificator>50</modificator> <modificator>60</modificator> <modificator>100</modificator> <modificator>100</modificator> <modificator>30</modificator> <modificator>60</modificator> <modificator>80</modificator> <modificator>40</modificator> <modificator>10</modificator> </climateModificator> </equationModificator> </production> <cost> <duration> <int>1</int> </duration> </cost> </ecosector> <ecosector> <sectorname>farming</sectorname> <workername>farmer</workername> <buildingname>farm</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="0" qt="15"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>logging</sectorname> <workername>logger</workername> <buildingname>woodcutterhut</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="1" qt="10"/> </equation> </production> <cost> <m ress="4" qt="50"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>forging</sectorname> <workername>smith</workername> <buildingname>forge</buildingname> <production> <workers> <int>10</int> </workers> <equation> <m ress="5" qt="-5"/> <m ress="3" qt="5"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>quarrying</sectorname> <workername>stone miner</workername> <buildingname>quarry</buildingname> <production> <workers> <int>20</int> </workers> <equation> <m ress="4" qt="100"/> </equation> </production> <cost> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>iron mining</sectorname> <workername>iron miner</workername> <buildingname>iron mine</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="5" qt="10"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>horse breeding</sectorname> <workername>horse breeder</workername> <buildingname>ranch</buildingname> <production> <workers> <int>10</int> </workers> <equation> <m ress="8" qt="10"/> <m ress="0" qt="-3"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>fishing</sectorname> <workername>fisherman</workername> <buildingname>fishery</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="7" qt="15"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> <ecosector> <sectorname>ship building</sectorname> <workername>ship builder</workername> <buildingname>shipyard</buildingname> <production> <workers> <int>100</int> </workers> <equation> <m ress="1" qt="-10"/> <m ress="6" qt="1"/> </equation> </production> <cost> <m ress="4" qt="100"/> <duration> <int>100</int> </duration> </cost> </ecosector> </ecosectors> <ressources> <ressource> <id>0</id> <name>wheat</name> <type>f</type> </ressource> <ressource> <id>1</id> <name>wood</name> </ressource> <ressource> <id>2</id> <name>meat</name> <type>f</type> </ressource> <ressource> <id>3</id> <name>sword</name> <type>s</type> </ressource> <ressource> <id>4</id> <name>stone</name> </ressource> <ressource> <id>5</id> <name>iron</name> </ressource> <ressource> <id>6</id> <name>sail</name> <type>s</type> </ressource> <ressource> <id>7</id> <name>fish</name> <type>f</type> </ressource> <ressource> <id>8</id> <name>horse</name> <type>s</type> </ressource> </ressources> <militaryUnits> <militaryUnit> <id>0</id> <name>settlers</name> <workers> <int>1</int> </workers> </militaryUnit> <militaryUnit> <id>1</id> <name>warrior</name> <workers> <int>1</int> </workers> <ressources> <m ress="3" qt="1"/> </ressources> </militaryUnit> <militaryUnit> <id>2</id> <name>horseman</name> <workers> <int>1</int> </workers> <ressources> <m ress="3" qt="1"/> <m ress="8" qt="1"/> </ressources> </militaryUnit> <militaryUnit> <id>3</id> <name>sail</name> <workers> <int>10</int> </workers> <ressources> <m ress="6" qt="1"/> </ressources> </militaryUnit> </militaryUnits> </Zeus> </xml> \ No newline at end of file |
|
From: Greg <evo...@us...> - 2005-12-16 15:46:54
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/img/map_items In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30246/Evolution/Ulysses/img/map_items Added Files: city.png Log Message: ADD : Squares with positive population are visible on the map --- NEW FILE: city.png --- PNG |
|
From: Greg <evo...@us...> - 2005-12-16 15:45:44
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/img/map_items In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30073/map_items Log Message: Directory /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ulysses/img/map_items added to the repository |
|
From: Greg <evo...@us...> - 2005-12-15 17:12:01
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25532/Evolution/Protogonos Modified Files: IEcoSquare.h Log Message: ADD : Active population computed in square and returned by ASpot Index: IEcoSquare.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Protogonos/IEcoSquare.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IEcoSquare.h 15 Dec 2005 15:03:37 -0000 1.1 --- IEcoSquare.h 15 Dec 2005 17:11:52 -0000 1.2 *************** *** 16,20 **** virtual void OnBuildingSiteComplete( Event *pEvent ) = 0; ! }; --- 16,20 ---- virtual void OnBuildingSiteComplete( Event *pEvent ) = 0; ! virtual Population GetActivePopulation() = 0; }; |
|
From: Greg <evo...@us...> - 2005-12-15 17:12:01
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25532/Evolution/Agamemnon Modified Files: ASpot.cpp SpotOrders.h Log Message: ADD : Active population computed in square and returned by ASpot Index: ASpot.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/ASpot.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ASpot.cpp 23 Jul 2005 23:23:30 -0000 1.15 --- ASpot.cpp 15 Dec 2005 17:11:51 -0000 1.16 *************** *** 179,182 **** --- 179,183 ---- EvoRef<ISquare> square = pKernel->world.GetISquare( GeoCode( GEOCODE_LOW, lon, lat ) ); EvoRef<IGeoSquare> geosquare = square->GetIGeoSquare(); + EvoRef<IEcoSquare> ecosquare = square->GetIEcoSquare(); OSpotResult::SquareInfos infos; *************** *** 192,195 **** --- 193,197 ---- infos.temperature = geosquare->GetTemperature(); infos.climate = geosquare->GetClimate(); + infos.population = ecosquare->GetActivePopulation(); if( idProv != INVALID_ID ) Index: SpotOrders.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Agamemnon/SpotOrders.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpotOrders.h 20 Jun 2005 16:47:46 -0000 1.7 --- SpotOrders.h 15 Dec 2005 17:11:51 -0000 1.8 *************** *** 38,41 **** --- 38,43 ---- Temperature temperature; Climate climate; + + Population population; }; |
|
From: Greg <evo...@us...> - 2005-12-15 17:12:01
|
Update of /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25532/Evolution/Ploutos Modified Files: EcoSquare.cpp EcoSquare.h Log Message: ADD : Active population computed in square and returned by ASpot Index: EcoSquare.cpp =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EcoSquare.cpp 15 Dec 2005 15:03:37 -0000 1.2 --- EcoSquare.cpp 15 Dec 2005 17:11:51 -0000 1.3 *************** *** 49,50 **** --- 49,66 ---- it->ModifySize( pBuildEvent->size ); } + + Population EcoSquare::GetActivePopulation() + { + Population result = 0; + + std::list<SquareActivitySector>::iterator it; + FOREACH( it, m_lstSectors ) + { + const EcoSector& sector = Zeus::Get().GetEcoSector( it->GetSector() ); + result = (Population)( result + (int)sector.GetWorkersNeed() * (int)it->GetSize() ); + } + + // TODO : population working on building sites + + return result; + } Index: EcoSquare.h =================================================================== RCS file: /cvsroot/evolutionlejeu/evolutionlejeu/Evolution/Ploutos/EcoSquare.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EcoSquare.h 15 Dec 2005 15:03:37 -0000 1.2 --- EcoSquare.h 15 Dec 2005 17:11:51 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- void OnBuildingSiteComplete( Event *pEvent ); + Population GetActivePopulation(); private: |