1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

* small improvements

* probably working getting visitable objects at certain position (to be tested)
This commit is contained in:
mateuszb
2007-10-26 17:55:33 +00:00
parent b07b1ec7dc
commit c18e4573f1
5 changed files with 57 additions and 2 deletions

View File

@ -4,6 +4,8 @@
#include "CGeneralTextHandler.h"
#include "CLodHandler.h"
#include "CAmbarCendamo.h"
#include "mapHandler.h"
#include "CDefObjInfoHandler.h"
void CObjectHandler::loadObjects()
{
@ -42,3 +44,22 @@ bool CObjectInstance::operator <(const CObjectInstance &cmp) const
return true;
return false;
}
int CObjectInstance::getWidth() const
{
return CGI->mh->reader->map.defy[defNumber].handler->ourImages[0].bitmap->w/32;
}
int CObjectInstance::getHeight() const
{
return CGI->mh->reader->map.defy[defNumber].handler->ourImages[0].bitmap->h/32;
}
bool CObjectInstance::visitableAt(int x, int y) const
{
if(x<0 || y<0 || x>=getWidth() || y>=getHeight())
return false;
if((CGI->dobjinfo->objs[defObjInfoNumber].visitMap[y] >> (7-x)) & 1)
return true;
return false;
}