Guest User

Untitled

a guest
Dec 28th, 2013
4,690
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #############################################################################
  2. #
  3. # Logging settings
  4. #
  5.  
  6. set logGroup "ConfigurationManager"
  7. set logLevelWarning warning
  8. set logLevelInfo info
  9. set logLevelDebug debug
  10.  
  11. log $logGroup $logLevelInfo "Parsing configuration script"
  12.  
  13.  
  14. #############################################################################
  15. #
  16. # Constants
  17. #
  18.  
  19. seti Off 0
  20. seti On 1
  21.  
  22. seti Low 1
  23. seti Medium 2
  24. seti High 3
  25.  
  26. seti MediumButDefaultLow 4
  27.  
  28. seti memoryLevelHigh 512
  29. seti memoryLevelMedium 384
  30. seti memoryLevelLow 256
  31. seti memoryLevelUnknown 0
  32.  
  33. if ( match("${osVersion}","*NT 6.0*") )
  34. seti cpuLevelHigh 3000
  35. seti cpuLevelMedium 2600
  36. seti cpuLevelLow 2000
  37. log $logGroup $logLevelInfo "Setting cpu level for Vista."
  38. else
  39. seti cpuLevelHigh 2800
  40. seti cpuLevelMedium 2200
  41. seti cpuLevelLow 1450
  42. log $logGroup $logLevelInfo "Setting cpu level for non-Vista."
  43. endif
  44.  
  45. seti cpuLevelUnsupported 0
  46.  
  47.  
  48. #############################################################################
  49. #
  50. # Identify gfx device
  51. #
  52.  
  53. # set some config variables based on a card table and vendor specific rules
  54. # sets isCardFound, cardVendor, and cardName
  55. include "Video Cards.sgr"
  56.  
  57. # Fallback on the card name text supplied by the card itself.
  58. # Assumes that at least the cardVendor has been matched, since
  59. # vendor name is not contained in some vendor card names.
  60. # Note that specific vendors are overridden to a default card.
  61. # For ATI -> Radeon 9800 Pro
  62. # For NVIDIA -> NVIDIA 4800 TI SE
  63. if (not $isCardFound)
  64. set cardName $cardNameText
  65. endif
  66.  
  67.  
  68.  
  69. #############################################################################
  70. #
  71. # Configuration override controlled by command line option -cardConfig.
  72. #
  73. if (varExists(cardConfig))
  74. # test unsupported cards using sw rendering
  75. if ($cardConfig = 1)
  76. log $logGroup $logLevelInfo "Testing with all devices unsupported."
  77. set cardVendor TestingAllUnsupported
  78. set cardName TestingAllUnsupported
  79.  
  80. elseif (($cardConfig = 2) and ($deviceNumber = 0))
  81. log $logGroup $logLevelInfo "Testing with the first device unsupported."
  82. set cardVendor TestingFirstUnsupported
  83. set cardName TestingFirstUnsupported
  84.  
  85. elseif (($cardConfig = 3) and ($deviceNumber != 0))
  86. log $logGroup $logLevelInfo "Testing with the all devices except first unsupported."
  87. set cardVendor TestingAllButFirstUnsupported
  88. set cardName TestingAllButFirstUnsupported
  89.  
  90. elseif (($cardConfig = 100) and ($deviceNumber = 0))
  91. log $logGroup $logLevelInfo "Testing first device as swvp only part."
  92. boolProp forceSoftwareVP true
  93. endif
  94. endif
  95.  
  96.  
  97.  
  98. #############################################################################
  99. #
  100. # Determine if gfx device is supported, force software rendering if not
  101. #
  102.  
  103. setb useSoftwareRasterizer false
  104.  
  105. if (not $useSoftwareRasterizer)
  106. log $logGroup $logLevelInfo "Hardware rendering is enabled"
  107. endif
  108.  
  109.  
  110.  
  111. #############################################################################
  112. #
  113. # Apply gfx device specific workarounds
  114. #
  115. # Available device props:
  116. # forceSoftwareVP
  117. # forceSoftwareDevice
  118. # queriesOK
  119. # windowedModeFormatConversionOK
  120. # enumerateMultisampleLevels
  121. # skipValidateDevice
  122. # enableDriverMemoryManager
  123. # softwareDeviceLocalVideoMemorySize
  124. # deviceLocalVideoMemorySizeDefault
  125. # disableVSyncSupport
  126. # substituteFlipForDiscardSwapEffect
  127. # minTextureDimensionForBalance
  128. #
  129. # Additional props:
  130. # vs2LoopsFunctional
  131.  
  132. setb forceLowSettings false
  133. setb forceLowResolution false
  134. setb defaultLowResolution false
  135. setb forceMediumMaterialDetail false
  136. setb isIntegratedChipset false
  137. setb forceMediumShadows false
  138. setb forceMediumObjectDetail false
  139.  
  140. boolProp dontMergeNHFlora false
  141.  
  142. seti textureMemory 2047
  143. setb textureMemorySizeOK true
  144. setb supportsDirtyRect true
  145. setb supportsTurboRect true
  146. setb supportsSpecialEventCamera true
  147. boolProp useRenderTextures true
  148. boolProp usePS30 true
  149. boolProp useShaders true
  150. boolProp vs2LoopsFunctional true
  151. boolProp presentWorkaround false
  152. boolProp enumerateMultisampleLevels true
  153. uintProp antialiasingSupport 1
  154.  
  155. # never trust the driver to manage its own memory - except I do!
  156. boolProp enableDriverMemoryManager true
  157.  
  158. intProp deviceLocalVideoMemorySizeDefault ($textureMemory * 1024 * 1024)
  159.  
  160.  
  161. #############################################################################
  162. #
  163. # Print system info
  164. #
  165.  
  166. if ($deviceNumber = 0)
  167. logSystemInfo "=== Application info ==="
  168. logSystemInfo "Name: ${appName}"
  169. logSystemInfo "Version: ${version}"
  170. logSystemInfo "Build: ${buildType}"
  171.  
  172. logSystemInfo "=== Machine info ==="
  173. logSystemInfo "OS version: ${osVersion}"
  174. logSystemInfo "CPU: ${cpuSpeed}Mhz, Name:${CPU}, FPU:${FPU}, MMX:${MMX}"
  175. logSystemInfo "Memory: ${memory}MB"
  176. logSystemInfo "Free memory: ${freeMemory}MB"
  177. logSystemInfo "User: ${userName}"
  178. logSystemInfo "Computer: ${computerName}"
  179.  
  180. logSystemInfo "=== Sound device info ==="
  181. logSystemInfo "Name: ${soundCardName}"
  182. logSystemInfo "Driver: ${soundDriverName}"
  183. endif
  184.  
  185. logSystemInfo "=== Graphics device info ==="
  186. logSystemInfo "Number: ${deviceNumber}"
  187. logSystemInfo "Name (driver): ${cardNameText}"
  188. if ($isCardFound)
  189. logSystemInfo "Name (database): ${cardName}"
  190. else
  191. logSystemInfo "Name (database): ${cardName} <<NOT FOUND IN DATABASE!>>"
  192. endif
  193. if ($isIntegratedChipset)
  194. logSystemInfo " (Integrated Chipset)"
  195. endif
  196. logSystemInfo "Vendor: ${cardVendor}"
  197. logSystemInfo "Chipset: ${cardChipset}"
  198. logSystemInfo "Driver: ${driverName}, Version: ${driverVersion}"
  199. logSystemInfo "Driver version: ${driverBuild}"
  200. logSystemInfo "Monitor: ${monitorName}"
  201. logSystemInfo "Monitor aspect: ${monitorAspect}, ${monitorAspectString}"
  202. logSystemInfo "Screen mode: ${screenWidth}x${screenHeight}x${screenBPP}BPP,${screenRefresh}Hz"
  203. if ($textureMemorySizeOK)
  204. logSystemInfo "Texture memory: ${textureMemory}MB"
  205. else
  206. logSystemInfo "Texture memory: ${textureMemory}MB <<OVERRIDE>>"
  207. endif
  208. logSystemInfo "HW T&L: Fixed function:${fixedFunctionHWTnL} Programmable:${maxVertexProgramVersionHWMajor}.${maxVertexProgramVersionHWMinor}"
  209. logSystemInfo "Pixel program: ${maxPixelProgramVersionMajor}.${maxPixelProgramVersionMinor}"
  210. logSystemInfo "Texture stages: ${textureStages}"
  211. logSystemInfo "AppControlledAA: ${appControlledAA}"
  212.  
  213. if (not $useSoftwareRasterizer)
  214. logSystemInfo "Hardware rendering is enabled"
  215. else
  216. logSystemInfo "Software rendering is enabled"
  217. endif
  218.  
  219.  
  220. #############################################################################
  221. #
  222. # UI Options
  223.  
  224. log $logGroup $logLevelDebug "Begin parsing option definitions"
  225.  
  226. option MaterialDetail
  227. setting $Low
  228. boolProp bumpMapping false
  229. intProp imageDataSizeReductionOnLoad 2
  230.  
  231. setting $Medium
  232. boolProp bumpMapping false
  233. intProp imageDataSizeReductionOnLoad 1
  234.  
  235. setting $High
  236. boolProp bumpMapping true
  237. intProp imageDataSizeReductionOnLoad 0
  238. end
  239.  
  240.  
  241. option ObjectDetail
  242. setting $Medium
  243. boolProp reduceBoneWeights true
  244. boolProp useLODs true
  245. intProp lodOverride 35
  246.  
  247. setting $High
  248. boolProp reduceBoneWeights false
  249. boolProp useLODs false
  250. intProp lodOverride 0
  251. end
  252.  
  253. option ObjectHiding
  254. setting $Off
  255. intProp renderInsideVisibleObjects 0
  256.  
  257. setting $On
  258. intProp renderInsideVisibleObjects 1
  259. end
  260.  
  261. option SnowOnGround
  262. setting $Off
  263. boolProp showSnowOnGround false
  264.  
  265. setting $On
  266. boolProp showSnowOnGround true
  267. end
  268.  
  269. option Shadows
  270. setting $Low
  271. boolProp simShadows false
  272. boolProp objectShadows false
  273. boolProp guob false
  274. boolProp heightMapShadows false
  275.  
  276. setting $Medium
  277. boolProp simShadows false
  278. boolProp objectShadows false
  279. boolProp guob true
  280. boolProp heightMapShadows true
  281.  
  282. setting $High
  283. boolProp simShadows true
  284. boolProp objectShadows true
  285. boolProp guob true
  286. boolProp heightMapShadows true
  287. end
  288.  
  289.  
  290. option OpaqueUI
  291. setting $Off
  292. boolProp renderOpaqueUI false
  293.  
  294. setting $On
  295. boolProp renderOpaqueUI true
  296. end
  297.  
  298.  
  299. option Reflection
  300. setting $Off
  301. boolProp reflectionWithExtraViewer false
  302. boolProp nhoodWaterReflection false
  303.  
  304. setting $On
  305. boolProp reflectionWithExtraViewer true
  306. boolProp nhoodWaterReflection true
  307. end
  308.  
  309. option Ceiling
  310. setting $Off
  311. boolProp includeCeilings false
  312.  
  313. setting $On
  314. boolProp includeCeilings true
  315. end
  316.  
  317. option EffectsQuality
  318. setting $Low
  319. boolProp useEffects true
  320. floatProp particleDensity 1
  321. floatProp particleScale 1
  322. intProp maxParticlesTarget 2000
  323. intProp particleLODOffset 0 # subtracted from the zoom.
  324. intProp effectPriorityLevel 1
  325. boolProp enableOceanReflection false
  326.  
  327. setting $Medium
  328. boolProp useEffects true
  329. floatProp particleDensity 1
  330. floatProp particleScale 1
  331. intProp maxParticlesTarget 5000
  332. intProp particleLODOffset 0 # subtracted from the zoom.
  333. intProp effectPriorityLevel 2
  334. boolProp enableOceanReflection false
  335.  
  336. setting $High
  337. boolProp useEffects true
  338. floatProp particleDensity 1
  339. floatProp particleScale 1
  340. intProp maxParticlesTarget 10000
  341. intProp particleLODOffset 0 # subtracted from the zoom.
  342. intProp effectPriorityLevel 3
  343. boolProp enableOceanReflection true
  344. end
  345.  
  346.  
  347. option LightingQuality
  348. setting $Low
  349. boolProp lightingEnabled true
  350. boolProp portalLighting false
  351. boolProp floorAndWallNormalMapping false
  352. boolProp specHighlights false
  353.  
  354. setting $Medium
  355. boolProp lightingEnabled true
  356. boolProp portalLighting true
  357. boolProp floorAndWallNormalMapping false
  358. boolProp specHighlights true
  359.  
  360. setting $High
  361. boolProp lightingEnabled true
  362. boolProp portalLighting true
  363. boolProp floorAndWallNormalMapping true
  364. boolProp specHighlights true
  365. end
  366.  
  367.  
  368. option SoundQuality
  369. setting $Low
  370. intProp AudioPerformance 0
  371.  
  372. setting $Medium
  373. intProp AudioPerformance 1
  374.  
  375. setting $High
  376. intProp AudioPerformance 2
  377. end
  378.  
  379.  
  380. #
  381. # Options without ui access.
  382. #
  383. option DirtyRect
  384. setting $High
  385. # no dirty rects
  386. intProp dynamicRenderStrategy 0
  387.  
  388. setting $Medium
  389. # 4 buffer mode
  390. intProp dynamicRenderStrategy 2
  391.  
  392. setting $Low
  393. # 2 buffer mode
  394. intProp dynamicRenderStrategy 1
  395. end
  396.  
  397.  
  398. option FullscreenFadeEffect
  399. setting $Off
  400. boolProp enableSnapshot false
  401.  
  402. setting $On
  403. boolProp enableSnapshot true
  404. end
  405.  
  406.  
  407. option Turbo
  408. setting $High
  409. boolProp useTurboRect true
  410.  
  411. setting $Medium
  412. boolProp useTurboRect true
  413.  
  414. setting $Low
  415. boolProp useTurboRect false
  416.  
  417. end
  418.  
  419.  
  420. option SimulatorControls
  421. setting $High
  422. intProp maxNumOfVisitingSims 8
  423.  
  424. setting $Medium
  425. intProp maxNumOfVisitingSims 6
  426.  
  427. setting $Low
  428. intProp maxNumOfVisitingSims 2
  429. end
  430.  
  431.  
  432. option LightingOptimizations
  433. setting $High
  434. boolProp optimizedDiffusion true
  435. boolProp incrementalLighting true
  436. boolProp lerpLights true
  437. boolProp useDirtyTiles true
  438. end
  439.  
  440.  
  441. option AnimationSamplingLevel
  442. setting $Low
  443. # sample nearest animation frame
  444. boolProp animationFrameSampling true
  445.  
  446. setting $Medium
  447. # sample nearest two animation frames and slerp
  448. boolProp animationFrameSampling false
  449. end
  450.  
  451.  
  452. option LivePIP
  453. setting $Off
  454. boolProp livePIP false
  455. boolProp livePIPDefault false
  456.  
  457. setting $On
  458. boolProp livePIPDefault true
  459. # do not override user's choice if the setting is ON
  460. end
  461.  
  462.  
  463. option SpecialEventCamera
  464. setting $Off
  465. boolProp chooseCameraSpecialEventEnabled false
  466. boolProp CameraSpecialEventEnabled false
  467.  
  468. setting $On
  469. boolProp chooseCameraSpecialEventEnabled true
  470. # do not override user's choice if the setting is ON
  471.  
  472.  
  473. end
  474.  
  475.  
  476. option ScreenModeResolution
  477. setting $Low
  478. uintProp maxResWidth 2560
  479. uintProp maxResHeight 1440
  480. uintProp defaultResWidth 800
  481. uintProp defaultResHeight 600
  482.  
  483. setting $MediumButDefaultLow
  484. uintProp maxResWidth 2560
  485. uintProp maxResHeight 1440
  486. uintProp defaultResWidth 800
  487. uintProp defaultResHeight 600
  488.  
  489. setting $Medium
  490. uintProp maxResWidth 2560
  491. uintProp maxResHeight 1440
  492. uintProp defaultResWidth 1024
  493. uintProp defaultResHeight 768
  494.  
  495. setting $High
  496. uintProp maxResWidth 2560
  497. uintProp maxResHeight 1440
  498. uintProp defaultResWidth 1024
  499. uintProp defaultResHeight 768
  500. end
  501.  
  502. option SubjectTracking
  503. setting $Low
  504. floatProp centerTrackingDeadZoneMagnitude 70
  505.  
  506. setting $Medium
  507. floatProp centerTrackingDeadZoneMagnitude 30
  508.  
  509. setting $High
  510. floatProp centerTrackingDeadZoneMagnitude 30
  511. end
  512.  
  513. option EnableLotImpostersInLot
  514. setting $On
  515. boolProp enableLotImpostersInLot true
  516. setting $Off
  517. boolProp enableLotImpostersInLot false
  518. end
  519.  
  520. option EnableNeighborhoodOccupantsInLot
  521. setting $On
  522. boolProp enableNeighborhoodOccupantsInLot true
  523. setting $Off
  524. boolProp enableNeighborhoodOccupantsInLot false
  525. end
  526.  
  527. option LotSkirtSizeIncrease
  528. setting 0
  529. uintProp lotSkirtSizeIncrease 5
  530. setting 1
  531. uintProp lotSkirtSizeIncrease 9
  532. setting 2
  533. uintProp lotSkirtSizeIncrease 18
  534. setting 3
  535. uintProp lotSkirtSizeIncrease 36
  536. end
  537.  
  538. log $logGroup $logLevelDebug "Finished parsing option definitions"
  539.  
  540.  
  541. #############################################################################
  542. #
  543. # Hardware Rendering
  544. #
  545.  
  546. # This cannot be defined as a local variable, the if clause is still executed when
  547. # sw render path is taken and an exception generated that fails the parsing. Be
  548. # careful with the use of local variables.
  549. setb usingHighDetail false
  550.  
  551. if (not $useSoftwareRasterizer)
  552.  
  553. # set a base level of options based on the card rating
  554. if (($memory >= $memoryLevelHigh) and ($cpuSpeed >= $cpuLevelHigh) and ($maxVertexProgramVersionHWMajor >= 1) and not $forceLowSettings and not $isIntegratedChipset)
  555. log $logGroup $logLevelInfo "Selecting High base level"
  556.  
  557. setOption OpaqueUI $Off
  558. setOption LivePIP $On
  559. setOption Reflection $On
  560. setOption Ceiling $On
  561. setOption EffectsQuality $High
  562. setOption LightingQuality $High
  563. setOption Shadows $High
  564. setOption MaterialDetail $High
  565. setOption ObjectDetail $High
  566. setOption ObjectHiding $Off
  567. setOption SubjectTracking $High
  568. setOption EnableLotImpostersInLot $On
  569. setOption EnableNeighborhoodOccupantsInLot $On
  570. setOption LotSkirtSizeIncrease 1
  571. setb usingHighDetail true #use this to test if current level is set to high
  572.  
  573. elseif (($memory >= $memoryLevelMedium) and ($cpuSpeed >= $cpuLevelMedium) and ($maxVertexProgramVersionHWMajor >= 1) and not $forceLowSettings)
  574. log $logGroup $logLevelInfo "Selecting Medium base level"
  575.  
  576. setOption OpaqueUI $Off
  577. setOption LivePIP $On
  578. setOption Reflection $Off
  579. setOption Ceiling $Off
  580. setOption EffectsQuality $Medium
  581. setOption LightingQuality $Medium
  582. setOption Shadows $Medium
  583. setOption MaterialDetail $Medium
  584. setOption ObjectDetail $High
  585. setOption ObjectHiding $On
  586. setOption SubjectTracking $Medium
  587. setOption EnableLotImpostersInLot $On
  588. setOption EnableNeighborhoodOccupantsInLot $On
  589. setOption LotSkirtSizeIncrease 0
  590.  
  591. else
  592. log $logGroup $logLevelInfo "Selecting Low base level"
  593. # NOTE: don't set forceLowSettings here, because this will force low simulator settings
  594. # if all you have is a low end video card
  595.  
  596. setOption OpaqueUI $Off
  597. setOption LivePIP $Off
  598. setOption Reflection $Off
  599. setOption Ceiling $Off
  600. setOption EffectsQuality $Low
  601. setOption LightingQuality $Low
  602. setOption Shadows $Low
  603. setOption MaterialDetail $Low
  604. setOption ObjectDetail $Medium
  605. setOption ObjectHiding $On
  606. setOption SubjectTracking $Low
  607. setOption EnableLotImpostersInLot $Off
  608. setOption EnableNeighborhoodOccupantsInLot $Off
  609. setOption LotSkirtSizeIncrease 0
  610. endif
  611.  
  612. setOption LightingOptimizations $High
  613. setOption SnowOnGround $On
  614.  
  615. # adjust simulator based on cpu speed
  616. # adjust the sound quality based on cpu speed (this may be overridden below for low-end systems)
  617. # adjust animation sampling based on cpu speed
  618. if ($cpuSpeed >= $cpuLevelHigh and not $forceLowSettings)
  619. setOption SimulatorControls $High
  620. setOption SoundQuality $High
  621. setOption AnimationSamplingLevel $Medium
  622. elseif ($cpuSpeed >= $cpuLevelMedium and not $forceLowSettings)
  623. setOption SimulatorControls $Medium
  624. setOption SoundQuality $Medium
  625. setOption AnimationSamplingLevel $Medium
  626. else
  627. setOption SimulatorControls $Low
  628. setOption SoundQuality $Low
  629. setOption AnimationSamplingLevel $Low
  630. endif
  631.  
  632. # turn off fullscreen fade
  633. setOption FullscreenFadeEffect $Off
  634. if ($textureMemory >= 128 and not $isIntegratedChipset)
  635. setOption FullscreenFadeEffect $On
  636. endif
  637.  
  638. # screen res defaults
  639. if (($maxVertexProgramVersionHWMajor >= 1) and ($textureMemory >= 128) and not $forceLowResolution)
  640. setOption ScreenModeResolution $High
  641. elseif ($textureMemory >= 64 and not $forceLowResolution)
  642. if (($memory <= $memoryLevelLow) and ($cpuSpeed <= $cpuLevelLow))
  643. setOption ScreenModeResolution $MediumButDefaultLow
  644. else
  645. setOption ScreenModeResolution $Medium
  646. endif
  647. else
  648. setOption ScreenModeResolution $Low
  649. endif
  650.  
  651. if ($defaultLowResolution)
  652. setOption ScreenModeResolution $MediumButDefaultLow
  653. endif
  654.  
  655. # special event cameras for cinematics
  656. if (($maxPixelProgramVersionMajor >= 1) and ($supportsSpecialEventCamera))
  657. setOption SpecialEventCamera $On
  658. else
  659. setOption SpecialEventCamera $Off
  660. endif
  661.  
  662. # set dirty rect mode
  663. if ($supportsDirtyRect)
  664. setOption DirtyRect $Medium
  665. else
  666. setOption DirtyRect $High
  667. endif
  668.  
  669. # set turbo mode
  670. if ($supportsTurboRect)
  671. setOption Turbo $Medium
  672. else
  673. setOption Turbo $Low
  674. endif
  675.  
  676. if ($forceMediumMaterialDetail and ($memory >= $memoryLevelHigh) and ($cpuSpeed >= $cpuLevelHigh) and not $forceLowSettings)
  677. log $logGroup $logLevelWarning "Setting Material Detail"
  678. setOption MaterialDetail $Medium
  679. endif
  680.  
  681. if ($usingHighDetail and not $forceLowSettings)
  682. if ($forceMediumShadows)
  683. setOption Shadows $Medium
  684. endif
  685.  
  686. if ($forceMediumObjectDetail)
  687. setOption ObjectDetail $Medium
  688. endif
  689. endif
  690.  
  691. endif
  692.  
  693.  
  694. #############################################################################
  695. # save the selected configuration for this device.
  696.  
  697. boolProp activeDeviceUseSoftwareRasterizer $useSoftwareRasterizer
  698.  
  699. #############################################################################
  700. # tell the caller that we completely finished parsing the script
  701. intProp configParserErrorCode 0
  702.  
  703. uintProp hwMajorPSVersion $maxPixelProgramVersionMajor
  704.  
  705. log $logGroup $logLevelInfo "Finished Config File"
RAW Paste Data