/*
** Command & Conquer Renegade(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Commando *
* *
* $Archive:: /Commando/Code/Combat/debug.h $*
* *
* $Author:: Byon_g $*
* *
* $Modtime:: 12/18/01 10:36a $*
* *
* $Revision:: 27 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef DEBUG_H
#define DEBUG_H
#ifndef ALWAYS_H
#include "always.h"
#endif
#ifndef WWDEBUG_H
#include "wwdebug.h"
#endif
#ifndef BITTYPE_H
#include "bittype.h"
#endif
#ifndef __WIDESTRING_H
#include "widestring.h"
#endif
#ifndef VECTOR3_H
#include "vector3.h"
#endif
#ifndef VECTOR4_H
#include "vector4.h"
#endif
//#ifndef _CONTEXT
//struct CONTEXT;
//#define TEMP_CONTEXT_DEFINE
//#endif
//int Stack_Walk(unsigned long *return_addresses, int num_addresses, CONTEXT *context = NULL);
//#ifdef TEMP_CONTEXT_DEFINE
//#undef CONTEXT
//#endif
/*
**
*/
class DebugDisplayHandlerClass {
public:
virtual void Display_Text( const char * string, const Vector4 & color = Vector4( 1,1,1,1 ) ) = 0;
virtual void Display_Text( const WideStringClass & string, const Vector4 & color = Vector4( 1,1,1,1 ) ) = 0;
};
/*
**
*/
class DebugManager {
public:
static void Init( void );
static void Shutdown( void );
static void Update( void );
static void Load_Registry_Settings( const char * sub_key );
static void Save_Registry_Settings( const char * sub_key );
//
// Version number support. The major revision number is stored in the
// hiword of the version, the minor revision number is stored in the loword.
//
static int Get_Version_Number (void) { return VersionNumber; }
static void Set_Version_Number (int number) { VersionNumber = number; }
/*
** Debug Displaying
*/
enum DebugDevice {
DEBUG_DEVICE_SCREEN = 1<<0,
DEBUG_DEVICE_MONO = 1<<1,
DEBUG_DEVICE_SRDEBUG = 1<<2, // OBSOLETE!
DEBUG_DEVICE_DBWIN32 = 1<<3,
DEBUG_DEVICE_LOG = 1<<4,
DEBUG_DEVICE_WINDOWS = 1<<5,
};
static void Enable_Device( DebugDevice device ) { EnabledDevices |= device; }
static void Disable_Device( DebugDevice device ) { EnabledDevices &= ~device; }
static void Toggle_Device_Enabled( DebugDevice device ) { EnabledDevices ^= device; }
static bool Is_Device_Enabled( DebugDevice device ) { return (EnabledDevices & device) != 0; }
enum DebugType {
DEBUG_TYPE_INFORMATION = 1<