home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2006 April / SGP.iso / dema / Keepsake-Demo-en-li-v1.0.exe / res / config.tcl next >
Text File  |  2005-11-01  |  6KB  |  158 lines

  1. #######################################################################################################################
  2. ###
  3. ##
  4. ##    Configuration file.
  5. ##
  6. ###
  7. #######################################################################################################################
  8.  
  9. ### Configuration namespace ###################################################
  10. namespace eval config {
  11.     namespace eval user      {}
  12.     namespace eval driver    {}
  13.     namespace eval screen    {}
  14.     namespace eval movie     {}
  15.     namespace eval music     {}
  16.     namespace eval ambient2d {}
  17.     namespace eval ambient3d {}
  18.     namespace eval voice     {}
  19.     namespace eval soundfx   {}
  20. }
  21.  
  22. #######################################################################################################################
  23. ###
  24. ##    User configuration.
  25. ###
  26. #######################################################################################################################
  27.  
  28. set config::user::resolution 0
  29. namespace eval config::user {source "../res/user.tcl"}
  30.  
  31. if {$::config::user::soundfx_volume   > 1.0} {set ::config::user::soundfx_volume   1.0}
  32. if {$::config::user::voice_volume     > 1.0} {set ::config::user::voice_volume     1.0}
  33. if {$::config::user::music_volume     > 0.4} {set ::config::user::music_volume     0.4}
  34. if {$::config::user::gamma_correction > 1.0} {set ::config::user::gamma_correction 1.0}
  35.  
  36. if {$::config::user::soundfx_volume   < 0.0} {set ::config::user::soundfx_volume   0.0}
  37. if {$::config::user::voice_volume     < 0.0} {set ::config::user::voice_volume     0.0}
  38. if {$::config::user::music_volume     < 0.0} {set ::config::user::music_volume     0.0}
  39. if {$::config::user::gamma_correction < 0.0} {set ::config::user::gamma_correction 0.0}
  40.  
  41. #######################################################################################################################
  42. ###
  43. ##    Driver configuration.
  44. ###
  45. #######################################################################################################################
  46.  
  47. # FIXME: NOT USE AT THE MOMENT
  48. set config::driver::video opengl
  49. set config::driver::audio openal
  50.  
  51. #######################################################################################################################
  52. ###
  53. ##    Video configuration.
  54. ###
  55. #######################################################################################################################
  56.  
  57. ### Screen Resolution #########################################################
  58. switch -exact $config::user::resolution {
  59.     low {
  60.         set config::screen::width  640
  61.         set config::screen::height 480
  62.     }
  63.     
  64.     medium {
  65.         set config::screen::width  800
  66.         set config::screen::height 600
  67.     }
  68.  
  69.     high {
  70.         set config::screen::width  1024
  71.         set config::screen::height 768
  72.     }
  73.  
  74.     default {
  75.         set config::screen::width  1024
  76.         set config::screen::height 768
  77.     }
  78. }
  79.  
  80. ### Movie Resolution ##########################################################
  81. switch -exact $config::user::resolution {
  82.     low {
  83.         set config::movie::width  640
  84.         set config::movie::height 480
  85.     }
  86.  
  87.     medium {
  88.         set config::movie::width  800
  89.         set config::movie::height 600
  90.     }
  91.  
  92.     high {
  93.         set config::movie::width  1024
  94.         set config::movie::height 768
  95.     }
  96.  
  97.     default {
  98.         set config::movie::width  1024
  99.         set config::movie::height 768
  100.     }
  101. }
  102.  
  103. #######################################################################################################################
  104. ###
  105. ##    Sound configuration.
  106. ###
  107. #######################################################################################################################
  108.  
  109. ### Music ####################################################################
  110. set config::music::volume    $config::user::music_volume
  111. set config::music::crosstime 5
  112.  
  113. # Set crosstime proportinal to volume.
  114. if {$config::music::volume > 0} {
  115.     set config::music::crosstime [expr $config::music::crosstime / $config::music::volume]
  116. }
  117.  
  118. ### Voice ####################################################################
  119. set config::voice::volume $config::user::voice_volume
  120.  
  121. ### Sound FX##################################################################
  122. set config::soundfx::volume $config::user::soundfx_volume
  123. set config::soundfx::crosstime 0.5
  124.  
  125. #set config::soundfx::r1 0.750
  126. #set config::soundfx::r2 0.550
  127. #set config::soundfx::r3 0.400
  128. #set config::soundfx::r4 0.250
  129. #set config::soundfx::r5 0.175
  130. #set config::soundfx::r6 0.100
  131. #set config::soundfx::r7 0.050
  132.  
  133. set config::soundfx::r1 0.750
  134. set config::soundfx::r2 0.550
  135. set config::soundfx::r3 0.350
  136. set config::soundfx::r4 0.200
  137. set config::soundfx::r5 0.100
  138. set config::soundfx::r6 0.050
  139. set config::soundfx::r7 0.000
  140.  
  141. # Set crosstime proportinal to volume.
  142. if {$config::soundfx::volume > 0} {
  143.     set config::soundfx::crosstime [expr $config::soundfx::crosstime / $config::soundfx::volume]
  144. }
  145.  
  146. ### Ambient ##################################################################
  147. set config::ambient2d::volume    [expr 1 * $config::user::soundfx_volume]
  148. set config::ambient2d::crosstime 2.5
  149.  
  150. # Set crosstime proportinal to volume.
  151. if {$config::ambient2d::volume > 0} {
  152.     set config::ambient2d::crosstime [expr $config::ambient2d::crosstime / $config::ambient2d::volume]
  153. }
  154.  
  155. set config::ambient3d::volume    [expr 0.5 * $config::user::soundfx_volume]
  156. set config::ambient3d::crosstime 1
  157.  
  158.