Skip to content
Permalink
Browse files

ULTIMA8: More small const correctness changes

  • Loading branch information
mduggan committed Mar 23, 2020
1 parent 6bddbbc commit 9ca315157972ec955796f685beedda2dcb6ceefd
@@ -265,7 +265,7 @@ IDataSource *FileSystem::checkBuiltinData(const Std::string &vfn, bool is_text)
return nullptr;
}

bool FileSystem::rewrite_virtual_path(string &vfn) {
bool FileSystem::rewrite_virtual_path(string &vfn) const {
bool ret = false;
string::size_type pos = vfn.size();

@@ -106,7 +106,7 @@ class FileSystem {

// rewrite virtual path in-place (i.e., fvn is replaced)
// returns false if no rewriting was done
bool rewrite_virtual_path(Std::string &vfn);
bool rewrite_virtual_path(Std::string &vfn) const;

Std::map<Common::String, Std::string> _virtualPaths;

@@ -96,7 +96,7 @@ Shape::~Shape() {
delete[] const_cast<uint8 *>(_data);
}

void Shape::getShapeId(uint16 &id, uint32 &shape) {
void Shape::getShapeId(uint16 &id, uint32 &shape) const {
id = _flexId;
shape = _shapeNum;
}
@@ -62,7 +62,7 @@ class Shape {

const ShapeFrame *getFrame(unsigned int frame) const;

void getShapeId(uint16 &flexId, uint32 &shapenum);
void getShapeId(uint16 &flexId, uint32 &shapenum) const;

// This will detect the format of a shape
static const ConvertShapeFormat *DetectShapeFormat(const uint8 *data, uint32 size);
@@ -187,7 +187,7 @@ class CurrentMap {
// Not allowed to modify the list. Remember to use const_iterator
const Std::list<Item *> *getItemList(int32 gx, int32 gy) const;

bool isChunkFast(int32 cx, int32 cy) {
bool isChunkFast(int32 cx, int32 cy) const {
// CONSTANTS!
if (cx < 0 || cy < 0 || cx >= MAP_NUM_CHUNKS || cy >= MAP_NUM_CHUNKS)
return false;

0 comments on commit 9ca3151

Please sign in to comment.
You can’t perform that action at this time.