Last change
on this file since 555 was
555,
checked in by Sam Hocevar, 11 years ago
|
ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Rev | Line | |
---|
[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
[494] | 4 | * Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
[56] | 5 | * |
---|
| 6 | * This software was released into the Public Domain. As with most public |
---|
[555] | 7 | * domain software, no warranty is made or implied by Crack dot Com, by |
---|
| 8 | * Jonathan Clark, or by Sam Hocevar. |
---|
[56] | 9 | */ |
---|
| 10 | |
---|
[534] | 11 | #ifndef __SOUND_H__ |
---|
| 12 | #define __SOUND_H__ |
---|
[2] | 13 | |
---|
[555] | 14 | #if !defined __CELLOS_LV2__ |
---|
| 15 | # include <SDL/SDL_mixer.h> |
---|
| 16 | #endif |
---|
[479] | 17 | |
---|
[2] | 18 | /* options are passed via command line */ |
---|
[124] | 19 | |
---|
[2] | 20 | #define SFX_INITIALIZED 1 |
---|
| 21 | #define MUSIC_INITIALIZED 2 |
---|
| 22 | |
---|
| 23 | int sound_init(int argc, char **argv); |
---|
| 24 | void sound_uninit(); |
---|
[534] | 25 | void print_sound_options(); // print the options avaible for sound |
---|
[2] | 26 | |
---|
| 27 | class sound_effect |
---|
| 28 | { |
---|
[534] | 29 | public: |
---|
[552] | 30 | sound_effect(char const *filename); |
---|
[534] | 31 | ~sound_effect(); |
---|
| 32 | |
---|
[552] | 33 | void play(int volume = 127, int pitch = 128, int panpot = 128); |
---|
| 34 | |
---|
[534] | 35 | private: |
---|
[555] | 36 | #if !defined __CELLOS_LV2__ |
---|
[552] | 37 | Mix_Chunk* m_chunk; |
---|
[555] | 38 | #endif |
---|
[534] | 39 | }; |
---|
[2] | 40 | |
---|
| 41 | class song |
---|
| 42 | { |
---|
[534] | 43 | public: |
---|
[555] | 44 | #if !defined __CELLOS_LV2__ |
---|
[534] | 45 | char const *name() { return Name; } |
---|
[555] | 46 | #endif |
---|
[534] | 47 | song(char const *filename); |
---|
| 48 | void play(unsigned char volume=127); |
---|
| 49 | void stop(long fadeout_time=0); // time in ms |
---|
| 50 | int playing(); |
---|
| 51 | void set_volume(int volume); |
---|
| 52 | ~song(); |
---|
| 53 | |
---|
| 54 | private: |
---|
[555] | 55 | #if !defined __CELLOS_LV2__ |
---|
[534] | 56 | char *Name; |
---|
| 57 | unsigned char *data; |
---|
| 58 | unsigned long song_id; |
---|
| 59 | Mix_Music* music; |
---|
| 60 | SDL_RWops* rw; |
---|
[555] | 61 | #endif |
---|
[534] | 62 | }; |
---|
| 63 | |
---|
[2] | 64 | #endif |
---|
| 65 | |
---|
Note: See
TracBrowser
for help on using the repository browser.