diff --git a/script/win_installer/readme.txt b/script/win_installer/readme.txt index 8fa43cc..48178db 100644 --- a/script/win_installer/readme.txt +++ b/script/win_installer/readme.txt @@ -58,4 +58,6 @@ www.rtsoft.com * Default color under status bar is now black, fixes issue when transparent colors are used in the stats area, random garbage would show through * (windows) Version # is now shown in title bar * (bugfix) Fixed some issues with how default offsets are calculated, it fixed some problems where sprites would be in the wrong place in certain DMODs -* (bugfix, windows) "Smoothing" no longer incorrectly turns on if you lose/regain focus \ No newline at end of file +* (bugfix, windows) "Smoothing" no longer incorrectly turns on if you lose/regain focus +* (windows) Added "Windowed Borderless fullscreen mode" toggle, defaults to off. It will try to do 640X480 at your native monitor resolution by default now on + a clean install. It's a bit wacky how fullscreen/bordlerless fullscreen and clicking screen sizes works, but it usually gets you to where you want to go eventually diff --git a/source/App.cpp b/source/App.cpp index 4911c04..e3ebb3d 100644 --- a/source/App.cpp +++ b/source/App.cpp @@ -24,6 +24,10 @@ #ifdef WINAPI +extern int g_winVideoScreenX; +extern int g_winVideoScreenY; +extern bool g_bUseBorderlessFullscreenOnWindows; + #include "StackWalker/StackUtils.h" extern bool g_bIsFullScreen; #endif @@ -518,27 +522,33 @@ if (GetEmulatedPlatformID() == PLATFORM_ID_IOS) GetBaseApp()->m_sig_unloadSurfaces.connect(1, boost::bind(&App::OnUnloadSurfaces, this)); #ifdef WINAPI - int videox = GetApp()->GetVarWithDefault("video_x", uint32(0))->GetUINT32(); - int videoy = GetApp()->GetVarWithDefault("video_y", uint32(0))->GetUINT32(); - int fullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(0))->GetUINT32(); + int videox = GetApp()->GetVarWithDefault("video_x", uint32(640))->GetUINT32(); + int videoy = GetApp()->GetVarWithDefault("video_y", uint32(480))->GetUINT32(); + int fullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(1))->GetUINT32(); + //bool borderlessfullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(1))->GetUINT32(); - if (fullscreen) + + if (fullscreen && g_bUseBorderlessFullscreenOnWindows) { LogMsg("Setting fullscreen..."); //GetMessageManager()->SendGUI(MESSAGE_TYPE_GUI_TOGGLE_FULLSCREEN, 0, 0); //lParam holds a lot of random data about the press, look it up if - + g_bIsFullScreen = false; //because we're using toggle.. OnFullscreenToggleRequest(); } else { + /* if (videox != 0 && videoy != 0) { //remember old setup SetVideoMode(videox, videoy, false, 0); } + */ } + #endif + return true; } @@ -726,6 +736,8 @@ void App::OnScreenSizeChange() GetApp()->GetVar("fullscreen")->Set(uint32(g_bIsFullScreen)); GetApp()->GetVar("videox")->Set(uint32(GetPrimaryGLX())); GetApp()->GetVar("videoy")->Set(uint32(GetPrimaryGLY())); + //GetApp()->GetVarWithDefault("borderless_fullscreen", uint32(g_bUseBorderlessFullscreenOnWindows))->Set(uint32(0)); + #endif } @@ -852,8 +864,7 @@ bool App::GetIconsOnLeft() #include "win/app/main.h" #endif -extern int g_winVideoScreenX; -extern int g_winVideoScreenY; + bool App::OnPreInitVideo() { @@ -870,14 +881,18 @@ bool App::OnPreInitVideo() #ifdef RT_SCRIPT_BUILD SetEmulatedPlatformID(PLATFORM_ID_WINDOWS); - g_winVideoScreenX = 1024; - g_winVideoScreenY = 768; + g_winVideoScreenX = 640; + g_winVideoScreenY = 480; + #endif // g_winVideoScreenX = 800; // g_winVideoScreenY = 1280; //windows only + + + VariantDB temp; temp.Load("save.dat"); Variant *pVarX = temp.GetVarIfExists("videox"); @@ -887,8 +902,11 @@ bool App::OnPreInitVideo() g_winVideoScreenX = pVarX->GetUINT32(); g_winVideoScreenY = pVarY->GetUINT32(); - + g_bIsFullScreen = temp.GetVarWithDefault("fullscreen", uint32(1))->GetUINT32(); + g_bUseBorderlessFullscreenOnWindows = temp.GetVarWithDefault("borderless_fullscreen", uint32(0))->GetUINT32() != 0; } + + #endif return true; diff --git a/source/GUI/MainMenu.cpp b/source/GUI/MainMenu.cpp index 5782a49..291801b 100644 --- a/source/GUI/MainMenu.cpp +++ b/source/GUI/MainMenu.cpp @@ -1,29 +1,29 @@ -#include "PlatformPrecomp.h" -#include "MainMenu.h" -#include "Entity/EntityUtils.h" -#include "DebugMenu.h" -#include "GameMenu.h" -#include "LoadMenu.h" -#include "dink/dink.h" -#include "DMODMenu.h" -#include "PauseMenu.h" -#include "DMODInstallMenu.h" -#include "PopUpMenu.h" -#include "OptionsMenu.h" -#include "AboutMenu.h" -#include "FileSystem/StreamingInstance.h" -#include "Entity/CustomInputComponent.h" -#include "Entity/HTTPComponent.h" - -bool g_bMainMenuFirstTime = true; -bool g_bDidVersionCheck = false; - -Entity * VersionShowScoreMessage(Entity *pMenu, string msg); +#include "PlatformPrecomp.h" +#include "MainMenu.h" +#include "Entity/EntityUtils.h" +#include "DebugMenu.h" +#include "GameMenu.h" +#include "LoadMenu.h" +#include "dink/dink.h" +#include "DMODMenu.h" +#include "PauseMenu.h" +#include "DMODInstallMenu.h" +#include "PopUpMenu.h" +#include "OptionsMenu.h" +#include "AboutMenu.h" +#include "FileSystem/StreamingInstance.h" +#include "Entity/CustomInputComponent.h" +#include "Entity/HTTPComponent.h" -void ReloadMainMenu(VariantList *pVList) -{ - MainMenuCreate(pVList->Get(0).GetEntity()); -} +bool g_bMainMenuFirstTime = true; +bool g_bDidVersionCheck = false; + +Entity * VersionShowScoreMessage(Entity *pMenu, string msg); + +void ReloadMainMenu(VariantList *pVList) +{ + MainMenuCreate(pVList->Get(0).GetEntity()); +} void OnVersionDownloadError(VariantList *pVList) { @@ -39,14 +39,14 @@ void OnVersionDownloadError(VariantList *pVList) VersionShowScoreMessage(pMenu, msg); - //kill current menu - GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL); - - //reload the main menu in a bit + //kill current menu + GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL); + + //reload the main menu in a bit VariantList vList(pMenu->GetParent()); GetMessageManager()->CallStaticFunction(ReloadMainMenu, 1000, &vList, TIMER_SYSTEM); -} +} Entity * VersionShowScoreMessage(Entity *pMenu, string msg) @@ -97,7 +97,7 @@ void OnVersionDownloadHTTPFinish(VariantList *pVList) float version = StringToFloat(lines[1]); if (version > GetApp()->GetVersion() + 0.001f) //the extra for an epsilon to flight floating point weirdness, trust me { - PopUpCreate(pMenu, "New version detected! Download it now?", lines[2], + PopUpCreate(pMenu, "New version detected! Download it now?", lines[2], "cancel_update", "`wCancel", "url_update", "`wDownload", true); return; } @@ -106,246 +106,246 @@ void OnVersionDownloadHTTPFinish(VariantList *pVList) VersionShowScoreMessage(pMenu, "No new updates found."); - //kill current menu - GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL); - - //reload the main menu in a bit + //kill current menu + GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL); + + //reload the main menu in a bit VariantList vList(pMenu->GetParent()); GetMessageManager()->CallStaticFunction(ReloadMainMenu, 1000, &vList, TIMER_SYSTEM); } - - -void MainMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from -{ - Entity *pEntClicked = pVList->m_variant[1].GetEntity(); - - LogMsg("Clicked %s entity at %s", pEntClicked->GetName().c_str(),pVList->m_variant[1].Print().c_str()); - - if (pEntClicked->GetName() == "New") - { - DisableAllButtonsEntity(pEntClicked->GetParent()); - InitDinkPaths(GetBaseAppPath(), "dink", ""); - - //slide it off the screen and then kill the whole menu tree - SlideScreen(pEntClicked->GetParent(), false); - GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - GameCreate(pEntClicked->GetParent()->GetParent(), 0, ""); - GetApp()->GetVar("showViewHint")->Set(uint32(0)); //so this won't be shown here - - } - - if (pEntClicked->GetName() == "Load") - { - DisableAllButtonsEntity(pEntClicked->GetParent()); - InitDinkPaths(GetBaseAppPath(), "dink", ""); - //slide it off the screen and then kill the whole menu tree - SlideScreen(pEntClicked->GetParent(), false); - GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - LoadMenuCreate(pEntClicked->GetParent()->GetParent()); - } - - if (pEntClicked->GetName() == "Continue") - { - DisableAllButtonsEntity(pEntClicked->GetParent()); - InitDinkPaths(GetBaseAppPath(), "dink", ""); - //slide it off the screen and then kill the whole menu tree - SlideScreen(pEntClicked->GetParent(), false); - GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - GameCreate(pEntClicked->GetParent()->GetParent(), 0, GetSavePath()+"dink/"+string("continue_state.dat")); - } - - if (pEntClicked->GetName() == "Debug") - { - //overlay the debug menu over this one - pEntClicked->GetParent()->RemoveComponentByName("FocusInput"); - DebugMenuCreate(pEntClicked->GetParent()); - } - - if (pEntClicked->GetName() == "Add-ons") - { - DisableAllButtonsEntity(pEntClicked->GetParent()); - //slide it off the screen and then kill the whole menu tree - SlideScreen(pEntClicked->GetParent(), false); - GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - // DMODInstallMenuCreate(pEntClicked->GetParent()->GetParent(), "files.dinknetwork.com/three_amulets-v1_1.dmod", ""); - DMODMenuCreate(pEntClicked->GetParent()->GetParent()); - } - - - if (pEntClicked->GetName() == "Options") - { - //DisableAllButtonsEntity(pEntClicked->GetParent()); - pEntClicked->GetParent()->RemoveComponentByName("FocusInput"); - pEntClicked->GetParent()->RemoveComponentByName("FocusUpdate"); - - //SlideScreen(pEntClicked->GetParent(), false); - //GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - OptionsMenuCreate(pEntClicked->GetParent()); - } - - if (pEntClicked->GetName() == "About") - { - DisableAllButtonsEntity(pEntClicked->GetParent()); - //RemoveFocusIfNeeded(pEntClicked->GetParent()); //slide it off the screen and then kill the whole menu tree - SlideScreen(pEntClicked->GetParent(), false); - GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); - AboutMenuCreate(pEntClicked->GetParent()->GetParent()); - } - - if (pEntClicked->GetName() == "rtsoftlogo") - { - PopUpCreate(pEntClicked->GetParent(), "Would you like to visit `wrtsoft.com``?", "http://www.rtsoft.com/iphone", - "cancel", "`wCancel", "url", "`wLaunch", true); - return; - } - - GetEntityRoot()->PrintTreeAsText(); //useful for debugging -} - - -string GetNextDMODToInstall() -{ - //if (!GetApp()->CanDownloadDMODS()) return ""; //ignore it - - vector files = GetFilesAtPath(GetSavePath()); - - //LogMsg("listing files"); - - for (unsigned int i=0; i < files.size(); i++) - { - //LogMsg(files[i].c_str()); - if (GetFileExtension(files[i]) == "dmod") - { - return files[i]; - } - } - - return ""; -} - -void MainOnStartLoading(VariantList *pVList) -{ - Entity *pBG = pVList->m_variant[0].GetEntity(); - - string fileName = pVList->m_variant[1].GetString(); - - DisableAllButtonsEntity(pBG); - SlideScreen(pBG, false); - GetMessageManager()->CallEntityFunction(pBG, 500, "OnDelete", NULL); - - string fName = GetNextDMODToInstall(); - if (!fName.empty()) - { - DMODInstallMenuCreate(pBG->GetParent(), "", GetDMODRootPath(), GetSavePath()+fName); - } else - { - GameCreate(pBG->GetParent(), 0, fileName, "Continuing last game..."); - } -} - - -void ImportSaveFileIfApplicable(string fName) -{ - if (GetFileExtension(fName) != "dat") return; - - if (fName == "save.dat") return; //it's not this one - if (fName == "state.dat") return; //it's not this one - if (fName == "continue_state.dat") return; //it's not this one - if (fName == "autosave.dat") return; //it's not this one - if (fName == "autosavedb.dat") return; //it's not this one - if (fName == "quicksave.dat") return; //it's not this one - if (fName == "quickload.dat") return; //it's not this one - - - //check for any dmod name specified after a _ - - size_t index = fName.find_last_of('_'); - size_t periodPos = fName.find_last_of('.'); - - if (periodPos == string::npos || GetFileExtension(fName) != "dat") return; - - string dmodName = ""; - - if (index != string::npos) - { - //yeah, it has one - dmodName = fName.substr(index+1, periodPos-(index+1)); - } - - //ok, ready to copy it. But figure out where, and what the filename should be - string destPath = GetSavePath()+"dink/"; - string destFile = fName; - - //modify if needed for a dmod - - if (!dmodName.empty()) - { - destPath = GetDMODRootPath()+dmodName+"/"; - destFile = fName.substr(0, index); - destFile += fName.substr(periodPos, fName.size()-periodPos); - } - - LogMsg("Importing %s to %s", (GetSavePath()+fName).c_str(), (destPath+destFile).c_str()); - GetFileManager()->Copy(GetSavePath()+fName, destPath+destFile, false); - - RemoveFile(GetSavePath()+fName, false); -} - -void CheckForImportedSavedGames() -{ - if (!GetEmulatedPlatformID() == PLATFORM_ID_IOS) return; - - vector files = GetFilesAtPath(GetSavePath()); - - for (uint32 i=0; i < files.size(); i++) - { - ImportSaveFileIfApplicable(files[i]); - } -} - -void MainMenuContinueLast(VariantList *pVList) -{ - Entity *pBG = pVList->Get(0).GetEntity(); - - pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); - VariantList vList(pBG, GetSavePath()+string("state.dat")); - GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); - g_bMainMenuFirstTime = false; - - LogMsg("Continuing"); -} - -void MainMenuContinueLastNewStyle(VariantList *pVList) -{ - Entity *pBG = pVList->Get(0).GetEntity(); - - pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); - VariantList vList(pBG, ReadLastPathSaved()+string("continue_state.dat")); - GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); - g_bMainMenuFirstTime = false; - WriteLastPathSaved(""); - LogMsg("Contining"); -} - -void MainMenuCancelLast(VariantList *pVList) -{ - Entity *pMenu = pVList->Get(0).GetEntity(); - - WriteLastPathSaved(""); - RemoveFile(GetSavePath()+"state.dat", false); - - //kill current menu - GetMessageManager()->CallEntityFunction(pMenu, 0, "OnDelete", NULL); - - //reload the main menu - MainMenuCreate(pMenu->GetParent()); -} - -void CheckForNewVersion(Entity *pMenu) -{ - + + +void MainMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from +{ + Entity *pEntClicked = pVList->m_variant[1].GetEntity(); + + LogMsg("Clicked %s entity at %s", pEntClicked->GetName().c_str(),pVList->m_variant[1].Print().c_str()); + + if (pEntClicked->GetName() == "New") + { + DisableAllButtonsEntity(pEntClicked->GetParent()); + InitDinkPaths(GetBaseAppPath(), "dink", ""); + + //slide it off the screen and then kill the whole menu tree + SlideScreen(pEntClicked->GetParent(), false); + GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + GameCreate(pEntClicked->GetParent()->GetParent(), 0, ""); + GetApp()->GetVar("showViewHint")->Set(uint32(0)); //so this won't be shown here + + } + + if (pEntClicked->GetName() == "Load") + { + DisableAllButtonsEntity(pEntClicked->GetParent()); + InitDinkPaths(GetBaseAppPath(), "dink", ""); + //slide it off the screen and then kill the whole menu tree + SlideScreen(pEntClicked->GetParent(), false); + GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + LoadMenuCreate(pEntClicked->GetParent()->GetParent()); + } + + if (pEntClicked->GetName() == "Continue") + { + DisableAllButtonsEntity(pEntClicked->GetParent()); + InitDinkPaths(GetBaseAppPath(), "dink", ""); + //slide it off the screen and then kill the whole menu tree + SlideScreen(pEntClicked->GetParent(), false); + GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + GameCreate(pEntClicked->GetParent()->GetParent(), 0, GetSavePath()+"dink/"+string("continue_state.dat")); + } + + if (pEntClicked->GetName() == "Debug") + { + //overlay the debug menu over this one + pEntClicked->GetParent()->RemoveComponentByName("FocusInput"); + DebugMenuCreate(pEntClicked->GetParent()); + } + + if (pEntClicked->GetName() == "Add-ons") + { + DisableAllButtonsEntity(pEntClicked->GetParent()); + //slide it off the screen and then kill the whole menu tree + SlideScreen(pEntClicked->GetParent(), false); + GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + // DMODInstallMenuCreate(pEntClicked->GetParent()->GetParent(), "files.dinknetwork.com/three_amulets-v1_1.dmod", ""); + DMODMenuCreate(pEntClicked->GetParent()->GetParent()); + } + + + if (pEntClicked->GetName() == "Options") + { + //DisableAllButtonsEntity(pEntClicked->GetParent()); + pEntClicked->GetParent()->RemoveComponentByName("FocusInput"); + pEntClicked->GetParent()->RemoveComponentByName("FocusUpdate"); + + //SlideScreen(pEntClicked->GetParent(), false); + //GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + OptionsMenuCreate(pEntClicked->GetParent()); + } + + if (pEntClicked->GetName() == "About") + { + DisableAllButtonsEntity(pEntClicked->GetParent()); + //RemoveFocusIfNeeded(pEntClicked->GetParent()); //slide it off the screen and then kill the whole menu tree + SlideScreen(pEntClicked->GetParent(), false); + GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL); + AboutMenuCreate(pEntClicked->GetParent()->GetParent()); + } + + if (pEntClicked->GetName() == "rtsoftlogo") + { + PopUpCreate(pEntClicked->GetParent(), "Would you like to visit `wrtsoft.com``?", "http://www.rtsoft.com/iphone", + "cancel", "`wCancel", "url", "`wLaunch", true); + return; + } + + //GetEntityRoot()->PrintTreeAsText(); //useful for debugging +} + + +string GetNextDMODToInstall() +{ + //if (!GetApp()->CanDownloadDMODS()) return ""; //ignore it + + vector files = GetFilesAtPath(GetSavePath()); + + //LogMsg("listing files"); + + for (unsigned int i=0; i < files.size(); i++) + { + //LogMsg(files[i].c_str()); + if (GetFileExtension(files[i]) == "dmod") + { + return files[i]; + } + } + + return ""; +} + +void MainOnStartLoading(VariantList *pVList) +{ + Entity *pBG = pVList->m_variant[0].GetEntity(); + + string fileName = pVList->m_variant[1].GetString(); + + DisableAllButtonsEntity(pBG); + SlideScreen(pBG, false); + GetMessageManager()->CallEntityFunction(pBG, 500, "OnDelete", NULL); + + string fName = GetNextDMODToInstall(); + if (!fName.empty()) + { + DMODInstallMenuCreate(pBG->GetParent(), "", GetDMODRootPath(), GetSavePath()+fName); + } else + { + GameCreate(pBG->GetParent(), 0, fileName, "Continuing last game..."); + } +} + + +void ImportSaveFileIfApplicable(string fName) +{ + if (GetFileExtension(fName) != "dat") return; + + if (fName == "save.dat") return; //it's not this one + if (fName == "state.dat") return; //it's not this one + if (fName == "continue_state.dat") return; //it's not this one + if (fName == "autosave.dat") return; //it's not this one + if (fName == "autosavedb.dat") return; //it's not this one + if (fName == "quicksave.dat") return; //it's not this one + if (fName == "quickload.dat") return; //it's not this one + + + //check for any dmod name specified after a _ + + size_t index = fName.find_last_of('_'); + size_t periodPos = fName.find_last_of('.'); + + if (periodPos == string::npos || GetFileExtension(fName) != "dat") return; + + string dmodName = ""; + + if (index != string::npos) + { + //yeah, it has one + dmodName = fName.substr(index+1, periodPos-(index+1)); + } + + //ok, ready to copy it. But figure out where, and what the filename should be + string destPath = GetSavePath()+"dink/"; + string destFile = fName; + + //modify if needed for a dmod + + if (!dmodName.empty()) + { + destPath = GetDMODRootPath()+dmodName+"/"; + destFile = fName.substr(0, index); + destFile += fName.substr(periodPos, fName.size()-periodPos); + } + + LogMsg("Importing %s to %s", (GetSavePath()+fName).c_str(), (destPath+destFile).c_str()); + GetFileManager()->Copy(GetSavePath()+fName, destPath+destFile, false); + + RemoveFile(GetSavePath()+fName, false); +} + +void CheckForImportedSavedGames() +{ + if (!GetEmulatedPlatformID() == PLATFORM_ID_IOS) return; + + vector files = GetFilesAtPath(GetSavePath()); + + for (uint32 i=0; i < files.size(); i++) + { + ImportSaveFileIfApplicable(files[i]); + } +} + +void MainMenuContinueLast(VariantList *pVList) +{ + Entity *pBG = pVList->Get(0).GetEntity(); + + pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); + VariantList vList(pBG, GetSavePath()+string("state.dat")); + GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); + g_bMainMenuFirstTime = false; + + LogMsg("Continuing"); +} + +void MainMenuContinueLastNewStyle(VariantList *pVList) +{ + Entity *pBG = pVList->Get(0).GetEntity(); + + pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); + VariantList vList(pBG, ReadLastPathSaved()+string("continue_state.dat")); + GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); + g_bMainMenuFirstTime = false; + WriteLastPathSaved(""); + LogMsg("Contining"); +} + +void MainMenuCancelLast(VariantList *pVList) +{ + Entity *pMenu = pVList->Get(0).GetEntity(); + + WriteLastPathSaved(""); + RemoveFile(GetSavePath()+"state.dat", false); + + //kill current menu + GetMessageManager()->CallEntityFunction(pMenu, 0, "OnDelete", NULL); + + //reload the main menu + MainMenuCreate(pMenu->GetParent()); +} + +void CheckForNewVersion(Entity *pMenu) +{ + pMenu->RemoveComponentByName("HTTP"); //just in case it already exists //get the internet stuff going @@ -381,221 +381,221 @@ void CheckForNewVersion(Entity *pMenu) Entity *pEnt = VersionShowScoreMessage(pMenu, "`6"); EntityComponent *pTyper = pEnt->AddComponent(new TyperComponent); pTyper->GetVar("text")->Set("Checking rtsoft.com for updates..."); - pTyper->GetVar("speedMS")->Set(uint32(50)); -} - -Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn ) -{ - CheckForImportedSavedGames(); - - GetApp()->GetVar("showViewHint")->Set(uint32(1)); //show that one tip - - Entity *pBG = CreateOverlayEntity(pParentEnt, "MainMenu", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0,0); - - OverlayRenderComponent *pOverlay = (OverlayRenderComponent*) pBG->GetComponentByName("OverlayRender"); - if (!pOverlay->GetSurfaceAnim()) - { - - LogMsg("Can't find media. If running from Visual Studio, make sure you set the active dir to ../bin first!"); -#ifdef WINAPI - MessageBox(NULL, "Can't find media. If running from Visual Studio, make sure you set the active dir to ../bin and have run media/update_media.bat first!", "Woah nelly!" , 0); -#endif - } - //Entity *pBG = pParentEnt->AddEntity(new Entity); - GetBaseApp()->ClearError(); - AddFocusIfNeeded(pBG, true); - - - pBG->GetFunction("ContinueLast")->sig_function.connect(&MainMenuContinueLast); - pBG->GetFunction("ContinueLastNewStyle")->sig_function.connect(&MainMenuContinueLastNewStyle); - pBG->GetFunction("CancelLast")->sig_function.connect(&MainMenuCancelLast); - - Entity *pButtonEntity; - float x = 50; - float yStart = 200; - float y = yStart; - float ySpacer = 55; - eFont fontID = FONT_LARGE; - float fontScale = 1; - float fireAnimY = 240; - CL_Vec2f vRtsoftLogoPt = CL_Vec2f(402, 149); - - CL_Vec2f vNewButPt = CL_Vec2f(26, 199); - CL_Vec2f vLoadButPt = CL_Vec2f(135, 199); - CL_Vec2f vAddonButPt = CL_Vec2f(26, 245); - CL_Vec2f vContinueButPt = CL_Vec2f(246, 198); - - CL_Vec2f vAboutButPt = CL_Vec2f(251, 245); - - CL_Vec2f vOptionsButPt = CL_Vec2f(360, 246); - - if (IsIPADSize) - { - vNewButPt = CL_Vec2f(0, 468); - vLoadButPt = CL_Vec2f(256, 468); - fireAnimY = GetScreenSizeYf()-256; - vRtsoftLogoPt = CL_Vec2f(830, 370); - - vAddonButPt = CL_Vec2f(13, 565); - vContinueButPt = CL_Vec2f(525, 468); - vAboutButPt = CL_Vec2f(525, 565); - vOptionsButPt = CL_Vec2f(748, 565); - } else if (IsIphone4Size) - { - vNewButPt = CL_Vec2f(66, 364); - vLoadButPt = CL_Vec2f(277, 362); - fireAnimY = GetScreenSizeYf()-160; - vRtsoftLogoPt = CL_Vec2f(775, 262); - - vAddonButPt = CL_Vec2f(67, 453); - vContinueButPt = CL_Vec2f(498, 364 ); - vAboutButPt = CL_Vec2f(512, 454); - vOptionsButPt = CL_Vec2f(716, 455); - } - - - -#ifdef RT_IS_BETA - Entity *pText = CreateTextLabelEntity(pBG, "text", GetScreenSizeXf()/2, GetScreenSizeYf()-20, - "`wBeta Version("+GetApp()->GetVersionString()+")"); - SetAlignmentEntity(pText, ALIGNMENT_CENTER); - -#endif - - if (!g_bDidVersionCheck && IsDesktop()) - { - g_bDidVersionCheck = true; - CheckForNewVersion(pBG); - return pBG; - } - - - Entity *pEntDinkLogo = CreateOverlayEntity(pBG, "dinklogo", ReplaceWithDeviceNameInFileName("interface/iphone/logo_dink.rttex"), 0, 0); - - pButtonEntity = CreateOverlayEntity(pBG, "flameAnim", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_anim_fire.rttex"), 0, fireAnimY); - SetupAnimEntity(pButtonEntity, 1, 4, 0, 0); - AnimateEntity(pButtonEntity, 0, 3, 125, InterpolateComponent::ON_FINISH_REPEAT, 0); - - //for android, so the back key (or escape on windows/OSX) will quit out of the game - EntityComponent *pComp = pBG->AddComponent(new CustomInputComponent); - //tell the component which key has to be hit for it to be activated - pComp->GetFunction("OnActivated")->sig_function.connect(1, boost::bind(&App::OnExitApp, GetApp(), _1)); - pComp->GetVar("keycode")->Set(uint32(VIRTUAL_KEY_BACK)); - - pButtonEntity = CreateOverlayButtonEntity(pBG, "rtsoftlogo", ReplaceWithDeviceNameInFileName("interface/iphone/logo_rtsoft.rttex"), vRtsoftLogoPt.x, vRtsoftLogoPt.y); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0, 0, 0, -10)); //no padding, it overlaps other buttons.. - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - FadeInEntity(pButtonEntity, false, 300, 1000); - - - if ( ! GetNextDMODToInstall().empty()) - { - pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); - VariantList vList(pBG, string("")); - GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); - - } else - { - - if (FileExists(GetSavePath()+"state.dat")) - { - PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLast", "Continue", true); - return pBG; - } else if (!ReadLastPathSaved().empty()) - { - PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLastNewStyle", "Continue", true); - return pBG; - } else - { - - if (g_bMainMenuFirstTime) - { -#ifdef RT_MOGA_ENABLED - ShowTextMessage("Moga enabled test version - not for distribution"); -#endif - PlayMenuMusic(); - } - - ZoomToPositionFromThisOffsetEntity(pEntDinkLogo, CL_Vec2f(0, -300), 2000, INTERPOLATE_EASE_TO, 5); - pButtonEntity = CreateOverlayButtonEntity(pBG, "New", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_new.rttex"), vNewButPt.x, vNewButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 100); - - //SetupTextEntity(pButtonEntity, fontID, fontScale); - pButtonEntity = CreateOverlayButtonEntity(pBG, "Add-ons", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_addon10.rttex"), vAddonButPt.x, vAddonButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - //SetupTextEntity(pButtonEntity, fontID, fontScale); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 1000); - - pButtonEntity = CreateOverlayButtonEntity(pBG, "Load", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_load.rttex"), vLoadButPt.x, vLoadButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - //SetupTextEntity(pButtonEntity, fontID, fontScale); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 400); - - pButtonEntity = CreateOverlayButtonEntity(pBG, "Continue", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_continue.rttex"), vContinueButPt.x, vContinueButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 700); - - if (!FileExists(GetSavePath()+"dink/"+string("continue_state.dat"))) - { - pButtonEntity->GetVar("color")->Set(MAKE_RGBA(100,100,100,255)); - DisableAllButtonsEntity(pButtonEntity, false); - } - - pButtonEntity = CreateOverlayButtonEntity(pBG, "About", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_about.rttex"), vAboutButPt.x, vAboutButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 1300); - - pButtonEntity = CreateOverlayButtonEntity(pBG, "Options", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_options.rttex"), vOptionsButPt.x, vOptionsButPt.y); - pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); - FadeInEntity(pButtonEntity, false, 500, 1500); - - DestroyUnusedTextures(); - } - - //pButtonEntity = CreateTextButtonEntity(pBG, "Debug", x, y, "Debug and MP3 Music"); y += ySpacer; - //pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); - //pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER)); - } - - if (bFadeIn) - { - FadeInEntity(pBG, true, 500, 0); - } else - { - - if (g_bMainMenuFirstTime) - { - g_bMainMenuFirstTime = false; - } else - { - SlideScreen(pBG, true); - } - } - - return pBG; -} - - -Entity * AddTitle( Entity *pEnt, string title) -{ - Entity *pTitle; - - float titleHeight = 25; - float scale = 1; - float x = 480/2; - - pTitle = CreateTextLabelEntity(pEnt, "Title", x, titleHeight, title); - pTitle->GetVar("scale2d")->Set(CL_Vec2f(scale, scale)); - pTitle->GetComponentByName("TextRender")->GetVar("font")->Set(uint32(FONT_LARGE)); - EntityRetinaRemapIfNeeded(pTitle, true, false, true); - pTitle->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER)); - - return pTitle; + pTyper->GetVar("speedMS")->Set(uint32(50)); +} + +Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn ) +{ + CheckForImportedSavedGames(); + + GetApp()->GetVar("showViewHint")->Set(uint32(1)); //show that one tip + + Entity *pBG = CreateOverlayEntity(pParentEnt, "MainMenu", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0,0); + + OverlayRenderComponent *pOverlay = (OverlayRenderComponent*) pBG->GetComponentByName("OverlayRender"); + if (!pOverlay->GetSurfaceAnim()) + { + + LogMsg("Can't find media. If running from Visual Studio, make sure you set the active dir to ../bin first!"); +#ifdef WINAPI + MessageBox(NULL, "Can't find media. If running from Visual Studio, make sure you set the active dir to ../bin and have run media/update_media.bat first!", "Woah nelly!" , 0); +#endif + } + //Entity *pBG = pParentEnt->AddEntity(new Entity); + GetBaseApp()->ClearError(); + AddFocusIfNeeded(pBG, true); + + + pBG->GetFunction("ContinueLast")->sig_function.connect(&MainMenuContinueLast); + pBG->GetFunction("ContinueLastNewStyle")->sig_function.connect(&MainMenuContinueLastNewStyle); + pBG->GetFunction("CancelLast")->sig_function.connect(&MainMenuCancelLast); + + Entity *pButtonEntity; + float x = 50; + float yStart = 200; + float y = yStart; + float ySpacer = 55; + eFont fontID = FONT_LARGE; + float fontScale = 1; + float fireAnimY = 240; + CL_Vec2f vRtsoftLogoPt = CL_Vec2f(402, 149); + + CL_Vec2f vNewButPt = CL_Vec2f(26, 199); + CL_Vec2f vLoadButPt = CL_Vec2f(135, 199); + CL_Vec2f vAddonButPt = CL_Vec2f(26, 245); + CL_Vec2f vContinueButPt = CL_Vec2f(246, 198); + + CL_Vec2f vAboutButPt = CL_Vec2f(251, 245); + + CL_Vec2f vOptionsButPt = CL_Vec2f(360, 246); + + if (IsIPADSize) + { + vNewButPt = CL_Vec2f(0, 468); + vLoadButPt = CL_Vec2f(256, 468); + fireAnimY = GetScreenSizeYf()-256; + vRtsoftLogoPt = CL_Vec2f(830, 370); + + vAddonButPt = CL_Vec2f(13, 565); + vContinueButPt = CL_Vec2f(525, 468); + vAboutButPt = CL_Vec2f(525, 565); + vOptionsButPt = CL_Vec2f(748, 565); + } else if (IsIphone4Size) + { + vNewButPt = CL_Vec2f(66, 364); + vLoadButPt = CL_Vec2f(277, 362); + fireAnimY = GetScreenSizeYf()-160; + vRtsoftLogoPt = CL_Vec2f(775, 262); + + vAddonButPt = CL_Vec2f(67, 453); + vContinueButPt = CL_Vec2f(498, 364 ); + vAboutButPt = CL_Vec2f(512, 454); + vOptionsButPt = CL_Vec2f(716, 455); + } + + + +#ifdef RT_IS_BETA + Entity *pText = CreateTextLabelEntity(pBG, "text", GetScreenSizeXf()/2, GetScreenSizeYf()-20, + "`wBeta Version("+GetApp()->GetVersionString()+")"); + SetAlignmentEntity(pText, ALIGNMENT_CENTER); + +#endif + + if (!g_bDidVersionCheck && IsDesktop()) + { + g_bDidVersionCheck = true; + CheckForNewVersion(pBG); + return pBG; + } + + + Entity *pEntDinkLogo = CreateOverlayEntity(pBG, "dinklogo", ReplaceWithDeviceNameInFileName("interface/iphone/logo_dink.rttex"), 0, 0); + + pButtonEntity = CreateOverlayEntity(pBG, "flameAnim", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_anim_fire.rttex"), 0, fireAnimY); + SetupAnimEntity(pButtonEntity, 1, 4, 0, 0); + AnimateEntity(pButtonEntity, 0, 3, 125, InterpolateComponent::ON_FINISH_REPEAT, 0); + + //for android, so the back key (or escape on windows/OSX) will quit out of the game + EntityComponent *pComp = pBG->AddComponent(new CustomInputComponent); + //tell the component which key has to be hit for it to be activated + pComp->GetFunction("OnActivated")->sig_function.connect(1, boost::bind(&App::OnExitApp, GetApp(), _1)); + pComp->GetVar("keycode")->Set(uint32(VIRTUAL_KEY_BACK)); + + pButtonEntity = CreateOverlayButtonEntity(pBG, "rtsoftlogo", ReplaceWithDeviceNameInFileName("interface/iphone/logo_rtsoft.rttex"), vRtsoftLogoPt.x, vRtsoftLogoPt.y); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0, 0, 0, -10)); //no padding, it overlaps other buttons.. + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + FadeInEntity(pButtonEntity, false, 300, 1000); + + + if ( ! GetNextDMODToInstall().empty()) + { + pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading); + VariantList vList(pBG, string("")); + GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList); + + } else + { + + if (FileExists(GetSavePath()+"state.dat")) + { + PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLast", "Continue", true); + return pBG; + } else if (!ReadLastPathSaved().empty()) + { + PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLastNewStyle", "Continue", true); + return pBG; + } else + { + + if (g_bMainMenuFirstTime) + { +#ifdef RT_MOGA_ENABLED + ShowTextMessage("Moga enabled test version - not for distribution"); +#endif + PlayMenuMusic(); + } + + ZoomToPositionFromThisOffsetEntity(pEntDinkLogo, CL_Vec2f(0, -300), 2000, INTERPOLATE_EASE_TO, 5); + pButtonEntity = CreateOverlayButtonEntity(pBG, "New", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_new.rttex"), vNewButPt.x, vNewButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 100); + + //SetupTextEntity(pButtonEntity, fontID, fontScale); + pButtonEntity = CreateOverlayButtonEntity(pBG, "Add-ons", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_addon10.rttex"), vAddonButPt.x, vAddonButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + //SetupTextEntity(pButtonEntity, fontID, fontScale); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 1000); + + pButtonEntity = CreateOverlayButtonEntity(pBG, "Load", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_load.rttex"), vLoadButPt.x, vLoadButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + //SetupTextEntity(pButtonEntity, fontID, fontScale); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 400); + + pButtonEntity = CreateOverlayButtonEntity(pBG, "Continue", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_continue.rttex"), vContinueButPt.x, vContinueButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 700); + + if (!FileExists(GetSavePath()+"dink/"+string("continue_state.dat"))) + { + pButtonEntity->GetVar("color")->Set(MAKE_RGBA(100,100,100,255)); + DisableAllButtonsEntity(pButtonEntity, false); + } + + pButtonEntity = CreateOverlayButtonEntity(pBG, "About", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_about.rttex"), vAboutButPt.x, vAboutButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 1300); + + pButtonEntity = CreateOverlayButtonEntity(pBG, "Options", ReplaceWithDeviceNameInFileName("interface/iphone/main_but_options.rttex"), vOptionsButPt.x, vOptionsButPt.y); + pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0)); + FadeInEntity(pButtonEntity, false, 500, 1500); + + DestroyUnusedTextures(); + } + + //pButtonEntity = CreateTextButtonEntity(pBG, "Debug", x, y, "Debug and MP3 Music"); y += ySpacer; + //pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect); + //pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER)); + } + + if (bFadeIn) + { + FadeInEntity(pBG, true, 500, 0); + } else + { + + if (g_bMainMenuFirstTime) + { + g_bMainMenuFirstTime = false; + } else + { + SlideScreen(pBG, true); + } + } + + return pBG; +} + + +Entity * AddTitle( Entity *pEnt, string title) +{ + Entity *pTitle; + + float titleHeight = 25; + float scale = 1; + float x = 480/2; + + pTitle = CreateTextLabelEntity(pEnt, "Title", x, titleHeight, title); + pTitle->GetVar("scale2d")->Set(CL_Vec2f(scale, scale)); + pTitle->GetComponentByName("TextRender")->GetVar("font")->Set(uint32(FONT_LARGE)); + EntityRetinaRemapIfNeeded(pTitle, true, false, true); + pTitle->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER)); + + return pTitle; } \ No newline at end of file diff --git a/source/GUI/OptionsMenu.cpp b/source/GUI/OptionsMenu.cpp index 42d8d2a..9c21163 100644 --- a/source/GUI/OptionsMenu.cpp +++ b/source/GUI/OptionsMenu.cpp @@ -14,6 +14,10 @@ #include "Gamepad/GamepadProvider60Beat.h" #endif +#ifdef WINAPI +extern bool g_bUseBorderlessFullscreenOnWindows; +extern bool g_bIsFullScreen; +#endif #include "Gamepad/GamepadProvideriCade.h" void UpdateOptionsGUI(); @@ -58,6 +62,12 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity GetBaseApp()->SetVideoMode(1280, 960, false); } + if (pEntClicked->GetName() == "vid_hd") + { + GetBaseApp()->SetVideoMode(1920, 1080, false); + } + + if (pEntClicked->GetName() == "controls_0") { GetApp()->GetShared()->GetVar("controlStyle")->Set(uint32(CONTROLS_JOYPAD)); @@ -124,6 +134,49 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity DinkOnForeground(); } +#ifdef WINAPI + if (pEntClicked->GetName() == "check_borderless") + { + bool bChecked = IsCheckboxChecked(pEntClicked); + GetApp()->GetVar("borderless_fullscreen")->Set(uint32(bChecked)); + + if (g_bIsFullScreen) + { + if (!g_bUseBorderlessFullscreenOnWindows) + { + g_bUseBorderlessFullscreenOnWindows = bChecked; + ChangeDisplaySettings(NULL, 0); + //GetBaseApp()->SetVideoMode(640, 480, false); + g_bIsFullScreen = false; + GetBaseApp()->OnFullscreenToggleRequest(); + } + else + { + //we're currently borderless.. how to we remove that? + g_bUseBorderlessFullscreenOnWindows = bChecked; + GetBaseApp()->SetVideoMode(640, 480, true); + + } + + } + else + { + + } + + + g_bUseBorderlessFullscreenOnWindows = bChecked; + + /* + GetApp()->UpdateVideoSettings(); + DinkUnloadUnusedGraphicsByUsageTime(0); //unload anything not used in the last second + DinkReInitSurfacesAfterVideoChange(); + DinkOnForeground(); + */ + } + +#endif + if (pEntClicked->GetName() == "sbeat_ad") { string url = "http://www.60beat.com/?Click=326"; @@ -401,6 +454,13 @@ void OptionsMenuAddScrollContent(Entity *pParent) y += GetSize2DEntity(pEnt).y; y += spacerY; +#ifdef WINAPI + bool bBorderlessFullscreen = GetApp()->GetVar("borderless_fullscreen")->GetUINT32() != 0; + pEnt = CreateCheckbox(pBG, "check_borderless", "Use Windowed borderless fullscreen mode", startX, y, bBorderlessFullscreen, FONT_SMALL, 1.0f); + pEnt->GetFunction("OnButtonSelected")->sig_function.connect(&OptionsMenuOnSelect); + y += GetSize2DEntity(pEnt).y; + y += spacerY; +#endif //fps limit