engine memory adjustment moved console history in the C++ separate file

engine memory adjustment
moved console history in the C++ separate file

diff --git a/src/engine/API/consoleHistory_api.hpp b/src/engine/API/consoleHistory_api.hpp
new file mode 100644
index 0000000..42b208c
--- /dev/null
+++ b/src/engine/API/consoleHistory_api.hpp
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////////////
+// Copyright(C) 2018 - 2021 Dusan Jocic <dusanjocic@msn.com>
+//
+// This file is part of the OpenWolf GPL Source Code.
+// OpenWolf Source Code 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.
+//
+// OpenWolf Source Code 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 OpenWolf Source Code.  If not, see <http://www.gnu.org/licenses/>.
+//
+// In addition, the OpenWolf Source Code is also subject to certain additional terms.
+// You should have received a copy of these additional terms immediately following the
+// terms and conditions of the GNU General Public License which accompanied the
+// OpenWolf Source Code. If not, please request a copy in writing from id Software
+// at the address below.
+//
+// If you have questions concerning this license or the applicable additional terms,
+// you may contact in writing id Software LLC, c/o ZeniMax Media Inc.,
+// Suite 120, Rockville, Maryland 20850 USA.
+//
+// -------------------------------------------------------------------------------------
+// File name:   consoleHistory_api.hpp
+// Created:
+// Compilers:   Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64,
+//              gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
+// Description:
+// -------------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef __CONSOLEHISTORY_API_H__
+#define __CONSOLEHISTORY_API_H__
+
+//
+// idConsoleHistorySystem
+//
+class idConsoleHistorySystem
+{
+public:
+    virtual void Load( void ) = 0;
+    virtual void Save( void ) = 0;
+    virtual void Add( pointer field ) = 0;
+    virtual pointer Prev( void ) = 0;
+    virtual pointer Next( pointer field ) = 0;
+};
+
+extern idConsoleHistorySystem* consoleHistorySystem;
+
+#endif //!__CONSOLEHISTORY_API_H__
diff --git a/src/engine/GPURenderer/r_bsp_tech3.cpp b/src/engine/GPURenderer/r_bsp_tech3.cpp
index b91732f..d2782b7 100644
--- a/src/engine/GPURenderer/r_bsp_tech3.cpp
+++ b/src/engine/GPURenderer/r_bsp_tech3.cpp
@@ -88,7 +88,7 @@ static void HSVtoRGB( float32 h, float32 s, float32 v, float32 rgb[3] )
         default:
             rgb[0] =
                 rgb[1] =
-                rgb[2] = 0;
+                    rgb[2] = 0;
             break;
     }
 }
diff --git a/src/engine/client/cl_keys.cpp b/src/engine/client/cl_keys.cpp
index cfe80fa..d57e562 100644
--- a/src/engine/client/cl_keys.cpp
+++ b/src/engine/client/cl_keys.cpp
@@ -724,7 +724,7 @@ void Console_Key( sint key )
         }
         
         // copy line to history buffer
