Skip to content

Video (Smacker)#

Purpose#

Cutscene and event playback using Smacker (.smk) animation files. Ghidra labels the statically linked Smacker SDK as DirectPlayCreate4, DirectPlayEnumerate3, etc. — these are not DirectPlay networking calls. See pass 40 notes in symbol-map.md.

Key entry points#

Playback wrappers#

Symbol Address Role
lotr2_video_play_smk 0x435d1b Thin wrapper; sets screen mode on success
lotr2_video_play_smk_and_close 0x435d6e Play once then close Smacker context
lotr2_video_start_cutscene 0x436460 Dispatches intro / title sequences
lotr2_video_play_intro_variant 0x436725 Plays Intro.smk variant by index

Decode pipeline#

Symbol Address Role
lotr2_video_open_smk_file 0x435e18 Resolve path; Smacker open (DirectPlayCreate4); first frame
lotr2_video_decode_and_blit_frame 0x435fc7 Per-frame decode loop; blit to lotr2_gfx_backbuf_pixels
lotr2_video_copy_smacker_palette 0x43663c Copy 256 RGB triples from Smacker context
lotr2_video_apply_smacker_palette 0x436706 Apply palette to DirectDraw
lotr2_video_init_smacker_audio_once 0x4366c4 One-shot Smacker audio hook via DirectSound
lotr2_video_close_smk 0x4363e2 Close Smacker file handle
lotr2_video_close_and_restart_cutscene 0x436330 Close + chain to lotr2_video_start_cutscene

Present / windowing#

Symbol Address Role
lotr2_video_blit_frame_to_primary 0x4368b1 Full 640×480 present from back buffer
lotr2_video_smacker_wndproc_paint 0x43675e Windowed-mode paint + frame advance

DirectDraw surface setup used during Smacker init lives in gfx/MODULE.md: lotr2_gfx_create_surfaces_and_backbuf, lotr2_gfx_lock_primary_surfaces, lotr2_gfx_release_surfaces.

Decode flow#

flowchart LR
  playSmk[lotr2_video_play_smk] --> open[lotr2_video_open_smk_file]
  open --> decode[lotr2_video_decode_and_blit_frame]
  decode --> palette[lotr2_video_apply_smacker_palette]
  decode --> present[lotr2_video_blit_frame_to_primary]
  decode --> close[lotr2_video_close_smk]
  close --> cutscene[lotr2_video_start_cutscene]

Dependencies#

Data files#

File Usage
intro.smk Opening cutscene
imptitle.smk Import title sequence
Intro.smk In-game intro variant
cap_cty1.smk, bat_win1.smk, castle1.smk Event cinematics

Open questions#

  • Locate decode entry separate from lotr2_video_play_smklotr2_video_open_smk_file @ 0x435e18, lotr2_video_decode_and_blit_frame @ 0x435fc7 (pass 40)
  • Recover Smacker context struct layout at DAT_004efae8 (Ghidra names it like a COM object)
  • Map Ghidra DirectPlayCreateN / DirectPlayEnumerateN ordinals to Smacker API names