1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-18 16:32:32 +02:00

Set args as const if possible

This commit is contained in:
Filip Gawin 2018-02-18 01:26:16 +01:00
parent 2aa6d3b3b3
commit 5f5e9f7504
4 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,7 @@ bool GameWorld::placeItems(const std::string& name) {
if (ipll.load(path)) {
// Find the object.
for (auto inst : ipll.m_instances) {
for (const auto &inst : ipll.m_instances) {
if (!createInstance(inst->id, inst->pos, inst->rot)) {
logger->error("World", "No object data for instance " +
std::to_string(inst->id) + " in " +

View File

@ -71,7 +71,7 @@ class LoaderIFP {
return reinterpret_cast<T*>(data + b);
}
template <class T>
T* peek(char* data, size_t* ofs) {
T* peek(char* data, const size_t* ofs) {
return reinterpret_cast<T*>(data + *ofs);
}

View File

@ -57,8 +57,8 @@ WaterRenderer::WaterRenderer(GameRenderer* renderer) : waterProg(nullptr) {
WaterRenderer::~WaterRenderer() = default;
void WaterRenderer::setWaterTable(float* waterHeights, unsigned int nHeights,
uint8_t* tiles, unsigned int nTiles) {
void WaterRenderer::setWaterTable(const float* waterHeights, const unsigned int nHeights,
const uint8_t* tiles, const unsigned int nTiles) {
// Determine the dimensions of the input tiles
int edgeNum = sqrt(nTiles);
float tileSize = WATER_WORLD_SIZE / edgeNum;

View File

@ -30,8 +30,8 @@ public:
* This data is used to create the internal stencil mask for clipping
* the water rendering.
*/
void setWaterTable(float* waterHeights, unsigned int nHeights,
uint8_t* tiles, unsigned int nTiles);
void setWaterTable(const float* waterHeights, const unsigned int nHeights,
const uint8_t* tiles, const unsigned int nTiles);
void setDataTexture(GLuint fbBinding, GLuint dataTexture);