Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions EEex-v2.6.6.0/EEex-v2.6.6.0.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ClCompile Include="source\EEex-v2.6.6.0\coordinate_util.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\debug.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\EEex.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\engine_function_names.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\engine_reimplementations.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\font_util.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\Generated\Baldur-v2.6.6.0_generated_internal_pointers.cpp" />
Expand All @@ -23,6 +24,7 @@
<ClCompile Include="source\EEex-v2.6.6.0\lua_util.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\main.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\menu_util.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\profiler.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\time_util.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\uncap_fps.cpp" />
<ClCompile Include="source\EEex-v2.6.6.0\util.cpp" />
Expand All @@ -33,9 +35,11 @@
<ClInclude Include="headers\EEex-v2.6.6.0\coordinate_util.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\EEex.h" />
<ClInclude Include="headers\EEex-v2.6.6.0\EEexLua_generated.h" />
<ClInclude Include="headers\EEex-v2.6.6.0\engine_function_names.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\font_util.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\lua_util.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\menu_util.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\profiler.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\time_util.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\uncap_fps.hpp" />
<ClInclude Include="headers\EEex-v2.6.6.0\util.hpp" />
Expand All @@ -46,6 +50,9 @@
<None Include="COPY_TO_GAME.ps1" />
<None Include="EEex-v2.6.6.0.def" />
</ItemGroup>
<ItemGroup>
<MASM Include="source\EEex-v2.6.6.0\profiler_assembly.asm" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
Expand All @@ -69,6 +76,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
Expand Down Expand Up @@ -146,5 +154,6 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>
17 changes: 17 additions & 0 deletions EEex-v2.6.6.0/EEex-v2.6.6.0.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
<ClCompile Include="source\EEex-v2.6.6.0\debug.cpp">
<Filter>Source Files\EEex-v2.6.6.0</Filter>
</ClCompile>
<ClCompile Include="source\EEex-v2.6.6.0\profiler.cpp">
<Filter>Source Files\EEex-v2.6.6.0</Filter>
</ClCompile>
<ClCompile Include="source\EEex-v2.6.6.0\engine_function_names.cpp">
<Filter>Source Files\EEex-v2.6.6.0</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="headers\EEex-v2.6.6.0\util.hpp">
Expand Down Expand Up @@ -122,6 +128,12 @@
<ClInclude Include="headers\EEex-v2.6.6.0\font_util.hpp">
<Filter>Header Files\EEex-v2.6.6.0</Filter>
</ClInclude>
<ClInclude Include="headers\EEex-v2.6.6.0\profiler.hpp">
<Filter>Header Files\EEex-v2.6.6.0</Filter>
</ClInclude>
<ClInclude Include="headers\EEex-v2.6.6.0\engine_function_names.hpp">
<Filter>Header Files\EEex-v2.6.6.0</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="EEex-v2.6.6.0.def">
Expand All @@ -131,4 +143,9 @@
<Filter>Build Tasks</Filter>
</None>
</ItemGroup>
<ItemGroup>
<MASM Include="source\EEex-v2.6.6.0\profiler_assembly.asm">
<Filter>Source Files\EEex-v2.6.6.0</Filter>
</MASM>
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions EEex-v2.6.6.0/headers/EEex-v2.6.6.0/EEex.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace EEex {
int __cdecl Override_Infinity_TransitionMenu(lua_State* L);
int __cdecl Override_Infinity_WriteINILine(lua_State* L);
void __cdecl Override_uiDoFile(char* fileName);
void __cdecl Override_uiDrawMenuStack();
bool __cdecl Override_uiEventMenuStack(SDL_Event* pEvent, SDL_Rect* pWindow);

//-------------------------//
Expand Down Expand Up @@ -95,6 +96,8 @@ namespace EEex {
bool Opcode_Hook_Op280_ShouldSuppressWildSurgeVisuals(CGameSprite* pSprite);
// op319
bool Opcode_Hook_Op319_IsInverted(CGameEffect* pEffect);
// op342
void Opcode_Hook_Op342_OnUnhandledParam2(CGameEffect* pEffect, CGameSprite* pSprite);
// New op400
int Opcode_Hook_SetTemporaryAIScript_ApplyEffect(CGameEffect* pEffect, CGameSprite* pSprite);
void Opcode_Hook_SetTemporaryAIScript_OnRemove(CGameEffect* pEffect, CGameSprite* pSprite);
Expand Down Expand Up @@ -124,6 +127,7 @@ namespace EEex {
void Sprite_Hook_OnDestruct(CGameSprite* pSprite);
void Sprite_Hook_OnAfterEffectListUnmarshalled(CGameSprite* pSprite);
void Sprite_Hook_OnBeforeEffectListMarshalled(CGameSprite* pSprite);
byte Sprite_Hook_OnGetAttackFrameType(CGameSprite* pSprite, byte numAttacks);

////////////
// Action //
Expand Down Expand Up @@ -160,6 +164,7 @@ namespace EEex {
/////////

void Fix_Hook_HandleMiddleMouseDrag(SDL_Event* pEvent);
void Fix_Hook_ImplementWSPECIALSpeedColumn(CGameSprite* pSprite, int nProficiencyLevel, bool bOffHand);
void Fix_Hook_OnBeforeUIKillCapture();
bool Fix_Hook_OnUIItemCheckRenderScrollbar(uiItem* pItem, bool bVisible);
bool Fix_Hook_ShouldProcessEffectListSkipRolls();
Expand Down
8 changes: 8 additions & 0 deletions EEex-v2.6.6.0/headers/EEex-v2.6.6.0/engine_function_names.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#pragma once

#include <string>

const std::string& GetContainingFunctionName(uintptr_t address);
const std::string& GetFunctionName(uintptr_t address);
void LoadFunctionNames();
30 changes: 30 additions & 0 deletions EEex-v2.6.6.0/headers/EEex-v2.6.6.0/profiler.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#pragma once

#include "time_util.hpp"

enum class TraceType
{
NONE,
NORMAL,
SPAM
};

#pragma pack(push, 1)
struct SavedRegisters
{
byte xmm1[16];
byte xmm0[16];
uintptr_t r11;
uintptr_t r10;
uintptr_t r9;
uintptr_t r8;
uintptr_t rdx;
uintptr_t rcx;
uintptr_t rax;
};
#pragma pack(pop)

void Profiler_StartTrace(TimeType startTime, TraceType toStartType);
void __stdcall Profiler_Trace(uintptr_t funcAddress, const SavedRegisters* savedRegisters, void* stackPtr);
void Profiler_RegisterTrace(const char* traceName, uintptr_t address, TimeType logTimeThreshold);
10 changes: 8 additions & 2 deletions EEex-v2.6.6.0/headers/EEex-v2.6.6.0/time_util.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

#pragma once

//-----------------------------//
// Type Defs //
//-----------------------------//

typedef long long TimeType;

//-----------------------------//
// Functions //
//-----------------------------//

DWORD getHighestRefreshRate();
long long getInitTime();
long long getTime();
TimeType getInitTime();
TimeType getTime();
void initTimeUtil();
Loading