@riq thanks, and sorry about that, i don't even checked if this issue already open.
cocos2d v0.9.0-alpha released
(40 posts) (11 voices)-
Posted 2 years ago #
-
@riq any change to cocos2d have an option to show actual texture Memory being used in Cocos2d?
like that:
// code from here: http://developers.enormego.com/view/iphone_sdk_available_memory +(double) getAvailableBytes { vm_statistics_data_t vmStats; mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT; kern_return_t kernReturn = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount); if (kernReturn != KERN_SUCCESS) { return NSNotFound; } return (vm_page_size * vmStats.free_count); } +(double) getAvailableKiloBytes { return [Utilities getAvailableBytes] / 1024.0; } +(double) getAvailableMegaBytes { return [Utilities getAvailableKiloBytes] / 1024.0; } //Something like: [[CCDirector sharedDirector] setDisplayMemoryUsed:YES];Posted 2 years ago # -
I get a lot of linking errors when trying to use the compatibility mode. This was from a newly created cocos2d chipmunk template and then I imported my files from another project. The only fix seems to be to manual change the names of everything with the CC namespace.
".objc_class_name_AtlasSprite", referenced from:
".objc_class_name_EaseIn", referenced from:
".objc_class_name_FadeIn", referenced from:
".objc_class_name_PageTurnTransition", referenced from:
".objc_class_name_Sequence", referenced from:
".objc_class_name_StopGrid", referenced from:
Posted 2 years ago # -
@riq one question.
I using zwoptex to mostly of my sprites, but sometimes i want o use some sprites normal, can i add to the sharedTextureCash my image? or for this case i must create a CCSpriteSheet for my image?
Posted 2 years ago # -
I am back to my previous post about child order and atlas indexes of 4123412323. I don't have a good code sample yet because this is very buried in my code, but looking at the logic in CCSprite for nesting nodes I am fairly sure I see the problem. I haven't updated my trunk in a week or so, so this may have been fixed but ill elaborate on the problem and you can give me your thoughts.
If you look at CCSpriteSheet,
-(NSUInteger)atlasIndexForChild:(CCSprite*)sprite atZ:(int)z
For a newly added sprite it will be the 0th child. So take the example of where the first thing on the atlas before you add this, is the guy who USED to be 0th child before your guy was added to the parent.
It will go down the childIndex==0 branch because the new guy we are adding is at the front of the children list. I am trying to add this guy behind everybody else so -1 z, means we go down this branch:
if( z < 0 && [brothers count] > 1 )
{
return [self lowestAtlasIndexInChild:next] -1;
}That function takes our next(child at index 1) and takes his atlas index -1. However he is currently # 0 in the atlas index so that gives us -1. This function deals with unsigned ints and so you end up with max int.
If you don't think this is a correct analaysis let me know and I will try to create this as a stand alone entitiy for verification.
P.S Has much changed since about 2 weeks ago on the trunk? I want to do an update but only if there are some important fixes.Posted 2 years ago # -
@greyhoundgames: Can you reproduce it ? If so, could you open a bug on the issue tracker with the code to reproduce it ? thanks.
If you are using cocos2d from SVN I suggest subscribing to the "SVN feeds":
http://code.google.com/p/cocos2d-iphone/feedsYou will receive information about each commit, so you can decide whether or not to do an
SVN update.Posted 2 years ago # -
I will repro it this weekend for you and also include the zorder thing I mentioned 15 or so posts ago if that is still an issue(though this -1 z thing can preclude putting sprites behind each other). While you are around a quick question. I have a ccsprite that is a regular ccsprite with one new function called step which i call from my main loop. It comes from the same atlas/sprite sheet as all the other sprites and is attached to the same parent as some of them are. It works perfectly on the simulator but on the device I cannot see it. Any thoughts?
Posted 2 years ago # -
@greyhoundgames: No idea :( Try to put some breakpoints to see why it is not called on the device. If you are using
idin your code, try to replace it with the the real object:
// replace this code id action = [RotateBy...]; // with this one: RotateBy *action = [RotateB...];just to see any possible compiler warning (and the error). Let's continue talking this issue in another thread.
Posted 2 years ago #
Reply
You must log in to post.