Optimize release builds: LTO, -O3, visibility, micro-perf fixes

- CMakeLists.txt: enable LTO for Release, add -O3 and -fvisibility=hidden
- scene: addMesh uses std::move, removeMesh takes const shared_ptr&
- entity: std::move entity into map instead of copy
- clouds: cosf/sinf instead of cos/sin (float math, avoids double promotion)
- game_screen: reserve trainer spell vector before push_back loop
- warden_module/emulator: replace std::endl (121 stream flushes) with '\n'
This commit is contained in:
Kelsi 2026-02-18 20:10:47 -08:00
parent 36f3c5c7c0
commit 98a64f44d0
8 changed files with 167 additions and 152 deletions

View file

@ -182,13 +182,13 @@ void Clouds::generateMesh() {
// Generate hemisphere mesh for clouds
for (int ring = 0; ring <= RINGS; ++ring) {
float phi = (ring / static_cast<float>(RINGS)) * (M_PI * 0.5f); // 0 to π/2
float y = RADIUS * cos(phi);
float ringRadius = RADIUS * sin(phi);
float y = RADIUS * cosf(phi);
float ringRadius = RADIUS * sinf(phi);
for (int segment = 0; segment <= SEGMENTS; ++segment) {
float theta = (segment / static_cast<float>(SEGMENTS)) * (2.0f * M_PI);
float x = ringRadius * cos(theta);
float z = ringRadius * sin(theta);
float x = ringRadius * cosf(theta);
float z = ringRadius * sinf(theta);
vertices.push_back(glm::vec3(x, y, z));
}

View file

@ -6,10 +6,10 @@ namespace wowee {
namespace rendering {
void Scene::addMesh(std::shared_ptr<Mesh> mesh) {
meshes.push_back(mesh);
meshes.push_back(std::move(mesh));
}
void Scene::removeMesh(std::shared_ptr<Mesh> mesh) {
void Scene::removeMesh(const std::shared_ptr<Mesh>& mesh) {
auto it = std::find(meshes.begin(), meshes.end(), mesh);
if (it != meshes.end()) {
meshes.erase(it);