Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

3dsshape.h

00001 
00007 /***************************************************************************
00008                           3dsshape.h  -  description
00009                              -------------------
00010     begin                : Fri Oct 3 2003
00011     copyright            : (C) 2003 by Gabor Torok
00012     email                : cctorok@yahoo.com
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef C3DSSHAPE_H
00025 #define C3DSSHAPE_H
00026 
00027 //#define DEBUG_3DS
00028 
00029 #include <iostream>
00030 #include <stdio.h>
00031 #include <stdlib.h>
00032 
00033 # include <string>
00034 # include <vector>
00035 
00036 #include "constants.h"
00037 #include "glshape.h"
00038 #include "3ds.h"
00039 #include "shapepalette.h"
00040 
00041 using namespace std;
00042 
00043 typedef unsigned char BYTE;
00044 
00045 class C3DSShape : public GLShape  {
00046 
00047 private:
00048   float div;
00049   // This holds the texture info, referenced by an ID
00050   unsigned int g_Texture[MAX_TEXTURES];
00051   // This is 3DS class.  This should go in a good model class.
00052   CLoad3DS g_Load3ds;
00053   // This holds the 3D Model info that we load in
00054   t3DModel g_3DModel;
00055   // We want the default drawing mode to be normal
00056   int g_ViewMode;
00057   float movex, movey, movez;
00058   ShapePalette *shapePal;
00059   int offsetx, offsety;
00060   GLShape *debugShape;
00061   GLuint displayListStart;
00062   bool initialized;
00063 
00064 public:   
00065   C3DSShape(char *file_name, float div, ShapePalette *shapePal,
00066                         GLuint texture[], char *name, int descriptionGroup,
00067                         Uint32 color, Uint8 shapePalIndex=0, int offsetx=0, int offsety=0);
00068   ~C3DSShape();
00069 
00070   void initialize();
00071   void draw();
00072   void outline( float r, float g, float b );
00073   
00074   bool drawFirst();
00075   // if true, the next two functions are called
00076   bool drawLater();
00077   void setupBlending();
00078   void endBlending();
00079 
00080 protected:
00081   void commonInit(char *file_name, float div, ShapePalette *shapePal, int offsetx, int offsety);
00082   void preRenderLight();
00083   void resolveTextures();
00084   void normalizeModel();
00085   void createDisplayList( GLuint listName, bool isShadow );
00086 };
00087 
00088 #endif

Generated on Thu Jun 16 21:50:42 2005 for scourge by  doxygen 1.4.0