Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameengine): light a Razer keyboard from the command bar
Olcay Seyganf83f86b63d36
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2f714129e..7d0846cbb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -642,6 +642,13 @@ found and fixed — EA's own, not port damage.**- Your allies see the smoke and their radar blinks at the spot, and the message area says who sent it. Three seconds later the smoke has cleared, so the call you made a minute ago is never still standing next to the one you are making now. Enemies see none of it.- One signal a second per player. Hammering the key gets you the first puff and nothing else, and a teammate who tries it cannot bury your screen in smoke either, because every machine in the game holds everyone to the same limit.+## A Razer keyboard plays along++- The keyboard sits in your own player colour for the whole match, dim enough to be a bed rather than a light show.+- The command bar is on the keys. Every letter and digit the bar has bound to a button lights up while that button can be pressed, and goes dark the moment it cannot - the moment you cannot afford it, or the thing that builds it is busy. What you can buy is readable without looking away from the fight.+- The board pulses red while something is shooting at your base, and settles again four seconds after the last hit.+- Nothing to install and nothing to turn on. If Synapse is running the lighting is there; if it is not, the game never mentions it.+## The options screen has pages- Display, graphics, effects, audio, controls, gameplay and network, behind seven buttons across the top. The original screen was one panel with everything on it at once, and it was already full the day it shipped: the language filter, the keyboard button and four camera checkboxes are all still in there, parked off the right edge where nobody can reach them, because there was nowhere left to put them.diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ChromaKeyboard.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ChromaKeyboard.hnew file mode 100644index 000000000..cd85dfa48--- /dev/null+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ChromaKeyboard.h@@ -0,0 +1,47 @@+/*+** Command & Conquer Generals Zero Hour(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 <http://www.gnu.org/licenses/>.+*/++// FILE: ChromaKeyboard.h /////////////////////////////////////////////////////+//+// Paints the player's colour onto a Razer keyboard, lights the command bar+// keys that can be pressed right now, and pulses red while the base is taking+// fire. Talks to the Chroma REST server on localhost, so it needs no SDK+// header, no import library and no DLL beside the exe: with Synapse absent the+// first request fails and the whole thing goes quiet for the run.+//+///////////////////////////////////////////////////////////////////////////////++#pragma once++#ifndef __CHROMA_KEYBOARD_H_+#define __CHROMA_KEYBOARD_H_++/** Read the game state and hand the keyboard its next frame. Called once per+ * engine update from GameEngine::update; cheap, and never blocks on the+ * network - the request itself belongs to a worker thread. */+extern void updateChromaKeyboard( void );++/** Stop the worker thread. Called from GameEngine::reset on the way out. */+extern void shutdownChromaKeyboard( void );++/** Which cell of the six-by-twenty-two Chroma grid a command bar key lights, or+ * -1 for a key the map does not cover. Only lower case letters and digits get+ * an answer, which is all the command bar ever binds. */+extern Int chromaCellForKey( char key );++#endif // __CHROMA_KEYBOARD_H_diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h b/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.hindex 8e48d3ce6..3144e6973 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h@@ -101,6 +101,11 @@ public:AsciiString searchHotKey( const AsciiString& label);AsciiString searchHotKey( const UnicodeString& uStr );+ /** Is this key bound to a window at the moment? When it is, pressable comes+ * back with the answer executeHotKey would give: the window is showing and+ * enabled, so the press would land. */+ Bool findHotKey( const AsciiString& key, Bool *pressable ) const;+private:typedef std::map<AsciiString, HotKey> HotKeyMap;HotKeyMap m_hotKeyMap;diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cppindex 6c1922f80..d0a5514ab 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp@@ -91,6 +91,7 @@#include "GameLogic/ScriptEngine.h"#include "GameLogic/SidesList.h"+#include "GameClient/ChromaKeyboard.h"#include "GameClient/CinemaDirector.h"#include "GameClient/Display.h"#include "GameClient/FXList.h"@@ -222,6 +223,8 @@ GameEngine::~GameEngine()// close the control socket before anything it can reach is torn downControlServer_shutdown();+ shutdownChromaKeyboard();+delete TheMapCache;TheMapCache = NULL;@@ -2137,6 +2140,10 @@ void GameEngine::update( void )}TheCDManager->UPDATE();++ // Reads the command bar and the local player, writes a keyboard frame+ // for the Chroma worker to pick up. Client only, never touches logic.+ updateChromaKeyboard();}#ifdef DEBUG_LOGGINGQueryPerformanceCounter( (LARGE_INTEGER *)&tClientEnd );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cppnew file mode 100644index 000000000..9d5f7e8c3--- /dev/null+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp@@ -0,0 +1,337 @@+/*+** Command & Conquer Generals Zero Hour(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 <http://www.gnu.org/licenses/>.+*/++// FILE: ChromaKeyboard.cpp ///////////////////////////////////////////////////++#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine++#include <wininet.h>+#include <math.h>++#include "GameClient/ChromaKeyboard.h"+#include "GameClient/Color.h"+#include "GameClient/HotKey.h"+#include "Common/GameCommon.h"+#include "Common/Player.h"+#include "Common/PlayerList.h"+#include "GameLogic/GameLogic.h"++//-----------------------------------------------------------------------------+// The Chroma grid is fixed at six rows of twenty-two, whatever keyboard is+// underneath; a device with fewer keys drops what it has no lamp for.+//-----------------------------------------------------------------------------+static const Int CHROMA_ROWS = 6;+static const Int CHROMA_COLUMNS = 22;+static const Int CHROMA_CELLS = CHROMA_ROWS * CHROMA_COLUMNS;++static const char *CHROMA_HOST = "localhost";+static const INTERNET_PORT CHROMA_PORT = 54235;+static const char *CHROMA_INIT_PATH = "/razer/chromasdk";+static const char *CHROMA_INIT_BODY =+ "{\"title\":\"Zero Hour Reforged\","+ "\"description\":\"Command bar and base state on the keyboard\","+ "\"author\":{\"name\":\"Zero Hour Reforged\",\"contact\":\"https://github.com/olcayseygan/CnCGeneralsZH-Reforged\"},"+ "\"device_supported\":[\"keyboard\"],"+ "\"category\":\"application\"}";++static const DWORD CHROMA_TIMEOUT_MS = 500;+static const DWORD CHROMA_SEND_INTERVAL_MS = 100;+/// The session expires after ten idle seconds, so a still frame is resent well inside that.+static const DWORD CHROMA_KEEPALIVE_MS = 4000;++/// Rows two to four of an ANSI board, in the order their keys sit on it. Every+/// command bar hotkey the game hands out is a letter or a digit, so this is the+/// whole map rather than a subset of one.+static const char *CHROMA_KEY_ROWS[] = { "1234567890", "qwertyuiop", "asdfghjkl", "zxcvbnm" };+static const Int CHROMA_KEY_ROW_COUNT = 4;+/// Column zero is the logo strip and column one is escape, tab, caps and shift,+/// so every one of these four rows starts at two. Row zero is the function keys.+static const Int CHROMA_KEY_FIRST_COLUMN = 2;+static const Int CHROMA_KEY_FIRST_ROW = 1;++static const Real AMBIENT_SCALE = 0.22f; ///< the unlit bed of player colour+static const Real PRESSABLE_SCALE = 1.0f; ///< a command key that would fire if pressed+static const Int UNDER_ATTACK_FRAMES = LOGICFRAMES_PER_SECOND * 4;+static const Real UNDER_ATTACK_PULSE_HZ = 2.5f;+static const Real UNDER_ATTACK_DEPTH = 0.75f; ///< how far the pulse drags the board to red++//-----------------------------------------------------------------------------+// The main thread writes s_pendingGrid, the worker reads it. One lock over the+// whole grid: it is 528 bytes copied ten times a second.+//-----------------------------------------------------------------------------+static CRITICAL_SECTION s_gridLock;+static Int s_pendingGrid[ CHROMA_CELLS ];+static Bool s_workerRunning = FALSE;+static volatile LONG s_workerShouldStop = 0;+static HANDLE s_workerThread = NULL;++//-----------------------------------------------------------------------------+Int chromaCellForKey( char key )+{+ for( Int row = 0; row < CHROMA_KEY_ROW_COUNT; ++row )+ {+ const char *keys = CHROMA_KEY_ROWS[ row ];+ for( Int column = 0; keys[ column ] != 0; ++column )+ {+ if( keys[ column ] == key )+ return (CHROMA_KEY_FIRST_ROW + row) * CHROMA_COLUMNS+ + CHROMA_KEY_FIRST_COLUMN + column;+ }+ }+ return -1;+}++//-----------------------------------------------------------------------------+static Int chromaColorFromComponents( Real red, Real green, Real blue )+{+ const Int r = (Int)(red * 255.0f + 0.5f);+ const Int g = (Int)(green * 255.0f + 0.5f);+ const Int b = (Int)(blue * 255.0f + 0.5f);+ // Chroma wants BGR, not the RGB the rest of the engine speaks.+ return (b << 16) | (g << 8) | r;+}++//-----------------------------------------------------------------------------+// The HTTP side. Everything below here runs on the worker thread.+//-----------------------------------------------------------------------------+static Bool chromaRequest( HINTERNET connection, const char *verb, const char *path,+ const char *body, char *reply, Int replyBytes )+{+ static const char *ACCEPT_TYPES[] = { "application/json", NULL };+ static const char *CONTENT_TYPE_HEADER = "Content-Type: application/json\r\n";++ HINTERNET request = HttpOpenRequestA( connection, verb, path, NULL, NULL, ACCEPT_TYPES,+ INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE, 0 );+ if( request == NULL )+ return FALSE;++ Bool ok = HttpSendRequestA( request, CONTENT_TYPE_HEADER, (DWORD)strlen( CONTENT_TYPE_HEADER ),+ (LPVOID)body, (DWORD)strlen( body ) ) ? TRUE : FALSE;+ if( ok && reply != NULL )+ {+ DWORD read = 0;+ ok = InternetReadFile( request, reply, (DWORD)(replyBytes - 1), &read ) ? TRUE : FALSE;+ reply[ ok ? read : 0 ] = 0;+ }++ InternetCloseHandle( request );+ return ok;+}++//-----------------------------------------------------------------------------+/** Ask the Chroma server for a session and write its path into sessionPath.+ * The host and port are ours, so only the id out of the reply is needed. */+static Bool chromaOpenSession( HINTERNET connection, char *sessionPath, Int sessionPathBytes )+{+ char reply[ 512 ];+ if( !chromaRequest( connection, "POST", CHROMA_INIT_PATH, CHROMA_INIT_BODY, reply, sizeof( reply ) ) )+ return FALSE;++ const char *idField = strstr( reply, "\"sessionid\"" );+ Int sessionId = 0;+ if( idField == NULL || sscanf( idField, "\"sessionid\" : %d", &sessionId ) != 1 )+ {+ if( idField == NULL || sscanf( idField, "\"sessionid\":%d", &sessionId ) != 1 )+ return FALSE;+ }+ if( sessionId <= 0 )+ return FALSE;++ _snprintf( sessionPath, sessionPathBytes, "%s/%d/keyboard", CHROMA_INIT_PATH, sessionId );+ sessionPath[ sessionPathBytes - 1 ] = 0;+ return TRUE;+}++//-----------------------------------------------------------------------------+static void chromaBuildKeyboardBody( const Int *grid, char *body, Int bodyBytes )+{+ Int used = _snprintf( body, bodyBytes, "{\"effect\":\"CHROMA_CUSTOM\",\"param\":[" );+ for( Int row = 0; row < CHROMA_ROWS && used > 0 && used < bodyBytes; ++row )+ {+ used += _snprintf( body + used, bodyBytes - used, row == 0 ? "[" : ",[" );+ for( Int column = 0; column < CHROMA_COLUMNS && used > 0 && used < bodyBytes; ++column )+ used += _snprintf( body + used, bodyBytes - used, column == 0 ? "%d" : ",%d",+ grid[ row * CHROMA_COLUMNS + column ] );+ used += _snprintf( body + used, bodyBytes - used, "]" );+ }+ _snprintf( body + used, bodyBytes - used, "]}" );+ body[ bodyBytes - 1 ] = 0;+}++//-----------------------------------------------------------------------------+static DWORD WINAPI chromaWorkerMain( LPVOID )+{+ // Big enough for six rows of twenty-two ten-digit numbers and the punctuation.+ char body[ CHROMA_CELLS * 12 + 64 ];+ char sessionPath[ 128 ];+ Int sent[ CHROMA_CELLS ];+ Int grid[ CHROMA_CELLS ];++ HINTERNET internet = InternetOpenA( "ZeroHourReforged", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 );+ HINTERNET connection = NULL;+ if( internet != NULL )+ {+ DWORD timeout = CHROMA_TIMEOUT_MS;+ InternetSetOptionA( internet, INTERNET_OPTION_CONNECT_TIMEOUT, &timeout, sizeof( timeout ) );+ InternetSetOptionA( internet, INTERNET_OPTION_SEND_TIMEOUT, &timeout, sizeof( timeout ) );+ InternetSetOptionA( internet, INTERNET_OPTION_RECEIVE_TIMEOUT, &timeout, sizeof( timeout ) );+ connection = InternetConnectA( internet, CHROMA_HOST, CHROMA_PORT, NULL, NULL,+ INTERNET_SERVICE_HTTP, 0, 0 );+ }++ // ponytail: one attempt at startup. Synapse started after the game is not+ // picked up; retrying on a timer would mean a second piece of state to own.+ if( connection == NULL || !chromaOpenSession( connection, sessionPath, sizeof( sessionPath ) ) )+ {+ DEBUG_LOG(( "Chroma: no Razer server on %s:%d, keyboard lighting is off for this run\n",+ CHROMA_HOST, (Int)CHROMA_PORT ));+ if( connection != NULL )+ InternetCloseHandle( connection );+ if( internet != NULL )+ InternetCloseHandle( internet );+ return 0;+ }++ memset( sent, 0, sizeof( sent ) );+ DWORD lastSendMs = 0;+ while( InterlockedCompareExchange( &s_workerShouldStop, 0, 0 ) == 0 )+ {+ EnterCriticalSection( &s_gridLock );+ memcpy( grid, s_pendingGrid, sizeof( grid ) );+ LeaveCriticalSection( &s_gridLock );++ const DWORD nowMs = timeGetTime();+ const Bool changed = memcmp( grid, sent, sizeof( grid ) ) != 0;+ if( changed || nowMs - lastSendMs >= CHROMA_KEEPALIVE_MS )+ {+ chromaBuildKeyboardBody( grid, body, sizeof( body ) );+ chromaRequest( connection, "PUT", sessionPath, body, NULL, 0 );+ memcpy( sent, grid, sizeof( sent ) );+ lastSendMs = nowMs;+ }++ Sleep( CHROMA_SEND_INTERVAL_MS );+ }++ InternetCloseHandle( connection );+ InternetCloseHandle( internet );+ return 0;+}++//-----------------------------------------------------------------------------+// The game state side. Everything below here runs on the main thread.+//-----------------------------------------------------------------------------+static void chromaFillGrid( Int *grid )+{+ Real red = 0.5f, green = 0.5f, blue = 0.5f;+ Player *localPlayer = ThePlayerList ? ThePlayerList->getLocalPlayer() : NULL;+ if( localPlayer != NULL )+ {+ UnsignedByte r, g, b, a;+ GameGetColorComponents( localPlayer->getPlayerColor(), &r, &g, &b, &a );+ red = r / 255.0f;+ green = g / 255.0f;+ blue = b / 255.0f;+ }++ // How hard the board is being dragged towards red, zero when nothing is+ // shooting at us.+ Real alarm = 0.0f;+ const Bool inGame = TheGameLogic && TheGameLogic->isInGame();+ if( inGame && localPlayer != NULL )+ {+ const UnsignedInt frame = TheGameLogic->getFrame();+ const UnsignedInt attackedFrame = localPlayer->getAttackedFrame();+ if( attackedFrame > 0 && frame - attackedFrame < (UnsignedInt)UNDER_ATTACK_FRAMES )+ {+ const Real seconds = (Real)frame / (Real)LOGICFRAMES_PER_SECOND;+ const Real phase = sinf( seconds * UNDER_ATTACK_PULSE_HZ * TWO_PI );+ alarm = UNDER_ATTACK_DEPTH * (0.5f + 0.5f * phase);+ }+ }++ const Int ambient = chromaColorFromComponents(+ red * AMBIENT_SCALE * (1.0f - alarm) + alarm,+ green * AMBIENT_SCALE * (1.0f - alarm),+ blue * AMBIENT_SCALE * (1.0f - alarm) );+ for( Int cell = 0; cell < CHROMA_CELLS; ++cell )+ grid[ cell ] = ambient;++ // Outside a match there is no command bar to read, so the flat bed is the+ // whole picture.+ if( !inGame || TheHotKeyManager == NULL )+ return;++ const Int pressable = chromaColorFromComponents(+ red * PRESSABLE_SCALE * (1.0f - alarm) + alarm,+ green * PRESSABLE_SCALE * (1.0f - alarm),+ blue * PRESSABLE_SCALE * (1.0f - alarm) );+ const Int unavailable = chromaColorFromComponents( alarm, 0.0f, 0.0f );++ for( Int row = 0; row < CHROMA_KEY_ROW_COUNT; ++row )+ {+ const char *keys = CHROMA_KEY_ROWS[ row ];+ for( Int column = 0; keys[ column ] != 0; ++column )+ {+ const char keyText[ 2 ] = { keys[ column ], 0 };+ Bool isPressable = FALSE;+ if( !TheHotKeyManager->findHotKey( AsciiString( keyText ), &isPressable ) )+ continue;++ grid[ chromaCellForKey( keys[ column ] ) ] = isPressable ? pressable : unavailable;+ }+ }+}++//-----------------------------------------------------------------------------+void updateChromaKeyboard( void )+{+ if( !s_workerRunning )+ {+ InitializeCriticalSection( &s_gridLock );+ DWORD threadId = 0;+ s_workerThread = ::CreateThread( NULL, 0, chromaWorkerMain, NULL, 0, &threadId );+ if( s_workerThread == NULL )+ {+ DeleteCriticalSection( &s_gridLock );+ return;+ }+ s_workerRunning = TRUE;+ }++ Int grid[ CHROMA_CELLS ];+ chromaFillGrid( grid );++ EnterCriticalSection( &s_gridLock );+ memcpy( s_pendingGrid, grid, sizeof( s_pendingGrid ) );+ LeaveCriticalSection( &s_gridLock );+}++//-----------------------------------------------------------------------------+void shutdownChromaKeyboard( void )+{+ if( !s_workerRunning )+ return;++ InterlockedExchange( &s_workerShouldStop, 1 );+ WaitForSingleObject( s_workerThread, 2000 );+ CloseHandle( s_workerThread );+ s_workerThread = NULL;+ DeleteCriticalSection( &s_gridLock );+ s_workerRunning = FALSE;+}diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cppindex 9d7c44282..1d041aac3 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp@@ -166,6 +166,21 @@ void HotKeyManager::addHotKey( GameWindow *win, const AsciiString& keyIn)m_hotKeyMap[key] = newHK;}+//-----------------------------------------------------------------------------+Bool HotKeyManager::findHotKey( const AsciiString& keyIn, Bool *pressable ) const+{+ AsciiString key = keyIn;+ key.toLower();+ HotKeyMap::const_iterator it = m_hotKeyMap.find(key);+ if( it == m_hotKeyMap.end() || it->second.m_win == NULL )+ return FALSE;++ GameWindow *win = it->second.m_win;+ const UnsignedInt status = win->winGetStatus();+ *pressable = !BitTest( status, WIN_STATUS_HIDDEN ) && BitTest( status, WIN_STATUS_ENABLED );+ return TRUE;+}+//-----------------------------------------------------------------------------Bool HotKeyManager::executeHotKey( const AsciiString& keyIn ){diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex b8ca48e5d..e6bfc5c85 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -43,6 +43,7 @@#include "GameNetwork/LinkSimulation.h"#include "Common/Energy.h"#include "Common/RandomValue.h"+#include "GameClient/ChromaKeyboard.h"#include "GameClient/ClickTolerance.h"#include "GameClient/KeyDownInfo.h"#include "GameClient/GameWindowTransitions.h"@@ -13024,6 +13025,24 @@ TEST(camera_preferences_default_to_a_finite_map_margin)TheWritableGlobalData = saved;delete scratch;}+// The Razer grid is six rows of twenty-two with the logo strip in column zero and+// escape, tab, caps and shift in column one, so the top left key the command bar+// can ever light is the digit 1 at row one, column two.+TEST(chroma_keys_land_on_the_razer_grid)+{+ CHECK_EQ(chromaCellForKey('1'), 1 * 22 + 2);+ CHECK_EQ(chromaCellForKey('0'), 1 * 22 + 11);+ CHECK_EQ(chromaCellForKey('q'), 2 * 22 + 2);+ CHECK_EQ(chromaCellForKey('p'), 2 * 22 + 11);+ CHECK_EQ(chromaCellForKey('a'), 3 * 22 + 2);+ CHECK_EQ(chromaCellForKey('l'), 3 * 22 + 10);+ CHECK_EQ(chromaCellForKey('z'), 4 * 22 + 2);+ CHECK_EQ(chromaCellForKey('m'), 4 * 22 + 8);+ // Upper case never reaches here: HotKeyManager lowers every key it stores.+ CHECK_EQ(chromaCellForKey('Q'), -1);+ CHECK_EQ(chromaCellForKey(' '), -1);+}+#include "test_camera_behavior.inc"#include "test_production_input.inc"#include "test_minimap_input.inc"