Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FrontierObjects.cpp

Go to the documentation of this file.
00001 
00002 /*
00003     TSGL - Teddy Space Game Library
00004     Copyright (C) 2002 Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2.1 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     $Id: FrontierObjects.cpp,v 1.1 2002/01/08 20:47:05 tksuoran Exp $
00022 */
00023 
00024 
00031 #include "Teddy/SpaceGame/ObjectManager.h"
00032 #include "Teddy/SpaceGame/FrontierFile.h"
00033 #include "Teddy/SpaceGame/FrontierBitmap.h"
00034 #include "Teddy/SpaceGame/FrontierMesh.h"
00035 #include "Teddy/Graphics/View.h"
00036 #include "Teddy/Models/ModelInstance.h"
00037 #include "Teddy/PhysicalComponents/Console.h"
00038 #include "Teddy/Scenes/Scene.h"
00039 using namespace Teddy::Graphics;
00040 using namespace Teddy::Models;
00041 using namespace Teddy::Scenes;
00042 using namespace Teddy::PhysicalComponents;
00043 
00044 
00045 namespace Teddy     {
00046 namespace SpaceGame {
00047 
00048 
00050 void ObjectManager::addFFE(){
00051     FrontierFile  *f  =  new FrontierFile( "ffedat.asm", 0 );
00052     FrontierMesh  *m;
00053     ModelInstance *mi;
00054 
00055 //  con << ": Parsing FFE objects: " << endl;
00056 //  view->display();
00057 
00058     int i = 4;
00059     for( int x=0; x<13; x++ ){
00060         for( int z=0; z<11; z++ ){
00061             i++;
00062             DoubleVector v = DoubleVector( (x-6)*240.0, 0.0, (z-5)*240.0 );
00063             m  = new FrontierMesh (  f, i, "?"  );
00064             mi = new ModelInstance(  m->getName(), m );
00065             mi->setPosition( v );
00066             mi->setMaterial( NULL );  //  Use material from Mesh
00067             scene->addInstance( mi );
00068         }
00069         //con << ".";
00070         //view->display();
00071     }
00072     //console->newLine();
00073 }
00074 
00075 
00076 };  //  namespace SpaceGame
00077 };  //  namespace Teddy
00078