Skip to content

Commit 11efe9b

Browse files
Rename Keyboard to WWKeyboard
The word `Keyboard` conflicts with the typedef `Keyboard` in libnds. So we have to rename it.
1 parent 1f28f43 commit 11efe9b

85 files changed

Lines changed: 461 additions & 461 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

common/gadget.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#include <unistd.h>
6464
#endif
6565

66-
extern WWKeyboardClass* Keyboard;
66+
extern WWKeyboardClass* WWKeyboard;
6767

6868
/*
6969
** This records the current gadget the the gadget system is "stuck on". Such a
@@ -486,9 +486,9 @@ KeyNumType GadgetClass::Input(void)
486486
/*
487487
** Fetch any pending keyboard input.
488488
*/
489-
key = Keyboard->Check();
489+
key = WWKeyboard->Check();
490490
if (key != 0) {
491-
key = Keyboard->Get();
491+
key = WWKeyboard->Get();
492492
}
493493

494494
#ifdef WIN32
@@ -527,8 +527,8 @@ KeyNumType GadgetClass::Input(void)
527527
** rather the the mouse position at the time we get around to this function.
528528
*/
529529
if (((key & 0xFF) == KN_LMOUSE) || ((key & 0xFF) == KN_RMOUSE)) {
530-
mousex = Keyboard->MouseQX;
531-
mousey = Keyboard->MouseQY;
530+
mousex = WWKeyboard->MouseQX;
531+
mousey = WWKeyboard->MouseQY;
532532
} else {
533533
mousex = Get_Mouse_X();
534534
mousey = Get_Mouse_Y();
@@ -576,12 +576,12 @@ KeyNumType GadgetClass::Input(void)
576576
** held down, then we automatically know that it must be up -- set the flag
577577
** accordingly.
578578
*/
579-
if (Keyboard->Down(KN_LMOUSE)) {
579+
if (WWKeyboard->Down(KN_LMOUSE)) {
580580
flags |= LEFTHELD;
581581
} else {
582582
flags |= LEFTUP;
583583
}
584-
if (Keyboard->Down(KN_RMOUSE)) {
584+
if (WWKeyboard->Down(KN_RMOUSE)) {
585585
flags |= RIGHTHELD;
586586
} else {
587587
flags |= RIGHTUP;

common/gadget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class GadgetClass : public LinkClass
110110
RIGHTHELD = 0x0020, // Right mouse button is being held down.
111111
RIGHTRELEASE = 0x0040, // Right mouse button released.
112112
RIGHTUP = 0x0080, // Right mouse button is being held up.
113-
KEYBOARD = 0x0100 // Keyboard input processing (maybe).
113+
KEYBOARD = 0x0100 // WWKeyboard input processing (maybe).
114114
} FlagEnum;
115115

116116
GadgetClass(int x, int y, int w, int h, unsigned flags, int sticky = false);

common/video_sdl2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
#include <SDL.h>
4949

50-
extern WWKeyboardClass* Keyboard;
50+
extern WWKeyboardClass* WWKeyboard;
5151
static SDL_Window* window;
5252
static SDL_Renderer* renderer;
5353
static SDL_Palette* palette;
@@ -357,7 +357,7 @@ bool Set_Video_Mode(int w, int h, int bits_per_pixel)
357357
*/
358358
if (Settings.Mouse.ControllerEnabled) {
359359
SDL_Init(SDL_INIT_GAMECONTROLLER);
360-
Keyboard->Open_Controller();
360+
WWKeyboard->Open_Controller();
361361
}
362362

363363
return true;
@@ -427,7 +427,7 @@ void Set_Video_Cursor_Clip(bool clipped)
427427

428428
void Move_Video_Mouse(float xrel, float yrel)
429429
{
430-
if (Keyboard->Is_Gamepad_Active() || hwcursor.Clip || !Settings.Video.Windowed) {
430+
if (WWKeyboard->Is_Gamepad_Active() || hwcursor.Clip || !Settings.Video.Windowed) {
431431
hwcursor.X += xrel * (Settings.Mouse.Sensitivity / 100.0f);
432432
hwcursor.Y += yrel * (Settings.Mouse.Sensitivity / 100.0f);
433433
}
@@ -447,7 +447,7 @@ void Move_Video_Mouse(float xrel, float yrel)
447447

448448
void Get_Video_Mouse(int& x, int& y)
449449
{
450-
if (Keyboard->Is_Gamepad_Active() || (Settings.Mouse.RawInput && (hwcursor.Clip || !Settings.Video.Windowed))) {
450+
if (WWKeyboard->Is_Gamepad_Active() || (Settings.Mouse.RawInput && (hwcursor.Clip || !Settings.Video.Windowed))) {
451451
x = hwcursor.X;
452452
y = hwcursor.Y;
453453
} else {
@@ -497,7 +497,7 @@ void Reset_Video_Mode(void)
497497
SDL_DestroyWindow(window);
498498
window = nullptr;
499499

500-
Keyboard->Close_Controller();
500+
WWKeyboard->Close_Controller();
501501
}
502502

503503
static void Update_HWCursor()

common/wsproto.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include "debugstring.h"
5757
#include "misc.h"
5858
#include "wwkeyboard.h"
59-
extern WWKeyboardClass* Keyboard;
59+
extern WWKeyboardClass* WWKeyboard;
6060

6161
#include <stdio.h>
6262
#include <assert.h>
@@ -383,7 +383,7 @@ int WinsockInterfaceClass::Read(void* buffer, int& buffer_len, void* address, in
383383
/*
384384
** Call the message loop in case there are any outstanding winsock READ messages.
385385
*/
386-
Keyboard->Check();
386+
WWKeyboard->Check();
387387

388388
/*
389389
** If there are no available packets then return 0
@@ -467,7 +467,7 @@ void WinsockInterfaceClass::WriteTo(void* buffer, int buffer_len, void* address)
467467
/*
468468
** Make sure the message loop gets called.
469469
*/
470-
Keyboard->Check();
470+
WWKeyboard->Check();
471471
}
472472

473473
/***********************************************************************************************
@@ -519,7 +519,7 @@ void WinsockInterfaceClass::Broadcast(void* buffer, int buffer_len)
519519
/*
520520
** Make sure the message loop gets called.
521521
*/
522-
Keyboard->Check();
522+
WWKeyboard->Check();
523523
}
524524

525525
/***********************************************************************************************

common/wspudp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "wspudp.h"
4848
#include "misc.h"
4949
#include "wwkeyboard.h"
50-
extern WWKeyboardClass* Keyboard;
50+
extern WWKeyboardClass* WWKeyboard;
5151

5252
#include <assert.h>
5353
#include <stdio.h>
@@ -346,7 +346,7 @@ void UDPInterfaceClass::Broadcast(void* buffer, int buffer_len)
346346
/*
347347
** Make sure the message loop gets called.
348348
*/
349-
Keyboard->Check();
349+
WWKeyboard->Check();
350350
}
351351
}
352352

common/wwkeyboard.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/* $Header: /CounterStrike/KEY.CPP 1 3/03/97 10:25a Joe_bostic $ */
1717
/***********************************************************************************************
1818
* *
19-
* Project Name : Westwood Keyboard Library *
19+
* Project Name : Westwood WWKeyboard Library *
2020
* *
2121
* File Name : KEYBOARD.CPP *
2222
* *
@@ -45,7 +45,7 @@
4545
* WWKeyboardClass::Peek_Element -- Fetches the next element in the keyboard buffer. *
4646
* WWKeyboardClass::Put -- Logic to insert a key into the keybuffer] *
4747
* WWKeyboardClass::Put_Element -- Put a keyboard data element into the buffer. *
48-
* WWKeyboardClass::Put_Key_Message -- Translates and inserts wParam into Keyboard Buffer *
48+
* WWKeyboardClass::Put_Key_Message -- Translates and inserts wParam into WWKeyboard Buffer *
4949
* WWKeyboardClass::To_ASCII -- Convert the key value into an ASCII representation. *
5050
* WWKeyboardClass::Available_Buffer_Room -- Fetch the quantity of free elements in the keybo*
5151
* WWKeyboardClass::Put_Mouse_Message -- Stores a mouse type message into the keyboard buffer*
@@ -72,7 +72,7 @@ extern void Focus_Loss();
7272
extern void Focus_Restore();
7373

7474
/***********************************************************************************************
75-
* WWKeyboardClass::WWKeyBoardClass -- Construction for Westwood Keyboard Class *
75+
* WWKeyboardClass::WWKeyBoardClass -- Construction for Westwood WWKeyboard Class *
7676
* *
7777
* INPUT: none *
7878
* *
@@ -199,7 +199,7 @@ bool WWKeyboardClass::Put(unsigned short key)
199199
}
200200

201201
/***********************************************************************************************
202-
* WWKeyboardClass::Put_Key_Message -- Translates and inserts wParam into Keyboard Buffer *
202+
* WWKeyboardClass::Put_Key_Message -- Translates and inserts wParam into WWKeyboard Buffer *
203203
* *
204204
* INPUT: *
205205
* *

common/wwkeyboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/* $Header: /CounterStrike/KEY.H 1 3/03/97 10:25a Joe_bostic $ */
1717
/***********************************************************************************************
1818
* *
19-
* Project Name : Westwood Keyboard Library *
19+
* Project Name : Westwood WWKeyboard Library *
2020
* *
2121
* File Name : KEYBOARD.H *
2222
* *
@@ -750,7 +750,7 @@ class WWKeyboardClass
750750
/* Define the base constructor and destructors for the class */
751751
WWKeyboardClass();
752752

753-
/* Define the functions which work with the Keyboard Class */
753+
/* Define the functions which work with the WWKeyboard Class */
754754
KeyNumType Check(void) const;
755755
KeyNumType Get(void);
756756
bool Put(unsigned short key);
@@ -772,7 +772,7 @@ class WWKeyboardClass
772772
#endif
773773

774774
/* Define the public access variables which are used with the */
775-
/* Keyboard Class. */
775+
/* WWKeyboard Class. */
776776
int MouseQX;
777777
int MouseQY;
778778

redalert/conquer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void Main_Game(int argc, char* argv[])
219219
** told the map to draw itself.
220220
*/
221221
GamePalette.Set(FADE_PALETTE_MEDIUM);
222-
Keyboard->Clear();
222+
WWKeyboard->Clear();
223223
/*
224224
** Only show the mouse if we're not playing back a recording.
225225
*/
@@ -2441,7 +2441,7 @@ void Play_Movie(char const* name, ThemeType theme, bool clrscrn, bool immediate)
24412441
BlackPalette.Set();
24422442
}
24432443
PreserveVQAScreen = 0;
2444-
Keyboard->Clear();
2444+
WWKeyboard->Clear();
24452445

24462446
VQAHandle* vqa = NULL;
24472447

@@ -2670,13 +2670,13 @@ MPG_RESPONSE far __stdcall MpegCallback(MPG_CMD cmd, LPVOID data, LPVOID user)
26702670
break;
26712671

26722672
case MPGCMD_UPDATE:
2673-
if ((BreakoutAllowed || Debug_Flag) && Keyboard->Check()) {
2674-
if (Keyboard->Get() == KN_ESC) {
2675-
Keyboard->Clear();
2673+
if ((BreakoutAllowed || Debug_Flag) && WWKeyboard->Check()) {
2674+
if (WWKeyboard->Get() == KN_ESC) {
2675+
WWKeyboard->Clear();
26762676
return MPGRES_QUIT;
26772677
}
26782678

2679-
Keyboard->Clear();
2679+
WWKeyboard->Clear();
26802680
}
26812681

26822682
if (!GameInFocus) {
@@ -3358,9 +3358,9 @@ int VQ_Call_Back(unsigned char*, int)
33583358
return 0;
33593359
#else
33603360
int key = 0;
3361-
if (Keyboard->Check()) {
3362-
key = Keyboard->Get();
3363-
Keyboard->Clear();
3361+
if (WWKeyboard->Check()) {
3362+
key = WWKeyboard->Get();
3363+
WWKeyboard->Clear();
33643364
}
33653365
Check_VQ_Palette_Set();
33663366
#ifdef MOVIE640
@@ -3375,7 +3375,7 @@ int VQ_Call_Back(unsigned char*, int)
33753375
Frame_Limiter();
33763376

33773377
if ((BreakoutAllowed || Debug_Flag) && key == KN_ESC) {
3378-
Keyboard->Clear();
3378+
WWKeyboard->Clear();
33793379
Brokeout = true;
33803380
return (true);
33813381
}
@@ -4291,7 +4291,7 @@ bool Force_CD_Available(int cd)
42914291
GamePalette.Set();
42924292
}
42934293

4294-
Keyboard->Clear();
4294+
WWKeyboard->Clear();
42954295

42964296
while (Get_Mouse_State())
42974297
Show_Mouse();

redalert/display.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ bool DisplayClass::Good_Reinforcement_Cell(CELL outcell, CELL incell, SpeedType
27972797
/*
27982798
** All tests have passed, return with success code.
27992799
*/
2800-
// Mono_Printf("<%04X>\n", incell);Keyboard->Get();
2800+
// Mono_Printf("<%04X>\n", incell);WWKeyboard->Get();
28012801
return (true);
28022802
}
28032803

@@ -3075,8 +3075,8 @@ int DisplayClass::TacticalClass::Action(unsigned flags, KeyNumType& key)
30753075
** events must use the current mouse position globals.
30763076
*/
30773077
if (flags & (LEFTPRESS | LEFTRELEASE | RIGHTPRESS | RIGHTRELEASE)) {
3078-
x = Keyboard->MouseQX;
3079-
y = Keyboard->MouseQY;
3078+
x = WWKeyboard->MouseQX;
3079+
y = WWKeyboard->MouseQY;
30803080
} else {
30813081
x = Get_Mouse_X();
30823082
y = Get_Mouse_Y();
@@ -3299,8 +3299,8 @@ int DisplayClass::TacticalClass::Selection_At_Mouse(unsigned flags, KeyNumType&
32993299
int x, y; // Sub cell pixel coordinates.
33003300
bool edge = false;
33013301
if (flags & (LEFTPRESS | LEFTRELEASE | RIGHTPRESS | RIGHTRELEASE)) {
3302-
x = Keyboard->MouseQX;
3303-
y = Keyboard->MouseQY;
3302+
x = WWKeyboard->MouseQX;
3303+
y = WWKeyboard->MouseQY;
33043304
} else {
33053305
x = Get_Mouse_X();
33063306
y = Get_Mouse_Y();
@@ -3373,8 +3373,8 @@ int DisplayClass::TacticalClass::Command_Object(unsigned flags, KeyNumType& key)
33733373
int x, y; // Sub cell pixel coordinates.
33743374
bool edge = false;
33753375
if (flags & (LEFTPRESS | LEFTRELEASE | RIGHTPRESS | RIGHTRELEASE)) {
3376-
x = Keyboard->MouseQX;
3377-
y = Keyboard->MouseQY;
3376+
x = WWKeyboard->MouseQX;
3377+
y = WWKeyboard->MouseQY;
33783378
} else {
33793379
x = Get_Mouse_X();
33803380
y = Get_Mouse_Y();

redalert/dllinterface.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extern char const* Speech[VOX_COUNT];
102102
*/
103103
#define GAME_TO_PLAY Session.Type
104104
#define MULTIPLAYER_COUNT Session.Players.Count()
105-
#define KEYBOARD Keyboard
105+
#define KEYBOARD WWKeyboard
106106

107107
#define RANDOM_START_POSITION 0x7f
108108

@@ -4127,8 +4127,8 @@ extern "C" __declspec(dllexport) void __cdecl CNC_Handle_Input(InputRequestEnum
41274127
DLLExportClass::Adjust_Internal_View();
41284128
DLLForceMouseX = x1;
41294129
DLLForceMouseY = y1;
4130-
Keyboard->MouseQX = x1;
4131-
Keyboard->MouseQY = y1;
4130+
WWKeyboard->MouseQX = x1;
4131+
WWKeyboard->MouseQY = y1;
41324132

41334133
COORDINATE coord = Map.Pixel_To_Coord(x1, y1);
41344134
CELL cell = Coord_Cell(coord);
@@ -4146,8 +4146,8 @@ extern "C" __declspec(dllexport) void __cdecl CNC_Handle_Input(InputRequestEnum
41464146
DLLExportClass::Adjust_Internal_View();
41474147
DLLForceMouseX = x1;
41484148
DLLForceMouseY = y1;
4149-
Keyboard->MouseQX = x1;
4150-
Keyboard->MouseQY = y1;
4149+
WWKeyboard->MouseQX = x1;
4150+
WWKeyboard->MouseQY = y1;
41514151

41524152
COORDINATE coord = Map.Pixel_To_Coord(x1, y1);
41534153
CELL cell = Coord_Cell(coord);
@@ -4168,8 +4168,8 @@ extern "C" __declspec(dllexport) void __cdecl CNC_Handle_Input(InputRequestEnum
41684168
DLLExportClass::Adjust_Internal_View();
41694169
DLLForceMouseX = x1;
41704170
DLLForceMouseY = y1;
4171-
Keyboard->MouseQX = x1;
4172-
Keyboard->MouseQY = y1;
4171+
WWKeyboard->MouseQX = x1;
4172+
WWKeyboard->MouseQY = y1;
41734173

41744174
COORDINATE coord = Map.Pixel_To_Coord(x1, y1);
41754175
CELL cell = Coord_Cell(coord);

0 commit comments

Comments
 (0)