Shape.cc

Go to the documentation of this file.
00001 /*
00002 RealTimeBattle, a robot programming game for Unix
00003 Copyright (C) 1998-2000  Erik Ouchterlony and Ragnar Ouchterlony
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software Foundation,
00017 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifdef HAVE_CONFIG_H
00021 #include <config.h>
00022 #endif
00023 
00024 #include <math.h>
00025 #include <iostream>
00026 
00027 using namespace std;
00028 
00029 //#include "Gui.h"
00030 #include "Shape.h"
00031 #include "Various.h"
00032 #include "Options.h"
00033 
00034 extern class Options the_opts;
00035 
00036 Shape::Shape()
00037 {
00038   set_colour(the_opts.get_l(OPTION_FOREGROUND_COLOUR));
00039 }
00040 
00041 Shape::Shape(int long colour)
00042 {
00043   set_colour(colour);
00044 }
00045 
00046 void
00047 Shape::set_colour(long int colour)
00048 {
00049   rgb_colour = colour;
00050 #ifndef NO_GRAPHICS
00051   gdk_colour = make_gdk_colour( colour );
00052 #endif
00053 }
00054 
00055 #ifndef NO_GRAPHICS
00056 
00057 void
00058 Shape::set_colour(const GdkColor& colour)
00059 {
00060   gdk_colour = colour;
00061   rgb_colour = gdk2hex_colour( colour );
00062 }
00063 
00064 #endif

Generated on Fri Oct 15 15:47:38 2004 for Real Time Battle by  doxygen 1.3.9.1