home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2006 April
/
SGP.iso
/
dema
/
Keepsake-Demo-en-li-v1.0.exe
/
res
/
config.tcl
next >
Wrap
Text File
|
2005-11-01
|
6KB
|
158 lines
#######################################################################################################################
###
##
## Configuration file.
##
###
#######################################################################################################################
### Configuration namespace ###################################################
namespace eval config {
namespace eval user {}
namespace eval driver {}
namespace eval screen {}
namespace eval movie {}
namespace eval music {}
namespace eval ambient2d {}
namespace eval ambient3d {}
namespace eval voice {}
namespace eval soundfx {}
}
#######################################################################################################################
###
## User configuration.
###
#######################################################################################################################
set config::user::resolution 0
namespace eval config::user {source "../res/user.tcl"}
if {$::config::user::soundfx_volume > 1.0} {set ::config::user::soundfx_volume 1.0}
if {$::config::user::voice_volume > 1.0} {set ::config::user::voice_volume 1.0}
if {$::config::user::music_volume > 0.4} {set ::config::user::music_volume 0.4}
if {$::config::user::gamma_correction > 1.0} {set ::config::user::gamma_correction 1.0}
if {$::config::user::soundfx_volume < 0.0} {set ::config::user::soundfx_volume 0.0}
if {$::config::user::voice_volume < 0.0} {set ::config::user::voice_volume 0.0}
if {$::config::user::music_volume < 0.0} {set ::config::user::music_volume 0.0}
if {$::config::user::gamma_correction < 0.0} {set ::config::user::gamma_correction 0.0}
#######################################################################################################################
###
## Driver configuration.
###
#######################################################################################################################
# FIXME: NOT USE AT THE MOMENT
set config::driver::video opengl
set config::driver::audio openal
#######################################################################################################################
###
## Video configuration.
###
#######################################################################################################################
### Screen Resolution #########################################################
switch -exact $config::user::resolution {
low {
set config::screen::width 640
set config::screen::height 480
}
medium {
set config::screen::width 800
set config::screen::height 600
}
high {
set config::screen::width 1024
set config::screen::height 768
}
default {
set config::screen::width 1024
set config::screen::height 768
}
}
### Movie Resolution ##########################################################
switch -exact $config::user::resolution {
low {
set config::movie::width 640
set config::movie::height 480
}
medium {
set config::movie::width 800
set config::movie::height 600
}
high {
set config::movie::width 1024
set config::movie::height 768
}
default {
set config::movie::width 1024
set config::movie::height 768
}
}
#######################################################################################################################
###
## Sound configuration.
###
#######################################################################################################################
### Music ####################################################################
set config::music::volume $config::user::music_volume
set config::music::crosstime 5
# Set crosstime proportinal to volume.
if {$config::music::volume > 0} {
set config::music::crosstime [expr $config::music::crosstime / $config::music::volume]
}
### Voice ####################################################################
set config::voice::volume $config::user::voice_volume
### Sound FX##################################################################
set config::soundfx::volume $config::user::soundfx_volume
set config::soundfx::crosstime 0.5
#set config::soundfx::r1 0.750
#set config::soundfx::r2 0.550
#set config::soundfx::r3 0.400
#set config::soundfx::r4 0.250
#set config::soundfx::r5 0.175
#set config::soundfx::r6 0.100
#set config::soundfx::r7 0.050
set config::soundfx::r1 0.750
set config::soundfx::r2 0.550
set config::soundfx::r3 0.350
set config::soundfx::r4 0.200
set config::soundfx::r5 0.100
set config::soundfx::r6 0.050
set config::soundfx::r7 0.000
# Set crosstime proportinal to volume.
if {$config::soundfx::volume > 0} {
set config::soundfx::crosstime [expr $config::soundfx::crosstime / $config::soundfx::volume]
}
### Ambient ##################################################################
set config::ambient2d::volume [expr 1 * $config::user::soundfx_volume]
set config::ambient2d::crosstime 2.5
# Set crosstime proportinal to volume.
if {$config::ambient2d::volume > 0} {
set config::ambient2d::crosstime [expr $config::ambient2d::crosstime / $config::ambient2d::volume]
}
set config::ambient3d::volume [expr 0.5 * $config::user::soundfx_volume]
set config::ambient3d::crosstime 1