Commit bb45b28c authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Source code "cleanup," herein referred to as "rape"

From-SVN: r1625
parent 08c4d27f
......@@ -3,8 +3,7 @@
SOURCEFILES=GNU.TXT buildlic.txt \
Makefile Makefile.deps Makefile.msvc Makefile.watcom MakeDistributions \
makemsc.bat makew.bat ChangeLog.html duke3d.def.sample \
SEHELP.HLP STHELP.HLP ChangeLog enhance.con.sample names.h
duke3d.def.sample SEHELP.HLP STHELP.HLP enhance.con.sample names.h
BINARYFILES=mapster32.exe eduke32.exe GNU.TXT buildlic.txt \
ChangeLog.html setup.exe duke3d.def.sample SEHELP.HLP STHELP.HLP \
......
......@@ -80,6 +80,9 @@ ifeq (4,$(GCC_MAJOR))
# debug += -finline-small-functions -fpredictive-commoning
endif
endif
ifeq (5,$(GCC_MINOR))
debug += -flto
endif
endif
endif
......@@ -89,7 +92,7 @@ OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
-fjump-tables -fno-stack-protector
# -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse
OURCXXFLAGS=-fno-exceptions -fno-rtti
LIBS=-lm
LIBS=-lm -ldl -pthread
NASMFLAGS = -s
EXESUFFIX=
......
......@@ -24,14 +24,12 @@ flags_cl= /Od /Zi
flags_link=/DEBUG
!else
# release options
flags_cl=/Ox /GL /arch:SSE
flags_cl=/O2 /GL /arch:SSE /MP
flags_link=/RELEASE /LTCG
!endif
DXROOT="U:\SDKs\Microsoft DirectX SDK (April 2007)
MSSDKROOT="N:\Program Files\Microsoft Visual Studio 9.0\VC
PLATFORMSDK="N:\Program Files\Microsoft Visual Studio 9.0\VC\PlatformSDK
DXROOT="C:\Program Files\Microsoft DirectX SDK (February 2010)"
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DPOLYMER
......@@ -40,10 +38,10 @@ AS=ml
LINK=link /nologo /opt:ref
MT=mt
CFLAGS= /MT /J /nologo $(flags_cl) \
/I$(INC) /I$(EINC)\msvc /I$(EINC)\ /I$(SRC)\jmact /I$(JAUDIOLIBDIR)\include /I$(ENETDIR)\include /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \
/I$(INC) /I$(EINC)\msvc /I$(EINC)\ /I$(SRC)\jmact /I$(JAUDIOLIBDIR)\include /I$(ENETDIR)\include \
/D "_CRT_SECURE_NO_DEPRECATE" /W2 $(ENGINEOPTS) \
/I$(DXROOT)\include" /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib ws2_32.lib comctl32.lib \
/I$(DXROOT)\include /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib winmm.lib ws2_32.lib dxguid.lib comctl32.lib \
/NODEFAULTLIB:glu32.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib
LIBS=vorbisfile_static.lib vorbis_static.lib ogg_static.lib dsound.lib advapi32.lib $(LIBS)
......@@ -128,18 +126,18 @@ EDITOROBJS=$(OBJ)\astub.$o \
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)\misc}.rc{$(OBJ)\}.res:
$(RC) /i$(EINC)\ /i$(SRC)\ /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" /DPOLYMER /fo$@ /r $<
$(RC) /i$(EINC)\ /i$(SRC)\ /DPOLYMER /fo$@ /r $<
# TARGETS
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) # duke3d_w32$(EXESUFFIX);
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB) $(ENETDIR)\$(ENETLIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86 $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $(RSRC)\manifest.game.xml -hashupdate -outputresource:$@ -out:$@.manifest
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86 $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $(RSRC)\manifest.build.xml -hashupdate -outputresource:$@ -out:$@.manifest
!include Makefile.deps
......
......@@ -102,6 +102,9 @@ ifeq (4,$(GCC_MAJOR))
# debug += -finline-small-functions -fpredictive-commoning
endif
endif
ifeq (5,$(GCC_MINOR))
debug += -flto
endif
endif
endif
......@@ -111,7 +114,7 @@ OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
-fjump-tables -fno-stack-protector
# -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse
OURCXXFLAGS=-fno-exceptions -fno-rtti
LIBS=-pthread
LIBS=-pthread -ldl
ASFLAGS=-s #-g
EXESUFFIX=
......@@ -140,7 +143,8 @@ ENGINEOBJS+= \
$(OBJ)/osd.$o \
$(OBJ)/pragmas.$o \
$(OBJ)/scriptfile.$o \
$(OBJ)/nedmalloc.$o
$(OBJ)/nedmalloc.$o \
$(OBJ)/mutex.$o
ifeq (1,$(USE_OPENGL))
ENGINEOBJS+= $(OBJ)/mdsprite.$o
......@@ -202,7 +206,7 @@ ifeq ($(RENDERTYPE),SDL)
endif
endif
ifeq ($(RENDERTYPE),WIN)
ENGINEOBJS+= $(OBJ)/winlayer.$o
ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o
EDITOROBJS+= $(OBJ)/startwin.editor.$o
endif
......
......@@ -9,12 +9,12 @@ $(OBJ)/compat.$o: $(SRC)/compat.c $(INC)/compat.h
$(OBJ)/config.$o: $(SRC)/config.c $(INC)/compat.h $(INC)/osd.h $(INC)/editor.h
$(OBJ)/crc32.$o: $(SRC)/crc32.c $(INC)/crc32.h
$(OBJ)/defs.$o: $(SRC)/defs.c $(INC)/build.h $(INC)/baselayer.h $(INC)/scriptfile.h $(INC)/compat.h
$(OBJ)/engine.$o: $(SRC)/engine.c $(INC)/compat.h $(INC)/build.h $(INC)/pragmas.h $(INC)/cache1d.h $(INC)/a.h $(INC)/osd.h $(INC)/baselayer.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h $(INC)/polymer.h
$(OBJ)/polymost.$o: $(SRC)/polymost.c $(INC)/md4.h $(INC)/quicklz.h $(INC)/lzwnew.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
$(OBJ)/hightile.$o: $(SRC)/hightile.c $(INC)/kplib.h $(INC)/hightile.h
$(OBJ)/mdsprite.$o: $(SRC)/mdsprite.c $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
$(OBJ)/textfont.$o: $(SRC)/textfont.c
$(OBJ)/smalltextfont.$o: $(SRC)/smalltextfont.c
$(OBJ)/engine.$o: $(SRC)/engine.c $(INC)/compat.h $(INC)/build.h $(INC)/pragmas.h $(INC)/cache1d.h $(INC)/a.h $(INC)/osd.h $(INC)/baselayer.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h $(INC)/polymer.h
$(OBJ)/polymost.$o: $(SRC)/polymost.c $(INC)/md4.h $(INC)/quicklz.h $(INC)/lzwnew.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
$(OBJ)/hightile.$o: $(SRC)/hightile.c $(INC)/kplib.h $(INC)/hightile.h
$(OBJ)/mdsprite.$o: $(SRC)/mdsprite.c $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
$(OBJ)/textfont.$o: $(SRC)/textfont.c
$(OBJ)/smalltextfont.$o: $(SRC)/smalltextfont.c
$(OBJ)/glbuild.$o: $(SRC)/glbuild.c $(INC)/glbuild.h $(INC)/baselayer.h
$(OBJ)/kplib.$o: $(SRC)/kplib.c $(INC)/compat.h
$(OBJ)/quicklz.$o: $(SRC)/quicklz.c $(INC)/quicklz.h
......@@ -29,6 +29,8 @@ $(OBJ)/gtkbits.$o: $(SRC)/gtkbits.c $(INC)/baselayer.h $(INC)/build.h $(INC)/dyn
$(OBJ)/dynamicgtk.$o: $(SRC)/dynamicgtk.c $(INC)/dynamicgtk.h
$(OBJ)/polymer.$o: $(SRC)/polymer.c $(INC)/polymer.h $(INC)/compat.h $(INC)/build.h $(INC)/glbuild.h $(INC)/osd.h $(INC)/pragmas.h $(INC)/mdsprite.h $(INC)/polymost.h
$(OBJ)/nedmalloc.$o: $(SRC)/nedmalloc.c $(INC)/nedmalloc.h $(INC)/malloc.c.h
$(OBJ)/mutex.$o: $(SRC)/mutex.c $(INC)/mutex.h
$(OBJ)/rawinput.$o: $(SRC)/rawinput.c $(INC)/rawinput.h
$(OBJ)/buildres.$(res): $(SRC)/misc/buildres.rc $(INC)/startwin.editor.h
$(OBJ)/startwin.editor.$o: $(SRC)/startwin.editor.c $(INC)/build.h $(INC)/editor.h $(INC)/winlayer.h $(INC)/compat.h $(INC)/startwin.editor.h
......
......@@ -19,9 +19,6 @@ asm=masm
ENGINELIB=engine.lib
EDITORLIB=build.lib
DXROOT="U:\SDKs\Microsoft DirectX SDK (April 2007)
MSSDKROOT="N:\Program Files\Microsoft Visual Studio 9.0\VC
PLATFORMSDK="N:\Program Files\Microsoft Visual Studio 9.0\VC\PlatformSDK
# ENETROOT=$(SRC)\enet
# /D these to enable certain features of the port's compile process
......@@ -37,7 +34,7 @@ flags_link=/DEBUG
flags_lib=
!else
# release options
flags_cl=/Ox /GL /arch:SSE
flags_cl=/O2 /GL /arch:SSE /MP
flags_link=/RELEASE /LTCG
flags_lib=/LTCG
!endif
......@@ -46,7 +43,7 @@ CC=cl
AS=ml
RC=rc
LINK=link /opt:ref /nologo
CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" /I$(DXROOT)\include" # /I$(ENETROOT)\include"
CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(INC) # /I$(ENETROOT)\include"
ASFLAGS=/nologo /coff /c
EXESUFFIX=.exe
!ifdef DEBUG
......@@ -80,14 +77,16 @@ ENGINEOBJS= \
$(OBJ)\scriptfile.$o \
$(OBJ)\winlayer.$o \
$(OBJ)\polymer.$o \
$(OBJ)\nedmalloc.$o
$(OBJ)\nedmalloc.$o \
$(OBJ)\mutex.$o \
$(OBJ)\rawinput.$o
EDITOROBJS=$(OBJ)\build.$o \
$(OBJ)\startwin.editor.$o \
$(OBJ)\config.$o
RENDERTYPE=WIN
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib dxguid.lib wsock32.lib comctl32.lib
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib wsock32.lib comctl32.lib dxguid.lib
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /D "_CRT_SECURE_NO_DEPRECATE" /W2
# RULES
......@@ -127,23 +126,23 @@ $(OBJ)\$(EDITORLIB): $(EDITOROBJS)
# the tools
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $@.manifest -outputresource:$@
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $@.manifest -outputresource:$@
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $@.manifest -outputresource:$@
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $@.manifest -outputresource:$@
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib\x86" /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS)
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $@.manifest -outputresource:$@
# DEPENDENCIES
......
......@@ -38,7 +38,7 @@ extern void (*baselayer_onvideomodechange)(int32_t);
#ifdef USE_OPENGL
extern int32_t osdcmd_glinfo(const osdfuncparm_t *parm);
struct glinfo {
struct glinfo_t {
const char *vendor;
const char *renderer;
const char *version;
......@@ -66,7 +66,7 @@ struct glinfo {
char dumped;
};
extern struct glinfo glinfo;
extern struct glinfo_t glinfo;
extern void setvsync(int32_t sync);
#endif
......@@ -113,7 +113,8 @@ const char *getjoyname(int32_t what, int32_t num); // what: 0=axis, 1=button, 2=
char *strtolower(char *str, int32_t len);
char bgetchar(void);
int32_t bkbhit(void);
#define bkbhit() (keyasciififoplc != keyasciififoend)
void bflushchars(void);
int32_t initmouse(void);
......
......@@ -158,8 +158,7 @@ typedef struct
typedef struct {
uint32_t mdanimtims;
int16_t mdanimcur;
int16_t angoff;
int16_t pitch, roll;
int16_t angoff, pitch, roll;
int32_t xoff, yoff, zoff;
uint8_t flags;
uint8_t xpanning, ypanning;
......
......@@ -4,6 +4,7 @@
#define __cache1d_h__
#include "compat.h"
#include "mutex.h"
#ifdef __cplusplus
extern "C" {
......@@ -19,6 +20,7 @@ void allocache(intptr_t *newhandle, int32_t newbytes, char *newlockptr);
void suckcache(intptr_t *suckptr);
void agecache(void);
mutex_t cachemutex;
extern int32_t pathsearchmode; // 0 = gamefs mode (default), 1 = localfs mode (editor's mode)
int32_t addsearchpath(const char *p);
int32_t findfrompath(const char *fn, char **where);
......
#ifndef __dxdidf_h__
#define __dxdidf_h__
// Keyboard
static DIOBJECTDATAFORMAT c_dfDIKeyboard_odf[] = {
{ &GUID_Key, 0, 0x8000000C, 0x00000000 },
{ &GUID_Key, 1, 0x8000010C, 0x00000000 },
{ &GUID_Key, 2, 0x8000020C, 0x00000000 },
{ &GUID_Key, 3, 0x8000030C, 0x00000000 },
{ &GUID_Key, 4, 0x8000040C, 0x00000000 },
{ &GUID_Key, 5, 0x8000050C, 0x00000000 },
{ &GUID_Key, 6, 0x8000060C, 0x00000000 },
{ &GUID_Key, 7, 0x8000070C, 0x00000000 },
{ &GUID_Key, 8, 0x8000080C, 0x00000000 },
{ &GUID_Key, 9, 0x8000090C, 0x00000000 },
{ &GUID_Key, 10, 0x80000A0C, 0x00000000 },
{ &GUID_Key, 11, 0x80000B0C, 0x00000000 },
{ &GUID_Key, 12, 0x80000C0C, 0x00000000 },
{ &GUID_Key, 13, 0x80000D0C, 0x00000000 },
{ &GUID_Key, 14, 0x80000E0C, 0x00000000 },
{ &GUID_Key, 15, 0x80000F0C, 0x00000000 },
{ &GUID_Key, 16, 0x8000100C, 0x00000000 },
{ &GUID_Key, 17, 0x8000110C, 0x00000000 },
{ &GUID_Key, 18, 0x8000120C, 0x00000000 },
{ &GUID_Key, 19, 0x8000130C, 0x00000000 },
{ &GUID_Key, 20, 0x8000140C, 0x00000000 },
{ &GUID_Key, 21, 0x8000150C, 0x00000000 },
{ &GUID_Key, 22, 0x8000160C, 0x00000000 },
{ &GUID_Key, 23, 0x8000170C, 0x00000000 },
{ &GUID_Key, 24, 0x8000180C, 0x00000000 },
{ &GUID_Key, 25, 0x8000190C, 0x00000000 },
{ &GUID_Key, 26, 0x80001A0C, 0x00000000 },
{ &GUID_Key, 27, 0x80001B0C, 0x00000000 },
{ &GUID_Key, 28, 0x80001C0C, 0x00000000 },
{ &GUID_Key, 29, 0x80001D0C, 0x00000000 },
{ &GUID_Key, 30, 0x80001E0C, 0x00000000 },
{ &GUID_Key, 31, 0x80001F0C, 0x00000000 },
{ &GUID_Key, 32, 0x8000200C, 0x00000000 },
{ &GUID_Key, 33, 0x8000210C, 0x00000000 },
{ &GUID_Key, 34, 0x8000220C, 0x00000000 },
{ &GUID_Key, 35, 0x8000230C, 0x00000000 },
{ &GUID_Key, 36, 0x8000240C, 0x00000000 },
{ &GUID_Key, 37, 0x8000250C, 0x00000000 },
{ &GUID_Key, 38, 0x8000260C, 0x00000000 },
{ &GUID_Key, 39, 0x8000270C, 0x00000000 },
{ &GUID_Key, 40, 0x8000280C, 0x00000000 },
{ &GUID_Key, 41, 0x8000290C, 0x00000000 },
{ &GUID_Key, 42, 0x80002A0C, 0x00000000 },
{ &GUID_Key, 43, 0x80002B0C, 0x00000000 },
{ &GUID_Key, 44, 0x80002C0C, 0x00000000 },
{ &GUID_Key, 45, 0x80002D0C, 0x00000000 },
{ &GUID_Key, 46, 0x80002E0C, 0x00000000 },
{ &GUID_Key, 47, 0x80002F0C, 0x00000000 },
{ &GUID_Key, 48, 0x8000300C, 0x00000000 },
{ &GUID_Key, 49, 0x8000310C, 0x00000000 },
{ &GUID_Key, 50, 0x8000320C, 0x00000000 },
{ &GUID_Key, 51, 0x8000330C, 0x00000000 },
{ &GUID_Key, 52, 0x8000340C, 0x00000000 },
{ &GUID_Key, 53, 0x8000350C, 0x00000000 },
{ &GUID_Key, 54, 0x8000360C, 0x00000000 },
{ &GUID_Key, 55, 0x8000370C, 0x00000000 },
{ &GUID_Key, 56, 0x8000380C, 0x00000000 },
{ &GUID_Key, 57, 0x8000390C, 0x00000000 },
{ &GUID_Key, 58, 0x80003A0C, 0x00000000 },
{ &GUID_Key, 59, 0x80003B0C, 0x00000000 },
{ &GUID_Key, 60, 0x80003C0C, 0x00000000 },
{ &GUID_Key, 61, 0x80003D0C, 0x00000000 },
{ &GUID_Key, 62, 0x80003E0C, 0x00000000 },
{ &GUID_Key, 63, 0x80003F0C, 0x00000000 },
{ &GUID_Key, 64, 0x8000400C, 0x00000000 },
{ &GUID_Key, 65, 0x8000410C, 0x00000000 },
{ &GUID_Key, 66, 0x8000420C, 0x00000000 },
{ &GUID_Key, 67, 0x8000430C, 0x00000000 },
{ &GUID_Key, 68, 0x8000440C, 0x00000000 },
{ &GUID_Key, 69, 0x8000450C, 0x00000000 },
{ &GUID_Key, 70, 0x8000460C, 0x00000000 },
{ &GUID_Key, 71, 0x8000470C, 0x00000000 },
{ &GUID_Key, 72, 0x8000480C, 0x00000000 },
{ &GUID_Key, 73, 0x8000490C, 0x00000000 },
{ &GUID_Key, 74, 0x80004A0C, 0x00000000 },
{ &GUID_Key, 75, 0x80004B0C, 0x00000000 },
{ &GUID_Key, 76, 0x80004C0C, 0x00000000 },
{ &GUID_Key, 77, 0x80004D0C, 0x00000000 },
{ &GUID_Key, 78, 0x80004E0C, 0x00000000 },
{ &GUID_Key, 79, 0x80004F0C, 0x00000000 },
{ &GUID_Key, 80, 0x8000500C, 0x00000000 },
{ &GUID_Key, 81, 0x8000510C, 0x00000000 },
{ &GUID_Key, 82, 0x8000520C, 0x00000000 },
{ &GUID_Key, 83, 0x8000530C, 0x00000000 },
{ &GUID_Key, 84, 0x8000540C, 0x00000000 },
{ &GUID_Key, 85, 0x8000550C, 0x00000000 },
{ &GUID_Key, 86, 0x8000560C, 0x00000000 },
{ &GUID_Key, 87, 0x8000570C, 0x00000000 },
{ &GUID_Key, 88, 0x8000580C, 0x00000000 },
{ &GUID_Key, 89, 0x8000590C, 0x00000000 },
{ &GUID_Key, 90, 0x80005A0C, 0x00000000 },
{ &GUID_Key, 91, 0x80005B0C, 0x00000000 },
{ &GUID_Key, 92, 0x80005C0C, 0x00000000 },
{ &GUID_Key, 93, 0x80005D0C, 0x00000000 },
{ &GUID_Key, 94, 0x80005E0C, 0x00000000 },
{ &GUID_Key, 95, 0x80005F0C, 0x00000000 },
{ &GUID_Key, 96, 0x8000600C, 0x00000000 },
{ &GUID_Key, 97, 0x8000610C, 0x00000000 },
{ &GUID_Key, 98, 0x8000620C, 0x00000000 },
{ &GUID_Key, 99, 0x8000630C, 0x00000000 },
{ &GUID_Key, 100, 0x8000640C, 0x00000000 },
{ &GUID_Key, 101, 0x8000650C, 0x00000000 },
{ &GUID_Key, 102, 0x8000660C, 0x00000000 },
{ &GUID_Key, 103, 0x8000670C, 0x00000000 },
{ &GUID_Key, 104, 0x8000680C, 0x00000000 },
{ &GUID_Key, 105, 0x8000690C, 0x00000000 },
{ &GUID_Key, 106, 0x80006A0C, 0x00000000 },
{ &GUID_Key, 107, 0x80006B0C, 0x00000000 },
{ &GUID_Key, 108, 0x80006C0C, 0x00000000 },
{ &GUID_Key, 109, 0x80006D0C, 0x00000000 },
{ &GUID_Key, 110, 0x80006E0C, 0x00000000 },
{ &GUID_Key, 111, 0x80006F0C, 0x00000000 },
{ &GUID_Key, 112, 0x8000700C, 0x00000000 },
{ &GUID_Key, 113, 0x8000710C, 0x00000000 },
{ &GUID_Key, 114, 0x8000720C, 0x00000000 },
{ &GUID_Key, 115, 0x8000730C, 0x00000000 },
{ &GUID_Key, 116, 0x8000740C, 0x00000000 },
{ &GUID_Key, 117, 0x8000750C, 0x00000000 },
{ &GUID_Key, 118, 0x8000760C, 0x00000000 },
{ &GUID_Key, 119, 0x8000770C, 0x00000000 },
{ &GUID_Key, 120, 0x8000780C, 0x00000000 },
{ &GUID_Key, 121, 0x8000790C, 0x00000000 },
{ &GUID_Key, 122, 0x80007A0C, 0x00000000 },
{ &GUID_Key, 123, 0x80007B0C, 0x00000000 },
{ &GUID_Key, 124, 0x80007C0C, 0x00000000 },
{ &GUID_Key, 125, 0x80007D0C, 0x00000000 },
{ &GUID_Key, 126, 0x80007E0C, 0x00000000 },
{ &GUID_Key, 127, 0x80007F0C, 0x00000000 },
{ &GUID_Key, 128, 0x8000800C, 0x00000000 },
{ &GUID_Key, 129, 0x8000810C, 0x00000000 },
{ &GUID_Key, 130, 0x8000820C, 0x00000000 },
{ &GUID_Key, 131, 0x8000830C, 0x00000000 },
{ &GUID_Key, 132, 0x8000840C, 0x00000000 },
{ &GUID_Key, 133, 0x8000850C, 0x00000000 },
{ &GUID_Key, 134, 0x8000860C, 0x00000000 },
{ &GUID_Key, 135, 0x8000870C, 0x00000000 },
{ &GUID_Key, 136, 0x8000880C, 0x00000000 },
{ &GUID_Key, 137, 0x8000890C, 0x00000000 },
{ &GUID_Key, 138, 0x80008A0C, 0x00000000 },
{ &GUID_Key, 139, 0x80008B0C, 0x00000000 },
{ &GUID_Key, 140, 0x80008C0C, 0x00000000 },
{ &GUID_Key, 141, 0x80008D0C, 0x00000000 },
{ &GUID_Key, 142, 0x80008E0C, 0x00000000 },
{ &GUID_Key, 143, 0x80008F0C, 0x00000000 },
{ &GUID_Key, 144, 0x8000900C, 0x00000000 },
{ &GUID_Key, 145, 0x8000910C, 0x00000000 },
{ &GUID_Key, 146, 0x8000920C, 0x00000000 },
{ &GUID_Key, 147, 0x8000930C, 0x00000000 },
{ &GUID_Key, 148, 0x8000940C, 0x00000000 },
{ &GUID_Key, 149, 0x8000950C, 0x00000000 },
{ &GUID_Key, 150, 0x8000960C, 0x00000000 },
{ &GUID_Key, 151, 0x8000970C, 0x00000000 },
{ &GUID_Key, 152, 0x8000980C, 0x00000000 },
{ &GUID_Key, 153, 0x8000990C, 0x00000000 },
{ &GUID_Key, 154, 0x80009A0C, 0x00000000 },
{ &GUID_Key, 155, 0x80009B0C, 0x00000000 },
{ &GUID_Key, 156, 0x80009C0C, 0x00000000 },
{ &GUID_Key, 157, 0x80009D0C, 0x00000000 },
{ &GUID_Key, 158, 0x80009E0C, 0x00000000 },
{ &GUID_Key, 159, 0x80009F0C, 0x00000000 },
{ &GUID_Key, 160, 0x8000A00C, 0x00000000 },
{ &GUID_Key, 161, 0x8000A10C, 0x00000000 },
{ &GUID_Key, 162, 0x8000A20C, 0x00000000 },
{ &GUID_Key, 163, 0x8000A30C, 0x00000000 },
{ &GUID_Key, 164, 0x8000A40C, 0x00000000 },
{ &GUID_Key, 165, 0x8000A50C, 0x00000000 },
{ &GUID_Key, 166, 0x8000A60C, 0x00000000 },
{ &GUID_Key, 167, 0x8000A70C, 0x00000000 },
{ &GUID_Key, 168, 0x8000A80C, 0x00000000 },
{ &GUID_Key, 169, 0x8000A90C, 0x00000000 },
{ &GUID_Key, 170, 0x8000AA0C, 0x00000000 },
{ &GUID_Key, 171, 0x8000AB0C, 0x00000000 },
{ &GUID_Key, 172, 0x8000AC0C, 0x00000000 },
{ &GUID_Key, 173, 0x8000AD0C, 0x00000000 },
{ &GUID_Key, 174, 0x8000AE0C, 0x00000000 },
{ &GUID_Key, 175, 0x8000AF0C, 0x00000000 },
{ &GUID_Key, 176, 0x8000B00C, 0x00000000 },
{ &GUID_Key, 177, 0x8000B10C, 0x00000000 },
{ &GUID_Key, 178, 0x8000B20C, 0x00000000 },
{ &GUID_Key, 179, 0x8000B30C, 0x00000000 },
{ &GUID_Key, 180, 0x8000B40C, 0x00000000 },
{ &GUID_Key, 181, 0x8000B50C, 0x00000000 },
{ &GUID_Key, 182, 0x8000B60C, 0x00000000 },
{ &GUID_Key, 183, 0x8000B70C, 0x00000000 },
{ &GUID_Key, 184, 0x8000B80C, 0x00000000 },
{ &GUID_Key, 185, 0x8000B90C, 0x00000000 },
{ &GUID_Key, 186, 0x8000BA0C, 0x00000000 },
{ &GUID_Key, 187, 0x8000BB0C, 0x00000000 },
{ &GUID_Key, 188, 0x8000BC0C, 0x00000000 },
{ &GUID_Key, 189, 0x8000BD0C, 0x00000000 },
{ &GUID_Key, 190, 0x8000BE0C, 0x00000000 },
{ &GUID_Key, 191, 0x8000BF0C, 0x00000000 },
{ &GUID_Key, 192, 0x8000C00C, 0x00000000 },
{ &GUID_Key, 193, 0x8000C10C, 0x00000000 },
{ &GUID_Key, 194, 0x8000C20C, 0x00000000 },
{ &GUID_Key, 195, 0x8000C30C, 0x00000000 },
{ &GUID_Key, 196, 0x8000C40C, 0x00000000 },
{ &GUID_Key, 197, 0x8000C50C, 0x00000000 },
{ &GUID_Key, 198, 0x8000C60C, 0x00000000 },
{ &GUID_Key, 199, 0x8000C70C, 0x00000000 },
{ &GUID_Key, 200, 0x8000C80C, 0x00000000 },
{ &GUID_Key, 201, 0x8000C90C, 0x00000000 },
{ &GUID_Key, 202, 0x8000CA0C, 0x00000000 },
{ &GUID_Key, 203, 0x8000CB0C, 0x00000000 },
{ &GUID_Key, 204, 0x8000CC0C, 0x00000000 },
{ &GUID_Key, 205, 0x8000CD0C, 0x00000000 },
{ &GUID_Key, 206, 0x8000CE0C, 0x00000000 },
{ &GUID_Key, 207, 0x8000CF0C, 0x00000000 },
{ &GUID_Key, 208, 0x8000D00C, 0x00000000 },
{ &GUID_Key, 209, 0x8000D10C, 0x00000000 },
{ &GUID_Key, 210, 0x8000D20C, 0x00000000 },
{ &GUID_Key, 211, 0x8000D30C, 0x00000000 },
{ &GUID_Key, 212, 0x8000D40C, 0x00000000 },
{ &GUID_Key, 213, 0x8000D50C, 0x00000000 },
{ &GUID_Key, 214, 0x8000D60C, 0x00000000 },
{ &GUID_Key, 215, 0x8000D70C, 0x00000000 },
{ &GUID_Key, 216, 0x8000D80C, 0x00000000 },
{ &GUID_Key, 217, 0x8000D90C, 0x00000000 },
{ &GUID_Key, 218, 0x8000DA0C, 0x00000000 },
{ &GUID_Key, 219, 0x8000DB0C, 0x00000000 },
{ &GUID_Key, 220, 0x8000DC0C, 0x00000000 },
{ &GUID_Key, 221, 0x8000DD0C, 0x00000000 },
{ &GUID_Key, 222, 0x8000DE0C, 0x00000000 },
{ &GUID_Key, 223, 0x8000DF0C, 0x00000000 },
{ &GUID_Key, 224, 0x8000E00C, 0x00000000 },
{ &GUID_Key, 225, 0x8000E10C, 0x00000000 },
{ &GUID_Key, 226, 0x8000E20C, 0x00000000 },
{ &GUID_Key, 227, 0x8000E30C, 0x00000000 },
{ &GUID_Key, 228, 0x8000E40C, 0x00000000 },
{ &GUID_Key, 229, 0x8000E50C, 0x00000000 },
{ &GUID_Key, 230, 0x8000E60C, 0x00000000 },
{ &GUID_Key, 231, 0x8000E70C, 0x00000000 },
{ &GUID_Key, 232, 0x8000E80C, 0x00000000 },
{ &GUID_Key, 233, 0x8000E90C, 0x00000000 },
{ &GUID_Key, 234, 0x8000EA0C, 0x00000000 },
{ &GUID_Key, 235, 0x8000EB0C, 0x00000000 },
{ &GUID_Key, 236, 0x8000EC0C, 0x00000000 },
{ &GUID_Key, 237, 0x8000ED0C, 0x00000000 },
{ &GUID_Key, 238, 0x8000EE0C, 0x00000000 },
{ &GUID_Key, 239, 0x8000EF0C, 0x00000000 },
{ &GUID_Key, 240, 0x8000F00C, 0x00000000 },
{ &GUID_Key, 241, 0x8000F10C, 0x00000000 },
{ &GUID_Key, 242, 0x8000F20C, 0x00000000 },
{ &GUID_Key, 243, 0x8000F30C, 0x00000000 },
{ &GUID_Key, 244, 0x8000F40C, 0x00000000 },
{ &GUID_Key, 245, 0x8000F50C, 0x00000000 },
{ &GUID_Key, 246, 0x8000F60C, 0x00000000 },
{ &GUID_Key, 247, 0x8000F70C, 0x00000000 },
{ &GUID_Key, 248, 0x8000F80C, 0x00000000 },
{ &GUID_Key, 249, 0x8000F90C, 0x00000000 },
{ &GUID_Key, 250, 0x8000FA0C, 0x00000000 },
{ &GUID_Key, 251, 0x8000FB0C, 0x00000000 },
{ &GUID_Key, 252, 0x8000FC0C, 0x00000000 },
{ &GUID_Key, 253, 0x8000FD0C, 0x00000000 },
{ &GUID_Key, 254, 0x8000FE0C, 0x00000000 },
{ &GUID_Key, 255, 0x8000FF0C, 0x00000000 }
};
const DIDATAFORMAT c_dfDIKeyboard = { 24, 16, 0x00000002, 256, 256, c_dfDIKeyboard_odf };
// Mouse
/*
static DIOBJECTDATAFORMAT c_dfDIMouse_odf[] = {
{ &GUID_XAxis, 0, 0x00FFFF03, 0x00000000 },
{ &GUID_YAxis, 4, 0x00FFFF03, 0x00000000 },
{ &GUID_ZAxis, 8, 0x80FFFF03, 0x00000000 },
{ NULL, 12, 0x00FFFF0C, 0x00000000 },
{ NULL, 13, 0x00FFFF0C, 0x00000000 },
{ NULL, 14, 0x80FFFF0C, 0x00000000 },
{ NULL, 15, 0x80FFFF0C, 0x00000000 }
};
const DIDATAFORMAT c_dfDIMouse = { 24, 16, 0x00000002, 16, 7, c_dfDIMouse_odf };
*/
static DIOBJECTDATAFORMAT c_dfDIMouse2_odf[] = {
{&GUID_XAxis, 0, 16776963, 0},
{&GUID_YAxis, 4, 16776963, 0},
{&GUID_ZAxis, 8, -2130706685, 0},
{0, 12, 16776972, 0},
{0, 13, 16776972, 0},
{0, 14, -2130706676, 0},
{0, 15, -2130706676, 0},
{0, 16, -2130706676, 0},
{0, 17, -2130706676, 0},
{0, 18, -2130706676,0},
{0, 19, -2130706676, 0}
};
const DIDATAFORMAT c_dfDIMouse2 = {24, 16, 2, 20, 11, c_dfDIMouse2_odf};
// Joystick
static DIOBJECTDATAFORMAT c_dfDIJoystick_odf[] = {
{ &GUID_XAxis, 0, 0x80FFFF03, 0x00000100 },
{ &GUID_YAxis, 4, 0x80FFFF03, 0x00000100 },
{ &GUID_ZAxis, 8, 0x80FFFF03, 0x00000100 },
{ &GUID_RxAxis, 12, 0x80FFFF03, 0x00000100 },
{ &GUID_RyAxis, 16, 0x80FFFF03, 0x00000100 },
{ &GUID_RzAxis, 20, 0x80FFFF03, 0x00000100 },
{ &GUID_Slider, 24, 0x80FFFF03, 0x00000100 },
{ &GUID_Slider, 28, 0x80FFFF03, 0x00000100 },
{ &GUID_POV, 32, 0x80FFFF10, 0x00000000 },
{ &GUID_POV, 36, 0x80FFFF10, 0x00000000 },