mirror of
https://github.com/Ed94/HandmadeHero.git
synced 2025-06-16 11:41:47 -07:00
Fixed bugs with optimized builds
Symbol table for engine module was out of order.
This commit is contained in:
@ -299,7 +299,6 @@ void play_input( EngineState* state, InputState* input, platform::ModuleAPI* pla
|
||||
if ( controller->Keyboard )
|
||||
{
|
||||
*controller->Keyboard = new_input.Controllers[idx].Keyboard;
|
||||
printf("keyboard D key: %d\n", controller->Keyboard->D.EndedDown );
|
||||
}
|
||||
|
||||
if ( controller->Mouse )
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Casting
|
||||
|
||||
#define ccast( Type, Value ) ( * const_cast< Type* >( & (Value) ) )
|
||||
#define ccast( Type, Value ) ( const_cast< Type >( (Value) ) )
|
||||
#define pcast( Type, Value ) ( * reinterpret_cast< Type* >( & ( Value ) ) )
|
||||
#define rcast( Type, Value ) reinterpret_cast< Type >( Value )
|
||||
#define scast( Type, Value ) static_cast< Type >( Value )
|
||||
|
@ -18,6 +18,8 @@
|
||||
#pragma warning( disable: 5045 ) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
|
||||
#pragma warning( disable: 5264 ) // Support for 'const' variables unused
|
||||
#pragma warning( disable: 4820 ) // Support auto-adding padding to structs
|
||||
#pragma warning( disable: 4711 ) // Support automatic inline expansion
|
||||
#pragma warning( disable: 4710 ) // Support automatic inline expansion
|
||||
|
||||
// TODO(Ed) : REMOVE THESE WHEN HE GETS TO THEM
|
||||
#include <math.h> // TODO : Implement math ourselves
|
||||
|
@ -7,7 +7,7 @@ void str_concat( u32 dest_size, char* dest
|
||||
, u32 str_b_len, char const* str_b );
|
||||
u32 str_length( char const* str );
|
||||
|
||||
#define str_ascii( str ) { sizeof( str ) - 1, str }
|
||||
#define str_ascii( str ) { sizeof( str ) - 1, ccast( char*, str) }
|
||||
|
||||
// Length tracked raw strings.
|
||||
struct Str
|
||||
@ -118,10 +118,10 @@ void str_concat( u32 dest_size, char* dest
|
||||
char* dest_b = dest + str_a_len;
|
||||
if ( str_a_len > str_b_len )
|
||||
{
|
||||
u32 left = str_a_len;
|
||||
u32 left = str_b_len;
|
||||
while ( left-- )
|
||||
{
|
||||
*dest_a = *str_a;
|
||||
*dest_a = *str_a;
|
||||
*dest_b = *str_b;
|
||||
|
||||
++ dest_a;
|
||||
@ -133,14 +133,14 @@ void str_concat( u32 dest_size, char* dest
|
||||
left = str_a_len - str_b_len;
|
||||
while ( left-- )
|
||||
{
|
||||
*dest_b = *str_b;
|
||||
++ dest_b;
|
||||
++ str_b;
|
||||
*dest_a = *str_a;
|
||||
++ dest_a;
|
||||
++ str_a;
|
||||
}
|
||||
}
|
||||
else if ( str_a_len < str_b_len )
|
||||
{
|
||||
u32 left = str_b_len;
|
||||
u32 left = str_a_len;
|
||||
while ( left-- )
|
||||
{
|
||||
*dest_a = *str_a;
|
||||
@ -154,9 +154,9 @@ void str_concat( u32 dest_size, char* dest
|
||||
left = str_b_len - str_a_len;
|
||||
while ( left-- )
|
||||
{
|
||||
*dest_a = *str_a;
|
||||
++ dest_a;
|
||||
++ str_a;
|
||||
*dest_b = *str_b;
|
||||
++ dest_b;
|
||||
++ str_b;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1064,9 +1064,9 @@ void* get_binary_module_symbol( BinaryModule module, char const* symbol_name )
|
||||
|
||||
#pragma region Engine Module API
|
||||
|
||||
constexpr Str FName_Engine_DLL = str_ascii("handmade_engine.dll");
|
||||
constexpr Str FName_Engine_DLL_InUse = str_ascii("handmade_engine_in_use.dll");
|
||||
constexpr Str FName_Engine_PDB_Lock = str_ascii("handmade_engine.pdb.lock");
|
||||
constexpr const Str FName_Engine_DLL = str_ascii("handmade_engine.dll");
|
||||
constexpr const Str FName_Engine_DLL_InUse = str_ascii("handmade_engine_in_use.dll");
|
||||
constexpr const Str FName_Engine_PDB_Lock = str_ascii("handmade_engine.pdb.lock");
|
||||
|
||||
global HMODULE Lib_Handmade_Engine = nullptr;
|
||||
global StrFixed< S16_MAX > Path_Engine_DLL;
|
||||
@ -1093,7 +1093,7 @@ engine::ModuleAPI load_engine_module_api()
|
||||
|
||||
File symbol_table {};
|
||||
symbol_table.Path = path_handmade_engine_symbols;
|
||||
if ( ! file_read_content( & symbol_table ) )
|
||||
if ( file_read_content( & symbol_table ), symbol_table.Size == 0 )
|
||||
{
|
||||
fatal( "Failed to load symbol table for handmade engine module!" );
|
||||
return {};
|
||||
@ -1218,7 +1218,8 @@ WinMain( HINSTANCE instance, HINSTANCE prev_instance, LPSTR commandline, int sho
|
||||
}
|
||||
|
||||
window_handle = CreateWindowExW(
|
||||
WS_EX_LAYERED | WS_EX_TOPMOST,
|
||||
// WS_EX_LAYERED | WS_EX_TOPMOST,
|
||||
WS_EX_LAYERED,
|
||||
window_class.lpszClassName,
|
||||
L"Handmade Hero",
|
||||
WS_Overlapped_Window | WS_Initially_Visible,
|
||||
|
Reference in New Issue
Block a user