Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#7,932 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp

調査の方向性

LabRenderer::useBackground から始めてください。ここではミッションの $Environment Map が envmap_name に読み込まれますが、代わりに The_mission.envmap_name がロードされます。starfield.cpp の environment_map_gen と比較し、続く ENVMAP > 1 テストを確認してください。ラボ内の船が背景ミッションの environment map の色を帯び、ミッションと一致すれば完了です。テストには 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時間
マージ済み PR(30日)
35

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

scp-fs2open/fs2open.github.com のほかの issue

scp-fs2open/fs2open.github.com の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。