Loading the graphic settings from an .ini file:
_graphics:
//Display height
DH$ = GS decrypttext ( lookup$ ( settings , "Graphics/DH" , "480" ) , "PASSWORD" )
//Display width
DW$ = GS decrypttext ( lookup$ ( settings , "Graphics/DW" , "640" ) , "PASSWORD" )
//Vsync
Vsync$ = GS decrypttext ( lookup$ ( settings , "Graphics/Vsync" , "1") , "PASSWORD" )
//Depth
Depth$ = GS decrypttext ( lookup$ ( settings , "Graphics/Depth" , "8" ) , "PASSWORD" )
DH = val ( DH$ )
DW = val ( DW$ )
Vsync = val ( Vsync$ )
Depth = val ( Depth$ )
return
The ini file looks like this:
[Version]
Dversion=wTf¥qh (encrypted ... = 0.0001)
[Graphics]
DH=x_h¥ (encrypted ... = 1080)
DW=xVn¥ (encrypted ... = 1920)
Vsync=x (encrypted ... = 1)
Depth=zX (encrypted ... = 32)
[Sound]
then I just call the function and set the settings like this:
#include "Files.dba"
_startup:
gosub _graphics
cls
sync on
sync rate 60
autocam off
maximize window
set display mode DW , DH , Depth , Vsync
kd setanisotropy 1
set ambient light 75
load image "Media/Textures/loading.jpg" , 9
for n = 0 to 1
cls
paste image 9 , 0 , 0
sync
next n
return
Please note that it is not the encryption/decryption which is faulty, I get an error that 32 bit is not supported, not that the depth is an illegal number!