trimming the fat

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sun May 24, 2009 7:28 pm

is it okay to get rid of:

[code:2v972zq8] float x; // X co-ordinate (top left point)
float y; // Y co-ordinate (top left point)
float w; // Width
float h; // Height
float angle; // Rotation angle
float displayangle; // Actual displayed angle
bool isMirrored;
bool isFlipped;[/code:2v972zq8]

or
[code:2v972zq8]
float HotSpotX; // Offset from the top left point
float HotSpotY; // Offset from the top left point
float HotSpotAngle; // Hotspot in polar form
float HotSpotDist;[/code:2v972zq8]

if an object isn't going to be drawn at all?
or will it cause problems
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun May 24, 2009 7:54 pm

Why?
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun May 24, 2009 7:58 pm

I just figured it might increase the number of objects I can have if the struct was significantly smaller
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun May 24, 2009 8:00 pm

No you can't, and the saving is literally a few bytes anyway, so it wouldn't be worth it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun May 24, 2009 9:37 pm

k
thanks rich
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun May 24, 2009 9:46 pm

If you change that struct you will change all the memory offsets used by the runtime and your plugin will completely break, not to mention the fact that the memory saving would be so tiny, you probably couldn't even measure a difference.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun May 24, 2009 9:52 pm

Yeah, the memory offsetting would break things.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests