Changeset 253
- Timestamp:
- Jan 21, 2011, 1:05:06 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r221 r253 49 49 50 50 # Use SDL? 51 ac_cv_my_have_sdl=" no"51 ac_cv_my_have_sdl="yes" 52 52 save_CPPFLAGS="${CPPFLAGS}" 53 53 AC_PATH_PROG(SDL_CONFIG, sdl-config, no) … … 56 56 fi 57 57 AC_CHECK_HEADERS(SDL_image.h, 58 [ac_cv_my_have_sdl="yes"], 59 [ac_cv_my_have_sdl="no"]) 58 [:],[ac_cv_my_have_sdl="no"]) 59 AC_CHECK_HEADERS(SDL_mixer.h, 60 [:],[ac_cv_my_have_sdl="no"]) 60 61 CPPFLAGS="${save_CPPFLAGS}" 61 62 if test "${ac_cv_my_have_sdl}" != "no"; then … … 64 65 AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes") 65 66 66 if test "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no"; then67 AC_MSG_ERROR([[ cannot find SDL_Image or GTK+, please install one of them]])67 if test "${ac_cv_my_have_sdl}" = "no"; then 68 AC_MSG_ERROR([[One of SDL, SDL_Image or SDL_Mixer not found]]) 68 69 fi 69 70 … … 89 90 # How to use the Lol Engine inside this tree 90 91 LOL_CFLAGS="-I \$(top_srcdir)/src `pkg-config --cflags sdl gl SDL_image`" 91 LOL_LIBS="`pkg-config --libs sdl gl SDL_image` "92 LOL_LIBS="`pkg-config --libs sdl gl SDL_image` -lSDL_mixer" 92 93 93 94 if test "${enable_release}" = "yes"; then -
trunk/monsterz/board.cpp
r248 r253 33 33 Game *game; 34 34 int screen, board, tiles; 35 int click; 35 36 Piece *pieces[8][8]; 36 37 Piece *grabbed; … … 62 63 data->board = Tiler::Register(PNG_BOARD, 384, 384, 1.0f); 63 64 data->tiles = Tiler::Register(PNG_TILES, 48, 48, 1.0f); 65 data->click = Sampler::Register(WAV_CLICK); 64 66 65 67 for (int j = 0; j < 8; j++) … … 101 103 if (data->pieces[x / 48][y / 48]->Grab(Int2(0, 0))) 102 104 { 105 Sampler::PlaySample(data->click); 103 106 data->grabbed = data->pieces[x / 48][y / 48]; 104 107 data->src_cell = Int2(x / 48, y / 48); … … 189 192 Tiler::Deregister(data->screen); 190 193 Tiler::Deregister(data->tiles); 194 Sampler::Deregister(data->click); 191 195 delete data; 192 196 } -
trunk/monsterz/monsterz.cpp
r234 r253 33 33 { 34 34 /* Initialise SDL */ 35 if (SDL_Init(SDL_INIT_VIDEO ) < 0)35 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) 36 36 { 37 37 fprintf(stderr, "Cannot initialise SDL: %s\n", SDL_GetError()); … … 54 54 /* Initialise OpenGL */ 55 55 Video::Setup(video->w, video->h); 56 Audio::Setup(2); 56 57 57 58 /* Create a game */ -
trunk/monsterz/monsterz.h
r226 r253 13 13 static char const * const PNG_TILES = "monsterz/tiles.png"; 14 14 15 static char const * const WAV_CLICK = "monsterz/click.wav"; 16 -
trunk/src/Makefile.am
r251 r253 3 3 4 4 liblol_a_SOURCES = \ 5 core.h matrix.h tiler.cpp tiler.h dict.cpp dict.h \5 core.h matrix.h tiler.cpp tiler.h dict.cpp dict.h audio.cpp audio.h \ 6 6 scene.cpp scene.h font.cpp font.h layer.cpp layer.h map.cpp map.h \ 7 7 entity.cpp entity.h ticker.cpp ticker.h tileset.cpp tileset.h \ -
trunk/src/core.h
r251 r253 23 23 // Static classes 24 24 #include "video.h" 25 #include "audio.h" 25 26 #include "scene.h" 26 27 #include "input.h" -
trunk/src/sample.cpp
r251 r253 16 16 #include <cmath> 17 17 18 #include <SDL .h>18 #include <SDL_mixer.h> 19 19 20 20 #include "core.h" … … 30 30 private: 31 31 char *name; 32 Mix_Chunk *chunk; 32 33 }; 33 34 … … 40 41 data = new SampleData(); 41 42 data->name = strdup(path); 43 data->chunk = Mix_LoadWAV(path); 42 44 } 43 45 44 46 Sample::~Sample() 45 47 { 48 Mix_FreeChunk(data->chunk); 46 49 free(data->name); 47 50 delete data; … … 60 63 void Sample::Play() 61 64 { 65 Mix_PlayChannel(-1, data->chunk, 0); 62 66 } 63 67 -
trunk/src/sampler.cpp
r251 r253 54 54 void Sampler::PlaySample(int id) 55 55 { 56 Sample *sample = (Sample *)data->samples.GetEntity(id );56 Sample *sample = (Sample *)data->samples.GetEntity(id - 1); 57 57 sample->Play(); 58 58 } -
trunk/win32/deushax.vcxproj
r251 r253 14 14 <ClInclude Include="..\deushax\debugsprite.h" /> 15 15 <ClInclude Include="..\deushax\game.h" /> 16 <ClInclude Include="..\src\audio.h" /> 16 17 <ClInclude Include="..\src\bitfield.h" /> 17 18 <ClInclude Include="..\src\core.h" /> … … 44 45 <ClCompile Include="..\deushax\deushax.cpp" /> 45 46 <ClCompile Include="..\deushax\game.cpp" /> 47 <ClCompile Include="..\src\audio.cpp" /> 46 48 <ClCompile Include="..\src\debugfps.cpp" /> 47 49 <ClCompile Include="..\src\debugrecord.cpp" /> -
trunk/win32/monsterz.vcxproj
r251 r253 15 15 <ClInclude Include="..\monsterz\game.h" /> 16 16 <ClInclude Include="..\monsterz\piece.h" /> 17 <ClInclude Include="..\src\audio.h" /> 17 18 <ClInclude Include="..\src\bitfield.h" /> 18 19 <ClInclude Include="..\src\core.h" /> … … 46 47 <ClCompile Include="..\monsterz\monsterz.cpp" /> 47 48 <ClCompile Include="..\monsterz\piece.cpp" /> 49 <ClCompile Include="..\src\audio.cpp" /> 48 50 <ClCompile Include="..\src\debugfps.cpp" /> 49 51 <ClCompile Include="..\src\debugrecord.cpp" />
Note: See TracChangeset
for help on using the changeset viewer.