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:
parent
2aa6d3b3b3
commit
5f5e9f7504
@ -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 " +
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user