building with more SDL code, added lots of D2X SDL related code, windows build does not need DirectX anymore; implemented SCons build system; provisoric hacks to build editor; changed contents of readme and compile text files
This commit is contained in:
parent
595f65dc74
commit
78dad5631f
396
SConstruct
Executable file
396
SConstruct
Executable file
|
@ -0,0 +1,396 @@
|
|||
#SConstruct
|
||||
|
||||
# TODO:
|
||||
# - command-line parameter for datapath
|
||||
|
||||
|
||||
print "D1X-Rebirth"
|
||||
|
||||
# needed imports
|
||||
import sys
|
||||
import os
|
||||
|
||||
# version number
|
||||
D1XMAJOR = 0
|
||||
D1XMINOR = 45
|
||||
|
||||
# place of descent data - please change if desired
|
||||
D1XDATAPATH = '\\"\\"'
|
||||
|
||||
# command-line parms
|
||||
debug = int(ARGUMENTS.get('debug', 0))
|
||||
no_release = int(ARGUMENTS.get('no_release', 0))
|
||||
sdl_only = int(ARGUMENTS.get('sdl_only', 0))
|
||||
no_asm = int(ARGUMENTS.get('no_asm', 0))
|
||||
editor = int(ARGUMENTS.get('editor', 0))
|
||||
|
||||
# general source files
|
||||
common_sources = [
|
||||
'2d/2dsline.c',
|
||||
'2d/bitblt.c',
|
||||
'2d/bitmap.c',
|
||||
'2d/box.c',
|
||||
'2d/canvas.c',
|
||||
'2d/circle.c',
|
||||
'2d/disc.c',
|
||||
'2d/font.c',
|
||||
'2d/gpixel.c',
|
||||
'2d/ibitblt.c',
|
||||
'2d/line.c',
|
||||
'2d/palette.c',
|
||||
'2d/pcx.c',
|
||||
'2d/pixel.c',
|
||||
'2d/poly.c',
|
||||
'2d/rect.c',
|
||||
'2d/rle.c',
|
||||
'2d/scalec.c',
|
||||
'2d/tmerge.c',
|
||||
'3d/clipper.c',
|
||||
'3d/draw.c',
|
||||
'3d/globvars.c',
|
||||
'3d/instance.c',
|
||||
'3d/interp.c',
|
||||
'3d/matrix.c',
|
||||
'3d/points.c',
|
||||
'3d/rod.c',
|
||||
'3d/setup.c',
|
||||
'cfile/cfile.c',
|
||||
'iff/iff.c',
|
||||
'main/ai.c',
|
||||
'main/aipath.c',
|
||||
'main/altsound.c',
|
||||
'main/args.c',
|
||||
'main/automap.c',
|
||||
'main/ban.c',
|
||||
'main/bm.c',
|
||||
'main/bmread.c',
|
||||
'main/cdplay.c',
|
||||
'main/cntrlcen.c',
|
||||
'main/collide.c',
|
||||
'main/command.c',
|
||||
'main/config.c',
|
||||
'main/controls.c',
|
||||
'main/credits.c',
|
||||
'main/custom.c',
|
||||
'main/d_conv.c',
|
||||
'main/d_gamecv.c',
|
||||
'main/dumpmine.c',
|
||||
'main/effects.c',
|
||||
'main/endlevel.c',
|
||||
'main/fireball.c',
|
||||
'main/fuelcen.c',
|
||||
'main/fvi.c',
|
||||
'main/game.c',
|
||||
'main/gamefont.c',
|
||||
'main/gameseg.c',
|
||||
'main/gameseq.c',
|
||||
'main/gauges.c',
|
||||
'main/hash.c',
|
||||
'main/hostage.c',
|
||||
'main/hud.c',
|
||||
'main/hudlog.c',
|
||||
'main/ignore.c',
|
||||
'main/inferno.c',
|
||||
'main/ip_base.cpp',
|
||||
'main/ipclienc.c',
|
||||
'main/ipclient.cpp',
|
||||
'main/ipx_drv.c',
|
||||
'main/kconfig.c',
|
||||
'main/key.c',
|
||||
'main/kmatrix.c',
|
||||
'main/laser.c',
|
||||
'main/lighting.c',
|
||||
'main/m_inspak.c',
|
||||
'main/menu.c',
|
||||
'main/mglobal.c',
|
||||
'main/mission.c',
|
||||
'main/mlticntl.c',
|
||||
'main/modem.c',
|
||||
'main/morph.c',
|
||||
'main/multi.c',
|
||||
'main/multibot.c',
|
||||
'main/multipow.c',
|
||||
'main/multiver.c',
|
||||
'main/mprofile.c',
|
||||
'main/netlist.c',
|
||||
'main/netmisc.c',
|
||||
'main/netpkt.c',
|
||||
'main/network.c',
|
||||
'main/newdemo.c',
|
||||
'main/newmenu.c',
|
||||
'main/nncoms.c',
|
||||
'main/nocomlib.c',
|
||||
'main/object.c',
|
||||
'main/paging.c',
|
||||
'main/physics.c',
|
||||
'main/piggy.c',
|
||||
'main/pingstat.c',
|
||||
'main/playsave.c',
|
||||
'main/polyobj.c',
|
||||
'main/powerup.c',
|
||||
'main/radar.c',
|
||||
'main/reconfig.c',
|
||||
'main/reorder.c',
|
||||
'main/render.c',
|
||||
'main/robot.c',
|
||||
'main/scores.c',
|
||||
'main/slew.c',
|
||||
'main/songs.c',
|
||||
'main/state.c',
|
||||
'main/switch.c',
|
||||
'main/terrain.c',
|
||||
'main/texmerge.c',
|
||||
'main/text.c',
|
||||
'main/titles.c',
|
||||
'main/vclip.c',
|
||||
'main/vlcnfire.c',
|
||||
'main/wall.c',
|
||||
'main/weapon.c',
|
||||
'mem/mem.c',
|
||||
'misc/compare.c',
|
||||
'misc/d_glob.c',
|
||||
'misc/d_delay.c',
|
||||
'misc/d_io.c',
|
||||
'misc/d_slash.c',
|
||||
'misc/error.c',
|
||||
'misc/strio.c',
|
||||
'misc/strutil.c',
|
||||
'texmap/ntmap.c',
|
||||
'texmap/scanline.c'
|
||||
]
|
||||
|
||||
# for editor
|
||||
editor_sources = [
|
||||
'editor/centers.c',
|
||||
'editor/curves.c',
|
||||
'editor/autosave.c',
|
||||
'editor/eglobal.c',
|
||||
'editor/ehostage.c',
|
||||
'editor/elight.c',
|
||||
'editor/eobject.c',
|
||||
'editor/eswitch.c',
|
||||
'editor/fixseg.c',
|
||||
'editor/func.c',
|
||||
'editor/group.c',
|
||||
'editor/info.c',
|
||||
'editor/kbuild.c',
|
||||
'editor/kcurve.c',
|
||||
'editor/kfuncs.c',
|
||||
'editor/kgame.c',
|
||||
'editor/khelp.c',
|
||||
'editor/kmine.c',
|
||||
'editor/ksegmove.c',
|
||||
'editor/ksegsel.c',
|
||||
'editor/ksegsize.c',
|
||||
'editor/ktmap.c',
|
||||
'editor/kview.c',
|
||||
'editor/med.c',
|
||||
'editor/meddraw.c',
|
||||
'editor/medmisc.c',
|
||||
'editor/medrobot.c',
|
||||
'editor/medsel.c',
|
||||
'editor/medwall.c',
|
||||
'editor/mine.c',
|
||||
'editor/objpage.c',
|
||||
'editor/segment.c',
|
||||
'editor/seguvs.c',
|
||||
'editor/texpage.c',
|
||||
'editor/texture.c',
|
||||
'main/gamemine.c',
|
||||
'main/gamesave.c',
|
||||
'ui/button.c',
|
||||
'ui/checkbox.c',
|
||||
'ui/gadget.c',
|
||||
'ui/icon.c',
|
||||
'ui/inputbox.c',
|
||||
'ui/keypad.c',
|
||||
'ui/keypress.c',
|
||||
'ui/keytrap.c',
|
||||
'ui/lfile.c',
|
||||
'ui/listbox.c',
|
||||
'ui/menu.c',
|
||||
'ui/menubar.c',
|
||||
'ui/message.c',
|
||||
'ui/mouse.c',
|
||||
'ui/popup.c',
|
||||
'ui/radio.c',
|
||||
'ui/scroll.c',
|
||||
'ui/ui.c',
|
||||
'ui/uidraw.c',
|
||||
'ui/userbox.c',
|
||||
'ui/window.c'
|
||||
]
|
||||
|
||||
# for linux
|
||||
arch_linux_sources = [
|
||||
'arch/linux/arch_ip.cpp',
|
||||
'arch/linux/hmiplay.c',
|
||||
'arch/linux/init.c',
|
||||
'arch/linux/ipx_bsd.c',
|
||||
'arch/linux/ipx_kali.c',
|
||||
'arch/linux/linuxnet.c',
|
||||
'arch/linux/mono.c',
|
||||
'arch/linux/serial.c',
|
||||
'arch/linux/timer.c',
|
||||
'arch/linux/ukali.c',
|
||||
'arch/sdl/clipboard.c',
|
||||
'arch/sdl/digi.c',
|
||||
'arch/sdl/event.c',
|
||||
'arch/sdl/init.c',
|
||||
'arch/sdl/joy.c',
|
||||
'arch/sdl/joydefs.c',
|
||||
'arch/sdl/key_arch.c',
|
||||
'arch/sdl/mouse.c'
|
||||
]
|
||||
|
||||
# for windows
|
||||
arch_win32_sources = [
|
||||
'arch/win32/arch_ip.cpp',
|
||||
'arch/win32/hmpfile.c',
|
||||
'arch/win32/init.c',
|
||||
'arch/win32/ipx_win.c',
|
||||
'arch/win32/midi.c',
|
||||
'arch/win32/mono.c',
|
||||
'arch/win32/serial.c',
|
||||
'arch/win32/timer.c',
|
||||
'arch/win32/winnet.c',
|
||||
'arch/sdl/digi.c',
|
||||
'arch/sdl/event.c',
|
||||
'arch/sdl/init.c',
|
||||
'arch/sdl/joy.c',
|
||||
'arch/sdl/joydefs.c',
|
||||
'arch/sdl/key_arch.c',
|
||||
'arch/sdl/mouse.c'
|
||||
]
|
||||
|
||||
# for opengl
|
||||
arch_ogl_sources = [
|
||||
'arch/ogl/gr.c',
|
||||
'arch/ogl/ogl.c',
|
||||
'arch/ogl/sdlgl.c',
|
||||
]
|
||||
|
||||
# for sdl
|
||||
arch_sdl_sources = [
|
||||
'arch/sdl/gr.c',
|
||||
'texmap/tmapflat.c'
|
||||
]
|
||||
|
||||
# assembler related
|
||||
asm_sources = [
|
||||
'2d/linear.asm',
|
||||
'2d/tmerge_a.asm',
|
||||
'maths/fix.asm',
|
||||
'maths/rand.c',
|
||||
'maths/vecmat.c',
|
||||
'maths/vecmata.asm',
|
||||
'texmap/tmap_ll.asm',
|
||||
'texmap/tmap_flt.asm',
|
||||
'texmap/tmapfade.asm',
|
||||
'texmap/tmap_lin.asm',
|
||||
'texmap/tmap_per.asm'
|
||||
]
|
||||
|
||||
noasm_sources = [
|
||||
'maths/fixc.c',
|
||||
'maths/rand.c',
|
||||
'maths/tables.c',
|
||||
'maths/vecmat.c'
|
||||
]
|
||||
|
||||
# flags and stuff for all platforms
|
||||
env = Environment(ENV = os.environ)
|
||||
env.Append(CPPFLAGS = '-O2 -Wall -funsigned-char ')
|
||||
env.Append(CPPDEFINES = [('DESCENT_DATA_PATH', D1XDATAPATH)])
|
||||
env.Append(CPPDEFINES = [('D1XMAJOR', '\\"' + str(D1XMAJOR) + '\\"'), ('D1XMINOR', '\\"' + str(D1XMINOR) + '\\"')])
|
||||
env.Append(CPPPATH = ['include', 'main', 'arch/sdl/include'])
|
||||
env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', 'SUPPORTS_NET_IP', '__SDL__', 'SDL_INPUT', 'SDL_AUDIO', '_REENTRANT'])
|
||||
sdllibs = ['SDL']
|
||||
|
||||
# windows or *nix?
|
||||
if sys.platform == 'win32':
|
||||
print "compiling on Windows"
|
||||
osdef = '__WINDOWS__'
|
||||
env.Append(CPPDEFINES = ['__WINDOWS__'])
|
||||
env.Append(CPPPATH = ['arch/win32/include'])
|
||||
ogldefines = ['SDL_GL', 'OGL_RUNTIME_LOAD', 'OGL']
|
||||
common_sources = arch_win32_sources + common_sources
|
||||
ogllibs = ['']
|
||||
winlibs = ['glu32', 'wsock32', 'winmm']
|
||||
alllibs = winlibs + sdllibs
|
||||
lflags = '-mwindows'
|
||||
else:
|
||||
print "compiling on *NIX"
|
||||
osdef = '__LINUX__'
|
||||
env.Append(CPPDEFINES = ['__LINUX__', 'WANT_AWE32'])
|
||||
env.Append(CPPPATH = ['arch/linux/include'])
|
||||
ogldefines = ['SDL_GL', 'OGL']
|
||||
common_sources = arch_linux_sources + common_sources
|
||||
ogllibs = ['GL', 'GLU']
|
||||
alllibs = sdllibs
|
||||
lflags = ' '
|
||||
|
||||
# sdl or opengl?
|
||||
if (sdl_only == 1):
|
||||
print "building with SDL"
|
||||
target = 'd1x-rebirth-sdl'
|
||||
env.Append(CPPDEFINES = ['SDL_VIDEO'])
|
||||
env.Append(CPPPATH = ['arch/sdl/include'])
|
||||
common_sources = arch_sdl_sources + common_sources
|
||||
else:
|
||||
print "building with OpenGL"
|
||||
target = 'd1x-rebirth-gl'
|
||||
env.Append(CPPDEFINES = ogldefines)
|
||||
env.Append(CPPPATH = ['arch/ogl/include'])
|
||||
common_sources = arch_ogl_sources + common_sources
|
||||
alllibs = ogllibs + sdllibs + alllibs
|
||||
|
||||
# debug?
|
||||
if (debug == 1):
|
||||
print "including: DEBUG"
|
||||
else:
|
||||
env.Append(CPPDEFINES = ['NDEBUG'])
|
||||
|
||||
# release?
|
||||
if (no_release == 0):
|
||||
print "including: RELEASE"
|
||||
env.Append(CPPDEFINES = ['RELEASE'])
|
||||
|
||||
# assembler code?
|
||||
if (no_asm == 0) and (sdl_only == 1):
|
||||
print "including: ASSEMBLER"
|
||||
env.Append(CPPDEFINES = ['ASM_VECMAT'])
|
||||
Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ')
|
||||
env.Replace(AS = 'nasm')
|
||||
env.Append(ASCOM = ' -f elf -d' + str(osdef) + ' -Itexmap/ ')
|
||||
common_sources = asm_sources + common_sources + ['texmap/tmappent.c', 'texmap/tmapppro.c']
|
||||
else:
|
||||
env.Append(CPPDEFINES = ['NO_ASM'])
|
||||
common_sources = noasm_sources + common_sources
|
||||
|
||||
#editor build?
|
||||
if (editor == 1):
|
||||
env.Append(CPPDEFINES = ['EDITOR'])
|
||||
env.Append(CPPPATH = ['include/editor'])
|
||||
common_sources = editor_sources + common_sources
|
||||
target = 'miner'
|
||||
else:
|
||||
common_sources = ['main/loadrl2.c'] + common_sources
|
||||
|
||||
# finally building program...
|
||||
env.Program(target=str(target), source = common_sources, LIBS = alllibs, LINKFLAGS = str(lflags))
|
||||
|
||||
# show some help when running scons -h
|
||||
Help("""
|
||||
D1X-Rebirth, SConstruct file help:
|
||||
Type 'scons' to build the binary.
|
||||
Type 'scons -c' to clean up.
|
||||
Extra options (add them to command line, like 'scons extraoption=value'):
|
||||
'debug=1' build DEBUG binary which includes asserts, debugging output, cheats and more output
|
||||
'no_release=1' don't build RELEASE binary - gives debug/editor things
|
||||
'sdl_only=1' don't include OpenGL, use SDL-only instead
|
||||
'no_asm=1' don't use ASSEMBLER (only with sdl_only=1 - NOT recommended, slow)
|
||||
'editor=1' build editor !EXPERIMENTAL!
|
||||
""")
|
||||
|
||||
#EOF
|
|
@ -69,14 +69,14 @@ int joycal_message( char * title, char * text )
|
|||
extern int WriteConfigFile();
|
||||
|
||||
extern joystick_device j_joystick[MAX_JOY_DEVS];
|
||||
extern joystick_axis j_axis[MAX_AXES];
|
||||
extern joystick_button j_button[MAX_BUTTONS];
|
||||
extern joystick_axis j_axis[JOY_MAX_AXES];
|
||||
extern joystick_button j_button[JOY_MAX_BUTTONS];
|
||||
|
||||
void joydefs_calibrate()
|
||||
{
|
||||
|
||||
int i;
|
||||
int temp_values[MAX_AXES];
|
||||
int temp_values[JOY_MAX_AXES];
|
||||
char title[50];
|
||||
char text[256];
|
||||
//added/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix
|
||||
|
|
|
@ -14,8 +14,8 @@ char joy_installed = 0;
|
|||
char joy_present = 0;
|
||||
|
||||
joystick_device j_joystick[MAX_JOY_DEVS];
|
||||
joystick_axis j_axis[MAX_AXES];
|
||||
joystick_button j_button[MAX_BUTTONS];
|
||||
joystick_axis j_axis[JOY_MAX_AXES];
|
||||
joystick_button j_button[JOY_MAX_BUTTONS];
|
||||
|
||||
int j_num_axes = 0, j_num_buttons = 0;
|
||||
int timer_rate;
|
||||
|
@ -253,10 +253,10 @@ int joy_init () {
|
|||
|
||||
// printf ("\n");
|
||||
|
||||
if (j_num_axes > MAX_AXES)
|
||||
j_num_axes = MAX_AXES;
|
||||
if (j_num_buttons > MAX_BUTTONS)
|
||||
j_num_buttons = MAX_BUTTONS;
|
||||
if (j_num_axes > JOY_MAX_AXES)
|
||||
j_num_axes = JOY_MAX_AXES;
|
||||
if (j_num_buttons > JOY_MAX_BUTTONS)
|
||||
j_num_buttons = JOY_MAX_BUTTONS;
|
||||
|
||||
joy_present = 1;
|
||||
joy_installed = 1;
|
||||
|
@ -323,7 +323,7 @@ int joy_get_scaled_reading(int raw, int axis_num)
|
|||
|
||||
|
||||
void joy_get_pos(int *x, int *y) {
|
||||
int axis[MAX_AXES];
|
||||
int axis[JOY_MAX_AXES];
|
||||
|
||||
if ((!joy_installed)||(!joy_present)) { *x=*y=0; return; }
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ TOPDIR = ../..
|
|||
|
||||
include $(TOPDIR)/makefile.config
|
||||
|
||||
OBJECTS = joystick.$(OBJ) init.$(OBJ) \
|
||||
joydefs.$(OBJ) mono.$(OBJ) \
|
||||
OBJECTS = init.$(OBJ) \
|
||||
mono.$(OBJ) \
|
||||
timer.$(OBJ)
|
||||
|
||||
ifdef NETWORK
|
||||
|
|
|
@ -47,13 +47,13 @@ void OpenGL_Shutdown(void);
|
|||
|
||||
void PumpMessages(void)
|
||||
{
|
||||
/* MSG msg;
|
||||
MSG msg;
|
||||
|
||||
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE|PM_NOYIELD))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}*/ // ZICO - let's deactivate Windows system-keys
|
||||
}
|
||||
}
|
||||
static void finiObjects()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
// SDL Event related stuff
|
||||
/* $Id: event.c,v 1.1.1.1 2006/03/17 19:53:40 zicodxx Exp $ */
|
||||
/*
|
||||
*
|
||||
* SDL Event related stuff
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <conf.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -6,48 +16,55 @@
|
|||
#include <SDL/SDL.h>
|
||||
|
||||
extern void key_handler(SDL_KeyboardEvent *event);
|
||||
//added on 10/17/98 by Hans de Goede for mouse functionality
|
||||
extern void mouse_button_handler(SDL_MouseButtonEvent *mbe);
|
||||
extern void mouse_motion_handler(SDL_MouseMotionEvent *mme);
|
||||
//end this section addition - Hans
|
||||
extern void joy_button_handler(SDL_JoyButtonEvent *jbe);
|
||||
extern void joy_hat_handler(SDL_JoyHatEvent *jhe);
|
||||
extern void joy_axis_handler(SDL_JoyAxisEvent *jae);
|
||||
|
||||
static int initialised=0;
|
||||
|
||||
void event_poll()
|
||||
{
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
// if( (event.type == SDL_KEYEVENT) {
|
||||
//added/changed on 10/17/98 by Hans de Goede for mouse functionality
|
||||
//-killed- if( (event.type == SDL_KEYDOWN) || (event.type == SDL_KEYUP) ) {
|
||||
switch(event.type)
|
||||
{
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
key_handler((SDL_KeyboardEvent *)&event);
|
||||
break;
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
mouse_button_handler((SDL_MouseButtonEvent *)&event);
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
mouse_motion_handler((SDL_MouseMotionEvent *)&event);
|
||||
break;
|
||||
//-killed- return;
|
||||
//end this section addition/change - Hans
|
||||
case SDL_QUIT: {
|
||||
void quit_request();
|
||||
quit_request();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
SDL_Event event;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch(event.type) {
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
key_handler((SDL_KeyboardEvent *)&event);
|
||||
break;
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
mouse_button_handler((SDL_MouseButtonEvent *)&event);
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
mouse_motion_handler((SDL_MouseMotionEvent *)&event);
|
||||
break;
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
case SDL_JOYBUTTONUP:
|
||||
joy_button_handler((SDL_JoyButtonEvent *)&event);
|
||||
break;
|
||||
case SDL_JOYAXISMOTION:
|
||||
joy_axis_handler((SDL_JoyAxisEvent *)&event);
|
||||
break;
|
||||
case SDL_JOYHATMOTION:
|
||||
joy_hat_handler((SDL_JoyHatEvent *)&event);
|
||||
break;
|
||||
case SDL_JOYBALLMOTION:
|
||||
break;
|
||||
case SDL_QUIT: {
|
||||
void quit_request();
|
||||
quit_request();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int event_init()
|
||||
{
|
||||
// We should now be active and responding to events.
|
||||
initialised = 1;
|
||||
// We should now be active and responding to events.
|
||||
initialised = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -36,8 +36,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
#define JOY_BIOS_READINGS 4
|
||||
#define JOY_FRIENDLY_READINGS 8
|
||||
|
||||
#define MAX_AXES 32
|
||||
#define MAX_BUTTONS 64
|
||||
#define JOY_MAX_AXES 32
|
||||
#define JOY_MAX_BUTTONS 64
|
||||
|
||||
#define JOY_NUM_AXES 4
|
||||
|
||||
|
@ -87,8 +87,8 @@ extern int j_num_buttons;
|
|||
extern int joy_deadzone;
|
||||
|
||||
extern joystick_device j_joystick[MAX_JOY_DEVS];
|
||||
extern joystick_axis j_axis[MAX_AXES];
|
||||
extern joystick_button j_button[MAX_BUTTONS];
|
||||
extern joystick_axis j_axis[JOY_MAX_AXES];
|
||||
extern joystick_button j_button[JOY_MAX_BUTTONS];
|
||||
|
||||
//==========================================================================
|
||||
// The following 3 routines can be used to zero in on better joy
|
||||
|
|
452
arch/sdl/joy.c
Executable file
452
arch/sdl/joy.c
Executable file
|
@ -0,0 +1,452 @@
|
|||
/* $Id: joy.c,v 1.1.1.1 2006/03/17 19:53:38 zicodxx Exp $ */
|
||||
/*
|
||||
*
|
||||
* SDL joystick support
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <conf.h>
|
||||
#endif
|
||||
|
||||
#include <string.h> // for memset
|
||||
#include <SDL/SDL.h>
|
||||
|
||||
#include "joy.h"
|
||||
#include "error.h"
|
||||
#include "timer.h"
|
||||
#include "console.h"
|
||||
#include "event.h"
|
||||
#include "text.h"
|
||||
#include "u_mem.h"
|
||||
|
||||
#define MAX_JOYSTICKS 16
|
||||
|
||||
#define MAX_AXES_PER_JOYSTICK 8
|
||||
#define MAX_BUTTONS_PER_JOYSTICK 16
|
||||
#define MAX_HATS_PER_JOYSTICK 128 // ZICO was 4 - resolves axes recignition problems with two ore more devices
|
||||
|
||||
extern char *joybutton_text[]; //from kconfig.c
|
||||
extern char *joyaxis_text[]; //from kconfig.c
|
||||
|
||||
char joy_present = 0;
|
||||
int num_joysticks = 0;
|
||||
int joy_deadzone = 0;
|
||||
int joy_num_axes = 0;
|
||||
|
||||
struct joybutton {
|
||||
int state;
|
||||
int last_state;
|
||||
fix time_went_down;
|
||||
int num_downs;
|
||||
int num_ups;
|
||||
};
|
||||
|
||||
struct joyaxis {
|
||||
int value;
|
||||
int min_val;
|
||||
int center_val;
|
||||
int max_val;
|
||||
};
|
||||
|
||||
/* This struct is a "virtual" joystick, which includes all the axes
|
||||
* and buttons of every joystick found.
|
||||
*/
|
||||
static struct joyinfo {
|
||||
int n_axes;
|
||||
int n_buttons;
|
||||
struct joyaxis axes[JOY_MAX_AXES];
|
||||
struct joybutton buttons[JOY_MAX_BUTTONS];
|
||||
} Joystick;
|
||||
|
||||
/* This struct is an array, with one entry for each physical joystick
|
||||
* found.
|
||||
*/
|
||||
static struct {
|
||||
SDL_Joystick *handle;
|
||||
int n_axes;
|
||||
int n_buttons;
|
||||
int n_hats;
|
||||
int hat_map[MAX_HATS_PER_JOYSTICK]; //Note: Descent expects hats to be buttons, so these are indices into Joystick.buttons
|
||||
int axis_map[MAX_AXES_PER_JOYSTICK];
|
||||
int button_map[MAX_BUTTONS_PER_JOYSTICK];
|
||||
} SDL_Joysticks[MAX_JOYSTICKS];
|
||||
|
||||
void joy_button_handler(SDL_JoyButtonEvent *jbe)
|
||||
{
|
||||
int button;
|
||||
|
||||
button = SDL_Joysticks[jbe->which].button_map[jbe->button];
|
||||
|
||||
Joystick.buttons[button].state = jbe->state;
|
||||
|
||||
switch (jbe->type) {
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
Joystick.buttons[button].time_went_down = timer_get_fixed_seconds();
|
||||
Joystick.buttons[button].num_downs++;
|
||||
break;
|
||||
case SDL_JOYBUTTONUP:
|
||||
Joystick.buttons[button].num_ups++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void joy_hat_handler(SDL_JoyHatEvent *jhe)
|
||||
{
|
||||
int hat = SDL_Joysticks[jhe->which].hat_map[jhe->hat];
|
||||
int hbi;
|
||||
|
||||
//Save last state of the hat-button
|
||||
Joystick.buttons[hat ].last_state = Joystick.buttons[hat ].state;
|
||||
Joystick.buttons[hat+1].last_state = Joystick.buttons[hat+1].state;
|
||||
Joystick.buttons[hat+2].last_state = Joystick.buttons[hat+2].state;
|
||||
Joystick.buttons[hat+3].last_state = Joystick.buttons[hat+3].state;
|
||||
|
||||
//get current state of the hat-button
|
||||
Joystick.buttons[hat ].state = ((jhe->value & SDL_HAT_UP)>0);
|
||||
Joystick.buttons[hat+1].state = ((jhe->value & SDL_HAT_RIGHT)>0);
|
||||
Joystick.buttons[hat+2].state = ((jhe->value & SDL_HAT_DOWN)>0);
|
||||
Joystick.buttons[hat+3].state = ((jhe->value & SDL_HAT_LEFT)>0);
|
||||
|
||||
//determine if a hat-button up or down event based on state and last_state
|
||||
for(hbi=0;hbi<4;hbi++)
|
||||
{
|
||||
if( !Joystick.buttons[hat+hbi].last_state && Joystick.buttons[hat+hbi].state) //last_state up, current state down
|
||||
{
|
||||
Joystick.buttons[hat+hbi].time_went_down
|
||||
= timer_get_fixed_seconds();
|
||||
Joystick.buttons[hat+hbi].num_downs++;
|
||||
}
|
||||
else if(Joystick.buttons[hat+hbi].last_state && !Joystick.buttons[hat+hbi].state) //last_state down, current state up
|
||||
{
|
||||
Joystick.buttons[hat+hbi].num_ups++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void joy_axis_handler(SDL_JoyAxisEvent *jae)
|
||||
{
|
||||
int axis;
|
||||
|
||||
axis = SDL_Joysticks[jae->which].axis_map[jae->axis];
|
||||
|
||||
Joystick.axes[axis].value = jae->value;
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------- */
|
||||
|
||||
int joy_init()
|
||||
{
|
||||
int i,j,n;
|
||||
char temp[10];
|
||||
|
||||
if (SDL_Init(SDL_INIT_JOYSTICK) < 0) {
|
||||
printf("sdl-joystick: initialisation failed: %s.",SDL_GetError());
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&Joystick,0,sizeof(Joystick));
|
||||
memset(joyaxis_text, 0, JOY_MAX_AXES * sizeof(char *));
|
||||
memset(joybutton_text, 0, JOY_MAX_BUTTONS * sizeof(char *));
|
||||
|
||||
n = SDL_NumJoysticks();
|
||||
|
||||
printf("sdl-joystick: found %d joysticks\n", n);
|
||||
for (i = 0; i < n; i++) {
|
||||
printf("sdl-joystick %d: %s\n", i, SDL_JoystickName(i));
|
||||
SDL_Joysticks[num_joysticks].handle = SDL_JoystickOpen(i);
|
||||
if (SDL_Joysticks[num_joysticks].handle) {
|
||||
joy_present = 1;
|
||||
|
||||
SDL_Joysticks[num_joysticks].n_axes
|
||||
= SDL_JoystickNumAxes(SDL_Joysticks[num_joysticks].handle);
|
||||
if(SDL_Joysticks[num_joysticks].n_axes > MAX_AXES_PER_JOYSTICK)
|
||||
{
|
||||
Warning("sdl-joystick: found %d axes, only %d supported. Game may be unstable.\n", SDL_Joysticks[num_joysticks].n_axes, MAX_AXES_PER_JOYSTICK);
|
||||
SDL_Joysticks[num_joysticks].n_axes = MAX_AXES_PER_JOYSTICK;
|
||||
}
|
||||
|
||||
SDL_Joysticks[num_joysticks].n_buttons
|
||||
= SDL_JoystickNumButtons(SDL_Joysticks[num_joysticks].handle);
|
||||
if(SDL_Joysticks[num_joysticks].n_buttons > MAX_BUTTONS_PER_JOYSTICK)
|
||||
{
|
||||
Warning("sdl-joystick: found %d buttons, only %d supported. Game may be unstable.\n", SDL_Joysticks[num_joysticks].n_buttons, MAX_BUTTONS_PER_JOYSTICK);
|
||||
SDL_Joysticks[num_joysticks].n_buttons = MAX_BUTTONS_PER_JOYSTICK;
|
||||
}
|
||||
|
||||
SDL_Joysticks[num_joysticks].n_hats
|
||||
= SDL_JoystickNumHats(SDL_Joysticks[num_joysticks].handle);
|
||||
if(SDL_Joysticks[num_joysticks].n_hats > MAX_HATS_PER_JOYSTICK)
|
||||
{
|
||||
Warning("sdl-joystick: found %d hats, only %d supported. Game may be unstable.\n", SDL_Joysticks[num_joysticks].n_hats, MAX_HATS_PER_JOYSTICK);
|
||||
SDL_Joysticks[num_joysticks].n_hats = MAX_HATS_PER_JOYSTICK;
|
||||
}
|
||||
|
||||
printf("sdl-joystick: %d axes\n", SDL_Joysticks[num_joysticks].n_axes);
|
||||
printf("sdl-joystick: %d buttons\n", SDL_Joysticks[num_joysticks].n_buttons);
|
||||
printf("sdl-joystick: %d hats\n", SDL_Joysticks[num_joysticks].n_hats);
|
||||
|
||||
for (j=0; j < SDL_Joysticks[num_joysticks].n_axes; j++)
|
||||
{
|
||||
sprintf(temp, "J%d A%d", i + 1, j + 1);
|
||||
joyaxis_text[Joystick.n_axes] = strdup(temp);
|
||||
SDL_Joysticks[num_joysticks].axis_map[j] = Joystick.n_axes++;
|
||||
}
|
||||
for (j=0; j < SDL_Joysticks[num_joysticks].n_buttons; j++)
|
||||
{
|
||||
sprintf(temp, "J%d B%d", i + 1, j + 1);
|
||||
joybutton_text[Joystick.n_buttons] = strdup(temp);
|
||||
SDL_Joysticks[num_joysticks].button_map[j] = Joystick.n_buttons++;
|
||||
}
|
||||
for (j=0; j < SDL_Joysticks[num_joysticks].n_hats; j++)
|
||||
{
|
||||
SDL_Joysticks[num_joysticks].hat_map[j] = Joystick.n_buttons;
|
||||
//a hat counts as four buttons
|
||||
sprintf(temp, "J%d H%d%c", i + 1, j + 1, 0202);
|
||||
joybutton_text[Joystick.n_buttons++] = strdup(temp);
|
||||
sprintf(temp, "J%d H%d%c", i + 1, j + 1, 0177);
|
||||
joybutton_text[Joystick.n_buttons++] = strdup(temp);
|
||||
sprintf(temp, "J%d H%d%c", i + 1, j + 1, 0200);
|
||||
joybutton_text[Joystick.n_buttons++] = strdup(temp);
|
||||
sprintf(temp, "J%d H%d%c", i + 1, j + 1, 0201);
|
||||
joybutton_text[Joystick.n_buttons++] = strdup(temp);
|
||||
}
|
||||
|
||||
num_joysticks++;
|
||||
}
|
||||
else
|
||||
printf("sdl-joystick: initialization failed!\n");
|
||||
|
||||
printf("sdl-joystick: %d axes (total)\n", Joystick.n_axes);
|
||||
printf("sdl-joystick: %d buttons (total)\n", Joystick.n_buttons);
|
||||
}
|
||||
|
||||
joy_num_axes = Joystick.n_axes;
|
||||
atexit(joy_close);
|
||||
|
||||
return joy_present;
|
||||
}
|
||||
|
||||
void joy_close()
|
||||
{
|
||||
while (num_joysticks)
|
||||
SDL_JoystickClose(SDL_Joysticks[num_joysticks--].handle);
|
||||
while (Joystick.n_axes--)
|
||||
free(joyaxis_text[Joystick.n_axes]);
|
||||
while (Joystick.n_buttons--)
|
||||
free(joybutton_text[Joystick.n_buttons]);
|
||||
}
|
||||
|
||||
void joy_get_pos(int *x, int *y)
|
||||
{
|
||||
int axis[JOY_MAX_AXES];
|
||||
|
||||
if (!num_joysticks) {
|
||||
*x=*y=0;
|
||||
return;
|
||||
}
|
||||
|
||||
joystick_read_raw_axis (JOY_ALL_AXIS, axis);
|
||||
|
||||
*x = joy_get_scaled_reading( axis[0], 0 );
|
||||
*y = joy_get_scaled_reading( axis[1], 1 );
|
||||
}
|
||||
|
||||
int joy_get_btns()
|
||||
{
|
||||
#if 0 // This is never used?
|
||||
int i, buttons = 0;
|
||||
for (i=0; i++; i<buttons) {
|
||||
switch (Joystick.buttons[i].state) {
|
||||
case SDL_PRESSED:
|
||||
buttons |= 1<<i;
|
||||
break;
|
||||
case SDL_RELEASED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return buttons;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int joy_get_button_down_cnt( int btn )
|
||||
{
|
||||
int num_downs;
|
||||
|
||||
if (!num_joysticks)
|
||||
return 0;
|
||||
|
||||
event_poll();
|
||||
|
||||
num_downs = Joystick.buttons[btn].num_downs;
|
||||
Joystick.buttons[btn].num_downs = 0;
|
||||
|
||||
return num_downs;
|
||||
}
|
||||
|
||||
fix joy_get_button_down_time(int btn)
|
||||
{
|
||||
fix time = F0_0;
|
||||
|
||||
if (!num_joysticks)
|
||||
return 0;
|
||||
|
||||
event_poll();
|
||||
|
||||
switch (Joystick.buttons[btn].state) {
|
||||
case SDL_PRESSED:
|
||||
time = timer_get_fixed_seconds() - Joystick.buttons[btn].time_went_down;
|
||||
Joystick.buttons[btn].time_went_down = timer_get_fixed_seconds();
|
||||
break;
|
||||
case SDL_RELEASED:
|
||||
time = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
ubyte joystick_read_raw_axis( ubyte mask, int * axis )
|
||||
{
|
||||
int i;
|
||||
ubyte channel_masks = 0;
|
||||
|
||||
if (!num_joysticks)
|
||||
return 0;
|
||||
|
||||
event_poll();
|
||||
|
||||
for (i = 0; i < Joystick.n_axes; i++)
|
||||
{
|
||||
if ((axis[i] = Joystick.axes[i].value))
|
||||
channel_masks |= 1 << i;
|
||||
}
|
||||
|
||||
return channel_masks;
|
||||
}
|
||||
|
||||
void joy_flush()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!num_joysticks)
|
||||
return;
|
||||
|
||||
for (i = 0; i < Joystick.n_buttons; i++) {
|
||||
Joystick.buttons[i].time_went_down = 0;
|
||||
Joystick.buttons[i].num_downs = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int joy_get_button_state( int btn )
|
||||
{
|
||||
if (!num_joysticks)
|
||||
return 0;
|
||||
|
||||
if(btn >= Joystick.n_buttons)
|
||||
return 0;
|
||||
|
||||
event_poll();
|
||||
|
||||
return Joystick.buttons[btn].state;
|
||||
}
|
||||
|
||||
void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Joystick.n_axes; i++)
|
||||
{
|
||||
axis_center[i] = Joystick.axes[i].center_val;
|
||||
axis_min[i] = Joystick.axes[i].min_val;
|
||||
axis_max[i] = Joystick.axes[i].max_val;
|
||||
}
|
||||
}
|
||||
|
||||
void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Joystick.n_axes; i++)
|
||||
{
|
||||
Joystick.axes[i].center_val = axis_center[i];
|
||||
Joystick.axes[i].min_val = axis_min[i];
|
||||
Joystick.axes[i].max_val = axis_max[i];
|
||||
}
|
||||
}
|
||||
|
||||
int joy_get_scaled_reading( int raw, int axis_num )
|
||||
{
|
||||
#if 1
|
||||
return raw/256;
|
||||
#else
|
||||
int d, x;
|
||||
|
||||
raw -= Joystick.axes[axis_num].center_val;
|
||||
|
||||
if (raw < 0)
|
||||
d = Joystick.axes[axis_num].center_val - Joystick.axes[axis_num].min_val;
|
||||
else if (raw > 0)
|
||||
d = Joystick.axes[axis_num].max_val - Joystick.axes[axis_num].center_val;
|
||||
else
|
||||
d = 0;
|
||||
|
||||
if (d)
|
||||
x = ((raw << 7) / d);
|
||||
else
|
||||
x = 0;
|
||||
|
||||
if ( x < -128 )
|
||||
x = -128;
|
||||
if ( x > 127 )
|
||||
x = 127;
|
||||
|
||||
d = (joy_deadzone) * 6;
|
||||
if ((x > (-1*d)) && (x < d))
|
||||
x = 0;
|
||||
|
||||
return x;
|
||||
#endif
|
||||
}
|
||||
|
||||
void joy_set_slow_reading( int flag )
|
||||
{
|
||||
}
|
||||
|
||||
typedef struct Button_info {
|
||||
ubyte ignore;
|
||||
ubyte state;
|
||||
ubyte last_state;
|
||||
int timedown;
|
||||
ubyte downcount;
|
||||
ubyte upcount;
|
||||
} Button_info;
|
||||
|
||||
typedef struct Joy_info {
|
||||
int joyid;
|
||||
ubyte present_mask;
|
||||
ubyte slow_read;
|
||||
int max_timer;
|
||||
int read_count;
|
||||
ubyte last_value;
|
||||
Button_info buttons[JOY_MAX_BUTTONS];
|
||||
int axis_min[JOY_NUM_AXES]; //changed
|
||||
int axis_center[JOY_NUM_AXES]; //changed --orulz
|
||||
int axis_max[JOY_NUM_AXES]; //changed
|
||||
} Joy_info;
|
||||
|
||||
Joy_info joystick;
|
||||
|
||||
void joy_set_btn_values( int btn, int state, fix timedown, int downcount, int upcount )
|
||||
{
|
||||
joystick.buttons[btn].ignore = 1;
|
||||
joystick.buttons[btn].state = state;
|
||||
joystick.buttons[btn].timedown = fixmuldiv( timedown, 1193180, 65536 );
|
||||
joystick.buttons[btn].downcount = downcount;
|
||||
joystick.buttons[btn].upcount = upcount;
|
||||
}
|
111
arch/sdl/joydefs.c
Executable file
111
arch/sdl/joydefs.c
Executable file
|
@ -0,0 +1,111 @@
|
|||
/* $Id: joydefs.c,v 1.1.1.1 2006/03/17 19:53:43 zicodxx Exp $ */
|
||||
/*
|
||||
*
|
||||
* SDL joystick support
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <conf.h>
|
||||
#endif
|
||||
|
||||
#include "joydefs.h"
|
||||
#include "types.h"
|
||||
#include "newmenu.h"
|
||||
#include "config.h"
|
||||
#include "text.h"
|
||||
#include "kconfig.h"
|
||||
|
||||
extern int num_joysticks;
|
||||
|
||||
int joydefs_calibrate_flag = 0;
|
||||
|
||||
void joydefs_calibrate()
|
||||
{
|
||||
joydefs_calibrate_flag = 0;
|
||||
|
||||
if (!num_joysticks) {
|
||||
nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
|
||||
return;
|
||||
}
|
||||
|
||||
//Actual calibration if necessary
|
||||
|
||||
}
|
||||
|
||||
void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
|
||||
{
|
||||
int i;
|
||||
int oc_type = Config_control_type;
|
||||
|
||||
nitems = nitems;
|
||||
last_key = last_key;
|
||||
citem = citem;
|
||||
|
||||
for (i=0; i<3; i++ )
|
||||
if (items[i].value) Config_control_type = i;
|
||||
|
||||
if (Config_control_type == 2) Config_control_type = CONTROL_MOUSE;
|
||||
|
||||
if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) {
|
||||
nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, TXT_FCS );
|
||||
}
|
||||
|
||||
if (oc_type != Config_control_type) {
|
||||
switch (Config_control_type) {
|
||||
// case CONTROL_NONE:
|
||||
case CONTROL_JOYSTICK:
|
||||
case CONTROL_FLIGHTSTICK_PRO:
|
||||
case CONTROL_THRUSTMASTER_FCS:
|
||||
case CONTROL_GRAVIS_GAMEPAD:
|
||||
// case CONTROL_MOUSE:
|
||||
// case CONTROL_CYBERMAN:
|
||||
joydefs_calibrate_flag = 1;
|
||||
}
|
||||
kc_set_controls();
|
||||
}
|
||||
}
|
||||
|
||||
void joydefs_config()
|
||||
{
|
||||
newmenu_item m[13];
|
||||
int i, i1 = 5, j;
|
||||
int nitems = 6;
|
||||
|
||||
m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0;
|
||||
m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0;
|
||||
m[2].type = NM_TYPE_RADIO; m[2].text = "MOUSE"; m[2].value = 0; m[2].group = 0;
|
||||
m[3].type = NM_TYPE_TEXT; m[3].text = "";
|
||||
m[4].type = NM_TYPE_MENU; m[4].text = TXT_CUST_ABOVE;
|
||||
m[5].type = NM_TYPE_MENU; m[5].text = TXT_CUST_KEYBOARD;
|
||||
|
||||
do {
|
||||
|
||||
i = Config_control_type;
|
||||
if (i == CONTROL_MOUSE) i = 2;
|
||||
m[i].value = 1;
|
||||
|
||||
i1 = newmenu_do1(NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1);
|
||||
|
||||
// Config_joystick_sensitivity = m[6].value;
|
||||
|
||||
for (j = 0; j <= 2; j++)
|
||||
if (m[j].value)
|
||||
Config_control_type = j;
|
||||
i = Config_control_type;
|
||||
if (Config_control_type == 2)
|
||||
Config_control_type = CONTROL_MOUSE;
|
||||
|
||||
switch (i1) {
|
||||
case 4:
|
||||
kconfig(i, m[i].text);
|
||||
break;
|
||||
case 5:
|
||||
kconfig(0, "KEYBOARD");
|
||||
break;
|
||||
}
|
||||
|
||||
} while (i1>-1);
|
||||
|
||||
}
|
|
@ -8,9 +8,9 @@ ifdef SDL_AUDIO
|
|||
OBJECTS += digi.$(OBJ)
|
||||
endif
|
||||
|
||||
ifdef SDL_INPUT
|
||||
OBJECTS += event.$(OBJ) key_arch.$(OBJ) mouse.$(OBJ) clipboard.$(OBJ)
|
||||
endif
|
||||
# ifdef SDL_INPUT
|
||||
OBJECTS += event.$(OBJ) key_arch.$(OBJ) mouse.$(OBJ) clipboard.$(OBJ) joy.$(OBJ) joydefs.$(OBJ)
|
||||
# endif
|
||||
|
||||
ifdef SDL_VIDEO
|
||||
OBJECTS += gr.$(OBJ)
|
||||
|
|
|
@ -1,200 +1,52 @@
|
|||
#include <stdio.h>
|
||||
/*
|
||||
*
|
||||
* mingw_init.c - Basically same as linux init.c
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <conf.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
#include <mmsystem.h>
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "console.h"
|
||||
#include "text.h"
|
||||
#include "event.h"
|
||||
#include "error.h"
|
||||
#include "joy.h"
|
||||
#include "args.h"
|
||||
#include "resource.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern HINSTANCE hInst;
|
||||
extern HWND g_hWnd;
|
||||
extern LPDIRECTDRAW lpDD;
|
||||
extern LPDIRECTDRAWSURFACE lpDDSPrimary;
|
||||
extern LPDIRECTDRAWSURFACE lpDDSOne;
|
||||
extern LPDIRECTDRAWPALETTE lpDDPal;
|
||||
|
||||
extern int Inferno_verbose;
|
||||
|
||||
static int mouse_hidden=0;
|
||||
|
||||
static void finiObjects()
|
||||
{
|
||||
if(lpDD!=NULL)
|
||||
{
|
||||
if(lpDDSPrimary!=NULL)
|
||||
{
|
||||
IDirectDrawSurface_Release(lpDDSPrimary);
|
||||
lpDDSPrimary=NULL;
|
||||
}
|
||||
if(lpDDSOne!=NULL)
|
||||
{
|
||||
IDirectDrawSurface_Unlock(lpDDSOne,NULL);
|
||||
IDirectDrawSurface_Release(lpDDSOne);
|
||||
lpDDSOne=NULL;
|
||||
}
|
||||
if(lpDDPal!=NULL)
|
||||
{
|
||||
IDirectDrawSurface_Release(lpDDPal);
|
||||
lpDDPal=NULL;
|
||||
}
|
||||
IDirectDrawSurface_Release(lpDD);
|
||||
lpDD=NULL;
|
||||
}
|
||||
if(mouse_hidden)
|
||||
ShowCursor(TRUE);
|
||||
}
|
||||
|
||||
//extern unsigned int key_wparam, key_lparam, key_msg;
|
||||
void keyboard_handler();
|
||||
extern int WMKey_Handler_Ready;
|
||||
|
||||
void PumpMessages(void)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE|PM_NOYIELD))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
long PASCAL DescentWndProc(HWND hWnd,UINT message,
|
||||
WPARAM wParam,LPARAM lParam )
|
||||
{
|
||||
switch(message)
|
||||
{
|
||||
|
||||
case WM_KEYDOWN:
|
||||
case WM_KEYUP:
|
||||
if (WMKey_Handler_Ready) {
|
||||
// key_wparam=wParam; key_lparam=lParam; key_msg=message;
|
||||
keyboard_handler();
|
||||
}
|
||||
break;
|
||||
case WM_MOUSEMOVE:
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_LBUTTONUP:
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_RBUTTONUP:
|
||||
case WM_NCMOUSEMOVE:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
case WM_NCLBUTTONUP:
|
||||
case WM_NCRBUTTONDOWN:
|
||||
case WM_NCRBUTTONUP:
|
||||
break;
|
||||
case WM_PALETTECHANGED:
|
||||
case WM_PALETTEISCHANGING:
|
||||
return 0;
|
||||
case WM_ACTIVATEAPP:
|
||||
// Win32_Key_Hook(wParam);
|
||||
// DPH: This doesn't work... no idea why not...
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
finiObjects();
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
return DefWindowProc(hWnd,message,wParam,lParam);
|
||||
}
|
||||
extern void arch_sdl_init();
|
||||
extern void key_init();
|
||||
extern int com_init();
|
||||
extern void timer_init();
|
||||
|
||||
void arch_init_start()
|
||||
{
|
||||
WNDCLASS wcDescentClass;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef _MSC_VER
|
||||
if (FindArg("-memdbg"))
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | /* _CRTDBG_CHECK_ALWAYS_DF | */
|
||||
/*_CRTDBG_CHECK_CRT_DF |*/
|
||||
_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
wcDescentClass.lpszClassName = "WinD1X";
|
||||
wcDescentClass.hInstance = hInst;
|
||||
wcDescentClass.lpfnWndProc = DescentWndProc;
|
||||
wcDescentClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
//wcDescentClass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
|
||||
wcDescentClass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIN_ICON));
|
||||
wcDescentClass.lpszMenuName = NULL;
|
||||
wcDescentClass.hbrBackground = NULL;
|
||||
wcDescentClass.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcDescentClass.cbClsExtra = 0;
|
||||
wcDescentClass.cbWndExtra = 0;
|
||||
|
||||
// Register the class
|
||||
RegisterClass(&wcDescentClass);
|
||||
g_hWnd = CreateWindowEx(0,
|
||||
"WinD1X",
|
||||
"Descent",
|
||||
WS_OVERLAPPED | WS_BORDER,
|
||||
0, 0,
|
||||
GetSystemMetrics(SM_CXSCREEN),
|
||||
GetSystemMetrics(SM_CYSCREEN),
|
||||
NULL,
|
||||
NULL,
|
||||
hInst,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (!g_hWnd) return; // CRAP!
|
||||
ShowWindow(g_hWnd,SW_SHOWNORMAL);
|
||||
UpdateWindow(g_hWnd);
|
||||
}
|
||||
|
||||
extern void key_init(void);
|
||||
extern void mouse_init(void);
|
||||
//added/changed 3/7/99 Owen Evans (next line)
|
||||
extern void joy_init(int joyid);
|
||||
|
||||
void arch_init()
|
||||
{
|
||||
HRESULT ddrval;
|
||||
|
||||
|
||||
ddrval=DirectDrawCreate(NULL,&lpDD,NULL);
|
||||
|
||||
if(ddrval!=DD_OK)
|
||||
{
|
||||
fprintf(stderr,"DirectDrawCreate() failed!\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (FindArg("-semiwin"))
|
||||
ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,DDSCL_NORMAL);
|
||||
else
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,
|
||||
DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN|DDSCL_ALLOWREBOOT);
|
||||
#else
|
||||
ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,
|
||||
DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN|DDSCL_ALLOWREBOOT);
|
||||
#endif
|
||||
// Initialise the library
|
||||
arch_sdl_init();
|
||||
|
||||
if (!FindArg( "-nojoystick" )) {
|
||||
if (Inferno_verbose) printf( "\n%s", TXT_VERBOSE_6);
|
||||
joy_init();
|
||||
}
|
||||
|
||||
if (ddrval!=DD_OK)
|
||||
{
|
||||
fprintf(stderr,"SetCooperativeLevel() failed\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
ShowCursor(FALSE);
|
||||
mouse_hidden = 1;
|
||||
|
||||
SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS);
|
||||
|
||||
key_init();
|
||||
mouse_init();
|
||||
//added/changed 3/7/99 Owen Evans (next line)
|
||||
joy_init(JOYSTICKID1);
|
||||
printf("arch_init successfully completed\n");
|
||||
//added 06/09/99 Matt Mueller - fix nonetwork compile
|
||||
#ifdef NETWORK
|
||||
//end addition -MM
|
||||
//added on 10/19/98 by Victor Rachels to add serial support (from DPH)
|
||||
if(!(FindArg("-noserial")))
|
||||
com_init();
|
||||
//end this section addition - Victor
|
||||
//added 06/09/99 Matt Mueller - fix nonetwork compile
|
||||
#endif
|
||||
//end addition -MM
|
||||
key_init();
|
||||
}
|
||||
|
|
102
arch/win32/midi.c
Executable file
102
arch/win32/midi.c
Executable file
|
@ -0,0 +1,102 @@
|
|||
/* $Id: midi.c,v 1.1.1.1 2006/03/17 19:54:11 zicodxx Exp $ */
|
||||
// MIDI stuff follows.
|
||||
#include <stdio.h>
|
||||
|
||||
#include "error.h"
|
||||
#include "hmpfile.h"
|
||||
#include "args.h"
|
||||
|
||||
hmp_file *hmp = NULL;
|
||||
|
||||
int midi_volume = 255;
|
||||
int digi_midi_song_playing = 0;
|
||||
|
||||
|
||||
void digi_stop_current_song()
|
||||
{
|
||||
if (digi_midi_song_playing)
|
||||
{
|
||||
hmp_close(hmp);
|
||||
hmp = NULL;
|
||||
digi_midi_song_playing = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void digi_set_midi_volume(int n)
|
||||
{
|
||||
int mm_volume;
|
||||
|
||||
if (n < 0)
|
||||
midi_volume = 0;
|
||||
else if (n > 127)
|
||||
midi_volume = 127;
|
||||
else
|
||||
midi_volume = n;
|
||||
|
||||
// scale up from 0-127 to 0-0xffff
|
||||
mm_volume = (midi_volume << 1) | (midi_volume & 1);
|
||||
mm_volume |= (mm_volume << 8);
|
||||
|
||||
if (hmp)
|
||||
midiOutSetVolume((HMIDIOUT)hmp->hmidi, mm_volume | mm_volume << 16);
|
||||
}
|
||||
|
||||
void digi_play_midi_song(char *filename, char *melodic_bank, char *drum_bank, int loop)
|
||||
{
|
||||
#if 0
|
||||
if (!digi_initialised)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (FindArg("-nosound"))
|
||||
return;
|
||||
|
||||
digi_stop_current_song();
|
||||
|
||||
if (filename == NULL)
|
||||
return;
|
||||
if (midi_volume < 1)
|
||||
return;
|
||||
|
||||
if ((hmp = hmp_open(filename)))
|
||||
{
|
||||
hmp_play(hmp,loop);
|
||||
digi_midi_song_playing = 1;
|
||||
digi_set_midi_volume(midi_volume);
|
||||
}
|
||||
else
|
||||
printf("hmp_open failed\n");
|
||||
}
|
||||
|
||||
|
||||
int sound_paused = 0;
|
||||
|
||||
void digi_pause_midi()
|
||||
{
|
||||
#if 0
|
||||
if (!digi_initialised)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (sound_paused == 0)
|
||||
{
|
||||
// pause here
|
||||
}
|
||||
sound_paused++;
|
||||
}
|
||||
|
||||
void digi_resume_midi()
|
||||
{
|
||||
#if 0
|
||||
if (!digi_initialised)
|
||||
return;
|
||||
#endif
|
||||
|
||||
Assert(sound_paused > 0);
|
||||
|
||||
if (sound_paused == 1)
|
||||
{
|
||||
// resume sound here
|
||||
}
|
||||
sound_paused--;
|
||||
}
|
|
@ -2,17 +2,26 @@ This file describes how to compile D1X-Rebirth from source.
|
|||
|
||||
To compile you´ll need:
|
||||
|
||||
-gcc
|
||||
-mingw under windows
|
||||
-you don´t need msys but it´s supported anyway (just change the appropriate line in config.mingw)
|
||||
-sdl under linux (development version)
|
||||
-gcc/g++
|
||||
-mingw [windows]
|
||||
-nasm (optional, for sdl-build)
|
||||
-sdl
|
||||
-scons
|
||||
|
||||
|
||||
Building with SCons:
|
||||
* open SConstruct and change D1XDATAPATH to specify where the DESCENT data files are located
|
||||
* run "scons" with desired command-line options (see "scons -h" for complete list of options)
|
||||
* place the binary wherever you want to have it
|
||||
* copy your data files to the desired path you specified in "SConstruct" on D1XDATAPATH (see dxx-readme.txt for more information)
|
||||
|
||||
|
||||
Building with make: [not supported anymore!!! Please use SCons or fix on your own :)]
|
||||
* edit the "config" file and specify the output directory and the platform you´re running
|
||||
* edit the appropriate "config.linux" "config.mingw" or "config.other" file to chenge the options
|
||||
* run "make"
|
||||
* the resulting file now will be copied in the directory you specified in "config"
|
||||
* place the file wherever you want to have it
|
||||
* copy your data files to the desired path (see DXX-README.TXT for more information)
|
||||
* place the binary wherever you want to have it
|
||||
* copy your data files to the desired path you specified in "config" on DESCENT_DATA_PATH (see dxx-readme.txt for more information)
|
||||
|
||||
If you run into any problems do not hesitate to contact me.
|
||||
eMail is: zicothehentaifreak@gmx.de
|
||||
eMail is: zico@unixboard.de
|
|
@ -25,7 +25,7 @@ D1X-Rebrith.
|
|||
I hope you enjoy the game as you did when you played it the first time.
|
||||
|
||||
If you have something to say about my release, feel free to contact me at
|
||||
zicothehentaifreak@gmx.de
|
||||
zico@unixboard.de
|
||||
|
||||
- zico 20051229
|
||||
|
||||
|
@ -52,6 +52,7 @@ For example:
|
|||
2. Installation
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Windows:
|
||||
After you extracted the archive you're almost ready for Descent. But there is
|
||||
still a little bit work to do.
|
||||
You need to copy the original Descent data - namely "descent.hog" and
|
||||
|
@ -60,29 +61,25 @@ NOTE: These files need to be patched to version 1.4a.
|
|||
You will find the DOS- and a self made linux patch on
|
||||
http://www.dxx-rebirth.de.
|
||||
|
||||
Linux: see dxx-compile.txt
|
||||
|
||||
If you wish to add some extra levels like "Levels of the world" copy them
|
||||
to this directory, too.
|
||||
[NOTE: if you compiled the source, copy the files to your data directory you
|
||||
[NOTE: if you compiled the source, copy the files to your data directory you
|
||||
selected]
|
||||
|
||||
If you want to create Shortcurts to D1X on your Desktop and/or WM
|
||||
there is a wonderful icon stored in this directory.
|
||||
Novacron aka Troy Anderson of http://www.planetdescent.com has created it and
|
||||
allowed me to implement it to this release. Thanks again, Novacron!
|
||||
[NOTE: for the source you need to download this icons from
|
||||
[NOTE: for the source you need to download this icons from
|
||||
http://www.dxx-rebirth.de]
|
||||
|
||||
This package contains a set of HiRes fonts and briefing pictures D1X-Rebirth
|
||||
will use. If you don't want them, delete them, move them to another directory,
|
||||
or whatever you want.
|
||||
The windows package contains a set of HiRes fonts and briefing pictures
|
||||
D1X-Rebirth will use. If you don't want them, delete them, move them to
|
||||
another directory, or whatever you want.
|
||||
[NOTE: if you compiled the source you need to download these HiRes sets from
|
||||
Http://www.dxx-rebirth.de and store them into your data path]
|
||||
|
||||
NOTE for Linux:
|
||||
D1X-Rebirth will probably need a special version of libstdc++.
|
||||
This file is located in the subdirectory "lib". Place this file to "/usr/lib".
|
||||
But do NOT overwrite any of your libs. If D1X-Rebirth refuses to work, please
|
||||
use the source to create your very own binary.
|
||||
http://www.dxx-rebirth.de and store them into your data path]
|
||||
|
||||
WARNING:
|
||||
IF YOU UPDATE FROM v0.31 OR OLDER RESET YOUR RESOLUTION AND CONTROLS IN THE
|
||||
|
@ -92,9 +89,8 @@ MENUS. OTHERWISE THE GAME MAY CRASH!
|
|||
3. Running the game
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
windows: Just start the d1x-rebirth.exe :)
|
||||
linux: go to the directory where you extracted the archive and type
|
||||
'./d1x-rebirth'.
|
||||
windows: Just start the d1x-rebirth-gl/sdl.exe :)
|
||||
linux: see dxx-compile.txt
|
||||
|
||||
There are also a lot of optional command-line options you can set for
|
||||
D1X-Rebirth. Just open the file d1x.ini for a complete list of options and
|
||||
|
@ -130,11 +126,10 @@ Solution: Use the option '-gl_mipmap' or '-gl_trilinear' to activate
|
|||
|
||||
Problem: [LINUX] MIDI music doesn't work.
|
||||
Reason: The game is binaries are compiled for AWE support and should run with
|
||||
it very well.
|
||||
Solution: If you use an MPU401 card, just make the changes in defines.mak
|
||||
and compile it again. If it doesn't work, make shure you have
|
||||
MIDI configures correctly.
|
||||
Hint for AWE cards: asfxload -V100 8mbgmsfx.sf2
|
||||
it very well. Hint for AWE cards: asfxload -V100 8mbgmsfx.sf2
|
||||
Solution: If you use an MPU401 card, just make the following changes in SConstruct:
|
||||
Look for WANT_AWE32 and change it to WANT_MPU401. Then compile again.
|
||||
If you still use make, do the changes in config.linux
|
||||
|
||||
Problem: The mouse movement is too slow. Is there no way to control the ship
|
||||
like in other first person shooters?
|
||||
|
@ -154,19 +149,17 @@ Solution: To check that out try the following two options in the d1x.ini and
|
|||
that values:
|
||||
-maxfps 80
|
||||
-gl_refresh 60
|
||||
If you see no difference or D1X runs less fluently change the d1x.ini
|
||||
back to its old settings because your System is in best condition
|
||||
without that settings.
|
||||
If D1X now runs more fluently: CONGRATULATIONS, it was a pleasure to
|
||||
help you.
|
||||
If your D1X RUNS BETTER with that settings, please send a short info-e-
|
||||
mail to zicothehentaifreak@gmx.de. I would like to know on how many
|
||||
systems this behaviour occure.
|
||||
It may also be useful to play around with these settings.
|
||||
[Thanks for this hint go to SNIPER]
|
||||
|
||||
Problem: [WINDOWS] My joystick is not recognized by the game.
|
||||
Reason: Probably you have more than one Joystick but only one connected now.
|
||||
Solution: Go to control center -> gamecontroller. There set your joystick as
|
||||
"preferred device".
|
||||
|
||||
I'll try to find better solutions for these problems listed above if possible.
|
||||
If you find a new bug or a better workaround for any existing problem, please
|
||||
submit it to zicothehentaifreak@gmx.de.
|
||||
If you find a new bug or a better workaround/fix for any existing problem, please
|
||||
submit it to zico@unixboard.de.
|
||||
|
||||
|
||||
5. LEGAL STUFF
|
||||
|
|
|
@ -131,9 +131,9 @@ void plot_parametric(vms_equation *coeffs, fix min_t, fix max_t, fix del_t) {
|
|||
fix t, dt;
|
||||
|
||||
gr_setcolor(15);
|
||||
gr_box( 75, 40, 325, 290 );
|
||||
gr_box( 75, 310, 325, 560 );
|
||||
gr_box( 475, 310, 725, 560 );
|
||||
gr_rect( 75, 40, 325, 290 );
|
||||
gr_rect( 75, 310, 325, 560 );
|
||||
gr_rect( 475, 310, 725, 560 );
|
||||
//gr_pal_fade_in( grd_curscreen->pal );
|
||||
|
||||
for (t=min_t;t<max_t-del_t;t+=del_t) {
|
||||
|
|
|
@ -1318,7 +1318,7 @@ int med_save_group( char *filename, short *vertex_ids, short *segment_ids, int n
|
|||
}
|
||||
|
||||
static char old_tmap_list[MAX_TEXTURES][13];
|
||||
static short tmap_xlate_table[MAX_TEXTURES];
|
||||
// static short tmap_xlate_table[MAX_TEXTURES]; // ZICO - FIXME
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Load group will:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
TOPDIR = ..
|
||||
|
||||
#include $(TOPDIR)/makefile.config
|
||||
include $(TOPDIR)/makefile.config
|
||||
|
||||
OBJECTS = \
|
||||
med.$(OBJ) eglobal.$(OBJ) mine.$(OBJ) curves.$(OBJ) \
|
||||
|
|
1698
include/d3dtypes.h
1698
include/d3dtypes.h
File diff suppressed because it is too large
Load diff
4844
include/ddraw.h
4844
include/ddraw.h
File diff suppressed because it is too large
Load diff
1849
include/dinput.h
1849
include/dinput.h
File diff suppressed because it is too large
Load diff
863
include/dsound.h
863
include/dsound.h
|
@ -1,863 +0,0 @@
|
|||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsound.h
|
||||
* Content: DirectSound include file
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
#include <d3dtypes.h>
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
|
||||
#define _FACDS 0x878
|
||||
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
|
||||
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
|
||||
|
||||
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
|
||||
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IDirectSound;
|
||||
struct IDirectSoundBuffer;
|
||||
struct IDirectSound3DListener;
|
||||
struct IDirectSound3DBuffer;
|
||||
struct IDirectSoundCapture;
|
||||
struct IDirectSoundCaptureBuffer;
|
||||
struct IDirectSoundNotify;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IDirectSound *LPDIRECTSOUND;
|
||||
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
|
||||
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
|
||||
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
|
||||
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
|
||||
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
|
||||
|
||||
typedef struct _DSCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwMinSecondarySampleRate;
|
||||
DWORD dwMaxSecondarySampleRate;
|
||||
DWORD dwPrimaryBuffers;
|
||||
DWORD dwMaxHwMixingAllBuffers;
|
||||
DWORD dwMaxHwMixingStaticBuffers;
|
||||
DWORD dwMaxHwMixingStreamingBuffers;
|
||||
DWORD dwFreeHwMixingAllBuffers;
|
||||
DWORD dwFreeHwMixingStaticBuffers;
|
||||
DWORD dwFreeHwMixingStreamingBuffers;
|
||||
DWORD dwMaxHw3DAllBuffers;
|
||||
DWORD dwMaxHw3DStaticBuffers;
|
||||
DWORD dwMaxHw3DStreamingBuffers;
|
||||
DWORD dwFreeHw3DAllBuffers;
|
||||
DWORD dwFreeHw3DStaticBuffers;
|
||||
DWORD dwFreeHw3DStreamingBuffers;
|
||||
DWORD dwTotalHwMemBytes;
|
||||
DWORD dwFreeHwMemBytes;
|
||||
DWORD dwMaxContigFreeHwMemBytes;
|
||||
DWORD dwUnlockTransferRateHwBuffers;
|
||||
DWORD dwPlayCpuOverheadSwBuffers;
|
||||
DWORD dwReserved1;
|
||||
DWORD dwReserved2;
|
||||
} DSCAPS, *LPDSCAPS;
|
||||
|
||||
typedef const DSCAPS *LPCDSCAPS;
|
||||
|
||||
typedef struct _DSBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwUnlockTransferRate;
|
||||
DWORD dwPlayCpuOverhead;
|
||||
} DSBCAPS, *LPDSBCAPS;
|
||||
|
||||
typedef const DSBCAPS *LPCDSBCAPS;
|
||||
|
||||
typedef struct _DSBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSBUFFERDESC, *LPDSBUFFERDESC;
|
||||
|
||||
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
|
||||
|
||||
typedef struct _DS3DBUFFER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
DWORD dwInsideConeAngle;
|
||||
DWORD dwOutsideConeAngle;
|
||||
D3DVECTOR vConeOrientation;
|
||||
LONG lConeOutsideVolume;
|
||||
D3DVALUE flMinDistance;
|
||||
D3DVALUE flMaxDistance;
|
||||
DWORD dwMode;
|
||||
} DS3DBUFFER, *LPDS3DBUFFER;
|
||||
|
||||
typedef const DS3DBUFFER *LPCDS3DBUFFER;
|
||||
|
||||
typedef struct _DS3DLISTENER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
D3DVECTOR vOrientFront;
|
||||
D3DVECTOR vOrientTop;
|
||||
D3DVALUE flDistanceFactor;
|
||||
D3DVALUE flRolloffFactor;
|
||||
D3DVALUE flDopplerFactor;
|
||||
} DS3DLISTENER, *LPDS3DLISTENER;
|
||||
|
||||
typedef const DS3DLISTENER *LPCDS3DLISTENER;
|
||||
|
||||
typedef struct _DSCCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwFormats;
|
||||
DWORD dwChannels;
|
||||
} DSCCAPS, *LPDSCCAPS;
|
||||
|
||||
typedef const DSCCAPS *LPCDSCCAPS;
|
||||
|
||||
typedef struct _DSCBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
|
||||
|
||||
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
|
||||
|
||||
typedef struct _DSCBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
} DSCBCAPS, *LPDSCBCAPS;
|
||||
|
||||
typedef const DSCBCAPS *LPCDSCBCAPS;
|
||||
|
||||
typedef struct _DSBPOSITIONNOTIFY
|
||||
{
|
||||
DWORD dwOffset;
|
||||
HANDLE hEventNotify;
|
||||
} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
|
||||
|
||||
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
|
||||
|
||||
//
|
||||
// Compatibility typedefs
|
||||
//
|
||||
|
||||
typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
|
||||
typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
|
||||
typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
|
||||
typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
|
||||
typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
|
||||
typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
|
||||
typedef LPVOID *LPLPVOID;
|
||||
//typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
|
||||
|
||||
//
|
||||
// DirectSound API
|
||||
//
|
||||
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateW
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
|
||||
#else // UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateA
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
|
||||
#endif // UNICODE
|
||||
|
||||
//
|
||||
// IDirectSound
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound methods
|
||||
STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE;
|
||||
STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
|
||||
STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE;
|
||||
STDMETHOD(Compact) (THIS) PURE;
|
||||
STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound_Release(p) (p)->Release()
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectSound_Compact(p) (p)->Compact()
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetPan) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE;
|
||||
STDMETHOD(SetVolume) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetPan) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetFrequency) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Restore) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DListener
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DListener
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE;
|
||||
STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE;
|
||||
STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(CommitDeferredSettings) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DListener_Release(p) (p)->Release()
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE;
|
||||
STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMode) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE;
|
||||
STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
|
||||
STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCapture
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCapture
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCapture methods
|
||||
STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCapture_Release(p) (p)->Release()
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCaptureBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCaptureBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCaptureBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Start) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundNotify
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundNotify
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundNotify methods
|
||||
STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundNotify_Release(p) (p)->Release()
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IKsPropertySet
|
||||
//
|
||||
|
||||
#ifndef _IKsPropertySet_
|
||||
#define _IKsPropertySet_
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IKsPropertySet;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IKsPropertySet *LPKSPROPERTYSET;
|
||||
|
||||
#define KSPROPERTY_SUPPORT_GET 0x00000001
|
||||
#define KSPROPERTY_SUPPORT_SET 0x00000002
|
||||
|
||||
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IKsPropertySet
|
||||
|
||||
DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IKsPropertySet methods
|
||||
STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
|
||||
STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
|
||||
STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->AddRef()
|
||||
#define IKsPropertySet_Release(p) (p)->Release()
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#endif // _IKsPropertySet_
|
||||
|
||||
//
|
||||
// Return Codes
|
||||
//
|
||||
|
||||
#define DS_OK 0
|
||||
|
||||
// The call failed because resources (such as a priority level)
|
||||
// were already being used by another caller.
|
||||
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
|
||||
|
||||
// The control (vol,pan,etc.) requested by the caller is not available.
|
||||
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
|
||||
|
||||
// An invalid parameter was passed to the returning function
|
||||
#define DSERR_INVALIDPARAM E_INVALIDARG
|
||||
|
||||
// This call is not valid for the current state of this object
|
||||
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
|
||||
|
||||
// An undetermined error occured inside the DirectSound subsystem
|
||||
#define DSERR_GENERIC E_FAIL
|
||||
|
||||
// The caller does not have the priority level required for the function to
|
||||
// succeed.
|
||||
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
|
||||
|
||||
// Not enough free memory is available to complete the operation
|
||||
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
|
||||
|
||||
// The specified WAVE format is not supported
|
||||
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
|
||||
|
||||
// The function called is not supported at this time
|
||||
#define DSERR_UNSUPPORTED E_NOTIMPL
|
||||
|
||||
// No sound driver is available for use
|
||||
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
|
||||
|
||||
// This object is already initialized
|
||||
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
|
||||
|
||||
// This object does not support aggregation
|
||||
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
|
||||
|
||||
// The buffer memory has been lost, and must be restored.
|
||||
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
||||
|
||||
// Another app has a higher priority level, preventing this call from
|
||||
// succeeding.
|
||||
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
|
||||
|
||||
// This object has not been initialized
|
||||
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
|
||||
|
||||
// The requested COM interface is not available
|
||||
#define DSERR_NOINTERFACE E_NOINTERFACE
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
|
||||
#define DSCAPS_PRIMARYMONO 0x00000001
|
||||
#define DSCAPS_PRIMARYSTEREO 0x00000002
|
||||
#define DSCAPS_PRIMARY8BIT 0x00000004
|
||||
#define DSCAPS_PRIMARY16BIT 0x00000008
|
||||
#define DSCAPS_CONTINUOUSRATE 0x00000010
|
||||
#define DSCAPS_EMULDRIVER 0x00000020
|
||||
#define DSCAPS_CERTIFIED 0x00000040
|
||||
#define DSCAPS_SECONDARYMONO 0x00000100
|
||||
#define DSCAPS_SECONDARYSTEREO 0x00000200
|
||||
#define DSCAPS_SECONDARY8BIT 0x00000400
|
||||
#define DSCAPS_SECONDARY16BIT 0x00000800
|
||||
|
||||
#define DSBPLAY_LOOPING 0x00000001
|
||||
|
||||
#define DSBSTATUS_PLAYING 0x00000001
|
||||
#define DSBSTATUS_BUFFERLOST 0x00000002
|
||||
#define DSBSTATUS_LOOPING 0x00000004
|
||||
|
||||
#define DSBLOCK_FROMWRITECURSOR 0x00000001
|
||||
#define DSBLOCK_ENTIREBUFFER 0x00000002
|
||||
|
||||
#define DSSCL_NORMAL 0x00000001
|
||||
#define DSSCL_PRIORITY 0x00000002
|
||||
#define DSSCL_EXCLUSIVE 0x00000003
|
||||
#define DSSCL_WRITEPRIMARY 0x00000004
|
||||
|
||||
#define DS3DMODE_NORMAL 0x00000000
|
||||
#define DS3DMODE_HEADRELATIVE 0x00000001
|
||||
#define DS3DMODE_DISABLE 0x00000002
|
||||
|
||||
#define DS3D_IMMEDIATE 0x00000000
|
||||
#define DS3D_DEFERRED 0x00000001
|
||||
|
||||
#define DS3D_MINDISTANCEFACTOR 0.0f
|
||||
#define DS3D_MAXDISTANCEFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINROLLOFFFACTOR 0.0f
|
||||
#define DS3D_MAXROLLOFFFACTOR 10.0f
|
||||
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINDOPPLERFACTOR 0.0f
|
||||
#define DS3D_MAXDOPPLERFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
|
||||
|
||||
#define DS3D_DEFAULTMINDISTANCE 1.0f
|
||||
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
|
||||
|
||||
#define DS3D_MINCONEANGLE 0
|
||||
#define DS3D_MAXCONEANGLE 360
|
||||
#define DS3D_DEFAULTCONEANGLE 360
|
||||
|
||||
#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
|
||||
|
||||
#define DSBCAPS_PRIMARYBUFFER 0x00000001
|
||||
#define DSBCAPS_STATIC 0x00000002
|
||||
#define DSBCAPS_LOCHARDWARE 0x00000004
|
||||
#define DSBCAPS_LOCSOFTWARE 0x00000008
|
||||
#define DSBCAPS_CTRL3D 0x00000010
|
||||
#define DSBCAPS_CTRLFREQUENCY 0x00000020
|
||||
#define DSBCAPS_CTRLPAN 0x00000040
|
||||
#define DSBCAPS_CTRLVOLUME 0x00000080
|
||||
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
|
||||
#define DSBCAPS_CTRLDEFAULT 0x000000E0
|
||||
#define DSBCAPS_CTRLALL 0x000001F0
|
||||
#define DSBCAPS_STICKYFOCUS 0x00004000
|
||||
#define DSBCAPS_GLOBALFOCUS 0x00008000
|
||||
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
|
||||
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
|
||||
|
||||
#define DSCBCAPS_WAVEMAPPED 0x80000000
|
||||
|
||||
#define DSSPEAKER_HEADPHONE 0x00000001
|
||||
#define DSSPEAKER_MONO 0x00000002
|
||||
#define DSSPEAKER_QUAD 0x00000003
|
||||
#define DSSPEAKER_STEREO 0x00000004
|
||||
#define DSSPEAKER_SURROUND 0x00000005
|
||||
|
||||
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
|
||||
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
|
||||
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
|
||||
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
|
||||
|
||||
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
|
||||
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
|
||||
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
|
||||
|
||||
#define DSCCAPS_EMULDRIVER 0x00000020
|
||||
|
||||
#define DSCBLOCK_ENTIREBUFFER 0x00000001
|
||||
|
||||
#define DSCBSTATUS_CAPTURING 0x00000001
|
||||
#define DSCBSTATUS_LOOPING 0x00000002
|
||||
|
||||
#define DSCBSTART_LOOPING 0x00000001
|
||||
|
||||
#define DSBFREQUENCY_MIN 100
|
||||
#define DSBFREQUENCY_MAX 100000
|
||||
#define DSBFREQUENCY_ORIGINAL 0
|
||||
|
||||
#define DSBPAN_LEFT -10000
|
||||
#define DSBPAN_CENTER 0
|
||||
#define DSBPAN_RIGHT 10000
|
||||
|
||||
#define DSBVOLUME_MIN -10000
|
||||
#define DSBVOLUME_MAX 0
|
||||
|
||||
#define DSBSIZE_MIN 4
|
||||
#define DSBSIZE_MAX 0x0FFFFFFF
|
||||
|
||||
#define DSBPN_OFFSETSTOP 0xFFFFFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __DSOUND_INCLUDED__
|
143
main/kconfig.c
143
main/kconfig.c
|
@ -81,18 +81,9 @@ static char rcsid[] = "$Id: kconfig.c,v 1.1.1.1 2006/03/17 19:44:27 zicodxx Exp
|
|||
byte fades[64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 };
|
||||
|
||||
int invert_text[2] = { TNUM_N, TNUM_Y };
|
||||
#ifndef __LINUX__
|
||||
int joybutton_text[28] =
|
||||
{ TNUM_BTN_1, TNUM_BTN_2, TNUM_BTN_3, TNUM_BTN_4,
|
||||
-1, TNUM_TRIG, TNUM_LEFT, TNUM_HAT_L,
|
||||
TNUM_RIGHT, -1, TNUM_HAT2_D, TNUM_HAT_R,
|
||||
TNUM_MID, -1, TNUM_HAT2_R, TNUM_HAT_U,
|
||||
TNUM_HAT2_L, -1, TNUM_HAT2_U, TNUM_HAT_D,
|
||||
TNUM_TRIG, TNUM_LEFT, TNUM_RIGHT, -1,
|
||||
TNUM_UP, TNUM_DOWN, TNUM_LEFT, TNUM_RIGHT };
|
||||
int joyaxis_text[4] = { TNUM_X1, TNUM_Y1, TNUM_X2, TNUM_Y2 };
|
||||
#endif
|
||||
int mouseaxis_text[2] = { TNUM_L_R, TNUM_F_B };
|
||||
char *joybutton_text[JOY_MAX_BUTTONS];
|
||||
char *joyaxis_text[JOY_MAX_AXES];
|
||||
int mouseaxis_text[3] = { TNUM_L_R, TNUM_F_B, "Z1" };
|
||||
int mousebutton_text[3] = { TNUM_LEFT, TNUM_RIGHT, TNUM_MID };
|
||||
char * mousebutton_textra[13] = { "M4", "M5", "M6", "M7", "M8", "M9", "M10","M11","M12","M13","M14","M15","M16" };//text for buttons above 3. -MPM
|
||||
|
||||
|
@ -856,27 +847,43 @@ void kc_drawitem( kc_item *item, int is_current )
|
|||
case BT_KEY:
|
||||
strncpy( btext, key_text[item->value], 10 ); break;
|
||||
case BT_MOUSE_BUTTON:
|
||||
|
||||
strncpy( btext, item->value<=3?Text_string[mousebutton_text[item->value]]:mousebutton_textra[item->value-3], 10 ); break;
|
||||
case BT_MOUSE_AXIS:
|
||||
strncpy( btext, Text_string[mouseaxis_text[item->value]], 10 ); break;
|
||||
// case BT_JOY_BUTTON:
|
||||
// //added/changed 9/6/98 Matt Mueller -> #endif
|
||||
// // #ifdef __LINUX__
|
||||
// // sprintf( btext, "J%d B%d", j_button[item->value].joydev, j_Get_joydev_button_number (item->value) );
|
||||
// // #else
|
||||
// if ( joybutton_text[item->value] !=-1 )
|
||||
// strncpy( btext, Text_string[ joybutton_text[item->value] ], 10 );
|
||||
// else
|
||||
// sprintf( btext, "BTN%d", item->value );
|
||||
// // #endif
|
||||
// break;
|
||||
// case BT_JOY_AXIS:
|
||||
// //added/changed 9/6/98 Matt Mueller -> #endif
|
||||
// // #ifdef __LINUX__
|
||||
// // sprintf( btext, "J%d A%d", j_axis[item->value].joydev, j_Get_joydev_axis_number (item->value) );
|
||||
// // #else
|
||||
// strncpy( btext, Text_string[joyaxis_text[item->value]], 10 );
|
||||
// // #endif
|
||||
// break;
|
||||
|
||||
|
||||
case BT_JOY_BUTTON:
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
sprintf( btext, "J%d B%d", j_button[item->value].joydev, j_Get_joydev_button_number (item->value) );
|
||||
#else
|
||||
if ( joybutton_text[item->value] !=-1 )
|
||||
strncpy( btext, Text_string[ joybutton_text[item->value] ], 10 );
|
||||
if (joybutton_text[item->value])
|
||||
strncpy(btext, joybutton_text[item->value], 10);
|
||||
else
|
||||
sprintf( btext, "BTN%d", item->value );
|
||||
#endif
|
||||
sprintf(btext, "BTN%2d", item->value + 1);
|
||||
|
||||
break;
|
||||
case BT_JOY_AXIS:
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
sprintf( btext, "J%d A%d", j_axis[item->value].joydev, j_Get_joydev_axis_number (item->value) );
|
||||
#else
|
||||
strncpy( btext, Text_string[joyaxis_text[item->value]], 10 );
|
||||
#endif
|
||||
if (joyaxis_text[item->value])
|
||||
strncpy(btext, joyaxis_text[item->value], 10);
|
||||
else
|
||||
sprintf(btext, "AXIS%2d", item->value + 1);
|
||||
break;
|
||||
case BT_INVERT:
|
||||
strncpy( btext, Text_string[invert_text[item->value]], 10 ); break;
|
||||
|
@ -1009,9 +1016,9 @@ void kc_change_joybutton( kc_item * item )
|
|||
kc_drawquestion( item );
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller + 9/19/98 Owen Evans-> #endif
|
||||
#ifdef __LINUX__
|
||||
for (i = 0; i < j_num_buttons; i++) {
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// for (i = 0; i < j_num_buttons; i++) {
|
||||
// #else
|
||||
if (Config_control_type==CONTROL_THRUSTMASTER_FCS) {
|
||||
|
||||
int axis[JOY_NUM_AXES];
|
||||
|
@ -1022,12 +1029,12 @@ void kc_change_joybutton( kc_item * item )
|
|||
if ( joy_get_button_state(15) ) code = 15;
|
||||
if ( joy_get_button_state(19) ) code = 19;
|
||||
for (i=0; i<4; i++ ) {
|
||||
#endif
|
||||
// #endif
|
||||
if ( joy_get_button_state(i) )
|
||||
code = i;
|
||||
}
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifndef __LINUX__
|
||||
// #ifndef __LINUX__
|
||||
} else if (Config_control_type==CONTROL_FLIGHTSTICK_PRO) {
|
||||
for (i=4; i<20; i++ ) {
|
||||
if ( joy_get_button_state(i) ) {
|
||||
|
@ -1037,12 +1044,12 @@ void kc_change_joybutton( kc_item * item )
|
|||
}
|
||||
} else {
|
||||
//added/changed 3/7/99 Owen Evans (next line)
|
||||
for (i=0; i<MAX_BUTTONS; i++ ) {
|
||||
for (i=0; i<JOY_MAX_BUTTONS; i++ ) {
|
||||
if ( joy_get_button_state(i) )
|
||||
code = i;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// #endif
|
||||
}
|
||||
if (code!=255) {
|
||||
for (i=0; i<Num_items; i++ ) {
|
||||
|
@ -1113,14 +1120,14 @@ void kc_change_mousebutton( kc_item * item )
|
|||
void kc_change_joyaxis( kc_item * item )
|
||||
{
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
int axis[32];
|
||||
int old_axis[32];
|
||||
#else
|
||||
//added/changed 3/7/99 Owen Evans -> #endif
|
||||
// #ifdef __LINUX__
|
||||
// int axis[32];
|
||||
// int old_axis[32];
|
||||
// #else
|
||||
// //added/changed 3/7/99 Owen Evans -> #endif
|
||||
int axis[JOY_NUM_AXES];
|
||||
int old_axis[JOY_NUM_AXES];
|
||||
#endif
|
||||
// #endif
|
||||
int n,i,k;
|
||||
ubyte code;
|
||||
|
||||
|
@ -1154,12 +1161,12 @@ void kc_change_joyaxis( kc_item * item )
|
|||
joystick_read_raw_axis( JOY_ALL_AXIS, axis );
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller + 9/19/98 Owen Evans -> #endif
|
||||
#ifdef __LINUX__
|
||||
for (i = 0; i < j_num_axes; i++)
|
||||
{
|
||||
if (abs (axis[i] - old_axis[i]) > ((j_axis[i].max_val - j_axis[i].min_val) / 32))
|
||||
{
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// for (i = 0; i < j_num_axes; i++)
|
||||
// {
|
||||
// if (abs (axis[i] - old_axis[i]) > ((j_axis[i].max_val - j_axis[i].min_val) / 32))
|
||||
// {
|
||||
// #else
|
||||
//added/changed 3/17/99 Owen Evans
|
||||
//added/edited on 9/6/99 by Victor Rachels for better config
|
||||
//-unneeded- joy_get_cal_vals(temp_min, temp_center, temp_max);
|
||||
|
@ -1169,7 +1176,7 @@ void kc_change_joyaxis( kc_item * item )
|
|||
if(axis[i]) //-was- if (abs(axis[i] - old_axis[i]) > ((temp_max[i] - temp_min[i]) / 32))
|
||||
//end this section addition/edit - VR
|
||||
{
|
||||
#endif
|
||||
// #endif
|
||||
code = i;
|
||||
}
|
||||
old_axis[i] = axis[i];
|
||||
|
@ -1316,7 +1323,7 @@ void kconfig(int n, char * title)
|
|||
}
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifndef __LINUX__
|
||||
// #ifndef __LINUX__
|
||||
void kconfig_read_fcs( int raw_axis )
|
||||
{
|
||||
int raw_button, button, axis_min[JOY_NUM_AXES], axis_center[JOY_NUM_AXES], axis_max[JOY_NUM_AXES];
|
||||
|
@ -1373,7 +1380,7 @@ void kconfig_set_fcs_button( int btn, int button )
|
|||
joy_set_btn_values( btn, state, time_down, downcount, upcount );
|
||||
|
||||
}
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
#define PH_SCALE 8
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
|
@ -1385,11 +1392,11 @@ void kconfig_set_fcs_button( int btn, int button )
|
|||
fix LastReadTime = 0;
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
fix joy_axis[32];
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// fix joy_axis[32];
|
||||
// #else
|
||||
fix joy_axis[JOY_NUM_AXES];
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
ubyte kc_use_external_control = 0;
|
||||
ubyte kc_enable_external_control = 1;
|
||||
|
@ -1561,11 +1568,11 @@ void controls_read_all()
|
|||
fix ctime;
|
||||
fix mouse_axis[2];
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
int raw_joy_axis[32];
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// int raw_joy_axis[32];
|
||||
// #else
|
||||
int raw_joy_axis[JOY_NUM_AXES];
|
||||
#endif
|
||||
// #endif
|
||||
int mouse_buttons;
|
||||
fix k0, k1, k2, k3, kp;
|
||||
fix k4, k5, k6, k7, kh;
|
||||
|
@ -1610,21 +1617,21 @@ void controls_read_all()
|
|||
channel_masks = joystick_read_raw_axis( JOY_ALL_AXIS, raw_joy_axis );
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
for (i=0; i < j_num_axes; i++ ) {
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// for (i=0; i < j_num_axes; i++ ) {
|
||||
// #else
|
||||
//added/changed 3/7/99 Owen Evans (next line)
|
||||
for (i=0; i<JOY_NUM_AXES; i++ ) {
|
||||
if (channel_masks&(1<<i)) {
|
||||
#endif
|
||||
// #endif
|
||||
int joy_null_value = 10;
|
||||
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifndef __LINUX__
|
||||
// #ifndef __LINUX__
|
||||
if ( (i==3) && (Config_control_type==CONTROL_THRUSTMASTER_FCS) ) {
|
||||
kconfig_read_fcs( raw_joy_axis[i] );
|
||||
} else {
|
||||
#endif
|
||||
// #endif
|
||||
raw_joy_axis[i] = joy_get_scaled_reading( raw_joy_axis[i], i );
|
||||
|
||||
if (kc_joystick[23].value==i) // If this is the throttle
|
||||
|
@ -1639,20 +1646,20 @@ void controls_read_all()
|
|||
joy_axis[i] = (raw_joy_axis[i]*FrameTime)/128;
|
||||
}
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifndef __LINUX__
|
||||
// #ifndef __LINUX__
|
||||
} else {
|
||||
joy_axis[i] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// #endif
|
||||
use_joystick=1;
|
||||
} else {
|
||||
//added/changed 9/6/98 Matt Mueller -> #endif
|
||||
#ifdef __LINUX__
|
||||
for (i=0; i<j_num_axes; i++ )
|
||||
#else
|
||||
// #ifdef __LINUX__
|
||||
// for (i=0; i<j_num_axes; i++ )
|
||||
// #else
|
||||
for (i=0; i<JOY_NUM_AXES; i++ )
|
||||
#endif
|
||||
// #endif
|
||||
joy_axis[i] = 0;
|
||||
use_joystick=0;
|
||||
}
|
||||
|
|
|
@ -1141,9 +1141,9 @@ void d1x_options_menu()
|
|||
#ifdef __MSDOS__
|
||||
Joy_is_Sidewinder=m[(checks+0)].value;
|
||||
#endif
|
||||
#ifdef __LINUX__
|
||||
Joy_is_Sidewinder=0;
|
||||
#endif
|
||||
// #ifdef __LINUX__
|
||||
// Joy_is_Sidewinder=0;
|
||||
// #endif
|
||||
#ifdef SUPPORTS_NICEFPS
|
||||
use_nice_fps=m[(checks+0)].value;
|
||||
#else
|
||||
|
|
|
@ -374,19 +374,7 @@ RetrySelection:
|
|||
kc_set_controls();
|
||||
Config_control_type = control_choice;
|
||||
|
||||
Joy_is_Sidewinder = 0;
|
||||
//added/edited 9/03/98 by Victor Rachels to add Sidewinder
|
||||
if ( (Config_control_type==CONTROL_THRUSTMASTER_FCS) &&
|
||||
(nm_messagebox(NULL, 2, "Yes", "No", "Is your joystick a sidewinder?")==0) )
|
||||
{
|
||||
Joy_is_Sidewinder = 1;
|
||||
kconfig_settings[3][21] = 0x2;
|
||||
kc_set_controls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( Config_control_type==CONTROL_THRUSTMASTER_FCS && !Joy_is_Sidewinder) {
|
||||
if ( Config_control_type==CONTROL_THRUSTMASTER_FCS) {
|
||||
//end addition/edit - Victor Rachels
|
||||
i = nm_messagebox( TXT_IMPORTANT_NOTE, 2, "Choose another", TXT_OK, TXT_FCS );
|
||||
if (i==0) goto RetrySelection;
|
||||
|
@ -660,8 +648,6 @@ int read_player_d1x(const char *filename)
|
|||
|
||||
while(!strstr(word,"END") && !feof(f))
|
||||
{
|
||||
if(!strcmp(word,"JOY IS SIDEWINDER"))
|
||||
sscanf(line,"%i",&Joy_is_Sidewinder);
|
||||
if(!strcmp(word,"DEADZONE"))
|
||||
sscanf(line,"%i",&joy_deadzone);
|
||||
free(line); free(word);
|
||||
|
@ -931,7 +917,6 @@ int write_player_d1x(const char *filename)
|
|||
fprintf(fout,"[end]\n");
|
||||
|
||||
fprintf(fout,"[joystick]\n");
|
||||
fprintf(fout,"joy is sidewinder=%i\n",Joy_is_Sidewinder);
|
||||
fprintf(fout,"deadzone=%i\n",joy_deadzone);
|
||||
fprintf(fout,"[end]\n");
|
||||
|
||||
|
@ -1103,7 +1088,6 @@ int write_player_d1x(const char *filename)
|
|||
else if (strstr(line,"JOYSTICK"))
|
||||
{
|
||||
fprintf(fout,"[joystick]\n");
|
||||
fprintf(fout,"joy is sidewinder=%i\n",Joy_is_Sidewinder);
|
||||
fprintf(fout,"deadzone=%i\n",joy_deadzone);
|
||||
fprintf(fout,"[end]\n");
|
||||
while(!strstr(line,"END")&&!feof(fin))
|
||||
|
@ -1154,7 +1138,6 @@ int write_player_d1x(const char *filename)
|
|||
if(!(printed&JOYSTICK))
|
||||
{
|
||||
fprintf(fout,"[joystick]\n");
|
||||
fprintf(fout,"joy is sidewinder=%i\n",Joy_is_Sidewinder);
|
||||
fprintf(fout,"deadzone=%i\n",joy_deadzone);
|
||||
fprintf(fout,"[end]\n");
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ void menu_show( MENU * menu )
|
|||
if ( menu != &Menu[0] )
|
||||
{
|
||||
gr_setcolor( CBLACK );
|
||||
gr_ubox( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
|
||||
gr_urect( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ void ui_draw_userbox( UI_GADGET_USERBOX * userbox )
|
|||
else
|
||||
gr_setcolor( CBRIGHT );
|
||||
|
||||
gr_box( -1, -1, userbox->width, userbox->height );
|
||||
gr_rect( -1, -1, userbox->width, userbox->height );
|
||||
|
||||
ui_mouse_show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue