| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef RELEASE |
| 20 | |
| 21 | #include <cstdarg> |
| 22 | #include <cstdio> |
| 23 | |
| 24 | #include <windows.h> |
| 25 | #include <fcntl.h> |
| 26 | |
| 27 | #include "debug.h" |
| 28 | #include "mono.h" |
| 29 | |
| 30 | // --------------------------------------------------------------------------- |
| 31 | // console debugging functions |
| 32 | |
| 33 | static char Mono_buffer[MAX_MONO_LENGTH]; |
| 34 | |
| 35 | void Debug_ConsolePrintf(int n, const char *format, ...) { |
| 36 | char *ptr = Mono_buffer; |
| 37 | std::va_list args; |
| 38 | |
| 39 | va_start(args, format); |
| 40 | std::vsnprintf(ptr, MAX_MONO_LENGTH, format, args); |
| 41 | va_end(args); |
| 42 | |
| 43 | if (strlen(ptr) >= MAX_MONO_LENGTH) { |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | Debug_LogWrite(Mono_buffer); |
| 48 | |
| 49 | if (n == 0) { |
| 50 | OutputDebugString(Mono_buffer); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | void Debug_ConsolePrintfAt(int n, int row, int col, const char *format, ...) {} |
| 55 | |
| 56 | #endif |