diff --git a/include/ZE_Defines.h b/include/ZE_Defines.h index 0e49fa6..680c03b 100644 --- a/include/ZE_Defines.h +++ b/include/ZE_Defines.h @@ -17,8 +17,12 @@ #define ZE_SDL (2) #define GFX_BACKEND (ZE_OGL) +#define ZE_NONE (0) +#define ZE_MIXER (1) +#define ZE_AUDIERE (2) +#define SND_BACKEND (ZE_MIXER) + #define USE_SDL_TTF #define USE_SDL_IMAGE -#define USE_AUDIERE #endif //__ze_defines_h__ diff --git a/include/ZE_Includes.h b/include/ZE_Includes.h index 6844e8b..9641f3e 100644 --- a/include/ZE_Includes.h +++ b/include/ZE_Includes.h @@ -23,7 +23,10 @@ #ifdef USE_SDL_TTF #include "SDL_ttf.h" #endif -#ifdef USE_AUDIERE + +#if SND_BACKEND == ZE_MIXER +#include "SDL_mixer.h" +#elif SND_BACKEND == ZE_AUDIERE #include "audiere.h" #endif diff --git a/include/ZE_Utility.h b/include/ZE_Utility.h index 803287c..a710a6a 100755 --- a/include/ZE_Utility.h +++ b/include/ZE_Utility.h @@ -11,6 +11,7 @@ #ifndef __ze_utility_h__ #define __ze_utility_h__ +#include "ZE_Defines.h" #include "ZE_Includes.h" namespace ZE @@ -18,6 +19,7 @@ namespace ZE std::string FormatStr(std::string fmtStr, ...); +int LoadFromZip(std::string zipname, std::string filename, void *&buffer); SDL_RWops* RWFromZip(std::string zipname, std::string filename); #if (GFX_BACKEND == ZE_OGL) @@ -27,6 +29,11 @@ GLuint SurfaceToTexture(SDL_Surface *surface, GLfloat *texcoord); void FreeImage(SDL_Surface *&image); +#if SND_BACKEND == ZE_MIXER +void FreeSound(Mix_Chunk *&chunk); +void FreeMusic(Mix_Music *&music); +#endif + #ifdef USE_SDL_TTF void FreeFont(TTF_Font *&font); #endif diff --git a/include/ZE_ZSoundBase.h b/include/ZE_ZAudioBase.h similarity index 66% rename from include/ZE_ZSoundBase.h rename to include/ZE_ZAudioBase.h index 7ad11cd..ff96e18 100644 --- a/include/ZE_ZSoundBase.h +++ b/include/ZE_ZAudioBase.h @@ -8,33 +8,40 @@ and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -#ifndef __ze_zsoundbase_h__ -#define __ze_zsoundbase_h__ +#ifndef __ze_zaudiobase_h__ +#define __ze_zaudiobase_h__ #include "ZE_ZEngine.h" -#ifdef USE_AUDIERE +#if SND_BACKEND == ZE_AUDIERE namespace ZE { -class ZSoundBase +class ZAudioBase { protected: - //ZEngine* rEngine; + ZEngine* rEngine; audiere::AudioDevicePtr rDevice; audiere::OutputStreamPtr rStream; + int rPausePos; public: - ZSoundBase(); - virtual ~ZSoundBase(); + ZAudioBase(); + virtual ~ZAudioBase(); virtual void Open(std::string filename)=0; + virtual void OpenFromZip(std::string zipname, std::string filename)=0; + virtual void OpenFromZRF(std::string resourceId)=0; + //void Release(); void Play(bool loop=false); + void Pause(); + void Unpause(); + void Rewind(); void Stop(); - void SetVolume(float volume); + void SetVolume(int volume); void SetPan(float pan); void SetPitch(float pitch); void SetPosition(int position); @@ -42,8 +49,9 @@ class ZSoundBase bool IsLoaded() const; bool IsPlaying() const; + bool IsPaused() const; bool IsSeekable() const; - float GetVolume() const; + int GetVolume() const; float GetPan() const; float GetPitch() const; int GetPosition() const; @@ -52,6 +60,6 @@ class ZSoundBase } -#endif //USE_AUDIERE +#endif //ZE_AUDIERE -#endif //__ze_zsound_h__ +#endif //__ze_zaudiobase_h__ diff --git a/include/ZE_ZEngine.h b/include/ZE_ZEngine.h index 602b604..ff1330e 100644 --- a/include/ZE_ZEngine.h +++ b/include/ZE_ZEngine.h @@ -70,9 +70,14 @@ class ZEngine std::FILE *mErrlog; ZRandGen mRandGen; TiXmlDocument rZRF; -#ifdef USE_AUDIERE +#if SND_BACKEND == ZE_MIXER + int mMixerFrequency; + Uint16 mMixerFormat; + int mMixerChannels; + int mMixerChunksize; +#elif SND_BACKEND == ZE_AUDIERE audiere::AudioDevicePtr mAudiereDevice; -#endif //USE_AUDIERE +#endif ZEngine(); @@ -83,7 +88,11 @@ class ZEngine static void ReleaseInstance(); void InitErrorLog(ZErrorLogStyle logStyle=ZLOG_HTML, std::string logFile="errlog.html", ZErrorSeverity severityFilter=ZERR_VERBOSE); - bool InitSound(); +#if SND_BACKEND == ZE_MIXER + void InitAudio(int frequency=MIX_DEFAULT_FREQUENCY, bool stereo=true, Uint16 format=MIX_DEFAULT_FORMAT, int chunksize=4096); +#elif SND_BACKEND == ZE_AUDIERE + bool InitAudio(); +#endif bool CreateDisplay(int width, int height, int bpp, bool fullscreen, std::string title="ZEngine Application", std::string icon=""); void CloseDisplay(); void ToggleFullscreen(); @@ -144,9 +153,9 @@ class ZEngine int GetIntResource(std::string type, std::string id, std::string element); double GetDoubleResource(std::string type, std::string id, std::string element); -#ifdef USE_AUDIERE +#if SND_BACKEND == ZE_AUDIERE audiere::AudioDevicePtr GetSoundDevice(); -#endif //USE_AUDIERE +#endif SDL_Surface* GetDisplayPointer(); bool DisplayCreated(); int DisplayWidth(); diff --git a/include/ZE_ZSound.h b/include/ZE_ZSound.h new file mode 100644 index 0000000..ead08b0 --- /dev/null +++ b/include/ZE_ZSound.h @@ -0,0 +1,81 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for 2D game development. + Copyright (C) 2002-2004 James Turk + + Licensed under a BSD-style license. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.zengine.sourceforge.net +*******************************************************************************/ + +#ifndef __ze_zsound_h__ +#define __ze_zsound_h__ + +#include "ZE_ZEngine.h" +#include "ZE_ZAudioBase.h" + +namespace ZE +{ + +#if SND_BACKEND == ZE_MIXER + +class ZSound +{ + protected: + ZEngine* rEngine; + Mix_Chunk* rSound; + int rChannelID; + + public: + static const int LoopInfinite; + + ZSound(); + ZSound(std::string filename); + virtual ~ZSound(); + + void Open(std::string filename); + void OpenFromZip(std::string zipname, std::string filename); + void OpenFromZRF(std::string resourceId); + void Release(); + + void Play(int loopNum=0, int fadeTime=0); + void Pause() const; + void Unpause() const; + void Rewind() const; + void Stop(int fadeTime=0) const; + + void SetVolume(int volume); + void SetPan(float pan); + //void SetPitch(float pitch); + void SetPosition(int position); + //void SetPosition(float posPercent); + + bool IsLoaded() const; + bool IsPlaying() const; + bool IsPaused() const; + bool IsSeekable() const; + int GetVolume() const; + //float GetPan() const; + //float GetPitch() const; + //int GetPosition() const; + //int GetLength() const; +}; + +#elif SND_BACKEND == ZE_AUDIERE + +class ZSound : public ZAudioBase +{ + public: + ZSound(); + ZSound(std::string filename); + + void Open(std::string filename); + void OpenFromZip(std::string zipname, std::string filename); + void OpenFromZRF(std::string resourceId); +}; + +#endif //SND_BACKEND + +} + +#endif //__ze_zsound_h__ diff --git a/include/ZEngine.h b/include/ZEngine.h index e4c694b..6162fea 100644 --- a/include/ZEngine.h +++ b/include/ZEngine.h @@ -15,7 +15,7 @@ #ifdef USE_SDL_TTF #include "ZE_ZFont.h" #endif -#ifdef USE_AUDIERE +#if SND_BACKEND != ZE_NONE #include "ZE_ZSound.h" #include "ZE_ZMusic.h" #endif diff --git a/src/ZE_Utility.cpp b/src/ZE_Utility.cpp index 29390b8..b6e7a8b 100755 --- a/src/ZE_Utility.cpp +++ b/src/ZE_Utility.cpp @@ -26,23 +26,24 @@ std::string FormatStr(std::string fmtStr, ...) return buf; } -SDL_RWops* RWFromZip(std::string zipname, std::string filename) +int LoadFromZip(std::string zipname, std::string filename, void *&buffer) { unzFile zip = unzOpen(zipname.c_str()); unz_file_info info; - void *buffer; + + buffer = NULL; //start off buffer as NULL if(!zip) //failed to open zip { ZEngine::GetInstance()->ReportError(ZERR_WARNING,"Could not open zipfile %s",zipname.c_str()); - return NULL; + return 0; } //locate the file and open it (last param means case sensitive comparison) unzLocateFile(zip,filename.c_str(),0); if(unzOpenCurrentFile(zip) != UNZ_OK) //failed to open file within zip { - return NULL; //error should reported in calling function + return 0; //error should reported in calling function } //find current file info (we are looking for uncompressed file size) @@ -55,7 +56,7 @@ SDL_RWops* RWFromZip(std::string zipname, std::string filename) unzCloseCurrentFile(zip); unzClose(zip); ZEngine::GetInstance()->ReportError(ZERR_ERROR,"RWFromZip failed to allocate enough memory for buffer while loading %s from %s.",filename.c_str(),zipname.c_str()); - return NULL; + return 0; } //load into memory @@ -65,7 +66,17 @@ SDL_RWops* RWFromZip(std::string zipname, std::string filename) unzCloseCurrentFile(zip); unzClose(zip); - return SDL_RWFromMem(buffer, info.uncompressed_size); //return buffer in RW form + return info.uncompressed_size; //return the buffer size +} + +SDL_RWops* RWFromZip(std::string zipname, std::string filename) +{ + void *buffer; + int bufSize; + + bufSize = LoadFromZip(zipname,filename,buffer); + + return SDL_RWFromMem(buffer,bufSize); } #if (GFX_BACKEND == ZE_OGL) @@ -157,6 +168,28 @@ void FreeImage(SDL_Surface *&image) } } +#if SND_BACKEND == ZE_MIXER + +void FreeSound(Mix_Chunk *&chunk) +{ + if(chunk) + { + Mix_FreeChunk(chunk); + chunk = NULL; + } +} + +void FreeMusic(Mix_Music *&music) +{ + if(music) + { + Mix_FreeMusic(music); + music = NULL; + } +} + +#endif //ZE_MIXER + #ifdef USE_SDL_TTF void FreeFont(TTF_Font *&font) diff --git a/src/ZE_ZAudioBase.cpp b/src/ZE_ZAudioBase.cpp new file mode 100644 index 0000000..1398741 --- /dev/null +++ b/src/ZE_ZAudioBase.cpp @@ -0,0 +1,144 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for 2D game development. + Copyright (C) 2002-2004 James Turk + + Licensed under a BSD-style license. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.zengine.sourceforge.net +*******************************************************************************/ + +#include "ZE_ZAudioBase.h" + +#if SND_BACKEND == ZE_AUDIERE + +namespace ZE +{ + +ZAudioBase::ZAudioBase() : + rEngine(ZEngine::GetInstance()), + rDevice(rEngine->GetSoundDevice()), + rPausePos(0) +{ +} + +ZAudioBase::~ZAudioBase() +{ +} + +void ZAudioBase::Play(bool loop) +{ + rStream->play(); + rStream->setRepeat(loop); +} + +void ZAudioBase::Pause() +{ + rPausePos = rStream->getPosition(); + rStream->stop(); +} + +void ZAudioBase::Unpause() +{ + if(rPausePos) + { + rStream->setPosition(rPausePos); + rPausePos = 0; + } + rStream->play(); +} + +void ZAudioBase::Rewind() +{ + rStream->reset(); + rPausePos = 0; +} + +void ZAudioBase::Stop() +{ + rStream->stop(); + rStream->reset(); + rPausePos = 0; +} + +void ZAudioBase::SetVolume(int volume) +{ + if(volume < 0) + volume = 0; + else if(volume > 100) + volume = 100; + + rStream->setVolume(volume/100.0f); +} + +void ZAudioBase::SetPan(float pan) +{ + rStream->setPan(pan); +} + +void ZAudioBase::SetPitch(float pitch) +{ + rStream->setPitchShift(pitch); +} + +void ZAudioBase::SetPosition(int position) +{ + rPausePos = 0; + rStream->setPosition(position); +} + +void ZAudioBase::SetPosition(float posPercent) +{ + rPausePos = 0; + rStream->setPosition(static_cast(posPercent*rStream->getLength())); +} + +bool ZAudioBase::IsLoaded() const +{ + return (rStream != NULL); +} + +bool ZAudioBase::IsPlaying() const +{ + return rStream->isPlaying(); +} + +bool ZAudioBase::IsPaused() const +{ + return (rPausePos != 0); +} + +bool ZAudioBase::IsSeekable() const +{ + return rStream->isSeekable(); +} + +int ZAudioBase::GetVolume() const +{ + //cast here needs to be accurate, adds .5 to get proper rounding + return static_cast((rStream->getVolume()*100)+.5); +} + +float ZAudioBase::GetPan() const +{ + return rStream->getPan(); +} + +float ZAudioBase::GetPitch() const +{ + return rStream->getPitchShift(); +} + +int ZAudioBase::GetPosition() const +{ + return rStream->getPosition(); +} + +int ZAudioBase::GetLength() const +{ + return rStream->getLength(); +} + +} + +#endif //ZE_AUDIERE diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index 85ed5ad..dd9147b 100644 --- a/src/ZE_ZEngine.cpp +++ b/src/ZE_ZEngine.cpp @@ -26,6 +26,9 @@ ZEngine::ZEngine() : mMouseX(0), mMouseY(0), mMouseB(0), mEventFilter(NULL), mLogStyle(ZLOG_NONE), mMinSeverity(ZERR_NOTE), mErrlog(NULL) +#if SND_BACKEND == ZE_MIXER + ,mMixerFrequency(0),mMixerFormat(0),mMixerChannels(0),mMixerChunksize(0) +#endif { for(int k = 0; k < SDLK_LAST; ++k) mKeyPress[k] = false; @@ -49,9 +52,8 @@ TiXmlElement* ZEngine::FindElement(std::string type, std::string id) elem = elem->NextSiblingElement(); } - //if it gets here, element not found - ReportError(ZERR_WARNING,"No '%s' resource found with id '%s'",type.c_str(),id.c_str()); - elem = NULL; + if(!elem) + ReportError(ZERR_WARNING,"No '%s' resource found with id '%s'",type.c_str(),id.c_str()); } else { @@ -116,7 +118,16 @@ void ZEngine::InitErrorLog(ZErrorLogStyle logStyle, std::string logFile, ZErrorS } } -bool ZEngine::InitSound() +#if SND_BACKEND == ZE_MIXER +void ZEngine::InitAudio(int frequency, bool stereo, Uint16 format, int chunksize) +{ + mMixerFrequency = frequency; + mMixerChannels = stereo ? 2 : 1; + mMixerFormat = format; + mMixerChunksize = chunksize; +} +#elif SND_BACKEND == ZE_AUDIERE +bool ZEngine::InitAudio() { mAudiereDevice = audiere::OpenDevice(); if(!mAudiereDevice) @@ -125,9 +136,11 @@ bool ZEngine::InitSound() } return (mAudiereDevice != NULL); } +#endif //SND_BACKEND bool ZEngine::CreateDisplay(int width, int height, int bpp, bool fullscreen, std::string title, std::string icon) { + Uint32 sdlFlags=SDL_INIT_VIDEO|SDL_INIT_TIMER; Uint32 vidFlags=0; SDL_Surface *iconImg; bool status=true; //status of setup, only true if everything went flawlessly @@ -138,15 +151,31 @@ bool ZEngine::CreateDisplay(int width, int height, int bpp, bool fullscreen, std mFullscreen = fullscreen; +#if SND_BACKEND == ZE_MIXER + if(mMixerFrequency && mMixerFormat && mMixerChannels && mMixerChunksize) + sdlFlags |= SDL_INIT_AUDIO; +#endif + if(!mInitialized) { - if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0) + if(SDL_Init(sdlFlags) < 0) { ReportError(ZERR_CRITICAL,"Error initializing SDL: %s",SDL_GetError()); return false; //return now, nothing else should be called } } +#if SND_BACKEND == ZE_MIXER + if(!mInitialized && mMixerFrequency && mMixerFormat && mMixerChannels && mMixerChunksize) + { + if(Mix_OpenAudio(mMixerFrequency,mMixerFormat,mMixerChannels,mMixerChunksize) < 0) + { + ReportError(ZERR_ERROR,"Error initializing SDL_mixer: %s",SDL_GetError()); + status = false; + } + } +#endif //USE_SDL_MIXER + //set vidFlags and bpp// if(mFullscreen) vidFlags |= SDL_FULLSCREEN; @@ -698,10 +727,12 @@ double ZEngine::GetDoubleResource(std::string type, std::string id, std::string return ret; } +#if SND_BACKEND == ZE_AUDIERE audiere::AudioDevicePtr ZEngine::GetSoundDevice() { return mAudiereDevice; } +#endif SDL_Surface *ZEngine::GetDisplayPointer() { diff --git a/src/ZE_ZMusic.cpp b/src/ZE_ZMusic.cpp index 6ce6121..ceb3a55 100644 --- a/src/ZE_ZMusic.cpp +++ b/src/ZE_ZMusic.cpp @@ -10,16 +10,182 @@ #include "ZE_ZMusic.h" -#ifdef USE_AUDIERE - namespace ZE { -ZMusic::ZMusic() +#if SND_BACKEND == ZE_MIXER + +const int ZMusic::LoopInfinite = -1; //constant for infinite, as used by SDL_Mixer + +ZMusic::ZMusic() : + rEngine(ZEngine::GetInstance()), + rMusic(NULL) { } -ZMusic::ZMusic(std::string filename) : ZSoundBase() +ZMusic::ZMusic(std::string filename) : + rEngine(ZEngine::GetInstance()), + rMusic(NULL) +{ + Open(filename); +} + +ZMusic::~ZMusic() +{ + Release(); +} + +void ZMusic::Open(std::string filename) +{ + Release(); + + rMusic = Mix_LoadMUS(filename.c_str()); + + if(!rMusic) + rEngine->ReportError(ZERR_WARNING,"Could not load %s",filename.c_str()); +} + +void ZMusic::OpenFromZRF(std::string resourceId) +{ + std::string filename = rEngine->GetStringResource("music",resourceId,"filename"); + if(filename.length()) + Open(filename); + else + rEngine->ReportError(ZERR_WARNING,"Failed to load music resource '%s'",resourceId.c_str()); +} + +void ZMusic::Release() +{ + Mix_HaltMusic(); + FreeMusic(rMusic); +} + +void ZMusic::Play(int loopNum, int fadeTime) const +{ + if(Mix_PlayingMusic()) //stop currently playing music + Mix_HaltMusic(); + + if(rMusic) + { + if(fadeTime) + Mix_FadeInMusic(rMusic, loopNum, fadeTime); + else + Mix_PlayMusic(rMusic, loopNum); + } + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::Play with no music loaded."); +} + +void ZMusic::Pause() const +{ + if(rMusic) + Mix_PauseMusic(); + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::Pause with no music loaded."); +} + +void ZMusic::Unpause() const +{ + if(rMusic) + Mix_ResumeMusic(); + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::Unpause with no music loaded."); +} + +void ZMusic::Rewind() const +{ + if(rMusic) + Mix_RewindMusic(); + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::Rewind with no music loaded."); +} + +void ZMusic::Stop(int fadeTime) const +{ + if(rMusic) + { + if(fadeTime) + Mix_FadeOutMusic(fadeTime); + else + Mix_HaltMusic(); + } + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::Stop with no music loaded."); +} + +void ZMusic::SetVolume(int volume) +{ + if(rMusic) + Mix_VolumeMusic(volume); + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::SetVolume with no music loaded."); +} + +void ZMusic::SetPosition(int position) +{ + if(rMusic) + { + if(!IsSeekable() || Mix_SetMusicPosition(static_cast(position)) == -1) + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::SetPosition on non-seekable file."); + } + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::SetPosition with no music loaded."); +} + +bool ZMusic::IsLoaded() const +{ + return rMusic != NULL; +} + +bool ZMusic::IsPlaying() const +{ + if(rMusic) + return Mix_PlayingMusic() > 0; + else + { + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::IsPlaying with no music loaded."); + return false; + } +} + +bool ZMusic::IsPaused() const +{ + if(rMusic) + return Mix_PausedMusic() > 0; + else + { + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::IsPaused with no music loaded."); + return false; + } +} + +bool ZMusic::IsSeekable() const +{ + Mix_MusicType type = Mix_GetMusicType(rMusic); + if(type == MUS_MOD || type == MUS_OGG || type == MUS_MP3) + return true; + else + return false; +} + +int ZMusic::GetVolume() const +{ + if(rMusic) + return Mix_VolumeMusic(-1); + else + { + rEngine->ReportError(ZERR_VERBOSE,"Called ZMusic::GetVolume with no music loaded."); + return false; + } +} + +#elif SND_BACKEND == ZE_AUDIERE + +ZMusic::ZMusic() : ZAudioBase() +{ +} + +ZMusic::ZMusic(std::string filename) : ZAudioBase() { Open(filename); } @@ -29,6 +195,24 @@ void ZMusic::Open(std::string filename) rStream = audiere::OpenSound(rDevice, filename.c_str(), true); } +void ZMusic::OpenFromZip(std::string zipname, std::string filename) +{ + void *buffer; + int bufSize; + + bufSize = LoadFromZip(zipname, filename, buffer); + rStream = audiere::OpenSound(rDevice, audiere::hidden::AdrCreateMemoryFile(buffer,bufSize), true); } -#endif +void ZMusic::OpenFromZRF(std::string resourceId) +{ + std::string filename = rEngine->GetStringResource("music",resourceId,"filename"); + if(filename.length()) + Open(filename); + else + rEngine->ReportError(ZERR_WARNING,"Failed to load music resource '%s'",resourceId.c_str()); +} + +#endif //SND_BACKEND + +} diff --git a/src/ZE_ZSound.cpp b/src/ZE_ZSound.cpp index 638f30e..bbd931a 100644 --- a/src/ZE_ZSound.cpp +++ b/src/ZE_ZSound.cpp @@ -8,19 +8,202 @@ and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -#include "ZE_ZSound.h" -#include "ZE_ZSoundBase.h" +//ZSound is almost exactly like ZMusic, when making changes check if that change should +//be applied to ZMusic as well, roughly 95% of the time it should be. -#ifdef USE_AUDIERE +#include "ZE_ZSound.h" namespace ZE { -ZSound::ZSound() +#if SND_BACKEND == ZE_MIXER + +const int ZSound::LoopInfinite = -1; + +ZSound::ZSound() : + rEngine(ZEngine::GetInstance()), + rSound(NULL), + rChannelID(-1) //request channel ID { } -ZSound::ZSound(std::string filename) : ZSoundBase() +ZSound::ZSound(std::string filename) : + rEngine(ZEngine::GetInstance()), + rSound(NULL), + rChannelID(-1) //request channel ID +{ + Open(filename); +} + +ZSound::~ZSound() +{ + Release(); +} + +void ZSound::Open(std::string filename) +{ + Release(); + rSound = Mix_LoadWAV(filename.c_str()); + + if(!rSound) + rEngine->ReportError(ZERR_ERROR,"Could not load %s",filename.c_str()); +} + +void ZSound::OpenFromZip(std::string zipname, std::string filename) +{ + SDL_RWops *rw = RWFromZip(zipname,filename); + if(rw) + { + rSound = Mix_LoadWAV_RW(rw,0); + delete []rw->hidden.mem.base; //must free buffer + SDL_FreeRW(rw); + } + + if(!rSound) + rEngine->ReportError(ZERR_WARNING,"Could not load %s from %s",filename.c_str(),zipname.c_str()); +} + +void ZSound::OpenFromZRF(std::string resourceId) +{ + std::string filename = rEngine->GetStringResource("sound",resourceId,"filename"); + if(filename.length()) + Open(filename); + else + rEngine->ReportError(ZERR_WARNING,"Failed to load sound resource '%s'",resourceId.c_str()); +} + +void ZSound::Release() +{ + if(rChannelID >= 0) + Mix_HaltChannel(rChannelID); + FreeSound(rSound); +} + +void ZSound::Play(int loopNum, int fadeTime) +{ + if(rChannelID >= 0 && Mix_Playing(rChannelID)) //stop currently playing sound + Mix_HaltChannel(rChannelID); + + if(rSound) + { + if(fadeTime) + rChannelID = Mix_FadeInChannel(rChannelID, rSound, loopNum, fadeTime); + else + rChannelID = Mix_PlayChannel(rChannelID, rSound, loopNum); + } + else if(!rSound) + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::Play with no sound effect loaded."); +} + +void ZSound::Pause() const +{ + if(rSound && rChannelID >= 0) + Mix_Pause(rChannelID); + else if(!rSound) + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::Pause with no sound effect loaded."); +} + +void ZSound::Unpause() const +{ + if(rSound && rChannelID >= 0) + Mix_Resume(rChannelID); + else if(!rSound) + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::Unpause with no sound effect loaded."); + +} + +void ZSound::Stop(int fadeTime) const +{ + if(rSound && rChannelID >= 0) + { + if(fadeTime) + Mix_FadeOutChannel(rChannelID,fadeTime); + else + Mix_HaltChannel(rChannelID); + } + else if(!rSound) + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::Stop with no sound effect loaded."); +} + +void ZSound::SetVolume(int volume) +{ + if(rSound) + Mix_VolumeChunk(rSound,volume); + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::SetVolume with no sound effect loaded."); +} + +void ZSound::SetPan(float pan) +{ + if(rSound) + { + if(pan == 0) + Mix_SetPanning(rChannelID,255,255); + else if(pan < 0) + Mix_SetPanning(rChannelID, static_cast(128+(128*-pan)), 128); + else + Mix_SetPanning(rChannelID, 128, static_cast(128+(128*pan))); + } + else + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::SetPan with no sound effect loaded."); +} + +void ZSound::SetPosition(int position) +{ + //no-op, non-seekable currently +} + +bool ZSound::IsLoaded() const +{ + return rSound != NULL; +} + +bool ZSound::IsPlaying() const +{ + if(rSound && rChannelID >= 0) + return Mix_Playing(rChannelID) > 0; + else + { + if(rChannelID >= 0) + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::IsPlaying with no sound effect loaded."); + return false; + } +} + +bool ZSound::IsPaused() const +{ + if(rSound && rChannelID >= 0) + return Mix_Paused(rChannelID) > 0; + else + { + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::IsPaused with no sound effect loaded."); + return false; + } +} + +bool ZSound::IsSeekable() const +{ + return false; //no Mix_Chunks are seekable atm. +} + +int ZSound::GetVolume() const +{ + if(rSound) + return Mix_VolumeChunk(rSound,-1); + else + { + rEngine->ReportError(ZERR_VERBOSE,"Called ZSound::GetVolume with no sound effect loaded."); + return -1; + } +} + +#elif SND_BACKEND == ZE_AUDIERE + +ZSound::ZSound() : ZAudioBase() +{ +} + +ZSound::ZSound(std::string filename) : ZAudioBase() { Open(filename); } @@ -30,6 +213,24 @@ void ZSound::Open(std::string filename) rStream = audiere::OpenSound(rDevice, filename.c_str(), false); } +void ZSound::OpenFromZip(std::string zipname, std::string filename) +{ + void *buffer; + int bufSize; + + bufSize = LoadFromZip(zipname, filename, buffer); + rStream = audiere::OpenSound(rDevice, audiere::hidden::AdrCreateMemoryFile(buffer,bufSize), false); } -#endif +void ZSound::OpenFromZRF(std::string resourceId) +{ + std::string filename = rEngine->GetStringResource("music",resourceId,"filename"); + if(filename.length()) + Open(filename); + else + rEngine->ReportError(ZERR_WARNING,"Failed to load music resource '%s'",resourceId.c_str()); +} + +#endif //SND_BACKEND + +} diff --git a/src/ZE_ZSoundBase.cpp b/src/ZE_ZSoundBase.cpp deleted file mode 100644 index dbed83c..0000000 --- a/src/ZE_ZSoundBase.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - This file is Part of the ZEngine Library for 2D game development. - Copyright (C) 2002-2004 James Turk - - Licensed under a BSD-style license. - - The maintainer of this library is James Turk (james@conceptofzero.net) - and the home of this Library is http://www.zengine.sourceforge.net -*******************************************************************************/ - -#include "ZE_ZSoundBase.h" - -#ifdef USE_AUDIERE - -namespace ZE -{ - -ZSoundBase::ZSoundBase() -{ - rDevice = ZEngine::GetInstance()->GetSoundDevice(); -} - -ZSoundBase::~ZSoundBase() -{ -} - -void ZSoundBase::Play(bool loop) -{ - rStream->play(); - rStream->setRepeat(true); -} - -void ZSoundBase::Stop() -{ - rStream->stop(); -} - -void ZSoundBase::SetVolume(float volume) -{ - rStream->setVolume(volume); -} - -void ZSoundBase::SetPan(float pan) -{ - rStream->setPan(pan); -} - -void ZSoundBase::SetPitch(float pitch) -{ - rStream->setPitchShift(pitch); -} - -void ZSoundBase::SetPosition(int position) -{ - rStream->setPosition(position); -} - -void ZSoundBase::SetPosition(float posPercent) -{ - rStream->setPosition(static_cast(posPercent*rStream->getLength())); -} - -bool ZSoundBase::IsLoaded() const -{ - return (rStream != NULL); -} - -bool ZSoundBase::IsPlaying() const -{ - return rStream->isPlaying(); -} - -bool ZSoundBase::IsSeekable() const -{ - return rStream->isSeekable(); -} - -float ZSoundBase::GetVolume() const -{ - return rStream->getVolume(); -} - -float ZSoundBase::GetPan() const -{ - return rStream->getPan(); -} - -float ZSoundBase::GetPitch() const -{ - return rStream->getPitchShift(); -} - -int ZSoundBase::GetPosition() const -{ - return rStream->getPosition(); -} - -int ZSoundBase::GetLength() const -{ - return rStream->getLength(); -} - - -} - -#endif diff --git a/test/ZAnimTest.cpp b/test/ZAnimTest.cpp index 42803ed..a91025d 100644 --- a/test/ZAnimTest.cpp +++ b/test/ZAnimTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZAnimTest.cpp,v 1.2 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZAnimTest.cpp,v 1.3 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -30,6 +30,7 @@ bool Initialize() fs = cfg.GetBool("ZAnimTest","fullscreen",false); title = cfg.GetString("ZAnimTest","title","ZAnimation Test"); + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -72,7 +73,7 @@ void Test() for(i=0; i < 8; ++i) tank[i].Update(); - engine->Clear(); + engine->ClearDisplay(); for(i=0; i < 8; ++i) tank[i].Draw(200*(i/2),200*(i%2)); diff --git a/test/ZFontTest.cpp b/test/ZFontTest.cpp index 9ac1c21..7d23d45 100644 --- a/test/ZFontTest.cpp +++ b/test/ZFontTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZFontTest.cpp,v 1.20 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZFontTest.cpp,v 1.21 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,7 @@ bool Initialize() title = cfg.GetString("ZFontTest","title","ZFont Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -69,7 +69,7 @@ void Test() engine->RequestQuit(); betsy.DrawText(FormatStr("FPS: %.2f",engine->GetFramerate()),text[5]); - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen //draw the images// for(int i=0; i <= 5; i++) text[i].Draw(10*i,50*i); diff --git a/test/ZImageTest.cpp b/test/ZImageTest.cpp index 278ee9c..2828b0f 100644 --- a/test/ZImageTest.cpp +++ b/test/ZImageTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZImageTest.cpp,v 1.30 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZImageTest.cpp,v 1.31 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,7 @@ bool Initialize() title = cfg.GetString("ZImageTest","title","ZImage Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -49,7 +49,7 @@ void Test() font.SetColor(0,255,0); font.SetBGColor(0,0,255); - engine->SetErrorLog(ZLOG_HTML,"err.html"); + engine->InitErrorLog(); engine->ReportError(ZERR_CRITICAL,"This is a critical test error!!! Something has gone seriously wrong!"); engine->ReportError(ZERR_DEPRECIATED,"This is a test of a depreciated feature."); engine->ReportError(ZERR_ERROR,"This is a normal error, but only a test."); @@ -88,7 +88,7 @@ void Test() } //movement// - movDelta = static_cast(engine->GetFrameTime()*30); + movDelta = static_cast(engine->GetFrameSpeed()*30); if(engine->KeyIsPressed(SDLK_LEFT)) clipRect.MoveRel(-movDelta,0); if(engine->KeyIsPressed(SDLK_RIGHT)) @@ -113,9 +113,9 @@ void Test() if(engine->KeyIsPressed(SDLK_ESCAPE)) engine->RequestQuit(); - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen //draw the images// - alpha += static_cast(alphaDelta*engine->GetFrameTime()); + alpha += static_cast(alphaDelta*engine->GetFrameSpeed()); if(alpha >= 255 || alpha <= 0) alphaDelta *= -1.0f; image1.SetAlpha(static_cast(alpha)); @@ -123,7 +123,7 @@ void Test() #if (GFX_BACKEND == ZE_OGL) image2.DrawRotated(100,0,angle); - angle += static_cast(150*engine->GetFrameTime()); + angle += static_cast(150*engine->GetFrameSpeed()); if(angle > 360) angle = 0.0f; #elif (GFX_BACKEND == ZE_SDL) diff --git a/test/ZMouseTest.cpp b/test/ZMouseTest.cpp index d48da4c..dc18e90 100644 --- a/test/ZMouseTest.cpp +++ b/test/ZMouseTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZMouseTest.cpp,v 1.22 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZMouseTest.cpp,v 1.23 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,7 @@ bool Initialize() title = cfg.GetString("ZMouseTest","title","ZMouse Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -78,7 +78,7 @@ void Test() font.DrawText(FormatStr("Mouse at %d,%d",engine->MouseX(),engine->MouseY()),text[2]); - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen //draw the images// text[engine->MouseInRect(textRect)].Draw(100,100); text[2].Draw(0,0); diff --git a/test/ZMusicTest.cpp b/test/ZMusicTest.cpp index 40d57f6..b08c224 100644 --- a/test/ZMusicTest.cpp +++ b/test/ZMusicTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZMusicTest.cpp,v 1.22 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZMusicTest.cpp,v 1.23 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -30,6 +30,7 @@ bool Initialize() fs = cfg.GetBool("ZMusicTest","fullscreen",false); title = cfg.GetString("ZMusicTest","title","ZMusic Test"); + engine->InitAudio(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -37,15 +38,15 @@ void Test() { ZEngine *engine = ZEngine::GetInstance(); - ZMusic song("data/music.ogg"); + ZMusic song("data/sample.ogg"); ZFont font("data/almontew.ttf",48); ZImage text[4]; if(!song.IsLoaded()) //this executes if there is no music.ogg file { engine->CreateDisplay(800,70,32,false,"ZMusic Test"); - engine->Clear(); - font.DrawText("Music.ogg does not exist, please read music.txt.",text[0]); + engine->ClearDisplay(); + font.DrawText("sample.ogg does not exist, please read music.txt.",text[0]); text[0].Draw(0,0); engine->Update(); do @@ -76,21 +77,24 @@ void Test() song.Pause(); if(engine->KeyIsPressed(SDLK_u)) song.Unpause(); +#if SND_BACKEND == ZE_MIXER if(engine->KeyIsPressed(SDLK_f)) - song.Stop(5000); + song.Stop(200); +#endif if(engine->KeyIsPressed(SDLK_h)) song.Stop(); if(engine->KeyIsPressed(SDLK_SPACE)) song.Play(); if(engine->KeyIsPressed(SDLK_UP)) song.SetVolume(song.GetVolume()+1); - if(engine->KeyIsPressed(SDLK_DOWN)) + if(engine->KeyIsPressed(SDLK_DOWN) && song.GetVolume() > 0) song.SetVolume(song.GetVolume()-1); + if(engine->KeyIsPressed(SDLK_v)) + song.SetVolume(100); + + font.DrawText(FormatStr("Volume: %d%%",song.GetVolume()),text[3]); - - font.DrawText(FormatStr("Volume: %d",song.GetVolume()),text[3]); - - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen for(int i=0; i < 4; i++) text[i].Draw(0,i*50); engine->Update(); //update the screen diff --git a/test/ZParticleTest.cpp b/test/ZParticleTest.cpp index 4d14bf6..ec03262 100755 --- a/test/ZParticleTest.cpp +++ b/test/ZParticleTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZParticleTest.cpp,v 1.10 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZParticleTest.cpp,v 1.11 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,7 @@ bool Initialize() title = cfg.GetString("ZParticleTest","title","ZParticle Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -127,9 +127,9 @@ void Test() engine->RequestQuit(); for(i=0; i < 3; ++i) - effect[i].Update(); + effect[i].Update(); - engine->Clear(); + engine->ClearDisplay(); bg.Draw(0,0); for(i=0; i < 3; ++i) diff --git a/test/ZRectTest.cpp b/test/ZRectTest.cpp index 737fedc..899ab36 100644 --- a/test/ZRectTest.cpp +++ b/test/ZRectTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZRectTest.cpp,v 1.23 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZRectTest.cpp,v 1.24 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -29,7 +29,7 @@ bool Initialize() bpp = cfg.GetInt("ZRectTest","bpp",32); fs = cfg.GetBool("ZRectTest","fullscreen",false); title = cfg.GetString("ZRectTest","title","ZRect Test"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -49,7 +49,7 @@ void Test() if(engine->KeyIsPressed(SDLK_ESCAPE)) engine->RequestQuit(); //movement// - movDelta = static_cast(engine->GetFrameTime()*30); + movDelta = static_cast(engine->GetFrameSpeed()*30); if(engine->KeyIsPressed(SDLK_LEFT)) moveRect.MoveRel(-movDelta,0); if(engine->KeyIsPressed(SDLK_RIGHT)) @@ -69,7 +69,7 @@ void Test() moveRect.ResizeRel(-2,-2); } - engine->Clear(); + engine->ClearDisplay(); moveRect.Draw(255,0,0,128); stillRect.Draw(0,0,255,128); moveRect.Intersection(stillRect).Draw(0,255,0); diff --git a/test/ZSoundTest.cpp b/test/ZSoundTest.cpp index fbb75a3..753e83f 100644 --- a/test/ZSoundTest.cpp +++ b/test/ZSoundTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZSoundTest.cpp,v 1.22 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZSoundTest.cpp,v 1.23 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,8 @@ bool Initialize() title = cfg.GetString("ZSoundTest","title","ZSound Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); + engine->InitAudio(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -49,7 +50,6 @@ void Test() sample[i].OpenFromZip("data/data.zip",FormatStr("%s.wav",name[i].c_str())); sample[4].OpenFromZRF("whip"); - font.DrawText("(P)ause\t(U)npause",text[0]); font.DrawText("(F)ade Out\t(H)alt\t",text[1]); font.DrawText("Space - Play\t Up/Down - Control Volume",text[2]); @@ -77,21 +77,23 @@ void Test() sample[sampleNum].Pause(); if(engine->KeyIsPressed(SDLK_u)) sample[sampleNum].Unpause(); +#if SND_BACKEND == ZE_MIXER if(engine->KeyIsPressed(SDLK_f)) - sample[sampleNum].Stop(5000); + sample[sampleNum].Stop(200); +#endif if(engine->KeyIsPressed(SDLK_h)) sample[sampleNum].Stop(); if(engine->KeyIsPressed(SDLK_SPACE)) sample[sampleNum].Play(); - if(engine->KeyIsPressed(SDLK_UP)) + if(engine->KeyIsPressed(SDLK_UP) && sample[sampleNum].GetVolume() < 100) sample[sampleNum].SetVolume(sample[sampleNum].GetVolume()+1); - if(engine->KeyIsPressed(SDLK_DOWN)) + if(engine->KeyIsPressed(SDLK_DOWN) && sample[sampleNum].GetVolume() > 0) sample[sampleNum].SetVolume(sample[sampleNum].GetVolume()-1); - font.DrawText(FormatStr("Volume: %d",sample[sampleNum].GetVolume()),text[4]); + font.DrawText(FormatStr("Volume: %d%%",sample[sampleNum].GetVolume()),text[4]); font.DrawText(FormatStr("Sample: %s",name[sampleNum].c_str()),text[5]); - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen for(int i=0; i < 6; i++) text[i].Draw(0,i*50); engine->Update(); //update the screen diff --git a/test/ZTimerTest.cpp b/test/ZTimerTest.cpp index 0068910..2b3dfe4 100644 --- a/test/ZTimerTest.cpp +++ b/test/ZTimerTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -// $Id: ZTimerTest.cpp,v 1.21 2003/12/31 12:27:58 cozman Exp $ +// $Id: ZTimerTest.cpp,v 1.22 2004/01/13 23:56:28 cozman Exp $ #include #include @@ -31,7 +31,7 @@ bool Initialize() title = cfg.GetString("ZTimerTest","title","ZTimer Test"); engine->SetResourceFile("resources.zrf"); - + engine->InitErrorLog(); return engine->CreateDisplay(w,h,bpp,fs,title); } @@ -105,7 +105,7 @@ void Test() font.DrawText(FormatStr("%s Time: %d",TimerName[1].c_str(),TimerOne.GetTime()),text[2]); font.DrawText(FormatStr("%s Time: %d",TimerName[2].c_str(),TimerTwo.GetTime()),text[3]); - engine->Clear(); //clear screen + engine->ClearDisplay(); //clear screen for(int i=0; i <= 4; i++) text[i].Draw(0,i*30); diff --git a/vc6/readme-vc6.txt b/vc6/readme-vc6.txt deleted file mode 100755 index 046cdaa..0000000 --- a/vc6/readme-vc6.txt +++ /dev/null @@ -1,4 +0,0 @@ - -Where have the VC6 project files gone? - -Visual C++ 6 is now an outdated program, and I apologize but I can no longer support it. It's STL support as well as it's support of newer features of C++ made compiling ZEngine properly in it an extremely difficult thing for me to officially support. As of 0.8.4 some people could get it to compile, but as far as I know they had to use things like STLPort (http://www.stlport.org) due to the problems in the STL shipped with VC6. If you have the money I'd recommend upgrading to Visual C++ 7 (aka .net) Standard which should cost you less than 100$. If you're short on cash Bloodshed makes their GCC based windows IDE available for free at http://bloodshed.net/dev/devcpp.html. I apologize for the inconvenience but keeping VC6 support is getting increasingly hard as all my VC6 contacts have switched and I have been notified several times that the VC6 project files are becoming more and more broken with every release. Of course if anybody would like to work on a VC6 port of ZEngine I'd be glad to help as much as I can, just contact me (james@conceptofzero.net). \ No newline at end of file diff --git a/vc7/ZAnimTest.vcproj b/vc7/ZAnimTest.vcproj index 4497946..0db724d 100644 --- a/vc7/ZAnimTest.vcproj +++ b/vc7/ZAnimTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZAnimTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZEngine.vcproj b/vc7/ZEngine.vcproj index d4f8900..cdfd53b 100644 --- a/vc7/ZEngine.vcproj +++ b/vc7/ZEngine.vcproj @@ -64,6 +64,9 @@ + + @@ -110,6 +113,9 @@ + + @@ -146,6 +152,9 @@ + + diff --git a/vc7/ZFontTest.vcproj b/vc7/ZFontTest.vcproj index 05018ae..e684582 100644 --- a/vc7/ZFontTest.vcproj +++ b/vc7/ZFontTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZFontTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZImageTest.vcproj b/vc7/ZImageTest.vcproj index 3bbfa84..cd08c0a 100644 --- a/vc7/ZImageTest.vcproj +++ b/vc7/ZImageTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZImageTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZMouseTest.vcproj b/vc7/ZMouseTest.vcproj index 4cd9cd9..d1f8c92 100644 --- a/vc7/ZMouseTest.vcproj +++ b/vc7/ZMouseTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZMouseTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZMusicTest.vcproj b/vc7/ZMusicTest.vcproj index 7b14401..59d1c6e 100644 --- a/vc7/ZMusicTest.vcproj +++ b/vc7/ZMusicTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZMusicTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZParticleTest.vcproj b/vc7/ZParticleTest.vcproj index 4d97a4b..20198fb 100755 --- a/vc7/ZParticleTest.vcproj +++ b/vc7/ZParticleTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZParticleTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZRectTest.vcproj b/vc7/ZRectTest.vcproj index abd9c66..f9ea45b 100644 --- a/vc7/ZRectTest.vcproj +++ b/vc7/ZRectTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZRectTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZSoundTest.vcproj b/vc7/ZSoundTest.vcproj index 1ea161f..ecb27fd 100644 --- a/vc7/ZSoundTest.vcproj +++ b/vc7/ZSoundTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZSoundTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib" diff --git a/vc7/ZTimerTest.vcproj b/vc7/ZTimerTest.vcproj index 6ba5bf5..598e7cd 100644 --- a/vc7/ZTimerTest.vcproj +++ b/vc7/ZTimerTest.vcproj @@ -38,9 +38,10 @@ sdlmain.lib opengl32.lib sdl_ttf.lib -sdl_mixer.lib sdl_image.lib -ZEngineS.lib" +ZEngineS.lib +SDL_mixer.lib +audiere.lib" OutputFile="../test/bin/ZTimerTest.exe" LinkIncremental="1" AdditionalLibraryDirectories="../lib"