Merge branch 'master' into whaven

# Conflicts:
#	source/core/screenjob.cpp
#	source/core/searchpaths.cpp
This commit is contained in:
Christoph Oelckers 2021-06-03 08:48:13 +02:00
commit 198fbf9297
2331 changed files with 8923 additions and 6251 deletions

View file

@ -71,23 +71,25 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
if [[ ! -z "${{ matrix.config.deps_cmdline }}" ]]; then
if [[ "${{ matrix.config.deps_cmdline }}" ]]; then
eval ${{ matrix.config.deps_cmdline }}
fi
# Build and install ZMusic
mkdir build
cd build
git clone https://github.com/coelckers/ZMusic.git
cd ZMusic
git checkout 1.1.6
cd ..
cmake -B zmusic_build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX=`pwd`/zmusic_install ${{ matrix.config.extra_options }} ZMusic
cmake --build zmusic_build --target install --parallel 3
if [[ "${{ runner.os }}" == 'macOS' ]]; then
export ZMUSIC_PACKAGE=zmusic-1.1.7-macos.tar.bz2
elif [[ "${{ runner.os }}" == 'Linux' ]]; then
export ZMUSIC_PACKAGE=zmusic-1.1.7-linux.tar.bz2
fi
if [[ "${ZMUSIC_PACKAGE}" ]]; then
cd build
wget -q "https://github.com/coelckers/gzdoom/releases/download/ci_deps/${ZMUSIC_PACKAGE}"
tar -xf "${ZMUSIC_PACKAGE}"
fi
- name: Configure
shell: bash
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_PREFIX_PATH=`pwd`/build/zmusic_install ${{ matrix.config.extra_options }} .
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_PREFIX_PATH=`pwd`/build/zmusic -DPK3_QUIET_ZIPDIR=ON ${{ matrix.config.extra_options }} .
- name: Build
shell: bash

View file

@ -151,7 +151,7 @@ endif()
# Fast math flags, required by some subprojects
set( ZD_FASTMATH_FLAG "" )
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set( ZD_FASTMATH_FLAG "-ffast-math -ffp-contract=fast" )
elseif( MSVC )
set( ZD_FASTMATH_FLAG "/fp:fast" )
@ -340,6 +340,7 @@ if( HAVE_VM_JIT AND UNIX )
else( HAVE_LIBEXECINFO )
set( HAVE_VM_JIT NO )
endif( HAVE_LIBEXECINFO )
set( CMAKE_REQUIRED_FLAGS )
endif( NOT HAVE_BACKTRACE )
endif( HAVE_VM_JIT AND UNIX )

View file

@ -1,44 +1,44 @@
Instructions for Building EDuke32's Library Dependencies Targeting Win32 and Win64
==================================================================================
First, follow these instructions: http://wiki.eduke32.com/wiki/Building_EDuke32_on_Windows
Download the latest sources from the link provided.
The build output listed as "Desired Results" is what EDuke32 needs to function.
The desired results for each library in some cases may need to be installed to the compiler. "x depends on the results of y to compile" means that the build output of x must be added to the compiler in this way. Copy files listed in each category to the appropriate destinations. Unless otherwise noted, do NOT copy the ".dll.a" file or else the final product may depend on external DLLs (which you may actually want).
For MinGW (MinGW32):
from the compiler root (ex. C:/MinGW/)
* headers: include/
* libraries: lib/
For MinGW-w64:
from the compiler root (ex. C:/MinGW-w64/mingw32-dw2/)
* headers: <target>-w64-mingw32/include/
* libraries: <target>-w64-mingw32/lib/
Binaries (if mentioned) need to be present with the finished EDuke32 executables. They are not needed during compilation.
NB: Text formatted as code blocks are commands to be pasted into the Windows command prompt.
http://wiki.eduke32.com/wiki/Working_with_the_Windows_Command_Prompt
[//]: # (Plain text readers: This refers to lines beginning with exactly four spaces.)
libvpx
------
### Prerequisites ###
Download the binary of yasm (http://yasm.tortall.net/) for your host system architecture. Both builds target both architectures.
The build environment needs pr.exe (https://mingw-lib.googlecode.com/files/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2).
### Download ###
* Instructions: http://www.webmproject.org/code/
* Stable: http://downloads.webmproject.org/releases/webm/
* Git: https://chromium.googlesource.com/webm/libvpx
### Build ###
sh ./configure --disable-vp8-encoder --disable-vp9-encoder --disable-multithread --disable-spatial-resampling --as=yasm && make libvpx.a
### Desired Results ###
* headers: vpx/vp8.h vpx/vp8dx.h vpx/vpx_codec.h vpx/vpx_decoder.h vpx/vpx_frame_buffer.h vpx/vpx_image.h vpx/vpx_integer.h
* libraries: libvpx.a
Instructions for Building EDuke32's Library Dependencies Targeting Win32 and Win64
==================================================================================
First, follow these instructions: http://wiki.eduke32.com/wiki/Building_EDuke32_on_Windows
Download the latest sources from the link provided.
The build output listed as "Desired Results" is what EDuke32 needs to function.
The desired results for each library in some cases may need to be installed to the compiler. "x depends on the results of y to compile" means that the build output of x must be added to the compiler in this way. Copy files listed in each category to the appropriate destinations. Unless otherwise noted, do NOT copy the ".dll.a" file or else the final product may depend on external DLLs (which you may actually want).
For MinGW (MinGW32):
from the compiler root (ex. C:/MinGW/)
* headers: include/
* libraries: lib/
For MinGW-w64:
from the compiler root (ex. C:/MinGW-w64/mingw32-dw2/)
* headers: <target>-w64-mingw32/include/
* libraries: <target>-w64-mingw32/lib/
Binaries (if mentioned) need to be present with the finished EDuke32 executables. They are not needed during compilation.
NB: Text formatted as code blocks are commands to be pasted into the Windows command prompt.
http://wiki.eduke32.com/wiki/Working_with_the_Windows_Command_Prompt
[//]: # (Plain text readers: This refers to lines beginning with exactly four spaces.)
libvpx
------
### Prerequisites ###
Download the binary of yasm (http://yasm.tortall.net/) for your host system architecture. Both builds target both architectures.
The build environment needs pr.exe (https://mingw-lib.googlecode.com/files/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2).
### Download ###
* Instructions: http://www.webmproject.org/code/
* Stable: http://downloads.webmproject.org/releases/webm/
* Git: https://chromium.googlesource.com/webm/libvpx
### Build ###
sh ./configure --disable-vp8-encoder --disable-vp9-encoder --disable-multithread --disable-spatial-resampling --as=yasm && make libvpx.a
### Desired Results ###
* headers: vpx/vp8.h vpx/vp8dx.h vpx/vpx_codec.h vpx/vpx_decoder.h vpx/vpx_frame_buffer.h vpx/vpx_image.h vpx/vpx_integer.h
* libraries: libvpx.a

View file

@ -1,22 +1,22 @@
o=o
NAME:=libcompat-to-msvc
%.$o: %.c
gcc -Wall -Wextra -O3 -c $< -o $@
%.$o: %.S
gcc -c $< -o $@
OBJS=dll_math.$o io_math.$o dll_dependency.$o vsnprintf.$o
.INTERMEDIATE: $(OBJS)
$(NAME).a: $(OBJS)
ar rc $@ $^
ranlib $@
clean:
-rm -f *.a *.o
o=o
NAME:=libcompat-to-msvc
%.$o: %.c
gcc -Wall -Wextra -O3 -c $< -o $@
%.$o: %.S
gcc -c $< -o $@
OBJS=dll_math.$o io_math.$o dll_dependency.$o vsnprintf.$o
.INTERMEDIATE: $(OBJS)
$(NAME).a: $(OBJS)
ar rc $@ $^
ranlib $@
clean:
-rm -f *.a *.o

View file

@ -1,88 +1,88 @@
/* Implementation for gcc's internal stack-allocation routines. */
.global ___chkstk
.global __alloca
.global ___chkstk_ms
___chkstk_ms:
#ifdef _WIN64
pushq %rax
pushq %rcx
cmpq $0x1000, %rax
leaq 24(%rsp), %rcx
jb .Lchkstk_ms_end
.Lchkstk_ms_loop:
subq $0x1000, %rcx
subq $0x1000, %rax
orq $0x0, (%rcx)
cmpq $0x1000, %rax
ja .Lchkstk_ms_loop
.Lchkstk_ms_end:
subq %rax, %rcx
orq $0x0, (%rcx)
popq %rcx
popq %rax
ret
#else
pushl %eax
pushl %ecx
cmpl $0x1000, %eax
leal 12(%esp), %ecx
jb chkstk_ms_end
chkstk_ms_loop:
subl $0x1000, %ecx
subl $0x1000, %eax
orl $0x0, (%ecx)
cmpl $0x1000, %eax
ja chkstk_ms_loop
chkstk_ms_end:
subl %eax, %ecx
orl $0x0, (%ecx)
popl %ecx
popl %eax
ret
#endif
#ifdef _WIN64
__alloca:
movq %rcx, %rax
.align 4
___chkstk:
popq %r11
movq %rsp, %r10
cmpq $0x1000, %rax
jb .Lchkstk_end
.Lchkstk_loop:
subq $0x1000, %r10
subq $0x1000, %rax
orl $0x0, (%r10)
cmpq $0x1000, %rax
ja .Lchkstk_loop
.Lchkstk_end:
subq %rax, %r10
movq %rsp, %rax
orl $0x0, (%r10)
movq %r10, %rsp
pushq %r11
ret
#else
___chkstk:
__alloca:
pushl %ecx
leal 8(%esp), %ecx
cmpl $0x1000, %eax /* > 4k ?*/
jb chkstk_end
chkstk_loop:
subl $0x1000, %ecx
subl $0x1000, %eax
orl $0x0, (%ecx)
cmpl $0x1000, %eax
ja chkstk_loop
chkstk_end:
subl %eax, %ecx
orl $0x0, (%ecx)
movl %esp, %eax
movl %ecx, %esp
movl (%eax), %ecx
pushl 4(%eax)
ret
#endif
/* Implementation for gcc's internal stack-allocation routines. */
.global ___chkstk
.global __alloca
.global ___chkstk_ms
___chkstk_ms:
#ifdef _WIN64
pushq %rax
pushq %rcx
cmpq $0x1000, %rax
leaq 24(%rsp), %rcx
jb .Lchkstk_ms_end
.Lchkstk_ms_loop:
subq $0x1000, %rcx
subq $0x1000, %rax
orq $0x0, (%rcx)
cmpq $0x1000, %rax
ja .Lchkstk_ms_loop
.Lchkstk_ms_end:
subq %rax, %rcx
orq $0x0, (%rcx)
popq %rcx
popq %rax
ret
#else
pushl %eax
pushl %ecx
cmpl $0x1000, %eax
leal 12(%esp), %ecx
jb chkstk_ms_end
chkstk_ms_loop:
subl $0x1000, %ecx
subl $0x1000, %eax
orl $0x0, (%ecx)
cmpl $0x1000, %eax
ja chkstk_ms_loop
chkstk_ms_end:
subl %eax, %ecx
orl $0x0, (%ecx)
popl %ecx
popl %eax
ret
#endif
#ifdef _WIN64
__alloca:
movq %rcx, %rax
.align 4
___chkstk:
popq %r11
movq %rsp, %r10
cmpq $0x1000, %rax
jb .Lchkstk_end
.Lchkstk_loop:
subq $0x1000, %r10
subq $0x1000, %rax
orl $0x0, (%r10)
cmpq $0x1000, %rax
ja .Lchkstk_loop
.Lchkstk_end:
subq %rax, %r10
movq %rsp, %rax
orl $0x0, (%r10)
movq %r10, %rsp
pushq %r11
ret
#else
___chkstk:
__alloca:
pushl %ecx
leal 8(%esp), %ecx
cmpl $0x1000, %eax /* > 4k ?*/
jb chkstk_end
chkstk_loop:
subl $0x1000, %ecx
subl $0x1000, %eax
orl $0x0, (%ecx)
cmpl $0x1000, %eax
ja chkstk_loop
chkstk_end:
subl %eax, %ecx
orl $0x0, (%ecx)
movl %esp, %eax
movl %ecx, %esp
movl (%eax), %ecx
pushl 4(%eax)
ret
#endif

View file

@ -1,39 +1,39 @@
// Some libraries expect these functions, for which Visual Studio (pre-2013) falls down on the job.
#include <stdio.h>
#include <math.h>
#ifndef _MSC_VER
# include <stdint.h>
int64_t _ftelli64(
FILE *stream
);
int _fseeki64(
FILE *stream,
int64_t offset,
int origin
);
#endif
int fseeko(FILE *fp, off_t offset, int whence)
{
return _fseeki64(fp, (int64_t)offset, whence);
}
int fseeko64(FILE *fp, off64_t offset, int whence)
{
return _fseeki64(fp, (int64_t)offset, whence);
}
off_t ftello(FILE *stream)
{
return (off_t)_ftelli64(stream);
}
off64_t ftello64(FILE *stream)
{
return (off64_t)_ftelli64(stream);
}
long lround(double d)
{
return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
}
// Some libraries expect these functions, for which Visual Studio (pre-2013) falls down on the job.
#include <stdio.h>
#include <math.h>
#ifndef _MSC_VER
# include <stdint.h>
int64_t _ftelli64(
FILE *stream
);
int _fseeki64(
FILE *stream,
int64_t offset,
int origin
);
#endif
int fseeko(FILE *fp, off_t offset, int whence)
{
return _fseeki64(fp, (int64_t)offset, whence);
}
int fseeko64(FILE *fp, off64_t offset, int whence)
{
return _fseeki64(fp, (int64_t)offset, whence);
}
off_t ftello(FILE *stream)
{
return (off_t)_ftelli64(stream);
}
off64_t ftello64(FILE *stream)
{
return (off64_t)_ftelli64(stream);
}
long lround(double d)
{
return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
}

View file

@ -1,19 +1,19 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#define __CRT__NO_INLINE
#include <stdarg.h>
#include <stdlib.h>
extern int __cdecl _vsnprintf(char * __restrict__, size_t, const char * __restrict__, va_list);
int __cdecl __ms_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg)
{
return _vsnprintf(s, n, format, arg);
}
int __cdecl __mingw_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg)
{
return _vsnprintf(s, n, format, arg);
}
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#define __CRT__NO_INLINE
#include <stdarg.h>
#include <stdlib.h>
extern int __cdecl _vsnprintf(char * __restrict__, size_t, const char * __restrict__, va_list);
int __cdecl __ms_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg)
{
return _vsnprintf(s, n, format, arg);
}
int __cdecl __mingw_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg)
{
return _vsnprintf(s, n, format, arg);
}

View file

@ -1,48 +0,0 @@
# ensure dinput.h can be found before running
%.o: %.c
gcc -I../../include -Wall -Wextra -c $< -o $@
lib%.a: %.def %.o
dlltool -k --output-lib $@ --def $*.def
ar r $@ $*.o
ranlib $@
lib%.a: %.def
dlltool -k --output-lib $@ --def $<
all : libdsound.a libdxguid.a libdxguid_sdl.a
@ls -l $^
full : libd3d8.a libd3dx8d.a libd3dxof.a libddraw.a libdinput.a libdinput8.a libdplayx.a \
libdpnaddr.a libdpnet.a libdpnlobby.a libdpvoice.a libdsetup.a \
libdsound.a libdxguid.a libdxguid_sdl.a
@ls -l $^
@echo move the created libraries to the lib dir.
@echo happy coding !!
libdxguid_sdl.a : dxguid_sdl.o
ar -r libdxguid_sdl.a dxguid_sdl.o
ranlib libdxguid_sdl.a
libdxguid.a : dxguid.o
ar -r libdxguid.a dxguid.o
ranlib libdxguid.a
libdinput_custom.a : dinput.o
ar r libdinput_custom.a dinput.o
ranlib libdinput_custom.a
libdinput8.a : dinput8.def dinput.o
dlltool -k --output-lib libdinput8.a --def dinput8.def
ar r libdinput8.a dinput.o
ranlib libdinput8.a
clean:
-rm -f *.a *.o

View file

@ -1,5 +0,0 @@
LIBRARY "d3d8.dll"
EXPORTS
ValidatePixelShader
ValidateVertexShader
Direct3DCreate8@4

View file

@ -1,155 +0,0 @@
LIBRARY "d3dx8d.dll"
EXPORTS
D3DXAssembleShader@24
D3DXAssembleShaderFromFileA@20
D3DXAssembleShaderFromFileW@20
D3DXBoxBoundProbe@16
D3DXCheckCubeTextureRequirements@24
D3DXCheckTextureRequirements@28
D3DXCheckVolumeTextureRequirements@32
D3DXCleanMesh@12
D3DXColorAdjustContrast@12
D3DXColorAdjustSaturation@12
D3DXCompileEffect@16
D3DXCompileEffectFromFileA@12
D3DXCompileEffectFromFileW@12
D3DXComputeBoundingBox@20
D3DXComputeBoundingSphere@20
D3DXComputeNormals@4
D3DXCreateBox@24
D3DXCreateBuffer@8
D3DXCreateCubeTexture@28
D3DXCreateCubeTextureFromFileA@12
D3DXCreateCubeTextureFromFileExA@52
D3DXCreateCubeTextureFromFileExW@52
D3DXCreateCubeTextureFromFileInMemory@16
D3DXCreateCubeTextureFromFileInMemoryEx@56
D3DXCreateCubeTextureFromFileW@12
D3DXCreateCylinder@32
D3DXCreateEffect@20
D3DXCreateFont@12
D3DXCreateFontIndirect@12
D3DXCreateMatrixStack@8
D3DXCreateMesh@24
D3DXCreateMeshFVF@24
D3DXCreatePMeshFromStream@24
D3DXCreatePolygon@20
D3DXCreateRenderToEnvMap@24
D3DXCreateRenderToSurface@28
D3DXCreateSPMesh@20
D3DXCreateSkinMesh@28
D3DXCreateSkinMeshFVF@28
D3DXCreateSkinMeshFromMesh@12
D3DXCreateSphere@24
D3DXCreateSprite@8
D3DXCreateTeapot@12
D3DXCreateTextA@28
D3DXCreateTextW@28
D3DXCreateTexture@32
D3DXCreateTextureFromFileA@12
D3DXCreateTextureFromFileExA@56
D3DXCreateTextureFromFileExW@56
D3DXCreateTextureFromFileInMemory@16
D3DXCreateTextureFromFileInMemoryEx@60
D3DXCreateTextureFromFileW@12
D3DXCreateTextureFromResourceA@16
D3DXCreateTextureFromResourceExA@60
D3DXCreateTextureFromResourceExW@60
D3DXCreateTextureFromResourceW@16
D3DXCreateTorus@28
D3DXCreateVolumeTexture@36
D3DXDeclaratorFromFVF@8
D3DXFVFFromDeclarator@8
D3DXFilterCubeTexture@16
D3DXFilterTexture@16
D3DXFilterVolumeTexture@16
D3DXGeneratePMesh@28
D3DXGetErrorStringA@12
D3DXGetErrorStringW@12
D3DXGetFVFVertexSize@4
D3DXIntersect@32
D3DXLoadMeshFromX@28
D3DXLoadMeshFromXof@28
D3DXLoadSkinMeshFromXof@36
D3DXLoadSurfaceFromFileA@32
D3DXLoadSurfaceFromFileInMemory@36
D3DXLoadSurfaceFromFileW@32
D3DXLoadSurfaceFromMemory@40
D3DXLoadSurfaceFromResourceA@36
D3DXLoadSurfaceFromResourceW@36
D3DXLoadSurfaceFromSurface@32
D3DXLoadVolumeFromMemory@44
D3DXLoadVolumeFromVolume@32
D3DXMatrixAffineTransformation@20
D3DXMatrixInverse@12
D3DXMatrixLookAtLH@16
D3DXMatrixLookAtRH@16
D3DXMatrixMultiply@12
D3DXMatrixOrthoLH@20
D3DXMatrixOrthoOffCenterLH@28
D3DXMatrixOrthoOffCenterRH@28
D3DXMatrixOrthoRH@20
D3DXMatrixPerspectiveFovLH@20
D3DXMatrixPerspectiveFovRH@20
D3DXMatrixPerspectiveLH@20
D3DXMatrixPerspectiveOffCenterLH@28
D3DXMatrixPerspectiveOffCenterRH@28
D3DXMatrixPerspectiveRH@20
D3DXMatrixReflect@8
D3DXMatrixRotationAxis@12
D3DXMatrixRotationQuaternion@8
D3DXMatrixRotationX@8
D3DXMatrixRotationY@8
D3DXMatrixRotationYawPitchRoll@16
D3DXMatrixRotationZ@8
D3DXMatrixScaling@16
D3DXMatrixShadow@12
D3DXMatrixTransformation@28
D3DXMatrixTranslation@16
D3DXMatrixTranspose@8
D3DXMatrixfDeterminant@4
D3DXPlaneFromPointNormal@12
D3DXPlaneFromPoints@16
D3DXPlaneIntersectLine@16
D3DXPlaneNormalize@8
D3DXPlaneTransform@12
D3DXQuaternionBaryCentric@24
D3DXQuaternionExp@8
D3DXQuaternionInverse@8
D3DXQuaternionLn@8
D3DXQuaternionMultiply@12
D3DXQuaternionNormalize@8
D3DXQuaternionRotationAxis@12
D3DXQuaternionRotationMatrix@8
D3DXQuaternionRotationYawPitchRoll@16
D3DXQuaternionSlerp@16
D3DXQuaternionSquad@24
D3DXQuaternionToAxisAngle@12
D3DXSaveMeshToX@24
D3DXSimplifyMesh@28
D3DXSphereBoundProbe@16
D3DXTesselateMesh@20
D3DXValidMesh@8
D3DXVec2BaryCentric@24
D3DXVec2CatmullRom@24
D3DXVec2Hermite@24
D3DXVec2Normalize@8
D3DXVec2Transform@12
D3DXVec2TransformCoord@12
D3DXVec2TransformNormal@12
D3DXVec3BaryCentric@24
D3DXVec3CatmullRom@24
D3DXVec3Hermite@24
D3DXVec3Normalize@8
D3DXVec3Project@24
D3DXVec3Transform@12
D3DXVec3TransformCoord@12
D3DXVec3TransformNormal@12
D3DXVec3Unproject@24
D3DXVec4BaryCentric@24
D3DXVec4CatmullRom@24
D3DXVec4Cross@16
D3DXVec4Hermite@24
D3DXVec4Normalize@8
D3DXVec4Transform@12
D3DXWeldVertices@24

View file

@ -1,3 +0,0 @@
LIBRARY "d3dxof.dll"
EXPORTS
DirectXFileCreate@4

View file

@ -1,15 +0,0 @@
LIBRARY "DDRAW.dll"
EXPORTS
DDGetAttachedSurfaceLcl@12
DDInternalLock@8
DDInternalUnlock@4
DSoundHelp@12
DirectDrawCreate@12
DirectDrawCreateClipper@12
DirectDrawCreateEx@16
DirectDrawEnumerateA@8
DirectDrawEnumerateExA@12
DirectDrawEnumerateExW@12
DirectDrawEnumerateW@8
GetDDSurfaceLocal@12
GetSurfaceFromDC@12

View file

@ -1,533 +0,0 @@
#define DIRECTINPUT_VERSION 0x0700
#include "dx/dinput.h"
/* This is a replacement for parts of dinput.lib. */
DIOBJECTDATAFORMAT rgodf_c_dfDIKeyboard[] = {
{&GUID_Key, 0, -2147483636, 0},
{&GUID_Key, 1, -2147483380, 0},
{&GUID_Key, 2, -2147483124, 0},
{&GUID_Key, 3, -2147482868, 0},
{&GUID_Key, 4, -2147482612, 0},
{&GUID_Key, 5, -2147482356, 0},
{&GUID_Key, 6, -2147482100, 0},
{&GUID_Key, 7, -2147481844, 0},
{&GUID_Key, 8, -2147481588, 0},
{&GUID_Key, 9, -2147481332, 0},
{&GUID_Key, 10, -2147481076, 0},
{&GUID_Key, 11, -2147480820, 0},
{&GUID_Key, 12, -2147480564, 0},
{&GUID_Key, 13, -2147480308, 0},
{&GUID_Key, 14, -2147480052, 0},
{&GUID_Key, 15, -2147479796, 0},
{&GUID_Key, 16, -2147479540, 0},
{&GUID_Key, 17, -2147479284, 0},
{&GUID_Key, 18, -2147479028, 0},
{&GUID_Key, 19, -2147478772, 0},
{&GUID_Key, 20, -2147478516, 0},
{&GUID_Key, 21, -2147478260, 0},
{&GUID_Key, 22, -2147478004, 0},
{&GUID_Key, 23, -2147477748, 0},
{&GUID_Key, 24, -2147477492, 0},
{&GUID_Key, 25, -2147477236, 0},
{&GUID_Key, 26, -2147476980, 0},
{&GUID_Key, 27, -2147476724, 0},
{&GUID_Key, 28, -2147476468, 0},
{&GUID_Key, 29, -2147476212, 0},
{&GUID_Key, 30, -2147475956, 0},
{&GUID_Key, 31, -2147475700, 0},
{&GUID_Key, 32, -2147475444, 0},
{&GUID_Key, 33, -2147475188, 0},
{&GUID_Key, 34, -2147474932, 0},
{&GUID_Key, 35, -2147474676, 0},
{&GUID_Key, 36, -2147474420, 0},
{&GUID_Key, 37, -2147474164, 0},
{&GUID_Key, 38, -2147473908, 0},
{&GUID_Key, 39, -2147473652, 0},
{&GUID_Key, 40, -2147473396, 0},
{&GUID_Key, 41, -2147473140, 0},
{&GUID_Key, 42, -2147472884, 0},
{&GUID_Key, 43, -2147472628, 0},
{&GUID_Key, 44, -2147472372, 0},
{&GUID_Key, 45, -2147472116, 0},
{&GUID_Key, 46, -2147471860, 0},
{&GUID_Key, 47, -2147471604, 0},
{&GUID_Key, 48, -2147471348, 0},
{&GUID_Key, 49, -2147471092, 0},
{&GUID_Key, 50, -2147470836, 0},
{&GUID_Key, 51, -2147470580, 0},
{&GUID_Key, 52, -2147470324, 0},
{&GUID_Key, 53, -2147470068, 0},
{&GUID_Key, 54, -2147469812, 0},
{&GUID_Key, 55, -2147469556, 0},
{&GUID_Key, 56, -2147469300, 0},
{&GUID_Key, 57, -2147469044, 0},
{&GUID_Key, 58, -2147468788, 0},
{&GUID_Key, 59, -2147468532, 0},
{&GUID_Key, 60, -2147468276, 0},
{&GUID_Key, 61, -2147468020, 0},
{&GUID_Key, 62, -2147467764, 0},
{&GUID_Key, 63, -2147467508, 0},
{&GUID_Key, 64, -2147467252, 0},
{&GUID_Key, 65, -2147466996, 0},
{&GUID_Key, 66, -2147466740, 0},
{&GUID_Key, 67, -2147466484, 0},
{&GUID_Key, 68, -2147466228, 0},
{&GUID_Key, 69, -2147465972, 0},
{&GUID_Key, 70, -2147465716, 0},
{&GUID_Key, 71, -2147465460, 0},
{&GUID_Key, 72, -2147465204, 0},
{&GUID_Key, 73, -2147464948, 0},
{&GUID_Key, 74, -2147464692, 0},
{&GUID_Key, 75, -2147464436, 0},
{&GUID_Key, 76, -2147464180, 0},
{&GUID_Key, 77, -2147463924, 0},
{&GUID_Key, 78, -2147463668, 0},
{&GUID_Key, 79, -2147463412, 0},
{&GUID_Key, 80, -2147463156, 0},
{&GUID_Key, 81, -2147462900, 0},
{&GUID_Key, 82, -2147462644, 0},
{&GUID_Key, 83, -2147462388, 0},
{&GUID_Key, 84, -2147462132, 0},
{&GUID_Key, 85, -2147461876, 0},
{&GUID_Key, 86, -2147461620, 0},
{&GUID_Key, 87, -2147461364, 0},
{&GUID_Key, 88, -2147461108, 0},
{&GUID_Key, 89, -2147460852, 0},
{&GUID_Key, 90, -2147460596, 0},
{&GUID_Key, 91, -2147460340, 0},
{&GUID_Key, 92, -2147460084, 0},
{&GUID_Key, 93, -2147459828, 0},
{&GUID_Key, 94, -2147459572, 0},
{&GUID_Key, 95, -2147459316, 0},
{&GUID_Key, 96, -2147459060, 0},
{&GUID_Key, 97, -2147458804, 0},
{&GUID_Key, 98, -2147458548, 0},
{&GUID_Key, 99, -2147458292, 0},
{&GUID_Key, 100, -2147458036, 0},
{&GUID_Key, 101, -2147457780, 0},
{&GUID_Key, 102, -2147457524, 0},
{&GUID_Key, 103, -2147457268, 0},
{&GUID_Key, 104, -2147457012, 0},
{&GUID_Key, 105, -2147456756, 0},
{&GUID_Key, 106, -2147456500, 0},
{&GUID_Key, 107, -2147456244, 0},
{&GUID_Key, 108, -2147455988, 0},
{&GUID_Key, 109, -2147455732, 0},
{&GUID_Key, 110, -2147455476, 0},
{&GUID_Key, 111, -2147455220, 0},
{&GUID_Key, 112, -2147454964, 0},
{&GUID_Key, 113, -2147454708, 0},
{&GUID_Key, 114, -2147454452, 0},
{&GUID_Key, 115, -2147454196, 0},
{&GUID_Key, 116, -2147453940, 0},
{&GUID_Key, 117, -2147453684, 0},
{&GUID_Key, 118, -2147453428, 0},
{&GUID_Key, 119, -2147453172, 0},
{&GUID_Key, 120, -2147452916, 0},
{&GUID_Key, 121, -2147452660, 0},
{&GUID_Key, 122, -2147452404, 0},
{&GUID_Key, 123, -2147452148, 0},
{&GUID_Key, 124, -2147451892, 0},
{&GUID_Key, 125, -2147451636, 0},
{&GUID_Key, 126, -2147451380, 0},
{&GUID_Key, 127, -2147451124, 0},
{&GUID_Key, 128, -2147450868, 0},
{&GUID_Key, 129, -2147450612, 0},
{&GUID_Key, 130, -2147450356, 0},
{&GUID_Key, 131, -2147450100, 0},
{&GUID_Key, 132, -2147449844, 0},
{&GUID_Key, 133, -2147449588, 0},
{&GUID_Key, 134, -2147449332, 0},
{&GUID_Key, 135, -2147449076, 0},
{&GUID_Key, 136, -2147448820, 0},
{&GUID_Key, 137, -2147448564, 0},
{&GUID_Key, 138, -2147448308, 0},
{&GUID_Key, 139, -2147448052, 0},
{&GUID_Key, 140, -2147447796, 0},
{&GUID_Key, 141, -2147447540, 0},
{&GUID_Key, 142, -2147447284, 0},
{&GUID_Key, 143, -2147447028, 0},
{&GUID_Key, 144, -2147446772, 0},
{&GUID_Key, 145, -2147446516, 0},
{&GUID_Key, 146, -2147446260, 0},
{&GUID_Key, 147, -2147446004, 0},
{&GUID_Key, 148, -2147445748, 0},
{&GUID_Key, 149, -2147445492, 0},
{&GUID_Key, 150, -2147445236, 0},
{&GUID_Key, 151, -2147444980, 0},
{&GUID_Key, 152, -2147444724, 0},
{&GUID_Key, 153, -2147444468, 0},
{&GUID_Key, 154, -2147444212, 0},
{&GUID_Key, 155, -2147443956, 0},
{&GUID_Key, 156, -2147443700, 0},
{&GUID_Key, 157, -2147443444, 0},
{&GUID_Key, 158, -2147443188, 0},
{&GUID_Key, 159, -2147442932, 0},
{&GUID_Key, 160, -2147442676, 0},
{&GUID_Key, 161, -2147442420, 0},
{&GUID_Key, 162, -2147442164, 0},
{&GUID_Key, 163, -2147441908, 0},
{&GUID_Key, 164, -2147441652, 0},
{&GUID_Key, 165, -2147441396, 0},
{&GUID_Key, 166, -2147441140, 0},
{&GUID_Key, 167, -2147440884, 0},
{&GUID_Key, 168, -2147440628, 0},
{&GUID_Key, 169, -2147440372, 0},
{&GUID_Key, 170, -2147440116, 0},
{&GUID_Key, 171, -2147439860, 0},
{&GUID_Key, 172, -2147439604, 0},
{&GUID_Key, 173, -2147439348, 0},
{&GUID_Key, 174, -2147439092, 0},
{&GUID_Key, 175, -2147438836, 0},
{&GUID_Key, 176, -2147438580, 0},
{&GUID_Key, 177, -2147438324, 0},
{&GUID_Key, 178, -2147438068, 0},
{&GUID_Key, 179, -2147437812, 0},
{&GUID_Key, 180, -2147437556, 0},
{&GUID_Key, 181, -2147437300, 0},
{&GUID_Key, 182, -2147437044, 0},
{&GUID_Key, 183, -2147436788, 0},
{&GUID_Key, 184, -2147436532, 0},
{&GUID_Key, 185, -2147436276, 0},
{&GUID_Key, 186, -2147436020, 0},
{&GUID_Key, 187, -2147435764, 0},
{&GUID_Key, 188, -2147435508, 0},
{&GUID_Key, 189, -2147435252, 0},
{&GUID_Key, 190, -2147434996, 0},
{&GUID_Key, 191, -2147434740, 0},
{&GUID_Key, 192, -2147434484, 0},
{&GUID_Key, 193, -2147434228, 0},
{&GUID_Key, 194, -2147433972, 0},
{&GUID_Key, 195, -2147433716, 0},
{&GUID_Key, 196, -2147433460, 0},
{&GUID_Key, 197, -2147433204, 0},
{&GUID_Key, 198, -2147432948, 0},
{&GUID_Key, 199, -2147432692, 0},
{&GUID_Key, 200, -2147432436, 0},
{&GUID_Key, 201, -2147432180, 0},
{&GUID_Key, 202, -2147431924, 0},
{&GUID_Key, 203, -2147431668, 0},
{&GUID_Key, 204, -2147431412, 0},
{&GUID_Key, 205, -2147431156, 0},
{&GUID_Key, 206, -2147430900, 0},
{&GUID_Key, 207, -2147430644, 0},
{&GUID_Key, 208, -2147430388, 0},
{&GUID_Key, 209, -2147430132, 0},
{&GUID_Key, 210, -2147429876, 0},
{&GUID_Key, 211, -2147429620, 0},
{&GUID_Key, 212, -2147429364, 0},
{&GUID_Key, 213, -2147429108, 0},
{&GUID_Key, 214, -2147428852, 0},
{&GUID_Key, 215, -2147428596, 0},
{&GUID_Key, 216, -2147428340, 0},
{&GUID_Key, 217, -2147428084, 0},
{&GUID_Key, 218, -2147427828, 0},
{&GUID_Key, 219, -2147427572, 0},
{&GUID_Key, 220, -2147427316, 0},
{&GUID_Key, 221, -2147427060, 0},
{&GUID_Key, 222, -2147426804, 0},
{&GUID_Key, 223, -2147426548, 0},
{&GUID_Key, 224, -2147426292, 0},
{&GUID_Key, 225, -2147426036, 0},
{&GUID_Key, 226, -2147425780, 0},
{&GUID_Key, 227, -2147425524, 0},
{&GUID_Key, 228, -2147425268, 0},
{&GUID_Key, 229, -2147425012, 0},
{&GUID_Key, 230, -2147424756, 0},
{&GUID_Key, 231, -2147424500, 0},
{&GUID_Key, 232, -2147424244, 0},
{&GUID_Key, 233, -2147423988, 0},
{&GUID_Key, 234, -2147423732, 0},
{&GUID_Key, 235, -2147423476, 0},
{&GUID_Key, 236, -2147423220, 0},
{&GUID_Key, 237, -2147422964, 0},
{&GUID_Key, 238, -2147422708, 0},
{&GUID_Key, 239, -2147422452, 0},
{&GUID_Key, 240, -2147422196, 0},
{&GUID_Key, 241, -2147421940, 0},
{&GUID_Key, 242, -2147421684, 0},
{&GUID_Key, 243, -2147421428, 0},
{&GUID_Key, 244, -2147421172, 0},
{&GUID_Key, 245, -2147420916, 0},
{&GUID_Key, 246, -2147420660, 0},
{&GUID_Key, 247, -2147420404, 0},
{&GUID_Key, 248, -2147420148, 0},
{&GUID_Key, 249, -2147419892, 0},
{&GUID_Key, 250, -2147419636, 0},
{&GUID_Key, 251, -2147419380, 0},
{&GUID_Key, 252, -2147419124, 0},
{&GUID_Key, 253, -2147418868, 0},
{&GUID_Key, 254, -2147418612, 0},
{&GUID_Key, 255, -2147418356, 0}
};
const DIDATAFORMAT c_dfDIKeyboard = {sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT),
0x00000002,
256,
256,
&rgodf_c_dfDIKeyboard[0]};
DIOBJECTDATAFORMAT rgodf_c_dfDIMouse[] = {
{&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}};
const DIDATAFORMAT c_dfDIMouse = {sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT),
0x00000002,
16,
7,
rgodf_c_dfDIMouse};
DIOBJECTDATAFORMAT rgodf_c_dfDIMouse2[] = {
{&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 = {sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT),
0x00000002,
20,
11,
rgodf_c_dfDIMouse2};
DIOBJECTDATAFORMAT rgodf_c_dfDIJoystick[] = {
{&GUID_XAxis, 0, -2130706685, 256},
{&GUID_YAxis, 4, -2130706685, 256},
{&GUID_ZAxis, 8, -2130706685, 256},
{&GUID_RxAxis, 12, -2130706685, 256},
{&GUID_RyAxis, 16, -2130706685, 256},
{&GUID_RzAxis, 20, -2130706685, 256},
{&GUID_Slider, 24, -2130706685, 256},
{&GUID_Slider, 28, -2130706685, 256},
{&GUID_POV, 32, -2130706672, 0},
{&GUID_POV, 36, -2130706672, 0},
{&GUID_POV, 40, -2130706672, 0},
{&GUID_POV, 44, -2130706672, 0},
{0, 48, -2130706676, 0},
{0, 49, -2130706676, 0},
{0, 50, -2130706676, 0},
{0, 51, -2130706676, 0},
{0, 52, -2130706676, 0},
{0, 53, -2130706676, 0},
{0, 54, -2130706676, 0},
{0, 55, -2130706676, 0},
{0, 56, -2130706676, 0},
{0, 57, -2130706676, 0},
{0, 58, -2130706676, 0},
{0, 59, -2130706676, 0},
{0, 60, -2130706676, 0},
{0, 61, -2130706676, 0},
{0, 62, -2130706676, 0},
{0, 63, -2130706676, 0},
{0, 64, -2130706676, 0},
{0, 65, -2130706676, 0},
{0, 66, -2130706676, 0},
{0, 67, -2130706676, 0},
{0, 68, -2130706676, 0},
{0, 69, -2130706676, 0},
{0, 70, -2130706676, 0},
{0, 71, -2130706676, 0},
{0, 72, -2130706676, 0},
{0, 73, -2130706676, 0},
{0, 74, -2130706676, 0},
{0, 75, -2130706676, 0},
{0, 76, -2130706676, 0},
{0, 77, -2130706676, 0},
{0, 78, -2130706676, 0},
{0, 79, -2130706676, 0}};
const DIDATAFORMAT c_dfDIJoystick = {sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT),
0x00000001,
80,
44,
rgodf_c_dfDIJoystick};
DIOBJECTDATAFORMAT rgodf_c_dfDIJoystick2[] = {
{&GUID_XAxis, 0, -2130706685, 256},
{&GUID_YAxis, 4, -2130706685, 256},
{&GUID_ZAxis, 8, -2130706685, 256},
{&GUID_RxAxis, 12, -2130706685, 256},
{&GUID_RyAxis, 16, -2130706685, 256},
{&GUID_RzAxis, 20, -2130706685, 256},
{&GUID_Slider, 24, -2130706685, 256},
{&GUID_Slider, 28, -2130706685, 256},
{&GUID_POV, 32, -2130706672, 0},
{&GUID_POV, 36, -2130706672, 0},
{&GUID_POV, 40, -2130706672, 0},
{&GUID_POV, 44, -2130706672, 0},
{0, 48, -2130706676, 0},
{0, 49, -2130706676, 0},
{0, 50, -2130706676, 0},
{0, 51, -2130706676, 0},
{0, 52, -2130706676, 0},
{0, 53, -2130706676, 0},
{0, 54, -2130706676, 0},
{0, 55, -2130706676, 0},
{0, 56, -2130706676, 0},
{0, 57, -2130706676, 0},
{0, 58, -2130706676, 0},
{0, 59, -2130706676, 0},
{0, 60, -2130706676, 0},
{0, 61, -2130706676, 0},
{0, 62, -2130706676, 0},
{0, 63, -2130706676, 0},
{0, 64, -2130706676, 0},
{0, 65, -2130706676, 0},
{0, 66, -2130706676, 0},
{0, 67, -2130706676, 0},
{0, 68, -2130706676, 0},
{0, 69, -2130706676, 0},
{0, 70, -2130706676, 0},
{0, 71, -2130706676, 0},
{0, 72, -2130706676, 0},
{0, 73, -2130706676, 0},
{0, 74, -2130706676, 0},
{0, 75, -2130706676, 0},
{0, 76, -2130706676, 0},
{0, 77, -2130706676, 0},
{0, 78, -2130706676, 0},
{0, 79, -2130706676, 0},
{0, 80, -2130706676, 0},
{0, 81, -2130706676, 0},
{0, 82, -2130706676, 0},
{0, 83, -2130706676, 0},
{0, 84, -2130706676, 0},
{0, 85, -2130706676, 0},
{0, 86, -2130706676, 0},
{0, 87, -2130706676, 0},
{0, 88, -2130706676, 0},
{0, 89, -2130706676, 0},
{0, 90, -2130706676, 0},
{0, 91, -2130706676, 0},
{0, 92, -2130706676, 0},
{0, 93, -2130706676, 0},
{0, 94, -2130706676, 0},
{0, 95, -2130706676, 0},
{0, 96, -2130706676, 0},
{0, 97, -2130706676, 0},
{0, 98, -2130706676, 0},
{0, 99, -2130706676, 0},
{0, 100, -2130706676, 0},
{0, 101, -2130706676, 0},
{0, 102, -2130706676, 0},
{0, 103, -2130706676, 0},
{0, 104, -2130706676, 0},
{0, 105, -2130706676, 0},
{0, 106, -2130706676, 0},
{0, 107, -2130706676, 0},
{0, 108, -2130706676, 0},
{0, 109, -2130706676, 0},
{0, 110, -2130706676, 0},
{0, 111, -2130706676, 0},
{0, 112, -2130706676, 0},
{0, 113, -2130706676, 0},
{0, 114, -2130706676, 0},
{0, 115, -2130706676, 0},
{0, 116, -2130706676, 0},
{0, 117, -2130706676, 0},
{0, 118, -2130706676, 0},
{0, 119, -2130706676, 0},
{0, 120, -2130706676, 0},
{0, 121, -2130706676, 0},
{0, 122, -2130706676, 0},
{0, 123, -2130706676, 0},
{0, 124, -2130706676, 0},
{0, 125, -2130706676, 0},
{0, 126, -2130706676, 0},
{0, 127, -2130706676, 0},
{0, 128, -2130706676, 0},
{0, 129, -2130706676, 0},
{0, 130, -2130706676, 0},
{0, 131, -2130706676, 0},
{0, 132, -2130706676, 0},
{0, 133, -2130706676, 0},
{0, 134, -2130706676, 0},
{0, 135, -2130706676, 0},
{0, 136, -2130706676, 0},
{0, 137, -2130706676, 0},
{0, 138, -2130706676, 0},
{0, 139, -2130706676, 0},
{0, 140, -2130706676, 0},
{0, 141, -2130706676, 0},
{0, 142, -2130706676, 0},
{0, 143, -2130706676, 0},
{0, 144, -2130706676, 0},
{0, 145, -2130706676, 0},
{0, 146, -2130706676, 0},
{0, 147, -2130706676, 0},
{0, 148, -2130706676, 0},
{0, 149, -2130706676, 0},
{0, 150, -2130706676, 0},
{0, 151, -2130706676, 0},
{0, 152, -2130706676, 0},
{0, 153, -2130706676, 0},
{0, 154, -2130706676, 0},
{0, 155, -2130706676, 0},
{0, 156, -2130706676, 0},
{0, 157, -2130706676, 0},
{0, 158, -2130706676, 0},
{0, 159, -2130706676, 0},
{0, 160, -2130706676, 0},
{0, 161, -2130706676, 0},
{0, 162, -2130706676, 0},
{0, 163, -2130706676, 0},
{0, 164, -2130706676, 0},
{0, 165, -2130706676, 0},
{0, 166, -2130706676, 0},
{0, 167, -2130706676, 0},
{0, 168, -2130706676, 0},
{0, 169, -2130706676, 0},
{0, 170, -2130706676, 0},
{0, 171, -2130706676, 0},
{0, 172, -2130706676, 0},
{0, 173, -2130706676, 0},
{0, 174, -2130706676, 0},
{0, 175, -2130706676, 0},
{&GUID_XAxis, 176, -2130706685, 512},
{&GUID_YAxis, 180, -2130706685, 512},
{&GUID_ZAxis, 184, -2130706685, 512},
{&GUID_RxAxis, 188, -2130706685, 512},
{&GUID_RyAxis, 192, -2130706685, 512},
{&GUID_RzAxis, 196, -2130706685, 512},
{&GUID_Slider, 24, -2130706685, 512},
{&GUID_Slider, 28, -2130706685, 512},
{&GUID_XAxis, 208, -2130706685, 768},
{&GUID_YAxis, 212, -2130706685, 768},
{&GUID_ZAxis, 216, -2130706685, 768},
{&GUID_RxAxis, 220, -2130706685, 768},
{&GUID_RyAxis, 224, -2130706685, 768},
{&GUID_RzAxis, 228, -2130706685, 768},
{&GUID_Slider, 24, -2130706685, 768},
{&GUID_Slider, 28, -2130706685, 768},
{&GUID_XAxis, 240, -2130706685, 1024},
{&GUID_YAxis, 244, -2130706685, 1024},
{&GUID_ZAxis, 248, -2130706685, 1024},
{&GUID_RxAxis, 252, -2130706685, 1024},
{&GUID_RyAxis, 256, -2130706685, 1024},
{&GUID_RzAxis, 260, -2130706685, 1024},
{&GUID_Slider, 24, -2130706685, 1024},
{&GUID_Slider, 28, -2130706685, 1024}};
const DIDATAFORMAT c_dfDIJoystick2 = {sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT),
0x00000001,
272,
164,
rgodf_c_dfDIJoystick2};

