- mark all return values from the texture() getters as const.

This is necessary to evade C++ stupidity which happily allows assignment to non-const struct type return values and won't even warn about it.
As const these will throw an error when that happens.
This commit is contained in:
Christoph Oelckers 2022-12-06 11:22:41 +01:00
parent ffa265ae1d
commit 4ecb4aacb2
2 changed files with 6 additions and 6 deletions

View file

@ -294,8 +294,8 @@ struct walltype
bool hasX() const { return _xw != nullptr; } bool hasX() const { return _xw != nullptr; }
void allocX(); void allocX();
FTextureID walltexture() const; const FTextureID walltexture() const;
FTextureID overtexture() const; const FTextureID overtexture() const;
void setwalltexture(FTextureID tex); void setwalltexture(FTextureID tex);
void setovertexture(FTextureID tex); void setovertexture(FTextureID tex);
}; };
@ -501,7 +501,7 @@ struct spritetypebase
pos = { x * maptoworld, y * maptoworld, z * zmaptoworld }; pos = { x * maptoworld, y * maptoworld, z * zmaptoworld };
} }
FTextureID spritetexture() const; const FTextureID spritetexture() const;
}; };

View file

@ -693,11 +693,11 @@ PicAnm picanm;
// wrappers that allow partial migration to a textureID-based setup. // wrappers that allow partial migration to a textureID-based setup.
FTextureID walltype::walltexture() const const FTextureID walltype::walltexture() const
{ {
return tileGetTextureID(wallpicnum); return tileGetTextureID(wallpicnum);
} }
FTextureID walltype::overtexture() const const FTextureID walltype::overtexture() const
{ {
return tileGetTextureID(overpicnum); return tileGetTextureID(overpicnum);
} }
@ -712,7 +712,7 @@ const FTextureID sectortype::floortexture() const
return tileGetTextureID(floorpicnum); return tileGetTextureID(floorpicnum);
} }
FTextureID spritetypebase::spritetexture() const const FTextureID spritetypebase::spritetexture() const
{ {
return tileGetTextureID(picnum); return tileGetTextureID(picnum);
} }