[Frontierproject-cvs] frontierproject/src FrontierClient.cpp,NONE,1.1 ClientObjects.cpp,1.3,1.4 Colo
Status: Pre-Alpha
Brought to you by:
bdragon28
Update of /cvsroot/frontierproject/frontierproject/src In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31984/src Modified Files: ClientObjects.cpp ColorListItem.cpp DebugConsole.cpp Entity.cpp Tech.cpp autoTarget.cpp event.cpp gui_Host.cpp gui_joingame.cpp gui_mainscreen.cpp gui_racewizard.cpp gui_shipdesigner.cpp gui_splashscreen.cpp hullTech.cpp luaIface.cpp main.cpp v_FIO.cpp v_Fleet.cpp v_Starbase.cpp widget_componentpopup.cpp widget_componenttray.cpp widget_fleetsummary.cpp widget_mineraltable.cpp widget_painter.cpp widget_selectionsummary.cpp widget_shipbuildview.cpp Added Files: FrontierClient.cpp Log Message: Got a lot done today. Index: main.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/main.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.cpp 16 May 2006 19:58:12 -0000 1.10 --- main.cpp 18 May 2006 07:08:20 -0000 1.11 *************** *** 61,65 **** Bdragon */ ! #include <fx.h> #include "event.h" Event *evh; --- 61,65 ---- Bdragon */ ! #include "FrontierClient.h" #include "event.h" Event *evh; Index: gui_shipdesigner.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_shipdesigner.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gui_shipdesigner.cpp 16 May 2006 22:42:17 -0000 1.9 --- gui_shipdesigner.cpp 18 May 2006 07:08:20 -0000 1.10 *************** *** 204,208 **** using FreeStars::Rules; using FreeStars::Component; - using FreeStars::TheGame; FXString s; --- 204,207 ---- Index: gui_Host.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_Host.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gui_Host.cpp 20 Jul 2005 02:34:37 -0000 1.1 --- gui_Host.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 25,30 **** * */ - #include <fx.h> #include "gui_Host.h" --- 25,30 ---- * */ + #include "FrontierClient.h" #include "gui_Host.h" Index: ClientObjects.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/ClientObjects.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClientObjects.cpp 14 May 2006 05:22:11 -0000 1.3 --- ClientObjects.cpp 18 May 2006 07:08:20 -0000 1.4 *************** *** 22,25 **** --- 22,27 ---- //2005 + + #include "FrontierClient.h" *************** *** 41,45 **** std::deque<FreeStars::Component*> CGame::GetCompenentsByType(FreeStars::ComponentType type) { ! using FreeStars::TheGame; using FreeStars::Component; using std::deque; --- 43,47 ---- std::deque<FreeStars::Component*> CGame::GetCompenentsByType(FreeStars::ComponentType type) { ! // using FreeStars::TheGame; using FreeStars::Component; using std::deque; *************** *** 63,67 **** using std::deque; using FreeStars::Component; ! using FreeStars::TheGame; const deque<Component*> cl = TheGame->GetComponents(); --- 65,69 ---- using std::deque; using FreeStars::Component; ! // using FreeStars::TheGame; const deque<Component*> cl = TheGame->GetComponents(); *************** *** 72,73 **** --- 74,89 ---- return 0; } + + /*void CGalaxy::GetWormholes( + std::deque<FreeStars::Wormhole*>::const_iterator& b, + std::deque<FreeStars::Wormhole*>::const_iterator& e) + { + b=mWormholes.begin(); + e=mWormholes.end(); + } + */ + + const std::deque<FreeStars::Wormhole*> &CGalaxy::GetWormholes() + { + return mWormholes; + } Index: v_Fleet.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/v_Fleet.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** v_Fleet.cpp 17 May 2006 04:59:35 -0000 1.7 --- v_Fleet.cpp 18 May 2006 07:08:20 -0000 1.8 *************** *** 70,74 **** void v_Fleet::setFleet(const FreeStars::Fleet* fleet) { ! using FreeStars::TheGame; setHeader(fleet->GetName(TheGame->GetCurrentPlayer()).c_str()); //pic->setImage(en.getPlanetIcon(fleet->->PICTURE)); --- 70,74 ---- void v_Fleet::setFleet(const FreeStars::Fleet* fleet) { ! // using FreeStars::TheGame; setHeader(fleet->GetName(TheGame->GetCurrentPlayer()).c_str()); //pic->setImage(en.getPlanetIcon(fleet->->PICTURE)); --- NEW FILE: FrontierClient.cpp --- /***************************************************************************** * Copyright (C) 2006 Brandon Bergren * * * * This file is part of The Frontier Project. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * * ****************************************************************************/ // Precompiled header for Frontier #include "FrontierClient.h" Index: widget_componentpopup.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_componentpopup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** widget_componentpopup.cpp 16 May 2006 18:30:40 -0000 1.1 --- widget_componentpopup.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 24,32 **** * Popup component details window. */ ! ! #include <fx.h> #include "widget_componentpopup.h" - #include "FSServer.h" - #include "DebugConsole.h" #include "gdArt.h" --- 24,29 ---- * Popup component details window. */ ! #include "FrontierClient.h" #include "widget_componentpopup.h" #include "gdArt.h" Index: autoTarget.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/autoTarget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** autoTarget.cpp 17 May 2006 20:45:29 -0000 1.1 --- autoTarget.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 27,56 **** #include "FrontierClient.h" ! FXDict *intTargets; ! //std::deque<FXint*> intValues; ! //FXApp *apptr; ! //FXString *dataPath; bool autoTarget::init() { ! intTargets = new FXDict(); return true; } ! FXDataTarget* autoTarget::tieInt(const char *key,FXint def) { ! if(intTargets->find(key)) ! return static_cast<FXDataTarget*>(intTargets->find(key)); FXDataTarget *theTarget; ! FXint *theValue = new FXint; ! *theValue = def; ! theTarget = new FXDataTarget(def); ! intTargets->insert(key,static_cast<void*>(theTarget)); return theTarget; } --- 27,65 ---- #include "FrontierClient.h" ! FXDict *targets; bool autoTarget::init() { ! targets = new FXDict(); //@todo Earlier initialization. return true; } ! template<class T> ! FXDataTarget* doTie(const char* key, T def) { ! if(targets->find(key)) ! return static_cast<FXDataTarget*>(targets->find(key)); FXDataTarget *theTarget; ! T *theValue = new T; ! (*theValue) = def; ! theTarget = new FXDataTarget(*theValue); ! targets->insert(key,static_cast<void*>(theTarget)); return theTarget; } + + + FXDataTarget* autoTarget::tieInt(const char *key,FXint def) + { + return doTie(key,def); + } + + FXDataTarget* autoTarget::tieBool(const char *key,FXbool def) + { + return doTie(key,def); + } \ No newline at end of file Index: widget_fleetsummary.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_fleetsummary.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** widget_fleetsummary.cpp 21 Jul 2005 16:02:26 -0000 1.1 --- widget_fleetsummary.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 19,20 **** --- 19,21 ---- * * ****************************************************************************/ + #include "FrontierClient.h" \ No newline at end of file Index: widget_shipbuildview.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_shipbuildview.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** widget_shipbuildview.cpp 16 May 2006 20:47:08 -0000 1.4 --- widget_shipbuildview.cpp 18 May 2006 07:08:20 -0000 1.5 *************** *** 297,301 **** ! foo.format("%s/data/xml/parttypemap.xml",FXFile::getCurrentDirectory().text()); TiXmlDocument file(foo.text()); --- 297,301 ---- ! foo.format("%s/data/xml/parttypemap.xml",FXSystem::getCurrentDirectory().text()); TiXmlDocument file(foo.text()); Index: widget_painter.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_painter.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** widget_painter.cpp 17 May 2006 20:45:29 -0000 1.19 --- widget_painter.cpp 18 May 2006 07:08:20 -0000 1.20 *************** *** 36,44 **** cursor? */ - - #include <fx.h> - #include <fxkeys.h> - #include <vector> - #include "FrontierClient.h" #include "FrontierTypes.h" --- 36,39 ---- *************** *** 59,62 **** --- 54,58 ---- FXMAPFUNC(SEL_COMMAND, w_Painter::ID_TOGGLE_SHOWPLANETNAMES, w_Painter::onCommand), FXMAPFUNC(SEL_COMMAND, w_Painter::ID_TOGGLE_PLANETVALUEVIEW, w_Painter::onCommand), + // FXMAPFUNC(SEL_UPDATE, w_Painter::ID_UPD_PLANETNAMES, w_Painter::onCommand), }; *************** *** 119,129 **** mpLastSelected = 0; - using FreeStars::TheGalaxy; FXScrollArea::create(); ! tinyFont = new FXFont(getApp(),NULL,7 ); ! smallFont = new FXFont(getApp(),NULL,8 ); ! normalFont = new FXFont(getApp(),NULL,10); ! largeFont = new FXFont(getApp(),NULL,12,FONTWEIGHT_BOLD); ! largestFont = new FXFont(getApp(),NULL,14,FONTWEIGHT_BOLD); tinyFont -> create(); smallFont -> create(); --- 115,124 ---- mpLastSelected = 0; FXScrollArea::create(); ! tinyFont = new FXFont(getApp(),"Tahoma,70"); ! smallFont = new FXFont(getApp(),"Tahoma,80"); ! normalFont = new FXFont(getApp(),"Tahoma,100"); ! largeFont = new FXFont(getApp(),"Tahoma,120,bold"); ! largestFont = new FXFont(getApp(),"Tahoma,140,bold"); tinyFont -> create(); smallFont -> create(); *************** *** 137,142 **** uMaxY = TheGalaxy->MaxY(); ! autoTarget::tieInt("/painter/forceshift",0)->connect(simulateShift); } --- 132,138 ---- uMaxY = TheGalaxy->MaxY(); + d_drawFlags = static_cast<FXbool*>(autoTarget::tieBool("/painter/show/planetnames",true)->getData()); ! simulateShift = static_cast<FXbool*>(autoTarget::tieBool("/painter/forceshift",false)->getData()); } *************** *** 161,171 **** cursory = 0; hasselection=false; ! simulateShift=false; }; void w_Painter::drawScanners(FXDCWindow &dc) { - using FreeStars::TheGalaxy; - using FreeStars::TheGame; FreeStars::Planet *curPlanet; int i; --- 157,165 ---- cursory = 0; hasselection=false; ! //simulateShift=false; }; void w_Painter::drawScanners(FXDCWindow &dc) { FreeStars::Planet *curPlanet; int i; *************** *** 241,245 **** segs[j-1].x2 = u2sx(f->GetOrders().at(j)->GetLocation()->GetPosX()); segs[j-1].y2 = u2sy(f->GetOrders().at(j)->GetLocation()->GetPosY()); ! CLOG("Painter: route line: %s, (%i, %i)-(%i, %i) j=%i\n",f->GetName(FreeStars::TheGame->GetCurrentPlayer()).c_str(),segs[j-1].x1,segs[j-1].y1,segs[j-1].x2,segs[j-1].y2,j); } // nukeDupeSegments(segs,j); --- 235,239 ---- segs[j-1].x2 = u2sx(f->GetOrders().at(j)->GetLocation()->GetPosX()); segs[j-1].y2 = u2sy(f->GetOrders().at(j)->GetLocation()->GetPosY()); ! CLOG("Painter: route line: %s, (%i, %i)-(%i, %i) j=%i\n",f->GetName(TheGame->GetCurrentPlayer()).c_str(),segs[j-1].x1,segs[j-1].y1,segs[j-1].x2,segs[j-1].y2,j); } // nukeDupeSegments(segs,j); *************** *** 283,287 **** { using FreeStars::Fleet; - using FreeStars::TheGame; FXString foo; --- 277,280 ---- *************** *** 380,387 **** void w_Painter::drawWormholes(FXDCWindow &dc) { //@@@ Remove these 3 lines ASAP!!! @@@ ! dc.setForeground(FXRGB(255,0,255)); ! dc.setBackground(FXRGB(255,0,255)); ! dc.drawPoint(u2sx(1079),u2sy(1047)); //@@@ --- 373,399 ---- void w_Painter::drawWormholes(FXDCWindow &dc) { + using std::deque; + using FreeStars::Wormhole; + + CGalaxy* f = dynamic_cast<CGalaxy*>(TheGalaxy); + + //deque<Wormhole*>::const_iterator wh = (dynamic_cast<CGalaxy*>(FreeStars::TheGalaxy))->GetWormholes(); + + const std::deque<FreeStars::Wormhole*> &wh = f->GetWormholes(); + + //dynamic_cast<CGalaxy*>(FreeStars::TheGalaxy)->GetWormholes(start,end); + + for(std::deque<FreeStars::Wormhole*>::const_iterator it=wh.begin();it!=wh.end();++it) + { + CLOG("Wormhole at %u,%u\n",(*it)->GetPosX(),(*it)->GetPosY()); + } + + + + //@@@ Remove these 3 lines ASAP!!! @@@ ! //dc.setForeground(FXRGB(255,0,255)); ! //dc.setBackground(FXRGB(255,0,255)); ! //dc.drawPoint(u2sx(1079),u2sy(1047)); //@@@ *************** *** 391,396 **** { using FreeStars::Planet; - using FreeStars::TheGame; - using FreeStars::TheGalaxy; Planet *curPlanet; int i; --- 403,406 ---- *************** *** 478,483 **** { using FreeStars::Planet; - using FreeStars::TheGalaxy; - using FreeStars::TheGame; int foo; FXint X, Y, W, H; --- 488,491 ---- *************** *** 528,533 **** // In theory, it works. using FreeStars::Planet; - using FreeStars::TheGalaxy; - using FreeStars::TheGame; FXlong X,Y; Planet *curPlanet; --- 536,539 ---- *************** *** 605,609 **** //bar = getHabforPlanet(planet,en.state.thisPlayer); ! bar = 1.0 * FreeStars::TheGame->GetCurrentPlayer()->HabFactor(p) / 100; //bar = 1; //if(bar<0) --- 611,615 ---- //bar = getHabforPlanet(planet,en.state.thisPlayer); ! bar = 1.0 * TheGame->GetCurrentPlayer()->HabFactor(p) / 100; //bar = 1; //if(bar<0) *************** *** 616,620 **** long w_Painter::onRCMenuChoice(FXObject *o, FXSelector, void *) { - using FreeStars::TheGame; FXString foo; int i; --- 622,625 ---- *************** *** 648,652 **** long w_Painter::onRightClick(FXObject *, FXSelector, void *ptr) { - using FreeStars::TheGame; FXEvent *ev = (FXEvent*)ptr; --- 653,656 ---- *************** *** 738,742 **** bool w_Painter::targetFleet(FreeStars::Fleet* f) { - using FreeStars::TheGame; using FreeStars::SpaceObject; ///@todo Better permission checking --- 742,745 ---- *************** *** 763,767 **** long w_Painter::onClick(FXObject *, FXSelector, void *ptr) { - using FreeStars::TheGame; using FreeStars::Planet; using FreeStars::Fleet; --- 766,769 ---- *************** *** 785,791 **** ///// Are we doing a shifted click? ///// ! if(simulateShift || (ev->state & SHIFTMASK)) { ! simulateShift = false; ///// We were last selecting a fleet ///// --- 787,793 ---- ///// Are we doing a shifted click? ///// ! if((*simulateShift) || (ev->state & SHIFTMASK)) { ! (*simulateShift) = false; ///// We were last selecting a fleet ///// Index: luaIface.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/luaIface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** luaIface.cpp 16 May 2006 20:47:08 -0000 1.3 --- luaIface.cpp 18 May 2006 07:08:20 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- * luaIface: Interface for Lua functions. */ + #include "FrontierClient.h" extern "C" *************** *** 33,37 **** } - #include "FrontierClient.h" #include "luaIface.h" --- 34,37 ---- *************** *** 107,113 **** { state = lua_open(); ! lua_baselibopen(state); lua_iolibopen(state); ! lua_mathlibopen(state); // lua_register(state,"debugprint",l_debugprint); } --- 107,113 ---- { state = lua_open(); ! /* lua_baselibopen(state); lua_iolibopen(state); ! lua_mathlibopen(state); */ // lua_register(state,"debugprint",l_debugprint); } *************** *** 121,124 **** void Script::load(const char *filename) { ! lua_dofile(state,filename); } --- 121,125 ---- void Script::load(const char *filename) { ! CLOG("LUA: @@@ port to new API!"); ! //lua_dofile(state,filename); } Index: v_Starbase.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/v_Starbase.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** v_Starbase.cpp 17 May 2006 20:45:29 -0000 1.9 --- v_Starbase.cpp 18 May 2006 07:08:20 -0000 1.10 *************** *** 114,119 **** void v_Starbase::setPlanet(const FreeStars::Planet* planet) { - using FreeStars::TheGame; - FXString foo; --- 114,117 ---- Index: widget_mineraltable.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_mineraltable.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** widget_mineraltable.cpp 16 May 2006 18:52:11 -0000 1.2 --- widget_mineraltable.cpp 18 May 2006 07:08:20 -0000 1.3 *************** *** 32,41 **** ^left align ^right align */ - #include <fx.h> - #include <deque> #include "widget_mineraltable.h" - #include "FSServer.h" - #include "DebugConsole.h" --- 32,38 ---- ^left align ^right align */ + #include "FrontierClient.h" #include "widget_mineraltable.h" Index: hullTech.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/hullTech.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hullTech.cpp 20 Jul 2005 02:34:37 -0000 1.1 --- hullTech.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 25,28 **** --- 25,30 ---- // @FS@ Figure out how to load hulls under Freestars system... + #include "FrontierClient.h" + #if 0 //@FS@ added Index: ColorListItem.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/ColorListItem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ColorListItem.cpp 20 Jul 2005 02:34:37 -0000 1.1 --- ColorListItem.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 1,4 **** /***************************************************************************** ! * Copyright (C) 2005 Brandon Bergren * * * * This file is part of The Frontier Project. * --- 1,4 ---- /***************************************************************************** ! * Copyright (C) 2005,2006 Brandon Bergren * * * * This file is part of The Frontier Project. * *************** *** 19,27 **** * * ****************************************************************************/ ! ! ! // ! ! //Spacing between icon and label --- 19,23 ---- * * ****************************************************************************/ ! #include "FrontierClient.h" //Spacing between icon and label *************** *** 33,43 **** #define LIST_MASK (SELECT_MASK|LIST_AUTOSELECT) - #include <fx.h> #include "ColorListItem.h" FXIMPLEMENT(ColorListItem,FXListItem,NULL,0) - - ColorListItem::ColorListItem(const FXString& text,FXColor tc, FXint q, FXIcon* ic,void* ptr): FXListItem(text,ic,ptr) --- 29,36 ---- Index: gui_joingame.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_joingame.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gui_joingame.cpp 16 May 2006 23:05:36 -0000 1.7 --- gui_joingame.cpp 18 May 2006 07:08:20 -0000 1.8 *************** *** 64,68 **** // this->handle(this,MKUINT(FXDialogBox::ID_ACCEPT,SEL_COMMAND),NULL); //fsBrowser-> ! txtFileName->setText(FXFileDialog::getOpenFilename(this,"Please select the game file.",FXFile::getCurrentDirectory(),"All FreeStars Game Files (*.def,*.hst,*.m*)\nPlayer Files (*.x*)\nHost Files (*.def,*.hst)")); getApp()->reg().writeStringEntry("GUI","jgfilename",txtFileName->getText().text()); return 1; --- 64,68 ---- // this->handle(this,MKUINT(FXDialogBox::ID_ACCEPT,SEL_COMMAND),NULL); //fsBrowser-> ! txtFileName->setText(FXFileDialog::getOpenFilename(this,"Please select the game file.",FXSystem::getCurrentDirectory(),"All FreeStars Game Files (*.def,*.hst,*.m*)\nPlayer Files (*.x*)\nHost Files (*.def,*.hst)")); getApp()->reg().writeStringEntry("GUI","jgfilename",txtFileName->getText().text()); return 1; Index: Entity.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/Entity.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Entity.cpp 16 May 2006 20:47:08 -0000 1.8 --- Entity.cpp 18 May 2006 07:08:20 -0000 1.9 *************** *** 25,28 **** --- 25,29 ---- * */ + #include "FrontierClient.h" #if 0 *************** *** 30,34 **** #define ENTITY_CPP - #include "FrontierClient.h" #include "FrontierTypes.h" --- 31,34 ---- Index: widget_selectionsummary.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_selectionsummary.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** widget_selectionsummary.cpp 21 Jul 2005 16:02:26 -0000 1.1 --- widget_selectionsummary.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 19,20 **** --- 19,21 ---- * * ****************************************************************************/ + #include "FrontierClient.h" \ No newline at end of file Index: DebugConsole.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/DebugConsole.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DebugConsole.cpp 16 May 2006 20:47:08 -0000 1.9 --- DebugConsole.cpp 18 May 2006 07:08:20 -0000 1.10 *************** *** 132,139 **** exit(10); //@@@ ! lua_baselibopen(vm); lua_iolibopen(vm); lua_strlibopen(vm); ! lua_mathlibopen(vm); lua_register(vm,"debugprint",l_debugprint); --- 132,139 ---- exit(10); //@@@ ! /* lua_baselibopen(vm); lua_iolibopen(vm); lua_strlibopen(vm); ! lua_mathlibopen(vm); */ lua_register(vm,"debugprint",l_debugprint); *************** *** 222,226 **** // For now, dump components. print("Dumping components.\n"); ! const std::deque<FreeStars::Component*> c = FreeStars::TheGame->GetComponents(); for(std::deque<FreeStars::Component*>::const_iterator i = c.begin(); i!=c.end(); ++i) --- 222,226 ---- // For now, dump components. print("Dumping components.\n"); ! const std::deque<FreeStars::Component*> c = TheGame->GetComponents(); for(std::deque<FreeStars::Component*>::const_iterator i = c.begin(); i!=c.end(); ++i) *************** *** 240,244 **** if(parsed==false) { ! l_ckerr(vm,lua_dostring(vm, cmd.text())); parsed = true; //@@@ } --- 240,245 ---- if(parsed==false) { ! CLOG("NOT EVALUATING -- @@@ need to convert to lua 5.1"); ! //l_ckerr(vm,lua_dostring(vm, cmd.text())); parsed = true; //@@@ } *************** *** 269,274 **** long debugConsole::doBut1(FXObject*,FXSelector,void* ev) { - using FreeStars::TheGame; - //FXEvent* event = static_cast<FXEvent*>(ev); --- 270,273 ---- *************** *** 334,338 **** { case SEL_RIGHTBUTTONPRESS: ! testcom->setComponent(FreeStars::TheGame->GetComponents().at(13)); testpop->popup(this,30,30); break; --- 333,337 ---- { case SEL_RIGHTBUTTONPRESS: ! testcom->setComponent(TheGame->GetComponents().at(13)); testpop->popup(this,30,30); break; Index: gui_mainscreen.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_mainscreen.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** gui_mainscreen.cpp 17 May 2006 20:45:29 -0000 1.15 --- gui_mainscreen.cpp 18 May 2006 07:08:20 -0000 1.16 *************** *** 162,167 **** // Toolbar implement ! new FXToggleButton(toolbar, NULL, NULL, gdArt::getIcon("/gui/flag"), gdArt::getIcon("/gui/flag"), playarea, w_Painter::ID_TOGGLE_PLANETVALUEVIEW,TOGGLEBUTTON_NORMAL|TOGGLEBUTTON_KEEPSTATE); ! new FXToggleButton(toolbar, NULL, NULL, gdArt::getIcon("/gui/togglenames"),gdArt::getIcon("/gui/togglenames"),playarea,w_Painter::ID_TOGGLE_SHOWPLANETNAMES,TOGGLEBUTTON_NORMAL|TOGGLEBUTTON_KEEPSTATE); //////////////////////////////////////// --- 162,167 ---- // Toolbar implement ! new FXToggleButton(toolbar, "", "", gdArt::getIcon("/gui/flag"), gdArt::getIcon("/gui/flag"), playarea, w_Painter::ID_TOGGLE_PLANETVALUEVIEW,TOGGLEBUTTON_NORMAL|TOGGLEBUTTON_KEEPSTATE); ! new FXToggleButton(toolbar, "", "", gdArt::getIcon("/gui/togglenames"),gdArt::getIcon("/gui/togglenames"),playarea,w_Painter::ID_TOGGLE_SHOWPLANETNAMES,TOGGLEBUTTON_NORMAL|TOGGLEBUTTON_KEEPSTATE); //////////////////////////////////////// *************** *** 172,179 **** // Add mainWindow keys. // //////////////////////////////////////// ! getAccelTable()->addAccel(fxparseAccel("Alt-F4"),getApp(),MKUINT(FXApp::ID_QUIT, SEL_COMMAND)); //make jeff happy. //getAccelTable()->addAccel(fxparseAccel("~" ),getApp(),MKUINT(mainWindow::ID_MNU_DEBUG_SHOWCONSOLE,SEL_COMMAND)); //make ME happy. ! getAccelTable()->addAccel(fxparseAccel("P"),playarea,MKUINT(w_Painter::ID_ZOOMIN,SEL_COMMAND)); ! getAccelTable()->addAccel(fxparseAccel("L"),playarea,MKUINT(w_Painter::ID_ZOOMOUT,SEL_COMMAND)); //////////////////////////////////////// --- 172,179 ---- // Add mainWindow keys. // //////////////////////////////////////// ! getAccelTable()->addAccel(parseAccel("Alt-F4"),getApp(),MKUINT(FXApp::ID_QUIT, SEL_COMMAND)); //make jeff happy. //getAccelTable()->addAccel(fxparseAccel("~" ),getApp(),MKUINT(mainWindow::ID_MNU_DEBUG_SHOWCONSOLE,SEL_COMMAND)); //make ME happy. ! getAccelTable()->addAccel(parseAccel("P"),playarea,MKUINT(w_Painter::ID_ZOOMIN,SEL_COMMAND)); ! getAccelTable()->addAccel(parseAccel("L"),playarea,MKUINT(w_Painter::ID_ZOOMOUT,SEL_COMMAND)); //////////////////////////////////////// *************** *** 374,378 **** if(foo) { ! FreeStars::TheGalaxy->GetPlanet("Heart")->ProcessLoad(foo,FreeStars::POPULATION,FreeStars::TRANSFER_LOADAMT,20,false); } return 1; --- 374,378 ---- if(foo) { ! TheGalaxy->GetPlanet("Heart")->ProcessLoad(foo,FreeStars::POPULATION,FreeStars::TRANSFER_LOADAMT,20,false); } return 1; *************** *** 388,392 **** { // racewizard->show(); ! FreeStars::TheGame->GetCurrentPlayer()->SaveXFile(); return 1; }; --- 388,392 ---- { // racewizard->show(); ! TheGame->GetCurrentPlayer()->SaveXFile(); return 1; }; *************** *** 429,433 **** using FreeStars::Fleet; using FreeStars::Planet; - using FreeStars::TheGame; Location* loc = static_cast<Location*>(ptr); --- 429,432 ---- Index: v_FIO.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/v_FIO.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** v_FIO.cpp 16 May 2006 20:47:08 -0000 1.5 --- v_FIO.cpp 18 May 2006 07:08:20 -0000 1.6 *************** *** 74,78 **** void v_FIO::setPlanet( FreeStars::Planet* planet) { ! using FreeStars::TheGame; lstFleets->clearItems(); --- 74,78 ---- void v_FIO::setPlanet( FreeStars::Planet* planet) { ! // using FreeStars::TheGame; lstFleets->clearItems(); Index: event.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/event.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** event.cpp 17 May 2006 20:45:29 -0000 1.14 --- event.cpp 18 May 2006 07:08:20 -0000 1.15 *************** *** 24,27 **** --- 24,28 ---- * Event: The event-based state machine */ + #define CLIENT #include "FrontierClient.h" *************** *** 48,51 **** --- 49,62 ---- FXIMPLEMENT(Event,FXObject,EventMap,ARRAYNUMBER(EventMap)) + + + + FreeStars::Game *TheGame; + FreeStars::Galaxy *TheGalaxy; + + //CGame *TheGame; + //CGalaxy *TheGalaxy; + + Event::Event(FXApp* app) { *************** *** 61,66 **** long Event::onEvent(FXObject*, FXSelector, void*st) { ! using FreeStars::TheGame; ! using FreeStars::TheGalaxy; mOldState = mState; mState = (int)(st); //cast --- 72,77 ---- long Event::onEvent(FXObject*, FXSelector, void*st) { ! //using FreeStars::TheGame; ! //using FreeStars::TheGalaxy; mOldState = mState; mState = (int)(st); //cast *************** *** 101,105 **** FXString remp; ! remp.format("%s/data",FXFile::getCurrentDirectory().text()); gdArt::init(apptr,remp.text()); --- 112,116 ---- FXString remp; ! remp.format("%s/data",FXSystem::getCurrentDirectory().text()); gdArt::init(apptr,remp.text()); *************** *** 185,190 **** bool error = false; ! TheGame = new FreeStars::Game(); ! TheGalaxy = new FreeStars::Galaxy(); ///@bug We need to force a chdir() here, so it picks up the right files. --- 196,201 ---- bool error = false; ! TheGame = new CGame(); ! TheGalaxy = new CGalaxy(); ///@bug We need to force a chdir() here, so it picks up the right files. *************** *** 258,264 **** { splashOn(); ! TheGame = new FreeStars::Game(); ! TheGalaxy = new FreeStars::Galaxy(); ! FreeStars::TheGame->LoadPlayerFile(strGameFileName.text()); wGameWindow = new mainWindow(apptr, gdArt::getIcon("/icons/app/big"), gdArt::getIcon("/icons/app/small")); wGameWindow->create(); --- 269,275 ---- { splashOn(); ! TheGame = new CGame(); ! TheGalaxy = new CGalaxy(); ! TheGame->LoadPlayerFile(strGameFileName.text()); wGameWindow = new mainWindow(apptr, gdArt::getIcon("/icons/app/big"), gdArt::getIcon("/icons/app/small")); wGameWindow->create(); Index: gui_splashscreen.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_splashscreen.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gui_splashscreen.cpp 16 May 2006 19:58:12 -0000 1.4 --- gui_splashscreen.cpp 18 May 2006 07:08:20 -0000 1.5 *************** *** 24,28 **** */ ! #include <fx.h> #include "gui_splashscreen.h" #include "data/gui/gui.inc" --- 24,28 ---- */ ! #include "FrontierClient.h" #include "gui_splashscreen.h" #include "data/gui/gui.inc" Index: Tech.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/Tech.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Tech.cpp 14 May 2006 03:28:10 -0000 1.4 --- Tech.cpp 18 May 2006 07:08:20 -0000 1.5 *************** *** 36,39 **** --- 36,40 ---- */ + #include "FrontierClient.h" #if 0 Index: gui_racewizard.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/gui_racewizard.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gui_racewizard.cpp 20 Jul 2005 02:34:37 -0000 1.1 --- gui_racewizard.cpp 18 May 2006 07:08:20 -0000 1.2 *************** *** 25,30 **** * */ ! ! #include <fx.h> #include "gui_racewizard.h" --- 25,29 ---- * */ ! #include "FrontierClient.h" #include "gui_racewizard.h" Index: widget_componenttray.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_componenttray.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** widget_componenttray.cpp 16 May 2006 20:47:08 -0000 1.8 --- widget_componenttray.cpp 18 May 2006 07:08:20 -0000 1.9 *************** *** 140,144 **** using FreeStars::Component; using FreeStars::ComponentType; ! using FreeStars::TheGame; FXint foo; lstTray->clearItems(); --- 140,144 ---- using FreeStars::Component; using FreeStars::ComponentType; ! // using FreeStars::TheGame; FXint foo; lstTray->clearItems(); |