[Kde-games-devel] Introducing Goldberg Slicer & myself
Stefan Majewsky
kdemailinglists at bethselamin.de
Wed May 26 09:20:00 CEST 2010
Am Dienstag, 25. Mai 2010, 23:11:35 schrieb Johannes Loehnert:
> I just commited the code into
> trunk/playground/games/palapeli-goldberg-slicer. You can find overview,
> installation and usage instructions on the old project page:
> http://code.google.com/p/palapeli-goldberg-slicer/
> If you are interested, I would be very happy if you would try it out, or
> even better, have a look at the code and tell me what can be improved. :-)
I have changed the buildsystem to conform with our standard building methods.
Johannes, if I broke your build, sorry. I'll explain that to you later this
day. ;-)
From the code review side, I've only had a quick look so far, but what
immediately caught my eye is that you're using calculated floating-point
constants, for example:
> src/grid-rotrex.cpp
> 46: const double _R3 = 1.7320508075689;
> src/utilities.h
> 27:inline double dsin(double angle) { return sin(angle* 0.01745329222); }
Could you please change these into the respective readable expressions, such
as:
> src/grid-rotrex.cpp
> 46: const double _R3 = sqrt(3.0);
> src/utilities.h
> 27:inline double dsin(double angle) { return sin(angle * M_PI / 180.0); }
The compiler will fold these expressions into the same constants, but the code
becomes much more readable.
You might want to consider moving from the double type to qreal, which is
either double or float, depending on which precision is more efficient on the
respective platform.
Greetings
Stefan
More information about the kde-games-devel
mailing list