├── .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_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 ├── resource ├── palettes.ini └── settings.ini └── src ├── Core ├── Settings.cpp ├── Settings.h ├── crashdump.cpp ├── crashdump.h ├── dllmain.cpp ├── info.h ├── interfaces.cpp ├── interfaces.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 ├── Jonb │ ├── JonbEntry.h │ ├── JonbReader.cpp │ └── JonbReader.h ├── MatchState.cpp ├── MatchState.h ├── Player.cpp ├── Player.h ├── Room │ ├── Room.h │ └── RoomMemberEntry.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 ├── 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 │ ├── DebugWindow.cpp │ ├── DebugWindow.h │ ├── HitboxOverlay.cpp │ ├── HitboxOverlay.h │ ├── IWindow.cpp │ ├── IWindow.h │ ├── LogWindow.cpp │ ├── LogWindow.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── PaletteEditorWindow.cpp │ ├── PaletteEditorWindow.h │ ├── RoomWindow.cpp │ ├── RoomWindow.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 | -------------------------------------------------------------------------------- /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 | - Create and load custom palettes and effects without file modifications 12 | - See each other's custom palettes in online matches 13 | - More flexibility to change the graphics options 14 | - Change avatars and accessories in online rooms/lobbies without going back into menu 15 | - Freely adjustable ingame currency value 16 | 17 | ## Compiling and usage 18 | BBCF Improvement Mod is coded using Visual Studio 2019 (toolset v142).
19 | 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.
20 | Copy the compiled binary, settings.ini, and palettes.ini files from the bin/ folder into the game's root folder. 21 | 22 | ## Requirements 23 | - Visual Studio 2019 (toolset v142) (Windows SDK 10) 24 | 25 | ## Thanks to the people who have helped the mod along the way 26 | * KoviDomi 27 | * Neptune 28 | * Rouzel 29 | * Dormin 30 | * NeoStrayCat 31 | * Everybody in the BlazBlue PC community that has given support or feedback of any kind! 32 | 33 | ## Extra thanks to 34 | Atom0s for their DirectX9.0 Hooking article
35 | Durante for their dsfix source 36 | 37 | ## Legal 38 | ``` 39 | BBCF Improvement Mod is NOT associated with Arc System Works or any of its partners / affiliates. 40 | BBCF Improvement Mod is NOT intended for malicious use. 41 | BBCF Improvement Mod is NOT intended to give players unfair advantages in online matches. 42 | BBCF Improvement Mod is NOT intended to unlock unreleased / unpurchased contents of the game. 43 | BBCF Improvement Mod should only be used on the official version that you legally purchased and own. 44 | 45 | Use BBCF Improvement Mod at your own risk. 46 | I, GrimFlash, 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. 47 | ``` 48 | -------------------------------------------------------------------------------- /depends/detour/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/detour/detours.lib -------------------------------------------------------------------------------- /depends/detour/detours.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/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/D3DX11core.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx11core.h 6 | // Content: D3DX11 core types and functions 7 | // 8 | /////////////////////////////////////////////////////////////////////////// 9 | 10 | #include "d3dx11.h" 11 | 12 | #ifndef __D3DX11CORE_H__ 13 | #define __D3DX11CORE_H__ 14 | 15 | // Current name of the DLL shipped in the same SDK as this header. 16 | 17 | 18 | #define D3DX11_DLL_W L"d3dx11_43.dll" 19 | #define D3DX11_DLL_A "d3dx11_43.dll" 20 | 21 | #ifdef UNICODE 22 | #define D3DX11_DLL D3DX11_DLL_W 23 | #else 24 | #define D3DX11_DLL D3DX11_DLL_A 25 | #endif 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif //__cplusplus 30 | 31 | /////////////////////////////////////////////////////////////////////////// 32 | // D3DX11_SDK_VERSION: 33 | // ----------------- 34 | // This identifier is passed to D3DX11CheckVersion in order to ensure that an 35 | // application was built against the correct header files and lib files. 36 | // This number is incremented whenever a header (or other) change would 37 | // require applications to be rebuilt. If the version doesn't match, 38 | // D3DX11CreateVersion will return FALSE. (The number itself has no meaning.) 39 | /////////////////////////////////////////////////////////////////////////// 40 | 41 | 42 | #define D3DX11_SDK_VERSION 43 43 | 44 | 45 | #ifdef D3D_DIAG_DLL 46 | BOOL WINAPI D3DX11DebugMute(BOOL Mute); 47 | #endif 48 | HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif //__cplusplus 53 | 54 | 55 | 56 | ////////////////////////////////////////////////////////////////////////////// 57 | // ID3DX11ThreadPump: 58 | ////////////////////////////////////////////////////////////////////////////// 59 | 60 | #undef INTERFACE 61 | #define INTERFACE ID3DX11DataLoader 62 | 63 | DECLARE_INTERFACE(ID3DX11DataLoader) 64 | { 65 | STDMETHOD(Load)(THIS) PURE; 66 | STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE; 67 | STDMETHOD(Destroy)(THIS) PURE; 68 | }; 69 | 70 | #undef INTERFACE 71 | #define INTERFACE ID3DX11DataProcessor 72 | 73 | DECLARE_INTERFACE(ID3DX11DataProcessor) 74 | { 75 | STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE; 76 | STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE; 77 | STDMETHOD(Destroy)(THIS) PURE; 78 | }; 79 | 80 | // {C93FECFA-6967-478a-ABBC-402D90621FCB} 81 | DEFINE_GUID(IID_ID3DX11ThreadPump, 82 | 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); 83 | 84 | #undef INTERFACE 85 | #define INTERFACE ID3DX11ThreadPump 86 | 87 | DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown) 88 | { 89 | // IUnknown 90 | STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; 91 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 92 | STDMETHOD_(ULONG, Release)(THIS) PURE; 93 | 94 | // ID3DX11ThreadPump 95 | STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE; 96 | STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; 97 | 98 | STDMETHOD(WaitForAllItems)(THIS) PURE; 99 | STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount); 100 | 101 | STDMETHOD(PurgeAllItems)(THIS) PURE; 102 | STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE; 103 | 104 | }; 105 | 106 | #ifdef __cplusplus 107 | extern "C" { 108 | #endif //__cplusplus 109 | 110 | HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump); 111 | 112 | HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext); 113 | 114 | #ifdef __cplusplus 115 | } 116 | #endif //__cplusplus 117 | 118 | /////////////////////////////////////////////////////////////////////////// 119 | 120 | #define _FACD3D 0x876 121 | #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) 122 | #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) 123 | 124 | #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) 125 | #define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) 126 | 127 | #endif //__D3DX11CORE_H__ 128 | 129 | -------------------------------------------------------------------------------- /depends/directx_sdk/Include/DXGIType.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __dxgitype_h__ 3 | #define __dxgitype_h__ 4 | 5 | 6 | #include "dxgiformat.h" 7 | 8 | #define _FACDXGI 0x87a 9 | #define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code) 10 | #define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code) 11 | 12 | #define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1) 13 | #define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2) 14 | #define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4) 15 | #define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5) 16 | #define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6) 17 | #define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7) 18 | #define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8) 19 | 20 | 21 | #define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1) 22 | #define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2) 23 | #define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3) 24 | #define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4) 25 | #define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5) 26 | #define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6) 27 | #define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7) 28 | #define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10) 29 | #define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11) 30 | #define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12) 31 | #define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32) 32 | #define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33) 33 | #define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34) 34 | #define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35) 35 | #define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36) 36 | 37 | 38 | 39 | #define DXGI_CPU_ACCESS_NONE ( 0 ) 40 | #define DXGI_CPU_ACCESS_DYNAMIC ( 1 ) 41 | #define DXGI_CPU_ACCESS_READ_WRITE ( 2 ) 42 | #define DXGI_CPU_ACCESS_SCRATCH ( 3 ) 43 | #define DXGI_CPU_ACCESS_FIELD 15 44 | 45 | #define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) ) 46 | #define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) ) 47 | #define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) ) 48 | #define DXGI_USAGE_SHARED ( 1L << (3 + 4) ) 49 | #define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) ) 50 | #define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) ) 51 | #define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) ) 52 | 53 | typedef struct DXGI_RGB 54 | { 55 | float Red; 56 | float Green; 57 | float Blue; 58 | } DXGI_RGB; 59 | 60 | typedef struct DXGI_GAMMA_CONTROL 61 | { 62 | DXGI_RGB Scale; 63 | DXGI_RGB Offset; 64 | DXGI_RGB GammaCurve[ 1025 ]; 65 | } DXGI_GAMMA_CONTROL; 66 | 67 | typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES 68 | { 69 | BOOL ScaleAndOffsetSupported; 70 | float MaxConvertedValue; 71 | float MinConvertedValue; 72 | UINT NumGammaControlPoints; 73 | float ControlPointPositions[1025]; 74 | } DXGI_GAMMA_CONTROL_CAPABILITIES; 75 | 76 | typedef struct DXGI_RATIONAL 77 | { 78 | UINT Numerator; 79 | UINT Denominator; 80 | } DXGI_RATIONAL; 81 | 82 | typedef enum DXGI_MODE_SCANLINE_ORDER 83 | { 84 | DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0, 85 | DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1, 86 | DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, 87 | DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3 88 | } DXGI_MODE_SCANLINE_ORDER; 89 | 90 | typedef enum DXGI_MODE_SCALING 91 | { 92 | DXGI_MODE_SCALING_UNSPECIFIED = 0, 93 | DXGI_MODE_SCALING_CENTERED = 1, 94 | DXGI_MODE_SCALING_STRETCHED = 2 95 | } DXGI_MODE_SCALING; 96 | 97 | typedef enum DXGI_MODE_ROTATION 98 | { 99 | DXGI_MODE_ROTATION_UNSPECIFIED = 0, 100 | DXGI_MODE_ROTATION_IDENTITY = 1, 101 | DXGI_MODE_ROTATION_ROTATE90 = 2, 102 | DXGI_MODE_ROTATION_ROTATE180 = 3, 103 | DXGI_MODE_ROTATION_ROTATE270 = 4 104 | } DXGI_MODE_ROTATION; 105 | 106 | typedef struct DXGI_MODE_DESC 107 | { 108 | UINT Width; 109 | UINT Height; 110 | DXGI_RATIONAL RefreshRate; 111 | DXGI_FORMAT Format; 112 | DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; 113 | DXGI_MODE_SCALING Scaling; 114 | } DXGI_MODE_DESC; 115 | 116 | typedef struct DXGI_SAMPLE_DESC 117 | { 118 | UINT Count; 119 | UINT Quality; 120 | } DXGI_SAMPLE_DESC; 121 | 122 | #endif // __dxgitype_h__ 123 | 124 | -------------------------------------------------------------------------------- /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/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/D3DCSX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/D3DCSXd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/D3DCSXd.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/DxErr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/DxErr.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/X3DAudio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/X3DAudio.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/XAPOFX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/XAPOFX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/XInput.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/XInput.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d2d1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d2d1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3d10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d10_1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3d10_1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3d11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3d9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3d9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dcompiler.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dcompiler.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx10d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx10d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx11d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx11d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dx9d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dx9d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/d3dxof.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/d3dxof.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dinput8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/dinput8.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dsound.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/dsound.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dwrite.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/dwrite.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dxgi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/dxgi.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/dxguid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/dxguid.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/xapobase.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/xapobase.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x64/xapobased.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x64/xapobased.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/D3DCSX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/D3DCSX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/D3DCSXd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/D3DCSXd.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/DxErr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/DxErr.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/X3DAudio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/X3DAudio.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/XAPOFX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/XAPOFX.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/XInput.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/XInput.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d2d1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d2d1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3d10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d10_1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3d10_1.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3d11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3d9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3d9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dcompiler.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dcompiler.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx10.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx10.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx10d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx10d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx11.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx11.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx11d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx11d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx9.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx9.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dx9d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dx9d.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/d3dxof.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/d3dxof.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dinput8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dinput8.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dsetup.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dsetup.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dsound.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dsound.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dwrite.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dwrite.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dxgi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dxgi.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/dxguid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/dxguid.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/xapobase.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/directx_sdk/Lib/x86/xapobase.lib -------------------------------------------------------------------------------- /depends/directx_sdk/Lib/x86/xapobased.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/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/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/isteamgamecoordinator.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteamgameserverstats.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/isteamgameserverstats.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/isteaminventory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/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/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/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/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/isteamvideo.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/linux32/libsdkencryptedappticket.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/linux32/libsdkencryptedappticket.so -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/linux64/libsdkencryptedappticket.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/linux64/libsdkencryptedappticket.so -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/osx32/libsdkencryptedappticket.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/osx32/libsdkencryptedappticket.dylib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.dll -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/win32/sdkencryptedappticket.lib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.dll -------------------------------------------------------------------------------- /depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/lib/win64/sdkencryptedappticket64.lib -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steam_gameserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/steam_gameserver.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamencryptedappticket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/steamencryptedappticket.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamhttpenums.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/public/steam/steamhttpenums.h -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamps3params.h: -------------------------------------------------------------------------------- 1 | //====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: 4 | // 5 | //============================================================================= 6 | 7 | #ifndef STEAMPS3PARAMS_H 8 | #define STEAMPS3PARAMS_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 14 | // PlayStation 3 initialization parameters 15 | // 16 | // The following structure must be passed to when loading steam_api_ps3.prx 17 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 18 | #define STEAM_PS3_PATH_MAX 1055 19 | #define STEAM_PS3_SERVICE_ID_MAX 32 20 | #define STEAM_PS3_COMMUNICATION_ID_MAX 10 21 | #define STEAM_PS3_COMMUNICATION_SIG_MAX 160 22 | #define STEAM_PS3_LANGUAGE_MAX 64 23 | #define STEAM_PS3_REGION_CODE_MAX 16 24 | #define STEAM_PS3_CURRENT_PARAMS_VER 2 25 | struct SteamPS3Params_t 26 | { 27 | uint32 m_unVersion; // set to STEAM_PS3_CURRENT_PARAMS_VER 28 | 29 | void *pReserved; 30 | uint32 m_nAppId; // set to your game's appid 31 | 32 | char m_rgchInstallationPath[ STEAM_PS3_PATH_MAX ]; // directory containing latest steam prx's and sdata. Can be read only (BDVD) 33 | char m_rgchSystemCache[ STEAM_PS3_PATH_MAX ]; // temp working cache, not persistent 34 | char m_rgchGameData[ STEAM_PS3_PATH_MAX ]; // persistent game data path for storing user data 35 | char m_rgchNpServiceID[ STEAM_PS3_SERVICE_ID_MAX ]; 36 | char m_rgchNpCommunicationID[ STEAM_PS3_COMMUNICATION_ID_MAX ]; 37 | char m_rgchNpCommunicationSig[ STEAM_PS3_COMMUNICATION_SIG_MAX ]; 38 | 39 | // Language should be one of the following. must be zero terminated 40 | // danish 41 | // dutch 42 | // english 43 | // finnish 44 | // french 45 | // german 46 | // italian 47 | // korean 48 | // norwegian 49 | // polish 50 | // portuguese 51 | // russian 52 | // schinese 53 | // spanish 54 | // swedish 55 | // tchinese 56 | char m_rgchSteamLanguage[ STEAM_PS3_LANGUAGE_MAX ]; 57 | 58 | // region codes are "SCEA", "SCEE", "SCEJ". must be zero terminated 59 | char m_rgchRegionCode[ STEAM_PS3_REGION_CODE_MAX ]; 60 | 61 | // Should be SYS_TTYP3 through SYS_TTYP10, if it's 0 then Steam won't spawn a 62 | // thread to read console input at all. Using this let's you use Steam console commands 63 | // like: profile_on, profile_off, profile_dump, mem_stats, mem_validate. 64 | unsigned int m_cSteamInputTTY; 65 | 66 | struct Ps3netInit_t 67 | { 68 | bool m_bNeedInit; 69 | void *m_pMemory; 70 | int m_nMemorySize; 71 | int m_flags; 72 | } m_sysNetInitInfo; 73 | 74 | struct Ps3jpgInit_t 75 | { 76 | bool m_bNeedInit; 77 | } m_sysJpgInitInfo; 78 | 79 | struct Ps3pngInit_t 80 | { 81 | bool m_bNeedInit; 82 | } m_sysPngInitInfo; 83 | 84 | struct Ps3sysutilUserInfo_t 85 | { 86 | bool m_bNeedInit; 87 | } m_sysSysUtilUserInfo; 88 | 89 | bool m_bIncludeNewsPage; 90 | }; 91 | 92 | 93 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 94 | // PlayStation 3 memory structure 95 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 96 | #define STEAMPS3_MALLOC_INUSE 0x53D04A51 97 | #define STEAMPS3_MALLOC_SYSTEM 0x0D102C48 98 | #define STEAMPS3_MALLOC_OK 0xFFD04A51 99 | struct SteamPS3Memory_t 100 | { 101 | bool m_bSingleAllocation; // If true, Steam will request one 6MB allocation and use the returned memory for all future allocations 102 | // If false, Steam will make call malloc for each allocation 103 | 104 | // required function pointers 105 | void* (*m_pfMalloc)(size_t); 106 | void* (*m_pfRealloc)(void *, size_t); 107 | void (*m_pfFree)(void *); 108 | size_t (*m_pUsable_size)(void*); 109 | }; 110 | 111 | 112 | #endif // STEAMPS3PARAMS_H 113 | -------------------------------------------------------------------------------- /depends/steam_api/public/steam/steamtypes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/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/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/linux32/libsteam_api.so -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/linux64/libsteam_api.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/linux64/libsteam_api.so -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/osx32/libsteam_api.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/osx32/libsteam_api.dylib -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/steam_api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/steam_api.dll -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/steam_api.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/steam_api.lib -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/win64/steam_api64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/win64/steam_api64.dll -------------------------------------------------------------------------------- /depends/steam_api/redistributable_bin/win64/steam_api64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GrimFlash/BBCF-Improvement-Mod/d40b8b2e2a82d4a807332ef5dfe59a12771a77af/depends/steam_api/redistributable_bin/win64/steam_api64.lib -------------------------------------------------------------------------------- /export/dinput8.def: -------------------------------------------------------------------------------- 1 | LIBRARY DINPUT8 2 | 3 | EXPORTS 4 | DirectInput8Create -------------------------------------------------------------------------------- /resource/palettes.ini: -------------------------------------------------------------------------------- 1 | # Lines starting with "#" are ignored. 2 | 3 | [General] 4 | 5 | ###################################################################################### 6 | # Below you can set custom palettes as default. # 7 | # # 8 | # Valid palette indexes are between 1 - 24. # 9 | # Filenames must be put between quotation marks ("). (Extension .cfpl is not needed) # 10 | # # 11 | # Example: # 12 | # If Ragna has palette files "Fox.cfpl" and "Panda.cfpl", then a section like: # 13 | # [Ragna] # 14 | # 1="Fox" # 15 | # 3="Panda" # 16 | # 4="Panda" # 17 | # 6="Fox" # 18 | # 14="Fox" # 19 | # Will make the mod load the palette file "Fox.cfpl" on ingame palettes 1, 6, 14, # 20 | # and load the palette file "Panda.cfpl" on ingame palettes 3, 4. # 21 | # # 22 | # Setting as "Random" will select a palette randomly from the list: # 23 | # [Ragna] # 24 | # 1="Random" # 25 | # Will make the mod randomly select between "Default", "Fox.cfpl", and "Panda.cfpl" # 26 | ###################################################################################### 27 | 28 | [Amane] 29 | 1="Default" 30 | 31 | [Arakune] 32 | 1="Default" 33 | 34 | [Azrael] 35 | 1="Default" 36 | 37 | [Bang] 38 | 1="Default" 39 | 40 | [Bullet] 41 | 1="Default" 42 | 43 | [Carl] 44 | 1="Default" 45 | 46 | [Celica] 47 | 1="Default" 48 | 49 | [Es] 50 | 1="Default" 51 | 52 | [Hakumen] 53 | 1="Default" 54 | 55 | [Hazama] 56 | 1="Default" 57 | 58 | [Hibiki] 59 | 1="Default" 60 | 61 | [Izanami] 62 | 1="Default" 63 | 64 | [Izayoi] 65 | 1="Default" 66 | 67 | [Jin] 68 | 1="Default" 69 | 70 | [Jubei] 71 | 1="Default" 72 | 73 | [Kagura] 74 | 1="Default" 75 | 76 | [Kokonoe] 77 | 1="Default" 78 | 79 | [Lambda] 80 | 1="Default" 81 | 82 | [Litchi] 83 | 1="Default" 84 | 85 | [Mai] 86 | 1="Default" 87 | 88 | [Makoto] 89 | 1="Default" 90 | 91 | [Mu] 92 | 1="Default" 93 | 94 | [Naoto] 95 | 1="Default" 96 | 97 | [Nine] 98 | 1="Default" 99 | 100 | [Noel] 101 | 1="Default" 102 | 103 | [Nu] 104 | 1="Default" 105 | 106 | [Platinum] 107 | 1="Default" 108 | 109 | [Rachel] 110 | 1="Default" 111 | 112 | [Ragna] 113 | 1="Default" 114 | 115 | [Relius] 116 | 1="Default" 117 | 118 | [Susanoo] 119 | 1="Default" 120 | 121 | [Tager] 122 | 1="Default" 123 | 124 | [Taokaka] 125 | 1="Default" 126 | 127 | [Terumi] 128 | 1="Default" 129 | 130 | [Tsubaki] 131 | 1="Default" 132 | 133 | [Valkenhayn] 134 | 1="Default" 135 | -------------------------------------------------------------------------------- /resource/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | 3 | # Lines starting with "#" are ignored. 4 | # If you want to gain even more FPS by sacrificing image quality, set RenderingWidth/RenderingHeight BELOW 1280x768 and set Viewport = 2 5 | 6 | ############################################## 7 | # TOGGLE BUTTON: # 8 | # Used to toggle the ingame menu of BBCFIM # 9 | # Valid buttons are F-keys beetween F1 - F9 # 10 | ############################################## 11 | ToggleButton = F1 12 | 13 | ###################################################### 14 | # TOGGLE ONLINE WINDOW BUTTON: # 15 | # Used to toggle the Online info and settings window # 16 | # Valid buttons are F-keys beetween F1 - F9 # 17 | ###################################################### 18 | ToggleOnlineButton = F2 19 | 20 | ################################################### 21 | # TOGGLE HUD BUTTON: # 22 | # Used to toggle the visibility of HUD in matches # 23 | # Valid buttons are F-keys beetween F1 - F9 # 24 | ################################################### 25 | ToggleHUDButton = F3 26 | 27 | ############################################## 28 | # RENDERING SETTINGS: # 29 | # Set these to your game's window resolution # 30 | ############################################## 31 | RenderingWidth = 1920 32 | RenderingHeight = 1080 33 | 34 | ##################################################################################################### 35 | # VIEWPORT SETTINGS: # 36 | # 1 = game's default choice (size varies based on computer specs, usually its around 1920x1152) # 37 | # 2 = sets to the sizes of RenderingWidth and RenderingHeight # 38 | # 3 = sets to 1280x768 (this was used by all the previous BlazBlue games, fixes pixelated sprites) # 39 | # Note: a custom texture filter will be applied if Viewport is set to 3 # 40 | ##################################################################################################### 41 | Viewport = 1 42 | 43 | ###################################################### 44 | # ANTIALIASING SETTINGS: # 45 | # 0 = off # 46 | # 4 = x4 # 47 | # 5 = game's default choice # 48 | ###################################################### 49 | AntiAliasing = 5 50 | 51 | ########################################################### 52 | # V-SYNC SETTINGS: # 53 | # 0 = off # 54 | # 1 = on # 55 | ########################################################### 56 | V-sync = 0 57 | 58 | ######################################### 59 | # MENUSIZE SETTINGS: # 60 | # Changes the size of BBCFIM's menu # 61 | # 1 = Small # 62 | # 2 = Medium # 63 | # 3 = Large # 64 | ######################################### 65 | MenuSize = 2 66 | 67 | ####################################################################################### 68 | # NOTIFICATION SETTINGS: # 69 | # Mainly used to notify about other BBCFIM users and their requests in online matches # 70 | # Notifications are always shown on top of the window # 71 | # 0 = off # 72 | # 1 = on # 73 | ####################################################################################### 74 | Notifications = 1 75 | 76 | ###################################################################### 77 | # CHECK UPDATES: # 78 | # Check and notify the user if a new version of BBCFIM is available # 79 | # 0 = off # 80 | # 1 = on # 81 | ###################################################################### 82 | CheckUpdates = 1 83 | 84 | ############################################################################# 85 | # DINPUT DLL CHAINING: # 86 | # If you want to use another dinput8.dll wrapper together with BBCFIM, # 87 | # rename the other dll (e.g. "dinputwrapper.dll") and put the new name here # 88 | # Example: # 89 | # DinputDllWrapper = dinputwrapper.dll # 90 | ############################################################################# 91 | DinputDllWrapper = none 92 | -------------------------------------------------------------------------------- /src/Core/Settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "D3D9EXWrapper/d3d9.h" 3 | 4 | #include 5 | 6 | struct settingsIni_t 7 | { 8 | //X-Macro 9 | #define SETTING(_type, _var, _inistring, _defaultval) \ 10 | _type _var 11 | #include "settings.def" 12 | #undef SETTING 13 | }; 14 | 15 | struct savedSettings_t 16 | { 17 | RECT newSourceRect; 18 | D3DVIEWPORT9 newViewport; 19 | D3DXVECTOR2 origViewportRes; 20 | bool isDuelFieldSprite; 21 | bool isFiltering; 22 | }; 23 | 24 | class Settings 25 | { 26 | public: 27 | static settingsIni_t settingsIni; 28 | static savedSettings_t savedSettings; 29 | 30 | static void applySettingsIni(D3DPRESENT_PARAMETERS* pPresentationParameters); 31 | static bool loadSettingsFile(); 32 | static void initSavedSettings(); 33 | //static void setViewportSize(D3DVIEWPORT9 Viewport); 34 | static short getButtonValue(std::string button); 35 | private: 36 | static int readSettingsFilePropertyInt(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 37 | static float readSettingsFilePropertyFloat(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 38 | static std::string readSettingsFilePropertyString(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename); 39 | }; -------------------------------------------------------------------------------- /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 | 3 | #define MOD_VERSION_NUM "v3.04" 4 | #define MOD_WINDOW_TITLE "BBCF Improvement Mod" 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/GrimFlash/BBCF-Improvement-Mod" -------------------------------------------------------------------------------- /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 | 11 | void InitManagers() 12 | { 13 | LOG(1, "InitManagers\n"); 14 | 15 | if (g_interfaces.pSteamNetworkingWrapper && 16 | g_interfaces.pSteamUserWrapper && 17 | !g_interfaces.pNetworkManager) 18 | { 19 | g_interfaces.pNetworkManager = new NetworkManager( 20 | g_interfaces.pSteamNetworkingWrapper, 21 | g_interfaces.pSteamUserWrapper->GetSteamID() 22 | ); 23 | } 24 | 25 | if (g_interfaces.pNetworkManager && 26 | g_interfaces.pSteamUserWrapper && 27 | g_interfaces.pSteamFriendsWrapper && 28 | !g_interfaces.pRoomManager) 29 | { 30 | g_interfaces.pRoomManager = new RoomManager( 31 | g_interfaces.pNetworkManager, 32 | g_interfaces.pSteamFriendsWrapper, 33 | g_interfaces.pSteamUserWrapper->GetSteamID() 34 | ); 35 | } 36 | 37 | if (g_interfaces.pPaletteManager && 38 | g_interfaces.pRoomManager && 39 | !g_interfaces.pOnlinePaletteManager) 40 | { 41 | g_interfaces.pOnlinePaletteManager = new OnlinePaletteManager( 42 | g_interfaces.pPaletteManager, 43 | &g_interfaces.player1.GetPalHandle(), 44 | &g_interfaces.player2.GetPalHandle(), 45 | g_interfaces.pRoomManager 46 | ); 47 | } 48 | 49 | if (!g_interfaces.pGameModeManager) 50 | { 51 | g_interfaces.pGameModeManager = new GameModeManager(); 52 | } 53 | 54 | if (g_interfaces.pGameModeManager && 55 | g_interfaces.pRoomManager && 56 | !g_interfaces.pOnlineGameModeManager) 57 | { 58 | g_interfaces.pOnlineGameModeManager = new OnlineGameModeManager( 59 | g_interfaces.pGameModeManager, 60 | g_interfaces.pRoomManager 61 | ); 62 | } 63 | } 64 | 65 | void CleanupInterfaces() 66 | { 67 | LOG(1, "CleanupInterfaces\n"); 68 | 69 | SAFE_DELETE(g_interfaces.pNetworkManager); 70 | SAFE_DELETE(g_interfaces.pPaletteManager); 71 | SAFE_DELETE(g_interfaces.pRoomManager); 72 | SAFE_DELETE(g_interfaces.pOnlinePaletteManager); 73 | SAFE_DELETE(g_interfaces.pOnlineGameModeManager); 74 | SAFE_DELETE(g_interfaces.pGameModeManager); 75 | 76 | SAFE_DELETE(g_interfaces.pD3D9ExWrapper); 77 | 78 | SAFE_DELETE(g_interfaces.pSteamFriendsWrapper); 79 | SAFE_DELETE(g_interfaces.pSteamMatchmakingWrapper); 80 | SAFE_DELETE(g_interfaces.pSteamNetworkingWrapper); 81 | SAFE_DELETE(g_interfaces.pSteamUserStatsWrapper); 82 | SAFE_DELETE(g_interfaces.pSteamUserWrapper); 83 | SAFE_DELETE(g_interfaces.pSteamUtilsWrapper); 84 | SAFE_DELETE(g_interfaces.pSteamApiHelper); 85 | } 86 | -------------------------------------------------------------------------------- /src/Core/interfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CustomGameMode/GameModeManager.h" 4 | #include "D3D9EXWrapper/d3d9.h" 5 | #include "D3D9EXWrapper/ID3D9EXWrapper_Device.h" 6 | #include "Game/Player.h" 7 | #include "Game/Room/Room.h" 8 | #include "Network/NetworkManager.h" 9 | #include "Network/OnlineGameModeManager.h" 10 | #include "Network/OnlinePaletteManager.h" 11 | #include "Network/RoomManager.h" 12 | #include "Palette/PaletteManager.h" 13 | #include "SteamApiWrapper/SteamApiHelper.h" 14 | #include "SteamApiWrapper/SteamFriendsWrapper.h" 15 | #include "SteamApiWrapper/SteamMatchmakingWrapper.h" 16 | #include "SteamApiWrapper/SteamNetworkingWrapper.h" 17 | #include "SteamApiWrapper/SteamUserStatsWrapper.h" 18 | #include "SteamApiWrapper/SteamUserWrapper.h" 19 | #include "SteamApiWrapper/SteamUtilsWrapper.h" 20 | 21 | struct interfaces_t 22 | { 23 | SteamFriendsWrapper* pSteamFriendsWrapper; 24 | SteamMatchmakingWrapper* pSteamMatchmakingWrapper; 25 | SteamNetworkingWrapper* pSteamNetworkingWrapper; 26 | SteamUserWrapper* pSteamUserWrapper; 27 | SteamUserStatsWrapper* pSteamUserStatsWrapper; 28 | SteamUtilsWrapper* pSteamUtilsWrapper; 29 | 30 | IDirect3DDevice9Ex* pD3D9ExWrapper; 31 | 32 | NetworkManager* pNetworkManager; 33 | RoomManager* pRoomManager; 34 | SteamApiHelper* pSteamApiHelper; 35 | 36 | PaletteManager* pPaletteManager; 37 | OnlinePaletteManager* pOnlinePaletteManager; 38 | 39 | GameModeManager* pGameModeManager; 40 | OnlineGameModeManager* pOnlineGameModeManager; 41 | 42 | Player player1; 43 | Player player2; 44 | }; 45 | 46 | struct gameVals_t 47 | { 48 | int* pGameState; 49 | int* pGameMoney; 50 | int* pGameMode; 51 | int* pMatchState; 52 | int* pMatchTimer; 53 | int* pMatchRounds; 54 | 55 | int playerAvatarBaseAddr; 56 | int* playerAvatarAddr; 57 | int* playerAvatarColAddr; 58 | byte* playerAvatarAcc1; 59 | byte* playerAvatarAcc2; 60 | 61 | int isP1CPU; 62 | 63 | unsigned char* stageListMemory; 64 | int *stageSelect_X; 65 | int *stageSelect_Y; 66 | int *musicSelect_X; 67 | int *musicSelect_Y; 68 | 69 | ///////////////// 70 | // New fields below 71 | ///////////////// 72 | 73 | // *pIsHUDHidden is a bitfield: 74 | // 0x00 - hud is visible 75 | // 0x01 - hud is hidden (intro) 76 | // 0x02 - hud is hidden (astral) 77 | // 0x04 - loading icon is shown 78 | int* pIsHUDHidden; 79 | 80 | bool isFrameFrozen; 81 | unsigned framesToReach; 82 | unsigned* pFrameCount; 83 | 84 | D3DXMATRIX* viewMatrix; 85 | D3DXMATRIX* projMatrix; 86 | 87 | int* pEntityList; 88 | int entityCount; 89 | 90 | Room* pRoom; 91 | }; 92 | 93 | struct gameProc_t 94 | { 95 | HWND hWndGameWindow; 96 | }; 97 | 98 | //temporary placeholders until wrappers are created / final addresses updated 99 | struct temps_t 100 | { 101 | ISteamFriends** ppSteamFriends; 102 | ISteamMatchmaking** ppSteamMatchmaking; 103 | ISteamNetworking** ppSteamNetworking; 104 | ISteamUser** ppSteamUser; 105 | ISteamUserStats** ppSteamUserStats; 106 | ISteamUtils** ppSteamUtils; 107 | }; 108 | 109 | extern interfaces_t g_interfaces; 110 | extern gameProc_t g_gameProc; 111 | extern gameVals_t g_gameVals; 112 | extern temps_t g_tempVals; 113 | 114 | void InitManagers(); 115 | void CleanupInterfaces(); 116 | -------------------------------------------------------------------------------- /src/Core/logger.cpp: -------------------------------------------------------------------------------- 1 | #include "logger.h" 2 | 3 | #include 4 | #include 5 | 6 | bool hookSucceeded(PBYTE addr, const char* funcName) 7 | { 8 | if (!addr) 9 | { 10 | LOG(2, "FAILED to hook %s\n", funcName); 11 | return false; 12 | } 13 | 14 | LOG(2, "Successfully hooked %s at 0x%p\n", funcName, addr); 15 | return true; 16 | } 17 | 18 | char* getFullDate() 19 | { 20 | time_t timer; 21 | char* buffer = (char*)malloc(sizeof(char) * 26); 22 | if (!buffer) 23 | { 24 | return NULL; 25 | } 26 | 27 | struct tm* tm_info; 28 | 29 | time(&timer); 30 | tm_info = localtime(&timer); 31 | 32 | strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info); 33 | return buffer; 34 | } 35 | 36 | #ifdef ENABLE_LOGGING 37 | 38 | FILE* g_oFile; 39 | 40 | inline void logger(const char* message, ...) 41 | { 42 | if (!message) { return; } 43 | 44 | va_list args; 45 | va_start(args, message); 46 | vfprintf(g_oFile, message, args); 47 | va_end(args); 48 | 49 | fflush(g_oFile); 50 | } 51 | 52 | void openLogger() 53 | { 54 | g_oFile = fopen("DEBUG.txt", "w"); 55 | char* time = getFullDate(); 56 | LOG(1, "\n\n\n\n"); 57 | 58 | if (time) 59 | { 60 | LOG(1, "BBCF_FIX START - %s\n", time); 61 | free(time); 62 | } 63 | else 64 | { 65 | LOG(1, "BBCF_FIX START - {Couldn't get the current time}\n"); 66 | } 67 | 68 | LOG(1, "/////////////////////////////////////\n"); 69 | LOG(1, "/////////////////////////////////////\n\n"); 70 | } 71 | 72 | void closeLogger() 73 | { 74 | char* time = getFullDate(); 75 | if (time) 76 | { 77 | LOG(1, "BBCF_FIX STOP - %s\n", time); 78 | free(time); 79 | } 80 | else 81 | { 82 | LOG(1, "BBCF_FIX STOP - {Couldn't get the current time}\n"); 83 | } 84 | 85 | if (g_oFile) 86 | { 87 | fclose(g_oFile); 88 | } 89 | } 90 | 91 | void logSettingsIni() 92 | { 93 | LOG(1, "settings.ini config:\n"); 94 | 95 | std::ostringstream oss; 96 | 97 | //X-Macro 98 | #define SETTING(_type, _var, _inistring, _defaultval) \ 99 | oss << "\t- " << _inistring << " = " << Settings::settingsIni.##_var << "\n"; 100 | #include "settings.def" 101 | #undef SETTING 102 | 103 | LOG(1, oss.str().c_str()); 104 | } 105 | 106 | void logD3DPParams(D3DPRESENT_PARAMETERS* pPresentationParameters, bool isOriginalSettings) 107 | { 108 | if (isOriginalSettings) 109 | { 110 | LOG(1, "Original D3D PresentationParameters:\n"); 111 | } 112 | else 113 | { 114 | LOG(1, "Modified D3D PresentationParameters:\n"); 115 | } 116 | 117 | LOG(1, "\t- BackBufferWidth: %u\n", pPresentationParameters->BackBufferWidth); 118 | LOG(1, "\t- BackBufferHeight: %u\n", pPresentationParameters->BackBufferHeight); 119 | LOG(1, "\t- BackBufferFormat: %u\n", pPresentationParameters->BackBufferFormat); 120 | LOG(1, "\t- BackBufferCount: %u\n", pPresentationParameters->BackBufferCount); 121 | LOG(1, "\t- SwapEffect: %u\n", pPresentationParameters->SwapEffect); 122 | LOG(1, "\t- MultiSampleType: %u\n", pPresentationParameters->MultiSampleType); 123 | LOG(1, "\t- MultiSampleQuality: %d\n", pPresentationParameters->MultiSampleQuality); 124 | LOG(1, "\t- EnableAutoDepthStencil: %d\n", pPresentationParameters->EnableAutoDepthStencil); 125 | LOG(1, "\t- FullScreen_RefreshRateInHz: %u\n", pPresentationParameters->FullScreen_RefreshRateInHz); 126 | LOG(1, "\t- hDeviceWindow: 0x%p\n", pPresentationParameters->hDeviceWindow); 127 | LOG(1, "\t- Windowed: %d\n", pPresentationParameters->Windowed); 128 | LOG(1, "\t- Flags: 0x%p\n", pPresentationParameters->Flags); 129 | LOG(1, "\t- PresentationInterval: 0x%p\n", pPresentationParameters->PresentationInterval); 130 | } 131 | 132 | #else 133 | 134 | void openLogger() 135 | { 136 | } 137 | void closeLogger() 138 | { 139 | } 140 | void logSettingsIni() 141 | { 142 | } 143 | void logD3DPParams(D3DPRESENT_PARAMETERS* pPresentationParameters, bool isOriginalSettings) 144 | { 145 | } 146 | 147 | #endif -------------------------------------------------------------------------------- /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, dinputDllWrapper, "DinputDllWrapper", "none"); 9 | SETTING(int, renderwidth, "RenderingWidth", "1920"); 10 | SETTING(int, renderheight, "RenderingHeight", "1080"); 11 | SETTING(int, viewport, "Viewport", "1"); 12 | SETTING(int, antialiasing, "AntiAliasing", "-1"); 13 | SETTING(bool, vsync, "V-sync", "0"); 14 | SETTING(int, menusize, "MenuSize", "2"); 15 | SETTING(bool, notifications, "Notifications", "1"); 16 | SETTING(bool, checkupdates, "CheckUpdates", "1"); -------------------------------------------------------------------------------- /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 | void WriteToProtectedMemory(uintptr_t addressToWrite, char* valueToWrite, int byteNum); 14 | char* RawMemoryArrayToString(unsigned char* srcBuf, int length); 15 | DWORD FindPattern(LPCWSTR module, char *pattern, char *mask); 16 | DWORD* GetInterfaceFuncPtr(DWORD* pDeviceInterface, const char *fmt, ...); 17 | bool Hook(void* toHook, void* ourFunc, int len); 18 | 19 | std::string FormatText(const char* message, ...); 20 | unsigned int rgb(double hue); 21 | DWORD QuickChecksum(DWORD *pData, int size); 22 | 23 | bool utils_WriteFile(const char* path, void* inBuffer, unsigned long bufferSize, bool binaryFile = false, bool append = false); 24 | bool utils_ReadFile(const char* path, void* outBuffer, unsigned long bufferSize, bool binaryFile = false); 25 | 26 | std::string utf16_to_utf8(const std::wstring & wstr); 27 | int SafeDereferencePtr(int* ptr); 28 | -------------------------------------------------------------------------------- /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/CharData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | // Generated using ReClass 2015 4 | 5 | class CharData 6 | { 7 | public: 8 | class OBJ_CCharBase* objCharbase; //0x0000 9 | char pad_0004[12]; //0x0004 10 | int32_t unknownStatus1; //0x0010 11 | char pad_0014[4]; //0x0014 12 | int32_t stateChangedCount; //0x0018 13 | char pad_001C[24]; //0x001C 14 | int32_t charIndex; //0x0034 15 | char pad_0038[20]; //0x0038 16 | class JonbEntry* pJonbEntryBegin; //0x004C 17 | char pad_0050[68]; //0x0050 18 | uint32_t hurtboxCount; //0x0094 19 | uint32_t hitboxCount; //0x0098 20 | char pad_009C[60]; //0x009C 21 | char* current_sprite_img; //0x00D8 22 | char pad_00DC[208]; //0x00DC 23 | int32_t lambda_nu_drive_hitcount; //0x01AC 24 | char pad_01B0[16]; //0x01B0 25 | int32_t overdriveTimeleft; //0x01C0 26 | int32_t overdriveTimerStartedAt; //0x01C4 27 | char pad_01C8[20]; //0x01C8 28 | int32_t some_distortion_timer; //0x01DC 29 | int32_t isDoingDistortion; //0x01E0 30 | char pad_01E4[4]; //0x01E4 31 | class CharData* ownerEntity; //0x01E8 32 | char pad_01EC[120]; //0x01EC 33 | int32_t facingLeft; //0x0264 34 | int32_t position_x; //0x0268 35 | int32_t position_y; //0x026C 36 | char pad_0270[4]; //0x0270 37 | int32_t offsetX_1; //0x0274 38 | char pad_0278[4]; //0x0278 39 | int32_t rotationDegrees; //0x027C 40 | char pad_0280[4]; //0x0280 41 | int32_t scaleX; //0x0284 42 | int32_t scaleY; //0x0288 43 | char pad_028C[80]; //0x028C 44 | int32_t position_x_dupe; //0x02DC 45 | int32_t position_y_dupe; //0x02E0 46 | char pad_02E4[16]; //0x02E4 47 | int32_t offsetX_2; //0x02F4 48 | char pad_02F8[4]; //0x02F8 49 | int32_t offsetY_2; //0x02FC 50 | char pad_0300[52]; //0x0300 51 | int32_t stageEdgeTouchTimer; //0x0334 52 | char pad_0338[336]; //0x0338 53 | int32_t heatUsageType; //0x0488 54 | char pad_048C[1348]; //0x048C 55 | int32_t previousHP; //0x09D0 56 | int32_t currentHP; //0x09D4 57 | int32_t maxHP; //0x09D8 58 | char pad_09DC[5656]; //0x09DC 59 | char lastAction[20]; //0x1FF4 60 | char pad_2008[104]; //0x2008 61 | char currentAction[20]; //0x2070 62 | char pad_2084[452]; //0x2084 63 | char char_abbr[4]; //0x2248 64 | char pad_224C[14472]; //0x224C 65 | int32_t heatMeter; //0x5AD4 66 | char pad_5AD8[4]; //0x5AD8 67 | int32_t heatGainCooldown; //0x5ADC 68 | char pad_5AE0[4]; //0x5AE0 69 | int32_t overdriveMeter; //0x5AE4 70 | char pad_5AE8[16]; //0x5AE8 71 | int32_t overdriveMaxtime; //0x5AF8 72 | char pad_5AFC[8]; //0x5AFC 73 | int32_t barrier; //0x5B04 74 | char pad_5B08[108036]; //0x5B08 75 | int32_t Drive1; //0x2010C 76 | char pad_20110[12]; //0x20110 77 | int32_t Drive1_type; //0x2011C 78 | char pad_20120[16]; //0x20120 79 | int32_t Drive2; //0x20130 80 | char pad_20134[32]; //0x20134 81 | int32_t Drive3; //0x20154 82 | char pad_20158[4972]; //0x20158 83 | }; //Size: 0x214C4 84 | -------------------------------------------------------------------------------- /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 | 50 | g_gameVals.isFrameFrozen = false; 51 | 52 | WindowManager::GetInstance().GetWindowContainer()->GetWindow(WindowType_PaletteEditor)->OnMatchInit(); 53 | } 54 | 55 | void MatchState::OnMatchRematch() 56 | { 57 | LOG(2, "MatchState::OnMatchRematch\n"); 58 | 59 | g_interfaces.pPaletteManager->OnMatchRematch( 60 | g_interfaces.player1, 61 | g_interfaces.player2 62 | ); 63 | 64 | g_interfaces.pOnlinePaletteManager->ClearSavedPalettePacketQueues(); 65 | } 66 | 67 | void MatchState::OnMatchEnd() 68 | { 69 | LOG(2, "MatchState::OnMatchEnd\n"); 70 | 71 | g_interfaces.pGameModeManager->EndGameMode(); 72 | 73 | g_interfaces.pPaletteManager->OnMatchEnd( 74 | g_interfaces.player1.GetPalHandle(), 75 | g_interfaces.player2.GetPalHandle() 76 | ); 77 | 78 | g_interfaces.pOnlinePaletteManager->ClearSavedPalettePacketQueues(); 79 | g_interfaces.pOnlineGameModeManager->ClearPlayerGameModeChoices(); 80 | } 81 | 82 | void MatchState::OnUpdate() 83 | { 84 | LOG(7, "MatchState::OnUpdate\n"); 85 | 86 | g_interfaces.pPaletteManager->OnUpdate( 87 | g_interfaces.player1.GetPalHandle(), 88 | g_interfaces.player2.GetPalHandle() 89 | ); 90 | } -------------------------------------------------------------------------------- /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/Player.cpp: -------------------------------------------------------------------------------- 1 | #include "Player.h" 2 | 3 | void Player::SetCharDataPtr(const void* addr) 4 | { 5 | m_charData = (CharData**)addr; 6 | } 7 | 8 | bool Player::IsCharDataNullPtr() const 9 | { 10 | if (m_charData == 0) 11 | return true; 12 | 13 | return *m_charData == 0; 14 | } 15 | 16 | CharData* Player::GetData() const 17 | { 18 | return *m_charData; 19 | } 20 | 21 | CharPaletteHandle& Player::GetPalHandle() 22 | { 23 | return m_charPalHandle; 24 | } 25 | -------------------------------------------------------------------------------- /src/Game/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CharData.h" 3 | 4 | #include "Palette/CharPaletteHandle.h" 5 | 6 | class Player 7 | { 8 | public: 9 | CharData* GetData() const; 10 | CharPaletteHandle& GetPalHandle(); 11 | 12 | void SetCharDataPtr(const void* addr); 13 | bool IsCharDataNullPtr() const; 14 | 15 | private: 16 | CharData** m_charData; 17 | CharPaletteHandle m_charPalHandle; 18 | }; 19 | -------------------------------------------------------------------------------- /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 | 25 | class Room 26 | { 27 | public: 28 | RoomStatus roomStatus; //0x0000 29 | uint8_t capacity; //0x0004 30 | uint8_t invitation; //0x0005 31 | uint8_t N000090AF; //0x0006 32 | uint8_t N000090AD; //0x0007 33 | wchar_t roomName[16]; //0x0008 34 | char pad_0028[8]; //0x0028 35 | RoomType roomType; //0x0030 36 | uint8_t N0001167D; //0x0031 37 | uint8_t N00011681; //0x0032 38 | uint8_t N0001167E; //0x0033 39 | uint8_t roundsToWinPlusMatchLimitBitfield; //0x0034 40 | uint8_t roundTime; //0x0035 41 | uint8_t skipTimeLimit; //0x0036 42 | uint8_t N00009510; //0x0037 43 | uint8_t memberCount; //0x0038 44 | uint8_t N0000910B; //0x0039 45 | uint8_t N0000910E; //0x003A 46 | uint8_t N0000910C; //0x003B 47 | uint32_t secondsElapsed; //0x003C 48 | char pad_0040[8]; //0x0040 49 | RoomMemberEntry member1; //0x0048 50 | RoomMemberEntry member2; //0x00E0 51 | RoomMemberEntry member3; //0x0178 52 | RoomMemberEntry member4; //0x0210 53 | RoomMemberEntry member5; //0x02A8 54 | RoomMemberEntry member6; //0x0340 55 | RoomMemberEntry member7; //0x03D8 56 | RoomMemberEntry member8; //0x0470 57 | }; //Size: 0x0508 58 | -------------------------------------------------------------------------------- /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/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_Bang8, 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 | 3 | enum MatchState_ 4 | { 5 | MatchState_NotStarted = 0, 6 | MatchState_RebelActionRoundSign = 2, 7 | MatchState_Fight = 3, 8 | MatchState_FinishSign = 4, 9 | MatchState_WinLoseSign = 5, 10 | MatchState_VictoryScreen = 7 11 | }; 12 | 13 | enum GameState 14 | { 15 | GameState_ArcsysLogo = 2, 16 | GameState_IntroVideoPlaying = 3, 17 | GameState_TitleScreen = 4, 18 | GameState_CharacterSelectionScreen = 6, 19 | GameState_ArcadeActSelectScreen = 11, 20 | GameState_ScoreAttackModeSelectScreen = 11, 21 | GameState_SpeedStarModeSelectScreen = 11, 22 | GameState_ArcadeCharInfoScreen = 12, 23 | GameState_ArcadeStageSelectScreen = 13, 24 | GameState_VersusScreen = 14, 25 | GameState_InMatch = 15, 26 | GameState_VictoryScreen = 16, 27 | GameState_StoryMenu = 24, 28 | GameState_GalleryMenu = 25, 29 | GameState_ItemMenu = 25, 30 | GameState_ReplayMenu = 26, 31 | GameState_MainMenu = 27, 32 | GameState_TutorialMenu = 28, 33 | GameState_LibraryMenu = 28, 34 | GameState_Lobby = 31, 35 | GameState_StoryPlaying = 33, 36 | GameState_AbyssMenu = 34, 37 | GameState_DCodeEdit = 39, 38 | }; 39 | 40 | enum GameMode 41 | { 42 | GameMode_Arcade = 1, 43 | GameMode_Story = 4, 44 | GameMode_Versus = 5, 45 | GameMode_Training = 6, 46 | GameMode_Tutorial = 7, 47 | GameMode_Challenge = 8, 48 | // GameMode_Gallery = 9, 49 | // GameMode_ItemShop = 10, 50 | GameMode_ReplayTheater = 11, 51 | // GameMode_TitleScreen = 12, 52 | // GameMode_MainMenuScreen = 13, 53 | GameMode_Online = 15, 54 | GameMode_Abyss = 16, 55 | // GameMode_DCodeEdit = 18, 56 | }; 57 | 58 | bool isPaletteEditingEnabledInCurrentState(); 59 | bool isHitboxOverlayEnabledInCurrentState(); 60 | bool isGameModeSelectorEnabledInCurrentState(); 61 | bool isStageSelectorEnabledInCurrentState(); 62 | 63 | bool isInMatch(); 64 | bool isInMenu(); 65 | bool isOnVersusScreen(); 66 | bool isOnReplayMenuScreen(); 67 | 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); //returns 0 if hook failed 27 | static bool SetHook(const char* label, void* newFunc, bool activate = true); 28 | static bool IsHookActivated(const char* label); 29 | static bool ActivateHook(const char* label); //0 hook not found, 1 success 30 | static bool DeactivateHook(const char* label); // 0 hook not found, 1 success 31 | static JMPBACKADDR GetJmpBackAddr(const char* label); /* do not call this whenever you want to jump back 32 | searching through the array each time is bad for performance, 33 | use this func ONCE to store the address in a variable*/ 34 | static bool SetJmpBackAddr(const char* label, DWORD newJmpBackAddr); 35 | static DWORD GetStartAddress(const char* label); 36 | static JMPBACKADDR RegisterHook(const char* label, const char* pattern, const char* mask, const int len); 37 | static int GetOriginalBytes(const char* label, int startIndex, int bytesToReturn); 38 | static int GetBytesFromAddr(const char* label, int startIndex, int bytesToReturn); 39 | static int OverWriteBytes(void* startAddress, void* endAddress, const char* pattern, const char* mask, const char* newBytes); 40 | static void Cleanup(); //empty atm 41 | private: 42 | static std::vector hooks; //stores hook structs 43 | static int GetHookStructIndex(const char* label); //returns the index of hook struct 44 | static bool SaveOriginalBytes(int hookIndex, void* startAddress, int len); 45 | static bool PlaceHook(void* toHook, void* ourFunc, int len); 46 | static bool RestoreOriginalBytes(int functionhook_index); 47 | static DWORD FindPattern(const char* pattern, const char* mask); 48 | }; -------------------------------------------------------------------------------- /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.cpp: -------------------------------------------------------------------------------- 1 | #include "NetworkManager.h" 2 | 3 | #include "RoomManager.h" 4 | 5 | #include "Core/interfaces.h" 6 | #include "Core/logger.h" 7 | #include "Core/utils.h" 8 | #include "Game/gamestates.h" 9 | #include "Overlay/Logger/ImGuiLogger.h" 10 | 11 | NetworkManager::NetworkManager(SteamNetworkingWrapper* SteamNetworking, CSteamID steamID) 12 | { 13 | m_pSteamNetworking = SteamNetworking; 14 | m_steamID = steamID; 15 | } 16 | 17 | NetworkManager::~NetworkManager() 18 | { 19 | } 20 | 21 | bool NetworkManager::SendPacket(CSteamID* steamID, Packet* packet) 22 | { 23 | LOG(2, "NetworkManager::SendPacket\n"); 24 | 25 | packet->steamID = m_steamID.ConvertToUint64(); 26 | 27 | LOG(2, "\tSending packet:\n"); 28 | LOG(2, "\tversion: %s\n", RawMemoryArrayToString((unsigned char*)&packet->version, sizeof(packet->version))); 29 | LOG(2, "\tpacketType: %s\n", RawMemoryArrayToString((unsigned char*)&packet->packetType, sizeof(packet->packetType))); 30 | LOG(2, "\tpart: %s\n", RawMemoryArrayToString((unsigned char*)&packet->part, sizeof(packet->part))); 31 | LOG(2, "\tpacketSize: %s\n", RawMemoryArrayToString((unsigned char*)&packet->packetSize, sizeof(packet->packetSize))); 32 | LOG(2, "\troomPlayerIndex: %s\n", RawMemoryArrayToString((unsigned char*)&packet->roomMemberIndex, sizeof(packet->roomMemberIndex))); 33 | LOG(2, "\tsteamID: %s\n", RawMemoryArrayToString((unsigned char*)&packet->steamID, sizeof(packet->steamID))); 34 | LOG(2, "\tdataSize: %s\n", RawMemoryArrayToString((unsigned char*)&packet->dataSize, sizeof(packet->dataSize))); 35 | //LOG(2, "\tdata: %s\n", RawMemoryArrayToString((unsigned char*)&packet->data, sizeof(packet->data))); 36 | 37 | EP2PSend sendType = k_EP2PSendUnreliable; 38 | 39 | return m_pSteamNetworking->SendP2PPacket(*steamID, packet, packet->packetSize, sendType, 0); 40 | } 41 | 42 | void NetworkManager::RecvPacket(Packet* packet) 43 | { 44 | LOG(7, "NetworkManager::RecvPacket\n"); 45 | 46 | if (!g_interfaces.pRoomManager->IsPacketFromSameRoom(packet)) 47 | { 48 | LOG(2, "[error] Packet received from not a room member. RoomPlayerIndex: %d, SteamID: %llu\n", 49 | packet->roomMemberIndex, packet->steamID); 50 | 51 | return; 52 | } 53 | 54 | switch (packet->packetType) 55 | { 56 | case PacketType_IMID_Announce: 57 | g_interfaces.pRoomManager->SendAcknowledge(packet); 58 | break; 59 | 60 | case PacketType_IMID_Acknowledge: 61 | g_interfaces.pRoomManager->AcceptAcknowledge(packet); 62 | break; 63 | 64 | case PacketType_PaletteInfo: 65 | if (g_interfaces.pRoomManager->IsPacketFromSameMatchNonSpectator(packet)) 66 | { 67 | g_interfaces.pOnlinePaletteManager->RecvPaletteInfoPacket(packet); 68 | } 69 | break; 70 | 71 | case PacketType_PaletteData: 72 | if (g_interfaces.pRoomManager->IsPacketFromSameMatchNonSpectator(packet)) 73 | { 74 | g_interfaces.pOnlinePaletteManager->RecvPaletteDataPacket(packet); 75 | } 76 | break; 77 | 78 | case PacketType_GameMode: 79 | if (g_interfaces.pRoomManager->IsPacketFromSameMatchNonSpectator(packet) && 80 | *g_gameVals.pGameState == GameState_CharacterSelectionScreen) 81 | { 82 | g_interfaces.pOnlineGameModeManager->RecvGameModePacket(packet); 83 | } 84 | break; 85 | 86 | default: 87 | LOG(2, "Unknown packet type received: %d\n", packet->packetType); 88 | g_imGuiLogger->Log("[error] Unknown packet type received (%d)\n", packet->packetType); 89 | } 90 | } 91 | 92 | bool NetworkManager::IsIMPacket(Packet* packet) 93 | { 94 | return packet->version == IM_PACKET_VERSION; 95 | } -------------------------------------------------------------------------------- /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 | }; 18 | 19 | // BBCF packets' first two fields must be the packet size 20 | struct Packet 21 | { 22 | uint16_t __packetSize; // BBCF packets' first two fields must be the packet size, the game performs validation on them upon receiving 23 | uint16_t packetSize; 24 | uint16_t version = IM_PACKET_VERSION; 25 | PacketType packetType; 26 | uint64_t steamID; 27 | uint16_t part; 28 | uint16_t roomMemberIndex; 29 | uint32_t dataSize; 30 | unsigned char data[MAX_DATA_SIZE]; 31 | 32 | Packet(void* dataSrc, uint16_t dataSize, PacketType packetType, uint16_t roomMemberIndex, uint16_t part = 0) 33 | : dataSize(dataSize), packetType(packetType), roomMemberIndex(roomMemberIndex), part(part) 34 | { 35 | // HeaderSize + dataSize 36 | packetSize = sizeof(Packet) - MAX_DATA_SIZE + dataSize; 37 | __packetSize = packetSize; 38 | 39 | if (dataSrc && dataSize) 40 | { 41 | memcpy_s(data, MAX_DATA_SIZE, dataSrc, dataSize); 42 | } 43 | } 44 | }; -------------------------------------------------------------------------------- /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 | bool IsPacketFromSameRoom(Packet* packet) const; 48 | bool IsPacketFromSameMatchNonSpectator(Packet* packet) const; 49 | bool IsThisPlayerSpectator() const; 50 | bool IsThisPlayerInMatch() const; 51 | void SetFFAThisPlayerIndex(int* pFFAThisPlayerIndex); 52 | uint16_t GetThisPlayerMatchPlayerIndex() const; 53 | uint16_t GetPlayerMatchPlayerIndexByRoomMemberIndex(uint16_t index) const; 54 | const std::string GetRoomTypeName() const; 55 | std::vector GetIMPlayersInCurrentMatch() const; 56 | std::vector GetIMPlayersInCurrentRoom() const; 57 | std::vector GetOtherRoomMemberEntriesInCurrentMatch() const; 58 | 59 | private: 60 | void SendAnnounce(); 61 | void AddIMPlayerToRoom(const IMPlayer& player); 62 | void RemoveIMPlayerFromRoom(uint16_t index); 63 | bool IsPacketFromSameMatch(Packet* packet) const; 64 | bool IsPacketFromSpectator(Packet* packet) const;; 65 | uint16_t GetThisPlayerRoomMemberIndex() const; 66 | const RoomMemberEntry* GetThisPlayerRoomMemberEntry() const; 67 | const RoomMemberEntry* GetRoomMemberEntryByIndex(uint16_t index) const; 68 | bool IsPlayerInRoom(const IMPlayer& player) const; 69 | bool IsThisPlayer(const uint64_t otherSteamID) const; 70 | const char* GetPlayerSteamName(uint64_t steamID) const; 71 | 72 | std::vector m_imPlayers; 73 | CSteamID m_thisPlayerSteamID; 74 | 75 | // Free-for-All fix 76 | int* m_pFFAThisPlayerIndex; 77 | 78 | // Interfaces 79 | NetworkManager* m_pNetworkManager; 80 | ISteamFriends* m_pSteamFriends; 81 | Room* m_pRoom; 82 | 83 | // For debug purposes 84 | friend class DebugWindow; 85 | }; 86 | -------------------------------------------------------------------------------- /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/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 DrawNotificationSection(); 20 | 21 | bool m_showDemoWindow = false; 22 | }; 23 | -------------------------------------------------------------------------------- /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 DrawOriginLine(ImVec2 worldPos, float rotationRad); 33 | void DrawCollisionAreas(const CharData* charObj, const ImVec2 playerWorldPos); 34 | 35 | bool IsOwnerEnabled(CharData* ownerCharInfo); 36 | bool WorldToScreen(LPDIRECT3DDEVICE9 pDevice, D3DXMATRIX* view, D3DXMATRIX* proj, D3DXVECTOR3* pos, D3DXVECTOR3* out); 37 | ImVec2 CalculateObjWorldPosition(const CharData* charObj); 38 | ImVec2 CalculateScreenPosition(ImVec2 worldPos); 39 | ImVec2 RotatePoint(ImVec2 center, float angleInRad, ImVec2 point); 40 | 41 | void RenderLine(const ImVec2& from, const ImVec2& to, uint32_t color, float thickness = 1.0f); 42 | void RenderCircle(const ImVec2& position, float radius, uint32_t color, float thickness = 1.0f, uint32_t segments = 16); 43 | void RenderCircleFilled(const ImVec2& position, float radius, uint32_t color, uint32_t segments = 16); 44 | void RenderRect(const ImVec2& pointA, const ImVec2& pointB, const ImVec2& pointC, const ImVec2& pointD, uint32_t color, float thickness = 1.0f); 45 | void RenderRect(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All, float thickness = 1.0f); 46 | void RenderRectFilled(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All); 47 | void RenderRectFilled(const ImVec2& pointA, const ImVec2& pointB, const ImVec2& pointC, const ImVec2& pointD, uint32_t color); 48 | 49 | // Literally a magic number as of now 50 | float m_scale = 0.346f; 51 | float m_rectThickness = 2.5f; 52 | float m_rectFillTransparency = 0.5f; 53 | 54 | ImGuiWindowFlags m_overlayWindowFlags = ImGuiWindowFlags_NoTitleBar 55 | | ImGuiWindowFlags_NoInputs 56 | | ImGuiWindowFlags_NoBringToFrontOnFocus 57 | | ImGuiWindowFlags_NoFocusOnAppearing; 58 | }; 59 | -------------------------------------------------------------------------------- /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/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 | 28 | const ImVec2 BTN_SIZE = ImVec2(60, 20); 29 | WindowContainer* m_pWindowContainer = nullptr; 30 | }; 31 | -------------------------------------------------------------------------------- /src/Overlay/Window/PaletteEditorWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IWindow.h" 3 | 4 | #include "Core/interfaces.h" 5 | #include "Game/characters.h" 6 | #include "Game/Player.h" 7 | #include "Palette/CharPaletteHandle.h" 8 | 9 | #include 10 | 11 | class PaletteEditorWindow : public IWindow 12 | { 13 | public: 14 | PaletteEditorWindow(const std::string& windowTitle, bool windowClosable, 15 | ImGuiWindowFlags windowFlags = 0) 16 | : IWindow(windowTitle, windowClosable, windowFlags), 17 | m_customPaletteVector(g_interfaces.pPaletteManager->GetCustomPalettesVector()) 18 | { 19 | OnMatchInit(); 20 | } 21 | ~PaletteEditorWindow() override = default; 22 | void ShowAllPaletteSelections(const std::string& windowID); 23 | void ShowReloadAllPalettesButton(); 24 | void OnMatchInit(); 25 | protected: 26 | void Draw() override; 27 | private: 28 | bool HasNullPointer(); 29 | void InitializeSelectedCharacters(); 30 | void CharacterSelection(); 31 | void PaletteSelection(); 32 | void FileSelection(); 33 | void EditingModesSelection(); 34 | void ShowPaletteBoxes(); 35 | void DisableHighlightModes(); 36 | void SavePaletteToFile(); 37 | void ReloadSavedPalette(const char* palName); 38 | bool ShowOverwritePopup(bool *p_open, const wchar_t* wFullPath, const char* filename); 39 | void CheckSelectedPalOutOfBound(); 40 | void ShowOnlinePaletteResetButton(Player& playerHandle, uint16_t thisPlayerMatchPlayerIndex, const char* btnText); 41 | void ShowPaletteSelectButton(Player & playerHandle, const char* btnText, const char* popupID); 42 | void ShowPaletteSelectPopup(CharPaletteHandle& charPalHandle, CharIndex charIndex, const char* popupID); 43 | void ShowHoveredPaletteInfoToolTip(const IMPL_info_t& palInfo, CharIndex charIndex, int palIndex); 44 | void HandleHoveredPaletteSelection(CharPaletteHandle* charPalHandle, CharIndex charIndex, int palIndex, const char* popupID, bool pressed); 45 | void ShowPaletteRandomizerButton(const char * btnID, Player& playerHandle); 46 | void CopyToEditorArray(const char* pSrc); 47 | void CopyPalFileToEditorArray(PaletteFile palFile, CharPaletteHandle &charPalHandle); 48 | void UpdateHighlightArray(int selectedBoxIndex); 49 | void CopyImplDataToEditorFields(CharPaletteHandle& charPalHandle); 50 | void ShowGradientPopup(); 51 | void GenerateGradient(int idx1, int idx2, int color1, int color2); 52 | 53 | std::vector>& m_customPaletteVector; 54 | Player* m_playerHandles[2]; 55 | std::string m_allSelectedCharNames[2]; 56 | const char* m_selectedCharName; 57 | CharPaletteHandle* m_selectedCharPalHandle; 58 | CharIndex m_selectedCharIndex; 59 | int m_selectedPalIndex; 60 | PaletteFile m_selectedFile; 61 | char m_paletteEditorArray[1024]; 62 | char m_highlightArray[IMPL_PALETTE_DATALEN]; 63 | int m_colorEditFlags; 64 | bool m_highlightMode; 65 | bool m_showAlpha; 66 | }; 67 | -------------------------------------------------------------------------------- /src/Overlay/Window/RoomWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "RoomWindow.h" 2 | 3 | #include "Core/interfaces.h" 4 | #include "Core/utils.h" 5 | #include "Game/gamestates.h" 6 | #include "Overlay/imgui_utils.h" 7 | #include "Overlay/WindowManager.h" 8 | #include "Overlay/Widget/ActiveGameModeWidget.h" 9 | #include "Overlay/Widget/GameModeSelectWidget.h" 10 | #include "Overlay/Widget/StageSelectWidget.h" 11 | #include "Overlay/Window/PaletteEditorWindow.h" 12 | 13 | void RoomWindow::BeforeDraw() 14 | { 15 | ImGui::SetWindowPos(m_windowTitle.c_str(), ImVec2(200, 200), ImGuiCond_FirstUseEver); 16 | 17 | //ImVec2 windowSizeConstraints; 18 | //switch (Settings::settingsIni.menusize) 19 | //{ 20 | //case 1: 21 | // windowSizeConstraints = ImVec2(250, 190); 22 | // break; 23 | //case 3: 24 | // windowSizeConstraints = ImVec2(400, 230); 25 | // break; 26 | //default: 27 | // windowSizeConstraints = ImVec2(330, 230); 28 | //} 29 | 30 | ImVec2 windowSizeConstraints = ImVec2(300, 190); 31 | 32 | ImGui::SetNextWindowSizeConstraints(windowSizeConstraints, ImVec2(1000, 1000)); 33 | } 34 | 35 | void RoomWindow::Draw() 36 | { 37 | if (!g_interfaces.pRoomManager->IsRoomFunctional()) 38 | { 39 | ImGui::TextDisabled("YOU ARE NOT IN A ROOM OR ONLINE MATCH!"); 40 | m_windowTitle = m_origWindowTitle; 41 | 42 | return; 43 | } 44 | 45 | std::string roomTypeName = g_interfaces.pRoomManager->GetRoomTypeName(); 46 | SetWindowTitleRoomType(roomTypeName); 47 | 48 | ImGui::Text("Online type: %s", roomTypeName.c_str()); 49 | 50 | ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); 51 | 52 | if (isStageSelectorEnabledInCurrentState()) 53 | { 54 | ImGui::VerticalSpacing(10); 55 | StageSelectWidget(); 56 | } 57 | 58 | if (isOnCharacterSelectionScreen() || isOnVersusScreen() || isInMatch()) 59 | { 60 | ImGui::VerticalSpacing(10); 61 | ActiveGameModeWidget(); 62 | } 63 | 64 | if (isGameModeSelectorEnabledInCurrentState()) 65 | { 66 | bool isThisPlayerSpectator = g_interfaces.pRoomManager->IsRoomFunctional() && g_interfaces.pRoomManager->IsThisPlayerSpectator(); 67 | 68 | if (!isThisPlayerSpectator) 69 | { 70 | GameModeSelectWidget(); 71 | } 72 | } 73 | 74 | if (isInMatch()) 75 | { 76 | ImGui::VerticalSpacing(10); 77 | WindowManager::GetInstance().GetWindowContainer()-> 78 | GetWindow(WindowType_PaletteEditor)->ShowAllPaletteSelections("Room"); 79 | } 80 | 81 | if (isInMenu()) 82 | { 83 | ImGui::VerticalSpacing(10); 84 | DrawRoomImPlayers(); 85 | } 86 | 87 | if (isOnCharacterSelectionScreen() || isOnVersusScreen() || isInMatch()) 88 | { 89 | ImGui::VerticalSpacing(10); 90 | DrawMatchImPlayers(); 91 | } 92 | 93 | ImGui::PopStyleVar(); 94 | } 95 | 96 | void RoomWindow::SetWindowTitleRoomType(const std::string& roomTypeName) 97 | { 98 | m_windowTitle = "Online - " + roomTypeName + "###Room"; 99 | } 100 | 101 | void RoomWindow::ShowClickableSteamUser(const char* playerName, const CSteamID& steamId) const 102 | { 103 | ImGui::TextUnformatted(playerName); 104 | ImGui::HoverTooltip("Click to open Steam profile"); 105 | if (ImGui::IsItemClicked()) 106 | { 107 | g_interfaces.pSteamFriendsWrapper->ActivateGameOverlayToUser("steamid", steamId); 108 | } 109 | } 110 | 111 | void RoomWindow::DrawRoomImPlayers() 112 | { 113 | ImGui::BeginGroup(); 114 | ImGui::TextUnformatted("Improvement Mod users in Room:"); 115 | ImGui::BeginChild("RoomImUsers", ImVec2(230, 150), true); 116 | 117 | for (const IMPlayer& imPlayer : g_interfaces.pRoomManager->GetIMPlayersInCurrentRoom()) 118 | { 119 | ShowClickableSteamUser(imPlayer.steamName.c_str(), imPlayer.steamID); 120 | ImGui::NextColumn(); 121 | } 122 | 123 | ImGui::EndChild(); 124 | ImGui::EndGroup(); 125 | } 126 | 127 | void RoomWindow::DrawMatchImPlayers() 128 | { 129 | ImGui::BeginGroup(); 130 | ImGui::TextUnformatted("Improvement Mod users in match:"); 131 | ImGui::BeginChild("MatchImUsers", ImVec2(230, 150), true); 132 | 133 | if (g_interfaces.pRoomManager->IsThisPlayerInMatch()) 134 | { 135 | ImGui::Columns(2); 136 | for (const IMPlayer& imPlayer : g_interfaces.pRoomManager->GetIMPlayersInCurrentMatch()) 137 | { 138 | uint16_t matchPlayerIndex = g_interfaces.pRoomManager->GetPlayerMatchPlayerIndexByRoomMemberIndex(imPlayer.roomMemberIndex); 139 | std::string playerType; 140 | 141 | if (matchPlayerIndex == 0) 142 | playerType = "Player 1"; 143 | else if (matchPlayerIndex == 1) 144 | playerType = "Player 2"; 145 | else 146 | playerType = "Spectator"; 147 | 148 | ShowClickableSteamUser(imPlayer.steamName.c_str(), imPlayer.steamID); 149 | ImGui::NextColumn(); 150 | 151 | ImGui::TextUnformatted(playerType.c_str()); 152 | ImGui::NextColumn(); 153 | } 154 | } 155 | 156 | ImGui::EndChild(); 157 | ImGui::EndGroup(); 158 | } 159 | -------------------------------------------------------------------------------- /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_FORUM, 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 | 11 | #include "Core/info.h" 12 | #include "Core/logger.h" 13 | #include "Core/Settings.h" 14 | 15 | WindowContainer::WindowContainer() 16 | { 17 | AddWindow(WindowType_Main, 18 | new MainWindow(MOD_WINDOW_TITLE, false, *this, ImGuiWindowFlags_AlwaysAutoResize)); 19 | 20 | AddWindow(WindowType_Log, 21 | new LogWindow("Log", true, *(ImGuiLogger*)g_imGuiLogger, 22 | ImGuiWindowFlags_NoCollapse)); 23 | 24 | AddWindow(WindowType_Debug, 25 | new DebugWindow("DEBUG", true)); 26 | 27 | AddWindow(WindowType_UpdateNotifier, 28 | new UpdateNotifierWindow("Update available", true, 29 | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)); 30 | 31 | AddWindow(WindowType_PaletteEditor, 32 | new PaletteEditorWindow("Palette Editor", true)); 33 | 34 | AddWindow(WindowType_HitboxOverlay, 35 | new HitboxOverlay("##HitboxOverlay", false, ImGuiWindowFlags_NoCollapse)); 36 | 37 | AddWindow(WindowType_Room, 38 | new RoomWindow("Online###Room", true, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)); 39 | } 40 | -------------------------------------------------------------------------------- /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 | }; 13 | -------------------------------------------------------------------------------- /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 | } 26 | -------------------------------------------------------------------------------- /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 | }; -------------------------------------------------------------------------------- /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/SteamUserStatsWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | interface SteamUserStatsWrapper : public ISteamUserStats 7 | { 8 | public: 9 | SteamUserStatsWrapper(ISteamUserStats**); 10 | ~SteamUserStatsWrapper(); 11 | 12 | ISteamUserStats* m_SteamUserStats; 13 | 14 | CALL_BACK(UserStatsReceived_t) 15 | bool RequestCurrentStats(); 16 | bool GetStat(const char *pchName, int32 *pData); 17 | bool GetStat(const char *pchName, float *pData); 18 | bool SetStat(const char *pchName, int32 nData); 19 | bool SetStat(const char *pchName, float fData); 20 | bool UpdateAvgRateStat(const char *pchName, float flCountThisSession, double dSessionLength); 21 | bool GetAchievement(const char *pchName, bool *pbAchieved); 22 | bool SetAchievement(const char *pchName); 23 | bool ClearAchievement(const char *pchName); 24 | bool GetAchievementAndUnlockTime(const char *pchName, bool *pbAchieved, uint32 *punUnlockTime); 25 | bool StoreStats(); 26 | int GetAchievementIcon(const char *pchName); 27 | const char *GetAchievementDisplayAttribute(const char *pchName, const char *pchKey); 28 | bool IndicateAchievementProgress(const char *pchName, uint32 nCurProgress, uint32 nMaxProgress); 29 | uint32 GetNumAchievements(); 30 | const char *GetAchievementName(uint32 iAchievement); 31 | CALL_RESULT(UserStatsReceived_t) 32 | SteamAPICall_t RequestUserStats(CSteamID steamIDUser); 33 | bool GetUserStat(CSteamID steamIDUser, const char *pchName, int32 *pData); 34 | bool GetUserStat(CSteamID steamIDUser, const char *pchName, float *pData); 35 | bool GetUserAchievement(CSteamID steamIDUser, const char *pchName, bool *pbAchieved); 36 | bool GetUserAchievementAndUnlockTime(CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime); 37 | bool ResetAllStats(bool bAchievementsToo); 38 | CALL_RESULT(LeaderboardFindResult_t) 39 | SteamAPICall_t FindOrCreateLeaderboard(const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType); 40 | CALL_RESULT(LeaderboardFindResult_t) 41 | SteamAPICall_t FindLeaderboard(const char *pchLeaderboardName); 42 | const char *GetLeaderboardName(SteamLeaderboard_t hSteamLeaderboard); 43 | int GetLeaderboardEntryCount(SteamLeaderboard_t hSteamLeaderboard); 44 | ELeaderboardSortMethod GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard); 45 | ELeaderboardDisplayType GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard); 46 | CALL_RESULT(LeaderboardScoresDownloaded_t) 47 | SteamAPICall_t DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd); 48 | METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) 49 | CALL_RESULT(LeaderboardScoresDownloaded_t) 50 | SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, 51 | ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers); 52 | bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax); 53 | CALL_RESULT(LeaderboardScoreUploaded_t) 54 | SteamAPICall_t UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount); 55 | CALL_RESULT(LeaderboardUGCSet_t) 56 | SteamAPICall_t AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC); 57 | CALL_RESULT(NumberOfCurrentPlayers_t) 58 | SteamAPICall_t GetNumberOfCurrentPlayers(); 59 | CALL_RESULT(GlobalAchievementPercentagesReady_t) 60 | SteamAPICall_t RequestGlobalAchievementPercentages(); 61 | int GetMostAchievedAchievementInfo(char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved); 62 | int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved); 63 | bool GetAchievementAchievedPercent(const char *pchName, float *pflPercent); 64 | CALL_RESULT(GlobalStatsReceived_t) 65 | SteamAPICall_t RequestGlobalStats(int nHistoryDays); 66 | bool GetGlobalStat(const char *pchStatName, int64 *pData); 67 | bool GetGlobalStat(const char *pchStatName, double *pData); 68 | int32 GetGlobalStatHistory(const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData); 69 | int32 GetGlobalStatHistory(const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData); 70 | 71 | #ifdef _PS3 72 | bool InstallPS3Trophies(); 73 | uint64 GetTrophySpaceRequiredBeforeInstall(); 74 | bool SetUserStatsData(const void *pvData, uint32 cubData); 75 | bool GetUserStatsData(void *pvData, uint32 cubData, uint32 *pcubWritten); 76 | #endif 77 | }; -------------------------------------------------------------------------------- /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 "Overlay/Logger/ImGuiLogger.h" 8 | #include "Overlay/WindowManager.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | std::string newVersionNum = ""; 15 | 16 | std::string GetNewVersionNum() 17 | { 18 | if (newVersionNum != "") 19 | { 20 | return newVersionNum; 21 | } 22 | 23 | return ""; 24 | } 25 | 26 | void CheckUpdate() 27 | { 28 | std::wstring wUrl = MOD_LINK_FORUM; 29 | std::string data = DownloadUrl(wUrl); 30 | 31 | if (strcmp(data.c_str(), "") == 0) 32 | { 33 | g_imGuiLogger->Log("[error] Update check failed. No data downloaded.\n"); 34 | LOG(2, "Update check failed.No data downloaded.\n"); 35 | return; 36 | } 37 | 38 | data = data.substr(0, 950).c_str(); 39 | 40 | // Fits on: [BBCF IMPROVEMENT MOD] (v2.06 41 | // and captures: v2.06 42 | std::regex r("<title>.+(v\\d\.\\d\\d)"); 43 | std::smatch m; 44 | std::regex_search(data, m, r); 45 | 46 | if (m[1].str() == "") 47 | { 48 | g_imGuiLogger->Log("[error] Update check failed. Regex no match.\n"); 49 | return; 50 | } 51 | 52 | if (strcmp(m[1].str().c_str(), MOD_VERSION_NUM) != 0) 53 | { 54 | newVersionNum = m[1].str(); 55 | 56 | LOG(2, "New version found: %s\n", newVersionNum.c_str()); 57 | g_imGuiLogger->Log("[system] Update available: BBCF Improvement Mod %s has been released!\n", 58 | newVersionNum.c_str()); 59 | 60 | WindowManager::GetInstance().GetWindowContainer()->GetWindow(WindowType_UpdateNotifier)->Open(); 61 | } 62 | else 63 | { 64 | g_imGuiLogger->Log("[system] BBCF Improvement Mod is up-to-date\n"); 65 | } 66 | } 67 | 68 | void StartAsyncUpdateCheck() 69 | { 70 | if (MOD_FORCE_DISABLE_UPDATE_CHECK) 71 | return; 72 | 73 | if (Settings::settingsIni.checkupdates) 74 | { 75 | CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)CheckUpdate, nullptr, 0, nullptr)); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Web/update_check.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include <string> 3 | 4 | std::string GetNewVersionNum(); 5 | void StartAsyncUpdateCheck(); -------------------------------------------------------------------------------- /src/Web/url_downloader.cpp: -------------------------------------------------------------------------------- 1 | #include "url_downloader.h" 2 | 3 | #include "url_downloader.h" 4 | 5 | #include "Core/utils.h" 6 | #include "Overlay/Logger/ImGuiLogger.h" 7 | 8 | #include <wininet.h> 9 | 10 | #pragma comment(lib,"wininet.lib") 11 | 12 | std::string DownloadUrl(std::wstring& wUrl) 13 | { 14 | std::string url(wUrl.begin(), wUrl.end()); 15 | 16 | HINTERNET connect = InternetOpen(L"MyBrowser", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); 17 | 18 | if (!connect) 19 | { 20 | g_imGuiLogger->Log("[error] DownloadUrl failed. Connection Failed or Syntax error with URL\n'%s'\n", url.c_str()); 21 | return ""; 22 | } 23 | 24 | HINTERNET OpenAddress = InternetOpenUrl(connect, wUrl.c_str(), NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); 25 | 26 | if (!OpenAddress) 27 | { 28 | DWORD ErrorNum = GetLastError(); 29 | g_imGuiLogger->Log("[error] DownloadUrl failed. Failed to open URL\n'%s'\ncode: %d\n", url.c_str(), ErrorNum); 30 | InternetCloseHandle(connect); 31 | return ""; 32 | } 33 | 34 | std::string receivedData = ""; 35 | 36 | char DataReceived[4096]; 37 | DWORD NumberOfBytesRead = 0; 38 | while (InternetReadFile(OpenAddress, DataReceived, 4096, &NumberOfBytesRead) && NumberOfBytesRead) 39 | { 40 | receivedData.append(DataReceived, NumberOfBytesRead); 41 | } 42 | 43 | InternetCloseHandle(OpenAddress); 44 | InternetCloseHandle(connect); 45 | 46 | return receivedData; 47 | } 48 | 49 | unsigned long DownloadUrlBinary(std::wstring& wUrl, void** outBuffer) 50 | { 51 | std::string url(wUrl.begin(), wUrl.end()); 52 | 53 | HINTERNET connect = InternetOpen(L"MyBrowser", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); 54 | 55 | if (!connect) 56 | { 57 | g_imGuiLogger->Log( 58 | "[error] DownloadUrlBinary failed. Connection Failed or Syntax error with URL\n'%s'\n", 59 | url.c_str() 60 | ); 61 | return 0; 62 | } 63 | 64 | HINTERNET OpenAddress = InternetOpenUrl(connect, wUrl.c_str(), NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); 65 | 66 | if (!OpenAddress) 67 | { 68 | DWORD ErrorNum = GetLastError(); 69 | g_imGuiLogger->Log( 70 | "[error] DownloadUrlBinary failed. Failed to open URL\n'%s'\ncode: %d\n", 71 | url.c_str(), ErrorNum 72 | ); 73 | InternetCloseHandle(connect); 74 | return 0; 75 | } 76 | 77 | DWORD numberOfBytesRead = 0; 78 | DWORD returnedBytesRead = 0; 79 | bool result = false; 80 | do 81 | { 82 | char buffer[2000]; 83 | result = InternetReadFile(OpenAddress, buffer, sizeof(buffer), &numberOfBytesRead); 84 | 85 | // Re-allocate memory 86 | char* tempData = new char[returnedBytesRead + numberOfBytesRead]; 87 | memcpy(tempData, *outBuffer, returnedBytesRead); 88 | memcpy(tempData + returnedBytesRead, buffer, numberOfBytesRead); 89 | SAFE_DELETE_ARRAY(*outBuffer); 90 | *outBuffer = tempData; 91 | 92 | returnedBytesRead += numberOfBytesRead; 93 | 94 | } while (result && numberOfBytesRead); 95 | 96 | InternetCloseHandle(OpenAddress); 97 | InternetCloseHandle(connect); 98 | 99 | return returnedBytesRead; 100 | } 101 | -------------------------------------------------------------------------------- /src/Web/url_downloader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include <string> 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 | --------------------------------------------------------------------------------