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/CCSAXParser.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/CCAffineTransform.cpp \
../base/CCArray.cpp \
../base/CCAutoreleasePool.cpp \
../base/CCConsole.cpp \
../base/CCData.cpp \
../base/CCDataVisitor.cpp \
../base/CCDictionary.cpp \
@ -132,7 +149,6 @@ platform/CCThread.cpp \
../base/CCValue.cpp \
../base/etc1.cpp \
../base/s3tc.cpp \
../base/CCConsole.cpp \
../math/kazmath/src/aabb.c \
../math/kazmath/src/mat3.c \
../math/kazmath/src/mat4.c \
@ -162,6 +178,7 @@ platform/CCThread.cpp \
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/renderer \
$(LOCAL_PATH)/../math/kazmath/include \
platform/android \
$(LOCAL_PATH)/../physics \
@ -171,6 +188,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../../external/chipmunk/include/chipmunk
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/renderer \
$(LOCAL_PATH)/../math/kazmath/include \
$(LOCAL_PATH)/platform/android \
$(LOCAL_PATH)/../physics \

View File

@ -59,8 +59,8 @@ public:
/** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */
static RenderTexture * create(int w, int h);
virtual /** starts grabbing */
void begin();
/** starts grabbing */
virtual void begin();
/** starts rendering to the texture while clearing the texture first.
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. */
inline void endToLua(){ end();};
virtual /** ends grabbing*/
void end();
/** ends grabbing*/
virtual void end();
/** clears the texture with a color */
void clear(float r, float g, float b, float a);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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