|
|
@@ -49,7 +49,13 @@ static RwInt32 GcurSel = 0, GcurSelVM = 0; |
|
|
|
|
|
static RwBool useDefault;
|
|
static RwBool useDefault;
|
|
|
|
|
|
|
|
// What is that for anyway?
|
|
|
|
#ifndef IMPROVED_VIDEOMODE
|
|
static RwBool defaultFullscreenRes = TRUE;
|
|
static RwBool defaultFullscreenRes = TRUE;
|
|
|
|
#else
|
|
|
|
static RwBool defaultFullscreenRes = FALSE;
|
|
|
|
static RwInt32 bestWndMode = -1;
|
|
|
|
#endif
|
|
|
|
|
|
static psGlobalType PsGlobal;
|
|
static psGlobalType PsGlobal;
|
|
|
|
|
|
|
@@ -421,11 +427,7 @@ RwChar **_psGetVideoModeList() |
|
_VMList[i] = nil;
|
|
_VMList[i] = nil;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
#ifdef IMPROVED_VIDEOMODE
|
|
|
|
_VMList[i] = strdup("WINDOW");
|
|
|
|
#else
|
|
|
|
_VMList[i] = nil;
|
|
_VMList[i] = nil;
|
|
#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return _VMList;
|
|
return _VMList;
|
|
|
@@ -440,7 +442,7 @@ void _psSelectScreenVM(RwInt32 videoMode) |
|
|
|
|
|
FrontEndMenuManager.UnloadTextures();
|
|
FrontEndMenuManager.UnloadTextures();
|
|
|
|
|
|
if ( !_psSetVideoMode(RwEngineGetCurrentSubSystem(), videoMode) )
|
|
if (!_psSetVideoMode(RwEngineGetCurrentSubSystem(), videoMode))
|
|
{
|
|
{
|
|
RsGlobal.quit = TRUE;
|
|
RsGlobal.quit = TRUE;
|
|
}
|
|
}
|
|
|
@@ -607,51 +609,51 @@ psSelectDevice() |
|
}
|
|
}
|
|
|
|
|
|
// Find the videomode that best fits what we got from the settings file
|
|
// Find the videomode that best fits what we got from the settings file
|
|
RwInt32 bestMode = -1;
|
|
RwInt32 bestFsMode = -1;
|
|
RwInt32 bestWidth = -1;
|
|
RwInt32 bestWidth = -1;
|
|
RwInt32 bestHeight = -1;
|
|
RwInt32 bestHeight = -1;
|
|
RwInt32 bestDepth = -1;
|
|
RwInt32 bestDepth = -1;
|
|
for(GcurSelVM = 0; GcurSelVM < RwEngineGetNumVideoModes(); GcurSelVM++){
|
|
for(GcurSelVM = 0; GcurSelVM < RwEngineGetNumVideoModes(); GcurSelVM++){
|
|
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
|
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
|
if(!(vm.flags & rwVIDEOMODEEXCLUSIVE) != FrontEndMenuManager.m_nPrefsWindowed)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if(FrontEndMenuManager.m_nPrefsWindowed){
|
|
if (!(vm.flags & rwVIDEOMODEEXCLUSIVE)){
|
|
bestMode = GcurSelVM;
|
|
bestWndMode = GcurSelVM;
|
|
}else{
|
|
} else {
|
|
// try the largest one that isn't larger than what we wanted
|
|
// try the largest one that isn't larger than what we wanted
|
|
if(vm.width >= bestWidth && vm.width <= FrontEndMenuManager.m_nPrefsWidth &&
|
|
if(vm.width >= bestWidth && vm.width <= FrontEndMenuManager.m_nPrefsWidth &&
|
|
vm.height >= bestHeight && vm.height <= FrontEndMenuManager.m_nPrefsHeight &&
|
|
vm.height >= bestHeight && vm.height <= FrontEndMenuManager.m_nPrefsHeight &&
|
|
vm.depth >= bestDepth && vm.depth <= FrontEndMenuManager.m_nPrefsDepth){
|
|
vm.depth >= bestDepth && vm.depth <= FrontEndMenuManager.m_nPrefsDepth){
|
|
bestWidth = vm.width;
|
|
bestWidth = vm.width;
|
|
bestHeight = vm.height;
|
|
bestHeight = vm.height;
|
|
bestDepth = vm.depth;
|
|
bestDepth = vm.depth;
|
|
bestMode = GcurSelVM;
|
|
bestFsMode = GcurSelVM;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(bestMode < 0){
|
|
if(bestFsMode < 0){
|
|
MessageBox(nil, "Cannot find desired video mode", "GTA3", MB_OK);
|
|
MessageBox(nil, "Cannot find desired video mode", "GTA3", MB_OK);
|
|
return FALSE;
|
|
return FALSE;
|
|
}
|
|
}
|
|
GcurSelVM = bestMode;
|
|
GcurSelVM = bestFsMode;
|
|
|
|
|
|
FrontEndMenuManager.m_nDisplayVideoMode = GcurSelVM;
|
|
FrontEndMenuManager.m_nDisplayVideoMode = GcurSelVM;
|
|
FrontEndMenuManager.m_nPrefsVideoMode = FrontEndMenuManager.m_nDisplayVideoMode;
|
|
FrontEndMenuManager.m_nPrefsVideoMode = FrontEndMenuManager.m_nDisplayVideoMode;
|
|
GcurSelVM = FrontEndMenuManager.m_nDisplayVideoMode;
|
|
|
|
|
|
FrontEndMenuManager.m_nSelectedScreenMode = FrontEndMenuManager.m_nPrefsWindowed;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
|
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
|
|
|
|
|
#ifdef IMPROVED_VIDEOMODE
|
|
#ifdef IMPROVED_VIDEOMODE
|
|
if(vm.flags & rwVIDEOMODEEXCLUSIVE){
|
|
if (FrontEndMenuManager.m_nPrefsWindowed)
|
|
FrontEndMenuManager.m_nPrefsWidth = vm.width;
|
|
GcurSelVM = bestWndMode;
|
|
FrontEndMenuManager.m_nPrefsHeight = vm.height;
|
|
|
|
FrontEndMenuManager.m_nPrefsDepth = vm.depth;
|
|
// Now GcurSelVM is 0 but vm has sizes(and fullscreen flag) of the video mode we want, that's why we changed the rwVIDEOMODEEXCLUSIVE conditions below
|
|
}
|
|
FrontEndMenuManager.m_nPrefsWidth = vm.width;
|
|
FrontEndMenuManager.m_nPrefsWindowed = !(vm.flags & rwVIDEOMODEEXCLUSIVE);
|
|
FrontEndMenuManager.m_nPrefsHeight = vm.height;
|
|
|
|
FrontEndMenuManager.m_nPrefsDepth = vm.depth;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
FrontEndMenuManager.m_nCurrOption = 0;
|
|
FrontEndMenuManager.m_nCurrOption = 0;
|
|
|
@@ -677,6 +679,7 @@ psSelectDevice() |
|
}
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
|
|
#ifndef IMPROVED_VIDEOMODE
|
|
if (vm.flags & rwVIDEOMODEEXCLUSIVE)
|
|
if (vm.flags & rwVIDEOMODEEXCLUSIVE)
|
|
{
|
|
{
|
|
RsGlobal.maximumWidth = vm.width;
|
|
RsGlobal.maximumWidth = vm.width;
|
|
|
@@ -686,15 +689,13 @@ psSelectDevice() |
|
|
|
|
|
PSGLOBAL(fullScreen) = TRUE;
|
|
PSGLOBAL(fullScreen) = TRUE;
|
|
}
|
|
}
|
|
#ifdef IMPROVED_VIDEOMODE
|
|
#else
|
|
else{
|
|
|
|
RsGlobal.maximumWidth = FrontEndMenuManager.m_nPrefsWidth;
|
|
RsGlobal.maximumWidth = FrontEndMenuManager.m_nPrefsWidth;
|
|
RsGlobal.maximumHeight = FrontEndMenuManager.m_nPrefsHeight;
|
|
RsGlobal.maximumHeight = FrontEndMenuManager.m_nPrefsHeight;
|
|
RsGlobal.width = FrontEndMenuManager.m_nPrefsWidth;
|
|
RsGlobal.width = FrontEndMenuManager.m_nPrefsWidth;
|
|
RsGlobal.height = FrontEndMenuManager.m_nPrefsHeight;
|
|
RsGlobal.height = FrontEndMenuManager.m_nPrefsHeight;
|
|
|
|
|
|
PSGLOBAL(fullScreen) = FALSE;
|
|
PSGLOBAL(fullScreen) = !FrontEndMenuManager.m_nPrefsWindowed;
|
|
}
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
return TRUE;
|
|
return TRUE;
|
|
|
@@ -1023,6 +1024,8 @@ void resizeCB(GLFWwindow* window, int width, int height) { |
|
if (RwInitialised && height > 0 && width > 0) {
|
|
if (RwInitialised && height > 0 && width > 0) {
|
|
RwRect r;
|
|
RwRect r;
|
|
|
|
|
|
|
|
// TODO support resizing with mouse. Now enabling this makes weird things to trails and CameraSize messing with sizes
|
|
|
|
|
|
r.x = 0;
|
|
r.x = 0;
|
|
r.y = 0;
|
|
r.y = 0;
|
|
r.w = RsGlobal.maximumWidth;
|
|
r.w = RsGlobal.maximumWidth;
|
|
|
|