Skip to content

Commit b6faa36

Browse files
James Chenstevetranby
authored andcommitted
tryfix merge
1 parent fd063f0 commit b6faa36

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

cocos/2d/CCActionManager.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ class CC_DLL ActionManager : public Ref
6161
/**
6262
* @js ctor
6363
*/
64-
ActionManager();
64+
ActionManager(void);
6565

6666
/**
6767
* @js NA
6868
* @lua NA
6969
*/
70-
virtual ~ActionManager();
70+
~ActionManager(void);
7171

7272
// actions
7373

@@ -80,55 +80,55 @@ class CC_DLL ActionManager : public Ref
8080
* @param target The target which need to be added an action.
8181
* @param paused Is the target paused or not.
8282
*/
83-
virtual void addAction(Action *action, Node *target, bool paused);
83+
void addAction(Action *action, Node *target, bool paused);
8484

8585
/** Removes all actions from all the targets.
8686
*/
87-
virtual void removeAllActions();
87+
void removeAllActions();
8888

8989
/** Removes all actions from a certain target.
9090
All the actions that belongs to the target will be removed.
9191
*
9292
* @param target A certain target.
9393
*/
94-
virtual void removeAllActionsFromTarget(Node *target);
94+
void removeAllActionsFromTarget(Node *target);
9595

9696
/** Removes an action given an action reference.
9797
*
9898
* @param action A certain target.
9999
*/
100-
virtual void removeAction(Action *action);
100+
void removeAction(Action *action);
101101

102102
/** Removes an action given its tag and the target.
103103
*
104104
* @param tag The action's tag.
105105
* @param target A certain target.
106106
*/
107-
virtual void removeActionByTag(int tag, Node *target);
107+
void removeActionByTag(int tag, Node *target);
108108

109109
/** Removes all actions given its tag and the target.
110110
*
111111
* @param tag The actions' tag.
112112
* @param target A certain target.
113113
* @js NA
114114
*/
115-
virtual void removeAllActionsByTag(int tag, Node *target);
115+
void removeAllActionsByTag(int tag, Node *target);
116116

117117
/** Removes all actions matching at least one bit in flags and the target.
118118
*
119119
* @param flags The flag field to match the actions' flags based on bitwise AND.
120120
* @param target A certain target.
121121
* @js NA
122122
*/
123-
virtual void removeActionsByFlags(unsigned int flags, Node *target);
123+
void removeActionsByFlags(unsigned int flags, Node *target);
124124

125125
/** Gets an action given its tag an a target.
126126
*
127127
* @param tag The action's tag.
128128
* @param target A certain target.
129129
* @return The Action the with the given tag.
130130
*/
131-
virtual Action* getActionByTag(int tag, const Node *target) const;
131+
Action* getActionByTag(int tag, const Node *target) const;
132132

133133
/** Returns the numbers of actions that are running in a certain target.
134134
* Composable actions are counted as 1 action. Example:
@@ -170,37 +170,37 @@ class CC_DLL ActionManager : public Ref
170170
* @see getNumberOfRunningActionsInTarget
171171
* @js NA
172172
*/
173-
virtual size_t getNumberOfRunningActionsInTargetByTag(const Node *target, int tag);
173+
size_t getNumberOfRunningActionsInTargetByTag(const Node *target, int tag);
174174

175175

176176
/** Pauses the target: all running actions and newly added actions will be paused.
177177
*
178178
* @param target A certain target.
179179
*/
180-
virtual void pauseTarget(Node *target);
180+
void pauseTarget(Node *target);
181181

182182
/** Resumes the target. All queued actions will be resumed.
183183
*
184184
* @param target A certain target.
185185
*/
186-
virtual void resumeTarget(Node *target);
186+
void resumeTarget(Node *target);
187187

188188
/** Pauses all running actions, returning a list of targets whose actions were paused.
189189
*
190190
* @return A list of targets whose actions were paused.
191191
*/
192-
virtual Vector<Node*> pauseAllRunningActions();
192+
Vector<Node*> pauseAllRunningActions();
193193

194194
/** Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
195195
*
196196
* @param targetsToResume A set of targets need to be resumed.
197197
*/
198-
virtual void resumeTargets(const Vector<Node*>& targetsToResume);
198+
void resumeTargets(const Vector<Node*>& targetsToResume);
199199

200200
/** Main loop of ActionManager.
201201
* @param dt In seconds.
202202
*/
203-
virtual void update(float dt);
203+
void update(float dt);
204204

