Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-20-2011, 12:23 PM   #1 (permalink)
Registered Member
 
SundialSoft's Avatar
 
Join Date: Oct 2010
Location: Scotland
Posts: 176
SundialSoft is on a distinguished road
Default question about pointers to memory - Cocos2D Particles example

There's an iphone app Fluid Toy which uses a particle system. The author released the source of the particles generator http://www.nulldesign.de/wp-content/...icleSystem.zip but I can't use it because I don't know how to access his particles which are created as:-
Code:
	particles = (SimpleParticle *) malloc(sizeof(SimpleParticle) * maxParticles);
The particle system is created
Code:
    particles = [SimpleParticleSystem node];
    [particles initialize: 1000 width: 20 height: 20];
But the code snippet shows accessing the individual particles
Code:
while(count < particles.particleCount)
{
   p = &particleAr[count];
   p->dir.x += CCRANDOM_MINUS1_1();
   p->dir.y += CCRANDOM_MINUS1_1();
and I'm stuck understanding how particleAr is defined. It's some sort of pointer to the memory containing the particles.

Any suggestions on how to get this working would be welcome.
It's a Cocos2d / 3D demo I'm working on and the built-in particles don't do exactly what I want.

Thanks in advance.
SundialSoft is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 383
17 members and 366 guests
7twenty7, Apptronics RBC, baja_yu, chiataytuday, Clouds, dedeys78, dre, Duncan C, e2applets, ipodphone, jeroenkeij, leostc, matador1978, mbadegree, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0