diff --git a/script/win_installer/readme.txt b/script/win_installer/readme.txt index 2479c1a..7a374da 100644 --- a/script/win_installer/readme.txt +++ b/script/win_installer/readme.txt @@ -16,7 +16,8 @@ Arrow keys - Movement Space - Talk Enter - Inventory Shift - Magic -Escape - Bring up menu +Escape - Bring up classic dink escape menu +Shift-Escape - Bring up Dink HD escape menu Drag on window borders - scale the play area (when windowed) NOTE: If you have a controller (like an xbox 360 pad) plugged in when you start the game, you can use that instead of keyboard, but you still need to use the @@ -207,3 +208,15 @@ I also added the CD and splash.bmp that were missing * (Windows, DinkC, Performance) Logging code rewritten, it's was horribly slow before. If a DMOD spammed "debug" messages it would previously drastically slow down the entire dmod * (Bugfix) LOAD_SEQUENCE and LOAD_SEQUENCE_NOW fixes, fixes stuff in many dmods * Improved mouse handling on dialog menus, no longer accidently select the first option of the dink menu if you click slow after using HD's escape menu to get there + +- Note: Just to be safe, save state version has changed, so old save states won't load + +------ Change log for 1.8.1 ---------- + +* Escape now brings up the classic dink escape menu, the Dink HD menu was just too intrusive. It will show a text message that you can hit Shift-Escape to bring up the HD menu as well +* Made dialog box background look better by making it 32 bit with alpha, no more "cracks" at some resolutions. Custom dialogs may still get line cracks at non 640X480 but whatever +* Default resolution is now 1024X768 fullscreen instead of 640X480 +* dmod listing is packed tighter and now sorted alphabetically by dmod name, not directory name + + + diff --git a/source/App.cpp b/source/App.cpp index ea9b956..98f82a2 100644 --- a/source/App.cpp +++ b/source/App.cpp @@ -184,8 +184,8 @@ App::App() m_bDidPostInit = false; m_bHasDMODSupport = true; //for mobiles - m_version = 1.80f; - m_versionString = "V1.8.0"; + m_version = 1.81f; + m_versionString = "V1.8.1"; m_build = 1; m_bCheatsEnabled = false; @@ -194,6 +194,7 @@ App::App() m_desktopVersionString = m_versionString; m_desktopBuild = 1; m_bForceAspectRatio = true; + } App::~App() @@ -223,6 +224,16 @@ bool App::GetForceAspectRatio() return m_bForceAspectRatio; } +bool App::UseClassicEscapeMenu() +{ + if (GetEmulatedPlatformID() == PLATFORM_ID_WINDOWS) + { + return true; + } + + return false; +} + void App::OniCadeDisconnected(GamepadProvider *pProvider) { LogMsg("Dealing with icade disconnect"); @@ -264,6 +275,7 @@ bool App::Init() #endif + //GetBaseApp()->SetDisableSubPixelBlits(true); SetDefaultButtonStyle(Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH_RELEASE); SetManualRotationMode(false); @@ -951,8 +963,8 @@ bool App::OnPreInitVideo() #ifdef RT_SCRIPT_BUILD SetEmulatedPlatformID(PLATFORM_ID_WINDOWS); - g_winVideoScreenX = 640; - g_winVideoScreenY = 480; + g_winVideoScreenX = 1024; + g_winVideoScreenY = 768; #endif diff --git a/source/App.h b/source/App.h index 724ec4d..32a2cbb 100644 --- a/source/App.h +++ b/source/App.h @@ -91,7 +91,7 @@ public: bool GetForceAspectRatio(); bool GetGhostMode() {return m_bGhostMode;} void SetGhostMode(bool bNew) { m_bGhostMode = bNew; } - + bool UseClassicEscapeMenu(); private: AdManager m_adManager; diff --git a/source/GUI/DMODMenu.cpp b/source/GUI/DMODMenu.cpp index 1fc3c33..42c724d 100644 --- a/source/GUI/DMODMenu.cpp +++ b/source/GUI/DMODMenu.cpp @@ -13,6 +13,8 @@ #include "BrowseMenu.h" #include "ReadTextMenu.h" + + void DMODMenuAddScrollContent(Entity *pParent); void DMODMenuOnRemoveDMOD(VariantList *pVList) @@ -236,7 +238,7 @@ void AddDMODBar(Entity *pParent, float &x, float &y, string title, string descri if (IsLargeScreen()) { - y += pBG->GetVar("size2d")->GetVector2().y/2; + y += pBG->GetVar("size2d")->GetVector2().y*.4f; } else { y += pBG->GetVar("size2d")->GetVector2().y; @@ -311,10 +313,10 @@ if (bCanDelete) //add animation effect - ZoomToPositionFromThisOffsetEntity(pBG, CL_Vec2f(GetScreenSizeXf(), 0), 500, INTERPOLATE_EASE_TO, 10); + //ZoomToPositionFromThisOffsetEntity(pBG, CL_Vec2f(GetScreenSizeXf(), 0), 500, INTERPOLATE_EASE_TO, 10); } -void GetParsedDMODInfo(string dmodPath, string &nameOut, float versionOut, string ©right, string &dmodwebsite, string &description) +void GetParsedDMODInfo(string dmodPath, string &nameOut, float &versionOut, string ©right, string &dmodwebsite, string &description) { TextScanner t(dmodPath+"/dmod.diz", false); @@ -381,6 +383,26 @@ bool EndsWith(std::string const &fullString, std::string const &ending) } } +struct DMODDisplayEntry +{ + DMODDisplayEntry() + { + version = 0.0f; + } + string m_files; + + string dmodName; + string dmodCopyright; + string dmodwebsite; + string description; + float version; + + + + +}; + + void DMODMenuAddScrollContent(Entity *pParent) { pParent = pParent->GetEntityByName("scroll_child"); @@ -392,16 +414,19 @@ void DMODMenuAddScrollContent(Entity *pParent) //Entity *pEnt; vector temp = GetDirectoriesAtPath(GetDMODRootPath()); - vector files; + vector entries; //actually, you know what? Let's add the path to each one for (int i=0; i < temp.size(); i++) { + temp[i] = GetDMODRootPath()+temp[i]; if (FileExists(temp[i]+"/dink.dat")) { //looks valid - files.push_back(temp[i]); + DMODDisplayEntry entry; + entry.m_files = temp[i]; + entries.push_back(entry); } } @@ -412,43 +437,55 @@ void DMODMenuAddScrollContent(Entity *pParent) for (int i=0; i < staticFiles.size(); i++) { //merge in if not a duplicate - for (int n=0; n < files.size(); n++) + for (int n=0; n < entries.size(); n++) { - if (GetFileNameFromString(files[n]) == staticFiles[i]) + if (GetFileNameFromString(entries[n].m_files) == staticFiles[i]) { //duplicate continue; } - } - - files.push_back(GetDMODStaticRootPath()+staticFiles[i]); + DMODDisplayEntry entry; + entry.m_files = GetDMODStaticRootPath() + staticFiles[i]; + entries.push_back(entry); } - } - + int dmodsAdded = 0; - for (unsigned int i=0; i < files.size(); i++) + for (unsigned int i=0; i < entries.size(); i++) { #ifdef WIN32 - - - if (EndsWith(files[i], "/audio") || EndsWith(files[i],"/dink" )|| EndsWith(files[i] ,"/game") || EndsWith(files[i],"/interface")) continue; - if (EndsWith(files[i] ,"/develop") ) continue; + if ( + EndsWith(entries[i].m_files, "/audio") || EndsWith(entries[i].m_files,"/dink" )|| EndsWith(entries[i].m_files,"/game") || EndsWith(entries[i].m_files,"/interface") + || EndsWith(entries[i].m_files, "/develop") + )continue; #else if (IsInString(files[i],"/Snapshot") || IsInString(files[i], "/Snapshots")) continue; #endif - string dmodName, dmodCopyright, dmodwebsite, description; - float version = 0; - - GetParsedDMODInfo(files[i], dmodName, version, dmodCopyright, dmodwebsite, description ); - AddDMODBar(pParent, x, y, dmodName, description, "", 20.3f, files[i], dmodsAdded); + GetParsedDMODInfo(entries[i].m_files, entries[i].dmodName, entries[i].version, entries[i].dmodCopyright, entries[i].dmodwebsite, entries[i].description ); + + StringReplace("\"", "", entries[i].dmodName); dmodsAdded++; } + //sort them by DMOD name rather than filename + sort(entries.begin(), entries.end(), [](const DMODDisplayEntry& lhs, const DMODDisplayEntry& rhs) + { + return lhs.dmodName < rhs.dmodName; + }); + + + for (int i = 0; i < entries.size(); i++) + { + if (entries[i].dmodName.empty())continue; + + AddDMODBar(pParent, x, y, entries[i].dmodName, entries[i].description, "", 20.3f, entries[i].m_files, i); + } + + if (dmodsAdded == 0) { CL_Vec2f vTextBoxPos(iPhoneMapX(20),iPhoneMapY(y)); @@ -481,7 +518,6 @@ void OnDMODMenuDelete(Entity *pMenu) } } - void OnPostIntroTransition(VariantList *pVList) { Entity *pBG = pVList->Get(0).GetEntity(); @@ -489,7 +525,6 @@ void OnPostIntroTransition(VariantList *pVList) if (GetEmulatedPlatformID() == PLATFORM_ID_WEBOS) { - CreateQuickTipFirstTimeOnly(pBG, "interface/generic/quicktip_dmod.rttex", true); } else if (GetEmulatedPlatformID() == PLATFORM_ID_BBX) @@ -513,10 +548,8 @@ if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID) //get notified when this is deleted so we can save the default settings pBG->sig_onRemoved.connect(&OnDMODMenuDelete); - } - Entity * DMODMenuCreate( Entity *pParentEnt, bool bFadeIn /*= false*/ ) { //GetMessageManager()->SendGame(MESSAGE_TYPE_PLAY_MUSIC, "audio/title.mp3", 200); @@ -564,8 +597,6 @@ Entity * DMODMenuCreate( Entity *pParentEnt, bool bFadeIn /*= false*/ ) Entity *pOverlay = CreateOverlayEntity(pBG, "", ReplaceWithDeviceNameInFileName("interface/iphone/bg_stone_overlay.rttex"), 0, GetScreenSizeYf()); SetAlignmentEntity(pOverlay, ALIGNMENT_DOWN_LEFT); - -// ZoomFromPositionEntity(pBG, CL_Vec2f(0, -GetScreenSizeYf()), 500); //the continue button Entity *pEnt; diff --git a/source/GUI/DMODMenu.h b/source/GUI/DMODMenu.h index 403230a..3bbfb8f 100644 --- a/source/GUI/DMODMenu.h +++ b/source/GUI/DMODMenu.h @@ -2,6 +2,6 @@ #define DMODMenu_h__ #include "BaseApp.h" Entity * DMODMenuCreate(Entity *pParentEnt, bool bFadeIn = false); - + #endif // DMODMenu_h__ \ No newline at end of file diff --git a/source/GUI/GameMenu.cpp b/source/GUI/GameMenu.cpp index df941e0..c3749a7 100644 --- a/source/GUI/GameMenu.cpp +++ b/source/GUI/GameMenu.cpp @@ -31,10 +31,10 @@ void ShowQuickMessage(string msg) //assert(pMenu); if (!pMenu) { - // pMenu = GetEntityRoot(); + // pMenu = GetEntityRoot(); return; } - Entity *pEnt = CreateTextLabelEntity(pMenu, "GameMsg", GetScreenSizeXf()/2, iPhoneMapY(100), msg); + Entity *pEnt = CreateTextLabelEntity(pMenu, "GameMsg", GetScreenSizeXf() / 2, iPhoneMapY(100), msg); //SetupTextEntity(pEnt, FONT_LARGE); SetAlignmentEntity(pEnt, ALIGNMENT_CENTER); @@ -44,12 +44,35 @@ void ShowQuickMessage(string msg) } + +void ShowQuickMessageBottom(string msg) +{ + + Entity *pMenu = GetEntityRoot()->GetEntityByName("GameMenu"); + if (!pMenu) + { + return; + } + Entity *pEnt = CreateTextLabelEntity(pMenu, "GameMsg", GetScreenSizeXf() / 2, iPhoneMapY(250), msg); + + + SetAlignmentEntity(pEnt, ALIGNMENT_CENTER); + pEnt->GetComponentByName("TextRender")->GetVar("shadowColor")->Set(MAKE_RGBA(0, 0, 0, 200)); + FadeInEntity(pEnt); + FadeOutAndKillEntity(pEnt, true, 1000, 1000); + +} + void GameOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from { + + Entity *pEntClicked = pVList->m_variant[1].GetEntity(); Entity *pMenu = GetEntityRoot()->GetEntityByName("GameMenu"); + if (pMenu->GetEntityByName("PauseMenu")) return; + //LogMsg("Clicked %s entity at %s", pEntClicked->GetName().c_str(),pVList->m_variant[1].Print().c_str()); if (pEntClicked->GetName() == "pause") @@ -59,16 +82,42 @@ void GameOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent fr //sjoy.joybit[5] = TRUE g_dglo.m_dirInput[DINK_INPUT_BUTTON5] = true; g_dglo.m_dirInputFinished[DINK_INPUT_BUTTON5] = true; - + //if we ONLY want the game to handle this, we'd enable this return... //return; } - if (!pMenu->GetEntityByName("PauseMenu")) + if (GetApp()->UseClassicEscapeMenu()) { - pMenu->RemoveComponentByName("FocusInput"); - PauseMenuCreate(pMenu); + +#ifdef WINAPI + if (GetKeyState(VK_SHIFT) & 0xfe) + { + if (!pMenu->GetEntityByName("PauseMenu")) + { + pMenu->RemoveComponentByName("FocusInput"); + PauseMenuCreate(pMenu); + } + return; + } +#endif + + g_dglo.m_dirInput[DINK_INPUT_BUTTON5] = true; + g_dglo.m_dirInputFinished[DINK_INPUT_BUTTON5] = true; + + ShowQuickMessageBottom("(Use Shift-Escape to bring up the Dink HD menu!)"); + return; } + else + { + if (!pMenu->GetEntityByName("PauseMenu")) + { + pMenu->RemoveComponentByName("FocusInput"); + PauseMenuCreate(pMenu); + } + } + + } if (pEntClicked->GetName() == "attack") diff --git a/source/GUI/MainMenu.cpp b/source/GUI/MainMenu.cpp index 82bfae9..81bbed5 100644 --- a/source/GUI/MainMenu.cpp +++ b/source/GUI/MainMenu.cpp @@ -19,7 +19,7 @@ bool g_bMainMenuFirstTime = true; bool g_bDidVersionCheck = false; Entity * VersionShowScoreMessage(Entity *pMenu, string msg); -void GetParsedDMODInfo(string dmodPath, string &nameOut, float versionOut, string ©right, string &dmodwebsite, string &description); +void GetParsedDMODInfo(string dmodPath, string &nameOut, float &versionOut, string ©right, string &dmodwebsite, string &description); void ReloadMainMenu(VariantList *pVList) { @@ -61,7 +61,7 @@ Entity * VersionShowScoreMessage(Entity *pMenu, string msg) } else { - pInfo = CreateTextLabelEntity(pMenu, "Info", iPhoneMapX(130), iPhoneMapY(220), msg); + pInfo = CreateTextLabelEntity(pMenu, "Info", iPhoneMapX(170), iPhoneMapY(220), msg); } return pInfo; diff --git a/source/dink/dink.cpp b/source/dink/dink.cpp index 90c4b3e..377ecf0 100644 --- a/source/dink/dink.cpp +++ b/source/dink/dink.cpp @@ -1579,11 +1579,13 @@ bool LoadSpriteSingleFrame(string fNameBase, int seq, int oo, int picIndex, eTra if (bUseCheckerboardFix) { + /* if (oo >=2 && oo <= 4 && fNameBase =="main-") { //nah, because this is connected it makes this look weird, even with the V2 checkerboard processing bUseCheckerboardFix = false; } + */ } @@ -14577,11 +14579,11 @@ void process_talk() ddrval = lpDDSBack->BltFast( px, py, g_pSpriteSurface[g_dglos.g_seq[30].frame[2]], &g_dglos.g_picInfo[g_dglos.g_seq[30].frame[2]].box , DDBLTFAST_SRCCOLORKEY ); - - ddrval = lpDDSBack->BltFast( px+169, py+42, g_pSpriteSurface[g_dglos.g_seq[30].frame[3]], + + ddrval = lpDDSBack->BltFast( px+170, py+42, g_pSpriteSurface[g_dglos.g_seq[30].frame[3]], &g_dglos.g_picInfo[g_dglos.g_seq[30].frame[3]].box , DDBLTFAST_SRCCOLORKEY ); - ddrval = lpDDSBack->BltFast( px+169+180, py+1, g_pSpriteSurface[g_dglos.g_seq[30].frame[4]], + ddrval = lpDDSBack->BltFast( px+170+181, py+1, g_pSpriteSurface[g_dglos.g_seq[30].frame[4]], &g_dglos.g_picInfo[g_dglos.g_seq[30].frame[4]].box , DDBLTFAST_SRCCOLORKEY ); } @@ -14841,7 +14843,7 @@ void DinkSetCursorPosition(CL_Vec2f vPos) { #ifdef _DEBUG - LogMsg("Mouse diff: %.2f", difY); + //LogMsg("Mouse diff: %.2f", difY); #endif g_dglos.g_playerInfo.mouse += difY; } diff --git a/source/video_gl.cpp b/source/video_gl.cpp index 598008c..91814fd 100644 --- a/source/video_gl.cpp +++ b/source/video_gl.cpp @@ -394,7 +394,7 @@ int IDirectDrawSurface::BltFast( int x, int y, IDirectDrawSurface *pSrcSurf, rtR } - + //pSrcSurf->m_pGLSurf->SetBlendingMode(Surface::BLENDING_NORMAL); pSrcSurf->m_pGLSurf->BlitEx(rtRectf(x, y, x+pSrcRect->GetWidth(), y +pSrcRect->GetHeight())+ rtRectf(0,0, 0.5f, 0.5f), rtRectf(*pSrcRect)); break; }