Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

P4: Lab: a background mission's $Environment Map is never used

未关闭 适合新手
#7,932 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
半天
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp

调研方向

从 LabRenderer::useBackground 开始,这里会读取任务的 $Environment Map 到 envmap_name,但实际加载的是 The_mission.envmap_name。与 starfield.cpp 中的 environment_map_gen 比较,然后检查紧随其后的 ENVMAP > 1 测试。当实验室中的飞船呈现出背景任务的环境贴图颜色并与任务一致时,即完成。测试需要 cubemap 任务和 OpenGL 调试构建。

由索引模型根据 Issue 内容生成。

描述

This is minor: it only affects the F3 lab's preview, not missions.

Problem

When you pick a mission as the lab's background, the lab loads that mission's stars, suns and bitmaps but ignores its $Environment Map. Ships in the lab don't reflect the environment map the mission names, so the lab preview doesn't match what the ship looks like in that mission.

Steps to reproduce

  1. Current master (8afa31842), debug build, Linux, OpenGL, MediaVPs 5.0.2.
  2. Use a mission whose $Environment Map is a cubemap with obvious colors. I used a test mission with a 64x64 cubemap that has one bright color per face.
  3. Open the lab (F3), show a GTC Fenris, then pick that mission under Mission Background.
  4. Compare with the same Fenris in that mission.

Expected vs. actual behavior

Expected: the Fenris in the lab picks up the environment map's colors, like it does in the mission.

Actual: the background loads (the stars appear), but the hull stays plain grey. In the mission, the same map tints the whole hull.

From reading the code: LabRenderer::useBackground reads the mission's $Environment Map into a local envmap_name, but then loads The_mission.envmap_name instead, which in the lab is empty or left over from the last mission played. So the background's map is never loaded. I haven't tested the case where the leftover name points at a flat (non-cubemap) texture; by reading, it could hit the same OpenGL crash as #2245.

Proposed fixes

  1. Load envmap_name (the name just read) instead of The_mission.envmap_name, and change the ENVMAP > 1 check right after it to >= 0.
  2. Same as 1, plus the cubemap check from #7930, so a flat texture falls back to the generated map in the lab too.
  3. Share one helper between the lab and environment_map_gen in starfield.cpp, so both load and check the mission's environment map the same way.
主要语言
C++
星标
488
派生
184
平均合并
2 天 2 小时
30 天内合并 PR
35

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

scp-fs2open/fs2open.github.com 的其他 Issue

查看 scp-fs2open/fs2open.github.com 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。