├── .gitignore ├── BBCF_IM.sln ├── BBCF_IM.vcxproj ├── BBCF_IM.vcxproj.filters ├── BBCF_IM.vcxproj.user ├── LICENSE ├── README.md ├── USER_README.txt ├── depends ├── detour │ ├── detours.h │ ├── detours.lib │ └── detours.pdb ├── directx_sdk │ ├── Include │ │ ├── D2D1.h │ │ ├── D2D1Helper.h │ │ ├── D2DBaseTypes.h │ │ ├── D2Derr.h │ │ ├── D3D10.h │ │ ├── D3D10_1.h │ │ ├── D3D10_1shader.h │ │ ├── D3D10effect.h │ │ ├── D3D10shader.h │ │ ├── D3D11.h │ │ ├── D3D11SDKLayers.h │ │ ├── D3D11Shader.h │ │ ├── D3DCSX.h │ │ ├── D3DX10.h │ │ ├── D3DX10core.h │ │ ├── D3DX10math.h │ │ ├── D3DX10math.inl │ │ ├── D3DX10mesh.h │ │ ├── D3DX10tex.h │ │ ├── D3DX11.h │ │ ├── D3DX11async.h │ │ ├── D3DX11core.h │ │ ├── D3DX11tex.h │ │ ├── D3DX_DXGIFormatConvert.inl │ │ ├── D3Dcommon.h │ │ ├── D3Dcompiler.h │ │ ├── DWrite.h │ │ ├── DXGI.h │ │ ├── DXGIFormat.h │ │ ├── DXGIType.h │ │ ├── Dcommon.h │ │ ├── DxErr.h │ │ ├── PIXPlugin.h │ │ ├── X3DAudio.h │ │ ├── XAPO.h │ │ ├── XAPOBase.h │ │ ├── XAPOFX.h │ │ ├── XAudio2.h │ │ ├── XAudio2fx.h │ │ ├── XDSP.h │ │ ├── XInput.h │ │ ├── audiodefs.h │ │ ├── comdecl.h │ │ ├── d3d10misc.h │ │ ├── d3d10sdklayers.h │ │ ├── d3d9.h │ │ ├── d3d9caps.h │ │ ├── d3d9types.h │ │ ├── d3dx10async.h │ │ ├── d3dx9.h │ │ ├── d3dx9anim.h │ │ ├── d3dx9core.h │ │ ├── d3dx9effect.h │ │ ├── d3dx9math.h │ │ ├── d3dx9math.inl │ │ ├── d3dx9mesh.h │ │ ├── d3dx9shader.h │ │ ├── d3dx9shape.h │ │ ├── d3dx9tex.h │ │ ├── d3dx9xof.h │ │ ├── dinput.h │ │ ├── dinputd.h │ │ ├── dsconf.h │ │ ├── dsetup.h │ │ ├── dsound.h │ │ ├── dxdiag.h │ │ ├── dxfile.h │ │ ├── dxsdkver.h │ │ ├── gameux.h │ │ ├── rmxfguid.h │ │ ├── rmxftmpl.h │ │ ├── rpcsal.h │ │ ├── xact3.h │ │ ├── xact3d3.h │ │ ├── xact3wb.h │ │ ├── xma2defs.h │ │ ├── xnamath.h │ │ ├── xnamathconvert.inl │ │ ├── xnamathmatrix.inl │ │ ├── xnamathmisc.inl │ │ └── xnamathvector.inl │ └── Lib │ │ ├── x64 │ │ ├── D3DCSX.lib │ │ ├── D3DCSXd.lib │ │ ├── DxErr.lib │ │ ├── X3DAudio.lib │ │ ├── XAPOFX.lib │ │ ├── XInput.lib │ │ ├── d2d1.lib │ │ ├── d3d10.lib │ │ ├── d3d10_1.lib │ │ ├── d3d11.lib │ │ ├── d3d9.lib │ │ ├── d3dcompiler.lib │ │ ├── d3dx10.lib │ │ ├── d3dx10d.lib │ │ ├── d3dx11.lib │ │ ├── d3dx11d.lib │ │ ├── d3dx9.lib │ │ ├── d3dx9d.lib │ │ ├── d3dxof.lib │ │ ├── dinput8.lib │ │ ├── dsound.lib │ │ ├── dwrite.lib │ │ ├── dxgi.lib │ │ ├── dxguid.lib │ │ ├── xapobase.lib │ │ └── xapobased.lib │ │ └── x86 │ │ ├── D3DCSX.lib │ │ ├── D3DCSXd.lib │ │ ├── DxErr.lib │ │ ├── X3DAudio.lib │ │ ├── XAPOFX.lib │ │ ├── XInput.lib │ │ ├── d2d1.lib │ │ ├── d3d10.lib │ │ ├── d3d10_1.lib │ │ ├── d3d11.lib │ │ ├── d3d9.lib │ │ ├── d3dcompiler.lib │ │ ├── d3dx10.lib │ │ ├── d3dx10d.lib │ │ ├── d3dx11.lib │ │ ├── d3dx11d.lib │ │ ├── d3dx9.lib │ │ ├── d3dx9d.lib │ │ ├── d3dxof.lib │ │ ├── dinput8.lib │ │ ├── dsetup.lib │ │ ├── dsound.lib │ │ ├── dwrite.lib │ │ ├── dxgi.lib │ │ ├── dxguid.lib │ │ ├── xapobase.lib │ │ └── xapobased.lib ├── imgui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_dx9.cpp │ ├── imgui_impl_dx9.h │ ├── imgui_internal.h │ ├── stb_image.h │ ├── stb_rect_pack.h │ ├── stb_textedit.h │ └── stb_truetype.h ├── steam_api │ ├── public │ │ └── steam │ │ │ ├── isteamapplist.h │ │ │ ├── isteamapps.h │ │ │ ├── isteamappticket.h │ │ │ ├── isteamclient.h │ │ │ ├── isteamcontroller.h │ │ │ ├── isteamfriends.h │ │ │ ├── isteamgamecoordinator.h │ │ │ ├── isteamgameserver.h │ │ │ ├── isteamgameserverstats.h │ │ │ ├── isteamhtmlsurface.h │ │ │ ├── isteamhttp.h │ │ │ ├── isteaminventory.h │ │ │ ├── isteammasterserverupdater.h │ │ │ ├── isteammatchmaking.h │ │ │ ├── isteammusic.h │ │ │ ├── isteammusicremote.h │ │ │ ├── isteamnetworking.h │ │ │ ├── isteamps3overlayrenderer.h │ │ │ ├── isteamremotestorage.h │ │ │ ├── isteamscreenshots.h │ │ │ ├── isteamugc.h │ │ │ ├── isteamunifiedmessages.h │ │ │ ├── isteamuser.h │ │ │ ├── isteamuserstats.h │ │ │ ├── isteamutils.h │ │ │ ├── isteamvideo.h │ │ │ ├── lib │ │ │ ├── linux32 │ │ │ │ └── libsdkencryptedappticket.so │ │ │ ├── linux64 │ │ │ │ └── libsdkencryptedappticket.so │ │ │ ├── osx32 │ │ │ │ └── libsdkencryptedappticket.dylib │ │ │ ├── win32 │ │ │ │ ├── sdkencryptedappticket.dll │ │ │ │ └── sdkencryptedappticket.lib │ │ │ └── win64 │ │ │ │ ├── sdkencryptedappticket64.dll │ │ │ │ └── sdkencryptedappticket64.lib │ │ │ ├── matchmakingtypes.h │ │ │ ├── steam_api.h │ │ │ ├── steam_api.json │ │ │ ├── steam_api_flat.h │ │ │ ├── steam_api_internal.h │ │ │ ├── steam_api_interop.cs │ │ │ ├── steam_gameserver.h │ │ │ ├── steamclientpublic.h │ │ │ ├── steamencryptedappticket.h │ │ │ ├── steamhttpenums.h │ │ │ ├── steamps3params.h │ │ │ ├── steamtypes.h │ │ │ └── steamuniverse.h │ └── redistributable_bin │ │ ├── linux32 │ │ └── libsteam_api.so │ │ ├── linux64 │ │ └── libsteam_api.so │ │ ├── osx32 │ │ └── libsteam_api.dylib │ │ ├── steam_api.dll │ │ ├── steam_api.lib │ │ └── win64 │ │ ├── steam_api64.dll │ │ └── steam_api64.lib └── winhttpclient │ ├── Include │ ├── RegExp.h │ ├── StringProcess.h │ └── WinHttpClient.h │ └── ThirdParty │ └── ATLRegExp │ └── atlrx.h ├── export └── dinput8.def ├── notes.h ├── resource ├── palettes.ini └── settings.ini └── src ├── Core ├── Settings.cpp ├── Settings.h ├── crashdump.cpp ├── crashdump.h ├── dllmain.cpp ├── info.h ├── interfaces.cpp ├── interfaces.h ├── keycodes.h ├── logger.cpp ├── logger.h ├── settings.def ├── utils.cpp └── utils.h ├── CustomGameMode ├── GameModeManager.cpp ├── GameModeManager.h ├── customGameMode.cpp └── customGameMode.h ├── D3D9EXWrapper ├── D3DXMath.cpp ├── D3DXMath.h ├── ID3D9EXWrapper.cpp ├── ID3D9EXWrapper.h ├── ID3D9EXWrapper_Device.cpp ├── ID3D9EXWrapper_Device.h ├── ID3D9Wrapper_Sprite.cpp ├── ID3D9Wrapper_Sprite.h ├── ID3DXWrapper_Effect.cpp ├── ID3DXWrapper_Effect.h └── d3d9.h ├── Game ├── CharData.h ├── EntityData.h ├── GhidraDefs.h ├── Jonb │ ├── JonbDBEntry.h │ ├── JonbDBReader.cpp │ ├── JonbDBReader.h │ ├── JonbEntry.h │ ├── JonbReader.cpp │ └── JonbReader.h ├── MatchState.cpp ├── MatchState.h ├── Menus │ ├── TrainingSetupMenu.cpp │ └── TrainingSetupMenu.h ├── Playbacks │ ├── PlaybackManager.cpp │ ├── PlaybackManager.h │ ├── PlaybackSlot.cpp │ └── PlaybackSlot.h ├── Player.cpp ├── Player.h ├── ReplayFiles │ ├── ReplayFile.h │ ├── ReplayFileManager.cpp │ ├── ReplayFileManager.h │ └── ReplayList.h ├── ReplayStates │ ├── FrameState.cpp │ └── FrameState.h ├── Room │ ├── Room.h │ └── RoomMemberEntry.h ├── Scr │ ├── CmdList.h │ ├── ScrStateEntry.h │ ├── ScrStateReader.cpp │ └── ScrStateReader.h ├── SnapshotApparatus │ ├── SnapshotApparatus.cpp │ └── SnapshotApparatus.h ├── characters.cpp ├── characters.h ├── gamestates.cpp ├── gamestates.h ├── stages.cpp └── stages.h ├── Hooks ├── HookManager.cpp ├── HookManager.h ├── hooks_bbcf.cpp ├── hooks_bbcf.h ├── hooks_customGameModes.cpp ├── hooks_customGameModes.h ├── hooks_detours.cpp ├── hooks_detours.h ├── hooks_palette.cpp └── hooks_palette.h ├── Network ├── NetworkManager.cpp ├── NetworkManager.h ├── OnlineGameModeManager.cpp ├── OnlineGameModeManager.h ├── OnlinePaletteManager.cpp ├── OnlinePaletteManager.h ├── Packet.h ├── ReplayUploadManager.cpp ├── ReplayUploadManager.h ├── RoomManager.cpp └── RoomManager.h ├── Overlay ├── Logger │ ├── ImGuiLogger.cpp │ ├── ImGuiLogger.h │ └── Logger.h ├── NotificationBar │ ├── NotificationBar.cpp │ └── NotificationBar.h ├── Widget │ ├── ActiveGameModeWidget.cpp │ ├── ActiveGameModeWidget.h │ ├── GameModeSelectWidget.cpp │ ├── GameModeSelectWidget.h │ ├── StageSelectWidget.cpp │ └── StageSelectWidget.h ├── Window │ ├── ComboDataWindow.cpp │ ├── ComboDataWindow.h │ ├── DebugWindow.cpp │ ├── DebugWindow.h │ ├── FrameAdvantage │ │ ├── FrameAdvantage.cpp │ │ ├── FrameAdvantage.h │ │ ├── PlayerExtendedData.cpp │ │ └── PlayerExtendedData.h │ ├── HitboxOverlay.cpp │ ├── HitboxOverlay.h │ ├── IWindow.cpp │ ├── IWindow.h │ ├── InputBufferWindow.cpp │ ├── InputBufferWindow.h │ ├── LogWindow.cpp │ ├── LogWindow.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── PaletteEditorWindow.cpp │ ├── PaletteEditorWindow.h │ ├── PlaybackEditorWindow.cpp │ ├── PlaybackEditorWindow.h │ ├── ReplayDBPopupWindow.cpp │ ├── ReplayDBPopupWindow.h │ ├── RoomWindow.cpp │ ├── RoomWindow.h │ ├── ScrWindow.cpp │ ├── ScrWindow.h │ ├── UpdateNotifierWindow.cpp │ └── UpdateNotifierWindow.h ├── WindowContainer │ ├── WindowContainer.cpp │ ├── WindowContainer.h │ └── WindowType.h ├── WindowManager.cpp ├── WindowManager.h ├── fonts.cpp ├── fonts.h ├── imgui_utils.cpp └── imgui_utils.h ├── Palette ├── CharPaletteHandle.cpp ├── CharPaletteHandle.h ├── PaletteManager.cpp ├── PaletteManager.h ├── impl_format.h ├── impl_templates.cpp └── impl_templates.h ├── SteamApiWrapper ├── SteamApiHelper.cpp ├── SteamApiHelper.h ├── SteamFriendsWrapper.cpp ├── SteamFriendsWrapper.h ├── SteamMatchmakingWrapper.cpp ├── SteamMatchmakingWrapper.h ├── SteamNetworkingWrapper.cpp ├── SteamNetworkingWrapper.h ├── SteamUserStatsWrapper.cpp ├── SteamUserStatsWrapper.h ├── SteamUserWrapper.cpp ├── SteamUserWrapper.h ├── SteamUtilsWrapper.cpp ├── SteamUtilsWrapper.h ├── steamApiWrappers.cpp └── steamApiWrappers.h └── Web ├── update_check.cpp ├── update_check.h ├── url_downloader.cpp └── url_downloader.h /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | bin/ 3 | build/ -------------------------------------------------------------------------------- /BBCF_IM.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BBCF_IM", "BBCF_IM.vcxproj", "{CB50353A-2EC9-4D1C-89C6-65A621C335C5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CB50353A-2EC9-4D1C-89C6-65A621C335C5}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {CB50353A-2EC9-4D1C-89C6-65A621C335C5}.Debug|Win32.Build.0 = Debug|Win32 16 | {CB50353A-2EC9-4D1C-89C6-65A621C335C5}.Release|Win32.ActiveCfg = Release|Win32 17 | {CB50353A-2EC9-4D1C-89C6-65A621C335C5}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /BBCF_IM.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | 7 | WindowsLocalDebugger 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BBCF-Improvement-Mod 2 | Additional features and tweaks for BlazBlue Centralfiction 3 | 4 | The goal is to extend the game with community-created content and provide additional graphical options. 5 | 6 | Join the [BB Improvement Mod Discord Server](https://discord.gg/j2mCX9s) to discuss about the development and the game itself! 7 | 8 | ## What this mod provides 9 | - Adds extra game modes 10 | - Adds hitbox overlay 11 | - Adds replay takeover 12 | - Adds P2 State Library 13 | - Adds wakeup action thru state library 14 | - Adds gap action thru state library 15 | - Adds training dummy slot introspection 16 | - Adds training dummy slot saving/loading to/from local files 17 | - Adds wakeup action thru training dummy slots 18 | - Adds gap action thru training dummy slots 19 | - Adds local replay file loading 20 | - more experimental features 21 | 22 | 23 | - Create and load custom palettes and effects without file modifications 24 | - See each other's custom palettes in online matches 25 | - More flexibility to change the graphics options 26 | - Change avatars and accessories in online rooms/lobbies without going back into menu 27 | - Freely adjustable ingame currency value 28 | 29 | ## Installing 30 | Download dinput8.dll, settings.ini and optionally palettes.ini from the latest release and put it in your BlazBlue Centralfiction folder. There is no need to compile it yourself for regular usage. 31 | 32 | 33 | ## Compiling and usage 34 | BBCF Improvement Mod is coded using Visual Studio 2019 (toolset v142).
35 | To compile, you should only need to load the sln file and compile as-is. No changes should be needed to the solution or source.
36 | Copy the compiled binary, settings.ini, and palettes.ini files from the bin/ folder into the game's root folder. 37 | 38 | ## Requirements 39 | - Visual Studio 2019 (toolset v142) (Windows SDK 10) 40 | 41 | ## Thanks to the people who have helped the mod along the way 42 | * GrimFlash 43 | * KoviDomi 44 | * Neptune 45 | * Rouzel 46 | * Dormin 47 | * NeoStrayCat 48 | * KDing 49 | * PC_volt 50 | * Everybody in the BlazBlue PC community that has given support or feedback of any kind! 51 | 52 | ## Extra thanks to 53 | Atom0s for their DirectX9.0 Hooking article
54 | Durante for their dsfix source 55 | 56 | ## Legal 57 | ``` 58 | BBCF Improvement Mod is NOT associated with Arc System Works or any of its partners / affiliates. 59 | BBCF Improvement Mod is NOT intended for malicious use. 60 | BBCF Improvement Mod is NOT intended to give players unfair advantages in online matches. 61 | BBCF Improvement Mod is NOT intended to unlock unreleased / unpurchased contents of the game. 62 | BBCF Improvement Mod should only be used on the official version that you legally purchased and own. 63 | 64 | Use BBCF Improvement Mod at your own risk. 65 | I, Microsoft Excel/libreofficecalc, am not responsible for what happens while using BBCF Improvement Mod. You take full reponsibility for any outcome that happens to you while using this application. 66 | ``` 67 | -------------------------------------------------------------------------------- /depends/detour/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/detour/detours.lib -------------------------------------------------------------------------------- /depends/detour/detours.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/detour/detours.pdb -------------------------------------------------------------------------------- /depends/directx_sdk/Include/D2DBaseTypes.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // This file is automatically generated. Please do not edit it directly. 5 | // 6 | // File name: D2DBaseTypes.h 7 | //--------------------------------------------------------------------------- 8 | #pragma once 9 | 10 | 11 | #ifndef _D2DBASETYPES_INCLUDED 12 | #define _D2DBASETYPES_INCLUDED 13 | 14 | #ifndef COM_NO_WINDOWS_H 15 | #include 16 | #endif // #ifndef COM_NO_WINDOWS_H 17 | 18 | #ifndef D3DCOLORVALUE_DEFINED 19 | 20 | //+----------------------------------------------------------------------------- 21 | // 22 | // Struct: 23 | // D3DCOLORVALUE 24 | // 25 | //------------------------------------------------------------------------------ 26 | typedef struct D3DCOLORVALUE 27 | { 28 | FLOAT r; 29 | FLOAT g; 30 | FLOAT b; 31 | FLOAT a; 32 | 33 | } D3DCOLORVALUE; 34 | 35 | #define D3DCOLORVALUE_DEFINED 36 | #endif 37 | 38 | 39 | //+----------------------------------------------------------------------------- 40 | // 41 | // Struct: 42 | // D2D_POINT_2U 43 | // 44 | //------------------------------------------------------------------------------ 45 | typedef struct D2D_POINT_2U 46 | { 47 | UINT32 x; 48 | UINT32 y; 49 | 50 | } D2D_POINT_2U; 51 | 52 | 53 | //+----------------------------------------------------------------------------- 54 | // 55 | // Struct: 56 | // D2D_POINT_2F 57 | // 58 | //------------------------------------------------------------------------------ 59 | typedef struct D2D_POINT_2F 60 | { 61 | FLOAT x; 62 | FLOAT y; 63 | 64 | } D2D_POINT_2F; 65 | 66 | 67 | //+----------------------------------------------------------------------------- 68 | // 69 | // Struct: 70 | // D2D_RECT_F 71 | // 72 | //------------------------------------------------------------------------------ 73 | typedef struct D2D_RECT_F 74 | { 75 | FLOAT left; 76 | FLOAT top; 77 | FLOAT right; 78 | FLOAT bottom; 79 | 80 | } D2D_RECT_F; 81 | 82 | 83 | //+----------------------------------------------------------------------------- 84 | // 85 | // Struct: 86 | // D2D_RECT_U 87 | // 88 | //------------------------------------------------------------------------------ 89 | typedef struct D2D_RECT_U 90 | { 91 | UINT32 left; 92 | UINT32 top; 93 | UINT32 right; 94 | UINT32 bottom; 95 | 96 | } D2D_RECT_U; 97 | 98 | 99 | //+----------------------------------------------------------------------------- 100 | // 101 | // Struct: 102 | // D2D_SIZE_F 103 | // 104 | //------------------------------------------------------------------------------ 105 | typedef struct D2D_SIZE_F 106 | { 107 | FLOAT width; 108 | FLOAT height; 109 | 110 | } D2D_SIZE_F; 111 | 112 | 113 | //+----------------------------------------------------------------------------- 114 | // 115 | // Struct: 116 | // D2D_SIZE_U 117 | // 118 | //------------------------------------------------------------------------------ 119 | typedef struct D2D_SIZE_U 120 | { 121 | UINT32 width; 122 | UINT32 height; 123 | 124 | } D2D_SIZE_U; 125 | 126 | typedef D3DCOLORVALUE D2D_COLOR_F; 127 | 128 | //+----------------------------------------------------------------------------- 129 | // 130 | // Struct: 131 | // D2D_MATRIX_3X2_F 132 | // 133 | //------------------------------------------------------------------------------ 134 | typedef struct D2D_MATRIX_3X2_F 135 | { 136 | FLOAT _11; 137 | FLOAT _12; 138 | FLOAT _21; 139 | FLOAT _22; 140 | FLOAT _31; 141 | FLOAT _32; 142 | 143 | } D2D_MATRIX_3X2_F; 144 | 145 | #endif // #ifndef _D2DBASETYPES_INCLUDED 146 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/D3DX10.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx10.h 6 | // Content: D3DX10 utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX10_INTERNAL__ 11 | #error Incorrect D3DX10 header used 12 | #endif 13 | 14 | #ifndef __D3DX10_H__ 15 | #define __D3DX10_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | #include 21 | 22 | #define D3DX10_DEFAULT ((UINT) -1) 23 | #define D3DX10_FROM_FILE ((UINT) -3) 24 | #define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) 25 | 26 | #ifndef D3DX10INLINE 27 | #ifdef _MSC_VER 28 | #if (_MSC_VER >= 1200) 29 | #define D3DX10INLINE __forceinline 30 | #else 31 | #define D3DX10INLINE __inline 32 | #endif 33 | #else 34 | #ifdef __cplusplus 35 | #define D3DX10INLINE inline 36 | #else 37 | #define D3DX10INLINE 38 | #endif 39 | #endif 40 | #endif 41 | 42 | 43 | 44 | // Includes 45 | #include "d3d10.h" 46 | #include "d3dx10.h" 47 | #include "d3dx10math.h" 48 | #include "d3dx10core.h" 49 | #include "d3dx10tex.h" 50 | #include "d3dx10mesh.h" 51 | #include "d3dx10async.h" 52 | 53 | 54 | // Errors 55 | #define _FACDD 0x876 56 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 57 | 58 | enum _D3DX10_ERR { 59 | D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), 60 | D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), 61 | D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), 62 | D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), 63 | D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), 64 | D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), 65 | D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), 66 | D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), 67 | D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), 68 | }; 69 | 70 | 71 | #endif //__D3DX10_H__ 72 | 73 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/D3DX11.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx11.h 6 | // Content: D3DX11 utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX11_INTERNAL__ 11 | #error Incorrect D3DX11 header used 12 | #endif 13 | 14 | #ifndef __D3DX11_H__ 15 | #define __D3DX11_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | #include 21 | 22 | #ifdef ALLOW_THROWING_NEW 23 | #include 24 | #endif 25 | 26 | #define D3DX11_DEFAULT ((UINT) -1) 27 | #define D3DX11_FROM_FILE ((UINT) -3) 28 | #define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) 29 | 30 | #ifndef D3DX11INLINE 31 | #ifdef _MSC_VER 32 | #if (_MSC_VER >= 1200) 33 | #define D3DX11INLINE __forceinline 34 | #else 35 | #define D3DX11INLINE __inline 36 | #endif 37 | #else 38 | #ifdef __cplusplus 39 | #define D3DX11INLINE inline 40 | #else 41 | #define D3DX11INLINE 42 | #endif 43 | #endif 44 | #endif 45 | 46 | 47 | 48 | // Includes 49 | #include "d3d11.h" 50 | #include "d3dx11.h" 51 | #include "d3dx11core.h" 52 | #include "d3dx11tex.h" 53 | #include "d3dx11async.h" 54 | 55 | 56 | // Errors 57 | #define _FACDD 0x876 58 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 59 | 60 | enum _D3DX11_ERR { 61 | D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), 62 | D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), 63 | D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), 64 | D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), 65 | D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), 66 | D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), 67 | D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), 68 | D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), 69 | D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), 70 | }; 71 | 72 | 73 | #endif //__D3DX11_H__ 74 | 75 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/Dcommon.h: -------------------------------------------------------------------------------- 1 | //+-------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // Abstract: 6 | // Public API definitions for DWrite and D2D 7 | // 8 | //---------------------------------------------------------------------------- 9 | 10 | #ifndef DCOMMON_H_INCLUDED 11 | #define DCOMMON_H_INCLUDED 12 | 13 | // 14 | //These macros are defined in the Windows 7 SDK, however to enable development using the technical preview, 15 | //they are included here temporarily. 16 | // 17 | #ifndef DEFINE_ENUM_FLAG_OPERATORS 18 | #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ 19 | extern "C++" { \ 20 | inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ 21 | inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ 22 | inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ 23 | inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ 24 | inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ 25 | inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ 26 | inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ 27 | } 28 | #endif 29 | 30 | #ifndef __field_ecount_opt 31 | #define __field_ecount_opt(x) 32 | #endif 33 | 34 | #ifndef __range 35 | #define __range(x,y) 36 | #endif 37 | 38 | #ifndef __field_ecount 39 | #define __field_ecount(x) 40 | #endif 41 | 42 | /// 43 | /// The measuring method used for text layout. 44 | /// 45 | typedef enum DWRITE_MEASURING_MODE 46 | { 47 | /// 48 | /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution. 49 | /// 50 | DWRITE_MEASURING_MODE_NATURAL, 51 | 52 | /// 53 | /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution. 54 | /// 55 | DWRITE_MEASURING_MODE_GDI_CLASSIC, 56 | 57 | /// 58 | /// Text is measured using the same glyph display metrics as text measured by GDI using a font 59 | /// created with CLEARTYPE_NATURAL_QUALITY. 60 | /// 61 | DWRITE_MEASURING_MODE_GDI_NATURAL 62 | 63 | } DWRITE_MEASURING_MODE; 64 | 65 | #endif /* DCOMMON_H_INCLUDED */ 66 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/DxErr.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * 4 | * File: dxerr.h 5 | * Content: DirectX Error Library Include File 6 | * 7 | ****************************************************************************/ 8 | 9 | #ifndef _DXERR_H_ 10 | #define _DXERR_H_ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif //__cplusplus 15 | 16 | // 17 | // DXGetErrorString 18 | // 19 | // Desc: Converts a DirectX HRESULT to a string 20 | // 21 | // Args: HRESULT hr Can be any error code from 22 | // XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW 23 | // 24 | // Return: Converted string 25 | // 26 | const char* WINAPI DXGetErrorStringA(__in HRESULT hr); 27 | const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr); 28 | 29 | #ifdef UNICODE 30 | #define DXGetErrorString DXGetErrorStringW 31 | #else 32 | #define DXGetErrorString DXGetErrorStringA 33 | #endif 34 | 35 | 36 | // 37 | // DXGetErrorDescription 38 | // 39 | // Desc: Returns a string description of a DirectX HRESULT 40 | // 41 | // Args: HRESULT hr Can be any error code from 42 | // XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW 43 | // 44 | // Return: String description 45 | // 46 | const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr); 47 | const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr); 48 | 49 | #ifdef UNICODE 50 | #define DXGetErrorDescription DXGetErrorDescriptionW 51 | #else 52 | #define DXGetErrorDescription DXGetErrorDescriptionA 53 | #endif 54 | 55 | 56 | // 57 | // DXTrace 58 | // 59 | // Desc: Outputs a formatted error message to the debug stream 60 | // 61 | // Args: CHAR* strFile The current file, typically passed in using the 62 | // __FILE__ macro. 63 | // DWORD dwLine The current line number, typically passed in using the 64 | // __LINE__ macro. 65 | // HRESULT hr An HRESULT that will be traced to the debug stream. 66 | // CHAR* strMsg A string that will be traced to the debug stream (may be NULL) 67 | // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. 68 | // 69 | // Return: The hr that was passed in. 70 | // 71 | HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox ); 72 | HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox ); 73 | 74 | #ifdef UNICODE 75 | #define DXTrace DXTraceW 76 | #else 77 | #define DXTrace DXTraceA 78 | #endif 79 | 80 | 81 | // 82 | // Helper macros 83 | // 84 | #if defined(DEBUG) | defined(_DEBUG) 85 | #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) 86 | #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) 87 | #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) 88 | #else 89 | #define DXTRACE_MSG(str) (0L) 90 | #define DXTRACE_ERR(str,hr) (hr) 91 | #define DXTRACE_ERR_MSGBOX(str,hr) (hr) 92 | #endif 93 | 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif //__cplusplus 98 | 99 | #endif // _DXERR_H_ 100 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/comdecl.h: -------------------------------------------------------------------------------- 1 | // comdecl.h: Macros to facilitate COM interface and GUID declarations. 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | 4 | #ifndef _COMDECL_H_ 5 | #define _COMDECL_H_ 6 | 7 | #ifndef _XBOX 8 | #include // For standard COM interface macros 9 | #else 10 | #pragma warning(push) 11 | #pragma warning(disable:4061) 12 | #include // Required by xobjbase.h 13 | #include // Special definitions for Xbox build 14 | #pragma warning(pop) 15 | #endif 16 | 17 | // The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to 18 | // be declared and defined in such a way that clients can obtain the GUIDs using 19 | // either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names. 20 | // If using the latter approach, the client can also choose whether to get the 21 | // GUID definitions by defining the INITGUID preprocessor constant or by linking 22 | // to a GUID library. This works in either C or C++. 23 | 24 | #ifdef __cplusplus 25 | 26 | #define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x)) 27 | #ifdef INITGUID 28 | 29 | #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 30 | class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ 31 | EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className) 32 | 33 | #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 34 | interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ 35 | EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName) 36 | 37 | #else // INITGUID 38 | 39 | #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 40 | class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ 41 | EXTERN_C const GUID CLSID_##className 42 | 43 | #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 44 | interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ 45 | EXTERN_C const GUID IID_##interfaceName 46 | 47 | #endif // INITGUID 48 | 49 | #else // __cplusplus 50 | 51 | #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 52 | DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) 53 | 54 | #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 55 | DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) 56 | 57 | #endif // __cplusplus 58 | 59 | #endif // #ifndef _COMDECL_H_ 60 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/d3dx9.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx9.h 6 | // Content: D3DX utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX_INTERNAL__ 11 | #error Incorrect D3DX header used 12 | #endif 13 | 14 | #ifndef __D3DX9_H__ 15 | #define __D3DX9_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | 21 | #define D3DX_DEFAULT ((UINT) -1) 22 | #define D3DX_DEFAULT_NONPOW2 ((UINT) -2) 23 | #define D3DX_DEFAULT_FLOAT FLT_MAX 24 | #define D3DX_FROM_FILE ((UINT) -3) 25 | #define D3DFMT_FROM_FILE ((D3DFORMAT) -3) 26 | 27 | #ifndef D3DXINLINE 28 | #ifdef _MSC_VER 29 | #if (_MSC_VER >= 1200) 30 | #define D3DXINLINE __forceinline 31 | #else 32 | #define D3DXINLINE __inline 33 | #endif 34 | #else 35 | #ifdef __cplusplus 36 | #define D3DXINLINE inline 37 | #else 38 | #define D3DXINLINE 39 | #endif 40 | #endif 41 | #endif 42 | 43 | 44 | 45 | // Includes 46 | #include "d3d9.h" 47 | #include "d3dx9math.h" 48 | #include "d3dx9core.h" 49 | #include "d3dx9xof.h" 50 | #include "d3dx9mesh.h" 51 | #include "d3dx9shader.h" 52 | #include "d3dx9effect.h" 53 | 54 | #include "d3dx9tex.h" 55 | #include "d3dx9shape.h" 56 | #include "d3dx9anim.h" 57 | 58 | 59 | 60 | // Errors 61 | #define _FACDD 0x876 62 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 63 | 64 | enum _D3DXERR { 65 | D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), 66 | D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), 67 | D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), 68 | D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), 69 | D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), 70 | D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), 71 | D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), 72 | D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), 73 | D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908), 74 | }; 75 | 76 | 77 | #endif //__D3DX9_H__ 78 | 79 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/dxsdkver.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * 4 | * File: dxsdkver.h 5 | * Content: DirectX SDK Version Include File 6 | * 7 | ****************************************************************************/ 8 | 9 | #ifndef _DXSDKVER_H_ 10 | #define _DXSDKVER_H_ 11 | 12 | #define _DXSDK_PRODUCT_MAJOR 9 13 | #define _DXSDK_PRODUCT_MINOR 29 14 | #define _DXSDK_BUILD_MAJOR 1962 15 | #define _DXSDK_BUILD_MINOR 0 16 | 17 | #endif // _DXSDKVER_H_ 18 | 19 | -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/D3DCSX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/D3DCSX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/D3DCSXd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/D3DCSXd.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/DxErr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/DxErr.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/X3DAudio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/X3DAudio.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/XAPOFX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/XAPOFX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/XInput.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/XInput.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d2d1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d2d1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3d10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d10_1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3d10_1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3d11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3d9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dcompiler.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dcompiler.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx10d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx10d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx11d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx11d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx9d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dx9d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dxof.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/d3dxof.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dinput8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/dinput8.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dsound.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/dsound.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dwrite.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/dwrite.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dxgi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/dxgi.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dxguid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/dxguid.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/xapobase.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/xapobase.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/xapobased.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x64/xapobased.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/D3DCSX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/D3DCSX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/D3DCSXd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/D3DCSXd.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/DxErr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/DxErr.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/X3DAudio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/X3DAudio.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/XAPOFX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/XAPOFX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/XInput.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/XInput.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d2d1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d2d1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3d10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d10_1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3d10_1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3d11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3d9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dcompiler.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dcompiler.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx10d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx10d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx11d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx11d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx9d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dx9d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dxof.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/d3dxof.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dinput8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dinput8.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dsetup.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dsetup.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dsound.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dsound.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dwrite.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dwrite.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dxgi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dxgi.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dxguid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/dxguid.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/xapobase.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/xapobase.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/xapobased.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/directx_sdk/Lib/x86/xapobased.lib -------------------------------------------------------------------------------- /depends/imgui/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // USER IMPLEMENTATION 3 | // This file contains compile-time options for ImGui. 4 | // Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO(). 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | //---- Define assertion handler. Defaults to calling assert(). 10 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 11 | 12 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows. 13 | //#define IMGUI_API __declspec( dllexport ) 14 | //#define IMGUI_API __declspec( dllimport ) 15 | 16 | //---- Don't define obsolete functions names. Consider enabling from time to time or when updating to reduce like hood of using already obsolete function/names 17 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 18 | 19 | //---- Include imgui_user.h at the end of imgui.h 20 | //#define IMGUI_INCLUDE_IMGUI_USER_H 21 | 22 | //---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions) 23 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS 24 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS 25 | 26 | //---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty) 27 | //---- It is very strongly recommended to NOT disable the demo windows. Please read the comment at the top of imgui_demo.cpp to learn why. 28 | //#define IMGUI_DISABLE_DEMO_WINDOWS 29 | 30 | //---- Don't implement ImFormatString(), ImFormatStringV() so you can reimplement them yourself. 31 | //#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS 32 | 33 | //---- Pack colors to BGRA instead of RGBA (remove need to post process vertex buffer in back ends) 34 | //#define IMGUI_USE_BGRA_PACKED_COLOR 35 | 36 | //---- Implement STB libraries in a namespace to avoid linkage conflicts 37 | //#define IMGUI_STB_NAMESPACE ImGuiStb 38 | 39 | //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. 40 | /* 41 | #define IM_VEC2_CLASS_EXTRA \ 42 | ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ 43 | operator MyVec2() const { return MyVec2(x,y); } 44 | 45 | #define IM_VEC4_CLASS_EXTRA \ 46 | ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ 47 | operator MyVec4() const { return MyVec4(x,y,z,w); } 48 | */ 49 | 50 | //---- Use 32-bit vertex indices (instead of default: 16-bit) to allow meshes with more than 64K vertices 51 | //#define ImDrawIdx unsigned int 52 | 53 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. 54 | //---- e.g. create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers. 55 | /* 56 | namespace ImGui 57 | { 58 | void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL); 59 | } 60 | */ 61 | 62 | -------------------------------------------------------------------------------- /depends/imgui/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX9 binding 2 | // In this binding, ImTextureID is used to store a 'LPDIRECT3DTEXTURE9' texture identifier. Read the FAQ about ImTextureID in imgui.cpp. 3 | 4 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 5 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 6 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 7 | // https://github.com/ocornut/imgui 8 | 9 | struct IDirect3DDevice9; 10 | 11 | IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device); 12 | IMGUI_API void ImGui_ImplDX9_Shutdown(); 13 | IMGUI_API void ImGui_ImplDX9_NewFrame(); 14 | 15 | // Use if you want to reset your rendering device without losing ImGui state. 16 | IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 17 | IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects(); 18 | 19 | // Handler for Win32 messages, update mouse/keyboard data. 20 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 21 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 22 | /* 23 | IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 24 | */ 25 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamapplist.h: -------------------------------------------------------------------------------- 1 | //====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: interface to app data in Steam 4 | // 5 | //============================================================================= 6 | 7 | #ifndef ISTEAMAPPLIST_H 8 | #define ISTEAMAPPLIST_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | #include "isteamclient.h" 14 | #include "steamtypes.h" 15 | 16 | //----------------------------------------------------------------------------- 17 | // Purpose: This is a restricted interface that can only be used by previously approved apps, 18 | // contact your Steam Account Manager if you believe you need access to this API. 19 | // This interface lets you detect installed apps for the local Steam client, useful for debugging tools 20 | // to offer lists of apps to debug via Steam. 21 | //----------------------------------------------------------------------------- 22 | class ISteamAppList 23 | { 24 | public: 25 | virtual uint32 GetNumInstalledApps() = 0; 26 | virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; 27 | 28 | virtual int GetAppName( AppId_t nAppID, OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found 29 | virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found 30 | 31 | virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game 32 | }; 33 | 34 | #define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" 35 | 36 | // callbacks 37 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 38 | #pragma pack( push, 4 ) 39 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 40 | #pragma pack( push, 8 ) 41 | #else 42 | #error isteamclient.h must be included 43 | #endif 44 | 45 | 46 | //--------------------------------------------------------------------------------- 47 | // Purpose: Sent when a new app is installed 48 | //--------------------------------------------------------------------------------- 49 | DEFINE_CALLBACK( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); 50 | CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs 51 | END_DEFINE_CALLBACK_1() 52 | 53 | 54 | //--------------------------------------------------------------------------------- 55 | // Purpose: Sent when an app is uninstalled 56 | //--------------------------------------------------------------------------------- 57 | DEFINE_CALLBACK( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); 58 | CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs 59 | END_DEFINE_CALLBACK_1() 60 | 61 | 62 | #pragma pack( pop ) 63 | #endif // ISTEAMAPPLIST_H 64 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamappticket.h: -------------------------------------------------------------------------------- 1 | //====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: a private, but well versioned, interface to get at critical bits 4 | // of a steam3 appticket - consumed by the simple drm wrapper to let it 5 | // ask about ownership with greater confidence. 6 | // 7 | //============================================================================= 8 | 9 | #ifndef ISTEAMAPPTICKET_H 10 | #define ISTEAMAPPTICKET_H 11 | #pragma once 12 | 13 | //----------------------------------------------------------------------------- 14 | // Purpose: hand out a reasonable "future proof" view of an app ownership ticket 15 | // the raw (signed) buffer, and indices into that buffer where the appid and 16 | // steamid are located. the sizes of the appid and steamid are implicit in 17 | // (each version of) the interface - currently uin32 appid and uint64 steamid 18 | //----------------------------------------------------------------------------- 19 | class ISteamAppTicket 20 | { 21 | public: 22 | virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; 23 | }; 24 | 25 | #define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001" 26 | 27 | 28 | #endif // ISTEAMAPPTICKET_H 29 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamgamecoordinator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/isteamgamecoordinator.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamgameserverstats.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/isteamgameserverstats.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteaminventory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/isteaminventory.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteammasterserverupdater.h: -------------------------------------------------------------------------------- 1 | #error "This file isn't used any more" 2 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteammusic.h: -------------------------------------------------------------------------------- 1 | //============ Copyright (c) Valve Corporation, All rights reserved. ============ 2 | 3 | #ifndef ISTEAMMUSIC_H 4 | #define ISTEAMMUSIC_H 5 | #ifdef _WIN32 6 | #pragma once 7 | #endif 8 | 9 | #include "isteamclient.h" 10 | 11 | //----------------------------------------------------------------------------- 12 | // Purpose: 13 | //----------------------------------------------------------------------------- 14 | enum AudioPlayback_Status 15 | { 16 | AudioPlayback_Undefined = 0, 17 | AudioPlayback_Playing = 1, 18 | AudioPlayback_Paused = 2, 19 | AudioPlayback_Idle = 3 20 | }; 21 | 22 | 23 | //----------------------------------------------------------------------------- 24 | // Purpose: Functions to control music playback in the steam client 25 | //----------------------------------------------------------------------------- 26 | class ISteamMusic 27 | { 28 | public: 29 | virtual bool BIsEnabled() = 0; 30 | virtual bool BIsPlaying() = 0; 31 | 32 | virtual AudioPlayback_Status GetPlaybackStatus() = 0; 33 | 34 | virtual void Play() = 0; 35 | virtual void Pause() = 0; 36 | virtual void PlayPrevious() = 0; 37 | virtual void PlayNext() = 0; 38 | 39 | // volume is between 0.0 and 1.0 40 | virtual void SetVolume( float flVolume ) = 0; 41 | virtual float GetVolume() = 0; 42 | 43 | }; 44 | 45 | #define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" 46 | 47 | // callbacks 48 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 49 | #pragma pack( push, 4 ) 50 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 51 | #pragma pack( push, 8 ) 52 | #else 53 | #error isteamclient.h must be included 54 | #endif 55 | 56 | 57 | DEFINE_CALLBACK( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) 58 | END_DEFINE_CALLBACK_0() 59 | 60 | DEFINE_CALLBACK( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) 61 | CALLBACK_MEMBER( 0, float, m_flNewVolume ) 62 | END_DEFINE_CALLBACK_1() 63 | 64 | #pragma pack( pop ) 65 | 66 | 67 | #endif // #define ISTEAMMUSIC_H 68 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamps3overlayrenderer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/isteamps3overlayrenderer.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamunifiedmessages.h: -------------------------------------------------------------------------------- 1 | //====== Copyright � 1996-2007, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: Interface to unified messages client 4 | // 5 | // You should not need to use this interface except if your product is using a language other than C++. 6 | // Contact your Steam Tech contact for more details. 7 | // 8 | //============================================================================= 9 | 10 | #ifndef ISTEAMUNIFIEDMESSAGES_H 11 | #define ISTEAMUNIFIEDMESSAGES_H 12 | #ifdef _WIN32 13 | #pragma once 14 | #endif 15 | 16 | typedef uint64 ClientUnifiedMessageHandle; 17 | 18 | class ISteamUnifiedMessages 19 | { 20 | public: 21 | static const ClientUnifiedMessageHandle k_InvalidUnifiedMessageHandle = 0; 22 | 23 | // Sends a service method (in binary serialized form) using the Steam Client. 24 | // Returns a unified message handle (k_InvalidUnifiedMessageHandle if could not send the message). 25 | virtual ClientUnifiedMessageHandle SendMethod( const char *pchServiceMethod, const void *pRequestBuffer, uint32 unRequestBufferSize, uint64 unContext ) = 0; 26 | 27 | // Gets the size of the response and the EResult. Returns false if the response is not ready yet. 28 | virtual bool GetMethodResponseInfo( ClientUnifiedMessageHandle hHandle, uint32 *punResponseSize, EResult *peResult ) = 0; 29 | 30 | // Gets a response in binary serialized form (and optionally release the corresponding allocated memory). 31 | virtual bool GetMethodResponseData( ClientUnifiedMessageHandle hHandle, void *pResponseBuffer, uint32 unResponseBufferSize, bool bAutoRelease ) = 0; 32 | 33 | // Releases the message and its corresponding allocated memory. 34 | virtual bool ReleaseMethod( ClientUnifiedMessageHandle hHandle ) = 0; 35 | 36 | // Sends a service notification (in binary serialized form) using the Steam Client. 37 | // Returns true if the notification was sent successfully. 38 | virtual bool SendNotification( const char *pchServiceNotification, const void *pNotificationBuffer, uint32 unNotificationBufferSize ) = 0; 39 | }; 40 | 41 | #define STEAMUNIFIEDMESSAGES_INTERFACE_VERSION "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001" 42 | 43 | // callbacks 44 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 45 | #pragma pack( push, 4 ) 46 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 47 | #pragma pack( push, 8 ) 48 | #else 49 | #error isteamclient.h must be included 50 | #endif 51 | 52 | struct SteamUnifiedMessagesSendMethodResult_t 53 | { 54 | enum { k_iCallback = k_iClientUnifiedMessagesCallbacks + 1 }; 55 | ClientUnifiedMessageHandle m_hHandle; // The handle returned by SendMethod(). 56 | uint64 m_unContext; // Context provided when calling SendMethod(). 57 | EResult m_eResult; // The result of the method call. 58 | uint32 m_unResponseSize; // The size of the response. 59 | }; 60 | 61 | #pragma pack( pop ) 62 | 63 | #endif // ISTEAMUNIFIEDMESSAGES_H 64 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamvideo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/isteamvideo.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/linux32/libsdkencryptedappticket.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/linux32/libsdkencryptedappticket.so -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/linux64/libsdkencryptedappticket.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/linux64/libsdkencryptedappticket.so -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/osx32/libsdkencryptedappticket.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/osx32/libsdkencryptedappticket.dylib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.dll -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.lib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.dll -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.lib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steam_gameserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/steam_gameserver.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamencryptedappticket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/steamencryptedappticket.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamhttpenums.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/steamhttpenums.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamtypes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/public/steam/steamtypes.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamuniverse.h: -------------------------------------------------------------------------------- 1 | //========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ 2 | // 3 | // Purpose: 4 | // 5 | //============================================================================= 6 | 7 | #ifndef STEAMUNIVERSE_H 8 | #define STEAMUNIVERSE_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | 14 | // Steam universes. Each universe is a self-contained Steam instance. 15 | enum EUniverse 16 | { 17 | k_EUniverseInvalid = 0, 18 | k_EUniversePublic = 1, 19 | k_EUniverseBeta = 2, 20 | k_EUniverseInternal = 3, 21 | k_EUniverseDev = 4, 22 | // k_EUniverseRC = 5, // no such universe anymore 23 | k_EUniverseMax 24 | }; 25 | 26 | 27 | #endif // STEAMUNIVERSE_H 28 | -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/linux32/libsteam_api.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/linux32/libsteam_api.so -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/linux64/libsteam_api.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/linux64/libsteam_api.so -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/osx32/libsteam_api.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/osx32/libsteam_api.dylib -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/steam_api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/steam_api.dll -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/steam_api.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/steam_api.lib -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/win64/steam_api64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/win64/steam_api64.dll -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/win64/steam_api64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libreofficecalc/BBCF-Improvement-Mod/d440319b51a2fb2a7a69c7183b4c18b01656c1a2/depends/steam_api/redistributable_bin/win64/steam_api64.lib -------------------------------------------------------------------------------- /export/dinput8.def: -------------------------------------------------------------------------------- 1 | LIBRARY DINPUT8 2 | 3 | EXPORTS 4 | DirectInput8Create -------------------------------------------------------------------------------- /notes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | 4 | 5 | SCENE_CVSInfo that is input to the touches_on_GameSceneState_FUN_00a8f9b0 func 6 | 7 | function to change scene probably in CScene_Controller class 8 | 9 | 10 | Check GAME_CEventCOntrol task because it probably is the thing that is controlling the order of SCENE change and stuff, and its factory. 11 | It is one of the arguments for the function that seems to do the scene change 12 | I can manipulate the scene change sometimes forcing by changing the arguments in the function (and remembering to set the GAMESTATE to be set in the minidump args in cheat engine) 13 | 14 | */ -------------------------------------------------------------------------------- /src/Core/Settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "D3D9EXWrapper/d3d9.h" 3 | 4 | #include 5 | #include 6 | 7 | struct settingsIni_t 8 | { 9 | //X-Macro 10 | #define SETTING(_type, _var, _inistring, _defaultval) \ 11 | _type _var 12 | #include "settings.def" 13 | #undef SETTING 14 | }; 15 | 16 | struct savedSettings_t 17 | { 18 | RECT newSourceRect; 19 | D3DVIEWPORT9 newViewport; 20 | D3DXVECTOR2 origViewportRes; 21 | bool isDuelFieldSprite; 22 | bool isFiltering; 23 | }; 24 | 25 | class Settings 26 | { 27 | public: 28 | static settingsIni_t settingsIni; 29 | static savedSettings_t savedSettings; 30 | 31 | static void applySettingsIni(D3DPRESENT_PARAMETERS* pPresentationParameters); 32 | static bool loadSettingsFile(); 33 | static void initSavedSettings(); 34 | //static void setViewportSize(D3DVIEWPORT9 Viewport); 35 | static short getButtonValue(std::string button); 36 | 37 | static int changeSetting(std::string setting_name, std::string new_value); 38 | private: 39 | static int readSettingsFilePropertyInt(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 40 | static float readSettingsFilePropertyFloat(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 41 | static std::string readSettingsFilePropertyString(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /src/Core/crashdump.cpp: -------------------------------------------------------------------------------- 1 | #include "crashdump.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | LONG WINAPI UnhandledExFilter(PEXCEPTION_POINTERS ExPtr) 10 | { 11 | BOOL(WINAPI* pMiniDumpWriteDump)(IN HANDLE hProcess, IN DWORD ProcessId, IN HANDLE hFile, IN MINIDUMP_TYPE DumpType, IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL) = NULL; 12 | 13 | HMODULE hLib = LoadLibrary(_T("dbghelp")); 14 | if (hLib) 15 | *(void**)&pMiniDumpWriteDump = (void*)GetProcAddress(hLib, "MiniDumpWriteDump"); 16 | 17 | TCHAR buf[MAX_PATH], buf2[MAX_PATH]; 18 | 19 | if (pMiniDumpWriteDump) { 20 | time_t timer; 21 | char timebuffer[26]; 22 | struct tm* tm_info; 23 | time(&timer); 24 | tm_info = localtime(&timer); 25 | strftime(timebuffer, 26, "%Y%m%d%H%M%S", tm_info); 26 | //convert from char* to wchar_t* 27 | size_t newsize = strlen(timebuffer) + 1; 28 | wchar_t * wtimestring = new wchar_t[newsize]; 29 | size_t convertedChars = 0; 30 | mbstowcs_s(&convertedChars, wtimestring, newsize, timebuffer, _TRUNCATE); 31 | 32 | wsprintf(buf2, _T("BBCF_IM\\Crash_%s.dmp"), wtimestring); 33 | delete wtimestring; 34 | 35 | HANDLE hFile = CreateFile(buf2, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 36 | 37 | if (hFile != INVALID_HANDLE_VALUE) 38 | { 39 | MINIDUMP_EXCEPTION_INFORMATION md; 40 | md.ThreadId = GetCurrentThreadId(); 41 | md.ExceptionPointers = ExPtr; 42 | md.ClientPointers = FALSE; 43 | BOOL win = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &md, 0, 0); 44 | 45 | if (!win) 46 | wsprintf(buf, _T("MiniDumpWriteDump failed. Error: %u \n(%s)"), GetLastError(), buf2); 47 | else 48 | wsprintf(buf, _T("Minidump created:\n%s"), buf2); 49 | CloseHandle(hFile); 50 | 51 | } 52 | else 53 | { 54 | wsprintf(buf, _T("Could not create minidump:\n%s"), buf2); 55 | } 56 | } 57 | else 58 | { 59 | wsprintf(buf, _T("Could not load dbghelp")); 60 | } 61 | MessageBox(NULL, buf, _T("Unhandled exception"), MB_OK | MB_ICONERROR); 62 | ExitProcess(0); //do whatever u want here 63 | } -------------------------------------------------------------------------------- /src/Core/crashdump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | //Custom exception handler to generate memory dump upon crash 5 | LONG WINAPI UnhandledExFilter(PEXCEPTION_POINTERS ExPtr); -------------------------------------------------------------------------------- /src/Core/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "crashdump.h" 2 | #include "interfaces.h" 3 | #include "logger.h" 4 | #include "Settings.h" 5 | 6 | #include "Hooks/hooks_detours.h" 7 | #include "Overlay/WindowManager.h" 8 | 9 | #include 10 | 11 | HMODULE hOriginalDinput; 12 | 13 | typedef HRESULT(WINAPI *DirectInput8Create_t)(HINSTANCE inst_handle, DWORD version, const IID& r_iid, LPVOID* out_wrapper, LPUNKNOWN p_unk); 14 | DirectInput8Create_t orig_DirectInput8Create; 15 | 16 | // Exported function 17 | HRESULT WINAPI DirectInput8Create(HINSTANCE hinstHandle, DWORD version, const IID& r_iid, LPVOID* outWrapper, LPUNKNOWN pUnk) 18 | { 19 | LOG(1, "DirectInput8Create\n"); 20 | 21 | HRESULT ret = orig_DirectInput8Create(hinstHandle, version, r_iid, outWrapper, pUnk); 22 | 23 | LOG(1, "DirectInput8Create result: %d\n", ret); 24 | 25 | return ret; 26 | } 27 | 28 | void CreateCustomDirectories() 29 | { 30 | LOG(1, "CreateCustomDirectories\n"); 31 | 32 | CreateDirectory(L"BBCF_IM", NULL); 33 | } 34 | 35 | void BBCF_IM_Shutdown() 36 | { 37 | LOG(1, "BBCF_IM_Shutdown\n"); 38 | 39 | WindowManager::GetInstance().Shutdown(); 40 | CleanupInterfaces(); 41 | closeLogger(); 42 | } 43 | 44 | bool LoadOriginalDinputDll() 45 | { 46 | if (Settings::settingsIni.dinputDllWrapper == "none" || Settings::settingsIni.dinputDllWrapper == "") 47 | { 48 | char dllPath[MAX_PATH]; 49 | GetSystemDirectoryA(dllPath, MAX_PATH); 50 | strcat_s(dllPath, "\\dinput8.dll"); 51 | 52 | hOriginalDinput = LoadLibraryA(dllPath); 53 | } 54 | else 55 | { 56 | LOG(2, "Loading dinput wrapper: %s\n", Settings::settingsIni.dinputDllWrapper.c_str()); 57 | hOriginalDinput = LoadLibraryA(Settings::settingsIni.dinputDllWrapper.c_str()); 58 | } 59 | 60 | if (hOriginalDinput == INVALID_HANDLE_VALUE) 61 | { 62 | return false; 63 | } 64 | 65 | orig_DirectInput8Create = (DirectInput8Create_t)GetProcAddress(hOriginalDinput, "DirectInput8Create"); 66 | 67 | if (!orig_DirectInput8Create) 68 | { 69 | return false; 70 | } 71 | 72 | LOG(1, "orig_DirectInput8Create: 0x%p\n", orig_DirectInput8Create); 73 | 74 | return true; 75 | } 76 | 77 | DWORD WINAPI BBCF_IM_Start(HMODULE hModule) 78 | { 79 | openLogger(); 80 | 81 | LOG(1, "Starting BBCF_IM_Start thread\n"); 82 | 83 | CreateCustomDirectories(); 84 | SetUnhandledExceptionFilter(UnhandledExFilter); 85 | 86 | if (!Settings::loadSettingsFile()) 87 | { 88 | ExitProcess(0); 89 | } 90 | logSettingsIni(); 91 | Settings::initSavedSettings(); 92 | 93 | if (!LoadOriginalDinputDll()) 94 | { 95 | MessageBoxA(nullptr, "Could not load original dinput8.dll!", "BBCFIM", MB_OK); 96 | ExitProcess(0); 97 | } 98 | 99 | if (!placeHooks_detours()) 100 | { 101 | MessageBoxA(nullptr, "Failed IAT hook", "BBCFIM", MB_OK); 102 | ExitProcess(0); 103 | } 104 | 105 | g_interfaces.pPaletteManager = new PaletteManager(); 106 | 107 | return 0; 108 | } 109 | 110 | BOOL WINAPI DllMain(HMODULE hinstDLL, DWORD ul_reason_for_call, LPVOID lpReserved) 111 | { 112 | switch (ul_reason_for_call) 113 | { 114 | case DLL_PROCESS_ATTACH: 115 | DisableThreadLibraryCalls(hinstDLL); 116 | CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)BBCF_IM_Start, hinstDLL, 0, nullptr)); 117 | break; 118 | 119 | case DLL_PROCESS_DETACH: 120 | BBCF_IM_Shutdown(); 121 | FreeLibrary(hOriginalDinput); 122 | break; 123 | } 124 | return TRUE; 125 | } -------------------------------------------------------------------------------- /src/Core/info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define MOD_VERSION "v3.0980" 3 | #define MOD_VERSION_NUM MOD_VERSION " BO BLEIS edition" 4 | #define MOD_WINDOW_TITLE "BBCF Improvement Mod BO BLEIS" 5 | 6 | #define MOD_FORCE_DISABLE_UPDATE_CHECK 0 7 | 8 | // Links 9 | #define MOD_LINK_DISCORD L"https://discord.gg/j2mCX9s" 10 | #define MOD_LINK_FORUM L"https://steamcommunity.com/app/586140/discussions/0/3195868146163014015/" 11 | #define MOD_LINK_GITHUB L"https://github.com/libreofficecalc/BBCF-Improvement-Mod/releases" 12 | #define MOD_LINK_API_GITHUB_RELEASE L"https://api.github.com/repos/libreofficecalc/BBCF-Improvement-Mod/releases" 13 | #define REPLAY_DB_FRONTEND L"http://50.118.225.175:2000/" 14 | -------------------------------------------------------------------------------- /src/Core/interfaces.cpp: -------------------------------------------------------------------------------- 1 | #include "interfaces.h" 2 | 3 | #include "logger.h" 4 | #include "utils.h" 5 | 6 | interfaces_t g_interfaces = {}; 7 | gameProc_t g_gameProc = {}; 8 | temps_t g_tempVals = {}; 9 | gameVals_t g_gameVals = {}; 10 | modValues_t g_modVals = {}; 11 | 12 | void InitManagers() 13 | { 14 | LOG(1, "InitManagers\n"); 15 | 16 | if (g_interfaces.pSteamNetworkingWrapper && 17 | g_interfaces.pSteamUserWrapper && 18 | !g_interfaces.pNetworkManager) 19 | { 20 | g_interfaces.pNetworkManager = new NetworkManager( 21 | g_interfaces.pSteamNetworkingWrapper, 22 | g_interfaces.pSteamUserWrapper->GetSteamID() 23 | ); 24 | } 25 | 26 | if (g_interfaces.pNetworkManager && 27 | g_interfaces.pSteamUserWrapper && 28 | g_interfaces.pSteamFriendsWrapper && 29 | !g_interfaces.pRoomManager) 30 | { 31 | g_interfaces.pRoomManager = new RoomManager( 32 | g_interfaces.pNetworkManager, 33 | g_interfaces.pSteamFriendsWrapper, 34 | g_interfaces.pSteamUserWrapper->GetSteamID() 35 | ); 36 | } 37 | 38 | if (g_interfaces.pPaletteManager && 39 | g_interfaces.pRoomManager && 40 | !g_interfaces.pOnlinePaletteManager) 41 | { 42 | g_interfaces.pOnlinePaletteManager = new OnlinePaletteManager( 43 | g_interfaces.pPaletteManager, 44 | &g_interfaces.player1.GetPalHandle(), 45 | &g_interfaces.player2.GetPalHandle(), 46 | g_interfaces.pRoomManager 47 | ); 48 | } 49 | 50 | if (!g_interfaces.pGameModeManager) 51 | { 52 | g_interfaces.pGameModeManager = new GameModeManager(); 53 | } 54 | 55 | if (g_interfaces.pGameModeManager && 56 | g_interfaces.pRoomManager && 57 | !g_interfaces.pOnlineGameModeManager) 58 | { 59 | g_interfaces.pOnlineGameModeManager = new OnlineGameModeManager( 60 | g_interfaces.pGameModeManager, 61 | g_interfaces.pRoomManager 62 | ); 63 | } 64 | if (g_interfaces.pRoomManager && 65 | !g_interfaces.pReplayUploadManager) 66 | { 67 | g_interfaces.pReplayUploadManager = new ReplayUploadManager(g_interfaces.pRoomManager); 68 | } 69 | } 70 | 71 | void CleanupInterfaces() 72 | { 73 | LOG(1, "CleanupInterfaces\n"); 74 | 75 | SAFE_DELETE(g_interfaces.pNetworkManager); 76 | SAFE_DELETE(g_interfaces.pPaletteManager); 77 | SAFE_DELETE(g_interfaces.pRoomManager); 78 | SAFE_DELETE(g_interfaces.pOnlinePaletteManager); 79 | SAFE_DELETE(g_interfaces.pOnlineGameModeManager); 80 | SAFE_DELETE(g_interfaces.pGameModeManager); 81 | 82 | SAFE_DELETE(g_interfaces.pD3D9ExWrapper); 83 | 84 | SAFE_DELETE(g_interfaces.pSteamFriendsWrapper); 85 | SAFE_DELETE(g_interfaces.pSteamMatchmakingWrapper); 86 | SAFE_DELETE(g_interfaces.pSteamNetworkingWrapper); 87 | SAFE_DELETE(g_interfaces.pSteamUserStatsWrapper); 88 | SAFE_DELETE(g_interfaces.pSteamUserWrapper); 89 | SAFE_DELETE(g_interfaces.pSteamUtilsWrapper); 90 | SAFE_DELETE(g_interfaces.pSteamApiHelper); 91 | } 92 | -------------------------------------------------------------------------------- /src/Core/keycodes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | std::map keycode_mapper{ 5 | // Function keys 6 | {"F1" , 112}, 7 | {"F2" , 113}, 8 | {"F3" , 114}, 9 | {"F4" , 115}, 10 | {"F5" , 116}, 11 | {"F6" , 117}, 12 | {"F7" , 118}, 13 | {"F8" , 119}, 14 | {"F9" , 120}, 15 | {"F10" , 121}, 16 | {"F11" , 122}, 17 | {"F12" , 123}, 18 | 19 | // Alphanumeric keys 20 | {"A" , 65}, 21 | {"B" , 66}, 22 | {"C" , 67}, 23 | {"D" , 68}, 24 | {"E" , 69}, 25 | {"F" , 70}, 26 | {"G" , 71}, 27 | {"H" , 72}, 28 | {"I" , 73}, 29 | {"J" , 74}, 30 | {"K" , 75}, 31 | {"L" , 76}, 32 | {"M" , 77}, 33 | {"N" , 78}, 34 | {"O" , 79}, 35 | {"P" , 80}, 36 | {"Q" , 81}, 37 | {"R" , 82}, 38 | {"S" , 83}, 39 | {"T" , 84}, 40 | {"U" , 85}, 41 | {"V" , 86}, 42 | {"W" , 87}, 43 | {"X" , 88}, 44 | {"Y" , 89}, 45 | {"Z" , 90}, 46 | 47 | // Numeric keys (top row) 48 | {"0" , 48}, 49 | {"1" , 49}, 50 | {"2" , 50}, 51 | {"3" , 51}, 52 | {"4" , 52}, 53 | {"5" , 53}, 54 | {"6" , 54}, 55 | {"7" , 55}, 56 | {"8" , 56}, 57 | {"9" , 57}, 58 | 59 | // Special characters 60 | {"TILDE" , 192}, 61 | {"MINUS" , 189}, 62 | {"EQUAL" , 187}, 63 | {"BACKSPACE" , 8}, 64 | 65 | // Control keys 66 | {"TAB" , 9}, 67 | {"ENTER" , 13}, 68 | {"SHIFT" , 16}, 69 | {"CTRL" , 17}, 70 | {"ALT" , 18}, 71 | {"SPACE" , 32}, 72 | 73 | // Arrow keys 74 | {"ARROW_LEFT" , 37}, 75 | {"ARROW_UP" , 38}, 76 | {"ARROW_RIGHT" , 39}, 77 | {"ARROW_DOWN" , 40}, 78 | 79 | // Punctuation and other symbols 80 | {"OPEN_BRACKET" , 219}, 81 | {"CLOSE_BRACKET" , 221}, 82 | {"BACKSLASH" , 220}, 83 | {"SEMICOLON" , 186}, 84 | {"QUOTE" , 222}, 85 | {"COMMA" , 188}, 86 | {"PERIOD" , 190}, 87 | {"SLASH" , 191}, 88 | 89 | // Other 90 | {"ESC" , 27}, 91 | {"CAPSLOCK" , 20}, 92 | {"INSERT" , 45}, 93 | {"DELETE" , 46}, 94 | {"HOME" , 36}, 95 | {"END" , 35}, 96 | {"PAGE_UP" , 33}, 97 | {"PAGE_DOWN" , 34} 98 | }; -------------------------------------------------------------------------------- /src/Core/logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Settings.h" 3 | 4 | #include "D3D9EXWrapper/d3d9.h" 5 | 6 | #define DEBUG_LOG_LEVEL 5 //0 = highest, 7 = lowest priority 7 | #define FORCE_LOGGING 0 8 | 9 | #if defined(_DEBUG) || FORCE_LOGGING == 1 10 | #define ENABLE_LOGGING 1 11 | #endif 12 | 13 | #ifdef ENABLE_LOGGING 14 | #define LOG(_level, _str, ...) { \ 15 | if (DEBUG_LOG_LEVEL >= _level) { logger(_str, __VA_ARGS__); }} 16 | 17 | //Use this to log in naked asm functions 18 | #define LOG_ASM(_level, _str, ...) { \ 19 | __asm{__asm pushad }; \ 20 | if (DEBUG_LOG_LEVEL >= _level) { {logger(_str, __VA_ARGS__);} } \ 21 | __asm{__asm popad }; } 22 | #else 23 | #define LOG(_level, _str, ...) {} 24 | 25 | //Use this to log in naked asm functions 26 | #define LOG_ASM(_level, _str, ...) {} 27 | #endif 28 | 29 | inline void logger(const char* message, ...); 30 | void openLogger(); 31 | void closeLogger(); 32 | //free it after usage!! 33 | char* getFullDate(); 34 | void logSettingsIni(); 35 | bool hookSucceeded(PBYTE addr, const char* funcName); 36 | void logD3DPParams(D3DPRESENT_PARAMETERS* pPresentationParameters, bool isOriginalSettings = true); -------------------------------------------------------------------------------- /src/Core/settings.def: -------------------------------------------------------------------------------- 1 | // X-Macro file for settings.ini definitions 2 | // Warning: std::string types must be handled separately in code when printing. 3 | // format: (type, cname, ininame, default value) 4 | 5 | SETTING(std::string, togglebutton, "ToggleButton", "F1"); 6 | SETTING(std::string, toggleOnlineButton, "ToggleOnlineButton", "F2"); 7 | SETTING(std::string, toggleHUDbutton, "ToggleHUDButton", "F3"); 8 | SETTING(std::string, saveStateKeybind, "SaveStateKeybind", "F5"); 9 | SETTING(std::string, loadStateKeybind, "LoadStateKeybind", "F9"); 10 | SETTING(std::string, loadReplayStateKeybind, "LoadReplayStateKeybind", "F4"); 11 | SETTING(std::string, freezeFrameKeybind, "freezeFrameKeybind", "C"); 12 | SETTING(std::string, stepFramesKeybind, "stepFramesKeybind", "V"); 13 | SETTING(std::string, dinputDllWrapper, "DinputDllWrapper", "none"); 14 | SETTING(int, renderwidth, "RenderingWidth", "1920"); 15 | SETTING(int, renderheight, "RenderingHeight", "1080"); 16 | SETTING(int, viewport, "Viewport", "1"); 17 | SETTING(int, antialiasing, "AntiAliasing", "-1"); 18 | SETTING(bool, vsync, "V-sync", "0"); 19 | SETTING(int, menusize, "MenuSize", "2"); 20 | SETTING(bool, notifications, "Notifications", "1"); 21 | SETTING(bool, checkupdates, "CheckUpdates", "1"); 22 | SETTING(bool, loadforeignpalettes, "LoadForeignPalettesToggleDefault", "1"); 23 | SETTING(int, uploadReplayData, "UploadReplayData", "-1"); 24 | SETTING(std::string, uploadReplayDataHost, "UploadReplayDataHost", "50.118.225.175"); 25 | SETTING(std::string, uploadReplayDataEndpoint, "UploadReplayDataEndpoint", "/upload"); 26 | SETTING(int, uploadReplayDataPort, "UploadReplayDataPort", "5000"); 27 | // SETTING(std::string, replayDatabaseFrontendUrl "ReplayDatabaseFrontendUrl", "http://50.118.225.175:2000/"); -------------------------------------------------------------------------------- /src/Core/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #define SAFE_RELEASE(x) if( x ) { (x)->Release(); (x) = NULL; } 6 | #define SAFE_DELETE(x) if( x ) { delete(x); (x) = NULL; } 7 | #define SAFE_DELETE_ARRAY(x) if( x ) { delete [] (x); (x) = NULL; } 8 | #define SHOWERROR(s,f,l) char buf[1024]; sprintf( buf, "File: %s\nLine: %d\n%s",f,l,s); MessageBox( 0, buf, "Error", 0 ); 9 | #define SHOWERROR_W(s,f,l) wchar_t buf[1024]; wsprintf(buf, L"File: %s\nLine: %d\n%s",f,l,s); MessageBox(0, buf, L"Error", 0); 10 | 11 | #define nameof(symbol) #symbol 12 | 13 | char* GetBbcfBaseAdress(); 14 | void WriteToProtectedMemory(uintptr_t addressToWrite, char* valueToWrite, int byteNum); 15 | char* RawMemoryArrayToString(unsigned char* srcBuf, int length); 16 | DWORD FindPattern(LPCWSTR module, char *pattern, char *mask); 17 | DWORD* GetInterfaceFuncPtr(DWORD* pDeviceInterface, const char *fmt, ...); 18 | bool Hook(void* toHook, void* ourFunc, int len); 19 | 20 | std::string FormatText(const char* message, ...); 21 | unsigned int rgb(double hue); 22 | DWORD QuickChecksum(DWORD *pData, int size); 23 | 24 | bool utils_WriteFile(const char* path, void* inBuffer, unsigned long bufferSize, bool binaryFile = false, bool append = false); 25 | bool utils_ReadFile(const char* path, void* outBuffer, unsigned long bufferSize, bool binaryFile = false); 26 | 27 | std::string utf16_to_utf8(const std::wstring & wstr); 28 | std::wstring utf8_to_utf16(const std::string & utf8_str); 29 | int SafeDereferencePtr(int* ptr); 30 | -------------------------------------------------------------------------------- /src/CustomGameMode/GameModeManager.cpp: -------------------------------------------------------------------------------- 1 | #include "GameModeManager.h" 2 | 3 | #include "Core/logger.h" 4 | #include "Hooks/HookManager.h" 5 | #include "Hooks/hooks_customGameModes.h" 6 | 7 | GameModeManager::GameModeManager() 8 | : m_gameModes(CreateGameModesVector()), m_activeGameMode(CustomGameMode_None) 9 | { 10 | } 11 | 12 | void GameModeManager::InitGameMode() 13 | { 14 | LOG(2, "InitGameMode\n"); 15 | 16 | ResetAllHooks(); 17 | m_gameModes[m_activeGameMode].init_func(); 18 | ActivateGameModeHooks(); 19 | } 20 | 21 | void GameModeManager::EndGameMode() 22 | { 23 | LOG(2, "EndGameMode\n"); 24 | 25 | m_activeGameMode = CustomGameMode_None; 26 | ResetAllHooks(); 27 | } 28 | 29 | void GameModeManager::SetActiveGameMode(CustomGameMode gameMode) 30 | { 31 | LOG(2, "SetActiveGameMode\n"); 32 | 33 | m_activeGameMode = gameMode; 34 | } 35 | 36 | CustomGameMode& GameModeManager::GetActiveGameModeRef() 37 | { 38 | return m_activeGameMode; 39 | } 40 | 41 | const CustomGameMode GameModeManager::GetActiveGameMode() const 42 | { 43 | return m_activeGameMode; 44 | } 45 | 46 | const std::string& GameModeManager::GetCurrentGameModeName() const 47 | { 48 | return m_gameModes[m_activeGameMode].name; 49 | } 50 | 51 | 52 | const std::string& GameModeManager::GetGameModeName(CustomGameMode gameMode) const 53 | { 54 | return m_gameModes[gameMode].name; 55 | } 56 | 57 | const std::string& GameModeManager::GetGameModeDesc(CustomGameMode gameMode) const 58 | { 59 | return m_gameModes[gameMode].desc; 60 | } 61 | 62 | int GameModeManager::GetGameModesCount() const 63 | { 64 | return m_gameModes.size(); 65 | } 66 | 67 | void GameModeManager::ActivateGameModeHooks() 68 | { 69 | for (const std::string& hookLabel : m_gameModes[m_activeGameMode].hook_labels) 70 | { 71 | HookManager::ActivateHook(hookLabel.c_str()); 72 | } 73 | } 74 | 75 | void GameModeManager::ResetAllHooks() 76 | { 77 | LOG(2, "ResetAllHooks\n"); 78 | 79 | for (const GameMode_t& gameMode : m_gameModes) 80 | { 81 | for (const std::string& hookLabel : gameMode.hook_labels) 82 | { 83 | HookManager::DeactivateHook(hookLabel.c_str()); 84 | } 85 | } 86 | 87 | // Change heat limits of 15000 back to 10000 88 | int result = HookManager::OverWriteBytes( 89 | (char*)steroid_HeatModifyJmpBackAddr, 90 | (char*)steroid_HeatModifyJmpBackAddr + 0x28, 91 | "\x98\x3A\x00\x00", 92 | "xxxx", 93 | "\x10\x27\x00\x00"); 94 | 95 | if (result) 96 | { 97 | LOG(2, "Original steroid_HeatModify has been reset, overwritten bytes: %d\n", result); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/CustomGameMode/GameModeManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "customGameMode.h" 3 | 4 | class GameModeManager 5 | { 6 | public: 7 | GameModeManager(); 8 | 9 | void InitGameMode(); 10 | void EndGameMode(); 11 | void SetActiveGameMode(CustomGameMode gameMode); 12 | 13 | CustomGameMode& GetActiveGameModeRef(); 14 | const CustomGameMode GameModeManager::GetActiveGameMode() const; 15 | const std::string& GetCurrentGameModeName() const; 16 | const std::string& GetGameModeName(CustomGameMode gameMode) const; 17 | const std::string& GetGameModeDesc(CustomGameMode gameMode) const; 18 | int GetGameModesCount() const; 19 | 20 | private: 21 | void ActivateGameModeHooks(); 22 | void ResetAllHooks(); 23 | 24 | std::vector m_gameModes; 25 | CustomGameMode m_activeGameMode; 26 | }; -------------------------------------------------------------------------------- /src/CustomGameMode/customGameMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | extern float steroid_hp_multiplier; 7 | extern float steroid_overdriveChargeMultiplier; 8 | extern int steroid_maximumHeat; 9 | extern float steroid_heatModifyMultiplier; 10 | extern float steroid_heatLowHPChargeMultiplier; 11 | extern float vampire_healing_percent; 12 | extern float vampire_health_loss_percent_per_sec; 13 | extern float exVampire_healing_percent; 14 | extern float exVampire_health_loss_percent_per_sec; 15 | 16 | enum CustomGameMode 17 | { 18 | CustomGameMode_None, 19 | CustomGameMode_Steroid, 20 | CustomGameMode_Vampire, 21 | CustomGameMode_ExVampire, 22 | CustomGameMode_OnePunch, 23 | CustomGameMode_TwoPunch, 24 | CustomGameMode_FivePunch, 25 | CustomGameMode_TugOfWar, 26 | CustomGameMode_InfiniteHeat 27 | }; 28 | 29 | struct GameMode_t 30 | { 31 | std::string name; 32 | int id; 33 | std::string desc; 34 | void (*init_func)(); 35 | std::vector hook_labels; 36 | }; 37 | 38 | std::vector CreateGameModesVector(); 39 | -------------------------------------------------------------------------------- /src/D3D9EXWrapper/D3DXMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void hookD3DMaths(); -------------------------------------------------------------------------------- /src/D3D9EXWrapper/ID3D9EXWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "d3d9.h" 4 | 5 | interface Direct3D9ExWrapper : public IDirect3D9Ex 6 | { 7 | public: 8 | 9 | Direct3D9ExWrapper(IDirect3D9Ex **ppIDirect3D9Ex); 10 | virtual ~Direct3D9ExWrapper(); 11 | 12 | IDirect3D9Ex* Direct3D9Ex; 13 | 14 | // original interface 15 | STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj); 16 | STDMETHOD_(ULONG, AddRef)(); 17 | STDMETHOD_(ULONG, Release)(); 18 | 19 | STDMETHOD(RegisterSoftwareDevice)(void* pInitializeFunction); 20 | STDMETHOD_(UINT, GetAdapterCount)(); 21 | STDMETHOD(GetAdapterIdentifier)( UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier); 22 | STDMETHOD_(UINT, GetAdapterModeCount)( UINT Adapter, D3DFORMAT Format); 23 | STDMETHOD(EnumAdapterModes)( UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode); 24 | STDMETHOD(GetAdapterDisplayMode)( UINT Adapter, D3DDISPLAYMODE* pMode); 25 | STDMETHOD(CheckDeviceType)( UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed); 26 | STDMETHOD(CheckDeviceFormat)( UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat); 27 | STDMETHOD(CheckDeviceMultiSampleType)( UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels); 28 | STDMETHOD(CheckDepthStencilMatch)( UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat); 29 | STDMETHOD(CheckDeviceFormatConversion)( UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat); 30 | STDMETHOD(GetDeviceCaps)( UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps); 31 | STDMETHOD_(HMONITOR, GetAdapterMonitor)( UINT Adapter); 32 | STDMETHOD(CreateDevice)( UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); 33 | STDMETHOD_(UINT, GetAdapterModeCountEx)( UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter); 34 | STDMETHOD(EnumAdapterModesEx)( UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode); 35 | STDMETHOD(GetAdapterDisplayModeEx)( UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation); 36 | STDMETHOD(CreateDeviceEx)( UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface); 37 | STDMETHOD(GetAdapterLUID)( UINT Adapter, LUID * pLUID); 38 | }; -------------------------------------------------------------------------------- /src/D3D9EXWrapper/ID3D9Wrapper_Sprite.cpp: -------------------------------------------------------------------------------- 1 | #include "ID3D9Wrapper_Sprite.h" 2 | 3 | #include "Core/logger.h" 4 | 5 | ID3DXSpriteWrapper::ID3DXSpriteWrapper(LPD3DXSPRITE** ppSprite) 6 | { 7 | m_D3DXSprite = **ppSprite; 8 | **ppSprite = this; 9 | LOG(7, "ID3DXSpriteWrapper Created: (0x%p)\n", ppSprite); 10 | } 11 | 12 | // IUnknown 13 | HRESULT ID3DXSpriteWrapper::QueryInterface(REFIID iid, LPVOID *ppv) 14 | { 15 | LOG(7, "Sprite QueryInterface\n"); 16 | return m_D3DXSprite->QueryInterface(iid, ppv); 17 | } 18 | 19 | ULONG ID3DXSpriteWrapper::AddRef() 20 | { 21 | LOG(7, "Sprite AddRef\n"); 22 | return m_D3DXSprite->AddRef(); 23 | } 24 | 25 | ULONG ID3DXSpriteWrapper::Release() 26 | { 27 | LOG(7, "Sprite Release\n"); 28 | return m_D3DXSprite->Release(); 29 | } 30 | 31 | // ID3DXSprite 32 | HRESULT ID3DXSpriteWrapper::GetDevice(LPDIRECT3DDEVICE9* ppDevice) 33 | { 34 | LOG(7, "Sprite GetDevice\n"); 35 | return m_D3DXSprite->GetDevice(ppDevice); 36 | } 37 | 38 | HRESULT ID3DXSpriteWrapper::GetTransform(D3DXMATRIX *pTransform) 39 | { 40 | LOG(7, "Sprite GetTransform\n"); 41 | return m_D3DXSprite->GetTransform(pTransform); 42 | } 43 | 44 | HRESULT ID3DXSpriteWrapper::SetTransform(CONST D3DXMATRIX *pTransform) 45 | { 46 | LOG(7, "Sprite SetTransform\n"); 47 | return m_D3DXSprite->SetTransform(pTransform); 48 | } 49 | 50 | HRESULT ID3DXSpriteWrapper::SetWorldViewRH(CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) 51 | { 52 | LOG(7, "Sprite SetWorldViewRH\n"); 53 | return m_D3DXSprite->SetWorldViewRH(pWorld, pView); 54 | } 55 | 56 | HRESULT ID3DXSpriteWrapper::SetWorldViewLH(CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) 57 | { 58 | LOG(7, "Sprite SetWorldViewLH\n"); 59 | return m_D3DXSprite->SetWorldViewLH(pWorld, pView); 60 | } 61 | 62 | HRESULT ID3DXSpriteWrapper::Begin(DWORD Flags) 63 | { 64 | LOG(7, "Sprite Begin\n"); 65 | return m_D3DXSprite->Begin(Flags); 66 | } 67 | 68 | HRESULT ID3DXSpriteWrapper::Draw(LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) 69 | { 70 | LOG(7, "Sprite Draw (pos:) %.2f %.2f %.2f (pcent:) %.2f %.2f\n", pPosition->x, pPosition->y, pPosition->z, pCenter->x, pCenter->y); 71 | 72 | if (!Settings::savedSettings.isDuelFieldSprite && Settings::settingsIni.viewport != 1) 73 | { 74 | D3DXVECTOR2 scale(Settings::savedSettings.newViewport.Width / Settings::savedSettings.origViewportRes.x, 75 | Settings::savedSettings.newViewport.Height / Settings::savedSettings.origViewportRes.y); // 1280/1920=0.66667 76 | D3DXVECTOR2 center(pCenter->x, pCenter->y); 77 | //D3DXVECTOR2 scalecenter(pPosition->x, pPosition->y); 78 | D3DXMATRIX m_transform; 79 | D3DXMatrixTransformation2D(&m_transform, NULL, 0.0f, &scale, ¢er, 0.0f, NULL); 80 | m_D3DXSprite->SetTransform(&m_transform); 81 | } 82 | return m_D3DXSprite->Draw(pTexture, pSrcRect, pCenter, pPosition, Color); 83 | } 84 | 85 | HRESULT ID3DXSpriteWrapper::Flush() 86 | { 87 | LOG(7, "Sprite Flush\n"); 88 | return m_D3DXSprite->Flush(); 89 | } 90 | 91 | HRESULT ID3DXSpriteWrapper::End() 92 | { 93 | LOG(7, "Sprite End\n"); 94 | return m_D3DXSprite->End(); 95 | } 96 | 97 | HRESULT ID3DXSpriteWrapper::OnLostDevice() 98 | { 99 | LOG(7, "Sprite OnLostDevice\n"); 100 | return m_D3DXSprite->OnLostDevice(); 101 | } 102 | HRESULT ID3DXSpriteWrapper::OnResetDevice() 103 | { 104 | LOG(7, "Sprite OnResetDevice\n"); 105 | return m_D3DXSprite->OnResetDevice(); 106 | } -------------------------------------------------------------------------------- /src/D3D9EXWrapper/ID3D9Wrapper_Sprite.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "d3d9.h" 3 | 4 | interface ID3DXSpriteWrapper : public ID3DXSprite 5 | { 6 | public: 7 | ID3DXSpriteWrapper(LPD3DXSPRITE** ppSprite); 8 | ID3DXSprite* m_D3DXSprite; 9 | 10 | // IUnknown 11 | STDMETHOD(QueryInterface)( REFIID iid, LPVOID *ppv) ; 12 | STDMETHOD_(ULONG, AddRef)(); 13 | STDMETHOD_(ULONG, Release)(); 14 | 15 | // ID3DXSprite 16 | STDMETHOD(GetDevice)( LPDIRECT3DDEVICE9* ppDevice) ; 17 | 18 | STDMETHOD(GetTransform)( D3DXMATRIX *pTransform) ; 19 | STDMETHOD(SetTransform)( CONST D3DXMATRIX *pTransform) ; 20 | 21 | STDMETHOD(SetWorldViewRH)( CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) ; 22 | STDMETHOD(SetWorldViewLH)( CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) ; 23 | 24 | STDMETHOD(Begin)( DWORD Flags) ; 25 | STDMETHOD(Draw)( LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) ; 26 | STDMETHOD(Flush)(); 27 | STDMETHOD(End)(); 28 | 29 | STDMETHOD(OnLostDevice)(); 30 | STDMETHOD(OnResetDevice)(); 31 | }; -------------------------------------------------------------------------------- /src/D3D9EXWrapper/d3d9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma comment(lib,"d3d9.lib") 4 | #pragma comment(lib,"d3dx9.lib") 5 | #include 6 | #include -------------------------------------------------------------------------------- /src/Game/Jonb/JonbDBEntry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | enum BoxEntry_ 6 | { 7 | BoxEntryType_Hurtbox, 8 | BoxEntryType_Hitbox 9 | }; 10 | 11 | class BoxEntry 12 | { 13 | public: 14 | BoxEntry_ type; 15 | float offsetX; 16 | float offsetY; 17 | float width; 18 | float height; 19 | }; 20 | 21 | class JonbDBEntry { 22 | public: 23 | char JONB[4]; //just JONB literal string + 2 bytes 24 | uint16_t number_of_sprite_names; //the amount of sprite names, each sprite name is char[32] 25 | //char sprite_name[32]; //for ex ar000_02.bmp //std::vector 26 | std::vector sprite_names; 27 | //char pad_0[6]; 28 | //uint8_t pad_2; 29 | uint8_t hurtbox_count;//uint8_t 30 | //uint8_t pad_3; 31 | uint8_t hitbox_count;//uint8_t 32 | //char pad_1[0xa3]; 33 | //BoxEntry* all_boxes; //I should implement later, leave it for now for it is not necessary, can check hitbox/hurtbox count for current purpose 34 | JonbDBEntry() {} 35 | JonbDBEntry(char* addr){ 36 | char offset = 0; 37 | memcpy(JONB, addr, 4); 38 | offset += 4; 39 | memcpy(&number_of_sprite_names, (addr + offset), 2); 40 | offset += 2; 41 | for (int i = 0; i < number_of_sprite_names; i++) { 42 | std::string sprite_name = (char*)(addr + offset); 43 | sprite_names.push_back(sprite_name); 44 | offset += 32; 45 | if (i > 10) { 46 | hurtbox_count = 0; 47 | hitbox_count = 0; 48 | return; 49 | } 50 | } 51 | offset += 6; 52 | offset += 1; 53 | memcpy(&hurtbox_count, (uint8_t*)(addr + offset),1); 54 | offset += 1; 55 | offset += 1; 56 | memcpy(&hitbox_count, (uint8_t*)(addr + offset), 1); 57 | offset += 1; 58 | ///this is where all the other offsets would come in to get the other things 59 | } 60 | }; 61 | 62 | class JonbDBIndexHeader { 63 | public: 64 | char FPAC[4]; //just FPAC literal string 65 | uint32_t offset_to_first_full_entry; 66 | char pad_0[24]; 67 | }; 68 | class JonbDBIndexEntry { 69 | public: 70 | char jonbin_name[20]; //for ex ae030_08ex00.jonbin 71 | char pad_1[12]; 72 | uint32_t offset_from_first_full_entry2; //some characters use the offset from this, others from the one after, idk what causes it to happen 73 | uint32_t offset_from_first_full_entry1; //see comment above 74 | char pad_2[8]; 75 | }; 76 | class JonbDBIndexEntryJubei { 77 | public: 78 | // you need to specify if it is jubei or not because for some reason his jonb index is spaced differently 79 | char jonbin_name[24]; //for ex ae030_08ex00.jonbin 80 | char pad_1[16]; 81 | uint32_t offset_from_first_full_entry2; //some characters use the offset from this, others from the one after, idk what causes it to happen 82 | uint32_t offset_from_first_full_entry1; //see comment above 83 | char pad_2[16]; 84 | }; 85 | -------------------------------------------------------------------------------- /src/Game/Jonb/JonbDBReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "JonbDBEntry.h" 5 | class JonbDBReader 6 | { 7 | public: 8 | std::map parse_all_jonbins(char* bbcf_base_addr, int player_num); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /src/Game/Jonb/JonbEntry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum JonbEntryType_ 4 | { 5 | JonbChunkType_Hurtbox, 6 | JonbChunkType_Hitbox 7 | }; 8 | 9 | class JonbEntry 10 | { 11 | public: 12 | JonbEntryType_ type; 13 | float offsetX; 14 | float offsetY; 15 | float width; 16 | float height; 17 | }; -------------------------------------------------------------------------------- /src/Game/Jonb/JonbReader.cpp: -------------------------------------------------------------------------------- 1 | #include "JonbReader.h" 2 | 3 | std::vector JonbReader::getJonbEntries(const CharData * charObj) 4 | { 5 | std::vector jonbEntries; 6 | 7 | const int entriesCount = charObj->hurtboxCount + charObj->hitboxCount; 8 | JonbEntry* pEntry = charObj->pJonbEntryBegin; 9 | 10 | for (int i = 0; i < entriesCount; i++) 11 | { 12 | jonbEntries.push_back(*pEntry); 13 | pEntry++; 14 | } 15 | 16 | return jonbEntries; 17 | } 18 | -------------------------------------------------------------------------------- /src/Game/Jonb/JonbReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../CharData.h" 3 | #include "JonbEntry.h" 4 | 5 | #include 6 | 7 | class JonbReader 8 | { 9 | public: 10 | static std::vector getJonbEntries(const CharData* charObj); 11 | }; 12 | -------------------------------------------------------------------------------- /src/Game/MatchState.cpp: -------------------------------------------------------------------------------- 1 | #include "MatchState.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Core/logger.h" 5 | #include "Overlay/Window/PaletteEditorWindow.h" 6 | #include "Overlay/WindowContainer/WindowType.h" 7 | #include "Overlay/WindowManager.h" 8 | 9 | void MatchState::OnMatchInit() 10 | { 11 | if (!WindowManager::GetInstance().IsInitialized()) 12 | { 13 | return; 14 | } 15 | 16 | LOG(2, "MatchState::OnMatchInit\n"); 17 | 18 | g_interfaces.pPaletteManager->LoadPaletteSettingsFile(); 19 | g_interfaces.pPaletteManager->OnMatchInit(g_interfaces.player1, g_interfaces.player2); 20 | 21 | if (g_interfaces.pRoomManager->IsRoomFunctional()) 22 | { 23 | // Prevent loading palettes.ini custom palette on opponent 24 | 25 | uint16_t thisPlayerMatchPlayerIndex = g_interfaces.pRoomManager->GetThisPlayerMatchPlayerIndex(); 26 | 27 | if (thisPlayerMatchPlayerIndex != 0) 28 | { 29 | g_interfaces.pPaletteManager->RestoreOrigPal(g_interfaces.player1.GetPalHandle()); 30 | } 31 | 32 | if (thisPlayerMatchPlayerIndex != 1) 33 | { 34 | g_interfaces.pPaletteManager->RestoreOrigPal(g_interfaces.player2.GetPalHandle()); 35 | } 36 | 37 | // Send our custom palette and load opponent's 38 | g_interfaces.pOnlinePaletteManager->OnMatchInit(); 39 | 40 | // Activate settled game mode 41 | g_interfaces.pOnlineGameModeManager->OnMatchInit(); 42 | 43 | // Add players to steam's "recent games" list 44 | for (const RoomMemberEntry* player : g_interfaces.pRoomManager->GetOtherRoomMemberEntriesInCurrentMatch()) 45 | { 46 | g_interfaces.pSteamFriendsWrapper->SetPlayedWith(CSteamID(player->steamId)); 47 | } 48 | 49 | // Send the broadcast to other players regarding telling if you have replay upload disabled or not. 50 | g_interfaces.pReplayUploadManager->OnMatchInit(); 51 | 52 | 53 | } 54 | 55 | g_gameVals.isFrameFrozen = false; 56 | 57 | WindowManager::GetInstance().GetWindowContainer()->GetWindow(WindowType_PaletteEditor)->OnMatchInit(); 58 | } 59 | 60 | void MatchState::OnMatchRematch() 61 | { 62 | LOG(2, "MatchState::OnMatchRematch\n"); 63 | 64 | g_interfaces.pPaletteManager->OnMatchRematch( 65 | g_interfaces.player1, 66 | g_interfaces.player2 67 | ); 68 | 69 | g_interfaces.pOnlinePaletteManager->ClearSavedPalettePacketQueues(); 70 | } 71 | 72 | void MatchState::OnMatchEnd() 73 | { 74 | LOG(2, "MatchState::OnMatchEnd\n"); 75 | 76 | g_interfaces.pGameModeManager->EndGameMode(); 77 | 78 | g_interfaces.pPaletteManager->OnMatchEnd( 79 | g_interfaces.player1.GetPalHandle(), 80 | g_interfaces.player2.GetPalHandle() 81 | ); 82 | 83 | g_interfaces.pOnlinePaletteManager->ClearSavedPalettePacketQueues(); 84 | g_interfaces.pOnlineGameModeManager->ClearPlayerGameModeChoices(); 85 | 86 | //resets the upload veto 87 | g_interfaces.pReplayUploadManager->OnMatchEnd(); 88 | 89 | } 90 | 91 | void MatchState::OnUpdate() 92 | { 93 | LOG(7, "MatchState::OnUpdate\n"); 94 | 95 | g_interfaces.pPaletteManager->OnUpdate( 96 | g_interfaces.player1.GetPalHandle(), 97 | g_interfaces.player2.GetPalHandle() 98 | ); 99 | } -------------------------------------------------------------------------------- /src/Game/MatchState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace MatchState 4 | { 5 | void OnMatchInit(); 6 | void OnMatchRematch(); 7 | void OnMatchEnd(); 8 | void OnUpdate(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Game/Menus/TrainingSetupMenu.cpp: -------------------------------------------------------------------------------- 1 | #include "TrainingSetupMenu.h" 2 | -------------------------------------------------------------------------------- /src/Game/Menus/TrainingSetupMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | /*the base of the struct here to is the base of the fourth page of the menu, it most certainly starts before but 4 | I havent got the time to map it yet, so this is why i'm not listing the offsets as of now*/ 5 | class TrainingSetupMenu 6 | { 7 | public: 8 | //HUD settings 9 | int32_t display_virtual_stick; //BBCF.exe+0x902BDC 10 | int32_t virtual_stick_type; 11 | int32_t display_input_history; 12 | int32_t damage_display; 13 | int32_t ukemi_display_window; 14 | int32_t display_dummy_info; ////BBCF.exe+0x902BDC + 0x18 15 | char padding1[24]; 16 | //Training Dummy Settings 17 | int32_t enemy_stance; //BBCF.exe + 0x902BDC + 0x30 18 | int32_t blocking; 19 | int32_t block_switching; 20 | int32_t block_type; 21 | int32_t aerial_roll; 22 | int32_t emergency_roll; 23 | int32_t wake_up; 24 | int32_t throw_escape; 25 | int32_t stagger_recovery; //BBCF.exe + 0x902BDC + 0x30 + 0x20 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /src/Game/Playbacks/PlaybackManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "PlaybackSlot.h" 4 | #include 5 | class PlaybackManager 6 | { 7 | public: 8 | 9 | 10 | PlaybackManager(); 11 | char* bbcf_base_adress; // pointer to the base adress of bbcf 12 | char* playback_control_p; //bbcf_base_adress + 0x1392d10 + 0x1ac2c; set to 3 to start playback without direction adjustment, 0 for dummy, 1 for recording standby, 2 for bugged recording, 3 for playback, 4 for controller, 5 for cpu, 6 for continuous playback 13 | char* active_slot_p; // the active slot 14 | std::vector slots; //one for each of the 4 playback slots 15 | 16 | 17 | void save_to_file(std::vector slot_buffer, char facing_direction, char* fname); 18 | std::vector load_from_file(char* fname);/*returns the contents of the file*/ 19 | std::vector trim_playback(std::vector slot_buffer); 20 | void load_into_slot(std::vector trimmed_playback, int slot); /*this is the "load_trimmed_playback" function back in ScrWindow.cpp, loads from a buffer into a slot, this assumes the direction byte is already taken care of in caso of the buffer coming from a file*/ 21 | void load_into_slot(std::vector trimmed_playback, int facing_left, int slot); /*this is the "load_trimmed_playback" function back in ScrWindow.cpp, loads from a buffer into a slot, this assumes the direction byte is already taken care of in caso of the buffer coming from a file*/ 22 | 23 | void load_from_file_into_slot(char* fname, int slot); /*loads from a file into a slot doing the necessary checks to ensure the file is valid, the facing byte is correctly set and won't crash*/ 24 | void set_active_slot(int slot); 25 | void set_playback_control(int playback_control); /*set to 3 to start playback without direction adjustment, 0 for dummy, 1 for recording standby, 2 for bugged recording, 3 for playback, 4 for controller, 5 for cpu, 6 for continuous playback*/ 26 | void set_playback_position(int frame_position); 27 | void set_playback_type(int playback_type); 28 | 29 | private: 30 | int playback_control_offset = 0x1392d10 + 0x1ac2c;// playback_control_p = bbcf_base_adress + playback_control_offset 31 | int active_slot_offset = 0x902C3C; //active_slot_p = bbcf_base_adress + active_slot_offset 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /src/Game/Playbacks/PlaybackSlot.cpp: -------------------------------------------------------------------------------- 1 | #include "PlaybackSlot.h" 2 | #include "Core/utils.h" 3 | PlaybackSlot::PlaybackSlot(int slot) 4 | { 5 | this->bbcf_base_adress = GetBbcfBaseAdress(); 6 | initialize_frame_len_slot(slot); 7 | initialize_facing_direction_slot(slot); 8 | initialize_start_of_slot_inputs_p(slot); 9 | } 10 | 11 | int PlaybackSlot::initialize_frame_len_slot(int slot) 12 | { 13 | //initializes the frame_len_slot for the specified slot 14 | int time_count_slot_addr_offset = this->time_count_slot_1_addr_offset + ((slot - 1) * 4); 15 | this->frame_len_slot_p = this->bbcf_base_adress + time_count_slot_addr_offset; 16 | int frame_len_slot; 17 | memcpy(&frame_len_slot, this->frame_len_slot_p, 4); 18 | return frame_len_slot; 19 | } 20 | 21 | int PlaybackSlot::initialize_facing_direction_slot(int slot) 22 | { 23 | /*initializes the facing_direction for the specified slot*/ 24 | this->facing_direction_p = this->bbcf_base_adress + facing_direction_slot_1_addr_offset + ((slot -1 ) * 4); 25 | int facing_direction; 26 | memcpy(&facing_direction, facing_direction_p, 4); 27 | return facing_direction; 28 | } 29 | 30 | char* PlaybackSlot::initialize_start_of_slot_inputs_p(int slot) 31 | { 32 | /*initializes the start_of_slot_inputs_p for the specified slot*/ 33 | this->start_of_slot_inputs_p = this->frame_len_slot_p+ this->start_of_slot_inputs_addr_offset_from_time_count[slot - 1]; 34 | return this->start_of_slot_inputs_p; 35 | } 36 | 37 | void PlaybackSlot::load_into_slot(std::vector trimmed_playback) { 38 | int frame_len_loaded_file = trimmed_playback.size(); 39 | memcpy(this->frame_len_slot_p, &(frame_len_loaded_file), 4); 40 | int iter = 0; 41 | for (auto input : trimmed_playback) { 42 | memcpy(this->start_of_slot_inputs_p + (iter * 2), &input, 1); //sets the move 43 | memset(this->start_of_slot_inputs_p + (iter * 2)+1,0x0 , 1); //zeroes the taunt(?) flag. The next step is to change all the shit regarding playback from chars to uint16, so that the extra byte for taunt(?) is included and not just zeroed 44 | iter++; 45 | } 46 | } 47 | std::vector PlaybackSlot::get_slot_buffer() { 48 | std::vector slot1_recording_frames{}; 49 | int frame_len_slot; 50 | memcpy(&frame_len_slot, this->frame_len_slot_p, 4); // probably unnecessary, but dont have the time to test rn so i'll copy what i had before 51 | for (int i = 0; i < frame_len_slot; i++) { 52 | slot1_recording_frames.push_back(*(this->start_of_slot_inputs_p + i * 2)); 53 | } 54 | return slot1_recording_frames; 55 | } 56 | 57 | char PlaybackSlot::get_facing_direction() 58 | { 59 | return *(this->facing_direction_p); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/Game/Playbacks/PlaybackSlot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class PlaybackSlot 5 | { 6 | public: 7 | PlaybackSlot(int slot); 8 | int initialize_frame_len_slot(int slot);/*initializes the frame_len_slot for the specified slot*/ 9 | int initialize_facing_direction_slot(int slot); /*initializes the facing_direction for the specified slot*/ 10 | char* initialize_start_of_slot_inputs_p(int slot); /*initializes the start_of_slot_inputs_p for the specified slot*/ 11 | void load_into_slot(std::vector trimmed_playback); //this is the "load_trimmed_playback" function back in ScrWindow.cpp 12 | 13 | std::vector get_slot_buffer(); 14 | char get_facing_direction(); 15 | 16 | 17 | 18 | 19 | private: 20 | char* bbcf_base_adress; // pointer to the base adress of bbcf 21 | 22 | 23 | int time_count_slot_1_addr_offset = 0x9075E8; // offset for playback duration per slot, 4 bytes per slot in order, probably shouldn't hardcode this and just do an offset from slot 1 base 24 | int time_count_slot_2_addr_offset = 0x9075EC; 25 | int time_count_slot_3_addr_offset = 0x9075F0; 26 | int time_count_slot_4_addr_offset = 0x9075F4; 27 | public: 28 | //frame_len_slot_p = bbcf_base_adress + time_count_slot_*_addr_offset; 29 | char* frame_len_slot_p; //adress holding length of playback on a specific slot, must be recalculated for every different slot 30 | private: 31 | 32 | int facing_direction_slot_1_addr_offset = 0x9075D8; // offset for facing direction per slot, 4 bytes per slot in order, probably shouldn't hardcode this and just do an offset from slot 1 base 33 | int facing_direction_slot_2_addr_offset = 0x9075DC; 34 | int facing_direction_slot_3_addr_offset = 0x9075E0; 35 | int facing_direction_slot_4_addr_offset = 0x9075E4; 36 | public: 37 | //facing_direction_p = bbcf_base_adress + facing_direction_slot_*_addr_offset; 38 | char* facing_direction_p; //adress holding the facing direction of playback on a specific slot, must be recalculated for every different slot 39 | 40 | private: 41 | std::vector start_of_slot_inputs_addr_offset_from_time_count = { 42 | 0x10, //slot 1 43 | 0x960 + 0xC, //slot 2 44 | (0x960 * 2) + 0x8, //slot 3 45 | (0x960 * 3) + 0x4 //slot 4 46 | };//offset to find start_of_slot_inputs_p from base_adress + time_count_slot_*_addr_offset 47 | public: 48 | /* start_of_slot_inputs_p = bbcf_base_adress + time_count_slot_ * _addr_offset + start_of_slot_inputs_slot_ * _addr_offset_from_time_count 49 | which is equialent to 50 | start_of_slot_inputs_p = frame_len_slot_p + start_of_slot_inputs_slot_ * _addr_offset_from_time_count */ 51 | char* start_of_slot_inputs_p; /*adress holding the starting position of playback data on a specific slot, must be recalculated for every different slot*/ 52 | 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /src/Game/Player.cpp: -------------------------------------------------------------------------------- 1 | #include "Player.h" 2 | 3 | void Player::SetCharDataPtr(const void* addr) 4 | { 5 | m_charData = (CharData**)addr; 6 | } 7 | void Player::SetScrStates(std::vector states) { 8 | this->states = states; 9 | } 10 | bool Player::IsCharDataNullPtr() const 11 | { 12 | if (m_charData == 0) 13 | return true; 14 | 15 | return *m_charData == 0; 16 | } 17 | 18 | CharData* Player::GetData() const 19 | { 20 | return *m_charData; 21 | } 22 | 23 | CharPaletteHandle& Player::GetPalHandle() 24 | { 25 | return m_charPalHandle; 26 | } 27 | -------------------------------------------------------------------------------- /src/Game/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CharData.h" 3 | #include "Scr/ScrStateEntry.h" 4 | #include 5 | #include "Palette/CharPaletteHandle.h" 6 | 7 | class Player 8 | { 9 | public: 10 | CharData* GetData() const; 11 | CharPaletteHandle& GetPalHandle(); 12 | std::vector states{}; 13 | 14 | 15 | void SetCharDataPtr(const void* addr); 16 | void SetScrStates(std::vector); 17 | bool IsCharDataNullPtr() const; 18 | 19 | 20 | private: 21 | CharData** m_charData; 22 | CharPaletteHandle m_charPalHandle; 23 | }; 24 | -------------------------------------------------------------------------------- /src/Game/ReplayFiles/ReplayFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #pragma pack(push, 1) 4 | class ReplayFile 5 | { 6 | public: 7 | //Will ALWAYS be 64 kib 8 | //metadata 9 | char pad_0000[0x08]; //0x00 10 | char pad_0008[0x08]; //0x08 - header from here to before inputs matches data in replay_list.dat (size 0x390) 11 | uint32_t valid; // 0x10 - always 1. empty items in replay list have this set to 0 12 | char pad_0014[0x0c]; //0x14 13 | uint32_t date1_int[6]; // 0x20 - year, month, day, hour, minute, second 14 | char date1[0x18]; //0x38 15 | char pad_0050[0x10]; //0x50 16 | uint32_t date2_int[6]; // 0x60 - year, month, day, hour, minute, second 17 | char date2[0x18]; //0x78 18 | char pad_0090[0x8]; //0x90 19 | uint32_t winner_maybe; //0x98 20 | uint64_t p1_steamID64; //0x9C 21 | wchar_t p1_name[0x12]; //0xA4 its in utf-16 22 | char pad_0xc8[0x9E]; //0xc8 23 | uint64_t p2_steamID64; //0x166 24 | wchar_t p2_name[0x12]; //0x16E its in utf-16 25 | char pad_192[0x9e]; //0x192 26 | uint32_t p1_toon; //0x230 27 | uint32_t p2_toon; //0x234 28 | uint64_t recorder_steamID64; //0x238 29 | wchar_t recorder_name[0x12]; //0x240 30 | char pad_264[0x314 - 0x264];// 0x264 31 | uint32_t p1_lvl; //0x314 - p1 ranked level (minus one) 32 | uint32_t p2_lvl; //0x318 33 | char pad_31c[0x8D0 - 0x31c]; 34 | //replay_inputs 35 | /* Here you have one frame represented every 4 bytes, 2 bytes for each player. 36 | 0x00000100 signals end of round. 37 | You will always have 10(?) of these "separators" in this section section regardless of 38 | how many round actually elapsed in the game.*/ 39 | char replay_inputs[0xF730]; //0x8D0 40 | }; 41 | #pragma pack(pop) -------------------------------------------------------------------------------- /src/Game/ReplayFiles/ReplayFileManager.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | #include 4 | #include "ReplayFile.h" 5 | #include 6 | #include 7 | #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 8 | #define REPLAY_FILE_SIZE 65536 9 | #define REPLAY_FOLDER_PATH "./Save/Replay/" 10 | #define REPLAY_ARCHIVE_FOLDER_PATH "./Save/Replay/archive/" 11 | class ReplayFileManager { 12 | public: 13 | ReplayFile replay_file; 14 | bool isLoaded = false; 15 | ReplayFileManager(); 16 | ReplayFileManager(std::string file_path); 17 | bool save_replay(std::string file_path); // return 1 means save sucessful, return -1 means error 18 | bool load_replay(std::string file_path); // return 1 means load sucessful, return -1 means error 19 | std::string build_file_name(); 20 | void archive_replays(); 21 | 22 | bool template_modified = false; 23 | 24 | void bbcf_sort_replay_list(); 25 | void load_replay_list_default(); 26 | void load_replay_list_default_repair(); 27 | void load_replay_list_from_archive(int page); 28 | void load_replay_list_from_db(int page, int character = -1, std::string player = ""); 29 | }; 30 | 31 | extern ReplayFileManager g_rep_manager; -------------------------------------------------------------------------------- /src/Game/ReplayFiles/ReplayList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "ReplayFile.h" 4 | #pragma pack(push, 1) 5 | 6 | struct ReplayFileHeader 7 | { 8 | char pad[0x390]; 9 | 10 | inline ReplayFile* data() { 11 | // items in replay_list.dat are initial parts of replay files in the list, without the first 8 bytes 12 | return (ReplayFile*)((char*)this - 8); 13 | } 14 | }; 15 | 16 | 17 | // at base + 0xAA9808 18 | class ReplayList 19 | { 20 | public: 21 | char pad_0000[0x08]; // 0x00000 22 | ReplayFileHeader replays[100]; // 0x00008 23 | uint32_t order[100]; // 0x16448 24 | uint32_t count; // 0x165d8 25 | }; 26 | 27 | #pragma pack(pop) -------------------------------------------------------------------------------- /src/Game/ReplayStates/FrameState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Core/interfaces.h" 3 | #include "Core/Settings.h" 4 | #include "Core/utils.h" 5 | #include "Game/gamestates.h" 6 | #include "Game/EntityData.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | struct ChildEntity { 13 | uint8_t offset_ownerEntity; 14 | uint8_t offset_pEntityList; 15 | CharData entity; 16 | }; 17 | class FrameState { 18 | public: 19 | CharData p1; 20 | CharData p2; 21 | //std::map ownedEntites; 22 | //std::shared_ptr> full_entity_list; 23 | std::shared_ptr> full_entity_map; 24 | std::array secondary_entity_pointers_list; 25 | //std::vector savedpEntityList; 26 | 27 | unsigned int frameCount; 28 | unsigned int matchTimer; 29 | 30 | 31 | std::array camPos; 32 | std::array camTarget; 33 | std::array camUpVector; 34 | D3DXMATRIX viewMatrix; 35 | std::array cam_mystery_vals0; //bbcf.exe+e3aa38 to bbcf.exe + e3aa44 36 | std::array cam_mystery_vals1; //bbcf.exe+e3aa84 to bbcf.exe + e3aa9C 37 | std::array cam_mystery_vals2;//bbcf.exe + e3aac0 to bbcf.exe + e3aaf4 38 | 39 | 40 | FrameState(); 41 | std::map save_owned_entities(); 42 | 43 | void load_frame_state(bool round_start); 44 | 45 | static std::array, 3> get_camera_vals(); 46 | 47 | static std::array get_camera_mystery_vals0(); 48 | 49 | static std::array get_camera_mystery_vals1(); 50 | 51 | static std::array get_camera_mystery_vals2(); 52 | 53 | }; -------------------------------------------------------------------------------- /src/Game/Room/Room.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "RoomMemberEntry.h" 3 | 4 | #include 5 | 6 | enum RoomStatus 7 | { 8 | RoomStatus_Unavailable, 9 | RoomStatus_Initializing, 10 | RoomStatus_Functional, 11 | RoomStatus_Terminating 12 | }; 13 | 14 | // Seems like a bitfield 15 | enum RoomType : uint8_t 16 | { 17 | RoomType_Ranked = 0x10, 18 | RoomType_MatchSpectate = 0x11, 19 | RoomType_Lobby = 0x12, 20 | RoomType_FFA = 0x21, 21 | RoomType_Training = 0x31, 22 | RoomType_Replay = 0x41 23 | }; 24 | enum RoomRematch : uint8_t { 25 | 26 | RematchType_Disabled = 0x0, 27 | RematchType_Unlimited = 0x10, 28 | RematchType_Ft2 = 0x20, 29 | RematchType_Ft3 = 0x30, 30 | RematchType_Ft5 = 0x50, 31 | RematchType_Ft10 = 0xA0, 32 | }; 33 | 34 | class Room 35 | { 36 | public: 37 | RoomStatus roomStatus; //0x0000 38 | uint8_t capacity; //0x0004 39 | uint8_t invitation; //0x0005 40 | uint8_t N000090AF; //0x0006 41 | uint8_t N000090AD; //0x0007 42 | wchar_t roomName[16]; //0x0008 43 | char pad_0028[8]; //0x0028 44 | RoomType roomType; //0x0030 45 | uint8_t N0001167D; //0x0031 46 | uint8_t N00011681; //0x0032 47 | uint8_t N0001167E; //0x0033 48 | uint8_t roundsToWinPlusMatchLimitBitfield; //0x0034 49 | uint8_t roundTime; //0x0035 50 | uint8_t skipTimeLimit; //0x0036 51 | RoomRematch rematch; //0x0037 52 | uint8_t memberCount; //0x0038 53 | uint8_t N0000910B; //0x0039 54 | uint8_t N0000910E; //0x003A 55 | uint8_t N0000910C; //0x003B 56 | uint32_t secondsElapsed; //0x003C 57 | char pad_0040[8]; //0x0040 58 | RoomMemberEntry member1; //0x0048 59 | RoomMemberEntry member2; //0x00E0 60 | RoomMemberEntry member3; //0x0178 61 | RoomMemberEntry member4; //0x0210 62 | RoomMemberEntry member5; //0x02A8 63 | RoomMemberEntry member6; //0x0340 64 | RoomMemberEntry member7; //0x03D8 65 | RoomMemberEntry member8; //0x0470 66 | }; //Size: 0x0508 67 | -------------------------------------------------------------------------------- /src/Game/Room/RoomMemberEntry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #pragma pack(push, 1) // Prevent padding by compiler 5 | 6 | class RoomMemberEntry 7 | { 8 | public: 9 | uint8_t memberIndex; //0x0000 10 | uint8_t N00009344; //0x0001 11 | uint8_t N00009342; //0x0002 12 | uint8_t N00009340; //0x0003 13 | uint64_t steamId; //0x0004 14 | char pad_000C[36]; //0x000C 15 | uint32_t matchId; //0x0030 16 | uint8_t matchPlayerIndex; //0x0034 17 | uint8_t N00009349; //0x0035 18 | uint8_t N0000934C; //0x0036 19 | uint8_t N0000934A; //0x0037 20 | char pad_0038[64]; //0x0038 21 | uint64_t N0000914B; //0x0078 22 | char pad_0080[24]; //0x0080 23 | }; //Size: 0x0098 24 | 25 | #pragma pack(pop) 26 | -------------------------------------------------------------------------------- /src/Game/Scr/ScrStateEntry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | enum class FrameActivity { 5 | // 0x0 - 0xf first 4 bits are frame activity 6 | Active = 0x0, //used when there are active hitboxes 7 | Inactive = 0x1, //used when there aren't active hitboxes 8 | Padding = 0x2, //used for the padding for summoned stuff from the EA 9 | NonDeterministicAcive = 0x10 | Active, // used for the cases where the sprite length is 32767 10 | NonDeterministicInactive = 0x10 | Inactive, // used for the cases where the sprite length is 32767 11 | 12 | }; 13 | enum class FrameInvuln { 14 | // 0x1 - 0f second 4 bits are invul/guard point 15 | None = 0, 16 | Head = 0x1, 17 | Body = 0x2, 18 | Foot = 0x4, 19 | Throw = 0x8, 20 | //Proj = 0x10, 21 | 22 | // permutations 23 | HeadBody = Head | Body, 24 | HeadFoot = Head | Foot, 25 | HeadThrow = Head | Throw, 26 | //HeadProj = Head | Proj, 27 | 28 | BodyFoot = Body | Foot, 29 | BodyThrow = Body | Throw, 30 | //BodyProj = Body | Proj, 31 | 32 | FootThrow = Foot | Throw, 33 | //FootProj = Foot | Proj, 34 | 35 | //ThrowProj = Throw | Proj, 36 | 37 | HeadBodyFoot = HeadBody | Foot, 38 | HeadBodyThrow = HeadBody | Throw, 39 | //HeadBodyProj = HeadBody | Proj, 40 | HeadFootThrow = Head | Foot | Throw, 41 | //HeadFootProj = Head | Foot | Proj, 42 | 43 | BodyFootThrow = Body | Foot | Throw, 44 | //BodyFootProj = Body | Foot | Proj, 45 | 46 | //HeadBodyFootThrow = Head | Body | Foot | Throw, 47 | //HeadBodyFootProj = Head | Body | Foot | Proj, 48 | 49 | //BodyFootThrowProj = Body | Foot | Throw | Proj, 50 | 51 | All = Head | Body | Foot | Throw, 52 | //All = Head | Body | Foot | Throw | Proj, 53 | // missing projectile invuln 54 | }; 55 | //gotta remember to clean up the memory afterwards 56 | struct scrState { 57 | std::string name = ""; 58 | char* addr = NULL; 59 | unsigned int frames = 0; 60 | unsigned int damage = 0; 61 | unsigned int atk_type = 4; 62 | unsigned int atk_level = 0; 63 | unsigned int hitstun = 0; 64 | unsigned int blockstun = 0; 65 | unsigned int hitstop = 0; 66 | unsigned int starter_rating = 0; 67 | unsigned int attack_p1 = 0; 68 | unsigned int attack_p2 = 0; 69 | unsigned int hit_overhead = 0; 70 | unsigned int hit_low = 0; 71 | unsigned int hit_air_unblockable = 0; 72 | unsigned int fatal_counter = 0; 73 | std::vector whiff_cancel = {}; 74 | std::vector hit_or_block_cancel = {}; 75 | //std::vector frame_activity_status = {}; 76 | std::vector frame_activity_status = {}; //vector of combinations from FrameActivity 77 | std::vector frame_invuln_status = {}; //vector of combinations from Frameinvuln 78 | std::vector >frame_EA_effect_pairs = {};// holds all the EA states the script spawns. First is the frame where it spawns, second is the scState of the EA state. 79 | char* replaced_state_script[36]{}; 80 | }; -------------------------------------------------------------------------------- /src/Game/Scr/ScrStateReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "Game/Jonb/JonbDBReader.h" 7 | #include "Game/Jonb/JonbDBEntry.h" 8 | #include "ScrStateEntry.h" 9 | 10 | 11 | std::vector parse_scr(char* bbcf_base_addr, int player_num); 12 | int parse_state(char* addr, std::vector& states_parsed, std::map*, std::map* ea_state_map); 13 | void override_state(char* addr, char* new_state); -------------------------------------------------------------------------------- /src/Game/SnapshotApparatus/SnapshotApparatus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Game/GhidraDefs.h" 3 | #include "Core/Interfaces.h" 4 | #define SNAPSHOT_PREALLOC_SIZE 1 5 | 6 | class Snapshot { 7 | public: 8 | char padding[0xa10000]; 9 | //btw chardata resides on buf + 0x623E10 for P1 and for p2 buf + 0x623E10 + 0x24978 for training mode THIS IS NOT TRUE, SEEMS TO CHANGE 10 | 11 | }; 12 | 13 | //!!!!!!!!!!!!Uncomment this later(and all the functions related to it) when I go back to working on rewind!!!! leaving out for possible crash reasons 14 | //static Snapshot snapshot_replay_pre_allocated[SNAPSHOT_PREALLOC_SIZE]; //keeping this with only one element for now while its not used for any implementation to save space 15 | //!!!!!!!!!!!!!!!! 16 | 17 | 18 | class SnapshotApparatus { 19 | 20 | 21 | public: 22 | unsigned int snapshot_count; 23 | CharData* p1_ptr;//p1 CharData* 24 | CharData* p2_ptr; //p2 CharData* 25 | //p1 and p2 ptrs are used for now to determine when I need to remake the snapshot 26 | GGPOSessionCallbacks* callbacks_ptr; 27 | //Snapshot* p_snapshot_reseve; 28 | //Snapshot** pp_snapshot_reseve; 29 | SnapshotApparatus(); 30 | 31 | 32 | bool save_snapshot(Snapshot** pbuf); 33 | bool save_snapshot_prealloc(); 34 | bool load_snapshot(Snapshot* buf); 35 | bool load_snapshot_prealloc(int index); 36 | bool load_snapshot_index(int index); 37 | bool check_if_valid(CharData* p1, CharData* p2); 38 | void clear_count(); 39 | bool clear_framecounts(); 40 | int get_nearest_prealloc_frame(int current_frame, std::map frame_snap_map); 41 | }; -------------------------------------------------------------------------------- /src/Game/characters.cpp: -------------------------------------------------------------------------------- 1 | #include "characters.h" 2 | 3 | #include 4 | 5 | const std::vector charNames 6 | { 7 | "Ragna", //00 8 | "Jin", //01 9 | "Noel", //02 10 | "Rachel", //03 11 | "Taokaka", //04 12 | "Tager", //05 13 | "Litchi", //06 14 | "Arakune", //07 15 | "Bang", //08 16 | "Carl", //09 17 | "Hakumen", //10 18 | "Nu", //11 19 | "Tsubaki", //12 20 | "Hazama", //13 21 | "Mu", //14 22 | "Makoto", //15 23 | "Valkenhayn", //16 24 | "Platinum", //17 25 | "Relius", //18 26 | "Izayoi", //19 27 | "Amane", //20 28 | "Bullet", //21 29 | "Azrael", //22 30 | "Kagura", //23 31 | "Kokonoe", //24 32 | "Terumi", //25 33 | "Celica", //26 34 | "Lambda", //27 35 | "Hibiki", //28 36 | "Nine", //29 37 | "Naoto", //30 38 | "Izanami", //31 39 | "Susanoo", //32 40 | "Es", //33 41 | "Mai", //34 42 | "Jubei" //35 43 | }; 44 | 45 | int getCharactersCount() 46 | { 47 | return charNames.size(); 48 | } 49 | 50 | const std::string& getCharacterNameByIndexA(int charIndex) 51 | { 52 | const static std::string UNKNOWN = "Unknown"; 53 | 54 | if (charIndex < getCharactersCount()) 55 | return charNames[charIndex]; 56 | 57 | return UNKNOWN; 58 | } 59 | 60 | std::wstring getCharacterNameByIndexW(int charIndex) 61 | { 62 | const std::string& charName = getCharacterNameByIndexA(charIndex); 63 | return std::wstring(charName.begin(), charName.end()); 64 | } 65 | 66 | bool isCharacterIndexOutOfBound(int charIndex) 67 | { 68 | return getCharactersCount() < charIndex; 69 | } 70 | -------------------------------------------------------------------------------- /src/Game/characters.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | enum CharIndex 5 | { 6 | CharIndex_Ragna = 0, 7 | CharIndex_Jin, 8 | CharIndex_Noel, 9 | CharIndex_Rachel, 10 | CharIndex_Taokaka, 11 | CharIndex_Tager, 12 | CharIndex_Litchi, 13 | CharIndex_Arakune, 14 | CharIndex_Bang, 15 | CharIndex_Carl, 16 | CharIndex_Hakumen, 17 | CharIndex_Nu, 18 | CharIndex_Tsubaki, 19 | CharIndex_Hazama, 20 | CharIndex_Mu, 21 | CharIndex_Makoto, 22 | CharIndex_Valkenhayn, 23 | CharIndex_Platinum, 24 | CharIndex_Relius, 25 | CharIndex_Izayoi, 26 | CharIndex_Amane, 27 | CharIndex_Bullet, 28 | CharIndex_Azrael, 29 | CharIndex_Kagura, 30 | CharIndex_Kokonoe, 31 | CharIndex_Terumi, 32 | CharIndex_Celica, 33 | CharIndex_Lambda, 34 | CharIndex_Hibiki, 35 | CharIndex_Nine, 36 | CharIndex_Naoto, 37 | CharIndex_Izanami, 38 | CharIndex_Susanoo, 39 | CharIndex_Es, 40 | CharIndex_Mai, 41 | CharIndex_Jubei 42 | }; 43 | 44 | int getCharactersCount(); 45 | 46 | const std::string& getCharacterNameByIndexA(int charIndex); 47 | 48 | std::wstring getCharacterNameByIndexW(int charIndex); 49 | 50 | bool isCharacterIndexOutOfBound(int charIndex); 51 | -------------------------------------------------------------------------------- /src/Game/gamestates.cpp: -------------------------------------------------------------------------------- 1 | #include "gamestates.h" 2 | 3 | #include "Core/interfaces.h" 4 | 5 | bool isPaletteEditingEnabledInCurrentState() 6 | { 7 | bool isEnabledInCurrentState = 8 | *g_gameVals.pGameState == GameState_InMatch; 9 | 10 | bool isEnabledInCurrentMode = 11 | *g_gameVals.pGameMode == GameMode_Training || 12 | *g_gameVals.pGameMode == GameMode_Versus; 13 | 14 | return isEnabledInCurrentState && isEnabledInCurrentMode; 15 | } 16 | 17 | bool isHitboxOverlayEnabledInCurrentState() 18 | { 19 | bool isEnabledInCurrentState = 20 | *g_gameVals.pGameState == GameState_InMatch; 21 | 22 | bool isEnabledInCurrentMode = 23 | *g_gameVals.pGameMode == GameMode_Training || 24 | *g_gameVals.pGameMode == GameMode_Versus || 25 | *g_gameVals.pGameMode == GameMode_ReplayTheater; 26 | 27 | return isEnabledInCurrentState && isEnabledInCurrentMode; 28 | } 29 | 30 | bool isGameModeSelectorEnabledInCurrentState() 31 | { 32 | bool isEnabledInCurrentState = 33 | *g_gameVals.pGameState == GameState_CharacterSelectionScreen || 34 | *g_gameVals.pGameState == GameState_ReplayMenu; 35 | 36 | bool isEnabledInCurrentMode = 37 | *g_gameVals.pGameMode == GameMode_Training || 38 | *g_gameVals.pGameMode == GameMode_Versus || 39 | *g_gameVals.pGameMode == GameMode_Online || 40 | *g_gameVals.pGameState == GameState_ReplayMenu; 41 | 42 | return isEnabledInCurrentState && isEnabledInCurrentMode; 43 | } 44 | 45 | bool isStageSelectorEnabledInCurrentState() 46 | { 47 | return *g_gameVals.pGameState == GameState_CharacterSelectionScreen; 48 | } 49 | 50 | bool isInMatch() 51 | { 52 | return *g_gameVals.pGameState == GameState_InMatch; 53 | } 54 | 55 | bool isInMenu() 56 | { 57 | return *g_gameVals.pGameState == GameState_MainMenu; 58 | } 59 | 60 | bool isOnVersusScreen() 61 | { 62 | return *g_gameVals.pGameState == GameState_VersusScreen; 63 | } 64 | 65 | bool isOnReplayMenuScreen() 66 | { 67 | return *g_gameVals.pGameState == GameState_ReplayMenu; 68 | } 69 | 70 | bool isOnCharacterSelectionScreen() 71 | { 72 | return *g_gameVals.pGameState == GameState_CharacterSelectionScreen; 73 | } 74 | -------------------------------------------------------------------------------- /src/Game/gamestates.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | enum GameSceneStatus { 3 | /* 4 | * These are just tests, might be wildly incorrect. 5 | * By "run" I mean passing thru the function on bbcf + 14f9b0 6 | seems like status 0->6 run sequencially, with each having just one "run". 7 | status 7 appears to be the loading screen and runs while it is active. It is also sequencial. 8 | status 8 appears to "run" once after the loading screen. It is also sequencial. 9 | status 9 appears to "run" for the duration of the "normal" behaviour of a SCENE 10 | wasn't able to trigger status 10 and 11 so far 11 | */ 12 | GameSceneStatus_0_idk = 0, 13 | GameSceneStatus_1_idk = 1, 14 | GameSceneStatus_2_idk = 2, 15 | GameSceneStatus_3_idk = 3, 16 | GameSceneStatus_4_idk = 4, 17 | GameSceneStatus_5_idk = 5, 18 | GameSceneStatus_6_idk = 6, 19 | GameSceneStatus_LoadingScreen = 7, 20 | GameSceneStatus_Initialization = 8, //only seems to appear for 1 "run" 21 | GameSceneStatus_Running = 9, 22 | GameSceneStatus_10_idk = 10, // 23 | GameSceneStatus_11_idk = 11 // 24 | }; 25 | enum MatchState_ 26 | { 27 | MatchState_NotStarted = 0, 28 | MatchState_RebelActionRoundSign = 2, 29 | MatchState_Fight = 3, 30 | MatchState_FinishSign = 4, 31 | MatchState_WinLoseSign = 5, 32 | MatchState_VictoryScreen = 7, 33 | MatchState_Initialization = 8 34 | }; 35 | //GameState=GameScene ON DUMPFILE 36 | enum GameState 37 | { 38 | GameState_ArcsysLogo = 2, 39 | GameState_IntroVideoPlaying = 3, 40 | GameState_TitleScreen = 4, 41 | GameState_CharacterSelectionScreen = 6, 42 | GameState_ArcadeActSelectScreen = 11, 43 | GameState_ScoreAttackModeSelectScreen = 11, 44 | GameState_SpeedStarModeSelectScreen = 11, 45 | GameState_ArcadeCharInfoScreen = 12, 46 | GameState_ArcadeStageSelectScreen = 13, 47 | GameState_VersusScreen = 14, 48 | GameState_InMatch = 15, 49 | GameState_VictoryScreen = 16, 50 | GameState_StoryMenu = 24, 51 | GameState_GalleryMenu = 25, 52 | GameState_ItemMenu = 25, 53 | GameState_ReplayMenu = 26, 54 | GameState_MainMenu = 27, 55 | GameState_TutorialMenu = 28, 56 | GameState_LibraryMenu = 28, 57 | GameState_Lobby = 31, 58 | GameState_StoryPlaying = 33, 59 | GameState_AbyssMenu = 34, 60 | GameState_DCodeEdit = 39, 61 | }; 62 | 63 | enum GameMode 64 | { 65 | GameMode_Arcade = 1, 66 | GameMode_Story = 4, 67 | GameMode_Versus = 5, 68 | GameMode_Training = 6, 69 | GameMode_Tutorial = 7, 70 | GameMode_Challenge = 8, 71 | // GameMode_Gallery = 9, 72 | // GameMode_ItemShop = 10, 73 | GameMode_ReplayTheater = 11, 74 | // GameMode_TitleScreen = 12, 75 | // GameMode_MainMenuScreen = 13, 76 | GameMode_Online = 15, 77 | GameMode_Abyss = 16, 78 | // GameMode_DCodeEdit = 18, 79 | }; 80 | 81 | bool isPaletteEditingEnabledInCurrentState(); 82 | bool isHitboxOverlayEnabledInCurrentState(); 83 | bool isGameModeSelectorEnabledInCurrentState(); 84 | bool isStageSelectorEnabledInCurrentState(); 85 | 86 | bool isInMatch(); 87 | bool isInMenu(); 88 | bool isOnVersusScreen(); 89 | bool isOnReplayMenuScreen(); 90 | bool isOnCharacterSelectionScreen(); -------------------------------------------------------------------------------- /src/Game/stages.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define STAGES_COUNT 79 4 | #define ALL_STAGES_UNLOCKED_MEMORY_SIZE 3536 5 | 6 | extern unsigned char stages[STAGES_COUNT][2]; 7 | extern char* allStagesUnlockedMemoryBlock; 8 | -------------------------------------------------------------------------------- /src/Hooks/HookManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAX_LENGTH 32 7 | 8 | typedef DWORD JMPBACKADDR; 9 | 10 | struct functionhook_t 11 | { 12 | std::string label; 13 | std::string pattern; 14 | std::string mask; 15 | int length; //number of bytes to replace 16 | DWORD startAddress; //address is 0 if signature scanning was unsuccessful 17 | DWORD jmpBackAddr; 18 | void* newFunc; 19 | char originalBytes[MAX_LENGTH]; 20 | bool activated; //is the hook in effect 21 | }; 22 | 23 | class HookManager 24 | { 25 | public: 26 | static JMPBACKADDR SetHook(const char* label, const char* pattern, const char* mask, const int length, void* newFunc, bool activate = true); //Hooks to a found adress, returns 0 if hook failed 27 | static JMPBACKADDR SetHook(const char* label, DWORD startAddress, const int length, void* newFunc, bool activate = true); //Hooks to direct adress, returns 0 if hook failed 28 | static bool SetHook(const char* label, void* newFunc, bool activate = true); 29 | static bool IsHookActivated(const char* label); 30 | static bool ActivateHook(const char* label); //0 hook not found, 1 success 31 | static bool DeactivateHook(const char* label); // 0 hook not found, 1 success 32 | static JMPBACKADDR GetJmpBackAddr(const char* label); /* do not call this whenever you want to jump back 33 | searching through the array each time is bad for performance, 34 | use this func ONCE to store the address in a variable*/ 35 | static bool SetJmpBackAddr(const char* label, DWORD newJmpBackAddr); 36 | static DWORD GetStartAddress(const char* label); 37 | static JMPBACKADDR RegisterHook(const char* label, const char* pattern, const char* mask, const int len); 38 | static int GetOriginalBytes(const char* label, int startIndex, int bytesToReturn); 39 | static int GetBytesFromAddr(const char* label, int startIndex, int bytesToReturn); 40 | static int OverWriteBytes(void* startAddress, void* endAddress, const char* pattern, const char* mask, const char* newBytes); 41 | static void Cleanup(); //empty atm 42 | private: 43 | static std::vector hooks; //stores hook structs 44 | static int GetHookStructIndex(const char* label); //returns the index of hook struct 45 | static bool SaveOriginalBytes(int hookIndex, void* startAddress, int len); 46 | static bool PlaceHook(void* toHook, void* ourFunc, int len); 47 | static bool RestoreOriginalBytes(int functionhook_index); 48 | static DWORD FindPattern(const char* pattern, const char* mask); 49 | }; -------------------------------------------------------------------------------- /src/Hooks/hooks_bbcf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool placeHooks_bbcf(); -------------------------------------------------------------------------------- /src/Hooks/hooks_customGameModes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern DWORD steroid_HeatModifyJmpBackAddr; 6 | 7 | void placeHooks_CustomGameModes(); -------------------------------------------------------------------------------- /src/Hooks/hooks_detours.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool placeHooks_detours(); -------------------------------------------------------------------------------- /src/Hooks/hooks_palette.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool placeHooks_palette(); -------------------------------------------------------------------------------- /src/Network/NetworkManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Packet.h" 3 | 4 | #include "SteamApiWrapper/SteamNetworkingWrapper.h" 5 | 6 | #include 7 | 8 | class NetworkManager 9 | { 10 | public: 11 | NetworkManager(SteamNetworkingWrapper* SteamNetworking, CSteamID steamID); 12 | ~NetworkManager(); 13 | bool SendPacket(CSteamID* steamID, Packet* packet); 14 | void RecvPacket(Packet* packet); 15 | bool IsIMPacket(Packet* packet); 16 | 17 | private: 18 | 19 | SteamNetworkingWrapper* m_pSteamNetworking; 20 | CSteamID m_steamID; 21 | }; -------------------------------------------------------------------------------- /src/Network/OnlineGameModeManager.cpp: -------------------------------------------------------------------------------- 1 | #include "OnlineGameModeManager.h" 2 | 3 | #include "Core/logger.h" 4 | 5 | OnlineGameModeManager::OnlineGameModeManager(GameModeManager* pGameModeManager, RoomManager* pRoomManager) 6 | : m_pGameModeManager(pGameModeManager), m_pRoomManager(pRoomManager), 7 | m_player1GameModeChoice(CustomGameMode_None), m_player2GameModeChoice(CustomGameMode_None) 8 | { 9 | } 10 | 11 | void OnlineGameModeManager::SendGameModePacket() 12 | { 13 | LOG(2, "OnlineGameModeManager::SendGameModePacket\n"); 14 | 15 | if (m_pRoomManager->IsThisPlayerSpectator()) 16 | return; 17 | 18 | uint16_t thisPlayerMatchPlayerIndex = m_pRoomManager->GetThisPlayerMatchPlayerIndex(); 19 | CustomGameMode selectedGameMode = m_pGameModeManager->GetActiveGameMode(); 20 | 21 | Packet packet = Packet(&selectedGameMode, sizeof(CustomGameMode), PacketType_GameMode, thisPlayerMatchPlayerIndex); 22 | 23 | m_pRoomManager->SendPacketToSameMatchIMPlayers(&packet); 24 | } 25 | 26 | void OnlineGameModeManager::RecvGameModePacket(Packet* packet) 27 | { 28 | LOG(2, "OnlineGameModeManager::RecvGameModePacket\n"); 29 | 30 | uint16_t matchPlayerIndex = m_pRoomManager->GetPlayerMatchPlayerIndexByRoomMemberIndex(packet->roomMemberIndex); 31 | CustomGameMode selectedGameMode = (CustomGameMode)packet->data[0]; 32 | CustomGameMode* pOtherPlayerGameModeChoice = matchPlayerIndex == 0 ? &m_player1GameModeChoice : &m_player2GameModeChoice; 33 | 34 | *pOtherPlayerGameModeChoice = selectedGameMode; 35 | } 36 | 37 | void OnlineGameModeManager::SetThisPlayerGameMode(CustomGameMode gameMode) 38 | { 39 | LOG(2, "OnlineGameModeManager::SetThisPlayerGameMode\n"); 40 | 41 | if (m_pRoomManager->IsThisPlayerSpectator()) 42 | return; 43 | 44 | uint16_t thisPlayerMatchPlayerIndex = m_pRoomManager->GetThisPlayerMatchPlayerIndex(); 45 | CustomGameMode* pThisPlayerGameModeChoice = thisPlayerMatchPlayerIndex == 0 ? &m_player1GameModeChoice : &m_player2GameModeChoice; 46 | 47 | *pThisPlayerGameModeChoice = gameMode; 48 | } 49 | 50 | const CustomGameMode OnlineGameModeManager::GetSettledGameModeChoice() const 51 | { 52 | if (m_player1GameModeChoice == m_player2GameModeChoice) 53 | return m_player1GameModeChoice; 54 | 55 | return CustomGameMode_None; 56 | } 57 | 58 | void OnlineGameModeManager::ClearPlayerGameModeChoices() 59 | { 60 | LOG(2, "OnlineGameModeManager::ClearPlayerGameModeChoices\n"); 61 | 62 | m_player1GameModeChoice = CustomGameMode_None; 63 | m_player2GameModeChoice = CustomGameMode_None; 64 | } 65 | 66 | void OnlineGameModeManager::OnMatchInit() 67 | { 68 | LOG(2, "OnlineGameModeManager::OnMatchInit\n"); 69 | 70 | // Set if both players settled on the same gamemode 71 | 72 | CustomGameMode gameModeToActivate = m_player1GameModeChoice == m_player2GameModeChoice 73 | ? m_player1GameModeChoice 74 | : CustomGameMode_None; 75 | 76 | m_pGameModeManager->SetActiveGameMode(gameModeToActivate); 77 | } -------------------------------------------------------------------------------- /src/Network/OnlineGameModeManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RoomManager.h" 4 | 5 | #include "CustomGameMode/GameModeManager.h" 6 | 7 | class OnlineGameModeManager 8 | { 9 | public: 10 | OnlineGameModeManager(GameModeManager* pGameModeManager, RoomManager* pRoomManager); 11 | void SendGameModePacket(); 12 | void RecvGameModePacket(Packet* packet); 13 | void SetThisPlayerGameMode(CustomGameMode gameMode); 14 | const CustomGameMode GetPlayer1GameModeChoice() const { return m_player1GameModeChoice; } 15 | const CustomGameMode GetPlayer2GameModeChoice() const { return m_player2GameModeChoice; } 16 | const CustomGameMode GetSettledGameModeChoice() const; 17 | void ClearPlayerGameModeChoices(); 18 | void OnMatchInit(); 19 | 20 | private: 21 | CustomGameMode m_player1GameModeChoice; 22 | CustomGameMode m_player2GameModeChoice; 23 | 24 | // Interfaces 25 | RoomManager* m_pRoomManager; 26 | GameModeManager* m_pGameModeManager; 27 | }; 28 | -------------------------------------------------------------------------------- /src/Network/OnlinePaletteManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RoomManager.h" 4 | 5 | #include "Palette/PaletteManager.h" 6 | 7 | #include 8 | 9 | class OnlinePaletteManager 10 | { 11 | public: 12 | OnlinePaletteManager(PaletteManager* pPaletteManager, CharPaletteHandle* pP1CharPalHandle, 13 | CharPaletteHandle* pP2CharPalHandle, RoomManager* pRoomManager); 14 | void SendPalettePackets(); 15 | void RecvPaletteDataPacket(Packet* packet); 16 | void RecvPaletteInfoPacket(Packet* packet); 17 | void ProcessSavedPalettePackets(); 18 | void ClearSavedPalettePacketQueues(); 19 | void OnMatchInit(); 20 | 21 | private: 22 | void SendPaletteInfoPacket(CharPaletteHandle& charPalHandle, uint16_t roomMemberIndex); 23 | void SendPaletteDataPackets(CharPaletteHandle& charPalHandle, uint16_t roomMemberIndex); 24 | void ProcessSavedPaletteInfoPackets(); 25 | void ProcessSavedPaletteDataPackets(); 26 | CharPaletteHandle& GetPlayerCharPaletteHandle(uint16_t matchPlayerIndex); 27 | 28 | struct UnprocessedPaletteInfo 29 | { 30 | uint16_t matchPlayerIndex; 31 | IMPL_info_t palInfo; 32 | 33 | UnprocessedPaletteInfo(uint16_t matchPlayerIndex_, IMPL_info_t* pPalInfo) 34 | : matchPlayerIndex(matchPlayerIndex_) 35 | { 36 | memcpy_s(&palInfo, sizeof(IMPL_info_t), pPalInfo, sizeof(IMPL_info_t)); 37 | } 38 | }; 39 | 40 | struct UnprocessedPaletteFile 41 | { 42 | uint16_t matchPlayerIndex; 43 | PaletteFile palFile; 44 | char palData[IMPL_PALETTE_DATALEN]; 45 | 46 | UnprocessedPaletteFile(uint16_t matchPlayerIndex_, PaletteFile palFile_, char* pPalSrc) 47 | : matchPlayerIndex(matchPlayerIndex_), palFile(palFile_) 48 | { 49 | memcpy_s(palData, IMPL_PALETTE_DATALEN, pPalSrc, IMPL_PALETTE_DATALEN); 50 | } 51 | }; 52 | 53 | std::queue m_unprocessedPaletteInfos; 54 | std::queue m_unprocessedPaletteFiles; 55 | 56 | CharPaletteHandle* m_pP1CharPalHandle; 57 | CharPaletteHandle* m_pP2CharPalHandle; 58 | 59 | // Interfaces 60 | PaletteManager* m_pPaletteManager; 61 | RoomManager* m_pRoomManager; 62 | }; -------------------------------------------------------------------------------- /src/Network/Packet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #define IM_PACKET_VERSION 0x95 6 | #define IM_PACKET_VERSION_ASM 95h 7 | 8 | constexpr int MAX_DATA_SIZE = 1200; 9 | 10 | enum PacketType : uint16_t 11 | { 12 | PacketType_IMID_Announce, 13 | PacketType_IMID_Acknowledge, 14 | PacketType_PaletteInfo, 15 | PacketType_PaletteData, 16 | PacketType_GameMode, 17 | PacketType_UploadReplayEnabled_Broadcast, 18 | PacketType_UploadReplayEnabled_Check, 19 | PacketType_UploadReplayEnabled_Response, 20 | }; 21 | 22 | // BBCF packets' first two fields must be the packet size 23 | struct Packet 24 | { 25 | uint16_t __packetSize; // BBCF packets' first two fields must be the packet size, the game performs validation on them upon receiving 26 | uint16_t packetSize; 27 | uint16_t version = IM_PACKET_VERSION; 28 | PacketType packetType; 29 | uint64_t steamID; 30 | uint16_t part; 31 | uint16_t roomMemberIndex; 32 | uint32_t dataSize; 33 | unsigned char data[MAX_DATA_SIZE]; 34 | 35 | Packet(void* dataSrc, uint16_t dataSize, PacketType packetType, uint16_t roomMemberIndex, uint16_t part = 0) 36 | : dataSize(dataSize), packetType(packetType), roomMemberIndex(roomMemberIndex), part(part) 37 | { 38 | // HeaderSize + dataSize 39 | packetSize = sizeof(Packet) - MAX_DATA_SIZE + dataSize; 40 | __packetSize = packetSize; 41 | 42 | if (dataSrc && dataSize) 43 | { 44 | memcpy_s(data, MAX_DATA_SIZE, dataSrc, dataSize); 45 | } 46 | } 47 | }; -------------------------------------------------------------------------------- /src/Network/ReplayUploadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "ReplayUploadManager.h" 2 | 3 | #include "Core/logger.h" 4 | #include "Core/interfaces.h" 5 | 6 | 7 | 8 | 9 | ReplayUploadManager::ReplayUploadManager(RoomManager* pRoomManager) : m_pRoomManager(pRoomManager){} 10 | 11 | void ReplayUploadManager::OnMatchInit() { 12 | uint16_t thisPlayerMatchPlayerIndex = g_interfaces.pRoomManager->GetThisPlayerMatchPlayerIndex(); 13 | // Only should be done if you are playing the match and not spectating 14 | if (thisPlayerMatchPlayerIndex < 2) 15 | { 16 | SendReplayUploadEnabledBroadcastPacket(); 17 | } 18 | 19 | } 20 | void ReplayUploadManager::OnMatchEnd() { 21 | // Resets the value to default "false" to wait for broadcast 22 | g_modVals.uploadReplayDataVeto = false; 23 | } 24 | void ReplayUploadManager::SendReplayUploadEnabledBroadcastPacket() 25 | { 26 | //this should be run on match init 27 | LOG(2, "ReplayUploadManager::SendReplayUploadEnabledCheckPacket\n"); 28 | 29 | uint16_t thisPlayerMatchPlayerIndex = m_pRoomManager->GetThisPlayerMatchPlayerIndex(); 30 | void* data_src = &g_modVals.uploadReplayData; 31 | Packet packet = Packet( 32 | data_src, 33 | (uint16_t)sizeof(g_modVals.uploadReplayData), 34 | PacketType_UploadReplayEnabled_Broadcast, 35 | thisPlayerMatchPlayerIndex 36 | ); 37 | m_pRoomManager->SendPacketToSameMatchIMPlayersNonSpectator(&packet); 38 | 39 | } 40 | 41 | void ReplayUploadManager::RecvReplayUploadEnabledBroadcastPacket(Packet* packet) 42 | { 43 | /*if either p1 or p2 don't want uploaded, disable it */ 44 | int allowUpload; 45 | memcpy(&allowUpload, packet->data, packet->dataSize); 46 | if (!allowUpload) { 47 | g_modVals.uploadReplayDataVeto = true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Network/ReplayUploadManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma once 3 | #include "NetworkManager.h" 4 | #include "RoomManager.h" 5 | 6 | class ReplayUploadManager 7 | { 8 | public: 9 | ReplayUploadManager(RoomManager* pRoomManager); 10 | void OnMatchInit(); 11 | void OnMatchEnd(); 12 | void SendReplayUploadEnabledBroadcastPacket(); 13 | void RecvReplayUploadEnabledBroadcastPacket(Packet* packet); 14 | 15 | RoomManager* m_pRoomManager; 16 | }; -------------------------------------------------------------------------------- /src/Network/RoomManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "NetworkManager.h" 3 | 4 | #include "Game/Room/Room.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define MAX_PLAYERS_IN_ROOM 8 11 | 12 | struct IMPlayer 13 | { 14 | int roomMemberIndex; 15 | CSteamID steamID; 16 | std::string steamName; 17 | int matchPlayerIndex; 18 | 19 | IMPlayer() : roomMemberIndex(-1), matchPlayerIndex(-1) 20 | { 21 | } 22 | 23 | IMPlayer(int roomMemberIndex, uint64_t steamID, const char* steamName) 24 | : roomMemberIndex(roomMemberIndex), steamID(steamID), 25 | steamName(steamName), matchPlayerIndex(-1) 26 | { 27 | } 28 | 29 | IMPlayer(IMPlayer other, int matchPlayerIndex) 30 | : roomMemberIndex(other.roomMemberIndex), steamID(other.steamID), 31 | steamName(other.steamName), matchPlayerIndex(matchPlayerIndex) 32 | { 33 | } 34 | }; 35 | 36 | class RoomManager 37 | { 38 | public: 39 | RoomManager(NetworkManager* pNetworkManager, ISteamFriends* pSteamFriends, CSteamID steamID); 40 | ~RoomManager(); 41 | 42 | void SendAcknowledge(Packet* packet); 43 | void AcceptAcknowledge(Packet* packet); 44 | void JoinRoom(Room* pRoom); 45 | bool IsRoomFunctional() const; 46 | void SendPacketToSameMatchIMPlayers(Packet* packet); 47 | void SendPacketToSameMatchIMPlayersNonSpectator(Packet* packet); 48 | bool IsPacketFromSameRoom(Packet* packet) const; 49 | bool IsPacketFromSameMatchNonSpectator(Packet* packet) const; 50 | bool IsThisPlayerSpectator() const; 51 | bool IsThisPlayerInMatch() const; 52 | void SetFFAThisPlayerIndex(int* pFFAThisPlayerIndex); 53 | uint16_t GetThisPlayerMatchPlayerIndex() const; 54 | uint16_t GetPlayerMatchPlayerIndexByRoomMemberIndex(uint16_t index) const; 55 | const std::string GetRoomTypeName() const; 56 | std::vector GetIMPlayersInCurrentMatch() const; 57 | std::vector GetIMPlayersInCurrentRoom() const; 58 | std::vector GetOtherRoomMemberEntriesInCurrentMatch() const; 59 | 60 | std::vector GetIMPlayersInCurrentMatchNonSpec() const; 61 | 62 | 63 | private: 64 | void SendAnnounce(); 65 | void AddIMPlayerToRoom(const IMPlayer& player); 66 | void RemoveIMPlayerFromRoom(uint16_t index); 67 | bool IsPacketFromSameMatch(Packet* packet) const; 68 | bool IsPacketFromSpectator(Packet* packet) const;; 69 | uint16_t GetThisPlayerRoomMemberIndex() const; 70 | const RoomMemberEntry* GetThisPlayerRoomMemberEntry() const; 71 | const RoomMemberEntry* GetRoomMemberEntryByIndex(uint16_t index) const; 72 | bool IsPlayerInRoom(const IMPlayer& player) const; 73 | bool IsThisPlayer(const uint64_t otherSteamID) const; 74 | const char* GetPlayerSteamName(uint64_t steamID) const; 75 | 76 | std::vector m_imPlayers; 77 | CSteamID m_thisPlayerSteamID; 78 | 79 | // Free-for-All fix 80 | int* m_pFFAThisPlayerIndex; 81 | 82 | // Interfaces 83 | NetworkManager* m_pNetworkManager; 84 | ISteamFriends* m_pSteamFriends; 85 | Room* m_pRoom; 86 | 87 | // For debug purposes 88 | friend class DebugWindow; 89 | }; 90 | -------------------------------------------------------------------------------- /src/Overlay/Logger/ImGuiLogger.cpp: -------------------------------------------------------------------------------- 1 | #include "ImGuiLogger.h" 2 | 3 | #include 4 | #include 5 | 6 | Logger* g_imGuiLogger = new ImGuiLogger(); 7 | 8 | void ImGuiLogger::Clear() 9 | { 10 | m_textBuffer.clear(); 11 | m_lineOffsets.clear(); 12 | } 13 | 14 | const std::string ImGuiLogger::GetTime() 15 | { 16 | std::ostringstream oss; 17 | 18 | CTime time = CTime::GetCurrentTime(); 19 | oss << time.GetHour() 20 | << ":" 21 | << time.GetMinute() 22 | << ":" 23 | << time.GetSecond(); 24 | 25 | return oss.str(); 26 | } 27 | 28 | const std::string ImGuiLogger::GetDate() 29 | { 30 | std::ostringstream oss; 31 | 32 | CTime time = CTime::GetCurrentTime(); 33 | oss << time.GetYear() 34 | << "/" 35 | << time.GetMonth() 36 | << "/" 37 | << time.GetDay(); 38 | 39 | return oss.str(); 40 | } 41 | 42 | void ImGuiLogger::Log(LogLevel_ logLevel, const char* fmt, ...) 43 | { 44 | if (!m_loggingEnabled) 45 | { 46 | return; 47 | } 48 | 49 | //va_list args; 50 | //va_start(args, fmt); 51 | //// 52 | //va_end(args); 53 | } 54 | 55 | void ImGuiLogger::Log(const char * fmt, ...) 56 | { 57 | if (!m_loggingEnabled) 58 | { 59 | return; 60 | } 61 | 62 | va_list args, args_copy; 63 | va_start(args, fmt); 64 | va_copy(args_copy, args); 65 | 66 | const int size = std::vsnprintf(nullptr, 0, fmt, args) + 1; 67 | std::string result(size, ' '); 68 | std::vsnprintf(&result.front(), size, fmt, args_copy); 69 | 70 | va_end(args_copy); 71 | va_end(args); 72 | 73 | std::string fullMessage = GetTime() + " " + result; 74 | 75 | int oldSize = m_textBuffer.size(); 76 | m_textBuffer.appendfv(fullMessage.c_str(), nullptr); 77 | 78 | for (int newSize = m_textBuffer.size(); oldSize < newSize; oldSize++) 79 | { 80 | if (m_textBuffer[oldSize] == '\n') 81 | { 82 | m_lineOffsets.push_back(oldSize); 83 | } 84 | } 85 | } 86 | 87 | void ImGuiLogger::LogSeparator() 88 | { 89 | Log("------------------------------------------------------------------\n"); 90 | } 91 | -------------------------------------------------------------------------------- /src/Overlay/Logger/ImGuiLogger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Logger.h" 3 | 4 | #include 5 | 6 | #include 7 | 8 | extern Logger* g_imGuiLogger; 9 | 10 | struct ImGuiLogBuffer 11 | { 12 | ImGuiTextBuffer textBuffer; 13 | ImVector lineOffsets; // Index to lines offset 14 | }; 15 | 16 | class ImGuiLogger : public Logger 17 | { 18 | public: 19 | ImGuiLogger() : m_textBuffer(m_buffer.textBuffer), m_lineOffsets(m_buffer.lineOffsets) {} 20 | ~ImGuiLogger() override = default; 21 | void Log(LogLevel_ logLevel, const char* fmt, ...) override; 22 | void Log(const char* fmt, ...) override; 23 | void LogSeparator() override; 24 | void Clear() override; 25 | void ToFile(FILE* file) const override { fprintf(file, "%s", m_buffer.textBuffer.begin()); } 26 | void EnableLog(bool value) override { m_loggingEnabled = value; } 27 | bool IsLogEnabled() const override { return m_loggingEnabled; } 28 | const void* GetBuffer() const override { return &m_buffer; } 29 | 30 | private: 31 | const std::string GetTime(); 32 | const std::string GetDate(); 33 | 34 | bool m_loggingEnabled = true; 35 | ImGuiLogBuffer m_buffer; 36 | 37 | ImGuiTextBuffer& m_textBuffer; 38 | ImVector& m_lineOffsets; 39 | }; 40 | -------------------------------------------------------------------------------- /src/Overlay/Logger/Logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | enum LogLevel_ 5 | { 6 | LogLevel_System, 7 | LogLevel_Info, 8 | LogLevel_Warning, 9 | LogLevel_Error, 10 | LogLevel_Fatal, 11 | LogLevel_Notice, 12 | LogLevel_Log 13 | }; 14 | 15 | class Logger 16 | { 17 | public: 18 | virtual ~Logger() = default; 19 | virtual void Log(LogLevel_ logLevel, const char* fmt, ...) = 0; 20 | virtual void Log(const char* fmt, ...) = 0; 21 | virtual void LogSeparator() = 0; 22 | virtual void Clear() = 0; 23 | virtual void ToFile(FILE* file) const = 0; 24 | virtual void EnableLog(bool value) = 0; 25 | virtual bool IsLogEnabled() const = 0; 26 | virtual const void* GetBuffer() const = 0; 27 | }; 28 | -------------------------------------------------------------------------------- /src/Overlay/NotificationBar/NotificationBar.cpp: -------------------------------------------------------------------------------- 1 | #include "NotificationBar.h" 2 | 3 | #include "Core/Settings.h" 4 | 5 | #include 6 | 7 | NotificationBar* g_notificationBar = new NotificationBar(); 8 | 9 | void NotificationBar::DrawNotifications() 10 | { 11 | if (m_notifications.empty()) 12 | return; 13 | 14 | if (ImGui::BeginMainMenuBar()) 15 | { 16 | m_screenWidth = ImGui::GetWindowWidth(); 17 | 18 | if (!m_isTextOffsetInitialized) 19 | { 20 | CalculateTextStartingOffset(m_notifications.front().c_str()); 21 | m_isTextOffsetInitialized = true; 22 | } 23 | 24 | ImGui::SetCursorPosX(m_textOffset); 25 | ImGui::TextUnformatted(m_notifications.front().c_str()); 26 | 27 | ImGui::EndMainMenuBar(); 28 | } 29 | 30 | m_textOffset -= ImGui::GetIO().DeltaTime * (m_screenWidth / m_secondsToSlide); 31 | 32 | bool isTextOffscreen = m_textOffset < -m_textWidth; 33 | if (isTextOffscreen) 34 | { 35 | m_notifications.pop(); 36 | m_isTextOffsetInitialized = false; 37 | } 38 | } 39 | 40 | void NotificationBar::AddNotification(const char* text, ...) 41 | { 42 | if (!Settings::settingsIni.notifications) 43 | return; 44 | 45 | va_list args; 46 | va_start(args, text); 47 | 48 | const int size = std::vsnprintf(nullptr, 0, text, args) + 1; 49 | std::string msg(size, ' '); 50 | 51 | vsprintf(&msg[0], text, args); 52 | va_end(args); 53 | 54 | m_notifications.push(msg); 55 | } 56 | 57 | void NotificationBar::ClearNotifications() 58 | { 59 | m_notifications = {}; 60 | m_isTextOffsetInitialized = false; 61 | } 62 | 63 | void NotificationBar::CalculateTextStartingOffset(const std::string& text) 64 | { 65 | ImGui::TextColored(ImVec4(0, 0, 0, 0), text.c_str()); 66 | m_textWidth = ImGui::GetItemRectSize().x; 67 | m_textOffset = m_screenWidth; 68 | } 69 | -------------------------------------------------------------------------------- /src/Overlay/NotificationBar/NotificationBar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Overlay/Window/DebugWindow.h" 4 | 5 | #include 6 | #include 7 | 8 | class NotificationBar; 9 | 10 | extern NotificationBar* g_notificationBar; 11 | 12 | class NotificationBar 13 | { 14 | public: 15 | void DrawNotifications(); 16 | void AddNotification(const char* text, ...); 17 | void ClearNotifications(); 18 | 19 | private: 20 | void CalculateTextStartingOffset(const std::string& text); 21 | 22 | std::queue m_notifications; 23 | 24 | bool m_isTextOffsetInitialized = false; 25 | float m_textOffset = 0; 26 | float m_textWidth = 0; 27 | float m_screenWidth = 0; 28 | float m_secondsToSlide = 7; 29 | 30 | // For debug purposes 31 | friend class DebugWindow; 32 | }; 33 | -------------------------------------------------------------------------------- /src/Overlay/Widget/ActiveGameModeWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "ActiveGameModeWidget.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Game/gamestates.h" 5 | 6 | #include 7 | 8 | void ActiveGameModeWidget() 9 | { 10 | ImGui::BeginGroup(); 11 | 12 | bool isOnlineMatch = g_interfaces.pRoomManager->IsRoomFunctional(); 13 | std::string activeGameMode; 14 | 15 | if (isOnlineMatch) 16 | { 17 | CustomGameMode currentGameMode = g_interfaces.pOnlineGameModeManager->GetSettledGameModeChoice(); 18 | activeGameMode = g_interfaces.pGameModeManager->GetGameModeName(currentGameMode); 19 | } 20 | else 21 | { 22 | activeGameMode = g_interfaces.pGameModeManager->GetCurrentGameModeName(); 23 | } 24 | 25 | ImGui::Text("ACTIVE GAME MODE: %s", activeGameMode.c_str()); 26 | 27 | if (isOnlineMatch && isOnCharacterSelectionScreen()) 28 | { 29 | const std::string player1SelectedGameMode = g_interfaces.pGameModeManager->GetGameModeName( 30 | g_interfaces.pOnlineGameModeManager->GetPlayer1GameModeChoice() 31 | ); 32 | 33 | const std::string player2SelectedGameMode = g_interfaces.pGameModeManager->GetGameModeName( 34 | g_interfaces.pOnlineGameModeManager->GetPlayer2GameModeChoice() 35 | ); 36 | 37 | // As spectator show both P1 and P2 selection 38 | if (g_interfaces.pRoomManager->IsThisPlayerSpectator()) 39 | { 40 | ImGui::Text("Player 1 selection: %s", player1SelectedGameMode.c_str()); 41 | ImGui::Text("Player 2 selection: %s", player2SelectedGameMode.c_str()); 42 | } 43 | else // As P1 or P2 only show the opponent's selection 44 | { 45 | const std::string& opponentSelectedMode = g_interfaces.pRoomManager->GetThisPlayerMatchPlayerIndex() 46 | ? player1SelectedGameMode 47 | : player2SelectedGameMode; 48 | 49 | ImGui::Text("Opponent selection: %s", opponentSelectedMode.c_str()); 50 | } 51 | } 52 | 53 | ImGui::EndGroup(); 54 | } 55 | -------------------------------------------------------------------------------- /src/Overlay/Widget/ActiveGameModeWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void ActiveGameModeWidget(); 4 | -------------------------------------------------------------------------------- /src/Overlay/Widget/GameModeSelectWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "GameModeSelectWidget.h" 2 | 3 | #include "Core/interfaces.h" 4 | 5 | #include 6 | 7 | void GameModeSelectWidget() 8 | { 9 | ImGui::BeginGroup(); 10 | 11 | ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); 12 | ImGui::BeginChild("GameModeSelection", ImVec2(200, 210), true); 13 | 14 | ImGui::TextUnformatted("Select game mode:"); 15 | for (int i = 0; i < g_interfaces.pGameModeManager->GetGameModesCount(); i++) 16 | { 17 | std::string gameModeName = g_interfaces.pGameModeManager->GetGameModeName((CustomGameMode)i); 18 | std::string gameModeDesc = g_interfaces.pGameModeManager->GetGameModeDesc((CustomGameMode)i); 19 | 20 | if (ImGui::RadioButton(gameModeName.c_str(), (int*)&g_interfaces.pGameModeManager->GetActiveGameModeRef(), i)) 21 | { 22 | if (g_interfaces.pRoomManager->IsRoomFunctional()) 23 | { 24 | g_interfaces.pOnlineGameModeManager->SetThisPlayerGameMode(g_interfaces.pGameModeManager->GetActiveGameMode()); 25 | g_interfaces.pOnlineGameModeManager->SendGameModePacket(); 26 | } 27 | } 28 | 29 | if (ImGui::IsItemHovered() && !gameModeDesc.empty()) 30 | { 31 | ImGui::BeginTooltip(); 32 | ImGui::TextUnformatted(gameModeDesc.c_str()); 33 | ImGui::EndTooltip(); 34 | } 35 | } 36 | 37 | ImGui::EndChild(); 38 | ImGui::PopStyleVar(); 39 | 40 | ImGui::EndGroup(); 41 | } 42 | -------------------------------------------------------------------------------- /src/Overlay/Widget/GameModeSelectWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void GameModeSelectWidget(); 4 | -------------------------------------------------------------------------------- /src/Overlay/Widget/StageSelectWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "StageSelectWidget.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Game/gamestates.h" 5 | #include "Game/stages.h" 6 | #include "Overlay/imgui_utils.h" 7 | 8 | void StageSelectWidget() 9 | { 10 | if (g_gameVals.stageSelect_X != nullptr && 11 | g_gameVals.stageSelect_Y != nullptr) 12 | { 13 | static unsigned char selectedStage = 0; 14 | 15 | // Sync slider with the selected stage 16 | for (int i = 0; i < STAGES_COUNT; i++) 17 | { 18 | if (stages[i][0] == *g_gameVals.stageSelect_X && 19 | stages[i][1] == *g_gameVals.stageSelect_Y) 20 | { 21 | selectedStage = i; 22 | break; 23 | } 24 | } 25 | 26 | ImGui::AlignTextToFramePadding(); 27 | ImGui::TextUnformatted("Stage"); ImGui::SameLine(); 28 | if (ImGui::SliderByte("##Stage", &selectedStage, 0, STAGES_COUNT - 1)) 29 | { 30 | *g_gameVals.stageSelect_X = stages[selectedStage][0]; 31 | *g_gameVals.stageSelect_Y = stages[selectedStage][1]; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Overlay/Widget/StageSelectWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void StageSelectWidget(); 4 | -------------------------------------------------------------------------------- /src/Overlay/Window/ComboDataWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "ComboDataWindow.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Core/Settings.h" 5 | #include "Core/utils.h" 6 | #include "Game/gamestates.h" 7 | #include "Core/info.h" 8 | 9 | 10 | void ComboDataWindow::Draw() { 11 | DrawMainSection(); 12 | } 13 | 14 | void ComboDataWindow::DrawMainSection() { 15 | if (!g_interfaces.player1.IsCharDataNullPtr() && !g_interfaces.player2.IsCharDataNullPtr()) { 16 | CharData* p1 = g_interfaces.player1.GetData(); 17 | CharData* p2 = g_interfaces.player2.GetData(); 18 | auto starter_rating = ""; int histun_decay = 0; 19 | static int player_radio = 0; 20 | ImGui::RadioButton("P1", &player_radio, 0); 21 | ImGui::SameLine(); 22 | ImGui::RadioButton("P2", &player_radio, 1); 23 | //make it clearer later 24 | if (player_radio == 0) { 25 | p1 = g_interfaces.player1.GetData(); 26 | p2 = g_interfaces.player2.GetData(); 27 | } 28 | else { 29 | p1 = g_interfaces.player2.GetData(); 30 | p2 = g_interfaces.player1.GetData(); 31 | } 32 | if (p2->starterRating == 1) { 33 | starter_rating = "short"; 34 | } 35 | else if (p2->starterRating == 2) { 36 | starter_rating = "normal"; 37 | } 38 | else if (p2->starterRating == 3) { 39 | starter_rating = "long"; 40 | } 41 | else { starter_rating = ""; } 42 | if (p2->comboTime > 660) { 43 | histun_decay = -100000; 44 | } 45 | else if (p2->comboTime > 480) { 46 | histun_decay = -10; 47 | } 48 | else if (p2->comboTime > 300) { 49 | histun_decay = -5; 50 | } 51 | else if (p2->comboTime > 120) { 52 | histun_decay = -2; 53 | } 54 | ImGui::Text("Starter Rating: %s", starter_rating); 55 | ImGui::Text("Combo Time: %d", p2->comboTime); 56 | ImGui::Text("Hitstun: %d", p2->hitstun); 57 | ImGui::Text("Hitstun Decay: %dF", histun_decay); 58 | ImGui::Text("Combo Proration: %d", p2->comboProration); 59 | ImGui::Text("Heat Generated: %d", p2->heatGeneratedForCombo); 60 | if (ImGui::TreeNode("Same Move Proration Stack")) { 61 | char* smp_stack_location = p2->sameMoveProrationStack; 62 | for (int iter = 0; iter < 5; iter++) { 63 | 64 | ImGui::Text("%s", smp_stack_location); 65 | smp_stack_location += 32; 66 | } 67 | ImGui::TreePop(); 68 | } 69 | if (ImGui::Button(" + ")) { 70 | ImGui::SetWindowFontScale(1.8f); 71 | } 72 | ImGui::SameLine(); 73 | if (ImGui::Button(" - ")) { 74 | ImGui::SetWindowFontScale(1.0f); 75 | } 76 | //ImGui::Text("Heat from combo2: %d", p1->heatGeneratedForCombo); 77 | 78 | } 79 | } -------------------------------------------------------------------------------- /src/Overlay/Window/ComboDataWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma once 3 | #include "IWindow.h" 4 | 5 | class ComboDataWindow : public IWindow 6 | { 7 | public: 8 | ComboDataWindow(const std::string& windowTitle, bool windowClosable, 9 | ImGuiWindowFlags windowFlags = 0) 10 | : IWindow(windowTitle, windowClosable, windowFlags) {} 11 | ~ComboDataWindow() override = default; 12 | 13 | protected: 14 | void Draw() override; 15 | private: 16 | void DrawMainSection(); 17 | }; 18 | -------------------------------------------------------------------------------- /src/Overlay/Window/DebugWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | class DebugWindow : public IWindow 5 | { 6 | public: 7 | DebugWindow(const std::string& windowTitle, bool windowClosable, 8 | ImGuiWindowFlags windowFlags = 0) 9 | : IWindow(windowTitle, windowClosable, windowFlags) {} 10 | ~DebugWindow() override = default; 11 | 12 | protected: 13 | void Draw() override; 14 | 15 | private: 16 | void DrawImGuiSection(); 17 | void DrawGameValuesSection(); 18 | void DrawRoomSection(); 19 | void DrawSettingsSection(); 20 | void DrawNotificationSection(); 21 | 22 | bool m_showDemoWindow = false; 23 | }; 24 | -------------------------------------------------------------------------------- /src/Overlay/Window/FrameAdvantage/FrameAdvantage.cpp: -------------------------------------------------------------------------------- 1 | #include "FrameAdvantage.h" 2 | 3 | #include "Game/CharData.h" 4 | #include "Core/interfaces.h" 5 | #include "Game/gamestates.h" 6 | 7 | PlayersInteractionState playersInteraction; 8 | PlayerExtendedData player1; 9 | PlayerExtendedData player2; 10 | 11 | void getFrameAdvantage(const PlayerExtendedData& player1, const PlayerExtendedData& player2) 12 | { 13 | bool isIdle1 = player1.isIdle(); 14 | bool isIdle2 = player2.isIdle(); 15 | bool isStunned = player2.isBlocking() || player2.isInHitstun(); 16 | 17 | if (!isIdle1 && !isIdle2) 18 | { 19 | playersInteraction.started = true; 20 | playersInteraction.timer = 0; 21 | } 22 | if (playersInteraction.started) 23 | { 24 | if (isIdle1 && isIdle2) 25 | { 26 | playersInteraction.started = false; 27 | playersInteraction.frameAdvantageToDisplay = playersInteraction.timer; 28 | } 29 | if (!isIdle1) 30 | { 31 | playersInteraction.timer -= 1; 32 | } 33 | if (!isIdle2) 34 | { 35 | playersInteraction.timer += 1; 36 | } 37 | } 38 | } 39 | 40 | void computeGaps(const PlayerExtendedData& player, int& gapCounter, int& gapResult) 41 | { 42 | playersInteraction.inBlockstring = player.isBlocking() || player.isInHitstun(); 43 | 44 | if (playersInteraction.inBlockstring) 45 | { 46 | if (gapCounter > 0 && gapCounter <= 30) 47 | { 48 | gapResult = gapCounter; 49 | } 50 | gapCounter = 0; //resets everytime you are in block or hit stun 51 | } 52 | else if (!playersInteraction.inBlockstring) 53 | { 54 | ++gapCounter; 55 | gapResult = -1; 56 | } 57 | } 58 | 59 | bool hasWorldTimeMoved() 60 | { 61 | if (playersInteraction.prevFrameCount < *g_gameVals.pFrameCount) 62 | { 63 | playersInteraction.prevFrameCount = *g_gameVals.pFrameCount; 64 | return true; 65 | } 66 | 67 | playersInteraction.prevFrameCount = *g_gameVals.pFrameCount; 68 | return false; 69 | } 70 | 71 | void computeFramedataInteractions() 72 | { 73 | if (!isInMatch && !(*g_gameVals.pGameMode == GameMode_Training || *g_gameVals.pGameMode == GameMode_ReplayTheater)) 74 | return; 75 | 76 | if (!g_interfaces.player1.IsCharDataNullPtr() && !g_interfaces.player2.IsCharDataNullPtr()) 77 | { 78 | player1.updateCharData(g_interfaces.player1); 79 | player2.updateCharData(g_interfaces.player2); 80 | 81 | if (hasWorldTimeMoved()) 82 | { 83 | computeGaps(player1, playersInteraction.p1Gap, playersInteraction.p1GapDisplay); 84 | computeGaps(player2, playersInteraction.p2Gap, playersInteraction.p2GapDisplay); 85 | getFrameAdvantage(player1, player2); 86 | 87 | player1.updatePreviousState(); 88 | player2.updatePreviousState(); 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /src/Overlay/Window/FrameAdvantage/FrameAdvantage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Game/CharData.h" 3 | #include "PlayerExtendedData.h" 4 | 5 | struct PlayersInteractionState 6 | { 7 | // World Time 8 | int prevFrameCount = 0; 9 | 10 | // Frame advantage 11 | int timer = 0; 12 | int frameAdvantageToDisplay = 0; 13 | bool started = false; 14 | 15 | // Gap 16 | bool inBlockstring = false; 17 | int p1Gap = -1; 18 | int p2Gap = -1; 19 | int p1GapDisplay = -1; 20 | int p2GapDisplay = -1; 21 | }; 22 | 23 | extern PlayersInteractionState playersInteraction; 24 | 25 | void getFrameAdvantage(const PlayerExtendedData& player1, const PlayerExtendedData& player2); 26 | void computeGaps(const PlayerExtendedData& player, int& gapCounter, int& gapResult); 27 | bool hasWorldTimeMoved(); 28 | void computeFramedataInteractions(); -------------------------------------------------------------------------------- /src/Overlay/Window/FrameAdvantage/PlayerExtendedData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Game/CharData.h" 3 | #include "Core\interfaces.h" 4 | 5 | #include 6 | 7 | struct IdleActionToggles 8 | { 9 | bool ukemiStaggerHit = false; 10 | }; 11 | 12 | class PlayerExtendedData 13 | { 14 | public: 15 | /** 16 | * PlayerExtendedData constructor. 17 | */ 18 | PlayerExtendedData(); 19 | 20 | /** 21 | * Updates the information of the current frame. 22 | */ 23 | void updateCharData(const Player& player); 24 | 25 | /** 26 | * Updates the useful information of the previous frame. 27 | */ 28 | void updatePreviousState(); 29 | 30 | /** 31 | * @return true if the character is considered to be in an idle action. 32 | */ 33 | bool isIdle() const; 34 | 35 | /** 36 | * @return true if the character is blocking. 37 | */ 38 | bool isBlocking() const; 39 | 40 | /** 41 | * @return true if the character is being hit or thrown. 42 | */ 43 | bool isInHitstun() const; 44 | 45 | /** 46 | * @return true if the character is touching the ground (y = 0). 47 | * Note that this doesn't equal to being grounded, as the character at y = 0 one frame before actually landing. 48 | */ 49 | bool isAirborne() const; 50 | 51 | /** 52 | * @return true if the character is moving on the y axis. Complements isAirborne for checking if a character 53 | * is static or not in the air. 54 | */ 55 | bool isMovingVertically() const; 56 | 57 | private: 58 | CharData* charData; 59 | std::string previousAction; 60 | int32_t previousPositionY; 61 | }; 62 | 63 | extern IdleActionToggles idleActionToggles; -------------------------------------------------------------------------------- /src/Overlay/Window/HitboxOverlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | #include "Game/CharData.h" 5 | 6 | #include 7 | #include 8 | 9 | typedef unsigned int uint32_t; 10 | 11 | class HitboxOverlay : public IWindow 12 | { 13 | public: 14 | bool drawOriginLine = false; 15 | bool drawCharacterHitbox[2] = {true, true}; 16 | 17 | HitboxOverlay(const std::string& windowTitle, bool windowClosable, 18 | ImGuiWindowFlags windowFlags) 19 | : IWindow(windowTitle, windowClosable, windowFlags) {} 20 | void Update() override; 21 | float& GetScale(); 22 | void DrawRectThicknessSlider(); 23 | void DrawRectFillTransparencySlider(); 24 | bool HasNullptrInData(); 25 | 26 | protected: 27 | void BeforeDraw() override; 28 | void Draw() override; 29 | void AfterDraw() override; 30 | 31 | private: 32 | void fixAspectRatio(ImVec2& point); 33 | void DrawOriginLine(ImVec2 worldPos, float rotationRad); 34 | void DrawCollisionAreas(const CharData* charObj, const ImVec2 playerWorldPos); 35 | 36 | bool IsOwnerEnabled(CharData* ownerCharInfo); 37 | bool WorldToScreen(LPDIRECT3DDEVICE9 pDevice, D3DXMATRIX* view, D3DXMATRIX* proj, D3DXVECTOR3* pos, D3DXVECTOR3* out); 38 | ImVec2 CalculateObjWorldPosition(const CharData* charObj); 39 | ImVec2 CalculateScreenPosition(ImVec2 worldPos); 40 | ImVec2 RotatePoint(ImVec2 center, float angleInRad, ImVec2 point); 41 | 42 | void RenderLine(const ImVec2& from, const ImVec2& to, uint32_t color, float thickness = 1.0f); 43 | void RenderCircle(const ImVec2& position, float radius, uint32_t color, float thickness = 1.0f, uint32_t segments = 16); 44 | void RenderCircleFilled(const ImVec2& position, float radius, uint32_t color, uint32_t segments = 16); 45 | void RenderRect(const ImVec2& pointA, const ImVec2& pointB, const ImVec2& pointC, const ImVec2& pointD, uint32_t color, float thickness = 1.0f); 46 | void RenderRect(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All, float thickness = 1.0f); 47 | void RenderRectFilled(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All); 48 | void RenderRectFilled(const ImVec2& pointA, const ImVec2& pointB, const ImVec2& pointC, const ImVec2& pointD, uint32_t color); 49 | 50 | // Literally a magic number as of now 51 | float m_scale = 0.346f; 52 | float m_rectThickness = 2.5f; 53 | float m_rectFillTransparency = 0.5f; 54 | 55 | // Aspect ratio fixes 56 | ImGuiIO io; 57 | const float aspectRatio = 5.0f / 3.0f; 58 | float displayRatio; 59 | const char* aspectRatioAddress; 60 | 61 | ImGuiWindowFlags m_overlayWindowFlags = ImGuiWindowFlags_NoTitleBar 62 | | ImGuiWindowFlags_NoInputs 63 | | ImGuiWindowFlags_NoBringToFrontOnFocus 64 | | ImGuiWindowFlags_NoFocusOnAppearing; 65 | }; 66 | -------------------------------------------------------------------------------- /src/Overlay/Window/IWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "IWindow.h" 2 | 3 | void IWindow::Update() 4 | { 5 | if (!m_windowOpen) 6 | { 7 | return; 8 | } 9 | 10 | BeforeDraw(); 11 | 12 | ImGui::Begin(m_windowTitle.c_str(), GetWindowOpenPointer(), m_windowFlags); 13 | Draw(); 14 | ImGui::End(); 15 | 16 | AfterDraw(); 17 | } 18 | 19 | void IWindow::Open() 20 | { 21 | m_windowOpen = true; 22 | } 23 | 24 | void IWindow::Close() 25 | { 26 | m_windowOpen = false; 27 | } 28 | 29 | void IWindow::ToggleOpen() 30 | { 31 | m_windowOpen = !m_windowOpen; 32 | } 33 | 34 | bool IWindow::IsOpen() const 35 | { 36 | return m_windowOpen; 37 | } 38 | 39 | void IWindow::SetWindowFlag(ImGuiWindowFlags flag) 40 | { 41 | m_windowFlags |= flag; 42 | } 43 | 44 | void IWindow::ClearWindowFlag(ImGuiWindowFlags flag) 45 | { 46 | m_windowFlags &= ~flag; 47 | } 48 | 49 | bool * IWindow::GetWindowOpenPointer() 50 | { 51 | if (m_windowClosable) 52 | { 53 | return &m_windowOpen; 54 | } 55 | 56 | return nullptr; 57 | } 58 | -------------------------------------------------------------------------------- /src/Overlay/Window/IWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class IWindow 7 | { 8 | public: 9 | IWindow(const std::string& windowTitle, bool windowClosable, ImGuiWindowFlags windowFlags = 0) 10 | : m_windowTitle(windowTitle), 11 | m_windowClosable(windowClosable), 12 | m_windowFlags(windowFlags) {} 13 | virtual ~IWindow() = default; 14 | virtual void Update(); 15 | void Open(); 16 | void Close(); 17 | void ToggleOpen(); 18 | bool IsOpen() const; 19 | void SetWindowFlag(ImGuiWindowFlags flag); 20 | void ClearWindowFlag(ImGuiWindowFlags flag); 21 | protected: 22 | virtual void BeforeDraw() {} 23 | virtual void Draw() = 0; 24 | virtual void AfterDraw() {} 25 | private: 26 | bool* GetWindowOpenPointer(); 27 | protected: 28 | std::string m_windowTitle; 29 | bool m_windowClosable; 30 | ImGuiWindowFlags m_windowFlags; 31 | bool m_windowOpen = false; 32 | }; 33 | -------------------------------------------------------------------------------- /src/Overlay/Window/InputBufferWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | #include 4 | #include "Game/Scr/ScrStateReader.h" 5 | #include "Game/Playbacks/PlaybackManager.h" 6 | #include "Core/utils.h" 7 | #include 8 | #include 9 | #include "Game/CharData.h" 10 | class InputBufferWindow : public IWindow 11 | { 12 | public: 13 | InputBufferWindow(const std::string& windowTitle, bool windowClosable, 14 | int player_number, ImGuiWindowFlags windowFlags = 0) 15 | : IWindow(windowTitle, windowClosable, windowFlags), player_number(player_number) { 16 | } 17 | ~InputBufferWindow() override = default; 18 | void initialize_buffer_maps(CharData*); 19 | void draw_right_side_buffers(CharData* player_data); 20 | void draw_left_side_buffers(CharData* player_data); 21 | void draw_active_buffers(CharData* player_data); 22 | 23 | 24 | 25 | std::vector> input_buffer_map_right = {}; 26 | std::vector> input_buffer_map_left = {}; 27 | 28 | protected: 29 | void Draw() override; 30 | int player_number; 31 | }; -------------------------------------------------------------------------------- /src/Overlay/Window/LogWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "LogWindow.h" 2 | 3 | void LogWindow::BeforeDraw() 4 | { 5 | ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver); 6 | } 7 | 8 | void LogWindow::Draw() 9 | { 10 | if (ImGui::Button("Clear")) 11 | { 12 | m_logger.Clear(); 13 | } 14 | ImGui::SameLine(); 15 | bool copyPressed = ImGui::Button("Copy to clipboard"); 16 | ImGui::SameLine(); 17 | m_filter.Draw("Search", -100.0f); 18 | ImGui::Separator(); 19 | ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar); 20 | if (copyPressed) 21 | { 22 | ImGui::LogToClipboard(); 23 | m_logger.Log("[system] Log has been copied to clipboard\n"); 24 | } 25 | 26 | ImGuiLogBuffer* logBuffer = (ImGuiLogBuffer*)m_logger.GetBuffer(); 27 | if (m_filter.IsActive()) 28 | { 29 | const char* bufBegin = logBuffer->textBuffer.begin(); 30 | const char* line = bufBegin; 31 | for (int line_no = 0; line != NULL; line_no++) 32 | { 33 | const char* lineEnd = (line_no < logBuffer->lineOffsets.Size) ? bufBegin + logBuffer->lineOffsets[line_no] : NULL; 34 | if (m_filter.PassFilter(line, lineEnd)) 35 | { 36 | ImGui::TextUnformatted(line, lineEnd); 37 | } 38 | line = lineEnd && lineEnd[1] ? lineEnd + 1 : NULL; 39 | } 40 | } 41 | else 42 | { 43 | ImGui::TextUnformatted(logBuffer->textBuffer.begin()); 44 | } 45 | 46 | // Handle automatic scrolling 47 | if (m_prevScrollMaxY < ImGui::GetScrollMaxY()) 48 | { 49 | // Scroll down automatically only if we didnt scroll up or we closed the window 50 | if (m_prevScrollMaxY - 5 <= ImGui::GetScrollY()) 51 | { 52 | ImGui::SetScrollY(ImGui::GetScrollMaxY()); 53 | } 54 | m_prevScrollMaxY = ImGui::GetScrollMaxY(); 55 | } 56 | 57 | ImGui::EndChild(); 58 | } 59 | -------------------------------------------------------------------------------- /src/Overlay/Window/LogWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | #include "Overlay/Logger/ImGuiLogger.h" 4 | 5 | class LogWindow : public IWindow 6 | { 7 | public: 8 | LogWindow(const std::string& windowTitle, bool windowClosable, ImGuiLogger& logger, 9 | ImGuiWindowFlags windowFlags = 0) 10 | : IWindow(windowTitle, windowClosable, windowFlags), m_logger(logger) {} 11 | ~LogWindow() override = default; 12 | protected: 13 | void BeforeDraw() override; 14 | void Draw() override; 15 | private: 16 | ImGuiLogger& m_logger; 17 | ImGuiTextFilter m_filter; 18 | float m_prevScrollMaxY = 0; 19 | }; 20 | -------------------------------------------------------------------------------- /src/Overlay/Window/MainWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | #include "Overlay/WindowContainer/WindowContainer.h" 5 | 6 | class MainWindow : public IWindow 7 | { 8 | public: 9 | MainWindow(const std::string& windowTitle, bool windowClosable, 10 | WindowContainer& windowContainer, ImGuiWindowFlags windowFlags = 0); 11 | 12 | ~MainWindow() override = default; 13 | 14 | protected: 15 | void BeforeDraw() override; 16 | void Draw() override; 17 | 18 | private: 19 | void DrawUtilButtons() const; 20 | void DrawCurrentPlayersCount() const; 21 | void DrawLinkButtons() const; 22 | void DrawLoadedSettingsValuesSection() const; 23 | void DrawCustomPalettesSection() const; 24 | void DrawHitboxOverlaySection() const; 25 | void DrawGameplaySettingSection() const; 26 | void DrawAvatarSection() const; 27 | void DrawFrameAdvantageSection() const; 28 | void DrawControllerSettingSection() const; 29 | 30 | const ImVec2 BTN_SIZE = ImVec2(60, 20); 31 | WindowContainer* m_pWindowContainer = nullptr; 32 | }; 33 | -------------------------------------------------------------------------------- /src/Overlay/Window/PlaybackEditorWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | #include "Game/Playbacks/PlaybackManager.h" 4 | #include "Game/Playbacks/PlaybackSlot.h" 5 | #include 6 | 7 | class PlaybackEditorWindow : public IWindow 8 | { 9 | public: 10 | PlaybackEditorWindow(const std::string& windowTitle, bool windowClosable, 11 | ImGuiWindowFlags windowFlags = 0) 12 | : IWindow(windowTitle, windowClosable, windowFlags), m_origWindowTitle(windowTitle), playback_manager() 13 | { 14 | } 15 | 16 | ~PlaybackEditorWindow() override = default; 17 | std::string interpret_move_absolute(char move); 18 | std::string interpret_move_L_R(char move, int side); 19 | 20 | PlaybackManager playback_manager; 21 | //std::vector::iterator line_edit_ptr; 22 | char* line_edit_ptr=nullptr; 23 | 24 | protected: 25 | void Draw() override; 26 | void DrawEditLinePopup(char* line); 27 | //void DrawEditLinePopup(); 28 | 29 | private: 30 | 31 | 32 | const std::string m_origWindowTitle; 33 | }; 34 | -------------------------------------------------------------------------------- /src/Overlay/Window/ReplayDBPopupWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "ReplayDBPopupWindow.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Core/Settings.h" 5 | #include "Core/utils.h" 6 | 7 | #include "Core/info.h" 8 | #include "Overlay/imgui_utils.h" 9 | #include 10 | 11 | 12 | 13 | 14 | 15 | void ReplayDBPopupWindow::Draw() 16 | { 17 | ImVec4 black = ImVec4(0.060, 0.060, 0.060, 1); 18 | ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 1.0f); 19 | ImGui::PushStyleColor(ImGuiCol_PopupBg, black); 20 | ImGui::OpenPopup("Enable/Disable Automatic Replay Uploads?"); 21 | 22 | ImVec2 center = ImVec2(ImGui::GetIO().DisplaySize.x * 0.5f, ImGui::GetIO().DisplaySize.y * 0.5f); 23 | const ImVec2 buttonSize = ImVec2(120, 23); 24 | ImGui::SetNextWindowPosCenter(ImGuiCond_Appearing); 25 | 26 | ImGui::BeginPopupModal("Enable/Disable Automatic Replay Uploads?", NULL, ImGuiWindowFlags_AlwaysAutoResize); 27 | 28 | const char txt[] = "\n\ 29 | IM BOBLEIS has a feature to automatically upload your replays to a public central repository. \n\ 30 | This feature allows : \n\ 31 | \n\ 32 | \t - Easy Sharing : Facilitates sharing of replays between players. \n\ 33 | \t - Community Sharing : Contribute to a collection of matches for learning and analysis.\n\ 34 | \t - Cataloging : Easily search by characters for matchups. \n\ 35 | \t - Storage : Keep your replays backed up automatically after the 100 limit.\n\ 36 | \n\ 37 | You can access the database using the Replay Database button on the IM main menu.\n\ 38 | \n\ 39 | If you disable it your replays won't be uploaded even if matched with someone with it enabled. \n\ 40 | \n\ 41 | If you wish to turn it off/on again you can access this menu using the button on the IM main \n\ 42 | menu or using settings.ini.\n\ 43 | \n\ 44 | This has no impact on performance or stability. \n\ 45 | \n\ 46 | Would you like to leave automatic replay uploads on or turn it off? \n"; 47 | ImGui::TextUnformatted(txt); 48 | ImGui::Separator(); 49 | ImGui::AlignItemHorizontalCenter(buttonSize.x); 50 | if (ImGui::Button("ON##dbpopup", buttonSize)) { 51 | Settings::changeSetting("UploadReplayData", std::to_string(1)); 52 | Settings::loadSettingsFile(); 53 | g_modVals.uploadReplayData = 1; 54 | ImGui::CloseCurrentPopup(); 55 | Close(); 56 | } 57 | //ImGui::SameLine(); 58 | ImGui::AlignItemHorizontalCenter(buttonSize.x); 59 | if (ImGui::Button("OFF##dbpopup", buttonSize)) { 60 | Settings::changeSetting("UploadReplayData", std::to_string(0)); 61 | Settings::loadSettingsFile(); 62 | g_modVals.uploadReplayData = 0; 63 | ImGui::CloseCurrentPopup(); 64 | Close(); 65 | } 66 | ImGui::EndPopup(); 67 | ImGui::PopStyleColor(); 68 | ImGui::PopStyleVar(); 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/Overlay/Window/ReplayDBPopupWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | #include "Core/utils.h" 4 | #include "Overlay/WindowContainer/WindowContainer.h" 5 | 6 | class ReplayDBPopupWindow : public IWindow 7 | { 8 | public: 9 | ReplayDBPopupWindow(const std::string& windowTitle, bool windowClosable, 10 | WindowContainer& windowContainer, ImGuiWindowFlags windowFlags = 0) 11 | : IWindow(windowTitle, windowClosable, windowFlags), m_pWindowContainer(&windowContainer) {} 12 | ~ReplayDBPopupWindow() override = default; 13 | protected: 14 | void Draw(); 15 | WindowContainer* m_pWindowContainer = nullptr; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /src/Overlay/Window/RoomWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | #include 5 | 6 | class RoomWindow : public IWindow 7 | { 8 | public: 9 | RoomWindow(const std::string& windowTitle, bool windowClosable, 10 | ImGuiWindowFlags windowFlags = 0) 11 | : IWindow(windowTitle, windowClosable, windowFlags), m_origWindowTitle(windowTitle) 12 | { 13 | } 14 | 15 | ~RoomWindow() override = default; 16 | 17 | protected: 18 | void BeforeDraw() override; 19 | void Draw() override; 20 | 21 | private: 22 | void SetWindowTitleRoomType(const std::string& roomTypeName); 23 | void ShowClickableSteamUser(const char* playerName, const CSteamID& steamId) const; 24 | void DrawRoomImPlayers(); 25 | void DrawMatchImPlayers(); 26 | 27 | const std::string m_origWindowTitle; 28 | }; 29 | -------------------------------------------------------------------------------- /src/Overlay/Window/UpdateNotifierWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "UpdateNotifierWindow.h" 2 | 3 | #include "Core/info.h" 4 | #include "Overlay/imgui_utils.h" 5 | #include "Web/update_check.h" 6 | 7 | 8 | void UpdateNotifierWindow::BeforeDraw() 9 | { 10 | ImGui::SetNextWindowPosCenter(ImGuiCond_Once); 11 | ImGui::SetNextWindowSizeConstraints(ImVec2(400, 100), ImVec2(500, 500)); 12 | } 13 | 14 | void UpdateNotifierWindow::Draw() 15 | { 16 | ImGui::TextAlignedHorizontalCenter("BBCF Improvement Mod %s has been released!", GetNewVersionNum().c_str()); 17 | ImGui::Spacing(); 18 | 19 | ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 7)); 20 | 21 | const ImVec2 buttonSize = ImVec2(120, 23); 22 | ImGui::AlignItemHorizontalCenter(buttonSize.x); 23 | if (ImGui::ButtonUrl("Download", MOD_LINK_GITHUB, buttonSize)) 24 | { 25 | Close(); 26 | } 27 | 28 | ImGui::AlignItemHorizontalCenter(buttonSize.x); 29 | if (ImGui::Button("Remind me later", buttonSize)) 30 | { 31 | Close(); 32 | } 33 | 34 | ImGui::PopStyleVar(); 35 | 36 | ImGui::Spacing(); 37 | } 38 | -------------------------------------------------------------------------------- /src/Overlay/Window/UpdateNotifierWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | class UpdateNotifierWindow : public IWindow 5 | { 6 | public: 7 | UpdateNotifierWindow(const std::string& windowTitle, bool windowClosable, 8 | ImGuiWindowFlags windowFlags) 9 | : IWindow(windowTitle, windowClosable, windowFlags) {} 10 | ~UpdateNotifierWindow() override = default; 11 | protected: 12 | void BeforeDraw() override; 13 | void Draw() override; 14 | }; 15 | -------------------------------------------------------------------------------- /src/Overlay/WindowContainer/WindowContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "WindowContainer.h" 2 | 3 | #include "Overlay/Window/DebugWindow.h" 4 | #include "Overlay/Window/HitboxOverlay.h" 5 | #include "Overlay/Window/LogWindow.h" 6 | #include "Overlay/Window/MainWindow.h" 7 | #include "Overlay/Window/PaletteEditorWindow.h" 8 | #include "Overlay/Window/RoomWindow.h" 9 | #include "Overlay/Window/UpdateNotifierWindow.h" 10 | #include "Overlay/Window/ScrWindow.h" 11 | #include "Overlay/Window/InputBufferWindow.h" 12 | #include "Overlay/Window/PlaybackEditorWindow.h" 13 | #include "Overlay/Window/ComboDataWindow.h" 14 | #include "Overlay/Window/ReplayDBPopupWindow.h" 15 | 16 | #include "Core/info.h" 17 | #include "Core/logger.h" 18 | #include "Core/Settings.h" 19 | 20 | WindowContainer::WindowContainer() 21 | { 22 | AddWindow(WindowType_Main, 23 | new MainWindow(MOD_WINDOW_TITLE, false, *this, ImGuiWindowFlags_AlwaysAutoResize)); 24 | 25 | AddWindow(WindowType_Log, 26 | new LogWindow("Log", true, *(ImGuiLogger*)g_imGuiLogger, 27 | ImGuiWindowFlags_NoCollapse)); 28 | 29 | AddWindow(WindowType_Debug, 30 | new DebugWindow("DEBUG", true)); 31 | 32 | AddWindow(WindowType_UpdateNotifier, 33 | new UpdateNotifierWindow("Update available", true, 34 | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)); 35 | 36 | AddWindow(WindowType_PaletteEditor, 37 | new PaletteEditorWindow("Palette Editor", true)); 38 | 39 | AddWindow(WindowType_HitboxOverlay, 40 | new HitboxOverlay("##HitboxOverlay", false, ImGuiWindowFlags_NoCollapse)); 41 | 42 | AddWindow(WindowType_Room, 43 | new RoomWindow("Online###Room", true, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)); 44 | 45 | AddWindow(WindowType_Scr, 46 | new ScrWindow("States", true, *this)); 47 | 48 | AddWindow(WindowType_InputBufferP1, 49 | new InputBufferWindow("Input Buffer P1", true, 1)); 50 | 51 | AddWindow(WindowType_InputBufferP2, 52 | new InputBufferWindow("Input Buffer P2", true, 2)); 53 | 54 | AddWindow(WindowType_PlaybackEditor, 55 | new PlaybackEditorWindow("Playback Editor", true)); 56 | 57 | AddWindow(WindowType_ComboData, 58 | new ComboDataWindow("Combo Data", true, ImGuiWindowFlags_AlwaysAutoResize)); 59 | 60 | AddWindow(WindowType_ReplayDBPopup, 61 | new ReplayDBPopupWindow("Replay DB Popup", true, *this, ImGuiWindowFlags_NoTitleBar)); 62 | } 63 | -------------------------------------------------------------------------------- /src/Overlay/WindowContainer/WindowContainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WindowType.h" 3 | #include "Overlay/Window/IWindow.h" 4 | 5 | #include 6 | 7 | typedef std::map WindowMap; 8 | 9 | class WindowContainer 10 | { 11 | public: 12 | WindowContainer(); 13 | ~WindowContainer() 14 | { 15 | for (const auto& window : m_windows) 16 | { 17 | delete window.second; 18 | } 19 | } 20 | 21 | template 22 | T* GetWindow(WindowType_ type) { return (T*)m_windows[type]; } 23 | IWindow* GetWindow(WindowType_ type) { return m_windows[type]; } 24 | const WindowMap& GetWindows() const { return m_windows; } 25 | private: 26 | void AddWindow(WindowType_ type, IWindow* pWindow) { m_windows[type] = pWindow; } 27 | 28 | WindowMap m_windows; 29 | }; 30 | -------------------------------------------------------------------------------- /src/Overlay/WindowContainer/WindowType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum WindowType_ 4 | { 5 | WindowType_Main, 6 | WindowType_Debug, 7 | WindowType_Log, 8 | WindowType_UpdateNotifier, 9 | WindowType_PaletteEditor, 10 | WindowType_HitboxOverlay, 11 | WindowType_Room, 12 | WindowType_Scr, 13 | WindowType_InputBufferP1, 14 | WindowType_InputBufferP2, 15 | WindowType_PlaybackEditor, 16 | WindowType_ComboData, 17 | WindowType_ReplayDBPopup 18 | }; 19 | -------------------------------------------------------------------------------- /src/Overlay/WindowManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Logger/Logger.h" 3 | #include "WindowContainer/WindowContainer.h" 4 | 5 | #include 6 | 7 | class WindowManager 8 | { 9 | public: 10 | static WindowManager& GetInstance(); 11 | WindowContainer* GetWindowContainer() const { return m_windowContainer; } 12 | bool Initialize(void *hwnd, IDirect3DDevice9 *device); 13 | void Shutdown(); 14 | void Render(); 15 | void InvalidateDeviceObjects(); 16 | void CreateDeviceObjects(); 17 | bool IsInitialized() const { return m_initialized; } 18 | 19 | private: 20 | WindowManager() = default; 21 | void HandleButtons(); 22 | void DrawAllWindows() const; 23 | 24 | static WindowManager* m_instance; 25 | bool m_initialized = false; 26 | WindowContainer* m_windowContainer = nullptr; 27 | Logger* m_pLogger = nullptr; 28 | }; 29 | -------------------------------------------------------------------------------- /src/Overlay/fonts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern const char TinyFont_compressed_data_base85[10950 + 1]; 4 | 5 | extern const unsigned int DroidSans_compressed_size; 6 | extern const unsigned int DroidSans_compressed_data[134348 / 4]; 7 | 8 | extern const unsigned int mplusMedium_compressed_size; 9 | extern const unsigned int mplusMedium_compressed_data[1296932 / 4]; -------------------------------------------------------------------------------- /src/Overlay/imgui_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ImGui 7 | { 8 | IMGUI_API void HoverTooltip(const char* text); 9 | IMGUI_API bool ButtonUrl(const std::string& label, const wchar_t* url, const ImVec2& btnSize = ImVec2(0, 0)); 10 | IMGUI_API void TextAlignedHorizontalCenter(const char* text, ...); 11 | IMGUI_API void TextColoredAlignedHorizontalCenter(const ImVec4 color, const char* text); 12 | IMGUI_API void AlignItemHorizontalCenter(float itemWidth); 13 | IMGUI_API void Spacing(ImVec2& size); 14 | IMGUI_API void VerticalSpacing(float height = 1); 15 | IMGUI_API void HorizontalSpacing(float width = 1); 16 | 17 | IMGUI_API bool SliderByte(const char* label, unsigned char* v, unsigned char v_min, unsigned char v_max, const char* display_format = "%.0f"); 18 | IMGUI_API bool DragByte(const char* label, unsigned char* v, float v_speed, unsigned char v_min, unsigned char v_max, const char* display_format = "%.0f"); 19 | 20 | IMGUI_API bool ColorButtonIndexed(const char* desc_id, int idx, const ImVec4& col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0, 0)); 21 | IMGUI_API void ColorTooltipIndexed(const char* text, int idx, const float* col, ImGuiColorEditFlags flags); 22 | IMGUI_API bool ColorEdit4On32Bit(const char* label, int idx, unsigned char val[4], ImGuiColorEditFlags flags = 0); 23 | IMGUI_API bool ColorButtonOn32Bit(const char* desc_id, int idx, unsigned char val[4], ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0, 0)); 24 | IMGUI_API bool ColorPicker4On32Bit(const char* label, unsigned char col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL); 25 | IMGUI_API void ShowHelpMarker(const char* desc); 26 | } 27 | -------------------------------------------------------------------------------- /src/Palette/CharPaletteHandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Palette/impl_format.h" 3 | 4 | #define MAX_PAL_INDEX 23 5 | #define TOTAL_PALETTE_FILES 8 6 | 7 | extern char* palFileNames[TOTAL_PALETTE_FILES]; 8 | 9 | enum PaletteFile 10 | { 11 | PaletteFile_Character, 12 | PaletteFile_Effect1, 13 | PaletteFile_Effect2, 14 | PaletteFile_Effect3, 15 | PaletteFile_Effect4, 16 | PaletteFile_Effect5, 17 | PaletteFile_Effect6, 18 | PaletteFile_Effect7 19 | }; 20 | 21 | class CharPaletteHandle 22 | { 23 | friend class PaletteManager; 24 | 25 | int* m_pCurPalIndex; 26 | int m_origPalIndex; 27 | const char* m_pPalBaseAddr; 28 | IMPL_data_t m_origPalBackup; 29 | IMPL_data_t m_currentPalData; 30 | int m_switchPalIndex1; 31 | int m_switchPalIndex2; 32 | int m_selectedCustomPalIndex; 33 | bool m_updateLocked; 34 | 35 | public: 36 | void SetPointerPalIndex(int* pPalIdx); 37 | void SetPointerBasePal(char* pPalBaseAddr); 38 | bool IsNullPointerPalBasePtr(); 39 | bool IsNullPointerPalIndex(); 40 | int& GetPalIndexRef(); 41 | int GetOrigPalIndex() const; 42 | bool IsCurrentPalWithBloom() const; 43 | 44 | private: 45 | void SetPaletteIndex(int palIndex); 46 | void ReplacePalData(IMPL_data_t* newPaletteData); 47 | void OnMatchInit(); 48 | void OnMatchRematch(); 49 | void LockUpdate(); 50 | void UnlockUpdate(); 51 | int GetSelectedCustomPalIndex(); 52 | void SetSelectedCustomPalIndex(int index); 53 | const char* GetCurPalFileAddr(PaletteFile palFile); 54 | const char* GetOrigPalFileAddr(PaletteFile palFile); 55 | const IMPL_info_t& GetCurrentPalInfo() const; 56 | void SetCurrentPalInfo(IMPL_info_t* pPalInfo); 57 | const IMPL_data_t& GetCurrentPalData(); 58 | char* GetPalFileAddr(const char* base, int palIdx, int fileIdx); 59 | void ReplacePalArrayInMemory(char* Dst, const void* Src); 60 | void ReplaceSinglePalFile(const char* newPalData, PaletteFile palFile); 61 | void ReplaceAllPalFiles(IMPL_data_t* newPaletteData, int palIdx); 62 | void BackupOrigPal(); 63 | void RestoreOrigPal(); 64 | void UpdatePalette(); 65 | }; -------------------------------------------------------------------------------- /src/Palette/PaletteManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "impl_format.h" 3 | 4 | #include "CharPaletteHandle.h" 5 | 6 | #include "Game/characters.h" 7 | #include "Game/Player.h" 8 | 9 | #include 10 | 11 | class PaletteManager 12 | { 13 | public: 14 | PaletteManager(); 15 | ~PaletteManager(); 16 | std::vector> &GetCustomPalettesVector(); 17 | 18 | bool PushImplFileIntoVector(IMPL_t &filledPal); 19 | bool PushImplFileIntoVector(CharIndex charIndex, IMPL_data_t &filledPalData); 20 | bool WritePaletteToFile(CharIndex charIndex, IMPL_data_t *filledPalData); 21 | 22 | void LoadAllPalettes(); 23 | void ReloadAllPalettes(); 24 | 25 | int GetOnlinePalsStartIndex(CharIndex charIndex); 26 | void OverwriteIMPLDataPalName(std::string fileName, IMPL_data_t& palData); 27 | 28 | // Return values: 29 | // ret > 0, index found 30 | // ret == -1, index not found 31 | // ret == -2, charindex out of bound 32 | // ret == -3, default palette or no name given 33 | int FindCustomPalIndex(CharIndex charIndex, const char* palNameToFind); 34 | bool PaletteArchiveDownloaded(); 35 | bool SwitchPalette(CharIndex charIndex, CharPaletteHandle& palHandle, int newCustomPalIndex); 36 | void ReplacePaletteFile(const char* newPalData, PaletteFile palFile, CharPaletteHandle& palHandle); 37 | void RestoreOrigPal(CharPaletteHandle& palHandle); 38 | const char* GetCurPalFileAddr(PaletteFile palFile, CharPaletteHandle& palHandle); 39 | const char* GetCustomPalFile(CharIndex charIndex, int palIndex, PaletteFile palFile, CharPaletteHandle& palHandle); 40 | int GetCurrentCustomPalIndex(CharPaletteHandle& palHandle) const; 41 | const IMPL_info_t& GetCurrentPalInfo(CharPaletteHandle& palHandle) const; 42 | void SetCurrentPalInfo(CharPaletteHandle& palHandle, IMPL_info_t& palInfo); 43 | const IMPL_data_t& GetCurrentPalData(CharPaletteHandle& palHandle); 44 | void LoadPaletteSettingsFile(); 45 | 46 | // Call it ONCE per frame 47 | void OnUpdate(CharPaletteHandle& P1, CharPaletteHandle& P2); 48 | 49 | // Call it ONCE upon match start 50 | void OnMatchInit(Player& playerOne, Player& playerTwo); 51 | 52 | void OnMatchRematch(Player& playerOne, Player& playerTwo); 53 | void OnMatchEnd(CharPaletteHandle& playerOne, CharPaletteHandle& playerTwo); 54 | 55 | private: 56 | std::vector> m_customPalettes; 57 | std::vector> m_paletteSlots; 58 | std::vector m_onlinePalsStartIndex; 59 | bool m_loadOnlinePalettes = false; 60 | bool m_PaletteArchiveDownloaded = false; 61 | 62 | void CreatePaletteFolders(); 63 | void InitCustomPaletteVector(); 64 | void LoadPalettesIntoVector(CharIndex charIndex, std::wstring& wFolderPath); 65 | void LoadPalettesFromFolder(); 66 | void LoadImplFile(const std::string& fullPath, const std::string& fileName, CharIndex charIndex); 67 | void LoadHplFile(const std::string& fullPath, const std::string& fileName, CharIndex charIndex); 68 | void InitPaletteSlotsVector(); 69 | void InitOnlinePalsIndexVector(); 70 | void ApplyDefaultCustomPalette(CharIndex charIndex, CharPaletteHandle& charPalHandle); 71 | }; 72 | -------------------------------------------------------------------------------- /src/Palette/impl_format.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define IMPL_FILE_EXTENSION ".cfpl" 3 | #define IMPL_FILE_EXTENSION_W L".cfpl" 4 | #define IMPL_FILESIG "IMPLCF" 5 | #define IMPL_PALNAME_LENGTH 32 6 | #define IMPL_CREATOR_LENGTH 32 7 | #define IMPL_DESC_LENGTH 64 8 | #define IMPL_PALETTE_DATALEN 1024 9 | #define IMPL_PALETTE_FILES_COUNT 8 10 | 11 | struct IMPL_header_t 12 | { 13 | const char fileSig[8] = IMPL_FILESIG; 14 | int headerLen; 15 | int dataLen; 16 | short charIndex; 17 | short RESERVED = 0; // padding 18 | }; 19 | 20 | struct IMPL_info_t 21 | { 22 | char palName[IMPL_PALNAME_LENGTH] = {}; 23 | char creator[IMPL_CREATOR_LENGTH] = {}; 24 | char desc[IMPL_DESC_LENGTH] = {}; 25 | bool hasBloom = false; 26 | }; 27 | 28 | struct IMPL_data_t 29 | { 30 | IMPL_info_t palInfo = {}; 31 | char file0[IMPL_PALETTE_DATALEN]; 32 | char file1[IMPL_PALETTE_DATALEN]; 33 | char file2[IMPL_PALETTE_DATALEN]; 34 | char file3[IMPL_PALETTE_DATALEN]; 35 | char file4[IMPL_PALETTE_DATALEN]; 36 | char file5[IMPL_PALETTE_DATALEN]; 37 | char file6[IMPL_PALETTE_DATALEN]; 38 | char file7[IMPL_PALETTE_DATALEN]; 39 | }; 40 | 41 | struct IMPL_t 42 | { 43 | IMPL_header_t header = {}; 44 | IMPL_data_t palData = {}; 45 | }; 46 | -------------------------------------------------------------------------------- /src/Palette/impl_templates.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define LEGACY_HPL_FILE_EXTENSION ".hpl" 4 | #define LEGACY_HPL_HEADER_LEN 32 5 | #define LEGACY_HPL_DATALEN 1024 6 | 7 | //extern const char* implTemplates[]; 8 | -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamApiHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "SteamApiHelper.h" 2 | 3 | #include "Core/logger.h" 4 | #include "Overlay/Logger/ImGuiLogger.h" 5 | 6 | SteamApiHelper::SteamApiHelper(ISteamUserStats* pSteamUserStats, ISteamFriends* pSteamFriends) 7 | : m_pSteamUserStats(pSteamUserStats), m_pSteamFriends(pSteamFriends) 8 | { 9 | LOG(2, "SteamApiHelper::SteamApiHelper, *pSteamUserStats: 0x%p, *pSteamFriends: 0x%p\n", *pSteamUserStats, *pSteamFriends); 10 | 11 | UpdateNumberOfCurrentPlayers(); 12 | } 13 | 14 | // Make the asynchronous request to receive the number of current players. 15 | void SteamApiHelper::UpdateNumberOfCurrentPlayers() 16 | { 17 | SteamAPICall_t hSteamAPICall = m_pSteamUserStats->GetNumberOfCurrentPlayers(); 18 | m_numberOfCurrentPlayersCallResult.Set(hSteamAPICall, this, &SteamApiHelper::OnUpdateNumberOfCurrentPlayers); 19 | } 20 | 21 | // Callback for UpdateNumberOfCurrentPlayers() 22 | void SteamApiHelper::OnUpdateNumberOfCurrentPlayers(NumberOfCurrentPlayers_t* pCallback, bool bIOFailure) 23 | { 24 | if (bIOFailure || !pCallback->m_bSuccess) 25 | { 26 | g_imGuiLogger->Log("[error] Failed to update the current number of ingame players\n"); 27 | m_currentPlayersCount = -1; 28 | return; 29 | } 30 | 31 | #ifdef ENABLE_LOGGING 32 | g_imGuiLogger->Log("[debug] Updated the current number of ingame players: %d\n", pCallback->m_cPlayers); 33 | #endif 34 | 35 | m_currentPlayersCount = pCallback->m_cPlayers; 36 | } 37 | 38 | const int SteamApiHelper::GetCurrentPlayersCount() const 39 | { 40 | return m_currentPlayersCount; 41 | } 42 | 43 | std::string SteamApiHelper::GetCurrentPlayersCountString() const 44 | { 45 | return m_currentPlayersCount < 0 ? "" : std::to_string(m_currentPlayersCount); 46 | } 47 | 48 | bool SteamApiHelper::IsSteamOverlayActive() const 49 | { 50 | return m_isSteamOverlayActive; 51 | } 52 | 53 | void SteamApiHelper::OnGameOverlayActivated(GameOverlayActivated_t* callback) 54 | { 55 | m_isSteamOverlayActive = callback->m_bActive; 56 | } 57 | -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamApiHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class SteamApiHelper 7 | { 8 | public: 9 | SteamApiHelper(ISteamUserStats* pSteamUserStats, ISteamFriends* pSteamFriends); 10 | void UpdateNumberOfCurrentPlayers(); 11 | const int GetCurrentPlayersCount() const; 12 | std::string GetCurrentPlayersCountString() const; 13 | bool IsSteamOverlayActive() const; 14 | 15 | private: 16 | void OnUpdateNumberOfCurrentPlayers(NumberOfCurrentPlayers_t* pCallback, bool bIOFailure); 17 | CCallResult< SteamApiHelper, NumberOfCurrentPlayers_t > m_numberOfCurrentPlayersCallResult; 18 | 19 | STEAM_CALLBACK(SteamApiHelper, OnGameOverlayActivated, GameOverlayActivated_t); 20 | 21 | int m_currentPlayersCount = -1; 22 | bool m_isSteamOverlayActive = false; 23 | 24 | // Interfaces 25 | ISteamUserStats* m_pSteamUserStats; 26 | ISteamFriends* m_pSteamFriends; 27 | }; -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamMatchmakingWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | interface SteamMatchmakingWrapper : public ISteamMatchmaking 7 | { 8 | public: 9 | SteamMatchmakingWrapper(ISteamMatchmaking**); 10 | ~SteamMatchmakingWrapper(); 11 | 12 | ISteamMatchmaking* m_SteamMatchmaking; 13 | 14 | int GetFavoriteGameCount(); 15 | bool GetFavoriteGame(int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer); 16 | int AddFavoriteGame(AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer); 17 | bool RemoveFavoriteGame(AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags); 18 | CALL_RESULT(LobbyMatchList_t) SteamAPICall_t RequestLobbyList(); 19 | void AddRequestLobbyListStringFilter(const char *pchKeyToMatch, const char *pchValueToMatch, ELobbyComparison eComparisonType); 20 | void AddRequestLobbyListNumericalFilter(const char *pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType); 21 | void AddRequestLobbyListNearValueFilter(const char *pchKeyToMatch, int nValueToBeCloseTo); 22 | void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable); 23 | void AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter eLobbyDistanceFilter); 24 | void AddRequestLobbyListResultCountFilter(int cMaxResults); 25 | void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby); 26 | CSteamID GetLobbyByIndex(int iLobby); 27 | CALL_RESULT(LobbyCreated_t) SteamAPICall_t CreateLobby(ELobbyType eLobbyType, int cMaxMembers); 28 | CALL_RESULT(LobbyEnter_t) SteamAPICall_t JoinLobby(CSteamID steamIDLobby); 29 | void LeaveLobby(CSteamID steamIDLobby); 30 | bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee); 31 | int GetNumLobbyMembers(CSteamID steamIDLobby); 32 | CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, int iMember); 33 | const char *GetLobbyData(CSteamID steamIDLobby, const char *pchKey); 34 | bool SetLobbyData(CSteamID steamIDLobby, const char *pchKey, const char *pchValue); 35 | int GetLobbyDataCount(CSteamID steamIDLobby); 36 | bool GetLobbyDataByIndex(CSteamID steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize); 37 | bool DeleteLobbyData(CSteamID steamIDLobby, const char *pchKey); 38 | const char *GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey); 39 | void SetLobbyMemberData(CSteamID steamIDLobby, const char *pchKey, const char *pchValue); 40 | bool SendLobbyChatMsg(CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody); 41 | int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType); 42 | bool RequestLobbyData(CSteamID steamIDLobby); 43 | void SetLobbyGameServer(CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer); 44 | bool GetLobbyGameServer(CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, OUT_STRUCT() CSteamID *psteamIDGameServer); 45 | bool SetLobbyMemberLimit(CSteamID steamIDLobby, int cMaxMembers); 46 | int GetLobbyMemberLimit(CSteamID steamIDLobby); 47 | bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType); 48 | bool SetLobbyJoinable(CSteamID steamIDLobby, bool bLobbyJoinable); 49 | CSteamID GetLobbyOwner(CSteamID steamIDLobby); 50 | bool SetLobbyOwner(CSteamID steamIDLobby, CSteamID steamIDNewOwner); 51 | bool SetLinkedLobby(CSteamID steamIDLobby, CSteamID steamIDLobbyDependent); 52 | 53 | #ifdef _PS3 54 | void CheckForPSNGameBootInvite(unsigned int iGameBootAttributes); 55 | #endif 56 | CALL_BACK(LobbyChatUpdate_t) 57 | }; -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamNetworkingWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | interface SteamNetworkingWrapper : public ISteamNetworking 8 | { 9 | public: 10 | SteamNetworkingWrapper(ISteamNetworking**); 11 | ~SteamNetworkingWrapper(); 12 | 13 | ISteamNetworking* m_SteamNetworking; 14 | 15 | bool SendP2PPacket(CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0); 16 | bool IsP2PPacketAvailable(uint32 *pcubMsgSize, int nChannel = 0); 17 | bool ReadP2PPacket(void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote, int nChannel = 0); 18 | bool AcceptP2PSessionWithUser(CSteamID steamIDRemote); 19 | bool CloseP2PSessionWithUser(CSteamID steamIDRemote); 20 | bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel); 21 | bool GetP2PSessionState(CSteamID steamIDRemote, P2PSessionState_t *pConnectionState); 22 | bool AllowP2PPacketRelay(bool bAllow); 23 | SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay); 24 | SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay); 25 | SNetSocket_t CreateConnectionSocket(uint32 nIP, uint16 nPort, int nTimeoutSec); 26 | bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd); 27 | bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd); 28 | bool SendDataOnSocket(SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable); 29 | bool IsDataAvailableOnSocket(SNetSocket_t hSocket, uint32 *pcubMsgSize); 30 | bool RetrieveDataFromSocket(SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize); 31 | bool IsDataAvailable(SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket); 32 | bool RetrieveData(SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket); 33 | bool GetSocketInfo(SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote); 34 | bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort); 35 | ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket); 36 | int GetMaxPacketSize(SNetSocket_t hSocket); 37 | }; -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamUserWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | interface SteamUserWrapper : public ISteamUser 7 | { 8 | public: 9 | SteamUserWrapper(ISteamUser**); 10 | ~SteamUserWrapper(); 11 | 12 | ISteamUser* m_SteamUser; 13 | 14 | HSteamUser GetHSteamUser(); 15 | bool BLoggedOn(); 16 | CSteamID GetSteamID(); 17 | int InitiateGameConnection(void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure); 18 | void TerminateGameConnection(uint32 unIPServer, uint16 usPortServer); 19 | void TrackAppUsageEvent(CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = ""); 20 | bool GetUserDataFolder(char *pchBuffer, int cubBuffer); 21 | void StartVoiceRecording(); 22 | void StopVoiceRecording(); 23 | EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0); 24 | EVoiceResult GetVoice(bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed_Deprecated = false, void *pUncompressedDestBuffer_Deprecated = 0, uint32 cbUncompressedDestBufferSize_Deprecated = 0, uint32 *nUncompressBytesWritten_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0); 25 | EVoiceResult DecompressVoice(const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate); 26 | uint32 GetVoiceOptimalSampleRate(); 27 | HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket); 28 | EBeginAuthSessionResult BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID); 29 | void EndAuthSession(CSteamID steamID); 30 | void CancelAuthTicket(HAuthTicket hAuthTicket); 31 | EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID); 32 | bool BIsBehindNAT(); 33 | void AdvertiseGame(CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer); 34 | CALL_RESULT(EncryptedAppTicketResponse_t) 35 | SteamAPICall_t RequestEncryptedAppTicket(void *pDataToInclude, int cbDataToInclude); 36 | bool GetEncryptedAppTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket); 37 | int GetGameBadgeLevel(int nSeries, bool bFoil); 38 | int GetPlayerSteamLevel(); 39 | CALL_RESULT(StoreAuthURLResponse_t) 40 | SteamAPICall_t RequestStoreAuthURL(const char *pchRedirectURL); 41 | bool BIsPhoneVerified(); 42 | bool BIsTwoFactorEnabled(); 43 | bool BIsPhoneIdentifying(); 44 | bool BIsPhoneRequiringVerification(); 45 | }; -------------------------------------------------------------------------------- /src/SteamApiWrapper/SteamUtilsWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | interface SteamUtilsWrapper : public ISteamUtils 7 | { 8 | public: 9 | SteamUtilsWrapper(ISteamUtils**); 10 | ~SteamUtilsWrapper(); 11 | 12 | ISteamUtils* m_SteamUtils; 13 | 14 | uint32 GetSecondsSinceAppActive(); 15 | uint32 GetSecondsSinceComputerActive(); 16 | EUniverse GetConnectedUniverse(); 17 | uint32 GetServerRealTime(); 18 | const char *GetIPCountry(); 19 | bool GetImageSize(int iImage, uint32 *pnWidth, uint32 *pnHeight); 20 | bool GetImageRGBA(int iImage, uint8 *pubDest, int nDestBufferSize); 21 | bool GetCSERIPPort(uint32 *unIP, uint16 *usPort); 22 | uint8 GetCurrentBatteryPower(); 23 | uint32 GetAppID(); 24 | void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition); 25 | bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, bool *pbFailed); 26 | ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall); 27 | bool GetAPICallResult(SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed); 28 | // Deprecated. Applications should use SteamAPI_RunCallbacks() instead. Game servers do not need to call this function. 29 | STEAM_PRIVATE_API(void RunFrame(); ) 30 | uint32 GetIPCCallCount(); 31 | void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction); 32 | bool IsOverlayEnabled(); 33 | bool BOverlayNeedsPresent(); 34 | CALL_RESULT(CheckFileSignature_t) 35 | SteamAPICall_t CheckFileSignature(const char *szFileName); 36 | bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char *pchDescription, uint32 unCharMax, const char *pchExistingText); 37 | uint32 GetEnteredGamepadTextLength(); 38 | bool GetEnteredGamepadTextInput(char *pchText, uint32 cchText); 39 | const char *GetSteamUILanguage(); 40 | bool IsSteamRunningInVR(); 41 | void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset); 42 | bool IsSteamInBigPictureMode(); 43 | void StartVRDashboard(); 44 | bool IsVRHeadsetStreamingEnabled(); 45 | void SetVRHeadsetStreamingEnabled(bool bEnabled); 46 | }; -------------------------------------------------------------------------------- /src/SteamApiWrapper/steamApiWrappers.cpp: -------------------------------------------------------------------------------- 1 | #include "steamApiWrappers.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Core/logger.h" 5 | 6 | bool InitSteamApiWrappers() 7 | { 8 | LOG(1, "InitSteamApiWrappers\n"); 9 | 10 | if (g_tempVals.ppSteamMatchmaking && 11 | !g_interfaces.pSteamMatchmakingWrapper) 12 | { 13 | g_interfaces.pSteamMatchmakingWrapper = new SteamMatchmakingWrapper(g_tempVals.ppSteamMatchmaking); 14 | } 15 | 16 | if (g_tempVals.ppSteamFriends && 17 | !g_interfaces.pSteamFriendsWrapper) 18 | { 19 | g_interfaces.pSteamFriendsWrapper = new SteamFriendsWrapper(g_tempVals.ppSteamFriends); 20 | } 21 | 22 | if (g_tempVals.ppSteamUser && 23 | !g_interfaces.pSteamUserWrapper) 24 | { 25 | g_interfaces.pSteamUserWrapper = new SteamUserWrapper(g_tempVals.ppSteamUser); 26 | } 27 | 28 | if (g_tempVals.ppSteamNetworking && 29 | !g_interfaces.pSteamNetworkingWrapper) 30 | { 31 | g_interfaces.pSteamNetworkingWrapper = new SteamNetworkingWrapper(g_tempVals.ppSteamNetworking); 32 | } 33 | 34 | if (g_tempVals.ppSteamUserStats && 35 | !g_interfaces.pSteamUserStatsWrapper) 36 | { 37 | g_interfaces.pSteamUserStatsWrapper = new SteamUserStatsWrapper(g_tempVals.ppSteamUserStats); 38 | } 39 | 40 | if (g_tempVals.ppSteamUtils && 41 | !g_interfaces.pSteamUtilsWrapper) 42 | { 43 | g_interfaces.pSteamUtilsWrapper = new SteamUtilsWrapper(g_tempVals.ppSteamUtils); 44 | } 45 | 46 | if (g_interfaces.pSteamUserStatsWrapper && 47 | g_interfaces.pSteamFriendsWrapper && 48 | !g_interfaces.pSteamApiHelper) 49 | { 50 | g_interfaces.pSteamApiHelper = new SteamApiHelper(g_interfaces.pSteamUserStatsWrapper, g_interfaces.pSteamFriendsWrapper); 51 | } 52 | 53 | return true; 54 | } -------------------------------------------------------------------------------- /src/SteamApiWrapper/steamApiWrappers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool InitSteamApiWrappers(); -------------------------------------------------------------------------------- /src/Web/update_check.cpp: -------------------------------------------------------------------------------- 1 | #include "update_check.h" 2 | 3 | #include "url_downloader.h" 4 | 5 | #include "Core/info.h" 6 | #include "Core/logger.h" 7 | #include "Core/interfaces.h" 8 | #include "Overlay/Logger/ImGuiLogger.h" 9 | #include "Overlay/WindowManager.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | std::string newVersionNum = ""; 16 | 17 | std::string GetNewVersionNum() 18 | { 19 | if (newVersionNum != "") 20 | { 21 | return newVersionNum; 22 | } 23 | 24 | return ""; 25 | } 26 | 27 | void CheckUpdate() 28 | { 29 | 30 | std::wstring wUrl = MOD_LINK_API_GITHUB_RELEASE; 31 | std::string data = DownloadUrl(wUrl); 32 | 33 | if (strcmp(data.c_str(), "") == 0) 34 | { 35 | g_imGuiLogger->Log("[error] Update check failed. No data downloaded.\n"); 36 | LOG(2, "Update check failed.No data downloaded.\n"); 37 | return; 38 | } 39 | 40 | 41 | data = data.c_str(); 42 | 43 | std::regex r("\"name\"\\s*:\\s*\"(v[\\d \.]+)\\s"); 44 | std::smatch m; 45 | std::regex_search(data, m, r); 46 | 47 | if (m[1].str() == "") 48 | { 49 | 50 | g_imGuiLogger->Log("[error] Update check failed. Regex no match.\n"); 51 | return; 52 | } 53 | 54 | if(std::string(MOD_VERSION_NUM).find(m[1].str()) == std::string::npos) 55 | { 56 | newVersionNum = m[1].str(); 57 | 58 | 59 | LOG(2, "New version found: %s\n", newVersionNum.c_str()); 60 | g_imGuiLogger->Log("[system] Update available: BBCF Improvement Mod %s has been released!(current: %s)\n", 61 | newVersionNum.c_str(),MOD_VERSION_NUM); 62 | 63 | WindowManager::GetInstance().GetWindowContainer()->GetWindow(WindowType_UpdateNotifier)->Open(); 64 | } 65 | else 66 | { 67 | newVersionNum = m[1].str(); 68 | g_imGuiLogger->Log("[system] BBCF Improvement Mod is up-to-date, current: %s, latest: %s\n", 69 | MOD_VERSION_NUM,newVersionNum.c_str() 70 | ); 71 | } 72 | } 73 | 74 | void StartAsyncUpdateCheck() 75 | { 76 | if (MOD_FORCE_DISABLE_UPDATE_CHECK) 77 | return; 78 | 79 | if (Settings::settingsIni.checkupdates) 80 | { 81 | CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)CheckUpdate, nullptr, 0, nullptr)); 82 | } 83 | } 84 | 85 | 86 | 87 | 88 | // Function to send a POST request with the provided bytes as the body 89 | 90 | 91 | 92 | 93 | 94 | 95 | void StartAsyncReplayUpload() { 96 | if (!Settings::settingsIni.uploadReplayData || g_modVals.uploadReplayDataVeto) { 97 | return; 98 | } 99 | CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)UploadReplayBinary, nullptr, 0, nullptr)); 100 | 101 | } -------------------------------------------------------------------------------- /src/Web/update_check.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | std::string GetNewVersionNum(); 5 | void StartAsyncUpdateCheck(); 6 | void StartAsyncReplayUpload(); -------------------------------------------------------------------------------- /src/Web/url_downloader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | std::string DownloadUrl(std::wstring& wUrl); 5 | 6 | // Returns number of bytes read 7 | unsigned long DownloadUrlBinary(std::wstring& wUrl, void** outBuffer); 8 | 9 | 10 | int UploadReplayBinary(); --------------------------------------------------------------------------------