issue #2171: [New Renderer] Fixing compilation errors for Android.

This commit is contained in:
James Chen 2013-12-17 14:18:41 +08:00
parent 8bd838ddfc
commit 4e01769cd5
10 changed files with 39 additions and 15 deletions

View File

@ -117,10 +117,27 @@ platform/CCEGLViewProtocol.cpp \
platform/CCFileUtils.cpp \ platform/CCFileUtils.cpp \
platform/CCSAXParser.cpp \ platform/CCSAXParser.cpp \
platform/CCThread.cpp \ platform/CCThread.cpp \
renderer/CCNewDrawNode.cpp \
renderer/CCNewLabelAtlas.cpp \
renderer/CCNewParticleSystemQuad.cpp \
renderer/CCNewRenderTexture.cpp \
renderer/CCNewSprite.cpp \
renderer/CCNewSpriteBatchNode.cpp \
renderer/CCNewTextureAtlas.cpp \
renderer/CustomCommand.cpp \
renderer/Frustum.cpp \
renderer/GroupCommand.cpp \
renderer/MaterialManager.cpp \
renderer/NewClippingNode.cpp \
renderer/QuadCommand.cpp \
renderer/RenderCommand.cpp \
renderer/Renderer.cpp \
renderer/RenderMaterial.cpp \
../base/atitc.cpp \ ../base/atitc.cpp \
../base/CCAffineTransform.cpp \ ../base/CCAffineTransform.cpp \
../base/CCArray.cpp \ ../base/CCArray.cpp \
../base/CCAutoreleasePool.cpp \ ../base/CCAutoreleasePool.cpp \
../base/CCConsole.cpp \
../base/CCData.cpp \ ../base/CCData.cpp \
../base/CCDataVisitor.cpp \ ../base/CCDataVisitor.cpp \
../base/CCDictionary.cpp \ ../base/CCDictionary.cpp \
@ -132,7 +149,6 @@ platform/CCThread.cpp \
../base/CCValue.cpp \ ../base/CCValue.cpp \
../base/etc1.cpp \ ../base/etc1.cpp \
../base/s3tc.cpp \ ../base/s3tc.cpp \
../base/CCConsole.cpp \
../math/kazmath/src/aabb.c \ ../math/kazmath/src/aabb.c \
../math/kazmath/src/mat3.c \ ../math/kazmath/src/mat3.c \
../math/kazmath/src/mat4.c \ ../math/kazmath/src/mat4.c \
@ -162,6 +178,7 @@ platform/CCThread.cpp \
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/renderer \
$(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/../math/kazmath/include \
platform/android \ platform/android \
$(LOCAL_PATH)/../physics \ $(LOCAL_PATH)/../physics \
@ -171,6 +188,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../../external/chipmunk/include/chipmunk $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk
LOCAL_C_INCLUDES := $(LOCAL_PATH) \ LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/renderer \
$(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/../math/kazmath/include \
$(LOCAL_PATH)/platform/android \ $(LOCAL_PATH)/platform/android \
$(LOCAL_PATH)/../physics \ $(LOCAL_PATH)/../physics \

View File

@ -59,8 +59,8 @@ public:
/** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */ /** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */
static RenderTexture * create(int w, int h); static RenderTexture * create(int w, int h);
virtual /** starts grabbing */ /** starts grabbing */
void begin(); virtual void begin();
/** starts rendering to the texture while clearing the texture first. /** starts rendering to the texture while clearing the texture first.
This is more efficient then calling -clear first and then -begin */ This is more efficient then calling -clear first and then -begin */
@ -77,8 +77,8 @@ public:
/** end is key word of lua, use other name to export to lua. */ /** end is key word of lua, use other name to export to lua. */
inline void endToLua(){ end();}; inline void endToLua(){ end();};
virtual /** ends grabbing*/ /** ends grabbing*/
void end(); virtual void end();
/** clears the texture with a color */ /** clears the texture with a color */
void clear(float r, float g, float b, float a); void clear(float r, float g, float b, float a);

View File

@ -1,6 +1,7 @@
#include "Frustum.h" #include "Frustum.h"
#include "platform/CCCommon.h"
#include <stdlib.h> #include <stdlib.h>
#include "CCCommon.h"
NS_CC_BEGIN NS_CC_BEGIN

View File

@ -2,7 +2,7 @@
#define __CC_FRUSTUM_H__ #define __CC_FRUSTUM_H__
#include "CCPlatformMacros.h" #include "CCPlatformMacros.h"
#include "math/kazmath/include/kazmath/kazmath.h" #include "kazmath/kazmath.h"
NS_CC_BEGIN NS_CC_BEGIN

View File

@ -10,7 +10,7 @@
#include "RenderCommand.h" #include "RenderCommand.h"
#include "CCGLProgram.h" #include "CCGLProgram.h"
#include "RenderCommandPool.h" #include "RenderCommandPool.h"
#include "kazmath.h" #include "kazmath/kazmath.h"
NS_CC_BEGIN NS_CC_BEGIN

View File

@ -10,11 +10,14 @@
#include "QuadCommand.h" #include "QuadCommand.h"
#include "GroupCommand.h" #include "GroupCommand.h"
#include "CCConfiguration.h" #include "CCConfiguration.h"
#include "CCNotificationCenter.h"
#include "CCEventType.h"
#include <algorithm> // for std::stable_sort
NS_CC_BEGIN NS_CC_BEGIN
using namespace std; using namespace std;
static Renderer* s_instance; static Renderer* s_instance = nullptr;
Renderer *Renderer::getInstance() Renderer *Renderer::getInstance()
{ {
@ -83,8 +86,9 @@ void Renderer::initGLView()
_glViewAssigned = true; _glViewAssigned = true;
} }
void Renderer::onBackToForeground() void Renderer::onBackToForeground(Object* obj)
{ {
CC_UNUSED_PARAM(obj);
setupBuffer(); setupBuffer();
} }
@ -216,7 +220,7 @@ void Renderer::render()
//1. Sort render commands based on ID //1. Sort render commands based on ID
for (auto it = _renderGroups.begin(); it != _renderGroups.end(); ++it) for (auto it = _renderGroups.begin(); it != _renderGroups.end(); ++it)
{ {
stable_sort((*it).begin(), (*it).end(), compareRenderCommand); std::stable_sort((*it).begin(), (*it).end(), compareRenderCommand);
} }
while(!_renderStack.empty()) while(!_renderStack.empty())

View File

@ -63,7 +63,7 @@ protected:
//Draw the previews queued quads and flush previous context //Draw the previews queued quads and flush previous context
void flush(); void flush();
void onBackToForeground(); void onBackToForeground(Object* obj);
protected: protected:
stack<int> _commandGroupStack; stack<int> _commandGroupStack;

View File

@ -99,8 +99,8 @@ Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \
Classes/FileUtilsTest/FileUtilsTest.cpp \ Classes/FileUtilsTest/FileUtilsTest.cpp \
Classes/FontTest/FontTest.cpp \ Classes/FontTest/FontTest.cpp \
Classes/IntervalTest/IntervalTest.cpp \
Classes/InputTest/MouseTest.cpp \ Classes/InputTest/MouseTest.cpp \
Classes/IntervalTest/IntervalTest.cpp \
Classes/KeyboardTest/KeyboardTest.cpp \ Classes/KeyboardTest/KeyboardTest.cpp \
Classes/KeypadTest/KeypadTest.cpp \ Classes/KeypadTest/KeypadTest.cpp \
Classes/LabelTest/LabelTest.cpp \ Classes/LabelTest/LabelTest.cpp \
@ -110,6 +110,7 @@ Classes/MenuTest/MenuTest.cpp \
Classes/MotionStreakTest/MotionStreakTest.cpp \ Classes/MotionStreakTest/MotionStreakTest.cpp \
Classes/MutiTouchTest/MutiTouchTest.cpp \ Classes/MutiTouchTest/MutiTouchTest.cpp \
Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \
Classes/NewRendererTest/NewRendererTest.cpp \
Classes/NodeTest/NodeTest.cpp \ Classes/NodeTest/NodeTest.cpp \
Classes/ParallaxTest/ParallaxTest.cpp \ Classes/ParallaxTest/ParallaxTest.cpp \
Classes/ParticleTest/ParticleTest.cpp \ Classes/ParticleTest/ParticleTest.cpp \

View File

@ -3,7 +3,7 @@
// //
#include "NewRendererTest.h" #include "NewRendererTest/NewRendererTest.h"
#include "renderer/CCNewSprite.h" #include "renderer/CCNewSprite.h"
#include "renderer/CCNewSpriteBatchNode.h" #include "renderer/CCNewSpriteBatchNode.h"
#include "renderer/NewClippingNode.h" #include "renderer/NewClippingNode.h"

View File

@ -1,7 +1,7 @@
#ifndef _TESTS_H_ #ifndef _TESTS_H_
#define _TESTS_H_ #define _TESTS_H_
#include "NewRendererTest.h" #include "NewRendererTest/NewRendererTest.h"
#include "ConsoleTest/ConsoleTest.h" #include "ConsoleTest/ConsoleTest.h"
#include "NewEventDispatcherTest/NewEventDispatcherTest.h" #include "NewEventDispatcherTest/NewEventDispatcherTest.h"
#include "ActionsTest/ActionsTest.h" #include "ActionsTest/ActionsTest.h"