205205
protected:
206206
// declared in ActionManager.m
Binary file not shown.

cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ bool _isFpsChanged = false;
111111
float _oldRealFps = 60.0f;
112112

113113
uint32_t _lowFpsCheckMode = 0; // 0: Continuous mode, 1: Average mode
114-
float _lowRealFpsThreshold = 0.5f; // Unit: percentage (0 ~ 1)
114+
float _lowRealFpsThreshold = 0.25f; // Unit: percentage (0 ~ 1)
115115
std::chrono::steady_clock::time_point _lastTimeNotifyLevelByLowFps; // Only used in continuous mode
116-
float _notifyLevelByLowFpsThreshold = 0.5f; // Unit: seconds, only used in continuous mode
116+
float _notifyLevelByLowFpsThreshold = 0.2f; // Unit: seconds, only used in continuous mode
117117
uint32_t _continuousLowRealFpsCount = 0; // Only used in continuous mode
118118
uint32_t _continuousLowRealFpsThreshold = 1; // Only used in continuous mode
119119
uint32_t _calculateAvgFpsCount = 0; // Only used in average mode
@@ -1223,38 +1223,38 @@ void EngineDataManager::nativeOnChangeLowFpsConfig(JNIEnv* env, jobject thiz, ji
12231223

12241224
void EngineDataManager::nativeOnChangeExpectedFps(JNIEnv* env, jobject thiz, jint fps)
12251225
{
1226-
if (!_isSupported)
1227-
return;
1228-
1229-
if (fps < -1 || fps > 60)
1230-
{
1231-
LOGE("Setting fps (%d) isn't supported!", fps);
1232-
return;
1233-
}
1234-
1235-
auto director = cocos2d::Director::getInstance();
1236-
float defaultAnimationInterval = director->getAnimationInterval();
1237-
1238-
int defaultFps = static_cast<int>(std::ceil(1.0f/defaultAnimationInterval));
1239-
1240-
if (fps > defaultFps)
1241-
{
1242-
LOGD("nativeOnChangeExpectedFps, fps (%d) is greater than default fps (%d), reset it to default!", fps, defaultFps);
1243-
fps = -1;
1244-
}
1245-
1246-
LOGD("nativeOnChangeExpectedFps, set fps: %d, default fps: %d", fps, defaultFps);
1247-
1248-
if (fps > 0)
1249-
{
1250-
setAnimationIntervalBySystem(1.0f/fps);
1251-
LOGD("nativeOnChangeExpectedFps, fps (%d) was set successfuly!", fps);
1252-
}
1253-
else if (fps == -1) // -1 means to reset to default FPS
1254-
{
1255-
setAnimationIntervalBySystem(-1.0f);
1256-
LOGD("nativeOnChangeExpectedFps, fps (%d) was reset successfuly!", defaultFps);
1257-
}
1226+
// if (!_isSupported)
1227+
// return;
1228+
1229+
// if (fps < -1 || fps > 60)
1230+
// {
1231+
// LOGE("Setting fps (%d) isn't supported!", fps);
1232+
// return;
1233+
// }
1234+
1235+
// auto director = cocos2d::Director::getInstance();
1236+
// float defaultAnimationInterval = director->getAnimationInterval();
1237+
1238+
// int defaultFps = static_cast<int>(std::ceil(1.0f/defaultAnimationInterval));
1239+
1240+
// if (fps > defaultFps)
1241+
// {
1242+
// LOGD("nativeOnChangeExpectedFps, fps (%d) is greater than default fps (%d), reset it to default!", fps, defaultFps);
1243+
// fps = -1;
1244+
// }
1245+
1246+
// LOGD("nativeOnChangeExpectedFps, set fps: %d, default fps: %d", fps, defaultFps);
1247+
1248+
// if (fps > 0)
1249+
// {
1250+
// setAnimationIntervalBySystem(1.0f/fps);
1251+
// LOGD("nativeOnChangeExpectedFps, fps (%d) was set successfuly!", fps);
1252+
// }
1253+
// else if (fps == -1) // -1 means to reset to default FPS
1254+
// {
1255+
// setAnimationIntervalBySystem(-1.0f);
1256+
// LOGD("nativeOnChangeExpectedFps, fps (%d) was reset successfuly!", defaultFps);
1257+
// }
12581258
}
12591259

12601260
void EngineDataManager::nativeOnChangeSpecialEffectLevel(JNIEnv* env, jobject thiz, jint level)

0 commit comments

Comments
 (0)