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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user