Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#7,932 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
Mezza giornata
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Inizia in LabRenderer::useBackground, dove il $Environment Map della missione viene letto in envmap_name ma al suo posto viene caricato The_mission.envmap_name. Confronta con environment_map_gen in starfield.cpp, poi controlla il test ENVMAP > 1 che segue. Fatto quando una nave nel laboratorio assume i colori dell'environment map della missione di sfondo, corrispondenti alla missione. Per testare servono una missione cubemap e una build di debug OpenGL.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C++
Stelle
488
Fork
184
Merge medio
2g 2h
PR unite (30g)
35

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.