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

Lab: exporting the environment cubemap crashes when no object is displayed

Aperta Adatta ai principianti
#7,890 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
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
game-dev

Direzione di ricerca

Inizia da gr_opengl_dump_envmap, usando l’asserzione in bmpman.cpp come percorso di chiamata fallito, poi traccia dove ENVMAP viene creata e cancellata. Decidi quale dei comportamenti proposti è previsto per l’export prima che esista una environment map. Il completamento deve essere verificato sia senza un oggetto visualizzato sia dopo la selezione di una nave, momento in cui l’export continua a scrivere envmaps/<mission>.png.

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

Descrizione

Problem

In the Lab, exporting the environment cubemap crashes the game if you haven't picked an object to display yet. A mission background has to be chosen for the export button to show up, but the game only builds the environment map while it's drawing an object, so with nothing on screen there's no map to export.

Steps to reproduce

  1. Start FSO with OpenGL and open the Lab.
  2. Without choosing anything under Select object, open Select background > Mission Background and pick any mission.
  3. Press M, or click "Export environment cubemap".

Debug build (master at a1250d716, retail data): ASSERTION: "handle >= 0" at bmpman.cpp:120, Invalid handle -1 passed to bm_get_slot! from gr_opengl_dump_envmap. A Release build segfaults at the same step (seen on a build of my #7853 branch, which doesn't change this code).

If you pick a ship first and then do steps 2 and 3, the export works and writes envmaps/<mission>.png.

Expected vs. actual behavior

Expected: the export writes the environment map for the chosen background, or tells you there's nothing to export yet.

Actual: Debug builds stop on the assertion and Release builds crash.

Proposed fixes

Ranked by simplicity, then maintainability, then thoroughness.

  1. Return early from gr_opengl_dump_envmap when ENVMAP is below 0, with a log line or a warning. One check, and it also covers any other caller.
  2. Do that, and also hide or disable the Lab's export button and M key until an environment map exists, so the option only appears when it can work.
  3. Have the Lab build the environment map as soon as a background is chosen, even with no object shown, so the export always matches the selected background.

I haven't tried Vulkan; its export function is an empty stub there.

Lingua principale
C++
Stelle
488
Fork
184
Merge medio
2g 9h
PR unite (30g)
40

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.