Merge branch 'upto-0.99.5' of https://github.com/cocos2d/cocos2d-x into merge

This commit is contained in:
natural-law 2011-01-12 18:01:44 +08:00
commit 01e876df03
5 changed files with 182 additions and 8 deletions

View File

@ -0,0 +1,10 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocosdenshion
LOCAL_SRC_FILES := SimpleAudioEngine.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
include $(BUILD_SHARED_LIBRARY)

View File

@ -0,0 +1,161 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "SimpleAudioEngine.h"
namespace CocosDenshion
{
static SimpleAudioEngine *s_pEngine;
SimpleAudioEngine::SimpleAudioEngine()
{
}
SimpleAudioEngine::~SimpleAudioEngine()
{
}
SimpleAudioEngine* SimpleAudioEngine::sharedEngine()
{
if (! s_pEngine)
{
s_pEngine = new SimpleAudioEngine();
}
return s_pEngine;
}
void SimpleAudioEngine::end()
{
}
void SimpleAudioEngine::setResourcePath(const char *pszResourcePath)
{
}
void SimpleAudioEngine::setResourceZipFile(const char* pszZipPath)
{
}
void SimpleAudioEngine::setSoundResInfo(const T_SoundResInfo ResInfo[], int nCount)
{
}
void SimpleAudioEngine::setResourceEntry(const void* pResEntry)
{
}
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
{
}
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
{
}
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
{
}
void SimpleAudioEngine::pauseBackgroundMusic()
{
}
void SimpleAudioEngine::resumeBackgroundMusic()
{
}
void SimpleAudioEngine::rewindBackgroundMusic()
{
}
bool SimpleAudioEngine::willPlayBackgroundMusic()
{
return false;
}
bool SimpleAudioEngine::isBackgroundMusicPlaying()
{
return false;
}
int SimpleAudioEngine::getBackgroundMusicVolume()
{
return -1;
}
void SimpleAudioEngine::setBackgroundMusicVolume(int volume)
{
}
int SimpleAudioEngine::getEffectsVolume()
{
return -1;
}
void SimpleAudioEngine::setEffectsVolume(int volume)
{
}
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath)
{
return 0;
}
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
{
}
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
{
}
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
{
}
void SimpleAudioEngine::unloadEffectAll()
{
}
}

View File

@ -56,16 +56,12 @@ namespace cocos2d {
}
HGDIOBJ hOldFont = SelectObject(m_hMemDC, hNewFont);
// text
int len = strlen(text);
WCHAR *pText = new WCHAR[len + 1];
MultiByteToWideChar(CP_ACP, 0, text, len + 1, pText, len);
// calculate text size
int len = strlen(text);
SIZE extent;
if (CGSize::CGSizeEqualToSize(dimensions, CGSizeZero))
{
GetTextExtentPoint(m_hMemDC, pText, len, &extent);
GetTextExtentPointA(m_hMemDC, text, len, &extent);
}
else
{
@ -100,10 +96,9 @@ namespace cocos2d {
RECT rc = {0, 0, extent.cx, extent.cy};
SetBkMode(m_hMemDC, TRANSPARENT);
SetTextColor(m_hMemDC, RGB(255, 255, 255)); // white color
DrawText(m_hMemDC, pText, len, &rc, dwStyle);
DrawTextA(m_hMemDC, text, len, &rc, dwStyle);
// free resource
delete [] pText;
SelectObject(m_hMemDC, hOldFont);
if (hFont)
{

View File

@ -53,6 +53,7 @@ OBJECTS = \
$(OBJECTS_DIR)/NSAutoreleasePool.o \
$(OBJECTS_DIR)/NSData.o \
$(OBJECTS_DIR)/NSObject.o \
$(OBJECTS_DIR)/CCNS_uphone.o \
$(OBJECTS_DIR)/NSSet.o \
$(OBJECTS_DIR)/NSZone.o \
$(OBJECTS_DIR)/CCGrabber.o \
@ -318,6 +319,9 @@ $(OBJECTS_DIR)/CCXUIImage_uphone.o : ../platform/uphone/CCXUIImage_uphone.cpp
$(OBJECTS_DIR)/NSLock.o : ../platform/uphone/NSLock.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/NSLock.o ../platform/uphone/NSLock.cpp
$(OBJECTS_DIR)/CCNS_uphone.o : ../platform/uphone/CCNS_uphone.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCNS_uphone.o ../platform/uphone/CCNS_uphone.cpp
$(OBJECTS_DIR)/CCAnimation.o : ../sprite_nodes/CCAnimation.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAnimation.o ../sprite_nodes/CCAnimation.cpp

View File

@ -801,6 +801,10 @@
<Filter
Name="win32"
>
<File
RelativePath="..\platform\win32\CCNS_win32.cpp"
>
</File>
<File
RelativePath="..\platform\win32\CCTime.cpp"
>