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: LWSceneRecord.cpp,v 1.1 2002/02/16 12:41:39 tksuoran Exp $ 00022 */ 00023 00024 00025 #include "Teddy/TeddyConfig.h" 00026 #if defined( TEDDY_INCLUDE_LW_SCENE ) 00027 00028 00029 #include "Teddy/Imports/LWSceneFile.h" 00030 #include "Teddy/Imports/LWSceneParser.h" 00031 00032 00033 namespace Teddy { 00034 namespace Imports { 00035 00036 00037 /* 00038 RenderMode <value> 00039 00040 example: RenderMode 2 00041 00042 The RenderMode function determines the type of rendering for the scene. 00043 00044 <value>: 00045 0 - WireFrame 00046 1 - Quickshade 00047 2 - Realistic (Default) 00048 */ 00049 void LWSceneParser::RenderMode(){ 00050 int render_mode = file->read_int(); 00051 } 00052 00053 00054 /* 00055 RayTraceEffects <bit-field value> 00056 00057 example: RayTraceEffects 7 00058 00059 The RayTraceEffects function determines the ray trace options for the scene. 00060 00061 The value is produced by calculating the decimal value of a 3 position 00062 bit-field whose bits represent logical on/off switches that are numbered 00063 left to right from 0 - 2. The field's least-significant bit is the 00064 rightmost bit. Each ray trace option has a corresponding bit in this 00065 bit-field. When an option is selected, it's bit (or switch) is turned on. 00066 00067 <bit position>: 00068 0 - Trace Shadows 00069 1 - Trace Reflection 00070 2 - Trace Refraction 00071 */ 00072 void LWSceneParser::RayTraceEffects(){ 00073 int ray_trace_effects = file->read_int(); 00074 } 00075 00076 00077 void LWSceneParser::RayTraceOptimization(){ 00078 int ray_trace_optimization = file->read_int(); 00079 } 00080 00081 00082 void LWSceneParser::RayRecursionLimit(){ 00083 int ray_recursion_limit = file->read_int(); 00084 } 00085 00086 00087 /* 00088 DataOverlay <flag> 00089 00090 example: DataOverlay 1 00091 00092 The DataOverlay flag activates the data overlay function that overlays a 00093 string provide by the DataOverlayLabel function on the rendered frames. 00094 00095 <flag>: 00096 0 - Off (No Listing) 00097 1 - On 00098 */ 00099 void LWSceneParser::DataOverlay(){ 00100 int data_overlay = file->read_int(); 00101 } 00102 00103 00104 /* 00105 DataOverlayLabel <string> 00106 00107 example: DataOverlayLabel Scene1_4/16/95 00108 00109 The DataOverlayLabel function provides the string to be used by the 00110 DataOverlay function. 00111 */ 00112 void LWSceneParser::DataOverlayLabel(){ 00113 file->skip(); 00114 //char *data_overlay_label = file->read_string(); 00115 } 00116 00117 00118 void LWSceneParser::OutputFilenameFormat(){ 00119 file->skip(); 00120 //int output_filename_format = file->read_int(); 00121 } 00122 00123 00124 void LWSceneParser::SaveRGB(){ 00125 int save_rgb = file->read_int(); 00126 } 00127 00128 00129 void LWSceneParser::SaveAlpha(){ 00130 int save_alpha = file->read_int(); 00131 } 00132 00133 00134 /* 00135 SaveANIMFileName <image path + filename> 00136 00137 example: SaveANIMFileName Anims\LogoAnim 00138 00139 The SaveANIMFileName function provides the path and filename for the 00140 animation to be saved during rendering. 00141 00142 In this example, if the current content directory is <c:\NewTek>, 00143 LightWave would attempt to save the anim file as <c:\NewTek\Anims\LogoAnim>. 00144 00145 Some animation formats produce additional function listings. 00146 */ 00147 void LWSceneParser::SaveANIMFileName(){ 00148 char *anim_file_name = file->read_string(); 00149 } 00150 00151 00152 /* 00153 Additional: LockANIMPaletteFrame <frame number> 00154 00155 example: LockANIMPaletteFrame 12 00156 00157 The LockANIMPaletteFrame function provides the frame number to be 00158 rendered for the palette information. The palette of all frames 00159 rendered in the animation will then use the given frames palette. 00160 */ 00161 void LWSceneParser::LockANIMPaletteFrame(){ 00162 int lock_anim_palette_frame = file->read_int(); 00163 } 00164 00165 00166 /* 00167 Additional: BeginANIMLoopFrame <frame number> 00168 00169 example: BeginANIMLoopFrame 15 00170 00171 The BeginANIMLoopFrame function provides the frame number to loop the 00172 animation from. After the animation is completed, it would continue 00173 looping from the given frame to the end of the animation. 00174 */ 00175 void LWSceneParser::BeginANIMLoopFrame(){ 00176 int begin_anim_loop_frame = file->read_int(); 00177 } 00178 00179 00180 /* 00181 SaveRGBImagesPrefix<image path + filename> 00182 00183 example: SaveRGBImagesPrefix Images\LogoFrames 00184 00185 The SaveRGBImagesPrefix function provides the path and filename prefix 00186 for the images to be saved during rendering. A frame number and optional 00187 file extension will be added to this filename. This additional information 00188 is provided by the Output Filename Format config file listing and the 00189 RGBImageFormat function. 00190 00191 In this example, if the current content directory is <c:\NewTek>, the 00192 Output Filename Format is set to Name001.xxx, and the Image Format is 00193 24-bit Targa, LightWave would attempt to save the first image file as 00194 <c:\NewTek\Images\LogoFrames001.tga>. 00195 */ 00196 void LWSceneParser::SaveRGBImagesPrefix(){ 00197 char *rgb_images_prefix = file->read_string(); 00198 } 00199 00200 00201 /* 00202 Additional: RGBImageFormat <value> 00203 00204 example: RGBImageFormat 2 00205 00206 The RGBImageFormat function determines which file format will be 00207 used in the image saving process. 00208 00209 <value>: 00210 0 - 24-bit IFF (.IFF) 00211 1 - 24-bit RAW (.RAW) 00212 2 - 24-bit Targa (.TGA) 00213 */ 00214 void LWSceneParser::RGBImageFormat(){ 00215 int rgb_image_format = file->read_int(); 00216 } 00217 00218 00219 /* 00220 SaveAlphaImagesPrefix<image path + filename> 00221 00222 example: SaveAlphaImagesPrefix Images\LogoAlpha 00223 00224 The SaveAlphaImagesPrefix function provides the path and filename prefix 00225 for the alpha images to be saved during rendering. A frame number and 00226 optional file extension will be added to this filename. This additional 00227 information is provided by the Output Filename Format config file listing 00228 and the AlphaImageFormat function. 00229 00230 In this example, if the current content directory is <c:\NewTek>, the 00231 Output Filename Format is set to Name001.xxx, and the Alpha Image Format 00232 is 24-bit IFF, LightWave would attempt to save the first image file as 00233 <c:\NewTek\Images\LogoAlpha001.tga>. 00234 */ 00235 void LWSceneParser::SaveAlphaImagesPrefix(){ 00236 char *alpha_images_prefix = file->read_string(); 00237 } 00238 00239 00240 /* 00241 Additional: AlphaImageFormat <value> 00242 00243 example: AlphaImageFormat 1 00244 00245 The AlphaImageFormat function determines which file format will 00246 be used in the image saving process. 00247 00248 <value>: 00249 0 - 8-bit IFF (.IFF) 00250 1 - 24-bit IFF (.IFF) 00251 */ 00252 void LWSceneParser::AlphaImageFormat(){ 00253 int alpha_image_format = file->read_int(); 00254 } 00255 00256 00257 /* 00258 AlphaMode <value> 00259 00260 example: AlphaMode 1 00261 00262 The AlphaMode functions determines which type of alpha image is 00263 going to be produced during the rendering process. 00264 00265 <value>: 00266 0 - Normal Alpha 00267 1 - Fader Alpha Mode 00268 */ 00269 void LWSceneParser::AlphaMode(){ 00270 int alpha_mode = file->read_int(); 00271 } 00272 00273 00274 /* 00275 SaveFramestoresComment <image path + filename> 00276 00277 example: SaveFramestoreComment Images\Frame 00278 00279 The SaveFramestoreComment function provides the path and 00280 filename prefix for the framestores to be saved during 00281 rendering. A frame number and optional file extension 00282 will be added to this filename. 00283 00284 In this example, if the current content directory i 00285 <c:\NewTek>, LightWave would attempt to save the first 00286 image file as <c:\NewTek\Images\001.FS.Frame>. 00287 */ 00288 void LWSceneParser::SaveFramestoresComment(){ 00289 char *framestores_comment = file->read_string(); 00290 } 00291 00292 00293 void LWSceneParser::FullSceneParamEval(){ 00294 int full_scene_param_evel = file->read_int(); 00295 } 00296 00297 00298 }; // namespace Imports 00299 }; // namespace Teddy 00300 00301 00302 #endif // TEDDY_INCLUDE_LW_SCENE 00303 00304 00305 /* 00306 The effects section contains the information on the saving of animations, 00307 RGB images and Alpha images. 00308 00309 Record functions produce a listing only when activated by the user. 00310 00311 The file saving process is not active when the scene is loaded into 00312 LightWave. The file name is available to the record functions. The user 00313 must activate the save function manually to begin the saving process. 00314 00315 SaveANIMFileName 00316 LockANIMPaletteFrame 00317 BeginANIMLoopFrame 00318 SaveRGBImagesPrefix 00319 RGBImageFormat 00320 SaveAlphaImagesPrefix 00321 AlphaImageFormat 00322 AlphaMode 00323 SaveFramestoresComment 00324 */ 00325