From: <c99...@us...> - 2006-07-08 01:57:20
|
Revision: 348 Author: c99koder Date: 2006-07-07 18:57:14 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/cadcdev/?rev=348&view=rev Log Message: ----------- Tiki: NDS build fixes Modified Paths: -------------- tiki/examples/TikiTest/Makefile tiki/nds/Makefile.rules tiki/nds/src/Makefile Added Paths: ----------- tiki/nds/src/audio/ tiki/nds/src/audio/sound.cpp tiki/nds/src/audio/stream.cpp Modified: tiki/examples/TikiTest/Makefile =================================================================== --- tiki/examples/TikiTest/Makefile 2006-07-06 19:18:05 UTC (rev 347) +++ tiki/examples/TikiTest/Makefile 2006-07-08 01:57:14 UTC (rev 348) @@ -4,7 +4,7 @@ OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) all: $(OBJS) - $(CXX) -L$(TIKI_DIR)$(TIKI_PLAT) -L$(TIKI_DIR)$(TIKI_PLAT)/lib $(OBJS) $(TIKI_BASE_LIBS) -o tikitest + $(CXX) $(LDFLAGS) -L$(TIKI_DIR)$(TIKI_PLAT) -L$(TIKI_DIR)$(TIKI_PLAT)/lib $(OBJS) $(TIKI_BASE_LIBS) -o tikitest clean: -rm -f $(OBJS) tikitest Modified: tiki/nds/Makefile.rules =================================================================== --- tiki/nds/Makefile.rules 2006-07-06 19:18:05 UTC (rev 347) +++ tiki/nds/Makefile.rules 2006-07-08 01:57:14 UTC (rev 348) @@ -31,4 +31,4 @@ LDFLAGS=-specs=ds_arm9.specs -mthumb -mthumb-interwork -mno-fpu -L$(DEVKITPRO)/lib -lgcc -include $(DEVKITPRO)/ds_rules +include $(DEVKITARM)/ds_rules Modified: tiki/nds/src/Makefile =================================================================== --- tiki/nds/src/Makefile 2006-07-06 19:18:05 UTC (rev 347) +++ tiki/nds/src/Makefile 2006-07-08 01:57:14 UTC (rev 348) @@ -1,5 +1,6 @@ OBJS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) +OBJS += $(patsubst %.cpp,%.o,$(wildcard audio/*.cpp)) all: $(OBJS) $(AR) ru ../libtiki.a $(OBJS) Added: tiki/nds/src/audio/sound.cpp =================================================================== --- tiki/nds/src/audio/sound.cpp (rev 0) +++ tiki/nds/src/audio/sound.cpp 2006-07-08 01:57:14 UTC (rev 348) @@ -0,0 +1,76 @@ +/* + Tiki + + sound.cpp + + Copyright (C)2002,2003,2004 Dan Potter + Copyright (C)2005 Cryptic Allusion, LLC +*/ + +#include "pch.h" +#include "Tiki/sound.h" +#include "Tiki/file.h" + +#include <string.h> + +using namespace Tiki::Audio; + +TIKI_OBJECT_NAME(Sound) +TIKI_OBJECT_BEGIN(Object, Sound) +TIKI_OBJECT_END(Sound) + +////////////////////////////////////////////////////////////////////////////////////////// + +float Sound::m_default_vol = 0.9f; + +bool Sound::initGlobal() { + return true; +} + +void Sound::shutdownGlobal() { + stopAll(); +} + +void Sound::stop(int ch) { +} + +void Sound::stopAll() { +} + +////////////////////////////////////////////////////////////////////////////////////////// + +Sound::Sound(const string & fn) { + if (!loadFromFile(fn)) + assert( false ); +} + +Sound::Sound() { +} + +Sound::~Sound() { +} + +bool Sound::loadFromFile(const string & fn) { + return false; +} + +// Set the default volume value +void Sound::setDefaultVolume(float vol) { + m_default_vol = vol; +} + +int Sound::play() { + return -1; +} + +int Sound::play(float vol) { + return -1; +} + +int Sound::play(float vol, float pan) { + return -1; +} + +void Sound::play(int ch, float vol, float pan) { +} + Property changes on: tiki/nds/src/audio/sound.cpp ___________________________________________________________________ Name: svn:executable + * Added: tiki/nds/src/audio/stream.cpp =================================================================== --- tiki/nds/src/audio/stream.cpp (rev 0) +++ tiki/nds/src/audio/stream.cpp 2006-07-08 01:57:14 UTC (rev 348) @@ -0,0 +1,162 @@ +/* + Tiki + + stream.cpp + + Copyright (C)2005 Cryptic Allusion, LLC +*/ + +#include "pch.h" +#include "Tiki/stream.h" + +#include <string.h> + +using namespace Tiki::Audio; +using namespace Tiki::Thread; + +TIKI_OBJECT_NAME(Stream) +TIKI_OBJECT_BEGIN(Object, Stream) + TIKI_OBJECT_RECEIVER("start", Stream::objectStart) + TIKI_OBJECT_RECEIVER("stop", Stream::objectStop) +TIKI_OBJECT_END(Stream) + + +bool Stream::initGlobal() { + return true; +} + +void Stream::shutdownGlobal() { +} + +Stream::Stream() { + // Default our members. + m_bufSize = 0x4000; + m_chnCount = 2; + m_freq = 44100; + m_queueing = false; + m_state = StateStopped; + m_volume = 0.8f; + m_mutex = new Mutex(); +} + +Stream::~Stream() { + destroy(); +} + +bool Stream::create() { + AutoLock lock(m_mutex); + return true; +} + +void Stream::destroy() { + AutoLock lock(m_mutex); +} + +// virtual void filter(int freq, int chncount, void * buffer, int smpcnt) { } + +void Stream::filterAdd(Filter * f) { + AutoLock lock(m_mutex); + + m_filters.insertTail(f); +} + +void Stream::filterRemove(Filter * f) { + AutoLock lock(m_mutex); + + m_filters.del(f); +} + +void Stream::setQueueing(bool isQueued) { + AutoLock lock(m_mutex); + + m_queueing = isQueued; +} + +void Stream::setFrequency(int freq) { + AutoLock lock(m_mutex); + + m_freq = freq; +} + +void Stream::setChannelCount(int chncount) { + AutoLock lock(m_mutex); + + m_chnCount = chncount; +} + +void Stream::start() { + AutoLock lock(m_mutex); + m_state = StatePlaying; +} + +void Stream::stop() { + AutoLock lock(m_mutex); + m_state = StateStopped; +} + +void Stream::pause() { + AutoLock lock(m_mutex); + m_state = StatePaused; +} + +void Stream::resume() { + AutoLock lock(m_mutex); + m_state = StatePlaying; +} + +void Stream::setVolume(float vol) { + AutoLock lock(m_mutex); + + m_volume = vol; +} + +bool Stream::isPlaying() { + AutoLock lock(m_mutex); + + return m_state == StatePlaying; +} + +int Stream::objectStart(Object * /*from*/, Object * /*arg*/) { + start(); return 0; +} + +int Stream::objectStop(Object * /*from*/, Object * /*arg*/) { + stop(); return 0; +} + + +void Stream::processFilters(void * buffer, int smpcnt) { +} + +// "len" is a *sample* count. +void Stream::sepData(void * buffer, int len, bool stereo, int16 * outl, int16 * outr) { + int16 * sep_buffer[2] = { outl, outr }; + int16 * bufsrc, * bufdst; + int cnt; + + if (stereo) { + bufsrc = (int16*)buffer; + bufdst = sep_buffer[0]; + cnt = len; + do { + *bufdst = *bufsrc; + bufdst++; bufsrc+=2; cnt--; + } while (cnt > 0); + + bufsrc = (int16*)buffer; bufsrc++; + bufdst = sep_buffer[1]; + cnt = len; + do { + *bufdst = *bufsrc; + bufdst++; bufsrc+=2; cnt--; + } while (cnt > 0); + } else { + memcpy(sep_buffer[0], buffer, len * 2); + memcpy(sep_buffer[1], buffer, len * 2); + } +} + +Stream::GetDataResult Stream::getData(uint16 * buffer, int * numSamples) { + return GDError; +} + Property changes on: tiki/nds/src/audio/stream.cpp ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |