It will help you to include your media files.
I was tired to code this part each time that's why I coded this tool

generated code sections
- plugin (if necessary)
- define resource IDs
- catch resources
- free resources
- include binary


- unzip this file
- menu > tools > configure tools > add new tool ...


- click menu > tools > Pure Resource Catcher
- select your resource files
- it will generate code
- select and copy the code
- click OK to close the tool
- paste the code

sample code generated :
Code: Select all
;// Code For PureBasic 4.30
InitSound()
UseOGGImageDecoder()
UsePNGImageDecoder()
;// ID resources
Enumeration #PB_Compiler_EnumerationValue
#MEDIA_LEVEL_GAMEOVER_OGG
#MEDIA_INTRO_STORY_FONT_PNG
#MEDIA_INTRO_STORY_IMAGES_PNG
EndEnumeration
;// Catch resources
CatchSound(#MEDIA_LEVEL_GAMEOVER_OGG, ?MEDIA_LEVEL_GAMEOVER_OGG, ?MEDIA_LEVEL_GAMEOVER_OGG_END-?MEDIA_LEVEL_GAMEOVER_OGG)
CatchImage(#MEDIA_INTRO_STORY_FONT_PNG, ?MEDIA_INTRO_STORY_FONT_PNG, ?MEDIA_INTRO_STORY_FONT_PNG_END-?MEDIA_INTRO_STORY_FONT_PNG)
CatchImage(#MEDIA_INTRO_STORY_IMAGES_PNG, ?MEDIA_INTRO_STORY_IMAGES_PNG, ?MEDIA_INTRO_STORY_IMAGES_PNG_END-?MEDIA_INTRO_STORY_IMAGES_PNG)
;// Free resources
FreeSound(#MEDIA_LEVEL_GAMEOVER_OGG)
FreeImage(#MEDIA_INTRO_STORY_FONT_PNG)
FreeImage(#MEDIA_INTRO_STORY_IMAGES_PNG)
;// Include resources
DataSection
MEDIA_LEVEL_GAMEOVER_OGG:
IncludeBinary "media\level_gameover.ogg"
MEDIA_LEVEL_GAMEOVER_OGG_END:
MEDIA_INTRO_STORY_FONT_PNG:
IncludeBinary "media\intro_story_font.png"
MEDIA_INTRO_STORY_FONT_PNG_END:
MEDIA_INTRO_STORY_IMAGES_PNG:
IncludeBinary "media\intro_story_images.png"
MEDIA_INTRO_STORY_IMAGES_PNG_END:
EndDataSection