Skip to content

Commit 74a0b5e

Browse files
committed
The stats label shouldn’t include its own draw call. Lots of confusion about that.
1 parent d4568ee commit 74a0b5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos2d/CCDirector.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,8 @@ -(void) showStats
864864
NSString *fpsstr = [[NSString alloc] initWithFormat:@"%.1f", _frameRate];
865865
[_FPSLabel setString:fpsstr];
866866

867-
NSString *draws = [[NSString alloc] initWithFormat:@"%4lu", (unsigned long)__ccNumberOfDraws];
867+
// Subtract one to exclude the batch for actually rendering the stats label itself.
868+
NSString *draws = [[NSString alloc] initWithFormat:@"%4lu", (unsigned long)__ccNumberOfDraws - 1];
868869
[_drawsLabel setString:draws];
869870
}
870871

0 commit comments

Comments
 (0)