|
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 |