issue #151: because now the r, g, b is correct, so we should not

change it
This commit is contained in:
Ming 2010-09-21 08:15:23 +00:00
parent 30417e37f9
commit a50b1b97bb
6 changed files with 11 additions and 190 deletions

View File

@ -504,10 +504,6 @@
RelativePath=".\include\CCXFileUtils.h"
>
</File>
<File
RelativePath=".\include\CCXRGBATransform.h"
>
</File>
<File
RelativePath=".\include\CCXUIImage.h"
>
@ -864,10 +860,6 @@
RelativePath=".\platform\CCXMath.h"
>
</File>
<File
RelativePath=".\platform\CCXRGBATransform_platform.h"
>
</File>
<File
RelativePath=".\platform\CCXUIImage_platform.h"
>
@ -923,14 +915,6 @@
RelativePath=".\platform\uphone\CCXFileUtils_uphone.h"
>
</File>
<File
RelativePath=".\platform\uphone\CCXRGBATransform_uphone.cpp"
>
</File>
<File
RelativePath=".\platform\uphone\CCXRGBATransform_uphone.h"
>
</File>
<File
RelativePath=".\platform\uphone\CCXUIImage_uphone.cpp"
>

View File

@ -1,29 +0,0 @@
/****************************************************************************
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.
****************************************************************************/
#ifndef __CCX_RGBA_TRANSFORM_H__
#define __CCX_RGBA_TRANSFORM_H__
#include "platform/CCXRGBATransform_platform.h"
#endif // __CCX_RGBA_TRANSFORM_H__

View File

@ -26,7 +26,6 @@ THE SOFTWARE.
#define __CCTYPES_H__
#include "CGGeometry.h"
#include "CCXRGBATransform.h"
#include <GLES/gl.h>
namespace cocos2d {
@ -44,28 +43,28 @@ typedef struct _ccColor3B
static inline ccColor3B
ccc3(const GLubyte r, const GLubyte g, const GLubyte b)
{
ccColor3B c = CCXRGBATransform::transformRGB(r, g, b);
ccColor3B c = {r, g, b};
return c;
}
//ccColor3B predefined colors
//! White color (255,255,255)
static const ccColor3B ccWHITE=ccc3(255,255,255);
static const ccColor3B ccWHITE={255,255,255};
//! Yellow color (255,255,0)
static const ccColor3B ccYELLOW=ccc3(255,255,0);
static const ccColor3B ccYELLOW={255,255,0};
//! Blue color (0,0,255)
static const ccColor3B ccBLUE=ccc3(0,0,255);
static const ccColor3B ccBLUE={0,0,255};
//! Green Color (0,255,0)
static const ccColor3B ccGREEN=ccc3(0,255,0);
static const ccColor3B ccGREEN={0,255,0};
//! Red Color (255,0,0,)
static const ccColor3B ccRED=ccc3(255,0,0);
static const ccColor3B ccRED={255,0,0};
//! Magenta Color (255,0,255)
static const ccColor3B ccMAGENTA=ccc3(255,0,255);
static const ccColor3B ccMAGENTA={255,0,255};
//! Black Color (0,0,0)
static const ccColor3B ccBLACK=ccc3(0,0,0);
static const ccColor3B ccBLACK={0,0,0};
//! Orange Color (255,127,0)
static const ccColor3B ccORANGE=ccc3(255,127,0);
static const ccColor3B ccORANGE={255,127,0};
//! Gray Color (166,166,166)
static const ccColor3B ccGRAY=ccc3(166,166,166);
static const ccColor3B ccGRAY={166,166,166};
/** RGBA color composed of 4 bytes
@since v0.8
@ -81,7 +80,7 @@ typedef struct _ccColor4B
static inline ccColor4B
ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o)
{
ccColor4B c = CCXRGBATransform::transformRGBA(r, g, b, o);
ccColor4B c = {r, g, b, o};
return c;
}

View File

@ -1,36 +0,0 @@
/****************************************************************************
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.
****************************************************************************/
#ifndef __CCX_RGBA_TRANSFORM_PLATFORM_H__
#define __CCX_RGBA_TRANSFORM_PLATFORM_H__
#include "config_platform.h"
#ifdef CCX_PLATFORM_UPHONE
#include "uphone/CCXRGBATransform_uphone.h"
#else
#error
#endif // __CCX_FILEUTILS_PLATFORM_H__
#endif // __CCX_RGBA_TRANSFORM_PLATFORM_H__

View File

@ -1,54 +0,0 @@
/****************************************************************************
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 "CCXRGBATransform_uphone.h"
#include "ccTypes.h"
namespace cocos2d
{
ccColor4B CCXRGBATransform::transformRGBA(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte a)
{
#ifdef _TRANZDA_VM_
ccColor4B c4 = {r, g, b, a};
#else
ccColor4B c4 = {b, g, r, a};
#endif
return c4;
}
ccColor3B CCXRGBATransform::transformRGB(const GLubyte r, const GLubyte g, const GLubyte b)
{
#ifdef _TRANZDA_VM_
ccColor3B c3 = {r, g, b};
#else
ccColor3B c3 = {b, g, r};
#endif
return c3;
}
} // end of namespace cocos2d

View File

@ -1,43 +0,0 @@
/****************************************************************************
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.
****************************************************************************/
#ifndef __CCX_RGBA_TRANSFORM_UPHONE_H__
#define __CCX_RGBA_TRANSFORM_UPHONE_H__
#include "ccxCommon.h"
#include <GLES/gl.h>
namespace cocos2d
{
struct _ccColor4B;
struct _ccColor3B;
class CCX_DLL CCXRGBATransform
{
public:
static struct _ccColor4B transformRGBA(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte a);
static struct _ccColor3B transformRGB(const GLubyte r, const GLubyte g, const GLubyte b);
};
} // end of namespace cocos2d
#endif // __CCX_RGBA_TRANSFORM_UPHONE_H__