diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 30dbc5813..f8cc31888 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -144,7 +144,6 @@ MACT_OBJS = \ file_lib \ control \ keyboard \ - mouse \ joystick \ scriplib \ animlib \ diff --git a/polymer/eduke32/Makefile.deps b/polymer/eduke32/Makefile.deps index 3841ab709..d13da9bd5 100644 --- a/polymer/eduke32/Makefile.deps +++ b/polymer/eduke32/Makefile.deps @@ -125,7 +125,6 @@ $(DUKE3D_OBJ)/animlib.$o: $(MACT_ROOT)/animlib.c $(MACT_ROOT)/animlib.h $(ENGINE $(DUKE3D_OBJ)/file_lib.$o: $(MACT_ROOT)/file_lib.c $(MACT_ROOT)/file_lib.h $(DUKE3D_OBJ)/control.$o: $(MACT_ROOT)/control.c $(MACT_ROOT)/control.h $(MACT_ROOT)/keyboard.h $(MACT_ROOT)/mouse.h $(MACT_ROOT)/joystick.h $(ENGINE_INC)/baselayer.h $(DUKE3D_OBJ)/keyboard.$o: $(MACT_ROOT)/keyboard.c $(MACT_ROOT)/keyboard.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/baselayer.h -$(DUKE3D_OBJ)/mouse.$o: $(MACT_ROOT)/mouse.c $(MACT_ROOT)/mouse.h $(ENGINE_INC)/baselayer.h $(DUKE3D_OBJ)/joystick.$o: $(MACT_ROOT)/joystick.c $(MACT_ROOT)/joystick.h $(ENGINE_INC)/baselayer.h $(DUKE3D_OBJ)/scriplib.$o: $(MACT_ROOT)/scriplib.c $(MACT_ROOT)/scriplib.h $(MACT_ROOT)/_scrplib.h $(ENGINE_INC)/compat.h diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index 21277856f..a4e3fbff9 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -194,7 +194,6 @@ AUDIOLIB_OBJS=$(AUDIOLIB_OBJ)\drivers.$o \ MACT_OBJS=$(DUKE3D_OBJ)\file_lib.$o \ $(DUKE3D_OBJ)\control.$o \ $(DUKE3D_OBJ)\keyboard.$o \ - $(DUKE3D_OBJ)\mouse.$o \ $(DUKE3D_OBJ)\joystick.$o \ $(DUKE3D_OBJ)\scriplib.$o diff --git a/polymer/eduke32/eduke32.vcxproj b/polymer/eduke32/eduke32.vcxproj index c7b7e753c..199ef567a 100644 --- a/polymer/eduke32/eduke32.vcxproj +++ b/polymer/eduke32/eduke32.vcxproj @@ -384,7 +384,6 @@ - diff --git a/polymer/eduke32/eduke32.vcxproj.filters b/polymer/eduke32/eduke32.vcxproj.filters index 51ddc69a8..12b132804 100644 --- a/polymer/eduke32/eduke32.vcxproj.filters +++ b/polymer/eduke32/eduke32.vcxproj.filters @@ -758,9 +758,6 @@ jmact\source - - jmact\source - jmact\source diff --git a/polymer/eduke32/source/jmact/mouse.c b/polymer/eduke32/source/jmact/mouse.c deleted file mode 100644 index db57f50c4..000000000 --- a/polymer/eduke32/source/jmact/mouse.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * mouse.c - * MACT library -to- JonoF's Build Port Mouse Glue - * - * by Jonathon Fowler - * - * Since we don't have the source to the MACT library I've had to - * concoct some magic to glue its idea of controllers into that of - * my Build port. - * - */ -//------------------------------------------------------------------------- -/* -Duke Nukem Copyright (C) 1996, 2003 3D Realms Entertainment - -This file is part of Duke Nukem 3D version 1.5 - Atomic Edition - -Duke Nukem 3D 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 2 -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, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#include "compat.h" - -#include "mouse.h" -#include "baselayer.h" - -int32_t Mouse_Init(void) -{ - initmouse(); - return ((inputdevices & 2) == 2); -} - - -void MOUSE_Shutdown(void) -{ - uninitmouse(); -} - -#if 0 -void MOUSE_ShowCursor(void) -{ -} - - -void MOUSE_HideCursor(void) -{ -} -#endif - -int32_t MOUSE_GetButtons(void) -{ - int32_t buttons; - - readmousebstatus(&buttons); - - return buttons; -} - - - - diff --git a/polymer/eduke32/source/jmact/mouse.h b/polymer/eduke32/source/jmact/mouse.h index d016067ed..c013172c5 100644 --- a/polymer/eduke32/source/jmact/mouse.h +++ b/polymer/eduke32/source/jmact/mouse.h @@ -33,24 +33,43 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) extern "C" { #endif -#define LEFT_MOUSE 1 -#define RIGHT_MOUSE 2 -#define MIDDLE_MOUSE 4 -#define THUMB_MOUSE 8 -#define WHEELUP_MOUSE 16 -#define WHEELDOWN_MOUSE 32 -#define LEFT_MOUSE_PRESSED( button ) ( ( ( button ) & LEFT_MOUSE ) != 0 ) -#define RIGHT_MOUSE_PRESSED( button ) ( ( ( button ) & RIGHT_MOUSE ) != 0 ) -#define MIDDLE_MOUSE_PRESSED( button ) ( ( ( button ) & MIDDLE_MOUSE ) != 0 ) +#define LEFT_MOUSE 1 +#define RIGHT_MOUSE 2 +#define MIDDLE_MOUSE 4 +#define THUMB_MOUSE 8 +#define WHEELUP_MOUSE 16 +#define WHEELDOWN_MOUSE 32 -int32_t Mouse_Init( void ); -void MOUSE_Shutdown( void ); -//void MOUSE_ShowCursor( void ); -//void MOUSE_HideCursor( void ); -int32_t MOUSE_GetButtons( void ); -#define MOUSE_ClearButton(b) (mouseb &= ~b) +#define LEFT_MOUSE_PRESSED(button) (((button)&LEFT_MOUSE) != 0) +#define RIGHT_MOUSE_PRESSED(button) (((button)&RIGHT_MOUSE) != 0) +#define MIDDLE_MOUSE_PRESSED(button) (((button)&MIDDLE_MOUSE) != 0) + +#include "baselayer.h" + +static inline int32_t Mouse_Init(void) +{ + initmouse(); + return ((inputdevices & 2) == 2); +} + + +static inline void MOUSE_Shutdown(void) { uninitmouse(); } + +#if 0 +static inline void MOUSE_ShowCursor(void) {} +static inline void MOUSE_HideCursor(void) {} +#endif + +static inline int32_t MOUSE_GetButtons(void) +{ + int32_t buttons; + readmousebstatus(&buttons); + return buttons; +} + +#define MOUSE_ClearButton(b) (mouseb &= ~b) #define MOUSE_ClearAllButtons() mouseb = 0 -#define MOUSE_GetDelta(x, y) readmousexy(x,y) +#define MOUSE_GetDelta(x, y) readmousexy(x, y) #ifdef __cplusplus }