Releases movie resources (closes ZIP archive, frees frame texture, deallocates MovieData, clears if active).
Takes handle (movie handle from b2dLoadMovie, integer).
Returns nothing.
2D Overlay
Parameters & Returns
Parameters
handleInt
Returns
Void
Quick Summary
Releases movie resources (closes ZIP archive, frees frame texture, deallocates MovieData, clears if active).
Takes handle (movie handle from b2dLoadMovie, integer).
Returns nothing.
Technical Exegesis...
Releases movie resources (closes ZIP archive, frees frame texture, deallocates MovieData, clears if active). Takes handle (movie handle from b2dLoadMovie, integer). Returns nothing. Frees current frame texture (if currentFrameHandle!=0, calls b2dFreeImage), closes ZIP archive (mz_zip_reader_end, releases file handle), deallocates MovieData (deletes struct, frees CPU memory), clears if active (if g_activeMovieHandle==handle, resets to 0), removes from map (erases from g_movieMap).
Releases movie resources (closes ZIP archive, frees frame texture, deallocates MovieData, clears if active). Takes handle (movie handle from b2dLoadMovie, integer). Returns nothing. Frees current frame texture (if currentFrameHandle!=0, calls b2dFreeImage), closes ZIP archive (mz_zip_reader_end, releases file handle), deallocates MovieData (deletes struct, frees CPU memory), clears if active (if g_activeMovieHandle==handle, resets to 0), removes from map (erases from g_movieMap). Use to cleanup loaded movies (free when no longer needed), manage resources (prevent memory/file handle leaks), or dynamic loading (free old, load new movies at runtime). When to free: movie no longer used (cutscene complete, level unloaded, dynamic movie system), cleanup on exit (free all movies before program end), resource limits (free unused movies to stay within file handle/memory limits). Use cases: (1) Cleanup on exit (b2dFreeMovie(introMovie): b2dFreeMovie(outroMovie) release resources), (2) Dynamic system (b2dFreeMovie(oldMovie): newMovie=b2dLoadMovie("next.bbv") swap movies), (3) Level transition (For each movie in level: b2dFreeMovie(movie) unload level movies). Resources freed: frame texture (GPU texture + image handle, freed with b2dFreeImage), ZIP archive (file handle + decompression state, closed with mz_zip_reader_end), MovieData (CPU structure ~1KB, deallocated with delete), map entry (handle removed from g_movieMap). Performance: cost low (frame free + ZIP close + delete ~0.1-1ms, no GPU sync required), immediate (resources freed on CPU side, file handle released), safe (no validation of handle state, silently ignores if not found). Validation: silently ignores if handle<=0 (negative or zero handle, no-op), silently ignores if not found (handle not in map, safe double-free), no error if active (automatically clears g_activeMovieHandle if this movie was active), no error if playing (stops playback, frees resources). Related: b2dLoadMovie loads movie (creates resource freed by this function), b2dStopMovie stops playback (should stop before freeing, but not required), b2dPlayMovie starts playback (do not free while playing, will stop automatically).