[SDL] New SDL app : LaserBoy Multiplatform
Ulrich Eckhardt
doomster at knuut.de
Tue Apr 29 03:28:00 PDT 2008
On Monday 28 April 2008 08:55:35 another james wrote:
> Check it out!
>
> http://akrobiz.com/laserboy/code/LaserBoy_04_27_2008.zip
>
> Let me know what you think!
I just changed the makefile:
-CXXFLAGS = -O3 -pg -g3
+CXXFLAGS = -O3 -pg -g3 -W -Wextra
and then started compiling. Apart from a few warnings that may or may not
indicate broken code, there is one that is really serious:
ez_ilda_frame_set.cpp: In member function ‘int
ez_ilda_frame_set::from_dxf_directory(std::string, bool)’:
ez_ilda_frame_set.cpp:329: warning: comparison is always false due to
limited range of data type
This comes from code like this:
char c;
...
c = getc(..);
if(c==EOF)
The problem is that 'c' must be an 'int' for things like that to work. It
might work correctly on your system if 'char' is signed there like 'int', but
on my system 'char' is unsigned (C/C++ say it's implementation defined
if 'char' is signed or unsigned).
Another thing you do a few times is that you are deriving from a vector but
you are not using vector's copy constructor in order to implement that class'
copy constructor. Seems like a waste of typing to me.
Anyway, your program seems to do what it is supposed to do. I can switch
between the different layouts and they all seem to render correctly.
BTW: In fact I'm rather impressed by the electronics and the photos you made
with the laser connected to it. Is there some more documentation available?
In particular I wonder how the timing is determined. I actually even have a
professional interest (working for http://www.satorlaser.com), though our
aims there (marking on surfaces) are a bit different to what you are doing.
cheers from Hamburg
Uli
More information about the SDL
mailing list