Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CToxiConfig.cpp

Go to the documentation of this file.
00001 
00009 /* 
00010         ---- Copyright (C) 2002  Jose Eduardo R. Mourão (eduardo_rdm@hotmail.com) ----
00011           
00012         This file is part of ToxiTea.
00013 
00014     ToxiTea is free software; you can redistribute it and/or modify
00015     it under the terms of the GNU General Public License as published by
00016     the Free Software Foundation; either version 2 of the License, or
00017     (at your option) any later version.
00018 
00019     ToxiTea is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022     GNU General Public License for more details.
00023 
00024     You should have received a copy of the GNU General Public License
00025     along with ToxiTea; if not, write to the Free Software
00026     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 
00028         For more information and updates visit: 
00029         http://toxitea.sourceforge.net
00030         or mail to: eduardo_rdm@hotmail.com
00031 
00032         COMPILING AND/OR USING YOU ARE ACCEPTING ALL TERMS ABOVE.
00033         THIS LICENSE CAN BE CHANGED ANY TIME FOR ANY REASON WITHOUT NO COMMUNICATION.
00034 */
00035 
00040 #include "CToxiConfig.h"
00041 
00043 CToxiConfig::CToxiConfig()
00044 {
00045         this->_bits=0;
00046         this->_fullscreen=false;
00047         this->_loop_auto_start=false;
00048         this->_width=0;
00049         this->_height=0;
00050         this->_xLocation=0;
00051         this->_yLocation=0;
00052         this->_title="Untitled Window - ToxiTea.";
00053         this->_active=true;
00054 }
00055 
00057 CToxiConfig::~CToxiConfig()
00058 {
00059 
00060 }
00061 
00062 void CToxiConfig::setWindowSize(int windowWidth,int windowHeight)
00063 {
00064         if((windowWidth < 0) && (windowWidth > 1600*2)) 
00065                 windowWidth = 640;
00066         else 
00067                 this->_width = windowWidth;
00068         if((windowHeight < 0) && (windowHeight > 1200*2)) 
00069                 windowHeight = 480;
00070         else 
00071                 this->_width = windowHeight;
00072 }
00073 
00074 void CToxiConfig::setWindowLocation(int locationX,int locationY)
00075 {
00076         if((locationY < 0) && (locationY > 1600*2))
00077                 _yLocation=0;
00078         else
00079                 this->_yLocation=locationY;
00080 
00081         if((locationX < 0) && (locationX > 1600*2))
00082                 locationX=0;
00083         else
00084                 this->_xLocation=locationX;
00085 }
00086 
00087 void CToxiConfig::setWindowColorBits(int depthBits)
00088 {
00089         if((depthBits < 8) && (depthBits > 64))
00090                 depthBits = 8;
00091         else
00092                 this->_bits=depthBits;
00093 }
00094 
00095 void CToxiConfig::setFullscreen(bool fullscreen)
00096 {
00097         if(fullscreen)
00098                 this->_fullscreen=true;
00099         else
00100                 this->_fullscreen=false;
00101 }
00102 
00103 void CToxiConfig::setAutomaticStart(bool automaticStart)
00104 {
00105         if(automaticStart)
00106                 this->_loop_auto_start=true;
00107         else
00108                 this->_loop_auto_start=false;
00109 }
00110 
00111 void CToxiConfig::setWindowTitle(char *windowTitle)
00112 {
00113         this->_title=windowTitle;
00114 }
00115 
00116 void CToxiConfig::setWindowActive(bool active)
00117 {
00118         if(active)
00119                 this->_active=true;
00120         else
00121                 this->_active=false;
00122 }
00123 
00124 int CToxiConfig::getWindowWidth()
00125 {
00126         return this->_width;
00127 }
00128 
00129 int CToxiConfig::getWindowHeight()
00130 {
00131         return this->_height;
00132 }
00133 
00134 int CToxiConfig::getWindowColorBits()
00135 {
00136         return this->_bits;
00137 }
00138 
00139 bool CToxiConfig::getFullscreen()
00140 {
00141         return this->_fullscreen;
00142 }
00143 
00144 bool CToxiConfig::getAutomaticStart()
00145 {
00146         return this->_loop_auto_start;
00147 }
00148 
00149 char* CToxiConfig::getWindowTitle()
00150 {
00151         return this->_title;
00152 }
00153 
00154 
00155 bool CToxiConfig::getWindowActive()
00156 {
00157         return this->_active;
00158 }
00159 
00160 void CToxiConfig::setDefaultParams()
00161 {
00162         this->_bits=16;
00163         this->_fullscreen=false;
00164         this->_loop_auto_start=false;
00165         this->_width=640;
00166         this->_height=480;
00167         this->_xLocation=0;
00168         this->_yLocation=0;
00169         this->_active=true;
00170 }

Generated on Mon Sep 23 23:07:01 2002 for ToxiTea by doxygen1.2.18