Fix mingw build + copy d3drm from wine (#25)

* Fix engineConfig declaration crossing jump

This fixes the following error:
```
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp: In member function 'virtual MxResult MxSoundManager::Create(MxU32, MxBool)':
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:119:1: error: jump to label 'done'
  119 | done:
      | ^~~~
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:78:22: note:   from here
   78 |                 goto done;
      |                      ^~~~
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:84:26: note:   crosses initialization of 'ma_engine_config engineConfig'
   84 |         ma_engine_config engineConfig = ma_engine_config_init();
      |                          ^~~~~~~~~~~~
```

* Fix 'invalid conversion from 'SDL_FunctionPointer' {aka 'void (*)()'} to 'void*'

* /SAFESEH:NO is a VC thing

* SDL3 is still instable

* Cannot forward declare and use enum

* Remove MusicManager from public LEGO1.DLL interface

* Copy d3d from wine git 6c5d17af07a318d754c0c21023b2d162a0d3725d

* Build d3drm-wine with 32-bit mingw

* cmake: move 3rd party targets to cmake script in 3rdparty directory

* cmake: bump minimum required CMake version to 3.25 to allow adding a subproject with SYSTEM automatically applied

An alternative would be to use SYSTEM in target_include_directories in the 3rd party cmake script.

* Add a minimal Findiniparser.cmake (not all distributions carry the upstream iniparser-config.cmake files)

* Add wine's d3drm headers

* cmake: merge ISLE_USE_DX5_LIBS into ISLE_USE_DX5

* cmake: Build all shared libraries in the binary output directory (to avoid PATH issues)

* ci: enable msys2 mingw32 build

* Disable clang-tidy on d3drm wine

* Thread functions must have SDLCALL call convention

* cmake: disable clang-tidy for miniaudio and libsmacker as well

* Hopefully fix c++ format and skip ncc naming violation

* clang-format violations keep up popping out of nowhere

* No need for lego/legoomni/include

* ncc: define SDLCALL as empty instead
This commit is contained in:
Anonymous Maarten 2024-06-24 16:25:51 +02:00 committed by Anonymous Maarten
parent 0f77823a7e
commit ec19d5edb0
38 changed files with 23460 additions and 50 deletions

View file

@ -15,7 +15,7 @@ jobs:
toolchain:
- { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true }
# TODO: Add back eventually, but exclude 3rdparty code from warnings as errors
# - { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true, werror: true }
- { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true, werror: true, no-dx5-libs: true }
# - { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true, werror: true, no-dx5-libs: true }
steps:

View file

@ -29,7 +29,7 @@ jobs:
--recurse \
--style tools/ncc/ncc.style \
--skip tools/ncc/skip.yml \
--definition WINAPI FAR BOOL CALLBACK HWND__=HWND \
--definition WINAPI FAR BOOL CALLBACK HWND__=HWND SDLCALL \
--include \
util \
LEGO1 \

26
3rdparty/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,26 @@
set(CMAKE_C_CLANG_TIDY)
add_library(miniaudio STATIC
miniaudio/extras/miniaudio_split/miniaudio.c
)
target_include_directories(miniaudio PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/miniaudio/extras/miniaudio_split")
set_property(TARGET miniaudio PROPERTY ARCHIVE_OUTPUT_NAME "miniaudio$<$<CONFIG:Debug>:d>")
# Disable most features since we don't need them.
target_compile_definitions(miniaudio PUBLIC
MA_ENABLE_ONLY_SPECIFIC_BACKENDS
MA_NO_DECODING
MA_NO_ENCODING
MA_NO_WAV
MA_NO_FLAC
MA_NO_MP3
MA_NO_DEVICE_IO
MA_NO_RESOURCE_MANAGER
MA_NO_GENERATION
MA_NO_THREADING
)
add_library(libsmacker STATIC
libsmacker/smacker.c
)
set_property(TARGET libsmacker PROPERTY ARCHIVE_OUTPUT_NAME "libsmacker$<$<CONFIG:Debug>:d>")
target_include_directories(libsmacker PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libsmacker")

30
3rdparty/d3drm/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,30 @@
project(wine_d3drm LANGUAGES C)
set(CMAKE_C_CLANG_TIDY)
add_library(d3drm-wine SHARED EXCLUDE_FROM_ALL
d3drm.c
d3drm_main.c
d3drm_private.h
d3drm.spec
device.c
face.c
frame.c
light.c
material.c
math.c
meshbuilder.c
texture.c
version.rc
viewport.c
d3drm.def
)
target_include_directories(d3drm-wine SYSTEM INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
target_link_libraries(d3drm-wine PRIVATE d3dxof ddraw)
set_property(TARGET d3drm-wine PROPERTY PREFIX "")
set_property(TARGET d3drm-wine PROPERTY OUTPUT_NAME "d3drm")
target_compile_definitions(d3drm-wine PRIVATE "__WINESRC__")
target_compile_definitions(d3drm-wine PRIVATE "WINE_NO_TRACE_MSGS")
target_compile_definitions(d3drm-wine PRIVATE "WINE_NO_DEBUG_MSGS")
target_compile_definitions(d3drm-wine PRIVATE "DECLSPEC_EXPORT=")

502
3rdparty/d3drm/COPYING.LIB vendored Normal file
View file

@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

19
3rdparty/d3drm/Makefile.in vendored Normal file
View file

@ -0,0 +1,19 @@
MODULE = d3drm.dll
IMPORTLIB = d3drm
IMPORTS = d3dxof ddraw
EXTRADLLFLAGS = -Wb,--prefer-native
SOURCES = \
d3drm.c \
d3drm_main.c \
device.c \
face.c \
frame.c \
light.c \
material.c \
math.c \
meshbuilder.c \
texture.c \
version.rc \
viewport.c

2350
3rdparty/d3drm/d3drm.c vendored Normal file

File diff suppressed because it is too large Load diff

22
3rdparty/d3drm/d3drm.def vendored Normal file
View file

@ -0,0 +1,22 @@
EXPORTS
D3DRMColorGetAlpha@4
D3DRMColorGetBlue@4
D3DRMColorGetGreen@4
D3DRMColorGetRed@4
D3DRMCreateColorRGB@12
D3DRMCreateColorRGBA@16
D3DRMMatrixFromQuaternion@8
D3DRMQuaternionFromRotation@12
D3DRMQuaternionMultiply@12
D3DRMQuaternionSlerp@16
D3DRMVectorAdd@12
D3DRMVectorCrossProduct@12
D3DRMVectorDotProduct@8
D3DRMVectorModulus@4
D3DRMVectorNormalize@4
D3DRMVectorRandom@4
D3DRMVectorReflect@12
D3DRMVectorRotate@16
D3DRMVectorScale@12
D3DRMVectorSubtract@12
Direct3DRMCreate@4

23
3rdparty/d3drm/d3drm.spec vendored Normal file
View file

@ -0,0 +1,23 @@
@ stdcall D3DRMColorGetAlpha(long)
@ stdcall D3DRMColorGetBlue(long)
@ stdcall D3DRMColorGetGreen(long)
@ stdcall D3DRMColorGetRed(long)
@ stdcall D3DRMCreateColorRGB(float float float)
@ stdcall D3DRMCreateColorRGBA(float float float float)
@ stdcall D3DRMMatrixFromQuaternion(ptr ptr)
@ stdcall D3DRMQuaternionFromRotation(ptr ptr float)
@ stdcall D3DRMQuaternionMultiply(ptr ptr ptr)
@ stdcall D3DRMQuaternionSlerp(ptr ptr ptr float)
@ stdcall D3DRMVectorAdd(ptr ptr ptr)
@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr)
@ stdcall D3DRMVectorDotProduct(ptr ptr)
@ stdcall D3DRMVectorModulus(ptr)
@ stdcall D3DRMVectorNormalize(ptr)
@ stdcall D3DRMVectorRandom(ptr)
@ stdcall D3DRMVectorReflect(ptr ptr ptr)
@ stdcall D3DRMVectorRotate(ptr ptr ptr float)
@ stdcall D3DRMVectorScale(ptr ptr float)
@ stdcall D3DRMVectorSubtract(ptr ptr ptr)
@ stdcall Direct3DRMCreate(ptr)
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)

150
3rdparty/d3drm/d3drm_main.c vendored Normal file
View file

@ -0,0 +1,150 @@
/*
* Copyright 2004 Ivan Leo Puoti
* Copyright 2010 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "initguid.h"
#include "d3drm_private.h"
void d3drm_object_init(struct d3drm_object *object, const char *classname)
{
object->ref = 1;
object->appdata = 0;
list_init(&object->destroy_callbacks);
object->classname = classname;
object->name = NULL;
}
struct destroy_callback
{
struct list entry;
D3DRMOBJECTCALLBACK cb;
void *ctx;
};
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct destroy_callback *callback;
if (!cb)
return D3DRMERR_BADVALUE;
if (!(callback = malloc(sizeof(*callback))))
return E_OUTOFMEMORY;
callback->cb = cb;
callback->ctx = ctx;
list_add_head(&object->destroy_callbacks, &callback->entry);
return D3DRM_OK;
}
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct destroy_callback *callback;
if (!cb)
return D3DRMERR_BADVALUE;
LIST_FOR_EACH_ENTRY(callback, &object->destroy_callbacks, struct destroy_callback, entry)
{
if (callback->cb == cb && callback->ctx == ctx)
{
list_remove(&callback->entry);
free(callback);
break;
}
}
return D3DRM_OK;
}
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name)
{
DWORD req_size;
if (!size)
return E_INVALIDARG;
req_size = strlen(object->classname) + 1;
if (name && *size < req_size)
return E_INVALIDARG;
*size = req_size;
if (name)
memcpy(name, object->classname, req_size);
return D3DRM_OK;
}
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name)
{
DWORD req_size;
if (!size)
return E_INVALIDARG;
req_size = object->name ? strlen(object->name) + 1 : 0;
if (name && *size < req_size)
return E_INVALIDARG;
if (name)
{
if (object->name)
memcpy(name, object->name, req_size);
else if (*size)
*name = 0;
}
*size = req_size;
return D3DRM_OK;
}
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name)
{
DWORD req_size;
free(object->name);
object->name = NULL;
if (name)
{
req_size = strlen(name) + 1;
if (!(object->name = malloc(req_size)))
return E_OUTOFMEMORY;
memcpy(object->name, name, req_size);
}
return D3DRM_OK;
}
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
{
struct destroy_callback *callback, *callback2;
LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry)
{
callback->cb(iface, callback->ctx);
list_remove(&callback->entry);
free(callback);
}
free(object->name);
object->name = NULL;
}

333
3rdparty/d3drm/d3drm_private.h vendored Normal file
View file

@ -0,0 +1,333 @@
/*
* Direct3DRM private interfaces (D3DRM.DLL)
*
* Copyright 2010 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __D3DRM_PRIVATE_INCLUDED__
#define __D3DRM_PRIVATE_INCLUDED__
#define COBJMACROS
#include <assert.h>
#include <math.h>
#include "dxfile.h"
#include "d3drmwin.h"
#include "rmxfguid.h"
#include "wine/debug.h"
#include "wine/list.h"
struct d3drm_matrix
{
float _11, _12, _13, _14;
float _21, _22, _23, _24;
float _31, _32, _33, _34;
float _41, _42, _43, _44;
};
static inline struct d3drm_matrix *d3drm_matrix(D3DRMMATRIX4D m)
{
return (struct d3drm_matrix *)m;
}
struct d3drm_object
{
LONG ref;
DWORD appdata;
struct list destroy_callbacks;
const char *classname;
char *name;
};
struct d3drm_texture
{
struct d3drm_object obj;
IDirect3DRMTexture IDirect3DRMTexture_iface;
IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
IDirect3DRM *d3drm;
D3DRMIMAGE *image;
IDirectDrawSurface *surface;
LONG decal_x;
LONG decal_y;
DWORD max_colors;
DWORD max_shades;
BOOL transparency;
D3DVALUE decal_width;
D3DVALUE decal_height;
};
struct d3drm_frame
{
struct d3drm_object obj;
IDirect3DRMFrame IDirect3DRMFrame_iface;
IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
IDirect3DRM *d3drm;
LONG ref;
struct d3drm_frame *parent;
SIZE_T nb_children;
SIZE_T children_size;
IDirect3DRMFrame3 **children;
SIZE_T nb_visuals;
SIZE_T visuals_size;
IDirect3DRMVisual **visuals;
SIZE_T nb_lights;
SIZE_T lights_size;
IDirect3DRMLight **lights;
struct d3drm_matrix transform;
D3DCOLOR scenebackground;
DWORD traversal_options;
};
struct d3drm_box
{
float left;
float top;
float right;
float bottom;
float front;
float back;
};
struct d3drm_viewport
{
struct d3drm_object obj;
struct d3drm_device *device;
IDirect3DRMFrame *camera;
IDirect3DRMViewport IDirect3DRMViewport_iface;
IDirect3DRMViewport2 IDirect3DRMViewport2_iface;
IDirect3DViewport *d3d_viewport;
IDirect3DMaterial *material;
IDirect3DRM *d3drm;
struct d3drm_box clip;
D3DRMPROJECTIONTYPE projection;
};
struct d3drm_device
{
struct d3drm_object obj;
IDirect3DRMDevice IDirect3DRMDevice_iface;
IDirect3DRMDevice2 IDirect3DRMDevice2_iface;
IDirect3DRMDevice3 IDirect3DRMDevice3_iface;
IDirect3DRMWinDevice IDirect3DRMWinDevice_iface;
IDirect3DRM *d3drm;
IDirectDraw *ddraw;
IDirectDrawSurface *primary_surface, *render_target;
IDirectDrawClipper *clipper;
IDirect3DDevice *device;
BOOL dither;
D3DRMRENDERQUALITY quality;
DWORD rendermode;
DWORD height;
DWORD width;
};
struct d3drm_face
{
struct d3drm_object obj;
IDirect3DRMFace IDirect3DRMFace_iface;
IDirect3DRMFace2 IDirect3DRMFace2_iface;
LONG ref;
D3DCOLOR color;
};
struct d3drm_mesh_builder
{
struct d3drm_object obj;
IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface;
IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface;
LONG ref;
IDirect3DRM *d3drm;
SIZE_T nb_vertices;
SIZE_T vertices_size;
D3DVECTOR *vertices;
SIZE_T nb_normals;
SIZE_T normals_size;
D3DVECTOR *normals;
DWORD nb_faces;
DWORD face_data_size;
void *pFaceData;
DWORD nb_coords2d;
struct coords_2d *pCoords2d;
D3DCOLOR color;
IDirect3DRMMaterial2 *material;
IDirect3DRMTexture3 *texture;
DWORD nb_materials;
struct mesh_material *materials;
DWORD *material_indices;
D3DRMRENDERQUALITY quality;
};
struct mesh_group
{
unsigned nb_vertices;
D3DRMVERTEX* vertices;
unsigned nb_faces;
unsigned vertex_per_face;
DWORD face_data_size;
unsigned* face_data;
D3DCOLOR color;
IDirect3DRMMaterial2* material;
IDirect3DRMTexture3* texture;
};
struct d3drm_mesh
{
struct d3drm_object obj;
IDirect3DRMMesh IDirect3DRMMesh_iface;
LONG ref;
IDirect3DRM *d3drm;
SIZE_T nb_groups;
SIZE_T groups_size;
struct mesh_group *groups;
};
struct d3drm_light
{
struct d3drm_object obj;
IDirect3DRMLight IDirect3DRMLight_iface;
LONG ref;
IDirect3DRM *d3drm;
D3DRMLIGHTTYPE type;
D3DCOLOR color;
D3DVALUE range;
D3DVALUE cattenuation;
D3DVALUE lattenuation;
D3DVALUE qattenuation;
D3DVALUE umbra;
D3DVALUE penumbra;
};
struct color_rgb
{
D3DVALUE r;
D3DVALUE g;
D3DVALUE b;
};
struct d3drm_material
{
struct d3drm_object obj;
IDirect3DRMMaterial2 IDirect3DRMMaterial2_iface;
LONG ref;
IDirect3DRM *d3drm;
struct color_rgb emissive;
struct color_rgb specular;
D3DVALUE power;
struct color_rgb ambient;
};
struct d3drm_animation_key
{
D3DVALUE time;
union
{
D3DVECTOR position;
D3DVECTOR scale;
D3DRMQUATERNION rotate;
} u;
};
struct d3drm_animation_keys
{
struct d3drm_animation_key *keys;
SIZE_T count;
SIZE_T size;
};
struct d3drm_animation
{
struct d3drm_object obj;
IDirect3DRMAnimation2 IDirect3DRMAnimation2_iface;
IDirect3DRMAnimation IDirect3DRMAnimation_iface;
LONG ref;
IDirect3DRM *d3drm;
IDirect3DRMFrame3 *frame;
D3DRMANIMATIONOPTIONS options;
struct d3drm_animation_keys position;
struct d3drm_animation_keys scale;
struct d3drm_animation_keys rotate;
};
struct d3drm_wrap
{
struct d3drm_object obj;
IDirect3DRMWrap IDirect3DRMWrap_iface;
LONG ref;
};
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm);
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw,
IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface);
void d3drm_device_destroy(struct d3drm_device *device);
HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw,
IDirectDrawSurface *surface, BOOL create_z_surface);
void d3drm_object_init(struct d3drm_object *object, const char *classname);
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx);
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx);
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name);
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name);
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name);
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object);
struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface);
struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
struct d3drm_device *unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface);
HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm);
HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm);
HRESULT d3drm_face_create(struct d3drm_face **face);
HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm);
HRESULT d3drm_mesh_builder_create(struct d3drm_mesh_builder **mesh_builder, IDirect3DRM *d3drm);
HRESULT d3drm_light_create(struct d3drm_light **light, IDirect3DRM *d3drm);
HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm);
HRESULT d3drm_mesh_create(struct d3drm_mesh **mesh, IDirect3DRM *d3drm);
HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm);
HRESULT d3drm_wrap_create(struct d3drm_wrap **wrap, IDirect3DRM *d3drm);
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg);
struct d3drm_file_header
{
WORD major;
WORD minor;
DWORD flags;
};
extern char templates[];
static inline BYTE d3drm_color_component(float c)
{
if (c <= 0.0f)
return 0u;
if (c >= 1.0f)
return 0xffu;
return floor(c * 255.0f);
}
static inline void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
{
*color = RGBA_MAKE(d3drm_color_component(r), d3drm_color_component(g),
d3drm_color_component(b), d3drm_color_component(a));
}
BOOL d3drm_array_reserve(void **elements, SIZE_T *capacity, SIZE_T element_count, SIZE_T element_size);
#endif /* __D3DRM_PRIVATE_INCLUDED__ */

103
3rdparty/d3drm/d3drmwin.h vendored Normal file
View file

@ -0,0 +1,103 @@
/*
* Copyright (C) 2010 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __D3DRMWIN_H__
#define __D3DRMWIN_H__
#include <d3drm.h>
#include <ddraw.h>
#include <d3d.h>
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* Direct3DRMWinDevice interface GUID
*/
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
typedef struct IDirect3DRMWinDevice *LPDIRECT3DRMWINDEVICE, **LPLPDIRECT3DRMWINDEVICE;
/*****************************************************************************
* IDirect3DRMWinDevice interface
*/
#define INTERFACE IDirect3DRMWinDevice
DECLARE_INTERFACE_(IDirect3DRMWinDevice,IDirect3DRMObject)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DRMObject methods ***/
STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE;
STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
STDMETHOD(SetName)(THIS_ const char *name) PURE;
STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE;
STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE;
/*** IDirect3DRMWinDevice methods ***/
STDMETHOD(HandlePaint)(THIS_ HDC) PURE;
STDMETHOD(HandleActivate)(THIS_ WORD) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DRMWinDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DRMWinDevice_Release(p) (p)->lpVtbl->Release(p)
/*** IDirect3DRMObject methods ***/
#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c)
#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b)
#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a)
#define IDirect3DRMWinDevice_GetAppData(p) (p)->lpVtbl->GetAppData(p)
#define IDirect3DRMWinDevice_SetName(p,a) (p)->lpVtbl->SetName(p,a)
#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b)
/*** IDirect3DRMWinDevice methods ***/
#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->lpVtbl->HandlePaint(p,a)
#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->lpVtbl->HandleActivate(p,a)
#else
/*** IUnknown methods ***/
#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3DRMWinDevice_AddRef(p) (p)->AddRef()
#define IDirect3DRMwinDevice_Release(p) (p)->Release()
/*** IDirect3DRMObject methods ***/
#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->Clone(a,b,c)
#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b)
#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->SetAppData(a)
#define IDirect3DRMWinDevice_GetAppData(p) (p)->GetAppData()
#define IDirect3DRMWinDevice_SetName(p,a) (p)->SetName(a)
#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->GetName(a,b)
#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->GetClassName(a,b)
/*** IDirect3DRMWinDevice methods ***/
#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->HandlePaint(a)
#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->HandleActivate(a)
#endif
#ifdef __cplusplus
}
#endif
#endif /* __D3DRMWIN_H__ */

1676
3rdparty/d3drm/device.c vendored Normal file

File diff suppressed because it is too large Load diff

639
3rdparty/d3drm/face.c vendored Normal file
View file

@ -0,0 +1,639 @@
/*
* Implementation of IDirect3DRMFace Interface
*
* Copyright 2013 André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "d3drm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
static inline struct d3drm_face *impl_from_IDirect3DRMFace(IDirect3DRMFace *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace_iface);
}
static inline struct d3drm_face *impl_from_IDirect3DRMFace2(IDirect3DRMFace2 *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace2_iface);
}
static HRESULT WINAPI d3drm_face1_QueryInterface(IDirect3DRMFace *iface, REFIID riid, void **out)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_IDirect3DRMFace)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown))
{
*out = &face->IDirect3DRMFace_iface;
}
else if(IsEqualGUID(riid, &IID_IDirect3DRMFace2))
{
*out = &face->IDirect3DRMFace2_iface;
}
else
{
*out = NULL;
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown *)*out);
return S_OK;
}
static ULONG WINAPI d3drm_face1_AddRef(IDirect3DRMFace *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
ULONG refcount = InterlockedIncrement(&face->ref);
TRACE("%p increasing refcount to %lu.\n", iface, refcount);
return refcount;
}
static ULONG WINAPI d3drm_face1_Release(IDirect3DRMFace *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
ULONG refcount = InterlockedDecrement(&face->ref);
TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
if (!refcount)
{
d3drm_object_cleanup((IDirect3DRMObject *)iface, &face->obj);
free(face);
}
return refcount;
}
static HRESULT WINAPI d3drm_face1_Clone(IDirect3DRMFace *iface,
IUnknown *outer, REFIID iid, void **out)
{
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_AddDestroyCallback(IDirect3DRMFace *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return IDirect3DRMFace2_AddDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
}
static HRESULT WINAPI d3drm_face1_DeleteDestroyCallback(IDirect3DRMFace *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return IDirect3DRMFace2_DeleteDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
}
static HRESULT WINAPI d3drm_face2_SetAppData(IDirect3DRMFace2 *iface, DWORD data)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, data %#lx.\n", iface, data);
face->obj.appdata = data;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_face1_SetAppData(IDirect3DRMFace *iface, DWORD data)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, data %#lx.\n", iface, data);
return d3drm_face2_SetAppData(&face->IDirect3DRMFace2_iface, data);
}
static DWORD WINAPI d3drm_face2_GetAppData(IDirect3DRMFace2 *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p.\n", iface);
return face->obj.appdata;
}
static DWORD WINAPI d3drm_face1_GetAppData(IDirect3DRMFace *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p.\n", iface);
return d3drm_face2_GetAppData(&face->IDirect3DRMFace2_iface);
}
static HRESULT WINAPI d3drm_face2_SetName(IDirect3DRMFace2 *iface, const char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
return d3drm_object_set_name(&face->obj, name);
}
static HRESULT WINAPI d3drm_face1_SetName(IDirect3DRMFace *iface, const char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
return d3drm_face2_SetName(&face->IDirect3DRMFace2_iface, name);
}
static HRESULT WINAPI d3drm_face2_GetName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_name(&face->obj, size, name);
}
static HRESULT WINAPI d3drm_face1_GetName(IDirect3DRMFace *iface, DWORD *size, char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_face2_GetName(&face->IDirect3DRMFace2_iface, size, name);
}
static HRESULT WINAPI d3drm_face1_GetClassName(IDirect3DRMFace *iface, DWORD *size, char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return IDirect3DRMFace2_GetClassName(&face->IDirect3DRMFace2_iface, size, name);
}
static HRESULT WINAPI d3drm_face1_AddVertex(IDirect3DRMFace *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
{
FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_AddVertexAndNormalIndexed(IDirect3DRMFace *iface,
DWORD vertex, DWORD normal)
{
FIXME("iface %p, vertex %lu, normal %lu stub!\n", iface, vertex, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_SetColorRGB(IDirect3DRMFace2 *iface, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
d3drm_set_color(&face->color, red, green, blue, 1.0f);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_face1_SetColorRGB(IDirect3DRMFace *iface,
D3DVALUE red, D3DVALUE green, D3DVALUE blue)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
return d3drm_face2_SetColorRGB(&face->IDirect3DRMFace2_iface, red, green, blue);
}
static HRESULT WINAPI d3drm_face2_SetColor(IDirect3DRMFace2 *iface, D3DCOLOR color)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, color 0x%08lx.\n", iface, color);
face->color = color;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_face1_SetColor(IDirect3DRMFace *iface, D3DCOLOR color)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p, color 0x%08lx.\n", iface, color);
return d3drm_face2_SetColor(&face->IDirect3DRMFace2_iface, color);
}
static HRESULT WINAPI d3drm_face1_SetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture *texture)
{
FIXME("iface %p, texture %p stub!\n", iface, texture);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_SetTextureCoordinates(IDirect3DRMFace *iface,
DWORD vertex, D3DVALUE u, D3DVALUE v)
{
FIXME("iface %p, vertex %lu, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_SetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial *material)
{
FIXME("iface %p, material %p stub!\n", iface, material);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_SetTextureTopology(IDirect3DRMFace *iface, BOOL wrap_u, BOOL wrap_v)
{
FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetVertex(IDirect3DRMFace *iface,
DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
{
FIXME("iface %p, index %lu, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetVertices(IDirect3DRMFace *iface,
DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
{
FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
iface, vertex_count, coords, normals);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetTextureCoordinates(IDirect3DRMFace *iface,
DWORD vertex, D3DVALUE *u, D3DVALUE *v)
{
FIXME("iface %p, vertex %lu, u %p, v %p stub!\n", iface, vertex, u, v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetTextureTopology(IDirect3DRMFace *iface, BOOL *wrap_u, BOOL *wrap_v)
{
FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetNormal(IDirect3DRMFace *iface, D3DVECTOR *normal)
{
FIXME("iface %p, normal %p stub!\n", iface, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture **texture)
{
FIXME("iface %p, texture %p stub!\n", iface, texture);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face1_GetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial **material)
{
FIXME("iface %p, material %p stub!\n", iface, material);
return E_NOTIMPL;
}
static int WINAPI d3drm_face1_GetVertexCount(IDirect3DRMFace *iface)
{
FIXME("iface %p stub!\n", iface);
return 0;
}
static int WINAPI d3drm_face1_GetVertexIndex(IDirect3DRMFace *iface, DWORD which)
{
FIXME("iface %p, which %lu stub!\n", iface, which);
return 0;
}
static int WINAPI d3drm_face1_GetTextureCoordinateIndex(IDirect3DRMFace *iface, DWORD which)
{
FIXME("iface %p, which %lu stub!\n", iface, which);
return 0;
}
static D3DCOLOR WINAPI d3drm_face2_GetColor(IDirect3DRMFace2 *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p.\n", iface);
return face->color;
}
static D3DCOLOR WINAPI d3drm_face1_GetColor(IDirect3DRMFace *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
TRACE("iface %p.\n", iface);
return d3drm_face2_GetColor(&face->IDirect3DRMFace2_iface);
}
static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl =
{
d3drm_face1_QueryInterface,
d3drm_face1_AddRef,
d3drm_face1_Release,
d3drm_face1_Clone,
d3drm_face1_AddDestroyCallback,
d3drm_face1_DeleteDestroyCallback,
d3drm_face1_SetAppData,
d3drm_face1_GetAppData,
d3drm_face1_SetName,
d3drm_face1_GetName,
d3drm_face1_GetClassName,
d3drm_face1_AddVertex,
d3drm_face1_AddVertexAndNormalIndexed,
d3drm_face1_SetColorRGB,
d3drm_face1_SetColor,
d3drm_face1_SetTexture,
d3drm_face1_SetTextureCoordinates,
d3drm_face1_SetMaterial,
d3drm_face1_SetTextureTopology,
d3drm_face1_GetVertex,
d3drm_face1_GetVertices,
d3drm_face1_GetTextureCoordinates,
d3drm_face1_GetTextureTopology,
d3drm_face1_GetNormal,
d3drm_face1_GetTexture,
d3drm_face1_GetMaterial,
d3drm_face1_GetVertexCount,
d3drm_face1_GetVertexIndex,
d3drm_face1_GetTextureCoordinateIndex,
d3drm_face1_GetColor,
};
static HRESULT WINAPI d3drm_face2_QueryInterface(IDirect3DRMFace2 *iface, REFIID riid, void **out)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
return d3drm_face1_QueryInterface(&face->IDirect3DRMFace_iface, riid, out);
}
static ULONG WINAPI d3drm_face2_AddRef(IDirect3DRMFace2 *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
return d3drm_face1_AddRef(&face->IDirect3DRMFace_iface);
}
static ULONG WINAPI d3drm_face2_Release(IDirect3DRMFace2 *iface)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
return d3drm_face1_Release(&face->IDirect3DRMFace_iface);
}
static HRESULT WINAPI d3drm_face2_Clone(IDirect3DRMFace2 *iface,
IUnknown *outer, REFIID iid, void **out)
{
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_AddDestroyCallback(IDirect3DRMFace2 *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_add_destroy_callback(&face->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_face2_DeleteDestroyCallback(IDirect3DRMFace2 *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_delete_destroy_callback(&face->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_face2_GetClassName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
{
struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_class_name(&face->obj, size, name);
}
static HRESULT WINAPI d3drm_face2_AddVertex(IDirect3DRMFace2 *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
{
FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_AddVertexAndNormalIndexed(IDirect3DRMFace2 *iface,
DWORD vertex, DWORD normal)
{
FIXME("iface %p, vertex %lu, normal %lu stub!\n", iface, vertex, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_SetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 *texture)
{
FIXME("iface %p, texture %p stub!\n", iface, texture);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_SetTextureCoordinates(IDirect3DRMFace2 *iface,
DWORD vertex, D3DVALUE u, D3DVALUE v)
{
FIXME("iface %p, vertex %lu, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_SetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 *material)
{
FIXME("iface %p, material %p stub!\n", iface, material);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_SetTextureTopology(IDirect3DRMFace2 *iface, BOOL wrap_u, BOOL wrap_v)
{
FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetVertex(IDirect3DRMFace2 *iface,
DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
{
FIXME("iface %p, index %lu, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetVertices(IDirect3DRMFace2 *iface,
DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
{
FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
iface, vertex_count, coords, normals);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetTextureCoordinates(IDirect3DRMFace2 *iface,
DWORD vertex, D3DVALUE *u, D3DVALUE *v)
{
FIXME("iface %p, vertex %lu, u %p, v %p stub!\n", iface, vertex, u, v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetTextureTopology(IDirect3DRMFace2 *iface, BOOL *wrap_u, BOOL *wrap_v)
{
FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetNormal(IDirect3DRMFace2 *iface, D3DVECTOR *normal)
{
FIXME("iface %p, normal %p stub!\n", iface, normal);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 **texture)
{
FIXME("iface %p, texture %p stub!\n", iface, texture);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_face2_GetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 **material)
{
FIXME("iface %p, material %p stub!\n", iface, material);
return E_NOTIMPL;
}
static int WINAPI d3drm_face2_GetVertexCount(IDirect3DRMFace2 *iface)
{
FIXME("iface %p stub!\n", iface);
return 0;
}
static int WINAPI d3drm_face2_GetVertexIndex(IDirect3DRMFace2 *iface, DWORD which)
{
FIXME("iface %p, which %lu stub!\n", iface, which);
return 0;
}
static int WINAPI d3drm_face2_GetTextureCoordinateIndex(IDirect3DRMFace2 *iface, DWORD which)
{
FIXME("iface %p, which %lu stub!\n", iface, which);
return 0;
}
static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl =
{
d3drm_face2_QueryInterface,
d3drm_face2_AddRef,
d3drm_face2_Release,
d3drm_face2_Clone,
d3drm_face2_AddDestroyCallback,
d3drm_face2_DeleteDestroyCallback,
d3drm_face2_SetAppData,
d3drm_face2_GetAppData,
d3drm_face2_SetName,
d3drm_face2_GetName,
d3drm_face2_GetClassName,
d3drm_face2_AddVertex,
d3drm_face2_AddVertexAndNormalIndexed,
d3drm_face2_SetColorRGB,
d3drm_face2_SetColor,
d3drm_face2_SetTexture,
d3drm_face2_SetTextureCoordinates,
d3drm_face2_SetMaterial,
d3drm_face2_SetTextureTopology,
d3drm_face2_GetVertex,
d3drm_face2_GetVertices,
d3drm_face2_GetTextureCoordinates,
d3drm_face2_GetTextureTopology,
d3drm_face2_GetNormal,
d3drm_face2_GetTexture,
d3drm_face2_GetMaterial,
d3drm_face2_GetVertexCount,
d3drm_face2_GetVertexIndex,
d3drm_face2_GetTextureCoordinateIndex,
d3drm_face2_GetColor,
};
HRESULT d3drm_face_create(struct d3drm_face **face)
{
static const char classname[] = "Face";
struct d3drm_face *object;
TRACE("face %p.\n", face);
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl;
object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl;
object->ref = 1;
d3drm_object_init(&object->obj, classname);
*face = object;
return S_OK;
}

3905
3rdparty/d3drm/frame.c vendored Normal file

File diff suppressed because it is too large Load diff

524
3rdparty/d3drm/include/d3drm.h vendored Normal file
View file

@ -0,0 +1,524 @@
/*
* Copyright (C) 2005 Peter Berg Larsen
* Copyright (C) 2010 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __D3DRM_H__
#define __D3DRM_H__
#include <ddraw.h>
typedef struct IDirect3DRM *LPDIRECT3DRM, **LPLPDIRECT3DRM;
#include <d3drmobj.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Direct3DRM Object CLSID */
DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/* Direct3DRM Interface GUIDs */
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);
typedef struct IDirect3DRM2 *LPDIRECT3DRM2, **LPLPDIRECT3DRM2;
typedef struct IDirect3DRM3 *LPDIRECT3DRM3, **LPLPDIRECT3DRM3;
HRESULT WINAPI Direct3DRMCreate(struct IDirect3DRM **d3drm);
/*****************************************************************************
* IDirect3DRMObject interface
*/
#ifdef WINE_NO_UNICODE_MACROS
#undef GetClassName
#endif
#define INTERFACE IDirect3DRM
DECLARE_INTERFACE_(IDirect3DRM,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DRM methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder **mesh_builder) PURE;
STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE;
STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation **animation) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet **set) PURE;
STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture **texture) PURE;
STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE;
STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b,
IDirect3DRMLight **light) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE;
STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice **device) PURE;
STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw,
IDirectDrawSurface *surface, IDirect3DRMDevice **device) PURE;
STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D *d3d, IDirect3DDevice *d3d_device,
IDirect3DRMDevice **device) PURE;
STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid,
int width, int height, IDirect3DRMDevice **device) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface,
IDirect3DRMTexture **texture) PURE;
STDMETHOD(CreateShadow)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMLight *light,
D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
IDirect3DRMVisual **shadow) PURE;
STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice *device, IDirect3DRMFrame *camera,
DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) PURE;
STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame *reference, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov,
D3DVALUE su, D3DVALUE sv, IDirect3DRMWrap **wrap) PURE;
STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE;
STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture **texture) PURE;
STDMETHOD(LoadTextureFromResource)(THIS_ HRSRC resource, IDirect3DRMTexture **texture) PURE;
STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE;
STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE;
STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags,
D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx,
IDirect3DRMFrame *parent_frame) PURE;
STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirect3DRM_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DRM_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DRM_Release(p) (p)->lpVtbl->Release(p)
/*** IDirect3DRM methods ***/
#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d)
#define IDirect3DRM_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b)
#define IDirect3DRM_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a)
#define IDirect3DRM_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a)
#define IDirect3DRM_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a)
#define IDirect3DRM_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a)
#define IDirect3DRM_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a)
#define IDirect3DRM_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b)
#define IDirect3DRM_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c)
#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
#define IDirect3DRM_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
#define IDirect3DRM_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d)
#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
#define IDirect3DRM_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c)
#define IDirect3DRM_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b)
#define IDirect3DRM_LoadTextureFromResource(p,a,b) (p)->lpVtbl->LoadTextureFromResource(p,a,b)
#define IDirect3DRM_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a)
#define IDirect3DRM_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a)
#define IDirect3DRM_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b)
#define IDirect3DRM_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a)
#define IDirect3DRM_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a)
#define IDirect3DRM_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a)
#define IDirect3DRM_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b)
#define IDirect3DRM_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b)
#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM_Tick(p,a) (p)->lpVtbl->Tick(p,a)
#else
/*** IUnknown methods ***/
#define IDirect3DRM_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3DRM_AddRef(p) (p)->AddRef()
#define IDirect3DRM_Release(p) (p)->Release()
/*** IDirect3DRM methods ***/
#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d)
#define IDirect3DRM_CreateFrame(p,a,b) (p)->CreateFrame(a,b)
#define IDirect3DRM_CreateMesh(p,a) (p)->CreateMesh(a)
#define IDirect3DRM_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a)
#define IDirect3DRM_CreateFace(p,a) (p)->CreateFace(a)
#define IDirect3DRM_CreateAnimation(p,a) (p)->CreateAnimation(a)
#define IDirect3DRM_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a)
#define IDirect3DRM_CreateTexture(p,a,b) (p)->CreateTexture(a,b)
#define IDirect3DRM_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c)
#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e)
#define IDirect3DRM_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
#define IDirect3DRM_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d)
#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c)
#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e)
#define IDirect3DRM_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b)
#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g)
#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c)
#define IDirect3DRM_LoadTexture(p,a,b) (p)->LoadTexture(a,b)
#define IDirect3DRM_LoadTextureFromResource(p,a,b) (p)->LoadTextureFromResource(a,b)
#define IDirect3DRM_SetSearchPath(p,a) (p)->SetSearchPath(a)
#define IDirect3DRM_AddSearchPath(p,a) (p)->AddSearchPath(a)
#define IDirect3DRM_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b)
#define IDirect3DRM_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a)
#define IDirect3DRM_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a)
#define IDirect3DRM_GetDevices(p,a) (p)->GetDevices(a)
#define IDirect3DRM_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b)
#define IDirect3DRM_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b)
#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM_Tick(p,a) (p)->Tick(a)
#endif
/*****************************************************************************
* IDirect3DRM2 interface
*/
#ifdef WINE_NO_UNICODE_MACROS
#undef GetClassName
#endif
#define INTERFACE IDirect3DRM2
DECLARE_INTERFACE_(IDirect3DRM2,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DRM2 methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame2 **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder2 **mesh_builder) PURE;
STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE;
STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation **animation) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet **set) PURE;
STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture2 **texture) PURE;
STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE;
STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b,
IDirect3DRMLight **light) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE;
STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice2 **device) PURE;
STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw,
IDirectDrawSurface *surface, IDirect3DRMDevice2 **device) PURE;
STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device,
IDirect3DRMDevice2 **device) PURE;
STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid,
int width, int height, IDirect3DRMDevice2 **device) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface,
IDirect3DRMTexture2 **texture) PURE;
STDMETHOD(CreateShadow)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMLight *light,
D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
IDirect3DRMVisual **shadow) PURE;
STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice *device, IDirect3DRMFrame *camera,
DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) PURE;
STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame *reference, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov,
D3DVALUE su, D3DVALUE sv, IDirect3DRMWrap **wrap) PURE;
STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE;
STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture2 **texture) PURE;
STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE module, const char *resource_name,
const char *resource_type, IDirect3DRMTexture2 **texture) PURE;
STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE;
STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE;
STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags,
D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx,
IDirect3DRMFrame *parent_frame) PURE;
STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
STDMETHOD(CreateProgressiveMesh)(THIS_ IDirect3DRMProgressiveMesh **mesh) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirect3DRM2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DRM2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DRM2_Release(p) (p)->lpVtbl->Release(p)
/*** IDirect3DRM2 methods ***/
#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d)
#define IDirect3DRM2_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b)
#define IDirect3DRM2_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a)
#define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a)
#define IDirect3DRM2_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a)
#define IDirect3DRM2_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a)
#define IDirect3DRM2_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a)
#define IDirect3DRM2_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b)
#define IDirect3DRM2_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c)
#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
#define IDirect3DRM2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
#define IDirect3DRM2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d)
#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
#define IDirect3DRM2_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM2_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c)
#define IDirect3DRM2_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b)
#define IDirect3DRM2_LoadTextureFromResource(p,a,b,c,d) (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d)
#define IDirect3DRM2_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a)
#define IDirect3DRM2_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a)
#define IDirect3DRM2_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b)
#define IDirect3DRM2_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a)
#define IDirect3DRM2_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a)
#define IDirect3DRM2_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a)
#define IDirect3DRM2_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b)
#define IDirect3DRM2_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b)
#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM2_Tick(p,a) (p)->lpVtbl->Tick(p,a)
#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->lpVtbl->CreateProgressiveMesh(p,a)
#else
/*** IUnknown methods ***/
#define IDirect3DRM2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3DRM2_AddRef(p) (p)->AddRef()
#define IDirect3DRM2_Release(p) (p)->Release()
/*** IDirect3DRM2 methods ***/
#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d)
#define IDirect3DRM2_CreateFrame(p,a,b) (p)->CreateFrame(a,b)
#define IDirect3DRM2_CreateMesh(p,a) (p)->CreateMesh(a)
#define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a)
#define IDirect3DRM2_CreateFace(p,a) (p)->CreateFace(a)
#define IDirect3DRM2_CreateAnimation(p,a) (p)->CreateAnimation(a)
#define IDirect3DRM2_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a)
#define IDirect3DRM2_CreateTexture(p,a,b) (p)->CreateTexture(a,b)
#define IDirect3DRM2_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c)
#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e)
#define IDirect3DRM2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
#define IDirect3DRM2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d)
#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c)
#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e)
#define IDirect3DRM2_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b)
#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g)
#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM2_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c)
#define IDirect3DRM2_LoadTexture(p,a,b) (p)->LoadTexture(a,b)
#define IDirect3DRM2_LoadTextureFromResource(p,a,b,c,d) (p)->LoadTextureFromResource(a,b,c,d)
#define IDirect3DRM2_SetSearchPath(p,a) (p)->SetSearchPath(a)
#define IDirect3DRM2_AddSearchPath(p,a) (p)->AddSearchPath(a)
#define IDirect3DRM2_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b)
#define IDirect3DRM2_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a)
#define IDirect3DRM2_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a)
#define IDirect3DRM2_GetDevices(p,a) (p)->GetDevices(a)
#define IDirect3DRM2_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b)
#define IDirect3DRM2_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b)
#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM2_Tick(p,a) (p)->Tick(a)
#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(a)
#endif
/*****************************************************************************
* IDirect3DRM3 interface
*/
#ifdef WINE_NO_UNICODE_MACROS
#undef GetClassName
#endif
#define INTERFACE IDirect3DRM3
DECLARE_INTERFACE_(IDirect3DRM3,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DRM2 methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame3 *parent, IDirect3DRMFrame3 **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder3 **mesh_builder) PURE;
STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace2 **face) PURE;
STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation2 **animation) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet2 **set) PURE;
STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture3 **texture) PURE;
STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE;
STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b,
IDirect3DRMLight **light) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, IDirect3DRMMaterial2 **material) PURE;
STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice3 **device) PURE;
STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw,
IDirectDrawSurface *surface, DWORD flags, IDirect3DRMDevice3 **device) PURE;
STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device,
IDirect3DRMDevice3 **device) PURE;
STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid,
int width, int height, IDirect3DRMDevice3 **device) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface,
IDirect3DRMTexture3 **texture) PURE;
STDMETHOD(CreateShadow)(THIS_ IUnknown *object, IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz,
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, IDirect3DRMShadow2 **shadow) PURE;
STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice3 *device, IDirect3DRMFrame3 *camera,
DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport2 **viewport) PURE;
STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame3 *reference,
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
IDirect3DRMWrap **wrap) PURE;
STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE;
STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture3 **texture) PURE;
STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE module, const char *resource_name,
const char *resource_type, IDirect3DRMTexture3 **texture) PURE;
STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE;
STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE;
STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE;
STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags,
D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx,
IDirect3DRMFrame3 *parent_frame) PURE;
STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
STDMETHOD(CreateProgressiveMesh)(THIS_ IDirect3DRMProgressiveMesh **mesh) PURE;
STDMETHOD(RegisterClient)(THIS_ REFGUID guid, DWORD *id) PURE;
STDMETHOD(UnregisterClient)(THIS_ REFGUID rguid) PURE;
STDMETHOD(CreateClippedVisual)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMClippedVisual **clipped_visual) PURE;
STDMETHOD(SetOptions)(THIS_ DWORD) PURE;
STDMETHOD(GetOptions)(THIS_ DWORD *flags) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirect3DRM3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DRM3_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DRM3_Release(p) (p)->lpVtbl->Release(p)
/*** IDirect3DRM3 methods ***/
#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d)
#define IDirect3DRM3_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b)
#define IDirect3DRM3_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a)
#define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a)
#define IDirect3DRM3_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a)
#define IDirect3DRM3_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a)
#define IDirect3DRM3_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a)
#define IDirect3DRM3_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b)
#define IDirect3DRM3_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c)
#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
#define IDirect3DRM3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
#define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d,e)
#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
#define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM3_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c)
#define IDirect3DRM3_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b)
#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d) (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d)
#define IDirect3DRM3_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a)
#define IDirect3DRM3_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a)
#define IDirect3DRM3_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b)
#define IDirect3DRM3_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a)
#define IDirect3DRM3_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a)
#define IDirect3DRM3_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a)
#define IDirect3DRM3_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b)
#define IDirect3DRM3_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b)
#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM3_Tick(p,a) (p)->lpVtbl->Tick(p,a)
#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->lpVtbl->CreateProgressiveMesh(p,a)
#define IDirect3DRM3_RegisterClient(p,a,b) (p)->lpVtbl->RegisterClient(p,a,b)
#define IDirect3DRM3_UnregisterClient(p,a) (p)->lpVtbl->UnregisterClient(p,a)
#define IDirect3DRM3_CreateClippedVisual(p,a,b) (p)->lpVtbl->CreateClippedVisual(p,a,b)
#define IDirect3DRM3_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a)
#define IDirect3DRM3_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a)
#else
/*** IUnknown methods ***/
#define IDirect3DRM3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3DRM3_AddRef(p) (p)->AddRef()
#define IDirect3DRM3_Release(p) (p)->Release()
/*** IDirect3DRM3 methods ***/
#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d)
#define IDirect3DRM3_CreateFrame(p,a,b) (p)->CreateFrame(a,b)
#define IDirect3DRM3_CreateMesh(p,a) (p)->CreateMesh(a)
#define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a)
#define IDirect3DRM3_CreateFace(p,a) (p)->CreateFace(a)
#define IDirect3DRM3_CreateAnimation(p,a) (p)->CreateAnimation(a)
#define IDirect3DRM3_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a)
#define IDirect3DRM3_CreateTexture(p,a,b) (p)->CreateTexture(a,b)
#define IDirect3DRM3_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c)
#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e)
#define IDirect3DRM3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
#define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d,e) (p)->CreateDeviceFromSurface(a,b,c,d,e)
#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c)
#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e)
#define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b)
#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g)
#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
#define IDirect3DRM3_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c)
#define IDirect3DRM3_LoadTexture(p,a,b) (p)->LoadTexture(a,b)
#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d) (p)->LoadTextureFromResource(a,b,c,d)
#define IDirect3DRM3_SetSearchPath(p,a) (p)->SetSearchPath(a)
#define IDirect3DRM3_AddSearchPath(p,a) (p)->AddSearchPath(a)
#define IDirect3DRM3_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b)
#define IDirect3DRM3_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a)
#define IDirect3DRM3_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a)
#define IDirect3DRM3_GetDevices(p,a) (p)->GetDevices(a)
#define IDirect3DRM3_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b)
#define IDirect3DRM3_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b)
#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j)
#define IDirect3DRM3_Tick(p,a) (p)->Tick(a)
#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(a)
#define IDirect3DRM3_RegisterClient(p,a,b) (p)->RegisterClient(a,b)
#define IDirect3DRM3_UnregisterClient(p,a) (p)->UnregisterClient(a)
#define IDirect3DRM3_CreateClippedVisual(p,a,b) (p)->CreateClippedVisual(a,b)
#define IDirect3DRM3_SetOptions(p,a) (p)->SetOptions(a)
#define IDirect3DRM3_GetOptions(p,a) (p)->GetOptions(a)
#endif
#define D3DRM_OK DD_OK
#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781)
#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782)
#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783)
#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784)
#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785)
#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786)
#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787)
#define D3DRMERR_BADFILE MAKE_DDHRESULT(788)
#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789)
#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790)
#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791)
#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792)
#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793)
#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794)
#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795)
#define D3DRMERR_PENDING MAKE_DDHRESULT(796)
#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797)
#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798)
#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799)
#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800)
#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801)
#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802)
#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803)
#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804)
#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805)
#define D3DRMERR_CLIENTNOTREGISTERED MAKE_DDHRESULT(806)
#define D3DRMERR_NOTCREATEDFROMDDS MAKE_DDHRESULT(807)
#define D3DRMERR_NOSUCHKEY MAKE_DDHRESULT(808)
#define D3DRMERR_INCOMPATABLEKEY MAKE_DDHRESULT(809)
#define D3DRMERR_ELEMENTINUSE MAKE_DDHRESULT(810)
#define D3DRMERR_TEXTUREFORMATNOTFOUND MAKE_DDHRESULT(811)
#define D3DRMERR_NOTAGGREGATED MAKE_DDHRESULT(812)
#ifdef __cplusplus
}
#endif
#endif /* __D3DRM_H__ */

