|
Josh @ Dreamland
|
|
Reply #1 Posted on: August 26, 2010, 11:18:57 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
My biggest suggestions are to reduce your draw_set_color() calls (by calling one up front of the loop instead of letting the graphics system call the equivalent literally 80,000 times) and to use C++ types more often. I noticed your implementation has a few workarounds in it. I will do my best to remove the need for such. I have already made one improvement to allow further optimization of your game. Please check out the latest revision. I have implemented my suggestions here: http://dl.dropbox.com/u/1052740/watersimulation.gmkCheers.
|
|
« Last Edit: August 26, 2010, 11:24:23 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
|
|
|
|
r9k
|
|
Reply #3 Posted on: August 27, 2010, 10:08:25 am |
|
|
Joined: Aug 2010
Posts: 25
|
Ok I did a clean update and this fixed my draw problem. But, I can't get your version to work. I had to create an endian.h by the way, because I'm on windows. I noticed some things : I can't put a variable between array brackets, it generates an error. and I can't do this : local float block1[160*120]; local float *buffer1; buffer1 = block1;
I get Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37: error: cannot convert `float[19200]' to `float' in assignment
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #4 Posted on: August 27, 2010, 01:27:14 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The latter problem you describe is exactly what the latest revision fixes... I'll investigate. I'll remove the dependency on endian.h; it figures it was too useful to be available on Windows.
|
|
|
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 #7 Posted on: August 27, 2010, 05:06:49 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
So, then. What's it like to program with C++?
|
|
|
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
|
|
|
|
|
|