-        Hist_Add( g_consoleField.buffer );
+        consoleHistorySystem->Add( g_consoleField.buffer );
         if( cls.state == CA_DISCONNECTED )
         {
             clientScreenSystem->UpdateScreen();     // force an update, because the command
@@ -755,7 +755,7 @@ void Console_Key( sint key )
     if( ( key == K_MWHEELUP && keys[K_SHIFT].down ) || ( key == K_UPARROW ) || ( key == K_KP_UPARROW ) ||
             ( ( tolower( key ) == 'p' ) && keys[K_CTRL].down ) )
     {
-        Q_strncpyz( g_consoleField.buffer, Hist_Prev(), sizeof( g_consoleField.buffer ) );
+        Q_strncpyz( g_consoleField.buffer, consoleHistorySystem->Prev(), sizeof( g_consoleField.buffer ) );
         g_consoleField.cursor = strlen( g_consoleField.buffer );
         if( g_consoleField.cursor >= g_consoleField.widthInChars )
         {
@@ -772,7 +772,7 @@ void Console_Key( sint key )
     if( ( key == K_MWHEELDOWN && keys[K_SHIFT].down ) || ( key == K_DOWNARROW ) || ( key == K_KP_DOWNARROW ) ||
             ( ( tolower( key ) == 'n' ) && keys[K_CTRL].down ) )
     {
-        pointer history = Hist_Next( g_consoleField.buffer );
+        pointer history = consoleHistorySystem->Next( g_consoleField.buffer );
         if( history )
         {
             Q_strncpyz( g_consoleField.buffer, history, sizeof( g_consoleField.buffer ) );
@@ -788,7 +788,7 @@ void Console_Key( sint key )
         }
         else if( g_consoleField.buffer[0] )
         {
-            Hist_Add( g_consoleField.buffer );
+            consoleHistorySystem->Add( g_consoleField.buffer );
             Field_Clear( &g_consoleField );
         }
         return;
diff --git a/src/engine/client/clientScreen.cpp b/src/engine/client/clientScreen.cpp
index bfb8ddf..80f0132 100644
--- a/src/engine/client/clientScreen.cpp
+++ b/src/engine/client/clientScreen.cpp
@@ -505,7 +505,7 @@ void idClientScreenSystemLocal::DrawScreenField( stereoFrame_t stereoFrame )
     // unless they are displaying game renderings
     if( uiFullscreen || cls.state < CA_LOADING )
     {
-        if( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 )
+        if( cls.glconfig.vidWidth * 480 != cls.glconfig.vidHeight * 640 )
         {
             renderSystem->SetColor( g_color_table[0] );
             renderSystem->DrawStretchPic( 0, 0, ( float32 )cls.glconfig.vidWidth, ( float32 )cls.glconfig.vidHeight, 0, 0, 0, 0, cls.whiteShader );
diff --git a/src/engine/console/consoleCurses.cpp b/src/engine/console/consoleCurses.cpp
index cc84d19..eca49d5 100644
--- a/src/engine/console/consoleCurses.cpp
+++ b/src/engine/console/consoleCurses.cpp
@@ -533,7 +533,7 @@ valueType* idConsoleCursesLocal::Input( void )
                     continue;
                 }
                 
-                Hist_Add( input_field.buffer );
+                consoleHistorySystem->Add( input_field.buffer );
                 Q_strcpy_s( text, input_field.buffer );
                 Field_Clear( &input_field );
                 werase( inputwin );
@@ -569,12 +569,12 @@ valueType* idConsoleCursesLocal::Input( void )
                 }
                 continue;
             case KEY_UP:
-                Q_strncpyz( input_field.buffer, Hist_Prev(), sizeof( input_field.buffer ) );
+                Q_strncpyz( input_field.buffer, consoleHistorySystem->Prev(), sizeof( input_field.buffer ) );
                 input_field.cursor = strlen( input_field.buffer );
                 continue;
             case KEY_DOWN:
             
-                Q_strncpyz( input_field.buffer, Hist_Next( input_field.buffer ), sizeof( input_field.buffer ) );
+                Q_strncpyz( input_field.buffer, consoleHistorySystem->Next( input_field.buffer ), sizeof( input_field.buffer ) );
                 input_field.cursor = strlen( input_field.buffer );
                 continue;
             case KEY_HOME:
diff --git a/src/engine/console/consoleHistory.cpp b/src/engine/console/consoleHistory.cpp
new file mode 100644
index 0000000..9fe0bf0
--- /dev/null
+++ b/src/engine/console/consoleHistory.cpp
@@ -0,0 +1,224 @@
+////////////////////////////////////////////////////////////////////////////////////////
+// Copyright(C) 1999 - 2010 id Software LLC, a ZeniMax Media company.
+// Copyright(C) 2011 - 2021 Dusan Jocic <dusanjocic@msn.com>
+//
+// This file is part of the OpenWolf GPL Source Code.
+// OpenWolf Source Code 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.
+//

[... diff too long, it was truncated ...]

GitHub
sha: 32d7f080