00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef C3DSSHAPE_H
00025 #define C3DSSHAPE_H
00026
00027
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
00050 unsigned int g_Texture[MAX_TEXTURES];
00051
00052 CLoad3DS g_Load3ds;
00053
00054 t3DModel g_3DModel;
00055
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
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