-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dev helper for windowed game debug
- Loading branch information
Showing
21 changed files
with
1,816 additions
and
511 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Created by DiaLight on 06.08.2024. | ||
// | ||
|
||
#ifndef FLAME_GAME_VERSION_PATCH_H | ||
#define FLAME_GAME_VERSION_PATCH_H | ||
|
||
|
||
|
||
namespace game_version_patch { | ||
extern bool enabled; | ||
char *getFileVersion(); | ||
} | ||
|
||
|
||
#endif //FLAME_GAME_VERSION_PATCH_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set(TARGET devhelper) | ||
|
||
enable_language(ASM_MASM) | ||
add_library(${TARGET} SHARED | ||
dllmain.cpp | ||
mimicry.cpp | ||
console.cpp | ||
game_version.cpp | ||
) | ||
|
||
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) | ||
target_compile_definitions(${TARGET} PRIVATE DIRECTINPUT_VERSION=0x0500 DIRECT3D_VERSION=0x0600) | ||
|
||
add_custom_command(TARGET ${TARGET} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
$<TARGET_FILE:${TARGET}> | ||
"${DEV_DK2_DIR}/devht.dll" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// Created by DiaLight on 16.08.2024. | ||
// | ||
|
||
#include "console.h" | ||
#include <Windows.h> | ||
#include <ios> | ||
#include <io.h> | ||
#include <fcntl.h> | ||
|
||
|
||
void RedirectStandardIo() { | ||
/* This clever code have been found at: | ||
Adding Console I/O to a Win32 GUI App | ||
Windows Developer Journal, December 1997 | ||
http://dslweb.nwnexus.com/~ast/dload/guicon.htm | ||
Andrew Tucker's Home Page */ | ||
|
||
// redirect unbuffered STDOUT to the console | ||
long lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); | ||
int hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); | ||
if(hConHandle > 0) { | ||
FILE *fp = _fdopen(hConHandle, "w"); | ||
*stdout = *fp; | ||
setvbuf(stdout, NULL, _IONBF, 0); | ||
} | ||
|
||
// redirect unbuffered STDIN to the console | ||
lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); | ||
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); | ||
if(hConHandle > 0) { | ||
FILE *fp = _fdopen( hConHandle, "r" ); | ||
*stdin = *fp; | ||
setvbuf(stdin, NULL, _IONBF, 0); | ||
} | ||
|
||
// redirect unbuffered STDERR to the console | ||
lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); | ||
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); | ||
if(hConHandle > 0) { | ||
FILE *fp = _fdopen(hConHandle, "w"); | ||
*stderr = *fp; | ||
setvbuf(stderr, NULL, _IONBF, 0 ); | ||
} | ||
|
||
// make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog point to console as well | ||
std::ios::sync_with_stdio(); | ||
} | ||
|
||
|
||
bool initConsole() { | ||
AllocConsole(); | ||
freopen_s((FILE**)stdout, "CONOUT$", "w", stdout); | ||
freopen_s((FILE**)stderr, "CONOUT$", "w", stderr); | ||
|
||
RedirectStandardIo(); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Created by DiaLight on 16.08.2024. | ||
// | ||
|
||
#ifndef FLAME_CONSOLE_H | ||
#define FLAME_CONSOLE_H | ||
|
||
|
||
bool initConsole(); | ||
|
||
|
||
#endif //FLAME_CONSOLE_H |
Oops, something went wrong.