00001 00002 /* 00003 TEDDY - General graphics application library 00004 Copyright (C) 1999-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: LWSurfaceBlok.h,v 1.4 2002/01/11 14:34:59 tksuoran Exp $ 00022 */ 00023 00024 00025 #ifndef TEDDY__IMPORTS__LW_SURFACE_BLOK__H 00026 #define TEDDY__IMPORTS__LW_SURFACE_BLOK__H 00027 00028 00029 #include "Teddy/TeddyConfig.h" 00030 #if defined( TEDDY_INCLUDE_LW_SCENE ) 00031 00032 00033 #include "Teddy/Imports/lwdef.h" 00034 #include "Teddy/SysSupport/StdList.h" 00035 using namespace Teddy::SysSupport; 00036 00037 00038 namespace Teddy { 00039 namespace Imports { 00040 00041 00042 class LWFile; 00043 class LWSurface; 00044 00045 00071 class LWSurfaceBlok { 00072 public: 00073 LWSurfaceBlok( LWSurface *surface ); 00074 00075 void processBlok(); 00076 00077 protected: 00078 // Apply attributes 00079 void applyAttributes( ID4 type ); 00080 void applyImageMap (); 00081 void applyProcedural(); 00082 void applyGradient (); 00083 void applyShader (); 00084 00085 // Header 00086 void readChannel_ID4 (); 00087 void readEnable_U2 (); 00088 void readOpacity_U2_FP4_VX (); 00089 void readDisplacementAxis_U2(); 00090 00091 // Texture Map Parser 00092 void readTextureMap( ID4 parent ); 00093 00094 // Texture Maps 00095 void readTextureCenter_VEC12_VX (); 00096 void readTextureSize_VEC12_VX (); 00097 void readTextureRotation_VEC12_VX (); 00098 void readTextureReferenceObject_S0 (); 00099 void readTextureFalloff_U2_VEC12_VX (); 00100 void readTextureCoordinateSystem_U2 (); 00101 00102 // Image maps 00103 void readTextureProjectionMode_U2 (); 00104 void readTextureMajorAxis_U2 (); 00105 void readTextureImageMap_VX (); 00106 void readTextureWrapOptions_U2_U2 (); 00107 void readTextureWrapWidthAmount_FP4_VX (); 00108 void readTextureWrapHeightAmount_FP4_VX (); 00109 void readTextureUV_VertexMap_S0 (); 00110 void readTextureAntialiasingStrength_U2_FP4(); 00111 void readTexturePixelBlending_U2 (); 00112 void readTextureStack_VX (); 00113 void readTextureAmplitude_FP4_VX (); 00114 void readTextureNegative_U2 (); 00115 00116 // Procedurals 00117 void readProceduralAxis_U2 (); 00118 void readProceduralBasicValue_FP4_1_or_3(); 00119 void readProceduralAlgorithm_S0_data (); 00120 00121 // Gradients 00122 void readGradientParameter_S0 (); 00123 void readGradientItem_S0 (); 00124 void readGradientRangeStart_FP4 (); 00125 void readGradientRangeEnd_FP4 (); 00126 void readGradientRepeat_U2 (); 00127 void readGradientKeys_FP4_data_FP4 (); 00128 void readGradientKeyParameters_data_U2 (); 00129 00130 // Shaders 00131 void readShaderAlgorithm_S0_data (); 00132 00133 protected: 00134 LWFile *f; 00135 LWSurface *surface; 00136 00137 // Header values 00138 ID4 texture_channel; 00139 U2 enable; 00140 U2 opacity_type; 00141 FP4 opacity; 00142 VX opacity_envelope; 00143 U2 displacement_axis; 00144 00145 // Texture maps 00146 VEC12 texture_center; 00147 VX texture_center_envelope; 00148 VEC12 texture_size; 00149 VX texture_size_envelope; 00150 VEC12 texture_rotation; 00151 VX texture_rotation_envelope; 00152 S0 texture_reference_object; 00153 U2 texture_falloff_type; 00154 VEC12 texture_falloff; 00155 VX texture_falloff_envelope; 00156 U2 texture_coordinate_system; 00157 00158 // Image maps 00159 U2 texture_projection_mode; 00160 U2 texture_major_axis; 00161 VX texture_image_map; 00162 U2 texture_width_wrap; 00163 U2 texture_height_wrap; 00164 FP4 texture_wrap_width_cycles; 00165 VX texture_wrap_width_cycles_envelope; 00166 FP4 texture_wrap_height_cycles; 00167 VX texture_wrap_height_cycles_envelope; 00168 S0 texture_uv_vertex_map; 00169 U2 texture_antialiasing_type; 00170 FP4 texture_antialiasing_strength; 00171 U2 texture_pixel_blending; 00172 VX texture_stack; 00173 FP4 texture_amplitude; 00174 VX texture_amplitude_envelope; 00175 U2 texture_negative; 00176 00177 // Procedurals 00178 U2 procedural_axis; 00179 S0 procedural_algorithm; 00180 00181 // Gradients 00182 S0 gradient_parameter; 00183 S0 gradient_item; 00184 FP4 gradient_range_start; 00185 FP4 gradient_range_end; 00186 U2 gradient_repeat; 00187 00188 // Shaders 00189 S0 shader_algorithm; 00190 00191 }; 00192 00193 00194 }; // namespace Imports 00195 }; // namespace Teddy 00196 00197 00198 #endif // TEDDY_INCLUDE_LW_SCENE 00199 #endif // TEDDY__IMPORTS__LW_SURFACE_BLOK__H 00200 00201 00202