View file

@ -1,6 +0,0 @@
LIBRARY "dinput.dll"
EXPORTS
DirectInputCreateA@16
DirectInputCreateEx@20
DirectInputCreateW@16

View file

@ -1,4 +0,0 @@
LIBRARY "dinput8.dll"
EXPORTS
DirectInput8Create@20

View file

@ -1,8 +0,0 @@
LIBRARY "dplayx.dll"
EXPORTS
DirectPlayCreate@12
DirectPlayEnumerate@8
DirectPlayEnumerateA@8
DirectPlayEnumerateW@8
DirectPlayLobbyCreateA@20
DirectPlayLobbyCreateW@20

View file

@ -1,3 +0,0 @@
LIBRARY "dpnaddr.dll"
EXPORTS
DirectPlay8AddressCreate@12

View file

@ -1,3 +0,0 @@
LIBRARY "dpnet.dll"
EXPORTS
DirectPlay8Create@12

View file

@ -1,3 +0,0 @@
LIBRARY "dpnlobby.dll"
EXPORTS
DirectPlay8LobbyCreate@12

View file

@ -1,3 +0,0 @@
LIBRARY "dpvoice.dll"
EXPORTS
DirectPlayVoiceCreate@12

View file

@ -1,18 +0,0 @@
LIBRARY "DSETUP.dll"
EXPORTS
DirectXDeviceDriverSetupA@16
DirectXDeviceDriverSetupW@16
DirectXLoadString@12
DirectXRegisterApplicationA@8
DirectXRegisterApplicationW@8
DirectXSetupA@12
DirectXSetupCallback@20
DirectXSetupGetFileVersion@12
DirectXSetupGetVersion@8
DirectXSetupIsEng@0
DirectXSetupIsJapan@0
DirectXSetupIsJapanNec@0
DirectXSetupSetCallback@4
DirectXSetupShowEULA@4
DirectXSetupW@12
DirectXUnRegisterApplication@8

View file

@ -1,13 +0,0 @@
LIBRARY "dsound.dll"
EXPORTS
DirectSoundCaptureCreate8@12
DirectSoundCaptureCreate@12
DirectSoundCaptureEnumerateA@8
DirectSoundCaptureEnumerateW@8
DirectSoundCreate8@12
DirectSoundCreate@12
DirectSoundCreate
DirectSoundEnumerateA@8
DirectSoundEnumerateW@8
DirectSoundFullDuplexCreate@40
GetDeviceID@8

View file

