home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 51
/
PCGamer51_17Demos.iso
/
games
/
CM
/
CyclingManagerDemoCangas.exe
/
CyclingManagerDemo
/
scripts
/
common
/
config
/
onglet_video.cnc
< prev
next >
Wrap
Text File
|
2001-06-05
|
29KB
|
933 lines
var DeviceDesc oLogDevice;
func void LogDevice3D()
{
var szx szLine;
var i32x i,iNumDevices,ibfValidVideoMode;
// Get available devices number api
iNumDevices = GetNumDevices();
szLine="******************************\n";
szLine=strcat(szLine,"* 3D DEVICES *\n");
szLine=strcat(szLine,"******************************\n");
szLine=strcat(szLine,"D3DX devices number : ");
szLine=strcat(szLine,itoa(iNumDevices));
szLine=strcat(szLine,"\n\n");
print(szLine);
i=0;
while(i<iNumDevices)
{
GetDeviceDesc(i,oLogDevice);
szLine="Device n░";
szLine=strcat(szLine,itoa(i));
szLine=strcat(szLine,":\n ");
szLine=strcat(szLine,oLogDevice.szDesc);
szLine=strcat(szLine,"\n Driver:");
szLine=strcat(szLine,oLogDevice.szDrv);
szLine=strcat(szLine,"\n Desc:");
szLine=strcat(szLine,oLogDevice.szDrvDesc);
szLine=strcat(szLine,"\n");
print(szLine);
i=i+1;
}
// Default selected device
szLine="Default device : ";
szLine=strcat(szLine,itoa(GetDevice()));
szLine=strcat(szLine,"\n\n");
print(szLine);
// Get available video mode from 3d device api on the default device
ibfValidVideoMode = GetValidVideoMode(oObject_DeviceListbox.m_iSelectedDevice);
szLine="******************************\n";
szLine=strcat(szLine,"* VIDEO MODE *\n");
szLine=strcat(szLine,"******************************\n");
if(ibfValidVideoMode & DLC_VidMod_640x480x16)
{
szLine=strcat(szLine," 640x480x16\n");
}
if(ibfValidVideoMode & DLC_VidMod_640x480x32)
{
szLine=strcat(szLine," 640x480x32\n");
}
if(ibfValidVideoMode & DLC_VidMod_800x600x16)
{
szLine=strcat(szLine," 800x600x16\n");
}
if(ibfValidVideoMode & DLC_VidMod_800x600x32)
{
szLine=strcat(szLine," 800x600x32\n");
}
if(ibfValidVideoMode & DLC_VidMod_1024x768x16)
{
szLine=strcat(szLine," 1024x768x16\n");
}
if(ibfValidVideoMode & DLC_VidMod_1024x768x32)
{
szLine=strcat(szLine," 1024x768x32\n");
}
if(ibfValidVideoMode & DLC_VidMod_1280x1024x16)
{
szLine=strcat(szLine," 1280x1024x16\n");
}
if(ibfValidVideoMode & DLC_VidMod_1280x1024x32)
{
szLine=strcat(szLine," 1280x1024x32\n");
}
if(ibfValidVideoMode & DLC_VidMod_1600x1200x16)
{
szLine=strcat(szLine," 1600x1200x16\n");
}
if(ibfValidVideoMode & DLC_VidMod_1600x1200x32)
{
szLine=strcat(szLine," 1600x1200x32\n");
}
print(szLine);
// current video mode
szLine="Current video mode : ";
szLine=strcat(szLine,itoa(GetVideoMode()));
szLine=strcat(szLine,"\n");
print(szLine);
}
func void Init_VideoMode_List ()
{
var i32x i,iVideoMode,ibfValidVideoMode;
// Get available video mode from 3d device api
ibfValidVideoMode = GetValidVideoMode(oObject_DeviceListbox.m_iSelectedDevice);
// Fill Video Mode Array
i=0;
if(ibfValidVideoMode & DLC_VidMod_640x480x16)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_640x480x16;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "640x480x16";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_640x480x32)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_640x480x32;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "640x480x32";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_800x600x16)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_800x600x16;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "800x600x16";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_800x600x32)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_800x600x32;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "800x600x32";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1024x768x16)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1024x768x16;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1024x768x16";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1024x768x32)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1024x768x32;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1024x768x32";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1280x1024x16)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1280x1024x16;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1280x1024x16";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1280x1024x32)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1280x1024x32;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1280x1024x32";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1600x1200x16)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1600x1200x16;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1600x1200x16";
i=i+1;
}
if(ibfValidVideoMode & DLC_VidMod_1600x1200x32)
{
oVideoModes.iVideoMode[i] = DLC_VidMod_1600x1200x32;
// MistER-j WARNING LOCALIZED
oVideoModes.szVideoModeDesc[i] = "1600x1200x32";
i=i+1;
}
// Num Available video mode
oVideoModes.iNbVideoMode = i;
// Get Current video Mode
iVideoMode = GetVideoMode();
oObject_VideoModeListbox.m_iSelectedVideoMode = 0;
i=0;
while(i<10)
{
if(iVideoMode == oVideoModes.iVideoMode[i])
{
oObject_VideoModeListbox.m_iSelectedVideoMode = i;
}
i=i+1;
}
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void VideoMode_List_Item_Create ()
{
SetObjectMembersNumber(1);
SetComponentNumber(2);
// selection
oVideoMode_List_Item.iSelectionID = InitContainer(t_Common_Color_White);
SetContainerColor(oVideoMode_List_Item.iSelectionID,c_ListSelection);
SetContainerSize(oVideoMode_List_Item.iSelectionID, 150, 16);
SetComponentClipper(oVideoMode_List_Item.iSelectionID, 0, 0, 150, 16);
SetComponentVisibleStatus(oVideoMode_List_Item.iSelectionID,false);
// video mode name
oVideoMode_List_Item.iVideoModeNameID = InitContainer(tFontArial);
SetContainerText(oVideoMode_List_Item.iVideoModeNameID,g_szNull);
SetComponentSize(oVideoMode_List_Item.iVideoModeNameID,150,16);
// Change item size
SetObjectSize(150,16);
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void VideoMode_List_Item_Update (i32x _iItemIndex)
{
// Store item index into object
Seti32x(0,_iItemIndex);
// Update container text
SetContainerText(oVideoMode_List_Item.iVideoModeNameID,oVideoModes.szVideoModeDesc[_iItemIndex]);
}
func i32x VideoMode_List_Item_Event (i32x _iComponentID, i32x _iEvent)
{
if (_iComponentID == -1)
{
if (_iEvent == GUI_COMPONENT_MOUSE_LEAVE)
{
SetComponentVisibleStatus(oVideoMode_List_Item.iSelectionID, 0);
}
if (_iEvent == GUI_COMPONENT_MOUSE_ENTER)
{
SetComponentVisibleStatus(oVideoMode_List_Item.iSelectionID, 1);
}
if (_iEvent == GUI_LIST_SELECTITEM)
{
// Save selected item as selected video mode
oObject_VideoModeListbox.m_iSelectedVideoMode = Geti32x(0);
}
}
if (_iEvent == GUI_COMPONENT_MOUSE_LDOWN)
{
if (_iComponentID != oVideoMode_List_Item.iSelectionID)
{
PlaySound(0,sbClickSound[0]);
PushEvent(GUI_LIST_SELECTION);
}
}
return 1;
}
// *** Video Mode List box ***
func void Object_VideoModeListbox_Update ()
{
var szx szTemp;
// Get server name
szTemp = oVideoModes.szVideoModeDesc[oObject_VideoModeListbox.m_iSelectedVideoMode];
// Update text container
SetContainerText(oObject_VideoModeListbox.m_cText,szTemp);
}
func void Object_VideoModeListbox_CreateList (i32x _iX, i32x _iY)
{
var i32x id;
var i32x iSizeX;
iSizeX = GetComponentWidth(oObject_VideoModeListbox.m_cBack);
id = Init_LibObject_FilledCadre(t_fcadre_listbox,iSizeX,120);
oObject_VideoModeListbox.m_cListBack = id;
SetComponentPosition(id,_iX,_iY);
// Init Stage List
if(oObject_VideoModeListbox.m_cList == ID_NOT_CREATED)
{
oObject_VideoModeListbox.m_cList = InitList("Server List",
20,
iSizeX-12,110,
VideoMode_List_Item_Create,VideoMode_List_Item_Update,VideoMode_List_Item_Event,
t_btn_slider,
NullButtonState
);
SetComponentPosition(oObject_VideoModeListbox.m_cList,_iX+8,_iY+10);
}
AutoResize();
SetListNbItems(oObject_VideoModeListbox.m_cList,oVideoModes.iNbVideoMode);
}
//Object_VideoModeListbox Create func
//----------------------------------------------------------------------------------------------------------------//
func void Object_VideoModeListbox_Create ()
{
SetComponentNumber(10);
var i32x id;
var i32x x;
// No list by default
oObject_VideoModeListbox.m_cList = ID_NOT_CREATED;
// Width of list box
x = 200;
// Background
id = Init_LibObject_FilledCadre(t_fcadre_listbox,x,30);
oObject_VideoModeListbox.m_cBack = id;
// Text
id =InitContainer(tFontArial);
SetComponentPosition(id, 10, 8);
SetContainerText(id,g_szNull);
oObject_VideoModeListbox.m_cText=id;
// arrow
id = InitButton(t_arrow_down);
oObject_VideoModeListbox.m_cArrow=id;
SetContainerStateFunc(id,ThreeStateButtonState);
SetComponentPosition(id,x-22,5);
// first display update
Object_VideoModeListbox_Update();
// resize the List box
AutoResize();
}
//Object_VideoModeListbox Event func
//----------------------------------------------------------------------------------------------------------------//
func i32x Object_VideoModeListbox_Event (i32x _iComponentID, i32x _iEvent)
{
if (_iComponentID == oObject_VideoModeListbox.m_cList)
{
// The video settings need to be changed
oDialog_Configuration.m_bChangeVideo = true;
if(_iEvent == GUI_LIST_SELECTION )
{
oDialog_Configuration.m_iNeedSave = true;
Object_VideoModeListbox_Update();
DeleteComponent(oObject_VideoModeListbox.m_cList);
DeleteComponent(oObject_VideoModeListbox.m_cListBack);
oObject_VideoModeListbox.m_cList=ID_NOT_CREATED;
oObject_VideoModeListbox.m_cListBack=ID_NOT_CREATED;
AutoResize();
PushEvent(GUI_COMPONENT_REFRESH);
}
}
if (_iComponentID == oObject_VideoModeListbox.m_cArrow)
{
if(_iEvent == GUI_BUTTON_PRESSED )
{
PlaySound(0,sbClickSound[0]);
if(oObject_VideoModeListbox.m_cList == ID_NOT_CREATED)
{
var i32x y;
// Get text height
y = GetComponentHeight(oObject_VideoModeListbox.m_cBack);
// Create the list under the text
Object_VideoModeListbox_CreateList(0,y);
}
else
{
DeleteComponent(oObject_VideoModeListbox.m_cList);
DeleteComponent(oObject_VideoModeListbox.m_cListBack);
oObject_VideoModeListbox.m_cList=ID_NOT_CREATED;
oObject_VideoModeListbox.m_cListBack=ID_NOT_CREATED;
// Restore size
AutoResize();
}
}
}
return 1;
}
//Object_VideoModeListbox Init member
//----------------------------------------------------------------------------------------------------------------//
func void Object_VideoModeListbox_InitMembers ()
{
oObject_VideoModeListbox.m_szName = "Object_VideoModeListbox";
oObject_VideoModeListbox.oFunc.pcreate = Object_VideoModeListbox_Create;
oObject_VideoModeListbox.oFunc.pevent = Object_VideoModeListbox_Event;
}
// **************************************************************
// Device list box
// **************************************************************
func void Init_Device_List ()
{
var i32x i,iNumDevices;
// Get available devices number api
iNumDevices = GetNumDevices();
if(iNumDevices>16)
iNumDevices = 16;
// Fill device Mode Array
i=0;
while(i<iNumDevices)
{
GetDeviceDesc(i,oDevices.m_oDevice[i]);
i=i+1;
}
// Device number
oDevices.iNbDevices = iNumDevices;
// Default selected device
oObject_DeviceListbox.m_iSelectedDevice = GetDevice();
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Device_List_Item_Create ()
{
SetObjectMembersNumber(1);
SetComponentNumber(3);
// selection
oDevice_List_Item.iSelectionID = InitContainer(t_Common_Color_White);
SetContainerColor(oDevice_List_Item.iSelectionID,c_ListSelection);
SetContainerSize(oDevice_List_Item.iSelectionID, 300, 64);
SetComponentClipper(oDevice_List_Item.iSelectionID, 0, 0, 300, 64);
SetComponentVisibleStatus(oDevice_List_Item.iSelectionID,false);
// Device name
oDevice_List_Item.iDeviceNameID = InitContainer(tFontArial);
SetContainerOffset(oDevice_List_Item.iDeviceNameID,-1);
SetComponentSize(oDevice_List_Item.iDeviceNameID,300,80);
SetContainerText(oDevice_List_Item.iDeviceNameID,g_szNull);
SetComponentPosition(oDevice_List_Item.iDeviceNameID,0,16);
// Driver name
oDevice_List_Item.iDriverDescID = InitContainer(tFontArialItalique);
SetComponentSize(oDevice_List_Item.iDriverDescID,300,48);
SetContainerText(oDevice_List_Item.iDriverDescID,g_szNull);
// Change item size
SetObjectSize(300,64);
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Device_List_Item_Update (i32x _iItemIndex)
{
var szx szDriverDesc;
// Store item index into object
Seti32x(0,_iItemIndex);
// Update container text
SetContainerTextJustify(oDevice_List_Item.iDeviceNameID,oDevices.m_oDevice[_iItemIndex].szDesc);
szDriverDesc = oDevices.m_oDevice[_iItemIndex].szDrvDesc;
szDriverDesc = strcat(szDriverDesc," ");
szDriverDesc = strcat(szDriverDesc,oDevices.m_oDevice[_iItemIndex].szDrv);
SetContainerText(oDevice_List_Item.iDriverDescID,szDriverDesc);
}
func i32x Device_List_Item_Event (i32x _iComponentID, i32x _iEvent)
{
if (_iComponentID == -1)
{
if (_iEvent == GUI_COMPONENT_MOUSE_LEAVE)
{
SetComponentVisibleStatus(oDevice_List_Item.iSelectionID, 0);
}
if (_iEvent == GUI_COMPONENT_MOUSE_ENTER)
{
SetComponentVisibleStatus(oDevice_List_Item.iSelectionID, 1);
}
if (_iEvent == GUI_LIST_UNSELECTITEM)
{
SetComponentVisibleStatus(oDevice_List_Item.iSelectionID, false);
}
if (_iEvent == GUI_LIST_SELECTITEM)
{
// Save selected item as selected device
oObject_DeviceListbox.m_iSelectedDevice = Geti32x(0);
// Update video mode list
Init_VideoMode_List();
SetComponentVisibleStatus(oDevice_List_Item.iSelectionID, true);
}
}
if (_iEvent == GUI_COMPONENT_MOUSE_LDOWN)
{
if (_iComponentID != oDevice_List_Item.iSelectionID)
{
// The video settings need to be changed
oDialog_Configuration.m_bChangeVideo = true;
PlaySound(0,sbClickSound[0]);
PushEvent(GUI_LIST_SELECTION);
}
}
return 1;
}
// *** Device List box ***
func void Object_DeviceListbox_Update ()
{
var szx szTemp;
// Get device name
szTemp = oDevices.m_oDevice[oObject_DeviceListbox.m_iSelectedDevice].szDesc;
// Update text container
SetContainerTextJustify(oObject_DeviceListbox.m_cText,szTemp);
}
func void Object_DeviceListbox_CreateList (i32x _iX, i32x _iY)
{
var i32x id;
var i32x iSizeX;
iSizeX = GetComponentWidth(oObject_DeviceListbox.m_cBack);
id = Init_LibObject_FilledCadre(t_fcadre_listbox,iSizeX,246);
oObject_DeviceListbox.m_cListBack = id;
SetComponentPosition(id,_iX,_iY);
// Init Stage List
if(oObject_DeviceListbox.m_cList == ID_NOT_CREATED)
{
oObject_DeviceListbox.m_cList = InitList("Device List",
20,
iSizeX-12,236,
Device_List_Item_Create,Device_List_Item_Update,Device_List_Item_Event,
t_btn_slider,
NullButtonState
);
SetComponentPosition(oObject_DeviceListbox.m_cList,_iX+8,_iY+10);
}
AutoResize();
SetListNbItems(oObject_DeviceListbox.m_cList,oDevices.iNbDevices);
}
//Object_DeviceListbox_Create func
//----------------------------------------------------------------------------------------------------------------//
func void Object_DeviceListbox_Create ()
{
SetComponentNumber(10);
var i32x id;
var i32x x;
// No list by default
oObject_DeviceListbox.m_cList = ID_NOT_CREATED;
// Width of list box
x = 350;
// Background
id = Init_LibObject_FilledCadre(t_fcadre_listbox,x,50);
oObject_DeviceListbox.m_cBack = id;
// Text
id =InitContainer(tFontArial);
SetComponentSize(id,320,48);
SetContainerOffset(id,-1);
SetComponentPosition(id, 10, 8);
SetContainerText(id,g_szNull);
SetComponentClipper(id,0, 0, 320, 48);
oObject_DeviceListbox.m_cText=id;
// arrow
id = InitButton(t_arrow_down);
oObject_DeviceListbox.m_cArrow=id;
SetContainerStateFunc(id,ThreeStateButtonState);
SetComponentPosition(id,x-22,5);
// first display update
Object_DeviceListbox_Update();
// resize the List box
AutoResize();
}
//Object_DeviceListbox Event func
//----------------------------------------------------------------------------------------------------------------//
func i32x Object_DeviceListbox_Event (i32x _iComponentID, i32x _iEvent)
{
if (_iComponentID == oObject_DeviceListbox.m_cList)
{
if(_iEvent == GUI_LIST_SELECTION )
{
oDialog_Configuration.m_iNeedSave = true;
Object_DeviceListbox_Update();
DeleteComponent(oObject_DeviceListbox.m_cList);
DeleteComponent(oObject_DeviceListbox.m_cListBack);
oObject_DeviceListbox.m_cList=ID_NOT_CREATED;
oObject_DeviceListbox.m_cListBack=ID_NOT_CREATED;
AutoResize();
PushEvent(GUI_COMPONENT_REFRESH);
}
}
if (_iComponentID == oObject_DeviceListbox.m_cArrow)
{
if(_iEvent == GUI_BUTTON_PRESSED )
{
PlaySound(0,sbClickSound[0]);
if(oObject_DeviceListbox.m_cList == ID_NOT_CREATED)
{
var i32x y;
// Get text height
y = GetComponentHeight(oObject_DeviceListbox.m_cBack);
// Create the list under the text
Object_DeviceListbox_CreateList(0,y);
}
else
{
DeleteComponent(oObject_DeviceListbox.m_cList);
DeleteComponent(oObject_DeviceListbox.m_cListBack);
oObject_DeviceListbox.m_cList=ID_NOT_CREATED;
oObject_DeviceListbox.m_cListBack=ID_NOT_CREATED;
// Restore size
AutoResize();
}
}
}
return 1;
}
//Object_DeviceListbox Init member
//----------------------------------------------------------------------------------------------------------------//
func void Object_DeviceListbox_InitMembers ()
{
oObject_DeviceListbox.m_szName = "oObject_DeviceListbox";
oObject_DeviceListbox.oFunc.pcreate = Object_DeviceListbox_Create;
oObject_DeviceListbox.oFunc.pevent = Object_DeviceListbox_Event;
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Onglet video Create
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Onglet_video_Create ()
{
var i32x i,id;
// Dialog component number
SetComponentNumber(32);
// Fill Device Array with available videoMode
Init_Device_List();
// Fill Video mode Array with available videoMode
Init_VideoMode_List();
// Resize dialog
SetObjectSize(690,450);
// Texture bitdepth RB
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 10, 150);
SetContainerText(id, GetLocalizedFromGMKey(287));
oOnglet_video.m_c16Bits = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,6,GetLocalizedFromGMKey(288),tFontArial,0);
oOnglet_video.m_c32Bits = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,6,GetLocalizedFromGMKey(289),tFontArial,0);
SetTextButtonStateFunc(oOnglet_video.m_c16Bits,CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetTextButtonStateFunc(oOnglet_video.m_c32Bits,CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetComponentPosition(oOnglet_video.m_c16Bits, 200, 150);
SetComponentPosition(oOnglet_video.m_c32Bits, 360, 150);
// Double or triple buffering
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 10, 100);
SetContainerText(id, GetLocalizedFromGMKey(402));
oOnglet_video.m_cDoubleBuffering = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,6,GetLocalizedFromGMKey(403),tFontArial,0);
SetTextButtonStateFunc(oOnglet_video.m_cDoubleBuffering,CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetComponentPosition(oOnglet_video.m_cDoubleBuffering, 200, 100);
oOnglet_video.m_cTripleBuffering = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,6,GetLocalizedFromGMKey(404),tFontArial,0);
SetTextButtonStateFunc(oOnglet_video.m_cTripleBuffering,CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetComponentPosition(oOnglet_video.m_cTripleBuffering, 360, 100);
print(itoa(IsTripleBuffering()));
if (IsTripleBuffering())
{
oOnglet_video.m_bTripleBuffer = true;
SetTextRadioButtonCheckBox(oOnglet_video.m_cTripleBuffering, 1);
}
else
{
oOnglet_video.m_bTripleBuffer = false;
SetTextRadioButtonCheckBox(oOnglet_video.m_cDoubleBuffering, 1);
}
// Default texture bit depth
if (GetTexBitDepth() == 32)
{
oOnglet_video.m_iTextureBitDepth = 32;
SetTextRadioButtonCheckBox(oOnglet_video.m_c32Bits, 1);
SetTextRadioButtonCheckBox(oOnglet_video.m_c16Bits, 0);
}
else
{
oOnglet_video.m_iTextureBitDepth = 16;
SetTextRadioButtonCheckBox(oOnglet_video.m_c32Bits, 0);
SetTextRadioButtonCheckBox(oOnglet_video.m_c16Bits, 1);
}
// Cyclist LOD
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 10, 200);
SetContainerText(id, GetLocalizedFromGMKey(410));
SetContainerOffset(id,-1);
oOnglet_video.m_iCyclistLOD = GetCyclistLOD();
i=0;
while(i<4)
{
oOnglet_video.m_cCyclistLOD[i] = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,4,GetLocalizedFromGMKey(406+i),tFontArial,0);
SetTextButtonStateFunc(oOnglet_video.m_cCyclistLOD[i],CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetComponentPosition(oOnglet_video.m_cCyclistLOD[i], 200+112*i, 200);
if(i==oOnglet_video.m_iCyclistLOD)
{
SetTextRadioButtonCheckBox(oOnglet_video.m_cCyclistLOD[i], 1);
}
i=i+1;
}
// Texture LOD
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 10, 250);
SetContainerText(id, GetLocalizedFromGMKey(411));
SetContainerOffset(id,-1);
oOnglet_video.m_iTextureLOD = GetTextureLOD();
i=0;
while(i<2)
{
oOnglet_video.m_cTextureLOD[i] = Init_LibObject_MultiRadioButtonWithText(tButton32Multi,4,GetLocalizedFromGMKey(406+(2*i)),tFontArial,0);
SetTextButtonStateFunc(oOnglet_video.m_cTextureLOD[i],CheckBoxMultiState,MultiRadioButtonWithText_TextState);
SetComponentPosition(oOnglet_video.m_cTextureLOD[i], 200+112*i, 250);
if(i==oOnglet_video.m_iTextureLOD)
{
SetTextRadioButtonCheckBox(oOnglet_video.m_cTextureLOD[i], 1);
}
i=i+1;
}
// Video Mode list box
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 400, 0);
SetContainerText(id, GetLocalizedFromGMKey(124));
Object_VideoModeListbox_InitMembers();
oOnglet_video.m_cVideoModeListBox = InitObject(
oObject_VideoModeListbox.m_szName, // Object Name
oObject_VideoModeListbox.oFunc.pcreate, // Create func
oObject_VideoModeListbox.oFunc.pevent // Event func
);
SetComponentPosition(oOnglet_video.m_cVideoModeListBox, 400, 20);
// Device Mode list box
id = InitContainer(tFontArialItalique);
SetComponentPosition(id, 10, 0);
SetContainerText(id, GetLocalizedFromGMKey(123));
Object_DeviceListbox_InitMembers();
oOnglet_video.m_cDeviceListBox = InitObject(
oObject_DeviceListbox.m_szName, // Object Name
oObject_DeviceListbox.oFunc.pcreate, // Create func
oObject_DeviceListbox.oFunc.pevent // Event func
);
SetComponentPosition(oOnglet_video.m_cDeviceListBox, 10, 20);
}
func i32x Onglet_video_Event (i32x _iComponentID, i32x _iEvent)
{
var i32x i,index;
if(_iEvent == GUI_RADIOBUTTON_CHANGED)
{
PlaySound(0,sbClickSound[0]);
// The video settings need to be changed
oDialog_Configuration.m_bChangeVideo = true;
//Need to save new settings
oDialog_Configuration.m_iNeedSave = true;
if (_iComponentID == oOnglet_video.m_c16Bits)
{
oOnglet_video.m_iTextureBitDepth = 16;
SetTextRadioButtonCheckBox(oOnglet_video.m_c32Bits,0);
}
else if (_iComponentID == oOnglet_video.m_c32Bits)
{
oOnglet_video.m_iTextureBitDepth = 32;
SetTextRadioButtonCheckBox(oOnglet_video.m_c16Bits,0);
}
else if (_iComponentID == oOnglet_video.m_cDoubleBuffering)
{
oOnglet_video.m_bTripleBuffer = false;
SetTextRadioButtonCheckBox(oOnglet_video.m_cTripleBuffering,0);
}
else if (_iComponentID == oOnglet_video.m_cTripleBuffering)
{
oOnglet_video.m_bTripleBuffer = true;
SetTextRadioButtonCheckBox(oOnglet_video.m_cDoubleBuffering,0);
}
else if ((_iComponentID >= oOnglet_video.m_cCyclistLOD[0])&&(_iComponentID <= oOnglet_video.m_cCyclistLOD[3]))
{
index = _iComponentID - oOnglet_video.m_cCyclistLOD[0];
i=0;
while(i<4)
{
if(i != index)
SetTextRadioButtonCheckBox(oOnglet_video.m_cCyclistLOD[i],0);
i=i+1;
}
oOnglet_video.m_iCyclistLOD = index;
}
else if ((_iComponentID >= oOnglet_video.m_cTextureLOD[0])&&(_iComponentID <= oOnglet_video.m_cTextureLOD[1]))
{
index = _iComponentID - oOnglet_video.m_cTextureLOD[0];
i=0;
while(i<2)
{
if(i != index)
SetTextRadioButtonCheckBox(oOnglet_video.m_cTextureLOD[i],0);
i=i+1;
}
oOnglet_video.m_iTextureLOD = index;
}
}
return 1;
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Constructor
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func i32x Onglet_video_Constructor ()
{
oOnglet_video.iWindowID = InitObject(
oOnglet_video.szName,
oOnglet_video.oFunc.pcreate,
oOnglet_video.oFunc.pevent
);
return oOnglet_video.iWindowID;
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Destructor
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Onglet_video_Destructor ()
{
DeleteComponent(oOnglet_video.iWindowID);
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Onglet video Init member
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Onglet_video_InitMembers ()
{
oOnglet_video.szName = "Video Configuration";
oOnglet_video.oFunc.pcreate = Onglet_video_Create;
oOnglet_video.oFunc.pevent = Onglet_video_Event;
}