Page 1 of 1

Pure Resource Catcher - code generator (beta)

Posted: Wed Sep 24, 2008 12:50 am
by eddy
This tool generates code to catch all your resources. (images, icons, sounds, modules, texts)
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 :wink:

generated code sections
  • plugin (if necessary)
  • define resource IDs
  • catch resources
  • free resources
  • include binary
:arrow: Download File : HERE

:arrow: How to install:
- unzip this file
- menu > tools > configure tools > add new tool ...
Image

:arrow: How to use :
- 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
Image

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

Posted: Wed Sep 24, 2008 12:56 am
by ts-soft
A bit more info before i install anything, please :wink:

Posted: Wed Sep 24, 2008 1:08 am
by eddy
I hope it's clear.
For the moment, there's only a menu shortcut.

TODO:
- I'll add an toolbar icon later.
- I'll improve the ID formater.

Posted: Wed Sep 24, 2008 12:22 pm
by yrreti
Sorry to bother you eddy, but the link gives 404 ?

Posted: Wed Sep 24, 2008 2:06 pm
by eddy
I have some problems with my file hosting services. :roll:
fixed... You can retry.

Posted: Thu Sep 25, 2008 2:02 am
by yrreti
Thank you eddy,
Just to let you know, that the link works now.