This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- LOGGER.DLL: Finished: - Finally discarded the visual console in-game feature due to several problems with memory leaks managing the char* buffer on DIV memory from DLL. - Remain the log to file feature. - Updated LOGGER.PRG file.
- Loading branch information
José Miguel Sánchez Fernández
committed
Jun 8, 2020
1 parent
bd5b0df
commit 54ee928
Showing
4 changed files
with
49 additions
and
218 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -1,41 +1,18 @@ | ||
/* ---------------------------------------------------------------------------- | ||
* LOGGER.DLL - File logger and console for DIV Games Studio 2. | ||
* LOGGER.DLL - File logger for DIV Games Studio 2. | ||
* (C) VisualStudioEX3, José Miguel Sánchez Fernández - 2020 | ||
* DIV Games Studio 2 (C) Hammer Technologies - 1998, 1999 | ||
* ---------------------------------------------------------------------------- */ | ||
|
||
#include <direct.h> | ||
#include "..\common.h" | ||
|
||
#define default_console_str_length 80 | ||
#define default_console_max_lines 15 | ||
#define log_folder "LOGS" | ||
#define log_ok file != NULL | ||
#define separator "-------------------------------------------------------------------------------" | ||
|
||
#define enable fileEnable || consoleEnable | ||
#define console_full_line_len consoleStrLen + 1 // strlen + \0 | ||
#define console_buffer_size console_full_line_len * consoleMaxLines | ||
|
||
int fileEnable; | ||
FILE* file; | ||
|
||
char* separator; | ||
|
||
int consoleEnable; | ||
int consoleVisible; | ||
int consoleStrLen; | ||
int consoleMaxLines; // Max lines to show. | ||
char* consoleBuffer; // (strLength + 1) * maxLines. | ||
int consoleWriteIndex; // Line to write. | ||
|
||
void _log(char* message); | ||
void cwrite(int index, char* text); | ||
char* cread(int index); | ||
void cclear(); | ||
|
||
void init(); | ||
void isFileEnabled(); | ||
void isConsoleEnabled(); | ||
void log(); | ||
void show(); | ||
void hide(); | ||
void clear(); | ||
int log(char* message); | ||
void div_log(); |
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