ソースを参照

build: fix Win64 compilation with mingw64, using an updated SDL build.

legacy
Sam Hocevar sam 13年前
コミット
beb141dd5b
4個のファイルの変更16行の追加12行の削除
  1. +4
    -0
      configure.ac
  2. +2
    -2
      src/audio.cpp
  3. +5
    -5
      src/image/image.cpp
  4. +5
    -5
      src/sample.cpp

+ 4
- 0
configure.ac ファイルの表示

@@ -219,9 +219,13 @@ else
fi
if test "${ac_cv_my_have_sdl_mixer}" = "no"; then
AC_MSG_WARN([SDL_mixer not found])
else
AC_DEFINE(USE_SDL_MIXER, 1, Define to 1 to use SDL_mixer)
fi
if test "${ac_cv_my_have_sdl_image}" = "no"; then
AC_MSG_WARN([SDL_image not found])
else
AC_DEFINE(USE_SDL_IMAGE, 1, Define to 1 to use SDL_image)
fi
AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
AM_CONDITIONAL(USE_SDL_MIXER, test "${ac_cv_my_have_sdl_mixer}" = "yes")


+ 2
- 2
src/audio.cpp ファイルの表示

@@ -14,7 +14,7 @@

#include <cmath>

#if defined USE_SDL
#if defined USE_SDL_MIXER
# include <SDL.h>
# include <SDL_mixer.h>
#endif
@@ -30,7 +30,7 @@ namespace lol

void Audio::Setup(int channels)
{
#if defined USE_SDL
#if defined USE_SDL_MIXER
Mix_OpenAudio(22050, AUDIO_S16, channels, 1024);
#endif
}


+ 5
- 5
src/image/image.cpp ファイルの表示

@@ -16,7 +16,7 @@

#if defined __APPLE__ && defined __MACH__
# import <UIKit/UIKit.h>
#elif defined USE_SDL
#elif defined USE_SDL_IMAGE
# include <SDL.h>
# include <SDL_image.h>
#elif defined __ANDROID__
@@ -53,7 +53,7 @@ private:

#if defined __APPLE__ && defined __MACH__
uint8_t *pixels;
#elif defined USE_SDL
#elif defined USE_SDL_IMAGE
SDL_Surface *img;
#elif defined __ANDROID__
jobject bmp;
@@ -109,7 +109,7 @@ Image::Image(char const *path)
CGContextRelease(ctx);
[image release];
[pngdata release];
#elif defined USE_SDL
#elif defined USE_SDL_IMAGE
for (char const *name = path; *name; name++)
if ((data->img = IMG_Load(name)))
break;
@@ -334,7 +334,7 @@ void * Image::GetData() const
{
#if defined __APPLE__ && defined __MACH__
return data->pixels;
#elif defined USE_SDL
#elif defined USE_SDL_IMAGE
return data->img->pixels;
#elif defined __ANDROID__
return data->pixels;
@@ -349,7 +349,7 @@ Image::~Image()
{
#if defined __APPLE__ && defined __MACH__
free(data->pixels);
#elif defined USE_SDL
#elif defined USE_SDL_IMAGE
SDL_FreeSurface(data->img);
#elif defined __ANDROID__
JNIEnv *env;


+ 5
- 5
src/sample.cpp ファイルの表示

@@ -17,7 +17,7 @@
#include <cmath>
#include <cstring>

#if defined USE_SDL
#if defined USE_SDL_MIXER
# include <SDL.h>
# include <SDL_mixer.h>
#endif
@@ -39,7 +39,7 @@ class SampleData

private:
char *name, *path;
#if defined USE_SDL
#if defined USE_SDL_MIXER
Mix_Chunk *chunk;
#endif
};
@@ -55,7 +55,7 @@ Sample::Sample(char const *path)
data->path = data->name + 9;
sprintf(data->name, "<sample> %s", path);

#if defined USE_SDL
#if defined USE_SDL_MIXER
data->chunk = Mix_LoadWAV(path);
if (!data->chunk)
{
@@ -70,7 +70,7 @@ Sample::Sample(char const *path)

Sample::~Sample()
{
#if defined USE_SDL
#if defined USE_SDL_MIXER
Mix_FreeChunk(data->chunk);
#endif
free(data->name);
@@ -89,7 +89,7 @@ char const *Sample::GetName()

void Sample::Play()
{
#if defined USE_SDL
#if defined USE_SDL_MIXER
Mix_PlayChannel(-1, data->chunk, 0);
#endif
}


読み込み中…
キャンセル
保存