@ -1,580 +0,0 @@
#define DIRECTINPUT_VERSION 0x0700
#include "dx/dinput.h"
/* This is a replacement for Microsoft's dxguid.lib. */
#undef DEFINE_GUID
#define DEFINE_GUID(n,a,b,c,d,e,f,g,h,i,j,k) const GUID n = {a,b,c,{d,e,f,g,h,i,j,k}}
/* d3rmobj.h */
DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(CLSID_CDirect3DRMViewportInterpolator,
0xde9eaa1, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMFrameInterpolator,
0xde9eaa2, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMMeshInterpolator,
0xde9eaa3, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMLightInterpolator,
0xde9eaa6, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMMaterialInterpolator,
0xde9eaa7, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMTextureInterpolator,
0xde9eaa8, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMProgressiveMesh, 0x4516ec40, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRMClippedVisual, 0x5434e72d, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a);
/* d3rmwin.h */
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
/* dpaddr.h */
DEFINE_GUID(CLSID_DirectPlay8Address,0x934a9523, 0xa3ca, 0x4bc5, 0xad, 0xa0, 0xd6, 0xd9, 0x5d, 0x97, 0x94, 0x21);
DEFINE_GUID(IID_IDirectPlay8Address, 0x83783300, 0x4063, 0x4c8a, 0x9d, 0xb3, 0x82, 0x83, 0xa, 0x7f, 0xeb, 0x31);
DEFINE_GUID(IID_IDirectPlay8AddressIP,0xe5a0e990, 0x2bad, 0x430b, 0x87, 0xda, 0xa1, 0x42, 0xcf, 0x75, 0xde, 0x58);
/* dplay.h */
DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
DEFINE_GUID(DPSPGUID_IPX, 0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
DEFINE_GUID(DPSPGUID_TCPIP, 0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
DEFINE_GUID(DPSPGUID_SERIAL, 0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPSPGUID_MODEM, 0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72);
/* dplay8.h */
DEFINE_GUID(CLSID_DirectPlay8Client,0x743f1dc6, 0x5aba, 0x429f, 0x8b, 0xdf, 0xc5, 0x4d, 0x3, 0x25, 0x3d, 0xc2);
DEFINE_GUID(CLSID_DirectPlay8Peer,0x286f484d, 0x375e, 0x4458, 0xa2, 0x72, 0xb1, 0x38, 0xe2, 0xf8, 0xa, 0x6a);
DEFINE_GUID(CLSID_DirectPlay8Server,0xda825e1b, 0x6830, 0x43d7, 0x83, 0x5d, 0xb, 0x5a, 0xd8, 0x29, 0x56, 0xa2);
DEFINE_GUID(IID_IDirectPlay8Client, 0x5102dacd, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(IID_IDirectPlay8Peer, 0x5102dacf, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(IID_IDirectPlay8Server, 0x5102dace, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(CLSID_DP8SP_IPX, 0x53934290, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(CLSID_DP8SP_MODEM, 0x6d4a3650, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(CLSID_DP8SP_SERIAL, 0x743b5d60, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(CLSID_DP8SP_TCPIP, 0xebfe7ba0, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
/* dplobby.h */
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(DPLPROPERTY_MessagesSupported, 0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
DEFINE_GUID(DPLPROPERTY_LobbyGuid, 0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
DEFINE_GUID(DPLPROPERTY_PlayerGuid, 0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
DEFINE_GUID(DPLPROPERTY_PlayerScore, 0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
DEFINE_GUID(DPAID_TotalSize, 0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
DEFINE_GUID(DPAID_ServiceProvider, 0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_LobbyProvider, 0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
DEFINE_GUID(DPAID_Phone, 0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_PhoneW, 0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_Modem, 0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_ModemW, 0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_INet, 0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_INetW, 0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
DEFINE_GUID(DPAID_INetPort, 0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(DPAID_MaxMessageSize, 0xf5d09980, 0xf0c4, 0x11d1, 0x83, 0x26, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(DPAID_ComPort, 0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* dplobby8.h */
DEFINE_GUID(CLSID_DirectPlay8LobbiedApplication, 0x667955ad, 0x6b3b, 0x43ca, 0xb9, 0x49, 0xbc, 0x69, 0xb5, 0xba, 0xff, 0x7f);
DEFINE_GUID(CLSID_DirectPlay8LobbyClient, 0x3b2b6775, 0x70b6, 0x45af, 0x8d, 0xea, 0xa2, 0x9, 0xc6, 0x95, 0x59, 0xf3);
DEFINE_GUID(IID_IDirectPlay8LobbiedApplication, 0x819074a3, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
DEFINE_GUID(IID_IDirectPlay8LobbyClient, 0x819074a2, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
/* dvoice.h */
DEFINE_GUID(CLSID_DirectPlayVoiceClient, 0xb9f3eb85, 0xb781, 0x4ac1, 0x8d, 0x90, 0x93, 0xa0, 0x5e, 0xe3, 0x7d, 0x7d);
DEFINE_GUID(CLSID_DirectPlayVoiceServer, 0xd3f5b8e6, 0x9b78, 0x4a4c, 0x94, 0xea, 0xca, 0x23, 0x97, 0xb6, 0x63, 0xd3);
DEFINE_GUID(CLSID_DirectPlayVoiceTest, 0xf0f094b, 0xb01c, 0x4091, 0xa1, 0x4d, 0xdd, 0xc, 0xd8, 0x7, 0x71, 0x1a);
DEFINE_GUID(IID_IDirectPlayVoiceClient, 0x1dfdc8ea, 0xbcf7, 0x41d6, 0xb2, 0x95, 0xab, 0x64, 0xb3, 0xb2, 0x33, 0x6);
DEFINE_GUID(IID_IDirectPlayVoiceServer, 0xfaa1c173, 0x468, 0x43b6, 0x8a, 0x2a, 0xea, 0x8a, 0x4f, 0x20, 0x76, 0xc9);
DEFINE_GUID(IID_IDirectPlayVoiceTest, 0xd26af734, 0x208b, 0x41da, 0x82, 0x24, 0xe0, 0xce, 0x79, 0x81, 0xb, 0xe1);
DEFINE_GUID(DPVCTGUID_ADPCM, 0x699b52c1, 0xa885, 0x46a8, 0xa3, 0x8, 0x97, 0x17, 0x24, 0x19, 0xad, 0xc7);
DEFINE_GUID(DPVCTGUID_GSM,0x24768c60, 0x5a0d, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7);
DEFINE_GUID(DPVCTGUID_NONE, 0x8de12fd4, 0x7cb3, 0x48ce, 0xa7, 0xe8, 0x9c, 0x47, 0xa2, 0x2e, 0x8a, 0xc5);
DEFINE_GUID(DPVCTGUID_SC03, 0x7d82a29b, 0x2242, 0x4f82, 0x8f, 0x39, 0x5d, 0x11, 0x53, 0xdf, 0x3e, 0x41);
DEFINE_GUID(DPVCTGUID_SC06, 0x53def900, 0x7168, 0x4633, 0xb4, 0x7f, 0xd1, 0x43, 0x91, 0x6a, 0x13, 0xc7);
DEFINE_GUID(DPVCTGUID_TRUESPEECH, 0xd7954361, 0x5a0b, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7);
DEFINE_GUID(DPVCTGUID_VR12, 0xfe44a9fe, 0x8ed4, 0x48bf, 0x9d, 0x66, 0x1b, 0x1a, 0xdf, 0xf9, 0xff, 0x6d);
/* dxfile.h */
DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* rmxfguid.h */
DEFINE_GUID(TID_D3DRMInfo, 0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMesh, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMVector, 0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMeshFace, 0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMaterial, 0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMaterialArray, 0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrame, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMFrameTransformMatrix, 0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshMaterialList, 0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshTextureCoords, 0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshNormals, 0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMCoords2d, 0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMatrix4x4, 0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMAnimation, 0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMAnimationSet, 0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMAnimationKey, 0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMFloatKeys, 0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMMaterialAmbientColor, 0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMMaterialDiffuseColor, 0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMMaterialSpecularColor, 0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMMaterialEmissiveColor, 0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialPower, 0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMColorRGBA, 0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
DEFINE_GUID(TID_D3DRMColorRGB, 0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMGuid, 0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMTextureFilename, 0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMTextureReference, 0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMIndexedColor, 0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshVertexColors, 0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialWrap, 0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMBoolean, 0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMMeshFaceWraps, 0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMBoolean2d, 0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMTimedFloatKeys, 0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMAnimationOptions, 0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFramePosition, 0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrameVelocity, 0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrameRotation, 0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMLight, 0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMCamera, 0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMAppData, 0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightUmbra, 0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightRange, 0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightPenumbra, 0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightAttenuation, 0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMInlineData, 0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMUrl, 0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMProgressiveMesh, 0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B);
DEFINE_GUID(TID_D3DRMExternalVisual, 0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMStringProperty, 0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMPropertyBag, 0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMRightHanded, 0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
/* d3drm.h */
DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(IID_IDirect3DRM3, 0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/* dvp.h */
DEFINE_GUID(IID_IDDVideoPortContainer, 0x6C142760, 0xA733, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
DEFINE_GUID(IID_IDirectDrawVideoPort, 0xB36D93E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
DEFINE_GUID(DDVPTYPE_E_HREFH_VREFH, 0x54F39980L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_E_HREFH_VREFL, 0x92783220L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_CCIR656, 0xFCA326A0L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_BROOKTREE, 0x1352A560L, 0xDA61, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID(DDVPTYPE_PHILIPS, 0x332CF160L, 0xDA61, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
/* dmksctrl.h */
DEFINE_GUID(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96);
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_MIDI, 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00);
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
/* dmplugin.h */
DEFINE_GUID(CLSID_DirectMusicScriptTrack,0x4108fa85, 0x3586, 0x11d3, 0x8b, 0xd7, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4108FA85-3586-11d3-8BD7-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicMarkerTrack,0x55a8fd00, 0x4288, 0x11d3, 0x9b, 0xd1, 0x8a, 0xd, 0x61, 0xc8, 0x88, 0x35);
DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665, 0x4ea1, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {BAE4D665-4EA1-11d3-8BDA-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5, 0x54ff, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {995C1CF5-54FF-11d3-8BDA-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b, 0x5c19, 0x11d3, 0x8b, 0xdc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4BE0537B-5C19-11d3-8BDC-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicMelodyFormulationTrack, 0xb0684266, 0xb57f, 0x11d2, 0x97, 0xf9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
DEFINE_GUID(CLSID_DirectMusicWaveTrack,0xeed36461, 0x9ea5, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
DEFINE_GUID(IID_IDirectMusicTool8, 0xe674303, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36);
DEFINE_GUID(IID_IDirectMusicTrack8, 0xe674304, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36);
/* dmusicc.h */
DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
DEFINE_GUID(CLSID_DirectMusic, 0x636b9f10, 0x0c7d, 0x11d1, 0x95, 0xb2, 0x00, 0x20, 0xaf, 0xdc, 0x74, 0x21);
DEFINE_GUID(CLSID_DirectMusicCollection, 0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
DEFINE_GUID(CLSID_DirectMusicSynth, 0x58C2B4D0, 0x46E7, 0x11D1, 0x89, 0xAC, 0x00, 0xA0, 0xC9, 0x05, 0x41, 0x29);
DEFINE_GUID(IID_IDirectMusic, 0xd2ac2876, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicBuffer, 0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicPort, 0x55e2edd8, 0xcd7c, 0x11d1, 0xa7, 0x6f, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(IID_IDirectMusicPortDownload, 0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicDownload, 0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicCollection, 0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicInstrument, 0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicDownloadedInstrument, 0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusic2,0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND, 0xaa97844, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE, 0xaa97845, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_GUID(GUID_DMUS_PROP_WriteLatency,0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_WritePeriod,0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_WavesReverb,0x4cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps,0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
/* dmusici.h */
DEFINE_GUID(CLSID_DirectMusicPerformance, 0xd2ac2881, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSegment, 0xd2ac2882, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSegmentState, 0xd2ac2883, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicGraph, 0xd2ac2884, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicTempoTrack, 0xd2ac2885, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSeqTrack, 0xd2ac2886, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicCurveTrack, 0xc51f3861, 0xf9a6, 0x11d1, 0xbc, 0x95, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(CLSID_DirectMusicSysExTrack, 0xd2ac2887, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicTimeSigTrack, 0xd2ac2888, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicStyle, 0xd2ac288a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicChordTrack, 0xd2ac288b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicCommandTrack, 0xd2ac288c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicStyleTrack, 0xd2ac288d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicMotifTrack, 0xd2ac288e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicChordMap,0xd2ac288f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicComposer, 0xd2ac2890, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSignPostTrack, 0xf17e8672, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicLoader, 0xd2ac2892, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicBandTrack,0xd2ac2894, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicBand, 0x79ba9e00, 0xb6ee, 0x11d1, 0x86, 0xbe, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
DEFINE_GUID(CLSID_DirectMusicChordMapTrack,0xd2ac2896, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicMuteTrack, 0xd2ac2898, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DirectMusicAllTypes, 0xd2ac2893, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_NOTIFICATION_SEGMENT, 0xd2ac2899, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE,0x81f75bc5, 0x4e5d, 0x11d2, 0xbc, 0xc7, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT, 0xd2ac289a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_NOTIFICATION_CHORD, 0xd2ac289b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_NOTIFICATION_COMMAND, 0xd2ac289c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_CommandParam,0xd2ac289d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7, 0x9538, 0x11d2, 0x97, 0xa9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
DEFINE_GUID(GUID_ChordParam,0xd2ac289e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_RhythmParam,0xd2ac289f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_IDirectMusicStyle,0xd2ac28a1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_TimeSignature,0xd2ac28a4, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_TempoParam,0xd2ac28a5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_IDirectMusicBand,0xd2ac28ac, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_IDirectMusicChordMap,0xd2ac28ad, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_MuteParam,0xd2ac28af, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_Download,0xd2ac28a7, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_Unload,0xd2ac28a8, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e);
DEFINE_GUID(GUID_Enable_Auto_Download,0xd2ac28a9, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_Clear_All_Bands,0xd2ac28ab, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_StandardMIDIFile, 0x6621075, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e);
DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_DisableTempo, 0x45fc707d, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_EnableTempo, 0x45fc707e, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5, 0xff37, 0x11d2, 0x81, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
DEFINE_GUID(GUID_PerfMasterTempo,0xd2ac28b0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_PerfMasterVolume,0xd2ac28b1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_PerfMasterGrooveLevel,0xd2ac28b2, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b, 0x3631, 0x11d2, 0xbc, 0xb8, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2, 0x5dca, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(IID_IDirectMusicGetLoader,0x68a04844, 0xd13d, 0x11d1, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(IID_IDirectMusicObject,0xd2ac28b5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7, 0xd3ee, 0x11d1, 0xbc, 0x8d, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicPerformance,0x7d43d03, 0x6523, 0x11d2, 0x87, 0x1d, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicTool,0xd2ac28ba, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicGraph,0x2befc277, 0x5497, 0x11d2, 0xbc, 0xcb, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
DEFINE_GUID(IID_IDirectMusicStyle,0xd2ac28bd, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicChordMap,0xd2ac28be, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicComposer,0xd2ac28bf, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicBand,0xd2ac28c0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicPerformance2,0x6fc2cae0, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1, 0xc052, 0x11d2, 0x87, 0x2f, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c, 0xa44, 0x4e6a, 0xa1, 0x16, 0x59, 0x5a, 0x7c, 0xd5, 0xde, 0x8c);
DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137, 0xc62e, 0x4147, 0xb2, 0xb4, 0x9d, 0x56, 0x9a, 0xcb, 0x25, 0x4c);
DEFINE_GUID(IID_IDirectMusicSegment8,0xc6784488, 0x41a3, 0x418f, 0xaa, 0x15, 0xb3, 0x50, 0x93, 0xba, 0x42, 0xd4);
DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730, 0xae4, 0x48a7, 0x98, 0x39, 0xbc, 0x4, 0xbf, 0xe0, 0x77, 0x72);
DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a, 0xa260, 0x453d, 0xbf, 0x50, 0x6f, 0x93, 0x84, 0xf7, 0x9, 0x85);
DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10, 0xb49f, 0x46fc, 0xbe, 0xc2, 0xe6, 0x28, 0x8f, 0xb9, 0xed, 0xe6);
DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a, 0x5814, 0x489b, 0x82, 0x9, 0x31, 0xfe, 0xde, 0xba, 0xf1, 0x37); /* {2252373A-5814-489b-8209-31FEDEBAF137} */
DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47);
DEFINE_GUID(IID_IDirectMusicSong, 0xa862b2ec, 0x3676, 0x4982, 0x85, 0xa, 0x78, 0x42, 0x77, 0x5e, 0x1d, 0x86);
DEFINE_GUID(IID_IDirectMusicAudioPath,0xc87631f5, 0x23be, 0x4986, 0x88, 0x36, 0x5, 0x83, 0x2f, 0xcc, 0x48, 0xf9);
/* d3d.h */
DEFINE_GUID(IID_IDirect3D, 0x3BBA0080, 0x2421, 0x11CF, 0xA3, 0x1A, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
DEFINE_GUID(IID_IDirect3D2, 0x6aae1ec1, 0x662a, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID(IID_IDirect3D3, 0xbb223240, 0xe72b, 0x11d0, 0xa9, 0xb4, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
DEFINE_GUID( IID_IDirect3D7, 0xf5049e77,0x4861,0x11d2,0xa4,0x7,0x0,0xa0,0xc9,0x6,0x29,0xa8);
DEFINE_GUID(IID_IDirect3DRampDevice, 0xF2086B20, 0x259F, 0x11CF, 0xA3, 0x1A, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
DEFINE_GUID(IID_IDirect3DRGBDevice, 0xA4665C60, 0x2673, 0x11CF, 0xA3, 0x1A, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
DEFINE_GUID(IID_IDirect3DHALDevice, 0x84E63dE0, 0x46AA, 0x11CF, 0x81, 0x6F, 0x00, 0x00, 0xC0, 0x20, 0x15, 0x6E);
DEFINE_GUID(IID_IDirect3DMMXDevice, 0x881949a1, 0xd6f3, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DRefDevice, 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( IID_IDirect3DTnLHalDevice, 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID(IID_IDirect3DDevice, 0x64108800, 0x957d, 0X11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DDevice3, 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74);
DEFINE_GUID( IID_IDirect3DDevice7, 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID(IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DLight, 0x4417C142, 0x33AD, 0x11CF, 0x81, 0x6F, 0x00, 0x00, 0xC0, 0x20, 0x15, 0x6E);
DEFINE_GUID(IID_IDirect3DMaterial, 0x4417C144, 0x33AD, 0x11CF, 0x81, 0x6F, 0x00, 0x00, 0xC0, 0x20, 0x15, 0x6E);
DEFINE_GUID(IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DMaterial3, 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x0, 0x60, 0x8, 0x52, 0xb3, 0x12);
DEFINE_GUID(IID_IDirect3DExecuteBuffer, 0x4417C145, 0x33AD, 0x11CF, 0x81, 0x6F, 0x00, 0x00, 0xC0, 0x20, 0x15, 0x6E);
DEFINE_GUID(IID_IDirect3DViewport, 0x4417C146, 0x33AD, 0x11CF, 0x81, 0x6F, 0x00, 0x00, 0xC0, 0x20, 0x15, 0x6E);
DEFINE_GUID(IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID(IID_IDirect3DViewport3, 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74);
DEFINE_GUID(IID_IDirect3DVertexBuffer, 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x0, 0xa0, 0xc9, 0x3, 0x67, 0xf8);
DEFINE_GUID( IID_IDirect3DVertexBuffer7, 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
/* d3d8.h */
DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12);
DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf);
DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f);
DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e);
DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58);
DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50);
DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad);
DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95);
DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86);
DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd);
DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0);
DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd);
/* d3dx8core.h */
DEFINE_GUID(IID_ID3DXBuffer, 0x932e6a7e, 0xc68e, 0x45dd, 0xa7, 0xbf, 0x53, 0xd1, 0x9c, 0x86, 0xdb, 0x1f);
DEFINE_GUID( IID_ID3DXFont, 0x2d501df7, 0xd253, 0x4414, 0x86, 0x5f, 0xa6, 0xd5, 0x4a, 0x75, 0x31, 0x38);
DEFINE_GUID( IID_ID3DXSprite, 0xe8691849, 0x87b8, 0x4929, 0x90, 0x50, 0x1b, 0x5, 0x42, 0xd5, 0x53, 0x8c);
DEFINE_GUID( IID_ID3DXRenderToSurface, 0x69cc587c, 0xe40c, 0x458d, 0xb5, 0xd3, 0xb0, 0x29, 0xe1, 0x8e, 0xb6, 0xa);
DEFINE_GUID( IID_ID3DXRenderToEnvMap, 0x9f6779e5, 0x60a9, 0x4d8b, 0xae, 0xe4, 0x32, 0x77, 0xf, 0x40, 0x5d, 0xba);
/* d3dx8effect.h */
DEFINE_GUID( IID_ID3DXTechnique, 0xa00f378d, 0xaf79, 0x4917, 0x90, 0x7e, 0x4d, 0x63, 0x5e, 0xe6, 0x38, 0x44);
DEFINE_GUID( IID_ID3DXEffect, 0x281bbdd4, 0xaedf, 0x4907, 0x86, 0x50, 0xe7, 0x9c, 0xdf, 0xd4, 0x51, 0x65);
/* d3dx8math.h */
DEFINE_GUID( IID_ID3DXMatrixStack, 0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
/* d3dx8mesh.h */
DEFINE_GUID(IID_ID3DXBaseMesh, 0xa69ba991, 0x1f7d, 0x11d3, 0xb9, 0x29, 0x0, 0xc0, 0x4f, 0x68, 0xdc, 0x23);
DEFINE_GUID(IID_ID3DXMesh, 0x9d84ac46, 0x6b90, 0x49a9, 0xa7, 0x21, 0x8, 0x5c, 0x7a, 0x3e, 0x3d, 0xae);
DEFINE_GUID(IID_ID3DXPMesh, 0x15981aa8, 0x1a05, 0x48e3, 0xbb, 0xe7, 0xff, 0x5d, 0x49, 0x65, 0x4e, 0x3f);
DEFINE_GUID(IID_ID3DXSPMesh, 0xbc3bbde2, 0x1f7d, 0x11d3, 0xb9, 0x29, 0x0, 0xc0, 0x4f, 0x68, 0xdc, 0x23);
DEFINE_GUID(IID_ID3DXSkinMesh, 0x82a53844, 0xf322, 0x409e, 0xa2, 0xe9, 0x99, 0x2e, 0x11, 0x4, 0x6, 0x9d);
/* dsound.h */
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66);
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e);
DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5);
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6);
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3);
DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47);
DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83);
DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42);
DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b);
DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0);
DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda);
DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4);
DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25);
DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0x174d3eb9, 0x6696, 0x4fac, 0xa4, 0x6c, 0xa0, 0xac, 0x7b, 0xc9, 0xe2, 0xf);
DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca);
DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d);
DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf);
DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6);
DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98);
DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d);
DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21);
DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57);
DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31);
DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4);
DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c);
DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40);
DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10);
DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5);
DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d);
DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0);
/* ddraw.h */
DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
DEFINE_GUID( CLSID_DirectDraw7, 0x3c305196,0x50db,0x11d3,0x9c,0xfe,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
DEFINE_GUID(IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
DEFINE_GUID(IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
/* dls2.h */
DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_GUID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
/* dinputd.h */
DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
/* dinput.h */
DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(CLSID_DirectInputDevice,0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(CLSID_DirectInputDevice8,0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInput7A, 0X9A4CB684,0X236D,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
DEFINE_GUID(IID_IDirectInput7W, 0X9A4CB685,0X236D,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(IID_IDirectInputDevice7A,0X57D7C6BC,0X2356,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
DEFINE_GUID(IID_IDirectInputDevice7W,0X57D7C6BD,0X2356,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
DEFINE_GUID(IID_IDirectInputDevice8A,0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
DEFINE_GUID(IID_IDirectInputDevice8W,0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_ConstantForce,0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);

View file

@ -1,9 +0,0 @@
#define DIRECTINPUT_VERSION 0x0700
#include "dx/dinput.h"
#undef DEFINE_GUID
#define DEFINE_GUID(n,a,b,c,d,e,f,g,h,i,j,k) const GUID n = {a,b,c,{d,e,f,g,h,i,j,k}}
/* dsound.h */
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);

View file

@ -1,8 +0,0 @@
This minimal DirectX 8.0 SDK is largely based upon work from Paul Gerfen.
paul@gamecoding.co.uk
www.gamecoding.co.uk
from: http://alleg.sourceforge.net/files/dx80_mgw.zip
tweaked for inclusion in EDuke32

View file

@ -83,28 +83,7 @@ if( WIN32 )
setupapi
oleaut32
dbghelp
legacy_stdio_definitions
shlwapi
version
imm32
dxguid
dsound
winspool
advapi32
shell32
SetupAPI
uuid
odbc32
odbccp32
# this local library crap needs to go away. Sadly there doesn't seem to be anything to get a working libvpx that doesn't force linking with MinGW dependencies.
#libvpx
#libcompat-to-msvc
)
legacy_stdio_definitions )
if( NOT DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
@ -154,6 +133,13 @@ else()
endif()
endif()
if ( NOT WIN32 )
option( NO_SDL_JOYSTICK "Disable SDL joystick support (Not applicable to Windows)" OFF )
if ( NO_SDL_JOYSTICK )
add_definitions( -DNO_SDL_JOYSTICK=1 )
endif()
endif()
if( NO_GTK )
add_definitions( -DNO_GTK )
elseif( DYN_GTK )
@ -305,16 +291,6 @@ if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_CXX_FLAGS}" )
# ARM processors (Raspberry Pi, et al) - enable ARM NEON support.
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
set (USE_ARMV8 0 CACHE BOOL "Use ARMv8 instructions - Raspberry Pi 3")
if (USE_ARMV8)
set( CMAKE_CXX_FLAGS "-mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mtune=cortex-a53 -mhard-float -DNO_SSE ${CMAKE_CXX_FLAGS}" )
else ()
set( CMAKE_CXX_FLAGS "-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mtune=cortex-a7 -mhard-float -DNO_SSE ${CMAKE_CXX_FLAGS}" )
endif ()
endif ()
if( NOT X64 AND NOT CAN_DO_MFPMATH )
set( CMAKE_C_FLAGS "-DNO_SSE ${CMAKE_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "-DNO_SSE ${CMAKE_CXX_FLAGS}" )
@ -368,15 +344,8 @@ if( NOT STRUPR_EXISTS )
add_definitions( -DNEED_STRUPR=1 )
endif()
CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()
CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()
require_stricmp()
require_strnicmp()
if( NOT MSVC )
add_definitions( -D__forceinline=inline )
@ -428,7 +397,7 @@ if( MSVC AND NOT ZMUSIC_FOUND )
set( ZMUSIC_LIBRARIES zmusiclite )
if( X64 )
link_directories( ${ZMUSIC_ROOT_PATH}/64bit )
elseif( ${TARGET_ARCHITECTURE} MATCHES "arm" )
elseif( ARM64 )
link_directories( ${ZMUSIC_ROOT_PATH}/arm64 )
else()
link_directories( ${ZMUSIC_ROOT_PATH}/32bit )
@ -436,11 +405,12 @@ if( MSVC AND NOT ZMUSIC_FOUND )
set( ZMUSIC_FOUND TRUE )
endif()
# VPX
if( MSVC AND NOT VPX_FOUND )
# Use prebuilt library
set( VPX_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../platform/Windows" )
set( VPX_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../bin/Windows/vpx" )
set( VPX_INCLUDE_DIR ${VPX_ROOT_PATH}/include )
set( VPX_LIBRARIES libvpx libcompat-to-msvc )
if( ARM64 )
@ -578,14 +548,14 @@ if( HAVE_MMX )
common/textures/hires/hqnx_asm/hq4x_asm.cpp
common/textures/hires/hqnx_asm/hqnx_asm_Image.cpp)
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set_source_files_properties(
common/textures/hires/hqnx_asm/hq2x_asm.cpp
common/textures/hires/hqnx_asm/hq3x_asm.cpp
common/textures/hires/hqnx_asm/hq4x_asm.cpp
common/textures/hires/hqresize.cpp
PROPERTIES COMPILE_FLAGS "-mmmx" )
endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
endif( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
endif( HAVE_MMX )
if( HAVE_PARALLEL_FOR )
@ -627,9 +597,6 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
file( GLOB HEADER_FILES
build/include/*.h
glbackend/*.h
libsmackerdec/include/*.h
libxmp-lite/include/libxmp-lite/*.h
libxmp-lite/src/*.h
core/*.h
core/2d/*.h
core/utility/*.h
@ -647,6 +614,7 @@ file( GLOB HEADER_FILES
common/audio/music/*.h*
common/2d/*.h
common/console/*.h
common/cutscenes/*.h
common/utility/*.h
common/engine/*.h
common/menu/*.h
@ -665,6 +633,7 @@ file( GLOB HEADER_FILES
common/thirdparty/*.h
common/thirdparty/rapidjson/*.h
common/thirdparty/math/*h
common/thirdparty/libsmackerdec/include/*.h
common/rendering/*.h
common/rendering/gl_load/*.h
common/rendering/hwrenderer/*.h
@ -791,8 +760,6 @@ set( NOT_COMPILED_SOURCE_FILES
games/blood/src/weapon.cpp
# Duke
games/duke/src/2d_d.cpp
games/duke/src/2d_r.cpp
games/duke/src/actors.cpp
games/duke/src/actors_d.cpp
games/duke/src/actors_lava.cpp
@ -1026,13 +993,6 @@ set( FASTMATH_SOURCES
common/textures/hires/hqnx/hq4x.cpp
common/textures/hires/xbr/xbrz.cpp
common/textures/hires/xbr/xbrz_old.cpp
# This should better be made a library subproject later, once things are working.
libsmackerdec/src/BitReader.cpp
libsmackerdec/src/FileStream.cpp
libsmackerdec/src/HuffmanVLC.cpp
libsmackerdec/src/LogError.cpp
libsmackerdec/src/SmackerDecoder.cpp
common/utility/matrix.cpp
# The rest is only here because it is C, not C++
@ -1085,8 +1045,6 @@ set (PCH_SOURCES
build/src/mdsprite.cpp
build/src/polymost.cpp
core/movie/playmve.cpp
core/movie/movieplayer.cpp
core/automap.cpp
core/cheats.cpp
core/cheathandler.cpp
@ -1118,6 +1076,7 @@ set (PCH_SOURCES
core/quotes.cpp
core/screenshot.cpp
core/sectorgeometry.cpp
core/razefont.cpp
core/raze_music.cpp
core/raze_sound.cpp
core/palette.cpp
@ -1228,6 +1187,9 @@ set (PCH_SOURCES
common/console/c_notifybufferbase.cpp
common/console/c_tabcomplete.cpp
common/console/c_expr.cpp
common/cutscenes/playmve.cpp
common/cutscenes/movieplayer.cpp
common/cutscenes/screenjob.cpp
common/utility/engineerrors.cpp
common/utility/i_module.cpp
common/utility/m_alloc.cpp
@ -1247,6 +1209,11 @@ set (PCH_SOURCES
common/thirdparty/base64.cpp
common/thirdparty/md5.cpp
common/thirdparty/superfasthash.cpp
common/thirdparty/libsmackerdec/src/BitReader.cpp
common/thirdparty/libsmackerdec/src/FileStream.cpp
common/thirdparty/libsmackerdec/src/HuffmanVLC.cpp
common/thirdparty/libsmackerdec/src/LogError.cpp
common/thirdparty/libsmackerdec/src/SmackerDecoder.cpp
common/filesystem/filesystem.cpp
common/filesystem/ancientzip.cpp
common/filesystem/file_7z.cpp
@ -1365,8 +1332,6 @@ endif()
macro( use_precompiled_header )
if( MSVC )
enable_precompiled_headers( "${ARGV0}/g_pch.h" PCH_SOURCES )
# The original Build code was written with unsigned chars and unfortunately they still haven't been eliminated entirely.
# All other code should stay with signed chars. What a mess... :(
else()
# Temporary solution for compilers other than MSVC
set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "-include g_pch.h" )
@ -1430,7 +1395,6 @@ include_directories(
build/include
libxmp-lite/include
libxmp-lite/include/libxmp-lite
libsmackerdec/include
thirdparty/include
thirdparty/imgui
core
@ -1449,6 +1413,8 @@ include_directories(
common/audio/sound
common/audio/music
common/2d
common/cutscenes
common/thirdparty/libsmackerdec/include
common/thirdparty
common/textures
common/textures/formats
@ -1539,7 +1505,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
if( CMAKE_COMPILER_IS_GNUCXX )
# GCC misoptimizes this file
endif()
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
# Need to enable intrinsics for these files.
if( SSE_MATTERS )
set_property( SOURCE
@ -1612,6 +1578,7 @@ source_group("Common\\Console" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/
source_group("Common\\Utility" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/utility/.+")
source_group("Common\\Engine" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/engine/.+")
source_group("Common\\2D" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/2d/.+")
source_group("Common\\Cutscenes" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/cutscenes/.+")
source_group("Common\\Objects" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/objects/.+")
source_group("Common\\Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/menu/.+")
source_group("Common\\Fonts" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/fonts/.+")
@ -1666,34 +1633,6 @@ source_group("Build Engine" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/bui
source_group("Build Engine\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/build/include/.+")
source_group("Build Engine\\Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/build/src/.+")
macro( add_game_library )
file( GLOB HEADER_FILES src/*.h )
if( NOT_COMPILED_SOURCE_FILES )
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
endif()
use_precompiled_header("..")
add_library( ${ARGV0} STATIC
${PCH_SOURCES}
${HEADER_FILES}
${NOT_COMPILED_SOURCE_FILES}
)
endmacro()
macro( add_game_library2 )
file( GLOB HEADER_FILES src/*.h )
if( NOT_COMPILED_SOURCE_FILES )
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
endif()
use_precompiled_header("../..")
add_library( ${ARGV0} STATIC
${PCH_SOURCES}
${HEADER_FILES}
${NOT_COMPILED_SOURCE_FILES}
)
endmacro()
require_stricmp()
require_strnicmp()
unset( PCH_SOURCES )
unset( HEADER_FILES )

View file

@ -146,12 +146,12 @@ struct usermaphack_t
uint8_t md4[16]{};
};
EXTERN spriteext_t *spriteext;
EXTERN spritesmooth_t *spritesmooth;
extern spriteext_t spriteext[MAXSPRITES];
extern spritesmooth_t spritesmooth[MAXSPRITES + MAXUNIQHUDID];
EXTERN sectortype *sector;
EXTERN walltype *wall;
EXTERN spritetype *sprite;
extern sectortype sector[MAXSECTORS];
extern walltype wall[MAXWALLS];
extern spritetype sprite[MAXSPRITES];
EXTERN int leveltimer;
extern sectortype sectorbackup[MAXSECTORS];
@ -339,7 +339,6 @@ typedef struct artheader_t {
} artheader_t;
#define ARTv1_UNITOFFSET 24 // using sizeof does not work because picanm_t is not the in-file format.
int32_t enginePreInit(void); // a partial setup of the engine used for launch windows
int32_t engineInit(void);
void engineUnInit(void);
void initspritelists(void);

View file

@ -197,6 +197,7 @@ enum
CSTAT_SPRITE_ALIGNMENT_WALL = 1u<<4u,
CSTAT_SPRITE_ALIGNMENT_FLOOR = 1u<<5u,
CSTAT_SPRITE_ALIGNMENT_SLAB = 1u<<4u | 1u<<5u,
CSTAT_SPRITE_ALIGNMENT_SLOPE = 1u << 4u | 1u << 5u,
CSTAT_SPRITE_ALIGNMENT_MASK = 1u<<4u | 1u<<5u,
};
@ -268,6 +269,9 @@ struct spritetype
int16_t extra;
int16_t detail;
int time;
int16_t wall;
int8_t wdist;
#if 0
// make sure we do not accidentally copy this

View file

@ -1081,6 +1081,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum,
const int32_t cstat = sprite[j].cstat;
int32_t daz, daz2;
if (cstat & CSTAT_SPRITE_INVISIBLE) continue;
if (cstat&dasprclipmask)
{
int32_t clipyou = 0;

View file

@ -41,6 +41,13 @@
#include "gl_renderer.h"
#endif
spriteext_t spriteext[MAXSPRITES];
spritesmooth_t spritesmooth[MAXSPRITES + MAXUNIQHUDID];
sectortype sector[MAXSECTORS];
walltype wall[MAXWALLS];
spritetype sprite[MAXSPRITES];
int32_t r_rortexture = 0;
int32_t r_rortexturerange = 0;
int32_t r_rorphase = 0;
@ -625,27 +632,6 @@ const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits,
}
//
// preinitengine
//
static spriteext_t spriteext_s[MAXSPRITES+MAXUNIQHUDID];
static spritesmooth_t spritesmooth_s[MAXSPRITES+MAXUNIQHUDID];
static sectortype sector_s[MAXSECTORS];
static walltype wall_s[MAXWALLS];
spritetype sprite_s[MAXSPRITES];
int32_t enginePreInit(void)
{
sector = sector_s;
wall = wall_s;
sprite = sprite_s;
spriteext = spriteext_s;
spritesmooth = spritesmooth_s;
return 0;
}
//
// initengine
//
@ -653,7 +639,6 @@ int32_t engineInit(void)
{
engineLoadTables();
g_visibility = 512;
if (!mdinited) mdinit();
return 0;
}

View file

@ -173,9 +173,8 @@ void DrawChar(F2DDrawer *drawer, FFont* font, int normalcolor, double x, double
FGameTexture* pic;
int dummy;
bool redirected;
if (NULL != (pic = font->GetChar(character, normalcolor, &dummy, &redirected)))
if (NULL != (pic = font->GetChar(character, normalcolor, &dummy)))
{
DrawParms parms;
Va_List tags;
@ -186,9 +185,9 @@ void DrawChar(F2DDrawer *drawer, FFont* font, int normalcolor, double x, double
{
return;
}
bool palettetrans = (normalcolor == CR_UNDEFINED && parms.TranslationId != 0);
bool palettetrans = (normalcolor == CR_NATIVEPAL && parms.TranslationId != 0);
PalEntry color = 0xffffffff;
if (!palettetrans) parms.TranslationId = redirected ? -1 : font->GetColorTranslation((EColorRange)normalcolor, &color);
if (!palettetrans) parms.TranslationId = font->GetColorTranslation((EColorRange)normalcolor, &color);
parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255);
drawer->AddTexture(pic, parms);
}
@ -204,17 +203,16 @@ void DrawChar(F2DDrawer *drawer, FFont *font, int normalcolor, double x, double
FGameTexture *pic;
int dummy;
bool redirected;
if (NULL != (pic = font->GetChar(character, normalcolor, &dummy, &redirected)))
if (NULL != (pic = font->GetChar(character, normalcolor, &dummy)))
{
DrawParms parms;
uint32_t tag = ListGetInt(args);
bool res = ParseDrawTextureTags(drawer, pic, x, y, tag, args, &parms, false);
if (!res) return;
bool palettetrans = (normalcolor == CR_UNDEFINED && parms.TranslationId != 0);
bool palettetrans = (normalcolor == CR_NATIVEPAL && parms.TranslationId != 0);
PalEntry color = 0xffffffff;
if (!palettetrans) parms.TranslationId = redirected ? -1 : font->GetColorTranslation((EColorRange)normalcolor, &color);
if (!palettetrans) parms.TranslationId = font->GetColorTranslation((EColorRange)normalcolor, &color);
parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255);
drawer->AddTexture(pic, parms);
}
@ -267,7 +265,7 @@ void DrawTextCommon(F2DDrawer *drawer, FFont *font, int normalcolor, double x, d
if (parms.celly == 0) parms.celly = font->GetHeight() + 1;
parms.celly = int (parms.celly * scaley);
bool palettetrans = (normalcolor == CR_UNDEFINED && parms.TranslationId != 0);
bool palettetrans = (normalcolor == CR_NATIVEPAL && parms.TranslationId != 0);
if (normalcolor >= NumTextColors)
normalcolor = CR_UNTRANSLATED;
@ -316,11 +314,10 @@ void DrawTextCommon(F2DDrawer *drawer, FFont *font, int normalcolor, double x, d
continue;
}
bool redirected = false;
if (NULL != (pic = font->GetChar(c, currentcolor, &w, &redirected)))
if (NULL != (pic = font->GetChar(c, currentcolor, &w)))
{
// if palette translation is used, font colors will be ignored.
if (!palettetrans) parms.TranslationId = redirected? -1 : trans;
if (!palettetrans) parms.TranslationId = trans;
SetTextureParms(drawer, &parms, pic, cx, cy);
if (parms.cellx)
{

View file

@ -102,6 +102,11 @@ void S_SetMusicCallbacks(MusicCallbacks* cb)
if (mus_cb.OpenMusic == nullptr) mus_cb.OpenMusic = DefaultOpenMusic; // without this we are dead in the water.
}
int MusicEnabled() // int return is for scripting
{
return mus_enabled && !nomusic;
}
//==========================================================================
//
//
@ -629,7 +634,7 @@ static void CheckReplayGain(const char *musicname, EMidiDevice playertype, const
bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force)
{
if (nomusic) return false; // skip the entire procedure if music is globally disabled.
if (!MusicEnabled()) return false; // skip the entire procedure if music is globally disabled.
if (!force && PlayList.GetNumSongs())
{ // Don't change if a playlist is active

View file

@ -11,6 +11,7 @@ class FileReader;
class SoundStream;
int MusicEnabled();
typedef bool(*StreamCallback)(SoundStream* stream, void* buff, int len, void* userdata);
SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, StreamCallback cb, void *userdata);
void S_StopCustomStream(SoundStream* stream);

View file

@ -43,7 +43,14 @@
#include "s_music.h"
#include "m_random.h"
#include "printf.h"
#include "c_cvars.h"
CVARD(Bool, snd_enabled, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enables/disables sound effects")
int SoundEnabled()
{
return snd_enabled && !nosound && !nosfx;
}
enum
{
@ -382,7 +389,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
FVector3 pos, vel;
FRolloffInfo *rolloff;
if (sound_id <= 0 || volume <= 0 || nosfx || nosound || blockNewSounds)
if (sound_id <= 0 || volume <= 0 || nosfx || !SoundEnabled() || blockNewSounds)
return NULL;
// prevent crashes.

View file

@ -429,3 +429,5 @@ inline int S_FindSound(const char* name)
{
return soundEngine->FindSound(name);
}
int SoundEnabled();

View file

@ -98,8 +98,7 @@ unsigned FCommandBuffer::CalcCellSize(unsigned length)
unsigned cellcount = 0;
for (unsigned i = 0; i < length; i++)
{
int w;
NewConsoleFont->GetChar(Text[i], CR_UNTRANSLATED, &w);
int w = NewConsoleFont->GetCharWidth(Text[i]);
cellcount += w / 9;
}
return cellcount;
@ -112,8 +111,7 @@ unsigned FCommandBuffer::CharsForCells(unsigned cellin, bool *overflow)
int cells = cellin;
while (cells > 0)
{
int w;
NewConsoleFont->GetChar(Text[chars++], CR_UNTRANSLATED, &w);
int w = NewConsoleFont->GetCharWidth(Text[chars++]);
cells -= w / 9;
}
*overflow = (cells < 0);

View file

@ -592,8 +592,7 @@ void C_DrawConsole ()
oldbottom = ConBottom;
if (ConsoleState == c_up && gamestate != GS_INTRO && gamestate != GS_INTERMISSION &&
gamestate != GS_FULLCONSOLE && gamestate != GS_MENUSCREEN)
if (ConsoleState == c_up && gamestate == GS_LEVEL)
{
if (NotifyStrings) NotifyStrings->Draw();
return;
@ -731,7 +730,7 @@ void C_ToggleConsole ()
}
if (gamestate == GS_MENUSCREEN)
{
gameaction = ga_fullconsole;
if (sysCallbacks.ToggleFullConsole) sysCallbacks.ToggleFullConsole();
togglestate = c_down;
}
else if (!chatmodeon && (ConsoleState == c_up || ConsoleState == c_rising) && menuactive == MENU_Off)

View file

@ -32,7 +32,6 @@
*/
#include "types.h"
#include "build.h"
#include "screenjob.h"
#include "i_time.h"
#include "v_2ddrawer.h"
@ -41,16 +40,13 @@
#include "s_soundinternal.h"
#include "animtexture.h"
#include "gamestate.h"
#include "razemenu.h"
#include "raze_sound.h"
#include "SmackerDecoder.h"
#include "movie/playmve.h"
#include "gamecontrol.h"
#include "playmve.h"
#include <vpx/vpx_decoder.h>
#include <vpx/vp8dx.h>
#include "raze_music.h"
#include "filesystem.h"
#include "vm.h"
#include "printf.h"
class MoviePlayer
{
@ -143,7 +139,7 @@ public:
int sound = animSnd[i+1];
if (sound == -1)
soundEngine->StopAllChannels();
else if (SoundEnabled())
else
soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, nostopsound? CHANF_UI : CHANF_NONE, sound, 1.f, ATTN_NONE);
}
}
@ -419,7 +415,7 @@ public:
{
if (soundtrack > 0)
{
Mus_Play(fileSystem.GetFileFullName(soundtrack, false), false);
S_ChangeMusic(fileSystem.GetFileFullName(soundtrack, false), 0, false);
}
animtex.SetSize(AnimTexture::YUV, width, height);
}
@ -462,7 +458,7 @@ public:
int sound = animSnd[i + 1];
if (sound == -1)
soundEngine->StopAllChannels();
else if (SoundEnabled())
else
soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, nostopsound ? CHANF_UI : CHANF_NONE, sound, 1.f, ATTN_NONE);
}
}
@ -475,7 +471,7 @@ public:
void Stop()
{
Mus_Stop();
S_StopMusic(true);
bool nostopsound = (flags & NOSOUNDCUTOFF);
if (!nostopsound) soundEngine->StopAllChannels();
}
@ -624,7 +620,7 @@ public:
Smacker_GetPalette(hSMK, palette);
Smacker_GetFrame(hSMK, pFrame.Data());
animtex.SetFrame(palette, pFrame.Data());
if (numAudioTracks)
if (numAudioTracks && SoundEnabled())
{
auto read = Smacker_GetAudioData(hSMK, 0, (int16_t*)audioBuffer.Data());
if (adata.inf.bitsPerSample == 8) copy8bitSamples(read);
@ -648,7 +644,7 @@ public:
int sound = animSnd[i + 1];
if (sound == -1)
soundEngine->StopAllChannels();
else if (SoundEnabled())
else
soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, nostopsound ? CHANF_UI : CHANF_NONE, sound, 1.f, ATTN_NONE);
}
}
@ -756,7 +752,10 @@ MoviePlayer* OpenMovie(const char* filename, TArray<int>& ans, const int* framet
delete anm;
return nullptr;
}
anm->soundtrack = LookupMusic(filename, true);
// VPX files have no sound track, so look for a same-named sound file with a known extension as the soundtrack to be played.
static const char* knownSoundExts[] = { "OGG", "FLAC", "MP3", "OPUS", "WAV" };
FString name = StripExtension(filename);
anm->soundtrack = fileSystem.FindFileWithExtensions(name, knownSoundExts, countof(knownSoundExts));
return anm;
}
// add more formats here.
@ -798,7 +797,9 @@ DEFINE_ACTION_FUNCTION(_MoviePlayer, Create)
DEFINE_ACTION_FUNCTION(_MoviePlayer, Start)
{
PARAM_SELF_STRUCT_PROLOGUE(MoviePlayer);
I_FreezeTime(true);
self->Start();
I_FreezeTime(false);
return 0;
}

View file

@ -0,0 +1,365 @@
/*
** screenjob.cpp
**
** Generic cutscene display
**
**---------------------------------------------------------------------------
** Copyright 2020 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include "types.h"
#include "screenjob.h"
#include "i_time.h"
#include "v_2ddrawer.h"
#include "animlib.h"
#include "v_draw.h"
#include "s_soundinternal.h"
#include "animtexture.h"
#include "gamestate.h"
#include "vm.h"
#include "c_bind.h"
#include "c_console.h"
#include "gamestate.h"
#include "printf.h"
#include "c_dispatch.h"
#include "s_music.h"
#include "m_argv.h"
#include "i_interface.h"
CVAR(Bool, inter_subtitles, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
DObject* runner;
PClass* runnerclass;
PType* runnerclasstype;
CompletionFunc completion;
static int ticks;
//=============================================================================
//
//
//
//=============================================================================
void Job_Init()
{
static bool done = false;
if (!done)
{
done = true;
GC::AddMarkerFunc([] { GC::Mark(runner); });
}
runnerclass = PClass::FindClass("ScreenJobRunner");
if (!runnerclass) I_FatalError("ScreenJobRunner not defined");
runnerclasstype = NewPointer(runnerclass);
}
//=============================================================================
//
//
//
//=============================================================================
VMFunction* LookupFunction(const char* qname, bool validate)
{
size_t p = strcspn(qname, ".");
if (p == 0) I_Error("Call to undefined function %s", qname);
FString clsname(qname, p);
FString funcname = qname + p + 1;
auto func = PClass::FindFunction(clsname, funcname);
if (func == nullptr) I_Error("Call to undefined function %s", qname);
if (validate)
{
// these conditions must be met by all functions for this interface.
if (func->Proto->ReturnTypes.Size() != 0) I_Error("Bad cutscene function %s. Return value not allowed", qname);
if (func->ImplicitArgs != 0) I_Error("Bad cutscene function %s. Must be static", qname);
}
return func;
}
//=============================================================================
//
//
//
//=============================================================================
void CallCreateFunction(const char* qname, DObject* runner)
{
auto func = LookupFunction(qname);
if (func->Proto->ArgumentTypes.Size() != 1) I_Error("Bad cutscene function %s. Must receive precisely one argument.", qname);
if (func->Proto->ArgumentTypes[0] != runnerclasstype) I_Error("Bad cutscene function %s. Must receive ScreenJobRunner reference.", qname);
VMValue val = runner;
VMCall(func, &val, 1, nullptr, 0);
}
//=============================================================================
//
//
//
//=============================================================================
DObject* CreateRunner(bool clearbefore)
{
auto obj = runnerclass->CreateNew();
auto func = LookupFunction("ScreenJobRunner.Init", false);
VMValue val[3] = { obj, clearbefore, false };
VMCall(func, val, 3, nullptr, 0);
return obj;
}
//=============================================================================
//
//
//
//=============================================================================
void AddGenericVideo(DObject* runner, const FString& fn, int soundid, int fps)
{
auto obj = runnerclass->CreateNew();
auto func = LookupFunction("ScreenJobRunner.AddGenericVideo", false);
VMValue val[] = { runner, &fn, soundid, fps };
VMCall(func, val, 4, nullptr, 0);
}
//=============================================================================
//
//
//
//=============================================================================
int CutsceneDef::GetSound()
{
int id = -1;
if (soundName.IsNotEmpty()) id = soundEngine->FindSound(soundName);
if (id <= 0) id = soundEngine->FindSoundByResID(soundID);
return id;
}
void CutsceneDef::Create(DObject* runner)
{
if (function.IsNotEmpty())
{
CallCreateFunction(function, runner);
}
else if (video.IsNotEmpty())
{
AddGenericVideo(runner, video, GetSound(), framespersec);
}
}
//=============================================================================
//
//
//
//=============================================================================
void DeleteScreenJob()
{
if (runner) runner->Destroy();
runner = nullptr;
}
void EndScreenJob()
{
DeleteScreenJob();
if (completion) completion(false);
completion = nullptr;
}
//=============================================================================
//
//
//
//=============================================================================
bool ScreenJobResponder(event_t* ev)
{
if (ev->type == EV_KeyDown)
{
// We never reach the key binding checks in G_Responder, so for the console we have to check for ourselves here.
auto binding = Bindings.GetBinding(ev->data1);
if (binding.CompareNoCase("toggleconsole") == 0)
{
C_ToggleConsole();
return true;
}
}
FInputEvent evt = ev;
if (runner)
{
IFVIRTUALPTRNAME(runner, NAME_ScreenJobRunner, OnEvent)
{
int result = 0;
VMValue parm[] = { runner, &evt };
VMReturn ret(&result);
VMCall(func, parm, 2, &ret, 1);
return result;
}
}
return false;
}
//=============================================================================
//
//
//
//=============================================================================
bool ScreenJobTick()
{
ticks++;
if (runner)
{
IFVIRTUALPTRNAME(runner, NAME_ScreenJobRunner, OnTick)
{
int result = 0;
VMValue parm[] = { runner };
VMReturn ret(&result);
VMCall(func, parm, 1, &ret, 1);
return result;
}
}
return false;
}
//=============================================================================
//
//
//
//=============================================================================
void ScreenJobDraw()
{
double smoothratio = I_GetTimeFrac();
if (runner)
{
twod->ClearScreen();
IFVIRTUALPTRNAME(runner, NAME_ScreenJobRunner, RunFrame)
{
VMValue parm[] = { runner, smoothratio };
VMCall(func, parm, 2, nullptr, 0);
}
}
}
//=============================================================================
//
//
//
//=============================================================================
bool ScreenJobValidate()
{
if (runner)
{
IFVIRTUALPTRNAME(runner, NAME_ScreenJobRunner, Validate)
{
int res;
VMValue parm[] = { runner };
VMReturn ret(&res);
VMCall(func, parm, 1, &ret, 1);
I_ResetFrameTime();
return res;
}
}
return false;
}
//=============================================================================
//
//
//
//=============================================================================
bool StartCutscene(CutsceneDef& cs, int flags, const CompletionFunc& completion_)
{
if ((cs.function.IsNotEmpty() || cs.video.IsNotEmpty()) && cs.function.CompareNoCase("none") != 0)
{
completion = completion_;
runner = CreateRunner();
GC::WriteBarrier(runner);
try
{
cs.Create(runner);
if (!ScreenJobValidate())
{
runner->Destroy();
runner = nullptr;
return false;
}
if (sysCallbacks.StartCutscene) sysCallbacks.StartCutscene(flags & SJ_BLOCKUI);
}
catch (...)
{
if (runner) runner->Destroy();
runner = nullptr;
throw;
}
return true;
}
return false;
}
bool StartCutscene(const char* s, int flags, const CompletionFunc& completion)
{
CutsceneDef def;
def.function = s;
return StartCutscene(def, 0, completion);
}
//=============================================================================
//
//
//
//=============================================================================
CCMD(testcutscene)
{
if (argv.argc() < 2)
{
Printf("Usage: testcutscene <buildfunction>\n");
return;
}
try
{
if (StartCutscene(argv[1], 0, [](bool) {}))
{
C_HideConsole();
}
}
catch (const CRecoverableError& err)
{
Printf(TEXTCOLOR_RED "Unable to play cutscene: %s\n", err.what());
}
}

View file

@ -0,0 +1,56 @@
#pragma once
#include <functional>
#include "dobject.h"
#include "v_2ddrawer.h"
#include "d_eventbase.h"
#include "s_soundinternal.h"
#include "gamestate.h"
#include "zstring.h"
#include "c_cvars.h"
EXTERN_CVAR(Bool, inter_subtitles)
using CompletionFunc = std::function<void(bool)>;
void Job_Init();
enum
{
SJ_BLOCKUI = 1,
};
struct CutsceneDef
{
FString video;
FString function;
FString soundName;
int soundID = -1; // ResID not SoundID!
int framespersec = 0; // only relevant for ANM.
bool transitiononly = false; // only play when transitioning between maps, but not when starting on a map or ending a game.
void Create(DObject* runner);
bool isdefined() { return video.IsNotEmpty() || function.IsNotEmpty(); }
int GetSound();
};
void EndScreenJob();
void DeleteScreenJob();
bool ScreenJobResponder(event_t* ev);
bool ScreenJobTick();
void ScreenJobDraw();
bool ScreenJobValidate();
struct CutsceneDef;
bool StartCutscene(const char* s, int flags, const CompletionFunc& completion);
bool StartCutscene(CutsceneDef& cs, int flags, const CompletionFunc& completion_);
VMFunction* LookupFunction(const char* qname, bool validate = true);
void CallCreateFunction(const char* qname, DObject* runner);
DObject* CreateRunner(bool clearbefore = true);
void AddGenericVideo(DObject* runner, const FString& fn, int soundid, int fps);
extern DObject* runner;
extern PClass* runnerclass;
extern PType* runnerclasstype;
extern CompletionFunc completion;

View file

@ -0,0 +1,28 @@
#pragma once
// The current state of the game: whether we are
// playing, gazing at the intermission screen,
// the game final animation, or a demo.
enum gamestate_t : int
{
GS_LEVEL,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN,
GS_FULLCONSOLE, // [RH] Fullscreen console
GS_HIDECONSOLE, // [RH] The menu just did something that should hide fs console
GS_STARTUP, // [RH] Console is fullscreen, and game is just starting
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
GS_INTRO,
GS_CUTSCENE,
GS_MENUSCREEN = GS_DEMOSCREEN,
GS_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2,
GS_FORCEWIPEBURN = -3,
GS_FORCEWIPEMELT = -4
};
extern gamestate_t gamestate;

View file

@ -31,7 +31,9 @@ struct SystemCallbacks
bool (*CheckMenudefOption)(const char* opt);
void (*ConsoleToggled)(int state);
bool (*PreBindTexture)(FRenderState* state, FGameTexture*& tex, EUpscaleFlags& flags, int& scaleflags, int& clampmode, int& translation, int& overrideshader);
void (*FontCharCreated)(FGameTexture* base, FGameTexture* untranslated, FGameTexture* translated);
void (*FontCharCreated)(FGameTexture* base, FGameTexture* untranslated);
void (*ToggleFullConsole)();
void (*StartCutscene)(bool blockui);
};
extern SystemCallbacks sysCallbacks;

View file

@ -70,12 +70,26 @@ inline constexpr uint32_t TRANSLATION(uint8_t a, uint32_t b)
{
return (a << TRANSLATION_SHIFT) | b;
}
inline constexpr uint32_t LuminosityTranslation(int range, uint8_t min, uint8_t max)
{
// ensure that the value remains positive.
return ( (1 << 30) | ((range&0x3fff) << 16) | (min << 8) | max );
}
inline constexpr bool IsLuminosityTranslation(int trans)
{
return trans > 0 && (trans & (1 << 30));
}
inline constexpr int GetTranslationType(uint32_t trans)
{
assert(!IsLuminosityTranslation(trans));
return (trans & TRANSLATIONTYPE_MASK) >> TRANSLATION_SHIFT;
}
inline constexpr int GetTranslationIndex(uint32_t trans)
{
assert(!IsLuminosityTranslation(trans));
return (trans & TRANSLATION_MASK);
}

View file

@ -513,6 +513,26 @@ size_t FStringTable::ProcessEscapes (char *iptr)
c = '\r';
else if (c == 't')
c = '\t';
else if (c == 'x')
{
c = 0;
for (int i = 0; i < 2; i++)
{
char cc = *iptr++;
if (cc >= '0' && cc <= '9')
c = (c << 4) + cc - '0';
else if (cc >= 'a' && cc <= 'f')
c = (c << 4) + 10 + cc - 'a';
else if (cc >= 'A' && cc <= 'F')
c = (c << 4) + 10 + cc - 'A';
else
{
iptr--;
break;
}
}
if (c == 0) continue;
}
else if (c == '\n')
continue;
}

View file

@ -635,7 +635,7 @@ int FileSystem::GetNumForFullName (const char *name)
//
// FindFile
//
// Looks up a file by name, either eith or without path and extension
// Looks up a file by name, either with or without path and extension
//
//==========================================================================

View file

@ -70,6 +70,7 @@
//==========================================================================
FFont::FFont (const char *name, const char *nametemplate, const char *filetemplate, int lfirst, int lcount, int start, int fdlump, int spacewidth, bool notranslate, bool iwadonly, bool doomtemplate, GlyphSet *baseGlyphs)
: FFont(fdlump, name)
{
int i;
FTextureID lump;
@ -77,18 +78,9 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
DVector2 Scale = { 1, 1 };
noTranslate = notranslate;
Lump = fdlump;
GlobalKerning = false;
FontName = name;
Next = FirstFont;
FirstFont = this;
Cursor = '_';
ActiveColors = 0;
SpaceWidth = 0;
FontHeight = 0;
uint8_t pp = 0;
for (auto &p : PatchRemap) p = pp++;
translateUntranslated = false;
int FixedWidth = 0;
TMap<int, FGameTexture*> charMap;
@ -127,6 +119,11 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
sc.MustGetValue(false);
GlobalKerning = sc.Number;
}
if (sc.Compare("Altfont"))
{
sc.MustGetString();
AltFontName = sc.String;
}
else if (sc.Compare("Scale"))
{
sc.MustGetValue(true);
@ -155,6 +152,16 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
sc.MustGetValue(false);
FontHeight = sc.Number;
}
else if (sc.Compare("minluminosity"))
{
sc.MustGetValue(false);
MinLum = (int16_t)clamp(sc.Number, 0, 255);
}
else if (sc.Compare("maxluminosity"))
{
sc.MustGetValue(false);
MaxLum = (int16_t)clamp(sc.Number, 0, 255);
}
else if (sc.Compare("Translationtype"))
{
sc.MustGetToken(TK_Identifier);
@ -303,7 +310,6 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
auto count = maxchar - minchar + 1;
Chars.Resize(count);
int fontheight = 0;
int asciiheight = 0;
for (i = 0; i < count; i++)
{
@ -321,10 +327,6 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
{
fontheight = height;
}
if (height > asciiheight && FirstChar + 1 < 128)
{
asciiheight = height;
}
}
auto orig = pic->GetTexture();
@ -333,23 +335,13 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
TexMan.AddGameTexture(tex);
Chars[i].OriginalPic = tex;
if (!noTranslate)
{
Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1(orig->GetImage())), nullptr, ETextureType::FontChar);
Chars[i].TranslatedPic->CopySize(pic, true);
TexMan.AddGameTexture(Chars[i].TranslatedPic);
}
else
{
Chars[i].TranslatedPic = tex;
}
if (sysCallbacks.FontCharCreated) sysCallbacks.FontCharCreated(pic, Chars[i].OriginalPic, Chars[i].TranslatedPic);
if (sysCallbacks.FontCharCreated) sysCallbacks.FontCharCreated(pic, Chars[i].OriginalPic);
Chars[i].XMove = (int)Chars[i].TranslatedPic->GetDisplayWidth();
Chars[i].XMove = (int)Chars[i].OriginalPic->GetDisplayWidth();
}
else
{
Chars[i].TranslatedPic = nullptr;
Chars[i].OriginalPic = nullptr;
Chars[i].XMove = INT_MIN;
}
}
@ -360,7 +352,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
{
SpaceWidth = spacewidth;
}
else if ('N' - FirstChar >= 0 && 'N' - FirstChar < count && Chars['N' - FirstChar].TranslatedPic != nullptr)
else if ('N' - FirstChar >= 0 && 'N' - FirstChar < count && Chars['N' - FirstChar].OriginalPic != nullptr)
{
SpaceWidth = (Chars['N' - FirstChar].XMove + 1) / 2;
}
@ -370,7 +362,6 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
}
}
if (FontHeight == 0) FontHeight = fontheight;
if (AsciiHeight == 0) AsciiHeight = asciiheight;
FixXMoves();
}
@ -444,11 +435,7 @@ void FFont::ReadSheetFont(TArray<FolderEntry> &folderdata, int width, int height
Chars[i].OriginalPic = (*lump)->GetUseType() == ETextureType::FontChar? (*lump) : MakeGameTexture(pic, nullptr, ETextureType::FontChar);
Chars[i].OriginalPic->SetUseType(ETextureType::FontChar);
Chars[i].OriginalPic->CopySize(*lump, true);
Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1(pic->GetImage())), nullptr, ETextureType::FontChar);
Chars[i].TranslatedPic->CopySize(*lump, true);
Chars[i].TranslatedPic->SetUseType(ETextureType::FontChar);
if (Chars[i].OriginalPic != *lump) TexMan.AddGameTexture(Chars[i].OriginalPic);
TexMan.AddGameTexture(Chars[i].TranslatedPic);
}
Chars[i].XMove = width;
}
@ -458,7 +445,7 @@ void FFont::ReadSheetFont(TArray<FolderEntry> &folderdata, int width, int height
// Move the Windows-1252 characters to their proper place.
for (int i = 0x80; i < 0xa0; i++)
{
if (win1252map[i - 0x80] != i && Chars[i - minchar].TranslatedPic != nullptr && Chars[win1252map[i - 0x80] - minchar].TranslatedPic == nullptr)
if (win1252map[i - 0x80] != i && Chars[i - minchar].OriginalPic != nullptr && Chars[win1252map[i - 0x80] - minchar].OriginalPic == nullptr)
{
std::swap(Chars[i - minchar], Chars[win1252map[i - 0x80] - minchar]);
}
@ -509,24 +496,24 @@ void FFont::CheckCase()
}
if (myislower(chr))
{
if (Chars[i].TranslatedPic != nullptr) lowercount++;
if (Chars[i].OriginalPic != nullptr) lowercount++;
}
else
{
if (Chars[i].TranslatedPic != nullptr) uppercount++;
if (Chars[i].OriginalPic != nullptr) uppercount++;
}
}
if (lowercount == 0) return; // This is an uppercase-only font and we are done.
// The ß needs special treatment because it is far more likely to be supplied lowercase only, even in an uppercase font.
if (Chars[0xdf - FirstChar].TranslatedPic != nullptr)
if (Chars[0xdf - FirstChar].OriginalPic != nullptr)
{
if (LastChar < 0x1e9e)
{
Chars.Resize(0x1e9f - FirstChar);
LastChar = 0x1e9e;
}
if (Chars[0x1e9e - FirstChar].TranslatedPic == nullptr)
if (Chars[0x1e9e - FirstChar].OriginalPic == nullptr)
{
std::swap(Chars[0xdf - FirstChar], Chars[0x1e9e - FirstChar]);
lowercount--;
@ -596,75 +583,14 @@ void FFont::RecordAllTextureColors(uint32_t *usedcolors)
{
for (unsigned int i = 0; i < Chars.Size(); i++)
{
if (Chars[i].TranslatedPic)
if (Chars[i].OriginalPic)
{
FFontChar1 *pic = static_cast<FFontChar1 *>(Chars[i].TranslatedPic->GetTexture()->GetImage());
if (pic)
{
// The remap must be temporarily reset here because this can be called on an initialized font.
auto sr = pic->ResetSourceRemap();
RecordTextureColors(pic, usedcolors);
pic->SetSourceRemap(sr);
}
auto pic = Chars[i].OriginalPic->GetTexture()->GetImage();
if (pic) RecordTextureColors(pic, usedcolors);
}
}
}
//==========================================================================
//
// SetDefaultTranslation
//
// Builds a translation to map the stock font to a mod provided replacement.
//
//==========================================================================
void FFont::SetDefaultTranslation(uint32_t *othercolors)
{
uint32_t mycolors[256] = {};
RecordAllTextureColors(mycolors);
uint8_t mytranslation[256], othertranslation[256], myreverse[256], otherreverse[256];
TArray<double> myluminosity, otherluminosity;
SimpleTranslation(mycolors, mytranslation, myreverse, myluminosity);
SimpleTranslation(othercolors, othertranslation, otherreverse, otherluminosity);
FRemapTable remap(ActiveColors);
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (unsigned l = 1; l < myluminosity.Size(); l++)
{
for (unsigned o = 1; o < otherluminosity.Size()-1; o++) // luminosity[0] is for the transparent color
{
if (myluminosity[l] >= otherluminosity[o] && myluminosity[l] <= otherluminosity[o+1])
{
PalEntry color1 = GPalette.BaseColors[otherreverse[o]];
PalEntry color2 = GPalette.BaseColors[otherreverse[o+1]];
double weight = 0;
if (otherluminosity[o] != otherluminosity[o + 1])
{
weight = (myluminosity[l] - otherluminosity[o]) / (otherluminosity[o + 1] - otherluminosity[o]);
}
int r = int(color1.r + weight * (color2.r - color1.r));
int g = int(color1.g + weight * (color2.g - color1.g));
int b = int(color1.b + weight * (color2.b - color1.b));
r = clamp(r, 0, 255);
g = clamp(g, 0, 255);
b = clamp(b, 0, 255);
remap.Remap[l] = ColorMatcher.Pick(r, g, b);
remap.Palette[l] = PalEntry(255, r, g, b);
break;
}
}
}
Translations[CR_UNTRANSLATED] = GPalette.StoreTranslation(TRANSLATION_Internal, &remap);
forceremap = true;
}
//==========================================================================
//
// compare
@ -688,160 +614,40 @@ static int compare (const void *arg1, const void *arg2)
//==========================================================================
//
// FFont :: SimpleTranslation
//
// Colorsused, translation, and reverse must all be 256 entry buffers.
// Colorsused must already be filled out.
// Translation be set to remap the source colors to a new range of
// consecutive colors based at 1 (0 is transparent).
// Reverse will be just the opposite of translation: It maps the new color
// range to the original colors.
// *Luminosity will be an array just large enough to hold the brightness
// levels of all the used colors, in consecutive order. It is sorted from
// darkest to lightest and scaled such that the darkest color is 0.0 and
// the brightest color is 1.0.
// The return value is the number of used colors and thus the number of
// entries in *luminosity.
// FFont :: GetLuminosity
//
//==========================================================================
int FFont::SimpleTranslation (uint32_t *colorsused, uint8_t *translation, uint8_t *reverse, TArray<double> &Luminosity)
int FFont::GetLuminosity (uint32_t *colorsused, TArray<double> &Luminosity, int* minlum, int* maxlum)
{
double min, max, diver;
int i, j;
memset (translation, 0, 256);
reverse[0] = 0;
for (i = 1, j = 1; i < 256; i++)
{
if (colorsused[i])
{
reverse[j++] = i;
}
}
qsort (reverse+1, j-1, 1, compare);
Luminosity.Resize(j);
Luminosity.Resize(256);
Luminosity[0] = 0.0; // [BL] Prevent uninitalized memory
max = 0.0;
min = 100000000.0;
for (i = 1; i < j; i++)
for (int i = 1; i < 256; i++)
{
translation[reverse[i]] = i;
Luminosity[i] = RPART(GPalette.BaseColors[reverse[i]]) * 0.299 +
GPART(GPalette.BaseColors[reverse[i]]) * 0.587 +
BPART(GPalette.BaseColors[reverse[i]]) * 0.114;
if (Luminosity[i] > max)
max = Luminosity[i];
if (Luminosity[i] < min)
min = Luminosity[i];
if (colorsused[i])
{
Luminosity[i] = GPalette.BaseColors[i].r * 0.299 + GPalette.BaseColors[i].g * 0.587 + GPalette.BaseColors[i].b * 0.114;
if (Luminosity[i] > max) max = Luminosity[i];
if (Luminosity[i] < min) min = Luminosity[i];
}
else Luminosity[i] = -1; // this color is not of interest.
}
diver = 1.0 / (max - min);
for (i = 1; i < j; i++)
for (int i = 1; i < 256; i++)
{
Luminosity[i] = (Luminosity[i] - min) * diver;
if (colorsused[i])
{
Luminosity[i] = (Luminosity[i] - min) * diver;
}
}
if (minlum) *minlum = int(min);
if (maxlum) *maxlum = int(max);
return j;
}
//==========================================================================
//
// FFont :: BuildTranslations
//
// Build color translations for this font. Luminosity is an array of
// brightness levels. The ActiveColors member must be set to indicate how
// large this array is. Identity is an array that remaps the colors to
// their original values; it is only used for CR_UNTRANSLATED. Ranges
// is an array of TranslationParm structs defining the ranges for every
// possible color, in order. Palette is the colors to use for the
// untranslated version of the font.
//
//==========================================================================
void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity,
const void *ranges, int total_colors, const PalEntry *palette, std::function<void(FRemapTable*)> post)
{
int i, j;
const TranslationParm *parmstart = (const TranslationParm *)ranges;
FRemapTable remap(total_colors);
remap.ForFont = true;
// Create different translations for different color ranges
Translations.Clear();
for (i = 0; i < NumTextColors; i++)
{
if (i == CR_UNTRANSLATED)
{
if (identity != nullptr)
{
memcpy(remap.Remap, identity, ActiveColors);
if (palette != nullptr)
{
memcpy(remap.Palette, palette, ActiveColors * sizeof(PalEntry));
}
else
{
remap.Palette[0] = GPalette.BaseColors[identity[0]] & MAKEARGB(0, 255, 255, 255);
for (j = 1; j < ActiveColors; ++j)
{
remap.Palette[j] = GPalette.BaseColors[identity[j]] | MAKEARGB(255, 0, 0, 0);
}
}
Translations.Push(GPalette.StoreTranslation(TRANSLATION_Internal, &remap));
}
else
{
Translations.Push(Translations[0]);
}
continue;
}
assert(parmstart->RangeStart >= 0);
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (j = 1; j < ActiveColors; j++)
{
int v = int(luminosity[j] * 256.0);
// Find the color range that this luminosity value lies within.
const TranslationParm *parms = parmstart - 1;
do
{
parms++;
if (parms->RangeStart <= v && parms->RangeEnd >= v)
break;
}
while (parms[1].RangeStart > parms[0].RangeEnd);
// Linearly interpolate to find out which color this luminosity level gets.
int rangev = ((v - parms->RangeStart) << 8) / (parms->RangeEnd - parms->RangeStart);
int r = ((parms->Start[0] << 8) + rangev * (parms->End[0] - parms->Start[0])) >> 8; // red
int g = ((parms->Start[1] << 8) + rangev * (parms->End[1] - parms->Start[1])) >> 8; // green
int b = ((parms->Start[2] << 8) + rangev * (parms->End[2] - parms->Start[2])) >> 8; // blue
r = clamp(r, 0, 255);
g = clamp(g, 0, 255);
b = clamp(b, 0, 255);
remap.Remap[j] = ColorMatcher.Pick(r, g, b);
remap.Palette[j] = PalEntry(255,r,g,b);
}
if (post) post(&remap);
Translations.Push(GPalette.StoreTranslation(TRANSLATION_Internal, &remap));
// Advance to the next color range.
while (parmstart[1].RangeStart > parmstart[0].RangeEnd)
{
parmstart++;
}
parmstart++;
}
return 256;
}
//==========================================================================
@ -852,6 +658,10 @@ void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity
int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const
{
// Single pic fonts do not set up their translation table and must always return 0.
if (Translations.Size() == 0) return 0;
assert(Translations.Size() == NumTextColors);
if (noTranslate)
{
PalEntry retcolor = PalEntry(255, 255, 255, 255);
@ -862,11 +672,10 @@ int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const
}
if (color != nullptr) *color = retcolor;
}
if (ActiveColors == 0 || range == CR_UNDEFINED)
if (range == CR_UNDEFINED)
return -1;
else if (range >= NumTextColors)
range = CR_UNTRANSLATED;
//if (range == CR_UNTRANSLATED && !translateUntranslated) return nullptr;
return Translations[range];
}
@ -889,7 +698,7 @@ int FFont::GetCharCode(int code, bool needpic) const
// regular chars turn negative when the 8th bit is set.
code &= 255;
}
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].OriginalPic != nullptr))
{
return code;
}
@ -903,7 +712,7 @@ int FFont::GetCharCode(int code, bool needpic) const
if (myislower(code))
{
code = upperforlower[code];
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].OriginalPic != nullptr))
{
return code;
}
@ -912,7 +721,7 @@ int FFont::GetCharCode(int code, bool needpic) const
while ((newcode = stripaccent(code)) != code)
{
code = newcode;
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].OriginalPic != nullptr))
{
return code;
}
@ -926,7 +735,7 @@ int FFont::GetCharCode(int code, bool needpic) const
while ((newcode = stripaccent(code)) != code)
{
code = newcode;
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].OriginalPic != nullptr))
{
return code;
}
@ -944,7 +753,7 @@ int FFont::GetCharCode(int code, bool needpic) const
while ((newcode = stripaccent(code)) != code)
{
code = newcode;
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].OriginalPic != nullptr))
{
return code;
}
@ -961,7 +770,7 @@ int FFont::GetCharCode(int code, bool needpic) const
//
//==========================================================================
FGameTexture *FFont::GetChar (int code, int translation, int *const width, bool *redirected) const
FGameTexture *FFont::GetChar (int code, int translation, int *const width) const
{
code = GetCharCode(code, true);
int xmove = SpaceWidth;
@ -979,19 +788,8 @@ FGameTexture *FFont::GetChar (int code, int translation, int *const width, bool
if (code < 0) return nullptr;
if ((translation == CR_UNTRANSLATED || translation == CR_UNDEFINED) && !forceremap)
{
bool redirect = Chars[code].OriginalPic && Chars[code].OriginalPic != Chars[code].TranslatedPic;
if (redirected) *redirected = redirect;
if (redirect)
{
assert(Chars[code].OriginalPic->GetUseType() == ETextureType::FontChar);
return Chars[code].OriginalPic;
}
}
if (redirected) *redirected = false;
assert(Chars[code].TranslatedPic->GetUseType() == ETextureType::FontChar);
return Chars[code].TranslatedPic;
assert(Chars[code].OriginalPic->GetUseType() == ETextureType::FontChar);
return Chars[code].OriginalPic;
}
//==========================================================================
@ -1170,33 +968,34 @@ int FFont::GetMaxAscender(const uint8_t* string) const
void FFont::LoadTranslations()
{
unsigned int count = LastChar - FirstChar + 1;
unsigned int count = min<unsigned>(Chars.Size(), LastChar - FirstChar + 1);
uint32_t usedcolors[256] = {};
uint8_t identity[256];
TArray<double> Luminosity;
if (count == 0) return;
for (unsigned int i = 0; i < count; i++)
{
if (Chars[i].TranslatedPic)
if (Chars[i].OriginalPic)
{
FFontChar1 *pic = static_cast<FFontChar1 *>(Chars[i].TranslatedPic->GetTexture()->GetImage());
if (pic)
{
pic->SetSourceRemap(nullptr); // Force the FFontChar1 to return the same pixels as the base texture
RecordTextureColors(pic, usedcolors);
}
auto pic = Chars[i].OriginalPic->GetTexture()->GetImage();
if (pic) RecordTextureColors(pic, usedcolors);
}
}
ActiveColors = SimpleTranslation (usedcolors, PatchRemap, identity, Luminosity);
int minlum = 0, maxlum = 0;
GetLuminosity (usedcolors, Luminosity, &minlum, &maxlum);
if (MinLum >= 0 && MinLum < minlum) minlum = MinLum;
if (MaxLum > maxlum) maxlum = MaxLum;
for (unsigned int i = 0; i < count; i++)
// Here we can set everything to a luminosity translation.
// Create different translations for different color ranges
Translations.Resize(NumTextColors);
for (int i = 0; i < NumTextColors; i++)
{
if(Chars[i].TranslatedPic)
static_cast<FFontChar1 *>(Chars[i].TranslatedPic->GetTexture()->GetImage())->SetSourceRemap(PatchRemap);
if (i == CR_UNTRANSLATED) Translations[i] = 0;
else Translations[i] = LuminosityTranslation(i*2 + TranslationType, minlum, maxlum);
}
BuildTranslations (Luminosity.Data(), identity, &TranslationParms[TranslationType][0], ActiveColors, nullptr);
}
//==========================================================================
@ -1205,14 +1004,15 @@ void FFont::LoadTranslations()
//
//==========================================================================
FFont::FFont (int lump)
FFont::FFont (int lump, FName nm)
{
FirstChar = LastChar = 0;
Next = FirstFont;
FirstFont = this;
Lump = lump;
FontName = NAME_None;
FontName = nm;
Cursor = '_';
noTranslate = false;
uint8_t pp = 0;
for (auto &p : PatchRemap) p = pp++;
}
//==========================================================================
@ -1276,3 +1076,7 @@ void FFont::FixXMoves()
}
void FFont::ClearOffsets()
{
for (auto& c : Chars) if (c.OriginalPic) c.OriginalPic->SetOffsets(0, 0);
}

View file

@ -3,7 +3,6 @@
#include <stdint.h>
#include "tarray.h"
// This structure is used by BuildTranslations() to hold color information.
struct TranslationParm
{
short RangeStart; // First level for this range

View file

@ -50,6 +50,8 @@ struct HexDataSource
TArray<uint8_t> glyphdata;
unsigned glyphmap[65536] = {};
PalEntry ConsolePal[18], SmallPal[18];
//==========================================================================
//
// parse a HEX font
@ -83,6 +85,17 @@ struct HexDataSource
if (codepoint > LastChar) LastChar = codepoint;
}
}
ConsolePal[0] = SmallPal[0] = 0;
for (int i = 1; i < 18; i++)
{
double lum = i == 1 ? 0.01 : 0.5 + (i - 2) * (0.5 / 17.);
uint8_t lumb = (uint8_t(lum * 255));
ConsolePal[i] = PalEntry(255, lumb, lumb, lumb);
lumb = i * 255 / 17;
SmallPal[i] = PalEntry(255, lumb, lumb, lumb);
}
}
};
@ -95,6 +108,7 @@ public:
FHexFontChar(uint8_t *sourcedata, int swidth, int width, int height);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
int CopyPixels(FBitmap* bmp, int conversion);
protected:
int SourceWidth;
@ -159,12 +173,23 @@ TArray<uint8_t> FHexFontChar::CreatePalettedPixels(int)
return Pixels;
}
int FHexFontChar::CopyPixels(FBitmap* bmp, int conversion)
{
if (conversion == luminance) conversion = normal; // luminance images have no use as an RGB source.
PalEntry* palette = hexdata.ConsolePal;
auto ppix = CreatePalettedPixels(conversion);
bmp->CopyPixelData(0, 0, ppix.Data(), Width, Height, Height, 1, 0, palette, nullptr);
return 0;
}
class FHexFontChar2 : public FHexFontChar
{
public:
FHexFontChar2(uint8_t *sourcedata, int swidth, int width, int height);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
int CopyPixels(FBitmap* bmp, int conversion);
};
@ -228,6 +253,15 @@ TArray<uint8_t> FHexFontChar2::CreatePalettedPixels(int)
return Pixels;
}
int FHexFontChar2::CopyPixels(FBitmap* bmp, int conversion)
{
if (conversion == luminance) conversion = normal; // luminance images have no use as an RGB source.
PalEntry* palette = hexdata.SmallPal;
auto ppix = CreatePalettedPixels(conversion);
bmp->CopyPixelData(0, 0, ppix.Data(), Width, Height, Height, 1, 0, palette, nullptr);
return 0;
}
class FHexFont : public FFont
@ -253,13 +287,10 @@ public:
FirstChar = hexdata.FirstChar;
LastChar = hexdata.LastChar;
Next = FirstFont;
FirstFont = this;
FontHeight = 16;
SpaceWidth = 9;
GlobalKerning = 0;
translateUntranslated = true;
Chars.Resize(LastChar - FirstChar + 1);
for (int i = FirstChar; i <= LastChar; i++)
{
@ -267,10 +298,9 @@ public:
{
auto offset = hexdata.glyphmap[i];
int size = hexdata.glyphdata[offset] / 16;
Chars[i - FirstChar].TranslatedPic = MakeGameTexture(new FImageTexture(new FHexFontChar(&hexdata.glyphdata[offset + 1], size, size * 9, 16)), nullptr, ETextureType::FontChar);
Chars[i - FirstChar].OriginalPic = Chars[i - FirstChar].TranslatedPic;
Chars[i - FirstChar].OriginalPic = MakeGameTexture(new FImageTexture(new FHexFontChar(&hexdata.glyphdata[offset + 1], size, size * 9, 16)), nullptr, ETextureType::FontChar);
Chars[i - FirstChar].XMove = size * spacing;
TexMan.AddGameTexture(Chars[i - FirstChar].TranslatedPic);
TexMan.AddGameTexture(Chars[i - FirstChar].OriginalPic);
}
else Chars[i - FirstChar].XMove = spacing;
@ -285,18 +315,15 @@ public:
void LoadTranslations()
{
double luminosity[256];
int minlum = hexdata.ConsolePal[1].r;
int maxlum = hexdata.ConsolePal[17].r;
memset (PatchRemap, 0, 256);
for (int i = 0; i < 18; i++)
{
// Create a gradient similar to the old console font.
PatchRemap[i] = i;
luminosity[i] = i == 1? 0.01 : 0.5 + (i-2) * (0.5 / 17.);
Translations.Resize(NumTextColors);
for (int i = 0; i < NumTextColors; i++)
{
if (i == CR_UNTRANSLATED) Translations[i] = 0;
else Translations[i] = LuminosityTranslation(i * 2 + 1, minlum, maxlum);
}
ActiveColors = 18;
BuildTranslations (luminosity, nullptr, &TranslationParms[1][0], ActiveColors, nullptr);
}
};
@ -325,12 +352,9 @@ public:
FirstChar = hexdata.FirstChar;
LastChar = hexdata.LastChar;
Next = FirstFont;
FirstFont = this;
FontHeight = 18;
SpaceWidth = 9;
GlobalKerning = -1;
translateUntranslated = true;
Chars.Resize(LastChar - FirstChar + 1);
for (int i = FirstChar; i <= LastChar; i++)
{
@ -338,10 +362,9 @@ public:
{
auto offset = hexdata.glyphmap[i];
int size = hexdata.glyphdata[offset] / 16;
Chars[i - FirstChar].TranslatedPic = MakeGameTexture(new FImageTexture(new FHexFontChar2(&hexdata.glyphdata[offset + 1], size, 2 + size * 8, 18)), nullptr, ETextureType::FontChar);
Chars[i - FirstChar].OriginalPic = Chars[i - FirstChar].TranslatedPic;
Chars[i - FirstChar].OriginalPic = MakeGameTexture(new FImageTexture(new FHexFontChar2(&hexdata.glyphdata[offset + 1], size, 2 + size * 8, 18)), nullptr, ETextureType::FontChar);
Chars[i - FirstChar].XMove = size * spacing;
TexMan.AddGameTexture(Chars[i - FirstChar].TranslatedPic);
TexMan.AddGameTexture(Chars[i - FirstChar].OriginalPic);
}
else Chars[i - FirstChar].XMove = spacing;
@ -356,71 +379,16 @@ public:
void LoadTranslations() override
{
double luminosity[256];
int minlum = hexdata.SmallPal[1].r;
int maxlum = hexdata.SmallPal[17].r;
memset(PatchRemap, 0, 256);
for (int i = 0; i < 18; i++)
Translations.Resize(NumTextColors);
for (int i = 0; i < NumTextColors; i++)
{
// Create a gradient similar to the old console font.
PatchRemap[i] = i;
luminosity[i] = i / 17.;
if (i == CR_UNTRANSLATED) Translations[i] = 0;
else Translations[i] = LuminosityTranslation(i * 2, minlum, maxlum);
}
ActiveColors = 18;
BuildTranslations(luminosity, nullptr, &TranslationParms[0][0], ActiveColors, nullptr);
}
void SetDefaultTranslation(uint32_t *colors) override
{
double myluminosity[18];
myluminosity[0] = 0;
for (int i = 1; i < 18; i++)
{
myluminosity[i] = (i - 1) / 16.;
}
uint8_t othertranslation[256], otherreverse[256];
TArray<double> otherluminosity;
SimpleTranslation(colors, othertranslation, otherreverse, otherluminosity);
FRemapTable remap(ActiveColors);
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (unsigned l = 1; l < 18; l++)
{
for (unsigned o = 1; o < otherluminosity.Size() - 1; o++) // luminosity[0] is for the transparent color
{
if (myluminosity[l] >= otherluminosity[o] && myluminosity[l] <= otherluminosity[o + 1])
{
PalEntry color1 = GPalette.BaseColors[otherreverse[o]];
PalEntry color2 = GPalette.BaseColors[otherreverse[o + 1]];
double weight = 0;
if (otherluminosity[o] != otherluminosity[o + 1])
{
weight = (myluminosity[l] - otherluminosity[o]) / (otherluminosity[o + 1] - otherluminosity[o]);
}
int r = int(color1.r + weight * (color2.r - color1.r));
int g = int(color1.g + weight * (color2.g - color1.g));
int b = int(color1.b + weight * (color2.b - color1.b));
r = clamp(r, 0, 255);
g = clamp(g, 0, 255);
b = clamp(b, 0, 255);
remap.Remap[l] = ColorMatcher.Pick(r, g, b);
remap.Palette[l] = PalEntry(255, r, g, b);
break;
}
}
}
Translations[CR_UNTRANSLATED] = GPalette.StoreTranslation(TRANSLATION_Internal, &remap);
forceremap = true;
}
};

View file

@ -90,26 +90,22 @@ public:
void RecordAllTextureColors(uint32_t* usedcolors) override;
protected:
void CheckFON1Chars (double *luminosity);
void BuildTranslations2 ();
void FixupPalette (uint8_t *identity, double *luminosity, const uint8_t *palette,
bool rescale, PalEntry *out_palette);
void CheckFON1Chars ();
void FixupPalette (uint8_t *identity, const PalEntry *palette, int* minlum ,int* maxlum);
void LoadTranslations ();
void LoadFON1 (int lump, const uint8_t *data);
void LoadFON2 (int lump, const uint8_t *data);
void LoadBMF (int lump, const uint8_t *data);
void CreateFontFromPic (FTextureID picnum);
static int BMFCompare(const void *a, const void *b);
enum
{
FONT1,
FONT2,
BMFFONT
} FontType;
uint8_t PaletteData[768];
PalEntry Palette[256];
bool RescalePalette;
int ActiveColors = -1;
};
@ -155,32 +151,6 @@ FSingleLumpFont::FSingleLumpFont (const char *name, int lump) : FFont(lump)
break;
}
}
Next = FirstFont;
FirstFont = this;
}
//==========================================================================
//
// FSingleLumpFont :: CreateFontFromPic
//
//==========================================================================
void FSingleLumpFont::CreateFontFromPic (FTextureID picnum)
{
auto pic = TexMan.GetGameTexture(picnum);
FontHeight = (int)pic->GetDisplayHeight ();
SpaceWidth = (int)pic->GetDisplayWidth ();
GlobalKerning = 0;
FirstChar = LastChar = 'A';
Chars.Resize(1);
Chars[0].TranslatedPic = pic;
Chars[0].OriginalPic = pic;
// Only one color range. Don't bother with the others.
ActiveColors = 0;
}
//==========================================================================
@ -191,28 +161,21 @@ void FSingleLumpFont::CreateFontFromPic (FTextureID picnum)
void FSingleLumpFont::LoadTranslations()
{
double luminosity[256];
uint8_t identity[256];
PalEntry local_palette[256];
bool useidentity = true;
bool usepalette = false;
const void* ranges;
unsigned int count = LastChar - FirstChar + 1;
int minlum, maxlum;
switch(FontType)
{
case FONT1:
useidentity = false;
ranges = &TranslationParms[1][0];
CheckFON1Chars (luminosity);
CheckFON1Chars();
minlum = 1;
maxlum = 255;
break;
case BMFFONT:
case FONT2:
usepalette = true;
FixupPalette (identity, luminosity, PaletteData, RescalePalette, local_palette);
ranges = &TranslationParms[0][0];
FixupPalette (identity, Palette, &minlum, &maxlum);
break;
default:
@ -223,11 +186,16 @@ void FSingleLumpFont::LoadTranslations()
for(unsigned int i = 0;i < count;++i)
{
if(Chars[i].TranslatedPic)
static_cast<FFontChar2*>(Chars[i].TranslatedPic->GetTexture()->GetImage())->SetSourceRemap(PatchRemap);
if(Chars[i].OriginalPic)
static_cast<FFontChar2*>(Chars[i].OriginalPic->GetTexture()->GetImage())->SetSourceRemap(Palette);
}
BuildTranslations (luminosity, useidentity ? identity : nullptr, ranges, ActiveColors, usepalette ? local_palette : nullptr);
Translations.Resize(NumTextColors);
for (int i = 0; i < NumTextColors; i++)
{
if (i == CR_UNTRANSLATED) Translations[i] = 0;
else Translations[i] = LuminosityTranslation(i * 2 + (FontType == FONT1 ? 1 : 0), minlum, maxlum);
}
}
//==========================================================================
@ -256,25 +224,25 @@ void FSingleLumpFont::LoadFON1 (int lump, const uint8_t *data)
FirstChar = 0;
LastChar = 255; // This is to allow LoadTranslations to function. The way this is all set up really needs to be changed.
GlobalKerning = 0;
translateUntranslated = true;
LastChar = 0x2122;
// Move the Windows-1252 characters to their proper place.
for (int i = 0x80; i < 0xa0; i++)
{
if (win1252map[i-0x80] != i && Chars[i].TranslatedPic != nullptr && Chars[win1252map[i - 0x80]].TranslatedPic == nullptr)
if (win1252map[i-0x80] != i && Chars[i].OriginalPic != nullptr && Chars[win1252map[i - 0x80]].OriginalPic == nullptr)
{
std::swap(Chars[i], Chars[win1252map[i - 0x80]]);
}
}
Palette[0] = 0;
for (int i = 1; i < 256; i++) Palette[i] = PalEntry(255, i, i, i);
}
//==========================================================================
//
// FSingleLumpFont :: LoadFON2
//
// FON2 is used for everything but the console font. The console font should
// probably use FON2 as well, but oh well.
// FON2 is used for everything but the console font.
//
//==========================================================================
@ -340,7 +308,11 @@ void FSingleLumpFont::LoadFON2 (int lump, const uint8_t *data)
SpaceWidth = totalwidth * 2 / (3 * count);
}
memcpy(PaletteData, palette, ActiveColors*3);
Palette[0] = 0;
for (int i = 1; i < ActiveColors; i++)
{
Palette[i] = PalEntry(255, palette[i * 3], palette[i * 3 + 1], palette[i * 3 + 2]);
}
data_p = palette + ActiveColors*3;
@ -350,14 +322,12 @@ void FSingleLumpFont::LoadFON2 (int lump, const uint8_t *data)
Chars[i].XMove = widths2[i];
if (destSize <= 0)
{
Chars[i].TranslatedPic = nullptr;
Chars[i].OriginalPic = nullptr;
}
else
{
Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar2 (lump, int(data_p - data), widths2[i], FontHeight)), nullptr, ETextureType::FontChar);
Chars[i].OriginalPic = Chars[i].TranslatedPic;
TexMan.AddGameTexture(Chars[i].TranslatedPic);
Chars[i].OriginalPic = MakeGameTexture(new FImageTexture(new FFontChar2 (lump, int(data_p - data), widths2[i], FontHeight)), nullptr, ETextureType::FontChar);
TexMan.AddGameTexture(Chars[i].OriginalPic);
do
{
int8_t code = *data_p++;
@ -396,8 +366,6 @@ void FSingleLumpFont::LoadBMF(int lump, const uint8_t *data)
int numchars, count, totalwidth, nwidth;
int infolen;
int i, chari;
uint8_t raw_palette[256*3];
PalEntry sort_palette[256];
FontType = BMFFONT;
FontHeight = data[5];
@ -439,31 +407,14 @@ void FSingleLumpFont::LoadBMF(int lump, const uint8_t *data)
count = LastChar - FirstChar + 1;
Chars.Resize(count);
// BMF palettes are only six bits per component. Fix that.
for (i = 0; i < ActiveColors*3; ++i)
{
raw_palette[i+3] = (data[17 + i] << 2) | (data[17 + i] >> 4);
}
ActiveColors++;
// Sort the palette by increasing brightness
for (i = 0; i < ActiveColors; ++i)
{
PalEntry *pal = &sort_palette[i];
pal->a = i; // Use alpha part to point back to original entry
pal->r = raw_palette[i*3 + 0];
pal->g = raw_palette[i*3 + 1];
pal->b = raw_palette[i*3 + 2];
int r = (data[17 + i * 3] << 2) | (data[17 + i * 3] >> 4);
int g = (data[18 + i * 3] << 2) | (data[18 + i * 3] >> 4);
int b = (data[19 + i * 3] << 2) | (data[19 + i * 3] >> 4);
Palette[i + 1] = PalEntry(255, r, g, b); // entry 0 (transparent) is not stored in the font file.
}
qsort(sort_palette + 1, ActiveColors - 1, sizeof(PalEntry), BMFCompare);
// Create the PatchRemap table from the sorted "alpha" values.
PatchRemap[0] = 0;
for (i = 1; i < ActiveColors; ++i)
{
PatchRemap[sort_palette[i].a] = i;
}
memcpy(PaletteData, raw_palette, 768);
ActiveColors++;
// Now scan through the characters again, creating glyphs for each one.
for (i = chari = 0; i < numchars; ++i, chari += 6 + chardata[chari+1] * chardata[chari+2])
@ -489,7 +440,6 @@ void FSingleLumpFont::LoadBMF(int lump, const uint8_t *data)
-(int8_t)chardata[chari+3], // x offset
-(int8_t)chardata[chari+4] // y offset
)), nullptr, ETextureType::FontChar);
Chars[chardata[chari] - FirstChar].TranslatedPic = tex;
Chars[chardata[chari] - FirstChar].OriginalPic = tex;
TexMan.AddGameTexture(tex);
}
@ -510,55 +460,33 @@ void FSingleLumpFont::LoadBMF(int lump, const uint8_t *data)
FixXMoves();
}
//==========================================================================
//
// FSingleLumpFont :: BMFCompare STATIC
//
// Helper to sort BMF palettes.
//
//==========================================================================
int FSingleLumpFont::BMFCompare(const void *a, const void *b)
{
const PalEntry *pa = (const PalEntry *)a;
const PalEntry *pb = (const PalEntry *)b;
return (pa->r * 299 + pa->g * 587 + pa->b * 114) -
(pb->r * 299 + pb->g * 587 + pb->b * 114);
}
//==========================================================================
//
// FSingleLumpFont :: CheckFON1Chars
//
// Scans a FON1 resource for all the color values it uses and sets up
// some tables like SimpleTranslation. Data points to the RLE data for
// some tables. Data points to the RLE data for
// the characters. Also sets up the character textures.
//
//==========================================================================
void FSingleLumpFont::CheckFON1Chars (double *luminosity)
void FSingleLumpFont::CheckFON1Chars()
{
FileData memLump = fileSystem.ReadFile(Lump);
const uint8_t* data = (const uint8_t*) memLump.GetMem();
const uint8_t* data = (const uint8_t*)memLump.GetMem();
const uint8_t* data_p;
uint8_t used[256], reverse[256];
const uint8_t *data_p;
int i, j;
memset (used, 0, 256);
data_p = data + 8;
for (i = 0; i < 256; ++i)
for (int i = 0; i < 256; ++i)
{
int destSize = SpaceWidth * FontHeight;
if(!Chars[i].TranslatedPic)
if (!Chars[i].OriginalPic)
{
Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar2 (Lump, int(data_p - data), SpaceWidth, FontHeight)), nullptr, ETextureType::FontChar);
Chars[i].OriginalPic = Chars[i].TranslatedPic;
Chars[i].OriginalPic = MakeGameTexture(new FImageTexture(new FFontChar2(Lump, int(data_p - data), SpaceWidth, FontHeight)), nullptr, ETextureType::FontChar);
Chars[i].XMove = SpaceWidth;
TexMan.AddGameTexture(Chars[i].TranslatedPic);
TexMan.AddGameTexture(Chars[i].OriginalPic);
}
// Advance to next char's data and count the used colors.
@ -567,87 +495,52 @@ void FSingleLumpFont::CheckFON1Chars (double *luminosity)
int8_t code = *data_p++;
if (code >= 0)
{
destSize -= code+1;
destSize -= code + 1;
while (code-- >= 0)
{
used[*data_p++] = 1;
data_p++;
}
}
else if (code != -128)
{
used[*data_p++] = 1;
data_p++;
destSize -= 1 - code;
}
} while (destSize > 0);
}
memset (PatchRemap, 0, 256);
reverse[0] = 0;
for (i = 1, j = 1; i < 256; ++i)
{
if (used[i])
{
reverse[j++] = i;
}
}
for (i = 1; i < j; ++i)
{
PatchRemap[reverse[i]] = i;
luminosity[i] = (reverse[i] - 1) / 254.0;
}
ActiveColors = j;
ActiveColors = 256;
}
//==========================================================================
//
// FSingleLumpFont :: FixupPalette
//
// Finds the best matches for the colors used by a FON2 font and sets up
// some tables like SimpleTranslation.
// Finds the best matches for the colors used by a FON2 font and finds thr
// used luminosity range
//
//==========================================================================
void FSingleLumpFont::FixupPalette (uint8_t *identity, double *luminosity, const uint8_t *palette, bool rescale, PalEntry *out_palette)
void FSingleLumpFont::FixupPalette (uint8_t *identity, const PalEntry *palette, int *pminlum, int *pmaxlum)
{
int i;
double maxlum = 0.0;
double minlum = 100000000.0;
double diver;
identity[0] = 0;
palette += 3; // Skip the transparent color
for (i = 1; i < ActiveColors; ++i, palette += 3)
for (int i = 1; i < ActiveColors; ++i, palette ++)
{
int r = palette[0];
int g = palette[1];
int b = palette[2];
int r = palette->r;
int g = palette->g;
int b = palette->b;
double lum = r*0.299 + g*0.587 + b*0.114;
identity[i] = ColorMatcher.Pick(r, g, b);
luminosity[i] = lum;
out_palette[i].r = r;
out_palette[i].g = g;
out_palette[i].b = b;
out_palette[i].a = 255;
if (lum > maxlum)
maxlum = lum;
if (lum < minlum)
minlum = lum;
if (lum > maxlum) maxlum = lum;
if (lum < minlum) minlum = lum;
}
out_palette[0] = 0;
if (rescale)
{
diver = 1.0 / (maxlum - minlum);
}
else
{
diver = 1.0 / 255.0;
}
for (i = 1; i < ActiveColors; ++i)
{
luminosity[i] = (luminosity[i] - minlum) * diver;
}
if (pminlum) *pminlum = int(minlum);
if (pmaxlum) *pmaxlum = int(maxlum);
}
//==========================================================================
@ -661,13 +554,11 @@ void FSingleLumpFont::FixupPalette (uint8_t *identity, double *luminosity, const
void FSingleLumpFont::RecordAllTextureColors(uint32_t* usedcolors)
{
double luminosity[256];
uint8_t identity[256];
PalEntry local_palette[256];
if (FontType == BMFFONT || FontType == FONT2)
{
FixupPalette(identity, luminosity, PaletteData, RescalePalette, local_palette);
FixupPalette(identity, Palette, nullptr, nullptr);
for (int i = 0; i < 256; i++)
{
if (identity[i] != 0) usedcolors[identity[i]]++;

View file

@ -45,7 +45,7 @@ public:
FSinglePicFont(const char *picname);
// FFont interface
FGameTexture *GetChar(int code, int translation, int *const width, bool *redirected = nullptr) const override;
FGameTexture *GetChar(int code, int translation, int *const width) const override;
int GetCharWidth (int code) const override;
protected:
@ -79,11 +79,7 @@ FSinglePicFont::FSinglePicFont(const char *picname) :
SpaceWidth = (int)pic->GetDisplayWidth();
GlobalKerning = 0;
FirstChar = LastChar = 'A';
ActiveColors = 0;
PicNum = picnum;
Next = FirstFont;
FirstFont = this;
}
//==========================================================================
@ -94,10 +90,9 @@ FSinglePicFont::FSinglePicFont(const char *picname) :
//
//==========================================================================
FGameTexture *FSinglePicFont::GetChar (int code, int translation, int *const width, bool *redirected) const
FGameTexture *FSinglePicFont::GetChar (int code, int translation, int *const width) const
{
*width = SpaceWidth;
if (redirected) *redirected = false;
if (code == 'a' || code == 'A')
{
return TexMan.GetGameTexture(PicNum, true);

View file

@ -78,8 +78,6 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FGameTexture
LastChar = first + count - 1;
FontHeight = 0;
GlobalKerning = false;
Next = FirstFont;
FirstFont = this;
maxyoffs = 0;
@ -108,26 +106,18 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FGameTexture
Chars[i].OriginalPic = MakeGameTexture(pic->GetTexture(), nullptr, ETextureType::FontChar);
Chars[i].OriginalPic->CopySize(pic, true);
TexMan.AddGameTexture(Chars[i].OriginalPic);
if (!noTranslate)
{
Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1 (charlumps[i]->GetTexture()->GetImage())), nullptr, ETextureType::FontChar);
Chars[i].TranslatedPic->CopySize(charlumps[i], true);
TexMan.AddGameTexture(Chars[i].TranslatedPic);
}
else Chars[i].TranslatedPic = Chars[i].OriginalPic;
Chars[i].XMove = (int)Chars[i].TranslatedPic->GetDisplayWidth();
if (sysCallbacks.FontCharCreated) sysCallbacks.FontCharCreated(pic, Chars[i].OriginalPic, Chars[i].TranslatedPic);
Chars[i].XMove = (int)Chars[i].OriginalPic->GetDisplayWidth();
if (sysCallbacks.FontCharCreated) sysCallbacks.FontCharCreated(pic, Chars[i].OriginalPic);
}
else
{
Chars[i].TranslatedPic = nullptr;
Chars[i].OriginalPic = nullptr;
Chars[i].XMove = INT_MIN;
}
}
// Special fonts normally don't have all characters so be careful here!
if ('N'-first >= 0 && 'N'-first < count && Chars['N' - first].TranslatedPic != nullptr)
if ('N'-first >= 0 && 'N'-first < count && Chars['N' - first].OriginalPic != nullptr)
{
SpaceWidth = (Chars['N' - first].XMove + 1) / 2;
}
@ -137,11 +127,6 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FGameTexture
}
FixXMoves();
if (noTranslate)
{
ActiveColors = 0;
}
}
//==========================================================================
@ -152,65 +137,67 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FGameTexture
void FSpecialFont::LoadTranslations()
{
int count = LastChar - FirstChar + 1;
uint32_t usedcolors[256] = {};
uint8_t identity[256];
TArray<double> Luminosity;
int TotalColors;
int i;
FFont::LoadTranslations();
for (i = 0; i < count; i++)
bool empty = true;
for (auto& c : Chars)
{
if (Chars[i].TranslatedPic)
if (c.OriginalPic != nullptr)
{
FFontChar1 *pic = static_cast<FFontChar1 *>(Chars[i].TranslatedPic->GetTexture()->GetImage());
if (pic)
{
pic->SetSourceRemap(nullptr); // Force the FFontChar1 to return the same pixels as the base texture
RecordTextureColors(pic, usedcolors);
}
empty = false;
break;
}
}
if (empty) return; // Font has no characters.
bool needsnotrans = false;
// exclude the non-translated colors from the translation calculation
for (i = 0; i < 256; i++)
if (notranslate[i])
usedcolors[i] = false;
TotalColors = ActiveColors = SimpleTranslation (usedcolors, PatchRemap, identity, Luminosity);
// Map all untranslated colors into the table of used colors
for (i = 0; i < 256; i++)
{
for (int i = 0; i < 256; i++)
if (notranslate[i])
{
PatchRemap[i] = TotalColors;
identity[TotalColors] = i;
TotalColors++;
needsnotrans = true;
break;
}
}
for (i = 0; i < count; i++)
// If we have no non-translateable colors, we can use the base data as-is.
if (!needsnotrans)
{
if(Chars[i].TranslatedPic)
static_cast<FFontChar1 *>(Chars[i].TranslatedPic->GetTexture()->GetImage())->SetSourceRemap(PatchRemap);
return;
}
BuildTranslations(Luminosity.Data(), identity, &TranslationParms[0][0], TotalColors, nullptr, [=](FRemapTable* remap)
{
// add the untranslated colors to the Ranges tables
if (ActiveColors < TotalColors)
{
for (int j = ActiveColors; j < TotalColors; ++j)
{
remap->Remap[j] = identity[j];
remap->Palette[j] = GPalette.BaseColors[identity[j]];
remap->Palette[j].a = 0xff;
}
}
});
// we only need to add special handling if there's colors that should not be translated.
// Obviously 'notranslate' should only be used on data that uses the base palette, otherwise results are undefined!
for (auto &trans : Translations)
{
if (!IsLuminosityTranslation(trans)) continue; // this should only happen for CR_UNTRANSLATED.
ActiveColors = TotalColors;
FRemapTable remap(256);
remap.ForFont = true;
uint8_t workpal[1024];
for (int i = 0; i < 256; i++)
{
workpal[i * 4 + 0] = GPalette.BaseColors[i].b;
workpal[i * 4 + 1] = GPalette.BaseColors[i].g;
workpal[i * 4 + 2] = GPalette.BaseColors[i].r;
workpal[i * 4 + 3] = GPalette.BaseColors[i].a;
}
V_ApplyLuminosityTranslation(trans, workpal, 256);
for (int i = 0; i < 256; i++)
{
if (!notranslate[i])
{
remap.Palette[i] = PalEntry(workpal[i * 4 + 3], workpal[i * 4 + 2], workpal[i * 4 + 1], workpal[i * 4 + 0]);
remap.Remap[i] = ColorMatcher.Pick(remap.Palette[i]);
}
else
{
remap.Palette[i] = GPalette.BaseColors[i];
remap.Remap[i] = i;
}
}
trans = GPalette.StoreTranslation(TRANSLATION_Internal, &remap);
}
}
FFont *CreateSpecialFont (const char *name, int first, int count, FGameTexture **lumplist, const bool *notranslate, int lump, bool donttranslate)

View file

@ -60,16 +60,6 @@
#define DEFAULT_LOG_COLOR PalEntry(223,223,223)
//
// Globally visible constants.
//
#define HU_FONTSTART uint8_t('!') // the first font characters
#define HU_FONTEND uint8_t('\377') // the last font characters
// Calculate # of glyphs in font.
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
// TYPES -------------------------------------------------------------------
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
@ -158,7 +148,7 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
}
if (folderdata.Size() > 0)
{
font = new FFont(name, nullptr, name, HU_FONTSTART, HU_FONTSIZE, 1, -1);
font = new FFont(name, nullptr, name, 0, 0, 1, -1);
if (translationsLoaded) font->LoadTranslations();
return font;
}
@ -187,9 +177,11 @@ void V_InitCustomFonts()
int start;
int first;
int count;
int spacewidth;
int spacewidth = -1;
int kerning;
char cursor = '_';
bool ignoreoffsets = false;
int MinLum = -1, MaxLum = -1;
while ((llump = fileSystem.FindLump ("FONTDEFS", &lastlump)) != -1)
{
@ -246,10 +238,8 @@ void V_InitCustomFonts()
}
else if (sc.Compare ("SPACEWIDTH"))
{
if (format == 2) goto wrong;
sc.MustGetNumber();
spacewidth = sc.Number;
format = 1;
}
else if (sc.Compare("DONTTRANSLATE"))
{
@ -270,9 +260,26 @@ void V_InitCustomFonts()
sc.MustGetNumber();
kerning = sc.Number;
}
else if (sc.Compare("ignoreoffsets"))
{
ignoreoffsets = true;
}
else if (sc.Compare("minluminosity"))
{
sc.MustGetValue(false);
MinLum = (int16_t)clamp(sc.Number, 0, 255);
}
else if (sc.Compare("maxluminosity"))
{
sc.MustGetValue(false);
MaxLum = (int16_t)clamp(sc.Number, 0, 255);
}
else
{
if (format == 1) goto wrong;
// The braces must be filtered so because they'd be treated as block terminators otherwise.
if (!strcmp(sc.String, "-{")) strcpy(sc.String, "{");
if (!strcmp(sc.String, "-}")) strcpy(sc.String, "}");
FGameTexture **p = &lumplist[*(unsigned char*)sc.String];
sc.MustGetString();
FTextureID texid = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
@ -293,6 +300,7 @@ void V_InitCustomFonts()
FFont *fnt = new FFont (namebuffer, templatebuf, nullptr, first, count, start, llump, spacewidth, donttranslate);
fnt->SetCursor(cursor);
fnt->SetKerning(kerning);
if (ignoreoffsets) fnt->ClearOffsets();
}
else if (format == 2)
{
@ -318,6 +326,10 @@ void V_InitCustomFonts()
FFont *fnt = CreateSpecialFont (namebuffer, first, count, &lumplist[first], notranslate, llump, donttranslate);
fnt->SetCursor(cursor);
fnt->SetKerning(kerning);
if (spacewidth >= 0) fnt->SpaceWidth = spacewidth;
fnt->MinLum = MinLum;
fnt->MaxLum = MaxLum;
if (ignoreoffsets) fnt->ClearOffsets();
}
}
else goto wrong;
@ -327,7 +339,7 @@ void V_InitCustomFonts()
return;
wrong:
sc.ScriptError ("Invalid combination of properties in font '%s'", namebuffer.GetChars());
sc.ScriptError ("Invalid combination of properties in font '%s', %s not allowed", namebuffer.GetChars(), sc.String);
}
//==========================================================================
@ -586,6 +598,179 @@ EColorRange V_FindFontColor (FName name)
return CR_UNTRANSLATED;
}
//==========================================================================
//
// CreateLuminosityTranslationRanges
//
// Create universal remap ranges for hardware rendering.
//
//==========================================================================
static PalEntry* paletteptr;
static void CreateLuminosityTranslationRanges()
{
paletteptr = (PalEntry*)ImageArena.Alloc(256 * ((NumTextColors * 2)) * sizeof(PalEntry));
for (int l = 0; l < 2; l++)
{
auto parmstart = &TranslationParms[l][0];
// Put the data into the image arena where it gets deleted with the rest of the texture data.
for (int p = 0; p < NumTextColors; p++)
{
// Intended storage order is Range 1, variant 1 - Range 1, variant 2, Range 2, variant 1, and so on.
// The storage of the ranges forces us to go through this differently...
PalEntry* palette = paletteptr + p * 512 + l * 256;
for (int v = 0; v < 256; v++)
{
palette[v].b = palette[v].g = palette[v].r = (uint8_t)v;
}
if (p != CR_UNTRANSLATED) // This table skips the untranslated entry. Do I need to say that the stored data format is garbage? >)
{
for (int v = 0; v < 256; v++)
{
// Find the color range that this luminosity value lies within.
const TranslationParm* parms = parmstart - 1;
do
{
parms++;
if (parms->RangeStart <= v && parms->RangeEnd >= v)
break;
} while (parms[1].RangeStart > parms[0].RangeEnd);
// Linearly interpolate to find out which color this luminosity level gets.
int rangev = ((v - parms->RangeStart) << 8) / (parms->RangeEnd - parms->RangeStart);
int r = ((parms->Start[0] << 8) + rangev * (parms->End[0] - parms->Start[0])) >> 8; // red
int g = ((parms->Start[1] << 8) + rangev * (parms->End[1] - parms->Start[1])) >> 8; // green
int b = ((parms->Start[2] << 8) + rangev * (parms->End[2] - parms->Start[2])) >> 8; // blue
palette[v].r = (uint8_t)clamp(r, 0, 255);
palette[v].g = (uint8_t)clamp(g, 0, 255);
palette[v].b = (uint8_t)clamp(b, 0, 255);
}
// Advance to the next color range.
while (parmstart[1].RangeStart > parmstart[0].RangeEnd)
{
parmstart++;
}
parmstart++;
}
}
}
}
//==========================================================================
//
// V_ApplyLuminosityTranslation
//
// Applies the translation to a bitmap for texture generation.
//
//==========================================================================
void V_ApplyLuminosityTranslation(int translation, uint8_t* pixel, int size)
{
int colorrange = (translation >> 16) & 0x3fff;
if (colorrange >= NumTextColors * 2) return;
int lum_min = (translation >> 8) & 0xff;
int lum_max = translation & 0xff;
int lum_range = (lum_max - lum_min + 1);
PalEntry* remap = paletteptr + colorrange * 256;
for (int i = 0; i < size; i++, pixel += 4)
{
// we must also process the transparent pixels here to ensure proper filtering on the characters' edges.
int gray = PalEntry(255, pixel[2], pixel[1], pixel[0]).Luminance();
int lumadjust = (gray - lum_min) * 255 / lum_range;
int index = clamp(lumadjust, 0, 255);
PalEntry newcol = remap[index];
// extend the range if we find colors outside what initial analysis provided.
if (gray < lum_min)
{
newcol.r = newcol.r * gray / lum_min;
newcol.g = newcol.g * gray / lum_min;
newcol.b = newcol.b * gray / lum_min;
}
else if (gray > lum_max)
{
newcol.r = clamp(newcol.r * gray / lum_max, 0, 255);
newcol.g = clamp(newcol.g * gray / lum_max, 0, 255);
newcol.b = clamp(newcol.b * gray / lum_max, 0, 255);
}
pixel[0] = newcol.b;
pixel[1] = newcol.g;
pixel[2] = newcol.r;
}
}
//==========================================================================
//
// SetDefaultTranslation
//
// Builds a translation to map the stock font to a mod provided replacement.
// This probably won't work that well if the original font is extremely colorful.
//
//==========================================================================
static void CalcDefaultTranslation(FFont* base, int index)
{
uint32_t othercolors[256] = {};
base->RecordAllTextureColors(othercolors);
TArray<double> otherluminosity;
base->GetLuminosity(othercolors, otherluminosity);
PalEntry *remap = &paletteptr[index * 256];
memset(remap, 0, 1024);
for (unsigned i = 0; i < 256; i++)
{
auto lum = otherluminosity[i];
if (lum >= 0 && lum <= 1)
{
int index = int(lum * 255);
remap[index] = GPalette.BaseColors[i];
remap[index].a = 255;
}
}
// todo: fill the gaps.
//remap[0] = 0;
int lowindex = 0;
while (lowindex < 255 && remap[lowindex].a == 0) lowindex++;
lowindex++;
int highindex = lowindex + 1;
while (lowindex < 255)
{
while (highindex <= 255 && remap[highindex].a == 0) highindex++;
if (lowindex == 0)
{
for (int i = 0; i < highindex; i++) remap[i] = remap[highindex];
lowindex = highindex++;
}
else if (highindex > 256)
{
for (int i = lowindex + 1; i < highindex; i++) remap[i] = remap[lowindex];
break;
}
else
{
for (int i = lowindex + 1; i < highindex; i++)
{
PalEntry color1 = remap[lowindex];
PalEntry color2 = remap[highindex];
double weight = (i - lowindex) / double(highindex - lowindex);
int r = int(color1.r + weight * (color2.r - color1.r));
int g = int(color1.g + weight * (color2.g - color1.g));
int b = int(color1.b + weight * (color2.b - color1.b));
r = clamp(r, 0, 255);
g = clamp(g, 0, 255);
b = clamp(b, 0, 255);
remap[i] = PalEntry(255, r, g, b);
}
lowindex = highindex++;
}
}
}
//==========================================================================
//
// V_LogColorFromColorRange
@ -676,6 +861,7 @@ EColorRange V_ParseFontColor (const uint8_t *&color_value, int normalcolor, int
void V_InitFonts()
{
CreateLuminosityTranslationRanges();
V_InitCustomFonts();
FFont *CreateHexLumpFont(const char *fontname, int lump);
@ -686,140 +872,7 @@ void V_InitFonts()
NewConsoleFont = CreateHexLumpFont("NewConsoleFont", lump);
NewSmallFont = CreateHexLumpFont2("NewSmallFont", lump);
CurrentConsoleFont = NewConsoleFont;
// load the heads-up font
if (!(SmallFont = V_GetFont("SmallFont", "SMALLFNT")))
{
if (fileSystem.CheckNumForName("FONTA_S") >= 0)
{
int wadfile = -1;
auto a = fileSystem.CheckNumForName("FONTA33", ns_graphics);
if (a != -1) wadfile = fileSystem.GetFileContainer(a);
if (wadfile > fileSystem.GetIwadNum())
{
// The font has been replaced, so we need to create a copy of the original as well.
SmallFont = new FFont("SmallFont", "FONTA%02u", nullptr, HU_FONTSTART, HU_FONTSIZE, 1, -1);
SmallFont->SetCursor('[');
}
else
{
SmallFont = new FFont("SmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1);
SmallFont->SetCursor('[');
}
}
else if (fileSystem.CheckNumForName("STCFN033", ns_graphics) >= 0)
{
int wadfile = -1;
auto a = fileSystem.CheckNumForName("STCFN065", ns_graphics);
if (a != -1) wadfile = fileSystem.GetFileContainer(a);
if (wadfile > fileSystem.GetIwadNum())
{
// The font has been replaced, so we need to create a copy of the original as well.
SmallFont = new FFont("SmallFont", "STCFN%.3d", nullptr, HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, false, true);
}
else
{
SmallFont = new FFont("SmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, false, true);
}
}
}
// Create the original small font as a fallback for incomplete definitions.
if (fileSystem.CheckNumForName("FONTA_S") >= 0)
{
OriginalSmallFont = new FFont("OriginalSmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true);
OriginalSmallFont->SetCursor('[');
}
else if (fileSystem.CheckNumForName("STCFN033", ns_graphics) >= 0)
{
OriginalSmallFont = new FFont("OriginalSmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, true);
}
if (!(SmallFont2 = V_GetFont("SmallFont2"))) // Only used by Strife
{
if (fileSystem.CheckNumForName("STBFN033", ns_graphics) >= 0)
{
SmallFont2 = new FFont("SmallFont2", "STBFN%.3d", "defsmallfont2", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1);
}
}
//This must be read before BigFont so that it can be properly substituted.
BigUpper = V_GetFont("BigUpper");
if (!(BigFont = V_GetFont("BigFont")))
{
if (fileSystem.CheckNumForName("FONTB_S") >= 0)
{
BigFont = new FFont("BigFont", "FONTB%02u", "defbigfont", HU_FONTSTART, HU_FONTSIZE, 1, -1);
}
}
if (!BigFont)
{
// Load the generic fallback if no BigFont is found.
BigFont = V_GetFont("BigFont", "ZBIGFONT");
}
if (fileSystem.CheckNumForName("FONTB_S") >= 0)
{
OriginalBigFont = new FFont("OriginalBigFont", "FONTB%02u", "defbigfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true);
}
else
{
OriginalBigFont = new FFont("OriginalBigFont", nullptr, "bigfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true);
}
// let PWAD BIGFONTs override the stock BIGUPPER font. (This check needs to be made smarter.)
if (BigUpper && BigFont->Type != FFont::Folder && BigUpper->Type == FFont::Folder)
{
delete BigUpper;
BigUpper = BigFont;
}
if (BigUpper == nullptr)
{
BigUpper = BigFont;
}
if (!(ConFont = V_GetFont("ConsoleFont", "CONFONT")))
{
ConFont = SmallFont;
}
if (!(IntermissionFont = FFont::FindFont("IntermissionFont")))
{
if (TexMan.CheckForTexture("WINUM0", ETextureType::MiscPatch).isValid())
{
IntermissionFont = FFont::FindFont("IntermissionFont_Doom");
}
if (IntermissionFont == nullptr)
{
IntermissionFont = BigFont;
}
}
// This can only happen if gzdoom.pk3 is corrupted. ConFont should always be present.
if (ConFont == nullptr)
{
I_FatalError("Console font not found.");
}
// SmallFont and SmallFont2 have no default provided by the engine. BigFont only has in non-Raven games.
if (OriginalSmallFont == nullptr)
{
OriginalSmallFont = ConFont;
}
if (SmallFont == nullptr)
{
SmallFont = OriginalSmallFont;
}
if (SmallFont2 == nullptr)
{
SmallFont2 = SmallFont;
}
if (BigFont == nullptr)
{
BigFont = OriginalBigFont;
}
AlternativeSmallFont = OriginalSmallFont;
AlternativeBigFont = OriginalBigFont;
ConFont = V_GetFont("ConsoleFont", "CONFONT");
}
void V_LoadTranslations()
@ -827,24 +880,44 @@ void V_LoadTranslations()
for (auto font = FFont::FirstFont; font; font = font->Next)
{
if (!font->noTranslate) font->LoadTranslations();
else font->ActiveColors = 0;
}
if (BigFont)
{
uint32_t colors[256] = {};
BigFont->RecordAllTextureColors(colors);
if (OriginalBigFont != nullptr) OriginalBigFont->SetDefaultTranslation(colors);
CalcDefaultTranslation(BigFont, CR_UNTRANSLATED * 2 + 1);
if (OriginalBigFont != nullptr && OriginalBigFont != BigFont)
{
int sometrans = OriginalBigFont->Translations[0];
sometrans &= ~(0x3fff << 16);
sometrans |= (CR_UNTRANSLATED * 2 + 1) << 16;
OriginalBigFont->Translations[CR_UNTRANSLATED] = sometrans;
OriginalBigFont->forceremap = true;
}
}
if (SmallFont)
{
uint32_t colors[256] = {};
SmallFont->RecordAllTextureColors(colors);
if (OriginalSmallFont != nullptr) OriginalSmallFont->SetDefaultTranslation(colors);
NewSmallFont->SetDefaultTranslation(colors);
CalcDefaultTranslation(SmallFont, CR_UNTRANSLATED * 2);
if (OriginalSmallFont != nullptr && OriginalSmallFont != SmallFont)
{
int sometrans = OriginalSmallFont->Translations[0];
sometrans &= ~(0x3fff << 16);
sometrans |= (CR_UNTRANSLATED * 2) << 16;
OriginalSmallFont->Translations[CR_UNTRANSLATED] = sometrans;
OriginalSmallFont->forceremap = true;
}
if (NewSmallFont != nullptr)
{
int sometrans = NewSmallFont->Translations[0];
sometrans &= ~(0x3fff << 16);
sometrans |= (CR_UNTRANSLATED * 2) << 16;
NewSmallFont->Translations[CR_UNTRANSLATED] = sometrans;
NewSmallFont->forceremap = true;
}
}
translationsLoaded = true;
}
void V_ClearFonts()
{
while (FFont::FirstFont != nullptr)
@ -885,3 +958,28 @@ char* CleanseString(char* str)
return str;
}
#include "c_dispatch.h"
FGameTexture* GetBaseForChar(FGameTexture* t);
CCMD(dumpfonts)
{
for (auto c : { "tilesmallfont", "tilebigfont", "smallfont2", "digifont", "indexfont" })
{
auto f = V_GetFont(c);
if (f)
{
Printf("%s\n{\n", c);
for (int i = 33; i < 127; i++)
{
auto ch = f->GetChar(i, CR_UNDEFINED, nullptr);
if (ch)
{
ch = GetBaseForChar(ch);
if (i == 34) Printf("\t\"\\\""); else Printf("\t%c", i);
Printf(" %s\n", ch->GetName().GetChars());
}
}
Printf("}\n\n");
}
}
}

View file

@ -40,10 +40,14 @@
class FGameTexture;
struct FRemapTable;
class FFont;
FFont* V_GetFont(const char* fontname, const char* fontlumpname = nullptr);
enum EColorRange : int
{
CR_UNDEFINED = -1,
CR_NATIVEPAL = -1,
CR_BRICK,
CR_TAN,
CR_GRAY,
@ -95,9 +99,10 @@ public:
};
FFont (const char *fontname, const char *nametemplate, const char *filetemplate, int first, int count, int base, int fdlump, int spacewidth=-1, bool notranslate = false, bool iwadonly = false, bool doomtemplate = false, GlyphSet *baseGlpyphs = nullptr);
FFont(int lump, FName nm = NAME_None);
virtual ~FFont ();
virtual FGameTexture *GetChar (int code, int translation, int *const width, bool *redirected = nullptr) const;
virtual FGameTexture *GetChar (int code, int translation, int *const width) const;
virtual int GetCharWidth (int code) const;
int GetColorTranslation (EColorRange range, PalEntry *color = nullptr) const;
int GetLump() const { return Lump; }
@ -122,53 +127,75 @@ public:
inline bool CanPrint(const char *str) const { return CanPrint((const uint8_t *)str); }
inline bool CanPrint(const FString &str) const { return CanPrint((const uint8_t *)str.GetChars()); }
inline FFont* AltFont()
{
if (AltFontName != NAME_None) return V_GetFont(AltFontName.GetChars());
return nullptr;
}
int GetCharCode(int code, bool needpic) const;
char GetCursor() const { return Cursor; }
void SetCursor(char c) { Cursor = c; }
void SetKerning(int c) { GlobalKerning = c; }
void SetHeight(int c) { FontHeight = c; }
void ClearOffsets();
bool NoTranslate() const { return noTranslate; }
virtual void RecordAllTextureColors(uint32_t *usedcolors);
virtual void SetDefaultTranslation(uint32_t *colors);
void CheckCase();
void SetName(FName nm) { FontName = nm; }
int GetDisplacement() const { return Displacement; }
static int GetLuminosity(uint32_t* colorsused, TArray<double>& Luminosity, int* minlum = nullptr, int* maxlum = nullptr);
EFontType GetType() const { return Type; }
friend void V_InitCustomFonts();
void CopyFrom(const FFont& other)
{
Type = other.Type;
FirstChar = other.FirstChar;
LastChar = other.LastChar;
SpaceWidth = other.SpaceWidth;
FontHeight = other.FontHeight;
GlobalKerning = other.GlobalKerning;
TranslationType = other.TranslationType;
Displacement = other.Displacement;
Cursor = other.Cursor;
noTranslate = other.noTranslate;
MixedCase = other.MixedCase;
forceremap = other.forceremap;
Chars = other.Chars;
Translations = other.Translations;
Lump = other.Lump;
}
protected:
FFont (int lump);
void BuildTranslations (const double *luminosity, const uint8_t *identity,
const void *ranges, int total_colors, const PalEntry *palette, std::function<void(FRemapTable*)> post = nullptr);
void FixXMoves();
static int SimpleTranslation (uint32_t *colorsused, uint8_t *translation,
uint8_t *identity, TArray<double> &Luminosity);
void ReadSheetFont(TArray<FolderEntry> &folderdata, int width, int height, const DVector2 &Scale);
EFontType Type = EFontType::Unknown;
FName AltFontName = NAME_None;
int FirstChar, LastChar;
int SpaceWidth;
int FontHeight;
int AsciiHeight = 0;
int GlobalKerning;
int TranslationType = 0;
int Displacement = 0;
int16_t MinLum = -1, MaxLum = -1;
char Cursor;
bool noTranslate = false;
bool translateUntranslated;
bool MixedCase = false;
bool forceremap = false;
struct CharData
{
FGameTexture *TranslatedPic = nullptr; // Texture for use with font translations.
FGameTexture *OriginalPic = nullptr; // Texture for use with CR_UNTRANSLATED or font colorization.
FGameTexture *OriginalPic = nullptr;
int XMove = INT_MIN;
};
TArray<CharData> Chars;
int ActiveColors = -1;
TArray<int> Translations;
uint8_t PatchRemap[256];
int Lump;
FName FontName = NAME_None;
@ -189,9 +216,10 @@ void V_ClearFonts();
EColorRange V_FindFontColor (FName name);
PalEntry V_LogColorFromColorRange (EColorRange range);
EColorRange V_ParseFontColor (const uint8_t *&color_value, int normalcolor, int boldcolor);
FFont *V_GetFont(const char *fontname, const char *fontlumpname = nullptr);
void V_InitFontColors();
char* CleanseString(char* str);
void V_ApplyLuminosityTranslation(int translation, uint8_t* pixel, int size);
void V_LoadTranslations();
class FBitmap;

View file

@ -555,18 +555,28 @@ public:
mRenderStyle = rs;
}
auto GetDepthBias()
{
return mBias;
}
void SetDepthBias(float a, float b)
{
mBias.mChanged = mBias.mFactor != a || mBias.mUnits != b;
mBias.mFactor = a;
mBias.mUnits = b;
mBias.mChanged = true;
}
void SetDepthBias(FDepthBiasState& bias)
{
SetDepthBias(bias.mFactor, bias.mUnits);
}
void ClearDepthBias()
{
mBias.mChanged = mBias.mFactor != 0 || mBias.mUnits != 0;
mBias.mFactor = 0;
mBias.mUnits = 0;
mBias.mChanged = true;
}
private:

View file

@ -291,16 +291,19 @@ FMaterial* DFrameBuffer::CreateMaterial(FGameTexture* tex, int scaleflags)
//
//==========================================================================
DEFINE_ACTION_FUNCTION(_Screen, GetWidth)
static int ScreenGetWidth() { return twod->GetWidth(); }
static int ScreenGetHeight() { return twod->GetHeight(); }
DEFINE_ACTION_FUNCTION_NATIVE(_Screen, GetWidth, ScreenGetWidth)
{
PARAM_PROLOGUE;
ACTION_RETURN_INT(screen->GetWidth());
ACTION_RETURN_INT(twod->GetWidth());
}
DEFINE_ACTION_FUNCTION(_Screen, GetHeight)
DEFINE_ACTION_FUNCTION_NATIVE(_Screen, GetHeight, ScreenGetHeight)
{
PARAM_PROLOGUE;
ACTION_RETURN_INT(screen->GetHeight());
ACTION_RETURN_INT(twod->GetHeight());
}
DEFINE_ACTION_FUNCTION(_Screen, PaletteColor)

View file

@ -932,7 +932,7 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx)
{
ExpVal constval = static_cast<FxConstant *>(basex)->GetValue();
FxExpression *x = new FxConstant(constval.GetInt(), ScriptPosition);
if (constval.GetInt() != constval.GetFloat())
if (constval.GetInt() != constval.GetFloat() && !Explicit)
{
ScriptPosition.Message(MSG_WARNING, "Truncation of floating point constant %f", constval.GetFloat());
}
@ -2170,7 +2170,6 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx)
ExpEmit FxPreIncrDecr::Emit(VMFunctionBuilder *build)
{
assert(Token == TK_Incr || Token == TK_Decr);
assert(ValueType == Base->ValueType && IsNumeric());
int zero = build->GetConstantInt(0);
int regtype = ValueType->GetRegType();
@ -2257,7 +2256,6 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx)
ExpEmit FxPostIncrDecr::Emit(VMFunctionBuilder *build)
{
assert(Token == TK_Incr || Token == TK_Decr);
assert(ValueType == Base->ValueType && IsNumeric());
int zero = build->GetConstantInt(0);
int regtype = ValueType->GetRegType();
@ -5261,7 +5259,6 @@ FxExpression *FxMinMax::Resolve(FCompileContext &ctx)
else
{
ExpVal value = static_cast<FxConstant *>(choices[j])->GetValue();
assert(value.Type == ValueType);
if (Type == NAME_Min)
{
if (value.Type->GetRegType() == REGT_FLOAT)

View file

@ -564,6 +564,20 @@ DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, Substitute, StringSubst)
return 0;
}
static void StringStripRight(FString* self, const FString& junk)
{
if (junk.IsNotEmpty()) self->StripRight(junk);
else self->StripRight();
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, StripRight, StringStripRight)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_STRING(junk);
StringStripRight(self, junk);
return 0;
}
static void StringSplit(FString* self, TArray<FString>* tokens, const FString& delimiter, int keepEmpty)
{
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));

View file

@ -50,6 +50,8 @@
#include "i_interface.h"
#include "base_sbar.h"
#include "image.h"
#include "s_soundinternal.h"
#include "i_time.h"
//==========================================================================
//
@ -696,6 +698,18 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetGlyphHeight, GetGlyphHeight)
PARAM_INT(code);
ACTION_RETURN_INT(GetGlyphHeight(self, code));
}
static int GetDefaultKerning(FFont* font)
{
return font->GetDefaultKerning();
}
DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetDefaultKerning, GetDefaultKerning)
{
PARAM_SELF_STRUCT_PROLOGUE(FFont);
ACTION_RETURN_INT(self->GetDefaultKerning());
}
//==========================================================================
//
// file system
@ -989,6 +1003,58 @@ DEFINE_ACTION_FUNCTION(_Console, Printf)
return 0;
}
static void StopAllSounds()
{
soundEngine->StopAllChannels();
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, StopAllSounds, StopAllSounds)
{
StopAllSounds();
return 0;
}
static int PlayMusic(const FString& musname, int order, int looped)
{
return S_ChangeMusic(musname, order, !!looped, true);
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, PlayMusic, PlayMusic)
{
PARAM_PROLOGUE;
PARAM_STRING(name);
PARAM_INT(order);
PARAM_BOOL(looped);
ACTION_RETURN_BOOL(PlayMusic(name, order, looped));
}
static void Mus_Stop()
{
S_StopMusic(true);
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, StopMusic, Mus_Stop)
{
Mus_Stop();
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, SoundEnabled, SoundEnabled)
{
ACTION_RETURN_INT(SoundEnabled());
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, MusicEnabled, MusicEnabled)
{
ACTION_RETURN_INT(MusicEnabled());
}
DEFINE_ACTION_FUNCTION_NATIVE(_System, GetTimeFrac, I_GetTimeFrac)
{
ACTION_RETURN_FLOAT(I_GetTimeFrac());
}
DEFINE_GLOBAL_NAMED(mus_playing, musplaying);
DEFINE_FIELD_X(MusPlayingInfo, MusPlayingInfo, name);
DEFINE_FIELD_X(MusPlayingInfo, MusPlayingInfo, baseorder);

View file

@ -577,10 +577,6 @@ void DStatusBarCore::DrawGraphic(FGameTexture* tex, double x, double y, int flag
x += orgx;
y += orgy;
}
if (clipwidth != -1)
{
int a = 0;
}
DrawTexture(twod, tex, x, y,
DTA_TopOffset, 0,
DTA_LeftOffset, 0,
@ -821,7 +817,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d
DTA_FillColor, 0,
TAG_DONE);
}
DrawChar(twod, font, pt == 0? fontcolor : CR_UNDEFINED, rx, ry, ch,
DrawChar(twod, font, pt == 0? fontcolor : CR_NATIVEPAL, rx, ry, ch,
DTA_DestWidthF, rw,
DTA_DestHeightF, rh,
DTA_Alpha, Alpha,
@ -840,7 +836,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d
void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int pt, int style)
{
if (font == nullptr) ThrowAbortException(X_READ_NIL, nullptr);
if (font == nullptr || font->mFont == nullptr) ThrowAbortException(X_READ_NIL, nullptr);
if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
// resolve auto-alignment before making any adjustments to the position values.

View file

@ -198,6 +198,11 @@ public:
return Pitch;
}
int GetBufferSize() const
{
return Pitch * Height;
}
const uint8_t *GetPixels() const
{
return data;

View file

@ -41,48 +41,6 @@
#include "fontchars.h"
#include "engineerrors.h"
//==========================================================================
//
// FFontChar1 :: FFontChar1
//
// Used by fonts made from textures.
//
//==========================================================================
FFontChar1::FFontChar1 (FImageSource *sourcelump)
: BaseTexture(sourcelump), SourceRemap (nullptr)
{
// now copy all the properties from the base texture
assert(BaseTexture != nullptr);
CopySize(*BaseTexture);
bUseGamePalette = false;
}
//==========================================================================
//
// FFontChar1 :: GetPixels
//
// Render style is not relevant for fonts. This must not use it!
//
//==========================================================================
TArray<uint8_t> FFontChar1::CreatePalettedPixels (int)
{
// Make the texture as normal, then remap it so that all the colors
// are at the low end of the palette
// Why? It only creates unnecessary work!
auto Pixels = BaseTexture->GetPalettedPixels(normal);
if (SourceRemap)
{
for (int x = 0; x < Width*Height; ++x)
{
Pixels[x] = SourceRemap[Pixels[x]];
}
}
return Pixels;
}
//==========================================================================
//
// FFontChar2 :: FFontChar2
@ -91,8 +49,8 @@ TArray<uint8_t> FFontChar1::CreatePalettedPixels (int)
//
//==========================================================================
FFontChar2::FFontChar2 (int sourcelump, int sourcepos, int width, int height, int leftofs, int topofs)
: SourceLump (sourcelump), SourcePos (sourcepos), SourceRemap(nullptr)
FFontChar2::FFontChar2(int sourcelump, int sourcepos, int width, int height, int leftofs, int topofs)
: SourceLump(sourcelump), SourcePos(sourcepos)
{
Width = width;
Height = height;
@ -100,17 +58,6 @@ FFontChar2::FFontChar2 (int sourcelump, int sourcepos, int width, int height, in
TopOffset = topofs;
}
//==========================================================================
//
// FFontChar2 :: SetSourceRemap
//
//==========================================================================
void FFontChar2::SetSourceRemap(const uint8_t *sourceremap)
{
SourceRemap = sourceremap;
}
//==========================================================================
//
// FFontChar2 :: Get8BitPixels
@ -121,7 +68,7 @@ void FFontChar2::SetSourceRemap(const uint8_t *sourceremap)
TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
{
auto lump = fileSystem.OpenFileReader (SourceLump);
auto lump = fileSystem.OpenFileReader(SourceLump);
int destSize = Width * Height;
uint8_t max = 255;
bool rle = true;
@ -129,23 +76,23 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
// This is to "fix" bad fonts
{
uint8_t buff[16];
lump.Read (buff, 4);
lump.Read(buff, 4);
if (buff[3] == '2')
{
lump.Read (buff, 7);
lump.Read(buff, 7);
max = buff[6];
lump.Seek (SourcePos - 11, FileReader::SeekCur);
lump.Seek(SourcePos - 11, FileReader::SeekCur);
}
else if (buff[3] == 0x1A)
{
lump.Read(buff, 13);
max = buff[12] - 1;
lump.Seek (SourcePos - 17, FileReader::SeekCur);
lump.Seek(SourcePos - 17, FileReader::SeekCur);
rle = false;
}
else
{
lump.Seek (SourcePos - 4, FileReader::SeekCur);
lump.Seek(SourcePos - 4, FileReader::SeekCur);
}
}
@ -153,7 +100,7 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
int runlen = 0, setlen = 0;
uint8_t setval = 0; // Shut up, GCC!
uint8_t *dest_p = Pixels.Data();
uint8_t* dest_p = Pixels.Data();
int dest_adv = Height;
int dest_rew = destSize - 1;
@ -166,11 +113,7 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
if (runlen != 0)
{
uint8_t color = lump.ReadUInt8();
color = MIN (color, max);
if (SourceRemap != nullptr)
{
color = SourceRemap[color];
}
color = MIN(color, max);
*dest_p = color;
dest_p += dest_adv;
x--;
@ -194,11 +137,7 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
{
uint8_t color = lump.ReadUInt8();
setlen = (-code) + 1;
setval = MIN (color, max);
if (SourceRemap != nullptr)
{
setval = SourceRemap[setval];
}
setval = MIN(color, max);
}
}
}
@ -216,10 +155,6 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
{
color = max;
}
if (SourceRemap != nullptr)
{
color = SourceRemap[color];
}
*dest_p = color;
dest_p += dest_adv;
}
@ -230,10 +165,17 @@ TArray<uint8_t> FFontChar2::CreatePalettedPixels(int)
if (destSize < 0)
{
char name[9];
fileSystem.GetFileShortName (name, SourceLump);
fileSystem.GetFileShortName(name, SourceLump);
name[8] = 0;
I_FatalError ("The font %s is corrupt", name);
I_FatalError("The font %s is corrupt", name);
}
return Pixels;
}
int FFontChar2::CopyPixels(FBitmap* bmp, int conversion)
{
if (conversion == luminance) conversion = normal; // luminance images have no use as an RGB source.
auto ppix = CreatePalettedPixels(conversion);
bmp->CopyPixelData(0, 0, ppix.Data(), Width, Height, Height, 1, 0, SourceRemap, nullptr);
return 0;
}

View file

@ -1,21 +1,5 @@
// This is a font character that loads a texture and recolors it.
class FFontChar1 : public FImageSource
{
public:
FFontChar1 (FImageSource *sourcelump);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
void SetSourceRemap(const uint8_t *sourceremap) { SourceRemap = sourceremap; }
const uint8_t *ResetSourceRemap() { auto p = SourceRemap; SourceRemap = nullptr; return p; }
FImageSource *GetBase() const { return BaseTexture; }
protected:
FImageSource *BaseTexture;
const uint8_t *SourceRemap;
};
// This is a font character that reads RLE compressed data.
class FFontChar2 : public FImageSource
{
@ -23,10 +7,15 @@ public:
FFontChar2 (int sourcelump, int sourcepos, int width, int height, int leftofs=0, int topofs=0);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
void SetSourceRemap(const uint8_t *sourceremap);
int CopyPixels(FBitmap* bmp, int conversion);
void SetSourceRemap(const PalEntry* sourceremap)
{
SourceRemap = sourceremap;
}
protected:
int SourceLump;
int SourcePos;
const uint8_t *SourceRemap;
const PalEntry *SourceRemap;
};

View file

@ -74,6 +74,7 @@ protected:
uint32_t StartOfPalette = 0;
};
FImageSource* StbImage_TryCreate(FileReader& file, int lumpnum);
//==========================================================================
//
@ -127,6 +128,46 @@ FImageSource *PNGImage_TryCreate(FileReader & data, int lumpnum)
}
if (!((1 << bitdepth) & 0x116))
{
// Try STBImage for 16 bit PNGs.
auto tex = StbImage_TryCreate(data, lumpnum);
if (tex)
{
// STBImage does not handle grAb, so do that here and insert the data into the texture.
data.Seek(33, FileReader::SeekSet);
int len = data.ReadInt32BE();
int id = data.ReadInt32();
while (id != MAKE_ID('I', 'D', 'A', 'T') && id != MAKE_ID('I', 'E', 'N', 'D'))
{
if (id != MAKE_ID('g', 'r', 'A', 'b'))
{
data.Seek(len, FileReader::SeekCur);
}
else
{
int ihotx = data.ReadInt32BE();
int ihoty = data.ReadInt32BE();
if (ihotx < -32768 || ihotx > 32767)
{
Printf("X-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName(lumpnum), ihotx, ihotx);
ihotx = 0;
}
if (ihoty < -32768 || ihoty > 32767)
{
Printf("Y-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName(lumpnum), ihoty, ihoty);
ihoty = 0;
}
tex->SetOffsets(ihotx, ihoty);
}
data.Seek(4, FileReader::SeekCur); // Skip CRC
len = data.ReadInt32BE();
id = MAKE_ID('I', 'E', 'N', 'D');
id = data.ReadInt32();
}
return tex;
}
Printf(TEXTCOLOR_YELLOW"WARNING: failed to load PNG %s: the bit-depth (%u) is not supported!\n", fileSystem.GetFileFullName(lumpnum), bitdepth);
return NULL;
}
@ -185,13 +226,8 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, int width, int height,
case MAKE_ID('g','r','A','b'):
// This is like GRAB found in an ILBM, except coordinates use 4 bytes
{
uint32_t hotx, hoty;
int ihotx, ihoty;
lump.Read(&hotx, 4);
lump.Read(&hoty, 4);
ihotx = BigLong((int)hotx);
ihoty = BigLong((int)hoty);
int ihotx = lump.ReadInt32BE();
int ihoty = lump.ReadInt32BE();
if (ihotx < -32768 || ihotx > 32767)
{
Printf ("X-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName (lumpnum), ihotx, ihotx);

View file

@ -37,7 +37,7 @@
#define STBI_NO_STDIO
// Undefine formats we do not want to support here.
#define STBI_NO_JPEG
#define STBI_NO_PNG
//#define STBI_NO_PNG we need PNG for 16 bit channel images. Regular ones still use our own, more flexible decoder.
#define STBI_NO_TGA
#define STBI_NO_PSD
#define STBI_NO_HDR

View file

@ -65,8 +65,16 @@ private:
// This is needed for allowing the client to allocate slots that aren't matched to a palette, e.g. Build's indexed variants.
if (translation >= 0)
{
auto remap = GPalette.TranslationToTable(translation);
translation = remap == nullptr ? 0 : remap->Index;
if (!IsLuminosityTranslation(translation))
{
auto remap = GPalette.TranslationToTable(translation);
translation = remap == nullptr ? 0 : remap->Index;
}
else
{
// only needs to preserve the color range plus an identifier for marking this a luminosity translation.
translation = ((translation >> 16) & 0x3fff) | 0xff0000;
}
}
else translation &= ~0x7fffffff;

View file

@ -321,6 +321,7 @@ bool FTexture::ProcessData(unsigned char* buffer, int w, int h, bool ispatch)
// Initializes the buffer for the texture data
//
//===========================================================================
void V_ApplyLuminosityTranslation(int translation, uint8_t *buffer, int size);
FTextureBuffer FTexture::CreateTexBuffer(int translation, int flags)
{
@ -356,7 +357,7 @@ FTextureBuffer FTexture::CreateTexBuffer(int translation, int flags)
buffer = new unsigned char[W * (H + 1) * 4];
memset(buffer, 0, W * (H + 1) * 4);
auto remap = translation <= 0 ? nullptr : GPalette.TranslationToTable(translation);
auto remap = translation <= 0 || IsLuminosityTranslation(translation) ? nullptr : GPalette.TranslationToTable(translation);
if (remap && remap->Inactive) remap = nullptr;
if (remap) translation = remap->Index;
FBitmap bmp(buffer, W * 4, W, H);
@ -364,6 +365,10 @@ FTextureBuffer FTexture::CreateTexBuffer(int translation, int flags)
int trans;
auto Pixels = GetBgraBitmap(remap ? remap->Palette : nullptr, &trans);
bmp.Blit(exx, exx, Pixels);
if (IsLuminosityTranslation(translation))
{
V_ApplyLuminosityTranslation(translation, buffer, W * H);
}
if (remap == nullptr)
{

View file

@ -331,13 +331,8 @@ FString ExtractFileBase (const char *path, bool include_extension)
}
#endif
if (!include_extension)
if (!include_extension && (dot = strrchr(src, '.')))
{
dot = src;
while (*dot && *dot != '.')
{
dot++;
}
return FString(src, dot - src);
}
else

View file

@ -195,9 +195,16 @@ void I_FreezeTime(bool frozen)
else
{
assert(FreezeTime != 0);
FirstFrameStartTime += GetClockTimeNS() - FreezeTime;
if (FirstFrameStartTime != 0) FirstFrameStartTime += GetClockTimeNS() - FreezeTime;
FreezeTime = 0;
I_SetFrameTime();
}
}
void I_ResetFrameTime()
{
// Reset the starting point of the current frame to now. For use after lengthy operations that should not result in tic accumulation.
auto ft = CurrentFrameStartTime;
I_SetFrameTime();
FirstFrameStartTime += (CurrentFrameStartTime - ft);
}

View file

@ -38,3 +38,6 @@ uint64_t I_msTimeFS();
// Nanosecond-accurate time
uint64_t I_nsTime();
// Reset the timer after a lengthy operation
void I_ResetFrameTime();

View file

@ -354,6 +354,8 @@ int getAlternative(int code)
default:
return code;
case '{': return '(';
case '}': return ')';
case 0x17f: return 's'; // The 'long s' can be safely remapped to the regular variant, not that this gets used in any real text...
case 0x218: return 0x15e; // Romanian S with comma below may get remapped to S with cedilla.
case 0x219: return 0x15f;

View file

@ -191,7 +191,7 @@ void FNotifyBuffer::Draw()
FFont* font = generic_ui ? NewSmallFont : SmallFont? SmallFont : AlternativeSmallFont;
double nfscale = (generic_ui? 0.7 : NotifyFontScale);
double scale = 1 / ( * con_notifyscale);
double scale = 1 / (nfscale * con_notifyscale);
double line = Top + font->GetDisplacement() / nfscale;
double lineadv = font->GetHeight () / nfscale;

View file

@ -54,7 +54,7 @@
bool G_Responder (event_t *ev)
{
if (gamestate == GS_INTRO || gamestate == GS_INTERMISSION)
if (gamestate == GS_INTRO || gamestate == GS_CUTSCENE)
{
return ScreenJobResponder(ev);
}

Some files were not shown because too many files have changed in this diff Show more