466
3rdparty/d3drm/include/d3drmdef.h vendored Normal file
View file

@ -0,0 +1,466 @@
/*
* Copyright 2007,2010 Vijay Kiran Kamuju
* Copyright 2007 David ADAM
* Copyright 2010 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __D3DRMDEFS_H__
#define __D3DRMDEFS_H__
#include <stddef.h>
#include <d3dtypes.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct _D3DRMVECTOR4D
{
D3DVALUE x;
D3DVALUE y;
D3DVALUE z;
D3DVALUE w;
} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
typedef D3DVALUE D3DRMMATRIX4D[4][4];
typedef struct _D3DRMQUATERNION {
D3DVALUE s;
D3DVECTOR v;
} D3DRMQUATERNION, *LPD3DRMQUATERNION;
typedef struct _D3DRMRAY {
D3DVECTOR dvDir;
D3DVECTOR dvPos;
} D3DRMRAY, *LPD3DRMRAY;
typedef struct _D3DRMBOX {
D3DVECTOR min;
D3DVECTOR max;
} D3DRMBOX, *LPD3DRMBOX;
typedef void (*D3DRMWRAPCALLBACK)(D3DVECTOR *vec, int *u, int *v, D3DVECTOR *a, D3DVECTOR *b, void *ctx);
typedef enum _D3DRMLIGHTTYPE {
D3DRMLIGHT_AMBIENT,
D3DRMLIGHT_POINT,
D3DRMLIGHT_SPOT,
D3DRMLIGHT_DIRECTIONAL,
D3DRMLIGHT_PARALLELPOINT
} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
typedef enum _D3DRMSHADEMODE {
D3DRMSHADE_FLAT = 0,
D3DRMSHADE_GOURAUD = 1,
D3DRMSHADE_PHONG = 2,
D3DRMSHADE_MASK = 7,
D3DRMSHADE_MAX = 8
} D3DRMSHADEMODE, *LPD3DRMSHADEMODE;
typedef enum _D3DRMLIGHTMODE {
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX,
D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX,
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX,
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX
} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE;
typedef enum _D3DRMFILLMODE {
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX,
D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX,
D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX,
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX,
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX
} D3DRMFILLMODE, *LPD3DRMFILLMODE;
typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
#define D3DRMRENDERMODE_LIGHTINMODELSPACE 8
#define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16
#define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32
typedef enum _D3DRMTEXTUREQUALITY {
D3DRMTEXTURE_NEAREST,
D3DRMTEXTURE_LINEAR,
D3DRMTEXTURE_MIPNEAREST,
D3DRMTEXTURE_MIPLINEAR,
D3DRMTEXTURE_LINEARMIPNEAREST,
D3DRMTEXTURE_LINEARMIPLINEAR
} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
#define D3DRMTEXTURE_FORCERESIDENT 0x00000001
#define D3DRMTEXTURE_STATIC 0x00000002
#define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004
#define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008
#define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010
#define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020
#define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040
#define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080
#define D3DRMTEXTURE_INVALIDATEONLY 0x00000100
#define D3DRMSHADOW_TRUEALPHA 0x00000001
typedef enum _D3DRMCOMBINETYPE {
D3DRMCOMBINE_REPLACE,
D3DRMCOMBINE_BEFORE,
D3DRMCOMBINE_AFTER
} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL;
typedef enum _D3DRMPALETTEFLAGS
{
D3DRMPALETTE_FREE,
D3DRMPALETTE_READONLY,
D3DRMPALETTE_RESERVED
} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
typedef struct _D3DRMPALETTEENTRY {
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char flags;
} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
typedef struct _D3DRMIMAGE {
int width;
int height;
int aspectx;
int aspecty;
int depth;
int rgb;
int bytes_per_line;
void* buffer1;
void* buffer2;
ULONG red_mask;
ULONG green_mask;
ULONG blue_mask;
ULONG alpha_mask;
int palette_size;
D3DRMPALETTEENTRY* palette;
} D3DRMIMAGE, *LPD3DRMIMAGE;
typedef enum _D3DRMWRAPTYPE {
D3DRMWRAP_FLAT,
D3DRMWRAP_CYLINDER,
D3DRMWRAP_SPHERE,
D3DRMWRAP_CHROME,
D3DRMWRAP_SHEET,
D3DRMWRAP_BOX
} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
#define D3DRMWIREFRAME_CULL 1
#define D3DRMWIREFRAME_HIDDENLINE 2
typedef enum _D3DRMPROJECTIONTYPE
{
D3DRMPROJECT_PERSPECTIVE,
D3DRMPROJECT_ORTHOGRAPHIC,
D3DRMPROJECT_RIGHTHANDPERSPECTIVE,
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
#define D3DRMOPTIONS_LEFTHANDED 0x00000001
#define D3DRMOPTIONS_RIGHTHANDED 0x00000002
typedef enum _D3DRMXOFFORMAT {
D3DRMXOF_BINARY,
D3DRMXOF_COMPRESSED,
D3DRMXOF_TEXT
} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
typedef DWORD D3DRMSAVEOPTIONS;
#define D3DRMXOFSAVE_NORMALS 1
#define D3DRMXOFSAVE_TEXTURECOORDINATES 2
#define D3DRMXOFSAVE_MATERIALS 4
#define D3DRMXOFSAVE_TEXTURENAMES 8
#define D3DRMXOFSAVE_ALL 15
#define D3DRMXOFSAVE_TEMPLATES 16
#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
typedef enum _D3DRMCOLORSOURCE {
D3DRMCOLOR_FROMFACE,
D3DRMCOLOR_FROMVERTEX
} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
typedef enum _D3DRMFRAMECONSTRAINT {
D3DRMCONSTRAIN_Z,
D3DRMCONSTRAIN_Y,
D3DRMCONSTRAIN_X
} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
typedef enum _D3DRMMATERIALMODE {
D3DRMMATERIAL_FROMMESH,
D3DRMMATERIAL_FROMPARENT,
D3DRMMATERIAL_FROMFRAME
} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
typedef enum _D3DRMFOGMODE {
D3DRMFOG_LINEAR,
D3DRMFOG_EXPONENTIAL,
D3DRMFOG_EXPONENTIALSQUARED
} D3DRMFOGMODE, *LPD3DRMFOGMODE;
typedef enum _D3DRMZBUFFERMODE {
D3DRMZBUFFER_FROMPARENT,
D3DRMZBUFFER_ENABLE,
D3DRMZBUFFER_DISABLE
} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
typedef enum _D3DRMSORTMODE {
D3DRMSORT_FROMPARENT,
D3DRMSORT_NONE,
D3DRMSORT_FRONTTOBACK,
D3DRMSORT_BACKTOFRONT
} D3DRMSORTMODE, *LPD3DRMSORTMODE;
typedef struct _D3DRMMATERIALOVERRIDE {
DWORD dwSize;
DWORD dwFlags;
D3DCOLORVALUE dcDiffuse;
D3DCOLORVALUE dcAmbient;
D3DCOLORVALUE dcEmissive;
D3DCOLORVALUE dcSpecular;
D3DVALUE dvPower;
IUnknown *lpD3DRMTex;
} D3DRMMATERIALOVERRIDE, *LPD3DRMMATERIALOVERRIDE;
#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY 0x00000001
#define D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY 0x00000002
#define D3DRMMATERIALOVERRIDE_DIFFUSE 0x00000003
#define D3DRMMATERIALOVERRIDE_AMBIENT 0x00000004
#define D3DRMMATERIALOVERRIDE_EMISSIVE 0x00000008
#define D3DRMMATERIALOVERRIDE_SPECULAR 0x00000010
#define D3DRMMATERIALOVERRIDE_POWER 0x00000020
#define D3DRMMATERIALOVERRIDE_TEXTURE 0x00000040
#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY 0x00000080
#define D3DRMMATERIALOVERRIDE_ALL 0x000000FF
#define D3DRMFPTF_ALPHA 0x00000001
#define D3DRMFPTF_NOALPHA 0x00000002
#define D3DRMFPTF_PALETTIZED 0x00000004
#define D3DRMFPTF_NOTPALETTIZED 0x00000008
#define D3DRMSTATECHANGE_UPDATEONLY 0x000000001
#define D3DRMSTATECHANGE_VOLATILE 0x000000002
#define D3DRMSTATECHANGE_NONVOLATILE 0x000000004
#define D3DRMSTATECHANGE_RENDER 0x000000020
#define D3DRMSTATECHANGE_LIGHT 0x000000040
#define D3DRMDEVICE_NOZBUFFER 0x00000001
#define D3DRMCALLBACK_PREORDER 0
#define D3DRMCALLBACK_POSTORDER 1
#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 0x01
#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 0x02
#define D3DRMRAYPICK_INTERPOLATEUV 0x04
#define D3DRMRAYPICK_INTERPOLATECOLOR 0x08
#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
#define D3DRMADDFACES_VERTICESONLY 1
#define D3DRMGENERATENORMALS_PRECOMPACT 1
#define D3DRMGENERATENORMALS_USECREASEANGLE 2
#define D3DRMMESHBUILDER_DIRECTPARENT 1
#define D3DRMMESHBUILDER_ROOTMESH 2
#define D3DRMMESHBUILDER_RENDERENABLE 0x00000001
#define D3DRMMESHBUILDER_PICKENABLE 0x00000002
#define D3DRMADDMESHBUILDER_DONTCOPYAPPDATA 1
#define D3DRMADDMESHBUILDER_FLATTENSUBMESHES 2
#define D3DRMADDMESHBUILDER_NOSUBMESHES 4
#define D3DRMMESHBUILDERAGE_GEOMETRY 0x00000001
#define D3DRMMESHBUILDERAGE_MATERIALS 0x00000002
#define D3DRMMESHBUILDERAGE_TEXTURES 0x00000004
#define D3DRMFVF_TYPE 0x00000001
#define D3DRMFVF_NORMAL 0x00000002
#define D3DRMFVF_COLOR 0x00000004
#define D3DRMFVF_TEXTURECOORDS 0x00000008
#define D3DRMVERTEX_STRIP 0x00000001
#define D3DRMVERTEX_FAN 0x00000002
#define D3DRMVERTEX_LIST 0x00000004
#define D3DRMCLEAR_TARGET 0x00000001
#define D3DRMCLEAR_ZBUFFER 0x00000002
#define D3DRMCLEAR_DIRTYRECTS 0x00000004
#define D3DRMCLEAR_ALL (D3DRMCLEAR_TARGET | D3DRMCLEAR_ZBUFFER | D3DRMCLEAR_DIRTYRECTS)
#define D3DRMFOGMETHOD_VERTEX 0x00000001
#define D3DRMFOGMETHOD_TABLE 0x00000002
#define D3DRMFOGMETHOD_ANY 0x00000004
#define D3DRMFRAME_RENDERENABLE 0x00000001
#define D3DRMFRAME_PICKENABLE 0x00000002
typedef DWORD D3DRMANIMATIONOPTIONS;
#define D3DRMANIMATION_OPEN 0x00000001
#define D3DRMANIMATION_CLOSED 0x00000002
#define D3DRMANIMATION_LINEARPOSITION 0x00000004
#define D3DRMANIMATION_SPLINEPOSITION 0x00000008
#define D3DRMANIMATION_SCALEANDROTATION 0x00000010
#define D3DRMANIMATION_POSITION 0x00000020
typedef DWORD D3DRMINTERPOLATIONOPTIONS;
#define D3DRMINTERPOLATION_OPEN 0x0001
#define D3DRMINTERPOLATION_CLOSED 0x0002
#define D3DRMINTERPOLATION_NEAREST 0x0100
#define D3DRMINTERPOLATION_LINEAR 0x0004
#define D3DRMINTERPOLATION_SPLINE 0x0008
#define D3DRMINTERPOLATION_VERTEXCOLOR 0x0040
#define D3DRMINTERPOLATION_SLERPNORMALS 0x0080
typedef DWORD D3DRMLOADOPTIONS;
#define D3DRMLOAD_FROMFILE __MSABI_LONG(0x000)
#define D3DRMLOAD_FROMRESOURCE __MSABI_LONG(0x001)
#define D3DRMLOAD_FROMMEMORY __MSABI_LONG(0x002)
#define D3DRMLOAD_FROMSTREAM __MSABI_LONG(0x004)
#define D3DRMLOAD_FROMURL __MSABI_LONG(0x008)
#define D3DRMLOAD_BYNAME __MSABI_LONG(0x010)
#define D3DRMLOAD_BYPOSITION __MSABI_LONG(0x020)
#define D3DRMLOAD_BYGUID __MSABI_LONG(0x040)
#define D3DRMLOAD_FIRST __MSABI_LONG(0x080)
#define D3DRMLOAD_INSTANCEBYREFERENCE __MSABI_LONG(0x100)
#define D3DRMLOAD_INSTANCEBYCOPYING __MSABI_LONG(0x200)
#define D3DRMLOAD_ASYNCHRONOUS __MSABI_LONG(0x400)
typedef struct _D3DRMLOADRESOURCE
{
HMODULE hModule;
const char *lpName;
const char *lpType;
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
typedef struct _D3DRMLOADMEMORY
{
void *lpMemory;
DWORD dSize;
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
#define D3DRMPMESHSTATUS_VALID 0x01
#define D3DRMPMESHSTATUS_INTERRUPTED 0x02
#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04
#define D3DRMPMESHSTATUS_COMPLETE 0x08
#define D3DRMPMESHSTATUS_RENDERABLE 0x10
#define D3DRMPMESHEVENT_BASEMESH 0x01
#define D3DRMPMESHEVENT_COMPLETE 0x02
typedef struct _D3DRMPMESHLOADSTATUS {
DWORD dwSize;
DWORD dwPMeshSize;
DWORD dwBaseMeshSize;
DWORD dwBytesLoaded;
DWORD dwVerticesLoaded;
DWORD dwFacesLoaded;
HRESULT dwLoadResult;
DWORD dwFlags;
} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
typedef enum _D3DRMUSERVISUALREASON {
D3DRMUSERVISUAL_CANSEE,
D3DRMUSERVISUAL_RENDER
} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
typedef struct _D3DRMANIMATIONKEY
{
DWORD dwSize;
DWORD dwKeyType;
D3DVALUE dvTime;
DWORD dwID;
#if !defined(__cplusplus) || !defined(D3D_OVERLOADS)
union
{
D3DRMQUATERNION dqRotateKey;
D3DVECTOR dvScaleKey;
D3DVECTOR dvPositionKey;
} DUMMYUNIONNAME;
#else
D3DVALUE dvK[4];
#endif
} D3DRMANIMATIONKEY;
typedef D3DRMANIMATIONKEY *LPD3DRMANIMATIONKEY;
#define D3DRMANIMATION_ROTATEKEY 0x01
#define D3DRMANIMATION_SCALEKEY 0x02
#define D3DRMANIMATION_POSITIONKEY 0x03
typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING;
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1;
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2;
static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4;
typedef struct _D3DRMVERTEX {
D3DVECTOR position;
D3DVECTOR normal;
D3DVALUE tu;
D3DVALUE tv;
D3DCOLOR color;
} D3DRMVERTEX, *LPD3DRMVERTEX;
typedef LONG D3DRMGROUPINDEX;
static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1;
void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D m, D3DRMQUATERNION *q);
D3DRMQUATERNION * WINAPI D3DRMQuaternionFromRotation(D3DRMQUATERNION *x, D3DVECTOR *axis, D3DVALUE theta);
D3DRMQUATERNION * WINAPI D3DRMQuaternionMultiply(D3DRMQUATERNION *ret, D3DRMQUATERNION *x, D3DRMQUATERNION *y);
D3DRMQUATERNION * WINAPI D3DRMQuaternionSlerp(D3DRMQUATERNION *ret,
D3DRMQUATERNION *x, D3DRMQUATERNION *y, D3DVALUE alpha);
D3DVECTOR * WINAPI D3DRMVectorAdd(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y);
D3DVECTOR * WINAPI D3DRMVectorCrossProduct(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y);
D3DVALUE WINAPI D3DRMVectorDotProduct(D3DVECTOR *x, D3DVECTOR *y);
D3DVECTOR * WINAPI D3DRMVectorNormalize(D3DVECTOR *x);
#define D3DRMVectorNormalise D3DRMVectorNormalize
D3DVALUE WINAPI D3DRMVectorModulus(D3DVECTOR *x);
D3DVECTOR * WINAPI D3DRMVectorRandom(D3DVECTOR *ret);
D3DVECTOR * WINAPI D3DRMVectorRotate(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *axis, D3DVALUE theta);
D3DVECTOR * WINAPI D3DRMVectorReflect(D3DVECTOR *ret, D3DVECTOR *ray, D3DVECTOR *normal);
D3DVECTOR * WINAPI D3DRMVectorScale(D3DVECTOR *ret, D3DVECTOR *x, D3DVALUE scale);
D3DVECTOR * WINAPI D3DRMVectorSubtract(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y);
D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE, D3DVALUE, D3DVALUE);
D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE);
D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR);
D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR);
D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR);
D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR);
#if defined(__cplusplus)
}
#endif
#endif

4702
3rdparty/d3drm/include/d3drmobj.h vendored Normal file

File diff suppressed because it is too large Load diff

103
3rdparty/d3drm/include/d3drmwin.h vendored Normal file
View file

@ -0,0 +1,103 @@
/*
* Copyright (C) 2010 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __D3DRMWIN_H__
#define __D3DRMWIN_H__
#include <d3drm.h>
#include <ddraw.h>
#include <d3d.h>
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* Direct3DRMWinDevice interface GUID
*/
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
typedef struct IDirect3DRMWinDevice *LPDIRECT3DRMWINDEVICE, **LPLPDIRECT3DRMWINDEVICE;
/*****************************************************************************
* IDirect3DRMWinDevice interface
*/
#define INTERFACE IDirect3DRMWinDevice
DECLARE_INTERFACE_(IDirect3DRMWinDevice,IDirect3DRMObject)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DRMObject methods ***/
STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE;
STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE;
STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
STDMETHOD(SetName)(THIS_ const char *name) PURE;
STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE;
STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE;
/*** IDirect3DRMWinDevice methods ***/
STDMETHOD(HandlePaint)(THIS_ HDC) PURE;
STDMETHOD(HandleActivate)(THIS_ WORD) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DRMWinDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DRMWinDevice_Release(p) (p)->lpVtbl->Release(p)
/*** IDirect3DRMObject methods ***/
#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c)
#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b)
#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a)
#define IDirect3DRMWinDevice_GetAppData(p) (p)->lpVtbl->GetAppData(p)
#define IDirect3DRMWinDevice_SetName(p,a) (p)->lpVtbl->SetName(p,a)
#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b)
/*** IDirect3DRMWinDevice methods ***/
#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->lpVtbl->HandlePaint(p,a)
#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->lpVtbl->HandleActivate(p,a)
#else
/*** IUnknown methods ***/
#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3DRMWinDevice_AddRef(p) (p)->AddRef()
#define IDirect3DRMwinDevice_Release(p) (p)->Release()
/*** IDirect3DRMObject methods ***/
#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->Clone(a,b,c)
#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b)
#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->SetAppData(a)
#define IDirect3DRMWinDevice_GetAppData(p) (p)->GetAppData()
#define IDirect3DRMWinDevice_SetName(p,a) (p)->SetName(a)
#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->GetName(a,b)
#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->GetClassName(a,b)
/*** IDirect3DRMWinDevice methods ***/
#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->HandlePaint(a)
#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->HandleActivate(a)
#endif
#ifdef __cplusplus
}
#endif
#endif /* __D3DRMWIN_H__ */

