00001 // OMICRON ENGINE HEADER FILE 00002 // 00003 // -------------------------------------------------------------------------- 00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de> 00005 // 00006 // This file is part of the Omicron Engine. 00007 // 00008 // The Omicron Engine is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by the 00010 // Free Software Foundation; either version 2 of the License, or (at your 00011 // option) any later version. 00012 // 00013 // The Omicron Engine is distributed in the hope that it will be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00015 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 // for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License along 00019 // with The Omicron Engine; if not, write to the Free Software Foundation, 00020 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 // 00022 // -------------------------------------------------------------------------- 00023 // Last modified: $Date: 2002/12/07 19:02:17 $ 00024 // By : $Author: kolrabi $ 00025 // $Id: kmf.h,v 1.1.1.1 2002/12/07 19:02:17 kolrabi Exp $ 00026 00027 /* 00028 00029 $Log: kmf.h,v $ 00030 Revision 1.1.1.1 2002/12/07 19:02:17 kolrabi 00031 initial release 00032 00033 00034 */ 00035 00041 #include "forward.h" 00042 00043 /**************************************************************************** 00044 **************************************************************************** 00045 * DEFINES ****************************************************************** 00046 **************************************************************************** 00047 ****************************************************************************/ 00048 00049 #define KMF_MAGIC "KMF2" 00050 #define KMF_MAX_SKIN_NAME 64 00051 00052 /**************************************************************************** 00053 **************************************************************************** 00054 * TYPES ******************************************************************** 00055 **************************************************************************** 00056 ****************************************************************************/ 00057 00058 #ifndef OMICRON_KMF_TYPES_DEFINED 00059 #define OMICRON_KMF_TYPES_DEFINED 00060 00061 #pragma pack(1) 00062 00064 typedef struct kmf_header_s 00065 { 00066 char magic[4]; 00067 ulong version; 00068 ulong framecount; 00069 00070 char texturename[64]; 00071 00072 ulong vertices; 00073 00074 ulong triangles; 00075 } kmf_header_t; 00076 00081 typedef struct kmf_vertmodifier_s 00082 { 00083 vec3_t scale; 00084 vec3_t offset; 00085 } kmf_vertmodifier_t; 00086 00088 typedef struct kmf_vertex_s 00089 { 00090 uchar pos[3]; 00091 ushort normal; 00092 uchar uv[2]; 00093 } kmf_vertex_t; 00094 00095 #pragma pack(8) 00096 00101 class kmf_c: public model_c 00102 { 00103 protected: 00104 00105 kmf_header_t header; 00106 ulong *tris; 00107 kmf_vertex_t *verts; 00108 kmf_vertmodifier_t *mods; 00109 uchar *normals; 00110 00111 vertex_t *tmpdrawvertices; 00112 00113 public: 00114 00115 kmf_c(); 00116 virtual ~kmf_c(); 00117 00118 bool 00119 load(const char* fileName); 00120 00121 void 00122 unload(); 00123 00124 void 00125 set_frame(float frame); 00126 00127 ulong 00128 get_frame_count(); 00129 00130 void 00131 draw(); 00132 }; 00133 00134 #endif
1.2.18