Source/ISp_Sample.h

/*
    File:       ISp_Sample.h
 
    Contains:   xxx put contents here xxx
 
    Version:    xxx put version here xxx
 
    Copyright:  © 1999 by Apple Computer, Inc., all rights reserved.
 
    File Ownership:
 
        DRI:                xxx put dri here xxx
 
        Other Contact:      xxx put other contact here xxx
 
        Technology:         xxx put technology here xxx
 
    Writers:
 
        (BWS)   Brent Schorsch
 
    Change History (most recent first):
 
       <SP1>      7/1/99    BWS     first checked in
*/
 
#ifndef __ISP_SAMPLE__
#define __ISP_SAMPLE__
 
#ifdef __cplusplus
extern "C" {
#endif
 
//¥ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ    Includes
 
#define USE_OLD_INPUT_SPROCKET_LABELS 0
#define USE_OLD_ISPNEED_STRUCT 0
#include <InputSprocket.h>
#include <MacTypes.h>
 
//¥ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ    Public Definitions
 
enum
{
    kMin_Roll           = -1000,
    kMax_Roll           =  1000,
    
    kMin_Pitch          = -1000,
    kMax_Pitch          =  1000,
    
    kMin_Yaw            = -1000,
    kMax_Yaw            =  1000,
    kIncrement_Yaw      =    50,
    
    kMin_Throttle       =     0,
    kMax_Throttle       =  1000,
    kIncrement_Throttle =    50
};
 
enum
{
    // primary needs
    
    kNeed_FireWeapon,
    kNeed_NextWeapon,
    kNeed_PreviousWeapon,
    
    kNeed_Roll,
    kNeed_Pitch,
    kNeed_Yaw,
    kNeed_Throttle,
    
    kNeed_StartPause,
    kNeed_Quit,
    
    // secondary needs for alternative input kinds
    
    kNeed_Weapon_MachineGun,
    kNeed_Weapon_Cannon,
    kNeed_Weapon_Laser,
    kNeed_Weapon_Missle,
    kNeed_Weapon_PrecisionBomb,
    kNeed_Weapon_ClusterBomb,
    
    kNeed_Roll_AsDelta,
    kNeed_Pitch_AsDelta,
    kNeed_Yaw_AsDelta,
    
    kNeed_Yaw_Left,
    kNeed_Yaw_Center,
    kNeed_Yaw_Right,
    
    kNeed_Throttle_Min,
    kNeed_Throttle_Decrease,
    kNeed_Throttle_Increase,
    kNeed_Throttle_Max,
    
    kNeed_NeedCount
};
 
enum
{
    kWeapon_MachineGun,
    kWeapon_Cannon,
    kWeapon_Laser,
    kWeapon_Missle,
    kWeapon_PrecisionBomb,
    kWeapon_ClusterBomb,
    
    kWeapon_WeaponCount
};
 
 
 
//¥ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ    Public Types
 
struct Input_GameState
{
    Boolean     gameInProgress;
    Boolean     gamePaused;
 
    Boolean     fireWeaponState;
    UInt32      fireWeaponCount;
    
    SInt16      currentWeapon;
    
    SInt32      rollInput;
    SInt32      pitchInput;
    SInt32      yawInput;
    SInt32      throttleInput;
    
    Fixed       deltaRoll;
    Fixed       deltaPitch;
    Fixed       deltaYaw;
};
typedef struct Input_GameState Input_GameState;
 
//¥ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ    Public Variables
 
//¥ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ    Public Functions
Boolean  Input_Available (void);
 
OSStatus Input_Initialize (void);
OSStatus Input_Terminate (void);
 
void    Input_InitializeState (Input_GameState * gameState);
 
OSStatus Input_Suspend (void);
OSStatus Input_Resume (void);
 
void     Input_ShowConfigureDialog (void);
 
void     Input_GetButtonEvents (Input_GameState * gameState);
void     Input_PollAxisValues (Input_GameState * gameState);
 
 
//¥¥¥ in order to implement typing, these functions must be called
//¥¥¥ they tell input sprocket to ignore the keyboard, and pass thru
//¥¥¥ keyboard events to the system (to be gotten in waitnextevent, or getosevent)
void     Input_EnableKeyboardForTyping (void);
void     Input_DisableKeyboardForTyping (void);
 
//¥¥¥ in order to implement mouse ISp input, these functions must be called
//¥¥¥ they tell input sprocket to ignore the mouse, and pass thru
//¥¥¥ mouse events to the system (to move the cursor among other things)
void     Input_EnableMouseForCursor (void);
void     Input_DisableMouseForCursor (void);
#ifdef __cplusplus
}
#endif
 
#endif