1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

In config file, for adventure map, replaced tilesWidth, tilesHeight, trimX and trimY with width and height. Let VCMI do the right calculations.

This commit is contained in:
Frank Zago 2009-06-14 15:10:59 +00:00
parent 96a34c30f0
commit e5203db83c
4 changed files with 15 additions and 14 deletions

View File

@ -55,8 +55,11 @@ CMinimap::CMinimap(bool draw)
pos.h=ADVOPT.minimapW;//144
pos.w=ADVOPT.minimapH;//144
int rx = (((float)ADVOPT.tilesW)/(mapSizes.x))*((float)pos.w),
ry = (((float)ADVOPT.tilesH)/(mapSizes.y))*((float)pos.h);
const int tilesw=(ADVOPT.advmapW+31)/32;
const int tilesh=(ADVOPT.advmapH+31)/32;
int rx = (((float)tilesw)/(mapSizes.x))*((float)pos.w),
ry = (((float)tilesh)/(mapSizes.y))*((float)pos.h);
radar = newSurface(rx,ry);
temps = newSurface(pos.w,pos.h);
@ -374,12 +377,12 @@ void CMinimap::hideTile(const int3 &pos)
CTerrainRect::CTerrainRect()
:currentPath(NULL)
{
tilesw=ADVOPT.tilesW;
tilesh=ADVOPT.tilesH;
tilesw=(ADVOPT.advmapW+31)/32;
tilesh=(ADVOPT.advmapH+31)/32;
pos.x=ADVOPT.advmapX;
pos.y=ADVOPT.advmapY;
pos.w=tilesw*32 - ADVOPT.advmapTrimX;
pos.h=tilesh*32 - ADVOPT.advmapTrimY;
pos.w=ADVOPT.advmapW;
pos.h=ADVOPT.advmapH;
moveX = moveY = 0;
arrows = CDefHandler::giveDef("ADAG.DEF");
for(size_t y=0; y < arrows->ourImages.size(); ++y)

View File

@ -235,10 +235,8 @@ struct SettingsGrammar : public grammar<SettingsGrammar>
*(
( "x=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapX)]
| "y=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapY)]
| "trimX=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapTrimX)]
| "trimY=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapTrimY)]
| "tilesWidth=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::tilesW)]
| "tilesHeight=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::tilesH)]
| "width=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapW)]
| "height=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::advmapH)]
| "smoothMove=" >> uint_p[SetAdventureProp_a(&AdventureMapConfig::smoothMove)]
)
)

View File

@ -42,7 +42,7 @@ namespace config
//infobox
int infoboxX, infoboxY;
//advmap
int tilesW, tilesH, advmapX, advmapY, advmapTrimX, advmapTrimY;
int advmapX, advmapY, advmapW, advmapH;
bool smoothMove;
//general properties
std::string mainGraphic;

View File

@ -16,7 +16,7 @@ GUISettings
{
AdventureMap
{
AdvMap: x=7 y=6 tilesWidth=19 tilesHeight=18 trimX=15 trimY=29 smoothMove=1;
AdvMap: x=7 y=6 width=593 height=547 smoothMove=1;
InfoBox: x=605 y=389;
gem0: x=6 y=508 graphic=agemLL.def;
gem1: x=556 y=508 graphic=agemLR.def;
@ -44,7 +44,7 @@ GUISettings
{
AdventureMap
{
AdvMap: x=7 y=6 tilesWidth=26 tilesHeight=18 trimX=15 trimY=29 smoothMove=1;
AdvMap: x=7 y=6 width=817 height=547 smoothMove=1;
InfoBox: x=829 y=389;
gem0: x=6 y=508 graphic=agemLL.def;
gem1: x=780 y=508 graphic=agemLR.def;
@ -73,7 +73,7 @@ GUISettings
{
AdventureMap
{
AdvMap: x=7 y=6 tilesWidth=26 tilesHeight=23 trimX=15 trimY=20 smoothMove=1;
AdvMap: x=7 y=6 width=817 height=715 smoothMove=1;
InfoBox: x=829 y=557;
gem0: x=6 y=676 graphic=agemLL.def;
gem1: x=780 y=676 graphic=agemLR.def;