Results 1 to 8 of 8

Thread: Questions

  1. #1

    Questions

    I'm creating version 2 of bomberman and using DirectDraw for it.

    1) I want to add some music and sounds, but without using TMediaPlayer, how do I do this?

    2) How do I get an application icon in a API program (not the window icon, but the icon the executable itself has.

    3) Is there free software that makes a setup application, excluding winzip (or powerarchiver) selfextractor or the installshield for delphi?

  2. #2

    Questions

    1) You could attempt to use DirectSound, or another API.

    2) You need to edit the application's resource file, or create a new one, such that there is an ICON resource called MAINICON which contains the icon data you wish to be the application's icon. Hope that helps.

    3) Sure there are plenty, check out this site for a good listing of various free installers.
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  3. #3

    Questions

    2) You should only include {$R *.res} in your source code and you'll be able to choose Icon from the project options

    1) You can use playsound() API function to play external wave or wave which is build in your resource file. Problem is that you cannot build-in wave into the resource file; it is possible to do this with VC++

    3) Yes, there are many such installers. One is InnoSetup (I can't remember if it is free), you can also check out http://clickteam.com for theis installer. If you search the web (http://download.com is perfect) for Install maker you'll find many pretty freeware programs
    http://www.kaldata.net

  4. #4

    Questions

    Alright, thank you guys!

  5. #5

    Questions

    Quote Originally Posted by Darhazer
    1) You can use playsound() API function to play external wave or wave which is build in your resource file. Problem is that you cannot build-in wave into the resource file; it is possible to do this with VC++
    It is possible to do this IIRC, but you have to manually write the resource file script (a little pain). Create a text file with a .rc extension ("myfile.rc"). Enter the following sort-of-stuff into it:

    my_wave_name WAVE moo.wav
    my_other_wave WAVE somefile.wav
    yet_another WAVE thirdsound.wav

    ...and so on.

    Add this to your project: Project->Add To Project menu, and select the wanted .rc. Once you've done this, Delphi will compile the resource script into a .res and will link it to your exe automatically (no need for a $R if you do it this way). I'd suggest creating a .rc file for sounds only, and doing everything else in the Image Editor tool and a $R. Makes life easier!

    Also, when you're linking .res resources, remember that *.res means "a res file with the same filename as the current unit", not "any and every resource file". Just in case you use multiple .res files, that's all...

    You can then play the stuff with sndPlaySound/PlaySound -- e.g.,

    PlaySound('my_wave_name', HInstance, SND_ASYNC or SND_RESOURCE or SND_LOOP);

    Where the first parameter is the same as one of the names in the .rc file.

    You might also want to investigate FMod and/or BASS -- I'd assume they have loading-from-resouce functions, though of course, I haven't used them yet...
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  6. #6

    Questions

    Alimonster, it is possible to compile 24bit bitmaps into resource, not only 256 colored bitmaps?
    http://www.kaldata.net

  7. #7

    Questions

    Yep. For some reason, the bitmap editor can't handle > 256 colour pictures (which seems a strange limitation, but never mind).

    You can add bitmaps to the resource compiler script (.rc) in much the same way as sound files -- in this case, the relevant type is BITMAP. For example, adding a bitmap into the above "myfile.rc" example:

    my_wave_name WAVE moo.wav
    my_other_wave WAVE somefile.wav
    yet_another WAVE thirdsound.wav
    my_lovely_picture BITMAP somepic.bmp

    You can load it up in the VCL using the tbitmap's LoadFromResourceName method:

    [pascal]var
    Bmp: TBitmap;
    begin
    Bmp := TBitmap.Create;
    try
    Bmp.LoadFromResourceName(HInstance, 'my_lovely_picture');

    // use the bitmap now
    finally
    Bmp.Free;
    end;
    end;[/pascal]

    For non-VCL stuff, you can use the LoadImage or LoadBitmap functions, I think.

    You might also want to add the DISCARDABLE flag, which will let the things be unloaded from memory if there's little memory left, and reloaded later. Example:

    my_lovely_picture BITMAP DISCARDABLE somepic.bmp

    I don't know what effect that has, though, since it's been a long time since I ever ran low on memory!
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  8. #8

    Questions

    It is possible to do this IIRC, but you have to manually write the resource file script (a little pain). Create a text file with a .rc extension ("myfile.rc"). Enter the following sort-of-stuff into it:

    my_wave_name WAVE moo.wav
    my_other_wave WAVE somefile.wav
    yet_another WAVE thirdsound.wav

    ...and so on.

    As an alternative to writing rc files, i found a great resource editor, free and with Delphi source code. i have'nt really used it much except for changing icons around so i don't know if it will work with wave files or anything, but could be worth a try

    the URL is:
    http://www.wilsonc.demon.co.uk/d7resourceexplorer.htm
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •