|
Josh @ Dreamland
|
|
Reply #16 Posted on: February 20, 2010, 11:00:32 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
A bounds check every time a sprite is drawn? That's just one of them that really sticks in my mind. I might prevent the untimely death of the game by modding the index by the number of sprites, but aside from that... Hell, I wouldn't even just mod it. I'd waste another ((1 << ceil(log2(sprite_count))) - sprite_count) * sizeof(sprite_struct*) bytes (as in, wrap the sprites to a greater power of two) and use an & instead.
It's the little, "oh, this won't really hurt anything" ideas that end up in projects behaving like GM. "Oh, all those local variables are negligible." "Oh, using a map to store array elements won't slow anything." Whatever I can save, I will, or it'll all build up into slow gunk.
Also, score_, I'm not sure if all structs are compile-only in the sense that they will not affect size if unused. I'm thinking vtables might be stored regardless (Not a C thing).
|
|
« Last Edit: February 20, 2010, 11:02:11 pm by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #18 Posted on: February 21, 2010, 12:38:37 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Well, I meant more like being able to check functions only in certain moments where the user would want it using the functions, hopefully without too major speed loss. E.g. you could call "error_start()" to start being error checking session and "error_stop()" to stop it, or perhaps "error_object(obj, true)" to check for errors that occur within a certain object and "error_object(obj, false)". Just suggesting... The former (error_start) leaves two options. 1) Have an if() to check if it's enabled, which wastes the same a mount of time as just doing the damn error checking 2) Use function pointers that can be swapped on error_start(), which removes any chance of inlining. The latter (error_object) is a terrible idea by any standard. Now instead of one if(), we're looking up whether we are supposed to be generating errors for that object in a... map? Array? Either of them are awful in one way or another (map's lookup time, array's allocation time). I'd be better off just leaving the errors than to add functions for them, but I'd rather not have them when they aren't needed.
|
|
« Last Edit: February 21, 2010, 12:40:56 pm by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|
serprex
|
|
Reply #23 Posted on: February 22, 2010, 10:46:12 pm |
|
|
Smooth ER
Joined: Apr 2008
Posts: 106
|
(03:18:56) Nark Pvermars: draw_mandlebrot (03:18:57) Nark Pvermars: do it (03:18:58) Nark Pvermars: fgt Enigma now supports more drawing functions than GM. At least 2dwise, for now. But don't worry, we'll have d3d_draw_mandlebrot to beat YYG there too when the time comes And d3d_draw_mandlebrot will have an UNMANLY label too
|
|
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #25 Posted on: February 23, 2010, 05:17:23 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Oh yes, that's funny. I'm dyslexic, asshole. ...haha. Fine, maybe I just can't spell old dead people.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #27 Posted on: February 23, 2010, 05:21:34 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
BAHAHAHAHAHAHAHAHAHAHHAHAHAHA How'd the documentation for that look?
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
freezway
|
|
Reply #29 Posted on: February 23, 2010, 10:18:35 pm |
|
|
Joined: Dec 2009
Posts: 220
|
just checked it... not only is there cr_arrrow there is ALSO the correct spelling... cr_arrow.
|
|
|
Logged
|
if you drop a cat with buttered toast strapped to its back, which side lands down? joshdreamland: our languages are based on the idea that it's going to end up FUBAR /kick retep998
|
|
|
|