From 8e431a3e95f413471c27b0b68c2fe172834a817f Mon Sep 17 00:00:00 2001 From: gabrielkheisa Date: Fri, 6 Nov 2020 18:55:46 +0700 Subject: [PATCH] upload --- .gitattributes | 63 + .gitignore | 340 +++ LICENSE.txt | 674 ++++++ README.md | 230 ++ subVersion.sln | 31 + subVersion/CallbackProxy.h | 38 + subVersion/ColorDef.h | 141 ++ subVersion/D3D9Render.cpp | 298 +++ subVersion/D3D9Render.h | 109 + subVersion/GTA d3d9.rc | 71 + subVersion/VehiclePreview.h | 811 +++++++ subVersion/d3d9/d3d9.h | 2791 +++++++++++++++++++++++ subVersion/d3d9/d3d9.lib | Bin 0 -> 5092 bytes subVersion/d3d9/d3dx9.h | 78 + subVersion/d3d9/d3dx9.lib | Bin 0 -> 81324 bytes subVersion/d3d9/d3dx9anim.h | 1114 +++++++++ subVersion/d3d9/d3dx9core.h | 753 +++++++ subVersion/d3d9/d3dx9effect.h | 873 +++++++ subVersion/d3d9/d3dx9math.h | 1796 +++++++++++++++ subVersion/d3d9/d3dx9math.inl | 2251 ++++++++++++++++++ subVersion/d3d9/d3dx9mesh.h | 3007 +++++++++++++++++++++++++ subVersion/d3d9/d3dx9shader.h | 1010 +++++++++ subVersion/d3d9/d3dx9shape.h | 221 ++ subVersion/d3d9/d3dx9tex.h | 1735 ++++++++++++++ subVersion/d3d9/d3dx9xof.h | 299 +++ subVersion/entity.cpp | 1570 +++++++++++++ subVersion/entity.h | 538 +++++ subVersion/hack.cpp | 2109 +++++++++++++++++ subVersion/hack.h | 191 ++ subVersion/main.cpp | 587 +++++ subVersion/mask.ico | Bin 0 -> 204862 bytes subVersion/memManager.cpp | 124 + subVersion/memManager.h | 67 + subVersion/resource.h | Bin 0 -> 868 bytes subVersion/settings.cpp | 649 ++++++ subVersion/settings.h | 255 +++ subVersion/settings.ini | 112 + subVersion/stdafx.cpp | 118 + subVersion/stdafx.h | 290 +++ subVersion/subVersion.vcxproj | 174 ++ subVersion/subVersion.vcxproj.filters | 85 + subVersion/vector.h | 44 + 42 files changed, 25647 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 subVersion.sln create mode 100644 subVersion/CallbackProxy.h create mode 100644 subVersion/ColorDef.h create mode 100644 subVersion/D3D9Render.cpp create mode 100644 subVersion/D3D9Render.h create mode 100644 subVersion/GTA d3d9.rc create mode 100644 subVersion/VehiclePreview.h create mode 100644 subVersion/d3d9/d3d9.h create mode 100644 subVersion/d3d9/d3d9.lib create mode 100644 subVersion/d3d9/d3dx9.h create mode 100644 subVersion/d3d9/d3dx9.lib create mode 100644 subVersion/d3d9/d3dx9anim.h create mode 100644 subVersion/d3d9/d3dx9core.h create mode 100644 subVersion/d3d9/d3dx9effect.h create mode 100644 subVersion/d3d9/d3dx9math.h create mode 100644 subVersion/d3d9/d3dx9math.inl create mode 100644 subVersion/d3d9/d3dx9mesh.h create mode 100644 subVersion/d3d9/d3dx9shader.h create mode 100644 subVersion/d3d9/d3dx9shape.h create mode 100644 subVersion/d3d9/d3dx9tex.h create mode 100644 subVersion/d3d9/d3dx9xof.h create mode 100644 subVersion/entity.cpp create mode 100644 subVersion/entity.h create mode 100644 subVersion/hack.cpp create mode 100644 subVersion/hack.h create mode 100644 subVersion/main.cpp create mode 100644 subVersion/mask.ico create mode 100644 subVersion/memManager.cpp create mode 100644 subVersion/memManager.h create mode 100644 subVersion/resource.h create mode 100644 subVersion/settings.cpp create mode 100644 subVersion/settings.h create mode 100644 subVersion/settings.ini create mode 100644 subVersion/stdafx.cpp create mode 100644 subVersion/stdafx.h create mode 100644 subVersion/subVersion.vcxproj create mode 100644 subVersion/subVersion.vcxproj.filters create mode 100644 subVersion/vector.h diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, 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 +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bcfed4 --- /dev/null +++ b/README.md @@ -0,0 +1,230 @@ +# subVerison_GTAV_Hack +subVerison重置版——GTAV线上外置修改器 + +[![](https://img.shields.io/badge/Powerd%20By-subVersion-brightgreen)](https://github.com/sub1to/subVersion_GTAO_Hack) + +███████╗██╗ ██╗██████╗ ██╗ ██╗███████╗██████╗ ███████╗██╗ ██████╗ ███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝██╔══██╗██╔════╝██║██╔═══██╗████╗ ██║ +███████╗██║ ██║██████╔╝██║ ██║█████╗ ██████╔╝███████╗██║██║ ██║██╔██╗ ██║ +╚════██║██║ ██║██╔══██╗╚██╗ ██╔╝██╔══╝ ██╔══██╗╚════██║██║██║ ██║██║╚██╗██║ +███████║╚██████╔╝██████╔╝ ╚████╔╝ ███████╗██║ ██║███████║██║╚██████╔╝██║ ╚████║ +╚══════╝ ╚═════╝ ╚═════╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝ + + +## 目录 + +- [背景](#背景) +- [支持的版本](#支持的版本) +- [功能](#功能) +- [使用说明](#使用说明) +- [已知问题](#已知问题) +- [TODO](#TODO) +- [相关仓库](#相关仓库) +- [维护者](#维护者) +- [使用许可](#使用许可) + +## 背景 + +`subVersion` 最开始是[@sub1to](https://github.com/sub1to) 开发的,原项目开发终止于2017年6月。 + +`subVersion` 是一款支持线上模式的外置修改器,带有d3d9实现的UI。 + +## 支持的版本 +[GTAV 1.51](https://www.rockstargames.com/zh/games/info/V) + +线下及线上 + +Steam版 + +Epic Game版 + +## 功能 +
+玩家 + +``` +治疗 +自杀 +无敌 +半无敌 +通缉等级 +永不通缉 +反NPC(杀死任何攻击你的NPC) +NPC无视玩家 +奔跑速度(1-5倍) +游泳速度(1-5倍) +超级跳跃 +爆炸近战 +无布娃娃(永不摔倒) +无限耐力 +近战击退倍数 +假死雷达隐匿 +水下行走 +``` +
+
+武器 + +``` +补满所有武器弹药 +补满当前武器弹药 +无扩散 +无后座 +无需换弹 +快速换弹(1-10倍) +武器伤害系数(1-10倍) +无限弹药 +射程(1-10倍) +加特林无需预热 +爆炸子弹 +燃烧子弹 +批量子弹(1-10倍;最大25)(射出一发等于多发) +批量传播(0-0.12) +初速(1-10倍) +人冲击力 +车辆冲击力 +直升机冲击力 +``` +
+子弹编辑 >> + +``` +手榴弹 +粘弹 +燃烧瓶 +隐形爆炸 +闪电爆炸 +大爆炸 +中爆炸 +小爆炸 +小水柱 +小火柱 +大水柱 +大火柱 +MK2爆炸子弹 +烟雾弹 +催泪瓦斯 +带特效的爆炸 +大冲击波爆炸 +大火灾爆炸 +超大型飞艇爆炸 +大爆炸+坠落碎片 +火球爆炸 +烟花 +雪球 +屏幕抖动爆炸 +假爆炸(无伤害) +``` +
+
+
+载具 + +``` +无敌 +半无敌 +防爆轮胎 +安全带 +修复 +无限喷射 +喷射恢复速度 +``` +
+属性 >> + +``` +质量 +浮力 +减档速度 +手刹制动力 +悬挂高度 +撞击伤害倍数 +武器伤害倍数 +变形系数 +引擎伤害倍数 +变形系数(0-1;默认值为0.7)(将滑块向左移动可一直减少变形向右表示变形较大) +加速度(1-10倍) +高速挡(1-25) +刹车制动力(1-10倍) +牵引力(1-2倍) +重力(0N-25N;默认9.8N) +悬挂(1-2倍) +``` +
+
+
+参数 + +``` +RP倍数 +AP倍数 +最小任务金额 +``` +
+ +
+导航 + +``` +导航点 +目标点 +室内 +``` +
+ + +## 使用说明 +### 快捷键 +```sh +Numpad - | 打开菜单 +F9 | 保存设置并关闭修改器 + +Numpad 5 | 开/关功能 +Numpad 0 | 返回 + +Numpad 7 | 左翻页 +Numpad 9 | 右翻页 + +Numpad 8 | 上翻 +Numpad 2 | 下翻 + +Numpad 4 | 滑块向左 +Numpad 6 | 滑块向右 + +F5 | 传送至导航点 +F6 | 清除通缉 +F7 | 满血满防弹衣 +F8 | 补满所有武器弹药 +``` + +### 注意 +- 只有在静止状态下才可以进行传送 +- 传送**导航点**时如果传送后卡地形,按下W键即可回到地面 +- 传送**导航点**时多人传送需要所有人都下车并按W键 +### 为什么传送导航点时会出现这种问题? +- 在进行**导航点**传送时,由于只导航点只有**XY轴**的坐标,并不知道Z轴高度轴的坐标,所以修改器会将你的Z轴改为-225,也就是地下,而GTA5有一个机制,会自动将Z轴位于-225的人物传送至地面。 + +## 已知问题 +- 无敌开启时,反NPC不会生效。必须使用半无敌 +- 传送到目标点仅限于任务目标(黄点),NPC和可拾取目标(绿点)等其他。 +- 如果尚未设定新的导航点,则传送到目标会传送到先前的导航点。 + +## TODO + +1. 一个更好,更易用的**UI**。 +2. 更多**功能特性**。 +3. 实现**AoBScan**,使用特征码定位基址。 +4. 支持Social Club版 + + +## 相关仓库 + +- [subVersion GTAO Hack](https://github.com/sub1to/subVersion_GTAO_Hack) — 💌 原版subVersion。 + +## 维护者 + +[@AmazingPP](https://github.com/AmazingPP) + +## 使用许可 + +[GPL-3.0](LICENSE) © AmazingPP diff --git a/subVersion.sln b/subVersion.sln new file mode 100644 index 0000000..63ab44d --- /dev/null +++ b/subVersion.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30128.74 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subVersion", "subVersion\subVersion.vcxproj", "{14BDF4DF-A71B-489A-9077-EA112711CB28}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Debug|x64.ActiveCfg = Debug|x64 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Debug|x64.Build.0 = Debug|x64 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Debug|x86.ActiveCfg = Debug|Win32 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Debug|x86.Build.0 = Debug|Win32 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Release|x64.ActiveCfg = Release|x64 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Release|x64.Build.0 = Release|x64 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Release|x86.ActiveCfg = Release|Win32 + {14BDF4DF-A71B-489A-9077-EA112711CB28}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {63DF38A2-CBFB-4311-B6EF-1C63E412CA84} + EndGlobalSection +EndGlobal diff --git a/subVersion/CallbackProxy.h b/subVersion/CallbackProxy.h new file mode 100644 index 0000000..d388e4f --- /dev/null +++ b/subVersion/CallbackProxy.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef __CALLBACK_PROXY_H__ +#define __CALLBACK_PROXY_H__ + +//Tobject:öͣTparamص +template +class CallbackProxy +{ + typedef void (Tobject::* CbFun)(Tparam*); + +public: + void Set(Tobject* pInstance, CbFun pFun); + bool Exec(Tparam* pParam); + +private: + CbFun pCbFun; //صָ + Tobject* m_pInstance; //ö +}; + +//õöص +template +void CallbackProxy::Set(Tobject* pInstance, CbFun pFun) +{ + m_pInstance = pInstance; + pCbFun = pFun; +}; + +//ûص +template +bool CallbackProxy::Exec(Tparam* pParam) +{ + (m_pInstance->*pCbFun)(pParam); + return true; +} + +extern std::map*>* g_pCBMap; + +#endif \ No newline at end of file diff --git a/subVersion/ColorDef.h b/subVersion/ColorDef.h new file mode 100644 index 0000000..31a3eb4 --- /dev/null +++ b/subVersion/ColorDef.h @@ -0,0 +1,141 @@ +#pragma once +#define CLR_LIGHTPINK RGB(255, 182, 193) // dzۺ +#define CLR_PINK RGB(255, 192, 203) // ۺ +#define CLR_CRIMSON RGB(220, 20, 60) // ɺ () +#define CLR_LAVENDERBLUSH RGB(255, 240, 245) // Ϻ +#define CLR_PALEVIOLETRED RGB(219, 112, 147) // +#define CLR_HOTPINK RGB(255, 105, 180) // ķۺ +#define CLR_DEEPPINK RGB(255, 20, 147) // ۺ +#define CLR_MEDIUMVIOLETRED RGB(199, 21, 133) // +#define CLR_ORCHID RGB(218, 112, 214) // +#define CLR_THISTLE RGB(216, 191, 216) // +#define CLR_PLUM RGB(221, 160, 221) // +#define CLR_VIOLET RGB(238, 130, 238) // +#define CLR_MAGENTA RGB(255, 0, 255) // (Ʒ õ) +#define CLR_FUCHSIA RGB(255, 0, 255) // (Ϻɫ) +#define CLR_DARKMAGENTA RGB(139, 0, 139) // +#define CLR_PURPLE RGB(128, 0, 128) // ɫ +#define CLR_MEDIUMORCHID RGB(186, 85, 211) // +#define CLR_DARKVIOLET RGB(148, 0, 211) // +#define CLR_DARKORCHID RGB(153, 50, 204) // +#define CLR_INDIGO RGB( 75, 0, 130) // (ɫ) +#define CLR_BLUEVIOLET RGB(138, 43, 226) // +#define CLR_MEDIUMPURPLE RGB(147, 112, 219) // ɫ +#define CLR_MEDIUMSLATEBLUE RGB(123, 104, 238) // а +#define CLR_SLATEBLUE RGB(106, 90, 205) // +#define CLR_DARKSLATEBLUE RGB( 72, 61, 139) // +#define CLR_LAVENDER RGB(230, 230, 250) // Ѭ²ݵ +#define CLR_GHOSTWHITE RGB(248, 248, 255) // +#define CLR_BLUE RGB( 0, 0, 255) // +#define CLR_MEDIUMBLUE RGB( 0, 0, 205) // ɫ +#define CLR_MIDNIGHTBLUE RGB( 25, 25, 112) // ҹ +#define CLR_DARKBLUE RGB( 0, 0, 139) // ɫ +#define CLR_NAVY RGB( 0, 0, 128) // +#define CLR_ROYALBLUE RGB( 65, 105, 225) // ʼ () +#define CLR_CORNFLOWERBLUE RGB(100, 149, 237) // ʸ +#define CLR_LIGHTSTEELBLUE RGB(176, 196, 222) // +#define CLR_LIGHTSLATEGRAY RGB(119, 136, 153) // ʯ +#define CLR_SLATEGRAY RGB(112, 128, 144) // ʯ +#define CLR_DODGERBLUE RGB( 30, 144, 255) // +#define CLR_ALICEBLUE RGB(240, 248, 255) // ˿ +#define CLR_STEELBLUE RGB( 70, 130, 180) // () +#define CLR_LIGHTSKYBLUE RGB(135, 206, 250) // ɫ +#define CLR_SKYBLUE RGB(135, 206, 235) // ɫ +#define CLR_DEEPSKYBLUE RGB( 0, 191, 255) // +#define CLR_LIGHTBLUE RGB(173, 216, 230) // +#define CLR_POWDERBLUE RGB(176, 224, 230) // ҩ +#define CLR_CADETBLUE RGB( 95, 158, 160) // +#define CLR_AZURE RGB(240, 255, 255) // εɫ +#define CLR_LIGHTCYAN RGB(224, 255, 255) // ɫ +#define CLR_PALETURQUOISE RGB(175, 238, 238) // ̱ʯ +#define CLR_CYAN RGB( 0, 255, 255) // ɫ +#define CLR_AQUA RGB( 0, 255, 255) // ˮɫ +#define CLR_DARKTURQUOISE RGB( 0, 206, 209) // ̱ʯ +#define CLR_DARKSLATEGRAY RGB( 47, 79, 79) // ʯ +#define CLR_DARKCYAN RGB( 0, 139, 139) // ɫ +#define CLR_TEAL RGB( 0, 128, 128) // ˮѼɫ +#define CLR_MEDIUMTURQUOISE RGB( 72, 209, 204) // ̱ʯ +#define CLR_LIGHTSEAGREEN RGB( 32, 178, 170) // dz +#define CLR_TURQUOISE RGB( 64, 224, 208) // ̱ʯ +#define CLR_AQUAMARINE RGB(127, 255, 212) // ʯ +#define CLR_MEDIUMAQUAMARINE RGB(102, 205, 170) // бʯ +#define CLR_MEDIUMSPRINGGREEN RGB( 0, 250, 154) // дɫ +#define CLR_MINTCREAM RGB(245, 255, 250) // +#define CLR_SPRINGGREEN RGB( 0, 255, 127) // ɫ +#define CLR_MEDIUMSEAGREEN RGB( 60, 179, 113) // к +#define CLR_SEAGREEN RGB( 46, 139, 87) // +#define CLR_HONEYDEW RGB(240, 255, 240) // ۹ɫ +#define CLR_LIGHTGREEN RGB(144, 238, 144) // ɫ +#define CLR_PALEGREEN RGB(152, 251, 152) // ɫ +#define CLR_DARKSEAGREEN RGB(143, 188, 143) // +#define CLR_LIMEGREEN RGB( 50, 205, 50) // +#define CLR_LIME RGB( 0, 255, 0) // +#define CLR_FORESTGREEN RGB( 34, 139, 34) // ɭ +#define CLR_GREEN RGB( 0, 128, 0) // +#define CLR_DARKGREEN RGB( 0, 100, 0) // ɫ +#define CLR_CHARTREUSE RGB(127, 255, 0) // ؾ (ɫ) +#define CLR_LAWNGREEN RGB(124, 252, 0) // ƺ +#define CLR_GREENYELLOW RGB(173, 255, 47) // ̻ɫ +#define CLR_DARKOLIVEGREEN RGB( 85, 107, 47) // +#define CLR_YELLOWGREEN RGB(154, 205, 50) // ɫ +#define CLR_OLIVEDRAB RGB(107, 142, 35) // 魺ɫ +#define CLR_BEIGE RGB(245, 245, 220) // ɫ(ɫ) +#define CLR_LIGHTGOLDENRODYELLOW RGB(250, 250, 210) // ջ +#define CLR_IVORY RGB(255, 255, 240) // +#define CLR_LIGHTYELLOW RGB(255, 255, 224) // dzɫ +#define CLR_YELLOW RGB(255, 255, 0) // +#define CLR_OLIVE RGB(128, 128, 0) // +#define CLR_DARKKHAKI RGB(189, 183, 107) // ߴ +#define CLR_LEMONCHIFFON RGB(255, 250, 205) // ʳ +#define CLR_PALEGOLDENROD RGB(238, 232, 170) // Ҿջ +#define CLR_KHAKI RGB(240, 230, 140) // ߴ +#define CLR_GOLD RGB(255, 215, 0) // ɫ +#define CLR_CORNSILK RGB(255, 248, 220) // ˿ɫ +#define CLR_GOLDENROD RGB(218, 165, 32) // ջ +#define CLR_DARKGOLDENROD RGB(184, 134, 11) // ջ +#define CLR_FLORALWHITE RGB(255, 250, 240) // İɫ +#define CLR_OLDLACE RGB(253, 245, 230) // ˿ +#define CLR_WHEAT RGB(245, 222, 179) // Сɫ +#define CLR_MOCCASIN RGB(255, 228, 181) // ¹Ƥѥ +#define CLR_ORANGE RGB(255, 165, 0) // ɫ +#define CLR_PAPAYAWHIP RGB(255, 239, 213) // ľ +#define CLR_BLANCHEDALMOND RGB(255, 235, 205) // ׵ɫ +#define CLR_NAVAJOWHITE RGB(255, 222, 173) // +#define CLR_ANTIQUEWHITE RGB(250, 235, 215) // Ŷ +#define CLR_TAN RGB(210, 180, 140) // ɫ +#define CLR_BURLYWOOD RGB(222, 184, 135) // Ӳľɫ +#define CLR_BISQUE RGB(255, 228, 196) // +#define CLR_DARKORANGE RGB(255, 140, 0) // ɫ +#define CLR_LINEN RGB(250, 240, 230) // 鲼 +#define CLR_PERU RGB(205, 133, 63) // ³ +#define CLR_PEACHPUFF RGB(255, 218, 185) // ɫ +#define CLR_SANDYBROWN RGB(244, 164, 96) // ɳɫ +#define CLR_CHOCOLATE RGB(210, 105, 30) // ɿ +#define CLR_SADDLEBROWN RGB(139, 69, 19) // ɫ +#define CLR_SEASHELL RGB(255, 245, 238) // +#define CLR_SIENNA RGB(160, 82, 45) // ɫ +#define CLR_LIGHTSALMON RGB(255, 160, 122) // dzɫ +#define CLR_CORAL RGB(255, 127, 80) // ɺ +#define CLR_ORANGERED RGB(255, 69, 0) // Ⱥɫ +#define CLR_DARKSALMON RGB(233, 150, 122) // ()ɫ +#define CLR_TOMATO RGB(255, 99, 71) // Ѻ +#define CLR_MISTYROSE RGB(255, 228, 225) // õ +#define CLR_SALMON RGB(250, 128, 114) // ()ɫ +#define CLR_SNOW RGB(255, 250, 250) // ѩ +#define CLR_LIGHTCORAL RGB(240, 128, 128) // ɺɫ +#define CLR_ROSYBROWN RGB(188, 143, 143) // õɫ +#define CLR_INDIANRED RGB(205, 92, 92) // ӡȺ +#define CLR_RED RGB(255, 0, 0) // +#define CLR_BROWN RGB(165, 42, 42) // ɫ +#define CLR_FIREBRICK RGB(178, 34, 34) // ͻש +#define CLR_DARKRED RGB(139, 0, 0) // ɫ +#define CLR_MAROON RGB(128, 0, 0) // ɫ +#define CLR_WHITE RGB(255, 255, 255) // +#define CLR_WHITESMOKE RGB(245, 245, 245) // +#define CLR_GAINSBORO RGB(220, 220, 220) // ˹޻ɫ +#define CLR_LIGHTGREY RGB(211, 211, 211) // dzɫ +#define CLR_SILVER RGB(192, 192, 192) // ɫ +#define CLR_DARKGRAY RGB(169, 169, 169) // ɫ +#define CLR_GRAY RGB(186, 183, 186) // ɫ(*) +#define CLR_DIMGRAY RGB(105, 105, 105) // Ļɫ +#define CLR_BLACK RGB( 0, 0, 0) // \ No newline at end of file diff --git a/subVersion/D3D9Render.cpp b/subVersion/D3D9Render.cpp new file mode 100644 index 0000000..cf7fbaa --- /dev/null +++ b/subVersion/D3D9Render.cpp @@ -0,0 +1,298 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#include "stdafx.h" + +D3D9Render::D3D9Render() : + m_nFont(0) +{ + +} +D3D9Render::~D3D9Render() +{ + this->releaseFont(); + m_pVertexBuffer->Release(); //close and release vertex buffer + m_pD3dDev->Release(); // close and release the 3D device + m_pD3d->Release(); // close and release Direct3D +} + +bool D3D9Render::init(HWND hWnd) +{ + m_pD3d = Direct3DCreate9(D3D_SDK_VERSION); //create d3d9 interface + + ZeroMemory(&m_d3dParam, sizeof(m_d3dParam)); //clear the struct + + m_d3dParam.Windowed = true; + m_d3dParam.SwapEffect = D3DSWAPEFFECT_DISCARD; + m_d3dParam.hDeviceWindow = hWnd; + m_d3dParam.BackBufferHeight = m_screen.h; + m_d3dParam.BackBufferWidth = m_screen.w; + m_d3dParam.MultiSampleQuality = D3DMULTISAMPLE_NONE; + m_d3dParam.BackBufferFormat = D3DFMT_A8R8G8B8; + + m_pD3d->CreateDevice( D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + hWnd, + D3DCREATE_HARDWARE_VERTEXPROCESSING, + &m_d3dParam, + &m_pD3dDev); + + //create vertex buffer + m_pD3dDev->CreateVertexBuffer( 4 * sizeof(Vertex), + 0, + VERTEX_FORMAT, + D3DPOOL_DEFAULT, //managed = video ram; D3DPOOL_DEFAULT = auto + &m_pVertexBuffer, //vertex buffer interface + NULL); + + this->createFont("Verdana", 14, true, false); + this->createFont("Verdana", 14, false, false); + this->createFont("Verdana", 18, true, false); + + m_pD3dDev->SetFVF(VERTEX_FORMAT);// select which vertex format to use + + return true; +} + +static std::string floatToString(float val) { + auto res = std::to_string(val); + const std::string format("$1"); + std::regex r("(\\d*)\\.0{6}|"); + std::regex r2("(\\d*\\.{1}0*[^0]+)0*"); + res = std::regex_replace(res, r2, format); + res = std::regex_replace(res, r, format); + return res; +} + +bool D3D9Render::render() +{ + m_pD3dDev->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 1.f, 0); + m_pD3dDev->BeginScene(); + + if(g_pSettings->isMenuActive() && g_pMemMan->getWindow() == GetForegroundWindow()) + { + //Draw header + this->drawBoxBorder(0, 0, LAYOUT_ELEMENT_WIDTH, LAYOUT_ELEMENT_HEIGHT, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_BACKGROUND, LAYOUT_COLOR_BORDER); + this->drawText(m_szWindowTitle, 0, 0, LAYOUT_ELEMENT_WIDTH, LAYOUT_ELEMENT_HEIGHT, 2, LAYOUT_COLOR_TEXT, DT_CENTER | DT_VCENTER); + + if (this->m_bMBShowing) + { + this->drawBoxBorder(LAYOUT_ELEMENT_WIDTH + 10, 0, LAYOUT_MB_WIDTH, LAYOUT_ELEMENT_HEIGHT, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_BACKGROUND, LAYOUT_COLOR_BORDER); + this->drawText(this->m_sTitle, LAYOUT_ELEMENT_WIDTH + 10, 0, LAYOUT_MB_WIDTH, LAYOUT_ELEMENT_HEIGHT, 2, LAYOUT_COLOR_TEXT, DT_CENTER | DT_VCENTER); + this->drawBoxBorder(LAYOUT_ELEMENT_WIDTH + 10, LAYOUT_ELEMENT_HEIGHT, LAYOUT_MB_WIDTH, LAYOUT_MB_HEIGHT, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_BACKGROUND, LAYOUT_COLOR_BORDER); + this->drawText(this->m_sDetail, LAYOUT_ELEMENT_WIDTH + 10, LAYOUT_ELEMENT_HEIGHT, LAYOUT_MB_WIDTH , LAYOUT_MB_HEIGHT, 0, LAYOUT_COLOR_TEXT, DT_CENTER | DT_VCENTER); + } + + //prevent race conditions + while(!g_pSettings->lockFeatureCur()) + Sleep(1); + + //draw tabs + for(int i = 0; i < g_pSettings->getFeatureCategoryCount(); i++) + { + featCat* tab = g_pSettings->getFeatureCategory(i); + int x = (LAYOUT_ELEMENT_WIDTH / g_pSettings->getFeatureCategoryCount()) * i, + y = LAYOUT_ELEMENT_HEIGHT * 1, + w = LAYOUT_ELEMENT_WIDTH / g_pSettings->getFeatureCategoryCount(), + h = LAYOUT_ELEMENT_HEIGHT; + + this->drawBoxBorder( x, y, w, h, LAYOUT_BORDER_SIZE, + (i == g_pSettings->getActiveCat()) ? LAYOUT_COLOR_ACTIVE_BG : LAYOUT_COLOR_BACKGROUND, + (i == g_pSettings->getActiveCat()) ? LAYOUT_COLOR_ACTIVE_BORDER : LAYOUT_COLOR_BORDER); + this->drawText(tab->m_szName, x, y, w - 1, h, 0, LAYOUT_COLOR_TEXT, DT_CENTER | DT_VCENTER); + } + //draw features + int n = g_pSettings->getFeatureCurCount(), + active = g_pSettings->getActiveFeature(); + + this->drawBoxBorder( 0, //draw bg for all features + LAYOUT_ELEMENT_HEIGHT * 2, + LAYOUT_ELEMENT_WIDTH, + (n > MAX_MENU_FEATURES_DISPLAYED) ? MAX_MENU_FEATURES_DISPLAYED * LAYOUT_ELEMENT_HEIGHT : LAYOUT_ELEMENT_HEIGHT * n, + LAYOUT_BORDER_SIZE, + LAYOUT_COLOR_BACKGROUND, + LAYOUT_COLOR_BORDER); + + for(int i = 0, j = g_pSettings->getDisplayOffset(); i < n && i < MAX_MENU_FEATURES_DISPLAYED; i++, j++) + { + feat* feature = g_pSettings->getFeatureCur(j); + + int x = 8, + y = LAYOUT_ELEMENT_HEIGHT * (i + 2); + + //selected box + if(j == active) + this->drawBoxBorder( x - 6, + y + 2, + LAYOUT_ELEMENT_WIDTH - (LAYOUT_BORDER_SIZE * 2), + LAYOUT_ELEMENT_HEIGHT - (LAYOUT_BORDER_SIZE * 2), + LAYOUT_BORDER_SIZE, + LAYOUT_COLOR_ACTIVE_BG, + LAYOUT_COLOR_SELECTED); + + //checkbox + if(feature->m_type == feat_toggle || feature->m_type == feat_slider) + { + this->drawBoxBorder( x - 2, + y + 5, + LAYOUT_ELEMENT_HEIGHT - (LAYOUT_BORDER_SIZE * 5), + LAYOUT_ELEMENT_HEIGHT - (LAYOUT_BORDER_SIZE * 5), + LAYOUT_BORDER_SIZE, + (feature->m_bOn == true) ? LAYOUT_COLOR_SELECTED : LAYOUT_COLOR_BACKGROUND, + (feature->m_bOn == true) ? LAYOUT_COLOR_ACTIVE_BORDER : LAYOUT_COLOR_BORDER); + x += (LAYOUT_ELEMENT_HEIGHT - (LAYOUT_BORDER_SIZE * 3)); + } + this->drawText(feature->m_szName, x, y, 0, LAYOUT_ELEMENT_HEIGHT, 1, LAYOUT_COLOR_TEXT, DT_VCENTER); + + //slider + if(feature->m_type == feat_slider) + { + featSlider* slider = static_cast(feature); + int x = (int) (LAYOUT_ELEMENT_WIDTH * .5f), + y = (LAYOUT_ELEMENT_HEIGHT * (i + 2)) + 5, + w = (int) ((LAYOUT_ELEMENT_WIDTH * .5f) - (LAYOUT_BORDER_SIZE * 2)), + h = LAYOUT_ELEMENT_HEIGHT - (LAYOUT_BORDER_SIZE * 5); + float mod = (slider->m_fValue - slider->m_fMin) / (slider->m_fMax - slider->m_fMin); + this->drawBoxBorder(x, y, w, h, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_SLIDER_BG, LAYOUT_COLOR_BORDER); + this->drawBoxBorder(x + (int) (mod * (w - h)), y, h, h, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_SLIDER_BTN, LAYOUT_COLOR_BORDER); + //this->drawText(floatToString(slider->m_fValue), x, y, w - 1, h, 0, LAYOUT_COLOR_VALUE_TEXT, DT_CENTER | DT_VCENTER); + } + } + + //draw scrollbar + int max = n - MAX_MENU_FEATURES_DISPLAYED; //number of features that are not displayed + if(max > 0) + { + int space = LAYOUT_ELEMENT_HEIGHT * (MAX_MENU_FEATURES_DISPLAYED + 2), + height = (space / max <= space / 2) ? space / max : space / 2; + space -= height; + float mod = (g_pSettings->getDisplayOffset() / (float) max); + this->drawBoxBorder(LAYOUT_ELEMENT_WIDTH + LAYOUT_BORDER_SIZE , (int) (space * mod), LAYOUT_SCROLLBAR_WIDTH, height, LAYOUT_BORDER_SIZE, LAYOUT_COLOR_BACKGROUND, LAYOUT_COLOR_BORDER); + } + + g_pSettings->unlockFeatureCur(); + } + + m_pD3dDev->EndScene(); + m_pD3dDev->Present(nullptr, nullptr, nullptr, nullptr); + return true; +} + +bool D3D9Render::createFont(char *name, int size, bool bold, bool italic) +{ + if(m_nFont >= FONT_BUFFER_SIZE) + return false; + D3DXCreateFont(m_pD3dDev, size, 0, (bold) ? FW_BOLD : FW_NORMAL, 0, (italic) ? 1 : 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, name, &m_pFont[m_nFont]); + m_nFont++; + return true; +} + +void D3D9Render::releaseFont() +{ + for(int i = 0; i < m_nFont; i++) + if(m_pFont[i] != nullptr) + m_pFont[i]->Release(); + m_nFont = 0; + return; +} + +bool D3D9Render::getViewport() +{ + RECT rectWnd; + GetWindowRect(g_pMemMan->getWindow(), &rectWnd); + m_screen.w = LAYOUT_ELEMENT_WIDTH * 2 + LAYOUT_SCROLLBAR_WIDTH + LAYOUT_BORDER_SIZE; + m_screen.h = LAYOUT_ELEMENT_HEIGHT * (MAX_MENU_FEATURES_DISPLAYED + 2); //300 + m_screen.x = rectWnd.left + LAYOUT_PADDING_LEFT; + m_screen.y = rectWnd.top + LAYOUT_PADDING_TOP; + return 1; +} + +void D3D9Render::showMessageBox(std::wstring title,std::wstring detail) +{ + this->m_sTitle = title; + this->m_sDetail = detail; + std::thread t([this] { + m_bMBShowing = true; + Sleep(3000); + m_bMBShowing = false; + }); + t.detach(); +} + +void D3D9Render::drawBox(int x, int y, int w, int h, D3DCOLOR color) +{ + /*Vertex vertex[] = + { + {(float) x, (float) y + h, 1.0f, 1.0f, color}, + {(float) x, (float) y, 1.0f, 1.0f, color}, + {(float) x + w, (float) y + h, 1.0f, 1.0f, color}, + {(float) x + w, (float) y, 1.0f, 1.0f, color} + }; + void* pvBuffer; //pointer to the buffer + m_pVertexBuffer->Lock(0, 0, (void**) &pvBuffer, 0); + memcpy(pvBuffer, vertex, sizeof(vertex)); + m_pVertexBuffer->Unlock(); + + // select the vertex buffer to display + m_pD3dDev->SetStreamSource(0, m_pVertexBuffer, 0, sizeof(Vertex)); + + // copy the vertex buffer to the back buffer + m_pD3dDev->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);*/ + + D3DRECT rect {x, y, x + w, y + h}; + m_pD3dDev->Clear(1, &rect, D3DCLEAR_TARGET, color, 1.f, 0); + + return; +} + +void D3D9Render::drawBoxInline(int x, int y, int w, int h, int size, D3DCOLOR color) +{ + this->drawBox(x, y, w, size, color); //top + this->drawBox(x + w - size, y, size, h, color); //right + this->drawBox(x, y + h - size, w, size, color); //bottom + this->drawBox(x, y, size, h, color); //left + return; +} + +void D3D9Render::drawBoxBorder(int x, int y, int w, int h, int borderSize, D3DCOLOR color, D3DCOLOR borderColor) +{ + this->drawBox(x, y, w, h, borderColor); + this->drawBox(x + borderSize, y + borderSize, w - (borderSize * 2), h - (borderSize * 2), color); +} + +void D3D9Render::drawText(std::wstring str, int x, int y, int font, D3DCOLOR color) +{ + LPCWSTR pszStr = str.c_str(); + RECT pos; + pos.left = x; + pos.top = y; + m_pFont[font]->DrawTextW(nullptr, pszStr, (int) lstrlenW(pszStr), &pos, DT_NOCLIP, color); +} + +//void drawText (std::string str, float x, float y, float w, float h, int font, D3DCOLOR color, DWORD flags = NULL) +void D3D9Render::drawText(std::wstring str, int x, int y, int w, int h, int font, D3DCOLOR color, DWORD flags) +{ + LPCWSTR pszStr = str.c_str(); + RECT pos; + pos.left = x; + pos.right = x + w; + pos.top = y; + pos.bottom = y + h; + m_pFont[font]->DrawTextW(nullptr, pszStr, (int) lstrlenW(pszStr), &pos, flags | DT_NOCLIP, color); +} \ No newline at end of file diff --git a/subVersion/D3D9Render.h b/subVersion/D3D9Render.h new file mode 100644 index 0000000..a7c74ed --- /dev/null +++ b/subVersion/D3D9Render.h @@ -0,0 +1,109 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#pragma once +#ifndef D3D9_RENDER +#define D3D9_RENDER + +#define FONT_BUFFER_SIZE 0x10 //max amount of fonts +#define VERTEX_FORMAT (D3DFVF_XYZRHW | D3DFVF_DIFFUSE) //custom vertex format + +//Layout defines +#define LAYOUT_PADDING_TOP 50 +#define LAYOUT_PADDING_LEFT 50 + +#define LAYOUT_BORDER_SIZE 2 +#define LAYOUT_ELEMENT_WIDTH 300 +#define LAYOUT_ELEMENT_HEIGHT 25 + +#define LAYOUT_MB_WIDTH 300 +#define LAYOUT_MB_HEIGHT 100 + +#define LAYOUT_SCROLLBAR_WIDTH 0x08 +#define LAYOUT_SCROLLBAR_HEIGHT 0x40 + +#define uuu 0xaa +#define merah 0x78, 0x38, 0x38 +#define merah_aktif 0xac, 0x85, 0x85 +#define biru 0x38, 0x78, 0xe2 +#define biru_aktif 0x85, 0xac, 0xed +#define hijau 0x38, 0xe2, 0x78 +#define hijau_aktif 0x85, 0xed, 0xac + +#define LAYOUT_COLOR_BACKGROUND D3DCOLOR_ARGB(uuu, 0x38, 0xe2, 0x78)// +#define LAYOUT_COLOR_BORDER D3DCOLOR_ARGB(uuu, 1, 1, 1) +#define LAYOUT_COLOR_TEXT D3DCOLOR_ARGB(uuu, 1, 1, 1) +#define LAYOUT_COLOR_VALUE_TEXT D3DCOLOR_ARGB(uuu, 255,255,255) +#define LAYOUT_COLOR_SLIDER_BG D3DCOLOR_ARGB(uuu, 0x28, 0x28, 0x28) +#define LAYOUT_COLOR_SLIDER_BTN D3DCOLOR_ARGB(uuu, 0x73, 0x73, 0x73) +#define LAYOUT_COLOR_ACTIVE_BG D3DCOLOR_ARGB(uuu, 0x85, 0xed, 0xac)// +#define LAYOUT_COLOR_ACTIVE_BORDER D3DCOLOR_ARGB(uuu, 1, 1, 1) +#define LAYOUT_COLOR_SELECTED D3DCOLOR_ARGB(uuu, 0xff, 0xff, 0xff) + + +struct Vertex +{ + FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag + DWORD color; // from the D3DFVF_DIFFUSE flag +}; + +class D3D9Render +{ + public: + struct scrnVars + { + int w = 800, //screen width + h = 600, + x = 0, + y = 0; //screen height + } m_screen; + + std::wstring m_szWindowTitle; + bool m_bMBShowing; + std::wstring m_sTitle; + std::wstring m_sDetail; + + D3D9Render (); + ~D3D9Render (); + + bool init (HWND hWnd); + bool render (); + bool createFont (char *font, int size, bool bold, bool italic); + void releaseFont (); + bool getViewport (); + void showMessageBox(std::wstring title, std::wstring detail); + + void drawBox (int x, int y, int w, int h, D3DCOLOR color); + void drawBoxInline (int x, int y, int w, int h, int size, D3DCOLOR color); + void drawBoxBorder (int x, int y, int w, int h, int borderSize, D3DCOLOR color, D3DCOLOR borderColor); + void drawText (std::wstring str, int x, int y, int font, D3DCOLOR color); + void drawText (std::wstring str, int x, int y, int w, int h, int font, D3DCOLOR color, DWORD flags = NULL); + protected: + + LPDIRECT3D9 m_pD3d; // the pointer to Direct3D interface + LPDIRECT3DDEVICE9 m_pD3dDev; // the pointer to the device + LPDIRECT3DVERTEXBUFFER9 m_pVertexBuffer; //pointer to the vertex buffer interface + LPD3DXFONT m_pFont[FONT_BUFFER_SIZE]; + int m_nFont; + D3DPRESENT_PARAMETERS m_d3dParam; //d3d9 device params +}; + +extern D3D9Render* g_pD3D9Render; + +#endif \ No newline at end of file diff --git a/subVersion/GTA d3d9.rc b/subVersion/GTA d3d9.rc new file mode 100644 index 0000000..717abf4 --- /dev/null +++ b/subVersion/GTA d3d9.rc @@ -0,0 +1,71 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// (壬й) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "mask.ico" + +#endif // (壬й) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/subVersion/VehiclePreview.h b/subVersion/VehiclePreview.h new file mode 100644 index 0000000..90aa3cb --- /dev/null +++ b/subVersion/VehiclePreview.h @@ -0,0 +1,811 @@ +#pragma once +#include + +struct VehiclePreview { + std::wstring VName; + char* VCode; + char* TexDict; + char* TexName; +}; + + +static std::vector Super{ +{L"Pfister 811","Pfister811","lgm_dlc_executive1","pfister811"}, +{L"Adder","Adder","lgm_default","adder"}, +{L"Autarch","autarch","lgm_dlc_xmas2017","autarch_b"}, +{L"Banshee 900R","Banshee2","lsc_jan2016","banshee2"}, +{L"Bullet","Bullet","lgm_default","bullet"}, +{L"Cheetah","Cheetah","lgm_default","cheetah"}, +{L"Cyclone","cyclone","lgm_dlc_smuggler","cyclone"}, +{L"Cyclone","cyclone","lgm_dlc_smuggler","cyclone"}, +{L"Deveste 8","DEVESTE","lgm_dlc_arena","deveste"}, +{L"Emperor ETR1","Sheava","lgm_dlc_stunt","sheava"}, +{L"Emerus","emerus","lgm_dlc_vinewood","emerus"}, +{L"Entity XXR","entity2","lgm_dlc_assault","entity2"}, +{L"Entity XF","Entityxf","lgm_default","entityxf"}, +{L"FMJ","Fmj","lgm_dlc_executive1","fmj"}, +{L"Furia","furia","lgm_dlc_casinoheist","furia"}, +{L"Progen GP1","gp1","lgm_dlc_specialraces","gp1"}, +{L"Infernus","Infernus","sssa_default","infernus"}, +{L"Itali GTB Custom","italigtb2","lsc_dlc_import_export","italigtb2"}, +{L"Itali GTB","Italigtb","lsc_dlc_import_export","italigtb"}, +{L"Krieger","krieger","lgm_dlc_vinewood","krieger"}, +{L"Nero Custom","Nero2","lsc_dlc_import_export","nero2_b"}, +{L"Nero","Nero","lsc_dlc_import_export","nero2_a"}, +{L"Osiris","Osiris","lgm_dlc_luxe","Osiris"}, +{L"Penetrator","Penetrator","lgm_dlc_importexport","penetrator"}, +{L"Annis RE-7B","Le7b","lgm_dlc_stunt","le7b"}, +{L"Reaper","Reaper","lgm_dlc_executive1","reaper"}, +{L"Rocket Voltic","voltic2","candc_importexport","voltic2"}, +{L"Annis S80RR","s80","lgm_dlc_vinewood","s80"}, +{L"Ubermacht SC1","sc1","lgm_dlc_xmas2017","sc1_b"}, +{L"Scramjet","Scramjet","candc_battle","scramjet"}, +{L"Sultan RS","Sultanrs","lsc_jan2016","sultan2_a"}, +{L"Progen T20","T20","lgm_dlc_luxe","t20"}, +{L"Taipan","taipan","lgm_dlc_assault","taipan"}, +{L"Tempesta","Tempesta","lgm_dlc_importexport","tempesta"}, +{L"Tezeract","tezeract","lgm_dlc_assault","tezeract"}, +{L"Thrax","thrax","lgm_dlc_vinewood","thrax"}, +{L"Turismo R","turismor","lgm_dlc_business","turismor"}, +{L"Tyrant","TYRANT","lgm_dlc_assault","tyrant"}, +{L"Tyrus","Tyrus","lgm_dlc_stunt","tyrus"}, +{L"Vacca","Vacca","lgm_default","vacca"}, +{L"Vagner","Vagner","lgm_dlc_gunrunning","vagner"}, +{L"Vigilante","Vigilante","candc_smuggler","vigilante"}, +{L"Visione","visione","lgm_dlc_smuggler","visione"}, +{L"Voltic","Voltic","lgm_default","voltic_tless"}, +{L"Proto X80 ","Prototipo","lgm_dlc_executive1","prototipo"}, +{L"Ocelot XA-21","xa21","lgm_dlc_gunrunning","xa21"}, +{L"Zentorno","Zentorno","lgm_dlc_business2","zentorno"}, +{L"Zorusso","zorrusso","lgm_dlc_vinewood","zorrusso"} +}; +static std::vector Sports{ +{L"Albany Alpha","Alpha","lgm_dlc_business","alpha"}, +{L"Banshee Topless","Banshee","lgm_dlc_business2","banshee_tless"}, +{L"Dinka Blista","Blista2","sssa_dlc_mp_to_sp","blista2"}, +{L"Grotti Bestia GTS","Bestiagts","lgm_dlc_executive1","bestiagts"}, +{L"Dinka Blista(GO GO Monkey)","blista3","",""}, +{L"Bravado Buffalo Sprunk","Buffalo2","sssa_dlc_hipster","buffalo"}, +{L"Bravado Buffalo S ","Buffalo3","sssa_dlc_mp_to_sp","buffalo3"}, +{L"Bravado Buffalo","Buffalo","sssa_dlc_hipster","buffalo"}, +{L"Grotti Carbonizzare","Carbonizzare","lgm_default","carboniz"}, +{L"Pfister Comet Retro Custom","Comet3","lsc_dlc_import_export","comet3"}, +{L"Pfister Comet","Comet2","sssa_default","comet2"}, +{L"Pfister Comet Safari","comet4","lgm_dlc_xmas2017","comet4_b"}, +{L"Pfister Comet SR","comet5","lgm_dlc_xmas2017","comet5_b"}, +{L"Invetero Coquette","Coquette","lgm_default","coquette"}, +{L"Obey 8F Drafter","drafter","lgm_dlc_vinewood","drafter"}, +{L"Declasse Drift Tampa","tampa2","sssa_dlc_stunt","tampa2"}, +{L"Elegy RH8","Elegy2","lgm_default","elegy2"}, +{L"Annis Elegy Retro Custom","Elegy","lsc_dlc_import_export","elegy"}, +{L"Benefactor Feltzer","Feltzer2","",""}, +{L"Formula PR4", "formula", "lgm_dlc_casinoheist", "formula"}, +{L"Formula R88", "formula2", "lgm_dlc_casinoheist", "formula2"}, +{L"Vapid Flash GT","flashgt","lgm_dlc_assault","flashgt"}, +{L"Lampadati Furore GT","Furoregt","lgm_dlc_lts_creator","furore"}, +{L"Schyster Fusilade","Fusilade","sssa_dlc_business2","fusilade"}, +{L"Karin Futo","futo","sssa_dlc_battle","futo"}, +{L"Vapid GB200","gb200","lgm_dlc_assault","gb200"}, +{L"Declasse Hotring Sabre","hotring","sssa_dlc_assault","hotring"}, +{L"Overflod Imorgon","imorgon","lgm_dlc_casinoheist","imorgon"}, +{L"Issi Sport","issi7","sssa_dlc_vinewood","issi7"}, +{L"Grotti Itali GTO","ITALIGTO","lgm_dlc_arena","italigto"}, +{L"Dinka Jester(Racecar)","jester2","sssa_dlc_christmas_2","jester2"}, +{L"Dinka Jester Classic","jester3","lgm_dlc_assault","jester3"}, +{L"Dinka Jester","Jester","lgm_dlc_business","jester"}, +{L"Ocelot Jugular","jugular","lgm_dlc_vinewood","jugular"}, +{L"Hijak Khamelion","Khamelion","",""}, +{L"Lampadati Komoda","komoda","lgm_dlc_casinoheist","komoda"}, +{L"Karin Kuruma(Armored)","kuruma2","sssa_dlc_heist","kuruma2"}, +{L"Karin Kuruma","kuruma","sssa_dlc_heist","kuruma"}, +{L"Ocelot Locust","locust","lgm_dlc_vinewood","locust"}, +{L"Ocelot Lynx","lynx","lgm_dlc_stunt","lynx"}, +{L"Dewbauchee Massacro (Race)","Massacro2","sssa_dlc_christmas_2","massacro2"}, +{L"Dewbauchee Massacro","Massacro","lgm_dlc_business2","massacro"}, +{L"Vysser Neo","neo","lgm_dlc_vinewood","neo"}, +{L"Pfister Neon","neon","lgm_dlc_xmas2017","neon_b"}, +{L"Obey 9F Cabrio","Ninef2","lgm_default","ninef2"}, +{L"Obey 9F","Ninef","sssa_default","ninef"}, +{L"Obey Omnis","Omnis","sssa_dlc_stunt","omnis"}, +{L"Enus Paragon R","paragon","lgm_dlc_vinewood","paragon"}, +{L"Enus Paragon R (Armored)","paragon2","lgm_dlc_vinewood","paragon"}, +{L"Ocelot Pariah","pariah","lgm_dlc_xmas2017","pariah_b"}, +{L"Maibatsu Penumbra","Penumbra","sssa_dlc_business2","penumbra"}, +{L"Coil Raiden","raiden","lgm_dlc_xmas2017","raiden_b"}, +{L"Dewbauchee Rapid GT Cabrio","rapidgt2","lgm_default","rapidgt2"}, +{L"Dewbauchee Rapid GT","Rapidgt","lgm_default","rapidgt"}, +{L"BF Raptor","raptor","lgm_dlc_biker","raptor"}, +{L"Ubermacht Revolter","revolter","lgm_dlc_xmas2017","revolter_b"}, +{L"Hijak Ruston","ruston","lgm_dlc_specialraces","ruston"}, +{L"Benefactor Schafter LWB","schafter4","lgm_dlc_apartments","schafter4"}, +{L"Benefactor Schafter V12","schafter3","lgm_dlc_apartments","schafter3"}, +{L"Benefactor Schlagen GT","SCHLAGEN","lgm_dlc_arena","schlagen"}, +{L"Benefactor Schwarter","schwarzer","sssa_default","schwarze"}, +{L"Ubermacht Sentine Classic","sentinel3","sssa_dlc_xmas2017","sentinel3_b"}, +{L"Dewbauchee Seven 70","Seven70","lgm_dlc_executive1","seven70"}, +{L"Dewbauchee Specter","specter","lsc_dlc_import_export","specter2_a"}, +{L"Dewbauchee Specter Custom","specter2","lsc_dlc_import_export","specter2_b"}, +{L"Benefactor Streiter","streiter","lgm_dlc_xmas2017","streiter_b"}, +{L"Dinka Sugoi","sugoi","sssa_dlc_casinoheist","sugoi"}, +{L"Karin Sultan","Sultan","lsc_jan2016","sultan2_a"}, +{L"Karin Sultan Classic","sultan2","sssa_dlc_casinoheist","sultan2"}, +{L"Benefactor Surano","surano","lgm_default","surano_convertable"}, +{L"Lampadati Tropos Rallye","tropos","sssa_dlc_stunt","tropos"}, +{L"Albany V-STR","vstr","lgm_dlc_casinoheist","vstr"}, +{L"Bravado Verlierer","Verlierer2","lgm_dlc_apartments","verlier"}, +{L"Annis Future Shock ZR380","ZR3802","mba_vehicles","zr3802"}, +{L"Annis Nightmare ZR380","ZR3803","mba_vehicles","zr3803"}, +{L"Annis Apocalypse ZR380","ZR380","mba_vehicles","zr3801"} +}; +static std::vector SportsClassics{ +{L"Ocelot Ardent","Ardent","candc_gunrunning","ardent"}, +{L"Lampadati Casco","casco","lgm_dlc_heist","casco"}, +{L"Rune Cheburek","cheburek","sssa_dlc_assault","cheburek"}, +{L"Grotti Cheetah Classic","Cheetah2","lgm_dlc_gunrunning","cheetah2"}, +{L"Invetero Coquette Classic","coquette2","lgm_dlc_pilot","coquette2"}, +{L"Imponte Deluxo","deluxo","candc_xmas2017","deluxo_b"}, +{L"Weeny Dynasty","dynasty","sssa_dlc_vinewood","dynasty"}, +{L"Vulcar Fagaloa ","fagaloa","sssa_dlc_assault","fagaloa"}, +{L"Grotti GT500","gt500","lgm_dlc_xmas2017","gt500_b"}, +{L"Pegassi Infernus Classic","Infernus2","lgm_dlc_specialraces","infernus2"}, +{L"Dewbauchee JB 700","jb700","lgm_default","jb700"}, +{L"Dewbauchee JB 700W","jb7002","lgm_default","jb700"}, +{L"Declasse Mamba","mamba","lgm_dlc_apartments","mamba"}, +{L"Albany Manana","manana","",""}, +{L"Lampadati Michelli GT","michelli","sssa_dlc_assault","michelli"}, +{L"Pegassi Monroe","monroe","lgm_default","monroe"}, +{L"Vulcar Nebula Turbo","nebula","sssa_dlc_vinewood","nebula"}, +{L"Vapid Peyote","Peyote","",""}, +{L"Lampadati Pigalle","pigalle","sssa_dlc_hipster","pigalle"}, +{L"Dewbauchee Rapid GT Classic","rapidgt3","lgm_dlc_smuggler","rapidgt3"}, +{L"Vapid Retinue Mk II","retinue2","sssa_dlc_casinoheist","retinue2"}, +{L"Vapid Retinue","Retinue","",""}, +{L"Vapid Retinue","Retinue","sssa_dlc_smuggler","retinue_b"}, +{L"Albany Franken Strange","btype2","sssa_dlc_halloween","btype2"}, +{L"Albany Roosevelt Valor","btype3","lgm_dlc_valentines2","roosevelt2"}, +{L"Albany Roosevelt","btype","lgm_dlc_valentines","roosevelt"}, +{L"Annis Savestra","savestra","lgm_dlc_xmas2017","savestra_b"}, +{L"Grotti Stinger GT","stingergt","lgm_default","stingerg"}, +{L"Grotti Stinger","stinger","lgm_default","stinger"}, +{L"Benefactor Stirling GT","Feltzer3","lgm_dlc_luxe","feltzer3"}, +{L"Ocelot Stromberg","stromberg","candc_xmas2017","stromberg_b"}, +{L"Ocelot Swinger","Swinger","lgm_dlc_battle","swinger"}, +{L"Pegassi Torero","torero","lgm_dlc_gunrunning","torero"}, +{L"Declasse Tornado","Tornado","",""}, +{L"Declasse Tornado Convertible","Tornado2","",""}, +{L"Declasse Tornado Gang","Tornado3","",""}, +{L"Declasse Tornado Convertible Gang","Tornado4","",""}, +{L"Declasse Tornado Custom","Tornado5","lsc_lowrider2","tornado5_a"}, +{L"Declasse Tornado Rat Rod","tornado6","sssa_dlc_biker","tornado6"}, +{L"Grotti Turismo Classic","turismo2","lgm_dlc_specialraces","turismo2"}, +{L"Lampadati Viseris","viseris","lgm_dlc_xmas2017","viseris_b"}, +{L"Truffade Z-Type","ztype","lgm_default","ztype"}, +{L"Karin 190z","z190","lgm_dlc_xmas2017","z190_b"}, +{L"Ubermacht Zion Classic","zion3","sssa_dlc_vinewood","zion3"} +}; +static std::vector Coupes{ +{L"Enus Cognoscenti Cabrio","cogcabrio","lgm_default","cogcabri"}, +{L"Dewbauchee Exemplar","Exemplar","sssa_default","exemplar"}, +{L"Ocelot F620","F620","sssa_dlc_business2","f620"}, +{L"Lampadati Felon","Felon","sssa_default","felon"}, +{L"Lampadati Felon GT","Felon2","sssa_default","felon2"}, +{L"Ocelot Jackal","Jackal","sssa_dlc_heist","jackal"}, +{L"Ubermacht Oracle","Oracle","sssa_default","oracle"}, +{L"Ubermacht Oracle Mk2","oracle2","sssa_dlc_heist","oracle1"}, +{L"Ubermacht Sentinel XS","Sentinel","sssa_dlc_business2","sentinel"}, +{L"Ubermacht Sentinel","Sentinel2","sssa_dlc_business2","sentinel"}, +{L"Enus Windsor","Windsor","lgm_dlc_luxe","windsor"}, +{L"Enus Windsor Drop","Windsor2","",""}, +{L"Ubermacht Zion","Zion","sssa_default","zion"}, +{L"Ubermacht Zion Cabrio","Zion2","sssa_default","zion2"} +}; +static std::vector Muscle{ +{L"Vapid Blade","Blade","sssa_dlc_hipster","blade"}, +{L"Imponte Ruiner 2000","ruiner3","",""}, +{L"Albany Buccaaneer Custom","Buccaneer2","lsc_default","buccaneer2_b"}, +{L"Albany Buccaaneer","Buccaneer","lsc_default","buccaneer2_a"}, +{L"Vapid Chino Custom","Chino2","lsc_default","chino2_a"}, +{L"Vapid Chino","Chino","lgm_dlc_luxe","chino"}, +{L"Vapid Clique","CLIQUE","lgm_dlc_arena","clique"}, +{L"Invetero Coquette Blackfin","coquette3","lgm_dlc_luxe","coquette3"}, +{L"Schyster Deviant","DEVIANT","lgm_dlc_arena","deviant"}, +{L"Vapid Dominator GTX","dominator3","sssa_dlc_assault","dominator3"}, +{L"Vapid Apocalypse Dominator","DOMINATOR4","mba_vehicles","dominato_c_1"}, +{L"Vapid Future Shock Dominator","DOMINATOR5","mba_vehicles","dominato_c_2"}, +{L"Vapid Nightmare Dominator","DOMINATOR6","mba_vehicles","dominato_c_3"}, +{L"Vapid Dominator","Dominator","sssa_dlc_business2","dominato"}, +{L"Imponte Dukes of Death","Dukes2","candc_default","dukes"}, +{L"Imponte Dukes","Dukes","sssa_dlc_mp_to_sp","dukes"}, +{L"Vapid Ellie","ellie","sssa_dlc_assault","ellie"}, +{L"Williard Faction Custom Donk","Faction3","lsc_lowrider2","faction3_b"}, +{L"Williard Faction Custom","Faction2","lsc_lowrider2","faction3_a"}, +{L"Williard Faction","Faction","lsc_default","faction2_a"}, +{L"Bravado Redwood Gauntlet","Gauntlet2","sssa_dlc_mp_to_sp","gauntlet2"}, +{L"Bravado Gauntlet Classic Custom","gauntlet3","sssa_dlc_vinewood","gauntlet3"}, +{L"Bravado Gauntlet Hellfire","gauntlet4","sssa_dlc_vinewood","gauntlet4"}, +{L"Bravado Gauntlet","Gauntlet","sssa_default","gauntlet"}, +{L"Albany Hermes","hermes","sssa_dlc_xmas2017","hermes_b"}, +{L"Vapid Hotknife","Hotknife","lgm_default","hotknife"}, +{L"Vapid Hustler","hustler","lgm_dlc_xmas2017","hustler_b"}, +{L"Declasse Impaler","IMPALER","mba_vehicles","impaler"}, +{L"Declasse Impaler","impaler","sssa_dlc_vinewood","impaler"}, +{L"Declasse Apocalypse Impaler","IMPALER2","mba_vehicles","impaler_c_1"}, +{L"Declasse Future Shock Impaler","IMPALER3","mba_vehicles","impaler_c_2"}, +{L"Declasse Nightmare Impaler","IMPALER4","mba_vehicles","impaler_c_3"}, +{L"Vapid Future Shock Imperator","IMPERATOR2","mba_vehicles","imperator2"}, +{L"Vapid Nightmare Imperator","IMPERATOR3","mba_vehicles","imperator3"}, +{L"Vapid Apocalypse Imperator","IMPERATOR","mba_vehicles","imperator1"}, +{L"Albany Lurcher","lurcher","sssa_dlc_halloween","lurcher"}, +{L"Declasse Moonbeam Custom","Moonbeam2","lsc_default","moonbeam2"}, +{L"Declasse Moonbeam","Moonbeam","",""}, +{L"Imponte Nightsade","nightshade","lgm_dlc_apartments","niteshad"}, +{L"Vapid Peyote Gasser","peyote2","sssa_dlc_vinewood","peyote2"}, +{L"Imponte Phoenix","phoenix","",""}, +{L"Cheval Picador","picador","sssa_dlc_hipster","picador"}, +{L"Vapid Pisswaser Dominator","Dominator2","sssa_dlc_mp_to_sp","dominator2"}, +{L"Bravado Rat Loader","ratloader","sssa_dlc_valentines","rloader"}, +{L"Bravado Rat truck","ratloader2","sssa_dlc_christmas_2","rloader2"}, +{L"Imponte Ruiner 2000","ruiner2","candc_importexport","ruiner2"}, +{L"Imponte Ruiner","ruiner","sssa_dlc_battle","ruiner"}, +{L"Declasse Sabre Turbo","Sabregt","",""}, +{L"Declasse Sabre Turbo Custom","Sabregt2","lsc_lowrider2","sabregt2_a"}, +{L"Vapid Slamvan LostMC","Slamvan2","",""}, +{L"Vapid Slamvan Custom","Slamvan3","lsc_lowrider2","slamvan3_b"}, +{L"Vapid Apocalypse Slamvan ","SLAMVAN4","mba_vehicles","slamvan_c_1"}, +{L"Vapid Future Shock Slamvan","SLAMVAN5","mba_vehicles","slamvan_c_2"}, +{L"Vapid Nightmare Slamvan","SLAMVAN6","mba_vehicles","slamvan_c_3"}, +{L"Vapid Slamvan","Slamvan","sssa_dlc_christmas_2","slamvan"}, +{L"Declasse Burgershot Stallion","stalion2","sssa_dlc_mp_to_sp","stalion2"}, +{L"Declasse Stallion","Stalion","sssa_dlc_mp_to_sp","stallion"}, +{L"Declasse Weaponized Tampa","tampa3","candc_gunrunning","tampa3"}, +{L"Declasse Tampa","Tampa","sssa_dlc_christmas_3","tampa"}, +{L"Declasse Tulip","TULIP","sssa_dlc_arena","tulip"}, +{L"Declasse Vamos","VAMOS","sssa_dlc_arena","vamos"}, +{L"Declasse Vigero","Vigero","sssa_default","vigero"}, +{L"Dundreary Virgo Classic Custom","Virgo2","lsc_lowrider2","virgo2_a"}, +{L"Dundreary Virgo Classic","Virgo3","lsc_lowrider2","virgo2_b"}, +{L"Dundreary Virgo","Virgo","lgm_dlc_luxe","virgo"}, +{L"Declasse Voodoo Custom","Voodoo2","lsc_default","voodoo_b"}, +{L"Declasse Voodoo","Voodoo","lsc_default","voodoo_a"}, +{L"Declasse Yosemite","yosemite","sssa_dlc_xmas2017","yosemite_b"}, +{L"Declasse Drift Yosemite","yosemite2","sssa_dlc_casinoheist","yosemite2"} +}; +static std::vector Offroad{ +{L"BF Injection","bfinjection","sssa_default","bfinject"}, +{L"BF Bifta","Bifta","sssa_default","bifta"}, +{L"Nagasaki Hotrod Blazer","Blazer3","sssa_dlc_hipster","blazer3"}, +{L"Nagasaki Blazer Aqua","Blazer5","candc_importexport","blazer5"}, +{L"Nagasaki Blazer Lifeguard","Blazer2","",""}, +{L"Nagasaki Blazer","Blazer","sssa_default","blazer"}, +{L"Nagasaki Street Blazer","Blazer4","sssa_dlc_biker","blazer4"}, +{L"Canis Bodhi","Bodhi2","sssa_default","bodhi2"}, +{L"Coil Brawler","Brawler","lgm_dlc_luxe","brawler"}, +{L"Benefactor Future Shock Bruiser","BRUISER2","mba_vehicles","bruiser_c_2"}, +{L"Benefactor Nightmare Bruiser","BRUISER3","mba_vehicles","bruiser_c_3"}, +{L"Benefactor Apocalypse Bruiser","BRUISER","mba_vehicles","bruiser_c_1"}, +{L"Declasse Future Shock Brutus","BRUTUS2","mba_vehicles","brutus2"}, +{L"Declasse Nightmare Brutus","BRUTUS3","mba_vehicles","brutus3"}, +{L"Declasse Apocalypse Brutus","BRUTUS","mba_vehicles","brutus1"}, +{L"Vapid Caracara 4x4","caracara2","sssa_dlc_vinewood","caracara2"}, +{L"Vapid Caracara","caracara","candc_assault","caracara"}, +{L"Benefactor Dubsta 6x6","Dubsta3","candc_default","dubsta3"}, +{L"BF Dune FAV","Dune3","candc_gunrunning","dune3"}, +{L"MTL Dune","Dune","sssa_default","dune"}, +{L"BF Duneloader","Dloader","",""}, +{L"Karin Everin","everon","sssa_dlc_casinoheist","everon"}, +{L"Karin Freecrawler","Freecrawler","lgm_dlc_battle","freecrawler"}, +{L"Annis Hellion","hellion","sssa_dlc_vinewood","hellion"}, +{L"HVY Insurgent PickUp Custom","Insurgent3","",""}, +{L"HVY Insurgent PickUp Custom","Insurgent3","ua_generic","ua_unlock_11"}, +{L"HVY Insurgent","Insurgent","candc_default","insurgent"}, +{L"HVY Insurgent PickUp","Insurgent2","candc_default","insurgent"}, +{L"Canis Kalahari","Kalahari","sssa_default","kalahari"}, +{L"Canis Kamacho","kamacho","sssa_dlc_xmas2017","kamacho_b"}, +{L"Cheval Marshall","marshall","candc_default","marshall"}, +{L"HVY Menacer","Menacer","candc_battle","menacer"}, +{L"Canis Mesa (Merryweather)","Mesa3","candc_default","mesa3"}, +{L"Bravado Apocalypse Sasquatch","MONSTER3","mba_vehicles","monster_c_1"}, +{L"Bravado Future Shock Sasquatch","MONSTER4","mba_vehicles","monster_c_2"}, +{L"Bravado Nightmare Sasquatch","MONSTER5","mba_vehicles","monster_c_3"}, +{L"HVY Nightshark","nightshark","candc_gunrunning","nightshark"}, +{L"Nagasaki Outlaw","outlaw","sssa_dlc_casinoheist","outlaw"}, +{L"BF Dune Buggy","Dune4","",""}, +{L"Dune","Dune5","candc_importexport","dune5"}, +{L"Declasse Rancher XL","Rancherxl2","",""}, +{L"Declasse Yosemite Rancher","Rancherxl","sssa_dlc_business","rancherx"}, +{L"RC Bandito","RCBANDITO","sssa_dlc_arena","rcbandito"}, +{L"Karin Rusty Rebel","Rebel2","sssa_dlc_hipster","rebel2"}, +{L"Karin Rebel","Rebel","sssa_default","rebel"}, +{L"Vapid Riata","riata","sssa_dlc_xmas2017","riata_b"}, +{L"Vapid Sandking XL","Sandking","sssa_default","sandking_b"}, +{L"Vapid Sandking SWB","Sandking2","sssa_default","sandkin_2b"}, +{L"Dune2","Dune2","",""}, +{L"Karin Technical modified edition","Technical3","",""}, +{L"Karin Technical Aqua","Technical2","candc_importexport","technical2"}, +{L"Karin Technical Custom","Technical3","ua_generic","ua_unlock_15"}, +{L"Karin Technical","Technical","candc_default","technical"}, +{L"Vapid Liberator","monster","candc_default","monster"}, +{L"Vapid Desert Raid","TrophyTruck2","sssa_dlc_stunt","trophy2"}, +{L"Vapid Trophy Truck","TrophyTruck","sssa_dlc_stunt","trophy"}, +{L"Maxwell Vagrant","vagrant","sssa_dlc_casinoheist","vagrant"}, +{L"Rune Zhaba","Zhaba","",""}, + +}; +static std::vector Motorcycles{ +{L"Dinka Akuma","Akuma","sssa_default","akuma"}, +{L"LCC Avarus","Avarus","sssa_dlc_biker","avarus"}, +{L"Nagasaki BF400","BF400","sssa_dlc_stunt","bf400"}, +{L"Western Bagger","Bagger","sssa_dlc_biker","bagger"}, +{L"Pegassi Bati 801RR","BATI2","sssa_default","bati2"}, +{L"Pegassi Bati 801","BATI","sssa_default","bati"}, +{L"Nagasaki Carbon RS","CARBONRS","lgm_default","carbon"}, +{L"Nagasaki Chimera","CHIMERA","sssa_dlc_biker","chimera"}, +{L"Western Cliffhanger","CLIFFHANGER","sssa_dlc_stunt","cliffhanger"}, +{L"Western Daemon Custom","DAEMON2","sssa_dlc_biker","daemon2"}, +{L"Western Daemon","DAEMON","",""}, +{L"Western Future Shock Deathbike","DEATHBIKE2","mba_vehicles","deathbike_c_2"}, +{L"Western Nightmare Deathbike","DEATHBIKE3","mba_vehicles","deathbike_c_3"}, +{L"Western Apocalypse Deathbike ","DEATHBIKE","mba_vehicles","deathbike_c_1"}, +{L"Shitzu Defiler","DEFILER","sssa_dlc_biker","defiler"}, +{L"Principe Diabolus Custom","DIABLOUS2","lsc_dlc_import_export","diablous2"}, +{L"Principe Diabolus","DIABLOUS","",""}, +{L"Dinka Double-T","DOUBLE","sssa_default","double"}, +{L"Dinka Enduro","ENDURO","sssa_dlc_heist","enduro"}, +{L"Pegassi Esskey","ESSKEY","sssa_dlc_biker","esskey"}, +{L"Pegassi FCR 1000 Custom","FCR2","lsc_dlc_import_export","fcr2_b"}, +{L"Pegassi FCR 1000","FCR","lsc_dlc_import_export","fcr2_a"}, +{L"Pegassi Faggio Mod","FAGGIO3","sssa_dlc_biker","faggio3"}, +{L"Pegassi Faggio","FAGGIO","sssa_default","faggio"}, +{L"Pegassi Faggio Sport","FAGGIO2","sssa_dlc_biker","faggion"}, +{L"Western Gargoyle","GARGOYLE","sssa_dlc_stunt","gargoyle"}, +{L"Shitzu Hakuchou Dragbike","HAKUCHOU2","lgm_dlc_biker","hakuchou2"}, +{L"Shitzu Hakuchou","HAKUCHOU","sssa_dlc_lts_creator","hakuchou"}, +{L"LCC Hexer","HEXER","sssa_default","hexer"}, +{L"LCC Innovation","INNOVATION","sssa_dlc_lts_creator","innovation"}, +{L"Principe Lectro","LECTRO","lgm_dlc_heist","lectro"}, +{L"Maibatsu Manchez","MANCHEZ","sssa_dlc_biker","manchez"}, +{L"Principe Nemesis","NEMESIS","sssa_dlc_heist","nemesis"}, +{L"Western Nightblade","NIGHTBLADE","sssa_dlc_biker","nightblade"}, +{L"Opressor Mk II","Oppressor2","candc_battle","oppressor2"}, +{L"Opressor Mk I","Oppressor","candc_gunrunning","oppressor"}, +{L"PCJ 600","PCJ","sssa_default","pcj"}, +{L"Western Ratbike","RATBIKE","sssa_dlc_biker","ratbike"}, +{L"Western Rampant Rocket Tricycle","rrocket","lgm_dlc_vinewood","rrocket"}, +{L"Pegassi Rufian","RUFFIAN","sssa_default","ruffian"}, +{L"Maibatsu Sanchez","SANCHEZ2","sssa_default","sanchez2"}, +{L"Maibatsu Sanchez Livery","SANCHEZ","sssa_default","sanchez"}, +{L"LCC Sanctus","SANCTUS","sssa_dlc_biker","sanctus"}, +{L"Nagasaki Shotaro","SHOTARO","lgm_dlc_biker","shotaro"}, +{L"Western Sovereign","SOVEREIGN","",""}, +{L"Nagasaki Stryder","stryder","lgm_dlc_casinoheist","stryder"}, +{L"Dinka Thrust","THRUST","lgm_dlc_business2","thrust"}, +{L"Shitzu Vader","VADER","sssa_default","vader"}, +{L"Dinka Vindicator","VINDICATOR","lgm_dlc_luxe","vindicator"}, +{L"Pegassi Vortex","VORTEX","sssa_dlc_biker","vortex"}, +{L"Western Wolfsbane","WOLFSBANE","sssa_dlc_biker","wolfsbane"}, +{L"Western Zombie Chopper","ZOMBIEB","sssa_dlc_biker","zombieb"}, +{L"Western Zombie Bobber","ZOMBIEA","sssa_dlc_biker","zombiea"} +}; +static std::vector Military{ +{L"HVY APC","apc","candc_gunrunning","apc"}, +{L"Trailer","Trailersmall2","candc_gunrunning","trsmall2"}, +{L"Barracks 3","Barracks3","",""}, +{L"Barracks 2","Barracks","candc_default","barracks"}, +{L"Barrage","barrage","candc_xmas2017","barrage_b"}, +{L"Chernobog","chernobog","candc_xmas2017","chernobog_b"}, +{L"Crusader","Crusader","candc_default","crusader"}, +{L"Halftrack","halftrack","candc_gunrunning","halftrack"}, +{L"Bangjali","khanjali","candc_xmas2017","khanjali_b"}, +{L"Rhino","Rhino","candc_default","rhino"}, +{L"HVY Scarab 1","SCARAB2","mba_vehicles","scarab2"}, +{L"HVY Scarab 2","SCARAB3","mba_vehicles","scarab3"}, +{L"HVY Scarab 3","SCARAB","mba_vehicles","scarab1"}, +{L"Thruster","thruster","candc_xmas2017","thruster_b"}, +{L"HVY Barracks 2","Barracks2","",""} +}; +static std::vector Emergency{ +{L"Ambulans","Ambulance","",""}, +{L"FIB","Fbi","",""}, +{L"Damkar","Firetruk","",""}, +{L"FIB SUV","Fbi2","",""}, +{L"Lifeguard","Lguard","",""}, +{L"Pranger","Pranger","",""}, +{L"Polisi 3","Police3","",""}, +{L"Cab Polisi","Policeb","",""}, +{L"Polisi 2","Police2","",""}, +{L"Polisi 1","Police","",""}, +{L"Polisi tua 1","Policeold1","",""}, +{L"Polisi tua 2","Policeold2","",""}, +{L"Riot","Riot","",""}, +{L"Policet","Policet","",""}, +{L"Pbus","Pbus","candc_default","pbus"}, +{L"Riot 2","riot2","candc_xmas2017","riot2_b"}, +{L"Sheriff","Sheriff","",""}, +{L"Sheriff SUV","Sheriff2","",""}, +{L"Polisi 4","Police4","",""} +}; +static std::vector Service{ +{L"Airbus","Airbus","candc_default","airbus"}, +{L"MTL Brickade","Brickade","candc_executive1","brickade"}, +{L"Bus","Bus","candc_default","bus"}, +{L"Coach","Coach","candc_default","coach"}, +{L"MTL Rally","Rallytruck","sssa_dlc_stunt","rallytruck"}, +{L"pbus","Pbus2","sssa_dlc_battle","pbus2"}, +{L"Rentbus","Rentalbus","candc_default","rentbus"}, +{L"Taxi","Taxi","",""}, +{L"Tourbus","Tourbus","",""}, +{L"Trash","Trash2","",""}, +{L"Trash 2","Trash","",""}, +{L"MTL Wastelander","Wastelander","candc_importexport","wastlndr"}, +}; +static std::vector Sedans{ +{L"Declasse Asea Custom","Asea2","",""}, +{L"Declasse Asea","Asea","sssa_dlc_business","asea"}, +{L"Karin Asterope","Asterope","sssa_dlc_business","astrope"}, +{L"Enus Cognoscenti 55","Cog55","lgm_dlc_apartments","cognosc"}, +{L"Enus Cognoscenti 55 (Armored)","Cog552","",""}, +{L"Declasse Premier","Premier","sssa_dlc_business","premier"}, +{L"Emperor Modif 1 (破旧版)","Emperor2","",""}, +{L"Emperor modif 2 (雪地版)","Emperor3","",""}, +{L"Albany Emperor","Emperor","",""}, +{L"Enus Super Diamond","Superd","sssa_default","superd"}, +{L"Cheval Fugitive","Fugitive","sssa_default","fugitive"}, +{L"Benefactor Glendale","Glendale","sssa_dlc_hipster","glendale"}, +{L"Karin Intruder","Intruder","sssa_dlc_business","intruder"}, +{L"Benefactor Turreted Limo","Limo2","",""}, +{L"Dundreary Stretch","Stretch","sssa_default","stretch"}, +{L"Albany Primo Custom","Primo2","",""}, +{L"Albany Primo","Primo","sssa_dlc_hipster","primo"}, +{L"Dundreary Regina","Regina","sssa_dlc_hipster","regina"}, +{L"Mobil Jenazah","Romero","sssa_dlc_battle","Romero"}, +{L"Benefactor Schafter V12 Armored","Schafter5","lgm_dlc_apartments","schafter3"}, +{L"Benefactor Schafter LWB Armored","Schafter6","lgm_dlc_apartments","schafter4"}, +{L"Benefactor Schafter","Schafter2","sssa_dlc_heist","schafter2"}, +{L"Enus Stafford","Stafford","lgm_dlc_battle","stafford"}, +{L"Vapid Stanier","Stanier","sssa_dlc_business","stanier"}, +{L"Zirconium Stratum","Stratum","sssa_dlc_business","stratum"}, +{L"Cheval Surge","Surge","sssa_dlc_heist","surge"}, +{L"Obey Tailgater","Tailgater","sssa_dlc_hipster","tailgater"}, +{L"Vulcar Ingot","Ingot","sssa_dlc_business","ingot"}, +{L"Vulcar Warrener","Warrener","sssa_dlc_hipster","warrener"}, +{L"Albany Washington","Washington","sssa_dlc_business","washingt"} +}; +static std::vector Industrial{ +{L"HVY Bulldozer","Bulldozer","",""}, +{L"HVY Cutter","Cutter","",""}, +{L"Handler","Handler","",""}, +{L"HVY Dump","Dump","candc_default","dump"}, +{L"MTL Flatbed","Flatbed","",""}, +{L"Guardian","Guardian","sssa_dlc_heist","guardian"}, +{L"HVY Mixer2","Mixer2","",""}, +{L"HVY Mixer","Mixer","",""}, +{L"Rubble","Rubble","",""}, +{L"Tiptruck 2","Tiptruck","",""}, +{L"Tip Truck","Tiptruck2","",""} +}; +static std::vector Compacts{ +{L"Asbo","asbo","sssa_dlc_casinoheist","asbo"}, +{L"Dinka Blista","Blista","",""}, +{L"Karin Dilettante (FlyUS)","Dilettante2","",""}, +{L"Karin Dilettante","Dilettante","sssa_default","dilettan"}, +{L"Grotti Brioso R/A","Brioso","sssa_dlc_stunt","brioso"}, +{L"Weeny Issi Classic","issi3","sssa_dlc_assault","issi3"}, +{L"Issi Apocalypse","ISSI4","mba_vehicles","issi3_c_1"}, +{L"Issi Future Shock","ISSI5","mba_vehicles","issi3_c_2"}, +{L"Issi Nightmare","ISSI6","mba_vehicles","issi3_c_3"}, +{L"Dinka Blista Kanjo","kanjo","sssa_dlc_casinoheist","kanjo"}, +{L"Benefactor Panto","Panto","sssa_dlc_hipster","panto"}, +{L"Bollokan Prairie","Prairie","sssa_dlc_battle","prairie"}, +{L"Declasse Rhapsody","Rhapsody","sssa_dlc_hipster","rhapsody"}, +{L"Weeny Issi","Issi2","sssa_default","issi2"} +}; +static std::vector Commercial{ +{L"Vapid Benson","Benson","",""}, +{L"MTL Future Shock Cerberus","CERBERUS2","mba_vehicles","cerberus2"}, +{L"MTL Nightmare Cerberus","CERBERUS3","mba_vehicles","cerberus3"}, +{L"MTL Appocalypse Cerberus","CERBERUS","mba_vehicles","cerberus1"}, +{L"HVY Biff","Biff","",""}, +{L"JoBuilt Hauler","Hauler","",""}, +{L"JoBuilt Hauler Custom","Hauler2","candc_truck","cab_1"}, +{L"MTL Packer","Packer","",""}, +{L"Maibatsu Mule Custom","Mule2","",""}, +{L"Maibatu Mule Custom1","Mule3","candc_default","mule3"}, +{L"Maibatsu Mule Custom2","Mule4","candc_battle","mule4"}, +{L"Maibatsu Mule","Mule","candc_default","mule"}, +{L"JoBuilt Phantom Custom","phantom3","candc_truck","cab_0"}, +{L"JoBuilt Phantom Wedge","Phantom2","candc_importexport","phantom2"}, +{L"JoBuilt Phantom","Phantom","",""}, +{L"MTL Pounder Custom","Pounder2","candc_battle","pounder2"}, +{L"MTL Pounder","Pounder","",""}, +{L"Stockade Custom","Stockade3","",""}, +{L"Stockade","Stockade","",""}, +{L"Terrobyte","Terbyte","",""} +}; +static std::vector Planes{ +{L"Alpha Z1","alphaz1","elt_dlc_smuggler","alphaz1"}, +{L"Avenger","avenger","candc_chopper","banner_5"}, +{L"Avenger 2","avenger2","candc_chopper","banner_4"}, +{L"Besra","Besra","elt_dlc_pilot","besra"}, +{L"Blimp","Blimp2","",""}, +{L"Blimp 2","Blimp","",""}, +{L"Blimp 3","blimp3","elt_dlc_battle","blimp3"}, +{L"RM-10 Bombushka","Bombushka","candc_smuggler","bombushka"}, +{L"Antonov","Cargoplane","",""}, +{L"Cuban 800","Cuban800","elt_default","cuban800"}, +{L"Dodo","Dodo","elt_default","dodo"}, +{L"Duster","Duster","elt_default","duster"}, +{L"Howard NX-25","Howard","elt_dlc_smuggler","howard"}, +{L"Hydra","Hydra","candc_default","hydra"}, +{L"B747","Jet","",""}, +{L"Luxor Deluxe","Luxor2","elt_dlc_executive1","luxor2"}, +{L"Luxor","Luxor","elt_default","luxor"}, +{L"Mammatus","Mammatus","elt_default","mammatus"}, +{L"Microlight","Microlight","elt_dlc_smuggler","microlight"}, +{L"Miljet","Miljet","elt_dlc_pilot","miljet"}, +{L"Mogul","Mogul","candc_smuggler","mogul"}, +{L"V-65 Molotok","Molotok","candc_smuggler","molotok_b"}, +{L"Nimbus","Nimbus","elt_dlc_executive1","nimbus"}, +{L"Nokota","Nokota","candc_smuggler","nokota"}, +{L"P-996 Lazer","Lazer","candc_smuggler","lazer"}, +{L"Pyro","Pyro","candc_smuggler","pyro"}, +{L"Rogue","Rogue","candc_smuggler","rogue"}, +{L"Seabreeze","Seabreeze","elt_dlc_smuggler","seabreeze"}, +{L"Shamal","Shamal","elt_default","shamal"}, +{L"LF-22 Starling","starling","candc_smuggler","starling"}, +{L"B-11 Strikeforce","Strikeforce","candc_battle","strikeforce"}, +{L"Stunt","Stunt","elt_default","stunt"}, +{L"Titan","Titan","elt_default","titan"}, +{L"Tula","tula","candc_smuggler","tula"}, +{L"Velum","Velum2","elt_default","velum2"}, +{L"Velum 2","Velum","elt_default","velum"}, +{L"Vestra","Vestra","",""}, +{L"Volatol (Kontol)","volatol","candc_xmas2017","volatol_b"} +}; +static std::vector Utility{ +{L"Airtug","Airtug","",""}, +{L"ArmyTrailer (1)","Armytrailer","",""}, +{L"ArmyTrailer (2)","Armytrailer2","",""}, +{L"ArmyTanker","Armytanker","",""}, +{L"Trailer3","Tr3","",""}, +{L"BoatTrailer","Boattrailer","",""}, +{L"Caddy","Caddy","",""}, +{L"Caddy2","Caddy2","foreclosures_bunker","transportation_2"}, +{L"Caddy3","Caddy3","foreclosures_bunker","transportation_1"}, +{L"Trailer2","Tr2","",""}, +{L"Trailer4","Tr4","",""}, +{L"Trailer (Pibwasser)","Trailers2","",""}, +{L"Trailer (Big Good)","Trailers3","",""}, +{L"Trailer4","Trailers4","",""}, +{L"Dock Trailer","Docktrailer","",""}, +{L"Dock Tug","Docktug","",""}, +{L"TV Trailer (Fame or Shame)","Tvtrailer","",""}, +{L"Tractor3","Tractor3","",""}, +{L"Tractor2","Tractor2","",""}, +{L"Freight Trailer","Freighttrailer","",""}, +{L"Flat Trailer","Trflat","",""}, +{L"HVY Forklift","Forklift","",""}, +{L"Graintraler","Graintrailer","",""}, +{L"Bale Trailer","Baletrailer","",""}, +{L"Trailer Logs","Trailerlogs","",""}, +{L"Prop Trailer","Proptrailer","",""}, +{L"Trailer Larger","trailerlarge","candc_truck","banner_2"}, +{L"Tanker","Tanker2","",""}, +{L"Tanker(RON)","Tanker","",""}, +{L"Ultility Truck","Utillitruck3","",""}, +{L"Trailers","Trailers","",""}, +{L"Ultility Truck 2","Utillitruck2","",""}, +{L"Rake Trailer","Raketrailer","",""}, +{L"Ripley","Ripley","",""}, +{L"Scrap","Scrap","",""}, +{L"Trailer Small","Trailersmall","",""}, +{L"Mower","Mower","",""}, +{L"Utility Truck 3","Utillitruck","",""}, +{L"Tow Truck","Towtruck","",""}, +{L"Tow Truck (2)","Towtruck2","",""}, +{L"Tractor","Tractor","",""}, +{L"Sadler 2","Sadler2","",""}, +{L"Sadler","Sadler","sssa_default","sadler"}, +}; +static std::vector Helicopters{ +{L"Akula","akula","candc_xmas2017","akula_b"}, +{L"Annihilator","Annihilator","elt_default","annihl"}, +{L"Nagasaki Buzzard Attack Chopper","Buzzard","candc_default","buzzard"}, +{L"Nagasaki Buzzard","Buzzard2","",""}, +{L"Cargobob custom","Cargobob4","",""}, +{L"Western Cargobob Jetsam","Cargobob2","",""}, +{L"Western Cargobob (TPE)","Cargobob3","",""}, +{L"Western Cargobob","Cargobob","candc_default","cargobob"}, +{L"Frogger","Frogger","elt_default","frogger"}, +{L"Frogger(FIB)","Frogger2","",""}, +{L"Havok","havok","elt_dlc_smuggler","havok"}, +{L"FH-1 Hunter","hunter","candc_smuggler","hunter"}, +{L"Maverick","Maverick","elt_default","maverick"}, +{L"Police Maverick","Polmav","",""}, +{L"Savage","Savage","candc_default","savage"}, +{L"Sea Sparrow","SEASPARROW","elt_dlc_assault","sparrow"}, +{L"HVY Skylift","Skylift","",""}, +{L"Buckingham Supervolito Carbon","Supervolito2","",""}, +{L"Buckingham Supervolito","Supervolito","",""}, +{L"Buckingham Swift Deluxe","Swift2","elt_dlc_executive1","swift2"}, +{L"Buckingham Swift","Swift","elt_dlc_pilot","swift"}, +{L"Valkyrie","Valkyrie2","",""}, +{L"Valkyrie (Custom)","Valkyrie","candc_default","valkyrie"}, +{L"Volatus","Volatus","elt_dlc_executive1","volatus"}, +}; +static std::vector Vans{ +{L"BF Surfer (Custom)","Surfer2","",""}, +{L"BF Surfer","Surfer","sssa_dlc_hipster","surfer"}, +{L"Bravado Bison (BackupRack)","Bison2","",""}, +{L"Bravado Bison (Rack)","Bison3","",""}, +{L"Bravado Bison","Bison","sssa_default","bison"}, +{L"Bobcat XL","Bobcatxl","sssa_dlc_business","bobcatxl"}, +{L"Boxville (armored)","Boxville5","candc_importexport","boxville5"}, +{L"Boxville (Go Postal)","Boxville2","",""}, +{L"Boxville (Humane)","Boxville3","",""}, +{L"Boxville (Post OP)","Boxville4","candc_default","boxville4"}, +{L"Boxville (W & P)","Boxville","",""}, +{L"Brute Pony (Business)","Pony","",""}, +{L"Brute Pony (Store)","Pony2","",""}, +{L"Burrito (Bug Stars)","Burrito2","",""}, +{L"Burrito (Construction)","Burrito4","",""}, +{L"Burrito (Gang)","Gburrito2","sssa_dlc_heist","gburrito2"}, +{L"Burrito (The Lost MC)","Gburrito","",""}, +{L"Burriot 5","Burrito5","",""}, +{L"Burrito 3","Burrito3","",""}, +{L"Burrito (Graphics)","Burrito","",""}, +{L"Camper","Camper","",""}, +{L"Journey","Journey","candc_default","journey"}, +{L"MiniVan Custom","Minivan2","lsc_lowrider2","minivan2_b"}, +{L"MiniVAN","Minivan","sssa_dlc_business","minivan"}, +{L"Paradise","Paradise","sssa_default","paradise"}, +{L"Rumpo (Armored)","Rumpo3","sssa_dlc_executive_1","rumpo3_b"}, +{L"Rumpo (Deludamol)","Rumpo2","",""}, +{L"Rumpo (Weazel News)","Rumpo","sssa_dlc_heist","rumpo"}, +{L"Speedo 3","Speedo4","",""}, +{L"Speedo 2","Speedo2","",""}, +{L"Speedo","Speedo","",""}, +{L"Taco","Taco","",""}, +{L"Bravado Youga Custom","Youga2","sssa_dlc_biker","youga2"}, +{L"Bravado Youga","Youga","sssa_dlc_hipster","youga"} +}; +static std::vector Boats{ +{L"Nagasaki Dinghy","Dinghy","",""}, +{L"Nagasaki Dinghy (2-Seater)","Dinghy2","",""}, +{L"Nagasaki Dinghy (Robbery)","Dinghy3","dock_default","dinghy3"}, +{L"Nagasaki Dinghy (Black&White)","Dinghy4","",""}, +{L"Shitzu Jetmax","Jetmax","dock_default","jetmax"}, +{L"Dinka Marquis","Marquis","dock_default","marquis"}, +{L"Police Predator","Predator","",""}, +{L"Seashark","Seashark","dock_default","seashark"}, +{L"Seashark (Lifeguard)","Seashark2","",""}, +{L"Seashark (Charged)","Seashark3","",""}, +{L"Pegassi Speeder","Speeder","dock_default","speeder"}, +{L"Pegassi Speeder (Custom)","Speeder2","",""}, +{L"Shitzu Squalo","Squalo","dock_default","squalo"}, +{L"Submersible","Submersible","",""}, +{L"Kraken Submersible (Kraken)","Submersible2","dock_default","sub2"}, +{L"Shitzu Suntrap","Suntrap","dock_default","suntrap"}, +{L"Lampadati Toro","Toro","dock_default","toro"}, +{L"Lampadati Toro (Custom)","Toro2","",""}, +{L"Shitzu Tropic","Tropic","dock_default","tropic"}, +{L"Shitu Tropic (Custom)","Tropic2","",""}, +{L"Tug","Tug","",""} +}; +static std::vector Cycles{ +{L"BMX","Bmx","pandm_default","bmx"}, +{L"Cruiser","Cruiser","pandm_default","cruiser"}, +{L"Tribike2","Tribike2","pandm_default","tribike2"}, +{L"Fixter","Fixter","",""}, +{L"Scorcher","Scorcher","pandm_default","scorcher"}, +{L"Tribike2","Tribike3","pandm_default","tribike3"}, +{L"Tribike1","Tribike","pandm_default","tribike"} +}; +static std::vector Trains{ +{L"CableCar","Cablecar","",""}, +{L"Gerbong1","Freightcont1","",""}, +{L"Gerbong2","Freightcont2","",""}, +{L"Freightcar","Freightcar","",""}, +{L"Freight","Freight","",""}, +{L"Kereta Api","Freightgrain","",""}, +{L"Metro Train","Metrotrain","",""}, +{L"TankerCar","Tankercar","",""} +}; +static std::vector Trailer{ +{L"Army Tanker", "Armytanker", "", "" }, +{L"Army Trailer", "Armytrailer", "", "" }, +{L"Army Trailer 2", "Armytrailer2", "", "" }, +{L"Bale Trailer", "Baletrailer", "", "" }, +{L"Boat Trailer", "Boattrailer", "", "" }, +{L"Dock Trailer", "Docktrailer", "", "" }, +{L"Freight Trailer", "Freighttrailer", "", "" }, +{L"Grain Trailer", "Graintrailer", "", "" }, +{L"Prop Trailer", "Proptrailer", "", "" }, +{L"Rake Trailer", "Raketrailer", "", "" }, +{L"Tanker (RON)", "Tanker", "", "" }, +{L"Tanker (2)", "Tanker2", "", "" }, +{L"Tanker (3)", "Tr2", "", "" }, +{L"Tanker (4)", "Tr3", "", "" }, +{L"Tanker (5)", "Tr4", "", "" }, +{L"Trailer Logs", "Trailerlogs", "", "" }, +{L"Trailer entah", "Trailers", "", "" }, +{L"Trailer (Pibwasser)", "Trailers2", "", "" }, +{L"Trailer (Big Goods)", "Trailers3", "", "" }, +{L"Trailer 4", "Trailers4", "", "" }, +{L"Trailer Small", "Trailersmall", "", "" }, +{L"Trailer Large", "trailerlarge", "", "" }, +{L"Trailer Flat", "Trflat", "", "" }, +{L"TV Trailer (Fame or Shame)", "Tvtrailer", "", "" } +}; +static std::vector SUV{ +{L"Gallivanter Baller (CEO)","Baller6","",""}, +{L"Gallivanter Baller 2","Baller2","sssa_default","baller2"}, +{L"Gallivanter Baller LE (Armored)","Baller5","",""}, +{L"Gallivanter Baller LE LWB","Baller4","lgm_dlc_apartments","baller4"}, +{L"Gallivanter Baller LE","Baller3","lgm_dlc_apartments","baller3"}, +{L"Gallivanter Baller","Baller","",""}, +{L"BeeJay XL","Bjxl","sssa_dlc_battle","bjxl"}, +{L"Canis Seminole Frontier","Seminole","sssa_dlc_heist","seminole"}, +{L"Albany Cavalcade Mk2","CAVALCADE2","sssa_dlc_business","cavcade2"}, +{L"Albany Cavalcade","CAVALCADE","sssa_default","cavcade"}, +{L"Vapid Contender","Contender","sssa_dlc_stunt","contender"}, +{L"Benefactor Dubsta2","Dubsta2","",""}, +{L"Benefactor Dubsta","Dubsta","",""}, +{L"Emperor Habanero","Habanero","sssa_dlc_battle","habanero"}, +{L"Enus Huntley S","Huntley","lgm_dlc_business2","huntley"}, +{L"Fathom FQ 2","fq2","sssa_dlc_battle","fq2"}, +{L"Declasse Granger","Granger","sssa_dlc_business","granger"}, +{L"Bravado Gresley","Gresley","sssa_dlc_heist","gresley"}, +{L"Dundreary Landstalker","Landstalker","sssa_dlc_heist","landstalker"}, +{L"Mammoth Patriot","Patriot","sssa_dlc_battle","patriot"}, +{L"Cannis Mesa (Custom)","Mesa2","",""}, +{L"Cannis Mesa SUV","Mesa","candc_default","mesa"}, +{L"Lampadati Novak","novak","lgm_dlc_vinewood","novak"}, +{L"Mammoth Patriot Stretch","Patriot2","sssa_dlc_battle","patriot2"}, +{L"Vapid Radius","Radi","sssa_dlc_business","radi"}, +{L"Ubermacht Rebla GTS","rebla","lgm_dlc_casinoheist","rebla"}, +{L"Obey Rocoto","Rocoto","sssa_default","rocoto"}, +{L"Benefactor Serrano","Serrano","sssa_dlc_battle","serrano"}, +{L"Pegassi Toros","TOROS","lgm_dlc_arena","toros"}, +{L"Benefactor XLS(Armored)","Xls2","",""}, +{L"Benefactor XLS","Xls","lgm_dlc_executive1","xls"} +}; +static std::vector>> vehiclePreview{ + {L"Super >>",Super}, + {L"Sport >>",Sports}, + {L"SportClassic >>",SportsClassics}, + {L"Coupe >>",Coupes}, + {L"Muscle >>",Muscle}, + {L"Offroad >>",Offroad}, + {L"Motor >>",Motorcycles}, + {L"Militer >>",Military}, + {L"Emergency >>",Emergency}, + {L"Service >>",Service}, + {L"Sedan >>",Sedans}, + {L"Industri >>",Industrial}, + {L"Compact >>",Compacts}, + {L"Commercial >>",Commercial}, + {L"Pesawat >>",Planes}, + {L"Utility >>",Utility}, + {L"Helikopter >>",Helicopters}, + {L"Van >>",Vans}, + {L"Perahu >>",Boats}, + {L"Sepeda >>",Cycles}, + {L"Kereta >>",Trains}, + {L"Trailer >>",Trailer}, + {L"SUV >>",SUV}, +}; + + +static unsigned int joaat(std::string input) +{ + unsigned int num1 = 0U; + for (char c : input) + { + unsigned int num2 = num1 + (unsigned int)tolower(c); + unsigned int num3 = num2 + (num2 << 10); + num1 = num3 ^ num3 >> 6; + } + unsigned int num4 = num1 + (num1 << 3); + unsigned int num5 = num4 ^ num4 >> 11; + return num5 + (num5 << 15); +} diff --git a/subVersion/d3d9/d3d9.h b/subVersion/d3d9/d3d9.h new file mode 100644 index 0000000..e5c7847 --- /dev/null +++ b/subVersion/d3d9/d3d9.h @@ -0,0 +1,2791 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d9.h + * Content: Direct3D include file + * + ****************************************************************************/ + +#ifndef _D3D9_H_ +#define _D3D9_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0900 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX9 interfaces +#if(DIRECT3D_VERSION >= 0x0900) + + +/* This identifier is passed to Direct3DCreate9 in order to ensure that an + * application was built against the correct header files. This number is + * incremented whenever a header (or other) change would require applications + * to be rebuilt. If the version doesn't match, Direct3DCreate9 will fail. + * (The number itself has no meaning.)*/ + +#ifdef D3D_DEBUG_INFO +#define D3D_SDK_VERSION (32 | 0x80000000) +#define D3D9b_SDK_VERSION (31 | 0x80000000) + +#else +#define D3D_SDK_VERSION 32 +#define D3D9b_SDK_VERSION 31 +#endif + + +#include + +#define COM_NO_WINDOWS_H +#include + +#include + +#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) + #define HMONITOR_DECLARED + DECLARE_HANDLE(HMONITOR); +#endif + +#define D3DAPI WINAPI + +/* + * Interface IID's + */ +#if defined( _WIN32 ) && !defined( _NO_COM) + +/* IID_IDirect3D9 */ +/* {81BDCBCA-64D4-426d-AE8D-AD0147F4275C} */ +DEFINE_GUID(IID_IDirect3D9, 0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c); + +/* IID_IDirect3DDevice9 */ +// {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */ +DEFINE_GUID(IID_IDirect3DDevice9, 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb); + +/* IID_IDirect3DResource9 */ +// {05EEC05D-8F7D-4362-B999-D1BAF357C704} +DEFINE_GUID(IID_IDirect3DResource9, 0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4); + +/* IID_IDirect3DBaseTexture9 */ +/* {580CA87E-1D3C-4d54-991D-B7D3E3C298CE} */ +DEFINE_GUID(IID_IDirect3DBaseTexture9, 0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce); + +/* IID_IDirect3DTexture9 */ +/* {85C31227-3DE5-4f00-9B3A-F11AC38C18B5} */ +DEFINE_GUID(IID_IDirect3DTexture9, 0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5); + +/* IID_IDirect3DCubeTexture9 */ +/* {FFF32F81-D953-473a-9223-93D652ABA93F} */ +DEFINE_GUID(IID_IDirect3DCubeTexture9, 0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f); + +/* IID_IDirect3DVolumeTexture9 */ +/* {2518526C-E789-4111-A7B9-47EF328D13E6} */ +DEFINE_GUID(IID_IDirect3DVolumeTexture9, 0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6); + +/* IID_IDirect3DVertexBuffer9 */ +/* {B64BB1B5-FD70-4df6-BF91-19D0A12455E3} */ +DEFINE_GUID(IID_IDirect3DVertexBuffer9, 0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3); + +/* IID_IDirect3DIndexBuffer9 */ +/* {7C9DD65E-D3F7-4529-ACEE-785830ACDE35} */ +DEFINE_GUID(IID_IDirect3DIndexBuffer9, 0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35); + +/* IID_IDirect3DSurface9 */ +/* {0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B} */ +DEFINE_GUID(IID_IDirect3DSurface9, 0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b); + +/* IID_IDirect3DVolume9 */ +/* {24F416E6-1F67-4aa7-B88E-D33F6F3128A1} */ +DEFINE_GUID(IID_IDirect3DVolume9, 0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1); + +/* IID_IDirect3DSwapChain9 */ +/* {794950F2-ADFC-458a-905E-10A10B0B503B} */ +DEFINE_GUID(IID_IDirect3DSwapChain9, 0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b); + +/* IID_IDirect3DVertexDeclaration9 */ +/* {DD13C59C-36FA-4098-A8FB-C7ED39DC8546} */ +DEFINE_GUID(IID_IDirect3DVertexDeclaration9, 0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46); + +/* IID_IDirect3DVertexShader9 */ +/* {EFC5557E-6265-4613-8A94-43857889EB36} */ +DEFINE_GUID(IID_IDirect3DVertexShader9, 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36); + +/* IID_IDirect3DPixelShader9 */ +/* {6D3BDBDC-5B02-4415-B852-CE5E8BCCB289} */ +DEFINE_GUID(IID_IDirect3DPixelShader9, 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89); + +/* IID_IDirect3DStateBlock9 */ +/* {B07C4FE5-310D-4ba8-A23C-4F0F206F218B} */ +DEFINE_GUID(IID_IDirect3DStateBlock9, 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b); + +/* IID_IDirect3DQuery9 */ +/* {d9771460-a695-4f26-bbd3-27b840b541cc} */ +DEFINE_GUID(IID_IDirect3DQuery9, 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc); + + +/* IID_HelperName */ +/* {E4A36723-FDFE-4b22-B146-3C04C07F4CC8} */ +DEFINE_GUID(IID_HelperName, 0xe4a36723, 0xfdfe, 0x4b22, 0xb1, 0x46, 0x3c, 0x4, 0xc0, 0x7f, 0x4c, 0xc8); + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* IID_IDirect3D9Ex */ +/* {02177241-69FC-400C-8FF1-93A44DF6861D} */ +DEFINE_GUID(IID_IDirect3D9Ex, 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D); + +/* IID_IDirect3DDevice9Ex */ +// {B18B10CE-2649-405a-870F-95F777D4313A} +DEFINE_GUID(IID_IDirect3DDevice9Ex, 0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a); + +/* IID_IDirect3DSwapChain9Ex */ +/* {91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303} */ +DEFINE_GUID(IID_IDirect3DSwapChain9Ex, 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3); + +/* IID_IDirect3D9ExOverlayExtension */ +/* {187aeb13-aaf5-4c59-876d-e059088c0df8} */ +DEFINE_GUID(IID_IDirect3D9ExOverlayExtension, 0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x8, 0x8c, 0xd, 0xf8); + +/* IID_IDirect3DDevice9Video */ +// {26DC4561-A1EE-4ae7-96DA-118A36C0EC95} +DEFINE_GUID(IID_IDirect3DDevice9Video, 0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95); + +/* IID_IDirect3D9AuthenticatedChannel */ +// {FF24BEEE-DA21-4beb-98B5-D2F899F98AF9} +DEFINE_GUID(IID_IDirect3DAuthenticatedChannel9, 0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9); + +/* IID_IDirect3DCryptoSession9 */ +// {FA0AB799-7A9C-48ca-8C5B-237E71A54434} +DEFINE_GUID(IID_IDirect3DCryptoSession9, 0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34); + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#endif + +#ifdef __cplusplus + +#ifndef DECLSPEC_UUID +#if _MSC_VER >= 1100 +#define DECLSPEC_UUID(x) __declspec(uuid(x)) +#else +#define DECLSPEC_UUID(x) +#endif +#endif + +interface DECLSPEC_UUID("81BDCBCA-64D4-426d-AE8D-AD0147F4275C") IDirect3D9; +interface DECLSPEC_UUID("D0223B96-BF7A-43fd-92BD-A43B0D82B9EB") IDirect3DDevice9; + +interface DECLSPEC_UUID("B07C4FE5-310D-4ba8-A23C-4F0F206F218B") IDirect3DStateBlock9; +interface DECLSPEC_UUID("05EEC05D-8F7D-4362-B999-D1BAF357C704") IDirect3DResource9; +interface DECLSPEC_UUID("DD13C59C-36FA-4098-A8FB-C7ED39DC8546") IDirect3DVertexDeclaration9; +interface DECLSPEC_UUID("EFC5557E-6265-4613-8A94-43857889EB36") IDirect3DVertexShader9; +interface DECLSPEC_UUID("6D3BDBDC-5B02-4415-B852-CE5E8BCCB289") IDirect3DPixelShader9; +interface DECLSPEC_UUID("580CA87E-1D3C-4d54-991D-B7D3E3C298CE") IDirect3DBaseTexture9; +interface DECLSPEC_UUID("85C31227-3DE5-4f00-9B3A-F11AC38C18B5") IDirect3DTexture9; +interface DECLSPEC_UUID("2518526C-E789-4111-A7B9-47EF328D13E6") IDirect3DVolumeTexture9; +interface DECLSPEC_UUID("FFF32F81-D953-473a-9223-93D652ABA93F") IDirect3DCubeTexture9; + +interface DECLSPEC_UUID("B64BB1B5-FD70-4df6-BF91-19D0A12455E3") IDirect3DVertexBuffer9; +interface DECLSPEC_UUID("7C9DD65E-D3F7-4529-ACEE-785830ACDE35") IDirect3DIndexBuffer9; + +interface DECLSPEC_UUID("0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B") IDirect3DSurface9; +interface DECLSPEC_UUID("24F416E6-1F67-4aa7-B88E-D33F6F3128A1") IDirect3DVolume9; + +interface DECLSPEC_UUID("794950F2-ADFC-458a-905E-10A10B0B503B") IDirect3DSwapChain9; +interface DECLSPEC_UUID("d9771460-a695-4f26-bbd3-27b840b541cc") IDirect3DQuery9; + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +interface DECLSPEC_UUID("02177241-69FC-400C-8FF1-93A44DF6861D") IDirect3D9Ex; +interface DECLSPEC_UUID("B18B10CE-2649-405a-870F-95F777D4313A") IDirect3DDevice9Ex; +interface DECLSPEC_UUID("91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303") IDirect3DSwapChain9Ex; +interface DECLSPEC_UUID("187AEB13-AAF5-4C59-876D-E059088C0DF8") IDirect3D9ExOverlayExtension; +interface DECLSPEC_UUID("26DC4561-A1EE-4ae7-96DA-118A36C0EC95") IDirect3DDevice9Video; +interface DECLSPEC_UUID("FF24BEEE-DA21-4beb-98B5-D2F899F98AF9") IDirect3DAuthenticatedChannel9; +interface DECLSPEC_UUID("FA0AB799-7A9C-48CA-8C5B-237E71A54434") IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#if defined(_COM_SMARTPTR_TYPEDEF) +_COM_SMARTPTR_TYPEDEF(IDirect3D9, __uuidof(IDirect3D9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9, __uuidof(IDirect3DDevice9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DStateBlock9, __uuidof(IDirect3DStateBlock9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DResource9, __uuidof(IDirect3DResource9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexDeclaration9, __uuidof(IDirect3DVertexDeclaration9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexShader9, __uuidof(IDirect3DVertexShader9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DPixelShader9, __uuidof(IDirect3DPixelShader9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DBaseTexture9, __uuidof(IDirect3DBaseTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DTexture9, __uuidof(IDirect3DTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVolumeTexture9, __uuidof(IDirect3DVolumeTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DCubeTexture9, __uuidof(IDirect3DCubeTexture9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexBuffer9, __uuidof(IDirect3DVertexBuffer9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DIndexBuffer9, __uuidof(IDirect3DIndexBuffer9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DSurface9, __uuidof(IDirect3DSurface9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVolume9, __uuidof(IDirect3DVolume9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9, __uuidof(IDirect3DSwapChain9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DQuery9, __uuidof(IDirect3DQuery9)); + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +_COM_SMARTPTR_TYPEDEF(IDirect3D9Ex, __uuidof(IDirect3D9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Ex, __uuidof(IDirect3DDevice9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9Ex, __uuidof(IDirect3DSwapChain9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3D9ExOverlayExtension, __uuidof(IDirect3D9ExOverlayExtension)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Video, __uuidof(IDirect3DDevice9Video)); +_COM_SMARTPTR_TYPEDEF(IDirect3DAuthenticatedChannel9, __uuidof(IDirect3DAuthenticatedChannel9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DCryptoSession9, __uuidof(IDirect3DCryptoSession9)); + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#endif + +#endif + + +typedef interface IDirect3D9 IDirect3D9; +typedef interface IDirect3DDevice9 IDirect3DDevice9; +typedef interface IDirect3DStateBlock9 IDirect3DStateBlock9; +typedef interface IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9; +typedef interface IDirect3DVertexShader9 IDirect3DVertexShader9; +typedef interface IDirect3DPixelShader9 IDirect3DPixelShader9; +typedef interface IDirect3DResource9 IDirect3DResource9; +typedef interface IDirect3DBaseTexture9 IDirect3DBaseTexture9; +typedef interface IDirect3DTexture9 IDirect3DTexture9; +typedef interface IDirect3DVolumeTexture9 IDirect3DVolumeTexture9; +typedef interface IDirect3DCubeTexture9 IDirect3DCubeTexture9; +typedef interface IDirect3DVertexBuffer9 IDirect3DVertexBuffer9; +typedef interface IDirect3DIndexBuffer9 IDirect3DIndexBuffer9; +typedef interface IDirect3DSurface9 IDirect3DSurface9; +typedef interface IDirect3DVolume9 IDirect3DVolume9; +typedef interface IDirect3DSwapChain9 IDirect3DSwapChain9; +typedef interface IDirect3DQuery9 IDirect3DQuery9; + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +typedef interface IDirect3D9Ex IDirect3D9Ex; +typedef interface IDirect3DDevice9Ex IDirect3DDevice9Ex; +typedef interface IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex; +typedef interface IDirect3D9ExOverlayExtension IDirect3D9ExOverlayExtension; +typedef interface IDirect3DDevice9Video IDirect3DDevice9Video; +typedef interface IDirect3DAuthenticatedChannel9 IDirect3DAuthenticatedChannel9; +typedef interface IDirect3DCryptoSession9 IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#include "d3d9types.h" +#include "d3d9caps.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * DLL Function for creating a Direct3D9 object. This object supports + * enumeration and allows the creation of Direct3DDevice9 objects. + * Pass the value of the constant D3D_SDK_VERSION to this function, so + * that the run-time can validate that your application was compiled + * against the right headers. + */ + +IDirect3D9 * WINAPI Direct3DCreate9(UINT SDKVersion); + +/* + * Stubs for graphics profiling. + */ + +int WINAPI D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName ); +int WINAPI D3DPERF_EndEvent( void ); +void WINAPI D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName ); +void WINAPI D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName ); +BOOL WINAPI D3DPERF_QueryRepeatFrame( void ); + +void WINAPI D3DPERF_SetOptions( DWORD dwOptions ); +DWORD WINAPI D3DPERF_GetStatus( void ); + +/* + * Direct3D interfaces + */ + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3D9 + +DECLARE_INTERFACE_(IDirect3D9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9 methods ***/ + STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Version; + #endif +}; + +typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) +#define IDirect3D9_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#else +#define IDirect3D9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9_AddRef(p) (p)->AddRef() +#define IDirect3D9_Release(p) (p)->Release() +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) +#define IDirect3D9_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#endif + + + + + + + +/* SwapChain */ + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9 + +DECLARE_INTERFACE_(IDirect3DDevice9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; + + #ifdef D3D_DEBUG_INFO + D3DDEVICE_CREATION_PARAMETERS CreationParameters; + D3DPRESENT_PARAMETERS PresentParameters; + D3DDISPLAYMODE DisplayMode; + D3DCAPS9 Caps; + + UINT AvailableTextureMem; + UINT SwapChains; + UINT Textures; + UINT VertexBuffers; + UINT IndexBuffers; + UINT VertexShaders; + UINT PixelShaders; + + D3DVIEWPORT9 Viewport; + D3DMATRIX ProjectionMatrix; + D3DMATRIX ViewMatrix; + D3DMATRIX WorldMatrix; + D3DMATRIX TextureMatrices[8]; + + DWORD FVF; + UINT VertexSize; + DWORD VertexShaderVersion; + DWORD PixelShaderVersion; + BOOL SoftwareVertexProcessing; + + D3DMATERIAL9 Material; + D3DLIGHT9 Lights[16]; + BOOL LightsEnabled[16]; + + D3DGAMMARAMP GammaRamp; + RECT ScissorRect; + BOOL DialogBoxMode; + #endif +}; + +typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice9_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) +#define IDirect3DDevice9_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) +#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice9_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) +#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) +#define IDirect3DDevice9_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) +#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) +#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) +#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) +#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) +#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) +#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) +#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) +#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) +#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) +#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) +#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) +#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) +#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice9_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice9_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice9_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice9_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice9_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice9_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice9_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice9_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice9_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice9_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice9_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice9_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice9_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice9_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice9_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice9_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice9_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) +#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) +#define IDirect3DDevice9_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice9_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) +#define IDirect3DDevice9_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) +#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) +#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) +#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) +#define IDirect3DDevice9_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) +#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) +#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) +#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) +#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) +#define IDirect3DDevice9_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) +#define IDirect3DDevice9_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) +#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) +#define IDirect3DDevice9_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice9_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) +#define IDirect3DDevice9_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) +#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice9_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice9_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice9_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) +#else +#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9_Release(p) (p)->Release() +#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice9_EvictManagedResources(p) (p)->EvictManagedResources() +#define IDirect3DDevice9_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) +#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice9_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) +#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() +#define IDirect3DDevice9_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) +#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) +#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) +#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) +#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) +#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) +#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) +#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) +#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) +#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) +#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) +#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) +#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) +#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice9_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice9_EndScene(p) (p)->EndScene() +#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice9_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice9_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice9_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice9_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice9_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice9_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice9_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice9_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice9_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice9_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice9_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice9_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice9_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice9_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice9_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) +#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) +#define IDirect3DDevice9_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice9_SetScissorRect(p,a) (p)->SetScissorRect(a) +#define IDirect3DDevice9_GetScissorRect(p,a) (p)->GetScissorRect(a) +#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) +#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() +#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->SetNPatchMode(a) +#define IDirect3DDevice9_GetNPatchMode(p) (p)->GetNPatchMode() +#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) +#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) +#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) +#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) +#define IDirect3DDevice9_SetFVF(p,a) (p)->SetFVF(a) +#define IDirect3DDevice9_GetFVF(p,a) (p)->GetFVF(a) +#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) +#define IDirect3DDevice9_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice9_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) +#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) +#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) +#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) +#define IDirect3DDevice9_SetIndices(p,a) (p)->SetIndices(a) +#define IDirect3DDevice9_GetIndices(p,a) (p)->GetIndices(a) +#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice9_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice9_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice9_DeletePatch(p,a) (p)->DeletePatch(a) +#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->CreateQuery(a,b) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DStateBlock9 + +DECLARE_INTERFACE_(IDirect3DStateBlock9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DStateBlock9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(Capture)(THIS) PURE; + STDMETHOD(Apply)(THIS) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DStateBlock9 *LPDIRECT3DSTATEBLOCK9, *PDIRECT3DSTATEBLOCK9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DStateBlock9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DStateBlock9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DStateBlock9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DStateBlock9_Capture(p) (p)->lpVtbl->Capture(p) +#define IDirect3DStateBlock9_Apply(p) (p)->lpVtbl->Apply(p) +#else +#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DStateBlock9_AddRef(p) (p)->AddRef() +#define IDirect3DStateBlock9_Release(p) (p)->Release() +#define IDirect3DStateBlock9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DStateBlock9_Capture(p) (p)->Capture() +#define IDirect3DStateBlock9_Apply(p) (p)->Apply() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain9 + +DECLARE_INTERFACE_(IDirect3DSwapChain9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + + #ifdef D3D_DEBUG_INFO + D3DPRESENT_PARAMETERS PresentParameters; + D3DDISPLAYMODE DisplayMode; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DSwapChain9 *LPDIRECT3DSWAPCHAIN9, *PDIRECT3DSWAPCHAIN9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#else +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9_Release(p) (p)->Release() +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DResource9 + +DECLARE_INTERFACE_(IDirect3DResource9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; +}; + +typedef struct IDirect3DResource9 *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DResource9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DResource9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DResource9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DResource9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DResource9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DResource9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DResource9_GetType(p) (p)->lpVtbl->GetType(p) +#else +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DResource9_AddRef(p) (p)->AddRef() +#define IDirect3DResource9_Release(p) (p)->Release() +#define IDirect3DResource9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DResource9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DResource9_GetPriority(p) (p)->GetPriority() +#define IDirect3DResource9_PreLoad(p) (p)->PreLoad() +#define IDirect3DResource9_GetType(p) (p)->GetType() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexDeclaration9 + +DECLARE_INTERFACE_(IDirect3DVertexDeclaration9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexDeclaration9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9* pElement,UINT* pNumElements) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexDeclaration9 *LPDIRECT3DVERTEXDECLARATION9, *PDIRECT3DVERTEXDECLARATION9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexDeclaration9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexDeclaration9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->lpVtbl->GetDeclaration(p,a,b) +#else +#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexDeclaration9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexDeclaration9_Release(p) (p)->Release() +#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->GetDeclaration(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexShader9 + +DECLARE_INTERFACE_(IDirect3DVertexShader9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; + + #ifdef D3D_DEBUG_INFO + DWORD Version; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexShader9 *LPDIRECT3DVERTEXSHADER9, *PDIRECT3DVERTEXSHADER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexShader9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexShader9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) +#else +#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexShader9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexShader9_Release(p) (p)->Release() +#define IDirect3DVertexShader9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DPixelShader9 + +DECLARE_INTERFACE_(IDirect3DPixelShader9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DPixelShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; + + #ifdef D3D_DEBUG_INFO + DWORD Version; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DPixelShader9 *LPDIRECT3DPIXELSHADER9, *PDIRECT3DPIXELSHADER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DPixelShader9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DPixelShader9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DPixelShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) +#else +#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DPixelShader9_AddRef(p) (p)->AddRef() +#define IDirect3DPixelShader9_Release(p) (p)->Release() +#define IDirect3DPixelShader9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DBaseTexture9 + +DECLARE_INTERFACE_(IDirect3DBaseTexture9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; +}; + +typedef struct IDirect3DBaseTexture9 *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DBaseTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DBaseTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DBaseTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#else +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DBaseTexture9_Release(p) (p)->Release() +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DBaseTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DBaseTexture9_GetType(p) (p)->GetType() +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DTexture9 + +DECLARE_INTERFACE_(IDirect3DTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface9** ppSurfaceLevel) PURE; + STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) +#else +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DTexture9_Release(p) (p)->Release() +#define IDirect3DTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DTexture9_GetType(p) (p)->GetType() +#define IDirect3DTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->UnlockRect(a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->AddDirtyRect(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolumeTexture9 + +DECLARE_INTERFACE_(IDirect3DVolumeTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume9** ppVolumeLevel) PURE; + STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Depth; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVolumeTexture9 *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolumeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolumeTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVolumeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVolumeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVolumeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DVolumeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) +#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) +#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) +#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) +#else +#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolumeTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DVolumeTexture9_Release(p) (p)->Release() +#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVolumeTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DVolumeTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DVolumeTexture9_GetType(p) (p)->GetType() +#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DVolumeTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) +#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) +#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->UnlockBox(a) +#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->AddDirtyBox(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DCubeTexture9 + +DECLARE_INTERFACE_(IDirect3DCubeTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface) PURE; + STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DCubeTexture9 *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCUBETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCubeTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DCubeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DCubeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) +#else +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DCubeTexture9_Release(p) (p)->Release() +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DCubeTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DCubeTexture9_GetType(p) (p)->GetType() +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->UnlockRect(a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexBuffer9 + +DECLARE_INTERFACE_(IDirect3DVertexBuffer9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Length; + DWORD Usage; + DWORD FVF; + D3DPOOL Pool; + DWORD Priority; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexBuffer9 *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVertexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer9_Release(p) (p)->Release() +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DVertexBuffer9_GetType(p) (p)->GetType() +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DIndexBuffer9 + +DECLARE_INTERFACE_(IDirect3DIndexBuffer9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Length; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DIndexBuffer9 *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DIndexBuffer9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DIndexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DIndexBuffer9_Release(p) (p)->Release() +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DIndexBuffer9_GetType(p) (p)->GetType() +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DSurface9 + +DECLARE_INTERFACE_(IDirect3DSurface9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS) PURE; + STDMETHOD(GetDC)(THIS_ HDC *phdc) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + D3DMULTISAMPLE_TYPE MultiSampleType; + DWORD MultiSampleQuality; + DWORD Priority; + UINT LockCount; + UINT DCCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DSurface9 *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSurface9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSurface9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSurface9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DSurface9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DSurface9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DSurface9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) +#define IDirect3DSurface9_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#else +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSurface9_AddRef(p) (p)->AddRef() +#define IDirect3DSurface9_Release(p) (p)->Release() +#define IDirect3DSurface9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DSurface9_GetPriority(p) (p)->GetPriority() +#define IDirect3DSurface9_PreLoad(p) (p)->PreLoad() +#define IDirect3DSurface9_GetType(p) (p)->GetType() +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->LockRect(a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->UnlockRect() +#define IDirect3DSurface9_GetDC(p,a) (p)->GetDC(a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->ReleaseDC(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolume9 + +DECLARE_INTERFACE_(IDirect3DVolume9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVolume9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Depth; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVolume9 *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolume9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolume9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolume9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) +#else +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolume9_AddRef(p) (p)->AddRef() +#define IDirect3DVolume9_Release(p) (p)->Release() +#define IDirect3DVolume9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->LockBox(a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->UnlockBox() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DQuery9 + +DECLARE_INTERFACE_(IDirect3DQuery9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DQuery9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, GetDataSize)(THIS) PURE; + STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE; + STDMETHOD(GetData)(THIS_ void* pData,DWORD dwSize,DWORD dwGetDataFlags) PURE; + + #ifdef D3D_DEBUG_INFO + D3DQUERYTYPE Type; + DWORD DataSize; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DQuery9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DQuery9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DQuery9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DQuery9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DQuery9_GetDataSize(p) (p)->lpVtbl->GetDataSize(p) +#define IDirect3DQuery9_Issue(p,a) (p)->lpVtbl->Issue(p,a) +#define IDirect3DQuery9_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c) +#else +#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DQuery9_AddRef(p) (p)->AddRef() +#define IDirect3DQuery9_Release(p) (p)->Release() +#define IDirect3DQuery9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DQuery9_GetType(p) (p)->GetType() +#define IDirect3DQuery9_GetDataSize(p) (p)->GetDataSize() +#define IDirect3DQuery9_Issue(p,a) (p)->Issue(a) +#define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c) +#endif + + +/**************************************************************************** + * Flags for SetPrivateData method on all D3D9 interfaces + * + * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData + * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this + * pointer and Release when the private data is destroyed. The data will be + * destroyed when another SetPrivateData with the same GUID is set, when + * FreePrivateData is called, or when the D3D9 object is freed. + ****************************************************************************/ +#define D3DSPD_IUNKNOWN 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3D9::CreateDevice's BehaviorFlags + * + ****************************************************************************/ + +#define D3DCREATE_FPU_PRESERVE 0x00000002L +#define D3DCREATE_MULTITHREADED 0x00000004L + +#define D3DCREATE_PUREDEVICE 0x00000010L +#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L +#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L +#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L + +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L +#define D3DCREATE_ADAPTERGROUP_DEVICE 0x00000200L +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX 0x00000400L + +// This flag causes the D3D runtime not to alter the focus +// window in any way. Use with caution- the burden of supporting +// focus management events (alt-tab, etc.) falls on the +// application, and appropriate responses (switching display +// mode, etc.) should be coded. +#define D3DCREATE_NOWINDOWCHANGES 0x00000800L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +// Disable multithreading for software vertex processing +#define D3DCREATE_DISABLE_PSGP_THREADING 0x00002000L +// This flag enables present statistics on device. +#define D3DCREATE_ENABLE_PRESENTSTATS 0x00004000L +// This flag disables printscreen support in the runtime for this device +#define D3DCREATE_DISABLE_PRINTSCREEN 0x00008000L + +#define D3DCREATE_SCREENSAVER 0x10000000L + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + +/**************************************************************************** + * + * Parameter for IDirect3D9::CreateDevice's Adapter argument + * + ****************************************************************************/ + +#define D3DADAPTER_DEFAULT 0 + +/**************************************************************************** + * + * Flags for IDirect3D9::EnumAdapters + * + ****************************************************************************/ + +/* + * The D3DENUM_WHQL_LEVEL value has been retired for 9Ex and future versions, + * but it needs to be defined here for compatibility with DX9 and earlier versions. + * See the DirectX SDK for sample code on discovering driver signatures. + */ +#define D3DENUM_WHQL_LEVEL 0x00000002L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* NO_DRIVERVERSION will not fill out the DriverVersion field, nor will the + DriverVersion be incorporated into the DeviceIdentifier GUID. WINNT only */ +#define D3DENUM_NO_DRIVERVERSION 0x00000004L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +/**************************************************************************** + * + * Maximum number of back-buffers supported in DX9 + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX 3L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/**************************************************************************** + * + * Maximum number of back-buffers supported when apps use CreateDeviceEx + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX_EX 30L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +/**************************************************************************** + * + * Flags for IDirect3DDevice9::SetGammaRamp + * + ****************************************************************************/ + +#define D3DSGR_NO_CALIBRATION 0x00000000L +#define D3DSGR_CALIBRATE 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3DDevice9::SetCursorPosition + * + ****************************************************************************/ + +#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3DSwapChain9::Present + * + ****************************************************************************/ + +#define D3DPRESENT_DONOTWAIT 0x00000001L +#define D3DPRESENT_LINEAR_CONTENT 0x00000002L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPRESENT_DONOTFLIP 0x00000004L +#define D3DPRESENT_FLIPRESTART 0x00000008L +#define D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR 0x00000010L +#define D3DPRESENT_UPDATEOVERLAYONLY 0x00000020L +#define D3DPRESENT_HIDEOVERLAY 0x00000040L +#define D3DPRESENT_UPDATECOLORKEY 0x00000080L +#define D3DPRESENT_FORCEIMMEDIATE 0x00000100L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +/**************************************************************************** + * + * Flags for DrawPrimitive/DrawIndexedPrimitive + * Also valid for Begin/BeginIndexed + * Also valid for VertexBuffer::CreateVertexBuffer + ****************************************************************************/ + + +/* + * DirectDraw error codes + */ +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +/* + * Direct3D Errors + */ +#define D3D_OK S_OK + +#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) +#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) +#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) +#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) +#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) +#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) +#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) +#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) +#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) +#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) +#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) +#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) + +#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) +#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) +#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) +#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) +#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) +#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) +#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) +#define D3DOK_NOAUTOGEN MAKE_D3DSTATUS(2159) + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160) +#define S_NOT_RESIDENT MAKE_D3DSTATUS(2165) +#define S_RESIDENT_IN_SHARED_MEMORY MAKE_D3DSTATUS(2166) +#define S_PRESENT_MODE_CHANGED MAKE_D3DSTATUS(2167) +#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168) +#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164) +#define D3DERR_UNSUPPORTEDOVERLAY MAKE_D3DHRESULT(2171) +#define D3DERR_UNSUPPORTEDOVERLAYFORMAT MAKE_D3DHRESULT(2172) +#define D3DERR_CANNOTPROTECTCONTENT MAKE_D3DHRESULT(2173) +#define D3DERR_UNSUPPORTEDCRYPTO MAKE_D3DHRESULT(2174) +#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180) + + +/********************* +/* D3D9Ex interfaces +/*********************/ + +HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex**); + + + + +#undef INTERFACE +#define INTERFACE IDirect3D9Ex + +DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9 methods ***/ + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter ) PURE; + STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter,UINT Mode,D3DDISPLAYMODEEX* pMode) PURE; + STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; + STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX* pFullscreenDisplayMode,IDirect3DDevice9Ex** ppReturnedDeviceInterface) PURE; + STDMETHOD(GetAdapterLUID)(THIS_ UINT Adapter,LUID * pLUID) PURE; +}; + +typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->lpVtbl->GetAdapterModeCountEx(p,a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->lpVtbl->GetAdapterLUID(p,a,b) +#else +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9Ex_AddRef(p) (p)->AddRef() +#define IDirect3D9Ex_Release(p) (p)->Release() +#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->GetAdapterModeCountEx(a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->EnumAdapterModesEx(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->GetAdapterDisplayModeEx(a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->CreateDeviceEx(a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->GetAdapterLUID(a,b) +#endif + + + + + + + + + + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Ex + +DECLARE_INTERFACE_(IDirect3DDevice9Ex, IDirect3DDevice9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; + STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width,UINT height,float* rows,float* columns) PURE; + STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9* pSrc,IDirect3DSurface9* pDst,IDirect3DVertexBuffer9* pSrcRectDescs,UINT NumRects,IDirect3DVertexBuffer9* pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset) PURE; + STDMETHOD(PresentEx)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetGPUThreadPriority)(THIS_ INT* pPriority) PURE; + STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE; + STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE; + STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9** pResourceArray,UINT32 NumResources) PURE; + STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE; + STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT* pMaxLatency) PURE; + STDMETHOD(CheckDeviceState)(THIS_ HWND hDestinationWindow) PURE; + STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) +#define IDirect3DDevice9Ex_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice9Ex_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->lpVtbl->PresentEx(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->lpVtbl->GetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->lpVtbl->SetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->lpVtbl->WaitForVBlank(p,a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->lpVtbl->CheckResourceResidency(p,a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->lpVtbl->SetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->lpVtbl->GetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->lpVtbl->CheckDeviceState(p,a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->lpVtbl->ResetEx(p,a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetDisplayModeEx(p,a,b,c) +#else +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Ex_Release(p) (p)->Release() +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->EvictManagedResources() +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() +#define IDirect3DDevice9Ex_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice9Ex_EndScene(p) (p)->EndScene() +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->SetScissorRect(a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->GetScissorRect(a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->SetNPatchMode(a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->GetNPatchMode() +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->SetFVF(a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->GetFVF(a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->SetIndices(a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->GetIndices(a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->DeletePatch(a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->CreateQuery(a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->SetConvolutionMonoKernel(a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->ComposeRects(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->PresentEx(a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->GetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->SetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->WaitForVBlank(a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->CheckResourceResidency(a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->SetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->GetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->CheckDeviceState(a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->ResetEx(a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->GetDisplayModeEx(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain9Ex + +DECLARE_INTERFACE_(IDirect3DSwapChain9Ex, IDirect3DSwapChain9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(GetLastPresentCount)(THIS_ UINT* pLastPresentCount) PURE; + STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS* pPresentationStatistics) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->lpVtbl->GetLastPresentCount(p,a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->lpVtbl->GetDisplayModeEx(p,a,b) +#else +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9Ex_Release(p) (p)->Release() +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->GetLastPresentCount(a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->GetPresentStats(a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->GetDisplayModeEx(a,b) +#endif + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + + +#undef INTERFACE +#define INTERFACE IDirect3D9ExOverlayExtension + +DECLARE_INTERFACE_(IDirect3D9ExOverlayExtension, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9ExOverlayExtension methods ***/ + STDMETHOD(CheckDeviceOverlayType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,UINT OverlayWidth,UINT OverlayHeight,D3DFORMAT OverlayFormat,D3DDISPLAYMODEEX* pDisplayMode,D3DDISPLAYROTATION DisplayRotation,D3DOVERLAYCAPS* pOverlayCaps) PURE; +}; + +typedef struct IDirect3D9ExOverlayExtension *LPDIRECT3D9EXOVERLAYEXTENSION, *PDIRECT3D9EXOVERLAYEXTENSION; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9ExOverlayExtension_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) +#else +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->AddRef() +#define IDirect3D9ExOverlayExtension_Release(p) (p)->Release() +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->CheckDeviceOverlayType(a,b,c,d,e,f,g,h) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Video + +DECLARE_INTERFACE_(IDirect3DDevice9Video, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9Video methods ***/ + STDMETHOD(GetContentProtectionCaps)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,D3DCONTENTPROTECTIONCAPS* pCaps) PURE; + STDMETHOD(CreateAuthenticatedChannel)(THIS_ D3DAUTHENTICATEDCHANNELTYPE ChannelType,IDirect3DAuthenticatedChannel9** ppAuthenticatedChannel,HANDLE* pChannelHandle) PURE; + STDMETHOD(CreateCryptoSession)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,IDirect3DCryptoSession9** ppCryptoSession,HANDLE* pCryptoHandle) PURE; +}; + +typedef struct IDirect3DDevice9Video *LPDIRECT3DDEVICE9VIDEO, *PDIRECT3DDEVICE9VIDEO; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Video_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->lpVtbl->GetContentProtectionCaps(p,a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->lpVtbl->CreateAuthenticatedChannel(p,a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->lpVtbl->CreateCryptoSession(p,a,b,c,d) +#else +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Video_Release(p) (p)->Release() +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->GetContentProtectionCaps(a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->CreateAuthenticatedChannel(a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->CreateCryptoSession(a,b,c,d) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DAuthenticatedChannel9 + +DECLARE_INTERFACE_(IDirect3DAuthenticatedChannel9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DAuthenticatedChannel9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(Query)(THIS_ UINT InputSize,CONST VOID* pInput,UINT OutputSize,VOID* pOutput) PURE; + STDMETHOD(Configure)(THIS_ UINT InputSize,CONST VOID* pInput,D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT* pOutput) PURE; +}; + +typedef struct IDirect3DAuthenticatedChannel9 *LPDIRECT3DAUTHENTICATEDCHANNEL9, *PDIRECT3DAUTHENTICATEDCHANNEL9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->lpVtbl->Query(p,a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->lpVtbl->Configure(p,a,b,c) +#else +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->AddRef() +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->Release() +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->Query(a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->Configure(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DCryptoSession9 + +DECLARE_INTERFACE_(IDirect3DCryptoSession9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DCryptoSession9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(EncryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT DstSurfaceSize,VOID* pIV) PURE; + STDMETHOD(DecryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT SrcSurfaceSize,D3DENCRYPTED_BLOCK_INFO* pEncryptedBlockInfo,VOID* pContentKey,VOID* pIV) PURE; + STDMETHOD(GetSurfacePitch)(THIS_ IDirect3DSurface9* pSrcSurface,UINT* pSurfacePitch) PURE; + STDMETHOD(StartSessionKeyRefresh)(THIS_ VOID* pRandomNumber,UINT RandomNumberSize) PURE; + STDMETHOD(FinishSessionKeyRefresh)(THIS) PURE; + STDMETHOD(GetEncryptionBltKey)(THIS_ VOID* pReadbackKey,UINT KeySize) PURE; +}; + +typedef struct IDirect3DCryptoSession9 *LPDIRECT3DCRYPTOSESSION9, *PDIRECT3DCRYPTOSESSION9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCryptoSession9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->lpVtbl->EncryptionBlt(p,a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->lpVtbl->DecryptionBlt(p,a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->lpVtbl->GetSurfacePitch(p,a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->lpVtbl->StartSessionKeyRefresh(p,a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->lpVtbl->FinishSessionKeyRefresh(p) +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->lpVtbl->GetEncryptionBltKey(p,a,b) +#else +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->AddRef() +#define IDirect3DCryptoSession9_Release(p) (p)->Release() +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->EncryptionBlt(a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->DecryptionBlt(a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->GetSurfacePitch(a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->StartSessionKeyRefresh(a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->FinishSessionKeyRefresh() +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->GetEncryptionBltKey(a,b) +#endif + +/* -- D3D9Ex only */ +#endif // !D3D_DISABLE_9EX + + +#ifdef __cplusplus +}; +#endif + +#endif /* (DIRECT3D_VERSION >= 0x0900) */ +#endif /* _D3D_H_ */ + diff --git a/subVersion/d3d9/d3d9.lib b/subVersion/d3d9/d3d9.lib new file mode 100644 index 0000000000000000000000000000000000000000..62b3f756405f144435aa239dbee664707ef9de8c GIT binary patch literal 5092 zcmcIn&2JM&6n}Am1UDZ}Qne~=!L1Mz;S8eh?ao{8SB$^9(%YGN^LBo3=DqpN>=$3x zjDz|&(XZm(Cz)JNCD$^EOxCMUh-NaeCaQO%0B`|d`Xxa0HNeazfTcMh$5^7wKD1@= z34kRMmMC*ig`C3@Wqw=8Gb~YJZ){n31wayeY|BC&+bFT~B&u52DVLP0nwKk^N}*gW zDXNyzvY@KFd&Od~7k;L0yR*8zw|hg)=c+l#Hw^v2OyxHXy=Ln4dE>CH`nA5cd>n3v z`VBU%)N7hg{0)nWwb#oA7sO58Slfsl_n%vQA$c7kFIz<7|k5@NDH%c)NDt=sTn`$hHuEO-eswv1FfT=rO>nG&5myTsOW9X=`Evn=tN$48|dcm z5VO=a5#fFif;-sux^7m?n%VK2cJ+hv%euoa3rH|8rvY9g(_ETCrdR?vMtL|3@MIA{ zLV1dea}H&D9^e_un;5_={O~cBbu7)N%-r+zw*=s-e-_4=vmgt!;2NW z1+amYU$`Mk31Zil>2R-IT;Z+{vGP00KSD8yr38uR!fs8dk&gi0qOcw5C5S(dU^$Om zMb9)(>Iy8yrcm*RrM8{C{9+kQb5q zsKyuwf6zK?qo0>w`~>gbx$V&q$gv3UbR_`G)jDgeiPV z4{`4&o)m)<@5=+PStjXPGkZ_{jR1CV!`H0Go?7K)qCH7_%KbNu|XdfPHEqo0qH78tH&TV0Mr1fy5 zPZ25NLh4>X9H@bJ!)iJl>r2F%bYTT9H4Y?K`pxikkJ+7aA$IRci~s}Au2+7X_G0nf z%K_ucIOcW6izTjej4;H!__F28`;Red^cTiI1NN`M2skI~`;QQ3+J$5NbT}|v>3ii? e!*lQxL^(?+zMCwMKg7EA$h~L~32(<;tp5Od+tKd; literal 0 HcmV?d00001 diff --git a/subVersion/d3d9/d3dx9.h b/subVersion/d3d9/d3dx9.h new file mode 100644 index 0000000..43f9e62 --- /dev/null +++ b/subVersion/d3d9/d3dx9.h @@ -0,0 +1,78 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9.h +// Content: D3DX utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX_INTERNAL__ +#error Incorrect D3DX header used +#endif + +#ifndef __D3DX9_H__ +#define __D3DX9_H__ + + +// Defines +#include + +#define D3DX_DEFAULT ((UINT) -1) +#define D3DX_DEFAULT_NONPOW2 ((UINT) -2) +#define D3DX_DEFAULT_FLOAT FLT_MAX +#define D3DX_FROM_FILE ((UINT) -3) +#define D3DFMT_FROM_FILE ((D3DFORMAT) -3) + +#ifndef D3DXINLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DXINLINE __forceinline + #else + #define D3DXINLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DXINLINE inline + #else + #define D3DXINLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d9.h" +#include "d3dx9math.h" +#include "d3dx9core.h" +#include "d3dx9xof.h" +#include "d3dx9mesh.h" +#include "d3dx9shader.h" +#include "d3dx9effect.h" + +#include "d3dx9tex.h" +#include "d3dx9shape.h" +#include "d3dx9anim.h" + + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DXERR { + D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), + D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), + D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), + D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), + D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), + D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), + D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), + D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), + D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX9_H__ + diff --git a/subVersion/d3d9/d3dx9.lib b/subVersion/d3d9/d3dx9.lib new file mode 100644 index 0000000000000000000000000000000000000000..8587d5b07ffc2e3cb09e930a446908fc5b8c0651 GIT binary patch literal 81324 zcmeHwdz@TFmH)XRKnSn!3L%6LAV7c+l9|aQK!`~u2@?omc4i16%aSyio}{6tJM_%N zz_O8bUDkD7mUWe7S(imc#DIu^hzJ@H5fB9tF(M)&YD7dtULxY}RMo9p=hSPub0>U$ ze{4RVlb&1Woch+O_pLfr_pmvI+M0E9N1rf>|C`Y?tEFZ3j2W|=c=+`6v1xj1llpu0 zXn+wP1Ng)z0Y3E@z^6w6{G_aC^Hcyq-+D^XgNp$KeP^zso5lkmCDT463AP;zf|6qo zmjs`m2a;}i1VGSjV^g{ue+9j+==L&zpgZR%`ss}Tf?h!!L4UYb(JQy$GtwW9l9U`V z2NZ3_-^~CIO;Plnn=ySz-<^=smH3PF>RyW8>;yncj;lz5pKL{Yk$&2u=;c=c1pWTJ zlrUd@{}?34pQLEoIJ6h(c*I45&)=o!)>Z&Xcj7P77p6)|jvIkENXK3&32wX}1SO}; zl>~PnwxkvKi}dY^q~xGCLDJMmAd$2Jf02%RP7=KFGzdzjy)FqJL`*@yO6k?h&|ak1 zE>ZOATloAIB!{=BbRYiS2k;Bz3wr)Tihi*TpOJp~NJ`!Ki}d{4iXONWK+v6NyPz*3 zPtdPlN@+CyB5k`yQnFVK6k#6hH3DsWR?!zRUj^NR1(&11WXjFVX{VDY}0F>LG2pK+)Hq1Q2xJGDY7& zJwf+koPxGIr|9eFq8!qF4=egcJIWz_4dWGbFV-1BU&XXb5`QCoZG)nFG0z0Ouv*b? zmIFxoF8(6Dc$%UYwjv+tO|(_eAMa80)@A@ff10f5k8?2`=}(w!Di}X%K(c2$JKGHke6#aP<@;5;;Ws9O?Zh=Hn3;wnMeD=1K z#NSApuTk{9Rsca?nxg23Sl)uZcY~rQ_6HF3rH?DRdm@0Kt(YHzp2GYV^aQ3w(32w- z-Hq`Jx(8(i{TTC6(9sdv!F~0=0j#YHx z-H3-Y=V3*FzmitqFVdb@DjIPGB$D32U!-KNqTM?n5wzz7MY|!kq?hp*Y4kISMqLSs zpxs6)8ht*7Bkh4UNV*<>u^j$#UP@2l?^B31QBiUW;vwz2Ste}xw745VU5K?IsogXp#2d;&^W9glCH*Iq=QB)!YY{v8Z%GP-j6^cXs_oL?TuwAXw0pO z_L&3;65RB5N?3PqLi$y^qHp!$JOb&4Clq~V8Gxh*@fYdF#fom|K|a#W&nx=exd4(- z?{i4EbSS!c0QpESKA`C3OK{vq`gxP0-(g!6^vsr&upK>v^ztZ0FHHxKgnjBuNWYt` z=(lqLB;AR>NKc|Yf_}Y8QgSestDwV1rG(?#VMycGDLM@6k)ZL9DLUl+kVtwNe~~7h zmlEdXM5IGcQZxbUrJzIhP;~HY#6gn~L+M2H1TxmvL>P&}j9zm7_oKrXX*`C_k_2se^l9p3oTU@2EF7Am$-7A7Q?7s{m` zOTvT+iBpS}Vhz)7gYj@7*@anDF7;k)MaP0=s;YhKF;5p%2P-|L%G$2=>xwm+!);!^ zM{_}SBh4nRCYVHLS+&+zDEGVann7f{3zfCS%781Y8LsT&TA|NlL#m*-0j)(IBd8wo zrKYSb3kG|8i#3`u8Z6`%m&(O98Azl^ppaQwEyzM&T&wo2m`~&^h9i4+NcL=*My9?5 zYhGWqc5z50<2xvw#s2DGZ4J#&7IVfInq7qrvR!ponI$aPlA~4-Ic0;&J6YRB_H+$k zUiJ|i{Ct6+I9(T(DoZN8RYxUbxU#*gT12as^~KS!xk9VE*xz3)m$Bbi)=?N(v#v;6o`)%P78ci(3)t0EYXXPoiOUlj zC?iA-li1?&gvOG}0Cv{JHMDV?FecG8cz%D;E0=PZba$;pz_Tbtu#h`z`TT)$pK#(P_XQoU$+_A%-G3Fm=?b=hF^I zjZ%aq_jzg~k4XT9r;gU8&qdO2}bl@{3CqM^J`k z5}n1hrG6Z#mf@_j=ZwNY&FVK~+BbiE+>TN~y0PMzbz9qQ<05EMicqiJl-HO+d`VlO+N>P%PJS*)x&$$%q(EEe_y> zLJwlBdvjQ+ylAi?1&c>CmKG~(2k1*8MlYn(a3Oi-`hij(cCnuE#9>kS#RWe2XkisD zB-38KTE2KKf1Oq1KpJi&trsvUmA!Y#r?!jBSlK-poiR*o?u(#|A`Lcj-PPJ48xN(J z3MEp-!ul$mzA59nRWOy?I6%7=>N9SFoh6n{g?))Qkr>C-W~ z<*ji8bu(j&l;C){q_42HDArhXEu;4M`5{f3Zl9(~tIg4t#Bhy_4_k9%_(sMTgJ?V1 zl-bO!?W8g>5s#RBr~S7t`@HOc9!a$3yOGfwSENKhm0y0f93 znUk+Z$fU&+hno_wkcq>}HUnelOi*yhxZE@a;-dNEWMDXD5mA%2ppcuoh^UE=WUJ`w zeJ?B?k%+#V4o9EnkCla?Gz7#8JC-?KwLDRNG9qUG(=fZ zF_R{5JZ_2tVkRCdBPm#&EsnqS2IF(n77;b+bFws+!l-avak{CD#2F}8HrKKAFt!GYzs$Mz4*<97sg0PH0#bU0COX2!!)$+A~23)NC2=Xs1}%F)s+KP`FA z(;7PSR#?&|TuTzXZd;o3v<5?TbZoBB5{o|QC8pf7tTkhsB~i-N!a#FVcXdYV{93KR zcI|9dCO@OKyV~63m8UErzr47nNhOBwZu4+0*|ZRv;-KAxt@1y1Q1W^!K9AnrgF4GKmWkhL)vy#DytGOJ`QqGQr*+boUdGb$S>5z$Sj<$XB`aBvj?EN0(uZQ>!XggJeWgl) zIrq9es<8$Kn`%GZgw*nyW29xOywZkaq|X>E50uuI=}4ub&KRz&iN_QOS27Ytdx`M$ z^4OrmjbzsvbO^7kCHYr11Z$}B;<~q> z2tl5XY#{XMXH2f6W+eO_&43y%*U}@Q4@mR4#!`CT%K%_7ms_-vx;q&`5zZyM&~wBu zt2mbQMS}(Ux@KbTk{pjTI$sV30ECKSb3HoS_T>%b3(bylp_0C{^CGYqnQV4a!t(Tz z@|>CJh&`K*YN;}yN|V%Ysb#ZWJv!)fm3~`_9M11=s`n{hmS+VQsoV=hs%NbS_UXP}A+Rn3O*aI+l1kjFcM- z$u*o*sXM8nS)=|oQIdmUEw2?$-`imwncMZyb#AiBI1O(|F>UoaIUTu3e~ z^%q!^A#uArOC$BvG;NY-q&$`yG|)PioFz!JnEa9ouDEs;`|$O+w1)PPnVKcRwAC?{ zsJbn}^t%dpd>B(qawNmecuWI(xc&i5Y5^&u8z2-&XoMH>p`h0>p!zhv4RB`v37)cUUWG>G!)d$AT!Z^T{g z^Lyw#LOm;8@z&3yRw0VJkh#})wToxP(NnV~k~dxLCX`Dxd!?GKxLUkYEtb?wuhdLS zs?{sino6wDR6_sEz9bs1(g>a2lx)XNl-~i@Bd$Ej};sE+&ObnR*MU}O_Lk)%_ zrK^=SxXx5T636-2p;4?27Efr1{YZ?%q+9Kf(s4N`649q~gMhyBycceZ3}1Uz(G*04 zL>hu@nu>@Ju|t(?Fb_C8phrM2TQMRw+XBR1&Z4NPt+s&B?Wh&k*Q$7;t6vR6 z8k(wyWnwYV0t>~UW^z8Rp6d;j4kH&ziKcN7%oi!KKTi} zA?{NEqdpB#{t3WTyw&HaZviaE+lA(S2Vne703Vu`z_Hr^4nH=5d7sCd;cfvKdmF&z zNUtN6ZwHuzxBlGtQ`C6{;MzanZA18b6#mXRB7x0FQy#*bhcLbg-vzi5X)nAPr}IsK z%5e#7McfwDedT3<^L~%%K|1O91jZrmX8gSiFMvUi9wCB!W0bGW-m%N6zzTt2C;R)P_bjdH! zM!d;q8~#4>OMq^qxAFPX2k>?_w5$7zc-zsh0Y)QTgZWU~D}fP6&m!Jq$h-C)fH99^ z_z&?`CH!6a7~U#~vU;41e##o95nn7Uht({tRFp(&hN~QVhQy>&ZAQ!yA5%8fftZ2 zMY`^!1g0UaoRh#+7|$k*qk?*GqTaKp_ZaGp#lP=Hy@yfeVRg|OT)AfgSByyD9i+KQ z0v)?2Fag6h?UumHNY9MMIz1|Zk@)xd`1iCu61X1eyuV<3M4E_tx1iqUT`|qOB(P;? zv&9aq;qPPk`~E{P&ydcWi0MQ+=}^qe2?^|hVY5-^ zqxkn#lMaCwvO7hpV9z zicp0Mp$vUcfeWAjy|5O}hc&PcO3(wV;T-sDI2Tp|ZVbWR$u6)foD2uUNy*8{oMdj& z0v&K3{0)qP32+EZgf6`3?<`mjXTyi#-{8OD_rnL^*YE;71wVpk z;6?ZiJPkjASK)Pd4gLTx!|&iFcm;kBzlAs9dH4nV44#8u!q4HS@CN(}w!yRTV>lC* z!Kh@nWY=VuWOTB7vNUN=mL#VorzblnNrFu+`7^u&e}cE*Z5Wa4l#ERN2s7ch`%J(-a-B_}4clUd0z$+5}QWFE|igJ3)?N){&blX=OdunGPSJ_nzN zTi|l|Ap8^T0VlvTI1FaPENF$J;TV_#qv0gD7w&`H$|7zv`)yn_RYUNJyZPl}U z%!ACdUrc`eyrGxN{knW&?OtkB-)XA!g_xbA5_nRZu0yH-d5AEm!!9o*nfMS|(Q z7mDM*y-Qnxszw0wb)cxP<#Hv4yibd$s7*GpTI2+(-7=9+2tL&1h(z0Wy`gte1B(?` zP5E_L_8nCo5pY|p2viz5_>Rp>C3-fC3^)n`R;_*z?%wa^UT1gn9 zq}kEa9OB%7xJcV+0yogaJ&NYE@Lzr4S zgsb^3w!FK=l%($>9DN-PO&Y!WhDK^%k>kIH%HUb|$=G|`sy1cU+?hvlMWu0&a8mR-r0Cc?S6Nnh0C+_$3{^!@@B3B6WW_F(#g zQj#DY#4{!f#TrKMEH#OyL!F9SU8H0r0@pTCfsO21q;v*B5|@VPmP0F&#o`s*VbZE* zF+Ck{K!UY)OC|uI+fN|nnjK8N5f}o%!)99^JlFC1O*)^F~ z3j-q52(O5ztfF$P#JrMGNS*t%^qg3<&=3|HvAQ6Ykh#oUl%Kd$j$gJbLydca8ZTs7 z5jO);(*6r}#XLoI7*Z7uYTxCe_ddvdb0v9G`0{SM&EP!A47`}=zcE_Xf=n~NeE(F!V>iTvi zXkREOyb$hi{M%45*j`=VN`OGm=Hi7IZbTPG15nG934kLQm z6)GE95GxqQ(RnYi7)Rwd3&PvMDOz@as|S|zy!c$iz-1F9K4yrNI4q`Rw#U7iE}LlU znUyq!*y+3fT%?5D=_GnZljj!0vE1UDBoGF<-^aqz#pT7*OmCcN^jQI_Zq>~w9_}Qc zvkj67w-Rp{I(a7TF3%UCl9CBmvv=Q7k|EgaqzU$i_}VYdeTmwv;-sg?OepmZS900O z6C>m~pQ62?2!IZf-ozI8P=_7Zc?2n(9aX?{5GEy(#X`tImB^Wq$WasqO=8OuFr+{z zJuF-wo-npJrw~;B>tN#%PwdxBHR<3Az5`|K7=sHWF)luMQC-h`c;nsB&NT)O+4#5GVL-XvyA@WgPq%1$T0n=JFup_wKl0 zNc5m9ON^`f0Xss`Tk&2bCZXam6~#WzU^wn^4chRHoOAv|H)@$JMvmv83D@;Aa>OPh8?%i{545ndbM;GzF|LVAO&aW|Xs8ntWu_6)k6y{_mOi=Uvmh!^e|khb znJ-slAIIUrS;LaG#EA0`UC@tc2>r;nWYVv|ct0Q`zf_T}ZptU~K?@PDxEjIk7)4l{ zxxGY-Syw)g3sba2HUdi1>b`Zsm3A*KFqb=!k&Pj!a5EYqv)N-=vul}i`3Ud7MMSCp zv`(ph=4g)j<|c-KptLiKG}Cv@H!*SZ?Qo8h-LH^AWFbtj#gk7hZa!I8h*GlypQ9yxIjqL&=(;NV6)5zMyZNtoGu&o_s7AM6_9D_Ut~a8s)~41OR)QZL=JvqeRw)LbV4 zN6a_{P}611WJz52EUapVgv4G!1V_i^`x1i(GMn<$5v7*py2t;@%?+ArrO&y~|w*Au6f4aMszTm?8(!ZqJl zN<0Q%)#MVP#0d;-K*(4s6HkkdDV`oJ6-tx$Lo~{z!LBIOfx%5a<+@8p95Z$@tD%$;7+ zcVi5E155iy4DlT!y^?NQ5&C5FP~VId4i!#Z^?nN0`M$F3d;{OAN*yh1Ffny-Yp4iy zYo=$KAraGX-7ol~LvI2t;A^Z_9KM!niReMf$-jV{r@yl#gBH`CCTgATLWZ!=h}8ud z6k^UBzLGUA91hp}t+jL+B=BVe#?^)C=7(3zmm>i|*Ich)u>7Oao?76QuOkt<6zj+V zEm~JD7~uvIK}C&2h$(f~ErjqK=MXP1brCT<*HMJ>m`Nkh)UQpXsNG%l$V1>s5|r?tvS#>g{}=HZc8Tp=eWJu?@vtZ?$hcDdoXmd?II39#6K{IaC% z1QK@Y%@Rz5t`2t5ktnoC1SOTWDu^1ULY8uFz)&t^r@(N%W*W9O!M4(s2tz1YVxoE{ z^*ZyI><$Zg?wB=>J$3}ty~pP1y?#49bM^5v(0|2d=w0X_LvDz8?~v9mKz5Ye+XtO( z;sTyTX{R7tkvQ|zbKk5dW)g!ZVT4Pag(Atw#Nt>Uu67@?BiD`-)?KHnQfa1fj&L$p zi>wH8A~#sqa~Cwdx+`6ySrfRVTe%zA7G_&)_9c@lHqQ1m87UCE>D#KU+Vv>(y>T&) zTi>(yIwl!AIGb)pNKQ7)TkBeqX*O!D_%gdm!AXsbp*BE?n&qcN6)l#pNA@`)iP~# zVyBDOf4iUmHb4LEeg50}`0ac+=@ipN>UKrbs@c@}it)J%7G=r0#;-S2LA1y1YFAEK zMA7ekMdv-*2P>OzD<>n`Ftvzu({dx1&RRS;n|*7Kr6}9RO7lrg&4V$RiMc<;=_J&z z&zPRcrpK*|n~<*F_+w|xK57$2OKd)VBoZmekG-Fy%xqQN;Nt0$Y&1z|x zJ!8h~CVU|Orl)_moH#rEYxU@!%Xfl_qu)3kFD}FTuhhS3J;n0}*G}$AAMw5_yroV* zq`&iE%z|m9p29$3a+7B5kAL7rg?NLM`nMDQ%!BD$Qn}VN81@o>AfA>JkMm&CmJ#^7 zAKnWl{_R1HIvVyHvnvMT4T19CX#D^2&VA1)t-&&>_6|&%(s|6JrAwBbp7Pnx9{40u zA_#BVlYfoD|96&uQ5a0c8k}`tav$&fIQ#`KwlX>>3?h9aKwCWzuVoV<>vV{;Pa&l; zEkXuGjLb|EBEk<7|E2##TzHFP`XqivKsWxseXftgS6iB9&LFjAgsd%iRiVrckxE}} z=@AU_kJOfC9V}`KUVq2_iQ2MbYC%0EdkCgwm1WB1K$PIt~)|0mrF$Kd{ zCue3o+iL6!L`&_tT=Zg-q@5$BTQT>_Wt}8@sHZGjbrYDx@s2?}yb;lZXVwB}y=lA_ z#gIotkC2 zbq^PnoCe5=8|a@!d)+g`C8r5kP2G;ZF;H)(Al_a+yuffkt*)oNv_^3Ej^SDzV#ByC z{&Jm)_KpeR28M#+#NKBp?3{Mb4D`#B(e8Z-HaYwu&JR!%*+V^LJTuaU_VZ(=2TmAl z!#zf8z*aE^?ay)j2U!?AeW=Ik)VNcT7(%;^9#4R6oY}R@h z!*+(g#_LsJek0xo4(C{dy}kG$CT1FasH;RHBi<1VO>B|X+>?G3kR_!a^jI63%+bjK zLI&Az{jS{7+0lo3`kmMc*K~%b4!`E>vZ1@mvU@3=)@>;?y`;K^+^%rytuJ9pOXW)!_}r* z18=!v2W-v|*uzlP5%g1rMBkD5K6eQ8yx21XZz*DR>OCH8dHDkEJlG&w&nVpzsNKRN zU>-wMcRDbzhFfuLZ)U!OWR+PKwg_8)VGBQ#q!%I)s7Ihq~+wjIm-zuie2C zS7lIy#%+uBIZGHGx#@&K(ucY%4D>l-uklA+Ql#xD&%hdySOM>1xaqY* z430k3Wo2YnuA8Ij+lnXzt4Vd?1?IG3-{>qaUjCjvwzIt4kBP_6={KvG$&L33krF+d z$54$pPa@b0FZ*2O%D{>FzFSUjP5Tu=RM4fHs|*YLa;uJb}YoXD%<$X4Mtj2xJY zi1pFcG2~&|`DqP|Wit@JP!GPnP}guD&{&3^gNVyjmdFtqgaYTi?vUoJ_1a|E?Rj2w{@{P`aXg;oU^{zT=TLJW`0W}Is5kpm0Sp% zuinIR_Wc>2ebI1E%)pzm*kk_(jajxXFlLbSp{_n4g7^W7*i7z4rXZ|!=0*HRjc8xD zoC`7bmU1~o4Bg_K3q9s*_)ipFUk;rMEjIV~AVrgRPBW;6*N ze~9Ax@5pB0^r4>G8yijjCBrsXZ`1g*geW=I6*qZmhTA1pl zaEh=UHb(mOD>6KK19?uo$QiJ@>ma*oOO{Sl|915nTV`2Te;}t3Mh+w_Y$C zw>mI$7ptis3*ZKp8HN@6sv)rR+8rBl{?lN4uH~mC+jt)p+bOx);QFrnXTbEKp86Hr zm;0|MuDzVrFmj+*7T(m?*vLyN_n~L+9FpSKRfhvBqvBSM|22r| zSj#>sL7`Y8>cNf8gs)3+v+Jr^?2Y#iv6Ylh*jVWoFqm^ke=+Lw*s-WtzLlWb9|)p2jrSulTfab22W!2BHQ5I&bB;%`6D+rd zQT-iA!|ga`^X*~uytOJa7T)1UO}|T&uY_aoJYV$V>QOjvDF;Sj@#b-7964uR$KEf$ z92Z`Ro&*(+lF&GGWvflMO7#MydO}ba4aG9wBgta z=$0X|@gq~Y&|`1DUuWp%b8if=;kp&um%YzI#LeKoQU#Z#xRH%x23EtwxyNrXO#O|f zoHhnVqDhE%Kf}vDd&dCjLp^mU_J03O4<3HhjY6=8ym${VJpF|u2EiWc!He}r-}2(g zuR_SLsWC%`wdOp?ko7kO^Wnv25)Zj}*+=~FlYk7EKGc=Nk$1j_Be=P1Qlw>m+r_ov z8ZOUR{yxI+$QKpW7aM7ovdqq#zu$@A+6L1^)PozFA$~W6YgeYmb2+f@Elz1X8bTeu zx*S1&Y)JGSnd9FJq1&Jh=Xh)%;&Fzmzurk}(ssPZ2l7~WHhiDsRR`qPGUay&87O_I zr!L3dET8aVnlBl$2Fo7mL5|Ime&9vU>-88zeA0_}4zsH95{X*1};5T*P=e0lPIrn0U zZ)Usn3*|X$c;x;3w+^oO@_A0Y$XNc8gEvg8b&NN+y3-74T-ChG@g78Fo-9@};u+YPDbvwq~Kpu;Cn>YN3UB!Vx%TQXu>M7Y+ z|NEwc+Fcc^9rG(|%ennMBmM6mQ{3!R=3UOTt>HG?5-86DF?Zie@w(dQ_v9_b7|x$E zoQ2igJ3j$?ME!g_!&$VUP;RSMic3pt*X>BeKQqLIrCM>#fa9RsaGAyW*?0Vig|f%g z;cOFsVYuzZzEZ!uhs^`qu)VR}cu3TDW4qc#naWSNm2d&a1KX&zv6Ev-hN{QwrkuT8 z3~hvi*1QAJc5={Kb|BhF2W{pKMBCXxYt4xktDC!IXy~yiJQ%yymrDa@;H|!0Z5+1I zx)~dtc6Cq(*B5JT<-va3UFWckx5UW%?R-w7j-OX2W9$TIM4@EM*z%<@O1q=Cn0d zclYI}#y@;m?2RGs7e~%%b8NL>e}bI4lMauyfjP5S=Q|*T>38pJxPOY-J2r&91M~Pm zf|=ehv%~XvTnO`B$m4@T*m?6fFv5wOgT@og^qw2vfYWeYinZE<1DO6SZg|9rSUVwr zY-Mo6*2YG;Lo{Zo52u{H7mLxIPyHIUFf#L-sL|vb--7C3rKh7-J>QzTG>RCTj~$vJ zrW0yzT;q8em}Ls@mPsjAxA<~t88?%Q>f04XYg@2U`(kUfhdG$pn$Hfj^l%3i52AL6 zLr5I7VM`-3q$4zDisUY7HH;QnL7SYSowa=aK)KN0CO`Jejcd5>#NOPG~jff z7&SI?Yzm`#3~n^1V?9u_L2iC`dY~49_-^z-GYQ^~?}1tg+HmzivHo=y!NUo$SQF)) zdBgQIHu}$Y(T1abMtbxU3F5oa!=B{B8x9*Iz52;M%pKgr&Iw|AjBUIQMS9p%e8@Yz zhn*Wn^%&f64;!h$?;*%%Rn`wr8;#Vac|N@1uraWLCw9H(8_bq>XB1gL5Ql9P3Dnwy z(ZV*0SF840FXj!mkXWC-kYMfj5o-}a8?F&6HfLT;@ZOCc{Zt>`aI}ZWibH#fd3Lef I!~g&Q literal 0 HcmV?d00001 diff --git a/subVersion/d3d9/d3dx9anim.h b/subVersion/d3d9/d3dx9anim.h new file mode 100644 index 0000000..fedb1db --- /dev/null +++ b/subVersion/d3d9/d3dx9anim.h @@ -0,0 +1,1114 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9anim.h +// Content: D3DX mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX9ANIM_H__ +#define __D3DX9ANIM_H__ + +// {698CFB3F-9289-4d95-9A57-33A94B5A65F9} +DEFINE_GUID(IID_ID3DXAnimationSet, +0x698cfb3f, 0x9289, 0x4d95, 0x9a, 0x57, 0x33, 0xa9, 0x4b, 0x5a, 0x65, 0xf9); + +// {FA4E8E3A-9786-407d-8B4C-5995893764AF} +DEFINE_GUID(IID_ID3DXKeyframedAnimationSet, +0xfa4e8e3a, 0x9786, 0x407d, 0x8b, 0x4c, 0x59, 0x95, 0x89, 0x37, 0x64, 0xaf); + +// {6CC2480D-3808-4739-9F88-DE49FACD8D4C} +DEFINE_GUID(IID_ID3DXCompressedAnimationSet, +0x6cc2480d, 0x3808, 0x4739, 0x9f, 0x88, 0xde, 0x49, 0xfa, 0xcd, 0x8d, 0x4c); + +// {AC8948EC-F86D-43e2-96DE-31FC35F96D9E} +DEFINE_GUID(IID_ID3DXAnimationController, +0xac8948ec, 0xf86d, 0x43e2, 0x96, 0xde, 0x31, 0xfc, 0x35, 0xf9, 0x6d, 0x9e); + + +//---------------------------------------------------------------------------- +// D3DXMESHDATATYPE: +// ----------------- +// This enum defines the type of mesh data present in a MeshData structure. +//---------------------------------------------------------------------------- +typedef enum _D3DXMESHDATATYPE { + D3DXMESHTYPE_MESH = 0x001, // Normal ID3DXMesh data + D3DXMESHTYPE_PMESH = 0x002, // Progressive Mesh - ID3DXPMesh + D3DXMESHTYPE_PATCHMESH = 0x003, // Patch Mesh - ID3DXPatchMesh + + D3DXMESHTYPE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXMESHDATATYPE; + +//---------------------------------------------------------------------------- +// D3DXMESHDATA: +// ------------- +// This struct encapsulates a the mesh data that can be present in a mesh +// container. The supported mesh types are pMesh, pPMesh, pPatchMesh. +// The valid way to access this is determined by the Type enum. +//---------------------------------------------------------------------------- +typedef struct _D3DXMESHDATA +{ + D3DXMESHDATATYPE Type; + + // current mesh data interface + union + { + LPD3DXMESH pMesh; + LPD3DXPMESH pPMesh; + LPD3DXPATCHMESH pPatchMesh; + }; +} D3DXMESHDATA, *LPD3DXMESHDATA; + +//---------------------------------------------------------------------------- +// D3DXMESHCONTAINER: +// ------------------ +// This struct encapsulates a mesh object in a transformation frame +// hierarchy. The app can derive from this structure to add other app specific +// data to this. +//---------------------------------------------------------------------------- +typedef struct _D3DXMESHCONTAINER +{ + LPSTR Name; + + D3DXMESHDATA MeshData; + + LPD3DXMATERIAL pMaterials; + LPD3DXEFFECTINSTANCE pEffects; + DWORD NumMaterials; + DWORD *pAdjacency; + + LPD3DXSKININFO pSkinInfo; + + struct _D3DXMESHCONTAINER *pNextMeshContainer; +} D3DXMESHCONTAINER, *LPD3DXMESHCONTAINER; + +//---------------------------------------------------------------------------- +// D3DXFRAME: +// ---------- +// This struct is the encapsulates a transform frame in a transformation frame +// hierarchy. The app can derive from this structure to add other app specific +// data to this +//---------------------------------------------------------------------------- +typedef struct _D3DXFRAME +{ + LPSTR Name; + D3DXMATRIX TransformationMatrix; + + LPD3DXMESHCONTAINER pMeshContainer; + + struct _D3DXFRAME *pFrameSibling; + struct _D3DXFRAME *pFrameFirstChild; +} D3DXFRAME, *LPD3DXFRAME; + + +//---------------------------------------------------------------------------- +// ID3DXAllocateHierarchy: +// ----------------------- +// This interface is implemented by the application to allocate/free frame and +// mesh container objects. Methods on this are called during loading and +// destroying frame hierarchies +//---------------------------------------------------------------------------- +typedef interface ID3DXAllocateHierarchy ID3DXAllocateHierarchy; +typedef interface ID3DXAllocateHierarchy *LPD3DXALLOCATEHIERARCHY; + +#undef INTERFACE +#define INTERFACE ID3DXAllocateHierarchy + +DECLARE_INTERFACE(ID3DXAllocateHierarchy) +{ + // ID3DXAllocateHierarchy + + //------------------------------------------------------------------------ + // CreateFrame: + // ------------ + // Requests allocation of a frame object. + // + // Parameters: + // Name + // Name of the frame to be created + // ppNewFrame + // Returns the created frame object + // + //------------------------------------------------------------------------ + STDMETHOD(CreateFrame)(THIS_ LPCSTR Name, + LPD3DXFRAME *ppNewFrame) PURE; + + //------------------------------------------------------------------------ + // CreateMeshContainer: + // -------------------- + // Requests allocation of a mesh container object. + // + // Parameters: + // Name + // Name of the mesh + // pMesh + // Pointer to the mesh object if basic polygon data found + // pPMesh + // Pointer to the progressive mesh object if progressive mesh data found + // pPatchMesh + // Pointer to the patch mesh object if patch data found + // pMaterials + // Array of materials used in the mesh + // pEffectInstances + // Array of effect instances used in the mesh + // NumMaterials + // Num elements in the pMaterials array + // pAdjacency + // Adjacency array for the mesh + // pSkinInfo + // Pointer to the skininfo object if the mesh is skinned + // pBoneNames + // Array of names, one for each bone in the skinned mesh. + // The numberof bones can be found from the pSkinMesh object + // pBoneOffsetMatrices + // Array of matrices, one for each bone in the skinned mesh. + // + //------------------------------------------------------------------------ + STDMETHOD(CreateMeshContainer)(THIS_ + LPCSTR Name, + CONST D3DXMESHDATA *pMeshData, + CONST D3DXMATERIAL *pMaterials, + CONST D3DXEFFECTINSTANCE *pEffectInstances, + DWORD NumMaterials, + CONST DWORD *pAdjacency, + LPD3DXSKININFO pSkinInfo, + LPD3DXMESHCONTAINER *ppNewMeshContainer) PURE; + + //------------------------------------------------------------------------ + // DestroyFrame: + // ------------- + // Requests de-allocation of a frame object. + // + // Parameters: + // pFrameToFree + // Pointer to the frame to be de-allocated + // + //------------------------------------------------------------------------ + STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree) PURE; + + //------------------------------------------------------------------------ + // DestroyMeshContainer: + // --------------------- + // Requests de-allocation of a mesh container object. + // + // Parameters: + // pMeshContainerToFree + // Pointer to the mesh container object to be de-allocated + // + //------------------------------------------------------------------------ + STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree) PURE; +}; + +//---------------------------------------------------------------------------- +// ID3DXLoadUserData: +// ------------------ +// This interface is implemented by the application to load user data in a .X file +// When user data is found, these callbacks will be used to allow the application +// to load the data. +//---------------------------------------------------------------------------- +typedef interface ID3DXLoadUserData ID3DXLoadUserData; +typedef interface ID3DXLoadUserData *LPD3DXLOADUSERDATA; + +#undef INTERFACE +#define INTERFACE ID3DXLoadUserData + +DECLARE_INTERFACE(ID3DXLoadUserData) +{ + STDMETHOD(LoadTopLevelData)(LPD3DXFILEDATA pXofChildData) PURE; + + STDMETHOD(LoadFrameChildData)(LPD3DXFRAME pFrame, + LPD3DXFILEDATA pXofChildData) PURE; + + STDMETHOD(LoadMeshChildData)(LPD3DXMESHCONTAINER pMeshContainer, + LPD3DXFILEDATA pXofChildData) PURE; +}; + +//---------------------------------------------------------------------------- +// ID3DXSaveUserData: +// ------------------ +// This interface is implemented by the application to save user data in a .X file +// The callbacks are called for all data saved. The user can then add any +// child data objects to the object provided to the callback. +//---------------------------------------------------------------------------- +typedef interface ID3DXSaveUserData ID3DXSaveUserData; +typedef interface ID3DXSaveUserData *LPD3DXSAVEUSERDATA; + +#undef INTERFACE +#define INTERFACE ID3DXSaveUserData + +DECLARE_INTERFACE(ID3DXSaveUserData) +{ + STDMETHOD(AddFrameChildData)(CONST D3DXFRAME *pFrame, + LPD3DXFILESAVEOBJECT pXofSave, + LPD3DXFILESAVEDATA pXofFrameData) PURE; + + STDMETHOD(AddMeshChildData)(CONST D3DXMESHCONTAINER *pMeshContainer, + LPD3DXFILESAVEOBJECT pXofSave, + LPD3DXFILESAVEDATA pXofMeshData) PURE; + + // NOTE: this is called once per Save. All top level objects should be added using the + // provided interface. One call adds objects before the frame hierarchy, the other after + STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE; + STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE; + + // callbacks for the user to register and then save templates to the XFile + STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE; + STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXCALLBACK_SEARCH_FLAGS: +// -------------------------- +// Flags that can be passed into ID3DXAnimationSet::GetCallback. +//---------------------------------------------------------------------------- +typedef enum _D3DXCALLBACK_SEARCH_FLAGS +{ + D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, // exclude callbacks at the initial position from the search + D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, // reverse the callback search direction + + D3DXCALLBACK_SEARCH_FORCE_DWORD = 0x7fffffff, +} D3DXCALLBACK_SEARCH_FLAGS; + +//---------------------------------------------------------------------------- +// ID3DXAnimationSet: +// ------------------ +// This interface implements an animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationSet ID3DXAnimationSet; +typedef interface ID3DXAnimationSet *LPD3DXANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationSet + +DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer +}; + + +//---------------------------------------------------------------------------- +// D3DXPLAYBACK_TYPE: +// ------------------ +// This enum defines the type of animation set loop modes. +//---------------------------------------------------------------------------- +typedef enum _D3DXPLAYBACK_TYPE +{ + D3DXPLAY_LOOP = 0, + D3DXPLAY_ONCE = 1, + D3DXPLAY_PINGPONG = 2, + + D3DXPLAY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPLAYBACK_TYPE; + + +//---------------------------------------------------------------------------- +// D3DXKEY_VECTOR3: +// ---------------- +// This structure describes a vector key for use in keyframe animation. +// It specifies a vector Value at a given Time. This is used for scale and +// translation keys. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_VECTOR3 +{ + FLOAT Time; + D3DXVECTOR3 Value; +} D3DXKEY_VECTOR3, *LPD3DXKEY_VECTOR3; + + +//---------------------------------------------------------------------------- +// D3DXKEY_QUATERNION: +// ------------------- +// This structure describes a quaternion key for use in keyframe animation. +// It specifies a quaternion Value at a given Time. This is used for rotation +// keys. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_QUATERNION +{ + FLOAT Time; + D3DXQUATERNION Value; +} D3DXKEY_QUATERNION, *LPD3DXKEY_QUATERNION; + + +//---------------------------------------------------------------------------- +// D3DXKEY_CALLBACK: +// ----------------- +// This structure describes an callback key for use in keyframe animation. +// It specifies a pointer to user data at a given Time. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_CALLBACK +{ + FLOAT Time; + LPVOID pCallbackData; +} D3DXKEY_CALLBACK, *LPD3DXKEY_CALLBACK; + + +//---------------------------------------------------------------------------- +// D3DXCOMPRESSION_FLAGS: +// ---------------------- +// Flags that can be passed into ID3DXKeyframedAnimationSet::Compress. +//---------------------------------------------------------------------------- +typedef enum _D3DXCOMPRESSION_FLAGS +{ + D3DXCOMPRESS_DEFAULT = 0x00, + + D3DXCOMPRESS_FORCE_DWORD = 0x7fffffff, +} D3DXCOMPRESSION_FLAGS; + + +//---------------------------------------------------------------------------- +// ID3DXKeyframedAnimationSet: +// --------------------------- +// This interface implements a compressable keyframed animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet; +typedef interface ID3DXKeyframedAnimationSet *LPD3DXKEYFRAMEDANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXKeyframedAnimationSet + +DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) +{ + // ID3DXAnimationSet + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + + // Playback + STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; + STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; + + // Scale keys + STDMETHOD_(UINT, GetNumScaleKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetScaleKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pScaleKeys) PURE; + STDMETHOD(GetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; + STDMETHOD(SetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; + + // Rotation keys + STDMETHOD_(UINT, GetNumRotationKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetRotationKeys)(THIS_ UINT Animation, LPD3DXKEY_QUATERNION pRotationKeys) PURE; + STDMETHOD(GetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; + STDMETHOD(SetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; + + // Translation keys + STDMETHOD_(UINT, GetNumTranslationKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetTranslationKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pTranslationKeys) PURE; + STDMETHOD(GetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; + STDMETHOD(SetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; + + // Callback keys + STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; + STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; + STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; + STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; + + // Key removal methods. These are slow, and should not be used once the animation starts playing + STDMETHOD(UnregisterScaleKey)(THIS_ UINT Animation, UINT Key) PURE; + STDMETHOD(UnregisterRotationKey)(THIS_ UINT Animation, UINT Key) PURE; + STDMETHOD(UnregisterTranslationKey)(THIS_ UINT Animation, UINT Key) PURE; + + // One-time animaton SRT keyframe registration + STDMETHOD(RegisterAnimationSRTKeys)(THIS_ + LPCSTR pName, // Animation name + UINT NumScaleKeys, // Number of scale keys + UINT NumRotationKeys, // Number of rotation keys + UINT NumTranslationKeys, // Number of translation keys + CONST D3DXKEY_VECTOR3 *pScaleKeys, // Array of scale keys + CONST D3DXKEY_QUATERNION *pRotationKeys, // Array of rotation keys + CONST D3DXKEY_VECTOR3 *pTranslationKeys, // Array of translation keys + DWORD *pAnimationIndex) PURE; // Returns the animation index + + // Compression + STDMETHOD(Compress)(THIS_ + DWORD Flags, // Compression flags (use D3DXCOMPRESS_STRONG for better results) + FLOAT Lossiness, // Compression loss ratio in the [0, 1] range + LPD3DXFRAME pHierarchy, // Frame hierarchy (optional) + LPD3DXBUFFER *ppCompressedData) PURE; // Returns the compressed animation set + + STDMETHOD(UnregisterAnimation)(THIS_ UINT Index) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXCompressedAnimationSet: +// ---------------------------- +// This interface implements a compressed keyframed animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet; +typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXCompressedAnimationSet + +DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) +{ + // ID3DXAnimationSet + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + + // Playback + STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; + STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; + + // Scale keys + STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE; + + // Callback keys + STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; + STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXPRIORITY_TYPE: +// ------------------ +// This enum defines the type of priority group that a track can be assigned to. +//---------------------------------------------------------------------------- +typedef enum _D3DXPRIORITY_TYPE { + D3DXPRIORITY_LOW = 0, // This track should be blended with all low priority tracks before mixed with the high priority result + D3DXPRIORITY_HIGH = 1, // This track should be blended with all high priority tracks before mixed with the low priority result + + D3DXPRIORITY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPRIORITY_TYPE; + +//---------------------------------------------------------------------------- +// D3DXTRACK_DESC: +// --------------- +// This structure describes the mixing information of an animation track. +// The mixing information consists of the current position, speed, and blending +// weight for the track. The Flags field also specifies whether the track is +// low or high priority. Tracks with the same priority are blended together +// and then the two resulting values are blended using the priority blend factor. +// A track also has an animation set (stored separately) associated with it. +//---------------------------------------------------------------------------- +typedef struct _D3DXTRACK_DESC +{ + D3DXPRIORITY_TYPE Priority; + FLOAT Weight; + FLOAT Speed; + DOUBLE Position; + BOOL Enable; +} D3DXTRACK_DESC, *LPD3DXTRACK_DESC; + +//---------------------------------------------------------------------------- +// D3DXEVENT_TYPE: +// --------------- +// This enum defines the type of events keyable via the animation controller. +//---------------------------------------------------------------------------- +typedef enum _D3DXEVENT_TYPE +{ + D3DXEVENT_TRACKSPEED = 0, + D3DXEVENT_TRACKWEIGHT = 1, + D3DXEVENT_TRACKPOSITION = 2, + D3DXEVENT_TRACKENABLE = 3, + D3DXEVENT_PRIORITYBLEND = 4, + + D3DXEVENT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXEVENT_TYPE; + +//---------------------------------------------------------------------------- +// D3DXTRANSITION_TYPE: +// -------------------- +// This enum defines the type of transtion performed on a event that +// transitions from one value to another. +//---------------------------------------------------------------------------- +typedef enum _D3DXTRANSITION_TYPE { + D3DXTRANSITION_LINEAR = 0x000, // Linear transition from one value to the next + D3DXTRANSITION_EASEINEASEOUT = 0x001, // Ease-In Ease-Out spline transtion from one value to the next + + D3DXTRANSITION_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXTRANSITION_TYPE; + +//---------------------------------------------------------------------------- +// D3DXEVENT_DESC: +// --------------- +// This structure describes a animation controller event. +// It gives the event's type, track (if the event is a track event), global +// start time, duration, transition method, and target value. +//---------------------------------------------------------------------------- +typedef struct _D3DXEVENT_DESC +{ + D3DXEVENT_TYPE Type; + UINT Track; + DOUBLE StartTime; + DOUBLE Duration; + D3DXTRANSITION_TYPE Transition; + union + { + FLOAT Weight; + FLOAT Speed; + DOUBLE Position; + BOOL Enable; + }; +} D3DXEVENT_DESC, *LPD3DXEVENT_DESC; + +//---------------------------------------------------------------------------- +// D3DXEVENTHANDLE: +// ---------------- +// Handle values used to efficiently reference animation controller events. +//---------------------------------------------------------------------------- +typedef DWORD D3DXEVENTHANDLE; +typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE; + + +//---------------------------------------------------------------------------- +// ID3DXAnimationCallbackHandler: +// ------------------------------ +// This interface is intended to be implemented by the application, and can +// be used to handle callbacks in animation sets generated when +// ID3DXAnimationController::AdvanceTime() is called. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationCallbackHandler ID3DXAnimationCallbackHandler; +typedef interface ID3DXAnimationCallbackHandler *LPD3DXANIMATIONCALLBACKHANDLER; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationCallbackHandler + +DECLARE_INTERFACE(ID3DXAnimationCallbackHandler) +{ + //---------------------------------------------------------------------------- + // ID3DXAnimationCallbackHandler::HandleCallback: + // ---------------------------------------------- + // This method gets called when a callback occurs for an animation set in one + // of the tracks during the ID3DXAnimationController::AdvanceTime() call. + // + // Parameters: + // Track + // Index of the track on which the callback occured. + // pCallbackData + // Pointer to user owned callback data. + // + //---------------------------------------------------------------------------- + STDMETHOD(HandleCallback)(THIS_ UINT Track, LPVOID pCallbackData) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXAnimationController: +// ------------------------- +// This interface implements the main animation functionality. It connects +// animation sets with the transform frames that are being animated. Allows +// mixing multiple animations for blended animations or for transistions +// It adds also has methods to modify blending parameters over time to +// enable smooth transistions and other effects. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationController ID3DXAnimationController; +typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationController + +DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Max sizes + STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE; + + // Animation output registration + STDMETHOD(RegisterAnimationOutput)(THIS_ + LPCSTR pName, + D3DXMATRIX *pMatrix, + D3DXVECTOR3 *pScale, + D3DXQUATERNION *pRotation, + D3DXVECTOR3 *pTranslation) PURE; + + // Animation set registration + STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; + STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; + + STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE; + STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE; + STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE; + + // Global time + STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE; + STDMETHOD(ResetTime)(THIS) PURE; + STDMETHOD_(DOUBLE, GetTime)(THIS) PURE; + + // Tracks + STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE; + STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE; + + STDMETHOD(SetTrackPriority)(THIS_ UINT Track, D3DXPRIORITY_TYPE Priority) PURE; + + STDMETHOD(SetTrackSpeed)(THIS_ UINT Track, FLOAT Speed) PURE; + STDMETHOD(SetTrackWeight)(THIS_ UINT Track, FLOAT Weight) PURE; + STDMETHOD(SetTrackPosition)(THIS_ UINT Track, DOUBLE Position) PURE; + STDMETHOD(SetTrackEnable)(THIS_ UINT Track, BOOL Enable) PURE; + + STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; + STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; + + // Priority blending + STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE; + STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE; + + // Event keying + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackEnable)(THIS_ UINT Track, BOOL NewEnable, DOUBLE StartTime) PURE; + + STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + + // Event unkeying + STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE; + STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE; + + // Event enumeration + STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE; + STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE; + + STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT Track, D3DXEVENTHANDLE hEvent) PURE; + STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE; + + // Cloning + STDMETHOD(CloneAnimationController)(THIS_ + UINT MaxNumAnimationOutputs, + UINT MaxNumAnimationSets, + UINT MaxNumTracks, + UINT MaxNumEvents, + LPD3DXANIMATIONCONTROLLER *ppAnimController) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DXLoadMeshHierarchyFromX: +// --------------------------- +// Loads the first frame hierarchy in a .X file. +// +// Parameters: +// Filename +// Name of the .X file +// MeshOptions +// Mesh creation options for meshes in the file (see d3dx9mesh.h) +// pD3DDevice +// D3D9 device on which meshes in the file are created in +// pAlloc +// Allocation interface used to allocate nodes of the frame hierarchy +// pUserDataLoader +// Application provided interface to allow loading of user data +// ppFrameHierarchy +// Returns root node pointer of the loaded frame hierarchy +// ppAnimController +// Returns pointer to an animation controller corresponding to animation +// in the .X file. This is created with default max tracks and events +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXA + ( + LPCSTR Filename, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXW + ( + LPCWSTR Filename, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +#ifdef UNICODE +#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXW +#else +#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXA +#endif + +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXInMemory + ( + LPCVOID Memory, + DWORD SizeOfMemory, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +//---------------------------------------------------------------------------- +// D3DXSaveMeshHierarchyToFile: +// ---------------------------- +// Creates a .X file and saves the mesh hierarchy and corresponding animations +// in it +// +// Parameters: +// Filename +// Name of the .X file +// XFormat +// Format of the .X file (text or binary, compressed or not, etc) +// pFrameRoot +// Root node of the hierarchy to be saved +// pAnimController +// The animation controller whose animation sets are to be stored +// pUserDataSaver +// Application provided interface to allow adding of user data to +// data objects saved to .X file +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXSaveMeshHierarchyToFileA + ( + LPCSTR Filename, + DWORD XFormat, + CONST D3DXFRAME *pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimcontroller, + LPD3DXSAVEUSERDATA pUserDataSaver + ); + +HRESULT WINAPI +D3DXSaveMeshHierarchyToFileW + ( + LPCWSTR Filename, + DWORD XFormat, + CONST D3DXFRAME *pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimController, + LPD3DXSAVEUSERDATA pUserDataSaver + ); + +#ifdef UNICODE +#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileW +#else +#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileA +#endif + +//---------------------------------------------------------------------------- +// D3DXFrameDestroy: +// ----------------- +// Destroys the subtree of frames under the root, including the root +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pAlloc +// Allocation interface used to de-allocate nodes of the frame hierarchy +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameDestroy + ( + LPD3DXFRAME pFrameRoot, + LPD3DXALLOCATEHIERARCHY pAlloc + ); + +//---------------------------------------------------------------------------- +// D3DXFrameAppendChild: +// --------------------- +// Add a child frame to a frame +// +// Parameters: +// pFrameParent +// Pointer to the parent node +// pFrameChild +// Pointer to the child node +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameAppendChild + ( + LPD3DXFRAME pFrameParent, + CONST D3DXFRAME *pFrameChild + ); + +//---------------------------------------------------------------------------- +// D3DXFrameFind: +// -------------- +// Finds a frame with the given name. Returns NULL if no frame found. +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// Name +// Name of frame to find +// +//---------------------------------------------------------------------------- +LPD3DXFRAME WINAPI +D3DXFrameFind + ( + CONST D3DXFRAME *pFrameRoot, + LPCSTR Name + ); + +//---------------------------------------------------------------------------- +// D3DXFrameRegisterNamedMatrices: +// ------------------------------- +// Finds all frames that have non-null names and registers each of those frame +// matrices to the given animation controller +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pAnimController +// Pointer to the animation controller where the matrices are registered +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameRegisterNamedMatrices + ( + LPD3DXFRAME pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimController + ); + +//---------------------------------------------------------------------------- +// D3DXFrameNumNamedMatrices: +// -------------------------- +// Counts number of frames in a subtree that have non-null names +// +// Parameters: +// pFrameRoot +// Pointer to the root node of the subtree +// Return Value: +// Count of frames +// +//---------------------------------------------------------------------------- +UINT WINAPI +D3DXFrameNumNamedMatrices + ( + CONST D3DXFRAME *pFrameRoot + ); + +//---------------------------------------------------------------------------- +// D3DXFrameCalculateBoundingSphere: +// --------------------------------- +// Computes the bounding sphere of all the meshes in the frame hierarchy. +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pObjectCenter +// Returns the center of the bounding sphere +// pObjectRadius +// Returns the radius of the bounding sphere +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameCalculateBoundingSphere + ( + CONST D3DXFRAME *pFrameRoot, + LPD3DXVECTOR3 pObjectCenter, + FLOAT *pObjectRadius + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateKeyframedAnimationSet: +// -------------------------------- +// This function creates a compressable keyframed animations set interface. +// +// Parameters: +// pName +// Name of the animation set +// TicksPerSecond +// Number of keyframe ticks that elapse per second +// Playback +// Playback mode of keyframe looping +// NumAnimations +// Number of SRT animations +// NumCallbackKeys +// Number of callback keys +// pCallbackKeys +// Array of callback keys +// ppAnimationSet +// Returns the animation set interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateKeyframedAnimationSet + ( + LPCSTR pName, + DOUBLE TicksPerSecond, + D3DXPLAYBACK_TYPE Playback, + UINT NumAnimations, + UINT NumCallbackKeys, + CONST D3DXKEY_CALLBACK *pCallbackKeys, + LPD3DXKEYFRAMEDANIMATIONSET *ppAnimationSet + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateCompressedAnimationSet: +// -------------------------------- +// This function creates a compressed animations set interface from +// compressed data. +// +// Parameters: +// pName +// Name of the animation set +// TicksPerSecond +// Number of keyframe ticks that elapse per second +// Playback +// Playback mode of keyframe looping +// pCompressedData +// Compressed animation SRT data +// NumCallbackKeys +// Number of callback keys +// pCallbackKeys +// Array of callback keys +// ppAnimationSet +// Returns the animation set interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateCompressedAnimationSet + ( + LPCSTR pName, + DOUBLE TicksPerSecond, + D3DXPLAYBACK_TYPE Playback, + LPD3DXBUFFER pCompressedData, + UINT NumCallbackKeys, + CONST D3DXKEY_CALLBACK *pCallbackKeys, + LPD3DXCOMPRESSEDANIMATIONSET *ppAnimationSet + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateAnimationController: +// ------------------------------ +// This function creates an animation controller object. +// +// Parameters: +// MaxNumMatrices +// Maximum number of matrices that can be animated +// MaxNumAnimationSets +// Maximum number of animation sets that can be played +// MaxNumTracks +// Maximum number of animation sets that can be blended +// MaxNumEvents +// Maximum number of outstanding events that can be scheduled at any given time +// ppAnimController +// Returns the animation controller interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateAnimationController + ( + UINT MaxNumMatrices, + UINT MaxNumAnimationSets, + UINT MaxNumTracks, + UINT MaxNumEvents, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9ANIM_H__ + + diff --git a/subVersion/d3d9/d3dx9core.h b/subVersion/d3d9/d3dx9core.h new file mode 100644 index 0000000..45243f4 --- /dev/null +++ b/subVersion/d3d9/d3dx9core.h @@ -0,0 +1,753 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9core.h +// Content: D3DX core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9CORE_H__ +#define __D3DX9CORE_H__ + + +/////////////////////////////////////////////////////////////////////////// +// D3DX_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DXCheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DXCheckVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + +#define D3DX_VERSION 0x0902 + +#define D3DX_SDK_VERSION 43 + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +BOOL WINAPI + D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// D3DXDebugMute +// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute) +// +// returns previous mute value +// +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +BOOL WINAPI + D3DXDebugMute(BOOL Mute); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +/////////////////////////////////////////////////////////////////////////// +// D3DXGetDriverLevel: +// Returns driver version information: +// +// 700 - DX7 level driver +// 800 - DX8 level driver +// 900 - DX9 level driver +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +UINT WINAPI + D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXBuffer: +// ------------ +// The buffer object is used by D3DX to return arbitrary size data. +// +// GetBufferPointer - +// Returns a pointer to the beginning of the buffer. +// +// GetBufferSize - +// Returns the size of the buffer, in bytes. +/////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXBuffer ID3DXBuffer; +typedef interface ID3DXBuffer *LPD3DXBUFFER; + +// {8BA5FB08-5195-40e2-AC58-0D989C3A0102} +DEFINE_GUID(IID_ID3DXBuffer, +0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + +#undef INTERFACE +#define INTERFACE ID3DXBuffer + +DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBuffer + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; +}; + + + +////////////////////////////////////////////////////////////////////////////// +// D3DXSPRITE flags: +// ----------------- +// D3DXSPRITE_DONOTSAVESTATE +// Specifies device state is not to be saved and restored in Begin/End. +// D3DXSPRITE_DONOTMODIFY_RENDERSTATE +// Specifies device render state is not to be changed in Begin. The device +// is assumed to be in a valid state to draw vertices containing POSITION0, +// TEXCOORD0, and COLOR0 data. +// D3DXSPRITE_OBJECTSPACE +// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The +// transforms currently set to the device are used to transform the sprites +// when the batch is drawn (at Flush or End). If this is not specified, +// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are +// drawn in screenspace coordinates. +// D3DXSPRITE_BILLBOARD +// Rotates each sprite about its center so that it is facing the viewer. +// D3DXSPRITE_ALPHABLEND +// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0). +// ID3DXFont expects this to be set when drawing text. +// D3DXSPRITE_SORT_TEXTURE +// Sprites are sorted by texture prior to drawing. This is recommended when +// drawing non-overlapping sprites of uniform depth. For example, drawing +// screen-aligned text with ID3DXFont. +// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK +// Sprites are sorted by depth front-to-back prior to drawing. This is +// recommended when drawing opaque sprites of varying depths. +// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT +// Sprites are sorted by depth back-to-front prior to drawing. This is +// recommended when drawing transparent sprites of varying depths. +// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE +// Disables calling AddRef() on every draw, and Release() on Flush() for +// better performance. +////////////////////////////////////////////////////////////////////////////// + +#define D3DXSPRITE_DONOTSAVESTATE (1 << 0) +#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1) +#define D3DXSPRITE_OBJECTSPACE (1 << 2) +#define D3DXSPRITE_BILLBOARD (1 << 3) +#define D3DXSPRITE_ALPHABLEND (1 << 4) +#define D3DXSPRITE_SORT_TEXTURE (1 << 5) +#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6) +#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7) +#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8) + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXSprite: +// ------------ +// This object intends to provide an easy way to drawing sprites using D3D. +// +// Begin - +// Prepares device for drawing sprites. +// +// Draw - +// Draws a sprite. Before transformation, the sprite is the size of +// SrcRect, with its top-left corner specified by Position. The color +// and alpha channels are modulated by Color. +// +// Flush - +// Forces all batched sprites to submitted to the device. +// +// End - +// Restores device state to how it was when Begin was called. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXSprite ID3DXSprite; +typedef interface ID3DXSprite *LPD3DXSPRITE; + + +// {BA0B762D-7D28-43ec-B9DC-2F84443B0614} +DEFINE_GUID(IID_ID3DXSprite, +0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14); + + +#undef INTERFACE +#define INTERFACE ID3DXSprite + +DECLARE_INTERFACE_(ID3DXSprite, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXSprite + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + + STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE; + STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE; + + STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; + STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; + + STDMETHOD(Begin)(THIS_ DWORD Flags) PURE; + STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE; + STDMETHOD(Flush)(THIS) PURE; + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateSprite( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXSPRITE* ppSprite); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFont: +// ---------- +// Font objects contain the textures and resources needed to render a specific +// font on a specific device. +// +// GetGlyphData - +// Returns glyph cache data, for a given glyph. +// +// PreloadCharacters/PreloadGlyphs/PreloadText - +// Preloads glyphs into the glyph cache textures. +// +// DrawText - +// Draws formatted text on a D3D device. Some parameters are +// surprisingly similar to those of GDI's DrawText function. See GDI +// documentation for a detailed description of these parameters. +// If pSprite is NULL, an internal sprite object will be used. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +////////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXFONT_DESCA +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + CHAR FaceName[LF_FACESIZE]; + +} D3DXFONT_DESCA, *LPD3DXFONT_DESCA; + +typedef struct _D3DXFONT_DESCW +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + WCHAR FaceName[LF_FACESIZE]; + +} D3DXFONT_DESCW, *LPD3DXFONT_DESCW; + +#ifdef UNICODE +typedef D3DXFONT_DESCW D3DXFONT_DESC; +typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC; +#else +typedef D3DXFONT_DESCA D3DXFONT_DESC; +typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC; +#endif + + +typedef interface ID3DXFont ID3DXFont; +typedef interface ID3DXFont *LPD3DXFONT; + + +// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC} +DEFINE_GUID(IID_ID3DXFont, +0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); + + +#undef INTERFACE +#define INTERFACE ID3DXFont + +DECLARE_INTERFACE_(ID3DXFont, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXFont + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; + STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE; + STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE; + STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; + STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE; + + STDMETHOD_(HDC, GetDC)(THIS) PURE; + STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE; + + STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE; + STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE; + + STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; + STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; + +#ifdef __cplusplus +#ifdef UNICODE + HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); } + HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); } +#else + HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); } + HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); } +#endif +#endif //__cplusplus +}; + +#ifndef GetTextMetrics +#ifdef UNICODE +#define GetTextMetrics GetTextMetricsW +#else +#define GetTextMetrics GetTextMetricsA +#endif +#endif + +#ifndef DrawText +#ifdef UNICODE +#define DrawText DrawTextW +#else +#define DrawText DrawTextA +#endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateFontA( + LPDIRECT3DDEVICE9 pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + DWORD CharSet, + DWORD OutputPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCSTR pFaceName, + LPD3DXFONT* ppFont); + +HRESULT WINAPI + D3DXCreateFontW( + LPDIRECT3DDEVICE9 pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + DWORD CharSet, + DWORD OutputPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCWSTR pFaceName, + LPD3DXFONT* ppFont); + +#ifdef UNICODE +#define D3DXCreateFont D3DXCreateFontW +#else +#define D3DXCreateFont D3DXCreateFontA +#endif + + +HRESULT WINAPI + D3DXCreateFontIndirectA( + LPDIRECT3DDEVICE9 pDevice, + CONST D3DXFONT_DESCA* pDesc, + LPD3DXFONT* ppFont); + +HRESULT WINAPI + D3DXCreateFontIndirectW( + LPDIRECT3DDEVICE9 pDevice, + CONST D3DXFONT_DESCW* pDesc, + LPD3DXFONT* ppFont); + +#ifdef UNICODE +#define D3DXCreateFontIndirect D3DXCreateFontIndirectW +#else +#define D3DXCreateFontIndirect D3DXCreateFontIndirectA +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXRenderToSurface: +// --------------------- +// This object abstracts rendering to surfaces. These surfaces do not +// necessarily need to be render targets. If they are not, a compatible +// render target is used, and the result copied into surface at end scene. +// +// BeginScene, EndScene - +// Call BeginScene() and EndScene() at the beginning and ending of your +// scene. These calls will setup and restore render targets, viewports, +// etc.. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXRTS_DESC +{ + UINT Width; + UINT Height; + D3DFORMAT Format; + BOOL DepthStencil; + D3DFORMAT DepthStencilFormat; + +} D3DXRTS_DESC, *LPD3DXRTS_DESC; + + +typedef interface ID3DXRenderToSurface ID3DXRenderToSurface; +typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE; + + +// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894} +DEFINE_GUID(IID_ID3DXRenderToSurface, +0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94); + + +#undef INTERFACE +#define INTERFACE ID3DXRenderToSurface + +DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXRenderToSurface + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE; + + STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateRenderToSurface( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + D3DFORMAT Format, + BOOL DepthStencil, + D3DFORMAT DepthStencilFormat, + LPD3DXRENDERTOSURFACE* ppRenderToSurface); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXRenderToEnvMap: +// -------------------- +// This object abstracts rendering to environment maps. These surfaces +// do not necessarily need to be render targets. If they are not, a +// compatible render target is used, and the result copied into the +// environment map at end scene. +// +// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic - +// This function initiates the rendering of the environment map. As +// parameters, you pass the textures in which will get filled in with +// the resulting environment map. +// +// Face - +// Call this function to initiate the drawing of each face. For each +// environment map, you will call this six times.. once for each face +// in D3DCUBEMAP_FACES. +// +// End - +// This will restore all render targets, and if needed compose all the +// rendered faces into the environment map surfaces. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXRTE_DESC +{ + UINT Size; + UINT MipLevels; + D3DFORMAT Format; + BOOL DepthStencil; + D3DFORMAT DepthStencilFormat; + +} D3DXRTE_DESC, *LPD3DXRTE_DESC; + + +typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap; +typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap; + + +// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E} +DEFINE_GUID(IID_ID3DXRenderToEnvMap, +0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e); + + +#undef INTERFACE +#define INTERFACE ID3DXRenderToEnvMap + +DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXRenderToEnvMap + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE; + + STDMETHOD(BeginCube)(THIS_ + LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE; + + STDMETHOD(BeginSphere)(THIS_ + LPDIRECT3DTEXTURE9 pTex) PURE; + + STDMETHOD(BeginHemisphere)(THIS_ + LPDIRECT3DTEXTURE9 pTexZPos, + LPDIRECT3DTEXTURE9 pTexZNeg) PURE; + + STDMETHOD(BeginParabolic)(THIS_ + LPDIRECT3DTEXTURE9 pTexZPos, + LPDIRECT3DTEXTURE9 pTexZNeg) PURE; + + STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE; + STDMETHOD(End)(THIS_ DWORD MipFilter) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateRenderToEnvMap( + LPDIRECT3DDEVICE9 pDevice, + UINT Size, + UINT MipLevels, + D3DFORMAT Format, + BOOL DepthStencil, + D3DFORMAT DepthStencilFormat, + LPD3DXRenderToEnvMap* ppRenderToEnvMap); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXLine: +// ------------ +// This object intends to provide an easy way to draw lines using D3D. +// +// Begin - +// Prepares device for drawing lines +// +// Draw - +// Draws a line strip in screen-space. +// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2 +// +// DrawTransform - +// Draws a line in screen-space with a specified input transformation matrix. +// +// End - +// Restores device state to how it was when Begin was called. +// +// SetPattern - +// Applies a stipple pattern to the line. Input is one 32-bit +// DWORD which describes the stipple pattern. 1 is opaque, 0 is +// transparent. +// +// SetPatternScale - +// Stretches the stipple pattern in the u direction. Input is one +// floating-point value. 0.0f is no scaling, whereas 1.0f doubles +// the length of the stipple pattern. +// +// SetWidth - +// Specifies the thickness of the line in the v direction. Input is +// one floating-point value. +// +// SetAntialias - +// Toggles line antialiasing. Input is a BOOL. +// TRUE = Antialiasing on. +// FALSE = Antialiasing off. +// +// SetGLLines - +// Toggles non-antialiased OpenGL line emulation. Input is a BOOL. +// TRUE = OpenGL line emulation on. +// FALSE = OpenGL line emulation off. +// +// OpenGL line: Regular line: +// *\ *\ +// | \ / \ +// | \ *\ \ +// *\ \ \ \ +// \ \ \ \ +// \ * \ * +// \ | \ / +// \| * +// * +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + + +typedef interface ID3DXLine ID3DXLine; +typedef interface ID3DXLine *LPD3DXLINE; + + +// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8} +DEFINE_GUID(IID_ID3DXLine, +0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8); + +#undef INTERFACE +#define INTERFACE ID3DXLine + +DECLARE_INTERFACE_(ID3DXLine, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXLine + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + + STDMETHOD(Begin)(THIS) PURE; + + STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList, + DWORD dwVertexListCount, D3DCOLOR Color) PURE; + + STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList, + DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform, + D3DCOLOR Color) PURE; + + STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE; + STDMETHOD_(DWORD, GetPattern)(THIS) PURE; + + STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE; + STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE; + + STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE; + STDMETHOD_(FLOAT, GetWidth)(THIS) PURE; + + STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE; + STDMETHOD_(BOOL, GetAntialias)(THIS) PURE; + + STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE; + STDMETHOD_(BOOL, GetGLLines)(THIS) PURE; + + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateLine( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXLINE* ppLine); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9CORE_H__ + diff --git a/subVersion/d3d9/d3dx9effect.h b/subVersion/d3d9/d3dx9effect.h new file mode 100644 index 0000000..a3bcd30 --- /dev/null +++ b/subVersion/d3d9/d3dx9effect.h @@ -0,0 +1,873 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: d3dx9effect.h +// Content: D3DX effect types and Shaders +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9EFFECT_H__ +#define __D3DX9EFFECT_H__ + + +//---------------------------------------------------------------------------- +// D3DXFX_DONOTSAVESTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, device state is not saved or restored in Begin/End. +// D3DXFX_DONOTSAVESHADERSTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, shader device state is not saved or restored in Begin/End. +// This includes pixel/vertex shaders and shader constants +// D3DXFX_DONOTSAVESAMPLERSTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, sampler device state is not saved or restored in Begin/End. +// D3DXFX_NOT_CLONEABLE +// This flag is used as a parameter to the D3DXCreateEffect family of APIs. +// When this flag is specified, the effect will be non-cloneable and will not +// contain any shader binary data. +// Furthermore, GetPassDesc will not return shader function pointers. +// Setting this flag reduces effect memory usage by about 50%. +//---------------------------------------------------------------------------- + +#define D3DXFX_DONOTSAVESTATE (1 << 0) +#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1) +#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2) + +#define D3DXFX_NOT_CLONEABLE (1 << 11) +#define D3DXFX_LARGEADDRESSAWARE (1 << 17) + +//---------------------------------------------------------------------------- +// D3DX_PARAMETER_SHARED +// Indicates that the value of a parameter will be shared with all effects +// which share the same namespace. Changing the value in one effect will +// change it in all. +// +// D3DX_PARAMETER_LITERAL +// Indicates that the value of this parameter can be treated as literal. +// Literal parameters can be marked when the effect is compiled, and their +// cannot be changed after the effect is compiled. Shared parameters cannot +// be literal. +//---------------------------------------------------------------------------- + +#define D3DX_PARAMETER_SHARED (1 << 0) +#define D3DX_PARAMETER_LITERAL (1 << 1) +#define D3DX_PARAMETER_ANNOTATION (1 << 2) + +//---------------------------------------------------------------------------- +// D3DXEFFECT_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXEFFECT_DESC +{ + LPCSTR Creator; // Creator string + UINT Parameters; // Number of parameters + UINT Techniques; // Number of techniques + UINT Functions; // Number of function entrypoints + +} D3DXEFFECT_DESC; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXPARAMETER_DESC +{ + LPCSTR Name; // Parameter name + LPCSTR Semantic; // Parameter semantic + D3DXPARAMETER_CLASS Class; // Class + D3DXPARAMETER_TYPE Type; // Component type + UINT Rows; // Number of rows + UINT Columns; // Number of columns + UINT Elements; // Number of array elements + UINT Annotations; // Number of annotations + UINT StructMembers; // Number of structure member sub-parameters + DWORD Flags; // D3DX_PARAMETER_* flags + UINT Bytes; // Parameter size, in bytes + +} D3DXPARAMETER_DESC; + + +//---------------------------------------------------------------------------- +// D3DXTECHNIQUE_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXTECHNIQUE_DESC +{ + LPCSTR Name; // Technique name + UINT Passes; // Number of passes + UINT Annotations; // Number of annotations + +} D3DXTECHNIQUE_DESC; + + +//---------------------------------------------------------------------------- +// D3DXPASS_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXPASS_DESC +{ + LPCSTR Name; // Pass name + UINT Annotations; // Number of annotations + + CONST DWORD *pVertexShaderFunction; // Vertex shader function + CONST DWORD *pPixelShaderFunction; // Pixel shader function + +} D3DXPASS_DESC; + + +//---------------------------------------------------------------------------- +// D3DXFUNCTION_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXFUNCTION_DESC +{ + LPCSTR Name; // Function name + UINT Annotations; // Number of annotations + +} D3DXFUNCTION_DESC; + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffectPool /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffectPool ID3DXEffectPool; +typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL; + +// {9537AB04-3250-412e-8213-FCD2F8677933} +DEFINE_GUID(IID_ID3DXEffectPool, +0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33); + + +#undef INTERFACE +#define INTERFACE ID3DXEffectPool + +DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // No public methods +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXBaseEffect /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXBaseEffect ID3DXBaseEffect; +typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT; + +// {017C18AC-103F-4417-8C51-6BF6EF1E56BE} +DEFINE_GUID(IID_ID3DXBaseEffect, +0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe); + + +#undef INTERFACE +#define INTERFACE ID3DXBaseEffect + +DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Useful for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + +}; + + +//---------------------------------------------------------------------------- +// ID3DXEffectStateManager: +// ------------------------ +// This is a user implemented interface that can be used to manage device +// state changes made by an Effect. +//---------------------------------------------------------------------------- + +typedef interface ID3DXEffectStateManager ID3DXEffectStateManager; +typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER; + +// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE} +DEFINE_GUID(IID_ID3DXEffectStateManager, +0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce); + +#undef INTERFACE +#define INTERFACE ID3DXEffectStateManager + +DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) +{ + // The user must correctly implement QueryInterface, AddRef, and Release. + + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // The following methods are called by the Effect when it wants to make + // the corresponding device call. Note that: + // 1. Users manage the state and are therefore responsible for making the + // the corresponding device calls themselves inside their callbacks. + // 2. Effects pay attention to the return values of the callbacks, and so + // users must pay attention to what they return in their callbacks. + + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE; + STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffect /////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffect ID3DXEffect; +typedef interface ID3DXEffect *LPD3DXEFFECT; + +// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5} +DEFINE_GUID(IID_ID3DXEffect, +0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5); + +#undef INTERFACE +#define INTERFACE ID3DXEffect + +DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) +{ + // ID3DXBaseEffect + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Usefull for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + // ID3DXBaseEffect + + + // Pool + STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE; + + // Selecting and setting a technique + STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; + STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE; + STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; + STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE; + STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE; + + // Using current technique + // Begin starts active technique + // BeginPass begins a pass + // CommitChanges updates changes to any set calls in the pass. This should be called before + // any DrawPrimitive call to d3d + // EndPass ends a pass + // End ends active technique + STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE; + STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE; + STDMETHOD(CommitChanges)(THIS) PURE; + STDMETHOD(EndPass)(THIS) PURE; + STDMETHOD(End)(THIS) PURE; + + // Managing D3D Device + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; + + // Logging device calls + STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE; + STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE; + + // Parameter blocks + STDMETHOD(BeginParameterBlock)(THIS) PURE; + STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE; + STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; + STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; + + // Cloning + STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE; + + // Fast path for setting variables directly in ID3DXEffect + STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffectCompiler /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffectCompiler ID3DXEffectCompiler; +typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER; + +// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0} +DEFINE_GUID(IID_ID3DXEffectCompiler, +0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0); + + +#undef INTERFACE +#define INTERFACE ID3DXEffectCompiler + +DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) +{ + // ID3DXBaseEffect + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Usefull for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + // ID3DXBaseEffect + + // Parameter sharing, specialization, and information + STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE; + STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE; + + // Compilation + STDMETHOD(CompileEffect)(THIS_ DWORD Flags, + LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE; + + STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags, + LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3DXCreateEffectPool: +// --------------------- +// Creates an effect pool. Pools are used for sharing parameters between +// multiple effects. For all effects within a pool, shared parameters of the +// same name all share the same value. +// +// Parameters: +// ppPool +// Returns the created pool. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectPool( + LPD3DXEFFECTPOOL* ppPool); + + +//---------------------------------------------------------------------------- +// D3DXCreateEffect: +// ----------------- +// Creates an effect from an ascii or binary effect description. +// +// Parameters: +// pDevice +// Pointer of the device on which to create the effect +// pSrcFile +// Name of the file containing the effect description +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to effect description +// SrcDataSize +// Size of the effect description in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// Flags +// See D3DXSHADER_xxx flags. +// pSkipConstants +// A list of semi-colon delimited variable names. The effect will +// not set these variables to the device when they are referenced +// by a shader. NOTE: the variables specified here must be +// register bound in the file and must not be used in expressions +// in passes or samplers or the file will not load. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pPool +// Pointer to ID3DXEffectPool object to use for shared parameters. +// If NULL, no parameters will be shared. +// ppEffect +// Returns a buffer containing created effect. +// ppCompilationErrors +// Returns a buffer containing any error messages which occurred during +// compile. Or NULL if you do not care about the error messages. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW +#else +#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateEffectFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW +#else +#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateEffect( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +// +// Ex functions that accept pSkipConstants in addition to other parameters +// + +HRESULT WINAPI + D3DXCreateEffectFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW +#else +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateEffectFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW +#else +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateEffectEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +//---------------------------------------------------------------------------- +// D3DXCreateEffectCompiler: +// ------------------------- +// Creates an effect from an ascii or binary effect description. +// +// Parameters: +// pSrcFile +// Name of the file containing the effect description +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to effect description +// SrcDataSize +// Size of the effect description in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pPool +// Pointer to ID3DXEffectPool object to use for shared parameters. +// If NULL, no parameters will be shared. +// ppCompiler +// Returns a buffer containing created effect compiler. +// ppParseErrors +// Returns a buffer containing any error messages which occurred during +// parse. Or NULL if you do not care about the error messages. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectCompilerFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +HRESULT WINAPI + D3DXCreateEffectCompilerFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +#ifdef UNICODE +#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW +#else +#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateEffectCompilerFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +HRESULT WINAPI + D3DXCreateEffectCompilerFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +#ifdef UNICODE +#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW +#else +#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateEffectCompiler( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +//---------------------------------------------------------------------------- +// D3DXDisassembleEffect: +// ----------------------- +// +// Parameters: +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXDisassembleEffect( + LPD3DXEFFECT pEffect, + BOOL EnableColorCode, + LPD3DXBUFFER *ppDisassembly); + + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9EFFECT_H__ + + diff --git a/subVersion/d3d9/d3dx9math.h b/subVersion/d3d9/d3dx9math.h new file mode 100644 index 0000000..3fda053 --- /dev/null +++ b/subVersion/d3d9/d3dx9math.h @@ -0,0 +1,1796 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9math.h +// Content: D3DX math types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9MATH_H__ +#define __D3DX9MATH_H__ + +#include +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning + + + +//=========================================================================== +// +// General purpose utilities +// +//=========================================================================== +#define D3DX_PI ((FLOAT) 3.141592654f) +#define D3DX_1BYPI ((FLOAT) 0.318309886f) + +#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) +#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) + + + +//=========================================================================== +// +// 16 bit floating point numbers +// +//=========================================================================== + +#define D3DX_16F_DIG 3 // # of decimal digits of precision +#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0 +#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa +#define D3DX_16F_MAX 6.550400e+004 // max value +#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent +#define D3DX_16F_MAX_EXP 15 // max binary exponent +#define D3DX_16F_MIN 6.1035156e-5f // min positive value +#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent +#define D3DX_16F_MIN_EXP (-14) // min binary exponent +#define D3DX_16F_RADIX 2 // exponent radix +#define D3DX_16F_ROUNDS 1 // addition rounding: near + + +typedef struct D3DXFLOAT16 +{ +#ifdef __cplusplus +public: + D3DXFLOAT16() {}; + D3DXFLOAT16( FLOAT ); + D3DXFLOAT16( CONST D3DXFLOAT16& ); + + // casting + operator FLOAT (); + + // binary operators + BOOL operator == ( CONST D3DXFLOAT16& ) const; + BOOL operator != ( CONST D3DXFLOAT16& ) const; + +protected: +#endif //__cplusplus + WORD value; +} D3DXFLOAT16, *LPD3DXFLOAT16; + + + +//=========================================================================== +// +// Vectors +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- +typedef struct D3DXVECTOR2 +{ +#ifdef __cplusplus +public: + D3DXVECTOR2() {}; + D3DXVECTOR2( CONST FLOAT * ); + D3DXVECTOR2( CONST D3DXFLOAT16 * ); + D3DXVECTOR2( FLOAT x, FLOAT y ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator *= ( FLOAT ); + D3DXVECTOR2& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR2 operator + () const; + D3DXVECTOR2 operator - () const; + + // binary operators + D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator * ( FLOAT ) const; + D3DXVECTOR2 operator / ( FLOAT ) const; + + friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); + + BOOL operator == ( CONST D3DXVECTOR2& ) const; + BOOL operator != ( CONST D3DXVECTOR2& ) const; + + +public: +#endif //__cplusplus + FLOAT x, y; +} D3DXVECTOR2, *LPD3DXVECTOR2; + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +typedef struct D3DXVECTOR2_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR2_16F() {}; + D3DXVECTOR2_16F( CONST FLOAT * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR2_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR2_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y; + +} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F; + + + +//-------------------------- +// 3D Vector +//-------------------------- +#ifdef __cplusplus +typedef struct D3DXVECTOR3 : public D3DVECTOR +{ +public: + D3DXVECTOR3() {}; + D3DXVECTOR3( CONST FLOAT * ); + D3DXVECTOR3( CONST D3DVECTOR& ); + D3DXVECTOR3( CONST D3DXFLOAT16 * ); + D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator *= ( FLOAT ); + D3DXVECTOR3& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR3 operator + () const; + D3DXVECTOR3 operator - () const; + + // binary operators + D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator * ( FLOAT ) const; + D3DXVECTOR3 operator / ( FLOAT ) const; + + friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); + + BOOL operator == ( CONST D3DXVECTOR3& ) const; + BOOL operator != ( CONST D3DXVECTOR3& ) const; + +} D3DXVECTOR3, *LPD3DXVECTOR3; + +#else //!__cplusplus +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; +#endif //!__cplusplus + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR3_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR3_16F() {}; + D3DXVECTOR3_16F( CONST FLOAT * ); + D3DXVECTOR3_16F( CONST D3DVECTOR& ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR3_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR3_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z; + +} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F; + + + +//-------------------------- +// 4D Vector +//-------------------------- +typedef struct D3DXVECTOR4 +{ +#ifdef __cplusplus +public: + D3DXVECTOR4() {}; + D3DXVECTOR4( CONST FLOAT* ); + D3DXVECTOR4( CONST D3DXFLOAT16* ); + D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w ); + D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator *= ( FLOAT ); + D3DXVECTOR4& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR4 operator + () const; + D3DXVECTOR4 operator - () const; + + // binary operators + D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator * ( FLOAT ) const; + D3DXVECTOR4 operator / ( FLOAT ) const; + + friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); + + BOOL operator == ( CONST D3DXVECTOR4& ) const; + BOOL operator != ( CONST D3DXVECTOR4& ) const; + +public: +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXVECTOR4, *LPD3DXVECTOR4; + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR4_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR4_16F() {}; + D3DXVECTOR4_16F( CONST FLOAT * ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16* ); + D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR4_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR4_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z, w; + +} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F; + + + +//=========================================================================== +// +// Matrices +// +//=========================================================================== +#ifdef __cplusplus +typedef struct D3DXMATRIX : public D3DMATRIX +{ +public: + D3DXMATRIX() {}; + D3DXMATRIX( CONST FLOAT * ); + D3DXMATRIX( CONST D3DMATRIX& ); + D3DXMATRIX( CONST D3DXFLOAT16 * ); + D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + + // access grants + FLOAT& operator () ( UINT Row, UINT Col ); + FLOAT operator () ( UINT Row, UINT Col ) const; + + // casting operators + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator *= ( FLOAT ); + D3DXMATRIX& operator /= ( FLOAT ); + + // unary operators + D3DXMATRIX operator + () const; + D3DXMATRIX operator - () const; + + // binary operators + D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator * ( FLOAT ) const; + D3DXMATRIX operator / ( FLOAT ) const; + + friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); + + BOOL operator == ( CONST D3DXMATRIX& ) const; + BOOL operator != ( CONST D3DXMATRIX& ) const; + +} D3DXMATRIX, *LPD3DXMATRIX; + +#else //!__cplusplus +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +#endif //!__cplusplus + + +//--------------------------------------------------------------------------- +// Aligned Matrices +// +// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. +// It aligns matrices on the stack and on the heap or in global scope. +// It does this using __declspec(align(16)) which works on VC7 and on VC 6 +// with the processor pack. Unfortunately there is no way to detect the +// latter so this is turned on only on VC7. On other compilers this is the +// the same as D3DXMATRIX. +// +// Using this class on a compiler that does not actually do the alignment +// can be dangerous since it will not expose bugs that ignore alignment. +// E.g if an object of this class in inside a struct or class, and some code +// memcopys data in it assuming tight packing. This could break on a compiler +// that eventually start aligning the matrix. +//--------------------------------------------------------------------------- +#ifdef __cplusplus +typedef struct _D3DXMATRIXA16 : public D3DXMATRIX +{ + _D3DXMATRIXA16() {} + _D3DXMATRIXA16( CONST FLOAT * ); + _D3DXMATRIXA16( CONST D3DMATRIX& ); + _D3DXMATRIXA16( CONST D3DXFLOAT16 * ); + _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + // new operators + void* operator new ( size_t ); + void* operator new[] ( size_t ); + + // delete operators + void operator delete ( void* ); // These are NOT virtual; Do not + void operator delete[] ( void* ); // cast to D3DXMATRIX and delete. + + // assignment operators + _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& ); + +} _D3DXMATRIXA16; + +#else //!__cplusplus +typedef D3DXMATRIX _D3DXMATRIXA16; +#endif //!__cplusplus + + + +#if _MSC_VER >= 1300 // VC7 +#define D3DX_ALIGN16 __declspec(align(16)) +#else +#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing. +#endif + +typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16; + + + +//=========================================================================== +// +// Quaternions +// +//=========================================================================== +typedef struct D3DXQUATERNION +{ +#ifdef __cplusplus +public: + D3DXQUATERNION() {} + D3DXQUATERNION( CONST FLOAT * ); + D3DXQUATERNION( CONST D3DXFLOAT16 * ); + D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( FLOAT ); + D3DXQUATERNION& operator /= ( FLOAT ); + + // unary operators + D3DXQUATERNION operator + () const; + D3DXQUATERNION operator - () const; + + // binary operators + D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( FLOAT ) const; + D3DXQUATERNION operator / ( FLOAT ) const; + + friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); + + BOOL operator == ( CONST D3DXQUATERNION& ) const; + BOOL operator != ( CONST D3DXQUATERNION& ) const; + +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXQUATERNION, *LPD3DXQUATERNION; + + +//=========================================================================== +// +// Planes +// +//=========================================================================== +typedef struct D3DXPLANE +{ +#ifdef __cplusplus +public: + D3DXPLANE() {} + D3DXPLANE( CONST FLOAT* ); + D3DXPLANE( CONST D3DXFLOAT16* ); + D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXPLANE& operator *= ( FLOAT ); + D3DXPLANE& operator /= ( FLOAT ); + + // unary operators + D3DXPLANE operator + () const; + D3DXPLANE operator - () const; + + // binary operators + D3DXPLANE operator * ( FLOAT ) const; + D3DXPLANE operator / ( FLOAT ) const; + + friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& ); + + BOOL operator == ( CONST D3DXPLANE& ) const; + BOOL operator != ( CONST D3DXPLANE& ) const; + +#endif //__cplusplus + FLOAT a, b, c, d; +} D3DXPLANE, *LPD3DXPLANE; + + +//=========================================================================== +// +// Colors +// +//=========================================================================== + +typedef struct D3DXCOLOR +{ +#ifdef __cplusplus +public: + D3DXCOLOR() {} + D3DXCOLOR( DWORD argb ); + D3DXCOLOR( CONST FLOAT * ); + D3DXCOLOR( CONST D3DXFLOAT16 * ); + D3DXCOLOR( CONST D3DCOLORVALUE& ); + D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); + + // casting + operator DWORD () const; + + operator FLOAT* (); + operator CONST FLOAT* () const; + + operator D3DCOLORVALUE* (); + operator CONST D3DCOLORVALUE* () const; + + operator D3DCOLORVALUE& (); + operator CONST D3DCOLORVALUE& () const; + + // assignment operators + D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator *= ( FLOAT ); + D3DXCOLOR& operator /= ( FLOAT ); + + // unary operators + D3DXCOLOR operator + () const; + D3DXCOLOR operator - () const; + + // binary operators + D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator * ( FLOAT ) const; + D3DXCOLOR operator / ( FLOAT ) const; + + friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& ); + + BOOL operator == ( CONST D3DXCOLOR& ) const; + BOOL operator != ( CONST D3DXCOLOR& ) const; + +#endif //__cplusplus + FLOAT r, g, b, a; +} D3DXCOLOR, *LPD3DXCOLOR; + + + +//=========================================================================== +// +// D3DX math functions: +// +// NOTE: +// * All these functions can take the same object as in and out parameters. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//=========================================================================== + +//-------------------------- +// Float16 +//-------------------------- + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Converts an array 32-bit floats to 16-bit floats +D3DXFLOAT16* WINAPI D3DXFloat32To16Array + ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ); + +// Converts an array 16-bit floats to 32-bit floats +FLOAT* WINAPI D3DXFloat16To32Array + ( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 2D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Z component of ((x1,y1,0) cross (x2,y2,0)) +FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2) +D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2) +D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR2* WINAPI D3DXVec2Normalize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR2* WINAPI D3DXVec2Hermite + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR2* WINAPI D3DXVec2CatmullRom + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR2* WINAPI D3DXVec2BaryCentric + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoord + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormal + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform Array (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n); + +// Transform Array (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + + + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 3D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR3* WINAPI D3DXVec3Normalize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR3* WINAPI D3DXVec3Hermite + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR3* WINAPI D3DXVec3CatmullRom + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR3* WINAPI D3DXVec3BaryCentric + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoord + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormal + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + + +// Transform Array (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Project vector from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3Project + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3Unproject + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector Array from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3ProjectArray + ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + +// Project vector Array from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + + +#ifdef __cplusplus +} +#endif + + + +//-------------------------- +// 4D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); + +D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Cross-product in 4 dimensions. +D3DXVECTOR4* WINAPI D3DXVec4Cross + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3); + +D3DXVECTOR4* WINAPI D3DXVec4Normalize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR4* WINAPI D3DXVec4Hermite + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR4* WINAPI D3DXVec4CatmullRom + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR4* WINAPI D3DXVec4BaryCentric + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); + +// Transform vector by matrix. +D3DXVECTOR4* WINAPI D3DXVec4Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); + +// Transform vector array by matrix. +D3DXVECTOR4* WINAPI D3DXVec4TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 4D Matrix +//-------------------------- + +// inline + +D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ); + +BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +FLOAT WINAPI D3DXMatrixDeterminant + ( CONST D3DXMATRIX *pM ); + +HRESULT WINAPI D3DXMatrixDecompose + ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, + D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ); + +D3DXMATRIX* WINAPI D3DXMatrixTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); + +// Matrix multiplication. The result represents the transformation M2 +// followed by the transformation M1. (Out = M1 * M2) +D3DXMATRIX* WINAPI D3DXMatrixMultiply + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) +D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Calculate inverse of matrix. Inversion my fail, in which case NULL will +// be returned. The determinant of pM is also returned it pfDeterminant +// is non-NULL. +D3DXMATRIX* WINAPI D3DXMatrixInverse + ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); + +// Build a matrix which scales by (sx, sy, sz) +D3DXMATRIX* WINAPI D3DXMatrixScaling + ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); + +// Build a matrix which translates by (x, y, z) +D3DXMATRIX* WINAPI D3DXMatrixTranslation + ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); + +// Build a matrix which rotates around the X axis +D3DXMATRIX* WINAPI D3DXMatrixRotationX + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Y axis +D3DXMATRIX* WINAPI D3DXMatrixRotationY + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Z axis +D3DXMATRIX* WINAPI D3DXMatrixRotationZ + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around an arbitrary axis +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Build a matrix from a quaternion +D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion + ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll + ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Build transformation matrix. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, + CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, + CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, + CONST D3DXVECTOR3 *pTranslation); + +// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D + ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, + FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, + CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, + CONST D3DXVECTOR2* pTranslation); + +// Build affine transformation matrix. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, + CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); + +// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, + FLOAT Rotation, CONST D3DXVECTOR2* pTranslation); + +// Build a lookat matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtRH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a lookat matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtLH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a matrix which flattens geometry into a plane, as if casting +// a shadow from a light. +D3DXMATRIX* WINAPI D3DXMatrixShadow + ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, + CONST D3DXPLANE *pPlane ); + +// Build a matrix which reflects the coordinate system about a plane +D3DXMATRIX* WINAPI D3DXMatrixReflect + ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Quaternion +//-------------------------- + +// inline + +FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ); + +// Length squared, or "norm" +FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ); + +FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); + +// (0, 0, 0, 1) +D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ); + +BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ); + +// (-x, -y, -z, w) +D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. +void WINAPI D3DXQuaternionToAxisAngle + ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); + +// Build a quaternion from a rotation matrix. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix + ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); + +// Rotation about arbitrary axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis + ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll + ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Quaternion multiplication. The result represents the rotation Q2 +// followed by the rotation Q1. (Out = Q2 * Q1) +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2 ); + +D3DXQUATERNION* WINAPI D3DXQuaternionNormalize + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Conjugate and re-norm +D3DXQUATERNION* WINAPI D3DXQuaternionInverse + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects unit quaternions. +// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) +D3DXQUATERNION* WINAPI D3DXQuaternionLn + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects pure quaternions. (w == 0) w is ignored in calculation. +// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) +D3DXQUATERNION* WINAPI D3DXQuaternionExp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). +// Expects unit quaternions. +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, FLOAT t ); + +// Spherical quadrangle interpolation. +// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) +D3DXQUATERNION* WINAPI D3DXQuaternionSquad + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, + CONST D3DXQUATERNION *pC, FLOAT t ); + +// Setup control points for spherical quadrangle interpolation +// from Q1 to Q2. The control points are chosen in such a way +// to ensure the continuity of tangents with adjacent segments. +void WINAPI D3DXQuaternionSquadSetup + ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, + CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); + +// Barycentric interpolation. +// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, + FLOAT f, FLOAT g ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Plane +//-------------------------- + +// inline + +// ax + by + cz + dw +FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); + +// ax + by + cz + d +FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +// ax + by + cz +FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Normalize plane (so that |a,b,c| == 1) +D3DXPLANE* WINAPI D3DXPlaneNormalize + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); + +// Find the intersection between a plane and a line. If the line is +// parallel to the plane, NULL is returned. +D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine + ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2); + +// Construct a plane from a point and a normal +D3DXPLANE* WINAPI D3DXPlaneFromPointNormal + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); + +// Construct a plane from 3 points +D3DXPLANE* WINAPI D3DXPlaneFromPoints + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3); + +// Transform a plane by a matrix. The vector (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransform + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); + +// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransformArray + ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Color +//-------------------------- + +// inline + +// (1-r, 1-g, 1-b, a) +D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); + +D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// (r1*r2, g1*g2, b1*b2, a1*a2) +D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) +D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Interpolate r,g,b between desaturated color and color. +// DesaturatedColor + s(Color - DesaturatedColor) +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) +D3DXCOLOR* WINAPI D3DXColorAdjustContrast + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); + +#ifdef __cplusplus +} +#endif + + + + +//-------------------------- +// Misc +//-------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Calculate Fresnel term given the cosine of theta (likely obtained by +// taking the dot of two normals), and the refraction index of the material. +FLOAT WINAPI D3DXFresnelTerm + (FLOAT CosTheta, FLOAT RefractionIndex); + +#ifdef __cplusplus +} +#endif + + + +//=========================================================================== +// +// Matrix Stack +// +//=========================================================================== + +typedef interface ID3DXMatrixStack ID3DXMatrixStack; +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; + +// {C7885BA7-F990-4fe7-922D-8515E477DD85} +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + // + // IUnknown methods + // + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + // + // ID3DXMatrixStack methods + // + + // Pops the top of the stack, returns the current top + // *after* popping the top. + STDMETHOD(Pop)(THIS) PURE; + + // Pushes the stack by one, duplicating the current matrix. + STDMETHOD(Push)(THIS) PURE; + + // Loads identity in the current matrix. + STDMETHOD(LoadIdentity)(THIS) PURE; + + // Loads the given matrix into the current matrix + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right-Multiplies the given matrix to the current matrix. + // (transformation is about the current world origin) + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Left-Multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object) + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the current world origin) + STDMETHOD(RotateAxis) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + STDMETHOD(RotateAxisLocal) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // current world origin) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRoll) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // local origin of the object) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRollLocal) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Right multiply the current matrix with the computed scale + // matrix. (transformation is about the current world origin) + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Left multiply the current matrix with the computed scale + // matrix. (transformation is about the local origin of the object) + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Right multiply the current matrix with the computed translation + // matrix. (transformation is about the current world origin) + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Obtain the current matrix at the top of the stack + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI + D3DXCreateMatrixStack( + DWORD Flags, + LPD3DXMATRIXSTACK* ppStack); + +#ifdef __cplusplus +} +#endif + +//=========================================================================== +// +// Spherical Harmonic Runtime Routines +// +// NOTE: +// * Most of these functions can take the same object as in and out parameters. +// The exceptions are the rotation functions. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//============================================================================ + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +//============================================================================ +// +// Basic Spherical Harmonic math routines +// +//============================================================================ + +#define D3DXSH_MINORDER 2 +#define D3DXSH_MAXORDER 6 + +//============================================================================ +// +// D3DXSHEvalDirection: +// -------------------- +// Evaluates the Spherical Harmonic basis functions +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction to evaluate in - assumed to be normalized +// +//============================================================================ + +FLOAT* WINAPI D3DXSHEvalDirection + ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ); + +//============================================================================ +// +// D3DXSHRotate: +// -------------------- +// Rotates SH vector by a rotation matrix +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pMatrix +// Matrix used for rotation - rotation sub matrix should be orthogonal +// and have a unit determinant. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHRotate + ( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHRotateZ: +// -------------------- +// Rotates the SH vector in the Z axis by an angle +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// Angle +// Angle in radians to rotate around the Z axis. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + + +FLOAT* WINAPI D3DXSHRotateZ + ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHAdd: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i] + pB[i]; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Input SH coeffs (second vector.) +// +//============================================================================ + +FLOAT* WINAPI D3DXSHAdd + ( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHScale: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i]*Scale; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pIn +// Input SH coeffs. +// Scale +// Scale factor. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHScale + ( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ); + +//============================================================================ +// +// D3DXSHDot: +// -------------------- +// Computes the dot product of two SH vectors +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT WINAPI D3DXSHDot + ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHMultiply[O]: +// -------------------- +// Computes the product of two functions represented using SH (f and g), where: +// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis +// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O +// determines the lengths of the arrays, where there should always be O^2 +// coefficients. In general the product of two SH functions of order O generates +// and SH function of order 2*O - 1, but we truncate the result. This means +// that the product commutes (f*g == g*f) but doesn't associate +// (f*(g*h) != (f*g)*h. +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// pF +// Input SH coeffs for first function. +// pG +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); + + +//============================================================================ +// +// Basic Spherical Harmonic lighting routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHEvalDirectionalLight: +// -------------------- +// Evaluates a directional light and returns spectral SH data. The output +// vector is computed so that if the intensity of R/G/B is unit the resulting +// exit radiance of a point directly under the light on a diffuse object with +// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut +// has to be specified, while pGout and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalDirectionalLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalSphericalLight: +// -------------------- +// Evaluates a spherical light and returns spectral SH data. There is no +// normalization of the intensity of the light like there is for directional +// lights, care has to be taken when specifiying the intensities. This will +// compute 3 spectral samples, pROut has to be specified, while pGout and +// pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pPos +// Position of light - reciever is assumed to be at the origin. +// Radius +// Radius of the spherical light source. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalSphericalLight + ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalConeLight: +// -------------------- +// Evaluates a light that is a cone of constant intensity and returns spectral +// SH data. The output vector is computed so that if the intensity of R/G/B is +// unit the resulting exit radiance of a point directly under the light oriented +// in the cone direction on a diffuse object with an albedo of 1 would be 1.0. +// This will compute 3 spectral samples, pROut has to be specified, while pGout +// and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// Radius +// Radius of cone in radians. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalConeLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalHemisphereLight: +// -------------------- +// Evaluates a light that is a linear interpolant between two colors over the +// sphere. The interpolant is linear along the axis of the two points, not +// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in +// Z, not in the azimuthal angle.) The resulting spherical lighting function +// is normalized so that a point on a perfectly diffuse surface with no +// shadowing and a normal pointed in the direction pDir would result in exit +// radiance with a value of 1 if the top color was white and the bottom color +// was black. This is a very simple model where Top represents the intensity +// of the "sky" and Bottom represents the intensity of the "ground". +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Axis of the hemisphere. +// Top +// Color of the upper hemisphere. +// Bottom +// Color of the lower hemisphere. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalHemisphereLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// Basic Spherical Harmonic projection routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHProjectCubeMap: +// -------------------- +// Projects a function represented on a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHProjectCubeMap + ( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + + +#ifdef __cplusplus +} +#endif + + +#include "d3dx9math.inl" + +#if _MSC_VER >= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif // __D3DX9MATH_H__ + diff --git a/subVersion/d3d9/d3dx9math.inl b/subVersion/d3d9/d3dx9math.inl new file mode 100644 index 0000000..a3652ed --- /dev/null +++ b/subVersion/d3d9/d3dx9math.inl @@ -0,0 +1,2251 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9math.inl +// Content: D3DX math inline functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX9MATH_INL__ +#define __D3DX9MATH_INL__ + +//=========================================================================== +// +// Inline Class Methods +// +//=========================================================================== + +#ifdef __cplusplus + +//-------------------------- +// Float16 +//-------------------------- + +D3DXINLINE +D3DXFLOAT16::D3DXFLOAT16( FLOAT f ) +{ + D3DXFloat32To16Array(this, &f, 1); +} + +D3DXINLINE +D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f ) +{ + value = f.value; +} + +// casting +D3DXINLINE +D3DXFLOAT16::operator FLOAT () +{ + FLOAT f; + D3DXFloat16To32Array(&f, this, 1); + return f; +} + +// binary operators +D3DXINLINE BOOL +D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const +{ + return value == f.value; +} + +D3DXINLINE BOOL +D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const +{ + return value != f.value; +} + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; +} + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 2); +} + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DXINLINE +D3DXVECTOR2::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR2::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) +{ + x += v.x; + y += v.y; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) +{ + x -= v.x; + y -= v.y; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator - () const +{ + return D3DXVECTOR2(-x, -y); +} + + +// binary operators +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x + v.x, y + v.y); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x - v.x, y - v.y); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator * ( FLOAT f ) const +{ + return D3DXVECTOR2(x * f, y * f); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR2(x * fInv, y * fInv); +} + +D3DXINLINE D3DXVECTOR2 +operator * ( FLOAT f, CONST D3DXVECTOR2& v ) +{ + return D3DXVECTOR2(f * v.x, f * v.y); +} + +D3DXINLINE BOOL +D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const +{ + return x == v.x && y == v.y; +} + +D3DXINLINE BOOL +D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const +{ + return x != v.x || y != v.y; +} + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 2); +} + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); +} + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DXINLINE +D3DXVECTOR2_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x); +} + +D3DXINLINE BOOL +D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x); +} + + +//-------------------------- +// 3D Vector +//-------------------------- +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) +{ + x = v.x; + y = v.y; + z = v.z; +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 3); +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DXINLINE +D3DXVECTOR3::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR3::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) +{ + x += v.x; + y += v.y; + z += v.z; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator - () const +{ + return D3DXVECTOR3(-x, -y, -z); +} + + +// binary operators +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator * ( FLOAT f ) const +{ + return D3DXVECTOR3(x * f, y * f, z * f); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); +} + + +D3DXINLINE D3DXVECTOR3 +operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) +{ + return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); +} + + +D3DXINLINE BOOL +D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DXINLINE BOOL +D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 3); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v ) +{ + D3DXFloat32To16Array(&x, &v.x, 1); + D3DXFloat32To16Array(&y, &v.y, 1); + D3DXFloat32To16Array(&z, &v.z, 1); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); + *((WORD *) &z) = *((WORD *) &pf[2]); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DXINLINE +D3DXVECTOR3_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x) && + *((WORD *) &z) == *((WORD *) &v.z); +} + +D3DXINLINE BOOL +D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x) || + *((WORD *) &z) != *((WORD *) &v.z); +} + + +//-------------------------- +// 4D Vector +//-------------------------- +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXVECTOR4::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR4::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) +{ + x += v.x; + y += v.y; + z += v.z; + w += v.w; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + w -= v.w; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator - () const +{ + return D3DXVECTOR4(-x, -y, -z, -w); +} + + +// binary operators +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator * ( FLOAT f ) const +{ + return D3DXVECTOR4(x * f, y * f, z * f, w * f); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); +} + +D3DXINLINE D3DXVECTOR4 +operator * ( FLOAT f, CONST D3DXVECTOR4& v ) +{ + return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); +} + + +D3DXINLINE BOOL +D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DXINLINE BOOL +D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 4); +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); + *((DWORD *) &z) = *((DWORD *) &pf[2]); +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXVECTOR4_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x) && + *((DWORD *) &z) == *((DWORD *) &v.z); +} + +D3DXINLINE BOOL +D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x) || + *((DWORD *) &z) != *((DWORD *) &v.z); +} + + +//-------------------------- +// Matrix +//-------------------------- +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + memcpy(&_11, pf, sizeof(D3DXMATRIX)); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) +{ + memcpy(&_11, &mat, sizeof(D3DXMATRIX)); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&_11, pf, 16); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, + FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, + FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, + FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) +{ + _11 = f11; _12 = f12; _13 = f13; _14 = f14; + _21 = f21; _22 = f22; _23 = f23; _24 = f24; + _31 = f31; _32 = f32; _33 = f33; _34 = f34; + _41 = f41; _42 = f42; _43 = f43; _44 = f44; +} + + + +// access grants +D3DXINLINE FLOAT& +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) +{ + return m[iRow][iCol]; +} + +D3DXINLINE FLOAT +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const +{ + return m[iRow][iCol]; +} + + +// casting operators +D3DXINLINE +D3DXMATRIX::operator FLOAT* () +{ + return (FLOAT *) &_11; +} + +D3DXINLINE +D3DXMATRIX::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &_11; +} + + +// assignment operators +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) +{ + D3DXMatrixMultiply(this, this, &mat); + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) +{ + _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; + _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; + _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; + _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) +{ + _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; + _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; + _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; + _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( FLOAT f ) +{ + _11 *= f; _12 *= f; _13 *= f; _14 *= f; + _21 *= f; _22 *= f; _23 *= f; _24 *= f; + _31 *= f; _32 *= f; _33 *= f; _34 *= f; + _41 *= f; _42 *= f; _43 *= f; _44 *= f; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; + _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; + _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; + _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator - () const +{ + return D3DXMATRIX(-_11, -_12, -_13, -_14, + -_21, -_22, -_23, -_24, + -_31, -_32, -_33, -_34, + -_41, -_42, -_43, -_44); +} + + +// binary operators +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const +{ + D3DXMATRIX matT; + D3DXMatrixMultiply(&matT, this, &mat); + return matT; +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, + _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, + _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, + _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, + _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, + _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, + _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator * ( FLOAT f ) const +{ + return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, + _21 * f, _22 * f, _23 * f, _24 * f, + _31 * f, _32 * f, _33 * f, _34 * f, + _41 * f, _42 * f, _43 * f, _44 * f); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, + _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, + _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, + _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); +} + + +D3DXINLINE D3DXMATRIX +operator * ( FLOAT f, CONST D3DXMATRIX& mat ) +{ + return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, + f * mat._21, f * mat._22, f * mat._23, f * mat._24, + f * mat._31, f * mat._32, f * mat._33, f * mat._34, + f * mat._41, f * mat._42, f * mat._43, f * mat._44); +} + + +D3DXINLINE BOOL +D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const +{ + return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + +D3DXINLINE BOOL +D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const +{ + return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + + + +//-------------------------- +// Aligned Matrices +//-------------------------- + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) : + D3DXMATRIX( f ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) : + D3DXMATRIX( m ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) : + D3DXMATRIX( f ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : + D3DXMATRIX(_11, _12, _13, _14, + _21, _22, _23, _24, + _31, _32, _33, _34, + _41, _42, _43, _44) +{ +} + +#ifndef SIZE_MAX +#define SIZE_MAX ((SIZE_T)-1) +#endif + +D3DXINLINE void* +_D3DXMATRIXA16::operator new( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DXINLINE void* +_D3DXMATRIXA16::operator new[]( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DXINLINE void +_D3DXMATRIXA16::operator delete(void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DXINLINE void +_D3DXMATRIXA16::operator delete[](void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DXINLINE _D3DXMATRIXA16& +_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs) +{ + memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); + return *this; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXQUATERNION::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXQUATERNION::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) +{ + x += q.x; + y += q.y; + z += q.z; + w += q.w; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) +{ + x -= q.x; + y -= q.y; + z -= q.z; + w -= q.w; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) +{ + D3DXQuaternionMultiply(this, this, &q); + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator - () const +{ + return D3DXQUATERNION(-x, -y, -z, -w); +} + + +// binary operators +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const +{ + D3DXQUATERNION qT; + D3DXQuaternionMultiply(&qT, this, &q); + return qT; +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( FLOAT f ) const +{ + return D3DXQUATERNION(x * f, y * f, z * f, w * f); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); +} + + +D3DXINLINE D3DXQUATERNION +operator * (FLOAT f, CONST D3DXQUATERNION& q ) +{ + return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); +} + + +D3DXINLINE BOOL +D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const +{ + return x == q.x && y == q.y && z == q.z && w == q.w; +} + +D3DXINLINE BOOL +D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const +{ + return x != q.x || y != q.y || z != q.z || w != q.w; +} + + + +//-------------------------- +// Plane +//-------------------------- + +D3DXINLINE +D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + a = pf[0]; + b = pf[1]; + c = pf[2]; + d = pf[3]; +} + +D3DXINLINE +D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&a, pf, 4); +} + +D3DXINLINE +D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) +{ + a = fa; + b = fb; + c = fc; + d = fd; +} + + +// casting +D3DXINLINE +D3DXPLANE::operator FLOAT* () +{ + return (FLOAT *) &a; +} + +D3DXINLINE +D3DXPLANE::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &a; +} + + +// assignment operators +D3DXINLINE D3DXPLANE& +D3DXPLANE::operator *= ( FLOAT f ) +{ + a *= f; + b *= f; + c *= f; + d *= f; + return *this; +} + +D3DXINLINE D3DXPLANE& +D3DXPLANE::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + a *= fInv; + b *= fInv; + c *= fInv; + d *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXPLANE +D3DXPLANE::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXPLANE +D3DXPLANE::operator - () const +{ + return D3DXPLANE(-a, -b, -c, -d); +} + + +// binary operators +D3DXINLINE D3DXPLANE +D3DXPLANE::operator * ( FLOAT f ) const +{ + return D3DXPLANE(a * f, b * f, c * f, d * f); +} + +D3DXINLINE D3DXPLANE +D3DXPLANE::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv); +} + +D3DXINLINE D3DXPLANE +operator * (FLOAT f, CONST D3DXPLANE& p ) +{ + return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d); +} + +D3DXINLINE BOOL +D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const +{ + return a == p.a && b == p.b && c == p.c && d == p.d; +} + +D3DXINLINE BOOL +D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const +{ + return a != p.a || b != p.b || c != p.c || d != p.d; +} + + + + +//-------------------------- +// Color +//-------------------------- + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( DWORD dw ) +{ + CONST FLOAT f = 1.0f / 255.0f; + r = f * (FLOAT) (unsigned char) (dw >> 16); + g = f * (FLOAT) (unsigned char) (dw >> 8); + b = f * (FLOAT) (unsigned char) (dw >> 0); + a = f * (FLOAT) (unsigned char) (dw >> 24); +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + r = pf[0]; + g = pf[1]; + b = pf[2]; + a = pf[3]; +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&r, pf, 4); +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DCOLORVALUE& c ) +{ + r = c.r; + g = c.g; + b = c.b; + a = c.a; +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) +{ + r = fr; + g = fg; + b = fb; + a = fa; +} + + +// casting +D3DXINLINE +D3DXCOLOR::operator DWORD () const +{ + DWORD dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD) (r * 255.0f + 0.5f); + DWORD dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD) (g * 255.0f + 0.5f); + DWORD dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD) (b * 255.0f + 0.5f); + DWORD dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD) (a * 255.0f + 0.5f); + + return (dwA << 24) | (dwR << 16) | (dwG << 8) | dwB; +} + + +D3DXINLINE +D3DXCOLOR::operator FLOAT * () +{ + return (FLOAT *) &r; +} + +D3DXINLINE +D3DXCOLOR::operator CONST FLOAT * () const +{ + return (CONST FLOAT *) &r; +} + + +D3DXINLINE +D3DXCOLOR::operator D3DCOLORVALUE * () +{ + return (D3DCOLORVALUE *) &r; +} + +D3DXINLINE +D3DXCOLOR::operator CONST D3DCOLORVALUE * () const +{ + return (CONST D3DCOLORVALUE *) &r; +} + + +D3DXINLINE +D3DXCOLOR::operator D3DCOLORVALUE& () +{ + return *((D3DCOLORVALUE *) &r); +} + +D3DXINLINE +D3DXCOLOR::operator CONST D3DCOLORVALUE& () const +{ + return *((CONST D3DCOLORVALUE *) &r); +} + + +// assignment operators +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) +{ + r += c.r; + g += c.g; + b += c.b; + a += c.a; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) +{ + r -= c.r; + g -= c.g; + b -= c.b; + a -= c.a; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator *= ( FLOAT f ) +{ + r *= f; + g *= f; + b *= f; + a *= f; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + r *= fInv; + g *= fInv; + b *= fInv; + a *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator - () const +{ + return D3DXCOLOR(-r, -g, -b, -a); +} + + +// binary operators +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator * ( FLOAT f ) const +{ + return D3DXCOLOR(r * f, g * f, b * f, a * f); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); +} + + +D3DXINLINE D3DXCOLOR +operator * (FLOAT f, CONST D3DXCOLOR& c ) +{ + return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); +} + + +D3DXINLINE BOOL +D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const +{ + return r == c.r && g == c.g && b == c.b && a == c.a; +} + +D3DXINLINE BOOL +D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const +{ + return r != c.r || g != c.g || b != c.b || a != c.a; +} + + +#endif //__cplusplus + + + +//=========================================================================== +// +// Inline functions +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); +#endif +} + +D3DXINLINE FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y; +} + +D3DXINLINE FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y; +} + +D3DXINLINE FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->y - pV1->y * pV2->x; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + return pOut; +} + + +//-------------------------- +// 3D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#endif +} + +D3DXINLINE FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; +} + +D3DXINLINE FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + D3DXVECTOR3 v; + +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + v.x = pV1->y * pV2->z - pV1->z * pV2->y; + v.y = pV1->z * pV2->x - pV1->x * pV2->z; + v.z = pV1->x * pV2->y - pV1->y * pV2->x; + + *pOut = v; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + return pOut; +} + + +//-------------------------- +// 4D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#endif +} + +D3DXINLINE FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; +} + +D3DXINLINE FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + pOut->w = pV1->w + pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + pOut->w = pV1->w - pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + pOut->w = pV->w * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + pOut->w = pV1->w + s * (pV2->w - pV1->w); + return pOut; +} + + +//-------------------------- +// 4D Matrix +//-------------------------- + +D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ) +{ +#ifdef D3DX_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = + pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = + pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = + pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; + + pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; + return pOut; +} + + +D3DXINLINE BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ) +{ +#ifdef D3DX_DEBUG + if(!pM) + return FALSE; +#endif + + return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && + pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && + pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && + pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DXINLINE FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#else + return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#endif +} + +D3DXINLINE FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return 0.0f; +#endif + + return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; +} + +D3DXINLINE FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) +{ +#ifdef D3DX_DEBUG + if(!pQ1 || !pQ2) + return 0.0f; +#endif + + return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; +} + + +D3DXINLINE D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ) +{ +#ifdef D3DX_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->x = pOut->y = pOut->z = 0.0f; + pOut->w = 1.0f; + return pOut; +} + +D3DXINLINE BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return FALSE; +#endif + + return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; +} + + +D3DXINLINE D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pQ) + return NULL; +#endif + + pOut->x = -pQ->x; + pOut->y = -pQ->y; + pOut->z = -pQ->z; + pOut->w = pQ->w; + return pOut; +} + + +//-------------------------- +// Plane +//-------------------------- + +D3DXINLINE FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; +} + +D3DXINLINE FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; +} + +D3DXINLINE FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; +} + +D3DXINLINE D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pP) + return NULL; +#endif + + pOut->a = pP->a * s; + pOut->b = pP->b * s; + pOut->c = pP->c * s; + pOut->d = pP->d * s; + return pOut; +} + + +//-------------------------- +// Color +//-------------------------- + +D3DXINLINE D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = 1.0f - pC->r; + pOut->g = 1.0f - pC->g; + pOut->b = 1.0f - pC->b; + pOut->a = pC->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + pC2->r; + pOut->g = pC1->g + pC2->g; + pOut->b = pC1->b + pC2->b; + pOut->a = pC1->a + pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r - pC2->r; + pOut->g = pC1->g - pC2->g; + pOut->b = pC1->b - pC2->b; + pOut->a = pC1->a - pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = pC->r * s; + pOut->g = pC->g * s; + pOut->b = pC->b * s; + pOut->a = pC->a * s; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r * pC2->r; + pOut->g = pC1->g * pC2->g; + pOut->b = pC1->b * pC2->b; + pOut->a = pC1->a * pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + s * (pC2->r - pC1->r); + pOut->g = pC1->g + s * (pC2->g - pC1->g); + pOut->b = pC1->b + s * (pC2->b - pC1->b); + pOut->a = pC1->a + s * (pC2->a - pC1->a); + return pOut; +} + + +#endif // __D3DX9MATH_INL__ + diff --git a/subVersion/d3d9/d3dx9mesh.h b/subVersion/d3d9/d3dx9mesh.h new file mode 100644 index 0000000..a009d9a --- /dev/null +++ b/subVersion/d3d9/d3dx9mesh.h @@ -0,0 +1,3007 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9mesh.h +// Content: D3DX mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9MESH_H__ +#define __D3DX9MESH_H__ + +// {7ED943DD-52E8-40b5-A8D8-76685C406330} +DEFINE_GUID(IID_ID3DXBaseMesh, +0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30); + +// {4020E5C2-1403-4929-883F-E2E849FAC195} +DEFINE_GUID(IID_ID3DXMesh, +0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95); + +// {8875769A-D579-4088-AAEB-534D1AD84E96} +DEFINE_GUID(IID_ID3DXPMesh, +0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96); + +// {667EA4C7-F1CD-4386-B523-7C0290B83CC5} +DEFINE_GUID(IID_ID3DXSPMesh, +0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5); + +// {11EAA540-F9A6-4d49-AE6A-E19221F70CC4} +DEFINE_GUID(IID_ID3DXSkinInfo, +0x11eaa540, 0xf9a6, 0x4d49, 0xae, 0x6a, 0xe1, 0x92, 0x21, 0xf7, 0xc, 0xc4); + +// {3CE6CC22-DBF2-44f4-894D-F9C34A337139} +DEFINE_GUID(IID_ID3DXPatchMesh, +0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39); + +//patch mesh can be quads or tris +typedef enum _D3DXPATCHMESHTYPE { + D3DXPATCHMESH_RECT = 0x001, + D3DXPATCHMESH_TRI = 0x002, + D3DXPATCHMESH_NPATCH = 0x003, + + D3DXPATCHMESH_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPATCHMESHTYPE; + +// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags +enum _D3DXMESH { + D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. + D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB. + D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB. + D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB. + D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB. + D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER + D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB. + D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB. + D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB. + D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB. + D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER + D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB. + D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB. + D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB. + D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB. + + D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer + + D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinInfo::ConvertToBlendedMesh + + // Helper options + D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM + D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED + D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY + D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC + D3DXMESH_SOFTWAREPROCESSING = 0x18000, // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING + +}; + +//patch mesh options +enum _D3DXPATCHMESH { + D3DXPATCHMESH_DEFAULT = 000, +}; +// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh +enum _D3DXMESHSIMP +{ + D3DXMESHSIMP_VERTEX = 0x1, + D3DXMESHSIMP_FACE = 0x2, + +}; + +typedef enum _D3DXCLEANTYPE { + D3DXCLEAN_BACKFACING = 0x00000001, + D3DXCLEAN_BOWTIES = 0x00000002, + + // Helper options + D3DXCLEAN_SKINNING = D3DXCLEAN_BACKFACING, // Bowtie cleaning modifies geometry and breaks skinning + D3DXCLEAN_OPTIMIZATION = D3DXCLEAN_BACKFACING, + D3DXCLEAN_SIMPLIFICATION= D3DXCLEAN_BACKFACING | D3DXCLEAN_BOWTIES, +} D3DXCLEANTYPE; + +enum _MAX_FVF_DECL_SIZE +{ + MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 // +1 for END +}; + +typedef enum _D3DXTANGENT +{ + D3DXTANGENT_WRAP_U = 0x01, + D3DXTANGENT_WRAP_V = 0x02, + D3DXTANGENT_WRAP_UV = 0x03, + D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x04, + D3DXTANGENT_DONT_ORTHOGONALIZE = 0x08, + D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x010, + D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x020, + D3DXTANGENT_WEIGHT_BY_AREA = 0x040, + D3DXTANGENT_WEIGHT_EQUAL = 0x080, + D3DXTANGENT_WIND_CW = 0x0100, + D3DXTANGENT_CALCULATE_NORMALS = 0x0200, + D3DXTANGENT_GENERATE_IN_PLACE = 0x0400, +} D3DXTANGENT; + +// D3DXIMT_WRAP_U means the texture wraps in the U direction +// D3DXIMT_WRAP_V means the texture wraps in the V direction +// D3DXIMT_WRAP_UV means the texture wraps in both directions +typedef enum _D3DXIMT +{ + D3DXIMT_WRAP_U = 0x01, + D3DXIMT_WRAP_V = 0x02, + D3DXIMT_WRAP_UV = 0x03, +} D3DXIMT; + +// These options are only valid for UVAtlasCreate and UVAtlasPartition, we may add more for UVAtlasPack if necessary +// D3DXUVATLAS_DEFAULT - Meshes with more than 25k faces go through fast, meshes with fewer than 25k faces go through quality +// D3DXUVATLAS_GEODESIC_FAST - Uses approximations to improve charting speed at the cost of added stretch or more charts. +// D3DXUVATLAS_GEODESIC_QUALITY - Provides better quality charts, but requires more time and memory than fast. +typedef enum _D3DXUVATLAS +{ + D3DXUVATLAS_DEFAULT = 0x00, + D3DXUVATLAS_GEODESIC_FAST = 0x01, + D3DXUVATLAS_GEODESIC_QUALITY = 0x02, +} D3DXUVATLAS; + +typedef struct ID3DXBaseMesh *LPD3DXBASEMESH; +typedef struct ID3DXMesh *LPD3DXMESH; +typedef struct ID3DXPMesh *LPD3DXPMESH; +typedef struct ID3DXSPMesh *LPD3DXSPMESH; +typedef struct ID3DXSkinInfo *LPD3DXSKININFO; +typedef struct ID3DXPatchMesh *LPD3DXPATCHMESH; +typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER; +typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER; + + +typedef struct _D3DXATTRIBUTERANGE +{ + DWORD AttribId; + DWORD FaceStart; + DWORD FaceCount; + DWORD VertexStart; + DWORD VertexCount; +} D3DXATTRIBUTERANGE; + +typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE; + +typedef struct _D3DXMATERIAL +{ + D3DMATERIAL9 MatD3D; + LPSTR pTextureFilename; +} D3DXMATERIAL; +typedef D3DXMATERIAL *LPD3DXMATERIAL; + +typedef enum _D3DXEFFECTDEFAULTTYPE +{ + D3DXEDT_STRING = 0x1, // pValue points to a null terminated ASCII string + D3DXEDT_FLOATS = 0x2, // pValue points to an array of floats - number of floats is NumBytes / sizeof(float) + D3DXEDT_DWORD = 0x3, // pValue points to a DWORD + + D3DXEDT_FORCEDWORD = 0x7fffffff +} D3DXEFFECTDEFAULTTYPE; + +typedef struct _D3DXEFFECTDEFAULT +{ + LPSTR pParamName; + D3DXEFFECTDEFAULTTYPE Type; // type of the data pointed to by pValue + DWORD NumBytes; // size in bytes of the data pointed to by pValue + LPVOID pValue; // data for the default of the effect +} D3DXEFFECTDEFAULT, *LPD3DXEFFECTDEFAULT; + +typedef struct _D3DXEFFECTINSTANCE +{ + LPSTR pEffectFilename; + DWORD NumDefaults; + LPD3DXEFFECTDEFAULT pDefaults; +} D3DXEFFECTINSTANCE, *LPD3DXEFFECTINSTANCE; + +typedef struct _D3DXATTRIBUTEWEIGHTS +{ + FLOAT Position; + FLOAT Boundary; + FLOAT Normal; + FLOAT Diffuse; + FLOAT Specular; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; +} D3DXATTRIBUTEWEIGHTS, *LPD3DXATTRIBUTEWEIGHTS; + +enum _D3DXWELDEPSILONSFLAGS +{ + D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping + + D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched + // vertices so that both components identical AND if all components "equal" + // remove one of the vertices + D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal + // ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set + // useful to modify vertices to be equal, but not allow vertices to be removed + + D3DXWELDEPSILONS_DONOTSPLIT = 0x8, // instructs weld to specify the D3DXMESHOPT_DONOTSPLIT flag when doing an Optimize(ATTR_SORT) + // if this flag is not set, all vertices that are in separate attribute groups + // will remain split and not welded. Setting this flag can slow down software vertex processing + +}; + +typedef struct _D3DXWELDEPSILONS +{ + FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency + // in general, it should be the same value or greater than the one passed to GeneratedAdjacency + FLOAT BlendWeights; + FLOAT Normal; + FLOAT PSize; + FLOAT Specular; + FLOAT Diffuse; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; + FLOAT TessFactor; +} D3DXWELDEPSILONS; + +typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS; + + +#undef INTERFACE +#define INTERFACE ID3DXBaseMesh + +DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXMesh + +DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // ID3DXMesh + STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE; + STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; + STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, + LPD3DXMESH* ppOptMesh) PURE; + STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE; + STDMETHOD(SetAttributeTable)(THIS_ CONST D3DXATTRIBUTERANGE *pAttribTable, DWORD cAttribTableSize) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXPMesh + +DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // ID3DXPMesh + STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE; + STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE; + STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE; + STDMETHOD(Save)(THIS_ IStream *pStream, CONST D3DXMATERIAL* pMaterials, CONST D3DXEFFECTINSTANCE* pEffectInstances, DWORD NumMaterials) PURE; + + STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, + LPD3DXMESH* ppOptMesh) PURE; + + STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE; + STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; + STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; + + STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE; + + // Used to generate the immediate "ancestor" for each vertex when it is removed by a vsplit. Allows generation of geomorphs + // Vertex buffer must be equal to or greater than the maximum number of vertices in the pmesh + STDMETHOD(GenerateVertexHistory)(THIS_ DWORD* pVertexHistory) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXSPMesh + +DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXSPMesh + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsByFace, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsbyFace, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE; + STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE; + STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; + STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE; + STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE; +}; + +#define UNUSED16 (0xffff) +#define UNUSED32 (0xffffffff) + +// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags +enum _D3DXMESHOPT { + D3DXMESHOPT_COMPACT = 0x01000000, + D3DXMESHOPT_ATTRSORT = 0x02000000, + D3DXMESHOPT_VERTEXCACHE = 0x04000000, + D3DXMESHOPT_STRIPREORDER = 0x08000000, + D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices + D3DXMESHOPT_DONOTSPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting + D3DXMESHOPT_DEVICEINDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards + + // D3DXMESHOPT_SHAREVB has been removed, please use D3DXMESH_VB_SHARE instead + +}; + +// Subset of the mesh that has the same attribute and bone combination. +// This subset can be rendered in a single draw call +typedef struct _D3DXBONECOMBINATION +{ + DWORD AttribId; + DWORD FaceStart; + DWORD FaceCount; + DWORD VertexStart; + DWORD VertexCount; + DWORD* BoneId; +} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION; + +// The following types of patch combinations are supported: +// Patch type Basis Degree +// Rect Bezier 2,3,5 +// Rect B-Spline 2,3,5 +// Rect Catmull-Rom 3 +// Tri Bezier 2,3,5 +// N-Patch N/A 3 + +typedef struct _D3DXPATCHINFO +{ + D3DXPATCHMESHTYPE PatchType; + D3DDEGREETYPE Degree; + D3DBASISTYPE Basis; +} D3DXPATCHINFO, *LPD3DXPATCHINFO; + +#undef INTERFACE +#define INTERFACE ID3DXPatchMesh + +DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPatchMesh + + // Return creation parameters + STDMETHOD_(DWORD, GetNumPatches)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetControlVerticesPerPatch)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; + STDMETHOD(GetPatchInfo)(THIS_ LPD3DXPATCHINFO PatchInfo) PURE; + + // Control mesh access + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE; + STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; + + // This function returns the size of the tessellated mesh given a tessellation level. + // This assumes uniform tessellation. For adaptive tessellation the Adaptive parameter must + // be set to TRUE and TessellationLevel should be the max tessellation. + // This will result in the max mesh size necessary for adaptive tessellation. + STDMETHOD(GetTessSize)(THIS_ FLOAT fTessLevel,DWORD Adaptive, DWORD *NumTriangles,DWORD *NumVertices) PURE; + + //GenerateAdjacency determines which patches are adjacent with provided tolerance + //this information is used internally to optimize tessellation + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Tolerance) PURE; + + //CloneMesh Creates a new patchmesh with the specified decl, and converts the vertex buffer + //to the new decl. Entries in the new decl which are new are set to 0. If the current mesh + //has adjacency, the new mesh will also have adjacency + STDMETHOD(CloneMesh)(THIS_ DWORD Options, CONST D3DVERTEXELEMENT9 *pDecl, LPD3DXPATCHMESH *pMesh) PURE; + + // Optimizes the patchmesh for efficient tessellation. This function is designed + // to perform one time optimization for patch meshes that need to be tessellated + // repeatedly by calling the Tessellate() method. The optimization performed is + // independent of the actual tessellation level used. + // Currently Flags is unused. + // If vertices are changed, Optimize must be called again + STDMETHOD(Optimize)(THIS_ DWORD flags) PURE; + + //gets and sets displacement parameters + //displacement maps can only be 2D textures MIP-MAPPING is ignored for non adapative tessellation + STDMETHOD(SetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 Texture, + D3DTEXTUREFILTERTYPE MinFilter, + D3DTEXTUREFILTERTYPE MagFilter, + D3DTEXTUREFILTERTYPE MipFilter, + D3DTEXTUREADDRESS Wrap, + DWORD dwLODBias) PURE; + + STDMETHOD(GetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 *Texture, + D3DTEXTUREFILTERTYPE *MinFilter, + D3DTEXTUREFILTERTYPE *MagFilter, + D3DTEXTUREFILTERTYPE *MipFilter, + D3DTEXTUREADDRESS *Wrap, + DWORD *dwLODBias) PURE; + + // Performs the uniform tessellation based on the tessellation level. + // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. + STDMETHOD(Tessellate)(THIS_ FLOAT fTessLevel,LPD3DXMESH pMesh) PURE; + + // Performs adaptive tessellation based on the Z based adaptive tessellation criterion. + // pTrans specifies a 4D vector that is dotted with the vertices to get the per vertex + // adaptive tessellation amount. Each edge is tessellated to the average of the criterion + // at the 2 vertices it connects. + // MaxTessLevel specifies the upper limit for adaptive tesselation. + // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. + STDMETHOD(TessellateAdaptive)(THIS_ + CONST D3DXVECTOR4 *pTrans, + DWORD dwMaxTessLevel, + DWORD dwMinTessLevel, + LPD3DXMESH pMesh) PURE; + +}; + +#undef INTERFACE +#define INTERFACE ID3DXSkinInfo + +DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Specify the which vertices do each bones influence and by how much + STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE; + STDMETHOD(SetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float weight) PURE; + STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE; + STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE; + STDMETHOD(GetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float *pWeight, DWORD *pVertexNum) PURE; + STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE; + STDMETHOD_(DWORD, GetNumBones)(THIS) PURE; + STDMETHOD(FindBoneVertexInfluenceIndex)(THIS_ DWORD boneNum, DWORD vertexNum, DWORD *pInfluenceIndex) PURE; + + // This gets the max face influences based on a triangle mesh with the specified index buffer + STDMETHOD(GetMaxFaceInfluences)(THIS_ LPDIRECT3DINDEXBUFFER9 pIB, DWORD NumFaces, DWORD* maxFaceInfluences) PURE; + + // Set min bone influence. Bone influences that are smaller than this are ignored + STDMETHOD(SetMinBoneInfluence)(THIS_ FLOAT MinInfl) PURE; + // Get min bone influence. + STDMETHOD_(FLOAT, GetMinBoneInfluence)(THIS) PURE; + + // Bone names are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object + STDMETHOD(SetBoneName)(THIS_ DWORD Bone, LPCSTR pName) PURE; // pName is copied to an internal string buffer + STDMETHOD_(LPCSTR, GetBoneName)(THIS_ DWORD Bone) PURE; // A pointer to an internal string buffer is returned. Do not free this. + + // Bone offset matrices are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object + STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD Bone, CONST D3DXMATRIX *pBoneTransform) PURE; // pBoneTransform is copied to an internal buffer + STDMETHOD_(LPD3DXMATRIX, GetBoneOffsetMatrix)(THIS_ DWORD Bone) PURE; // A pointer to an internal matrix is returned. Do not free this. + + // Clone a skin info object + STDMETHOD(Clone)(THIS_ LPD3DXSKININFO* ppSkinInfo) PURE; + + // Update bone influence information to match vertices after they are reordered. This should be called + // if the target vertex buffer has been reordered externally. + STDMETHOD(Remap)(THIS_ DWORD NumVertices, DWORD* pVertexRemap) PURE; + + // These methods enable the modification of the vertex layout of the vertices that will be skinned + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(SetDeclaration)(THIS_ CONST D3DVERTEXELEMENT9 *pDeclaration) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // Apply SW skinning based on current pose matrices to the target vertices. + STDMETHOD(UpdateSkinnedMesh)(THIS_ + CONST D3DXMATRIX* pBoneTransforms, + CONST D3DXMATRIX* pBoneInvTransposeTransforms, + LPCVOID pVerticesSrc, + PVOID pVerticesDst) PURE; + + // Takes a mesh and returns a new mesh with per vertex blend weights and a bone combination + // table that describes which bones affect which subsets of the mesh + STDMETHOD(ConvertToBlendedMesh)(THIS_ + LPD3DXMESH pMesh, + DWORD Options, + CONST DWORD *pAdjacencyIn, + LPDWORD pAdjacencyOut, + DWORD* pFaceRemap, + LPD3DXBUFFER *ppVertexRemap, + DWORD* pMaxFaceInfl, + DWORD* pNumBoneCombinations, + LPD3DXBUFFER* ppBoneCombinationTable, + LPD3DXMESH* ppMesh) PURE; + + // Takes a mesh and returns a new mesh with per vertex blend weights and indices + // and a bone combination table that describes which bones palettes affect which subsets of the mesh + STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ + LPD3DXMESH pMesh, + DWORD Options, + DWORD paletteSize, + CONST DWORD *pAdjacencyIn, + LPDWORD pAdjacencyOut, + DWORD* pFaceRemap, + LPD3DXBUFFER *ppVertexRemap, + DWORD* pMaxVertexInfl, + DWORD* pNumBoneCombinations, + LPD3DXBUFFER* ppBoneCombinationTable, + LPD3DXMESH* ppMesh) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateMesh( + DWORD NumFaces, + DWORD NumVertices, + DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXCreateMeshFVF( + DWORD NumFaces, + DWORD NumVertices, + DWORD Options, + DWORD FVF, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXCreateSPMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + LPD3DXSPMESH* ppSMesh); + +// clean a mesh up for simplification, try to make manifold +HRESULT WINAPI + D3DXCleanMesh( + D3DXCLEANTYPE CleanType, + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacencyIn, + LPD3DXMESH* ppMeshOut, + DWORD* pAdjacencyOut, + LPD3DXBUFFER* ppErrorsAndWarnings); + +HRESULT WINAPI + D3DXValidMesh( + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacency, + LPD3DXBUFFER* ppErrorsAndWarnings); + +HRESULT WINAPI + D3DXGeneratePMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + DWORD MinValue, + DWORD Options, + LPD3DXPMESH* ppPMesh); + +HRESULT WINAPI + D3DXSimplifyMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + DWORD MinValue, + DWORD Options, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXComputeBoundingSphere( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pCenter, + FLOAT *pRadius); + +HRESULT WINAPI + D3DXComputeBoundingBox( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pMin, + D3DXVECTOR3 *pMax); + +HRESULT WINAPI + D3DXComputeNormals( + LPD3DXBASEMESH pMesh, + CONST DWORD *pAdjacency); + +HRESULT WINAPI + D3DXCreateBuffer( + DWORD NumBytes, + LPD3DXBUFFER *ppBuffer); + + +HRESULT WINAPI + D3DXLoadMeshFromXA( + LPCSTR pFilename, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXLoadMeshFromXW( + LPCWSTR pFilename, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +#ifdef UNICODE +#define D3DXLoadMeshFromX D3DXLoadMeshFromXW +#else +#define D3DXLoadMeshFromX D3DXLoadMeshFromXA +#endif + +HRESULT WINAPI + D3DXLoadMeshFromXInMemory( + LPCVOID Memory, + DWORD SizeOfMemory, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXLoadMeshFromXResource( + HMODULE Module, + LPCSTR Name, + LPCSTR Type, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXSaveMeshToXA( + LPCSTR pFilename, + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXMATERIAL* pMaterials, + CONST D3DXEFFECTINSTANCE* pEffectInstances, + DWORD NumMaterials, + DWORD Format + ); + +HRESULT WINAPI + D3DXSaveMeshToXW( + LPCWSTR pFilename, + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXMATERIAL* pMaterials, + CONST D3DXEFFECTINSTANCE* pEffectInstances, + DWORD NumMaterials, + DWORD Format + ); + +#ifdef UNICODE +#define D3DXSaveMeshToX D3DXSaveMeshToXW +#else +#define D3DXSaveMeshToX D3DXSaveMeshToXA +#endif + + +HRESULT WINAPI + D3DXCreatePMeshFromStream( + IStream *pStream, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD* pNumMaterials, + LPD3DXPMESH *ppPMesh); + +// Creates a skin info object based on the number of vertices, number of bones, and a declaration describing the vertex layout of the target vertices +// The bone names and initial bone transforms are not filled in the skin info object by this method. +HRESULT WINAPI + D3DXCreateSkinInfo( + DWORD NumVertices, + CONST D3DVERTEXELEMENT9 *pDeclaration, + DWORD NumBones, + LPD3DXSKININFO* ppSkinInfo); + +// Creates a skin info object based on the number of vertices, number of bones, and a FVF describing the vertex layout of the target vertices +// The bone names and initial bone transforms are not filled in the skin info object by this method. +HRESULT WINAPI + D3DXCreateSkinInfoFVF( + DWORD NumVertices, + DWORD FVF, + DWORD NumBones, + LPD3DXSKININFO* ppSkinInfo); + +#ifdef __cplusplus +} + +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXLoadMeshFromXof( + LPD3DXFILEDATA pxofMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +// This similar to D3DXLoadMeshFromXof, except also returns skinning info if present in the file +// If skinning info is not present, ppSkinInfo will be NULL +HRESULT WINAPI + D3DXLoadSkinMeshFromXof( + LPD3DXFILEDATA pxofMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER* ppAdjacency, + LPD3DXBUFFER* ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pMatOut, + LPD3DXSKININFO* ppSkinInfo, + LPD3DXMESH* ppMesh); + + +// The inverse of D3DXConvertTo{Indexed}BlendedMesh() functions. It figures out the skinning info from +// the mesh and the bone combination table and populates a skin info object with that data. The bone +// names and initial bone transforms are not filled in the skin info object by this method. This works +// with either a non-indexed or indexed blended mesh. It examines the FVF or declarator of the mesh to +// determine what type it is. +HRESULT WINAPI + D3DXCreateSkinInfoFromBlendedMesh( + LPD3DXBASEMESH pMesh, + DWORD NumBones, + CONST D3DXBONECOMBINATION *pBoneCombinationTable, + LPD3DXSKININFO* ppSkinInfo); + +HRESULT WINAPI + D3DXTessellateNPatches( + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacencyIn, + FLOAT NumSegs, + BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppAdjacencyOut); + + +//generates implied outputdecl from input decl +//the decl generated from this should be used to generate the output decl for +//the tessellator subroutines. + +HRESULT WINAPI + D3DXGenerateOutputDecl( + D3DVERTEXELEMENT9 *pOutput, + CONST D3DVERTEXELEMENT9 *pInput); + +//loads patches from an XFileData +//since an X file can have up to 6 different patch meshes in it, +//returns them in an array - pNumPatches will contain the number of +//meshes in the actual file. +HRESULT WINAPI + D3DXLoadPatchMeshFromXof( + LPD3DXFILEDATA pXofObjMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + PDWORD pNumMaterials, + LPD3DXPATCHMESH *ppMesh); + +//computes the size a single rect patch. +HRESULT WINAPI + D3DXRectPatchSize( + CONST FLOAT *pfNumSegs, //segments for each edge (4) + DWORD *pdwTriangles, //output number of triangles + DWORD *pdwVertices); //output number of vertices + +//computes the size of a single triangle patch +HRESULT WINAPI + D3DXTriPatchSize( + CONST FLOAT *pfNumSegs, //segments for each edge (3) + DWORD *pdwTriangles, //output number of triangles + DWORD *pdwVertices); //output number of vertices + + +//tessellates a patch into a created mesh +//similar to D3D RT patch +HRESULT WINAPI + D3DXTessellateRectPatch( + LPDIRECT3DVERTEXBUFFER9 pVB, + CONST FLOAT *pNumSegs, + CONST D3DVERTEXELEMENT9 *pdwInDecl, + CONST D3DRECTPATCH_INFO *pRectPatchInfo, + LPD3DXMESH pMesh); + + +HRESULT WINAPI + D3DXTessellateTriPatch( + LPDIRECT3DVERTEXBUFFER9 pVB, + CONST FLOAT *pNumSegs, + CONST D3DVERTEXELEMENT9 *pInDecl, + CONST D3DTRIPATCH_INFO *pTriPatchInfo, + LPD3DXMESH pMesh); + + + +//creates an NPatch PatchMesh from a D3DXMESH +HRESULT WINAPI + D3DXCreateNPatchMesh( + LPD3DXMESH pMeshSysMem, + LPD3DXPATCHMESH *pPatchMesh); + + +//creates a patch mesh +HRESULT WINAPI + D3DXCreatePatchMesh( + CONST D3DXPATCHINFO *pInfo, //patch type + DWORD dwNumPatches, //number of patches + DWORD dwNumVertices, //number of control vertices + DWORD dwOptions, //options + CONST D3DVERTEXELEMENT9 *pDecl, //format of control vertices + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXPATCHMESH *pPatchMesh); + + +//returns the number of degenerates in a patch mesh - +//text output put in string. +HRESULT WINAPI + D3DXValidPatchMesh(LPD3DXPATCHMESH pMesh, + DWORD *dwcDegenerateVertices, + DWORD *dwcDegeneratePatches, + LPD3DXBUFFER *ppErrorsAndWarnings); + +UINT WINAPI + D3DXGetFVFVertexSize(DWORD FVF); + +UINT WINAPI + D3DXGetDeclVertexSize(CONST D3DVERTEXELEMENT9 *pDecl,DWORD Stream); + +UINT WINAPI + D3DXGetDeclLength(CONST D3DVERTEXELEMENT9 *pDecl); + +HRESULT WINAPI + D3DXDeclaratorFromFVF( + DWORD FVF, + D3DVERTEXELEMENT9 pDeclarator[MAX_FVF_DECL_SIZE]); + +HRESULT WINAPI + D3DXFVFFromDeclarator( + CONST D3DVERTEXELEMENT9 *pDeclarator, + DWORD *pFVF); + +HRESULT WINAPI + D3DXWeldVertices( + LPD3DXMESH pMesh, + DWORD Flags, + CONST D3DXWELDEPSILONS *pEpsilons, + CONST DWORD *pAdjacencyIn, + DWORD *pAdjacencyOut, + DWORD *pFaceRemap, + LPD3DXBUFFER *ppVertexRemap); + +typedef struct _D3DXINTERSECTINFO +{ + DWORD FaceIndex; // index of face intersected + FLOAT U; // Barycentric Hit Coordinates + FLOAT V; // Barycentric Hit Coordinates + FLOAT Dist; // Ray-Intersection Parameter Distance +} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO; + + +HRESULT WINAPI + D3DXIntersect( + LPD3DXBASEMESH pMesh, + CONST D3DXVECTOR3 *pRayPos, + CONST D3DXVECTOR3 *pRayDir, + BOOL *pHit, // True if any faces were intersected + DWORD *pFaceIndex, // index of closest face intersected + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist, // Ray-Intersection Parameter Distance + LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) + DWORD *pCountOfHits); // Number of entries in AllHits array + +HRESULT WINAPI + D3DXIntersectSubset( + LPD3DXBASEMESH pMesh, + DWORD AttribId, + CONST D3DXVECTOR3 *pRayPos, + CONST D3DXVECTOR3 *pRayDir, + BOOL *pHit, // True if any faces were intersected + DWORD *pFaceIndex, // index of closest face intersected + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist, // Ray-Intersection Parameter Distance + LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) + DWORD *pCountOfHits); // Number of entries in AllHits array + + +HRESULT WINAPI D3DXSplitMesh + ( + LPD3DXMESH pMeshIn, + CONST DWORD *pAdjacencyIn, + CONST DWORD MaxSize, + CONST DWORD Options, + DWORD *pMeshesOut, + LPD3DXBUFFER *ppMeshArrayOut, + LPD3DXBUFFER *ppAdjacencyArrayOut, + LPD3DXBUFFER *ppFaceRemapArrayOut, + LPD3DXBUFFER *ppVertRemapArrayOut + ); + +BOOL WINAPI D3DXIntersectTri +( + CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position + CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position + CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position + CONST D3DXVECTOR3 *pRayPos, // Ray origin + CONST D3DXVECTOR3 *pRayDir, // Ray direction + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist); // Ray-Intersection Parameter Distance + +BOOL WINAPI + D3DXSphereBoundProbe( + CONST D3DXVECTOR3 *pCenter, + FLOAT Radius, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +BOOL WINAPI + D3DXBoxBoundProbe( + CONST D3DXVECTOR3 *pMin, + CONST D3DXVECTOR3 *pMax, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + + +HRESULT WINAPI D3DXComputeTangentFrame(ID3DXMesh *pMesh, + DWORD dwOptions); + +HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *pMesh, + DWORD dwTextureInSemantic, + DWORD dwTextureInIndex, + DWORD dwUPartialOutSemantic, + DWORD dwUPartialOutIndex, + DWORD dwVPartialOutSemantic, + DWORD dwVPartialOutIndex, + DWORD dwNormalOutSemantic, + DWORD dwNormalOutIndex, + DWORD dwOptions, + CONST DWORD *pdwAdjacency, + FLOAT fPartialEdgeThreshold, + FLOAT fSingularPointThreshold, + FLOAT fNormalEdgeThreshold, + ID3DXMesh **ppMeshOut, + ID3DXBuffer **ppVertexMapping); + + +//D3DXComputeTangent +// +//Computes the Tangent vectors for the TexStage texture coordinates +//and places the results in the TANGENT[TangentIndex] specified in the meshes' DECL +//puts the binorm in BINORM[BinormIndex] also specified in the decl. +// +//If neither the binorm or the tangnet are in the meshes declaration, +//the function will fail. +// +//If a tangent or Binorm field is in the Decl, but the user does not +//wish D3DXComputeTangent to replace them, then D3DX_DEFAULT specified +//in the TangentIndex or BinormIndex will cause it to ignore the specified +//semantic. +// +//Wrap should be specified if the texture coordinates wrap. + +HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH Mesh, + DWORD TexStage, + DWORD TangentIndex, + DWORD BinormIndex, + DWORD Wrap, + CONST DWORD *pAdjacency); + +//============================================================================ +// +// UVAtlas apis +// +//============================================================================ +typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(FLOAT fPercentDone, LPVOID lpUserContext); + +// This function creates atlases for meshes. There are two modes of operation, +// either based on the number of charts, or the maximum allowed stretch. If the +// maximum allowed stretch is 0, then each triangle will likely be in its own +// chart. + +// +// The parameters are as follows: +// pMesh - Input mesh to calculate an atlas for. This must have a position +// channel and at least a 2-d texture channel. +// uMaxChartNumber - The maximum number of charts required for the atlas. +// If this is 0, it will be parameterized based solely on +// stretch. +// fMaxStretch - The maximum amount of stretch, if 0, no stretching is allowed, +// if 1, then any amount of stretching is allowed. +// uWidth - The width of the texture the atlas will be used on. +// uHeight - The height of the texture the atlas will be used on. +// fGutter - The minimum distance, in texels between two charts on the atlas. +// this gets scaled by the width, so if fGutter is 2.5, and it is +// used on a 512x512 texture, then the minimum distance will be +// 2.5 / 512 in u-v space. +// dwTextureIndex - Specifies which texture coordinate to write to in the +// output mesh (which is cloned from the input mesh). Useful +// if your vertex has multiple texture coordinates. +// pdwAdjacency - a pointer to an array with 3 DWORDs per face, indicating +// which triangles are adjacent to each other. +// pdwFalseEdgeAdjacency - a pointer to an array with 3 DWORDS per face, indicating +// at each face, whether an edge is a false edge or not (using +// the same ordering as the adjacency data structure). If this +// is NULL, then it is assumed that there are no false edges. If +// not NULL, then a non-false edge is indicated by -1 and a false +// edge is indicated by any other value (it is not required, but +// it may be useful for the caller to use the original adjacency +// value). This allows you to parameterize a mesh of quads, and +// the edges down the middle of each quad will not be cut when +// parameterizing the mesh. +// pfIMTArray - a pointer to an array with 3 FLOATs per face, describing the +// integrated metric tensor for that face. This lets you control +// the way this triangle may be stretched in the atlas. The IMT +// passed in will be 3 floats (a,b,c) and specify a symmetric +// matrix (a b) that, given a vector (s,t), specifies the +// (b c) +// distance between a vector v1 and a vector v2 = v1 + (s,t) as +// sqrt((s, t) * M * (s, t)^T). +// In other words, this lets one specify the magnitude of the +// stretch in an arbitrary direction in u-v space. For example +// if a = b = c = 1, then this scales the vector (1,1) by 2, and +// the vector (1,-1) by 0. Note that this is multiplying the edge +// length by the square of the matrix, so if you want the face to +// stretch to twice its +// size with no shearing, the IMT value should be (2, 0, 2), which +// is just the identity matrix times 2. +// Note that this assumes you have an orientation for the triangle +// in some 2-D space. For D3DXUVAtlas, this space is created by +// letting S be the direction from the first to the second +// vertex, and T be the cross product between the normal and S. +// +// pStatusCallback - Since the atlas creation process can be very CPU intensive, +// this allows the programmer to specify a function to be called +// periodically, similarly to how it is done in the PRT simulation +// engine. +// fCallbackFrequency - This lets you specify how often the callback will be +// called. A decent default should be 0.0001f. +// pUserContext - a void pointer to be passed back to the callback function +// dwOptions - A combination of flags in the D3DXUVATLAS enum +// ppMeshOut - A pointer to a location to store a pointer for the newly created +// mesh. +// ppFacePartitioning - A pointer to a location to store a pointer for an array, +// one DWORD per face, giving the final partitioning +// created by the atlasing algorithm. +// ppVertexRemapArray - A pointer to a location to store a pointer for an array, +// one DWORD per vertex, giving the vertex it was copied +// from, if any vertices needed to be split. +// pfMaxStretchOut - A location to store the maximum stretch resulting from the +// atlasing algorithm. +// puNumChartsOut - A location to store the number of charts created, or if the +// maximum number of charts was too low, this gives the minimum +// number of charts needed to create an atlas. + +HRESULT WINAPI D3DXUVAtlasCreate(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This has the same exact arguments as Create, except that it does not perform the +// final packing step. This method allows one to get a partitioning out, and possibly +// modify it before sending it to be repacked. Note that if you change the +// partitioning, you'll also need to calculate new texture coordinates for any faces +// that have switched charts. +// +// The partition result adjacency output parameter is meant to be passed to the +// UVAtlasPack function, this adjacency cuts edges that are between adjacent +// charts, and also can include cuts inside of a chart in order to make it +// equivalent to a disc. For example: +// +// _______ +// | ___ | +// | |_| | +// |_____| +// +// In order to make this equivalent to a disc, we would need to add a cut, and it +// Would end up looking like: +// _______ +// | ___ | +// | |_|_| +// |_____| +// +// The resulting partition adjacency parameter cannot be NULL, because it is +// required for the packing step. + + + +HRESULT WINAPI D3DXUVAtlasPartition(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + LPD3DXBUFFER *ppPartitionResultAdjacency, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This takes the face partitioning result from Partition and packs it into an +// atlas of the given size. pdwPartitionResultAdjacency should be derived from +// the adjacency returned from the partition step. This value cannot be NULL +// because Pack needs to know where charts were cut in the partition step in +// order to find the edges of each chart. +// The options parameter is currently reserved. +HRESULT WINAPI D3DXUVAtlasPack(ID3DXMesh *pMesh, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwPartitionResultAdjacency, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXBUFFER pFacePartitioning); + + +//============================================================================ +// +// IMT Calculation apis +// +// These functions all compute the Integrated Metric Tensor for use in the +// UVAtlas API. They all calculate the IMT with respect to the canonical +// triangle, where the coordinate system is set up so that the u axis goes +// from vertex 0 to 1 and the v axis is N x u. So, for example, the second +// vertex's canonical uv coordinates are (d,0) where d is the distance between +// vertices 0 and 1. This way the IMT does not depend on the parameterization +// of the mesh, and if the signal over the surface doesn't change, then +// the IMT doesn't need to be recalculated. +//============================================================================ + +// This callback is used by D3DXComputeIMTFromSignal. +// +// uv - The texture coordinate for the vertex. +// uPrimitiveID - Face ID of the triangle on which to compute the signal. +// uSignalDimension - The number of floats to store in pfSignalOut. +// pUserData - The pUserData pointer passed in to ComputeIMTFromSignal. +// pfSignalOut - A pointer to where to store the signal data. +typedef HRESULT (WINAPI* LPD3DXIMTSIGNALCALLBACK) + (CONST D3DXVECTOR2 *uv, + UINT uPrimitiveID, + UINT uSignalDimension, + VOID *pUserData, + FLOAT *pfSignalOut); + +// This function is used to calculate the IMT from per vertex data. It sets +// up a linear system over the triangle, solves for the jacobian J, then +// constructs the IMT from that (J^TJ). +// This function allows you to calculate the IMT based off of any value in a +// mesh (color, normal, etc) by specifying the correct stride of the array. +// The IMT computed will cause areas of the mesh that have similar values to +// take up less space in the texture. +// +// pMesh - The mesh to calculate the IMT for. +// pVertexSignal - A float array of size uSignalStride * v, where v is the +// number of vertices in the mesh. +// uSignalDimension - How many floats per vertex to use in calculating the IMT. +// uSignalStride - The number of bytes per vertex in the array. This must be +// a multiple of sizeof(float) +// ppIMTData - Where to store the buffer holding the IMT data + +HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal ( + LPD3DXMESH pMesh, + CONST FLOAT *pfVertexSignal, // uSignalDimension floats per vertex + UINT uSignalDimension, + UINT uSignalStride, // stride of signal in bytes + DWORD dwOptions, // reserved for future use + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from data that varies over the +// surface of the mesh (generally at a higher frequency than vertex data). +// This function requires the mesh to already be parameterized (so it already +// has texture coordinates). It allows the user to define a signal arbitrarily +// over the surface of the mesh. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// uSignalDimension - How many components there are in the signal. +// fMaxUVDistance - The subdivision will continue until the distance between +// all vertices is at most fMaxUVDistance. +// dwOptions - reserved for future use +// pSignalCallback - The callback to use to get the signal. +// pUserData - A pointer that will be passed in to the callback. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + UINT uSignalDimension, + FLOAT fMaxUVDistance, + DWORD dwOptions, // reserved for future use + LPD3DXIMTSIGNALCALLBACK pSignalCallback, + VOID *pUserData, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from texture data. Given a texture +// that maps over the surface of the mesh, the algorithm computes the IMT for +// each face. This will cause large areas that are very similar to take up less +// room when parameterized with UVAtlas. The texture is assumed to be +// interpolated over the mesh bilinearly. +// +// pMesh - The mesh to calculate the IMT for. +// pTexture - The texture to load data from. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// dwOptions - Combination of one or more D3DXIMT flags. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromTexture ( + LPD3DXMESH pMesh, + LPDIRECT3DTEXTURE9 pTexture, + DWORD dwTextureIndex, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is very similar to ComputeIMTFromTexture, but it uses a +// float array to pass in the data, and it can calculate higher dimensional +// values than 4. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// pfFloatArray - a pointer to a float array of size +// uWidth*uHeight*uComponents +// uWidth - The width of the texture +// uHeight - The height of the texture +// uSignalDimension - The number of floats per texel in the signal +// uComponents - The number of floats in each texel +// dwOptions - Combination of one or more D3DXIMT flags +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + FLOAT *pfTexelSignal, + UINT uWidth, + UINT uHeight, + UINT uSignalDimension, + UINT uComponents, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +HRESULT WINAPI + D3DXConvertMeshSubsetToSingleStrip( + LPD3DXBASEMESH MeshIn, + DWORD AttribId, + DWORD IBOptions, + LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, + DWORD *pNumIndices); + +HRESULT WINAPI + D3DXConvertMeshSubsetToStrips( + LPD3DXBASEMESH MeshIn, + DWORD AttribId, + DWORD IBOptions, + LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, + DWORD *pNumIndices, + LPD3DXBUFFER *ppStripLengths, + DWORD *pNumStrips); + + +//============================================================================ +// +// D3DXOptimizeFaces: +// -------------------- +// Generate a face remapping for a triangle list that more effectively utilizes +// vertex caches. This optimization is identical to the one provided +// by ID3DXMesh::Optimize with the hardware independent option enabled. +// +// Parameters: +// pbIndices +// Triangle list indices to use for generating a vertex ordering +// NumFaces +// Number of faces in the triangle list +// NumVertices +// Number of vertices referenced by the triangle list +// b32BitIndices +// TRUE if indices are 32 bit, FALSE if indices are 16 bit +// pFaceRemap +// Destination buffer to store face ordering +// The number stored for a given element is where in the new ordering +// the face will have come from. See ID3DXMesh::Optimize for more info. +// +//============================================================================ +HRESULT WINAPI + D3DXOptimizeFaces( + LPCVOID pbIndices, + UINT cFaces, + UINT cVertices, + BOOL b32BitIndices, + DWORD* pFaceRemap); + +//============================================================================ +// +// D3DXOptimizeVertices: +// -------------------- +// Generate a vertex remapping to optimize for in order use of vertices for +// a given set of indices. This is commonly used after applying the face +// remap generated by D3DXOptimizeFaces +// +// Parameters: +// pbIndices +// Triangle list indices to use for generating a vertex ordering +// NumFaces +// Number of faces in the triangle list +// NumVertices +// Number of vertices referenced by the triangle list +// b32BitIndices +// TRUE if indices are 32 bit, FALSE if indices are 16 bit +// pVertexRemap +// Destination buffer to store vertex ordering +// The number stored for a given element is where in the new ordering +// the vertex will have come from. See ID3DXMesh::Optimize for more info. +// +//============================================================================ +HRESULT WINAPI + D3DXOptimizeVertices( + LPCVOID pbIndices, + UINT cFaces, + UINT cVertices, + BOOL b32BitIndices, + DWORD* pVertexRemap); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +//=========================================================================== +// +// Data structures for Spherical Harmonic Precomputation +// +// +//============================================================================ + +typedef enum _D3DXSHCOMPRESSQUALITYTYPE { + D3DXSHCQUAL_FASTLOWQUALITY = 1, + D3DXSHCQUAL_SLOWHIGHQUALITY = 2, + D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff +} D3DXSHCOMPRESSQUALITYTYPE; + +typedef enum _D3DXSHGPUSIMOPT { + D3DXSHGPUSIMOPT_SHADOWRES256 = 1, + D3DXSHGPUSIMOPT_SHADOWRES512 = 0, + D3DXSHGPUSIMOPT_SHADOWRES1024 = 2, + D3DXSHGPUSIMOPT_SHADOWRES2048 = 3, + + D3DXSHGPUSIMOPT_HIGHQUALITY = 4, + + D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff +} D3DXSHGPUSIMOPT; + +// for all properties that are colors the luminance is computed +// if the simulator is run with a single channel using the following +// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 + +typedef struct _D3DXSHMATERIAL { + D3DCOLORVALUE Diffuse; // Diffuse albedo of the surface. (Ignored if object is a Mirror) + BOOL bMirror; // Must be set to FALSE. bMirror == TRUE not currently supported + BOOL bSubSurf; // true if the object does subsurface scattering - can't do this and be a mirror + + // subsurface scattering parameters + FLOAT RelativeIndexOfRefraction; + D3DCOLORVALUE Absorption; + D3DCOLORVALUE ReducedScattering; + +} D3DXSHMATERIAL; + +// allocated in D3DXSHPRTCompSplitMeshSC +// vertices are duplicated into multiple super clusters but +// only have a valid status in one super cluster (fill in the rest) + +typedef struct _D3DXSHPRTSPLITMESHVERTDATA { + UINT uVertRemap; // vertex in original mesh this corresponds to + UINT uSubCluster; // cluster index relative to super cluster + UCHAR ucVertStatus; // 1 if vertex has valid data, 0 if it is "fill" +} D3DXSHPRTSPLITMESHVERTDATA; + +// used in D3DXSHPRTCompSplitMeshSC +// information for each super cluster that maps into face/vert arrays + +typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA { + UINT uVertStart; // initial index into remapped vertex array + UINT uVertLength; // number of vertices in this super cluster + + UINT uFaceStart; // initial index into face array + UINT uFaceLength; // number of faces in this super cluster + + UINT uClusterStart; // initial index into cluster array + UINT uClusterLength; // number of clusters in this super cluster +} D3DXSHPRTSPLITMESHCLUSTERDATA; + +// call back function for simulator +// return S_OK to keep running the simulator - anything else represents +// failure and the simulator will abort. + +typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float fPercentDone, LPVOID lpUserContext); + +// interfaces for PRT buffers/simulator + +// GUIDs +// {F1827E47-00A8-49cd-908C-9D11955F8728} +DEFINE_GUID(IID_ID3DXPRTBuffer, +0xf1827e47, 0xa8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28); + +// {A758D465-FE8D-45ad-9CF0-D01E56266A07} +DEFINE_GUID(IID_ID3DXPRTCompBuffer, +0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x7); + +// {838F01EC-9729-4527-AADB-DF70ADE7FEA9} +DEFINE_GUID(IID_ID3DXTextureGutterHelper, +0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9); + +// {683A4278-CD5F-4d24-90AD-C4E1B6855D53} +DEFINE_GUID(IID_ID3DXPRTEngine, +0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53); + +// interface defenitions + +typedef interface ID3DXTextureGutterHelper ID3DXTextureGutterHelper; +typedef interface ID3DXPRTBuffer ID3DXPRTBuffer; + +#undef INTERFACE +#define INTERFACE ID3DXPRTBuffer + +// Buffer interface - contains "NumSamples" samples +// each sample in memory is stored as NumCoeffs scalars per channel (1 or 3) +// Same interface is used for both Vertex and Pixel PRT buffers + +DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPRTBuffer + STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; + STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; + STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; + + STDMETHOD_(BOOL, IsTexture)(THIS) PURE; + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + // changes the number of samples allocated in the buffer + STDMETHOD(Resize)(THIS_ UINT NewSize) PURE; + + // ppData will point to the memory location where sample Start begins + // pointer is valid for at least NumSamples samples + STDMETHOD(LockBuffer)(THIS_ UINT Start, UINT NumSamples, FLOAT **ppData) PURE; + STDMETHOD(UnlockBuffer)(THIS) PURE; + + // every scalar in buffer is multiplied by Scale + STDMETHOD(ScaleBuffer)(THIS_ FLOAT Scale) PURE; + + // every scalar contains the sum of this and pBuffers values + // pBuffer must have the same storage class/dimensions + STDMETHOD(AddBuffer)(THIS_ LPD3DXPRTBUFFER pBuffer) PURE; + + // GutterHelper (described below) will fill in the gutter + // regions of a texture by interpolating "internal" values + STDMETHOD(AttachGH)(THIS_ LPD3DXTEXTUREGUTTERHELPER) PURE; + STDMETHOD(ReleaseGH)(THIS) PURE; + + // Evaluates attached gutter helper on the contents of this buffer + STDMETHOD(EvalGH)(THIS) PURE; + + // extracts a given channel into texture pTexture + // NumCoefficients starting from StartCoefficient are copied + STDMETHOD(ExtractTexture)(THIS_ UINT Channel, UINT StartCoefficient, + UINT NumCoefficients, LPDIRECT3DTEXTURE9 pTexture) PURE; + + // extracts NumCoefficients coefficients into mesh - only applicable on single channel + // buffers, otherwise just lockbuffer and copy data. With SHPRT data NumCoefficients + // should be Order^2 + STDMETHOD(ExtractToMesh)(THIS_ UINT NumCoefficients, D3DDECLUSAGE Usage, UINT UsageIndexStart, + LPD3DXMESH pScene) PURE; + +}; + +typedef interface ID3DXPRTCompBuffer ID3DXPRTCompBuffer; +typedef interface ID3DXPRTCompBuffer *LPD3DXPRTCOMPBUFFER; + +#undef INTERFACE +#define INTERFACE ID3DXPRTCompBuffer + +// compressed buffers stored a compressed version of a PRTBuffer + +DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DPRTCompBuffer + + // NumCoeffs and NumChannels are properties of input buffer + STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; + STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; + STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; + + STDMETHOD_(BOOL, IsTexture)(THIS) PURE; + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + // number of clusters, and PCA vectors per-cluster + STDMETHOD_(UINT, GetNumClusters)(THIS) PURE; + STDMETHOD_(UINT, GetNumPCA)(THIS) PURE; + + // normalizes PCA weights so that they are between [-1,1] + // basis vectors are modified to reflect this + STDMETHOD(NormalizeData)(THIS) PURE; + + // copies basis vectors for cluster "Cluster" into pClusterBasis + // (NumPCA+1)*NumCoeffs*NumChannels floats + STDMETHOD(ExtractBasis)(THIS_ UINT Cluster, FLOAT *pClusterBasis) PURE; + + // UINT per sample - which cluster it belongs to + STDMETHOD(ExtractClusterIDs)(THIS_ UINT *pClusterIDs) PURE; + + // copies NumExtract PCA projection coefficients starting at StartPCA + // into pPCACoefficients - NumSamples*NumExtract floats copied + STDMETHOD(ExtractPCA)(THIS_ UINT StartPCA, UINT NumExtract, FLOAT *pPCACoefficients) PURE; + + // copies NumPCA projection coefficients starting at StartPCA + // into pTexture - should be able to cope with signed formats + STDMETHOD(ExtractTexture)(THIS_ UINT StartPCA, UINT NumpPCA, + LPDIRECT3DTEXTURE9 pTexture) PURE; + + // copies NumPCA projection coefficients into mesh pScene + // Usage is D3DDECLUSAGE where coefficients are to be stored + // UsageIndexStart is starting index + STDMETHOD(ExtractToMesh)(THIS_ UINT NumPCA, D3DDECLUSAGE Usage, UINT UsageIndexStart, + LPD3DXMESH pScene) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXTextureGutterHelper + +// ID3DXTextureGutterHelper will build and manage +// "gutter" regions in a texture - this will allow for +// bi-linear interpolation to not have artifacts when rendering +// It generates a map (in texture space) where each texel +// is in one of 3 states: +// 0 Invalid - not used at all +// 1 Inside triangle +// 2 Gutter texel +// 4 represents a gutter texel that will be computed during PRT +// For each Inside/Gutter texel it stores the face it +// belongs to and barycentric coordinates for the 1st two +// vertices of that face. Gutter vertices are assigned to +// the closest edge in texture space. +// +// When used with PRT this requires a unique parameterization +// of the model - every texel must correspond to a single point +// on the surface of the model and vice versa + +DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXTextureGutterHelper + + // dimensions of texture this is bound too + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + + // Applying gutters recomputes all of the gutter texels of class "2" + // based on texels of class "1" or "4" + + // Applies gutters to a raw float buffer - each texel is NumCoeffs floats + // Width and Height must match GutterHelper + STDMETHOD(ApplyGuttersFloat)(THIS_ FLOAT *pDataIn, UINT NumCoeffs, UINT Width, UINT Height); + + // Applies gutters to pTexture + // Dimensions must match GutterHelper + STDMETHOD(ApplyGuttersTex)(THIS_ LPDIRECT3DTEXTURE9 pTexture); + + // Applies gutters to a D3DXPRTBuffer + // Dimensions must match GutterHelper + STDMETHOD(ApplyGuttersPRT)(THIS_ LPD3DXPRTBUFFER pBuffer); + + // Resamples a texture from a mesh onto this gutterhelpers + // parameterization. It is assumed that the UV coordinates + // for this gutter helper are in TEXTURE 0 (usage/usage index) + // and the texture coordinates should all be within [0,1] for + // both sets. + // + // pTextureIn - texture represented using parameterization in pMeshIn + // pMeshIn - Mesh with texture coordinates that represent pTextureIn + // pTextureOut texture coordinates are assumed to be in + // TEXTURE 0 + // Usage - field in DECL for pMeshIn that stores texture coordinates + // for pTextureIn + // UsageIndex - which index for Usage above for pTextureIn + // pTextureOut- Resampled texture + // + // Usage would generally be D3DDECLUSAGE_TEXCOORD and UsageIndex other than zero + STDMETHOD(ResampleTex)(THIS_ LPDIRECT3DTEXTURE9 pTextureIn, + LPD3DXMESH pMeshIn, + D3DDECLUSAGE Usage, UINT UsageIndex, + LPDIRECT3DTEXTURE9 pTextureOut); + + // the routines below provide access to the data structures + // used by the Apply functions + + // face map is a UINT per texel that represents the + // face of the mesh that texel belongs too - + // only valid if same texel is valid in pGutterData + // pFaceData must be allocated by the user + STDMETHOD(GetFaceMap)(THIS_ UINT *pFaceData) PURE; + + // BaryMap is a D3DXVECTOR2 per texel + // the 1st two barycentric coordinates for the corresponding + // face (3rd weight is always 1-sum of first two) + // only valid if same texel is valid in pGutterData + // pBaryData must be allocated by the user + STDMETHOD(GetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; + + // TexelMap is a D3DXVECTOR2 per texel that + // stores the location in pixel coordinates where the + // corresponding texel is mapped + // pTexelData must be allocated by the user + STDMETHOD(GetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; + + // GutterMap is a BYTE per texel + // 0/1/2 for Invalid/Internal/Gutter texels + // 4 represents a gutter texel that will be computed + // during PRT + // pGutterData must be allocated by the user + STDMETHOD(GetGutterMap)(THIS_ BYTE *pGutterData) PURE; + + // face map is a UINT per texel that represents the + // face of the mesh that texel belongs too - + // only valid if same texel is valid in pGutterData + STDMETHOD(SetFaceMap)(THIS_ UINT *pFaceData) PURE; + + // BaryMap is a D3DXVECTOR2 per texel + // the 1st two barycentric coordinates for the corresponding + // face (3rd weight is always 1-sum of first two) + // only valid if same texel is valid in pGutterData + STDMETHOD(SetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; + + // TexelMap is a D3DXVECTOR2 per texel that + // stores the location in pixel coordinates where the + // corresponding texel is mapped + STDMETHOD(SetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; + + // GutterMap is a BYTE per texel + // 0/1/2 for Invalid/Internal/Gutter texels + // 4 represents a gutter texel that will be computed + // during PRT + STDMETHOD(SetGutterMap)(THIS_ BYTE *pGutterData) PURE; +}; + + +typedef interface ID3DXPRTEngine ID3DXPRTEngine; +typedef interface ID3DXPRTEngine *LPD3DXPRTENGINE; + +#undef INTERFACE +#define INTERFACE ID3DXPRTEngine + +// ID3DXPRTEngine is used to compute a PRT simulation +// Use the following steps to compute PRT for SH +// (1) create an interface (which includes a scene) +// (2) call SetSamplingInfo +// (3) [optional] Set MeshMaterials/albedo's (required if doing bounces) +// (4) call ComputeDirectLightingSH +// (5) [optional] call ComputeBounce +// repeat step 5 for as many bounces as wanted. +// if you want to model subsurface scattering you +// need to call ComputeSS after direct lighting and +// each bounce. +// If you want to bake the albedo into the PRT signal, you +// must call MutliplyAlbedo, otherwise the user has to multiply +// the albedo themselves. Not multiplying the albedo allows you +// to model albedo variation at a finer scale then illumination, and +// can result in better compression results. +// Luminance values are computed from RGB values using the following +// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 + +DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPRTEngine + + // This sets a material per attribute in the scene mesh and it is + // the only way to specify subsurface scattering parameters. if + // bSetAlbedo is FALSE, NumChannels must match the current + // configuration of the PRTEngine. If you intend to change + // NumChannels (through some other SetAlbedo function) it must + // happen before SetMeshMaterials is called. + // + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // bSetAlbedo sets albedo from material if TRUE - which clobbers per texel/vertex + // albedo that might have been set before. FALSE won't clobber. + // fLengthScale is used for subsurface scattering - scene is mapped into a 1mm unit cube + // and scaled by this amount + STDMETHOD(SetMeshMaterials)(THIS_ CONST D3DXSHMATERIAL **ppMaterials, UINT NumMeshes, + UINT NumChannels, BOOL bSetAlbedo, FLOAT fLengthScale) PURE; + + // setting albedo per-vertex or per-texel over rides the albedos stored per mesh + // but it does not over ride any other settings + + // sets an albedo to be used per vertex - the albedo is represented as a float + // pDataIn input pointer (pointint to albedo of 1st sample) + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // Stride - stride in bytes to get to next samples albedo + STDMETHOD(SetPerVertexAlbedo)(THIS_ CONST VOID *pDataIn, UINT NumChannels, UINT Stride) PURE; + + // represents the albedo per-texel instead of per-vertex (even if per-vertex PRT is used) + // pAlbedoTexture - texture that stores the albedo (dimension arbitrary) + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // pGH - optional gutter helper, otherwise one is constructed in computation routines and + // destroyed (if not attached to buffers) + STDMETHOD(SetPerTexelAlbedo)(THIS_ LPDIRECT3DTEXTURE9 pAlbedoTexture, + UINT NumChannels, + LPD3DXTEXTUREGUTTERHELPER pGH) PURE; + + // gets the per-vertex albedo + STDMETHOD(GetVertexAlbedo)(THIS_ D3DXCOLOR *pVertColors, UINT NumVerts) PURE; + + // If pixel PRT is being computed normals default to ones that are interpolated + // from the vertex normals. This specifies a texture that stores an object + // space normal map instead (must use a texture format that can represent signed values) + // pNormalTexture - normal map, must be same dimensions as PRTBuffers, signed + STDMETHOD(SetPerTexelNormal)(THIS_ LPDIRECT3DTEXTURE9 pNormalTexture) PURE; + + // Copies per-vertex albedo from mesh + // pMesh - mesh that represents the scene. It must have the same + // properties as the mesh used to create the PRTEngine + // Usage - D3DDECLUSAGE to extract albedos from + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + STDMETHOD(ExtractPerVertexAlbedo)(THIS_ LPD3DXMESH pMesh, + D3DDECLUSAGE Usage, + UINT NumChannels) PURE; + + // Resamples the input buffer into the output buffer + // can be used to move between per-vertex and per-texel buffers. This can also be used + // to convert single channel buffers to 3-channel buffers and vice-versa. + STDMETHOD(ResampleBuffer)(THIS_ LPD3DXPRTBUFFER pBufferIn, LPD3DXPRTBUFFER pBufferOut) PURE; + + // Returns the scene mesh - including modifications from adaptive spatial sampling + // The returned mesh only has positions, normals and texture coordinates (if defined) + // pD3DDevice - d3d device that will be used to allocate the mesh + // pFaceRemap - each face has a pointer back to the face on the original mesh that it comes from + // if the face hasn't been subdivided this will be an identity mapping + // pVertRemap - each vertex contains 3 vertices that this is a linear combination of + // pVertWeights - weights for each of above indices (sum to 1.0f) + // ppMesh - mesh that will be allocated and filled + STDMETHOD(GetAdaptedMesh)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice,UINT *pFaceRemap, UINT *pVertRemap, FLOAT *pfVertWeights, LPD3DXMESH *ppMesh) PURE; + + // Number of vertices currently allocated (includes new vertices from adaptive sampling) + STDMETHOD_(UINT, GetNumVerts)(THIS) PURE; + // Number of faces currently allocated (includes new faces) + STDMETHOD_(UINT, GetNumFaces)(THIS) PURE; + + // Sets the Minimum/Maximum intersection distances, this can be used to control + // maximum distance that objects can shadow/reflect light, and help with "bad" + // art that might have near features that you don't want to shadow. This does not + // apply for GPU simulations. + // fMin - minimum intersection distance, must be positive and less than fMax + // fMax - maximum intersection distance, if 0.0f use the previous value, otherwise + // must be strictly greater than fMin + STDMETHOD(SetMinMaxIntersection)(THIS_ FLOAT fMin, FLOAT fMax) PURE; + + // This will subdivide faces on a mesh so that adaptively simulations can + // use a more conservative threshold (it won't miss features.) + // MinEdgeLength - minimum edge length that will be generated, if 0.0f a + // reasonable default will be used + // MaxSubdiv - maximum level of subdivision, if 0 is specified a default + // value will be used (5) + STDMETHOD(RobustMeshRefine)(THIS_ FLOAT MinEdgeLength, UINT MaxSubdiv) PURE; + + // This sets to sampling information used by the simulator. Adaptive sampling + // parameters are currently ignored. + // NumRays - number of rays to shoot per sample + // UseSphere - if TRUE uses spherical samples, otherwise samples over + // the hemisphere. Should only be used with GPU and Vol computations + // UseCosine - if TRUE uses a cosine weighting - not used for Vol computations + // or if only the visiblity function is desired + // Adaptive - if TRUE adaptive sampling (angular) is used + // AdaptiveThresh - threshold used to terminate adaptive angular sampling + // ignored if adaptive sampling is not set + STDMETHOD(SetSamplingInfo)(THIS_ UINT NumRays, + BOOL UseSphere, + BOOL UseCosine, + BOOL Adaptive, + FLOAT AdaptiveThresh) PURE; + + // Methods that compute the direct lighting contribution for objects + // always represente light using spherical harmonics (SH) + // the albedo is not multiplied by the signal - it just integrates + // incoming light. If NumChannels is not 1 the vector is replicated + // + // SHOrder - order of SH to use + // pDataOut - PRT buffer that is generated. Can be single channel + STDMETHOD(ComputeDirectLightingSH)(THIS_ UINT SHOrder, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Adaptive variant of above function. This will refine the mesh + // generating new vertices/faces to approximate the PRT signal + // more faithfully. + // SHOrder - order of SH to use + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - PRT buffer that is generated. Can be single channel. + STDMETHOD(ComputeDirectLightingSHAdaptive)(THIS_ UINT SHOrder, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Function that computes the direct lighting contribution for objects + // light is always represented using spherical harmonics (SH) + // This is done on the GPU and is much faster then using the CPU. + // The albedo is not multiplied by the signal - it just integrates + // incoming light. If NumChannels is not 1 the vector is replicated. + // ZBias/ZAngleBias are akin to parameters used with shadow zbuffers. + // A reasonable default for both values is 0.005, but the user should + // experiment (ZAngleBias can be zero, ZBias should not be.) + // Callbacks should not use the Direct3D9Device the simulator is using. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // + // pD3DDevice - device used to run GPU simulator - must support PS2.0 + // and FP render targets + // Flags - parameters for the GPU simulator, combination of one or more + // D3DXSHGPUSIMOPT flags. Only one SHADOWRES setting should be set and + // the defaults is 512 + // SHOrder - order of SH to use + // ZBias - bias in normal direction (for depth test) + // ZAngleBias - scaled by one minus cosine of angle with light (offset in depth) + // pDataOut - PRT buffer that is filled in. Can be single channel + STDMETHOD(ComputeDirectLightingSHGPU)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice, + UINT Flags, + UINT SHOrder, + FLOAT ZBias, + FLOAT ZAngleBias, + LPD3DXPRTBUFFER pDataOut) PURE; + + + // Functions that computes subsurface scattering (using material properties) + // Albedo is not multiplied by result. This only works for per-vertex data + // use ResampleBuffer to move per-vertex data into a texture and back. + // + // pDataIn - input data (previous bounce) + // pDataOut - result of subsurface scattering simulation + // pDataTotal - [optional] results can be summed into this buffer + STDMETHOD(ComputeSS)(THIS_ LPD3DXPRTBUFFER pDataIn, + LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + + // Adaptive version of ComputeSS. + // + // pDataIn - input data (previous bounce) + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - result of subsurface scattering simulation + // pDataTotal - [optional] results can be summed into this buffer + STDMETHOD(ComputeSSAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + + // computes a single bounce of inter-reflected light + // works for SH based PRT or generic lighting + // Albedo is not multiplied by result + // + // pDataIn - previous bounces data + // pDataOut - PRT buffer that is generated + // pDataTotal - [optional] can be used to keep a running sum + STDMETHOD(ComputeBounce)(THIS_ LPD3DXPRTBUFFER pDataIn, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Adaptive version of above function. + // + // pDataIn - previous bounces data, can be single channel + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - PRT buffer that is generated + // pDataTotal - [optional] can be used to keep a running sum + STDMETHOD(ComputeBounceAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Computes projection of distant SH radiance into a local SH radiance + // function. This models how direct lighting is attenuated by the + // scene and is a form of "neighborhood transfer." The result is + // a linear operator (matrix) at every sample point, if you multiply + // this matrix by the distant SH lighting coefficients you get an + // approximation of the local incident radiance function from + // direct lighting. These resulting lighting coefficients can + // than be projected into another basis or used with any rendering + // technique that uses spherical harmonics as input. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // Generates SHOrderIn*SHOrderIn*SHOrderOut*SHOrderOut scalars + // per channel at each sample location. + // + // SHOrderIn - Order of the SH representation of distant lighting + // SHOrderOut - Order of the SH representation of local lighting + // NumVolSamples - Number of sample locations + // pSampleLocs - position of sample locations + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeVolumeSamplesDirectSH)(THIS_ UINT SHOrderIn, + UINT SHOrderOut, + UINT NumVolSamples, + CONST D3DXVECTOR3 *pSampleLocs, + LPD3DXPRTBUFFER pDataOut) PURE; + + // At each sample location computes a linear operator (matrix) that maps + // the representation of source radiance (NumCoeffs in pSurfDataIn) + // into a local incident radiance function approximated with spherical + // harmonics. For example if a light map data is specified in pSurfDataIn + // the result is an SH representation of the flow of light at each sample + // point. If PRT data for an outdoor scene is used, each sample point + // contains a matrix that models how distant lighting bounces of the objects + // in the scene and arrives at the given sample point. Combined with + // ComputeVolumeSamplesDirectSH this gives the complete representation for + // how light arrives at each sample point parameterized by distant lighting. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // Generates pSurfDataIn->NumCoeffs()*SHOrder*SHOrder scalars + // per channel at each sample location. + // + // pSurfDataIn - previous bounce data + // SHOrder - order of SH to generate projection with + // NumVolSamples - Number of sample locations + // pSampleLocs - position of sample locations + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeVolumeSamples)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, + UINT SHOrder, + UINT NumVolSamples, + CONST D3DXVECTOR3 *pSampleLocs, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Computes direct lighting (SH) for a point not on the mesh + // with a given normal - cannot use texture buffers. + // + // SHOrder - order of SH to use + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeSurfSamplesDirectSH)(THIS_ UINT SHOrder, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut) PURE; + + + // given the solution for PRT or light maps, computes transfer vector at arbitrary + // position/normal pairs in space + // + // pSurfDataIn - input data + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + // pDataTotal - optional buffer to sum results into - can be NULL + STDMETHOD(ComputeSurfSamplesBounce)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Frees temporary data structures that can be created for subsurface scattering + // this data is freed when the PRTComputeEngine is freed and is lazily created + STDMETHOD(FreeSSData)(THIS) PURE; + + // Frees temporary data structures that can be created for bounce simulations + // this data is freed when the PRTComputeEngine is freed and is lazily created + STDMETHOD(FreeBounceData)(THIS) PURE; + + // This computes the Local Deformable PRT (LDPRT) coefficients relative to the + // per sample normals that minimize error in a least squares sense with respect + // to the input PRT data set. These coefficients can be used with skinned/transformed + // normals to model global effects with dynamic objects. Shading normals can + // optionally be solved for - these normals (along with the LDPRT coefficients) can + // more accurately represent the PRT signal. The coefficients are for zonal + // harmonics oriented in the normal/shading normal direction. + // + // pDataIn - SH PRT dataset that is input + // SHOrder - Order of SH to compute conv coefficients for + // pNormOut - Optional array of vectors (passed in) that will be filled with + // "shading normals", LDPRT coefficients are optimized for + // these normals. This array must be the same size as the number of + // samples in pDataIn + // pDataOut - Output buffer (SHOrder zonal harmonic coefficients per channel per sample) + STDMETHOD(ComputeLDPRTCoeffs)(THIS_ LPD3DXPRTBUFFER pDataIn, + UINT SHOrder, + D3DXVECTOR3 *pNormOut, + LPD3DXPRTBUFFER pDataOut) PURE; + + // scales all the samples associated with a given sub mesh + // can be useful when using subsurface scattering + // fScale - value to scale each vector in submesh by + STDMETHOD(ScaleMeshChunk)(THIS_ UINT uMeshChunk, FLOAT fScale, LPD3DXPRTBUFFER pDataOut) PURE; + + // mutliplies each PRT vector by the albedo - can be used if you want to have the albedo + // burned into the dataset, often better not to do this. If this is not done the user + // must mutliply the albedo themselves when rendering - just multiply the albedo times + // the result of the PRT dot product. + // If pDataOut is a texture simulation result and there is an albedo texture it + // must be represented at the same resolution as the simulation buffer. You can use + // LoadSurfaceFromSurface and set a new albedo texture if this is an issue - but must + // be careful about how the gutters are handled. + // + // pDataOut - dataset that will get albedo pushed into it + STDMETHOD(MultiplyAlbedo)(THIS_ LPD3DXPRTBUFFER pDataOut) PURE; + + // Sets a pointer to an optional call back function that reports back to the + // user percentage done and gives them the option of quitting + // pCB - pointer to call back function, return S_OK for the simulation + // to continue + // Frequency - 1/Frequency is roughly the number of times the call back + // will be invoked + // lpUserContext - will be passed back to the users call back + STDMETHOD(SetCallBack)(THIS_ LPD3DXSHPRTSIMCB pCB, FLOAT Frequency, LPVOID lpUserContext) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. This function + // takes into account settings from SetMinMaxIntersection. If the closest intersection + // is not needed this function is more efficient compared to the ClosestRayIntersection + // method. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + + STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. If there is an + // intersection the closest face that was intersected and its first two barycentric coordinates + // are returned. This function takes into account settings from SetMinMaxIntersection. + // This is a slower function compared to ShadowRayIntersects and should only be used where + // needed. The third vertices barycentric coordinates will be 1 - pU - pV. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + // pFaceIndex - Closest face that intersects. This index is based on stacking the pBlockerMesh + // faces before the faces from pMesh + // pU - Barycentric coordinate for vertex 0 + // pV - Barycentric coordinate for vertex 1 + // pDist - Distance along ray where the intersection occured + + STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir, + DWORD *pFaceIndex, FLOAT *pU, FLOAT *pV, FLOAT *pDist) PURE; +}; + + +// API functions for creating interfaces + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//============================================================================ +// +// D3DXCreatePRTBuffer: +// -------------------- +// Generates a PRT Buffer that can be compressed or filled by a simulator +// This function should be used to create per-vertex or volume buffers. +// When buffers are created all values are initialized to zero. +// +// Parameters: +// NumSamples +// Number of sample locations represented +// NumCoeffs +// Number of coefficients per sample location (order^2 for SH) +// NumChannels +// Number of color channels to represent (1 or 3) +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXCreatePRTBuffer( + UINT NumSamples, + UINT NumCoeffs, + UINT NumChannels, + LPD3DXPRTBUFFER* ppBuffer); + +//============================================================================ +// +// D3DXCreatePRTBufferTex: +// -------------------- +// Generates a PRT Buffer that can be compressed or filled by a simulator +// This function should be used to create per-pixel buffers. +// When buffers are created all values are initialized to zero. +// +// Parameters: +// Width +// Width of texture +// Height +// Height of texture +// NumCoeffs +// Number of coefficients per sample location (order^2 for SH) +// NumChannels +// Number of color channels to represent (1 or 3) +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXCreatePRTBufferTex( + UINT Width, + UINT Height, + UINT NumCoeffs, + UINT NumChannels, + LPD3DXPRTBUFFER* ppBuffer); + +//============================================================================ +// +// D3DXLoadPRTBufferFromFile: +// -------------------- +// Loads a PRT buffer that has been saved to disk. +// +// Parameters: +// pFilename +// Name of the file to load +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXLoadPRTBufferFromFileA( + LPCSTR pFilename, + LPD3DXPRTBUFFER* ppBuffer); + +HRESULT WINAPI + D3DXLoadPRTBufferFromFileW( + LPCWSTR pFilename, + LPD3DXPRTBUFFER* ppBuffer); + +#ifdef UNICODE +#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileW +#else +#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileA +#endif + + +//============================================================================ +// +// D3DXSavePRTBufferToFile: +// -------------------- +// Saves a PRTBuffer to disk. +// +// Parameters: +// pFilename +// Name of the file to save +// pBuffer +// Buffer that will be saved +// +//============================================================================ + +HRESULT WINAPI + D3DXSavePRTBufferToFileA( + LPCSTR pFileName, + LPD3DXPRTBUFFER pBuffer); + +HRESULT WINAPI + D3DXSavePRTBufferToFileW( + LPCWSTR pFileName, + LPD3DXPRTBUFFER pBuffer); + +#ifdef UNICODE +#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileW +#else +#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileA +#endif + + +//============================================================================ +// +// D3DXLoadPRTCompBufferFromFile: +// -------------------- +// Loads a PRTComp buffer that has been saved to disk. +// +// Parameters: +// pFilename +// Name of the file to load +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXLoadPRTCompBufferFromFileA( + LPCSTR pFilename, + LPD3DXPRTCOMPBUFFER* ppBuffer); + +HRESULT WINAPI + D3DXLoadPRTCompBufferFromFileW( + LPCWSTR pFilename, + LPD3DXPRTCOMPBUFFER* ppBuffer); + +#ifdef UNICODE +#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileW +#else +#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileA +#endif + +//============================================================================ +// +// D3DXSavePRTCompBufferToFile: +// -------------------- +// Saves a PRTCompBuffer to disk. +// +// Parameters: +// pFilename +// Name of the file to save +// pBuffer +// Buffer that will be saved +// +//============================================================================ + +HRESULT WINAPI + D3DXSavePRTCompBufferToFileA( + LPCSTR pFileName, + LPD3DXPRTCOMPBUFFER pBuffer); + +HRESULT WINAPI + D3DXSavePRTCompBufferToFileW( + LPCWSTR pFileName, + LPD3DXPRTCOMPBUFFER pBuffer); + +#ifdef UNICODE +#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileW +#else +#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileA +#endif + +//============================================================================ +// +// D3DXCreatePRTCompBuffer: +// -------------------- +// Compresses a PRT buffer (vertex or texel) +// +// Parameters: +// D3DXSHCOMPRESSQUALITYTYPE +// Quality of compression - low is faster (computes PCA per voronoi cluster) +// high is slower but better quality (clusters based on distance to affine subspace) +// NumClusters +// Number of clusters to compute +// NumPCA +// Number of basis vectors to compute +// pCB +// Optional Callback function +// lpUserContext +// Optional user context +// pBufferIn +// Buffer that will be compressed +// ppBufferOut +// Compressed buffer that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreatePRTCompBuffer( + D3DXSHCOMPRESSQUALITYTYPE Quality, + UINT NumClusters, + UINT NumPCA, + LPD3DXSHPRTSIMCB pCB, + LPVOID lpUserContext, + LPD3DXPRTBUFFER pBufferIn, + LPD3DXPRTCOMPBUFFER *ppBufferOut + ); + +//============================================================================ +// +// D3DXCreateTextureGutterHelper: +// -------------------- +// Generates a "GutterHelper" for a given set of meshes and texture +// resolution +// +// Parameters: +// Width +// Width of texture +// Height +// Height of texture +// pMesh +// Mesh that represents the scene +// GutterSize +// Number of texels to over rasterize in texture space +// this should be at least 1.0 +// ppBuffer +// GutterHelper that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreateTextureGutterHelper( + UINT Width, + UINT Height, + LPD3DXMESH pMesh, + FLOAT GutterSize, + LPD3DXTEXTUREGUTTERHELPER* ppBuffer); + + +//============================================================================ +// +// D3DXCreatePRTEngine: +// -------------------- +// Computes a PRTEngine which can efficiently generate PRT simulations +// of a scene +// +// Parameters: +// pMesh +// Mesh that represents the scene - must have an AttributeTable +// where vertices are in a unique attribute. +// pAdjacency +// Optional adjacency information +// ExtractUVs +// Set this to true if textures are going to be used for albedos +// or to store PRT vectors +// pBlockerMesh +// Optional mesh that just blocks the scene +// ppEngine +// PRTEngine that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreatePRTEngine( + LPD3DXMESH pMesh, + DWORD *pAdjacency, + BOOL ExtractUVs, + LPD3DXMESH pBlockerMesh, + LPD3DXPRTENGINE* ppEngine); + +//============================================================================ +// +// D3DXConcatenateMeshes: +// -------------------- +// Concatenates a group of meshes into one common mesh. This can optionaly transform +// each sub mesh or its texture coordinates. If no DECL is given it will +// generate a union of all of the DECL's of the sub meshes, promoting channels +// and types if neccesary. It will create an AttributeTable if possible, one can +// call OptimizeMesh with attribute sort and compacting enabled to ensure this. +// +// Parameters: +// ppMeshes +// Array of pointers to meshes that can store PRT vectors +// NumMeshes +// Number of meshes +// Options +// Passed through to D3DXCreateMesh +// pGeomXForms +// [optional] Each sub mesh is transformed by the corresponding +// matrix if this array is supplied +// pTextureXForms +// [optional] UV coordinates for each sub mesh are transformed +// by corresponding matrix if supplied +// pDecl +// [optional] Only information in this DECL is used when merging +// data +// pD3DDevice +// D3D device that is used to create the new mesh +// ppMeshOut +// Mesh that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXConcatenateMeshes( + LPD3DXMESH *ppMeshes, + UINT NumMeshes, + DWORD Options, + CONST D3DXMATRIX *pGeomXForms, + CONST D3DXMATRIX *pTextureXForms, + CONST D3DVERTEXELEMENT9 *pDecl, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH *ppMeshOut); + +//============================================================================ +// +// D3DXSHPRTCompSuperCluster: +// -------------------------- +// Used with compressed results of D3DXSHPRTSimulation. +// Generates "super clusters" - groups of clusters that can be drawn in +// the same draw call. A greedy algorithm that minimizes overdraw is used +// to group the clusters. +// +// Parameters: +// pClusterIDs +// NumVerts cluster ID's (extracted from a compressed buffer) +// pScene +// Mesh that represents composite scene passed to the simulator +// MaxNumClusters +// Maximum number of clusters allocated per super cluster +// NumClusters +// Number of clusters computed in the simulator +// pSuperClusterIDs +// Array of length NumClusters, contains index of super cluster +// that corresponding cluster was assigned to +// pNumSuperClusters +// Returns the number of super clusters allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXSHPRTCompSuperCluster( + UINT *pClusterIDs, + LPD3DXMESH pScene, + UINT MaxNumClusters, + UINT NumClusters, + UINT *pSuperClusterIDs, + UINT *pNumSuperClusters); + +//============================================================================ +// +// D3DXSHPRTCompSplitMeshSC: +// ------------------------- +// Used with compressed results of the vertex version of the PRT simulator. +// After D3DXSHRTCompSuperCluster has been called this function can be used +// to split the mesh into a group of faces/vertices per super cluster. +// Each super cluster contains all of the faces that contain any vertex +// classified in one of its clusters. All of the vertices connected to this +// set of faces are also included with the returned array ppVertStatus +// indicating whether or not the vertex belongs to the supercluster. +// +// Parameters: +// pClusterIDs +// NumVerts cluster ID's (extracted from a compressed buffer) +// NumVertices +// Number of vertices in original mesh +// NumClusters +// Number of clusters (input parameter to compression) +// pSuperClusterIDs +// Array of size NumClusters that will contain super cluster ID's (from +// D3DXSHCompSuerCluster) +// NumSuperClusters +// Number of superclusters allocated in D3DXSHCompSuerCluster +// pInputIB +// Raw index buffer for mesh - format depends on bInputIBIs32Bit +// InputIBIs32Bit +// Indicates whether the input index buffer is 32-bit (otherwise 16-bit +// is assumed) +// NumFaces +// Number of faces in the original mesh (pInputIB is 3 times this length) +// ppIBData +// LPD3DXBUFFER holds raw index buffer that will contain the resulting split faces. +// Format determined by bIBIs32Bit. Allocated by function +// pIBDataLength +// Length of ppIBData, assigned in function +// OutputIBIs32Bit +// Indicates whether the output index buffer is to be 32-bit (otherwise +// 16-bit is assumed) +// ppFaceRemap +// LPD3DXBUFFER mapping of each face in ppIBData to original faces. Length is +// *pIBDataLength/3. Optional paramter, allocated in function +// ppVertData +// LPD3DXBUFFER contains new vertex data structure. Size of pVertDataLength +// pVertDataLength +// Number of new vertices in split mesh. Assigned in function +// pSCClusterList +// Array of length NumClusters which pSCData indexes into (Cluster* fields) +// for each SC, contains clusters sorted by super cluster +// pSCData +// Structure per super cluster - contains indices into ppIBData, +// pSCClusterList and ppVertData +// +//============================================================================ + +HRESULT WINAPI + D3DXSHPRTCompSplitMeshSC( + UINT *pClusterIDs, + UINT NumVertices, + UINT NumClusters, + UINT *pSuperClusterIDs, + UINT NumSuperClusters, + LPVOID pInputIB, + BOOL InputIBIs32Bit, + UINT NumFaces, + LPD3DXBUFFER *ppIBData, + UINT *pIBDataLength, + BOOL OutputIBIs32Bit, + LPD3DXBUFFER *ppFaceRemap, + LPD3DXBUFFER *ppVertData, + UINT *pVertDataLength, + UINT *pSCClusterList, + D3DXSHPRTSPLITMESHCLUSTERDATA *pSCData); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +////////////////////////////////////////////////////////////////////////////// +// +// Definitions of .X file templates used by mesh load/save functions +// that are not RM standard +// +////////////////////////////////////////////////////////////////////////////// + +// {3CF169CE-FF7C-44ab-93C0-F78F62D172E2} +DEFINE_GUID(DXFILEOBJ_XSkinMeshHeader, +0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2); + +// {B8D65549-D7C9-4995-89CF-53A9A8B031E3} +DEFINE_GUID(DXFILEOBJ_VertexDuplicationIndices, +0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3); + +// {A64C844A-E282-4756-8B80-250CDE04398C} +DEFINE_GUID(DXFILEOBJ_FaceAdjacency, +0xa64c844a, 0xe282, 0x4756, 0x8b, 0x80, 0x25, 0xc, 0xde, 0x4, 0x39, 0x8c); + +// {6F0D123B-BAD2-4167-A0D0-80224F25FABB} +DEFINE_GUID(DXFILEOBJ_SkinWeights, +0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb); + +// {A3EB5D44-FC22-429d-9AFB-3221CB9719A6} +DEFINE_GUID(DXFILEOBJ_Patch, +0xa3eb5d44, 0xfc22, 0x429d, 0x9a, 0xfb, 0x32, 0x21, 0xcb, 0x97, 0x19, 0xa6); + +// {D02C95CC-EDBA-4305-9B5D-1820D7704BBF} +DEFINE_GUID(DXFILEOBJ_PatchMesh, +0xd02c95cc, 0xedba, 0x4305, 0x9b, 0x5d, 0x18, 0x20, 0xd7, 0x70, 0x4b, 0xbf); + +// {B9EC94E1-B9A6-4251-BA18-94893F02C0EA} +DEFINE_GUID(DXFILEOBJ_PatchMesh9, +0xb9ec94e1, 0xb9a6, 0x4251, 0xba, 0x18, 0x94, 0x89, 0x3f, 0x2, 0xc0, 0xea); + +// {B6C3E656-EC8B-4b92-9B62-681659522947} +DEFINE_GUID(DXFILEOBJ_PMInfo, +0xb6c3e656, 0xec8b, 0x4b92, 0x9b, 0x62, 0x68, 0x16, 0x59, 0x52, 0x29, 0x47); + +// {917E0427-C61E-4a14-9C64-AFE65F9E9844} +DEFINE_GUID(DXFILEOBJ_PMAttributeRange, +0x917e0427, 0xc61e, 0x4a14, 0x9c, 0x64, 0xaf, 0xe6, 0x5f, 0x9e, 0x98, 0x44); + +// {574CCC14-F0B3-4333-822D-93E8A8A08E4C} +DEFINE_GUID(DXFILEOBJ_PMVSplitRecord, +0x574ccc14, 0xf0b3, 0x4333, 0x82, 0x2d, 0x93, 0xe8, 0xa8, 0xa0, 0x8e, 0x4c); + +// {B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897} +DEFINE_GUID(DXFILEOBJ_FVFData, +0xb6e70a0e, 0x8ef9, 0x4e83, 0x94, 0xad, 0xec, 0xc8, 0xb0, 0xc0, 0x48, 0x97); + +// {F752461C-1E23-48f6-B9F8-8350850F336F} +DEFINE_GUID(DXFILEOBJ_VertexElement, +0xf752461c, 0x1e23, 0x48f6, 0xb9, 0xf8, 0x83, 0x50, 0x85, 0xf, 0x33, 0x6f); + +// {BF22E553-292C-4781-9FEA-62BD554BDD93} +DEFINE_GUID(DXFILEOBJ_DeclData, +0xbf22e553, 0x292c, 0x4781, 0x9f, 0xea, 0x62, 0xbd, 0x55, 0x4b, 0xdd, 0x93); + +// {F1CFE2B3-0DE3-4e28-AFA1-155A750A282D} +DEFINE_GUID(DXFILEOBJ_EffectFloats, +0xf1cfe2b3, 0xde3, 0x4e28, 0xaf, 0xa1, 0x15, 0x5a, 0x75, 0xa, 0x28, 0x2d); + +// {D55B097E-BDB6-4c52-B03D-6051C89D0E42} +DEFINE_GUID(DXFILEOBJ_EffectString, +0xd55b097e, 0xbdb6, 0x4c52, 0xb0, 0x3d, 0x60, 0x51, 0xc8, 0x9d, 0xe, 0x42); + +// {622C0ED0-956E-4da9-908A-2AF94F3CE716} +DEFINE_GUID(DXFILEOBJ_EffectDWord, +0x622c0ed0, 0x956e, 0x4da9, 0x90, 0x8a, 0x2a, 0xf9, 0x4f, 0x3c, 0xe7, 0x16); + +// {3014B9A0-62F5-478c-9B86-E4AC9F4E418B} +DEFINE_GUID(DXFILEOBJ_EffectParamFloats, +0x3014b9a0, 0x62f5, 0x478c, 0x9b, 0x86, 0xe4, 0xac, 0x9f, 0x4e, 0x41, 0x8b); + +// {1DBC4C88-94C1-46ee-9076-2C28818C9481} +DEFINE_GUID(DXFILEOBJ_EffectParamString, +0x1dbc4c88, 0x94c1, 0x46ee, 0x90, 0x76, 0x2c, 0x28, 0x81, 0x8c, 0x94, 0x81); + +// {E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5} +DEFINE_GUID(DXFILEOBJ_EffectParamDWord, +0xe13963bc, 0xae51, 0x4c5d, 0xb0, 0xf, 0xcf, 0xa3, 0xa9, 0xd9, 0x7c, 0xe5); + +// {E331F7E4-0559-4cc2-8E99-1CEC1657928F} +DEFINE_GUID(DXFILEOBJ_EffectInstance, +0xe331f7e4, 0x559, 0x4cc2, 0x8e, 0x99, 0x1c, 0xec, 0x16, 0x57, 0x92, 0x8f); + +// {9E415A43-7BA6-4a73-8743-B73D47E88476} +DEFINE_GUID(DXFILEOBJ_AnimTicksPerSecond, +0x9e415a43, 0x7ba6, 0x4a73, 0x87, 0x43, 0xb7, 0x3d, 0x47, 0xe8, 0x84, 0x76); + +// {7F9B00B3-F125-4890-876E-1CFFBF697C4D} +DEFINE_GUID(DXFILEOBJ_CompressedAnimationSet, +0x7f9b00b3, 0xf125, 0x4890, 0x87, 0x6e, 0x1c, 0x42, 0xbf, 0x69, 0x7c, 0x4d); + +#pragma pack(push, 1) +typedef struct _XFILECOMPRESSEDANIMATIONSET +{ + DWORD CompressedBlockSize; + FLOAT TicksPerSec; + DWORD PlaybackType; + DWORD BufferLength; +} XFILECOMPRESSEDANIMATIONSET; +#pragma pack(pop) + +#define XSKINEXP_TEMPLATES \ + "xof 0303txt 0032\ + template XSkinMeshHeader \ + { \ + <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ + WORD nMaxSkinWeightsPerVertex; \ + WORD nMaxSkinWeightsPerFace; \ + WORD nBones; \ + } \ + template VertexDuplicationIndices \ + { \ + \ + DWORD nIndices; \ + DWORD nOriginalVertices; \ + array DWORD indices[nIndices]; \ + } \ + template FaceAdjacency \ + { \ + \ + DWORD nIndices; \ + array DWORD indices[nIndices]; \ + } \ + template SkinWeights \ + { \ + <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ + STRING transformNodeName; \ + DWORD nWeights; \ + array DWORD vertexIndices[nWeights]; \ + array float weights[nWeights]; \ + Matrix4x4 matrixOffset; \ + } \ + template Patch \ + { \ + \ + DWORD nControlIndices; \ + array DWORD controlIndices[nControlIndices]; \ + } \ + template PatchMesh \ + { \ + \ + DWORD nVertices; \ + array Vector vertices[nVertices]; \ + DWORD nPatches; \ + array Patch patches[nPatches]; \ + [ ... ] \ + } \ + template PatchMesh9 \ + { \ + \ + DWORD Type; \ + DWORD Degree; \ + DWORD Basis; \ + DWORD nVertices; \ + array Vector vertices[nVertices]; \ + DWORD nPatches; \ + array Patch patches[nPatches]; \ + [ ... ] \ + } " \ + "template EffectFloats \ + { \ + \ + DWORD nFloats; \ + array float Floats[nFloats]; \ + } \ + template EffectString \ + { \ + \ + STRING Value; \ + } \ + template EffectDWord \ + { \ + <622C0ED0-956E-4da9-908A-2AF94F3CE716> \ + DWORD Value; \ + } " \ + "template EffectParamFloats \ + { \ + <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \ + STRING ParamName; \ + DWORD nFloats; \ + array float Floats[nFloats]; \ + } " \ + "template EffectParamString \ + { \ + <1DBC4C88-94C1-46ee-9076-2C28818C9481> \ + STRING ParamName; \ + STRING Value; \ + } \ + template EffectParamDWord \ + { \ + \ + STRING ParamName; \ + DWORD Value; \ + } \ + template EffectInstance \ + { \ + \ + STRING EffectFilename; \ + [ ... ] \ + } " \ + "template AnimTicksPerSecond \ + { \ + <9E415A43-7BA6-4a73-8743-B73D47E88476> \ + DWORD AnimTicksPerSecond; \ + } \ + template CompressedAnimationSet \ + { \ + <7F9B00B3-F125-4890-876E-1C42BF697C4D> \ + DWORD CompressedBlockSize; \ + FLOAT TicksPerSec; \ + DWORD PlaybackType; \ + DWORD BufferLength; \ + array DWORD CompressedData[BufferLength]; \ + } " + +#define XEXTENSIONS_TEMPLATES \ + "xof 0303txt 0032\ + template FVFData \ + { \ + \ + DWORD dwFVF; \ + DWORD nDWords; \ + array DWORD data[nDWords]; \ + } \ + template VertexElement \ + { \ + \ + DWORD Type; \ + DWORD Method; \ + DWORD Usage; \ + DWORD UsageIndex; \ + } \ + template DeclData \ + { \ + \ + DWORD nElements; \ + array VertexElement Elements[nElements]; \ + DWORD nDWords; \ + array DWORD data[nDWords]; \ + } \ + template PMAttributeRange \ + { \ + <917E0427-C61E-4a14-9C64-AFE65F9E9844> \ + DWORD iFaceOffset; \ + DWORD nFacesMin; \ + DWORD nFacesMax; \ + DWORD iVertexOffset; \ + DWORD nVerticesMin; \ + DWORD nVerticesMax; \ + } \ + template PMVSplitRecord \ + { \ + <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \ + DWORD iFaceCLW; \ + DWORD iVlrOffset; \ + DWORD iCode; \ + } \ + template PMInfo \ + { \ + \ + DWORD nAttributes; \ + array PMAttributeRange attributeRanges[nAttributes]; \ + DWORD nMaxValence; \ + DWORD nMinLogicalVertices; \ + DWORD nMaxLogicalVertices; \ + DWORD nVSplits; \ + array PMVSplitRecord splitRecords[nVSplits]; \ + DWORD nAttributeMispredicts; \ + array DWORD attributeMispredicts[nAttributeMispredicts]; \ + } " + +#endif //__D3DX9MESH_H__ + + diff --git a/subVersion/d3d9/d3dx9shader.h b/subVersion/d3d9/d3dx9shader.h new file mode 100644 index 0000000..5ed3f01 --- /dev/null +++ b/subVersion/d3d9/d3dx9shader.h @@ -0,0 +1,1010 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: d3dx9shader.h +// Content: D3DX Shader APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9SHADER_H__ +#define __D3DX9SHADER_H__ + + +//--------------------------------------------------------------------------- +// D3DXTX_VERSION: +// -------------- +// Version token used to create a procedural texture filler in effects +// Used by D3DXFill[]TX functions +//--------------------------------------------------------------------------- +#define D3DXTX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor)) + + + +//---------------------------------------------------------------------------- +// D3DXSHADER flags: +// ----------------- +// D3DXSHADER_DEBUG +// Insert debug file/line/type/symbol information. +// +// D3DXSHADER_SKIPVALIDATION +// Do not validate the generated code against known capabilities and +// constraints. This option is only recommended when compiling shaders +// you KNOW will work. (ie. have compiled before without this option.) +// Shaders are always validated by D3D before they are set to the device. +// +// D3DXSHADER_SKIPOPTIMIZATION +// Instructs the compiler to skip optimization steps during code generation. +// Unless you are trying to isolate a problem in your code using this option +// is not recommended. +// +// D3DXSHADER_PACKMATRIX_ROWMAJOR +// Unless explicitly specified, matrices will be packed in row-major order +// on input and output from the shader. +// +// D3DXSHADER_PACKMATRIX_COLUMNMAJOR +// Unless explicitly specified, matrices will be packed in column-major +// order on input and output from the shader. This is generally more +// efficient, since it allows vector-matrix multiplication to be performed +// using a series of dot-products. +// +// D3DXSHADER_PARTIALPRECISION +// Force all computations in resulting shader to occur at partial precision. +// This may result in faster evaluation of shaders on some hardware. +// +// D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT +// Force compiler to compile against the next highest available software +// target for vertex shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT +// Force compiler to compile against the next highest available software +// target for pixel shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DXSHADER_NO_PRESHADER +// Disables Preshaders. Using this flag will cause the compiler to not +// pull out static expression for evaluation on the host cpu +// +// D3DXSHADER_AVOID_FLOW_CONTROL +// Hint compiler to avoid flow-control constructs where possible. +// +// D3DXSHADER_PREFER_FLOW_CONTROL +// Hint compiler to prefer flow-control constructs where possible. +// +//---------------------------------------------------------------------------- + +#define D3DXSHADER_DEBUG (1 << 0) +#define D3DXSHADER_SKIPVALIDATION (1 << 1) +#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2) +#define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3) +#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4) +#define D3DXSHADER_PARTIALPRECISION (1 << 5) +#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6) +#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7) +#define D3DXSHADER_NO_PRESHADER (1 << 8) +#define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9) +#define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3DXSHADER_IEEE_STRICTNESS (1 << 13) +#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL (1 << 16) + + +// optimization level flags +#define D3DXSHADER_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3DXSHADER_OPTIMIZATION_LEVEL1 0 +#define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15) + + + +//---------------------------------------------------------------------------- +// D3DXCONSTTABLE flags: +// ------------------- + +#define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17) + + + +//---------------------------------------------------------------------------- +// D3DXHANDLE: +// ----------- +// Handle values used to efficiently reference shader and effect parameters. +// Strings can be used as handles. However, handles are not always strings. +//---------------------------------------------------------------------------- + +#ifndef D3DXFX_LARGEADDRESS_HANDLE +typedef LPCSTR D3DXHANDLE; +#else +typedef UINT_PTR D3DXHANDLE; +#endif +typedef D3DXHANDLE *LPD3DXHANDLE; + + +//---------------------------------------------------------------------------- +// D3DXMACRO: +// ---------- +// Preprocessor macro definition. The application pass in a NULL-terminated +// array of this structure to various D3DX APIs. This enables the application +// to #define tokens at runtime, before the file is parsed. +//---------------------------------------------------------------------------- + +typedef struct _D3DXMACRO +{ + LPCSTR Name; + LPCSTR Definition; + +} D3DXMACRO, *LPD3DXMACRO; + + +//---------------------------------------------------------------------------- +// D3DXSEMANTIC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXSEMANTIC +{ + UINT Usage; + UINT UsageIndex; + +} D3DXSEMANTIC, *LPD3DXSEMANTIC; + + + +//---------------------------------------------------------------------------- +// D3DXREGISTER_SET: +//---------------------------------------------------------------------------- + +typedef enum _D3DXREGISTER_SET +{ + D3DXRS_BOOL, + D3DXRS_INT4, + D3DXRS_FLOAT4, + D3DXRS_SAMPLER, + + // force 32-bit size enum + D3DXRS_FORCE_DWORD = 0x7fffffff + +} D3DXREGISTER_SET, *LPD3DXREGISTER_SET; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_CLASS: +//---------------------------------------------------------------------------- + +typedef enum _D3DXPARAMETER_CLASS +{ + D3DXPC_SCALAR, + D3DXPC_VECTOR, + D3DXPC_MATRIX_ROWS, + D3DXPC_MATRIX_COLUMNS, + D3DXPC_OBJECT, + D3DXPC_STRUCT, + + // force 32-bit size enum + D3DXPC_FORCE_DWORD = 0x7fffffff + +} D3DXPARAMETER_CLASS, *LPD3DXPARAMETER_CLASS; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_TYPE: +//---------------------------------------------------------------------------- + +typedef enum _D3DXPARAMETER_TYPE +{ + D3DXPT_VOID, + D3DXPT_BOOL, + D3DXPT_INT, + D3DXPT_FLOAT, + D3DXPT_STRING, + D3DXPT_TEXTURE, + D3DXPT_TEXTURE1D, + D3DXPT_TEXTURE2D, + D3DXPT_TEXTURE3D, + D3DXPT_TEXTURECUBE, + D3DXPT_SAMPLER, + D3DXPT_SAMPLER1D, + D3DXPT_SAMPLER2D, + D3DXPT_SAMPLER3D, + D3DXPT_SAMPLERCUBE, + D3DXPT_PIXELSHADER, + D3DXPT_VERTEXSHADER, + D3DXPT_PIXELFRAGMENT, + D3DXPT_VERTEXFRAGMENT, + D3DXPT_UNSUPPORTED, + + // force 32-bit size enum + D3DXPT_FORCE_DWORD = 0x7fffffff + +} D3DXPARAMETER_TYPE, *LPD3DXPARAMETER_TYPE; + + +//---------------------------------------------------------------------------- +// D3DXCONSTANTTABLE_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXCONSTANTTABLE_DESC +{ + LPCSTR Creator; // Creator string + DWORD Version; // Shader version + UINT Constants; // Number of constants + +} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC; + + +//---------------------------------------------------------------------------- +// D3DXCONSTANT_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXCONSTANT_DESC +{ + LPCSTR Name; // Constant name + + D3DXREGISTER_SET RegisterSet; // Register set + UINT RegisterIndex; // Register index + UINT RegisterCount; // Number of registers occupied + + D3DXPARAMETER_CLASS Class; // Class + D3DXPARAMETER_TYPE Type; // Component type + + UINT Rows; // Number of rows + UINT Columns; // Number of columns + UINT Elements; // Number of array elements + UINT StructMembers; // Number of structure member sub-parameters + + UINT Bytes; // Data size, in bytes + LPCVOID DefaultValue; // Pointer to default value + +} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC; + + + +//---------------------------------------------------------------------------- +// ID3DXConstantTable: +//---------------------------------------------------------------------------- + +typedef interface ID3DXConstantTable ID3DXConstantTable; +typedef interface ID3DXConstantTable *LPD3DXCONSTANTTABLE; + +// {AB3C758F-093E-4356-B762-4DB18F1B3A01} +DEFINE_GUID(IID_ID3DXConstantTable, +0xab3c758f, 0x93e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x1); + + +#undef INTERFACE +#define INTERFACE ID3DXConstantTable + +DECLARE_INTERFACE_(ID3DXConstantTable, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Buffer + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + + // Set Constants + STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE; + STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE; + STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE; + STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE; + STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXTextureShader: +//---------------------------------------------------------------------------- + +typedef interface ID3DXTextureShader ID3DXTextureShader; +typedef interface ID3DXTextureShader *LPD3DXTEXTURESHADER; + +// {3E3D67F8-AA7A-405d-A857-BA01D4758426} +DEFINE_GUID(IID_ID3DXTextureShader, +0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26); + +#undef INTERFACE +#define INTERFACE ID3DXTextureShader + +DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Gets + STDMETHOD(GetFunction)(THIS_ LPD3DXBUFFER *ppFunction) PURE; + STDMETHOD(GetConstantBuffer)(THIS_ LPD3DXBUFFER *ppConstantBuffer) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + + // Set Constants + STDMETHOD(SetDefaults)(THIS) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXINCLUDE_TYPE: +//---------------------------------------------------------------------------- + +typedef enum _D3DXINCLUDE_TYPE +{ + D3DXINC_LOCAL, + D3DXINC_SYSTEM, + + // force 32-bit size enum + D3DXINC_FORCE_DWORD = 0x7fffffff + +} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE; + + +//---------------------------------------------------------------------------- +// ID3DXInclude: +// ------------- +// This interface is intended to be implemented by the application, and can +// be used by various D3DX APIs. This enables application-specific handling +// of #include directives in source files. +// +// Open() +// Opens an include file. If successful, it should fill in ppData and +// pBytes. The data pointer returned must remain valid until Close is +// subsequently called. The name of the file is encoded in UTF-8 format. +// Close() +// Closes an include file. If Open was successful, Close is guaranteed +// to be called before the API using this interface returns. +//---------------------------------------------------------------------------- + +typedef interface ID3DXInclude ID3DXInclude; +typedef interface ID3DXInclude *LPD3DXINCLUDE; + +#undef INTERFACE +#define INTERFACE ID3DXInclude + +DECLARE_INTERFACE(ID3DXInclude) +{ + STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DXAssembleShader: +// ------------------- +// Assembles a shader. +// +// Parameters: +// pSrcFile +// Source file name +// hSrcModule +// Module handle. if NULL, current module will be used +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// Flags +// See D3DXSHADER_xxx flags +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the assembled shader code, as well as any embedded debug info. +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DXAssembleShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXAssembleShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW +#else +#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA +#endif + + +HRESULT WINAPI + D3DXAssembleShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXAssembleShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW +#else +#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA +#endif + + +HRESULT WINAPI + D3DXAssembleShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + + + +//---------------------------------------------------------------------------- +// D3DXCompileShader: +// ------------------ +// Compiles a shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "ps_1_1", +// "ps_1_2", "ps_1_3", "ps_1_4", "ps_2_0", "ps_2_a", "ps_2_sw", "tx_1_0" +// Flags +// See D3DXSHADER_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3DXGetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// ppConstantTable +// Returns a ID3DXConstantTable object which can be used to set +// shader constants to the device. Alternatively, an application can +// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within +// the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCompileShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXCompileShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +#ifdef UNICODE +#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileW +#else +#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileA +#endif + + +HRESULT WINAPI + D3DXCompileShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXCompileShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +#ifdef UNICODE +#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceW +#else +#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceA +#endif + + +HRESULT WINAPI + D3DXCompileShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + + +//---------------------------------------------------------------------------- +// D3DXDisassembleShader: +// ---------------------- +// Takes a binary shader, and returns a buffer containing text assembly. +// +// Parameters: +// pShader +// Pointer to the shader byte code. +// ShaderSizeInBytes +// Size of the shader byte code in bytes. +// EnableColorCode +// Emit HTML tags for color coding the output? +// pComments +// Pointer to a comment string to include at the top of the shader. +// ppDisassembly +// Returns a buffer containing the disassembled shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXDisassembleShader( + CONST DWORD* pShader, + BOOL EnableColorCode, + LPCSTR pComments, + LPD3DXBUFFER* ppDisassembly); + + +//---------------------------------------------------------------------------- +// D3DXGetPixelShaderProfile/D3DXGetVertexShaderProfile: +// ----------------------------------------------------- +// Returns the name of the HLSL profile best suited to a given device. +// +// Parameters: +// pDevice +// Pointer to the device in question +//---------------------------------------------------------------------------- + +LPCSTR WINAPI + D3DXGetPixelShaderProfile( + LPDIRECT3DDEVICE9 pDevice); + +LPCSTR WINAPI + D3DXGetVertexShaderProfile( + LPDIRECT3DDEVICE9 pDevice); + + +//---------------------------------------------------------------------------- +// D3DXFindShaderComment: +// ---------------------- +// Searches through a shader for a particular comment, denoted by a FourCC in +// the first DWORD of the comment. If the comment is not found, and no other +// error has occurred, S_FALSE is returned. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// FourCC +// FourCC used to identify the desired comment block. +// ppData +// Returns a pointer to the comment data (not including comment token +// and FourCC). Can be NULL. +// pSizeInBytes +// Returns the size of the comment data in bytes. Can be NULL. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFindShaderComment( + CONST DWORD* pFunction, + DWORD FourCC, + LPCVOID* ppData, + UINT* pSizeInBytes); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderSize: +// ------------------ +// Returns the size of the shader byte-code, in bytes. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +//---------------------------------------------------------------------------- + +UINT WINAPI + D3DXGetShaderSize( + CONST DWORD* pFunction); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderVersion: +// ----------------------- +// Returns the shader version of a given shader. Returns zero if the shader +// function is NULL. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +//---------------------------------------------------------------------------- + +DWORD WINAPI + D3DXGetShaderVersion( + CONST DWORD* pFunction); + +//---------------------------------------------------------------------------- +// D3DXGetShaderSemantics: +// ----------------------- +// Gets semantics for all input elements referenced inside a given shader. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// pSemantics +// Pointer to an array of D3DXSEMANTIC structures. The function will +// fill this array with the semantics for each input element referenced +// inside the shader. This array is assumed to contain at least +// MAXD3DDECLLENGTH elements. +// pCount +// Returns the number of elements referenced by the shader +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderInputSemantics( + CONST DWORD* pFunction, + D3DXSEMANTIC* pSemantics, + UINT* pCount); + +HRESULT WINAPI + D3DXGetShaderOutputSemantics( + CONST DWORD* pFunction, + D3DXSEMANTIC* pSemantics, + UINT* pCount); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderSamplers: +// ---------------------- +// Gets semantics for all input elements referenced inside a given shader. +// +// pFunction +// Pointer to the function DWORD stream +// pSamplers +// Pointer to an array of LPCSTRs. The function will fill this array +// with pointers to the sampler names contained within pFunction, for +// each sampler referenced inside the shader. This array is assumed to +// contain at least 16 elements. +// pCount +// Returns the number of samplers referenced by the shader +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderSamplers( + CONST DWORD* pFunction, + LPCSTR* pSamplers, + UINT* pCount); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderConstantTable: +// --------------------------- +// Gets shader constant table embedded inside shader. A constant table is +// generated by D3DXAssembleShader and D3DXCompileShader, and is embedded in +// the body of the shader. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// Flags +// See D3DXCONSTTABLE_xxx +// ppConstantTable +// Returns a ID3DXConstantTable object which can be used to set +// shader constants to the device. Alternatively, an application can +// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within +// the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderConstantTable( + CONST DWORD* pFunction, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXGetShaderConstantTableEx( + CONST DWORD* pFunction, + DWORD Flags, + LPD3DXCONSTANTTABLE* ppConstantTable); + + + +//---------------------------------------------------------------------------- +// D3DXCreateTextureShader: +// ------------------------ +// Creates a texture shader object, given the compiled shader. +// +// Parameters +// pFunction +// Pointer to the function DWORD stream +// ppTextureShader +// Returns a ID3DXTextureShader object which can be used to procedurally +// fill the contents of a texture using the D3DXFillTextureTX functions. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateTextureShader( + CONST DWORD* pFunction, + LPD3DXTEXTURESHADER* ppTextureShader); + + +//---------------------------------------------------------------------------- +// D3DXPreprocessShader: +// --------------------- +// Runs the preprocessor on the specified shader or effect, but does +// not actually compile it. This is useful for evaluating the #includes +// and #defines in a shader and then emitting a reformatted token stream +// for debugging purposes or for generating a self-contained shader. +// +// Parameters: +// pSrcFile +// Source file name +// hSrcModule +// Module handle. if NULL, current module will be used +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// ppShaderText +// Returns a buffer containing a single large string that represents +// the resulting formatted token stream +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXPreprocessShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileW +#else +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileA +#endif + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceW +#else +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceA +#endif + +HRESULT WINAPI + D3DXPreprocessShader( + LPCSTR pSrcData, + UINT SrcDataSize, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// Shader comment block layouts ////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXSHADER_CONSTANTTABLE: +// ------------------------- +// Shader constant information; included as an CTAB comment block inside +// shaders. All offsets are BYTE offsets from start of CONSTANTTABLE struct. +// Entries in the table are sorted by Name in ascending order. +//---------------------------------------------------------------------------- + +typedef struct _D3DXSHADER_CONSTANTTABLE +{ + DWORD Size; // sizeof(D3DXSHADER_CONSTANTTABLE) + DWORD Creator; // LPCSTR offset + DWORD Version; // shader version + DWORD Constants; // number of constants + DWORD ConstantInfo; // D3DXSHADER_CONSTANTINFO[Constants] offset + DWORD Flags; // flags shader was compiled with + DWORD Target; // LPCSTR offset + +} D3DXSHADER_CONSTANTTABLE, *LPD3DXSHADER_CONSTANTTABLE; + + +typedef struct _D3DXSHADER_CONSTANTINFO +{ + DWORD Name; // LPCSTR offset + WORD RegisterSet; // D3DXREGISTER_SET + WORD RegisterIndex; // register number + WORD RegisterCount; // number of registers + WORD Reserved; // reserved + DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset + DWORD DefaultValue; // offset of default value + +} D3DXSHADER_CONSTANTINFO, *LPD3DXSHADER_CONSTANTINFO; + + +typedef struct _D3DXSHADER_TYPEINFO +{ + WORD Class; // D3DXPARAMETER_CLASS + WORD Type; // D3DXPARAMETER_TYPE + WORD Rows; // number of rows (matrices) + WORD Columns; // number of columns (vectors and matrices) + WORD Elements; // array dimension + WORD StructMembers; // number of struct members + DWORD StructMemberInfo; // D3DXSHADER_STRUCTMEMBERINFO[Members] offset + +} D3DXSHADER_TYPEINFO, *LPD3DXSHADER_TYPEINFO; + + +typedef struct _D3DXSHADER_STRUCTMEMBERINFO +{ + DWORD Name; // LPCSTR offset + DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset + +} D3DXSHADER_STRUCTMEMBERINFO, *LPD3DXSHADER_STRUCTMEMBERINFO; + + + +#endif //__D3DX9SHADER_H__ + diff --git a/subVersion/d3d9/d3dx9shape.h b/subVersion/d3d9/d3dx9shape.h new file mode 100644 index 0000000..4c23091 --- /dev/null +++ b/subVersion/d3d9/d3dx9shape.h @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9shapes.h +// Content: D3DX simple shapes +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9SHAPES_H__ +#define __D3DX9SHAPES_H__ + +/////////////////////////////////////////////////////////////////////////// +// Functions: +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//------------------------------------------------------------------------- +// D3DXCreatePolygon: +// ------------------ +// Creates a mesh containing an n-sided polygon. The polygon is centered +// at the origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Length Length of each side. +// Sides Number of sides the polygon has. (Must be >= 3) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreatePolygon( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Length, + UINT Sides, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateBox: +// -------------- +// Creates a mesh containing an axis-aligned box. The box is centered at +// the origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Width Width of box (along X-axis) +// Height Height of box (along Y-axis) +// Depth Depth of box (along Z-axis) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateBox( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Width, + FLOAT Height, + FLOAT Depth, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateCylinder: +// ------------------- +// Creates a mesh containing a cylinder. The generated cylinder is +// centered at the origin, and its axis is aligned with the Z-axis. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Radius1 Radius at -Z end (should be >= 0.0f) +// Radius2 Radius at +Z end (should be >= 0.0f) +// Length Length of cylinder (along Z-axis) +// Slices Number of slices about the main axis +// Stacks Number of stacks along the main axis +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateCylinder( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Radius1, + FLOAT Radius2, + FLOAT Length, + UINT Slices, + UINT Stacks, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateSphere: +// ----------------- +// Creates a mesh containing a sphere. The sphere is centered at the +// origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Radius Radius of the sphere (should be >= 0.0f) +// Slices Number of slices about the main axis +// Stacks Number of stacks along the main axis +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateSphere( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Radius, + UINT Slices, + UINT Stacks, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateTorus: +// ---------------- +// Creates a mesh containing a torus. The generated torus is centered at +// the origin, and its axis is aligned with the Z-axis. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// InnerRadius Inner radius of the torus (should be >= 0.0f) +// OuterRadius Outer radius of the torue (should be >= 0.0f) +// Sides Number of sides in a cross-section (must be >= 3) +// Rings Number of rings making up the torus (must be >= 3) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTorus( + LPDIRECT3DDEVICE9 pDevice, + FLOAT InnerRadius, + FLOAT OuterRadius, + UINT Sides, + UINT Rings, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateTeapot: +// ----------------- +// Creates a mesh containing a teapot. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTeapot( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateText: +// --------------- +// Creates a mesh containing the specified text using the font associated +// with the device context. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// hDC Device context, with desired font selected +// pText Text to generate +// Deviation Maximum chordal deviation from true font outlines +// Extrusion Amount to extrude text in -Z direction +// ppMesh The mesh object which will be created +// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL) +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTextA( + LPDIRECT3DDEVICE9 pDevice, + HDC hDC, + LPCSTR pText, + FLOAT Deviation, + FLOAT Extrusion, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency, + LPGLYPHMETRICSFLOAT pGlyphMetrics); + +HRESULT WINAPI + D3DXCreateTextW( + LPDIRECT3DDEVICE9 pDevice, + HDC hDC, + LPCWSTR pText, + FLOAT Deviation, + FLOAT Extrusion, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency, + LPGLYPHMETRICSFLOAT pGlyphMetrics); + +#ifdef UNICODE +#define D3DXCreateText D3DXCreateTextW +#else +#define D3DXCreateText D3DXCreateTextA +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9SHAPES_H__ + diff --git a/subVersion/d3d9/d3dx9tex.h b/subVersion/d3d9/d3dx9tex.h new file mode 100644 index 0000000..c4b6510 --- /dev/null +++ b/subVersion/d3d9/d3dx9tex.h @@ -0,0 +1,1735 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9tex.h +// Content: D3DX texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9TEX_H__ +#define __D3DX9TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR +// Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V | +// D3DX_FILTER_MIRROR_V +// D3DX_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX_FILTER_SRGB +// Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +#define D3DX_FILTER_NONE (1 << 0) +#define D3DX_FILTER_POINT (2 << 0) +#define D3DX_FILTER_LINEAR (3 << 0) +#define D3DX_FILTER_TRIANGLE (4 << 0) +#define D3DX_FILTER_BOX (5 << 0) + +#define D3DX_FILTER_MIRROR_U (1 << 16) +#define D3DX_FILTER_MIRROR_V (2 << 16) +#define D3DX_FILTER_MIRROR_W (4 << 16) +#define D3DX_FILTER_MIRROR (7 << 16) + +#define D3DX_FILTER_DITHER (1 << 19) +#define D3DX_FILTER_DITHER_DIFFUSION (2 << 19) + +#define D3DX_FILTER_SRGB_IN (1 << 21) +#define D3DX_FILTER_SRGB_OUT (2 << 21) +#define D3DX_FILTER_SRGB (3 << 21) + + +//----------------------------------------------------------------------------- +// D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file: +//----------------------------------------------------------------------------- + +#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F +#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26 +#define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter))) + + + + +//---------------------------------------------------------------------------- +// D3DX_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DXComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX_NORMALMAP_MIRROR +// Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V +// D3DX_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +//---------------------------------------------------------------------------- + +#define D3DX_NORMALMAP_MIRROR_U (1 << 16) +#define D3DX_NORMALMAP_MIRROR_V (2 << 16) +#define D3DX_NORMALMAP_MIRROR (3 << 16) +#define D3DX_NORMALMAP_INVERTSIGN (8 << 16) +#define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16) + + + + +//---------------------------------------------------------------------------- +// D3DX_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX_CHANNEL_RED +// Indicates the red channel should be used +// D3DX_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +#define D3DX_CHANNEL_RED (1 << 0) +#define D3DX_CHANNEL_BLUE (1 << 1) +#define D3DX_CHANNEL_GREEN (1 << 2) +#define D3DX_CHANNEL_ALPHA (1 << 3) +#define D3DX_CHANNEL_LUMINANCE (1 << 4) + + + + +//---------------------------------------------------------------------------- +// D3DXIMAGE_FILEFORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum _D3DXIMAGE_FILEFORMAT +{ + D3DXIFF_BMP = 0, + D3DXIFF_JPG = 1, + D3DXIFF_TGA = 2, + D3DXIFF_PNG = 3, + D3DXIFF_DDS = 4, + D3DXIFF_PPM = 5, + D3DXIFF_DIB = 6, + D3DXIFF_HDR = 7, //high dynamic range formats + D3DXIFF_PFM = 8, // + D3DXIFF_FORCE_DWORD = 0x7fffffff + +} D3DXIMAGE_FILEFORMAT; + + +//---------------------------------------------------------------------------- +// LPD3DXFILL2D and LPD3DXFILL3D: +// ------------------------------ +// Function types used by the texture fill functions. +// +// Parameters: +// pOut +// Pointer to a vector which the function uses to return its result. +// X,Y,Z,W will be mapped to R,G,B,A respectivly. +// pTexCoord +// Pointer to a vector containing the coordinates of the texel currently +// being evaluated. Textures and VolumeTexture texcoord components +// range from 0 to 1. CubeTexture texcoord component range from -1 to 1. +// pTexelSize +// Pointer to a vector containing the dimensions of the current texel. +// pData +// Pointer to user data. +// +//---------------------------------------------------------------------------- + +typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, + CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); + +typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut, + CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData); + + + +//---------------------------------------------------------------------------- +// D3DXIMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// MipLevels +// Number of mip levels in original image +// Format +// D3D format which most closely describes the data in original image +// ResourceType +// D3DRESOURCETYPE representing the type of texture stored in the file. +// D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE. +// ImageFileFormat +// D3DXIMAGE_FILEFORMAT representing the format of the image file. +// +//---------------------------------------------------------------------------- + +typedef struct _D3DXIMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + D3DFORMAT Format; + D3DRESOURCETYPE ResourceType; + D3DXIMAGE_FILEFORMAT ImageFileFormat; + +} D3DXIMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +; +//---------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource: +// ------------------------------ +// Fills in a D3DXIMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetImageInfoFromFileA( + LPCSTR pSrcFile, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXGetImageInfoFromFileW( + LPCWSTR pSrcFile, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW +#else +#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DXGetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXGetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW +#else +#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DXGetImageInfoFromFileInMemory( + LPCVOID pSrcData, + UINT SrcDataSize, + D3DXIMAGE_INFO* pSrcInfo); + + + + +////////////////////////////////////////////////////////////////////////////// +// Load/Save Surface APIs //////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromFile/Resource: +// --------------------------------- +// Load surface from a file or resource +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcRect +// Source rectangle, or NULL for entire image +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromFileA( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCSTR pSrcFile, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadSurfaceFromFileW( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCWSTR pSrcFile, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW +#else +#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA +#endif + + + +HRESULT WINAPI + D3DXLoadSurfaceFromResourceA( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadSurfaceFromResourceW( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + +#ifdef UNICODE +#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW +#else +#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA +#endif + + + +HRESULT WINAPI + D3DXLoadSurfaceFromFileInMemory( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCVOID pSrcData, + UINT SrcDataSize, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromSurface: +// --------------------------- +// Load surface from another surface (with color conversion) +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcSurface +// Source surface +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for entire surface +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromSurface( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey); + + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromMemory: +// -------------------------- +// Load surface from memory. +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcMemory +// Pointer to the top-left corner of the source image in memory +// SrcFormat +// Pixel format of the source image. +// SrcPitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the width of one row of cells, in bytes. +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle. +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromMemory( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCVOID pSrcMemory, + D3DFORMAT SrcFormat, + UINT SrcPitch, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey); + + +//---------------------------------------------------------------------------- +// D3DXSaveSurfaceToFile: +// ---------------------- +// Save a surface to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcSurface +// Source surface, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for the entire image +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveSurfaceToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + +HRESULT WINAPI + D3DXSaveSurfaceToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + +#ifdef UNICODE +#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW +#else +#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA +#endif + +//---------------------------------------------------------------------------- +// D3DXSaveSurfaceToFileInMemory: +// ---------------------- +// Save a surface to a image file. +// +// Parameters: +// ppDestBuf +// address of pointer to d3dxbuffer for returning data bits +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcSurface +// Source surface, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for the entire image +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveSurfaceToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + + +////////////////////////////////////////////////////////////////////////////// +// Load/Save Volume APIs ///////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromFile/Resource: +// -------------------------------- +// Load volume from a file or resource +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcBox +// Source box, or NULL for entire image +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromFileA( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCSTR pSrcFile, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadVolumeFromFileW( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCWSTR pSrcFile, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW +#else +#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA +#endif + + +HRESULT WINAPI + D3DXLoadVolumeFromResourceA( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadVolumeFromResourceW( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW +#else +#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA +#endif + + + +HRESULT WINAPI + D3DXLoadVolumeFromFileInMemory( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCVOID pSrcData, + UINT SrcDataSize, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromVolume: +// ------------------------- +// Load volume from another volume (with color conversion) +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcVolume +// Source volume +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for entire volume +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromVolume( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey); + + + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromMemory: +// ------------------------- +// Load volume from memory. +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcMemory +// Pointer to the top-left corner of the source volume in memory +// SrcFormat +// Pixel format of the source volume. +// SrcRowPitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the size of one row of cells, in bytes. +// SrcSlicePitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the size of one slice of cells, in bytes. +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box. +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromMemory( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCVOID pSrcMemory, + D3DFORMAT SrcFormat, + UINT SrcRowPitch, + UINT SrcSlicePitch, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey); + + + +//---------------------------------------------------------------------------- +// D3DXSaveVolumeToFile: +// --------------------- +// Save a volume to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcVolume +// Source volume, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for the entire volume +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveVolumeToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +HRESULT WINAPI + D3DXSaveVolumeToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +#ifdef UNICODE +#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW +#else +#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DXSaveVolumeToFileInMemory: +// --------------------- +// Save a volume to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcVolume +// Source volume, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for the entire volume +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveVolumeToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXCheckTextureRequirements: +// ----------------------------- +// Checks texture creation parameters. If parameters are invalid, this +// function returns corrected parameters. +// +// Parameters: +// +// pDevice +// The D3D device to be used +// pWidth, pHeight, pDepth, pSize +// Desired size in pixels, or NULL. Returns corrected size. +// pNumMipLevels +// Number of desired mipmap levels, or NULL. Returns corrected number. +// Usage +// Texture usage flags +// pFormat +// Desired pixel format, or NULL. Returns corrected format. +// Pool +// Memory pool to be used to create texture +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCheckTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pWidth, + UINT* pHeight, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + +HRESULT WINAPI + D3DXCheckCubeTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pSize, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + +HRESULT WINAPI + D3DXCheckVolumeTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pWidth, + UINT* pHeight, + UINT* pDepth, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + + +//---------------------------------------------------------------------------- +// D3DXCreateTexture: +// ------------------ +// Create an empty texture +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// Width, Height, Depth, Size +// size in pixels. these must be non-zero +// MipLevels +// number of mip levels desired. if zero or D3DX_DEFAULT, a complete +// mipmap chain will be created. +// Usage +// Texture usage flags +// Format +// Pixel format. +// Pool +// Memory pool to be used to create texture +// ppTexture, ppCubeTexture, ppVolumeTexture +// The texture object that will be created +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + + +//---------------------------------------------------------------------------- +// D3DXCreateTextureFromFile/Resource: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// Width, Height, Depth, Size +// Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from +// the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2, +// and the device supports NONPOW2 textures, the size will not be rounded. +// If D3DX_FROM_FILE, the size will be taken exactly as it is in the file, +// and the call will fail if this violates device capabilities. +// MipLevels +// Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap +// chain will be created. If D3DX_FROM_FILE, the size will be taken +// exactly as it is in the file, and the call will fail if this violates +// device capabilities. +// Usage +// Texture usage flags +// Format +// Desired pixel format. If D3DFMT_UNKNOWN, the format will be +// taken from the file. If D3DFMT_FROM_FILE, the format will be taken +// exactly as it is in the file, and the call will fail if the device does +// not support the given format. +// Pool +// Memory pool to be used to create texture +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// MipFilter +// D3DX_FILTER flags controlling how each miplevel is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_BOX. +// Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the +// number of mip levels to skip when loading DDS files. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// pPalette +// 256 color palette to be filled in, or NULL +// ppTexture, ppCubeTexture, ppVolumeTexture +// The texture object that will be created +// +//---------------------------------------------------------------------------- + +// FromFile + +HRESULT WINAPI + D3DXCreateTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW +#else +#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW +#else +#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW +#else +#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA +#endif + + +// FromResource + +HRESULT WINAPI + D3DXCreateTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW +#else +#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW +#else +#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW +#else +#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA +#endif + + +// FromFileEx + +HRESULT WINAPI + D3DXCreateTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW +#else +#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW +#else +#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW +#else +#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA +#endif + + +// FromResourceEx + +HRESULT WINAPI + D3DXCreateTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW +#else +#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW +#else +#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW +#else +#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DXCreateTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + +// FromFileInMemoryEx + +HRESULT WINAPI + D3DXCreateTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + + +//---------------------------------------------------------------------------- +// D3DXSaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DXSaveTextureToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + +HRESULT WINAPI + D3DXSaveTextureToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + +#ifdef UNICODE +#define D3DXSaveTextureToFile D3DXSaveTextureToFileW +#else +#define D3DXSaveTextureToFile D3DXSaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DXSaveTextureToFileInMemory: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveTextureToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + + + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXFilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// pPalette +// 256 color palette to be used, or NULL for non-palettized formats +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// Filter +// D3DX_FILTER flags controlling how each miplevel is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFilterTexture( + LPDIRECT3DBASETEXTURE9 pBaseTexture, + CONST PALETTEENTRY* pPalette, + UINT SrcLevel, + DWORD Filter); + +#define D3DXFilterCubeTexture D3DXFilterTexture +#define D3DXFilterVolumeTexture D3DXFilterTexture + + + +//---------------------------------------------------------------------------- +// D3DXFillTexture: +// ---------------- +// Uses a user provided function to fill each texel of each mip level of a +// given texture. +// +// Paramters: +// pTexture, pCubeTexture, pVolumeTexture +// Pointer to the texture to be filled. +// pFunction +// Pointer to user provided evalutor function which will be used to +// compute the value of each texel. +// pData +// Pointer to an arbitrary block of user defined data. This pointer +// will be passed to the function provided in pFunction +//----------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFillTexture( + LPDIRECT3DTEXTURE9 pTexture, + LPD3DXFILL2D pFunction, + LPVOID pData); + +HRESULT WINAPI + D3DXFillCubeTexture( + LPDIRECT3DCUBETEXTURE9 pCubeTexture, + LPD3DXFILL3D pFunction, + LPVOID pData); + +HRESULT WINAPI + D3DXFillVolumeTexture( + LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, + LPD3DXFILL3D pFunction, + LPVOID pData); + +//--------------------------------------------------------------------------- +// D3DXFillTextureTX: +// ------------------ +// Uses a TX Shader target to function to fill each texel of each mip level +// of a given texture. The TX Shader target should be a compiled function +// taking 2 paramters and returning a float4 color. +// +// Paramters: +// pTexture, pCubeTexture, pVolumeTexture +// Pointer to the texture to be filled. +// pTextureShader +// Pointer to the texture shader to be used to fill in the texture +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFillTextureTX( + LPDIRECT3DTEXTURE9 pTexture, + LPD3DXTEXTURESHADER pTextureShader); + + +HRESULT WINAPI + D3DXFillCubeTextureTX( + LPDIRECT3DCUBETEXTURE9 pCubeTexture, + LPD3DXTEXTURESHADER pTextureShader); + + +HRESULT WINAPI + D3DXFillVolumeTextureTX( + LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, + LPD3DXTEXTURESHADER pTextureShader); + + + +//---------------------------------------------------------------------------- +// D3DXComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pTexture +// Pointer to the destination texture +// pSrcTexture +// Pointer to the source heightmap texture +// pSrcPalette +// Source palette of 256 colors, or NULL +// Flags +// D3DX_NORMALMAP flags +// Channel +// D3DX_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXComputeNormalMap( + LPDIRECT3DTEXTURE9 pTexture, + LPDIRECT3DTEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette, + DWORD Flags, + DWORD Channel, + FLOAT Amplitude); + + + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9TEX_H__ + diff --git a/subVersion/d3d9/d3dx9xof.h b/subVersion/d3d9/d3dx9xof.h new file mode 100644 index 0000000..c513f0f --- /dev/null +++ b/subVersion/d3d9/d3dx9xof.h @@ -0,0 +1,299 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9xof.h +// Content: D3DX .X File types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#if !defined( __D3DX9XOF_H__ ) +#define __D3DX9XOF_H__ + +#if defined( __cplusplus ) +extern "C" { +#endif // defined( __cplusplus ) + +//---------------------------------------------------------------------------- +// D3DXF_FILEFORMAT +// This flag is used to specify what file type to use when saving to disk. +// _BINARY, and _TEXT are mutually exclusive, while +// _COMPRESSED is an optional setting that works with all file types. +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILEFORMAT; + +#define D3DXF_FILEFORMAT_BINARY 0 +#define D3DXF_FILEFORMAT_TEXT 1 +#define D3DXF_FILEFORMAT_COMPRESSED 2 + +//---------------------------------------------------------------------------- +// D3DXF_FILESAVEOPTIONS +// This flag is used to specify where to save the file to. Each flag is +// mutually exclusive, indicates the data location of the file, and also +// chooses which additional data will specify the location. +// _TOFILE is paired with a filename (LPCSTR) +// _TOWFILE is paired with a filename (LPWSTR) +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILESAVEOPTIONS; + +#define D3DXF_FILESAVE_TOFILE 0x00L +#define D3DXF_FILESAVE_TOWFILE 0x01L + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADOPTIONS +// This flag is used to specify where to load the file from. Each flag is +// mutually exclusive, indicates the data location of the file, and also +// chooses which additional data will specify the location. +// _FROMFILE is paired with a filename (LPCSTR) +// _FROMWFILE is paired with a filename (LPWSTR) +// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description. +// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description. +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILELOADOPTIONS; + +#define D3DXF_FILELOAD_FROMFILE 0x00L +#define D3DXF_FILELOAD_FROMWFILE 0x01L +#define D3DXF_FILELOAD_FROMRESOURCE 0x02L +#define D3DXF_FILELOAD_FROMMEMORY 0x03L + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADRESOURCE: +//---------------------------------------------------------------------------- + +typedef struct _D3DXF_FILELOADRESOURCE +{ + HMODULE hModule; // Desc + LPCSTR lpName; // Desc + LPCSTR lpType; // Desc +} D3DXF_FILELOADRESOURCE; + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADMEMORY: +//---------------------------------------------------------------------------- + +typedef struct _D3DXF_FILELOADMEMORY +{ + LPCVOID lpMemory; // Desc + SIZE_T dSize; // Desc +} D3DXF_FILELOADMEMORY; + +#if defined( _WIN32 ) && !defined( _NO_COM ) + +// {cef08cf9-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFile, +0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfa-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileSaveObject, +0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfb-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileSaveData, +0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfc-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileEnumObject, +0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfd-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileData, +0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +#endif // defined( _WIN32 ) && !defined( _NO_COM ) + +#if defined( __cplusplus ) +#if !defined( DECLSPEC_UUID ) +#if _MSC_VER >= 1100 +#define DECLSPEC_UUID( x ) __declspec( uuid( x ) ) +#else // !( _MSC_VER >= 1100 ) +#define DECLSPEC_UUID( x ) +#endif // !( _MSC_VER >= 1100 ) +#endif // !defined( DECLSPEC_UUID ) + +interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" ) + ID3DXFile; +interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" ) + ID3DXFileSaveObject; +interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" ) + ID3DXFileSaveData; +interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" ) + ID3DXFileEnumObject; +interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" ) + ID3DXFileData; + +#if defined( _COM_SMARTPTR_TYPEDEF ) +_COM_SMARTPTR_TYPEDEF( ID3DXFile, + __uuidof( ID3DXFile ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject, + __uuidof( ID3DXFileSaveObject ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData, + __uuidof( ID3DXFileSaveData ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject, + __uuidof( ID3DXFileEnumObject ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileData, + __uuidof( ID3DXFileData ) ); +#endif // defined( _COM_SMARTPTR_TYPEDEF ) +#endif // defined( __cplusplus ) + +typedef interface ID3DXFile ID3DXFile; +typedef interface ID3DXFileSaveObject ID3DXFileSaveObject; +typedef interface ID3DXFileSaveData ID3DXFileSaveData; +typedef interface ID3DXFileEnumObject ID3DXFileEnumObject; +typedef interface ID3DXFileData ID3DXFileData; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFile ///////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFile + +DECLARE_INTERFACE_( ID3DXFile, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS, + ID3DXFileEnumObject** ) PURE; + STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS, + D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE; + STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE; + STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileSaveObject /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileSaveObject + +DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; + STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, + SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; + STDMETHOD( Save )( THIS ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileSaveData ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileSaveData + +DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE; + STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; + STDMETHOD( GetId )( THIS_ LPGUID ) PURE; + STDMETHOD( GetType )( THIS_ GUID* ) PURE; + STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, + SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; + STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileEnumObject /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileEnumObject + +DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; + STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; + STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; + STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE; + STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileData ///////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileData + +DECLARE_INTERFACE_( ID3DXFileData, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE; + STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; + STDMETHOD( GetId )( THIS_ LPGUID ) PURE; + STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE; + STDMETHOD( Unlock )( THIS ) PURE; + STDMETHOD( GetType )( THIS_ GUID* ) PURE; + STDMETHOD_( BOOL, IsReference )( THIS ) PURE; + STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; + STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; +}; + +STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile ); + +/* + * DirectX File errors. + */ + +#define _FACD3DXF 0x876 + +#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 ) +#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 ) +#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 ) +#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 ) +#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 ) +#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 ) +#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 ) +#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 ) +#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 ) +#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 ) +#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 ) +#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 ) +#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 ) +#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 ) +#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 ) +#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 ) +#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 ) +#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 ) + +/* + * DirectX File object types. + */ + +#ifndef WIN_TYPES +#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype +#endif + +WIN_TYPES(ID3DXFile, D3DXFILE); +WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT); +WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT); +WIN_TYPES(ID3DXFileData, D3DXFILEDATA); +WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA); + +#if defined( __cplusplus ) +} // extern "C" +#endif // defined( __cplusplus ) + +#endif // !defined( __D3DX9XOF_H__ ) + + diff --git a/subVersion/entity.cpp b/subVersion/entity.cpp new file mode 100644 index 0000000..38ea605 --- /dev/null +++ b/subVersion/entity.cpp @@ -0,0 +1,1570 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#include "stdafx.h" +#include "entity.h" + +/* + ENTITY +*/ +entity::entity() {} +entity::~entity() +{ + this->setGod(0); +} + +void entity::getPos() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_POS, &m_v3Pos); + return; +} + +void entity::setPos(v3 dest) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPosBase + OFFSET_ENTITY_POSBASE_POS, &dest); + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_POS, &dest); + return; +} + +void entity::getCos() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPosBase + OFFSET_ENTITY_POSBASE_COS, &m_fCos); + return; +} + +void entity::setCos(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPosBase + OFFSET_ENTITY_POSBASE_COS, &value); + return; +} + +void entity::getSin() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPosBase + OFFSET_ENTITY_POSBASE_SIN, &m_fSin); + return; +} + +void entity::setSin(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPosBase + OFFSET_ENTITY_POSBASE_SIN, &value); + return; +} + +void entity::getGod() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_GOD, &m_btGod); + return; +} + +void entity::setGod(BYTE value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_GOD, &value); + return; +} + +void entity::getHealth() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH, &m_cmHp.cur); + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH_MAX, &m_cmHp.max); + return; +} +void entity::setHealth(float hp) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH, &hp); + return; +} + +/* + PLAYER +*/ +player::player() {} +player::~player() +{ + this->setRunSpeed(1); + this->setSwimSpeed(1); + this->setRagdoll(m_btRagdoll | 0x20); + this->setSeatbelt((m_btSeatbelt & 0x01) ? m_btSeatbelt ^ 0x01 : m_btSeatbelt); + restorePlayerData(); + //this->setWantedCanChange(1.f); +} + +void player::getHealth() +{ + entity::getHealth(); + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_ARMOR, &m_flArmor); + return; +} + +void player::setHealth(float hp, float armor) +{ + entity::setHealth(hp); + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_ARMOR, &armor); + return; +} + +bool player::loadPlayerData() +{ + if (m_dwpBase == 0) + return 0; + m_playerDataCur.m_isInit = true; + this->getMaxHealth(); + this->getWaterProof(); + if (m_playerDataCur.m_isInit != m_playerDataRestore.m_isInit) + { + m_playerDataRestore = m_playerDataCur; + } + return 1; +} + +void player::restorePlayerData() +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH_MAX, &m_playerDataRestore.m_maxHealth); + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_WATER_PROOF, &m_playerDataRestore.m_dwWaterProof); +} + +void player::getMaxHealth() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH_MAX, &m_playerDataCur.m_maxHealth); + return; +} + +void player::setMaxHealth(float hp) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_ENTITY_HEALTH_MAX, &hp); + return; +} + +void player::getVehicleDamageMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_VEHICLE_DAMAGE_MP, &m_flVehicleDamageMult); + return; +} + +void player::setVehicleDamageMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_VEHICLE_DAMAGE_MP, &value); + return; +} + +void player::getWanted() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_WANTED, &m_dwWanted); + return; +} + +void player::setWanted(DWORD stars) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_WANTED, &stars); + return; +} + +void player::getWantedCanChange() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_WANTED_CAN_CHANGE, &m_flWantedCanChange); + return; +} + +void player::setWantedCanChange(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_WANTED_CAN_CHANGE, &value); + return; +} + +void player::getInVehicle() +{ + BYTE btRead; + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_INVEHICLE, &btRead); + m_bIsInVehicle = !((btRead >> 4) & 1); + return; +} + +void player::getRunSpeed() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_RUN_SPD, &m_flRunSpd); + return; +} + +void player::setRunSpeed(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_RUN_SPD, &value); + return; +} + +void player::getSwimSpeed() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_SWIM_SPD, &m_flSwimSpd); + return; +} + +void player::setSwimSpeed(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_SWIM_SPD, &value); + return; +} + +void player::getNpcIgnore() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_NPC_IGNORE, &m_dwNpcIgnore); + return; +} + +void player::setNpcIgnore(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_NPC_IGNORE, &value); + return; +} + +void player::getFrameFlags() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_FRAMEFLAGS, &m_dwFrameFlags); + return; +} + +void player::setFrameFlags(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_FRAMEFLAGS, &value); + return; +} + +void player::getWaterProof() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_WATER_PROOF, &m_playerDataCur.m_dwWaterProof); + return; +} + +void player::setWaterProof(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_WATER_PROOF, &value); + return; +} + +void player::getRagdoll() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_RAGDOLL, &m_btRagdoll); + return; +} + +void player::setRagdoll(BYTE value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_RAGDOLL, &value); + return; +} + +void player::getSeatbelt() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_SEATBELT, &m_btSeatbelt); + return; +} + +void player::setSeatbelt(BYTE value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_PLAYER_SEATBELT, &value); + return; +} + +void player::getStamina() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_STAMINA, &m_cmStamina); + return; +} + +void player::setStamina(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpPlayerInfo + OFFSET_PLAYER_INFO_STAMINA, &value); + return; +} + +/* + VEHICLE +*/ + +vehicle::vehicle() +{ + m_cmHp.max = 1000.f; + m_cmHpVehicle.max = 1000.f; +} +vehicle::~vehicle() +{ + this->restoreHandling(); + this->setGravity(9.8f); + this->setBoost(1.f); + this->setRocketRechargeSpeed(0.5f); +} + +void vehicle::getHealth() +{ + entity::getHealth(); + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_HEALTH, &m_cmHpVehicle.cur); + return; +} + +void vehicle::setHealth(float hp) +{ + entity::setHealth(hp); + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_HEALTH, &hp); + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_HEALTH2, &hp); + return; +} + +bool vehicle::loadHandling() +{ + if (m_dwpBase == 0) + return 0; + this->getMass(); + this->getBuoyancy(); + this->getAcceleration(); + this->getBrakeForce(); + this->getHandbrakeForce(); + this->getTractionCurveMin(); + this->getDeformationDamageMult(); + this->getColisionDamageMult(); + this->getWeaponDamageMult(); + this->getEngineDamageMult(); + this->getUpShift(); + this->getDownShift(); + this->getSuspensionForce(); + this->getSuspensionHeigh(); + if (m_handlingCur.m_dwpHandling != m_handlingRestore.m_dwpHandling) + { + if (m_handlingRestore.m_dwpHandling != 0) + this->restoreHandling(); + m_handlingRestore = m_handlingCur; + } + return 1; +} + +void vehicle::restoreHandling() +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_MASS, &m_handlingRestore.m_fMass); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BUOYANCY, &m_handlingRestore.m_fBuoyancy); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ACCELERATION, &m_handlingRestore.m_fAcceleration); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BRAKEFORCE, &m_handlingRestore.m_fBrakeForce); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_HANDBRAKEFORCE, &m_handlingRestore.m_fHandbrakeForce); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_TRACTION_CURVE_MIN, &m_handlingRestore.m_fTractionCurveMin); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DEFORM_MULTIPLIER, &m_handlingRestore.m_fDeformationDamageMult); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_COLISION_DAMAGE_MP, &m_handlingRestore.m_fColisionDamageMult); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_WEAPON_DAMAGE_MP, &m_handlingRestore.m_fWeaponDamageMult); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ENGINE_DAMAGE_MP, &m_handlingRestore.m_fEngineDamageMult); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_UPSHIFT, &m_handlingRestore.m_fUpShift); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DOWNSHIFT, &m_handlingRestore.m_fDownShift); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_FORCE, &m_handlingRestore.m_fSuspensionForce); + g_pMemMan->writeMem((DWORD_PTR)m_handlingRestore.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_HEIGH, &m_handlingRestore.m_fSuspensionHeigh); + return; +} + +void vehicle::getMass() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_MASS, &m_handlingCur.m_fMass); + return; +} + +void vehicle::setMass(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_MASS, &value); + return; +} + +void vehicle::getBuoyancy() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BUOYANCY, &m_handlingCur.m_fBuoyancy); + return; +} + +void vehicle::setBuoyancy(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BUOYANCY, &value); + return; +} + +void vehicle::getAcceleration() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ACCELERATION, &m_handlingCur.m_fAcceleration); + return; +} + +void vehicle::setAcceleration(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ACCELERATION, &value); + return; +} + +void vehicle::getBrakeForce() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BRAKEFORCE, &m_handlingCur.m_fBrakeForce); + return; +} + +void vehicle::setBrakeForce(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_BRAKEFORCE, &value); + return; +} + +void vehicle::getHandbrakeForce() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_HANDBRAKEFORCE, &m_handlingCur.m_fHandbrakeForce); + return; +} + +void vehicle::setHandbrakeForce(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_HANDBRAKEFORCE, &value); + return; +} + +void vehicle::getTractionCurveMin() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_TRACTION_CURVE_MIN, &m_handlingCur.m_fTractionCurveMin); + return; +} + +void vehicle::setTractionCurveMin(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_TRACTION_CURVE_MIN, &value); + return; +} + +void vehicle::getGravity() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_GRAVITY, &m_fGravity); + return; +} + +void vehicle::setGravity(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_GRAVITY, &value); + return; +} + +void vehicle::getBoost() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_BOOST, &m_fBoost); + return; +} + +void vehicle::setBoost(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_BOOST, &value); + return; +} + +void vehicle::getRocketRechargeSpeed() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_RECHARGE_SPEED, &m_fRocketRechargeSpeed); + return; +} + +void vehicle::setRocketRechargeSpeed(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_RECHARGE_SPEED, &value); + return; +} + +void vehicle::getBulletproofTires() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_BULLETPROOF_TIRES, &m_btBulletproofTires); + return; +} + +void vehicle::setBulletproofTires(BYTE value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpBase + OFFSET_VEHICLE_BULLETPROOF_TIRES, &value); + return; +} + +void vehicle::getEngineManagementSystem() +{ +} + +void vehicle::setEngineManagementSystem(BYTE value) +{ +} + +void vehicle::getBrakes() +{ +} + +void vehicle::setBrakes(BYTE value) +{ +} + +void vehicle::getTransmission() +{ +} + +void vehicle::setTransmission(BYTE value) +{ +} + +void vehicle::getSuspension() +{ +} + +void vehicle::setSuspension(BYTE value) +{ +} + +void vehicle::getArmor() +{ +} + +void vehicle::setArmor(BYTE value) +{ +} + +void vehicle::getTurboTuning() +{ +} + +void vehicle::setTurboTuning(BYTE value) +{ +} + +void vehicle::getNeonLightRed() +{ +} + +void vehicle::setNeonLightRed(BYTE value) +{ +} + +void vehicle::getNeonLightGreen() +{ +} + +void vehicle::setNeonLightGreen(BYTE value) +{ +} + +void vehicle::getNeonLightBlue() +{ +} + +void vehicle::setNeonLightBlue(BYTE value) +{ +} + +void vehicle::getNeonLightLeft() +{ +} + +void vehicle::setNeonLightLeft(BYTE value) +{ +} + +void vehicle::getNeonLightRight() +{ +} + +void vehicle::setNeonLightRight(BYTE value) +{ +} + +void vehicle::getNeonLightFront() +{ +} + +void vehicle::setNeonLightFront(BYTE value) +{ +} + +void vehicle::getNeonLightBack() +{ +} + +void vehicle::setNeonLightBack(BYTE value) +{ +} + +void vehicle::getTyreSmoke() +{ +} + +void vehicle::setTyreSmoke(BYTE value) +{ +} + +void vehicle::getTyreSmokeRed() +{ +} + +void vehicle::setTyreSmokeRed(BYTE value) +{ +} + +void vehicle::getTyreSmokeGreen() +{ +} + +void vehicle::setTyreSmokeGreen(BYTE value) +{ +} + +void vehicle::getTyreSmokeBlue() +{ +} + +void vehicle::setTyreSmokeBlue(BYTE value) +{ +} + +void vehicle::getLimoWindows() +{ +} + +void vehicle::setLimoWindows(BYTE value) +{ +} + +void vehicle::getVehicleMissles() +{ +} + +void vehicle::setVehicleMissles(BYTE value) +{ +} + +void vehicle::getAircraftBombs() +{ +} + +void vehicle::setAircraftBombs(BYTE value) +{ +} + +void vehicle::getAircraftCountermeasures() +{ +} + +void vehicle::setAircraftCountermeasures(BYTE value) +{ +} + +void vehicle::getOppressorMK2Misseles() +{ +} + +void vehicle::setOppressorMK2Misseles(BYTE value) +{ +} + +void vehicle::getTampaMissles() +{ +} + +void vehicle::setTampaMissles(BYTE value) +{ +} + +void vehicle::getDeformationDamageMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DEFORM_MULTIPLIER, &m_handlingCur.m_fDeformationDamageMult); + return; +} + +void vehicle::setDeformationDamageMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DEFORM_MULTIPLIER, &value); + return; +} + +void vehicle::getUpShift() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_UPSHIFT, &m_handlingCur.m_fUpShift); + return; +} + +void vehicle::setUpShift(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_UPSHIFT, &value); + return; +} + +void vehicle::getSuspensionForce() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_FORCE, &m_handlingCur.m_fSuspensionForce); + return; +} + +void vehicle::setSuspensionForce(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_FORCE, &value); + return; +} + +void vehicle::getSuspensionHeigh() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_HEIGH, &m_handlingCur.m_fSuspensionHeigh); + return; +} + +void vehicle::setSuspensionHeigh(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_SUSPENSION_HEIGH, &value); + return; +} + +void vehicle::getColisionDamageMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_COLISION_DAMAGE_MP, &m_handlingCur.m_fColisionDamageMult); + return; +} + +void vehicle::setColisionDamageMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_COLISION_DAMAGE_MP, &value); + return; +} + +void vehicle::getWeaponDamageMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_WEAPON_DAMAGE_MP, &m_handlingCur.m_fWeaponDamageMult); + return; +} + +void vehicle::setWeaponDamageMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_WEAPON_DAMAGE_MP, &value); + return; +} + +void vehicle::getEngineDamageMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ENGINE_DAMAGE_MP, &m_handlingCur.m_fEngineDamageMult); + return; +} + +void vehicle::setEngineDamageMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_ENGINE_DAMAGE_MP, &value); + return; +} + +/*void vehicle::getOpenableDoors() +{ + g_pMemMan->readMem((DWORD_PTR) m_dwpBase + OFFSET_VEHICLE_OPENABLE_DOORS, m_btOpenableDoors); + return; +} + +void vehicle::setOpenableDoors(BYTE value) +{ + g_pMemMan->writeMem((DWORD_PTR) m_dwpBase + OFFSET_VEHICLE_OPENABLE_DOORS, &value); + return; +}*/ + +void vehicle::getDownShift() +{ + g_pMemMan->readMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DOWNSHIFT, &m_handlingCur.m_fDownShift); + return; +} + +void vehicle::setDownShift(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_handlingCur.m_dwpHandling + OFFSET_VEHICLE_HANDLING_DOWNSHIFT, &value); + return; +} + +/* + WEAPON +*/ + +weapon::weapon() : m_dwHash(0) {}; +weapon::~weapon() +{ + this->restoreWeapon(); +} + +bool weapon::findAmmoBase() +{ + if (m_weapDataCur.m_dwpWeapon == 0) + return 0; + + DWORD_PTR dwpBase = m_dwpAmmoInfo, + dwpBase2; + DWORD dwTmp; + do + { + g_pMemMan->readMem((DWORD_PTR)dwpBase + OFFSET_WEAPON_AMMOINFO_CUR_1, &dwpBase); + g_pMemMan->readMem((DWORD_PTR)dwpBase + OFFSET_WEAPON_AMMOINFO_CUR_2, &dwpBase2); + g_pMemMan->readMem((DWORD_PTR)dwpBase2 + OFFSET_WEAPON_AMMOINFO_TYPE, &dwTmp); + if (dwpBase == 0 || dwpBase2 == 0) + return 0; + } while (dwTmp == 0); + m_dwpCurAmmoBase = dwpBase2; + return 1; +} + +void weapon::getCurAmmo() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpCurAmmoBase + OFFSET_WEAPON_AMMOINFO_CURAMMO, &m_dwCurAmmo); + return; +} + +void weapon::setCurAmmo(DWORD ammo) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpCurAmmoBase + OFFSET_WEAPON_AMMOINFO_CURAMMO, &ammo); + return; +} + +void weapon::getMaxAmmo() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpAmmoInfo + OFFSET_WEAPON_AMMOINFO_MAX, &m_dwMaxAmmo); + return; +} + +bool weapon::loadWeapon() +{ + if (m_weapDataCur.m_dwpWeapon == 0) + return 0; + this->getHash(); + this->getBulletDamage(); + this->getReloadSpeed(); + this->getReloadVehicle(); + this->getForceOnPed(); + this->getForceOnVehicle(); + this->getForceOnHeli(); + this->getRecoil(); + this->getSpread(); + this->getRange(); + this->getSpinUp(); + this->getSpin(); + this->getBulletBatch(); + this->getImpactType(); + this->getImpactExplosion(); + this->getMuzzleVelocity(); + if (m_weapDataCur.m_dwHash != m_weapDataRestore.m_dwHash) + { + if (m_weapDataRestore.m_dwpWeapon != 0) + this->restoreWeapon(); + m_weapDataRestore = m_weapDataCur; + } + return 1; +} + +void weapon::restoreWeapon() +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_SPREAD, &m_weapDataRestore.m_fSpread); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_RECOIL, &m_weapDataRestore.m_fRecoil); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_BULLET_DMG, &m_weapDataRestore.m_fDamage); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_RELOAD_MULTIPLIER, &m_weapDataRestore.m_fReload); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_RELOAD_VEHICLE, &m_weapDataRestore.m_fReloadVeh); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_RANGE, &m_weapDataRestore.m_fRange); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_SPINUP, &m_weapDataRestore.m_fSpinUp); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_SPIN, &m_weapDataRestore.m_fSpin); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_PED, &m_weapDataRestore.m_fForceOnPed); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_VEHICLE, &m_weapDataRestore.m_fForceOnVehicle); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_HELI, &m_weapDataRestore.m_fForceOnHeli); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_BULLET_BATCH, &m_weapDataRestore.m_dwBulletBatch); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_IMPACT_TYPE, &m_weapDataRestore.m_dwImpactType); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_IMPACT_EXPLOSION, &m_weapDataRestore.m_dwImpactExplosion); + g_pMemMan->writeMem((DWORD_PTR)m_weapDataRestore.m_dwpWeapon + OFFSET_WEAPON_MUZZLE_VELOCITY, &m_weapDataRestore.m_fMuzzleVelocity); + return; +} + +void weapon::getReloadSpeed() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RELOAD_MULTIPLIER, &m_weapDataCur.m_fReload); + return; +} + +void weapon::setReloadSpeed(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RELOAD_MULTIPLIER, &value); + return; +} + +void weapon::getReloadVehicle() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RELOAD_VEHICLE, &m_weapDataCur.m_fReloadVeh); + return; +} + +void weapon::setReloadVehicle(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RELOAD_VEHICLE, &value); + return; +} + +void weapon::getBulletDamage() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_BULLET_DMG, &m_weapDataCur.m_fDamage); + return; +} + +void weapon::setBulletDamage(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_BULLET_DMG, &value); + return; +} + +void weapon::getRecoil() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RECOIL, &m_weapDataCur.m_fRecoil); + return; +} + +void weapon::setRecoil(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RECOIL, &value); + return; +} + +void weapon::getSpread() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPREAD, &m_weapDataCur.m_fSpread); + return; +} + +void weapon::setSpread(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPREAD, &value); + return; +} + +void weapon::getRange() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RANGE, &m_weapDataCur.m_fRange); + return; +} + +void weapon::setRange(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_RANGE, &value); + return; +} + +void weapon::getSpinUp() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPINUP, &m_weapDataCur.m_fSpinUp); + return; +} + +void weapon::setSpinUp(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPINUP, &value); + return; +} + +void weapon::getSpin() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPIN, &m_weapDataCur.m_fSpin); + return; +} + +void weapon::setSpin(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_SPIN, &value); + return; +} + +void weapon::getForceOnPed() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_PED, &m_weapDataCur.m_fForceOnPed); + return; +} + +void weapon::setForceOnPed(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_PED, &value); + return; +} + +void weapon::getForceOnVehicle() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_VEHICLE, &m_weapDataCur.m_fForceOnVehicle); + return; +} + +void weapon::setForceOnVehicle(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_VEHICLE, &value); + return; +} + +void weapon::getForceOnHeli() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_HELI, &m_weapDataCur.m_fForceOnHeli); + return; +} + +void weapon::setForceOnHeli(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_FORCE_ON_HELI, &value); + return; +} + +void weapon::getHash() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_NAME_HASH, &m_weapDataCur.m_dwHash); + return; +} + +void weapon::getBulletBatch() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_BULLET_BATCH, &m_weapDataCur.m_dwBulletBatch); + return; +} + +void weapon::setBulletBatch(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_BULLET_BATCH, &value); + return; +} + +void weapon::getImpactType() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_IMPACT_TYPE, &m_weapDataCur.m_dwImpactType); + return; +} + +void weapon::setImpactType(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_IMPACT_TYPE, &value); + return; +} + +void weapon::getImpactExplosion() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_IMPACT_EXPLOSION, &m_weapDataCur.m_dwImpactExplosion); + return; +} + +void weapon::setImpactExplosion(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_IMPACT_EXPLOSION, &value); + return; +} + +void weapon::getMuzzleVelocity() +{ + g_pMemMan->readMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_MUZZLE_VELOCITY, &m_weapDataCur.m_fMuzzleVelocity); + return; +} + +void weapon::setMuzzleVelocity(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_weapDataCur.m_dwpWeapon + OFFSET_WEAPON_MUZZLE_VELOCITY, &value); + return; +} + +/* + TUNABLE +*/ + +tunable::tunable() +{ +} + +tunable::~tunable() +{ + this->restoreTunable(); +} + +void tunable::restoreTunable() +{ + setRpMult(1); + setApMult(1); + setMinMissionPayout(0); +} + +void tunable::getRpMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_RP_MULTIPLIER, &m_fRpMult); + return; +} + +void tunable::setRpMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_RP_MULTIPLIER, &value); + return; +} + +void tunable::getApMult() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_AP_MULTIPLIER, &m_fApMult); + return; +} + +void tunable::setApMult(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_AP_MULTIPLIER, &value); + return; +} + +void tunable::getMinMissionPayout() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_MIN_MISSION_PAYOUT, &m_fMinMissionPayout); + return; +} + +void tunable::setMinMissionPayout(float value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_MIN_MISSION_PAYOUT, &value); + return; +} + +void tunable::getOrbitalCannonCooldown() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ORBITAL_CANNON_COOLDOWN, &m_dwOrbitalCannonCooldown); + return; +} + +void tunable::setOrbitalCannonCooldown(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ORBITAL_CANNON_COOLDOWN, &value); + return; +} + +void tunable::getBunkerResearch() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_BUNKER_RESEARCH, &m_dwBunkerResearch); + return; +} + +void tunable::setBunkerResearch(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_BUNKER_RESEARCH, &value); + return; +} + +void tunable::getAntiIdleKick1() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK1, &m_dwAntiIdleKick1); + return; +} + +void tunable::setAntiIdleKick1(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK1, &value); + return; +} + +void tunable::getAntiIdleKick2() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK2, &m_dwAntiIdleKick2); + return; +} + +void tunable::setAntiIdleKick2(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK2, &value); + return; +} + +void tunable::getAntiIdleKick3() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK3, &m_dwAntiIdleKick3); + return; +} + +void tunable::setAntiIdleKick3(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK3, &value); + return; +} + +void tunable::getAntiIdleKick4() +{ + g_pMemMan->readMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK4, &m_dwAntiIdleKick4); + return; +} + +void tunable::setAntiIdleKick4(DWORD value) +{ + g_pMemMan->writeMem((DWORD_PTR)m_dwpTunableBase + OFFSET_TUNABLE_ANTI_IDLE_KICK4, &value); + return; +} + + + +/* + GLOBAL +*/ + +global::global() +{ +} + +global::~global() +{ +} + +bool global::initStatPtr(HMODULE base) +{ + m_dwpStatCall = getGlobal(1377170, base) + 0x2398; + m_dwpStatHash = getGlobal(1387876, base) + 0x20; + m_dwpStatValue = getGlobal(939452, base) + 0xACB0; + + + return m_dwpStatCall != 0 || m_dwpStatHash != 0 || m_dwpStatValue != 0; +} + +bool global::initMoneyPtr(HMODULE base) +{ + m_dwpMoneyObject = getGlobal(2513253, base); + m_dwpMoneyVal = getGlobal(2513247 + 1, base); + m_dwpMoneyPosX = getGlobal(2513247 + 3, base); + m_dwpMoneyPosY = getGlobal(2513247 + 4, base); + m_dwpMoneyPosZ = getGlobal(2513247 + 5, base); + + return m_dwpMoneyObject != 0 || m_dwpMoneyVal != 0 || m_dwpMoneyPosX != 0 + || m_dwpMoneyPosY != 0 || m_dwpMoneyPosZ != 0; +} + +bool global::initSessionPtr(HMODULE base) +{ + m_dwpSessionID = getGlobal(1312836, base); + m_dwpSessionTransition = getGlobal(1312425, base); + + return m_dwpSessionID != 0 || m_dwpSessionTransition != 0; +} + +bool global::initIntoPVPtr(HMODULE base) +{ + m_dwpIntoPersonalVehicle = getGlobal(2409287 + 8, base); + + return m_dwpIntoPersonalVehicle != 0; +} + +bool global::initVehiclePtr(HMODULE base) +{ + m_dwpVehicleSpawn1 = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 2, base); + m_dwpVehicleSpawn2 = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 5, base); + m_dwpVehicleHash = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 66, base); + m_dwpVehicleKickPrevent1 = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 121, base); + m_dwpVehicleKickPrevent2 = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 122, base); + m_dwpVehicleX = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 7 + 0, base); + m_dwpVehicleY = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 7 + 1, base); + m_dwpVehicleZ = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 7 + 2, base); + m_dwpPrimaryColor = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 5, base); + m_dwpSecondaryColor = getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 6, base); + + return m_dwpVehicleSpawn1 != 0 || m_dwpVehicleSpawn2 != 0 || m_dwpVehicleHash != 0 || + m_dwpVehicleKickPrevent1 != 0 || m_dwpVehicleKickPrevent2 != 0 || + m_dwpVehicleX != 0 || m_dwpVehicleY != 0 || + m_dwpVehicleZ != 0 || m_dwpPrimaryColor != 0 || m_dwpSecondaryColor; +} + + +bool global::findMoneyPtr(HMODULE base) +{ + float buffer; + DWORD_PTR dwpTemp = getGlobal(2513247, base); + g_pMemMan->readMem(dwpTemp, &buffer); + m_dwpMoneyCall = getGlobal(85 * (DWORD)buffer + 4263954 + 69, base); + return true; +} + +DWORD_PTR global::getGlobal(int atIndex, HMODULE base) +{ + DWORD_PTR dwpBuffer; + g_pMemMan->readMem((DWORD_PTR)base + ADDRESS_GLOBAL + 8 * ((atIndex >> 0x12) & 0x3F), &dwpBuffer); + return 8 * (atIndex & 0x3FFFF) + dwpBuffer; +} + +void global::getStatHash() +{ + g_pMemMan->readMem(m_dwpStatHash, &m_dwStatHash); + return; +} + +void global::setStatHash(unsigned int value) +{ + g_pMemMan->writeMem(m_dwpStatHash, &value); + return; +} + +void global::getStatValue() +{ + g_pMemMan->readMem(m_dwpStatValue, &m_dwStatValue); + return; +} + +void global::setStatValue(int value) +{ + g_pMemMan->writeMem(m_dwpStatValue, &value); + return; +} + +void global::getStatCall() +{ + g_pMemMan->readMem(m_dwpStatCall, &m_dwStatCall); + return; +} + +void global::setStatCall(int value) +{ + g_pMemMan->writeMem(m_dwpStatCall, &value); + return; +} + +void global::getMoneyObject() +{ + g_pMemMan->readMem(m_dwpMoneyObject, &m_btMoneyObject); + return; +} + +void global::setMoneyObject(BYTE value) +{ + g_pMemMan->writeMem(m_dwpMoneyObject, &value); + return; +} + +void global::getMoneyVal() +{ + g_pMemMan->readMem(m_dwpMoneyVal, &m_dwMoneyVal); + return; +} + +void global::setMoneyVal(int value) +{ + g_pMemMan->writeMem(m_dwpMoneyVal, &value); + return; +} + +void global::getMoneyPosX() +{ + g_pMemMan->readMem(m_dwpMoneyPosX, &m_fMoneyPosX); + return; +} + +void global::setMoneyPosX(float value) +{ + g_pMemMan->writeMem(m_dwpMoneyPosX, &value); + return; +} + +void global::getMoneyPosY() +{ + g_pMemMan->readMem(m_dwpMoneyPosY, &m_fMoneyPosY); + return; +} + +void global::setMoneyPosY(float value) +{ + g_pMemMan->writeMem(m_dwpMoneyPosY, &value); + return; +} + +void global::getMoneyPosZ() +{ + g_pMemMan->readMem(m_dwpMoneyPosZ, &m_fMoneyPosZ); + return; +} + +void global::setMoneyPosZ(float value) +{ + g_pMemMan->writeMem(m_dwpMoneyPosZ, &value); + return; +} + +void global::getMoneyCall() +{ + g_pMemMan->readMem(m_dwpMoneyCall, &m_btMoneyCall); + return; +} + +void global::setMoneyCall(BYTE value) +{ + g_pMemMan->writeMem(m_dwpMoneyCall, &value); + return; +} + +void global::getSessionTransition() +{ + g_pMemMan->readMem(m_dwpSessionTransition, &m_dwSessionTransition); + return; +} + +void global::setSessionTransition(int value) +{ + g_pMemMan->writeMem(m_dwpSessionTransition, &value); + return; +} + +void global::getSessionID() +{ + g_pMemMan->readMem(m_dwpSessionID, &m_dwSessionID); + return; +} + +void global::setSessionID(int value) +{ + g_pMemMan->writeMem(m_dwpSessionID, &value); + return; +} + +void global::getIntoPersonalVehicle() +{ + g_pMemMan->readMem(m_dwpIntoPersonalVehicle, &m_dwIntoPersonalVehicle); + return; +} + +void global::setIntoPersonalVehicle(int value) +{ + g_pMemMan->writeMem(m_dwpIntoPersonalVehicle, &value); + return; +} + +void global::getVehicleSpawn1() +{ + g_pMemMan->readMem(m_dwpVehicleSpawn1, &m_dwVehicleSpawn1); + return; +} + +void global::setVehicleSpawn1(int value) +{ + g_pMemMan->writeMem(m_dwpVehicleSpawn1, &value); + return; +} + +void global::getVehicleSpawn2() +{ + g_pMemMan->readMem(m_dwpVehicleSpawn2, &m_dwVehicleSpawn2); + return; +} + +void global::setVehicleSpawn2(int value) +{ + g_pMemMan->writeMem(m_dwpVehicleSpawn2, &value); + return; +} + +void global::getVehicleHash() +{ + g_pMemMan->readMem(m_dwpVehicleHash, &m_dwVehicleHash); + return; +} + +void global::setVehicleHash(unsigned int value) +{ + g_pMemMan->writeMem(m_dwpVehicleHash, &value); + return; + +} + +void global::getVehicleKickPrevent1() +{ + g_pMemMan->readMem(m_dwpVehicleKickPrevent1, &m_dwVehicleKickPrevent1); + return; +} + +void global::setVehicleKickPrevent1(int value) +{ + g_pMemMan->writeMem(m_dwpVehicleKickPrevent1, &value); + return; +} + +void global::getVehicleKickPrevent2() +{ + g_pMemMan->readMem(m_dwpVehicleKickPrevent2, &m_dwVehicleKickPrevent2); + return; +} + +void global::setVehicleKickPrevent2(int value) +{ + g_pMemMan->writeMem(m_dwpVehicleKickPrevent2, &value); + return; +} + +void global::getVehiclePosX() +{ + g_pMemMan->readMem(m_dwpVehicleX, &m_fVehicleX); + return; +} + +void global::setVehiclePosX(float value) +{ + g_pMemMan->writeMem(m_dwpVehicleX, &value); + return; +} + +void global::getVehiclePosY() +{ + g_pMemMan->readMem(m_dwpVehicleY, &m_fVehicleY); + return; +} + +void global::setVehiclePosY(float value) +{ + g_pMemMan->writeMem(m_dwpVehicleY, &value); + return; +} + +void global::getVehiclePosZ() +{ + g_pMemMan->readMem(m_dwpVehicleZ, &m_fVehicleZ); + return; +} + +void global::setVehiclePosZ(float value) +{ + g_pMemMan->writeMem(m_dwpVehicleZ, &value); + return; +} + +void global::getPrimaryColor() +{ + g_pMemMan->readMem(m_dwpPrimaryColor, &m_btPrimaryColor); + return; +} + +void global::setPrimaryColor(BYTE value) +{ + g_pMemMan->writeMem(m_dwpPrimaryColor, &value); + return; +} + +void global::getSecondaryColor() +{ + g_pMemMan->readMem(m_dwpSecondaryColor, &m_btSecondaryColor); + return; +} + +void global::setSecondaryColor(BYTE value) +{ + g_pMemMan->writeMem(m_dwpSecondaryColor, &value); + return; +} + +replayInterface::replayInterface() +{ +} + +replayInterface::~replayInterface() +{ +} + +void replayInterface::initPeds() +{ + for (size_t i = 0; i < dw_curPedNum; i++) + { + delete g_pPedList[i]; + g_pPedList[i] = nullptr; + } + dw_curPedNum = 256; + //g_pMemMan->readMem((DWORD_PTR)m_dwpPedInterface + OFFSET_PED_INTERFACE_CUR_PEDS, &dw_curPedNum); + + for (size_t i = 0; i < dw_curPedNum; i++) + { + g_pPedList[i] = new entity(); + g_pMemMan->readMem((DWORD_PTR)m_dwpPedList + i * 0x10, &g_pPedList[i]->m_dwpBase); + g_pMemMan->readMem((DWORD_PTR)g_pPedList[i]->m_dwpBase + OFFSET_ENTITY_POSBASE, &g_pPedList[i]->m_dwpPosBase); + } +} diff --git a/subVersion/entity.h b/subVersion/entity.h new file mode 100644 index 0000000..379f225 --- /dev/null +++ b/subVersion/entity.h @@ -0,0 +1,538 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#pragma once +#ifndef ENTITY_H +#define ENTITY_H + +typedef struct +{ + float cur, max; +} curmax; + +class entity +{ + public: + curmax m_cmHp; + v3 m_v3Pos; + float m_fCos,m_fSin; + BYTE m_btGod; + + entity(); + ~entity(); + virtual void getPos(); + virtual void setPos(v3 dest); + virtual void getCos(); + virtual void setCos(float value); + virtual void getSin(); + virtual void setSin(float value); + virtual void getHealth(); + virtual void setHealth(float hp); + virtual void getGod(); + virtual void setGod(BYTE value); + + DWORD_PTR m_dwpBase, + m_dwpPosBase; +}; + +class player : public entity +{ + public: + float m_flArmor, + m_flRunSpd, + m_flSwimSpd, + m_flWantedCanChange, + m_flVehicleDamageMult; + DWORD m_dwWanted, + m_dwNpcIgnore, + m_dwFrameFlags; + BYTE m_btRagdoll, + m_btSeatbelt; + bool m_bIsInVehicle; + curmax m_cmStamina; + + struct playerData + { + bool m_isInit; + DWORD m_dwWaterProof; + float m_maxHealth; + }; + playerData m_playerDataRestore,//the original values will be stored here. + m_playerDataCur; + + player(); + ~player(); + virtual void getHealth(); + virtual void setHealth(float hp, float armor); + bool loadPlayerData(); + void restorePlayerData(); + void getMaxHealth(); + void setMaxHealth(float hp); + void getVehicleDamageMult(); + void setVehicleDamageMult(float value); + void getWanted(); + void setWanted(DWORD stars); + void getWantedCanChange(); + void setWantedCanChange(float value); + void getInVehicle(); + void getRunSpeed(); + void setRunSpeed(float value); + void getSwimSpeed(); + void setSwimSpeed(float value); + void getNpcIgnore(); + void setNpcIgnore(DWORD value); + void getFrameFlags(); + void setFrameFlags(DWORD value); + void getWaterProof(); + void setWaterProof(DWORD value); + void getRagdoll(); + void setRagdoll(BYTE value); + void getSeatbelt(); + void setSeatbelt(BYTE value); + void getStamina(); + void setStamina(float value); + + DWORD_PTR m_dwpPlayerInfo; +}; + +class vehicle : public entity +{ + public: + curmax m_cmHpVehicle; + float m_fBoost, + m_fRocketRechargeSpeed, + m_fGravity; + BYTE m_btBulletproofTires, + m_btEngineManagementSystem, + m_btBrakes, + m_btTransmission, + m_btSuspension, + m_btArmor, + m_btTurboTuning, + m_btNeonLightRed, + m_btNeonLightGreen, + m_btNeonLightBlue, + m_btNeonLightLeft, + m_btNeonLightRight, + m_btNeonLightFront, + m_btNeonLightBack, + m_btTyreSmoke, + m_btTyreSmokeRed, + m_btTyreSmokeGreen, + m_btTyreSmokeBlue, + m_btLimoWindows, + m_btVehicleMissles, + m_btAircraftBombs, + m_btAircraftCountermeasures, + m_btOppressorMK2Misseles, + m_btTampaMissles; + + + struct vehicleHandling + { + DWORD_PTR m_dwpHandling = 0; + float m_fMass, + m_fBuoyancy, + m_fAcceleration, + m_fUpShift, + m_fDownShift, + m_fBrakeForce, + m_fHandbrakeForce, + m_fTractionCurveMin, + m_fSuspensionForce, + m_fSuspensionHeigh, + m_fColisionDamageMult, + m_fWeaponDamageMult, + m_fDeformationDamageMult, + m_fEngineDamageMult; + }; + + vehicleHandling m_handlingRestore, + m_handlingCur; + + vehicle(); + ~vehicle(); + void getHealth(); + void setHealth(float hp); + bool loadHandling(); + void restoreHandling(); + void getMass(); + void setMass(float value); + void getBuoyancy(); + void setBuoyancy(float value); + void getAcceleration(); + void setAcceleration(float value); + void getBrakeForce(); + void setBrakeForce(float value); + void getHandbrakeForce(); + void setHandbrakeForce(float value); + void getTractionCurveMin(); + void setTractionCurveMin(float value); + void getGravity(); + void setGravity(float value); + void getBoost(); + void setBoost(float value); + void getRocketRechargeSpeed(); + void setRocketRechargeSpeed(float value); + void getBulletproofTires(); + void setBulletproofTires(BYTE value); + void getEngineManagementSystem(); + void setEngineManagementSystem(BYTE value); + void getBrakes(); + void setBrakes(BYTE value); + void getTransmission(); + void setTransmission(BYTE value); + void getSuspension(); + void setSuspension(BYTE value); + void getArmor(); + void setArmor(BYTE value); + void getTurboTuning(); + void setTurboTuning(BYTE value); + void getNeonLightRed(); + void setNeonLightRed(BYTE value); + void getNeonLightGreen(); + void setNeonLightGreen(BYTE value); + void getNeonLightBlue(); + void setNeonLightBlue(BYTE value); + void getNeonLightLeft(); + void setNeonLightLeft(BYTE value); + void getNeonLightRight(); + void setNeonLightRight(BYTE value); + void getNeonLightFront(); + void setNeonLightFront(BYTE value); + void getNeonLightBack(); + void setNeonLightBack(BYTE value); + void getTyreSmoke(); + void setTyreSmoke(BYTE value); + void getTyreSmokeRed(); + void setTyreSmokeRed(BYTE value); + void getTyreSmokeGreen(); + void setTyreSmokeGreen(BYTE value); + void getTyreSmokeBlue(); + void setTyreSmokeBlue(BYTE value); + void getLimoWindows(); + void setLimoWindows(BYTE value); + void getVehicleMissles(); + void setVehicleMissles(BYTE value); + void getAircraftBombs(); + void setAircraftBombs(BYTE value); + void getAircraftCountermeasures(); + void setAircraftCountermeasures(BYTE value); + void getOppressorMK2Misseles(); + void setOppressorMK2Misseles(BYTE value); + void getTampaMissles(); + void setTampaMissles(BYTE value); + void getDeformationDamageMult(); + void setDeformationDamageMult(float value); + void getUpShift(); + void setUpShift(float value); + void getSuspensionForce(); + void setSuspensionForce(float value); + void getSuspensionHeigh(); + void setSuspensionHeigh(float value); + void getColisionDamageMult(); + void setColisionDamageMult(float value); + void getWeaponDamageMult(); + void setWeaponDamageMult(float value); + void getEngineDamageMult(); + void setEngineDamageMult(float value); + void getDownShift(); + void setDownShift(float value); +}; + +enum ImpactTypeEnum +{ + Fists = 2, + Bullets = 3, + Explosives = 5, +}; + +enum ImpactExplosionEnum +{ + DefaultBullets = 4294967295, + GrenadeExplosion = 1, + StickyBombExplosion = 2, + MoltovCoctailExplosion = 3, + SuperLauncher = 59, + LightningExplosion = 58, + BigExplosion = 4, + MediumExplosion = 40, + TinyExplosion = 25, + BigFireyExplosion = 5, + SmallWaterSpray = 11, + SmallFireSpray = 12, + BigWaterSpray = 13, + BigFireSpray = 14, + MK2ExplosiveBullets = 18, + SmokeGrenade = 19, + TearGas = 20, + TearGas2 = 21, + RedFlareSmoke = 22, + CoolGroundExplosion = 23, + CRAZYSHOCKWAVEEXPLOSION = 26, + HUGEFireyExplosion = 28, + MassiveBlimpExplosion = 29, + MassiveBlimpExplosion2 = 37, + LargeExplosionFallingDebris = 31, + FireBallExplosion = 32, + FireworkExplosion = 38, + SnowballHit = 39, + TinyExplosions2 = 33, + JustScreenShake = 41, + SPOOFEXPLOSION = 99 +}; + +class weapon +{ + public: + DWORD m_dwCurAmmo, + m_dwMaxAmmo, + m_dwHash; //name hash + struct weaponData + { + DWORD m_dwHash = 0, + m_dwBulletBatch, + m_dwImpactType, + m_dwImpactExplosion; + DWORD_PTR m_dwpWeapon = 0; + float m_fSpread, + m_fRecoil, + m_fDamage, + m_fReload, + m_fReloadVeh, + m_fRange, + m_fSpinUp, + m_fSpin, + m_fMuzzleVelocity, + m_fPenetration, + m_fForceOnPed, + m_fForceOnVehicle, + m_fForceOnHeli; + }; + + weaponData m_weapDataRestore,//the original values will be stored here. + m_weapDataCur; + + weapon(); + ~weapon(); + bool loadWeapon(); + void restoreWeapon(); + void getReloadSpeed(); + void setReloadSpeed(float value); + void getReloadVehicle(); + void setReloadVehicle(float value); + void getBulletDamage(); + void setBulletDamage(float value); + void getRecoil(); + void setRecoil(float value); + void getSpread(); + void setSpread(float value); + void getRange(); + void setRange(float value); + void getSpinUp(); + void setSpinUp(float value); + void getSpin(); + void setSpin(float value); + void getForceOnPed(); + void setForceOnPed(float value); + void getForceOnVehicle(); + void setForceOnVehicle(float value); + void getForceOnHeli(); + void setForceOnHeli(float value); + void getHash(); + bool findAmmoBase(); + void getCurAmmo(); + void setCurAmmo(DWORD ammo); + void getMaxAmmo(); + void getBulletBatch(); + void setBulletBatch(DWORD value); + void getImpactType(); + void setImpactType(DWORD value); + void getImpactExplosion(); + void setImpactExplosion(DWORD value); + void getMuzzleVelocity(); + void setMuzzleVelocity(float value); + + DWORD_PTR m_dwpAmmoInfo, + m_dwpCurAmmoBase; +}; + +class tunable +{ + public: + float m_fRpMult, + m_fApMult, + m_fMinMissionPayout; + DWORD m_dwOrbitalCannonCooldown, + m_dwBunkerResearch, + m_dwAntiIdleKick1, + m_dwAntiIdleKick2, + m_dwAntiIdleKick3, + m_dwAntiIdleKick4; + tunable(); + ~tunable(); + void restoreTunable(); + void getRpMult(); + void setRpMult(float value); + void getApMult(); + void setApMult(float value); + void getMinMissionPayout(); + void setMinMissionPayout(float value); + void getOrbitalCannonCooldown(); + void setOrbitalCannonCooldown(DWORD value); + void getBunkerResearch(); + void setBunkerResearch(DWORD value); + void getAntiIdleKick1(); + void setAntiIdleKick1(DWORD value); + void getAntiIdleKick2(); + void setAntiIdleKick2(DWORD value); + void getAntiIdleKick3(); + void setAntiIdleKick3(DWORD value); + void getAntiIdleKick4(); + void setAntiIdleKick4(DWORD value); + + DWORD_PTR m_dwpTunableBase; +}; + + +class global +{ + public: + DWORD_PTR m_dwpStatHash, + m_dwpStatValue, + m_dwpStatCall, + m_dwpMoneyObject, + m_dwpMoneyVal, + m_dwpMoneyPosX, + m_dwpMoneyPosY, + m_dwpMoneyPosZ, + m_dwpMoneyCall, + m_dwpSessionTransition, + m_dwpSessionID, + m_dwpIntoPersonalVehicle, + m_dwpVehicleSpawn1, + m_dwpVehicleSpawn2, + m_dwpVehicleHash, + m_dwpVehicleKickPrevent1, + m_dwpVehicleKickPrevent2, + m_dwpVehicleX, + m_dwpVehicleY, + m_dwpVehicleZ, + m_dwpPrimaryColor, + m_dwpSecondaryColor; + + unsigned int m_dwStatHash, + m_dwVehicleHash, + m_dwStatHashSet; + int m_dwStatValue, + m_dwStatCall, + m_dwMoneyVal, + m_dwSessionTransition, + m_dwSessionID, + m_dwIntoPersonalVehicle, + m_dwVehicleSpawn1, + m_dwVehicleSpawn2, + m_dwVehicleKickPrevent1, + m_dwVehicleKickPrevent2; + float m_fMoneyPosX, + m_fMoneyPosY, + m_fMoneyPosZ, + m_fVehicleX, + m_fVehicleY, + m_fVehicleZ; + BYTE m_btMoneyObject, + m_btMoneyCall, + m_btPrimaryColor, + m_btSecondaryColor; + + global(); + ~global(); + bool initStatPtr(HMODULE base); + bool initMoneyPtr(HMODULE base); + bool initSessionPtr(HMODULE base); + bool initIntoPVPtr(HMODULE base); + bool initVehiclePtr(HMODULE base); + bool findMoneyPtr(HMODULE base); + void getStatHash(); + void setStatHash(unsigned int value); + void getStatValue(); + void setStatValue(int value); + void getStatCall(); + void setStatCall(int value); + void getMoneyObject(); + void setMoneyObject(BYTE value); + void getMoneyVal(); + void setMoneyVal(int value); + void getMoneyPosX(); + void setMoneyPosX(float value); + void getMoneyPosY(); + void setMoneyPosY(float value); + void getMoneyPosZ(); + void setMoneyPosZ(float value); + void getMoneyCall(); + void setMoneyCall(BYTE value); + void getSessionTransition(); + void setSessionTransition(int value); + void getSessionID(); + void setSessionID(int value); + void getIntoPersonalVehicle(); + void setIntoPersonalVehicle(int value); + void getVehicleSpawn1(); + void setVehicleSpawn1(int value); + void getVehicleSpawn2(); + void setVehicleSpawn2(int value); + void getVehicleHash(); + void setVehicleHash(unsigned int value); + void getVehicleKickPrevent1(); + void setVehicleKickPrevent1(int value); + void getVehicleKickPrevent2(); + void setVehicleKickPrevent2(int value); + void getVehiclePosX(); + void setVehiclePosX(float value); + void getVehiclePosY(); + void setVehiclePosY(float value); + void getVehiclePosZ(); + void setVehiclePosZ(float value); + void getPrimaryColor(); + void setPrimaryColor(BYTE value); + void getSecondaryColor(); + void setSecondaryColor(BYTE value); + + DWORD_PTR getGlobal(int value, HMODULE base); + + DWORD_PTR m_dwpGlobalBase; +}; + + +class replayInterface +{ +public: + entity *g_pPedList[256]; + DWORD dw_curPedNum; + + replayInterface(); + ~replayInterface(); + void initPeds(); + + + DWORD_PTR m_dwpReplayInterfaceBase, + m_dwpPedInterface, + m_dwpPedList; +}; +#endif \ No newline at end of file diff --git a/subVersion/hack.cpp b/subVersion/hack.cpp new file mode 100644 index 0000000..0f1abfe --- /dev/null +++ b/subVersion/hack.cpp @@ -0,0 +1,2109 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#include "stdafx.h" +#include + +/* + TRAINER +*/ + +trainer::trainer() +{ + m_keyTmr = clock(); +} + +trainer::~trainer() {} +void trainer::checkKeys() {} + +bool trainer::checkKeyState(int key) +{ + if + ( + clock() - m_keyTmr > 100 && + (GetAsyncKeyState(key) & 0x8001) == 0x8001 + ) + { + m_keyTmr = clock(); + return true; + } + return false; +} + + +/* + HACK +*/ + + +hack::hack() { + m_explosion = ImpactExplosionEnum::DefaultBullets; +} + +hack::~hack() {} + +void hack::checkKeys() +{ + if (checkKeyState(g_pSettings->m_iKeys[keyExit])) + { + g_bKillHack = true; + killProgram(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenu])) + { + g_pSettings->toggleMenu(); + return; + } + + //hotkeys + if (checkKeyState(g_pSettings->m_iKeys[keyHotTeleport])) + { + g_pHack->teleportWaypoint(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyHotWanted])) + { + g_pHack->notWanted(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyHotHealth])) + { + g_pHack->restoreHealth(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyHotAmmo])) + { + g_pHack->fillAllAmmo(NULL); + return; + } + + //if menu is not active, no need to check other keys + if (!g_pSettings->isMenuActive()) + return; + + //menu navigation + if (checkKeyState(g_pSettings->m_iKeys[keyMenuDown])) + { + g_pSettings->menuDown(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuUp])) + { + g_pSettings->menuUp(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuRight])) + { + g_pSettings->menuRight(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuLeft])) + { + g_pSettings->menuLeft(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuTabNext])) + { + g_pSettings->menuTabRight(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuTabPrev])) + { + g_pSettings->menuTabLeft(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuSave])) + { + featTeleport* tp = dynamic_cast(g_pSettings->getFeatureCur(g_pSettings->getActiveFeature())); + if (tp == nullptr || tp->m_tpType != tp_saved) + return; + m_player.getPos(); + tp->m_v3Pos.x = m_player.m_v3Pos.x; + tp->m_v3Pos.y = m_player.m_v3Pos.y; + tp->m_v3Pos.z = m_player.m_v3Pos.z; + g_pSettings->m_iniParser.setValue(tp->m_szIniKey + "_x", m_player.m_v3Pos.x, "Teleport"); + g_pSettings->m_iniParser.setValue(tp->m_szIniKey + "_y", m_player.m_v3Pos.y, "Teleport"); + g_pSettings->m_iniParser.setValue(tp->m_szIniKey + "_z", m_player.m_v3Pos.y, "Teleport"); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuSelect])) + { + g_pSettings->menuSelect(); + return; + } + if (checkKeyState(g_pSettings->m_iKeys[keyMenuBack])) + { + g_pSettings->menuBack(); + return; + } +} + +BYTE hack::initPointers() +{ + + BYTE r = 0; + + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_WORLD, &m_dwpWorldBase); + if (m_dwpWorldBase == 0) + return INITPTR_INVALID_WORLD; + + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_TUNABLE, &m_dwpTunableBase); + if (m_dwpTunableBase == 0) + return INITPTR_INVALID_TUNABLE; + m_tunable.m_dwpTunableBase = m_dwpTunableBase; + + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_GLOBAL, &m_dwpGlobalBase); + if (m_dwpGlobalBase == 0) + return INITPTR_INVALID_GLOBAL; + m_global.m_dwpGlobalBase = m_dwpGlobalBase; + m_mpId = "MP0_"; + + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_REPLAY_INTERFACE, &m_dwpReplayInterfaceBase); + if (m_dwpReplayInterfaceBase == 0) + return INITPTR_INVALID_REPLAY_INTERFACE; + m_replayInterface.m_dwpPedInterface = m_dwpReplayInterfaceBase; + g_pMemMan->readMem((DWORD_PTR)m_dwpReplayInterfaceBase + OFFSET_REPLAY_PED_INTERFACE, &m_replayInterface.m_dwpPedInterface); + g_pMemMan->readMem((DWORD_PTR)m_replayInterface.m_dwpPedInterface + OFFSET_PED_INTERFACE_PED_LIST, &m_replayInterface.m_dwpPedList); + + g_pMemMan->readMem((DWORD_PTR)m_dwpWorldBase + OFFSET_PLAYER, &m_dwpPlayerBase); + if (m_dwpPlayerBase == 0) + return INITPTR_INVALID_PLAYER; + m_player.m_dwpBase = m_dwpPlayerBase; + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerBase + OFFSET_ENTITY_POSBASE, &m_player.m_dwpPosBase); + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerBase + OFFSET_PLAYER_INFO, &m_player.m_dwpPlayerInfo); + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerBase + OFFSET_ENTITY_ATTACKER, &m_dwpAttackerBase); + + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerBase + OFFSET_PLAYER_VEHICLE, &m_dwpVehicleBase); + if (m_dwpVehicleBase == 0) + r |= INITPTR_INVALID_VEHICLE; + else + { + m_vehicle.m_dwpBase = m_dwpVehicleBase; + g_pMemMan->readMem((DWORD_PTR)m_dwpVehicleBase + OFFSET_ENTITY_POSBASE, &m_vehicle.m_dwpPosBase); + g_pMemMan->readMem((DWORD_PTR)m_dwpVehicleBase + OFFSET_VEHICLE_HANDLING, &m_vehicle.m_handlingCur.m_dwpHandling); + } + + //g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_WEAPON, &m_dwpWeaponBase); + g_pMemMan->readMem((DWORD_PTR)m_dwpPlayerBase + OFFSET_WEAPON_MANAGER, &m_dwpWeaponManager); + g_pMemMan->readMem((DWORD_PTR)m_dwpWeaponManager + OFFSET_WEAPON_CURRENT, &m_dwpWeaponCur); + if (m_dwpWeaponManager == 0 || m_dwpWeaponCur == 0 )// || m_dwpWeaponBase == 0 + r |= INITPTR_INVALID_WEAPON; + else + { + m_weapon.m_weapDataCur.m_dwpWeapon = m_dwpWeaponCur; + g_pMemMan->readMem((DWORD_PTR)m_dwpWeaponCur + OFFSET_WEAPON_AMMOINFO, &m_dwpAmmoInfo); + m_weapon.m_dwpAmmoInfo = m_dwpAmmoInfo; + } + + return r; +} + +void hack::getWaypoint() +{ + DWORD_PTR a = (DWORD_PTR)m_hModule + ADDRESS_BLIP; + for (size_t i = 2000; i > 1; i--) + { + DWORD64 n; + DWORD buf[2]; + g_pMemMan->readMem((DWORD_PTR)a + (i * 8), &n); + g_pMemMan->readMem((DWORD_PTR)n + 0x40, &buf[0]); + g_pMemMan->readMem((DWORD_PTR)n + 0x48, &buf[1]); + if (n > 0 && buf[0] == 8 && buf[1] == 84) + { + g_pMemMan->readMem((DWORD_PTR)n + 0x10, &m_v2Waypoint); + } + } + + //g_pMemMan->readMem((DWORD_PTR) m_hModule + ADDRESS_WAYPOINT, &m_v2Waypoint); + return; +} + +void hack::getObjective() +{ + DWORD_PTR a = (DWORD_PTR)m_hModule + ADDRESS_BLIP; + for (size_t i = 2000; i > 1; i--) + { + DWORD64 n; + DWORD buf[2]; + g_pMemMan->readMem((DWORD_PTR)a + (i * 8), &n); + g_pMemMan->readMem((DWORD_PTR)n + 0x40, &buf[0]); + g_pMemMan->readMem((DWORD_PTR)n + 0x48, &buf[1]); + if (n > 0 && buf[0] == 1 && (buf[1] == 5 || buf[1] == 60 || buf[1] == 66)) + { + g_pMemMan->readMem((DWORD_PTR)n + 0x10, &m_v3Objective); + } + } + + //g_pMemMan->readMem((DWORD_PTR) m_hModule + ADDRESS_OBJECTIVE, &m_v3Objective); + return; +} + +void hack::teleport(v3 v) +{ + m_player.getInVehicle(); + if (m_player.m_bIsInVehicle) + { + m_vehicle.setPos(v); + return; + } + m_player.setPos(v); + return; +} + +bool hack::teleportWaypoint() +{ + getWaypoint(); + if (m_v2Waypoint.x == 64000.f && m_v2Waypoint.y == 64000.f) + return false; + + v3 dest(m_v2Waypoint.x, m_v2Waypoint.y, -225.f); + teleport(dest); + return true; +} + + +bool hack::teleportObjective() +{ + getObjective(); + if (m_v3Objective.x == 64000.f && m_v3Objective.y == 64000.f && m_v3Objective.z == 64000.f) + return false; + + v3 dest(m_v3Objective.x, m_v3Objective.y, m_v3Objective.z + 1.f); + teleport(dest); + return true; +} + +void hack::restoreHealth() +{ + m_player.getHealth(); + if (m_player.m_flArmor < 100.f || m_player.m_cmHp.cur < m_player.m_cmHp.max) + m_player.setHealth(m_player.m_cmHp.max, 100.f); + return; +} + +void hack::restoreVehicleHealth() +{ + m_vehicle.getHealth(); + if ((m_vehicle.m_cmHp.cur < m_vehicle.m_cmHp.max && m_vehicle.m_cmHp.cur > 0.f) || + (m_vehicle.m_cmHpVehicle.cur < m_vehicle.m_cmHpVehicle.max && m_vehicle.m_cmHpVehicle.cur > 0.f)) + m_vehicle.setHealth(m_vehicle.m_cmHp.max); + return; +} + +void hack::restoreStamina() +{ + m_player.getStamina(); + if (m_player.m_cmStamina.cur < m_player.m_cmStamina.max) + m_player.setStamina(m_player.m_cmStamina.max); + return; +} + +void hack::notWanted() +{ + m_player.getWanted(); + if (m_player.m_dwWanted == 0) + return; + m_player.setWanted(0); + feat* fpWanted = g_pSettings->getFeature(g_iFeature[FEATURE_P_WANTED]); + if (fpWanted->m_bOn) + fpWanted->toggle(); + return; +} + +void hack::killNpc() +{ + if (m_dwpAttackerBase == 0) + return; + for (int i = 0; i < 3; i++) + { + DWORD_PTR npc; + g_pMemMan->readMem((DWORD_PTR)m_dwpAttackerBase + (i * OFFSET_ATTACKER_DISTANCE), &npc); + if (npc == m_dwpPlayerBase || npc == 0) + continue; + float health; + g_pMemMan->readMem((DWORD_PTR)npc + OFFSET_ENTITY_HEALTH, &health); + float v = 0.f; + if (health > v) + g_pMemMan->writeMem((DWORD_PTR)npc + OFFSET_ENTITY_HEALTH, &v); + } + return; +} + +void hack::fillAmmo() +{ + if (!m_weapon.findAmmoBase()) + return; + m_weapon.getCurAmmo(); + m_weapon.getMaxAmmo(); + if (m_weapon.m_dwCurAmmo != m_weapon.m_dwMaxAmmo) + m_weapon.setCurAmmo(m_weapon.m_dwMaxAmmo); + return; +} + +void hack::setImpactExplosion(float* arg) +{ + this->m_explosion = (ImpactExplosionEnum)((DWORD)*arg); +} + +void hack::fillAllAmmo(float* arg) +{ + for (size_t i = 0; i < 0x400; i++) + { + DWORD_PTR dwpWeapon, dwpAmmoInfo, dwpAmmoPtr1, dwpAmmoPtr2; + DWORD dwCurAmmo, dwMaxAmmo; + g_pMemMan->readMem((DWORD_PTR)m_dwpWeaponBase + i, &dwpWeapon); + g_pMemMan->readMem((DWORD_PTR)dwpWeapon + OFFSET_WEAPON_AMMOINFO, &dwpAmmoInfo); + + g_pMemMan->readMem((DWORD_PTR)dwpAmmoInfo + OFFSET_WEAPON_AMMOINFO_CUR_1, &dwpAmmoPtr1); + g_pMemMan->readMem((DWORD_PTR)dwpAmmoPtr1 + OFFSET_WEAPON_AMMOINFO_CUR_2, &dwpAmmoPtr2); + g_pMemMan->readMem((DWORD_PTR)dwpAmmoPtr2 + OFFSET_WEAPON_AMMOINFO_CURAMMO, &dwCurAmmo); + if (dwCurAmmo >= 0 && dwCurAmmo <= 9999) + { + g_pMemMan->readMem((DWORD_PTR)dwpAmmoInfo + OFFSET_WEAPON_AMMOINFO_MAX, &dwMaxAmmo); + if (dwMaxAmmo >= 20 && dwMaxAmmo <= 9999 && dwCurAmmo < dwMaxAmmo) + { + g_pMemMan->writeMem((DWORD_PTR)dwpAmmoPtr2 + OFFSET_WEAPON_AMMOINFO_CURAMMO, &dwMaxAmmo); + } + } + } +} + +void hack::healVehicle(float* arg) +{ + restoreVehicleHealth(); +} + +void hack::healPlayer(float* arg) +{ + restoreHealth(); +} + +void hack::suicide(float* arg) +{ + m_player.setHealth(0, 0); +} + +void hack::fillAmmo(float* arg) +{ + this->fillAmmo(); +} + +void hack::fillSkillLevels(float* arg) +{ + dStatPushBack(string_to_hash("SCRIPT_INCREASE_STAM"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_SHO"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_STRN"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_STL"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_FLY"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_DRIV"), 100); + dStatPushBack(string_to_hash("SCRIPT_INCREASE_LUNG"), 100); +} + +void hack::fillAllSnacks(float* arg) +{ + dStatPushBack(string_to_hash("NO_BOUGHT_YUM_SNACKS"), 30); + dStatPushBack(string_to_hash("NO_BOUGHT_HEALTH_SNACKS"), 15); + dStatPushBack(string_to_hash("NO_BOUGHT_EPIC_SNACKS"), 5); + dStatPushBack(string_to_hash("NUMBER_OF_ORANGE_BOUGHT"), 10); + dStatPushBack(string_to_hash("NUMBER_OF_BOURGE_BOUGHT"), 10); + dStatPushBack(string_to_hash("CIGARETTES_BOUGHT"), 20); + dStatPushBack(string_to_hash("MP_CHAR_ARMOUR_5_COUNT"), 10); +} + +void hack::casinoStat(float* arg) +{ + dStatPushBack(string_to_hash("H3_COMPLETEDPOSIX"), -1); +} + +void hack::casinoStatBitSet1(float* arg) +{ + dStatPushBack(string_to_hash("H3OPT_BITSET1"), 0); + switch ((int)*arg) + { + case 0: + dStatPushBack(string_to_hash("H3OPT_APPROACH"), 1); + break; + case 1: + dStatPushBack(string_to_hash("H3OPT_APPROACH"), 2); + break; + case 2: + dStatPushBack(string_to_hash("H3OPT_APPROACH"), 3); + break; + case 3: + dStatPushBack(string_to_hash("H3OPT_TARGET"), 0); + break; + case 4: + dStatPushBack(string_to_hash("H3OPT_TARGET"), 1); + break; + case 5: + dStatPushBack(string_to_hash("H3OPT_TARGET"), 2); + break; + case 6: + dStatPushBack(string_to_hash("H3OPT_TARGET"), 3); + break; + case 7: + dStatPushBack(string_to_hash("H3OPT_ACCESSPOINTS"), -1); + break; + case 8: + dStatPushBack(string_to_hash("H3OPT_POI"), -1); + break; + default: + break; + } + dStatPushBack(string_to_hash("H3OPT_BITSET1"), -1); +} + +void hack::casinoStatBitSet2(float* arg) +{ + dStatPushBack(string_to_hash("H3OPT_BITSET0"), 0); + switch ((int)*arg) + { + case 0: + dStatPushBack(string_to_hash("H3OPT_DISRUPTSHIP"), 3); + break; + case 1: + dStatPushBack(string_to_hash("H3OPT_KEYLEVELS"), 2); + break; + case 2: + dStatPushBack(string_to_hash("H3OPT_CREWWEAP"), 5); + break; + case 3: + dStatPushBack(string_to_hash("H3OPT_CREWDRIVER"), 5); + break; + case 4: + dStatPushBack(string_to_hash("H3OPT_CREWHACKER"), 4); + break; + case 5: + dStatPushBack(string_to_hash("H3OPT_VEHS"), 0); + break; + case 6: + dStatPushBack(string_to_hash("H3OPT_VEHS"), 1); + break; + case 7: + dStatPushBack(string_to_hash("H3OPT_VEHS"), 2); + break; + case 8: + dStatPushBack(string_to_hash("H3OPT_VEHS"), 3); + break; + case 9: + dStatPushBack(string_to_hash("H3OPT_WEAPS"), 0); + break; + case 10: + dStatPushBack(string_to_hash("H3OPT_WEAPS"), 1); + break; + default: + dStatPushBack(string_to_hash("H3OPT_DISRUPTSHIP"), 3); + dStatPushBack(string_to_hash("H3OPT_KEYLEVELS"), 2); + dStatPushBack(string_to_hash("H3OPT_CREWWEAP"), 5); + dStatPushBack(string_to_hash("H3OPT_CREWDRIVER"), 5); + dStatPushBack(string_to_hash("H3OPT_CREWHACKER"), 4); + dStatPushBack(string_to_hash("H3OPT_VEHS"), 3); + dStatPushBack(string_to_hash("H3OPT_WEAPS"), 0); + break; + } + dStatPushBack(string_to_hash("H3OPT_BITSET0"), -1); +} + +void hack::unlockHeistCars(float* arg) +{ + dStatPushBack(string_to_hash("CHAR_FM_VEHICLE_1_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_VEHICLE_2_UNLCK"), -1); + for (size_t i = 1; i <= 7; i++) + { + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_"+ std::to_string(i) +"_UNLCK"), -1); + } +} + +void hack::unlockLSC(float* arg) +{ + dStatPushBack(string_to_hash("RACES_WON"), 50); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_1_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_2_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_3_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_4_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_5_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_6_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CARMOD_7_UNLCK"), -1); + dStatPushBack(string_to_hash("NUMBER_SLIPSTREAMS_IN_RACE"), 110); + dStatPushBack(string_to_hash("NUMBER_TURBO_STARTS_IN_RACE"), 90); + dStatPushBack(string_to_hash("USJS_FOUND"), 50); + dStatPushBack(string_to_hash("USJS_COMPLETED"), 50); + dStatPushBack(string_to_hash("TIMES_RACE_BEST_LAP", "MPPLY_"), 101); + dStatPushBack(string_to_hash("AWD_FMRALLYWONDRIVE"), 2); + dStatPushBack(string_to_hash("AWD_FMWINSEARACE"), 2); + dStatPushBack(string_to_hash("AWD_FMWINAIRRACE"), 2); + dStatPushBack(string_to_hash("AWD_FM_RACES_FASTEST_LAP"), 101); +} + +void hack::unlockWeaponCamos(float* arg) +{ + dStatPushBack(string_to_hash("PISTOL_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("CMBTPISTOL_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("PISTOL50_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("APPISTOL_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("MICROSMG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("SMG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("ASLTSMG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("ASLTRIFLE_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("CRBNRIFLE_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("ADVRIFLE_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("MG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("CMBTMG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("ASLTMG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("PUMP_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("SAWNOFF_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("BULLPUP_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("ASLTSHTGN_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("SNIPERRFL_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("HVYSNIPER_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("GRNLAUNCH_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("RPG_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("MINIGUNS_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("GRENADE_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("SMKGRENADE_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("STKYBMB_ENEMY_KILLS"), 600); + dStatPushBack(string_to_hash("MOLOTOV_ENEMY_KILLS"), 600); +} + +//void hack::unlockWeapon(float* arg) +//{ +// globalStatSetInt(string_to_hash("CHAR_WEAP_UNLOCKED"), -1); +// globalStatSetInt(string_to_hash("CHAR_WEAP_UNLOCKED2"), -1); +// globalStatSetInt(string_to_hash("CHAR_WEAP_ADDON_1_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_WEAP_ADDON_2_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_WEAP_ADDON_3_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_WEAP_ADDON_4_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_UNLOCKED"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_UNLOCKED2"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_ADDON_1_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_ADDON_2_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_ADDON_3_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_ADDON_4_UNLCK"), -1); +// globalStatSetInt(string_to_hash("CHAR_FM_WEAP_ADDON_5_UNLCK"), -1); +//} + +void hack::unlockAllAwards(float* arg) +{ + dStatPushBack(string_to_hash("AWD_100_KILLS_PISTOL"), 500); + dStatPushBack(string_to_hash("AWD_100_KILLS_SNIPER"), 500); + dStatPushBack(string_to_hash("AWD_50_KILLS_GRENADES"), 500); + dStatPushBack(string_to_hash("AWD_100_KILLS_SHOTGUN"), 500); + dStatPushBack(string_to_hash("AWD_100_KILLS_SMG"), 500); + dStatPushBack(string_to_hash("AWD_50_KILLS_ROCKETLAUNCH"), 500); + dStatPushBack(string_to_hash("AWD_25_KILLS_STICKYBOMBS"), 500); + dStatPushBack(string_to_hash("AWD_20_KILLS_MELEE"), 500); + dStatPushBack(string_to_hash("AWD_100_HEADSHOTS"), 500); + dStatPushBack(string_to_hash("AWD_50_VEHICLES_BLOWNUP"), 500); + dStatPushBack(string_to_hash("AWD_ENEMYDRIVEBYKILLS"), 500); + dStatPushBack(string_to_hash("AWD_COPS_KILLED"), 500); + dStatPushBack(string_to_hash("AWD_BUY_EVERY_GUN"), 1); + dStatPushBack(string_to_hash("AWD_DRIVE_ALL_COP_CARS"), 1); + dStatPushBack(string_to_hash("AWD_VEHICLE_JUMP_OVER_40M"), 50); + dStatPushBack(string_to_hash("AWD_VEHICLE_JUMP0_OVER_40M"), 50); + dStatPushBack(string_to_hash("AWD_VEHICLE_JUMP1_OVER_40M"), 50); + dStatPushBack(string_to_hash("AWD_NO_ARMWRESTLING_WINS"), 50); + dStatPushBack(string_to_hash("AWD_KILLS_MACHINEGUN"), 50); + dStatPushBack(string_to_hash("AWD_ODD_JOBS"), 52); + dStatPushBack(string_to_hash("AWD_PREPARATION"), 50); + dStatPushBack(string_to_hash("AWD_ASLEEPONJOB"), 20); + dStatPushBack(string_to_hash("AWD_DAICASHCRAB"), 100000); + dStatPushBack(string_to_hash("AWD_BIGBRO"), 40); + dStatPushBack(string_to_hash("AWD_SHARPSHOOTER"), 40); + dStatPushBack(string_to_hash("AWD_RACECHAMP"), 40); + dStatPushBack(string_to_hash("AWD_BATSWORD"), 1000000); + dStatPushBack(string_to_hash("AWD_COINPURSE"), 950000); + dStatPushBack(string_to_hash("AWD_ASTROCHIMP"), 3000000); + dStatPushBack(string_to_hash("AWD_MASTERFUL"), 40000); + dStatPushBack(string_to_hash("AWD_5STAR_WANTED_AVOIDANCE"), 50); + dStatPushBack(string_to_hash("AWD_CAR_BOMBS_ENEMY_KILLS"), 50); + dStatPushBack(string_to_hash("AWD_CARS_EXPORTED"), 50); + dStatPushBack(string_to_hash("AWD_CONTROL_CROWDS"), 25); + dStatPushBack(string_to_hash("AWD_DAILYOBJCOMPLETED"), 100); + dStatPushBack(string_to_hash("AWD_DO_HEIST_AS_MEMBER"), 25); + dStatPushBack(string_to_hash("AWD_DO_HEIST_AS_THE_LEADER"), 25); + dStatPushBack(string_to_hash("AWD_DROPOFF_CAP_PACKAGES"), 100); + dStatPushBack(string_to_hash("AWD_FINISH_HEIST_SETUP_JOB"), 50); + dStatPushBack(string_to_hash("AWD_FINISH_HEISTS"), 50); + dStatPushBack(string_to_hash("AWD_FM_DM_3KILLSAMEGUY"), 50); + dStatPushBack(string_to_hash("AWD_FM_DM_KILLSTREAK"), 100); + dStatPushBack(string_to_hash("AWD_FM_DM_STOLENKILL"), 50); + dStatPushBack(string_to_hash("AWD_FM_DM_TOTALKILLS"), 500); + dStatPushBack(string_to_hash("AWD_FM_DM_WINS"), 50); + dStatPushBack(string_to_hash("AWD_FM_GOLF_HOLE_IN_1"), 300); + dStatPushBack(string_to_hash("AWD_FM_GOLF_BIRDIES"), 25); + dStatPushBack(string_to_hash("AWD_FM_GOLF_WON"), 25); + dStatPushBack(string_to_hash("AWD_FM_GTA_RACES_WON"), 50); + dStatPushBack(string_to_hash("AWD_FM_RACE_LAST_FIRST"), 25); + dStatPushBack(string_to_hash("AWD_FM_RACES_FASTEST_LAP"), 50); + dStatPushBack(string_to_hash("AWD_FM_SHOOTRANG_CT_WON"), 25); + dStatPushBack(string_to_hash("AWD_FM_SHOOTRANG_RT_WON"), 25); + dStatPushBack(string_to_hash("AWD_FM_SHOOTRANG_TG_WON"), 25); + dStatPushBack(string_to_hash("AWD_FM_TDM_MVP"), 50); + dStatPushBack(string_to_hash("AWD_FM_TDM_WINS"), 50); + dStatPushBack(string_to_hash("AWD_FM_TENNIS_ACE"), 25); + dStatPushBack(string_to_hash("AWD_FM_TENNIS_WON"), 25); + dStatPushBack(string_to_hash("AWD_FMBASEJMP"), 25); + dStatPushBack(string_to_hash("AWD_FMBBETWIN"), 50000); + dStatPushBack(string_to_hash("AWD_FMCRATEDROPS"), 25); + dStatPushBack(string_to_hash("AWD_FMDRIVEWITHOUTCRASH"), 30); + dStatPushBack(string_to_hash("AWD_FMHORDWAVESSURVIVE"), 10); + dStatPushBack(string_to_hash("AWD_FMKILLBOUNTY"), 25); + dStatPushBack(string_to_hash("AWD_FMRALLYWONDRIVE"), 25); + dStatPushBack(string_to_hash("AWD_FMRALLYWONNAV"), 25); + dStatPushBack(string_to_hash("AWD_FMREVENGEKILLSDM"), 50); + dStatPushBack(string_to_hash("AWD_FMSHOOTDOWNCOPHELI"), 25); + dStatPushBack(string_to_hash("AWD_FMWINAIRRACE"), 25); + dStatPushBack(string_to_hash("AWD_FMWINRACETOPOINTS"), 25); + dStatPushBack(string_to_hash("AWD_FMWINSEARACE"), 25); + dStatPushBack(string_to_hash("AWD_HOLD_UP_SHOPS"), 20); + dStatPushBack(string_to_hash("AWD_KILL_CARRIER_CAPTURE"), 100); + dStatPushBack(string_to_hash("AWD_KILL_PSYCHOPATHS"), 100); + dStatPushBack(string_to_hash("AWD_KILL_TEAM_YOURSELF_LTS"), 25); + dStatPushBack(string_to_hash("AWD_LAPDANCES"), 25); + dStatPushBack(string_to_hash("AWD_LESTERDELIVERVEHICLES"), 25); + dStatPushBack(string_to_hash("AWD_MENTALSTATE_TO_NORMAL"), 50); + dStatPushBack(string_to_hash("AWD_NIGHTVISION_KILLS"), 100); + dStatPushBack(string_to_hash("AWD_NO_HAIRCUTS"), 25); + dStatPushBack(string_to_hash("AWD_ODISTRACTCOPSNOEATH"), 25); + dStatPushBack(string_to_hash("AWD_ONLY_PLAYER_ALIVE_LTS"), 50); + dStatPushBack(string_to_hash("AWD_PARACHUTE_JUMPS_20M"), 50); + dStatPushBack(string_to_hash("AWD_PARACHUTE_JUMPS_50M"), 50); + dStatPushBack(string_to_hash("AWD_PASSENGERTIME"), 4); + dStatPushBack(string_to_hash("AWD_PICKUP_CAP_PACKAGES"), 100); + dStatPushBack(string_to_hash("AWD_RACES_WON"), 50); + dStatPushBack(string_to_hash("AWD_SECURITY_CARS_ROBBED"), 25); + dStatPushBack(string_to_hash("AWD_TAKEDOWNSMUGPLANE"), 50); + dStatPushBack(string_to_hash("AWD_TIME_IN_HELICOPTER"), 4); + dStatPushBack(string_to_hash("AWD_TRADE_IN_YOUR_PROPERTY"), 25); + dStatPushBack(string_to_hash("AWD_VEHICLES_JACKEDR"), 500); + dStatPushBack(string_to_hash("AWD_WIN_AT_DARTS"), 25); + dStatPushBack(string_to_hash("AWD_WIN_CAPTURE_DONT_DYING"), 25); + dStatPushBack(string_to_hash("AWD_WIN_CAPTURES"), 50); + dStatPushBack(string_to_hash("AWD_WIN_GOLD_MEDAL_HEISTS"), 25); + dStatPushBack(string_to_hash("AWD_WIN_LAST_TEAM_STANDINGS"), 50); + dStatPushBack(string_to_hash("AWD_DANCE_TO_SOLOMUN"), 100); + dStatPushBack(string_to_hash("AWD_DANCE_TO_TALEOFUS"), 100); + dStatPushBack(string_to_hash("AWD_DANCE_TO_DIXON"), 100); + dStatPushBack(string_to_hash("AWD_DANCE_TO_BLKMAD"), 100); + dStatPushBack(string_to_hash("AWD_CLUB_DRUNK"), 200); + dStatPushBack(string_to_hash("AWD_WATCH_YOUR_STEP"), 50); + dStatPushBack(string_to_hash("AWD_TOWER_OFFENSE"), 50); + dStatPushBack(string_to_hash("AWD_READY_FOR_WAR"), 50); + dStatPushBack(string_to_hash("AWD_THROUGH_A_LENS"), 50); + dStatPushBack(string_to_hash("AWD_SPINNER"), 50); + dStatPushBack(string_to_hash("AWD_YOUMEANBOOBYTRAPS"), 50); + dStatPushBack(string_to_hash("AWD_MASTER_BANDITO"), 50); + dStatPushBack(string_to_hash("AWD_SITTING_DUCK"), 50); + dStatPushBack(string_to_hash("AWD_CROWDPARTICIPATION"), 50); + dStatPushBack(string_to_hash("AWD_KILL_OR_BE_KILLED"), 50); + dStatPushBack(string_to_hash("AWD_MASSIVE_SHUNT"), 25); + dStatPushBack(string_to_hash("AWD_YOURE_OUTTA_HERE"), 200); + dStatPushBack(string_to_hash("AWD_WEVE_GOT_ONE"), 50); + dStatPushBack(string_to_hash("AWD_ARENA_WAGEWORKER"), 20000000); + dStatPushBack(string_to_hash("AWD_TIME_SERVED"), 1000); + dStatPushBack(string_to_hash("AWD_TOP_SCORE"), 500000); + dStatPushBack(string_to_hash("AWD_CAREER_WINNER"), 1000); +} + +void hack::unlockClothes(float* arg) +{ + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_1_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_2_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_3_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_4_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_5_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_6_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_7_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_8_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_9_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_10_UNLCK"), -1); + dStatPushBack(string_to_hash("CHAR_FM_CLOTHES_11_UNLCK"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_OUTFIT"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_OUTFIT"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_HAIR_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_OUTFIT"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_OUTFIT"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_JBIB_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_JBIB_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_LEGS_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_LEGS_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_FEET_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_FEET_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_8"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_9"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_PROPS_10"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_TEETH"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_TEETH_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_TEETH_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_TEETH"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_TEETH_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_TEETH_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_BERD_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_BERD_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_TORSO"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_TORSO"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_3"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_4"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_5"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_6"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL_7"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL2"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_SPECIAL2_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_1"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_3"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_4"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_5"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_6"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL_7"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL2"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_SPECIAL2_1"), -1); + dStatPushBack(string_to_hash("CLTHS_AVAILABLE_DECL"), -1); + dStatPushBack(string_to_hash("CLTHS_ACQUIRED_DECL"), -1); + for (size_t i = 0; i <= 205; i++) + { + dStatPushBack(string_to_hash("DLC_APPAREL_ACQUIRED_" + std::to_string(i)), -1); + } + for (size_t i = 0; i <= 31; i++) + { + + dStatPushBack(string_to_hash("ADMIN_CLOTHES_GV_BS_" + std::to_string(i)), -1); + } +} + +void hack::intoPV(float* arg) +{ + if (m_global.initIntoPVPtr(m_hModule)) + { + m_global.setIntoPersonalVehicle(1); + Sleep(500); + m_global.getIntoPersonalVehicle(); + if (m_global.m_dwIntoPersonalVehicle == 1) + { + m_global.setIntoPersonalVehicle(0); + } + } +} + +void hack::loadSession(float* arg) +{ + if (m_global.initSessionPtr(m_hModule)) + { + m_global.setSessionID((int)*arg); + m_global.setSessionTransition(1); + Sleep(400); + m_global.setSessionTransition(0); + } +} + +void hack::forwardTeleport(float* arg) +{ + m_player.getPos(); + v3 v3Pos = m_player.m_v3Pos; + m_player.getCos(); + m_player.getSin(); + float fAngle = m_player.m_fCos; + float fAngle2 = m_player.m_fSin; + v3Pos.x +=*arg * fAngle2; + v3Pos.y +=*arg * fAngle; + teleport(v3Pos); +} + +void hack::spawnVehicle(float* arg) +{ + if (m_global.initVehiclePtr(m_hModule)) + { + int vehTypeIndex = (int)*arg / 1000; + int vehIndex = (int)*arg % 1000; + m_player.getPos(); + v3 v3Pos = m_player.m_v3Pos; + m_player.getCos(); + m_player.getSin(); + float fAngle = m_player.m_fCos; + float fAngle2 = m_player.m_fSin; + v3Pos.x += 6 * fAngle2; + v3Pos.y += 6 * fAngle; + + m_global.setVehicleHash(joaat(vehiclePreview[vehTypeIndex].second[vehIndex].VCode)); + m_global.setVehicleKickPrevent1(2); + m_global.setVehicleKickPrevent2(14); + m_global.setSecondaryColor(-1); + m_global.setPrimaryColor(-1); + m_global.setVehiclePosX(v3Pos.x); + m_global.setVehiclePosY(v3Pos.y); + m_global.setVehiclePosZ(-255); + if (true) + { + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 10, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 11, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 12, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 13, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 14, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 15, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 16, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 17, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 18, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 19, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 20, m_hModule), 1); + + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 21, m_hModule), 4); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 22, m_hModule), 3); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 23, m_hModule), 3); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 24, m_hModule), 57); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 25, m_hModule), 4); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 26, m_hModule), 5); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 28, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 30, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 32, m_hModule), 1); + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 65, m_hModule), 1); + + g_pMemMan->writeMem(m_global.getGlobal(OFFSET_GLOBAL_VEHICLE_HASH + 27 + 77, m_hModule), 0xF0400200); + } + + m_global.setVehicleSpawn2(1); + m_global.setVehicleSpawn1(1); + } +} + +void hack::selfDropMoney(feat* feature) +{ + if (!m_bSelfDropInit) + { + m_bSelfDropInit = true; + std::thread t([=] { + while (true) + { + if (feature->m_bOn) + { + if (m_global.initMoneyPtr(m_hModule)) + { + m_player.getPos(); + m_global.setMoneyObject(1); + m_global.setMoneyVal(2000); + m_global.setMoneyPosX(m_player.m_v3Pos.x); + m_global.setMoneyPosY(m_player.m_v3Pos.y); + m_global.setMoneyPosZ(m_player.m_v3Pos.z + 5); + m_global.findMoneyPtr(m_hModule); + m_global.setMoneyCall(2); + } + } + Sleep(100); + } + }); + t.detach(); + } +} + + +void hack::dStatPushBack(unsigned int hash, int value) +{ + this->m_dStat.push_back(std::pair(hash, value)); +} + +void hack::consumeStatQueue() +{ + if (!m_bInit) + { + m_bInit = true; + std::thread tConsumeStatQueue([=] { + while (true) + { + if (!m_dStat.empty()) + { + g_pD3D9Render->m_bMBShowing = true; + g_pD3D9Render->m_sTitle = L"Memproses..."; + g_pD3D9Render->m_sDetail = L"Sisa " + std::to_wstring(m_dStat.size()) + L" detik"; + if (m_global.initStatPtr(m_hModule)) + { + m_global.getStatHash(); + unsigned int resotreHash = m_global.m_dwStatHash; + m_global.getStatValue(); + DWORD resotreValue = m_global.m_dwStatValue; + m_global.getStatCall(); + DWORD call = m_global.m_dwStatCall; + + m_global.setStatHash(m_dStat.front().first); + m_global.setStatValue(m_dStat.front().second); + m_global.setStatCall(-1); + Sleep(1000); + m_global.setStatHash(resotreHash); + m_global.setStatValue(resotreValue); + } + m_dStat.pop_front(); + } + else + { + g_pD3D9Render->m_bMBShowing = false; + } + Sleep(1); + } + }); + tConsumeStatQueue.detach(); + } +} + +void hack::killAllNpc(float* arg) +{ + m_replayInterface.initPeds(); + for (size_t i = 0; i < m_replayInterface.dw_curPedNum; i++) + { + if (i == 10) + continue; + m_replayInterface.g_pPedList[i]->getHealth(); + if (m_replayInterface.g_pPedList[i]->m_cmHp.cur > 0) + { + m_replayInterface.g_pPedList[i]->setHealth(0); + } + } +} + +void hack::renderPlayerList(int parent,int playerList[32]) +{ + for (size_t i = 0; i < 32; i++) + { + g_pSettings->updataFeature(playerList[i], -1, parent, L"" + std::to_wstring(i), feat_teleport,tp_static, -1336.f, -3044.f, -225.f); + } +} + +void hack::waterProof(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_player.m_playerDataCur.m_dwWaterProof != m_player.m_playerDataRestore.m_dwWaterProof) + m_player.setWaterProof(m_player.m_playerDataRestore.m_dwWaterProof); + feature->m_bRestored = true; + } + return; + } + if (m_player.m_playerDataCur.m_dwWaterProof != m_player.m_playerDataRestore.m_dwWaterProof + 0x1000000) + m_player.setWaterProof(m_player.m_playerDataRestore.m_dwWaterProof + 0x1000000); + return; +} + +void hack::undeadOffradar(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_player.m_playerDataCur.m_maxHealth != m_player.m_playerDataRestore.m_maxHealth) + m_player.setMaxHealth(m_player.m_playerDataRestore.m_maxHealth); + feature->m_bRestored = true; + } + return; + } + if (m_player.m_playerDataCur.m_maxHealth > 0) + m_player.setMaxHealth(0); + return; +} + +void hack::superPunch(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getVehicleDamageMult(); + if (m_player.m_flVehicleDamageMult != 1) + m_player.setVehicleDamageMult(1); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_player.m_flVehicleDamageMult != fValue) + m_player.setVehicleDamageMult(fValue); + return; +} + +void hack::noSpread(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fSpread != m_weapon.m_weapDataRestore.m_fSpread) + m_weapon.setSpread(m_weapon.m_weapDataRestore.m_fSpread); + feature->m_bRestored = true; + } + return; + } + if (m_weapon.m_weapDataCur.m_fSpread != 0) + m_weapon.setSpread(0); + return; +} + +void hack::noRecoil(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fRecoil != m_weapon.m_weapDataRestore.m_fRecoil) + m_weapon.setRecoil(m_weapon.m_weapDataRestore.m_fRecoil); + feature->m_bRestored = true; + } + return; + } + if (m_weapon.m_weapDataCur.m_fRecoil != 0) + m_weapon.setRecoil(0); + return; +} + +void hack::quickReload(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fReload != m_weapon.m_weapDataRestore.m_fReload || m_weapon.m_weapDataCur.m_fReloadVeh != m_weapon.m_weapDataRestore.m_fReloadVeh) + { + m_weapon.setReloadSpeed(m_weapon.m_weapDataRestore.m_fReload); + m_weapon.setReloadVehicle(m_weapon.m_weapDataRestore.m_fReloadVeh); + } + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fReload * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fReload != fValue) + m_weapon.setReloadSpeed(fValue); + if (m_weapon.m_weapDataCur.m_fReloadVeh != 0) + m_weapon.setReloadVehicle(0); + return; +} + +void hack::bulletDamage(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fDamage != m_weapon.m_weapDataRestore.m_fDamage) + m_weapon.setBulletDamage(m_weapon.m_weapDataRestore.m_fDamage); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fDamage * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fDamage != fValue) + m_weapon.setBulletDamage(fValue); + return; +} + +void hack::weaponRange(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fRange != m_weapon.m_weapDataRestore.m_fRange) + m_weapon.setRange(m_weapon.m_weapDataRestore.m_fRange); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fRange * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fRange != fValue) + m_weapon.setRange(fValue); + return; +} + +void hack::weaponSpin(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fSpinUp != m_weapon.m_weapDataRestore.m_fSpinUp || m_weapon.m_weapDataCur.m_fSpin != m_weapon.m_weapDataRestore.m_fSpin) + { + m_weapon.setSpinUp(m_weapon.m_weapDataRestore.m_fSpinUp); + m_weapon.setSpin(m_weapon.m_weapDataRestore.m_fSpin); + } + feature->m_bRestored = true; + } + return; + } + if (m_weapon.m_weapDataCur.m_fSpinUp != 0 || m_weapon.m_weapDataCur.m_fSpin != 0) + { + m_weapon.setSpin(0); + m_weapon.setSpinUp(0); + } + return; +} + +void hack::weaponForceOnPed(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fForceOnPed != m_weapon.m_weapDataRestore.m_fForceOnPed) + m_weapon.setForceOnPed(m_weapon.m_weapDataRestore.m_fForceOnPed); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fForceOnPed * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fForceOnPed != fValue) + m_weapon.setForceOnPed(fValue); + return; +} + +void hack::weaponForceOnVehicle(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fForceOnVehicle != m_weapon.m_weapDataRestore.m_fForceOnVehicle) + m_weapon.setForceOnVehicle(m_weapon.m_weapDataRestore.m_fForceOnVehicle); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fForceOnVehicle * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fForceOnVehicle != fValue) + m_weapon.setForceOnVehicle(fValue); + return; +} + +void hack::weaponForceOnHeli(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fForceOnHeli != m_weapon.m_weapDataRestore.m_fForceOnHeli) + m_weapon.setForceOnHeli(m_weapon.m_weapDataRestore.m_fForceOnHeli); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fForceOnHeli * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fForceOnHeli != fValue) + m_weapon.setForceOnHeli(fValue); + return; +} + +void hack::weaponBulletEdit(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_dwImpactType != m_weapon.m_weapDataRestore.m_dwImpactType) + m_weapon.setImpactType(m_weapon.m_weapDataRestore.m_dwImpactType); + if (m_weapon.m_weapDataCur.m_dwImpactExplosion != ImpactExplosionEnum::DefaultBullets) + m_weapon.setImpactExplosion(ImpactExplosionEnum::DefaultBullets); + feature->m_bRestored = true; + } + return; + } + if (m_weapon.m_weapDataCur.m_dwImpactType != ImpactTypeEnum::Explosives) + m_weapon.setImpactType(ImpactTypeEnum::Explosives); + if (m_weapon.m_weapDataCur.m_dwImpactExplosion != m_explosion) + m_weapon.setImpactExplosion(m_explosion); + return; +} + +void hack::runSpeed(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getRunSpeed(); + if (m_player.m_flRunSpd > 1.f) + m_player.setRunSpeed(1.f); + feature->m_bRestored = true; + } + return; + } + m_player.getRunSpeed(); + float fValue = static_cast(feature)->m_fValue; + if (m_player.m_flRunSpd != fValue) + m_player.setRunSpeed(fValue); + return; +} + +void hack::swimSpeed(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getSwimSpeed(); + if (m_player.m_flSwimSpd > 1.f) + m_player.setSwimSpeed(1.f); + feature->m_bRestored = true; + } + return; + } + m_player.getSwimSpeed(); + float fValue = static_cast(feature)->m_fValue; + if (m_player.m_flSwimSpd != fValue) + m_player.setSwimSpeed(fValue); + return; +} + +void hack::npcIgnore(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getNpcIgnore(); + if (m_player.m_dwNpcIgnore > 0) + m_player.setNpcIgnore(0); + feature->m_bRestored = true; + } + return; + } + m_player.getNpcIgnore(); + if (m_player.m_dwNpcIgnore != 0x450000) + m_player.setNpcIgnore(0x450000); + return; +} + +void hack::godMode(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getGod(); + if (m_player.m_btGod > 0) + m_player.setGod(0); + feature->m_bRestored = true; + } + return; + } + m_player.getGod(); + if (m_player.m_btGod < 1) + m_player.setGod(1); + return; +} + +void hack::frameFlags(feat* featSuperJump, feat* featExplosiveMelee, feat* featFireAmmo, feat* featExplosiveAmmo) +{ + if (!featSuperJump->m_bOn && !featExplosiveMelee->m_bOn && !featFireAmmo->m_bOn && !featExplosiveAmmo->m_bOn) + return; + DWORD dwValue = 0; + if (featSuperJump->m_bOn) + dwValue += 64; + if (featExplosiveMelee->m_bOn) + dwValue += 32; + if (featFireAmmo->m_bOn) + dwValue += 16; + if (featExplosiveAmmo->m_bOn) + dwValue += 8; + m_player.setFrameFlags(dwValue); + return; +} + +void hack::vehicleGod(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_vehicle.getGod(); + if (m_vehicle.m_btGod > 0) + m_vehicle.setGod(0); + feature->m_bRestored = true; + } + return; + } + m_vehicle.getGod(); + if (m_vehicle.m_btGod < 1) + m_vehicle.setGod(1); + return; +} + +void hack::infAmmo(feat* feature) +{ + BYTE cur[3] = {}; + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_AMMO, cur, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + BYTE value[3] = { 0x41, 0x2B, 0xD1 }; + if (cur[0] != value[0]) + g_pMemMan->writeMem((DWORD_PTR)m_hModule + ADDRESS_AMMO, value , sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + feature->m_bRestored = true; + } + return; + } + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_AMMO, cur, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + BYTE value[3] = { 0x90, 0x90, 0x90 }; + if (cur[0] != value[0]) + g_pMemMan->writeMem((DWORD_PTR)m_hModule + ADDRESS_AMMO, value, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + return; +} + +void hack::noReload(feat* feature) +{ + BYTE cur[3] = {}; + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_MAGAZINE, cur, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + BYTE value[3] = { 0x41, 0x2B, 0xC9 }; + if (cur[0] != value[0]) + g_pMemMan->writeMem((DWORD_PTR)m_hModule + ADDRESS_MAGAZINE, value, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + feature->m_bRestored = true; + } + return; + } + g_pMemMan->readMem((DWORD_PTR)m_hModule + ADDRESS_MAGAZINE, cur, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + BYTE value[3] = { 0x90, 0x90, 0x90 }; + if (cur[0] != value[0]) + g_pMemMan->writeMem((DWORD_PTR)m_hModule + ADDRESS_MAGAZINE, value, sizeof(BYTE) * 3, PAGE_EXECUTE_READWRITE); + return; +} + +void hack::seatbelt(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getSeatbelt(); + if (m_player.m_btSeatbelt & 0x01) + m_player.setSeatbelt(m_player.m_btSeatbelt ^ 0x01); + feature->m_bRestored = true; + } + return; + } + m_player.getSeatbelt(); + if (!(m_player.m_btSeatbelt & 0x01)) + m_player.setSeatbelt(m_player.m_btSeatbelt | 0x01); + return; +} + +void hack::noRagdoll(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getRagdoll(); + if (!(m_player.m_btRagdoll & 0x20)) + m_player.setRagdoll(m_player.m_btRagdoll | 0x20); + feature->m_bRestored = true; + } + return; + } + m_player.getRagdoll(); + if (m_player.m_btRagdoll & 0x20) + m_player.setRagdoll(m_player.m_btRagdoll ^ 0x20); + return; +} + +void hack::vehicleAccel(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fAcceleration != m_vehicle.m_handlingRestore.m_fAcceleration) + m_vehicle.setAcceleration(m_vehicle.m_handlingRestore.m_fAcceleration); + feature->m_bRestored = true; + } + return; + } + float fValue = m_vehicle.m_handlingRestore.m_fAcceleration * static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fAcceleration != fValue) + m_vehicle.setAcceleration(fValue); + return; +} + +void hack::vehicleBrake(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fBrakeForce != m_vehicle.m_handlingRestore.m_fBrakeForce) + m_vehicle.setBrakeForce(m_vehicle.m_handlingRestore.m_fBrakeForce); + feature->m_bRestored = true; + } + return; + } + float fValue = m_vehicle.m_handlingRestore.m_fBrakeForce * static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fBrakeForce != fValue) + m_vehicle.setBrakeForce(fValue); + return; +} + +void hack::neverWanted(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_player.getWantedCanChange(); + if (m_player.m_flWantedCanChange != 1.f) + m_player.setWantedCanChange(1.f); + feature->m_bRestored = true; + } + return; + } + m_player.getWantedCanChange(); + if (m_player.m_flWantedCanChange != 0.f) + m_player.setWantedCanChange(0.f); + return; +} + +void hack::vehicleTraction(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fTractionCurveMin != m_vehicle.m_handlingRestore.m_fTractionCurveMin) + m_vehicle.setTractionCurveMin(m_vehicle.m_handlingRestore.m_fTractionCurveMin); + feature->m_bRestored = true; + } + return; + } + float fValue = m_vehicle.m_handlingRestore.m_fTractionCurveMin * static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fTractionCurveMin != fValue) + m_vehicle.setTractionCurveMin(fValue); + return; +} + +void hack::vehicleGravity(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_vehicle.getGravity(); + if (m_vehicle.m_fGravity != 9.8f) + m_vehicle.setGravity(9.8f); + feature->m_bRestored = true; + } + return; + } + m_vehicle.getGravity(); + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_fGravity != fValue) + m_vehicle.setGravity(fValue); + return; +} + +void hack::vehicleBulletproofTires(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_vehicle.getBulletproofTires(); + if (m_vehicle.m_btBulletproofTires & 0x20) + m_vehicle.setBulletproofTires(m_vehicle.m_btBulletproofTires ^ 0x20); + feature->m_bRestored = true; + } + return; + } + m_vehicle.getBulletproofTires(); + if (!(m_vehicle.m_btBulletproofTires & 0x20)) + m_vehicle.setBulletproofTires(m_vehicle.m_btBulletproofTires | 0x20); + return; +} + +void hack::wanted(feat* feature) +{ + if (!feature->m_bOn) + return; + m_player.getWanted(); + float fValue = static_cast(feature)->m_fValue; + if (m_player.m_dwWanted != (DWORD)fValue) + { + m_player.setWanted((DWORD)fValue); + feat* fpNeverWanted = g_pSettings->getFeature(g_iFeature[FEATURE_P_NEVERWANTED]); + if (fpNeverWanted->m_bOn) + fpNeverWanted->toggle(); + } + return; +} + +void hack::bulletBatch(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_dwBulletBatch != m_weapon.m_weapDataRestore.m_dwBulletBatch) + m_weapon.setBulletBatch(m_weapon.m_weapDataRestore.m_dwBulletBatch); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_dwBulletBatch * static_cast(feature)->m_fValue; + fValue = (fValue > 25.f) ? 25.f : fValue; + if (m_weapon.m_weapDataCur.m_dwBulletBatch != fValue) + m_weapon.setBulletBatch((DWORD)fValue); + return; +} + +void hack::muzzleVelocity(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_weapon.m_weapDataCur.m_fMuzzleVelocity != m_weapon.m_weapDataRestore.m_fMuzzleVelocity) + m_weapon.setMuzzleVelocity(m_weapon.m_weapDataRestore.m_fMuzzleVelocity); + feature->m_bRestored = true; + } + return; + } + float fValue = m_weapon.m_weapDataRestore.m_fMuzzleVelocity * static_cast(feature)->m_fValue; + if (m_weapon.m_weapDataCur.m_fMuzzleVelocity != fValue) + m_weapon.setMuzzleVelocity(fValue); + return; +} + +void hack::vehicleDeformation(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fDeformationDamageMult != m_vehicle.m_handlingRestore.m_fDeformationDamageMult) + m_vehicle.setDeformationDamageMult(m_vehicle.m_handlingRestore.m_fDeformationDamageMult); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fDeformationDamageMult != fValue) + m_vehicle.setDeformationDamageMult(fValue); + return; +} + +void hack::vehicleUpShift(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fUpShift != m_vehicle.m_handlingRestore.m_fUpShift) + m_vehicle.setUpShift(m_vehicle.m_handlingRestore.m_fUpShift); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fUpShift != fValue) + m_vehicle.setUpShift(fValue); + return; +} + +void hack::vehicleSuspensionForce(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fSuspensionForce != m_vehicle.m_handlingRestore.m_fSuspensionForce) + m_vehicle.setSuspensionForce(m_vehicle.m_handlingRestore.m_fSuspensionForce); + feature->m_bRestored = true; + } + return; + } + float fValue = m_vehicle.m_handlingRestore.m_fSuspensionForce * static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fSuspensionForce != fValue) + m_vehicle.setSuspensionForce(fValue); + return; +} + +void hack::vehicleDownShift(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fDownShift != m_vehicle.m_handlingRestore.m_fDownShift) + m_vehicle.setDownShift(m_vehicle.m_handlingRestore.m_fDownShift); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fDownShift != fValue) + m_vehicle.setDownShift(fValue); + return; +} + +void hack::vehicleMass(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fMass != m_vehicle.m_handlingRestore.m_fMass) + m_vehicle.setMass(m_vehicle.m_handlingRestore.m_fMass); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fMass != fValue) + m_vehicle.setMass(fValue); + return; +} + +void hack::vehicleBuoyancy(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fBuoyancy != m_vehicle.m_handlingRestore.m_fBuoyancy) + m_vehicle.setBuoyancy(m_vehicle.m_handlingRestore.m_fBuoyancy); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fBuoyancy != fValue) + m_vehicle.setBuoyancy(fValue); + return; +} + +void hack::vehicleHandbrakeForce(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fHandbrakeForce != m_vehicle.m_handlingRestore.m_fHandbrakeForce) + m_vehicle.setHandbrakeForce(m_vehicle.m_handlingRestore.m_fHandbrakeForce); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fHandbrakeForce != fValue) + m_vehicle.setHandbrakeForce(fValue); + return; +} + +void hack::boost(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_vehicle.getBoost(); + if (m_vehicle.m_fBoost != 1.25) + m_vehicle.setBoost(1.25); + feature->m_bRestored = true; + } + return; + } + m_vehicle.getBoost(); + if (m_vehicle.m_fBoost != 1.25) + m_vehicle.setBoost(1.25); + return; +} + +void hack::vehicleRocketRechargeSpeed(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_vehicle.getRocketRechargeSpeed(); + if (m_vehicle.m_fRocketRechargeSpeed != 0.5f) + m_vehicle.setRocketRechargeSpeed(0.5f); + feature->m_bRestored = true; + } + return; + } + m_vehicle.getRocketRechargeSpeed(); + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_fRocketRechargeSpeed != fValue) + m_vehicle.setRocketRechargeSpeed(fValue); + return; +} + +void hack::vehicleSuspensionHeigh(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fSuspensionHeigh != m_vehicle.m_handlingRestore.m_fSuspensionHeigh) + m_vehicle.setSuspensionHeigh(m_vehicle.m_handlingRestore.m_fSuspensionHeigh); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fSuspensionHeigh != fValue) + m_vehicle.setSuspensionHeigh(fValue); + return; +} + +void hack::vehicleColisionDamageMult(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fColisionDamageMult != m_vehicle.m_handlingRestore.m_fColisionDamageMult) + m_vehicle.setColisionDamageMult(m_vehicle.m_handlingRestore.m_fColisionDamageMult); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fColisionDamageMult != fValue) + m_vehicle.setColisionDamageMult(fValue); + return; +} + +void hack::vehicleWeaponDamageMult(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fWeaponDamageMult != m_vehicle.m_handlingRestore.m_fWeaponDamageMult) + m_vehicle.setWeaponDamageMult(m_vehicle.m_handlingRestore.m_fWeaponDamageMult); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fWeaponDamageMult != fValue) + m_vehicle.setWeaponDamageMult(fValue); + return; +} + +void hack::vehicleEngineDamageMult(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + if (m_vehicle.m_handlingCur.m_fEngineDamageMult != m_vehicle.m_handlingRestore.m_fEngineDamageMult) + m_vehicle.setEngineDamageMult(m_vehicle.m_handlingRestore.m_fEngineDamageMult); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + if (m_vehicle.m_handlingCur.m_fEngineDamageMult != fValue) + m_vehicle.setEngineDamageMult(fValue); + return; +} + +void hack::tunableRpMult(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getRpMult(); + if (m_tunable.m_fRpMult != 1) + m_tunable.setRpMult(1); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + m_tunable.getRpMult(); + if (m_tunable.m_fRpMult != fValue) + m_tunable.setRpMult(fValue); + return; +} + +void hack::tunableApMult(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getApMult(); + if (m_tunable.m_fApMult != 1) + m_tunable.setApMult(1); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + m_tunable.getApMult(); + if (m_tunable.m_fApMult != fValue) + m_tunable.setApMult(fValue); + return; +} + +void hack::tunableMissionPayout(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getMinMissionPayout(); + if (m_tunable.m_fMinMissionPayout != 0) + m_tunable.setMinMissionPayout(0); + feature->m_bRestored = true; + } + return; + } + float fValue = static_cast(feature)->m_fValue; + m_tunable.getMinMissionPayout(); + if (m_tunable.m_fMinMissionPayout != fValue) + m_tunable.setMinMissionPayout(fValue); + return; +} + +void hack::tunableOrbitalCannonCooldown(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getOrbitalCannonCooldown(); + if (m_tunable.m_dwOrbitalCannonCooldown != 2880000) + m_tunable.setOrbitalCannonCooldown(2880000); + feature->m_bRestored = true; + } + return; + } + m_tunable.getOrbitalCannonCooldown(); + if (m_tunable.m_dwOrbitalCannonCooldown != 0) + m_tunable.setOrbitalCannonCooldown(0); + return; +} + +void hack::tunableBunkerResearch(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getBunkerResearch(); + if (m_tunable.m_dwBunkerResearch != 0) + m_tunable.setBunkerResearch(0); + feature->m_bRestored = true; + } + return; + } + m_tunable.getBunkerResearch(); + if (m_tunable.m_dwBunkerResearch != 1) + m_tunable.setBunkerResearch(1); + return; +} + +void hack::tunableAntiIdleKick(feat* feature) +{ + if (!feature->m_bOn) + { + if (!feature->m_bRestored) + { + m_tunable.getAntiIdleKick1(); + m_tunable.getAntiIdleKick2(); + m_tunable.getAntiIdleKick3(); + m_tunable.getAntiIdleKick4(); + if (m_tunable.m_dwAntiIdleKick1 != 120000) + m_tunable.setAntiIdleKick1(120000); + if (m_tunable.m_dwAntiIdleKick2 != 300000) + m_tunable.setAntiIdleKick2(300000); + if (m_tunable.m_dwAntiIdleKick3 != 600000) + m_tunable.setAntiIdleKick3(600000); + if (m_tunable.m_dwAntiIdleKick4 != 900000) + m_tunable.setAntiIdleKick4(900000); + feature->m_bRestored = true; + } + return; + } + m_tunable.getAntiIdleKick1(); + m_tunable.getAntiIdleKick2(); + m_tunable.getAntiIdleKick3(); + m_tunable.getAntiIdleKick4(); + if (m_tunable.m_dwAntiIdleKick1 != 2000000000) + m_tunable.setAntiIdleKick1(2000000000); + if (m_tunable.m_dwAntiIdleKick2 != 2000000000) + m_tunable.setAntiIdleKick2(2000000000); + if (m_tunable.m_dwAntiIdleKick3 != 2000000000) + m_tunable.setAntiIdleKick3(2000000000); + if (m_tunable.m_dwAntiIdleKick4 != 2000000000) + m_tunable.setAntiIdleKick4(2000000000); + return; +} + +void hack::about(float* arg) +{ + switch ((int)*arg) + { + case 0: + WinExec("explorer.exe https://google.com", SW_NORMAL); + break; + case 1: + WinExec("explorer.exe https://google.com", SW_NORMAL); + break; + default: + break; + } + +} + +void hack::cabut(float* arg) +{ + exit(0); +} diff --git a/subVersion/hack.h b/subVersion/hack.h new file mode 100644 index 0000000..0b71be1 --- /dev/null +++ b/subVersion/hack.h @@ -0,0 +1,191 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#pragma once +#include +#ifndef HACK_H +#define HACK_H + +#define INITPTR_INVALID_WORLD 1 << 0 +#define INITPTR_INVALID_PLAYER 1 << 1 +#define INITPTR_INVALID_VEHICLE 1 << 2 +#define INITPTR_INVALID_WEAPON 1 << 3 +#define INITPTR_INVALID_TUNABLE 1 << 4 +#define INITPTR_INVALID_GLOBAL 1 << 5 +#define INITPTR_INVALID_PLAYER_LIST 1 << 6 +#define INITPTR_INVALID_REPLAY_INTERFACE 1 << 7 +class trainer +{ + public: + clock_t m_keyTmr; + + trainer(); + ~trainer(); + bool checkKeyState(int key); + virtual void checkKeys(); +}; + +class hack : public trainer +{ + public: + v2 m_v2Waypoint; + v3 m_v3Objective; + player m_player; + vehicle m_vehicle; + weapon m_weapon; + tunable m_tunable; + global m_global; + replayInterface m_replayInterface; + std::string m_mpId; + std::deque> m_dStat; + ImpactExplosionEnum m_explosion; + + HMODULE m_hModule; + + hack(); + ~hack(); + void checkKeys(); + BYTE initPointers(); + + void teleport(v3 v); + bool teleportWaypoint(); + bool teleportObjective(); + void restoreHealth(); + void restoreVehicleHealth(); + void restoreStamina(); + void notWanted(); + void killNpc(); + void fillAmmo(); + void consumeStatQueue(); + void killAllNpc(float* arg); + void renderPlayerList(int parent, int playerList[32]); + void setImpactExplosion(float* arg); + void fillAllAmmo(float* arg); + void healVehicle(float* arg); + void healPlayer(float* arg); + void suicide(float* arg); + void fillAmmo(float* arg); + void fillSkillLevels(float* arg); + void fillAllSnacks(float* arg); + void casinoStat(float* arg); + void casinoStatBitSet1(float* arg); + void casinoStatBitSet2(float* arg); + void unlockHeistCars(float* arg); + void unlockLSC(float* arg); + void unlockWeaponCamos(float* arg); + //void unlockWeapon(float* arg); + void unlockAllAwards(float* arg); + void unlockClothes(float* arg); + void intoPV(float* arg); + void loadSession(float* arg); + void forwardTeleport(float* arg); + void spawnVehicle(float* arg); + void selfDropMoney(feat* feature); + void waterProof(feat* feature); + void undeadOffradar(feat* feature); + void superPunch(feat* feature); + void noSpread(feat* feature); + void noRecoil(feat* feature); + void quickReload(feat* feature); + void bulletDamage(feat* feature); + void weaponRange(feat* feature); + void weaponSpin(feat* feature); + void weaponForceOnPed(feat* feature); + void weaponForceOnVehicle(feat* feature); + void weaponForceOnHeli(feat* feature); + void weaponBulletEdit(feat* feature); + void runSpeed(feat* feature); + void swimSpeed(feat* feature); + void npcIgnore(feat* feature); + void godMode(feat* feature); + void frameFlags(feat* featSuperJump, feat* featExplosiveMelee, feat* featFireAmmo, feat* featExplosiveAmmo); + void vehicleGod(feat* feature); + void infAmmo(feat* feature); + void noReload(feat* feature); + void seatbelt(feat* feature); + void noRagdoll(feat* feature); + void vehicleAccel(feat* feature); + void vehicleBrake(feat* feature); + void neverWanted(feat* feature); + void vehicleTraction(feat* feature); + void vehicleGravity(feat* feature); + void vehicleBulletproofTires(feat* feature); + void wanted(feat* feature); + void bulletBatch(feat* feature); + void muzzleVelocity(feat* feature); + void vehicleDeformation(feat* feature); + void vehicleUpShift(feat* feature); + void vehicleSuspensionForce(feat* feature); + void vehicleDownShift(feat* feature); + void vehicleMass(feat* feature); + void vehicleBuoyancy(feat* feature); + void vehicleHandbrakeForce(feat* feature); + void boost(feat* feature); + void vehicleRocketRechargeSpeed(feat* feature); + void vehicleSuspensionHeigh(feat* feature); + void vehicleColisionDamageMult(feat* feature); + void vehicleWeaponDamageMult(feat* feature); + void vehicleEngineDamageMult(feat* feature); + void tunableRpMult(feat* feature); + void tunableApMult(feat* feature); + void tunableMissionPayout(feat* feature); + void tunableOrbitalCannonCooldown(feat* feature); + void tunableBunkerResearch(feat* feature); + void tunableAntiIdleKick(feat* feature); + void about(float* arg); + void cabut(float* arg); + + private: + DWORD_PTR m_dwpWorldBase, + m_dwpPlayerBase, + m_dwpVehicleBase, + m_dwpAttackerBase, + m_dwpWeaponManager, + m_dwpWeaponCur, + m_dwpAmmoInfo, + m_dwpWeaponBase, + m_dwpTunableBase, + m_dwpGlobalBase, + m_dwpPlayerListBase, + m_dwpReplayInterfaceBase; + bool m_bInit,m_bSelfDropInit; + + void getWaypoint(); + void getObjective(); + void dStatPushBack(unsigned int hash, int value); + + unsigned int string_to_hash(std::string input,std::string pre = "MP0_") + { + unsigned int num1 = 0U; + input = pre + input; + for (char c : input) + { + unsigned int num2 = num1 + (unsigned int)tolower(c); + unsigned int num3 = num2 + (num2 << 10); + num1 = num3 ^ num3 >> 6; + } + unsigned int num4 = num1 + (num1 << 3); + unsigned int num5 = num4 ^ num4 >> 11; + return num5 + (num5 << 15); + } +}; + +extern hack* g_pHack; + +#endif \ No newline at end of file diff --git a/subVersion/main.cpp b/subVersion/main.cpp new file mode 100644 index 0000000..b98c4c2 --- /dev/null +++ b/subVersion/main.cpp @@ -0,0 +1,587 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#include "stdafx.h" + +//global vars +HWND g_hWnd; +hack* g_pHack; +settings* g_pSettings; +memManager* g_pMemMan; +D3D9Render* g_pD3D9Render; +std::map*>* g_pCBMap; +int g_iFeature[MAX_MENU_FEATURES] = {}; +int g_iIndex; +int g_iFeaturePlayerList[32]; +std::pair tbl_SessionMItems[] = { + {-1,L"Ke GTA offline"},{0,L"Join public"},{1,L"Bikin Solo Public"},{12,L"Join temen"}, + {2,L"Bikin friend only"},{3,L"Gang war?"},{9,L"Add sbg teman"},{6,L"Close friend"}, + {10,L"Solo"},{11,L"Sesi invite only"} +}; + +bool g_bKillSwitch = false; +bool g_bKillRender = false; +bool g_bKillAttach = false; +bool g_bKillHack = false; + +long ADDRESS_WORLD = 0; +long ADDRESS_BLIP = 0; +long ADDRESS_AMMO = 0; +long ADDRESS_MAGAZINE = 0; +long ADDRESS_TUNABLE = 0; +long ADDRESS_WEAPON = 0; +long ADDRESS_GLOBAL = 0; +long ADDRESS_PLAYER_LIST = 0; +long ADDRESS_REPLAY_INTERFACE = 0; +//fuction prototypes +LRESULT __stdcall WindowProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam); +int addFeature(int cat, + int parent, + std::wstring name, + featType type, + void (hack::* fun)(float*), + float arg); +DWORD __stdcall threadAttach(LPVOID lpParam); +DWORD __stdcall threadRender(LPVOID lpParam); +DWORD __stdcall threadHack(LPVOID lpParam); + +void iklan(); + +int __stdcall WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + if (FindWindow("sub1toOverlay", nullptr)) //make sure the hack is not already running + exit(0); + + g_iIndex = 0; + g_pMemMan = new memManager; + g_pSettings = new settings; + g_pD3D9Render = new D3D9Render; + g_pHack = new hack; + g_pCBMap = new std::map*>; + + LPCSTR szWindowTitleTarget = "Grand Theft Auto V"; + LPCWSTR szWindowTitle = L"Wahyu anekdot mk2"; + //v 1.3.1 + g_pMemMan->setWindowName(szWindowTitleTarget); + g_pD3D9Render->m_szWindowTitle = szWindowTitle; + + g_pSettings->addFeatureCategory(L"Pemain"); //0 + g_pSettings->addFeatureCategory(L"Senjata"); //1 + g_pSettings->addFeatureCategory(L"Mobil"); //2 + g_pSettings->addFeatureCategory(L"Teleport"); //3 + g_pSettings->addFeatureCategory(L"dll"); //4 + + + g_iFeature[FEATURE_P_TRUEGOD] = g_pSettings->addFeature(0, -1, L"Tuhan", feat_toggle, "trueGodMode"); + g_iFeature[FEATURE_P_GOD] = g_pSettings->addFeature(0, -1, L"Dewa", feat_toggle, "godMode"); + g_iFeature[FEATURE_P_HEAL] = addFeature(0, -1, L"ngobat", feat_btn, &hack::healPlayer, -1.f); + g_iFeature[FEATURE_P_SUICIDE] = addFeature(0, -1, L"Bunuh diri", feat_btn, &hack::suicide, -1.f); + g_iFeature[FEATURE_P_WANTED] = g_pSettings->addFeature(0, -1, L"Wanted", feat_slider, "wanted", 0.f, 5.f, .2f); + g_iFeature[FEATURE_P_NEVERWANTED] = g_pSettings->addFeature(0, -1, L"Polisi Damai", feat_toggle, "neverWanted"); + //addFeature(0, -1, "ɱNPC", feat_btn, &hack::killAllNpc, -1.f); + g_iFeature[FEATURE_P_ANTINPC] = g_pSettings->addFeature(0, -1, L"bunuh NPC", feat_toggle, "antiNpc"); + g_iFeature[FEATURE_P_NPC_IGNORE] = g_pSettings->addFeature(0, -1, L"NPC cuek", feat_toggle, "npcIgnore"); + g_iFeature[FEATURE_P_RUNSPD] = g_pSettings->addFeature(0, -1, L"kecepatan Lari", feat_slider, "runSpd", 1.f, 5.f); + g_iFeature[FEATURE_P_SWIMSPD] = g_pSettings->addFeature(0, -1, L"kecepatan Renang", feat_slider, "swimSpd", 1.f, 5.f); + g_iFeature[FEATURE_P_SUPER_PUNCH] = g_pSettings->addFeature(0, -1, L"Tinju Budha", feat_slider, "superPunch", 0.f, 1000.f, (float)1.f / 10.f); + g_iFeature[FEATURE_P_SUPERJUMP] = g_pSettings->addFeature(0, -1, L"Lompat Kanguru", feat_toggle, "superJump"); + g_iFeature[FEATURE_P_EXPLOSIVEMELEE] = g_pSettings->addFeature(0, -1, L"Tinju Ledak Budha", feat_toggle, "explMelee"); + g_iFeature[FEATURE_P_UNDEAD_OFFRADAR] = g_pSettings->addFeature(0, -1, L"anti RadarUndead", feat_toggle, "undeadOffradar"); + g_iFeature[FEATURE_P_NORAGDOLL] = g_pSettings->addFeature(0, -1, L"anti Ragdoll", feat_toggle, "noRagdoll"); + g_iFeature[FEATURE_P_WATER_PROOF] = g_pSettings->addFeature(0, -1, L"anti Aer", feat_toggle, "waterProof"); + g_iFeature[FEATURE_P_STAMINA] = g_pSettings->addFeature(0, -1, L"Stamina Dewa", feat_toggle, "infStam"); + + //g_iFeature[FEATURE_W_FILL_ALL_AMMO] = addFeature(1, -1, "ҩ", feat_btn, &hack::fillAllAmmo, -1.f); + g_iFeature[FEATURE_W_FILL_AMMO] = addFeature(1, -1, L"IsiPelor", feat_btn, &hack::fillAmmo, -1.f); + g_iFeature[FEATURE_W_SPREAD] = g_pSettings->addFeature(1, -1, L"No Nyebar", feat_toggle, "noSpread"); + g_iFeature[FEATURE_W_RECOIL] = g_pSettings->addFeature(1, -1, L"No Recoil", feat_toggle, "noRecoil"); + g_iFeature[FEATURE_W_NORELOAD] = g_pSettings->addFeature(1, -1, L"No Isi Ulang", feat_toggle, "noReload"); + g_iFeature[FEATURE_W_RELOAD] = g_pSettings->addFeature(1, -1, L"Isi Ulang GC", feat_slider, "quickReload", 1.f, 10.f); + int bulletEdit = g_pSettings->addFeature(1, -1, L"Edit Peluru >>", feat_parent); + g_iFeature[FEATURE_W_BULLET_EDIT] = g_pSettings->addFeature(-1, bulletEdit, L"Edit Peluru", feat_toggle, "bulletEdit"); + addFeature(-1, bulletEdit, L"Ledakan Granat", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::GrenadeExplosion); + addFeature(-1, bulletEdit, L"Ledakan Sticky", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::StickyBombExplosion); + addFeature(-1, bulletEdit, L"Ledakan Molotov", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::MoltovCoctailExplosion); + addFeature(-1, bulletEdit, L"Super Launcher", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SuperLauncher); + addFeature(-1, bulletEdit, L"Ledakan petir", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::LightningExplosion); + addFeature(-1, bulletEdit, L"Ledakan besar", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::BigExplosion); + addFeature(-1, bulletEdit, L"Ledakan berapi", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::BigFireyExplosion); + addFeature(-1, bulletEdit, L"Ledakan sedang", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::MediumExplosion); + addFeature(-1, bulletEdit, L"Ledakan kecil", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::TinyExplosion); + addFeature(-1, bulletEdit, L"Ledakan kecil 2", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::TinyExplosions2); + addFeature(-1, bulletEdit, L"Semprot air kecil", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SmallWaterSpray); + addFeature(-1, bulletEdit, L"Semprot api kecil", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SmallFireSpray); + addFeature(-1, bulletEdit, L"Semprot air besar", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::BigWaterSpray); + addFeature(-1, bulletEdit, L"Semprot api besar", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::BigFireSpray); + addFeature(-1, bulletEdit, L"Peluru ledak MK2", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::MK2ExplosiveBullets); + addFeature(-1, bulletEdit, L"Granat asap", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SmokeGrenade); + addFeature(-1, bulletEdit, L"Gas air mata", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::TearGas); + addFeature(-1, bulletEdit, L"Gas air mata 2", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::TearGas2); + addFeature(-1, bulletEdit, L"Flare merah", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::RedFlareSmoke); + addFeature(-1, bulletEdit, L"Cool Ground Explosion", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::CoolGroundExplosion); + addFeature(-1, bulletEdit, L"Ledakan shockwave", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::CRAZYSHOCKWAVEEXPLOSION); + addFeature(-1, bulletEdit, L"Ledakan berapi besar", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::HUGEFireyExplosion); + addFeature(-1, bulletEdit, L"Ledakan blimp besar", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::MassiveBlimpExplosion); + addFeature(-1, bulletEdit, L"Ledakan blimp besar 2", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::MassiveBlimpExplosion2); + addFeature(-1, bulletEdit, L"Serpihan ledak", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::LargeExplosionFallingDebris); + addFeature(-1, bulletEdit, L"Ledakan bola api", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::FireBallExplosion); + addFeature(-1, bulletEdit, L"Ledakan petasan", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::FireworkExplosion); + addFeature(-1, bulletEdit, L"Bola salju", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SnowballHit); + addFeature(-1, bulletEdit, L"Layar gempa", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::JustScreenShake); + addFeature(-1, bulletEdit, L"Spoof Exp", feat_btn, &hack::setImpactExplosion, ImpactExplosionEnum::SPOOFEXPLOSION); + g_iFeature[FEATURE_W_FORCE_ON_PED] = g_pSettings->addFeature(1, -1, L"Gaya pejalan kaki", feat_slider, "forceOnPed", 1.f, 10000.f); + g_iFeature[FEATURE_W_FORCE_ON_VEHICLE] = g_pSettings->addFeature(1, -1, L"Gaya pada kendaraan", feat_slider, "forceOnVeh", 1.f, 10000.f); + g_iFeature[FEATURE_W_FORCE_ON_HELI] = g_pSettings->addFeature(1, -1, L"Gaya pada heli", feat_slider, "forceOnHeli", 1.f, 10000.f); + g_iFeature[FEATURE_W_DAMAGE] = g_pSettings->addFeature(1, -1, L"Damage peluru", feat_slider, "bulletDamage", 1.f, 10.f); + g_iFeature[FEATURE_W_AMMO] = g_pSettings->addFeature(1, -1, L"Peluru ga habis", feat_toggle, "infAmmo"); + g_iFeature[FEATURE_W_RANGE] = g_pSettings->addFeature(1, -1, L"Weap Range", feat_slider, "weapRange", 1.f, 10.f); + g_iFeature[FEATURE_W_SPINUP] = g_pSettings->addFeature(1, -1, L"Weap spin", feat_toggle, "weapSpin"); + g_iFeature[FEATURE_W_EXPLOSIVEAMMO] = g_pSettings->addFeature(1, -1, L"Peluru Ledak", feat_toggle, "explAmmo"); + g_iFeature[FEATURE_W_FIREAMMO] = g_pSettings->addFeature(1, -1, L"Peluru api", feat_toggle, "fireAmmo"); + g_iFeature[FEATURE_W_BULLET_BATCH] = g_pSettings->addFeature(1, -1, L"Peluru banyak", feat_slider, "bulletBatch", 1.f, 10.f, (float)1.f / 9.f); + g_iFeature[FEATURE_W_MUZZLE_VELOCITY] = g_pSettings->addFeature(1, -1, L"Kelajuan peluru", feat_slider, "muzzleVelo", 1.f, 10.f); + + g_iFeature[FEATURE_V_TRUEGOD] = g_pSettings->addFeature(2, -1, L"Kendaraan Tuhan", feat_toggle, "vehTrueGodMode"); + g_iFeature[FEATURE_V_GOD] = g_pSettings->addFeature(2, -1, L"Kendaraan Dewa", feat_toggle, "vehGodMode"); + g_iFeature[FEATURE_V_HEAL] = addFeature(2, -1, L"Ketok magic", feat_btn, &hack::healVehicle, -1.f); + g_iFeature[FEATURE_V_BULLETPROOFTIRES] = g_pSettings->addFeature(2, -1, L"Ban antipeluru", feat_toggle, "vehBulletproofTires"); + g_iFeature[FEATURE_V_SEATBELT] = g_pSettings->addFeature(2, -1, L"Sabuk pengaman", feat_toggle, "seatbelt"); + g_iFeature[FEATURE_V_GRAVITY] = g_pSettings->addFeature(2, -1, L"Gravitasi Kendaraan", feat_slider, "vehGravity", -25.f, 25.f); + g_iFeature[FEATURE_V_BOOST] = g_pSettings->addFeature(2, -1, L"Boost Kendaraan", feat_toggle, "vehBoost"); + g_iFeature[FEATURE_V_RECHARGE_SPEED] = g_pSettings->addFeature(2, -1, L"Boost isi ulang", feat_slider, "vehRrchargeSpeed", .5f, 5.f); + int handing = g_pSettings->addFeature(2, -1, L"Setingan mobil >>", feat_parent); + g_iFeature[FEATURE_V_MASS] = g_pSettings->addFeature(-1, handing, L"Massa", feat_slider, "vehMass", 0.f, 1000000.f); + g_iFeature[FEATURE_V_BUOYANCY] = g_pSettings->addFeature(-1, handing, L"Kemampuan ngapung", feat_slider, "vehBuoyancy", 0.f, 1000.f); + g_iFeature[FEATURE_V_ACCELERATION] = g_pSettings->addFeature(-1, handing, L"Akselerasi", feat_slider, "vehAccel", 1.f, 1000.f); + g_iFeature[FEATURE_V_UPSHIFT] = g_pSettings->addFeature(-1, handing, L"Gigi naik", feat_slider, "vehUpShift", 1.f, 25.f); + g_iFeature[FEATURE_V_DOWNSHIFT] = g_pSettings->addFeature(-1, handing, L"Gigi turun", feat_slider, "vehDownShift", 1.f, 25.f); + g_iFeature[FEATURE_V_BRAKEFORCE] = g_pSettings->addFeature(-1, handing, L"Gaya rem", feat_slider, "vehBrakeForce", 1.f, 25.f); + g_iFeature[FEATURE_V_HANDBRAKEFORCE] = g_pSettings->addFeature(-1, handing, L"Buyoancy", feat_slider, "vehBuoyancy", 1.f, 25.f); + g_iFeature[FEATURE_V_TRACTION] = g_pSettings->addFeature(-1, handing, L"Traction", feat_slider, "vehTraction", 1.f, 25.f); + g_iFeature[FEATURE_V_SUSPENSION_FORCE] = g_pSettings->addFeature(-1, handing, L"Gaya pegas", feat_slider, "vehSuspensionForce", 0.f, 25.f); + g_iFeature[FEATURE_V_SUSPENSION_HEIGH] = g_pSettings->addFeature(-1, handing, L"Tinggi pegas", feat_slider, "vehSuspensionHeigh", 0.f, 1.f); + g_iFeature[FEATURE_V_COLISION_DAMAGE_MP] = g_pSettings->addFeature(-1, handing, L"Kerusakan tabrakan", feat_slider, "vehColisionDamage", 0.f, 25.f); + g_iFeature[FEATURE_V_WEAPON_DAMAGE_MP] = g_pSettings->addFeature(-1, handing, L"Damage senjata kendaraan", feat_slider, "vehWeaponDamage", 0.f, 25.f); + g_iFeature[FEATURE_V_DEFORMATION] = g_pSettings->addFeature(-1, handing, L"Deform kendaraan", feat_slider, "vehDeform", 0.f, 25.f); + g_iFeature[FEATURE_V_ENGINE_DAMAGE_MP] = g_pSettings->addFeature(-1, handing, L"Kerusakan mesin", feat_slider, "vehEngineDamage", 0.f, 25.f); + + g_pSettings->addFeature(3, -1, L"teleport ke WP", feat_teleport, tp_waypoint); + g_pSettings->addFeature(3, -1, L"teleport ke OBJ", feat_teleport, tp_objective); + addFeature(3, -1, L"Teleport maju", feat_btn, &hack::forwardTeleport, 5.f); + + int interior = g_pSettings->addFeature(3, -1, L"Teleport ke... >>", feat_parent); + g_pSettings->addFeature(-1, interior, L"Gedung FIB", feat_teleport, tp_static, 136.0f, -750.f, 262.f); + g_pSettings->addFeature(-1, interior, L"Garment Factory", feat_teleport, tp_static, 712.716f, -962.906f, 30.6f); + g_pSettings->addFeature(-1, interior, L"Franklin House", feat_teleport, tp_static, 7.119f, 536.615f, 176.2f); + g_pSettings->addFeature(-1, interior, L"Michael House", feat_teleport, tp_static, -813.603f, 179.474f, 72.5f); + g_pSettings->addFeature(-1, interior, L"Hidden Treasure 1", feat_teleport, tp_static, 1972.610f, 3817.040f, 33.65f); + g_pSettings->addFeature(-1, interior, L"Aunt Dennis House", feat_teleport, tp_static, -14.380f, -1438.510f, 31.3f); + g_pSettings->addFeature(-1, interior, L"Freud House", feat_teleport, tp_static, -1151.770f, -1518.138f, 10.85f); + g_pSettings->addFeature(-1, interior, L"Lester House", feat_teleport, tp_static, 1273.898f, -1719.304f, 54.8f); + g_pSettings->addFeature(-1, interior, L"Strip Club", feat_teleport, tp_static, 97.271f, -1290.994f, 29.45f); + g_pSettings->addFeature(-1, interior, L"Bank Vault (Pacific Standard)", feat_teleport, tp_static, 255.85f, 217.f, 101.9f); + g_pSettings->addFeature(-1, interior, L"Comedy Club", feat_teleport, tp_static, 378.100f, -999.964f, -98.6f); + g_pSettings->addFeature(-1, interior, L"Humane Lab", feat_teleport, tp_static, 3614.394f, 3744.803f, 28.9f); + g_pSettings->addFeature(-1, interior, L"Humane Lab Authentic", feat_teleport, tp_static, 3525.201f, 3709.625f, 21.2f); + g_pSettings->addFeature(-1, interior, L"IAA Office", feat_teleport, tp_static, 113.568f, -619.001f, 206.25f); + g_pSettings->addFeature(-1, interior, L"Torture Chamber", feat_teleport, tp_static, 142.746f, -2201.189f, 4.9f); + g_pSettings->addFeature(-1, interior, L"Military Base Tower", feat_teleport, tp_static, -2358.132f, 3249.754f, 101.65f); + g_pSettings->addFeature(-1, interior, L"Mine", feat_teleport, tp_static, -595.342f, 2086.008f, 131.6f); + int saved = g_pSettings->addFeature(3, -1, L"Custom Save Point >>", feat_parent); + g_pSettings->addFeature(-1, saved, L"Save Point1", feat_teleport, "pos0", tp_saved); + g_pSettings->addFeature(-1, saved, L"Save Point2", feat_teleport, "pos1", tp_saved); + g_pSettings->addFeature(-1, saved, L"Save Point3", feat_teleport, "pos2", tp_saved); + g_pSettings->addFeature(-1, saved, L"Save Point4", feat_teleport, "pos3", tp_saved); + g_pSettings->addFeature(-1, saved, L"Save Point5", feat_teleport, "pos4", tp_saved); + g_pSettings->addFeature(-1, saved, L"Save Point6", feat_teleport, "pos5", tp_saved); + g_pSettings->addFeature(3, -1, L"Los Santos Custom", feat_teleport, tp_static, -365.425f, -131.809f, -225.f);//38.9f); + g_pSettings->addFeature(3, -1, L"LS Airport", feat_teleport, tp_static, -1336.f, -3044.f, -225.f);//14.15f); + g_pSettings->addFeature(3, -1, L"Shandy Shore Airport", feat_teleport, tp_static, 1747.f, 3273.f, -225.f);//41.35f); + g_pSettings->addFeature(3, -1, L"Mount Chilliad", feat_teleport, tp_static, 489.979f, 5587.527f, 794.3f); + + int session = g_pSettings->addFeature(4, -1, L"Bikin sesi baru >>", feat_parent); + for (size_t i = 0; i < sizeof(tbl_SessionMItems) / sizeof(tbl_SessionMItems[0]); i++) + addFeature(-1, session, tbl_SessionMItems[i].second, feat_btn, &hack::loadSession, tbl_SessionMItems[i].first); + int olService = g_pSettings->addFeature(4, -1, L"Onlen >>", feat_parent); + addFeature(-1, olService, L"Ke PV", feat_btn, &hack::intoPV, -1.f); + g_iFeature[FEATURE_P_MONERY_DROP] = g_pSettings->addFeature(-1, olService, L"Uang surga", feat_toggle, "moneyDrop"); + //g_iFeature[FEATURE_P_PLAYER_LIST] = g_pSettings->addFeature(3, -1, "б >>", feat_parent); + //for (size_t i = 0; i < sizeof(g_iFeaturePlayerList)/sizeof(g_iFeaturePlayerList[0]); i++) + //{ + // g_iFeaturePlayerList[i] = g_pSettings->addFeature(-1, g_iFeature[FEATURE_P_PLAYER_LIST]," >>", feat_parent); + //} + int vehSpawn = g_pSettings->addFeature(-1, olService, L"Mobil >>", feat_parent); + for (size_t i = 0; i < vehiclePreview.size(); i++) + { + int temp = g_pSettings->addFeature(-1, vehSpawn, vehiclePreview[i].first, feat_parent); + for (size_t j = 0; j < vehiclePreview[i].second.size(); j++) + addFeature(-1, temp, vehiclePreview[i].second[j].VName, feat_btn, &hack::spawnVehicle, i * 1000 + j); + } + + int tunable = g_pSettings->addFeature(-1, olService, L"Parameter tunable >>", feat_parent); + g_iFeature[FEATURE_T_ANTI_IDLE_KICK] = g_pSettings->addFeature(-1, tunable, L"Anti AFK", feat_toggle, "AntiIdleKick"); + g_iFeature[FEATURE_T_ORBITAL_CANNON] = g_pSettings->addFeature(-1, tunable, L"Orbital Cannon", feat_toggle, "OrbitalCannon"); + g_iFeature[FEATURE_T_RP_MP] = g_pSettings->addFeature(-1, tunable, L"RP Ganda", feat_slider, "RP", 1.f, 1000.f, (float)1.f / 9.f); + g_iFeature[FEATURE_T_AP_MP] = g_pSettings->addFeature(-1, tunable, L"AP Ganda", feat_slider, "AP", 1.f, 1000.f, (float)1.f / 9.f); + g_iFeature[FEATURE_T_MISSION_PAYOUT] = g_pSettings->addFeature(-1, tunable, L"Bayaran misi", feat_slider, "MinMissionPayout", 0.f, 100000.f); + int recovery = g_pSettings->addFeature(-1, olService, L"Buka kunci >>", feat_parent); + addFeature(-1, recovery, L"Isi Skill", feat_btn, &hack::fillSkillLevels, -1.f); + addFeature(-1, recovery, L"Isi cemilan", feat_btn, &hack::fillAllSnacks, -1.f); + int casino = g_pSettings->addFeature(-1, recovery, L"Perampokan Kasino >>", feat_parent); + addFeature(-1, casino, L"Stat kasino", feat_btn, &hack::casinoStat, 1.f); + int bitSet1 = g_pSettings->addFeature(-1, casino, L"Papan rencana >>", feat_parent); + addFeature(-1, bitSet1, L"Unlock probe", feat_btn, &hack::casinoStatBitSet1, 7.f); + addFeature(-1, bitSet1, L"Unlock POI", feat_btn, &hack::casinoStatBitSet1, 8.f); + int approach = g_pSettings->addFeature(-1, bitSet1, L"ٷʽ >>", feat_parent); + addFeature(-1, approach, L"Stealth", feat_btn, &hack::casinoStatBitSet1, 0.f); + addFeature(-1, approach, L"Big Cont", feat_btn, &hack::casinoStatBitSet1, 1.f); + addFeature(-1, approach, L"Agressive", feat_btn, &hack::casinoStatBitSet1, 2.f); + int target = g_pSettings->addFeature(-1, bitSet1, L"Rampok >>", feat_parent); + addFeature(-1, target, L"Duid", feat_btn, &hack::casinoStatBitSet1, 3.f); + addFeature(-1, target, L"Emas", feat_btn, &hack::casinoStatBitSet1, 4.f); + addFeature(-1, target, L"Seni", feat_btn, &hack::casinoStatBitSet1, 5.f); + addFeature(-1, target, L"Intan", feat_btn, &hack::casinoStatBitSet1, 6.f); + int bitSet2 = g_pSettings->addFeature(-1, casino, L"Papan rencana kedua >>", feat_parent); + addFeature(-1, bitSet2, L"One key, highest", feat_btn, &hack::casinoStatBitSet2, 11.f); + addFeature(-1, bitSet2, L"Duggan Shipment kelar", feat_btn, &hack::casinoStatBitSet2, 0.f); + addFeature(-1, bitSet2, L"Keycard level tinggi", feat_btn, &hack::casinoStatBitSet2, 1.f); + addFeature(-1, bitSet2, L"Most sought-after", feat_btn, &hack::casinoStatBitSet2, 2.f); + addFeature(-1, bitSet2, L"Driver terbaik", feat_btn, &hack::casinoStatBitSet2, 3.f); + addFeature(-1, bitSet2, L"Hacker terbaik", feat_btn, &hack::casinoStatBitSet2, 4.f); + int vehs = g_pSettings->addFeature(-1, bitSet2, L"Kendaraan escape >>", feat_parent); + addFeature(-1, vehs, L"0", feat_btn, &hack::casinoStatBitSet2, 5.f); + addFeature(-1, vehs, L"1", feat_btn, &hack::casinoStatBitSet2, 6.f); + addFeature(-1, vehs, L"2", feat_btn, &hack::casinoStatBitSet2, 7.f); + addFeature(-1, vehs, L"3", feat_btn, &hack::casinoStatBitSet2, 8.f); + int weaps = g_pSettings->addFeature(-1, bitSet2, L"Senjata >>", feat_parent); + addFeature(-1, weaps, L"0", feat_btn, &hack::casinoStatBitSet2, 9.f); + addFeature(-1, weaps, L"1", feat_btn, &hack::casinoStatBitSet2, 10.f); + int unlock = g_pSettings->addFeature(-1, recovery, L"Buka >>", feat_parent); + addFeature(-1, unlock, L"Unlock LSC", feat_btn, &hack::unlockLSC, -1.f); + addFeature(-1, unlock, L"Unlock Camo", feat_btn, &hack::unlockWeaponCamos, -1.f); + addFeature(-1, unlock, L"Unlock Heist Car", feat_btn, &hack::unlockHeistCars, -1.f); + addFeature(-1, unlock, L"Unlock Awards", feat_btn, &hack::unlockAllAwards, -1.f); + addFeature(-1, unlock, L"Unlock Baju", feat_btn, &hack::unlockClothes, -1.f); + g_iFeature[FEATURE_T_BUNKER_RESEARCH] = g_pSettings->addFeature(-1, unlock, L"Riset Bunker", feat_toggle, "BunkerResearch"); + addFeature(4, -1, L"Buka Internet", feat_btn, &hack::about, 0.f); + //addFeature(4, -1, L"Cek Update", feat_btn, &hack::about, 1.f); + addFeature(4, -1, L"Matiin modmenu", feat_btn, &hack::cabut, 1.f); + + + g_pSettings->setActiveCat(0); //this needs to be called so we can fill the current feature buffer + + WNDCLASSEX wc; + ZeroMemory(&wc, sizeof(WNDCLASSEX)); + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WindowProc; + wc.hInstance = hInstance; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); + wc.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); + wc.hbrBackground = dynamic_cast(CreateSolidBrush(RGB(0, 0, 0)));//(HBRUSH)COLOR_WINDOW; + wc.lpszClassName = "sub1toOverlay"; + + RegisterClassEx(&wc); + g_hWnd = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW, //dwExStyle [in] + L"sub1toOverlay", //lpClassName [in, optional] + szWindowTitle, //lpWindowName [in, optional] + WS_POPUP, //dwStyle [in] + 0, //x [in] + 0, //y [in] + 300, //nWidth [in] + 300, //nHeight [in] + nullptr, //hWndParent [in, optional] + nullptr, //hMenu [in, optional] + hInstance, //hInstance [in, optional] A handle to the instance of the module to be associated with the window. + nullptr); //lpParam [in, optional] + + SetLayeredWindowAttributes(g_hWnd, 0, 0, LWA_ALPHA); + SetLayeredWindowAttributes(g_hWnd, RGB(0, 0, 0), 0, LWA_COLORKEY); + + MARGINS margins{ 1, 1, 1, 1 }; + DwmExtendFrameIntoClientArea(g_hWnd, &margins); + + ShowWindow(g_hWnd, SW_SHOWNORMAL); + + CreateThread(NULL, + 0, + threadAttach, + NULL, + 0, + nullptr); + Sleep(100); + CreateThread(NULL, + 0, + threadRender, + NULL, + 0, + nullptr); + Sleep(100); + CreateThread(NULL, + 0, + threadHack, + NULL, + 0, + nullptr); + + MSG msg; + while (true) + { + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // Check to see if any messages are waiting in the queue + { + TranslateMessage(&msg); //Translate the message and dispatch it to WindowProc() + DispatchMessage(&msg); + } + + if (msg.message == WM_QUIT) + break; + + Sleep(100); + } + + return (int)msg.wParam; +} + +//main message handler +LRESULT __stdcall WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_DESTROY: + PostQuitMessage(0); + return 0; + break; + } + + return DefWindowProc(hWnd, message, wParam, lParam); //default behaviour for any unhandled messages +} + +int addFeature(int cat, int parent, std::wstring name, featType type, void (hack::* func)(float*), float arg) +{ + (*g_pCBMap)[g_iIndex] = new CallbackProxy; + (*g_pCBMap)[g_iIndex]->Set(g_pHack, func); + return g_pSettings->addFeature(cat, parent, name, type, g_iIndex++, arg); +} + +void iklan() { + MessageBoxExW( + NULL, + L"Nyalain NUM LOCK dan tekan NUM-", + L"Mod menu terbuka", + MB_ICONWARNING | MB_OK | MB_DEFBUTTON2, + 0 + ); +} + +DWORD __stdcall threadAttach(LPVOID lpParam) +{ + //iklan(); + + while (!g_bKillSwitch) + { + if (g_pMemMan->attach() && g_pMemMan->findWindow()) + { + + HWND fgWnd = GetForegroundWindow(), + tgWnd = g_pMemMan->getWindow(); + if (g_pD3D9Render->getViewport()) + MoveWindow(g_hWnd, g_pD3D9Render->m_screen.x, g_pD3D9Render->m_screen.y, g_pD3D9Render->m_screen.w, g_pD3D9Render->m_screen.h, true); + + if (fgWnd != tgWnd && fgWnd != g_hWnd) + { + SetWindowPos(g_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + else if (g_hWnd == fgWnd) + { + ShowWindow(tgWnd, SW_SHOW); + SetForegroundWindow(tgWnd); + } + else if (tgWnd == fgWnd && !(GetWindowLong(g_hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST)) + { + SetWindowPos(g_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + } + else + { + MessageBoxW(nullptr, L"GTA V nya idupin dulu jir", L"Mod menu gagal kebukak", MB_OK | MB_ICONERROR); + g_bKillAttach = true; + killProgram(); + } + + Sleep(0x30); + } + g_bKillAttach = true; + return 1; +} + +DWORD __stdcall threadRender(LPVOID lpParam) +{ + g_pD3D9Render->init(g_hWnd); + while (!g_bKillSwitch) + { + g_pD3D9Render->render(); + Sleep(0x10); + } + g_bKillRender = true; + return 0; +} + +DWORD __stdcall threadHack(LPVOID lpParam) +{ + g_pHack->m_hModule = g_pMemMan->getModuleAddress("GTA5.exe"); + while (!g_bKillSwitch) + { + BYTE btInit = g_pHack->initPointers(); + g_pHack->checkKeys(); + + if (!(btInit & INITPTR_INVALID_WORLD) && !(btInit & INITPTR_INVALID_PLAYER)) + { + if (g_pSettings->getFeature(g_iFeature[FEATURE_P_GOD])->m_bOn || g_pSettings->getFeature(g_iFeature[FEATURE_P_TRUEGOD])->m_bOn) + g_pHack->restoreHealth(); + if (g_pSettings->getFeature(g_iFeature[FEATURE_P_ANTINPC])->m_bOn) + g_pHack->killNpc(); + if (g_pSettings->getFeature(g_iFeature[FEATURE_P_NEVERWANTED])->m_bOn) + g_pHack->notWanted(); + if (g_pSettings->getFeature(g_iFeature[FEATURE_P_STAMINA])->m_bOn) + g_pHack->restoreStamina(); + + g_pHack->neverWanted(g_pSettings->getFeature(g_iFeature[FEATURE_P_NEVERWANTED])); + g_pHack->wanted(g_pSettings->getFeature(g_iFeature[FEATURE_P_WANTED])); + g_pHack->runSpeed(g_pSettings->getFeature(g_iFeature[FEATURE_P_RUNSPD])); + g_pHack->swimSpeed(g_pSettings->getFeature(g_iFeature[FEATURE_P_SWIMSPD])); + g_pHack->npcIgnore(g_pSettings->getFeature(g_iFeature[FEATURE_P_NPC_IGNORE])); + g_pHack->godMode(g_pSettings->getFeature(g_iFeature[FEATURE_P_TRUEGOD])); + g_pHack->noRagdoll(g_pSettings->getFeature(g_iFeature[FEATURE_P_NORAGDOLL])); + g_pHack->seatbelt(g_pSettings->getFeature(g_iFeature[FEATURE_V_SEATBELT])); + g_pHack->superPunch(g_pSettings->getFeature(g_iFeature[FEATURE_P_SUPER_PUNCH])); + if (g_pHack->m_player.loadPlayerData()) + { + g_pHack->undeadOffradar(g_pSettings->getFeature(g_iFeature[FEATURE_P_UNDEAD_OFFRADAR])); + g_pHack->waterProof(g_pSettings->getFeature(g_iFeature[FEATURE_P_WATER_PROOF])); + } + + g_pHack->frameFlags(g_pSettings->getFeature(g_iFeature[FEATURE_P_SUPERJUMP]), + g_pSettings->getFeature(g_iFeature[FEATURE_P_EXPLOSIVEMELEE]), + g_pSettings->getFeature(g_iFeature[FEATURE_W_FIREAMMO]), + g_pSettings->getFeature(g_iFeature[FEATURE_W_EXPLOSIVEAMMO])); + + + if (!(btInit & INITPTR_INVALID_VEHICLE)) + { + if (g_pSettings->getFeature(g_iFeature[FEATURE_V_GOD])->m_bOn) + g_pHack->restoreVehicleHealth(); + + g_pHack->vehicleGod(g_pSettings->getFeature(g_iFeature[FEATURE_V_TRUEGOD])); + g_pHack->vehicleGravity(g_pSettings->getFeature(g_iFeature[FEATURE_V_GRAVITY])); + g_pHack->vehicleBulletproofTires(g_pSettings->getFeature(g_iFeature[FEATURE_V_BULLETPROOFTIRES])); + g_pHack->boost(g_pSettings->getFeature(g_iFeature[FEATURE_V_BOOST])); + g_pHack->vehicleRocketRechargeSpeed(g_pSettings->getFeature(g_iFeature[FEATURE_V_RECHARGE_SPEED])); + + if (g_pHack->m_vehicle.loadHandling()) + { + g_pHack->vehicleAccel(g_pSettings->getFeature(g_iFeature[FEATURE_V_ACCELERATION])); + g_pHack->vehicleBrake(g_pSettings->getFeature(g_iFeature[FEATURE_V_BRAKEFORCE])); + g_pHack->vehicleTraction(g_pSettings->getFeature(g_iFeature[FEATURE_V_TRACTION])); + g_pHack->vehicleDeformation(g_pSettings->getFeature(g_iFeature[FEATURE_V_DEFORMATION])); + g_pHack->vehicleUpShift(g_pSettings->getFeature(g_iFeature[FEATURE_V_UPSHIFT])); + g_pHack->vehicleDownShift(g_pSettings->getFeature(g_iFeature[FEATURE_V_DOWNSHIFT])); + g_pHack->vehicleSuspensionForce(g_pSettings->getFeature(g_iFeature[FEATURE_V_SUSPENSION_FORCE])); + g_pHack->vehicleMass(g_pSettings->getFeature(g_iFeature[FEATURE_V_MASS])); + g_pHack->vehicleBuoyancy(g_pSettings->getFeature(g_iFeature[FEATURE_V_BUOYANCY])); + g_pHack->vehicleHandbrakeForce(g_pSettings->getFeature(g_iFeature[FEATURE_V_HANDBRAKEFORCE])); + g_pHack->vehicleSuspensionHeigh(g_pSettings->getFeature(g_iFeature[FEATURE_V_SUSPENSION_HEIGH])); + g_pHack->vehicleColisionDamageMult(g_pSettings->getFeature(g_iFeature[FEATURE_V_COLISION_DAMAGE_MP])); + g_pHack->vehicleWeaponDamageMult(g_pSettings->getFeature(g_iFeature[FEATURE_V_WEAPON_DAMAGE_MP])); + g_pHack->vehicleEngineDamageMult(g_pSettings->getFeature(g_iFeature[FEATURE_V_ENGINE_DAMAGE_MP])); + } + } + + if (!(btInit & INITPTR_INVALID_WEAPON) && g_pHack->m_weapon.loadWeapon()) + { + g_pHack->weaponBulletEdit(g_pSettings->getFeature(g_iFeature[FEATURE_W_BULLET_EDIT])); + g_pHack->noSpread(g_pSettings->getFeature(g_iFeature[FEATURE_W_SPREAD])); + g_pHack->noRecoil(g_pSettings->getFeature(g_iFeature[FEATURE_W_RECOIL])); + g_pHack->quickReload(g_pSettings->getFeature(g_iFeature[FEATURE_W_RELOAD])); + g_pHack->bulletDamage(g_pSettings->getFeature(g_iFeature[FEATURE_W_DAMAGE])); + g_pHack->weaponRange(g_pSettings->getFeature(g_iFeature[FEATURE_W_RANGE])); + g_pHack->weaponSpin(g_pSettings->getFeature(g_iFeature[FEATURE_W_SPINUP])); + g_pHack->weaponForceOnPed(g_pSettings->getFeature(g_iFeature[FEATURE_W_FORCE_ON_PED])); + g_pHack->weaponForceOnVehicle(g_pSettings->getFeature(g_iFeature[FEATURE_W_FORCE_ON_VEHICLE])); + g_pHack->weaponForceOnHeli(g_pSettings->getFeature(g_iFeature[FEATURE_W_FORCE_ON_HELI])); + g_pHack->bulletBatch(g_pSettings->getFeature(g_iFeature[FEATURE_W_BULLET_BATCH])); + g_pHack->muzzleVelocity(g_pSettings->getFeature(g_iFeature[FEATURE_W_MUZZLE_VELOCITY])); + g_pHack->infAmmo(g_pSettings->getFeature(g_iFeature[FEATURE_W_AMMO])); + g_pHack->noReload(g_pSettings->getFeature(g_iFeature[FEATURE_W_NORELOAD])); + } + + if (!(btInit & INITPTR_INVALID_TUNABLE)) + { + g_pHack->tunableRpMult(g_pSettings->getFeature(g_iFeature[FEATURE_T_RP_MP])); + g_pHack->tunableApMult(g_pSettings->getFeature(g_iFeature[FEATURE_T_AP_MP])); + g_pHack->tunableMissionPayout(g_pSettings->getFeature(g_iFeature[FEATURE_T_MISSION_PAYOUT])); + g_pHack->tunableOrbitalCannonCooldown(g_pSettings->getFeature(g_iFeature[FEATURE_T_ORBITAL_CANNON])); + g_pHack->tunableBunkerResearch(g_pSettings->getFeature(g_iFeature[FEATURE_T_BUNKER_RESEARCH])); + g_pHack->tunableAntiIdleKick(g_pSettings->getFeature(g_iFeature[FEATURE_T_ANTI_IDLE_KICK])); + } + + if (!(btInit & INITPTR_INVALID_GLOBAL)) + { + g_pHack->selfDropMoney(g_pSettings->getFeature(g_iFeature[FEATURE_P_MONERY_DROP])); + g_pHack->consumeStatQueue(); + } + + //g_pHack->renderPlayerList(g_iFeature[FEATURE_P_PLAYER_LIST], g_iFeaturePlayerList); + } + Sleep(1); + } + g_bKillHack = true; + return 0; +} + +//Kill the program; Prototype in stdafx.h +void killProgram() +{ + g_bKillSwitch = true; //enable thread killswitch + g_pSettings->m_iniParser.write(); //save options + + //make sure we shut down all threads before deleting the objects + while (!g_bKillAttach || !g_bKillRender || !g_bKillHack) + Sleep(1); + + //restore patched code + feat dummyFeat; + dummyFeat.m_bRestored = false; + g_pHack->noReload(&dummyFeat); + dummyFeat.m_bRestored = false; + g_pHack->infAmmo(&dummyFeat); + + delete g_pHack; + delete g_pD3D9Render; + delete g_pSettings; + delete g_pMemMan; + exit(0); +} + diff --git a/subVersion/mask.ico b/subVersion/mask.ico new file mode 100644 index 0000000000000000000000000000000000000000..0968335af7f4221526d4434b9a9034916a9349fa GIT binary patch literal 204862 zcmeFahj&|7o+jA4`#NcBLf2U0zd>VZ@bq_>1j<_?*XI?3YM=@Kg_^dLY#UsUG;(dtlCZPnvVz@I5chy)4yE^}t_l z54=J0*qp~3Fa5ON5t8->e%kw|?)Gc$fml2~7vI$tgyFHo>v;9f1d~X_UdJ4fz>6$i ze|I8=`^~<@T|ka>B2LHW08bO~Xd*_=&jOddaWC>T&Vl_p zz|&bVBa_=3_^y6Qo&O8(0VW<#0)p^e-v)H%E}JVXXmfPphzsr#`r zD|&M`p<^+eM>`UaaR|p4G@^v+Goa%M4#_jG8u&0V0(vgu>^<>E*^fGx|Ffcz0K+-V zyq$^DNwBv{ia?70-^GM~W9K=x%y8zr`42`%<8(M4jl}3^j3Hncn!!I%8Pp-nXUFaY z_y^|Wbd{vmn=#i@9+=!9Z$e@M`4erT|>S-8?BikvKgI zCi#sx5g;NxJD7vs+&y0toLM1?GUTg#%i#Z=qr$&2F8mt5PLeHX;K%>2E&wf}F*+QJ zgqdiRp#d7~rx~yuFJQ<{V05NI{sj1k6JTbTMJUdMVi@FcCJ|1=$;kv0BBI0qENL02 zHyk453^x(HHW#q>o{Z!JFrO5VS?x^Xb2HEae(R|JgXYv7OP=%nmw2wO@PNVoro~;FcS;Km_VEce2J(x z9`Pk2UNp!t>`nxyQvmxmoCrqfKsf4;MtyYH7mv7@z$EP* zqdi0P^k95yAU4s*jP)`jFPM?u`0(@C%N}O%84&63rH7t{2VT&_J>kKg=u13(66zzz zU|&yk;Bm0;InIX%Uqpuo>9K+6Xn$nnB|SbyPff(!M0^rNe7v!Mm-hQ(p+GDWjMJe6 zgCiyy%oGd@@IMA4n)~>idN!lGv0sRsAtFPjGFAlMRD|aCORD{Es0TRyvsyeM^*6s+ zQUY)#%_{0pJc99P5KK!D_~Jo#JUEr`Pb9o!3C~b$vY#G(&J6d&hn~a-?lZk#L?2xX ze04ke@M`GGrm3#;LrsUDoZ0rpXZEh`+ireV-M!o1zJ1?U$BsX%J^bkNW6#cicK_7w zyGOR&JWzdQ*OA9(cildG;&JWSzJ`Y3_O|Kk*Zg1J2|m0ZdG;*U-@^>_#fD$T#zte4 zQ*n8A|CQ5!l6VYl89nn;-r8W46Copl4xq~$XFfWkl z5dXe&R{UmfrOy0?^+1yU#Gd^Q{*$3T7W2hIF4{N6_$K0>@wj_5F+CU?ABd0j$48&V z2JbV^??xWq2!7q+xz*~vc44&j_>0;-4~}j9`k?*Ru8o})wlB7CykgI5T$kItHqWtE z-@ICLxv0RoA@g#HzG+QC>xO*C`aH+_oTfFn0PWnCwRz4BSq-aKwHtC8*5uT$DQ+oS z+h*C+RcXDkZP$atM_-(+9cpTwzWPP*-ZQ4ZFFyQ&emTgDj>e`Y6Q1dW&z10d6G5m+ z!FUAL0c&Es@-MyNZX&XP@t?yS5g;Q%ivNFMr2Z2=E<372>184`tXgREuRSpM6Y}F# zhMtOhhvU;jiK)K$=wrJ79{v1Q_))k2ZvANciQc-skB`^f-DA93Q`%-KYAwrktkXM6 zvs+hZI!g4dXq4*PO7-ofSsf*+wtR&%N8XmB>L^gO=PTO^sKzXQy++$rtm#@MZ_ULS zr88gAULfx%&|WE#wd7@XtyVdTw5`ROmSS~dp}MJ1)l{IooUgrDlz(}xxoh*Wr{}ud zH}6IsKBAxZh6e{3%m`BxaTh+bC+>&j1|R~g(VcV|aUR#?Q&{M)`2V_%kfQ%5R)+B}Z~4M}Dn<>eP$7^*pCW)R84>&lWl} zCAd|4uCy&z=FG)?L^#t%Bt_j)l-X3Gzg$}4D7W3(zW33wV~@^U9B8`cz5S4W+7}-j ziH}dlrd+f;5D$dlzhxs1A({@uc46C)ixB);aX60H@t<{N5u=!mkr9LWTeQNza1#8A zKR)X}BqD&3pIC)(z{8+r=ujl$4+p&=&s1n?A~HTgk30`QzwNr+KGJ@9u<6LXVy=@`(P%Id2{PeeECdCKOaZJR zkPPBsXkdeI2)4oYe+@C3o;mZ~PUBxO%YM0Eo!E0TE^gu+r|DpX2?QChmv&7=#-4be zJPAI%aeYr?f7AWY z{odH~{@BnEGcgjKa>smRE?}b2`XV$M5kxmww-yP4po=i%vr{9n`2oE6O{Dn$%VqiZ zd@{m*_yP&=)4GF`E_z}*G1eP=d}E^PZ14HX?wU3A8;a^n^BYRC8w+(!80Ygej$CC^ zj=DKd?Z{O*a+FTJye&)C0kuRY=>Rez0+O~YF$ZUsIEhxhq&ZL8k}q=<%AEyoK-yYJ zKtzK@TfVeCkAs+q1_UIBYS+*3ALPHHpsvWp-75S=0*F9+7XGx1od_@&$ep=L{FN4b z+B{7|fxdCoYR5)HhjquD-L=CPI$T#D(9e3~FJHz+$D)(|SRg{e)a(RE^grVIB!p-4 zf*5#tXCL1rKX-tufY@`#^2)jpF9#lz*~q! z2pyT?wj3F;4)WB_e66!k*PO3w$j@n6Ww=&(;OQxctLuL3X)iM{#!Pq_F9v@S$ek&_g@b{h-|O@E{k}*fjGr_VMV!dv ziFqbs)4h?QwxO%ruk9_pyguhrZk{7o=giSM^VDs5Drc^|4fbZXv@=WGl}UAL`Q1uh zmy+MD5_GGD-5L=Kke`6)BuY`I0!OM_DZQ!zWY@H^>st9$ovc$U>(EL&G}3mpghQKJ z>{J2LwoG|@mZCFT(UmRl!j&3Xms-}PlHn$uI(B%^<_39aJD3PW?Rp_OW|OC!Ezk+M z;J|*8PA!ZDVmP#CQkaa`*+B|pxm71~WNBLpi`q9>zu0nmuN+06o(Z5 ze}SSFrK29N`}UnL8)EgUG8a|90`s+i}v64-uvv%vHaRKxlN@yN0Fpa zC&Osz&`6v*=qga8rLDx%$njs=rImE6`B#+uYf9lYkUvv;RWHAiC+o^3=51T9*qJYG zE0A^+0g|=?NqYgFira9K*tUX}JYh?os3l+6Tp(&LV2_1VOA*ylEOD%+noC4YtElEx zV#jJpD~A$kYl+0MO43>^ZY`!-i$tx3g4RNQYXQJRqb-l$t``8TgNX1SN>R5`d_^JY zR*1TlqHYyImj)1aYQTSjHZ25-C}S;pS!0f-sW`8BebpDc&yO@;4}X1+>Fr633?!x| zNYpG6n9WcPM8lXG!qG59APGzd9AFiv`2S1fe>CC`_-@|1!58pWtX#e_ZG}>$=pX3w z_}snjfh!YtDx0_Eo?4Z2sZdp)rESaAUC9Uk3Hdu%PfmL-oHKB+6T(2-?^a8$C`DI5 zDyTg~{})3!2a#IyWR84UOQE=-M0k0f=<+(MVLgit;>Hb04piZ0oxOLlR+UD99_H*TVuHi(+n30q3}Evqt| z1?g@1>Fs&x?YSB4xxDrqemmTxnV15^U1|wbrf!9dSjP$o0ucvdDZpUSiQ06C7f`LR z%CkkSnK<&BbX2omf!INFX-S7^>!ZW$r)B)kCgM!nC_@@r?PaYJWJ}f+aM0Dne`1~I6h0UT1m4ZuF{$&HNX??n* zWTmrUWqaPr_WZQAg7o%$UPmq;fivj;kkD?0^om>p{&OPGt(0`ZO{9V4PPIYH(urHM z1TET(CN0&b7a|hZo+HK_*OISlE><^{tiN9K`FPt^`tgI<&>-WQi2A+JP#_v%*&a@E z9)t(xK27oe7bt7+O9Vqfh(K-KIk7~zWX0k%{)%+L3WKf8e9*r7j3NKxdcCt$>C92J zXRDprI%l@lnWb*mDcZF#NHMTWTH%w2E1tD9iS3!KxSFNBmaV)}C~YeiV@$qSmVU-4 zJXg&>wOLVjL{)cIb?&0-Oq1$lo8oAP{7Ad(NUQX4i{x;#_+SflpqcutMZCXRysw4Y z+aliEBEfNwLw@iUwf7otXE%S>Rq_5Wl!x!Bjy{kdx+mIuTXFPC&c!R*+GfG=V;QIS zr=8!*Yp4=9?JJr$E^l79yk+f5XQ`mGgx8Ui0p0$JM%b;Ou40nHQB7S{iLNS%v$R`D zY;$6Us1b1%wIKkFc@1tQJqKudGRSgkzOKEb?5mpn182G;Uw<9x>+z3_hrDC%>1mJ4 z=l61EFP9dFFc?B#NsxF!$_4rhlL7dDBGE8@xM|nq{sVh?qKtV9KcZv;9Yx%yr z($8*+K5J8*?aXfOlGL5gID07V+}^Yc+ZJCiEU915Z(m1UDG_$%B7;ImJVLpM8c5pn zC0*H)D;n`NnfSU?d<`0rmIM(X(at#%h5sHA#aTrnZGPl;{Ql+`7&xG9T^GP%TN zz%8|S5!Uaohr9rUhmf-{j&Mr+G#Bfw6N7HI|r(LYbXxhYctQNJc5<6EBgBl+dwlhSaJ4>{g9lrPIYi+hVU9fUV+TxD{^XKI+ zD>%PiUYn!sC{{Rg6|K1{WYM%`E84OYNGE7RrWr}mAr3}(8k^Qq7cJD;t+I0`Ml&{eMJ6xbFr8LDD&OqkR}8JN zJQHsp5^U>}ALVwm)ZGQbCXK8;Pw2=MwXPPz@cg_+dg_GgWD9RcJAdc(jIB3?+aL0( zo>A4qX~vNZgL~Q9NuD7gputcgpMS;*0B~O{=BNCDP{AGDoSjb(O?fDCx|Vc4tYi z!gEE^=UD#FM5|x%AL^eoKdWJt_DI2dnor*6&--x6$IE%kkDff@@=YbZ{hS~q$Nw-1 zhmrB0n+1M31o)MI68Pk}Ntp;jjP{2D1H=96%hoREEnASW=p)I3CKeQUnNnJZ}0$=gdrjis_y8+Cazb?%`4a)E+wJe5;>t23;e311&HxLIUtSDl&#erVwQcQl@~| z?3da?GJ9BJ3yWPnj zwQWqXx4*cyUw6_eI&e^VX0Nh#i>$UnT4$DAER!^@m9!MYej)KmX&3^BmQ8aXwlM)W!ZUIP=3NpaBjdCK7Y;&gd?f}V4Rtq0f->{%8B<2 z`TB(avm$^r6<^Tr5BYA~zOK`2m+@CD5G{I3`hk4EURzhJZ79(+tx`4@%i+d%6pC9{ zQ;p@q3swBH`%13dke%q19sE+T`4Mz`f!)QkxJ4CyzRgEfhK2T^q&mv8g@qMSzLgPJ zV|**kw?+B3FwYv{S)x2MlVOVU3<*K`3|KNVA}Bnjh}aw!n}d|yFR2VlDg)$L5fa%$ zR7IGoh)@-@*ve3*8Hmjg0Y+qw3C%Hq34hBksGJm5dW01Lp)DY;^eVTEXYc7NI{HMh zqgAo*lJf9b<;g?xv)d#WP2z@iB)-;CEJ7%a#OYxFvN;uO`W(^!+eo}m)s&xGU&5;q zf0#M%L%~N2R?g@1)9>8A<@dWnVgGmWAC6GWu$X5d1^DS92)_^l{K`MZT>j&yaeI;Z z5cGw7CqF;2WW~~D)XG2b-hHodVSfF_%!W0(#!_|DYI*Z2Ny{2>vrT$=AMeC*UENK= z{#(?Zr;=SG;>}ayDxc665m=*CMND9)#nmxU6;0JJY1UAhHJD}zXV_vHRwlz5OSi<* zOw39nv(gX)(#zveW&lB1LIB;y$Ouie$P^*4geY4;S`n63h9xZRh1QVJ5*At_LTglL zr3L0F2cd-~Fhc|wk%`7-m|}PqZ-&Lkw+8tpud*s6DH~QA26eVUP1O_SmfMP*ZOVhS ziqnT=wcErO5l}M-8`g_jidp|Byj$>pBEL?LG&v;T!3CPxxJq+S|8c>B_r)J96D?V~ z^wXmU4#0_k2pIf7-^YJsS+V?2YC)-4;D5RF&G4U{1u!U$PK-eX@&&z5d!H(m$_2|7 zy)T&ekJRsF2lP3YH)J-f(=@JCG_8>~mWwa#mYqMRum6&_>#lG|Kd*X}s__add{FEq zRdGpmTvWjb?Xh%oWNEp7@g~o5V{oY=4Dt9w*i?-rH4NkpV=?2s}@~0 zh?+~;IWC__0i3#6H9%6b3+0Z&?D~?0>zBQ+{_sQI2kC-k8%j%GzUUA8d5 z8AK_bpf3>ddxM@S&*Zk9+ZHZew1B_leaZay3KnM7u2o-NE303d*;XaLv{TpMP=9_) zxa%uw>yWT=N>T-`dfCA_MA>7MJt4Hjpz82oliDB!G{$^Fax2FFK!z=tVGX8ZMlgrc z&Czrdooy5Cy!7tKgOZVE;mcjWS_> z$P);Aon20eTDnBA{1a;N|4@9OKf6(Oew`G0^7)$FmP^`mw~;fQ?>+-LTjAQN&y6cNP#7i0Tsv^Vi8QYgfh(03=@-KjHer78D^SX zW{RX4LjO(i;6JVC{=XME-pTHf*l7wkB;=m~_|J+!ObCOQX!~Rqz%?BCB^3!k3^BCA zSrio*!Xh*DsF1`I6m4>=Edkkv$xl>YEzP~JG>&CfxYdH6ICeO-0n@RZ2&Rre&43q4fQ-jNi%Uze~+uAzE5xGx??`W8o07bV-IA zw0v|hhME9|`cN?FM`Y3EdeQUj#IeJsva*BwKYP*B6AlGQVLVjoX4Tayk2VVS+z@PkEUFn1TH(?UDXQZf|0!#b)j;APKjFWH zOaUA~?{rf%-5gHGux}wCQec4z%w!M~m|O;7$uLFI4WWOM-uri-H2 zlKg1A!GCyxz<(U!5rPOL`7gE+a~S*=7~w|>QAQtSa7)WwpJ?v?{i4hNu;Rj!q6eBv zm%=_Rv5m<#56gD+EwNu!9lOu}tX^>Zh_H5x;DUi)TPnOzAiJEcYbjKnEBYthC%=;{ ze0$}`3zpBn{l)c2z)uHRJ~QZ25SqpW>hijfRT7Ct244jSRx#W`41f1vnXTX$Nc%f7cY=*FV8-6B=gjT+*8*ypWPAfe9Eut zOEZm9wxGN+Caa8zZDElm09{>Vff7E$f59C7vplCE1!T-869JhEhzp2#f!LE!SKuJB z(0p_BE#32f5Pi8|)o8jQ0Na-MIoUCP?h%7O8UKk!#5zJ*{?8GCxCG*0hJ!Q;{tL}P z5&WoTUwY~AKdo^7f1h6bPfJdJka5^GJLgUnmjW5%TgNmJ#yz1w|9d`tKTd3n_ zL?@AkXO&$jRb9@?gM;)l{XfYT{9f?seBttRL7LAsO%}uif?N;JKVACCl9h`VFJE;2!Z~hr0N#?)e|{$Z&((ik4h;%r85z_H9+f7L z3U=<@HSlr(Q*$_g6-y-O#nm?;4!StXEaSHe5D|z6!T;@hYZmi9{Y0?%T}is4W^3`u zmW>ym>2^O*ZS56r9ue3kL>9lu6ozpsu}3iS^9&wdxsUK4gk%SQ0Ss01%=k}+cT0@G zigBKR4E`WL9HF*wh6Pc8Fvu^oGQi@st|jZ-FeRW(Wgr$X%ka4kPVJd{X2$p>vjD(| zZHxp$0kJZL1SaVJm<4<*RuBE%lIFjecm6laYyYUdA+viV79T_-ZQ~^7vc($)dA2cO zRiAj{Qv9#+`L#Wpv5l3+gKt>C->UK)#^ zXYi$M^dj)YF%w7dA1V+Bfh`U|!nYI@BHS|hX1s*{^Q(7B9ogk2ZTm^cn{y?=2_i{ zUkI#|(wY%o)z|X9H#A3^a?T%Co!XdJXIyH`{O^Kg@2pt7D1G_f-8(&#qanXL;F{aoMoK;*r>b6ttIe zzrf@tv@yE`W?~2k=a3)d#NeFdKbaA1aiN_^!7LCXVEFbZ-yRXzBO-WgSO-4Gc^r8r zqA&4CEP$vw91t2vYC+@-G@Rt@!1_NycvcI7N=6gdp^QNi5hI9*@h8gs%U6vr%o|u( z*e|h$#}AG{~} z=#S~|F4HVutXL{5R;;p>Y&*8&=*5$bSDT*CoIvdz!sTW;(2H>>v@ zSz<8!GsS;Pl=g>Z^OuTOP+B3CEy~cQFOn|)F#V%>f=@mce*6Ld!}o>ARZfViCaDTH_z!;zOim6IbZ_`= zSb+b;BZ{C{B`ri~n4JQ6taZ${(U<~6aB>niKA8fz@&6V7jjslOj{gXLCHW8k=POx* z?Jye!LxK=H{zoVz3y~=x#y29xC`K6);&IJqe(v&CdKOaxIWV2>bK zg4*m7Ays<|4E!;%rBAo(E7h(G{F)vAqL%(<$wz;;`2F85eeYw*!uP3pAHW?d|KtP3 zg7;(}zpZ%hE%`g|=ssMrk*D6JFFCuu==_?J%j*nn=GLK(;n>(z+>Ih~&`xKHOQI}F zivK?Y|C8zvJUgK<RVd;WXx z2tWKtiiF0G-dXYChbtE@$XNONk3W5Xv1~qnV@CG5EK{$}>Q-2M64SKA;+9kdWz{fO z-ODz;;_2`b{EN=9Ul389nQ;xqhbZDD~8ULz>~ z5rHMlH%EBpFwYdtFftj27|#$F8cD!Q2thCs8ngU|QbhEkSL7#J5DA3MSOG-yN17a_ zl_<-9+#x0?XN2W(h=8aJi1F431)CyLOB|V{5;Mslm0DslDEb zgGXKUQnl@tcw5~ECFOr76#Q12{*S_s-cru{o$UR8k-Ysc(m(!A{oY&p59S+|Evw?G zkLrsqk#(a*O=}CA)@0Wg>Ms-?dvN+`FT&D2Pw;(2dpe*8}6g10mu{a*RUca-nGFPrxc zfBsv`7r&P#{=<^Y-!C`G*4@ai7}sD;iZvj&24prrG~{%{u=YbTEnF!agvco`#1m!VNd4j+I@+ZVbOaw8hnLuWZ z$*Kd=8ke-vEyI^JM&;$S((F}N4XAc}rP|S)X59M8n&JhUH1Dro_J{m=AFW-w$e6Ln zn!ao+UvmjH!Adflin34{tf>IUtfr#u#*&=NrPWt-v)PAjaUlxCdGHr|K z{nhh+r~Tk<)#5)0_-|)qzbDwF*w|XI<)zL(t+E8~mq-ab5#we0} zc!n65Peg#^JRrS!4(H)7GSA4uj6}>8hu8TJ5kOKX<_CM<6NSoC1&UMo+S*n6 zrnOp9;JR4jDAYO%Py`Znw6v(T+q4SX6RdACJ14sP5`)umR~Va{p@uf500iC%|5Fn1 zbMYVPwqAxFi@9%2-L3A}kyW=Y(@~b`EYr5E)->c~wdJ6ao2oHS(_Eye*Q+k+b(c!i zCrZ<6ik7c63f3OeSUNH*9&79)N}E?^2}{jUi6ttwgwxC1LQ~*Br+5GD(zgGw$ninW z3*?(2KTTqJlk;=Mf$*Po??VJgXn^yD67sYBC&2>N^Eo305v&V<2xOEafHmU+dXxWf zvChr~KZO5q7P0)NXZX)99H2~bu_-o}{}L;Mv}&=1k(lFBV?t7%kQ$*H`DOM=>6RY( z-kXY}4f4kgkPUm@p|8t+Rw(u+c2k%1e1grpz|Cmr_R?R^FVfl}5N5+2){>URD z`E_h?8Q&MnYKV@+h)u9=f})C1(Y8m@gIA@WpAlZL3mZ!Ljk&zbS;D4#te}xN@=*{& zjzz?dJeiZM6_PnnWw#LPCUP&AZn?SpZs_Zw*oZIYMgA2k=(7BWCX^cge=Z3?lpVVw zJ_+>hzjdhS;u<})Q)h`915`_%tVt_vQ%X9ORGXS=L%AE2e#)gTu9cqItUi8HxA&HI z%aFQyTxOq^+2Giu!3xR_jZZ1tqY0S7-={jIbi1JVS*@h-dTAIOemdXfu-n z(ZgAAIdX6cAwfc5jstugO$j0bMurb91x7AB_7+SBFoZ);a*)gk!gI{$l=(l4|0ItH ziKG1Tn2-gxY7F$I3{fnxWceSHU>yzIO2o5-zlh|z2p}*4Sij~I)w~q!xXU|qf%o}# zUi~J4qgaIXGOdM_qX6rmkur_t^OPe`jD>P2=gtCBpuJqY!C`6~arQ?0+%b1F79r$k z7lr*?zkTYya4;trSKM=L^rqEOslQN=<0#5<6lAvMYg=6^2TyMRMBrL zl3uc_&zw^2Z&h#Wk=k8SD@J~hKLScfFisi?B*r+j1sIGNGa&+GaW0%E5DNAJ;`U_o z(B_W(XeY@()0j<=6JoGsML=MRv;1c#0wM)mIG7m4#Lk5>KjYh(F=qd4{v&)w42p7C z!8Ddzii~7su^2E#i3`X|X9`pv|;%`fNw#LHv|Fem#0LVd-%J%c*l?N z>#78es5?i#mK#C(t$O;0oa7No)Sk%1s%nPCdO~t2!Opv5NL;X+r ze|}CmMWAJv9y@*Se9?uq+Dkc^j@&FqURFz<&XKEb%~7C?Pdi(aA63qr1t?CasN1hQ z*)H4irJ`~|Y7R<~GhhkJ%u$({mYEotDb51cV&Xgbk5QV9K+WZUlKdnmlf&!$Cn5mN z1hh9o3OGR^B0wwxtYn$>>a)Jh@8drw6f?)y?O#^^A>%*zPpoN})#X@s&x!z9anJD| z;V_UtC@}}cBx@R}cOjwO&$oN{HY`;}9z~e4da0^0!S+Xj11&t%qq}4kG_4jn3Q#5v zg(C>CcG8(Eb>^|#c|Z|DiPRijJ8=!|eR$*n{bYn5^U;37e>_tB|JnEt-*Pw+dE|Xo z*}g0D;wlxkrD)abT61)cJgp-S^-N@_w@-GU&{NJFp`!>(pCq3jReW|$V(*n(0#YL_ zHNgQAk((n5Q&?__Dol*R6jPWIvN`-`rvOG~A)+CHBEj-MDFR96lLlGF!r(|DQGtz) zk?aU|{3k1RVgG{gLc=0zoX|SvMv;nPia{ZuJ_^=lXo+wqNHzv?gxt3`Br3 zC!ol&gFjhuk7WXw#mE=IOb0XH5`>#eYGNSc6x1*<-|i7W3anv)6#=yXawPbhU-I|f z<{hu)*KOxFZV+Nkv@?g)3qsW(RE7cP*?Ms}qEHNw*;TA-F08)2<96ulm-L8_@gwIp zHU9q`+{bbjlHN}o%yC~l)H!mqa*Q!~h~qgu03#zcV9 z%9rheqsIkXuTkb z!Wx$$_=~_3=uLEWcu|mq1CRzse(;|I)Fd$iPp~7n#Vnlvli0sx3J{tSLUV#F@4^Md zYlJiglG4WINPG|fIRjzlNYa63Dn)?&bNP>@WN=l@ESzUY{v`ip=CI5flv^S1_<{+N zL2VCR zz@D#<=Uyz;Hx=pI3e_#y;J*g^Z_QSA zM`8#{jUn(sZV4-_5kP4L&uN7X_HP2_0EKjdat6Rq$?~6;n!|9A!WNdWo)cINQX3<+ zBd-8{mDvCjW(rFjQP;VE)%M!&*}f?7Vgosn12(h5dGgpL+h&?q#)f}tu1 zL=|B{rB8sOUV9&ljs_3E=i2nopj%B_EJFpaP*@7Pc+OlsU5$9XZ&G*ny93#XGln{2WO-wl6eMs*!b6Owb@0Xphb{MVNp4GFZhL`- z<3B{8HCx@9DFgXY%-oS9Lm8-gtNh$S)uB%HwqB`eO1RM@H3b2gIRyU8tr0+Bivn^` z8mnJL423T4C6Mbn8NZ=sJ zSk`<_QkvsG@_Enz|3#1jOd>yo{}3N&`*Sd>YY{~VnG$?M2ueN-9Kj~fN4jVKoN?o$ z%wFDl4+&)3ku@<3mh&^rXOlNj#Rw&ggw<1`oxQ??S9xcSr`KEgj#6yT2b)(6=Z^yo z)Q5y^1t*&h4Ut2uX)i?K&{og2f%tGJ9!SKo1dM3^Devcx6#{5G2q&VLE%xg~oei4t zhC-9H|8a0=-;GoG7uV)Dug-4C%Wi|(lcjd#sM+zK@Sodk%aJc{E>m6Hr8s^;y5qK@ z`lZY=O_jUB{BPyIg7801MtDO^Y=}uvt`J%fT%aZd$bK^Z&vh9sDxLVf`sp7u&*m48 z@j%)i#($7p03~V`LU=ysw1s%pgjgOUG6X)(>iw@Pul&vY=6_guJ#FnY7Rw0X_Thl+ zXd6s`Sy4YsB zbw{DTdF`c%j_35CFXqE^4J8%YPm2FP4gXQhmXsR964dZyz%$IaT8D0}udm2&EX{9S zmDP$JyE0L|9APh2OD>Uu)@SgBYR{ii?!Q7+JeAtU#Ar_dE81YXr{=Yu>Gyg38`maB@{O=b!|Euus%8mXX&VRl+ zk%YkVdfO65p%oFFoQBW`+Nb}|BIhUi-hWKLzOr--h2}th5n+BrWQWfm)w*VZY&|w$ zN3uBVAz{s=VCQ50VJGkOG2Vq5s(B3@p%nZHWGg_exPxruG$R7-S@O1gO~dMQBdt&9 z0T)7Gqyz_%0oD!lV=3^fem~iudS?6&#~63OKNfU94GrzPbvnOxQ(kjvj-w!}9o5Tq zDrctBp;tEN01yFLQ=z1>Sk|xsgTMAkaP$w-dv7c6&C7W%H27In=SS&39RFvPf9CH+xBuO|roUa*{hJlnR&4P7nf#v} z{K+f;Summ2P#CM@rRGS+`sv?Mcm4-;=L78%{stGX+{?qd9&->re*x?B;aej!;8t;R zJ}cNJcApSs*!O-RIMN{a{1A1y96L0LoY;B~n_a5Ge@Fq@%M4P`t(UasYMa&^A8foI z?VpHwu=ox&Be0crivK@Wc%l3gkii5=Rnr0ASj2O4;-RT&M{eClee-Jg{I$+()a_Ta zW-40riY6igsusPxu~1sSMt;evK7UMo_=ub)kwv9mUpM zvWZ5AicA6R*aV791hQ_jS6XK4`UB4|d=>2*W!xdMi!k}UQvCms{D%TbBhQ&7KlDj& z7}@@==ALWD<{jC!8#MJrYV391s>i;Ka!01DSubzSWv75_c|)=E(ne+7HudRR)&4JJ z)i1?HuhEAAN{Ko|i|6zW^{QLou zLQi4=un`bWMd`MG-Ts9=3$H21_HQ0}#^Az|i3O|10peEuVfsH={|;4c4kU=}&H~FG zom#$q1uA0`__ zAmsr4k^Dyog8WJT`@`YUfV=6*Ra5h>Oce01E5sfy(D`L8nX;CwB>xr7;D3?)qEU7B zGu4r1<*u(3n}^wvKSX|dgMTjnlg=M*{8w6{s#y`>ulKH4J^owKZ4CZ@yQF17!Jym* z&ky*YAbAns{|^}dIsQZ8`6l^s2A+Q$xmQU*;fL`b8F~sEd{(bOy!tE@wvf{1SJ`}O zt4C>eDa~$OWk_2Y5tX_58{ObPimnrw5Csn5D@bO+m3a}t%t!3QkdPVTa!W)}Jt;%F z$lhzz$)lpWNwo)SeSHsUHbL46oOLsjyb2r>O9`}Y~*h`-9KV|>^ zNd992jU?g#8jyuRC^{Jm+!%ReckItPyHS3wSbnKM*_vFC~7?Nim=d#g;738TEED47LY0EvYd|EX3D)s(HeT(axI={v#a<8dDu z|B?TeqW_O%Kg)U09>7QfApA8E4nA~`9JH=^BwG=KoSf^*0Jq#%%30K&lrT5hC~4xu#1 zl<@W&!jvJv-{e`bW`ax{aH?aa00}K2mKs9(sKSZ}T3A^TmD|H8!h`$EECHo0sX)l(21_;%mTVa)uIwqP87Qb4)>n*WR!(Xv zr`@z^vS=?i)<-@9WtwSU!VTmI=X)u|F){hI8yH7ZA*sx>#ayCln5pl!;} zX)(x-+txRCY`FN$))*~17*tfbgyt#A?7@nUIq*p>vp_*+?94(or(l7)QkI~Q6n`Ut zZon4p4~tD`1f@u%v2qBis-ki%9Jcv2)nSR*tFQzV7Nk`~R2V`{FsKnD1Jw~kLn<;d zO9{w=dL)_}6Hqq5H>r_i8If6oke>*Gh$QMmC?IiIp%7iME|9hX)!uxX?S6^U`R=I;*WC3tymg(vLl-8hj|^?tIZ#mZBD3O!);_4Qj7c_* zh|4D>Mvv4GmKzv_kx@Xyu|kj$+GbPZtUd{fML^`sqM|Y)_}IKmY?}~oej(b|E;xRI zUt7s*F5$Ol3b3a(*;ZZ$@SHk9lO6@MkMvx86n*KM;eR{~$HknVFV*~!Jplg05b!bd zBolq^b6**FvZM8QdEJ(hbC%3grCD{Qxh?B*o7ZSB73Q~;Y8!L4jjPvm>@RI>$USx? z?_iI9_n5k7N?zfT!3Apb%)shFk-!}`yyl6YOn6k`g>jS=u)!Gesp7vQU?R%mvV_NC+6|cGw^Q0tgb43U4ddPNGOfcGY;%*8aWC({*3FoX>-| zN0_JX_<%n#2m}%X{&=51@q9A=U?BEoPuy`cxcBT!!=A^56%Vsa&$BJ#8tb&e;!>FX z3hskhq4HrZBvN5X97JgksqGP!m4*={C;nl-%<7WbCM8va;=Q+pN9%algSDxY*PhAm z)bMBdp8@{2U^n@7M_$xFVz3I*kMSS7VnR3nt} z#5idRDeYkeb}}-fj)Vu*I02bCAU6k>Wfvpamfh zTyCb75CLdzBq1uKfNEz8DC|B3h6^}CcRdyyZpk>mH@$IPdRsQHQ_Um%&jfg_nW7e~ z0$2zC|I_%8JMKflNfbgMWuue7T&nSB^#G^#&wVSr3XymWt4uv~WY9C&;~Kg-c)zvh z`oZoqd%I6;YddJI-(GgEs^qjK|Cp`d;2zuguA=Q7g;jU*?azwrgGILCLhDGOeRKx4 z(c+5n8B~rJR*vbb#> zmD!JV_cK6dCb1o`H7W}$gvbL`EyL_hvv>s7>Fh1z8~47rc*Xr>C_d_mO?v2QPt1#K z10NF%#6rP%Aeit66F%hM!~(vM8zrx?BZb!&9d*TT_t3jOhiULcUp1tym{MDP82@Dk z661h*qCjaBB&Kde1w|hUXCZM;ZjZ<-B62&*D#A^KlnFO~+YA1oZr=GLD;vvKI&(5Q zbiDQ~zB5~h^zs(H4CNpiH=G)5eik2Q`H!E7-4}T7FPCcn={*4cbN27tw{k*(u?6Lp z{Bg#Uh`JJ?$wXiz;qIp=o&;Xrn||Ka|8>LtFHUq^*>k>o>#-YK58vB%=-G}#eLIc} z?mRNM{m8&926r7B+Iwnr->LCk$A`Bb?yo-7SADR*>cBwd{sG(G0n4rd(~kb~t$mwn zUaZ;tymZU+)mvVy-rTo(^FYbwp^}>6l4_WrqxtrsJo{jN{=C8`M_~=TwgrY@Nv4JYKYIN?$dSTRmE^b-ZZ% zR8F-^ZO7E(PPd{4*KlUl{kj|em)?Xc6baI#6f=riGcgvZc}+sDtkoHdh2wC)V+2MR zHW-bDQ1r#S^@$!^rh7gPk`$tyf%U8%IuD8a`4x_}S_Hy(eDmJoaMSkr!JJzu0oHujasu z>Vq#fqm7d%UTi+z!{T|(aiF*QM1SS6KI`G<=7T-P{ZGsGJ~kcdE#Loa)4r#s1HFcQ z&y4$?ZQS*E)9%ORd!CdLp#5aS_WlACX0-NE*5~T#M-|7PJ{o3_TjP!RB5_|V9*iT? zJ`rS41||`t6X9qgg5pz=IPH%{u~^D>3ib0ffl?6028YMJZIkErw25IWF1SlXLc-?qZ#?VGDJ!R8&`} zZdjYsT&}7u&8u6Ve|p`{8%OU)dWV?t02z}a*f;|lVUQv~smD*$18;OCo`U=Yu{d_Q z4l&rIlg5S(1eo_}uRH2S=T%#=4i>5UJK#|KB^{lkgA;l%To@uvgKlfDGR{4((f7)(5TnRqyuxIYlT+Z((2GubO3Z@=TObxhgzJj}J<%-MXqXv-DHt;uO0Dr{nlk3bY_ zY#HbnNHf65ABn~zNI7H2fAZWPK@X5qD90I!20S6(bQmI#xc+Ez^U*Ii?znH*J+ywu zctOQ542t~fk;0mh!m6RXs==JiFLSqy=GKho)=Xqqj$~I3XIBqp*Ysy^ex9}c>y5Sd zit1|h=eK5kUZ($iW8UeFCFjg*YpvExHGA6+Ii7d-g-52M?kF8b)$|yWbyNKRiI|Vu zfbGdB0C!iMfjbl=0RJP{@C60`qf7|mFdD%QVZlhm9}f9~ zK`(ai3C#j+>|z!4V}opVrvU6<5+-ksQu9Ue<{PVb+^Vd-UESQW;oR=^ zXDX^1_MG{$zOC=0WiMX)m{)N5>r{lf5;D+jm83DCV&r((VR&DK0jV!#(nX@X?omEWRkpq z-8}Gx$$hcL7Qm+_G$+b7{uG{(4@~9;j0spV0TSY)2E*Y{h<3Tc_Z|&5Iv>mx1WTr-}iOiakXBXYU!GCbWgWkcX!|QUVq@b@z8heq3?E| z=c&v4aC)#WH1aYuHbJ|+2|u)bnBbm>$BW%EXpB8!@=K7P3e-m{_4pZkASn^t-vH~r z>+!=s#N0dJUCBT3tv_Y*)$hOm+T5tw}gdnHHyKjE)`*ZouH|84icENgzs|0l_hoBr_LoBIiV;JaqtlH&gl?61^i z-{^t4tozB^-}q}pllkV!T+k$UM@ z(gPgde%j;rbY1cfeakhVDhpx-zYgNuOorHJFPot`IX^24ukjz`Px1d-y7|{|DoL}s z4fxpMX~YquD;fwqg~MSSxxp4^&@(vVDe=a$4_tuIR3H%WA(feZ3r^!qFo>{i7$@-* z7jq9>!2P-J>EXGb=g)2@?~gm+({jQxdlJGx;_awIOaO^UJ$`*X@J(uQtWFXY4UWd4 zPzX#0bx8;|iew7HD7=a`&V%P5zt`&p)m<*v=;-M9__*8co|u^Mcszc;AMfHGxC0(| zBi{Z!{r$}k_Gg?)-k*Cf_|HAq^C|u(yXV*2m`f^d#0ELh0H48RZuAE8!EKNn$GIHl z&fwyysj1=N;ijghlP6DZ+qSK|ynOZQ)f+Z!Fq_R*t99qjoi}gZOilr~14sV*W2yQ&*<^>Gwot>Q}B_(`5fBEv|X=!N-7cQJPZ{C6h3qJky(~OJ^oLsqb<%$(6 zN=r-o`}^6keDObB?cHIrm+EQX5Q2l40%}-}oeRU;6*syA$s?w(4Bq@2^XM z5J>W1!Qv$=EJBzG^N_%01riAJ9Kv)BgaCm+0)%P7z1Q}YCE1!KOY$VkldO3jyIX4O z{i?TAt}EGXTejtvbk5Q$ovJ!@hHrm+pM8d^J}7Zb2nQg<*V)p2^IE`RDnJol^{Q8i z2tWA24>m%y{@(Y#_lH0H z;n2_!nFjoe&BMW4ehZ_`&NJo=e$D*9TI&RHSKQSvpz+Us z_Oow)``aGDYIm{P^>@DWoge+^M}Pd|AOHUMzdu22d*xLtf|&vE&IRJ*8v5b@xQi%vCM5Rr1vr98n0DYAwLX!D^D zeTemAD!IFu@Yc7!m7i>sr{UTdDxWvAfb`DjJ~yXWyoUVhSHB7-zvLw^!BRt4UXY6y zFJ9#HU$}6gySp2!aU0LEorfbC8dHaOQ2hJf|31ei)L)*(BFz8j9FHA4MscW^4n-HB z)5$=5{QSqXVyJC=zWt`r?RwUmhA_liC4wie5$t)KnuXZbeBjM!iN;umqA z)G%2yGZR(|t{A#f4F;SU$A4On_JY38_%}wxF!5B8Z{mc`;d$nnXFN#7j0isVv5%P- zl{k>OTYHQ3e4uzS!xvV@Z?9$Vlhxh;*c$U@IoCD?6`$I399p1*#`WvhFJHcV{`~o8 zpMCa6Kl%}S!d>Jy!e@tJ+;dq^>Oqi36SU>Ti4%GOk`=J1#)wzrNpEj&ZVV;P-eb}+ z+NGX-P{XnI0;4Y-`1RA0?|p1;l(TrnpSWM0$`8nYVYe`|9TbxlRYAh#L@`lQhR9YK*jLi5a|tX zcms36{u^Jr0w0e&79nP%T$lb z{&^}l<|2#(+EZt<0h;-xFMY|7@GWn73r~_siBS)8q4~|t&Cmc*l>5SR4&E8dM*3R) z=}&(eA4pc<2|MDF=@cS{4`kL#-i!6_kyq`!eCzf04a=ePv*qc@($v`6^w`?eXlZ<; zG=8%@HBp)OtB`9}SM6=jdg{lA3s&=OYQx+=r@Tf1bqJ}k1kJanFRy*=YfTfG(sxk< zP{MTNDS9xt`>czXdx^NycV2r6S{=my${&Gjmk0Fv<97`BR!|Oo3$5!wA zW11fb009|v>){v^u_l`mry3XnA8(r1KFa|3Tcz^G{9I}5=F-)nxuL~2rF?h#tX9$FE=e}>}Mzy37}MX2-O!`!-Uttmjcy1KlvJijqLwlX`pIybqx zFkM=lD=*ELmKI9Bui-t)s&5cPpIdWQqiC6k+|Ft{1_}*_m2pi^PtSM1``y>Q?scKv zslGGQgPn{09ZS7u7P?wzd)j8s_b-gxSeu)x zBI9G)lM?t71pX72KANz8_q*Q_>)n9$h=w3@h|e*|pS7;8{ikJ|;g5XeBYF*dFpj=* z9qV*M_Dh zMi!Un^aoL+od##?YT=(I3ydCDhm%92nR*zKIR3LFF(0C_#)FnTjH;;o(9lqLN~rR1 zt!tF02@wwDivR-GuA`#^AUxzSsyYI59adCJWe$+;x5D$8pDkU#GB?;W-gjnlpl$wa z%R*1{Vo%FT=c%QRQwtrF;Fy-T@hx*&U{aa@F9q)LD zY00>L$0FP!IOa>M1vR7ijxN@DN>1j-UJl#WNoWezmfZxeORTuvbivI>vI46+1AOPrtyyBBmTNhj`lW>_n)5VZN1sme08An=JiYS zm9?$CK|6|8$sK{jHHxfb5`e5poY{AD#e~3DzVa0VLu0_069becdn!TzxTBN$aGg00S;RcrZ4EUE7haAz-9DB zN#8Ze_+MJyoEj-z=$=OSt`p`uvh&1r zPt$x~^Wxc-#hz2MeXX;7rzg+#OqW*fZ2v(KQVtF~k}}-Db@uF8Lm|tcHvTd7>^$ka zm4|rbAcJ}Dy650%HI=9SaNzO&&;R_75#?`x`&(NDR{1^~mF#bQ!;gQ>&6?_2zH({q z!r7_*j)|V;iSFj9&QnwErzYB(N4q;lhb~S}P5IhiHV1U?8azY_l_xUZNC@sBa%!AM zYtBFazZQHcYj$Gg`tZz!zOl1yH@ccRJY(I>lYOl-{hZG;GrgzB`#Z+3U0U)Tp$PYE z2|-f<{AV=m^d@dX7eX&^K#=A>bGv78jhsLmb7ha_JB187g;5o8-B$%`pLI37BhumuGUK$er zvrm=+-Iu0U%JZ{J<72ZUH>R%)jbA)>(|6d1FHT$?o*W&Sot;_E=B8_5cb-{hK3rVu z--F(c3_i|dendk2;^Z#GsYfEW$YFQR2mOj>hVDlsS{+J(^G?Ng+kwFO_7U)fzal2L z)7&LiOq}Ao5h%h&5cp|-&iwqs^wiAc#FXRQ-2C!#_G*umyC07$9yEbt_X4*zUTWhp zBEO4*NJw8_AR@64S15wGOrjch%m2V#*BtG_?Ogq9O24J`!T*3oJO^P9%`A%VZt*>2 zdz2r^Wk)m-h|s&TIS>ZCRXT`+Ko)!O}{NyL*`Au;k0IK6W%TMm&dB5Pae*U{lZ15|ZqnUP# zeeZkUV-VnAD%b+I@a|f$2x4C)aO{oLX@&*ZL!)-ct9U9;A-}SR%#YwBIb4C>eFDg; zdmGdW7v|e8h5Ul~ZTkjA>;p92?KNjBDfYiv`7!}+mxz@b(Lq>MXAG@~+3AP>`UR!bDdGU#(w1=ZEStXV zZEvd?gY3l+fY?PN5`ft6=L)5uAa+UZt${hoBO;TCgvj#vJtere(huKLTOR-Rqy*gZ zD|H$RXB@tC>5`@Vr=NbBosXSAI8VMLE)shosDsnEC_+JW9O3^kn01OcD7V1Hw~s;1 zsZ*!8J-Rw7EcNIeCp zVE+Bv4ICDjK4U$OJ%O@mKKAmpuYJwdR(6lLxd9xcFn|<6Pk|mt;=v%yK?fOb+Cq_O z0q6{QYy$B%aIDPuGUeYT+ti&&W`Aci!Y{hSW^BcQlHGgky4@&1pg$i+6jJuLw zkGp#-?ua}Es~Dv^ir-JGbIf)9@p$Cm1rWO+yxnH4-!}y80%7g0ix%(M4d)&WWuutbIL2Ij*w+_Rt) z&^{tykAfWC72=jiR3?rG2*ZP3)c`!lUvpfEW0J)~3Ky!;n>dE$af~j&G2jjDhmQ*Y? zayU&v#Gr#N2)k9_A3g_%==)J9f-|3M**V)bdpoGt3cO z_chM!{o?Iyw`hPH!Xv3n<75);((8rS7b@>G79#bMVKE#Vr_QM+dq4nn$<$05SI4Ik zaNbIaqXji9jN8P|{##tL+Txb&h*TyY9mwJE`TrV)+sp#@&%C1fc8jnUT)cJYB6Xk( zbVP(M9KPo7fk+4Rk>EcOzwdqTv!saU7%mbk>_z^EQn*Dg{_DT~i^|{tk{n6`XcvQ^ znbz68Y;JD}K_dVxdP4<0hH z?rx60+qP1lisJAic91`4zr+8Du0aA3DL?$-58Hzg0|6><2z&qp7Lb`<+ggC?fj~4_ zJo-d-fQv{YY{l^jGW}pI#CsM9hX9A&Bsttyd|E#z{BE-!x9)iK4aRVW4+sCX0{QXT zXJaY2CWkf1`A-G%pgZvE8#dwVDa;SoR3|$eZmJx<))Bg0bHq)cj^rCu57FO|_HohX zLp$+e7#ODSpo0^hj2U1r9ztUW|D)Bxe|Pl-0&`*KA^v+7lEOg;;i%Q0#nX?IqqmJv znoM)fhuzChcSIXLG5R|M{XRDalf61*dwJlH+y5dIRDcTvE)kB9^${EOxlE8e z1RxwW{xjXan97?aN?K49^bW%BIF&elWAxDQpAAQ2iz&tsM8K6C zis&68feA4KDBDHC6--^g!BPR%+gnBEGxHulgkBVP$X%!JR*>HZw+;QQ4N)I+fQQ5H zrNx5JNNO(+KSGX15s+Yh99ax=p`4!x2TS^?wh*{@@uJE9*ziD_xs@wQJSag0s0quj zr|``I5=WR=0yqRn(qh)zm-9I`Iy*k0keh`f8b$uYBNl`7_3n!J&VcSd@9__Z&_kE`{~8Df_MaBqlm8N!0y1zA4hIfL zhx}T~=n z9eoe}JJoQ=uoA8av;!<6esaZI*h~Q!4+jp1K$Q32gb=#!+hmT-Ektae8>+|rMz}+y z%-xZ&IL+lG*_yQ5r0;VrMD-@>BMW5dC6`ISJFH0H5KNtGp;J@Z* z8Z+(#gI<4N-kAb+Ufb~>8k9mjer?Tla=Y0^{T3 z-haXK_{0!J2)D;ih}r|}Tf{ngDe*+&L&kqlAh0P=ZS)nLx4-@E{5>5X1hCyP%tF`) zxBS$a#bWy(JeWhVKT=DjJSqf8Jm)hzW&xBz^M(s8FcS1@GJp8PAH4R(?7Jl}kI`8i zKK=)XwJus}cZZ+PAZa_Seq_yxT%T+;kV zmN@@dC6Y341O$*=2(6EJBh)I@AtA6o2t;4N;0xkZV1LR@r6dFz0fEf_D}==VMi5G> z!@eO9+(&znWdHXK_Eb#rJcj^6hk8gD6Kh6>tAIY&nn%RKWr~_}E+V1VCIvF1ETRu(f z7hC*3ksmOsgYBMg9dUT;G`|j{kNl}R86M?ZL~#E6`A>Y}6Mm@9k6HU&D(X;2E_=9j zl;N%4_BvqJd2nw})yeQE-vXxJXY`Alewx-#_lo;W{i9WZqYQ8Tw(pI}dwZ&WO^)nc zKL5AA^)2N0tF?ZY`S|hUiU0dXhP^R)Z%^%8qZ+@UB7od}zs2lFY5h{IAM3n+{kkD= zt^(RpOuV;v;{)=fYFG!)I#t@+Q*|;tYPX62E-fuR_0&_0zwp5ie$XlBr>FwO#CwY$ zHF)p8y>;-clgZwms*~YSyHy0x50U#_W}c7Whs*tfv%Bm+6%gn`gm|P5P{llV#OpkD z#Bc2Ys(4xlnPRdX@j6eXTR8$n&`kJne*Wyw{>_e_7#6YK!0cv`1v#bi6;b)HJMas+bF@OW%&?3J&4rSb18Uh#@I zz3ENM%gZiG=@?x=k^dX(S-((m&_QH zrjzob?6vy?8U;HBeJ3UwsJ=xmg+r-4go8SCqE|Br>Ti^Ot!+|3I#f9A3l#stvDz8^c z<;v1hWqy8re!jZ6bZcoP`&(S8F0EA;R?ExfN~u~cZEUPc$&cE|j8*-XN}v?og_US= za^#8K^QroIKEblxsRA4(i2>(MU!^6X`d)@2UuD879EkF3d4+v{J zuk`=k2!LyHa`K(;e5WqJ`1if}68zAIJ_Ndkgrq?$1;)|Q zQ6t|N0=(~i@0*&Mf?*II!a;tgS-5qJCsQ^ou5K(Ymv4?NT^yVn=$aYqo*(R)ALyGM z?4Le2IC=5X@>_lQ^{;>Z^wUqbx3}vH?wq>euRa+6 zw^Q$E*7oH){|_tS$ocuJzxpfo-weigzVjV+V@E#evjZeG1Mx3IXrR@pQz z;0Sq2hN=m}*w(9nazr_t2H7!Xk#2jvQXVD{_!RAzZ&_s?p8N8dG478P=wl;IG(=a z5e_;3?Oln!o6-2UfBQEo`2D*uFr5+cGc=Sgjb_ z;{V3N;>NY%wR7F8eXXUwmWsc#t(Csht9@;Yy`586E-%i{Z>*Ho7uQyoO2!J=kXBi7 zETZI!vPg|-{m=jWPk!uQ{Ka4B&HwdZ|J9Y<>5I?qXPkPn4BRt)C9JsI&pr1XpoFXg zsLOxcM)mkJU0nFv+^B4BtZ)BSq{+y?r5751_Yg(1|1=Tv$qs1$@gM(@{GSJ91@pz& zvi~|zp{c3Kl{@qQ)~(XUx+xuF+qwCTE0C;kKuS;*<3Hb@UOI4SSZOIaTUzTJ3IK=xLw0a(Q8KvC2)#oTco4B}y!o8x?Rx1xSilGNX1p>vx;B1ud1_*1Znm_tWM#!DOVjTfl%-InUg`h*&;N}4 zuX)XDXeIy0t$jx3pce<_XPf*|{E4|oHCO+Zw{Q9 z8aO?7?#$9)`%>?jxvsX^j*h9ej+?!GBcme=<(2i!&=jVfBdh!vpapLK@-P2Fc6v-z zI(F=si;aWWfv5@DojiFmI#9=_pMIL4aj$4ew&Yvme~C9!-kh5b{x9@4ui$_0sZvkV zTJV3McXDd7jJ&3{dAl3_-#sYBs%1w<$7^5vTBeop$Ny)Zc?Pf4p`ife|3Jog6Vp&m zJ-_1tU#(>j0p z%uH+BSXb}p$jIWF9VqwWKiqUW25TSqzz3r5HZWnwRG^_iYy8SUtfi&pFaPo{_36aQ zpY#?m?iJ~m^ViUftIkeUuAE;QFxsv0zpo{8ero)m7&^BwKWim7TlS(c*%Hs) z13B7pVd9PuLyn*S{O7sZdUnBcjRPQ{)V9CB|BY{aqb>mdt(%wy0u-z3ZnRP)k7rjb zZ`Fcv?&?zYQvXE^2)N#Vr%8a zqmg0pi1|)chL>o|7O$1ytOBbH-?ecNI}kO2u-#K+3PYC7P7<>m*`TgA3Wz3z1T$G| zaA~TmYa8=3>o1D8?7r>XOsgDlWUMp1sILq-dgM?M zm5V(y1E*)%e~7g;t+hVC+H`8Qsb%p*%k=5a$t%}a?I*!v8Oo`c;daK^f7cay;=~F4 zCg%rqYGo_qfuLMNRT7ds5Y_|v&FpbP$P@#?%g*fLf3}!au57F(tah*Yx;}mDT0yI=_bm@6Laj3;LQ5fB3`UeG%ekKl@qkgzHKt<;DRD zN}A(nVDiHs{!oR@H&WZLeeG+;=~Pvn-4$|{#_1OSX+brc0$N+#oVZ%K)U(jnJloZ@ z*m`og>BRE$&##ZNvA;(;-*#vgBQEhW>s&e7%T<@9b?$+t{rt!|E@qv!% z>qAS+3)$T)edhU?_}*#!ki z{oUXFoi2dGW;i@JIH);Pz)^Lxb{E37{m<|)5n5i^oSUd#KfiLmW3IbpwzX-#>BQ`b zlMBzcEIxmFuA_JM+Q{1Ca%TUlTQf=7bMnjn6@to;&c{Fg@mRRmd!9LS#-K@(MuF^r z)C0CmuIWdXADE^!{^1|~!KNT!>e)k*0X+GNZ1I16b8&us=-g~i`&dugSjXub{axe8 zzc|M+-6B8!ix~#gmiTXTBG^KF!^6WL`N&5Us^8&GeBldU&=W}qxi~fygaHDct0Z&5 z{^LK;EZfm#jmmBB?WS&zU$QIJ%zG@a-CCO6m>#KIJHIs8J=b|=x}|CIRP$`}>G{(% z;_Tdwn``#Hu4ijuQDAn=o-PCh2>|4^f=*yM_>Dx?P>3Cr%HaRCYuDH`W+b<10dkH! z`3i)vek)S}<2^3Wjcbb+&P|;gm>4)aa{bEO^1=oaSChH1uZg(YihgZPGb6xuKp|FC z{=fLeFBE6aU#G*6k|3FeoTY6*^wcVd_p_hgl^es$gMHJTXU5ywr`kK_I=W}h4$jy^TUwE>K=)nz2cTfZ&;VQo zUi{)0lbu1FI%FlL@E{044C^?PU-`;cun`qGB(1Hjq!~_lNFrnZdd(zdtMu#mU#@H} zEmr4d*QX{+6XQ!u3zoSo-)Dlhk+}~4Wk`HDV+o1bMF$~7 z?4BGLn3@<{sjLE6%G*Icw@+&50r2;~|GmL4zmWkkhVmX$;{P5<09&}hlLN_~7=+RS zJF`)`loKA<+ zb>+&HNRU0U9rn7k30H?Gai&v~uRM)P7GJL3vsudLKVF95XjKQ?adD6v?2ir)=^ z7>epZd9yLI!LaCFfsCu3f~v?)F}%ru8TqPo0TUYuWBS}3h8Z>*QH z{X&^BxqDEGMH7Qx3W)yzq>NECGnJQ^BKL^^{z+}d#}On{>@D_#-b!Y$hrT4OuH*EpY@#+ADKCoCB1cL<9LaKpSV{7y;S-+AOfYJ4jB z$0(cN_zyq*=}%23Dmv=0Bfo}44A~&Vi!+2rLgs?q;Dl(4hU{oXobG5~G%YUX$E^o5 z{@*#1NT8STwFlia41sCezqeKcMo>2_Xa}NV_QH`S70|PL9fr9!3Lx(2Tkj~@J6_Bs zC?W^m>A7>~ke}4TW}=NHOA{#v0+t<>)Lp7MtIG}>!sy5#_U?DT+gcc`0HW3LNDfZ@ z(>&Q7BUsJ0)3^xn&aV>LD4WK6dU_ZT2^@FSGo3yt0!*~M5UdK@f~ak6ZDftW;H3h0 zlun(Cx#cG^%W6bssh8&?XD@4T807q*HEe|R)EW6z9$Y4WSPWwsU4V75cr`feaBc(w zA~nykidN*O^&??Jh=44p0D~W6G~Kk-2W7?JH}U`BxdB7#u%yYhfY*CiI#vPfZq*l4 z@h+jnBmCrNo_Qt~mpMFgMt+}#86RxeeBpVW)t&KNScSO@soHSA}(Z`1gPR z_y1S>fEdsiWKLr^Dn1x&)k(urQcdoivcE!=2Fo@|E-WB~4_eSW2Yud=vR zup*jpBdLG@OzUn6%F`YmB0iy(5Ekm5K7ATp@m3ED=imMAcW`F$+yynE!<rqb7L+aW+GQ7hl=LC8!yz~gXCJ&q7ft3j za?X8KhMNZ>Mk8Dok(~Jv3H0uH^dJ@B`I~N~U-&QoZ+`QevSn}-aa7s*=-W*eP!*_v zB{0-w{~hfxF@Xu{5S)U=$(?AT5(Fd|)ta3!gM|6^Wnsb}{m~y89vT8iww@9^63ma| zqi@DO=BNpbaA>{h0>&R)d?68YT(K=v+x3_`$nVs%_Y;7u2yeTD<#*Jp8kYe)vW@1- zY9HHuIEx|_Q1kYQ?D^-P*P)Z9j==GApZgq#RsysS*+ramAkVR}6CTw~^|1M*&v(*U z>!x{AB&BPR5>E~p|M4LFd<|rx?F$80ywL*$yL7llSjtcbZa~Y!{g7W8&oVxGVOE7n zpp%<}`Q-ofPyfUSu+oT17dS$esL&Nwl1Uuu06l0BSzr?Q&isgknn=vN_$U)dX;X}+VrwGu=g&4cCI`2ABxU5ws{uapI}$7WeQLwZ^Rv%B z8#ARL9i2W+F=~*&w12)Si=+-N0uNeqyyXZ{0T$a2i?ILU4T8@051-5eDOTsbfJhWk zizG3zd=?a|AWe9Z|O-&|7&K$ULZ3MgviKK2m3bhoVP_lewG5gIiE~DMF?ADEGAC4w7}@h z=s-%MClux@jMx#hRD2uFhXeGi0EX!R5qAh&42VIoPxt5}c!tslPzwG7EpWSV;Q|LT z93DsHhdkYpt;8r4=@b9=O`ACUoO}{w_Ax&!KeHx6px$BOsfIX`P;#O0VN42H_(OZR z;c!@TeF4Mn^Ffy{U&eo|<~8XN443qtEQu8pll)7MY&}lnV$H0(S^> zMn-6i%qSgNpc~bJ>Il3L`qWcTvG7(84X-GO6)xIgz-8T>kueYka)dnd6xmM%$dQrP zJM(iQLaZV}?!MNfoknE0#gYROKtYVdW4|a1kKq)7U!*go4ual+pO5o`1dRW;zx{2q zJ)ZR-^6P>HdEPD{#r6>a$cLSGBo0UJsAEVZmrEYm$Er1GQ2_<^LP-eFc>4xZUbXYf zJG>y)KE_iBuP+Gq690W@R1eFx;J=rsR!|09Io@o(skWIIlZ! z6sk(>>*y9!dx#1QG%XfrLOpAR&+tNC+eZ z5&{W. +*/ + +#include "stdafx.h" + +memManager::memManager() {} + +memManager::memManager(LPCSTR name) +{ + m_szWindowName = name; +} + +memManager::~memManager() +{ + CloseHandle(m_hProc); +} + +bool memManager::attach() +{ + if(m_hProc != nullptr) + return 1; + + if(!this->findWindow()) + return 0; + + DWORD dwProcId; + GetWindowThreadProcessId(m_hWndTarget, &dwProcId); + if(!dwProcId) + return 0; + + m_hProc = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_QUERY_INFORMATION, 0, dwProcId); + if(m_hProc == nullptr) + return 0; + initPtr(); + + return 1; +} + +HMODULE memManager::getModuleAddress(char* moduleName) +{ + HMODULE hModBuf[0xff]; + DWORD bN; + UINT i; + + if(EnumProcessModulesEx(m_hProc, hModBuf, sizeof(hModBuf), &bN, LIST_MODULES_64BIT)) + { + for(i = 0; i < (bN / sizeof(HMODULE)); i++) + { + TCHAR szPath[MAX_PATH]; + if(GetModuleFileNameEx(m_hProc, hModBuf[i], szPath, sizeof(szPath) / sizeof(TCHAR))) + { + std::string szName = szPath; + if(szName.find(moduleName) != std::string::npos) + return hModBuf[i]; + } + } + } + return 0; +} + +bool memManager::findWindow() +{ + m_hWndTarget = FindWindow(nullptr, m_szWindowName); + if(!m_hWndTarget) + return 0; + return 1; +} + +HWND memManager::getWindow() +{ + return m_hWndTarget; +} + +void memManager::setWindowName(LPCSTR str) +{ + m_szWindowName = str; +} + +void memManager::initPtr() +{ + HMODULE hModule = memManager::getModuleAddress("steam_api64.dll"); + if (hModule != 0) + { + //Steam + ADDRESS_WORLD = 0x24CD000; + ADDRESS_BLIP = 0x1F524F0; + ADDRESS_AMMO = 0x101BFBD; + ADDRESS_MAGAZINE = 0x101BF78; + ADDRESS_TUNABLE = 0x2D765E8; + //ADDRESS_WEAPON = 0x02810670; + ADDRESS_GLOBAL = 0x2D765E0; + ADDRESS_PLAYER_LIST = 0x1D98AE8; + ADDRESS_REPLAY_INTERFACE = 0x1EC7E40; + } + else + { + //Epic + ADDRESS_WORLD = 0x24C8858; + ADDRESS_BLIP = 0x1F4F940; + ADDRESS_AMMO = 0x101B6D9; + ADDRESS_MAGAZINE = 0x101B694; + ADDRESS_TUNABLE = 0x2D70DA8; + //ADDRESS_WEAPON = 0x0280E650; + ADDRESS_GLOBAL = 0x2D70DA0; + ADDRESS_PLAYER_LIST = 0x1D949A0; + ADDRESS_REPLAY_INTERFACE = 0x1EC3828; + } +} diff --git a/subVersion/memManager.h b/subVersion/memManager.h new file mode 100644 index 0000000..e34f80c --- /dev/null +++ b/subVersion/memManager.h @@ -0,0 +1,67 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#pragma once +#ifndef MEMMANAGER_H +#define MEMMANAGER_H +class memManager +{ + public: + memManager(); + memManager(LPCSTR name); + ~memManager(); + bool attach(); + HMODULE getModuleAddress(char* moduleName); + bool findWindow(); + HWND getWindow(); + void setWindowName(LPCSTR str); + void initPtr(); + + template + void readMem(DWORD_PTR address, rT* output, DWORD size = NULL, DWORD prot = NULL) + { + size = (size == NULL) ? sizeof(rT) : size; + ReadProcessMemory(m_hProc, (LPVOID) address, output, size, NULL); + return; + } + + template + void writeMem(DWORD_PTR address, wT* value , DWORD size = NULL, DWORD prot = NULL) + { + size = (size == NULL) ? sizeof(wT) : size; + WriteProcessMemory(m_hProc, (LPVOID) address, value, size, NULL); + return; + } + + template + void writeMem(DWORD_PTR address, wT value, DWORD size = NULL, DWORD prot = NULL) + { + size = (size == NULL) ? sizeof(wT) : size; + WriteProcessMemory(m_hProc, (LPVOID)address, &value, size, NULL); + return; + } + protected: + LPCSTR m_szWindowName; + HWND m_hWndTarget; + HANDLE m_hProc = nullptr; +}; + +extern memManager* g_pMemMan; + +#endif \ No newline at end of file diff --git a/subVersion/resource.h b/subVersion/resource.h new file mode 100644 index 0000000000000000000000000000000000000000..ffccd74e2537112cbbb288d0e7b912f2bfb0c312 GIT binary patch literal 868 zcmb7>QA+|*5QPsxFG0{h=z=eSkXpU;xa~?vx{9k&Pm9_Lh9tPH1rfaj{fPc&kJWeY zCRvmy!|a{8JNL|-Gav6ImGppxYARNss#_*m+6b!j1Ab#%t5)R2_L#UFi@%);^d6@~7rrHm|g2 zfxiiTM!MlN%oN};?lX0$3U}*RMP(g0KJzXHltlNAN#3gmm$A!dj#I|}lrBRUPdV)* zcbpUTbxk~=HeJvtpL;}oj%Q%nLdlN0ZhEVBjjrb~I78#Wy)D3T2=@PP+SGbfTi$hD zf)ep<=!Ba(@n3qyU%g}ARCU1&u`Eu+n=X-095aarLYMfrmR7II%E)#n4a}okuoTzm q2xM#Pp@%SNJHE@NHlXI{t7?)fX?L+4*XpyVN#ZtUH. +*/ + +#include "stdafx.h" + +/* + //SETTINGS CLASS +*/ + +settings::settings() +{ + m_iniParser.m_szFile = "settings.ini"; + m_iniParser.read(); + + //keys + m_iKeys[keyExit] = strToVk(m_iniParser.getValue("Exit", "Keys")); + m_iKeys[keyMenu] = strToVk(m_iniParser.getValue("Menu", "Keys")); + m_iKeys[keyMenuUp] = strToVk(m_iniParser.getValue("MenuUp", "Keys")); + m_iKeys[keyMenuDown] = strToVk(m_iniParser.getValue("MenuDown", "Keys")); + m_iKeys[keyMenuLeft] = strToVk(m_iniParser.getValue("MenuLeft", "Keys")); + m_iKeys[keyMenuRight] = strToVk(m_iniParser.getValue("MenuRight", "Keys")); + m_iKeys[keyMenuSelect] = strToVk(m_iniParser.getValue("MenuSelect", "Keys")); + m_iKeys[keyMenuBack] = strToVk(m_iniParser.getValue("MenuBack", "Keys")); + m_iKeys[keyMenuTabNext] = strToVk(m_iniParser.getValue("MenuTabNext", "Keys")); + m_iKeys[keyMenuTabPrev] = strToVk(m_iniParser.getValue("MenuTabPrev", "Keys")); + m_iKeys[keyMenuSave] = strToVk(m_iniParser.getValue("MenuSave", "Keys")); + m_iKeys[keyHotTeleport] = strToVk(m_iniParser.getValue("HotTeleport", "Keys")); + m_iKeys[keyHotWanted] = strToVk(m_iniParser.getValue("HotWanted", "Keys")); + m_iKeys[keyHotHealth] = strToVk(m_iniParser.getValue("HotHealth", "Keys")); + m_iKeys[keyHotAmmo] = strToVk(m_iniParser.getValue("HotAmmo", "Keys")); +} +settings::~settings() +{ + for(int i = 0; i < MAX_MENU_FEATURES; i++) + { + if(m_pFeature[i]) + delete m_pFeature[i]; + } + + for(int i = 0; i < MAX_MENU_TABS; i++) + { + if(m_pFeatureCat[i]) + delete m_pFeatureCat[i]; + } +} + +void settings::toggleMenu() +{ + m_bMenuActive = !m_bMenuActive; + return; +} + +bool settings::isMenuActive() +{ + return m_bMenuActive; +} + +void settings::menuDown() +{ + if(m_iActiveFeature + 1 < m_nFeatureCur) + { + m_iActiveFeature++; + if (m_iActiveFeature == m_iFeatureCurDisplayOffset + MAX_MENU_FEATURES_DISPLAYED - MENU_FEATURE_SCROLL_PADDING) + { + int displayOffset = m_iActiveFeature - (MAX_MENU_FEATURES_DISPLAYED - 1 - MENU_FEATURE_SCROLL_PADDING); + displayOffset = (displayOffset > m_nFeatureCur - MAX_MENU_FEATURES_DISPLAYED) ? m_nFeatureCur - MAX_MENU_FEATURES_DISPLAYED : displayOffset; + displayOffset = (displayOffset < 0) ? 0 : displayOffset; + m_iFeatureCurDisplayOffset = displayOffset; + } + } + else + { + m_iActiveFeature = 0; + m_iFeatureCurDisplayOffset = 0; + } + + return; +} + +void settings::menuUp() +{ + if(m_iActiveFeature - 1 >= 0) + { + m_iActiveFeature--; + if (m_iActiveFeature == m_iFeatureCurDisplayOffset + MENU_FEATURE_SCROLL_PADDING - 1) + { + int displayOffset = m_iActiveFeature - MENU_FEATURE_SCROLL_PADDING; + displayOffset = (displayOffset > m_nFeatureCur - MAX_MENU_FEATURES_DISPLAYED) ? m_nFeatureCur - MAX_MENU_FEATURES_DISPLAYED : displayOffset; + displayOffset = (displayOffset < 0) ? 0 : displayOffset; + m_iFeatureCurDisplayOffset = displayOffset; + } + } + else + { + m_iActiveFeature = m_nFeatureCur - 1; + int displayOffset = m_nFeatureCur - MAX_MENU_FEATURES_DISPLAYED; + displayOffset = (displayOffset < 0) ? 0 : displayOffset; + m_iFeatureCurDisplayOffset = displayOffset; + } + + return; +} + +void settings::menuRight() +{ + return this->getFeatureCur(m_iActiveFeature)->inc(); +} + +void settings::menuLeft() +{ + return this->getFeatureCur(m_iActiveFeature)->dec(); +} + +void settings::menuTabRight() +{ + while(m_pFeatureCur[0]->m_iCat < 0) + this->menuBack(); + m_pFeatureCat[m_iActiveCat]->m_iDisplayOffsetRet = m_iFeatureCurDisplayOffset; + m_pFeatureCat[m_iActiveCat]->m_iActiveFeatureRet = m_iActiveFeature; + + if(m_iActiveCat + 1 < m_nFeatureCat) + this->setActiveCat(m_iActiveCat + 1); + else + this->setActiveCat(0); + + m_iFeatureCurDisplayOffset = m_pFeatureCat[m_iActiveCat]->m_iDisplayOffsetRet; + m_iActiveFeature = m_pFeatureCat[m_iActiveCat]->m_iActiveFeatureRet; + return; +} + +void settings::menuTabLeft() +{ + while(m_pFeatureCur[0]->m_iCat < 0) + this->menuBack(); + m_pFeatureCat[m_iActiveCat]->m_iDisplayOffsetRet = m_iFeatureCurDisplayOffset; + m_pFeatureCat[m_iActiveCat]->m_iActiveFeatureRet = m_iActiveFeature; + + if(m_iActiveCat - 1 >= 0) + this->setActiveCat(m_iActiveCat - 1); + else + this->setActiveCat(m_nFeatureCat - 1); + m_iFeatureCurDisplayOffset = m_pFeatureCat[m_iActiveCat]->m_iDisplayOffsetRet; + m_iActiveFeature = m_pFeatureCat[m_iActiveCat]->m_iActiveFeatureRet; + return; +} + +void settings::menuSelect() +{ + feat* feat = this->getFeatureCur(m_iActiveFeature); + feat->toggle(); + return; +} + +void settings::menuBack() +{ + if(m_pFeatureCur[0]->m_iParent >= 0) //if the buffer is filled with features that have a parent, not a category + { + featParent* parent = dynamic_cast(m_pFeature[m_pFeatureCur[0]->m_iParent]); + if(parent->m_iCat < 0) + this->fillFeatureCurBuffer(parent->m_iParent, FFB_PARENT); + else + this->fillFeatureCurBuffer(parent->m_iCat, FFB_CATEGORY); + + m_iFeatureCurDisplayOffset = parent->m_iDisplayOffsetRet; + m_iActiveFeature = parent->m_iActiveFeatureRet; + } + else + { + toggleMenu(); + } + return; +} + + + +int settings::addFeatureCategory(std::wstring name) +{ + if(m_nFeatureCat >= MAX_MENU_TABS) //prevent buffer overflow + return -1; + m_pFeatureCat[m_nFeatureCat] = new featCat; + m_pFeatureCat[m_nFeatureCat]->m_iId = m_nFeatureCat; + m_pFeatureCat[m_nFeatureCat]->m_szName = name; + m_nFeatureCat++; + return m_nFeatureCat - 1; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type) +{ + if( m_nFeature >= MAX_MENU_FEATURES || //buffer overflow + (parent < 0 && m_pFeatureCat[cat] == nullptr) || //invalid cat + (cat < 0 && (m_pFeature[parent] == nullptr || m_pFeature[parent]->m_type != feat_parent)) || //invalid parent + (cat < 0 && parent < 0) || (cat > 0 && parent > 0)) //both cat and parent were provided + return -1; + switch(type) + { + case feat_toggle: + m_pFeature[m_nFeature] = new feat; + break; + case feat_btn: + m_pFeature[m_nFeature] = new featBtn; + break; + case feat_slider: + m_pFeature[m_nFeature] = new featSlider; + break; + case feat_teleport: + m_pFeature[m_nFeature] = new featTeleport; + break; + case feat_parent: + m_pFeature[m_nFeature] = new featParent; + break; + } + m_pFeature[m_nFeature]->m_iId = m_nFeature; + m_pFeature[m_nFeature]->m_iCat = cat; + m_pFeature[m_nFeature]->m_iParent = parent; + m_pFeature[m_nFeature]->m_type = type; + m_pFeature[m_nFeature]->m_szName = name; + m_nFeature++; + return m_nFeature - 1; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, int index, float arg) +{ + int id = this->addFeature(cat, parent, name, type); + if (id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_iIndex = index; + dynamic_cast(m_pFeature[id])->m_fArg = arg; + + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey) +{ + int id = this->addFeature(cat, parent, name, type); + if(id < 0) + return id; + m_pFeature[id]->m_szIniKey = iniKey; + m_pFeature[id]->m_bOn = (bool) m_iniParser.getValue(iniKey, "FeatureToggle"); + m_pFeature[id]->m_bRestored = (m_pFeature[id]->m_bOn) ? false : true; + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, float min, float max) +{ + int id = this->addFeature(cat, parent, name, type, iniKey); + if(id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_fMin = min; + dynamic_cast(m_pFeature[id])->m_fMax = max; + float v = m_iniParser.getValue(iniKey, "FeatureValue"); + if(v <= max && v >= min) + dynamic_cast(m_pFeature[id])->m_fValue = v; + else + { + dynamic_cast(m_pFeature[id])->m_fValue = min; + m_iniParser.setValue(iniKey, min, "FeatureValue"); + } + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, float min, float max, float mod) +{ + int id = this->addFeature(cat, parent, name, type, iniKey, min, max); + if(id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_fMod = mod; + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, teleType tpType) +{ + if(tpType != tp_saved) + return -1; + int id = this->addFeature(cat, parent, name, type, iniKey); + if(id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_tpType = tpType; + dynamic_cast(m_pFeature[id])->m_v3Pos.x = m_iniParser.getValue(iniKey + "_x", "Teleport"); + dynamic_cast(m_pFeature[id])->m_v3Pos.y = m_iniParser.getValue(iniKey + "_y", "Teleport"); + dynamic_cast(m_pFeature[id])->m_v3Pos.z = m_iniParser.getValue(iniKey + "_z", "Teleport"); + dynamic_cast(m_pFeature[id])->m_szName += L" | " + StringToWString(m_iniParser.getValue(iniKey + "_name", "Teleport")); + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, teleType tpType) +{ + if(tpType == tp_saved) + return -1; + int id = this->addFeature(cat, parent, name, type); + if(id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_tpType = tpType; + return id; +} + +int settings::addFeature(int cat, int parent, std::wstring name, featType type, teleType tpType, float x, float y, float z) +{ + if(tpType == tp_saved) + return -1; + int id = this->addFeature(cat, parent, name, type, tpType); + if(id < 0) + return id; + dynamic_cast(m_pFeature[id])->m_v3Pos.x = x; + dynamic_cast(m_pFeature[id])->m_v3Pos.y = y; + dynamic_cast(m_pFeature[id])->m_v3Pos.z = z; + return id; +} + +int settings::updataFeature(int id, int cat, int parent, std::wstring name, featType type) +{ + if (id >= MAX_MENU_FEATURES || //buffer overflow + (parent < 0 && m_pFeatureCat[cat] == nullptr) || //invalid cat + (cat < 0 && (m_pFeature[parent] == nullptr || m_pFeature[parent]->m_type != feat_parent)) || //invalid parent + (cat < 0 && parent < 0) || (cat > 0 && parent > 0)) //both cat and parent were provided + return -1; + m_pFeature[id]->m_iId = id; + m_pFeature[id]->m_iCat = cat; + m_pFeature[id]->m_iParent = parent; + m_pFeature[id]->m_type = type; + m_pFeature[id]->m_szName = name; + return id; +} + +int settings::updataFeature(int id, int cat, int parent, std::wstring name, featType type, teleType tpType, float x, float y, float z) +{ + if (tpType == tp_saved) + return -1; + int ret = this->updataFeature(id, cat, parent, name, type); + if (ret < 0) + return ret; + dynamic_cast(m_pFeature[ret])->m_tpType = tpType; + dynamic_cast(m_pFeature[ret])->m_v3Pos.x = x; + dynamic_cast(m_pFeature[ret])->m_v3Pos.y = y; + dynamic_cast(m_pFeature[ret])->m_v3Pos.z = z; + return ret; +} + +int settings::getFeatureCategoryCount() +{ + return m_nFeatureCat; +} + +featCat* settings::getFeatureCategory(int id) +{ + if(id > m_nFeatureCat) + return 0; + return m_pFeatureCat[id]; +} + +int settings::getActiveCat() +{ + return m_iActiveCat; +} + +int settings::setActiveCat(int cat) +{ + if(cat > m_nFeatureCat) + return 0; + + m_iActiveCat = cat; + this->fillFeatureCurBuffer(cat, FFB_CATEGORY); + + return 1; +} + +bool settings::fillFeatureCurBuffer(int id, BYTE flag) +{ + //prevent race conditions + while(!g_pSettings->lockFeatureCur()) + Sleep(1); + + ZeroMemory(&m_pFeatureCur, sizeof(feat*) * MAX_MENU_FEATURES); //clear buffer + m_nFeatureCur = 0; + m_iActiveFeature = 0; + m_iFeatureCurDisplayOffset = 0; + + for(int i = 0; i < m_nFeature; i++) //create a list of features from current category + { + if( (m_pFeature[i]->m_iCat == id && flag & FFB_CATEGORY) || + (m_pFeature[i]->m_iParent == id && flag & FFB_PARENT)) + { + m_pFeatureCur[m_nFeatureCur] = m_pFeature[i]; + m_nFeatureCur++; + } + } + + this->unlockFeatureCur(); + return 1; +} + +int settings::getFeatureCurCount() +{ + return m_nFeatureCur; +} + +feat* settings::getFeatureCur(int i) +{ + if(i > m_nFeatureCur) + return 0; + return m_pFeatureCur[i]; +} + +int settings::getFeatureCount() +{ + return m_nFeature; +} + +feat* settings::getFeature(int id) +{ + if(id > m_nFeature) + return 0; + return m_pFeature[id]; +} + +int settings::getActiveFeature() +{ + return m_iActiveFeature; +} + +bool settings::getFeatureCurLock() +{ + return m_bFeatureCurLock; +} + +bool settings::lockFeatureCur() +{ + if(m_bFeatureCurLock) + return false; + m_bFeatureCurLock = true; + return true; +} + +bool settings::unlockFeatureCur() +{ + m_bFeatureCurLock = false; + return true; +} + +int settings::getDisplayOffset() +{ + return m_iFeatureCurDisplayOffset; +} + + +/* + //FEATURE CLASSES +*/ + +feat::feat() {} + +feat::~feat() {} + +void feat::toggle() +{ + m_bOn = !m_bOn; + if(m_bOn) + m_bRestored = false; + if(m_szIniKey != "") + g_pSettings->m_iniParser.setValue(m_szIniKey, (int) m_bOn, "FeatureToggle"); + return; +} + +void feat::inc() {} +void feat::dec() {} + +featBtn::featBtn() {} +featBtn::~featBtn() {} + +void featBtn::toggle() +{ + (*g_pCBMap)[this->m_iIndex]->Exec(&this->m_fArg); +} + +featSlider::featSlider() {} +featSlider::~featSlider() {} + +void featSlider::inc() +{ + float v = (m_fValue + ( (m_fMax - m_fMin) * m_fMod) ); + if(v <= m_fMax) + m_fValue = v; + else + m_fValue = m_fMax; + g_pSettings->m_iniParser.setValue(m_szIniKey, m_fValue, "FeatureValue"); + return; +} + +void featSlider::dec() +{ + float v = (m_fValue - ( (m_fMax - m_fMin) * m_fMod) ); + if(v >= m_fMin) + m_fValue = v; + else + m_fValue = m_fMin; + g_pSettings->m_iniParser.setValue(m_szIniKey, m_fValue, "FeatureValue"); + return; +} + + +featTeleport::featTeleport() {} +featTeleport::~featTeleport() {} + +void featTeleport::toggle() +{ + switch(m_tpType) + { + case tp_waypoint: + g_pHack->teleportWaypoint(); + break; + case tp_objective: + g_pHack->teleportObjective(); + break; + case tp_saved: + case tp_static: + g_pHack->teleport(m_v3Pos); + break; + } +} + +featParent::featParent() {} +featParent::~featParent() {} + +void featParent::toggle() +{ + m_iActiveFeatureRet = g_pSettings->getActiveFeature(); + m_iDisplayOffsetRet = g_pSettings->getDisplayOffset(); + g_pSettings->fillFeatureCurBuffer(this->m_iId, FFB_PARENT); + + return; +} + + + +/* + //INI PARSER CLASS +*/ + +iniParser::iniParser(){}; + +iniParser::iniParser(std::string szFile) : +m_szFile(szFile) +{}; + +iniParser::~iniParser(){}; + +void iniParser::read() +{ + std::ifstream file; + file.open(m_szFile, std::ios::in); + if (!file.is_open()) + { + MessageBoxW(nullptr, L"δҵsettings.iniļ뽫ѹļѹͬһĿ¼!", L"subVersionʧ", MB_OK | MB_ICONERROR); + g_bKillAttach = true; + killProgram(); + return; + } + + + std::string szLine; + int iSection = -1; + std::regex regexSection("^\\[([A-Za-z0-9_]+)\\]$"), + regexKey ("^([A-Za-z0-9_]+)=([A-Za-z0-9_\\-*/+.\\s]+)$"), + regexComment("^(;|#)(.*)$"); + + while(std::getline(file, szLine, '\n')) + { + std::smatch regexMatch; //std::string match object + + if(szLine == "") + continue; + + else if(std::regex_search(szLine, regexMatch, regexComment) && regexMatch.size() > 1) + m_key.push_back({"__COMMENT__", regexMatch[2], iSection}); + + else if(std::regex_search(szLine, regexMatch, regexSection) && regexMatch.size() > 1) + { + iSection = (int) m_section.size(); + m_section.push_back(regexMatch[1]); + } + + else if(std::regex_search(szLine, regexMatch, regexKey) && regexMatch.size() > 1) + m_key.push_back({regexMatch.str(1), regexMatch[2], iSection}); + } + return; +} + +void iniParser::write() +{ + std::ofstream file; + file.open(m_szFile, std::ios::out | std::ios::trunc); + if(!file.is_open()) + return; + for(int j = 0; j <= m_section.size(); j++) + { + if(j > 0) + file << "[" << m_section[j - 1] << "]\n"; + for(int i = 0; i < m_key.size(); i++) + { + if(m_key[i].section != j - 1) + continue; + if(m_key[i].key == "__COMMENT__") + file << ";" ; + else + file << m_key[i].key << "="; + file << m_key[i].value << "\n"; + } + } + return; +} + +int iniParser::findKey(std::string szKey, std::string szSection) +{ + for(int i = 0; i < m_key.size(); i++) + if(m_key[i].key == szKey && (szSection == "" || szSection == m_section[m_key[i].section])) + return i; + return -1; +} + +int iniParser::createKey(std::string szKey, std::string szSection) +{ + int iSection = -1; + if(szSection != "") + { + for(int i = 0; i < m_section.size(); i++) + if(m_section[i] == szSection) + { + iSection = i; + break; + } + } + m_key.push_back({szKey, "", iSection}); + return (int) m_key.size() - 1; +} \ No newline at end of file diff --git a/subVersion/settings.h b/subVersion/settings.h new file mode 100644 index 0000000..1d0fec1 --- /dev/null +++ b/subVersion/settings.h @@ -0,0 +1,255 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#pragma once +#ifndef SETTINGS_H +#define SETTINGS_H + +#define MAX_SAVEDPOS 0x06 //max saved positions (to teleport to) +#define MAX_PROPERTIES 0x60 //max iniparser properties +#define MAX_KEYS 0x10 //max indexed keys (keybinds) +#define MAX_MENU_TABS 0x08 //max amount of overlay menu tabs +#define MAX_MENU_FEATURES 0xFFF //max amount of features +#define MAX_MENU_FEATURES_DISPLAYED 0x14 //max features displayed +#define MENU_FEATURE_SCROLL_PADDING 0x02 +#define NAME_BUFFER_SIZE 0x20 + +#define FFB_CATEGORY 1 << 0 +#define FFB_PARENT 1 << 1 + +//Required keys, loaded in settings::settings +#define keyExit 0x0 +#define keyMenu 0x1 +#define keyMenuUp 0x2 +#define keyMenuDown 0x3 +#define keyMenuLeft 0x4 +#define keyMenuRight 0x5 +#define keyMenuSelect 0x6 +#define keyMenuTabNext 0x7 +#define keyMenuTabPrev 0x8 +#define keyMenuSave 0x9 +#define keyHotTeleport 0xA +#define keyHotWanted 0xB +#define keyHotHealth 0xC +#define keyHotAmmo 0xD +#define keyMenuBack 0xE + +class featCat +{ + public: + int m_iId, + m_iActiveFeatureRet = 0, + m_iDisplayOffsetRet = 0; + std::wstring m_szName; +}; + +enum featType { feat_btn, feat_toggle, feat_slider, feat_teleport, feat_parent }; +enum teleType { tp_saved, tp_waypoint, tp_static, tp_objective }; + +class feat +{ + public: + int m_iId, + m_iCat, + m_iParent; + featType m_type; + std::wstring m_szName; + std::string m_szIniKey; + bool m_bOn = false, + m_bRestored = true; + + feat(); + virtual ~feat(); + virtual void toggle(); + virtual void inc(); + virtual void dec(); +}; + +class featBtn : public feat +{ + public: + int m_iIndex; + float m_fArg; + + featBtn(); + ~featBtn(); + void toggle(); +}; + +class featSlider : public feat +{ + public: + float m_fValue, + m_fMin, + m_fMax, + m_fMod = .10f; + + featSlider(); + ~featSlider(); + void inc(); + void dec(); +}; + +class featTeleport : public feat +{ + public: + teleType m_tpType; + v3 m_v3Pos; + + featTeleport(); + ~featTeleport(); + void toggle(); +}; + +class featParent : public feat +{ + public: + int m_iActiveFeatureRet = 0, + m_iDisplayOffsetRet = 0; + + featParent(); + ~featParent(); + void toggle(); +}; + + +typedef struct +{ + std::string key, + value; + int section; +} iniProperty; + +class iniParser +{ + public: + std::string m_szFile; + + iniParser(); + iniParser(std::string szFile); + ~iniParser(); + + void read(); + void write(); + + int findKey(std::string szKey, std::string szSection = ""); + int createKey(std::string szKey, std::string szSection = ""); + + + template + rT getValue(std::string szKey, std::string szSection = "") + { + rT r{}; + int i = this->findKey(szKey, szSection); + if(i == -1 || (szSection != "" && (m_key[i].section < 0 || m_section[m_key[i].section] != szSection))) + return r; + std::stringstream ss(m_key[i].value); + ss >> r; + return r; + } + + template <> + std::string getValue(std::string szKey, std::string szSection) + { + std::string r{}; + int i = this->findKey(szKey, szSection); + if(i == -1 || (szSection != "" && (m_key[i].section < 0 || m_section[m_key[i].section] != szSection))) + return r; + return m_key[i].value; + } + + template + bool setValue(std::string szKey, wT value, std::string szSection = "") + { + int i = findKey(szKey, szSection); + if(i == -1 || (szSection != "" && (m_key[i].section < 0 || m_section[m_key[i].section] != szSection))) + i = createKey(szKey, szSection); + m_key[i].value = std::to_string(value); + return true; + } + protected: + std::vector m_section; + std::vector m_key; +}; + +class settings +{ + public: + int m_iKeys[MAX_KEYS]; + iniParser m_iniParser; + + settings(); + ~settings(); + + void toggleMenu(); + bool isMenuActive(); + void menuUp(); //prev feature + void menuDown(); //next feature + void menuLeft(); //float value down + void menuRight(); //float value up + void menuSelect(); //toggle feature/teleport or w/e + void menuBack(); + void menuTabLeft(); //prev tab + void menuTabRight(); //next tab + + int addFeatureCategory(std::wstring name); + int getFeatureCategoryCount(); + featCat* getFeatureCategory(int id); + int setActiveCat(int); + int getActiveCat(); + bool fillFeatureCurBuffer(int i, BYTE flags); + + int addFeature(int cat, int parent, std::wstring name, featType type); + int addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey); + int addFeature(int cat, int parent, std::wstring name, featType type, int index,float arg); + int addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, float min, float max); + int addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, float min, float max, float mod); + int addFeature(int cat, int parent, std::wstring name, featType type, std::string iniKey, teleType tpType); + int addFeature(int cat, int parent, std::wstring name, featType type, teleType tpType); + int addFeature(int cat, int parent, std::wstring name, featType type, teleType tpType, float x, float y, float z); + int updataFeature(int id, int cat, int parent, std::wstring name, featType type); + int updataFeature(int id, int cat, int parent, std::wstring name, featType type, teleType tpType, float x, float y, float z); + int getFeatureCurCount(); + feat* getFeatureCur(int i); + int getFeatureCount(); + feat* getFeature(int id); + int getActiveFeature(); + int getDisplayOffset(); + + bool getFeatureCurLock(); + bool lockFeatureCur(); + bool unlockFeatureCur(); + + protected: + featCat* m_pFeatureCat[MAX_MENU_TABS]; + int m_nFeatureCat = 0; + int m_iActiveCat = 0; //index for featureParent [should be the same as id] + feat* m_pFeature[MAX_MENU_FEATURES]; + int m_nFeature = 0; //total amount of features + int m_iActiveFeature = 0; //index for featureCur [DOES NOT HOLD ID!] + feat* m_pFeatureCur[MAX_MENU_FEATURES]; //list of features from current category + bool m_bFeatureCurLock = false; + int m_nFeatureCur = 0; //amount of features in current tab + bool m_bMenuActive = false; + int m_iFeatureCurDisplayOffset = 0; +}; + +extern settings* g_pSettings; + +#endif \ No newline at end of file diff --git a/subVersion/settings.ini b/subVersion/settings.ini new file mode 100644 index 0000000..cefd0f6 --- /dev/null +++ b/subVersion/settings.ini @@ -0,0 +1,112 @@ +; +; Keys +; Full list of valid keys in KEYS.txt +; +[Keys] +Exit=F9 +Menu=NUM- +MenuUp=NUM8 +MenuDown=NUM2 +MenuLeft=NUM4 +MenuRight=NUM6 +MenuSelect=NUM5 +MenuBack=NUM0 +MenuTabNext=NUM9 +MenuTabPrev=NUM7 +MenuSave=L +HotTeleport=F5 +HotWanted=F6 +HotHealth=F7 +HotAmmo=F8 +[Teleport] +pos0_name=Saved Position 1 +pos0_x=0.00 +pos0_y=0.00 +pos1_name=Saved Position 2 +pos1_x=0.00 +pos1_y=0.00 +pos2_name=Saved Position 3 +pos2_x=0.00 +pos2_y=0.00 +pos3_name=Saved Position 4 +pos3_x=0.00 +pos3_y=0.00 +pos4_name=Saved Position 5 +pos4_x=0.00 +pos4_y=0.00 +pos5_name=Saved Position 6 +pos5_x=0.00 +pos5_y=0.00 +[FeatureValue] +runSpd=1.000000 +swimSpd=1.000000 +quickReload=1.000000 +bulletDamage=1.000000 +weapRange=1.000000 +bulletBatch=1.000000 +muzzleVelo=1.000000 +vehAccel=1.000000 +vehUpShift=1.000000 +vehBrakeForce=1.000000 +vehTraction=1.000000 +batchSpread=0.000000 +wanted=0.000000 +vehDeform=0.000000 +vehGravity=0.000000 +vehSuspensionForce=0.000000 +vehDownShift=1.000000 +vehRrchargeSpeed=0.500000 +vehBuoyancy=1.000000 +RP=1.000000 +AP=1.000000 +superPunch=0.000000 +forceOnPed=1.000000 +forceOnVeh=1.000000 +forceOnHeli=1.000000 +vehSuspensionHeigh=0.000000 +[FeatureToggle] +trueGodMode=0 +godMode=0 +wanted=0 +neverWanted=0 +antiNpc=0 +runSpd=0 +swimSpd=0 +superJump=0 +explMelee=0 +noRagdoll=0 +infStam=0 +noSpread=0 +noRecoil=0 +noReload=0 +quickReload=0 +bulletDamage=0 +infAmmo=0 +weapRange=0 +weapSpin=0 +explAmmo=0 +fireAmmo=0 +bulletBatch=0 +batchSpread=0 +muzzleVelo=0 +vehTrueGodMode=0 +vehGodMode=0 +vehBulletproofTires=0 +seatbelt=0 +vehDeform=0 +vehAccel=0 +vehUpShift=0 +vehBrakeForce=0 +vehTraction=0 +vehGravity=0 +vehSuspensionForce=0 +vehDownShift=0 +superPunch=0 +npcIgnore=0 +bulletEdit=1 +undeadOffradar=0 +vehSuspensionHeigh=0 +RP=0 +vehRrchargeSpeed=0 +OrbitalCannon=0 +AntiIdleKick=1 diff --git a/subVersion/stdafx.cpp b/subVersion/stdafx.cpp new file mode 100644 index 0000000..a5e7874 --- /dev/null +++ b/subVersion/stdafx.cpp @@ -0,0 +1,118 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#include "stdafx.h" + +DWORD strToVk(std::string str) +{ + for(auto& c : str) + c = toupper(c); + if(str == "BACKSPACE") return 0x08; + if(str == "TAB") return 0x09; + if(str == "RETURN") return 0x0D; + if(str == "SHIFT") return 0x10; + if(str == "CONTROL") return 0x11; + if(str == "ALT") return 0x12; + if(str == "PAUSE") return 0x13; + if(str == "CAPSLOCK") return 0x14; + if(str == "ESCAPE") return 0x1B; + if(str == "SPACE") return 0x20; + if(str == "PAGEUP") return 0x21; + if(str == "PAGEDOWN") return 0x22; + if(str == "END") return 0x23; + if(str == "HOME") return 0x24; + if(str == "LEFT") return 0x25; + if(str == "UP") return 0x26; + if(str == "RIGHT") return 0x27; + if(str == "DOWN") return 0x28; + if(str == "INSERT") return 0x2D; + if(str == "DELETE") return 0x2E; + if(str == "0") return 0x30; + if(str == "1") return 0x31; + if(str == "2") return 0x32; + if(str == "3") return 0x33; + if(str == "4") return 0x34; + if(str == "5") return 0x35; + if(str == "6") return 0x36; + if(str == "7") return 0x37; + if(str == "8") return 0x38; + if(str == "9") return 0x39; + if(str == "A") return 0x41; + if(str == "B") return 0x42; + if(str == "C") return 0x43; + if(str == "D") return 0x44; + if(str == "E") return 0x45; + if(str == "F") return 0x46; + if(str == "G") return 0x47; + if(str == "H") return 0x48; + if(str == "I") return 0x49; + if(str == "J") return 0x4A; + if(str == "K") return 0x4B; + if(str == "L") return 0x4C; + if(str == "M") return 0x4D; + if(str == "N") return 0x4E; + if(str == "O") return 0x4F; + if(str == "P") return 0x50; + if(str == "Q") return 0x51; + if(str == "R") return 0x52; + if(str == "S") return 0x53; + if(str == "T") return 0x54; + if(str == "U") return 0x55; + if(str == "V") return 0x56; + if(str == "W") return 0x57; + if(str == "X") return 0x58; + if(str == "Y") return 0x59; + if(str == "Z") return 0x5A; + if(str == "NUM0") return 0x60; + if(str == "NUM1") return 0x61; + if(str == "NUM2") return 0x62; + if(str == "NUM3") return 0x63; + if(str == "NUM4") return 0x64; + if(str == "NUM5") return 0x65; + if(str == "NUM6") return 0x66; + if(str == "NUM7") return 0x67; + if(str == "NUM8") return 0x68; + if(str == "NUM9") return 0x69; + if(str == "NUM*") return 0x6A; + if(str == "NUM+") return 0x6B; + if(str == "NUM-") return 0x6D; + if(str == "NUMDEL") return 0x6E; + if(str == "NUM/") return 0x6F; + if(str == "F1") return 0x70; + if(str == "F2") return 0x71; + if(str == "F3") return 0x72; + if(str == "F4") return 0x73; + if(str == "F5") return 0x74; + if(str == "F6") return 0x75; + if(str == "F7") return 0x76; + if(str == "F8") return 0x77; + if(str == "F9") return 0x78; + if(str == "F10") return 0x79; + if(str == "F11") return 0x7A; + if(str == "F12") return 0x7B; + if(str == "NUMLOCK") return 0x90; + if(str == "SCROLLLOCK") return 0x91; + if(str == "LSHIFT") return 0xA0; + if(str == "RSHIFT") return 0xA1; + if(str == "LCONTROL") return 0xA2; + if(str == "RCONTROL") return 0xA3; + if(str == "LALT") return 0xA4; + if(str == "RALT") return 0xA5; + return 0; +} \ No newline at end of file diff --git a/subVersion/stdafx.h b/subVersion/stdafx.h new file mode 100644 index 0000000..3e0ecb9 --- /dev/null +++ b/subVersion/stdafx.h @@ -0,0 +1,290 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +//#define __SC_VERSION__ +//#define __STEAM_VERSION__ + +#ifndef STDAFX_H +#define STDAFX_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#pragma comment(lib,"Dwmapi.lib") + +#include "d3d9/d3d9.h" +#include "d3d9/d3dx9.h" +#pragma comment(lib,"d3d9/d3dx9.lib") +#pragma comment(lib,"d3d9/d3d9.lib") + +#include "resource.h" + +#include "vector.h" +#include "memManager.h" +#include "D3D9Render.h" +#include "settings.h" +#include "entity.h" +#include "hack.h" +#include "CallbackProxy.h" +#include "VehiclePreview.h" + +//offset from WORLD +#define OFFSET_PLAYER 0x08 //playerbase +#define OFFSET_NET_PLAYER 0x1C8 + +//entity offsets +#define OFFSET_ENTITY_POSBASE 0x30 //base of a structure that contains entity coords +#define OFFSET_ENTITY_POSBASE_COS 0x20 +#define OFFSET_ENTITY_POSBASE_SIN 0x30 +#define OFFSET_ENTITY_POSBASE_POS 0x50 //vector3 +#define OFFSET_ENTITY_POS 0x90 //vector3 +#define OFFSET_ENTITY_GOD 0x189 //godmode; on = 1, off = 0; byte +#define OFFSET_ENTITY_HEALTH 0x280 //entity health (except for vehicles); float cur, float max +#define OFFSET_ENTITY_HEALTH_MAX 0x2A0 //they moved this away from curHealth in 1.36 :( +#define OFFSET_ENTITY_ATTACKER 0x2A8 //base to a list of the last 3 entities that attacked the current entity + +//player (entity) offsets +#define OFFSET_PLAYER_VEHICLE 0xD28 //ptr to last used vehicle +#define OFFSET_NET_PLAYER_INFO 0xA8 +#define OFFSET_PLAYER_INFO 0x10C8 //playerInfo struct +#define OFFSET_PLAYER_INFO_NAME 0x84 +#define OFFSET_PLAYER_INFO_SWIM_SPD 0x150 //swim speed; def 1; float +#define OFFSET_PLAYER_INFO_RUN_SPD 0xCD0 //run speed; def 1; float +#define OFFSET_PLAYER_INFO_FRAMEFLAGS 0x1F9 //frame flags; DWORD +#define OFFSET_PLAYER_INFO_WANTED_CAN_CHANGE 0x71C //fWantedCanChange +#define OFFSET_PLAYER_INFO_NPC_IGNORE 0x850 //npc ignore; DWORD; everyone = 0x450000; +#define OFFSET_PLAYER_INFO_WANTED 0x868 //wanted level; DWORD +#define OFFSET_PLAYER_INFO_STAMINA 0xCD4 //fStamina, fStaminaMax +#define OFFSET_PLAYER_RAGDOLL 0x10B8 //byte; CPed.noRagdoll: 0x20 = off; 0x00/0x01 = on +#define OFFSET_PLAYER_SEATBELT 0xC00 //byte; CPed.seatBelt: 0xC8 = off; 0xC9 = on +#define OFFSET_PLAYER_INVEHICLE 0x1477 +#define OFFSET_PLAYER_ARMOR 0x14E0 //armour +#define OFFSET_PLAYER_WATER_PROOF 0x188 //water proof; DWORD; +0x1000000 = on +#define OFFSET_PLAYER_VEHICLE_DAMAGE_MP 0xCFC //super punck/kick;float; + +//vehicle offsets +#define OFFSET_VEHICLE_HEALTH 0x908 //vehicle health; 0.f-1000.f +#define OFFSET_VEHICLE_HEALTH2 0x844 //vehicle health2; 0.f-1000.f +#define OFFSET_VEHICLE_HANDLING 0x938 +#define OFFSET_VEHICLE_HANDLING_MASS 0xC //fMass +#define OFFSET_VEHICLE_HANDLING_BUOYANCY 0x40 //fBuoyancy +#define OFFSET_VEHICLE_HANDLING_ACCELERATION 0x4C +#define OFFSET_VEHICLE_HANDLING_UPSHIFT 0x58 +#define OFFSET_VEHICLE_HANDLING_DOWNSHIFT 0x5C +#define OFFSET_VEHICLE_HANDLING_BRAKEFORCE 0x6C +#define OFFSET_VEHICLE_HANDLING_HANDBRAKEFORCE 0x7C //fHandbrakeForce +#define OFFSET_VEHICLE_HANDLING_TRACTION_CURVE_MIN 0x90 //fTractionCurveMin +#define OFFSET_VEHICLE_HANDLING_SUSPENSION_FORCE 0xBC //fSuspensionForce +#define OFFSET_VEHICLE_HANDLING_SUSPENSION_HEIGH 0xD0 //fSuspensionHeight +#define OFFSET_VEHICLE_HANDLING_COLISION_DAMAGE_MP 0xF0 //fColisionDamageMult +#define OFFSET_VEHICLE_HANDLING_WEAPON_DAMAGE_MP 0xF4 //fWeaponDamageMult +#define OFFSET_VEHICLE_HANDLING_DEFORM_MULTIPLIER 0xF8 //fDeformationDamageMult +#define OFFSET_VEHICLE_HANDLING_ENGINE_DAMAGE_MP 0xFC //fEngineDamageMult +#define OFFSET_VEHICLE_BULLETPROOF_TIRES 0x943 //btBulletproofTires; (btBulletproofTires & 0x20) ? true : false +#define OFFSET_VEHICLE_GRAVITY 0xC5C //fGravity +#define OFFSET_VEHICLE_BOOST 0x320 //fBoost +#define OFFSET_VEHICLE_RECHARGE_SPEED 0x324 //fRocketRechargeSpeed +#define OFFSET_VEHICLE_MISSLES 0x1280 //btVehicleMissles +#define OFFSET_VEHICLE_BOMBS 0x1294 //btAircraftBombs +#define OFFSET_VEHICLE_COUNTERMEASURES 0x1298 //btAircraftCountermeasures +#define OFFSET_VEHICLE_MK2_MISSLES 0x1284 //btOppressorMK2Misseles +#define OFFSET_VEHICLE_TAMPA_MISSLES 0x127C //btTampaMissles +#define OFFSET_VEHICLE_CUSTOM 0x48 +#define OFFSET_VEHICLE_CUSTOM_EMS 0x3D6 //btEngineManagementSystem; 0x3 = max +#define OFFSET_VEHICLE_CUSTOM_BRAKES 0x3D7 //btBrakes; 0x6 = max +#define OFFSET_VEHICLE_CUSTOM_TRANSMISSION 0x3D8 //btTransmission; 0x8 = max +#define OFFSET_VEHICLE_CUSTOM_SUSPENSION 0x3DA //btSuspension; 0x1B = max +#define OFFSET_VEHICLE_CUSTOM_ARMOR 0x3DB //btArmor; 0x1B = max +#define OFFSET_VEHICLE_CUSTOM_TURBO_TUNING 0x3DD //btTurboTuning; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHT_R 0x3A2 //btNeonLightRed +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHT_G 0x3A1 //btNeonLightGreen +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHT_B 0x3A0 //btNeonLightBlue +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHTS_L 0x402 //btNeonLightLeft; 0x0 = off; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHTS_R 0x403 //btNeonLightRight; 0x0 = off; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHTS_F 0x404 //btNeonLightFront; 0x0 = off; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_NEON_LIGHTS_B 0x405 //btNeonLightBack; 0x0 = off; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_TYRE_SMOKE 0x3DF //btTyreSmoke; 0x1 = on +#define OFFSET_VEHICLE_CUSTOM_TYRE_SMOKE_R 0x3FC //btTyreSmokeRed +#define OFFSET_VEHICLE_CUSTOM_TYRE_SMOKE_G 0x3FD //btTyreSmokeGreen +#define OFFSET_VEHICLE_CUSTOM_TYRE_SMOKE_B 0x3FE //btTyreSmokeBlue +#define OFFSET_VEHICLE_CUSTOM_LIMO_WINDOWS 0x3FF //btLimoWindows; 0x1 = on + +//weapon offsets +#define OFFSET_WEAPON_MANAGER 0x10D8 //from playerbase +#define OFFSET_WEAPON_CURRENT 0x20 //from weapon manager +#define OFFSET_WEAPON_AMMOINFO 0x60 //from weaponbase +#define OFFSET_WEAPON_AMMOINFO_MAX 0x28 //ammoinfo +#define OFFSET_WEAPON_AMMOINFO_CUR_1 0x08 //ptr lvl 1, ptr 1 +#define OFFSET_WEAPON_AMMOINFO_CUR_2 0x00 //ptr tr lvl 2, ptr 1 +#define OFFSET_WEAPON_AMMOINFO_CURAMMO 0x18 //offset to cur ammo +#define OFFSET_WEAPON_AMMOINFO_TYPE 0x0C //offset to projectile type? +#define OFFSET_WEAPON_SPREAD 0x7C //float set to 0 +#define OFFSET_WEAPON_BULLET_DMG 0xBC //float times 10 (so when 0, it will stay 0) +#define OFFSET_WEAPON_RELOAD_MULTIPLIER 0x134 //float times 10 +#define OFFSET_WEAPON_RECOIL 0x2F4 //float set to 0 +#define OFFSET_WEAPON_MODEL_HASH 0x14 +#define OFFSET_WEAPON_NAME_HASH 0x10 +#define OFFSET_WEAPON_RELOAD_VEHICLE 0x130 +#define OFFSET_WEAPON_RANGE 0x28C +#define OFFSET_WEAPON_SPINUP 0x144 +#define OFFSET_WEAPON_SPIN 0x148 +#define OFFSET_WEAPON_BULLET_BATCH 0x124 //dwBulletInBatch +#define OFFSET_WEAPON_MUZZLE_VELOCITY 0x11C //fMuzzleVelocity +#define OFFSET_WEAPON_IMPACT_TYPE 0x20 //dwImpactType; 1: Fists,3; Bullets,5: Explosives +#define OFFSET_WEAPON_IMPACT_EXPLOSION 0x24 //dwImpactExplosion +#define OFFSET_WEAPON_PENETRATION 0x110 //fPenetration +#define OFFSET_WEAPON_FORCE_ON_PED 0xDC //fForceOnPed +#define OFFSET_WEAPON_FORCE_ON_VEHICLE 0xE0 //fForceOnVehicle(Bullet Mass) +#define OFFSET_WEAPON_FORCE_ON_HELI 0xE4 //fForceOnHeli + + +//tunable offsets +#define OFFSET_TUNABLE_RP_MULTIPLIER 0x10 +#define OFFSET_TUNABLE_AP_MULTIPLIER 0x30F80 +#define OFFSET_TUNABLE_MIN_MISSION_PAYOUT 0x4BC8 //fMinMissionPayout +#define OFFSET_TUNABLE_ANTI_IDLE_KICK1 0x2C0 //AFK;DWORD;2000000000 = Anti idle kick +#define OFFSET_TUNABLE_ANTI_IDLE_KICK2 0x2C8 +#define OFFSET_TUNABLE_ANTI_IDLE_KICK3 0x2D0 +#define OFFSET_TUNABLE_ANTI_IDLE_KICK4 0x2D8 +#define OFFSET_TUNABLE_ORBITAL_CANNON_COOLDOWN 0x2C188 //OrbitalCannonCooldown;DWORD +#define OFFSET_TUNABLE_BUNKER_RESEARCH 0x29BB8 //UnlockAllBunkerResearch;DWORD + + +#define OFFSET_ATTACKER_DISTANCE 0x18 //changed to 0x18, from 0x10 + +//replay interface offsets +#define OFFSET_REPLAY_PED_INTERFACE 0x18 +#define OFFSET_PED_INTERFACE_PED_LIST 0x100 +#define OFFSET_PED_INTERFACE_CUR_PEDS 0x110 + +//global offsets +#define OFFSET_GLOBAL_VEHICLE_HASH 2460715 + + +//feature indexing +#define FEATURE_P_GOD 0x00 +#define FEATURE_P_NEVERWANTED 0x01 +#define FEATURE_P_ANTINPC 0x02 +#define FEATURE_V_GOD 0x03 +#define FEATURE_W_SPREAD 0x04 +#define FEATURE_W_RECOIL 0x05 +#define FEATURE_W_RELOAD 0x06 +#define FEATURE_W_DAMAGE 0x07 +#define FEATURE_W_AMMO 0x08 +#define FEATURE_W_RANGE 0x09 +#define FEATURE_W_SPINUP 0x0A +#define FEATURE_P_RUNSPD 0x0B +#define FEATURE_P_SWIMSPD 0x0C +#define FEATURE_P_TRUEGOD 0x0D +#define FEATURE_P_SUPERJUMP 0x0E +#define FEATURE_P_EXPLOSIVEMELEE 0x0F +#define FEATURE_W_EXPLOSIVEAMMO 0x10 +#define FEATURE_W_FIREAMMO 0x11 +#define FEATURE_V_TRUEGOD 0x12 +#define FEATURE_P_NORAGDOLL 0x13 +#define FEATURE_V_SEATBELT 0x14 +#define FEATURE_W_NORELOAD 0x15 +#define FEATURE_V_ACCELERATION 0x16 +#define FEATURE_V_BRAKEFORCE 0x17 +#define FEATURE_V_TRACTION 0x18 +#define FEATURE_V_GRAVITY 0x19 +#define FEATURE_V_BULLETPROOFTIRES 0x1A +#define FEATURE_P_WANTED 0x1B +#define FEATURE_W_BULLET_BATCH 0x1C +#define FEATURE_W_MUZZLE_VELOCITY 0x1D +#define FEATURE_V_DEFORMATION 0x1E +#define FEATURE_V_UPSHIFT 0x1F +#define FEATURE_V_SUSPENSION_FORCE 0x21 +#define FEATURE_P_STAMINA 0x22 +#define FEATURE_V_DOWNSHIFT 0x24 +#define FEATURE_P_SUICIDE 0x25 +#define FEATURE_W_FILL_AMMO 0x26 +#define FEATURE_P_WATER_PROOF 0x27 +#define FEATURE_P_HEAL 0x28 +#define FEATURE_P_UNDEAD_OFFRADAR 0x29 +#define FEATURE_P_SUPER_PUNCH 0x2A +#define FEATURE_V_MASS 0x2B +#define FEATURE_V_BUOYANCY 0x2C +#define FEATURE_V_HANDBRAKEFORCE 0x2D +#define FEATURE_V_SUSPENSION_HEIGH 0x2E +#define FEATURE_V_COLISION_DAMAGE_MP 0x2F +#define FEATURE_V_WEAPON_DAMAGE_MP 0x30 +#define FEATURE_V_ENGINE_DAMAGE_MP 0x31 +#define FEATURE_V_BOOST 0x32 +#define FEATURE_V_RECHARGE_SPEED 0x33 +#define FEATURE_V_HEAL 0x34 +#define FEATURE_T_RP_MP 0x35 +#define FEATURE_T_AP_MP 0x36 +#define FEATURE_T_MISSION_PAYOUT 0x37 +#define FEATURE_W_FILL_ALL_AMMO 0x38 +#define FEATURE_W_FORCE_ON_PED 0x39 +#define FEATURE_W_FORCE_ON_VEHICLE 0x3A +#define FEATURE_W_FORCE_ON_HELI 0x3B +#define FEATURE_W_BULLET_EDIT 0x3C +#define FEATURE_P_NPC_IGNORE 0x3D +#define FEATURE_T_ORBITAL_CANNON 0x3E +#define FEATURE_T_BUNKER_RESEARCH 0x3F +#define FEATURE_T_ANTI_IDLE_KICK 0x40 +#define FEATURE_P_PLAYER_LIST 0x41 +#define FEATURE_P_MONERY_DROP 0x42 + +static std::wstring StringToWString(const std::string& str) { + int num = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, NULL, 0); + wchar_t* wide = new wchar_t[num]; + MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, wide, num); + std::wstring w_str(wide); + delete[] wide; + return w_str; +} + +void killProgram (); +DWORD strToVk(std::string str); + +extern HWND g_hWnd; +extern int g_iFeature[MAX_MENU_FEATURES]; + +extern bool g_bKillSwitch; +extern bool g_bKillRender; +extern bool g_bKillAttach; +extern bool g_bKillHack; +//Addresses from GTAV.exe module +extern long ADDRESS_WORLD; //48 8B 05 ? ? ? ? 45 ? ? ? ? 48 8B 48 08 48 85 C9 74 07 +extern long ADDRESS_BLIP; //4C 8D 05 ? ? ? ? 0F B7 C1 +extern long ADDRESS_AMMO; //Ammo dec code; 41 2B D1 E8; 90 90 90 E8 +extern long ADDRESS_MAGAZINE; //Magazine dec code; 41 2B C9 3B C8 0F; 90 90 90 3B C8 0F +extern long ADDRESS_TUNABLE; +extern long ADDRESS_WEAPON; +extern long ADDRESS_GLOBAL; //4C 8D 05 ? ? ? ? 4D 8B 08 4D 85 C9 74 11 +extern long ADDRESS_PLAYER_LIST; //48 8B 0D ? ? ? ? E8 ? ? ? ? 48 8B C8 E8 ? ? ? ? 48 8B CF +extern long ADDRESS_REPLAY_INTERFACE; //48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D ? ? ? ? +#endif \ No newline at end of file diff --git a/subVersion/subVersion.vcxproj b/subVersion/subVersion.vcxproj new file mode 100644 index 0000000..5ee54bb --- /dev/null +++ b/subVersion/subVersion.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16.0 + Win32Proj + {14bdf4df-a71b-489a-9077-ea112711cb28} + subVersion + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + MultiByte + + + Application + false + v142 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + true + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Windows + true + RequireAdministrator + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Windows + true + true + true + RequireAdministrator + + + + + + \ No newline at end of file diff --git a/subVersion/subVersion.vcxproj.filters b/subVersion/subVersion.vcxproj.filters new file mode 100644 index 0000000..2395f26 --- /dev/null +++ b/subVersion/subVersion.vcxproj.filters @@ -0,0 +1,85 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 资源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/subVersion/vector.h b/subVersion/vector.h new file mode 100644 index 0000000..b951632 --- /dev/null +++ b/subVersion/vector.h @@ -0,0 +1,44 @@ +/* + Copyright 2016-2017 sub1to + + This file is part of subVersion GTA:O SC External Hack. + + subVersion GTA:O SC External Hack is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + subVersion GTA:O SC External Hack 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with subVersion GTA:O SC External Hack. If not, see . +*/ + +#ifndef VECTOR_H +#define VECTOR_H + +struct v2 +{ + float x = 0, + y = 0; +}; + +struct v3 +{ + float x = 0, + y = 0, + z = 0; + + v3(){} + v3(float x, float y, float z) + { + this->x = x; + this->y = y; + this->z = z; + } +}; + +#endif \ No newline at end of file