Skip to content

Commit f93444c

Browse files
committed
Mark certain methods const
1 parent a6701da commit f93444c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/supertux/sector.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Sector::finish_construction(bool editable)
172172
}
173173

174174
SpawnPointMarker*
175-
Sector::get_spawn_point(const std::string& spawnpoint)
175+
Sector::get_spawn_point(const std::string& spawnpoint) const
176176
{
177177
SpawnPointMarker* sp = nullptr;
178178
for (auto& spawn_point : get_objects_by_type<SpawnPointMarker>()) {
@@ -186,7 +186,7 @@ Sector::get_spawn_point(const std::string& spawnpoint)
186186
}
187187

188188
Vector
189-
Sector::get_spawn_point_position(const std::string& spawnpoint)
189+
Sector::get_spawn_point_position(const std::string& spawnpoint) const
190190
{
191191
SpawnPointMarker* sp = get_spawn_point(spawnpoint);
192192
if (sp)
@@ -317,11 +317,11 @@ Sector::deactivate()
317317
Rectf
318318
Sector::get_active_region() const
319319
{
320-
Camera& camera = get_camera();
320+
auto cam_translation = get_camera().get_translation();
321321
return Rectf(
322-
camera.get_translation() - Vector(1600, 1200),
323-
camera.get_translation() + Vector(1600, 1200) + Vector(static_cast<float>(SCREEN_WIDTH),
324-
static_cast<float>(SCREEN_HEIGHT)));
322+
cam_translation - Vector(1600, 1200),
323+
cam_translation + Vector(1600, 1200) + Vector(static_cast<float>(SCREEN_WIDTH),
324+
static_cast<float>(SCREEN_HEIGHT)));
325325
}
326326

327327
int

src/supertux/sector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class Sector final : public Base::Sector
233233

234234
std::vector<Player*> get_players() const;
235235

236-
Vector get_spawn_point_position(const std::string& spawnpoint);
236+
Vector get_spawn_point_position(const std::string& spawnpoint) const;
237237

238238
private:
239239
uint32_t collision_tile_attributes(const Rectf& dest, const Vector& mov) const;
@@ -247,7 +247,7 @@ class Sector final : public Base::Sector
247247
bonusblocks, add light to lava tiles) */
248248
void convert_tiles2gameobject();
249249

250-
SpawnPointMarker* get_spawn_point(const std::string& spawnpoint);
250+
SpawnPointMarker* get_spawn_point(const std::string& spawnpoint) const;
251251

252252
private:
253253
Level& m_level; // Parent level

0 commit comments

Comments
 (0)