391
3rdparty/d3drm/light.c vendored Normal file
View file

@ -0,0 +1,391 @@
/*
* Implementation of IDirect3DRMLight Interface
*
* Copyright 2012 André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "d3drm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
static inline struct d3drm_light *impl_from_IDirect3DRMLight(IDirect3DRMLight *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_light, IDirect3DRMLight_iface);
}
static HRESULT WINAPI d3drm_light_QueryInterface(IDirect3DRMLight *iface, REFIID riid, void **out)
{
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_IDirect3DRMLight)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown))
{
IDirect3DRMLight_AddRef(iface);
*out = iface;
return S_OK;
}
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*out = NULL;
return E_NOINTERFACE;
}
static ULONG WINAPI d3drm_light_AddRef(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
ULONG refcount = InterlockedIncrement(&light->ref);
TRACE("%p increasing refcount to %lu.\n", iface, refcount);
return refcount;
}
static ULONG WINAPI d3drm_light_Release(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
ULONG refcount = InterlockedDecrement(&light->ref);
TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
if (!refcount)
{
d3drm_object_cleanup((IDirect3DRMObject *)iface, &light->obj);
IDirect3DRM_Release(light->d3drm);
free(light);
}
return refcount;
}
static HRESULT WINAPI d3drm_light_Clone(IDirect3DRMLight *iface,
IUnknown *outer, REFIID iid, void **out)
{
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_light_AddDestroyCallback(IDirect3DRMLight *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_add_destroy_callback(&light->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_light_DeleteDestroyCallback(IDirect3DRMLight *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_delete_destroy_callback(&light->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_light_SetAppData(IDirect3DRMLight *iface, DWORD data)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, data %#lx.\n", iface, data);
light->obj.appdata = data;
return D3DRM_OK;
}
static DWORD WINAPI d3drm_light_GetAppData(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->obj.appdata;
}
static HRESULT WINAPI d3drm_light_SetName(IDirect3DRMLight *iface, const char *name)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
return d3drm_object_set_name(&light->obj, name);
}
static HRESULT WINAPI d3drm_light_GetName(IDirect3DRMLight *iface, DWORD *size, char *name)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_name(&light->obj, size, name);
}
static HRESULT WINAPI d3drm_light_GetClassName(IDirect3DRMLight *iface, DWORD *size, char *name)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_class_name(&light->obj, size, name);
}
static HRESULT WINAPI d3drm_light_SetType(IDirect3DRMLight *iface, D3DRMLIGHTTYPE type)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, type %#x.\n", iface, type);
light->type = type;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetColor(IDirect3DRMLight *iface, D3DCOLOR color)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, color 0x%08lx.\n", iface, color);
light->color = 0xff000000 | color;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetColorRGB(IDirect3DRMLight *iface,
D3DVALUE red, D3DVALUE green, D3DVALUE blue)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
d3drm_set_color(&light->color, red, green, blue, 1.0f);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetRange(IDirect3DRMLight *iface, D3DVALUE range)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, range %.8e.\n", iface, range);
light->range = range;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetUmbra(IDirect3DRMLight *iface, D3DVALUE umbra)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, umbra %.8e.\n", iface, umbra);
light->umbra = umbra;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetPenumbra(IDirect3DRMLight *iface, D3DVALUE penumbra)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, penumbra %.8e.\n", iface, penumbra);
light->penumbra = penumbra;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetConstantAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
light->cattenuation = attenuation;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetLinearAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
light->lattenuation = attenuation;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_light_SetQuadraticAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
light->qattenuation = attenuation;
return D3DRM_OK;
}
static D3DVALUE WINAPI d3drm_light_GetRange(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->range;
}
static D3DVALUE WINAPI d3drm_light_GetUmbra(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", light);
return light->umbra;
}
static D3DVALUE WINAPI d3drm_light_GetPenumbra(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->penumbra;
}
static D3DVALUE WINAPI d3drm_light_GetConstantAttenuation(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->cattenuation;
}
static D3DVALUE WINAPI d3drm_light_GetLinearAttenuation(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->lattenuation;
}
static D3DVALUE WINAPI d3drm_light_GetQuadraticAttenuation(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->qattenuation;
}
static D3DCOLOR WINAPI d3drm_light_GetColor(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->color;
}
static D3DRMLIGHTTYPE WINAPI d3drm_light_GetType(IDirect3DRMLight *iface)
{
struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
TRACE("iface %p.\n", iface);
return light->type;
}
static HRESULT WINAPI d3drm_light_SetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame *frame)
{
FIXME("iface %p, frame %p stub!\n", iface, frame);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_light_GetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame **frame)
{
FIXME("iface %p, frame %p stub!\n", iface, frame);
return E_NOTIMPL;
}
static const struct IDirect3DRMLightVtbl d3drm_light_vtbl =
{
d3drm_light_QueryInterface,
d3drm_light_AddRef,
d3drm_light_Release,
d3drm_light_Clone,
d3drm_light_AddDestroyCallback,
d3drm_light_DeleteDestroyCallback,
d3drm_light_SetAppData,
d3drm_light_GetAppData,
d3drm_light_SetName,
d3drm_light_GetName,
d3drm_light_GetClassName,
d3drm_light_SetType,
d3drm_light_SetColor,
d3drm_light_SetColorRGB,
d3drm_light_SetRange,
d3drm_light_SetUmbra,
d3drm_light_SetPenumbra,
d3drm_light_SetConstantAttenuation,
d3drm_light_SetLinearAttenuation,
d3drm_light_SetQuadraticAttenuation,
d3drm_light_GetRange,
d3drm_light_GetUmbra,
d3drm_light_GetPenumbra,
d3drm_light_GetConstantAttenuation,
d3drm_light_GetLinearAttenuation,
d3drm_light_GetQuadraticAttenuation,
d3drm_light_GetColor,
d3drm_light_GetType,
d3drm_light_SetEnableFrame,
d3drm_light_GetEnableFrame,
};
HRESULT d3drm_light_create(struct d3drm_light **light, IDirect3DRM *d3drm)
{
static const char classname[] = "Light";
struct d3drm_light *object;
TRACE("light %p.\n", light);
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl;
object->ref = 1;
object->d3drm = d3drm;
IDirect3DRM_AddRef(object->d3drm);
d3drm_object_init(&object->obj, classname);
*light = object;
return S_OK;
}

303
3rdparty/d3drm/material.c vendored Normal file
View file

@ -0,0 +1,303 @@
/*
* Implementation of IDirect3DRMMaterial2 interface
*
* Copyright 2012 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "d3drm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
static inline struct d3drm_material *impl_from_IDirect3DRMMaterial2(IDirect3DRMMaterial2 *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_material, IDirect3DRMMaterial2_iface);
}
static HRESULT WINAPI d3drm_material_QueryInterface(IDirect3DRMMaterial2 *iface, REFIID riid, void **out)
{
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_IDirect3DRMMaterial2)
|| IsEqualGUID(riid, &IID_IDirect3DRMMaterial)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown))
{
IDirect3DRMMaterial2_AddRef(iface);
*out = iface;
return S_OK;
}
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*out = NULL;
return E_NOINTERFACE;
}
static ULONG WINAPI d3drm_material_AddRef(IDirect3DRMMaterial2 *iface)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
ULONG refcount = InterlockedIncrement(&material->ref);
TRACE("%p increasing refcount to %lu.\n", iface, refcount);
return refcount;
}
static ULONG WINAPI d3drm_material_Release(IDirect3DRMMaterial2 *iface)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
ULONG refcount = InterlockedDecrement(&material->ref);
TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
if (!refcount)
{
d3drm_object_cleanup((IDirect3DRMObject *)iface, &material->obj);
IDirect3DRM_Release(material->d3drm);
free(material);
}
return refcount;
}
static HRESULT WINAPI d3drm_material_Clone(IDirect3DRMMaterial2 *iface,
IUnknown *outer, REFIID iid, void **out)
{
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_material_AddDestroyCallback(IDirect3DRMMaterial2 *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_add_destroy_callback(&material->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_material_DeleteDestroyCallback(IDirect3DRMMaterial2 *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_delete_destroy_callback(&material->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_material_SetAppData(IDirect3DRMMaterial2 *iface, DWORD data)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, data %#lx.\n", iface, data);
material->obj.appdata = data;
return D3DRM_OK;
}
static DWORD WINAPI d3drm_material_GetAppData(IDirect3DRMMaterial2 *iface)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p.\n", iface);
return material->obj.appdata;
}
static HRESULT WINAPI d3drm_material_SetName(IDirect3DRMMaterial2 *iface, const char *name)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
return d3drm_object_set_name(&material->obj, name);
}
static HRESULT WINAPI d3drm_material_GetName(IDirect3DRMMaterial2 *iface, DWORD *size, char *name)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_name(&material->obj, size, name);
}
static HRESULT WINAPI d3drm_material_GetClassName(IDirect3DRMMaterial2 *iface, DWORD *size, char *name)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_class_name(&material->obj, size, name);
}
static HRESULT WINAPI d3drm_material_SetPower(IDirect3DRMMaterial2 *iface, D3DVALUE power)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, power %.8e.\n", iface, power);
material->power = power;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_material_SetSpecular(IDirect3DRMMaterial2 *iface,
D3DVALUE r, D3DVALUE g, D3DVALUE b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b);
material->specular.r = r;
material->specular.g = g;
material->specular.b = b;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_material_SetEmissive(IDirect3DRMMaterial2 *iface,
D3DVALUE r, D3DVALUE g, D3DVALUE b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b);
material->emissive.r = r;
material->emissive.g = g;
material->emissive.b = b;
return D3DRM_OK;
}
static D3DVALUE WINAPI d3drm_material_GetPower(IDirect3DRMMaterial2 *iface)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p.\n", iface);
return material->power;
}
static HRESULT WINAPI d3drm_material_GetSpecular(IDirect3DRMMaterial2 *iface,
D3DVALUE *r, D3DVALUE *g, D3DVALUE *b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b);
*r = material->specular.r;
*g = material->specular.g;
*b = material->specular.b;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_material_GetEmissive(IDirect3DRMMaterial2 *iface,
D3DVALUE *r, D3DVALUE *g, D3DVALUE *b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b);
*r = material->emissive.r;
*g = material->emissive.g;
*b = material->emissive.b;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_material_GetAmbient(IDirect3DRMMaterial2 *iface,
D3DVALUE *r, D3DVALUE *g, D3DVALUE *b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b);
*r = material->ambient.r;
*g = material->ambient.g;
*b = material->ambient.b;
return D3DRM_OK;
}
static HRESULT WINAPI d3drm_material_SetAmbient(IDirect3DRMMaterial2 *iface,
D3DVALUE r, D3DVALUE g, D3DVALUE b)
{
struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface);
TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b);
material->ambient.r = r;
material->ambient.g = g;
material->ambient.b = b;
return D3DRM_OK;
}
static const struct IDirect3DRMMaterial2Vtbl d3drm_material_vtbl =
{
d3drm_material_QueryInterface,
d3drm_material_AddRef,
d3drm_material_Release,
d3drm_material_Clone,
d3drm_material_AddDestroyCallback,
d3drm_material_DeleteDestroyCallback,
d3drm_material_SetAppData,
d3drm_material_GetAppData,
d3drm_material_SetName,
d3drm_material_GetName,
d3drm_material_GetClassName,
d3drm_material_SetPower,
d3drm_material_SetSpecular,
d3drm_material_SetEmissive,
d3drm_material_GetPower,
d3drm_material_GetSpecular,
d3drm_material_GetEmissive,
d3drm_material_GetAmbient,
d3drm_material_SetAmbient,
};
HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm)
{
static const char classname[] = "Material";
struct d3drm_material *object;
TRACE("material %p, d3drm %p.\n", material, d3drm);
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->IDirect3DRMMaterial2_iface.lpVtbl = &d3drm_material_vtbl;
object->ref = 1;
object->d3drm = d3drm;
IDirect3DRM_AddRef(object->d3drm);
object->specular.r = 1.0f;
object->specular.g = 1.0f;
object->specular.b = 1.0f;
d3drm_object_init(&object->obj, classname);
*material = object;
return S_OK;
}

263
3rdparty/d3drm/math.c vendored Normal file
View file

@ -0,0 +1,263 @@
/*
* Copyright 2007 David Adam
* Copyright 2007 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "d3drm_private.h"
/* Create a RGB color from its components */
D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE red, D3DVALUE green, D3DVALUE blue)
{
return D3DRMCreateColorRGBA(red, green, blue, 1.0f);
}
/* Create a RGBA color from its components */
D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE red, D3DVALUE green, D3DVALUE blue, D3DVALUE alpha)
{
D3DCOLOR color;
d3drm_set_color(&color, red, green, blue, alpha);
return color;
}
/* Determine the alpha part of a color */
D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR color)
{
return (RGBA_GETALPHA(color)/255.0);
}
/* Determine the blue part of a color */
D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR color)
{
return (RGBA_GETBLUE(color)/255.0);
}
/* Determine the green part of a color */
D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR color)
{
return (RGBA_GETGREEN(color)/255.0);
}
/* Determine the red part of a color */
D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR color)
{
return (RGBA_GETRED(color)/255.0);
}
/* Product of 2 quaternions */
D3DRMQUATERNION * WINAPI D3DRMQuaternionMultiply(D3DRMQUATERNION *q, D3DRMQUATERNION *a, D3DRMQUATERNION *b)
{
D3DRMQUATERNION temp;
D3DVECTOR cross_product;
D3DRMVectorCrossProduct(&cross_product, &a->v, &b->v);
temp.s = a->s * b->s - D3DRMVectorDotProduct(&a->v, &b->v);
temp.v.x = a->s * b->v.x + b->s * a->v.x + cross_product.x;
temp.v.y = a->s * b->v.y + b->s * a->v.y + cross_product.y;
temp.v.z = a->s * b->v.z + b->s * a->v.z + cross_product.z;
*q = temp;
return q;
}
/* Matrix for the Rotation that a unit quaternion represents */
void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D m, D3DRMQUATERNION *q)
{
D3DVALUE w,x,y,z;
w = q->s;
x = q->v.x;
y = q->v.y;
z = q->v.z;
m[0][0] = 1.0-2.0*(y*y+z*z);
m[1][1] = 1.0-2.0*(x*x+z*z);
m[2][2] = 1.0-2.0*(x*x+y*y);
m[1][0] = 2.0*(x*y+z*w);
m[0][1] = 2.0*(x*y-z*w);
m[2][0] = 2.0*(x*z-y*w);
m[0][2] = 2.0*(x*z+y*w);
m[2][1] = 2.0*(y*z+x*w);
m[1][2] = 2.0*(y*z-x*w);
m[3][0] = 0.0;
m[3][1] = 0.0;
m[3][2] = 0.0;
m[0][3] = 0.0;
m[1][3] = 0.0;
m[2][3] = 0.0;
m[3][3] = 1.0;
}
/* Return a unit quaternion that represents a rotation of an angle around an axis */
D3DRMQUATERNION * WINAPI D3DRMQuaternionFromRotation(D3DRMQUATERNION *q, D3DVECTOR *v, D3DVALUE theta)
{
q->s = cos(theta/2.0);
D3DRMVectorScale(&q->v, D3DRMVectorNormalize(v), sin(theta/2.0));
return q;
}
/* Interpolation between two quaternions */
D3DRMQUATERNION * WINAPI D3DRMQuaternionSlerp(D3DRMQUATERNION *q,
D3DRMQUATERNION *a, D3DRMQUATERNION *b, D3DVALUE alpha)
{
D3DVALUE dot, epsilon, temp, theta, u;
D3DVECTOR v1, v2;
dot = a->s * b->s + D3DRMVectorDotProduct(&a->v, &b->v);
epsilon = 1.0f;
temp = 1.0f - alpha;
u = alpha;
if (dot < 0.0)
{
epsilon = -1.0;
dot = -dot;
}
if( 1.0f - dot > 0.001f )
{
theta = acos(dot);
temp = sin(theta * temp) / sin(theta);
u = sin(theta * alpha) / sin(theta);
}
q->s = temp * a->s + epsilon * u * b->s;
D3DRMVectorScale(&v1, &a->v, temp);
D3DRMVectorScale(&v2, &b->v, epsilon * u);
D3DRMVectorAdd(&q->v, &v1, &v2);
return q;
}
/* Add Two Vectors */
D3DVECTOR * WINAPI D3DRMVectorAdd(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
{
D3DVECTOR temp;
temp.x=s1->x + s2->x;
temp.y=s1->y + s2->y;
temp.z=s1->z + s2->z;
*d = temp;
return d;
}
/* Subtract Two Vectors */
D3DVECTOR * WINAPI D3DRMVectorSubtract(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
{
D3DVECTOR temp;
temp.x=s1->x - s2->x;
temp.y=s1->y - s2->y;
temp.z=s1->z - s2->z;
*d = temp;
return d;
}
/* Cross Product of Two Vectors */
D3DVECTOR * WINAPI D3DRMVectorCrossProduct(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
{
D3DVECTOR temp;
temp.x=s1->y * s2->z - s1->z * s2->y;
temp.y=s1->z * s2->x - s1->x * s2->z;
temp.z=s1->x * s2->y - s1->y * s2->x;
*d = temp;
return d;
}
/* Dot Product of Two vectors */
D3DVALUE WINAPI D3DRMVectorDotProduct(D3DVECTOR *s1, D3DVECTOR *s2)
{
D3DVALUE dot_product;
dot_product=s1->x * s2->x + s1->y * s2->y + s1->z * s2->z;
return dot_product;
}
/* Norm of a vector */
D3DVALUE WINAPI D3DRMVectorModulus(D3DVECTOR *v)
{
D3DVALUE result;
result=sqrt(v->x * v->x + v->y * v->y + v->z * v->z);
return result;
}
/* Normalize a vector. Returns (1,0,0) if INPUT is the NULL vector. */
D3DVECTOR * WINAPI D3DRMVectorNormalize(D3DVECTOR *u)
{
D3DVALUE modulus = D3DRMVectorModulus(u);
if(modulus)
{
D3DRMVectorScale(u,u,1.0/modulus);
}
else
{
u->x=1.0;
u->y=0.0;
u->z=0.0;
}
return u;
}
/* Returns a random unit vector */
D3DVECTOR * WINAPI D3DRMVectorRandom(D3DVECTOR *d)
{
d->x = rand();
d->y = rand();
d->z = rand();
D3DRMVectorNormalize(d);
return d;
}
/* Reflection of a vector on a surface */
D3DVECTOR * WINAPI D3DRMVectorReflect(D3DVECTOR *r, D3DVECTOR *ray, D3DVECTOR *norm)
{
D3DVECTOR sca, temp;
D3DRMVectorSubtract(&temp, D3DRMVectorScale(&sca, norm, 2.0*D3DRMVectorDotProduct(ray,norm)), ray);
*r = temp;
return r;
}
/* Rotation of a vector */
D3DVECTOR * WINAPI D3DRMVectorRotate(D3DVECTOR *r, D3DVECTOR *v, D3DVECTOR *axis, D3DVALUE theta)
{
D3DRMQUATERNION quaternion1, quaternion2, quaternion3;
D3DVECTOR norm;
quaternion1.s = cos(theta * 0.5f);
quaternion2.s = cos(theta * 0.5f);
norm = *D3DRMVectorNormalize(axis);
D3DRMVectorScale(&quaternion1.v, &norm, sin(theta * 0.5f));
D3DRMVectorScale(&quaternion2.v, &norm, -sin(theta * 0.5f));
quaternion3.s = 0.0;
quaternion3.v = *v;
D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion3);
D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion2);
*r = *D3DRMVectorNormalize(&quaternion1.v);
return r;
}
/* Scale a vector */
D3DVECTOR * WINAPI D3DRMVectorScale(D3DVECTOR *d, D3DVECTOR *s, D3DVALUE factor)
{
D3DVECTOR temp;
temp.x=factor * s->x;
temp.y=factor * s->y;
temp.z=factor * s->z;
*d = temp;
return d;
}

3040
3rdparty/d3drm/meshbuilder.c vendored Normal file

File diff suppressed because it is too large Load diff

130
3rdparty/d3drm/rmxfguid.h vendored Normal file
View file

@ -0,0 +1,130 @@
/*
* Copyright (C) 2007 Patrik Stridvall
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_RMXFGUID_H
#define __WINE_RMXFGUID_H
/*****************************************************************************
* Define GUIDs
*/
DEFINE_GUID(TID_D3DRMAnimation, 0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMAnimationKey, 0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMAnimationOptions, 0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMAnimationSet, 0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMAppData, 0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x00, 0xaa, 0x00, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMBoolean, 0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMBoolean2d, 0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMCamera, 0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMColorRGB, 0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMColorRGBA, 0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMCoords2d, 0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMExternalVisual, 0x98116aa0, 0xbdba, 0x11d1, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMFloatKeys, 0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrame, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMFramePosition, 0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrameRotation, 0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrameTransformMatrix, 0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMFrameVelocity, 0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMGuid, 0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMIndexedColor, 0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMInfo, 0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMInlineData, 0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMLight, 0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMLightAttenuation, 0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMLightPenumbra, 0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x00, 0xaa, 0x00, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightRange, 0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x00, 0xaa, 0x00, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMLightUmbra, 0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x00, 0xaa, 0x00, 0xa7, 0x1a, 0x2f);
DEFINE_GUID(TID_D3DRMMaterial, 0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMaterialAmbientColor, 0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialArray, 0x35ff44e1, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialDiffuseColor, 0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialEmissiveColor, 0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialPower, 0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialSpecularColor, 0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMaterialWrap, 0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMatrix4x4, 0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMesh, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMeshFace, 0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMMeshFaceWraps, 0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMMeshMaterialList, 0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshNormals, 0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshTextureCoords, 0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMMeshVertexColors, 0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMProgressiveMesh, 0x8a63c360, 0x997d, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b);
DEFINE_GUID(TID_D3DRMPropertyBag, 0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMRightHanded, 0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMStringProperty, 0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71);
DEFINE_GUID(TID_D3DRMTextureFilename, 0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMTextureReference, 0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMTimedFloatKeys, 0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3);
DEFINE_GUID(TID_D3DRMUrl, 0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(TID_D3DRMVector, 0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
#endif /* __WINE_RMXFGUID_H */

1485
3rdparty/d3drm/texture.c vendored Normal file

File diff suppressed because it is too large Load diff

26
3rdparty/d3drm/version.rc vendored Normal file
View file

@ -0,0 +1,26 @@
/*
* Copyright 2004 Ivan Leo Puoti
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WINE_FILEDESCRIPTION_STR "Wine Direct3D Retained Mode Utility Functions"
#define WINE_FILENAME_STR "d3drm.dll"
#define WINE_FILEVERSION 5,0,2134,14
#define WINE_FILEVERSION_STR "5.0.2134.14"
#define WINE_PRODUCTVERSION 5,0,2134,14
#define WINE_PRODUCTVERSION_STR "5.0"
#include "wine/wine_common_ver.rc"

1147
3rdparty/d3drm/viewport.c vendored Normal file

File diff suppressed because it is too large Load diff

567
3rdparty/d3drm/wine/debug.h vendored Normal file
View file

@ -0,0 +1,567 @@
/*
* Wine debugging interface
*
* Copyright 1999 Patrik Stridvall
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep install
#endif
#ifndef __WINE_WINE_DEBUG_H
#define __WINE_WINE_DEBUG_H
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#ifndef GUID_DEFINED
#include <guiddef.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct _GUID;
/*
* Internal definitions (do not use these directly)
*/
enum __wine_debug_class
{
__WINE_DBCL_FIXME,
__WINE_DBCL_ERR,
__WINE_DBCL_WARN,
__WINE_DBCL_TRACE,
__WINE_DBCL_INIT = 7 /* lazy init flag */
};
struct __wine_debug_channel
{
unsigned char flags;
char name[15];
};
#ifndef WINE_NO_TRACE_MSGS
# define __WINE_GET_DEBUGGING_TRACE(dbch) ((dbch)->flags & (1 << __WINE_DBCL_TRACE))
#else
# define __WINE_GET_DEBUGGING_TRACE(dbch) 0
#endif
#ifndef WINE_NO_DEBUG_MSGS
# define __WINE_GET_DEBUGGING_WARN(dbch) ((dbch)->flags & (1 << __WINE_DBCL_WARN))
# define __WINE_GET_DEBUGGING_FIXME(dbch) ((dbch)->flags & (1 << __WINE_DBCL_FIXME))
#else
# define __WINE_GET_DEBUGGING_WARN(dbch) 0
# define __WINE_GET_DEBUGGING_FIXME(dbch) 0
#endif
/* define error macro regardless of what is configured */
#define __WINE_GET_DEBUGGING_ERR(dbch) ((dbch)->flags & (1 << __WINE_DBCL_ERR))
#define __WINE_GET_DEBUGGING(dbcl,dbch) __WINE_GET_DEBUGGING##dbcl(dbch)
#define __WINE_IS_DEBUG_ON(dbcl,dbch) \
(__WINE_GET_DEBUGGING##dbcl(dbch) && (__wine_dbg_get_channel_flags(dbch) & (1 << __WINE_DBCL##dbcl)))
#define __WINE_DPRINTF(dbcl,dbch) \
do { if(__WINE_GET_DEBUGGING(dbcl,(dbch))) { \
struct __wine_debug_channel * const __dbch = (dbch); \
const enum __wine_debug_class __dbcl = __WINE_DBCL##dbcl; \
__WINE_DBG_LOG
#define __WINE_DBG_LOG(...) \
wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0)
#if defined(__MINGW32__) || (!defined(__WINE_USE_MSVCRT) && (defined(__GNUC__) || defined(__clang__)))
#define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
#else
#define __WINE_PRINTF_ATTR(fmt,args)
#endif
#ifdef WINE_NO_TRACE_MSGS
#define WINE_TRACE(...) do { } while(0)
#define WINE_TRACE_(ch) WINE_TRACE
#endif
#ifdef WINE_NO_DEBUG_MSGS
#define WINE_WARN(...) do { } while(0)
#define WINE_WARN_(ch) WINE_WARN
#define WINE_FIXME(...) do { } while(0)
#define WINE_FIXME_(ch) WINE_FIXME
#endif
NTSYSAPI int WINAPI __wine_dbg_write( const char *str, unsigned int len );
extern DECLSPEC_EXPORT unsigned char __cdecl __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel );
extern DECLSPEC_EXPORT const char * __cdecl __wine_dbg_strdup( const char *str );
extern DECLSPEC_EXPORT int __cdecl __wine_dbg_output( const char *str );
extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_channel *channel,
const char *function );
/*
* Exported definitions and macros
*/
/* These functions return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
#if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
# define __wine_dbg_cdecl __cdecl
#else
# define __wine_dbg_cdecl
#endif
#if 0
static const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) __WINE_PRINTF_ATTR(1,0);
static inline const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args )
{
char buffer[200];
vsnprintf( buffer, sizeof(buffer), format, args );
return __wine_dbg_strdup( buffer );
}
static const char * __wine_dbg_cdecl wine_dbg_sprintf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2);
static inline const char * __wine_dbg_cdecl wine_dbg_sprintf( const char *format, ... )
{
const char *ret;
va_list args;
va_start( args, format );
ret = wine_dbg_vsprintf( format, args );
va_end( args );
return ret;
}
static int __wine_dbg_cdecl wine_dbg_vprintf( const char *format, va_list args ) __WINE_PRINTF_ATTR(1,0);
static inline int __wine_dbg_cdecl wine_dbg_vprintf( const char *format, va_list args )
{
char buffer[1024];
vsnprintf( buffer, sizeof(buffer), format, args );
return __wine_dbg_output( buffer );
}
static int __wine_dbg_cdecl wine_dbg_printf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2);
static inline int __wine_dbg_cdecl wine_dbg_printf( const char *format, ... )
{
int ret;
va_list args;
va_start( args, format );
ret = wine_dbg_vprintf( format, args );
va_end( args );
return ret;
}
static int __wine_dbg_cdecl wine_dbg_vlog( enum __wine_debug_class cls,
struct __wine_debug_channel *channel, const char *func,
const char *format, va_list args ) __WINE_PRINTF_ATTR(4,0);
static inline int __wine_dbg_cdecl wine_dbg_vlog( enum __wine_debug_class cls,
struct __wine_debug_channel *channel,
const char *function, const char *format, va_list args )
{
int ret;
if (*format == '\1') /* special magic to avoid standard prefix */
{
format++;
function = NULL;
}
if ((ret = __wine_dbg_header( cls, channel, function )) != -1) ret += wine_dbg_vprintf( format, args );
return ret;
}
static int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
struct __wine_debug_channel *channel, const char *func,
const char *format, ... ) __WINE_PRINTF_ATTR(4,5);
static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
struct __wine_debug_channel *channel,
const char *function, const char *format, ... )
{
va_list args;
int ret;
va_start( args, format );
ret = wine_dbg_vlog( cls, channel, function, format, args );
va_end( args );
return ret;
}
static inline const char *wine_dbgstr_an( const char *str, int n )
{
static const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
char buffer[300], *dst = buffer;
if (!str) return "(null)";
if (!((ULONG_PTR)str >> 16)) return wine_dbg_sprintf( "#%04x", LOWORD(str) );
#ifndef WINE_UNIX_LIB
if (IsBadStringPtrA( str, n )) return "(invalid)";
#endif
if (n == -1) for (n = 0; str[n]; n++) ;
*dst++ = '"';
while (n-- > 0 && dst <= buffer + sizeof(buffer) - 9)
{
unsigned char c = *str++;
switch (c)
{
case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
case '\t': *dst++ = '\\'; *dst++ = 't'; break;
case '"': *dst++ = '\\'; *dst++ = '"'; break;
case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
default:
if (c < ' ' || c >= 127)
{
*dst++ = '\\';
*dst++ = 'x';
*dst++ = hex[(c >> 4) & 0x0f];
*dst++ = hex[c & 0x0f];
}
else *dst++ = c;
}
}
*dst++ = '"';
if (n > 0)
{
*dst++ = '.';
*dst++ = '.';
*dst++ = '.';
}
*dst = 0;
return __wine_dbg_strdup( buffer );
}
static inline const char *wine_dbgstr_wn( const WCHAR *str, int n )
{
static const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
char buffer[300], *dst = buffer;
if (!str) return "(null)";
if (!((ULONG_PTR)str >> 16)) return wine_dbg_sprintf( "#%04x", LOWORD(str) );
#ifndef WINE_UNIX_LIB
if (IsBadStringPtrW( str, n )) return "(invalid)";
#endif
if (n == -1) for (n = 0; str[n]; n++) ;
*dst++ = 'L';
*dst++ = '"';
while (n-- > 0 && dst <= buffer + sizeof(buffer) - 10)
{
WCHAR c = *str++;
switch (c)
{
case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
case '\t': *dst++ = '\\'; *dst++ = 't'; break;
case '"': *dst++ = '\\'; *dst++ = '"'; break;
case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
default:
if (c < ' ' || c >= 127)
{
*dst++ = '\\';
*dst++ = hex[(c >> 12) & 0x0f];
*dst++ = hex[(c >> 8) & 0x0f];
*dst++ = hex[(c >> 4) & 0x0f];
*dst++ = hex[c & 0x0f];
}
else *dst++ = (char)c;
}
}
*dst++ = '"';
if (n > 0)
{
*dst++ = '.';
*dst++ = '.';
*dst++ = '.';
}
*dst = 0;
return __wine_dbg_strdup( buffer );
}
static inline const char *wine_dbgstr_a( const char *s )
{
return wine_dbgstr_an( s, -1 );
}
static inline const char *wine_dbgstr_w( const WCHAR *s )
{
return wine_dbgstr_wn( s, -1 );
}
#if defined(__hstring_h__) && defined(__WINSTRING_H_)
static inline const char *wine_dbgstr_hstring( HSTRING hstr )
{
UINT32 len;
const WCHAR *str = WindowsGetStringRawBuffer( hstr, &len );
return wine_dbgstr_wn( str, len );
}
#endif
static inline const char *wine_dbgstr_guid( const GUID *id )
{
if (!id) return "(null)";
if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04hx>", (WORD)(ULONG_PTR)id );
return wine_dbg_sprintf( "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
(unsigned int)id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
}
static inline const char *wine_dbgstr_fourcc( unsigned int fourcc )
{
char str[4] = { (char)fourcc, (char)(fourcc >> 8), (char)(fourcc >> 16), (char)(fourcc >> 24) };
if (!fourcc)
return "''";
if (isprint( str[0] ) && isprint( str[1] ) && isprint( str[2] ) && isprint( str[3] ))
return wine_dbg_sprintf( "'%.4s'", str );
return wine_dbg_sprintf( "0x%08x", fourcc );
}
static inline const char *wine_dbgstr_point( const POINT *pt )
{
if (!pt) return "(null)";
return wine_dbg_sprintf( "(%d,%d)", (int)pt->x, (int)pt->y );
}
static inline const char *wine_dbgstr_rect( const RECT *rect )
{
if (!rect) return "(null)";
return wine_dbg_sprintf( "(%d,%d)-(%d,%d)", (int)rect->left, (int)rect->top,
(int)rect->right, (int)rect->bottom );
}
static inline const char *wine_dbgstr_longlong( ULONGLONG ll )
{
if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
else return wine_dbg_sprintf( "%lx", (unsigned long)ll );
}
#if defined(__oaidl_h__) && defined(V_VT)
static inline const char *wine_dbgstr_vt( VARTYPE vt )
{
static const char *const variant_types[] =
{
"VT_EMPTY","VT_NULL","VT_I2","VT_I4","VT_R4","VT_R8","VT_CY","VT_DATE",
"VT_BSTR","VT_DISPATCH","VT_ERROR","VT_BOOL","VT_VARIANT","VT_UNKNOWN",
"VT_DECIMAL","15","VT_I1","VT_UI1","VT_UI2","VT_UI4","VT_I8","VT_UI8",
"VT_INT","VT_UINT","VT_VOID","VT_HRESULT","VT_PTR","VT_SAFEARRAY",
"VT_CARRAY","VT_USERDEFINED","VT_LPSTR","VT_LPWSTR","32","33","34","35",
"VT_RECORD","VT_INT_PTR","VT_UINT_PTR","39","40","41","42","43","44","45",
"46","47","48","49","50","51","52","53","54","55","56","57","58","59","60",
"61","62","63","VT_FILETIME","VT_BLOB","VT_STREAM","VT_STORAGE",
"VT_STREAMED_OBJECT","VT_STORED_OBJECT","VT_BLOB_OBJECT","VT_CF","VT_CLSID",
"VT_VERSIONED_STREAM"
};
static const char *const variant_flags[16] =
{
"",
"|VT_VECTOR",
"|VT_ARRAY",
"|VT_VECTOR|VT_ARRAY",
"|VT_BYREF",
"|VT_VECTOR|VT_BYREF",
"|VT_ARRAY|VT_BYREF",
"|VT_VECTOR|VT_ARRAY|VT_BYREF",
"|VT_RESERVED",
"|VT_VECTOR|VT_RESERVED",
"|VT_ARRAY|VT_RESERVED",
"|VT_VECTOR|VT_ARRAY|VT_RESERVED",
"|VT_BYREF|VT_RESERVED",
"|VT_VECTOR|VT_BYREF|VT_RESERVED",
"|VT_ARRAY|VT_BYREF|VT_RESERVED",
"|VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED",
};
if (vt & ~VT_TYPEMASK)
return wine_dbg_sprintf( "%s%s", wine_dbgstr_vt(vt&VT_TYPEMASK), variant_flags[vt>>12] );
if (vt < sizeof(variant_types)/sizeof(*variant_types))
return variant_types[vt];
if (vt == VT_BSTR_BLOB)
return "VT_BSTR_BLOB";
return wine_dbg_sprintf( "vt(invalid %x)", vt );
}
static inline const char *wine_dbgstr_variant( const VARIANT *v )
{
if (!v)
return "(null)";
if (V_VT(v) & VT_BYREF) {
if (V_VT(v) == (VT_VARIANT|VT_BYREF))
return wine_dbg_sprintf( "%p {VT_VARIANT|VT_BYREF: %s}", v, wine_dbgstr_variant(V_VARIANTREF(v)) );
if (V_VT(v) == (VT_BSTR|VT_BYREF))
return wine_dbg_sprintf( "%p {VT_BSTR|VT_BYREF: %s}", v, V_BSTRREF(v) ? wine_dbgstr_w(*V_BSTRREF(v)) : "(none)" );
return wine_dbg_sprintf( "%p {%s %p}", v, wine_dbgstr_vt(V_VT(v)), V_BYREF(v) );
}
if (V_ISARRAY(v) || V_ISVECTOR(v))
return wine_dbg_sprintf( "%p {%s %p}", v, wine_dbgstr_vt(V_VT(v)), V_ARRAY(v) );
switch(V_VT(v)) {
case VT_EMPTY:
return wine_dbg_sprintf( "%p {VT_EMPTY}", v );
case VT_NULL:
return wine_dbg_sprintf( "%p {VT_NULL}", v );
case VT_I2:
return wine_dbg_sprintf( "%p {VT_I2: %d}", v, V_I2(v) );
case VT_I4:
return wine_dbg_sprintf( "%p {VT_I4: %d}", v, (int)V_I4(v) );
case VT_R4:
return wine_dbg_sprintf( "%p {VT_R4: %f}", v, V_R4(v) );
case VT_R8:
return wine_dbg_sprintf( "%p {VT_R8: %lf}", v, V_R8(v) );
case VT_CY:
return wine_dbg_sprintf( "%p {VT_CY: %s}", v, wine_dbgstr_longlong(V_CY(v).int64) );
case VT_DATE:
return wine_dbg_sprintf( "%p {VT_DATE: %lf}", v, V_DATE(v) );
case VT_LPSTR:
return wine_dbg_sprintf( "%p {VT_LPSTR: %s}", v, wine_dbgstr_a((const char *)V_BSTR(v)) );
case VT_LPWSTR:
return wine_dbg_sprintf( "%p {VT_LPWSTR: %s}", v, wine_dbgstr_w(V_BSTR(v)) );
case VT_BSTR:
return wine_dbg_sprintf( "%p {VT_BSTR: %s}", v, wine_dbgstr_w(V_BSTR(v)) );
case VT_DISPATCH:
return wine_dbg_sprintf( "%p {VT_DISPATCH: %p}", v, V_DISPATCH(v) );
case VT_ERROR:
return wine_dbg_sprintf( "%p {VT_ERROR: %08x}", v, (int)V_ERROR(v) );
case VT_BOOL:
return wine_dbg_sprintf( "%p {VT_BOOL: %x}", v, V_BOOL(v) );
case VT_UNKNOWN:
return wine_dbg_sprintf( "%p {VT_UNKNOWN: %p}", v, V_UNKNOWN(v) );
case VT_I1:
return wine_dbg_sprintf( "%p {VT_I1: %d}", v, V_I1(v) );
case VT_UI1:
return wine_dbg_sprintf( "%p {VT_UI1: %u}", v, V_UI1(v) );
case VT_UI2:
return wine_dbg_sprintf( "%p {VT_UI2: %u}", v, V_UI2(v) );
case VT_UI4:
return wine_dbg_sprintf( "%p {VT_UI4: %u}", v, (unsigned int)V_UI4(v) );
case VT_I8:
return wine_dbg_sprintf( "%p {VT_I8: %s}", v, wine_dbgstr_longlong(V_I8(v)) );
case VT_UI8:
return wine_dbg_sprintf( "%p {VT_UI8: %s}", v, wine_dbgstr_longlong(V_UI8(v)) );
case VT_INT:
return wine_dbg_sprintf( "%p {VT_INT: %d}", v, V_INT(v) );
case VT_UINT:
return wine_dbg_sprintf( "%p {VT_UINT: %u}", v, V_UINT(v) );
case VT_VOID:
return wine_dbg_sprintf( "%p {VT_VOID}", v );
case VT_RECORD:
return wine_dbg_sprintf( "%p {VT_RECORD: %p %p}", v, V_RECORD(v), V_RECORDINFO(v) );
default:
return wine_dbg_sprintf( "%p {vt %s}", v, wine_dbgstr_vt(V_VT(v)) );
}
}
#endif
#endif /* defined(__oaidl_h__) && defined(V_VT) */
#ifndef WINE_TRACE
#define WINE_TRACE __WINE_DPRINTF(_TRACE,__wine_dbch___default)
#define WINE_TRACE_(ch) __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)
#endif
#define WINE_TRACE_ON(ch) __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)
#ifndef WINE_WARN
#define WINE_WARN __WINE_DPRINTF(_WARN,__wine_dbch___default)
#define WINE_WARN_(ch) __WINE_DPRINTF(_WARN,&__wine_dbch_##ch)
#endif
#define WINE_WARN_ON(ch) __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch)
#ifndef WINE_FIXME
#define WINE_FIXME __WINE_DPRINTF(_FIXME,__wine_dbch___default)
#define WINE_FIXME_(ch) __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch)
#endif
#define WINE_FIXME_ON(ch) __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch)
#define WINE_ERR __WINE_DPRINTF(_ERR,__wine_dbch___default)
#define WINE_ERR_(ch) __WINE_DPRINTF(_ERR,&__wine_dbch_##ch)
#define WINE_ERR_ON(ch) __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch)
#define WINE_DECLARE_DEBUG_CHANNEL(ch) \
static struct __wine_debug_channel __wine_dbch_##ch = { 0xff, #ch }; \
C_ASSERT(sizeof(#ch) <= sizeof(__wine_dbch_##ch.name))
#define WINE_DEFAULT_DEBUG_CHANNEL(ch) \
static struct __wine_debug_channel __wine_dbch_##ch = { 0xff, #ch }; \
C_ASSERT(sizeof(#ch) <= sizeof(__wine_dbch_##ch.name)); \
static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
#define WINE_MESSAGE wine_dbg_printf
#ifdef __WINESRC__
/* Wine uses shorter names that are very likely to conflict with other software */
#if 0
static inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
static inline const char *debugstr_fourcc( unsigned int cc ) { return wine_dbgstr_fourcc( cc ); }
static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
#if defined(__hstring_h__) && defined(__WINSTRING_H_)
static inline const char *debugstr_hstring( struct HSTRING__ *s ) { return wine_dbgstr_hstring( s ); }
#endif
#if defined(__oaidl_h__) && defined(V_VT)
static inline const char *debugstr_vt( VARTYPE vt ) { return wine_dbgstr_vt( vt ); }
static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }
#endif
#endif
#define TRACE WINE_TRACE
#define TRACE_(ch) WINE_TRACE_(ch)
#define TRACE_ON(ch) WINE_TRACE_ON(ch)
#define WARN WINE_WARN
#define WARN_(ch) WINE_WARN_(ch)
#define WARN_ON(ch) WINE_WARN_ON(ch)
#define FIXME WINE_FIXME
#define FIXME_(ch) WINE_FIXME_(ch)
#define FIXME_ON(ch) WINE_FIXME_ON(ch)
#if 0
#undef ERR /* Solaris got an 'ERR' define in <sys/reg.h> */
#define ERR WINE_ERR
#define ERR_(ch) WINE_ERR_(ch)
#define ERR_ON(ch) WINE_ERR_ON(ch)
#else
static void ERR(const char *msg) {
/* Do something */
}
#endif
#define MESSAGE WINE_MESSAGE
#endif /* __WINESRC__ */
#ifdef __cplusplus
}
#endif
#endif /* __WINE_WINE_DEBUG_H */

270
3rdparty/d3drm/wine/list.h vendored Normal file
View file

@ -0,0 +1,270 @@
/*
* Linked lists support
*
* Copyright (C) 2002 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_SERVER_LIST_H
#define __WINE_SERVER_LIST_H
#include <stddef.h>
struct list
{
struct list *next;
struct list *prev;
};
/* Define a list like so:
*
* struct gadget
* {
* struct list entry; <-- doesn't have to be the first item in the struct
* int a, b;
* };
*
* static struct list global_gadgets = LIST_INIT( global_gadgets );
*
* or
*
* struct some_global_thing
* {
* struct list gadgets;
* };
*
* list_init( &some_global_thing->gadgets );
*
* Manipulate it like this:
*
* list_add_head( &global_gadgets, &new_gadget->entry );
* list_remove( &new_gadget->entry );
* list_add_after( &some_random_gadget->entry, &new_gadget->entry );
*
* And to iterate over it:
*
* struct gadget *gadget;
* LIST_FOR_EACH_ENTRY( gadget, &global_gadgets, struct gadget, entry )
* {
* ...
* }
*
*/
/* add an element after the specified one */
static inline void list_add_after( struct list *elem, struct list *to_add )
{
to_add->next = elem->next;
to_add->prev = elem;
elem->next->prev = to_add;
elem->next = to_add;
}
/* add an element before the specified one */
static inline void list_add_before( struct list *elem, struct list *to_add )
{
to_add->next = elem;
to_add->prev = elem->prev;
elem->prev->next = to_add;
elem->prev = to_add;
}
/* add element at the head of the list */
static inline void list_add_head( struct list *list, struct list *elem )
{
list_add_after( list, elem );
}
/* add element at the tail of the list */
static inline void list_add_tail( struct list *list, struct list *elem )
{
list_add_before( list, elem );
}
/* remove an element from its list */
static inline void list_remove( struct list *elem )
{
elem->next->prev = elem->prev;
elem->prev->next = elem->next;
}
/* get the next element */
static inline struct list *list_next( const struct list *list, const struct list *elem )
{
struct list *ret = elem->next;
if (elem->next == list) ret = NULL;
return ret;
}
/* get the previous element */
static inline struct list *list_prev( const struct list *list, const struct list *elem )
{
struct list *ret = elem->prev;
if (elem->prev == list) ret = NULL;
return ret;
}
/* get the first element */
static inline struct list *list_head( const struct list *list )
{
return list_next( list, list );
}
/* get the last element */
static inline struct list *list_tail( const struct list *list )
{
return list_prev( list, list );
}
/* check if a list is empty */
static inline int list_empty( const struct list *list )
{
return list->next == list;
}
/* initialize a list */
static inline void list_init( struct list *list )
{
list->next = list->prev = list;
}
/* count the elements of a list */
static inline unsigned int list_count( const struct list *list )
{
unsigned count = 0;
const struct list *ptr;
for (ptr = list->next; ptr != list; ptr = ptr->next) count++;
return count;
}
/* move all elements from src to before the specified element */
static inline void list_move_before( struct list *dst, struct list *src )
{
if (list_empty(src)) return;
dst->prev->next = src->next;
src->next->prev = dst->prev;
dst->prev = src->prev;
src->prev->next = dst;
list_init(src);
}
/* move all elements from src to after the specified element */
static inline void list_move_after( struct list *dst, struct list *src )
{
if (list_empty(src)) return;
dst->next->prev = src->prev;
src->prev->next = dst->next;
dst->next = src->next;
src->next->prev = dst;
list_init(src);
}
/* move all elements from src to the head of dst */
static inline void list_move_head( struct list *dst, struct list *src )
{
list_move_after( dst, src );
}
/* move all elements from src to the tail of dst */
static inline void list_move_tail( struct list *dst, struct list *src )
{
list_move_before( dst, src );
}
/* move the slice of elements from begin to end inclusive to the head of dst */
static inline void list_move_slice_head( struct list *dst, struct list *begin, struct list *end )
{
struct list *dst_next = dst->next;
begin->prev->next = end->next;
end->next->prev = begin->prev;
dst->next = begin;
dst_next->prev = end;
begin->prev = dst;
end->next = dst_next;
}
/* move the slice of elements from begin to end inclusive to the tail of dst */
static inline void list_move_slice_tail( struct list *dst, struct list *begin, struct list *end )
{
struct list *dst_prev = dst->prev;
begin->prev->next = end->next;
end->next->prev = begin->prev;
dst_prev->next = begin;
dst->prev = end;
begin->prev = dst_prev;
end->next = dst;
}
/* iterate through the list */
#define LIST_FOR_EACH(cursor,list) \
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
/* iterate through the list, with safety against removal */
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list) \
for ((cursor) = (list)->next, (cursor2) = (cursor)->next; \
(cursor) != (list); \
(cursor) = (cursor2), (cursor2) = (cursor)->next)
/* iterate through the list using a list entry */
#define LIST_FOR_EACH_ENTRY(elem, list, type, field) \
for ((elem) = LIST_ENTRY((list)->next, type, field); \
&(elem)->field != (list); \
(elem) = LIST_ENTRY((elem)->field.next, type, field))
/* iterate through the list using a list entry, with safety against removal */
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \
for ((cursor) = LIST_ENTRY((list)->next, type, field), \
(cursor2) = LIST_ENTRY((cursor)->field.next, type, field); \
&(cursor)->field != (list); \
(cursor) = (cursor2), \
(cursor2) = LIST_ENTRY((cursor)->field.next, type, field))
/* iterate through the list in reverse order */
#define LIST_FOR_EACH_REV(cursor,list) \
for ((cursor) = (list)->prev; (cursor) != (list); (cursor) = (cursor)->prev)
/* iterate through the list in reverse order, with safety against removal */
#define LIST_FOR_EACH_SAFE_REV(cursor, cursor2, list) \
for ((cursor) = (list)->prev, (cursor2) = (cursor)->prev; \
(cursor) != (list); \
(cursor) = (cursor2), (cursor2) = (cursor)->prev)
/* iterate through the list in reverse order using a list entry */
#define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \
for ((elem) = LIST_ENTRY((list)->prev, type, field); \
&(elem)->field != (list); \
(elem) = LIST_ENTRY((elem)->field.prev, type, field))
/* iterate through the list in reverse order using a list entry, with safety against removal */
#define LIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field) \
for ((cursor) = LIST_ENTRY((list)->prev, type, field), \
(cursor2) = LIST_ENTRY((cursor)->field.prev, type, field); \
&(cursor)->field != (list); \
(cursor) = (cursor2), \
(cursor2) = LIST_ENTRY((cursor)->field.prev, type, field))
/* macros for statically initialized lists */
#undef LIST_INIT
#define LIST_INIT(list) { &(list), &(list) }
/* get pointer to object containing list element */
#undef LIST_ENTRY
#define LIST_ENTRY(elem, type, field) \
((type *)((char *)(elem) - offsetof(type, field)))
#endif /* __WINE_SERVER_LIST_H */

152
3rdparty/d3drm/wine/wine_common_ver.rc vendored Normal file
View file

@ -0,0 +1,152 @@
/*
* Copyright 2001 Dmitry Timoshkov
* Copyright 2004 Ivan Leo Puoti
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep header
#endif
#include "winresrc.h"
/*
Assign WINE_FILEVERSION and WINE_FILEVERSION_STR high enough number
to make sure that programs, relying on the version numbers, will
never complain.
*/
#ifndef WINE_FILEVERSION_MAJOR
#define WINE_FILEVERSION_MAJOR 10
#endif
#ifndef WINE_FILEVERSION_MINOR
#define WINE_FILEVERSION_MINOR 0
#endif
#ifndef WINE_FILEVERSION_BUILD
#define WINE_FILEVERSION_BUILD 0
#endif
#ifndef WINE_FILEVERSION_PLATFORMID
#define WINE_FILEVERSION_PLATFORMID 0
#endif
#ifndef WINE_FILEVERSION
#define WINE_FILEVERSION WINE_FILEVERSION_MAJOR,WINE_FILEVERSION_MINOR,\
WINE_FILEVERSION_BUILD,WINE_FILEVERSION_PLATFORMID
#endif
#define WINE_VER_STRINGIZE2(x) #x
#define WINE_VER_STRINGIZE(x) WINE_VER_STRINGIZE2(x)
#define WINE_VER_HEXPREFIX2(x) 0x ## x
#define WINE_VER_HEXPREFIX(x) WINE_VER_HEXPREFIX2(x)
#ifndef WINE_FILEVERSION_STR
#define WINE_FILEVERSION_STR WINE_VER_STRINGIZE(WINE_FILEVERSION_MAJOR.WINE_FILEVERSION_MINOR.WINE_FILEVERSION_BUILD.WINE_FILEVERSION_PLATFORMID)
#endif
#ifndef WINE_FILEDESCRIPTION_STR
#define WINE_FILEDESCRIPTION_STR "Wine core dll"
#endif
#ifndef WINE_FILENAME
#define WINE_FILENAME ""
#endif
#ifndef WINE_FILENAME_STR
#define WINE_FILENAME_STR ""
#endif
#ifndef WINE_FILETYPE
#define WINE_FILETYPE VFT_DLL
#endif
#ifndef WINE_FILESUBTYPE
#define WINE_FILESUBTYPE VFT2_UNKNOWN
#endif
#ifndef WINE_LEGALCOPYRIGHT
#define WINE_LEGALCOPYRIGHT "Copyright (c) 1993-2024 the Wine project authors (see the file AUTHORS for a complete list)"
#endif
#ifndef WINE_PRODUCTVERSION
#define WINE_PRODUCTVERSION 1,0,0,0
#endif
#ifndef WINE_PRODUCTVERSION_STR
#define WINE_PRODUCTVERSION_STR "1.0"
#endif
#ifndef WINE_PRODUCTNAME_STR
#define WINE_PRODUCTNAME_STR "Wine"
#endif
#ifndef WINE_EXTRAVALUES
#define WINE_EXTRAVALUES
#endif
#ifndef WINE_CODEPAGE
#ifdef _WIN32
#define WINE_CODEPAGE 04B0 /* CP1200 (Unicode) */
#else
#define WINE_CODEPAGE 04E4 /* CP1252 for Win16 */
#endif
#endif
#ifndef WINE_CODEPAGE_STR
#define WINE_CODEPAGE_STR WINE_VER_STRINGIZE(WINE_CODEPAGE)
#endif
#ifndef WINE_CODEPAGE_HEX
#define WINE_CODEPAGE_HEX WINE_VER_HEXPREFIX(WINE_CODEPAGE)
#endif
#ifndef WINE_LANGID
#define WINE_LANGID 0409 /* LANG_ENGLISH/SUBLANG_DEFAULT */
#endif
#define WINE_LANGID_STR WINE_VER_STRINGIZE(WINE_LANGID)
#define WINE_LANGID_HEX WINE_VER_HEXPREFIX(WINE_LANGID)
VS_VERSION_INFO VERSIONINFO
FILEVERSION WINE_FILEVERSION
PRODUCTVERSION WINE_PRODUCTVERSION
FILEFLAGSMASK 63
FILEFLAGS 0
FILEOS VOS_UNKNOWN
FILETYPE WINE_FILETYPE
FILESUBTYPE WINE_FILESUBTYPE
{
BLOCK "StringFileInfo"
{
BLOCK WINE_LANGID_STR WINE_CODEPAGE_STR
{
VALUE "CompanyName", "Microsoft Corporation" /* GameGuard depends on this */
VALUE "FileDescription", WINE_FILEDESCRIPTION_STR
VALUE "FileVersion", WINE_FILEVERSION_STR
VALUE "InternalName", WINE_FILENAME
VALUE "LegalCopyright", WINE_LEGALCOPYRIGHT
VALUE "OriginalFilename", WINE_FILENAME_STR
VALUE "ProductName", WINE_PRODUCTNAME_STR
VALUE "ProductVersion", WINE_PRODUCTVERSION_STR
WINE_EXTRAVALUES
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", WINE_LANGID_HEX, WINE_CODEPAGE_HEX
}
}

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
# MSVC runtime library flags are selected by an abstraction
cmake_policy(SET CMP0091 NEW)
@ -8,6 +8,10 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
project(isle CXX C)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" CACHE PATH "Directory where to put executables and dll")
# By configuring CMake with -DDOWNLOAD_DEPENDENCIES=ON/OFF,
# users can choose between downloading dependencies or using system libraries
option(DOWNLOAD_DEPENDENCIES "Download dependencies" TRUE)
@ -38,7 +42,7 @@ else()
# to add search paths.
find_package(SDL3 CONFIG REQUIRED)
# TODO add iniparser?
find_package(iniparser REQUIRED COMPONENTS static)
endif()
include(CheckCXXSourceCompiles)
@ -95,53 +99,38 @@ function(add_cxx_warning WARNING)
endif()
endfunction()
if(NOT MINGW)
set(NOT_MINGW TRUE)
else()
set(NOT_MINGW FALSE)
endif()
add_subdirectory(3rdparty EXCLUDE_FROM_ALL SYSTEM)
message(STATUS "MSVC for decompilation: ${MSVC_FOR_DECOMP}")
option(ISLE_WERROR "Treat warnings as errors" OFF)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF)
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON)
cmake_dependent_option(ISLE_USE_DX5_LIBS "Build with internal DirectX 5 SDK Libraries" ON ISLE_USE_DX5 OFF)
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ${NOT_MINGW})
cmake_dependent_option(ISLE_D3DRM_FROM_WINE "Use d3drm from wine" "${MINGW}" "NOT ISLE_USE_DX5" OFF)
message(STATUS "Using internal DirectX5 SDK: ${ISLE_USE_DX5}")
message(STATUS "Using d3drm from wine: ${ISLE_D3DRM_FROM_WINE}")
add_cxx_warning(parentheses)
add_library(DirectX5::DirectX5 INTERFACE IMPORTED)
target_include_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/inc")
if(ISLE_USE_DX5_LIBS)
if(ISLE_USE_DX5)
target_link_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib")
endif()
add_subdirectory(3rdparty/d3drm)
add_library(Vec::Vec INTERFACE IMPORTED)
target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec")
add_library(libsmacker STATIC
3rdparty/libsmacker/smacker.c
)
register_lego1_target(libsmacker)
set_property(TARGET libsmacker PROPERTY ARCHIVE_OUTPUT_NAME "libsmacker$<$<CONFIG:Debug>:d>")
set_property(TARGET libsmacker PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/libsmacker")
target_include_directories(libsmacker PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/libsmacker")
add_library(miniaudio STATIC
3rdparty/miniaudio/extras/miniaudio_split/miniaudio.c
)
register_lego1_target(miniaudio)
set_property(TARGET miniaudio PROPERTY ARCHIVE_OUTPUT_NAME "miniaudio$<$<CONFIG:Debug>:d>")
set_property(TARGET miniaudio PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/miniaudio/extras/miniaudio_split")
target_include_directories(miniaudio PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/miniaudio/extras/miniaudio_split")
# Disable most features since we don't need them.
target_compile_definitions(miniaudio PUBLIC
MA_ENABLE_ONLY_SPECIFIC_BACKENDS
MA_NO_DECODING
MA_NO_ENCODING
MA_NO_WAV
MA_NO_FLAC
MA_NO_MP3
MA_NO_DEVICE_IO
MA_NO_RESOURCE_MANAGER
MA_NO_GENERATION
MA_NO_THREADING
)
add_library(tglrl STATIC
LEGO1/tgl/d3drm/camera.cpp
@ -157,7 +146,11 @@ add_library(tglrl STATIC
register_lego1_target(tglrl)
set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>")
target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
if(ISLE_D3DRM_FROM_WINE)
target_link_libraries(tglrl PRIVATE d3drm-wine)
else()
target_link_libraries(tglrl PRIVATE d3drm)
endif()
add_library(realtime STATIC
LEGO1/realtime/matrix.cpp
@ -551,8 +544,10 @@ if (MSVC)
endif()
endif()
if(MSVC)
target_link_options(isle PRIVATE "/SAFESEH:NO")
target_link_options(lego1 PRIVATE "/SAFESEH:NO")
endif()
if (MSVC_FOR_DECOMP)
foreach(tgt IN LISTS lego1_targets)

View file

@ -334,7 +334,7 @@ int SDL_AppEvent(void* appstate, const SDL_Event* event)
break;
}
SDL_Keycode keyCode = event->key.keysym.sym;
SDL_Keycode keyCode = event->key.key;
if (InputManager()) {
InputManager()->QueueEvent(c_notificationKeyPress, keyCode, 0, 0, keyCode);
}

View file

@ -1,6 +1,7 @@
#ifndef ISLEAPP_H
#define ISLEAPP_H
#include "legoutils.h"
#include "mxtypes.h"
#include "mxvideoparam.h"
@ -8,8 +9,6 @@
#include <SDL3/SDL_video.h>
#include <windows.h>
enum Cursor;
// SIZE 0x8c
class IsleApp {
public:

View file

@ -23,7 +23,6 @@ DllMain@12
_Z10PickEntityii
_Z12EventManagerv
_Z12InputManagerv
_Z12MusicManagerv
_Z12SoundManagerv
_Z12VideoManagerv
_Z13MSoundManagerv

View file

@ -33,7 +33,7 @@ class MxThread {
virtual ~MxThread();
private:
static unsigned ThreadProc(void* p_thread);
static int SDLCALL ThreadProc(void* p_thread);
SDL_Thread* m_thread;
MxBool m_running; // 0x0c

View file

@ -73,6 +73,7 @@ MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
{
MxResult status = FAILURE;
MxBool locked = FALSE;
ma_engine_config engineConfig;
if (MxAudioManager::Create() != SUCCESS) {
goto done;
@ -81,7 +82,7 @@ MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
m_criticalSection.Enter();
locked = TRUE;
ma_engine_config engineConfig = ma_engine_config_init();
engineConfig = ma_engine_config_init();
engineConfig.noDevice = MA_TRUE;
engineConfig.channels = MxOmni::IsSound3D() ? 2 : 1;
engineConfig.sampleRate = g_sampleRate;

View file

@ -28,11 +28,7 @@ MxResult MxThread::Start(MxS32 p_stack, MxS32 p_flag)
if (m_semaphore.Init(0, 1) == SUCCESS) {
const SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(
props,
SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER,
(SDL_FunctionPointer) &MxThread::ThreadProc
);
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void*) MxThread::ThreadProc);
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, this);
SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, p_stack << 2);
@ -60,7 +56,7 @@ void MxThread::Terminate()
}
// FUNCTION: LEGO1 0x100bf680
unsigned MxThread::ThreadProc(void* p_thread)
int MxThread::ThreadProc(void* p_thread)
{
return static_cast<MxThread*>(p_thread)->Run();
}

73
cmake/Findiniparser.cmake Normal file
View file

@ -0,0 +1,73 @@
if(WIN32)
set(__iniparser_shared_names "libiniparser.dll.a" "libiniparser.lib")
set(__iniparser_static_names "libiniparser.a" "iniparser.lib")
else()
if(APPLE)
set(__iniparser_shared_names "libiniparser.dylib")
else()
set(__iniparser_shared_names "libiniparser.so")
endif()
set(__iniparser_static_names "libiniparser.a")
endif()
find_path(iniparser_INCLUDE_PATH
NAMES "iniparser.h"
)
set(__iniparser_required_vars iniparser_INCLUDE_PATH)
set(__iniparser_shared_required FALSE)
set(__iniparser_static_required FALSE)
foreach(__comp ${iniparser_FIND_COMPONENTS})
if(__comp STREQUAL "shared")
set(__iniparser_shared_required TRUE)
find_library(iniparser_shared_LIBRARY
NAMES ${__iniparser_shared_names}
)
set(iniparser_shared_FOUND "${iniparser_shared_LIBRARY}")
if(iniparser_FIND_REQUIRED_shared)
list(APPEND __iniparser_required_vars iniparser_shared_LIBRARY)
endif()
endif()
if(__comp STREQUAL "static")
set(__iniparser_static_required TRUE)
find_library(iniparser_static_LIBRARY
NAMES ${__iniparser_static_names}
)
set(iniparser_static_FOUND "${iniparser_static_LIBRARY}")
if(iniparser_FIND_REQUIRED_static)
list(APPEND __iniparser_required_vars iniparser_static_LIBRARY)
endif()
endif()
endforeach()
if(NOT __iniparser_shared_required AND NOT __iniparser_static_required)
list(APPEND __iniparser_required_vars iniparser_shared_LIBRARY)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(iniparser
FOUND_VAR iniparser_FOUND
REQUIRED_VARS ${__iniparser_required_vars}
HANDLE_COMPONENTS
)
if(iniparser_FOUND)
if(NOT TARGET iniparser-shared AND iniparser_shared_LIBRARY)
if(WIN32)
# We don't know the name and location of the dll, so use an imported target
add_library(iniparser-shared UNKNOWN IMPORTED)
set_property(TARGET iniparser-shared PROPERTY IMPORTED_IMPLIB "${iniparser_shared_LIBRARY}")
else()
add_library(iniparser-shared SHARED IMPORTED)
set_property(TARGET iniparser-shared PROPERTY IMPORTED_LOCATION "${iniparser_shared_LIBRARY}")
endif()
set_property(TARGET iniparser-shared PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${iniparser_INCLUDE_PATH}")
endif()
if(NOT TARGET iniparser-static AND iniparser_static_LIBRARY)
add_library(iniparser-static STATIC IMPORTED)
set_property(TARGET iniparser-static PROPERTY IMPORTED_LOCATION "${iniparser_static_LIBRARY}")
set_property(TARGET iniparser-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${iniparser_INCLUDE_PATH}")
endif()
endif()