Skip to content
Snippets Groups Projects
Select Git revision
  • 01b017019b42dead468fe62ffed5c55cc8c8be3c
  • next default protected
  • movie
  • movie-netcode-fixes
  • next-test
  • master protected
  • softcode-info
  • acs
  • clipmidtex
  • custom-map-names
  • nogravity-trampolines
  • 2214-pre4
  • 2214-pre3
  • just-in-case
  • fix-opengl-parameter-crash
  • 2214-pre2
  • 2214-pre1
  • delfile2
  • cleanupmusic
  • gametype-refactor-1
  • extra-textures
  • SRB2_release_2.2.15
  • SRB2_release_2.2.13
  • SRB2_release_2.2.12
  • SRB2_release_2.2.11
  • SRB2_release_2.2.10
  • SRB2_release_2.2.9
  • SRB2_release_2.2.8
  • SRB2_release_2.2.7
  • SRB2_release_2.2.6
  • SRB2_release_2.2.5
  • SRB2_release_2.2.4
  • SRB2_release_2.2.3
  • SRB2_release_2.2.2
  • SRB2_release_2.2.1
  • SRB2_release_2.2.0
  • SRB2_release_2.1.25
  • SRB2_release_2.1.24
  • SRB2_release_2.1.23
  • SRB2_release_2.1.22
  • SRB2_release_2.1.21
41 results

info.c

Blame
  • i_joy.h 1.72 KiB
    // SONIC ROBO BLAST 2
    //-----------------------------------------------------------------------------
    // Copyright (C) 1998-2000 by DooM Legacy Team.
    // Copyright (C) 1999-2021 by Sonic Team Junior.
    //
    // This program is free software distributed under the
    // terms of the GNU General Public License, version 2.
    // See the 'LICENSE' file for more details.
    //-----------------------------------------------------------------------------
    /// \file  i_joy.h
    /// \brief share joystick information with game control code
    
    #ifndef __I_JOY_H__
    #define __I_JOY_H__
    
    #include "g_input.h"
    
    /*!
      \brief	-JOYAXISRANGE to +JOYAXISRANGE for each axis
    
    	(1024-1) so we can do a right shift instead of division
    	(doesnt matter anyway, just give enough precision)
    	a gamepad will return -1, 0, or 1 in the event data
    	an analog type joystick will return a value
    	from -JOYAXISRANGE to +JOYAXISRANGE for each axis
    */
    
    #define JOYAXISRANGE 1023
    
    // detect a bug if we increase JOYBUTTONS above DIJOYSTATE's number of buttons
    #if (JOYBUTTONS > 64)
    "JOYBUTTONS is greater than INT64 bits can hold"
    #endif
    
    /**	\brief	The struct JoyType_s
    
     share some joystick information (maybe 2 for splitscreen), to the game input code,
     actually, we need to know if it is a gamepad or analog controls
    */
    
    struct JoyType_s
    {
    	/*! if true, we MUST Poll() to get new joystick data,
    	that is: we NEED the DIRECTINPUTDEVICE2 ! (watchout NT compatibility) */
    	INT32 bJoyNeedPoll;
    	/*! this joystick is a gamepad, read: digital axes
    	if FALSE, interpret the joystick event data as JOYAXISRANGE (see above) */
    	INT32 bGamepadStyle;
    
    };
    typedef struct JoyType_s JoyType_t;
    /**	\brief Joystick info
    	for palyer 1 and 2's joystick/gamepad
    */
    
    extern JoyType_t Joystick, Joystick2;
    
    #endif // __I_JOY_H__