diff --git a/SKSE/Plugins/EnderalSE.dll b/SKSE/Plugins/EnderalSE.dll new file mode 100644 index 00000000..20bc9127 --- /dev/null +++ b/SKSE/Plugins/EnderalSE.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:075f4348a1f2c6f3ea05f1516bb70b96df3530d6be1253c0c6c4eeda42d83b79 +size 629760 diff --git a/SKSE/Plugins/EnderalSE.ini b/SKSE/Plugins/EnderalSE.ini new file mode 100644 index 00000000..8c672f65 --- /dev/null +++ b/SKSE/Plugins/EnderalSE.ini @@ -0,0 +1,2 @@ +FlatMapMarkers = true +StayAtSystemPage = true diff --git a/SKSE/Plugins/FlatMapMarkersSSE.json b/SKSE/Plugins/FlatMapMarkersSSE.json deleted file mode 100644 index f76f2caf..00000000 --- a/SKSE/Plugins/FlatMapMarkersSSE.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "whiteListedWorldSpaces": [ - { - "name": "Vyn, Enderal", - "editorID": "Vyn", - "markerHeight": 100000.156250, - "enabled": true - } - ] -} diff --git a/SKSE/Plugins/fs.dll b/SKSE/Plugins/fs.dll deleted file mode 100644 index 84e957a6..00000000 --- a/SKSE/Plugins/fs.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:51078f091c911ab11a267ed8e81fade1eb05f2176d8c526ac0128dc0bdf95a63 -size 200704 diff --git a/SKSE/Plugins/fs_se.dll b/SKSE/Plugins/fs_se.dll deleted file mode 100644 index dfe87547..00000000 --- a/SKSE/Plugins/fs_se.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:648179f406d8319c2c05a17cfa06d8cb0961cf7ae05389039517c04a099cd1cb -size 200704 diff --git a/scripts/_00e_func_checkdependencies.pex b/scripts/_00e_func_checkdependencies.pex index dc01eeff..e9dd8b3d 100644 Binary files a/scripts/_00e_func_checkdependencies.pex and b/scripts/_00e_func_checkdependencies.pex differ diff --git a/scripts/_00e_mqp01_functions.pex b/scripts/_00e_mqp01_functions.pex index 358892d1..cea3aca3 100644 Binary files a/scripts/_00e_mqp01_functions.pex and b/scripts/_00e_mqp01_functions.pex differ diff --git a/scripts/_00e_phasmalist_apparationinventory.pex b/scripts/_00e_phasmalist_apparationinventory.pex index 9418561d..ccfd8748 100644 Binary files a/scripts/_00e_phasmalist_apparationinventory.pex and b/scripts/_00e_phasmalist_apparationinventory.pex differ diff --git a/scripts/_00e_theriantrophist_alchemycontrol.pex b/scripts/_00e_theriantrophist_alchemycontrol.pex index b3c0ba48..e9f5817f 100644 Binary files a/scripts/_00e_theriantrophist_alchemycontrol.pex and b/scripts/_00e_theriantrophist_alchemycontrol.pex differ diff --git a/scripts/_00e_theriantrophist_chymikum.pex b/scripts/_00e_theriantrophist_chymikum.pex index c1a4d9d7..c3cbc014 100644 Binary files a/scripts/_00e_theriantrophist_chymikum.pex and b/scripts/_00e_theriantrophist_chymikum.pex differ diff --git a/scripts/_00e_theriantrophist_transformsc.pex b/scripts/_00e_theriantrophist_transformsc.pex index 3247979b..70a59fa4 100644 Binary files a/scripts/_00e_theriantrophist_transformsc.pex and b/scripts/_00e_theriantrophist_transformsc.pex differ diff --git a/scripts/_00e_theriantrophist_werewolfpotion.pex b/scripts/_00e_theriantrophist_werewolfpotion.pex index 3e60f3a9..0ecf4bcc 100644 Binary files a/scripts/_00e_theriantrophist_werewolfpotion.pex and b/scripts/_00e_theriantrophist_werewolfpotion.pex differ diff --git a/scripts/enderalfunctions.pex b/scripts/enderalfunctions.pex new file mode 100644 index 00000000..bece588a Binary files /dev/null and b/scripts/enderalfunctions.pex differ diff --git a/source/Enderal DLL/.clang-format b/source/Enderal DLL/.clang-format new file mode 100644 index 00000000..51f76aca --- /dev/null +++ b/source/Enderal DLL/.clang-format @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3841be3ad0538a7f7e40fb654977576f3594e73efeeb91a08eec6d9b591fbf8 +size 3092 diff --git a/source/Enderal DLL/.gitignore b/source/Enderal DLL/.gitignore new file mode 100644 index 00000000..fddaf08b --- /dev/null +++ b/source/Enderal DLL/.gitignore @@ -0,0 +1,539 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/clion,visualstudio,visualstudiocode,cmake +# Edit at https://www.toptal.com/developers/gitignore?templates=clion,visualstudio,visualstudiocode,cmake + +### CLion ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf +.vscode/ + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### CLion Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +### CMake ### +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +### CMake Patch ### +# External projects +*-prefix/ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# Local History for Visual Studio Code +.history/ + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +!.vscode/*.code-snippets + +### VisualStudio ### +## 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 + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# 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 +nunit-*.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/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# 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 +*.tlog +*.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 + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# 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 +# NuGet Symbol Packages +*.snupkg +# 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 + +# Nuget personal access tokens and Credentials +# nuget.config + +# 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 +*.appxbundle +*.appxupload + +# 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 +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).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/ + +# 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 + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +.idea/ +*.sln.iml + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/clion,visualstudio,visualstudiocode,cmake + +build/ + +contrib/Distribution/**/*.dll +contrib/Distribution/**/*.pdb +contrib/Distribution/**/*.pex diff --git a/source/Enderal DLL/CMakeLists.txt b/source/Enderal DLL/CMakeLists.txt new file mode 100644 index 00000000..e74a3d46 --- /dev/null +++ b/source/Enderal DLL/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 3.21) +message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.") + +######################################################################################################################## +## Define project +######################################################################################################################## +project( + EnderalSE + VERSION 1.0.0 + DESCRIPTION "Enderal SE DLL" + LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) + +include(GNUInstallDirs) + +find_path(SIMPLEINI_INCLUDE_DIRS "ConvertUTF.c") + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/version.rc + @ONLY) + +set(sources + src/Main.cpp + src/EventListener.cpp + src/Papyrus.cpp + + ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + +source_group( + TREE ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${headers} + ${sources}) + +######################################################################################################################## +## Configure target DLL +######################################################################################################################## +find_package(CommonLibSSE CONFIG REQUIRED) + +add_commonlibsse_plugin(${PROJECT_NAME} SOURCES ${headers} ${sources}) +add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}") + +target_include_directories(${PROJECT_NAME} + PRIVATE + $ + $ + $ + ${SIMPLEINI_INCLUDE_DIRS} +) + +target_include_directories(${PROJECT_NAME} + PUBLIC + $) + +target_precompile_headers(${PROJECT_NAME} + PRIVATE + src/PCH.h) + +install(TARGETS ${PROJECT_NAME} + DESTINATION "${CMAKE_INSTALL_LIBDIR}") + + + +######################################################################################################################## +## Automatic plugin deployment +######################################################################################################################## + +add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/") +add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/") diff --git a/source/Enderal DLL/CMakePresets.json b/source/Enderal DLL/CMakePresets.json new file mode 100644 index 00000000..566eb6bb --- /dev/null +++ b/source/Enderal DLL/CMakePresets.json @@ -0,0 +1,252 @@ +{ + "version": 2, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_FLAGS": "$env{COMMONLIBSSE_COMPILER} $env{COMMONLIBSSE_PLATFORM} $env{COMMONLIBSSE_TEXT}" + } + }, + { + "name": "vcpkg", + "hidden": true, + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "VCPKG_TARGET_TRIPLET": "x64-windows-skse", + "VCPKG_HOST_TRIPLET": "x64-windows-skse", + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake", + "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$:Debug>DLL" + } + }, + { + "name": "win32", + "hidden": true, + "environment": { + "COMMONLIBSSE_PLATFORM": "-DWIN32_LEAN_AND_MEAN -DNOMINMAX" + } + }, + { + "name": "win32-unicode", + "hidden": true, + "inherits": "win32", + "environment": { + "COMMONLIBSSE_TEXT": "-DUNICODE -D_UNICODE" + } + }, + { + "name": "x64", + "hidden": true, + "architecture": { + "value": "x64", + "strategy": "external" + } + }, + { + "name": "msvc", + "hidden": true, + "environment": { + "COMMONLIBSSE_COMPILER": "/permissive- /Zc:preprocessor /EHsc $penv{CXXFLAGS}" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "intelliSenseMode": "windows-msvc-x64", + "enableMicrosoftCodeAnalysis": true, + "enableClangTidyCodeAnalysis": true + } + } + }, + { + "name": "clang-cl", + "hidden": true, + "cacheVariables": { + "CMAKE_C_COMPILER": "clang-cl", + "CMAKE_CXX_COMPILER": "clang-cl" + }, + "environment": { + "COMMONLIBSSE_COMPILER": "/permissive- /EHsc -Wno-overloaded-virtual -Wno-delete-non-abstract-non-virtual-dtor -D__cpp_lib_char8_t -D__cpp_consteval -D__cpp_lib_format $penv{CXXFLAGS}" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "intelliSenseMode": "windows-clang-x64", + "enableMicrosoftCodeAnalysis": true, + "enableClangTidyCodeAnalysis": true + } + } + }, + { + "name": "build-tests", + "displayName": "Build Tests", + "hidden": true, + "description": "Include test suites in the build.", + "cacheVariables": { + "BUILD_TESTS": { + "type": "STRING", + "value": "ON" + } + } + }, + { + "name": "build-release-msvc", + "inherits": [ + "base", + "vcpkg", + "win32-unicode", + "x64", + "build-tests", + "msvc" + ], + "displayName": "Release", + "description": "Optimized release build.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/release-msvc", + "cacheVariables": { + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + } + } + }, + { + "name": "build-debug-msvc", + "inherits": [ + "base", + "vcpkg", + "win32-unicode", + "x64", + "build-tests", + "msvc" + ], + "displayName": "Debug", + "description": "Debug build for testing.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/debug-msvc", + "cacheVariables": { + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + } + } + }, + { + "name": "build-debug-clang-cl", + "inherits": [ + "base", + "vcpkg", + "win32-unicode", + "x64", + "build-tests", + "clang-cl" + ], + "displayName": "Debug", + "description": "Debug build for testing.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/debug-clang", + "cacheVariables": { + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + } + } + }, + { + "name": "build-release-clang-cl", + "inherits": [ + "base", + "vcpkg", + "win32-unicode", + "x64", + "build-tests", + "clang-cl" + ], + "displayName": "Release", + "description": "Optimized release build.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/release-clang", + "cacheVariables": { + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + } + } + } + ], + "buildPresets": [ + { + "name": "release-msvc", + "displayName": "Release (MSVC)", + "configurePreset": "build-release-msvc", + "description": "Optimized release build." + }, + { + "name": "debug-msvc", + "displayName": "Debug (MSVC)", + "configurePreset": "build-debug-msvc", + "description": "Debug build for testing." + }, + { + "name": "release-clang-cl", + "displayName": "Release (Clang)", + "configurePreset": "build-release-clang-cl", + "description": "Optimized release build." + }, + { + "name": "debug-clang-cl", + "displayName": "Debug (Clang)", + "configurePreset": "build-debug-clang-cl", + "description": "Debug build for testing." + } + ], + "testPresets": [ + { + "name": "tests-all", + "displayName": "All Tests", + "configurePreset": "build-debug-msvc", + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "stopOnFailure": false + } + }, + { + "name": "tests-unit", + "displayName": "Unit Tests", + "description": "Runs tests that do not require any Skyrim module loaded into the process.", + "inherits": "tests-all", + "filter": { + "exclude": { + "label": "[integration],[e2e]" + } + } + }, + { + "name": "tests-integration", + "displayName": "Integration Tests", + "description": "Runs tests that interact with a Skyrim module at rest (do not require the Skyrim module to have run any main function).", + "inherits": "tests-all", + "filter": { + "include": { + "label": "[integration]" + } + } + }, + { + "name": "tests-e2e", + "displayName": "End-to-End Tests", + "description": "Runs test that depend on a fully running Skyrim engine in the process.", + "inherits": "tests-all", + "filter": { + "include": { + "label": "[e2e]" + } + } + } + ] +} diff --git a/source/Enderal DLL/cmake/version.rc.in b/source/Enderal DLL/cmake/version.rc.in new file mode 100644 index 00000000..b1d91ed9 --- /dev/null +++ b/source/Enderal DLL/cmake/version.rc.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4329f800ad76e7ec3d7178d3d429230d1258284bf9b26f5b8ffdc97475f41280 +size 933 diff --git a/source/Enderal DLL/cmake/x64-windows-skse.cmake b/source/Enderal DLL/cmake/x64-windows-skse.cmake new file mode 100644 index 00000000..4eedaa8f --- /dev/null +++ b/source/Enderal DLL/cmake/x64-windows-skse.cmake @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a16e5b30471c2f50b6fe6bae55f973efa2768d5871966ae4ee51c5339873ef42 +size 227 diff --git a/source/fs.dll/fs/HasInvalidCells.h b/source/Enderal DLL/src/CheckInvalidForms.h similarity index 50% rename from source/fs.dll/fs/HasInvalidCells.h rename to source/Enderal DLL/src/CheckInvalidForms.h index e0591906..b38ffb61 100644 --- a/source/fs.dll/fs/HasInvalidCells.h +++ b/source/Enderal DLL/src/CheckInvalidForms.h @@ -1,13 +1,60 @@ #pragma once -#include "skse64/GameForms.h" +static bool bMessageShown = false; -inline bool HasInvalidCells() +static std::unordered_set aModNames; + +inline void NotifyInvalidForm(const RE::TESForm* form) +{ + if (!form) { + if (!bMessageShown) { + bMessageShown = true; + RE::DebugMessageBox("Some of the installed mods are incompatible with Enderal."); + } + return; + } + + if (!bMessageShown) { + bMessageShown = true; + RE::DebugMessageBox(std::format("{} is incompatible with Enderal.\nCheck console for the list of flagged mods.", form->GetFile()->fileName).c_str()); + RE::ConsoleLog::GetSingleton()->Print("Some of the installed mods are incompatible! This list is not exhaustive, always use xEdit to verify mod compatibility."); + } + + if (!aModNames.contains(form->GetFile()->fileName)) { + aModNames.insert(form->GetFile()->fileName); + RE::ConsoleLog::GetSingleton()->Print(std::format("{} is incompatible", form->GetFile()->fileName).c_str()); + } +} + +inline void CheckWorldspaces() +{ + auto* form = RE::TESForm::LookupByID(0x3C); // Tamriel + if (form) { + RE::TESWorldSpace* world = form->As(); + if (!world || std::string(world->editorID) != "MQP01Home") { + NotifyInvalidForm(form); + } + } else { + if (!bMessageShown) { + bMessageShown = true; + RE::ConsoleLog::GetSingleton()->Print("Some of the installed mods are incompatible! This list is not exhaustive, always use xEdit to verify mod compatibility."); + RE::DebugMessageBox("Some of the installed mods are incompatible with Enderal."); + } + } + + form = RE::TESForm::LookupByID(0x16BB4); // RiftenWorld + RE::TESWorldSpace* world = form ? form->As() : nullptr; + if (world) { + NotifyInvalidForm(form); + } +} + +inline void CheckSkyrimCells() { // FormIDs of all Skyrim cells. // 9 of them are commented out, because they are cells in Enderal as well. - UInt32 formids[582] = { + uint32_t formids[582] = { 0x0004B8FB, 0x000352C7, 0x000161E7, @@ -600,13 +647,452 @@ inline bool HasInvalidCells() 0x00027D1C }; - bool result = false; for (int i = 0; i < 582; i++) { - if ((TESObjectCELL*)LookupFormByID(formids[i])) { - _MESSAGE("Detected invalid cell: %#08x", formids[i]); - result = true; + const auto* form = RE::TESForm::LookupByID(formids[i]); + if (form && form->Is(RE::FormType::Cell)) { + logger::warn("Detected invalid cell: {:08X}", formids[i]); + NotifyInvalidForm(form); + } + } + + //memset(formids, 0, sizeof(formids)); +} + +inline void CheckEnderalCells() +{ + // FormIDs of all Enderal cells. + + uint32_t formids[415] = { + 0x0014DB0F, + 0x00114BBB, + 0x00108AC3, + 0x00106863, + 0x000E67E3, + 0x000DCBA3, + 0x000A1E3B, + 0x0008320B, + 0x0006A8AF, + 0x00050B67, + 0x00043DEF, + 0x0003E737, + 0x000E4961, + 0x00030F8D, + 0x0014F6B7, + 0x001080EB, + 0x0008613B, + 0x0010E671, + 0x000ED971, + 0x000EB581, + 0x000C0E35, + 0x00055DB5, + 0x0012F42F, + 0x000905FF, + 0x00069C6B, + 0x00012C3B, + 0x000DABCD, + 0x00081299, + 0x0005C971, + 0x0004D5B1, + 0x000E2CAB, + 0x0005530B, + 0x000299C7, + 0x0007F65B, + 0x0007336F, + 0x0005BCD3, + 0x0013FB45, + 0x0011C4DD, + 0x000A5F1D, + 0x00072B95, + 0x00069C9D, + 0x00149B58, + 0x0012DAE8, + 0x000E4960, + 0x000B5264, + 0x0009B710, + 0x000ED97A, + 0x000C0E3E, + 0x0009FD56, + 0x00024BCE, + 0x000C0E34, + 0x0008783C, + 0x000528F8, + 0x00033494, + 0x00009900, + 0x000EA95A, + 0x000C566E, + 0x0004145E, + 0x00015282, + 0x000FE108, + 0x0007FBF0, + 0x000098EC, + 0x0011DC6A, + 0x00102DF2, + 0x00074AF2, + 0x0005530A, + 0x000299C6, + 0x00010A84, + 0x0014B5A2, + 0x0007F65A, + 0x0007336E, + 0x0006C032, + 0x00030FAA, + 0x0012EF4C, + 0x0011C4DC, + 0x000A5F1C, + 0x00096D50, + 0x0004BC88, + 0x00046ECC, + 0x00130C29, + 0x00070799, + 0x00149B57, + 0x000E495F, + 0x000A5C4B, + 0x00074547, + 0x00004E77, + 0x000ED979, + 0x000C0E3D, + 0x0009FD55, + 0x00024BCD, + 0x001461D7, + 0x0008783B, + 0x000528F7, + 0x00033493, + 0x000D9B6D, + 0x000C566D, + 0x0007FA69, + 0x0004145D, + 0x000375C5, + 0x00032999, + 0x000D8E1B, + 0x000D89CF, + 0x0006FECF, + 0x001344F5, + 0x00127E21, + 0x0011DC69, + 0x00102DF1, + 0x000CBEA5, + 0x00074AF1, + 0x00033B19, + 0x00000025, + 0x0011847B, + 0x0006E4F3, + 0x000169D3, + 0x00089B95, + 0x000028B1, + 0x000A5F1B, + 0x00083213, + 0x00069C9B, + 0x00130C28, + 0x000E495E, + 0x0009B70E, + 0x00147F2C, + 0x00117890, + 0x000ED978, + 0x000C0E3C, + 0x00055DBC, + 0x00024BCC, + 0x0008783A, + 0x000250D6, + 0x00127538, + 0x000D9B6C, + 0x000813CC, + 0x00045A48, + 0x00021634, + 0x00014B78, + 0x0011B1DE, + 0x0006FECE, + 0x000399AA, + 0x000098EA, + 0x00127E20, + 0x0011DC68, + 0x00102DF0, + 0x000CBEA4, + 0x000A5894, + 0x00067288, + 0x0011847A, + 0x0006E4F2, + 0x00089B94, + 0x0007336C, + 0x0004C26C, + 0x00083212, + 0x0003C4DE, + 0x00128CCF, + 0x000D340F, + 0x000E495D, + 0x000A82F5, + 0x000405A1, + 0x00147F2B, + 0x0013D0F3, + 0x000ED977, + 0x000D24BF, + 0x000C0E3B, + 0x00055DBB, + 0x0009710D, + 0x00015671, + 0x00098553, + 0x000813CB, + 0x0015295D, + 0x0012AB15, + 0x00085A75, + 0x0006FECD, + 0x000399A9, + 0x000098E9, + 0x00127E1F, + 0x0011DC67, + 0x000A5893, + 0x000848D7, + 0x0007075B, + 0x00067287, + 0x001130E1, + 0x0010FF45, + 0x0010A829, + 0x000DD775, + 0x000CEB85, + 0x000CD6D1, + 0x0006E4F1, + 0x000DEDAF, + 0x000A19FF, + 0x00089B93, + 0x0004C26B, + 0x0002BA7F, + 0x000BCB8D, + 0x00083211, + 0x0004B25D, + 0x001503AA, + 0x0013F5BE, + 0x0013B612, + 0x00128CCE, + 0x000CAFA2, + 0x000E495C, + 0x0009B70C, + 0x00020AFC, + 0x0010D1C2, + 0x000ED976, + 0x000D24BE, + 0x000C0E3A, + 0x000AECC6, + 0x00055DBA, + 0x00009906, + 0x001514BC, + 0x0009855C, + 0x0009710C, + 0x00090988, + 0x0006C768, + 0x00036A14, + 0x000098FC, + 0x000E041A, + 0x000D9B6A, + 0x00082432, + 0x0015295C, + 0x0012AB14, + 0x0010BBC4, + 0x00085A74, + 0x0006FECC, + 0x000098E8, + 0x0014E5BE, + 0x00127E1E, + 0x001152E6, + 0x000848D6, + 0x001130E0, + 0x000CEB84, + 0x0007D400, + 0x00076E70, + 0x0006E4F0, + 0x000EFFE6, + 0x000DEDAE, + 0x000E1A2C, + 0x000CC974, + 0x000BCB8C, + 0x00083210, + 0x00128CCD, + 0x00119B01, + 0x000CAFA1, + 0x000A9EB9, + 0x00078625, + 0x000E495B, + 0x000DE74F, + 0x000B525F, + 0x0009B70B, + 0x00020AFB, + 0x0000990F, + 0x00143B31, + 0x0010D1C1, + 0x000ED975, + 0x000D74D1, + 0x000D24BD, + 0x000AECC5, + 0x0008D791, + 0x00055DB9, + 0x00009905, + 0x00133E07, + 0x0011267B, + 0x000C6677, + 0x0009855B, + 0x0009710B, + 0x00090987, + 0x00143479, + 0x0011F9C5, + 0x000D9B69, + 0x0015295B, + 0x00102947, + 0x000C3913, + 0x00089123, + 0x00085A73, + 0x0006FECB, + 0x0013CA25, + 0x00129141, + 0x00127E1D, + 0x000848D5, + 0x00056A11, + 0x0013CF2F, + 0x001130DF, + 0x000CEB83, + 0x0008E957, + 0x0007D3FF, + 0x00079F43, + 0x0006E4EF, + 0x000DEDAD, + 0x00086739, + 0x000BCB8B, + 0x0008320F, + 0x00144954, + 0x000A9EB8, + 0x0007EB50, + 0x0001CB58, + 0x000E495A, + 0x000DE74E, + 0x000B525E, + 0x00004382, + 0x00143B30, + 0x000ED974, + 0x000D24BC, + 0x000C0E38, + 0x000AECC4, + 0x0005A728, + 0x00055DB8, + 0x00022904, + 0x00009904, + 0x00133E06, + 0x0012E492, + 0x000C6676, + 0x0009855A, + 0x0009710A, + 0x00069C6E, + 0x00019C50, + 0x0015295A, + 0x0012AB12, + 0x0006FECA, + 0x000098E6, + 0x000FF034, + 0x000EB818, + 0x000C91B4, + 0x0009B228, + 0x000848D4, + 0x001130DE, + 0x00100C4A, + 0x000CEB82, + 0x0007D3FE, + 0x0006E4EE, + 0x0001A01A, + 0x0011F744, + 0x000DEDAC, + 0x00086738, + 0x0007BC20, + 0x000ACECE, + 0x0008320E, + 0x00081CF6, + 0x00048F32, + 0x0003E73A, + 0x00011046, + 0x000A9EB7, + 0x000780AB, + 0x000E4959, + 0x000B525D, + 0x00045101, + 0x001461DB, + 0x00107EEF, + 0x000ED973, + 0x000C0E37, + 0x000AECC3, + 0x0005A727, + 0x00055DB7, + 0x00034D97, + 0x00009903, + 0x001514B9, + 0x0012E491, + 0x00103F39, + 0x000C5671, + 0x0005AE7F, + 0x000A2635, + 0x0006FEC9, + 0x0003D825, + 0x000FF033, + 0x000EB817, + 0x0009B227, + 0x001315A1, + 0x00127515, + 0x001130DD, + 0x00100C49, + 0x000DD771, + 0x000A51E1, + 0x0007A7D9, + 0x0012511B, + 0x0011C4DF, + 0x000F524F, + 0x000DEDAB, + 0x000ACECD, + 0x0008320D, + 0x00081CF5, + 0x00048F31, + 0x0003E739, + 0x0013584E, + 0x00030F8E, + 0x0013EB88, + 0x000E77D4, + 0x000E4958, + 0x0012A552, + 0x0010E672, + 0x000C0E36, + 0x0007284E, + 0x001514B8, + 0x00136C80, + 0x0012E490, + 0x000C5670, + 0x001421B6, + 0x000E040C, + 0x00098D14, + 0x0005530C, + 0x00043A94, + 0x000FF032, + 0x0009B226, + 0x001130DC, + 0x000A51E0, + 0x0008AD90, + 0x0013FB46, + 0x001346CE, + 0x0011C4DE, + 0x000DEDAA, + 0x0007B89A, + 0x00130C2C, + 0x00106864, + 0x000DCBA4, + 0x000A1E3C, + 0x0008320C + }; + + for (int i = 0; i < 415; i++) { + const auto* form = RE::TESForm::LookupByID(formids[i]); + if (!form) { + if (!bMessageShown) { + bMessageShown = true; + RE::DebugMessageBox("Some of the installed mods are incompatible with Enderal.\nCheck console for the list of flagged mods."); + } + } else if (!form->Is(RE::FormType::Cell)) { + logger::warn("Detected invalid cell: {:08X}", formids[i]); + NotifyInvalidForm(form); } } - return result; + //memset(formids, 0, sizeof(formids)); + aModNames.clear(); } diff --git a/source/Enderal DLL/src/EventListener.cpp b/source/Enderal DLL/src/EventListener.cpp new file mode 100644 index 00000000..e9bd0a3b --- /dev/null +++ b/source/Enderal DLL/src/EventListener.cpp @@ -0,0 +1,64 @@ +#include "EventListener.h" +#include "Util.h" + +auto EventListener::GetSingleton() -> EventListener* +{ + static EventListener singleton{}; + return std::addressof(singleton); +} + +void EventListener::Install() +{ + RE::ScriptEventSourceHolder::GetSingleton()->AddEventSink(EventListener::GetSingleton()); + RE::UI::GetSingleton()->AddEventSink(EventListener::GetSingleton()); +} + +auto EventListener::ProcessEvent( + const SKSE::ModCallbackEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl +{ + // + + return RE::BSEventNotifyControl::kContinue; +} + +auto EventListener::ProcessEvent( + const RE::TESContainerChangedEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl +{ + // + + return RE::BSEventNotifyControl::kContinue; +} + +auto EventListener::ProcessEvent( + const RE::MenuOpenCloseEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl +{ + + + if (a_event->menuName == "ContainerMenu") { + #ifdef _DEBUG + SKSE::log::info("MenuOpenCloseEvent"); + #endif + + bool bOpening = a_event->opening; + + // + } + + return RE::BSEventNotifyControl::kContinue; +} + +auto EventListener::ProcessEvent( + const RE::TESActivateEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl +{ + // + + return RE::BSEventNotifyControl::kContinue; +} diff --git a/source/Enderal DLL/src/EventListener.h b/source/Enderal DLL/src/EventListener.h new file mode 100644 index 00000000..a6fd6c75 --- /dev/null +++ b/source/Enderal DLL/src/EventListener.h @@ -0,0 +1,42 @@ +#pragma once + +class EventListener : + public RE::BSTEventSink, + public RE::BSTEventSink, + public RE::BSTEventSink, + public RE::BSTEventSink +{ +public: + ~EventListener() = default; + EventListener(const EventListener&) = delete; + EventListener& operator=(const EventListener&) = delete; + EventListener& operator=(EventListener&&) = delete; + + static auto GetSingleton() -> EventListener*; + + static void Install(); + + auto ProcessEvent( + const RE::TESContainerChangedEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl override; + + + auto ProcessEvent( + const RE::MenuOpenCloseEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl override; + + auto ProcessEvent( + const SKSE::ModCallbackEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl override; + + auto ProcessEvent( + const RE::TESActivateEvent* a_event, + RE::BSTEventSource* a_eventSource) + -> RE::BSEventNotifyControl override; + +private: + EventListener() = default; +}; \ No newline at end of file diff --git a/source/Enderal DLL/src/FlatMapMarkers.h b/source/Enderal DLL/src/FlatMapMarkers.h new file mode 100644 index 00000000..3c0bc2f2 --- /dev/null +++ b/source/Enderal DLL/src/FlatMapMarkers.h @@ -0,0 +1,20 @@ +#pragma once + +#include "Util.h" + +// Based on Ryan McKenzie's Flat Map Markers +namespace FlatMapMarkers +{ + inline void Hook_WorldPtToScreenPt3(RE::NiCamera* a_camera, RE::NiPoint3& a_in, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance) + { + a_in.z = 100000.156250; + RE::NiCamera::WorldPtToScreenPt3(a_camera->GetRuntimeData().worldToCam, a_camera->GetRuntimeData2().port, a_in, a_xOut, a_yOut, a_zOut, a_zeroTolerance); + } + + inline void Install() + { + REL::Relocation offset{ RELOCATION_ID(52224, 53111), IsSE() ? 0x22F : 0x21F }; + auto& trampoline = SKSE::GetTrampoline(); + trampoline.write_call<5>(offset.address(), &Hook_WorldPtToScreenPt3); + } +} diff --git a/source/Enderal DLL/src/Main.cpp b/source/Enderal DLL/src/Main.cpp new file mode 100644 index 00000000..4f88160b --- /dev/null +++ b/source/Enderal DLL/src/Main.cpp @@ -0,0 +1,126 @@ +#include "EventListener.h" +#include "Util.h" +#include "Papyrus.h" +#include "FlatMapMarkers.h" +#include "StayAtSystemPage.h" + +using namespace SKSE; + +static std::map g_settings{ + { "FlatMapMarkers", true }, + { "StayAtSystemPage", true } +}; + +namespace { + + void InitializeLogging() { + auto path = logger::log_directory(); + if (!path) { + SKSE::stl::report_and_fail("Failed to find standard logging directory"sv); + } + + *path /= "EnderalSE.log"sv; + auto sink = std::make_shared(path->string(), true); + + auto log = std::make_shared("global log"s, std::move(sink)); + + log->set_level(spdlog::level::info); + log->flush_on(spdlog::level::info); + + spdlog::set_default_logger(std::move(log)); + spdlog::set_pattern("[%l] %v"s); + } + + void InitializeMessaging() + { + GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) { + if (message->type == MessagingInterface::kPostLoad) { + if ((std::filesystem::exists("Data\\Dawnguard.esm") && std::filesystem::file_size("Data\\Dawnguard.esm") > 1000000) || (std::filesystem::exists("Data\\Dragonborn.esm") && std::filesystem::file_size("Data\\Dragonborn.esm") > 1000000) || (std::filesystem::exists("Data\\HearthFires.esm") && std::filesystem::file_size("Data\\HearthFires.esm") > 1000000) || (std::filesystem::exists("Data\\Update.esm") && std::filesystem::file_size("Data\\Update.esm") > 1000000)) { + MessageBoxW(NULL, L"Skyrim DLCs are incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + if (std::filesystem::exists("Data\\Unofficial Skyrim Special Edition Patch.esp")) { + MessageBoxW(NULL, L"Unofficial Skyrim Special Edition Patch is incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + if (std::filesystem::exists("Data\\ccBGSSSE001-Fish.esm") || std::filesystem::exists("Data\\ccBGSSSE025-AdvDSGS.esm") || std::filesystem::exists("Data\\ccBGSSSE037-Curios.esl") || std::filesystem::exists("Data\\ccQDRSSE001-SurvivalMode.esl")) { + MessageBoxW(NULL, L"Creation Club mods are incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + + if (g_settings.at("StayAtSystemPage")) { + if (const auto pluginInfo = GetLoadInterface()->GetPluginInfo("StayAtSystemPage"); pluginInfo) { + MessageBoxW(NULL, L"Stay At The System Page is already included in Enderal, please, disable it.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + } + if (g_settings.at("FlatMapMarkers")) { + if (const auto pluginInfo = GetLoadInterface()->GetPluginInfo("FlatMapMarkersSSE"); pluginInfo) { + MessageBoxW(NULL, L"Flat Map Markers is already included in Enderal, please, disable it (remove file Data\\SKSE\\Plugins\\FlatMapMarkersSSE.dll).", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + } + + SetINISettings(); + EventListener::Install(); + + } else if (message->type == MessagingInterface::kPostPostLoad) { + // + } else if (message->type == MessagingInterface::kDataLoaded) { + const auto dataHandler = RE::TESDataHandler::GetSingleton(); + if (dataHandler) { + if (!dataHandler->LookupLoadedModByName("Update.esm")) { + MessageBoxW(NULL, L"Update.esm is not loaded!", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + if (!dataHandler->LookupLoadedModByName("Enderal - Forgotten Stories.esm")) { + MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + } + const auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton(); + if (!vm->TypeIsValid("_00e_questfunctions")) { + MessageBoxW(NULL, L"One or more of Enderal's BSA archives are not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + CheckIncompatibleMods(); + } else if (message->type == MessagingInterface::kPreLoadGame) { + // + } else if ((message->type == MessagingInterface::kPostLoadGame && message->data) || message->type == MessagingInterface::kNewGame) { + NewGameCount(true); + } + }); + } +} + +SKSEPluginLoad(const LoadInterface* skse) { + + GetLoadInterface(skse); + + InitializeLogging(); + + auto* plugin = PluginDeclaration::GetSingleton(); + auto version = plugin->GetVersion(); + logger::info("{} {} is loading...", plugin->GetName(), version); + + LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini"); + + Init(skse); + InitializeMessaging(); + + GetPapyrusInterface()->Register(Papyrus::Bind); + + if (skse->RuntimeVersion() != RUNTIME_VR_1_4_15 && skse->RuntimeVersion() != RUNTIME_LATEST_VR && g_settings.at("FlatMapMarkers")) { + logger::info("Initializing Flat Map Markers..."); + SKSE::AllocTrampoline(1 << 4); + FlatMapMarkers::Install(); + } + + if (g_settings.at("StayAtSystemPage")) { + logger::info("Initializing Stay At The System Page..."); + JournalMenuEx::InstallHooks(); + } + + logger::info("{} has finished loading.", plugin->GetName()); + return true; +} diff --git a/source/Enderal DLL/src/PCH.h b/source/Enderal DLL/src/PCH.h new file mode 100644 index 00000000..eed4d90a --- /dev/null +++ b/source/Enderal DLL/src/PCH.h @@ -0,0 +1,120 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#undef cdecl // Workaround for Clang 14 CMake configure error. + +#include +#include + +// Compatible declarations with other sample projects. +#define DLLEXPORT __declspec(dllexport) + +using namespace std::literals; +using namespace REL::literals; + +namespace logger = SKSE::log; + +namespace util { + using SKSE::stl::report_and_fail; +} diff --git a/source/Enderal DLL/src/Papyrus.cpp b/source/Enderal DLL/src/Papyrus.cpp new file mode 100644 index 00000000..2b7ecaa8 --- /dev/null +++ b/source/Enderal DLL/src/Papyrus.cpp @@ -0,0 +1,21 @@ +#include "Papyrus.h" +#include "PapyrusFunctions.h" +#include "PhasmalistFunctions.h" + +namespace Papyrus +{ + bool Bind(VM* a_vm) + { + if (!a_vm) { + logger::critical("couldn't get VM State"sv); + return false; + } + + logger::info("{:*^30}", "FUNCTIONS"sv); + + PapyrusFunctions::Bind(*a_vm); + PhasmalistFunctions::Bind(*a_vm); + + return true; + } +} diff --git a/source/Enderal DLL/src/Papyrus.h b/source/Enderal DLL/src/Papyrus.h new file mode 100644 index 00000000..73bc20c5 --- /dev/null +++ b/source/Enderal DLL/src/Papyrus.h @@ -0,0 +1,15 @@ +#pragma once + +#define BIND(a_method, ...) a_vm.RegisterFunction(#a_method##sv, script, a_method __VA_OPT__(, ) __VA_ARGS__) + +#include + +namespace Papyrus { + using VM = RE::BSScript::Internal::VirtualMachine; + using StackID = RE::VMStackID; + using Severity = RE::BSScript::ErrorLogger::Severity; + + inline constexpr auto script = "EnderalFunctions"sv; + + bool Bind(VM* a_vm); +} diff --git a/source/Enderal DLL/src/PapyrusFunctions.h b/source/Enderal DLL/src/PapyrusFunctions.h new file mode 100644 index 00000000..c57420a5 --- /dev/null +++ b/source/Enderal DLL/src/PapyrusFunctions.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Util.h" +#include "PersistentFormManager.h" + +namespace Papyrus::PapyrusFunctions +{ + inline RE::AlchemyItem* CreatePotion(RE::StaticFunctionTag*, std::vector effects, std::vector magnitudes, std::vector areas, std::vector durations, uint32_t arraySize) + { + RE::AlchemyItem* result = NULL; + + if (effects.size() >= arraySize && magnitudes.size() >= arraySize && areas.size() >= arraySize && durations.size() >= arraySize) { + RE::tArray effectItems; + effectItems.Allocate(effects.size()); + + uint16_t count = 0; + for (uint16_t i = 0; i < effects.size(); ++i) { + if (effects[i]) { + effectItems[i].baseEffect = effects[i]; + effectItems[i].effectItem.duration = durations[i]; + effectItems[i].effectItem.magnitude = magnitudes[i]; + effectItems[i].effectItem.area = areas[i]; + count++; + } + } + effectItems.count = count; + + RE::PersistentFormManager::GetSingleton()->CreatePotion(&result, &effectItems); + + effectItems.Clear(); + } else { + logger::warn("Illegal arrays for creating a potion"); + } + + return result; + } + + inline uint8_t GetNewGameCount(RE::StaticFunctionTag*) + { + return NewGameCount(); + } + + inline RE::TESObjectREFR* GetCurrentContainer(RE::StaticFunctionTag*) + { + const auto handle = RE::ContainerMenu::GetTargetRefHandle(); + const auto refr = RE::TESObjectREFR::LookupByHandle(handle); + return refr ? refr.get() : nullptr; + } + + inline void Bind(VM& a_vm) + { + BIND(CreatePotion); + logger::info("Registered CreatePotion"sv); + BIND(GetNewGameCount); + logger::info("Registered GetNewGameCount"sv); + BIND(GetCurrentContainer); + logger::info("Registered GetCurrentContainer"sv); + } +} diff --git a/source/Enderal DLL/src/PersistentFormManager.h b/source/Enderal DLL/src/PersistentFormManager.h new file mode 100644 index 00000000..98add91e --- /dev/null +++ b/source/Enderal DLL/src/PersistentFormManager.h @@ -0,0 +1,346 @@ +#pragma once + +namespace RE +{ + // 18 + template + class tArray + { + public: + T* entries; // 00 + uint32_t capacity; // 08 + uint32_t pad0C; // 0C + uint32_t count; // 10 + uint32_t pad14; // 14 + + tArray() : + entries(NULL), capacity(0), count(0), pad0C(0), pad14(0) {} + + T& operator[](uint64_t index) + { + return entries[index]; + } + + RE::MemoryManager* Heap() + { + return RE::MemoryManager::GetSingleton(); + } + + void Clear() + { + Heap()->Deallocate(entries, false); + entries = NULL; + capacity = 0; + count = 0; + } + + bool Allocate(uint32_t numEntries) + { + entries = (T*)Heap()->Allocate(sizeof(T) * numEntries, 0, false); + if (!entries) + return false; + + for (uint32_t i = 0; i < numEntries; i++) + new (&entries[i]) T; + + capacity = numEntries; + count = numEntries; + + return true; + } + + bool CopyFrom(const tArray* rhs) + { + if (rhs->count == 0) + return false; + if (!rhs->entries) + return false; + + if (entries) + Clear(); + + if (!Allocate(rhs->count)) + return false; + memcpy(entries, rhs->entries, sizeof(T) * count); + return true; + } + + bool Resize(uint32_t numEntries) + { + if (numEntries == capacity) + return false; + + if (!entries) { + Allocate(numEntries); + return true; + } + if (numEntries < capacity) { + // Delete the truncated entries + for (uint32_t i = numEntries; i < capacity; i++) + delete &entries[i]; + } + + T* newBlock = (T*)Heap()->Allocate(sizeof(T) * numEntries, 0, false); // Create a new block + memmove_s(newBlock, sizeof(T) * numEntries, entries, sizeof(T) * numEntries); // Move the old memory to the new block + if (numEntries > capacity) { // Fill in new remaining entries + for (uint32_t i = capacity; i < numEntries; i++) + new (&entries[i]) T; + } + Heap()->Deallocate(entries, false); // Free the old block + entries = newBlock; // Assign the new block + capacity = numEntries; // Capacity is now the number of total entries in the block + count = std::min(capacity, count); // Count stays the same, or is truncated to capacity + return true; + } + + bool Push(const T& entry) + { + if (!entries || count + 1 > capacity) { + if (!Grow(nGrow)) + return false; + } + + new (&entries[count]) T(entry); + count++; + return true; + }; + + bool Insert(uint32_t index, const T& entry) + { + if (!entries || index < count) + return false; + + entries[index] = entry; + return true; + }; + + bool Remove(uint32_t index) + { + if (!entries || index >= count) + return false; + + // This might not be right for pointer types... + (&entries[index])->~T(); + + if (index + 1 < count) { + uint32_t remaining = count - index; + memmove_s(&entries[index + 1], sizeof(T) * remaining, &entries[index], sizeof(T) * remaining); // Move the rest up + } + count--; + + if (capacity > count + nShrink) + Shrink(); + + return true; + } + + bool Shrink() + { + if (!entries || count == capacity) + return false; + + try { + uint32_t newSize = count; + T* oldArray = entries; + T* newArray = (T*)Heap()->Allocate(sizeof(T) * newSize, 0, false); // Allocate new block + memmove_s(newArray, sizeof(T) * newSize, entries, sizeof(T) * newSize); // Move the old block + entries = newArray; + capacity = count; + Heap()->Deallocate(oldArray, false); // Free the old block + return true; + } catch (...) { + return false; + } + + return false; + } + + bool Grow(uint32_t numEntries) + { + if (!entries) { + entries = (T*)Heap()->Allocate(sizeof(T) * numEntries, 0, false); + count = 0; + capacity = numEntries; + return true; + } + + try { + uint32_t oldSize = capacity; + uint32_t newSize = oldSize + numEntries; + T* oldArray = entries; + T* newArray = (T*)Heap()->Allocate(sizeof(T) * newSize, 0, false); // Allocate new block + if (oldArray) + memmove_s(newArray, sizeof(T) * newSize, entries, sizeof(T) * capacity); // Move the old block + entries = newArray; + capacity = newSize; + + if (oldArray) + Heap()->Deallocate(oldArray, false); // Free the old block + + for (uint32_t i = oldSize; i < newSize; i++) // Allocate the rest of the free blocks + new (&entries[i]) T; + + return true; + } catch (...) { + return false; + } + + return false; + } + + bool GetNthItem(uint64_t index, T& pT) const + { + if (index < count) { + pT = entries[index]; + return true; + } + return false; + } + + int64_t GetItemIndex(T& pFind) const + { + for (uint64_t n = 0; n < count; n++) { + T& pT = entries[n]; + if (pT == pFind) + return n; + } + return -1; + } + }; + + typedef tArray UnkArray; + typedef tArray UnkFormArray; + + // D0 + class PersistentFormManager + { + public: + // 10 + struct EnchantData + { + EnchantmentItem* enchantment; // 00 + volatile long refCount; // 08 + uint32_t pad; // 0C + }; + + uint64_t unk00; // 00 + tArray weaponEnchants; // 08 + tArray armorEnchants; // 20 + uint64_t unk38; // 38 + uint32_t unk40; // 40 + uint32_t unk44; // 44 + uint32_t unk48; // 48 + uint32_t unk4C; // 4C + + // 30 + struct Data + { + void* unk00; // 00 + uint64_t unk08; // 08 + void* unk10; // 10 + uint64_t unk18; // 18 + uint32_t unk20; // 20 + uint32_t unk24; // 24 + uint32_t unk28; // 28 + uint32_t unk2C; // 2C + }; + + Data unk50; // 50 + Data unk80; // 80 + void* unkB0; // B0 + uint64_t unkB8; // B8 + uint64_t unkC0; // C0 + uint64_t unkC8; // C8 + + //RelocPtr g_persistentFormManager(0x01EBEAE8); // SE + //RelocPtr g_persistentFormManager(0x01F5A468); // AE + [[nodiscard]] static PersistentFormManager* GetSingleton() + { + REL::Relocation singleton{ RELOCATION_ID(514172, 400320) }; + return *singleton; + } + + void IncRefEnchantment(EnchantmentItem* enchantment) + { + if (enchantment && enchantment->formID >= 0xFF000000) { + for (uint32_t i = 0; i < weaponEnchants.count; i++) { + EnchantData foundData; + weaponEnchants.GetNthItem(i, foundData); + if (foundData.enchantment == enchantment) { + InterlockedIncrement(&weaponEnchants[i].refCount); + break; + } + } + for (uint32_t i = 0; i < armorEnchants.count; i++) { + EnchantData foundData; + armorEnchants.GetNthItem(i, foundData); + if (foundData.enchantment == enchantment) { + InterlockedIncrement(&armorEnchants[i].refCount); + break; + } + } + } + } + + // The game doesn't bother to dec ref or even delete custom enchants + // when they are no longer used, maybe we can fix this? + void DecRefEnchantment(EnchantmentItem* enchantment) + { + if (enchantment && enchantment->formID >= 0xFF000000) { + for (uint32_t i = 0; i < weaponEnchants.count; i++) { + EnchantData foundData; + weaponEnchants.GetNthItem(i, foundData); + if (foundData.enchantment == enchantment) { + if (!InterlockedDecrement(&weaponEnchants[i].refCount)) + ScheduleForDeletion(enchantment); + break; + } + } + for (uint32_t i = 0; i < armorEnchants.count; i++) { + EnchantData foundData; + armorEnchants.GetNthItem(i, foundData); + if (foundData.enchantment == enchantment) { + if (!InterlockedDecrement(&armorEnchants[i].refCount)) + ScheduleForDeletion(enchantment); + break; + } + } + } + } + + //MEMBER_FN_PREFIX(PersistentFormManager); + + // SE + /* + DEFINE_MEMBER_FN(CreateOffensiveEnchantment, EnchantmentItem*, 0x0059F0F0, tArray* effectArray); + DEFINE_MEMBER_FN(CreateDefensiveEnchantment, EnchantmentItem*, 0x0059F190, tArray* effectArray); + DEFINE_MEMBER_FN(CreatePoison, void, 0x0059F2E0, tArray* effectArray, AlchemyItem** poison); + DEFINE_MEMBER_FN(CreatePotion, void, 0x0059F230, AlchemyItem** potion, tArray* effectArray); + DEFINE_MEMBER_FN(ScheduleForDeletion, void, 0x0059F6E0, TESForm*); + */ + + // AE + /* + DEFINE_MEMBER_FN(CreateOffensiveEnchantment, EnchantmentItem*, 0x005C1350, tArray* effectArray); + DEFINE_MEMBER_FN(CreateDefensiveEnchantment, EnchantmentItem*, 0x005C13F0, tArray* effectArray); + DEFINE_MEMBER_FN(CreatePoison, void, 0x005C1540, tArray* effectArray, AlchemyItem** poison); + DEFINE_MEMBER_FN(CreatePotion, void, 0x005C1490, AlchemyItem** potion, tArray* effectArray); + DEFINE_MEMBER_FN(ScheduleForDeletion, void, 0x005C1870, TESForm*); + */ + + void CreatePotion(AlchemyItem** potion, tArray* effectArray) + { + using func_t = decltype(&PersistentFormManager::CreatePotion); + REL::Relocation func{ RELOCATION_ID(35265, 36167) }; + return func(this, potion, effectArray); + } + + void ScheduleForDeletion(TESForm* form) + { + using func_t = decltype(&PersistentFormManager::ScheduleForDeletion); + REL::Relocation func{ RELOCATION_ID(35269, 36171) }; + return func(this, form); + } + }; + //STATIC_ASSERT(sizeof(PersistentFormManager) == 0xD0); +} \ No newline at end of file diff --git a/source/Enderal DLL/src/PhasmalistFunctions.h b/source/Enderal DLL/src/PhasmalistFunctions.h new file mode 100644 index 00000000..1dae75d2 --- /dev/null +++ b/source/Enderal DLL/src/PhasmalistFunctions.h @@ -0,0 +1,159 @@ +#pragma once + +namespace Papyrus::PhasmalistFunctions +{ + static constexpr float magicWeight = 0.1; + + float getMagicEffectStrength(RE::EffectSetting* magicEffect, float magnitude, float area, float duration) + { + float result = magicEffect->data.baseCost; + if (magnitude > 0) { + result *= magnitude; + } + if (area > 0) { + result *= area; + } + if (duration > 0) { + result *= duration; + } + return result; + } + + float getEnchantmentStrength(RE::EnchantmentItem* ench) + { + if (!ench) { + return 0.0; + } + float result = 0; + const auto effects = ench->As()->effects; + for (int i = effects.size() - 1; i >= 0; i--) { + result += getMagicEffectStrength( + effects[i]->baseEffect, + effects[i]->GetMagnitude(), + effects[i]->GetArea(), + effects[i]->GetDuration()); + } + return result * magicWeight; + } + + float getSpellStrength(RE::SpellItem* spell) + { + if (!spell) { + return 0.0; + } + /* + * // Sum of effect costs + float result = 0; + for (int i = papyrusSpell::GetNumEffects(spell) - 1; i >= 0; i--) { + result += getMagicEffectStrength( + papyrusSpell::GetNthEffectMagicEffect(spell, i), + papyrusSpell::GetNthEffectMagnitude(spell, i), + papyrusSpell::GetNthEffectDuration(spell, i), + papyrusSpell::GetNthEffectArea(spell, i)); + } + */ + + /* + * // The costliest effect + int iCostliestEffect = papyrusSpell::GetCostliestEffectIndex(spell); + + float result = getMagicEffectStrength( + papyrusSpell::GetNthEffectMagicEffect(spell, iCostliestEffect), + papyrusSpell::GetNthEffectMagnitude(spell, iCostliestEffect), + papyrusSpell::GetNthEffectDuration(spell, iCostliestEffect), + papyrusSpell::GetNthEffectArea(spell, iCostliestEffect) + ); + */ + + // 2.0.10: Switch to flat magicka correlation + return spell->GetData1()->costOverride * 1.5; + } + + float getAdditionalExtendDataStrength(RE::InventoryEntryData* itemStack, float physicalStrength) + { + float strength = 0; + + if (!itemStack->extraLists) { + return strength; + } + + for (const auto& xList : *itemStack->extraLists) { + const auto xEnch = xList->GetByType(); + if (xEnch && xEnch->enchantment) { + strength += getEnchantmentStrength(xEnch->enchantment) * xList->GetCount(); + } + const auto xTempered = xList->GetByType(); + if (xTempered && xTempered->health > 1.0) { + strength += physicalStrength * (xTempered->health - 1.0) * 20 * xList->GetCount(); + } + } + + return strength; + } + + float getItemStackStrength(RE::InventoryEntryData* itemStack) + { + float strength = 0; + float physicalStrength = 0; + + if (itemStack->object) { + if (itemStack->object->IsWeapon()) { + RE::TESObjectWEAP* asWeapon = itemStack->object->As(); + if (asWeapon) { + float baseDmg = asWeapon->GetAttackDamage() * 1.5; + float speed = asWeapon->GetSpeed(); + physicalStrength = baseDmg * speed; + strength += physicalStrength; + strength += getEnchantmentStrength(asWeapon->As()->formEnchanting); + } + } + + if (itemStack->object->IsArmor()) { + RE::TESObjectARMO* asArmor = itemStack->object->As(); + if (asArmor) { + physicalStrength = asArmor->GetArmorRating(); + strength += physicalStrength; + strength += getEnchantmentStrength(asArmor->As()->formEnchanting); + } + } + + if (itemStack->object->IsBook()) { + RE::TESObjectBOOK* asBook = itemStack->object->As(); + if (asBook && asBook->TeachesSpell()) { + return getSpellStrength(asBook->GetSpell()); + } + } + } + + strength = strength * itemStack->countDelta; + + strength += getAdditionalExtendDataStrength(itemStack, physicalStrength); + + return strength; + } + + float calculateContentStrength(RE::StaticFunctionTag* tag, RE::TESObjectREFR* container) + { + if (!container) { + return 0.0; + } + + float strength = 0; + const auto inv = container->GetInventory(); + + for (const auto& [item, data] : inv) { + const auto& [count, entry] = data; + if (count > 0) { + strength += getItemStackStrength(entry.get()); + } + } + + return strength; + } + + inline void Bind(VM& a_vm) + { + BIND(calculateContentStrength); + logger::info("Registered calculateContentStrength"sv); + } +} \ No newline at end of file diff --git a/source/Enderal DLL/src/StayAtSystemPage.h b/source/Enderal DLL/src/StayAtSystemPage.h new file mode 100644 index 00000000..38cfd205 --- /dev/null +++ b/source/Enderal DLL/src/StayAtSystemPage.h @@ -0,0 +1,58 @@ +#pragma once + +// Based on Ryan McKenzie's Stay at the System Page +class JournalMenuEx : + public RE::JournalMenu +{ +public: + enum class Tab : std::uint32_t + { + kQuest, + kStats, + kSystem + }; + + void Hook_Accept(RE::FxDelegateHandler::CallbackProcessor* a_cbProc) + { + _Accept(this, a_cbProc); + fxDelegate->callbacks.Remove("RememberCurrentTabIndex"); + a_cbProc->Process("RememberCurrentTabIndex", RememberCurrentTabIndex); + } + + RE::UI_MESSAGE_RESULTS Hook_ProcessMessage(RE::UIMessage& a_message) + { + switch (a_message.type.get()) { + case RE::UI_MESSAGE_TYPE::kShow: + { + auto UI = RE::UI::GetSingleton(); + auto InterfaceStrings = RE::InterfaceStrings::GetSingleton(); + if (UI && InterfaceStrings && UI->IsMenuOpen(InterfaceStrings->mapMenu)) { + *_savedTabIdx = Tab::kQuest; + } else { + *_savedTabIdx = Tab::kSystem; + } + } + + default: + break; + } + + return _ProcessMessage(this, a_message); + } + + static void RememberCurrentTabIndex([[maybe_unused]] const RE::FxDelegateArgs& a_params) + { + return; + } + + static void InstallHooks() + { + REL::Relocation vtbl(RE::VTABLE_JournalMenu[0]); + _Accept = vtbl.write_vfunc(0x01, &JournalMenuEx::Hook_Accept); + _ProcessMessage = vtbl.write_vfunc(0x04, &JournalMenuEx::Hook_ProcessMessage); + } + + static inline REL::Relocation _Accept; + static inline REL::Relocation _ProcessMessage; + static inline REL::Relocation _savedTabIdx{ RELOCATION_ID(520167, 406697) }; +}; diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h new file mode 100644 index 00000000..298cd1a8 --- /dev/null +++ b/source/Enderal DLL/src/Util.h @@ -0,0 +1,106 @@ +#pragma once + +#include "CheckInvalidForms.h" +#include + +inline const SKSE::LoadInterface* GetLoadInterface(const SKSE::LoadInterface* loadInterface = nullptr) +{ + const static SKSE::LoadInterface* singleton; + if (loadInterface) { + singleton = loadInterface; + } + return singleton; +} + +inline uint8_t NewGameCount(bool increment = false) +{ + static uint8_t g_NewGameStarted = 0; + + if (increment) { + g_NewGameStarted++; + } + + return g_NewGameStarted; +} + +inline bool IsSE() +{ + return GetLoadInterface()->RuntimeVersion().minor() == 5; +} + +inline void SetINISettings() +{ + auto* setting = RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bFreebiesSeen:General"); + if (setting && !setting->GetBool()) { + setting->data.b = true; + RE::INIPrefSettingCollection::GetSingleton()->WriteSetting(setting); + } + + setting = RE::INISettingCollection::GetSingleton()->GetSetting("bInvalidateOlderFiles:Archive"); + if (setting && !setting->GetBool()) { + setting->data.b = true; + RE::INISettingCollection::GetSingleton()->WriteSetting(setting); + } + + setting = RE::INISettingCollection::GetSingleton()->GetSetting("bModManagerMenuEnabled:General"); + if (setting && setting->GetBool()) { + setting->data.b = false; + RE::INISettingCollection::GetSingleton()->WriteSetting(setting); + } +} + +inline void CheckIncompatibleMods() +{ + RE::ConsoleLog::GetSingleton()->Print("Loaded SureAI's Enderal: Forgotten Stories | Special Edition port v2.0.12 by Eddoursul et al"); + + CheckWorldspaces(); + CheckSkyrimCells(); + CheckEnderalCells(); +} + +inline void LoadINI(std::map* settings, const char* iniPath) +{ + for (auto it = settings->begin(); it != settings->end(); it++) { + logger::info("[DEFAULT] {} = {}", it->first, it->second); + } + + if (!std::filesystem::exists(iniPath)) { + logger::warn("{} does not exist, using default values.", iniPath); + return; + } + + try { + CSimpleIniA ini; + ini.SetUnicode(false); + ini.SetMultiKey(false); + ini.LoadFile(iniPath); + + std::list keysList; + ini.GetAllKeys("", keysList); + + bool bUpdateINI = false; + for (auto it = settings->begin(); it != settings->end(); it++) { + bool bExists = false; + for (const auto& k : keysList) { + if (it->first == k.pItem) { + settings->insert_or_assign(k.pItem, ini.GetBoolValue("", k.pItem, settings->at(k.pItem))); + logger::info("[INI] {} = {}", k.pItem, settings->at(k.pItem)); + bExists = true; + break; + } + } + if (!bExists) { + ini.SetBoolValue("", it->first.c_str(), it->second); + bUpdateINI = true; + } + } + + if (bUpdateINI) { + logger::info("New settings detected, adding to ArtifactTracker.ini"); + ini.SaveFile(iniPath); + } + + } catch (const std::exception& e) { + logger::error(e.what()); + } +} \ No newline at end of file diff --git a/source/Enderal DLL/vcpkg-configuration.json b/source/Enderal DLL/vcpkg-configuration.json new file mode 100644 index 00000000..337bdfa8 --- /dev/null +++ b/source/Enderal DLL/vcpkg-configuration.json @@ -0,0 +1,15 @@ +{ + "registries": [ + { + "kind": "git", + "repository": "https://gitlab.com/colorglass/vcpkg-colorglass", + "baseline": "5a11d06fd1b2d7cd6339d6aea48d450309e89cc1", + "packages": [ + "commonlibsse-ng", + "gluino", + "script-extender-common", + "skse" + ] + } + ] +} diff --git a/source/Enderal DLL/vcpkg.json b/source/Enderal DLL/vcpkg.json new file mode 100644 index 00000000..99277de2 --- /dev/null +++ b/source/Enderal DLL/vcpkg.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "name": "enderal-se", + "version-string": "1.0.0", + "port-version": 0, + "description": "Enderal SE Helper", + "homepage": "https://eddoursul.win/mods/enderal-se/", + "license": "LGPL-3.0", + "features": { + "plugin": { + "description": "Enderal SE functions and potion replacer.", + "dependencies": [ + "commonlibsse-ng", + "simpleini" + ] + } + }, + "default-features": [ + "plugin" + ] +} diff --git a/source/fs.dll/.gitignore b/source/fs.dll/.gitignore deleted file mode 100644 index cf0b2bc8..00000000 --- a/source/fs.dll/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.db -.vs/ -x64/ -x64_*/ -common/x64_*/ -fs/x64/ -skse64/.vs/ -skse64/skse64/x64/ -skse64/skse64_common/x64/ diff --git a/source/fs.dll/common/IArchive.cpp b/source/fs.dll/common/IArchive.cpp deleted file mode 100644 index 268bd426..00000000 --- a/source/fs.dll/common/IArchive.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "IArchive.h" -#include "IErrors.h" - -#if ENABLE_IDYNAMICCREATE - -IDynamic * IArchive::iterator::Instantiate(void) -{ - IDataSubStream subStream(owner->theStream, GetDataOffset(), GetDataLength()); - - return IClassRegistry::Instantiate(GetTypeID(), &subStream); -} - -void * IArchive::iterator::GetBuffer(UInt32 * outLength) -{ - HeaderEntry * entry = GetData(); - UInt8 * buf = new UInt8[entry->dataLength]; - - owner->theStream->SetOffset(entry->dataOffset); - owner->theStream->ReadBuf(buf, entry->dataLength); - - if(outLength) - *outLength = entry->dataLength; - - return buf; -} - -void IArchive::iterator::NextOfType(UInt32 typeID) -{ - idx++; - - while((GetData()->typeID != typeID) && (idx < owner->header.numEntries)) - idx++; -} - -void IArchive::iterator::PrevOfType(UInt32 typeID) -{ - idx--; - - while((GetData()->typeID != typeID) && (idx > 0)) - idx--; -} - -IArchive::IArchive() -:theStream(NULL), entries(NULL), nameTable(NULL) -{ - -} - -IArchive::IArchive(IDataStream * stream) -:theStream(NULL), entries(NULL), nameTable(NULL) -{ - AttachStream(stream); -} - -IArchive::~IArchive() -{ - Dispose(); -} - -void IArchive::AttachStream(IDataStream * inStream) -{ - Dispose(); - - theStream = inStream; -} - -void IArchive::Dispose(void) -{ - if(entries) - { - delete entries; - entries = NULL; - } - - if(nameTable) - { - delete nameTable; - nameTable = NULL; - } -} - -void IArchive::ReadHeader(void) -{ - ASSERT(theStream); - - theStream->Rewind(); - - theStream->ReadBuf(&header, sizeof(FileHeader)); - - entries = new HeaderEntry[header.numEntries]; - theStream->ReadBuf(entries, header.numEntries * sizeof(HeaderEntry)); - - if(header.nameTableLength) - { - nameTable = new char[header.nameTableLength]; - - theStream->SetOffset(header.nameTableOffset); - theStream->ReadBuf(nameTable, header.nameTableLength); - } -} - -#endif diff --git a/source/fs.dll/common/IArchive.h b/source/fs.dll/common/IArchive.h deleted file mode 100644 index 261a344a..00000000 --- a/source/fs.dll/common/IArchive.h +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once - -#include "common/IDataStream.h" -#include "common/IDynamicCreate.h" - -#if ENABLE_IDYNAMICCREATE - -/** - * An object archive - * - * This class implements reading and instantiating objects from an object archive. - */ -class IArchive -{ - public: - class iterator; - friend iterator; - - IArchive(); - IArchive(IDataStream * inStream); - ~IArchive(); - - void AttachStream(IDataStream * inStream); - void Dispose(void); - - iterator begin(void) { return iterator(0, this); } - iterator end(void) { return iterator(header.numEntries, this); } - - static const UInt32 kFileID = CHAR_CODE(0x00, 'A', 'R', 0x01); - static const UInt32 kCurrentVersion = VERSION_CODE(1, 0, 0); - - private: - struct FileHeader - { - UInt32 fileID; // IArchive::kFileID - UInt32 version; // IArchive::kCurrentVersion - UInt32 numEntries; - UInt32 nameTableOffset; - UInt32 nameTableLength; - }; - - struct HeaderEntry - { - UInt32 typeID; - UInt32 subID; - UInt32 dataOffset; - UInt32 dataLength; - UInt32 nameOffset; - }; - - void ReadHeader(void); - - IDataStream * theStream; - - FileHeader header; - HeaderEntry * entries; - - char * nameTable; - - public: - class iterator - { - public: - iterator() { idx = 0; owner = NULL; } - iterator(UInt32 inIdx, IArchive * inArchive) { idx = inIdx; owner = inArchive; } - ~iterator() { } - - IDynamic * Instantiate(void); - - UInt32 GetTypeID(void) { return GetData()->typeID; } - UInt32 GetSubID(void) { return GetData()->subID; } - UInt32 GetDataLength(void) { return GetData()->dataLength; } - char * GetName(void) { return &owner->nameTable[GetData()->nameOffset]; } - void * GetBuffer(UInt32 * outLength); - - iterator & operator++() { Next(); return *this; } - iterator & operator--() { Prev(); return *this; } - - void NextOfType(UInt32 typeID); - void Next(void) { idx++; } - - void PrevOfType(UInt32 typeID); - void Prev(void) { idx--; } - - private: - HeaderEntry * GetData(void) { return &owner->entries[idx]; } - - UInt32 GetDataOffset(void) { return GetData()->dataOffset; } - - UInt32 idx; - IArchive * owner; - }; -}; - -#endif diff --git a/source/fs.dll/common/IBufferStream.cpp b/source/fs.dll/common/IBufferStream.cpp deleted file mode 100644 index dd68a6b3..00000000 --- a/source/fs.dll/common/IBufferStream.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "IBufferStream.h" - -IBufferStream::IBufferStream() -:streamBuf(NULL), flags(0) -{ - -} - -IBufferStream::IBufferStream(const IBufferStream & rhs) -{ - // explicitly not supporting copy constructor for self-owned buffers - ASSERT((flags & kFlag_OwnedBuf) == 0); -} - -IBufferStream::IBufferStream(void * buf, UInt64 inLength) -:streamBuf(NULL), flags(0) -{ - SetBuffer(buf, inLength); -} - -IBufferStream::~IBufferStream() -{ - if(flags & kFlag_OwnedBuf) - { - delete [] streamBuf; - } -} - -IBufferStream & IBufferStream::operator=(IBufferStream & rhs) -{ - // explicitly not supporting copying for self-owned buffers - ASSERT((flags & kFlag_OwnedBuf) == 0); - - streamBuf = rhs.streamBuf; - flags = rhs.flags; - - return *this; -} - -void IBufferStream::SetBuffer(void * buf, UInt64 inLength) -{ - streamBuf = (UInt8 *)buf; - streamLength = inLength; - - Rewind(); -} - -void IBufferStream::ReadBuf(void * buf, UInt32 inLength) -{ - memcpy(buf, &streamBuf[streamOffset], inLength); - streamOffset += inLength; -} - -void IBufferStream::WriteBuf(const void * buf, UInt32 inLength) -{ - memcpy(&streamBuf[streamOffset], buf, inLength); - streamOffset += inLength; -} diff --git a/source/fs.dll/common/IBufferStream.h b/source/fs.dll/common/IBufferStream.h deleted file mode 100644 index 9e20aba6..00000000 --- a/source/fs.dll/common/IBufferStream.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include "common/IDataStream.h" - -class IBufferStream : public IDataStream -{ - public: - IBufferStream(); - IBufferStream(const IBufferStream & rhs); - IBufferStream(void * buf, UInt64 inLength); - virtual ~IBufferStream(); - - IBufferStream & operator=(IBufferStream & rhs); - - void SetBuffer(void * buf, UInt64 inLength); - void * GetBuffer(void) { return streamBuf; } - - void OwnBuffer(void) { flags |= kFlag_OwnedBuf; } - void DisownBuffer(void) { flags &= ~kFlag_OwnedBuf; } - - // read - virtual void ReadBuf(void * buf, UInt32 inLength); - - // write - virtual void WriteBuf(const void * buf, UInt32 inLength); - - protected: - UInt8 * streamBuf; - UInt32 flags; - - enum - { - kFlag_OwnedBuf = 1 << 0 - }; -}; diff --git a/source/fs.dll/common/IConsole.cpp b/source/fs.dll/common/IConsole.cpp deleted file mode 100644 index c638577f..00000000 --- a/source/fs.dll/common/IConsole.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "common/IConsole.h" -#include -#include -#include - -IConsole::IConsole() -{ - AllocConsole(); - - SetConsoleTitle("Console"); - - inputHandle = GetStdHandle(STD_INPUT_HANDLE); - outputHandle = GetStdHandle(STD_OUTPUT_HANDLE); - - ASSERT_STR(inputHandle, "IConsole: couldn't get input handle"); - ASSERT_STR(outputHandle, "IConsole: couldn't get output handle"); - - SetConsoleMode(inputHandle, ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT); - SetConsoleMode(outputHandle, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); -} - -IConsole::~IConsole() -{ - -} - -/** - * Writes a string to the console - */ -void IConsole::Write(char * buf) -{ - UInt32 charsWritten; - - WriteConsole(outputHandle, buf, std::strlen(buf), &charsWritten, NULL); -} - -/** - * Writes a formatted string to the console - * - * You may specify a temp buffer to use for the formatted text, but if NULL - * is used a local buffer will be provided. - * - * @param buf a temporary buffer, or NULL to use the internal buffer - * @param fmt the format string - */ -void IConsole::Write(char * buf, UInt32 bufLen, const char * fmt, ...) -{ - static char tempBuf[4096]; - - if(!buf) - { - buf = tempBuf; - bufLen = sizeof(tempBuf); - } - - va_list args; - - va_start(args, fmt); - vsprintf_s(buf, bufLen, fmt, args); - va_end(args); - - Write(buf); -} - -/** - * Reads a single character from the console - */ -char IConsole::ReadChar(void) -{ - char data; - UInt32 charsRead; - - ReadConsole(inputHandle, &data, 1, &charsRead, NULL); - - return data; -} - -/** - * Reads a newline-terminated string from the console - * - * @param buf output buffer - * @param len buffer size - * @return number of characters read - */ -UInt32 IConsole::ReadBuf(char * buf, UInt32 len) -{ - UInt32 charsRead; - - buf[0] = 0; - - do - { - ReadConsole(inputHandle, buf, len, &charsRead, NULL); - } - while(!charsRead); - - int done = 0; - for(UInt32 i = charsRead - 1; (i > 0) && !done; i--) - { - switch(buf[i]) - { - case 0x0A: - case 0x0D: - buf[i] = 0; - break; - - default: - done = 1; - break; - } - } - - buf[charsRead] = 0; - - return charsRead; -} diff --git a/source/fs.dll/common/IConsole.h b/source/fs.dll/common/IConsole.h deleted file mode 100644 index 70c0c872..00000000 --- a/source/fs.dll/common/IConsole.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "common/ITypes.h" -#include "common/ISingleton.h" -#include - -/** - * Wrapper class for a standard Windows console - * - * @todo make nonblocking - */ -class IConsole : public ISingleton -{ - public: - IConsole(); - ~IConsole(); - - void Write(char * buf); - void Write(char * buf, UInt32 bufLen, const char * fmt, ...); - - char ReadChar(void); - UInt32 ReadBuf(char * buf, UInt32 len); - - private: - HANDLE inputHandle, outputHandle; -}; diff --git a/source/fs.dll/common/ICriticalSection.h b/source/fs.dll/common/ICriticalSection.h deleted file mode 100644 index 84b405de..00000000 --- a/source/fs.dll/common/ICriticalSection.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -class ICriticalSection -{ - public: - ICriticalSection() { InitializeCriticalSection(&critSection); } - ~ICriticalSection() { DeleteCriticalSection(&critSection); } - - void Enter(void) { EnterCriticalSection(&critSection); } - void Leave(void) { LeaveCriticalSection(&critSection); } - bool TryEnter(void) { return TryEnterCriticalSection(&critSection) != 0; } - - private: - CRITICAL_SECTION critSection; -}; - -class IScopedCriticalSection -{ -public: - IScopedCriticalSection(ICriticalSection * cs) - :m_cs(cs) - { - m_cs->Enter(); - } - - ~IScopedCriticalSection() - { - m_cs->Leave(); - } - -private: - IScopedCriticalSection(); // undefined - - ICriticalSection * m_cs; -}; diff --git a/source/fs.dll/common/IDataStream.cpp b/source/fs.dll/common/IDataStream.cpp deleted file mode 100644 index 51fda675..00000000 --- a/source/fs.dll/common/IDataStream.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "IDataStream.h" - -/**** IDataStream *************************************************************/ - -IDataStream::IDataStream() -:streamLength(0), streamOffset(0), swapBytes(false) -{ - -} - -IDataStream::~IDataStream() -{ - -} - -/** - * Reads and returns an 8-bit value from the stream - */ -UInt8 IDataStream::Read8(void) -{ - UInt8 out; - - ReadBuf(&out, sizeof(UInt8)); - - return out; -} - -/** - * Reads and returns a 16-bit value from the stream - */ -UInt16 IDataStream::Read16(void) -{ - UInt16 out; - - ReadBuf(&out, sizeof(UInt16)); - - if(swapBytes) - out = Swap16(out); - - return out; -} - -/** - * Reads and returns a 32-bit value from the stream - */ -UInt32 IDataStream::Read32(void) -{ - UInt32 out; - - ReadBuf(&out, sizeof(UInt32)); - - if(swapBytes) - out = Swap32(out); - - return out; -} - -/** - * Reads and returns a 64-bit value from the stream - */ -UInt64 IDataStream::Read64(void) -{ - UInt64 out; - - ReadBuf(&out, sizeof(UInt64)); - - if(swapBytes) - out = Swap64(out); - - return out; -} - -/** - * Reads and returns a 32-bit floating point value from the stream - */ -float IDataStream::ReadFloat(void) -{ - UInt32 out = Read32(); - - return *((float *)&out); -} - -/** - * Reads a null-or-return-terminated string from the stream - * - * If the buffer is too small to hold the entire string, it is truncated and - * properly terminated. - * - * @param buf the output buffer - * @param bufLength the size of the output buffer - * @return the number of characters written to the buffer - */ -UInt32 IDataStream::ReadString(char * buf, UInt32 bufLength, char altTerminator, char altTerminator2) -{ - char * traverse = buf; - bool breakOnReturns = false; - - if((altTerminator == '\n') || (altTerminator2 == '\n')) - breakOnReturns = true; - - ASSERT_STR(bufLength > 0, "IDataStream::ReadString: zero-sized buffer"); - - if(bufLength == 1) - { - buf[0] = 0; - return 0; - } - - bufLength--; - - for(UInt32 i = 0; i < bufLength; i++) - { - if(HitEOF()) break; - - UInt8 data = Read8(); - - if(breakOnReturns) - { - if(data == 0x0D) - { - if(Peek8() == 0x0A) - Skip(1); - - break; - } - } - - if(!data || (data == altTerminator) || (data == altTerminator2)) - { - break; - } - - *traverse++ = data; - } - - *traverse++ = 0; - - return traverse - buf - 1; -} - -/** - * Reads and returns an 8-bit value from the stream without advancing the stream's position - */ -UInt8 IDataStream::Peek8(void) -{ - IDataStream_PositionSaver saver(this); - - return Read8(); -} - -/** - * Reads and returns a 16-bit value from the stream without advancing the stream's position - */ -UInt16 IDataStream::Peek16(void) -{ - IDataStream_PositionSaver saver(this); - - return Read16(); -} - -/** - * Reads and returns a 32-bit value from the stream without advancing the stream's position - */ -UInt32 IDataStream::Peek32(void) -{ - IDataStream_PositionSaver saver(this); - - return Read32(); -} - -/** - * Reads and returns a 32-bit value from the stream without advancing the stream's position - */ -UInt64 IDataStream::Peek64(void) -{ - IDataStream_PositionSaver saver(this); - - return Read64(); -} - -/** - * Reads and returns a 32-bit floating point value from the stream without advancing the stream's position - */ -float IDataStream::PeekFloat(void) -{ - IDataStream_PositionSaver saver(this); - - return ReadFloat(); -} - -/** - * Reads raw data into a buffer without advancing the stream's position - */ -void IDataStream::PeekBuf(void * buf, UInt32 inLength) -{ - IDataStream_PositionSaver saver(this); - - ReadBuf(buf, inLength); -} - -/** - * Skips a specified number of bytes down the stream - */ -void IDataStream::Skip(SInt64 inBytes) -{ - SetOffset(GetOffset() + inBytes); -} - -/** - * Writes an 8-bit value to the stream. - */ -void IDataStream::Write8(UInt8 inData) -{ - WriteBuf(&inData, sizeof(UInt8)); -} - -/** - * Writes a 16-bit value to the stream. - */ -void IDataStream::Write16(UInt16 inData) -{ - if(swapBytes) - inData = Swap16(inData); - - WriteBuf(&inData, sizeof(UInt16)); -} - -/** - * Writes a 32-bit value to the stream. - */ -void IDataStream::Write32(UInt32 inData) -{ - if(swapBytes) - inData = Swap32(inData); - - WriteBuf(&inData, sizeof(UInt32)); -} - -/** - * Writes a 64-bit value to the stream. - */ -void IDataStream::Write64(UInt64 inData) -{ - if(swapBytes) - inData = Swap64(inData); - - WriteBuf(&inData, sizeof(UInt64)); -} - -/** - * Writes a 32-bit floating point value to the stream. - */ -void IDataStream::WriteFloat(float inData) -{ - if(swapBytes) - { - UInt32 temp = *((UInt32 *)&inData); - - temp = Swap32(temp); - - WriteBuf(&temp, sizeof(UInt32)); - } - else - { - WriteBuf(&inData, sizeof(float)); - } -} - -/** - * Writes a null-terminated string to the stream. - */ -void IDataStream::WriteString(const char * buf) -{ - WriteBuf(buf, std::strlen(buf) + 1); -} - -/** - * Returns the length of the stream - */ -SInt64 IDataStream::GetLength(void) -{ - return streamLength; -} - -/** - * Returns the number of bytes remaining in the stream - */ -SInt64 IDataStream::GetRemain(void) -{ - return streamLength - streamOffset; -} - -/** - * Returns the current offset into the stream - */ -SInt64 IDataStream::GetOffset(void) -{ - return streamOffset; -} - -/** - * Returns whether we have reached the end of the stream or not - */ -bool IDataStream::HitEOF(void) -{ - return streamOffset >= streamLength; -} - -/** - * Moves the current offset into the stream - */ -void IDataStream::SetOffset(SInt64 inOffset) -{ - streamOffset = inOffset; -} - -/** - * Enables or disables byte swapping for basic data transfers - */ -void IDataStream::SwapBytes(bool inSwapBytes) -{ - swapBytes = inSwapBytes; -} - -IDataStream * IDataStream::GetRootParent(void) -{ - IDataStream * parent = GetParent(); - - if(parent) - return parent->GetRootParent(); - else - return this; -} - -void IDataStream::CopyStreams(IDataStream * out, IDataStream * in, UInt64 bufferSize, UInt8 * buf) -{ - in->Rewind(); - - bool ourBuffer = false; - - if(!buf) - { - buf = new UInt8[bufferSize]; - ourBuffer = true; - } - - UInt64 remain = in->GetLength(); - - while(remain > 0) - { - UInt64 transferSize = remain; - - if(transferSize > bufferSize) - transferSize = bufferSize; - - in->ReadBuf(buf, transferSize); - out->WriteBuf(buf, transferSize); - - remain -= transferSize; - } - - if(ourBuffer) - delete [] buf; -} - -void IDataStream::CopySubStreams(IDataStream * out, IDataStream * in, UInt64 remain, UInt64 bufferSize, UInt8 * buf) -{ - bool ourBuffer = false; - - if(!buf) - { - buf = new UInt8[bufferSize]; - ourBuffer = true; - } - - while(remain > 0) - { - UInt64 transferSize = remain; - - if(transferSize > bufferSize) - transferSize = bufferSize; - - in->ReadBuf(buf, transferSize); - out->WriteBuf(buf, transferSize); - - remain -= transferSize; - } - - if(ourBuffer) - delete [] buf; -} - -/**** IDataStream_PositionSaver ***********************************************/ - -/** - * The constructor; save the stream's position - */ -IDataStream_PositionSaver::IDataStream_PositionSaver(IDataStream * tgt) -{ - stream = tgt; - offset = tgt->GetOffset(); -} - -/** - * The destructor; restore the stream's saved position - */ -IDataStream_PositionSaver::~IDataStream_PositionSaver() -{ - stream->SetOffset(offset); -} - -/**** IDataSubStream **********************************************************/ - -IDataSubStream::IDataSubStream() -:stream(NULL), subBase(0) -{ - // -} - -IDataSubStream::IDataSubStream(IDataStream * inStream, SInt64 inOffset, SInt64 inLength) -{ - stream = inStream; - subBase = inOffset; - streamLength = inLength; - - stream->SetOffset(inOffset); -} - -IDataSubStream::~IDataSubStream() -{ - -} - -void IDataSubStream::Attach(IDataStream * inStream, SInt64 inOffset, SInt64 inLength) -{ - stream = inStream; - subBase = inOffset; - streamLength = inLength; - - stream->SetOffset(inOffset); -} - -void IDataSubStream::ReadBuf(void * buf, UInt32 inLength) -{ - ASSERT_STR(inLength <= GetRemain(), "IDataSubStream::ReadBuf: hit eof"); - - if(stream->GetOffset() != subBase + streamOffset) - stream->SetOffset(subBase + streamOffset); - - stream->ReadBuf(buf, inLength); - - streamOffset += inLength; -} - -void IDataSubStream::WriteBuf(const void * buf, UInt32 inLength) -{ - if(stream->GetOffset() != subBase + streamOffset) - stream->SetOffset(subBase + streamOffset); - - stream->WriteBuf(buf, inLength); - - streamOffset += inLength; - - if(streamLength < streamOffset) - streamLength = streamOffset; -} - -void IDataSubStream::SetOffset(SInt64 inOffset) -{ - stream->SetOffset(subBase + inOffset); - streamOffset = inOffset; -} diff --git a/source/fs.dll/common/IDataStream.h b/source/fs.dll/common/IDataStream.h deleted file mode 100644 index cca0805b..00000000 --- a/source/fs.dll/common/IDataStream.h +++ /dev/null @@ -1,102 +0,0 @@ -#pragma once - -#include "common/IErrors.h" - -/** - * An arbitrary data stream - */ -class IDataStream -{ - public: - IDataStream(); - virtual ~IDataStream(); - - // read - virtual UInt8 Read8(void); - virtual UInt16 Read16(void); - virtual UInt32 Read32(void); - virtual UInt64 Read64(void); - virtual float ReadFloat(void); - virtual UInt32 ReadString(char * buf, UInt32 bufLength, char altTerminator = 0, char altTerminator2 = 0); - virtual void ReadBuf(void * buf, UInt32 inLength) = 0; - - // peek - virtual UInt8 Peek8(void); - virtual UInt16 Peek16(void); - virtual UInt32 Peek32(void); - virtual UInt64 Peek64(void); - virtual float PeekFloat(void); - virtual void PeekBuf(void * buf, UInt32 inLength); - - virtual void Skip(SInt64 inBytes); - - // write - virtual void Write8(UInt8 inData); - virtual void Write16(UInt16 inData); - virtual void Write32(UInt32 inData); - virtual void Write64(UInt64 inData); - virtual void WriteFloat(float inData); - virtual void WriteString(const char * buf); - virtual void WriteBuf(const void * buf, UInt32 inLength) = 0; - - SInt64 GetLength(void); - SInt64 GetRemain(void); - SInt64 GetOffset(void); - bool HitEOF(void); - - virtual void SetOffset(SInt64 inOffset); - void Rewind(void) { SetOffset(0); } - - void SwapBytes(bool inSwapBytes); - - virtual SInt64 GetParentOffset(void) { return GetOffset(); } - virtual IDataStream * GetParent(void) { return NULL; } - - IDataStream * GetRootParent(void); - - static void CopyStreams(IDataStream * out, IDataStream * in, UInt64 bufferSize = 1024 * 1024, UInt8 * buf = NULL); - static void CopySubStreams(IDataStream * out, IDataStream * in, UInt64 remain, UInt64 bufferSize = 1024 * 1024, UInt8 * buf = NULL); - - protected: - SInt64 streamLength; - SInt64 streamOffset; - bool swapBytes; -}; - -/** - * A utility class to automatically save and restore the current position of an IDataStream - */ -class IDataStream_PositionSaver -{ - public: - IDataStream_PositionSaver(IDataStream * tgt); - ~IDataStream_PositionSaver(); - - private: - IDataStream * stream; - SInt64 offset; -}; - -class IDataSubStream : public IDataStream -{ - public: - IDataSubStream(); - IDataSubStream(IDataStream * inStream, SInt64 inOffset, SInt64 inLength); - ~IDataSubStream(); - - void Attach(IDataStream * inStream, SInt64 inOffset, SInt64 inLength); - - void ReadBuf(void * buf, UInt32 inLength); - void WriteBuf(const void * buf, UInt32 inLength); - void SetOffset(SInt64 inOffset); - - virtual SInt64 GetParentOffset(void) { return stream->GetOffset(); } - virtual IDataStream * GetParent(void) { return stream; } - - SInt64 GetSubBase(void) { return subBase; } - - private: - IDataStream * stream; - - SInt64 subBase; -}; diff --git a/source/fs.dll/common/IDatabase.cpp b/source/fs.dll/common/IDatabase.cpp deleted file mode 100644 index 121a4f83..00000000 --- a/source/fs.dll/common/IDatabase.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "IDatabase.h" diff --git a/source/fs.dll/common/IDatabase.h b/source/fs.dll/common/IDatabase.h deleted file mode 100644 index 3bc85dee..00000000 --- a/source/fs.dll/common/IDatabase.h +++ /dev/null @@ -1,116 +0,0 @@ -#pragma once - -#include -#include "common/IDataStream.h" -#include "common/IFilestream.h" - -template -class IDatabase -{ - public: - typedef std::map DataMapType; - typedef typename DataMapType::iterator DataMapIterator; - - static const UInt64 kGUIDMask = 0x0FFFFFFFFFFFFFFF; - - IDatabase() { newKeyHint = 1; } - virtual ~IDatabase() { } - - DataType * Get(UInt64 key) - { - key &= kGUIDMask; - - if(!key) - return NULL; - - DataMapType::iterator iter = theDataMap.find(key); - - return (iter == theDataMap.end()) ? NULL : &((*iter).second); - } - - DataType * Alloc(UInt64 key) - { - key &= kGUIDMask; - - if(!key) - return NULL; - - DataMapType::iterator iter = theDataMap.find(key); - - return (iter == theDataMap.end()) ? &theDataMap[key] : NULL; - } - - DataType * Alloc(UInt64 * key) - { - UInt64 newKey = newKeyHint; - - do - { - if(!newKey) - newKey++; - - DataMapType::iterator iter = theDataMap.find(newKey); - - // is 'newKey' unused? - if(iter == theDataMap.end()) - { - *key = newKey; - newKeyHint = (newKey + 1) & kGUIDMask; - return &theDataMap[newKey]; - } - else - { - ++iter; - if(iter == theDataMap.end()) - { - newKey = 1; - } - else - { - UInt64 nextKey = (newKey + 1) & kGUIDMask; - if(iter->first != nextKey) - { - *key = nextKey; - newKeyHint = (nextKey + 1) & kGUIDMask; - return &theDataMap[nextKey]; - } - } - } - } - while(1); - - *key = 0; - - return NULL; - } - - void Delete(UInt64 key) - { - if(key) - { - key &= kGUIDMask; - - theDataMap.erase(key); - - newKeyHint = key; - } - } - - void Save(IDataStream * stream); - void Load(IDataStream * stream); - - bool SaveToFile(char * name); - bool LoadFromFile(char * name); - - DataMapType & GetData(void) { return theDataMap; } - - DataMapIterator Begin(void) { return theDataMap.begin(); } - DataMapIterator End(void) { return theDataMap.end(); } - UInt32 Length(void) { return theDataMap.size(); } - - private: - DataMapType theDataMap; - UInt64 newKeyHint; -}; - -#include "common/IDatabase.inc" diff --git a/source/fs.dll/common/IDatabase.inc b/source/fs.dll/common/IDatabase.inc deleted file mode 100644 index 2d6d2cce..00000000 --- a/source/fs.dll/common/IDatabase.inc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ac7167426f30b689deb797b06dd660872aa90dd086178d494523be32e03b2ad -size 1076 diff --git a/source/fs.dll/common/IDebugLog.cpp b/source/fs.dll/common/IDebugLog.cpp deleted file mode 100644 index 7f332a36..00000000 --- a/source/fs.dll/common/IDebugLog.cpp +++ /dev/null @@ -1,324 +0,0 @@ -#include "common/IDebugLog.h" -#include -#include "common/IFileStream.h" -#include - -std::FILE * IDebugLog::logFile = NULL; -char IDebugLog::sourceBuf[16] = { 0 }; -char IDebugLog::headerText[16] = { 0 }; -char IDebugLog::formatBuf[8192] = { 0 }; -int IDebugLog::indentLevel = 0; -int IDebugLog::rightMargin = 0; -int IDebugLog::cursorPos = 0; -int IDebugLog::inBlock = 0; -bool IDebugLog::autoFlush = true; -IDebugLog::LogLevel IDebugLog::logLevel = IDebugLog::kLevel_DebugMessage; -IDebugLog::LogLevel IDebugLog::printLevel = IDebugLog::kLevel_Message; - -IDebugLog::IDebugLog() -{ - // -} - -IDebugLog::IDebugLog(const char * name) -{ - Open(name); -} - -IDebugLog::~IDebugLog() -{ - if(logFile) - fclose(logFile); -} - -void IDebugLog::Open(const char * path) -{ - logFile = _fsopen(path, "w", _SH_DENYWR); - - if(!logFile) - { - UInt32 id = 0; - char name[1024]; - - do - { - sprintf_s(name, sizeof(name), "%s%d", path, id); - id++; - - logFile = NULL; - logFile = _fsopen(name, "w", _SH_DENYWR); - } - while(!logFile && (id < 5)); - } -} - -void IDebugLog::OpenRelative(int folderID, const char * relPath) -{ - char path[MAX_PATH]; - - HRESULT err = SHGetFolderPath(NULL, folderID | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, path); - if(!SUCCEEDED(err)) - { - _FATALERROR("SHGetFolderPath %08X failed (result = %08X lasterr = %08X)", folderID, err, GetLastError()); - } - ASSERT_CODE(SUCCEEDED(err), err); - - strcat_s(path, sizeof(path), relPath); - - IFileStream::MakeAllDirs(path); - - Open(path); -} - -/** - * Output a non-formatted message to the log file - * - * @param message the message - * @param source the source of the message, or NULL to use the previous source - */ -void IDebugLog::Message(const char * message, const char * source, bool newLine) -{ - if(source) - SetSource(source); - - if(inBlock) - { - SeekCursor(RoundToTab((indentLevel * 4) + strlen(headerText))); - } - else - { - SeekCursor(indentLevel * 4); - - PrintText(headerText); - } - - PrintText(message); - - if(newLine) - NewLine(); -} - -/** - * Output a formatted message to the log file - * - * @note It is impossible to set the source of a formatted message. - * The previous source will be used. - */ -void IDebugLog::FormattedMessage(const char * fmt, ...) -{ - va_list argList; - - va_start(argList, fmt); - vsprintf_s(formatBuf, sizeof(formatBuf), fmt, argList); - Message(formatBuf); - va_end(argList); -} - -/** - * Output a formatted message to the log file - * - * @note It is impossible to set the source of a formatted message. - * The previous source will be used. - */ -void IDebugLog::FormattedMessage(const char * fmt, va_list args) -{ - vsprintf_s(formatBuf, sizeof(formatBuf), fmt, args); - Message(formatBuf); -} - -void IDebugLog::Log(LogLevel level, const char * fmt, va_list args) -{ - bool log = (level <= logLevel); - bool print = (level <= printLevel); - - if(log || print) - vsprintf_s(formatBuf, sizeof(formatBuf), fmt, args); - - if(log) - Message(formatBuf); - - if(print) - printf("%s\n", formatBuf); -} - -void IDebugLog::LogNNL(LogLevel level, const char * fmt, va_list args) -{ - bool log = (level <= logLevel); - bool print = (level <= printLevel); - - if(log || print) - vsprintf_s(formatBuf, sizeof(formatBuf), fmt, args); - - if(log) - Message(formatBuf, NULL, false); - - if(print) - printf("%s", formatBuf); -} - -/** - * Set the current message source - */ -void IDebugLog::SetSource(const char * source) -{ - strcpy_s(sourceBuf, sizeof(sourceBuf), source); - strcpy_s(headerText, sizeof(headerText), "[ ]\t"); - - char * tgt = headerText + 1; - char * src = sourceBuf; - - for(int i = 0; (i < 8) && *src; i++, tgt++, src++) - *tgt = *src; -} - -/** - * Clear the current message source - */ -void IDebugLog::ClearSource(void) -{ - sourceBuf[0] = 0; -} - -/** - * Increase the indentation level - */ -void IDebugLog::Indent(void) -{ - indentLevel++; -} - -/** - * Decrease the indentation level - */ -void IDebugLog::Outdent(void) -{ - if(indentLevel) - indentLevel--; -} - -/** - * Enter a logical block - */ -void IDebugLog::OpenBlock(void) -{ - SeekCursor(indentLevel * 4); - - PrintText(headerText); - - inBlock = 1; -} - -/** - * Close a logical block - */ -void IDebugLog::CloseBlock(void) -{ - inBlock = 0; -} - -/** - * Enable/disable autoflush - * - * @param inAutoFlush autoflush state - */ -void IDebugLog::SetAutoFlush(bool inAutoFlush) -{ - autoFlush = inAutoFlush; -} - -/** - * Print spaces to the log - * - * If possible, tabs are used instead of spaces. - */ -void IDebugLog::PrintSpaces(int numSpaces) -{ - int originalNumSpaces = numSpaces; - - if(logFile) - { - while(numSpaces > 0) - { - if(numSpaces >= TabSize()) - { - numSpaces -= TabSize(); - fputc('\t', logFile); - } - else - { - numSpaces--; - fputc(' ', logFile); - } - } - } - - cursorPos += originalNumSpaces; -} - -/** - * Prints raw text to the log file - */ -void IDebugLog::PrintText(const char * buf) -{ - if(logFile) - { - fputs(buf, logFile); - if(autoFlush) - fflush(logFile); - } - - const char * traverse = buf; - char data; - - while(data = *traverse++) - { - if(data == '\t') - cursorPos += TabSize(); - else - cursorPos++; - } -} - -/** - * Moves to the next line of the log file - */ -void IDebugLog::NewLine(void) -{ - if(logFile) - { - fputc('\n', logFile); - - if(autoFlush) - fflush(logFile); - } - - cursorPos = 0; -} - -/** - * Prints spaces to align the cursor to the requested position - * - * @note The cursor move will not be performed if the request would move the cursor - * backwards. - */ -void IDebugLog::SeekCursor(int position) -{ - if(position > cursorPos) - PrintSpaces(position - cursorPos); -} - -/** - * Returns the number of spaces a tab would occupy at the current cursor position - */ -int IDebugLog::TabSize(void) -{ - return ((~cursorPos) & 3) + 1; -} - -/** - * Rounds a number of spaces to the nearest tab - */ -int IDebugLog::RoundToTab(int spaces) -{ - return (spaces + 3) & ~3; -} diff --git a/source/fs.dll/common/IDebugLog.h b/source/fs.dll/common/IDebugLog.h deleted file mode 100644 index 31cc36bd..00000000 --- a/source/fs.dll/common/IDebugLog.h +++ /dev/null @@ -1,133 +0,0 @@ -#pragma once - -#include - -/** - * A simple debug log file - * - * This class supports prefix blocks describing the source of the log event. - * It also allows logical blocks and outlining.\n - */ -class IDebugLog -{ - public: - IDebugLog(); - IDebugLog(const char * name); - ~IDebugLog(); - - static void Open(const char * path); - static void OpenRelative(int folderID, const char * relPath); - - static void Message(const char * message, const char * source = NULL, bool newLine = true); - static void FormattedMessage(const char * fmt, ...); - static void FormattedMessage(const char * fmt, va_list args); - - enum LogLevel - { - kLevel_FatalError = 0, - kLevel_Error, - kLevel_Warning, - kLevel_Message, - kLevel_VerboseMessage, - kLevel_DebugMessage - }; - - static void Log(LogLevel level, const char * fmt, va_list args); - static void LogNNL(LogLevel level, const char * fmt, va_list args); // No new line - - static void SetSource(const char * source); - static void ClearSource(void); - - static void Indent(void); - static void Outdent(void); - - static void OpenBlock(void); - static void CloseBlock(void); - - static void SetAutoFlush(bool inAutoFlush); - - static void SetLogLevel(LogLevel in) { logLevel = in; } - static void SetPrintLevel(LogLevel in) { printLevel = in; } - - private: - static void PrintSpaces(int numSpaces); - static void PrintText(const char * buf); - static void NewLine(void); - - static void SeekCursor(int position); - - static int TabSize(void); - static int RoundToTab(int spaces); - - static FILE * logFile; //!< the output file - - static char sourceBuf[16]; //!< name of current source, used in prefix - static char headerText[16]; //!< current text to use as line prefix - static char formatBuf[8192]; //!< temp buffer used for formatted messages - - static int indentLevel; //!< the current indentation level (in tabs) - static int rightMargin; //!< the column at which text should be wrapped - static int cursorPos; //!< current cursor position - static int inBlock; //!< are we in a block? - - static bool autoFlush; //!< automatically flush the file after writing - - static LogLevel logLevel; //!< least important log level to write - static LogLevel printLevel; //!< least important log level to print -}; - -extern IDebugLog gLog; - -inline void _FATALERROR(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_FatalError, fmt, args); - va_end(args); -} - -inline void _ERROR(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_Error, fmt, args); - va_end(args); -} - -inline void _WARNING(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_Warning, fmt, args); - va_end(args); -} - -inline void _MESSAGE(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_Message, fmt, args); - va_end(args); -} - -inline void _VMESSAGE(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_VerboseMessage, fmt, args); - va_end(args); -} - -inline void _DMESSAGE(const char * fmt, ...) -{ - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_DebugMessage, fmt, args); - va_end(args); -} diff --git a/source/fs.dll/common/IDirectoryIterator.cpp b/source/fs.dll/common/IDirectoryIterator.cpp deleted file mode 100644 index b815f134..00000000 --- a/source/fs.dll/common/IDirectoryIterator.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "IDirectoryIterator.h" -#include - -IDirectoryIterator::IDirectoryIterator(const char * path, const char * match) -:m_searchHandle(INVALID_HANDLE_VALUE), m_done(false) -{ - if(!match) match = "*"; - - strcpy_s(m_path, sizeof(m_path), path); - - char wildcardPath[MAX_PATH]; - sprintf_s(wildcardPath, sizeof(wildcardPath), "%s\\%s", path, match); - - m_searchHandle = FindFirstFile(wildcardPath, &m_result); - if(m_searchHandle == INVALID_HANDLE_VALUE) - m_done = true; -} - -IDirectoryIterator::~IDirectoryIterator() -{ - if(m_searchHandle != INVALID_HANDLE_VALUE) - FindClose(m_searchHandle); -} - -void IDirectoryIterator::GetFullPath(char * out, UInt32 outLen) -{ - sprintf_s(out, outLen, "%s\\%s", m_path, m_result.cFileName); -} - -std::string IDirectoryIterator::GetFullPath(void) -{ - return std::string(m_path) + "\\" + std::string(m_result.cFileName); -} - -void IDirectoryIterator::Next(void) -{ - BOOL result = FindNextFile(m_searchHandle, &m_result); - if(!result) - m_done = true; -} - -bool IDirectoryIterator::Done(void) -{ - return m_done; -} diff --git a/source/fs.dll/common/IDirectoryIterator.h b/source/fs.dll/common/IDirectoryIterator.h deleted file mode 100644 index 7759c214..00000000 --- a/source/fs.dll/common/IDirectoryIterator.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -class IDirectoryIterator -{ -public: - IDirectoryIterator(const char * path, const char * match = NULL); - virtual ~IDirectoryIterator(); - - WIN32_FIND_DATA * Get(void) { return &m_result; } - void GetFullPath(char * out, UInt32 outLen); - std::string GetFullPath(void); - - void Next(void); - bool Done(void); - -private: - IDirectoryIterator(); // undefined, disallow - - HANDLE m_searchHandle; - WIN32_FIND_DATA m_result; - bool m_done; - - char m_path[MAX_PATH]; -}; diff --git a/source/fs.dll/common/IDynamicCreate.cpp b/source/fs.dll/common/IDynamicCreate.cpp deleted file mode 100644 index 44467b39..00000000 --- a/source/fs.dll/common/IDynamicCreate.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "IDynamicCreate.h" - -#if ENABLE_IDYNAMICCREATE - -IClassRegistry _gClassRegistry; - -IClassRegistry::IClassRegistry() -{ - // -} - -IClassRegistry::~IClassRegistry() -{ - // -} - -void IClassRegistry::RegisterClassInfo(UInt32 id, IDynamicType * typeInfo) -{ - theClassRegistry[id] = typeInfo; -} - -IDynamicType * IClassRegistry::LookupClassInfo(UInt32 id) -{ - ClassRegistryType::iterator iter = theClassRegistry.find(id); - - return (iter == theClassRegistry.end()) ? NULL : (*iter).second; -} - -IDynamicType * IClassRegistry::LookupClassInfo(char * name) -{ - for(ClassRegistryType::iterator iter = theClassRegistry.begin(); iter != theClassRegistry.end(); iter++) - if(!strcmp((*iter).second->GetName(), name)) - return (*iter).second; - - return NULL; -} - -#endif diff --git a/source/fs.dll/common/IDynamicCreate.h b/source/fs.dll/common/IDynamicCreate.h deleted file mode 100644 index 7d58374a..00000000 --- a/source/fs.dll/common/IDynamicCreate.h +++ /dev/null @@ -1,118 +0,0 @@ -#pragma once - -#include -#include "common/IDataStream.h" -#include "common/IErrors.h" - -// this screws with edit-and-continue and we don't use it -#define ENABLE_IDYNAMICCREATE 0 - -#if ENABLE_IDYNAMICCREATE - -//! Get a pointer to the IDynamicType for a class. -//! @note This is not a function; the parameter must be constant. -#define GetDynType(name) (&(##name##::__DYN_DynamicType)) - -//! Declare the members used for dynamic class creation -#define DYNAMIC_DECLARE(name) \ -public: \ - class __DYN_##name##_DynamicType : public IDynamicType \ - { \ - public: \ - __DYN_##name##_DynamicType() { } \ - ~__DYN_##name##_DynamicType() { } \ - \ - virtual IDynamic * Create(void) { return new name; } \ - virtual char * GetName(void) { return #name; } \ - virtual IDynamic * Instantiate(IDataStream * stream); \ - }; \ - \ - static __DYN_##name##_DynamicType __DYN_DynamicType; \ - virtual IDynamicType * __DYN_GetDynamicType(void) { return &__DYN_DynamicType; } \ - \ - friend __DYN_##name##_DynamicType; - -//! Define the members used for dynamic class creation -#define DYNAMIC_DEFINE(name) name##::__DYN_##name##_DynamicType name##::__DYN_DynamicType; - -//! Define a dynamic instantiation handler -#define DYNAMIC_INSTANTIATE_HANDLER(name) IDynamic * name##::__DYN_##name##_DynamicType::Instantiate(IDataStream * stream) { name * object = new name; -#define END_DYNAMIC_INSTANTIATE_HANDLER return object; } - -//! Specifies that a dynamic class should not be instantiated automatically -#define NO_DYNAMIC_INSTANTIATE_HANDLER(name) DYNAMIC_INSTANTIATE_HANDLER(name) { HALT("attempted to instantiate " #name); } END_DYNAMIC_INSTANTIATE_HANDLER - -//! Casts -#define CAST(ptr, type) _DynamicCast (ptr); - -class IDynamicType; - -/** - * Pure virtual base class allowing dynamic creation of objects - * - * To allow dynamic creation of a class, publicly inherit IDynamic, add the - * macro DYNAMIC_DECLARE(classname) first in the class declaration, and add - * the macro DYNAMIC_DEFINE(classname) somewhere in the class definition file. - */ -class IDynamic -{ - public: - IDynamic() { } - virtual ~IDynamic() { } - - virtual IDynamicType * __DYN_GetDynamicType(void) = 0; -}; - -/** - * Pure virtual base class allowing class instantiation and information retrieval - */ -class IDynamicType -{ - public: - IDynamicType() { } - virtual ~IDynamicType() { } - - virtual IDynamic * Create(void) = 0; - virtual char * GetName(void) = 0; - - virtual IDynamic * Instantiate(IDataStream * stream) = 0; -}; - -//! -template -T * _DynamicCast(IDynamic * ptr) -{ - if(ptr && (&T::__DYN_DynamicType == ptr->__DYN_GetDynamicType())) - return static_cast(ptr); - - return NULL; -} - -/** - * Registry of dynamic classes - */ -class IClassRegistry -{ - public: - IClassRegistry(); - ~IClassRegistry(); - - static void RegisterClassInfo(UInt32 id, IDynamicType * typeInfo); - - static IDynamicType * LookupClassInfo(UInt32 id); - static IDynamicType * LookupClassInfo(char * name); - - static IDynamic * Create(UInt32 id) { IDynamicType * info = LookupClassInfo(id); return info ? info->Create() : NULL; } - static IDynamic * Create(char * name) { IDynamicType * info = LookupClassInfo(name); return info ? info->Create() : NULL; } - - static IDynamic * Instantiate(UInt32 id, IDataStream * stream) { IDynamicType * info = LookupClassInfo(id); return info ? info->Instantiate(stream) : NULL; } - static IDynamic * Instantiate(char * name, IDataStream * stream) { IDynamicType * info = LookupClassInfo(name); return info ? info->Instantiate(stream) : NULL; } - - static char * GetName(UInt32 id) { IDynamicType * info = LookupClassInfo(id); return info ? info->GetName() : NULL; } - - private: - typedef std::map ClassRegistryType; - static ClassRegistryType theClassRegistry; -}; - -#endif diff --git a/source/fs.dll/common/IErrors.cpp b/source/fs.dll/common/IErrors.cpp deleted file mode 100644 index 3fb8ac59..00000000 --- a/source/fs.dll/common/IErrors.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "common/IErrors.h" -#include "common/IDebugLog.h" -#include - -__declspec(noreturn) static void IErrors_Halt(void) -{ - // crash - *((int *)0) = 0xDEADBEEF; -} - -/** - * Report a failed assertion and exit the program - * - * @param file the file where the error occured - * @param line the line number where the error occured - * @param desc an error message - */ -void _AssertionFailed(const char * file, unsigned long line, const char * desc) -{ - _FATALERROR("Assertion failed in %s (%d): %s", file, line, desc); - - IErrors_Halt(); -} - -/** - * Report a failed assertion and exit the program - * - * @param file the file where the error occured - * @param line the line number where the error occured - * @param desc an error message - * @param code the error code - */ -void _AssertionFailed_ErrCode(const char * file, unsigned long line, const char * desc, unsigned long long code) -{ - if(code & 0xFFFFFFFF00000000) - _FATALERROR("Assertion failed in %s (%d): %s (code = %16I64X (%I64d))", file, line, desc, code, code); - else - { - UInt32 code32 = code; - _FATALERROR("Assertion failed in %s (%d): %s (code = %08X (%d))", file, line, desc, code32, code32); - } - - IErrors_Halt(); -} - -/** - * Report a failed assertion and exit the program - * - * @param file the file where the error occured - * @param line the line number where the error occured - * @param desc an error message - * @param code the error code - */ -void _AssertionFailed_ErrCode(const char * file, unsigned long line, const char * desc, const char * code) -{ - _FATALERROR("Assertion failed in %s (%d): %s (code = %s)", file, line, desc, code); - - IErrors_Halt(); -} diff --git a/source/fs.dll/common/IErrors.h b/source/fs.dll/common/IErrors.h deleted file mode 100644 index d90c5fc8..00000000 --- a/source/fs.dll/common/IErrors.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -void _AssertionFailed(const char * file, unsigned long line, const char * desc); -void _AssertionFailed_ErrCode(const char * file, unsigned long line, const char * desc, unsigned long long code); -void _AssertionFailed_ErrCode(const char * file, unsigned long line, const char * desc, const char * code); - -//! Exit the program if the condition is not true -#define ASSERT(a) do { if(!(a)) _AssertionFailed(__FILE__, __LINE__, #a); } while(0) -//! Exit the program if the condition is not true, with an error message -#define ASSERT_STR(a, b) do { if(!(a)) _AssertionFailed(__FILE__, __LINE__, b); } while(0) -//! Exit the program if the condition is not true, reporting an error code -#define ASSERT_CODE(a, b) do { if(!(a)) _AssertionFailed_ErrCode(__FILE__, __LINE__, #a, b); } while(0) -//! Exit the program if the condition is not true, reporting an error code and message -#define ASSERT_STR_CODE(a, b, c) do { if(!(a)) _AssertionFailed_ErrCode(__FILE__, __LINE__, b, c); } while(0) -//! Exit the program with an error message -#define HALT(a) do { _AssertionFailed(__FILE__, __LINE__, a); } while(0) -//! Exit the program with and error code and message -#define HALT_CODE(a, b) do { _AssertionFailed_ErrCode(__FILE__, __LINE__, a, b); } while(0) - -// based on the boost implementation of static asserts -template struct StaticAssertFailure; -template <> struct StaticAssertFailure { enum { a = 1 }; }; -template struct static_assert_test { }; - -#define __MACRO_JOIN__(a, b) __MACRO_JOIN_2__(a, b) -#define __MACRO_JOIN_2__(a, b) __MACRO_JOIN_3__(a, b) -#define __MACRO_JOIN_3__(a, b) a##b -#define __PREPRO_TOKEN_STR2__(a) #a -#define __PREPRO_TOKEN_STR__(a) __PREPRO_TOKEN_STR2__(a) -#define __LOC__ __FILE__ "("__PREPRO_TOKEN_STR__(__LINE__)") : " - -#define STATIC_ASSERT(a) typedef static_assert_test )> __MACRO_JOIN__(static_assert_typedef_, __COUNTER__) diff --git a/source/fs.dll/common/IEvent.cpp b/source/fs.dll/common/IEvent.cpp deleted file mode 100644 index d36a4640..00000000 --- a/source/fs.dll/common/IEvent.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "IEvent.h" - -IEvent::IEvent() -{ - theEvent = CreateEvent(NULL, true, true, NULL); - ASSERT(theEvent); - - blockCount.Set(0); -} - -IEvent::~IEvent() -{ - CloseHandle(theEvent); -} - -bool IEvent::Block(void) -{ - if(blockCount.Increment() == 1) - return (ResetEvent(theEvent) != 0); - else - return true; -} - -bool IEvent::UnBlock(void) -{ - if(blockCount.Decrement() == 0) - return (SetEvent(theEvent) != 0); - else - return true; -} - -bool IEvent::Wait(UInt32 timeout) -{ - switch(WaitForSingleObject(theEvent, timeout)) - { - case WAIT_ABANDONED: - HALT("IEvent::Wait: got abandoned event"); - return false; - - case WAIT_OBJECT_0: - return true; - - default: - case WAIT_TIMEOUT: - gLog.FormattedMessage("IEvent::Wait: timeout"); - return false; - } -} diff --git a/source/fs.dll/common/IEvent.h b/source/fs.dll/common/IEvent.h deleted file mode 100644 index 2ebf3db8..00000000 --- a/source/fs.dll/common/IEvent.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "common/IInterlockedLong.h" - -class IEvent -{ - public: - static const UInt32 kDefaultTimeout = 1000 * 10; - - IEvent(); - ~IEvent(); - - bool Block(void); - bool UnBlock(void); - bool Wait(UInt32 timeout = kDefaultTimeout); - - bool IsBlocked(void) { return blockCount.Get() > 0; } - - private: - HANDLE theEvent; - IInterlockedLong blockCount; -}; diff --git a/source/fs.dll/common/IFIFO.cpp b/source/fs.dll/common/IFIFO.cpp deleted file mode 100644 index be27865a..00000000 --- a/source/fs.dll/common/IFIFO.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "IFIFO.h" - -IFIFO::IFIFO(UInt32 length) -{ - fifoBuf = new UInt8[length]; - fifoBufSize = length; - fifoBase = 0; - fifoDataLength = 0; -} - -IFIFO::~IFIFO() -{ - delete fifoBuf; -} - -bool IFIFO::Push(UInt8 * buf, UInt32 length) -{ - // would that overflow the buffer? - if(length > GetBufferRemain()) - return false; - - UInt32 writeOffset = GetWriteOffset(); - - // will this cross the end of the buffer? - if(writeOffset + length > fifoBufSize) - { - UInt32 segmentLength = fifoBufSize - writeOffset; - - std::memcpy(&fifoBuf[writeOffset], buf, segmentLength); - std::memcpy(fifoBuf, &buf[segmentLength], length - segmentLength); - } - else - { - std::memcpy(&fifoBuf[writeOffset], buf, length); - } - - // update pointers - fifoDataLength += length; - - return true; -} - -bool IFIFO::Pop(UInt8 * buf, UInt32 length) -{ - bool result = Peek(buf, length); - - // update pointers if we were successful - if(result) - { - fifoDataLength -= length; - fifoBase = ToRawOffset(fifoBase + length); - } - - return result; -} - -bool IFIFO::Peek(UInt8 * buf, UInt32 length) -{ - // would that underflow the buffer? - if(length > fifoDataLength) - return false; - - // will this cross the end of the buffer? - if(fifoBase + length > fifoBufSize) - { - UInt32 segmentLength = fifoBufSize - fifoBase; - - std::memcpy(buf, &fifoBuf[fifoBase], segmentLength); - std::memcpy(&buf[segmentLength], fifoBuf, length - segmentLength); - } - else - { - std::memcpy(buf, &fifoBuf[fifoBase], length); - } - - return true; -} - -void IFIFO::Clear(void) -{ - fifoDataLength = 0; - - // this isn't needed, but staying away from the buffer end is always good - fifoBase = 0; -} diff --git a/source/fs.dll/common/IFIFO.h b/source/fs.dll/common/IFIFO.h deleted file mode 100644 index 89fdfaf4..00000000 --- a/source/fs.dll/common/IFIFO.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -class IFIFO -{ - public: - IFIFO(UInt32 length = 0); - virtual ~IFIFO(); - - virtual bool Push(UInt8 * buf, UInt32 length); - virtual bool Pop(UInt8 * buf, UInt32 length); - virtual bool Peek(UInt8 * buf, UInt32 length); - virtual void Clear(void); - - UInt32 GetBufferSize(void) { return fifoBufSize; } - UInt32 GetBufferRemain(void) { return fifoBufSize - fifoDataLength; } - UInt32 GetDataLength(void) { return fifoDataLength; } - - private: - UInt32 ToRawOffset(UInt32 in) { return in % fifoBufSize; } - UInt32 ToDataOffset(UInt32 in) { return ToRawOffset(fifoBase + in); } - UInt32 GetWriteOffset(void) { return ToDataOffset(fifoDataLength); } - - UInt8 * fifoBuf; - UInt32 fifoBufSize; // size of the buffer (in bytes) - UInt32 fifoBase; // pointer to the beginning of the data block - UInt32 fifoDataLength; // size of the data block -}; diff --git a/source/fs.dll/common/IFileStream.cpp b/source/fs.dll/common/IFileStream.cpp deleted file mode 100644 index a8ebe4f5..00000000 --- a/source/fs.dll/common/IFileStream.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "IFileStream.h" -#include "IDebugLog.h" -#include "IErrors.h" -#include - -IFileStream::IFileStream() -:theFile(INVALID_HANDLE_VALUE) -{ - -} - -IFileStream::IFileStream(const char * name) -:theFile(INVALID_HANDLE_VALUE) -{ - Open(name); -} - -IFileStream::~IFileStream() -{ - Close(); -} - -/** - * Opens a file for reading and attaches it to the stream - */ -bool IFileStream::Open(const char * name) -{ - Close(); - - theFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(theFile != INVALID_HANDLE_VALUE) - { - LARGE_INTEGER temp; - - GetFileSizeEx(theFile, &temp); - - streamLength = temp.QuadPart; - streamOffset = 0; - } - - return theFile != INVALID_HANDLE_VALUE; -} - -static UINT_PTR CALLBACK BrowseEventProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam) -{ - return 0; -} - -bool IFileStream::BrowseOpen(void) -{ - bool result = false; - OPENFILENAME info; - char path[4096]; - - path[0] = 0; - - info.lStructSize = sizeof(info); - info.hwndOwner = NULL; - info.hInstance = NULL; - info.lpstrFilter = NULL; - info.lpstrCustomFilter = NULL; - info.nMaxCustFilter = 0; - info.nFilterIndex = 0; - info.lpstrFile = path; - info.nMaxFile = sizeof(path); - info.lpstrFileTitle = NULL; - info.nMaxFileTitle = 0; - info.lpstrInitialDir = NULL; - info.lpstrTitle = NULL; - info.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_ENABLEHOOK | OFN_NOCHANGEDIR; - info.lpstrDefExt = NULL; - info.lCustData = NULL; - info.lpfnHook = BrowseEventProc; - info.lpTemplateName = NULL; -// info.pvReserved = NULL; -// info.dwReserved = NULL; -// info.FlagsEx = 0; - - if(GetOpenFileName(&info)) - { - result = Open(path); - } - - return result; -} - -/** - * Creates a new file for writing, overwriting any previously-existing files, - * and attaches it to the stream - */ -bool IFileStream::Create(const char * name) -{ - Close(); - - theFile = CreateFile(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if(theFile != INVALID_HANDLE_VALUE) - { - streamLength = 0; - streamOffset = 0; - } - - return theFile != INVALID_HANDLE_VALUE; -} - -bool IFileStream::BrowseCreate(const char * defaultName, const char * defaultPath, const char * title) -{ - bool result = false; - OPENFILENAME info; - char path[4096]; - - if(defaultName) - strcpy_s(path, sizeof(path), defaultName); - - info.lStructSize = sizeof(info); - info.hwndOwner = NULL; - info.hInstance = NULL; - info.lpstrFilter = NULL; - info.lpstrCustomFilter = NULL; - info.nMaxCustFilter = 0; - info.nFilterIndex = 0; - info.lpstrFile = path; - info.nMaxFile = sizeof(path); - info.lpstrFileTitle = NULL; - info.nMaxFileTitle = 0; - info.lpstrInitialDir = defaultPath; - info.lpstrTitle = title; - info.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_ENABLEHOOK | - OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST; - info.lpstrDefExt = NULL; - info.lCustData = NULL; - info.lpfnHook = BrowseEventProc; - info.lpTemplateName = NULL; -// info.pvReserved = NULL; -// info.dwReserved = NULL; -// info.FlagsEx = 0; - - if(GetSaveFileName(&info)) - { - result = Create(path); - } - - return result; -} - -/** - * Closes the current file - */ -void IFileStream::Close(void) -{ - if(theFile) - { - CloseHandle(theFile); - theFile = INVALID_HANDLE_VALUE; - } -} - -void IFileStream::ReadBuf(void * buf, UInt32 inLength) -{ - UInt32 bytesRead; - - ReadFile(theFile, buf, inLength, &bytesRead, NULL); - - streamOffset += bytesRead; -} - -void IFileStream::WriteBuf(const void * buf, UInt32 inLength) -{ - UInt32 bytesWritten; - - // check for file expansion - if(streamOffset > streamLength) - SetEndOfFile(theFile); - - WriteFile(theFile, buf, inLength, &bytesWritten, NULL); - - streamOffset += bytesWritten; - - if(streamLength < streamOffset) - streamLength = streamOffset; -} - -void IFileStream::SetOffset(SInt64 inOffset) -{ - LARGE_INTEGER temp; - - temp.QuadPart = inOffset; - - SetFilePointerEx(theFile, temp, NULL, FILE_BEGIN); - streamOffset = inOffset; -} - -void IFileStream::SetLength(UInt64 length) -{ - SetOffset(length); - SetEndOfFile(theFile); - - streamLength = length; -} - -// ### TODO: get rid of buf -void IFileStream::MakeAllDirs(const char * path) -{ - char buf[1024]; - char * traverse = buf; - - while(1) - { - char data = *path++; - - if(!data) - break; - - if((data == '\\') || (data == '/')) - { - *traverse = 0; - _mkdir(buf); - } - - *traverse++ = data; - } -} - -char * IFileStream::ExtractFileName(char * path) -{ - char * traverse = path; - char * lastSlash = NULL; - - while(1) - { - char data = *traverse++; - - if((data == '\\') || (data == '/')) - lastSlash = traverse; - - if(!data) - break; - } - - return lastSlash; -} diff --git a/source/fs.dll/common/IFileStream.h b/source/fs.dll/common/IFileStream.h deleted file mode 100644 index 01aa9555..00000000 --- a/source/fs.dll/common/IFileStream.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "common/IDataStream.h" - -/** - * An input file stream - */ -class IFileStream : public IDataStream -{ - public: - IFileStream(); - IFileStream(const char * name); - ~IFileStream(); - - bool Open(const char * name); - bool BrowseOpen(void); - - bool Create(const char * name); - bool BrowseCreate(const char * defaultName = NULL, const char * defaultPath = NULL, const char * title = NULL); - - void Close(void); - - HANDLE GetHandle(void) { return theFile; } - - virtual void ReadBuf(void * buf, UInt32 inLength); - virtual void WriteBuf(const void * buf, UInt32 inLength); - virtual void SetOffset(SInt64 inOffset); - - // can truncate. implicitly seeks to the end of the file - void SetLength(UInt64 length); - - static void MakeAllDirs(const char * path); - static char * ExtractFileName(char * path); - - protected: - HANDLE theFile; -}; diff --git a/source/fs.dll/common/IInterlockedLong.cpp b/source/fs.dll/common/IInterlockedLong.cpp deleted file mode 100644 index fd3ec9e9..00000000 --- a/source/fs.dll/common/IInterlockedLong.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "IInterlockedLong.h" - -// all functions are inlined diff --git a/source/fs.dll/common/IInterlockedLong.h b/source/fs.dll/common/IInterlockedLong.h deleted file mode 100644 index 73b44867..00000000 --- a/source/fs.dll/common/IInterlockedLong.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -struct IInterlockedLong -{ - public: - long Increment(void) { return InterlockedIncrement(&value); } - long Decrement(void) { return InterlockedDecrement(&value); } - long Get(void) { return value; } - long Set(long in) { return InterlockedExchange(&value, in); } - long TrySetIf(long newValue, long expectedOldValue) - { return InterlockedCompareExchange(&value, newValue, expectedOldValue); } - - // interlock variable semantics - bool Claim(void) { return TrySetIf(1, 0) == 0; } - bool Release(void) { return TrySetIf(0, 1) == 1; } - - private: - volatile long value; -}; diff --git a/source/fs.dll/common/ILinkedList.h b/source/fs.dll/common/ILinkedList.h deleted file mode 100644 index 3f00dee7..00000000 --- a/source/fs.dll/common/ILinkedList.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once - -// ILink members must be public -template -struct ILink -{ - static const UInt32 s_offset; - - ILink * next; - ILink * prev; - - T * GetObj(void) { return (T *)(((uintptr_t)this) - s_offset); } - - static ILink * GetLink(T * obj) { return (ILink *)(((uintptr_t)obj) + s_offset); } - - void Unlink(void) - { - if(next) next->prev = prev; - if(prev) prev->next = next; - - next = prev = NULL; - } - - void LinkBefore(T * obj) - { - LinkBefore(GetLink(obj)); - } - - void LinkAfter(T * obj) - { - LinkAfter(GetLink(obj)); - } - - void LinkBefore(ILink * link) - { - link->next = this; - link->prev = prev; - - if(prev) - { - prev->next = link; - } - - prev = link; - } - - void LinkAfter(ILink * link) - { - link->next = next; - link->prev = this; - - if(next) - { - next->prev = link; - } - - next = link; - } -}; - -template -struct ILinkedList -{ - ILink begin; - ILink end; - - void Reset(void) - { - begin.next = &end; - begin.prev = NULL; - end.next = NULL; - end.prev = &begin; - } - - void PushFront(T * obj) - { - ILink * objLink = ILink ::GetLink(obj); - - objLink->next = begin.next; - objLink->prev = &begin; - - if(objLink->next) - { - objLink->next->prev = objLink; - } - - begin.next = objLink; - } -}; - -#define ILINK_INIT(baseType, memberName) template const UInt32 ILink ::s_offset = offsetof(baseType, memberName) diff --git a/source/fs.dll/common/IMemPool.cpp b/source/fs.dll/common/IMemPool.cpp deleted file mode 100644 index 73afe4b6..00000000 --- a/source/fs.dll/common/IMemPool.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "IMemPool.h" - -void Test_IMemPool(void) -{ - IMemPool pool; - - _DMESSAGE("main: pool test"); - gLog.Indent(); - - _DMESSAGE("start"); - pool.Dump(); - - UInt32 * data0, * data1, * data2; - - data0 = pool.Allocate(); - _DMESSAGE("alloc0 = %08X", data0); - pool.Dump(); - - data1 = pool.Allocate(); - _DMESSAGE("alloc1 = %08X", data1); - pool.Dump(); - - data2 = pool.Allocate(); - _DMESSAGE("alloc2 = %08X", data2); - pool.Dump(); - - _DMESSAGE("free0 %08X", data0); - pool.Free(data0); - pool.Dump(); - - data0 = pool.Allocate(); - _DMESSAGE("alloc0 = %08X", data0); - pool.Dump(); - - _DMESSAGE("free2 %08X", data2); - pool.Free(data2); - pool.Dump(); - - _DMESSAGE("done"); - pool.Dump(); - - gLog.Outdent(); -} diff --git a/source/fs.dll/common/IMemPool.h b/source/fs.dll/common/IMemPool.h deleted file mode 100644 index b42578c0..00000000 --- a/source/fs.dll/common/IMemPool.h +++ /dev/null @@ -1,312 +0,0 @@ -#pragma once - -#include "common/ICriticalSection.h" - -template -class IMemPool -{ -public: - IMemPool() - :m_free(NULL), m_alloc(NULL) - { - Reset(); - } - - ~IMemPool() { Clear(); } - - void Reset(void) - { - for(UInt32 i = 0; i < size - 1; i++) - { - m_items[i].next = &m_items[i + 1]; - } - - m_items[size - 1].next = NULL; - m_free = m_items; - m_alloc = NULL; - } - - T * Allocate(void) - { - if(m_free) - { - PoolItem * item = m_free; - m_free = m_free->next; - - item->next = m_alloc; - m_alloc = item; - - T * obj = item->GetObj(); - - new (obj) T; - return obj; - } - - return NULL; - } - - void Free(T * obj) - { - PoolItem * item = reinterpret_cast (obj); - - if(item == m_alloc) - { - m_alloc = item->next; - } - else - { - PoolItem * traverse = m_alloc; - while(traverse->next != item) - traverse = traverse->next; - traverse->next = traverse->next->next; - } - - item->next = m_free; - m_free = item; - - obj->~T(); - } - - UInt32 GetSize(void) { return size; } - - T * Begin(void) - { - T * result = NULL; - - if(m_alloc) - result = m_alloc->GetObj(); - - return result; - } - - T * Next(T * obj) - { - PoolItem * item = reinterpret_cast (obj); - PoolItem * next = item->next; - T * result = NULL; - - if(next) - result = next->GetObj(); - - return result; - } - - void Dump(void) - { - gLog.Indent(); - - _DMESSAGE("free:"); - gLog.Indent(); - for(PoolItem * traverse = m_free; traverse; traverse = traverse->next) - _DMESSAGE("%08X", traverse); - gLog.Outdent(); - - _DMESSAGE("alloc:"); - gLog.Indent(); - for(PoolItem * traverse = m_alloc; traverse; traverse = traverse->next) - _DMESSAGE("%08X", traverse); - gLog.Outdent(); - - gLog.Outdent(); - } - - bool Full(void) - { - return m_free == NULL; - } - - bool Empty(void) - { - return m_alloc == NULL; - } - - void Clear(void) - { - while(m_alloc) - Free(m_alloc->GetObj()); - } - -private: - struct PoolItem - { - UInt8 obj[sizeof(T)]; - PoolItem * next; - - T * GetObj(void) { return reinterpret_cast (obj); } - }; - - PoolItem m_items[size]; - PoolItem * m_free; - PoolItem * m_alloc; -}; - -template -class IBasicMemPool -{ -public: - IBasicMemPool() - :m_free(NULL) - { - Reset(); - } - - ~IBasicMemPool() { } - - void Reset(void) - { - for(UInt32 i = 0; i < size - 1; i++) - { - m_items[i].next = &m_items[i + 1]; - } - - m_items[size - 1].next = NULL; - m_free = m_items; - } - - T * Allocate(void) - { - if(m_free) - { - PoolItem * item = m_free; - m_free = m_free->next; - - T * obj = item->GetObj(); - - new (obj) T; - return obj; - } - - return NULL; - } - - void Free(T * obj) - { - obj->~T(); - - PoolItem * item = reinterpret_cast (obj); - - item->next = m_free; - m_free = item; - } - - UInt32 GetSize(void) { return size; } - - bool Full(void) - { - return m_free == NULL; - } - - UInt32 GetIdx(T * obj) - { - PoolItem * item = reinterpret_cast (obj); - - return item - m_items; - } - - T * GetByID(UInt32 id) - { - return m_items[id].GetObj(); - } - -private: - union PoolItem - { - UInt8 obj[sizeof(T)]; - PoolItem * next; - - T * GetObj(void) { return reinterpret_cast (obj); } - }; - - PoolItem m_items[size]; - PoolItem * m_free; -}; - -template -class IThreadSafeBasicMemPool -{ -public: - IThreadSafeBasicMemPool() - :m_free(NULL) - { - Reset(); - } - - ~IThreadSafeBasicMemPool() { } - - void Reset(void) - { - m_mutex.Enter(); - - for(UInt32 i = 0; i < size - 1; i++) - { - m_items[i].next = &m_items[i + 1]; - } - - m_items[size - 1].next = NULL; - m_free = m_items; - - m_mutex.Leave(); - } - - T * Allocate(void) - { - T * result = NULL; - - m_mutex.Enter(); - - if(m_free) - { - PoolItem * item = m_free; - m_free = m_free->next; - - m_mutex.Leave(); - - result = item->GetObj(); - - new (result) T; - } - else - { - m_mutex.Leave(); - } - - return result; - } - - void Free(T * obj) - { - obj->~T(); - - PoolItem * item = reinterpret_cast (obj); - - m_mutex.Enter(); - - item->next = m_free; - m_free = item; - - m_mutex.Leave(); - } - - UInt32 GetSize(void) { return size; } - - bool Full(void) - { - return m_free == NULL; - } - -private: - union PoolItem - { - UInt8 obj[sizeof(T)]; - PoolItem * next; - - T * GetObj(void) { return reinterpret_cast (obj); } - }; - - PoolItem m_items[size]; - PoolItem * m_free; - - ICriticalSection m_mutex; -}; - -void Test_IMemPool(void); diff --git a/source/fs.dll/common/IMutex.cpp b/source/fs.dll/common/IMutex.cpp deleted file mode 100644 index 691c0b47..00000000 --- a/source/fs.dll/common/IMutex.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "IMutex.h" - -IMutex::IMutex() -{ - theMutex = CreateMutex(NULL, true, NULL); -} - -IMutex::~IMutex() -{ - CloseHandle(theMutex); -} - -bool IMutex::Wait(UInt32 timeout) -{ - switch(WaitForSingleObject(theMutex, timeout)) - { - case WAIT_ABANDONED: - HALT("IMutex::Wait: got abandoned mutex"); - return false; - - case WAIT_OBJECT_0: - return true; - - default: - case WAIT_TIMEOUT: - gLog.FormattedMessage("IMutex::Wait: timeout"); - return false; - } -} - -void IMutex::Release(void) -{ - ASSERT_STR(ReleaseMutex(theMutex), "IMutex::Release: failed to release mutex"); -} diff --git a/source/fs.dll/common/IMutex.h b/source/fs.dll/common/IMutex.h deleted file mode 100644 index b0de17cc..00000000 --- a/source/fs.dll/common/IMutex.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -class IMutex -{ - public: - static const UInt32 kDefaultTimeout = 1000 * 10; - - IMutex(); - ~IMutex(); - - bool Wait(UInt32 timeout = kDefaultTimeout); - void Release(void); - - private: - HANDLE theMutex; -}; diff --git a/source/fs.dll/common/IPipeClient.cpp b/source/fs.dll/common/IPipeClient.cpp deleted file mode 100644 index a9c74273..00000000 --- a/source/fs.dll/common/IPipeClient.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "IPipeClient.h" - -IPipeClient::IPipeClient() -:m_pipe(INVALID_HANDLE_VALUE) -{ - // -} - -IPipeClient::~IPipeClient() -{ - Close(); -} - -bool IPipeClient::Open(const char * name) -{ - Close(); - - m_pipe = CreateFile( - name, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - 0, - NULL); - - return m_pipe != INVALID_HANDLE_VALUE; -} - -void IPipeClient::Close(void) -{ - if(m_pipe != INVALID_HANDLE_VALUE) - { - CloseHandle(m_pipe); - m_pipe = INVALID_HANDLE_VALUE; - } -} - -bool IPipeClient::ReadMessage(UInt8 * buf, UInt32 length) -{ - UInt32 bytesRead; - - ReadFile(m_pipe, buf, length, &bytesRead, NULL); - - IPipeServer::MessageHeader * header = (IPipeServer::MessageHeader *)buf; - - return - (bytesRead >= sizeof(IPipeServer::MessageHeader)) && // has a valid header - (bytesRead >= (sizeof(IPipeServer::MessageHeader) + header->length)); -} - -bool IPipeClient::WriteMessage(IPipeServer::MessageHeader * msg) -{ - UInt32 bytesWritten; - UInt32 length = sizeof(IPipeServer::MessageHeader) + msg->length; - - WriteFile(m_pipe, msg, length, &bytesWritten, NULL); - - return bytesWritten >= length; -} diff --git a/source/fs.dll/common/IPipeClient.h b/source/fs.dll/common/IPipeClient.h deleted file mode 100644 index 0cf500df..00000000 --- a/source/fs.dll/common/IPipeClient.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "common/IPipeServer.h" - -class IPipeClient -{ -public: - IPipeClient(); - virtual ~IPipeClient(); - - bool Open(const char * name); - void Close(void); - - bool ReadMessage(UInt8 * buf, UInt32 length); - bool WriteMessage(IPipeServer::MessageHeader * msg); - -private: - HANDLE m_pipe; - std::string m_name; -}; diff --git a/source/fs.dll/common/IPipeServer.cpp b/source/fs.dll/common/IPipeServer.cpp deleted file mode 100644 index 9356f923..00000000 --- a/source/fs.dll/common/IPipeServer.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "IPipeServer.h" - -IPipeServer::IPipeServer() -:m_pipe(INVALID_HANDLE_VALUE) -{ - // -} - -IPipeServer::~IPipeServer() -{ - Close(); -} - -bool IPipeServer::Open(const char * name) -{ - Close(); - - m_pipe = CreateNamedPipe( - name, - PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, - PIPE_TYPE_MESSAGE | PIPE_TYPE_MESSAGE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - 8192, 8192, - 10 * 1000, // 10 seconds - NULL); - - return m_pipe != INVALID_HANDLE_VALUE; -} - -void IPipeServer::Close(void) -{ - if(m_pipe != INVALID_HANDLE_VALUE) - { - CloseHandle(m_pipe); - m_pipe = INVALID_HANDLE_VALUE; - } -} - -bool IPipeServer::WaitForClient(void) -{ - bool result = ConnectNamedPipe(m_pipe, NULL) != 0; - - // already connected? - if(!result) - { - if(GetLastError() == ERROR_PIPE_CONNECTED) - result = true; - } - - return result; -} - -bool IPipeServer::ReadMessage(UInt8 * buf, UInt32 length) -{ - UInt32 bytesRead; - - ReadFile(m_pipe, buf, length, &bytesRead, NULL); - - MessageHeader * header = (MessageHeader *)buf; - - return - (bytesRead >= sizeof(MessageHeader)) && // has a valid header - (bytesRead >= (sizeof(MessageHeader) + header->length)); -} - -bool IPipeServer::WriteMessage(MessageHeader * msg) -{ - UInt32 bytesWritten; - UInt32 length = sizeof(MessageHeader) + msg->length; - - WriteFile(m_pipe, msg, length, &bytesWritten, NULL); - - return bytesWritten >= length; -} diff --git a/source/fs.dll/common/IPipeServer.h b/source/fs.dll/common/IPipeServer.h deleted file mode 100644 index bc68c16b..00000000 --- a/source/fs.dll/common/IPipeServer.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -class IPipeServer -{ -public: - struct MessageHeader - { - UInt32 type; - UInt32 length; - }; - - IPipeServer(); - virtual ~IPipeServer(); - - bool Open(const char * name); - void Close(void); - - bool WaitForClient(void); - - bool ReadMessage(UInt8 * buf, UInt32 length); - bool WriteMessage(MessageHeader * msg); - -private: - HANDLE m_pipe; -}; diff --git a/source/fs.dll/common/IPrefix.cpp b/source/fs.dll/common/IPrefix.cpp deleted file mode 100644 index 6231a063..00000000 --- a/source/fs.dll/common/IPrefix.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "IPrefix.h" diff --git a/source/fs.dll/common/IPrefix.h b/source/fs.dll/common/IPrefix.h deleted file mode 100644 index 675f11c8..00000000 --- a/source/fs.dll/common/IPrefix.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -// 4018 - signed/unsigned mismatch -// 4200 - zero-sized array -// 4244 - loss of data by assignment -// 4267 - possible loss of data (truncation) -// 4305 - truncation by assignment -// 4288 - disable warning for crap microsoft extension screwing up the scope of variables defined in for loops -// 4311 - pointer truncation -// 4312 - pointer extension -#pragma warning(disable: 4018 4200 4244 4267 4305 4288 4312 4311) - -#include -#include -#include -#include -#include "common/ITypes.h" -#include "common/IErrors.h" -#include "common/IDynamicCreate.h" -#include "common/IDebugLog.h" -#include "common/ISingleton.h" -#include -#include diff --git a/source/fs.dll/common/IRangeMap.cpp b/source/fs.dll/common/IRangeMap.cpp deleted file mode 100644 index 855568ef..00000000 --- a/source/fs.dll/common/IRangeMap.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "IRangeMap.h" diff --git a/source/fs.dll/common/IRangeMap.h b/source/fs.dll/common/IRangeMap.h deleted file mode 100644 index 23416b82..00000000 --- a/source/fs.dll/common/IRangeMap.h +++ /dev/null @@ -1,215 +0,0 @@ -#pragma once - -#include - -// t_key must be a numeric type -// ### you can't create a range taking up the entire range of t_key -// ### (could be done by switching from start/length -> start/end) -template -class IRangeMap -{ -public: - struct Entry - { - bool Contains(t_key addr, t_key base) - { - return (addr >= base) && (addr <= (base + length - 1)); - } - - t_key length; - t_data data; - }; - - typedef std::map EntryMapType; - typedef typename EntryMapType::iterator Iterator; - - IRangeMap() - { - // - } - - virtual ~IRangeMap() - { - // - } - - void Clear(void) - { - m_entries.clear(); - } - - t_data * Add(t_key start, t_key length) - { - t_data * result = NULL; - Entry * entry = NULL; - - t_key end = start + length - 1; - - if(end >= start) // check for overflow ### should also check for overflow on length - 1, but that's pedantic - { - // special-case empty lists - if(m_entries.empty()) - { - entry = &m_entries[start]; - } - else - { - // collision check - - EntryMapType::iterator iter = m_entries.lower_bound(start); - // iter contains the first entry at or after start (or null) - - if(iter == m_entries.begin()) - { - // there can't be anything before this entry - // so we only need to check if it's colliding with us - - if(iter->first > end) - { - // can't provide a hint because we're inserting at the top - entry = &m_entries[start]; - } - } - else - { - // see if this entry doesn't collide - // can be null (null entries don't collide) - if((iter == m_entries.end()) || (iter->first > end)) - { - // we didn't get the first entry in the map - // and there is at least one entry in the map - // therefore there's an entry before iter - EntryMapType::iterator preIter = iter; - preIter--; - - // check if this collides - // guaranteed to be the first entry before start - t_key preEnd = preIter->first + preIter->second.length - 1; - - if(preEnd < start) - { - // cool, everything's fine, allocate it - EntryMapType::iterator newEntry = m_entries.insert(preIter, EntryMapType::value_type(start, Entry())); - entry = &newEntry->second; - } - } - } - } - } - - // set up the entry - if(entry) - { - entry->length = length; - - result = &entry->data; - } - - return result; - } - - t_data * Lookup(t_key addr, t_key * base = NULL, t_key * length = NULL) - { - t_data * result = NULL; - - EntryMapType::iterator iter = LookupIter(addr); - if(iter != m_entries.end()) - { - if(base) *base = iter->first; - if(length) *length = iter->second.length; - - result = &iter->second.data; - } - - return result; - } - - bool Erase(t_key addr, t_key * base = NULL, t_key * length = NULL) - { - bool result = false; - - EntryMapType::iterator iter = LookupIter(addr); - if(iter != m_entries.end()) - { - if(base) *base = iter->first; - if(length) *length = iter->second.length; - - m_entries.erase(iter); - - result = true; - } - - return result; - } - - t_key GetDataRangeLength(t_data * data) - { - Entry * entry = reinterpret_cast (reinterpret_cast (data) - offsetof(Entry, data)); - - return entry->length; - } - - typename EntryMapType::iterator LookupIter(t_key addr) - { - EntryMapType::iterator result = m_entries.end(); - - if(!m_entries.empty()) - { - // we need to find the last entry less than or equal to addr - - // find the first entry not less than addr - EntryMapType::iterator iter = m_entries.lower_bound(addr); - - // iter is either equal to addr, greater than addr, or the end - if(iter == m_entries.end()) - { - // iter is the end - // can only be in the entry before this - // which does exist because map isn't empty - --iter; - - if(iter->second.Contains(addr, iter->first)) - { - result = iter; - } - } - // at this point iter must be valid - else if(iter->first > addr) - { - // iter is greater than addr - // can only be in the entry before this - // but there may not be an entry before this - - if(iter != m_entries.begin()) - { - --iter; - - if(iter->second.Contains(addr, iter->first)) - { - result = iter; - } - } - } - else - { - // iter is equal to addr and matches - result = iter; - } - } - - return result; - } - - typename EntryMapType::iterator Begin(void) - { - return m_entries.begin(); - } - - typename EntryMapType::iterator End(void) - { - return m_entries.end(); - } - -private: - EntryMapType m_entries; -}; diff --git a/source/fs.dll/common/IReadWriteLock.cpp b/source/fs.dll/common/IReadWriteLock.cpp deleted file mode 100644 index 211917ba..00000000 --- a/source/fs.dll/common/IReadWriteLock.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "IReadWriteLock.h" - -IReadWriteLock::IReadWriteLock() -{ - readCount.Set(0); - readBlocker.UnBlock(); - writeBlocker.UnBlock(); -} - -IReadWriteLock::~IReadWriteLock() -{ - // -} - -void IReadWriteLock::StartRead(void) -{ - enterBlocker.Enter(); - readBlocker.Wait(); - if(readCount.Increment() == 1) - writeBlocker.Block(); - enterBlocker.Leave(); -} - -void IReadWriteLock::EndRead(void) -{ - if(!readCount.Decrement()) - writeBlocker.UnBlock(); -} - -void IReadWriteLock::StartWrite(void) -{ - writeMutex.Enter(); - enterBlocker.Enter(); - readBlocker.Block(); - writeBlocker.Wait(); - enterBlocker.Leave(); -} - -void IReadWriteLock::EndWrite(void) -{ - readBlocker.UnBlock(); - writeMutex.Leave(); -} diff --git a/source/fs.dll/common/IReadWriteLock.h b/source/fs.dll/common/IReadWriteLock.h deleted file mode 100644 index d3e0984a..00000000 --- a/source/fs.dll/common/IReadWriteLock.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "common/ICriticalSection.h" -#include "common/IEvent.h" -#include "common/IInterlockedLong.h" - -class IReadWriteLock -{ - public: - IReadWriteLock(); - ~IReadWriteLock(); - - void StartRead(void); - void EndRead(void); - void StartWrite(void); - void EndWrite(void); - - private: - IEvent readBlocker; - IEvent writeBlocker; - ICriticalSection enterBlocker; - ICriticalSection writeMutex; - IInterlockedLong readCount; -}; diff --git a/source/fs.dll/common/ISegmentStream.cpp b/source/fs.dll/common/ISegmentStream.cpp deleted file mode 100644 index 7fd06184..00000000 --- a/source/fs.dll/common/ISegmentStream.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "common/ISegmentStream.h" - -ISegmentStream::ISegmentStream() -{ - streamLength = 0; -} - -ISegmentStream::~ISegmentStream() -{ - -} - -void ISegmentStream::AttachStream(IDataStream * inStream) -{ - parent = inStream; - streamLength = 0; - streamOffset = 0; -} - -void ISegmentStream::AddSegment(UInt64 offset, UInt64 length, UInt64 parentOffset) -{ - segmentInfo.push_back(SegmentInfo(offset, length, parentOffset)); - - if(streamLength < (parentOffset + length)) - streamLength = parentOffset + length; -} - -void ISegmentStream::ReadBuf(void * buf, UInt32 inLength) -{ - UInt32 remain = inLength; - UInt8 * out = (UInt8 *)buf; - - while(remain > 0) - { - SegmentInfo * info = LookupInfo(streamOffset); - ASSERT(info); - - UInt64 segmentOffset = streamOffset - info->offset; - UInt64 transferLength = info->length - segmentOffset; - - if(transferLength > remain) - transferLength = remain; - - parent->SetOffset(info->parentOffset + segmentOffset); - parent->ReadBuf(out, transferLength); - - streamOffset += transferLength; - remain -= transferLength; - } -} - -void ISegmentStream::WriteBuf(const void * buf, UInt32 inLength) -{ - HALT("ISegmentStream::WriteBuf: writing unsupported"); -} - -void ISegmentStream::SetOffset(SInt64 inOffset) -{ - SegmentInfo * info = LookupInfo(inOffset); - ASSERT(info); - - UInt64 segmentOffset = inOffset - info->offset; - - parent->SetOffset(info->parentOffset + segmentOffset); - - streamOffset = inOffset; -} - -ISegmentStream::SegmentInfo * ISegmentStream::LookupInfo(UInt64 offset) -{ - for(SegmentInfoListType::iterator iter = segmentInfo.begin(); iter != segmentInfo.end(); iter++) - if((offset >= (*iter).offset) && (offset < (*iter).offset + (*iter).length)) - return &(*iter); - - return NULL; -} diff --git a/source/fs.dll/common/ISegmentStream.h b/source/fs.dll/common/ISegmentStream.h deleted file mode 100644 index 6abe880c..00000000 --- a/source/fs.dll/common/ISegmentStream.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include "common/IDataStream.h" -#include - -/** - * An stream composed of many non-contiguous segments of a larger stream - */ -class ISegmentStream : public IDataStream -{ - public: - ISegmentStream(); - ~ISegmentStream(); - - void AttachStream(IDataStream * inStream); - - void AddSegment(UInt64 offset, UInt64 length, UInt64 parentOffset); - - virtual void ReadBuf(void * buf, UInt32 inLength); - virtual void WriteBuf(const void * buf, UInt32 inLength); - virtual void SetOffset(SInt64 inOffset); - - protected: - IDataStream * parent; - - struct SegmentInfo - { - SegmentInfo(UInt64 inOffset, UInt64 inLength, UInt64 inParentOffset) - { - offset = inOffset; - length = inLength; - parentOffset = inParentOffset; - } - - UInt64 offset; - UInt64 length; - UInt64 parentOffset; - }; - - typedef std::vector SegmentInfoListType; - SegmentInfoListType segmentInfo; - - SegmentInfo * LookupInfo(UInt64 offset); -}; diff --git a/source/fs.dll/common/ISingleton.cpp b/source/fs.dll/common/ISingleton.cpp deleted file mode 100644 index 00818f43..00000000 --- a/source/fs.dll/common/ISingleton.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "common/ISingleton.h" - -//template T * Singleton ::ms_Singleton = 0; \ No newline at end of file diff --git a/source/fs.dll/common/ISingleton.h b/source/fs.dll/common/ISingleton.h deleted file mode 100644 index 3cb16a96..00000000 --- a/source/fs.dll/common/ISingleton.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include "common/IErrors.h" - -#pragma warning(push) -#pragma warning(disable: 4311 4312) - -/** - * A singleton base class - * - * Singletons are useful when you have a class that will be instantiated once, - * like a global manager. - */ -template -class ISingleton -{ - static T * ms_Singleton; - - public: - ISingleton() - { - ASSERT(!ms_Singleton); - intptr_t offset = (intptr_t)(T *)1 - (intptr_t)(ISingleton *)(T *)1; - ms_Singleton = (T *)((intptr_t)this + offset); - } - - virtual ~ISingleton() - { - ASSERT(ms_Singleton); - ms_Singleton = 0; - } - - /** - * Returns the single instance of the derived class - */ - static T& GetSingleton(void) - { - ASSERT(ms_Singleton); - return *ms_Singleton; - } - - /** - * Returns a pointer to the single instance of the derived class - */ - static T * GetSingletonPtr(void) - { - return ms_Singleton; - } -}; - -template T * ISingleton ::ms_Singleton = 0; - -#pragma warning(pop) diff --git a/source/fs.dll/common/ITextParser.cpp b/source/fs.dll/common/ITextParser.cpp deleted file mode 100644 index e178685c..00000000 --- a/source/fs.dll/common/ITextParser.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "ITextParser.h" -#include "IDataStream.h" - -ITextParser::ITextParser() -:m_stream(NULL) -{ - // -} - -ITextParser::ITextParser(IDataStream * stream) -:m_stream(stream) -{ - // -} - -ITextParser::~ITextParser() -{ - // -} - -void ITextParser::Attach(IDataStream * stream) -{ - m_stream = stream; -} - -void ITextParser::SkipWhitespace(void) -{ - while(!m_stream->HitEOF()) - { - char data = m_stream->Peek8(); - - if(!isspace(data)) - break; - - m_stream->Skip(1); - } -} - -void ITextParser::SkipLine(void) -{ - while(!m_stream->HitEOF()) - { - char data = m_stream->Peek8(); - - if((data != '\n') && (data != '\r')) - break; - - m_stream->Skip(1); - } -} - -void ITextParser::ReadLine(char * out, UInt32 length) -{ - m_stream->ReadString(out, length, '\n', '\r'); -} - -void ITextParser::ReadToken(char * buf, UInt32 bufLength) -{ - char * traverse = buf; - - ASSERT_STR(bufLength > 0, "ITextParser::ReadToken: zero-sized buffer"); - - if(bufLength == 1) - { - buf[0] = 0; - } - else - { - bufLength--; - - for(UInt32 i = 0; (i < bufLength) && !m_stream->HitEOF(); i++) - { - UInt8 data = m_stream->Read8(); - - if(isspace(data) || !data) - break; - - *traverse++ = data; - } - - *traverse++ = 0; - } -} diff --git a/source/fs.dll/common/ITextParser.h b/source/fs.dll/common/ITextParser.h deleted file mode 100644 index 212a0733..00000000 --- a/source/fs.dll/common/ITextParser.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "common/IDataStream.h" - -class ITextParser -{ -public: - ITextParser(); - ITextParser(IDataStream * stream); - ~ITextParser(); - - void Attach(IDataStream * stream); - IDataStream * GetStream(void) { return m_stream; } - - bool HitEOF(void) { return m_stream->HitEOF(); } - - void SkipWhitespace(void); - void SkipLine(void); - - void ReadLine(char * out, UInt32 length); - void ReadToken(char * out, UInt32 length); - -private: - IDataStream * m_stream; -}; diff --git a/source/fs.dll/common/IThread.cpp b/source/fs.dll/common/IThread.cpp deleted file mode 100644 index 9b7e75c9..00000000 --- a/source/fs.dll/common/IThread.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "IThread.h" - -IThread::IThread() -{ - mainProc = NULL; - mainProcParam = NULL; - stopRequested = false; - isRunning = false; - theThread = NULL; - threadID = 0; -} - -IThread::~IThread() -{ - ForceStop(); - - if(theThread) - { - CloseHandle(theThread); - } -} - -void IThread::Start(MainProcPtr proc, void * procParam) -{ - if(!isRunning) - { - isRunning = true; - stopRequested = false; - - mainProc = proc; - mainProcParam = procParam; - - theThread = CreateThread(NULL, 0, _ThreadProc, static_cast(this), 0, &threadID); - } -} - -void IThread::Stop(void) -{ - if(isRunning) - { - stopRequested = true; - } -} - -void IThread::ForceStop(void) -{ - if(isRunning) - { - TerminateThread(theThread, 0); - - isRunning = false; - } -} - -UInt32 IThread::_ThreadProc(void * param) -{ - IThread * _this = (IThread *)param; - - if(_this->mainProc) - _this->mainProc(_this->mainProcParam); - - _this->isRunning = false; - - return 0; -} diff --git a/source/fs.dll/common/IThread.h b/source/fs.dll/common/IThread.h deleted file mode 100644 index 3601c4a6..00000000 --- a/source/fs.dll/common/IThread.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -// TODO: I really don't like the interface for this - -class IThread -{ - public: - typedef void (* MainProcPtr)(void * param); - - IThread(); - ~IThread(); - - void Start(MainProcPtr proc, void * procParam = NULL); - void Stop(void); - void ForceStop(void); - - bool IsRunning(void) { return isRunning; } - bool StopRequested(void) { return stopRequested; } - - HANDLE GetHandle(void) { return theThread; } - - protected: - MainProcPtr mainProc; - void * mainProcParam; - volatile bool stopRequested; - bool isRunning; - HANDLE theThread; - UInt32 threadID; - - private: - static UInt32 WINAPI _ThreadProc(void * param); -}; diff --git a/source/fs.dll/common/ITimer.cpp b/source/fs.dll/common/ITimer.cpp deleted file mode 100644 index 76fc6e82..00000000 --- a/source/fs.dll/common/ITimer.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include "ITimer.h" - -// QueryPerformanceCounter is very accurate, but hardware bugs can cause it to return inaccurate results -// this code uses multimedia timers to check for glitches in QPC - -double ITimer::s_secondsPerCount = 0; -TIMECAPS ITimer::s_timecaps = { 0 }; -bool ITimer::s_setTime = false; -UInt64 ITimer::s_lastQPC = 0; -UInt64 ITimer::s_qpcWrapMargin = 0; -bool ITimer::s_hasLastQPC = false; -UInt32 ITimer::s_qpcWrapCount = 0; -UInt32 ITimer::s_qpcInaccurateCount = 0; - -ITimer::ITimer() -:m_qpcBase(0), m_tickBase(0) -{ - Init(); -} - -ITimer::~ITimer() -{ - -} - -void ITimer::Init(void) -{ - if(!s_secondsPerCount) - { - // init qpc - UInt64 countsPerSecond; - BOOL res = QueryPerformanceFrequency((LARGE_INTEGER *)&countsPerSecond); - - ASSERT_STR(res, "ITimer: no high-resolution timer support"); - - s_secondsPerCount = 1.0 / countsPerSecond; - - s_qpcWrapMargin = (UInt64)(-((SInt64)(countsPerSecond * 60))); // detect if we've wrapped around by a delta greater than this - also limits max time - _MESSAGE("s_qpcWrapMargin: %016I64X", s_qpcWrapMargin); - _MESSAGE("wrap time: %fs", ((double)0xFFFFFFFFFFFFFFFF) * s_secondsPerCount); - - // init multimedia timer - timeGetDevCaps(&s_timecaps, sizeof(s_timecaps)); - - _MESSAGE("min timer period = %d", s_timecaps.wPeriodMin); - - s_setTime = (timeBeginPeriod(s_timecaps.wPeriodMin) == TIMERR_NOERROR); - if(!s_setTime) - _WARNING("couldn't change timer period"); - } -} - -void ITimer::DeInit(void) -{ - if(s_secondsPerCount) - { - if(s_setTime) - { - timeEndPeriod(s_timecaps.wPeriodMin); - s_setTime = false; - } - - if(s_qpcWrapCount) - _MESSAGE("s_qpcWrapCount: %d", s_qpcWrapCount); - - s_secondsPerCount = 0; - } -} - -void ITimer::Start(void) -{ - m_qpcBase = GetQPC(); - m_tickBase = timeGetTime(); -} - -double ITimer::GetElapsedTime(void) -{ - UInt64 qpcNow = GetQPC(); - UInt32 tickNow = timeGetTime(); - - UInt64 qpcDelta = qpcNow - m_qpcBase; - UInt64 tickDelta = tickNow - m_tickBase; - - double qpcSeconds = ((double)qpcDelta) * s_secondsPerCount; - double tickSeconds = ((double)tickDelta) * 0.001; // ticks are in milliseconds - double qpcTickDelta = qpcSeconds - tickSeconds; - - if(qpcTickDelta < 0) qpcTickDelta = -qpcTickDelta; - - // if they differ by more than one second, something's wrong, return - if(qpcTickDelta > 1) - { - s_qpcInaccurateCount++; - return tickSeconds; - } - else - { - return qpcSeconds; - } -} - -UInt64 ITimer::GetQPC(void) -{ - UInt64 now; - - QueryPerformanceCounter((LARGE_INTEGER *)&now); - - if(s_hasLastQPC) - { - UInt64 delta = now - s_lastQPC; - - if(delta > s_qpcWrapMargin) - { - // we've gone back in time, return a kludged value - - s_lastQPC = now; - now = s_lastQPC + 1; - - s_qpcWrapCount++; - } - else - { - s_lastQPC = now; - } - } - else - { - s_hasLastQPC = true; - s_lastQPC = now; - } - - return now; -} diff --git a/source/fs.dll/common/ITimer.h b/source/fs.dll/common/ITimer.h deleted file mode 100644 index 10685188..00000000 --- a/source/fs.dll/common/ITimer.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "common/ITypes.h" - -/** - * A high-resolution timer. - */ -class ITimer -{ - public: - ITimer(); - ~ITimer(); - - static void Init(void); - static void DeInit(void); - - void Start(void); - - double GetElapsedTime(void); // seconds - - private: - UInt64 m_qpcBase; // QPC - UInt32 m_tickBase; // timeGetTime - - static double s_secondsPerCount; - static TIMECAPS s_timecaps; - static bool s_setTime; - - // safe QPC stuff - static UInt64 GetQPC(void); - - static UInt64 s_lastQPC; - static UInt64 s_qpcWrapMargin; - static bool s_hasLastQPC; - - static UInt32 s_qpcWrapCount; - static UInt32 s_qpcInaccurateCount; -}; diff --git a/source/fs.dll/common/ITypes.cpp b/source/fs.dll/common/ITypes.cpp deleted file mode 100644 index 6a9539f4..00000000 --- a/source/fs.dll/common/ITypes.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "ITypes.h" - -Bitstring::Bitstring() -:data(NULL) -{ - -} - -Bitstring::Bitstring(UInt32 inLength) -:data(NULL) -{ - Alloc(inLength); -} - -Bitstring::~Bitstring() -{ - Dispose(); -} - -void Bitstring::Alloc(UInt32 inLength) -{ - Dispose(); - - inLength = (inLength + 7) & ~7; - length = inLength >> 3; - - data = new UInt8[length]; -} - -void Bitstring::Dispose(void) -{ - delete [] data; -} - -void Bitstring::Clear(void) -{ - std::memset(data, 0, length); -} - -void Bitstring::Clear(UInt32 idx) -{ - ASSERT_STR(idx < (length << 3), "Bitstring::Clear: out of range"); - - data[idx >> 3] &= ~(1 << (idx & 7)); -} - -void Bitstring::Set(UInt32 idx) -{ - ASSERT_STR(idx < (length << 3), "Bitstring::Set: out of range"); - - data[idx >> 3] |= (1 << (idx & 7)); -} - -bool Bitstring::IsSet(UInt32 idx) -{ - ASSERT_STR(idx < (length << 3), "Bitstring::IsSet: out of range"); - - return (data[idx >> 3] & (1 << (idx & 7))) ? true : false; -} - -bool Bitstring::IsClear(UInt32 idx) -{ - ASSERT_STR(idx < (length << 3), "Bitstring::IsClear: out of range"); - - return (data[idx >> 3] & (1 << (idx & 7))) ? false : true; -} diff --git a/source/fs.dll/common/ITypes.h b/source/fs.dll/common/ITypes.h deleted file mode 100644 index eab23c83..00000000 --- a/source/fs.dll/common/ITypes.h +++ /dev/null @@ -1,344 +0,0 @@ -#pragma once - -#include "common/IErrors.h" - -#pragma warning(disable: 4221) -#include - -typedef unsigned char UInt8; //!< An unsigned 8-bit integer value -typedef unsigned short UInt16; //!< An unsigned 16-bit integer value -typedef unsigned long UInt32; //!< An unsigned 32-bit integer value -typedef unsigned long long UInt64; //!< An unsigned 64-bit integer value -typedef signed char SInt8; //!< A signed 8-bit integer value -typedef signed short SInt16; //!< A signed 16-bit integer value -typedef signed long SInt32; //!< A signed 32-bit integer value -typedef signed long long SInt64; //!< A signed 64-bit integer value -typedef float Float32; //!< A 32-bit floating point value -typedef double Float64; //!< A 64-bit floating point value - -inline UInt32 Extend16(UInt32 in) -{ - return (in & 0x8000) ? (0xFFFF0000 | in) : in; -} - -inline UInt32 Extend8(UInt32 in) -{ - return (in & 0x80) ? (0xFFFFFF00 | in) : in; -} - -inline UInt16 Swap16(UInt16 in) -{ - return ((in >> 8) & 0x00FF) | - ((in << 8) & 0xFF00); -} - -inline UInt32 Swap32(UInt32 in) -{ - return ((in >> 24) & 0x000000FF) | - ((in >> 8) & 0x0000FF00) | - ((in << 8) & 0x00FF0000) | - ((in << 24) & 0xFF000000); -} - -inline UInt64 Swap64(UInt64 in) -{ - UInt64 temp; - - temp = Swap32(in); - temp <<= 32; - temp |= Swap32(in >> 32); - - return temp; -} - -inline void SwapFloat(float * in) -{ - UInt32 * temp = (UInt32 *)in; - - *temp = Swap32(*temp); -} - -inline void SwapDouble(double * in) -{ - UInt64 * temp = (UInt64 *)in; - - *temp = Swap64(*temp); -} - -inline bool IsBigEndian(void) -{ - union - { - UInt16 u16; - UInt8 u8[2]; - } temp; - - temp.u16 = 0x1234; - - return temp.u8[0] == 0x12; -} - -inline bool IsLittleEndian(void) -{ - return !IsBigEndian(); -} - -#define CHAR_CODE(a, b, c, d) (((a & 0xFF) << 0) | ((b & 0xFF) << 8) | ((c & 0xFF) << 16) | ((d & 0xFF) << 24)) -#define MACRO_SWAP16(a) ((((a) & 0x00FF) << 8) | (((a) & 0xFF00) >> 8)) -#define MACRO_SWAP32(a) ((((a) & 0x000000FF) << 24) | (((a) & 0x0000FF00) << 8) | (((a) & 0x00FF0000) >> 8) | (((a) & 0xFF000000) >> 24)) - -#define VERSION_CODE(primary, secondary, sub) (((primary & 0xFFF) << 20) | ((secondary & 0xFFF) << 8) | ((sub & 0xFF) << 0)) -#define VERSION_CODE_PRIMARY(in) ((in >> 20) & 0xFFF) -#define VERSION_CODE_SECONDARY(in) ((in >> 8) & 0xFFF) -#define VERSION_CODE_SUB(in) ((in >> 0) & 0xFF) - -#define MAKE_COLOR(a, r, g, b) (((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | ((b & 0xFF) << 0)) -#define COLOR_ALPHA(in) ((in >> 24) & 0xFF) -#define COLOR_RED(in) ((in >> 16) & 0xFF) -#define COLOR_GREEN(in) ((in >> 8) & 0xFF) -#define COLOR_BLUE(in) ((in >> 0) & 0xFF) - -/** - * A 64-bit variable combiner - * - * Useful for endian-independent value extraction. - */ -union VarCombiner -{ - UInt64 u64; - SInt64 s64; - double f64; - struct { UInt32 b; UInt32 a; } u32; - struct { SInt32 b; SInt32 a; } s32; - struct { float b; float a; } f32; - struct { UInt16 d; UInt16 c; UInt16 b; UInt16 a; } u16; - struct { SInt16 d; SInt16 c; SInt16 b; SInt16 a; } s16; - struct { UInt8 h; UInt8 g; UInt8 f; UInt8 e; - UInt8 d; UInt8 c; UInt8 b; UInt8 a; } u8; - struct { SInt8 h; SInt8 g; SInt8 f; SInt8 e; - SInt8 d; SInt8 c; SInt8 b; SInt8 a; } s8; -}; - -/** - * A bitfield. - */ -template -class Bitfield -{ - public: - Bitfield() { } - ~Bitfield() { } - - void Clear(void) { field = 0; } //!< Clears all bits - void RawSet(UInt32 data) { field = data; } //!< Modifies all bits - - void Set(UInt32 data) { field |= data; } //!< Sets individual bits - void Clear(UInt32 data) { field &= ~data; } //!< Clears individual bits - void UnSet(UInt32 data) { Clear(data); } //!< Clears individual bits - void Mask(UInt32 data) { field &= data; } //!< Masks individual bits - void Toggle(UInt32 data) { field ^= data; } //!< Toggles individual bits - void Write(UInt32 data, bool state) - { if(state) Set(data); else Clear(data); } - - T Get(void) const { return field; } //!< Gets all bits - T Get(UInt32 data) const { return field & data; } //!< Gets individual bits - T Extract(UInt32 bit) const { return (field >> bit) & 1; } //!< Extracts a bit - T ExtractField(UInt32 shift, UInt32 length) //!< Extracts a series of bits - { return (field >> shift) & (0xFFFFFFFF >> (32 - length)); } - - bool IsSet(UInt32 data) const { return ((field & data) == data) ? true : false; } //!< Are all these bits set? - bool IsUnSet(UInt32 data) const { return (field & data) ? false : true; } //!< Are all these bits clear? - bool IsClear(UInt32 data) const { return IsUnSet(data); } //!< Are all these bits clear? - - private: - T field; //!< bitfield data -}; - -typedef Bitfield Bitfield8; //!< An 8-bit bitfield -typedef Bitfield Bitfield16; //!< A 16-bit bitfield -typedef Bitfield Bitfield32; //!< A 32-bit bitfield - -STATIC_ASSERT(sizeof(Bitfield8) == 1); -STATIC_ASSERT(sizeof(Bitfield16) == 2); -STATIC_ASSERT(sizeof(Bitfield32) == 4); - -/** - * A bitstring - * - * Essentially a long bitvector. - */ -class Bitstring -{ - public: - Bitstring(); - Bitstring(UInt32 inLength); - ~Bitstring(); - - void Alloc(UInt32 inLength); - void Dispose(void); - - void Clear(void); - void Clear(UInt32 idx); - void Set(UInt32 idx); - - bool IsSet(UInt32 idx); - bool IsClear(UInt32 idx); - - private: - UInt8 * data; - UInt32 length; //!< length in bytes -}; - -/** - * Time storage - */ -class Time -{ - public: - Time() { Clear(); } - ~Time() { } - - //! Deinitialize the class - void Clear(void) { seconds = minutes = hours = 0; hasData = false; } - //! Sets the class to the current time - //! @todo implement this - void SetToNow(void) { Set(1, 2, 3); } - - //! Sets the class to the specified time - void Set(UInt8 inS, UInt8 inM, UInt8 inH) - { seconds = inS; minutes = inM; hours = inH; hasData = true; } - - //! Gets whether the class has been initialized or not - bool IsSet(void) { return hasData; } - - UInt8 GetSeconds(void) { return seconds; } //!< return the seconds portion of the time - UInt8 GetMinutes(void) { return minutes; } //!< return the minutes portion of the time - UInt8 GetHours(void) { return hours; } //!< return the hours portion of the time - - private: - UInt8 seconds, minutes, hours; - bool hasData; -}; - -const float kFloatEpsilon = 0.0001f; - -inline bool FloatEqual(float a, float b) { float magnitude = a - b; if(magnitude < 0) magnitude = -magnitude; return magnitude < kFloatEpsilon; } - -class Vector2 -{ - public: - Vector2() { } - Vector2(const Vector2 & in) { x = in.x; y = in.y; } - Vector2(float inX, float inY) { x = inX; y = inY; } - ~Vector2() { } - - void Set(float inX, float inY) { x = inX; y = inY; } - void SetX(float inX) { x = inX; } - void SetY(float inY) { y = inY; } - void Get(float * outX, float * outY) { *outX = x; *outY = y; } - float GetX(void) { return x; } - float GetY(void) { return y; } - - void Normalize(void) { float mag = Magnitude(); x /= mag; y /= mag; } - float Magnitude(void) { return sqrt(x*x + y*y); } - - void Reverse(void) { float temp = -x; x = -y; y = temp; } - - void Scale(float scale) { x *= scale; y *= scale; } - - void SwapBytes(void) { SwapFloat(&x); SwapFloat(&y); } - - Vector2 & operator+=(const Vector2 & rhs) { x += rhs.x; y += rhs.y; return *this; } - Vector2 & operator-=(const Vector2 & rhs) { x -= rhs.x; y -= rhs.y; return *this; } - Vector2 & operator*=(float rhs) { x *= rhs; y *= rhs; return *this; } - Vector2 & operator/=(float rhs) { x /= rhs; y /= rhs; return *this; } - - float x; - float y; -}; - -inline Vector2 operator+(const Vector2 & lhs, const Vector2 & rhs) -{ - return Vector2(lhs.x + rhs.x, lhs.y + rhs.y); -}; - -inline Vector2 operator-(const Vector2 & lhs, const Vector2 & rhs) -{ - return Vector2(lhs.x - rhs.x, lhs.y - rhs.y); -}; - -inline Vector2 operator*(const Vector2 & lhs, float rhs) -{ - return Vector2(lhs.x * rhs, lhs.y * rhs); -}; - -inline Vector2 operator/(const Vector2 & lhs, float rhs) -{ - return Vector2(lhs.x / rhs, lhs.y / rhs); -}; - -inline bool MaskCompare(void * lhs, void * rhs, void * mask, UInt32 size) -{ - UInt8 * lhs8 = (UInt8 *)lhs; - UInt8 * rhs8 = (UInt8 *)rhs; - UInt8 * mask8 = (UInt8 *)mask; - - for(UInt32 i = 0; i < size; i++) - if((lhs8[i] & mask8[i]) != (rhs8[i] & mask8[i])) - return false; - - return true; -} - -class Vector3 -{ -public: - Vector3() { } - Vector3(const Vector3 & in) { x = in.x; y = in.y; z = in.z; } - Vector3(float inX, float inY, float inZ) { x = inX; y = inY; z = inZ; } - ~Vector3() { } - - void Set(float inX, float inY, float inZ) { x = inX; y = inY; z = inZ; } - void Get(float * outX, float * outY, float * outZ) { *outX = x; *outY = y; *outZ = z; } - - void Normalize(void) { float mag = Magnitude(); x /= mag; y /= mag; z /= mag; } - float Magnitude(void) { return sqrt(x*x + y*y + z*z); } - - void Scale(float scale) { x *= scale; y *= scale; z *= scale; } - - void SwapBytes(void) { SwapFloat(&x); SwapFloat(&y); SwapFloat(&z); } - - Vector3 & operator+=(const Vector3 & rhs) { x += rhs.x; y += rhs.y; z += rhs.z; return *this; } - Vector3 & operator-=(const Vector3 & rhs) { x -= rhs.x; y -= rhs.y; z -= rhs.z; return *this; } - Vector3 & operator*=(const Vector3 & rhs) { x *= rhs.x; y *= rhs.y; z *= rhs.z; return *this; } - Vector3 & operator/=(const Vector3 & rhs) { x /= rhs.x; y /= rhs.y; z /= rhs.z; return *this; } - - union - { - struct - { - float x, y, z; - }; - float d[3]; - }; -}; - -inline Vector3 operator+(const Vector3 & lhs, const Vector3 & rhs) -{ - return Vector3(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); -} - -inline Vector3 operator-(const Vector3 & lhs, const Vector3 & rhs) -{ - return Vector3(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); -} - -inline Vector3 operator*(const Vector3 & lhs, const Vector3 & rhs) -{ - return Vector3(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); -} - -inline Vector3 operator/(const Vector3 & lhs, const Vector3 & rhs) -{ - return Vector3(lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); -} diff --git a/source/fs.dll/common/common.vcproj b/source/fs.dll/common/common.vcproj deleted file mode 100644 index ca58e22b..00000000 --- a/source/fs.dll/common/common.vcproj +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/fs.dll/common/common.vcxproj b/source/fs.dll/common/common.vcxproj deleted file mode 100644 index 0a5c2b51..00000000 --- a/source/fs.dll/common/common.vcxproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {20C6411C-596F-4B85-BE4E-8BC91F59D8A6} - common - Perforce Project - . - MSSCCI:Perforce SCM - Win32Proj - - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - Debug\ - Debug\ - Release\ - Release\ - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - true - - - - - Level3 - EditAndContinue - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - true - - - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common.vcxproj.filters b/source/fs.dll/common/common.vcxproj.filters deleted file mode 100644 index 9352bd34..00000000 --- a/source/fs.dll/common/common.vcxproj.filters +++ /dev/null @@ -1,196 +0,0 @@ - - - - - {3116e955-2cbf-4759-a5ae-1fd8a64cf82f} - - - {2763d79e-c908-489f-98d7-e9033c13ee81} - - - {0189b4d3-578c-4b8e-9e73-ef2a5658a139} - - - {d245593e-d1c3-4f87-b989-1841f48a2837} - - - {454cfcb6-5332-4789-8092-3e68723f9eb2} - - - {324323c6-8765-4754-bc66-3d8cf12d3ad0} - - - {1c594a4b-a331-4eeb-826c-87f764586bbd} - - - {22a19b00-a69e-48b2-a637-78e10e06217b} - - - - - streams - - - streams - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - pipe - - - pipe - - - files - - - - - - streams - - - streams - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - pipe - - - pipe - - - files - - - - - - datatypes - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_license.txt b/source/fs.dll/common/common_license.txt deleted file mode 100644 index de4de6fb..00000000 --- a/source/fs.dll/common/common_license.txt +++ /dev/null @@ -1,22 +0,0 @@ -This license applies to all of the files in src/common: - -Copyright (c) 2006-2011 Ian Patterson - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. \ No newline at end of file diff --git a/source/fs.dll/common/common_vc11.sln b/source/fs.dll/common/common_vc11.sln deleted file mode 100644 index 4835e8a9..00000000 --- a/source/fs.dll/common/common_vc11.sln +++ /dev/null @@ -1,24 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_vc11", "common_vc11.vcxproj", "{D4C128A1-73DC-4941-A453-CE55AF239BA8}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 1 - SccLocalPath0 = . - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D4C128A1-73DC-4941-A453-CE55AF239BA8}.Debug|x64.ActiveCfg = Debug|x64 - {D4C128A1-73DC-4941-A453-CE55AF239BA8}.Debug|x64.Build.0 = Debug|x64 - {D4C128A1-73DC-4941-A453-CE55AF239BA8}.Release|x64.ActiveCfg = Release|x64 - {D4C128A1-73DC-4941-A453-CE55AF239BA8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/source/fs.dll/common/common_vc11.vcxproj b/source/fs.dll/common/common_vc11.vcxproj deleted file mode 100644 index 8855adf3..00000000 --- a/source/fs.dll/common/common_vc11.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {D4C128A1-73DC-4941-A453-CE55AF239BA8} - Win32Proj - common_vc11 - - - - - - - - - 10.0.17134.0 - - - - StaticLibrary - true - v110 - Unicode - - - StaticLibrary - true - v110 - MultiByte - - - StaticLibrary - false - v110 - true - Unicode - - - StaticLibrary - false - v110 - true - MultiByte - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(Platform)_vc11\$(Configuration)\ - $(Platform)_vc11\$(Configuration)\ - - - $(SolutionDir)$(Platform)_vc11\$(Configuration)\ - $(Platform)_vc11\$(Configuration)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\.. - MultiThreadedDebug - common/IPrefix.h - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - - - Windows - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\.. - MultiThreaded - common/IPrefix.h - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc11.vcxproj.filters b/source/fs.dll/common/common_vc11.vcxproj.filters deleted file mode 100644 index dcf852ca..00000000 --- a/source/fs.dll/common/common_vc11.vcxproj.filters +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - streams - - - streams - - - datatypes - - - datatypes - - - utilities - - - utilities - - - - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - streams - - - streams - - - datatypes - - - datatypes - - - utilities - - - utilities - - - - - {9fbaeb6f-acb8-4ee5-ac77-3e3b4473acc0} - - - {c27df8b6-6fe8-4628-a6ee-51346b65cd8c} - - - {0496bc12-7477-42e4-87e7-d9565c164a32} - - - {09a8ab62-d5b8-4cb4-a24e-33761b7c98f9} - - - {0bd6b089-31f2-4bc9-acc5-4bf164af219b} - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc11.vssscc b/source/fs.dll/common/common_vc11.vssscc deleted file mode 100644 index 6cb031bc..00000000 --- a/source/fs.dll/common/common_vc11.vssscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" -} diff --git a/source/fs.dll/common/common_vc12.vcproj b/source/fs.dll/common/common_vc12.vcproj deleted file mode 100644 index d27c0b9b..00000000 --- a/source/fs.dll/common/common_vc12.vcproj +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/fs.dll/common/common_vc12.vcxproj b/source/fs.dll/common/common_vc12.vcxproj deleted file mode 100644 index f91693b3..00000000 --- a/source/fs.dll/common/common_vc12.vcxproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - - Debug_VC12 - Win32 - - - Release_VC12 - Win32 - - - - common_vc12 - {20C6411C-596F-4B85-BE4E-8BC91F59D8A6} - common - Perforce Project - . - MSSCCI:Perforce SCM - Win32Proj - - - - StaticLibrary - v140 - MultiByte - - - StaticLibrary - v140 - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.21005.1 - - - Debug VC12\ - Debug VC12\ - - - Release VC12\ - Release VC12\ - - - - Disabled - $(SolutionDir);$(SolutionDir)\..;$(SolutionDir)\..\..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - true - - - Level3 - EditAndContinue - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - $(SolutionDir);$(SolutionDir)\..;$(SolutionDir)\..\..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc12.vcxproj.filters b/source/fs.dll/common/common_vc12.vcxproj.filters deleted file mode 100644 index 9aa3e177..00000000 --- a/source/fs.dll/common/common_vc12.vcxproj.filters +++ /dev/null @@ -1,196 +0,0 @@ - - - - - {d67cef38-29e8-4e1c-8542-87d51c18a597} - - - {af002d79-6671-4d5c-bab0-86900008e5f4} - - - {a5a7c46f-70ed-4718-87fc-04bf3790af81} - - - {68a8910e-7fba-4149-ab34-c921ff1ea866} - - - {f8121a1e-0e21-4b90-83f5-94958d0cf700} - - - {0e189790-a9dc-4eff-a878-bed300c281ad} - - - {b9ea82cd-ef4a-414c-9049-2faaa9232fc6} - - - {327d9d26-a3b5-420d-82d8-ef5ca691b7ac} - - - - - streams - - - streams - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - pipe - - - pipe - - - files - - - - - - streams - - - streams - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - pipe - - - pipe - - - files - - - - - - datatypes - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc14.sln b/source/fs.dll/common/common_vc14.sln deleted file mode 100644 index 5c220f28..00000000 --- a/source/fs.dll/common/common_vc14.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_vc14", "common_vc14.vcxproj", "{472E19AB-DEF0-42DF-819B-18722E8DC822}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.ActiveCfg = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.Build.0 = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.ActiveCfg = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 2 - SccLocalPath0 = . - SccProjectUniqueName1 = common_vc14.vcxproj - SccLocalPath1 = . - EndGlobalSection -EndGlobal diff --git a/source/fs.dll/common/common_vc14.vcxproj b/source/fs.dll/common/common_vc14.vcxproj deleted file mode 100644 index cf617cd2..00000000 --- a/source/fs.dll/common/common_vc14.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - Debug_VC142 - x64 - - - Debug - x64 - - - Release_VC142 - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {472E19AB-DEF0-42DF-819B-18722E8DC822} - Win32Proj - common_vc14 - 10.0 - - - - - - - - - - - - StaticLibrary - true - v143 - MultiByte - - - StaticLibrary - true - v143 - MultiByte - - - StaticLibrary - false - v143 - true - MultiByte - - - StaticLibrary - false - v143 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(Platform)_$(PlatformToolset)\$(Configuration)\ - $(Platform)_$(PlatformToolset)\$(Configuration)\ - - - $(SolutionDir)$(Platform)_$(PlatformToolset)\$(Configuration)\ - $(Platform)_$(PlatformToolset)\$(Configuration)\ - - - $(SolutionDir)$(Platform)_$(PlatformToolset)\$(Configuration)\ - $(Platform)_$(PlatformToolset)\$(Configuration)\ - - - $(SolutionDir)$(Platform)_$(PlatformToolset)\$(Configuration)\ - $(Platform)_$(PlatformToolset)\$(Configuration)\ - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - MultiThreadedDebug - common/IPrefix.h - - - Windows - - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - MultiThreadedDebug - common/IPrefix.h - - - Windows - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories);$(SolutionDir)common;$(SolutionDir)skse64 - MultiThreaded - common/IPrefix.h - - - Windows - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - MultiThreaded - common/IPrefix.h - - - Windows - true - true - - - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc14.vcxproj.filters b/source/fs.dll/common/common_vc14.vcxproj.filters deleted file mode 100644 index 3cc066fe..00000000 --- a/source/fs.dll/common/common_vc14.vcxproj.filters +++ /dev/null @@ -1,104 +0,0 @@ - - - - - {0f6691fb-e192-419b-8bff-f445630e86a8} - - - {79afdc7c-80c1-4a8a-9e09-8a7884ac7cf4} - - - {8484df68-4f7a-496e-8427-11d2bdc94cdc} - - - {2fabee45-95d4-476f-b408-d7270ef65fce} - - - {6ae4c15e-7477-4acf-af9e-c571f5c902b4} - - - - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - streams - - - streams - - - datatypes - - - datatypes - - - utilities - - - utilities - - - - - - streams - - - streams - - - debug - - - debug - - - threads - - - threads - - - threads - - - streams - - - streams - - - datatypes - - - datatypes - - - utilities - - - utilities - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc14.vcxproj.user b/source/fs.dll/common/common_vc14.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/source/fs.dll/common/common_vc14.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc14.vssscc b/source/fs.dll/common/common_vc14.vssscc deleted file mode 100644 index 6cb031bc..00000000 --- a/source/fs.dll/common/common_vc14.vssscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" -} diff --git a/source/fs.dll/common/common_vc9.vcproj b/source/fs.dll/common/common_vc9.vcproj deleted file mode 100644 index b61c6834..00000000 --- a/source/fs.dll/common/common_vc9.vcproj +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/fs.dll/common/common_vc9.vcxproj b/source/fs.dll/common/common_vc9.vcxproj deleted file mode 100644 index fc4be3f4..00000000 --- a/source/fs.dll/common/common_vc9.vcxproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {20C6411C-596F-4B85-BE4E-8BC91F59D8A6} - common - Perforce Project - . - MSSCCI:Perforce SCM - Win32Proj - - - - StaticLibrary - v120 - MultiByte - - - StaticLibrary - v120 - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - Debug VC9\ - Debug VC9\ - - - Release VC9\ - Release VC9\ - - - - Disabled - $(SolutionDir);$(SolutionDir)\..;$(SolutionDir)\..\..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - true - - - Level3 - EditAndContinue - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - $(SolutionDir);$(SolutionDir)\..;$(SolutionDir)\..\..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/common/common_vc9.vcxproj.filters b/source/fs.dll/common/common_vc9.vcxproj.filters deleted file mode 100644 index 073f402e..00000000 --- a/source/fs.dll/common/common_vc9.vcxproj.filters +++ /dev/null @@ -1,196 +0,0 @@ - - - - - {a9593906-ad60-444b-88a2-54a75a2e2a1e} - - - {9e6a6865-4bd9-4fda-b409-c2a7a7871b14} - - - {4cffb943-c063-4354-9d64-03fe722f5ba1} - - - {2b914cdc-ec99-4427-968b-df902dadd4f4} - - - {3691376d-a08d-49b0-be2e-8c8785aac28a} - - - {29d63e0c-4310-414b-bb79-f6bdd64180a5} - - - {a2d044cd-45d4-4981-af63-0a9cded23500} - - - {5ea32332-977c-4ed1-bc83-8e6ecf62dd87} - - - - - streams - - - streams - - - streams - - - streams - - - streams\pipe - - - streams\pipe - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - files - - - - - - streams - - - streams - - - streams - - - streams - - - streams\pipe - - - streams\pipe - - - debug - - - debug - - - threads - - - threads - - - threads - - - threads - - - threads - - - threads - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - datatypes - - - utilities - - - utilities - - - utilities - - - memory - - - files - - - - - - datatypes - - - \ No newline at end of file diff --git a/source/fs.dll/forgotten_stories_skse_plugin.sln b/source/fs.dll/forgotten_stories_skse_plugin.sln deleted file mode 100644 index 8de3d928..00000000 --- a/source/fs.dll/forgotten_stories_skse_plugin.sln +++ /dev/null @@ -1,124 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.2.32616.157 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs", "fs\fs.vcxproj", "{F0CF443B-B64A-489E-A826-6924FECB0F4E}" - ProjectSection(ProjectDependencies) = postProject - {5FD1C08D-DB80-480C-A1C6-F0920005CD13} = {5FD1C08D-DB80-480C-A1C6-F0920005CD13} - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB} = {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB} - {472E19AB-DEF0-42DF-819B-18722E8DC822} = {472E19AB-DEF0-42DF-819B-18722E8DC822} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_vc14", "common\common_vc14.vcxproj", "{472E19AB-DEF0-42DF-819B-18722E8DC822}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64_common", "skse64\skse64_common\skse64_common.vcxproj", "{5FD1C08D-DB80-480C-A1C6-F0920005CD13}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64", "skse64\skse64\skse64.vcxproj", "{7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_Lib_VC142|Win32 = Debug_Lib_VC142|Win32 - Debug_Lib_VC142|x64 = Debug_Lib_VC142|x64 - Debug_VC142|Win32 = Debug_VC142|Win32 - Debug_VC142|x64 = Debug_VC142|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release_Lib_VC142|Win32 = Release_Lib_VC142|Win32 - Release_Lib_VC142|x64 = Release_Lib_VC142|x64 - Release_VC142|Win32 = Release_VC142|Win32 - Release_VC142|x64 = Release_VC142|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_Lib_VC142|Win32.ActiveCfg = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_Lib_VC142|Win32.Build.0 = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_Lib_VC142|x64.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_Lib_VC142|x64.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_VC142|Win32.ActiveCfg = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_VC142|Win32.Build.0 = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_VC142|x64.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug_VC142|x64.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug|Win32.Build.0 = Debug|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug|x64.ActiveCfg = Debug|x64 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Debug|x64.Build.0 = Debug|x64 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_Lib_VC142|Win32.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_Lib_VC142|Win32.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_Lib_VC142|x64.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_Lib_VC142|x64.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_VC142|Win32.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_VC142|Win32.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_VC142|x64.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release_VC142|x64.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release|Win32.ActiveCfg = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release|Win32.Build.0 = Release|Win32 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release|x64.ActiveCfg = Release|x64 - {F0CF443B-B64A-489E-A826-6924FECB0F4E}.Release|x64.Build.0 = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_Lib_VC142|Win32.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_Lib_VC142|Win32.Build.0 = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_Lib_VC142|x64.ActiveCfg = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_Lib_VC142|x64.Build.0 = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|Win32.ActiveCfg = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|Win32.ActiveCfg = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.ActiveCfg = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.Build.0 = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_Lib_VC142|Win32.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_Lib_VC142|Win32.Build.0 = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_Lib_VC142|x64.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_Lib_VC142|x64.Build.0 = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|Win32.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|Win32.ActiveCfg = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.ActiveCfg = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.Build.0 = Release|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_Lib_VC142|Win32.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_Lib_VC142|Win32.Build.0 = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_Lib_VC142|x64.ActiveCfg = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_Lib_VC142|x64.Build.0 = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|Win32.ActiveCfg = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|Win32.ActiveCfg = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|x64.ActiveCfg = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|x64.Build.0 = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_Lib_VC142|Win32.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_Lib_VC142|Win32.Build.0 = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_Lib_VC142|x64.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_Lib_VC142|x64.Build.0 = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|Win32.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|Win32.ActiveCfg = Release|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|x64.ActiveCfg = Release|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|x64.Build.0 = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_Lib_VC142|Win32.ActiveCfg = Debug_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_Lib_VC142|x64.ActiveCfg = Debug_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_Lib_VC142|x64.Build.0 = Debug_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|Win32.ActiveCfg = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|Win32.ActiveCfg = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|x64.ActiveCfg = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|x64.Build.0 = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_Lib_VC142|Win32.ActiveCfg = Release_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_Lib_VC142|x64.ActiveCfg = Release_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_Lib_VC142|x64.Build.0 = Release_Lib_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|Win32.ActiveCfg = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|Win32.ActiveCfg = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|x64.ActiveCfg = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B7CBD8BC-3E22-47CA-B91F-06C9B3080996} - EndGlobalSection -EndGlobal diff --git a/source/fs.dll/fs/CreatePotion.cpp b/source/fs.dll/fs/CreatePotion.cpp deleted file mode 100644 index 9a82a945..00000000 --- a/source/fs.dll/fs/CreatePotion.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "CreatePotion.h" -#include "skse64\GameObjects.h" -#include "skse64\GameData.h" -#include - -namespace CreatePotion { - - AlchemyItem * createPotion(StaticFunctionTag * tag, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations, UInt32 arraySize) - { - AlchemyItem * result = NULL; - - if (effects.Length() >= arraySize && magnitudes.Length() >= arraySize && areas.Length() >= arraySize && durations.Length() >= arraySize) { - tArray effectItems; - effectItems.Allocate(arraySize); - - UInt32 count = 0; - for (UInt32 i = 0; i < arraySize; ++i) { - EffectSetting * magicEffect = NULL; - effects.Get(&magicEffect, i); - if (magicEffect) { // Only add effects that actually exist - magnitudes.Get(&effectItems[count].magnitude, i); - areas.Get(&effectItems[count].area, i); - durations.Get(&effectItems[count].duration, i); - effectItems[count].mgef = magicEffect; - ++count; - } - } - effectItems.count = count; // Set count to existing count - CALL_MEMBER_FN(PersistentFormManager::GetSingleton(), CreatePotion)(&result, &effectItems); - Heap_Free(effectItems.entries); - } - else { - _MESSAGE("Illegal arrays for creating a potion"); - } - return result; - } - - typedef AlchemyItem*(*CreatePotionType)(StaticFunctionTag * tag, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations); - - bool RegisterFuncs(VMClassRegistry* registry) { - registry->RegisterFunction( - new NativeFunction5, VMArray, VMArray, VMArray, UInt32>("CreatePotion", "EnderalLib", CreatePotion::createPotion, registry)); - return true; - } -} diff --git a/source/fs.dll/fs/CreatePotion.h b/source/fs.dll/fs/CreatePotion.h deleted file mode 100644 index c625ba84..00000000 --- a/source/fs.dll/fs/CreatePotion.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include "skse64/PapyrusNativeFunctions.h" -#include "skse64/GameReferences.h" -#include "skse64/GameObjects.h" - -namespace CreatePotion -{ - AlchemyItem* createPotion(StaticFunctionTag* tag, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations, UInt32 arraySize); - - bool RegisterFuncs(VMClassRegistry* registry); -} diff --git a/source/fs.dll/fs/PhasmalistInventoryFunctions.cpp b/source/fs.dll/fs/PhasmalistInventoryFunctions.cpp deleted file mode 100644 index c5350126..00000000 --- a/source/fs.dll/fs/PhasmalistInventoryFunctions.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include "PhasmalistInventoryFunctions.h" -#include "skse64\GameExtraData.h" -#include "skse64\GameBSExtraData.h" -#include "skse64\GameRTTI.h" -#include "skse64\PapyrusWornObject.h" -#include "skse64\PapyrusEnchantment.h" -#include "skse64\PapyrusWeapon.h" -#include "skse64\PapyrusArmor.h" -#include "skse64\PapyrusBook.h" -#include "skse64\PapyrusSpell.h" -#include - -namespace PhasmalistScripts { - - static constexpr float magicWeight = 0.1; - - EntryDataList * getEntryData(TESObjectREFR *container) { - ExtraContainerChanges * ecc = DYNAMIC_CAST - (container->extraData.GetByType(kExtraData_ContainerChanges), BSExtraData, ExtraContainerChanges); - if (!ecc) { - return 0; - } - return ecc->data->objList; - } - - float getMagicEffectStrength(EffectSetting * magicEffect, float magnitude, float area, float duration) { - float result = magicEffect->properties.baseCost; - if (magnitude > 0) { - result *= magnitude; - } - if (area > 0) { - result *= area; - } - if (duration > 0) { - result *= duration; - } - return result; - } - - float getEnchantmentStrength(EnchantmentItem * ench) { - if (!ench) { - return 0.0; - } - float result = 0; - for (int i = papyrusEnchantment::GetNumEffects(ench) - 1; i >= 0; i--) { - result += getMagicEffectStrength( - papyrusEnchantment::GetNthEffectMagicEffect(ench, i), - papyrusEnchantment::GetNthEffectMagnitude(ench, i), - papyrusEnchantment::GetNthEffectArea(ench, i), - papyrusEnchantment::GetNthEffectDuration(ench, i) - ); - } - return result * magicWeight; - } - - float getSpellStrength(SpellItem * spell) { - if (!spell) { - return 0.0; - } - /* - * // Sum of effect costs - float result = 0; - for (int i = papyrusSpell::GetNumEffects(spell) - 1; i >= 0; i--) { - result += getMagicEffectStrength( - papyrusSpell::GetNthEffectMagicEffect(spell, i), - papyrusSpell::GetNthEffectMagnitude(spell, i), - papyrusSpell::GetNthEffectDuration(spell, i), - papyrusSpell::GetNthEffectArea(spell, i)); - } - */ - - /* - * // The costliest effect - int iCostliestEffect = papyrusSpell::GetCostliestEffectIndex(spell); - - float result = getMagicEffectStrength( - papyrusSpell::GetNthEffectMagicEffect(spell, iCostliestEffect), - papyrusSpell::GetNthEffectMagnitude(spell, iCostliestEffect), - papyrusSpell::GetNthEffectDuration(spell, iCostliestEffect), - papyrusSpell::GetNthEffectArea(spell, iCostliestEffect) - ); - */ - - // 2.0.10: Switch to flat magicka correlation - return papyrusSpell::GetMagickaCost(spell) * 1.5; - } - - float getAdditionalExtendDataStrength(InventoryEntryData * itemStack, float physicalStrength) { - float strength = 0; - for (int i = itemStack->extendDataList->Count() - 1; i >= 0; i--) { - BaseExtraList * extraData = itemStack->extendDataList->GetNthItem(i); - if (!extraData) { - continue; - } - ExtraCount * exCount = DYNAMIC_CAST(extraData->GetByType(kExtraData_Count), BSExtraData, ExtraCount); - int count = 1; - if (exCount) { - count = exCount->count; - } - if (extraData->HasType(kExtraData_Enchantment)) { - //item has been enchanted - EnchantmentItem * ench = referenceUtils::GetEnchantment(extraData); - strength += getEnchantmentStrength(ench) * count; - } - if (extraData->HasType(kExtraData_Health)) { - //item has been tempered - ExtraHealth * health = DYNAMIC_CAST(extraData->GetByType(kExtraData_Health), BSExtraData, ExtraHealth); - if (health) { - strength += physicalStrength * (health->health - 1.0) * 20 * count; - } - } - } - return strength; - } - - float getItemStackStrength(InventoryEntryData * itemStack) { - float strength = 0; - float physicalStrength = 0; - - if (itemStack->type) { - if (itemStack->type->IsWeapon()) { - TESObjectWEAP* asWeapon = static_cast(itemStack->type); - if (asWeapon) { - float baseDmg = papyrusWeapon::GetBaseDamage(asWeapon) * 1.5; - float speed = papyrusWeapon::GetSpeed(asWeapon); - physicalStrength = baseDmg * speed; - strength += physicalStrength; - strength += getEnchantmentStrength(papyrusWeapon::GetEnchantment(asWeapon)); - } - } - - if (itemStack->type->IsArmor()) { - TESObjectARMO* asArmor = static_cast(itemStack->type); - if (asArmor) { - physicalStrength = papyrusArmor::GetArmorRating(asArmor); - strength += physicalStrength; - strength += getEnchantmentStrength(papyrusArmor::GetEnchantment(asArmor)); - } - } - - if (itemStack->type->formType == kFormType_Book) { - TESObjectBOOK* asBook = static_cast(itemStack->type); - if (asBook) { - SpellItem* spell = papyrusBook::GetSpell(asBook); - return getSpellStrength(spell); - } - } - } - - strength = strength * itemStack->countDelta; - - strength += getAdditionalExtendDataStrength(itemStack, physicalStrength); - - return strength; - } - - float calculateContentStrength(StaticFunctionTag * tag, TESObjectREFR *container) { - if (!container) { - return 0.0; - } - float strength = 0; - for (int i = getEntryData(container)->Count() - 1; i >= 0; --i) { - InventoryEntryData * ed = getEntryData(container)->GetNthItem(i); - if (!ed) { - continue; - } - strength += getItemStackStrength(ed); - } - return strength; - } - - bool RegisterFuncs(VMClassRegistry* registry) { - registry->RegisterFunction( - new NativeFunction1("calculateContentStrength", "EnderalLib", PhasmalistScripts::calculateContentStrength, registry)); - return true; - } -} \ No newline at end of file diff --git a/source/fs.dll/fs/PhasmalistInventoryFunctions.h b/source/fs.dll/fs/PhasmalistInventoryFunctions.h deleted file mode 100644 index f48c8a82..00000000 --- a/source/fs.dll/fs/PhasmalistInventoryFunctions.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include "skse64/PapyrusNativeFunctions.h" -#include "skse64/GameReferences.h" - -namespace PhasmalistScripts -{ - float calculateContentStrength(StaticFunctionTag* tag, TESObjectREFR* container); - - bool RegisterFuncs(VMClassRegistry* registry); -} diff --git a/source/fs.dll/fs/exports.def b/source/fs.dll/fs/exports.def deleted file mode 100644 index 44a47e25..00000000 --- a/source/fs.dll/fs/exports.def +++ /dev/null @@ -1,5 +0,0 @@ -LIBRARY "enderalse" -EXPORTS -SKSEPlugin_Query -SKSEPlugin_Load -SKSEPlugin_Version diff --git a/source/fs.dll/fs/fs.vcxproj b/source/fs.dll/fs/fs.vcxproj deleted file mode 100644 index aa579250..00000000 --- a/source/fs.dll/fs/fs.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {F0CF443B-B64A-489E-A826-6924FECB0F4E} - plugin_example - - - - - - - - - Win32Proj - fs - 10.0 - - - - DynamicLibrary - MultiByte - true - v143 - - - DynamicLibrary - MultiByte - true - v143 - - - DynamicLibrary - MultiByte - v143 - - - DynamicLibrary - MultiByte - v143 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - ..\..\Output\Debug - $(Configuration)\ - true - true - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - false - false - - - - Disabled - $(SolutionDir);$(SolutionDir)common;$(SolutionDir)skse;C:\Users\Simon\Documents\Visual Studio 2015\Projects\SteamSDK\public;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_EXAMPLE_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - common/IPrefix.h;%(ForcedIncludeFiles) - - - exports.def - true - Windows - MachineX86 - steam_api.lib;%(AdditionalDependencies) - C:\Users\Simon\Documents\Visual Studio 2015\Projects\SteamSDK\redistributable_bin;%(AdditionalLibraryDirectories) - - - - - Disabled - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories);$(SolutionDir)common;$(SolutionDir)skse64 - WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_EXAMPLE_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - - - exports.def - true - Windows - $(SolutionDir)x64_v143\Debug\common_vc14.lib;$(SolutionDir)x64\Debug\skse64_common.lib;$(SolutionDir)x64\Debug\skse64_1_5_97.lib;%(AdditionalDependencies) - C:\Users\Simon\Documents\Visual Studio 2015\Projects\SteamSDK\redistributable_bin;%(AdditionalLibraryDirectories) - - - - - MaxSpeed - true - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_EXAMPLE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - - - exports.def - true - Windows - true - true - MachineX86 - skse.lib;%(AdditionalDependencies) - - - - - MaxSpeed - true - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories);$(SolutionDir)common;$(SolutionDir)skse64 - WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_EXAMPLE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - common/IPrefix.h;%(ForcedIncludeFiles) - stdcpp17 - - - exports.def - true - Windows - true - true - $(SolutionDir)x64_v143\Release\common_vc14.lib;$(SolutionDir)x64\Release\skse64_common.lib;$(SolutionDir)x64\Release\skse64_1_5_97.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/fs/fs.vcxproj.user b/source/fs.dll/fs/fs.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/source/fs.dll/fs/fs.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/source/fs.dll/fs/main.cpp b/source/fs.dll/fs/main.cpp deleted file mode 100644 index 2506871c..00000000 --- a/source/fs.dll/fs/main.cpp +++ /dev/null @@ -1,182 +0,0 @@ -#include "skse64/PluginAPI.h" // super -#include "skse64_common/skse_version.h" // What version of SKSE is running? -#include // CSIDL_MYCODUMENTS -#include - -#include "PhasmalistInventoryFunctions.h" -#include "CreatePotion.h" -#include "HasInvalidCells.h" - -static SKSEPapyrusInterface * g_papyrus = NULL; -static SInt32 g_NewGameStarted = 0; - -#define SKYRIMAE constexpr true - -#ifndef SKYRIMAE - -#define RUNTIME_VERSION_1_6_353 MAKE_EXE_VERSION(1, 6, 353) - -struct SKSEPluginVersionData -{ - enum - { - kVersion = 1, - }; - - enum - { - // set this if you are using a (potential at this time of writing) post-AE version of the Address Library - kVersionIndependent_AddressLibraryPostAE = 1 << 0, - // set this if you exclusively use signature matching to find your addresses and have NO HARDCODED ADDRESSES - kVersionIndependent_Signatures = 1 << 1, - }; - - UInt32 dataVersion; // set to kVersion - - UInt32 pluginVersion; // version number of your plugin - char name[256]; // null-terminated ASCII plugin name - - char author[256]; // null-terminated ASCII plugin author name (can be empty) - char supportEmail[256]; // null-terminated ASCII support email address (can be empty) - // this is not for showing to users, it's in case I need to contact you about - // a compatibility problem with your plugin - - // version compatibility - UInt32 versionIndependence; // set to one of the kVersionIndependent_ enums or zero - UInt32 compatibleVersions[16]; // zero-terminated list of RUNTIME_VERSION_ defines your plugin is compatible with - - UInt32 seVersionRequired; // minimum version of the script extender required, compared against PACKED_SKSE_VERSION - // you probably should just set this to 0 unless you know what you are doing -}; -#endif - - -void SKSEMessageHandler(SKSEMessagingInterface::Message* msg) -{ - if (msg->type == SKSEMessagingInterface::kMessage_PostLoad) { - if (std::filesystem::file_size("Data\\Dawnguard.esm") > 100000 || std::filesystem::file_size("Data\\Dragonborn.esm") > 100000 || std::filesystem::file_size("Data\\HearthFires.esm") > 100000 || std::filesystem::file_size("Data\\Update.esm") > 150000) { - MessageBox(NULL, "Skyrim DLCs are incompatible with Enderal!", "Error", MB_OK | MB_ICONERROR); - exit(EXIT_FAILURE); - } - if (std::filesystem::exists("Data\\Unofficial Skyrim Special Edition Patch.esp")) { - MessageBox(NULL, "Unofficial Skyrim Special Edition Patch is incompatible with Enderal!", "Error", MB_OK | MB_ICONERROR); - exit(EXIT_FAILURE); - } - if (std::filesystem::exists("Data\\ccBGSSSE001-Fish.esm") || std::filesystem::exists("Data\\ccBGSSSE025-AdvDSGS.esm") || std::filesystem::exists("Data\\ccBGSSSE037-Curios.esl") || std::filesystem::exists("Data\\ccQDRSSE001-SurvivalMode.esl")) { - MessageBox(NULL, "Creation Club mods are incompatible with Enderal!", "Error", MB_OK | MB_ICONERROR); - exit(EXIT_FAILURE); - } - } - else if (msg->type == SKSEMessagingInterface::kMessage_DataLoaded) { - TESWorldSpace* world = (TESWorldSpace*)LookupFormByID(0x3C); - if ((world && std::string(world->editorId.Get()) != "MQP01Home") || HasInvalidCells()) { - MessageBox(NULL, "Some installed mods are incompatible with Enderal!", "Error", MB_OK | MB_ICONERROR); - } - } - else if ((msg->type == SKSEMessagingInterface::kMessage_PostLoadGame && msg->data) || msg->type == SKSEMessagingInterface::kMessage_NewGame) { - if (g_NewGameStarted < 2) { - g_NewGameStarted++; - } - } -} - -extern "C" { - - __declspec(dllexport) SKSEPluginVersionData SKSEPlugin_Version = - { - SKSEPluginVersionData::kVersion, - - 1, -#ifdef SKYRIMAE - "fs_skse_functions", -#else - "fs_skse_functions_disabled", -#endif - "Eddoursul", - "enderal@eddoursul.win", - - 0, // not version independent - - { RUNTIME_VERSION_1_6_353, 0 }, // compatible with 1.6.353 - - 0, // works with any version of the script extender. you probably do not need to put anything here - }; - - bool SKSEPlugin_Query(const SKSEInterface * skse, PluginInfo * info) { // Called by SKSE to learn about this plugin and check that it's safe to load it - -#ifndef SKYRIMAE - gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Enderal Special Edition\\SKSE\\Enderal_SE.log"); - gLog.SetPrintLevel(IDebugLog::kLevel_Error); - gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage); - - _MESSAGE("EnderalSE"); -#endif - - // populate info structure - info->infoVersion = PluginInfo::kInfoVersion; -#ifdef SKYRIMAE - info->name = "fs_skse_functions_disabled"; -#else - info->name = skse->runtimeVersion == RUNTIME_VERSION_1_5_97 ? "fs_skse_functions" : "fs_skse_functions_disabled"; -#endif - info->version = 1; - - if (skse->isEditor) { - return false; - } - - // ### do not do anything else in this callback - // ### only fill out PluginInfo and return true/false - - // supported runtime version - return true; - } - - bool SKSEPlugin_Load(const SKSEInterface * skse) { // Called by SKSE to load this plugin - -#ifdef SKYRIMAE - gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Enderal Special Edition\\SKSE\\Enderal_AE.log"); - gLog.SetPrintLevel(IDebugLog::kLevel_Error); - gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage); - if (skse->runtimeVersion != RUNTIME_VERSION_1_6_353) { - _MESSAGE("skipping initialization of the non-AE library"); - return true; - } -#else - if (skse->runtimeVersion != RUNTIME_VERSION_1_5_97) { - _MESSAGE("skipping initialization of the non-SE library"); - return true; - } -#endif - - _MESSAGE("EnderalSE loaded"); - - auto messaging = (SKSEMessagingInterface*)skse->QueryInterface(kInterface_Messaging); - messaging->RegisterListener(skse->GetPluginHandle(), "SKSE", SKSEMessageHandler); - - g_papyrus = (SKSEPapyrusInterface *)skse->QueryInterface(kInterface_Papyrus); - - //Check if the function registration was a success... - bool btest = g_papyrus->Register(PhasmalistScripts::RegisterFuncs); - - if (btest) { - _MESSAGE("Register Succeeded: Phasmalist functions"); - } - - btest = g_papyrus->Register(CreatePotion::RegisterFuncs); - - if (btest) { - _MESSAGE("Register Succeeded: CreatePotion functions"); - } - - g_papyrus->Register([](VMClassRegistry* registry) { - registry->RegisterFunction(new NativeFunction0("NewGameCount", "EnderalLib", [](StaticFunctionTag* tag) { - return g_NewGameStarted; - }, registry)); - _MESSAGE("Register Succeeded: NewGameCount"); - return true; - }); - - return true; - } -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64.sln b/source/fs.dll/skse64/skse64.sln deleted file mode 100644 index 1d90b612..00000000 --- a/source/fs.dll/skse64/skse64.sln +++ /dev/null @@ -1,115 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2009 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64_common", "skse64_common\skse64_common.vcxproj", "{5FD1C08D-DB80-480C-A1C6-F0920005CD13}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64_loader", "skse64_loader\skse64_loader.vcxproj", "{6BDD43E4-A8D9-49CA-9F76-954718F295EE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64_loader_common", "skse64_loader_common\skse64_loader_common.vcxproj", "{FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64_steam_loader", "skse64_steam_loader\skse64_steam_loader.vcxproj", "{F592B749-2333-4C63-9E97-0EB8FEC4D734}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skse64", "skse64\skse64.vcxproj", "{7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_vc14", "..\common\common_vc14.vcxproj", "{472E19AB-DEF0-42DF-819B-18722E8DC822}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_VC142|x64 = Debug_VC142|x64 - Debug_VC142|x86 = Debug_VC142|x86 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release_VC142|x64 = Release_VC142|x64 - Release_VC142|x86 = Release_VC142|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug_VC142|x86.ActiveCfg = Debug_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|x64.ActiveCfg = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|x64.Build.0 = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Debug|x86.ActiveCfg = Debug|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release_VC142|x86.ActiveCfg = Release_VC142|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|x64.ActiveCfg = Release|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|x64.Build.0 = Release|x64 - {5FD1C08D-DB80-480C-A1C6-F0920005CD13}.Release|x86.ActiveCfg = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug_VC142|x64.ActiveCfg = Debug|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug_VC142|x64.Build.0 = Debug|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug_VC142|x86.ActiveCfg = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug_VC142|x86.Build.0 = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug|x64.ActiveCfg = Debug|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug|x64.Build.0 = Debug|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Debug|x86.ActiveCfg = Debug|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release_VC142|x64.ActiveCfg = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release_VC142|x64.Build.0 = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release_VC142|x86.ActiveCfg = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release_VC142|x86.Build.0 = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release|x64.ActiveCfg = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release|x64.Build.0 = Release|x64 - {6BDD43E4-A8D9-49CA-9F76-954718F295EE}.Release|x86.ActiveCfg = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug_VC142|x64.ActiveCfg = Debug|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug_VC142|x64.Build.0 = Debug|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug_VC142|x86.ActiveCfg = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug_VC142|x86.Build.0 = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug|x64.ActiveCfg = Debug|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug|x64.Build.0 = Debug|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Debug|x86.ActiveCfg = Debug|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release_VC142|x64.ActiveCfg = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release_VC142|x64.Build.0 = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release_VC142|x86.ActiveCfg = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release_VC142|x86.Build.0 = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release|x64.ActiveCfg = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release|x64.Build.0 = Release|x64 - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D}.Release|x86.ActiveCfg = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug_VC142|x64.ActiveCfg = Debug|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug_VC142|x64.Build.0 = Debug|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug_VC142|x86.ActiveCfg = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug_VC142|x86.Build.0 = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug|x64.ActiveCfg = Debug|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug|x64.Build.0 = Debug|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Debug|x86.ActiveCfg = Debug|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release_VC142|x64.ActiveCfg = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release_VC142|x64.Build.0 = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release_VC142|x86.ActiveCfg = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release_VC142|x86.Build.0 = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release|x64.ActiveCfg = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release|x64.Build.0 = Release|x64 - {F592B749-2333-4C63-9E97-0EB8FEC4D734}.Release|x86.ActiveCfg = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug_VC142|x86.ActiveCfg = Debug_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|x64.ActiveCfg = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|x64.Build.0 = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Debug|x86.ActiveCfg = Debug|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release_VC142|x86.ActiveCfg = Release_VC142|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|x64.ActiveCfg = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|x64.Build.0 = Release|x64 - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB}.Release|x86.ActiveCfg = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|x64.ActiveCfg = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|x64.Build.0 = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug_VC142|x86.ActiveCfg = Debug_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.ActiveCfg = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x64.Build.0 = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Debug|x86.ActiveCfg = Debug|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|x64.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|x64.Build.0 = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release_VC142|x86.ActiveCfg = Release_VC142|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.ActiveCfg = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x64.Build.0 = Release|x64 - {472E19AB-DEF0-42DF-819B-18722E8DC822}.Release|x86.ActiveCfg = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {26709489-1263-455B-B795-1D8468709B7A} - EndGlobalSection -EndGlobal diff --git a/source/fs.dll/skse64/skse64/BSModelDB.cpp b/source/fs.dll/skse64/skse64/BSModelDB.cpp deleted file mode 100644 index 17f74d31..00000000 --- a/source/fs.dll/skse64/skse64/BSModelDB.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "skse64/BSModelDB.h" - -// 206875324DD3C045FB854CB2889AFBCA94C7790B+89 -RelocPtr g_TESProcessor(0x01F5F590); diff --git a/source/fs.dll/skse64/skse64/BSModelDB.h b/source/fs.dll/skse64/skse64/BSModelDB.h deleted file mode 100644 index 15356655..00000000 --- a/source/fs.dll/skse64/skse64/BSModelDB.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" - -class NiAVObject; - -class BSModelDB -{ -public: - struct ModelData - { - UInt64 unk00; // 00 - - enum - { - kFlag_Unk1 = (1 << 0), - kFlag_Dynamic = (1 << 1), - kFlag_PostProcess = (1 << 3), - kFlag_Unk2 = (1 << 4), - kFlag_Unk3 = (1 << 5) - }; - - UInt8 modelFlags; // 08 - // ... - }; - - class BSModelProcessor - { - public: - virtual ~BSModelProcessor() { }; - - virtual void Process(ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut) { }; - }; - - class TESProcessor : public BSModelProcessor - { - public: - TESProcessor() { } - virtual ~TESProcessor() { CALL_MEMBER_FN(this, dtor)(); }; - - virtual void Process(ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut) override { CALL_MEMBER_FN(this, Impl_Process)(modelData, modelName, root, typeOut); } - - MEMBER_FN_PREFIX(TESProcessor); - // find from ??_7BSModelProcessor@BSModelDB@@6B@ - DEFINE_MEMBER_FN(dtor, void, 0x00D66540); - DEFINE_MEMBER_FN(Impl_Process, void, 0x0018B0C0, ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut); - }; -}; - -extern RelocPtr g_TESProcessor; diff --git a/source/fs.dll/skse64/skse64/CMakeLists.txt b/source/fs.dll/skse64/skse64/CMakeLists.txt deleted file mode 100644 index e6050943..00000000 --- a/source/fs.dll/skse64/skse64/CMakeLists.txt +++ /dev/null @@ -1,473 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/versioning.cmake) - -project( - skse64 - VERSION ${SKSE_VERSION_MAJOR}.${SKSE_VERSION_MINOR}.${SKSE_VERSION_PATCH} - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Build options ---- - -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) - -# ---- Dependencies ---- - -if (NOT TARGET skse64_common) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../skse64_common skse64_common) # bundled -endif() - -if (NOT TARGET xbyak) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../xbyak xbyak) # bundled -endif() - -find_package(common REQUIRED CONFIG) - -# ---- Add source files ---- - -include(cmake/headerlist.cmake) -include(cmake/sourcelist.cmake) - -source_group( - ${PROJECT_NAME} - FILES - skse64.cpp - skse64.def - skse_version.rc -) - -source_group( - ${PROJECT_NAME}/api - FILES - GameAPI.cpp - GameAPI.h - GameBSExtraData.cpp - GameBSExtraData.h - GameCamera.cpp - GameCamera.h - GameData.cpp - GameData.h - GameEvents.cpp - GameEvents.h - GameExtraData.cpp - GameExtraData.h - GameFormComponents.cpp - GameFormComponents.h - GameForms.cpp - GameForms.h - GameHandlers.cpp - GameHandlers.h - GameInput.cpp - GameInput.h - GameMenus.cpp - GameMenus.h - GameObjects.cpp - GameObjects.h - GamePathing.cpp - GameReferences.cpp - GameReferences.h - GameResources.cpp - GameResources.h - GameRTTI.cpp - GameRTTI.h - GameRTTI.inl - GameSettings.cpp - GameSettings.h - GameStreams.cpp - GameStreams.h - GameThreads.cpp - GameThreads.h - GameTypes.cpp - GameTypes.h - GameUtilities.cpp - GameUtilities.h - ObScript.cpp - ObScript.h -) - -source_group( - ${PROJECT_NAME}/hooks - FILES - Hooks_Camera.cpp - Hooks_Camera.h - Hooks_Data.cpp - Hooks_Data.h - Hooks_Debug.cpp - Hooks_Debug.h - Hooks_Diagnostics.cpp - Hooks_Diagnostics.h - Hooks_DirectInput8Create.cpp - Hooks_DirectInput8Create.h - Hooks_Event.cpp - Hooks_Event.h - Hooks_Gameplay.cpp - Hooks_Gameplay.h - Hooks_Handlers.cpp - Hooks_Handlers.h - Hooks_Memory.cpp - Hooks_Memory.h - Hooks_NetImmerse.cpp - Hooks_NetImmerse.h - Hooks_ObScript.cpp - Hooks_ObScript.h - Hooks_Papyrus.cpp - Hooks_Papyrus.h - Hooks_SaveLoad.cpp - Hooks_SaveLoad.h - Hooks_Scaleform.cpp - Hooks_Scaleform.h - Hooks_Threads.cpp - Hooks_Threads.h - Hooks_UI.cpp - Hooks_UI.h -) - -source_group( - ${PROJECT_NAME}/internal - FILES - Colors.cpp - Colors.h - CustomMenu.cpp - CustomMenu.h - GlobalLocks.cpp - GlobalLocks.h - HashUtil.cpp - HashUtil.h - InputMap.cpp - InputMap.h - InternalSerialization.cpp - InternalSerialization.h - InternalTasks.cpp - InternalTasks.h - PluginAPI.h - PluginLoadErrorDialog.rc - PluginManager.cpp - PluginManager.h - Serialization.cpp - Serialization.h - Translation.cpp - Translation.h -) - -source_group( - ${PROJECT_NAME}/netimmerse - FILES - BSModelDB.cpp - BSModelDB.h - NiAdditionalGeometryData.cpp - NiAdditionalGeometryData.h - NiControllers.cpp - NiControllers.h - NiExtraData.cpp - NiExtraData.h - NiGeometry.cpp - NiGeometry.h - NiInterpolators.cpp - NiInterpolators.h - NiLight.cpp - NiLight.h - NiMaterial.cpp - NiMaterial.h - NiNodes.cpp - NiNodes.h - NiObjects.cpp - NiObjects.h - NiProperties.cpp - NiProperties.h - NiRenderer.cpp - NiRenderer.h - NiRTTI.cpp - NiRTTI.h - NiSerialization.cpp - NiSerialization.h - NiTextures.cpp - NiTextures.h - NiTypes.cpp - NiTypes.h -) - -source_group( - ${PROJECT_NAME}/papyrus/functions - FILES - PapyrusActiveMagicEffect.cpp - PapyrusActiveMagicEffect.h - PapyrusActor.cpp - PapyrusActor.h - PapyrusActorBase.cpp - PapyrusActorBase.h - PapyrusActorValueInfo.cpp - PapyrusActorValueInfo.h - PapyrusAlias.cpp - PapyrusAlias.h - PapyrusAmmo.cpp - PapyrusAmmo.h - PapyrusArmor.cpp - PapyrusArmor.h - PapyrusArmorAddon.cpp - PapyrusArmorAddon.h - PapyrusArt.cpp - PapyrusArt.h - PapyrusBook.cpp - PapyrusBook.h - PapyrusCamera.cpp - PapyrusCamera.h - PapyrusCell.cpp - PapyrusCell.h - PapyrusClass.cpp - PapyrusClass.h - PapyrusColorForm.cpp - PapyrusColorForm.h - PapyrusCombatStyle.cpp - PapyrusCombatStyle.h - PapyrusConstructibleObject.cpp - PapyrusConstructibleObject.h - PapyrusDefaultObjectManager.cpp - PapyrusDefaultObjectManager.h - PapyrusEnchantment.cpp - PapyrusEnchantment.h - PapyrusEquipSlot.cpp - PapyrusEquipSlot.h - PapyrusFaction.cpp - PapyrusFaction.h - PapyrusFlora.cpp - PapyrusFlora.h - PapyrusForm.cpp - PapyrusForm.h - PapyrusFormList.cpp - PapyrusFormList.h - PapyrusGame.cpp - PapyrusGame.h - PapyrusGameData.cpp - PapyrusGameData.h - PapyrusHeadPart.cpp - PapyrusHeadPart.h - PapyrusIngredient.cpp - PapyrusIngredient.h - PapyrusInput.cpp - PapyrusInput.h - PapyrusKeyword.cpp - PapyrusKeyword.h - PapyrusLeveledActor.cpp - PapyrusLeveledActor.h - PapyrusLeveledItem.cpp - PapyrusLeveledItem.h - PapyrusLeveledSpell.cpp - PapyrusLeveledSpell.h - PapyrusLocation.cpp - PapyrusLocation.h - PapyrusMagicEffect.cpp - PapyrusMagicEffect.h - PapyrusMath.cpp - PapyrusMath.h - PapyrusMisc.cpp - PapyrusMisc.h - PapyrusModEvent.cpp - PapyrusModEvent.h - PapyrusNetImmerse.cpp - PapyrusNetImmerse.h - PapyrusObjectReference.cpp - PapyrusObjectReference.h - PapyrusPerk.cpp - PapyrusPerk.h - PapyrusPotion.cpp - PapyrusPotion.h - PapyrusQuest.cpp - PapyrusQuest.h - PapyrusRace.cpp - PapyrusRace.h - PapyrusReferenceAlias.cpp - PapyrusReferenceAlias.h - PapyrusScroll.cpp - PapyrusScroll.h - PapyrusShout.cpp - PapyrusShout.h - PapyrusSKSE.cpp - PapyrusSKSE.h - PapyrusSound.cpp - PapyrusSound.h - PapyrusSoundDescriptor.cpp - PapyrusSoundDescriptor.h - PapyrusSpawnerTask.cpp - PapyrusSpawnerTask.h - PapyrusSpell.cpp - PapyrusSpell.h - PapyrusStringUtil.cpp - PapyrusStringUtil.h - PapyrusTextureSet.cpp - PapyrusTextureSet.h - PapyrusTree.cpp - PapyrusTree.h - PapyrusUI.cpp - PapyrusUI.h - PapyrusUICallback.cpp - PapyrusUICallback.h - PapyrusUtility.cpp - PapyrusUtility.h - PapyrusWeapon.cpp - PapyrusWeapon.h - PapyrusWeather.cpp - PapyrusWeather.h - PapyrusWornObject.cpp - PapyrusWornObject.h -) - -source_group( - ${PROJECT_NAME}/papyrus/vm - FILES - PapyrusArgs.cpp - PapyrusArgs.h - PapyrusDelayFunctors.cpp - PapyrusDelayFunctors.h - PapyrusEventFunctor.h - PapyrusEvents.cpp - PapyrusEvents.h - PapyrusInterfaces.cpp - PapyrusInterfaces.h - PapyrusNativeFunctionDef.inl - PapyrusNativeFunctionDef_Base.inl - PapyrusNativeFunctions.cpp - PapyrusNativeFunctions.h - PapyrusObjects.cpp - PapyrusObjects.h - PapyrusValue.cpp - PapyrusValue.h - PapyrusVM.cpp - PapyrusVM.h -) - -source_group( - ${PROJECT_NAME}/scaleform - FILES - ScaleformAPI.cpp - ScaleformAPI.h - ScaleformCallbacks.cpp - ScaleformCallbacks.h - ScaleformExtendedData.cpp - ScaleformExtendedData.h - ScaleformLoader.cpp - ScaleformLoader.h - ScaleformMovie.cpp - ScaleformMovie.h - ScaleformState.cpp - ScaleformState.h - ScaleformTypes.cpp - ScaleformTypes.h - ScaleformValue.cpp - ScaleformValue.h - ScaleformVM.cpp - ScaleformVM.h -) - -# ---- Create library ---- - -add_library( - ${PROJECT_NAME} - SHARED - ${headers} - ${sources} - skse64.def - ${skse64_common_SOURCE_DIR}/skse_version.rc - PluginLoadErrorDialog.rc -) - -add_library(skse64::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/configuration.cmake) - -set_target_properties( - ${PROJECT_NAME} - PROPERTIES - OUTPUT_NAME "${PROJECT_NAME}_${RUNTIME_VERSION_MAJOR}_${RUNTIME_VERSION_MINOR}_${RUNTIME_VERSION_PATCH}" -) - -target_compile_definitions( - ${PROJECT_NAME} - PRIVATE - RUNTIME - RUNTIME_VERSION=${RUNTIME_VERSION_PACKED} -) - -target_compile_features( - ${PROJECT_NAME} - PUBLIC - cxx_std_11 -) - -target_include_directories( - ${PROJECT_NAME} - PUBLIC - $ - $ -) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC - skse64::skse64_common - Xbyak::xbyak - xse::common -) - -# ---- Configure all targets ---- - -set_target_properties( - ${PROJECT_NAME} - skse64_common - PROPERTIES - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" -) - -# ---- Create an installable target ---- - -include(GNUInstallDirs) - -install( - TARGETS - ${PROJECT_NAME} - EXPORT - ${PROJECT_NAME}-targets -) - -install( - FILES - ${headers} - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -) - -configure_file( - cmake/config.cmake.in - ${PROJECT_NAME}-config.cmake - @ONLY -) - -install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -install( - EXPORT - ${PROJECT_NAME}-targets - NAMESPACE - skse64:: - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/installation.cmake) diff --git a/source/fs.dll/skse64/skse64/Colors.cpp b/source/fs.dll/skse64/skse64/Colors.cpp deleted file mode 100644 index 806c78fd..00000000 --- a/source/fs.dll/skse64/skse64/Colors.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "Colors.h" - -UInt32 ARGBColor::GetColor() -{ - return MAKE_COLOR(m_alpha, m_red, m_green, m_blue); -} - -void ARGBColor::SetARGB(UInt8 alpha, UInt8 red, UInt8 green, UInt8 blue) -{ - m_alpha = alpha; - m_red = red; - m_green = green; - m_blue = blue; -} - -void ARGBColor::GetARGB(UInt8 & alpha, UInt8 & red, UInt8 & green, UInt8 & blue) -{ - alpha = m_alpha; - red = m_red; - green = m_green; - blue = m_blue; -} - -void ARGBColor::SetHSV(double hue, double saturation, double value) -{ - double h,s,v; - double r,g,b; - - h = hue; - s = saturation; - v = value; - - if (hue < 0.0) - hue += 360.0; - - if (s != 0.0) { - double f, p, q, t; - if (h == 360.0) - h = 0.0; - h /= 60.0; - - int i = (int)h; - f = h - i; - p = v * (1.0 - s); - q = v * (1.0 - (s * f)); - t = v * (1.0 - (s * (1.0 - f))); - - switch (i) { - case 0: r = v; g = t; b = p; break; - case 1: r = q; g = v; b = p; break; - case 2: r = p; g = v; b = t; break; - case 3: r = p; g = q; b = v; break; - case 4: r = t; g = p; b = v; break; - case 5: r = v; g = p; b = q; break; - } - } - else { - r = v; - g = v; - b = v; - } - - m_red = r * 255; - m_green = g * 255; - m_blue = b * 255; -} - -void ARGBColor::GetHSV(double & hue, double & saturation, double & value) -{ - double r,g,b, rgb_max, rgb_min, delta, h, s; - r = m_red / 255.0; - g = m_green / 255.0; - b = m_blue / 255.0; - rgb_max = MAX3(r, g, b); - rgb_min = MIN3(r, g, b); - delta = rgb_max - rgb_min; - h = 0; - s = 0; - - if ( rgb_max != 0.0 ) - s = delta / rgb_max; - - if ( s != 0.0 ) - { - double rc = (rgb_max - r) / delta; - double gc = (rgb_max - g) / delta; - double bc = (rgb_max - b) / delta; - - if ( r == rgb_max ) - h = bc - gc; - else if ( g == rgb_max ) - h = 2.0f + rc - bc; - else if ( b == rgb_max ) - h = 4.0f + gc - rc; - - h *= 60.0f; - if ( h < 0.0 ) - h += 360.0f; - } - - hue = h; - saturation = s; - value = rgb_max; -} - -UInt8 ARGBColor::GetAlpha() -{ - return m_alpha; -} - -UInt8 ARGBColor::GetRed() -{ - return m_red; -} - -UInt8 ARGBColor::GetGreen() -{ - return m_green; -} - -UInt8 ARGBColor::GetBlue() -{ - return m_blue; -} - -void ARGBColor::SetAlpha(UInt8 alpha) -{ - m_alpha = alpha; -} - -void ARGBColor::SetRed(UInt8 red) -{ - m_red = red; -} - -void ARGBColor::SetGreen(UInt8 green) -{ - m_green = green; -} - -void ARGBColor::SetBlue(UInt8 blue) -{ - m_blue = blue; -} - -void ARGBColor::SetHue(double newHue) -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - SetHSV(newHue, sat, val); -} - -void ARGBColor::SetSaturation(double newSat) -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - SetHSV(hue, newSat, val); -} - -void ARGBColor::SetValue(double newVal) -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - SetHSV(hue, sat, newVal); -} - -double ARGBColor::GetHue() -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - return hue; -} - -double ARGBColor::GetSaturation() -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - return sat; -} - -double ARGBColor::GetValue() -{ - double hue; - double sat; - double val; - GetHSV(hue, sat, val); - return val; -} diff --git a/source/fs.dll/skse64/skse64/Colors.h b/source/fs.dll/skse64/skse64/Colors.h deleted file mode 100644 index 9ee69516..00000000 --- a/source/fs.dll/skse64/skse64/Colors.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "common/ITypes.h" - -#define MIN3(x,y,z) ((y) <= (z) ? ((x) <= (y) ? (x) : (y)) : ((x) <= (z) ? (x) : (z))) -#define MAX3(x,y,z) ((y) >= (z) ? ((x) >= (y) ? (x) : (y)) : ((x) >= (z) ? (x) : (z))) - -class ARGBColor -{ -public: - ARGBColor(UInt32 argb) { - m_alpha = COLOR_ALPHA(argb); - m_red = COLOR_RED(argb); - m_green = COLOR_GREEN(argb); - m_blue = COLOR_BLUE(argb); - }; - ARGBColor(UInt8 _a, UInt8 _r, UInt8 _g, UInt8 _b) : m_alpha(_a), m_red(_r), m_green(_g), m_blue(_b) {}; - - UInt32 GetColor(); - - void SetARGB(UInt8 alpha, UInt8 red, UInt8 green, UInt8 blue); - void GetARGB(UInt8 & alpha, UInt8 & red, UInt8 & green, UInt8 & blue); - - void SetHSV(double hue, double saturation, double value); - void GetHSV(double & hue, double & saturation, double & value); - - UInt8 GetAlpha(); - UInt8 GetRed(); - UInt8 GetGreen(); - UInt8 GetBlue(); - - void SetAlpha(UInt8 alpha); - void SetRed(UInt8 red); - void SetGreen(UInt8 green); - void SetBlue(UInt8 blue); - - void SetHue(double hue); - void SetSaturation(double saturation); - void SetValue(double value); - - double GetHue(); - double GetSaturation(); - double GetValue(); - -private: - UInt8 m_alpha; - UInt8 m_red; - UInt8 m_green; - UInt8 m_blue; -}; diff --git a/source/fs.dll/skse64/skse64/Common.props b/source/fs.dll/skse64/skse64/Common.props deleted file mode 100644 index fc40e4e2..00000000 --- a/source/fs.dll/skse64/skse64/Common.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - $(ProjectName)_1_5_97 - - - - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - Level3 - _WINDOWS;_USRDLL;SKSE64_EXPORTS;RUNTIME_VERSION=0x01050610;RUNTIME;%(PreprocessorDefinitions) - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/CustomMenu.cpp b/source/fs.dll/skse64/skse64/CustomMenu.cpp deleted file mode 100644 index 1a77dd9c..00000000 --- a/source/fs.dll/skse64/skse64/CustomMenu.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "skse64/CustomMenu.h" - -std::string CustomMenuCreator::swfPath_; - -IMenu* CustomMenuCreator::Create(void) -{ - void* p = ScaleformHeap_Allocate(sizeof(CustomMenu)); - if (p) - { - IMenu* menu = new (p) CustomMenu(swfPath_.c_str()); - return menu; - } - else - { - return NULL; - } -} - -void CustomMenuCreator::SetSwfPath(const char* path) -{ - swfPath_ = path; -} - -CustomMenu::CustomMenu(const char* swfPath) -{ - CALL_MEMBER_FN(GFxLoader::GetSingleton(), LoadMovie)(this, &view, swfPath, GFxMovieView::ScaleModeType::kNoBorder, 0.0); - - flags = IMenu::kFlag_Modal | IMenu::kFlag_PausesGame; - unk0C = 0xA; - unk14 = 1; - - if(!InputEventDispatcher::GetSingleton()->IsGamepadEnabled()) - flags |= IMenu::kFlag_UpdateUsesCursor | IMenu::kFlag_UsesCursor; // Shows the cursor when no gamepad is enabled - -#ifdef _CUSTOMMENU_ITEMDISPLAY - flags |= IMenu::kFlag_RendersOffscreenTargets; -#endif -} -#ifdef _CUSTOMMENU_ITEMDISPLAY -void UpdateItem3D(const FxDelegateArgs & params) -{ - if(params.menu) { - UInt32 formId = (UInt32)params.args->GetNumber(); - if(formId) { - TESForm * form = LookupFormByID(formId); - if(form) { - CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), UpdateMagic3D)(form, 0); - } - } else { - CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), Clear3D)(); - } - } -} -#endif -void CustomMenu::Accept(CallbackProcessor * processor) -{ - GString playSound("PlaySound"); - processor->Process(playSound, PlaySoundCallback); - -#ifdef _CUSTOMMENU_ITEMDISPLAY - GString renderItem("UpdateItem3D"); - processor->Process(renderItem, UpdateItem3D); -#endif -} - - -void CustomMenu::Render() -{ - if(view) { - view->Render(); -#ifdef _CUSTOMMENU_ITEMDISPLAY - CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), Render)(); -#endif - } -} diff --git a/source/fs.dll/skse64/skse64/CustomMenu.h b/source/fs.dll/skse64/skse64/CustomMenu.h deleted file mode 100644 index 2539dc9c..00000000 --- a/source/fs.dll/skse64/skse64/CustomMenu.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "skse64/GameMenus.h" -#include "skse64/ScaleformLoader.h" - -class CustomMenuCreator -{ -public: - static IMenu* Create(void); - static void SetSwfPath(const char* path); - -private: - CustomMenuCreator(); - - static std::string swfPath_; -}; - -class CustomMenu : public IMenu -{ -public: - CustomMenu(const char* swfPath); - virtual void Accept(CallbackProcessor * processor); - virtual void Render(void); -}; diff --git a/source/fs.dll/skse64/skse64/GameAPI.cpp b/source/fs.dll/skse64/skse64/GameAPI.cpp deleted file mode 100644 index 01fc487e..00000000 --- a/source/fs.dll/skse64/skse64/GameAPI.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "skse64/GameAPI.h" - -// CFBAE5ABDAD102C91A5CD32DE6F45A70A6EC7561+80 -RelocPtr g_mainHeap(0x01F58C00); - -// 338B95DD01390309C6CF7F96A08D629A564D0A48+5D -RelocPtr g_console(0x02F9B980); - -// 4D7631B98BE6AABD42229719E0D837E677A24FB5+CF -RelocPtr g_consoleHandle(0x02FE8234); - -// 3DD6796A3BFE73B35604DD47E8677156AEBD4360+20 -RelocPtr g_TlsIndexPtr(0x03532618); - -// 14BE6944D5E0E54959DE86FE65045CCEBBC65E31+6 -RelocPtr g_thePlayer(0x02FC2B68); - -void * Heap_Allocate(size_t size) -{ - return CALL_MEMBER_FN(g_mainHeap, Allocate)(size, 0, false); -} - -void Heap_Free(void * ptr) -{ - CALL_MEMBER_FN(g_mainHeap, Free)(ptr, false); -} - -void Console_Print(const char * fmt, ...) -{ - ConsoleManager * mgr = *g_console; - if(mgr) - { - va_list args; - va_start(args, fmt); - - CALL_MEMBER_FN(mgr, VPrint)(fmt, args); - - va_end(args); - } -} - -struct TLSData -{ - // thread local storage - - UInt8 unk000[0x600]; // 000 - UInt8 consoleMode; // 600 - UInt8 pad601[7]; // 601 -}; - -static TLSData * GetTLSData() -{ - UInt32 TlsIndex = *g_TlsIndexPtr; - TLSData ** data = (TLSData **)__readgsqword(0x58); - - return data[TlsIndex]; -} - - -bool IsConsoleMode(void) -{ - return GetTLSData()->consoleMode != 0; -} - -__int64 GetPerfCounter(void) -{ - LARGE_INTEGER li; - QueryPerformanceCounter(&li); - return li.QuadPart; -} diff --git a/source/fs.dll/skse64/skse64/GameAPI.h b/source/fs.dll/skse64/skse64/GameAPI.h deleted file mode 100644 index 8c913899..00000000 --- a/source/fs.dll/skse64/skse64/GameAPI.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" - -class PlayerCharacter; - -class Heap -{ -public: - MEMBER_FN_PREFIX(Heap); - DEFINE_MEMBER_FN(Allocate, void *, 0x00C27D60, size_t size, size_t alignment, bool aligned); - DEFINE_MEMBER_FN(Free, void, 0x00C281B0, void * buf, bool aligned); -}; - -extern RelocPtr g_mainHeap; - -void * Heap_Allocate(size_t size); -void Heap_Free(void * ptr); - -class ConsoleManager -{ -public: - MEMBER_FN_PREFIX(ConsoleManager); - DEFINE_MEMBER_FN(VPrint, void, 0x0088A420, const char * fmt, va_list args); -// DEFINE_MEMBER_FN(Print, void, 0x001D2050, const char * str); -}; - -extern RelocPtr g_console; -extern RelocPtr g_consoleHandle; -extern RelocPtr g_thePlayer; - -void Console_Print(const char * fmt, ...); -bool IsConsoleMode(void); -__int64 GetPerfCounter(void); diff --git a/source/fs.dll/skse64/skse64/GameBSExtraData.cpp b/source/fs.dll/skse64/skse64/GameBSExtraData.cpp deleted file mode 100644 index 6a647fdd..00000000 --- a/source/fs.dll/skse64/skse64/GameBSExtraData.cpp +++ /dev/null @@ -1,280 +0,0 @@ -#include "GameBSExtraData.h" -#include "GameExtraData.h" -#include "GameRTTI.h" - -extern const void * RTTIForExtraType[0xB4] = -{ - NULL, // 0x0 - RTTI_ExtraHavok, // 0x1, - RTTI_ExtraCell3D, // 0x2, - RTTI_ExtraCellWaterType, // 0x3, - RTTI_ExtraRegionList, // 0x4, - RTTI_ExtraSeenData, // 0x5, - RTTI_ExtraEditorID, // 0x6, - RTTI_ExtraCellMusicType, // 0x7, - RTTI_ExtraCellSkyRegion, // 0x8, - RTTI_ExtraProcessMiddleLow, // 0x9, - RTTI_ExtraDetachTime, // 0xA, - RTTI_ExtraPersistentCell, // 0xB, - NULL, // 0xC, - RTTI_ExtraAction, // 0xD, - RTTI_ExtraStartingPosition, // 0xE, - NULL, // 0xF, - RTTI_ExtraAnimGraphManager, // 0x10, - NULL, // 0x11, - RTTI_ExtraUsedMarkers, // 0x12, - RTTI_ExtraDistantData, // 0x13, - RTTI_ExtraRagDollData, // 0x14, - RTTI_ExtraContainerChanges, // 0x15, - RTTI_ExtraWorn, // 0x16, - RTTI_ExtraWornLeft, // 0x17, - RTTI_ExtraPackageStartLocation, // 0x18, - RTTI_ExtraPackage, // 0x19, - RTTI_ExtraTresPassPackage, // 0x1A, - RTTI_ExtraRunOncePacks, // 0x1B, - RTTI_ExtraReferenceHandle, // 0x1C, - RTTI_ExtraFollower, // 0x1D, - RTTI_ExtraLevCreaModifier, // 0x1E, - RTTI_ExtraGhost, // 0x1F, - RTTI_ExtraOriginalReference, // 0x20, - RTTI_ExtraOwnership, // 0x21, - RTTI_ExtraGlobal, // 0x22, - RTTI_ExtraRank, // 0x23, - RTTI_ExtraCount, // 0x24, - RTTI_ExtraHealth, // 0x25, - NULL, // 0x26, - RTTI_ExtraTimeLeft, // 0x27, - RTTI_ExtraCharge, // 0x28, - RTTI_ExtraLight, // 0x29, - RTTI_ExtraLock, // 0x2A, - RTTI_ExtraTeleport, // 0x2B, - RTTI_ExtraMapMarker, // 0x2C, - RTTI_ExtraLeveledCreature, // 0x2D, - RTTI_ExtraLeveledItem, // 0x2E, - RTTI_ExtraScale, // 0x2F, - NULL, // 0x30, was ExtraSeed, removed in 1.7.7.0 - NULL, // 0x31, - NULL, // 0x32, - NULL, // 0x33, - RTTI_ExtraPlayerCrimeList, // 0x34, - NULL, // 0x35 - RTTI_ExtraEnableStateParent, // 0x36, - RTTI_ExtraEnableStateChildren, // 0x37, - RTTI_ExtraItemDropper, // 0x38, - RTTI_ExtraDroppedItemList, // 0x39, - RTTI_ExtraRandomTeleportMarker, // 0x3A, - NULL, // 0x3B - RTTI_ExtraSavedHavokData, // 0x3C, - RTTI_ExtraCannotWear, // 0x3D, - RTTI_ExtraPoison, // 0x3E, - NULL, // 0x3F - RTTI_ExtraLastFinishedSequence, // 0x40, - RTTI_ExtraSavedAnimation, // 0x41, - RTTI_ExtraNorthRotation, // 0x42, - RTTI_ExtraSpawnContainer, // 0x43, - RTTI_ExtraFriendHits, // 0x44, - RTTI_ExtraHeadingTarget, // 0x45, - NULL, // 0x46 - RTTI_ExtraRefractionProperty, // 0x47, - RTTI_ExtraStartingWorldOrCell, // 0x48, - RTTI_ExtraHotkey, // 0x49, - NULL, // 0x4A - RTTI_ExtraEditorRefMoveData, // 0x4B, - RTTI_ExtraInfoGeneralTopic, // 0x4C, - RTTI_ExtraHasNoRumors, // 0x4D, - RTTI_ExtraSound, // 0x4E, - RTTI_ExtraTerminalState, // 0x4F, - RTTI_ExtraLinkedRef, // 0x50, - RTTI_ExtraLinkedRefChildren, // 0x51, - RTTI_ExtraActivateRef, // 0x52, - RTTI_ExtraActivateRefChildren, // 0x53, - RTTI_ExtraCanTalkToPlayer, // 0x54, - RTTI_ExtraObjectHealth, // 0x55, - RTTI_ExtraCellImageSpace, // 0x56, - RTTI_ExtraNavMeshPortal, // 0x57, - RTTI_ExtraModelSwap, // 0x58, - RTTI_ExtraRadius, // 0x59, - NULL, // 0x5A, - RTTI_ExtraFactionChanges, // 0x5B, - RTTI_ExtraDismemberedLimbs, // 0x5C, - RTTI_ExtraActorCause, // 0x5D, - RTTI_ExtraMultiBound, // 0x5E, - NULL, // 0x5F, was ExtraMultiBoundData, removed in 1.7.7.0 - RTTI_ExtraMultiBoundRef, // 0x60, - RTTI_ExtraReflectedRefs, // 0x61, - RTTI_ExtraReflectorRefs, // 0x62, - RTTI_ExtraEmittanceSource, // 0x63, - NULL, // 0x64, was ExtraRadioData, removed in 1.7.7.0 - RTTI_ExtraCombatStyle, // 0x65, - NULL, // 0x66, - RTTI_ExtraPrimitive, // 0x67, - RTTI_ExtraOpenCloseActivateRef, // 0x68, - RTTI_ExtraAnimNoteReceiver, // 0x69, - RTTI_ExtraAmmo, // 0x6A, - RTTI_ExtraPatrolRefData, // 0x6B, - RTTI_ExtraPackageData, // 0x6C, - RTTI_ExtraOcclusionShape, // 0x6D, - RTTI_ExtraCollisionData, // 0x6E, - RTTI_ExtraSayTopicInfoOnceADay, // 0x6F, - RTTI_ExtraEncounterZone, // 0x70, - RTTI_ExtraSayToTopicInfo, // 0x71, - RTTI_ExtraOcclusionPlaneRefData, // 0x72, - RTTI_ExtraPortalRefData, // 0x73, - RTTI_ExtraPortal, // 0x74, - RTTI_ExtraRoom, // 0x75, - RTTI_ExtraHealthPerc, // 0x76, - RTTI_ExtraRoomRefData, // 0x77, - RTTI_ExtraGuardedRefData, // 0x78, - RTTI_ExtraCreatureAwakeSound, // 0x79, - NULL, // 0x7A, - RTTI_ExtraHorse, // 0x7B, - RTTI_ExtraIgnoredBySandbox, // 0x7C, - RTTI_ExtraCellAcousticSpace, // 0x7D, - RTTI_ExtraReservedMarkers, // 0x7E, - RTTI_ExtraWeaponIdleSound, // 0x7F, - RTTI_ExtraWaterLightRefs, // 0x80, - RTTI_ExtraLitWaterRefs, // 0x81, - RTTI_ExtraWeaponAttackSound, // 0x82, - RTTI_ExtraActivateLoopSound, // 0x83, - RTTI_ExtraPatrolRefInUseData, // 0x84, - RTTI_ExtraAshPileRef, // 0x85, - NULL, // 0x86 - RTTI_ExtraFollowerSwimBreadcrumbs, // 0x87, - RTTI_ExtraAliasInstanceArray, // 0x88, - RTTI_ExtraLocation, // 0x89, - NULL, // 0x8A, - RTTI_ExtraLocationRefType, // 0x8B, - RTTI_ExtraPromotedRef, // 0x8C, - NULL, // 0x8D, - RTTI_ExtraOutfitItem, // 0x8E, - NULL, // 0x8F, - RTTI_ExtraLeveledItemBase, // 0x90, - RTTI_ExtraLightData, // 0x91, - RTTI_ExtraSceneData, // 0x92, - RTTI_ExtraBadPosition, // 0x93, - RTTI_ExtraHeadTrackingWeight, // 0x94, - RTTI_ExtraFromAlias, // 0x95, - RTTI_ExtraShouldWear, // 0x96, - RTTI_ExtraFavorCost, // 0x97, - RTTI_ExtraAttachedArrows3D, // 0x98, - RTTI_ExtraTextDisplayData, // 0x99, - RTTI_ExtraAlphaCutoff, // 0x9A, - RTTI_ExtraEnchantment, // 0x9B, - RTTI_ExtraSoul, // 0x9C, - RTTI_ExtraForcedTarget, // 0x9D, - NULL, // 0x9E, - RTTI_ExtraUniqueID, // 0x9F, - RTTI_ExtraFlags, // 0xA0, - RTTI_ExtraRefrPath, // 0xA1, - RTTI_ExtraDecalGroup, // 0xA2, - RTTI_ExtraLockList, // 0xA3, - RTTI_ExtraForcedLandingMarker, // 0xA4, - RTTI_ExtraLargeRefOwnerCells, // 0xA5, - RTTI_ExtraCellWaterEnvMap, // 0xA6, - RTTI_ExtraCellGrassData, // 0xA7, - RTTI_ExtraTeleportName, // 0xA8, - RTTI_ExtraInteraction, // 0xA9, - RTTI_ExtraWaterData, // 0xAA, - RTTI_ExtraWaterCurrentZoneData, // 0xAB, - RTTI_ExtraAttachRef, // 0xAC, - RTTI_ExtraAttachRefChildren, // 0xAD, - RTTI_ExtraGroupConstraint, // 0xAE, - RTTI_ExtraScriptedAnimDependence, // 0xAF, - RTTI_ExtraCachedScale, // 0xB0, - RTTI_ExtraRaceData, // 0xB1, - RTTI_ExtraGIDBuffer, // 0xB2, - RTTI_ExtraMissingRefIDs, // 0xB3 -}; - - -BSExtraData* BaseExtraList::GetByType(UInt32 type) -{ - BSReadLocker locker(&m_lock); - if (!HasType(type)) return NULL; - - const void* rttiType = RTTIForExtraType[type]; - - for(BSExtraData * traverse = m_data; traverse; traverse = traverse->next) { - if (Runtime_DynamicCast((void*)(traverse), RTTI_BSExtraData, rttiType) != NULL) { - return traverse; - } - //if(traverse->type == type) - // return traverse; - } - return NULL; -} - -bool BaseExtraList::Remove(UInt8 type, BSExtraData* toRemove) -{ - BSWriteLocker locker(&m_lock); - if (!toRemove) return false; - - if (HasType(type)) { - bool bRemoved = false; - if (m_data == toRemove) { - m_data = m_data->next; - bRemoved = true; - } - - for (BSExtraData* traverse = m_data; traverse; traverse = traverse->next) { - if (traverse->next == toRemove) { - traverse->next = toRemove->next; - bRemoved = true; - break; - } - } - if (bRemoved) { - MarkType(type, true); - } - return true; - } - - return false; -} - -bool BaseExtraList::Add(UInt8 type, BSExtraData* toAdd) -{ - if (!toAdd || HasType(type)) return false; - - BSWriteLocker locker(&m_lock); - BSExtraData* next = m_data; - m_data = toAdd; - toAdd->next = next; - MarkType(type, false); - return true; -} - -bool BaseExtraList::CheckContainerExtraData(bool isEquipped) -{ - return CALL_MEMBER_FN(this, CheckContainerExtraData_Internal)(isEquipped); -} - -const char * BaseExtraList::GetDisplayName(TESForm * type) -{ - float healthValue = 1.0; - - ExtraHealth* xHealth = static_cast(GetByType(kExtraData_Health)); - if(xHealth) - healthValue = xHealth->health; - - ExtraTextDisplayData * xText = CALL_MEMBER_FN(this, GetExtraTextDisplayData_Internal)(); - if (!xText && healthValue != 1.0) - { - xText = ExtraTextDisplayData::Create(); - Add(kExtraData_TextDisplayData, xText); - } - - if (xText) - return xText->GenerateName(type, healthValue); - else - return NULL; -} - -BSExtraData* BSExtraData::Create(UInt32 size, uintptr_t vtbl) -{ - void* memory = Heap_Allocate(size); - memset(memory, 0, size); - ((uintptr_t *)memory)[0] = vtbl; - BSExtraData* xData = (BSExtraData*)memory; - return xData; -} diff --git a/source/fs.dll/skse64/skse64/GameBSExtraData.h b/source/fs.dll/skse64/skse64/GameBSExtraData.h deleted file mode 100644 index 05fb533f..00000000 --- a/source/fs.dll/skse64/skse64/GameBSExtraData.h +++ /dev/null @@ -1,268 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "skse64_common/Utilities.h" - -class ExtraTextDisplayData; - -enum ExtraDataType -{ - kExtraData_Havok = 0x1, - kExtraData_Cell3D = 0x2, - kExtraData_CellWaterType = 0x3, - kExtraData_RegionList = 0x4, - kExtraData_SeenData = 0x5, - kExtraData_EditorID = 0x6, - kExtraData_CellMusicType = 0x7, - kExtraData_CellSkyRegion = 0x8, - kExtraData_ProcessMiddleLow = 0x9, - kExtraData_DetachTime = 0xA, - kExtraData_PersistentCell = 0xB, - // ?? = 0xC, - kExtraData_Action = 0xD, - kExtraData_StartingPosition = 0xE, - // ?? = 0xF, - kExtraData_AnimGraphManager = 0x10, - // ?? = 0x11, - kExtraData_UsedMarkers = 0x12, - kExtraData_DistantData = 0x13, - kExtraData_RagDollData = 0x14, - kExtraData_ContainerChanges = 0x15, - kExtraData_Worn = 0x16, - kExtraData_WornLeft = 0x17, - kExtraData_PackageStartLocation = 0x18, - kExtraData_Package = 0x19, - kExtraData_TresPassPackage = 0x1A, - kExtraData_RunOncePacks = 0x1B, - kExtraData_ReferenceHandle = 0x1C, - kExtraData_Follower = 0x1D, - kExtraData_LevCreaModifier = 0x1E, - kExtraData_Ghost = 0x1F, - kExtraData_OriginalReference = 0x20, - kExtraData_Ownership = 0x21, - kExtraData_Global = 0x22, - kExtraData_Rank = 0x23, - kExtraData_Count = 0x24, - kExtraData_Health = 0x25, - // ?? = 0x26, - kExtraData_TimeLeft = 0x27, - kExtraData_Charge = 0x28, - kExtraData_Light = 0x29, - kExtraData_Lock = 0x2A, - kExtraData_Teleport = 0x2B, - kExtraData_MapMarker = 0x2C, - kExtraData_LeveledCreature = 0x2D, - kExtraData_LeveledItem = 0x2E, - kExtraData_Scale = 0x2F, - kExtraData_Seed = 0x30, - kExtraData_MagicCaster = 0x31, // ExtraMagicLight?? - // ?? = 0x32, - // ?? = 0x33, - kExtraData_PlayerCrimeList = 0x34, - // ?? = 0x35, - kExtraData_EnableStateParent = 0x36, - kExtraData_EnableStateChildren = 0x37, - kExtraData_ItemDropper = 0x38, - kExtraData_DroppedItemList = 0x39, - kExtraData_RandomTeleportMarker = 0x3A, - //?? = 0x3B - kExtraData_SavedHavokData = 0x3C, - kExtraData_CannotWear = 0x3D, - kExtraData_Poison = 0x3E, - //?? = 0x3F - kExtraData_LastFinishedSequence = 0x40, - kExtraData_SavedAnimation = 0x41, - kExtraData_NorthRotation = 0x42, - kExtraData_SpawnContainer = 0x43, - kExtraData_FriendHits = 0x44, - kExtraData_HeadingTarget = 0x45, - //?? = 0x46 - kExtraData_RefractionProperty = 0x47, - kExtraData_StartingWorldOrCell = 0x48, - kExtraData_Hotkey = 0x49, - //?? 0x4A - kExtraData_EditiorRefMoveData = 0x4B, - kExtraData_InfoGeneralTopic = 0x4C, - kExtraData_HasNoRumors = 0x4D, - kExtraData_Sound = 0x4E, - kExtraData_TerminalState = 0x4F, - kExtraData_LinkedRef = 0x50, - kExtraData_LinkedRefChildren = 0x51, - kExtraData_ActivateRef = 0x52, - kExtraData_ActivateRefChildren =0x53, - kExtraData_CanTalkToPlayer = 0x54, - kExtraData_ObjectHealth = 0x55, - kExtraData_CellImageSpace = 0x56, - kExtraData_NavMeshPortal = 0x57, - kExtraData_ModelSwap = 0x58, - kExtraData_Radius = 0x59, - //?? = 0x5A, - kExtraData_FactionChanges = 0x5B, - kExtraData_DismemberedLimbs = 0x5C, - kExtraData_ActorCause = 0x5D, - kExtraData_MultiBound = 0x5E, - kExtraData_MultiBoundData = 0x5F, - kExtraData_MultiBoundRef = 0x60, - kExtraData_ReflectedRefs = 0x61, - kExtraData_ReflectorRefs = 0x62, - kExtraData_EmittanceSource = 0x63, - kExtraData_RadioData = 0x64, - kExtraData_CombatStyle = 0x65, - //?? = 0x66, - kExtraData_Primitive = 0x67, - kExtraData_OpenCloseActivateRef = 0x68, - kExtraData_AnimNoteReceiver = 0x69, - kExtraData_Ammo = 0x6A, - kExtraData_PatrolRefData = 0x6B, - kExtraData_PackageData = 0x6C, - kExtraData_OcclusionShape = 0x6D, - kExtraData_CollisionData = 0x6E, - kExtraData_SayTopicInfoOnceADay = 0x6F, - kExtraData_EncounterZone = 0x70, - kExtraData_SayTopicInfo = 0x71, - kExtraData_OcclusionPlaneRefData = 0x72, - kExtraData_PortalRefData = 0x73, - kExtraData_Portal = 0x74, - kExtraData_Room = 0x75, - kExtraData_HealthPerc = 0x76, - kExtraData_RoomRefData = 0x77, - kExtraData_GuardedRefData = 0x78, - kExtraData_CreatureAwakeSound = 0x79, - //?? = 0x7A, - kExtraData_Horse = 0x7B, - kExtraData_IgnoredBySandbox = 0x7C, - kExtraData_CellAcousticSpace = 0x7D, - kExtraData_ReservedMarkers = 0x7E, - kExtraData_WeaponIdleSound = 0x7F, - kExtraData_WaterLightRefs = 0x80, - kExtraData_LitWaterRefs = 0x81, - kExtraData_WeaponAttackSound = 0x82, - kExtraData_ActivateLoopSound = 0x83, - kExtraData_PatrolRefInUseData = 0x84, - kExtraData_AshPileRef = 0x85, - //?? = 0x86 - kExtraData_FollowerSwimBreadcrumbs = 0x87, - kExtraData_AliasInstanceArray = 0x88, - kExtraData_Location = 0x89, - //?? = 0x8A, - kExtraData_LocationRefType = 0x8B, - kExtraData_PromotedRef = 0x8C, - //?? = 0x8D, - kExtraData_OutfitItem = 0x8E, - //?? = 0x8F, - kExtraData_LeveledItemBase = 0x90, - kExtraData_LightData = 0x91, - kExtraData_SceneData = 0x92, - kExtraData_BadPosition = 0x93, - kExtraData_HeadTrackingWeight = 0x94, - kExtraData_FromAlias = 0x95, - kExtraData_ShouldWear = 0x96, - kExtraData_FavorCost = 0x97, - kExtraData_AttachedArrows3D = 0x98, - kExtraData_TextDisplayData = 0x99, - kExtraData_AlphaCutoff = 0x9A, - kExtraData_Enchantment = 0x9B, - kExtraData_Soul = 0x9C, - kExtraData_ForcedTarget = 0x9D, - //?? = 0x9E, - kExtraData_UniqueID = 0x9F, - kExtraData_Flags = 0xA0, - kExtraData_RefrPath = 0xA1, - kExtraData_DecalGroup = 0xA2, - kExtraData_LockList = 0xA3, - kExtraData_ForcedLandingMarker = 0xA4, - kExtraData_LargeRefOwnerCells = 0xA5, - kExtraData_CellWaterEnvMap = 0xA6, - kExtraData_CellGrassData = 0xA7, - kExtraData_TeleportName = 0xA8, - kExtraData_Interaction = 0xA9, - kExtraData_WaterData = 0xAA, - kExtraData_WaterCurrentZoneData = 0xAB, - kExtraData_AttachRef = 0xAC, - kExtraData_AttachRefChildren = 0xAD, - kExtraData_GroupConstraint = 0xAE, - kExtraData_ScriptedAnimDependence = 0xAF, - kExtraData_CachedScale = 0xB0, - kExtraData_RaceData = 0xB1, - kExtraData_GIDBuffer = 0xB2, - kExtraData_MissingRefIDs = 0xB3 -}; - -// 10 -class BSExtraData -{ -public: - BSExtraData(); - virtual ~BSExtraData(); - virtual UInt32 GetType(void); - - BSExtraData* next; // 08 - //UInt8 type; // 10 - //UInt8 padding[3]; - static BSExtraData* Create(UInt32 size, uintptr_t vtbl); -}; -//STATIC_ASSERT(sizeof(BSExtraData) == 0x10); - -// 18 -class BaseExtraList -{ -public: - BaseExtraList(); - ~BaseExtraList(); - - struct PresenceBitfield - { - bool HasType(UInt32 type) const - { - UInt32 index = (type >> 3); - UInt8 bitMask = 1 << (type % 8); - return (bits[index] & bitMask) != 0; - } - - UInt8 bits[0x18]; - }; - - bool HasType(UInt32 type) - { - BSReadLocker locker(&m_lock); - return (m_presence) ? m_presence->HasType(type) : false; - } - - void MarkType(UInt32 type, bool bCleared) - { - UInt32 index = (type >> 3); - UInt8 bitMask = 1 << (type % 8); - UInt8& flag = m_presence->bits[index]; - if (bCleared) { - flag &= ~bitMask; - } else { - flag |= bitMask; - } - } - - bool Remove(UInt8 type, BSExtraData* toRemove); - bool Add(UInt8 type, BSExtraData* toAdd); - - bool CheckContainerExtraData(bool isEquipped); - - const char * GetDisplayName(TESForm * type); - - BSExtraData* GetByType(UInt32 type); - BSExtraData * m_data; // 00 - PresenceBitfield * m_presence; // 08 - - // These added in SE - BSReadWriteLock m_lock; - -private: - MEMBER_FN_PREFIX(BaseExtraList); - // A7985F15034C77C00ACC57607F29F4802502A1BA+2F - DEFINE_MEMBER_FN(CheckContainerExtraData_Internal, bool, 0x00119580, bool isEquipped); - // This also does some internal ReferenceHandle lookup - // - DEFINE_MEMBER_FN(GetExtraTextDisplayData_Internal, ExtraTextDisplayData*, 0x0011D360); -}; - -typedef tList ExtendDataList; - -STATIC_ASSERT(sizeof(BaseExtraList) == 0x18); diff --git a/source/fs.dll/skse64/skse64/GameCamera.cpp b/source/fs.dll/skse64/skse64/GameCamera.cpp deleted file mode 100644 index 6259886b..00000000 --- a/source/fs.dll/skse64/skse64/GameCamera.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "GameCamera.h" - -void LocalMapCamera::SetDefaultStateMinFrustumDimensions(float width, float height) -{ - defaultState->minFrustumWidth = width / 2.0; - defaultState->minFrustumHeight = height / 2.0; -} - -void LocalMapCamera::SetAreaBounds(NiPoint3 * maxBound, NiPoint3 * minBound) -{ - areaBoundsMin = *minBound; - areaBoundsMax = *maxBound; - areaBoundsMax.z += (*g_mapLocalHeight); -} - -void LocalMapCamera::SetDefaultStateMaxBound(NiPoint3 * maxBound) -{ - defaultState->someBoundMax = *maxBound; - defaultState->someBoundMax.z += (*g_mapLocalHeight); -} - -void LocalMapCamera::SetDefaultStateBounds(float x, float y, float z) -{ - defaultState->someBoundMin.x = x - defaultState->someBoundMax.x; - defaultState->someBoundMin.y = y - defaultState->someBoundMax.y; - defaultState->someBoundMin.z = z - defaultState->someBoundMax.z; -} diff --git a/source/fs.dll/skse64/skse64/GameCamera.h b/source/fs.dll/skse64/skse64/GameCamera.h deleted file mode 100644 index 9cc92cff..00000000 --- a/source/fs.dll/skse64/skse64/GameCamera.h +++ /dev/null @@ -1,387 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "GameInput.h" - -#include "GameSettings.h" - -#include "skse64/NiObjects.h" -#include "skse64/NiTypes.h" - -class TESCamera; -class NiNode; - -// 20 -class TESCameraState -{ -public: - TESCameraState(); - virtual ~TESCameraState(); - - virtual void OnStateStart(); // pure - virtual void OnStateEnd(); // pure - virtual void OnUpdate(void * unk1); - virtual void Unk_04(); - virtual void Unk_05(); - virtual void Unk_06(); // pure - virtual void Unk_07(); // pure - virtual void Unk_08(); // pure - - BSIntrusiveRefCounted refCount; // 08 - TESCamera * camera; // 10 - UInt32 stateId; // 18 - UInt32 pad1C; // 1C -}; - -// 90 -class FirstPersonState : public TESCameraState -{ -public: - FirstPersonState(); - virtual ~FirstPersonState(); - - PlayerInputHandler inputHandler; // 20 - float unk30[6]; // 30 - UInt64 unk48; // 48 - UInt64 unk50; // 50 - void* unk58; // 58 - void* unk60; // 60 - float unk68[3]; // 70 - UInt32 unk74; // 74 - UInt32 unk78; // 78 - float unk7C; // 7C - UInt32 unk80; // 80 - UInt8 unk84[4]; // 84 - UInt64 unk88; // 88 -}; -STATIC_ASSERT(sizeof(FirstPersonState) == 0x90); - -// E8 -class ThirdPersonState : public TESCameraState -{ -public: - ThirdPersonState(); - virtual ~ThirdPersonState(); - virtual void Unk_09(void); - virtual void Unk_0A(void); - virtual void UpdateMode(bool weaponDrawn); - - PlayerInputHandler inputHandler; // 20 - NiNode * cameraNode; // 30 - NiNode * controllerNode; // 38 - float unk40[4]; // 40 - UInt32 unk50[3]; // 50 - float fOverShoulderPosX; // 5C - float fOverShoulderCombatAddY; // 60 - float fOverShoulderPosZ; // 64 - float unk68[3]; // 68 - UInt32 unk74[6]; // 74 - float unk8C; // 8C - init'd 7F7FFFFF - UInt32 unk90[3]; // 90 - float unk9C; // 9C - init'd 7F7FFFFF - UInt64 unkA0; // A0 - UInt64 unkA8; // A8 - float unkB0; // B0 - UInt32 unkB4[3]; // B4 - float unkC0[6]; // C0 - UInt32 unkD8; // D8 - UInt8 unkDC[7]; // DC - UInt8 padE3[5]; // E3 -}; -STATIC_ASSERT(sizeof(ThirdPersonState) == 0xE8); - -// 110 -class DragonCameraState : public ThirdPersonState -{ -public: - DragonCameraState(); - virtual ~DragonCameraState(); - - UInt32 unkE8; // 0E8 - UInt32 unkEC; // 0EC - UInt8 unkF0; // 0F0 - UInt8 padF1[3]; // 0F1 - float unkF4; // 0F4 - init'd to 1 - UInt8 unkF8; // 0F8 - UInt8 padF9[3]; // 0F9 - float unkFC[4]; // 0FC - UInt32 unk10C; // 10C -}; - -// F8 -class HorseCameraState : public ThirdPersonState -{ -public: - HorseCameraState(); - virtual ~HorseCameraState(); - - UInt32 unkE8; // E8 - UInt32 unkEC; // EC - UInt8 unkF0; // F0 - UInt8 padF1[7]; // F1 -}; - -// 50 -class TweenMenuCameraState : public TESCameraState -{ -public: - TweenMenuCameraState(); - virtual ~TweenMenuCameraState(); - - float unk20[4]; // 20 - UInt32 unk30; // 30 - float unk34[4]; // 34 - UInt32 unk44; // 44 - UInt32 unk48; // 48 - UInt8 unk4C; // 4C - UInt8 pad4D[3]; // 4D -}; - -// 38 -class VATSCameraState : public TESCameraState -{ -public: - VATSCameraState(); - virtual ~VATSCameraState(); - - float unk20[6]; // 20 -}; - -// 50 -class FreeCameraState : public TESCameraState -{ -public: - FreeCameraState(); - virtual ~FreeCameraState(); - - PlayerInputHandler inputHandler; // 20 - float unk30[7]; // 30 - UInt32 unk4C; // 4C -}; - -// 28 -class AutoVanityState : public TESCameraState -{ -public: - AutoVanityState(); - virtual ~AutoVanityState(); - - UInt32 unk20; // 20 - UInt32 pad24; // 24 -}; - -// 40 -class FurnitureCameraState : public TESCameraState -{ -public: - FurnitureCameraState(); - virtual ~FurnitureCameraState(); - - UInt32 unk20; // 20 - float unk24; // 24 - float unk28; // 28 - float unk2C; // 2C - UInt32 unk30; // 30 - UInt32 unk34; // 34 - UInt32 unk38; // 38 - UInt8 unk3C; // 3C - UInt8 unk3D; // 3D - UInt8 unk3E; // 3E - UInt8 pad3F; // 3F -}; - -// 28 -class IronSightsState : public TESCameraState -{ -public: - IronSightsState(); - virtual ~IronSightsState(); - - UInt64 unk20; // 20 -}; - -// 138 -class BleedoutCameraState : public ThirdPersonState -{ -public: - BleedoutCameraState(); - virtual ~BleedoutCameraState(); - - float unkE8[8]; // E8 - UInt32 unk108; // 108 - float unk10C; // 10C - init'd to 200 - float unk110; // 110 - init'd to 0.523599 (PI/6) - UInt32 unk114; // 114 - float unk118; // 118 - UInt32 pad11C; // 11C - UInt64 unk120; // 120 - UInt32 unk128; // 128 - init'd to FFFFFFFF - UInt8 unk12C; // 12C - UInt8 pad12D[3]; // 12D - UInt32 unk130; // 130 - UInt8 unk134; // 134 - UInt8 pad135[3]; // 135 -}; - -// 40 -class PlayerCameraTransitionState : public TESCameraState -{ -public: - PlayerCameraTransitionState(); - virtual ~PlayerCameraTransitionState(); - - UInt32 unk20; // 20 - UInt32 unk24; // 24 - UInt64 unk28; // 28 - UInt64 unk30; // 30 - UInt32 unk38; // 38 - UInt8 unk3C; // 3C - UInt8 unk3D; // 3D - UInt16 pad3E; -}; - -// 38 -class TESCamera -{ -public: - TESCamera(); - virtual ~TESCamera(); - - virtual void SetNode(NiNode * node); - virtual void Update(); - - float rotZ; // 08 - float rotX; // 0C - NiPoint3 pos; // 10 - float zoom; // 1C - NiNode * cameraNode; // 20 - First child is usually NiCamera - TESCameraState * cameraState; // 28 - UInt8 unk30; // 30 - UInt8 pad31[7]; // 31 - - MEMBER_FN_PREFIX(TESCamera); - DEFINE_MEMBER_FN(SetCameraState, UInt32, 0x0050F050, TESCameraState * cameraState); -}; -STATIC_ASSERT(offsetof(TESCamera, cameraNode) == 0x20); -STATIC_ASSERT(sizeof(TESCamera) == 0x38); - -// 68 -class LocalMapCamera : public TESCamera -{ -public: - LocalMapCamera(); - virtual ~LocalMapCamera(); - - // 48 - class DefaultState : public TESCameraState - { - public: - NiPoint3 someBoundMax; // 20 - NiPoint3 someBoundMin; // 2C - float zoomPercent; // 38 - float minFrustumWidth; // 3C - float minFrustumHeight; // 40 - UInt32 pad44; // 44 - }; - - NiPoint3 areaBoundsMax; // 38 - NiPoint3 areaBoundsMin; // 44 - DefaultState * defaultState; // 50 - NiObject * niCamera; // 58 - float northRotation; // 60 - UInt32 pad64; // 64 - - void SetDefaultStateMinFrustumDimensions(float width, float height); - void SetAreaBounds(NiPoint3 * maxBound, NiPoint3 * minBound); - void SetDefaultStateMaxBound(NiPoint3 * maxBound); - void SetDefaultStateBounds(float x, float y, float z); - - MEMBER_FN_PREFIX(LocalMapCamera); - DEFINE_MEMBER_FN(ctor, void, 0x00200F40); - DEFINE_MEMBER_FN(SetNorthRotation, void, 0x00201390, float northRotation); -}; - -STATIC_ASSERT(offsetof(LocalMapCamera, northRotation) == 0x60); - -// 90 -class MapCamera : public TESCamera -{ -public: - MapCamera(); - virtual ~MapCamera(); - - float unk38[5]; // 38 - UInt32 unk4C[3]; // 4C - UInt64 unk58; // 58 - UInt32 unk60; // 60 - UInt32 unk64; // 64 - UInt64 unk68[2]; // 68 - UInt64 unk78; // 78 - UInt64 unk80; // 80 - UInt8 unk88; // 88 - UInt8 pad89[7]; // 89 -}; - -// 38 -class RaceSexCamera : public TESCamera -{ -public: - RaceSexCamera(); - virtual ~RaceSexCamera(); -}; - -// 168 -class PlayerCamera : public TESCamera -{ -public: - PlayerCamera(); - virtual ~PlayerCamera(); - - static PlayerCamera * GetSingleton(void) - { - // 8737E3612AB5A303F82C06809C0B0B41B2015C66+1E - static RelocPtr g_playerCamera(0x02F61288); - return *g_playerCamera; - } - - enum - { - kCameraState_FirstPerson = 0, - kCameraState_AutoVanity, - kCameraState_VATS, - kCameraState_Free, - kCameraState_IronSights, - kCameraState_Furniture, - kCameraState_Transition, - kCameraState_TweenMenu, - kCameraState_ThirdPerson1, - kCameraState_ThirdPerson2, - kCameraState_Horse, - kCameraState_Bleedout, - kCameraState_Dragon, - kNumCameraStates - }; - - UInt8 unk38[0xB8-0x38]; // 028 - TESCameraState * cameraStates[kNumCameraStates]; // 0B8 - UInt64 unk120; // 120 - UInt64 unk128; // 128 - UInt64 unk130; // 130 - UInt32 unk138; // 138 - float worldFOV; // 13C - float firstPersonFOV; // 140 - UInt8 unk144[0x160-0x144]; // 144 - UInt8 unk160; // 160 - UInt8 unk161; // 161 - UInt8 unk162; // 162 - init'd to 1 - UInt8 unk163; // 163 - UInt8 unk164; // 164 - UInt8 unk165; // 165 - UInt8 pad166[2]; // 166 - - MEMBER_FN_PREFIX(PlayerCamera); - DEFINE_MEMBER_FN(UpdateThirdPerson, void, 0x0087A350, bool weaponDrawn); -}; - -STATIC_ASSERT(offsetof(PlayerCamera, cameraStates) == 0xB8); -STATIC_ASSERT(offsetof(PlayerCamera, pad166) == 0x166); diff --git a/source/fs.dll/skse64/skse64/GameData.cpp b/source/fs.dll/skse64/skse64/GameData.cpp deleted file mode 100644 index 3a227dac..00000000 --- a/source/fs.dll/skse64/skse64/GameData.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "skse64/GameData.h" - -// 9615953AF64D4A2EB76F7BDE0F38D30B311B1351+40 -RelocAddr g_gameTime(0x03007710); - -// B8860AA646A4AA64DB8D5C6EDA306FC6B59F1B9B+5B -RelocPtr g_dataHandler(0x01F59DA8); - -// 5F417CF4D2EB33C7D6903EA38BB5CDDEF48A6F83+4B -RelocPtr g_persistentFormManager(0x01F5A468); - -// EC410889481EE7B9DC4B6D7A707FA41B72CDCE48+4 -RelocPtr g_faceGen(0x01F5A4C0); - -// F22C9BC54C962ED86B36585C0EC0E729DCA18000+26 -RelocPtr g_MagicFavorites(0x02FC23A0); - -// 6C8AEF51A6996BA6DC317E92014FCC446B5DBC17+25 -RelocPtr g_MenuTopicManager(0x02F9B218); - -// 5ED03BBC1845C7394493F8FAA1DE8C7AEB3E2350+2A -RelocPtr g_actorValueList(0x01F59D98); - -// aWerewolfSpell -RelocPtr g_defaultObjectList(0x01E4AF20); - -// 68BF756333EF751059E935236F381FA91F62C373+22 -RelocPtr g_saveLoadManager(0x02FC23B8); - -// 3B74AA860AC42F1080FAF792E4BE1D3BF0E0EFEE+47 -RelocPtr g_MiscStatManager(0x02F60DA8); - -// A9D0A72CC9E5F85E2169118F999943FD43AF51EA+95 -RelocPtr g_equipManager(0x02F60108); - -// FBC6C0FB3A858D20081F5FF9CB3E780E59DCE52F+50 -RelocPtr g_relationshipRanks(0x01E66FE8); - -RelocAddr<_ChangeActorHeadPart> ChangeActorHeadPart(0x003F4860); -// -RelocAddr<_GetEitherHandSlot> GetEitherHandSlot(0x00346E90); -// -RelocAddr<_GetRightHandSlot> GetRightHandSlot(0x00346E80); -// -RelocAddr<_GetLeftHandSlot> GetLeftHandSlot(0x00346E70); -RelocAddr<_LookupActorValueByName> LookupActorValueByName(0x003FA030); -RelocAddr<_UpdatePlayerTints> UpdatePlayerTints(0x008E4AA0); -RelocAddr<_GetActorBaseOverlays> GetActorBaseOverlays(0x0037FFB0); -RelocAddr<_GetNumActorBaseOverlays> GetNumActorBaseOverlays(0x00380040); - -RelocAddr<_ApplyMasksToRenderTarget> ApplyMasksToRenderTarget(0x003F36C0); - -RelocAddr<_UpdateModelSkin> UpdateModelSkin(0x003F4B90); // Applies tint to ShaderType 5 nodes -RelocAddr<_UpdateModelHair> UpdateModelHair(0x003F4CA0); // Applies tint to ShaderType 6 nodes -RelocAddr<_UpdateModelFace> UpdateModelFace(0x003F4200); -RelocAddr<_UpdateHarvestModel> UpdateHarvestModel(0x001A8280); - -RelocAddr<_GetRelationshipIndex> GetRelationshipIndex(0x0035C1E0); - -RelocPtr g_facePresetList(0x01E6B300); // aNosetype - -RelocAddr<_HasLOS> HasLOS(0x00949B70); - -class LoadedModFinder -{ - const char * m_stringToFind; - -public: - LoadedModFinder(const char * str) : m_stringToFind(str) { } - - bool Accept(ModInfo* modInfo) - { - return _stricmp(modInfo->name, m_stringToFind) == 0; - } -}; - -const ModInfo * DataHandler::LookupModByName(const char * modName) -{ - return modList.modInfoList.Find(LoadedModFinder(modName)); -} - -DataHandler* DataHandler::GetSingleton() -{ - return *(g_dataHandler.GetPtr()); -} - -MiscStatManager * MiscStatManager::GetSingleton(void) -{ - return g_MiscStatManager.GetPtr(); -} - -MiscStatManager::MiscStat * MiscStatManager::Get(const char * name) -{ - for (UInt32 i = 0; i < m_stats.count; i++) - { - MiscStat * stat = &m_stats[i]; - - if (!_stricmp(name, stat->name)) - { - return stat; - } - } - - return NULL; -} - -EquipManager * EquipManager::GetSingleton(void) -{ - return *g_equipManager; -} - -PersistentFormManager * PersistentFormManager::GetSingleton(void) -{ - return *g_persistentFormManager; -} - -FaceGen * FaceGen::GetSingleton(void) -{ - return *g_faceGen; -} - -MagicFavorites * MagicFavorites::GetSingleton() -{ - return *(g_MagicFavorites.GetPtr()); -} - -void MagicFavorites::ClearHotkey(SInt8 idx) -{ - if (idx < 0 || idx >= hotkeys.count) - return; - - hotkeys[idx] = NULL; -} - -void MagicFavorites::SetHotkey(TESForm * form, SInt8 idx) -{ - if (idx < 0 || idx >= hotkeys.count) - return; - - SInt8 oldIdx = hotkeys.GetItemIndex(form); - if (idx == oldIdx) - return; - - if (IsFavorited(form)) - { - hotkeys[oldIdx] = NULL; - hotkeys[idx] = form; - } -} - -TESForm * MagicFavorites::GetSpell(SInt8 idx) -{ - TESForm * form = NULL; - hotkeys.GetNthItem(idx, form); - return form; -} - -bool MagicFavorites::IsFavorited(TESForm * form) -{ - SInt32 indexOut = -1; - if (GetSortIndex(spells, form, indexOut) && indexOut != -1) - return true; - else - return false; -} - -MenuTopicManager * MenuTopicManager::GetSingleton(void) -{ - return *(g_MenuTopicManager.GetPtr()); -} - -NiPointer MenuTopicManager::GetDialogueTarget() -{ - - NiPointer refr; - if (talkingHandle == (*g_invalidRefHandle) || talkingHandle == 0) - return NULL; - - LookupREFRByHandle(talkingHandle, refr); - return refr; -} - -ActorValueList * ActorValueList::GetSingleton(void) -{ - return *g_actorValueList; -} - -ActorValueInfo * ActorValueList::GetActorValue(UInt32 id) -{ - return (id < kNumActorValues) ? actorValues[id] : NULL; -} - -UInt32 ActorValueList::ResolveActorValueByName(const char * name) -{ - UInt32 id = LookupActorValueByName(name); - if (id >= kNumActorValues) - return 255; - - return id; -} - -DefaultObjectList * DefaultObjectList::GetSingleton(void) -{ - return g_defaultObjectList.GetPtr(); -} - -void BGSSaveLoadManager::Save(const char * name) -{ - CALL_MEMBER_FN(this, Save_Internal)(2, 0, name); -} - -void BGSSaveLoadManager::Load(const char * name) -{ - CALL_MEMBER_FN(this, Load_Internal)(name, -1, 0, 1); -} - -BGSSaveLoadManager * BGSSaveLoadManager::GetSingleton(void) -{ - return *g_saveLoadManager; -} - -RelationshipRanks * RelationshipRanks::GetSingleton(void) -{ - return g_relationshipRanks; -} - -SInt32 RelationshipRanks::GetRelationshipRank(TESForm * form1, TESForm * form2) -{ - RelationshipRanks * ranks = RelationshipRanks::GetSingleton(); - if (form1 && form2) { - return ranks->value[GetRelationshipIndex(form1, form2)]; - } - - return ranks->value[kRelationshipAcquaintance]; -} - -FacePresetList * FacePresetList::GetSingleton(void) -{ - return g_facePresetList; -} diff --git a/source/fs.dll/skse64/skse64/GameData.h b/source/fs.dll/skse64/skse64/GameData.h deleted file mode 100644 index 85212567..00000000 --- a/source/fs.dll/skse64/skse64/GameData.h +++ /dev/null @@ -1,963 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/GameTypes.h" -#include "skse64/GameForms.h" -#include "skse64/GameObjects.h" -#include "skse64/GameReferences.h" - -class TESObjectWEAP; -class TESNPC; -class AlchemyItem; -class SpellItem; -class ScrollItem; -class IngredientItem; -class EffectSetting; -class TESObjectARMO; -class TESObjectARMA; -class TESObjectCONT; -class TESObjectCELL; -class TESRegionList; -class BGSAddonNode; -class BGSKeyword; -class BGSAction; -class BGSHeadPart; -class TESRace; -class EnchantmentItem; -class TESObjectACTI; -class TESFurniture; -class BGSEncounterZone; -class BGSLocation; -class BGSColorForm; -class BSFile; -class BSFaceGenModelMap; -class BSFaceGenModel; -class NiTexture; -class Setting; - -class NiAVObject; -class NiColorA; - -extern RelocAddr g_gameTime; - -struct FormRecordData -{ - UInt8 typeID; // corresponds to kFormType_XXX - UInt32 typeCode; // i.e. 'GMST', 'FACT' - UInt32 unk08; // only seen zero -}; - -struct ChunkHeader -{ - UInt32 type : 4; // i.e. 'XGRD', 'DATA' - UInt16 size : 2; -}; - -// 4C8 -struct ModInfo // referred to by game as TESFile -{ - ModInfo(); - ~ModInfo(); - - // 18 info about currently loading form - struct FormInfo - { - UInt32 recordType; // 00 i.e. 'FACT', 'GMST' - UInt32 unk04; // 04 looks like size of entire record - UInt32 formFlags; // 08 copied to TESForm->flags - UInt32 formID; // 0C - UInt32 unk10; // 10 - UInt16 unk14; // 14 always initialized to 0F on SaveForm. - UInt16 unk16; - }; - - enum FileFlags - { - kFileFlags_Light = (1 << 9) - }; - - UInt32 unk000; // 000 - UInt8 unk004[0xC]; // 004 - UInt32 /*NiTPointerMap*/ * pointerMap; // 010 CHECK - UInt64 unk018[2]; // 018 - UInt8 unk028; // 028 - UInt8 unk029; // 029 - UInt8 pad02A[6]; // 029 - UInt64 unk030; // 030 - BSFile* unkFile; // 038 - UInt64 unk040[3]; // 040 - char name[0x104]; // 058 - char filepath[0x104]; // 15C - void* unk260; // 260 - UInt32 unk268; // 268 - init'd to ctor arg(0x800) or 0x10000 if arg is 0 - UInt32 unk26C; // 26C - UInt32 unk270; // 270 - UInt32 unk274; // 274 - pad? - UInt64 unk278; // 278 - UInt32 unk280; // 280 - FormInfo formInfo; // 284 - ChunkHeader subRecord; // 29C - UInt32 unk2A4; // 2A4 - UInt32 fileOffset; // 2A8 - UInt32 dataOffset; // 2AC index into dataBuf - UInt32 subrecordBytesRead; // 2B0 generates error on Read if != expected length - UInt8 unk2B4[0x2D8 - 0x2B4]; // 2B4 - UInt64 unk2D8; // 2D8 - UInt64 unk2E0; // 2E0 - UInt8 unk2E8; // 2E8 - UInt8 bIsBigEndian; // 2E9 - UInt8 unk2EA; // 2EA - UInt8 pad2EB; // 2EB - WIN32_FIND_DATA fileData; // 2EC - float unk42C; // 42C init'd to 0.94 - UInt32 unk430; // 430 - UInt32 flags; // 434 init'd to 0x00000800. 4000 and 40000 do stuff - UInt32 fileFlags; // 438 - UInt32 unk43C; // 43C - void* unk440; // 440 - void* unk448; // 448 - void* unk450; // 450 - void* unk458; // 458 - UInt32 numRefMods; // 460 related to modindex; see 4472D0 - // formIDs in mod are as saved in GECK, must fix up at runtime - UInt32 pad464; - ModInfo ** refModInfo; // 468 used to look up modInfo based on fixed mod index, double-check - UInt32 unk470; // 470 - UInt32 unk474; // 474 - UInt8 modIndex; // 478 init to 0xFF - UInt8 pad479; // 479 - UInt16 lightIndex; // 47A - UInt8 pad47C[4]; - BSString author; // 480 - BSString description; // 490 - void * dataBuf; // 4A0 - UInt32 unk4A8; // 4A8 looks like size of entire record - UInt32 pad4AC; // 4AC - void * unk4B0; // 4B0 - UInt32 unk4B8; // 4B8 - UInt32 pad4BC; // 4BC - void * unk4C0; // 4C0 - - // Checks if a particular formID is part of the mod - bool IsFormInMod(UInt32 formID) const - { - if (!IsLight() && (formID >> 24) == modIndex) - return true; - if (IsLight() && (formID >> 24) == 0xFE && ((formID & 0x00FFF000) >> 12) == lightIndex) - return true; - return false; - } - - // Returns either a modIndex or a modIndex|lightIndex pair - UInt32 GetPartialIndex() const - { - return !IsLight() ? modIndex : (0xFE000 | lightIndex); - } - - // Converts the lower bits of a FormID to a full FormID depending on plugin type - UInt32 GetFormID(UInt32 formLower) const - { - return !IsLight() ? UInt32(modIndex) << 24 | (formLower & 0xFFFFFF) : 0xFE000000 | (UInt32(lightIndex) << 12) | (formLower & 0xFFF); - } - - bool IsActive() const { return modIndex != 0xFF; } - bool IsLight() const { return (fileFlags & kFileFlags_Light) == kFileFlags_Light; } -}; - -STATIC_ASSERT(offsetof(ModInfo, formInfo) == 0x284); -STATIC_ASSERT(offsetof(ModInfo, subRecord) == 0x29C); -STATIC_ASSERT(offsetof(ModInfo, fileOffset) == 0x2A8); -STATIC_ASSERT(offsetof(ModInfo, fileData) == 0x2EC); -STATIC_ASSERT(offsetof(ModInfo, numRefMods) == 0x460); -STATIC_ASSERT(offsetof(ModInfo, author) == 0x480); -STATIC_ASSERT(sizeof(ModInfo) == 0x4C8); - -// 40 - updated in 1.5.3 -struct ModList -{ - tList modInfoList; // 00 - DataHandler D60 - tArray loadedMods; // 10 - DataHandler D70 - tArray loadedCCMods; // 28 - DataHandler D88 - just assuming this is for CC -}; -STATIC_ASSERT(sizeof(ModList) == 0x40); - -// DC0 -class DataHandler -{ -public: - UInt64 unk00; - UInt64 unk08; - UnkFormArray arrNONE; // Form Type 0 - UnkFormArray arrTES4; // Form Type 1 - UnkFormArray arrGRUP; // Form Type 2 - UnkFormArray arrGMST; // Form Type 3 - tArray keywords; // Form Type 4 - UnkFormArray arrLCRT; // Form Type 5 - UnkFormArray arrAACT; // Form Type 6 - UnkFormArray arrTXST; // Form Type 7 - UnkFormArray arrMICN; // Form Type 8 - UnkFormArray arrGLOB; // Form Type 9 - UnkFormArray arrCLAS; // Form Type 10 - UnkFormArray arrFACT; // Form Type 11 - tArray headParts; // Form Type 12 - UnkFormArray arrEYES; // Form Type 13 - tArray races; // Form Type 14 - UnkFormArray arrSOUN; // Form Type 15 - UnkFormArray arrASPC; // Form Type 16 - UnkFormArray arrSKIL; // Form Type 17 - tArray arrEffectSettings; // Form Type 18 - UnkFormArray arrSCPT; // Form Type 19 - UnkFormArray arrLTEX; // Form Type 20 - tArray enchantments; // Form Type 21 - tArray spells; // Form Type 22 - tArray scrolls; // Form Type 23 - tArray arrACTI; // Form Type 24 - UnkFormArray arrTACT; // Form Type 25 - tArray armors; // Form Type 26 - tArray books; // Form Type 27 - tArray arrCONT; // Form Type 28 - UnkFormArray arrDOOR; // Form Type 29 - tArray ingredients; // Form Type 30 - UnkFormArray arrLIGH; // Form Type 31 - tArray miscObjects; // Form Type 32 - UnkFormArray arrSTAT; // Form Type 33 - UnkFormArray arrAPPA; // Form Type 34 - UnkFormArray arrSCOL; // Form Type 35 - UnkFormArray arrMSTT; // Form Type 36 - UnkFormArray arrGRAS; // Form Type 37 - UnkFormArray arrTREE; // Form Type 38 - UnkFormArray arrFLOR; // Form Type 39 - tArray arrFURN; // Form Type 40 - tArray weapons; // Form Type 41 - tArray ammo; // Form Type 42 - tArray npcs; // Form Type 43 - UnkFormArray arrLVLN; // Form Type 44 - tArray keys; // Form Type 45 - tArray potions; // Form Type 46 - UnkFormArray arrIDLM; // Form Type 47 - UnkFormArray arrNOTE; // Form Type 48 - UnkFormArray arrCOBJ; // Form Type 49 - UnkFormArray arrPROJ; // Form Type 50 - UnkFormArray arrHAZD; // Form Type 51 - UnkFormArray arrSLGM; // Form Type 52 - UnkFormArray arrLVLI; // Form Type 53 - UnkFormArray arrWTHR; // Form Type 54 - UnkFormArray arrCLMT; // Form Type 55 - UnkFormArray arrSPGD; // Form Type 56 - UnkFormArray arrRFCT; // Form Type 57 - UnkFormArray arrREGN; // Form Type 58 - UnkFormArray arrNAVI; // Form Type 59 - UnkFormArray arrCELL; // Form Type 60 - UnkFormArray arrREFR; // Form Type 61 - UnkFormArray arrACHR; // Form Type 62 - UnkFormArray arrPMIS; // Form Type 63 - UnkFormArray arrPARW; // Form Type 64 - UnkFormArray arrPGRE; // Form Type 65 - UnkFormArray arrPBEA; // Form Type 66 - UnkFormArray arrPFLA; // Form Type 67 - UnkFormArray arrPCOM; // Form Type 68 - UnkFormArray arrPBAR; // Form Type 69 - UnkFormArray arrPHZD; // Form Type 70 - UnkFormArray arrWRLD; // Form Type 71 - UnkFormArray arrLAND; // Form Type 72 - UnkFormArray arrNAVM; // Form Type 73 - UnkFormArray arrTLOD; // Form Type 74 - UnkFormArray arrDIAL; // Form Type 75 - UnkFormArray arrINFO; // Form Type 76 - tArray quests; // Form Type 77 - UnkFormArray arrIDLE; // Form Type 78 - UnkFormArray arrPACK; // Form Type 79 - UnkFormArray arrCSTY; // Form Type 80 - UnkFormArray arrLSCR; // Form Type 81 - UnkFormArray arrLVSP; // Form Type 82 - UnkFormArray arrANIO; // Form Type 83 - UnkFormArray arrWATR; // Form Type 84 - UnkFormArray arrEFSH; // Form Type 85 - UnkFormArray arrTOFT; // Form Type 86 - UnkFormArray arrEXPL; // Form Type 87 - UnkFormArray arrDEBR; // Form Type 88 - UnkFormArray arrIMGS; // Form Type 89 - UnkFormArray arrIMAD; // Form Type 90 - UnkFormArray arrFLST; // Form Type 91 - UnkFormArray arrPERK; // Form Type 92 - UnkFormArray arrBPTD; // Form Type 93 - UnkFormArray arrADDN; // Form Type 94 - UnkFormArray arrAVIF; // Form Type 95 - UnkFormArray arrCAMS; // Form Type 96 - UnkFormArray arrCPTH; // Form Type 97 - UnkFormArray arrVTYP; // Form Type 98 - UnkFormArray arrMATT; // Form Type 99 - UnkFormArray arrIPCT; // Form Type 100 - UnkFormArray arrIPDS; // Form Type 101 - tArray arrARMA; // Form Type 102 - tArray arrECZN; // Form Type 103 - tArray arrLCTN; // Form Type 104 - UnkFormArray arrMESG; // Form Type 105 - UnkFormArray arrRGDL; // Form Type 106 - UnkFormArray arrDOBJ; // Form Type 107 - UnkFormArray arrLGTM; // Form Type 108 - UnkFormArray arrMUSC; // Form Type 109 - UnkFormArray arrFSTP; // Form Type 110 - UnkFormArray arrFSTS; // Form Type 111 - UnkFormArray arrSMBN; // Form Type 112 - UnkFormArray arrSMQN; // Form Type 113 - UnkFormArray arrSMEN; // Form Type 114 - UnkFormArray arrDLBR; // Form Type 115 - UnkFormArray arrMUST; // Form Type 116 - UnkFormArray arrDLVW; // Form Type 117 - tArray arrWOOP; // Form Type 118 - tArray arrSHOU; // Form Type 119 - UnkFormArray arrEQUP; // Form Type 120 - UnkFormArray arrRELA; // Form Type 121 - UnkFormArray arrSCEN; // Form Type 122 - UnkFormArray arrASTP; // Form Type 123 - UnkFormArray arrOTFT; // Form Type 124 - UnkFormArray arrARTO; // Form Type 125 - UnkFormArray arrMATO; // Form Type 126 - UnkFormArray arrMOVT; // Form Type 127 - UnkFormArray arrSNDR; // Form Type 128 - UnkFormArray arrDUAL; // Form Type 129 - UnkFormArray arrSNCT; // Form Type 130 - UnkFormArray arrSOPM; // Form Type 131 - UnkFormArray arrCOLL; // Form Type 132 - tArray arrCLFM; // Form Type 133 - UnkFormArray arrREVB; // Form Type 134 - UnkFormArray arrLENS; // Form Type 135 - UnkFormArray arrLSPR; // Form Type 136 - UnkFormArray arrVOLI; // Form Type 137 - - TESRegionList * regionList; // D00 -// NiTArray cellList; // D08 - UInt64 cellList[0x3]; // D08 -// NiTArray addonNodes; // D20 - UInt64 addonNodes[0x3]; // D20 - - UInt64 unkD38[3]; // D38 - UInt32 unkD50; // D50 - init'd to 0x800 - UInt32 padD54; // D54 - UInt64 unkD58; // D58 - ModList modList; // D60 - - UInt8 unkDA0; // DA0 - UInt8 unkDA1; // DA1 - UInt8 unkDA2; // DA2 - UInt8 unkDA3; // DA3 - UInt8 unkDA4; // DA4 - UInt8 unkDA5; // DA5 - UInt8 unkDA6; // DA6 - UInt8 unkDA7; // DA7 - UInt8 unkDA8; // DA8 - UInt8 unkDA9; // DA9 - UInt8 unkDAA; // DAA - UInt8 padDAB[5]; // DAB - - void * regionDataManager; // DB0 - TESRegionDataManager*, allocated in ctor - UInt64 unkDB8; // DB8 - - const ModInfo* LookupModByName(const char* modName); - - static DataHandler * GetSingleton(); - - UInt32 LoadScripts_Hook(); - - MEMBER_FN_PREFIX(DataHandler); - DEFINE_MEMBER_FN(LoadScripts, UInt32, 0x0017BDB0); -}; - -STATIC_ASSERT(offsetof(DataHandler, regionList) == 0xD00); -STATIC_ASSERT(offsetof(DataHandler, addonNodes) == 0xD20); -STATIC_ASSERT(offsetof(DataHandler, modList) == 0xD60); -STATIC_ASSERT(sizeof(DataHandler) == 0xDC0); - -extern RelocPtr g_dataHandler; -extern RelocPtr g_isGameDataReady; - -class MiscStatManager -{ -public: - static MiscStatManager * GetSingleton(void); - - // 20 - struct MiscStat - { - const char * name; // 00 - const char * unk04; // 08 - UInt32 value; // 10 - UInt32 unk14; // 14 - UInt8 unk18; // 18 - UInt8 pad19[7]; // 19 - }; - - class Visitor - { - public: - virtual void Visit(MiscStat * stat, void * stat_unk04, UInt32 stat_unk0C, UInt32 value, UInt32 stat_unk10) = 0; - }; - - MEMBER_FN_PREFIX(MiscStatManager); - - tArray m_stats; // 00 - - MiscStat * Get(const char * name); -}; -STATIC_ASSERT(sizeof(MiscStatManager::MiscStat) == 0x20); - -class EquipManager -{ -public: - virtual ~EquipManager(); - - static EquipManager * GetSingleton(void); - - MEMBER_FN_PREFIX(EquipManager); - DEFINE_MEMBER_FN(EquipItem, void, 0x0065E4B0, Actor * actor, TESForm * item, BaseExtraList * extraData, SInt32 count, BGSEquipSlot * equipSlot, bool withEquipSound, bool preventUnequip, bool showMsg, void * unk); - DEFINE_MEMBER_FN(UnequipItem, bool, 0x0065ECA0, Actor * actor, TESForm * item, BaseExtraList * extraData, SInt32 count, BGSEquipSlot * equipSlot, bool unkFlag1, bool preventEquip, bool unkFlag2, bool unkFlag3, void * unk); -}; - - -typedef BGSEquipSlot * (*_GetEitherHandSlot)(); -extern RelocAddr<_GetEitherHandSlot> GetEitherHandSlot; - -typedef BGSEquipSlot * (*_GetRightHandSlot)(); -extern RelocAddr<_GetRightHandSlot> GetRightHandSlot; - -typedef BGSEquipSlot * (*_GetLeftHandSlot)(); -extern RelocAddr<_GetLeftHandSlot> GetLeftHandSlot; - -typedef UInt32(*_LookupActorValueByName)(const char * name); -extern RelocAddr<_LookupActorValueByName> LookupActorValueByName; - -typedef bool(*_HasLOS)(Actor* source, TESObjectREFR* target, UInt8 * unk1); -extern RelocAddr<_HasLOS> HasLOS; - -typedef UInt32(*_GetRelationshipIndex)(TESForm * form1, TESForm * form2); -extern RelocAddr<_GetRelationshipIndex> GetRelationshipIndex; - -class RelationshipRanks -{ -public: - static RelationshipRanks * GetSingleton(void); - - enum - { - kRelationshipLover = 0, - kRelationshipAlly, - kRelationshipConfidant, - kRelationshipFriend, - kRelationshipAcquaintance, - kRelationshipRival, - kRelationshipFoe, - kRelationshipEnemy, - kRelationshipArchnemesis, - kNumRelationships - }; - SInt32 value[kNumRelationships]; - - static SInt32 GetRelationshipRank(TESForm * form1, TESForm * form2); -}; - -class ActorValueList -{ -public: - enum { - kNumActorValues = 164 - }; - - static ActorValueList * GetSingleton(void); - ActorValueInfo * GetActorValue(UInt32 id); - - static UInt32 ResolveActorValueByName(const char * name); - -private: - UInt32 unk00; // 00 - UInt32 pad04; // 04 - ActorValueInfo * actorValues[kNumActorValues]; // 08 -}; - -// 68 or 70 -class FaceGen -{ -public: - static FaceGen * GetSingleton(void); - - struct Action { - BSFixedString name; - UInt32 unk04; - float delta; - }; - - // 40 - class MorphDatabase - { - public: - MEMBER_FN_PREFIX(MorphDatabase); - DEFINE_MEMBER_FN(GetFaceGenModelMapEntry, bool, 0x003ED210, const char * meshPath, BSFaceGenModelMap ** entry); - DEFINE_MEMBER_FN(SetFaceGenModelMapEntry, void, 0x003ED0C0, const char * meshPath, BSFaceGenModel * model); - - UInt64 unk00; // 00 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - UInt32 unk14; // 14 - void *unk18; // 18 - UInt64 unk20; // 20 - UInt64 unk28; // 28 - - struct Data30 - { - UInt32 unk00; - UInt32 unk04; - }; - - Data30 unk30; // 30 - UInt8 unk38; // 38 - UInt8 pad39[7]; // 39 - }; - - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt8 unk08; // 08 - UInt8 pad09[7]; // 09 - UInt64 unk10; // 10 - MorphDatabase morphDatabase; // 18 - UInt8 isReset; // 58 - UInt8 pad59[3]; // 59 - UInt32 unk5C; // 5C - UInt8 unk60; // 60 - UInt8 pad61[7]; // 61 - - MEMBER_FN_PREFIX(FaceGen); - DEFINE_MEMBER_FN(RegenerateHead, void, 0x003EA340, BSFaceGenNiNode * headNode, BGSHeadPart * head, TESNPC * npc); - DEFINE_MEMBER_FN(ApplyMorph, void, 0x003E9C40, BSFaceGenNiNode* faceGenNode, BGSHeadPart* headPart, BSFixedString* morphName, float relative); -}; -STATIC_ASSERT(offsetof(FaceGen, isReset) == 0x58); - -// Changes one HeadPart to another -typedef void(*_ChangeActorHeadPart)(Actor*, BGSHeadPart* oldPart, BGSHeadPart* newPart); -extern RelocAddr<_ChangeActorHeadPart> ChangeActorHeadPart; - - -// Regenerates dynamic tints -typedef UInt32(*_UpdatePlayerTints)(); -extern RelocAddr<_UpdatePlayerTints> UpdatePlayerTints; - -typedef BGSHeadPart ** (*_GetActorBaseOverlays)(TESNPC * npc); -extern RelocAddr<_GetActorBaseOverlays> GetActorBaseOverlays; - -typedef UInt32(*_GetNumActorBaseOverlays)(TESNPC * npc); -extern RelocAddr<_GetNumActorBaseOverlays> GetNumActorBaseOverlays; - -typedef bool(*_ApplyMasksToRenderTarget)(tArray * tintMask, NiTexture * renderTarget); -extern RelocAddr<_ApplyMasksToRenderTarget> ApplyMasksToRenderTarget; - -typedef UInt32(*_UpdateModelSkin)(NiAVObject*, NiColorA**); -extern RelocAddr<_UpdateModelSkin> UpdateModelSkin; - -typedef UInt32(*_UpdateModelHair)(NiAVObject*, NiColorA**); -extern RelocAddr<_UpdateModelHair> UpdateModelHair; - -typedef UInt32(*_UpdateModelFace)(NiAVObject*); -extern RelocAddr<_UpdateModelFace> UpdateModelFace; - -typedef void(*_UpdateHarvestModel)(TESObjectREFR*, NiAVObject*); -extern RelocAddr<_UpdateHarvestModel> UpdateHarvestModel; - -// 40 -class MagicFavorites -{ - // void ** _vtbl; // 00 - UInt64 unk008; // 08 - UnkFormArray spells; // 10 - UnkFormArray hotkeys; // 28 - -public: - virtual ~MagicFavorites(); - - void SetHotkey(TESForm * form, SInt8 idx); - void ClearHotkey(SInt8 idx); - TESForm * GetSpell(SInt8 idx); - bool IsFavorited(TESForm * form); - - static MagicFavorites * GetSingleton(void); -}; - -// D0 -class PersistentFormManager -{ -public: - - // 10 - struct EnchantData - { - EnchantmentItem * enchantment; // 00 - volatile SInt32 refCount; // 08 - UInt32 pad; // 0C - }; - - UInt64 unk00; // 00 - tArray weaponEnchants; // 08 - tArray armorEnchants; // 20 - UInt64 unk38; // 38 - UInt32 unk40; // 40 - UInt32 unk44; // 44 - UInt32 unk48; // 48 - UInt32 unk4C; // 4C - - // 30 - struct Data - { - void* unk00; // 00 - UInt64 unk08; // 08 - void* unk10; // 10 - UInt64 unk18; // 18 - UInt32 unk20; // 20 - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - }; - - Data unk50; // 50 - Data unk80; // 80 - void* unkB0; // B0 - UInt64 unkB8; // B8 - UInt64 unkC0; // C0 - UInt64 unkC8; // C8 - - static PersistentFormManager * GetSingleton(void); - - void IncRefEnchantment(EnchantmentItem * enchantment) - { - if (enchantment && enchantment->formID >= 0xFF000000) { - for (UInt32 i = 0; i < weaponEnchants.count; i++) { - EnchantData foundData; - weaponEnchants.GetNthItem(i, foundData); - if (foundData.enchantment == enchantment) { - InterlockedIncrement(&weaponEnchants[i].refCount); - break; - } - } - for (UInt32 i = 0; i < armorEnchants.count; i++) { - EnchantData foundData; - armorEnchants.GetNthItem(i, foundData); - if (foundData.enchantment == enchantment) { - InterlockedIncrement(&armorEnchants[i].refCount); - break; - } - } - } - } - - // The game doesn't bother to dec ref or even delete custom enchants - // when they are no longer used, maybe we can fix this? - void DecRefEnchantment(EnchantmentItem * enchantment) - { - if (enchantment && enchantment->formID >= 0xFF000000) { - for (UInt32 i = 0; i < weaponEnchants.count; i++) { - EnchantData foundData; - weaponEnchants.GetNthItem(i, foundData); - if (foundData.enchantment == enchantment) { - if (!InterlockedDecrement(&weaponEnchants[i].refCount)) - CALL_MEMBER_FN(this, ScheduleForDeletion)(enchantment); - break; - } - } - for (UInt32 i = 0; i < armorEnchants.count; i++) { - EnchantData foundData; - armorEnchants.GetNthItem(i, foundData); - if (foundData.enchantment == enchantment) { - if (!InterlockedDecrement(&armorEnchants[i].refCount)) - CALL_MEMBER_FN(this, ScheduleForDeletion)(enchantment); - break; - } - } - } - } - - MEMBER_FN_PREFIX(PersistentFormManager); - DEFINE_MEMBER_FN(CreateOffensiveEnchantment, EnchantmentItem *, 0x005C1350, tArray * effectArray); - DEFINE_MEMBER_FN(CreateDefensiveEnchantment, EnchantmentItem *, 0x005C13F0, tArray * effectArray); - DEFINE_MEMBER_FN(CreatePoison, void, 0x005C1540, tArray * effectArray, AlchemyItem ** poison); - DEFINE_MEMBER_FN(CreatePotion, void, 0x005C1490, AlchemyItem ** potion, tArray * effectArray); - DEFINE_MEMBER_FN(ScheduleForDeletion, void, 0x005C1870, TESForm *); -}; -STATIC_ASSERT(sizeof(PersistentFormManager) == 0xD0); - -// D8 or E0 -class MenuTopicManager -{ -public: - virtual ~MenuTopicManager(); - virtual void Unk_01(void); - - NiPointer GetDialogueTarget(); - - static MenuTopicManager * GetSingleton(void); - - BSTEventSink playerPositionEvent; // 08 - UInt64 unk10[6]; // 10 - CRITICAL_SECTION critSection; // 40 - UInt32 talkingHandle; // 68 - init'd to g_InvalidRefHandler - UInt32 handle2; // 6C - init'd to g_InvalidRefHandler - void* unk70; // 70 - UInt64 unk78; // 78 - tArray unk80; // 80 - tArray unk98; // 98 - UInt8 unkB0; - UInt8 unkB1; - UInt8 unkB2; - UInt8 unkB3; - UInt8 unkB4; - UInt8 unkB5; - UInt8 unkB6; - UInt8 unkB7; - UInt8 unkB8; - UInt8 unkB9; - UInt8 unkBA; - UInt8 unkBB; - UInt16 padBC; - tArray unkC0; -}; -STATIC_ASSERT(offsetof(MenuTopicManager, talkingHandle) == 0x68); - -// 3D0 -// Note: this class heavily changed in SE! -class BGSSaveLoadManager -{ -public: - enum - { - kEvent_Autosave = 1 << 0, - kEvent_Save = 1 << 1, - kEvent_Unk02 = 1 << 2, - kEvent_Unk03 = 1 << 3, - kEvent_Unk04 = 1 << 4, - - kEvent_Unk07 = 1 << 7, - }; - - static BGSSaveLoadManager * GetSingleton(void); - - void Save(const char * name); - void Load(const char * name); - - // used by Hooks_SaveLoad - void SaveGame_Hook(UInt64 *unk0); - bool LoadGame_Hook(UInt64 *unk0, UInt32 unk1, UInt32 unk2, void *unk3); - void ProcessEvents_Hook(void); - void DeleteSavegame_Hook(const char * saveName, UInt32 unk1); - - // use these when calling from a papyrus thread - void RequestSave(const char * name); - void RequestLoad(const char * name); - - MEMBER_FN_PREFIX(BGSSaveLoadManager); - - BSTEventSink unk000; // 000 - .?AV?$BSTEventSink@VBSSaveDataEvent@@@@ - BSTEventSink unk008; // 008 - .?AV?$BSTEventSink@UNameChangedEvent@RaceSexMenuEvent@@@@ - void* unk010; // 010 - - // 58 - struct Data018 - { - UnkArray unk00; // 00 - UnkArray unk18; // 18 - UnkArray unk30; // 30 - UInt64 unk48; // 48 - UInt8 unk50; // 50 - UInt8 pad51[7]; // 51 - }; - - Data018 unk018; // 018 - UInt32 unk070; // 070 - UInt32 unk074; // 074 - UInt32 unk078; // 078 - UInt32 unk07C; // 07C - UInt32 unk080; // 080 - UInt32 unk084; // 084 - void* unk088; // 088 - UInt32 unk090; // 090 - UInt32 unk094; // 094 - void* unk098; // 098 - UInt32 unk0A0; // 0A0 - UInt32 unk0A4; // 0A4 - UInt32 unk0A8; // 0A8 - UInt32 unk0AC; // 0AC - UInt32 unk0B0; // 0B0 - UInt32 unk0B4; // 0B4 - void* unk0B8; // 0B8 - UInt32 unk0C0; // 0C0 - UInt32 unk0C4; // 0C4 - UInt32 unk0C8; // 0C8 - UInt32 unk0CC; // 0CC - UInt32 unk0D0; // 0D0 - UInt32 unk0D4; // 0D4 - UInt32 unk0D8; // 0D8 - init'd to 0xFFFFFFFF - UInt32 unk0DC; // 0DC - UInt32 unk0E0; // 0E0 - UInt32 unk0E4; // 0E4 - UnkArray unk0E8; // 0E8 - TODO: it is really a tArray of a structure of 0x48 bytes - UnkArray unk100; // 100 - UInt8 unk118; // 118 - UInt8 pad119[3]; // 119 - UInt32 unk11C; // 11C - UInt16 unk120; // 120 - UInt16 pad122; // 122 - UInt32 unk124; // 124 - UInt64 startTickCount; // 128 - GetTickCount when constructed, casted to 64 bits - UInt8 unk130; // 130 - init'd to 1 - UInt8 pad131[7]; // 131 - - // 118 - struct Data138 - { - char latestSaveFileName[0x104]; // 000 - UInt32 pad104; // 104 - Data138* unk108; // 108 - Init'd as self ptr. Might has been intended as a ptr to the char[] instead - UInt8 unk110; // 110 - init'd to 0 - UInt8 unk111; // 111 - init'd to 0 - UInt8 unk112; // 112 - init'd to 4 - UInt8 unk113; // 113 - init'd to 1 - UInt32 pad114; // 114 - - }; - - Data138 unk138; // 138 - UInt32 unk250; // 250 - init'd to FFFFFFFF (unk28 in Skyrim32) - bool unk254; // 254 (unk2C in Skyrim32) - UInt8 pad255[3]; // 255 - void* unk258; // 258 (unk30 in Skyrim32) - UInt8 unk260; // 260 - init'd to 1 (unk34 in Skyrim32) - UInt8 unk261; // 261 (unk35 in Skyrim32) - UInt8 pad262[2]; // 262 - UInt32 unk264; // 264 - UInt32 unk268; // 268 - UInt32 unk26C; // 26C - UInt8 unk270[0x2B0 - 0x270]; // 270 - - // C0 .?AVThread@BGSSaveLoadManager@@ - class Thread - { - public: - - virtual ~Thread(); - virtual UInt32 Unk01(); - virtual void SetEvent(); // Just calls Windows SetEvent on hEvent - - CRITICAL_SECTION criticalSection; // 08 - HANDLE hThread; // 30 - HANDLE currentThread; // 38 - DWORD threadId; // 40 - DWORD currentThreadId; // 44 - UInt8 unk48; // 48 - UInt8 pad49[3]; // 49 - UInt8 unk50; // 50 - init'd to 1 - UInt8 unk51; // 51 - UInt16 pad52; // 52 - UInt32 unk54; // 54 - init'd to 1 - HANDLE hEvent; // 58 - UInt8 unk60[0x60]; // 60 - TODO: .?AV?$BSTCommonStaticMessageQueue@V?$BSTSmartPointer@VRequest@saveload@bgs@@UBSTSmartPointerIntrusiveRefCount@@@@$07@@ - }; - - Thread thread; // 2B0 - UInt8 unk370[0x60]; // 370 - TODO: .?AV?$BSTCommonStaticMessageQueue@V?$BSTSmartPointer@VRequest@saveload@bgs@@UBSTSmartPointerIntrusiveRefCount@@@@$07@@ - - private: - DEFINE_MEMBER_FN(Save_Internal, bool, 0x005A87C0, int unk1, UInt32 unk2, const char * name); - DEFINE_MEMBER_FN(Load_Internal, bool, 0x005A8F00, const char * name, int unk1, UInt32 unk2, UInt32 unk3); - - DEFINE_MEMBER_FN(SaveGame_HookTarget, void, 0x0059E730, UInt64 *unk0); - DEFINE_MEMBER_FN(LoadGame_HookTarget, bool, 0x0059EE40, UInt64 *unk0, UInt32 unk1, UInt32 unk2, void *unk3); - - DEFINE_MEMBER_FN(ProcessEvents_Internal, void, 0x005ABA70); - DEFINE_MEMBER_FN(DeleteSavegame, void, 0x005A8750, const char * saveName, UInt32 unk1); -}; -STATIC_ASSERT(offsetof(BGSSaveLoadManager, thread) == 0x2B0); -STATIC_ASSERT(offsetof(BGSSaveLoadManager::Thread, hThread) == 0x30); -STATIC_ASSERT(sizeof(BGSSaveLoadManager::Thread) == 0xC0); -STATIC_ASSERT(sizeof(BGSSaveLoadManager) == 0x3D0); - -class DefaultObjectList -{ -public: - enum { - kNumDefaultObjects = 0x15B // SE: there is one more than in Skyrim32 ("Mods Help FormList") - }; - - // 18 - Verified - struct DefaultObject - { - const char * description; // 00 - UInt32 unk08; // 08 - UInt32 key; // 0C - UInt32 unk10; // 10 - UInt32 pad; // 14 - }; - - static DefaultObjectList * GetSingleton(void); - - DefaultObject objects[kNumDefaultObjects]; -}; -STATIC_ASSERT(sizeof(DefaultObjectList::DefaultObject) == 0x18); - -class FacePresetList -{ -public: - enum { - kNumPresets = 4 - }; - enum { - kPreset_NoseType, - kPreset_BrowType, - kPreset_EyesType, - kPreset_LipType - }; - - struct Preset - { - const char * presetName; - Setting * gameSetting; - }; - - Preset presets[kNumPresets]; - - static FacePresetList * GetSingleton(void); -}; - -class FaceMorphList -{ -public: - enum { - kNumMorphs = 19 - }; - - enum { - kMorph_NoseShortLong = 0, - kMorph_NoseDownUp, - kMorph_JawUpDown, - kMorph_JawNarrowWide, - kMorph_JawBackForward, - kMorph_CheeksDownUp, - kMorph_CheeksInOut, - kMorph_EyesMoveDownUp, - kMorph_EyesMoveInOut, - kMorph_BrowDownUp, - kMorph_BrowInOut, - kMorph_BrowBackForward, - kMorph_LipMoveDownUp, - kMorph_LipMoveInOut, - kMorph_ChinThinWide, - kMorph_ChinMoveUpDown, - kMorph_OverbiteUnderbite, - kMorph_EyesBackForward, - kMorph_Vampire - }; - - struct Morph - { - UInt32 type; - const char * lowerName; - const char * upperName; - }; - - Morph morphs[kNumMorphs]; -}; diff --git a/source/fs.dll/skse64/skse64/GameEvents.cpp b/source/fs.dll/skse64/skse64/GameEvents.cpp deleted file mode 100644 index 9af08b56..00000000 --- a/source/fs.dll/skse64/skse64/GameEvents.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "GameEvents.h" - -// 614D2151B14D0D61E7DA7088CAB85DB111E2E0D3+1B -RelocAddr<_GetEventDispatcherList> GetEventDispatcherList(0x00194100); - -//EventDispatcher* g_footstepEventDispatcher = (EventDispatcher*) 0x01B2E9C0; - -// Story based events -//EventDispatcher* g_harvestEventDispatcher = (EventDispatcher*) 0x012E5A74; -// Event ActorKill 0xDEADBEEF -// Event ActorItemEquipped 0xDEADBEEF -// Event Pickpocket 0xDEADBEEF -// Event BooksRead 0xDEADBEEF -//EventDispatcher* g_levelIncreaseEventDispatcher = (EventDispatcher*) 0x01B39804; -// Event SkillIncrease 0xDEADBEEF -// Event WordLearned 0xDEADBEEF -// Event WordUnlocked 0xDEADBEEF -// Event Inventory 0xDEADBEEF -// Event Bounty 0xDEADBEEF -// Event QuestStatus 0xDEADBEEF -// Event ObjectiveState 0xDEADBEEF -// Event Trespass 0xDEADBEEF -// Event FinePaid 0xDEADBEEF -// Event HoursPassed 0xDEADBEEF -// Event DaysPassed 0xDEADBEEF -// Event DaysJailed 0xDEADBEEF -// Event CriticalHitEvent 0xDEADBEEF -// Event DisarmedEvent 0xDEADBEEF -// Event ItemsPickpocketed 0xDEADBEEF -// Event ItemSteal 0xDEADBEEF -// Event ItemCrafted 0xDEADBEEF -// Event LocationDiscovery 0xDEADBEEF -// Event Jailing 0xDEADBEEF -// Event ChestsLooted 0xDEADBEEF -// Event TimesTrained 0xDEADBEEF -// Event TimesBartered 0xDEADBEEF -// Event ContractedDisease 0xDEADBEEF -// Event SpellsLearned 0xDEADBEEF -// Event DragonSoulGained 0xDEADBEEF -// Event SoulGemsUsed 0xDEADBEEF -// Event SoulsTrapped 0xDEADBEEF -// Event PoisonedWeapon 0xDEADBEEF -// Event ShoutAttack 0xDEADBEEF -// Event JailEscape 0xDEADBEEF -// Event GrandTheftHorse 0xDEADBEEF -// Event AssaultCrime 0xDEADBEEF -// Event MurderCrime 0xDEADBEEF -// Event LocksPicked 0xDEADBEEF -// Event LocationCleared 0xDEADBEEF -// Event ShoutMastered 0xDEADBEEF diff --git a/source/fs.dll/skse64/skse64/GameEvents.h b/source/fs.dll/skse64/skse64/GameEvents.h deleted file mode 100644 index 526e2dd1..00000000 --- a/source/fs.dll/skse64/skse64/GameEvents.h +++ /dev/null @@ -1,718 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "GameTypes.h" -#include "GameForms.h" - -class TESObjectREFR; -class Actor; -class TESObjectBOOK; -class TESFullName; -class TESQuest; -class TESObjectWEAP; -class TESWordOfPower; -class Character; -class TESShout; -class TESFaction; -class BGSLocation; - -template class BSTEventSink; - -enum EventResult -{ - kEvent_Continue = 0, - kEvent_Abort -}; - -// 058 -template -class EventDispatcher -{ - typedef BSTEventSink SinkT; - - tArray eventSinks; // 000 - tArray addBuffer; // 018 - schedule for add - tArray removeBuffer; // 030 - schedule for remove - SimpleLock lock; // 048 - bool stateFlag; // 050 - some internal state changed while sending - char pad[7]; // 051 - - // Note: in SE there are multiple identical copies of all these functions - MEMBER_FN_PREFIX(EventDispatcher); - // 9FCA8C7632C2FC6D6E342E554B43402121BC4E44+66 - DEFINE_MEMBER_FN(AddEventSink_Internal, void, 0x00587E20, SinkT * eventSink); - // ??_7BGSProcedureShoutExecState@@6B@ xref +21 last call - DEFINE_MEMBER_FN(RemoveEventSink_Internal, void, 0x0043C400, SinkT * eventSink); - // FB59C2DDF89F5248DF43230E39A6FECF8C997BA6+466 - DEFINE_MEMBER_FN(SendEvent_Internal, void, 0x00181CB0, EventArgT * evn); - -public: - - EventDispatcher() : stateFlag(false) {} - - void AddEventSink(SinkT * eventSink) { CALL_MEMBER_FN(this,AddEventSink_Internal)(eventSink); } - void RemoveEventSink(SinkT * eventSink) { CALL_MEMBER_FN(this,RemoveEventSink_Internal)(eventSink); } - void SendEvent(EventArgT * evn) { CALL_MEMBER_FN(this,SendEvent_Internal)(evn); } -}; -STATIC_ASSERT(sizeof(EventDispatcher) == 0x58); - -// 08 -template -class BSTEventSink -{ -public: - virtual ~BSTEventSink() { }; - virtual EventResult ReceiveEvent(T * evn, EventDispatcher * dispatcher) { return kEvent_Continue; }; // pure -// void ** _vtbl; // 00 -}; - -// 58 -template -class BSTEventSource -{ -public: - - tArray unk00; // 08 - UnkArray unk18; // 18 - UnkArray unk30; // 30 - UInt32 unk48; // 48 - UInt32 unk4C; // 4C - UInt8 unk50; // 50 - UInt8 pad51[7]; // 51 -}; -STATIC_ASSERT(sizeof(BSTEventSource) == 0x58); - -// 08 -struct TESSleepStartEvent -{ - float startTime; // 00 - float endTime; // 04 -}; - -// 10 -struct MenuOpenCloseEvent -{ - BSFixedString menuName; // 00 - bool opening; // 08 - char pad[7]; -}; - -// Todo -struct MenuModeChangeEvent -{ -}; - -class TESObjectREFR; -class TESForm; -class ActiveEffect; - -struct TESActiveEffectApplyRemoveEvent -{ - TESObjectREFR * caster; // 0 - TESObjectREFR * target; // 8 - UInt16 unk10; // 10 - UInt8 unk12; // 12 -}; - -struct TESQuestStageEvent -{ - void * finishedCallback; // 0 - UInt32 formId; // 8 - UInt16 stage; // C - UInt8 unk0E; // E - UInt8 pad; // F -}; - -// This isn't necessarily correct, just there to receive events -struct TESHarvestEvent -{ - struct ItemHarvested - { - TESForm* object; - TESForm* player; - }; -}; - -struct LevelIncrease -{ - struct Event - { - TESForm * character; - UInt32 level; - }; -}; - -struct SkillIncrease -{ - struct Event - { - TESForm* character; - UInt32 avId; - }; -}; - -struct WordLearned -{ - struct Event - { - bool first; - }; -}; - -struct WordUnlocked -{ - struct Event - { - bool third; - }; -}; - -struct Inventory -{ - struct Event - { - TESForm* character; - }; -}; - -struct Bounty -{ - struct Event - { - TESFaction* faction; - UInt32 before; - UInt32 after; - }; -}; - -struct QuestStatus -{ - struct Event - { - TESQuest* quest; - UInt32 status; - }; -}; - -struct ObjectiveState -{ - struct Event - { - TESQuest::Objective* objective; - UInt32 oldState; - UInt32 newState; - }; -}; - -struct Trespass -{ - struct Event - { - // Unknown - }; -}; - -struct FinePaid -{ - struct Event - { - // Unknown - }; -}; - -struct HoursPassed -{ - struct Event - { - // Unknown - }; -}; - -struct DaysPassed -{ - struct Event - { - // Unknown - }; -}; - -struct DaysJailed -{ - struct Event - { - UInt32 days; - BGSLocation* location; - TESFaction* faction; - UInt32 bounty; - }; -}; - -struct CriticalHitEvent -{ - struct Event - { - // Unknown - }; -}; - -struct DisarmedEvent -{ - struct Event - { - // Unknown - }; -}; - -struct ItemsPickpocketed -{ - struct Event - { - // Unknown - }; -}; - -struct ItemSteal -{ - struct Event - { - // Unknown - }; -}; - -struct ItemCrafted -{ - struct Event - { - // Unknown - }; -}; - -struct LocationDiscovery -{ - struct Event - { - TESFullName * name; - const char * world; - }; -}; - -struct Jailing -{ - struct Event - { - // Unknown - }; -}; - -struct ChestsLooted -{ - struct Event - { - // Unknown - }; -}; - -struct TimesTrained -{ - struct Event - { - // Unknown - }; -}; - -struct TimesBartered -{ - struct Event - { - // Unknown - }; -}; - -struct ContractedDisease -{ - struct Event - { - // Unknown - }; -}; - -struct SpellsLearned -{ - struct Event - { - // Unknown - }; -}; - -struct DragonSoulGained -{ - struct Event - { - float souls; - }; -}; - -struct SoulGemsUsed -{ - struct Event - { - // Unknown - }; -}; - -struct SoulsTrapped -{ - struct Event - { - TESObjectREFR* player; - TESObjectREFR* target; - }; -}; - -struct PoisonedWeapon -{ - struct Event - { - // Unknown - }; -}; - -struct ShoutAttack -{ - struct Event - { - TESShout* shout; - }; -}; - -struct JailEscape -{ - struct Event - { - // Unknown - }; -}; - -struct GrandTheftHorse -{ - struct Event - { - // Unknown - }; -}; - -struct AssaultCrime -{ - struct Event - { - UInt8 pad; - TESObjectREFR* target; - }; -}; - -struct MurderCrime -{ - struct Event - { - UInt8 pad; - TESObjectREFR* source; - TESObjectREFR* target; - }; -}; - -struct LocksPicked -{ - struct Event - { - // Unknown - }; -}; - -struct ShoutMastered -{ - struct Event - { - // Unknown - }; -}; - -struct TESCombatEvent -{ - TESObjectREFR * source; // 00 - TESObjectREFR * target; // 08 - UInt32 state; // 10 -}; - -struct TESDeathEvent -{ - TESObjectREFR * source; // 00 - TESObjectREFR * killer; // 08 - UInt8 state; // 10 - 0 - dying; 1 - death -}; - -struct TESHitEvent -{ - TESObjectREFR * target; // 00 - TESObjectREFR * caster; // 08 - UInt32 sourceFormID; // 10 - UInt32 projectileFormID; // 14 - - enum - { - kFlag_PowerAttack = (1 << 0), - kFlag_SneakAttack = (1 << 1), - kFlag_Bash = (1 << 2), - kFlag_Blocked = (1 << 3) - }; - - UInt32 flags; // 18 ?? -}; - -struct TESUniqueIDChangeEvent -{ - UInt32 oldOwnerFormId; // 0 - UInt32 newOwnerFormId; // 4 - UInt32 formId; // 8 - UInt16 oldUniqueId; // C - UInt16 newUniqueId; // E -}; - -struct TESContainerChangedEvent -{ - UInt32 fromFormId; // 0 - UInt32 toFormId; // 4 - UInt32 itemFormId; // 8 - UInt32 count; // C - UInt32 toReference; // 10 - UInt16 unk14; // 14 -}; - -struct TESObjectLoadedEvent -{ - UInt32 formId; // 00 - UInt8 loaded; // 04 - 01 - loaded, 00 - unloaded -}; - -struct TESCellAttachDetachEvent -{ - TESObjectREFR * reference; // 00 - UInt8 attached; // 08 - 01 - attached, 00 - detached -}; - -struct TESCellFullyLoadedEvent -{ - TESObjectCELL* cell; -}; - -struct TESMoveAttachDetachEvent -{ - TESObjectREFR * reference; // 00 - UInt8 attached; // 08 - 01 - attached, 00 - detached -}; - -struct TESInitScriptEvent -{ - TESObjectREFR * reference; -}; - -struct BGSFootstepEvent -{ - UInt32 actorHandle; -}; - -struct TESFurnitureEvent -{ - TESObjectREFR* character; - TESObjectREFR* furniture; - UInt32 state; -}; - -struct TESLoadGameEvent -{ - // empty -}; - -struct TESLockChangedEvent -{ - TESObjectREFR* lock; - TESObjectREFR* unlocker; -}; - -struct TESQuestInitEvent -{ - UInt32 formId; -}; - -struct TESQuestStartStopEvent -{ - UInt32 formId; -}; - -struct TESTrackedStatsEvent -{ - BSFixedString statName; - UInt32 newValue; -}; - -struct TESWaitStartEvent -{ - float current; - float desired; -}; - -struct TESWaitStopEvent -{ - //empty? -}; - -struct TESSwitchRaceCompleteEvent -{ - Actor* actor; -}; - -struct LocationCleared -{ - struct Event - { - //empty? - }; -}; - -struct BookRead -{ - struct Event - { - TESObjectBOOK* book; - }; -}; - -struct HourPassed -{ - struct Event - { - UInt32 sleep; - }; -}; - -struct ActorKill -{ - struct Event - { - TESObjectREFR* killer; - TESObjectREFR* victim; - }; -}; - -struct CriticalHit -{ - struct Event - { - TESForm* character; - TESObjectWEAP* weapon; - }; -}; - -struct Disarmed -{ - struct Event - { - TESObjectREFR* source; - TESObjectREFR* target; - }; -}; - -struct WeaponAttack -{ - struct Event - { - TESObjectWEAP* weapon; - Character* wielder; //unk - }; -}; - -struct DefaultObjectsReadyEvent -{ - struct Event - { - //g_defaultObjectManager ? - }; -}; - -class EventDispatcherList -{ -public: - EventDispatcher unk00; // 00 - EventDispatcher unk58; // 58 - sink offset 010 - EventDispatcher unkB0; // B0 - sink offset 018 - EventDispatcher unk108; // 108 - sink offset 020 - EventDispatcher unk160; // 160 - sink offset 028 - EventDispatcher unk1B8; // 1B8 - sink offset 030 - EventDispatcher unk210; // 210 - sink offset 038 - EventDispatcher unk2C0; // 2C0 - sink offset 040 - EventDispatcher combatDispatcher; // 318 - sink offset 048 - EventDispatcher unk370; // 370 - sink offset 050 - EventDispatcher deathDispatcher; // 3C8 - sink offset 058 - EventDispatcher unk420; // 420 - sink offset 068 - EventDispatcher unk478; // 478 - sink offset 070 - EventDispatcher unk4D0; // 4D0 - sink offset 078 - EventDispatcher unk528; // 528 - sink offset 080 - EventDispatcher unk580; // 580 - sink offset 088 - EventDispatcher unk5D8; // 5D8 - sink offset 090 - EventDispatcher unk630; // 630 - sink offset 098 - EventDispatcher initScriptDispatcher; // 688 - sink offset 0A0 - EventDispatcher loadGameEventDispatcher;// 6E0 - sink offset 0A8 - EventDispatcher unk738; // 738 - sink offset 0B0 - EventDispatcher unk790; // 790 - sink offset 0B8 - EventDispatcher unk7E8; // 7E8 - sink offset 0C0 - EventDispatcher unk840; // 840 - sink offset 0C8 - EventDispatcher objectLoadedDispatcher; // 898 - sink offset 0D0 - EventDispatcher unk8F0; // 8F0 - sink offset 0D8 - EventDispatcher unk948; // 948 - sink offset 0E0 - EventDispatcher unk9A0; // 9A0 - sink offset 0E8 - EventDispatcher unk9F8; // 9F8 - sink offset 0F0 - EventDispatcher unkA50; // A50 - sink offset 0F8 - EventDispatcher unkAA8; // AA8 - sink offset 100 - EventDispatcher unkB00; // B00 - sink offset 108 - EventDispatcher unkB58; // B58 - sink offset 110 - EventDispatcher unkBB0; // BB0 - sink offset 118 - EventDispatcher unkC08; // C08 - sink offset 120 - EventDispatcher unkC60; // C60 - sink offset 128 - EventDispatcher unkCB8; // CB8 - sink offset 130 - EventDispatcher unkD10; // D10 - sink offset 138 - EventDispatcher unkD68; // D68 - sink offset 140 - EventDispatcher unkDC0; // DC0 - sink offset 148 - EventDispatcher unkE18; // E18 - sink offset 150 - EventDispatcher unkE70; // E70 - sink offset 158 - EventDispatcher unkEC8; // EC8 - sink offset 160 - EventDispatcher unkF20; // F20 - sink offset 168 - EventDispatcher unkF78; // F78 - sink offset 170 - EventDispatcher unkFD0; // FD0 - sink offset 178 - EventDispatcher unk1028; // 1028 - sink offset 180 - EventDispatcher unk1080; // 1080 - sink offset 188 - EventDispatcher unk10D8; // 10D8 - sink offset 190 - EventDispatcher uniqueIdChangeDispatcher; // 1130 - sink offset 198 - EventDispatcher unk1188; // 1188 - sink offset 200 - EventDispatcher unk11E0; // 11E0 - sink offset 208 - EventDispatcher unk1238; // 1238 - sink offset 210 - EventDispatcher unk1290; // 1290 - sink offset 218 -}; -STATIC_ASSERT(offsetof(EventDispatcherList, uniqueIdChangeDispatcher) == 0x10D8); - -typedef EventDispatcherList*(*_GetEventDispatcherList)(); -extern RelocAddr<_GetEventDispatcherList> GetEventDispatcherList; - -// For testing -//extern EventDispatcher * g_sleepStartEventDispatcher; -//extern EventDispatcher * g_combatEventDispatcher; -//extern EventDispatcher * g_deathEventDispatcher; -//extern EventDispatcher * g_footstepEventDispatcher; -//extern EventDispatcher * g_questStageEventDispatcher; -//extern EventDispatcher * g_harvestEventDispatcher; -//extern EventDispatcher * g_levelIncreaseEventDispatcher; -//extern EventDispatcher * g_hitEventDispatcher; -//extern EventDispatcher * g_containerChangedEventDispatcher; -//extern EventDispatcher * g_changeUniqueIDEventDispatcher; -//extern EventDispatcher * g_objectLoadedEventDispatcher; -//extern EventDispatcher * g_initScriptEventDispatcher; -//extern EventDispatcher * g_cellAttachDetachEventDispatcher; -//extern EventDispatcher * g_moveAttachDetachEventDispatcher; diff --git a/source/fs.dll/skse64/skse64/GameExtraData.cpp b/source/fs.dll/skse64/skse64/GameExtraData.cpp deleted file mode 100644 index 13b7955a..00000000 --- a/source/fs.dll/skse64/skse64/GameExtraData.cpp +++ /dev/null @@ -1,568 +0,0 @@ -#include "GameExtraData.h" -#include "GameBSExtraData.h" -#include "GameRTTI.h" -#include "GameAPI.h" -#include "GameData.h" -#include "HashUtil.h" - -// ??_7ExtraHealth@@6B@ -const RelocPtr s_ExtraHealthVtbl(0x01624A50); -// ??_7ExtraCharge@@6B@ -const RelocPtr s_ExtraChargeVtbl(0x01624AB0); -// ??_7ExtraCount@@6B@ -const RelocPtr s_ExtraCountVtbl(0x016249D0); -// ??_7ExtraTextDisplayData@@6B@ -const RelocPtr s_ExtraTextDisplayVtbl(0x016254D0); -// ??_7ExtraSoul@@6B@ -const RelocPtr s_ExtraSoulVtbl(0x01628220); -// ??_7ExtraOwnership@@6B@ -const RelocPtr s_ExtraOwnershipVtbl(0x01624970); -// ??_7ExtraAliasInstanceArray@@6B@ -const RelocPtr s_ExtraAliasInstanceArrayVtbl(0x01625390); -// ??_7ExtraCannotWear@@6B@ -const RelocPtr s_ExtraCannotWearVtbl(0x01624A30); -// ??_7ExtraHotkey@@6B@ -const RelocPtr s_ExtraHotkeyVtbl(0x01624B10); -// ??_7ExtraForcedTarget@@6B@ -const RelocPtr s_ExtraForcedTargetVtbl(0x01625550); -// ??_7ExtraReferenceHandle@@6B@ -const RelocPtr s_ExtraReferenceHandleVtbl(0x01624B50); -// ??_7ExtraEnchantment@@6B@ -const RelocPtr s_ExtraEnchantmentVtbl(0x01624E70); -// ??_7ExtraRank@@6B@ -const RelocPtr s_ExtraRankVtbl(0x016249B0); -// ??_7ExtraUniqueID@@6B@ -const RelocPtr s_ExtraUniqueIdVtbl(0x01625590); - -ExtraHealth* ExtraHealth::Create() -{ - ExtraHealth* xHealth = (ExtraHealth*)BSExtraData::Create(sizeof(ExtraHealth), s_ExtraHealthVtbl.GetUIntPtr()); - xHealth->health = 1; - return xHealth; -} - -ExtraCharge* ExtraCharge::Create() -{ - ExtraCharge* xCharge = (ExtraCharge*)BSExtraData::Create(sizeof(ExtraCharge), s_ExtraChargeVtbl.GetUIntPtr()); - xCharge->charge = 0; - return xCharge; -} - -ExtraEnchantment* ExtraEnchantment::Create() -{ - ExtraEnchantment* xEnchantment = (ExtraEnchantment*)BSExtraData::Create(sizeof(ExtraEnchantment), s_ExtraEnchantmentVtbl.GetUIntPtr()); - xEnchantment->enchant = NULL; - xEnchantment->maxCharge = 0; - xEnchantment->unk0E = 0; - return xEnchantment; -} - -ExtraCannotWear* ExtraCannotWear::Create() -{ - ExtraCannotWear* xCannotWear = (ExtraCannotWear*)BSExtraData::Create(sizeof(ExtraCannotWear), s_ExtraCannotWearVtbl.GetUIntPtr()); - return xCannotWear; -} - -ExtraHotkey* ExtraHotkey::Create() -{ - ExtraHotkey* xHotkey = (ExtraHotkey*)BSExtraData::Create(sizeof(ExtraHotkey), s_ExtraHotkeyVtbl.GetUIntPtr()); - xHotkey->hotkey = -1; - return xHotkey; -} - -ExtraCount* ExtraCount::Create() -{ - ExtraCount* xCount = (ExtraCount*)BSExtraData::Create(sizeof(ExtraCount), s_ExtraCountVtbl.GetUIntPtr()); - return xCount; -} - -ExtraSoul* ExtraSoul::Create() -{ - ExtraSoul* xSoul = (ExtraSoul*)BSExtraData::Create(sizeof(ExtraSoul), s_ExtraSoulVtbl.GetUIntPtr()); - return xSoul; -} - -ExtraForcedTarget* ExtraForcedTarget::Create() -{ - ExtraForcedTarget* xForcedTarget = (ExtraForcedTarget*)BSExtraData::Create(sizeof(ExtraForcedTarget), s_ExtraForcedTargetVtbl.GetUIntPtr()); - xForcedTarget->handle = (*g_invalidRefHandle); - return xForcedTarget; -} - -ExtraTextDisplayData* ExtraTextDisplayData::Create() -{ - ExtraTextDisplayData* xText = (ExtraTextDisplayData*)BSExtraData::Create(sizeof(ExtraTextDisplayData), s_ExtraTextDisplayVtbl.GetUIntPtr()); - xText->unk14 = -1; - xText->extraHealthValue = 1.0; - return xText; -} - -ExtraReferenceHandle* ExtraReferenceHandle::Create() -{ - ExtraReferenceHandle* xReference = (ExtraReferenceHandle*)BSExtraData::Create(sizeof(ExtraReferenceHandle), s_ExtraReferenceHandleVtbl.GetUIntPtr()); - return xReference; -} - -ExtraRank* ExtraRank::Create() -{ - ExtraRank* xRank = (ExtraRank*)BSExtraData::Create(sizeof(ExtraRank), s_ExtraRankVtbl.GetUIntPtr()); - xRank->rank = 0; - return xRank; -} - -ExtraUniqueID* ExtraUniqueID::Create() -{ - ExtraUniqueID* xUniqueId = (ExtraUniqueID*)BSExtraData::Create(sizeof(ExtraUniqueID), s_ExtraUniqueIdVtbl.GetUIntPtr()); - xUniqueId->ownerFormId = 0; - xUniqueId->uniqueId = 0; - return xUniqueId; -} - -NiPointer ExtraReferenceHandle::GetReference() -{ - NiPointer reference; - if(handle == (*g_invalidRefHandle) || handle == 0) - return NULL; - - LookupREFRByHandle(handle, reference); - return reference; -} - -NiPointer ExtraEnableStateParent::GetReference() -{ - NiPointer reference; - if(handle == (*g_invalidRefHandle) || handle == 0) - return NULL; - - LookupREFRByHandle(handle, reference); - return reference; -} - -NiPointer ExtraForcedTarget::GetReference() -{ - NiPointer reference; - if(handle == (*g_invalidRefHandle) || handle == 0) - return NULL; - - LookupREFRByHandle(handle, reference); - return reference; -} - -const char* ExtraTextDisplayData::GenerateName(TESForm * form, float extraHealthValue) -{ - return CALL_MEMBER_FN(this, GenerateName_Internal)(form, extraHealthValue); -} - -struct GetMatchingEquipped -{ - FormMatcher& m_matcher; - EquipData m_found; - bool m_isWorn; - bool m_isWornLeft; - - GetMatchingEquipped(FormMatcher& matcher, bool isWorn = true, bool isWornLeft = true) : m_matcher(matcher), m_isWorn(isWorn), m_isWornLeft(isWornLeft) - { - m_found.pForm = NULL; - m_found.pExtraData = NULL; - } - - bool Accept(InventoryEntryData* pEntryData) - { - if (pEntryData) - { - // quick check - needs an extendData or can't be equipped - ExtendDataList* pExtendList = pEntryData->extendDataList; - if (pExtendList && m_matcher.Matches(pEntryData->type)) - { - for (ExtendDataList::Iterator it = pExtendList->Begin(); !it.End(); ++it) - { - BaseExtraList * pExtraDataList = it.Get(); - - if (pExtraDataList) - { - if ((m_isWorn && pExtraDataList->HasType(kExtraData_Worn)) || (m_isWornLeft && pExtraDataList->HasType(kExtraData_WornLeft))) - { - m_found.pForm = pEntryData->type; - m_found.pExtraData = pExtraDataList; - return false; - } - } - } - } - } - return true; - } - - EquipData Found() - { - return m_found; - } -}; - -EquipData ExtraContainerChanges::FindEquipped(FormMatcher& matcher, bool isWorn, bool isWornLeft) const -{ - FoundEquipData equipData; - if (data && data->objList) { - GetMatchingEquipped getEquipped(matcher, isWorn, isWornLeft); - data->objList->Visit(getEquipped); - equipData = getEquipped.Found(); - } - return equipData; -}; - -class HotkeyDataFinder -{ -private: - - // Match by either of those, depending on which ctor was used - SInt32 m_matchHotkey; - TESForm * m_matchForm; - - HotkeyData m_found; - -public: - - HotkeyDataFinder(SInt32 hotkey) : m_matchHotkey(hotkey) - { - m_matchForm = NULL; - - m_found.pForm = NULL; - m_found.pHotkey = NULL; - } - - HotkeyDataFinder(TESForm * form) : m_matchForm(form) - { - m_matchHotkey = -1; - - m_found.pForm = NULL; - m_found.pHotkey = NULL; - } - - bool Accept(InventoryEntryData* pEntryData) - { - if (!pEntryData) - return true; - - // If matching by form, skip if this is not the one we're looking for - if (m_matchForm && m_matchForm != pEntryData->type) - return true; - - ExtendDataList* pExtendList = pEntryData->extendDataList; - if (!pExtendList) - return true; - - SInt32 n = 0; - BaseExtraList* pExtraDataList = pExtendList->GetNthItem(n); - while (pExtraDataList) - { - if (ExtraHotkey * extraHotkey = static_cast(pExtraDataList->GetByType(kExtraData_Hotkey))) - { - // Matching by form - found ExtraHotkey? - if (m_matchForm) - { - m_found.pForm = pEntryData->type; - m_found.pHotkey = extraHotkey; - return false; - } - // Matching by hotkey - compare hotkeys - else - { - if (extraHotkey->hotkey == m_matchHotkey) - { - m_found.pForm = pEntryData->type; - m_found.pHotkey = extraHotkey; - return false; - } - } - } - - n++; - pExtraDataList = pExtendList->GetNthItem(n); - } - - return true; - } - - HotkeyData& Found() - { - return m_found; - } -}; - -HotkeyData ExtraContainerChanges::FindHotkey(SInt32 hotkey) const -{ - FoundHotkeyData hotkeyData; - if (data && data->objList) { - HotkeyDataFinder getHotkey(hotkey); - data->objList->Visit(getHotkey); - hotkeyData = getHotkey.Found(); - } - return hotkeyData; -} - -HotkeyData ExtraContainerChanges::FindHotkey(TESForm * form) const -{ - FoundHotkeyData hotkeyData; - if (data && data->objList) { - HotkeyDataFinder getHotkey(form); - data->objList->Visit(getHotkey); - hotkeyData = getHotkey.Found(); - } - return hotkeyData; -} - -InventoryEntryData::InventoryEntryData(TESForm * item, UInt32 count) -{ - type = item; - countDelta = count; - extendDataList = NULL; -} - -InventoryEntryData * InventoryEntryData::Create(TESForm * item, UInt32 count) -{ - InventoryEntryData * p = (InventoryEntryData *)Heap_Allocate(sizeof(InventoryEntryData)); - ASSERT(p); - - new (p) InventoryEntryData(item, count); - p->extendDataList = ExtendDataList::Create(); - - return p; -} - -void InventoryEntryData::Delete(void) -{ - if (extendDataList) - { - extendDataList->Delete(); - extendDataList = NULL; - } - Heap_Free(this); -} - -void InventoryEntryData::GetExtraWornBaseLists(BaseExtraList ** pWornBaseListOut, BaseExtraList ** pWornLeftBaseListOut) const -{ - bool checkWorn = pWornBaseListOut != NULL; - bool checkWornLeft = pWornLeftBaseListOut != NULL; - - if (!extendDataList) - return; - - if (!checkWorn && !checkWornLeft) - return; - - for (ExtendDataList::Iterator it = extendDataList->Begin(); !it.End(); ++it) - { - BaseExtraList * xList = it.Get(); - if (!xList) - continue; - - if (checkWorn && xList->HasType(kExtraData_Worn)) - { - checkWorn = false; - *pWornBaseListOut = xList; - - if (!checkWornLeft) - break; - } - - if (checkWornLeft && xList->HasType(kExtraData_WornLeft)) - { - checkWornLeft = false; - *pWornLeftBaseListOut = xList; - - if (!checkWorn) - break; - } - } -} - -InventoryEntryData::EquipData::EquipData() : - itemCount(0), - itemExtraList(NULL), - wornExtraList(NULL), - wornLeftExtraList(NULL), - isItemWorn(false), - isItemWornLeft(false), - isTypeWorn(false), - isTypeWornLeft(false) -{ -} - -void InventoryEntryData::GetEquipItemData(EquipData& stateOut, SInt32 itemId, SInt32 baseCount) const -{ - bool checkDisplayName = itemId != 0; - - // When searching for a specific itemId, start at 0 and count up for every match. - // When searching for the base item, start at baseCount+delta and subtract 1 for every named item. - stateOut.itemCount = checkDisplayName ? 0 : (baseCount + countDelta); - - // Search for match based on textDisplayData - for (ExtendDataList::Iterator it = extendDataList->Begin(); !it.End(); ++it) - { - BaseExtraList * xList = it.Get(); - if (!xList) - continue; - - SInt32 count = 1; - - ExtraCount* xCount = static_cast(xList->GetByType(kExtraData_Count)); - if (xCount) - count = xCount->count; - - const char * displayName = xList->GetDisplayName(type); - - bool isWorn = xList->HasType(kExtraData_Worn); - bool isWornLeft = xList->HasType(kExtraData_WornLeft); - - if (isWorn) - { - stateOut.isTypeWorn = true; - stateOut.wornExtraList = xList; - } - - if (isWornLeft) - { - stateOut.isTypeWornLeft = true; - stateOut.wornLeftExtraList = xList; - } - - if (checkDisplayName) - { - if (displayName) - { - SInt32 xItemId = (SInt32) HashUtil::CRC32(displayName, type->formID & 0x00FFFFFF); - if (itemId == xItemId) - { - if (isWorn) - stateOut.isItemWorn = true; - else if (isWornLeft) - stateOut.isItemWornLeft = true; - else - stateOut.itemExtraList = xList; - - stateOut.itemCount += count; - } - } - } - else - { - if (!displayName) - { - if (isWorn) - stateOut.isItemWorn = true; - else if (isWornLeft) - stateOut.isItemWornLeft = true; - else - stateOut.itemExtraList = xList; - } - else - { - stateOut.itemCount -= count; - } - } - } -} - -InventoryEntryData * ExtraContainerChanges::Data::FindItemEntry(TESForm * item) const -{ - typedef EntryDataList::Iterator EntryDataIterator; - - if (!objList) - return NULL; - - for (EntryDataIterator it = objList->Begin(); !it.End(); ++it) - { - InventoryEntryData * e = it.Get(); - if (e && e->type == item) - return e; - } - - return NULL; -} - -InventoryEntryData * ExtraContainerChanges::Data::CreateEquipEntryData(TESForm * item) -{ - InventoryEntryData * newEntryData = NULL; - - // Get count from baseForm container - UInt32 baseCount = 0; - if (owner && owner->baseForm) - { - TESContainer * container = DYNAMIC_CAST(owner->baseForm, TESForm, TESContainer); - if (container) - baseCount = container->CountItem(item); - } - - // Find existing entryData for this item - InventoryEntryData * curEntryData = FindItemEntry(item); - - if (curEntryData) - { - newEntryData = InventoryEntryData::Create(item, baseCount + curEntryData->countDelta); - - ExtendDataList * curExtendDataList = curEntryData->extendDataList; - ExtendDataList * newExtendDataList = newEntryData->extendDataList; - - if (curExtendDataList) - { - BaseExtraList * head = curExtendDataList->GetNthItem(0); - if (head && (! head->CheckContainerExtraData(true))) - newExtendDataList->Insert(head); - else - newExtendDataList->Append(curExtendDataList->Begin()); - } - else - { - // Native func does this, though the entryData is deleted later anyway... - newExtendDataList->Delete(); - newEntryData->extendDataList = NULL; - } - } - else - { - if (baseCount > 0) - { - newEntryData = InventoryEntryData::Create(item, baseCount); - } - } - - return newEntryData; -} - -void ExtraContainerChanges::Data::GetEquipItemData(InventoryEntryData::EquipData& stateOut, TESForm * item, SInt32 itemId) const -{ - // Get count from baseForm container - UInt32 baseCount = 0; - if (owner && owner->baseForm) - { - TESContainer * container = DYNAMIC_CAST(owner->baseForm, TESForm, TESContainer); - if (container) - baseCount = container->CountItem(item); - } - - bool matchedBaseForm = false; - - // Test base form name for itemId - TESFullName* pFullName = DYNAMIC_CAST(item, TESForm, TESFullName); - if (pFullName) - { - const char * name = pFullName->name.data; - SInt32 baseItemId = (SInt32)HashUtil::CRC32(name, item->formID & 0x00FFFFFF); - - if (baseItemId == itemId) - matchedBaseForm = true; - } - - // Find existing entryData for this item - InventoryEntryData * curEntryData = FindItemEntry(item); - - // Found entryData - if (curEntryData) - { - curEntryData->GetEquipItemData(stateOut, (matchedBaseForm ? 0 : itemId), baseCount); - } - else if (matchedBaseForm) - { - stateOut.itemCount = baseCount; - } -} diff --git a/source/fs.dll/skse64/skse64/GameExtraData.h b/source/fs.dll/skse64/skse64/GameExtraData.h deleted file mode 100644 index 4b986595..00000000 --- a/source/fs.dll/skse64/skse64/GameExtraData.h +++ /dev/null @@ -1,656 +0,0 @@ -#pragma once - -#include "GameBSExtraData.h" -#include "GameReferences.h" -#include "GameAPI.h" -#include "GameObjects.h" - -// ExtraHavok -// ExtraCell3D -// ExtraCellWaterType -// ExtraRegionList -// ExtraSeenData -// ExtraEditorID -// ExtraCellMusicType -// ExtraCellSkyRegion -// ExtraProcessMiddleLow -// ExtraDetachTime - -// 18 -class ExtraPersistentCell : public BSExtraData -{ -public: - ExtraPersistentCell(); - virtual ~ExtraPersistentCell(); - - TESObjectCELL* cell; // 10 -}; -// ExtraAction -// ExtraStartingPosition -// ExtraAnimGraphManager -// ExtraUsedMarkers -// ExtraDistantData -// ExtraRagDollData -class ExtraHotkey; - -class InventoryEntryData -{ -public: - struct EquipData - { - SInt32 itemCount; - - BaseExtraList* itemExtraList; - - BaseExtraList* wornExtraList; - BaseExtraList* wornLeftExtraList; - - bool isItemWorn; - bool isItemWornLeft; - bool isTypeWorn; - bool isTypeWornLeft; - - EquipData(); - }; - - InventoryEntryData(TESForm * item, UInt32 count); - - TESForm* type; - ExtendDataList* extendDataList; - SInt32 countDelta; - - // Heap allocated - static InventoryEntryData * Create(TESForm * item, UInt32 count); - void Delete(void); - - void GetExtraWornBaseLists(BaseExtraList ** pWornBaseListOut, BaseExtraList ** pWornLeftBaseListOut) const; - void GetEquipItemData(EquipData& stateOut, SInt32 itemId, SInt32 baseCount) const; - - MEMBER_FN_PREFIX(InventoryEntryData); - DEFINE_MEMBER_FN(GenerateName, const char *, 0x001E2B70); - DEFINE_MEMBER_FN(GetValue, SInt32, 0x001E1EC0); - DEFINE_MEMBER_FN(IsOwnedBy, bool, 0x001E2CB0, TESForm * actor, bool unk1); - DEFINE_MEMBER_FN(GetSoulLevel, UInt32, 0x001E2040); -}; - -typedef tList EntryDataList; - -class ExtraContainerChanges : public BSExtraData -{ -public: - ExtraContainerChanges(); - virtual ~ExtraContainerChanges(); - - class Data - { - public: - EntryDataList* objList; - TESObjectREFR* owner; - float totalWeight; - float armorWeight; - - InventoryEntryData * FindItemEntry(TESForm * item) const; - - // Allocate new entry data as a merge between base container data and extra data - // Uses BaseExtraList*'s from original extra data and combined count - InventoryEntryData * CreateEquipEntryData(TESForm * item); - - void GetEquipItemData(InventoryEntryData::EquipData& stateOut, TESForm * item, SInt32 itemId) const; - - MEMBER_FN_PREFIX(Data); - DEFINE_MEMBER_FN(SetUniqueID, void, 0x001F8560, BaseExtraList* itemList, TESForm * oldForm, TESForm * newForm); - DEFINE_MEMBER_FN(TransferItemUID, void, 0x001F8810, BaseExtraList * extraList, TESForm * oldForm, TESForm * newForm, UInt32 unk1); - }; - - Data * data; - - struct FoundEquipData { - TESForm* pForm; - BaseExtraList* pExtraData; - }; - - struct FoundHotkeyData { - TESForm* pForm; - ExtraHotkey * pHotkey; - }; - - FoundEquipData FindEquipped(FormMatcher& matcher, bool isWorn = true, bool isWornLeft = true) const; - FoundHotkeyData FindHotkey(SInt32 hotkey) const; - FoundHotkeyData FindHotkey(TESForm * form) const; -}; -typedef ExtraContainerChanges::FoundEquipData EquipData; -typedef ExtraContainerChanges::FoundHotkeyData HotkeyData; - -// 10 - class ExtraWorn : public BSExtraData -{ -public: - ExtraWorn(); - virtual ~ExtraWorn(); -}; - - // 10 -class ExtraWornLeft : public BSExtraData -{ -public: - ExtraWornLeft(); - virtual ~ExtraWornLeft(); -}; - // ExtraPackageStartLocation - -// 28 -class ExtraPackage : public BSExtraData -{ -public: - ExtraPackage(); - virtual ~ExtraPackage(); - - TESPackage * currentPackage; // 10 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - init'd to 0000FFFFF - UInt8 unk20; // 20 - init'd to F8 - UInt8 pad21[7]; // 21 -}; - // ExtraTresPassPackage - // ExtraRunOncePacks - -// 18 -class ExtraReferenceHandle : public BSExtraData -{ -public: - ExtraReferenceHandle(); - virtual ~ExtraReferenceHandle(); - - UInt32 handle; // 10 - UInt32 pad; // 14 - - NiPointer GetReference(); - static ExtraReferenceHandle* Create(); -}; - -// 28 -class ExtraFollower : public BSExtraData -{ -public: - ExtraFollower(); - virtual ~ExtraFollower(); - - tArray unk10; // 10 -}; - // ExtraLevCreaModifier - // ExtraGhost - // ExtraOriginalReference - -// 18 -class ExtraOwnership : public BSExtraData -{ -public: - ExtraOwnership(); - virtual ~ExtraOwnership(); - - TESForm* owner; -}; - // ExtraGlobal - -// 18 -class ExtraRank : public BSExtraData -{ -public: - ExtraRank(); - virtual ~ExtraRank(); - - SInt32 rank; // 10 - UInt32 pad; // 14 - - static ExtraRank* Create(); -}; - -// 18 -class ExtraCount : public BSExtraData -{ -public: - ExtraCount(); - virtual ~ExtraCount(); - - UInt32 count; // 10 - Should be 16... - UInt32 pad; // 14 - - static ExtraCount* Create(); -}; - -// 18 -class ExtraHealth : public BSExtraData // Tempered -{ -public: - ExtraHealth(); - virtual ~ExtraHealth(); - - enum { // Multiplier - kHealthBase = 1 - }; - - float health; - UInt32 pad; - - static ExtraHealth* Create(); -}; - -// 18 -class ExtraTimeLeft : public BSExtraData -{ -public: - ExtraTimeLeft(); - virtual ~ExtraTimeLeft(); - - float time; - UInt32 pad; -}; - -// 18 -class ExtraCharge : public BSExtraData -{ -public: - ExtraCharge(); - virtual ~ExtraCharge(); - - float charge; - UInt32 pad; - - static ExtraCharge* Create(); -}; - // ExtraLight - // ExtraLock - // ExtraTeleport - // ExtraMapMarker - // ExtraLeveledCreature - // ExtraLeveledItem - -// 18 -class ExtraScale : public BSExtraData -{ -public: - ExtraScale(); - virtual ~ExtraScale(); - - float scale; - UInt32 pad; -}; - // ExtraSeed - // ExtraMagicCaster - // ExtraPlayerCrimeList - -// 18 -class ExtraEnableStateParent : public BSExtraData -{ -public: - ExtraEnableStateParent(); - virtual ~ExtraEnableStateParent(); - - UInt8 unk10; // 10 - UInt8 pad11[3]; // 11 - UInt32 handle; // 14 handle? - - NiPointer GetReference(); -}; - // ExtraEnableStateChildren - // ExtraItemDropper - // ExtraDroppedItemList - // ExtraRandomTeleportMarker - // ExtraSavedHavokData - -// 10 -class ExtraCannotWear : public BSExtraData -{ -public: - ExtraCannotWear(); - virtual ~ExtraCannotWear(); - - static ExtraCannotWear* Create(); -}; - -// 20 -class ExtraPoison : public BSExtraData -{ -public: - ExtraPoison(); - virtual ~ExtraPoison(); - - // SE: they swapped order of poison and unk - AlchemyItem* poison; // 10 - UInt32 unk18; // 18 - UInt32 pad; // 1C -}; - - // ExtraLastFinishedSequence - // ExtraSavedAnimation - // ExtraNorthRotation - // ExtraSpawnContainer - // ExtraFriendHits - // ExtraHeadingTarget - // ExtraRefractionProperty - // ExtraStartingWorldOrCell - -// 18 -class ExtraHotkey : public BSExtraData -{ -public: - ExtraHotkey(); - virtual ~ExtraHotkey(); - - SInt8 hotkey; // 10 (1 to 8, -1 unbound) - UInt8 pad[7]; // 11 - - static ExtraHotkey* Create(); -}; - // ExtraEditiorRefMoveData - // ExtraInfoGeneralTopic - // ExtraHasNoRumors - // ExtraSound - // ExtraTerminalState - // ExtraLinkedRef - // ExtraLinkedRefChildren - // ExtraActivateRef - // ExtraActivateRefChildren - // ExtraCanTalkToPlayer - // ExtraObjectHealth - // ExtraCellImageSpace - // ExtraNavMeshPortal - // ExtraModelSwap - // ExtraRadius - -// 38 -struct ExtraFactionChanges : public BSExtraData -{ -public: - ExtraFactionChanges(); - virtual ~ExtraFactionChanges(); - - struct FactionInfo - { - TESFaction * faction; // 00 - SInt8 rank; // 04 - UInt8 pad[3]; // 05 - }; - - tArray factions; // 10 - UInt64 unk28; // 28 - UInt8 unk30; // 30 - SE: this used to be at beginning in Skyrim32 - UInt8 unk31[7]; // 31 -}; - // ExtraDismemberedLimbs - // ExtraActorCause - // ExtraMultiBound - // ExtraMultiBoundData - // ExtraMultiBoundRef - // ExtraReflectedRefs - // ExtraReflectorRefs - // ExtraEmittanceSource - // ExtraRadioData - // ExtraCombatStyle - -// 18 -struct ExtraPrimitive : public BSExtraData -{ -public: - ExtraPrimitive(); - virtual ~ExtraPrimitive(); - - BGSPrimitive * primitive; -}; - // ExtraOpenCloseActivateRef - // ExtraAnimNoteReceiver - // ExtraAmmo - // ExtraPatrolRefData - // ExtraPackageData - // ExtraOcclusionShape - -// 18 -struct ExtraCollisionData : public BSExtraData -{ -public: - ExtraCollisionData(); - virtual ~ExtraCollisionData(); - - struct Data - { - UInt32 collisionLayer; // LayerId - }; - - Data * data; -}; - // ExtraSayTopicInfoOnceADay - - // 18 -struct ExtraEncounterZone : public BSExtraData -{ -public: - ExtraEncounterZone(); - virtual ~ExtraEncounterZone(); - - BGSEncounterZone* encounterZone; -}; - // ExtraSayTopicInfo - // ExtraOcclusionPlaneRefData - // ExtraPortalRefData - // ExtraPortal - // ExtraRoom - // ExtraHealthPerc - // ExtraRoomRefData - // ExtraGuardedRefData - // ExtraCreatureAwakeSound - // ExtraHorse - // ExtraIgnoredBySandbox - // ExtraCellAcousticSpace - // ExtraReservedMarkers - // ExtraWeaponIdleSound - // ExtraWaterLightRefs - // ExtraWeaponAttackSound - // ExtraActivateLoopSound - // ExtraPatrolRefInUseData - // ExtraAshPileRef - -// 38 -class ExtraFollowerSwimBreadcrumbs : public BSExtraData -{ -public: - ExtraFollowerSwimBreadcrumbs(); - virtual ~ExtraFollowerSwimBreadcrumbs(); - - UInt32 unk10; - float unk14; // Looks like a position? - float unk18; - float unk1C; - UInt32 unk20; - UInt32 pad24; - UInt64 unk28; - UInt64 unk30; -}; - -// 30 -class ExtraAliasInstanceArray : public BSExtraData -{ -public: - ExtraAliasInstanceArray(); - virtual ~ExtraAliasInstanceArray(); - - // 18 - struct AliasInfo - { - TESQuest * quest; - BGSBaseAlias * alias; - tArray * packages; - }; - - tArray aliases; // 10 - UInt32 unk28; - UInt32 unk2C; -}; - -// 18 -class ExtraLocation : public BSExtraData -{ -public: - ExtraLocation(); // Related to protected/essential - ~ExtraLocation(); - - BGSLocation* location; -}; - // ExtraLitWaterRefs - // ExtraLocationRefType - -// 28 -class ExtraPromotedRef : public BSExtraData -{ -public: - ExtraPromotedRef(); - virtual ~ExtraPromotedRef(); - - tArray unk08; -}; - // ExtraOutfitItem - // ExtraLeveledItemBase - -// 28 -class ExtraLightData : public BSExtraData -{ -public: - ExtraLightData(); - virtual ~ExtraLightData(); - - float unk10; // 10 - UInt32 unk14; // 14 - UInt32 unk18; // 18 - float unk1C; // 1C - UInt8 unk20; // 20 - UInt8 pad21[7]; // 21 -}; - // ExtraSceneData - // ExtraBadPosition - // ExtraHeadTrackingWeight - // ExtraFromAlias - // ExtraShouldWear - // ExtraFavorCost - // ExtraAttachedArrows3D - -// 38 -class ExtraTextDisplayData : public BSExtraData -{ -public: - ExtraTextDisplayData(); - virtual ~ExtraTextDisplayData(); - - BSFixedString name; // 10 - BGSMessage * message; // 18 - TESQuest * owner; // 20 - SInt32 unk14; // 28 -1 default -2 explicit name? - float extraHealthValue; // 2C - UInt16 unk30; // 30 - UInt8 pad32[6]; // 32 - - const char* GenerateName(TESForm * form, float extraHealthValue); - - static ExtraTextDisplayData* Create(); - - MEMBER_FN_PREFIX(ExtraTextDisplayData); - DEFINE_MEMBER_FN(SetName_Internal, void, 0x00143C40, const char * name); - DEFINE_MEMBER_FN(GenerateName_Internal, const char*, 0x00143B10, TESForm * form, float extraHealthValue); -}; - // ExtraAlphaCutoff - -// 20 -class ExtraEnchantment : public BSExtraData -{ -public: - ExtraEnchantment(); - virtual ~ExtraEnchantment(); - - EnchantmentItem* enchant; // 10 - UInt16 maxCharge; // 18 - UInt8 unk0E; // 1A - usually 0 - UInt8 pad1B[5]; // 1B - - static ExtraEnchantment* Create(); -}; - -// 18 -class ExtraSoul : public BSExtraData -{ -public: - ExtraSoul(); - virtual ~ExtraSoul(); - - UInt32 count; // 10 - Should be 8 bits - UInt32 pad; // 14 - - static ExtraSoul* Create(); -}; - -// 18 -class ExtraForcedTarget : public BSExtraData -{ -public: - UInt32 handle; // 10 - UInt32 pad; // 14 - - static ExtraForcedTarget* Create(); - NiPointer GetReference(); -}; -STATIC_ASSERT(sizeof(ExtraForcedTarget) == 0x18); - -// 18 -class ExtraUniqueID : public BSExtraData -{ -public: - UInt32 ownerFormId; // 10 - UInt16 uniqueId; // 14 - UInt16 pad; // 16 - - static ExtraUniqueID* Create(); -}; - // ExtraUniqueID - // ExtraFlags - -// 18 -class ExtraFlags : public BSExtraData -{ - ExtraFlags(); - virtual ~ExtraFlags(); - - UInt32 flags; // 10 - UInt32 pad; // 14 -}; - // ExtraRefrPath - // ExtraDecalGroup - // ExtraLockList - // ExtraForcedLandingMarker - // ExtraLargeRefOwnerCells - // ExtraCelLWaterEnvMap - // ExtraCellGrassData - // ExtraTeleportName - // ExtraInteraction - // ExtraWaterData - // ExtraWaterCurrentZoneData - // ExtraAttachRef - // ExtraAttachRefChildren - // ExtraGroupConstraint - // ExtraScriptedAnimDependence - // ExtraCachedScale - // ExtraRaceData - // ExtraGIDBuffer - // ExtraMissingRefIDs - - -extern const RelocPtr s_ExtraHealthVtbl; -extern const RelocPtr s_ExtraChargeVtbl; -extern const RelocPtr s_ExtraCountVtbl; -extern const RelocPtr s_ExtraTextDisplayVtbl; -extern const RelocPtr s_ExtraSoulVtbl; -extern const RelocPtr s_ExtraOwnershipVtbl; -extern const RelocPtr s_ExtraAliasInstanceArrayVtbl; -extern const RelocPtr s_ExtraCannotWearVtbl; -extern const RelocPtr s_ExtraHotkeyVtbl; -extern const RelocPtr s_ExtraForcedTargetVtbl; -extern const RelocPtr s_ExtraReferenceHandleVtbl; -extern const RelocPtr s_ExtraEnchantmentVtbl; -extern const RelocPtr s_ExtraRankVtbl; -extern const RelocPtr s_ExtraUniqueIdVtbl; diff --git a/source/fs.dll/skse64/skse64/GameFormComponents.cpp b/source/fs.dll/skse64/skse64/GameFormComponents.cpp deleted file mode 100644 index daf5c8b9..00000000 --- a/source/fs.dll/skse64/skse64/GameFormComponents.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include "skse64/GameFormComponents.h" -#include "skse64/GameData.h" - -UInt32 BGSBipedObjectForm::AddSlotToMask(UInt32 slot) -{ - data.parts |= slot; - return data.parts; -} - -UInt32 BGSBipedObjectForm::RemoveSlotFromMask(UInt32 slot) -{ - data.parts &= ~slot; - return data.parts; -} - -UInt32 TESSpellList::GetSpellCount() const -{ - return data ? data->numSpells : 0; -} - -SpellItem* TESSpellList::GetNthSpell(UInt32 n) const -{ - if (data && n < data->numSpells) { - return data->spells[n]; - } - else return NULL; -} - -UInt32 TESSpellList::GetShoutCount() const -{ - return data ? data->numShouts : 0; -} - -TESShout* TESSpellList::GetNthShout(UInt32 n) const -{ - if (data && n < data->numShouts) { - return data->shouts[n]; - } - else return NULL; -} - -class ItemCounter -{ - UInt32 m_count; - TESForm * m_item; - -public: - ItemCounter(TESForm * item) : m_count(0), m_item(item) {} - - bool Accept(TESContainer::Entry * entry) - { - if (entry->form == m_item) - m_count += entry->count; - return true; - } - - UInt32 Count() const { return m_count; } -}; - -UInt32 TESContainer::CountItem(TESForm * item) const -{ - ItemCounter v(item); - Visit(v); - return v.Count(); -} - -UInt32 TintMask::ToARGB() -{ - return MAKE_COLOR((UInt32)(alpha * 255), color.red, color.green, color.blue); -} - -SInt32 PlayerSkills::ResolveAdvanceableSkillId(SInt32 actorValue) -{ - if(actorValue - kAdvanceableSkillOffset >= 0 && actorValue < kNumAdvanceableSkills + kAdvanceableSkillOffset) - return actorValue - kAdvanceableSkillOffset; - - return -1; -} - -float PlayerSkills::GetSkillPoints(BSFixedString actorValue) -{ - if(data) { - UInt32 avId = LookupActorValueByName(actorValue.data); - SInt32 skillId = ResolveAdvanceableSkillId(avId); - if(skillId != -1) - return data->levelData[skillId].points; - } - - return 0.0; -} - -void PlayerSkills::SetSkillPoints(BSFixedString actorValue, float points) -{ - if(data) { - UInt32 avId = LookupActorValueByName(actorValue.data); - SInt32 skillId = ResolveAdvanceableSkillId(avId); - if(skillId != -1) - data->levelData[skillId].points = points; - } -} - -SInt32 PlayerSkills::GetSkillLegendaryLevel(BSFixedString actorValue) -{ - if(data) { - UInt32 avId = LookupActorValueByName(actorValue.data); - SInt32 skillId = ResolveAdvanceableSkillId(avId); - if(skillId != -1) - return data->legendaryLevel[skillId]; - } - - return -1; -} - -void PlayerSkills::SetSkillLegendaryLevel(BSFixedString actorValue, UInt32 level) -{ - if(data) { - UInt32 avId = LookupActorValueByName(actorValue.data); - SInt32 skillId = ResolveAdvanceableSkillId(avId); - if(skillId != -1) - data->legendaryLevel[skillId] = level; - } -} diff --git a/source/fs.dll/skse64/skse64/GameFormComponents.h b/source/fs.dll/skse64/skse64/GameFormComponents.h deleted file mode 100644 index 1d1efd19..00000000 --- a/source/fs.dll/skse64/skse64/GameFormComponents.h +++ /dev/null @@ -1,1514 +0,0 @@ -#pragma once - -// everything deriving from BaseFormComponent but not TESForm goes here - -#include "skse64/GameTypes.h" - -class TESObjectSTAT; -class BGSSoundDescriptorForm; -class BGSSoundOutput; -class BGSSoundCategory; -class BGSKeyword; -class TESForm; -class SpellItem; -class TESShout; -class IngredientItem; -class TESRace; -class EnchantmentItem; -class TESFaction; -class BGSVoiceType; -class BGSEquipSlot; -class Actor; -class TESObjectARMO; -class TESObjectARMA; -class TESIdleForm; -class BGSPerk; -class ActorValueInfo; -class TESGlobal; -class TESRegion; -class BGSMusicType; -class TESWeather; -class TESPackage; -class BGSMusicTrackFormWrapper; -class BGSImpactDataSet; -class BGSMaterialType; -class NiNode; -class NiAVObject; - -//// root - -// 04 -class BaseFormComponent -{ -public: - BaseFormComponent(); - virtual ~BaseFormComponent(); - - virtual void Init(void); - virtual void ReleaseRefs(void); - virtual void CopyFromBase(BaseFormComponent * rhs); - - // void ** _vtbl; // 00 -}; - -//// members of other components - -// 10 -class TESTexture : public BaseFormComponent -{ -public: - virtual UInt32 Unk_04(void); - virtual void GetNormalMapName(BSString * out); // might have const char * retn type - virtual const char * GetSearchDir(void); - - BSFixedString str; // 08 -}; - -// 10 -class TESIcon : public TESTexture -{ - -}; - -// 10 -class TESTexture1024 : public TESTexture -{ - -}; - -//// leaf nodes - -// 10 -class BGSAttackDataForm : public BaseFormComponent -{ -public: - BSTSmartPointer unk08; // 08 -}; - -// 10 -class BGSBipedObjectForm : public BaseFormComponent -{ -public: - // applicable to DefaultRace - enum - { - kPart_Head = 1 << 0, - kPart_Hair = 1 << 1, - kPart_Body = 1 << 2, - kPart_Hands = 1 << 3, - kPart_Forearms = 1 << 4, - kPart_Amulet = 1 << 5, - kPart_Ring = 1 << 6, - kPart_Feet = 1 << 7, - kPart_Calves = 1 << 8, - kPart_Shield = 1 << 9, - kPart_Unnamed10 = 1 << 10, - kPart_LongHair = 1 << 11, - kPart_Circlet = 1 << 12, - kPart_Ears = 1 << 13, - kPart_Unnamed14 = 1 << 14, - kPart_Unnamed15 = 1 << 15, - kPart_Unnamed16 = 1 << 16, - kPart_Unnamed17 = 1 << 17, - kPart_Unnamed18 = 1 << 18, - kPart_Unnamed19 = 1 << 19, - kPart_Unnamed20 = 1 << 20, - kPart_Unnamed21 = 1 << 21, - kPart_Unnamed22 = 1 << 22, - kPart_Unnamed23 = 1 << 23, - kPart_Unnamed24 = 1 << 24, - kPart_Unnamed25 = 1 << 25, - kPart_Unnamed26 = 1 << 26, - kPart_Unnamed27 = 1 << 27, - kPart_Unnamed28 = 1 << 28, - kPart_Unnamed29 = 1 << 29, - kPart_Unnamed30 = 1 << 30, - kPart_FX01 = 1 << 31, - }; - - enum - { - kWeight_Light = 0, - kWeight_Heavy, - kWeight_None, - }; - - struct Data - { - UInt32 parts; // 00 - init'd to 0 - UInt32 weightClass; // 04 - init'd to 2 (none) - }; - - Data data; // 08 - - UInt32 GetSlotMask() const { return data.parts; } - void SetSlotMask(UInt32 mask) { data.parts = mask; } - UInt32 AddSlotToMask(UInt32 mask); - UInt32 RemoveSlotFromMask(UInt32 mask); -}; - -// 18 -class BGSBlockBashData : public BaseFormComponent -{ -public: - BGSImpactDataSet * impact; // 08 - BGSMaterialType * material; // 10 -}; - -// 10 -class BGSDestructibleObjectForm : public BaseFormComponent -{ -public: - // 10 or 10+ - struct Data - { - UInt32 health; // 00 - UInt8 destCount; // 04 - UInt8 vatsTargetable; // 05 - UInt8 pad06[2]; // 06 - void *unk08; // 08 - - // ...? - }; - - Data * data; // 08 -}; - -// 10 -class BGSEquipType : public BaseFormComponent -{ -public: - virtual BGSEquipSlot * GetEquipSlot(void); - virtual void SetEquipSlot(BGSEquipSlot * type); - - BGSEquipSlot * equipSlot; // 08 -}; - -// 20 -class BGSIdleCollection : public BaseFormComponent -{ -public: - UInt8 unk08; // 08 - UInt8 unk09; // 09 - unk10 length - UInt8 unk0A[6]; // 0A - void ** unk10; // 10 - copyable struct - UInt32 unk18; // 18 - UInt32 pad1C; // 1C -}; - -// 18 -class BGSKeywordForm : public BaseFormComponent -{ -public: - virtual bool HasKeyword(BGSKeyword* keyword); - virtual UInt32 GetDefaultKeyword(void); - - BGSKeyword ** keywords; // 08 - UInt32 numKeywords; // 10 - UInt32 pad14; -}; - -// 10 -class BGSMenuDisplayObject : public BaseFormComponent -{ -public: - virtual UInt32 GetMenuDisplayObject(void); - - TESObjectSTAT * worldStatic; // 08 - copyable -}; - -// 18 -class BGSMessageIcon : public BaseFormComponent -{ -public: - TESIcon icon; // 08 -}; - -// 28 -class BGSOverridePackCollection : public BaseFormComponent -{ -public: - UInt64 unk08; // 08 - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt64 unk20; // 20 -}; - -// 18 -class BGSPerkRankArray : public BaseFormComponent -{ -public: - // 10 - struct Data - { - BGSPerk * perk; // 00 - UInt8 rank; // 08 - UInt8 pad05[7]; // 09 - }; - - Data * perkRanks; // 08 - UInt32 numPerkRanks; // 10 - UInt32 pad14; // 14 -}; - -class BGSPerkRanks : public tArray -{ -public: - MEMBER_FN_PREFIX(BGSPerkRanks); - DEFINE_MEMBER_FN(VisitPerks, void, 0x00000000, void * perkRankVisitor); // BGSPerk::PerkRankVisitor -}; - -// 18 -class BGSPickupPutdownSounds : public BaseFormComponent -{ -public: - BGSSoundDescriptorForm* pickUp; // 08 - BGSSoundDescriptorForm* putDown; // 10 -}; - -// 08 -class BGSPreloadable : public BaseFormComponent -{ -public: - virtual void Unk_04(void); // pure virtual -}; - -// 10 -class BGSSkinForm : public BaseFormComponent -{ -public: - TESObjectARMO * skin; // 04 -}; - -// 28 -class TESAIForm : public BaseFormComponent -{ -public: - // 10 - might be ExtraDataList - struct Data - { - void *unk0; // 0 - Data * next; // 8 - }; - - UInt32 flags; // 08 - UInt32 unk0C; // 0C - UInt16 unk10; // 10 - UInt8 pad12[6]; // 12 - - Data unk18; // 18 -}; - -// 58 -class TESActorBaseData : public BaseFormComponent -{ -public: - virtual void Unk_04(UInt32 arg); - virtual bool GetFlag20000000(void); - virtual bool GetFlag80000000(void); - virtual bool Unk_07(void); - virtual UInt32 GetUnk20(void); - - enum { - kFlag_PCLevelMult = 0x80 - }; - - UInt32 flags; // 08 - init'd to 0 - UInt16 unk0C; // 0C - init'd to 0 - UInt16 unk0E; // 0E - init'd to 0 - UInt16 level; // 10 - init'd to 1 (CK Multiplier * 1000 if PCLevelMult is true) - UInt16 minLevel; // 12 - init'd to 0 - UInt16 maxLevel; // 14 - init'd to 0 - UInt16 unk16; // 16 - init'd to 0x64 (100) - UInt16 unk18; // 18 - init'd to iBaseDisposition (35) - UInt16 unk1A; // 1A - init'd to 0 - UInt16 unk1C; // 1C - init'd to 0 - UInt16 unk1E; // 1E - init'd to 0 - UInt64 unk20; // 20 - BGSVoiceType* voiceType; // 28 - UInt64 unk30; // 30 - UInt32 unk38; // 38 - init'd to 0 - UInt32 pad3C; // 3C - - struct FactionInfo - { - TESFaction * faction; // 00 - SInt8 rank; // 08 - UInt8 pad[7]; // 09 - }; - - tArray factions; // 40 -}; - -STATIC_ASSERT(sizeof(TESActorBaseData) == 0x58); - -// 10 -class TESAttackDamageForm : public BaseFormComponent -{ -public: - virtual UInt16 GetAttackDamage(void); - - UInt16 attackDamage; // 08 - UInt8 pad06[2]; // 0A - UInt32 pad0C; // 0C -}; - -class BGSTextureSet; - -// 28 -class TESModel : public BaseFormComponent -{ -public: - virtual const char * GetModelName(void); - virtual void SetModelName(const char * name); - virtual UInt32 Unk_06(void); - - BSFixedString name; // 08 - - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt32 unk20; // 20 -}; - -// 38 -class TESModelTextureSwap : public TESModel -{ -public: - // 18 - struct SwapInfo - { - BGSTextureSet * textureSet; // 00 - UInt32 unk04; // 08 - index - BSFixedString name; // 10 - }; - - SwapInfo * swaps; // 28 - UInt32 count; // 30 -}; - -// 28 -class TESModelRDT : public TESModel -{ -public: -}; - -// F0 -class TESBipedModelForm : public BaseFormComponent -{ -public: - TESModelTextureSwap textureSwap[2]; // 08 - TESIcon icon[2]; // 78 - BGSMessageIcon messageIcon[2]; // 98 - TESModelRDT modelRDT; // C8 -}; - - -// 18 -class TESContainer : public BaseFormComponent -{ -public: - struct Entry - { - struct Data - { - TESForm* owner; // 00 - TESGlobal* global; // 08 - float condition; // 10 - }; - - UInt32 count; // 00 - UInt32 unk04; // 04 - likely just pad - TESForm* form; // 08 - Data * data; // 10 - extra data - }; - - Entry ** entries; // 8 - UInt32 numEntries; // 10 - - template - UInt32 CountIf(Op& op) const - { - UInt32 count = 0; - for (UInt32 n = 0; n < numEntries; n++) { - Entry* pEntry = entries[n]; - if (pEntry && op.Accept(pEntry)) - count++; - } - return count; - } - - template - Entry* Find(Op& op) const - { - bool bFound = false; - UInt32 n = 0; - Entry* pEntry = NULL; - for (UInt32 n = 0; n < numEntries && !bFound; n++) { - pEntry = entries[n]; - if (pEntry) { - bFound = op.Accept(pEntry); - } - } - return (bFound && pEntry) ? pEntry : NULL; - } - - template - void Visit(Op& op) const { - bool bContinue = true; - for (UInt32 n = 0; n < numEntries && bContinue; n++) { - Entry* pEntry = entries[n]; - if (pEntry) { - bContinue = op.Accept(pEntry); - } - } - } - - UInt32 CountItem(TESForm* item) const; -}; - -// 18 -class TESDescription : public BaseFormComponent -{ -public: - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - init'd to FFFFFFFF - - MEMBER_FN_PREFIX(TESDescription); - DEFINE_MEMBER_FN(Get, void, 0x0019AB70, BSString * out, TESForm * parent, UInt32 fieldType); -}; - -// 18 -class TESEnchantableForm : public BaseFormComponent -{ -public: - virtual UInt16 Unk_04(void); // return unk10 - - EnchantmentItem* enchantment; // 08 - init'd to 0 - UInt16 unk10; // 10 - init'd to 3 - UInt16 maxCharge; // 12 -}; - -// 10 -class TESFullName : public BaseFormComponent -{ -public: - virtual UInt32 Unk_04(void); - virtual const char * GetName(void); - - BSFixedString name; // 08 -}; - -// 10 -class TESImageSpaceModifiableForm : public BaseFormComponent -{ -public: - UInt64 unk08; // 08 -}; - -// 28 -class TESLeveledList : public BaseFormComponent -{ -public: - struct Entry - { - TESForm * form; // 00 - init'd to 0 - UInt16 count; // 08 - init'd to 1 - UInt16 level; // 0A - init'd to 1 - UInt32 pad0C; // 0C - UInt64 unk10; // 10 - init'd to 0 - }; - - enum - { - kFlagCalculateFromAllLevelsLTPCLevel = 1 << 0, - kFlagCalculateForEachItemInCount = 1 << 1, - kFlagUseAll = 1 << 2, - kFlagSpecialLoot = 1 << 3 - }; - - virtual bool Unk_04(void); - virtual bool GetFlag02(void); - virtual UInt32 Unk_06(void); - virtual void Unk_07(void); // pure - - Entry * entries; // 08 - UInt8 chanceValue; // 10 - UInt8 flags; // 11 - UInt8 length; // 12 - UInt8 unk0B; // 13 - UInt32 pad14; // 14 - void * unk18; // 18 - TESGlobal * chanceGlobal; // 20 -}; - -// 28 -class BGSBehaviorGraphModel : public TESModel -{ -public: -}; - -// 28 -class BGSTextureModel : public TESModel -{ -public: -}; - -// 28 -class TESModelPSA : public TESModel -{ -public: -}; - -// 28 -class TESModelTri : public TESModel -{ -public: -}; - -// 20 -class TESProduceForm : public BaseFormComponent -{ -public: - BGSSoundDescriptorForm * harvestSound; // 08 - TESForm * produce; // 10 - UInt32 un18; // 18 - UInt32 pad1C; // 1C -}; - -// 10 -class TESQualityForm : public BaseFormComponent -{ -public: - UInt32 quality; // 08 - UInt32 pad0C; // 0C -}; - -// 10 -class TESRaceForm : public BaseFormComponent -{ -public: - TESRace * race; // 08 -}; - -class TESFaction; - -// 20 -class TESReactionForm : public BaseFormComponent -{ -public: - // 10 - struct Data - { - TESFaction *faction; // 00 - UInt32 modifier; // 08 - UInt32 reaction; // 0C - }; - - // 10 - struct Entry - { - Data * data; // 00 - Entry * unk4; // 08 - }; - - Entry entry; // 08 - UInt8 unk18; // 18 - init'd to B - UInt8 pad19[7]; // 19 -}; - -// 10 -class TESSpellList : public BaseFormComponent -{ -public: - UInt32 GetSpellCount() const; - SpellItem * GetNthSpell(UInt32 n) const; - - UInt32 GetShoutCount() const; - TESShout * GetNthShout(UInt32 n) const; - - struct Data - { - SpellItem** spells; // 00 - SpellItem** (null terminated array of spells) - void * unk4; // 08 - TESShout** shouts; // 10 - UInt32 numSpells; // 18 - UInt32 numUnk4; // 1C - UInt32 numShouts; // 20 - }; - - Data * data; // 08 -}; - -// 10 -class TESValueForm : public BaseFormComponent -{ -public: - UInt32 value; // 08 - UInt32 pad0C; // 0C -}; - -// 10 -class TESWeightForm : public BaseFormComponent -{ -public: - float weight; // 08 -}; - -//// the following are not form components -//// they live here until there's a better header file - -// 58 -class BSMaterialObject -{ -public: - // 34 - struct Data - { - // 0C - struct Data10 - { - UInt32 unk0; // 0 - init'd to 0 - UInt32 unk4; // 4 - init'd to 0 - float unk8; // 8 - init'd to -1 - }; - - float unk00; // 00 - init'd to 0.4 - float unk04; // 04 - init'd to 0.4 - float unk08; // 08 - init'd to 512 - float unk0C; // 0C - init'd to 512 - Data10 unk10; // 10 - float unk1C; // 1C - init'd to 1 - UInt32 unk20; // 20 - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - UInt32 unk30; // 30 - }; - - BSMaterialObject(); - virtual ~BSMaterialObject(); - - virtual void Unk_01(void); - -// void ** _vtbl; // 00 - - Data unk08; // 08 - UnkArray unk40; // 40 -}; -STATIC_ASSERT(sizeof(BSMaterialObject) == 0x58); - -// 08 -class TESChildCell -{ -public: - virtual ~TESChildCell(); - - virtual UInt32 Unk_01(void); - - // void ** _vtbl; -}; - -// 08 -class ActorValueOwner -{ -public: - virtual ~ActorValueOwner(); - - // Argument is the ActorValue ID - virtual float GetCurrent(UInt32 a_akValue); - virtual float GetMaximum(UInt32 a_akValue); - virtual float GetBase(UInt32 a_akValue); - virtual void SetBase(UInt32 a_akValue, float a_value); - virtual void ModBase(UInt32 a_akValue, float a_value); - virtual void ModCurrent(UInt32 a_arg1, UInt32 a_akValue, float a_value); - virtual void SetCurrent(UInt32 a_akValue, float a_value); - virtual bool UsePCAVMult() const; - - // void ** _vtbl; // 00 -}; -STATIC_ASSERT(sizeof(ActorValueOwner) == 0x8); - -// 10 -class BSIMusicTrack -{ -public: - BSIMusicTrack(); - virtual ~BSIMusicTrack(); - - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual bool Unk_07(void); - virtual UInt32 Unk_08(void); // return unk04 - virtual void Unk_09(UInt32 arg); - virtual void Unk_0A(void); - - // void ** _vtbl; // 00 - UInt32 unk08; // 08 -}; - -// 50 -class BSIMusicType -{ -public: - virtual void Unk_00(void); - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - - enum - { - kFlagUnk1 = (1 << 0), - kFlagUnk2 = (1 << 1), - kFlagCycleTracks = (1 << 2), - kFlagDuclsCurrentTrack = (1 << 5) - }; - -// void ** _vtbl; // 00 - UInt32 flags; // 08 - UInt8 priority; // 0C - init'd to 0x32 - UInt8 unk09; // 0D - UInt16 ducking; // 0E (db = ducking/100.0) - float fadeDuration; // 10 - UInt32 unk14; // 14 - UnkArray unk18; // 18 - tArray tracks; // 30 - UInt32 unk48; // 48 -}; - -// 08 -class BSIReverbType -{ -public: - virtual void Unk_00(void); - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - virtual void Unk_08(void); - virtual void Unk_09(void); - virtual void Unk_0A(void); - - // void ** _vtbl; // 00 -}; - -// 08 -class BSISoundCategory -{ -public: - virtual ~BSISoundCategory(); - - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - virtual void Unk_08(void); - virtual void Unk_09(void); - virtual void Unk_0A(void); - virtual void Unk_0B(void); - - // void ** _vtbl; // 00 -}; - -// 08 -class BSISoundDescriptor -{ -public: - virtual ~BSISoundDescriptor(); - - virtual void Unk_01(void) = 0; - virtual void Unk_02(void) = 0; - -// void ** _vtbl; // 00 -}; - -// 08 -class BGSSoundDescriptor : public BSISoundDescriptor -{ -public: - virtual void Unk_01(void); - virtual void Unk_02(void); - - // void ** _vtbl; // 00 -}; - -// 08 -class BSISoundOutputModel -{ -public: - virtual ~BSISoundOutputModel(); - - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - virtual void Unk_08(void); - virtual void Unk_09(void); - - // void ** _vtbl; // 00 -}; - -class BSIPlaybackCharacteristics -{ -public: - virtual ~BSIPlaybackCharacteristics(); - - virtual UInt8 GetFrequencyShift(void) = 0; - virtual UInt8 GetFrequencyVariance(void) = 0; - virtual UInt8 GetPriority(void) = 0; - virtual UInt16 GetDBAttenuation(void) = 0; - virtual UInt8 GetDBVariance(void) = 0; -}; - -// 28 -class SoundPlaybackCharacteristics : public BSIPlaybackCharacteristics -{ -public: - virtual UInt8 GetFrequencyShift(void); - virtual UInt8 GetFrequencyVariance(void); - virtual UInt8 GetPriority(void); - virtual UInt16 GetDBAttenuation(void); - virtual UInt8 GetDBVariance(void); - - UInt8 frequencyShift; // 08 - UInt8 frequencyVariance; // 09 - UInt8 priority; // 0A - UInt8 dbVariance; // 0B - UInt16 dbAttenuation; // 0C - CK Value * 100 - UInt16 pad0E; // 0E - UInt64 unk10; // 10 - BGSSoundOutput * soundOutput; // 18 - UInt32 unk20; // 20 - UInt32 unk24; // 24 -}; - -// 58 -class BGSStandardSoundDef : public BGSSoundDescriptor -{ -public: - virtual ~BGSStandardSoundDef(); - - BGSSoundCategory * soundCategory; // 08 - UInt64 unk10; // 10 - void* unk18; // 18 - UInt32 unk20; // 20 - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - probably pad - SoundPlaybackCharacteristics soundCharacteristics; // 30 -}; -STATIC_ASSERT(sizeof(BGSStandardSoundDef) == 0x58); - -//STATIC_ASSERT(sizeof(BSTEventSource) == 0x30); - -// 08 -class BGSOpenCloseForm -{ -public: - virtual ~BGSOpenCloseForm(); - - // void ** _vtbl; // 00 -}; - -class ActiveEffect; -class Character; -// 18 -class MagicTarget -{ -public: - virtual ~MagicTarget(); - - virtual UInt8 Unk_01(int); - virtual Character * Unk_02(void); - virtual UInt8 Unk_03(void); - virtual bool Unk_04(void); - virtual int Unk_05(int); - virtual bool Unk_06(void); // pure 030 - virtual tList * GetActiveEffects(void); // pure 038 - virtual int Unk_08(int); - virtual void Unk_09(int); - virtual double Unk_0A(int, int, int); - virtual UInt8 Unk_0B(int, int, int); - -// void ** _vtbl; // 00 - UInt64 unk04; // 08 - UInt64 unk08; // 10 -}; -STATIC_ASSERT(sizeof(MagicTarget) == 0x18); - -// 38 -class Condition -{ -public: - enum ComparisonFlags { - kComparisonFlag_And = 0x00, - kComparisonFlag_Or = 0x01, - kComparisonFlag_Equal = 0x00, - kComparisonFlag_UseAliases = 0x02, - kComparisonFlag_Global = 0x04, - kComparisonFlag_UsePackData = 0x08, - kComparisonFlag_SwapTarget = 0x10, - kComparisonFlag_NotEqual = 0x20, - kComparisonFlag_Greater = 0x40, - kComparisonFlag_GreaterEqual = 0x60, - kComparisonFlag_Less = 0x80, - kComparisonFlag_LessEqual = 0xA0 - }; - enum ReferenceTypes { - kReferenceType_None = 0, - kReferenceType_Target, - kReferenceType_Reference, - kReferenceType_CombatTarget, - kReferenceType_LinkedRef, - kReferenceType_Alias, - kReferenceType_PackageData, - kReferenceType_EventData - }; - Condition * next; // 00 - UInt32 compareValue; // 04-08 - UInt32 unk0C; // 08-0C - UInt32 unk10; // 10 - New in SE? - UInt32 unk14; // 0C-14 - FFFFFFFF - UInt16 functionId; // 10-18 - UInt8 unk1A; // 12-1A - UInt8 unk1B; // 13-1B - UInt32 pad1C; // 1C - UInt64 param1; // 14-20 - UInt64 param2; // 18-28 - UInt8 comparisonType; // 1C-30 - UInt8 referenceType; // 1D-31 - UInt8 pad32[6]; // 32 -}; -STATIC_ASSERT(sizeof(Condition) == 0x38); - -class TintMask -{ -public: - TintMask() - { - alpha = 0.0; - tintType = 0; - texture = NULL; - }; - ~TintMask() { }; - -#ifdef PAPYRUS_CUSTOM_CLASS - enum { kTypeID = 300 }; -#endif - - enum { - kMaskType_Frekles = 0, - kMaskType_Lips, - kMaskType_Cheeks, - kMaskType_Eyeliner, - kMaskType_UpperEyeSocket, - kMaskType_LowerEyeSocket, - kMaskType_SkinTone, - kMaskType_WarPaint, - kMaskType_FrownLines, - kMaskType_LowerCheeks, - kMaskType_Nose, - kMaskType_Chin, - kMaskType_Neck, - kMaskType_Forehead, - kMaskType_Dirt - }; - TESTexture * texture; - - union { - struct Color { - UInt8 red, green, blue, alpha; // The alpha isn't actually used here so its usually zero - } color; - UInt32 abgr; - }; - - float alpha; - UInt32 tintType; - - UInt32 ToARGB(); -}; - -// 2778 -class Biped : public BSIntrusiveRefCounted -{ -public: - NiNode * root; // 08 - - struct Data - { - TESForm* armor; // 00 - Can be ARMO or ARMA - TESForm* addon; // 08 - Usually always ARMA - TESModelTextureSwap* model; // 10 - BGSTextureSet* textureSet; // 18 - NiAVObject* object; // 20 - UInt64 unk28[(0x78 - 0x28) >> 3]; - }; - Data unk10[42]; // 10 - Data unk13C0[42]; // 13C0 - UInt32 handle; // 2770 - UInt32 unk2774; // 2774 - - DEFINE_MEMBER_FN_0(UpdateWeightData, void, 0x001D1360); - DEFINE_MEMBER_FN_0(DeleteThis, void, 0x001D1260); -}; -STATIC_ASSERT(offsetof(Biped, unk10) == 0x10); -STATIC_ASSERT(offsetof(Biped, unk13C0) == 0x13C0); -STATIC_ASSERT(sizeof(Biped) == 0x2778); - -// ?? -class BipedModel -{ -public: - enum { - kWeightModel_Small = 0, - kWeightModel_Large = 1 - }; - Biped * bipedData; -}; - -class BSFixedStringCI; - -template -class DoNothingUnhandledPolicy -{ -public: - virtual ~DoNothingUnhandledPolicy(); -}; - -// 2C -#if 0 -// Not done for SE, currently nothing references it -template -class BSResponse : public BSIntrusiveRefCounted, public DoNothingUnhandledPolicy -{ -public: - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - NiNode? - UInt32 unk14; // 14 - NiNode? - UInt32 unk18; // 18 - NiNode? - UInt32 unk1C; // 1C - UInt32 unk20; // 20 - NiNode? - UInt32 unk24; // 24 - UInt32 unk28; // 28 -}; -//STATIC_ASSERT(sizeof(BSResponse>) == 0x2C); -#endif - -// 338 -// Ctor 0x673900 (SE 1.4), 0x72E600 (Skyrim32) -class MiddleProcess -{ -public: - // 10 - struct EffectListNode - { - ActiveEffect * effect; // 0 - EffectListNode * next; // 8 - }; - - // 30 - // This is used also in ActorProcessManager - struct Data58 - { - UInt64 unk00; // 00 - New in SE? - TESPackage * package; // 08 - UInt64 unk10; // 10 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - init'd to FFFFFFFF - float unk20; // 20 - init'd to -1 - UInt32 unk24; // 24 - UInt16 unk28; // 28 - UInt8 unk2A; // 2A - UInt8 unk2B; // 2B - UInt32 pad2C; // 2C - }; - - UnkArray unk000; // 000 - UnkArray unk018; // 018 - UnkArray unk030; // 030 - UInt64 unk048; // 048 - UInt8 unk050; // 050 - UInt8 unk051[7]; // 051 - - Data58 unk058; // 058 - UnkArray unk088; // 088 - - UInt64 unk0A0; // 0A0 - UInt64 unk0A8; // 0A8 - float unk0B0; // 0B0 - float unk0B4; // 0B4 - float unk0B8; // 0B8 - float unk0BC; // 0BC - float unk0C0; // 0C0 - float unk0C4; // 0C4 - float unk0C8; // 0C8 - float unk0CC; // 0CC - float unk0D0; // 0D0 - float unk0D4; // 0D4 - float unk0D8; // 0D8 - float unk0DC; // 0DC - float unk0E0; // 0E0 - float unk0E4; // 0E4 - float unk0E8; // 0E8 - UInt32 unk0EC; // 0EC - UInt32 unk0F0; // 0F0 - UInt32 pad0F4; // 0F4 - UInt64 unk0F8; // 0F8 - UnkArray unk100; // 100 - UInt64 unk118; // 118 - UInt64 unk120; // 120 - UInt64 unk128; // 128 - UInt64 unk130; // 130 - UInt64 unk138; // 138 - UInt64 unk140; // 140 - UInt64 unk148; // 148 - UInt64 unk150; // 150 - void * unk158; // 158 - NiNode? - void * unk160; // 160 - NiNode? - UInt64 unk168; // 168 - void * unk170; // 170 - BSFaceGenNiNode? - void * unk178; // 178 - UInt64 unk180; // 180 - UInt64 unk188; // 188 - UInt64 unk190; // 190 - UInt64 unk198; // 198 - EffectListNode * effectList; // 1A0 - void * unk1A8; // 1A8 - void * unk1B0; // 1B0 - UnkArray unk1B8; // 1B8 - UnkArray unk1D0; // 1D0 - UInt64 unk1E8; // 1E8 - UInt32 unk1F0; // 1F0 - UInt32 unk1F4; // 1F4 - UInt16 unk1F8; // 1F8 - init'd to FFFF - UInt16 unk1FA; // 1FA - init'd to FFFF - UInt32 unk1FC; // 1FC - UInt32 unk200; // 200 - UInt32 unk204; // 204 - init'd to FF7FFFFF - UInt32 furnitureHandle; // 208 - UInt32 pad20C; // 20C - UInt64 unk210; // 210 - UInt32 unk218; // 218 - UInt32 pad21C; // 21C - UInt64 unk220; // 220 - TESIdleForm * currentIdle; // 228 - UInt64 unk230; // 230 - UInt64 unk238; // 238 - UInt64 unk240; // 240 - UInt64 unk248; // 248 - void * unk250; // 250 - hkCharacterProxy? - void * unk258; // 258 - UInt64 unk164; // 260 - UInt64 unk268; // 268 - UInt64 unk270; // 270 - UInt64 unk278; // 278 - UInt64 unk280; // 280 - void * unk288; // 288 - UInt32 unk290; // 290 - UInt32 unk294; // 294 - float unk298; // 298 - init'd to -1 - UInt32 unk29C; // 29C - UInt32 unk2A0; // 2A0 - UInt32 unk2A4; // 2A4 - UInt32 unk2A8; // 2A8 - UInt32 unk2AC; // 2AC - UInt32 unk2B0; // 2B0 - UInt32 unk2B4; // 2B4 - UInt32 unk2B8; // 2B8 - float unk2BC; // 2BC - init'd to -1 - UInt32 unk2C0; // 2C0 - UInt32 unk2C4; // 2C4 - float actorAlpha; // 2C8 - init'd to 1 - - UInt8 todo2CC[0x338 - 0x2CC]; // TODO -}; -STATIC_ASSERT(offsetof(MiddleProcess, effectList) == 0x1A0); -STATIC_ASSERT(offsetof(MiddleProcess, currentIdle) == 0x228); -STATIC_ASSERT(offsetof(MiddleProcess, furnitureHandle) == 0x208); -STATIC_ASSERT(offsetof(MiddleProcess, actorAlpha) == 0x2C8); -STATIC_ASSERT(sizeof(MiddleProcess) == 0x338); - -// 140 -class ActorProcessManager -{ -public: - enum { - kEquippedHand_Left = 0, - kEquippedHand_Right = 1 - }; - enum { - kFlags_None = 0, - kFlags_Unk01 = 1, - kFlags_Unk02 = 2, - kFlags_Unk03 = 4, - kFlags_DrawHead = 8, - kFlags_Mobile = 16, - kFlags_Reset = 32 - }; - UInt64 unk00; // 00 - MiddleProcess * middleProcess; // 08 - void * unk10; // 10 - - - MiddleProcess::Data58 unk18; // 18 - float unk48; // 48 - init'd to -1 - UInt32 unk4C; // 4C - UInt64 unk50; // 50 - UInt32 unk58; // 58 - UInt32 pad5C; // 5C - UInt64 unk60; // 60 - UInt64 unk68; // 68 - UInt64 unk70; // 70 - UInt64 unk78; // 78 - UInt64 unk80; // 80 - UInt64 unk88; // 88 - UInt32 unk90; // 90 - float timeOfDeath; // 94 - GetTimeDead = (GameDaysPassed*24) - timeOfDeath - float unk98; // 98 - related with above - UInt32 pad9C; // 9C - UnkFormArray forms; // A0 seen containing [left hand, equip slot, right hand, equip slot, right hand, equip slot) - UInt64 unkB8[7]; // B8 2nd slot points back to this adress - TESForm * equippedObject[2]; // F0 - UInt8 unk100[0x136 - 0x100]; // 100 - UInt8 unk136; // 136 - SInt8 unk137; // 137 - init'd to 3 - UInt8 unk138; // 138 - UInt8 unk139; // 139 - UInt8 unk13A; // 13A - UInt8 unk13B; // 13B - UInt32 pad13C; // 13C - - MEMBER_FN_PREFIX(ActorProcessManager); - DEFINE_MEMBER_FN(SetEquipFlag, void, 0x006A6720, UInt8 flags); - DEFINE_MEMBER_FN(UpdateEquipment, void, 0x006787D0, Actor * actor); - // CDC12817DF3AB5B832348763F433A216BB8A85CA+89 - DEFINE_MEMBER_FN(SetDataFlag, void, 0x00684430, float flag); // Sets a number on the 0x10 object - - void UpdateEquipment_Hooked(Actor * actor); -}; - -STATIC_ASSERT(offsetof(ActorProcessManager, equippedObject) == 0xF0); -STATIC_ASSERT(sizeof(ActorProcessManager) == 0x140); - -// 68 -class BGSSkillPerkTreeNode -{ -public: - virtual ~BGSSkillPerkTreeNode(); - - UInt32 index; // 08 - init'd to ctor argument - UInt32 pad0C; // 0C - tArray connections; // 10 - tArray connectees; // 28 - BGSPerk * perk; // 40 - UInt32 unk48; // 48 - UInt32 gridX; // 4C - UInt32 gridY; // 50 - UInt32 pad54; // 54 - ActorValueInfo * skill; // 58 - float horizontalPos; // 60 - float verticalPos; // 64 - - class PerkVisitor - { - public: - virtual bool Accept(BGSPerk * node) = 0; - }; - - bool VisitPerks(PerkVisitor & visitor) - { - if(visitor.Accept(perk)) - return true; - - for(UInt32 i = 0; i < connections.count; i++) - { - BGSSkillPerkTreeNode* connector = NULL; - connections.GetNthItem(i, connector); - - if(connector->VisitPerks(visitor)) - return true; - } - - return false; - } -}; - -class PlayerSkills -{ -public: - - enum { - kAdvanceableSkillOffset = 6, - kNumAdvanceableSkills = 18 - }; - - struct StatData { - struct LevelData { - float level; // 00 - float points; // 04 - float pointsMax; // 08 - }; - - float levelPoints; // 00 - float levelPointsMax; // 04 - LevelData levelData[kNumAdvanceableSkills]; // 08 - UInt32 legendaryLevel[kNumAdvanceableSkills]; // E0 - }; - - StatData * data; - - static SInt32 ResolveAdvanceableSkillId(SInt32 actorValue); - - float GetSkillPoints(BSFixedString actorValue); - void SetSkillPoints(BSFixedString actorValue, float points); - - SInt32 GetSkillLegendaryLevel(BSFixedString actorValue); - void SetSkillLegendaryLevel(BSFixedString actorValue, UInt32 level); - - MEMBER_FN_PREFIX(PlayerSkills); - DEFINE_MEMBER_FN(GetSkillData, UInt32, 0x0070F910, UInt32 actorValue, float * level, float * points, float * pointsMax, UInt32 * unk6); - DEFINE_MEMBER_FN(IncrementLegendary, UInt32, 0x0070FF00, UInt32 actorValue); - DEFINE_MEMBER_FN(SetLevel, void, 0x0070FEA0, UInt32 level); -}; - -// 10 -class TESRegionData -{ -public: - virtual ~TESRegionData(); - - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual SInt32 GetType(void); // pure - virtual void Unk_04(void); // pure - Init? - virtual void Unk_05(void); // pure - virtual void Unk_06(void); // pure - virtual void Unk_07(void); // pure - - UInt8 unk08; // 08 - UInt8 unk09; // 09 - UInt8 unk0A; // 0A - UInt8 pad0B[5]; // 0B -}; - -class TESRegionObjectBase -{ -public: - virtual ~TESRegionObjectBase(); - - virtual void Unk_01(void); // pure - virtual void Unk_02(void); // pure -}; - -// 10 -class TESRegionGrassObject : public TESRegionObjectBase -{ -public: - virtual ~TESRegionGrassObject(); - - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - - UInt32 unk08; // 08 - UInt32 unk0C; // 0C -}; - -// 20 -class TESRegionGrassObjectList : public tList -{ -public: - virtual ~TESRegionGrassObjectList(); - - UInt32 unk18; // 18 - UInt32 unk1C; // 1C -}; - -// 20 -class TESRegionList : public tList -{ -public: - virtual ~TESRegionList(); - - UInt32 unk18; // 18 - maybe a single byte and rest pad - UInt32 pad1C; // 1C -}; - -// 18 -class TESRegionDataGrass : public TESRegionData -{ -public: - virtual ~TESRegionDataGrass(); - - TESRegionGrassObjectList * grassObjectList; // 10 -}; - -// 30 -class TESRegionDataSound : public TESRegionData -{ -public: - virtual ~TESRegionDataSound(); - - BGSMusicType * musicType; // 10 - - struct SoundData - { - BGSSoundDescriptorForm * soundDescriptor; // 00 - UInt32 flags; // 08 - float chance; // 0C - }; - - tArray soundData; // 18 -}; - -// 18 -class TESRegionDataLandscape : public TESRegionData -{ -public: - virtual ~TESRegionDataLandscape(); - - UInt64 unk10; // 10 -}; - -// 18 -class TESRegionDataMap : public TESRegionData -{ -public: - virtual ~TESRegionDataMap(); - - UInt64 unk10; // 10 -}; - -// 20 -class TESRegionDataWeather : public TESRegionData -{ -public: - virtual ~TESRegionDataWeather(); - - struct WeatherData - { - TESWeather * weather; // 00 - UInt32 chance; // 08 - TESGlobal * globalChance; // 10 - }; - - tList weatherData; // 10 -}; diff --git a/source/fs.dll/skse64/skse64/GameForms.cpp b/source/fs.dll/skse64/skse64/GameForms.cpp deleted file mode 100644 index 63a00963..00000000 --- a/source/fs.dll/skse64/skse64/GameForms.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include "GameForms.h" -#include "GameObjects.h" - -RelocAddr <_LookupFormByID> LookupFormByID(0x0019F050); - -BGSDefaultObjectManager *BGSDefaultObjectManager::GetSingleton(void) -{ - // 28B3F9E3FED2F18B102E5B767FD2BE747CAB4002+37 - static RelocPtr g_BGSDefaultObjectManager(0x01F59090); - return g_BGSDefaultObjectManager; -} - -void TESForm::CopyFromEx(TESForm * rhsForm) -{ - if(!rhsForm || rhsForm->formType != formType) - return; - - switch(formType) - { - case kFormType_CombatStyle: - { - TESCombatStyle * lhs = (TESCombatStyle *)this; - TESCombatStyle * rhs = (TESCombatStyle *)rhsForm; - - lhs->general = rhs->general; - lhs->melee = rhs->melee; - lhs->closeRange = rhs->closeRange; - lhs->longRange = rhs->longRange; - lhs->flight = rhs->flight; - lhs->flags = rhs->flags; - } - break; - - // Untested, probably shouldn't use this - case kFormType_Armor: - { - TESObjectARMO * lhs = (TESObjectARMO*)this; - TESObjectARMO * rhs = (TESObjectARMO*)rhsForm; - - lhs->fullName.CopyFromBase(&rhs->fullName); - lhs->race.CopyFromBase(&rhs->race); - lhs->enchantable.CopyFromBase(&rhs->enchantable); - lhs->value.CopyFromBase(&rhs->value); - lhs->weight.CopyFromBase(&rhs->weight); - lhs->destructible.CopyFromBase(&rhs->destructible); - lhs->pickupSounds.CopyFromBase(&rhs->pickupSounds); - lhs->bipedModel.CopyFromBase(&rhs->bipedModel); - lhs->equipType.CopyFromBase(&rhs->equipType); - lhs->bipedObject.CopyFromBase(&rhs->bipedObject); - lhs->blockBash.CopyFromBase(&rhs->blockBash); - lhs->keyword.CopyFromBase(&rhs->keyword); - lhs->description.CopyFromBase(&rhs->description); - - lhs->armorValTimes100 = rhs->armorValTimes100; - lhs->armorAddons.CopyFrom(&rhs->armorAddons); - lhs->templateArmor = rhs->templateArmor; - } - break; - - default: - // unsupported - break; - } -} - -float GetFormWeight(TESForm *form) -{ - // 3894EDBBE3D9FBC367A71D7ABC60B87A407F3E3D+30 - static RelocAddr GetFormWeight_Address(0x001ACF20); - - return ((_GetFormWeight)(GetFormWeight_Address.GetUIntPtr())) (form); -} - -UInt32 BGSListForm::GetSize() -{ - UInt32 totalSize = forms.count; - if(addedForms) { - totalSize += addedForms->count; - } - - return totalSize; -} - -bool BGSListForm::Visit(BGSListForm::Visitor & visitor) -{ - // Base Added Forms - for(UInt32 i = 0; i < forms.count; i++) - { - TESForm* childForm = NULL; - if(forms.GetNthItem(i, childForm)) - { - if(visitor.Accept(childForm)) - return true; - } - } - - // Script Added Forms - if(addedForms) { - for(int i = 0; i < addedForms->count; i++) { - UInt32 formid = 0; - addedForms->GetNthItem(i, formid); - TESForm* childForm = LookupFormByID(formid); - if(visitor.Accept(childForm)) - return true; - } - } - - return false; -} - -bool TESPackage::IsExtraType() -{ - switch(type) - { - case kPackageType_Activate: - case kPackageType_Alarm: - case kPackageType_Flee: - case kPackageType_Trespass: - case kPackageType_Spectator: - case kPackageType_ReactToDead: - case kPackageType_DoNothing: - case kPackageType_InGameDialogue: - case kPackageType_Surface: - case kPackageType_AvoidPlayer: - case kPackageType_ReactToDestroyedObject: - case kPackageType_ReactToGrenadeOrMine: - case kPackageType_StealWarning: - case kPackageType_PickPocketWarning: - case kPackageType_MovementBlocked: - case kPackageType_Unk37: - case kPackageType_Unk38: - return true; - break; - } - - return false; -} diff --git a/source/fs.dll/skse64/skse64/GameForms.h b/source/fs.dll/skse64/skse64/GameForms.h deleted file mode 100644 index cefe9730..00000000 --- a/source/fs.dll/skse64/skse64/GameForms.h +++ /dev/null @@ -1,3484 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" -#include "skse64/GameFormComponents.h" -//#include "skse/GamePathing.h" -//#include "skse/NiInterpolators.h" -#include "skse64/NiObjects.h" -#include "skse64/NiTypes.h" - -class TESForm; -class TESObjectSTAT; -class TESFile; -class TESObjectLIGH; -class TESEffectShader; -class BGSProjectile; -class BGSArtObject; -class BGSImpactDataSet; -class TESSound; -class TESObjectREFR; -class BGSListForm; -class TESQuest; -class BGSExplosion; -class BGSDualCastData; -class TESImageSpaceModifier; -class TESWordOfPower; -class BGSHazard; -class TESNPC; -class TESWorldSpace; -class BSExtraData; -struct ModInfo; - -typedef TESForm* (*_LookupFormByID)(UInt32 id); -extern RelocAddr <_LookupFormByID> LookupFormByID; - -class FormMatcher -{ -public: - virtual bool Matches(TESForm* pForm) const = 0; -}; - - -// TESObject and derivatives are in GameObjects.h -// TESObjectREFR and derivatives are in GameReferences.h -// everything else deriving from TESForm goes here - -/**** form types *************************************************************** - * - * TESHair and BGSCloudClusterForm were removed in 1.2 - * - * 1.1 1.2 se1.4.2 - * id id id code name - * - * 00 00 ?? NONE - * 01 01 ?? TES4 - * 02 02 ?? GRUP - * 03 03 ?? GMST - * 04 04 04 KYWD BGSKeyword - * 05 05 05 LCRT BGSLocationRefType - * 06 06 06 AACT BGSAction - * 07 07 07 TXST BGSTextureSet - * 08 08 08 MICN BGSMenuIcon - * 09 09 09 GLOB TESGlobal - * 0A 0A 0A CLAS TESClass - * 0B 0B 0B FACT TESFaction - * 0C 0C 0C HDPT BGSHeadPart - * 0D xx xx HAIR TESHair - * 0E 0D 0D EYES TESEyes - * 0F 0E 0E RACE TESRace - * 10 0F 0F SOUN TESSound - * 11 10 10 ASPC BGSAcousticSpace - * 12 11 ?? SKIL - * 13 12 12 MGEF EffectSetting - * 14 13 13 SCPT Script - * 15 14 14 LTEX TESLandTexture - * 16 15 15 ENCH EnchantmentItem - * 17 16 16 SPEL SpellItem - * 18 17 17 SCRL ScrollItem - * 19 18 18 ACTI TESObjectACTI - * 1A 19 19 TACT BGSTalkingActivator - * 1B 1A 1A ARMO TESObjectARMO - * 1C 1B 1B BOOK TESObjectBOOK - * 1D 1C 1C CONT TESObjectCONT - * 1E 1D 1D DOOR TESObjectDOOR - * 1F 1E 1E INGR IngredientItem - * 20 1F 1F LIGH TESObjectLIGH - * 21 20 20 MISC TESObjectMISC - * 22 21 21 APPA BGSApparatus - * 23 22 22 STAT TESObjectSTAT - * 24 23 23 SCOL BGSStaticCollection - * 25 24 24 MSTT BGSMovableStatic - * 26 25 25 GRAS TESGrass - * 27 26 26 TREE TESObjectTREE - * 28 xx xx CLDC BGSCloudClusterForm - * 29 27 27 FLOR TESFlora - * 2A 28 28 FURN TESFurniture - * 2B 29 29 WEAP TESObjectWEAP - * 2C 2A 2A AMMO TESAmmo - * 2D 2B 2B NPC_ TESNPC - * 2E 2C 2C LVLN TESLevCharacter - * 2F 2D 2D KEYM TESKey - * 30 2E 2E ALCH AlchemyItem - * 31 2F 2F IDLM BGSIdleMarker / BGSDefaultObjectManager? strange - * 32 30 30 NOTE BGSNote - * 33 31 31 COBJ BGSConstructibleObject - * 34 32 32 PROJ BGSProjectile - * 35 33 33 HAZD BGSHazard - * 36 34 34 SLGM TESSoulGem - * 37 35 35 LVLI TESLevItem - * 38 36 36 WTHR TESWeather - * 39 37 37 CLMT TESClimate - * 3A 38 38 SPGD BGSShaderParticleGeometryData - * 3B 39 39 RFCT BGSReferenceEffect - * 3C 3A 3A REGN TESRegion - * 3D 3B ?? NAVI NavMeshInfoMap - * 3E 3C 3C CELL TESObjectCELL - * 3F 3D 3D REFR TESObjectREFR / Actor - * 40 3E 3E ACHR Character / PlayerCharacter - * 41 3F 3F PMIS MissileProjectile - * 42 40 40 PARW ArrowProjectile - * 43 41 41 PGRE GrenadeProjectile - * 44 42 42 PBEA BeamProjectile - * 45 43 43 PFLA FlameProjectile - * 46 44 44 PCON ConeProjectile - * 47 45 45 PBAR BarrierProjectile - * 48 46 46 PHZD Hazard - * 49 47 47 WRLD TESWorldSpace - * 4A 48 48 LAND TESObjectLAND - * 4B 49 49 NAVM NavMesh - * 4C 4A 4A TLOD ? - * 4D 4B 4B DIAL TESTopic - * 4E 4C 4C INFO TESTopicInfo - * 4F 4D 4D QUST TESQuest - * 50 4E 4E IDLE TESIdleForm - * 51 4F 4F PACK TESPackage - * 52 50 50 CSTY TESCombatStyle - * 53 51 51 LSCR TESLoadScreen - * 54 52 52 LVSP TESLevSpell - * 55 53 53 ANIO TESObjectANIO - * 56 54 54 WATR TESWaterForm - * 57 55 55 EFSH TESEffectShader - * 58 56 56 TOFT ? - * 59 57 57 EXPL BGSExplosion - * 5A 58 58 DEBR BGSDebris - * 5B 59 59 IMGS TESImageSpace - * 5C 5A 5A IMAD TESImageSpaceModifier - * 5D 5B 5B FLST BGSListForm - * 5E 5C 5C PERK BGSPerk - * 5F 5D 5D BPTD BGSBodyPartData - * 60 5E 5E ADDN BGSAddonNode - * 61 5F 5F AVIF ActorValueInfo - * 62 60 60 CAMS BGSCameraShot - * 63 61 61 CPTH BGSCameraPath - * 64 62 62 VTYP BGSVoiceType - * 65 63 63 MATT BGSMaterialType - * 66 64 64 IPCT BGSImpactData - * 67 65 65 IPDS BGSImpactDataSet - * 68 66 66 ARMA TESObjectARMA - * 69 67 67 ECZN BGSEncounterZone - * 6A 68 68 LCTN BGSLocation - * 6B 69 69 MESH BGSMessage - * 6C 6A 6A RGDL BGSRagdoll - * 6D 6B 6B DOBJ ? - * 6E 6C 6C LGTM BGSLightingTemplate - * 6F 6D 6D MUSC BGSMusicType - * 70 6E 6E FSTP BGSFootstep - * 71 6F 6F FSTS BGSFootstepSet - * 72 70 70 SMBN BGSStoryManagerBranchNode - * 73 71 71 SMQN BGSStoryManagerQuestNode - * 74 72 72 SMEN BGSStoryManagerEventNode - * 75 73 73 DLBR BGSDialogueBranch - * 76 74 74 MUST BGSMusicTrackFormWrapper - * 77 75 ?? DLVW ? - * 78 76 76 WOOP TESWordOfPower - * 79 77 77 SHOU TESShout - * 7A 78 78 EQUP BGSEquipSlot - * 7B 79 79 RELA BGSRelationship - * 7C 7A 7A SCEN BGSScene - * 7D 7B 7B ASTP BGSAssociationType - * 7E 7C 7C OTFT BGSOutfit - * 7F 7D 7D ARTO BGSArtObject - * 80 7E 7E MATO BGSMaterialObject - * 81 7F 7F MOVT BGSMovementType - * 82 80 80 SNDR BGSSoundDescriptorForm - * 83 81 81 DUAL BGSDualCastData - * 84 82 82 SNCT BGSSoundCategory - * 85 83 83 SOPM BGSSoundOutput - * 86 84 84 COLL BGSCollisionLayer - * 87 85 85 CLFM BGSColorForm - * 88 86 86 REVB BGSReverbParameters - * 87 87 LENS Unknown87 / BGSLensFlare - * 88 ?? LSPR Unknown88 - * 89 89 VOLI Unknown89 / BGSVolumetricLighting - * 8A Unknown8A - * 8B Alias - * 8C ReferenceAlias - * 8D LocAlias - * 8E ActiveMagicEffect - */ - -enum FormType { - kFormType_None = 0, // NONE - kFormType_TES4, // TES4 - kFormType_Group, // GRUP - kFormType_GMST, // GMST - kFormType_Keyword, // KYWD BGSKeyword - kFormType_LocationRef, // LCRT BGSLocationRefType - kFormType_Action, // AACT BGSAction - kFormType_TextureSet, // TXST BGSTextureSet - kFormType_MenuIcon, // MICN BGSMenuIcon - kFormType_Global, // GLOB TESGlobal - kFormType_Class, // CLAS TESClass - kFormType_Faction, // FACT TESFaction - kFormType_HeadPart, // HDPT BGSHeadPart - kFormType_Eyes, // EYES TESEyes - kFormType_Race, // RACE TESRace - kFormType_Sound, // SOUN TESSound - kFormType_AcousticSpace, // ASPC BGSAcousticSpace - kFormType_Skill, // SKIL - kFormType_EffectSetting, // MGEF EffectSetting - kFormType_Script, // SCPT Script - kFormType_LandTexture, // LTEX TESLandTexture - kFormType_Enchantment, // ENCH EnchantmentItem - kFormType_Spell, // SPEL SpellItem - kFormType_ScrollItem, // SCRL ScrollItem - kFormType_Activator, // ACTI TESObjectACTI - kFormType_TalkingActivator, // TACT BGSTalkingActivator - kFormType_Armor, // ARMO TESObjectARMO - kFormType_Book, // BOOK TESObjectBOOK - kFormType_Container, // CONT TESObjectCONT - kFormType_Door, // DOOR TESObjectDOOR - kFormType_Ingredient, // INGR IngredientItem - kFormType_Light, // LIGH TESObjectLIGH - kFormType_Misc, // MISC TESObjectMISC - kFormType_Apparatus, // APPA BGSApparatus - kFormType_Static, // STAT TESObjectSTAT - kFormType_StaticCollection, // SCOL BGSStaticCollection - kFormType_MovableStatic, // MSTT BGSMovableStatic - kFormType_Grass, // GRAS TESGrass - kFormType_Tree, // TREE TESObjectTREE - kFormType_Flora, // FLOR TESFlora - kFormType_Furniture, // FURN TESFurniture - kFormType_Weapon, // WEAP TESObjectWEAP - kFormType_Ammo, // AMMO TESAmmo - kFormType_NPC, // NPC_ TESNPC - kFormType_LeveledCharacter, // LVLN TESLevCharacter - kFormType_Key, // KEYM TESKey - kFormType_Potion, // ALCH AlchemyItem - kFormType_IdleMarker, // IDLM BGSIdleMarker / BGSDefaultObjectManager? strange - kFormType_Note, // NOTE BGSNote - kFormType_ConstructibleObject, // COBJ BGSConstructibleObject - kFormType_Projectile, // PROJ BGSProjectile - kFormType_Hazard, // HAZD BGSHazard - kFormType_SoulGem, // SLGM TESSoulGem - kFormType_LeveledItem, // LVLI TESLevItem - kFormType_Weather, // WTHR TESWeather - kFormType_Climate, // CLMT TESClimate - kFormType_SPGD, // SPGD BGSShaderParticleGeometryData - kFormType_ReferenceEffect, // RFCT BGSReferenceEffect - kFormType_Region, // REGN TESRegion - kFormType_NAVI, // NAVI NavMeshInfoMap - kFormType_Cell, // CELL TESObjectCELL - kFormType_Reference, // REFR TESObjectREFR / Actor - kFormType_Character, // ACHR Character / PlayerCharacter - kFormType_Missile, // PMIS MissileProjectile - kFormType_Arrow, // PARW ArrowProjectile - kFormType_Grenade, // PGRE GrenadeProjectile - kFormType_BeamProj, // PBEA BeamProjectile - kFormType_FlameProj, // PFLA FlameProjectile - kFormType_ConeProj, // PCON ConeProjectile - kFormType_BarrierProj, // PBAR BarrierProjectile - kFormType_PHZD, // PHZD Hazard - kFormType_WorldSpace, // WRLD TESWorldSpace - kFormType_Land, // LAND TESObjectLAND - kFormType_NAVM, // NAVM NavMesh - kFormType_TLOD, // TLOD ? - kFormType_Topic, // DIAL TESTopic - kFormType_TopicInfo, // INFO TESTopicInfo - kFormType_Quest, // QUST TESQuest - kFormType_Idle, // IDLE TESIdleForm - kFormType_Package, // PACK TESPackage - kFormType_CombatStyle, // CSTY TESCombatStyle - kFormType_LoadScreen, // LSCR TESLoadScreen - kFormType_LeveledSpell, // LVSP TESLevSpell - kFormType_ANIO, // ANIO TESObjectANIO - kFormType_Water, // WATR TESWaterForm - kFormType_EffectShader, // EFSH TESEffectShader - kFormType_TOFT, // TOFT ? - kFormType_Explosion, // EXPL BGSExplosion - kFormType_Debris, // DEBR BGSDebris - kFormType_ImageSpace, // IMGS TESImageSpace - kFormType_ImageSpaceMod, // IMAD TESImageSpaceModifier - kFormType_List, // FLST BGSListForm - kFormType_Perk, // PERK BGSPerk - kFormType_BodyPartData, // BPTD BGSBodyPartData - kFormType_AddonNode, // ADDN BGSAddonNode - kFormType_ActorValueInfo, // AVIF ActorValueInfo - kFormType_CameraShot, // CAMS BGSCameraShot - kFormType_CameraPath, // CPTH BGSCameraPath - kFormType_VoiceType, // VTYP BGSVoiceType - kFormType_MaterialType, // MATT BGSMaterialType - kFormType_ImpactData, // IPCT BGSImpactData - kFormType_ImpactDataSet, // IPDS BGSImpactDataSet - kFormType_ARMA, // ARMA TESObjectARMA - kFormType_EncounterZone, // ECZN BGSEncounterZone - kFormType_Location, // LCTN BGSLocation - kFormType_Message, // MESH BGSMessage - kFormType_Ragdoll, // RGDL BGSRagdoll - kFormType_DOBJ, // DOBJ ? (used for default objects, custom loader) - kFormType_LightingTemplate, // LGTM BGSLightingTemplate - kFormType_MusicType, // MUSC BGSMusicType - kFormType_Footstep, // FSTP BGSFootstep - kFormType_FootstepSet, // FSTS BGSFootstepSet - kFormType_StoryBranchNode, // SMBN BGSStoryManagerBranchNode - kFormType_StoryQuestNode, // SMQN BGSStoryManagerQuestNode - kFormType_StoryEventNode, // SMEN BGSStoryManagerEventNode - kFormType_DialogueBranch, // DLBR BGSDialogueBranch - kFormType_MusicTrack, // MUST BGSMusicTrackFormWrapper - kFormType_DLVW, // DLVW ? - kFormType_WordOfPower, // WOOP TESWordOfPower - kFormType_Shout, // SHOU TESShout - kFormType_EquipSlot, // EQUP BGSEquipSlot - kFormType_Relationship, // RELA BGSRelationship - kFormType_Scene, // SCEN BGSScene - kFormType_AssociationType, // ASTP BGSAssociationType - kFormType_Outfit, // OTFT BGSOutfit - kFormType_Art, // ARTO BGSArtObject - kFormType_Material, // MATO BGSMaterialObject - kFormType_MovementType, // MOVT BGSMovementType - kFormType_SoundDescriptor, // SNDR BGSSoundDescriptorForm - kFormType_DualCastData, // DUAL BGSDualCastData - kFormType_SoundCategory, // SNCT BGSSoundCategory - kFormType_SoundOutput, // SOPM BGSSoundOutput - kFormType_CollisionLayer, // COLL BGSCollisionLayer - kFormType_ColorForm, // CLFM BGSColorForm - kFormType_ReverbParam, // REVB BGSReverbParameters - kFormType_LensFlare, // - kFormType_Unk88, - kFormType_VolumetricLighting, // - kFormType_Unk8A, - kFormType_Alias, // BGSBaseAlias - kFormType_ReferenceAlias, // BGSRefAlias - kFormType_LocationAlias, // BGSLocAlias - kFormType_ActiveMagicEffect, // ActiveMagicEffect - - kFormType_Max = kFormType_VolumetricLighting // max of standard types -}; - -STATIC_ASSERT(kFormType_Weapon == 0x29); -STATIC_ASSERT(kFormType_WordOfPower == 0x76); - -// 20 -class TESForm : public BaseFormComponent -{ -public: - enum { kTypeID = 0 }; // special-case - - enum { - kFlagIsDeleted = 0x20, - kFlagPlayerKnows = 0x40, - kFlagUnk_0x800 = 0x800, - }; - - virtual void Unk_04(void); // reset/init? would leak pointers if called on a live object - virtual void Unk_05(void); // release pointers? - virtual bool LoadForm(UInt32 arg); - virtual bool Unk_07(UInt32 arg); - virtual bool Unk_08(UInt32 arg); // calls LoadForm - virtual TESForm * Unk_09(UInt32 arg1, void * arg2); - virtual bool MarkChanged(UInt32 changed); - virtual void ClearChanged(UInt32 changed); - virtual bool Unk_0C(UInt32 arg); - virtual void Unk_0D(UInt32 arg); - virtual void Unk_0E(UInt32 arg); - virtual void Unk_0F(void * arg); - virtual void Unk_10(UInt32 arg); - virtual void Unk_11(UInt32 arg); - virtual void Unk_12(UInt32 arg); - virtual void InitItem(void); // called once all dependent forms are loaded - virtual ModInfo* GetFinalSourceFile(); - virtual UInt32 GetFormType(void); - virtual void GetFormDesc(char * buf, UInt32 bufLen); - virtual bool GetFlag00000040(void); - virtual bool GetFlag00010000(void); - virtual bool IsPlayable(void); - virtual bool GetFlag00080000(void); - virtual bool GetFlag02000000(void); - virtual bool Unk_1B(void); - virtual bool GetFlag00000200(void); - virtual bool GetFlag00000100(void); - virtual void SetFlag00000200(bool set); - virtual bool Unk_20(void); - virtual void SetFlag00000020(bool set); - virtual void SetFlag00000002(bool set); - virtual void Unk_23(void); - virtual void Unk_24(UInt32 arg); - virtual bool Unk_25(void); - virtual bool Unk_26(void); - virtual bool Has3D(void); - virtual bool Unk_28(void); - virtual UInt32 Unk_29(void); - virtual UInt32 Unk_2A(void); - virtual UInt32 Unk_2B(void); - virtual const char * GetFullName(void); - virtual void CopyFrom(TESForm * srcForm); - virtual bool Compare(TESForm * rhs); - virtual void Unk_2F(void * dst, UInt32 unk); - virtual const char * GetName(void); - virtual bool SetName(const char * str); - virtual bool Unk_32(void); - virtual bool Unk_33(void); - virtual bool Unk_34(UInt32 arg); - virtual bool Unk_35(UInt32 arg0, UInt32 arg1, UInt32 arg2, UInt32 arg3, UInt32 arg4); - virtual void SetFormID(UInt32 id, UInt32 generateID); - virtual const char * Unk_37(void); - virtual bool Unk_38(void); - - bool IsWeapon() { return formType == kFormType_Weapon; } - bool IsAmmo() { return formType == kFormType_Ammo; } - bool IsArmor() { return formType == kFormType_Armor; } - - // bethesda removed most of the functionality from their code, this reimplements it for simple classes - void CopyFromEx(TESForm * rhs); - - void * unk08; // 08 - UInt32 flags; // 10 - UInt32 formID; // 14 - UInt16 unk18; // 18 - UInt8 formType; // 1A - UInt8 pad1B; // 1B - UInt32 pad; // 1C -}; - -typedef float (* _GetFormWeight)(TESForm* form); -float GetFormWeight(TESForm *form); - -// 128 -class ActorValueInfo : public TESForm -{ -public: - enum { kTypeID = kFormType_ActorValueInfo }; - - // parents - TESFullName fullName; // 020 - TESDescription description; // 030 - TESIcon icon; // 040 - - enum { - kSkillUseMult = 0, - kSkillOffsetMult, - kSkillImproveMult, - kSkillImproveOffset - }; - - // members - const char * name; // 050 - second ctor argument - StringCache::Ref unk58; // 058 - UInt32 unk60; // 060 - UInt32 unk64; // 064 - UInt64 unk68; // 068 - UInt32 unk70; // 070 - UInt32 unk74[0x0F]; // 074 - init'd to 0xA4 - UInt32 numSubTypes; // 0B0 - const char * subTypes[0x0A]; // 0B8 - init'd to 0 - float * skillUsages; // 108 - UInt32 unk110; // 110 - init to FFFFFFFF - UInt32 unk118; // 114 - init to FFFFFFFF - BGSSkillPerkTreeNode * perkTree; // 118 - BGSSkillPerkTreeNode - - UInt8 pad120[8]; // 120 - ? not initialized -}; - -// 48 -class BGSAssociationType : public TESForm -{ -public: - enum { kTypeID = kFormType_AssociationType }; - - BSFixedString unk20[4]; // 20 - UInt32 unk40; // 40 -}; - -// 88 -class BGSBodyPartData : public TESForm -{ -public: - enum { kTypeID = kFormType_BodyPartData }; - - // parents - TESModel model; // 20 - BGSPreloadable preloadable; // 48 - - // members - struct Data - { - BSFixedString unk00; // 00 - BSFixedString unk08; // 08 - BSFixedString unk10; // 10 - BSFixedString unk18; // 18 - BSFixedString unk20; // 20 - TESModel model; // 28 - TESModelRDT modelRDT; // 50 - }; - - Data * part[5]; // 50 - init'd to 0 - UInt64 unk78; // 78 - init'd to 0 - UInt64 unk80; // 80 - init'd to 0 -}; - -// 58 -class BGSCameraPath : public TESForm -{ -public: - enum { kTypeID = kFormType_CameraPath }; - - void *unk20; // 20 - UInt64 unk28; // 28 - UInt64 unk30; // 30 - UInt8 unk38; // 38 - UInt8 pad39[7]; // 39 - UInt64 unk40; // 40 - UInt64 unk48; // 48 - UInt64 unk50; // 50 -}; - -// C0 -class BGSCameraShot : public TESForm -{ -public: - enum { kTypeID = kFormType_CameraShot }; - - // parents - TESModel model; // 20 - TESImageSpaceModifiableForm imageSpaceMod; // 48 - - // members - UInt32 unk58; // 58 - init to 2 - UInt32 unk5C; // 5C - init to 2 - UInt32 unk60; // 60 - UInt32 unk64; // 64 - init to 3 - UInt32 unk68; // 68 - UInt32 unk6C; // 6C - float globalTimeMultiplier; // 70 - init to 1.0f - UInt32 unk74; // 74 - UInt32 unk78; // 78 - UInt32 unk7C; // 7C - UInt32 unk80; // 80 - UInt64 unk88; // 88 - UInt64 unk90; // 90 - UInt64 unk98; // 98 - UInt64 unkA0; // A0 - UInt64 unkA8; // A8 - UInt16 unkB0; // B0 - init to FF - UInt8 padB2[6]; // B2 - UInt64 unkB8; // B8 -}; - -// 60 -class BGSCollisionLayer : public TESForm -{ -public: - enum { kTypeID = kFormType_CollisionLayer }; - - enum { - kCollisionLayer_Unidentified = 0x00, - kCollisionLayer_Static, - kCollisionLayer_AnimStatic, - kCollisionLayer_Transparent, - kCollisionLayer_Clutter, - kCollisionLayer_Weapon, - kCollisionLayer_Projectile, - kCollisionLayer_Spell, - kCollisionLayer_Biped, - kCollisionLayer_Trees, - kCollisionLayer_Props, - kCollisionLayer_Water, - kCollisionLayer_Trigger, - kCollisionLayer_Terrain, - kCollisionLayer_Trap, - kCollisionLayer_NonCollidable, - kCollisionLayer_CloudTrap, - kCollisionLayer_Ground, - kCollisionLayer_Portal, - kCollisionLayer_DebrisSmall, - kCollisionLayer_DebrisLarge, - kCollisionLayer_AcousticSpace, - kCollisionLayer_ActorZone, - kCollisionLayer_ProjectileZone, - kCollisionLayer_GasTrap, - kCollisionLayer_Shellcasing, - kCollisionLayer_TransparentSmall, - kCollisionLayer_InvisibleWall, - kCollisionLayer_TransparentSmallAnim, - kCollisionLayer_Ward, - kCollisionLayer_CharController, - kCollisionLayer_StairHelper, - kCollisionLayer_DeadBip, - kCollisionLayer_BipedNoCC, - kCollisionLayer_AvoidBox, - kCollisionLayer_CollisionBox, - kCollisionLayer_CameraSphere, - kCollisionLayer_DoorDetection, - kCollisionLayer_ConeProjectile, - kCollisionLayer_Camera, - kCollisionLayer_ItemPicker, - kCollisionLayer_Los, - kCollisionLayer_PathingPick, - kCollisionLayer_CustomPick1, - kCollisionLayer_CustomPick2, - kCollisionLayer_SpellExplosion, - kCollisionLayer_DroppingPick, - kCollisionLayer_DeadActorZone, - kCollisionLayer_TriggerFallingTrap, - kCollisionLayer_Navcut, - kCollisionLayer_Critter, - kCollisionLayer_SpellTrigger, - kCollisionLayer_LivingAndDeadActors, - kCollisionLayer_Detection, - kCollisionLayer_TrapTrigger - }; - - // parents - TESDescription description; // 20 - - // members - UInt32 layerId; // 30 - init to FFFFFFFF - UInt32 flags; // 34 - UInt32 unk38; // 38 - BSFixedString name; // 40 - tArray interactables; // 48 - really? -}; - -// 38 -class BGSColorForm : public TESForm -{ -public: - enum { kTypeID = kFormType_ColorForm }; - - // parents - TESFullName fullName; // 20 - - union { - struct Color { - UInt8 red, green, blue, alpha; // The alpha isn't actually used here so its usually zero - } color; - UInt32 abgr; // 30 - }; - UInt32 unk34; // 34 -}; - -// 58 -class BGSConstructibleObject : public TESForm -{ -public: - enum { kTypeID = kFormType_ConstructibleObject }; - - // members - TESContainer container; // 20 - not inherited - void* unk20; // 38 - linked list - TESForm* createdObject; // 40 - BGSKeyword* wbKeyword; // 48 - UInt16 quantity; // 50 - UInt8 pad52[6]; // 52 -}; - -// 38 -class BGSDebris : public TESForm -{ -public: - enum { kTypeID = kFormType_Debris }; - - struct Data - { - UInt64 unk0; - UInt64 unk8; - }; - - // parents - BGSPreloadable preloadable; // 20 - - // members - Data unk28; // 28 - linked list -}; - -// ?? - singleton, ID 00000031 -class BGSDefaultObjectManager : public TESForm -{ -public: - enum { kTypeID = kFormType_DOBJ }; - - // cleared to 0 in ctor - TESForm * objects[0x15B]; // 20 - UInt8 pad[0x15B]; // just pad out the rest of the space - - static BGSDefaultObjectManager * GetSingleton(void); -}; - -// 40 -class BGSDialogueBranch : public TESForm -{ -public: - enum { kTypeID = kFormType_DialogueBranch }; - - UInt32 unk20; // 20 - init'd to 1 - TESForm * unk28; // 28 - init'd to 0, TESQuest - TESForm * unk30; // 30 - init'd to 0, starting topic (type 4D) - UInt32 unk38; // 38 - init'd to 0 -}; - -class BGSLocation; - -// 48 -class BGSEncounterZone : public TESForm -{ -public: - enum { kTypeID = kFormType_EncounterZone }; - - TESForm *owner; // 20 - BGSLocation *location; // 28 - - UInt8 rank; // 30 - UInt8 minLevel; // 31 - UInt8 encounterFlags; // 32 - UInt8 maxLevel; // 33 - - UInt64 unk38; // 38 - UInt64 unk40; // 40 -}; - -// 40 -class BGSEquipSlot : public TESForm -{ -public: - enum { kTypeID = kFormType_EquipSlot }; - - tArray parentSlots; // 20 - UInt32 unk38; // 38 -}; - -// 30 -class BGSFootstep : public TESForm -{ -public: - enum { kTypeID = kFormType_Footstep }; - - BSFixedString unk20; // 20 - UInt64 unk28; // 28 -}; - -// 98 -class BGSFootstepSet : public TESForm -{ -public: - enum { kTypeID = kFormType_FootstepSet }; - - UnkArray unk14[5]; // 20 -}; - -// 120 -class BGSHeadPart : public TESForm -{ -public: - enum { kTypeID = kFormType_HeadPart }; - - - // parents - TESFullName fullName; // 020 - TESModelTextureSwap model; // 030 - - // members - UInt8 partFlags; // 068 // Flag Inconsistencies (Is Extra Part?) (Use Solid Tint?) - UInt8 pad69[3]; //069 - enum { - kTypeMisc = 0, - kTypeFace, - kTypeEyes, - kTypeHair, - kTypeFacialHair, - kTypeScar, - kTypeBrows, - kNumTypes - }; - - enum - { - kFlagPlayable = 1 << 0, - kFlagMale = 1 << 1, - kFlagFemale = 1 << 2, - kFlagExtraPart = 1 << 3, - kFlagSolidTint = 1 << 4 - }; - - UInt32 type; // 06C - tArray extraParts; // 070 - BGSTextureSet * textureSet; // 088 - TESModelTri raceMorph; // 090 - This and next two are part of a fixed array of 3, according to ctor - TESModelTri morph; // 0B8 - TESModelTri chargenMorph; // 0E0 - UInt32 unk128; // 108 - BGSListForm * validRaces; // 110 - BSFixedString partName; // 118 - - bool IsExtraPart() { return (partFlags & kFlagExtraPart) == kFlagExtraPart; } -}; - -// B0 -class BGSImpactData : public TESForm -{ -public: - enum { kTypeID = kFormType_ImpactData }; - - // 24 - struct DecalData - { - float minw; // 00 - init'd to 8 - float maxw; // 04 - init'd to 32 - float minh; // 08 - init'd to 8 - float maxh; // 0C - init'd to 32 - float depth; // 10 - init'd to 32 - float shininess; // 14 - init'd to 4 - float parallaxScale; // 18 - init'd to 1 - UInt8 parallaxPasses; // 1C - init'd to 4 - - enum - { - kDecalFlag_Parallax = (1 << 0), - kDecalFlag_AlphaBlending = (1 << 1), - kDecalFlag_AlphaTesting = (1 << 2), - kDecalFlag_NoSubtextures = (1 << 3) - }; - - UInt8 flags; // 1D - init'd to 0 - UInt8 pad1E[2]; // 1E - - UInt32 unk20; // 20 - New in SE . init'd to FFFFFFFF - }; - - // parents - TESModel model; // 20 - - // members - float duration; // 48 - init'd to .25 - - enum - { - kOrientation_SurfaceNormal = 0, - kOrientation_ProjectileNormal = 1, - kOrientation_ProjtectileReflection = 2 - }; - UInt32 orientation; // 4C - init'd to 2 - float angleThreshold; // 50 - init'd to 15 - float placementRadius; // 54 - init'd to 16 - UInt32 soundLevel; // 58 - init'd to 1 - - enum - { - kFlags_NoDecalData = 1 - }; - - UInt8 flags; // 5C - UInt8 impactResult; // 5D - UInt8 pad5E[2]; // 5E - - BGSTextureSet * textures[2]; // 60 - texture set - BGSSoundDescriptorForm * sounds[2]; // 70 - sound - BGSHazard * hazard; // 80 - hazard - - DecalData unk88; // 88 - - UInt32 padAC; // AC -}; - -// 58 -class BGSImpactDataSet : public TESForm -{ -public: - enum { kTypeID = kFormType_ImpactDataSet }; - - BGSPreloadable preloadable; // 20 - - UInt32 unk28; // 28 - UInt32 unk30; // 30 - UInt32 unk34; // 34 - UInt32 unk38; // 38 - UInt32 unk3C; // 3C - void* unk40; // 40 - UInt32 unk48; // 48 - void* unk50; // 50 -}; -STATIC_ASSERT(sizeof(BGSImpactDataSet) == 0x58); - -// 28 -class BGSKeyword : public TESForm -{ -public: - enum { kTypeID = kFormType_Keyword }; - - BSFixedString keyword; // 20 -}; - -// 30 -class BGSAction : public BGSKeyword -{ -public: - enum { kTypeID = kFormType_Action }; - - UInt32 idx; // 28 - ctor sets to a unique value -}; - -// 28 -class BGSLocationRefType : public BGSKeyword -{ -public: - enum { kTypeID = kFormType_LocationRef }; -}; - -// A0 -class BGSLightingTemplate : public TESForm -{ -public: - enum { kTypeID = kFormType_LightingTemplate }; - - // 5C - struct Data - { - // 20 - used elsewhere - struct Color - { - UInt32 x[2]; // 00 - init'd to 00FFFFFF - UInt32 y[2]; - UInt32 z[2]; - UInt32 specular; // 18 - init'd to 0 - float fresnelPower; // 1C - init'd to 1 - }; - - UInt32 unk00; // 00 - init'd to 0 - UInt32 unk04; // 04 - init'd to 0 - UInt32 unk08; // 08 - init'd to 0 - UInt32 unk0C; // 0C - init'd to 0 - UInt32 unk10; // 10 - init'd to 0 - UInt32 unk14; // 14 - init'd to 0 - UInt32 unk18; // 18 - init'd to 0 - float unk1C; // 1C - init'd to 1 - UInt32 unk20; // 20 - init'd to 0 - float unk24; // 24 - init'd to 1 - Color unk28; // 28 - UInt32 unk48; // 48 - init'd to 0 - float unk4C; // 4C - init'd to 1 - float lodStartFade; // 50 - fLightLODStartFade - float lodStopFade; // 54 - fLightLODStartFade + fLightLODRange - UInt32 unk58; // 58 - init'd to 0000079F - }; - - Data unk20; // 20 - UInt32 pad7C; // 7C - Data::Color unk80; // 80 -}; -STATIC_ASSERT(sizeof(BGSLightingTemplate) == 0xA0); - -// 48 -class BGSListForm : public TESForm -{ -public: - enum { kTypeID = kFormType_List }; - - tArray forms; // 20 - tArray * addedForms; // 38 - UInt32 unk40; // 40 - - MEMBER_FN_PREFIX(BGSListForm); - DEFINE_MEMBER_FN(AddFormToList, void, 0x002D81C0, TESForm * form); - DEFINE_MEMBER_FN(RemoveFormFromList, void, 0x002D8390, TESForm * form); - DEFINE_MEMBER_FN(RevertList, void, 0x002D80E0); - - class Visitor - { - public: - virtual bool Accept(TESForm * form) = 0; - }; - - bool Visit(BGSListForm::Visitor & visitor); - UInt32 GetSize(); -}; - -// F0 -class BGSLocation : public TESForm -{ -public: - enum { kTypeID = kFormType_Location }; - - struct UnloadedRefData - { - public: - union CellKey - { - struct XY - { - UInt16 x; - UInt16 y; - } xy; - UInt32 raw; - }; - STATIC_ASSERT(sizeof(CellKey) == 0x4); - - - // members - UInt32 refID; // 0 - UInt32 parentSpaceID; // 4 - CellKey cellKey; // 8 - }; - STATIC_ASSERT(sizeof(UnloadedRefData) == 0xC); - - struct SpecialRefData // LCSR - { - public: - // members - BGSLocationRefType* type; // 00 - UnloadedRefData refData; // 08 - UInt32 pad14; // 14 - }; - STATIC_ASSERT(sizeof(SpecialRefData) == 0x18); - - struct UniqueNPCData // LCUN - { - public: - // members - Actor* actor; // 00 - UInt32 refID; // 08 - UInt32 pad0C; // 0C - BGSLocation* editorLoc; // 10 - }; - STATIC_ASSERT(sizeof(UniqueNPCData) == 0x18); - - struct OverrideData - { - public: - // members - tArray addedData; // 00 - ACPR - tHashSet removedData; // 18 - RCPR - }; - STATIC_ASSERT(sizeof(OverrideData) == 0x48); - - struct ChangeFlags - { - enum ChangeFlag : UInt32 - { - kKeywordData = 1 << 30, - kCleared = (UInt32)1 << 31 - }; - }; - - struct RecordFlags - { - enum RecordFlag : UInt32 - { - kDeleted = 1 << 5, - kIgnored = 1 << 12, - kCleared = (UInt32)1 << 31 - }; - }; - - - struct KEYWORD_DATA - { - public: - // members - BGSKeyword* keyword; // 00 - float data; // 08 - UInt32 pad0C; // 0C - }; - STATIC_ASSERT(sizeof(KEYWORD_DATA) == 0x10); - - // parents - TESFullName fullName; // 20 - BGSKeywordForm keyword; // 30 - - BGSLocation* parentLoc; // 48 - PNAM - TESFaction* unreportedCrimeFaction; // 50 - FNAM - BGSMusicType* musicType; // 58 - NAM1 - UInt32 worldLocMarker; // 60 - MNAM - float worldLocRadius; // 64 - RNAM - UInt32 horseLocMarker; // 68 - NAM0 - UInt32 pad6C; // 6C - tArray specialRefs; // 70 - LCSR - tArray uniqueNPCs; // 88 - LCUN - OverrideData* overrideData; // A0 - NiPointer promoteRefsTask; // A8 - tArray promotedRefs; // B0 - SInt32 loadedCount; // C8 - UInt32 fileOffset; // CC - tArray keywordData; // D0 - UInt32 lastChecked; // E8 - bool cleared; // EC - bool everCleared; // ED - UInt16 padEE; // EE -}; -STATIC_ASSERT(sizeof(BGSLocation) == 0xF0); - -// B8 -class BGSMaterialObject : public TESForm -{ -public: - enum { kTypeID = kFormType_Material }; - - // parents - TESModel model; // 20 - BSMaterialObject materialObject; // 48 - - // members - UnkArray unkA0; // A0 -}; - -// 50 -class BGSMaterialType : public TESForm -{ -public: - enum { kTypeID = kFormType_MaterialType }; - - // C - struct Data20 - { - float unk0; - float unk4; - float unk8; - }; - - TESForm * parentType; // 20 - init'd to 0 - BSFixedString unk28; // 28 - init'd to 0 - UInt32 unk30; // 30 - init'd to 0 - Data20 unk34; // 34 - float unk40; // 40 - init'd to 1 - UInt32 unk44; // 44 - init'd to 0 - TESForm * impactDataSet; // 48 - init'd to 0 -}; - -// 30 -class BGSMenuIcon : public TESForm -{ -public: - enum { kTypeID = kFormType_MenuIcon }; - - // parents - TESIcon icon; // 20 -}; - -// 68 -class BGSMessage : public TESForm -{ -public: - enum { kTypeID = kFormType_Message }; - - // parents - TESFullName fullName; // 20 - TESDescription description; // 30 - - // members - TESForm * icon; // 40 - init'd to 0 - TESQuest * quest; // 48 - init'd to 0 - tList buttons; // 50 - UInt32 unk60; // 60 - init'd to 1 - UInt32 unk64; // 64 - init'd to 2 - - std::string GetDescription() - { - BSString str; - CALL_MEMBER_FN(&description, Get)(&str, this, 'DESC'); - return str.Get(); - }; -}; - -// 60 -class BGSMovementType : public TESForm -{ -public: - enum { kTypeID = kFormType_MovementType }; - - enum { - kType_Walk = 0, - kType_Run, - kType_Max - }; - - enum - { - kDefaultData_Left = 0, - kDefaultData_Right, - kDefaultData_Forward, - kDefaultData_Back, - kDefaultData_RotateInPlace, - kDefaultData_Max - }; - - enum - { - kAnimChangeThresholds_Direction = 0, - kAnimChangeThresholds_MovementSpeed, - kAnimChangeThresholds_RotationSpeed, - kAnimChangeThresholds_Max - }; - - BSFixedString typeId; // 20 - float data[kDefaultData_Max][kType_Max]; // 28 - float rotateWhileMoving; // 50 - float thresholds[kAnimChangeThresholds_Max]; // 54 - read from INAM chunk - init'd to 7F7FFFFF, max float -}; - -// 38 -class BGSMusicTrackFormWrapper : public TESForm -{ -public: - enum { kTypeID = kFormType_MusicTrack }; - - // parents - BSIMusicTrack track; // 20 - - // members - UInt64 unk30; // 30 -}; - -// 78 -class BGSMusicType : public TESForm -{ -public: - enum { kTypeID = kFormType_MusicType }; - - // parents - BSIMusicType type; // 20 - - // members - BSFixedString unk70; // 70 -}; - -// 38 -class BGSOutfit : public TESForm -{ -public: - enum { kTypeID = kFormType_Outfit }; - - tArray armorOrLeveledItemArray; // 20 -}; - -class BGSPerkEntry; - -// 80 -class BGSPerk : public TESForm -{ -public: - enum { kTypeID = kFormType_Perk }; - - // parents - TESFullName fullName; // 20 - TESDescription description; // 30 - TESIcon icon; // 40 - - class PerkRankVisitor - { - public: - virtual ~PerkRankVisitor(); - }; - - // members - UInt8 unk30; // 50 - UInt8 unk31; // 51 - UInt8 unk32; // 52 - init'd to 1 - UInt8 unk33; // 53 - init'd to 1 - UInt8 unk34; // 54 - UInt8 pad55[3]; // 55 - Condition * conditions; // 58 - tArray perkEntries; // 60 - BGSPerk * nextPerk; // 78 -}; - -// 1B8 -class BGSRagdoll : public TESForm -{ -public: - enum { kTypeID = kFormType_Ragdoll }; - - // parents - TESModel model; // 20 - - // members - - // 58 - struct Data58 - { - // 3C - struct Data - { - float unk00; // 00 - init'd to .9 - float unk04; // 04 - init'd to .8 - float unk08; // 08 - init'd to .4 - float unk0C; // 0C - init'd to .2 - float unk10; // 10 - init'd to .1 - float unk14; // 14 - init'd to .3 - float unk18; // 18 - init'd to 0 - float unk1C; // 1C - init'd to 50 - float unk20; // 20 - init'd to 50 - float unk24; // 24 - init'd to 25 - float unk28; // 28 - init'd to 25 - float unk2C; // 2C - init'd to 50 - float unk30; // 30 - init'd to 50 - UInt32 unk34; // 34 - init'd to 10000 - UInt32 unk38; // 38 - init'd to 30000 - }; - - UInt8 unk00; // 00 - UInt8 pad01[3]; // 01 - Data unk04; // 04 - UnkArray unk40; // 40 - }; - - // 50 - struct DataB0 - { - // 1C - struct Data - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - UInt32 unk14; // 14 - UInt32 unk18; // 18 - }; - - UInt8 unk00; // 00 - UInt8 pad01[3]; // 01 - Data unk04; // 04 - UnkArray unk20; // 20 - UnkArray unk38; // 38 - }; - - // 38 - struct Data100 - { - UInt8 unk00; // 00 - UInt8 pad01[7]; // 01 - UnkArray unk08; // 08 - UnkArray unk20; // 20 - }; - - // 30 - struct Data170 - { - // 18 - struct Data - { - UInt16 unk00; // 00 - init'd to FFFF - UInt16 unk02; // 02 - init'd to FFFF - UInt16 unk04; // 04 - init'd to FFFF - UInt8 unk06; // 06 - init'd to 0 - UInt8 pad07; // 07 - UInt32 unk08; // 08 - init'd to 0 - UInt32 unk0C; // 0C - init'd to 0 - float unk10; // 10 - init'd to 0.1 - UInt32 unk14; // 14 - init'd to 0 - }; - - UInt8 unk00; // 00 - UInt8 pad01[7]; // 01 - BSString unk08; // 08 - Data unk18; // 18 - }; - - UInt8 pad48[0x10]; // 48 - - Data58 unk58; // 58 - DataB0 unkB0; // B0 - Data100 unk100; // 100 - Data100 unk138; // 138 - Data170 unk170; // 170 - UInt8 unk1A0[8]; // 1A0 - UInt64 unk1A8; // 1A8 - UInt64 unk1B0; // 1B0 -}; -STATIC_ASSERT(sizeof(BGSRagdoll) == 0x1B8); - -// 38 -class BGSReferenceEffect : public TESForm -{ -public: - enum { kTypeID = kFormType_ReferenceEffect }; - - // C - struct Data - { - UInt64 unk00; - UInt64 unk08; - UInt32 unk10; - }; - - Data unk20; // 20 -}; - -// 40 -class BGSRelationship : public TESForm -{ -public: - enum { kTypeID = kFormType_Relationship }; - - UInt64 unk20; // 20 - UInt64 unk28; // 28 - UInt64 unk30; // 30 - UInt32 unk38; // 38 - init'd to 3 -}; - -// 38 -class BGSReverbParameters : public TESForm -{ -public: - enum { kTypeID = kFormType_ReverbParam }; - - BSIReverbType reverbType; // 20 - - UInt16 unk28; // 28 - init'd to 1250 - UInt16 unk2A; // 2A - init'd to 800 - UInt8 unk2C; // 2C - init'd to 100 - UInt8 unk2D; // 2D - init'd to 100 - UInt8 unk2E; // 2E - init'd to 0 - UInt8 unk2F; // 2F - init'd to 0 - UInt8 unk30; // 30 - init'd to 100 - UInt8 unk31; // 31 - init'd to 0 - UInt8 unk32; // 32 - init'd to 0 - UInt8 unk33; // 33 - init'd to 100 - UInt32 unk34; // 34 - ??? -}; - -// C8 -class BGSScene : public TESForm -{ -public: - enum { kTypeID = kFormType_Scene }; - - UnkArray unk20; // 20 - UnkArray unk38; // 38 - UnkArray unk50; // 50 - UnkArray unk68; // 68 - UnkArray unk80; // 80 - TESForm * quest; // 98 - UInt32 unkA0; // A0 - void * unkA8; // A8 - linked list - UInt8 unkB0; // B0 - UInt8 unkB1; // B1 - UInt8 unkB2; // B2 - UInt8 unkB3; // B3 - UInt8 unkB4; // B4 - UInt8 unkB5; // B5 - UInt8 unkB6; // B6 - UInt8 unkB7; // B7 - UInt8 unkB8; // B8 - UInt8 padB9[3]; // B9 - UInt32 unkBC; // BC - init'd to FFFFFFFF - float unkC0; // C0 - init'd to 7F7FFFFF, max float -}; - -// 48 -class BGSShaderParticleGeometryData : public TESForm -{ -public: - enum { kTypeID = kFormType_SPGD }; - - UnkArray unk20; // 20 - TESTexture texture; // 38 -}; - -// 58 -class BGSSoundCategory : public TESForm -{ -public: - enum { kTypeID = kFormType_SoundCategory }; - - // parents - TESFullName fullName; // 20 - BSISoundCategory soundCategory; // 30 - - // members - UInt32 unk38; // 38 - init'd to 0 - UInt64 unk40; // 40 - init'd to 0 - UInt16 unk48; // 48 - init'd to 0 - UInt16 unk4A; // 4A - init'd to 0 - UInt16 unk4C; // 4C - init'd to FFFF - UInt16 unk4E; // 4E - init'd to FFFF - float unk50; // 50 - init'd to 1 - float unk54; // 54 - init'd to 1 -}; - -// 30 -class BGSSoundDescriptorForm : public TESForm -{ -public: - enum { kTypeID = kFormType_SoundDescriptor }; - - virtual void Unk_39(void); // calls something on unk18 - - // parents - BGSSoundDescriptor soundDescriptor; // 20 - - // members - BGSStandardSoundDef * standardSoundDef; // 28 -}; - -// 40 -class BGSSoundOutput : public TESForm -{ -public: - enum { kTypeID = kFormType_SoundOutput }; - - // parents - BSISoundOutputModel soundOutputModel; // 20 - - // members - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - UInt64 unk30; // 30 - void * unk38; // 38 -}; - -// 28 -class BGSStoryManagerTreeForm : public TESForm -{ -public: - virtual UInt32 Unk_39(void); - virtual UInt32 Unk_3A(UInt32 arg); - virtual void * Unk_3B(void); // pure - virtual void Unk_3C(void); // pure - - UInt32 unk20; // 20 -}; - -class BGSStoryManagerBranchNode; - -// 48 -class BGSStoryManagerNodeBase : public BGSStoryManagerTreeForm -{ -public: - BGSStoryManagerBranchNode * unk28; // 28 - BGSStoryManagerNodeBase * unk30; // 30 - UInt32 unk38; // 38 - UInt32 unk3C; // 3C - void * unk40; // 40 - linked list -}; - -// 60 -class BGSStoryManagerBranchNode : public BGSStoryManagerNodeBase -{ -public: - enum { kTypeID = kFormType_StoryBranchNode }; - - UnkArray unk48; // 48 -}; - -// 68 -class BGSStoryManagerEventNode : public BGSStoryManagerBranchNode -{ -public: - enum { kTypeID = kFormType_StoryEventNode }; - - UInt64 unk60; // 60 -}; - -// E0 -class BGSStoryManagerQuestNode : public BGSStoryManagerNodeBase -{ -public: - enum { kTypeID = kFormType_StoryQuestNode }; - - - UnkArray unk48; // 48 - UInt8 unk60[0x60]; // 60 - UInt32 unkC0; // C0 - UnkArray unkC8; // C8 -}; -STATIC_ASSERT(sizeof(BGSStoryManagerQuestNode) == 0xE0); - -// 28 -class BGSBaseAlias // Not actually a form, but its used like one in Papyrus -{ -public: - virtual ~BGSBaseAlias(); - virtual void Unk01(void); - virtual void Unk02(void); - virtual const char * Unk03(void); - - enum { kTypeID = kFormType_Alias }; - - BSFixedString name; // 08 - TESQuest * owner; // 10 - UInt32 aliasId; // 18 - init'd to FFFFFFFF - UInt32 flags; // 1C - init'd to 0 - UInt16 unk20; // 20 - init'd to 0 -}; - -// 48 -class BGSRefAlias : public BGSBaseAlias -{ -public: - enum { kTypeID = kFormType_ReferenceAlias }; - - // One of these is the filltype/filltype filter - UInt64 unk28[3]; // 28 - void *unk40; // 40 -}; - -// 60 -class BGSLocAlias : public BGSBaseAlias -{ -public: - enum { kTypeID = kFormType_LocationAlias }; - - UInt64 unk28; // 28 - UInt32 unk30; // 30 - UInt64 unk38; // 38 - UInt32 unk40; // 40 - UInt32 unk44; // 44 - UInt64 unk48; // 48 - UInt32 unk50; // 50 - void* unk58; // 58 -}; - -// 268 -class TESQuest : public BGSStoryManagerTreeForm -{ -public: - enum { kTypeID = kFormType_Quest }; - - // parents - TESFullName fullName; // 028 - - // members - - // 30 - struct Data070 - { - UInt8 data[0x30]; // ### todo - }; - - // 30 - struct Data0A0 - { - UInt8 data[0x30]; // ### todo - }; - - // 8 - struct Data0D8 - { - UInt32 unk0; - UInt16 flags; // - init'd to 0x100 - UInt8 priority; - UInt8 type; - }; - - struct Objective - { - StringCache::Ref displayText; // 0 - TESQuest * owner; // 8 - void* unk10; // 10 - UInt32 unk18; //18 - UInt16 index; // 1C - UInt16 unk1E; // 1E - UInt64 unk20; // 20 - }; - - // 10 - struct Data0E8 - { - UInt64 unk0; - UInt64 unk4; - }; - - // 30 - struct Data118 - { - UInt8 data[0x30]; // ### todo - }; - - UnkArray unk038; // 038 - UInt32 unk050; // 050 - tArray aliases; // 058 - Data070 unk070; // 070 - Data0A0 unk0A0; // 0A0 - UInt64 unk0D0; // 0D0 - Data0D8 unk0D8; // 0D8 - UInt32 unk0E0; // 0E0 - init'd to FFFFFFFF - UInt32 pad0E4; // 0E4 - Data0E8 unk0E8; // 0E8 - tList objectives; // 0F8 - void * unk108; // 108 - linked list - void * unk110; // 110 - linked list - Data118 unk118[2]; // 118 - UnkArray unk178[6]; // 178 - UnkArray unk208; // 208 - void * unk220; // 220 - linked list - UInt16 unk228; // 228 - UInt8 unk22A; // 22A - UInt8 pad22B[5]; // 22B - BSString questID; // 230 - UInt64 unk144; // 240 - UInt64 unk148; // 248 - UnkArray unk250; // 250 - - MEMBER_FN_PREFIX(TESQuest); - DEFINE_MEMBER_FN(ForceRefTo, UInt32, 0x0038C240, UInt32 aliasId, TESObjectREFR * reference); - DEFINE_MEMBER_FN(NewGame_Internal, UInt8, 0x00387F50, UInt8 * unk1, UInt8 unk2); - - UInt8 NewGame_Hook(UInt8 * unk1, UInt8 unk2); -}; -STATIC_ASSERT(sizeof(TESQuest) == 0x268); - -// 38 -class BGSVoiceType : public TESForm -{ -public: - enum { kTypeID = kFormType_VoiceType }; - - UInt8 unk14; // 20 - UInt8 pad15[7]; // 21 - BSString editorId; // 28 -}; - -// 198 -class EffectSetting : public TESForm -{ -public: - enum { kTypeID = kFormType_EffectSetting }; - - // parents - TESFullName fullName; // 20 - BGSMenuDisplayObject menuDisplayObject; // 30 - BGSKeywordForm keywordForm; // 40 - - // members - - // F0 - struct Properties - { - enum { - kEffectType_Hostile = 0x00000001, - kEffectType_Recover = 0x00000002, - kEffectType_Detrimental = 0x00000004, - kEffectType_NoHitEvent = 0x00000010, - kEffectType_DispelKeywords = 0x00000100, - kEffectType_NoDuration = 0x00000200, - kEffectType_NoMagnitude = 0x00000400, - kEffectType_NoArea = 0x00000800, - kEffectType_FXPersist = 0x00001000, - kEffectType_GloryVisuals = 0x00004000, - kEffectType_HideInUI = 0x00008000, - kEffectType_NoRecast = 0x00020000, - kEffectType_Magnitude = 0x00200000, - kEffectType_Duration = 0x00400000, - kEffectType_Painless = 0x04000000, - kEffectType_NoHitEffect = 0x08000000, - kEffectType_NoDeathDispel = 0x10000000 - }; - - enum { - kArchetype_ValueMod = 0, - kArchetype_Script, - kArchetype_Dispel, - kArchetype_CureDisease, - kArchetype_Absorb, - kArchetype_DualValueMod, - kArchetype_Calm, - kArchetype_Demoralize, - kArchetype_Frenzy, - kArchetype_Disarm, - kArchetype_CommandSummoned, - kArchetype_Invisibility, - kArchetype_Light, - kArchetype_Lock = 15, - kArchetype_Open, - kArchetype_BoundWeapon, - kArchetype_SummonCreature, - kArchetype_DetectLife, - kArchetype_Telekinesis, - kArchetype_Paralysis, - kArchetype_Reanimate, - kArchetype_SoulTrap, - kArchetype_TurnUndead, - kArchetype_Guide, - kArchetype_WerewolfFeed, - kArchetype_CureParalysis, - kArchetype_CureAddiction, - kArchetype_CurePoison, - kArchetype_Concussion, - kArchetype_ValueAndParts, - kArchetype_AccumulateMagnitude, - kArchetype_Stagger, - kArchetype_PeakValueMod, - kArchetype_Cloak, - kArchetype_Werewolf, - kArchetype_SlowTime, - kArchetype_Rally, - kArchetype_EnhanceWeapon, - kArchetype_SpawnHazard, - kArchetype_Etherealize, - kArchetype_Banish, - kArchetype_Disguise = 44, - kArchetype_GrabActor, - kArchetype_VampireLord - }; - - enum { - kCastingType_ConstantEffect = 0, - kCastingType_FireAndForget, - kCastingType_Concentration - }; - - enum { - kDeliveryType_Self = 0, - kDeliveryType_Contact, - kDeliveryType_Aimed, - kDeliveryType_TargetActor, - kDeliveryType_TargetLocation - }; - - enum { - kVolume_Loud = 0, - kVolume_Normal, - kVolume_Silent, - kVolume_VeryLoud - }; - - UInt32 flags; // 00 - init'd to 0 - float baseCost; // 04 - init'd to 0 - TESForm* primaryObject; // 08 - init'd to 0 - UInt32 school; // 10 - init'd to FFFFFFFF - UInt32 resistance; // 14 - init'd to FFFFFFFF - UInt16 unk18; // 18 - init'd to 0 - UInt8 pad1A[6]; // 1A - TESObjectLIGH* light; // 20 - init'd to 0 - float taperWeight; // 28 - init'd to 0 - TESEffectShader* hitShader; // 30 - init'd to 0 - TESEffectShader* enchantShader; // 38 - init'd to 0 - UInt32 level; // 40 - init'd to 0 - UInt32 area; // 44 - init'd to 0 - float castingTime; // 48 - init'd to 0 - float taperCurve; // 4C - init'd to 0 - float taperDuration; // 50 - init'd to 0 - float secondAVWeight; // 54 - init'd to 0 float - Always 0 - UInt32 archetype; // 58 - init'd to 0 - UInt32 primaryValue; // 5C - init'd to FFFFFFFF - BGSProjectile* projectile; // 60 - init'd to 0 - BGSExplosion* explosion; // 68 - init'd to 0 - UInt32 castType; // 70 - init'd to 3 cast type? - UInt32 deliveryType; // 74 - init'd to 5 cast type? - UInt32 secondaryValue; // 78 - init'd to FFFFFFFF - BGSArtObject* castingArt; // 80 - init'd to 0 - BGSArtObject* hitEffectArt; // 88 - init'd to 0 - BGSImpactDataSet* impactDataSet; // 90 - init'd to 0 - float skillUsageMult; // 98 - init'd to 0 - BGSDualCastData* dualCastData; // A0 - init'd to 0 - float dualCastingScale; // A8 - init'd to 1 - BGSArtObject* enchantArt; // B0 - init'd to 0 - UInt64 unkB8; // B8 - init'd to 0 - UInt64 unkC0; // C0 - init'd to 0 - SpellItem* equipAbility; // C8 - init'd to 0 - TESImageSpaceModifier* imageSpaceMod; // D0 - init'd to 0 - BGSPerk* perk; // D8 - init'd to 0 - UInt32 soundVolume; // E0 - init'd to 1 - float aiScore; // E4 - init'd to 0 - float delayTime; // E8 - init'd to 0 - }; - - struct SoundInfo - { - enum - { - kSound_DrawSheathe = 0, - kSound_Charge, - kSound_Ready, - kSound_Release, - kSound_CastLoop, - kSound_OnHit, - kNumSounds - }; - - UInt32 index; - TESSound* sound; - }; - - UInt64 unk058; // 58 - UInt64 unk060; // 60 - Properties properties; // 68 - tList counterEffects; // 158 - tArray sounds; // 168 - StringCache::Ref description; // 180 - UInt32 unk188; // 188 - UInt32 unk18C; // 18C - void * unk190; // 190 - linked list - - UInt32 school() { return properties.school; } - UInt32 level() { return properties.level; } -}; - -#if 0 -// SE CONVERSION NOT DONE YET -// B4 -class NavMesh : public TESForm -{ -public: - enum { kTypeID = kFormType_NAVM }; - - // parents - TESChildCell childCell; // 14 - BSNavmesh navmesh; // 18 -}; - -//STATIC_ASSERT(sizeof(NavMesh) == 0xB4); - -// SE CONVERSION NOT DONE YET -// 98 -class NavMeshInfoMap : public TESForm -{ -public: - enum { kTypeID = kFormType_NAVI }; - - // parents - BSNavmeshInfoMap infoMap; // 14 - PrecomputedNavmeshInfoPathMap pathMap; // 1C - - // members - - // 20 - struct Data4C - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - 0 - UInt32 unk0C; // 0C - 0 - void * unk10; // 10 - ptr to 0xDEADBEEF - UInt32 unk14; // 14 - 0 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - 0 - }; - - // 20 - struct Data6C - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - 0 - UInt32 unk0C; // 0C - 0 - UInt32 unk10; // 10 - 0 - void * unk14; // 14 - ptr to 0xDEADBEEF - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - }; - - // 8 - struct Data8C - { - UInt32 unk0; - UInt32 unk4; - }; - - UInt8 unk48; // 48 - UInt8 pad49[3]; // 49 - Data4C unk4C; // 4C - Data6C unk6C; // 6C - Data8C unk8C; // 8C - UInt8 unk94; // 94 - UInt8 pad95[3]; // 95 -}; - -//STATIC_ASSERT(sizeof(NavMeshInfoMap) == 0x98); -#endif - -// 80 -class Script : public TESForm -{ -public: - enum { kTypeID = kFormType_Script }; - - // 14 - struct Data - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - numRefs? - UInt32 unk08; // 08 - dataLength? - UInt32 unk0C; // 0C - varCount? - UInt32 unk10; // 10 - type? - }; - - // 10 - struct RefListEntry - { - void * data; - RefListEntry * next; - }; - - // 10 - struct VarInfoEntry - { - void * data; - VarInfoEntry * next; - }; - - Data unk20; // 20 - UInt32 pad34; // 34 - void * unk38; // 38 - void * unk40; // 40 - UInt32 unk30; // 48 - float questDelayTimer; // 4C - float secondsPassed; // 50 - TESForm * parentQuest; // 58 - RefListEntry refList; // 60 - VarInfoEntry varList; // 70 -}; - -// 78 -class TESClass : public TESForm -{ -public: - enum { kTypeID = kFormType_Class }; - - // parents - TESFullName fullName; // 14-20 - TESDescription description; // 1C-30 - TESTexture texture; // 28-40 - - // members - - // 24 - struct Data50 - { - UInt8 unk00[0x4]; // 00 - UInt8 trainSkill; // 04 (AV-6) - UInt8 maxTrainingLevel; // 05 - UInt8 oneHanded; // 06 - UInt8 twoHanded; // 07 - UInt8 archery; - UInt8 block; - UInt8 smithing; - UInt8 heavyArmor; - UInt8 lightArmor; - UInt8 pickPocket; - UInt8 lockpicking; - UInt8 sneak; - UInt8 alchemy; - UInt8 speech; - UInt8 alteration; - UInt8 conjuration; - UInt8 destruction; - UInt8 illusion; - UInt8 restoration; - UInt8 enchanting; - float bleedout; // 18 - UInt32 voicePoints; // 1C - UInt8 health; // 20 - UInt8 magicka; // 21 - UInt8 stamina; // 22 - UInt8 unk23; // 23 - }; - - Data50 unk50; // 50 - UInt32 pad74; // 74 -}; -STATIC_ASSERT(sizeof(TESClass) == 0x78); - -// 80 -class TESClimate : public TESForm -{ -public: - enum { kTypeID = kFormType_Climate }; - - // 10 - struct Data48 - { - UInt64 unk0; - UInt64 unk4; - }; - - TESModel model; // 20 - Data48 unk48; // 48 - TESTexture textures[2]; // 58 - UInt8 unk78[6]; // 78 - UInt8 pad7E[2]; // 7E -}; - -// A0 -class TESCombatStyle : public TESForm -{ -public: - enum { kTypeID = kFormType_CombatStyle }; - - // 28 - struct General // CSGD - { - float offensiveMult; // 00 - init'd to 0.5 - float defensiveMult; // 04 - init'd to 0.5 - float groupOffensiveMult; // 08 - init'd to 1 - float meleeMult; // 0C - init'd to 1 - float magicMult; // 10 - init'd to 1 - float rangedMult; // 14 - init'd to 1 - float shoutMult; // 18 - init'd to 1 - float unarmedMult; // 1C - init'd to 1 - float staffMult; // 20 - init'd to 1 - float avoidThreatChance; // 24 - init'd to 0.2 - }; - - // 20 - struct Melee // CSME - { - float attackStaggeredMult; // 00 - init'd to 1 - float powerAttackStaggeredMult; // 04 - init'd to 1 - float powerAttackBlockingMult; // 08 - init'd to 1 - float bashMult; // 0C - init'd to 1 - float bashRecoiledMult; // 10 - init'd to 1 - float bashAttackMult; // 14 - init'd to 1 - float bashPowerAttackMult; // 18 - init'd to 1 - float specialAttackMult; // 1C - init'd to 0.1 - }; - - // 10 - struct CloseRange // CSCR - { - float duelingCircleMult; // 00 - init'd to 0.2 - float duelingFallbackMult; // 04 - init'd to 0.2 - float flankingFlankDistance; // 08 - init'd to 0.2 - float flankingStalkTime; // 0C - init'd to 0.2 - }; - - // 4 - struct LongRange // CSLR - { - float strafeMult; // 00 - init'd to 0.2 - }; - - // 20 - struct Flight // CSFL - { - float hoverChance; // 00 - init'd to 0.5 - float diveBombChance; // 04 - init'd to 1 - float groundAttackChance; // 08 - init'd to 0.5 - float hoverTime; // 0C - init'd to 0.5 - float unk10; // 10 - init'd to 0.5 - float perchAttackChance; // 14 - init'd to 0.5 - float unk18; // 18 - init'd to 0.5 - float flyingAttackChance; // 1C - init'd to 0.75 - }; - - enum { - kFlag_Dueling = 1, - kFlag_Flanking = 2, - kFlag_AllowDualWielding = 4 - }; - - General general; // 20 - CSGD - Melee melee; // 48 - CSME - CloseRange closeRange; // 68 - CSCR - LongRange longRange; // 78 - CSLR - Flight flight; // 7C - CSFL - UInt8 flags; // 9C - DATA - UInt8 pad9D[3]; // 9D -}; - -// 220 -class TESEffectShader : public TESForm -{ -public: - enum { kTypeID = kFormType_EffectShader }; - - // 1A0 - struct Data - { - UInt8 pad[0x1A0]; // ### - }; - - Data unk020; // 020 - TESTexture unk1C0; // 1C0 - TESTexture unk1D0; // 1D0 - TESTexture unk1E0; // 1E0 - TESTexture unk1F0; // 1F0 - TESTexture unk200; // 200 - UInt64 unk210; // 210 BSIntrusiveRefCounted * - UInt64 unk218; // 218 BSIntrusiveRefCounted * -}; - -// 48 -class TESEyes : public TESForm -{ -public: - enum { kTypeID = kFormType_Eyes }; - - // parents - TESFullName fullName; // 20 - TESTexture texture; // 30 - - // members - UInt8 unk40; // 40 - UInt8 pad41[7]; // 41 -}; - -// 100 -class TESFaction : public TESForm -{ -public: - enum { kTypeID = kFormType_Faction }; - - // parents - TESFullName fullName; // 20 - TESReactionForm reaction; // 30 - - // members - - // 48 - struct CrimeValues - { - UInt64 unk00; // 00 - UInt64 unk08; // 08 - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt64 unk20; // 20 - UInt64 unk28; // 28 - bool arrest; // 30 - bool attackOnSight; // 31 - UInt16 murder; // 32 - UInt16 assault; // 34 - UInt16 trespass; // 36 - UInt16 pickpocket; // 38 - float stealMult; // 3C - UInt16 escape; // 40 - UInt16 werewolf; // 42 - UInt32 pad44; // 44 - }; - - // 38 - struct VendorData - { - UInt16 startHour; // 00 - UInt16 endHour; // 02 - UInt32 radius; // 04 - UInt8 onlyBuysStolenItems; // 08 - UInt8 notSellBuy; // 09 - UInt8 pad0A[6]; // 0A - void * packageLocation; // 10 - UInt32 unk18; // 18 - BGSListForm * buySellList; // 20 - TESObjectREFR * merchantContainer; // 28 - UInt32 unk30; // 30 - init'd to FFFFFFFF - UInt32 pad34; // 34 - }; - - // 10 - struct DataE0 - { - UInt64 unk0; // 0 - UInt64 unk8; // 8 - }; - - UInt64 unk50; // 50 - - enum - { - kFactionFlag_HiddenFromNPC = (1 << 0), - kFactionFlag_SpecialCombat = (1 << 1), - kFactionFlag_TrackCrime = (1 << 4), - kFactionFlag_IgnoreMurder = (1 << 5), - kFactionFlag_IgnoreAssult = (1 << 6), - kFactionFlag_IngoreStealing = (1 << 7), - kFactionFlag_IgnoreTrespass = (1 << 8), - kFactionFlag_NoReportCrime = (1 << 9), - kFactionFlag_CrimeGoldDefaults = (1 << 10), - kFactionFlag_IgnorePickpocket = (1 << 11), - kFactionFlag_Vendor = (1 << 12), - kFactionFlag_CanBeOwner = (1 << 13), - kFactionFlag_IgnoreWerewolf = (1 << 14) - }; - - UInt32 factionFlags; // 58 - UInt32 pad5C; // 5C - CrimeValues crimeValues; // 60 - VendorData vendorData; // A8 - DataE0 unkE0; // E0 - UInt32 unkF0; // F0 - UInt32 unkF4; // F4 - float unkF8; // F8 - UInt32 unkFC; // FC -}; -STATIC_ASSERT(sizeof(TESFaction) == 0x100); -STATIC_ASSERT(offsetof(TESFaction, vendorData) == 0xA8); - -// 38 -class TESGlobal : public TESForm -{ -public: - enum { kTypeID = kFormType_Global }; - - BSString unk20; // 20 - UInt8 unk1C; // 30 - type? - init'd to 115 - UInt8 pad[3]; // 31 - UInt32 unk34; // 34 -}; - -// This was removed at some point in Skyrim32, it doesn't exist in SE either, commenting this -/* -// 50 -class TESHair : public TESForm -{ -public: - // parents - TESFullName fullName; // 14 - TESModel model; // 1C - TESTexture texture; // 30 - - // members - UInt8 unk38; // 38 - UInt8 pad39[3]; // 39 - TESModel unk40; // 3C -};*/ - -// 68 -class TESIdleForm : public TESForm -{ -public: - enum { kTypeID = kFormType_Idle }; - - void * unk20; // 20 - linked list - UInt8 loopMin; // 28 - UInt8 loopMax; // 29 - UInt8 flags; // 2A - UInt8 group; // 2B - UInt16 unk1C; // 2C - UInt8 pad1E[2]; // 2E - UInt64 unk30; // 30 - NiFormArray - TESIdleForm * relatedIdle1; // 38 - TESIdleForm * relatedIdle2; // 40 - StringCache::Ref fileName; // 48 - StringCache::Ref animationEvent; // 50 - BSString editorId; // 58 -}; - -// 70 -class TESImageSpace : public TESForm -{ -public: - enum { kTypeID = kFormType_ImageSpace }; - - // 50 - struct Data20 - { - float unk00; // 00 - init'd to 3 - float unk04; // 04 - init'd to 7 - float unk08; // 08 - init'd to .6 - float unk0C; // 0C - init'd to .5 - float unk10; // 10 - init'd to .15 - float unk14; // 14 - init'd to .15 - float unk18; // 18 - init'd to 1.8 - float unk1C; // 1C - init'd to 1.5 - float unk20; // 20 - init'd to 3.5, 3 - float unk24; // 24 - init'd to 1.8, .8 - float unk28; // 28 - init'd to 1.5 - float unk2C; // 2C - init'd to 1.1 - float unk30; // 30 - init'd to 0 - float unk34; // 34 - init'd to 0 - float unk38; // 38 - init'd to 0 - float unk3C; // 3C - init'd to 0 - float unk40; // 40 - init'd to 0 - UInt32 unk44; // 44 - init'd to 0 - UInt32 unk48; // 48 - init'd to 0 - float unk4C; // 4C - init'd to 2 - }; - - Data20 unk20; // 20 -}; - -// TODO: replace with NiFloatInterpolator when definition available -// 2E0 -class TESImageSpaceModifier : public TESForm -{ -public: - enum { kTypeID = kFormType_ImageSpaceMod }; - - // F4 - struct Data020 - { - // 8 - struct Data0CC - { - float unk0; - float unk4; - }; - - UInt8 unk000; // 000 - UInt8 pad001[3]; // 001 - float unk004; // 004 - // 008 - - UInt8 todo008[0xC8 - 0x08]; // 008 - - UInt8 unk0C8; // 0C8 - UInt8 unk0C9[3]; // 0C9 - Data0CC unk0CC; // 0CC - // 0D4 - - UInt8 todo0D4[0xE0 - 0xD4]; // 0D4 - - UInt8 unk0E0; // 0E0 - UInt8 unk0E1; // 0E1 - UInt8 pad0E2[2]; // 0E2 - // 0E4 - - UInt8 todo0E4[0xF4 - 0xE4]; // 0E4 - }; - - Data020 unk020; // 020 - UInt32 pad114; // 114 - void* unk118[0x15 * 2]; // 118 - UInt64 unk268[14]; // 268 - UInt16 unk2D8; // 2D8 - UInt16 unk2DA; // 2DA - UInt32 pad2DC; // 2DC -}; -STATIC_ASSERT(sizeof(TESImageSpaceModifier::Data020) == 0xF4); -STATIC_ASSERT(offsetof(TESImageSpaceModifier, pad114) == 0x114); -STATIC_ASSERT(sizeof(TESImageSpaceModifier) == 0x2E0); - - -// 50 -class TESLandTexture : public TESForm -{ -public: - enum { kTypeID = kFormType_LandTexture }; - - // 10 - struct Data40 - { - UInt64 unk0; // 0 - UInt64 unk4; // 8 - }; - - UInt64 unk20; // 20 - UInt8 unk28; // 28 - init'd to 30 - UInt8 unk29; // 29 - init'd to 30 - UInt8 pad2A[6]; // 2A - UInt64 unk30; // 30 - UInt8 unk38; // 38 - init'd to 30 - UInt8 pad39[3]; // 39 - UInt32 unk3C; // 3C - Data40 unk40; // 40 -}; - -// 38 -class TESLoadScreen : public TESForm -{ -public: - enum { kTypeID = kFormType_LoadScreen }; - - void * unk20; // 20 - linked list - TESObjectSTAT * object; // 28 - BSFixedString unk30; // 30 -}; - -// 68 -class TESObjectANIO : public TESForm -{ -public: - enum { kTypeID = kFormType_ANIO }; - - TESModelTextureSwap textureSwap; // 20 - BSFixedString unk58; // 58 - BSFixedString unk60; // 60 -}; - -// 140 -class TESObjectCELL : public TESForm -{ -public: - enum { kTypeID = kFormType_Cell }; - - // parents - TESFullName fullName; // 020 - - // members - - // 8 - struct Data - { - UInt32 unk0; - UInt32 unk4; - }; - - // 18 - struct Data048 - { - BSExtraData * extraData;; // 00 - void* unk00; // 08 - UInt32 unk10; // 10 - UInt32 unk14; // 14 - }; - - struct TVDT - { - struct TVDT1 - { - UInt32 * unk00; // array? - UInt32 * unk08; // array? - UInt32 unk10; // size? - }; - - struct TVDT0 - { - TVDT1 * unk00; - UInt64 unk08; - UInt32 unk10; // skip TVDT1 if > 1 - }; - - UInt32 unk00; - UInt32 unk04; - UInt32 unk08; - TVDT0 * unk10; - // ... - }; - - // 28 - struct ReferenceData - { - // 10 - struct Reference - { - TESObjectREFR *ref; // 0 - only valid if unk08 is NOT NULL, ignore value otherwise - void *unk08; // 8 - }; - - UInt32 unk00; // 0 - UInt32 maxSize; // 4 - UInt32 freeEntries; // 8 - maxSize - freeEntries = num valid entries (where Reference.unk08 is not NULL) - UInt32 unk0C; // 0C - void *unk10; // 10 - Reference.unk08 is usually inititalized to this, but it is not always this - void *unk18; // 18 - Reference* refArray; // 20 - }; - - - Data unk030; // 030 - Data unk038; // 038 - UInt16 unk040; // 040 1 - no 060 - UInt16 unk042; // 042 - UInt8 unk044; // 044 - UInt8 unk045; // 045 - UInt8 unk046; // 046 - UInt8 pad047; // 047 - - // ExtraEditorID - // ExtraCellImageSpace - // ExtraCellMusicType - // ExtraLocation - // ExtraEncounterZone - // ExtraCellAcousticSpace - // ExtraSeenData - // ExtraHavok - Data048 unk048; // 048 - TVDT * * unk060; // 060 - void * unk068; // 068 - float waterLevel; // 070 - init'd to 7F7FFFFFh, max float - void * unk078; // 078 - - void * unk080; // 080 - ReferenceData refData; // 088 - New in SE - TESForm * unk0B0; // 0B0 - REFR owner of cell? - - tArray objectList; // 0B8 - SE: not always valid - UnkArray unk0D0; // 0D0 - UnkArray unk0F8; // 0F8 - UnkArray unk100; // 100 - Data unk118; // 118 - TESWorldSpace * worldSpace; // 120 - UInt64 unk128; // 128 - BGSLightingTemplate * lightingTemplate; // 130 - UInt64 unk138; // 138 - - MEMBER_FN_PREFIX(TESObjectCELL); - DEFINE_MEMBER_FN(GetNorthRotation, float, 0x00280DB0); -}; -STATIC_ASSERT(offsetof(TESObjectCELL, refData) == 0x88); -STATIC_ASSERT(offsetof(TESObjectCELL, objectList) == 0xB8); -STATIC_ASSERT(sizeof(TESObjectCELL) == 0x140); - -// 48 -class TESObjectLAND : public TESForm -{ -public: - enum { kTypeID = kFormType_Land }; - - // parents - TESChildCell childCell; // 20 - - // members - UInt32 unk28; // 28 - UInt64 unk30; // 30 - UInt64 unk38; // 38 - UInt64 unk40; // 40 -}; - -// E0 -class TESPackage : public TESForm -{ -public: - enum { kTypeID = kFormType_Package }; - - virtual bool Unk_39(UInt32 arg0, UInt32 arg1, UInt32 arg2, UInt32 arg3); - virtual bool Unk_3A(UInt32 arg0, UInt32 arg1, UInt32 arg2, UInt32 arg3, UInt32 arg4); - virtual bool Unk_3B(UInt32 arg0, UInt32 arg1); - virtual bool Unk_3C(UInt32 arg0, UInt32 arg1); - virtual bool Unk_3D(UInt32 arg0); - - enum - { - kPackageType_Find = 0, - kPackageType_Follow, - kPackageType_Escort, - kPackageType_Eat, - kPackageType_Sleep, - kPackageType_Wander, - kPackageType_Travel, - kPackageType_Accompany, - kPackageType_UseItemAt, - kPackageType_Ambush, - kPackageType_FleeNotCombat, - kPackageType_CastMagic, - kPackageType_Sandbox, - kPackageType_Patrol, - kPackageType_Guard, - kPackageType_Dialogue, - kPackageType_UseWeapon, - kPackageType_Find2, - kPackageType_Package, - kPackageType_PackageTemplate, - kPackageType_Activate, - kPackageType_Alarm, - kPackageType_Flee, - kPackageType_Trespass, - kPackageType_Spectator, - kPackageType_ReactToDead, - kPackageType_GetUpFromChair, - kPackageType_DoNothing, - kPackageType_InGameDialogue, - kPackageType_Surface, - kPackageType_SearchForAttacker, - kPackageType_AvoidPlayer, - kPackageType_ReactToDestroyedObject, - kPackageType_ReactToGrenadeOrMine, - kPackageType_StealWarning, - kPackageType_PickPocketWarning, - kPackageType_MovementBlocked, - kPackageType_Unk37, - kPackageType_Unk38 - }; - - // C - struct Data50 - { - UInt8 unk00; // 0 - init'd to FF - UInt8 unk01; // 1 - init'd to FF - UInt8 unk02; // 2 - init'd to FF - UInt8 unk03; // 3 - init'd to FF - UInt8 unk04; // 4 - init'd to FF - UInt8 pad05[3]; // 5 - UInt32 unk08; // 8 - init'd to 0 - }; - - // 20 - struct Data - { - UInt64 unk00; // 00 - UInt32 unk08; // 08 - UInt32 pad0C; // 0C - UInt32 unk10; // 10 - UInt64 unk18; // 18 - }; - - UInt32 packageFlags; // 20 - UInt8 type; // 24 - see kPackageType_ enum - UInt8 unk25; // 25 - UInt8 unk26; // 26 - UInt8 pad27; // 27 - UInt16 unk28; // 28 - UInt16 unk2A; // 2A - UInt64 unk30; // 30 - UInt64 unk38; // 38 - UInt64 unk40; // 40 - UInt64 unk48; // 48 - Data50 unk50; // 50 - UInt32 pad5C; // 5C - void * unk60; // 60 - linked list - UInt64 unk68; // 68 - UInt64 unk70; // 70 - Data unk78; // 78 - Data unk98; // 98 - Data unkB8; // B8 - UInt32 unkD8; // D8 - UInt32 unkDC; // DC - incremented in dtor - - bool IsExtraType(); -}; - -// F8 -class AlarmPackage : public TESPackage -{ -public: - - UInt64 unkE0; // E0 - UInt64 unkE8; // E8 - UInt8 unkF0; // F0 - UInt8 padF1[7]; // F1 -}; - -// 100 -class DialoguePackage : public TESPackage -{ -public: - UInt32 unkE0; // E0 - UInt32 unkE4; // E4 - UInt32 unkE8; // E8 - UInt32 unkEC; // EC - UInt8 unkF0; // F0 - UInt8 unkF1; // F1 - UInt8 padF2[2]; // F2 - UInt32 unkF4; // F4 - UInt32 unkF8; // F8 - UInt8 unkFC; // FC - UInt8 padFD[3]; // FD -}; - -// 118 -class FleePackage : public TESPackage -{ -public: - struct DataF8 - { - UInt32 unk0; // 0 - UInt32 unk4; // 4 - UInt32 unk8; // 8 - }; - - UnkArray unk0E0; // 0E0 - DataF8 unk0F8; // 0F8 - float unk104; // 104 - init'd to -1 - UInt32 unk108; // 108 - UInt32 unk10C; // 10C - UInt8 unk110; // 110 - UInt8 unk111; // 111 - init'd to 1 - UInt8 unk112; // 112 - UInt8 unk113; // 113 - UInt8 unk114; // 114 - UInt8 pad115[3]; // 115 -}; - -// 120 -class SpectatorPackage : public TESPackage -{ -public: - struct Data0F4 - { - UInt32 unk0; // 0 - UInt32 unk4; // 4 - UInt32 unk8; // 8 - }; - - UInt32 unk0E0; // 0E0 - UInt32 pad0E4; // 0E4 - not init'd - UInt32 unk0E8; // 0E8 - UInt32 unk0EC; // 0EC - UInt8 unk0F0; // 0F0 - UInt8 pad0F1[3]; // 0F1 - Data0F4 unk94; // 0F4 - UnkArray unk100; // 100 - UInt64 pad118; // 118 - not init'd -}; - -// 100 -class TrespassPackage : public TESPackage -{ -public: - // Warning: either unkE0 or unkE8 is a UInt64, but not both, but it hasn't been confirmed yet which one. - UInt32 unkE0; // E0 - UInt32 unkE4; // E4 - UInt64 unkE8; // E8 - UInt32 unkF0; // F0 - init'd to -1 - UInt32 unkF4; // F4 - init'd to 3 - UInt32 unkF8; // F8 -}; - -// 4B8 -class TESRace : public TESForm -{ -public: - enum { kTypeID = kFormType_Race }; - - enum { - kRace_Playable = 0x00000001, - kRace_FaceGenHead = 0x00000002, - kRace_Child = 0x00000004, - kRace_TiltFrontBack = 0x00000008, - kRace_TiltLeftRight = 0x00000010, - kRace_NoShadow = 0x00000020, - kRace_Swims = 0x00000040, - kRace_Flies = 0x00000080, - kRace_Walks = 0x00000100, - kRace_Immobile = 0x00000200, - kRace_NotPushable = 0x00000400, - kRace_NoCombatInWater = 0x00000800, - kRace_NoRotatingToHeadTrack = 0x00001000, - kRace_UseHeadTrackAnim = 0x00008000, - kRace_SpellsAlignWithMagicNode = 0x00010000, - kRace_UseWorldRaycasts = 0x00020000, - kRace_AllowRagdollCollision = 0x00040000, - kRace_CantOpenDoors = 0x00100000, - kRace_AllowPCDialogue = 0x00200000, - kRace_NoKnockdowns = 0x00400000, - kRace_AllowPickpocket = 0x00800000, - kRace_AlwaysUseProxyController = 0x01000000, - kRace_OverlayHeadParts = 0x04000000, - kRace_OverrideHeadParts = 0x08000000, - kRace_AllowMultipleMembraneShaders = 0x20000000, - kRace_CanDualWield = 0x40000000, - kRace_AvoidsRoads = 0x80000000, - }; - - // parents - TESFullName fullName; // 020 - TESDescription description; // 030 - TESSpellList spellList; // 040 - BGSSkinForm skin; // 050 - BGSBipedObjectForm biped; // 060 - BGSKeywordForm keyword; // 070 - BGSAttackDataForm attackData; // 088 - - // members - - enum { - kRace_NumSkillBonuses = 7 - }; - - // AC - struct Data - { - struct SkillBonus - { - UInt8 skill; - UInt8 bonus; - }; - SkillBonus skillBonus[kRace_NumSkillBonuses]; - UInt8 pad0E[2]; // 0E - float height[2]; // 10 - float weight[2]; // 18 - UInt32 raceFlags; // 20 - not init'd - float health; // 24 - float magicka; // 28 - float stamina; // 2C - float carryweight; // 30 - float mass; // 34 - float accelRate; // 38 - float deaccelRate; // 3C - UInt32 unk40; // 40 - init'd to 1 - Flags? - UInt32 unk44; // 44 - init'd to FFFFFFFF - UInt32 unk48; // 48 - init'd to FFFFFFFF - Flags? - UInt32 unk4C; // 4C - not init'd - float injuredHealthPct; // 50 - init'd to FFFFFFFF - float healthRegen; // 54 - float manaRegen; // 58 - float staminaRegen; // 5C - float unarmedDamage; // 60 - float handReach; // 64 - UInt32 unk68; // 68 - init'd to FFFFFFFF - Flags? - float aimAngleTolerance; // 6C - UInt32 unk70; // 70 - init'd to 0 - float angleAcceleration; // 74 - float angleTolerance; // 78 - UInt32 unk7C; // 7C - UInt32 unk80; // 80 - UInt32 unk84; // 84 - float unk88; // 88 - float unk8C; // 8C - float unk90; // 90 - float unk94; // 94 - float unk98; // 98 - float unk9C; // 9C - float unkA0; // A0 - float unkA4; // A4 - float unkA8; // A8 - }; - - TESModel models[2]; // 098 - Data data; // 0E8 - BGSTextureModel textureModel[2]; // 198 - BGSBehaviorGraphModel behaviorGraph[2]; // 1E8 - StringCache::Ref behaviorPath[2]; // 238 - StringCache::Ref behaviorName[2]; // 248 - BGSVoiceType * voiceTypes[2]; // 258 - BGSBodyPartData * bodyPartData; // 268 - TESForm * decapitateArmor[2]; // 270 - UnkArray unk280[2]; // 280 - void * unk2B0[4]; // 2B0 - void * unk2D0[2]; // 2D0 AttackAnimationArrayMap - StringCache::Ref editorId; // 2E0 - BGSMaterialType * impactMaterial; // 2E8 - BGSImpactDataSet * meleeImpact; // 2F0 - BGSArtObject * decapitateBloodArt; // 2F8 - BGSSoundDescriptorForm * openCorpseSound; // 300 - BGSSoundDescriptorForm * closeCorpseSound; // 308 - StringCache::Ref bipedObjectNames[0x20]; // 310 - tArray slotRestrictions; // 410 - UInt32 unk428; // 428 - BGSEquipSlot * unarmedEquipSlot; // 430 - TESRace * morphRace; // 438 - TESRace * armorRace; // 440 - UnkArray unk448; // 448 - UnkArray unk460; // 460 - UInt8 unk478[0x30]; // 478 - - // C8 - struct CharGenData - { - struct TintOption - { - UInt32 unk00; // 00 - TESTexture texture; // 08 - BGSColorForm * defaultColor; // 18 - tArray colors; // 20 - tArray alpha; // 38 - tArray unk50; // 50 - }; - UInt32 presetFlags[4][8]; // 00 - UInt32 totalPresets[4]; // 80 - tArray * tintData; // 90 - tArray * textureSet; // 98 - BGSTextureSet * defaultTexture; // A0 - tArray * presets; // A8 - tArray * colors; // B0 - BGSColorForm * defaultColor; // B8 - tArray * headParts; // C0 - }; - - CharGenData * chargenData[2]; // 4A8 -}; - -// 50 -class TESRegion : public TESForm -{ -public: - enum { kTypeID = kFormType_Region }; - - virtual bool Unk_39(void); - - // 18 - struct Data20 - { - UInt64 unk00; // 0 - UInt64 unk08; // 8 - UInt8 unk10; // 10 - UInt8 pad11[7]; // 11 - }; - - // 10 - struct Data28 - { - UInt64 unk0; - UInt64 unk8; - }; - - // C - struct Data40 - { - UInt32 unk0; - UInt32 unk4; - UInt32 unk8; - }; - - Data20 * unk20; // 20 - Data28 * unk28; // 28 - TESWorldSpace * worldSpace; // 30 - UInt64 unk38; // 38 - Data40 unk40; // 40 -}; - -// A8 -class TESShout : public TESForm -{ -public: - enum { kTypeID = kFormType_Shout }; - - // parents - TESFullName fullName; // 20 - BGSMenuDisplayObject menuDispObject; // 30 - BGSEquipType equipType; // 40 - TESDescription description; // 50 - - // members - - // 18 - struct Words - { - enum { - kNumWords = 3 - }; - TESWordOfPower * word; // 0 - SpellItem * spell; // 8 - float recoverytime; // 10 - UInt32 pad14; // 14 - }; - - Words words[Words::kNumWords]; // 60 -}; - -// 60 -class TESTopic : public TESForm -{ -public: - enum { kTypeID = kFormType_Topic }; - - // parents - TESFullName fullName; // 20 - - // members - UInt8 unk1C[4]; // 30 - UInt32 unk20; // 34 - init'd to 0x32000000 - void *unk38; // 38 - UInt64 unk40; // 40 - void ** unk2C; // 48 - buf[unk50] - UInt32 unk50; // 50 - len - BSFixedString editorId; // 58 -}; - -// 48 -class TESTopicInfo : public TESForm -{ -public: - enum { kTypeID = kFormType_TopicInfo }; - - enum - { - kDialogFlag_Goodbye = 1 << 0, - kDialogFlag_Random = 1 << 1, - kDialogFlag_SayOnce = 1 << 2, - kDialogFlag_RandomEnd = 1 << 5, - kDialogFlag_InvisibleContinue = 1 << 6, - kDialogFlag_ForceSubtitle = 1 << 8, - kDialogFlag_CanMoveWhileGreeting = 1 << 10, - kDialogFlag_HasNoLipFile = 1 << 11, - kDialogFlag_RequiresPostProcessing = 1 << 12, - kDialogFlag_SpendsFavorPoints = 1 << 14, - }; - - UInt64 unk14; // 20 - UInt64 unk18; // 28 - show response data from info? - Condition * conditions; // 30 - linked list - UInt16 unk20; // 38 - init'd to FFFF - UInt8 unk22; // 3A - UInt8 favorLevel; // 3B - UInt16 dialogFlags; // 3C - UInt16 hoursUntilReset; // 3E - UInt32 unk40; // 40 - UInt32 pad44; // 44 -}; -STATIC_ASSERT(sizeof(TESTopicInfo) == 0x48); - -// 260 -class TESWaterForm : public TESForm -{ -public: - enum { kTypeID = kFormType_Water }; - - // parents - TESFullName fullName; // 20 - TESAttackDamageForm attackDamage; // 30 - - // members - - // E4-E8 - struct Data0D0 - { - float unk00; // 00 - init'd to .1 - float unk04; // 04 - init'd to 90 - float unk08; // 08 - init'd to .5 - float unk0C; // 0C - init'd to 1 - float unk10; // 10 - init'd to 50 - float unk14; // 14 - init'd to .5 - float unk18; // 18 - init'd to .025 - UInt32 unk1C; // 1C - init'd to 0 - UInt32 unk20; // 20 - init'd to 0 - UInt32 unk24; // 24 - init'd to 0 - UInt32 unk28; // 28 - init'd to 00808000 - UInt32 unk2C; // 2C - init'd to 00190000 - UInt32 unk30; // 30 - init'd to 00FFFFFF - UInt8 unk34; // 34 - init'd to 0 - UInt8 pad35[3]; // 35 - float unk38; // 38 - init'd to 0.1 - float unk3C; // 3C - init'd to 0.6 - float unk40; // 40 - init'd to 0.985 - float unk44; // 44 - init'd to 2 - float unk48; // 48 - init'd to .01 - float unk4C; // 4C - init'd to .4 - float unk50; // 50 - init'd to .6 - float unk54; // 54 - init'd to .985 - float unk58; // 58 - init'd to 10 - float unk5C; // 5C - init'd to .05 - float unk60; // 60 - init'd to 300 - UInt32 unk64; // 64 - init'd to 0 - UInt32 unk68; // 68 - init'd to 0 - UInt32 unk6C; // 6C - init'd to 0 - UInt32 unk70; // 70 - init'd to 0 - UInt32 unk74; // 74 - init'd to 0 - UInt32 unk78; // 78 - init'd to 0 - float unk7C; // 7C - init'd to 300 - float unk80; // 80 - init'd to 300 - float unk84; // 84 - init'd to 1 - UInt32 unk88; // 88 - not init'd - float unk8C; // 8C - init'd to 1 - UInt32 unk90; // 90 - init'd to 0 - float unk94; // 94 - init'd to 1000 - float unk98; // 98 - init'd to 250 - float unk9C; // 9C - init'd to 100 - float unkA0; // A0 - init'd to 1 - float unkA4; // A4 - init'd to 10000 - float unkA8; // A8 - init'd to 1 - float unkAC; // AC - init'd to 100 - float unkB0; // B0 - init'd to 100 - float unkB4; // B4 - init'd to 100 - UInt32 unkB8; // B8 - init'd to 0 - UInt32 unkBC; // BC - init'd to 0 - UInt32 unkC0; // C0 - init'd to 0 - float unkC4; // C4 - init'd to 1 - float unkC8; // C8 - init'd to 1 - float unkCC; // CC - init'd to 1 - float unkD0; // D0 - init'd to 1 - float unkD4; // D4 - init'd to 1 - float unkD8; // D8 - init'd to 1 - float unkDC; // DC - init'd to 1 - float unkE0; // E0 - init'd to 1 - float unkE4; // E4 - init'd to 1 - New in SE - }; - - UInt8 unk040; // 040 - init'd to 1 - UInt8 pad041[3]; // 041 - UInt32 unk044; // 044 - - // SE: I had to remove the Data2C structures and extract the variables out because there was no way for the alignment to work - UInt32 unk048; // 048 - UInt32 unk04C; // 04C - UInt32 unk050; // 050 - UInt32 unk054; // 054 - UInt32 unk058; // 058 - UInt32 unk05C; // 05C - UInt32 unk060; // 060 - UInt32 unk064; // 064 - UInt32 unk068; // 068 - UInt32 unk06C; // 06C - UInt32 unk070; // 070 - UInt32 pad074; // 074 - - TESTexture unk078; // 078 - TESTexture unk088; // 088 - TESTexture unk098; // 098 - TESTexture unk0A8; // 0A8 - New in SE? - - UInt8 unk0B8; // 0B8 - init'd to 75 - UInt8 unk0B9; // 0B9 - UInt8 pad0BA[6]; // 0BA - UInt64 unk0C0; // 0C0 - UInt64 unk0C8; // 0C8 - Data0D0 unk0D0; // 0D0 - UInt64 unk1B8[3]; // 1B8 - UInt32 unk1D0; // 1D0 - UInt32 unk1D4; // 1D4 - UInt32 unk1D8; // 1D8 - init'd to 9 - UInt32 unk1DC; // 1DC - init'd to 9 - UInt32 unk1E0; // 1E0 - init'd to 4 - float unk1E4; // 1E4 - init'd to 0.5 - float unk1E8; // 1E8 - init'd to 2.0 - float unk1EC; // 1EC - init'd to 0.5 - float unk1F0; // 1F0 - init'd to 0.5 - UInt32 pad1F4; // 1F4 - UInt64 unk1F8; // 1F8 - UInt64 unk200; // 200 - UInt64 unk208; // 201 - UInt64 unk210; // 210 - UInt64 unk218; // 218 - UInt64 unk220; // 220 - UInt64 unk228; // 228 - it may be new in SE - void * unk230; // 230 - refcounted ptr - UInt32 unk238; // 238 - UInt8 unk23C; // 23C - UInt8 pad23D[3]; // 23D - UInt32 unk240; // 240 - - // SE: extracting data out from old Data1C8 structure, or alignment won't work - UInt32 unk244; // 244 - UInt32 unk248; // 248 - UInt32 unk24C; // 24C - UInt32 unk250; // 250 - UInt32 unk254; // 254 - UInt32 unk258; // 258 - UInt32 unk25C; // 25C -}; -STATIC_ASSERT(sizeof(TESWaterForm) == 0x260); - -// 8D8 -class TESWeather : public TESForm -{ -public: - enum { kTypeID = kFormType_Weather }; - - enum { kNumColorTypes = 17 }; - enum { kNumTimeOfDay = 4 }; - - enum ColorTypes { - kColorType_SkyUpper = 0, - kColorType_FogNear = 1, - kColorType_Unk = 2, - kColorType_Ambient = 3, - kColorType_Sunlight = 4, - kColorType_Sun = 5, - kColorType_Stars = 6, - kColorType_SkyLower = 7, - kColorType_Horizon = 8, - kColorType_EffectLighting = 9, - kColorType_CloudLODDiffuse = 10, - kColorType_CloudLODAmbient = 11, - kColorType_FogFar = 12, - kColorType_SkyStatics = 13, - kColorType_WaterMultiplier = 14, - kColorType_SunGlare = 15, - kColorType_MoonGlare = 16 - }; - - enum TimeOfDay { - kTime_Sunrise = 0, - kTime_Day = 1, - kTime_Sunset = 2, - kTime_Night = 3 - }; - - // 10 - struct ColorType - { - UInt32 time[kNumTimeOfDay]; - }; - - // 14 - struct General - { - //UInt8 unk00[0x13]; // 00 - UInt8 windSpeed; - UInt8 unk01[2]; - UInt8 transDelta; // Div 1000 - UInt8 sunGlare; // Div 256 - UInt8 sunDamage; // Div 256 - UInt16 unk06; // precipitation fadein/out - UInt32 unk08; // thunder ligting fadein/out/frequency/flags - UInt32 lightingColor; - UInt8 unk10; - UInt8 windDirection; // Div (256/360) - UInt8 windDirRange; // Div (256/180) - UInt8 pad13; - }; - - // 20 - struct FogDistance - { - float nearDay; - float farDay; // 10 - float nearNight; // 14 - float farNight; // 18 - float powerDay; // 1C - float powerNight; - float maxDay; - float maxNight; - }; - - // 10 - struct CloudAlpha - { - float time[kNumTimeOfDay]; - }; - - TESTexture1024 texture[0x20]; // 020 - UInt8 unk220[0x20]; // 220 - cleared to 0x7F - UInt8 unk240[0x20]; // 240 - cleared to 0x7F - UInt8 unk260[0x200]; // 260 - CloudAlpha cloudAlpha[0x20]; // 460 - UInt32 unk660; // 660 - General general; // 664 - FogDistance fogDistance; // 678 - ColorType colorTypes[kNumColorTypes]; // 698 - TESAIForm::Data unk7A8; // 7A8 - UnkArray unk7B8; // 7B8 - UInt32 unk7D0; // 7D0 - not init'd - LNAM unknown - TESImageSpace * imageSpaces[kNumTimeOfDay]; // 7D8 - BGSLightingTemplate::Data::Color directionalAmbient[kNumTimeOfDay]; // 7F8 - TESModel unk878; // 878 - TESForm *lensFlare; // 8A0 - TODO: replace with actual form pointer when a definition is available - TESForm *volumetricLightings[kNumTimeOfDay]; // 8A8 - TODO: replace with actual form pointer when a definition is available - BGSShaderParticleGeometryData * particleShader; // 8C8 - BGSReferenceEffect * referenceEffect; // 8D0 -}; -STATIC_ASSERT(sizeof(TESWeather) == 0x8D8); - -// 38 -class TESWordOfPower : public TESForm -{ -public: - enum { kTypeID = kFormType_WordOfPower }; - - // parents - TESFullName fullName; // 20 - - // members - BSFixedString word; // 30 -}; - -// 358 -class TESWorldSpace : public TESForm -{ -public: - enum { kTypeID = kFormType_WorldSpace }; - - // parents - TESFullName fullName; // 14-20 - - // members - - // F0 - struct Data250 - { - // this struct keeps showing up everywhere - // 30 - struct Entry - { - UInt64 unk00; // 00 - not init'd - UInt32 unk08; // 08 - not init'd - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - UInt32 unk14; // 14 - void* unk18; // 18 - UInt64 unk20; // 20 - not init'd - UInt64 unk28; - }; - - Entry unk00; - Entry unk30; - Entry unk60; - Entry unk90; - Entry unkC0; - }; - - struct LandData // DNAM - { - float defaultLandHeight; // 0 - float defaultWaterHeight; // 4 - }; - STATIC_ASSERT(sizeof(LandData) == 0x8); - - - TESModel unk030; // 030 - - // TODO: this block may all be part of same thing - UInt8 unk058[0x18]; // 058 - void* unk070; // 070 - UInt8 unk078[0x10]; // 078 - TESObjectCELL* unk088; // 088 - void* unk090; // 090 - UInt64 unk098; // 098 - - UInt8 unk0A0; // 0A0 - UInt8 pad0A1; // 0A1 - UInt16 unk0A2; // 0A2 - UInt16 unkA04; // 0A4 - UInt16 unk0A6; // 0A6 - UInt64 unk0A8; // 0A8 - UInt32 unk0B0; // 0B0 - UInt32 unk0B4; // 0B4 - UInt32 unk0B8; // 0B8 - UInt32 unk0BC; // 0BC - - void* unk0C0; // 0C0 - UInt64 unk0C8; // 0C8 - void* unk0D0; // 0D0 - tArray unk0D8; // 0D8 - void* unk0F0; // 0F0 - TESObjectCELL* unk0F8; // 0F8 - - UInt64 unk100; // 100 - UInt32 unk108; // 108 - UInt32 unk10C; // 10C - UInt32 unk110; // 110 - UInt32 unk114; // 114 - - void* unk118; // 118 - UInt64 unk120; // 120 - UInt64 unk128; // 128 - UInt64 unk130; // 130 - UInt64 unk138; // 138 - UInt64 unk140; // 140 - UInt64 unk148; // 148 - UInt64 unk150; // 150 - void* unk158; // 158 - - BGSLightingTemplate* interiorLighting; // 160 - TESWaterForm* water; // 168 - TESWaterForm* lodWater; // 170 - - UInt8 unk178[0x20]; // 178 - - float unk198; // init'd to 50000 - float unk19C; // init'd to 80000 - float unk1A0; // init'd to 50 - float unk1A4; // world map scale? - float unk1A8; // cell X offset? - float unk1AC; // cell Y offset? - float unk1B0; // cell Z offset? - UInt32 unk1B4; - - BGSMusicType* musicType; // 1B8 - - float unk1C0; // 1C0 - float unk1C4; // 1C4 - float unk1C8; // 1C8 - float unk1CC; // 1CC - - UInt64 unk1D0; // 1D0 - UInt32 unk1D8; // 1D8 - UInt32 unk1DC; // 1DC - UInt32 unk1E0; // 1E0 - UInt32 unk1E4; // 1E4 - - void* unk1E8; // 1E8 - UInt64 unk1F0; // 1F0 - void* unk1F8; // 1F8 - BSString editorId; // 200 - LandData landData; // 210 - float unk218; // 218 - UInt32 pad21C; // 21C - - BGSEncounterZone* encounterZone; // 220 - BGSLocation* location; // 228 - - TESTexture unk230; // 230 - TESTexture unk240; // 240 - - Data250 unk250; // 250 - - UInt64 unk340; // 340 - UInt64 unk348; // 348 - void* unk350; // 350 -}; -STATIC_ASSERT(sizeof(TESWorldSpace) == 0x358); - -// 8 -class IFormFactory -{ -public: - IFormFactory(); - virtual ~IFormFactory(); - - virtual TESForm * Create(void) = 0; - virtual const char * GetName(void) = 0; - virtual UInt32 GetTypeID(void) = 0; - virtual const char * Unk_04(void); // return NULL - virtual UInt32 Unk_05(void); // return 0x67 - virtual UInt32 Unk_06(void); // return 9 - -// void ** _vtbl; // 00 - - static IFormFactory * GetFactoryForType(UInt32 type) - { - if(type > kFormType_Max) - return NULL; - - // 5386ADDB542755AB5BD598497543E780AD5BDC54+35 - static RelocPtr kFactoryList(0x01F5F620); - - return kFactoryList[type]; - } -}; - -// 10 -class ConcreteFormFactory : public IFormFactory -{ -public: - const char * name; // 08 -}; diff --git a/source/fs.dll/skse64/skse64/GameHandlers.cpp b/source/fs.dll/skse64/skse64/GameHandlers.cpp deleted file mode 100644 index 7a033cc9..00000000 --- a/source/fs.dll/skse64/skse64/GameHandlers.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "GameHandlers.h" diff --git a/source/fs.dll/skse64/skse64/GameHandlers.h b/source/fs.dll/skse64/skse64/GameHandlers.h deleted file mode 100644 index 4a7a8236..00000000 --- a/source/fs.dll/skse64/skse64/GameHandlers.h +++ /dev/null @@ -1,167 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "GameReferences.h" - -template -class IHandlerFunctor -{ -public: - virtual ~IHandlerFunctor(); - virtual UInt8 Process(FormT * form, DataT unk04); // pure - - BSIntrusiveRefCounted refCount; -}; - -template<> -class IHandlerFunctor -{ -public: - virtual ~IHandlerFunctor(); - virtual UInt8 Process(Actor * form, UInt32 unk04); // pure - - template - UInt8 ProcessAction(Actor * form, UInt32 unk04); -}; - -// All member functions below are merely the original vtbl function address -class WeaponRightSwingHandler : public IHandlerFunctor -{ -public: - virtual ~WeaponRightSwingHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(WeaponRightSwingHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C500, Actor * form, UInt32 unk04); -}; - -class WeaponLeftSwingHandler : public IHandlerFunctor -{ -public: - virtual ~WeaponLeftSwingHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(WeaponLeftSwingHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C590, Actor * form, UInt32 unk04); -}; - -class RightHandSpellFireHandler : public IHandlerFunctor -{ -public: - virtual ~RightHandSpellFireHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(RightHandSpellFireHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C750, Actor * form, UInt32 unk04); -}; - -class LeftHandSpellFireHandler : public IHandlerFunctor -{ -public: - virtual ~LeftHandSpellFireHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(LeftHandSpellFireHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C700, Actor * form, UInt32 unk04); -}; - -class RightHandSpellCastHandler : public IHandlerFunctor -{ -public: - virtual ~RightHandSpellCastHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(RightHandSpellCastHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C910, Actor * form, UInt32 unk04); -}; - -class LeftHandSpellCastHandler : public IHandlerFunctor -{ -public: - virtual ~LeftHandSpellCastHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(LeftHandSpellCastHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C8C0, Actor * form, UInt32 unk04); -}; - -class VoiceSpellCastHandler : public IHandlerFunctor -{ -public: - virtual ~VoiceSpellCastHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(VoiceSpellCastHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C960, Actor * form, UInt32 unk04); -}; - -class VoiceSpellFireHandler : public IHandlerFunctor -{ -public: - virtual ~VoiceSpellFireHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(VoiceSpellFireHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C7A0, Actor * form, UInt32 unk04); -}; - -class BowDrawnHandler : public IHandlerFunctor -{ -public: - virtual ~BowDrawnHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(BowDrawnHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074DBC0, Actor * form, UInt32 unk04); -}; - -class BowReleaseHandler : public IHandlerFunctor -{ -public: - virtual ~BowReleaseHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(BowReleaseHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074DBE0, Actor * form, UInt32 unk04); -}; - -class WeaponBeginDrawRightHandler : public IHandlerFunctor -{ -public: - virtual ~WeaponBeginDrawRightHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(WeaponBeginDrawRightHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074C9F0, Actor * form, UInt32 unk04); -}; - -class WeaponBeginSheatheRightHandler : public IHandlerFunctor -{ -public: - virtual ~WeaponBeginSheatheRightHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(WeaponBeginSheatheRightHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074CAA0, Actor * form, UInt32 unk04); -}; - -class RightHandWeaponDrawHandler : public IHandlerFunctor -{ -public: - virtual ~RightHandWeaponDrawHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(RightHandWeaponDrawHandler); - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074CB10, Actor * form, UInt32 unk04); -}; - -class RightHandWeaponSheatheHandler : public IHandlerFunctor -{ -public: - virtual ~RightHandWeaponSheatheHandler(); - virtual UInt8 Process(Actor * form, UInt32 unk04); - - MEMBER_FN_PREFIX(RightHandWeaponSheatheHandler); - // ??_7RightHandWeaponSheatheHandler@@6B@ + 8 - DEFINE_MEMBER_FN(Process_Origin, UInt8, 0x0074CC70, Actor * form, UInt32 unk04); -}; diff --git a/source/fs.dll/skse64/skse64/GameInput.cpp b/source/fs.dll/skse64/skse64/GameInput.cpp deleted file mode 100644 index f51a506d..00000000 --- a/source/fs.dll/skse64/skse64/GameInput.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include "GameInput.h" - -bool InputEventDispatcher::IsGamepadEnabled(void) -{ - return (gamepad != NULL) && gamepad->IsEnabled(); -} - -InputEventDispatcher* InputEventDispatcher::GetSingleton() -{ - // 8FAAB2F3DC59885AE2A550C95F2C82BE2497789F+37 - static RelocPtr g_inputEventDispatcher(0x02FC0DC0); - return *g_inputEventDispatcher; -} - -InputManager * InputManager::GetSingleton(void) -{ - // 80AE59E4FF0DC421866FA7261C1625595B0C7572+11 - static RelocPtr g_inputManager(0x02F614A0); - return *g_inputManager; -} - -UInt8 InputManager::AllowTextInput(bool allow) -{ - if(allow) - { - if(allowTextInput == 0xFF) - _WARNING("InputManager::AllowTextInput: counter overflow"); - else - allowTextInput++; - } - else - { - if(allowTextInput == 0) - _WARNING("InputManager::AllowTextInput: counter underflow"); - else - allowTextInput--; - } - - if(IsConsoleMode()) - Console_Print("%s text input, count = %d", allow ? "allowed" : "disallowed", allowTextInput); - - return allowTextInput; -} - -UInt32 InputManager::GetMappedKey(BSFixedString name, UInt32 deviceType, UInt32 contextIdx) -{ - ASSERT(contextIdx < kContextCount); - - tArray * mappings; - if (deviceType == kDeviceType_Mouse) - mappings = &context[contextIdx]->mouseMap; - else if (deviceType == kDeviceType_Gamepad) - mappings = &context[contextIdx]->gamepadMap; - else - mappings = &context[contextIdx]->keyboardMap; - - for (UInt32 i=0; i < mappings->count; i++) - { - InputContext::Mapping m; - if (!mappings->GetNthItem(i, m)) - break; - if (m.name == name) - return m.buttonID; - } - - // Unbound - return 0xFF; -} - -BSFixedString InputManager::GetMappedControl(UInt32 buttonID, UInt32 deviceType, UInt32 contextIdx) -{ - ASSERT(contextIdx < kContextCount); - - // 0xFF == unbound - if (buttonID == 0xFF) - return BSFixedString(); - - tArray * mappings; - if (deviceType == kDeviceType_Mouse) - mappings = &context[contextIdx]->mouseMap; - else if (deviceType == kDeviceType_Gamepad) - mappings = &context[contextIdx]->gamepadMap; - else - mappings = &context[contextIdx]->keyboardMap; - - for (UInt32 i=0; i < mappings->count; i++) - { - InputContext::Mapping m; - if (!mappings->GetNthItem(i, m)) - break; - if (m.buttonID == buttonID) - return m.name; - } - - return BSFixedString(); -} - -PlayerControls * PlayerControls::GetSingleton(void) -{ - // 20AF40A6B803C21547F594CE478EAA5065E8F5A5+11B - static RelocPtr g_playerControls(0x02F614A8); - return *g_playerControls; -} - -MenuControls * MenuControls::GetSingleton(void) -{ - // 4E9F39D1066653EF254B38406212E476F80A6C9B+F0 - static RelocPtr g_menuControls(0x02F9BC88); - return *g_menuControls; -} diff --git a/source/fs.dll/skse64/skse64/GameInput.h b/source/fs.dll/skse64/skse64/GameInput.h deleted file mode 100644 index b50fa45b..00000000 --- a/source/fs.dll/skse64/skse64/GameInput.h +++ /dev/null @@ -1,442 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "GameEvents.h" -#include "InputMap.h" - -class PlayerControls; -class BGSEncounterZone; -class MenuEventHandler; - -// Note: These are different from those in Hooks_DI -enum -{ - kDeviceType_Keyboard = 0, - kDeviceType_Mouse, - kDeviceType_Gamepad -}; - -class BSInputDevice -{ -public: - - // SE: destructor is now at top - virtual ~BSInputDevice(); - virtual UInt32 Unk_01(void); // pure - virtual void Unk_02(float unk1); // pure - virtual void Unk_03(void); // pure - - // These 3 ones added in SE. The three of them do some call to CRC functions but I didn't do further research - virtual bool Unk_04(UInt32 unk0, void *unk1); - virtual bool Unk_05(void *unk0); - virtual bool Unk_06(UInt32 unk0, UInt32 *unk1); - - virtual bool IsEnabled(void); // Always 1 for non-gamepad? - virtual void Unk_08(void* unk1); // pure -}; - -// 18 -class InputEvent -{ -public: - enum - { - kEventType_Button = 0, - kEventType_MouseMove, - kEventType_Char, - kEventType_Thumbstick, - kEventType_DeviceConnect, - kEventType_Kinect - }; - - virtual ~InputEvent(); - virtual bool IsIDEvent(); - virtual BSFixedString * GetControlID(); - -// void ** _vtbl; // 00 - UInt32 deviceType; // 08 - UInt32 eventType; // 0C - InputEvent * next; // 10 -}; - -class IDEvent -{ -public: - BSFixedString controlID; // 00 -}; - -// 30 -class ButtonEvent : public IDEvent, public InputEvent -{ -public: - virtual ~ButtonEvent(); - virtual bool IsIDEvent(); - virtual BSFixedString * GetControlID(); - - // 18 -> controlID from IDEvent - UInt32 keyMask; // 20 (00000038 when ALT is pressed, 0000001D when STRG is pressed) - UInt32 pad24; // 24 - UInt32 flags; // 28 - isn't this a float? - float timer; // 2C (hold duration) -}; - -class MouseMoveEvent : public IDEvent, public InputEvent -{ -}; - -// 20 -class CharEvent : public InputEvent -{ -public: - UInt32 keyCode; // 18 (ascii code) -}; - -class ThumbstickEvent : public IDEvent, public InputEvent -{ -public: - virtual ~ThumbstickEvent(); - virtual bool IsIDEvent(); - virtual BSFixedString * GetControlID(); - - // 18 -> controlID from IDEvent - UInt32 keyMask; // 20 - b for left stick, c for right stick - float x; // 24 - float y; // 28 -}; - -class DeviceConnectEvent : public InputEvent -{ -}; - -class KinectEvent : public IDEvent, public InputEvent -{ -}; - -// E8 -class InputEventDispatcher : public EventDispatcher -{ -public: - UInt32 unk058; // 058 - UInt32 pad05C; // 05C - BSInputDevice * keyboard; // 060 - BSInputDevice * mouse; // 068 - BSInputDevice * gamepad; // 070 - BSInputDevice * vkeyboard; // 078 - New in SE .?AVBSWin32VirtualKeyboardDevice@@ - UInt8 unk080; // 080 - UInt8 unk081; // 081 - UInt8 pad082[6]; // 082 - BSTEventSource unk088; // 088 - TODO: template type - UInt8 unk0E0; // 0E0 - UInt8 pad0E1[7]; // 0E1 - - bool IsGamepadEnabled(void); - - static InputEventDispatcher* GetSingleton(); -}; -STATIC_ASSERT(offsetof(InputEventDispatcher, gamepad) == 0x70); -STATIC_ASSERT(sizeof(InputEventDispatcher) == 0xE8); - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(InputEvent ** evn, InputEventDispatcher * dispatcher) = 0; -}; - -// 128 -class InputManager -{ -public: - enum - { - kContext_Gameplay = 0, - kContext_MenuMode, - kContext_Console, - kContext_ItemMenu, - kContext_Inventory, - kContext_DebugText, - kContext_Favorites, - kContext_Map, - kContext_Stats, - kContext_Cursor, - kContext_Book, - kContext_DebugOverlay, - kContext_Journal, - kContext_TFCMode, - kContext_MapDebug, - kContext_Lockpicking, - kContext_Favor, - kContextCount = 17 - }; - - struct InputContext - { - // 18 - struct Mapping - { - BSFixedString name; // 00 - UInt32 buttonID; // 08 - UInt32 sortIndex; // 0C - UInt32 unk10; // 10 - UInt32 pad14; // 14 - }; - - tArray keyboardMap; - tArray mouseMap; - tArray gamepadMap; - }; - - - void* unkPtr000; // 000 - BSTEventSource unk008; // 008 - TODO: template type - InputContext * context[kContextCount]; // 060 - tArray unk0E8; // 0E8 - tArray unk100; // 100 - UInt32 unk118; // 118 - init'd to 0xFFFFFFFF - UInt32 unk11C; // 11C - init'd to 0x80000000 - UInt8 allowTextInput; // 120 - UInt8 unk121; // 121 - UInt8 unk122; // 122 - UInt8 pad[5]; // 123 - - static InputManager * GetSingleton(void); - - UInt8 AllowTextInput(bool allow); - - UInt32 GetMappedKey(BSFixedString name, UInt32 deviceType, UInt32 contextIdx); - - BSFixedString GetMappedControl(UInt32 buttonID, UInt32 deviceType, UInt32 contextIdx); -}; -STATIC_ASSERT(sizeof(InputManager) == 0x128); - -// 10 -class PlayerInputHandler -{ -public: - PlayerInputHandler(); - virtual ~PlayerInputHandler(); - - virtual void Unk_01(); - virtual void Unk_02(); - virtual void Unk_03(); - virtual void Unk_04(); - - UInt32 unk08; // 08 - UInt32 pad0C; // 0C -}; - -// 1D8 or 1E0 -class PlayerControls -{ -public: - virtual ~PlayerControls(); - virtual UInt32 Unk_01(); - -// void ** _vtbl; // 000 - BSTEventSink menuOpenCloseEvent; // 008 - BSTEventSink menuModeChangeEvent; // 010 - BSTEventSink furnitureEvent; // 018 - UInt32 unk020; // 020 - float unk024; // 024 - float unk028; // 028 - float unk02C; // 02C - float unk030; // 030 - float unk034; // 034 - float unk038; // 038 - float unk03C; // 03C - float unk040; // 040 - UInt32 unk044; // 044 - UInt8 autoRun; // 048 - UInt8 runMode; // 049 - UInt8 unk04A; // 04A - UInt8 unk04B; // 04B - UInt16 unk04C; // 04C - UInt8 unk04E; // 04E - UInt8 unk04F; // 04F - bool remapMode; // 050 - might be named differently - UInt8 pad51[7]; // 051 - tArray unk058; // 058 - tArray unk070; // 070 - tArray unk088; // 088 - UInt8 unkA0[8]; // 0A0 - UInt64 unkA8; // 0A8 - float unkB0[8]; // B0 - UInt32 unkD0[10]; // D0 - UInt8 unkF8[8]; // F8 - float unk100[20]; // 100 - tArray unk150; // 150 - UInt64 unk168; // 168 - - PlayerInputHandler* movementHandler; // 170 - PlayerInputHandler* lookHandler; // 178 - PlayerInputHandler* sprintHandler; // 180 - PlayerInputHandler* readyWeaponHandler; // 188 - PlayerInputHandler* autoMoveHandler; // 190 - PlayerInputHandler* toggleRunHandler; // 198 - PlayerInputHandler* activateHandler; // 1A0 - PlayerInputHandler* jumpHandler; // 1A8 - PlayerInputHandler* shoutHandler; // 1B0 - PlayerInputHandler* attackBlockHandler; // 1B8 - PlayerInputHandler* runHandler; // 1C0 - PlayerInputHandler* sneakHandler; // 1C8 - PlayerInputHandler* togglePOVHandler; // 1D0 - - static PlayerControls * GetSingleton(void); - - // used by Hooks_Event - PlayerControls * ctor_Hook(void); - MEMBER_FN_PREFIX(PlayerControls); - DEFINE_MEMBER_FN(ctor, PlayerControls *, 0x0072F010); -}; -STATIC_ASSERT(offsetof(PlayerControls, runMode) == 0x049); -STATIC_ASSERT(offsetof(PlayerControls, remapMode) == 0x050); - -// 90 -class MenuControls -{ -public: - virtual ~MenuControls(); - virtual UInt32 Unk_01(); - -// void ** _vtbl; // 00 - BSTEventSink menuModeEventSink; // 08 - UInt64 unk10; // 10 - tArray arr18; // 18 - UInt64 unk30[3]; // 30 - - MenuEventHandler* clickHandler; // 48 - MenuEventHandler* directionHandler; // 50 - MenuEventHandler* consoleOpenHandler; // 58 - MenuEventHandler* quickSaveLoadHandler; // 60 - MenuEventHandler* menuOpenHandler; // 68 - MenuEventHandler* favoritesHandler; // 70 - MenuEventHandler* screenshotHandler; // 78 - - UInt8 unk80; // 80 - UInt8 unk81; // 81 - bool remapMode; // 82 - UInt8 unk83; // 83 - UInt8 pad84[0x90 - 0x84]; // 84 - - static MenuControls * GetSingleton(void); -}; -STATIC_ASSERT(offsetof(MenuControls, remapMode) == 0x082); - -// 340 -class InputStringHolder -{ -public: - void * unk00; // 000 - BSFixedString forward; // 008 "Forward" - BSFixedString back; // 010 "Back" - BSFixedString strafeLeft; // 018 "Strafe Left" - BSFixedString strafeRight; // 020 "Strafe Right" - BSFixedString move; // 028 "Move" - BSFixedString look; // 030 "Look" - BSFixedString activate; // 038 "Activate" - BSFixedString leftAttack; // 040 "Left Attack/Block" - BSFixedString rightAttack; // 048 "Right Attack/Block" - BSFixedString dualAttack; // 050 "Dual Attack" - BSFixedString forceRelease; // 058 "ForceRelease" - BSFixedString pause; // 060 "Pause" - BSFixedString readyWeapon; // 068 "Ready Weapon" - BSFixedString togglePOV; // 070 "Toggle POV" - BSFixedString jump; // 078 "Jump" - BSFixedString journal; // 080 "Journal" - BSFixedString sprint; // 088 "Sprint" - BSFixedString sneak; // 090 "Sneak" - BSFixedString shout; // 098 "Shout" - BSFixedString kinectShout; // 0A0 "KinectShout" - BSFixedString grab; // 0A8 "Grab" - BSFixedString run; // 0B0 "Run" - BSFixedString toggleRun; // 0B8 "Toggle Always Run" - BSFixedString autoMove; // 0C0 "Auto-Move" - BSFixedString quicksave; // 0C8 "Quicksave" - BSFixedString quickload; // 0D0 "Quickload" - BSFixedString newSave; // 0D8 "NewSave" - BSFixedString inventory; // 0E0 "Inventory" - BSFixedString stats; // 0E8 "Stats" - BSFixedString map; // 0F0 "Map" - BSFixedString screenshot; // 0F8 "Screenshot" - BSFixedString multiScreenshot; // 100 "Multi-Screenshot" - BSFixedString console; // 108 "Console" - BSFixedString cameraPath; // 110 "CameraPath" - BSFixedString tweenMenu; // 118 "Tween Menu" - BSFixedString takeAll; // 120 "Take All" - BSFixedString accept; // 128 "Accept" - BSFixedString cancel; // 130 "Cancel" - BSFixedString up; // 138 "Up" - BSFixedString down; // 140 "Down" - BSFixedString left; // 148 "Left" - BSFixedString right; // 150 "Right" - BSFixedString pageUp; // 158 "PageUp" - BSFixedString pageDown; // 160 "PageDown" - BSFixedString pick; // 168 "Pick" - BSFixedString pickNext; // 170 "PickNext" - BSFixedString pickPrevious; // 178 "PickPrevious" - BSFixedString cursor; // 180 "Cursor" - BSFixedString kinect; // 188 "Kinect" - BSFixedString sprintStart; // 190 "SprintStart" - BSFixedString sprintStop; // 198 "SprintStop" - BSFixedString sneakStart; // 1A0 "sneakStart" - BSFixedString sneakStop; // 1A8 "sneakStop" - BSFixedString blockStart; // 1B0 "blockStart" - BSFixedString blockStop; // 1B8 "blockStop" - BSFixedString blockBash; // 1C0 "blockBash" - BSFixedString attackStart; // 1C8 "attackStart" - BSFixedString attackPowerStart; // 1D0 "attackPowerStart" - BSFixedString reverseDirection; // 1D8 "reverseDirection" - BSFixedString unequip; // 1E0 "Unequip" - BSFixedString zoomIn; // 1E8 "Zoom In" - BSFixedString zoomOut; // 1F0 "Zoom Out" - BSFixedString rotateItem; // 1F8 "RotateItem" - BSFixedString leftStick; // 200 "Left Stick" - BSFixedString prevPage; // 208 "PrevPage" - BSFixedString nextPage; // 210 "NextPage" - BSFixedString prevSubPage; // 218 "PrevSubPage" - BSFixedString nextSubPage; // 220 "NextSubPage" - BSFixedString leftEquip; // 228 "LeftEquip" - BSFixedString rightEquip; // 230 "RightEquip" - BSFixedString toggleFavorite; // 238 "ToggleFavorite" - BSFixedString favorites; // 240 "Favorites" - BSFixedString hotkey1; // 248 "Hotkey1" - BSFixedString hotkey2; // 250 "Hotkey2" - BSFixedString hotkey3; // 258 "Hotkey3" - BSFixedString hotkey4; // 260 "Hotkey4" - BSFixedString hotkey5; // 268 "Hotkey5" - BSFixedString hotkey6; // 270 "Hotkey6" - BSFixedString hotkey7; // 278 "Hotkey7" - BSFixedString hotkey8; // 280 "Hotkey8" - BSFixedString quickInventory; // 288 "Quick Inventory" - BSFixedString quickMagic; // 290 "Quick Magic" - BSFixedString quickStats; // 298 "Quick Stats" - BSFixedString quickMap; // 2A0 "Quick Map" - BSFixedString toggleCursor; // 2A8 "ToggleCursor" - BSFixedString wait; // 2B0 "Wait" - BSFixedString click; // 2B8 "Click" - BSFixedString mapLookMode; // 2C0 "MapLookMode" - BSFixedString equip; // 2C8 "Equip" - BSFixedString dropItem; // 2D0 "DropItem" - BSFixedString rotate; // 2D8 "Rotate" - BSFixedString nextFocus; // 2E0 "NextFocus" - BSFixedString prevFocus; // 2E8 "PreviousFocus" - BSFixedString setActiveQuest; // 2F0 "SetActiveQuest" - BSFixedString placePlayerMarker; // 2F8 "PlacePlayerMarker" - BSFixedString xButton; // 300 "XButton" - BSFixedString yButton; // 308 "YButton" - BSFixedString chargeItem; // 310 "ChargeItem" - UInt64 unk318; // 318 - BSFixedString playerPosition; // 320 "PlayerPosition" - BSFixedString localMap; // 328 "LocalMap" - BSFixedString localMapMoveMode; // 330 "LocalMapMoveMode" - BSFixedString itemZoom; // 338 "Item Zoom" - - static InputStringHolder * GetSingleton(void) - { - // 8BDB97B9BE3B9EBCCFB4F3BA9237EDC8341B354C+B - static RelocPtr g_inputStringHolder(0x02FC07C0); - return *g_inputStringHolder; - } -}; -STATIC_ASSERT(sizeof(InputStringHolder) == 0x340); diff --git a/source/fs.dll/skse64/skse64/GameMenus.cpp b/source/fs.dll/skse64/skse64/GameMenus.cpp deleted file mode 100644 index d2c01504..00000000 --- a/source/fs.dll/skse64/skse64/GameMenus.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "GameMenus.h" - -RelocAddr <_CreateUIMessageData> CreateUIMessageData(0x005B0E50); - -IMenu::IMenu() : - view(NULL), - unk0C(3), - flags(0), - unk14(0x12), - unk18(NULL) -{ -} - -void IMenu::Render(void) -{ - if (view) - view->Render(); -} - -bool MenuManager::IsMenuOpen(BSFixedString * menuName) -{ - return CALL_MEMBER_FN(this, IsMenuOpen)(menuName); -} - -GFxMovieView * MenuManager::GetMovieView(BSFixedString * menuName) -{ - IMenu * menu = GetMenu(menuName); - if (!menu) - return NULL; - - return menu->view; -} - -IMenu * MenuManager::GetMenu(BSFixedString * menuName) -{ - if (!menuName->data) - return NULL; - - MenuTableItem * item = menuTable.Find(menuName); - - if (!item) - return NULL; - - IMenu * menu = item->menuInstance; - if(!menu) - return NULL; - - return menu; -} - -RaceMenuSlider::RaceMenuSlider(UInt32 _filterFlag, const char * _sliderName, const char * _callbackName, UInt32 _sliderId, UInt32 _index, UInt32 _type, UInt8 _unk8, float _min, float _max, float _value, float _interval, UInt32 _unk13) -{ - filterFlag = _filterFlag; - name = _sliderName; - strcpy_s(callback, MAX_PATH, _callbackName); - id = _sliderId; - index = _index; - type = _type; - min = _min; - max = _max; - value = _value; - interval = _interval; - unk12C = _unk13; - unk130 = 0x7F7FFFFF; - unk134 = _unk8; - pad135[0] = 0; - pad135[1] = 0; - pad135[2] = 0; -} - -NiPointer EnemyHealth::GetTarget() const -{ - NiPointer refr; - UInt32 refHandle = (*g_thePlayer)->targetHandle; - LookupREFRByHandle(refHandle, refr); - if(!refr) { - refHandle = handle; - LookupREFRByHandle(refHandle, refr); - } - - return refr; -} - -Notification::Notification(const Notification& other) -{ - CALL_MEMBER_FN(&text, Set)(other.text.Get(), 0); - CALL_MEMBER_FN(&status, Set)(other.status.Get(), 0); - - CALL_MEMBER_FN(&sound, Set)(other.sound.c_str()); - objectives.CopyFrom(&other.objectives); - - type = other.type; - quest = other.quest; - word = other.word; - time = other.time; -} diff --git a/source/fs.dll/skse64/skse64/GameMenus.h b/source/fs.dll/skse64/skse64/GameMenus.h deleted file mode 100644 index 2e5aea7e..00000000 --- a/source/fs.dll/skse64/skse64/GameMenus.h +++ /dev/null @@ -1,1124 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" -#include "skse64/GameEvents.h" -#include "skse64/GameCamera.h" -#include "skse64/GameReferences.h" - -#include "skse64/ScaleformCallbacks.h" -#include "skse64/ScaleformMovie.h" - -#include "skse64_common/Utilities.h" -#include "skse64/GameUtilities.h" -//#include "skse64/NiNodes.h" - -class TESObjectREFR; -class TESFullName; - -class InventoryEntryData; - -class UIDelegate; -class UIDelegate_v1; - -class UIMessage; - -//// menu implementations - -// 30 -class IMenu : public FxDelegateHandler -{ - struct BSUIScaleformData - { - virtual ~BSUIScaleformData() {} - - // void ** _vtbl; // 00 - UInt32 unk04; // 04 - void* unk08; // 08 - }; - - struct UnkData1 - { - BSFixedString name; // 00 - UInt32 unk04; // 04 - BSUIScaleformData* data; // 08 - BSUIScaleformData - }; - -public: - IMenu(); - virtual ~IMenu() { CALL_MEMBER_FN(this, dtor)(); } // TODO - - enum - { - kFlag_None = 0, - kFlag_PausesGame = 1 << 0, - kFlag_AlwaysOpen = 1 << 1, - kFlag_UsesCursor = 1 << 2, - kFlag_UsesMenuContext = 1 << 3, - kFlag_Modal = 1 << 4, // prevents lower movies with this flag from advancing - kFlag_FreezeFrameBackground = 1 << 5, - kFlag_OnStack = 1 << 6, - kFlag_DisablePauseMenu = 1 << 7, - kFlag_RequiresUpdate = 1 << 8, - kFlag_TopmostRenderedMenu = 1 << 9, - kFlag_UpdateUsesCursor = 1 << 10, - kFlag_AllowSaving = 1 << 11, - kFlag_RendersOffscreenTargets = 1 << 12, - kFlag_InventoryItemMenu = 1 << 13, - kFlag_DontHideCursorWhenTopmost = 1 << 14, - kFlag_CustomRendering = 1 << 15, - kFlag_AssignCursorToRenderer = 1 << 16, - kFlag_ApplicationMenu = 1 << 17, - kFlag_HasButtonBar = 1 << 18, - kFlag_IsTopButtonBar = 1 << 19, - kFlag_AdvancesUnderPauseMenu = 1 << 20, - kFlag_RendersUnderPauseMenu = 1 << 21, - kFlag_UsesBlurredBackground = 1 << 22, - kFlag_CompanionAppAllowed = 1 << 23, - kFlag_FreezeFramePause = 1 << 24, - kFlag_SkipRenderDuringFreezeFrameScreenshot = 1 << 25, - kFlag_LargeScaleformRenderCacheMode = 1 << 26, - kFlag_UsesMovementToDirection = 1 << 27 - }; - - virtual void Accept(CallbackProcessor * processor) {} - virtual void Unk_02(void) {} - virtual void Unk_03(void) {} - virtual UInt32 ProcessMessage(UIMessage* message) { return CALL_MEMBER_FN(this, ProcessMessage_internal)(message); } - virtual void NextFrame(UInt32 arg0, UInt32 arg1) { CALL_MEMBER_FN(this, NextFrame_internal)(arg0, arg1); } - virtual void Render(void); - virtual void Unk_07(void) {} - virtual void InitMovie(void) { CALL_MEMBER_FN(this, InitMovie_internal)(view); } - - GFxMovieView * view; // 10 - init'd to 0, a class, virtual fn 0x228 called in dtor - UInt8 unk0C; // 18 - init'd to 3 - UInt8 pad19[3]; // 19 - UInt32 flags; // 1C - init'd to 0 - UInt32 unk14; // 20 - init'd to 0x12 - UInt32 pad24; // 24 - GRefCountBase * unk18; // 28 - holds a reference - - MEMBER_FN_PREFIX(IMenu); - DEFINE_MEMBER_FN(InitMovie_internal, void, 0x00F10E30, GFxMovieView* view); - DEFINE_MEMBER_FN(NextFrame_internal, void, 0x00F10BC0, UInt32 arg0, UInt32 arg1); - DEFINE_MEMBER_FN(ProcessMessage_internal, UInt32, 0x00F10B70, UIMessage* message); - DEFINE_MEMBER_FN(dtor, void, 0x00F10B10); -}; -STATIC_ASSERT(offsetof(IMenu, view) == 0x10); - -// 58 -class Console : public IMenu -{ -public: - // unk0C - 0x0C - // Flags - 0x807 - // unk14 - 2 - - void * opcodeInfo; // 30 - constructor checks that opcodes match - UnkArray unk38; // 38 - probably history linked list? - UInt32 unk50; // 50 - init'd to 0 - UInt8 unk54; // 54 - init'd to 0 - UInt8 pad55[3]; // 55 -}; - -// A8 -class BarterMenu : public IMenu -{ - // unk0C - 0 - // Flags - 0xA489 - // unk14 - 3 - GFxValue * root; // 30 - UInt64 unk38; // 38 - UInt64 unk40; // 40 - UInt64 unk48; // 48 - UInt32 unk50; // 50 - UInt32 unk54; // 54 - UInt32 unk58; // 58 - UInt32 pad5C; // 5C - UInt64 unk60; // 60 - UInt64 unk68; // 68 - UInt64 unk70; // 70 - UInt8 unk78; // 78 - UnkArray unk80; // 80 - UInt32 unk98; // 98 - UInt32 unk9C; // 9C - UInt32 unkA0; // A0 - bool bPcControlsReady; // A4 - UInt8 padA5[3]; // A5 -}; - -class BGSHeadPart; -class TESRace; - -// 138 -class RaceMenuSlider -{ -public: - RaceMenuSlider::RaceMenuSlider() {}; - RaceMenuSlider::RaceMenuSlider(UInt32 filterFlag, const char * sliderName, const char * callbackName, UInt32 sliderId, UInt32 index, UInt32 type, UInt8 unk8, float min, float max, float value, float interval, UInt32 unk13); - - enum { - kTypeHeadPart = 0, - kTypeUnk1, - kTypeDoubleMorph, - kTypePreset, - kTypeTintingMask, - kTypeHairColorPreset, - kTypeUnk6, - kTypeUnused7, - kTypeUnk8, - kTypeUnk9, - kTypeUnk10 - }; - - float min; // 00 - float max; // 04 - float value; // 08 - float interval; // 0C - UInt32 filterFlag; // 10 - UInt32 type; // 14 - const char * name; // 18 - char callback[MAX_PATH]; // 20 - UInt32 index; // 124 - UInt32 id; // 128 - UInt32 unk12C; // 12C - UInt32 unk130; // 130 - 0x7F7FFFFF - UInt8 unk134; // 134 - UInt8 pad135[3]; // 135 -}; -STATIC_ASSERT(sizeof(RaceMenuSlider) == 0x138); - -// 1A8 -class RaceSexMenu : public IMenu -{ -public: - // unk0C - 3 - // Flags - 0x709 - // unk14 - 3 - void * menuHandler; // 30 - UInt32 unk38; // 38 - UInt8 unk3C; // 3C - UInt8 unk3D; // 3D - UInt16 pad3E; // 3E - - enum { - kHeadPartsHairLine = 0, - kHeadPartsHead, - kHeadPartsEyes, - kHeadPartsHair, - kHeadPartsBeard, - kHeadPartsScars, - kHeadPartsBrows, - kNumHeadPartLists - }; - tArray headParts[kNumHeadPartLists]; // 40 - /*tArray hairline; // 28 - tArray head; // 34 - tArray eyes; // 40 - tArray hair; // 4C - tArray beard; // 58 - tArray scars; // 64 - tArray brows; // 70*/ - RaceSexCamera camera; // E8 - - float unk120[0x07]; // 120 - UInt32 pad13C; // 13C - - struct RaceComponent - { - TESRace * race; // 00 - tArray sliders; // 08 - UInt32 unk20; // 20 - UInt32 pad24; // 24 - }; - - tArray sliderData[2]; // 140 - UnkArray unk170; // 170 - UInt32 raceIndex; // 188 - UInt32 unk18C; // 18C - UInt32 unk190; // 190 - UInt32 unk194; // 194 - UInt32 unk198; // 198 - UInt8 unk19C; // 19C - UInt8 unk19D; // 19D - UInt8 unk19E; // 19E - init'd to 1 - UInt8 unk19F; // 19F - UInt8 unk1A0; // 1A0 - UInt8 unk1A1; // 1A1 - UInt8 unk1A2; // 1A2 - UInt8 unk1A3; // 1A3 - UInt8 unk1A4; // 1A4 - UInt8 unk1A5; // 1A5 - UInt16 pad1A6; // 1A6 - - - MEMBER_FN_PREFIX(RaceSexMenu); - // B3D68A070DD2D03BA80128C5FED7004330D111AC+B1 - DEFINE_MEMBER_FN(LoadSliders, void *, 0x008E6300, UInt64 unk1, UInt8 unk2); -}; -STATIC_ASSERT(offsetof(RaceSexMenu, sliderData) == 0x140); -STATIC_ASSERT(offsetof(RaceSexMenu, raceIndex) == 0x188); - -// 30598 -class MapMenu : public IMenu -{ -public: - // unk0C - 3 - // Flags - 0x9005 - // unk14 - 7 - enum - { - kMarkerType_Location = 0 - }; - - // 38 - struct MarkerData - { - // mostly wrong - TESFullName * name; // 00 - UInt32 refHandle; // 08 - UInt32 pad0C; // 0C - void * unk10; // 10 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - UInt32 unk20; // 20 - UInt32 unk24; // 24 - void * unk28; // 28 - UInt32 unk30; // 30 - UInt32 unk34; // 34 - }; - - // 30400 - struct LocalMap - { - UnkArray unk000; // 000 - GFxValue markerData; // 018 - float unk030; // 030 - float unk034; // 034 - float unk038; // 038 - float unk03C; // 03C - - // SE: this structure growed by a lot! - // FIXME: Replace when LocalMapCullingProcess has a size of 0x30360 - //LocalMapCullingProcess cullingProcess; // 40 /// ---------------- commented out but needs to be sorted out by size - UInt8 cullingProcess[0x30360]; // 40 - - // TODO: these 4 should go in their own structure - NiRenderedTexture * renderedLocalMapTexture; // 303A0 - UInt32 unk303A8; // 303A8 - UInt32 pad303AC; // 303AC - UInt64 unk303B0; // 303B0 - - GFxValue localMapRoot; // 303B8 - GFxValue mapRoot; // 303D0 - GFxMovieView * view; // 303E8 - void * localMapInputHandler; // 303F0 - UInt32 unk303F8; // 303F8 - init'd to FFFFFFFF - UInt8 unk303FC[4]; // 303FC - }; - - void * eventSinkMenuOpenCloseEvent; // 030 - void * mapCameraCallback; // 038 - UInt64 mapMoveHandler; // 040 - UInt64 mapLookHandler; // 048 - UInt64 mapZoomHandler; // 050 - UInt32 unk058; // 058 - UInt32 unk05C; // 05C - LocalMap localMap; // 060 - UInt32 unk30460; // 30460 - float unk30464; // 30464 - float unk30468; // 30468 - float unk3046C; // 3046C - tArray markers; // 30470 - UInt8 todo[0x30598 - 0x30488]; // 30488 -}; -STATIC_ASSERT(offsetof(MapMenu, localMap) == 0x60); -STATIC_ASSERT(offsetof(MapMenu::LocalMap, cullingProcess) == 0x40); -STATIC_ASSERT(sizeof(MapMenu::LocalMap::cullingProcess) == 0x30360); -STATIC_ASSERT(offsetof(MapMenu::LocalMap, renderedLocalMapTexture) == 0x303A0); -STATIC_ASSERT(offsetof(MapMenu, markers) == 0x30470); -STATIC_ASSERT(sizeof(MapMenu) == 0x030598); - -// 28 -class HUDObject -{ -public: - HUDObject::HUDObject(GFxMovieView* movie) - { - if (movie) - InterlockedIncrement(&movie->refCount); - view = movie; - } - virtual ~HUDObject(void) - { - object.CleanManaged(); - - GFxMovieView * thisView = view; - if (thisView) - thisView->ForceCollectGarbage(); - } - - virtual void Update(void) = 0; // Called per-frame - virtual UInt8 Unk_02(void * unk1) { return 0; }; - virtual void * Unk_03(void * unk1) { return Impl_Fn03(unk1); }; - virtual void Unk_04(void) { }; // No implementation? - - GFxMovieView * view; // 08 - GFxValue object; // 10 - - MEMBER_FN_PREFIX(HUDObject); - DEFINE_MEMBER_FN_0(dtor, void, 0x008B6170); - DEFINE_MEMBER_FN_1(Impl_Fn03, void *, 0x008B0FD0, void * unk1); - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free); -}; -STATIC_ASSERT(sizeof(HUDObject) == 0x28); - -// 40 -class Compass : public HUDObject -{ -public: - UInt64 unk28; // 28 - UInt32 unk30; // 30 - UInt32 unk34; // 34 - UInt64 unk38; // 38 -}; -STATIC_ASSERT(sizeof(Compass) == 0x40); - -// B8 -class FloatingQuestMarker : public HUDObject -{ -public: - - UInt8 todo[0xB8 - 0x28]; // 28 - -}; - -// 60 -class Notification -{ -public: - Notification() : type(0), quest(nullptr), word(nullptr), time(0) { } - Notification(const Notification& other); - ~Notification() { dtor(); } - - BSString text; // 00 - size 10 - BSString status; // 10 - size 10 - BSFixedString sound; // 20 - size 08 - tArray objectives; // 28 - size 18 - UInt64 type; // 40 - TESQuest* quest; // 48 - TESWordOfPower* word; // 50 - UInt32 time; // 58 - g_gameTime + iObjectivesWaitTime - - DEFINE_MEMBER_FN_0(dtor, void, 0x008B61E0); -}; - -// 78 -class HUDNotifications : public HUDObject -{ -public: - tArray queue; // 28 - size 18 - GFxValue object; // 40 - size 18 - .Invoke("CanShowNotification") - GFxValue array; // 58 - size 18 - .GetType() == 7 - UInt32 time; // 70 - last meter update time - float points; // 74 - cached meter progress -}; - -// 88 -class EnemyHealth : public HUDObject -{ -public: - UInt32 handle; // 28 - UInt32 unk2C; // 2C - UInt32 unk30; // 30 - UInt32 unk34; // 34 - GFxValue unk38; // 38 - GFxValue unk50; // 50 - GFxValue text; // 68 - UInt32 unk5C; // 5C - UInt8 unk80; // 80 - UInt8 unk81[7]; // 81 - - NiPointer GetTarget() const; -}; -STATIC_ASSERT(offsetof(EnemyHealth, handle) == 0x28); - -// 98 -class StealthMeter : public HUDObject -{ -public: - - UInt8 todo[0x98 - 0x28]; // 28 -}; - -// 30 -class HUDChargeMeter : public HUDObject -{ -public: - - float unk28; // 28 - init'd to 100 - float unk2C; // 2C - init'd to 100 -}; - -// 50 -class HUDMeter : public HUDObject -{ -public: - virtual double GetMaxValue(void); - - char * setMeterPercent; // 28 - char * startBlinking; // 30 - char * fadeOut; // 38 - float unk40; // 40 - init'd to 100 - UInt32 unk44; // 44 - UInt64 unk48; // 48 - TODO: may be 32 -}; -STATIC_ASSERT(sizeof(HUDMeter) == 0x50); - -// 50 -class ActorValueMeter : public HUDMeter -{ -public: - -}; - -// 50 -class ShoutMeter : public HUDMeter -{ -public: - -}; - -// 98 -class HUDMenu : public IMenu -{ -public: - BSTEventSink unk30; // 30 - UserEventEnabledEvent - void *unk38; // 38 - New in SE - tArray hudComponents; // 40 - ActorValueMeter *unk58; // 58 - ActorValueMeter *unk60; // 60 - ActorValueMeter *unk68; // 68 - ShoutMeter *unk70; // 70 - UInt64 unk78; // 78 - UInt32 unk80; // 80 - UInt32 unk84; // 84 - UInt64 unk88; // 88 - UInt8 unk90; // 90 - UInt8 unk91[7]; // 91 -}; -STATIC_ASSERT(sizeof(HUDMenu) == 0x98); - -// 38 -class CraftingMenu : public IMenu -{ -public: - - UInt64 unk30; // 30 -}; - -// ??? -class CraftingSubMenu : public FxDelegateHandler -{ -public: - virtual ~CraftingSubMenu(); - - UInt64 unk10; // 010 - GFxMovieView* view; // 018 - // ... -}; - -STATIC_ASSERT(offsetof(CraftingSubMenu, view) == 0x018); - -// 220 -class EnchantConstructMenu : public CraftingSubMenu -{ -public: - enum - { - kFilterFlag_EnchantWeapon = 0x1, - kFilterFlag_DisenchantWeapon = 0x2, - kFilterFlag_EnchanteArmor = 0x4, - kFilterFlag_DisenchantArmor = 0x8, - kFilterFlag_EffectWeapon = 0x10, - kFilterFlag_EffectArmor = 0x20, - kFilterFlag_SoulGem = 0x40 - }; - - // 18 - class CategoryListEntry - { - public: - virtual ~CategoryListEntry(); - - virtual void Unk1(); - virtual void Unk2(); - virtual void Unk3(); // pure - virtual void SetData(GFxValue* dataContainer); - - // void ** _vtbl; // 00 - UInt32 unk08; // 08 - UInt32 filterFlag; // 0C - UInt8 bEquipped; // 10 - UInt8 bEnabled; // 11 - UInt8 pad12[6]; // 12 - - MEMBER_FN_PREFIX(CategoryListEntry); - DEFINE_MEMBER_FN(SetData, void, 0x0089E570, GFxValue* target); - - void SetData_Extended(EnchantConstructMenu* subMenu, GFxValue* target); - }; - - // 020 - class ItemChangeEntry : public CategoryListEntry - { - public: - InventoryEntryData* data; // 18 - }; - - // 028 - class EnchantmentEntry : public CategoryListEntry - { - public: - EnchantmentItem* data; // 18 - float unk20; // 20 - init'd to 1 - float unk24; // 24 - init'd to 1 - }; - - // ... -}; - -// 168 -class SmithingMenu : public CraftingSubMenu -{ -public: - - - // ... -}; - -// 160 -class ConstructibleObjectMenu : public CraftingSubMenu -{ -public: - // 08 - struct EntryData - { - BGSConstructibleObject* object; // 00 - UInt32 filterFlag; // 08 - }; - - // ... -}; - -// Declared outside of AlchemyMenu for forward decls -// 08 -struct AlchemyEffectCategory -{ - UInt32 formId; - UInt32 unk1; -}; - -// 1A0 -class AlchemyMenu : public CraftingSubMenu -{ -public: - // 10 - struct EntryData - { - InventoryEntryData* data; // 00 - UInt32 filterFlag; // 08 - UInt8 bEquipped; // 0C - UInt8 bEnabled; // 0D - UInt16 pad0E; // 0E - }; - - // ... -}; - - - -// HUDMenu -// unk0C - 2 -// Flags - 0x18902 -// unk14 - 0x12 - -// DialogueMenu -// unk0C - 3 -// Flags - 0x4400 -// unk14 - 1 - -// MainMenu -// unk0C - 9 -// Flags - 0x581 -// unk14 - 1 - -// MagicMenu -// unk0C - 0 -// Flags - 0xA489 -// unk14 - 3 - -// InventoryMenu -// unk0C - 0 -// Flags - 0x4400 -// unk14 - 0x12 - -//// menu management - -// 10 -class IUIMessageData -{ -public: - virtual ~IUIMessageData(); - - // void ** _vtbl; // 00 - UInt8 unk08; // 08 - UInt8 unk09; // 09 - UInt8 pad0A[6]; // 0A -}; - -// 28 -class BSUIMessageData : public IUIMessageData -{ -public: - BSString * unk08; // 10 - StringCache::Ref unk18; // 18 - UInt32 unk20; // 20 - UInt32 pad24; // 24 -}; - -// 18 -class RefHandleUIData : public IUIMessageData -{ -public: - UInt32 refHandle; // 10 - UInt32 pad14; // 14 -}; - -class HUDData : public IUIMessageData -{ -public: - enum MessageType - { - kType_ShowMessage = 1, - kType_SetCrosshairTarget = 3, - kType_SetLoadDoorInfo = 4, - kType_ShowSubtitle = 5, - kType_HideSubtitle = 6, - kType_ShowArrowCount = 7, - kType_HideArrowCount = 8, - kType_SetSubtitlesEnabled = 9, - kType_QuestStarted = 14, - kType_QuestCompleted = 15, - kType_QuestUpdated = 16, - kType_NewObjective = 17, - kType_ObjectiveCompleted = 18, - kType_ObjectiveFailed = 19, - kType_SkillIncreased = 20, - kType_WorldOfPowerLearned = 21, - kType_DragonSoulAbsorbed = 22, - kType_ShowElements = 23, - kType_LocationDiscoverd = 26, - kType_Favor = 27, - kType_ValidateCrosshair = 28, - kType_SetLocationName = 29, - kType_ShowTutrialHintText = 30, - kType_SetCrosshairEnabled = 31, - kType_Unk32 = 32, - kType_RefreshActivateButtonArt = 33, - kType_Unk34 = 34 - - }; - - UInt32 type; // 10 - UInt8 pad14[4]; // or UInt64 with 'type'? - BSString text; // 18 - size 10 - void * unk14; // 28 - size 8 - TESQuest* quest; // 30 - size 8 - TESWordOfPower* word; // 38 - size 8 - bool unk40; // 40 - some flag - UInt8 pad41[3]; - UInt32 unk44; // 44 - location type - -}; - -typedef void * (*_CreateUIMessageData)(BSFixedString * name); -extern RelocAddr<_CreateUIMessageData> CreateUIMessageData; - -// 20 -// ### pool added in 1.3 (or maybe 1.2) -class UIMessage -{ -public: - enum - { - kMessage_Refresh = 0, // used after ShowAllMapMarkers - kMessage_Open, - kMessage_PreviouslyKnownAsClose, - kMessage_Close - }; - - StringCache::Ref strData; // 00 - UInt32 message; // 08 - UInt32 pad0C; // 0C - IUIMessageData * objData; // 10 - something with a virtual destructor - UInt8 isPooled; // 18 - UInt8 pad19[7]; // 19 -}; - -// 08 -template -class BSTMessageQueue -{ -public: - BSTMessageQueue(); - virtual ~BSTMessageQueue(); - - virtual bool Push(T * obj); // pure, add (loop until lock taken, call Fn05) - virtual bool TryPush(T * obj); // pure, try add (try to take lock, return false if already taken, else call Fn05) - virtual bool Pop(T * obj); // pure, remove (loop until lock taken, call Fn06) - virtual bool TryPop(T * obj); // pure, try remove (try to take lock, return false if already taken, else call Fn06) - -// void ** _vtbl; // 00 -}; - -// 10 -template -class BSTCommonMessageQueue : public BSTMessageQueue -{ -protected: - virtual bool PushInternal(T * obj); // pure - virtual bool PopInternal(T * obj); // pure - -public: - volatile UInt32 lock; // 08 - UInt32 pad0C; // 0C -}; - -template -class BSTCommonScrapHeapMessageQueue : public BSTCommonMessageQueue -{ -public: - BSTCommonScrapHeapMessageQueue(); - virtual ~BSTCommonScrapHeapMessageQueue(); - - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt64 unk20; // 20 -}; - -// 10 + sizeof(T) * T_len + 10, aligned to 8 -template -class BSTCommonStaticMessageQueue : public BSTCommonMessageQueue -{ -public: - T data[T_len]; // 010 - UInt32 numEntries; // 330 - offsets are for - UInt32 writePtr; // 334 - UInt32 readPtr; // 338 -}; - -// B80 -class UIManager -{ -public: - enum - { - kPoolSize = 0x40, - }; - - typedef BSTCommonStaticMessageQueue MessageQueue; - - UInt64 unk000; // 000 - MessageQueue messages; // 008 - UInt8 pad348[0x378 - 0x348]; // 348 - UInt32 poolUsed; // 378 - UInt32 pad37C; // 37C - UIMessage messagePool[kPoolSize]; // 380 - - MEMBER_FN_PREFIX(UIManager); - // this takes ownership of the message ptr -// DEFINE_MEMBER_FN(AddMessage, void, 0x004503E0, UIMessage * msg); // old 1.1 implementation - // 1.3 uses a little non-thread-safe pool of UIMessages to wrap around the nicely thread-safe BSTMessageQueue it gets added to - - DEFINE_MEMBER_FN(AddMessage, void, 0x0016EC10, StringCache::Ref * strData, UInt32 msgID, void * objData); - DEFINE_MEMBER_FN(CreateUIMessageData, IUIMessageData *, 0x00F09F80, const BSFixedString &type); - - static UIManager * GetSingleton(void) - { - // 5DCBE2588F11BA3D68C45F56DC0FC5D806409F85+C3 - static RelocPtr g_UIManager(0x01F5C3F0); - return *g_UIManager; - } - - // Used by Hooks_UI - void ProcessCommands(void); - void QueueCommand(UIDelegate* cmd); - void QueueCommand(UIDelegate_v1* cmd); - - DEFINE_MEMBER_FN(ProcessEventQueue_HookTarget, void, 0x00F09E00); -}; -STATIC_ASSERT(offsetof(UIManager, pad348) == 0x348); -STATIC_ASSERT(sizeof(UIManager) == 0xB80); - -// 258 -class UIStringHolder -{ -public: - void * unk00; // 000 - BSFixedString faderData; // 008 "FaderData" - BSFixedString hudData; // 010 "HUDData" - BSFixedString hudCamData; // 018 "HUDCamData" - BSFixedString floatingQuestMarkers; // 020 "FloatingQuestMarkers" - BSFixedString consoleData; // 028 "ConsoleData" - BSFixedString quantityData; // 030 "QuantityData" - BSFixedString messageBoxData; // 038 "MessageBoxData" - BSFixedString bsUIScaleformData; // 040 "BSUIScaleformData" - BSFixedString bsUIMessageData; // 048 "BSUIMessageData" - BSFixedString bsUIAnalogData; // 050 "BSUIAnalogData" - BSFixedString inventoryUpdateData; // 058 "InventoryUpdateData" - BSFixedString refHandleUIData; // 060 "RefHandleUIData" - BSFixedString tesFormUIData; // 068 "TESFormUIData" - BSFixedString loadingMenuData; // 070 "LoadingMenuData" - BSFixedString kinectStateData; // 078 "KinectStateChangeData" - BSFixedString kinectUserEventData; // 080 "KinectUserEventData" - BSFixedString inventoryMenu; // 088 "InventoryMenu" - BSFixedString console; // 090 "Console" - BSFixedString dialogueMenu; // 098 "Dialogue Menu" - BSFixedString hudMenu; // 0A0 "HUD Menu" - BSFixedString mainMenu; // 0A8 "Main Menu" - BSFixedString messageBoxMenu; // 0B0 "MessageBoxMenu" - BSFixedString cursorMenu; // 0B8 "Cursor Menu" - BSFixedString faderMenu; // 0C0 "Fader Menu" - BSFixedString magicMenu; // 0C8 "MagicMenu" - BSFixedString topMenu; // 0D0 "Top Menu" - BSFixedString overlayMenu; // 0D8 "Overlay Menu" - BSFixedString overlayInteractionMenu; // 0E0 "Overlay Interaction Menu" - BSFixedString loadingMenu; // 0E8 "Loading Menu" - BSFixedString tweenMenu; // 0F0 "TweenMenu" - BSFixedString barterMenu; // 0F8 "BarterMenu" - BSFixedString giftMenu; // 100 "GiftMenu" - BSFixedString debugTextMenu; // 108 "Debug Text Menu" - BSFixedString mapMenu; // 110 "MapMenu" - BSFixedString lockpickingMenu; // 118 "Lockpicking Menu" - BSFixedString quantityMenu; // 120 "Quantity Menu" - BSFixedString statsMenu; // 128 "StatsMenu" - BSFixedString containerMenu; // 130 "ContainerMenu" - BSFixedString sleepWaitMenu; // 138 "Sleep/Wait Menu" - BSFixedString levelUpMenu; // 140 "LevelUp Menu" - BSFixedString journalMenu; // 148 "Journal Menu" - BSFixedString bookMenu; // 150 "Book Menu" - BSFixedString favoritesMenu; // 158 "FavoritesMenu" - BSFixedString raceSexMenu; // 160 "RaceSex Menu" - BSFixedString craftingMenu; // 168 "Crafting Menu" - BSFixedString trainingMenu; // 170 "Training Menu" - BSFixedString mistMenu; // 178 "Mist Menu" - BSFixedString tutorialMenu; // 180 "Tutorial Menu" - BSFixedString creditsMenu; // 188 "Credits Menu" - BSFixedString modManagerMenu; // 190 "Mod Manager Menu" - NEW IN SE - BSFixedString titleSequenceMenu; // 198 "TitleSequence Menu" - BSFixedString consoleNativeUIMenu; // 1A0 "Console Native UI Menu" - BSFixedString kinectMenu; // 1A8 "Kinect Menu" - BSFixedString loadWaitSpinner; // 1B0 "LoadWaitSpinner" - NEW IN SE - BSFixedString streamingInstallMenu; // 1B8 "StreamingInstallMenu" - NEW IN SE - BSFixedString textWidget; // 1C0 "TextWidget" - BSFixedString buttonBarWidget; // 1C8 "ButtonBarWidget" - BSFixedString graphWidget; // 1D0 "GraphWidget" - BSFixedString textureWidget; // 1D8 "TextWidget" - BSFixedString uiMenuOK; // 1E0 "UIMenuOK" - BSFixedString uiMenuCancel; // 1E8 "UIMenuCancel" - BSFixedString showText; // 1F0 "Show Text" - BSFixedString hideText; // 1F8 "Hide Text" - BSFixedString showList; // 200 "Show List" - BSFixedString voiceReady; // 208 "Voice Ready" - BSFixedString dmfoStr; // 210 "DMFOStr" - BSFixedString showJournal; // 218 "Show Journal" - BSFixedString journalSettingsSaved; // 220 "Journal Settings Saved" - BSFixedString closeMenu; // 228 "CloseMenu" - BSFixedString closingAllMenus; // 230 "Closing All Menus" - BSFixedString refreshMenu; // 238 "RefreshMenu" - BSFixedString cancelLoading; // 240 "CancelLoading" - NEW IN SE - BSFixedString menuTextureDegradeEvent; // 248 "Menu Texture Degrade Event" - BSFixedString diamondMarker; // 250 "" - - static UIStringHolder * GetSingleton(void) - { - // 5DCBE2588F11BA3D68C45F56DC0FC5D806409F85+BC - static RelocPtr g_UIStringHolder(0x01F5C3F8); - return *g_UIStringHolder; - } -}; - -// 160 -class Inventory3DManager -{ -public: - virtual ~Inventory3DManager(); - - static Inventory3DManager * GetSingleton(void) - { - // 6BC34CC398831C8B8BE5BE20EC213B5BE7C47A7A+2E - static RelocPtr g_inventory3DManager(0x02FC2DF0); - return *g_inventory3DManager; - } - - // void ** _vtbl; // 00 - UInt32 unk08; // 08 - UInt8 unk0C; // 0C - This appears to be 1 when a menu is open - UInt8 unk0D; // 0D - UInt16 pad0E; // 0E - UInt32 unk10; // 10 - float unk14[8]; // 14 - UInt32 pad34; // 34 - TESObjectREFR * object; // 38 - BaseExtraList baseExtraList; // 40 - Only valid when NewInventoryMenuItemLoadTask is pending - UInt32 unk58; // 58 - UInt32 pad5C; // 5C - - // 20 - struct ItemData - { - TESForm * form1; - TESForm * form2; - NiNode * node; - UInt32 unk18; - float unk1C; - }; - - ItemData itemData[7]; // 60 - UInt32 meshCount; // 140 - Number of ItemData where there is a valid BSFadeNode - UInt32 pad144; // 144 - UInt32 unk148; // 148 - UInt32 unk14C; // 14C - void* unk150; // 150 - Pointer to NewInventoryMenuItemLoadTask when loading - UInt8 unk158; - UInt8 unk159; // Somekind of mode (0 for MagicMenu) - UInt8 unk15A; - UInt8 pad15B[5]; - - MEMBER_FN_PREFIX(Inventory3DManager); - DEFINE_MEMBER_FN(UpdateItem3D, void, 0x008B84E0, InventoryEntryData * objDesc); - DEFINE_MEMBER_FN(UpdateMagic3D, void, 0x008B8510, TESForm * form, UInt32 unk1); - DEFINE_MEMBER_FN(Clear3D, void, 0x008B88D0); - DEFINE_MEMBER_FN(Render, UInt32, 0x008B81F0); -}; - -STATIC_ASSERT(offsetof(Inventory3DManager, unk14) == 0x14); -STATIC_ASSERT(offsetof(Inventory3DManager, object) == 0x38); -STATIC_ASSERT(offsetof(Inventory3DManager, unk158) == 0x158); - -// 018 -class MenuTableItem -{ -public: - BSFixedString name; // 000 - IMenu * menuInstance; // 008 0 if the menu is not currently open - void * menuConstructor; // 010 - - bool operator==(const MenuTableItem & rhs) const { return name == rhs.name; } - bool operator==(const BSFixedString a_name) const { return name == a_name; } - operator UInt64() const { return (UInt64)name.data; } - - static inline UInt32 GetHash(BSFixedString * key) - { - UInt32 hash; - CalculateCRC32_64(&hash, (UInt64)key->data); - return hash; - } - - void Dump(void) - { - _MESSAGE("\t\tname: %s", name); - _MESSAGE("\t\tinstance: %08X", menuInstance); - } -}; - -// 1C8 -class MenuManager -{ - typedef tHashSet MenuTable; - - // 030-040 - struct Unknown3 - { - UInt64 unk00; // 000 - New in SE. Not init'd? - - UInt64 frequency; // 008 - - UInt64 unk_010; // 010 (= 0) - UInt32 unk_018; // 018 (= 0) - UInt32 unk_01C; // 01C (= 0) - UInt32 unk_020; // 020 (= 0) - UInt32 unk_024; // 024 (= 0) - float unk_028; // 028 (= frequency related) - - UInt32 unk_02C; // 02C - UInt32 unk_030; // 030 - - UInt32 unk_034; // 034 (= 0) - UInt16 unk_038; // 038 - UInt8 unk_03A; // 03A (= 0) - UInt8 pad[5]; // 03B - }; - STATIC_ASSERT(sizeof(Unknown3) == 0x40); - -private: - UInt64 unk_000; // 000 - - EventDispatcher menuOpenCloseEventDispatcher; // 008 - EventDispatcher menuModeChangeEventDispatcher; // 060 - EventDispatcher unk_064; // 0B8 - New in 1.6.87.0 - Kinect related? - - UnkArray menuStack; // 110 - MenuTable menuTable; // 128 (Entries ptr at 150) - SimpleLock menuTableLock; // 158 - UInt32 numPauseGame; // 160 (= 0) += 1 if (imenu->flags & 0x0001) - UInt32 numItemMenu; // 164 (= 0) += 1 if (imenu->flags & 0x2000) - UInt32 numPreventGameLoad; // 168 (= 0) += 1 if (imenu->flags & 0x0080) - UInt32 numDoNotPreventSaveGame; // 16C (= 0) += 1 if (imenu->flags & 0x0800) - UInt32 numStopCrosshairUpdate; // 170 (= 0) += 1 if (imenu->flags & 0x4000) - UInt32 numFlag8000; // 174 (= 0) += 1 if (imenu->flags & 0x8000) - UInt32 numFlag20000; // 178 (= 0) = 1 if (imenu->flags & 0x20000) - UInt8 numModal; // 17C (= 0) = 1 if (imenu->flags & 0x10) - UInt8 pad_17D[3]; // 17D - Unknown3 unk_180; // 180 - bool showMenus; // 1C0 (= 0) - bool unk_1C1; // 1C1 (= 0) - char pad[6]; // 1C2 - -public: - typedef IMenu* (*CreatorFunc)(void); - -private: - MEMBER_FN_PREFIX(MenuManager); - DEFINE_MEMBER_FN(IsMenuOpen, bool, 0x00F05300, BSFixedString * menuName); - DEFINE_MEMBER_FN(Register_internal, void, 0x00F06FD0, const char * name, CreatorFunc creator); - -public: - - static MenuManager * GetSingleton(void) - { - // 0060C371BC22FE1665DD3BA10816084EEC6FAA3F+4 - static RelocPtr g_menuManager(0x01F5A4A0); - return *g_menuManager; - } - - EventDispatcher * MenuOpenCloseEventDispatcher() - { - return &menuOpenCloseEventDispatcher; - } - - bool IsMenuOpen(BSFixedString * menuName); - IMenu * GetMenu(BSFixedString * menuName); - GFxMovieView * GetMovieView(BSFixedString * menuName); - void ShowMenus(bool show) { showMenus = show; } - bool IsShowingMenus() const { return showMenus; } - - typedef IMenu* (*CreatorFunc)(void); - - void Register(const char* name, CreatorFunc creator) - { - CALL_MEMBER_FN(this, Register_internal)(name, creator); - } -}; -STATIC_ASSERT(sizeof(MenuManager) == 0x1C8); diff --git a/source/fs.dll/skse64/skse64/GameObjects.cpp b/source/fs.dll/skse64/skse64/GameObjects.cpp deleted file mode 100644 index 3744f868..00000000 --- a/source/fs.dll/skse64/skse64/GameObjects.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include "GameObjects.h" -#include "GameData.h" -#include "GameRTTI.h" - -UInt32 TESObjectBOOK::Data::GetSanitizedType(void) -{ - if(flags & kType_Spell) - return kType_Spell; - if(flags & kType_Skill) - return kType_Skill; - - return kType_None; -} - -BGSHeadPart * TESNPC::GetCurrentHeadPartByType(UInt32 type) -{ - BGSHeadPart * facePart = NULL; - if(CALL_MEMBER_FN(this, HasOverlays)()) { - facePart = GetHeadPartOverlayByType(type); - } else { - facePart = GetHeadPartByType(type); - } - - return facePart; -} - -BGSHeadPart * TESNPC::GetHeadPartByType(UInt32 type) -{ - if(headparts) { - for(UInt32 i = 0; i < numHeadParts; i++) { - if(headparts[i] && headparts[i]->type == type) - return headparts[i]; - } - } - - return NULL; -} - -BGSHeadPart * TESNPC::GetHeadPartOverlayByType(UInt32 type) -{ - UInt32 numOverlays = GetNumActorBaseOverlays(this); - BGSHeadPart ** overlays = GetActorBaseOverlays(this); - if(overlays) { - for(UInt32 i = 0; i < numOverlays; i++) { - if(overlays[i]->type == type) { - return overlays[i]; - } - } - } - - return NULL; -} - - -TESNPC * TESNPC::GetRootTemplate() -{ - TESNPC * node = NULL; - node = nextTemplate; - if (node) { - while (node->nextTemplate) - node = node->nextTemplate; - } - - return node; -} - -void TESObjectARMA::GetNodeName(char * dstBuff, TESObjectREFR * refr, TESObjectARMO * armor, float weightOverride) -{ - float weight = 100.0; - TESNPC * npc = DYNAMIC_CAST(refr->baseForm, TESForm, TESNPC); - if(npc && npc->nextTemplate) { - TESNPC * temp = npc->GetRootTemplate(); - if(temp) { - weight = temp->weight; - } - } - else - weight = CALL_MEMBER_FN(refr, GetWeight)(); - - weight /= 100.0; - if(weightOverride >= 0.0) // Determines whether to factor weight into the name, -1 true, 1 false - weight = weightOverride; - - weight *= 100.0; - - UInt32 sex = npc ? CALL_MEMBER_FN(npc, GetSex)() : 0; - /*sprintf_s(dstBuff, MAX_PATH, "%s (%08X)[%d]/%s (%08X) [%2.0f%%]", - this->Unk_32(), // I really have no idea why they used a string here for a boolean value, probably legacy code - this->formID, - sex, - armor->Unk_32(), - armor->formID, - weight);*/ - sprintf_s(dstBuff, MAX_PATH, " (%08X)[%d]/ (%08X) [%2.0f%%]", - this->formID, - sex, - armor->formID, - weight); -} - -void TESObjectWEAP::GetNodeName(char * dstBuff) -{ - /*sprintf_s(dstBuff, MAX_PATH, "%s %s (%08X)", - "Weapon", - this->Unk_34(), // I really have no idea why they used a string here for a boolean value, probably legacy code - this->formID);*/ - sprintf_s(dstBuff, MAX_PATH, "%s (%08X)", - "Weapon", - this->formID); -} - -bool HasArmorRace(TESRace * sourceRace, TESRace * targetRace) -{ - if(sourceRace == targetRace) - return true; - - // Check if this race inherits the source race - TESRace * armorRace = sourceRace->armorRace; - while(armorRace) { - if(armorRace == targetRace) - return true; - armorRace = armorRace->armorRace; - } - - return false; -} - -bool TESObjectARMA::isValidRace(TESRace * sourceRace) const -{ - // Found race is the race this armor is designed for, or inherits a race this armor is designed for - if(HasArmorRace(sourceRace, race.race)) - return true; - - for(UInt32 i = 0; i < additionalRaces.count; i++) - { - TESRace * currentRace = NULL; - additionalRaces.GetNthItem(i, currentRace); - - // Source race is a found race, or inherits one of the found races - if(HasArmorRace(sourceRace, currentRace)) - return true; - } - - return false; -} - -BSShaderTextureSet * BSShaderTextureSet::Create() -{ - typedef BSShaderTextureSet * (* _BSShaderTextureSet_Create)(void); - // 898A3CAF8F24D9FDC30B00DA3DC5BDF182682C1C+63 - static RelocAddr <_BSShaderTextureSet_Create> BSShaderTextureSet_Create(0x0140B7A0); - - return BSShaderTextureSet_Create(); -} - -void TESNPC::SetFaceTexture(BGSTextureSet * textureSet) -{ - if(!headData) - { - if(textureSet) - { - HeadData * newHeadData = (HeadData *)Heap_Allocate(sizeof(HeadData)); - if(newHeadData) { - newHeadData->hairColor = NULL; - newHeadData->headTexture = NULL; - } else { - newHeadData = NULL; - } - headData = newHeadData; - } - } - if(headData) - headData->headTexture = textureSet; -} - -void TESNPC::SetHairColor(BGSColorForm * hairColor) -{ - if(!headData) - { - if(hairColor) - { - HeadData * newHeadData = (HeadData *)Heap_Allocate(sizeof(HeadData)); - if(newHeadData) { - newHeadData->hairColor = NULL; - newHeadData->headTexture = NULL; - } else { - newHeadData = NULL; - } - headData = newHeadData; - } - } - if(headData) - headData->hairColor = hairColor; -} diff --git a/source/fs.dll/skse64/skse64/GameObjects.h b/source/fs.dll/skse64/skse64/GameObjects.h deleted file mode 100644 index 66f7d73b..00000000 --- a/source/fs.dll/skse64/skse64/GameObjects.h +++ /dev/null @@ -1,2039 +0,0 @@ -#pragma once - -#include "skse64/GameForms.h" -#include "skse64/NiObjects.h" -#include "skse64/GameEvents.h" - -class Character; - -// TESObject and children - -// 20 -class TESObject : public TESForm -{ -public: - virtual UInt32 Unk_39(void); - virtual bool Unk_3A(void); - virtual UInt32 Unk_3B(void); - virtual bool Unk_3C(void); - virtual void Unk_3D(UInt32 arg); - virtual UInt32 Unk_3E(UInt32 arg0, UInt32 arg1); - virtual void Unk_3F(void * arg); - virtual bool Unk_40(void); - virtual bool Unk_41(void); - virtual void Unk_42(void); - virtual void Unk_43(UInt32 arg0, UInt32 arg1); - virtual UInt32 Unk_44(void); - virtual UInt32 Unk_45(void); - virtual void * Unk_46(void); -}; - -// 30 -class TESBoundObject : public TESObject -{ -public: - struct Bound - { - UInt16 x; - UInt16 y; - UInt16 z; - }; - - virtual void Unk_47(UInt32 arg); - virtual UInt32 Unk_48(void); - virtual UInt32 Unk_49(UInt32 arg); // return Unk_3E(arg, 0); - // model-related? - virtual bool Unk_4A(void); - virtual bool Unk_4B(void * arg0, BSString * dst); // steal/take string - virtual bool Unk_4C(void * arg0, UInt8 arg1, UInt32 arg2, float arg3); - virtual void Unk_4D(UInt32 arg); - virtual void Unk_4E(UInt32 arg); - virtual void Unk_4F(void); - virtual void Unk_50(void); - virtual void Unk_51(void); - - Bound bounds; // 20 - Bound bounds2; // 26 (not 28!) -}; - -STATIC_ASSERT(offsetof(TESBoundObject, bounds2) == 0x26); -STATIC_ASSERT(sizeof(TESBoundObject) == 0x30); - -// 48 -class BGSAcousticSpace : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_AcousticSpace }; - - TESForm * loopingSound; // 30 - TESForm * soundRegion; // 38 - TESForm * reverbType; // 40 -}; - -// 80 -class BGSAddonNode : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_AddonNode }; - - // parents - TESModelTextureSwap texSwap; // 30 - - // members - UInt32 unk68; // 68 - UInt64 unk70; // 70 - UInt8 unk78[4]; // 78 - UInt32 unk7C; // 7C -}; - -// 70 -class BGSArtObject : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Art }; - - // parents - TESModelTextureSwap texSwap; // 30 - - // members - UInt32 unk68; // 68 -}; - -// This class was already removed in Skyrim32 and doesn't apply to SE, I'll leave it commented -/* -// 34 -class BGSCloudClusterForm : public TESBoundObject -{ -public: - // parents - TESModel model; // 20 -}; -*/ - -// 60 -class BGSDualCastData : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_DualCastData }; - - // 30 - struct Data - { - UInt64 unk00; // 00 - UInt64 unk08; // 08 - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt64 unk20; // 20 - UInt32 unk28; // 28 - UInt32 pad2C; // 2C - }; - - Data unk30; // 30 -}; - -// E8 -class BGSExplosion : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Explosion }; - - // parents - TESFullName fullName; // 30 - TESModel model; // 40 - TESEnchantableForm enchantment; // 68 - BGSPreloadable preloadable; // 80 - TESImageSpaceModifiableForm imageSpaceModifier; // 88 - - // members - - // 50 - struct Data - { - UInt64 unk00; // 00 - UInt64 unk08; // 08 - UInt64 unk10; // 10 - UInt64 unk18; // 18 - UInt64 unk20; // 20 - UInt64 unk28; // 28 - UInt32 unk30; // 30 - UInt32 unk34; // 34 - UInt32 unk38; // 38 - UInt32 unk3C; // 3C - UInt32 unk40; // 40 - UInt32 unk44; // 44 - UInt32 unk48; // 48 - UInt32 unk4C; // 4C - }; - - Data data; // 98 -}; - -// B8 -class BGSHazard : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Hazard }; - - // parents - TESFullName fullName; // 30 - TESModel model; // 40 - BGSPreloadable preloadable; // 68 - TESImageSpaceModifiableForm imageSpaceModifier; // 70 - - // members - - // 38 - struct Data - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - float unk10; // 10 - UInt32 unk14; // 14 - UInt64 unk18; // 18 - UInt64 unk20; // 20 - UInt64 unk28; // 28 - UInt64 unk30; // 30 - }; - - Data unk80; // 80 -}; - -// 78 -class BGSIdleMarker : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_IdleMarker }; - - // parents - TESModel model; // 30 - BGSIdleCollection idle; // 58 -}; - -// B8 -class BGSNote : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Note }; - - // parents - TESModel model; // 30 - TESFullName fullName; // 58 - TESIcon icon; // 68 - BGSPickupPutdownSounds sounds; // 78 - - // members - struct Entry - { - void * data; - Entry * next; - }; - - UInt64 unk90; // 90 - UInt64 unk98; // 98 - Entry unkA0; // A0 - UInt8 unkB0; // B0 - UInt8 unkB1; // B1 - UInt8 padB2[6]; // B2 -}; - -// 138 -class BGSProjectile : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Projectile }; - - // parents - TESFullName fullName; // 030 - TESModel model; // 040 - BGSPreloadable preloadable; // 068 - BGSDestructibleObjectForm destructible; // 070 - - // members - - // 88 - struct Data - { - UInt32 unk00; // 00 - init'd to 65536 - UInt32 unk04; // 04 - float speed; // 08 - init'd to 1000 - float range; // 0C - init'd to 10000 - void* unk10; // 10 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - UInt64 unk20; // 20 - UInt64 unk28; // 28 - UInt64 unk30; // 30 - BGSSoundDescriptorForm* sound; // 38 - UInt32 unk40; // 40 - float fadeDuration; // 44 - init'd to 0.5 - float impactForce; // 48 - UInt32 pad4C; // 4C - UInt64 unk50; // 50 - UInt64 unk58; // 58 - UInt64 unk60; // 60 - float coneSpread; // 68 - float collisionRadius; // 6C - init'd to 10 - UInt32 unk70; // 70 - probably "lifetime" (float) - float relaunchInterval; // 74 - UInt64 unk78; // 78 - UInt64 unk80; // 80 - }; - - Data data; // 080 - TESModel model108; // 108 - UInt32 unk130; // 130 - init'd to 1 -}; - -// 68 -class BGSStaticCollection : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_StaticCollection }; - - // parents - TESModelTextureSwap texSwap; // 30 -}; - -class BSShaderTextureSet; - -// 10 -// TODO: virtual functions need check -class BSTextureSet : public NiObject -{ -public: - virtual const char * GetTexturePath(UInt32 index); - virtual void SetTexture(UInt32 index, /*NiSourceTexture*/void * texture); - virtual void SetTexturePath(UInt32 index, const char * path); - - enum - { - kTextureDiffuse = 0, - kTextureNormal, - kTextureEnvironmentMask, - kTextureSubsurfaceTint = kTextureEnvironmentMask, - kTextureGlowMap, - kTextureDetailMap = kTextureGlowMap, - kTextureHeight, - kTextureEnvironment, - kTextureMultilayer, - kTextureBacklightMask, - kTextureSpecular = kTextureBacklightMask, - kTextureUnused08, - kNumTextures = 9 - }; -}; - -// 58 -class BSShaderTextureSet : public BSTextureSet -{ -public: - - // According to constructor, they are all in a fixed array of 9 - const char * textures[9]; - - static BSShaderTextureSet * Create(); -}; - -STATIC_ASSERT(sizeof(BSShaderTextureSet) == 0x58); - -// 130 -class BGSTextureSet : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_TextureSet }; - - // parents - BSTextureSet textureSet; // 30 - - // members - - // 0C - struct Data - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - }; - - enum Flag - { - kFlagNone = 0, - kFlagNoSpecularMap = 1 << 0, - kFlagFacegenTextures = 1 << 1, - kFlagHasModelSpaceNormalMap = 1 << 2 - }; - - enum - { - kTextureDiffuse = 0, - kTextureNormal, - kTextureEnvironmentMask, - kTextureSubsurfaceTint = kTextureEnvironmentMask, - kTextureGlowMap, - kTextureDetailMap = kTextureGlowMap, - kTextureHeight, - kTextureEnvironment, - kTextureMultilayer, - kTextureBacklightMask, - kTextureSpecular = kTextureBacklightMask, - //kTextureUnused08, // commented this one, it made the below array to be 9, not 8 as needed! - kNumTextures - }; - - TESTexture texturePaths[kNumTextures]; // 40 - UInt64 unkC0; // C0 - UInt16 flags; // C8 - UInt8 padCA[6]; // CA - Data unkD0[kNumTextures]; // D0 -}; - -STATIC_ASSERT(sizeof(BGSTextureSet) == 0x130); - -// 90 -class MagicItem : public TESBoundObject -{ -public: - virtual UInt32 Unk_52(void); // pure - virtual void Unk_53(UInt32 arg); - virtual UInt32 Unk_54(void); // pure - virtual void Unk_55(UInt32 arg); - virtual UInt32 Unk_56(void); // pure - virtual bool Unk_57(UInt32 arg); - virtual float Unk_58(void); - virtual float Unk_59(void); - virtual bool Unk_5A(void); - virtual bool Unk_5B(void); - virtual bool Unk_5C(void); - virtual bool Unk_5D(void); - virtual bool Unk_5E(void); - virtual bool Unk_5F(UInt32 arg); - virtual bool Unk_60(void); - virtual bool Unk_61(void); - virtual void Unk_62(UInt32 arg0, UInt32 arg1); - virtual float Unk_63(void); - virtual UInt32 Unk_64(void); - virtual UInt32 Unk_65(void); - virtual bool Unk_66(void); - virtual UInt32 Unk_67(void); // pure, returns char code - virtual void Unk_68(MagicItem * src); // pure, copy data if possible? - virtual void Unk_69(UInt32 arg0, UInt32 arg1); // loading-related - virtual void Unk_6A(UInt32 arg); - virtual void * Unk_6B(void); // pure, returns data - virtual void * Unk_6C(void); // pure, returns data - virtual UInt32 Unk_6D(void); // pure, return size of data - virtual void Unk_6E(void); // pure, byteswap? - - // parents - TESFullName fullName; // 30 - BGSKeywordForm keyword; // 40 - - // members - struct EffectItem - { - float magnitude; // 00 - UInt32 area; // 04 - UInt32 duration; // 08 - UInt32 pad0C; // 0C - EffectSetting* mgef; // 10 - float cost; // 18 - ? - UInt32 unk1C; // 1C - probably pad - void *unk20; // 20 - looks like the condition - - EffectItem() - { - magnitude = 0; - area = 0; - duration = 0; - mgef = NULL; - cost = 0.0; - unk1C = 0; - unk20 = NULL; - } - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free); - }; - - tArray effectItemList; // 58 - UInt32 hostile; // 70 - EffectSetting* effectTemplate; // 78 - UInt32 unk80; // 80 - UInt64 unk88; // 88 - - MEMBER_FN_PREFIX(MagicItem); - DEFINE_MEMBER_FN(GetCostliestEffectItem, EffectItem *, 0x0010BF00, int arg1, bool arg2); - DEFINE_MEMBER_FN(GetEffectiveMagickaCost, float, 0x0010BC80, Character* caster); -}; - -STATIC_ASSERT(sizeof(MagicItem) == 0x90); - -// 168 -class AlchemyItem : public MagicItem -{ -public: - enum { kTypeID = kFormType_Potion }; - - enum - { - kFlag_ManualCalc = 0x00000001, - kFlag_Food = 0x00000002, - kFlag_Medicine = 0x00010000, - kFlag_Poison = 0x00020000, - }; - - // parents - TESModelTextureSwap texSwap; // 090 - TESIcon icon; // 0C8 - BGSMessageIcon messageIcon; // 0D8 - TESWeightForm weight; // 0F0 - BGSEquipType equipType; // 100 - BGSDestructibleObjectForm destructibleObj; // 110 - BGSPickupPutdownSounds sounds; // 120 - - // members - - // 20 - struct Data - { - UInt32 value; // 00 - init'd to FFFFFFFF - UInt32 flags; // 04 - UInt64 unk08; // 08 addiction (legacy?) - UInt32 unk10; // 10 addiction chance (legacy?) - UInt32 pad14; // 14 - BGSSoundDescriptorForm * useSound; // 18 - }; - - Data itemData; // 138 - TESIcon unkB8; // 158 - - bool IsFood() { return (itemData.flags & kFlag_Food) != 0; } - bool IsPoison() { return (itemData.flags & kFlag_Poison) != 0; } -}; - -// C0 -class EnchantmentItem : public MagicItem -{ -public: - enum { kTypeID = kFormType_Enchantment }; - - enum - { - kFlag_ManualCalc = 0x00000001, - }; - - // 30 - struct Data - { - struct Calculations - { - UInt32 cost; // 00 - init'd to FFFFFFFF - UInt32 flags; // 04 - }; - - Calculations calculations; // 00 - UInt32 unk08; // 08 - UInt32 amount; // 0C - init'd to FFFFFFFF - UInt32 deliveryType; // 10 - init'd to 5 - UInt32 castingType; // 14 - init'd to 6 - float castTime; // 18 - UInt32 pad1C; // 1C - EnchantmentItem * baseEnchantment; // 20 - BGSListForm * restrictions; // 28 - }; - - Data data; // 90 -}; - -// 140 -class IngredientItem : public MagicItem -{ -public: - enum { kTypeID = kFormType_Ingredient }; - - // parents - TESModelTextureSwap texSwap; // 090 - TESIcon icon; // 0C8 - TESWeightForm weight; // 0D8 - BGSEquipType equipType; // 0E8 - BGSDestructibleObjectForm destructible; // 0F8 - BGSPickupPutdownSounds sounds; // 108 - TESValueForm value; // 120 - - // members - - // SE: I'm taking members out of the several structures, they break alignment - - UInt32 unk130; // 00 - init'd to FFFFFFFF - UInt32 unk134; // 04 - - // ahzaab 8-25-13 - enum // type - these are flags - { - kType_NoEffect = 0, - kType_FirstEffect = 1 << 0, - kType_SecondEffect = 1 << 1, - kType_ThirdEffect = 1 << 2, - kType_FourthEffect = 1 << 3 - }; - - UInt8 knownEffects; // 138 //The lower nibble contains the known effects, the upper nibble is unknown - - UInt8 unk139; // 139 - UInt16 unk13A; // 13A - UInt32 pad13C; // 13C -}; - -class Character; - -// E8 -class SpellItem : public MagicItem -{ -public: - enum { kTypeID = kFormType_Spell }; - - // parents - BGSEquipType equipType; // 90 - BGSMenuDisplayObject dispObj; // A0 - TESDescription description; // B0 - - // members - - enum - { - kTypeSpell = 0, - kTypeDisease, - kTypePower, - kTypeLesserPower, - kTypeAbility, - kTypePoison, - kTypeAddition, - kTypeVoice - }; - - // 24-28 - struct Data - { - struct Data0 - { - UInt32 cost; // 00 - init'd to FFFFFFFF - UInt32 flags; // 04 - }; - - Data0 unk00; // 00 - UInt32 type; // 08 - float castTime; // 0C - UInt32 castType; // 10 - init'd to 3 - UInt32 unk14; // 14 - init'd to 5 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - BGSPerk* spellPerk; // 20 - }; - - Data data; // C0 - - UInt32 GetMagickaCost() { return data.unk00.cost; } -}; - -// 168 -class ScrollItem : public SpellItem -{ -public: - enum { kTypeID = kFormType_ScrollItem }; - - // parents - TESModelTextureSwap texSwap; // E8 - BGSDestructibleObjectForm destructible; // 120 - BGSPickupPutdownSounds sounds; // 130 - TESWeightForm weight; // 148 - TESValueForm value; // 158 -}; - -// 128 -class TESAmmo : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Ammo }; - - // parents - TESFullName fullName; // 030 - TESModelTextureSwap texSwap; // 040 - TESIcon icon; // 078 - BGSMessageIcon messageIcon; // 088 - TESValueForm value; // 0A0 - TESWeightForm weight; // 0B0 - BGSDestructibleObjectForm destructible; // 0C0 - BGSPickupPutdownSounds sounds; // 0D0 - TESDescription description; // 0E8 - BGSKeywordForm keyword; // 0F8 - - // members - - // 10 - struct AmmoSettings - { - BGSProjectile * projectile; // 0 - UInt32 flags; // 8 - float damage; // C - }; - - enum { - kIgnoreNormalResist = (1 << 0), - kNotPlayable = (1 << 1), - kNotBolt = (1 << 2) - }; - - bool isBolt() { return (settings.flags & kNotBolt) != kNotBolt; } - bool isPlayable() { return (settings.flags & kNotPlayable) != kNotPlayable; } - - AmmoSettings settings; // 110 - BSFixedString unk120; // 120 -}; -STATIC_ASSERT(sizeof(TESAmmo) == 0x128); - -// 30 -class TESBoundAnimObject : public TESBoundObject -{ -public: -}; - -// 150 -class TESActorBase : public TESBoundAnimObject -{ -public: - // parents - TESActorBaseData actorData; // 030 - TESContainer container; // 088 - TESSpellList spellList; // 0A0 - TESAIForm aiForm; // 0B0 - TESFullName fullName; // 0D8 - ActorValueOwner actorValueOwner; // 0E8 - BGSDestructibleObjectForm destructible; // 0F0 - BGSSkinForm skinForm; // 100 - BGSKeywordForm keyword; // 110 - BGSAttackDataForm attackData; // 128 - BGSPerkRankArray perkRanks; // 138 - - virtual bool Unk_52(void); - virtual UInt32 Unk_53(void); - virtual void Unk_54(UInt32 arg); - virtual TESActorBase * Unk_55(void); -}; -STATIC_ASSERT(offsetof(TESActorBase, keyword) == 0x110); -STATIC_ASSERT(sizeof(TESActorBase) == 0x150); - -class BSFaceGenNiNode; - -// 268 -class TESNPC : public TESActorBase -{ -public: - enum { kTypeID = kFormType_NPC }; - - struct FaceMorphs - { - enum - { - kNumOptions = 19, - kNumPresets = 4, - }; - - float option[kNumOptions]; - UInt32 presets[kNumPresets]; - }; - - struct HeadData { - BGSColorForm * hairColor; - BGSTextureSet * headTexture; // Only seems to apply to the player - }; - - - // parents - TESRaceForm race; // 150 - BGSOverridePackCollection overridePacks; // 160 - /*BSTEventSink */void* menuOpenCloseEvent; // 188 - MenuOpenCloseEvent - - // members @190 - UInt8 unk190[0x12]; // 190 - init'd to 5 - UInt8 unk1A2[0x12]; // 1A2 - init'd to 0 - - UInt8 pad1B4[0x1BA - 0x1B4]; // 1B4 - - UInt16 unk1BA; // 1BA - UInt32 pad1BC; // 1BC - TESClass* npcClass; // 1C0 - - HeadData * headData; // 1C8 - UInt64 unk1D0; // 1D0 - TESCombatStyle* combatStyle; // 1D8 - UInt32 unk1E0; // 1E0 - UInt32 pad1E4; // 1E4 - TESRace * overlayRace; // 1E8 - TESNPC * nextTemplate; // 1F0 - float height; // 1F8 - init'd to 1 - float weight; // 1FC - init'd to 50 - - UInt64 unk200; // 200 - - BSFixedString shortName; // 208 - TESObjectARMO* skinFar; // 210 - BGSOutfit* defaultOutfit; // 218 - BGSOutfit* sleepOutfit; // 220 - UInt64 unk228; // 228 - TESFaction* faction; // 230 - BGSHeadPart ** headparts; // 238 - UInt8 numHeadParts; // 240 - UInt8 unk241; // 241 - init'd to 1 - UInt8 unk242; // 242 - New in SE? - UInt8 unk243; // 243 - UInt8 unk244; // 244 - New in SE? - UInt8 unk245; // 245 - init'd to 1 - struct Color { // 797979 Transparent - UInt8 red, green, blue; // 246 - 248 - Skin Color - } color; - UInt8 pad249[7]; // 249 - UInt64 unk250; // 250 // Relationships? - - FaceMorphs * faceMorph; // 258 - UInt64 unk260; // 260 - - MEMBER_FN_PREFIX(TESNPC); - DEFINE_MEMBER_FN(GetSex, char, 0x00367290); // return (formType == 0x2B) ? (actorData.flags & 1) : -1; - DEFINE_MEMBER_FN(HasOverlays, bool, 0x0037FEB0); - - DEFINE_MEMBER_FN(ChangeHeadPart, void, 0x0037CE80, BGSHeadPart * target); // Swaps a headPart of the same type as target with target - - struct MorphAction { - BSFaceGenNiNode * faceNode; - TESNPC * npc; - const char ** morphName; - float value; - }; - - DEFINE_MEMBER_FN(UpdateNeck, void, 0x00377430, BSFaceGenNiNode * faceNode); // Updates the neck seam when weight changed - - DEFINE_MEMBER_FN(SetSkinFromTint, void, 0x003771F0, NiColorA * result, TintMask * tintMask, bool fromTint); // Computes RGB SkinTone from RGBA TintMask - - void SetFaceTexture(BGSTextureSet * textureSet); - void SetHairColor(BGSColorForm * hairColor); - - BGSHeadPart * GetHeadPartByType(UInt32 type); - BGSHeadPart * GetHeadPartOverlayByType(UInt32 type); - BGSHeadPart * GetCurrentHeadPartByType(UInt32 type); - TESNPC * GetRootTemplate(); -}; -STATIC_ASSERT(offsetof(TESNPC, nextTemplate) == 0x1F0); -STATIC_ASSERT(sizeof(TESNPC) == 0x268); - -// 90 -class TESLevCharacter : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_LeveledCharacter }; - - TESLeveledList leveledList; // 30 - TESModelTextureSwap texSwap; // 58 -}; - -// C8 -class TESObjectACTI : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_Activator }; - - // parents - TESFullName fullName; // 20-30 - TESModelTextureSwap texSwap; // 28-40 - BGSDestructibleObjectForm destructible; // 44-78 - BGSOpenCloseForm openClose; // 4C-88 - BGSKeywordForm keyword; // 50-90 - - // members - UInt64 unkA8; // A8 - UInt64 unkB0; // B0 - UInt64 unkB8; // B8 - UInt16 unkC0; // C0 - UInt8 padC2[6]; // C2 -}; - -// D8 -class BGSTalkingActivator : public TESObjectACTI -{ -public: - enum { kTypeID = kFormType_TalkingActivator }; - - void * unkC8; // C8 - BGSVoiceType * unkD0; // D0 -}; - -// E8 -class TESFlora : public TESObjectACTI -{ -public: - enum { kTypeID = kFormType_Flora }; - - // parents - TESProduceForm produce; // C8 -}; - -// F0 -class TESFurniture : public TESObjectACTI -{ -public: - enum { kTypeID = kFormType_Furniture }; - - // 4 - struct DataE0 - { - UInt8 unk0; // 0 - UInt8 unk1; // 1 - init'd to FF - UInt8 pad2[2]; // 2 - }; - - UnkArray unkC8; // C8 - DataE0 unkE0; // E0 - UInt32 unkE4; // E4 - UInt64 unkE8; // E8 -}; - -// D0 -class TESObjectCONT : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_Container }; - - // parents - TESContainer container; // 30 - TESFullName fullName; // 48 - TESModelTextureSwap texSwap; // 58 - TESWeightForm weight; // 90 - BGSDestructibleObjectForm destructible; // A0 - BGSOpenCloseForm openClose; // B0 - - // members - UInt8 unkB8; // B8 - UInt8 unkB9; // B9 - UInt8 padBA[6]; // BA - UInt64 padC0; // C0 - UInt64 padC8; // C8 -}; - -// D0 -class TESObjectDOOR : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_Door }; - - // parents - TESFullName fullName; // 30 - TESModelTextureSwap texSwap; // 40 - BGSDestructibleObjectForm destructible; // 78 - BGSOpenCloseForm openClose; // 88 - - // members - UInt64 unk90; // 90 - UInt64 unk98; // 98 - UInt64 unkA0; // A0 - UInt64 unkA8; // A8 - UInt8 unkB0; // B0 - UInt8 padB1[7]; // B1 - UnkArray unkB8; // 64-B8 -}; - -// B4-130 -class TESObjectLIGH : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_Light }; - - // parents - TESFullName fullName; // 20-030 - TESModelTextureSwap texSwap; // 28-040 - TESIcon icon; // 44-078 - BGSMessageIcon messageIcon; // 4C-088 - TESWeightForm weight; // 58-0A0 - TESValueForm value; // 60-0B0 - BGSDestructibleObjectForm destructible; // 68-0C0 - BGSEquipType equipType; // 70-0D0 - - // members (78) - - // 28 - struct DataE0 - { - SInt32 time; // 00 time ? - UInt32 radius; // 04 - struct Color { - UInt8 red, green, blue; - } color; // 08 - UInt32 unk0C; // 0C - float unk10; // 10 - float FOV; // 14 - 90 - float unk18; // 18 - .001 - float unk1C; // 1C - UInt32 unk20; // 20 - UInt32 unk24; // 24 - }; - - // 18 - struct Data118 - { - UInt64 unk0; // 00 - UInt32 unk4; // 08 - UInt32 padC; // 0C - UInt64 unk8; // 10 - }; - - DataE0 unkE0; // 78-0E0 - float fade; // A0-108 - init'd to - UInt32 pad10C; // 10C - UInt64 unkA4; // A4-110 - Data118 unk118; // 118 -}; - -STATIC_ASSERT(sizeof(TESObjectLIGH) == 0x130); - -// 38 -class TESSound : public TESBoundAnimObject -{ -public: - enum { kTypeID = kFormType_Sound }; - - BGSSoundDescriptorForm * descriptor; // 30 -}; - -// 78 -class TESGrass : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Grass }; - - virtual UInt8 GetUnk34(void); // return unk34; - virtual bool SetUnk34(UInt8 data); // if(data > 100) return false; - // unk34 = data; return true; - virtual UInt8 GetUnk35(void); // return unk35; - virtual bool SetUnk35(UInt8 data); // if(data > 90) return false; - // if(data > unk36) return false; - // unk35 = data; return true; - virtual UInt8 GetUnk36(void); // return unk36; - virtual bool SetUnk36(UInt8 data); // if(data > 90) return false; - // if(data < unk35) return false; - // unk36 = data; return true; - virtual float GetUnk35_Float(void); // return unk35 * (M_PI / 180); - virtual float GetUnk36_Float(void); // return unk36 * (M_PI / 180); - virtual UInt16 GetUnk38(void); // return unk38; - virtual void SetUnk38(UInt16 data); // unk38 = data; - virtual UInt32 GetUnk3C(void); // return unk3C; - virtual void SetUnk3C(UInt32 data); // unk3C = data; - virtual float GetUnk40(void); // return unk40; - virtual bool SetUnk40(float data); // if((data < 0) || (data > 512)) return false; - // unk40 = data; return true; - virtual float GetUnk44(void); // return unk44; - virtual bool SetUnk44(float data); // if((data < 0) || (data > 1)) return false; - // unk44 = data; return true; - virtual float GetUnk48(void); // return unk48; - virtual bool GetUnk48(float data); // if((data < 0) || (data > 1)) return false; - // unk48 = data; return true; - virtual float GetUnk4C(void); // return unk4C; - virtual bool SetUnk4C(float data); // if(data <= 0) return false; - // unk4C = data; return true; - virtual bool GetUnk50_01(void); // return (unk50 & 1) != 0; - virtual void SetUnk50_01(UInt8 data); // if(data) unk50 |= 1; else unk50 &= ~1; - virtual bool GetUnk50_02(void); // return (unk50 & 2) != 0; - virtual void SetUnk50_02(UInt8 data); // if(data) unk50 |= 2; else unk50 &= ~2; - virtual bool GetUnk50_04(void); // return (unk50 & 4) != 0; - virtual void SetUnk50_04(UInt8 data); // if(data) unk50 |= 4; else unk50 &= ~4; - - // parents - TESModel model; // 30 - - // members - UInt8 unk58; // 58 - init'd to 30 - UInt8 unk59; // 59 - degrees - UInt8 unk5A; // 5A - init'd to 90 - degrees - UInt8 pad5B; // 5B - UInt16 unk5C; // 5C - UInt8 pad5E[2]; // 5E - UInt32 unk60; // 60 - float unk64; // 64 - init'd to 32 - float unk68; // 68 - init'd to 0.2 - float unk6C; // 6C - init'd to 0.5 - float unk70; // 70 - init'd to 10 - UInt8 unk74; // 74 - UInt8 pad75[3]; // 75 -}; - -// 58 -class TESLevItem : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_LeveledItem }; - - // parents - TESLeveledList leveledList; // 30 -}; - -// 58 -class TESLevSpell : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_LeveledSpell }; - - // parents - TESLeveledList leveledList; // 30 -}; - -class TESObjectARMA; - -// 228 -class TESObjectARMO : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Armor }; - - // parents - TESFullName fullName; // 030 - TESRaceForm race; // 040 - TESEnchantableForm enchantable; // 050 - TESValueForm value; // 068 - TESWeightForm weight; // 078 - BGSDestructibleObjectForm destructible; // 088 - BGSPickupPutdownSounds pickupSounds; // 098 - TESBipedModelForm bipedModel; // 0B0 - BGSEquipType equipType; // 1A0 - BGSBipedObjectForm bipedObject; // 1B0 - BGSBlockBashData blockBash; // 1C0 - BGSKeywordForm keyword; // 1D8 - TESDescription description; // 1F0 - - // members - UInt32 armorValTimes100; // 200 - UInt32 pad204; // 204 - tArray armorAddons; // 208 - TESObjectARMO * templateArmor; // 220 - enchantment related? -}; - -STATIC_ASSERT(offsetof(TESObjectARMO, armorValTimes100) == 0x200); -STATIC_ASSERT(sizeof(TESObjectARMO) == 0x228); - -// 138 -class TESObjectBOOK : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Book }; - - // parents - TESFullName fullName; // 30 - TESModelTextureSwap texSwap; // 40 - TESIcon icon; // 78 - TESValueForm value; // 88 - TESWeightForm weight; // 98 - TESDescription description; // A8 - BGSDestructibleObjectForm destructible; // B8 - BGSMessageIcon messageIcon; // C8 - BGSPickupPutdownSounds pickupSounds; // E0 - BGSKeywordForm keyword; // F8 - - // members - struct Data - { - enum // type - these are technically flags - { - kType_None = 0, - kType_Skill = 1 << 0, - kType_CantBeTaken = 1 << 1, - kType_Spell = 1 << 2, // takes priority over skill - kType_Read = 1 << 3, // set once the book is equipped by the player, along with the CHANGE_BOOK_READ (0x40) change flag - }; - - UInt8 flags; // 0 - UInt8 type; // 1 - UInt16 unk02; // 2, probably padding too - UInt32 unk04; // 4, probably padding (SE) - - union - { - UInt32 skill; - SpellItem * spell; - } teaches; // 8 - - // make some sense of the flags field so we know what's in the union - UInt32 GetSanitizedType(void); - }; - - Data data; // 110 - TESObjectSTAT * bookStat; // 120 - TESDescription description2; // 128 -}; - -STATIC_ASSERT(sizeof(TESObjectBOOK) == 0x138); - -// 100 -class TESObjectMISC : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Misc }; - - // parents - TESFullName fullName; // 30 - TESModelTextureSwap texSwap; // 40 - TESIcon icon; // 78 - TESValueForm value; // 88 - TESWeightForm weight; // 98 - BGSDestructibleObjectForm destructible; // A8 - BGSMessageIcon messageIcon; // B8 - BGSPickupPutdownSounds pickupSounds; // D0 - BGSKeywordForm keyword; // E8 - - virtual void Unk_52(void); - virtual void Unk_53(UInt32 arg0, UInt32 arg1); - virtual void Unk_54(void); -}; - -// 120 -class BGSApparatus : public TESObjectMISC -{ -public: - enum { kTypeID = kFormType_Apparatus }; - - // parents - TESQualityForm quality; // 100 - TESDescription description; // 110 -}; - -// 100 -class TESKey : public TESObjectMISC -{ -public: - enum { kTypeID = kFormType_Key }; -}; - -// 110 -class TESSoulGem : public TESObjectMISC -{ -public: - enum { kTypeID = kFormType_SoulGem }; - - UInt64 unk100; // 100 - UInt8 soulSize; // 108 - UInt8 gemSize; // 109 - UInt8 pad10A[6]; // 10A -}; - - -// 80 -class TESObjectSTAT : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Static }; - - // parents - TESModelTextureSwap texSwap; // 30 - - // members - float unk68; // 68 - init'd to 90 - UInt64 unk70; // 70 - - // New members in SE: - UInt8 unk78; // 78 - UInt8 unk79; // 79 - UInt8 unk7A; // 7A - UInt8 unk7B; // 7B - - UInt32 pad7C; // 7C -}; - -// B0 -// they probably wanted this to derive from TESObjectSTAT first -// doesn't really hurt anything except performance (shims) -class BGSMovableStatic : public TESFullName -{ -public: - enum { kTypeID = kFormType_MovableStatic }; - - // parents - BGSDestructibleObjectForm destructible; // 10 - TESObjectSTAT staticObj; // 20 - - // members - void* unkA0; // A0 - New in SE? - UInt8 unkA8; // A8 - UInt8 pad59[7]; // A9 -}; - -// C8 -class TESObjectTREE : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Tree }; - - // parents - TESModel model; // 30 - TESFullName fullName; // 58 - TESProduceForm produce; // 68 - - // members - // 40 - struct Data88 - { - float unk00; // 00 - init'd to 1 - float unk04; // 04 - init'd to 1 - float unk08; // 08 - init'd to .03 - float unk0C; // 0C - init'd to .6 - float unk10; // 10 - init'd to .2 - float unk14; // 14 - init'd to .4 - float unk18; // 18 - init'd to .075 - float unk1C; // 1C - init'd to .025 - float unk20; // 20 - init'd to .035 - float unk24; // 24 - init'd to 1 - float unk28; // 28 - init'd to 1 - float unk2C; // 2C - init'd to 1 - UInt64 unk30; // 30 - UInt32 unk38; // 38 - init'd to 2 - UInt32 pad3C; // 3C - }; - - Data88 unk88; // 88 -}; - -// 220 -class TESObjectWEAP : public TESBoundObject -{ -public: - enum { kTypeID = kFormType_Weapon }; - - // parents - TESFullName fullName; // 030 - TESModelTextureSwap texSwap; // 040 - TESIcon icon; // 078 - TESEnchantableForm enchantable; // 088 - TESValueForm value; // 0A0 - TESWeightForm weight; // 0B0 - TESAttackDamageForm damage; // 0C0 - BGSDestructibleObjectForm destructible; // 0D0 - BGSEquipType equipType; // 0E0 - BGSPreloadable preloadable; // 0F0 - BGSMessageIcon messageIcon; // 0F8 - BGSPickupPutdownSounds pickupSounds; // 110 - BGSBlockBashData blockBash; // 128 - BGSKeywordForm keyword; // 140 - TESDescription description; // 158 - - // members - - // 38 - struct GameData - { - enum // type - { - kType_HandToHandMelee = 0, - kType_OneHandSword, - kType_OneHandDagger, - kType_OneHandAxe, - kType_OneHandMace, - kType_TwoHandSword, - kType_TwoHandAxe, - kType_Bow, - kType_Staff, - kType_CrossBow, - kType_H2H, - kType_1HS, - kType_1HD, - kType_1HA, - kType_1HM, - kType_2HS, - kType_2HA, - kType_Bow2, - kType_Staff2, - kType_CBow - }; - - enum Flags1 { - kFlags_PlayerOnly = 0x01, - kFlags_NPCUseAmmo = 0x02, - kFlags_NoJamAfterReload = 0x04, - kFlags_MinorCrime = 0x10, - kFlags_NotUsedInNormalCombat = 0x40, - kFlags_Unknown1 = 0x100, - kFlags_LongBursts = 0x800, - kFlags_NonHostile = 0x1000, - kFlags_BoundWeapon = 0x2000, - }; - - enum Flags2 { - kFlags_Hidebackpack = 0x01, - kFlags_Automatic = 0x02, - kFlags_CantDrop = 0x08, - kFlags_EmbeddedWeapon = 0x20, - kFlags_Unknown2 = 0x40, - kFlags_NotPlayable = 0x80, - }; - - void *unk00; // 00 - float speed; // 08 - float reach; // 0C - float minRange; // 10 - init'd to 500 - float maxRange; // 14 - init'd to 2000 - float animationMult; // 18 - float unk18; // 1C - float stagger;// 20 - init'd to 1 - UInt32 unk24; // 24 - UInt32 skill; // 28 - init'd to FFFFFFFF - UInt32 resist; // 2C - init'd to FFFFFFFF - UInt16 flags1; // 30 - UInt8 vatsChance; // 32 - init'd to 5 - UInt8 unk33; // 33 - init'd to FF - UInt8 unk34; // 34 - UInt8 type; // 35 - UInt8 flags2; // 36 - UInt8 unk37; // 37 - }; - - // 18 - struct CritData - { - float critMult; // 00 - init'd to 1 - UInt32 pad04; // 04 - SpellItem * critEffect; // 08 - UInt16 critDamage; // 10 - UInt8 effectOnDeath; // 12 - init'd to 1 - UInt8 pad13[5]; // 13 - }; - - GameData gameData; // 168 - CritData critData; // 1A0 - TESForm * scopeEffect; // 1B8 - BGSSoundDescriptorForm * attackSound; // 1C0 - BGSSoundDescriptorForm * attackSound2D; // 1C8 - BGSSoundDescriptorForm * attackLoopSound; // 1D0 - BGSSoundDescriptorForm * attackFailSound; // 1D8 - BGSSoundDescriptorForm * idleSound; // 1E0 - BGSSoundDescriptorForm * equipSound; // 1E8 - BGSSoundDescriptorForm * unequipSound; // 1F0 - BGSImpactDataSet * impactDataSet; // 1F8 - TESObjectSTAT * model; // 200 - TESObjectWEAP * templateForm; // 208 - Non-weapon templates don't make sense here and would probably crash anyway so assume it - BSFixedString embeddedNode; // 210 - UInt32 unk218; // 218 - UInt32 pad21C; // 21C - - float speed() { return gameData.speed; } - float reach() { return gameData.reach; } - float stagger() { return gameData.stagger; } - float minRange() { return gameData.minRange; } - float maxRange() { return gameData.maxRange; } - UInt8 type() { return gameData.type; } - UInt16 critDamage() { return critData.critDamage; } - - void GetNodeName(char * dstBuff); -}; -STATIC_ASSERT(offsetof(TESObjectWEAP, messageIcon) == 0xF8); -STATIC_ASSERT(sizeof(TESObjectWEAP) == 0x220); - -// 178 -class TESObjectARMA : public TESObject -{ -public: - enum { kTypeID = kFormType_ARMA }; - - // parents - TESRaceForm race; // 20 - BGSBipedObjectForm biped; // 30 - - // members - - // 10 - struct Data40 - { - UInt8 priority[2]; // 00 - UInt8 unk02; // 02 - UInt8 unk03; // 03 - UInt8 unk04; // 04 - UInt8 unk05; // 05 - UInt8 unk06; // 06 - UInt8 pad07; // 07 - UInt32 unk08; // 08 - UInt32 pad0C; // 0C - }; - - Data40 data; // 40 - TESModelTextureSwap models[2][2]; // 50 - BGSTextureSet* skinTextures[2]; // 130 - NAM0 - NAM1 - BGSListForm* skinTextureSwapLists[2]; // 140 - NAM2 - NAM3 - tArray additionalRaces; // 150 - BGSFootstepSet * footstepSet; // 168 - UInt64 unk170; // 170 - - bool isValidRace(TESRace * race) const; - void GetNodeName(char * dstBuff, TESObjectREFR * refr, TESObjectARMO * armor, float weightOverride); -}; - -STATIC_ASSERT(sizeof(TESObjectARMA) == 0x178); - -class ActiveEffect; - -// 10 -class ActiveEffectReferenceEffectController -{ -public: - virtual ~ActiveEffectReferenceEffectController(); - -// void ** _vtbl; // 00 - ActiveEffect * effect; // 08 - // possibly more -}; - -class ActiveEffect -{ -public: - enum { kTypeID = kFormType_ActiveMagicEffect }; - - enum - { - kFlag_Inactive = 0x8000 - }; - - virtual ~ActiveEffect(); - -// void ** _vtbl; // 00 - ActiveEffectReferenceEffectController controller; // 08 - UInt32 unk18; // 18 - float unk1C; // 1C - float unk20; // 20 - float unk24; // 24 - UInt32 unk28; // 28 - init'd to FFFFFFFF - UInt8 unk2C; // 2C - UInt8 pad2D[3]; // 2D - UInt32 unk30; // 30 - UInt32 unk34; // 34 - void * niNode; // 38 - MagicItem * item; // 40 - init'd to ctor argument - MagicItem::EffectItem * effect; // 48 - init'd to ctor argumet - TESObjectREFR * reference; // 50 - TESForm * sourceItem; // 58 - UInt64 unk60; // 60 - UInt64 un68; // 68 - float elapsed; // 70 - float duration; // 74 - float magnitude; // 78 - UInt32 flags; // 7C - UInt32 unk80; // 80 - init'd to 1 - UInt32 effectNum; // 84 - Somekind of counter used to determine whether the ActiveMagicEffect handle is valid - UInt32 unk88; // 88 - init'd to 4 - UInt32 pad8C; // 8C - UInt32 actorValue; // 90 - Only seems to appear on value modifiers - UInt32 unk94; // 94 - UInt64 unk98; // 98 -}; - -class ScriptEffect : public ActiveEffect -{ -public: - virtual ~ScriptEffect(); - - // ?? -}; - -class ScriptedRefEffect : public ScriptEffect -{ -public: - virtual ~ScriptedRefEffect(); - - // ?? -}; - -class SlowTimeEffect : public ScriptEffect -{ -public: - virtual ~SlowTimeEffect(); - - // ?? -}; - -class ValueModifierEffect : public ActiveEffect -{ -public: - virtual ~ValueModifierEffect(); - - // ?? -}; - -class BoundItemEffect : public ActiveEffect -{ -public: - virtual ~BoundItemEffect(); - - // ?? -}; - -class CloakEffect : public ActiveEffect -{ -public: - virtual ~CloakEffect(); - - // ?? -}; - -class CommandEffect : public ActiveEffect -{ -public: - virtual ~CommandEffect(); - - // ?? -}; - -class ReanimateEffect : public CommandEffect -{ -public: - virtual ~ReanimateEffect(); - - // ?? -}; - -class CommandSummonedEffect : public ActiveEffect -{ -public: - virtual ~CommandSummonedEffect(); - - // ?? -}; - -class SummonCreatureEffect : public ActiveEffect -{ -public: - virtual ~SummonCreatureEffect(); - - // ?? -}; - -class CureEffect : public ActiveEffect -{ -public: - virtual ~CureEffect(); - - // ?? -}; - -class DetectLifeEffect : public ActiveEffect -{ -public: - virtual ~DetectLifeEffect(); - - // ?? -}; - -class StaggerEffect : public ActiveEffect -{ -public: - virtual ~StaggerEffect(); - - // ?? -}; - -class DisarmEffect : public StaggerEffect -{ -public: - virtual ~DisarmEffect(); - - // ?? -}; - -class DisguiseEffect : public ActiveEffect -{ -public: - virtual ~DisguiseEffect(); - - // ?? -}; - -class DispelEffect : public ActiveEffect -{ -public: - virtual ~DispelEffect(); - - // ?? -}; - -class EtherealizationEffect : public ActiveEffect -{ -public: - virtual ~EtherealizationEffect(); - - // ?? -}; - -class GuideEffect : public ActiveEffect -{ -public: - virtual ~GuideEffect(); - - // ?? -}; - -class LightEffect : public ActiveEffect -{ -public: - virtual ~LightEffect(); - - // ?? -}; - -class LockEffect : public ActiveEffect -{ -public: - virtual ~LockEffect(); - - // ?? -}; - -class OpenEffect : public ActiveEffect -{ -public: - virtual ~OpenEffect(); - - // ?? -}; - -class SoulTrapEffect : public ActiveEffect -{ -public: - virtual ~SoulTrapEffect(); - - // ?? -}; - -class TelekinesisEffect : public ActiveEffect -{ -public: - virtual ~TelekinesisEffect(); - - // ?? -}; - -class VampireLordEffect : public ActiveEffect -{ -public: - virtual ~VampireLordEffect(); - - // ?? -}; - -class WerewolfEffect : public ActiveEffect -{ -public: - virtual ~WerewolfEffect(); - - // ?? -}; - -class WerewolfFeedEffect : public ActiveEffect -{ -public: - virtual ~WerewolfFeedEffect(); - - // ?? -}; - -class SpawnHazardEffect : public ActiveEffect -{ -public: - virtual ~SpawnHazardEffect(); - - // ?? -}; - -class PeakValueModifierEffect : public ValueModifierEffect -{ -public: - virtual ~PeakValueModifierEffect(); - - // ?? -}; - -class DualValueModifierEffect : public ValueModifierEffect -{ -public: - virtual ~DualValueModifierEffect(); - - // ?? -}; - -class EnhanceWeaponEffect : public DualValueModifierEffect -{ -public: - virtual ~EnhanceWeaponEffect(); - - // ?? -}; - -class AccumulatingValueModifierEffect : public ValueModifierEffect -{ -public: - virtual ~AccumulatingValueModifierEffect(); - - // ?? -}; - -class InvisibilityEffect : public ValueModifierEffect -{ -public: - virtual ~InvisibilityEffect(); - - // ?? -}; - -class NightEyeEffect : public ValueModifierEffect -{ -public: - virtual ~NightEyeEffect(); - - // ?? -}; - -class ParalysisEffect : public ValueModifierEffect -{ -public: - virtual ~ParalysisEffect(); - - // ?? -}; - -class DarknessEffect : public ValueModifierEffect -{ -public: - virtual ~DarknessEffect(); - - // ?? -}; - -class AbsorbEffect : public ValueModifierEffect -{ -public: - virtual ~AbsorbEffect(); - - // ?? -}; - -class ValueAndConditionsEffect : public ValueModifierEffect -{ -public: - virtual ~ValueAndConditionsEffect(); - - // ?? -}; - -class TargetValueModifierEffect : public ValueModifierEffect -{ -public: - virtual ~TargetValueModifierEffect(); - - // ?? -}; - -class RallyEffect : public TargetValueModifierEffect -{ -public: - virtual ~RallyEffect(); - - // ?? -}; - -class DemoralizeEffect : public TargetValueModifierEffect -{ -public: - virtual ~DemoralizeEffect(); - - // ?? -}; - -class CalmEffect : public TargetValueModifierEffect -{ -public: - virtual ~CalmEffect(); - - // ?? -}; - -class FrenzyEffect : public TargetValueModifierEffect -{ -public: - virtual ~FrenzyEffect(); - - // ?? -}; - -class TurnUndeadEffect : public DemoralizeEffect -{ -public: - virtual ~TurnUndeadEffect(); - - // ?? -}; - -class BanishEffect : public DemoralizeEffect -{ -public: - virtual ~BanishEffect(); - - // ?? -}; - -class BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionData(); -}; - - -class BGSEntryPointFunctionDataTwoValue : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataTwoValue(); - - enum { - kNumValues = 2 - }; - - float value[kNumValues]; -}; - -class BGSEntryPointFunctionDataOneValue : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataOneValue(); - - float value; -}; - -class BGSEntryPointFunctionDataText : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataText(); - - StringCache::Ref text; -}; - -class BGSEntryPointFunctionDataSpellItem : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataSpellItem(); - - SpellItem * spellItem; -}; - -class BGSEntryPointFunctionDataLeveledList : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataLeveledList(); - - TESLevItem * leveledList; -}; - -class BGSEntryPointFunctionDataActivateChoice : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataActivateChoice(); - - StringCache::Ref label; - BGSPerk * perk; - SpellItem * appliedSpell; - UInt32 flags; - UInt32 unk14; -}; - -class BGSEntryPointFunctionDataBooleanGraphVariable : public BGSEntryPointFunctionData -{ -public: - virtual ~BGSEntryPointFunctionDataBooleanGraphVariable(); - - StringCache::Ref variable; -}; - -// 10 -class BGSPerkEntry -{ -public: - virtual ~BGSPerkEntry(); - - UInt8 rank; //8 - UInt8 priority; // 9 - UInt16 unk0A; - UInt32 pad0C; -}; -STATIC_ASSERT(sizeof(BGSPerkEntry) == 0x10); - -class BGSQuestPerkEntry : public BGSPerkEntry -{ -public: - virtual ~BGSQuestPerkEntry(); - - TESQuest * quest; // 10 - UInt8 stage; // 18 - UInt8 pad[7]; // 19 -}; - -class BGSAbilityPerkEntry : public BGSPerkEntry -{ -public: - virtual ~BGSAbilityPerkEntry(); - - SpellItem * spellItem; // 10 -}; - -class BGSEntryPointPerkEntry : public BGSPerkEntry -{ -public: - virtual ~BGSEntryPointPerkEntry(); // Has a number of virtuals, don't know what they are yet - - UInt32 unk10; - UInt32 pad14; - BGSEntryPointFunctionData * data; // 18 - void * unk20; - BGSPerk * perk; // 28 -}; - -class BGSPrimitive -{ -public: - BGSPrimitive(); - virtual ~BGSPrimitive(); - - enum { - kPrimitive_None = 0, - kPrimitive_Box = 1, - kPrimitive_Sphere = 2 - }; - - UInt32 type; - float bounds_x; // Div 2 from CK - float bounds_y; // Div 2 from CK - float bounds_z; // Div 2 from CK -}; - -class BGSPrimitiveBox : public BGSPrimitive -{ -public: - BGSPrimitiveBox(); - virtual ~BGSPrimitiveBox(); -}; - -class BGSPrimitiveLine : public BGSPrimitiveBox -{ -public: - BGSPrimitiveLine(); - virtual ~BGSPrimitiveLine(); -}; - -class BGSPrimitivePlane : public BGSPrimitive -{ -public: - BGSPrimitivePlane(); - virtual ~BGSPrimitivePlane(); -}; - -class BGSPrimitiveSphere : public BGSPrimitive -{ -public: - BGSPrimitiveSphere(); - virtual ~BGSPrimitiveSphere(); -}; diff --git a/source/fs.dll/skse64/skse64/GamePathing.cpp b/source/fs.dll/skse64/skse64/GamePathing.cpp deleted file mode 100644 index 111cbe54..00000000 --- a/source/fs.dll/skse64/skse64/GamePathing.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "GamePathing.h" diff --git a/source/fs.dll/skse64/skse64/GamePathing.h b/source/fs.dll/skse64/skse64/GamePathing.h deleted file mode 100644 index 9c70e09e..00000000 --- a/source/fs.dll/skse64/skse64/GamePathing.h +++ /dev/null @@ -1,100 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" -#include "skse64/GameFormComponents.h" - -// 9C -class BSNavmesh -{ -public: - // 28 - struct Data50 - { - UInt32 unk00; // 00 - init'd to 0 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - init'd to 7F7FFFFF - UInt32 unk10; // 10 - UInt32 unk14; // 14 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - UInt32 unk20; // 20 - UInt32 unk24; // 24 - init'd to 0 - }; - - // 10 - class Data84 - { - public: - virtual ~Data84(); - - // void ** _vtbl; // 00 - UInt32 unk04; // 04 - ctor arg, prime? - void * unk08; // 08 - buf, len = unk04 * 4 - UInt32 unk0C; // 0C - }; - - virtual ~BSNavmesh(); - - // void ** _vtbl; // 00 - BSIntrusiveRefCounted refCount; // 04 - UnkArray unk08; // 08 - UnkArray unk14; // 14 - UnkArray unk20; // 20 - UnkArray unk2C; // 2C - UnkArray unk38; // 38 - UnkArray unk44; // 44 - Data50 unk50; // 50 - UnkArray unk78; // 78 - Data84 * unk84; // 84 - UnkArray unk88; // 88 - UInt32 unk94; // 94 - UInt32 unk98; // 98 -}; - -//STATIC_ASSERT(sizeof(BSNavmesh) == 0x9C); - -// 8 -class BSNavmeshInfoMap -{ -public: - virtual ~BSNavmeshInfoMap(); - - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - -// void ** _vtbl; // 00 - UInt32 unk04; // 04 -}; - -// ? -class BSPrecomputedNavmeshInfoPathMap -{ -public: -}; - -// 2C -class PrecomputedNavmeshInfoPathMap : public BSPrecomputedNavmeshInfoPathMap -{ -public: - // 20 - struct Data0C - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - 0 - UInt32 unk0C; // 0C - 0 - UInt32 unk10; // 10 - 0 - void * unk14; // 14 - ptr to 0xDEADBEEF - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - }; - - UnkArray unk00; // 00 - Data0C unk0C; // 0C -}; - -//STATIC_ASSERT(sizeof(PrecomputedNavmeshInfoPathMap) == 0x2C); diff --git a/source/fs.dll/skse64/skse64/GameRTTI.cpp b/source/fs.dll/skse64/skse64/GameRTTI.cpp deleted file mode 100644 index f23ae71c..00000000 --- a/source/fs.dll/skse64/skse64/GameRTTI.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "GameRTTI.h" -#include "skse64_common/Relocation.h" - -typedef void * (* _Runtime_DynamicCast_Internal)(void * srcObj, UInt32 arg1, const void * fromType, const void * toType, UInt32 arg4); -// 09ECDC875A847989BA08B9E8A23656EDFE1F380C+A8 -RelocAddr <_Runtime_DynamicCast_Internal> Runtime_DynamicCast_Internal(0x0147854A); // __RTDynamicCast - -void * Runtime_DynamicCast(void * srcObj, const void * fromType, const void * toType) -{ - uintptr_t fromTypeAddr = uintptr_t(fromType) + RelocationManager::s_baseAddr; - uintptr_t toTypeAddr = uintptr_t(toType) + RelocationManager::s_baseAddr; - - return Runtime_DynamicCast_Internal(srcObj, 0, (void *)fromTypeAddr, (void *)toTypeAddr, 0); -} - -#include "GameRTTI.inl" diff --git a/source/fs.dll/skse64/skse64/GameRTTI.h b/source/fs.dll/skse64/skse64/GameRTTI.h deleted file mode 100644 index ff732258..00000000 --- a/source/fs.dll/skse64/skse64/GameRTTI.h +++ /dev/null @@ -1,3393 +0,0 @@ -#pragma once - -void * Runtime_DynamicCast(void * srcObj, const void * fromType, const void * toType); - -#define DYNAMIC_CAST(obj, from, to) ( ## to *) Runtime_DynamicCast((void*)(obj), RTTI_ ## from, RTTI_ ## to) - -extern const void * RTTI_IFormFactory; -extern const void * RTTI_BaseFormComponent; -extern const void * RTTI_AlchemyItem; -extern const void * RTTI_BGSDualCastData; -extern const void * RTTI_Setting; -extern const void * RTTI_GameSettingCollection; -extern const void * RTTI_BSTArrayBase__IAllocatorFunctor; -extern const void * RTTI_TESFullName; -extern const void * RTTI_EffectSetting; -extern const void * RTTI_EnchantmentItem; -extern const void * RTTI_IngredientItem; -extern const void * RTTI_BSModelDB__QueuedHandles; -extern const void * RTTI_TESModelDB__TESQueuedHandles; -extern const void * RTTI_MagicItem; -extern const void * RTTI_MagicItem__PreloadableVisitor; -extern const void * RTTI_MagicItemTraversalFunctor; -extern const void * RTTI_MagicItemFindFunctor; -extern const void * RTTI_MagicItemFindKeywordFunctor; -extern const void * RTTI_AnimationSystemUtils__TESModelAndAnimationHandles; -extern const void * RTTI_FindNonExcludedDeliveryFunctor; -extern const void * RTTI_FindEqualsFunctor; -extern const void * RTTI_GetCostliestEffectFunctor; -extern const void * RTTI_LongestDurationFunctor; -extern const void * RTTI_LargestAreaFunctor; -extern const void * RTTI_GetMagicItemDescriptionFunctor; -extern const void * RTTI_ScrollItem; -extern const void * RTTI_SpellItem; -extern const void * RTTI_ExtraSeenData; -extern const void * RTTI_BSExtraData; -extern const void * RTTI_ExtraHavok; -extern const void * RTTI_ExtraEditorID; -extern const void * RTTI_MagicTarget; -extern const void * RTTI_ExtraTimeLeft; -extern const void * RTTI_ExtraLock; -extern const void * RTTI_ExtraTeleport; -extern const void * RTTI_ExtraStartingPosition; -extern const void * RTTI_ExtraOwnership; -extern const void * RTTI_ExtraGlobal; -extern const void * RTTI_ExtraRank; -extern const void * RTTI_ExtraCount; -extern const void * RTTI_ExtraWorn; -extern const void * RTTI_ExtraWornLeft; -extern const void * RTTI_ExtraLeveledItem; -extern const void * RTTI_ExtraOutfitItem; -extern const void * RTTI_ExtraHealth; -extern const void * RTTI_ExtraHealthPerc; -extern const void * RTTI_ExtraCharge; -extern const void * RTTI_ExtraScale; -extern const void * RTTI_ExtraReferenceHandle; -extern const void * RTTI_ExtraFollower; -extern const void * RTTI_ExtraOriginalReference; -extern const void * RTTI_ExtraEnableStateParent; -extern const void * RTTI_ExtraEnableStateChildren; -extern const void * RTTI_ExtraLinkedRef; -extern const void * RTTI_ExtraLinkedRefChildren; -extern const void * RTTI_ExtraActivateRef; -extern const void * RTTI_ExtraActivateRefChildren; -extern const void * RTTI_ExtraRandomTeleportMarker; -extern const void * RTTI_ExtraCannotWear; -extern const void * RTTI_ExtraPoison; -extern const void * RTTI_ExtraLastFinishedSequence; -extern const void * RTTI_ExtraItemDropper; -extern const void * RTTI_ExtraDroppedItemList; -extern const void * RTTI_ExtraSavedAnimation; -extern const void * RTTI_ExtraSavedHavokData; -extern const void * RTTI_ExtraHeadingTarget; -extern const void * RTTI_ExtraRefractionProperty; -extern const void * RTTI_ExtraSound; -extern const void * RTTI_ExtraCreatureAwakeSound; -extern const void * RTTI_ExtraCreatureMovementSound; -extern const void * RTTI_ExtraWeaponIdleSound; -extern const void * RTTI_ExtraWeaponAttackSound; -extern const void * RTTI_ExtraActivateLoopSound; -extern const void * RTTI_ExtraObjectHealth; -extern const void * RTTI_ExtraFactionChanges; -extern const void * RTTI_ExtraActorCause; -extern const void * RTTI_ExtraPatrolRefData; -extern const void * RTTI_ExtraEncounterZone; -extern const void * RTTI_ExtraNavMeshPortal; -extern const void * RTTI_ExtraOcclusionPlaneRefData; -extern const void * RTTI_ExtraPortalRefData; -extern const void * RTTI_ExtraRoomRefData; -extern const void * RTTI_ExtraAliasInstanceArray; -extern const void * RTTI_ExtraSceneData; -extern const void * RTTI_ExtraBadPosition; -extern const void * RTTI_ExtraHeadTrackingWeight; -extern const void * RTTI_ExtraFavorCost; -extern const void * RTTI_ExtraTextDisplayData; -extern const void * RTTI_ExtraHorse; -extern const void * RTTI_ExtraEnchantment; -extern const void * RTTI_ExtraForcedTarget; -extern const void * RTTI_ExtraUniqueID; -extern const void * RTTI_ExtraFlags; -extern const void * RTTI_ExtraDecalGroup; -extern const void * RTTI_ExtraWaterCurrentZoneData; -extern const void * RTTI_ExtraMissingRefIDs; -extern const void * RTTI_ExtraCell3D; -extern const void * RTTI_ExtraRegionList; -extern const void * RTTI_ExtraCellSkyRegion; -extern const void * RTTI_ExtraCellImageSpace; -extern const void * RTTI_ExtraNorthRotation; -extern const void * RTTI_ExtraDetachTime; -extern const void * RTTI_ExtraCanTalkToPlayer; -extern const void * RTTI_ExtraPrimitive; -extern const void * RTTI_ExtraAmmo; -extern const void * RTTI_ExtraMagicLight; -extern const void * RTTI_ExtraFromAlias; -extern const void * RTTI_ExtraOpenCloseActivateRef; -extern const void * RTTI_ExtraTeleportName; -extern const void * RTTI_ExtraCachedScale; -extern const void * RTTI_ExtraHotkey; -extern const void * RTTI_ExtraPackageStartLocation; -extern const void * RTTI_ExtraLocation; -extern const void * RTTI_ExtraTresPassPackage; -extern const void * RTTI_ExtraRagDollData; -extern const void * RTTI_ExtraAttachRef; -extern const void * RTTI_ExtraAttachRefChildren; -extern const void * RTTI_ExtraAshPileRef; -extern const void * RTTI_ExtraLocationRefType; -extern const void * RTTI_ExtraLeveledItemBase; -extern const void * RTTI_ExtraReflectedRefs; -extern const void * RTTI_ExtraReflectorRefs; -extern const void * RTTI_ExtraWaterLightRefs; -extern const void * RTTI_ExtraLitWaterRefs; -extern const void * RTTI_ExtraLevCreaModifier; -extern const void * RTTI_ExtraSpawnContainer; -extern const void * RTTI_ExtraEmittanceSource; -extern const void * RTTI_ExtraMultiBoundRef; -extern const void * RTTI_ExtraMultiBound; -extern const void * RTTI_ExtraRoom; -extern const void * RTTI_ExtraFriendHits; -extern const void * RTTI_ExtraStartingWorldOrCell; -extern const void * RTTI_ExtraHasNoRumors; -extern const void * RTTI_ExtraTerminalState; -extern const void * RTTI_ExtraModelSwap; -extern const void * RTTI_ExtraRadius; -extern const void * RTTI_ExtraCombatStyle; -extern const void * RTTI_ExtraPackageData; -extern const void * RTTI_ExtraCollisionData; -extern const void * RTTI_ExtraGuardedRefData; -extern const void * RTTI_ExtraIgnoredBySandbox; -extern const void * RTTI_ExtraPromotedRef; -extern const void * RTTI_ExtraLargeRefOwnerCells; -extern const void * RTTI_ExtraLightData; -extern const void * RTTI_ExtraAttachedArrows3D; -extern const void * RTTI_ExtraAlphaCutoff; -extern const void * RTTI_ExtraForcedLandingMarker; -extern const void * RTTI_ExtraRefrPath; -extern const void * RTTI_ExtraCellWaterEnvMap; -extern const void * RTTI_ExtraWaterData; -extern const void * RTTI_ExtraScriptedAnimDependence; -extern const void * RTTI_ExtraCellMusicType; -extern const void * RTTI_ExtraCellAcousticSpace; -extern const void * RTTI_ExtraCellWaterType; -extern const void * RTTI_ExtraGIDBuffer; -extern const void * RTTI_ExtraMissingLinkedRefIDs; -extern const void * RTTI_NonActorMagicTarget; -extern const void * RTTI_ExtraMapMarker; -extern const void * RTTI_ExtraDistantData; -extern const void * RTTI_ExtraAnimNoteReceiver; -extern const void * RTTI_ExtraLockList; -extern const void * RTTI_ExtraPersistentCell; -extern const void * RTTI_ExtraRaceData; -extern const void * RTTI_ExtraAnimGraphManager; -extern const void * RTTI_ExtraDismemberedLimbs; -extern const void * RTTI_ExtraBiped; -extern const void * RTTI_ExtraLight; -extern const void * RTTI_ExtraLeveledCreature; -extern const void * RTTI_ExtraAction; -extern const void * RTTI_ExtraShouldWear; -extern const void * RTTI_ExtraContainerChanges; -extern const void * RTTI_ExtraPackage; -extern const void * RTTI_ExtraPlayerCrimeList; -extern const void * RTTI_ExtraRunOncePacks; -extern const void * RTTI_ExtraGhost; -extern const void * RTTI_ExtraSayTopicInfoOnceADay; -extern const void * RTTI_ExtraPatrolRefInUseData; -extern const void * RTTI_ExtraFollowerSwimBreadcrumbs; -extern const void * RTTI_ExtraInfoGeneralTopic; -extern const void * RTTI_ExtraSayToTopicInfo; -extern const void * RTTI_ExtraSoul; -extern const void * RTTI_ExtraResourcesPreload; -extern const void * RTTI_ExtraPortal; -extern const void * RTTI_ExtraOcclusionShape; -extern const void * RTTI_ExtraEditorRef3DData; -extern const void * RTTI_ExtraEditorRefMoveData; -extern const void * RTTI_ExtraAnimationSequencer; -extern const void * RTTI_ExtraCellGrassData; -extern const void * RTTI_ExtraInteraction; -extern const void * RTTI_ExtraGroupConstraint; -extern const void * RTTI_MultiBoundMarkerData; -extern const void * RTTI_INISettingCollection; -extern const void * RTTI_BSStream; -extern const void * RTTI_InterfacedClass; -extern const void * RTTI_BSTask; -extern const void * RTTI_IOTask; -extern const void * RTTI_QueuedActor; -extern const void * RTTI_QueuedCharacter; -extern const void * RTTI_QueuedHead; -extern const void * RTTI_QueuedHelmet; -extern const void * RTTI_AttachDistant3DTask; -extern const void * RTTI_QueuedModel; -extern const void * RTTI_QueuedReference; -extern const void * RTTI_QueuedAnimationObject; -extern const void * RTTI_QueuedTempEffect; -extern const void * RTTI_BackgroundProcessThread; -extern const void * RTTI_QueuedTree; -extern const void * RTTI_QueuedPlayer; -extern const void * RTTI_INIPrefSettingCollection; -extern const void * RTTI_AddCellGrassTask; -extern const void * RTTI_ICellAttachDetachEventSource; -extern const void * RTTI_TES; -extern const void * RTTI_TES__SystemEventAdapter; -extern const void * RTTI_BSTempNodeManager; -extern const void * RTTI_BGSLoadFormBuffer; -extern const void * RTTI_BGSStoryManagerBranchNode; -extern const void * RTTI_BGSStoryManagerTreeForm; -extern const void * RTTI_BGSStoryManagerNodeBase; -extern const void * RTTI_Projectile__LaunchData; -extern const void * RTTI_BSModelDB__BSModelProcessor; -extern const void * RTTI_BGSAttackDataForm; -extern const void * RTTI_BGSBipedModelList; -extern const void * RTTI_BGSBipedObjectForm; -extern const void * RTTI_BGSBlockBashData; -extern const void * RTTI_BGSDestructibleObjectForm; -extern const void * RTTI_BGSEquipType; -extern const void * RTTI_BGSIdleCollection; -extern const void * RTTI_BGSKeywordForm; -extern const void * RTTI_BGSMenuDisplayObject; -extern const void * RTTI_BGSMessageIcon; -extern const void * RTTI_BGSOverridePackCollection; -extern const void * RTTI_PerkRankVisitor; -extern const void * RTTI_BGSPerkRankArray; -extern const void * RTTI_BGSPickupPutdownSounds; -extern const void * RTTI_BGSSkinForm; -extern const void * RTTI_TESActorBaseData; -extern const void * RTTI_TESAIForm; -extern const void * RTTI_TESAttackDamageForm; -extern const void * RTTI_TESModelRDT; -extern const void * RTTI_TESBipedModelForm; -extern const void * RTTI_TESContainer; -extern const void * RTTI_TESDescription; -extern const void * RTTI_TESEnchantableForm; -extern const void * RTTI_IFormFactory__IFactoryVisitor; -extern const void * RTTI_TESForm; -extern const void * RTTI_BSStorage; -extern const void * RTTI_BSMemStorage; -extern const void * RTTI_BSScript__IHandleReaderWriter; -extern const void * RTTI_SkyrimScript__BaseHandleReaderWriter; -extern const void * RTTI_SkyrimScript__DataFileHandleReaderWriter; -extern const void * RTTI_BSVMLoadTask; -extern const void * RTTI_TESHealthForm; -extern const void * RTTI_TESIcon; -extern const void * RTTI_TESImageSpaceModifiableForm; -extern const void * RTTI_TESLeveledList; -extern const void * RTTI_TESModel; -extern const void * RTTI_TESModelLODList; -extern const void * RTTI_TESModelTextureSwap; -extern const void * RTTI_TESProduceForm; -extern const void * RTTI_TESQualityForm; -extern const void * RTTI_TESRaceForm; -extern const void * RTTI_TESReactionForm; -extern const void * RTTI_TESSpellList; -extern const void * RTTI_TESTexture; -extern const void * RTTI_TESValueForm; -extern const void * RTTI_TESWeightForm; -extern const void * RTTI_ActionInput; -extern const void * RTTI_BGSAnimSoundStateManager; -extern const void * RTTI_BSAttachTechniques__BSAttachTechnique; -extern const void * RTTI_BGSAttachTechniquesUtil__ProcessTechniquesFunctor; -extern const void * RTTI_BGSAttachTechniquesUtil__AttachTechniquesFunctor; -extern const void * RTTI_BGSAttachTechniquesUtil__DetachTechniquesFunctor; -extern const void * RTTI_BGSParticleArrayAttach; -extern const void * RTTI_BGSParticleArrayAttach__EmitterPolicy; -extern const void * RTTI_BGSParticleArrayAttach__CollectEmitterPolicy; -extern const void * RTTI_BGSParticleArrayAttach__ClearEmitterPolicy; -extern const void * RTTI_BGSHavokGeometryAttach; -extern const void * RTTI_BGSHavokGeometryAttach__ActionPolicy; -extern const void * RTTI_BGSHavokGeometryAttach__AttachPolicy; -extern const void * RTTI_BGSHavokGeometryAttach__DetachPolicy; -extern const void * RTTI_BGSNamedNodeAttach; -extern const void * RTTI_BGSNamedNodeAttach__ActionPolicy; -extern const void * RTTI_BGSNamedNodeAttach__AttachPolicy; -extern const void * RTTI_BGSNamedNodeAttach__DetachPolicy; -extern const void * RTTI_BGSMultiTechniqueAttach; -extern const void * RTTI_BGSMultiTechniqueAttach__ActionPolicy; -extern const void * RTTI_BGSMultiTechniqueAttach__AttachPolicy; -extern const void * RTTI_BGSMultiTechniqueAttach__DetachPolicy; -extern const void * RTTI_hkpRayHitCollector; -extern const void * RTTI_hkpAllRayHitTempCollector; -extern const void * RTTI_BGSDecalNode; -extern const void * RTTI_QueuedPromoteReferencesTask; -extern const void * RTTI_NiProperty; -extern const void * RTTI_NiAlphaProperty; -extern const void * RTTI_BSResource__Location; -extern const void * RTTI_BSResource__LooseFileLocation; -extern const void * RTTI_BGSQueuedGrassModelHandles; -extern const void * RTTI_NiRefObject; -extern const void * RTTI_BGSPrimitive; -extern const void * RTTI_BSPortal; -extern const void * RTTI_BGSPrimitiveLine; -extern const void * RTTI_BGSPrimitivePlane; -extern const void * RTTI_BGSPrimitiveBox; -extern const void * RTTI_BGSPrimitiveSphere; -extern const void * RTTI_BSMultiBoundAABB; -extern const void * RTTI_BSMultiBoundOBB; -extern const void * RTTI_BSMultiBoundSphere; -extern const void * RTTI_BSShaderProperty__ForEachVisitor; -extern const void * RTTI_BGSSceneInfo; -extern const void * RTTI_BGSSceneInfo__TextureUse; -extern const void * RTTI_BGSTextureUseMap__TextureUse; -extern const void * RTTI_BSAnimationGraphChannel; -extern const void * RTTI_BSAnimGroupSequence; -extern const void * RTTI_BSAnimNoteReceiver; -extern const void * RTTI_IBSAnimNoteReceiver; -extern const void * RTTI_GridArray; -extern const void * RTTI_GridCellArray; -extern const void * RTTI_TESActionData; -extern const void * RTTI_InventoryUtils__ItemFilter; -extern const void * RTTI_InventoryChanges__IItemChangeVisitor; -extern const void * RTTI_BGSActionData; -extern const void * RTTI_Inventory__StatInventoryVisitor; -extern const void * RTTI_FindByEffectSettingFunctor; -extern const void * RTTI_BSExternalAudioIO__ExternalIOInterface; -extern const void * RTTI_LipSynchAnimDB__LipAudioInterface; -extern const void * RTTI_TESCameraState; -extern const void * RTTI_LocalMapCamera; -extern const void * RTTI_LocalMapCamera__DefaultState; -extern const void * RTTI_BSSplatterExtraData; -extern const void * RTTI_TESRegion; -extern const void * RTTI_TESRegionData; -extern const void * RTTI_TESRegionDataGrass; -extern const void * RTTI_TESRegionDataLandscape; -extern const void * RTTI_TESRegionDataManager; -extern const void * RTTI_TESRegionDataMap; -extern const void * RTTI_TESRegionDataObjects; -extern const void * RTTI_TESRegionDataSound; -extern const void * RTTI_TESRegionDataWeather; -extern const void * RTTI_TESRegionObjectBase; -extern const void * RTTI_TESRegionGrassObject; -extern const void * RTTI_TESRegionGrassObjectList; -extern const void * RTTI_TESRegionList; -extern const void * RTTI_TESRegionNoiseFunction; -extern const void * RTTI_TESRegionObject; -extern const void * RTTI_TESRegionObjectList; -extern const void * RTTI_BGSAddonNode; -extern const void * RTTI_BGSAddonNodeSoundHandleExtra; -extern const void * RTTI_BGSApparatus; -extern const void * RTTI_BGSArtObject; -extern const void * RTTI_BGSArtObjectCloneTask; -extern const void * RTTI_BGSConstructibleObject; -extern const void * RTTI_InventoryUtils__QuestItemFilter; -extern const void * RTTI_BGSDebris; -extern const void * RTTI_BGSPreloadable; -extern const void * RTTI_BGSExplosion; -extern const void * RTTI_BGSHazard; -extern const void * RTTI_BGSLensFlare; -extern const void * RTTI_BSLensFlareSpriteRenderData; -extern const void * RTTI_BGSLensFlareSprite; -extern const void * RTTI_BGSVolumetricLighting; -extern const void * RTTI_BGSMovableStatic; -extern const void * RTTI_BGSOutfit; -extern const void * RTTI_BGSProjectile; -extern const void * RTTI_BGSStaticCollection; -extern const void * RTTI_BGSTalkingActivator; -extern const void * RTTI_TESAmmo; -extern const void * RTTI_TESCombatStyle; -extern const void * RTTI_TESEffectShader; -extern const void * RTTI_BSParticleShaderGeometry; -extern const void * RTTI_TESFlora; -extern const void * RTTI_TESFurniture; -extern const void * RTTI_TESGrass; -extern const void * RTTI_TESKey; -extern const void * RTTI_TESLevCharacter; -extern const void * RTTI_TESLevItem; -extern const void * RTTI_TESLevSpell; -extern const void * RTTI_TESObjectLIGH; -extern const void * RTTI_TESBoundObject; -extern const void * RTTI_TESObject; -extern const void * RTTI_TESBoundAnimObject; -extern const void * RTTI_TESObjectACTI; -extern const void * RTTI_BGSOpenCloseForm; -extern const void * RTTI_TESObjectANIO; -extern const void * RTTI_TESObjectARMA; -extern const void * RTTI_TESObjectARMO; -extern const void * RTTI_TESObjectBOOK; -extern const void * RTTI_TESObjectCONT; -extern const void * RTTI_TESObjectDOOR; -extern const void * RTTI_IFadeDoneCallback; -extern const void * RTTI_TESObjectMISC; -extern const void * RTTI_TESObjectSTAT; -extern const void * RTTI_TESObjectTREE; -extern const void * RTTI_TESObjectWEAP; -extern const void * RTTI_TESSoulGem; -extern const void * RTTI_BGSEncounterZone; -extern const void * RTTI_QueuedPromoteLargeReferencesTask; -extern const void * RTTI_BGSLightingTemplate; -extern const void * RTTI_BGSLocation; -extern const void * RTTI_QueuedPromoteLocationReferencesTask; -extern const void * RTTI_BGSLocationRefType; -extern const void * RTTI_BGSReferenceEffect; -extern const void * RTTI_BGSShaderParticleGeometryData; -extern const void * RTTI_BSParticleShaderEmitter; -extern const void * RTTI_BSParticleShaderCubeEmitter; -extern const void * RTTI_BSParticleShaderSnowEmitter; -extern const void * RTTI_BSParticleShaderRainEmitter; -extern const void * RTTI_CellLoaderTask; -extern const void * RTTI_ImageSpaceModifierInstanceForm; -extern const void * RTTI_ImageSpaceModifierInstance; -extern const void * RTTI_ImageSpaceModifierInstanceTemp; -extern const void * RTTI_ImageSpaceModifierInstanceDOF; -extern const void * RTTI_ImageSpaceModifierInstanceRB; -extern const void * RTTI_TESClimate; -extern const void * RTTI_TESImageSpace; -extern const void * RTTI_NiFloatData; -extern const void * RTTI_TESImageSpaceModifier; -extern const void * RTTI_NiColorData; -extern const void * RTTI_hkBaseObject; -extern const void * RTTI_hkReferencedObject; -extern const void * RTTI_TESChildCell; -extern const void * RTTI_TESObjectLAND; -extern const void * RTTI_hkpMoppCode; -extern const void * RTTI_TESLandTexture; -extern const void * RTTI_hkpWorldCinfo; -extern const void * RTTI_hkpEntityListener; -extern const void * RTTI_CheckWithinMultiBoundTask; -extern const void * RTTI_ExtraProcessMiddleLow; -extern const void * RTTI_TESObjectCELL; -extern const void * RTTI_TESObjectCELL__IDecalRefFunctor; -extern const void * RTTI_TESWindListener; -extern const void * RTTI_bhkSerializable; -extern const void * RTTI_hkpShape; -extern const void * RTTI_bhkShape; -extern const void * RTTI_BSHandleRefObject; -extern const void * RTTI_TESObjectREFRDef__ILinkedReferenceFunctor; -extern const void * RTTI_BGSWaterCollisionManager__bhkPlaceableWater; -extern const void * RTTI_BGSWaterCollisionManager__bhkWaterfall; -extern const void * RTTI_hkpPhantomCallbackShape; -extern const void * RTTI_bhkEntity; -extern const void * RTTI_bhkPhantom; -extern const void * RTTI_bhkAabbPhantom; -extern const void * RTTI_BGSWaterCollisionManager__BGSWaterUpdateI; -extern const void * RTTI_bhkRigidBody; -extern const void * RTTI_TESObjectREFR; -extern const void * RTTI_bhkSimpleShapePhantom; -extern const void * RTTI_bhkCollisionObject; -extern const void * RTTI_bhkAcousticSpacePhantomCallbackShape; -extern const void * RTTI_bhkSphereRepShape; -extern const void * RTTI_bhkConvexShape; -extern const void * RTTI_bhkPCollisionObject; -extern const void * RTTI_bhkShapePhantom; -extern const void * RTTI_bhkSphereShape; -extern const void * RTTI_ReferenceEffectController; -extern const void * RTTI_OwnedController; -extern const void * RTTI_OwnedCameraEffectController; -extern const void * RTTI_bhkBoxShape; -extern const void * RTTI_IAnimationStreamWrite; -extern const void * RTTI_IAnimationStreamRead; -extern const void * RTTI_AnimationStreamLoadGame; -extern const void * RTTI_AnimationStreamSaveGame; -extern const void * RTTI_REFREventCallbacks__IEventCallback; -extern const void * RTTI_REFREventCallbacks__IEventCallbackFactory; -extern const void * RTTI_ExtraUsedMarkers; -extern const void * RTTI_ExtraReservedMarkers; -extern const void * RTTI_TESObjectREFRSync__REFRSyncController; -extern const void * RTTI_TESWaterForm; -extern const void * RTTI_TESWeather; -extern const void * RTTI_TESTexture1024; -extern const void * RTTI_TESWorldSpace; -extern const void * RTTI_BGSAcousticSpace; -extern const void * RTTI_NiFormArray; -extern const void * RTTI_BGSCameraPath; -extern const void * RTTI_BGSCameraShot; -extern const void * RTTI_BGSCollisionLayer; -extern const void * RTTI_BGSColorForm; -extern const void * RTTI_BGSDefaultObjectManager; -extern const void * RTTI_BGSFootstep; -extern const void * RTTI_BGSFootstepSet; -extern const void * RTTI_BGSImpactData; -extern const void * RTTI_BGSImpactDataSet; -extern const void * RTTI_BGSListForm; -extern const void * RTTI_BSMaterialObject; -extern const void * RTTI_BGSMaterialObject; -extern const void * RTTI_BGSMaterialType; -extern const void * RTTI_BGSMenuIcon; -extern const void * RTTI_BGSMessage; -extern const void * RTTI_BGSMusicPaletteTrack; -extern const void * RTTI_BGSMusicSilenceTrack; -extern const void * RTTI_BGSMusicSingleTrack; -extern const void * RTTI_BSIMusicTrack; -extern const void * RTTI_BGSMusicTrack; -extern const void * RTTI_BGSMusicTrackFormWrapper; -extern const void * RTTI_BGSMusicType; -extern const void * RTTI_BSIMusicType; -extern const void * RTTI_BSIReverbType; -extern const void * RTTI_BGSReverbParameters; -extern const void * RTTI_BSISoundCategory; -extern const void * RTTI_BGSSoundCategory; -extern const void * RTTI_BGSSoundDescriptorForm; -extern const void * RTTI_BSISoundDescriptor; -extern const void * RTTI_BSISoundOutputModel; -extern const void * RTTI_BGSSoundOutput; -extern const void * RTTI_BSISoundOutputModel__BSIAttenuationCharacteristics; -extern const void * RTTI_BGSSoundOutput__DynamicAttenuationCharacteristics; -extern const void * RTTI_BSISoundDescriptor__BSIPlaybackCharacteristics; -extern const void * RTTI_BGSSoundDescriptor; -extern const void * RTTI_BGSStandardSoundDef; -extern const void * RTTI_BGSStandardSoundDef__SoundPlaybackCharacteristics; -extern const void * RTTI_BGSTextureSet; -extern const void * RTTI_BSTextureSet; -extern const void * RTTI_BSShaderTextureSet; -extern const void * RTTI_IVisitProcedures; -extern const void * RTTI_MiscStatManager__IMiscStatVisitor; -extern const void * RTTI_MiscStatManager__FindStatByCRC; -extern const void * RTTI_BSScript__IForEachScriptObjectFunctor; -extern const void * RTTI_TESGlobal; -extern const void * RTTI_TESLoadScreen; -extern const void * RTTI_Script; -extern const void * RTTI_BSAnimGraphVisit__BShkbVisitor; -extern const void * RTTI_MagicTarget__ForEachActiveEffectVisitor; -extern const void * RTTI_TESObjectREFRDef__IAliasFunctor; -extern const void * RTTI_BSScript__IFunctionArguments; -extern const void * RTTI_BSScript__ZeroFunctionArguments; -extern const void * RTTI_MobIterOperator; -extern const void * RTTI_TESShout; -extern const void * RTTI_TESSound; -extern const void * RTTI_TESWordOfPower; -extern const void * RTTI_BGSAction; -extern const void * RTTI_BGSAssociationType; -extern const void * RTTI_TESModelPSA; -extern const void * RTTI_BGSBodyPartData; -extern const void * RTTI_BGSDialogueBranch; -extern const void * RTTI_PerkEntryVisitor; -extern const void * RTTI_BGSEntryPointFunctionData; -extern const void * RTTI_BGSEntryPointFunctionDataOneValue; -extern const void * RTTI_BGSEntryPointFunctionDataTwoValue; -extern const void * RTTI_BGSEntryPointFunctionDataLeveledList; -extern const void * RTTI_BGSEntryPointFunctionDataSpellItem; -extern const void * RTTI_BGSEntryPointFunctionDataBooleanGraphVariable; -extern const void * RTTI_BGSEntryPointFunctionDataText; -extern const void * RTTI_BGSEntryPointFunctionDataActivateChoice; -extern const void * RTTI_BGSEquipSlot; -extern const void * RTTI_BGSHeadPart; -extern const void * RTTI_TESModelTri; -extern const void * RTTI_BGSIdleMarker; -extern const void * RTTI_BGSKeyword; -extern const void * RTTI_BGSBaseAlias; -extern const void * RTTI_BGSLocAlias; -extern const void * RTTI_BGSMovementType; -extern const void * RTTI_BGSNote; -extern const void * RTTI_BGSPerk; -extern const void * RTTI_BGSPerkEntry; -extern const void * RTTI_BGSQuestPerkEntry; -extern const void * RTTI_BGSAbilityPerkEntry; -extern const void * RTTI_BGSEntryPointPerkEntry; -extern const void * RTTI_BGSRagdoll; -extern const void * RTTI_BGSRefAlias; -extern const void * RTTI_BGSRelationship; -extern const void * RTTI_BGSScene; -extern const void * RTTI_BGSSceneAction; -extern const void * RTTI_BGSSceneActionDialogue; -extern const void * RTTI_BGSSceneActionPackage; -extern const void * RTTI_BGSSceneActionTimer; -extern const void * RTTI_BGSVoiceType; -extern const void * RTTI_Reset3DMobIterator; -extern const void * RTTI_TESAnimGroup; -extern const void * RTTI_TESClass; -extern const void * RTTI_TESEyes; -extern const void * RTTI_TESFaction; -extern const void * RTTI_TESIdleForm; -extern const void * RTTI_ActorValueOwner; -extern const void * RTTI_TESActorBase; -extern const void * RTTI_TESNPC; -extern const void * RTTI_BSFaceGenModelExtraData; -extern const void * RTTI_TESQuest; -extern const void * RTTI_QueuedPromoteQuestTask; -extern const void * RTTI_TESRace; -extern const void * RTTI_BGSTextureModel; -extern const void * RTTI_BGSBehaviorGraphModel; -extern const void * RTTI_AttackAnimationArrayMap; -extern const void * RTTI_TESTopic; -extern const void * RTTI_TESTopicInfo; -extern const void * RTTI_bhkEntityListener; -extern const void * RTTI_BGSAcousticSpaceListener; -extern const void * RTTI_TargetEntry; -extern const void * RTTI_ZoneEntry; -extern const void * RTTI_BGSZoneTargetListener; -extern const void * RTTI_TrapTargetEntry; -extern const void * RTTI_bhkAction; -extern const void * RTTI_bhkCartTether; -extern const void * RTTI_hkConstraintCinfo; -extern const void * RTTI_bhkConstraint; -extern const void * RTTI_hkPrismaticConstraintCinfo; -extern const void * RTTI_bhkPrismaticConstraint; -extern const void * RTTI_bhkUnaryAction; -extern const void * RTTI_CellMopp; -extern const void * RTTI_BSTasklet; -extern const void * RTTI_BSTaskletData; -extern const void * RTTI_BSWin32TaskletData; -extern const void * RTTI_bhkBvTreeShape; -extern const void * RTTI_bhkTriSampledHeightFieldBvTreeShape; -extern const void * RTTI_CellMopp__HeightFieldWeldingTasklet; -extern const void * RTTI_hkpContactListener; -extern const void * RTTI_bhkContactListener; -extern const void * RTTI_bhkBackfaceContactListener; -extern const void * RTTI_FOCollisionListener; -extern const void * RTTI_hkpIslandActivationListener; -extern const void * RTTI_FOIslandActivationListener; -extern const void * RTTI_hkStreamWriter; -extern const void * RTTI_hkError; -extern const void * RTTI_hkStreamReader; -extern const void * RTTI_hkFileSystem; -extern const void * RTTI_HavokStreambufReader; -extern const void * RTTI_HavokStreambufWriter; -extern const void * RTTI_HavokFileStreambufReader; -extern const void * RTTI_HavokFileStreambufWriter; -extern const void * RTTI_hkNativeFileSystem; -extern const void * RTTI_HavokStreambufFactory; -extern const void * RTTI_HavokError; -extern const void * RTTI_hkpCdPointCollector; -extern const void * RTTI_hkpAllCdPointCollector; -extern const void * RTTI_LoadedAreaBound; -extern const void * RTTI_RagdollFurnitureListener; -extern const void * RTTI_hkpClosestRayHitCollector; -extern const void * RTTI_SpecificItemCollector; -extern const void * RTTI_hkpPhantomListener; -extern const void * RTTI_hkpCdBodyPairCollector; -extern const void * RTTI_bhkTrapListener; -extern const void * RTTI_TrapEntry; -extern const void * RTTI_TriggerEntry; -extern const void * RTTI_TESTrapListener; -extern const void * RTTI_hkpAllCdBodyPairTempCollector; -extern const void * RTTI_hkpAllCdPointTempCollector; -extern const void * RTTI_FindTriangleForLocationFilter; -extern const void * RTTI_FindTriangleForLocationFilterCheckDeltaZ; -extern const void * RTTI_Atmosphere; -extern const void * RTTI_Clouds; -extern const void * RTTI_Moon; -extern const void * RTTI_BSGeometryListCullingProcess; -extern const void * RTTI_Precipitation; -extern const void * RTTI_Sky; -extern const void * RTTI_TESWeather__SkyStaticFunctor; -extern const void * RTTI_SkyEffectController; -extern const void * RTTI_SkyStaticFindFunctor; -extern const void * RTTI_TempLoadGameBuffer; -extern const void * RTTI_SkyObject; -extern const void * RTTI_Stars; -extern const void * RTTI_NiBillboardNode; -extern const void * RTTI_Sun; -extern const void * RTTI_BShkNonTransformController; -extern const void * RTTI_BShkFloatController; -extern const void * RTTI_BGShkPhonemeController; -extern const void * RTTI_BSFaceGenAnimationData; -extern const void * RTTI_FutBinaryFileC; -extern const void * RTTI_BSResourceFaceGenBinaryFile; -extern const void * RTTI_BSFaceGenKeyframe; -extern const void * RTTI_BSFaceGenKeyframeExclusive; -extern const void * RTTI_BSFaceGenKeyframeMultiple; -extern const void * RTTI_BSFaceGenDB__TRI__QueuedHandles; -extern const void * RTTI_BSFaceGenModel; -extern const void * RTTI_BSFaceGenModelMap__Entry; -extern const void * RTTI_BSFaceGenMorphData; -extern const void * RTTI_BSFaceGenMorphDataHead; -extern const void * RTTI_BSFaceGenMorphDataHair; -extern const void * RTTI_BSFaceGenBaseMorphExtraData; -extern const void * RTTI_BSFaceGenNiNode; -extern const void * RTTI_BSFadeNodeCuller; -extern const void * RTTI_ActorValueInfo; -extern const void * RTTI_BGSSkillPerkTreeNode; -extern const void * RTTI_IAIWorldLocation; -extern const void * RTTI_BGSAIWorldLocation; -extern const void * RTTI_BGSAIWorldLocationRefRadius; -extern const void * RTTI_BGSAIWorldLocationPointRadius; -extern const void * RTTI_BGSAIWorldLocationInteriorCell; -extern const void * RTTI_BGSAttackDataMap; -extern const void * RTTI_BGSAttackData; -extern const void * RTTI_IAITarget; -extern const void * RTTI_BGSPackageDataBool; -extern const void * RTTI_BGSPackageDataFloat; -extern const void * RTTI_BGSPackageDataInt; -extern const void * RTTI_BGSPackageDataRefOLD; -extern const void * RTTI_BGSPackageDataLocation; -extern const void * RTTI_BGSPackageDataTargetSelector; -extern const void * RTTI_IPackageDataAIWorldLocationHandle; -extern const void * RTTI_IPackageData; -extern const void * RTTI_IAIWorldLocationHandle; -extern const void * RTTI_BGSPackageDataLocationWrapper; -extern const void * RTTI_BGSPackageDataObjectList; -extern const void * RTTI_ObjectListItem; -extern const void * RTTI_BGSPackageDataRef; -extern const void * RTTI_BGSPackageDataTopic; -extern const void * RTTI_IProcedureTreeExecState; -extern const void * RTTI_IProcedureTreeItem; -extern const void * RTTI_BGSProcedureDoneExecState; -extern const void * RTTI_BGSProcedureTreeConditionalItem; -extern const void * RTTI_BGSProcedureTreeBranch; -extern const void * RTTI_BGSProcedureTreeOneChildExecState; -extern const void * RTTI_BGSProcedureTreeSequence; -extern const void * RTTI_BGSProcedureTreeSequenceExecState; -extern const void * RTTI_BGSProcedureTreeStacked; -extern const void * RTTI_BGSProcedureTreeStackedExecState; -extern const void * RTTI_BGSProcedureTreeSimultaneous; -extern const void * RTTI_BGSProcedureTreeSimultaneousExecState; -extern const void * RTTI_BGSProcedureTreeRandom; -extern const void * RTTI_BGSProcedureTreeRandomExecState; -extern const void * RTTI_BGSProcedureGuardExecState; -extern const void * RTTI_BGSProcedureDialogueExecState; -extern const void * RTTI_BGSProcedureEatExecState; -extern const void * RTTI_BGSProcedureFindExecState; -extern const void * RTTI_BGSProcedureHoldPositionExecState; -extern const void * RTTI_BGSProcedureKeepAnEyeOnExecState; -extern const void * RTTI_BGSProcedureSayExecState; -extern const void * RTTI_BGSProcedureWaitExecState; -extern const void * RTTI_IProcedure; -extern const void * RTTI_BGSProcedureBase; -extern const void * RTTI_BGSProcedureDone; -extern const void * RTTI_IPackageDataTypeCheck; -extern const void * RTTI_BGSProcedureAcquire; -extern const void * RTTI_BGSProcedureAcquireExecState; -extern const void * RTTI_BGSProcedureActivate; -extern const void * RTTI_BGSProcedureActivateExecState; -extern const void * RTTI_BGSProcedureDialogue; -extern const void * RTTI_BGSProcedureDialogueActivate; -extern const void * RTTI_BGSProcedureDialogueActivateExecState; -extern const void * RTTI_BGSProcedureEat; -extern const void * RTTI_BGSProcedureEscort; -extern const void * RTTI_BGSProcedureEscortExecState; -extern const void * RTTI_BGSProcedureFind; -extern const void * RTTI_BGSProcedureFlee; -extern const void * RTTI_BGSProcedureFleeExecState; -extern const void * RTTI_BGSProcedureFlightGrab; -extern const void * RTTI_BGSProcedureFlightGrabExecState; -extern const void * RTTI_IMovementParameters; -extern const void * RTTI_BGSProcedureFollow; -extern const void * RTTI_BGSProcedureFollowTo; -extern const void * RTTI_BGSProcedureFollowExecState; -extern const void * RTTI_MovementParameters; -extern const void * RTTI_BGSProcedureForceGreet; -extern const void * RTTI_BGSProcedureGuard; -extern const void * RTTI_BGSProcedureHoldPosition; -extern const void * RTTI_BGSProcedureHover; -extern const void * RTTI_BGSProcedureHoverExecState; -extern const void * RTTI_BGSProcedureKeepAnEyeOn; -extern const void * RTTI_BGSProcedureLock; -extern const void * RTTI_BGSProcedureUnlock; -extern const void * RTTI_BGSProcedureLockUnlockExecState; -extern const void * RTTI_BGSProcedureOrbit; -extern const void * RTTI_BGSProcedureOrbitExecState; -extern const void * RTTI_BGSProcedurePatrol; -extern const void * RTTI_BGSProcedurePatrolExecState; -extern const void * RTTI_BGSProcedurePursue; -extern const void * RTTI_BGSProcedureSandboxExecState; -extern const void * RTTI_BGSProcedureSandbox; -extern const void * RTTI_BGSProcedureSay; -extern const void * RTTI_BGSProcedureShout; -extern const void * RTTI_BGSProcedureShoutExecState; -extern const void * RTTI_BGSProcedureSit; -extern const void * RTTI_BGSProcedureSleep; -extern const void * RTTI_BGSProcedureSitSleepExecState; -extern const void * RTTI_BGSProcedureTravel; -extern const void * RTTI_BGSProcedureTravelExecState; -extern const void * RTTI_BGSProcedureTreeProcedure; -extern const void * RTTI_BGSProcedureUseIdleMarker; -extern const void * RTTI_BGSProcedureUseIdleMarkerExecState; -extern const void * RTTI_BGSProcedureUseMagic; -extern const void * RTTI_BGSProcedureUseMagicExecState; -extern const void * RTTI_BGSProcedureUseWeapon; -extern const void * RTTI_BGSProcedureUseWeaponExecState; -extern const void * RTTI_BGSProcedureWait; -extern const void * RTTI_BGSProcedureWander; -extern const void * RTTI_BGSProcedureWanderExecState; -extern const void * RTTI_BGSVisitProceduresInitActorLocation; -extern const void * RTTI_BGSVisitProceduresCheckGuardWarnTarget; -extern const void * RTTI_PackageCreator; -extern const void * RTTI_TESPackage; -extern const void * RTTI_DialoguePackage; -extern const void * RTTI_TESPackageData; -extern const void * RTTI_TESAmbushPackageData; -extern const void * RTTI_TESCustomPackageData; -extern const void * RTTI_IProcedureTreeVisitor; -extern const void * RTTI_CustomUtils__HasForceGreetVisitor; -extern const void * RTTI_TESDialoguePackageData; -extern const void * RTTI_TESEatPackageData; -extern const void * RTTI_TESEscortPackageData; -extern const void * RTTI_TESFollowPackageData; -extern const void * RTTI_TESPatrolPackageData; -extern const void * RTTI_TESUseItemPackageData; -extern const void * RTTI_ActorPackageData; -extern const void * RTTI_TESUseWeaponPackageData; -extern const void * RTTI_UseWeaponActorPackageData; -extern const void * RTTI_PackageLocation; -extern const void * RTTI_ITempEffectFactory; -extern const void * RTTI_BSTempEffect; -extern const void * RTTI_BSTempEffectDebris; -extern const void * RTTI_BSTempEffectGeometryDecal; -extern const void * RTTI_BGSParticleObjectCloneTask; -extern const void * RTTI_BSTempEffectParticle; -extern const void * RTTI_BSTempEffectSimpleDecal; -extern const void * RTTI_BSLightingShaderMaterial; -extern const void * RTTI_BSTempEffectSPG; -extern const void * RTTI_BSTempEffectWeaponBlood; -extern const void * RTTI_BSTerrainEffect; -extern const void * RTTI_BSPSysHavokUpdateModifier__ICollisionObjectHandler; -extern const void * RTTI_NavMesh; -extern const void * RTTI_BSPathingStreamRead; -extern const void * RTTI_PathingStreamMasterFileRead; -extern const void * RTTI_BSNavmeshInfoMap__IVisitor; -extern const void * RTTI_NavMeshInfoMap; -extern const void * RTTI_hkpEntityActivationListener; -extern const void * RTTI_NavMeshObstacleManager; -extern const void * RTTI_bhkObstacleDeactivationListener; -extern const void * RTTI_bhkObstacleRemovalListener; -extern const void * RTTI_BSNavmeshReferenceObstacleArray; -extern const void * RTTI_ObstacleTaskData; -extern const void * RTTI_PathingCoverLocation; -extern const void * RTTI_BSPathingCellManager; -extern const void * RTTI_Pathing; -extern const void * RTTI_BSPathingCell; -extern const void * RTTI_PathingCell; -extern const void * RTTI_BSPathingDoor; -extern const void * RTTI_PathingDoor; -extern const void * RTTI_BSPathingLockData; -extern const void * RTTI_PathingLockData; -extern const void * RTTI_BSPathingNumericIDVisitor; -extern const void * RTTI_PathingNumericIDVisitor; -extern const void * RTTI_PathingRequest; -extern const void * RTTI_BSPathingSpace; -extern const void * RTTI_PathingSpace; -extern const void * RTTI_TeleportDoorSearch; -extern const void * RTTI_NavMeshSearchClosePoint; -extern const void * RTTI_NavMeshSearchFitSphere; -extern const void * RTTI_NavMeshSearchFlee; -extern const void * RTTI_NavMeshSearchHide; -extern const void * RTTI_BSNavmeshSearchHideFilter; -extern const void * RTTI_NavMeshSearchLOS; -extern const void * RTTI_NavMeshSearchMaxCost; -extern const void * RTTI_BSNavmeshSearchMaxCostFilters; -extern const void * RTTI_NavMeshSearchMultipleGoals; -extern const void * RTTI_NavMeshSearchSLPoint; -extern const void * RTTI_PathingRequestClosePoint; -extern const void * RTTI_IPathBuilderFactoryBase; -extern const void * RTTI_PathingRequestClosestGoal; -extern const void * RTTI_PathingRequestCover; -extern const void * RTTI_PathingRequestFlee; -extern const void * RTTI_PathingRequestFly; -extern const void * RTTI_PathingRequestFlyAction; -extern const void * RTTI_PathingRequestFlyHover; -extern const void * RTTI_PathingRequestFlyLand; -extern const void * RTTI_PathingRequestFlyOrbit; -extern const void * RTTI_PathingRequestFlyTakeOff; -extern const void * RTTI_PathingRequestHide; -extern const void * RTTI_PathingRequestLOS; -extern const void * RTTI_PathingRequestOptimalLocation; -extern const void * RTTI_PathingRequestRotate; -extern const void * RTTI_PathingRequestSafeStraightLine; -extern const void * RTTI_PathingRequestStopMoving; -extern const void * RTTI_BGSQueuedTerrainUpdate; -extern const void * RTTI_BGSQueuedTerrainUpgrade; -extern const void * RTTI_BGSQueuedTerrainDowngrade; -extern const void * RTTI_BGSQueuedTerrainInitialLoad; -extern const void * RTTI_BGSQueuedObjectUpgrade; -extern const void * RTTI_BGSQueuedObjectDowngrade; -extern const void * RTTI_BGSQueuedObjectInitialLoad; -extern const void * RTTI_BGSWaterCollisionManager__bhkAutoWater; -extern const void * RTTI_BGSWaterCollisionManager__bshkAutoWater; -extern const void * RTTI_TESWaterObject; -extern const void * RTTI_TESWaterReflections; -extern const void * RTTI_TESWaterDisplacement; -extern const void * RTTI_TESWaterNormals; -extern const void * RTTI_BGSStoryManagerTreeVisitor; -extern const void * RTTI_BGSStoryManagerQuestFinder; -extern const void * RTTI_BGSStoryManager; -extern const void * RTTI_BGSStoryManagerEventNode; -extern const void * RTTI_BGSStoryManagerQuestNode; -extern const void * RTTI_BGSStoryTeller; -extern const void * RTTI_BGSLOSData; -extern const void * RTTI_AnimationClipDataSingleton; -extern const void * RTTI_AnimationSystemUtils__QueuedReferenceAnimationTask; -extern const void * RTTI_hkaRaycastInterface; -extern const void * RTTI_BSIFootIkRaycastInterfaceDB; -extern const void * RTTI_CachedRaycastData; -extern const void * RTTI_BGSFootIkRaycastInterfaceDB; -extern const void * RTTI_IGamebryoSequenceGeneratorHolderSingleton; -extern const void * RTTI_BGSGamebryoSequenceGeneratorHolderSingleton; -extern const void * RTTI_BSSynchronizedClipGenerator__hkbSynchronizedAnimationScene; -extern const void * RTTI_BGSSynchronizedAnimationInstance; -extern const void * RTTI_BSLimbIKModifierUtilityCastInfo; -extern const void * RTTI_BSLimbIKModifierUtility; -extern const void * RTTI_IAnimationGraphManagerHolder; -extern const void * RTTI_IAnimationGraphManagerLoadingTask; -extern const void * RTTI_SimpleAnimationGraphManagerLoadingTask; -extern const void * RTTI_SimpleAnimationGraphManagerHolder; -extern const void * RTTI_WeaponAnimationGraphManagerHolder; -extern const void * RTTI_TailAnimationGraphManagerHolder; -extern const void * RTTI_TESCamera; -extern const void * RTTI_PlayerInputHandler; -extern const void * RTTI_ThirdPersonState; -extern const void * RTTI_DragonCameraState; -extern const void * RTTI_CombatBehaviorTreeRanged; -extern const void * RTTI_GRefCountImpl; -extern const void * RTTI_GRefCountImplCore; -extern const void * RTTI_GFxFunctionHandler; -extern const void * RTTI_MenuEventHandler; -extern const void * RTTI_CreationClubMenu; -extern const void * RTTI_MessageBoxData; -extern const void * RTTI_IMessageBoxCallback; -extern const void * RTTI_IUIMessageData; -extern const void * RTTI_CreationClub__AsyncModRequest; -extern const void * RTTI_CreationClub__CreationListRequest; -extern const void * RTTI_CreationClub__BundleChildrenRequest; -extern const void * RTTI_CreationClub__CategorySearchRequest; -extern const void * RTTI_CreationClub__GetCreationRequest; -extern const void * RTTI_CreationClub__GetIntRequest; -extern const void * RTTI_CreationClub__DownloadImageRequest; -extern const void * RTTI_CreationClub__StringStringRequest; -extern const void * RTTI_CreationClub__SavedGFxValueRequest; -extern const void * RTTI_CreationClub__DownloadCreationRequest; -extern const void * RTTI_CreationClub__CreationChanged_ConfirmResetCallback; -extern const void * RTTI_ModManagerMenu; -extern const void * RTTI_ModManager__AsyncModRequest; -extern const void * RTTI_ModManager__DownloadModRequest; -extern const void * RTTI_ModManager__CategorySearchRequest; -extern const void * RTTI_ModManager__GetDetailsRequest; -extern const void * RTTI_ModManager__GetDependencyRequest; -extern const void * RTTI_ModManager__DownloadImageRequest; -extern const void * RTTI_ModManager__SavedGFxValueRequest; -extern const void * RTTI_ModManager__GetIntRequest; -extern const void * RTTI_ModManager__StringStringRequest; -extern const void * RTTI_ModManager__ReportMod_CategoryCallback; -extern const void * RTTI_ModManager__ReportMod_ConfirmCallback; -extern const void * RTTI_ModManager__DeleteMod_ConfirmCallback; -extern const void * RTTI_ModManager__DeleteLibraryModConfirmCallback; -extern const void * RTTI_ModManager__DeleteAllModsConfirmCallback; -extern const void * RTTI_ModManager__CloseModManager_ConfirmCallback; -extern const void * RTTI_ModManager__ModsChanged_ConfirmResetCallback; -extern const void * RTTI_KinectMenu; -extern const void * RTTI_LoadWaitSpinner; -extern const void * RTTI_AbsorbEffect; -extern const void * RTTI_AccumulatingValueModifierEffect; -extern const void * RTTI_FindMaxMagnitudeVisitor; -extern const void * RTTI_FinishActiveEffectVisitor; -extern const void * RTTI_ActiveEffect; -extern const void * RTTI_ActiveEffectReferenceEffectController; -extern const void * RTTI_ActiveEffect__ForEachHitEffectVisitor; -extern const void * RTTI_ActorMagicCaster; -extern const void * RTTI_BSAttachTechniques__AttachTechniqueInput; -extern const void * RTTI_RefAttachTechniqueInput; -extern const void * RTTI_MagicItemDataCollector; -extern const void * RTTI_BoundItemEffect; -extern const void * RTTI_MagicTarget__IPostCreationModification; -extern const void * RTTI_CloakEffect; -extern const void * RTTI_CommandEffect; -extern const void * RTTI_CommandSummonedEffect; -extern const void * RTTI_CureEffect; -extern const void * RTTI_DarknessEffect; -extern const void * RTTI_DetectLifeEffect; -extern const void * RTTI_DisarmEffect; -extern const void * RTTI_DisguiseEffect; -extern const void * RTTI_DisguiseEffect__DetectionChecker; -extern const void * RTTI_DispelEffect; -extern const void * RTTI_DualValueModifierEffect; -extern const void * RTTI_EtherealizationEffect; -extern const void * RTTI_GrabActorEffect; -extern const void * RTTI_VampireLordEffect; -extern const void * RTTI_ConcussionEffect; -extern const void * RTTI_GuideEffect; -extern const void * RTTI_InvisibilityEffect; -extern const void * RTTI_LightEffect; -extern const void * RTTI_LightEffect__AttachBestLightVisitor; -extern const void * RTTI_LockEffect; -extern const void * RTTI_MagicCaster; -extern const void * RTTI_MagicCaster__PostCreationCallback; -extern const void * RTTI_ProcessLists__GetActorsFilter; -extern const void * RTTI_ActorTargetCheck; -extern const void * RTTI_MagicTarget__DispelFromBoundObject; -extern const void * RTTI_KeywordDispelFunctor; -extern const void * RTTI_IsSpellTargetFunctor; -extern const void * RTTI_IsSpellTypeTargetFunctor; -extern const void * RTTI_FindEffectKeywordOnTargetFunctor; -extern const void * RTTI_StartSpellHelpers__EffectGatherFunctor; -extern const void * RTTI_StartSpellHelpers__SpellEffectGatherFunctor; -extern const void * RTTI_StartSpellHelpers__DoneEffectGatherFunctor; -extern const void * RTTI_FindActiveEffectByIDFunctor; -extern const void * RTTI_EffectsCausingDamageFunctor; -extern const void * RTTI_ModelReferenceEffect; -extern const void * RTTI_NightEyeEffect; -extern const void * RTTI_ExtraMagicCaster; -extern const void * RTTI_NonActorMagicCaster; -extern const void * RTTI_OpenEffect; -extern const void * RTTI_ParalysisEffect; -extern const void * RTTI_PeakValueModifierEffect; -extern const void * RTTI_ReanimateEffect; -extern const void * RTTI_ReferenceEffect; -extern const void * RTTI_WeaponEnchantmentController; -extern const void * RTTI_ScriptedRefEffect; -extern const void * RTTI_ScriptEffect; -extern const void * RTTI_BSParticleShaderObjectEmitter; -extern const void * RTTI_BSParticleShaderRayEmitter; -extern const void * RTTI_BSParticleShaderCollisionEmitter; -extern const void * RTTI_BSParticleShaderGeometryEmitter; -extern const void * RTTI_ShaderReferenceEffect; -extern const void * RTTI_SlowTimeEffect; -extern const void * RTTI_SoulTrapEffect; -extern const void * RTTI_StaggerEffect; -extern const void * RTTI_BSPathing__CheckLineOfSightFilter; -extern const void * RTTI_CheckLineOfSightFilterMisc; -extern const void * RTTI_SummonPlacementEffect; -extern const void * RTTI_SummonCreatureEffect; -extern const void * RTTI_TargetValueModifierEffect; -extern const void * RTTI_RallyEffect; -extern const void * RTTI_DemoralizeEffect; -extern const void * RTTI_TurnUndeadEffect; -extern const void * RTTI_BanishEffect; -extern const void * RTTI_CalmEffect; -extern const void * RTTI_FrenzyEffect; -extern const void * RTTI_TelekinesisEffect; -extern const void * RTTI_ValueAndConditionsEffect; -extern const void * RTTI_ValueModifierEffect; -extern const void * RTTI_WerewolfEffect; -extern const void * RTTI_WerewolfFeedEffect; -extern const void * RTTI_TESAudio__ScriptedMusicState; -extern const void * RTTI_BGSPlayerMusicChanger; -extern const void * RTTI_MenuTopicManager; -extern const void * RTTI_BNETSystem__ModsChanged_ConfirmResetCallback; -extern const void * RTTI_DownloadAll__uiCallback; -extern const void * RTTI_JobListManager__ServingThread; -extern const void * RTTI_BGSSaveLoadManager; -extern const void * RTTI_bgs__saveload__SaveOperationRequest; -extern const void * RTTI_bgs__saveload__LoadRequest; -extern const void * RTTI_bgs__saveload__LoadEntryRequest; -extern const void * RTTI_BGSSaveLoadManager__Thread; -extern const void * RTTI_bgs__saveload__Request; -extern const void * RTTI_BGSSaveLoadStatsMap; -extern const void * RTTI_BGSLoadGameBuffer; -extern const void * RTTI_BGSSaveFormBuffer; -extern const void * RTTI_BGSSaveGameBuffer; -extern const void * RTTI_SaveStorageWrapper; -extern const void * RTTI_LoadStorageWrapper; -extern const void * RTTI_BSResource__CacheDrive__Op; -extern const void * RTTI_BGSMoviePlayer; -extern const void * RTTI_IExplosionFactory; -extern const void * RTTI_ChainExplosion; -extern const void * RTTI_EnhanceWeaponEffect; -extern const void * RTTI_GarbageCollector; -extern const void * RTTI_IMovementControllerNPCFunctor; -extern const void * RTTI_MovementAvoidBoxEventAdapter; -extern const void * RTTI_PathManagerPositionPlayerAdapter; -extern const void * RTTI_CharacterCollisionMessagePlayerAdapter; -extern const void * RTTI_PlayerSleepWaitMovementControllerAdapter; -extern const void * RTTI_PlayerSleepWaitMovementControllerAdapter__SwitchToLoadedSetControllerFunctor; -extern const void * RTTI_PlayerSleepWaitMovementControllerAdapter__SwitchToUnloadedSetControllerFunctor; -extern const void * RTTI_DoorObstacleAdapter; -extern const void * RTTI_SystemEventAdapter; -extern const void * RTTI_Main; -extern const void * RTTI_bhkTelekinesisListener; -extern const void * RTTI_MagicFavorites; -extern const void * RTTI_BSTreeManager__IQueryCullingCamera; -extern const void * RTTI_RegSettingCollection; -extern const void * RTTI_BGSImpactManager; -extern const void * RTTI_InitTESThread; -extern const void * RTTI_DetectSignOut; -extern const void * RTTI_IMemoryManagerFileFactory; -extern const void * RTTI_IMemoryManagerFile; -extern const void * RTTI_MemoryManagerFile; -extern const void * RTTI_SceneGraph; -extern const void * RTTI_SeenData; -extern const void * RTTI_IntSeenData; -extern const void * RTTI_SpawnHazardEffect; -extern const void * RTTI_BSUIMessageData; -extern const void * RTTI_hkpWorldPostSimulationListener; -extern const void * RTTI_IMovementState; -extern const void * RTTI_IPostAnimationChannelUpdateFunctor; -extern const void * RTTI_IAnimationSetCallbackFunctor; -extern const void * RTTI_Actor; -extern const void * RTTI_PackageList__IPackageVisitor; -extern const void * RTTI_ProcessCallbackAdapter; -extern const void * RTTI_SaveLoadMagicCasterVisitor; -extern const void * RTTI_SaveGameMagicCasterVisitor; -extern const void * RTTI_LoadGameMagicCasterVisitor; -extern const void * RTTI_RevertSelectedSpellFunctor; -extern const void * RTTI_HoldWardSpellsActiveEffectVisitor; -extern const void * RTTI_hkpAllCdBodyPairCollector; -extern const void * RTTI_bhkFilteredCdBodyCollector; -extern const void * RTTI_Actor__ForEachSpellVisitor; -extern const void * RTTI_InventoryChanges__FindBestSoulGemVisitor; -extern const void * RTTI_HasSpellVisitor; -extern const void * RTTI_SumHostileEffectsFunctor; -extern const void * RTTI_ActorMediator; -extern const void * RTTI_IMovementInterface; -extern const void * RTTI_ActorState; -extern const void * RTTI_BGSVisitProceduresProcess; -extern const void * RTTI_BGSVisitProceduresInitActorAnimPose; -extern const void * RTTI_DetectionListener; -extern const void * RTTI_InstantInteractionCallback; -extern const void * RTTI_RunActionAnimationLoadedCallback; -extern const void * RTTI_BGSPerk__FindPerkInRanksVisitor; -extern const void * RTTI_BGSPerk__ApplyPerksVisitor; -extern const void * RTTI_WeaponAnimationLoadedCallback; -extern const void * RTTI_BSDoorHavokController; -extern const void * RTTI_BSPlayerDistanceCheckController; -extern const void * RTTI_BSSimpleScaleController; -extern const void * RTTI_Character; -extern const void * RTTI_HighActorCuller; -extern const void * RTTI_MountInteraction; -extern const void * RTTI_BGSPerk__AddPerkVisitor; -extern const void * RTTI_bhkMouseSpringAction; -extern const void * RTTI_PlayerCharacter; -extern const void * RTTI_IAllowEGMCacheClear; -extern const void * RTTI_hkpFirstCdBodyPairCollector; -extern const void * RTTI_TargetLock__SetTargetLockFilter; -extern const void * RTTI_PlayerRegionState; -extern const void * RTTI_IMovementFormIDManager; -extern const void * RTTI_ProcessListMovementInterface; -extern const void * RTTI_RefrInteraction; -extern const void * RTTI_SyncQueueObj; -extern const void * RTTI_MovementParametersFixed; -extern const void * RTTI_ActorMover; -extern const void * RTTI_bhkCharacterCollisionHandler; -extern const void * RTTI_CharacterCollisionHandler; -extern const void * RTTI_IMovementAvoidanceManager; -extern const void * RTTI_MovementAvoidanceManager; -extern const void * RTTI_MovementControllerNPC; -extern const void * RTTI_IMovementMessageInterface; -extern const void * RTTI_IMovementDirectControl; -extern const void * RTTI_IMovementPlannerDirectControl; -extern const void * RTTI_IMovementSelectIdle; -extern const void * RTTI_IMovementMotionDrivenControl; -extern const void * RTTI_BSPathingStreamWrite; -extern const void * RTTI_BSPathingStreamSimpleBufferWrite; -extern const void * RTTI_MovementHandlerAgentDirectControl; -extern const void * RTTI_IMovementSetPlayerControls; -extern const void * RTTI_MovementHandlerAgentPlayerControls; -extern const void * RTTI_MovementHandlerAgentPlayerControlsActionTrigger; -extern const void * RTTI_IMovementSetSprinting; -extern const void * RTTI_MovementHandlerAgentSprintActionTrigger; -extern const void * RTTI_MovementHandlerAgentStairsHelper; -extern const void * RTTI_MovementMessage; -extern const void * RTTI_MovementMessageActorCollision; -extern const void * RTTI_MovementMessageMovementTypeChange; -extern const void * RTTI_MovementPlannerAgentDirectControl; -extern const void * RTTI_MovementPlannerAgentHorseControls; -extern const void * RTTI_IMovementSetKeepOffsetFromActor; -extern const void * RTTI_MovementPlannerAgentKeepOffset; -extern const void * RTTI_IMovementSetWarp; -extern const void * RTTI_MovementPlannerAgentWarp; -extern const void * RTTI_MovementTweenerAgentAnimationDriven; -extern const void * RTTI_ITweenerNodeFollowerSetup; -extern const void * RTTI_MovementTweenerAgentNodeFollower; -extern const void * RTTI_PathingStreamLoadGame; -extern const void * RTTI_PathingStreamSaveGame; -extern const void * RTTI_InputEvent; -extern const void * RTTI_ButtonEvent; -extern const void * RTTI_HeldStateHandler; -extern const void * RTTI_PlayerControls; -extern const void * RTTI_MovementHandler; -extern const void * RTTI_LookHandler; -extern const void * RTTI_SprintHandler; -extern const void * RTTI_ReadyWeaponHandler; -extern const void * RTTI_AutoMoveHandler; -extern const void * RTTI_ToggleRunHandler; -extern const void * RTTI_ActivateHandler; -extern const void * RTTI_JumpHandler; -extern const void * RTTI_ShoutHandler; -extern const void * RTTI_AttackBlockHandler; -extern const void * RTTI_RunHandler; -extern const void * RTTI_SneakHandler; -extern const void * RTTI_TogglePOVHandler; -extern const void * RTTI_IDEvent; -extern const void * RTTI_IStaticAvoidNodeManager; -extern const void * RTTI_StaticAvoidNodeManager; -extern const void * RTTI_AlarmPackage; -extern const void * RTTI_CustomActorPackageData; -extern const void * RTTI_EscortActorPackageData; -extern const void * RTTI_FleePackage; -extern const void * RTTI_GuardActorPackageData; -extern const void * RTTI_GuardPackageData; -extern const void * RTTI_PatrolActorPackageData; -extern const void * RTTI_SandBoxActorPackageData; -extern const void * RTTI_SpectatorPackage; -extern const void * RTTI_TrespassPackage; -extern const void * RTTI_ActorKnowledge; -extern const void * RTTI_DetectionCollector; -extern const void * RTTI_DetectionState; -extern const void * RTTI_WeaponRightSwingHandler; -extern const void * RTTI_WeaponLeftSwingHandler; -extern const void * RTTI_AttackWinStartHandler; -extern const void * RTTI_AttackWinEndHandler; -extern const void * RTTI_AttackStopHandler; -extern const void * RTTI_RecoilStopHandler; -extern const void * RTTI_LeftHandSpellFireHandler; -extern const void * RTTI_RightHandSpellFireHandler; -extern const void * RTTI_VoiceSpellFireHandler; -extern const void * RTTI_LeftHandSpellCastHandler; -extern const void * RTTI_RightHandSpellCastHandler; -extern const void * RTTI_VoiceSpellCastHandler; -extern const void * RTTI_WeaponBeginDrawRightHandler; -extern const void * RTTI_WeaponBeginSheatheRightHandler; -extern const void * RTTI_RightHandWeaponDrawHandler; -extern const void * RTTI_RightHandWeaponSheatheHandler; -extern const void * RTTI_CameraOverrideStartHandler; -extern const void * RTTI_CameraOverrideStopHandler; -extern const void * RTTI_HitFrameHandler; -extern const void * RTTI_AnticipateAttackHandler; -extern const void * RTTI_StaggeredStopHandler; -extern const void * RTTI_ChairEnterHandler; -extern const void * RTTI_PlayerChairEnterHandler; -extern const void * RTTI_BedEnterHandler; -extern const void * RTTI_PlayerBedEnterHandler; -extern const void * RTTI_ChairFurnitureExitHandler; -extern const void * RTTI_BedFurnitureExitHandler; -extern const void * RTTI_PlayerFurnitureExitHandler; -extern const void * RTTI_KillActorHandler; -extern const void * RTTI_DecapitateHandler; -extern const void * RTTI_HeadTrackingOnHandler; -extern const void * RTTI_HeadTrackingOffHandler; -extern const void * RTTI_FlightTakeOffHandler; -extern const void * RTTI_FlightCruisingHandler; -extern const void * RTTI_FlightHoveringHandler; -extern const void * RTTI_FlightLandingHandler; -extern const void * RTTI_FlightPerchingHandler; -extern const void * RTTI_FlightLandHandler; -extern const void * RTTI_FlightLandEndHandler; -extern const void * RTTI_FlightActionHandler; -extern const void * RTTI_FlightActionEntryEndHandler; -extern const void * RTTI_FlightActionEndHandler; -extern const void * RTTI_FlightActionGrabHandler; -extern const void * RTTI_FlightActionReleaseHandler; -extern const void * RTTI_FlightCrashLandStartHandler; -extern const void * RTTI_BowDrawnHandler; -extern const void * RTTI_BowReleaseHandler; -extern const void * RTTI_ArrowAttachHandler; -extern const void * RTTI_ArrowDetachHandler; -extern const void * RTTI_ArrowReleaseHandler; -extern const void * RTTI_BowZoomStartHandler; -extern const void * RTTI_BowZoomStopHandler; -extern const void * RTTI_InterruptCastHandler; -extern const void * RTTI_EndSummonAnimationHandler; -extern const void * RTTI_PickNewIdleHandler; -extern const void * RTTI_DeathStopHandler; -extern const void * RTTI_ActionActivateDoneHandler; -extern const void * RTTI_StopMountCameraHandler; -extern const void * RTTI_PairedStopHandler; -extern const void * RTTI_CameraShakeHandler; -extern const void * RTTI_KillMoveStartHandler; -extern const void * RTTI_KillMoveEndHandler; -extern const void * RTTI_DeathEmoteHandler; -extern const void * RTTI_AddRagdollHandler; -extern const void * RTTI_MotionDrivenHandler; -extern const void * RTTI_AnimationDrivenHandler; -extern const void * RTTI_AllowRotationHandler; -extern const void * RTTI_RemoveRagdollHandler; -extern const void * RTTI_RagdollStartHandler; -extern const void * RTTI_GetUpStartHandler; -extern const void * RTTI_GetUpEndHandler; -extern const void * RTTI_MountDismountEndHandler; -extern const void * RTTI_ExitCartBeginHandler; -extern const void * RTTI_ExitCartEndHandler; -extern const void * RTTI_NPCAttachHandler; -extern const void * RTTI_NPCDetachHandler; -extern const void * RTTI_EnableCharacterBumperHandler; -extern const void * RTTI_DisableCharacterBumperHandler; -extern const void * RTTI_AnimationObjectLoadHandler; -extern const void * RTTI_AnimationObjectDrawHandler; -extern const void * RTTI_EnableCharacterPitchHandler; -extern const void * RTTI_DisableCharacterPitchHandler; -extern const void * RTTI_JumpAnimEventHandler; -extern const void * RTTI_IdleDialogueEnterHandler; -extern const void * RTTI_IdleDialogueExitHandler; -extern const void * RTTI_AnimatedCameraStartHandler; -extern const void * RTTI_AnimatedCameraDeltaStartHandler; -extern const void * RTTI_AnimatedCameraEndHandler; -extern const void * RTTI_PitchOverrideStartHandler; -extern const void * RTTI_PitchOverrideEndHandler; -extern const void * RTTI_MTStateHandler; -extern const void * RTTI_ZeroPitchHandler; -extern const void * RTTI_VampireFeedEndHandler; -extern const void * RTTI_BGShkMatFadeController; -extern const void * RTTI_BSDirectAtModifierInterface; -extern const void * RTTI_BSPassByTargetTriggerModifierInterface; -extern const void * RTTI_BSRagdollContactListenerModifierInterface; -extern const void * RTTI_ArrowProjectile; -extern const void * RTTI_BarrierPhantomCallbackShape; -extern const void * RTTI_BarrierProjectile; -extern const void * RTTI_bhkSPCollisionObject; -extern const void * RTTI_BeamProjectile; -extern const void * RTTI_ConeProjectile; -extern const void * RTTI_Explosion; -extern const void * RTTI_hkpFixedBufferCdPointCollector; -extern const void * RTTI_FlameProjectile; -extern const void * RTTI_GrenadeProjectile; -extern const void * RTTI_Hazard; -extern const void * RTTI_MissileProjectile; -extern const void * RTTI_hkHingeConstraintCinfo; -extern const void * RTTI_bhkHingeConstraint; -extern const void * RTTI_Projectile; -extern const void * RTTI_ProjectilePickCache; -extern const void * RTTI_HealthDamageFunctor; -extern const void * RTTI_VATS__ICommandListVisitor; -extern const void * RTTI_CombatAimController; -extern const void * RTTI_CombatTrackTargetAimController; -extern const void * RTTI_CombatMeleeAimController; -extern const void * RTTI_CombatProjectileAimController; -extern const void * RTTI_CombatDisableAimController; -extern const void * RTTI_CombatObject; -extern const void * RTTI_CombatAimControllerBase; -extern const void * RTTI_CombatArea; -extern const void * RTTI_CombatAreaRadius; -extern const void * RTTI_CombatAreaReference; -extern const void * RTTI_CombatAreaStandard; -extern const void * RTTI_CombatAreaHoldPosition; -extern const void * RTTI_CombatBlackboardKeyBase; -extern const void * RTTI_CombatCoverSearchResult; -extern const void * RTTI_CombatCoverLocation; -extern const void * RTTI_CombatCoverSearchDebugData; -extern const void * RTTI_CombatCoverSearch; -extern const void * RTTI_CombatGroupDetectionListener; -extern const void * RTTI_GatherSpellsFunctor; -extern const void * RTTI_CombatInventoryItem; -extern const void * RTTI_CombatInventoryItemComposite; -extern const void * RTTI_CombatInventoryItemMelee; -extern const void * RTTI_CombatInventoryItemRanged; -extern const void * RTTI_CombatInventoryItemShield; -extern const void * RTTI_CombatInventoryItemOneHandedBlock; -extern const void * RTTI_CombatInventoryItemTorch; -extern const void * RTTI_CombatInventoryItemMagic; -extern const void * RTTI_CombatInventoryItemShout; -extern const void * RTTI_CombatInventoryItemStaff; -extern const void * RTTI_CombatInventoryItemPotion; -extern const void * RTTI_CombatInventoryItemScroll; -extern const void * RTTI_CombatMagicCasterOffensive; -extern const void * RTTI_CombatMagicCasterWard; -extern const void * RTTI_CombatMagicCasterRestore; -extern const void * RTTI_CombatMagicCasterSummon; -extern const void * RTTI_CombatMagicCasterStagger; -extern const void * RTTI_CombatMagicCasterDisarm; -extern const void * RTTI_CombatMagicCasterCloak; -extern const void * RTTI_CombatMagicCasterLight; -extern const void * RTTI_CombatMagicCasterInvisibility; -extern const void * RTTI_CombatMagicCasterBoundItem; -extern const void * RTTI_CombatMagicCasterArmor; -extern const void * RTTI_CombatMagicCasterTargetEffect; -extern const void * RTTI_CombatMagicCasterParalyze; -extern const void * RTTI_CombatMagicCasterScript; -extern const void * RTTI_CombatMagicCaster; -extern const void * RTTI_CombatMagicItemData; -extern const void * RTTI_CombatMagicItemSkillChecker; -extern const void * RTTI_CombatMagicCasterReanimate; -extern const void * RTTI_CombatPathingRequest; -extern const void * RTTI_CombatTargetLocationSearchResult; -extern const void * RTTI_CombatTargetLocation; -extern const void * RTTI_CombatTargetLocationSearch; -extern const void * RTTI_CombatPath; -extern const void * RTTI_CombatTargetSelector; -extern const void * RTTI_CombatTargetSelectorStandard; -extern const void * RTTI_CombatTargetSelectorFixed; -extern const void * RTTI_CombatThreat; -extern const void * RTTI_hkpClosestCdPointCollector; -extern const void * RTTI_CombatBehaviorResource; -extern const void * RTTI_CombatBehaviorTreeRootNode; -extern const void * RTTI_CombatBehaviorTreeLinkNode; -extern const void * RTTI_CombatBehaviorTree; -extern const void * RTTI_CombatBehaviorTreeCombat; -extern const void * RTTI_CombatBehaviorTreeNode; -extern const void * RTTI_CombatBehaviorTreeAcquireWeapon; -extern const void * RTTI_CombatBehaviorTreeAction; -extern const void * RTTI_CombatBehaviorTreeActionEquipmentSelector; -extern const void * RTTI_CombatBehaviorTreeWrapperNode; -extern const void * RTTI_CombatBehaviorTreeDodgeThreat; -extern const void * RTTI_CombatBehaviorTreeBlock; -extern const void * RTTI_CombatBehaviorTreeCloseMovement; -extern const void * RTTI_CombatPathSpeedController; -extern const void * RTTI_CombatApproachTargetSpeedController; -extern const void * RTTI_CombatBehaviorTreeFindAttackLocation; -extern const void * RTTI_CombatBehaviorTreeFlankingMovement; -extern const void * RTTI_CombatFlankingSearchData; -extern const void * RTTI_CombatBehaviorTreeFlee; -extern const void * RTTI_CombatBehaviorTreeHide; -extern const void * RTTI_CombatBehaviorTreeFlight; -extern const void * RTTI_DiveBombSpeedController; -extern const void * RTTI_CombatBehaviorTreeLowCombat; -extern const void * RTTI_CombatBehaviorTreeMagic; -extern const void * RTTI_CombatBehaviorTreeMelee; -extern const void * RTTI_CombatDisableActionController; -extern const void * RTTI_CombatBehaviorTreeCheckUnreachableTarget; -extern const void * RTTI_CombatBehaviorTreeReturnToCombatArea; -extern const void * RTTI_CombatBehaviorTreeExitWater; -extern const void * RTTI_CombatBehaviorTreeMovement; -extern const void * RTTI_CombatBehaviorTreeRangedMovement; -extern const void * RTTI_CombatBehaviorTreeSearch; -extern const void * RTTI_CombatSearchLockData; -extern const void * RTTI_CombatBehaviorTreeShout; -extern const void * RTTI_CombatBehaviorTreeUseCover; -extern const void * RTTI_CombatBehaviorTreeUsePotion; -extern const void * RTTI_IPathBuilder; -extern const void * RTTI_CombatNavmeshSearch; -extern const void * RTTI_CombatPathBuilder; -extern const void * RTTI_CombatPathBuilderStandard; -extern const void * RTTI_CombatPathBuilderOpen; -extern const void * RTTI_CombatPathingRequestStandard; -extern const void * RTTI_CombatPathingRequestAdapter; -extern const void * RTTI_CombatPathingRequestMultiGoal; -extern const void * RTTI_CombatPathingDebugData; -extern const void * RTTI_HorseCameraState; -extern const void * RTTI_FirstPersonState; -extern const void * RTTI_PlayerCamera; -extern const void * RTTI_AutoVanityState; -extern const void * RTTI_FreeCameraState; -extern const void * RTTI_IronSightsState; -extern const void * RTTI_FurnitureCameraState; -extern const void * RTTI_PlayerCameraTransitionState; -extern const void * RTTI_BleedoutCameraState; -extern const void * RTTI_TweenMenuCameraState; -extern const void * RTTI_VATSCameraState; -extern const void * RTTI_FxResponseArgsBase; -extern const void * RTTI_FxResponseArgsList; -extern const void * RTTI_StandardItemData; -extern const void * RTTI_BarterMenu; -extern const void * RTTI_BookMenu; -extern const void * RTTI_IStringForwarder; -extern const void * RTTI_Console; -extern const void * RTTI_ConsoleNativeUIMenu; -extern const void * RTTI_ContainerMenu; -extern const void * RTTI_FxDelegateHandler; -extern const void * RTTI_CraftingSubMenus__CraftingSubMenu; -extern const void * RTTI_CraftingMenu; -extern const void * RTTI_CraftingSubMenus__ConstructibleObjectMenu; -extern const void * RTTI_CraftingSubMenus__ConstructibleObjectMenu__CreationConfirmCallback; -extern const void * RTTI_CraftingSubMenus__SmithingMenu; -extern const void * RTTI_CraftingSubMenus__SmithingMenu__SmithingConfirmCallback; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuCallback; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuExitCallback; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuCraftCallback; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuDisenchantCallback; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__CategoryListEntry; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__ItemChangeEntry; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantmentEntry; -extern const void * RTTI_CraftingSubMenus__EnchantConstructMenu__CreateEffectFunctor; -extern const void * RTTI_CraftingSubMenus__AlchemyMenu; -extern const void * RTTI_CraftingSubMenus__AlchemyMenu__CraftItemCallback; -extern const void * RTTI_CraftingSubMenus__AlchemyMenu__QuitMenuCallback; -extern const void * RTTI_CraftingSubMenus__AlchemyMenu__ModEffectivenessFunctor; -extern const void * RTTI_CreditsMenu; -extern const void * RTTI_CursorMenu; -extern const void * RTTI_DialogueMenu; -extern const void * RTTI_FaderMenu; -extern const void * RTTI_FavoritesMenu; -extern const void * RTTI_GiftMenu; -extern const void * RTTI_HUDObject; -extern const void * RTTI_HUDMeter; -extern const void * RTTI_HUDMenu; -extern const void * RTTI_HUDNotifications; -extern const void * RTTI_ActorValueMeter; -extern const void * RTTI_ShoutMeter; -extern const void * RTTI_HUDChargeMeter; -extern const void * RTTI_Compass; -extern const void * RTTI_EnemyHealth; -extern const void * RTTI_FloatingQuestMarker; -extern const void * RTTI_StealthMeter; -extern const void * RTTI_HelpMessageManager; -extern const void * RTTI_NewInventoryMenuItemLoadTask; -extern const void * RTTI_Inventory3DManager; -extern const void * RTTI_InventoryMenu; -extern const void * RTTI_LevelUpMenu; -extern const void * RTTI_LoadingMenu; -extern const void * RTTI_LockpickingMenu; -extern const void * RTTI_MagicItemData; -extern const void * RTTI_MagicMenu; -extern const void * RTTI_MainMenu; -extern const void * RTTI_DLCPurchased__OpenVisitCreationClubCallback; -extern const void * RTTI_DLCPurchased__PurchasedDLCDialogCallback; -extern const void * RTTI_NeedToUpdateCreationClubCallback; -extern const void * RTTI_MenuControls; -extern const void * RTTI_ClickHandler; -extern const void * RTTI_DirectionHandler; -extern const void * RTTI_ConsoleOpenHandler; -extern const void * RTTI_QuickSaveLoadHandler; -extern const void * RTTI_MenuOpenHandler; -extern const void * RTTI_FavoritesHandler; -extern const void * RTTI_ScreenshotHandler; -extern const void * RTTI_MessageBoxMenu; -extern const void * RTTI_MistMenu; -extern const void * RTTI_ThumbstickEvent; -extern const void * RTTI_RaceSexCamera; -extern const void * RTTI_RaceSexMenu; -extern const void * RTTI_SafeZoneMenu; -extern const void * RTTI_SleepWaitMenu; -extern const void * RTTI_StatsNode; -extern const void * RTTI_StatsMenu; -extern const void * RTTI_LineNode; -extern const void * RTTI_StreamingInstallMenu; -extern const void * RTTI_TitleSequenceMenu; -extern const void * RTTI_TrainingMenu; -extern const void * RTTI_TutorialMenu; -extern const void * RTTI_TweenMenu; -extern const void * RTTI_UIBlurManager; -extern const void * RTTI_HUDData; -extern const void * RTTI_ConsoleData; -extern const void * RTTI_FaderData; -extern const void * RTTI_InventoryUpdateData; -extern const void * RTTI_RefHandleUIData; -extern const void * RTTI_TESFormUIData; -extern const void * RTTI_LoadingMenuData; -extern const void * RTTI_KinectStateChangeData; -extern const void * RTTI_KinectUserEventData; -extern const void * RTTI_UISaveLoadManager; -extern const void * RTTI_bgs__saveload__BuildSaveListRequest; -extern const void * RTTI_LocalMapMenu__InputHandler; -extern const void * RTTI_TransitionState; -extern const void * RTTI_MapCameraStates__Exit; -extern const void * RTTI_MapCameraStates__Transition; -extern const void * RTTI_IMapCameraCallbacks; -extern const void * RTTI_MapCamera; -extern const void * RTTI_MapCameraStates__World; -extern const void * RTTI_MapMenu; -extern const void * RTTI_MapInputHandler; -extern const void * RTTI_MapLookHandler; -extern const void * RTTI_MapMoveHandler; -extern const void * RTTI_MapZoomHandler; -extern const void * RTTI_JournalTab; -extern const void * RTTI_Journal_QuestsTab; -extern const void * RTTI_ModManagerData; -extern const void * RTTI_Journal_SystemTab; -extern const void * RTTI_JournalInputMapping__RemapHandler; -extern const void * RTTI_Journal_StatsTab; -extern const void * RTTI_JournalMenu; -extern const void * RTTI_SkyrimScript__Internal__CallbackList; -extern const void * RTTI_SkyrimScript__Internal__AnimationCallbacks; -extern const void * RTTI_SkyrimScript__DelayFunctor; -extern const void * RTTI_SkyrimScript__DelayFunctorFactory; -extern const void * RTTI_SkyrimScript__Logger; -extern const void * RTTI_SkyrimScript__PathingCallbackMgr; -extern const void * RTTI_SkyrimScript__Internal__IProfileCallQuery; -extern const void * RTTI_SkyrimScript__Profiler; -extern const void * RTTI_SkyrimScript__QuestCallbackMgr; -extern const void * RTTI_SkyrimScript__SavePatcher; -extern const void * RTTI_SkyrimScript__SoundCallbackMgr; -extern const void * RTTI_BSScript__IStore; -extern const void * RTTI_SkyrimScript__Store; -extern const void * RTTI_BSResource__ArchiveFoundStreamCB; -extern const void * RTTI_BSCounterStorage; -extern const void * RTTI_BSScript__IObjectHandlePolicy; -extern const void * RTTI_BSScript__IStackCallbackSaveInterface; -extern const void * RTTI_BSScript__IStackCallbackFunctor; -extern const void * RTTI_BSScript__IProfilePolicy; -extern const void * RTTI_BSScript__ILoader; -extern const void * RTTI_BSScript__ObjectBindPolicy; -extern const void * RTTI_BSScript__IFreezeQuery; -extern const void * RTTI_BSScript__ISavePatcherInterface; -extern const void * RTTI_SkyrimScript__HandlePolicy; -extern const void * RTTI_SkyrimScript__SaveFileHandleReaderWriter; -extern const void * RTTI_SkyrimScript__ObjectBindPolicy; -extern const void * RTTI_SkyrimVM; -extern const void * RTTI_SkyrimVM__ISendEventFilter; -extern const void * RTTI_SkyrimVM__EventRelayFunctor; -extern const void * RTTI_SkyrimVM__EffectEventRelayFunctor; -extern const void * RTTI_SkyrimVM__SleepStartEventFunctor; -extern const void * RTTI_SkyrimVM__SleepStopEventFunctor; -extern const void * RTTI_SkyrimVM__InventoryEventFilter; -extern const void * RTTI_IGiftMenuScriptCallback; -extern const void * RTTI_SkyrimSpeechRecognition; -extern const void * RTTI_hkaFootPlacementIkSolver; -extern const void * RTTI_hkReferencedObjectLock; -extern const void * RTTI_hkMemoryAllocator; -extern const void * RTTI_hkLifoAllocator; -extern const void * RTTI_hkContainerTempAllocator__Allocator; -extern const void * RTTI_hkContainerHeapAllocator__Allocator; -extern const void * RTTI_hkContainerDebugAllocator__Allocator; -extern const void * RTTI_hkErrStream; -extern const void * RTTI_hkLocalFrameGroup; -extern const void * RTTI_hkLocalFrame; -extern const void * RTTI_hkSimpleLocalFrame; -extern const void * RTTI_hkBufferedStreamReader; -extern const void * RTTI_hkBufferedStreamWriter; -extern const void * RTTI_hkSeekableStreamReader; -extern const void * RTTI_hkStdioStreamReader; -extern const void * RTTI_hkStdioStreamWriter; -extern const void * RTTI_hkOstream; -extern const void * RTTI_hkMemoryTrackStreamWriter; -extern const void * RTTI_hkArrayStreamWriter; -extern const void * RTTI_hkStatisticsCollector; -extern const void * RTTI_hkCrc32StreamWriter; -extern const void * RTTI_hkStackTracer; -extern const void * RTTI_hkDummySingleton; -extern const void * RTTI_hkTrackerSerializableScanSnapshot; -extern const void * RTTI_hkTrackerTypeTreeTextCache; -extern const void * RTTI_hkMemoryTrackStreamReader; -extern const void * RTTI_hkOArchive; -extern const void * RTTI_hkDefaultError; -extern const void * RTTI_hkSocket; -extern const void * RTTI_hkSocket__ReaderAdapter; -extern const void * RTTI_hkSocket__WriterAdapter; -extern const void * RTTI_hkTrackerScanSnapshot; -extern const void * RTTI_hkBsdSocket; -extern const void * RTTI_hkTrackerTypeTreeCache; -extern const void * RTTI_hkMemoryTracker; -extern const void * RTTI_hkDefaultMemoryTracker; -extern const void * RTTI_hkMemorySystem; -extern const void * RTTI_hkDummyMemoryTrackerImpl; -extern const void * RTTI_hkTrackerArrayLayoutHandler; -extern const void * RTTI_hkTrackerStringPtrLayoutHandler; -extern const void * RTTI_hkTrackerCachedHashMapLayoutHandler; -extern const void * RTTI_hkTrackerStringMapLayoutHandler; -extern const void * RTTI_hkTrackerTypeLayout; -extern const void * RTTI_hkTrackerLayoutCalculator; -extern const void * RTTI_hkTrackerLayoutHandler; -extern const void * RTTI_hkTrackerRefPtrLayoutHandler; -extern const void * RTTI_hkbRagdollDriver; -extern const void * RTTI_hkbNode; -extern const void * RTTI_hkbBindable; -extern const void * RTTI_hkbBehaviorGraph; -extern const void * RTTI_hkbNodeInternalStateInfo; -extern const void * RTTI_hkbGenerator; -extern const void * RTTI_hkbVariableValueSet; -extern const void * RTTI_hkbBehaviorGraph__GlobalTransitionData; -extern const void * RTTI_hkbFootIkDriver; -extern const void * RTTI_hkbAnimationBindingSet; -extern const void * RTTI_hkbCharacter; -extern const void * RTTI_hkbWorld; -extern const void * RTTI_hkbSceneModifier; -extern const void * RTTI_hkbFootIkSceneModifier; -extern const void * RTTI_hkbHandIkSceneModifier; -extern const void * RTTI_hkbHandIkFixupSceneModifier; -extern const void * RTTI_hkbBindableCollector; -extern const void * RTTI_hkbBindable__CacheBindablesCollector; -extern const void * RTTI_hkbNode__BoundVariablesCollector; -extern const void * RTTI_hkbAttachmentSetup; -extern const void * RTTI_hkbEventPayload; -extern const void * RTTI_hkbRealEventPayload; -extern const void * RTTI_hkbIntEventPayload; -extern const void * RTTI_hkbStringEventPayload; -extern const void * RTTI_hkbNamedEventPayload; -extern const void * RTTI_hkbNamedRealEventPayload; -extern const void * RTTI_hkbNamedIntEventPayload; -extern const void * RTTI_hkbNamedStringEventPayload; -extern const void * RTTI_hkbEventPayloadList; -extern const void * RTTI_hkbVariableBindingSet; -extern const void * RTTI_hkbHandle; -extern const void * RTTI_hkbHandIkDriverInfo; -extern const void * RTTI_hkbTransitionEffect; -extern const void * RTTI_hkbProjectStringData; -extern const void * RTTI_hkbBehaviorGraphInternalState; -extern const void * RTTI_hkbBehaviorGraphData; -extern const void * RTTI_hkbStateListener; -extern const void * RTTI_hkbSequence; -extern const void * RTTI_hkbBehaviorGraphStringData; -extern const void * RTTI_hkbBoneIndexArray; -extern const void * RTTI_hkbBoneWeightArray; -extern const void * RTTI_hkbCharacterStringData; -extern const void * RTTI_hkbFootIkDriverInfo; -extern const void * RTTI_hkbMirroredSkeletonInfo; -extern const void * RTTI_hkbCondition; -extern const void * RTTI_hkbCompiledExpressionSet; -extern const void * RTTI_hkbExpressionCondition; -extern const void * RTTI_hkbStringCondition; -extern const void * RTTI_hkbBehaviorReferenceGenerator; -extern const void * RTTI_hkbBlenderGeneratorChild; -extern const void * RTTI_hkbBlenderGenerator; -extern const void * RTTI_hkbBlenderGeneratorInternalState; -extern const void * RTTI_hkbClipTriggerArray; -extern const void * RTTI_hkbClipGeneratorInternalState; -extern const void * RTTI_hkbRegisteredGenerator; -extern const void * RTTI_hkbManualSelectorGenerator; -extern const void * RTTI_hkbManualSelectorGeneratorInternalState; -extern const void * RTTI_hkbModifier; -extern const void * RTTI_hkbModifierGenerator; -extern const void * RTTI_hkbPoseMatchingGenerator; -extern const void * RTTI_hkbPoseMatchingGeneratorInternalState; -extern const void * RTTI_hkbReferencePoseGenerator; -extern const void * RTTI_hkbAttachmentModifier; -extern const void * RTTI_hkbAttributeModifier; -extern const void * RTTI_hkbCharacterControllerModifier; -extern const void * RTTI_hkbCharacterControllerModifierInternalState; -extern const void * RTTI_hkbCombineTransformsModifier; -extern const void * RTTI_hkbCombineTransformsModifierInternalState; -extern const void * RTTI_hkbComputeDirectionModifier; -extern const void * RTTI_hkbComputeDirectionModifierInternalState; -extern const void * RTTI_hkbComputeRotationFromAxisAngleModifier; -extern const void * RTTI_hkbComputeRotationFromAxisAngleModifierInternalState; -extern const void * RTTI_hkbComputeRotationToTargetModifier; -extern const void * RTTI_hkbComputeRotationToTargetModifierInternalState; -extern const void * RTTI_hkbDampingModifier; -extern const void * RTTI_hkbDampingModifierInternalState; -extern const void * RTTI_hkbModifierWrapper; -extern const void * RTTI_hkbDelayedModifier; -extern const void * RTTI_hkbDelayedModifierInternalState; -extern const void * RTTI_hkbDetectCloseToGroundModifier; -extern const void * RTTI_hkbDetectCloseToGroundModifierInternalState; -extern const void * RTTI_hkbExpressionDataArray; -extern const void * RTTI_hkbEvaluateExpressionModifier; -extern const void * RTTI_hkbEvaluateExpressionModifierInternalState; -extern const void * RTTI_hkbEvaluateHandleModifier; -extern const void * RTTI_hkbEventDrivenModifier; -extern const void * RTTI_hkbEventDrivenModifierInternalState; -extern const void * RTTI_hkbEventRangeDataArray; -extern const void * RTTI_hkbEventsFromRangeModifier; -extern const void * RTTI_hkbEventsFromRangeModifierInternalState; -extern const void * RTTI_hkbFootIkControlsModifier; -extern const void * RTTI_hkbFootIkModifier; -extern const void * RTTI_hkbGetHandleOnBoneModifier; -extern const void * RTTI_hkbGetUpModifier; -extern const void * RTTI_hkbGetUpModifierInternalState; -extern const void * RTTI_hkbGetWorldFromModelModifier; -extern const void * RTTI_hkbGetWorldFromModelModifierInternalState; -extern const void * RTTI_hkbHandIkControlsModifier; -extern const void * RTTI_hkbHandIkModifier; -extern const void * RTTI_hkbModifierList; -extern const void * RTTI_hkbLookAtModifier; -extern const void * RTTI_hkbLookAtModifierInternalState; -extern const void * RTTI_hkbMirrorModifier; -extern const void * RTTI_hkbMoveCharacterModifier; -extern const void * RTTI_hkbMoveCharacterModifierInternalState; -extern const void * RTTI_hkbProxyModifier; -extern const void * RTTI_hkbExtractRagdollPoseModifier; -extern const void * RTTI_hkbKeyframeBonesModifier; -extern const void * RTTI_hkbPoweredRagdollControlsModifier; -extern const void * RTTI_hkbRigidBodyRagdollControlsModifier; -extern const void * RTTI_hkbRotateCharacterModifier; -extern const void * RTTI_hkbRotateCharacterModifierInternalState; -extern const void * RTTI_hkbSenseHandleModifier; -extern const void * RTTI_hkbSetWorldFromModelModifier; -extern const void * RTTI_hkbTimerModifier; -extern const void * RTTI_hkbTimerModifierInternalState; -extern const void * RTTI_hkbTransformVectorModifier; -extern const void * RTTI_hkbTransformVectorModifierInternalState; -extern const void * RTTI_hkbTwistModifier; -extern const void * RTTI_hkbSequenceStringData; -extern const void * RTTI_hkbEventSequencedData; -extern const void * RTTI_hkbRealVariableSequencedData; -extern const void * RTTI_hkbBoolVariableSequencedData; -extern const void * RTTI_hkbIntVariableSequencedData; -extern const void * RTTI_hkbSequenceInternalState; -extern const void * RTTI_hkbSequencedData; -extern const void * RTTI_hkbStateMachine__TransitionInfoArray; -extern const void * RTTI_hkbStateMachine__EventPropertyArray; -extern const void * RTTI_hkbStateMachine__StateInfo; -extern const void * RTTI_hkbStateMachineInternalState; -extern const void * RTTI_hkbBlendingTransitionEffect; -extern const void * RTTI_hkbBlendingTransitionEffectInternalState; -extern const void * RTTI_hkbGeneratorTransitionEffect; -extern const void * RTTI_hkbGeneratorTransitionEffectInternalState; -extern const void * RTTI_hkbClipGenerator; -extern const void * RTTI_hkbStateMachine; -extern const void * RTTI_hkbAnimationBindingWithTriggers; -extern const void * RTTI_hkbHandIkDriver; -extern const void * RTTI_hkbAttachmentSceneModifier; -extern const void * RTTI_hkbAttachmentFixupSceneModifier; -extern const void * RTTI_hkbRagdollSceneModifier; -extern const void * RTTI_hkbCharacterControllerSceneModifier; -extern const void * RTTI_hkbCharacterSetup; -extern const void * RTTI_hkbProjectData; -extern const void * RTTI_hkbCharacterData; -extern const void * RTTI_hkpCharacterControllerCinfo; -extern const void * RTTI_hkpCharacterProxyCinfo; -extern const void * RTTI_hkLocalFrameCollector; -extern const void * RTTI_hkbClosestLocalFrameCollector; -extern const void * RTTI_hkbDefaultRaycastInterface; -extern const void * RTTI_hkbSymbolIdMap; -extern const void * RTTI_hkVtableClassRegistry; -extern const void * RTTI_hkClassNameRegistry; -extern const void * RTTI_hkTypeInfoRegistry; -extern const void * RTTI_hkBuiltinTypeRegistry; -extern const void * RTTI_hkDynamicClassNameRegistry; -extern const void * RTTI_hkDefaultClassNameRegistry; -extern const void * RTTI_hkDefaultBuiltinTypeRegistry; -extern const void * RTTI_hkObjectCopier; -extern const void * RTTI_hkStaticClassNameRegistry; -extern const void * RTTI_hkResourceContainer; -extern const void * RTTI_hkResourceMap; -extern const void * RTTI_hkResourceBase; -extern const void * RTTI_hkResourceHandle; -extern const void * RTTI_hkMemoryResourceHandle; -extern const void * RTTI_hkMemoryResourceContainer; -extern const void * RTTI_hkContainerResourceMap; -extern const void * RTTI_hkpShapeContainer; -extern const void * RTTI_hkpSingleShapeContainer; -extern const void * RTTI_hkpBvShape; -extern const void * RTTI_hkpConvexShape; -extern const void * RTTI_hkpSphereRepShape; -extern const void * RTTI_hkpBoxShape; -extern const void * RTTI_hkpConvexTransformShapeBase; -extern const void * RTTI_hkpHeightFieldShape; -extern const void * RTTI_hkpPlaneShape; -extern const void * RTTI_hkpSphereShape; -extern const void * RTTI_hkpCapsuleShape; -extern const void * RTTI_hkpCollidableCollidableFilter; -extern const void * RTTI_hkpRayCollidableFilter; -extern const void * RTTI_hkpShapeCollectionFilter; -extern const void * RTTI_hkpRayShapeCollectionFilter; -extern const void * RTTI_hkpGroupFilter; -extern const void * RTTI_hkpCollisionFilter; -extern const void * RTTI_hkpConvexListFilter; -extern const void * RTTI_hkpTriangleShape; -extern const void * RTTI_hkpDefaultConvexListFilter; -extern const void * RTTI_hkpBvTreeShape; -extern const void * RTTI_hkpCollisionFilterList; -extern const void * RTTI_hkpNullCollisionFilter; -extern const void * RTTI_hkpMoppModifier; -extern const void * RTTI_hkpRemoveTerminalsMoppModifier; -extern const void * RTTI_hkMoppBvTreeShapeBase; -extern const void * RTTI_hkpMoppBvTreeShape; -extern const void * RTTI_hkpConvexTransformShape; -extern const void * RTTI_hkpConvexTranslateShape; -extern const void * RTTI_hkpConvexVerticesConnectivity; -extern const void * RTTI_hkpConvexListShape; -extern const void * RTTI_hkpMultiSphereShape; -extern const void * RTTI_hkpMultiRayShape; -extern const void * RTTI_hkpTransformShape; -extern const void * RTTI_hkpShapeInfo; -extern const void * RTTI_hkpSampledHeightFieldShape; -extern const void * RTTI_hkpCompressedSampledHeightFieldShape; -extern const void * RTTI_hkpStorageSampledHeightFieldShape; -extern const void * RTTI_hkpShapeCollection; -extern const void * RTTI_hkpTriSampledHeightFieldCollection; -extern const void * RTTI_hkpTriSampledHeightFieldBvTreeShape; -extern const void * RTTI_hkpListShape; -extern const void * RTTI_hkpRemoveTerminalsMoppModifier2; -extern const void * RTTI_hkpCylinderShape; -extern const void * RTTI_hkpWorldObject; -extern const void * RTTI_hkpMotion; -extern const void * RTTI_hkpMaxSizeMotion; -extern const void * RTTI_hkpKeyframedRigidMotion; -extern const void * RTTI_hkpEntity; -extern const void * RTTI_hkpFixedRigidMotion; -extern const void * RTTI_hkpSphereMotion; -extern const void * RTTI_hkpBoxMotion; -extern const void * RTTI_hkpThinBoxMotion; -extern const void * RTTI_hkpCharacterMotion; -extern const void * RTTI_hkpRigidBody; -extern const void * RTTI_hkpPhantom; -extern const void * RTTI_hkpAabbPhantom; -extern const void * RTTI_hkpConstraintData; -extern const void * RTTI_hkpPrismaticConstraintData; -extern const void * RTTI_hkpAction; -extern const void * RTTI_hkpUnaryAction; -extern const void * RTTI_hkpConstraintInstance; -extern const void * RTTI_hkpConstraintMotor; -extern const void * RTTI_hkpConstraintListener; -extern const void * RTTI_hkWorldMemoryAvailableWatchDog; -extern const void * RTTI_hkpPhysicsSystem; -extern const void * RTTI_hkpSimulation; -extern const void * RTTI_hkpPairCollisionFilter; -extern const void * RTTI_hkpConstraintCollisionFilter; -extern const void * RTTI_hkpBallAndSocketConstraintData; -extern const void * RTTI_hkpCogWheelConstraintData; -extern const void * RTTI_hkpHingeConstraintData; -extern const void * RTTI_hkpLimitedHingeConstraintData; -extern const void * RTTI_hkpParametricCurve; -extern const void * RTTI_hkpLinearParametricCurve; -extern const void * RTTI_hkpPointToPathConstraintData; -extern const void * RTTI_hkpPointToPlaneConstraintData; -extern const void * RTTI_hkpRackAndPinionConstraintData; -extern const void * RTTI_hkpRagdollConstraintData; -extern const void * RTTI_hkpStiffSpringConstraintData; -extern const void * RTTI_hkpWheelConstraintData; -extern const void * RTTI_hkpRotationalConstraintData; -extern const void * RTTI_hkpHingeLimitsData; -extern const void * RTTI_hkpRagdollLimitsData; -extern const void * RTTI_hkpConstraintChainInstanceAction; -extern const void * RTTI_hkpConstraintChainInstance; -extern const void * RTTI_hkpLimitedForceConstraintMotor; -extern const void * RTTI_hkpCallbackConstraintMotor; -extern const void * RTTI_hkpPositionConstraintMotor; -extern const void * RTTI_hkpSpringDamperConstraintMotor; -extern const void * RTTI_hkpVelocityConstraintMotor; -extern const void * RTTI_hkpPulleyConstraintData; -extern const void * RTTI_hkpShapePhantom; -extern const void * RTTI_hkpCachingShapePhantom; -extern const void * RTTI_hkpSimpleShapePhantom; -extern const void * RTTI_hkpDefaultWorldMemoryWatchDog; -extern const void * RTTI_hkpWorld; -extern const void * RTTI_hkpBroadPhaseCastCollector; -extern const void * RTTI_hkpContactMgr; -extern const void * RTTI_hkpContactMgrFactory; -extern const void * RTTI_hkpNullContactMgr; -extern const void * RTTI_hkpNullContactMgrFactory; -extern const void * RTTI_hkpBroadPhaseListener; -extern const void * RTTI_hkpSimpleWorldRayCaster; -extern const void * RTTI_hkpWorldRayCaster; -extern const void * RTTI_hkpWorldLinearCaster; -extern const void * RTTI_hkpPhantomBroadPhaseListener; -extern const void * RTTI_hkpBroadPhaseBorderListener; -extern const void * RTTI_hkpCollisionCallbackUtil; -extern const void * RTTI_hkpConstraintOwner; -extern const void * RTTI_hkpBreakableConstraintData; -extern const void * RTTI_hkpConstraintChainData; -extern const void * RTTI_hkpBallSocketChainData; -extern const void * RTTI_hkpStiffSpringChainData; -extern const void * RTTI_hkpGenericConstraintData; -extern const void * RTTI_hkpMalleableConstraintData; -extern const void * RTTI_hkpEntityEntityBroadPhaseListener; -extern const void * RTTI_hkpSimulationIsland; -extern const void * RTTI_hkpBroadPhaseBorder; -extern const void * RTTI_hkpPhantomOverlapListener; -extern const void * RTTI_hkpWorldDeletionListener; -extern const void * RTTI_hkpSimpleConstraintContactMgr; -extern const void * RTTI_hkpSimpleContactConstraintData; -extern const void * RTTI_hkpDynamicsContactMgr; -extern const void * RTTI_hkpSimpleConstraintContactMgr__Factory; -extern const void * RTTI_hkpReportContactMgr; -extern const void * RTTI_hkpReportContactMgr__Factory; -extern const void * RTTI_hkpWorldMaintenanceMgr; -extern const void * RTTI_hkpDefaultWorldMaintenanceMgr; -extern const void * RTTI_hkpWorldExtension; -extern const void * RTTI_hkpEndOfStepCallbackUtil; -extern const void * RTTI_hkpConvexPieceStreamData; -extern const void * RTTI_hkpCharacterContext; -extern const void * RTTI_hkPackfileWriter__AddObjectListener; -extern const void * RTTI_hkpHavokSnapshot__ConvertListener; -extern const void * RTTI_hkpCharacterStateManager; -extern const void * RTTI_hkpCharacterRigidBody; -extern const void * RTTI_hkpMouseSpringAction; -extern const void * RTTI_hkpBinaryAction; -extern const void * RTTI_hkpAngularDashpotAction; -extern const void * RTTI_hkpDashpotAction; -extern const void * RTTI_hkpMotorAction; -extern const void * RTTI_hkpReorientAction; -extern const void * RTTI_hkpSpringAction; -extern const void * RTTI_hkpCharacterRigidBodyCinfo; -extern const void * RTTI_hkpPoweredChainMapper; -extern const void * RTTI_hkpConstrainedSystemFilter; -extern const void * RTTI_hkpDisableEntityCollisionFilter; -extern const void * RTTI_hkpGroupCollisionFilter; -extern const void * RTTI_hkpSerializedAgentNnEntry; -extern const void * RTTI_hkpPhysicsSystemWithContacts; -extern const void * RTTI_hkpSerializedDisplayMarker; -extern const void * RTTI_hkpSerializedDisplayMarkerList; -extern const void * RTTI_hkpSerializedDisplayRbTransforms; -extern const void * RTTI_hkpDisplayBindingData; -extern const void * RTTI_hkpDisplayBindingData__RigidBody; -extern const void * RTTI_hkpDisplayBindingData__PhysicsSystem; -extern const void * RTTI_hkpPhysicsData; -extern const void * RTTI_hkpCharacterProxy; -extern const void * RTTI_hkpTriggerVolume; -extern const void * RTTI_hkpFirstPersonGun; -extern const void * RTTI_hkpBallGun; -extern const void * RTTI_hkpGravityGun; -extern const void * RTTI_hkpMountedBallGun; -extern const void * RTTI_hkpProjectileGun; -extern const void * RTTI_hkpGunProjectile; -extern const void * RTTI_hkpSaveContactPointsUtil__EntitySelector; -extern const void * RTTI_BSLimbIKModifierCastInfo; -extern const void * RTTI_BSILimbIKModifierSingleton; -extern const void * RTTI_BGSGamebryoSequenceGenerator; -extern const void * RTTI_BSIStateManagerModifier__BSIStateManagerStateListener; -extern const void * RTTI_BSSynchronizedClipGenerator; -extern const void * RTTI_BSSynchronizedClipGenerator__hkbDefaultSynchronizedScene; -extern const void * RTTI_BSIDirectAtModifierSingleton; -extern const void * RTTI_BSIPassByTargetTriggerModifierSingleton; -extern const void * RTTI_BSIRagdollContactListenerModifierSingleton; -extern const void * RTTI_BSRagdollContactListenerModifier; -extern const void * RTTI_BSIStateManagerModifier; -extern const void * RTTI_BSBoneSwitchGenerator; -extern const void * RTTI_BSBoneSwitchGeneratorBoneData; -extern const void * RTTI_BSCyclicBlendTransitionGenerator; -extern const void * RTTI_BSOffsetAnimationGenerator; -extern const void * RTTI_BSiStateTaggingGenerator; -extern const void * RTTI_BSComputeAddBoneAnimModifier; -extern const void * RTTI_BSDecomposeVectorModifier; -extern const void * RTTI_BSDirectAtModifier; -extern const void * RTTI_BSDistTriggerModifier; -extern const void * RTTI_BSEventEveryNEventsModifier; -extern const void * RTTI_BSEventOnDeactivateModifier; -extern const void * RTTI_BSEventOnFalseToTrueModifier; -extern const void * RTTI_BSGetTimeStepModifier; -extern const void * RTTI_BSInterpValueModifier; -extern const void * RTTI_BSIsActiveModifier; -extern const void * RTTI_BSLimbIKModifier; -extern const void * RTTI_BSLookAtModifier; -extern const void * RTTI_BSModifyOnceModifier; -extern const void * RTTI_BSPassByTargetTriggerModifier; -extern const void * RTTI_BSSpeedSamplerModifier; -extern const void * RTTI_BSTimerModifier; -extern const void * RTTI_BSTweenerModifier; -extern const void * RTTI_hkaAnimationBinding; -extern const void * RTTI_BSSynchronizedClipGeneratorUtils__FindEventFunctor; -extern const void * RTTI_BSAnimationGraphManager; -extern const void * RTTI_hkLoader; -extern const void * RTTI_BShkbHkxDB__ProjectDBData; -extern const void * RTTI_BShkbHkxDB__DBData; -extern const void * RTTI_BShkbHkxDB__QueuedHandles; -extern const void * RTTI_BShkbHkxDB__StreamAdaptor; -extern const void * RTTI_BSAnimationGraphLoadScrapper; -extern const void * RTTI_bhkIWorldStepListener; -extern const void * RTTI_hkaSkeleton; -extern const void * RTTI_BSIRagdollDriver; -extern const void * RTTI_BShkbAnimationGraph; -extern const void * RTTI_BSISpeedSamplerDB; -extern const void * RTTI_BSSpeedSamplerDBManager; -extern const void * RTTI_BShkVisibilityController; -extern const void * RTTI_BShkbUtils__GraphInspectionFunctor; -extern const void * RTTI_hkbAssetLoader; -extern const void * RTTI_BShkbUtils__ProspectiveEventClipAddingFunctor; -extern const void * RTTI_IAnimationClipLoaderSingleton; -extern const void * RTTI_AnimationFileManagerSingleton; -extern const void * RTTI_hkaSkeletonMapper; -extern const void * RTTI_hkaRagdollInstance; -extern const void * RTTI_hkaDefaultAnimationControl; -extern const void * RTTI_hkaDefaultAnimationControlMapperData; -extern const void * RTTI_hkaAnimatedReferenceFrame; -extern const void * RTTI_hkaAnimation; -extern const void * RTTI_hkaInterleavedUncompressedAnimation; -extern const void * RTTI_hkaQuantizedAnimation; -extern const void * RTTI_hkaSplineCompressedAnimation; -extern const void * RTTI_hkaAnimationPreviewColorContainer; -extern const void * RTTI_hkaDefaultAnimatedReferenceFrame; -extern const void * RTTI_hkaFootstepAnalysisInfoContainer; -extern const void * RTTI_hkaBoneAttachment; -extern const void * RTTI_hkaAnimationContainer; -extern const void * RTTI_hkaMirroredSkeleton; -extern const void * RTTI_hkaAnimationControl; -extern const void * RTTI_hkpCollisionDispatcher; -extern const void * RTTI_hkpNullBroadPhaseListener; -extern const void * RTTI_hkpCollisionAgent; -extern const void * RTTI_hkpNullAgent; -extern const void * RTTI_hkp3AxisSweep; -extern const void * RTTI_hkpBroadPhase; -extern const void * RTTI_hkTraceStream; -extern const void * RTTI_hkpStorageMeshShape; -extern const void * RTTI_hkpStorageMeshShape__SubpartStorage; -extern const void * RTTI_hkpStorageExtendedMeshShape; -extern const void * RTTI_hkpStorageExtendedMeshShape__MeshSubpartStorage; -extern const void * RTTI_hkpStorageExtendedMeshShape__ShapeSubpartStorage; -extern const void * RTTI_hkTagfileWriter; -extern const void * RTTI_hkTagfileWriter__AddDataObjectListener; -extern const void * RTTI_hkTagfileReader; -extern const void * RTTI_hkBinaryTagfileWriter; -extern const void * RTTI_hkXmlTagfileReader; -extern const void * RTTI_hkXmlTagfileWriter; -extern const void * RTTI_hkpFastMeshShape; -extern const void * RTTI_hkpMapPointsToSubShapeContactMgr; -extern const void * RTTI_hkpPoweredChainData; -extern const void * RTTI_hkpConvexVerticesShape; -extern const void * RTTI_hkResource; -extern const void * RTTI_BShkbUtils__SaveDataRestoreFunctor; -extern const void * RTTI_hkpConstraintUtils__CollectConstraintsFilter; -extern const void * RTTI_hkpEaseConstraintsAction; -extern const void * RTTI_hkpEaseConstraintsAction__CollectSupportedConstraints; -extern const void * RTTI_hkpEasePenetrationAction; -extern const void * RTTI_BSiStateTaggingUtils__BSiStateTaggingStateListener; -extern const void * RTTI_hkxAnimatedFloat; -extern const void * RTTI_hkxAnimatedMatrix; -extern const void * RTTI_hkxAnimatedQuaternion; -extern const void * RTTI_hkxAnimatedVector; -extern const void * RTTI_hkxSparselyAnimatedBool; -extern const void * RTTI_hkxSparselyAnimatedInt; -extern const void * RTTI_hkxEnum; -extern const void * RTTI_hkxSparselyAnimatedEnum; -extern const void * RTTI_hkxSparselyAnimatedString; -extern const void * RTTI_hkxAttributeHolder; -extern const void * RTTI_hkxCamera; -extern const void * RTTI_hkxNode; -extern const void * RTTI_hkxLight; -extern const void * RTTI_hkxMaterial; -extern const void * RTTI_hkxMaterialEffect; -extern const void * RTTI_hkxMaterialShader; -extern const void * RTTI_hkxTextureFile; -extern const void * RTTI_hkxTextureInplace; -extern const void * RTTI_hkxEdgeSelectionChannel; -extern const void * RTTI_hkxTriangleSelectionChannel; -extern const void * RTTI_hkxVertexFloatDataChannel; -extern const void * RTTI_hkxVertexIntDataChannel; -extern const void * RTTI_hkxVertexSelectionChannel; -extern const void * RTTI_hkxVertexVectorDataChannel; -extern const void * RTTI_hkxIndexBuffer; -extern const void * RTTI_hkxMeshSection; -extern const void * RTTI_hkxMesh__UserChannelInfo; -extern const void * RTTI_hkxNodeSelectionSet; -extern const void * RTTI_hkxSkinBinding; -extern const void * RTTI_hkxScene; -extern const void * RTTI_hkaMeshBinding; -extern const void * RTTI_hkaFootstepAnalysisInfo; -extern const void * RTTI_hkpMeshShape; -extern const void * RTTI_hkpExtendedMeshShape; -extern const void * RTTI_hkPackfileWriter; -extern const void * RTTI_hkIstream; -extern const void * RTTI_hkDataWorld; -extern const void * RTTI_hkDataObjectImpl; -extern const void * RTTI_hkDataArrayImpl; -extern const void * RTTI_hkDataClassImpl; -extern const void * RTTI_hkDataClassDict; -extern const void * RTTI_hkDataObjectDict; -extern const void * RTTI_hkDataWorldDict; -extern const void * RTTI_hkDataRefCounted; -extern const void * RTTI_VariableIntArrayImplementation; -extern const void * RTTI_ByteArrayImplementation; -extern const void * RTTI_ArrayOfTuplesImplementation; -extern const void * RTTI_ArrayOfTuplesImplementation__View; -extern const void * RTTI_RealArrayImplementation; -extern const void * RTTI_VecArrayImplementation; -extern const void * RTTI_PointerArrayImplementation; -extern const void * RTTI_CstringArrayImplementation; -extern const void * RTTI_StructArrayImplementation; -extern const void * RTTI_StructArrayImplementation__Object; -extern const void * RTTI_hkDataClassNative; -extern const void * RTTI_hkDataWorldNative; -extern const void * RTTI_hkDataObjectNative; -extern const void * RTTI_hkDataArrayNative; -extern const void * RTTI_hkBinaryTagfileReader; -extern const void * RTTI_hkVersionPatchManager; -extern const void * RTTI_hkSubStreamWriter; -extern const void * RTTI_hkBinaryPackfileWriter; -extern const void * RTTI_hkPooledAllocator; -extern const void * RTTI_hkTempDetectAllocator; -extern const void * RTTI_hkSerializeDeprecated; -extern const void * RTTI_hkpPredGskfAgent; -extern const void * RTTI_hkpIterativeLinearCastAgent; -extern const void * RTTI_hkpBoxBoxAgent; -extern const void * RTTI_hkpSymmetricAgentFlipCollector; -extern const void * RTTI_hkpSymmetricAgentFlipCastCollector; -extern const void * RTTI_hkpSymmetricAgentFlipBodyCollector; -extern const void * RTTI_hkpBvAgent; -extern const void * RTTI_hkpFlagCdBodyPairCollector; -extern const void * RTTI_hkpSimpleClosestContactCollector; -extern const void * RTTI_hkpBvTreeAgent; -extern const void * RTTI_hkpBvTreeStreamAgent; -extern const void * RTTI_hkpMoppAgent; -extern const void * RTTI_hkpPhantomAgent; -extern const void * RTTI_hkpSphereSphereAgent; -extern const void * RTTI_hkpSphereCapsuleAgent; -extern const void * RTTI_hkpSphereTriangleAgent; -extern const void * RTTI_hkpCapsuleCapsuleAgent; -extern const void * RTTI_hkpCapsuleTriangleAgent; -extern const void * RTTI_hkpSphereBoxAgent; -extern const void * RTTI_hkpMultiSphereTriangleAgent; -extern const void * RTTI_hkpMultiRayConvexAgent; -extern const void * RTTI_hkpTransformAgent; -extern const void * RTTI_hkpListAgent; -extern const void * RTTI_hkpConvexListAgent; -extern const void * RTTI_hkpShapeCollectionAgent; -extern const void * RTTI_hkpMultiSphereAgent; -extern const void * RTTI_hkpArrayAction; -extern const void * RTTI_hkAlignSceneToNodeOptions; -extern const void * RTTI_hkxEnvironment; -extern const void * RTTI_hkxMaterialShaderSet; -extern const void * RTTI_hkxVertexBuffer; -extern const void * RTTI_hkxMesh; -extern const void * RTTI_hkOffsetOnlyStreamWriter; -extern const void * RTTI_hkObjectWriter; -extern const void * RTTI_hkPlatformObjectWriter; -extern const void * RTTI_hkPlatformObjectWriter__Cache; -extern const void * RTTI_hkMemoryStreamReader; -extern const void * RTTI_hkPackfileData; -extern const void * RTTI_hkObjectResource; -extern const void * RTTI_hkIArchive; -extern const void * RTTI_hkParserBuffer; -extern const void * RTTI_hkXmlStreamParser; -extern const void * RTTI_hkpGskBaseAgent; -extern const void * RTTI_hkpGskfAgent; -extern const void * RTTI_hkXmlLexAnalyzer; -extern const void * RTTI_BSAudioManagerThread; -extern const void * RTTI_AudioLoadForPlaybackTask; -extern const void * RTTI_AudioLoadToCacheTask; -extern const void * RTTI_BSAudio; -extern const void * RTTI_BSGameSound; -extern const void * RTTI_BSNullImplAudio; -extern const void * RTTI_BSAudioListener; -extern const void * RTTI_BSNullImplAudioListener; -extern const void * RTTI_BSNullImplGameSound; -extern const void * RTTI_BSXAudio2Audio; -extern const void * RTTI_BSXAudio2AudioListener; -extern const void * RTTI_BSXAudio2GameSound; -extern const void * RTTI_BSXAudio2DataSrc; -extern const void * RTTI_ScrapHeap; -extern const void * RTTI_BSCoreMessage; -extern const void * RTTI_BSThread; -extern const void * RTTI_CompactingStore__MoveCallback; -extern const void * RTTI_CompactingStore__NoopMoveCallback; -extern const void * RTTI_CompactingStore__Store; -extern const void * RTTI_MemoryHeap; -extern const void * RTTI_UnitTestMemoryHeap; -extern const void * RTTI_IMemoryHeap; -extern const void * RTTI_ZeroOverheadHeap; -extern const void * RTTI_UnitTestZeroOverheadHeap; -extern const void * RTTI_BSSmallBlockAllocator; -extern const void * RTTI_BSSmallBlockAllocatorUtil__UserPoolBase; -extern const void * RTTI_BSStepThread; -extern const void * RTTI_IMemoryStoreBase; -extern const void * RTTI_IMemoryStore; -extern const void * RTTI_AbstractHeap; -extern const void * RTTI_MouseMoveEvent; -extern const void * RTTI_CharEvent; -extern const void * RTTI_DeviceConnectEvent; -extern const void * RTTI_KinectEvent; -extern const void * RTTI_BSWin32GamerProfile; -extern const void * RTTI_BSIInputDevice; -extern const void * RTTI_BSInputDevice; -extern const void * RTTI_BSGamepadDevice; -extern const void * RTTI_BSGamerProfile; -extern const void * RTTI_BSWin32KeyboardDevice; -extern const void * RTTI_BSWin32MouseDevice; -extern const void * RTTI_BSPCGamepadDeviceDelegate; -extern const void * RTTI_BSPCGamepadDeviceHandler; -extern const void * RTTI_BSWin32GamepadDevice; -extern const void * RTTI_BSPCOrbisGamepadDevice; -extern const void * RTTI_BSKeyboardDevice; -extern const void * RTTI_BSWin32VirtualKeyboardDevice; -extern const void * RTTI_BSMouseDevice; -extern const void * RTTI_BSVirtualKeyboardDevice; -extern const void * RTTI_NiFile; -extern const void * RTTI_NiBinaryStream; -extern const void * RTTI_NiAllocator; -extern const void * RTTI_BSNiAllocator; -extern const void * RTTI_NiStandardAllocator; -extern const void * RTTI_NiSearchPath; -extern const void * RTTI_NiThread; -extern const void * RTTI_BSStringPool__IterationCallback; -extern const void * RTTI_Archive; -extern const void * RTTI_ArchiveFile; -extern const void * RTTI_CompressedArchiveFile; -extern const void * RTTI_BSJobs__JobThread; -extern const void * RTTI_BSFile; -extern const void * RTTI_BSSystemFileAsyncFunctor; -extern const void * RTTI_BSSystemFileStorage; -extern const void * RTTI_BSTaskletGroupData; -extern const void * RTTI_BSTaskletManagerCallback; -extern const void * RTTI_BSTaskletManager; -extern const void * RTTI_BSSearchPath; -extern const void * RTTI_BSWin32TaskletManager; -extern const void * RTTI_BSWin32TaskletGroupData; -extern const void * RTTI_BSResource__StreamBase; -extern const void * RTTI_BSResource__Stream; -extern const void * RTTI_BSResource__AsyncStream; -extern const void * RTTI_BSResource__ArchiveStream; -extern const void * RTTI_BSResource__CacheArchiveOp; -extern const void * RTTI_BSResource__CompressedArchiveStream; -extern const void * RTTI_BSResource__ArchiveManager; -extern const void * RTTI_BSResource__IEntryDB; -extern const void * RTTI_BSResource__IEntryDB__PostFlushNotify; -extern const void * RTTI_BSResource__LocationTraverser; -extern const void * RTTI_BSResource__CacheDrive; -extern const void * RTTI_BSResource__CacheDrive__Impl; -extern const void * RTTI_BSResource__CacheDrive__Task; -extern const void * RTTI_NiObject; -extern const void * RTTI_NiAVObject; -extern const void * RTTI_NiNode; -extern const void * RTTI_NiStream; -extern const void * RTTI_NiStream__BackgroundLoadProcedure; -extern const void * RTTI_NiObjectNET; -extern const void * RTTI_NiLight; -extern const void * RTTI_NiSwitchNode; -extern const void * RTTI_NiStringsExtraData; -extern const void * RTTI_NiCamera; -extern const void * RTTI_BSTriShape; -extern const void * RTTI_BSSkinnedDecalTriShape; -extern const void * RTTI_NiTexture; -extern const void * RTTI_NiSourceTexture; -extern const void * RTTI_BSFlattenedBoneTree; -extern const void * RTTI_NiSkinInstance; -extern const void * RTTI_BSDismemberSkinInstance; -extern const void * RTTI_NiStringExtraData; -extern const void * RTTI_NiTimeController; -extern const void * RTTI_NiExtraData; -extern const void * RTTI_NiGeometryData; -extern const void * RTTI_BSGeometry; -extern const void * RTTI_BSDynamicTriShape; -extern const void * RTTI_NiPointLight; -extern const void * RTTI_NiAVObjectPalette; -extern const void * RTTI_NiDefaultAVObjectPalette; -extern const void * RTTI_BSResourceNiBinaryStream; -extern const void * RTTI_NiDirectionalLight; -extern const void * RTTI_NiCullingProcess; -extern const void * RTTI_NiParticles; -extern const void * RTTI_NiSkinPartition; -extern const void * RTTI_NiVertWeightsExtraData; -extern const void * RTTI_NiGeometry; -extern const void * RTTI_NiSkinData; -extern const void * RTTI_NiShadeProperty; -extern const void * RTTI_NiAlphaAccumulator; -extern const void * RTTI_NiAmbientLight; -extern const void * RTTI_NiBinaryExtraData; -extern const void * RTTI_NiBooleanExtraData; -extern const void * RTTI_NiBSPNode; -extern const void * RTTI_NiColorExtraData; -extern const void * RTTI_NiFloatExtraData; -extern const void * RTTI_NiFloatsExtraData; -extern const void * RTTI_NiFogProperty; -extern const void * RTTI_NiIntegerExtraData; -extern const void * RTTI_NiIntegersExtraData; -extern const void * RTTI_NiParticlesData; -extern const void * RTTI_NiParticleMeshesData; -extern const void * RTTI_NiParticleMeshes; -extern const void * RTTI_NiSpotLight; -extern const void * RTTI_NiSwitchStringExtraData; -extern const void * RTTI_NiTriShapeData; -extern const void * RTTI_NiTriShape; -extern const void * RTTI_NiTriStripsData; -extern const void * RTTI_NiTriStrips; -extern const void * RTTI_NiVectorExtraData; -extern const void * RTTI_BSLODTriShape; -extern const void * RTTI_NiAdditionalGeometryData; -extern const void * RTTI_BSSegmentedTriShape; -extern const void * RTTI_NiBackToFrontAccumulator; -extern const void * RTTI_NiAccumulator; -extern const void * RTTI_NiTriBasedGeomData; -extern const void * RTTI_NiTriBasedGeom; -extern const void * RTTI_NiPick__Results; -extern const void * RTTI_NiCollisionTraversals__IFindIntersections; -extern const void * RTTI_NiCollisionData; -extern const void * RTTI_NiOBBRoot; -extern const void * RTTI_NiBoundingVolume; -extern const void * RTTI_NiBoxBV; -extern const void * RTTI_NiCapsuleBV; -extern const void * RTTI_NiHalfSpaceBV; -extern const void * RTTI_NiSphereBV; -extern const void * RTTI_NiUnionBV; -extern const void * RTTI_NiOBBNode; -extern const void * RTTI_NiOBBLeaf; -extern const void * RTTI_NiIntersector; -extern const void * RTTI_NiBoxSphereIntersector; -extern const void * RTTI_NiBoxCapsuleIntersector; -extern const void * RTTI_NiCapsuleCapsuleIntersector; -extern const void * RTTI_NiCapsuleSphereIntersector; -extern const void * RTTI_NiCapsuleTriIntersector; -extern const void * RTTI_NiSphereTriIntersector; -extern const void * RTTI_NiControllerManager; -extern const void * RTTI_NiControllerSequence; -extern const void * RTTI_NiTextKeyMatch; -extern const void * RTTI_NiMultiTargetTransformController; -extern const void * RTTI_NiBlendInterpolator; -extern const void * RTTI_BSMultiTargetTreadTransfController; -extern const void * RTTI_NiInterpController; -extern const void * RTTI_NiFloatInterpolator; -extern const void * RTTI_NiColorInterpolator; -extern const void * RTTI_NiSingleInterpController; -extern const void * RTTI_NiTransformInterpolator; -extern const void * RTTI_NiPosData; -extern const void * RTTI_NiPathInterpolator; -extern const void * RTTI_NiBlendTransformInterpolator; -extern const void * RTTI_NiBlendFloatInterpolator; -extern const void * RTTI_NiFloatExtraDataController; -extern const void * RTTI_NiTransformController; -extern const void * RTTI_NiBlendAccumTransformInterpolator; -extern const void * RTTI_NiInterpolator; -extern const void * RTTI_BSBlendTreadTransfInterpolator; -extern const void * RTTI_NiKeyBasedInterpolator; -extern const void * RTTI_NiTransformData; -extern const void * RTTI_NiBlendBoolInterpolator; -extern const void * RTTI_NiBlendColorInterpolator; -extern const void * RTTI_NiBlendPoint3Interpolator; -extern const void * RTTI_NiBlendQuaternionInterpolator; -extern const void * RTTI_NiBoolData; -extern const void * RTTI_NiBoolInterpolator; -extern const void * RTTI_NiBoolTimelineInterpolator; -extern const void * RTTI_NiBSplineBasisData; -extern const void * RTTI_NiBSplineData; -extern const void * RTTI_NiBSplineColorInterpolator; -extern const void * RTTI_NiBSplineCompColorInterpolator; -extern const void * RTTI_NiBSplineCompFloatInterpolator; -extern const void * RTTI_NiBSplineCompPoint3Interpolator; -extern const void * RTTI_NiBSplineCompTransformInterpolator; -extern const void * RTTI_NiBSplineFloatInterpolator; -extern const void * RTTI_NiBSplinePoint3Interpolator; -extern const void * RTTI_NiBSplineTransformInterpolator; -extern const void * RTTI_NiColorExtraDataController; -extern const void * RTTI_NiFloatsExtraDataController; -extern const void * RTTI_NiFloatsExtraDataPoint3Controller; -extern const void * RTTI_NiKeyframeManager; -extern const void * RTTI_NiLightColorController; -extern const void * RTTI_NiLightDimmerController; -extern const void * RTTI_NiLookAtController; -extern const void * RTTI_NiLookAtInterpolator; -extern const void * RTTI_NiMorphData; -extern const void * RTTI_NiPathController; -extern const void * RTTI_NiPoint3Interpolator; -extern const void * RTTI_NiQuaternionInterpolator; -extern const void * RTTI_NiFloatController; -extern const void * RTTI_NiRollController; -extern const void * RTTI_NiRotData; -extern const void * RTTI_NiSequence; -extern const void * RTTI_NiSequenceStreamHelper; -extern const void * RTTI_NiStringPalette; -extern const void * RTTI_NiTextKeyExtraData; -extern const void * RTTI_NiUVData; -extern const void * RTTI_NiVisController; -extern const void * RTTI_BSAnimNotes; -extern const void * RTTI_BSAnimNote; -extern const void * RTTI_BSGrabIKNote; -extern const void * RTTI_BSLookIKNote; -extern const void * RTTI_BSRotAccumTransfInterpolator; -extern const void * RTTI_BSTreadTransfInterpolator; -extern const void * RTTI_BSFrustumFOVController; -extern const void * RTTI_NiExtraDataController; -extern const void * RTTI_NiBSplineInterpolator; -extern const void * RTTI_NiPoint3InterpController; -extern const void * RTTI_NiFloatInterpController; -extern const void * RTTI_NiBoolInterpController; -extern const void * RTTI_NiParticleSystem; -extern const void * RTTI_NiPSysEmitterCtlr; -extern const void * RTTI_NiPSysGravityModifier; -extern const void * RTTI_BSPSysHavokUpdateModifier; -extern const void * RTTI_NiMeshParticleSystem; -extern const void * RTTI_NiPSysCylinderEmitter; -extern const void * RTTI_BSStripParticleSystem; -extern const void * RTTI_NiPSysEmitter; -extern const void * RTTI_NiPSysModifierCtlr; -extern const void * RTTI_NiPSysModifier; -extern const void * RTTI_NiPSysMeshUpdateModifier; -extern const void * RTTI_NiPSysUpdateCtlr; -extern const void * RTTI_NiMeshPSysData; -extern const void * RTTI_NiPSysAirFieldAirFrictionCtlr; -extern const void * RTTI_NiPSysAirFieldInheritVelocityCtlr; -extern const void * RTTI_NiPSysAirFieldModifier; -extern const void * RTTI_NiPSysAirFieldSpreadCtlr; -extern const void * RTTI_NiPSysAgeDeathModifier; -extern const void * RTTI_NiPSysBombModifier; -extern const void * RTTI_NiPSysBoundUpdateModifier; -extern const void * RTTI_NiPSysBoxEmitter; -extern const void * RTTI_NiPSysColliderManager; -extern const void * RTTI_NiPSysColorModifier; -extern const void * RTTI_NiPSysData; -extern const void * RTTI_NiPSysDragFieldModifier; -extern const void * RTTI_NiPSysDragModifier; -extern const void * RTTI_NiPSysEmitterCtlrData; -extern const void * RTTI_NiPSysEmitterDeclinationCtlr; -extern const void * RTTI_NiPSysEmitterDeclinationVarCtlr; -extern const void * RTTI_NiPSysEmitterInitialRadiusCtlr; -extern const void * RTTI_NiPSysEmitterLifeSpanCtlr; -extern const void * RTTI_NiPSysEmitterPlanarAngleCtlr; -extern const void * RTTI_NiPSysEmitterPlanarAngleVarCtlr; -extern const void * RTTI_NiPSysEmitterSpeedCtlr; -extern const void * RTTI_NiPSysFieldAttenuationCtlr; -extern const void * RTTI_NiPSysFieldMagnitudeCtlr; -extern const void * RTTI_NiPSysFieldMaxDistanceCtlr; -extern const void * RTTI_NiPSysGravityFieldModifier; -extern const void * RTTI_NiPSysGravityStrengthCtlr; -extern const void * RTTI_NiPSysGrowFadeModifier; -extern const void * RTTI_NiPSysInitialRotAngleCtlr; -extern const void * RTTI_NiPSysInitialRotAngleVarCtlr; -extern const void * RTTI_NiPSysInitialRotSpeedCtlr; -extern const void * RTTI_NiPSysInitialRotSpeedVarCtlr; -extern const void * RTTI_NiPSysMeshEmitter; -extern const void * RTTI_NiPSysModifierActiveCtlr; -extern const void * RTTI_NiPSysPlanarCollider; -extern const void * RTTI_NiPSysPositionModifier; -extern const void * RTTI_NiPSysRadialFieldModifier; -extern const void * RTTI_NiPSysResetOnLoopCtlr; -extern const void * RTTI_NiPSysRotationModifier; -extern const void * RTTI_NiPSysSpawnModifier; -extern const void * RTTI_NiPSysSphereEmitter; -extern const void * RTTI_NiPSysSphericalCollider; -extern const void * RTTI_NiPSysTurbulenceFieldModifier; -extern const void * RTTI_NiPSysVortexFieldModifier; -extern const void * RTTI_BSStripPSysData; -extern const void * RTTI_BSPSysRecycleBoundModifier; -extern const void * RTTI_BSPSysInheritVelocityModifier; -extern const void * RTTI_NiPSysVolumeEmitter; -extern const void * RTTI_NiPSysModifierFloatCtlr; -extern const void * RTTI_NiPSysFieldModifier; -extern const void * RTTI_NiPSysModifierBoolCtlr; -extern const void * RTTI_NiPSysCollider; -extern const void * RTTI_BSTaskManager; -extern const void * RTTI_BSTaskManagerThread; -extern const void * RTTI_BSTaskThread; -extern const void * RTTI_IOManager; -extern const void * RTTI_BSResource__IEntryDB__NotifyLoadDone; -extern const void * RTTI_QueuedFile; -extern const void * RTTI_QueuedNamedFile; -extern const void * RTTI_BSQueuedResourceCollectionBase; -extern const void * RTTI_BSMultiBound; -extern const void * RTTI_BSMultiBoundRoom; -extern const void * RTTI_BSReference; -extern const void * RTTI_BSNodeReferences; -extern const void * RTTI_BSXFlags; -extern const void * RTTI_BSValueNode; -extern const void * RTTI_ITextureDB; -extern const void * RTTI_BSTextureDB__QueuedHandles; -extern const void * RTTI_BSWindModifier; -extern const void * RTTI_BSTempNode; -extern const void * RTTI_BSPortalGraph; -extern const void * RTTI_BSPortalGraphEntry; -extern const void * RTTI_BSOcclusionShape; -extern const void * RTTI_MessageHandler; -extern const void * RTTI_BSRangeNode; -extern const void * RTTI_BSBlastNode; -extern const void * RTTI_BSDebrisNode; -extern const void * RTTI_BSDamageStage; -extern const void * RTTI_PArrayPoint; -extern const void * RTTI_BSPSysArrayEmitter; -extern const void * RTTI_BSInstanceTriShape; -extern const void * RTTI_BSMultiStreamInstanceTriShape; -extern const void * RTTI_BSIStream; -extern const void * RTTI_BSOStream; -extern const void * RTTI_BSMultiBoundShape; -extern const void * RTTI_BSOcclusionBox; -extern const void * RTTI_BSOcclusionPlane; -extern const void * RTTI_BSPortalSharedNode; -extern const void * RTTI_BSBodyMorphOffsetsExtraData; -extern const void * RTTI_BSBehaviorGraphExtraData; -extern const void * RTTI_NiBSBoneLODController; -extern const void * RTTI_BSCullingProcess; -extern const void * RTTI_BSParticleSystemManager; -extern const void * RTTI_BSFurnitureMarkerNode; -extern const void * RTTI_BSBound; -extern const void * RTTI_BSMultiBoundNode; -extern const void * RTTI_BSBoneMap; -extern const void * RTTI_BSAnimInteractionMarker; -extern const void * RTTI_BSSceneGraph; -extern const void * RTTI_BSPSysMultiTargetEmitterCtlr; -extern const void * RTTI_BSSubIndexTriShape; -extern const void * RTTI_BSDistantObjectLargeRefExtraData; -extern const void * RTTI_BSMasterParticleSystem; -extern const void * RTTI_BSProceduralLightningTasklet; -extern const void * RTTI_BSProceduralLightningController; -extern const void * RTTI_BSInvMarker; -extern const void * RTTI_BSBoneLODExtraData; -extern const void * RTTI_BSDecalPlacementVectorExtraData; -extern const void * RTTI_BSParentVelocityModifier; -extern const void * RTTI_BSWArray; -extern const void * RTTI_BSMultiBoundCapsule; -extern const void * RTTI_BSPSysStripUpdateModifier; -extern const void * RTTI_BSPSysSubTexModifier; -extern const void * RTTI_BSPSysScaleModifier; -extern const void * RTTI_BSLagBoneController; -extern const void * RTTI_BSNonUniformScaleExtraData; -extern const void * RTTI_BSNiNode; -extern const void * RTTI_BSTableCurve; -extern const void * RTTI_bhkWorldObject; -extern const void * RTTI_bhkTaskletManagerCallback; -extern const void * RTTI_bhkOnStartupCallback; -extern const void * RTTI_bhkOnExitCallback; -extern const void * RTTI_ahkpWorld; -extern const void * RTTI_bhkWorld__bhkConstraintProjector; -extern const void * RTTI_bhkWorld; -extern const void * RTTI_bhkWorldCinfo; -extern const void * RTTI_hkGenericConstraintCinfo; -extern const void * RTTI_hkStiffSpringConstraintCinfo; -extern const void * RTTI_bhkStiffSpringConstraint; -extern const void * RTTI_hkBallAndSocketConstraintCinfo; -extern const void * RTTI_hkFixedConstraintCinfo; -extern const void * RTTI_bhkWindListener; -extern const void * RTTI_hkpAllRayHitCollector; -extern const void * RTTI_bhkRagdollPenetrationUtil; -extern const void * RTTI_hkaRagdollRaycastInterface; -extern const void * RTTI_hkpCharacterState; -extern const void * RTTI_bhkCharacterState; -extern const void * RTTI_bhkShapeCollection; -extern const void * RTTI_bhkCharacterController; -extern const void * RTTI_bhkCollisionBox; -extern const void * RTTI_bhkICharOrientationController; -extern const void * RTTI_bhkCharacterControllerCinfo; -extern const void * RTTI_bhkCharacterStateClimbing; -extern const void * RTTI_bhkCharacterStateFlying; -extern const void * RTTI_bhkListShape; -extern const void * RTTI_bhkNiCollisionObject; -extern const void * RTTI_bhkRagdollShareData; -extern const void * RTTI_bhkRagdollController; -extern const void * RTTI_bhkCollisionFilter; -extern const void * RTTI_bhkAttachmentCollisionObject; -extern const void * RTTI_bhkLimitedHingeConstraint; -extern const void * RTTI_WeaponObject; -extern const void * RTTI_hkLimitedHingeConstraintCinfo; -extern const void * RTTI_bhkRigidBodyT; -extern const void * RTTI_bhkWorldM; -extern const void * RTTI_bhkRefObject; -extern const void * RTTI_hkNiTriStripsShape; -extern const void * RTTI_hkNormalTriangleShape; -extern const void * RTTI_hkPackedNiTriStripsData; -extern const void * RTTI_hkPackedNiTriStripsShape; -extern const void * RTTI_bhkCapsuleShape; -extern const void * RTTI_bhkNiTriStripsShape; -extern const void * RTTI_bhkPackedNiTriStripsShape; -extern const void * RTTI_bhkBlendCollisionObject; -extern const void * RTTI_hkAvoidBox; -extern const void * RTTI_bhkAvoidBox; -extern const void * RTTI_ahkpMalleableConstraintData; -extern const void * RTTI_bhkMalleableConstraint; -extern const void * RTTI_hkMalleableConstraintCinfo; -extern const void * RTTI_hkBSHeightFieldShape; -extern const void * RTTI_hkProductFeatures; -extern const void * RTTI_bhkCachingShapePhantom; -extern const void * RTTI_hkpCharacterProxyListener; -extern const void * RTTI_bhkCharacterProxyCinfo; -extern const void * RTTI_bhkCharacterProxy; -extern const void * RTTI_bhkCharProxyController; -extern const void * RTTI_bhkCharProxyControllerCinfo; -extern const void * RTTI_hkpCharacterRigidBodyListener; -extern const void * RTTI_bhkCharacterRigidBodyCinfo; -extern const void * RTTI_bhkCharacterRigidBody; -extern const void * RTTI_bhkCharRigidBodyControllerCinfo; -extern const void * RTTI_bhkCharRigidBodyController; -extern const void * RTTI_bhkBallAndSocketConstraint; -extern const void * RTTI_bhkRagdollTemplateData; -extern const void * RTTI_bhkRagdollTemplate; -extern const void * RTTI_hkRagdollConstraintCinfo; -extern const void * RTTI_bhkRagdollConstraint; -extern const void * RTTI_hkpSafeEaseConstraintsAction; -extern const void * RTTI_bhkBipedOrientationController; -extern const void * RTTI_hkThreadMemory; -extern const void * RTTI_bhkMemorySystem; -extern const void * RTTI_hkpSuspendInactiveAgentsUtil; -extern const void * RTTI_bhkCompressedMeshShapeData; -extern const void * RTTI_bhkCompressedMeshShape; -extern const void * RTTI_bhkConvexSweepShape; -extern const void * RTTI_bhkConvexTransformShape; -extern const void * RTTI_bhkConvexTranslateShape; -extern const void * RTTI_bhkConvexVerticesShape; -extern const void * RTTI_bhkCylinderShape; -extern const void * RTTI_bhkMultiSphereShape; -extern const void * RTTI_bhkHeightFieldShape; -extern const void * RTTI_bhkPlaneShape; -extern const void * RTTI_bhkTriangleShape; -extern const void * RTTI_hkScaledMoppBvTreeShape; -extern const void * RTTI_bhkMoppBvTreeShape; -extern const void * RTTI_bhkTransformShape; -extern const void * RTTI_hkConstraintChainCinfo; -extern const void * RTTI_bhkConstraintChain; -extern const void * RTTI_hkBallSocketChainCinfo; -extern const void * RTTI_bhkBallSocketConstraintChain; -extern const void * RTTI_bhkGroupConstraint; -extern const void * RTTI_hkHingeLimitsConstraintCinfo; -extern const void * RTTI_bhkHingeLimitsConstraint; -extern const void * RTTI_bhkGenericConstraint; -extern const void * RTTI_bhkFixedConstraint; -extern const void * RTTI_hkRagdollLimitsConstraintCinfo; -extern const void * RTTI_bhkRagdollLimitsConstraint; -extern const void * RTTI_hkWheelConstraintCinfo; -extern const void * RTTI_bhkWheelConstraint; -extern const void * RTTI_ahkpBreakableConstraintData; -extern const void * RTTI_hkBreakableConstraintCinfo; -extern const void * RTTI_bhkBreakableConstraint; -extern const void * RTTI_bhkBinaryAction; -extern const void * RTTI_bhkAngularDashpotAction; -extern const void * RTTI_bhkDashpotAction; -extern const void * RTTI_bhkLiquidAction; -extern const void * RTTI_bhkMotorAction; -extern const void * RTTI_bhkOrientHingedBodyAction; -extern const void * RTTI_bhkSpringAction; -extern const void * RTTI_bhkBlendController; -extern const void * RTTI_bhkExtraData; -extern const void * RTTI_bhkPoseArray; -extern const void * RTTI_hkaDetectRagdollPenetration; -extern const void * RTTI_bhkCharacterStateInAir; -extern const void * RTTI_bhkCharacterStateJumping; -extern const void * RTTI_bhkCharacterStateOnGround; -extern const void * RTTI_bhkCharacterStateSwimming; -extern const void * RTTI_hkCharControllerShape; -extern const void * RTTI_bhkCharControllerShape; -extern const void * RTTI_bhkQuadOrientationController; -extern const void * RTTI_hkPointToPathConstraintCinfo; -extern const void * RTTI_bhkPositionConstraintMotor; -extern const void * RTTI_bhkVelocityConstraintMotor; -extern const void * RTTI_bhkSpringDamperConstraintMotor; -extern const void * RTTI_hkbCameraShakeEventPayload; -extern const void * RTTI_hkbParticleSystemEventPayload; -extern const void * RTTI_hkbStateChooser; -extern const void * RTTI_hkbTestStateChooser; -extern const void * RTTI_hkbSimulationControlCommand; -extern const void * RTTI_hkbCharacterControlCommand; -extern const void * RTTI_hkbRaiseEventCommand; -extern const void * RTTI_hkbSetWordVariableCommand; -extern const void * RTTI_hkbSetLocalTimeOfClipGeneratorCommand; -extern const void * RTTI_hkbSetBehaviorCommand; -extern const void * RTTI_hkbSetNodePropertyCommand; -extern const void * RTTI_hkbCharacterAddedInfo; -extern const void * RTTI_hkbCharacterInfo; -extern const void * RTTI_hkbCharacterSteppedInfo; -extern const void * RTTI_hkbCharacterSkinInfo; -extern const void * RTTI_hkbBehaviorInfo; -extern const void * RTTI_hkbBehaviorEventsInfo; -extern const void * RTTI_hkbEventRaisedInfo; -extern const void * RTTI_hkbSimulationStateInfo; -extern const void * RTTI_hkbLinkedSymbolInfo; -extern const void * RTTI_hkbAuxiliaryNodeInfo; -extern const void * RTTI_hkbBehaviorGraphInternalStateInfo; -extern const void * RTTI_hkpHeightFieldAgent; -extern const void * RTTI_hkHeightFieldRayForwardingCollector; -extern const void * RTTI_hkpContinuousSimulation; -extern const void * RTTI_hkpMultiThreadedSimulation; -extern const void * RTTI_hkpMultiThreadedSimulation__MtEntityEntityBroadPhaseListener; -extern const void * RTTI_hkpMultiThreadedSimulation__MtPhantomBroadPhaseListener; -extern const void * RTTI_hkpMultiThreadedSimulation__MtBroadPhaseBorderListener; -extern const void * RTTI_bhkCharacterPointCollector; -extern const void * RTTI_ahkpCharacterProxy; -extern const void * RTTI_ahkpCharacterRigidBody; -extern const void * RTTI_hkSolverAllocator; -extern const void * RTTI_bhkThreadMemorySource; -extern const void * RTTI_hkJobThreadPool; -extern const void * RTTI_hkCpuJobThreadPool; -extern const void * RTTI_hkpCompressedMeshShape; -extern const void * RTTI_hkLiquidAction; -extern const void * RTTI_hkOrientHingedBodyAction; -extern const void * RTTI_hkgpConvexHull; -extern const void * RTTI_bhkPointToPathConstraint; -extern const void * RTTI_hkRemoteObjectClientSideListener; -extern const void * RTTI_hkbBehaviorClient; -extern const void * RTTI_hkbClientCharacterState; -extern const void * RTTI_hkpToiResourceMgr; -extern const void * RTTI_hkpDefaultToiResourceMgr; -extern const void * RTTI_hkpDeferredConstraintOwner; -extern const void * RTTI_hkgpIndexedMesh; -extern const void * RTTI_hkpMoppMediator; -extern const void * RTTI_hkpMoppShapeMediator; -extern const void * RTTI_hkpMoppCachedShapeMediator; -extern const void * RTTI_hkpMoppCostFunction; -extern const void * RTTI_hkGeometryProcessingInternals__NearestFeaturePolicy; -extern const void * RTTI_hkProcess; -extern const void * RTTI_hkRemoteObjectProcess; -extern const void * RTTI_hkKdTreeCastCollector; -extern const void * RTTI_hkCpuWorldGetClosestPointsCollector; -extern const void * RTTI_hkCpuWorldLinearCastCollector; -extern const void * RTTI_hkpFixedBufferRayHitCollector; -extern const void * RTTI_hkCpuWorldRayCastCollector; -extern const void * RTTI_hkpSimpleMeshShape; -extern const void * RTTI_hkpMoppNodeMgr; -extern const void * RTTI_hkpMoppSplitter; -extern const void * RTTI_hkpMoppDefaultSplitter; -extern const void * RTTI_hkpMoppCodeGenerator; -extern const void * RTTI_hkpMoppAssembler; -extern const void * RTTI_hkpMoppDefaultAssembler; -extern const void * RTTI_hkgpTriangulatorBase; -extern const void * RTTI_hkgpJobQueue__IJob; -extern const void * RTTI_hkgpMesh; -extern const void * RTTI_hkgpMesh__IConvexOverlap; -extern const void * RTTI_hkgpMesh__IConvexOverlap__IConvexShape; -extern const void * RTTI_hkgpMesh__TriangleShape; -extern const void * RTTI_hkgpMesh__ExternShape; -extern const void * RTTI_hkgpMesh__CollideShapeTriangle; -extern const void * RTTI_hkgpMesh__NearestFeaturePolicy; -extern const void * RTTI_hkGskShape; -extern const void * RTTI_hkgpMeshInternals__SimpleCollector; -extern const void * RTTI_hkgpMeshInternals__TriangleOverlap; -extern const void * RTTI_hkgpMeshInternals__RayCaster; -extern const void * RTTI_IConvexOverlapImpl; -extern const void * RTTI_IConvexOverlapImpl__ShapeBridge; -extern const void * RTTI_hkProcessFactory; -extern const void * RTTI_hkKdTreeBundleCastCollector; -extern const void * RTTI_hkKdTreeBuildInput__Mediator; -extern const void * RTTI_hkpCollidableMediator; -extern const void * RTTI_hkKdTreeCpuBroadphaseBundleCastCollector; -extern const void * RTTI_BSUIScaleformData; -extern const void * RTTI_IMenu; -extern const void * RTTI_GSysAllocBase; -extern const void * RTTI_GSysAllocPaged; -extern const void * RTTI_GSysMemoryMap; -extern const void * RTTI_GFxLog; -extern const void * RTTI_GFxTranslator; -extern const void * RTTI_GFxZlibSupportBase; -extern const void * RTTI_GFxState; -extern const void * RTTI_GFxZlibSupport; -extern const void * RTTI_BSScaleformTranslator; -extern const void * RTTI_BSStreamParserData; -extern const void * RTTI_BSResourceStreamParser; -extern const void * RTTI_GFile; -extern const void * RTTI_GMemoryFile; -extern const void * RTTI_GFxFileOpenerBase; -extern const void * RTTI_BSScaleformFileOpener; -extern const void * RTTI_ScaleformFile__MemoryFile; -extern const void * RTTI_IDebugText; -extern const void * RTTI_DebugText; -extern const void * RTTI_GFxExternalInterface; -extern const void * RTTI_FxDelegate; -extern const void * RTTI_FxDelegateHandler__CallbackProcessor; -extern const void * RTTI_AddCallbackVisitor; -extern const void * RTTI_RemoveCallbackVisitor; -extern const void * RTTI_GFxImageLoader; -extern const void * RTTI_BSScaleformImageLoader; -extern const void * RTTI_BSScaleformMovieLoadTask; -extern const void * RTTI_MoviePlayer; -extern const void * RTTI_BSMusicManager; -extern const void * RTTI_ITrianglePathSplitter; -extern const void * RTTI_IPathSmootherRayCast; -extern const void * RTTI_FindTriangleForLocationWaterFilter; -extern const void * RTTI_BSPathing; -extern const void * RTTI_BSPathing__EdgeFoundVisitor; -extern const void * RTTI_TrianglePathWaterAndLedgeSplitter; -extern const void * RTTI_BSNavmeshInfoSearch; -extern const void * RTTI_BSPrecomputedNavmeshInfoSearch; -extern const void * RTTI_IMovementSetState; -extern const void * RTTI_IMovementQueryState; -extern const void * RTTI_MovementAgentActorState; -extern const void * RTTI_IPathBuilderTracker; -extern const void * RTTI_BSPathingRequest; -extern const void * RTTI_NullPathBuilderTracker; -extern const void * RTTI_IPipelineStageInterface; -extern const void * RTTI_IMovementPlannerAgent; -extern const void * RTTI_IMovementPathManagerAgent; -extern const void * RTTI_IMovementQueryPathFollowing; -extern const void * RTTI_IMovementQueryPathFollowing__INodeVisitor; -extern const void * RTTI_IMovementSetPathFollowing; -extern const void * RTTI_IMovementPlayIdleResult; -extern const void * RTTI_IPathFollowerAction; -extern const void * RTTI_ISelectIdleFilter; -extern const void * RTTI_ICheckEndReachedFunctorMapper; -extern const void * RTTI_IMovementHandlerAgent; -extern const void * RTTI_CheckParameterReachedFunctor; -extern const void * RTTI_CheckGoalReachedFunctor; -extern const void * RTTI_CheckStoppedMovingFunctor; -extern const void * RTTI_MovementAgentPathFollowerStandard; -extern const void * RTTI_MovementSelectIdleUtils__SelectFirstIdleFilter; -extern const void * RTTI_MovementPathManagerAgent; -extern const void * RTTI_IMovementSetGoal; -extern const void * RTTI_IMovementQueryPathingState; -extern const void * RTTI_IMovementPathManagerDataTracker; -extern const void * RTTI_MovementPathManagerArbiter; -extern const void * RTTI_MovementMessageNewPath; -extern const void * RTTI_MovementPathManagerNullTracker; -extern const void * RTTI_BSNavmesh; -extern const void * RTTI_BSNavmeshInfoMap; -extern const void * RTTI_BSNavmeshInfoMap__IRecursiveVisitor; -extern const void * RTTI_BSPrecomputedNavmeshInfoPathMap__INavmeshInfoVisitor; -extern const void * RTTI_BSNavmeshObstacleData; -extern const void * RTTI_PathingTaskData; -extern const void * RTTI_MovementArbitrationAverageFloat; -extern const void * RTTI_MovementArbitrationMaxWeightPoint; -extern const void * RTTI_MovementArbitrationMaxWeightParameters; -extern const void * RTTI_NullMovementSelectIdleResult; -extern const void * RTTI_INavmeshSearchFilterSet; -extern const void * RTTI_BSNavmeshSearchFilters; -extern const void * RTTI_BSNavmeshSearch; -extern const void * RTTI_BSPathingLOSGridCell; -extern const void * RTTI_BSPathingLOSGrid; -extern const void * RTTI_BSPathingLOSGridMap; -extern const void * RTTI_BSPathBuilder; -extern const void * RTTI_PathSmootherRayCastUsePreferredTris; -extern const void * RTTI_PathSmootherRayCastUseTrianglePath; -extern const void * RTTI_BSPathEventManager; -extern const void * RTTI_IMovementControllerRegisterInterface; -extern const void * RTTI_IMovementControllerDataTracker; -extern const void * RTTI_MovementControllerAI; -extern const void * RTTI_NullMovementState; -extern const void * RTTI_BSPathingStreamSimpleBufferRead; -extern const void * RTTI_MovementControllerNullDataTracker; -extern const void * RTTI_MovementMessageDoor; -extern const void * RTTI_MovementMessageApproachingDoor; -extern const void * RTTI_MovementMessageActivateDoor; -extern const void * RTTI_MovementMessageWarpToLocation; -extern const void * RTTI_MovementMessageWarpToMultiple; -extern const void * RTTI_MovementMessageBlocked; -extern const void * RTTI_MovementMessagePlayIdle; -extern const void * RTTI_MovementMessageFreezeDirection; -extern const void * RTTI_MovementMessageSetStaticPath; -extern const void * RTTI_MovementMessageJump; -extern const void * RTTI_IMovementQueryDeltas; -extern const void * RTTI_MovementPostUpdateArbiter; -extern const void * RTTI_IMovementSetStaticAvoider; -extern const void * RTTI_IMovementQueryStaticAvoider; -extern const void * RTTI_MovementPathManagerAgentStaticAvoider; -extern const void * RTTI_IMovementQueryActorAvoidance; -extern const void * RTTI_MovementAgentActorAvoider; -extern const void * RTTI_MovementAgent; -extern const void * RTTI_MovementArbiter; -extern const void * RTTI_IMovementSetTranslationControllerType; -extern const void * RTTI_MovementHandlerAgentTranslationController; -extern const void * RTTI_IMovementSetCorrectionData; -extern const void * RTTI_MovementTweenerAgentFixedDelta; -extern const void * RTTI_MovementHandlerArbiter; -extern const void * RTTI_MovementHandlerAgent; -extern const void * RTTI_IMovementPlannerSetArbitration; -extern const void * RTTI_MovementPlannerArbiter; -extern const void * RTTI_MovementPlannerAgent; -extern const void * RTTI_MovementPathManagerAgentLoadedAreaMonitor; -extern const void * RTTI_IMovementQueryFlight; -extern const void * RTTI_MovementAgentPathFollowerFlight; -extern const void * RTTI_MovementAgentPathFollowerVirtual; -extern const void * RTTI_MovementHandlerAgentAngleController; -extern const void * RTTI_MovementHandlerAgentAngleGain; -extern const void * RTTI_MovementHandlerAgentSpeedPassThrough; -extern const void * RTTI_MovementHandlerAgentAnglePassThrough; -extern const void * RTTI_MovementHandlerAgentDirectionPassThrough; -extern const void * RTTI_MovementHandlerAgentStrafing; -extern const void * RTTI_MovementHandlerAgentLargeDeltaIdle; -extern const void * RTTI_MovementPlannerAgentNavmeshBounds; -extern const void * RTTI_MovementPathManagerAgentAvoidBox; -extern const void * RTTI_IMovementQueryTweener; -extern const void * RTTI_IMovementSetTweener; -extern const void * RTTI_IMovementTweenerAgent; -extern const void * RTTI_MovementTweenerArbiter; -extern const void * RTTI_MovementTweenerAgent; -extern const void * RTTI_MovementStateTweener; -extern const void * RTTI_MovementStateFollowPath; -extern const void * RTTI_MovementSelectIdleUtils__SelectClosestIdleToPath; -extern const void * RTTI_MovementMessagePathEvent; -extern const void * RTTI_MovementMessagePathComplete; -extern const void * RTTI_MovementMessagePathFailed; -extern const void * RTTI_MovementMessagePathCleared; -extern const void * RTTI_BSPathSmootherPOVSearch; -extern const void * RTTI_BSPathingSearchRayCast; -extern const void * RTTI_ISmoothingRayValidator; -extern const void * RTTI_GroundPathRayValidator; -extern const void * RTTI_WaterPathRayValidator; -extern const void * RTTI_IPathingNodeGenerator; -extern const void * RTTI_GroundPathPathingNodeGenerator; -extern const void * RTTI_WaterPathPathingNodeGenerator; -extern const void * RTTI_IPathFollowerState; -extern const void * RTTI_ICheckEndReachedFunctor; -extern const void * RTTI_PathFollowerStatePlayIdle; -extern const void * RTTI_PathFollowerStateFollowPathToParameter; -extern const void * RTTI_PathFollowerStateTurnToAngle; -extern const void * RTTI_PathFollowerStateKeepLastDirection; -extern const void * RTTI_VelocityObstacle__Utilities__BuildOpenEdgeListsVisitor; -extern const void * RTTI_BSNavmeshObstacleUndoData; -extern const void * RTTI_MovementArbitrationVectorAdd; -extern const void * RTTI_bnet__BaseCallback; -extern const void * RTTI_BSPlatform__BSTerminatedCallback; -extern const void * RTTI_BSPlatform__BSBethesdaPlatform; -extern const void * RTTI_BSPlatform__BSAsyncRequestBase; -extern const void * RTTI_bnet__EmptyTerminationCB; -extern const void * RTTI_bnet__ExternalAuthInfo; -extern const void * RTTI_bnet__SteamExternalAuthInfo; -extern const void * RTTI_bnet__CustomData__Value; -extern const void * RTTI_BSPlatform__BSUploadRequest; -extern const void * RTTI_BSPlatform__BSDownloadRequest; -extern const void * RTTI_bnet___impl__RefCount; -extern const void * RTTI_bnet___impl__SharedMutex; -extern const void * RTTI_bnet__IDynamicVariableDeleter; -extern const void * RTTI_bnet__ConfigurationEntry; -extern const void * RTTI_bnet___impl__IPool; -extern const void * RTTI_bnet__ConfigurationEntryBoolean; -extern const void * RTTI_bnet__ConfigurationEntryInteger; -extern const void * RTTI_bnet__ConfigurationEntryFloat; -extern const void * RTTI_bnet__ConfigurationEntryLong; -extern const void * RTTI_bnet__ConfigurationEntryString; -extern const void * RTTI_bnet__IJobCollection; -extern const void * RTTI_bnet___detail__Composite; -extern const void * RTTI_bnet__IHeap; -extern const void * RTTI_bnet__IHttpConnectionProvider; -extern const void * RTTI_bnet__Network; -extern const void * RTTI_bnet__UserProcessor; -extern const void * RTTI_bnet__UserQueue; -extern const void * RTTI_bnet__UserProcessorCollection; -extern const void * RTTI_bnet__JobProcessorCollection; -extern const void * RTTI_bnet___impl__AsyncOperation; -extern const void * RTTI_bnet__SuspendFlow; -extern const void * RTTI_bnet__ResumeFlow; -extern const void * RTTI_bnet__CustomData__StringValue; -extern const void * RTTI_bnet__CustomData__BinaryValue; -extern const void * RTTI_bnet__CustomData__ObjectValue; -extern const void * RTTI_bnet__BaseHttpRequest; -extern const void * RTTI_bnet__LogoutFlow; -extern const void * RTTI_std__exception; -extern const void * RTTI_std__bad_weak_ptr; -extern const void * RTTI_bnet__Notification__UserData__ReconnectJob; -extern const void * RTTI_bnet__Notification__UserData__OnSystemIdFetchedRegister; -extern const void * RTTI_bnet__Notification__UserWebSocket__OnSystemIdFetchedSend; -extern const void * RTTI_bnet__Notification__UserWebSocket__OnConnected; -extern const void * RTTI_bnet__IUgcUploader; -extern const void * RTTI_bnet__ChunkedUploadFlow; -extern const void * RTTI_bnet__IDownloader; -extern const void * RTTI_bnet__DownloadFlow; -extern const void * RTTI_bnet__FileDownloader; -extern const void * RTTI_bnet__UgcBrowseRequest; -extern const void * RTTI_bnet__UgcArgLessRequest; -extern const void * RTTI_bnet__UgcCategoryCountRequest; -extern const void * RTTI_bnet__UgcContentUploadRequest; -extern const void * RTTI_bnet__UgcImageUploadRequest; -extern const void * RTTI_bnet__UgcAddVideoRequest; -extern const void * RTTI_bnet__UgcContentRequest; -extern const void * RTTI_bnet__UgcContentUploadDetailsRequest; -extern const void * RTTI_bnet__UgcCreationRequest; -extern const void * RTTI_bnet__UgcEditRequest; -extern const void * RTTI_bnet__UgcFlagRequest; -extern const void * RTTI_bnet__UgcListContentRequest; -extern const void * RTTI_bnet__UgcListCategoriesRequest; -extern const void * RTTI_bnet__UgcListDlcRequest; -extern const void * RTTI_bnet__Ugc__ListPlatformsRequest; -extern const void * RTTI_bnet__Ugc__ListProductsRequest; -extern const void * RTTI_bnet__UgcListFollowedAuthorRequest; -extern const void * RTTI_bnet__UgcListNotificationRequest; -extern const void * RTTI_bnet__UgcListBlacklistedRequest; -extern const void * RTTI_bnet__UgcListFeaturedContentRequest; -extern const void * RTTI_bnet__UgcListByEntitlementIdsRequest; -extern const void * RTTI_bnet__UgcNotificationAcknowledgeRequest; -extern const void * RTTI_bnet__UgcPreviewUploadRequest; -extern const void * RTTI_bnet__UgcQueryRequest; -extern const void * RTTI_bnet__UgcRateRequest; -extern const void * RTTI_bnet__UgcAddReleaseNoteRequest; -extern const void * RTTI_bnet__UgcUpdateReleaseNoteRequest; -extern const void * RTTI_bnet__UgcRemoveReleaseNoteRequest; -extern const void * RTTI_bnet__Ugc__RefreshEntitlementRequest; -extern const void * RTTI_bnet__Job; -extern const void * RTTI_bnet__FreeLessHeap; -extern const void * RTTI_bnet__AcquirableFreeLessHeap; -extern const void * RTTI_bnet__NetworkLoop; -extern const void * RTTI_bnet__AcceptLegalDocumentsRequest; -extern const void * RTTI_bnet__ListLegalDocumentsFlow; -extern const void * RTTI_bnet__AccountLinkingRequest; -extern const void * RTTI_bnet__AccountQuickCreateFlow; -extern const void * RTTI_bnet__AnonymousAuthenticationFlow; -extern const void * RTTI_bnet__SessionAnonymousCreateFlow; -extern const void * RTTI_bnet__SessionQuickCreateFlow; -extern const void * RTTI_bnet__AccountDeletionRequest; -extern const void * RTTI_bnet__AddFingerprintRequest; -extern const void * RTTI_bnet__IsAccountLinkableRequest; -extern const void * RTTI_bnet__UserCredentialsAuthenticationFlow; -extern const void * RTTI_bnet__ExternalAuthenticationFlow; -extern const void * RTTI_bnet__GameCodeAuthenticationFlow; -extern const void * RTTI_bnet__UnlinkAccountFlow; -extern const void * RTTI_bnet__UsernameValidationRequest; -extern const void * RTTI_bnet__VerifyFingerprintRequest; -extern const void * RTTI_bnet__VerifyLinkRequest; -extern const void * RTTI_bnet__TwitchAccountInfoRequest; -extern const void * RTTI_bnet__CheckDisplayNameRequest; -extern const void * RTTI_bnet__CheckEmailRequest; -extern const void * RTTI_bnet__RecoverPasswordRequest; -extern const void * RTTI_bnet__RecoverUsernameRequest; -extern const void * RTTI_bnet__ResendVerificationRequest; -extern const void * RTTI_bnet__SessionValidateRequest; -extern const void * RTTI_bnet__AccountInfoRequest; -extern const void * RTTI_bnet__RetrieveExternalAccountJob; -extern const void * RTTI_bnet__ExternalServiceRetrieveAccountRequest; -extern const void * RTTI_bnet__AccountUpgradeAnonymousToQuickRequest; -extern const void * RTTI_bnet__GameAccountLinkFlow; -extern const void * RTTI_bnet__GameAccountLinkConflictResolveFlow; -extern const void * RTTI_bnet__GameAccountExternalLinkConflictResolveFlow; -extern const void * RTTI_bnet__GameAccountUserCredentialsAuthenticationFlow; -extern const void * RTTI_bnet__GameAccountExternalAuthenticationFlow; -extern const void * RTTI_bnet__GameAccountExternalLinkFlow; -extern const void * RTTI_bnet__GameAccountGameCodeAuthenticationFlow; -extern const void * RTTI_bnet__SessionResumeFlow; -extern const void * RTTI_bnet__NewGameSessionFlow; -extern const void * RTTI_bnet__Entitlements__CombinedEntitlementsListRequest; -extern const void * RTTI_bnet__Entitlements__ListRequest; -extern const void * RTTI_bnet__Entitlements__ConsumeRequest; -extern const void * RTTI_bnet__Entitlements__SearchRequest; -extern const void * RTTI_bnet__VCCS__MTX__Generic__GetCatalogRequest; -extern const void * RTTI_bnet__VCCS__MTX__Generic__PurchaseRequest; -extern const void * RTTI_bnet__VCCS__MTX__Generic__GetStoreURLRequest; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentRequestBase; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentCreateRequest; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentDeleteRequest; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentGetRequest; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentListRequest; -extern const void * RTTI_bnet__Gsp__Profile__DataAttachmentUpdateRequest; -extern const void * RTTI_bnet__Gsp__Profile__ProfileGetRequest; -extern const void * RTTI_bnet__Gsp__Profile__ProfileUpdateRequest; -extern const void * RTTI_bnet__EventLog__LogEventRequest; -extern const void * RTTI_bnet__VCCS__Wallet__BalanceRequest; -extern const void * RTTI_bnet__VCCS__Wallet__BalanceListRequest; -extern const void * RTTI_bnet__VCCS__Wallet__PurchaseRequest; -extern const void * RTTI_bnet__VCCS__Wallet__PurchasePreviewRequest; -extern const void * RTTI_bnet__VCCS__Wallet__ServerlessCreditRequest; -extern const void * RTTI_bnet__VCCS__Wallet__ServerlessDebitRequest; -extern const void * RTTI_bnet__UgcMtxPurchaseFlow; -extern const void * RTTI_bnet__VCCS__Fulfillment__UpdateFirstPartyEntitlementRequest; -extern const void * RTTI_bnet__VCCS__Catalog__GetContentsRequest; -extern const void * RTTI_bnet__VCCS__Catalog__GetItemRequest; -extern const void * RTTI_bnet__VCCS__Catalog__ListCategoryPathRequest; -extern const void * RTTI_bnet__VCCS__Catalog__ListCategoryPathChildrenRequest; -extern const void * RTTI_bnet__VCCS__Catalog__ListItemsRequest; -extern const void * RTTI_bnet__VCCS__Catalog__GetBundlePreviewRequest; -extern const void * RTTI_bnet__VCCS__Catalog__GetBundlePreviewListRequest; -extern const void * RTTI_bnet__CMS__ListMessagesRequest; -extern const void * RTTI_bnet__CMS__GetMultiMessageRequest; -extern const void * RTTI_bnet__Status__GetExtServerStatusRequest; -extern const void * RTTI_bnet__Status__GetStatusRequest; -extern const void * RTTI_bnet__SessionLogoutRequest; -extern const void * RTTI_bnet__NotificationLogoutRequest; -extern const void * RTTI_bnet__Notification__Context__OnSystemFetched; -extern const void * RTTI_bnet__Notification__ReceiveJob; -extern const void * RTTI_bnet__Notification__FilterJob; -extern const void * RTTI_bnet__UgcCancelUploadRequest; -extern const void * RTTI_bnet__UgcChunkedUploadCompletionRequest; -extern const void * RTTI_bnet__UgcChunkedUploadInitiationRequest; -extern const void * RTTI_bnet__UgcChunkUploadRequest; -extern const void * RTTI_bnet__CdpFileInfoRequest; -extern const void * RTTI_bnet__CdpKeyRequest; -extern const void * RTTI_bnet__BaseFileDownloader; -extern const void * RTTI_bnet__HttpTransport; -extern const void * RTTI_bnet__WinHttpTransport; -extern const void * RTTI_bnet__SessionRefreshRequest; -extern const void * RTTI_bnet__SessionResumeRequest; -extern const void * RTTI_bnet__ListRequiredLegalDocumentsRequest; -extern const void * RTTI_bnet__AuthenticationFlow; -extern const void * RTTI_bnet__BeamQuickCreationRequest; -extern const void * RTTI_bnet__AnonymousAuthRequest; -extern const void * RTTI_bnet__SessionAnonymousAccountCreateRequest; -extern const void * RTTI_bnet__SessionQuickCreateRequest; -extern const void * RTTI_bnet__SessionAuthRequest; -extern const void * RTTI_bnet__BeamUserCredentialsAuthenticationRequest; -extern const void * RTTI_bnet__BeamExternalAuthenticationRequest; -extern const void * RTTI_bnet__SessionExternalAuthRequest; -extern const void * RTTI_bnet__Session__GameCodeAuthRequest; -extern const void * RTTI_bnet__TokenUpgradeRequest; -extern const void * RTTI_bnet__AccountUnlinkingRequest; -extern const void * RTTI_bnet__RetrieveExternalAccountRequest; -extern const void * RTTI_bnet__GameAccountLinkRequest; -extern const void * RTTI_bnet__GameAccountLinkConflictResolveRequest; -extern const void * RTTI_bnet__GameAccountExternalLinkConflictResolveRequest; -extern const void * RTTI_bnet__GameAccountAuthenticationRequest; -extern const void * RTTI_bnet__GameAccountExternalAuthRequest; -extern const void * RTTI_bnet__GameAccountExternalLinkRequest; -extern const void * RTTI_bnet__Session__GameAccountGameCodeAuthRequest; -extern const void * RTTI_bnet__SharedSRWMutex; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob; -extern const void * RTTI_bnet__ISocket; -extern const void * RTTI_bnet__CSocket; -extern const void * RTTI_bnet__CSecureSocket; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__SocketInitJob; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__SendHandshakeJob; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__ReceiveHandshakeJob; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__IWriteJobSequence; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__WriteJobSequence; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__WriteJobSequence__WriteJob; -extern const void * RTTI_bnet__WebSocketUtils__WebSocketJob__ReadJob; -extern const void * RTTI_bnet__Notification__ListSystemRequest; -extern const void * RTTI_bnet__Notification__ChangeFilterRequest; -extern const void * RTTI_bnet__Presence__AppearDoNotDisturbRequest; -extern const void * RTTI_bnet__Presence__AppearOfflineRequest; -extern const void * RTTI_bnet__Presence__GetRequest; -extern const void * RTTI_bnet__Presence__UpdateRequest; -extern const void * RTTI_bnet__SessionTokenRequest; -extern const void * RTTI_bnet__NotificationConnectRequest; -extern const void * RTTI_bnet__SessionAccessTokenRequest; -extern const void * RTTI_bnet__CdpAuthenticationRequest; -extern const void * RTTI_bnet__SessionResumeTokenRequest; -extern const void * RTTI_bnet__BeamAuthenticationRequest; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__HandshakeJob; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__InitializeJob; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__WriteJob; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__ReceiveJob; -extern const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__ReceiveJob__DecodeJob; -extern const void * RTTI_BSScript__IFindBoundObjectFunctor; -extern const void * RTTI_BSScript__IVMObjectBindInterface; -extern const void * RTTI_BSScript__IVMSaveLoadInterface; -extern const void * RTTI_BSScript__IVirtualMachine; -extern const void * RTTI_BSScript__IVMDebugInterface; -extern const void * RTTI_BSScript__ErrorLogger; -extern const void * RTTI_BSScript__UnlinkedTypes__Function__ConvertTypeFunctor; -extern const void * RTTI_BSScript__ByteCode__PackedInstructionStream__InstructionFunctor; -extern const void * RTTI_BSScript__IMemoryPagePolicy; -extern const void * RTTI_BSScript__SimpleAllocMemoryPagePolicy; -extern const void * RTTI_BSScript__CompiledScriptLoader; -extern const void * RTTI_BSScript__IFunction; -extern const void * RTTI_BSScript__NF_util__NativeFunctionBase; -extern const void * RTTI_BSScript__Internal__VirtualMachine; -extern const void * RTTI_BSScript__Internal__IFuncCallQuery; -extern const void * RTTI_BSScript__Internal__RawFuncCallQuery; -extern const void * RTTI_BSScript__IObjectProcessor; -extern const void * RTTI_BSScript__Internal__CodeTasklet; -extern const void * RTTI_BSScript__Internal__AutoPropGetFunction; -extern const void * RTTI_BSScript__Internal__AutoPropSetFunction; -extern const void * RTTI_BSScript__Internal__NativeFunctionStub; -extern const void * RTTI_BSScript__UnlinkedTypes__InstructionStream__InstructionFunctor; -extern const void * RTTI_BSScript__LinkerProcessor; -extern const void * RTTI_BSScript__Internal__ScriptFunction; -extern const void * RTTI_BSFadeNode; -extern const void * RTTI_BSShaderProperty; -extern const void * RTTI_BSLeafAnimNode; -extern const void * RTTI_BSTreeNode; -extern const void * RTTI_BSImagespaceShaderAlphaBlend; -extern const void * RTTI_BSImagespaceShaderBlur3; -extern const void * RTTI_BSImagespaceShaderBlur5; -extern const void * RTTI_BSImagespaceShaderBlur7; -extern const void * RTTI_BSImagespaceShaderBlur9; -extern const void * RTTI_BSImagespaceShaderBlur11; -extern const void * RTTI_BSImagespaceShaderBlur13; -extern const void * RTTI_BSImagespaceShaderBlur15; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur3; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur5; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur7; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur9; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur11; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur13; -extern const void * RTTI_BSImagespaceShaderNonHDRBlur15; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur3; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur5; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur7; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur9; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur11; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur13; -extern const void * RTTI_BSImagespaceShaderBrightPassBlur15; -extern const void * RTTI_BSImagespaceShaderCopy; -extern const void * RTTI_BSImagespaceShaderCopyDynamicFetchDisabled; -extern const void * RTTI_BSImagespaceShaderCopyScaleBias; -extern const void * RTTI_BSImagespaceShaderTextureMask; -extern const void * RTTI_BSImagespaceShaderGreyScale; -extern const void * RTTI_BSImagespaceShaderCopyCustomViewport; -extern const void * RTTI_BSImagespaceShaderDepthOfField; -extern const void * RTTI_BSImagespaceShaderDepthOfFieldFogged; -extern const void * RTTI_BSImagespaceShaderDepthOfFieldMaskedFogged; -extern const void * RTTI_BSImagespaceShaderDistantBlur; -extern const void * RTTI_BSImagespaceShaderDistantBlurFogged; -extern const void * RTTI_BSImagespaceShaderDistantBlurMaskedFogged; -extern const void * RTTI_BSImagespaceShaderDoubleVision; -extern const void * RTTI_BSImagespaceShaderFXAA; -extern const void * RTTI_BSImagespaceShaderHDRDownSample4; -extern const void * RTTI_BSImagespaceShaderHDRDownSample16Lum; -extern const void * RTTI_BSImagespaceShaderHDRDownSample4RGB2Lum; -extern const void * RTTI_BSImagespaceShaderHDRDownSample16; -extern const void * RTTI_BSImagespaceShaderHDRDownSample4LumClamp; -extern const void * RTTI_BSImagespaceShaderHDRDownSample16LumClamp; -extern const void * RTTI_BSImagespaceShaderHDRDownSample4LightAdapt; -extern const void * RTTI_BSImagespaceShaderHDRDownSample16LightAdapt; -extern const void * RTTI_BSImagespaceShaderHDRTonemapBlendCinematic; -extern const void * RTTI_BSImagespaceShaderHDRTonemapBlendCinematicFade; -extern const void * RTTI_BSImagespaceShaderLocalMap; -extern const void * RTTI_BSImagespaceShaderMap; -extern const void * RTTI_BSImagespaceShaderWorldMap; -extern const void * RTTI_BSImagespaceShaderWorldMapNoSkyBlur; -extern const void * RTTI_BSImagespaceShaderNoiseScrollAndBlend; -extern const void * RTTI_BSImagespaceShaderNoiseNormalmap; -extern const void * RTTI_BSImagespaceShaderRadialBlur; -extern const void * RTTI_BSImagespaceShaderRadialBlurMedium; -extern const void * RTTI_BSImagespaceShaderRadialBlurHigh; -extern const void * RTTI_BSImagespaceShaderRefraction; -extern const void * RTTI_BSImagespaceShaderWaterDisplacementClearSimulation; -extern const void * RTTI_BSImagespaceShaderWaterDisplacementTexOffset; -extern const void * RTTI_BSImagespaceShaderWaterDisplacementWadingRipple; -extern const void * RTTI_BSImagespaceShaderWaterDisplacementRainRipple; -extern const void * RTTI_BSImagespaceShaderWaterWadingHeightmap; -extern const void * RTTI_BSImagespaceShaderWaterRainHeightmap; -extern const void * RTTI_BSImagespaceShaderWaterBlendHeightmaps; -extern const void * RTTI_BSImagespaceShaderWaterSmoothHeightmap; -extern const void * RTTI_BSImagespaceShaderWaterDisplacementNormals; -extern const void * RTTI_BSImagespaceShaderVolumetricLighting; -extern const void * RTTI_BSImagespaceShaderWaterFlow; -extern const void * RTTI_BSImagespaceShaderApplyReflections; -extern const void * RTTI_BSImagespaceShaderISApplyVolumetricLighting; -extern const void * RTTI_BSImagespaceShaderISBasicCopy; -extern const void * RTTI_BSImagespaceShaderISBlur; -extern const void * RTTI_BSImagespaceShaderISVolumetricLightingBlurHCS; -extern const void * RTTI_BSImagespaceShaderISVolumetricLightingBlurVCS; -extern const void * RTTI_BSImagespaceShaderReflectionBlurHCS; -extern const void * RTTI_BSImagespaceShaderReflectionBlurVCS; -extern const void * RTTI_BSImagespaceShaderISParallaxMaskBlurHCS; -extern const void * RTTI_BSImagespaceShaderISParallaxMaskBlurVCS; -extern const void * RTTI_BSImagespaceShaderISDepthOfFieldBlurHCS; -extern const void * RTTI_BSImagespaceShaderISDepthOfFieldBlurVCS; -extern const void * RTTI_BSImagespaceShaderISCompositeVolumetricLighting; -extern const void * RTTI_BSImagespaceShaderISCompositeLensFlare; -extern const void * RTTI_BSImagespaceShaderISCompositeLensFlareVolumetricLighting; -extern const void * RTTI_BSImagespaceShaderISCopySubRegionCS; -extern const void * RTTI_BSImagespaceShaderISDebugSnow; -extern const void * RTTI_BSImagespaceShaderISDownsample; -extern const void * RTTI_BSImagespaceShaderISDownsampleIgnoreBrightest; -extern const void * RTTI_BSImagespaceShaderISDownsampleCS; -extern const void * RTTI_BSImagespaceShaderISDownsampleIgnoreBrightestCS; -extern const void * RTTI_BSImagespaceShaderISExp; -extern const void * RTTI_BSImagespaceShaderISIBLensFlares; -extern const void * RTTI_BSImagespaceShaderISLightingComposite; -extern const void * RTTI_BSImagespaceShaderISLightingCompositeNoDirectionalLight; -extern const void * RTTI_BSImagespaceShaderISLightingCompositeMenu; -extern const void * RTTI_BSImagespaceShaderISPerlinNoiseCS; -extern const void * RTTI_BSImagespaceShaderISPerlinNoise2DCS; -extern const void * RTTI_BSImagespaceShaderReflectionsRayTracing; -extern const void * RTTI_BSImagespaceShaderReflectionsDebugSpecMask; -extern const void * RTTI_BSImagespaceShaderISSAOBlurH; -extern const void * RTTI_BSImagespaceShaderISSAOBlurV; -extern const void * RTTI_BSImagespaceShaderISSAOBlurHCS; -extern const void * RTTI_BSImagespaceShaderISSAOBlurVCS; -extern const void * RTTI_BSImagespaceShaderISSAOCameraZ; -extern const void * RTTI_BSImagespaceShaderISSAOCameraZAndMipsCS; -extern const void * RTTI_BSImagespaceShaderISSAOCompositeSAO; -extern const void * RTTI_BSImagespaceShaderISSAOCompositeFog; -extern const void * RTTI_BSImagespaceShaderISSAOCompositeSAOFog; -extern const void * RTTI_BSImagespaceShaderISMinify; -extern const void * RTTI_BSImagespaceShaderISMinifyContrast; -extern const void * RTTI_BSImagespaceShaderISSAORawAO; -extern const void * RTTI_BSImagespaceShaderISSAORawAONoTemporal; -extern const void * RTTI_BSImagespaceShaderISSAORawAOCS; -extern const void * RTTI_BSImagespaceShaderISSILComposite; -extern const void * RTTI_BSImagespaceShaderISSILRawInd; -extern const void * RTTI_BSImagespaceShaderISSimpleColor; -extern const void * RTTI_BSImagespaceShaderISDisplayDepth; -extern const void * RTTI_BSImagespaceShaderISSnowSSS; -extern const void * RTTI_BSImagespaceShaderISTemporalAA; -extern const void * RTTI_BSImagespaceShaderISTemporalAA_UI; -extern const void * RTTI_BSImagespaceShaderISTemporalAA_Water; -extern const void * RTTI_BSImagespaceShaderISUpsampleDynamicResolution; -extern const void * RTTI_BSImagespaceShaderISWaterBlend; -extern const void * RTTI_BSImagespaceShaderISUnderwaterMask; -extern const void * RTTI_ShadowSceneNode; -extern const void * RTTI_BSLightingShaderProperty; -extern const void * RTTI_BSGrassShaderProperty; -extern const void * RTTI_BSShaderAccumulator; -extern const void * RTTI_BSGrassShader; -extern const void * RTTI_BSLightingShaderMaterialBase; -extern const void * RTTI_BSLightingShaderMaterialEnvmap; -extern const void * RTTI_BSLightingShaderMaterialEye; -extern const void * RTTI_BSLightingShaderMaterialGlowmap; -extern const void * RTTI_BSLightingShaderMaterialParallax; -extern const void * RTTI_BSLightingShaderMaterialParallaxOcc; -extern const void * RTTI_BSLightingShaderMaterialFacegen; -extern const void * RTTI_BSLightingShaderMaterialFacegenTint; -extern const void * RTTI_BSLightingShaderMaterialHairTint; -extern const void * RTTI_BSLightingShaderMaterialLandscape; -extern const void * RTTI_BSLightingShaderMaterialLODLandscape; -extern const void * RTTI_BSLightingShaderMaterialSnow; -extern const void * RTTI_BSLightingShaderMaterialMultiLayerParallax; -extern const void * RTTI_BSEffectShaderProperty; -extern const void * RTTI_ImageSpaceEffectParam; -extern const void * RTTI_ImageSpaceShaderParam; -extern const void * RTTI_BSWaterShaderProperty; -extern const void * RTTI_BSBloodSplatterShaderProperty; -extern const void * RTTI_BSBloodSplatterShader; -extern const void * RTTI_BSImagespaceShaderLensFlare; -extern const void * RTTI_BSImagespaceShaderLensFlareVisibility; -extern const void * RTTI_BSParticleShaderProperty; -extern const void * RTTI_ImageSpaceEffectHDR; -extern const void * RTTI_BSLightingShader; -extern const void * RTTI_BSWaterShader; -extern const void * RTTI_ImageSpaceEffectVolumetricLighting; -extern const void * RTTI_ImageSpaceEffectOption; -extern const void * RTTI_ImageSpaceEffectDepthOfField; -extern const void * RTTI_BSSkyShader; -extern const void * RTTI_BSSkyShaderProperty; -extern const void * RTTI_ImageSpaceEffect; -extern const void * RTTI_BSEffectShaderMaterial; -extern const void * RTTI_BSEffectShader; -extern const void * RTTI_BSDistantTreeShaderProperty; -extern const void * RTTI_BSDistantTreeShader; -extern const void * RTTI_BSCubeMapCamera; -extern const void * RTTI_BSWaterShaderMaterial; -extern const void * RTTI_ImageSpaceEffectWaterDisplacement; -extern const void * RTTI_BSFogProperty; -extern const void * RTTI_BSShadowLight; -extern const void * RTTI_BSBatchRenderer; -extern const void * RTTI_BSClearZNode; -extern const void * RTTI_BSImagespaceShader; -extern const void * RTTI_ImageSpaceEffectRefraction; -extern const void * RTTI_ImageSpaceEffectRadialBlur; -extern const void * RTTI_BSUtilityShader; -extern const void * RTTI_ImageSpaceEffectWorldMap; -extern const void * RTTI_NiThreadProcedure; -extern const void * RTTI_NiMemStream; -extern const void * RTTI_NiCollisionObject; -extern const void * RTTI_BSOrderedNode; -extern const void * RTTI_BSLines; -extern const void * RTTI_BSDynamicLines; -extern const void * RTTI_UnitTest_BSStreamParserStream; -extern const void * RTTI_UnitTest_BSStreamParserData; -extern const void * RTTI_BSShapeConstructor; -extern const void * RTTI_BSBoxConstructor; -extern const void * RTTI_BSOrientedBoxConstructor; -extern const void * RTTI_BSSphereConstructor; -extern const void * RTTI_BSCylinderConstructor; -extern const void * RTTI_BSCapsuleConstructor; -extern const void * RTTI_BSArrowConstructor; -extern const void * RTTI_BSCircleConstructor; -extern const void * RTTI_BSRingConstructor; -extern const void * RTTI_BSFlatQuadConstructor; -extern const void * RTTI_BSDiskConstructor; -extern const void * RTTI_BSMultiIndexTriShape; -extern const void * RTTI_BSShaderMaterial; -extern const void * RTTI_BSLight; -extern const void * RTTI_BSShader; -extern const void * RTTI_NiBoneMatrixSetterI; -extern const void * RTTI_BSReloadShaderI; -extern const void * RTTI_BSParticleShader; -extern const void * RTTI_BSLightingShaderPropertyFloatController; -extern const void * RTTI_BSLightingShaderPropertyUShortController; -extern const void * RTTI_BSLightingShaderPropertyColorController; -extern const void * RTTI_BSEffectShaderPropertyFloatController; -extern const void * RTTI_BSEffectShaderPropertyColorController; -extern const void * RTTI_BSNiAlphaPropertyTestRefController; -extern const void * RTTI_BSPSysSimpleColorModifier; -extern const void * RTTI_BSPSysLODModifier; -extern const void * RTTI_BSShadowDirectionalLight; -extern const void * RTTI_BSShaderResourceManager; -extern const void * RTTI_IRendererResourceManager; -extern const void * RTTI_ImageSpaceEffectGetHit; -extern const void * RTTI_ImageSpaceEffectBlur; -extern const void * RTTI_ImageSpaceEffectFullScreenBlur; -extern const void * RTTI_ImageSpaceEffectMap; -extern const void * RTTI_ImageSpaceEffectNoise; -extern const void * RTTI_BSParabolicCullingProcess; -extern const void * RTTI_BSShadowFrustumLight; -extern const void * RTTI_BSShadowParabolicLight; -extern const void * RTTI_BSComputeShader; -extern const void * RTTI_BSMeshLODTriShape; -extern const void * RTTI_BSLODMultiIndexTriShape; -extern const void * RTTI_BSSubIndexLandTriShape; -extern const void * RTTI_BSSystemMonitor__SocketThread; -extern const void * RTTI_BSSystemMonitor__MemOpsThread; -extern const void * RTTI_BSSystemUtility; -extern const void * RTTI_BSGameDataSystemUtility; -extern const void * RTTI_BSWin32SaveDataSystemUtility; -extern const void * RTTI_BSSaveDataSystemUtility; -extern const void * RTTI_BSSaveDataSystemUtility__Entry; -extern const void * RTTI_BSSaveDataSystemUtilityFile; -extern const void * RTTI_BSSystemUtilitiesStrings; -extern const void * RTTI_BSStreamSystemUtility; -extern const void * RTTI_CCallbackBase; -extern const void * RTTI_BSWin32SystemUtility; -extern const void * RTTI_BSCacheDriveSystemUtility; -extern const void * RTTI_BSSysInfoSystemUtility; -extern const void * RTTI_BSWin32GameDataSystemUtility; -extern const void * RTTI_BSAwardsSystemUtility; -extern const void * RTTI_BSWin32AwardsSystemUtility; -extern const void * RTTI_BSMsgDialogSystemUtility; -extern const void * RTTI_BSDiscBootSystemUtility; -extern const void * RTTI_type_info; -extern const void * RTTI_BSSocket; -extern const void * RTTI_BSSocketServer; diff --git a/source/fs.dll/skse64/skse64/GameRTTI.inl b/source/fs.dll/skse64/skse64/GameRTTI.inl deleted file mode 100644 index 5a0886ee..00000000 --- a/source/fs.dll/skse64/skse64/GameRTTI.inl +++ /dev/null @@ -1,3387 +0,0 @@ -const void * RTTI_IFormFactory = (void *)0x01EA7B00; -const void * RTTI_BaseFormComponent = (void *)0x01EA7B28; -const void * RTTI_AlchemyItem = (void *)0x01EA7B90; -const void * RTTI_BGSDualCastData = (void *)0x01EA7F50; -const void * RTTI_Setting = (void *)0x01EA7FB8; -const void * RTTI_GameSettingCollection = (void *)0x01EA8158; -const void * RTTI_BSTArrayBase__IAllocatorFunctor = (void *)0x01EA82B8; -const void * RTTI_TESFullName = (void *)0x01EA7C20; -const void * RTTI_EffectSetting = (void *)0x01EA81F8; -const void * RTTI_EnchantmentItem = (void *)0x01EA8520; -const void * RTTI_IngredientItem = (void *)0x01EA85E8; -const void * RTTI_BSModelDB__QueuedHandles = (void *)0x01EA86A0; -const void * RTTI_TESModelDB__TESQueuedHandles = (void *)0x01EA87B0; -const void * RTTI_MagicItem = (void *)0x01EA7BB8; -const void * RTTI_MagicItem__PreloadableVisitor = (void *)0x01EA87E8; -const void * RTTI_MagicItemTraversalFunctor = (void *)0x01EA8820; -const void * RTTI_MagicItemFindFunctor = (void *)0x01EA8850; -const void * RTTI_MagicItemFindKeywordFunctor = (void *)0x01EA8880; -const void * RTTI_AnimationSystemUtils__TESModelAndAnimationHandles = (void *)0x01EA88C0; -const void * RTTI_FindNonExcludedDeliveryFunctor = (void *)0x01EA89B8; -const void * RTTI_FindEqualsFunctor = (void *)0x01EA8A60; -const void * RTTI_GetCostliestEffectFunctor = (void *)0x01EA8A88; -const void * RTTI_LongestDurationFunctor = (void *)0x01EA8AB8; -const void * RTTI_LargestAreaFunctor = (void *)0x01EA8AE8; -const void * RTTI_GetMagicItemDescriptionFunctor = (void *)0x01EA8B18; -const void * RTTI_ScrollItem = (void *)0x01EA8BE0; -const void * RTTI_SpellItem = (void *)0x01EA7B70; -const void * RTTI_ExtraSeenData = (void *)0x01EA8D08; -const void * RTTI_BSExtraData = (void *)0x01EA8CE0; -const void * RTTI_ExtraHavok = (void *)0x01EA8D30; -const void * RTTI_ExtraEditorID = (void *)0x01EA8D58; -const void * RTTI_MagicTarget = (void *)0x01EA8D80; -const void * RTTI_ExtraTimeLeft = (void *)0x01EA8DA8; -const void * RTTI_ExtraLock = (void *)0x01EA8DD0; -const void * RTTI_ExtraTeleport = (void *)0x01EA8DF0; -const void * RTTI_ExtraStartingPosition = (void *)0x01EA8E18; -const void * RTTI_ExtraOwnership = (void *)0x01EA8E48; -const void * RTTI_ExtraGlobal = (void *)0x01EA8E70; -const void * RTTI_ExtraRank = (void *)0x01EA8E98; -const void * RTTI_ExtraCount = (void *)0x01EA8EB8; -const void * RTTI_ExtraWorn = (void *)0x01EA8EE0; -const void * RTTI_ExtraWornLeft = (void *)0x01EA8F00; -const void * RTTI_ExtraLeveledItem = (void *)0x01EA8F28; -const void * RTTI_ExtraOutfitItem = (void *)0x01EA8F50; -const void * RTTI_ExtraHealth = (void *)0x01EA8F78; -const void * RTTI_ExtraHealthPerc = (void *)0x01EA8FA0; -const void * RTTI_ExtraCharge = (void *)0x01EA8FC8; -const void * RTTI_ExtraScale = (void *)0x01EA8FF0; -const void * RTTI_ExtraReferenceHandle = (void *)0x01EA9018; -const void * RTTI_ExtraFollower = (void *)0x01EA9048; -const void * RTTI_ExtraOriginalReference = (void *)0x01EA9070; -const void * RTTI_ExtraEnableStateParent = (void *)0x01EA90A0; -const void * RTTI_ExtraEnableStateChildren = (void *)0x01EA90D0; -const void * RTTI_ExtraLinkedRef = (void *)0x01EA9100; -const void * RTTI_ExtraLinkedRefChildren = (void *)0x01EA9128; -const void * RTTI_ExtraActivateRef = (void *)0x01EA9158; -const void * RTTI_ExtraActivateRefChildren = (void *)0x01EA9180; -const void * RTTI_ExtraRandomTeleportMarker = (void *)0x01EA91B0; -const void * RTTI_ExtraCannotWear = (void *)0x01EA91E0; -const void * RTTI_ExtraPoison = (void *)0x01EA9208; -const void * RTTI_ExtraLastFinishedSequence = (void *)0x01EA9230; -const void * RTTI_ExtraItemDropper = (void *)0x01EA9260; -const void * RTTI_ExtraDroppedItemList = (void *)0x01EA9288; -const void * RTTI_ExtraSavedAnimation = (void *)0x01EA92B8; -const void * RTTI_ExtraSavedHavokData = (void *)0x01EA92E8; -const void * RTTI_ExtraHeadingTarget = (void *)0x01EA9318; -const void * RTTI_ExtraRefractionProperty = (void *)0x01EA9348; -const void * RTTI_ExtraSound = (void *)0x01EA9378; -const void * RTTI_ExtraCreatureAwakeSound = (void *)0x01EA93A0; -const void * RTTI_ExtraCreatureMovementSound = (void *)0x01EA93D0; -const void * RTTI_ExtraWeaponIdleSound = (void *)0x01EA9408; -const void * RTTI_ExtraWeaponAttackSound = (void *)0x01EA9438; -const void * RTTI_ExtraActivateLoopSound = (void *)0x01EA9468; -const void * RTTI_ExtraObjectHealth = (void *)0x01EA9498; -const void * RTTI_ExtraFactionChanges = (void *)0x01EA94C0; -const void * RTTI_ExtraActorCause = (void *)0x01EA94F0; -const void * RTTI_ExtraPatrolRefData = (void *)0x01EA9518; -const void * RTTI_ExtraEncounterZone = (void *)0x01EA9548; -const void * RTTI_ExtraNavMeshPortal = (void *)0x01EA9578; -const void * RTTI_ExtraOcclusionPlaneRefData = (void *)0x01EA95A8; -const void * RTTI_ExtraPortalRefData = (void *)0x01EA95E0; -const void * RTTI_ExtraRoomRefData = (void *)0x01EA9610; -const void * RTTI_ExtraAliasInstanceArray = (void *)0x01EA9638; -const void * RTTI_ExtraSceneData = (void *)0x01EA9668; -const void * RTTI_ExtraBadPosition = (void *)0x01EA9690; -const void * RTTI_ExtraHeadTrackingWeight = (void *)0x01EA96B8; -const void * RTTI_ExtraFavorCost = (void *)0x01EA96E8; -const void * RTTI_ExtraTextDisplayData = (void *)0x01EA9710; -const void * RTTI_ExtraHorse = (void *)0x01EA9740; -const void * RTTI_ExtraEnchantment = (void *)0x01EA9768; -const void * RTTI_ExtraForcedTarget = (void *)0x01EA9790; -const void * RTTI_ExtraUniqueID = (void *)0x01EA97B8; -const void * RTTI_ExtraFlags = (void *)0x01EA97E0; -const void * RTTI_ExtraDecalGroup = (void *)0x01EA9808; -const void * RTTI_ExtraWaterCurrentZoneData = (void *)0x01EA9830; -const void * RTTI_ExtraMissingRefIDs = (void *)0x01EA9860; -const void * RTTI_ExtraCell3D = (void *)0x01EA9890; -const void * RTTI_ExtraRegionList = (void *)0x01EA98B8; -const void * RTTI_ExtraCellSkyRegion = (void *)0x01EA98E0; -const void * RTTI_ExtraCellImageSpace = (void *)0x01EA9910; -const void * RTTI_ExtraNorthRotation = (void *)0x01EA9940; -const void * RTTI_ExtraDetachTime = (void *)0x01EA9970; -const void * RTTI_ExtraCanTalkToPlayer = (void *)0x01EA9998; -const void * RTTI_ExtraPrimitive = (void *)0x01EA99C8; -const void * RTTI_ExtraAmmo = (void *)0x01EA99F0; -const void * RTTI_ExtraMagicLight = (void *)0x01EA9A10; -const void * RTTI_ExtraFromAlias = (void *)0x01EA9A60; -const void * RTTI_ExtraOpenCloseActivateRef = (void *)0x01EA9A88; -const void * RTTI_ExtraTeleportName = (void *)0x01EA9AB8; -const void * RTTI_ExtraCachedScale = (void *)0x01EA9AE0; -const void * RTTI_ExtraHotkey = (void *)0x01EA9B08; -const void * RTTI_ExtraPackageStartLocation = (void *)0x01EA9B30; -const void * RTTI_ExtraLocation = (void *)0x01EA9B60; -const void * RTTI_ExtraTresPassPackage = (void *)0x01EA9B88; -const void * RTTI_ExtraRagDollData = (void *)0x01EA9BB8; -const void * RTTI_ExtraAttachRef = (void *)0x01EA9BE0; -const void * RTTI_ExtraAttachRefChildren = (void *)0x01EA9C08; -const void * RTTI_ExtraAshPileRef = (void *)0x01EA9C38; -const void * RTTI_ExtraLocationRefType = (void *)0x01EA9C60; -const void * RTTI_ExtraLeveledItemBase = (void *)0x01EA9C90; -const void * RTTI_ExtraReflectedRefs = (void *)0x01EA9CC0; -const void * RTTI_ExtraReflectorRefs = (void *)0x01EA9CF0; -const void * RTTI_ExtraWaterLightRefs = (void *)0x01EA9D20; -const void * RTTI_ExtraLitWaterRefs = (void *)0x01EA9D50; -const void * RTTI_ExtraLevCreaModifier = (void *)0x01EA9D78; -const void * RTTI_ExtraSpawnContainer = (void *)0x01EA9DA8; -const void * RTTI_ExtraEmittanceSource = (void *)0x01EA9DD8; -const void * RTTI_ExtraMultiBoundRef = (void *)0x01EA9E08; -const void * RTTI_ExtraMultiBound = (void *)0x01EA9E38; -const void * RTTI_ExtraRoom = (void *)0x01EA9E60; -const void * RTTI_ExtraFriendHits = (void *)0x01EA9E80; -const void * RTTI_ExtraStartingWorldOrCell = (void *)0x01EA9EA8; -const void * RTTI_ExtraHasNoRumors = (void *)0x01EA9ED8; -const void * RTTI_ExtraTerminalState = (void *)0x01EA9F00; -const void * RTTI_ExtraModelSwap = (void *)0x01EA9F30; -const void * RTTI_ExtraRadius = (void *)0x01EA9F58; -const void * RTTI_ExtraCombatStyle = (void *)0x01EA9F80; -const void * RTTI_ExtraPackageData = (void *)0x01EA9FA8; -const void * RTTI_ExtraCollisionData = (void *)0x01EA9FD0; -const void * RTTI_ExtraGuardedRefData = (void *)0x01EAA000; -const void * RTTI_ExtraIgnoredBySandbox = (void *)0x01EAA030; -const void * RTTI_ExtraPromotedRef = (void *)0x01EAA060; -const void * RTTI_ExtraLargeRefOwnerCells = (void *)0x01EAA088; -const void * RTTI_ExtraLightData = (void *)0x01EAA0B8; -const void * RTTI_ExtraAttachedArrows3D = (void *)0x01EAA0E0; -const void * RTTI_ExtraAlphaCutoff = (void *)0x01EAA110; -const void * RTTI_ExtraForcedLandingMarker = (void *)0x01EAA138; -const void * RTTI_ExtraRefrPath = (void *)0x01EAA168; -const void * RTTI_ExtraCellWaterEnvMap = (void *)0x01EAA190; -const void * RTTI_ExtraWaterData = (void *)0x01EAA1C0; -const void * RTTI_ExtraScriptedAnimDependence = (void *)0x01EAA1E8; -const void * RTTI_ExtraCellMusicType = (void *)0x01EAA220; -const void * RTTI_ExtraCellAcousticSpace = (void *)0x01EAA250; -const void * RTTI_ExtraCellWaterType = (void *)0x01EAA280; -const void * RTTI_ExtraGIDBuffer = (void *)0x01EAA2B0; -const void * RTTI_ExtraMissingLinkedRefIDs = (void *)0x01EAA688; -const void * RTTI_NonActorMagicTarget = (void *)0x01EAA6B8; -const void * RTTI_ExtraMapMarker = (void *)0x01EAA6E8; -const void * RTTI_ExtraDistantData = (void *)0x01EAA710; -const void * RTTI_ExtraAnimNoteReceiver = (void *)0x01EAA738; -const void * RTTI_ExtraLockList = (void *)0x01EAA768; -const void * RTTI_ExtraPersistentCell = (void *)0x01EAA790; -const void * RTTI_ExtraRaceData = (void *)0x01EAA7C0; -const void * RTTI_ExtraAnimGraphManager = (void *)0x01EAA7E8; -const void * RTTI_ExtraDismemberedLimbs = (void *)0x01EAA818; -const void * RTTI_ExtraBiped = (void *)0x01EAA848; -const void * RTTI_ExtraLight = (void *)0x01EA9A38; -const void * RTTI_ExtraLeveledCreature = (void *)0x01EAA870; -const void * RTTI_ExtraAction = (void *)0x01EAA8A0; -const void * RTTI_ExtraShouldWear = (void *)0x01EAA8C8; -const void * RTTI_ExtraContainerChanges = (void *)0x01EAA8F0; -const void * RTTI_ExtraPackage = (void *)0x01EAA920; -const void * RTTI_ExtraPlayerCrimeList = (void *)0x01EAA948; -const void * RTTI_ExtraRunOncePacks = (void *)0x01EAA978; -const void * RTTI_ExtraGhost = (void *)0x01EAA9A0; -const void * RTTI_ExtraSayTopicInfoOnceADay = (void *)0x01EAA9C8; -const void * RTTI_ExtraPatrolRefInUseData = (void *)0x01EAA9F8; -const void * RTTI_ExtraFollowerSwimBreadcrumbs = (void *)0x01EAAA28; -const void * RTTI_ExtraInfoGeneralTopic = (void *)0x01EAAA60; -const void * RTTI_ExtraSayToTopicInfo = (void *)0x01EAAA90; -const void * RTTI_ExtraSoul = (void *)0x01EAAAC0; -const void * RTTI_ExtraResourcesPreload = (void *)0x01EAAAE0; -const void * RTTI_ExtraPortal = (void *)0x01EAAB10; -const void * RTTI_ExtraOcclusionShape = (void *)0x01EAAB38; -const void * RTTI_ExtraEditorRef3DData = (void *)0x01EAAB68; -const void * RTTI_ExtraEditorRefMoveData = (void *)0x01EAAB98; -const void * RTTI_ExtraAnimationSequencer = (void *)0x01EAABC8; -const void * RTTI_ExtraCellGrassData = (void *)0x01EAABF8; -const void * RTTI_ExtraInteraction = (void *)0x01EAAC28; -const void * RTTI_ExtraGroupConstraint = (void *)0x01EAAC50; -const void * RTTI_MultiBoundMarkerData = (void *)0x01EAAC80; -const void * RTTI_INISettingCollection = (void *)0x01EAACF0; -const void * RTTI_BSStream = (void *)0x01EAAD60; -const void * RTTI_InterfacedClass = (void *)0x01EAADA0; -const void * RTTI_BSTask = (void *)0x01EA8638; -const void * RTTI_IOTask = (void *)0x01EA8658; -const void * RTTI_QueuedActor = (void *)0x01EAAF58; -const void * RTTI_QueuedCharacter = (void *)0x01EAAFD0; -const void * RTTI_QueuedHead = (void *)0x01EAAFF8; -const void * RTTI_QueuedHelmet = (void *)0x01EAB020; -const void * RTTI_AttachDistant3DTask = (void *)0x01EAB118; -const void * RTTI_QueuedModel = (void *)0x01EAAFA8; -const void * RTTI_QueuedReference = (void *)0x01EAAF80; -const void * RTTI_QueuedAnimationObject = (void *)0x01EAB148; -const void * RTTI_QueuedTempEffect = (void *)0x01EAB178; -const void * RTTI_BackgroundProcessThread = (void *)0x01EAB1A0; -const void * RTTI_QueuedTree = (void *)0x01EAB250; -const void * RTTI_QueuedPlayer = (void *)0x01EAB278; -const void * RTTI_INIPrefSettingCollection = (void *)0x01EAB2A0; -const void * RTTI_AddCellGrassTask = (void *)0x01EAB408; -const void * RTTI_ICellAttachDetachEventSource = (void *)0x01EAB430; -const void * RTTI_TES = (void *)0x01EAB538; -const void * RTTI_TES__SystemEventAdapter = (void *)0x01EAB5F0; -const void * RTTI_BSTempNodeManager = (void *)0x01EAB620; -const void * RTTI_BGSLoadFormBuffer = (void *)0x01EAB9A0; -const void * RTTI_BGSStoryManagerBranchNode = (void *)0x01EABA18; -const void * RTTI_BGSStoryManagerTreeForm = (void *)0x01EABA78; -const void * RTTI_BGSStoryManagerNodeBase = (void *)0x01EABA48; -const void * RTTI_Projectile__LaunchData = (void *)0x01EABB28; -const void * RTTI_BSModelDB__BSModelProcessor = (void *)0x01EABC20; -const void * RTTI_BGSAttackDataForm = (void *)0x01EABCF0; -const void * RTTI_BGSBipedModelList = (void *)0x01EABD18; -const void * RTTI_BGSBipedObjectForm = (void *)0x01EABD40; -const void * RTTI_BGSBlockBashData = (void *)0x01EABD70; -const void * RTTI_BGSDestructibleObjectForm = (void *)0x01EA7D80; -const void * RTTI_BGSEquipType = (void *)0x01EA7D58; -const void * RTTI_BGSIdleCollection = (void *)0x01EABF08; -const void * RTTI_BGSKeywordForm = (void *)0x01EA7C48; -const void * RTTI_BGSMenuDisplayObject = (void *)0x01EA83E8; -const void * RTTI_BGSMessageIcon = (void *)0x01EA7D08; -const void * RTTI_BGSOverridePackCollection = (void *)0x01EABF58; -const void * RTTI_PerkRankVisitor = (void *)0x01EABF88; -const void * RTTI_BGSPerkRankArray = (void *)0x01EABFB0; -const void * RTTI_BGSPickupPutdownSounds = (void *)0x01EA7DB0; -const void * RTTI_BGSSkinForm = (void *)0x01EAC018; -const void * RTTI_TESActorBaseData = (void *)0x01EAC0B0; -const void * RTTI_TESAIForm = (void *)0x01EAC090; -const void * RTTI_TESAttackDamageForm = (void *)0x01EAC0D8; -const void * RTTI_TESModelRDT = (void *)0x01EAC400; -const void * RTTI_TESBipedModelForm = (void *)0x01EAAE88; -const void * RTTI_TESContainer = (void *)0x01EAC108; -const void * RTTI_TESDescription = (void *)0x01EA8C08; -const void * RTTI_TESEnchantableForm = (void *)0x01EA84C8; -const void * RTTI_IFormFactory__IFactoryVisitor = (void *)0x01EAC428; -const void * RTTI_TESForm = (void *)0x01EA7B50; -const void * RTTI_BSStorage = (void *)0x01EAC490; -const void * RTTI_BSMemStorage = (void *)0x01EAC4B0; -const void * RTTI_BSScript__IHandleReaderWriter = (void *)0x01EAC4D8; -const void * RTTI_SkyrimScript__BaseHandleReaderWriter = (void *)0x01EAC510; -const void * RTTI_SkyrimScript__DataFileHandleReaderWriter = (void *)0x01EAC550; -const void * RTTI_BSVMLoadTask = (void *)0x01EAC600; -const void * RTTI_TESHealthForm = (void *)0x01EAC130; -const void * RTTI_TESIcon = (void *)0x01EA7CC0; -const void * RTTI_TESImageSpaceModifiableForm = (void *)0x01EAC248; -const void * RTTI_TESLeveledList = (void *)0x01EAC158; -const void * RTTI_TESModel = (void *)0x01EA7CA0; -const void * RTTI_TESModelLODList = (void *)0x01EAC2C0; -const void * RTTI_TESModelTextureSwap = (void *)0x01EA7C70; -const void * RTTI_TESProduceForm = (void *)0x01EAC180; -const void * RTTI_TESQualityForm = (void *)0x01EAC1A8; -const void * RTTI_TESRaceForm = (void *)0x01EAC1D0; -const void * RTTI_TESReactionForm = (void *)0x01EAC220; -const void * RTTI_TESSpellList = (void *)0x01EAC1F8; -const void * RTTI_TESTexture = (void *)0x01EA7CE0; -const void * RTTI_TESValueForm = (void *)0x01EA8610; -const void * RTTI_TESWeightForm = (void *)0x01EA7D30; -const void * RTTI_ActionInput = (void *)0x01EAC788; -const void * RTTI_BGSAnimSoundStateManager = (void *)0x01EAC7B0; -const void * RTTI_BSAttachTechniques__BSAttachTechnique = (void *)0x01EACA08; -const void * RTTI_BGSAttachTechniquesUtil__ProcessTechniquesFunctor = (void *)0x01EACA50; -const void * RTTI_BGSAttachTechniquesUtil__AttachTechniquesFunctor = (void *)0x01EACAA0; -const void * RTTI_BGSAttachTechniquesUtil__DetachTechniquesFunctor = (void *)0x01EACAF0; -const void * RTTI_BGSParticleArrayAttach = (void *)0x01EACB38; -const void * RTTI_BGSParticleArrayAttach__EmitterPolicy = (void *)0x01EACB68; -const void * RTTI_BGSParticleArrayAttach__CollectEmitterPolicy = (void *)0x01EACBB0; -const void * RTTI_BGSParticleArrayAttach__ClearEmitterPolicy = (void *)0x01EACC00; -const void * RTTI_BGSHavokGeometryAttach = (void *)0x01EACC40; -const void * RTTI_BGSHavokGeometryAttach__ActionPolicy = (void *)0x01EACC70; -const void * RTTI_BGSHavokGeometryAttach__AttachPolicy = (void *)0x01EACCB0; -const void * RTTI_BGSHavokGeometryAttach__DetachPolicy = (void *)0x01EACCF0; -const void * RTTI_BGSNamedNodeAttach = (void *)0x01EACD30; -const void * RTTI_BGSNamedNodeAttach__ActionPolicy = (void *)0x01EACD60; -const void * RTTI_BGSNamedNodeAttach__AttachPolicy = (void *)0x01EACD98; -const void * RTTI_BGSNamedNodeAttach__DetachPolicy = (void *)0x01EACDD0; -const void * RTTI_BGSMultiTechniqueAttach = (void *)0x01EACE08; -const void * RTTI_BGSMultiTechniqueAttach__ActionPolicy = (void *)0x01EACE38; -const void * RTTI_BGSMultiTechniqueAttach__AttachPolicy = (void *)0x01EACE78; -const void * RTTI_BGSMultiTechniqueAttach__DetachPolicy = (void *)0x01EACEB8; -const void * RTTI_hkpRayHitCollector = (void *)0x01EACEF8; -const void * RTTI_hkpAllRayHitTempCollector = (void *)0x01EACF28; -const void * RTTI_BGSDecalNode = (void *)0x01EACF58; -const void * RTTI_QueuedPromoteReferencesTask = (void *)0x01EACF80; -const void * RTTI_NiProperty = (void *)0x01EACFB8; -const void * RTTI_NiAlphaProperty = (void *)0x01EACFE0; -const void * RTTI_BSResource__Location = (void *)0x01EAD008; -const void * RTTI_BSResource__LooseFileLocation = (void *)0x01EAD098; -const void * RTTI_BGSQueuedGrassModelHandles = (void *)0x01EAD0D0; -const void * RTTI_NiRefObject = (void *)0x01EAB310; -const void * RTTI_BGSPrimitive = (void *)0x01EAD108; -const void * RTTI_BSPortal = (void *)0x01EAD158; -const void * RTTI_BGSPrimitiveLine = (void *)0x01EAD1A0; -const void * RTTI_BGSPrimitivePlane = (void *)0x01EAD1F0; -const void * RTTI_BGSPrimitiveBox = (void *)0x01EAD1C8; -const void * RTTI_BGSPrimitiveSphere = (void *)0x01EAD218; -const void * RTTI_BSMultiBoundAABB = (void *)0x01EAD248; -const void * RTTI_BSMultiBoundOBB = (void *)0x01EAD298; -const void * RTTI_BSMultiBoundSphere = (void *)0x01EAD2C0; -const void * RTTI_BSShaderProperty__ForEachVisitor = (void *)0x01EAD2F0; -const void * RTTI_BGSSceneInfo = (void *)0x01EAD3C8; -const void * RTTI_BGSSceneInfo__TextureUse = (void *)0x01EAD3F0; -const void * RTTI_BGSTextureUseMap__TextureUse = (void *)0x01EAD4F8; -const void * RTTI_BSAnimationGraphChannel = (void *)0x01EAD530; -const void * RTTI_BSAnimGroupSequence = (void *)0x01EAD600; -const void * RTTI_BSAnimNoteReceiver = (void *)0x01EAD660; -const void * RTTI_IBSAnimNoteReceiver = (void *)0x01EAD690; -const void * RTTI_GridArray = (void *)0x01EAD758; -const void * RTTI_GridCellArray = (void *)0x01EAD778; -const void * RTTI_TESActionData = (void *)0x01EAD7A0; -const void * RTTI_InventoryUtils__ItemFilter = (void *)0x01EAD818; -const void * RTTI_InventoryChanges__IItemChangeVisitor = (void *)0x01EAD848; -const void * RTTI_BGSActionData = (void *)0x01EAD7C8; -const void * RTTI_Inventory__StatInventoryVisitor = (void *)0x01EAD888; -const void * RTTI_FindByEffectSettingFunctor = (void *)0x01EAD980; -const void * RTTI_BSExternalAudioIO__ExternalIOInterface = (void *)0x01EADB28; -const void * RTTI_LipSynchAnimDB__LipAudioInterface = (void *)0x01EADB68; -const void * RTTI_TESCameraState = (void *)0x01EAE0D0; -const void * RTTI_LocalMapCamera = (void *)0x01EAE0F8; -const void * RTTI_LocalMapCamera__DefaultState = (void *)0x01EAE140; -const void * RTTI_BSSplatterExtraData = (void *)0x01EAE1A0; -const void * RTTI_TESRegion = (void *)0x01EAE268; -const void * RTTI_TESRegionData = (void *)0x01EAE210; -const void * RTTI_TESRegionDataGrass = (void *)0x01EAE288; -const void * RTTI_TESRegionDataLandscape = (void *)0x01EAE2B8; -const void * RTTI_TESRegionDataManager = (void *)0x01EAE2E8; -const void * RTTI_TESRegionDataMap = (void *)0x01EAE318; -const void * RTTI_TESRegionDataObjects = (void *)0x01EAE340; -const void * RTTI_TESRegionDataSound = (void *)0x01EAE370; -const void * RTTI_TESRegionDataWeather = (void *)0x01EAE238; -const void * RTTI_TESRegionObjectBase = (void *)0x01EAE3A0; -const void * RTTI_TESRegionGrassObject = (void *)0x01EAE3D0; -const void * RTTI_TESRegionGrassObjectList = (void *)0x01EAE400; -const void * RTTI_TESRegionList = (void *)0x01EAE470; -const void * RTTI_TESRegionNoiseFunction = (void *)0x01EAE4D0; -const void * RTTI_TESRegionObject = (void *)0x01EAE500; -const void * RTTI_TESRegionObjectList = (void *)0x01EAE550; -const void * RTTI_BGSAddonNode = (void *)0x01EAB7D0; -const void * RTTI_BGSAddonNodeSoundHandleExtra = (void *)0x01EAE658; -const void * RTTI_BGSApparatus = (void *)0x01EAE728; -const void * RTTI_BGSArtObject = (void *)0x01EA7EB0; -const void * RTTI_BGSArtObjectCloneTask = (void *)0x01EAE7E8; -const void * RTTI_BGSConstructibleObject = (void *)0x01EAE940; -const void * RTTI_InventoryUtils__QuestItemFilter = (void *)0x01EAE970; -const void * RTTI_BGSDebris = (void *)0x01EABD98; -const void * RTTI_BGSPreloadable = (void *)0x01EAEAE8; -const void * RTTI_BGSExplosion = (void *)0x01EA7F00; -const void * RTTI_BGSHazard = (void *)0x01EAEC40; -const void * RTTI_BGSLensFlare = (void *)0x01EAECF8; -const void * RTTI_BSLensFlareSpriteRenderData = (void *)0x01EAED50; -const void * RTTI_BGSLensFlareSprite = (void *)0x01EAED88; -const void * RTTI_BGSVolumetricLighting = (void *)0x01EAEE70; -const void * RTTI_BGSMovableStatic = (void *)0x01EAEF88; -const void * RTTI_BGSOutfit = (void *)0x01EAF040; -const void * RTTI_BGSProjectile = (void *)0x01EA7F28; -const void * RTTI_BGSStaticCollection = (void *)0x01EAF1C8; -const void * RTTI_BGSTalkingActivator = (void *)0x01EAF2D8; -const void * RTTI_TESAmmo = (void *)0x01EAA468; -const void * RTTI_TESCombatStyle = (void *)0x01EAA548; -const void * RTTI_TESEffectShader = (void *)0x01EA7ED8; -const void * RTTI_BSParticleShaderGeometry = (void *)0x01EAF598; -const void * RTTI_TESFlora = (void *)0x01EAF680; -const void * RTTI_TESFurniture = (void *)0x01EAF738; -const void * RTTI_TESGrass = (void *)0x01EAF7F0; -const void * RTTI_TESKey = (void *)0x01EAA328; -const void * RTTI_TESLevCharacter = (void *)0x01EAF948; -const void * RTTI_TESLevItem = (void *)0x01EAC2E8; -const void * RTTI_TESLevSpell = (void *)0x01EAC740; -const void * RTTI_TESObjectLIGH = (void *)0x01EA83C0; -const void * RTTI_TESBoundObject = (void *)0x01EA7BD8; -const void * RTTI_TESObject = (void *)0x01EA7C00; -const void * RTTI_TESBoundAnimObject = (void *)0x01EAF308; -const void * RTTI_TESObjectACTI = (void *)0x01EAB860; -const void * RTTI_BGSOpenCloseForm = (void *)0x01EAF338; -const void * RTTI_TESObjectANIO = (void *)0x01EAFC68; -const void * RTTI_TESObjectARMA = (void *)0x01EAFD28; -const void * RTTI_TESObjectARMO = (void *)0x01EAC040; -const void * RTTI_TESObjectBOOK = (void *)0x01EAFE88; -const void * RTTI_TESObjectCONT = (void *)0x01EAFF78; -const void * RTTI_TESObjectDOOR = (void *)0x01EAB900; -const void * RTTI_IFadeDoneCallback = (void *)0x01EB0038; -const void * RTTI_TESObjectMISC = (void *)0x01EAB8D8; -const void * RTTI_TESObjectSTAT = (void *)0x01EAB8B0; -const void * RTTI_TESObjectTREE = (void *)0x01EB02B8; -const void * RTTI_TESObjectWEAP = (void *)0x01EAB818; -const void * RTTI_TESSoulGem = (void *)0x01EB0410; -const void * RTTI_BGSEncounterZone = (void *)0x01EAA440; -const void * RTTI_QueuedPromoteLargeReferencesTask = (void *)0x01EB0510; -const void * RTTI_BGSLightingTemplate = (void *)0x01EB05F8; -const void * RTTI_BGSLocation = (void *)0x01EB04E8; -const void * RTTI_QueuedPromoteLocationReferencesTask = (void *)0x01EB06C0; -const void * RTTI_BGSLocationRefType = (void *)0x01EAA3C0; -const void * RTTI_BGSReferenceEffect = (void *)0x01EA8390; -const void * RTTI_BGSShaderParticleGeometryData = (void *)0x01EB0918; -const void * RTTI_BSParticleShaderEmitter = (void *)0x01EB0950; -const void * RTTI_BSParticleShaderCubeEmitter = (void *)0x01EB0980; -const void * RTTI_BSParticleShaderSnowEmitter = (void *)0x01EB09B8; -const void * RTTI_BSParticleShaderRainEmitter = (void *)0x01EB09F0; -const void * RTTI_CellLoaderTask = (void *)0x01EB0A28; -const void * RTTI_ImageSpaceModifierInstanceForm = (void *)0x01EB0A50; -const void * RTTI_ImageSpaceModifierInstance = (void *)0x01EB0A88; -const void * RTTI_ImageSpaceModifierInstanceTemp = (void *)0x01EB0AC0; -const void * RTTI_ImageSpaceModifierInstanceDOF = (void *)0x01EB0AF8; -const void * RTTI_ImageSpaceModifierInstanceRB = (void *)0x01EB0B30; -const void * RTTI_TESClimate = (void *)0x01EB0C28; -const void * RTTI_TESImageSpace = (void *)0x01EAA348; -const void * RTTI_NiFloatData = (void *)0x01EB0DA0; -const void * RTTI_TESImageSpaceModifier = (void *)0x01EA8340; -const void * RTTI_NiColorData = (void *)0x01EB0DC8; -const void * RTTI_hkBaseObject = (void *)0x01EB0E68; -const void * RTTI_hkReferencedObject = (void *)0x01EB0E38; -const void * RTTI_TESChildCell = (void *)0x01EB0E90; -const void * RTTI_TESObjectLAND = (void *)0x01EB0EB8; -const void * RTTI_hkpMoppCode = (void *)0x01EB0EE0; -const void * RTTI_TESLandTexture = (void *)0x01EAE528; -const void * RTTI_hkpWorldCinfo = (void *)0x01EB1088; -const void * RTTI_hkpEntityListener = (void *)0x01EB10B0; -const void * RTTI_CheckWithinMultiBoundTask = (void *)0x01EB1100; -const void * RTTI_ExtraProcessMiddleLow = (void *)0x01EB1130; -const void * RTTI_TESObjectCELL = (void *)0x01EAA300; -const void * RTTI_TESObjectCELL__IDecalRefFunctor = (void *)0x01EB1650; -const void * RTTI_TESWindListener = (void *)0x01EB1800; -const void * RTTI_bhkSerializable = (void *)0x01EB1AD8; -const void * RTTI_hkpShape = (void *)0x01EB1B28; -const void * RTTI_bhkShape = (void *)0x01EB1B48; -const void * RTTI_BSHandleRefObject = (void *)0x01EB1B68; -const void * RTTI_TESObjectREFRDef__ILinkedReferenceFunctor = (void *)0x01EB1B90; -const void * RTTI_BGSWaterCollisionManager__bhkPlaceableWater = (void *)0x01EB1C20; -const void * RTTI_BGSWaterCollisionManager__bhkWaterfall = (void *)0x01EB1CD8; -const void * RTTI_hkpPhantomCallbackShape = (void *)0x01EB1C68; -const void * RTTI_bhkEntity = (void *)0x01EB1D18; -const void * RTTI_bhkPhantom = (void *)0x01EB1BF8; -const void * RTTI_bhkAabbPhantom = (void *)0x01EB1BD0; -const void * RTTI_BGSWaterCollisionManager__BGSWaterUpdateI = (void *)0x01EB1C98; -const void * RTTI_bhkRigidBody = (void *)0x01EAEAC0; -const void * RTTI_TESObjectREFR = (void *)0x01EAA418; -const void * RTTI_bhkSimpleShapePhantom = (void *)0x01EB1DB0; -const void * RTTI_bhkCollisionObject = (void *)0x01EB1E08; -const void * RTTI_bhkAcousticSpacePhantomCallbackShape = (void *)0x01EB1EA0; -const void * RTTI_bhkSphereRepShape = (void *)0x01EB1EE0; -const void * RTTI_bhkConvexShape = (void *)0x01EB1F08; -const void * RTTI_bhkPCollisionObject = (void *)0x01EB1F30; -const void * RTTI_bhkShapePhantom = (void *)0x01EB1DE0; -const void * RTTI_bhkSphereShape = (void *)0x01EB1F60; -const void * RTTI_ReferenceEffectController = (void *)0x01EB1F88; -const void * RTTI_OwnedController = (void *)0x01EB1FB8; -const void * RTTI_OwnedCameraEffectController = (void *)0x01EB1FE0; -const void * RTTI_bhkBoxShape = (void *)0x01EB2018; -const void * RTTI_IAnimationStreamWrite = (void *)0x01EB21F8; -const void * RTTI_IAnimationStreamRead = (void *)0x01EB2228; -const void * RTTI_AnimationStreamLoadGame = (void *)0x01EB2258; -const void * RTTI_AnimationStreamSaveGame = (void *)0x01EB2288; -const void * RTTI_REFREventCallbacks__IEventCallback = (void *)0x01EB22B8; -const void * RTTI_REFREventCallbacks__IEventCallbackFactory = (void *)0x01EB22F0; -const void * RTTI_ExtraUsedMarkers = (void *)0x01EB2330; -const void * RTTI_ExtraReservedMarkers = (void *)0x01EB2358; -const void * RTTI_TESObjectREFRSync__REFRSyncController = (void *)0x01EB2450; -const void * RTTI_TESWaterForm = (void *)0x01EAA398; -const void * RTTI_TESWeather = (void *)0x01EB0C00; -const void * RTTI_TESTexture1024 = (void *)0x01EB2610; -const void * RTTI_TESWorldSpace = (void *)0x01EAA2D8; -const void * RTTI_BGSAcousticSpace = (void *)0x01EAA370; -const void * RTTI_NiFormArray = (void *)0x01EB28C8; -const void * RTTI_BGSCameraPath = (void *)0x01EB2878; -const void * RTTI_BGSCameraShot = (void *)0x01EB28A0; -const void * RTTI_BGSCollisionLayer = (void *)0x01EAF0F8; -const void * RTTI_BGSColorForm = (void *)0x01EB2C18; -const void * RTTI_BGSDefaultObjectManager = (void *)0x01EB2C40; -const void * RTTI_BGSFootstep = (void *)0x01EB2D50; -const void * RTTI_BGSFootstepSet = (void *)0x01EB2E28; -const void * RTTI_BGSImpactData = (void *)0x01EB2EE8; -const void * RTTI_BGSImpactDataSet = (void *)0x01EA7E88; -const void * RTTI_BGSListForm = (void *)0x01EA84F8; -const void * RTTI_BSMaterialObject = (void *)0x01EB31E8; -const void * RTTI_BGSMaterialObject = (void *)0x01EB3210; -const void * RTTI_BGSMaterialType = (void *)0x01EB2558; -const void * RTTI_BGSMenuIcon = (void *)0x01EB3380; -const void * RTTI_BGSMessage = (void *)0x01EAA600; -const void * RTTI_BGSMusicPaletteTrack = (void *)0x01EB3618; -const void * RTTI_BGSMusicSilenceTrack = (void *)0x01EB3670; -const void * RTTI_BGSMusicSingleTrack = (void *)0x01EB3998; -const void * RTTI_BSIMusicTrack = (void *)0x01EB35F0; -const void * RTTI_BGSMusicTrack = (void *)0x01EB3648; -const void * RTTI_BGSMusicTrackFormWrapper = (void *)0x01EB3A80; -const void * RTTI_BGSMusicType = (void *)0x01EAA3F0; -const void * RTTI_BSIMusicType = (void *)0x01EB3B48; -const void * RTTI_BSIReverbType = (void *)0x01EB3C18; -const void * RTTI_BGSReverbParameters = (void *)0x01EB27F8; -const void * RTTI_BSISoundCategory = (void *)0x01EB3D10; -const void * RTTI_BGSSoundCategory = (void *)0x01EB3CE8; -const void * RTTI_BGSSoundDescriptorForm = (void *)0x01EB3DF0; -const void * RTTI_BSISoundDescriptor = (void *)0x01EB3E20; -const void * RTTI_BSISoundOutputModel = (void *)0x01EB3EF8; -const void * RTTI_BGSSoundOutput = (void *)0x01EB3F28; -const void * RTTI_BSISoundOutputModel__BSIAttenuationCharacteristics = (void *)0x01EB3F50; -const void * RTTI_BGSSoundOutput__DynamicAttenuationCharacteristics = (void *)0x01EB3FA0; -const void * RTTI_BSISoundDescriptor__BSIPlaybackCharacteristics = (void *)0x01EB4220; -const void * RTTI_BGSSoundDescriptor = (void *)0x01EB4268; -const void * RTTI_BGSStandardSoundDef = (void *)0x01EB4298; -const void * RTTI_BGSStandardSoundDef__SoundPlaybackCharacteristics = (void *)0x01EB42D0; -const void * RTTI_BGSTextureSet = (void *)0x01EAC688; -const void * RTTI_BSTextureSet = (void *)0x01EB43B0; -const void * RTTI_BSShaderTextureSet = (void *)0x01EB43D8; -const void * RTTI_IVisitProcedures = (void *)0x01EB4408; -const void * RTTI_MiscStatManager__IMiscStatVisitor = (void *)0x01EB4430; -const void * RTTI_MiscStatManager__FindStatByCRC = (void *)0x01EB4468; -const void * RTTI_BSScript__IForEachScriptObjectFunctor = (void *)0x01EB44A0; -const void * RTTI_TESGlobal = (void *)0x01EA8CC0; -const void * RTTI_TESLoadScreen = (void *)0x01EB4658; -const void * RTTI_Script = (void *)0x01EB4710; -const void * RTTI_BSAnimGraphVisit__BShkbVisitor = (void *)0x01EB47B0; -const void * RTTI_MagicTarget__ForEachActiveEffectVisitor = (void *)0x01EB4A48; -const void * RTTI_TESObjectREFRDef__IAliasFunctor = (void *)0x01EB4A88; -const void * RTTI_BSScript__IFunctionArguments = (void *)0x01EB4B40; -const void * RTTI_BSScript__ZeroFunctionArguments = (void *)0x01EB4B78; -const void * RTTI_MobIterOperator = (void *)0x01EB4BB0; -const void * RTTI_TESShout = (void *)0x01EAC768; -const void * RTTI_TESSound = (void *)0x01EB4F00; -const void * RTTI_TESWordOfPower = (void *)0x01EB4FC8; -const void * RTTI_BGSAction = (void *)0x01EB5080; -const void * RTTI_BGSAssociationType = (void *)0x01EB5148; -const void * RTTI_TESModelPSA = (void *)0x01EB5178; -const void * RTTI_BGSBodyPartData = (void *)0x01EB5270; -const void * RTTI_BGSDialogueBranch = (void *)0x01EAA4F8; -const void * RTTI_PerkEntryVisitor = (void *)0x01EB53F8; -const void * RTTI_BGSEntryPointFunctionData = (void *)0x01EB5460; -const void * RTTI_BGSEntryPointFunctionDataOneValue = (void *)0x01EB5490; -const void * RTTI_BGSEntryPointFunctionDataTwoValue = (void *)0x01EB54C8; -const void * RTTI_BGSEntryPointFunctionDataLeveledList = (void *)0x01EB5500; -const void * RTTI_BGSEntryPointFunctionDataSpellItem = (void *)0x01EB5540; -const void * RTTI_BGSEntryPointFunctionDataBooleanGraphVariable = (void *)0x01EB5580; -const void * RTTI_BGSEntryPointFunctionDataText = (void *)0x01EB55C8; -const void * RTTI_BGSEntryPointFunctionDataActivateChoice = (void *)0x01EB5600; -const void * RTTI_BGSEquipSlot = (void *)0x01EB56D8; -const void * RTTI_BGSHeadPart = (void *)0x01EB5790; -const void * RTTI_TESModelTri = (void *)0x01EB57B8; -const void * RTTI_BGSIdleMarker = (void *)0x01EB5878; -const void * RTTI_BGSKeyword = (void *)0x01EAA5D8; -const void * RTTI_BGSBaseAlias = (void *)0x01EB5930; -const void * RTTI_BGSLocAlias = (void *)0x01EB5958; -const void * RTTI_BGSMovementType = (void *)0x01EB5A28; -const void * RTTI_BGSNote = (void *)0x01EB4730; -const void * RTTI_BGSPerk = (void *)0x01EA8370; -const void * RTTI_BGSPerkEntry = (void *)0x01EB5B70; -const void * RTTI_BGSQuestPerkEntry = (void *)0x01EB5B98; -const void * RTTI_BGSAbilityPerkEntry = (void *)0x01EB5BC0; -const void * RTTI_BGSEntryPointPerkEntry = (void *)0x01EB5BF0; -const void * RTTI_BGSRagdoll = (void *)0x01EB5248; -const void * RTTI_BGSRefAlias = (void *)0x01EB5CB0; -const void * RTTI_BGSRelationship = (void *)0x01EB5D88; -const void * RTTI_BGSScene = (void *)0x01EAA598; -const void * RTTI_BGSSceneAction = (void *)0x01EB5EA0; -const void * RTTI_BGSSceneActionDialogue = (void *)0x01EB5EC8; -const void * RTTI_BGSSceneActionPackage = (void *)0x01EB5EF8; -const void * RTTI_BGSSceneActionTimer = (void *)0x01EB5FE8; -const void * RTTI_BGSVoiceType = (void *)0x01EAB888; -const void * RTTI_Reset3DMobIterator = (void *)0x01EB6178; -const void * RTTI_TESAnimGroup = (void *)0x01EB61A8; -const void * RTTI_TESClass = (void *)0x01EB6260; -const void * RTTI_TESEyes = (void *)0x01EAB840; -const void * RTTI_TESFaction = (void *)0x01EAA520; -const void * RTTI_TESIdleForm = (void *)0x01EABF30; -const void * RTTI_ActorValueOwner = (void *)0x01EB6470; -const void * RTTI_TESActorBase = (void *)0x01EAA570; -const void * RTTI_TESNPC = (void *)0x01EAB928; -const void * RTTI_BSFaceGenModelExtraData = (void *)0x01EB64D8; -const void * RTTI_TESQuest = (void *)0x01EAA5B8; -const void * RTTI_QueuedPromoteQuestTask = (void *)0x01EB6610; -const void * RTTI_TESRace = (void *)0x01EAC720; -const void * RTTI_BGSTextureModel = (void *)0x01EB6790; -const void * RTTI_BGSBehaviorGraphModel = (void *)0x01EB67B8; -const void * RTTI_AttackAnimationArrayMap = (void *)0x01EB67E8; -const void * RTTI_TESTopic = (void *)0x01EAA4D8; -const void * RTTI_TESTopicInfo = (void *)0x01EAA4B0; -const void * RTTI_bhkEntityListener = (void *)0x01EB10D8; -const void * RTTI_BGSAcousticSpaceListener = (void *)0x01EB71C8; -const void * RTTI_TargetEntry = (void *)0x01EB7290; -const void * RTTI_ZoneEntry = (void *)0x01EB71F8; -const void * RTTI_BGSZoneTargetListener = (void *)0x01EB72B8; -const void * RTTI_TrapTargetEntry = (void *)0x01EB72E8; -const void * RTTI_bhkAction = (void *)0x01EB7330; -const void * RTTI_bhkCartTether = (void *)0x01EB7350; -const void * RTTI_hkConstraintCinfo = (void *)0x01EB7378; -const void * RTTI_bhkConstraint = (void *)0x01EB73D0; -const void * RTTI_hkPrismaticConstraintCinfo = (void *)0x01EB73F8; -const void * RTTI_bhkPrismaticConstraint = (void *)0x01EB7430; -const void * RTTI_bhkUnaryAction = (void *)0x01EB7488; -const void * RTTI_CellMopp = (void *)0x01EB7590; -const void * RTTI_BSTasklet = (void *)0x01EB75B0; -const void * RTTI_BSTaskletData = (void *)0x01EB75D0; -const void * RTTI_BSWin32TaskletData = (void *)0x01EB75F8; -const void * RTTI_bhkBvTreeShape = (void *)0x01EB7628; -const void * RTTI_bhkTriSampledHeightFieldBvTreeShape = (void *)0x01EB7650; -const void * RTTI_CellMopp__HeightFieldWeldingTasklet = (void *)0x01EB7758; -const void * RTTI_hkpContactListener = (void *)0x01EB7798; -const void * RTTI_bhkContactListener = (void *)0x01EB77C8; -const void * RTTI_bhkBackfaceContactListener = (void *)0x01EB77F8; -const void * RTTI_FOCollisionListener = (void *)0x01EB7830; -const void * RTTI_hkpIslandActivationListener = (void *)0x01EB7A20; -const void * RTTI_FOIslandActivationListener = (void *)0x01EB7A58; -const void * RTTI_hkStreamWriter = (void *)0x01EB7A90; -const void * RTTI_hkError = (void *)0x01EB7AB8; -const void * RTTI_hkStreamReader = (void *)0x01EB7B08; -const void * RTTI_hkFileSystem = (void *)0x01EB7B30; -const void * RTTI_HavokStreambufReader = (void *)0x01EB7B90; -const void * RTTI_HavokStreambufWriter = (void *)0x01EB7BC0; -const void * RTTI_HavokFileStreambufReader = (void *)0x01EB7BF0; -const void * RTTI_HavokFileStreambufWriter = (void *)0x01EB7C20; -const void * RTTI_hkNativeFileSystem = (void *)0x01EB7C50; -const void * RTTI_HavokStreambufFactory = (void *)0x01EB7C80; -const void * RTTI_HavokError = (void *)0x01EB7CB0; -const void * RTTI_hkpCdPointCollector = (void *)0x01EB7CD8; -const void * RTTI_hkpAllCdPointCollector = (void *)0x01EB7D08; -const void * RTTI_LoadedAreaBound = (void *)0x01EB7D38; -const void * RTTI_RagdollFurnitureListener = (void *)0x01EB7D60; -const void * RTTI_hkpClosestRayHitCollector = (void *)0x01EB7DE0; -const void * RTTI_SpecificItemCollector = (void *)0x01EB7E10; -const void * RTTI_hkpPhantomListener = (void *)0x01EB7E40; -const void * RTTI_hkpCdBodyPairCollector = (void *)0x01EB7E70; -const void * RTTI_bhkTrapListener = (void *)0x01EB7EA0; -const void * RTTI_TrapEntry = (void *)0x01EB7EC8; -const void * RTTI_TriggerEntry = (void *)0x01EB7EE8; -const void * RTTI_TESTrapListener = (void *)0x01EB7FE8; -const void * RTTI_hkpAllCdBodyPairTempCollector = (void *)0x01EB8010; -const void * RTTI_hkpAllCdPointTempCollector = (void *)0x01EB8048; -const void * RTTI_FindTriangleForLocationFilter = (void *)0x01EB8080; -const void * RTTI_FindTriangleForLocationFilterCheckDeltaZ = (void *)0x01EB80B8; -const void * RTTI_Atmosphere = (void *)0x01EB80F8; -const void * RTTI_Clouds = (void *)0x01EB8140; -const void * RTTI_Moon = (void *)0x01EB8160; -const void * RTTI_BSGeometryListCullingProcess = (void *)0x01EB8180; -const void * RTTI_Precipitation = (void *)0x01EB8208; -const void * RTTI_Sky = (void *)0x01EB8230; -const void * RTTI_TESWeather__SkyStaticFunctor = (void *)0x01EB8250; -const void * RTTI_SkyEffectController = (void *)0x01EB8288; -const void * RTTI_SkyStaticFindFunctor = (void *)0x01EB82B8; -const void * RTTI_TempLoadGameBuffer = (void *)0x01EB82E8; -const void * RTTI_SkyObject = (void *)0x01EB8120; -const void * RTTI_Stars = (void *)0x01EB8318; -const void * RTTI_NiBillboardNode = (void *)0x01EB8338; -const void * RTTI_Sun = (void *)0x01EB8360; -const void * RTTI_BShkNonTransformController = (void *)0x01EB83B8; -const void * RTTI_BShkFloatController = (void *)0x01EB83F0; -const void * RTTI_BGShkPhonemeController = (void *)0x01EB8420; -const void * RTTI_BSFaceGenAnimationData = (void *)0x01EB8678; -const void * RTTI_FutBinaryFileC = (void *)0x01EB86A8; -const void * RTTI_BSResourceFaceGenBinaryFile = (void *)0x01EB86D0; -const void * RTTI_BSFaceGenKeyframe = (void *)0x01EB9190; -const void * RTTI_BSFaceGenKeyframeExclusive = (void *)0x01EB91B8; -const void * RTTI_BSFaceGenKeyframeMultiple = (void *)0x01EB91F0; -const void * RTTI_BSFaceGenDB__TRI__QueuedHandles = (void *)0x01EB9220; -const void * RTTI_BSFaceGenModel = (void *)0x01EB9328; -const void * RTTI_BSFaceGenModelMap__Entry = (void *)0x01EB9350; -const void * RTTI_BSFaceGenMorphData = (void *)0x01EB9380; -const void * RTTI_BSFaceGenMorphDataHead = (void *)0x01EB93B0; -const void * RTTI_BSFaceGenMorphDataHair = (void *)0x01EB93E0; -const void * RTTI_BSFaceGenBaseMorphExtraData = (void *)0x01EB9410; -const void * RTTI_BSFaceGenNiNode = (void *)0x01EB94A8; -const void * RTTI_BSFadeNodeCuller = (void *)0x01EB94D0; -const void * RTTI_ActorValueInfo = (void *)0x01EB9538; -const void * RTTI_BGSSkillPerkTreeNode = (void *)0x01EB9560; -const void * RTTI_IAIWorldLocation = (void *)0x01EB9590; -const void * RTTI_BGSAIWorldLocation = (void *)0x01EB95B8; -const void * RTTI_BGSAIWorldLocationRefRadius = (void *)0x01EB95E8; -const void * RTTI_BGSAIWorldLocationPointRadius = (void *)0x01EB9680; -const void * RTTI_BGSAIWorldLocationInteriorCell = (void *)0x01EB9720; -const void * RTTI_BGSAttackDataMap = (void *)0x01EB97C0; -const void * RTTI_BGSAttackData = (void *)0x01EB97E8; -const void * RTTI_IAITarget = (void *)0x01EB9878; -const void * RTTI_BGSPackageDataBool = (void *)0x01EBA668; -const void * RTTI_BGSPackageDataFloat = (void *)0x01EB9898; -const void * RTTI_BGSPackageDataInt = (void *)0x01EB9968; -const void * RTTI_BGSPackageDataRefOLD = (void *)0x01EB9A28; -const void * RTTI_BGSPackageDataLocation = (void *)0x01EB9A58; -const void * RTTI_BGSPackageDataTargetSelector = (void *)0x01EB9A88; -const void * RTTI_IPackageDataAIWorldLocationHandle = (void *)0x01EB9810; -const void * RTTI_IPackageData = (void *)0x01EBA640; -const void * RTTI_IAIWorldLocationHandle = (void *)0x01EB9848; -const void * RTTI_BGSPackageDataLocationWrapper = (void *)0x01EBAAA8; -const void * RTTI_BGSPackageDataObjectList = (void *)0x01EBAC78; -const void * RTTI_ObjectListItem = (void *)0x01EBACA8; -const void * RTTI_BGSPackageDataRef = (void *)0x01EBAD58; -const void * RTTI_BGSPackageDataTopic = (void *)0x01EBAF10; -const void * RTTI_IProcedureTreeExecState = (void *)0x01EBB0D0; -const void * RTTI_IProcedureTreeItem = (void *)0x01EBB138; -const void * RTTI_BGSProcedureDoneExecState = (void *)0x01EBB1A8; -const void * RTTI_BGSProcedureTreeConditionalItem = (void *)0x01EBB240; -const void * RTTI_BGSProcedureTreeBranch = (void *)0x01EBB278; -const void * RTTI_BGSProcedureTreeOneChildExecState = (void *)0x01EBB2A8; -const void * RTTI_BGSProcedureTreeSequence = (void *)0x01EBB2E0; -const void * RTTI_BGSProcedureTreeSequenceExecState = (void *)0x01EBB370; -const void * RTTI_BGSProcedureTreeStacked = (void *)0x01EBB420; -const void * RTTI_BGSProcedureTreeStackedExecState = (void *)0x01EBB4B0; -const void * RTTI_BGSProcedureTreeSimultaneous = (void *)0x01EBB560; -const void * RTTI_BGSProcedureTreeSimultaneousExecState = (void *)0x01EBB600; -const void * RTTI_BGSProcedureTreeRandom = (void *)0x01EBB6A8; -const void * RTTI_BGSProcedureTreeRandomExecState = (void *)0x01EBB738; -const void * RTTI_BGSProcedureGuardExecState = (void *)0x01EBB7E0; -const void * RTTI_BGSProcedureDialogueExecState = (void *)0x01EBB880; -const void * RTTI_BGSProcedureEatExecState = (void *)0x01EBB920; -const void * RTTI_BGSProcedureFindExecState = (void *)0x01EBB9B0; -const void * RTTI_BGSProcedureHoldPositionExecState = (void *)0x01EBBA40; -const void * RTTI_BGSProcedureKeepAnEyeOnExecState = (void *)0x01EBBAE8; -const void * RTTI_BGSProcedureSayExecState = (void *)0x01EBBB88; -const void * RTTI_BGSProcedureWaitExecState = (void *)0x01EBBC20; -const void * RTTI_IProcedure = (void *)0x01EBFB38; -const void * RTTI_BGSProcedureBase = (void *)0x01EBFB60; -const void * RTTI_BGSProcedureDone = (void *)0x01EBFB88; -const void * RTTI_IPackageDataTypeCheck = (void *)0x01EBFDE8; -const void * RTTI_BGSProcedureAcquire = (void *)0x01EBFF20; -const void * RTTI_BGSProcedureAcquireExecState = (void *)0x01EBFFD0; -const void * RTTI_BGSProcedureActivate = (void *)0x01EC0200; -const void * RTTI_BGSProcedureActivateExecState = (void *)0x01EC02B0; -const void * RTTI_BGSProcedureDialogue = (void *)0x01EC0530; -const void * RTTI_BGSProcedureDialogueActivate = (void *)0x01EC07E0; -const void * RTTI_BGSProcedureDialogueActivateExecState = (void *)0x01EC08A8; -const void * RTTI_BGSProcedureEat = (void *)0x01EC0B58; -const void * RTTI_BGSProcedureEscort = (void *)0x01EC0E30; -const void * RTTI_BGSProcedureEscortExecState = (void *)0x01EC0EE0; -const void * RTTI_BGSProcedureFind = (void *)0x01EC1160; -const void * RTTI_BGSProcedureFlee = (void *)0x01EC1390; -const void * RTTI_BGSProcedureFleeExecState = (void *)0x01EC1438; -const void * RTTI_BGSProcedureFlightGrab = (void *)0x01EC1650; -const void * RTTI_BGSProcedureFlightGrabExecState = (void *)0x01EC1700; -const void * RTTI_IMovementParameters = (void *)0x01EC19C0; -const void * RTTI_BGSProcedureFollow = (void *)0x01EC19F0; -const void * RTTI_BGSProcedureFollowTo = (void *)0x01EC1AA0; -const void * RTTI_BGSProcedureFollowExecState = (void *)0x01EC1B50; -const void * RTTI_MovementParameters = (void *)0x01EC1BF0; -const void * RTTI_BGSProcedureForceGreet = (void *)0x01EC1F40; -const void * RTTI_BGSProcedureGuard = (void *)0x01EC2188; -const void * RTTI_BGSProcedureHoldPosition = (void *)0x01EC23C0; -const void * RTTI_BGSProcedureHover = (void *)0x01EC2608; -const void * RTTI_BGSProcedureHoverExecState = (void *)0x01EC26A8; -const void * RTTI_BGSProcedureKeepAnEyeOn = (void *)0x01EC28D0; -const void * RTTI_BGSProcedureLock = (void *)0x01EC2B18; -const void * RTTI_BGSProcedureUnlock = (void *)0x01EC2BB8; -const void * RTTI_BGSProcedureLockUnlockExecState = (void *)0x01EC2C70; -const void * RTTI_BGSProcedureOrbit = (void *)0x01EC3030; -const void * RTTI_BGSProcedureOrbitExecState = (void *)0x01EC30D8; -const void * RTTI_BGSProcedurePatrol = (void *)0x01EC3300; -const void * RTTI_BGSProcedurePatrolExecState = (void *)0x01EC33B0; -const void * RTTI_BGSProcedurePursue = (void *)0x01EC35E0; -const void * RTTI_BGSProcedureSandboxExecState = (void *)0x01EC3820; -const void * RTTI_BGSProcedureSandbox = (void *)0x01EC38C0; -const void * RTTI_BGSProcedureSay = (void *)0x01EC3B00; -const void * RTTI_BGSProcedureShout = (void *)0x01EC3D30; -const void * RTTI_BGSProcedureShoutExecState = (void *)0x01EC3DD8; -const void * RTTI_BGSProcedureSit = (void *)0x01EC4040; -const void * RTTI_BGSProcedureSleep = (void *)0x01EC40E8; -const void * RTTI_BGSProcedureSitSleepExecState = (void *)0x01EC4188; -const void * RTTI_BGSProcedureTravel = (void *)0x01EC4530; -const void * RTTI_BGSProcedureTravelExecState = (void *)0x01EC45E0; -const void * RTTI_BGSProcedureTreeProcedure = (void *)0x01EC4810; -const void * RTTI_BGSProcedureUseIdleMarker = (void *)0x01EC48A8; -const void * RTTI_BGSProcedureUseIdleMarkerExecState = (void *)0x01EC4960; -const void * RTTI_BGSProcedureUseMagic = (void *)0x01EC4BA8; -const void * RTTI_BGSProcedureUseMagicExecState = (void *)0x01EC4C60; -const void * RTTI_BGSProcedureUseWeapon = (void *)0x01EC4E90; -const void * RTTI_BGSProcedureUseWeaponExecState = (void *)0x01EC4F40; -const void * RTTI_BGSProcedureWait = (void *)0x01EC5180; -const void * RTTI_BGSProcedureWander = (void *)0x01EC53B0; -const void * RTTI_BGSProcedureWanderExecState = (void *)0x01EC5460; -const void * RTTI_BGSVisitProceduresInitActorLocation = (void *)0x01EC5690; -const void * RTTI_BGSVisitProceduresCheckGuardWarnTarget = (void *)0x01EC56D0; -const void * RTTI_PackageCreator = (void *)0x01EC5710; -const void * RTTI_TESPackage = (void *)0x01EAA488; -const void * RTTI_DialoguePackage = (void *)0x01EC5738; -const void * RTTI_TESPackageData = (void *)0x01EC5760; -const void * RTTI_TESAmbushPackageData = (void *)0x01EC5788; -const void * RTTI_TESCustomPackageData = (void *)0x01EC57B8; -const void * RTTI_IProcedureTreeVisitor = (void *)0x01EC57E8; -const void * RTTI_CustomUtils__HasForceGreetVisitor = (void *)0x01EC5818; -const void * RTTI_TESDialoguePackageData = (void *)0x01EC5850; -const void * RTTI_TESEatPackageData = (void *)0x01EC5880; -const void * RTTI_TESEscortPackageData = (void *)0x01EC58A8; -const void * RTTI_TESFollowPackageData = (void *)0x01EC58D8; -const void * RTTI_TESPatrolPackageData = (void *)0x01EC5908; -const void * RTTI_TESUseItemPackageData = (void *)0x01EC5938; -const void * RTTI_ActorPackageData = (void *)0x01EC5998; -const void * RTTI_TESUseWeaponPackageData = (void *)0x01EC5968; -const void * RTTI_UseWeaponActorPackageData = (void *)0x01EC59C0; -const void * RTTI_PackageLocation = (void *)0x01EC59F0; -const void * RTTI_ITempEffectFactory = (void *)0x01EC5A18; -const void * RTTI_BSTempEffect = (void *)0x01EC5C28; -const void * RTTI_BSTempEffectDebris = (void *)0x01EC5D18; -const void * RTTI_BSTempEffectGeometryDecal = (void *)0x01EC5D48; -const void * RTTI_BGSParticleObjectCloneTask = (void *)0x01EC5E20; -const void * RTTI_BSTempEffectParticle = (void *)0x01EC5E58; -const void * RTTI_BSTempEffectSimpleDecal = (void *)0x01EC5E88; -const void * RTTI_BSLightingShaderMaterial = (void *)0x01EC5EB8; -const void * RTTI_BSTempEffectSPG = (void *)0x01EC5F98; -const void * RTTI_BSTempEffectWeaponBlood = (void *)0x01EC5FC0; -const void * RTTI_BSTerrainEffect = (void *)0x01EC6040; -const void * RTTI_BSPSysHavokUpdateModifier__ICollisionObjectHandler = (void *)0x01EC6070; -const void * RTTI_NavMesh = (void *)0x01EC6130; -const void * RTTI_BSPathingStreamRead = (void *)0x01EC6170; -const void * RTTI_PathingStreamMasterFileRead = (void *)0x01EC61A0; -const void * RTTI_BSNavmeshInfoMap__IVisitor = (void *)0x01EC61D8; -const void * RTTI_NavMeshInfoMap = (void *)0x01EC6208; -const void * RTTI_hkpEntityActivationListener = (void *)0x01EC63B0; -const void * RTTI_NavMeshObstacleManager = (void *)0x01EC63E8; -const void * RTTI_bhkObstacleDeactivationListener = (void *)0x01EC6640; -const void * RTTI_bhkObstacleRemovalListener = (void *)0x01EC6678; -const void * RTTI_BSNavmeshReferenceObstacleArray = (void *)0x01EC66B0; -const void * RTTI_ObstacleTaskData = (void *)0x01EC66E8; -const void * RTTI_PathingCoverLocation = (void *)0x01EC6710; -const void * RTTI_BSPathingCellManager = (void *)0x01EC6768; -const void * RTTI_Pathing = (void *)0x01EC67E8; -const void * RTTI_BSPathingCell = (void *)0x01EC6E38; -const void * RTTI_PathingCell = (void *)0x01EC6E60; -const void * RTTI_BSPathingDoor = (void *)0x01EC7048; -const void * RTTI_PathingDoor = (void *)0x01EC7070; -const void * RTTI_BSPathingLockData = (void *)0x01EC7278; -const void * RTTI_PathingLockData = (void *)0x01EC72A0; -const void * RTTI_BSPathingNumericIDVisitor = (void *)0x01EC72C8; -const void * RTTI_PathingNumericIDVisitor = (void *)0x01EC72F8; -const void * RTTI_PathingRequest = (void *)0x01EC6B20; -const void * RTTI_BSPathingSpace = (void *)0x01EC7558; -const void * RTTI_PathingSpace = (void *)0x01EC7580; -const void * RTTI_TeleportDoorSearch = (void *)0x01EC75A8; -const void * RTTI_NavMeshSearchClosePoint = (void *)0x01EC7670; -const void * RTTI_NavMeshSearchFitSphere = (void *)0x01EC77B8; -const void * RTTI_NavMeshSearchFlee = (void *)0x01EC7838; -const void * RTTI_NavMeshSearchHide = (void *)0x01EC7890; -const void * RTTI_BSNavmeshSearchHideFilter = (void *)0x01EC78E0; -const void * RTTI_NavMeshSearchLOS = (void *)0x01EC7940; -const void * RTTI_NavMeshSearchMaxCost = (void *)0x01EC7968; -const void * RTTI_BSNavmeshSearchMaxCostFilters = (void *)0x01EC7998; -const void * RTTI_NavMeshSearchMultipleGoals = (void *)0x01EC79D0; -const void * RTTI_NavMeshSearchSLPoint = (void *)0x01EC7A08; -const void * RTTI_PathingRequestClosePoint = (void *)0x01EC6AF0; -const void * RTTI_IPathBuilderFactoryBase = (void *)0x01EC7C70; -const void * RTTI_PathingRequestClosestGoal = (void *)0x01EC7F78; -const void * RTTI_PathingRequestCover = (void *)0x01EC8218; -const void * RTTI_PathingRequestFlee = (void *)0x01EC8458; -const void * RTTI_PathingRequestFly = (void *)0x01EC8698; -const void * RTTI_PathingRequestFlyAction = (void *)0x01EC88E8; -const void * RTTI_PathingRequestFlyHover = (void *)0x01EC8B48; -const void * RTTI_PathingRequestFlyLand = (void *)0x01EC8D98; -const void * RTTI_PathingRequestFlyOrbit = (void *)0x01EC8FF8; -const void * RTTI_PathingRequestFlyTakeOff = (void *)0x01EC9260; -const void * RTTI_PathingRequestHide = (void *)0x01EC9498; -const void * RTTI_PathingRequestLOS = (void *)0x01EC96D8; -const void * RTTI_PathingRequestOptimalLocation = (void *)0x01EC9930; -const void * RTTI_PathingRequestRotate = (void *)0x01EC9B78; -const void * RTTI_PathingRequestSafeStraightLine = (void *)0x01EC6AB8; -const void * RTTI_PathingRequestStopMoving = (void *)0x01ECA010; -const void * RTTI_BGSQueuedTerrainUpdate = (void *)0x01ECBA38; -const void * RTTI_BGSQueuedTerrainUpgrade = (void *)0x01ECBA68; -const void * RTTI_BGSQueuedTerrainDowngrade = (void *)0x01ECBA98; -const void * RTTI_BGSQueuedTerrainInitialLoad = (void *)0x01ECBAC8; -const void * RTTI_BGSQueuedObjectUpgrade = (void *)0x01ECBB00; -const void * RTTI_BGSQueuedObjectDowngrade = (void *)0x01ECBB30; -const void * RTTI_BGSQueuedObjectInitialLoad = (void *)0x01ECBB60; -const void * RTTI_BGSWaterCollisionManager__bhkAutoWater = (void *)0x01ECC1C8; -const void * RTTI_BGSWaterCollisionManager__bshkAutoWater = (void *)0x01ECC280; -const void * RTTI_TESWaterObject = (void *)0x01ECC340; -const void * RTTI_TESWaterReflections = (void *)0x01ECC368; -const void * RTTI_TESWaterDisplacement = (void *)0x01ECC398; -const void * RTTI_TESWaterNormals = (void *)0x01ECC3C8; -const void * RTTI_BGSStoryManagerTreeVisitor = (void *)0x01ECC508; -const void * RTTI_BGSStoryManagerQuestFinder = (void *)0x01ECC540; -const void * RTTI_BGSStoryManager = (void *)0x01ECC578; -const void * RTTI_BGSStoryManagerEventNode = (void *)0x01ECC7A0; -const void * RTTI_BGSStoryManagerQuestNode = (void *)0x01ECC880; -const void * RTTI_BGSStoryTeller = (void *)0x01ECC900; -const void * RTTI_BGSLOSData = (void *)0x01ECCB28; -const void * RTTI_AnimationClipDataSingleton = (void *)0x01ECCB50; -const void * RTTI_AnimationSystemUtils__QueuedReferenceAnimationTask = (void *)0x01ECCD90; -const void * RTTI_hkaRaycastInterface = (void *)0x01ECCEA8; -const void * RTTI_BSIFootIkRaycastInterfaceDB = (void *)0x01ECCED8; -const void * RTTI_CachedRaycastData = (void *)0x01ECCF10; -const void * RTTI_BGSFootIkRaycastInterfaceDB = (void *)0x01ECCF38; -const void * RTTI_IGamebryoSequenceGeneratorHolderSingleton = (void *)0x01ECD170; -const void * RTTI_BGSGamebryoSequenceGeneratorHolderSingleton = (void *)0x01ECD1B0; -const void * RTTI_BSSynchronizedClipGenerator__hkbSynchronizedAnimationScene = (void *)0x01ECD460; -const void * RTTI_BGSSynchronizedAnimationInstance = (void *)0x01ECD4B0; -const void * RTTI_BSLimbIKModifierUtilityCastInfo = (void *)0x01ECD588; -const void * RTTI_BSLimbIKModifierUtility = (void *)0x01ECD5F0; -const void * RTTI_IAnimationGraphManagerHolder = (void *)0x01EB1D78; -const void * RTTI_IAnimationGraphManagerLoadingTask = (void *)0x01ECCDD8; -const void * RTTI_SimpleAnimationGraphManagerLoadingTask = (void *)0x01ECD848; -const void * RTTI_SimpleAnimationGraphManagerHolder = (void *)0x01ECD888; -const void * RTTI_WeaponAnimationGraphManagerHolder = (void *)0x01ECD8C0; -const void * RTTI_TailAnimationGraphManagerHolder = (void *)0x01ECD8F8; -const void * RTTI_TESCamera = (void *)0x01EAE120; -const void * RTTI_PlayerInputHandler = (void *)0x01ECDBC0; -const void * RTTI_ThirdPersonState = (void *)0x01ECDBF0; -const void * RTTI_DragonCameraState = (void *)0x01ECDC18; -const void * RTTI_CombatBehaviorTreeRanged = (void *)0x01ECDC40; -const void * RTTI_GRefCountImpl = (void *)0x01ECE5F8; -const void * RTTI_GRefCountImplCore = (void *)0x01ECE620; -const void * RTTI_GFxFunctionHandler = (void *)0x01ECE698; -const void * RTTI_MenuEventHandler = (void *)0x01ECE770; -const void * RTTI_CreationClubMenu = (void *)0x01ECE798; -const void * RTTI_MessageBoxData = (void *)0x01ECE7E0; -const void * RTTI_IMessageBoxCallback = (void *)0x01ECE830; -const void * RTTI_IUIMessageData = (void *)0x01ECE808; -const void * RTTI_CreationClub__AsyncModRequest = (void *)0x01ECE9B8; -const void * RTTI_CreationClub__CreationListRequest = (void *)0x01ECE9F0; -const void * RTTI_CreationClub__BundleChildrenRequest = (void *)0x01ECEA28; -const void * RTTI_CreationClub__CategorySearchRequest = (void *)0x01ECEA68; -const void * RTTI_CreationClub__GetCreationRequest = (void *)0x01ECEAA8; -const void * RTTI_CreationClub__GetIntRequest = (void *)0x01ECEAE0; -const void * RTTI_CreationClub__DownloadImageRequest = (void *)0x01ECEB18; -const void * RTTI_CreationClub__StringStringRequest = (void *)0x01ECEB50; -const void * RTTI_CreationClub__SavedGFxValueRequest = (void *)0x01ECEB88; -const void * RTTI_CreationClub__DownloadCreationRequest = (void *)0x01ECEBC0; -const void * RTTI_CreationClub__CreationChanged_ConfirmResetCallback = (void *)0x01ECEC00; -const void * RTTI_ModManagerMenu = (void *)0x01ECF688; -const void * RTTI_ModManager__AsyncModRequest = (void *)0x01ECF6B0; -const void * RTTI_ModManager__DownloadModRequest = (void *)0x01ECF6E8; -const void * RTTI_ModManager__CategorySearchRequest = (void *)0x01ECF720; -const void * RTTI_ModManager__GetDetailsRequest = (void *)0x01ECF758; -const void * RTTI_ModManager__GetDependencyRequest = (void *)0x01ECF790; -const void * RTTI_ModManager__DownloadImageRequest = (void *)0x01ECF7C8; -const void * RTTI_ModManager__SavedGFxValueRequest = (void *)0x01ECF800; -const void * RTTI_ModManager__GetIntRequest = (void *)0x01ECF838; -const void * RTTI_ModManager__StringStringRequest = (void *)0x01ECF868; -const void * RTTI_ModManager__ReportMod_CategoryCallback = (void *)0x01ECF8F8; -const void * RTTI_ModManager__ReportMod_ConfirmCallback = (void *)0x01ECF938; -const void * RTTI_ModManager__DeleteMod_ConfirmCallback = (void *)0x01ECFA08; -const void * RTTI_ModManager__DeleteLibraryModConfirmCallback = (void *)0x01ECFA50; -const void * RTTI_ModManager__DeleteAllModsConfirmCallback = (void *)0x01ECFA98; -const void * RTTI_ModManager__CloseModManager_ConfirmCallback = (void *)0x01ECFAE0; -const void * RTTI_ModManager__ModsChanged_ConfirmResetCallback = (void *)0x01ECFB30; -const void * RTTI_KinectMenu = (void *)0x01ECFCA8; -const void * RTTI_LoadWaitSpinner = (void *)0x01ECFD50; -const void * RTTI_AbsorbEffect = (void *)0x01ECFD78; -const void * RTTI_AccumulatingValueModifierEffect = (void *)0x01ECFDF8; -const void * RTTI_FindMaxMagnitudeVisitor = (void *)0x01ECFE30; -const void * RTTI_FinishActiveEffectVisitor = (void *)0x01ECFE60; -const void * RTTI_ActiveEffect = (void *)0x01ECFDD0; -const void * RTTI_ActiveEffectReferenceEffectController = (void *)0x01ECFE90; -const void * RTTI_ActiveEffect__ForEachHitEffectVisitor = (void *)0x01ECFED0; -const void * RTTI_ActorMagicCaster = (void *)0x01ECFFD8; -const void * RTTI_BSAttachTechniques__AttachTechniqueInput = (void *)0x01ED0000; -const void * RTTI_RefAttachTechniqueInput = (void *)0x01ED0040; -const void * RTTI_MagicItemDataCollector = (void *)0x01ED0070; -const void * RTTI_BoundItemEffect = (void *)0x01ED0178; -const void * RTTI_MagicTarget__IPostCreationModification = (void *)0x01ED01A0; -const void * RTTI_CloakEffect = (void *)0x01ED01E0; -const void * RTTI_CommandEffect = (void *)0x01ED0248; -const void * RTTI_CommandSummonedEffect = (void *)0x01ED0270; -const void * RTTI_CureEffect = (void *)0x01ED02A0; -const void * RTTI_DarknessEffect = (void *)0x01ED02C8; -const void * RTTI_DetectLifeEffect = (void *)0x01ED02F0; -const void * RTTI_DisarmEffect = (void *)0x01ED0318; -const void * RTTI_DisguiseEffect = (void *)0x01ED0390; -const void * RTTI_DisguiseEffect__DetectionChecker = (void *)0x01ED03B8; -const void * RTTI_DispelEffect = (void *)0x01ED0440; -const void * RTTI_DualValueModifierEffect = (void *)0x01ED04B8; -const void * RTTI_EtherealizationEffect = (void *)0x01ED04E8; -const void * RTTI_GrabActorEffect = (void *)0x01ED0518; -const void * RTTI_VampireLordEffect = (void *)0x01ED0540; -const void * RTTI_ConcussionEffect = (void *)0x01ED0568; -const void * RTTI_GuideEffect = (void *)0x01ED0590; -const void * RTTI_InvisibilityEffect = (void *)0x01ED05B8; -const void * RTTI_LightEffect = (void *)0x01ED05E8; -const void * RTTI_LightEffect__AttachBestLightVisitor = (void *)0x01ED0610; -const void * RTTI_LockEffect = (void *)0x01ED0690; -const void * RTTI_MagicCaster = (void *)0x01EB4788; -const void * RTTI_MagicCaster__PostCreationCallback = (void *)0x01ED06B8; -const void * RTTI_ProcessLists__GetActorsFilter = (void *)0x01ED06F0; -const void * RTTI_ActorTargetCheck = (void *)0x01ED0728; -const void * RTTI_MagicTarget__DispelFromBoundObject = (void *)0x01ED0750; -const void * RTTI_KeywordDispelFunctor = (void *)0x01ED0788; -const void * RTTI_IsSpellTargetFunctor = (void *)0x01ED07B8; -const void * RTTI_IsSpellTypeTargetFunctor = (void *)0x01ED07E8; -const void * RTTI_FindEffectKeywordOnTargetFunctor = (void *)0x01ED0818; -const void * RTTI_StartSpellHelpers__EffectGatherFunctor = (void *)0x01ED0918; -const void * RTTI_StartSpellHelpers__SpellEffectGatherFunctor = (void *)0x01ED0960; -const void * RTTI_StartSpellHelpers__DoneEffectGatherFunctor = (void *)0x01ED09B0; -const void * RTTI_FindActiveEffectByIDFunctor = (void *)0x01ED0A28; -const void * RTTI_EffectsCausingDamageFunctor = (void *)0x01ED0A60; -const void * RTTI_ModelReferenceEffect = (void *)0x01ED0C60; -const void * RTTI_NightEyeEffect = (void *)0x01ED0CB8; -const void * RTTI_ExtraMagicCaster = (void *)0x01ED0CE0; -const void * RTTI_NonActorMagicCaster = (void *)0x01ED0D08; -const void * RTTI_OpenEffect = (void *)0x01ED0D38; -const void * RTTI_ParalysisEffect = (void *)0x01ED0D60; -const void * RTTI_PeakValueModifierEffect = (void *)0x01ED0D88; -const void * RTTI_ReanimateEffect = (void *)0x01ED0DB8; -const void * RTTI_ReferenceEffect = (void *)0x01ED0C90; -const void * RTTI_WeaponEnchantmentController = (void *)0x01ED0E28; -const void * RTTI_ScriptedRefEffect = (void *)0x01ED0E88; -const void * RTTI_ScriptEffect = (void *)0x01ED0E60; -const void * RTTI_BSParticleShaderObjectEmitter = (void *)0x01ED0F00; -const void * RTTI_BSParticleShaderRayEmitter = (void *)0x01ED0F38; -const void * RTTI_BSParticleShaderCollisionEmitter = (void *)0x01ED0F70; -const void * RTTI_BSParticleShaderGeometryEmitter = (void *)0x01ED0FA8; -const void * RTTI_ShaderReferenceEffect = (void *)0x01ED1088; -const void * RTTI_SlowTimeEffect = (void *)0x01ED10B8; -const void * RTTI_SoulTrapEffect = (void *)0x01ED10E0; -const void * RTTI_StaggerEffect = (void *)0x01ED0340; -const void * RTTI_BSPathing__CheckLineOfSightFilter = (void *)0x01ED1160; -const void * RTTI_CheckLineOfSightFilterMisc = (void *)0x01ED1198; -const void * RTTI_SummonPlacementEffect = (void *)0x01ED11D0; -const void * RTTI_SummonCreatureEffect = (void *)0x01ED1200; -const void * RTTI_TargetValueModifierEffect = (void *)0x01ED1230; -const void * RTTI_RallyEffect = (void *)0x01ED1260; -const void * RTTI_DemoralizeEffect = (void *)0x01ED1288; -const void * RTTI_TurnUndeadEffect = (void *)0x01ED12B0; -const void * RTTI_BanishEffect = (void *)0x01ED12D8; -const void * RTTI_CalmEffect = (void *)0x01ED1300; -const void * RTTI_FrenzyEffect = (void *)0x01ED1328; -const void * RTTI_TelekinesisEffect = (void *)0x01ED1350; -const void * RTTI_ValueAndConditionsEffect = (void *)0x01ED1378; -const void * RTTI_ValueModifierEffect = (void *)0x01ECFDA0; -const void * RTTI_WerewolfEffect = (void *)0x01ED13A8; -const void * RTTI_WerewolfFeedEffect = (void *)0x01ED13D0; -const void * RTTI_TESAudio__ScriptedMusicState = (void *)0x01ED15C0; -const void * RTTI_BGSPlayerMusicChanger = (void *)0x01ED17F8; -const void * RTTI_MenuTopicManager = (void *)0x01ED18E8; -const void * RTTI_BNETSystem__ModsChanged_ConfirmResetCallback = (void *)0x01ED1BA0; -const void * RTTI_DownloadAll__uiCallback = (void *)0x01ED1F08; -const void * RTTI_JobListManager__ServingThread = (void *)0x01ED1FD0; -const void * RTTI_BGSSaveLoadManager = (void *)0x01ED2278; -const void * RTTI_bgs__saveload__SaveOperationRequest = (void *)0x01ED2378; -const void * RTTI_bgs__saveload__LoadRequest = (void *)0x01ED23E0; -const void * RTTI_bgs__saveload__LoadEntryRequest = (void *)0x01ED2410; -const void * RTTI_BGSSaveLoadManager__Thread = (void *)0x01ED2448; -const void * RTTI_bgs__saveload__Request = (void *)0x01ED23B0; -const void * RTTI_BGSSaveLoadStatsMap = (void *)0x01ED2658; -const void * RTTI_BGSLoadGameBuffer = (void *)0x01EAB9C8; -const void * RTTI_BGSSaveFormBuffer = (void *)0x01ED27A0; -const void * RTTI_BGSSaveGameBuffer = (void *)0x01ED27C8; -const void * RTTI_SaveStorageWrapper = (void *)0x01ED27F0; -const void * RTTI_LoadStorageWrapper = (void *)0x01ED2820; -const void * RTTI_BSResource__CacheDrive__Op = (void *)0x01ED28A0; -const void * RTTI_BGSMoviePlayer = (void *)0x01ED2BA8; -const void * RTTI_IExplosionFactory = (void *)0x01ED2C30; -const void * RTTI_ChainExplosion = (void *)0x01ED2CD0; -const void * RTTI_EnhanceWeaponEffect = (void *)0x01ED2DA0; -const void * RTTI_GarbageCollector = (void *)0x01ED2DD0; -const void * RTTI_IMovementControllerNPCFunctor = (void *)0x01ED2FB0; -const void * RTTI_MovementAvoidBoxEventAdapter = (void *)0x01ED3168; -const void * RTTI_PathManagerPositionPlayerAdapter = (void *)0x01ED31A0; -const void * RTTI_CharacterCollisionMessagePlayerAdapter = (void *)0x01ED31D8; -const void * RTTI_PlayerSleepWaitMovementControllerAdapter = (void *)0x01ED3218; -const void * RTTI_PlayerSleepWaitMovementControllerAdapter__SwitchToLoadedSetControllerFunctor = (void *)0x01ED3260; -const void * RTTI_PlayerSleepWaitMovementControllerAdapter__SwitchToUnloadedSetControllerFunctor = (void *)0x01ED32D0; -const void * RTTI_DoorObstacleAdapter = (void *)0x01ED3338; -const void * RTTI_SystemEventAdapter = (void *)0x01ED3368; -const void * RTTI_Main = (void *)0x01ED3460; -const void * RTTI_bhkTelekinesisListener = (void *)0x01ED3480; -const void * RTTI_MagicFavorites = (void *)0x01ED3690; -const void * RTTI_BSTreeManager__IQueryCullingCamera = (void *)0x01ED3868; -const void * RTTI_RegSettingCollection = (void *)0x01ED38A0; -const void * RTTI_BGSImpactManager = (void *)0x01ED38D0; -const void * RTTI_InitTESThread = (void *)0x01ED3E28; -const void * RTTI_DetectSignOut = (void *)0x01ED3E50; -const void * RTTI_IMemoryManagerFileFactory = (void *)0x01ED3E78; -const void * RTTI_IMemoryManagerFile = (void *)0x01ED3F40; -const void * RTTI_MemoryManagerFile = (void *)0x01ED3F70; -const void * RTTI_SceneGraph = (void *)0x01ED4038; -const void * RTTI_SeenData = (void *)0x01EB1160; -const void * RTTI_IntSeenData = (void *)0x01EB1180; -const void * RTTI_SpawnHazardEffect = (void *)0x01ED4088; -const void * RTTI_BSUIMessageData = (void *)0x01ED40B0; -const void * RTTI_hkpWorldPostSimulationListener = (void *)0x01ED57A0; -const void * RTTI_IMovementState = (void *)0x01ED5828; -const void * RTTI_IPostAnimationChannelUpdateFunctor = (void *)0x01ED5880; -const void * RTTI_IAnimationSetCallbackFunctor = (void *)0x01ED5948; -const void * RTTI_Actor = (void *)0x01EAB7F8; -const void * RTTI_PackageList__IPackageVisitor = (void *)0x01ED59D0; -const void * RTTI_ProcessCallbackAdapter = (void *)0x01ED61D0; -const void * RTTI_SaveLoadMagicCasterVisitor = (void *)0x01ED6258; -const void * RTTI_SaveGameMagicCasterVisitor = (void *)0x01ED6290; -const void * RTTI_LoadGameMagicCasterVisitor = (void *)0x01ED62C8; -const void * RTTI_RevertSelectedSpellFunctor = (void *)0x01ED6300; -const void * RTTI_HoldWardSpellsActiveEffectVisitor = (void *)0x01ED6AA0; -const void * RTTI_hkpAllCdBodyPairCollector = (void *)0x01ED6AD8; -const void * RTTI_bhkFilteredCdBodyCollector = (void *)0x01ED6B08; -const void * RTTI_Actor__ForEachSpellVisitor = (void *)0x01ED6B40; -const void * RTTI_InventoryChanges__FindBestSoulGemVisitor = (void *)0x01ED6B70; -const void * RTTI_HasSpellVisitor = (void *)0x01ED6C78; -const void * RTTI_SumHostileEffectsFunctor = (void *)0x01ED6CA0; -const void * RTTI_ActorMediator = (void *)0x01ED6DC8; -const void * RTTI_IMovementInterface = (void *)0x01ED5850; -const void * RTTI_ActorState = (void *)0x01ED59A8; -const void * RTTI_BGSVisitProceduresProcess = (void *)0x01ED6FC0; -const void * RTTI_BGSVisitProceduresInitActorAnimPose = (void *)0x01ED6FF0; -const void * RTTI_DetectionListener = (void *)0x01ED0368; -const void * RTTI_InstantInteractionCallback = (void *)0x01ED70B8; -const void * RTTI_RunActionAnimationLoadedCallback = (void *)0x01ED70F0; -const void * RTTI_BGSPerk__FindPerkInRanksVisitor = (void *)0x01ED71B8; -const void * RTTI_BGSPerk__ApplyPerksVisitor = (void *)0x01ED71F0; -const void * RTTI_WeaponAnimationLoadedCallback = (void *)0x01ED7220; -const void * RTTI_BSDoorHavokController = (void *)0x01ED7298; -const void * RTTI_BSPlayerDistanceCheckController = (void *)0x01ED72C8; -const void * RTTI_BSSimpleScaleController = (void *)0x01ED7300; -const void * RTTI_Character = (void *)0x01ED0420; -const void * RTTI_HighActorCuller = (void *)0x01ED73E8; -const void * RTTI_MountInteraction = (void *)0x01ED75D8; -const void * RTTI_BGSPerk__AddPerkVisitor = (void *)0x01ED76F0; -const void * RTTI_bhkMouseSpringAction = (void *)0x01ED7720; -const void * RTTI_PlayerCharacter = (void *)0x01ED77C8; -const void * RTTI_IAllowEGMCacheClear = (void *)0x01ED7930; -const void * RTTI_hkpFirstCdBodyPairCollector = (void *)0x01ED79A8; -const void * RTTI_TargetLock__SetTargetLockFilter = (void *)0x01ED7A20; -const void * RTTI_PlayerRegionState = (void *)0x01ED7AA8; -const void * RTTI_IMovementFormIDManager = (void *)0x01ED7C90; -const void * RTTI_ProcessListMovementInterface = (void *)0x01ED7D08; -const void * RTTI_RefrInteraction = (void *)0x01ED7600; -const void * RTTI_SyncQueueObj = (void *)0x01ED7628; -const void * RTTI_MovementParametersFixed = (void *)0x01ED7D80; -const void * RTTI_ActorMover = (void *)0x01ED8240; -const void * RTTI_bhkCharacterCollisionHandler = (void *)0x01ED8268; -const void * RTTI_CharacterCollisionHandler = (void *)0x01ED82F0; -const void * RTTI_IMovementAvoidanceManager = (void *)0x01ED8518; -const void * RTTI_MovementAvoidanceManager = (void *)0x01ED85A0; -const void * RTTI_MovementControllerNPC = (void *)0x01ED87B8; -const void * RTTI_IMovementMessageInterface = (void *)0x01ED8858; -const void * RTTI_IMovementDirectControl = (void *)0x01ED88F0; -const void * RTTI_IMovementPlannerDirectControl = (void *)0x01ED8920; -const void * RTTI_IMovementSelectIdle = (void *)0x01ED88C0; -const void * RTTI_IMovementMotionDrivenControl = (void *)0x01ED8888; -const void * RTTI_BSPathingStreamWrite = (void *)0x01ED8958; -const void * RTTI_BSPathingStreamSimpleBufferWrite = (void *)0x01ED89E8; -const void * RTTI_MovementHandlerAgentDirectControl = (void *)0x01ED8DC8; -const void * RTTI_IMovementSetPlayerControls = (void *)0x01ED90B0; -const void * RTTI_MovementHandlerAgentPlayerControls = (void *)0x01ED90E8; -const void * RTTI_MovementHandlerAgentPlayerControlsActionTrigger = (void *)0x01ED9390; -const void * RTTI_IMovementSetSprinting = (void *)0x01ED9618; -const void * RTTI_MovementHandlerAgentSprintActionTrigger = (void *)0x01ED9648; -const void * RTTI_MovementHandlerAgentStairsHelper = (void *)0x01ED98B0; -const void * RTTI_MovementMessage = (void *)0x01ED9B60; -const void * RTTI_MovementMessageActorCollision = (void *)0x01ED9B88; -const void * RTTI_MovementMessageMovementTypeChange = (void *)0x01ED9E28; -const void * RTTI_MovementPlannerAgentDirectControl = (void *)0x01EDA080; -const void * RTTI_MovementPlannerAgentHorseControls = (void *)0x01EDA340; -const void * RTTI_IMovementSetKeepOffsetFromActor = (void *)0x01EDA590; -const void * RTTI_MovementPlannerAgentKeepOffset = (void *)0x01EDA5C8; -const void * RTTI_IMovementSetWarp = (void *)0x01EDA808; -const void * RTTI_MovementPlannerAgentWarp = (void *)0x01EDA830; -const void * RTTI_MovementTweenerAgentAnimationDriven = (void *)0x01EDAA88; -const void * RTTI_ITweenerNodeFollowerSetup = (void *)0x01EDAD50; -const void * RTTI_MovementTweenerAgentNodeFollower = (void *)0x01EDAD80; -const void * RTTI_PathingStreamLoadGame = (void *)0x01EDADB8; -const void * RTTI_PathingStreamSaveGame = (void *)0x01EDADE8; -const void * RTTI_InputEvent = (void *)0x01EDAE18; -const void * RTTI_ButtonEvent = (void *)0x01EDAE40; -const void * RTTI_HeldStateHandler = (void *)0x01EDAE88; -const void * RTTI_PlayerControls = (void *)0x01EDAEB0; -const void * RTTI_MovementHandler = (void *)0x01EDB0C8; -const void * RTTI_LookHandler = (void *)0x01EDB0F0; -const void * RTTI_SprintHandler = (void *)0x01EDB118; -const void * RTTI_ReadyWeaponHandler = (void *)0x01EDB140; -const void * RTTI_AutoMoveHandler = (void *)0x01EDB170; -const void * RTTI_ToggleRunHandler = (void *)0x01EDB198; -const void * RTTI_ActivateHandler = (void *)0x01EDB1C0; -const void * RTTI_JumpHandler = (void *)0x01EDB1E8; -const void * RTTI_ShoutHandler = (void *)0x01EDB210; -const void * RTTI_AttackBlockHandler = (void *)0x01EDB238; -const void * RTTI_RunHandler = (void *)0x01EDB268; -const void * RTTI_SneakHandler = (void *)0x01EDB290; -const void * RTTI_TogglePOVHandler = (void *)0x01EDB2B8; -const void * RTTI_IDEvent = (void *)0x01EDAE68; -const void * RTTI_IStaticAvoidNodeManager = (void *)0x01EDB2E0; -const void * RTTI_StaticAvoidNodeManager = (void *)0x01EDB358; -const void * RTTI_AlarmPackage = (void *)0x01ED6F98; -const void * RTTI_CustomActorPackageData = (void *)0x01EDB570; -const void * RTTI_EscortActorPackageData = (void *)0x01EDB5A0; -const void * RTTI_FleePackage = (void *)0x01ED5980; -const void * RTTI_GuardActorPackageData = (void *)0x01EDB5D0; -const void * RTTI_GuardPackageData = (void *)0x01EDB600; -const void * RTTI_PatrolActorPackageData = (void *)0x01EDB628; -const void * RTTI_SandBoxActorPackageData = (void *)0x01EDB658; -const void * RTTI_SpectatorPackage = (void *)0x01EDB688; -const void * RTTI_TrespassPackage = (void *)0x01EDB6B0; -const void * RTTI_ActorKnowledge = (void *)0x01EDB6D8; -const void * RTTI_DetectionCollector = (void *)0x01ED03F0; -const void * RTTI_DetectionState = (void *)0x01EDB700; -const void * RTTI_WeaponRightSwingHandler = (void *)0x01EDB828; -const void * RTTI_WeaponLeftSwingHandler = (void *)0x01EDB858; -const void * RTTI_AttackWinStartHandler = (void *)0x01EDB888; -const void * RTTI_AttackWinEndHandler = (void *)0x01EDB8B8; -const void * RTTI_AttackStopHandler = (void *)0x01EDB8E8; -const void * RTTI_RecoilStopHandler = (void *)0x01EDB910; -const void * RTTI_LeftHandSpellFireHandler = (void *)0x01EDB938; -const void * RTTI_RightHandSpellFireHandler = (void *)0x01EDB968; -const void * RTTI_VoiceSpellFireHandler = (void *)0x01EDB998; -const void * RTTI_LeftHandSpellCastHandler = (void *)0x01EDB9C8; -const void * RTTI_RightHandSpellCastHandler = (void *)0x01EDB9F8; -const void * RTTI_VoiceSpellCastHandler = (void *)0x01EDBA28; -const void * RTTI_WeaponBeginDrawRightHandler = (void *)0x01EDBA58; -const void * RTTI_WeaponBeginSheatheRightHandler = (void *)0x01EDBA90; -const void * RTTI_RightHandWeaponDrawHandler = (void *)0x01EDBAC8; -const void * RTTI_RightHandWeaponSheatheHandler = (void *)0x01EDBB00; -const void * RTTI_CameraOverrideStartHandler = (void *)0x01EDBB38; -const void * RTTI_CameraOverrideStopHandler = (void *)0x01EDBB70; -const void * RTTI_HitFrameHandler = (void *)0x01EDBBA0; -const void * RTTI_AnticipateAttackHandler = (void *)0x01EDBBC8; -const void * RTTI_StaggeredStopHandler = (void *)0x01EDBBF8; -const void * RTTI_ChairEnterHandler = (void *)0x01EDBC28; -const void * RTTI_PlayerChairEnterHandler = (void *)0x01EDBC50; -const void * RTTI_BedEnterHandler = (void *)0x01EDBC80; -const void * RTTI_PlayerBedEnterHandler = (void *)0x01EDBCA8; -const void * RTTI_ChairFurnitureExitHandler = (void *)0x01EDBCD8; -const void * RTTI_BedFurnitureExitHandler = (void *)0x01EDBD08; -const void * RTTI_PlayerFurnitureExitHandler = (void *)0x01EDBD38; -const void * RTTI_KillActorHandler = (void *)0x01EDBD70; -const void * RTTI_DecapitateHandler = (void *)0x01EDBD98; -const void * RTTI_HeadTrackingOnHandler = (void *)0x01EDBDC0; -const void * RTTI_HeadTrackingOffHandler = (void *)0x01EDBDF0; -const void * RTTI_FlightTakeOffHandler = (void *)0x01EDBE20; -const void * RTTI_FlightCruisingHandler = (void *)0x01EDBE50; -const void * RTTI_FlightHoveringHandler = (void *)0x01EDBE80; -const void * RTTI_FlightLandingHandler = (void *)0x01EDBEB0; -const void * RTTI_FlightPerchingHandler = (void *)0x01EDBEE0; -const void * RTTI_FlightLandHandler = (void *)0x01EDBF10; -const void * RTTI_FlightLandEndHandler = (void *)0x01EDBF38; -const void * RTTI_FlightActionHandler = (void *)0x01EDBF68; -const void * RTTI_FlightActionEntryEndHandler = (void *)0x01EDBF98; -const void * RTTI_FlightActionEndHandler = (void *)0x01EDBFD0; -const void * RTTI_FlightActionGrabHandler = (void *)0x01EDC000; -const void * RTTI_FlightActionReleaseHandler = (void *)0x01EDC030; -const void * RTTI_FlightCrashLandStartHandler = (void *)0x01EDC068; -const void * RTTI_BowDrawnHandler = (void *)0x01EDC0A0; -const void * RTTI_BowReleaseHandler = (void *)0x01EDC0C8; -const void * RTTI_ArrowAttachHandler = (void *)0x01EDC0F0; -const void * RTTI_ArrowDetachHandler = (void *)0x01EDC120; -const void * RTTI_ArrowReleaseHandler = (void *)0x01EDC150; -const void * RTTI_BowZoomStartHandler = (void *)0x01EDC180; -const void * RTTI_BowZoomStopHandler = (void *)0x01EDC1B0; -const void * RTTI_InterruptCastHandler = (void *)0x01EDC1E0; -const void * RTTI_EndSummonAnimationHandler = (void *)0x01EDC210; -const void * RTTI_PickNewIdleHandler = (void *)0x01EDC240; -const void * RTTI_DeathStopHandler = (void *)0x01EDC270; -const void * RTTI_ActionActivateDoneHandler = (void *)0x01EDC298; -const void * RTTI_StopMountCameraHandler = (void *)0x01EDC2C8; -const void * RTTI_PairedStopHandler = (void *)0x01EDC2F8; -const void * RTTI_CameraShakeHandler = (void *)0x01EDC320; -const void * RTTI_KillMoveStartHandler = (void *)0x01EDC350; -const void * RTTI_KillMoveEndHandler = (void *)0x01EDC380; -const void * RTTI_DeathEmoteHandler = (void *)0x01EDC3B0; -const void * RTTI_AddRagdollHandler = (void *)0x01EDC3D8; -const void * RTTI_MotionDrivenHandler = (void *)0x01EDC400; -const void * RTTI_AnimationDrivenHandler = (void *)0x01EDC430; -const void * RTTI_AllowRotationHandler = (void *)0x01EDC460; -const void * RTTI_RemoveRagdollHandler = (void *)0x01EDC490; -const void * RTTI_RagdollStartHandler = (void *)0x01EDC4C0; -const void * RTTI_GetUpStartHandler = (void *)0x01EDC4F0; -const void * RTTI_GetUpEndHandler = (void *)0x01EDC518; -const void * RTTI_MountDismountEndHandler = (void *)0x01EDC540; -const void * RTTI_ExitCartBeginHandler = (void *)0x01EDC570; -const void * RTTI_ExitCartEndHandler = (void *)0x01EDC5A0; -const void * RTTI_NPCAttachHandler = (void *)0x01EDC5D0; -const void * RTTI_NPCDetachHandler = (void *)0x01EDC5F8; -const void * RTTI_EnableCharacterBumperHandler = (void *)0x01EDC620; -const void * RTTI_DisableCharacterBumperHandler = (void *)0x01EDC658; -const void * RTTI_AnimationObjectLoadHandler = (void *)0x01EDC690; -const void * RTTI_AnimationObjectDrawHandler = (void *)0x01EDC6C8; -const void * RTTI_EnableCharacterPitchHandler = (void *)0x01EDC700; -const void * RTTI_DisableCharacterPitchHandler = (void *)0x01EDC738; -const void * RTTI_JumpAnimEventHandler = (void *)0x01EDC770; -const void * RTTI_IdleDialogueEnterHandler = (void *)0x01EDC7A0; -const void * RTTI_IdleDialogueExitHandler = (void *)0x01EDC7D0; -const void * RTTI_AnimatedCameraStartHandler = (void *)0x01EDC800; -const void * RTTI_AnimatedCameraDeltaStartHandler = (void *)0x01EDC838; -const void * RTTI_AnimatedCameraEndHandler = (void *)0x01EDC870; -const void * RTTI_PitchOverrideStartHandler = (void *)0x01EDC8A0; -const void * RTTI_PitchOverrideEndHandler = (void *)0x01EDC8D0; -const void * RTTI_MTStateHandler = (void *)0x01EDC900; -const void * RTTI_ZeroPitchHandler = (void *)0x01EDC928; -const void * RTTI_VampireFeedEndHandler = (void *)0x01EDC950; -const void * RTTI_BGShkMatFadeController = (void *)0x01EEA1B0; -const void * RTTI_BSDirectAtModifierInterface = (void *)0x01EEA3B8; -const void * RTTI_BSPassByTargetTriggerModifierInterface = (void *)0x01EEA628; -const void * RTTI_BSRagdollContactListenerModifierInterface = (void *)0x01EEA950; -const void * RTTI_ArrowProjectile = (void *)0x01EEAC98; -const void * RTTI_BarrierPhantomCallbackShape = (void *)0x01EEACE8; -const void * RTTI_BarrierProjectile = (void *)0x01EEAD20; -const void * RTTI_bhkSPCollisionObject = (void *)0x01EEAD48; -const void * RTTI_BeamProjectile = (void *)0x01EEAD78; -const void * RTTI_ConeProjectile = (void *)0x01EEAE28; -const void * RTTI_Explosion = (void *)0x01ED2CF8; -const void * RTTI_hkpFixedBufferCdPointCollector = (void *)0x01EEAE98; -const void * RTTI_FlameProjectile = (void *)0x01EEAED0; -const void * RTTI_GrenadeProjectile = (void *)0x01EEAEF8; -const void * RTTI_Hazard = (void *)0x01EEAF20; -const void * RTTI_MissileProjectile = (void *)0x01EEACC0; -const void * RTTI_hkHingeConstraintCinfo = (void *)0x01EEAF40; -const void * RTTI_bhkHingeConstraint = (void *)0x01EEAF70; -const void * RTTI_Projectile = (void *)0x01ED2CA8; -const void * RTTI_ProjectilePickCache = (void *)0x01EEAFA0; -const void * RTTI_HealthDamageFunctor = (void *)0x01EEAFD0; -const void * RTTI_VATS__ICommandListVisitor = (void *)0x01EEB000; -const void * RTTI_CombatAimController = (void *)0x01EEB030; -const void * RTTI_CombatTrackTargetAimController = (void *)0x01EEB0B8; -const void * RTTI_CombatMeleeAimController = (void *)0x01EEB0F0; -const void * RTTI_CombatProjectileAimController = (void *)0x01EEB120; -const void * RTTI_CombatDisableAimController = (void *)0x01EEB158; -const void * RTTI_CombatObject = (void *)0x01EEB090; -const void * RTTI_CombatAimControllerBase = (void *)0x01EEB060; -const void * RTTI_CombatArea = (void *)0x01EEBB38; -const void * RTTI_CombatAreaRadius = (void *)0x01EEBB60; -const void * RTTI_CombatAreaReference = (void *)0x01EEBB88; -const void * RTTI_CombatAreaStandard = (void *)0x01EEBBB8; -const void * RTTI_CombatAreaHoldPosition = (void *)0x01EEBBE8; -const void * RTTI_CombatBlackboardKeyBase = (void *)0x01EEC328; -const void * RTTI_CombatCoverSearchResult = (void *)0x01EEC358; -const void * RTTI_CombatCoverLocation = (void *)0x01EEC388; -const void * RTTI_CombatCoverSearchDebugData = (void *)0x01EEC3B8; -const void * RTTI_CombatCoverSearch = (void *)0x01EEC3F0; -const void * RTTI_CombatGroupDetectionListener = (void *)0x01EECB48; -const void * RTTI_GatherSpellsFunctor = (void *)0x01EECB80; -const void * RTTI_CombatInventoryItem = (void *)0x01EECCF8; -const void * RTTI_CombatInventoryItemComposite = (void *)0x01EECD28; -const void * RTTI_CombatInventoryItemMelee = (void *)0x01EECD60; -const void * RTTI_CombatInventoryItemRanged = (void *)0x01EECD90; -const void * RTTI_CombatInventoryItemShield = (void *)0x01EECDC0; -const void * RTTI_CombatInventoryItemOneHandedBlock = (void *)0x01EECDF0; -const void * RTTI_CombatInventoryItemTorch = (void *)0x01EECE28; -const void * RTTI_CombatInventoryItemMagic = (void *)0x01EED7D8; -const void * RTTI_CombatInventoryItemShout = (void *)0x01EF8010; -const void * RTTI_CombatInventoryItemStaff = (void *)0x01EF8040; -const void * RTTI_CombatInventoryItemPotion = (void *)0x01EF8070; -const void * RTTI_CombatInventoryItemScroll = (void *)0x01EF80A0; -const void * RTTI_CombatMagicCasterOffensive = (void *)0x01EF80D0; -const void * RTTI_CombatMagicCasterWard = (void *)0x01EF8108; -const void * RTTI_CombatMagicCasterRestore = (void *)0x01EF8138; -const void * RTTI_CombatMagicCasterSummon = (void *)0x01EF8168; -const void * RTTI_CombatMagicCasterStagger = (void *)0x01EF8198; -const void * RTTI_CombatMagicCasterDisarm = (void *)0x01EF81C8; -const void * RTTI_CombatMagicCasterCloak = (void *)0x01EF81F8; -const void * RTTI_CombatMagicCasterLight = (void *)0x01EF8228; -const void * RTTI_CombatMagicCasterInvisibility = (void *)0x01EF8258; -const void * RTTI_CombatMagicCasterBoundItem = (void *)0x01EF8290; -const void * RTTI_CombatMagicCasterArmor = (void *)0x01EF82C8; -const void * RTTI_CombatMagicCasterTargetEffect = (void *)0x01EF82F8; -const void * RTTI_CombatMagicCasterParalyze = (void *)0x01EF8330; -const void * RTTI_CombatMagicCasterScript = (void *)0x01EF8360; -const void * RTTI_CombatMagicCaster = (void *)0x01EF7FE8; -const void * RTTI_CombatMagicItemData = (void *)0x01EFEEB0; -const void * RTTI_CombatMagicItemSkillChecker = (void *)0x01EFEEE0; -const void * RTTI_CombatMagicCasterReanimate = (void *)0x01EFEF18; -const void * RTTI_CombatPathingRequest = (void *)0x01EFF070; -const void * RTTI_CombatTargetLocationSearchResult = (void *)0x01EFF0A0; -const void * RTTI_CombatTargetLocation = (void *)0x01EFF0D8; -const void * RTTI_CombatTargetLocationSearch = (void *)0x01EFF108; -const void * RTTI_CombatPath = (void *)0x01EFF140; -const void * RTTI_CombatTargetSelector = (void *)0x01F005F0; -const void * RTTI_CombatTargetSelectorStandard = (void *)0x01F00620; -const void * RTTI_CombatTargetSelectorFixed = (void *)0x01F00658; -const void * RTTI_CombatThreat = (void *)0x01F00A58; -const void * RTTI_hkpClosestCdPointCollector = (void *)0x01F00C30; -const void * RTTI_CombatBehaviorResource = (void *)0x01F00D18; -const void * RTTI_CombatBehaviorTreeRootNode = (void *)0x01F00D48; -const void * RTTI_CombatBehaviorTreeLinkNode = (void *)0x01F00D80; -const void * RTTI_CombatBehaviorTree = (void *)0x01ECDC70; -const void * RTTI_CombatBehaviorTreeCombat = (void *)0x01F00DB8; -const void * RTTI_CombatBehaviorTreeNode = (void *)0x01ECDCA0; -const void * RTTI_CombatBehaviorTreeAcquireWeapon = (void *)0x01F00E98; -const void * RTTI_CombatBehaviorTreeAction = (void *)0x01F01658; -const void * RTTI_CombatBehaviorTreeActionEquipmentSelector = (void *)0x01F01690; -const void * RTTI_CombatBehaviorTreeWrapperNode = (void *)0x01F016D0; -const void * RTTI_CombatBehaviorTreeDodgeThreat = (void *)0x01F02238; -const void * RTTI_CombatBehaviorTreeBlock = (void *)0x01F024A8; -const void * RTTI_CombatBehaviorTreeCloseMovement = (void *)0x01F02958; -const void * RTTI_CombatPathSpeedController = (void *)0x01F02990; -const void * RTTI_CombatApproachTargetSpeedController = (void *)0x01F029C0; -const void * RTTI_CombatBehaviorTreeFindAttackLocation = (void *)0x01F03AD0; -const void * RTTI_CombatBehaviorTreeFlankingMovement = (void *)0x01F04C10; -const void * RTTI_CombatFlankingSearchData = (void *)0x01F04C50; -const void * RTTI_CombatBehaviorTreeFlee = (void *)0x01F06C00; -const void * RTTI_CombatBehaviorTreeHide = (void *)0x01F081C0; -const void * RTTI_CombatBehaviorTreeFlight = (void *)0x01F08FA0; -const void * RTTI_DiveBombSpeedController = (void *)0x01F08FD0; -const void * RTTI_CombatBehaviorTreeLowCombat = (void *)0x01F0A0F0; -const void * RTTI_CombatBehaviorTreeMagic = (void *)0x01F0A630; -const void * RTTI_CombatBehaviorTreeMelee = (void *)0x01F0ACC0; -const void * RTTI_CombatDisableActionController = (void *)0x01F0AFB8; -const void * RTTI_CombatBehaviorTreeCheckUnreachableTarget = (void *)0x01F0AFF0; -const void * RTTI_CombatBehaviorTreeReturnToCombatArea = (void *)0x01F0B030; -const void * RTTI_CombatBehaviorTreeExitWater = (void *)0x01F0BBE0; -const void * RTTI_CombatBehaviorTreeMovement = (void *)0x01F0CDC8; -const void * RTTI_CombatBehaviorTreeRangedMovement = (void *)0x01F0D4A0; -const void * RTTI_CombatBehaviorTreeSearch = (void *)0x01F0D878; -const void * RTTI_CombatSearchLockData = (void *)0x01F0E360; -const void * RTTI_CombatBehaviorTreeShout = (void *)0x01F0FA88; -const void * RTTI_CombatBehaviorTreeUseCover = (void *)0x01F0FDA0; -const void * RTTI_CombatBehaviorTreeUsePotion = (void *)0x01F10E00; -const void * RTTI_IPathBuilder = (void *)0x01EFF168; -const void * RTTI_CombatNavmeshSearch = (void *)0x01F003F8; -const void * RTTI_CombatPathBuilder = (void *)0x01F00330; -const void * RTTI_CombatPathBuilderStandard = (void *)0x01F00300; -const void * RTTI_CombatPathBuilderOpen = (void *)0x01F039F0; -const void * RTTI_CombatPathingRequestStandard = (void *)0x01F11098; -const void * RTTI_CombatPathingRequestAdapter = (void *)0x01F110D0; -const void * RTTI_CombatPathingRequestMultiGoal = (void *)0x01F11108; -const void * RTTI_CombatPathingDebugData = (void *)0x01F11A98; -const void * RTTI_HorseCameraState = (void *)0x01F155F0; -const void * RTTI_FirstPersonState = (void *)0x01F15618; -const void * RTTI_PlayerCamera = (void *)0x01F15640; -const void * RTTI_AutoVanityState = (void *)0x01F15868; -const void * RTTI_FreeCameraState = (void *)0x01F15890; -const void * RTTI_IronSightsState = (void *)0x01F158B8; -const void * RTTI_FurnitureCameraState = (void *)0x01F158E0; -const void * RTTI_PlayerCameraTransitionState = (void *)0x01F15910; -const void * RTTI_BleedoutCameraState = (void *)0x01F15948; -const void * RTTI_TweenMenuCameraState = (void *)0x01F15978; -const void * RTTI_VATSCameraState = (void *)0x01F159A8; -const void * RTTI_FxResponseArgsBase = (void *)0x01F159D0; -const void * RTTI_FxResponseArgsList = (void *)0x01F15A00; -const void * RTTI_StandardItemData = (void *)0x01F15A30; -const void * RTTI_BarterMenu = (void *)0x01F15A58; -const void * RTTI_BookMenu = (void *)0x01F15B40; -const void * RTTI_IStringForwarder = (void *)0x01F15B60; -const void * RTTI_Console = (void *)0x01F15B88; -const void * RTTI_ConsoleNativeUIMenu = (void *)0x01F15BE0; -const void * RTTI_ContainerMenu = (void *)0x01F15C10; -const void * RTTI_FxDelegateHandler = (void *)0x01ECE708; -const void * RTTI_CraftingSubMenus__CraftingSubMenu = (void *)0x01F15C38; -const void * RTTI_CraftingMenu = (void *)0x01F15C70; -const void * RTTI_CraftingSubMenus__ConstructibleObjectMenu = (void *)0x01F15C98; -const void * RTTI_CraftingSubMenus__ConstructibleObjectMenu__CreationConfirmCallback = (void *)0x01F15CE0; -const void * RTTI_CraftingSubMenus__SmithingMenu = (void *)0x01F15D38; -const void * RTTI_CraftingSubMenus__SmithingMenu__SmithingConfirmCallback = (void *)0x01F15D70; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu = (void *)0x01F15DC0; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuCallback = (void *)0x01F15E00; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuExitCallback = (void *)0x01F15E50; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuCraftCallback = (void *)0x01F15EB0; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantMenuDisenchantCallback = (void *)0x01F15F10; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__CategoryListEntry = (void *)0x01F15F70; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__ItemChangeEntry = (void *)0x01F15FC0; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__EnchantmentEntry = (void *)0x01F16010; -const void * RTTI_CraftingSubMenus__EnchantConstructMenu__CreateEffectFunctor = (void *)0x01F16060; -const void * RTTI_CraftingSubMenus__AlchemyMenu = (void *)0x01F160B0; -const void * RTTI_CraftingSubMenus__AlchemyMenu__CraftItemCallback = (void *)0x01F160F0; -const void * RTTI_CraftingSubMenus__AlchemyMenu__QuitMenuCallback = (void *)0x01F16140; -const void * RTTI_CraftingSubMenus__AlchemyMenu__ModEffectivenessFunctor = (void *)0x01F16190; -const void * RTTI_CreditsMenu = (void *)0x01F16238; -const void * RTTI_CursorMenu = (void *)0x01F16260; -const void * RTTI_DialogueMenu = (void *)0x01F16288; -const void * RTTI_FaderMenu = (void *)0x01F162B0; -const void * RTTI_FavoritesMenu = (void *)0x01F162D0; -const void * RTTI_GiftMenu = (void *)0x01F162F8; -const void * RTTI_HUDObject = (void *)0x01F16358; -const void * RTTI_HUDMeter = (void *)0x01F16378; -const void * RTTI_HUDMenu = (void *)0x01F16398; -const void * RTTI_HUDNotifications = (void *)0x01F163B8; -const void * RTTI_ActorValueMeter = (void *)0x01F163E0; -const void * RTTI_ShoutMeter = (void *)0x01F16408; -const void * RTTI_HUDChargeMeter = (void *)0x01F16430; -const void * RTTI_Compass = (void *)0x01F16458; -const void * RTTI_EnemyHealth = (void *)0x01F16478; -const void * RTTI_FloatingQuestMarker = (void *)0x01F164A0; -const void * RTTI_StealthMeter = (void *)0x01F164D0; -const void * RTTI_HelpMessageManager = (void *)0x01F164F8; -const void * RTTI_NewInventoryMenuItemLoadTask = (void *)0x01F166F0; -const void * RTTI_Inventory3DManager = (void *)0x01F16728; -const void * RTTI_InventoryMenu = (void *)0x01F169C8; -const void * RTTI_LevelUpMenu = (void *)0x01F16A38; -const void * RTTI_LoadingMenu = (void *)0x01F16AA8; -const void * RTTI_LockpickingMenu = (void *)0x01F16B00; -const void * RTTI_MagicItemData = (void *)0x01F16B58; -const void * RTTI_MagicMenu = (void *)0x01F16B80; -const void * RTTI_MainMenu = (void *)0x01F16D50; -const void * RTTI_DLCPurchased__OpenVisitCreationClubCallback = (void *)0x01F16DF0; -const void * RTTI_DLCPurchased__PurchasedDLCDialogCallback = (void *)0x01F16E38; -const void * RTTI_NeedToUpdateCreationClubCallback = (void *)0x01F16E78; -const void * RTTI_MenuControls = (void *)0x01F16FC8; -const void * RTTI_ClickHandler = (void *)0x01F17188; -const void * RTTI_DirectionHandler = (void *)0x01F171B0; -const void * RTTI_ConsoleOpenHandler = (void *)0x01F171D8; -const void * RTTI_QuickSaveLoadHandler = (void *)0x01F17208; -const void * RTTI_MenuOpenHandler = (void *)0x01F17238; -const void * RTTI_FavoritesHandler = (void *)0x01F17260; -const void * RTTI_ScreenshotHandler = (void *)0x01F17288; -const void * RTTI_MessageBoxMenu = (void *)0x01F172B0; -const void * RTTI_MistMenu = (void *)0x01F17318; -const void * RTTI_ThumbstickEvent = (void *)0x01F17338; -const void * RTTI_RaceSexCamera = (void *)0x01F17360; -const void * RTTI_RaceSexMenu = (void *)0x01F17388; -const void * RTTI_SafeZoneMenu = (void *)0x01F174C0; -const void * RTTI_SleepWaitMenu = (void *)0x01F174E8; -const void * RTTI_StatsNode = (void *)0x01F17510; -const void * RTTI_StatsMenu = (void *)0x01F17530; -const void * RTTI_LineNode = (void *)0x01F17550; -const void * RTTI_StreamingInstallMenu = (void *)0x01F17770; -const void * RTTI_TitleSequenceMenu = (void *)0x01F177A0; -const void * RTTI_TrainingMenu = (void *)0x01F177C8; -const void * RTTI_TutorialMenu = (void *)0x01F177F0; -const void * RTTI_TweenMenu = (void *)0x01F17818; -const void * RTTI_UIBlurManager = (void *)0x01F17838; -const void * RTTI_HUDData = (void *)0x01F17A08; -const void * RTTI_ConsoleData = (void *)0x01F17A28; -const void * RTTI_FaderData = (void *)0x01F17A50; -const void * RTTI_InventoryUpdateData = (void *)0x01F17A70; -const void * RTTI_RefHandleUIData = (void *)0x01F17AA0; -const void * RTTI_TESFormUIData = (void *)0x01F17AC8; -const void * RTTI_LoadingMenuData = (void *)0x01F17AF0; -const void * RTTI_KinectStateChangeData = (void *)0x01F17B18; -const void * RTTI_KinectUserEventData = (void *)0x01F17B48; -const void * RTTI_UISaveLoadManager = (void *)0x01F18B38; -const void * RTTI_bgs__saveload__BuildSaveListRequest = (void *)0x01F18D20; -const void * RTTI_LocalMapMenu__InputHandler = (void *)0x01F18D90; -const void * RTTI_TransitionState = (void *)0x01F18E10; -const void * RTTI_MapCameraStates__Exit = (void *)0x01F18E38; -const void * RTTI_MapCameraStates__Transition = (void *)0x01F18E68; -const void * RTTI_IMapCameraCallbacks = (void *)0x01F18EA0; -const void * RTTI_MapCamera = (void *)0x01F18ED0; -const void * RTTI_MapCameraStates__World = (void *)0x01F18F88; -const void * RTTI_MapMenu = (void *)0x01F18FB8; -const void * RTTI_MapInputHandler = (void *)0x01F18FD8; -const void * RTTI_MapLookHandler = (void *)0x01F19000; -const void * RTTI_MapMoveHandler = (void *)0x01F19028; -const void * RTTI_MapZoomHandler = (void *)0x01F19050; -const void * RTTI_JournalTab = (void *)0x01F19148; -const void * RTTI_Journal_QuestsTab = (void *)0x01F19170; -const void * RTTI_ModManagerData = (void *)0x01F19468; -const void * RTTI_Journal_SystemTab = (void *)0x01F19490; -const void * RTTI_JournalInputMapping__RemapHandler = (void *)0x01F194F8; -const void * RTTI_Journal_StatsTab = (void *)0x01F19530; -const void * RTTI_JournalMenu = (void *)0x01F19558; -const void * RTTI_SkyrimScript__Internal__CallbackList = (void *)0x01F195B8; -const void * RTTI_SkyrimScript__Internal__AnimationCallbacks = (void *)0x01F195F8; -const void * RTTI_SkyrimScript__DelayFunctor = (void *)0x01F19638; -const void * RTTI_SkyrimScript__DelayFunctorFactory = (void *)0x01F19668; -const void * RTTI_SkyrimScript__Logger = (void *)0x01F19788; -const void * RTTI_SkyrimScript__PathingCallbackMgr = (void *)0x01F198C8; -const void * RTTI_SkyrimScript__Internal__IProfileCallQuery = (void *)0x01F19B78; -const void * RTTI_SkyrimScript__Profiler = (void *)0x01F19BB8; -const void * RTTI_SkyrimScript__QuestCallbackMgr = (void *)0x01F19CD0; -const void * RTTI_SkyrimScript__SavePatcher = (void *)0x01F19F18; -const void * RTTI_SkyrimScript__SoundCallbackMgr = (void *)0x01F19F80; -const void * RTTI_BSScript__IStore = (void *)0x01F1A1C8; -const void * RTTI_SkyrimScript__Store = (void *)0x01F1A1F0; -const void * RTTI_BSResource__ArchiveFoundStreamCB = (void *)0x01F1B600; -const void * RTTI_BSCounterStorage = (void *)0x01F1B690; -const void * RTTI_BSScript__IObjectHandlePolicy = (void *)0x01F1B6B8; -const void * RTTI_BSScript__IStackCallbackSaveInterface = (void *)0x01F1B6F0; -const void * RTTI_BSScript__IStackCallbackFunctor = (void *)0x01F1B730; -const void * RTTI_BSScript__IProfilePolicy = (void *)0x01F19B48; -const void * RTTI_BSScript__ILoader = (void *)0x01F1B768; -const void * RTTI_BSScript__ObjectBindPolicy = (void *)0x01F1B790; -const void * RTTI_BSScript__IFreezeQuery = (void *)0x01F1B7C0; -const void * RTTI_BSScript__ISavePatcherInterface = (void *)0x01F19F48; -const void * RTTI_SkyrimScript__HandlePolicy = (void *)0x01F1C2F8; -const void * RTTI_SkyrimScript__SaveFileHandleReaderWriter = (void *)0x01F1C328; -const void * RTTI_SkyrimScript__ObjectBindPolicy = (void *)0x01F1C368; -const void * RTTI_SkyrimVM = (void *)0x01F1C3A0; -const void * RTTI_SkyrimVM__ISendEventFilter = (void *)0x01F1C598; -const void * RTTI_SkyrimVM__EventRelayFunctor = (void *)0x01F1C5C8; -const void * RTTI_SkyrimVM__EffectEventRelayFunctor = (void *)0x01F1C600; -const void * RTTI_SkyrimVM__SleepStartEventFunctor = (void *)0x01F1C638; -const void * RTTI_SkyrimVM__SleepStopEventFunctor = (void *)0x01F1C670; -const void * RTTI_SkyrimVM__InventoryEventFilter = (void *)0x01F1C960; -const void * RTTI_IGiftMenuScriptCallback = (void *)0x01F1D5F8; -const void * RTTI_SkyrimSpeechRecognition = (void *)0x01F25AF8; -const void * RTTI_hkaFootPlacementIkSolver = (void *)0x01F25E60; -const void * RTTI_hkReferencedObjectLock = (void *)0x01F25E90; -const void * RTTI_hkMemoryAllocator = (void *)0x01F25F00; -const void * RTTI_hkLifoAllocator = (void *)0x01F25F28; -const void * RTTI_hkContainerTempAllocator__Allocator = (void *)0x01F25F50; -const void * RTTI_hkContainerHeapAllocator__Allocator = (void *)0x01F25F90; -const void * RTTI_hkContainerDebugAllocator__Allocator = (void *)0x01F25FD0; -const void * RTTI_hkErrStream = (void *)0x01F26030; -const void * RTTI_hkLocalFrameGroup = (void *)0x01F26058; -const void * RTTI_hkLocalFrame = (void *)0x01F26080; -const void * RTTI_hkSimpleLocalFrame = (void *)0x01F260A8; -const void * RTTI_hkBufferedStreamReader = (void *)0x01F260D8; -const void * RTTI_hkBufferedStreamWriter = (void *)0x01F26108; -const void * RTTI_hkSeekableStreamReader = (void *)0x01F26138; -const void * RTTI_hkStdioStreamReader = (void *)0x01F26168; -const void * RTTI_hkStdioStreamWriter = (void *)0x01F26198; -const void * RTTI_hkOstream = (void *)0x01F26010; -const void * RTTI_hkMemoryTrackStreamWriter = (void *)0x01F261C8; -const void * RTTI_hkArrayStreamWriter = (void *)0x01F261F8; -const void * RTTI_hkStatisticsCollector = (void *)0x01F26228; -const void * RTTI_hkCrc32StreamWriter = (void *)0x01F26258; -const void * RTTI_hkStackTracer = (void *)0x01F262C0; -const void * RTTI_hkDummySingleton = (void *)0x01F26320; -const void * RTTI_hkTrackerSerializableScanSnapshot = (void *)0x01F26380; -const void * RTTI_hkTrackerTypeTreeTextCache = (void *)0x01F263B8; -const void * RTTI_hkMemoryTrackStreamReader = (void *)0x01F263F0; -const void * RTTI_hkOArchive = (void *)0x01F26420; -const void * RTTI_hkDefaultError = (void *)0x01F26448; -const void * RTTI_hkSocket = (void *)0x01F26470; -const void * RTTI_hkSocket__ReaderAdapter = (void *)0x01F26490; -const void * RTTI_hkSocket__WriterAdapter = (void *)0x01F264C0; -const void * RTTI_hkTrackerScanSnapshot = (void *)0x01F264F0; -const void * RTTI_hkBsdSocket = (void *)0x01F26520; -const void * RTTI_hkTrackerTypeTreeCache = (void *)0x01F26548; -const void * RTTI_hkMemoryTracker = (void *)0x01F26578; -const void * RTTI_hkDefaultMemoryTracker = (void *)0x01F265A0; -const void * RTTI_hkMemorySystem = (void *)0x01F265D0; -const void * RTTI_hkDummyMemoryTrackerImpl = (void *)0x01F265F8; -const void * RTTI_hkTrackerArrayLayoutHandler = (void *)0x01F26628; -const void * RTTI_hkTrackerStringPtrLayoutHandler = (void *)0x01F26690; -const void * RTTI_hkTrackerCachedHashMapLayoutHandler = (void *)0x01F266C8; -const void * RTTI_hkTrackerStringMapLayoutHandler = (void *)0x01F26708; -const void * RTTI_hkTrackerTypeLayout = (void *)0x01F26740; -const void * RTTI_hkTrackerLayoutCalculator = (void *)0x01F26770; -const void * RTTI_hkTrackerLayoutHandler = (void *)0x01F26660; -const void * RTTI_hkTrackerRefPtrLayoutHandler = (void *)0x01F267A0; -const void * RTTI_hkbRagdollDriver = (void *)0x01F267D8; -const void * RTTI_hkbNode = (void *)0x01F26800; -const void * RTTI_hkbBindable = (void *)0x01F26820; -const void * RTTI_hkbBehaviorGraph = (void *)0x01F26848; -const void * RTTI_hkbNodeInternalStateInfo = (void *)0x01F26898; -const void * RTTI_hkbGenerator = (void *)0x01F26870; -const void * RTTI_hkbVariableValueSet = (void *)0x01F268C8; -const void * RTTI_hkbBehaviorGraph__GlobalTransitionData = (void *)0x01F268F8; -const void * RTTI_hkbFootIkDriver = (void *)0x01F26938; -const void * RTTI_hkbAnimationBindingSet = (void *)0x01F26960; -const void * RTTI_hkbCharacter = (void *)0x01F26990; -const void * RTTI_hkbWorld = (void *)0x01F269B8; -const void * RTTI_hkbSceneModifier = (void *)0x01F269D8; -const void * RTTI_hkbFootIkSceneModifier = (void *)0x01F26A00; -const void * RTTI_hkbHandIkSceneModifier = (void *)0x01F26A30; -const void * RTTI_hkbHandIkFixupSceneModifier = (void *)0x01F26A60; -const void * RTTI_hkbBindableCollector = (void *)0x01F26A98; -const void * RTTI_hkbBindable__CacheBindablesCollector = (void *)0x01F26AC8; -const void * RTTI_hkbNode__BoundVariablesCollector = (void *)0x01F26B08; -const void * RTTI_hkbAttachmentSetup = (void *)0x01F26B40; -const void * RTTI_hkbEventPayload = (void *)0x01F26B70; -const void * RTTI_hkbRealEventPayload = (void *)0x01F26B98; -const void * RTTI_hkbIntEventPayload = (void *)0x01F26BC8; -const void * RTTI_hkbStringEventPayload = (void *)0x01F26BF8; -const void * RTTI_hkbNamedEventPayload = (void *)0x01F26C28; -const void * RTTI_hkbNamedRealEventPayload = (void *)0x01F26C58; -const void * RTTI_hkbNamedIntEventPayload = (void *)0x01F26C88; -const void * RTTI_hkbNamedStringEventPayload = (void *)0x01F26CB8; -const void * RTTI_hkbEventPayloadList = (void *)0x01F26CF0; -const void * RTTI_hkbVariableBindingSet = (void *)0x01F26D20; -const void * RTTI_hkbHandle = (void *)0x01F26D50; -const void * RTTI_hkbHandIkDriverInfo = (void *)0x01F26D70; -const void * RTTI_hkbTransitionEffect = (void *)0x01F26DA0; -const void * RTTI_hkbProjectStringData = (void *)0x01F26DD0; -const void * RTTI_hkbBehaviorGraphInternalState = (void *)0x01F26E00; -const void * RTTI_hkbBehaviorGraphData = (void *)0x01F26E38; -const void * RTTI_hkbStateListener = (void *)0x01F26E68; -const void * RTTI_hkbSequence = (void *)0x01F26E90; -const void * RTTI_hkbBehaviorGraphStringData = (void *)0x01F26EE0; -const void * RTTI_hkbBoneIndexArray = (void *)0x01F26F18; -const void * RTTI_hkbBoneWeightArray = (void *)0x01F26F40; -const void * RTTI_hkbCharacterStringData = (void *)0x01F26F70; -const void * RTTI_hkbFootIkDriverInfo = (void *)0x01F26FA0; -const void * RTTI_hkbMirroredSkeletonInfo = (void *)0x01F26FD0; -const void * RTTI_hkbCondition = (void *)0x01F27000; -const void * RTTI_hkbCompiledExpressionSet = (void *)0x01F27028; -const void * RTTI_hkbExpressionCondition = (void *)0x01F27058; -const void * RTTI_hkbStringCondition = (void *)0x01F27088; -const void * RTTI_hkbBehaviorReferenceGenerator = (void *)0x01F270B8; -const void * RTTI_hkbBlenderGeneratorChild = (void *)0x01F270F0; -const void * RTTI_hkbBlenderGenerator = (void *)0x01F27120; -const void * RTTI_hkbBlenderGeneratorInternalState = (void *)0x01F27150; -const void * RTTI_hkbClipTriggerArray = (void *)0x01F27188; -const void * RTTI_hkbClipGeneratorInternalState = (void *)0x01F271B8; -const void * RTTI_hkbRegisteredGenerator = (void *)0x01F271F0; -const void * RTTI_hkbManualSelectorGenerator = (void *)0x01F27220; -const void * RTTI_hkbManualSelectorGeneratorInternalState = (void *)0x01F27258; -const void * RTTI_hkbModifier = (void *)0x01F26EB8; -const void * RTTI_hkbModifierGenerator = (void *)0x01F27298; -const void * RTTI_hkbPoseMatchingGenerator = (void *)0x01F272C8; -const void * RTTI_hkbPoseMatchingGeneratorInternalState = (void *)0x01F272F8; -const void * RTTI_hkbReferencePoseGenerator = (void *)0x01F27338; -const void * RTTI_hkbAttachmentModifier = (void *)0x01F27368; -const void * RTTI_hkbAttributeModifier = (void *)0x01F27398; -const void * RTTI_hkbCharacterControllerModifier = (void *)0x01F273C8; -const void * RTTI_hkbCharacterControllerModifierInternalState = (void *)0x01F27400; -const void * RTTI_hkbCombineTransformsModifier = (void *)0x01F27448; -const void * RTTI_hkbCombineTransformsModifierInternalState = (void *)0x01F27480; -const void * RTTI_hkbComputeDirectionModifier = (void *)0x01F274C0; -const void * RTTI_hkbComputeDirectionModifierInternalState = (void *)0x01F274F8; -const void * RTTI_hkbComputeRotationFromAxisAngleModifier = (void *)0x01F27538; -const void * RTTI_hkbComputeRotationFromAxisAngleModifierInternalState = (void *)0x01F27580; -const void * RTTI_hkbComputeRotationToTargetModifier = (void *)0x01F275D0; -const void * RTTI_hkbComputeRotationToTargetModifierInternalState = (void *)0x01F27610; -const void * RTTI_hkbDampingModifier = (void *)0x01F27658; -const void * RTTI_hkbDampingModifierInternalState = (void *)0x01F27688; -const void * RTTI_hkbModifierWrapper = (void *)0x01F276C0; -const void * RTTI_hkbDelayedModifier = (void *)0x01F276F0; -const void * RTTI_hkbDelayedModifierInternalState = (void *)0x01F27720; -const void * RTTI_hkbDetectCloseToGroundModifier = (void *)0x01F27758; -const void * RTTI_hkbDetectCloseToGroundModifierInternalState = (void *)0x01F27790; -const void * RTTI_hkbExpressionDataArray = (void *)0x01F277D8; -const void * RTTI_hkbEvaluateExpressionModifier = (void *)0x01F27808; -const void * RTTI_hkbEvaluateExpressionModifierInternalState = (void *)0x01F27840; -const void * RTTI_hkbEvaluateHandleModifier = (void *)0x01F27888; -const void * RTTI_hkbEventDrivenModifier = (void *)0x01F278B8; -const void * RTTI_hkbEventDrivenModifierInternalState = (void *)0x01F278E8; -const void * RTTI_hkbEventRangeDataArray = (void *)0x01F27928; -const void * RTTI_hkbEventsFromRangeModifier = (void *)0x01F27958; -const void * RTTI_hkbEventsFromRangeModifierInternalState = (void *)0x01F27990; -const void * RTTI_hkbFootIkControlsModifier = (void *)0x01F279D0; -const void * RTTI_hkbFootIkModifier = (void *)0x01F27A00; -const void * RTTI_hkbGetHandleOnBoneModifier = (void *)0x01F27A28; -const void * RTTI_hkbGetUpModifier = (void *)0x01F27A60; -const void * RTTI_hkbGetUpModifierInternalState = (void *)0x01F27A88; -const void * RTTI_hkbGetWorldFromModelModifier = (void *)0x01F27AC0; -const void * RTTI_hkbGetWorldFromModelModifierInternalState = (void *)0x01F27B00; -const void * RTTI_hkbHandIkControlsModifier = (void *)0x01F27B40; -const void * RTTI_hkbHandIkModifier = (void *)0x01F27B70; -const void * RTTI_hkbModifierList = (void *)0x01F27B98; -const void * RTTI_hkbLookAtModifier = (void *)0x01F27BC0; -const void * RTTI_hkbLookAtModifierInternalState = (void *)0x01F27BE8; -const void * RTTI_hkbMirrorModifier = (void *)0x01F27C20; -const void * RTTI_hkbMoveCharacterModifier = (void *)0x01F27C48; -const void * RTTI_hkbMoveCharacterModifierInternalState = (void *)0x01F27C78; -const void * RTTI_hkbProxyModifier = (void *)0x01F27CB8; -const void * RTTI_hkbExtractRagdollPoseModifier = (void *)0x01F27CE0; -const void * RTTI_hkbKeyframeBonesModifier = (void *)0x01F27D18; -const void * RTTI_hkbPoweredRagdollControlsModifier = (void *)0x01F27D48; -const void * RTTI_hkbRigidBodyRagdollControlsModifier = (void *)0x01F27D80; -const void * RTTI_hkbRotateCharacterModifier = (void *)0x01F27DC0; -const void * RTTI_hkbRotateCharacterModifierInternalState = (void *)0x01F27DF8; -const void * RTTI_hkbSenseHandleModifier = (void *)0x01F27E38; -const void * RTTI_hkbSetWorldFromModelModifier = (void *)0x01F27E68; -const void * RTTI_hkbTimerModifier = (void *)0x01F27EA0; -const void * RTTI_hkbTimerModifierInternalState = (void *)0x01F27EC8; -const void * RTTI_hkbTransformVectorModifier = (void *)0x01F27F00; -const void * RTTI_hkbTransformVectorModifierInternalState = (void *)0x01F27F38; -const void * RTTI_hkbTwistModifier = (void *)0x01F27F78; -const void * RTTI_hkbSequenceStringData = (void *)0x01F27FA0; -const void * RTTI_hkbEventSequencedData = (void *)0x01F27FD0; -const void * RTTI_hkbRealVariableSequencedData = (void *)0x01F28028; -const void * RTTI_hkbBoolVariableSequencedData = (void *)0x01F28060; -const void * RTTI_hkbIntVariableSequencedData = (void *)0x01F28098; -const void * RTTI_hkbSequenceInternalState = (void *)0x01F280D0; -const void * RTTI_hkbSequencedData = (void *)0x01F28000; -const void * RTTI_hkbStateMachine__TransitionInfoArray = (void *)0x01F28100; -const void * RTTI_hkbStateMachine__EventPropertyArray = (void *)0x01F28140; -const void * RTTI_hkbStateMachine__StateInfo = (void *)0x01F28180; -const void * RTTI_hkbStateMachineInternalState = (void *)0x01F281B0; -const void * RTTI_hkbBlendingTransitionEffect = (void *)0x01F281E8; -const void * RTTI_hkbBlendingTransitionEffectInternalState = (void *)0x01F28220; -const void * RTTI_hkbGeneratorTransitionEffect = (void *)0x01F28260; -const void * RTTI_hkbGeneratorTransitionEffectInternalState = (void *)0x01F282A0; -const void * RTTI_hkbClipGenerator = (void *)0x01F282E0; -const void * RTTI_hkbStateMachine = (void *)0x01F28308; -const void * RTTI_hkbAnimationBindingWithTriggers = (void *)0x01F28330; -const void * RTTI_hkbHandIkDriver = (void *)0x01F28368; -const void * RTTI_hkbAttachmentSceneModifier = (void *)0x01F28390; -const void * RTTI_hkbAttachmentFixupSceneModifier = (void *)0x01F283C8; -const void * RTTI_hkbRagdollSceneModifier = (void *)0x01F28400; -const void * RTTI_hkbCharacterControllerSceneModifier = (void *)0x01F28430; -const void * RTTI_hkbCharacterSetup = (void *)0x01F28470; -const void * RTTI_hkbProjectData = (void *)0x01F28498; -const void * RTTI_hkbCharacterData = (void *)0x01F284C0; -const void * RTTI_hkpCharacterControllerCinfo = (void *)0x01F284E8; -const void * RTTI_hkpCharacterProxyCinfo = (void *)0x01F28520; -const void * RTTI_hkLocalFrameCollector = (void *)0x01F28550; -const void * RTTI_hkbClosestLocalFrameCollector = (void *)0x01F28580; -const void * RTTI_hkbDefaultRaycastInterface = (void *)0x01F285B8; -const void * RTTI_hkbSymbolIdMap = (void *)0x01F285F0; -const void * RTTI_hkVtableClassRegistry = (void *)0x01F28618; -const void * RTTI_hkClassNameRegistry = (void *)0x01F28688; -const void * RTTI_hkTypeInfoRegistry = (void *)0x01F286B8; -const void * RTTI_hkBuiltinTypeRegistry = (void *)0x01F28728; -const void * RTTI_hkDynamicClassNameRegistry = (void *)0x01F28798; -const void * RTTI_hkDefaultClassNameRegistry = (void *)0x01F287D0; -const void * RTTI_hkDefaultBuiltinTypeRegistry = (void *)0x01F28858; -const void * RTTI_hkObjectCopier = (void *)0x01F28890; -const void * RTTI_hkStaticClassNameRegistry = (void *)0x01F288B8; -const void * RTTI_hkResourceContainer = (void *)0x01F288E8; -const void * RTTI_hkResourceMap = (void *)0x01F28940; -const void * RTTI_hkResourceBase = (void *)0x01F28918; -const void * RTTI_hkResourceHandle = (void *)0x01F28968; -const void * RTTI_hkMemoryResourceHandle = (void *)0x01F28990; -const void * RTTI_hkMemoryResourceContainer = (void *)0x01F289C0; -const void * RTTI_hkContainerResourceMap = (void *)0x01F289F0; -const void * RTTI_hkpShapeContainer = (void *)0x01F28A20; -const void * RTTI_hkpSingleShapeContainer = (void *)0x01F28A48; -const void * RTTI_hkpBvShape = (void *)0x01F28A78; -const void * RTTI_hkpConvexShape = (void *)0x01F28AA0; -const void * RTTI_hkpSphereRepShape = (void *)0x01F28AC8; -const void * RTTI_hkpBoxShape = (void *)0x01F28AF0; -const void * RTTI_hkpConvexTransformShapeBase = (void *)0x01F28B18; -const void * RTTI_hkpHeightFieldShape = (void *)0x01F28B50; -const void * RTTI_hkpPlaneShape = (void *)0x01F28B80; -const void * RTTI_hkpSphereShape = (void *)0x01F28BA8; -const void * RTTI_hkpCapsuleShape = (void *)0x01F28BD0; -const void * RTTI_hkpCollidableCollidableFilter = (void *)0x01F28C28; -const void * RTTI_hkpRayCollidableFilter = (void *)0x01F28CC8; -const void * RTTI_hkpShapeCollectionFilter = (void *)0x01F28C60; -const void * RTTI_hkpRayShapeCollectionFilter = (void *)0x01F28C90; -const void * RTTI_hkpGroupFilter = (void *)0x01F28CF8; -const void * RTTI_hkpCollisionFilter = (void *)0x01F28BF8; -const void * RTTI_hkpConvexListFilter = (void *)0x01F28D20; -const void * RTTI_hkpTriangleShape = (void *)0x01F28D50; -const void * RTTI_hkpDefaultConvexListFilter = (void *)0x01F28D78; -const void * RTTI_hkpBvTreeShape = (void *)0x01F28DB0; -const void * RTTI_hkpCollisionFilterList = (void *)0x01F28DD8; -const void * RTTI_hkpNullCollisionFilter = (void *)0x01F28E08; -const void * RTTI_hkpMoppModifier = (void *)0x01F28E38; -const void * RTTI_hkpRemoveTerminalsMoppModifier = (void *)0x01F28E60; -const void * RTTI_hkMoppBvTreeShapeBase = (void *)0x01F28E98; -const void * RTTI_hkpMoppBvTreeShape = (void *)0x01F28EC8; -const void * RTTI_hkpConvexTransformShape = (void *)0x01F28EF8; -const void * RTTI_hkpConvexTranslateShape = (void *)0x01F28F28; -const void * RTTI_hkpConvexVerticesConnectivity = (void *)0x01F28F58; -const void * RTTI_hkpConvexListShape = (void *)0x01F28F90; -const void * RTTI_hkpMultiSphereShape = (void *)0x01F28FC0; -const void * RTTI_hkpMultiRayShape = (void *)0x01F28FF0; -const void * RTTI_hkpTransformShape = (void *)0x01F29018; -const void * RTTI_hkpShapeInfo = (void *)0x01F29040; -const void * RTTI_hkpSampledHeightFieldShape = (void *)0x01F29068; -const void * RTTI_hkpCompressedSampledHeightFieldShape = (void *)0x01F290A0; -const void * RTTI_hkpStorageSampledHeightFieldShape = (void *)0x01F290E0; -const void * RTTI_hkpShapeCollection = (void *)0x01F29118; -const void * RTTI_hkpTriSampledHeightFieldCollection = (void *)0x01F29148; -const void * RTTI_hkpTriSampledHeightFieldBvTreeShape = (void *)0x01F29188; -const void * RTTI_hkpListShape = (void *)0x01F291C8; -const void * RTTI_hkpRemoveTerminalsMoppModifier2 = (void *)0x01F291F0; -const void * RTTI_hkpCylinderShape = (void *)0x01F29228; -const void * RTTI_hkpWorldObject = (void *)0x01ECC230; -const void * RTTI_hkpMotion = (void *)0x01F292C8; -const void * RTTI_hkpMaxSizeMotion = (void *)0x01F292E8; -const void * RTTI_hkpKeyframedRigidMotion = (void *)0x01F29310; -const void * RTTI_hkpEntity = (void *)0x01F29340; -const void * RTTI_hkpFixedRigidMotion = (void *)0x01F29360; -const void * RTTI_hkpSphereMotion = (void *)0x01F29390; -const void * RTTI_hkpBoxMotion = (void *)0x01F293B8; -const void * RTTI_hkpThinBoxMotion = (void *)0x01F293E0; -const void * RTTI_hkpCharacterMotion = (void *)0x01F29408; -const void * RTTI_hkpRigidBody = (void *)0x01F29438; -const void * RTTI_hkpPhantom = (void *)0x01ECC208; -const void * RTTI_hkpAabbPhantom = (void *)0x01ECC258; -const void * RTTI_hkpConstraintData = (void *)0x01F29460; -const void * RTTI_hkpPrismaticConstraintData = (void *)0x01F29488; -const void * RTTI_hkpAction = (void *)0x01EB7310; -const void * RTTI_hkpUnaryAction = (void *)0x01EB7460; -const void * RTTI_hkpConstraintInstance = (void *)0x01F294C0; -const void * RTTI_hkpConstraintMotor = (void *)0x01F294F0; -const void * RTTI_hkpConstraintListener = (void *)0x01F29520; -const void * RTTI_hkWorldMemoryAvailableWatchDog = (void *)0x01F29550; -const void * RTTI_hkpPhysicsSystem = (void *)0x01F29588; -const void * RTTI_hkpSimulation = (void *)0x01F295B0; -const void * RTTI_hkpPairCollisionFilter = (void *)0x01F295D8; -const void * RTTI_hkpConstraintCollisionFilter = (void *)0x01F29608; -const void * RTTI_hkpBallAndSocketConstraintData = (void *)0x01F29640; -const void * RTTI_hkpCogWheelConstraintData = (void *)0x01F29678; -const void * RTTI_hkpHingeConstraintData = (void *)0x01F296A8; -const void * RTTI_hkpLimitedHingeConstraintData = (void *)0x01F296D8; -const void * RTTI_hkpParametricCurve = (void *)0x01F29710; -const void * RTTI_hkpLinearParametricCurve = (void *)0x01F29740; -const void * RTTI_hkpPointToPathConstraintData = (void *)0x01F29770; -const void * RTTI_hkpPointToPlaneConstraintData = (void *)0x01F297A8; -const void * RTTI_hkpRackAndPinionConstraintData = (void *)0x01F297E0; -const void * RTTI_hkpRagdollConstraintData = (void *)0x01F29818; -const void * RTTI_hkpStiffSpringConstraintData = (void *)0x01F29848; -const void * RTTI_hkpWheelConstraintData = (void *)0x01F29880; -const void * RTTI_hkpRotationalConstraintData = (void *)0x01F298B0; -const void * RTTI_hkpHingeLimitsData = (void *)0x01F298E8; -const void * RTTI_hkpRagdollLimitsData = (void *)0x01F29918; -const void * RTTI_hkpConstraintChainInstanceAction = (void *)0x01F29948; -const void * RTTI_hkpConstraintChainInstance = (void *)0x01F29980; -const void * RTTI_hkpLimitedForceConstraintMotor = (void *)0x01F299B8; -const void * RTTI_hkpCallbackConstraintMotor = (void *)0x01F299F0; -const void * RTTI_hkpPositionConstraintMotor = (void *)0x01F29A28; -const void * RTTI_hkpSpringDamperConstraintMotor = (void *)0x01F29A60; -const void * RTTI_hkpVelocityConstraintMotor = (void *)0x01F29A98; -const void * RTTI_hkpPulleyConstraintData = (void *)0x01F29AD0; -const void * RTTI_hkpShapePhantom = (void *)0x01F29B00; -const void * RTTI_hkpCachingShapePhantom = (void *)0x01F29B28; -const void * RTTI_hkpSimpleShapePhantom = (void *)0x01F29B58; -const void * RTTI_hkpDefaultWorldMemoryWatchDog = (void *)0x01F29B88; -const void * RTTI_hkpWorld = (void *)0x01F29BC0; -const void * RTTI_hkpBroadPhaseCastCollector = (void *)0x01F29C08; -const void * RTTI_hkpContactMgr = (void *)0x01F29BE0; -const void * RTTI_hkpContactMgrFactory = (void *)0x01F29C40; -const void * RTTI_hkpNullContactMgr = (void *)0x01F29C70; -const void * RTTI_hkpNullContactMgrFactory = (void *)0x01F29C98; -const void * RTTI_hkpBroadPhaseListener = (void *)0x01F29CC8; -const void * RTTI_hkpSimpleWorldRayCaster = (void *)0x01F29CF8; -const void * RTTI_hkpWorldRayCaster = (void *)0x01F29D28; -const void * RTTI_hkpWorldLinearCaster = (void *)0x01F29D50; -const void * RTTI_hkpPhantomBroadPhaseListener = (void *)0x01F29D80; -const void * RTTI_hkpBroadPhaseBorderListener = (void *)0x01F29DB8; -const void * RTTI_hkpCollisionCallbackUtil = (void *)0x01F29DF0; -const void * RTTI_hkpConstraintOwner = (void *)0x01F29E48; -const void * RTTI_hkpBreakableConstraintData = (void *)0x01F29E78; -const void * RTTI_hkpConstraintChainData = (void *)0x01F29EB0; -const void * RTTI_hkpBallSocketChainData = (void *)0x01F29EE0; -const void * RTTI_hkpStiffSpringChainData = (void *)0x01F29F10; -const void * RTTI_hkpGenericConstraintData = (void *)0x01F29F40; -const void * RTTI_hkpMalleableConstraintData = (void *)0x01F29F70; -const void * RTTI_hkpEntityEntityBroadPhaseListener = (void *)0x01F29FA8; -const void * RTTI_hkpSimulationIsland = (void *)0x01F29FE0; -const void * RTTI_hkpBroadPhaseBorder = (void *)0x01F2A010; -const void * RTTI_hkpPhantomOverlapListener = (void *)0x01F2A070; -const void * RTTI_hkpWorldDeletionListener = (void *)0x01F2A040; -const void * RTTI_hkpSimpleConstraintContactMgr = (void *)0x01F2A0A0; -const void * RTTI_hkpSimpleContactConstraintData = (void *)0x01F2A108; -const void * RTTI_hkpDynamicsContactMgr = (void *)0x01F2A0D8; -const void * RTTI_hkpSimpleConstraintContactMgr__Factory = (void *)0x01F2A140; -const void * RTTI_hkpReportContactMgr = (void *)0x01F2A180; -const void * RTTI_hkpReportContactMgr__Factory = (void *)0x01F2A1B0; -const void * RTTI_hkpWorldMaintenanceMgr = (void *)0x01F2A1E8; -const void * RTTI_hkpDefaultWorldMaintenanceMgr = (void *)0x01F2A218; -const void * RTTI_hkpWorldExtension = (void *)0x01F29E20; -const void * RTTI_hkpEndOfStepCallbackUtil = (void *)0x01F2A250; -const void * RTTI_hkpConvexPieceStreamData = (void *)0x01F2A280; -const void * RTTI_hkpCharacterContext = (void *)0x01F2A2B0; -const void * RTTI_hkPackfileWriter__AddObjectListener = (void *)0x01F2A2E0; -const void * RTTI_hkpHavokSnapshot__ConvertListener = (void *)0x01F2A320; -const void * RTTI_hkpCharacterStateManager = (void *)0x01F2A358; -const void * RTTI_hkpCharacterRigidBody = (void *)0x01F2A388; -const void * RTTI_hkpMouseSpringAction = (void *)0x01F2A3B8; -const void * RTTI_hkpBinaryAction = (void *)0x01F2A3E8; -const void * RTTI_hkpAngularDashpotAction = (void *)0x01F2A410; -const void * RTTI_hkpDashpotAction = (void *)0x01F2A440; -const void * RTTI_hkpMotorAction = (void *)0x01F2A468; -const void * RTTI_hkpReorientAction = (void *)0x01F2A490; -const void * RTTI_hkpSpringAction = (void *)0x01F2A4B8; -const void * RTTI_hkpCharacterRigidBodyCinfo = (void *)0x01F2A4E0; -const void * RTTI_hkpPoweredChainMapper = (void *)0x01F2A518; -const void * RTTI_hkpConstrainedSystemFilter = (void *)0x01F2A548; -const void * RTTI_hkpDisableEntityCollisionFilter = (void *)0x01F2A580; -const void * RTTI_hkpGroupCollisionFilter = (void *)0x01F2A5B8; -const void * RTTI_hkpSerializedAgentNnEntry = (void *)0x01F2A5E8; -const void * RTTI_hkpPhysicsSystemWithContacts = (void *)0x01F2A618; -const void * RTTI_hkpSerializedDisplayMarker = (void *)0x01F2A650; -const void * RTTI_hkpSerializedDisplayMarkerList = (void *)0x01F2A688; -const void * RTTI_hkpSerializedDisplayRbTransforms = (void *)0x01F2A6C0; -const void * RTTI_hkpDisplayBindingData = (void *)0x01F2A6F8; -const void * RTTI_hkpDisplayBindingData__RigidBody = (void *)0x01F2A728; -const void * RTTI_hkpDisplayBindingData__PhysicsSystem = (void *)0x01F2A760; -const void * RTTI_hkpPhysicsData = (void *)0x01F2A7A0; -const void * RTTI_hkpCharacterProxy = (void *)0x01F2A7C8; -const void * RTTI_hkpTriggerVolume = (void *)0x01F2A7F0; -const void * RTTI_hkpFirstPersonGun = (void *)0x01F2A818; -const void * RTTI_hkpBallGun = (void *)0x01F2A840; -const void * RTTI_hkpGravityGun = (void *)0x01F2A868; -const void * RTTI_hkpMountedBallGun = (void *)0x01F2A890; -const void * RTTI_hkpProjectileGun = (void *)0x01F2A8B8; -const void * RTTI_hkpGunProjectile = (void *)0x01F2A8E0; -const void * RTTI_hkpSaveContactPointsUtil__EntitySelector = (void *)0x01F2A908; -const void * RTTI_BSLimbIKModifierCastInfo = (void *)0x01ECD5C0; -const void * RTTI_BSILimbIKModifierSingleton = (void *)0x01ECD620; -const void * RTTI_BGSGamebryoSequenceGenerator = (void *)0x01F2A9C0; -const void * RTTI_BSIStateManagerModifier__BSIStateManagerStateListener = (void *)0x01F2AA00; -const void * RTTI_BSSynchronizedClipGenerator = (void *)0x01F2AA50; -const void * RTTI_BSSynchronizedClipGenerator__hkbDefaultSynchronizedScene = (void *)0x01F2AA90; -const void * RTTI_BSIDirectAtModifierSingleton = (void *)0x01EEA3F0; -const void * RTTI_BSIPassByTargetTriggerModifierSingleton = (void *)0x01EEA668; -const void * RTTI_BSIRagdollContactListenerModifierSingleton = (void *)0x01EEA990; -const void * RTTI_BSRagdollContactListenerModifier = (void *)0x01F2AAE0; -const void * RTTI_BSIStateManagerModifier = (void *)0x01F2AB18; -const void * RTTI_BSBoneSwitchGenerator = (void *)0x01F2AB48; -const void * RTTI_BSBoneSwitchGeneratorBoneData = (void *)0x01F2AB78; -const void * RTTI_BSCyclicBlendTransitionGenerator = (void *)0x01F2ABB0; -const void * RTTI_BSOffsetAnimationGenerator = (void *)0x01F2ABE8; -const void * RTTI_BSiStateTaggingGenerator = (void *)0x01F2AC20; -const void * RTTI_BSComputeAddBoneAnimModifier = (void *)0x01F2AC50; -const void * RTTI_BSDecomposeVectorModifier = (void *)0x01F2AC88; -const void * RTTI_BSDirectAtModifier = (void *)0x01F2ACB8; -const void * RTTI_BSDistTriggerModifier = (void *)0x01F2ACE8; -const void * RTTI_BSEventEveryNEventsModifier = (void *)0x01F2AD18; -const void * RTTI_BSEventOnDeactivateModifier = (void *)0x01F2AD50; -const void * RTTI_BSEventOnFalseToTrueModifier = (void *)0x01F2AD88; -const void * RTTI_BSGetTimeStepModifier = (void *)0x01F2ADC0; -const void * RTTI_BSInterpValueModifier = (void *)0x01F2ADF0; -const void * RTTI_BSIsActiveModifier = (void *)0x01F2AE20; -const void * RTTI_BSLimbIKModifier = (void *)0x01F2AE50; -const void * RTTI_BSLookAtModifier = (void *)0x01F2AE78; -const void * RTTI_BSModifyOnceModifier = (void *)0x01F2AEA0; -const void * RTTI_BSPassByTargetTriggerModifier = (void *)0x01F2AED0; -const void * RTTI_BSSpeedSamplerModifier = (void *)0x01F2AF08; -const void * RTTI_BSTimerModifier = (void *)0x01F2AF38; -const void * RTTI_BSTweenerModifier = (void *)0x01F2AF60; -const void * RTTI_hkaAnimationBinding = (void *)0x01F2AF88; -const void * RTTI_BSSynchronizedClipGeneratorUtils__FindEventFunctor = (void *)0x01F2AFC0; -const void * RTTI_BSAnimationGraphManager = (void *)0x01F2B008; -const void * RTTI_hkLoader = (void *)0x01F2B408; -const void * RTTI_BShkbHkxDB__ProjectDBData = (void *)0x01F2B428; -const void * RTTI_BShkbHkxDB__DBData = (void *)0x01F2B458; -const void * RTTI_BShkbHkxDB__QueuedHandles = (void *)0x01ECCE10; -const void * RTTI_BShkbHkxDB__StreamAdaptor = (void *)0x01F2B968; -const void * RTTI_BSAnimationGraphLoadScrapper = (void *)0x01F2B998; -const void * RTTI_bhkIWorldStepListener = (void *)0x01F2B9D0; -const void * RTTI_hkaSkeleton = (void *)0x01F2BB50; -const void * RTTI_BSIRagdollDriver = (void *)0x01F2BB78; -const void * RTTI_BShkbAnimationGraph = (void *)0x01F2BBA0; -const void * RTTI_BSISpeedSamplerDB = (void *)0x01F2BCD0; -const void * RTTI_BSSpeedSamplerDBManager = (void *)0x01F2BCF8; -const void * RTTI_BShkVisibilityController = (void *)0x01F2BF18; -const void * RTTI_BShkbUtils__GraphInspectionFunctor = (void *)0x01F2C128; -const void * RTTI_hkbAssetLoader = (void *)0x01F2C160; -const void * RTTI_BShkbUtils__ProspectiveEventClipAddingFunctor = (void *)0x01F2C270; -const void * RTTI_IAnimationClipLoaderSingleton = (void *)0x01F2C330; -const void * RTTI_AnimationFileManagerSingleton = (void *)0x01F2C368; -const void * RTTI_hkaSkeletonMapper = (void *)0x01F2C5E0; -const void * RTTI_hkaRagdollInstance = (void *)0x01F2C608; -const void * RTTI_hkaDefaultAnimationControl = (void *)0x01F2C638; -const void * RTTI_hkaDefaultAnimationControlMapperData = (void *)0x01F2C6A0; -const void * RTTI_hkaAnimatedReferenceFrame = (void *)0x01F2C6E0; -const void * RTTI_hkaAnimation = (void *)0x01F2C710; -const void * RTTI_hkaInterleavedUncompressedAnimation = (void *)0x01F2C738; -const void * RTTI_hkaQuantizedAnimation = (void *)0x01F2C778; -const void * RTTI_hkaSplineCompressedAnimation = (void *)0x01F2C7A8; -const void * RTTI_hkaAnimationPreviewColorContainer = (void *)0x01F2C7E0; -const void * RTTI_hkaDefaultAnimatedReferenceFrame = (void *)0x01F2C818; -const void * RTTI_hkaFootstepAnalysisInfoContainer = (void *)0x01F2C850; -const void * RTTI_hkaBoneAttachment = (void *)0x01F2C888; -const void * RTTI_hkaAnimationContainer = (void *)0x01F2C8B0; -const void * RTTI_hkaMirroredSkeleton = (void *)0x01F2C8E0; -const void * RTTI_hkaAnimationControl = (void *)0x01F2C670; -const void * RTTI_hkpCollisionDispatcher = (void *)0x01F2C910; -const void * RTTI_hkpNullBroadPhaseListener = (void *)0x01F2C940; -const void * RTTI_hkpCollisionAgent = (void *)0x01F2C970; -const void * RTTI_hkpNullAgent = (void *)0x01F2C998; -const void * RTTI_hkp3AxisSweep = (void *)0x01F2C9C0; -const void * RTTI_hkpBroadPhase = (void *)0x01F2C9E8; -const void * RTTI_hkTraceStream = (void *)0x01F2CA10; -const void * RTTI_hkpStorageMeshShape = (void *)0x01F2CA70; -const void * RTTI_hkpStorageMeshShape__SubpartStorage = (void *)0x01F2CAC8; -const void * RTTI_hkpStorageExtendedMeshShape = (void *)0x01F2CB08; -const void * RTTI_hkpStorageExtendedMeshShape__MeshSubpartStorage = (void *)0x01F2CB70; -const void * RTTI_hkpStorageExtendedMeshShape__ShapeSubpartStorage = (void *)0x01F2CBC0; -const void * RTTI_hkTagfileWriter = (void *)0x01F2CC08; -const void * RTTI_hkTagfileWriter__AddDataObjectListener = (void *)0x01F2CC30; -const void * RTTI_hkTagfileReader = (void *)0x01F2CC70; -const void * RTTI_hkBinaryTagfileWriter = (void *)0x01F2CC98; -const void * RTTI_hkXmlTagfileReader = (void *)0x01F2CCC8; -const void * RTTI_hkXmlTagfileWriter = (void *)0x01F2CCF8; -const void * RTTI_hkpFastMeshShape = (void *)0x01F2CD68; -const void * RTTI_hkpMapPointsToSubShapeContactMgr = (void *)0x01F2CD90; -const void * RTTI_hkpPoweredChainData = (void *)0x01F2CDC8; -const void * RTTI_hkpConvexVerticesShape = (void *)0x01F2CDF8; -const void * RTTI_hkResource = (void *)0x01F2CE28; -const void * RTTI_BShkbUtils__SaveDataRestoreFunctor = (void *)0x01F2CE88; -const void * RTTI_hkpConstraintUtils__CollectConstraintsFilter = (void *)0x01F2CEF0; -const void * RTTI_hkpEaseConstraintsAction = (void *)0x01F2CF38; -const void * RTTI_hkpEaseConstraintsAction__CollectSupportedConstraints = (void *)0x01F2CF70; -const void * RTTI_hkpEasePenetrationAction = (void *)0x01F2CFC0; -const void * RTTI_BSiStateTaggingUtils__BSiStateTaggingStateListener = (void *)0x01F2CFF0; -const void * RTTI_hkxAnimatedFloat = (void *)0x01F2D070; -const void * RTTI_hkxAnimatedMatrix = (void *)0x01F2D098; -const void * RTTI_hkxAnimatedQuaternion = (void *)0x01F2D0C0; -const void * RTTI_hkxAnimatedVector = (void *)0x01F2D0F0; -const void * RTTI_hkxSparselyAnimatedBool = (void *)0x01F2D118; -const void * RTTI_hkxSparselyAnimatedInt = (void *)0x01F2D148; -const void * RTTI_hkxEnum = (void *)0x01F2D178; -const void * RTTI_hkxSparselyAnimatedEnum = (void *)0x01F2D198; -const void * RTTI_hkxSparselyAnimatedString = (void *)0x01F2D1C8; -const void * RTTI_hkxAttributeHolder = (void *)0x01F2D1F8; -const void * RTTI_hkxCamera = (void *)0x01F2D228; -const void * RTTI_hkxNode = (void *)0x01F2D248; -const void * RTTI_hkxLight = (void *)0x01F2D268; -const void * RTTI_hkxMaterial = (void *)0x01F2D288; -const void * RTTI_hkxMaterialEffect = (void *)0x01F2D2B0; -const void * RTTI_hkxMaterialShader = (void *)0x01F2D2D8; -const void * RTTI_hkxTextureFile = (void *)0x01F2D300; -const void * RTTI_hkxTextureInplace = (void *)0x01F2D328; -const void * RTTI_hkxEdgeSelectionChannel = (void *)0x01F2D350; -const void * RTTI_hkxTriangleSelectionChannel = (void *)0x01F2D380; -const void * RTTI_hkxVertexFloatDataChannel = (void *)0x01F2D3B8; -const void * RTTI_hkxVertexIntDataChannel = (void *)0x01F2D3E8; -const void * RTTI_hkxVertexSelectionChannel = (void *)0x01F2D418; -const void * RTTI_hkxVertexVectorDataChannel = (void *)0x01F2D448; -const void * RTTI_hkxIndexBuffer = (void *)0x01F2D480; -const void * RTTI_hkxMeshSection = (void *)0x01F2D4A8; -const void * RTTI_hkxMesh__UserChannelInfo = (void *)0x01F2D4D0; -const void * RTTI_hkxNodeSelectionSet = (void *)0x01F2D500; -const void * RTTI_hkxSkinBinding = (void *)0x01F2D530; -const void * RTTI_hkxScene = (void *)0x01F2D558; -const void * RTTI_hkaMeshBinding = (void *)0x01F2D578; -const void * RTTI_hkaFootstepAnalysisInfo = (void *)0x01F2D5A0; -const void * RTTI_hkpMeshShape = (void *)0x01F2CAA0; -const void * RTTI_hkpExtendedMeshShape = (void *)0x01F2CB40; -const void * RTTI_hkPackfileWriter = (void *)0x01F2D5D0; -const void * RTTI_hkIstream = (void *)0x01F2D5F8; -const void * RTTI_hkDataWorld = (void *)0x01F2D658; -const void * RTTI_hkDataObjectImpl = (void *)0x01F2D680; -const void * RTTI_hkDataArrayImpl = (void *)0x01F2D6D0; -const void * RTTI_hkDataClassImpl = (void *)0x01F2D6F8; -const void * RTTI_hkDataClassDict = (void *)0x01F2D720; -const void * RTTI_hkDataObjectDict = (void *)0x01F2D748; -const void * RTTI_hkDataWorldDict = (void *)0x01F2D770; -const void * RTTI_hkDataRefCounted = (void *)0x01F2D6A8; -const void * RTTI_VariableIntArrayImplementation = (void *)0x01F2D798; -const void * RTTI_ByteArrayImplementation = (void *)0x01F2D7D0; -const void * RTTI_ArrayOfTuplesImplementation = (void *)0x01F2D838; -const void * RTTI_ArrayOfTuplesImplementation__View = (void *)0x01F2D870; -const void * RTTI_RealArrayImplementation = (void *)0x01F2D8A8; -const void * RTTI_VecArrayImplementation = (void *)0x01F2D910; -const void * RTTI_PointerArrayImplementation = (void *)0x01F2D940; -const void * RTTI_CstringArrayImplementation = (void *)0x01F2D9D0; -const void * RTTI_StructArrayImplementation = (void *)0x01F2DA48; -const void * RTTI_StructArrayImplementation__Object = (void *)0x01F2DA78; -const void * RTTI_hkDataClassNative = (void *)0x01F2DAB0; -const void * RTTI_hkDataWorldNative = (void *)0x01F2DAD8; -const void * RTTI_hkDataObjectNative = (void *)0x01F2DB00; -const void * RTTI_hkDataArrayNative = (void *)0x01F2DB30; -const void * RTTI_hkBinaryTagfileReader = (void *)0x01F2DB58; -const void * RTTI_hkVersionPatchManager = (void *)0x01F2DB88; -const void * RTTI_hkSubStreamWriter = (void *)0x01F2DBF8; -const void * RTTI_hkBinaryPackfileWriter = (void *)0x01F2DC20; -const void * RTTI_hkPooledAllocator = (void *)0x01F2DC50; -const void * RTTI_hkTempDetectAllocator = (void *)0x01F2DC78; -const void * RTTI_hkSerializeDeprecated = (void *)0x01F2DCA8; -const void * RTTI_hkpPredGskfAgent = (void *)0x01F2DDA0; -const void * RTTI_hkpIterativeLinearCastAgent = (void *)0x01F2DD18; -const void * RTTI_hkpBoxBoxAgent = (void *)0x01F2DDC8; -const void * RTTI_hkpSymmetricAgentFlipCollector = (void *)0x01F2DDF0; -const void * RTTI_hkpSymmetricAgentFlipCastCollector = (void *)0x01F2DE28; -const void * RTTI_hkpSymmetricAgentFlipBodyCollector = (void *)0x01F2DE68; -const void * RTTI_hkpBvAgent = (void *)0x01F2DEA8; -const void * RTTI_hkpFlagCdBodyPairCollector = (void *)0x01F2DED0; -const void * RTTI_hkpSimpleClosestContactCollector = (void *)0x01F2DF08; -const void * RTTI_hkpBvTreeAgent = (void *)0x01F2DFC8; -const void * RTTI_hkpBvTreeStreamAgent = (void *)0x01F2E078; -const void * RTTI_hkpMoppAgent = (void *)0x01F2E220; -const void * RTTI_hkpPhantomAgent = (void *)0x01F2E2D8; -const void * RTTI_hkpSphereSphereAgent = (void *)0x01F2E300; -const void * RTTI_hkpSphereCapsuleAgent = (void *)0x01F2E330; -const void * RTTI_hkpSphereTriangleAgent = (void *)0x01F2E3B0; -const void * RTTI_hkpCapsuleCapsuleAgent = (void *)0x01F2E430; -const void * RTTI_hkpCapsuleTriangleAgent = (void *)0x01F2E460; -const void * RTTI_hkpSphereBoxAgent = (void *)0x01F2E4E0; -const void * RTTI_hkpMultiSphereTriangleAgent = (void *)0x01F2E560; -const void * RTTI_hkpMultiRayConvexAgent = (void *)0x01F2E5F8; -const void * RTTI_hkpTransformAgent = (void *)0x01F2E680; -const void * RTTI_hkpListAgent = (void *)0x01F2E740; -const void * RTTI_hkpConvexListAgent = (void *)0x01F2E7F8; -const void * RTTI_hkpShapeCollectionAgent = (void *)0x01F2E1F0; -const void * RTTI_hkpMultiSphereAgent = (void *)0x01F2E8C0; -const void * RTTI_hkpArrayAction = (void *)0x01F2CEC0; -const void * RTTI_hkAlignSceneToNodeOptions = (void *)0x01F2E990; -const void * RTTI_hkxEnvironment = (void *)0x01F2E9C0; -const void * RTTI_hkxMaterialShaderSet = (void *)0x01F2E9E8; -const void * RTTI_hkxVertexBuffer = (void *)0x01F2EA18; -const void * RTTI_hkxMesh = (void *)0x01F2EA40; -const void * RTTI_hkOffsetOnlyStreamWriter = (void *)0x01F2EA60; -const void * RTTI_hkObjectWriter = (void *)0x01F2EA90; -const void * RTTI_hkPlatformObjectWriter = (void *)0x01F2EAB8; -const void * RTTI_hkPlatformObjectWriter__Cache = (void *)0x01F2EAE8; -const void * RTTI_hkMemoryStreamReader = (void *)0x01F2EB20; -const void * RTTI_hkPackfileData = (void *)0x01F2EB50; -const void * RTTI_hkObjectResource = (void *)0x01F2EB78; -const void * RTTI_hkIArchive = (void *)0x01F2EBA0; -const void * RTTI_hkParserBuffer = (void *)0x01F2EBC8; -const void * RTTI_hkXmlStreamParser = (void *)0x01F2EBF0; -const void * RTTI_hkpGskBaseAgent = (void *)0x01F2DD50; -const void * RTTI_hkpGskfAgent = (void *)0x01F2DD78; -const void * RTTI_hkXmlLexAnalyzer = (void *)0x01F2EC18; -const void * RTTI_BSAudioManagerThread = (void *)0x01F2EC40; -const void * RTTI_AudioLoadForPlaybackTask = (void *)0x01F2EC70; -const void * RTTI_AudioLoadToCacheTask = (void *)0x01F2ECD8; -const void * RTTI_BSAudio = (void *)0x01F2ED08; -const void * RTTI_BSGameSound = (void *)0x01F2ED28; -const void * RTTI_BSNullImplAudio = (void *)0x01F2ED50; -const void * RTTI_BSAudioListener = (void *)0x01F2EF18; -const void * RTTI_BSNullImplAudioListener = (void *)0x01F2EF40; -const void * RTTI_BSNullImplGameSound = (void *)0x01F2EF70; -const void * RTTI_BSXAudio2Audio = (void *)0x01F2F008; -const void * RTTI_BSXAudio2AudioListener = (void *)0x01F2F288; -const void * RTTI_BSXAudio2GameSound = (void *)0x01F2F2E8; -const void * RTTI_BSXAudio2DataSrc = (void *)0x01F2F318; -const void * RTTI_ScrapHeap = (void *)0x01F2F380; -const void * RTTI_BSCoreMessage = (void *)0x01F2F3F0; -const void * RTTI_BSThread = (void *)0x01EAADC8; -const void * RTTI_CompactingStore__MoveCallback = (void *)0x01F2F418; -const void * RTTI_CompactingStore__NoopMoveCallback = (void *)0x01F2F450; -const void * RTTI_CompactingStore__Store = (void *)0x01F2F488; -const void * RTTI_MemoryHeap = (void *)0x01F2F4B8; -const void * RTTI_UnitTestMemoryHeap = (void *)0x01F2F530; -const void * RTTI_IMemoryHeap = (void *)0x01F2F508; -const void * RTTI_ZeroOverheadHeap = (void *)0x01F2F560; -const void * RTTI_UnitTestZeroOverheadHeap = (void *)0x01F2F588; -const void * RTTI_BSSmallBlockAllocator = (void *)0x01F2F5B8; -const void * RTTI_BSSmallBlockAllocatorUtil__UserPoolBase = (void *)0x01F2F5E8; -const void * RTTI_BSStepThread = (void *)0x01F2F628; -const void * RTTI_IMemoryStoreBase = (void *)0x01F2F3C8; -const void * RTTI_IMemoryStore = (void *)0x01F2F3A0; -const void * RTTI_AbstractHeap = (void *)0x01F2F4E0; -const void * RTTI_MouseMoveEvent = (void *)0x01F2F900; -const void * RTTI_CharEvent = (void *)0x01F2F928; -const void * RTTI_DeviceConnectEvent = (void *)0x01F2F948; -const void * RTTI_KinectEvent = (void *)0x01F2F978; -const void * RTTI_BSWin32GamerProfile = (void *)0x01F2F9A0; -const void * RTTI_BSIInputDevice = (void *)0x01F2FA38; -const void * RTTI_BSInputDevice = (void *)0x01F2FA60; -const void * RTTI_BSGamepadDevice = (void *)0x01F2FA88; -const void * RTTI_BSGamerProfile = (void *)0x01F2F9D0; -const void * RTTI_BSWin32KeyboardDevice = (void *)0x01F2FAF0; -const void * RTTI_BSWin32MouseDevice = (void *)0x01F2FB48; -const void * RTTI_BSPCGamepadDeviceDelegate = (void *)0x01F2FBA0; -const void * RTTI_BSPCGamepadDeviceHandler = (void *)0x01F2FBD0; -const void * RTTI_BSWin32GamepadDevice = (void *)0x01F2FC00; -const void * RTTI_BSPCOrbisGamepadDevice = (void *)0x01F2FC30; -const void * RTTI_BSKeyboardDevice = (void *)0x01F2FB20; -const void * RTTI_BSWin32VirtualKeyboardDevice = (void *)0x01F2FC60; -const void * RTTI_BSMouseDevice = (void *)0x01F2FB78; -const void * RTTI_BSVirtualKeyboardDevice = (void *)0x01F2FC98; -const void * RTTI_NiFile = (void *)0x01F2FCC8; -const void * RTTI_NiBinaryStream = (void *)0x01EB4B18; -const void * RTTI_NiAllocator = (void *)0x01F2FCE8; -const void * RTTI_BSNiAllocator = (void *)0x01F2FD10; -const void * RTTI_NiStandardAllocator = (void *)0x01F2FD38; -const void * RTTI_NiSearchPath = (void *)0x01F2FD68; -const void * RTTI_NiThread = (void *)0x01F2FD90; -const void * RTTI_BSStringPool__IterationCallback = (void *)0x01F2FDB0; -const void * RTTI_Archive = (void *)0x01F2FDE8; -const void * RTTI_ArchiveFile = (void *)0x01F2FE70; -const void * RTTI_CompressedArchiveFile = (void *)0x01F2FE98; -const void * RTTI_BSJobs__JobThread = (void *)0x01F2FEC8; -const void * RTTI_BSFile = (void *)0x01F2FE50; -const void * RTTI_BSSystemFileAsyncFunctor = (void *)0x01F2FEF0; -const void * RTTI_BSSystemFileStorage = (void *)0x01F2FF20; -const void * RTTI_BSTaskletGroupData = (void *)0x01F2FF50; -const void * RTTI_BSTaskletManagerCallback = (void *)0x01F2FF80; -const void * RTTI_BSTaskletManager = (void *)0x01F2FFB0; -const void * RTTI_BSSearchPath = (void *)0x01F2FFD8; -const void * RTTI_BSWin32TaskletManager = (void *)0x01F30000; -const void * RTTI_BSWin32TaskletGroupData = (void *)0x01F30030; -const void * RTTI_BSResource__StreamBase = (void *)0x01F30060; -const void * RTTI_BSResource__Stream = (void *)0x01F30090; -const void * RTTI_BSResource__AsyncStream = (void *)0x01F300B8; -const void * RTTI_BSResource__ArchiveStream = (void *)0x01F300E8; -const void * RTTI_BSResource__CacheArchiveOp = (void *)0x01F30118; -const void * RTTI_BSResource__CompressedArchiveStream = (void *)0x01F30148; -const void * RTTI_BSResource__ArchiveManager = (void *)0x01F30188; -const void * RTTI_BSResource__IEntryDB = (void *)0x01EADBA0; -const void * RTTI_BSResource__IEntryDB__PostFlushNotify = (void *)0x01EA8770; -const void * RTTI_BSResource__LocationTraverser = (void *)0x01F30258; -const void * RTTI_BSResource__CacheDrive = (void *)0x01F31238; -const void * RTTI_BSResource__CacheDrive__Impl = (void *)0x01F31268; -const void * RTTI_BSResource__CacheDrive__Task = (void *)0x01F312A0; -const void * RTTI_NiObject = (void *)0x01EAB338; -const void * RTTI_NiAVObject = (void *)0x01EAB380; -const void * RTTI_NiNode = (void *)0x01EAB648; -const void * RTTI_NiStream = (void *)0x01EAAD80; -const void * RTTI_NiStream__BackgroundLoadProcedure = (void *)0x01F313D0; -const void * RTTI_NiObjectNET = (void *)0x01EAB358; -const void * RTTI_NiLight = (void *)0x01F31B08; -const void * RTTI_NiSwitchNode = (void *)0x01F31B28; -const void * RTTI_NiStringsExtraData = (void *)0x01F31BC0; -const void * RTTI_NiCamera = (void *)0x01F31BF0; -const void * RTTI_BSTriShape = (void *)0x01EAF548; -const void * RTTI_BSSkinnedDecalTriShape = (void *)0x01F31C10; -const void * RTTI_NiTexture = (void *)0x01F31C40; -const void * RTTI_NiSourceTexture = (void *)0x01F31C60; -const void * RTTI_BSFlattenedBoneTree = (void *)0x01F31C88; -const void * RTTI_NiSkinInstance = (void *)0x01F31CB8; -const void * RTTI_BSDismemberSkinInstance = (void *)0x01F31CE0; -const void * RTTI_NiStringExtraData = (void *)0x01F31D10; -const void * RTTI_NiTimeController = (void *)0x01EB2490; -const void * RTTI_NiExtraData = (void *)0x01EAE178; -const void * RTTI_NiGeometryData = (void *)0x01F31D38; -const void * RTTI_BSGeometry = (void *)0x01EAF570; -const void * RTTI_BSDynamicTriShape = (void *)0x01EAF5C8; -const void * RTTI_NiPointLight = (void *)0x01F31D60; -const void * RTTI_NiAVObjectPalette = (void *)0x01F31D88; -const void * RTTI_NiDefaultAVObjectPalette = (void *)0x01F31DB0; -const void * RTTI_BSResourceNiBinaryStream = (void *)0x01F31DE0; -const void * RTTI_NiDirectionalLight = (void *)0x01F31EC0; -const void * RTTI_NiCullingProcess = (void *)0x01EB81E0; -const void * RTTI_NiParticles = (void *)0x01F31EF0; -const void * RTTI_NiSkinPartition = (void *)0x01F31F18; -const void * RTTI_NiVertWeightsExtraData = (void *)0x01F31F40; -const void * RTTI_NiGeometry = (void *)0x01F31F70; -const void * RTTI_NiSkinData = (void *)0x01F31F98; -const void * RTTI_NiShadeProperty = (void *)0x01F31FC0; -const void * RTTI_NiAlphaAccumulator = (void *)0x01F32010; -const void * RTTI_NiAmbientLight = (void *)0x01F32070; -const void * RTTI_NiBinaryExtraData = (void *)0x01F32098; -const void * RTTI_NiBooleanExtraData = (void *)0x01F320C0; -const void * RTTI_NiBSPNode = (void *)0x01F320F0; -const void * RTTI_NiColorExtraData = (void *)0x01F32110; -const void * RTTI_NiFloatExtraData = (void *)0x01F32138; -const void * RTTI_NiFloatsExtraData = (void *)0x01F32160; -const void * RTTI_NiFogProperty = (void *)0x01F32188; -const void * RTTI_NiIntegerExtraData = (void *)0x01F321B0; -const void * RTTI_NiIntegersExtraData = (void *)0x01F321E0; -const void * RTTI_NiParticlesData = (void *)0x01F322E8; -const void * RTTI_NiParticleMeshesData = (void *)0x01F32310; -const void * RTTI_NiParticleMeshes = (void *)0x01F32340; -const void * RTTI_NiSpotLight = (void *)0x01F32368; -const void * RTTI_NiSwitchStringExtraData = (void *)0x01F32390; -const void * RTTI_NiTriShapeData = (void *)0x01F323C0; -const void * RTTI_NiTriShape = (void *)0x01F32418; -const void * RTTI_NiTriStripsData = (void *)0x01F32468; -const void * RTTI_NiTriStrips = (void *)0x01F32490; -const void * RTTI_NiVectorExtraData = (void *)0x01F324B8; -const void * RTTI_BSLODTriShape = (void *)0x01F32558; -const void * RTTI_NiAdditionalGeometryData = (void *)0x01F32580; -const void * RTTI_BSSegmentedTriShape = (void *)0x01F325B0; -const void * RTTI_NiBackToFrontAccumulator = (void *)0x01F32040; -const void * RTTI_NiAccumulator = (void *)0x01F31FE8; -const void * RTTI_NiTriBasedGeomData = (void *)0x01F323E8; -const void * RTTI_NiTriBasedGeom = (void *)0x01F32440; -const void * RTTI_NiPick__Results = (void *)0x01F325E0; -const void * RTTI_NiCollisionTraversals__IFindIntersections = (void *)0x01F326B8; -const void * RTTI_NiCollisionData = (void *)0x01F326F8; -const void * RTTI_NiOBBRoot = (void *)0x01F32720; -const void * RTTI_NiBoundingVolume = (void *)0x01F32740; -const void * RTTI_NiBoxBV = (void *)0x01F32768; -const void * RTTI_NiCapsuleBV = (void *)0x01F32788; -const void * RTTI_NiHalfSpaceBV = (void *)0x01F327B0; -const void * RTTI_NiSphereBV = (void *)0x01F327D8; -const void * RTTI_NiUnionBV = (void *)0x01F32868; -const void * RTTI_NiOBBNode = (void *)0x01F328D8; -const void * RTTI_NiOBBLeaf = (void *)0x01F328F8; -const void * RTTI_NiIntersector = (void *)0x01F32918; -const void * RTTI_NiBoxSphereIntersector = (void *)0x01F32940; -const void * RTTI_NiBoxCapsuleIntersector = (void *)0x01F32970; -const void * RTTI_NiCapsuleCapsuleIntersector = (void *)0x01F329A0; -const void * RTTI_NiCapsuleSphereIntersector = (void *)0x01F329D8; -const void * RTTI_NiCapsuleTriIntersector = (void *)0x01F32A10; -const void * RTTI_NiSphereTriIntersector = (void *)0x01F32A40; -const void * RTTI_NiControllerManager = (void *)0x01F32A70; -const void * RTTI_NiControllerSequence = (void *)0x01EAD630; -const void * RTTI_NiTextKeyMatch = (void *)0x01F32B78; -const void * RTTI_NiMultiTargetTransformController = (void *)0x01F32BA0; -const void * RTTI_NiBlendInterpolator = (void *)0x01F32C08; -const void * RTTI_BSMultiTargetTreadTransfController = (void *)0x01F32C60; -const void * RTTI_NiInterpController = (void *)0x01F32BD8; -const void * RTTI_NiFloatInterpolator = (void *)0x01F32CA0; -const void * RTTI_NiColorInterpolator = (void *)0x01F32D00; -const void * RTTI_NiSingleInterpController = (void *)0x01F32D30; -const void * RTTI_NiTransformInterpolator = (void *)0x01F32D60; -const void * RTTI_NiPosData = (void *)0x01F32D90; -const void * RTTI_NiPathInterpolator = (void *)0x01F32DB0; -const void * RTTI_NiBlendTransformInterpolator = (void *)0x01F32DE0; -const void * RTTI_NiBlendFloatInterpolator = (void *)0x01F32E18; -const void * RTTI_NiFloatExtraDataController = (void *)0x01F32E48; -const void * RTTI_NiTransformController = (void *)0x01F32EB0; -const void * RTTI_NiBlendAccumTransformInterpolator = (void *)0x01F32EE0; -const void * RTTI_NiInterpolator = (void *)0x01F32C38; -const void * RTTI_BSBlendTreadTransfInterpolator = (void *)0x01F33010; -const void * RTTI_NiKeyBasedInterpolator = (void *)0x01F32CD0; -const void * RTTI_NiTransformData = (void *)0x01F33048; -const void * RTTI_NiBlendBoolInterpolator = (void *)0x01F33070; -const void * RTTI_NiBlendColorInterpolator = (void *)0x01F330A0; -const void * RTTI_NiBlendPoint3Interpolator = (void *)0x01F330D0; -const void * RTTI_NiBlendQuaternionInterpolator = (void *)0x01F33100; -const void * RTTI_NiBoolData = (void *)0x01F33138; -const void * RTTI_NiBoolInterpolator = (void *)0x01F33160; -const void * RTTI_NiBoolTimelineInterpolator = (void *)0x01F33190; -const void * RTTI_NiBSplineBasisData = (void *)0x01F331C8; -const void * RTTI_NiBSplineData = (void *)0x01F331F8; -const void * RTTI_NiBSplineColorInterpolator = (void *)0x01F33220; -const void * RTTI_NiBSplineCompColorInterpolator = (void *)0x01F33288; -const void * RTTI_NiBSplineCompFloatInterpolator = (void *)0x01F332C0; -const void * RTTI_NiBSplineCompPoint3Interpolator = (void *)0x01F33330; -const void * RTTI_NiBSplineCompTransformInterpolator = (void *)0x01F333A0; -const void * RTTI_NiBSplineFloatInterpolator = (void *)0x01F332F8; -const void * RTTI_NiBSplinePoint3Interpolator = (void *)0x01F33368; -const void * RTTI_NiBSplineTransformInterpolator = (void *)0x01F333E0; -const void * RTTI_NiColorExtraDataController = (void *)0x01F33418; -const void * RTTI_NiFloatsExtraDataController = (void *)0x01F33450; -const void * RTTI_NiFloatsExtraDataPoint3Controller = (void *)0x01F33488; -const void * RTTI_NiKeyframeManager = (void *)0x01F334C0; -const void * RTTI_NiLightColorController = (void *)0x01F33670; -const void * RTTI_NiLightDimmerController = (void *)0x01F336D0; -const void * RTTI_NiLookAtController = (void *)0x01F33730; -const void * RTTI_NiLookAtInterpolator = (void *)0x01F33760; -const void * RTTI_NiMorphData = (void *)0x01F33790; -const void * RTTI_NiPathController = (void *)0x01F337B8; -const void * RTTI_NiPoint3Interpolator = (void *)0x01F337E0; -const void * RTTI_NiQuaternionInterpolator = (void *)0x01F33810; -const void * RTTI_NiFloatController = (void *)0x01F33840; -const void * RTTI_NiRollController = (void *)0x01F33868; -const void * RTTI_NiRotData = (void *)0x01F33890; -const void * RTTI_NiSequence = (void *)0x01F338B0; -const void * RTTI_NiSequenceStreamHelper = (void *)0x01F339B8; -const void * RTTI_NiStringPalette = (void *)0x01F339E8; -const void * RTTI_NiTextKeyExtraData = (void *)0x01F33A10; -const void * RTTI_NiUVData = (void *)0x01F33A40; -const void * RTTI_NiVisController = (void *)0x01F33A60; -const void * RTTI_BSAnimNotes = (void *)0x01F33AB8; -const void * RTTI_BSAnimNote = (void *)0x01F33AE0; -const void * RTTI_BSGrabIKNote = (void *)0x01F33B08; -const void * RTTI_BSLookIKNote = (void *)0x01F33B30; -const void * RTTI_BSRotAccumTransfInterpolator = (void *)0x01F33B58; -const void * RTTI_BSTreadTransfInterpolator = (void *)0x01F33B90; -const void * RTTI_BSFrustumFOVController = (void *)0x01F33BC0; -const void * RTTI_NiExtraDataController = (void *)0x01F32E80; -const void * RTTI_NiBSplineInterpolator = (void *)0x01F33258; -const void * RTTI_NiPoint3InterpController = (void *)0x01F336A0; -const void * RTTI_NiFloatInterpController = (void *)0x01F33700; -const void * RTTI_NiBoolInterpController = (void *)0x01F33A88; -const void * RTTI_NiParticleSystem = (void *)0x01F33BF0; -const void * RTTI_NiPSysEmitterCtlr = (void *)0x01F33C18; -const void * RTTI_NiPSysGravityModifier = (void *)0x01F33C70; -const void * RTTI_BSPSysHavokUpdateModifier = (void *)0x01F33CC8; -const void * RTTI_NiMeshParticleSystem = (void *)0x01F33D28; -const void * RTTI_NiPSysCylinderEmitter = (void *)0x01F33D58; -const void * RTTI_BSStripParticleSystem = (void *)0x01F33DE0; -const void * RTTI_NiPSysEmitter = (void *)0x01F33DB8; -const void * RTTI_NiPSysModifierCtlr = (void *)0x01F33C40; -const void * RTTI_NiPSysModifier = (void *)0x01F33CA0; -const void * RTTI_NiPSysMeshUpdateModifier = (void *)0x01F33CF8; -const void * RTTI_NiPSysUpdateCtlr = (void *)0x01F33E10; -const void * RTTI_NiMeshPSysData = (void *)0x01F33E38; -const void * RTTI_NiPSysAirFieldAirFrictionCtlr = (void *)0x01F33F90; -const void * RTTI_NiPSysAirFieldInheritVelocityCtlr = (void *)0x01F33FF8; -const void * RTTI_NiPSysAirFieldModifier = (void *)0x01F34030; -const void * RTTI_NiPSysAirFieldSpreadCtlr = (void *)0x01F34090; -const void * RTTI_NiPSysAgeDeathModifier = (void *)0x01F340C0; -const void * RTTI_NiPSysBombModifier = (void *)0x01F340F0; -const void * RTTI_NiPSysBoundUpdateModifier = (void *)0x01F34120; -const void * RTTI_NiPSysBoxEmitter = (void *)0x01F34150; -const void * RTTI_NiPSysColliderManager = (void *)0x01F34178; -const void * RTTI_NiPSysColorModifier = (void *)0x01F341A8; -const void * RTTI_NiPSysData = (void *)0x01F33E60; -const void * RTTI_NiPSysDragFieldModifier = (void *)0x01F341D8; -const void * RTTI_NiPSysDragModifier = (void *)0x01F34208; -const void * RTTI_NiPSysEmitterCtlrData = (void *)0x01F34238; -const void * RTTI_NiPSysEmitterDeclinationCtlr = (void *)0x01F34268; -const void * RTTI_NiPSysEmitterDeclinationVarCtlr = (void *)0x01F342A0; -const void * RTTI_NiPSysEmitterInitialRadiusCtlr = (void *)0x01F342D8; -const void * RTTI_NiPSysEmitterLifeSpanCtlr = (void *)0x01F34310; -const void * RTTI_NiPSysEmitterPlanarAngleCtlr = (void *)0x01F34340; -const void * RTTI_NiPSysEmitterPlanarAngleVarCtlr = (void *)0x01F34378; -const void * RTTI_NiPSysEmitterSpeedCtlr = (void *)0x01F343B0; -const void * RTTI_NiPSysFieldAttenuationCtlr = (void *)0x01F343E0; -const void * RTTI_NiPSysFieldMagnitudeCtlr = (void *)0x01F34418; -const void * RTTI_NiPSysFieldMaxDistanceCtlr = (void *)0x01F34448; -const void * RTTI_NiPSysGravityFieldModifier = (void *)0x01F34480; -const void * RTTI_NiPSysGravityStrengthCtlr = (void *)0x01F344B8; -const void * RTTI_NiPSysGrowFadeModifier = (void *)0x01F344E8; -const void * RTTI_NiPSysInitialRotAngleCtlr = (void *)0x01F34518; -const void * RTTI_NiPSysInitialRotAngleVarCtlr = (void *)0x01F34548; -const void * RTTI_NiPSysInitialRotSpeedCtlr = (void *)0x01F34580; -const void * RTTI_NiPSysInitialRotSpeedVarCtlr = (void *)0x01F345B0; -const void * RTTI_NiPSysMeshEmitter = (void *)0x01F345E8; -const void * RTTI_NiPSysModifierActiveCtlr = (void *)0x01F34790; -const void * RTTI_NiPSysPlanarCollider = (void *)0x01F347F0; -const void * RTTI_NiPSysPositionModifier = (void *)0x01F34848; -const void * RTTI_NiPSysRadialFieldModifier = (void *)0x01F34878; -const void * RTTI_NiPSysResetOnLoopCtlr = (void *)0x01F348A8; -const void * RTTI_NiPSysRotationModifier = (void *)0x01F348D8; -const void * RTTI_NiPSysSpawnModifier = (void *)0x01F34908; -const void * RTTI_NiPSysSphereEmitter = (void *)0x01F34938; -const void * RTTI_NiPSysSphericalCollider = (void *)0x01F34968; -const void * RTTI_NiPSysTurbulenceFieldModifier = (void *)0x01F34998; -const void * RTTI_NiPSysVortexFieldModifier = (void *)0x01F349D0; -const void * RTTI_BSStripPSysData = (void *)0x01F34A00; -const void * RTTI_BSPSysRecycleBoundModifier = (void *)0x01F34A28; -const void * RTTI_BSPSysInheritVelocityModifier = (void *)0x01F34A60; -const void * RTTI_NiPSysVolumeEmitter = (void *)0x01F33D88; -const void * RTTI_NiPSysModifierFloatCtlr = (void *)0x01F33FC8; -const void * RTTI_NiPSysFieldModifier = (void *)0x01F34060; -const void * RTTI_NiPSysModifierBoolCtlr = (void *)0x01F347C0; -const void * RTTI_NiPSysCollider = (void *)0x01F34820; -const void * RTTI_BSTaskManager = (void *)0x01F34A98; -const void * RTTI_BSTaskManagerThread = (void *)0x01F34B58; -const void * RTTI_BSTaskThread = (void *)0x01EAB1D0; -const void * RTTI_IOManager = (void *)0x01F34BF0; -const void * RTTI_BSResource__IEntryDB__NotifyLoadDone = (void *)0x01F34C10; -const void * RTTI_QueuedFile = (void *)0x01EA8678; -const void * RTTI_QueuedNamedFile = (void *)0x01F34CA8; -const void * RTTI_BSQueuedResourceCollectionBase = (void *)0x01EA8738; -const void * RTTI_BSMultiBound = (void *)0x01F351A8; -const void * RTTI_BSMultiBoundRoom = (void *)0x01F351D0; -const void * RTTI_BSReference = (void *)0x01F35240; -const void * RTTI_BSNodeReferences = (void *)0x01F35268; -const void * RTTI_BSXFlags = (void *)0x01F35290; -const void * RTTI_BSValueNode = (void *)0x01F352B0; -const void * RTTI_ITextureDB = (void *)0x01F352D8; -const void * RTTI_BSTextureDB__QueuedHandles = (void *)0x01F357E8; -const void * RTTI_BSWindModifier = (void *)0x01F358D8; -const void * RTTI_BSTempNode = (void *)0x01F35900; -const void * RTTI_BSPortalGraph = (void *)0x01F35928; -const void * RTTI_BSPortalGraphEntry = (void *)0x01F35950; -const void * RTTI_BSOcclusionShape = (void *)0x01EAD130; -const void * RTTI_MessageHandler = (void *)0x01F35980; -const void * RTTI_BSRangeNode = (void *)0x01F359A8; -const void * RTTI_BSBlastNode = (void *)0x01F359D0; -const void * RTTI_BSDebrisNode = (void *)0x01F359F8; -const void * RTTI_BSDamageStage = (void *)0x01F35A20; -const void * RTTI_PArrayPoint = (void *)0x01F35A48; -const void * RTTI_BSPSysArrayEmitter = (void *)0x01F35A70; -const void * RTTI_BSInstanceTriShape = (void *)0x01F35B68; -const void * RTTI_BSMultiStreamInstanceTriShape = (void *)0x01F35B98; -const void * RTTI_BSIStream = (void *)0x01F35BD0; -const void * RTTI_BSOStream = (void *)0x01F35C60; -const void * RTTI_BSMultiBoundShape = (void *)0x01EAD270; -const void * RTTI_BSOcclusionBox = (void *)0x01F35CC8; -const void * RTTI_BSOcclusionPlane = (void *)0x01EAD178; -const void * RTTI_BSPortalSharedNode = (void *)0x01F35CF0; -const void * RTTI_BSBodyMorphOffsetsExtraData = (void *)0x01F35D20; -const void * RTTI_BSBehaviorGraphExtraData = (void *)0x01F35D58; -const void * RTTI_NiBSBoneLODController = (void *)0x01F35D88; -const void * RTTI_BSCullingProcess = (void *)0x01EB81B8; -const void * RTTI_BSParticleSystemManager = (void *)0x01F35F98; -const void * RTTI_BSFurnitureMarkerNode = (void *)0x01F35FC8; -const void * RTTI_BSBound = (void *)0x01F35FF8; -const void * RTTI_BSMultiBoundNode = (void *)0x01F351F8; -const void * RTTI_BSBoneMap = (void *)0x01F36018; -const void * RTTI_BSAnimInteractionMarker = (void *)0x01F36038; -const void * RTTI_BSSceneGraph = (void *)0x01ED4060; -const void * RTTI_BSPSysMultiTargetEmitterCtlr = (void *)0x01F36068; -const void * RTTI_BSSubIndexTriShape = (void *)0x01F360A0; -const void * RTTI_BSDistantObjectLargeRefExtraData = (void *)0x01F360D0; -const void * RTTI_BSMasterParticleSystem = (void *)0x01F36190; -const void * RTTI_BSProceduralLightningTasklet = (void *)0x01F361C0; -const void * RTTI_BSProceduralLightningController = (void *)0x01F361F8; -const void * RTTI_BSInvMarker = (void *)0x01F36270; -const void * RTTI_BSBoneLODExtraData = (void *)0x01F36298; -const void * RTTI_BSDecalPlacementVectorExtraData = (void *)0x01F362C8; -const void * RTTI_BSParentVelocityModifier = (void *)0x01F36300; -const void * RTTI_BSWArray = (void *)0x01F36330; -const void * RTTI_BSMultiBoundCapsule = (void *)0x01F36350; -const void * RTTI_BSPSysStripUpdateModifier = (void *)0x01F36380; -const void * RTTI_BSPSysSubTexModifier = (void *)0x01F363B0; -const void * RTTI_BSPSysScaleModifier = (void *)0x01F363E0; -const void * RTTI_BSLagBoneController = (void *)0x01F36410; -const void * RTTI_BSNonUniformScaleExtraData = (void *)0x01F36440; -const void * RTTI_BSNiNode = (void *)0x01F35220; -const void * RTTI_BSTableCurve = (void *)0x01F36478; -const void * RTTI_bhkWorldObject = (void *)0x01EAEA40; -const void * RTTI_bhkTaskletManagerCallback = (void *)0x01F364A0; -const void * RTTI_bhkOnStartupCallback = (void *)0x01F364D0; -const void * RTTI_bhkOnExitCallback = (void *)0x01F36500; -const void * RTTI_ahkpWorld = (void *)0x01F36528; -const void * RTTI_bhkWorld__bhkConstraintProjector = (void *)0x01F36548; -const void * RTTI_bhkWorld = (void *)0x01F36580; -const void * RTTI_bhkWorldCinfo = (void *)0x01F365A0; -const void * RTTI_hkGenericConstraintCinfo = (void *)0x01F365C8; -const void * RTTI_hkStiffSpringConstraintCinfo = (void *)0x01F365F8; -const void * RTTI_bhkStiffSpringConstraint = (void *)0x01F36630; -const void * RTTI_hkBallAndSocketConstraintCinfo = (void *)0x01F36660; -const void * RTTI_hkFixedConstraintCinfo = (void *)0x01F36698; -const void * RTTI_bhkWindListener = (void *)0x01EB1828; -const void * RTTI_hkpAllRayHitCollector = (void *)0x01F366C8; -const void * RTTI_bhkRagdollPenetrationUtil = (void *)0x01F366F8; -const void * RTTI_hkaRagdollRaycastInterface = (void *)0x01F36728; -const void * RTTI_hkpCharacterState = (void *)0x01F36760; -const void * RTTI_bhkCharacterState = (void *)0x01F36788; -const void * RTTI_bhkShapeCollection = (void *)0x01F367B0; -const void * RTTI_bhkCharacterController = (void *)0x01F367E0; -const void * RTTI_bhkCollisionBox = (void *)0x01F36858; -const void * RTTI_bhkICharOrientationController = (void *)0x01F36880; -const void * RTTI_bhkCharacterControllerCinfo = (void *)0x01F368B8; -const void * RTTI_bhkCharacterStateClimbing = (void *)0x01F368F0; -const void * RTTI_bhkCharacterStateFlying = (void *)0x01F36920; -const void * RTTI_bhkListShape = (void *)0x01F36950; -const void * RTTI_bhkNiCollisionObject = (void *)0x01EAEA90; -const void * RTTI_bhkRagdollShareData = (void *)0x01F36978; -const void * RTTI_bhkRagdollController = (void *)0x01F369A8; -const void * RTTI_bhkCollisionFilter = (void *)0x01F369D8; -const void * RTTI_bhkAttachmentCollisionObject = (void *)0x01F36BD0; -const void * RTTI_bhkLimitedHingeConstraint = (void *)0x01F36C38; -const void * RTTI_WeaponObject = (void *)0x01F36C68; -const void * RTTI_hkLimitedHingeConstraintCinfo = (void *)0x01F36C90; -const void * RTTI_bhkRigidBodyT = (void *)0x01F36CC8; -const void * RTTI_bhkWorldM = (void *)0x01F36CF0; -const void * RTTI_bhkRefObject = (void *)0x01EB1B00; -const void * RTTI_hkNiTriStripsShape = (void *)0x01F36DC8; -const void * RTTI_hkNormalTriangleShape = (void *)0x01F36DF8; -const void * RTTI_hkPackedNiTriStripsData = (void *)0x01F36E28; -const void * RTTI_hkPackedNiTriStripsShape = (void *)0x01F36E58; -const void * RTTI_bhkCapsuleShape = (void *)0x01F36E88; -const void * RTTI_bhkNiTriStripsShape = (void *)0x01F36EB0; -const void * RTTI_bhkPackedNiTriStripsShape = (void *)0x01F36EE0; -const void * RTTI_bhkBlendCollisionObject = (void *)0x01F36C08; -const void * RTTI_hkAvoidBox = (void *)0x01F36F10; -const void * RTTI_bhkAvoidBox = (void *)0x01F36F38; -const void * RTTI_ahkpMalleableConstraintData = (void *)0x01F36F60; -const void * RTTI_bhkMalleableConstraint = (void *)0x01F36F98; -const void * RTTI_hkMalleableConstraintCinfo = (void *)0x01F36FC8; -const void * RTTI_hkBSHeightFieldShape = (void *)0x01F37040; -const void * RTTI_hkProductFeatures = (void *)0x01F37070; -const void * RTTI_bhkCachingShapePhantom = (void *)0x01F37390; -const void * RTTI_hkpCharacterProxyListener = (void *)0x01F373C0; -const void * RTTI_bhkCharacterProxyCinfo = (void *)0x01F373F0; -const void * RTTI_bhkCharacterProxy = (void *)0x01F37420; -const void * RTTI_bhkCharProxyController = (void *)0x01F37448; -const void * RTTI_bhkCharProxyControllerCinfo = (void *)0x01F37478; -const void * RTTI_hkpCharacterRigidBodyListener = (void *)0x01F374B0; -const void * RTTI_bhkCharacterRigidBodyCinfo = (void *)0x01F374E8; -const void * RTTI_bhkCharacterRigidBody = (void *)0x01F37520; -const void * RTTI_bhkCharRigidBodyControllerCinfo = (void *)0x01F37550; -const void * RTTI_bhkCharRigidBodyController = (void *)0x01F37588; -const void * RTTI_bhkBallAndSocketConstraint = (void *)0x01F375C0; -const void * RTTI_bhkRagdollTemplateData = (void *)0x01F375F8; -const void * RTTI_bhkRagdollTemplate = (void *)0x01F37628; -const void * RTTI_hkRagdollConstraintCinfo = (void *)0x01F37658; -const void * RTTI_bhkRagdollConstraint = (void *)0x01F37688; -const void * RTTI_hkpSafeEaseConstraintsAction = (void *)0x01F376B8; -const void * RTTI_bhkBipedOrientationController = (void *)0x01F376F0; -const void * RTTI_hkThreadMemory = (void *)0x01F37970; -const void * RTTI_bhkMemorySystem = (void *)0x01F37998; -const void * RTTI_hkpSuspendInactiveAgentsUtil = (void *)0x01F379C0; -const void * RTTI_bhkCompressedMeshShapeData = (void *)0x01F37A68; -const void * RTTI_bhkCompressedMeshShape = (void *)0x01F37AA0; -const void * RTTI_bhkConvexSweepShape = (void *)0x01F37B40; -const void * RTTI_bhkConvexTransformShape = (void *)0x01F37B70; -const void * RTTI_bhkConvexTranslateShape = (void *)0x01F37BA0; -const void * RTTI_bhkConvexVerticesShape = (void *)0x01F37BD0; -const void * RTTI_bhkCylinderShape = (void *)0x01F37C00; -const void * RTTI_bhkMultiSphereShape = (void *)0x01F37C28; -const void * RTTI_bhkHeightFieldShape = (void *)0x01F37C58; -const void * RTTI_bhkPlaneShape = (void *)0x01F37C88; -const void * RTTI_bhkTriangleShape = (void *)0x01F37CB0; -const void * RTTI_hkScaledMoppBvTreeShape = (void *)0x01F37CD8; -const void * RTTI_bhkMoppBvTreeShape = (void *)0x01F37D08; -const void * RTTI_bhkTransformShape = (void *)0x01F37D38; -const void * RTTI_hkConstraintChainCinfo = (void *)0x01F37D60; -const void * RTTI_bhkConstraintChain = (void *)0x01F37D90; -const void * RTTI_hkBallSocketChainCinfo = (void *)0x01F37DC0; -const void * RTTI_bhkBallSocketConstraintChain = (void *)0x01F37DF0; -const void * RTTI_bhkGroupConstraint = (void *)0x01F37E28; -const void * RTTI_hkHingeLimitsConstraintCinfo = (void *)0x01F37E58; -const void * RTTI_bhkHingeLimitsConstraint = (void *)0x01F37E90; -const void * RTTI_bhkGenericConstraint = (void *)0x01F37EC0; -const void * RTTI_bhkFixedConstraint = (void *)0x01F37EF0; -const void * RTTI_hkRagdollLimitsConstraintCinfo = (void *)0x01F37F20; -const void * RTTI_bhkRagdollLimitsConstraint = (void *)0x01F37F58; -const void * RTTI_hkWheelConstraintCinfo = (void *)0x01F37F90; -const void * RTTI_bhkWheelConstraint = (void *)0x01F37FC0; -const void * RTTI_ahkpBreakableConstraintData = (void *)0x01F37FF0; -const void * RTTI_hkBreakableConstraintCinfo = (void *)0x01F38028; -const void * RTTI_bhkBreakableConstraint = (void *)0x01F38060; -const void * RTTI_bhkBinaryAction = (void *)0x01F38090; -const void * RTTI_bhkAngularDashpotAction = (void *)0x01F380B8; -const void * RTTI_bhkDashpotAction = (void *)0x01F380E8; -const void * RTTI_bhkLiquidAction = (void *)0x01F38110; -const void * RTTI_bhkMotorAction = (void *)0x01F38138; -const void * RTTI_bhkOrientHingedBodyAction = (void *)0x01F38160; -const void * RTTI_bhkSpringAction = (void *)0x01F38190; -const void * RTTI_bhkBlendController = (void *)0x01F381B8; -const void * RTTI_bhkExtraData = (void *)0x01F381E8; -const void * RTTI_bhkPoseArray = (void *)0x01F38210; -const void * RTTI_hkaDetectRagdollPenetration = (void *)0x01F38238; -const void * RTTI_bhkCharacterStateInAir = (void *)0x01F38270; -const void * RTTI_bhkCharacterStateJumping = (void *)0x01F382A0; -const void * RTTI_bhkCharacterStateOnGround = (void *)0x01F382D0; -const void * RTTI_bhkCharacterStateSwimming = (void *)0x01F38300; -const void * RTTI_hkCharControllerShape = (void *)0x01F38330; -const void * RTTI_bhkCharControllerShape = (void *)0x01F38360; -const void * RTTI_bhkQuadOrientationController = (void *)0x01F38390; -const void * RTTI_hkPointToPathConstraintCinfo = (void *)0x01F38408; -const void * RTTI_bhkPositionConstraintMotor = (void *)0x01F38440; -const void * RTTI_bhkVelocityConstraintMotor = (void *)0x01F38478; -const void * RTTI_bhkSpringDamperConstraintMotor = (void *)0x01F384B0; -const void * RTTI_hkbCameraShakeEventPayload = (void *)0x01F384E8; -const void * RTTI_hkbParticleSystemEventPayload = (void *)0x01F38520; -const void * RTTI_hkbStateChooser = (void *)0x01F38558; -const void * RTTI_hkbTestStateChooser = (void *)0x01F38580; -const void * RTTI_hkbSimulationControlCommand = (void *)0x01F385B0; -const void * RTTI_hkbCharacterControlCommand = (void *)0x01F385E8; -const void * RTTI_hkbRaiseEventCommand = (void *)0x01F38620; -const void * RTTI_hkbSetWordVariableCommand = (void *)0x01F38650; -const void * RTTI_hkbSetLocalTimeOfClipGeneratorCommand = (void *)0x01F38680; -const void * RTTI_hkbSetBehaviorCommand = (void *)0x01F386C0; -const void * RTTI_hkbSetNodePropertyCommand = (void *)0x01F386F0; -const void * RTTI_hkbCharacterAddedInfo = (void *)0x01F38720; -const void * RTTI_hkbCharacterInfo = (void *)0x01F38750; -const void * RTTI_hkbCharacterSteppedInfo = (void *)0x01F38778; -const void * RTTI_hkbCharacterSkinInfo = (void *)0x01F387A8; -const void * RTTI_hkbBehaviorInfo = (void *)0x01F387D8; -const void * RTTI_hkbBehaviorEventsInfo = (void *)0x01F38800; -const void * RTTI_hkbEventRaisedInfo = (void *)0x01F38830; -const void * RTTI_hkbSimulationStateInfo = (void *)0x01F38860; -const void * RTTI_hkbLinkedSymbolInfo = (void *)0x01F38890; -const void * RTTI_hkbAuxiliaryNodeInfo = (void *)0x01F388C0; -const void * RTTI_hkbBehaviorGraphInternalStateInfo = (void *)0x01F388F0; -const void * RTTI_hkpHeightFieldAgent = (void *)0x01F38928; -const void * RTTI_hkHeightFieldRayForwardingCollector = (void *)0x01F38A00; -const void * RTTI_hkpContinuousSimulation = (void *)0x01F38A40; -const void * RTTI_hkpMultiThreadedSimulation = (void *)0x01F38A70; -const void * RTTI_hkpMultiThreadedSimulation__MtEntityEntityBroadPhaseListener = (void *)0x01F38AB0; -const void * RTTI_hkpMultiThreadedSimulation__MtPhantomBroadPhaseListener = (void *)0x01F38B10; -const void * RTTI_hkpMultiThreadedSimulation__MtBroadPhaseBorderListener = (void *)0x01F38B60; -const void * RTTI_bhkCharacterPointCollector = (void *)0x01F38BB0; -const void * RTTI_ahkpCharacterProxy = (void *)0x01F38C40; -const void * RTTI_ahkpCharacterRigidBody = (void *)0x01F38C70; -const void * RTTI_hkSolverAllocator = (void *)0x01F38CA0; -const void * RTTI_bhkThreadMemorySource = (void *)0x01F38CC8; -const void * RTTI_hkJobThreadPool = (void *)0x01F38CF8; -const void * RTTI_hkCpuJobThreadPool = (void *)0x01F38D20; -const void * RTTI_hkpCompressedMeshShape = (void *)0x01F37B10; -const void * RTTI_hkLiquidAction = (void *)0x01F38DD0; -const void * RTTI_hkOrientHingedBodyAction = (void *)0x01F38DF8; -const void * RTTI_hkgpConvexHull = (void *)0x01F38E28; -const void * RTTI_bhkPointToPathConstraint = (void *)0x01F38EC8; -const void * RTTI_hkRemoteObjectClientSideListener = (void *)0x01F38EF8; -const void * RTTI_hkbBehaviorClient = (void *)0x01F38F30; -const void * RTTI_hkbClientCharacterState = (void *)0x01F38F58; -const void * RTTI_hkpToiResourceMgr = (void *)0x01F38F88; -const void * RTTI_hkpDefaultToiResourceMgr = (void *)0x01F38FB0; -const void * RTTI_hkpDeferredConstraintOwner = (void *)0x01F38FE0; -const void * RTTI_hkgpIndexedMesh = (void *)0x01F39018; -const void * RTTI_hkpMoppMediator = (void *)0x01F39040; -const void * RTTI_hkpMoppShapeMediator = (void *)0x01F39068; -const void * RTTI_hkpMoppCachedShapeMediator = (void *)0x01F39098; -const void * RTTI_hkpMoppCostFunction = (void *)0x01F390D0; -const void * RTTI_hkGeometryProcessingInternals__NearestFeaturePolicy = (void *)0x01F39270; -const void * RTTI_hkProcess = (void *)0x01F39330; -const void * RTTI_hkRemoteObjectProcess = (void *)0x01F39350; -const void * RTTI_hkKdTreeCastCollector = (void *)0x01F39380; -const void * RTTI_hkCpuWorldGetClosestPointsCollector = (void *)0x01F393B0; -const void * RTTI_hkCpuWorldLinearCastCollector = (void *)0x01F39450; -const void * RTTI_hkpFixedBufferRayHitCollector = (void *)0x01F394F0; -const void * RTTI_hkCpuWorldRayCastCollector = (void *)0x01F39528; -const void * RTTI_hkpSimpleMeshShape = (void *)0x01F39560; -const void * RTTI_hkpMoppNodeMgr = (void *)0x01F39590; -const void * RTTI_hkpMoppSplitter = (void *)0x01F395B8; -const void * RTTI_hkpMoppDefaultSplitter = (void *)0x01F395E0; -const void * RTTI_hkpMoppCodeGenerator = (void *)0x01F39610; -const void * RTTI_hkpMoppAssembler = (void *)0x01F39640; -const void * RTTI_hkpMoppDefaultAssembler = (void *)0x01F39668; -const void * RTTI_hkgpTriangulatorBase = (void *)0x01F3A018; -const void * RTTI_hkgpJobQueue__IJob = (void *)0x01F3A188; -const void * RTTI_hkgpMesh = (void *)0x01F3A1B0; -const void * RTTI_hkgpMesh__IConvexOverlap = (void *)0x01F3A240; -const void * RTTI_hkgpMesh__IConvexOverlap__IConvexShape = (void *)0x01F3A270; -const void * RTTI_hkgpMesh__TriangleShape = (void *)0x01F3A2B0; -const void * RTTI_hkgpMesh__ExternShape = (void *)0x01F3A2E0; -const void * RTTI_hkgpMesh__CollideShapeTriangle = (void *)0x01F3A310; -const void * RTTI_hkgpMesh__NearestFeaturePolicy = (void *)0x01F3A348; -const void * RTTI_hkGskShape = (void *)0x01F3A380; -const void * RTTI_hkgpMeshInternals__SimpleCollector = (void *)0x01F3A538; -const void * RTTI_hkgpMeshInternals__TriangleOverlap = (void *)0x01F3A570; -const void * RTTI_hkgpMeshInternals__RayCaster = (void *)0x01F3A5A8; -const void * RTTI_IConvexOverlapImpl = (void *)0x01F3A5E0; -const void * RTTI_IConvexOverlapImpl__ShapeBridge = (void *)0x01F3A610; -const void * RTTI_hkProcessFactory = (void *)0x01F3A6A8; -const void * RTTI_hkKdTreeBundleCastCollector = (void *)0x01F3A708; -const void * RTTI_hkKdTreeBuildInput__Mediator = (void *)0x01F3A740; -const void * RTTI_hkpCollidableMediator = (void *)0x01F3A778; -const void * RTTI_hkKdTreeCpuBroadphaseBundleCastCollector = (void *)0x01F3A7A8; -const void * RTTI_BSUIScaleformData = (void *)0x01F3A7E8; -const void * RTTI_IMenu = (void *)0x01ECE7C0; -const void * RTTI_GSysAllocBase = (void *)0x01F3ABF8; -const void * RTTI_GSysAllocPaged = (void *)0x01F3AC20; -const void * RTTI_GSysMemoryMap = (void *)0x01F3AC48; -const void * RTTI_GFxLog = (void *)0x01F3AC70; -const void * RTTI_GFxTranslator = (void *)0x01F3AD40; -const void * RTTI_GFxZlibSupportBase = (void *)0x01F3AD68; -const void * RTTI_GFxState = (void *)0x01F3AC90; -const void * RTTI_GFxZlibSupport = (void *)0x01F3AD98; -const void * RTTI_BSScaleformTranslator = (void *)0x01F3ADC0; -const void * RTTI_BSStreamParserData = (void *)0x01F3ADF0; -const void * RTTI_BSResourceStreamParser = (void *)0x01F3AE20; -const void * RTTI_GFile = (void *)0x01F3B148; -const void * RTTI_GMemoryFile = (void *)0x01F3B1C8; -const void * RTTI_GFxFileOpenerBase = (void *)0x01F3B1F0; -const void * RTTI_BSScaleformFileOpener = (void *)0x01F3B218; -const void * RTTI_ScaleformFile__MemoryFile = (void *)0x01F3B758; -const void * RTTI_IDebugText = (void *)0x01F3B788; -const void * RTTI_DebugText = (void *)0x01F3B7B0; -const void * RTTI_GFxExternalInterface = (void *)0x01F3B7D0; -const void * RTTI_FxDelegate = (void *)0x01F3B800; -const void * RTTI_FxDelegateHandler__CallbackProcessor = (void *)0x01F3B828; -const void * RTTI_AddCallbackVisitor = (void *)0x01F3B868; -const void * RTTI_RemoveCallbackVisitor = (void *)0x01F3B898; -const void * RTTI_GFxImageLoader = (void *)0x01F3B8C8; -const void * RTTI_BSScaleformImageLoader = (void *)0x01F3B8F0; -const void * RTTI_BSScaleformMovieLoadTask = (void *)0x01F3B920; -const void * RTTI_MoviePlayer = (void *)0x01ED2BD0; -const void * RTTI_BSMusicManager = (void *)0x01F3B980; -const void * RTTI_ITrianglePathSplitter = (void *)0x01F3BB90; -const void * RTTI_IPathSmootherRayCast = (void *)0x01F3BBC0; -const void * RTTI_FindTriangleForLocationWaterFilter = (void *)0x01F3BBF0; -const void * RTTI_BSPathing = (void *)0x01EC6998; -const void * RTTI_BSPathing__EdgeFoundVisitor = (void *)0x01F3BC30; -const void * RTTI_TrianglePathWaterAndLedgeSplitter = (void *)0x01F3BC68; -const void * RTTI_BSNavmeshInfoSearch = (void *)0x01F3BDB0; -const void * RTTI_BSPrecomputedNavmeshInfoSearch = (void *)0x01F3BEC8; -const void * RTTI_IMovementSetState = (void *)0x01F3C0F8; -const void * RTTI_IMovementQueryState = (void *)0x01F3C120; -const void * RTTI_MovementAgentActorState = (void *)0x01F3C150; -const void * RTTI_IPathBuilderTracker = (void *)0x01F3C388; -const void * RTTI_BSPathingRequest = (void *)0x01EC6B48; -const void * RTTI_NullPathBuilderTracker = (void *)0x01F3C3B8; -const void * RTTI_IPipelineStageInterface = (void *)0x01ED8D98; -const void * RTTI_IMovementPlannerAgent = (void *)0x01EDA0E8; -const void * RTTI_IMovementPathManagerAgent = (void *)0x01F3C660; -const void * RTTI_IMovementQueryPathFollowing = (void *)0x01F3C690; -const void * RTTI_IMovementQueryPathFollowing__INodeVisitor = (void *)0x01F3C6C8; -const void * RTTI_IMovementSetPathFollowing = (void *)0x01F3C708; -const void * RTTI_IMovementPlayIdleResult = (void *)0x01F3C738; -const void * RTTI_IPathFollowerAction = (void *)0x01F3C768; -const void * RTTI_ISelectIdleFilter = (void *)0x01F3C798; -const void * RTTI_ICheckEndReachedFunctorMapper = (void *)0x01F3C7C0; -const void * RTTI_IMovementHandlerAgent = (void *)0x01ED8E58; -const void * RTTI_CheckParameterReachedFunctor = (void *)0x01F3C7F8; -const void * RTTI_CheckGoalReachedFunctor = (void *)0x01F3C860; -const void * RTTI_CheckStoppedMovingFunctor = (void *)0x01F3C890; -const void * RTTI_MovementAgentPathFollowerStandard = (void *)0x01F3C8C0; -const void * RTTI_MovementSelectIdleUtils__SelectFirstIdleFilter = (void *)0x01F3C900; -const void * RTTI_MovementPathManagerAgent = (void *)0x01F3CC38; -const void * RTTI_IMovementSetGoal = (void *)0x01F3CC68; -const void * RTTI_IMovementQueryPathingState = (void *)0x01F3CC90; -const void * RTTI_IMovementPathManagerDataTracker = (void *)0x01F3CCC8; -const void * RTTI_MovementPathManagerArbiter = (void *)0x01F3CD88; -const void * RTTI_MovementMessageNewPath = (void *)0x01F3CDE8; -const void * RTTI_MovementPathManagerNullTracker = (void *)0x01F3CE48; -const void * RTTI_BSNavmesh = (void *)0x01EC6150; -const void * RTTI_BSNavmeshInfoMap = (void *)0x01EC6230; -const void * RTTI_BSNavmeshInfoMap__IRecursiveVisitor = (void *)0x01F3D118; -const void * RTTI_BSPrecomputedNavmeshInfoPathMap__INavmeshInfoVisitor = (void *)0x01F3D1C0; -const void * RTTI_BSNavmeshObstacleData = (void *)0x01F3D210; -const void * RTTI_PathingTaskData = (void *)0x01F3D240; -const void * RTTI_MovementArbitrationAverageFloat = (void *)0x01F3D368; -const void * RTTI_MovementArbitrationMaxWeightPoint = (void *)0x01F3D410; -const void * RTTI_MovementArbitrationMaxWeightParameters = (void *)0x01F3D4D8; -const void * RTTI_NullMovementSelectIdleResult = (void *)0x01F3D638; -const void * RTTI_INavmeshSearchFilterSet = (void *)0x01EC7860; -const void * RTTI_BSNavmeshSearchFilters = (void *)0x01EC7910; -const void * RTTI_BSNavmeshSearch = (void *)0x01EC78B8; -const void * RTTI_BSPathingLOSGridCell = (void *)0x01F3D670; -const void * RTTI_BSPathingLOSGrid = (void *)0x01F3D6A0; -const void * RTTI_BSPathingLOSGridMap = (void *)0x01F3D6C8; -const void * RTTI_BSPathBuilder = (void *)0x01F3D7B8; -const void * RTTI_PathSmootherRayCastUsePreferredTris = (void *)0x01F3D830; -const void * RTTI_PathSmootherRayCastUseTrianglePath = (void *)0x01F3D870; -const void * RTTI_BSPathEventManager = (void *)0x01F3D8B0; -const void * RTTI_IMovementControllerRegisterInterface = (void *)0x01ED8818; -const void * RTTI_IMovementControllerDataTracker = (void *)0x01F3DAD8; -const void * RTTI_MovementControllerAI = (void *)0x01ED87E8; -const void * RTTI_NullMovementState = (void *)0x01F3DB10; -const void * RTTI_BSPathingStreamSimpleBufferRead = (void *)0x01F3DB88; -const void * RTTI_MovementControllerNullDataTracker = (void *)0x01F3DBC0; -const void * RTTI_MovementMessageDoor = (void *)0x01F3DEA0; -const void * RTTI_MovementMessageApproachingDoor = (void *)0x01F3DED0; -const void * RTTI_MovementMessageActivateDoor = (void *)0x01F3DF08; -const void * RTTI_MovementMessageWarpToLocation = (void *)0x01F3E180; -const void * RTTI_MovementMessageWarpToMultiple = (void *)0x01F3E400; -const void * RTTI_MovementMessageBlocked = (void *)0x01F3E668; -const void * RTTI_MovementMessagePlayIdle = (void *)0x01F3E8D8; -const void * RTTI_MovementMessageFreezeDirection = (void *)0x01F3EB50; -const void * RTTI_MovementMessageSetStaticPath = (void *)0x01F3EDD0; -const void * RTTI_MovementMessageJump = (void *)0x01F3F038; -const void * RTTI_IMovementQueryDeltas = (void *)0x01F3F280; -const void * RTTI_MovementPostUpdateArbiter = (void *)0x01F3F2B0; -const void * RTTI_IMovementSetStaticAvoider = (void *)0x01F3F518; -const void * RTTI_IMovementQueryStaticAvoider = (void *)0x01F3F548; -const void * RTTI_MovementPathManagerAgentStaticAvoider = (void *)0x01F3F580; -const void * RTTI_IMovementQueryActorAvoidance = (void *)0x01F3F7C8; -const void * RTTI_MovementAgentActorAvoider = (void *)0x01F3F800; -const void * RTTI_MovementAgent = (void *)0x01ED8E30; -const void * RTTI_MovementArbiter = (void *)0x01F3CDC0; -const void * RTTI_IMovementSetTranslationControllerType = (void *)0x01F3FA78; -const void * RTTI_MovementHandlerAgentTranslationController = (void *)0x01F3FAC0; -const void * RTTI_IMovementSetCorrectionData = (void *)0x01F3FD10; -const void * RTTI_MovementTweenerAgentFixedDelta = (void *)0x01F3FD48; -const void * RTTI_MovementHandlerArbiter = (void *)0x01F3FF88; -const void * RTTI_MovementHandlerAgent = (void *)0x01ED8E00; -const void * RTTI_IMovementPlannerSetArbitration = (void *)0x01F404C8; -const void * RTTI_MovementPlannerArbiter = (void *)0x01F40500; -const void * RTTI_MovementPlannerAgent = (void *)0x01EDA0B8; -const void * RTTI_MovementPathManagerAgentLoadedAreaMonitor = (void *)0x01F40BC0; -const void * RTTI_IMovementQueryFlight = (void *)0x01F40E20; -const void * RTTI_MovementAgentPathFollowerFlight = (void *)0x01F40E50; -const void * RTTI_MovementAgentPathFollowerVirtual = (void *)0x01F410B0; -const void * RTTI_MovementHandlerAgentAngleController = (void *)0x01F41318; -const void * RTTI_MovementHandlerAgentAngleGain = (void *)0x01F41570; -const void * RTTI_MovementHandlerAgentSpeedPassThrough = (void *)0x01F417E8; -const void * RTTI_MovementHandlerAgentAnglePassThrough = (void *)0x01F41A68; -const void * RTTI_MovementHandlerAgentDirectionPassThrough = (void *)0x01F41CF8; -const void * RTTI_MovementHandlerAgentStrafing = (void *)0x01F41F50; -const void * RTTI_MovementHandlerAgentLargeDeltaIdle = (void *)0x01F421B0; -const void * RTTI_MovementPlannerAgentNavmeshBounds = (void *)0x01F42408; -const void * RTTI_MovementPathManagerAgentAvoidBox = (void *)0x01F42660; -const void * RTTI_IMovementQueryTweener = (void *)0x01F42908; -const void * RTTI_IMovementSetTweener = (void *)0x01F42938; -const void * RTTI_IMovementTweenerAgent = (void *)0x01EDAAF8; -const void * RTTI_MovementTweenerArbiter = (void *)0x01F42968; -const void * RTTI_MovementTweenerAgent = (void *)0x01EDAAC8; -const void * RTTI_MovementStateTweener = (void *)0x01F42D08; -const void * RTTI_MovementStateFollowPath = (void *)0x01F42F38; -const void * RTTI_MovementSelectIdleUtils__SelectClosestIdleToPath = (void *)0x01F42F70; -const void * RTTI_MovementMessagePathEvent = (void *)0x01F3CE18; -const void * RTTI_MovementMessagePathComplete = (void *)0x01F43670; -const void * RTTI_MovementMessagePathFailed = (void *)0x01F436A8; -const void * RTTI_MovementMessagePathCleared = (void *)0x01F436D8; -const void * RTTI_BSPathSmootherPOVSearch = (void *)0x01F43710; -const void * RTTI_BSPathingSearchRayCast = (void *)0x01F437F8; -const void * RTTI_ISmoothingRayValidator = (void *)0x01F43828; -const void * RTTI_GroundPathRayValidator = (void *)0x01F43858; -const void * RTTI_WaterPathRayValidator = (void *)0x01F43888; -const void * RTTI_IPathingNodeGenerator = (void *)0x01F438B8; -const void * RTTI_GroundPathPathingNodeGenerator = (void *)0x01F438E8; -const void * RTTI_WaterPathPathingNodeGenerator = (void *)0x01F43920; -const void * RTTI_IPathFollowerState = (void *)0x01F43958; -const void * RTTI_ICheckEndReachedFunctor = (void *)0x01F3C830; -const void * RTTI_PathFollowerStatePlayIdle = (void *)0x01F43988; -const void * RTTI_PathFollowerStateFollowPathToParameter = (void *)0x01F439B8; -const void * RTTI_PathFollowerStateTurnToAngle = (void *)0x01F439F8; -const void * RTTI_PathFollowerStateKeepLastDirection = (void *)0x01F43A30; -const void * RTTI_VelocityObstacle__Utilities__BuildOpenEdgeListsVisitor = (void *)0x01F43A70; -const void * RTTI_BSNavmeshObstacleUndoData = (void *)0x01F43AC0; -const void * RTTI_MovementArbitrationVectorAdd = (void *)0x01F43AF0; -const void * RTTI_bnet__BaseCallback = (void *)0x01F43B78; -const void * RTTI_BSPlatform__BSTerminatedCallback = (void *)0x01F43C40; -const void * RTTI_BSPlatform__BSBethesdaPlatform = (void *)0x01F43C78; -const void * RTTI_BSPlatform__BSAsyncRequestBase = (void *)0x01F43FD0; -const void * RTTI_bnet__EmptyTerminationCB = (void *)0x01F45918; -const void * RTTI_bnet__ExternalAuthInfo = (void *)0x01F45948; -const void * RTTI_bnet__SteamExternalAuthInfo = (void *)0x01F45978; -const void * RTTI_bnet__CustomData__Value = (void *)0x01F459B0; -const void * RTTI_BSPlatform__BSUploadRequest = (void *)0x01F44170; -const void * RTTI_BSPlatform__BSDownloadRequest = (void *)0x01F441A8; -const void * RTTI_bnet___impl__RefCount = (void *)0x01F494E8; -const void * RTTI_bnet___impl__SharedMutex = (void *)0x01F49518; -const void * RTTI_bnet__IDynamicVariableDeleter = (void *)0x01F49548; -const void * RTTI_bnet__ConfigurationEntry = (void *)0x01F49580; -const void * RTTI_bnet___impl__IPool = (void *)0x01F49608; -const void * RTTI_bnet__ConfigurationEntryBoolean = (void *)0x01F49630; -const void * RTTI_bnet__ConfigurationEntryInteger = (void *)0x01F49668; -const void * RTTI_bnet__ConfigurationEntryFloat = (void *)0x01F496A0; -const void * RTTI_bnet__ConfigurationEntryLong = (void *)0x01F496D8; -const void * RTTI_bnet__ConfigurationEntryString = (void *)0x01F49710; -const void * RTTI_bnet__IJobCollection = (void *)0x01F499A0; -const void * RTTI_bnet___detail__Composite = (void *)0x01F499D0; -const void * RTTI_bnet__IHeap = (void *)0x01F49B80; -const void * RTTI_bnet__IHttpConnectionProvider = (void *)0x01F49BA8; -const void * RTTI_bnet__Network = (void *)0x01F49CB0; -const void * RTTI_bnet__UserProcessor = (void *)0x01F4A030; -const void * RTTI_bnet__UserQueue = (void *)0x01F4A0B8; -const void * RTTI_bnet__UserProcessorCollection = (void *)0x01F4A0E0; -const void * RTTI_bnet__JobProcessorCollection = (void *)0x01F4A118; -const void * RTTI_bnet___impl__AsyncOperation = (void *)0x01F4A380; -const void * RTTI_bnet__SuspendFlow = (void *)0x01F4A410; -const void * RTTI_bnet__ResumeFlow = (void *)0x01F4A598; -const void * RTTI_bnet__CustomData__StringValue = (void *)0x01F4A7F8; -const void * RTTI_bnet__CustomData__BinaryValue = (void *)0x01F4A830; -const void * RTTI_bnet__CustomData__ObjectValue = (void *)0x01F4A868; -const void * RTTI_bnet__BaseHttpRequest = (void *)0x01F4A8A0; -const void * RTTI_bnet__LogoutFlow = (void *)0x01F4ACA8; -const void * RTTI_std__exception = (void *)0x01F4AE58; -const void * RTTI_std__bad_weak_ptr = (void *)0x01F4AE80; -const void * RTTI_bnet__Notification__UserData__ReconnectJob = (void *)0x01F4B040; -const void * RTTI_bnet__Notification__UserData__OnSystemIdFetchedRegister = (void *)0x01F4B080; -const void * RTTI_bnet__Notification__UserWebSocket__OnSystemIdFetchedSend = (void *)0x01F4B0D0; -const void * RTTI_bnet__Notification__UserWebSocket__OnConnected = (void *)0x01F4B120; -const void * RTTI_bnet__IUgcUploader = (void *)0x01F4B6A0; -const void * RTTI_bnet__ChunkedUploadFlow = (void *)0x01F4B6C8; -const void * RTTI_bnet__IDownloader = (void *)0x01F4B8A0; -const void * RTTI_bnet__DownloadFlow = (void *)0x01F4B8C8; -const void * RTTI_bnet__FileDownloader = (void *)0x01F4BBF8; -const void * RTTI_bnet__UgcBrowseRequest = (void *)0x01F4BCB8; -const void * RTTI_bnet__UgcArgLessRequest = (void *)0x01F4BD78; -const void * RTTI_bnet__UgcCategoryCountRequest = (void *)0x01F4BDA8; -const void * RTTI_bnet__UgcContentUploadRequest = (void *)0x01F4BF30; -const void * RTTI_bnet__UgcImageUploadRequest = (void *)0x01F4C060; -const void * RTTI_bnet__UgcAddVideoRequest = (void *)0x01F4C098; -const void * RTTI_bnet__UgcContentRequest = (void *)0x01F4C0C8; -const void * RTTI_bnet__UgcContentUploadDetailsRequest = (void *)0x01F4C178; -const void * RTTI_bnet__UgcCreationRequest = (void *)0x01F4C240; -const void * RTTI_bnet__UgcEditRequest = (void *)0x01F4C2F0; -const void * RTTI_bnet__UgcFlagRequest = (void *)0x01F4C320; -const void * RTTI_bnet__UgcListContentRequest = (void *)0x01F4C350; -const void * RTTI_bnet__UgcListCategoriesRequest = (void *)0x01F4C458; -const void * RTTI_bnet__UgcListDlcRequest = (void *)0x01F4C518; -const void * RTTI_bnet__Ugc__ListPlatformsRequest = (void *)0x01F4C678; -const void * RTTI_bnet__Ugc__ListProductsRequest = (void *)0x01F4C778; -const void * RTTI_bnet__UgcListFollowedAuthorRequest = (void *)0x01F4C8D8; -const void * RTTI_bnet__UgcListNotificationRequest = (void *)0x01F4C9D8; -const void * RTTI_bnet__UgcListBlacklistedRequest = (void *)0x01F4CAE0; -const void * RTTI_bnet__UgcListFeaturedContentRequest = (void *)0x01F4CC48; -const void * RTTI_bnet__UgcListByEntitlementIdsRequest = (void *)0x01F4CC88; -const void * RTTI_bnet__UgcNotificationAcknowledgeRequest = (void *)0x01F4CCC8; -const void * RTTI_bnet__UgcPreviewUploadRequest = (void *)0x01F4CD08; -const void * RTTI_bnet__UgcQueryRequest = (void *)0x01F4CD40; -const void * RTTI_bnet__UgcRateRequest = (void *)0x01F4CD70; -const void * RTTI_bnet__UgcAddReleaseNoteRequest = (void *)0x01F4CDA0; -const void * RTTI_bnet__UgcUpdateReleaseNoteRequest = (void *)0x01F4CE48; -const void * RTTI_bnet__UgcRemoveReleaseNoteRequest = (void *)0x01F4CE80; -const void * RTTI_bnet__Ugc__RefreshEntitlementRequest = (void *)0x01F4CEB8; -const void * RTTI_bnet__Job = (void *)0x01F49A00; -const void * RTTI_bnet__FreeLessHeap = (void *)0x01F4CEF8; -const void * RTTI_bnet__AcquirableFreeLessHeap = (void *)0x01F4CF20; -const void * RTTI_bnet__NetworkLoop = (void *)0x01F4CF58; -const void * RTTI_bnet__AcceptLegalDocumentsRequest = (void *)0x01F4D298; -const void * RTTI_bnet__ListLegalDocumentsFlow = (void *)0x01F4D328; -const void * RTTI_bnet__AccountLinkingRequest = (void *)0x01F4D4D8; -const void * RTTI_bnet__AccountQuickCreateFlow = (void *)0x01F4D598; -const void * RTTI_bnet__AnonymousAuthenticationFlow = (void *)0x01F4D7F8; -const void * RTTI_bnet__SessionAnonymousCreateFlow = (void *)0x01F4D8C0; -const void * RTTI_bnet__SessionQuickCreateFlow = (void *)0x01F4D990; -const void * RTTI_bnet__AccountDeletionRequest = (void *)0x01F4DA58; -const void * RTTI_bnet__AddFingerprintRequest = (void *)0x01F4DA90; -const void * RTTI_bnet__IsAccountLinkableRequest = (void *)0x01F4DAC8; -const void * RTTI_bnet__UserCredentialsAuthenticationFlow = (void *)0x01F4DB68; -const void * RTTI_bnet__ExternalAuthenticationFlow = (void *)0x01F4DCF0; -const void * RTTI_bnet__GameCodeAuthenticationFlow = (void *)0x01F4DEE8; -const void * RTTI_bnet__UnlinkAccountFlow = (void *)0x01F4DFB0; -const void * RTTI_bnet__UsernameValidationRequest = (void *)0x01F4E170; -const void * RTTI_bnet__VerifyFingerprintRequest = (void *)0x01F4E1A8; -const void * RTTI_bnet__VerifyLinkRequest = (void *)0x01F4E1E0; -const void * RTTI_bnet__TwitchAccountInfoRequest = (void *)0x01F4E210; -const void * RTTI_bnet__CheckDisplayNameRequest = (void *)0x01F4E2D8; -const void * RTTI_bnet__CheckEmailRequest = (void *)0x01F4E3A0; -const void * RTTI_bnet__RecoverPasswordRequest = (void *)0x01F4E3D0; -const void * RTTI_bnet__RecoverUsernameRequest = (void *)0x01F4E408; -const void * RTTI_bnet__ResendVerificationRequest = (void *)0x01F4E440; -const void * RTTI_bnet__SessionValidateRequest = (void *)0x01F4E478; -const void * RTTI_bnet__AccountInfoRequest = (void *)0x01F4E538; -const void * RTTI_bnet__RetrieveExternalAccountJob = (void *)0x01F4E660; -const void * RTTI_bnet__ExternalServiceRetrieveAccountRequest = (void *)0x01F4E8C0; -const void * RTTI_bnet__AccountUpgradeAnonymousToQuickRequest = (void *)0x01F4E9F0; -const void * RTTI_bnet__GameAccountLinkFlow = (void *)0x01F4EAD8; -const void * RTTI_bnet__GameAccountLinkConflictResolveFlow = (void *)0x01F4EB98; -const void * RTTI_bnet__GameAccountExternalLinkConflictResolveFlow = (void *)0x01F4EC80; -const void * RTTI_bnet__GameAccountUserCredentialsAuthenticationFlow = (void *)0x01F4ED70; -const void * RTTI_bnet__GameAccountExternalAuthenticationFlow = (void *)0x01F4EF10; -const void * RTTI_bnet__GameAccountExternalLinkFlow = (void *)0x01F4F098; -const void * RTTI_bnet__GameAccountGameCodeAuthenticationFlow = (void *)0x01F4F160; -const void * RTTI_bnet__SessionResumeFlow = (void *)0x01F4F248; -const void * RTTI_bnet__NewGameSessionFlow = (void *)0x01F4F300; -const void * RTTI_bnet__Entitlements__CombinedEntitlementsListRequest = (void *)0x01F4F3B0; -const void * RTTI_bnet__Entitlements__ListRequest = (void *)0x01F4F4D8; -const void * RTTI_bnet__Entitlements__ConsumeRequest = (void *)0x01F4F5D0; -const void * RTTI_bnet__Entitlements__SearchRequest = (void *)0x01F4F688; -const void * RTTI_bnet__VCCS__MTX__Generic__GetCatalogRequest = (void *)0x01F4F6C0; -const void * RTTI_bnet__VCCS__MTX__Generic__PurchaseRequest = (void *)0x01F4F790; -const void * RTTI_bnet__VCCS__MTX__Generic__GetStoreURLRequest = (void *)0x01F4F860; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentRequestBase = (void *)0x01F4F940; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentCreateRequest = (void *)0x01F4FA20; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentDeleteRequest = (void *)0x01F4FA70; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentGetRequest = (void *)0x01F4FAC0; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentListRequest = (void *)0x01F4FB00; -const void * RTTI_bnet__Gsp__Profile__DataAttachmentUpdateRequest = (void *)0x01F4FBE0; -const void * RTTI_bnet__Gsp__Profile__ProfileGetRequest = (void *)0x01F4FC28; -const void * RTTI_bnet__Gsp__Profile__ProfileUpdateRequest = (void *)0x01F4FCF0; -const void * RTTI_bnet__EventLog__LogEventRequest = (void *)0x01F4FD30; -const void * RTTI_bnet__VCCS__Wallet__BalanceRequest = (void *)0x01F4FD68; -const void * RTTI_bnet__VCCS__Wallet__BalanceListRequest = (void *)0x01F4FE20; -const void * RTTI_bnet__VCCS__Wallet__PurchaseRequest = (void *)0x01F4FF38; -const void * RTTI_bnet__VCCS__Wallet__PurchasePreviewRequest = (void *)0x01F4FFF8; -const void * RTTI_bnet__VCCS__Wallet__ServerlessCreditRequest = (void *)0x01F500D0; -const void * RTTI_bnet__VCCS__Wallet__ServerlessDebitRequest = (void *)0x01F501A8; -const void * RTTI_bnet__UgcMtxPurchaseFlow = (void *)0x01F501E8; -const void * RTTI_bnet__VCCS__Fulfillment__UpdateFirstPartyEntitlementRequest = (void *)0x01F50340; -const void * RTTI_bnet__VCCS__Catalog__GetContentsRequest = (void *)0x01F50390; -const void * RTTI_bnet__VCCS__Catalog__GetItemRequest = (void *)0x01F50460; -const void * RTTI_bnet__VCCS__Catalog__ListCategoryPathRequest = (void *)0x01F50520; -const void * RTTI_bnet__VCCS__Catalog__ListCategoryPathChildrenRequest = (void *)0x01F50660; -const void * RTTI_bnet__VCCS__Catalog__ListItemsRequest = (void *)0x01F506A8; -const void * RTTI_bnet__VCCS__Catalog__GetBundlePreviewRequest = (void *)0x01F50770; -const void * RTTI_bnet__VCCS__Catalog__GetBundlePreviewListRequest = (void *)0x01F50840; -const void * RTTI_bnet__CMS__ListMessagesRequest = (void *)0x01F50928; -const void * RTTI_bnet__CMS__GetMultiMessageRequest = (void *)0x01F50A28; -const void * RTTI_bnet__Status__GetExtServerStatusRequest = (void *)0x01F50AE0; -const void * RTTI_bnet__Status__GetStatusRequest = (void *)0x01F50BB0; -const void * RTTI_bnet__SessionLogoutRequest = (void *)0x01F50BE8; -const void * RTTI_bnet__NotificationLogoutRequest = (void *)0x01F50C18; -const void * RTTI_bnet__Notification__Context__OnSystemFetched = (void *)0x01F50E50; -const void * RTTI_bnet__Notification__ReceiveJob = (void *)0x01F50E90; -const void * RTTI_bnet__Notification__FilterJob = (void *)0x01F50F58; -const void * RTTI_bnet__UgcCancelUploadRequest = (void *)0x01F50F90; -const void * RTTI_bnet__UgcChunkedUploadCompletionRequest = (void *)0x01F50FC8; -const void * RTTI_bnet__UgcChunkedUploadInitiationRequest = (void *)0x01F51008; -const void * RTTI_bnet__UgcChunkUploadRequest = (void *)0x01F510A8; -const void * RTTI_bnet__CdpFileInfoRequest = (void *)0x01F510E0; -const void * RTTI_bnet__CdpKeyRequest = (void *)0x01F51190; -const void * RTTI_bnet__BaseFileDownloader = (void *)0x01F4BC28; -const void * RTTI_bnet__HttpTransport = (void *)0x01F51240; -const void * RTTI_bnet__WinHttpTransport = (void *)0x01F51270; -const void * RTTI_bnet__SessionRefreshRequest = (void *)0x01F51310; -const void * RTTI_bnet__SessionResumeRequest = (void *)0x01F51378; -const void * RTTI_bnet__ListRequiredLegalDocumentsRequest = (void *)0x01F51438; -const void * RTTI_bnet__AuthenticationFlow = (void *)0x01F4D5D0; -const void * RTTI_bnet__BeamQuickCreationRequest = (void *)0x01F51C10; -const void * RTTI_bnet__AnonymousAuthRequest = (void *)0x01F51CD0; -const void * RTTI_bnet__SessionAnonymousAccountCreateRequest = (void *)0x01F51D00; -const void * RTTI_bnet__SessionQuickCreateRequest = (void *)0x01F51D40; -const void * RTTI_bnet__SessionAuthRequest = (void *)0x01F51D78; -const void * RTTI_bnet__BeamUserCredentialsAuthenticationRequest = (void *)0x01F51E30; -const void * RTTI_bnet__BeamExternalAuthenticationRequest = (void *)0x01F51EB0; -const void * RTTI_bnet__SessionExternalAuthRequest = (void *)0x01F51EF0; -const void * RTTI_bnet__Session__GameCodeAuthRequest = (void *)0x01F51F28; -const void * RTTI_bnet__TokenUpgradeRequest = (void *)0x01F51F60; -const void * RTTI_bnet__AccountUnlinkingRequest = (void *)0x01F52010; -const void * RTTI_bnet__RetrieveExternalAccountRequest = (void *)0x01F52048; -const void * RTTI_bnet__GameAccountLinkRequest = (void *)0x01F52110; -const void * RTTI_bnet__GameAccountLinkConflictResolveRequest = (void *)0x01F52150; -const void * RTTI_bnet__GameAccountExternalLinkConflictResolveRequest = (void *)0x01F521A0; -const void * RTTI_bnet__GameAccountAuthenticationRequest = (void *)0x01F521F0; -const void * RTTI_bnet__GameAccountExternalAuthRequest = (void *)0x01F52230; -const void * RTTI_bnet__GameAccountExternalLinkRequest = (void *)0x01F52270; -const void * RTTI_bnet__Session__GameAccountGameCodeAuthRequest = (void *)0x01F522B0; -const void * RTTI_bnet__SharedSRWMutex = (void *)0x01F52338; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob = (void *)0x01F52368; -const void * RTTI_bnet__ISocket = (void *)0x01F52440; -const void * RTTI_bnet__CSocket = (void *)0x01F52468; -const void * RTTI_bnet__CSecureSocket = (void *)0x01F52490; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob = (void *)0x01F524C0; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__SocketInitJob = (void *)0x01F52500; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__SendHandshakeJob = (void *)0x01F52550; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__InitJob__ReceiveHandshakeJob = (void *)0x01F525A0; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__IWriteJobSequence = (void *)0x01F52640; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__WriteJobSequence = (void *)0x01F52710; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__WriteJobSequence__WriteJob = (void *)0x01F52760; -const void * RTTI_bnet__WebSocketUtils__WebSocketJob__ReadJob = (void *)0x01F527B8; -const void * RTTI_bnet__Notification__ListSystemRequest = (void *)0x01F53080; -const void * RTTI_bnet__Notification__ChangeFilterRequest = (void *)0x01F531A0; -const void * RTTI_bnet__Presence__AppearDoNotDisturbRequest = (void *)0x01F53278; -const void * RTTI_bnet__Presence__AppearOfflineRequest = (void *)0x01F532B8; -const void * RTTI_bnet__Presence__GetRequest = (void *)0x01F532F8; -const void * RTTI_bnet__Presence__UpdateRequest = (void *)0x01F533B8; -const void * RTTI_bnet__SessionTokenRequest = (void *)0x01F51348; -const void * RTTI_bnet__NotificationConnectRequest = (void *)0x01F53430; -const void * RTTI_bnet__SessionAccessTokenRequest = (void *)0x01F53468; -const void * RTTI_bnet__CdpAuthenticationRequest = (void *)0x01F53508; -const void * RTTI_bnet__SessionResumeTokenRequest = (void *)0x01F53640; -const void * RTTI_bnet__BeamAuthenticationRequest = (void *)0x01F51E78; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob = (void *)0x01F538E8; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__HandshakeJob = (void *)0x01F53930; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__InitializeJob = (void *)0x01F53A80; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__WriteJob = (void *)0x01F53AD0; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__ReceiveJob = (void *)0x01F53B20; -const void * RTTI_bnet__SecureSocket__pImpl__SecureSocketJob__ReceiveJob__DecodeJob = (void *)0x01F53BD0; -const void * RTTI_BSScript__IFindBoundObjectFunctor = (void *)0x01F543C0; -const void * RTTI_BSScript__IVMObjectBindInterface = (void *)0x01F543F8; -const void * RTTI_BSScript__IVMSaveLoadInterface = (void *)0x01F54430; -const void * RTTI_BSScript__IVirtualMachine = (void *)0x01F54468; -const void * RTTI_BSScript__IVMDebugInterface = (void *)0x01F54498; -const void * RTTI_BSScript__ErrorLogger = (void *)0x01F197B8; -const void * RTTI_BSScript__UnlinkedTypes__Function__ConvertTypeFunctor = (void *)0x01F544D0; -const void * RTTI_BSScript__ByteCode__PackedInstructionStream__InstructionFunctor = (void *)0x01F54570; -const void * RTTI_BSScript__IMemoryPagePolicy = (void *)0x01F545C8; -const void * RTTI_BSScript__SimpleAllocMemoryPagePolicy = (void *)0x01F54600; -const void * RTTI_BSScript__CompiledScriptLoader = (void *)0x01F54640; -const void * RTTI_BSScript__IFunction = (void *)0x01F1D038; -const void * RTTI_BSScript__NF_util__NativeFunctionBase = (void *)0x01F1D0C0; -const void * RTTI_BSScript__Internal__VirtualMachine = (void *)0x01F54678; -const void * RTTI_BSScript__Internal__IFuncCallQuery = (void *)0x01F546F0; -const void * RTTI_BSScript__Internal__RawFuncCallQuery = (void *)0x01F54728; -const void * RTTI_BSScript__IObjectProcessor = (void *)0x01F54768; -const void * RTTI_BSScript__Internal__CodeTasklet = (void *)0x01F54B10; -const void * RTTI_BSScript__Internal__AutoPropGetFunction = (void *)0x01F54B48; -const void * RTTI_BSScript__Internal__AutoPropSetFunction = (void *)0x01F54B88; -const void * RTTI_BSScript__Internal__NativeFunctionStub = (void *)0x01F54BC8; -const void * RTTI_BSScript__UnlinkedTypes__InstructionStream__InstructionFunctor = (void *)0x01F54C10; -const void * RTTI_BSScript__LinkerProcessor = (void *)0x01F54E30; -const void * RTTI_BSScript__Internal__ScriptFunction = (void *)0x01F54EA8; -const void * RTTI_BSFadeNode = (void *)0x01F54EE0; -const void * RTTI_BSShaderProperty = (void *)0x01F54F08; -const void * RTTI_BSLeafAnimNode = (void *)0x01F54F30; -const void * RTTI_BSTreeNode = (void *)0x01F54F58; -const void * RTTI_BSImagespaceShaderAlphaBlend = (void *)0x01F55068; -const void * RTTI_BSImagespaceShaderBlur3 = (void *)0x01F55140; -const void * RTTI_BSImagespaceShaderBlur5 = (void *)0x01F55170; -const void * RTTI_BSImagespaceShaderBlur7 = (void *)0x01F551A0; -const void * RTTI_BSImagespaceShaderBlur9 = (void *)0x01F551D0; -const void * RTTI_BSImagespaceShaderBlur11 = (void *)0x01F55200; -const void * RTTI_BSImagespaceShaderBlur13 = (void *)0x01F55230; -const void * RTTI_BSImagespaceShaderBlur15 = (void *)0x01F55260; -const void * RTTI_BSImagespaceShaderNonHDRBlur3 = (void *)0x01F55290; -const void * RTTI_BSImagespaceShaderNonHDRBlur5 = (void *)0x01F552C8; -const void * RTTI_BSImagespaceShaderNonHDRBlur7 = (void *)0x01F55300; -const void * RTTI_BSImagespaceShaderNonHDRBlur9 = (void *)0x01F55338; -const void * RTTI_BSImagespaceShaderNonHDRBlur11 = (void *)0x01F55370; -const void * RTTI_BSImagespaceShaderNonHDRBlur13 = (void *)0x01F553A8; -const void * RTTI_BSImagespaceShaderNonHDRBlur15 = (void *)0x01F553E0; -const void * RTTI_BSImagespaceShaderBrightPassBlur3 = (void *)0x01F55418; -const void * RTTI_BSImagespaceShaderBrightPassBlur5 = (void *)0x01F55450; -const void * RTTI_BSImagespaceShaderBrightPassBlur7 = (void *)0x01F55488; -const void * RTTI_BSImagespaceShaderBrightPassBlur9 = (void *)0x01F554C0; -const void * RTTI_BSImagespaceShaderBrightPassBlur11 = (void *)0x01F554F8; -const void * RTTI_BSImagespaceShaderBrightPassBlur13 = (void *)0x01F55538; -const void * RTTI_BSImagespaceShaderBrightPassBlur15 = (void *)0x01F55578; -const void * RTTI_BSImagespaceShaderCopy = (void *)0x01F555B8; -const void * RTTI_BSImagespaceShaderCopyDynamicFetchDisabled = (void *)0x01F555F0; -const void * RTTI_BSImagespaceShaderCopyScaleBias = (void *)0x01F55638; -const void * RTTI_BSImagespaceShaderTextureMask = (void *)0x01F55670; -const void * RTTI_BSImagespaceShaderGreyScale = (void *)0x01F556A8; -const void * RTTI_BSImagespaceShaderCopyCustomViewport = (void *)0x01F556E0; -const void * RTTI_BSImagespaceShaderDepthOfField = (void *)0x01F55720; -const void * RTTI_BSImagespaceShaderDepthOfFieldFogged = (void *)0x01F55758; -const void * RTTI_BSImagespaceShaderDepthOfFieldMaskedFogged = (void *)0x01F557A0; -const void * RTTI_BSImagespaceShaderDistantBlur = (void *)0x01F557E8; -const void * RTTI_BSImagespaceShaderDistantBlurFogged = (void *)0x01F55820; -const void * RTTI_BSImagespaceShaderDistantBlurMaskedFogged = (void *)0x01F55860; -const void * RTTI_BSImagespaceShaderDoubleVision = (void *)0x01F558A0; -const void * RTTI_BSImagespaceShaderFXAA = (void *)0x01F558D8; -const void * RTTI_BSImagespaceShaderHDRDownSample4 = (void *)0x01F55908; -const void * RTTI_BSImagespaceShaderHDRDownSample16Lum = (void *)0x01F55940; -const void * RTTI_BSImagespaceShaderHDRDownSample4RGB2Lum = (void *)0x01F55980; -const void * RTTI_BSImagespaceShaderHDRDownSample16 = (void *)0x01F559C0; -const void * RTTI_BSImagespaceShaderHDRDownSample4LumClamp = (void *)0x01F559F8; -const void * RTTI_BSImagespaceShaderHDRDownSample16LumClamp = (void *)0x01F55A40; -const void * RTTI_BSImagespaceShaderHDRDownSample4LightAdapt = (void *)0x01F55A80; -const void * RTTI_BSImagespaceShaderHDRDownSample16LightAdapt = (void *)0x01F55AD0; -const void * RTTI_BSImagespaceShaderHDRTonemapBlendCinematic = (void *)0x01F55B20; -const void * RTTI_BSImagespaceShaderHDRTonemapBlendCinematicFade = (void *)0x01F55B70; -const void * RTTI_BSImagespaceShaderLocalMap = (void *)0x01F55BB8; -const void * RTTI_BSImagespaceShaderMap = (void *)0x01F55BF0; -const void * RTTI_BSImagespaceShaderWorldMap = (void *)0x01F55C20; -const void * RTTI_BSImagespaceShaderWorldMapNoSkyBlur = (void *)0x01F55C58; -const void * RTTI_BSImagespaceShaderNoiseScrollAndBlend = (void *)0x01F55C98; -const void * RTTI_BSImagespaceShaderNoiseNormalmap = (void *)0x01F55CD8; -const void * RTTI_BSImagespaceShaderRadialBlur = (void *)0x01F55D10; -const void * RTTI_BSImagespaceShaderRadialBlurMedium = (void *)0x01F55D48; -const void * RTTI_BSImagespaceShaderRadialBlurHigh = (void *)0x01F55D88; -const void * RTTI_BSImagespaceShaderRefraction = (void *)0x01F55DC0; -const void * RTTI_BSImagespaceShaderWaterDisplacementClearSimulation = (void *)0x01F55E00; -const void * RTTI_BSImagespaceShaderWaterDisplacementTexOffset = (void *)0x01F55E50; -const void * RTTI_BSImagespaceShaderWaterDisplacementWadingRipple = (void *)0x01F55EA0; -const void * RTTI_BSImagespaceShaderWaterDisplacementRainRipple = (void *)0x01F55EF0; -const void * RTTI_BSImagespaceShaderWaterWadingHeightmap = (void *)0x01F55F38; -const void * RTTI_BSImagespaceShaderWaterRainHeightmap = (void *)0x01F55F78; -const void * RTTI_BSImagespaceShaderWaterBlendHeightmaps = (void *)0x01F55FB8; -const void * RTTI_BSImagespaceShaderWaterSmoothHeightmap = (void *)0x01F55FF8; -const void * RTTI_BSImagespaceShaderWaterDisplacementNormals = (void *)0x01F56040; -const void * RTTI_BSImagespaceShaderVolumetricLighting = (void *)0x01F56088; -const void * RTTI_BSImagespaceShaderWaterFlow = (void *)0x01F560C8; -const void * RTTI_BSImagespaceShaderApplyReflections = (void *)0x01F56100; -const void * RTTI_BSImagespaceShaderISApplyVolumetricLighting = (void *)0x01F56140; -const void * RTTI_BSImagespaceShaderISBasicCopy = (void *)0x01F56188; -const void * RTTI_BSImagespaceShaderISBlur = (void *)0x01F561C0; -const void * RTTI_BSImagespaceShaderISVolumetricLightingBlurHCS = (void *)0x01F561F0; -const void * RTTI_BSImagespaceShaderISVolumetricLightingBlurVCS = (void *)0x01F56240; -const void * RTTI_BSImagespaceShaderReflectionBlurHCS = (void *)0x01F56288; -const void * RTTI_BSImagespaceShaderReflectionBlurVCS = (void *)0x01F562C8; -const void * RTTI_BSImagespaceShaderISParallaxMaskBlurHCS = (void *)0x01F56308; -const void * RTTI_BSImagespaceShaderISParallaxMaskBlurVCS = (void *)0x01F56348; -const void * RTTI_BSImagespaceShaderISDepthOfFieldBlurHCS = (void *)0x01F56388; -const void * RTTI_BSImagespaceShaderISDepthOfFieldBlurVCS = (void *)0x01F563C8; -const void * RTTI_BSImagespaceShaderISCompositeVolumetricLighting = (void *)0x01F56410; -const void * RTTI_BSImagespaceShaderISCompositeLensFlare = (void *)0x01F56458; -const void * RTTI_BSImagespaceShaderISCompositeLensFlareVolumetricLighting = (void *)0x01F564A0; -const void * RTTI_BSImagespaceShaderISCopySubRegionCS = (void *)0x01F564F0; -const void * RTTI_BSImagespaceShaderISDebugSnow = (void *)0x01F56530; -const void * RTTI_BSImagespaceShaderISDownsample = (void *)0x01F56568; -const void * RTTI_BSImagespaceShaderISDownsampleIgnoreBrightest = (void *)0x01F565A0; -const void * RTTI_BSImagespaceShaderISDownsampleCS = (void *)0x01F565E8; -const void * RTTI_BSImagespaceShaderISDownsampleIgnoreBrightestCS = (void *)0x01F56620; -const void * RTTI_BSImagespaceShaderISExp = (void *)0x01F56668; -const void * RTTI_BSImagespaceShaderISIBLensFlares = (void *)0x01F56698; -const void * RTTI_BSImagespaceShaderISLightingComposite = (void *)0x01F566D0; -const void * RTTI_BSImagespaceShaderISLightingCompositeNoDirectionalLight = (void *)0x01F56710; -const void * RTTI_BSImagespaceShaderISLightingCompositeMenu = (void *)0x01F56760; -const void * RTTI_BSImagespaceShaderISPerlinNoiseCS = (void *)0x01F567A0; -const void * RTTI_BSImagespaceShaderISPerlinNoise2DCS = (void *)0x01F567D8; -const void * RTTI_BSImagespaceShaderReflectionsRayTracing = (void *)0x01F56818; -const void * RTTI_BSImagespaceShaderReflectionsDebugSpecMask = (void *)0x01F56860; -const void * RTTI_BSImagespaceShaderISSAOBlurH = (void *)0x01F568A8; -const void * RTTI_BSImagespaceShaderISSAOBlurV = (void *)0x01F568E0; -const void * RTTI_BSImagespaceShaderISSAOBlurHCS = (void *)0x01F56918; -const void * RTTI_BSImagespaceShaderISSAOBlurVCS = (void *)0x01F56950; -const void * RTTI_BSImagespaceShaderISSAOCameraZ = (void *)0x01F56988; -const void * RTTI_BSImagespaceShaderISSAOCameraZAndMipsCS = (void *)0x01F569C0; -const void * RTTI_BSImagespaceShaderISSAOCompositeSAO = (void *)0x01F56A00; -const void * RTTI_BSImagespaceShaderISSAOCompositeFog = (void *)0x01F56A40; -const void * RTTI_BSImagespaceShaderISSAOCompositeSAOFog = (void *)0x01F56A80; -const void * RTTI_BSImagespaceShaderISMinify = (void *)0x01F56AC0; -const void * RTTI_BSImagespaceShaderISMinifyContrast = (void *)0x01F56AF8; -const void * RTTI_BSImagespaceShaderISSAORawAO = (void *)0x01F56B38; -const void * RTTI_BSImagespaceShaderISSAORawAONoTemporal = (void *)0x01F56B70; -const void * RTTI_BSImagespaceShaderISSAORawAOCS = (void *)0x01F56BB0; -const void * RTTI_BSImagespaceShaderISSILComposite = (void *)0x01F56BE8; -const void * RTTI_BSImagespaceShaderISSILRawInd = (void *)0x01F56C20; -const void * RTTI_BSImagespaceShaderISSimpleColor = (void *)0x01F56C58; -const void * RTTI_BSImagespaceShaderISDisplayDepth = (void *)0x01F56C90; -const void * RTTI_BSImagespaceShaderISSnowSSS = (void *)0x01F56CC8; -const void * RTTI_BSImagespaceShaderISTemporalAA = (void *)0x01F56D00; -const void * RTTI_BSImagespaceShaderISTemporalAA_UI = (void *)0x01F56D38; -const void * RTTI_BSImagespaceShaderISTemporalAA_Water = (void *)0x01F56D70; -const void * RTTI_BSImagespaceShaderISUpsampleDynamicResolution = (void *)0x01F56DB0; -const void * RTTI_BSImagespaceShaderISWaterBlend = (void *)0x01F56DF8; -const void * RTTI_BSImagespaceShaderISUnderwaterMask = (void *)0x01F56E30; -const void * RTTI_ShadowSceneNode = (void *)0x01F56E70; -const void * RTTI_BSLightingShaderProperty = (void *)0x01F56E98; -const void * RTTI_BSGrassShaderProperty = (void *)0x01F56EC8; -const void * RTTI_BSShaderAccumulator = (void *)0x01F56EF8; -const void * RTTI_BSGrassShader = (void *)0x01F56F90; -const void * RTTI_BSLightingShaderMaterialBase = (void *)0x01EC5EE8; -const void * RTTI_BSLightingShaderMaterialEnvmap = (void *)0x01F56FB8; -const void * RTTI_BSLightingShaderMaterialEye = (void *)0x01F56FF0; -const void * RTTI_BSLightingShaderMaterialGlowmap = (void *)0x01F57028; -const void * RTTI_BSLightingShaderMaterialParallax = (void *)0x01F57060; -const void * RTTI_BSLightingShaderMaterialParallaxOcc = (void *)0x01F57098; -const void * RTTI_BSLightingShaderMaterialFacegen = (void *)0x01F570D8; -const void * RTTI_BSLightingShaderMaterialFacegenTint = (void *)0x01F57110; -const void * RTTI_BSLightingShaderMaterialHairTint = (void *)0x01F57150; -const void * RTTI_BSLightingShaderMaterialLandscape = (void *)0x01F57188; -const void * RTTI_BSLightingShaderMaterialLODLandscape = (void *)0x01F571C0; -const void * RTTI_BSLightingShaderMaterialSnow = (void *)0x01F57200; -const void * RTTI_BSLightingShaderMaterialMultiLayerParallax = (void *)0x01F57240; -const void * RTTI_BSEffectShaderProperty = (void *)0x01F57288; -const void * RTTI_ImageSpaceEffectParam = (void *)0x01F572B8; -const void * RTTI_ImageSpaceShaderParam = (void *)0x01F572E8; -const void * RTTI_BSWaterShaderProperty = (void *)0x01F574B0; -const void * RTTI_BSBloodSplatterShaderProperty = (void *)0x01F574E0; -const void * RTTI_BSBloodSplatterShader = (void *)0x01F57518; -const void * RTTI_BSImagespaceShaderLensFlare = (void *)0x01F57548; -const void * RTTI_BSImagespaceShaderLensFlareVisibility = (void *)0x01F57580; -const void * RTTI_BSParticleShaderProperty = (void *)0x01F575C0; -const void * RTTI_ImageSpaceEffectHDR = (void *)0x01F575F0; -const void * RTTI_BSLightingShader = (void *)0x01F57620; -const void * RTTI_BSWaterShader = (void *)0x01F57648; -const void * RTTI_ImageSpaceEffectVolumetricLighting = (void *)0x01F57670; -const void * RTTI_ImageSpaceEffectOption = (void *)0x01F576B0; -const void * RTTI_ImageSpaceEffectDepthOfField = (void *)0x01F57750; -const void * RTTI_BSSkyShader = (void *)0x01F57788; -const void * RTTI_BSSkyShaderProperty = (void *)0x01F577B0; -const void * RTTI_ImageSpaceEffect = (void *)0x01F55118; -const void * RTTI_BSEffectShaderMaterial = (void *)0x01F57AA0; -const void * RTTI_BSEffectShader = (void *)0x01F57AD0; -const void * RTTI_BSDistantTreeShaderProperty = (void *)0x01F57AF8; -const void * RTTI_BSDistantTreeShader = (void *)0x01F57B30; -const void * RTTI_BSCubeMapCamera = (void *)0x01F57B60; -const void * RTTI_BSWaterShaderMaterial = (void *)0x01F57B88; -const void * RTTI_ImageSpaceEffectWaterDisplacement = (void *)0x01F57BB8; -const void * RTTI_BSFogProperty = (void *)0x01F57BF0; -const void * RTTI_BSShadowLight = (void *)0x01F57C38; -const void * RTTI_BSBatchRenderer = (void *)0x01F57C60; -const void * RTTI_BSClearZNode = (void *)0x01F57C88; -const void * RTTI_BSImagespaceShader = (void *)0x01F550A0; -const void * RTTI_ImageSpaceEffectRefraction = (void *)0x01F57CB0; -const void * RTTI_ImageSpaceEffectRadialBlur = (void *)0x01F57CE8; -const void * RTTI_BSUtilityShader = (void *)0x01F57D20; -const void * RTTI_ImageSpaceEffectWorldMap = (void *)0x01F57D48; -const void * RTTI_NiThreadProcedure = (void *)0x01F31408; -const void * RTTI_NiMemStream = (void *)0x01F57D78; -const void * RTTI_NiCollisionObject = (void *)0x01EAEA68; -const void * RTTI_BSOrderedNode = (void *)0x01F57DA0; -const void * RTTI_BSLines = (void *)0x01F57DC8; -const void * RTTI_BSDynamicLines = (void *)0x01F57DE8; -const void * RTTI_UnitTest_BSStreamParserStream = (void *)0x01F57E10; -const void * RTTI_UnitTest_BSStreamParserData = (void *)0x01F57E48; -const void * RTTI_BSShapeConstructor = (void *)0x01F57E80; -const void * RTTI_BSBoxConstructor = (void *)0x01F57EB0; -const void * RTTI_BSOrientedBoxConstructor = (void *)0x01F57ED8; -const void * RTTI_BSSphereConstructor = (void *)0x01F57F08; -const void * RTTI_BSCylinderConstructor = (void *)0x01F57F38; -const void * RTTI_BSCapsuleConstructor = (void *)0x01F57F68; -const void * RTTI_BSArrowConstructor = (void *)0x01F57F98; -const void * RTTI_BSCircleConstructor = (void *)0x01F57FC8; -const void * RTTI_BSRingConstructor = (void *)0x01F57FF8; -const void * RTTI_BSFlatQuadConstructor = (void *)0x01F58020; -const void * RTTI_BSDiskConstructor = (void *)0x01F58050; -const void * RTTI_BSMultiIndexTriShape = (void *)0x01F58078; -const void * RTTI_BSShaderMaterial = (void *)0x01EC5F20; -const void * RTTI_BSLight = (void *)0x01F57C18; -const void * RTTI_BSShader = (void *)0x01F550D0; -const void * RTTI_NiBoneMatrixSetterI = (void *)0x01F54F80; -const void * RTTI_BSReloadShaderI = (void *)0x01F550F0; -const void * RTTI_BSParticleShader = (void *)0x01F580A8; -const void * RTTI_BSLightingShaderPropertyFloatController = (void *)0x01F580D0; -const void * RTTI_BSLightingShaderPropertyUShortController = (void *)0x01F58110; -const void * RTTI_BSLightingShaderPropertyColorController = (void *)0x01F58150; -const void * RTTI_BSEffectShaderPropertyFloatController = (void *)0x01F58190; -const void * RTTI_BSEffectShaderPropertyColorController = (void *)0x01F581D0; -const void * RTTI_BSNiAlphaPropertyTestRefController = (void *)0x01F58210; -const void * RTTI_BSPSysSimpleColorModifier = (void *)0x01F58250; -const void * RTTI_BSPSysLODModifier = (void *)0x01F58280; -const void * RTTI_BSShadowDirectionalLight = (void *)0x01F582A8; -const void * RTTI_BSShaderResourceManager = (void *)0x01F582D8; -const void * RTTI_IRendererResourceManager = (void *)0x01F58308; -const void * RTTI_ImageSpaceEffectGetHit = (void *)0x01F58338; -const void * RTTI_ImageSpaceEffectBlur = (void *)0x01F58368; -const void * RTTI_ImageSpaceEffectFullScreenBlur = (void *)0x01F58398; -const void * RTTI_ImageSpaceEffectMap = (void *)0x01F583D0; -const void * RTTI_ImageSpaceEffectNoise = (void *)0x01F58400; -const void * RTTI_BSParabolicCullingProcess = (void *)0x01F58430; -const void * RTTI_BSShadowFrustumLight = (void *)0x01F58460; -const void * RTTI_BSShadowParabolicLight = (void *)0x01F58490; -const void * RTTI_BSComputeShader = (void *)0x01F584C0; -const void * RTTI_BSMeshLODTriShape = (void *)0x01F584E8; -const void * RTTI_BSLODMultiIndexTriShape = (void *)0x01F58510; -const void * RTTI_BSSubIndexLandTriShape = (void *)0x01F58540; -const void * RTTI_BSSystemMonitor__SocketThread = (void *)0x01F58570; -const void * RTTI_BSSystemMonitor__MemOpsThread = (void *)0x01F585A8; -const void * RTTI_BSSystemUtility = (void *)0x01F58708; -const void * RTTI_BSGameDataSystemUtility = (void *)0x01F58768; -const void * RTTI_BSWin32SaveDataSystemUtility = (void *)0x01F58798; -const void * RTTI_BSSaveDataSystemUtility = (void *)0x01F587D0; -const void * RTTI_BSSaveDataSystemUtility__Entry = (void *)0x01F58840; -const void * RTTI_BSSaveDataSystemUtilityFile = (void *)0x01F58918; -const void * RTTI_BSSystemUtilitiesStrings = (void *)0x01F58988; -const void * RTTI_BSStreamSystemUtility = (void *)0x01F589B8; -const void * RTTI_CCallbackBase = (void *)0x01F585E0; -const void * RTTI_BSWin32SystemUtility = (void *)0x01F589E8; -const void * RTTI_BSCacheDriveSystemUtility = (void *)0x01F58A18; -const void * RTTI_BSSysInfoSystemUtility = (void *)0x01F58A48; -const void * RTTI_BSWin32GameDataSystemUtility = (void *)0x01F58A78; -const void * RTTI_BSAwardsSystemUtility = (void *)0x01F58AB0; -const void * RTTI_BSWin32AwardsSystemUtility = (void *)0x01F58AE0; -const void * RTTI_BSMsgDialogSystemUtility = (void *)0x01F58B18; -const void * RTTI_BSDiscBootSystemUtility = (void *)0x01F58B48; -const void * RTTI_type_info = (void *)0x01F58B78; -const void * RTTI_BSSocket = (void *)0x01F58B98; -const void * RTTI_BSSocketServer = (void *)0x01F58BB8; diff --git a/source/fs.dll/skse64/skse64/GameReferences.cpp b/source/fs.dll/skse64/skse64/GameReferences.cpp deleted file mode 100644 index 4342ac35..00000000 --- a/source/fs.dll/skse64/skse64/GameReferences.cpp +++ /dev/null @@ -1,175 +0,0 @@ -#include "skse64/GameReferences.h" -#include "skse64/GameObjects.h" -#include "skse64/GameForms.h" -#include "skse64/GameExtraData.h" -#include "skse64/GameRTTI.h" -#include "skse64/GameData.h" -#include "skse64/NiNodes.h" - -// 9993FF829D7004AAE73399E0559CC28B110D4A91+C2 -RelocAddr<_CreateRefHandleByREFR> CreateRefHandleByREFR(0x00138A70); -// 526D2C6164B5B723ABF2D3B5BF05D3E20C270AA8+2C -RelocAddr<_LookupREFRByHandle> LookupREFRByHandle(0x00139010); -// AF5D1D698E25CFB06197DD5322B6F15A13ABF0B3+4D -RelocAddr<_LookupREFRObjectByHandle> LookupREFRObjectByHandle(0x00139130); - -// AF5D1D698E25CFB06197DD5322B6F15A13ABF0B3+30 -RelocPtr g_invalidRefHandle(0x01F5A43C); - -RelocAddr<_MoveRefrToPosition> MoveRefrToPosition(0x009D4240); -RelocAddr<_PlaceAtMe_Native> PlaceAtMe_Native(0x009BE1B0); -RelocAddr<_AddItem_Native> AddItem_Native(0x009BC030); - -UInt32 GetOrCreateRefrHandle(TESObjectREFR* ref) -{ - UInt32 invalidRefHandleVal = *(g_invalidRefHandle.GetPtr()); - if (ref == NULL) - return invalidRefHandleVal; - - ExtraReferenceHandle* xRefHandle = static_cast(ref->extraData.GetByType(kExtraData_ReferenceHandle)); - - UInt32 result = xRefHandle != NULL ? - xRefHandle->handle : - invalidRefHandleVal; - - if (result == invalidRefHandleVal) - result = ref->CreateRefHandle(); - - return result; -} - -UInt32 TESObjectREFR::CreateRefHandle(void) -{ - if (handleRefObject.GetRefCount() > 0) - { - UInt32 refHandle = 0; - CreateRefHandleByREFR(refHandle, this); - return refHandle; - } - else - { - return *g_invalidRefHandle; - } -} - -void TESObjectREFR::IncRef() -{ - handleRefObject.IncRef(); -} - -void TESObjectREFR::DecRef() -{ - handleRefObject.DecRef(); -} - -TESForm * Actor::GetEquippedObject(bool abLeftHand) -{ - if(!processManager) - return NULL; - - if(abLeftHand) - return processManager->equippedObject[ActorProcessManager::kEquippedHand_Left]; - else - return processManager->equippedObject[ActorProcessManager::kEquippedHand_Right]; - - return NULL; -} - -TintMask * PlayerCharacter::GetOverlayTintMask(TintMask * original) -{ - SInt32 curIndex = -1; - if(!overlayTintMasks) - return NULL; - - TintMask * foundMask; - for(UInt32 i = 0; i < tintMasks.count; i++) - { - tintMasks.GetNthItem(i, foundMask); - if(foundMask == original) { - curIndex = i; - break; - } - } - - overlayTintMasks->GetNthItem(curIndex, foundMask); - if(foundMask) - return foundMask; - - return NULL; -} - -void Actor::UpdateHairColor() -{ - TESNPC* npc = DYNAMIC_CAST(baseForm, TESForm, TESNPC); - if(npc && npc->headData) { - BGSColorForm * hairColor = npc->headData->hairColor; // Non-player actors won't have this - if(hairColor) { - NiColorA val; - val.r = hairColor->color.red / 128.0; - val.g = hairColor->color.green / 128.0; - val.b = hairColor->color.blue / 128.0; - NiColorA * color = &val; - - NiNode * model = GetNiRootNode(0); - if(model) { - UpdateModelHair(model, &color); - } - } - } -} - -void Actor::UpdateSkinColor() -{ - TESNPC* npc = DYNAMIC_CAST(baseForm, TESForm, TESNPC); - if(npc) { - NiColorA val; - val.r = npc->color.red / 255.0; - val.g = npc->color.green / 255.0; - val.b = npc->color.blue / 255.0; - NiColorA * color = &val; - - NiNode * thirdPerson = GetNiRootNode(0); - NiNode * firstPerson = GetNiRootNode(1); - if(thirdPerson) { - UpdateModelSkin(thirdPerson, &color); // Update for 3rd Person - } - if(firstPerson) { - UpdateModelSkin(firstPerson, &color); // Update for 1st Person - } - } -} - -bool Actor::VisitFactions(FactionVisitor & visitor) -{ - TESNPC* npc = DYNAMIC_CAST(baseForm, TESForm, TESNPC); - if(npc) { - for(UInt32 i = 0; i < npc->actorData.factions.count; i++) - { - TESActorBaseData::FactionInfo info; - npc->actorData.factions.GetNthItem(i, info); - if(visitor.Accept(info.faction, info.rank)) - return true; - } - - ExtraFactionChanges* pFactionChanges = static_cast(extraData.GetByType(kExtraData_FactionChanges)); - if (pFactionChanges) { - for(UInt32 i = 0; i < pFactionChanges->factions.count; i++) - { - ExtraFactionChanges::FactionInfo info; - pFactionChanges->factions.GetNthItem(i, info); - if(visitor.Accept(info.faction, info.rank)) - return true; - } - } - } - - return false; -} - -// 7C86FE404A52BB28611337DE8714FD037A8B834B+17 -RelocPtr g_crosshairRefHandleHolder(0x02F9CA70); - -CrosshairRefHandleHolder * CrosshairRefHandleHolder::GetSingleton(void) -{ - return *(g_crosshairRefHandleHolder.GetPtr()); -} diff --git a/source/fs.dll/skse64/skse64/GameReferences.h b/source/fs.dll/skse64/skse64/GameReferences.h deleted file mode 100644 index cbba79e7..00000000 --- a/source/fs.dll/skse64/skse64/GameReferences.h +++ /dev/null @@ -1,1037 +0,0 @@ -#pragma once - -#include "skse64/GameFormComponents.h" -#include "skse64/GameForms.h" -#include "skse64/GameEvents.h" -#include "skse64/NiObjects.h" -#include "skse64/GameObjects.h" -#include "GameBSExtraData.h" - -class BSAnimationGraphEvent; -class NiNode; -class NiPoint3; -class TESObjectREFR; -class BSFaceGenNiNode; -class BSFaceGenAnimationData; -class PlayerCharacter; -class ImageSpaceModifierInstanceDOF; -class ObjectListItem; -class BSFadeNode; -class BGSLightingShaderProperty; -class BSAnimationGraphManager; -class QueuedFile; -class InventoryEntryData; - -class VMClassRegistry; - -// TESObjectREFR and child classes - -// 10 -class BSHandleRefObject : public NiRefObject -{ -public: - enum - { - kMask_RefCount = 0x3FF - }; - - UInt32 GetRefCount() const - { - return m_uiRefCount & kMask_RefCount; - } - - void DecRef() - { - if((InterlockedDecrement(&m_uiRefCount) & kMask_RefCount) == 0) - DeleteThis(); - } -}; - -// The refHandle is stored in BSHandleRefObject.m_uiRefCount -// Bits: -// 01 - 10 ref count -// 11 isHandleSet -// 12 - ?? handle (seems to be divided in two parts, 0xFFFFF and 0x3F00000) - -// Adds entry to lookup table if not yet there -typedef void (* _CreateRefHandleByREFR)(UInt32 & refHandleOut, TESObjectREFR * refr); -extern RelocAddr<_CreateRefHandleByREFR> CreateRefHandleByREFR; - -// Note: May set refHandle to 0 -typedef bool (* _LookupREFRByHandle)(UInt32 & refHandle, NiPointer & refrOut); -extern RelocAddr<_LookupREFRByHandle> LookupREFRByHandle; - -typedef bool (* _LookupREFRObjectByHandle)(UInt32 & refHandle, NiPointer & refrOut); -extern RelocAddr<_LookupREFRObjectByHandle> LookupREFRObjectByHandle; - -extern RelocPtr g_invalidRefHandle; - -// Try to retrive/create handle. Return invalid handle otherwise. -UInt32 GetOrCreateRefrHandle(TESObjectREFR* refr); - -// Place/move reference -typedef void (* _MoveRefrToPosition)(TESObjectREFR* source, UInt32* pTargetHandle, void* parentCell, void* worldSpace, NiPoint3* postion, NiPoint3* rotation); -extern RelocAddr<_MoveRefrToPosition> MoveRefrToPosition; - -typedef TESObjectREFR* (* _PlaceAtMe_Native)(VMClassRegistry* registry, UInt32 stackId, TESObjectREFR* target, TESForm* form, SInt32 count, bool bForcePersist, bool bInitiallyDisabled); -extern RelocAddr<_PlaceAtMe_Native> PlaceAtMe_Native; - -typedef void (* _AddItem_Native)(VMClassRegistry* registry, UInt32 stackId, TESObjectREFR* target, TESForm* form, SInt32 count, bool bSilent); -extern RelocAddr<_AddItem_Native> AddItem_Native; - -// 8 -class IAnimationGraphManagerHolder -{ -public: - virtual ~IAnimationGraphManagerHolder(); - - virtual UInt32 Unk_01(void); - virtual UInt32 Unk_02(void); - virtual UInt32 Unk_03(void); - virtual UInt32 Unk_04(void); - virtual UInt32 Unk_05(void); - virtual UInt32 Unk_06(void); - virtual UInt32 Unk_07(void); - virtual UInt32 Unk_08(void); - virtual UInt32 Unk_09(void); - virtual UInt32 Unk_0A(void); - virtual UInt32 Unk_0B(void); - virtual UInt32 Unk_0C(void); - virtual UInt32 Unk_0D(void); - virtual UInt32 Unk_0E(void); - virtual UInt32 Unk_0F(void); - virtual UInt32 Unk_10(void); - virtual UInt32 Unk_11(void); - virtual UInt32 Unk_12(void); - -// void ** _vtbl; -}; - -// 8 -class IPostAnimationChannelUpdateFunctor -{ -public: - virtual ~IPostAnimationChannelUpdateFunctor(); -// void ** _vtbl; -}; - -// 98 -class TESObjectREFR : public TESForm -{ -public: - enum { kTypeID = kFormType_Reference }; - - enum - { - kFlag_Harvested = 0x2000, - - kChange_IsEmpty = 0x00200000, - }; - - // currently none of these have been analyzed - virtual void Unk_39(void); - virtual void Unk_3A(void); - virtual void Unk_3B(void); - virtual void Unk_3C(void); - virtual void Unk_3D(void); - virtual void Unk_3E(void); - virtual void Unk_3F(void); - virtual void Unk_40(void); - virtual void Unk_41(void); - virtual void Unk_42(void); - virtual void Unk_43(void); - virtual void Unk_44(void); - virtual void Unk_45(void); - virtual void Unk_46(void); - virtual void Unk_47(void); - virtual void Unk_48(void); - virtual void Unk_49(void); - virtual void Unk_4A(void); - virtual void Unk_4B(void); - virtual void Unk_4C(void); - virtual void Unk_4D(void); - virtual void Unk_4E(void); - virtual void Unk_4F(void); - virtual void Unk_50(void); - virtual void GetStartingPos(NiPoint3 * pos); - virtual void Unk_52(void); - virtual void Unk_53(void); - virtual void Unk_54(void); - virtual void Unk_55(void); - virtual void Unk_56(void); - virtual void Unk_57(void); - virtual void Unk_58(void); - virtual void Unk_59(void); - virtual void Unk_5A(void); - virtual void GetMarkerPosition(NiPoint3 * pos); - virtual void Unk_5C(void); - virtual void Unk_5D(void); - virtual void Unk_5E(void); - virtual void Unk_5F(void); - virtual void Unk_60(void); - virtual BSFaceGenNiNode * GetFaceGenNiNode(void); - virtual void Unk_62(void); - virtual BSFaceGenAnimationData * GetFaceGenAnimationData(void); - virtual void Unk_64(void); - virtual void Unk_65(void); - virtual void Unk_66(void); - virtual void Unk_67(void); - virtual void Unk_68(void); - virtual void Unk_69(void); - virtual void Unk_6A(void); - virtual void Unk_6B(void); - virtual void Unk_6C(void); - virtual void SetNiNode(NiNode * root, UInt32 unk1); // NULL, 1? - virtual void Unk_6E(void); - virtual NiNode * GetNiRootNode(UInt32 firstPerson); - virtual NiNode * GetNiNode(void); // Root of the skeleton (Get3D) - virtual void Unk_71(void); - virtual void Unk_72(void); - virtual void Unk_73(void); - virtual void Unk_74(void); - virtual void Unk_75(void); - virtual void Unk_76(void); - virtual void Unk_77(void); - virtual void Unk_78(void); - virtual void Unk_79(void); - virtual void Unk_7A(void); - virtual void Unk_7B(void); - virtual void Unk_7C(void); - virtual void Unk_7D(void); - virtual BipedModel* GetBiped(UInt32 weightModel); // 0 Small 1 Large - virtual BipedModel* GetBipedSmall(void); - virtual void Unk_80(void); - virtual void Unk_81(void); - virtual void Unk_82(void); - virtual void Unk_83(void); - virtual void Unk_84(void); - virtual void Unk_85(void); - virtual void Unk_86(void); - virtual void Unk_87(void); - virtual void Unk_88(void); - virtual void Unk_89(void); - virtual void ResetInventory(bool unk); - virtual void Unk_8B(void); - virtual void Unk_8C(void); - virtual void Unk_8D(void); - virtual void Unk_8E(void); - virtual void Unk_8F(void); - virtual void Unk_90(void); - virtual void Unk_91(void); - virtual void Unk_92(void); - virtual void Unk_93(void); - virtual void Unk_94(void); - virtual void Unk_95(void); - virtual void Unk_96(void); - virtual void Unk_97(void); - virtual void Unk_98(void); - virtual bool IsDead(UInt8 unk1); // unk1 = 1 for Actors - virtual void Unk_9A(void); - virtual void Unk_9B(void); - - struct LoadedState - { - UInt8 todo[0x68]; - NiNode * node; // 68 - // ... probably more - }; - - // parents - BSHandleRefObject handleRefObject; // 20 - BSTEventSink animGraphEventSink; // 30 - IAnimationGraphManagerHolder animGraphHolder; // 38 - - // members - TESForm* baseForm; // 40 - NiPoint3 rot; // 48 - NiPoint3 pos; // 54 - - TESObjectCELL * parentCell; // 60 - LoadedState * loadedState; // 68 - BaseExtraList extraData; // 70 - UInt64 unk88; // 88 - New in SE - UInt16 unk90; // 90 - init'd to 100 - UInt8 unk92; // 92 - UInt8 unk93; // 93 - UInt32 pad94; // 94 - - UInt32 CreateRefHandle(void); - - void IncRef(); - void DecRef(); - - MEMBER_FN_PREFIX(TESObjectREFR); - DEFINE_MEMBER_FN(GetBaseScale, float, 0x0029EE80); - DEFINE_MEMBER_FN(IsOffLimits, bool, 0x002AC940); - // 9C5031E1D6707680E2D9E4A717A225C1137FED59+145 - DEFINE_MEMBER_FN(GetWeight, float, 0x002B8D40); - DEFINE_MEMBER_FN(GetReferenceName, const char *, 0x002A8800); - DEFINE_MEMBER_FN(GetWorldspace, TESWorldSpace*, 0x002ABD30); -}; - -STATIC_ASSERT(sizeof(TESObjectREFR) == 0x98); -STATIC_ASSERT(offsetof(TESObjectREFR, extraData) == 0x70); -STATIC_ASSERT(offsetof(TESObjectREFR, loadedState) == 0x68); -STATIC_ASSERT(offsetof(TESObjectREFR::LoadedState, node) == 0x68); - -// 08 -class IMovementInterface -{ -public: - virtual ~IMovementInterface(); -// void ** _vtbl; // 00 -}; - -// 08 -class IMovementState : public IMovementInterface -{ -public: - virtual ~IMovementState(); -}; - -// 10 -class ActorState : public IMovementState -{ -public: - virtual ~ActorState(); - -// void ** _vtbl; // 00 - - // older versions of this class stored flags in a UInt64 - // this forced the addition of 4 useless padding bytes - // current and future versions store flags as two UInt32s - - enum { - kState_Running = 0x40, - kState_Walking = 0x80, - kState_Sprinting = 0x100, - kState_Sneaking = 0x200, - kState_Swimming = 0x400 - }; - - // SE: not changing names of these, they are referenced somewhere else - UInt32 flags04; // 08 - UInt32 flags08; // 0C - - bool IsWeaponDrawn() - { - return (flags08 >> 5 & 7) >= 3; - } -}; -STATIC_ASSERT(sizeof(ActorState) == 0x10); - -// 2B0 -class Actor : public TESObjectREFR -{ -public: - enum { kTypeID = kFormType_Character }; - - virtual ~Actor(); - virtual void Unk_9C(void); - virtual void Unk_9D(void); - virtual void Unk_9E(void); - virtual void Unk_9F(void); - virtual void Unk_A0(void); - virtual void Unk_A1(void); - virtual void Unk_A2(void); - virtual void Unk_A3(void); - virtual void Unk_A4(void); - virtual void Unk_A5(void); - virtual void DrawSheatheWeapon(bool draw); - virtual void Unk_A7(void); - virtual void Unk_A8(void); - virtual void Unk_A9(void); - virtual void Unk_AA(void); - virtual void Unk_AB(void); - virtual void Unk_AC(void); - virtual void Unk_AD(void); - virtual void Unk_AE(void); - virtual void Unk_AF(void); - virtual void Unk_B0(void); - virtual void Unk_B1(void); - virtual void Unk_B2(void); - virtual void Unk_B3(void); - virtual void Unk_B4(void); - virtual void Unk_B5(void); - virtual void Unk_B6(void); - virtual void Unk_B7(void); - virtual void Unk_B8(void); - virtual void Unk_B9(void); - virtual void Unk_BA(void); - virtual void Unk_BB(void); - virtual void Unk_BC(void); - virtual void Unk_BD(void); - virtual void Unk_BE(void); - virtual void Unk_BF(void); - virtual void Unk_C0(void); - virtual void Unk_C1(void); - virtual void Unk_C2(void); - virtual void Unk_C3(void); - virtual void Unk_C4(void); - virtual void Unk_C5(void); - virtual void Unk_C6(void); - virtual void Unk_C7(void); - virtual void Unk_C8(void); - virtual void Unk_C9(void); - virtual void Unk_CA(void); - virtual void Unk_CB(void); - virtual void Unk_CC(void); - virtual void Unk_CD(void); - virtual void Unk_CE(void); - virtual void Unk_CF(void); - virtual void Unk_D0(void); - virtual void Unk_D1(void); - virtual void Unk_D2(void); - virtual void Unk_D3(void); - virtual void Unk_D4(void); - virtual void Unk_D5(void); - virtual void Unk_D6(void); - virtual void Unk_D7(void); - virtual void Unk_D8(void); - virtual void Unk_D9(void); - virtual void Unk_DA(void); - virtual void Unk_DB(void); - virtual void Unk_DC(void); - virtual void Unk_DD(void); - virtual void Unk_DE(void); - virtual void Unk_DF(void); - virtual void Unk_E0(void); - virtual void Unk_E1(void); - virtual void Unk_E2(void); - virtual bool IsInCombat(void); - virtual void Unk_E4(void); - virtual void Unk_E5(void); - virtual void Unk_E6(void); - virtual void Unk_E7(void); - virtual void Unk_E8(void); - virtual void Unk_E9(void); - virtual void Unk_EA(void); - virtual void Unk_EB(void); - virtual void Unk_EC(void); - virtual void Unk_ED(void); - virtual void Unk_EE(void); - virtual void Unk_EF(void); - virtual void Unk_F0(void); - virtual void Unk_F1(void); - virtual void Unk_F2(void); - virtual void Unk_F3(void); - virtual void Unk_F4(void); - virtual void Unk_F5(void); - virtual void Unk_F6(void); - virtual void AdvanceSkill(UInt32 skillId, float points, UInt32 unk1, UInt32 unk2); - virtual void Unk_F8(void); - virtual void Unk_F9(void); - virtual void VisitPerks(void); // BGSPerk::FindPerkInRanksVisitor - virtual void AddPerk(BGSPerk * perk, UInt32 unk1); - virtual void RemovePerk(BGSPerk * perk); - - // 0C - class SpellArray - { - public: - SpellItem * Get(UInt32 idx) - { - if(idx >= spellCount) return NULL; - - if(allocatedCount & kLocalAlloc) - return (idx == 0) ? singleSpell : NULL; - else - return spells ? spells[idx] : NULL; - } - - UInt32 Length(void) { return spellCount; } - - private: - enum - { - kLocalAlloc = 0x80000000, - }; - - UInt32 allocatedCount; // 00 - upper bit is set when single-element optimization is used - union { - SpellItem ** spells; // 08 - SpellItem * singleSpell; // 08 - used when kLocalAlloc is set - }; - UInt32 spellCount; // 10 - }; - - enum Flags1 { - kFlags_AIEnabled = 0x02, - kFlags_IsPlayerTeammate = 0x4000000 - }; - enum Flags2 { - kFlags_CanDoFavor = 0x80 - }; - - MagicTarget magicTarget; // 098 - ActorValueOwner actorValueOwner; // 0B0 - ActorState actorState; // 0B8 - BSTEventSink transformDeltaEvent; // 0C8 .?AV?$BSTEventSink@VBSTransformDeltaEvent@@@@ - BSTEventSink characterMoveFinishEvent; // 0D0 .?AV?$BSTEventSink@VbhkCharacterMoveFinishEvent@@@@ - IPostAnimationChannelUpdateFunctor unk0D8; // 0D8 IPostAnimationChannelUpdateFunctor - UInt32 flags1; // 0E0 - float unk0E4; // 0E4 - UInt32 unk0E8; // 0E8 - UInt32 pad0EC; // 0EC - ActorProcessManager * processManager; // 0F0 - UInt32 unk0F8; // 0F8 - UInt32 unk0FC; // 0FC - UInt32 unk100; // 100 - UInt32 unk104; // 104 - float unk108; // 108 - init'd to -1 - UInt32 unk10C; // 10C - UInt32 unk110; // 110 - UInt32 unk114; // 114 - UInt32 unk118; // 118 - UInt32 unk11C; // 11C - float unk120; // 120 - float unk124; // 124 - float unk128; // 128 - UInt32 unk12C; // 12C - UInt64 unk130; // 130 - UInt64 unk138; // 138 - void* unk140; // 140 ActorMover* - void* unk148; // 148 MovementControllerNPC* - UInt64 unk150; // 150 - UInt64 unk158; // 158 - UInt64 unk160; // 160 - float unk168; // 168 - UInt32 unk16C; // 16C - UInt32 unk170; // 170 - UInt32 unk174; // 174 - init'd to 50 - UInt32 unk178; // 178 - UInt32 unk17C; // 17C - init'd to 7FFFFFFF - UInt64 unk180; // 180 - SpellArray addedSpells; // 188 - void* unk1A0; // 1A0 ActorMagicCaster* - void* unk1A8; // 1A8 ActorMagicCaster* - UInt64 unk1B0; // 1B0 - void* unk1B8; // 1B8 ActorMagicCaster* - SpellItem* leftHandSpell; // 1C0 - SpellItem* rightHandSpell; // 1C8 - UInt64 unk1D0; // 1D0 - UInt64 unk1D8; // 1D8 - TESForm * equippedShout; // 1E0 - UInt32 unk1E8; // 1E8 - UInt32 pad1EC; // 1EC - TESRace* race; // 1F0 - float unk1F8; // 1F8 - init'd to -1 - UInt32 flags2; // 1FC - - // These two are part of an object - BSString unk200; // 200 - BSString unk210; // 210 - - UInt64 unk220; // 220 - - // C - struct Data228 - { - UInt32 unk0; - UInt32 unk4; - UInt32 unk8; - }; - - Data228 unk228; - Data228 unk234; - Data228 unk240; - Data228 unk24C; - float unk258; // 258 - init'd to -1 - UInt32 unk25C; // 25C - UInt64 unk260; // 260 - float unk268; // 268 - float unk26C; // 26C - UInt32 unk270; // 270 - UInt32 unk274; // 274 - UInt64 unk278; // 278 - UInt64 unk280; // 280 - UInt64 unk288; // 288 - UInt64 unk290; // 290 - UInt64 unk298; // 298 - UInt64 unk2A0; // 2A0 - UInt64 unk2A8; // 2A8 - - MEMBER_FN_PREFIX(Actor); - DEFINE_MEMBER_FN(QueueNiNodeUpdate, void, 0x006BBB70, bool updateWeight); - // CC3C9D131FFDF35E82C6D7182C4F9E42A3ED1EF2+28 - DEFINE_MEMBER_FN(HasPerk, bool, 0x00621AA0, BGSPerk * perk); - DEFINE_MEMBER_FN(GetLevel, UInt16, 0x005FB9B0); - DEFINE_MEMBER_FN(SetRace, void, 0x0062FAA0, TESRace*, bool isPlayer); - DEFINE_MEMBER_FN(UpdateWeaponAbility, void, 0x00658070, TESForm*, BaseExtraList * extraData, bool bLeftHand); - DEFINE_MEMBER_FN(UpdateArmorAbility, void, 0x00658000, TESForm*, BaseExtraList * extraData); - DEFINE_MEMBER_FN(IsHostileToActor, bool, 0x0060EBC0, Actor * actor); - DEFINE_MEMBER_FN(ResetAI, void, 0x006019A0, UInt32 unk1, UInt32 unk2); - - TESForm * GetEquippedObject(bool abLeftHand); - void UpdateSkinColor(); - void UpdateHairColor(); - - class FactionVisitor - { - public: - virtual bool Accept(TESFaction * faction, SInt8 rank) = 0; - }; - - // Can contain duplicate entries with different rankings - bool VisitFactions(FactionVisitor & visitor); -}; - -STATIC_ASSERT(offsetof(Actor, magicTarget) == 0x98); -STATIC_ASSERT(offsetof(Actor, actorValueOwner) == 0xB0); -STATIC_ASSERT(offsetof(Actor, actorState) == 0xB8); -STATIC_ASSERT(offsetof(Actor, unk0D8) == 0xD8); -STATIC_ASSERT(offsetof(Actor, addedSpells) == 0x188); -STATIC_ASSERT(sizeof(Actor) == 0x2B0); - -// 2B0 -class Character : public Actor -{ -public: - enum { kTypeID = kFormType_Character }; -}; - -STATIC_ASSERT(sizeof(Character) == 0x2B0); - -// BE0 -class PlayerCharacter : public Character -{ -public: - virtual ~PlayerCharacter(); - - // parents - BSTEventSink menuOpenCloseEvent; // 2B0 .?AV?$BSTEventSink@VMenuOpenCloseEvent@@@@ - BSTEventSink menuModeChangeEvent; // 2B8 .?AV?$BSTEventSink@VMenuModeChangeEvent@@@@ - BSTEventSink userEventEnabledEvent; // 2C0 .?AV?$BSTEventSink@VUserEventEnabledEvent@@@@ - BSTEventSink trackedStatsEvent; // 2C8 BSTEventSink@UTESTrackedStatsEvent@@@@@ - - BSTEventSource actorCellEventSource; // 2D0 .?AV?$BSTEventSource@UBGSActorCellEvent@@@@ - // tArray: 4 PlayerRegionState, BGSPlayerMusicChanger, CellAcousticSpaceListener, PlayerParentCellListener - BSTEventSource actorDeathEventSource; // 328 .?AV?$BSTEventSource@UBGSActorDeathEvent@@@@ - // tArray: 1 BGSPlayerMusicChanger - BSTEventSource positionPlayerEventSource; // 380 .?AV?$BSTEventSource@UPositionPlayerEvent@@@@ - // tArray: 9 MovementAvoidBoxEventAdapter, GarbaseCollector, Main, MenuTopicManager, TES (85E27728), - // PathManagerPositionPlayerAdapter, CharacterCollisionMessagePlayerAdapter, PlayerSleepWaitMovementControllerAdapter, SkyrimVM - - UInt32 unk3D8; // 3D8 - UInt32 unk3DC; // 3DC - UInt32 unk3E0; // 3E0 - UInt32 unk3E4; // 3E4 - UInt32 unk3E8; // 3E8 - UInt32 unk3EC; // 3EC - UInt32 unk3F0; // 3F0 - UInt32 unk3F4; // 3F4 - void* unk3F8; // 3F8 - UInt32 unk400; // 400 - UInt32 unk404; // 404 - void* unk408; // 408 - UInt32 unk410; // 410 - UInt32 unk414; // 414 - UInt32 unk418; // 418 - UInt32 unk41C; // 41C - UInt32 unk420; // 420 - UInt32 unk424; // 424 - void* unk428; // 428 - UInt32 unk430; // 430 - UInt32 unk434; // 434 - void* unk438; // 438 - UInt32 unk440; // 440 - UInt32 unk444; // 444 - UInt32 unk448; // 448 - UInt32 unk44C; // 44C - UInt32 unk450; // 450 - UInt32 unk454; // 454 - UInt32 unk458; // 458 - UInt32 unk45C; // 45C - void* unk460; // 460 - UInt64 unk468; // 468 - ObjectListItem* unk470; // 470 - float unk478; // 478 - float unk47C; // 47C - float unk480; // 480 - float unk484; // 484 - float unk488; // 488 - float unk48C; // 48C - float unk490; // 490 - float unk494; // 494 - float unk498; // 498 - float unk49C; // 49C - UInt64 unk4A0; // 4A0 - UInt64 unk4A8; // 4A8 - BGSPerkRanks addedPerks; // 4B0 - tArray perks; // 4C8 - tArray standingStonePerks; // 4E0 - tArray unk4F8; // 4F8 - struct DataUnk510 { UInt32 a; UInt32 b; UInt32 c; UInt32 pad; }; - tArray unk510; // 510 - UnkArray unk528; // 528 - tArray unk540; // 540 - tArray unk558; // 558 - void * unk570; // 570 - void* unk578; // 578 - tArray unk580; // 580 - UInt32 unk598; // 598 - UInt32 unk59C; // 59C - UInt32 unk5A0; // 5A0 - UInt32 unk5A4; // 5A4 - UInt32 unk5A8; // 5A8 - UInt32 unk5AC; // 5AC - void* unk5B0; // 5B0 - UInt64 unk5B8; // 5B8 - void* unk5C0; // 5C0 - UInt32 unk5C8; // 5C8 - UInt32 unk5CC; // 5CC - UInt32 unk5D0; // 5D0 - UInt32 unk5D4; // 5D4 - UInt32 unk5D8; // 5D8 - UInt32 unk5DC; // 5DC - void* unk5E0; // 5E0 - UInt8 unk5E8; // 5E8 - UInt8 pad5E9[7]; // 5E9 - void* unk5F0; // 5F0 - UInt32 unk5F8; // 5F8 - UInt32 pad5FC; // 5FC - UInt64 unk600; // 600 - NiTMap unk608; // 608 - TESWorldSpace* currentWorldSpace; // 628 - float unk630; // 630 - float unk634; // 634 - float unk638; // 638 - UInt32 unk63C; // 63C - UInt64 unk640; // 640 - UInt64 unk648; // 648 - float unk650; // 650 - float unk654; // 654 - float unk658; // 658 - float unk65C; // 65C - float unk660; // 660 - float unk664; // 664 - UInt64 unk668; // 668 - UInt64 unk670; // 670 - UInt32 unk678; // 678 - UInt32 unk67C; // 67C - UInt8 unk680; // 680 - UInt8 unk681; // 681 - UInt8 unk682; // 682 - UInt8 pad683; // 683 - UInt32 unk684; // 684 - UInt32 unk688; // 688 - init'd to FFFFFFFF - UInt8 unk68C; // 68C - UInt8 pad68D[3]; // 68D - UInt32 unk690; // 690 - UInt32 unk694; // 694 - UInt8 unk698; // 698 - UInt8 pad699[3]; // 699 - UInt32 unk69C; // 69C - UInt32 unk6A0; // 6A0 - UInt8 unk6A4; // 6A4 - UInt8 pad6A5[7]; // 6A5 - UInt64 unk6B0; // 6B0 - UInt32 unk6B8; // 6B8 - UInt32 unk6BC; // 6BC - UInt64 unk6C0; // 6C0 - UInt32 unk6C8; // 6C8 - float unk6CC; // 6CC - init'd to -1 - UInt32 unk6D0; // 6D0 - float unk6D4; // 6D4 - init'd to -1 - float unk6D8; // 6D8 - FF7FFFFF - UInt32 unk6DC; // 6DC - probably pad - ImageSpaceModifierInstanceDOF* unk6E0; // 6E0 - ImageSpaceModifierInstanceDOF* unk6E8; // 6E8 - ImageSpaceModifierInstanceDOF* unk6F0; // 6F0 - UInt32 unk6F8; // 6F8 - looks like a pointer along with next in debugger, but it isn't - UInt32 unk6FC; // 6FC - UInt64 unk700[3]; // 700 - UInt64 unk718; // 718 - UInt32 unk720; // 720 - UInt32 pad724; // 724 - UInt64 unk728; // 728 - UInt8 unk730[0xA0]; // 730 - memset to 0 in ctor - UInt32 unk7D0; // 7D0 - UInt32 unk7D4; // 7D4 - UInt32 unk7D8; // 7D8 - - // C - struct Data7DC - { - float unk0; // init'd to -1 - UInt32 unk4; - UInt32 unk8; // init'd to 16 - }; - - Data7DC unk7DC[15]; // 7DC - UInt32 unk890; // 890 - init'd to 15 - UInt32 unk894; // 894 - UInt32 unk898; // 898 - UInt32 unk89C; // 89C - UInt64 unk8A0[5]; // 8A0 - UInt32 unk8C8; // 8C8 - UInt32 unk8CC; // 8CC - UInt32 unk8D0; // 8D0 - float unk8D4; // 8D4 - init'd to -5 - UInt64 unk8D8; // 8D8 - UInt32 unk8E0; // 8E0 - UInt32 unk8E4; // 8E4 - UInt64 unk8E8; // 8E8 - BSFadeNode* firstPersonSkeleton; // 8F0 - float unk8F8; // 8F8 - UInt32 pad8FC; // 8FC - float unk900; // 900 - UInt32 pad904; // 904 - UInt64 unk908; // 908 - UInt32 unk910; // 910 - UInt32 lastRiddenHorseHandle; // 914 - UInt32 unk918; // 918 - UInt32 unk91C; // 91C - UInt64 unk920; // 920 - UInt64 unk928; // 928 - UInt32 unk930; // 930 - UInt32 unk934; // 934 - UInt64 unk938; // 938 - UInt64 unk940; // 940 - UInt32 unk948; // 948 - UInt32 unk94C; // 94C - UInt32 unk950; // 950 - UInt32 unk954; // 954 - UInt32 unk958; // 958 - UInt32 unk95C; // 95C - UInt32 unk960; // 960 - UInt32 unk964; // 964 - UInt64 unk968; // 968 - UInt64 unk970; // 970 - init'd to GetTickCount() in ctor - UInt64 unk978; // 978 - UInt32 unk980; // 980 - init'd to _time64(NULL) in ctor - UInt32 unk984; // 984 - TESWorldSpace* sameWorldSpace; // 988 - UInt32 unk990; // 990 - UInt32 unk994; // 994 - UInt64 unk998; // 998 - UInt64 unk9A0; // 9A0 - UInt64 unk9A8; // 9A8 - PlayerSkills * skills; // 9B0 - UInt32 targetHandle; // 9B8 - UInt32 unk9BC; // 9BC - UInt64 unk9C0; // 9C0 - BSFadeNode* fadeNode9C8; // 9C8 - void* unk9D0; // 9D0 - tArray hostileHandles; // 9D8 - UInt64 unk9F0; // 9F0 - UInt64 unk9F8; // 9F8 - TESForm* tempPoison; // A00 - UInt32 numTeammates; // A08 - UInt32 unkA0C; // A0C - UInt64 unkA10; // A10 - float unkA18; // A18 - UInt32 unkA1C; // A1C - UInt8 unkA20[0xA0]; // A20 - memset to 0 in ctor - UInt32 unkAC0; // AC0 - UInt32 unkAC4; // AC4 - BGSLocation* locationAC8; // AC8 - float unkAD0; // AD0 - UInt32 unkAD4; // AD4 - UInt32 unkAD8; // AD8 - UInt32 unkADC; // ADC - UInt64 unkAE0; // AE0 - UInt32 unkAE8; // AE8 - UInt32 unkAEC; // AEC - UInt32 unkAF0; // AF0 - UInt32 unkAF4; // AF4 - UInt32 unkAF8; // AF8 - UInt32 unkAFC; // AFC - UInt8 unkB00; // B00 - UInt8 numPerkPoints; // B01 - UInt8 unkB02; // B02 - UInt8 unkB03; // B03 - UInt32 unkB04; // B04 - void* unkB08; // B08 - tArray tintMasks; // B10 - tArray * overlayTintMasks; // B28 - BGSTextureSet* texSetB30; // B30 - TESRace* race; // B38 - TESRace* raceAgain; // B40 - transformed race maybe for vamps and werewolves? - UInt32 unkB48; // B48 - UInt32 unkB4C; // B4C - UnkArray unkB50; // B50 - UInt64 unkB68[5]; // B68 - UInt64 unkB90; // B90 - UInt64 unkB98; // B98 - UInt32 unkBA0; // BA0 - UInt32 unkBA4; // BA4 - UInt64 unkBA8; // BA8 - UInt64 unkBB0[3]; // BB0 - UInt32 unkBC8; // BC8 - UInt32 unkBCC; // BCC - UInt64 unkBD0; // BD0 - UInt8 unkBD8; // BD8 - UInt8 unkBD9; // BD9 - UInt8 unkBDA; // BDA - UInt8 unkBDB; // BDB - UInt8 unkBDC; // BDC - UInt8 unkBDD; // BDD - UInt16 padBDE; // BDE - // Object allocation size is 0xBE0. Anything >= this address wouldn't be part of this object!!!! - - // Overlayed tints should be the same as original tints - // occasionally they can have no type so index matching - // is required to set anything on the tint - TintMask * GetOverlayTintMask(TintMask * original); - - // Confirmed - Same as ExtraContainerChanges::EntryData - // This type is used by scaleform to extend data - // It can be used to extend more of the "ExtraData" - /*struct ObjDesc - { - TESForm * form; - tList * extraData; - SInt32 countDelta; - - MEMBER_FN_PREFIX(ObjDesc); - //DEFINE_MEMBER_FN(GenerateName, const char *, 0x00475AA0); - };*/ - - // I've replaced the old GetTintList defined through DEFINE_MEMBER_FN by a regular method. - // GetTintList doesn't longer exist in Skyrim64. There is a function that fullfills same role at 0x680630 (1.4), - // but it cannot be used like it is because it assumes it is called with object at offsset 0xB10. - tArray * GetTintList() - { - if (overlayTintMasks) - return overlayTintMasks; - - return &tintMasks; - } - - MEMBER_FN_PREFIX(PlayerCharacter); - DEFINE_MEMBER_FN(GetNumTints, UInt32, 0x006DEF60, UInt32 tintType); - DEFINE_MEMBER_FN(GetTintMask, TintMask *, 0x006DEDB0, UInt32 tintType, UInt32 index); - DEFINE_MEMBER_FN(GetDamage, float, 0x006BBAB0, InventoryEntryData * pForm); - DEFINE_MEMBER_FN(GetArmorValue, float, 0x006BB740, InventoryEntryData * pForm); -}; - -STATIC_ASSERT(offsetof(PlayerCharacter, userEventEnabledEvent) == 0x2C0); -STATIC_ASSERT(offsetof(PlayerCharacter, numPerkPoints) == 0xB01); -STATIC_ASSERT(offsetof(PlayerCharacter, tintMasks) == 0xB10); -STATIC_ASSERT(offsetof(PlayerCharacter, overlayTintMasks) == 0xB28); -STATIC_ASSERT(offsetof(PlayerCharacter, unk3D8) == 0x3D8); -STATIC_ASSERT(offsetof(PlayerCharacter, lastRiddenHorseHandle) == 0x914); -STATIC_ASSERT(offsetof(PlayerCharacter, skills) == 0x9B0); -STATIC_ASSERT(offsetof(PlayerCharacter, tempPoison) == 0xA00); -STATIC_ASSERT(offsetof(PlayerCharacter, hostileHandles) == 0x9D8); -STATIC_ASSERT(offsetof(PlayerCharacter, currentWorldSpace) == 0x628); -STATIC_ASSERT(offsetof(PlayerCharacter, addedPerks) == 0x4B0); -STATIC_ASSERT(offsetof(PlayerCharacter, sameWorldSpace) == 0x988); -STATIC_ASSERT(offsetof(PlayerCharacter, unk890) == 0x890); -STATIC_ASSERT(sizeof(PlayerCharacter) == 0xBE0); - - -// 140 -class Explosion : public TESObjectREFR -{ - UInt8 unk098[0x140 - 0x98]; // 098 TODO -}; - -// 1A0 -class ChainExplosion : public Explosion -{ - UInt8 unk1A0[0x1A0 - 0x140]; // 140 TODO -}; - -// D8 -class Hazard : public TESObjectREFR -{ - enum { kTypeID = kFormType_Hazard }; - - UInt64 unk98[8]; // 98 TODO -}; - -// 1D8 -class Projectile : public TESObjectREFR -{ - // A8 - class LaunchData - { - public: - virtual ~LaunchData(); - - UInt8 unk08[0xA0]; // 08 TODO - }; - - UInt8 unk98[0x1D8 - 0x98]; // 98 TODO -}; - -// 1F8 -class BarrierProjectile : public Projectile -{ - enum { kTypeID = kFormType_BarrierProj }; - - UInt32 unk1D8; // 1D8 - UInt32 pad1DC; // 1DC - UnkArray unk1E0; // 1E0 -}; -STATIC_ASSERT(sizeof(BarrierProjectile) == 0x1F8); - -// 240 -class BeamProjectile : public Projectile -{ - enum { kTypeID = kFormType_BeamProj }; - - UInt8 unk1D8[0x240 - 0x1D8]; // 1D8 TODO -}; - -// 218 -class ConeProjectile : public Projectile -{ - enum { kTypeID = kFormType_ConeProj }; - - UInt8 unk1D8[0x218 - 0x1D8]; // 1D8 TODO -}; - -// 1E0 -class FlameProjectile : public Projectile -{ - enum { kTypeID = kFormType_FlameProj }; - - UInt64 unk1D8; // 1D8 -}; - -// 1E8 -class GrenadeProjectile : public Projectile -{ - enum { kTypeID = kFormType_Grenade }; - - void* unk1D8; // 1D8 - Allocated in ctor - UInt8 unk1E0; // 1E0 - UInt8 unk1E1[7]; // 1E1 - probably padding -}; - -// 1E0 -class MissileProjectile : public Projectile -{ - enum { kTypeID = kFormType_Missile }; - - UInt32 unk1D8; // 1D8 - UInt8 unk1DC; // 1DC - UInt8 pad1DD[3]; // 1DD -}; - -// 1F0 -class ArrowProjectile : public MissileProjectile -{ - enum { kTypeID = kFormType_Arrow }; - - UInt64 unk1E0; - UInt64 unk1E8; -}; - -// This does alot more, but no idea what it is yet -// ?? -class CrosshairRefHandleHolder -{ - UInt32 unk00; // 00 - UInt32 crosshairRefHandle; // 04 - // ... - -public: - - static CrosshairRefHandleHolder * GetSingleton(void); - - UInt32 CrosshairRefHandle(void) const { return crosshairRefHandle; } -}; diff --git a/source/fs.dll/skse64/skse64/GameResources.cpp b/source/fs.dll/skse64/skse64/GameResources.cpp deleted file mode 100644 index 2cf05510..00000000 --- a/source/fs.dll/skse64/skse64/GameResources.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "GameResources.h" - -FaceGenTriDatabase * FaceGenTriDatabase::GetSingleton(void) -{ - // 9FA4657D28964C48501C6FF2E9E8E52D86D2BDEF+3E - static RelocPtr g_FaceGenTriDatabase(0x02F9D080); - return *g_FaceGenTriDatabase; -} - -BSFaceGenDB::TRI::DBTraits::Data * FaceGenTriDatabase::GetInvalidEntry(void) -{ - // CD3B953DD742EFE4CEFC4ECA602FC9F442434777+A2 - static RelocPtr g_FaceGenTriDatabase_InvalidEntry(0x01E82A40); - return g_FaceGenTriDatabase_InvalidEntry.GetPtr(); -} diff --git a/source/fs.dll/skse64/skse64/GameResources.h b/source/fs.dll/skse64/skse64/GameResources.h deleted file mode 100644 index 0365bfa3..00000000 --- a/source/fs.dll/skse64/skse64/GameResources.h +++ /dev/null @@ -1,178 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "NiObjects.h" - -class BSResource -{ -public: - virtual ~BSResource(); - - template - class EntryDBBase - { - public: - virtual ~EntryDBBase(); - virtual void Unk_01(void); // Pure - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - }; - - template - class EntryDB : public EntryDBBase - { - public: - virtual ~EntryDB(); - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - - D data; // 08 - }; -}; - -struct BSFaceGenDB -{ - struct TRI - { - struct DBTraits - { - struct MorphVertex - { - SInt16 x; - SInt16 y; - SInt16 z; - }; - - // 38 - struct MorphData - { - const char * morphName; // 00 - UInt32 unk08; // 08 - UInt32 pad0C; // 0C - tArray diffData; // 10 - float baseDiff; // 28 - UInt32 diffVertexNum; // 2C - UInt32 baseVertexNum; // 30 - UInt32 diffVertexPosNum; // 34 - }; - - struct MorphSet - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - it may be pad - const char * fileName; // 08 - tArray morphData; // 10 - UInt8 unk28[0x58-0x28]; // 28 - BSFaceGenMorphData * faceMorphData; // 58 - BSFaceGenMorphDataHead - }; - - struct Data - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - tri\0 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - UInt32 pad14; // 14 - Data * next; // 18 - void * unk18; // 20 - MorphSet * morphSet; // 28 - }; - - struct UnkData - { - UInt64 unk00; - UInt64 unk08; - void* unk10; - }; - - // In parenthesis local offset - UnkData unk008[8]; // 008 (000) - UInt32 unk0C8; // 0C8 (0C0) - UInt32 pad0CC; // 0CC (0C4) - UInt8 unk0D0[0x110 - 0xD0]; // 0D0 (0C8) - - tArray triEntries; // 110 (108) - // ... more things - }; - }; - - struct FG - { - struct DBTraits - { - - }; - }; -}; - -// 8 less due to vtbl of BSResource::EntryDB not being part of the equation -STATIC_ASSERT(offsetof(BSFaceGenDB::TRI::DBTraits, triEntries) == 0x108); - -class FaceGenTriDatabase : public BSResource::EntryDB -{ -public: - static FaceGenTriDatabase * GetSingleton(void); - static BSFaceGenDB::TRI::DBTraits::Data * GetInvalidEntry(void); -}; - -// DumpCode -/* -FaceGenTriDatabase * triDatabase = FaceGenTriDatabase::GetSingleton(); -_MESSAGE("TRI Database..."); -//DumpClass(triDatabase, sizeof(FaceGenTriDatabase)/4); -gLog.Indent(); -BSFaceGenDB::TRI::DBTraits::Data * triEntry; -_MESSAGE("Database Capacity: %d", triDatabase->data.triEntries.arr.capacity); -for(UInt32 i = 0; i < triDatabase->data.triEntries.arr.capacity; i++) { - triEntry = triDatabase->data.triEntries[i]; - if(triEntry && triEntry != FaceGenTriDatabase::GetInvalidEntry()) { - _MESSAGE("Tri Entry %d", i); - //DumpClass(triEntry, sizeof(BSFaceGenDB::TRI::DBTraits::Data)/4); - if(triEntry->morphSet) { - //_MESSAGE("Set %d - %s", i, triEntry->morphSet->fileName); - //DumpClass(triEntry->morphSet, sizeof(BSFaceGenDB::TRI::DBTraits::MorphSet)/4); - _MESSAGE("Set - %s MorphCount: %d", triEntry->morphSet->fileName, triEntry->morphSet->morphData.count); - for(UInt32 n = 0; n < triEntry->morphSet->morphData.count; n++) { - BSFaceGenDB::TRI::DBTraits::MorphData morphEntry; - if(triEntry->morphSet->morphData.GetNthItem(n, morphEntry)) { - //_MESSAGE("Morph %d %d - %s", i, n, morphEntry.morphName); - //DumpClass(&morphEntry, sizeof(BSFaceGenDB::TRI::DBTraits::MorphData)/4); - _MESSAGE("Morph %d %d - %s baseDiff: %f DiffVertNum: %d BaseVertNum: %d DiffVertPosNum: %d", i, n, morphEntry.morphName, morphEntry.baseDiff, morphEntry.diffVertexNum, morphEntry.baseVertexNum, morphEntry.diffVertexPosNum); - } - } - - gLog.Indent(); - UInt32 k = 0; - BSFaceGenDB::TRI::DBTraits::Data * children = triEntry->next; - while(children) { - _MESSAGE("Child Set - %s MorphCount: %d", children->morphSet->fileName, children->morphSet->morphData.count); - gLog.Indent(); - //_MESSAGE("Child Set %d - %s", i, children->morphSet->fileName); - //DumpClass(children->morphSet, sizeof(BSFaceGenDB::TRI::DBTraits::MorphSet)/4); - for(UInt32 n = 0; n < children->morphSet->morphData.count; n++) { - BSFaceGenDB::TRI::DBTraits::MorphData morphEntry; - if(children->morphSet->morphData.GetNthItem(n, morphEntry)) { - //_MESSAGE("Child Morph %d %d - %s", k, n, morphEntry.morphName); - //DumpClass(&morphEntry, sizeof(BSFaceGenDB::TRI::DBTraits::MorphData)/4); - _MESSAGE("Child Morph %d %d - %s baseDiff: %f DiffVertNum: %d BaseVertNum: %d DiffVertPosNum: %d", i, n, morphEntry.morphName, morphEntry.baseDiff, morphEntry.diffVertexNum, morphEntry.baseVertexNum, morphEntry.diffVertexPosNum); - } - } - gLog.Outdent(); - k++; - children = children->next; - } - gLog.Outdent(); - } - } else { - _MESSAGE("Invalid entry %d", i); - } -} - -gLog.Outdent(); -*/ diff --git a/source/fs.dll/skse64/skse64/GameSettings.cpp b/source/fs.dll/skse64/skse64/GameSettings.cpp deleted file mode 100644 index 09dcf084..00000000 --- a/source/fs.dll/skse64/skse64/GameSettings.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include "GameSettings.h" -#include "GameAPI.h" - -// 91546BBAE6D61CD8C6D2021DD28BEB01C32E7178+30 -RelocPtr g_iniSettingCollection(0x030B9558); -// see ??_7INIPrefSettingCollection@@6B@ -RelocPtr g_iniPrefSettingCollection(0x03007810); -// CC0A0629D6A4756EA7CC1819A40AE77FB941F585+14 -RelocPtr g_gameSettingCollection(0x02F61180); - -// ### we can just look these up -// D1E741E48E0181F5A2371C8E8BD02C1F0810BADF+0 -RelocPtr g_mapLocalHeight(0x01E48F48); // fMapLocalHeight:MapMenu -// 2267F2663E2F5F55835C7541D7851DF11A53F787+1A2 -RelocPtr g_localMapMinFrustumWidth(0x01E8A880); - -UInt32 Setting::GetType(void) const -{ - if(!name || !name[0]) return kType_Unknown; - - switch(name[0]) - { - case 'b': return kType_Bool; - case 'c': return kType_Unknown; - case 'h': return kType_Unknown; - case 'i': return kType_Integer; - case 'u': return kType_Unknown; - case 'f': return kType_Float; - case 'S': return kType_String; // dynamically allocated string - case 's': return kType_String; // statically allocated string - case 'r': return kType_ID6; - case 'a': return kType_ID; - } - - return kType_Unknown; -} - -bool Setting::GetDouble(double * out) const -{ - switch(GetType()) - { - case kType_Integer: *out = data.s32; break; - case kType_Float: *out = data.f32; break; - case kType_String: return false; - case kType_Bool: *out = data.u8 ? 1 : 0; break; - case kType_ID6: *out = data.u32 >> 8; break; - case kType_ID: *out = data.u32; break; - default: return false; - case kType_Unknown: return false; - } - - return true; -} - -bool Setting::SetDouble(double value) -{ - switch(GetType()) - { - case kType_Integer: data.s32 = value; break; - case kType_Float: data.f32 = value; break; - case kType_String: return false; - case kType_Bool: data.u8 = value ? 1 : 0; break; - case kType_ID6: data.u32 = ((UInt32)value) << 8; break; - case kType_ID: data.u32 = value; break; - default: return false; - case kType_Unknown: return false; - } - - return true; -} - -char * FormHeap_Strdup(const char * src) -{ - UInt32 len = strlen(src) + 1; - char * result = (char *)Heap_Allocate(len); - memcpy(result, src, len); - - return result; -} - -bool Setting::SetString(const char * value) -{ - if(GetType() == kType_String) - { - if(name[0] == 'S') - Heap_Free(data.s); - - data.s = FormHeap_Strdup(value); - - // mark string as dynamically allocated - if(name[0] != 'S') - { - name = FormHeap_Strdup(name); - name[0] = 'S'; - } - - return true; - } - else - { - return false; - } -} - -Setting * SettingCollectionList::Get(const char * name) -{ - return CALL_MEMBER_FN(this, Get_Internal)(name); -} - -Setting * SettingCollectionMap::Get(const char * name) -{ - return items.Get(name); -} - -Setting * GetINISetting(const char * name) -{ - Setting * setting = (*g_iniSettingCollection)->Get(name); - if(!setting) - setting = (*g_iniPrefSettingCollection)->Get(name); - - return setting; -} diff --git a/source/fs.dll/skse64/skse64/GameSettings.h b/source/fs.dll/skse64/skse64/GameSettings.h deleted file mode 100644 index a5cfc4ea..00000000 --- a/source/fs.dll/skse64/skse64/GameSettings.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/NiTypes.h" - -// 18 -class Setting -{ -public: - Setting(); - virtual ~Setting(); - - enum - { - kType_Unknown = 0, - kType_Integer, - kType_Float, - kType_String, - kType_Bool, - kType_ID6, // need to find an example of this - kType_ID, - }; - - union Data - { - UInt32 u32; - SInt32 s32; - float f32; - UInt8 u8; // used for bool - char * s; - }; - -// void ** _vtbl; // 00 - Data data; // 08 - char * name; // 10 - - UInt32 GetType(void) const; - - bool GetDouble(double * out) const; - bool SetDouble(double value); - - bool SetString(const char * value); -}; - -// 128 -class SettingCollectionList -{ -public: - virtual ~SettingCollectionList(); - - struct Entry - { - Setting * setting; - Entry * next; - }; - -// void ** _vtbl; // 000 - UInt64 pad008[(0x118 - 0x008) >> 3]; - Entry items; // 118 - - MEMBER_FN_PREFIX(SettingCollectionList); - DEFINE_MEMBER_FN(Get_Internal, Setting *, 0x00325220, const char * name); - - Setting * Get(const char * name); -}; -STATIC_ASSERT(offsetof(SettingCollectionList, items) == 0x118); - -// 138 -class SettingCollectionMap -{ -public: - virtual ~SettingCollectionMap(); - - Setting * Get(const char * name); - -// void ** _vtbl; // 000 - UInt64 pad008[(0x118 - 0x008) >> 3]; - NiTMap items; // 118 - actually BSTCaseInsensitiveStringMap but that only changes the virtual functions -}; -STATIC_ASSERT(offsetof(SettingCollectionMap, items) == 0x118); - -Setting * GetINISetting(const char * name); - -extern RelocPtr g_iniSettingCollection; -extern RelocPtr g_iniPrefSettingCollection; -extern RelocPtr g_gameSettingCollection; - -extern RelocPtr g_mapLocalHeight; -extern RelocPtr g_localMapMinFrustumWidth; diff --git a/source/fs.dll/skse64/skse64/GameStreams.cpp b/source/fs.dll/skse64/skse64/GameStreams.cpp deleted file mode 100644 index 924b9137..00000000 --- a/source/fs.dll/skse64/skse64/GameStreams.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "GameStreams.h" - -BSResourceNiBinaryStream::BSResourceNiBinaryStream() -{ - // -} - -BSResourceNiBinaryStream::BSResourceNiBinaryStream(const char * path) -{ - CALL_MEMBER_FN(this, Construct)(path, 0, 0); -} - -BSResourceNiBinaryStream::~BSResourceNiBinaryStream() -{ - CALL_MEMBER_FN(this, Destroy)(); -} - -bool BSResourceNiBinaryStream::IsValid(void) -{ - return CALL_MEMBER_FN(this, IsValid)(); -} - -void BSResourceNiBinaryStream::Seek(SInt32 delta) -{ - CALL_MEMBER_FN(this, Seek)(delta); -} - -UInt32 BSResourceNiBinaryStream::GetOffset(void) -{ - return CALL_MEMBER_FN(this, GetOffset)(); -} - -void BSResourceNiBinaryStream::EnableEndianSwap(bool swap) -{ - CALL_MEMBER_FN(this, EnableEndianSwap)(swap); -} - -UInt32 BSResourceNiBinaryStream::ReadLine(char * dst, UInt32 dstLen, UInt32 terminator) -{ - return CALL_MEMBER_FN(this, ReadLine)(dst, dstLen, terminator); -} - -UInt32 BSResourceNiBinaryStream::ReadLine_w(wchar_t * dst, UInt32 dstLen, UInt32 terminator) -{ - wchar_t * iter = dst; - - if(dstLen == 0) - return 0; - - for(UInt32 i = 0; i < dstLen - 1; i++) - { - wchar_t data; - - if(Read(&data, sizeof(data)) != sizeof(data)) - break; - - if(data == terminator) - break; - - *iter++ = data; - } - - // null terminate - *iter = 0; - - return iter - dst; -} - -UInt32 BSResourceNiBinaryStream::Read(void * dst, UInt32 len) -{ - return CALL_MEMBER_FN(this, Read)(dst, len); -} - -UInt32 BSResourceNiBinaryStream::Write(void * src, UInt32 len) -{ - return CALL_MEMBER_FN(this, Write)(src, len); -} - -NiMemStream::NiMemStream() -{ - CALL_MEMBER_FN(this, Construct)(); -} - -NiMemStream::~NiMemStream() -{ - CALL_MEMBER_FN(this, Destroy)(); -} - -void NiMemStream::Seek(SInt32 delta) -{ - CALL_MEMBER_FN(this, Seek)(delta); -} -UInt32 NiMemStream::GetOffset(void) -{ - return CALL_MEMBER_FN(this, GetOffset)(); -} -void NiMemStream::CopyFrom(void * other) -{ - CALL_MEMBER_FN(this, CopyFrom)(other); -} -void NiMemStream::FunctionSwap(bool swap) -{ - CALL_MEMBER_FN(this, FunctionSwap)(swap); -} diff --git a/source/fs.dll/skse64/skse64/GameStreams.h b/source/fs.dll/skse64/skse64/GameStreams.h deleted file mode 100644 index 497bb748..00000000 --- a/source/fs.dll/skse64/skse64/GameStreams.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" - -// class NiBinaryStream -// class NiFile : public NiBinaryStream -// class NiMemStream : public NiBinaryStream -// class OutputInfoStream : public NiBinaryStream -// class BSResourceNiBinaryStream : public NiBinaryStream -// class BSResourceStreamParser : public BSResourceNiBinaryStream -// class BSStreamParserData - -// 20 -class NiBinaryStream -{ -public: - virtual ~NiBinaryStream() { }; - - virtual bool IsValid(void) = 0; - virtual void Seek(SInt32 delta) = 0; - virtual UInt32 GetOffset(void) { return 0; } - - // void ** _vtbl; // 00 - UInt32 unk08; // 08 - UInt32 pad0C; // 0C - void * readFn; // 10 - void * writeFn; // 18 -}; - -class NiMemStream : public NiBinaryStream -{ -public: - NiMemStream(); - virtual ~NiMemStream(); - - virtual bool IsValid(void) { return true; }; - virtual void Seek(SInt32 delta); - virtual UInt32 GetOffset(void); - virtual void CopyFrom(void * other); - virtual void FunctionSwap(bool swap); - - MEMBER_FN_PREFIX(NiMemStream); - DEFINE_MEMBER_FN(Construct, NiMemStream *, 0x0143AA70); - DEFINE_MEMBER_FN(Destroy, void, 0x0143AAE0); - DEFINE_MEMBER_FN(Seek, void, 0x0143AB70, SInt32); - // ??_7NiMemStream@@6B@ + 18 - DEFINE_MEMBER_FN(GetOffset, UInt32, 0x00C4BEF0, void); - DEFINE_MEMBER_FN(CopyFrom, UInt32, 0x0143AB40, void *); - // ??_7NiMemStream@@6B@ + 28 - DEFINE_MEMBER_FN(FunctionSwap, UInt32, 0x0143ABB0, bool); - - void * data; // 20 - UInt32 offset; // 28 - UInt32 unk2C; // 2C - UInt32 unk30; // 30 - Inited to 0x400 - UInt8 flag1; // 34 - UInt8 flag2; // 35 - UInt16 pad36; // 36 -}; - -class BSResourceNiBinaryStream : public NiBinaryStream -{ -public: - BSResourceNiBinaryStream(); - BSResourceNiBinaryStream(const char * path); - virtual ~BSResourceNiBinaryStream(); - - // stub implementations - virtual bool IsValid(void); - virtual void Seek(SInt32 delta); - virtual UInt32 GetOffset(void); - virtual void Unk_04(void) { } - virtual void EnableEndianSwap(bool swap); - - void * unk10; // 20 - void * unk14; // 28 - UInt64 offset; // 30 - - MEMBER_FN_PREFIX(BSResourceNiBinaryStream); - DEFINE_MEMBER_FN(Construct, BSResourceNiBinaryStream *, 0x00C9F5C0, const char * filePath, UInt32 unk1, UInt32 unk2); // unk1 = 0, unk2 = 0 - DEFINE_MEMBER_FN(ReadLine, UInt32, 0x00C9FB00, char * dst, UInt32 dstLen, UInt32 terminator); - - // E93F9EA10EEEC2FC86D868E75F28A023D7453255+51 - DEFINE_MEMBER_FN(Read, UInt32, 0x00C9FCF0, void * dst, UInt32 len); - // E93F9EA10EEEC2FC86D868E75F28A023D7453255+5C - DEFINE_MEMBER_FN(Write, UInt32, 0x00C9FD60, void * src, UInt32 len); - DEFINE_MEMBER_FN(Destroy, void, 0x00C9F8A0); - - DEFINE_MEMBER_FN(IsValid, bool, 0x00C9F9E0, void); - DEFINE_MEMBER_FN(Seek, void, 0x00C9F9F0, SInt32); - // ??_7BSResourceNiBinaryStream@@6B@ + 18 - DEFINE_MEMBER_FN(GetOffset, UInt32, 0x00C9FA30, void); // return offset; - // ??_7BSResourceNiBinaryStream@@6B@ + 28 - DEFINE_MEMBER_FN(EnableEndianSwap, void, 0x00C9FAC0, bool); - - UInt32 ReadLine(char * dst, UInt32 dstLen, UInt32 terminator); - UInt32 ReadLine_w(wchar_t * dst, UInt32 dstLen, UInt32 terminator); // length in characters - UInt32 Read(void * dst, UInt32 len); - UInt32 Write(void * src, UInt32 len); -}; - -STATIC_ASSERT(offsetof(BSResourceNiBinaryStream, readFn) == 0x10); -STATIC_ASSERT(offsetof(BSResourceNiBinaryStream, offset) == 0x30); -STATIC_ASSERT(sizeof(BSResourceNiBinaryStream) == 0x38); diff --git a/source/fs.dll/skse64/skse64/GameThreads.cpp b/source/fs.dll/skse64/skse64/GameThreads.cpp deleted file mode 100644 index c58686ad..00000000 --- a/source/fs.dll/skse64/skse64/GameThreads.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "skse64/GameThreads.h" - -BSTaskPool * BSTaskPool::GetSingleton(void) -{ - // 7D1E14E40FFCA18609B3FAAD0A5750A26162D096+90 - static RelocPtr g_taskPool(0x02FD48A0); - return *g_taskPool; -} diff --git a/source/fs.dll/skse64/skse64/GameTypes.cpp b/source/fs.dll/skse64/skse64/GameTypes.cpp deleted file mode 100644 index 3fea90d6..00000000 --- a/source/fs.dll/skse64/skse64/GameTypes.cpp +++ /dev/null @@ -1,290 +0,0 @@ -#include "skse64/GameTypes.h" - -BSString::~BSString() -{ - if (m_data) - { - Heap_Free(m_data); - m_data = NULL; - } -} - -const char * BSString::Get(void) const -{ - return m_data ? m_data : ""; -} - -StringCache::Ref::Ref() -{ - CALL_MEMBER_FN(this, ctor)(""); -} - - -StringCache::Ref::Ref(const char * buf) -{ - CALL_MEMBER_FN(this, ctor)(buf); -} - -void SimpleLock::Lock(UInt32 pauseAttempts) -{ - SInt32 myThreadID = GetCurrentThreadId(); - - _mm_lfence(); - if (threadID == myThreadID) - { - InterlockedIncrement(&lockCount); - } - else - { - UInt32 attempts = 0; - if (InterlockedCompareExchange(&lockCount, 1, 0)) - { - do - { - ++attempts; - _mm_pause(); - if (attempts >= pauseAttempts) { - UInt32 spinCount = 0; - while (InterlockedCompareExchange(&lockCount, 1, 0)) - Sleep(++spinCount < kFastSpinThreshold ? 0 : 1); - break; - } - } while (InterlockedCompareExchange(&lockCount, 1, 0)); - _mm_lfence(); - } - - threadID = myThreadID; - _mm_sfence(); - } -} - -void SimpleLock::Release(void) -{ - SInt32 myThreadID = GetCurrentThreadId(); - - _mm_lfence(); - if (threadID == myThreadID) - { - if (lockCount == 1) - { - threadID = 0; - _mm_mfence(); - InterlockedCompareExchange(&lockCount, 0, 1); - } - else - { - InterlockedDecrement(&lockCount); - } - } -} - -/*** using runtime internal implementation rather than our reimplementation so it can be hooked by other plugins - -void BSReadWriteLock::LockForRead() -{ - SInt32 myThreadID = GetCurrentThreadId(); - - if (threadID == myThreadID) - { - InterlockedIncrement(&lockValue); - } - else - { - UInt32 lockCount = lockValue & kLockCountMask; - UInt32 spinCount = 0; - UInt32 lockResult = InterlockedCompareExchange(&lockValue, lockCount + 1, lockCount); - while (lockResult != lockCount + 1) - { - if ((lockResult & kLockWrite) != 0) - { - Sleep(++spinCount < kFastSpinThreshold ? 0 : 1); - lockResult = lockValue; - } - - lockCount = lockValue & kLockCountMask; - lockResult = InterlockedCompareExchange(&lockValue, lockCount + 1, lockCount); - } - - threadID = myThreadID; - } -} - -void BSReadWriteLock::LockForWrite() -{ - SInt32 myThreadID = GetCurrentThreadId(); - - if (threadID == myThreadID) - { - InterlockedIncrement(&lockValue); - } - else - { - UInt32 spinCount = 0; - while (InterlockedCompareExchange(&lockValue, UInt32(1 | kLockWrite), 0) != UInt32(1 | kLockWrite)) - Sleep(++spinCount < kFastSpinThreshold ? 0 : 1); - - threadID = myThreadID; - _mm_mfence(); - } -} - -void BSReadWriteLock::LockForReadAndWrite() -{ - SInt32 myThreadID = GetCurrentThreadId(); - - if (threadID == myThreadID) - { - InterlockedIncrement(&lockValue); - } - else - { - UInt32 spinCount = 0; - while (InterlockedCompareExchange(&lockValue, 1, 0) != 1) - Sleep(++spinCount >= kFastSpinThreshold ? 1 : 0); - } -} - -bool BSReadWriteLock::TryLockForWrite() -{ - SInt32 myThreadID = GetCurrentThreadId(); - - bool result = false; - if (threadID == myThreadID) - { - InterlockedIncrement(&lockValue); - result = true; - } - else - { - result = InterlockedCompareExchange(&lockValue, UInt32(1 | kLockWrite), 0) == UInt32(1 | kLockWrite); - if (result) - { - threadID = myThreadID; - _mm_mfence(); - } - } - return result; -} -bool BSReadWriteLock::TryLockForRead() -{ - SInt32 myThreadID = GetCurrentThreadId(); - - bool result = false; - if (threadID == myThreadID) - { - InterlockedIncrement(&lockValue); - result = true; - } - else - { - UInt32 lockCount = lockValue & kLockCountMask; - UInt32 lockResult = InterlockedCompareExchange(&lockValue, lockCount + 1, lockCount); - while ((lockResult & kLockWrite) == 0) - { - if (lockResult == lockCount) - break; - - lockCount = lockResult & kLockCountMask; - lockResult = InterlockedCompareExchange(&lockValue, lockCount + 1, lockCount); - } - - result = ~(lockResult >> 31) & 1; - } - - return result; -} - -void BSReadWriteLock::Unlock() -{ - SInt32 myThreadID = GetCurrentThreadId(); - if (threadID == myThreadID) - { - UInt32 lockCount = lockValue - 1; - if (lockValue == kLockWrite) - { - threadID = 0; - _mm_mfence(); - InterlockedExchange(&lockValue, 0); - } - else - { - InterlockedDecrement(&lockValue); - } - } - else - { - InterlockedDecrement(&lockValue); - } -}*/ - -void UpdateRegistrationHolder::Order(UInt32 index) -{ - UInt32 count = m_regs.count; - UInt32 pivotIndex = count >> 1; - - if (index >= pivotIndex) - return; - - Registration * pOldReg = m_regs[index]; - UInt32 startIndex = index; - UInt32 cmpIndex; - do - { - cmpIndex = 2 * index + 1; - - if (cmpIndex < (count - 1)) - { - Registration * pCur = m_regs[cmpIndex]; - Registration * pSucc = m_regs[cmpIndex + 1]; - if (!pCur || !pSucc || pCur->schedTime > pSucc->schedTime) - cmpIndex++; - } - - Registration * pCmpReg = m_regs[cmpIndex]; - if (!pCmpReg || !pOldReg || pCmpReg->schedTime > pOldReg->schedTime) - break; - - m_regs[index] = pCmpReg; - index = cmpIndex; - - } while (cmpIndex < pivotIndex); - - if (index != startIndex) - m_regs[index] = pOldReg; - -} - -bool UpdateRegistrationHolder::Remove(UInt64 & handle) -{ - if (m_regs.count == 0) - return false; - - for (UInt32 i = 0; ihandle == handle) - { - UInt32 lastIndex = m_regs.count - 1; - - // Remove last entry => no reorganizing necessary - if (i == lastIndex) - { - pReg->Release(); - m_regs.count--; - } - else - { - m_regs[i] = m_regs[lastIndex]; - m_regs[lastIndex] = pReg; // seems pointless, but the original code does it - - pReg->Release(); - m_regs.count--; - - Order(i); - } - return true; - } - } - return false; -} diff --git a/source/fs.dll/skse64/skse64/GameTypes.h b/source/fs.dll/skse64/skse64/GameTypes.h deleted file mode 100644 index 83eb96b6..00000000 --- a/source/fs.dll/skse64/skse64/GameTypes.h +++ /dev/null @@ -1,1320 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/GameAPI.h" - -class TESForm; - -// 08 -struct BSIntrusiveRefCounted -{ -public: - volatile UInt32 m_refCount; // 00 - UInt32 unk04; // 04 -}; - -// 04 -template -class BSTSmartPointer -{ -public: - // refcounted - T * ptr; -}; - - -//// 04 -//struct BSNonReentrantSpinLock -//{ -//public: -// volatile UInt32 uiLock; // 00 -//}; -// - -// 08 -class SimpleLock -{ - enum - { - kFastSpinThreshold = 10000 - }; - - volatile SInt32 threadID; // 00 - volatile UInt32 lockCount; // 04 - -public: - SimpleLock() : threadID(0), lockCount(0) {} - - void Lock(UInt32 pauseAttempts = 0); - void Release(void); -}; -STATIC_ASSERT(sizeof(SimpleLock) == 0x8); - -class SimpleLocker -{ -public: - SimpleLocker(SimpleLock * dataHolder) { m_lock = dataHolder; m_lock->Lock(); } - ~SimpleLocker() { m_lock->Release(); } - -protected: - SimpleLock * m_lock; -}; - -// 08 -class BSReadWriteLock -{ - enum - { - kFastSpinThreshold = 10000, - kLockWrite = 0x80000000, - kLockCountMask = 0xFFFFFFF - }; - - volatile SInt32 threadID; // 00 - volatile UInt32 lockValue; // 04 - -public: - BSReadWriteLock() : threadID(0), lockValue(0) {} - - //void LockForRead(); - //void LockForWrite(); - MEMBER_FN_PREFIX(BSReadWriteLock); - DEFINE_MEMBER_FN(LockForRead, void, 0x00C2CD50); - DEFINE_MEMBER_FN(LockForWrite, void, 0x00C2CDD0); - DEFINE_MEMBER_FN(UnlockRead, void, 0x00C2D010); - DEFINE_MEMBER_FN(UnlockWrite, void, 0x00C2D020); - DEFINE_MEMBER_FN(LockForReadAndWrite, void, 0x00C2CED0); - DEFINE_MEMBER_FN(TryLockForWrite, bool, 0x00C2CFC0); -}; -STATIC_ASSERT(sizeof(BSReadWriteLock) == 0x8); - -class BSReadLocker -{ -public: - BSReadLocker(BSReadWriteLock * lock) { m_lock = lock; CALL_MEMBER_FN(m_lock, LockForRead)(); } - ~BSReadLocker() { CALL_MEMBER_FN(m_lock, UnlockRead)(); } - -protected: - BSReadWriteLock * m_lock; -}; - -class BSWriteLocker -{ -public: - BSWriteLocker(BSReadWriteLock * lock) { m_lock = lock; CALL_MEMBER_FN(m_lock, LockForWrite)(); } - ~BSWriteLocker() { CALL_MEMBER_FN(m_lock, UnlockWrite)(); } - -protected: - BSReadWriteLock * m_lock; -}; - -class BSReadAndWriteLocker -{ -public: - BSReadAndWriteLocker(BSReadWriteLock * lock) { m_lock = lock; CALL_MEMBER_FN(m_lock, LockForReadAndWrite)(); } - ~BSReadAndWriteLocker() { CALL_MEMBER_FN(m_lock, UnlockWrite)(); } - -protected: - BSReadWriteLock * m_lock; -}; - -// 80808 -class StringCache -{ -public: - struct Ref - { - const char * data; - - MEMBER_FN_PREFIX(Ref); - DEFINE_MEMBER_FN(ctor, Ref *, 0x00C4F780, const char * buf); - // 31D79EFB15D5E4B34BD32D03A46EAFF65C28ACFB+CB - DEFINE_MEMBER_FN(ctor_ref, Ref *, 0x00C4F830, const Ref & rhs); - DEFINE_MEMBER_FN(Set, Ref *, 0x00C4F910, const char * buf); - // 31D79EFB15D5E4B34BD32D03A46EAFF65C28ACFB+41 - DEFINE_MEMBER_FN(Set_ref, Ref *, 0x00C4F9D0, const Ref & rhs); - // 46F6DC561A3C9677037E58B55951C58A08E41C47+4A - DEFINE_MEMBER_FN(Release, void, 0x00C50B50); - - Ref(); - Ref(const char * buf); - - void Release() { CALL_MEMBER_FN(this, Release)(); } - - bool operator==(const Ref& lhs) const { return data == lhs.data; } - bool operator<(const Ref& lhs) const { return data < lhs.data; } - - const char * c_str() const { return operator const char *(); } - const char * Get() const { return c_str(); } - operator const char *() const { return data ? data : ""; } - }; - - // 10 - struct Lock - { - UInt32 unk00; // 00 - set to 80000000 when locked - UInt32 pad04; // 04 - UInt64 pad08; // 08 - }; - - void * lut[0x10000]; // 00000 - Lock lock[0x80]; // 80000 - UInt8 isInit; // 80800 -}; - -typedef StringCache::Ref BSFixedString; - -//class BSAutoFixedString : public BSFixedString -//{ -//public: -// BSAutoFixedString() : BSFixedString() { } -// BSAutoFixedString(const char * buf) : BSFixedString(buf) { } -// -// ~BSAutoFixedString() -// { -// Release(); -// } -//}; - -// 10 -class BSString -{ -public: - BSString() :m_data(NULL), m_dataLen(0), m_bufLen(0) { } - ~BSString(); - - const char * Get(void) const; - - MEMBER_FN_PREFIX(BSString); - DEFINE_MEMBER_FN(Set, bool, 0x00103D50, const char * str, UInt32 len); // len default 0 - -private: - char * m_data; // 00 - UInt16 m_dataLen; // 08 - UInt16 m_bufLen; // 0A - UInt32 pad0C; // 0C -}; - - -// Container types - -// 18 -template -class tArray -{ -public: - T* entries; // 00 - UInt32 capacity; // 08 - UInt32 pad0C; // 0C - UInt32 count; // 10 - UInt32 pad14; // 14 - - tArray() : entries(NULL), capacity(0), count(0), pad0C(0), pad14(0) { } - - T& operator[](UInt64 index) - { - return entries[index]; - } - - void Clear() - { - Heap_Free(entries); - entries = NULL; - capacity = 0; - count = 0; - } - - bool Allocate(UInt32 numEntries) - { - entries = (T *)Heap_Allocate(sizeof(T) * numEntries); - if(!entries) return false; - - for(UInt32 i = 0; i < numEntries; i++) - new (&entries[i]) T; - - capacity = numEntries; - count = numEntries; - - return true; - } - - bool CopyFrom(const tArray * rhs) - { - if (rhs->count == 0) return false; - if (!rhs->entries) return false; - - if (entries) - Clear(); - - if (!Allocate(rhs->count)) return false; - memcpy(entries, rhs->entries, sizeof(T) * count); - return true; - } - - - - bool Resize(UInt32 numEntries) - { - if(numEntries == capacity) - return false; - - if(!entries) { - Allocate(numEntries); - return true; - } - if(numEntries < capacity) { - // Delete the truncated entries - for(UInt32 i = numEntries; i < capacity; i++) - delete &entries[i]; - } - - T * newBlock = (T *)Heap_Allocate(sizeof(T) * numEntries); // Create a new block - memmove_s(newBlock, sizeof(T) * numEntries, entries, sizeof(T) * numEntries); // Move the old memory to the new block - if(numEntries > capacity) { // Fill in new remaining entries - for(UInt32 i = capacity; i < numEntries; i++) - new (&entries[i]) T; - } - Heap_Free(entries); // Free the old block - entries = newBlock; // Assign the new block - capacity = numEntries; // Capacity is now the number of total entries in the block - count = min(capacity, count); // Count stays the same, or is truncated to capacity - return true; - } - - bool Push(const T & entry) - { - if(!entries || count + 1 > capacity) { - if(!Grow(nGrow)) - return false; - } - - new (&entries[count]) T(entry); - count++; - return true; - }; - - bool Insert(UInt32 index, const T & entry) - { - if(!entries || index < count) - return false; - - entries[index] = entry; - return true; - }; - - bool Remove(UInt32 index) - { - if(!entries || index >= count) - return false; - - // This might not be right for pointer types... - (&entries[index])->~T(); - - if(index + 1 < count) { - UInt32 remaining = count - index; - memmove_s(&entries[index + 1], sizeof(T) * remaining, &entries[index], sizeof(T) * remaining); // Move the rest up - } - count--; - - if(capacity > count + nShrink) - Shrink(); - - return true; - } - - bool Shrink() - { - if(!entries || count == capacity) return false; - - try { - UInt32 newSize = count; - T * oldArray = entries; - T * newArray = (T *)Heap_Allocate(sizeof(T) * newSize); // Allocate new block - memmove_s(newArray, sizeof(T) * newSize, entries, sizeof(T) * newSize); // Move the old block - entries = newArray; - capacity = count; - Heap_Free(oldArray); // Free the old block - return true; - } - catch(...) { - return false; - } - - return false; - } - - bool Grow(UInt32 numEntries) - { - if(!entries) { - entries = (T *)Heap_Allocate(sizeof(T) * numEntries); - count = 0; - capacity = numEntries; - return true; - } - - try { - UInt32 oldSize = capacity; - UInt32 newSize = oldSize + numEntries; - T * oldArray = entries; - T * newArray = (T *)Heap_Allocate(sizeof(T) * newSize); // Allocate new block - if(oldArray) - memmove_s(newArray, sizeof(T) * newSize, entries, sizeof(T) * capacity); // Move the old block - entries = newArray; - capacity = newSize; - - if(oldArray) - Heap_Free(oldArray); // Free the old block - - for(UInt32 i = oldSize; i < newSize; i++) // Allocate the rest of the free blocks - new (&entries[i]) T; - - return true; - } - catch(...) { - return false; - } - - return false; - } - - bool GetNthItem(UInt64 index, T& pT) const - { - if (index < count) { - pT = entries[index]; - return true; - } - return false; - } - - SInt64 GetItemIndex(T & pFind) const - { - for (UInt64 n = 0; n < count; n++) { - T& pT = entries[n]; - if (pT == pFind) - return n; - } - return -1; - } - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free) -}; - -//template -//class tMutexArray : public tArray -//{ -//public: -// SimpleLock lock; // 18 -//}; - -typedef tArray UnkArray; -typedef tArray UnkFormArray; - -// Returns if/where the element was found, otherwise indexOut can be used as insert position -template -bool GetSortIndex(tArray & arr, T & elem, SInt32 & indexOut) -{ - UInt32 count = arr.count; - if (count == 0) - { - indexOut = 0; - return false; - } - - SInt32 leftIdx = 0; - SInt32 rightIdx = count - 1; - - while (true) - { - UInt32 pivotIdx = leftIdx + ((rightIdx - leftIdx) / 2); - - T & p = arr[pivotIdx]; - - if (elem == p) - { - indexOut = pivotIdx; - return true; - } - else if (elem > p) - { - leftIdx = pivotIdx + 1; - } - else - { - rightIdx = pivotIdx - 1; - } - - if (leftIdx > rightIdx) - { - indexOut = leftIdx; - return false; - } - } -} - -enum { - eListCount = -3, - eListEnd = -2, - eListInvalid = -1, -}; - -// 10 -template -class tList -{ - enum { - eListCount = -3, - eListEnd = -2, - eListInvalid = -1, - }; - struct _Node - { - - T * item; // 00 - _Node* next; // 04 - - T * Item() const { return item; } - _Node* Next() const { return next; } - - T * Remove(_Node * pred) - { - T * pRemoved = item; - _Node * pNext = next; - - // become the next entry and return my item - if (pNext) - { - item = pNext->item; - next = pNext->next; - Heap_Free(pNext); - } - // tail? - else - { - item = NULL; - next = NULL; - - // has precedessor, so tail != head - if (pred) - { - pred->next = NULL; - Heap_Free(this); - } - } - return pRemoved; - } - }; - - _Node m_listHead; // 00 - -private: - - _Node * Head() const { return const_cast<_Node*>(&m_listHead); } - - _Node * Tail() const - { - _Node * node = const_cast<_Node*>(&m_listHead); - - if (node) - while (node->next) node = node->next; - - return node; - } - - template - UInt32 FreeNodes(Op &compareOp) - { - UInt32 numFreed = 0; - - _Node * pPred = NULL; - _Node * pCur = Head(); - - while (pCur) - { - if (pCur->next) - { - if (compareOp.Accept(pCur->item)) - { - pCur->Remove(pPred); - numFreed++; - } - else - { - pPred = pCur; - pCur = pCur->next; - } - } - // List Tail? - else - { - if (compareOp.Accept(pCur->item)) - { - pCur->Remove(pPred); - numFreed++; - } - break; - } - } - - return numFreed; - } - - struct NodePos - { - NodePos(): node(NULL), index(eListInvalid) {} - - _Node* node; - SInt32 index; - }; - - - NodePos GetNthNode(SInt32 index) const - { - NodePos pos; - SInt32 n = 0; - _Node* pCur = Head(); - - while (pCur && pCur->Item()) - { - if (n == index) break; - if (eListEnd == index && !pCur->Next()) break; - pCur = pCur->Next(); - ++n; - } - - pos.node = pCur; - pos.index = n; - - return pos; - } - -public: - - // Allocate list as a single empty node - static tList * Create(void) - { - tList * p = (tList *)Heap_Allocate(sizeof(tList)); - ASSERT(p); - - p->m_listHead.item = NULL; - p->m_listHead.next = NULL; - - return p; - } - - void Delete(void) - { - RemoveAll(); - Heap_Free(&m_listHead); - } - - class Iterator - { - _Node * m_cur; - public: - Iterator() : m_cur(NULL) {} - Iterator(_Node* node) : m_cur(node) { } - Iterator operator++() { if (!End()) m_cur = m_cur->Next(); return *this;} - bool End() { return m_cur == NULL; } - const T * operator->() { return (m_cur) ? m_cur->Item() : NULL; } - const T * operator*() { return (m_cur) ? m_cur->Item() : NULL; } - const Iterator& operator=(const Iterator& rhs) { - m_cur = rhs.m_cur; - return *this; - } - T * Get() { return (m_cur) ? m_cur->Item() : NULL; } - }; - - const Iterator Begin() const { return Iterator(Head()); } - - void Insert(T * item) - { - // add new node if we aren't empty - if (m_listHead.item) - { - // copy head in to new node - _Node * node = (_Node *)Heap_Allocate(sizeof(_Node)); - ASSERT(node); - - node->item = m_listHead.item; - node->next = m_listHead.next; - - m_listHead.next = node; - } - - m_listHead.item = item; - } - - void Push(T * item) - { - _Node * tail = Tail(); - - // add new node if we aren't empty - if (tail->item) - { - _Node * node = (_Node *)Heap_Allocate(sizeof(_Node)); - ASSERT(node); - - tail->next = node; - - node->item = item; - node->next = NULL; - } - else - { - tail->item = item; - } - } - - T * AddFront(void) - { - T * item = (T *)Heap_Allocate(sizeof(T)); - if(!item) - return NULL; - - new (item) T; - - Insert(item); - return item; - } - - T * AddBack(void) - { - T * item = (T *)Heap_Allocate(sizeof(T)); - if(!item) - return NULL; - - new (item) T; - - Push(item); - return item; - } - - void Append(Iterator source) - { - while (!source.End()) - { - Push(source.Get()); - ++source; - } - } - - UInt32 Count() const - { - NodePos pos = GetNthNode(eListCount); - return (pos.index > 0) ? pos.index : 0; - }; - - T * GetNthItem(SInt32 n) const - { - NodePos pos = GetNthNode(n); - return (pos.index == n && pos.node) ? pos.node->Item() : NULL; - } - - T * GetLastItem() const - { - NodePos pos = GetNthNode(eListEnd); - return pos.node->Item(); - } - - SInt32 AddAt(T * item, SInt32 index) - { - if (!m_listHead.item) { - m_listHead.item = item; - return 0; - } - - NodePos pos = GetNthNode(index); - _Node* pTargetNode = pos.node; - _Node* newNode = (_Node*)Heap_Allocate(sizeof(_Node)); - if (newNode && pTargetNode) { - if (index == eListEnd) { - pTargetNode->next = newNode; - newNode->item = item; - newNode->next = NULL; - } else { - newNode->item = pTargetNode->item; - newNode->next = pTargetNode->next; - pTargetNode->item = item; - pTargetNode->next = newNode; - } - return pos.index; - } - return eListInvalid; - } - - template - void Visit(Op& op, _Node* prev = NULL) const { - const _Node* pCur = (prev) ? prev->next : Head(); - bool bContinue = true; - while (pCur && bContinue) { - bContinue = op.Accept(pCur->Item()); - if (bContinue) { - pCur = pCur->next; - } - } - } - - template - T * Find(Op& op) const - { - const _Node* pCur = Head(); - - bool bFound = false; - while (pCur && !bFound) - { - if (!pCur->Item()) - pCur = pCur->Next(); - else - { - bFound = op.Accept(pCur->Item()); - if (!bFound) - pCur = pCur->Next(); - } - } - return (bFound && pCur) ? pCur->Item() : NULL; - } - - template - Iterator Find(Op& op, Iterator prev) const - { - Iterator curIt = (prev.End()) ? Begin() : ++prev; - bool bFound = false; - - while(!curIt.End() && !bFound) { - const T * pCur = *curIt; - if (pCur) { - bFound = op.Accept(pCur); - } - if (!bFound) { - ++curIt; - } - } - return curIt; - } - - const _Node* FindString(char* str, Iterator prev) const - { - return Find(StringFinder_CI(str), prev); - } - - template - UInt32 CountIf(Op& op) const - { - UInt32 count = 0; - const _Node* pCur = Head(); - while (pCur) - { - if (pCur->Item() && op.Accept(pCur->Item())) - count++; - pCur = pCur->Next(); - } - return count; - } - - class AcceptAll { - public: - bool Accept(T * item) { - return true; - } - }; - - void RemoveAll() - { - FreeNodes(AcceptAll()); - } - - T * RemoveNth(SInt32 n) - { - Item* pRemoved = NULL; - if (n == 0) { - pRemoved = m_listHead.RemoveMe(); - } else if (n > 0) { - NodePos nodePos = GetNthNode(n); - if (nodePos.node && nodePos.index == n) { - pRemoved = nodePos.node->RemoveMe(); - } - } - return pRemoved; - }; - - T * ReplaceNth(SInt32 n, T* item) - { - Item* pReplaced = NULL; - NodePos nodePos = GetNthNode(n); - if (nodePos.node && nodePos.index == n) { - pReplaced = nodePos.node->item; - nodePos.node->item = item; - } - return pReplaced; - } - - template - UInt32 RemoveIf(Op& op) - { - return FreeNodes(op); - } - - template - SInt32 GetIndexOf(Op& op) - { - SInt32 idx = 0; - const _Node* pCur = Head(); - while (pCur && pCur->Item() && !op.Accept(pCur->Item())) - { - idx++; - pCur = pCur->Next(); - } - - if (pCur && pCur->Item()) - return idx; - else - return -1; - } - - class AcceptEqual { - public: - T * item; - - AcceptEqual(T * a_item) : item(a_item) {} - - bool Accept(T * a_item) { - return *item == *a_item; - } - }; - - bool Contains(T * item) const - { - return Find(AcceptEqual(item)) != NULL; - } - - void Dump(void) - { - _MESSAGE("tList:"); - _MESSAGE("> count: %d", Count()); - - const _Node* pCur = Head(); - UInt32 i = 0; - while (pCur) - { - _MESSAGE("* %d :", i); - //_MESSAGE("\t\titem: %08X", pCur->item); - if (pCur->item) - _MESSAGE("\t\t*item: %d", *pCur->item); - _MESSAGE("\t\tnext: %08X", pCur->next); - - i++; - pCur = pCur->next; - } - } -}; - -// -//STATIC_ASSERT(sizeof(tList) == 0x10); -// -// 30 -template -class tHashSet -{ - class _Entry - { - public: - Item item; - _Entry * next; - - _Entry() : next(NULL) {} - - bool IsFree() const { return next == NULL; } - void SetFree() { next = NULL; } - - void Dump(void) - { - item.Dump(); - _MESSAGE("\t\tnext: %08X", next); - } - }; - - // When creating a new tHashSet, init sentinel pointer with address of this entry - static _Entry sentinel; - - void * unk00; // 000 - UInt32 unk_000; // 008 - UInt32 m_size; // 00C - UInt32 m_freeCount; // 010 - UInt32 m_freeOffset; // 014 - _Entry * m_eolPtr; // 018 - UInt64 unk_018; // 020 - _Entry * m_entries; // 028 - - - _Entry * GetEntry(UInt32 hash) const - { - return (_Entry*) (((uintptr_t) m_entries) + sizeof(_Entry) * (hash & (m_size - 1))); - } - - _Entry * GetEntryAt(UInt32 index) const - { - return (_Entry*) (((uintptr_t) m_entries) + sizeof(_Entry) * index); - } - - _Entry * NextFreeEntry(void) - { - _Entry * result = NULL; - - if (m_freeCount == 0) - return NULL; - - do - { - m_freeOffset = (m_size - 1) & (m_freeOffset - 1); - _Entry * entry = GetEntryAt(m_freeOffset); - - if (entry->IsFree()) - result = entry; - } - while (!result); - - m_freeCount--; - - return result; - } - - enum InsertResult - { - kInsert_Duplicate = -1, - kInsert_OutOfSpace = 0, - kInsert_Success = 1 - }; - - InsertResult Insert(Item * item) - { - if (! m_entries) - return kInsert_OutOfSpace; - - Key k = (Key)*item; - _Entry * targetEntry = GetEntry(Item::GetHash(&k)); - - // Case 1: Target entry is free - if (targetEntry->IsFree()) - { - targetEntry->item = *item; - targetEntry->next = m_eolPtr; - --m_freeCount; - - return kInsert_Success; - } - - // -- Target entry is already in use - - // Case 2: Item already included - _Entry * p = targetEntry; - do - { - if (p->item == *item) - return kInsert_Duplicate; - p = p->next; - } - while (p != m_eolPtr); - - // -- Either hash collision or bucket overlap - - _Entry * freeEntry = NextFreeEntry(); - // No more space? - if (!freeEntry) - return kInsert_OutOfSpace; - - // Original position of the entry that currently uses the target position - k = (Key)targetEntry->item; - p = GetEntry(Item::GetHash(&k)); - - // Case 3a: Hash collision - insert new entry between target entry and successor - if (targetEntry == p) - { - freeEntry->item = *item; - freeEntry->next = targetEntry->next; - targetEntry->next = freeEntry; - - return kInsert_Success; - } - // Case 3b: Bucket overlap - else - { - while (p->next != targetEntry) - p = p->next; - - freeEntry->item = targetEntry->item; - freeEntry->next = targetEntry->next; - - p->next = freeEntry; - targetEntry->item = *item; - targetEntry->next = m_eolPtr; - - return kInsert_Success; - } - } - - bool CopyEntry(_Entry * sourceEntry) - { - if (! m_entries) - return false; - - Key k = (Key)sourceEntry->item; - _Entry * targetEntry = GetEntry(Item::GetHash(&k)); - - // Case 1: Target location is unused - if (!targetEntry->next) - { - targetEntry->item = sourceEntry->item; - targetEntry->next = m_eolPtr; - --m_freeCount; - - return true; - } - - // Target location is in use. Either hash collision or bucket overlap. - - _Entry * freeEntry = NextFreeEntry(); - k = (Key)targetEntry->item; - _Entry * p = GetEntry(Item::GetHash(&k)); - - // Case 2a: Hash collision - insert new entry between target entry and successor - if (targetEntry == p) - { - freeEntry->item = sourceEntry->item; - freeEntry->next = targetEntry->next; - targetEntry->next = freeEntry; - - return true; - } - - // Case 2b: Bucket overlap - forward until hash collision is found, then insert - while (p->next != targetEntry) - p = p->next; - - // Source entry takes position of target entry - not completely understood yet - freeEntry->item = targetEntry->item; - freeEntry->next = targetEntry->next; - p->next = freeEntry; - targetEntry->item = sourceEntry->item; - targetEntry->next = m_eolPtr; - - return true; - } - - void Grow(void) - { - UInt32 oldSize = m_size; - UInt32 newSize = oldSize ? 2*oldSize : 8; - - _Entry * oldEntries = m_entries; - _Entry * newEntries = (_Entry*)Heap_Allocate(newSize * sizeof(_Entry)); - ASSERT(newEntries); - - m_entries = newEntries; - m_size = m_freeCount = m_freeOffset = newSize; - - // Initialize new table data (clear next pointers) - _Entry * p = newEntries; - for (UInt32 i = 0; i < newSize; i++, p++) - p->SetFree(); - - // Copy old entries, free old table data - if (oldEntries) - { - _Entry * p = oldEntries; - for (UInt32 i = 0; i < oldSize; i++, p++) - if (p->next) - CopyEntry(p); - Heap_Free(oldEntries); - } - } - -public: - - tHashSet() : m_size(0), m_freeCount(0), m_freeOffset(0), m_entries(NULL), m_eolPtr(&sentinel) { } - - UInt32 Size() const { return m_size; } - UInt32 FreeCount() const { return m_freeCount; } - UInt32 FillCount() const { return m_size - m_freeCount; } - - Item * Find(Key * key) const - { - if (!m_entries) - return NULL; - - _Entry * entry = GetEntry(Item::GetHash(key)); - if (! entry->next) - return NULL; - - while (!(entry->item == *key)) - { - entry = entry->next; - if (entry == m_eolPtr) - return NULL; - } - - return &entry->item; - } - - bool Add(Item * item) - { - InsertResult result; - - for (result = Insert(item); result == kInsert_OutOfSpace; result = Insert(item)) - Grow(); - - return result == kInsert_Success; - } - - bool Remove(Key * key) - { - if ( !m_entries) - return false; - - _Entry * entry = GetEntry(Item::GetHash(key)); - if (! entry->next) - return NULL; - - _Entry * prevEntry = NULL; - while (! (entry->item == *key)) - { - prevEntry = entry; - entry = entry->next; - if (entry == m_eolPtr) - return false; - } - - // Remove tail? - _Entry * nextEntry = entry->next; - if (nextEntry == m_eolPtr) - { - if (prevEntry) - prevEntry->next = m_eolPtr; - entry->next = NULL; - } - else - { - entry->item = nextEntry->item; - entry->next = nextEntry->next; - nextEntry->next = NULL; - } - - ++m_freeCount; - return true; - } - - void Clear(void) - { - if (m_entries) - { - _Entry * p = m_entries; - for (UInt32 i = 0; i < m_size; i++, p++) - p->next = NULL; - } - else - { - m_size = 0; - } - m_freeCount = m_freeOffset = m_size; - } - - template - void ForEach(T& functor) - { - if (!m_entries) - return; - - if(m_size == m_freeCount) // The whole thing is free - return; - - _Entry * cur = m_entries; - _Entry * end = GetEntryAt(m_size); // one index beyond the entries data to check if we reached that point - - if (cur == end) - return; - - if (cur->IsFree()) - { - // Forward to first non-free entry - do cur++; - while (cur != end && cur->IsFree()); - } - - do - { - if (! functor(&cur->item)) - return; - - // Forward to next non-free entry - do cur++; - while (cur != end && cur->IsFree()); - - } while (cur != end); - } - - void Dump(void) - { - _MESSAGE("tHashSet:"); - _MESSAGE("> size: %d", Size()); - _MESSAGE("> free: %d", FreeCount()); - _MESSAGE("> filled: %d", FillCount()); - if (m_entries) - { - _Entry * p = m_entries; - for (UInt32 i = 0; i < m_size; i++, p++) { - _MESSAGE("* %d %s:", i, p->IsFree()?"(free)" : ""); - if (!p->IsFree()) - p->Dump(); - } - } - } - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free) -}; - -template -typename tHashSet::_Entry tHashSet::sentinel = tHashSet::_Entry(); - -// Don't know if this really is a native type or if sometimes locks are just placed before data structures. -template -class SafeDataHolder -{ -protected: - mutable SimpleLock m_lock; -public: - T m_data; - - void Lock(void) { m_lock.Lock(); } - void Release(void) { m_lock.Release(); } - - template friend class SafeDataLocker; -}; - -// 18 -// Some generic type but I haven't figured it out yet -class UpdateRegistrationHolder -{ - // 018 - class Registration - { - public: - volatile SInt32 refCount; // 00 - bool runOnce; // 04 - UInt8 pad05; // 05 - UInt16 pad06; // 06 - UInt32 schedTime; // 08 - UInt32 interval; // 0C - UInt64 handle; // 10 - - void Release(void) - { - if (InterlockedDecrement(&refCount) == 0) Heap_Free(this); - } - }; - - tArray m_regs; // 00 - - void Order(UInt32 index); - -public: - bool Remove(UInt64 & handle); -}; diff --git a/source/fs.dll/skse64/skse64/GameUtilities.cpp b/source/fs.dll/skse64/skse64/GameUtilities.cpp deleted file mode 100644 index 5c798d0f..00000000 --- a/source/fs.dll/skse64/skse64/GameUtilities.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "skse64/GameUtilities.h" - -RelocAddr <_CalculateCRC32_64> CalculateCRC32_64(0x00C2C0F0); -RelocAddr <_CalculateCRC32_32> CalculateCRC32_32(0x00C2C070); diff --git a/source/fs.dll/skse64/skse64/GameUtilities.h b/source/fs.dll/skse64/skse64/GameUtilities.h deleted file mode 100644 index ca288447..00000000 --- a/source/fs.dll/skse64/skse64/GameUtilities.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "skse64_common/Relocation.h" - -typedef void(*_CalculateCRC32_64)(UInt32 * out, UInt64 data); -extern RelocAddr <_CalculateCRC32_64> CalculateCRC32_64; - -typedef void(*_CalculateCRC32_32)(UInt32 * out, UInt32 data); -extern RelocAddr <_CalculateCRC32_32> CalculateCRC32_32; diff --git a/source/fs.dll/skse64/skse64/GlobalLocks.cpp b/source/fs.dll/skse64/skse64/GlobalLocks.cpp deleted file mode 100644 index 9538f39f..00000000 --- a/source/fs.dll/skse64/skse64/GlobalLocks.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "GlobalLocks.h" -#include "common/ICriticalSection.h" - -ICriticalSection g_loadGameLock; diff --git a/source/fs.dll/skse64/skse64/GlobalLocks.h b/source/fs.dll/skse64/skse64/GlobalLocks.h deleted file mode 100644 index d0fe02fc..00000000 --- a/source/fs.dll/skse64/skse64/GlobalLocks.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "common/ICriticalSection.h" - -extern ICriticalSection g_loadGameLock; diff --git a/source/fs.dll/skse64/skse64/HashUtil.cpp b/source/fs.dll/skse64/skse64/HashUtil.cpp deleted file mode 100644 index ddf52b38..00000000 --- a/source/fs.dll/skse64/skse64/HashUtil.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "HashUtil.h" - -static const UInt32 s_crc32Lookup[256] = -{ - 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3, - 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, - 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7, - 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, - 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B, - 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, - 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, - 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, - 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433, - 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, - 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457, - 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, - 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB, - 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, - 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F, - 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, - 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683, - 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, - 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7, - 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, - 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, - 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, - 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F, - 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, - 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713, - 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, - 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777, - 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, - 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB, - 0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9, - 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF, - 0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D -}; - -namespace HashUtil -{ - UInt32 CRC32(const char* str, UInt32 start) - { - UInt32 result = ~start; - unsigned char* c = (unsigned char*) str; - size_t len = strlen(str); - while (len-- > 0) - result = (result >> 8) ^ s_crc32Lookup[(result & 0xFF) ^ *c++]; - return ~result; - } -} diff --git a/source/fs.dll/skse64/skse64/HashUtil.h b/source/fs.dll/skse64/skse64/HashUtil.h deleted file mode 100644 index afd814d1..00000000 --- a/source/fs.dll/skse64/skse64/HashUtil.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -namespace HashUtil -{ - // Calc CRC32 of null terminated string - UInt32 CRC32(const char* str, UInt32 start = 0); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Camera.cpp b/source/fs.dll/skse64/skse64/Hooks_Camera.cpp deleted file mode 100644 index cbfb348c..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Camera.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "Hooks_Camera.h" -#include "GameCamera.h" -#include "PapyrusEvents.h" -#include "skse64_common/BranchTrampoline.h" -#include "skse64_common/SafeWrite.h" -#include "xbyak/xbyak.h" -#include - -RelocAddr kInstallCameraHook_Base(0x0050F050); - -void InstallCameraHook(TESCameraState * oldState, TESCameraState * newState) -{ - SKSECameraEvent evn(oldState, newState); - g_cameraEventDispatcher.SendEvent(&evn); -} - -void Hooks_Camera_Commit(void) -{ - struct InstallHookCamera_Code : Xbyak::CodeGenerator { - InstallHookCamera_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - Xbyak::Label origFunctionP5; - - push(r12); - push(r13); - sub(rsp, 0x28); // Remainder that stack must keep 16 bytes alignment or bad things will happen - - mov(r12, rcx); - mov(r13, ptr[rcx + 0x28]); - - // Original code - mov(ptr[rsp], rbx); // Using rsp+0 instead of rsp+8 of original instruction, because call will decrement rsp - call(ptr[rip + origFunctionP5]); - - mov(rcx, r13); // oldState - mov(rdx, ptr[r12 + 0x28]); // newState - mov(rax, (uintptr_t)InstallCameraHook); - call(rax); - - add(rsp, 0x28); - pop(r13); - pop(r12); - ret(); - - L(origFunctionP5); - dq(kInstallCameraHook_Base.GetUIntPtr() + 0x5); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - InstallHookCamera_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kInstallCameraHook_Base.GetUIntPtr(), uintptr_t(code.getCode())); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Camera.h b/source/fs.dll/skse64/skse64/Hooks_Camera.h deleted file mode 100644 index 2c48d4fb..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Camera.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void Hooks_Camera_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Data.cpp b/source/fs.dll/skse64/skse64/Hooks_Data.cpp deleted file mode 100644 index b564b10b..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Data.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Hooks_Data.h" -#include "GameData.h" -#include "PluginManager.h" -#include "skse64_common/BranchTrampoline.h" - -UInt32 DataHandler::LoadScripts_Hook() -{ - UInt32 ret = CALL_MEMBER_FN(this, LoadScripts)(); - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_DataLoaded, (void*)NULL, 0, NULL); - return ret; -} - -RelocAddr LoadScripts_Enter(0x005D7A20 + 0x3EB); - -void Hooks_Data_Commit(void) -{ - g_branchTrampoline.Write5Call(LoadScripts_Enter.GetUIntPtr(), GetFnAddr(&DataHandler::LoadScripts_Hook)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Data.h b/source/fs.dll/skse64/skse64/Hooks_Data.h deleted file mode 100644 index 09bfcc08..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Data.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void Hooks_Data_Commit(void); \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/Hooks_Debug.cpp b/source/fs.dll/skse64/skse64/Hooks_Debug.cpp deleted file mode 100644 index 014885af..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Debug.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include "Hooks_Debug.h" -#include "common/IInterlockedLong.h" -#include "common/IFileStream.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/SafeWrite.h" -#include -#include - -static HMODULE s_dbgHelpDLL = NULL; - -typedef BOOL (__stdcall * _MiniDumpWriteDump)(HANDLE hProcess, DWORD ProcessId, HANDLE hFile, MINIDUMP_TYPE DumpType, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); -static _MiniDumpWriteDump s_dbgHelpWriteDump = NULL; - -static LPTOP_LEVEL_EXCEPTION_FILTER s_oldExceptionFilter = NULL; -static SYSTEMTIME s_launchTime; -static char s_crashDumpPath[MAX_PATH]; - -static IInterlockedLong s_inExceptionFilter; - -// ignore these crash points to make dumps less spammy -const char * IsKnownCrash(EXCEPTION_POINTERS * info) -{ - return NULL; -} - -LONG WINAPI ExceptionFilter(EXCEPTION_POINTERS * info) -{ - if(s_inExceptionFilter.Claim()) - { - bool writeDump = true; - const char * crashReason = IsKnownCrash(info); - - if(crashReason) - { - _ERROR("Skyrim has crashed in a known crash location (%s). No crashdump will be written in release builds.", crashReason); - -#if NDEBUG - // skip writing crashdumps for these in release - writeDump = false; -#endif - } - - if(writeDump) - { - _ERROR("Skyrim has crashed. A minidump containing debugging information is being written to %s.", s_crashDumpPath); - - HANDLE dumpFile = CreateFile(s_crashDumpPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if(dumpFile != INVALID_HANDLE_VALUE) - { - MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; - - exceptionInfo.ThreadId = GetCurrentThreadId(); - exceptionInfo.ExceptionPointers = info; - exceptionInfo.ClientPointers = FALSE; - - BOOL result = s_dbgHelpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), dumpFile, MiniDumpNormal, &exceptionInfo, NULL, NULL); - if(result) - { - _ERROR("Minidump written."); - } - else - { - _ERROR("Unable to write minidump."); - } - - CloseHandle(dumpFile); - } - else - { - _ERROR("Unable to open minidump. (%08X)", GetLastError()); - } - } - - s_inExceptionFilter.Release(); - } - else - { - _ERROR("top-level exception filter hit multiple times"); - } - - return EXCEPTION_EXECUTE_HANDLER; -} - -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter_Hook(__in LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) -{ - _MESSAGE("SetUnhandledExceptionFilter_Hook: %p", lpTopLevelExceptionFilter); - - return NULL; -} - -void Hooks_Debug_Init(void) -{ - GetSystemTime(&s_launchTime); - - UInt32 enableMiniDump = 0; - GetConfigOption_UInt32("Debug", "WriteMinidumps", &enableMiniDump); - - if(enableMiniDump) - { - _MESSAGE("minidumps enabled"); - - // try to get dbghelp - s_dbgHelpDLL = LoadLibrary("dbghelp.dll"); - if(s_dbgHelpDLL) - { - s_dbgHelpWriteDump = (_MiniDumpWriteDump)GetProcAddress(s_dbgHelpDLL, "MiniDumpWriteDump"); - if(!s_dbgHelpWriteDump) - _WARNING("dbghelp missing MiniDumpWriteDump, upgrade to dbghelp 5.1 or later"); - } - else - { - _MESSAGE("no dbghelp"); - } - - // we want to catch crashes from hook commit, apply exception filter in Init function - if(s_dbgHelpDLL && s_dbgHelpWriteDump) - { - // precalculate as much as possible - char myDocumentsPath[MAX_PATH]; - ASSERT(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, myDocumentsPath))); - - sprintf_s(s_crashDumpPath, sizeof(s_crashDumpPath), "%s\\My Games\\Skyrim Special Edition\\SKSE\\Crashdumps\\%04d-%02d-%02d_%02d.%02d.%02d.dmp", myDocumentsPath, - s_launchTime.wYear, s_launchTime.wMonth, s_launchTime.wDay, - s_launchTime.wHour, s_launchTime.wMinute, s_launchTime.wSecond); - - IFileStream::MakeAllDirs(s_crashDumpPath); - - // replace previous exception filter - s_oldExceptionFilter = SetUnhandledExceptionFilter(ExceptionFilter); - _MESSAGE("old exception filter = %p", s_oldExceptionFilter); - - // disable game overwriting exception filter - uintptr_t thunkAddress = (uintptr_t)GetIATAddr((UInt8 *)GetModuleHandle(NULL), "kernel32.dll", "SetUnhandledExceptionFilter"); - SafeWrite64(thunkAddress, (uintptr_t)SetUnhandledExceptionFilter_Hook); - } - } -} - -void Hooks_Debug_Commit(void) -{ - // -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Debug.h b/source/fs.dll/skse64/skse64/Hooks_Debug.h deleted file mode 100644 index 5a77e57e..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Debug.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -void Hooks_Debug_Init(void); -void Hooks_Debug_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Diagnostics.cpp b/source/fs.dll/skse64/skse64/Hooks_Diagnostics.cpp deleted file mode 100644 index 34b41df4..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Diagnostics.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "Hooks_Diagnostics.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include -#include - -// not really needed, bethesda does this now - -void Hooks_Diagnostics_Commit(void) -{ - UInt32 enableDiagnostics = 0; - if (GetConfigOption_UInt32("General", "EnableDiagnostics", &enableDiagnostics)) - { - if (enableDiagnostics) - { - // - } - } -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Diagnostics.h b/source/fs.dll/skse64/skse64/Hooks_Diagnostics.h deleted file mode 100644 index eec34768..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Diagnostics.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void Hooks_Diagnostics_Commit(void); \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.cpp b/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.cpp deleted file mode 100644 index 4d1b45e8..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.cpp +++ /dev/null @@ -1,596 +0,0 @@ -#include "Hooks_DirectInput8Create.h" -#include -#include "PapyrusForm.h" -#include "skse64_common/SafeWrite.h" - -enum -{ - kDeviceType_Keyboard = 1, - kDeviceType_Mouse -}; - -static const GUID GUID_SysMouse = { 0x6F1D2B60, 0xD5A0, 0x11CF, { 0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00} }; -static const GUID GUID_SysKeyboard = { 0x6F1D2B61, 0xD5A0, 0x11CF, { 0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00} }; - -typedef HRESULT (_stdcall * CreateDInputProc)(HINSTANCE, DWORD, REFIID, LPVOID, LPUNKNOWN); - -DIHookControl g_diHookData; -FramerateTracker g_framerateTracker; -static CreateDInputProc DICreate_RealFunc; - -class FakeDirectInputDevice : public IDirectInputDevice8 -{ -public: - FakeDirectInputDevice(IDirectInputDevice8 * device, DWORD type) - :m_device(device), m_deviceType(type), m_refs(1) - { - // - } - - HRESULT _stdcall QueryInterface (REFIID riid, LPVOID * ppvObj) - { - return m_device->QueryInterface(riid,ppvObj); - } - - ULONG _stdcall AddRef(void) - { - m_refs++; - - return m_refs; - } - - ULONG _stdcall Release(void) - { - m_refs--; - - if(!m_refs) - { - m_device->Release(); - delete this; - return 0; - } - else - { - return m_refs; - } - } - - // IDirectInputDevice8A - HRESULT _stdcall GetCapabilities(LPDIDEVCAPS a) { return m_device->GetCapabilities(a); } - HRESULT _stdcall EnumObjects(LPDIENUMDEVICEOBJECTSCALLBACKA a,LPVOID b,DWORD c) { return m_device->EnumObjects(a,b,c); } - HRESULT _stdcall GetProperty(REFGUID a,DIPROPHEADER* b) { return m_device->GetProperty(a,b); } - HRESULT _stdcall SetProperty(REFGUID a,const DIPROPHEADER* b) { return m_device->SetProperty(a,b); } - HRESULT _stdcall Acquire(void) { return m_device->Acquire(); } - HRESULT _stdcall Unacquire(void) { return m_device->Unacquire(); } - - HRESULT _stdcall GetDeviceState(DWORD outDataLen, LPVOID outData) - { - if(m_deviceType == kDeviceType_Keyboard) - { - // keyboard - - // get raw data - UInt8 rawData[InputMap::kMaxMacros]; - HRESULT hr = m_device->GetDeviceState(256, rawData); - if(hr != DI_OK) return hr; - - DIHookControl::GetSingleton().ProcessKeyboardData(rawData); - - memcpy(outData, rawData, outDataLen < 256 ? outDataLen : 256); - - return hr; - } - else - { - // mouse - - ASSERT(outDataLen == sizeof(DIMOUSESTATE2)); - - g_framerateTracker.Update(); - - DIMOUSESTATE2 * mouseState = (DIMOUSESTATE2 *)outData; - - // get raw data - HRESULT hr = m_device->GetDeviceState(sizeof(DIMOUSESTATE2), mouseState); - if(hr != DI_OK) return hr; - - DIHookControl::GetSingleton().ProcessMouseData(mouseState); - - return hr; - } - } - - // oblivion and on use this for menus and the console - HRESULT _stdcall GetDeviceData(DWORD dataSize, DIDEVICEOBJECTDATA * outData, DWORD * outDataLen, DWORD flags) - { - // ### begin hack land - if(m_deviceType == kDeviceType_Keyboard) - { - UInt8 rawData[InputMap::kMaxMacros]; - HRESULT hr = m_device->GetDeviceState(256, rawData); - if(hr == DI_OK) - { - DIHookControl::GetSingleton().ProcessKeyboardData(rawData); - } - } - - return DIHookControl::GetSingleton().ProcessBufferedData(m_device, dataSize, outData, outDataLen, flags); - } - - HRESULT _stdcall SetDataFormat(const DIDATAFORMAT* a) { return m_device->SetDataFormat(a); } - HRESULT _stdcall SetEventNotification(HANDLE a) { return m_device->SetEventNotification(a); } - - // in debug builds, force cooperative level so input isn't locked out - HRESULT _stdcall SetCooperativeLevel(HWND a,DWORD b) - { -#if defined(_DEBUG) || 0 - b = DISCL_BACKGROUND | DISCL_NONEXCLUSIVE; -#endif - return m_device->SetCooperativeLevel(a,b); - } - - HRESULT _stdcall GetObjectInfo(LPDIDEVICEOBJECTINSTANCEA a,DWORD b,DWORD c) { return m_device->GetObjectInfo(a,b,c); } - HRESULT _stdcall GetDeviceInfo(LPDIDEVICEINSTANCEA a) { return m_device->GetDeviceInfo(a); } - HRESULT _stdcall RunControlPanel(HWND a,DWORD b) { return m_device->RunControlPanel(a,b); } - HRESULT _stdcall Initialize(HINSTANCE a,DWORD b,REFGUID c) { return m_device->Initialize(a,b,c); } - HRESULT _stdcall CreateEffect(REFGUID a,LPCDIEFFECT b,LPDIRECTINPUTEFFECT *c,LPUNKNOWN d) { return m_device->CreateEffect(a,b,c,d); } - HRESULT _stdcall EnumEffects(LPDIENUMEFFECTSCALLBACKA a,LPVOID b,DWORD c) { return m_device->EnumEffects(a,b,c); } - HRESULT _stdcall GetEffectInfo(LPDIEFFECTINFOA a,REFGUID b) { return m_device->GetEffectInfo(a,b); } - HRESULT _stdcall GetForceFeedbackState(LPDWORD a) { return m_device->GetForceFeedbackState(a); } - HRESULT _stdcall SendForceFeedbackCommand(DWORD a) { return m_device->SendForceFeedbackCommand(a); } - HRESULT _stdcall EnumCreatedEffectObjects(LPDIENUMCREATEDEFFECTOBJECTSCALLBACK a,LPVOID b,DWORD c) { return m_device->EnumCreatedEffectObjects(a,b,c); } - HRESULT _stdcall Escape(LPDIEFFESCAPE a) { return m_device->Escape(a); } - HRESULT _stdcall Poll(void) { return m_device->Poll(); } - HRESULT _stdcall SendDeviceData(DWORD a,LPCDIDEVICEOBJECTDATA b,LPDWORD c,DWORD d) { return m_device->SendDeviceData(a,b,c,d); } - HRESULT _stdcall EnumEffectsInFile(LPCSTR a,LPDIENUMEFFECTSINFILECALLBACK b,LPVOID c,DWORD d) { return m_device->EnumEffectsInFile(a,b,c,d); } - HRESULT _stdcall WriteEffectToFile(LPCSTR a,DWORD b,LPDIFILEEFFECT c,DWORD d) { return m_device->WriteEffectToFile(a,b,c,d); } - HRESULT _stdcall BuildActionMap(LPDIACTIONFORMATA a,LPCSTR b,DWORD c) { return m_device->BuildActionMap(a,b,c); } - HRESULT _stdcall SetActionMap(LPDIACTIONFORMATA a,LPCSTR b,DWORD c) { return m_device->SetActionMap(a,b,c); } - HRESULT _stdcall GetImageInfo(LPDIDEVICEIMAGEINFOHEADERA a) { return m_device->GetImageInfo(a); } - -private: - IDirectInputDevice8 * m_device; - DWORD m_deviceType; - ULONG m_refs; -}; - -class FakeDirectInput : public IDirectInput8A { -public: - /*** Constructor ***/ - FakeDirectInput(IDirectInput8 * obj) - :m_realDInput(obj), m_refs(1) { } - - /*** IUnknown methods ***/ - HRESULT _stdcall QueryInterface (REFIID riid, LPVOID* ppvObj) { return m_realDInput->QueryInterface(riid, ppvObj); } - - ULONG _stdcall AddRef(void) - { - m_refs++; - - return m_refs; - } - - ULONG _stdcall Release(void) - { - m_refs--; - - if(!m_refs) - { - m_realDInput->Release(); - delete this; - return 0; - } - - return m_refs; - } - - /*** IDirectInput8A methods ***/ - HRESULT _stdcall CreateDevice(REFGUID typeGuid, IDirectInputDevice8A ** device, IUnknown * unused) - { -#if 0 - _MESSAGE("IDirectInput8A::CreateDevice: %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X", - typeGuid.Data1, typeGuid.Data2, typeGuid.Data3, - typeGuid.Data4[0], typeGuid.Data4[1], typeGuid.Data4[2], typeGuid.Data4[3], - typeGuid.Data4[4], typeGuid.Data4[5], typeGuid.Data4[6], typeGuid.Data4[7]); -#endif - - if(typeGuid != GUID_SysKeyboard && typeGuid != GUID_SysMouse) - { - return m_realDInput->CreateDevice(typeGuid, device, unused); - } - else - { - IDirectInputDevice8A * dev; - - HRESULT hr = m_realDInput->CreateDevice(typeGuid, &dev, unused); - if(hr != DI_OK) return hr; - - *device = new FakeDirectInputDevice(dev, (typeGuid == GUID_SysKeyboard) ? kDeviceType_Keyboard : kDeviceType_Mouse); - - return hr; - } - } - - HRESULT _stdcall EnumDevices(DWORD a,LPDIENUMDEVICESCALLBACKA b,void* c,DWORD d) { return m_realDInput->EnumDevices(a,b,c,d); } - HRESULT _stdcall GetDeviceStatus(REFGUID r) { return m_realDInput->GetDeviceStatus(r); } - HRESULT _stdcall RunControlPanel(HWND a,DWORD b) { return m_realDInput->RunControlPanel(a,b); } - HRESULT _stdcall Initialize(HINSTANCE a,DWORD b) { return m_realDInput->Initialize(a,b); } - HRESULT _stdcall FindDevice(REFGUID a,LPCSTR b,LPGUID c) { return m_realDInput->FindDevice(a,b,c); } - HRESULT _stdcall EnumDevicesBySemantics(LPCSTR a,LPDIACTIONFORMATA b,LPDIENUMDEVICESBYSEMANTICSCBA c,void* d,DWORD e) { return m_realDInput->EnumDevicesBySemantics(a,b,c,d,e); } - HRESULT _stdcall ConfigureDevices(LPDICONFIGUREDEVICESCALLBACK a,LPDICONFIGUREDEVICESPARAMSA b,DWORD c,void* d) { return m_realDInput->ConfigureDevices(a,b,c,d); } - -private: - IDirectInput8 * m_realDInput; - ULONG m_refs; -}; - -static HRESULT _stdcall Hook_DirectInput8Create_Execute(HINSTANCE instance, DWORD version, REFIID iid, void * out, IUnknown * outer) -{ - IDirectInput8A * dinput; - HRESULT hr = DICreate_RealFunc(instance, version, iid, &dinput, outer); - if(hr != DI_OK) return hr; - - *((IDirectInput8A**)out) = new FakeDirectInput(dinput); - - _MESSAGE("hooked dinput"); - - return DI_OK; -} - -void Hooks_DirectInput_Commit(void) -{ - uintptr_t thunkAddress = (uintptr_t)GetIATAddr((UInt8 *)GetModuleHandle(NULL), "dinput8.dll", "DirectInput8Create"); - - DICreate_RealFunc = (CreateDInputProc)*(uintptr_t *)thunkAddress; - SafeWrite64(thunkAddress, (uintptr_t)Hook_DirectInput8Create_Execute); -} - -DIHookControl::DIHookControl() -{ - memset(&m_keys, 0, sizeof(m_keys)); -} - -bool DIHookControl::_IsKeyPressed(KeyInfo* info, UInt32 flags) -{ - bool result = false; - //bool isMouseButton = keycode >= kMacro_MouseButtonOffset; - - // data sources - if(flags & kFlag_GameState) result |= info->gameState; - if(flags & kFlag_RawState) result |= info->rawState; - if(flags & kFlag_InsertedState) result |= info->insertedState; - - // modifiers - bool disable = false; - - if((flags & kFlag_IgnoreDisabled_User) && info->userDisable) - disable = true; - - if((flags & kFlag_IgnoreDisabled_Script) && info->scriptDisable) - disable = true; - - if(disable) result = false; - - return result; -} - -bool DIHookControl::IsKeyPressed(UInt32 keycode, UInt32 flags) -{ - if(keycode >= InputMap::kMaxMacros) return false; - - // default mode - if(!flags) flags = kFlag_DefaultBackCompat; - - KeyInfo * info = &m_keys[keycode]; - return _IsKeyPressed(info, flags); -} - -UInt32 DIHookControl::GetNumKeysPressed() -{ - UInt32 keysPressed = 0; - - for (UInt32 keycode = 0; keycode < InputMap::kMaxMacros; keycode++) - { - KeyInfo* info = &m_keys[keycode]; - if (_IsKeyPressed(info, kFlag_DefaultBackCompat)) - keysPressed++; - } - return keysPressed; -} - -SInt32 DIHookControl::GetNthKeyPressed(UInt32 n) -{ - UInt32 index = 0; - for (UInt32 keycode = 0; keycode < InputMap::kMaxMacros; keycode++) { - KeyInfo* info = &m_keys[keycode]; - if (_IsKeyPressed(info, kFlag_DefaultBackCompat)) { - if (index == n) { - return keycode; - } else - index++; - } - } - return -1; -} - -bool DIHookControl::IsKeyDisabled(UInt32 keycode) -{ - if(keycode >= InputMap::kMaxMacros) return false; - - KeyInfo * info = &m_keys[keycode]; - - return info->userDisable || info->scriptDisable; -} - -bool DIHookControl::IsKeyHeld(UInt32 keycode) -{ - if(keycode >= InputMap::kMaxMacros) return false; - - return m_keys[keycode].hold; -} - -bool DIHookControl::IsKeyTapped(UInt32 keycode) -{ - if(keycode >= InputMap::kMaxMacros) return false; - - return m_keys[keycode].tap; -} - -void DIHookControl::SetKeyDisableState(UInt32 keycode, bool bDisable, UInt32 mask) -{ - if(!mask) mask = kDisable_All; // default mask value - - if(keycode < InputMap::kMaxMacros) - { - KeyInfo * info = &m_keys[keycode]; - - if(mask & kDisable_User) info->userDisable = bDisable; - if(mask & kDisable_Script) info->scriptDisable = bDisable; - } -} - -void DIHookControl::SetKeyHeldState(UInt32 keycode, bool bHold) -{ - if(keycode < InputMap::kMaxMacros) - m_keys[keycode].hold = bHold; -} - -void DIHookControl::TapKey(UInt32 keycode) -{ - if(keycode < InputMap::kMaxMacros) - m_keys[keycode].tap = true; -} - -void DIHookControl::BufferedKeyTap(UInt32 key) -{ - DIDEVICEOBJECTDATA data; - - data.uAppData = -1; - data.dwTimeStamp = GetTickCount(); - data.dwSequence = 0; // engine doesn't appear to use this and we can't fake it easily - data.dwOfs = key; - data.dwData = 0x80; - - IScopedCriticalSection lock(&m_bufferedPressesLock); - - // key down - m_bufferedPresses.push(data); - - // key up - data.dwData = 0x00; - m_bufferedPresses.push(data); -} - -void DIHookControl::BufferedKeyPress(UInt32 key) -{ - DIDEVICEOBJECTDATA data; - - data.uAppData = -1; - data.dwTimeStamp = GetTickCount(); - data.dwSequence = 0; - data.dwOfs = key; - data.dwData = 0x80; - - IScopedCriticalSection lock(&m_bufferedPressesLock); - m_bufferedPresses.push(data); -} - -void DIHookControl::BufferedKeyRelease(UInt32 key) -{ - DIDEVICEOBJECTDATA data; - - data.uAppData = -1; - data.dwTimeStamp = GetTickCount(); - data.dwSequence = 0; - data.dwOfs = key; - data.dwData = 0x00; - - IScopedCriticalSection lock(&m_bufferedPressesLock); - m_bufferedPresses.push(data); -} - -void DIHookControl::ProcessKeyboardData(UInt8 * data) -{ - // process keys - for(UInt32 idx = 0; idx < 256; idx++) - { - bool keyDown = data[idx] != 0; - - keyDown = m_keys[idx].Process(keyDown, idx); - - data[idx] = keyDown ? 0x80 : 0x00; - } -} - -void DIHookControl::ProcessMouseData(DIMOUSESTATE2 * data) -{ - STATIC_ASSERT(sizeof(data->rgbButtons) == InputMap::kMacro_NumMouseButtons); - - // process buttons - for(UInt32 idx = 0; idx < InputMap::kMacro_NumMouseButtons; idx++) - { - UInt32 macroIdx = InputMap::kMacro_MouseButtonOffset + idx; - bool keyDown = data->rgbButtons[idx] != 0; - - keyDown = m_keys[macroIdx].Process(keyDown, macroIdx); - - data->rgbButtons[idx] = keyDown ? 0x80 : 0x00; - } - - // process mouse wheel - UInt8 wheelState[InputMap::kMacro_MouseWheelDirections]; // 0 = +, 1 = - - - wheelState[0] = data->lZ > 0 ? 0x80 : 0x00; - wheelState[1] = data->lZ < 0 ? 0x80 : 0x00; - - for(UInt32 idx = 0; idx < InputMap::kMacro_MouseWheelDirections; idx++) - { - UInt32 macroIdx = InputMap::kMacro_MouseWheelOffset + idx; - bool keyDown = wheelState[idx] != 0; - - keyDown = m_keys[macroIdx].Process(keyDown, macroIdx); - - wheelState[idx] = keyDown ? 0x80 : 0x00; - } - - // wheel state not transferred back -} - -HRESULT DIHookControl::ProcessBufferedData(IDirectInputDevice8 * device, DWORD dataSize, DIDEVICEOBJECTDATA * outData, DWORD * outDataLen, DWORD flags) -{ - ASSERT(dataSize == sizeof(DIDEVICEOBJECTDATA)); - - IScopedCriticalSection lock(&m_bufferedPressesLock); - - // if we have nothing to inject, pass through - if(m_bufferedPresses.empty()) - return device->GetDeviceData(dataSize, outData, outDataLen, flags); - - UInt32 eventsRequested = *outDataLen; - - // pass down to the device - UInt32 numRealEvents = eventsRequested; - HRESULT hr = device->GetDeviceData(dataSize, outData, &numRealEvents, flags); - if((hr != DI_OK) && (hr != DI_BUFFEROVERFLOW)) - { - *outDataLen = numRealEvents; - return hr; - } - - // move pointer down and update count - DIDEVICEOBJECTDATA * virtualOutData = (DIDEVICEOBJECTDATA *)(((UInt8 *)outData) + (dataSize * numRealEvents)); - UInt32 virtualEventsRequested = eventsRequested - numRealEvents; - - UInt32 numVirtualEvents = 0; - - if(flags & DIGDD_PEEK) - { - if(outData) - { - // todo: switch from queue to list so we can handle this - HALT("DIHookControl::ProcessBufferedData: can't handle non-NULL data in peek mode"); - } - else - { - UInt32 virtualEventsAvail = m_bufferedPresses.size(); - - if(virtualEventsAvail > virtualEventsRequested) - numVirtualEvents = virtualEventsRequested; - else - numVirtualEvents = virtualEventsAvail; - } - } - else - { - for(UInt32 i = 0; i < virtualEventsRequested; i++) - { - if(m_bufferedPresses.empty()) break; - - if(outData) - { - *virtualOutData = m_bufferedPresses.front(); - virtualOutData = (DIDEVICEOBJECTDATA *)(((UInt8 *)outData) + dataSize); - } - - m_bufferedPresses.pop(); - numVirtualEvents++; - } - } - - *outDataLen = numRealEvents + numVirtualEvents; - - return hr; -} - -bool DIHookControl::KeyInfo::Process(bool keyDown, UInt32 idx) -{ - insertedState = false; - rawState = keyDown; - - // only process whitelisted keys - if(userDisable) - keyDown = false; - - if(!scriptDisable) - { - if(hold) - insertedState = true; - - if(tap) - { - insertedState = true; - tap = false; - } - - if(insertedState) - keyDown = true; - } - - gameState = keyDown; - - return keyDown; -} - -// this code doesn't belong here -FramerateTracker::FramerateTracker() -:m_lastTime(0), m_lastFrameLength(0), -m_frameTimeHistoryIdx(0), m_frameTimeHistoryPrimed(false), -m_averageFrameTime(0) -{ - for(UInt32 i = 0; i < kFrameTimeHistoryLength; i++) - m_frameTimeHistory[i] = 0; -} - -void FramerateTracker::Update(void) -{ - DWORD time = GetTickCount(); - - // calculate current frame time - m_lastFrameLength = (float)(time - m_lastTime) / 1000.0f; - m_lastTime = time; - - // store in ring buffer - m_frameTimeHistory[m_frameTimeHistoryIdx % kFrameTimeHistoryLength] = m_lastFrameLength; - m_frameTimeHistoryIdx++; - - // filled ring buffer? flag it - if(m_frameTimeHistoryIdx >= kFrameTimeHistoryLength) - m_frameTimeHistoryPrimed = true; - - // history full? - if(m_frameTimeHistoryPrimed) - { - // calculate and store the average - float total = 0; - - for(UInt32 i = 0; i < kFrameTimeHistoryLength; i++) - total += m_frameTimeHistory[i]; - - m_averageFrameTime = total / kFrameTimeHistoryLength; - } - else - { - // report 0 frametime until primed - m_averageFrameTime = 0; - } -} diff --git a/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.h b/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.h deleted file mode 100644 index bb46d69d..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_DirectInput8Create.h +++ /dev/null @@ -1,105 +0,0 @@ -#pragma once - -#define DIRECTINPUT_VERSION 0x0800 -#include -#include -#include "InputMap.h" -#include "common/ICriticalSection.h" - -void Hooks_DirectInput_Commit(void); - -class DIHookControl : public ISingleton -{ -public: - enum - { - // data sources - kFlag_GameState = 1 << 0, // input passed to game post-filtering - kFlag_RawState = 1 << 1, // user input - kFlag_InsertedState = 1 << 2, // keydown was inserted by script - - // modifiers - kFlag_IgnoreDisabled_User = 1 << 3, // ignore user-disabled keys - kFlag_IgnoreDisabled_Script = 1 << 4, // ignore script-disabled keys - - kFlag_DefaultBackCompat = kFlag_GameState, - }; - - enum - { - kDisable_User = 1 << 0, - kDisable_Script = 1 << 1, - - kDisable_All = kDisable_User | kDisable_Script, - }; - - DIHookControl(); - - bool IsKeyPressed(UInt32 keycode, UInt32 flags = 0); - bool IsKeyDisabled(UInt32 keycode); - bool IsKeyHeld(UInt32 keycode); - bool IsKeyTapped(UInt32 keycode); - - UInt32 GetNumKeysPressed(); - SInt32 GetNthKeyPressed(UInt32 n); - - void SetKeyDisableState(UInt32 keycode, bool bDisable, UInt32 mask); - void SetKeyHeldState(UInt32 keycode, bool bHold); - void TapKey(UInt32 keycode); - - void BufferedKeyTap(UInt32 key); - void BufferedKeyPress(UInt32 key); - void BufferedKeyRelease(UInt32 key); - - // hook interface - void ProcessKeyboardData(UInt8 * data); - void ProcessMouseData(DIMOUSESTATE2 * data); - HRESULT ProcessBufferedData(IDirectInputDevice8 * device, DWORD dataSize, DIDEVICEOBJECTDATA * outData, DWORD * outDataLen, DWORD flags); - -private: - struct KeyInfo - { - bool rawState; // state from dinput last update - bool gameState; // state sent to the game last update - bool insertedState; // true if a script pushed/held this key down last update - - bool hold; // key is held down - bool tap; // key is being tapped - bool userDisable; // key cannot be pressed by user - bool scriptDisable; // key cannot be pressed by script - - bool Process(bool keyDown, UInt32 idx); - }; - bool _IsKeyPressed(KeyInfo* info, UInt32 flags); - - KeyInfo m_keys[InputMap::kMaxMacros]; - - ICriticalSection m_bufferedPressesLock; // hold this when modifying m_bufferedPresses - typedef std::queue BufferedPressQueue; - BufferedPressQueue m_bufferedPresses; -}; - -class FramerateTracker -{ -public: - FramerateTracker(); - - void Update(void); - -private: - enum - { - kFrameTimeHistoryLength = 32 - }; - - UInt32 m_lastTime; - float m_lastFrameLength; // frametime in seconds - - float m_frameTimeHistory[kFrameTimeHistoryLength]; // last kFrameTimeHistoryLength frametimes - UInt32 m_frameTimeHistoryIdx; // slot that will be filled on the next update call - bool m_frameTimeHistoryPrimed; // true after history buffer is full - - float m_averageFrameTime; // average of m_frameTimeHistory -}; - -extern FramerateTracker g_framerateTracker; diff --git a/source/fs.dll/skse64/skse64/Hooks_Event.cpp b/source/fs.dll/skse64/skse64/Hooks_Event.cpp deleted file mode 100644 index 16d1bd07..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Event.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "Hooks_Event.h" - -#include "skse64_common/Utilities.h" -#include "skse64/GameInput.h" -#include "skse64/GameMenus.h" -#include "skse64/PapyrusEvents.h" -#include "skse64/PluginManager.h" -#include "skse64_common/BranchTrampoline.h" - -RelocAddr PlayerControls_ctor_Call(0x005D3920 + 0xD75); - -PlayerControls * PlayerControls::ctor_Hook(void) -{ - PlayerControls * result = CALL_MEMBER_FN(this, ctor)(); - - MenuManager * mm = MenuManager::GetSingleton(); - if (mm) { - mm->MenuOpenCloseEventDispatcher()->AddEventSink(&g_menuEventHandler); - } else { - _MESSAGE("Failed to register SKSE menuEventHandler!"); - } - - g_modCallbackEventDispatcher.AddEventSink(&g_modCallbackEventHandler); - g_cameraEventDispatcher.AddEventSink(&g_cameraEventHandler); - g_crosshairRefEventDispatcher.AddEventSink(&g_crosshairRefEventHandler); - g_actionEventDispatcher.AddEventSink(&g_actionEventHandler); - g_ninodeUpdateEventDispatcher.AddEventSink(&g_ninodeUpdateEventHandler); - - InputEventDispatcher *inputEventDispatcher = InputEventDispatcher::GetSingleton(); - if (inputEventDispatcher) { - inputEventDispatcher->AddEventSink(&g_inputEventHandler); - } else { - _MESSAGE("Failed to register SKSE inputEventHandler"); - } - - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_InputLoaded, NULL, 0, NULL); - - return result; -} - -void Hooks_Event_Commit(void) -{ - g_branchTrampoline.Write5Call(PlayerControls_ctor_Call, GetFnAddr(&PlayerControls::ctor_Hook)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Event.h b/source/fs.dll/skse64/skse64/Hooks_Event.h deleted file mode 100644 index 7ce9397a..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Event.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void Hooks_Event_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Gameplay.cpp b/source/fs.dll/skse64/skse64/Hooks_Gameplay.cpp deleted file mode 100644 index d902a533..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Gameplay.cpp +++ /dev/null @@ -1,195 +0,0 @@ -#include "Hooks_Gameplay.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "PapyrusEvents.h" -#include "skse64/GameReferences.h" -#include "skse64_common/skse_version.h" -#include "skse64_common/BranchTrampoline.h" -#include "xbyak/xbyak.h" - - -static UInt32 g_forceContainerCategorization = 0; - -// 103A70E32BCD6C07E69BAE82CDD6BFE66E9F6797+3C -RelocPtr g_containerMode(0x02FE8240); -RelocAddr kHook_ContainerMode_Base(0x0088D910); -uintptr_t kHook_ContainerMode_Start = kHook_ContainerMode_Base + 0xAE; -uintptr_t kHook_ContainerMode_Categories = kHook_ContainerMode_Base + 0xB7; -uintptr_t kHook_ContainerMode_NoCategories = kHook_ContainerMode_Base + 0xCB; - -void Hooks_Gameplay_EnableForceContainerCategorization(bool enable) -{ - g_forceContainerCategorization = enable ? 1 : 0; -} - -UInt32 g_invalidateKeywordCache = 0; -RelocAddr kHook_BGSKeyword_Base(0x003491C0); -uintptr_t kHook_BGSKeyword_Create_Return = kHook_BGSKeyword_Base + 6; - -// 4C1457C3040DCD34A7E7B2326F1EA2023930C56B+71 -RelocAddr g_gameVersion(0x0163D168); -RelocAddr kHook_ShowVersion_Offset(0x0091F210 + 0x78); -static char kHook_ShowVersion_FormatString[] = -"%s.%d (SKSE64 " __PREPRO_TOKEN_STR__(SKSE_VERSION_INTEGER) "." -__PREPRO_TOKEN_STR__(SKSE_VERSION_INTEGER_MINOR) "." -__PREPRO_TOKEN_STR__(SKSE_VERSION_INTEGER_BETA) " rel " -__PREPRO_TOKEN_STR__(SKSE_VERSION_RELEASEIDX) ")"; - -RelocAddr kHook_Crosshair_LookupREFRByHandle_Enter(0x006D9980 + 0x88); - -NiPointer g_curCrosshairRef; - -bool __cdecl Hook_Crosshair_LookupREFRByHandle(UInt32 & refHandle, NiPointer & refrOut) -{ - bool result = LookupREFRByHandle(refHandle, refrOut); - - g_curCrosshairRef = refrOut; - - SKSECrosshairRefEvent evn(refrOut); - g_crosshairRefEventDispatcher.SendEvent(&evn); - - return result; -} - -TESObjectREFR* Hooks_Gameplay_GetCrosshairRef() -{ - return g_curCrosshairRef; -} - -static UInt8 s_disableMapMenuMouseWheel = 1; - -RelocAddr kHook_MapMenuMouseWheel_Enter(0x0090D530 + 0x187); - -void Hooks_Gameplay_EnableMapMenuMouseWheel(bool enable) -{ - s_disableMapMenuMouseWheel = enable ? 0 : 1; -} - -void Hooks_Gameplay_Commit(void) -{ - // optionally force containers in to "npc" mode, showing categories - { - struct HookContainerMode_Code : Xbyak::CodeGenerator { - HookContainerMode_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - Xbyak::Label useCategories; - - push(rax); - mov(rax, (uintptr_t)&g_forceContainerCategorization); - mov(eax, ptr[rax]); - cmp(eax, 0); - pop(rax); - jnz(useCategories); - - push(rax); - mov(rax, g_containerMode.GetUIntPtr()); - mov(eax, ptr[rax]); - cmp(eax, 3); - pop(rax); - jz(useCategories); - jmp(ptr[rip]); - dq(kHook_ContainerMode_NoCategories); - - L(useCategories); - jmp(ptr[rip]); - dq(kHook_ContainerMode_Categories); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - HookContainerMode_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kHook_ContainerMode_Start, uintptr_t(code.getCode())); - SafeWrite16(kHook_ContainerMode_Start + 5, 0x9090); - } - - // read config - UInt32 enableContainerCategorization = 0; - if(GetConfigOption_UInt32("Interface", "EnableContainerCategorization", &enableContainerCategorization)) - { - if(enableContainerCategorization) - { - _MESSAGE(".ini enabled container categorization"); - g_forceContainerCategorization = 1; - } - } - - // show SKSE version in menu - { - struct ShowVersion_Code : Xbyak::CodeGenerator { - ShowVersion_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - Xbyak::Label retnLabel; - Xbyak::Label dataLabel; - - mov(r8, ptr[rip + dataLabel]); - jmp(ptr[rip + retnLabel]); - - L(retnLabel); - dq(kHook_ShowVersion_Offset.GetUIntPtr() + 0x7); - - L(dataLabel); - dq(uintptr_t(&kHook_ShowVersion_FormatString)); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - ShowVersion_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kHook_ShowVersion_Offset.GetUIntPtr(), uintptr_t(code.getCode())); - SafeWrite8(kHook_ShowVersion_Offset.GetUIntPtr() + 6, 0x90); - } - - //// hook BGSKeyword ctor so we can rebuild the lookup table - { - struct Hook_BGSKeyword_Create_Code : Xbyak::CodeGenerator { - Hook_BGSKeyword_Create_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // rax is safe to use here - mov(rax, (uintptr_t)&g_invalidateKeywordCache); - mov(dword[rax], 1); - - // Original code - push(rbx); - sub(rsp, 0x30); - jmp(ptr[rip]); - dq(kHook_BGSKeyword_Create_Return); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - Hook_BGSKeyword_Create_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kHook_BGSKeyword_Base.GetUIntPtr(), uintptr_t(code.getCode())); - SafeWrite8(kHook_BGSKeyword_Base.GetUIntPtr() + 5, 0x90); - } - - //// hook crosshair ref update - g_branchTrampoline.Write5Call(kHook_Crosshair_LookupREFRByHandle_Enter, (uintptr_t)Hook_Crosshair_LookupREFRByHandle); - - // change return value of LocalMapMenu::InputHandler::HandleMouseMoveEvent - // for zoomIn/out case so it passes on the event to flash - { - struct Hook_MapMenuMouseWheel_Code : Xbyak::CodeGenerator { - Hook_MapMenuMouseWheel_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - mov(rax, (uintptr_t)&s_disableMapMenuMouseWheel); - mov(al, ptr[rax]); - - // Original code - add(rsp, 0x30); - pop(rdi); - ret(); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - Hook_MapMenuMouseWheel_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kHook_MapMenuMouseWheel_Enter.GetUIntPtr(), uintptr_t(code.getCode())); - } -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Gameplay.h b/source/fs.dll/skse64/skse64/Hooks_Gameplay.h deleted file mode 100644 index 7b8170da..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Gameplay.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -class TESObjectREFR; - -void Hooks_Gameplay_EnableForceContainerCategorization(bool enable); -void Hooks_Gameplay_EnableMapMenuMouseWheel(bool enable); - -TESObjectREFR* Hooks_Gameplay_GetCrosshairRef(); - -void Hooks_Gameplay_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Handlers.cpp b/source/fs.dll/skse64/skse64/Hooks_Handlers.cpp deleted file mode 100644 index 13186f2d..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Handlers.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "Hooks_Handlers.h" -#include "skse64_common/SafeWrite.h" - -#include "skse64/GameRTTI.h" -#include "skse64/GameData.h" -#include "skse64/GameForms.h" -#include "skse64/GameObjects.h" -#include "skse64/GameHandlers.h" - -#include "skse64/PapyrusEvents.h" - -template -UInt8 IHandlerFunctor::ProcessAction(Actor * actor, UInt32 unk04) -{ - TESForm * object = slot == SKSEActionEvent::kSlot_Voice ? actor->equippedShout : actor->GetEquippedObject(slot == SKSEActionEvent::kSlot_Left); - SKSEActionEvent evn(type, actor, object, slot); - g_actionEventDispatcher.SendEvent(&evn); - return CALL_MEMBER_FN(static_cast(this), Process_Origin)(actor, unk04); -} - -void Hooks_Handlers_Init(void) -{ - -} - -// ??_7WeaponRightSwingHandler@@6B@ -RelocAddr WeaponRightSwingHandler_Vtable(0x01768AD8); -// ??_7WeaponLeftSwingHandler@@6B@ -RelocAddr WeaponLeftSwingHandler_Vtable(0x01768AF0); -// ??_7RightHandSpellFireHandler@@6B@ -RelocAddr RightHandSpellFireHandler_Vtable(0x01768B80); -// ??_7LeftHandSpellFireHandler@@6B@ -RelocAddr LeftHandSpellFireHandler_Vtable(0x01768B68); -// ??_7RightHandSpellCastHandler@@6B@ -RelocAddr RightHandSpellCastHandler_Vtable(0x01768BC8); -// ??_7LeftHandSpellCastHandler@@6B@ -RelocAddr LeftHandSpellCastHandler_Vtable(0x01768BB0); -// ??_7VoiceSpellFireHandler@@6B@ -RelocAddr VoiceSpellFireHandler_Vtable(0x01768B98); -// ??_7VoiceSpellCastHandler@@6B@ -RelocAddr VoiceSpellCastHandler_Vtable(0x01768BE0); -// ??_7BowDrawnHandler@@6B@ -RelocAddr BowDrawnHandler_Vtable(0x01768F10); -// ??_7BowReleaseHandler@@6B@ -RelocAddr BowReleaseHandler_Vtable(0x01768F28); -// ??_7WeaponBeginDrawRightHandler@@6B@ -RelocAddr WeaponBeginDrawRightHandler_Vtable(0x01768BF8); -// ??_7WeaponBeginSheatheRightHandler@@6B@ -RelocAddr WeaponBeginSheatheRightHandler_Vtable(0x01768C10); -// ??_7RightHandWeaponDrawHandler@@6B@ -RelocAddr RightHandWeaponDrawHandler_Vtable(0x01768C28); -// ??_7RightHandWeaponSheatheHandler@@6B@ -RelocAddr RightHandWeaponSheatheHandler_Vtable(0x01768C40); - -void Hooks_Handlers_Commit(void) -{ - // vtbl overwrites - SafeWrite64(WeaponRightSwingHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(WeaponLeftSwingHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(RightHandSpellFireHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(LeftHandSpellFireHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(RightHandSpellCastHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(LeftHandSpellCastHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(VoiceSpellFireHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(VoiceSpellCastHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(BowDrawnHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(BowReleaseHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(WeaponBeginDrawRightHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(WeaponBeginSheatheRightHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - - SafeWrite64(RightHandWeaponDrawHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); - SafeWrite64(RightHandWeaponSheatheHandler_Vtable.GetUIntPtr() + 0x08, GetFnAddr(&IHandlerFunctor::ProcessAction)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Handlers.h b/source/fs.dll/skse64/skse64/Hooks_Handlers.h deleted file mode 100644 index 3a0fdfe9..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Handlers.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -void Hooks_Handlers_Init(void); -void Hooks_Handlers_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Memory.cpp b/source/fs.dll/skse64/skse64/Hooks_Memory.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/source/fs.dll/skse64/skse64/Hooks_Memory.h b/source/fs.dll/skse64/skse64/Hooks_Memory.h deleted file mode 100644 index e69de29b..00000000 diff --git a/source/fs.dll/skse64/skse64/Hooks_NetImmerse.cpp b/source/fs.dll/skse64/skse64/Hooks_NetImmerse.cpp deleted file mode 100644 index 604108ff..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_NetImmerse.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "Hooks_NetImmerse.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/BranchTrampoline.h" - -#include "skse64/GameReferences.h" -#include "skse64/GameFormComponents.h" -#include "skse64/PapyrusEvents.h" - -#include "common/ICriticalSection.h" -#include "xbyak/xbyak.h" - -// Used by UpdatePlayerTints to create a render target of a particular size -// D55B7565783E557DBA232E15687FDD05C35FE3D1+473 -RelocPtr g_tintTextureWidth(0x030C7444); -// D55B7565783E557DBA232E15687FDD05C35FE3D1+46C -RelocPtr g_tintTextureHeight(0x030C7448); - -UInt32 g_tintTextureResolution = 512; - -struct RenderTargetInfo -{ - UInt32 width; - UInt32 height; - UInt32 unk08; - UInt32 unk0C; - SInt32 unk10; - UInt32 unk14; - UInt16 unk18; - UInt16 unk1A; - UInt32 unk1C; -}; - -typedef void ( * _CreateRenderTarget)(void * renderTargetManager, UInt64 type, RenderTargetInfo * info); -RelocAddr<_CreateRenderTarget> CreateRenderTarget(0x00DB18B0); -_CreateRenderTarget CreateRenderTarget_Original = nullptr; - -void CreateRenderTarget_Hook(BSRenderManager ** targetManager, UInt64 type, RenderTargetInfo * info) -{ - if (type == 0xF) - { - info->width = g_tintTextureResolution; - info->height = g_tintTextureResolution; - - *g_tintTextureWidth = g_tintTextureResolution; - *g_tintTextureHeight = g_tintTextureResolution; - } - CreateRenderTarget_Original(targetManager, type, info); -} - -void ActorProcessManager::UpdateEquipment_Hooked(Actor * actor) -{ - CALL_MEMBER_FN(this, UpdateEquipment)(actor); - - SKSENiNodeUpdateEvent evn(actor); - g_ninodeUpdateEventDispatcher.SendEvent(&evn); -} - -void Hooks_NetImmerse_Init(void) -{ - UInt32 tintTextureResolution = 0; - if(GetConfigOption_UInt32("Display", "iTintTextureResolution", &tintTextureResolution)) - { - g_tintTextureResolution = tintTextureResolution; - } -} - -RelocAddr UpdateEquipment_Enter(0x006BBB70 + 0x197); - -void Hooks_NetImmerse_Commit(void) -{ - { - struct CreateRenderTarget_Code : Xbyak::CodeGenerator { - CreateRenderTarget_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - Xbyak::Label retnLabel; - - movups(xmm0, ptr[r8]); - movsxd(rax, edx); - - jmp(ptr[rip + retnLabel]); - - L(retnLabel); - dq(CreateRenderTarget.GetUIntPtr() + 7); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - CreateRenderTarget_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - CreateRenderTarget_Original = (_CreateRenderTarget)codeBuf; - - g_branchTrampoline.Write6Branch(CreateRenderTarget.GetUIntPtr(), (uintptr_t)CreateRenderTarget_Hook); - } - - g_branchTrampoline.Write5Call(UpdateEquipment_Enter, GetFnAddr(&ActorProcessManager::UpdateEquipment_Hooked)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_NetImmerse.h b/source/fs.dll/skse64/skse64/Hooks_NetImmerse.h deleted file mode 100644 index fc6856f7..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_NetImmerse.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "skse64_common/Relocation.h" -#include "skse64/NiRenderer.h" - -void Hooks_NetImmerse_Init(void); -void Hooks_NetImmerse_Commit(void); - diff --git a/source/fs.dll/skse64/skse64/Hooks_ObScript.cpp b/source/fs.dll/skse64/skse64/Hooks_ObScript.cpp deleted file mode 100644 index 0438896f..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_ObScript.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "Hooks_ObScript.h" -#include "ObScript.h" -#include "GameAPI.h" -//#include "GameReferences.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/skse_version.h" -#include "GameData.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "Hooks_Gameplay.h" -#include "GameInput.h" - -// currently ForceRSXCrash, could also use ToggleESRAM and several others -static ObScriptCommand * s_hijackedCommand = nullptr; - -void Hooks_ObScript_Init() -{ - // instead of hooking the entire classic scripting system, we're just hijacking some unused commands - - for(ObScriptCommand * iter = g_firstConsoleCommand; iter->opcode < kObScript_NumConsoleCommands + kObScript_ConsoleOpBase; ++iter) - { - if(!strcmp(iter->longName, "ForceRSXCrash")) - { - s_hijackedCommand = iter; - break; - } - } -} - -bool GetSKSEVersion_Execute(const ObScriptParam * paramInfo, ScriptData * scriptData, TESObjectREFR * thisObj, TESObjectREFR* containingObj, Script* scriptObj, ScriptLocals* locals, double& result, UInt32& opcodeOffsetPtr) -{ - _MESSAGE("GetSKSEVersion_Execute"); - - Console_Print("SKSE64 version: %d.%d.%d, release idx %d, runtime %08X", - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA, - SKSE_VERSION_RELEASEIDX, RUNTIME_VERSION); - - return true; -} - -void Hooks_ObScript_Commit() -{ - ObScriptCommand cmd = *s_hijackedCommand; - - cmd.longName = "GetSKSEVersion"; - cmd.shortName = "skse"; - cmd.helpText = ""; - cmd.needsParent = 0; - cmd.numParams = 0; - cmd.execute = GetSKSEVersion_Execute; - cmd.flags = 0; - - SafeWriteBuf((uintptr_t)s_hijackedCommand, &cmd, sizeof(cmd)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_ObScript.h b/source/fs.dll/skse64/skse64/Hooks_ObScript.h deleted file mode 100644 index 85d90513..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_ObScript.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -void Hooks_ObScript_Init(); -void Hooks_ObScript_Commit(); diff --git a/source/fs.dll/skse64/skse64/Hooks_Papyrus.cpp b/source/fs.dll/skse64/skse64/Hooks_Papyrus.cpp deleted file mode 100644 index bc8018dd..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Papyrus.cpp +++ /dev/null @@ -1,373 +0,0 @@ -#include "Hooks_Papyrus.h" -#include "skse64_common/Relocation.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/BranchTrampoline.h" -#include -#include "PapyrusVM.h" - -#include "PapyrusEvents.h" -#include "PapyrusDelayFunctors.h" -#include "Serialization.h" - -#include "PapyrusSKSE.h" -#include "PapyrusMath.h" -#include "PapyrusWeapon.h" -#include "PapyrusKeyword.h" -#include "PapyrusForm.h" -#include "PapyrusEnchantment.h" -#include "PapyrusMagicEffect.h" -#include "PapyrusSpell.h" -#include "PapyrusEquipSlot.h" -#include "PapyrusActor.h" -#include "PapyrusWornObject.h" -#include "PapyrusGame.h" -#include "PapyrusObjectReference.h" -#include "PapyrusActiveMagicEffect.h" -#include "PapyrusActorBase.h" -#include "PapyrusCombatStyle.h" -#include "PapyrusModEvent.h" -#include "PapyrusHeadPart.h" -#include "PapyrusColorForm.h" -#include "PapyrusTextureSet.h" -#include "PapyrusActorValueInfo.h" -#include "PapyrusUICallback.h" -#include "PapyrusUI.h" -#include "PapyrusUtility.h" -#include "PapyrusStringUtil.h" -#include "PapyrusQuest.h" -#include "PapyrusAlias.h" -#include "PapyrusAmmo.h" -#include "PapyrusMisc.h" -#include "PapyrusArmor.h" -#include "PapyrusArmorAddon.h" -#include "PapyrusArt.h" -#include "PapyrusBook.h" -#include "PapyrusCell.h" -#include "PapyrusConstructibleObject.h" -#include "PapyrusDefaultObjectManager.h" -#include "PapyrusFaction.h" -#include "PapyrusFlora.h" -#include "PapyrusFormList.h" -#include "PapyrusSoundDescriptor.h" -#include "PapyrusGameData.h" -#include "PapyrusIngredient.h" -#include "PapyrusLeveledActor.h" -#include "PapyrusLeveledItem.h" -#include "PapyrusLeveledSpell.h" -#include "PapyrusNetImmerse.h" -#include "PapyrusPerk.h" -#include "PapyrusPotion.h" -#include "PapyrusRace.h" -#include "PapyrusScroll.h" -#include "PapyrusShout.h" -#include "PapyrusSound.h" -#include "PapyrusSpawnerTask.h" -#include "PapyrusInput.h" -#include "PapyrusTree.h" -#include "PapyrusWeather.h" - -#include "xbyak/xbyak.h" - -typedef void(*_RegisterPapyrusFunctions)(VMClassRegistry ** registry); -RelocAddr<_RegisterPapyrusFunctions> RegisterPapyrusFunctions(0x009A98F0); -RelocAddr RegisterPapyrusFunctions_Start(0x0094D8E0 + 0xCC3); - -RelocAddr UnregisterFromSleep_Enter(0x00952AF0 + 0x14B); -RelocAddr RevertGlobalData_Enter(0x00959AC0 + 0x22); -RelocAddr RevertGlobalData_Enter2(0x0095A000 + 0x288); -RelocAddr SaveRegsSleep_Enter(0x0095C540 + 0x390); -RelocAddr LoadRegsSleep_Enter(0x0095D620 + 0x2FB); - -RelocAddr kDFQueueHook_Base(0x0095FBD0); -uintptr_t kDFQueueHook_HookAddr = kDFQueueHook_Base + 0x6E; -uintptr_t kDFQueueHook_Entry_retn = kDFQueueHook_Base + 0x73; - -typedef std::list PapyrusPluginList; -static PapyrusPluginList s_pap_plugins; - -bool RegisterPapyrusPlugin(SKSEPapyrusInterface::RegisterFunctions callback) -{ - s_pap_plugins.push_back(callback); - return true; -} - -void RegisterPapyrusFunctions_Hook(VMClassRegistry ** registryPtr) -{ - RegisterPapyrusFunctions(registryPtr); - - VMClassRegistry * registry = *registryPtr; - - // registration for classes - - // SKSE - papyrusSKSE::RegisterFuncs(registry); - - // TESForm - papyrusForm::RegisterFuncs(registry); - - // DefaultObjectManager - papyrusDefaultObjectManager::RegisterFuncs(registry); - - // ColorForm - papyrusColorComponent::RegisterFuncs(registry); - papyrusColorForm::RegisterFuncs(registry); - - // Art - papyrusArt::RegisterFuncs(registry); - - // EquipSlot - papyrusEquipSlot::RegisterFuncs(registry); - - // HeadPart - papyrusHeadPart::RegisterFuncs(registry); - - // TESObjectCELL - papyrusCell::RegisterFuncs(registry); - - // ArmorAddon (TESObjectARMA) - papyrusArmorAddon::RegisterFuncs(registry); - - // TESObjectARMO - papyrusArmor::RegisterFuncs(registry); - - // TESSoulGem - papyrusSoulGem::RegisterFuncs(registry); - - // BGSApparatus - papyrusApparatus::RegisterFuncs(registry); - - // Math - papyrusMath::RegisterFuncs(registry); - - // Input - papyrusInput::RegisterFuncs(registry); - - // ObjectReference - papyrusObjectReference::RegisterFuncs(registry); - - // Weapon - papyrusWeapon::RegisterFuncs(registry); - - // Ammo - papyrusAmmo::RegisterFuncs(registry); - - // CombatStyle - papyrusCombatStyle::RegisterFuncs(registry); - - // Actor - papyrusActor::RegisterFuncs(registry); - - // ActorBase (TESNPC) - papyrusActorBase::RegisterFuncs(registry); - - // Outfit - papyrusOutfit::RegisterFuncs(registry); - - // SoundDescriptor - papyrusSoundDescriptor::RegisterFuncs(registry); - - // Potion - papyrusPotion::RegisterFuncs(registry); - - // Race - papyrusRace::RegisterFuncs(registry); - - // Spell - papyrusSpell::RegisterFuncs(registry); - - // Enchantment - papyrusEnchantment::RegisterFuncs(registry); - - // Ingredient - papyrusIngredient::RegisterFuncs(registry); - - // Scroll - papyrusScroll::RegisterFuncs(registry); - - // StringUtil - papyrusStringUtil::RegisterFuncs(registry); - - // Keyword - papyrusKeyword::RegisterFuncs(registry); - - // TESObjectBOOK - papyrusBook::RegisterFuncs(registry); - - // ConstructibleObject - papyrusConstructibleObject::RegisterFuncs(registry); - - // Game - papyrusGame::RegisterFuncs(registry); - - // UI - papyrusUI::RegisterFuncs(registry); - - // Alias - papyrusAlias::RegisterFuncs(registry); - - // Quest - papyrusQuest::RegisterFuncs(registry); - - // Shout - papyrusShout::RegisterFuncs(registry); - - // Utility - papyrusUtility::RegisterFuncs(registry); - - // ActiveMagicEffect - papyrusActiveMagicEffect::RegisterFuncs(registry); - - // Sound - papyrusSound::RegisterFuncs(registry); - - // Weather - papyrusWeather::RegisterFuncs(registry); - - // NetImmerse - papyrusNetImmerse::RegisterFuncs(registry); - - // TextureSet - papyrusTextureSet::RegisterFuncs(registry); - - // Tree - papyrusTree::RegisterFuncs(registry); - - // Flora - papyrusFlora::RegisterFuncs(registry); - - // Perk - papyrusPerk::RegisterFuncs(registry); - - // MagicEffect - papyrusMagicEffect::RegisterFuncs(registry); - - // UICallback - papyrusUICallback::RegisterFuncs(registry); - - // ModEvent - papyrusModEvent::RegisterFuncs(registry); - - // ActorValueInfo - papyrusActorValueInfo::RegisterFuncs(registry); - - // LeveledItem - papyrusLeveledItem::RegisterFuncs(registry); - - // LeveledSpell - papyrusLeveledSpell::RegisterFuncs(registry); - - // LeveledActor - papyrusLeveledActor::RegisterFuncs(registry); - - // WornObject - papyrusWornObject::RegisterFuncs(registry); - - // Faction - papyrusFaction::RegisterFuncs(registry); - - // PapyrusSpawnerTask - papyrusSpawnerTask::RegisterFuncs(registry); - - // FormList - papyrusFormList::RegisterFuncs(registry); - - // GameData - papyrusGameData::RegisterFuncs(registry); - -//#ifdef _PPAPI - // Plugins - for (PapyrusPluginList::iterator iter = s_pap_plugins.begin(); iter != s_pap_plugins.end(); ++iter) - { - (*iter)(registry); - } -//#endif -} - -void SkyrimVM::OnFormDelete_Hook(UInt64 handle) -{ - CALL_MEMBER_FN(this, UnregisterFromSleep_Internal)(handle); - - g_menuOpenCloseRegs.UnregisterAll(handle); - g_inputKeyEventRegs.UnregisterAll(handle); - g_inputControlEventRegs.UnregisterAll(handle); - g_modCallbackRegs.UnregisterAll(handle); - g_actionEventRegs.UnregisterAll(handle); - - g_cameraEventRegs.Unregister(handle); - g_crosshairRefEventRegs.Unregister(handle); - - Serialization::HandleDeletedForm(handle); -} - -void SkyrimVM::RevertGlobalData_Hook(void) -{ - CALL_MEMBER_FN(this, RevertGlobalData_Internal)(); - - Serialization::HandleRevertGlobalData(); -} - -bool SkyrimVM::SaveGlobalData_Hook(void * handleReaderWriter, void * saveStorageWrapper) -{ - bool success = CALL_MEMBER_FN(this, SaveRegSleepEventHandles_Internal)(handleReaderWriter, saveStorageWrapper); - Serialization::HandleSaveGlobalData(); - return success; -} - -bool SkyrimVM::LoadGlobalData_Hook(void * handleReaderWriter, void * loadStorageWrapper) -{ - bool success = CALL_MEMBER_FN(this, LoadRegSleepEventHandles_Internal)(handleReaderWriter, loadStorageWrapper); - Serialization::HandleLoadGlobalData(); - return success; -} - -__int64 DelayFunctorQueue_Hook(float budget) -{ - SKSEDelayFunctorManagerInstance().OnPreTick(); - - LARGE_INTEGER startTime; - QueryPerformanceCounter(&startTime); - - // Sharing budget with papyrus queue - SKSEDelayFunctorManagerInstance().OnTick(startTime.QuadPart, budget); - - return startTime.QuadPart; -} - -void Hooks_Papyrus_Init() -{ - -} - -void Hooks_Papyrus_Commit() -{ - g_branchTrampoline.Write5Call(RegisterPapyrusFunctions_Start, (uintptr_t)RegisterPapyrusFunctions_Hook); - - // GlobalData / event regs - g_branchTrampoline.Write5Call(UnregisterFromSleep_Enter, GetFnAddr(&SkyrimVM::OnFormDelete_Hook)); - g_branchTrampoline.Write5Call(RevertGlobalData_Enter, GetFnAddr(&SkyrimVM::RevertGlobalData_Hook)); // Normal game load - g_branchTrampoline.Write5Call(RevertGlobalData_Enter2, GetFnAddr(&SkyrimVM::RevertGlobalData_Hook)); // New script reload command - g_branchTrampoline.Write5Call(SaveRegsSleep_Enter, GetFnAddr(&SkyrimVM::SaveGlobalData_Hook)); - g_branchTrampoline.Write5Call(LoadRegsSleep_Enter, GetFnAddr(&SkyrimVM::LoadGlobalData_Hook)); - - { - struct DelayFunctorQueue_Entry_Code : Xbyak::CodeGenerator { - DelayFunctorQueue_Entry_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // Need timeBudget as parameter - movss(xmm0, ptr[rsp + 0xB0]); - mov(rax, (uintptr_t)DelayFunctorQueue_Hook); - call(rax); - - // Return to original code - jmp(ptr[rip]); - dq(kDFQueueHook_Entry_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - DelayFunctorQueue_Entry_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(kDFQueueHook_HookAddr, uintptr_t(code.getCode())); - } -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Papyrus.h b/source/fs.dll/skse64/skse64/Hooks_Papyrus.h deleted file mode 100644 index 054ff427..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Papyrus.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "skse64/PluginAPI.h" - -void Hooks_Papyrus_Init(); -void Hooks_Papyrus_Commit(); - -bool RegisterPapyrusPlugin(SKSEPapyrusInterface::RegisterFunctions); diff --git a/source/fs.dll/skse64/skse64/Hooks_SaveLoad.cpp b/source/fs.dll/skse64/skse64/Hooks_SaveLoad.cpp deleted file mode 100644 index 21eaa34f..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_SaveLoad.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "Hooks_SaveLoad.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/BranchTrampoline.h" -#include "Serialization.h" -#include "GlobalLocks.h" -#include "GameData.h" -#include "GameMenus.h" -#include "PapyrusVM.h" -#include "PluginManager.h" - -void BGSSaveLoadManager::SaveGame_Hook(UInt64 *unk0) -{ - const char *saveName = reinterpret_cast(unk0[0xBB0 / 8]); - - // Game actually does this, we may as well do the same - if (!saveName) - saveName = ""; - -#ifdef DEBUG - _MESSAGE("Executing BGSSaveLoadManager::SaveGame_Hook. saveName: %s", saveName); -#endif - - Serialization::SetSaveName(saveName); - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_SaveGame, (void*)saveName, strlen(saveName), NULL); - CALL_MEMBER_FN(this, SaveGame_HookTarget)(unk0); - Serialization::SetSaveName(NULL); - -#ifdef DEBUG - _MESSAGE("Executed BGSSaveLoadManager::SaveGame_Hook."); -#endif -} - -bool BGSSaveLoadManager::LoadGame_Hook(UInt64 *unk0, UInt32 unk1, UInt32 unk2, void *unk3) -{ - const char *saveName = reinterpret_cast(unk0[0xBB0 / 8]); - - // Game actually does this, we may as well do the same - if (!saveName) - saveName = ""; - -#ifdef DEBUG - _MESSAGE("Executing BGSSaveLoadManager::LoadGame_Hook. saveName: %s", saveName); -#endif - - g_loadGameLock.Enter(); - - Serialization::SetSaveName(saveName); - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_PreLoadGame, (void*)saveName, strlen(saveName), NULL); - bool result = CALL_MEMBER_FN(this, LoadGame_HookTarget)(unk0, unk1, unk2, unk3); - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_PostLoadGame, (void*)result, 1, NULL); - Serialization::SetSaveName(NULL); - - g_loadGameLock.Leave(); - - // Clear invalid handles in OnUpdate event registration list - UInt32 enableClearRegs = 0; - if(GetConfigOption_UInt32("General", "ClearInvalidRegistrations", &enableClearRegs)) - { - if(enableClearRegs) - { - UInt32 count = (*g_skyrimVM)->ClearInvalidRegistrations(); - if (count > 0) - _MESSAGE("ClearInvalidRegistrations: Removed %d invalid OnUpdate registration(s)", count); - } - } - -#ifdef DEBUG - _MESSAGE("Executed BGSSaveLoadManager::LoadGame_Hook."); -#endif - - return result; -} - -bool s_requestedSave = false; -bool s_requestedLoad = false; -std::string s_reqSaveName; -std::string s_reqLoadName; - -void BGSSaveLoadManager::RequestSave(const char * name) -{ - s_requestedSave = true; - s_reqSaveName = name; -} - -void BGSSaveLoadManager::RequestLoad(const char * name) -{ - s_requestedLoad = true; - s_reqLoadName = name; -} - -void BGSSaveLoadManager::ProcessEvents_Hook(void) -{ - CALL_MEMBER_FN(this, ProcessEvents_Internal)(); - - // wants both? gets nothing. - if(s_requestedSave && s_requestedLoad) - _MESSAGE("BGSSaveLoadManager: save and load requested in the same frame, ignoring both"); - else if(s_requestedSave) - Save(s_reqSaveName.c_str()); - else if(s_requestedLoad) - Load(s_reqLoadName.c_str()); - - s_requestedSave = false; - s_requestedLoad = false; - s_reqSaveName.clear(); - s_reqLoadName.clear(); -} - -void BGSSaveLoadManager::DeleteSavegame_Hook(const char * saveNameIn, UInt32 unk1) - -{ - std::string saveName = saveNameIn; - - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_DeleteGame, (void*)saveName.c_str(), strlen(saveName.c_str()), NULL); - CALL_MEMBER_FN(this, DeleteSavegame)(saveNameIn, unk1); - Serialization::HandleDeleteSave(saveName); -} - -UInt8 TESQuest::NewGame_Hook(UInt8 * unk1, UInt8 unk2) -{ - UInt8 ret = CALL_MEMBER_FN(this, NewGame_Internal)(unk1, unk2); - PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_NewGame, (void*)this, sizeof(void*), NULL); - return ret; -} - -RelocAddr SaveGame_HookTarget_Enter(0x005A87C0 + 0x2B3); -RelocAddr LoadGame_HookTarget_Enter(0x005AD3B0 + 0x2C5); -// 691ACD40B8430FBDA081477DEB2A9948ACC235F1+11F -RelocAddr ProcessEvents_Enter(0x005DACE0 + 0x9A); -RelocAddr NewGame_Enter(0x008D3370 + 0x59); -RelocAddr DeleteSaveGame_Enter(0x0059AAE0 + 0x77); -RelocAddr DeleteSaveGame_Enter2(0x0059ABB0 + 0x17); - -void Hooks_SaveLoad_Commit(void) -{ - // Load & Save - g_branchTrampoline.Write5Call(SaveGame_HookTarget_Enter, GetFnAddr(&BGSSaveLoadManager::SaveGame_Hook)); - g_branchTrampoline.Write5Call(LoadGame_HookTarget_Enter, GetFnAddr(&BGSSaveLoadManager::LoadGame_Hook)); - g_branchTrampoline.Write5Call(ProcessEvents_Enter, GetFnAddr(&BGSSaveLoadManager::ProcessEvents_Hook)); - - // New Game - g_branchTrampoline.Write5Call(NewGame_Enter, GetFnAddr(&TESQuest::NewGame_Hook)); - - // Delete savegame - g_branchTrampoline.Write5Call(DeleteSaveGame_Enter, GetFnAddr(&BGSSaveLoadManager::DeleteSavegame_Hook)); - g_branchTrampoline.Write5Call(DeleteSaveGame_Enter2, GetFnAddr(&BGSSaveLoadManager::DeleteSavegame_Hook)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_SaveLoad.h b/source/fs.dll/skse64/skse64/Hooks_SaveLoad.h deleted file mode 100644 index 7a5d7069..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_SaveLoad.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void Hooks_SaveLoad_Commit(void); diff --git a/source/fs.dll/skse64/skse64/Hooks_Scaleform.cpp b/source/fs.dll/skse64/skse64/Hooks_Scaleform.cpp deleted file mode 100644 index 2c0603fe..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Scaleform.cpp +++ /dev/null @@ -1,1855 +0,0 @@ -#include "Hooks_Scaleform.h" -#include "Hooks_Gameplay.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/BranchTrampoline.h" -#include "ScaleformCallbacks.h" -#include "ScaleformMovie.h" -#include "ScaleformAPI.h" -#include "ScaleformExtendedData.h" -#include "ScaleformLoader.h" -#include "GameAPI.h" -#include "GameSettings.h" -#include "GameMenus.h" -#include "PluginManager.h" -#include "skse64_common/skse_version.h" -#include "GameForms.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "GameRTTI.h" -#include "GameData.h" -#include "GameExtraData.h" -#include -#include -#include "PapyrusEvents.h" -#include "PapyrusVM.h" -#include "ScaleformState.h" -#include "GlobalLocks.h" -#include "GameMenus.h" -#include "common/IMemPool.h" -#include "HashUtil.h" -#include "Translation.h" -#include "xbyak/xbyak.h" - -//// plugin API - -struct ScaleformPluginInfo -{ - const char * name; - SKSEScaleformInterface::RegisterCallback callback; -}; - -typedef std::list PluginList; -static PluginList s_plugins; - -typedef std::list InventoryPluginList; -static InventoryPluginList s_inventoryPlugins; - -bool g_logScaleform = false; - -bool RegisterScaleformPlugin(const char * name, SKSEScaleformInterface::RegisterCallback callback) -{ - // check for a name collision - for(PluginList::iterator iter = s_plugins.begin(); iter != s_plugins.end(); ++iter) - { - if(!strcmp(iter->name, name)) - { - _WARNING("scaleform plugin name collision: %s", iter->name); - return false; - } - } - - ScaleformPluginInfo info; - - info.name = name; - info.callback = callback; - - s_plugins.push_back(info); - - return true; -} - -void RegisterScaleformInventory(SKSEScaleformInterface::RegisterInventoryCallback callback) -{ - s_inventoryPlugins.push_back(callback); -} - -//// commands - -class SKSEScaleform_AllowTextInput : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - bool enable = args->args[0].GetBool(); - - InputManager * inputManager = InputManager::GetSingleton(); - if(inputManager) - { - UInt8 allowCount = inputManager->AllowTextInput(enable); -#if _DEBUG - _MESSAGE("scaleform: AllowTextInput (counter = %d)", allowCount); -#endif - } - else - _WARNING("input manager not initialized"); - } -}; - -class SKSEScaleform_GetMappedKey : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 3); - - const char * nameArg = args->args[0].GetString(); - BSFixedString name(nameArg); - - UInt32 deviceType = (UInt32)args->args[1].GetNumber(); - UInt32 contextIdx = (UInt32)args->args[2].GetNumber(); - - args->result->SetNull(); - - InputManager * inputManager = InputManager::GetSingleton(); - if (!inputManager) - return; - - UInt32 key = inputManager->GetMappedKey(name, deviceType, contextIdx); - - if (key == 0xFF) - { - args->result->SetNumber(-1); - return; - } - - if (deviceType == kDeviceType_Mouse) - { - args->result->SetNumber(key + InputMap::kMacro_MouseButtonOffset); - } - else if (deviceType == kDeviceType_Gamepad) - { - UInt32 mapped = InputMap::GamepadMaskToKeycode(key); - args->result->SetNumber((mapped != InputMap::kMaxMacros ? mapped : -1)); - } - else - { - args->result->SetNumber(key); - } - } -}; - -class SKSEScaleform_StartRemapMode : public GFxFunctionHandler -{ - class RemapHandler : public BSTEventSink - { - public: - virtual EventResult ReceiveEvent(InputEvent ** evns, InputEventDispatcher * dispatcher) - { - ButtonEvent * e = (ButtonEvent*) *evns; - - // Make sure this is really a button event - if (!e || e->eventType != InputEvent::kEventType_Button) - return kEvent_Continue; - - UInt32 deviceType = e->deviceType; - - if ((dispatcher->IsGamepadEnabled() ^ (deviceType == kDeviceType_Gamepad)) || e->flags == 0 || e->timer != 0.0) - return kEvent_Continue; - - UInt32 keyMask = e->keyMask; - UInt32 keyCode; - - // Mouse - if (deviceType == kDeviceType_Mouse) - keyCode = InputMap::kMacro_MouseButtonOffset + keyMask; - // Gamepad - else if (deviceType == kDeviceType_Gamepad) - keyCode = InputMap::GamepadMaskToKeycode(keyMask); - // Keyboard - else - keyCode = keyMask; - - // Valid scancode? - if (keyCode >= InputMap::kMaxMacros) - keyCode = -1; - - GFxValue arg; - arg.SetNumber(keyCode); - scope.Invoke("EndRemapMode", NULL, &arg, 1); - - MenuControls::GetSingleton()->remapMode = false; - PlayerControls::GetSingleton()->remapMode = false; - - dispatcher->RemoveEventSink(this); - return kEvent_Continue; - } - - GFxValue scope; - }; - - RemapHandler remapHandler; - -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - remapHandler.scope = args->args[0]; - - PlayerControls * playerControls = PlayerControls::GetSingleton(); - if (!playerControls) - return; - - MenuControls * menuControls = MenuControls::GetSingleton(); - if (!menuControls) - return; - InputEventDispatcher* pInputEventDispatcher = InputEventDispatcher::GetSingleton(); - if (! (pInputEventDispatcher)) - return; - - pInputEventDispatcher->AddEventSink(&remapHandler); - menuControls->remapMode = true; - playerControls->remapMode = true; - } -}; - -const char * s_lastControlDown; -const char * s_lastControlUp; -UInt32 s_lastKeycodeDown; -UInt32 s_lastKeycodeUp; - -void SetLastControlDown(const char * control, UInt32 keycode) -{ - s_lastControlDown = control; - s_lastKeycodeDown = keycode; -} - -void SetLastControlUp(const char * control, UInt32 keycode) -{ - s_lastControlUp = control; - s_lastKeycodeUp = keycode; -} - -class SKSEScaleform_GetLastControl : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - bool isKeyDown = args->args[0].GetBool(); - - if (isKeyDown) - args->result->SetString(s_lastControlDown); - else - args->result->SetString(s_lastControlUp); - } -}; - -class SKSEScaleform_GetLastKeycode : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - bool isKeyDown = args->args[0].GetBool(); - - if (isKeyDown) - args->result->SetNumber(s_lastKeycodeDown); - else - args->result->SetNumber(s_lastKeycodeUp); - } -}; - - -class SKSEScaleform_Log : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - const char * strData = args->args[0].GetString(); - - _MESSAGE("%s", strData); - } -}; - -class SKSEScaleform_SetINISetting : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 2); - - const char * settingName = args->args[0].GetString(); - double settingValue = args->args[1].GetNumber(); - -#if _DEBUG - _MESSAGE("scaleform: SetINISetting %s %f", settingName, settingValue); -#endif - - Setting * setting = GetINISetting(settingName); - - if(setting) - { - if(!setting->SetDouble(settingValue)) - { - _MESSAGE("tried to set a non-floating-point setting (%s)", settingName); - } - } - else - { - _MESSAGE("setting not found (%s)", settingName); - } - } -}; - -class SKSEScaleform_GetINISetting : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - const char * settingName = args->args[0].GetString(); - -#if _DEBUG - _MESSAGE("scaleform: GetINISetting %s", settingName); -#endif - - Setting * setting = GetINISetting(settingName); - - args->result->SetNull(); - - if(setting) - { - double result; - - if(!setting->GetDouble(&result)) - { - _MESSAGE("tried to get a non-floating-point setting (%s)", settingName); - } - else - { - args->result->SetNumber(result); - } - } - else - { - _MESSAGE("setting not found (%s)", settingName); - } - } -}; - -class SKSEScaleform_OpenMenu : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - const char * menuName = args->args[0].GetString(); - -#if _DEBUG - _MESSAGE("scaleform: open menu (%s)", menuName); -#endif - - StringCache::Ref menuNameRef; - - CALL_MEMBER_FN(&menuNameRef, ctor)(menuName); - CALL_MEMBER_FN(UIManager::GetSingleton(), AddMessage)(&menuNameRef, UIMessage::kMessage_Open, NULL); - CALL_MEMBER_FN(&menuNameRef, Release)(); - } -}; - -class SKSEScaleform_CloseMenu : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - ASSERT(args->numArgs >= 1); - - const char * menuName = args->args[0].GetString(); - -#if _DEBUG - _MESSAGE("scaleform: close menu (%s)", menuName); -#endif - - StringCache::Ref menuNameRef; - - CALL_MEMBER_FN(&menuNameRef, ctor)(menuName); - CALL_MEMBER_FN(UIManager::GetSingleton(), AddMessage)(&menuNameRef, UIMessage::kMessage_Close, NULL); - CALL_MEMBER_FN(&menuNameRef, Release)(); - } -}; - -static bool s_bExtendData = false; - -class SKSEScaleform_ExtendData : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args* args) - { - ASSERT(args->numArgs >= 1); - - bool bExtend = args->args[0].GetBool(); - - s_bExtendData = bExtend; - } -}; - -static bool s_bExtendAlchemyCategories = false; - -class SKSEScaleform_ExtendAlchemyCategories : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args* args) - { - ASSERT(args->numArgs >= 1); - - bool bExtend = args->args[0].GetBool(); - - s_bExtendAlchemyCategories = bExtend; - } -}; - -class SKSEScaleform_ForceContainerCategorization : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args* args) - { - ASSERT(args->numArgs >= 1); - - bool enable = args->args[0].GetBool(); - - Hooks_Gameplay_EnableForceContainerCategorization(enable); - } -}; - -class SKSEScaleform_SendModEvent : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args* args) - { - if (! g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - - const char * eventName = args->args[0].GetString(); - const char * strArg = NULL; - float numArg = 0.0; - UInt32 formidArg = 0; - TESForm * formArg = NULL; - - if (args->numArgs >= 2) - strArg = args->args[1].GetString(); - - if (args->numArgs >= 3) - numArg = args->args[2].GetNumber(); - - if (args->numArgs >= 4) { - formidArg = (UInt32)args->args[3].GetNumber(); - if(formidArg > 0) - formArg = LookupFormByID(formidArg); - } - -#if _DEBUG - _MESSAGE("scaleform: send mod event (%s, %s, %f)", eventName, strArg, numArg); -#endif - - BSFixedString aEventName(eventName); - BSFixedString aStrArg(strArg); - SKSEModCallbackEvent evn(aEventName, aStrArg, numArg, formArg); - g_modCallbackEventDispatcher.SendEvent(&evn); - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_RequestActivePlayerEffects : public GFxFunctionHandler -{ - class ActiveEffectVisitor - { - GFxMovieView * movieView; - GFxValue * activeEffects; - - public: - ActiveEffectVisitor(GFxMovieView * a_movieView, GFxValue * a_activeEffects) - : movieView(a_movieView), activeEffects(a_activeEffects) {} - - bool Accept(ActiveEffect * e) - { - if (!e) - return false; - - if (e->duration <= 0) - return true; - - if (e->effect == NULL || e->effect->mgef == NULL) - return true; - - EffectSetting * mgef = e->effect->mgef; - - // Skip effect if condition wasn't evaluated to true or HideInUI flag is set - if (e->flags & ActiveEffect::kFlag_Inactive || mgef->properties.flags & EffectSetting::Properties::kEffectType_HideInUI) - return true; - - GFxValue obj; - movieView->CreateObject(&obj); - - RegisterNumber(&obj, "duration", e->duration); - RegisterNumber(&obj, "elapsed", e->elapsed); - RegisterNumber(&obj, "magnitude", e->magnitude); - RegisterNumber(&obj, "effectFlags", mgef->properties.flags); - RegisterNumber(&obj, "subType", mgef->school()); - RegisterNumber(&obj, "archetype", mgef->properties.archetype); - RegisterNumber(&obj, "actorValue", mgef->properties.primaryValue); - RegisterNumber(&obj, "magicType", mgef->properties.resistance); - - // Use pointer value to track effects - RegisterNumber(&obj, "id", (UInt64)e); - - activeEffects->PushBack(&obj); - - return true; - } - }; - -public: - virtual void Invoke(Args* args) - { - if (! g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - ASSERT(args->args[0].GetType() == GFxValue::kType_Array); - - tList * effects = (*g_thePlayer) ? (*g_thePlayer)->magicTarget.GetActiveEffects() : nullptr; - if(effects) - { - ActiveEffectVisitor v(args->movie, &args->args[0]); - effects->Visit(v); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_ExtendForm : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args* args) - { - if (! g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - ASSERT(args->args[0].GetType() == GFxValue::kType_Number); - ASSERT(args->args[1].GetType() == GFxValue::kType_Object); - - UInt32 formidArg = 0; - TESForm * formArg = NULL; - GFxValue * object = NULL; - bool bExtra = false; - // False - Pull only basic data - // True - Pull all form data - bool bRecursive = false; - // False - Pull only first level data - // True - Pull all Form children - - if (args->numArgs >= 1) { - formidArg = (UInt32)args->args[0].GetNumber(); - if(formidArg > 0) - formArg = LookupFormByID(formidArg); - } - - if (args->numArgs >= 2) - object = &args->args[1]; - - if (args->numArgs >= 3) - bExtra = args->args[2].GetBool(); - - if (args->numArgs >= 4) - bRecursive = args->args[3].GetBool(); - - if(formArg && object) - scaleformExtend::FormData(object, args->movie, formArg, bExtra, bRecursive); - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_RequestActorValues : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if (! g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - ASSERT(args->args[0].GetType() == GFxValue::kType_Number); - ASSERT(args->args[1].GetType() == GFxValue::kType_Array); - ASSERT(args->args[2].GetType() == GFxValue::kType_Array); - - UInt32 formidArg = 0; - UInt32 actorValue = 0; - TESForm * formArg; - GFxValue * inArray = NULL; - GFxValue * outArray = NULL; - - if (args->numArgs >= 1) { - formidArg = (UInt32)args->args[0].GetNumber(); - if(formidArg > 0) - formArg = LookupFormByID(formidArg); - } - - if(!formArg) { - _MESSAGE("SKSEScaleform_RequestActorValues - Invalid form (%X)", formidArg); - g_loadGameLock.Leave(); - return; - } - - Actor * actor = DYNAMIC_CAST(formArg, TESForm, Actor); - if(!actor) { - _MESSAGE("SKSEScaleform_RequestActorValues - Invalid form type (%X)", formidArg); - g_loadGameLock.Leave(); - return; - } - - if (args->numArgs >= 2) { - inArray = &args->args[1]; - } - if (args->numArgs >= 3) { - outArray = &args->args[2]; - } - - GFxValue val; - UInt32 size = inArray->GetArraySize(); - for(UInt32 i = 0; i < size; i++) - { - inArray->GetElement(i, &val); - if(val.GetType() != GFxValue::kType_Number) - continue; - - GFxValue avOut; - args->movie->CreateObject(&avOut); - - UInt32 actorValue = val.GetNumber(); - RegisterNumber(&avOut, "id", actorValue); - RegisterNumber(&avOut, "base", actor->actorValueOwner.GetBase(actorValue)); - RegisterNumber(&avOut, "current", actor->actorValueOwner.GetCurrent(actorValue)); - RegisterNumber(&avOut, "maximum", actor->actorValueOwner.GetMaximum(actorValue)); - - outArray->PushBack(&avOut); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_GetClipboardData : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if (! g_loadGameLock.TryEnter()) - return; - - if(OpenClipboard(NULL)) - { - BOOL unicode = IsClipboardFormatAvailable(CF_UNICODETEXT); - BOOL utf8 = IsClipboardFormatAvailable(CF_TEXT); - if(unicode || utf8) - { - HANDLE handle = GetClipboardData(unicode ? CF_UNICODETEXT : CF_TEXT); - if(handle) - { - LPTSTR textData = (LPTSTR)GlobalLock(handle); - if(textData) - { - if(unicode) - args->movie->CreateWideString(args->result, (const wchar_t*)textData); - else - args->movie->CreateString(args->result, (const char*)textData); - - GlobalUnlock(handle); - } - } - } - - CloseClipboard(); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_SetClipboardData : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - if(OpenClipboard(NULL)) - { - const wchar_t * textUnicode = args->args[0].GetWideString(); - const char * textUtf8 = args->args[0].GetString(); - void * textIn = NULL; - - UInt32 size = 0; - if(textUnicode) { - size = (wcslen(textUnicode) + 1) * sizeof(wchar_t); - textIn = (void*)textUnicode; - } - else if(textUtf8) { - size = strlen(textUtf8) + 1; - textIn = (void*)textUtf8; - } - - if(textIn && size > 0) - { - HANDLE handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); - if(handle) - { - LPTSTR textData = (LPTSTR)GlobalLock(handle); - if(textData) - { - memcpy(textData, textIn, size); - GlobalUnlock(handle); - - EmptyClipboard(); - if(SetClipboardData(textUtf8 ? CF_TEXT : CF_UNICODETEXT, handle)) - { - handle = NULL; // ownership passed to the OS - } - } - - // clean up the allocation if something failed - if(handle) - { - GlobalFree(handle); - } - } - } - - CloseClipboard(); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_GetPlayerSex : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - args->result->SetNull(); - - TESNPC * actorBase = DYNAMIC_CAST((*g_thePlayer)->baseForm, TESForm, TESNPC); - if(actorBase) { - args->result->SetNumber(CALL_MEMBER_FN(actorBase, GetSex)()); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_EnableMapMenuMouseWheel : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - - bool enable = args->args[0].GetBool(); - - Hooks_Gameplay_EnableMapMenuMouseWheel(enable); - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_ShowOnMap : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - - UInt32 index = args->args[0].GetNumber(); - UIStringHolder * stringHolder = UIStringHolder::GetSingleton(); - MenuManager * mm = MenuManager::GetSingleton(); - - if (index >= 0 && mm->IsMenuOpen(&stringHolder->mapMenu)) - { - MapMenu * mapMenu = static_cast(mm->GetMenu(&stringHolder->mapMenu)); - - if (mapMenu && index < mapMenu->markers.count) - { - MapMenu::MarkerData & marker = mapMenu->markers[index]; - UInt32 refHandle = marker.refHandle; - - if (refHandle) - { - RefHandleUIData * msgData = (RefHandleUIData*) CreateUIMessageData(&stringHolder->refHandleUIData); - - if (msgData) - { - msgData->refHandle = refHandle; - CALL_MEMBER_FN(UIManager::GetSingleton(), AddMessage)(&stringHolder->mapMenu, UIMessage::kMessage_Refresh, msgData); - } - } - } - } - - g_loadGameLock.Leave(); - } -}; - -typedef std::list IndexStorageList; -typedef std::map IndexStorageTable; - -IndexStorageTable s_indexTable; - -class SKSEScaleform_StoreIndices : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 2); - ASSERT(args->args[0].GetType() == GFxValue::kType_String); - ASSERT(args->args[1].GetType() == GFxValue::kType_Array); - - std::string key(args->args[0].GetString()); - GFxValue * indices = &args->args[1]; - - s_indexTable[key].clear(); - - for (UInt32 i=0; iGetArraySize(); i++) - { - GFxValue t; - if (indices->GetElement(i, &t)) - if (t.GetType() == GFxValue::kType_Number) - s_indexTable[key].push_back(t.GetNumber()); - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_LoadIndices : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 2); - ASSERT(args->args[0].GetType() == GFxValue::kType_String); - ASSERT(args->args[1].GetType() == GFxValue::kType_Array); - - std::string key(args->args[0].GetString()); - GFxValue * indicesOut = &args->args[1]; - - IndexStorageTable::iterator indices = s_indexTable.find(key); - - if (indices != s_indexTable.end()) - { - for (IndexStorageList::iterator iter = indices->second.begin(); iter != indices->second.end(); ++iter) - { - GFxValue t; - t.SetNumber(*iter); - indicesOut->PushBack(&t); - } - } - - g_loadGameLock.Leave(); - } -}; - -class SKSEScaleform_GetModList : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - DataHandler* pDataHandler = DataHandler::GetSingleton(); - - args->movie->CreateArray(args->result); - - for(UInt32 i = 0; i < pDataHandler->modList.modInfoList.Count(); i++) - { - ModInfo* modInfo = pDataHandler->modList.modInfoList.GetNthItem(i); - if(modInfo) - { - GFxValue info; - args->movie->CreateObject(&info); - - RegisterNumber(&info, "index", i); - RegisterString(&info, args->movie, "name", modInfo->name); - RegisterString(&info, args->movie, "author", modInfo->author.Get()); - RegisterString(&info, args->movie, "description", modInfo->description.Get()); - - args->result->PushBack(&info); - } - } - - g_loadGameLock.Leave(); - } -}; - -typedef void * (* _UIOpenJournalMenu)(bool bUnk); -RelocAddr<_UIOpenJournalMenu> UIOpenJournalMenu(0x00924F90); - -class SKSEScaleform_OpenJournalMenu : public GFxFunctionHandler -{ -public: - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - UIOpenJournalMenu(true); - - g_loadGameLock.Leave(); - } -}; - -/* -class GetScriptVariableFunctor : public IForEachScriptObjectFunctor -{ -public: - GetScriptVariableFunctor(VMClassRegistry * registry, UInt64 handle, BSFixedString var) - { - m_registry = registry; - m_handle = handle; - m_variable = var; - } - virtual ~GetScriptVariableFunctor(){} - - virtual bool Visit(VMScriptInstance * script, void * arg2) - { - UInt32 variableId = CALL_MEMBER_FN(script->classInfo, GetVariable)(&m_variable); - if(variableId == -1) { - return true; - } - if(m_registry->ExtractValue(m_handle, &script->classInfo->name, variableId, &m_result)) - { - return false; - } - - return true; - } - - VMValue * getResult() { return m_result.type == VMValue::kType_None ? NULL : &m_result; } - -private: - VMClassRegistry * m_registry; - BSFixedString m_variable; - UInt64 m_handle; - VMValue m_result; -}; - -#include "PapyrusArgs.h" - -class SKSEScaleform_GetVMVariable : public GFxFunctionHandler -{ - virtual void Invoke(Args * args) - { - if(!g_loadGameLock.TryEnter()) - return; - - ASSERT(args->numArgs >= 1); - ASSERT(args->args[0].GetType() == GFxValue::kType_Number); - ASSERT(args->args[1].GetType() == GFxValue::kType_String); - - const char * varName = args->args[1].GetString(); - BSFixedString variableName(varName); - - UInt32 formId; - TESForm * form = NULL; - - - if (args->numArgs >= 1) { - formId = (UInt32)args->args[0].GetNumber(); - if(formId > 0) - form = LookupFormByID(formId); - } - - args->result->SetNull(); - - if(form) { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - UInt64 handle = policy->Create(form->formType, form); - if (handle != policy->GetInvalidHandle()) - { - GetScriptVariableFunctor scriptVariable(registry, handle, variableName); - registry->VisitScripts(handle, &scriptVariable); - VMValue * retValue; - if((retValue = scriptVariable.getResult()) != NULL) - { - if(retValue->IsIdentifier()) - { - TESForm * retForm; - UnpackValue(&retForm, retValue); - if(retForm) { - args->movie->CreateObject(args->result); - scaleformExtend::FormData(args->result, args->movie, retForm, false, false); - } - } - else - { - switch(retValue->type) - { - case VMValue::kType_Bool: - { - bool b; - UnpackValue(&b, retValue); - args->result->SetNumber(b); - } - break; - case VMValue::kType_Int: - { - SInt32 i; - UnpackValue(&i, retValue); - args->result->SetNumber(i); - } - break; - case VMValue::kType_Float: - { - float f; - UnpackValue(&f, retValue); - args->result->SetNumber(f); - } - break; - case VMValue::kType_String: - { - BSFixedString str; - UnpackValue(&str, retValue); - args->movie->CreateString(args->result, str.data); - } - break; - case VMValue::kType_BoolArray: - { - VMArray bArray; - UnpackValue>(&bArray, retValue); - args->movie->CreateArray(args->result); - - bool tmp; - for(int i = 0; i < bArray.Length(); i++) { - GFxValue gfxValue; - bArray.Get(&tmp, i); - gfxValue.SetNumber(tmp); - args->result->PushBack(&gfxValue); - } - } - break; - case VMValue::kType_IntArray: - { - VMArray iArray; - UnpackValue>(&iArray, retValue); - args->movie->CreateArray(args->result); - - SInt32 tmp; - for(int i = 0; i < iArray.Length(); i++) { - GFxValue gfxValue; - iArray.Get(&tmp, i); - gfxValue.SetNumber(tmp); - args->result->PushBack(&gfxValue); - } - } - break; - case VMValue::kType_FloatArray: - { - VMArray fArray; - UnpackValue>(&fArray, retValue); - args->movie->CreateArray(args->result); - - float tmp; - for(int i = 0; i < fArray.Length(); i++) { - GFxValue gfxValue; - fArray.Get(&tmp, i); - gfxValue.SetNumber(tmp); - args->result->PushBack(&gfxValue); - } - } - break; - case VMValue::kType_StringArray: - { - VMArray sArray; - UnpackValue>(&sArray, retValue); - args->movie->CreateArray(args->result); - - BSFixedString tmp; - for(int i = 0; i < sArray.Length(); i++) { - GFxValue gfxValue; - sArray.Get(&tmp, i); - args->movie->CreateString(&gfxValue, tmp.data); - args->result->PushBack(&gfxValue); - } - } - break; - } - } - } - } - } - - g_loadGameLock.Leave(); - } -};*/ - -//// item card extensions - -// 40 -class StandardItemData -{ -public: - virtual ~StandardItemData(); - - virtual const char * GetName(void); - virtual UInt32 GetCount(void); - virtual UInt32 GetEquipState(void); - virtual UInt32 GetFilterFlag(void); - virtual UInt32 GetFavorite(void); - virtual bool GetEnabled(void); - -// void ** _vtbl; // 00 - InventoryEntryData * objDesc; // 08 - void * unk10; // 10 - GFxValue fxValue; // 18 - UInt8 unk30[0x10]; // 30 - - MEMBER_FN_PREFIX(StandardItemData); - DEFINE_MEMBER_FN(ctor_data, StandardItemData *, 0x00882BC0, GFxMovieView ** movieView, InventoryEntryData * objDesc, UInt64 unk); - - StandardItemData * ctor_Hook(GFxMovieView ** movieView, InventoryEntryData * objDesc, UInt64 unk); - - static uintptr_t GetCtorHookAddress() - { - static RelocAddr kCtorHookAddress(0x00883B90 + 0x97); - return kCtorHookAddress.GetUIntPtr(); - } -}; -STATIC_ASSERT(offsetof(StandardItemData, fxValue) == 0x18); -STATIC_ASSERT(sizeof(StandardItemData) == 0x40); - -StandardItemData * StandardItemData::ctor_Hook(GFxMovieView ** movieView, InventoryEntryData * objDesc, UInt64 unk) -{ - StandardItemData * result = CALL_MEMBER_FN(this, ctor_data)(movieView, objDesc, unk); - -// _MESSAGE("StandardItemData hook"); - - if(s_bExtendData) - { - scaleformExtend::CommonItemData(&result->fxValue, objDesc->type); - scaleformExtend::StandardItemData(&result->fxValue, objDesc->type, objDesc); - scaleformExtend::InventoryData(&result->fxValue, *movieView, objDesc); - // Calling this to set scrolls, potions, ingredients - // as this function is called for inventory, barter, container - scaleformExtend::MagicItemData(&result->fxValue, *movieView, objDesc->type, true, false); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(*movieView, &result->fxValue, objDesc); - } - } - - return result; -} - -// 48 -class MagicItemData -{ -public: - virtual ~MagicItemData(); - -// void ** _vtbl; // 00 - UInt64 unk08; // 08 - UInt16 unk0C; // 10 - UInt16 unk0E; // 12 - UInt32 pad14; // 14 - TESForm * form; // 18 - GFxValue fxValue; // 20 - UInt8 unk38[0x10]; // 38 - - - MEMBER_FN_PREFIX(MagicItemData); - DEFINE_MEMBER_FN(ctor_data, MagicItemData *, 0x008CF470, GFxMovieView ** movieView, TESForm * pForm, int unk); // unk is ignored by ctor - - static uintptr_t GetCtorHookAddress() - { - static RelocAddr kCtorHookAddress(0x008D0A90 + 0x97); - return kCtorHookAddress.GetUIntPtr(); - } - - MagicItemData * ctor_Hook(GFxMovieView ** movieView, TESForm * pForm, int unk); -}; -STATIC_ASSERT(offsetof(MagicItemData, fxValue) == 0x20); -STATIC_ASSERT(sizeof(MagicItemData) == 0x48); - -MagicItemData * MagicItemData::ctor_Hook(GFxMovieView ** movieView, TESForm * pForm, int unk) -{ - MagicItemData * result = CALL_MEMBER_FN(this, ctor_data)(movieView, pForm, unk); - -// _MESSAGE("MagicItemData hook"); - - if(s_bExtendData) - { - scaleformExtend::CommonItemData(&result->fxValue, pForm); - scaleformExtend::MagicItemData(&result->fxValue, *movieView, pForm, true, false); - } - - return result; -} - -//// fav menu data - -namespace favMenuDataHook -{ - // One hook for items (1) and magic (2), and a special case of magic if the player is a vampire lord (3). - - // Not used, for documenation only - struct FavData - { - GFxMovieView ** movieView; // 00 - void * unk04; // 08 - GFxValue * entryList; // 10 - }; - - // 1 - Item - - RelocAddr kSetItemData_Base(0x008A7F60); - uintptr_t kSetItemData_hook = kSetItemData_Base + 0xC2; - uintptr_t kSetItemData_retn = kSetItemData_Base + 0xC8; - - void SetItemData(IMenu * menu, GFxValue * dataContainer, InventoryEntryData * objDesc) - { - if (s_bExtendData) - { - GFxMovieView * movieView = menu->view; - - scaleformExtend::CommonItemData(dataContainer, objDesc->type); - scaleformExtend::StandardItemData(dataContainer, objDesc->type); - scaleformExtend::InventoryData(dataContainer, movieView, objDesc); - scaleformExtend::MagicItemData(dataContainer, movieView, objDesc->type, true, false); - - // itemId to uniquely identify items - const char* name = CALL_MEMBER_FN(objDesc, GenerateName)(); - SInt32 itemId = (SInt32)HashUtil::CRC32(name, objDesc->type->formID & 0x00FFFFFF); - RegisterNumber(dataContainer, "itemId", itemId); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(movieView, dataContainer, objDesc); - } - } - }; - - // 2 - Magic - - RelocAddr kSetMagicData_Base(0x008A8F70); - uintptr_t kSetMagicData_hook = kSetMagicData_Base + 0x6B; - uintptr_t kSetMagicData_retn = kSetMagicData_Base + 0x71; - - void SetMagicData(GFxMovieView * movieView, GFxValue * dataContainer, TESForm * form) - { - if (s_bExtendData) - { - scaleformExtend::CommonItemData(dataContainer, form); - scaleformExtend::MagicItemData(dataContainer, movieView, form, true, false); - - // itemId to uniquely identify items - TESFullName* pFullName = DYNAMIC_CAST(form, TESForm, TESFullName); - const char * name; - if (pFullName) - name = pFullName->name.data; - else - name = NULL; - SInt32 itemId = (SInt32)HashUtil::CRC32(name, form->formID & 0x00FFFFFF); - RegisterNumber(dataContainer, "itemId", itemId); - } - }; - - // 3 - VampireLord - - RelocAddr kSetVampireData_Base(0x008A9200); - uintptr_t kSetVampireData_hook = kSetVampireData_Base + 0x92; - uintptr_t kSetVampireData_retn = kSetVampireData_Base + 0x98; -} - -//// enchanting menu - -namespace enchantMenuDataHook -{ - RelocAddr kSetData_Base(0x0089C1B0); - uintptr_t kSetData_hook = kSetData_Base + 0x4A1; - uintptr_t kSetData_retn = kSetData_Base + 0x4A6; -} - -// SE: this function has been moved out of the class, so that its address can be obtained -// SE: parameters order swapped (dataContainer and submenu), this is not an error, extra parameter is now r8 -void EnchantConstructMenu::CategoryListEntry::SetData_Extended(EnchantConstructMenu* subMenu, GFxValue* dataContainer) -{ - CALL_MEMBER_FN(this, SetData)(dataContainer); - - if (!s_bExtendData) - return; - - if (!subMenu) - return; - - GFxMovieView* movieView = subMenu->view; - - // Note: Unsafe casts due to missing RTTI data. - // Filterflag should indicate the correct type though. - switch (filterFlag) - { - case kFilterFlag_EnchantWeapon: - case kFilterFlag_DisenchantWeapon: - case kFilterFlag_EnchanteArmor: - case kFilterFlag_DisenchantArmor: - case kFilterFlag_SoulGem: - { - //ItemChangeEntry* entry = DYNAMIC_CAST(this, CategoryListEntry, ItemChangeEntry); - ItemChangeEntry* entry = reinterpret_cast(this); - - if (entry && entry->data && entry->data->type) - { - InventoryEntryData* data = entry->data; - scaleformExtend::CommonItemData(dataContainer, data->type); - scaleformExtend::ItemInfoData(dataContainer, data); - scaleformExtend::StandardItemData(dataContainer, data->type, data); - scaleformExtend::InventoryData(dataContainer, movieView, data); - scaleformExtend::MagicItemData(dataContainer, movieView, data->type, true, false); - - scaleformExtend::CraftDisenchantData(dataContainer, movieView, data); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(movieView, dataContainer, data); - } - } - break; - } - case kFilterFlag_EffectWeapon: - case kFilterFlag_EffectArmor: - { - //EnchantmentEntry* entry = DYNAMIC_CAST(this, CategoryListEntry, EnchantmentEntry); - EnchantmentEntry* entry = reinterpret_cast(this); - - if (entry) - { - EnchantmentItem* data = entry->data; - scaleformExtend::CommonItemData(dataContainer, data); - scaleformExtend::MagicItemData(dataContainer, movieView, data, true, false); - } - break; - } - } -} - -// SE: This function exists because we need to get a pointer function for xbyak and can'd do it with member functions. -// Also notice the parameter order is different, that's because in x64 the extra parameter added by the hook goes in r8 -void EnchantConstructMenu_CategoryListEntry_SetData_Extended(EnchantConstructMenu::CategoryListEntry *pthis, GFxValue* dataContainer, EnchantConstructMenu* subMenu) -{ - pthis->SetData_Extended(subMenu, dataContainer); -} - -// smithing menu - -namespace smithingMenuDataHook -{ - RelocAddr kSetData_Base(0x00892AA0); - uintptr_t kSetData_hook = kSetData_Base + 0xD6; - uintptr_t kSetData_retn = kSetData_Base + 0xDB; - - const char * SetData_Hook(GFxValue * dataContainer, InventoryEntryData ** pObjDesc, SmithingMenu * menu) - { - InventoryEntryData * objDesc = *pObjDesc; - - if(s_bExtendData && objDesc && menu && menu->view) - { - scaleformExtend::CommonItemData(dataContainer, objDesc->type); - scaleformExtend::ItemInfoData(dataContainer, objDesc); - scaleformExtend::StandardItemData(dataContainer, objDesc->type); - scaleformExtend::InventoryData(dataContainer, menu->view, objDesc); - scaleformExtend::MagicItemData(dataContainer, menu->view, objDesc->type, true, false); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(menu->view, dataContainer, objDesc); - } - } - - // original code - return CALL_MEMBER_FN(objDesc, GenerateName)(); - } -} - -// crafting menu - -namespace craftingMenuDataHook -{ - // - RelocAddr kSetData_Base(0x00892FD0); - uintptr_t kSetData_hook = kSetData_Base + 0xC4; - uintptr_t kSetData_retn = kSetData_Base + 0xC9; - - const char * SetData_Hook(GFxValue * dataContainer, ConstructibleObjectMenu::EntryData * entry, ConstructibleObjectMenu * menu) - { - if(s_bExtendData && entry && entry->object && menu && menu->view) - { - BGSConstructibleObject * object = entry->object; - TESForm * form = object->createdObject; - - InventoryEntryData entryData(form, 0); - - scaleformExtend::CommonItemData(dataContainer, form); - scaleformExtend::ItemInfoData(dataContainer, &entryData); - scaleformExtend::StandardItemData(dataContainer, form); - scaleformExtend::InventoryData(dataContainer, menu->view, &entryData); - scaleformExtend::MagicItemData(dataContainer, menu->view, form, true, false); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(menu->view, dataContainer, &entryData); - } - } - - // original code - TESFullName * fullName = DYNAMIC_CAST(entry->object->createdObject, TESForm, TESFullName); - return fullName ? fullName->GetName() : ""; - } -} - -// alchemy menu - -namespace alchemyMenuDataHook -{ - // - RelocAddr kSetData_Base(0x00892CE0); - uintptr_t kSetData_hook = kSetData_Base + 0xC6; - uintptr_t kSetData_retn = kSetData_Base + 0xCB; - - const char * SetData_Hook(GFxValue * dataContainer, AlchemyMenu::EntryData * entry, AlchemyMenu * menu) - { - if(s_bExtendData && entry && entry->data && menu && menu->view) - { - InventoryEntryData * entryData = entry->data; - - scaleformExtend::CommonItemData(dataContainer, entryData->type); - scaleformExtend::ItemInfoData(dataContainer, entryData); - scaleformExtend::MagicItemData(dataContainer, menu->view, entryData->type, true, false); - - for(InventoryPluginList::iterator iter = s_inventoryPlugins.begin(); iter != s_inventoryPlugins.end(); ++iter) - { - if(*iter) - (*iter)(menu->view, dataContainer, entryData); - } - } - - // original code - TESFullName * fullName = DYNAMIC_CAST(entry->data->type, TESForm, TESFullName); - return fullName ? fullName->GetName() : ""; - } - - // Category arguments - // (note: this passes data in arguments to SetCategoriesList. makes it more difficult to extend) - - RelocAddr kExtendCategoryArgs_Base(0x008A0640); - uintptr_t kExtendCategoryArgs_hook = kExtendCategoryArgs_Base + 0x564; - uintptr_t kExtendCategoryArgs_retn = kExtendCategoryArgs_Base + 0x569; - - class GFxInvokeHook - { - public: - // hijack unused 'result' parameter to pass effectArray - bool Invoke(void * obj, AlchemyEffectCategory * effectArray, const char * name, GFxValue * args, UInt32 numArgs, bool isDisplayObj) - { - if (s_bExtendAlchemyCategories) - scaleformExtend::AlchemyCategoryArgs(effectArray, args, numArgs); - - // Call hooked func - GFxValue::ObjectInterface* p = reinterpret_cast(this); - return p->Invoke(obj, nullptr, name, args, numArgs, isDisplayObj); - } - }; -} - -namespace GFxLoaderHook -{ - RelocPtr kCtor_Base(0x005D4EF0 + 0xE91); // WinMain+15 - - GFxLoader *ctor_Hook(GFxLoader * loader) - { - GFxLoader* result = CALL_MEMBER_FN(loader, ctor)(); - - // _MESSAGE("result == singleton %d", (UInt32)(result == GetSingleton())); - - // Read plugin list, load translation files - Translation::ImportTranslationFiles(loader->stateBag->GetTranslator()); - - if (g_logScaleform) { - SKSEGFxLogger * logger = new SKSEGFxLogger(); - loader->stateBag->SetState(GFxState::kInterface_Log, (void*)logger); - } - - return result; - } -} - -//// core hook -void InstallHooks(GFxMovieView * view) -{ - // called from a task, must be threadsafe - -// _MESSAGE("got new scaleform menu (view = %p)", view); - - GFxValue globals; - - bool result = view->GetVariable(&globals, "_global"); - if(!result) - { - _ERROR("couldn't get _global"); - return; - } - - GFxValue skse; - view->CreateObject(&skse); - - // root functions - RegisterFunction (&skse, view, "AllowTextInput"); - RegisterFunction (&skse, view, "GetMappedKey"); - RegisterFunction (&skse, view, "StartRemapMode"); - RegisterFunction (&skse, view, "GetLastControl"); - RegisterFunction (&skse, view, "GetLastKeycode"); - RegisterFunction (&skse, view, "Log"); - RegisterFunction (&skse, view, "SetINISetting"); - RegisterFunction (&skse, view, "GetINISetting"); - RegisterFunction (&skse, view, "OpenMenu"); - RegisterFunction (&skse, view, "CloseMenu"); - RegisterFunction (&skse, view, "ExtendData"); - RegisterFunction (&skse, view, "ExtendAlchemyCategories"); - RegisterFunction (&skse, view, "ForceContainerCategorization"); - RegisterFunction (&skse, view, "SendModEvent"); - RegisterFunction (&skse, view, "RequestActivePlayerEffects"); - RegisterFunction (&skse, view, "ExtendForm"); - RegisterFunction (&skse, view, "RequestActorValues"); - RegisterFunction (&skse, view, "GetClipboardData"); - RegisterFunction (&skse, view, "SetClipboardData"); - RegisterFunction (&skse, view, "GetPlayerSex"); - //RegisterFunction (&skse, view, "GetVMVariable"); - RegisterFunction (&skse, view, "EnableMapMenuMouseWheel"); - RegisterFunction (&skse, view, "ShowOnMap"); - RegisterFunction (&skse, view, "StoreIndices"); - RegisterFunction (&skse, view, "LoadIndices"); - RegisterFunction (&skse, view, "GetModList"); - RegisterFunction (&skse, view, "OpenJournalMenu"); - - // version - GFxValue version; - view->CreateObject(&version); - - RegisterNumber(&version, "major", SKSE_VERSION_INTEGER); - RegisterNumber(&version, "minor", SKSE_VERSION_INTEGER_MINOR); - RegisterNumber(&version, "beta", SKSE_VERSION_INTEGER_BETA); - RegisterNumber(&version, "releaseIdx", SKSE_VERSION_RELEASEIDX); - - skse.SetMember("version", &version); - - // plugins - GFxValue plugins; - view->CreateObject(&plugins); - - for(PluginList::iterator iter = s_plugins.begin(); iter != s_plugins.end(); ++iter) - { - GFxValue plugin; - view->CreateObject(&plugin); - - iter->callback(view, &plugin); - - plugins.SetMember(iter->name, &plugin); - } - - skse.SetMember("plugins", &plugins); - - globals.SetMember("skse", &skse); -} - -RelocAddr kInstallHooks_Enter(0x00F11C60 + 0x1DD); - -void InstallHooks_Entry(GFxMovieView *pthis, UInt32 unk) -{ - InstallHooks(pthis); - // Original call - pthis->Unk_1B(unk); -} - - -void * GFxAllocateHeap_Hook(HeapDesc * heap, ScaleformAllocator * allocator) -{ - heap->flags |= HeapDesc::kHeap_FastTinyBlocks | HeapDesc::kHeap_Root; - heap->threshold = ~0; - return GFxAllocateHeap(heap, allocator); -} - -void Hooks_Scaleform_Commit(void) -{ - UInt32 logScaleform = 0; - if(GetConfigOption_UInt32("Interface", "bEnableGFXLog", &logScaleform)) - { - if(logScaleform) - { - g_logScaleform = true; - } - } - - // movie creation hook - // This patch is more convenient in SKSE64, since we can just rewrite the 6 bytes indirect call - g_branchTrampoline.Write6Call(kInstallHooks_Enter, GetFnAddr(&InstallHooks_Entry)); - - //// item card data creation hook - g_branchTrampoline.Write5Call(StandardItemData::GetCtorHookAddress(), GetFnAddr(&StandardItemData::ctor_Hook)); - g_branchTrampoline.Write5Call(MagicItemData::GetCtorHookAddress(), GetFnAddr(&MagicItemData::ctor_Hook)); - - //// fav menu data hooks - { - struct SetItemDataEntry_Code : Xbyak::CodeGenerator { - SetItemDataEntry_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // r14 is objDesc - // r13 is IMenu (this) - // [rsp + 0x48] -> dataContainer - - // The hooked call (overwritten code) movieView->CreateObject(containerObj,0,0,0) - call(ptr[rax + 0x68]); - - // insert call to our data extend function - mov(rcx, r13); - lea(rdx, ptr[rsp + 0x48]); - mov(r8, r14); - mov(rax, (uintptr_t)favMenuDataHook::SetItemData); - call(rax); - - // The other overwritten instruction and return to original code - mov(rcx, r14); - jmp(ptr[rip]); - dq(favMenuDataHook::kSetItemData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - SetItemDataEntry_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(favMenuDataHook::kSetItemData_hook, uintptr_t(code.getCode())); - SafeWrite8(favMenuDataHook::kSetItemData_hook + 5, 0x90); - } - - { - struct SetMagicData_Entry_Code : Xbyak::CodeGenerator { - SetMagicData_Entry_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // The hooked call (overwritten code) movieView->CreateObject(containerObj,0,0,0) - call(ptr[rax + 0x68]); - - // insert call to our data extend function - mov(rcx, ptr[rdi]); - mov(rcx, ptr[rcx]); // GFxMovieView * view - lea(rdx, ptr[rbp - 0x30]); // GFxValue * dataContainer - mov(r8, rbx); // TESForm * form - mov(rax, (uintptr_t)favMenuDataHook::SetMagicData); - call(rax); - - // The other overwritten instruction and return to original code - mov(rcx, rbx); - jmp(ptr[rip]); - dq(favMenuDataHook::kSetMagicData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - SetMagicData_Entry_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(favMenuDataHook::kSetMagicData_hook, uintptr_t(code.getCode())); - SafeWrite8(favMenuDataHook::kSetMagicData_hook + 5, 0x90); - } - - { - struct SetVampireData_Entry_Code : Xbyak::CodeGenerator { - SetVampireData_Entry_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // rdi: FavData* (this) - // rbp-0x30: data container - // rbx: TESForm* - // The hooked call (overwritten code) movieView->CreateObject(containerObj,0,0,0) - call(ptr[rax + 0x68]); - - // insert call to our data extend function - mov(rcx, ptr[rdi]); - mov(rcx, ptr[rcx]); - lea(rdx, ptr[rbp - 0x30]); - mov(r8, rbx); - mov(rax, (uintptr_t)favMenuDataHook::SetMagicData); - call(rax); - - // The other overwritten instruction and return to original code - mov(rcx, rbx); - jmp(ptr[rip]); - dq(favMenuDataHook::kSetVampireData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - SetVampireData_Entry_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(favMenuDataHook::kSetVampireData_hook, uintptr_t(code.getCode())); - SafeWrite8(favMenuDataHook::kSetVampireData_hook + 5, 0x90); - } - // end of fav menu data hooks - - // crafting menu data hooks - { - struct SetDataEntry_Code : Xbyak::CodeGenerator { - SetDataEntry_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - // Extra parameter as r8 - mov(r8, rsi); - mov(rax, (uintptr_t)EnchantConstructMenu_CategoryListEntry_SetData_Extended); - call(rax); - - // Return to original code - jmp(ptr[rip]); - dq(enchantMenuDataHook::kSetData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - SetDataEntry_Code code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(enchantMenuDataHook::kSetData_hook, uintptr_t(code.getCode())); - } - - { - struct SmithingMenuHook : Xbyak::CodeGenerator { - SmithingMenuHook(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - lea(rcx, ptr[rbp - 0x48]); // GFxValue * - mov(rdx, rbx); // InventoryEntryData ** - mov(r8, r14); // SmithingMenu * - mov(rax, (uintptr_t)smithingMenuDataHook::SetData_Hook); - call(rax); - - jmp(ptr[rip]); - dq(smithingMenuDataHook::kSetData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - SmithingMenuHook code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(smithingMenuDataHook::kSetData_hook, uintptr_t(code.getCode())); - } - - { - struct CraftingMenuHook : Xbyak::CodeGenerator { - CraftingMenuHook(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - lea(rcx, ptr[rbp - 0x38]); // GFxValue * - mov(rdx, rbx); // ConstructibleObjectMenu::EntryData * - mov(r8, r14); // ConstructibleObjectMenu * - mov(rax, (uintptr_t)craftingMenuDataHook::SetData_Hook); - call(rax); - - jmp(ptr[rip]); - dq(craftingMenuDataHook::kSetData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - CraftingMenuHook code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(craftingMenuDataHook::kSetData_hook, uintptr_t(code.getCode())); - } - - { - struct AlchemyMenuHook : Xbyak::CodeGenerator { - AlchemyMenuHook(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - lea(rcx, ptr[rbp - 0x38]); // GFxValue * - mov(rdx, rbx); // AlchemyMenu::EntryData * - mov(r8, r14); // AlchemyMenu * - mov(rax, (uintptr_t)alchemyMenuDataHook::SetData_Hook); - call(rax); - - jmp(ptr[rip]); - dq(alchemyMenuDataHook::kSetData_retn); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - AlchemyMenuHook code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Branch(alchemyMenuDataHook::kSetData_hook, uintptr_t(code.getCode())); - } - - { - struct AlchemyCategoryHook : Xbyak::CodeGenerator { - AlchemyCategoryHook(void * buf) : Xbyak::CodeGenerator(4096, buf) - { - mov(r8, ptr[rbp - 0x69]); // overwrite zero in 'result' param - mov(rax, (uintptr_t)GetFnAddr(&alchemyMenuDataHook::GFxInvokeHook::Invoke)); - jmp(rax); - } - }; - - void * codeBuf = g_localTrampoline.StartAlloc(); - AlchemyCategoryHook code(codeBuf); - g_localTrampoline.EndAlloc(code.getCurr()); - - g_branchTrampoline.Write5Call(alchemyMenuDataHook::kExtendCategoryArgs_hook, uintptr_t(code.getCode())); - } - // End of crafting menu data hooks - - // gfxloader creation hook - g_branchTrampoline.Write5Call(GFxLoaderHook::kCtor_Base.GetUIntPtr(), GetFnAddr(&GFxLoaderHook::ctor_Hook)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Scaleform.h b/source/fs.dll/skse64/skse64/Hooks_Scaleform.h deleted file mode 100644 index b554ad6a..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Scaleform.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "skse64/PluginAPI.h" - -void SetLastControlDown(const char * control, UInt32 keycode); -void SetLastControlUp(const char * control, UInt32 keycode); - -void Hooks_Scaleform_Commit(void); - -bool RegisterScaleformPlugin(const char * name, SKSEScaleformInterface::RegisterCallback callback); -void RegisterScaleformInventory(SKSEScaleformInterface::RegisterInventoryCallback callback); diff --git a/source/fs.dll/skse64/skse64/Hooks_Threads.cpp b/source/fs.dll/skse64/skse64/Hooks_Threads.cpp deleted file mode 100644 index fee70fc3..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Threads.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "Hooks_Threads.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/BranchTrampoline.h" -#include "GameThreads.h" - -#include "common/ICriticalSection.h" -#include - -ICriticalSection s_taskQueueLock; -std::queue s_tasks; - -static bool IsTaskQueueEmpty() -{ - IScopedCriticalSection scoped(&s_taskQueueLock); - return s_tasks.empty(); -} - -void BSTaskPool::ProcessTasks() -{ - CALL_MEMBER_FN(this, ProcessTaskQueue_HookTarget)(); - - while (!IsTaskQueueEmpty()) - { - s_taskQueueLock.Enter(); - TaskDelegate * cmd = s_tasks.front(); - s_tasks.pop(); - s_taskQueueLock.Leave(); - - cmd->Run(); - cmd->Dispose(); - } -} - -void TaskInterface::AddTask(TaskDelegate * cmd) -{ - s_taskQueueLock.Enter(); - s_tasks.push(cmd); - s_taskQueueLock.Leave(); -} - -void Hooks_Threads_Init(void) -{ - -} - -// 691ACD40B8430FBDA081477DEB2A9948ACC235F1+11F -RelocAddr ProcessTasks_HookTarget_Enter(0x005DACE0 + 0xB97); -RelocAddr ProcessTasks_HookTarget_Enter2(0x005DC810 + 0x1C); - -void Hooks_Threads_Commit(void) -{ - g_branchTrampoline.Write5Call(ProcessTasks_HookTarget_Enter, GetFnAddr(&BSTaskPool::ProcessTasks)); - g_branchTrampoline.Write5Call(ProcessTasks_HookTarget_Enter2, GetFnAddr(&BSTaskPool::ProcessTasks)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_Threads.h b/source/fs.dll/skse64/skse64/Hooks_Threads.h deleted file mode 100644 index 8629df10..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_Threads.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -class TaskDelegate; -class UIDelegate_v1; - -void Hooks_Threads_Init(void); -void Hooks_Threads_Commit(void); - -namespace TaskInterface -{ - void AddTask(TaskDelegate * task); - void AddUITask(UIDelegate_v1 * task); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_UI.cpp b/source/fs.dll/skse64/skse64/Hooks_UI.cpp deleted file mode 100644 index 9847ec1a..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_UI.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "Hooks_UI.h" -#include "Hooks_Threads.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/BranchTrampoline.h" -#include "GameMenus.h" -#include "common/ICriticalSection.h" -#include - -#include "PapyrusUI.h" - -namespace -{ - struct QueueEntry - { - // Allow implicit construction - QueueEntry(UIDelegate* cmd) : bIsV1(false) { data.cmd = cmd; } - QueueEntry(UIDelegate_v1* cmd) : bIsV1(true) { data.cmd_v1 = cmd; } - - bool bIsV1; - - union { - UIDelegate* cmd; - UIDelegate_v1* cmd_v1; - } data; - }; -} - -ICriticalSection g_uiQueueLock; -std::queue g_uiQueue; - -void UIManager::QueueCommand(UIDelegate* cmd) -{ - g_uiQueueLock.Enter(); - g_uiQueue.push(cmd); - g_uiQueueLock.Leave(); -} - -void UIManager::QueueCommand(UIDelegate_v1* cmd) -{ - g_uiQueueLock.Enter(); - g_uiQueue.push(cmd); - g_uiQueueLock.Leave(); -} - -void UIManager::ProcessCommands(void) -{ - CALL_MEMBER_FN(this, ProcessEventQueue_HookTarget)(); - - g_uiQueueLock.Enter(); - while (!g_uiQueue.empty()) - { - QueueEntry e = g_uiQueue.front(); - g_uiQueue.pop(); - - // Old interface - if (e.bIsV1) - { - UIDelegate_v1* cmd = e.data.cmd_v1; - cmd->Run(); - cmd->Dispose(); - } - // New interface - else - { - UIDelegate* cmd = e.data.cmd; - cmd->Run(); - delete cmd; - } - } - g_uiQueueLock.Leave(); -} - -void TaskInterface::AddUITask(UIDelegate_v1* task) -{ - UIManager * uiManager = UIManager::GetSingleton(); - if(uiManager) { - uiManager->QueueCommand(task); - } -} - -RelocAddr ProcessEventQueue_HookTarget_Enter(0x00F05AF0 + 0xAB5); - -void Hooks_UI_Commit(void) -{ - g_branchTrampoline.Write5Call(ProcessEventQueue_HookTarget_Enter, GetFnAddr(&UIManager::ProcessCommands)); -} diff --git a/source/fs.dll/skse64/skse64/Hooks_UI.h b/source/fs.dll/skse64/skse64/Hooks_UI.h deleted file mode 100644 index 1516f58a..00000000 --- a/source/fs.dll/skse64/skse64/Hooks_UI.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// Old interface for compatibility with plugins -class UIDelegate_v1 -{ -public: - virtual void Run(void) = 0; - virtual void Dispose(void) = 0; -}; - -void Hooks_UI_Commit(void); diff --git a/source/fs.dll/skse64/skse64/InputMap.cpp b/source/fs.dll/skse64/skse64/InputMap.cpp deleted file mode 100644 index 9a85e1ca..00000000 --- a/source/fs.dll/skse64/skse64/InputMap.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "InputMap.h" -#include - -UInt32 InputMap::GamepadMaskToKeycode(UInt32 keyMask) -{ - switch (keyMask) - { - case XINPUT_GAMEPAD_DPAD_UP: return kGamepadButtonOffset_DPAD_UP; - case XINPUT_GAMEPAD_DPAD_DOWN: return kGamepadButtonOffset_DPAD_DOWN; - case XINPUT_GAMEPAD_DPAD_LEFT: return kGamepadButtonOffset_DPAD_LEFT; - case XINPUT_GAMEPAD_DPAD_RIGHT: return kGamepadButtonOffset_DPAD_RIGHT; - case XINPUT_GAMEPAD_START: return kGamepadButtonOffset_START; - case XINPUT_GAMEPAD_BACK: return kGamepadButtonOffset_BACK; - case XINPUT_GAMEPAD_LEFT_THUMB: return kGamepadButtonOffset_LEFT_THUMB; - case XINPUT_GAMEPAD_RIGHT_THUMB: return kGamepadButtonOffset_RIGHT_THUMB; - case XINPUT_GAMEPAD_LEFT_SHOULDER: return kGamepadButtonOffset_LEFT_SHOULDER; - case XINPUT_GAMEPAD_RIGHT_SHOULDER: return kGamepadButtonOffset_RIGHT_SHOULDER; - case XINPUT_GAMEPAD_A: return kGamepadButtonOffset_A; - case XINPUT_GAMEPAD_B: return kGamepadButtonOffset_B; - case XINPUT_GAMEPAD_X: return kGamepadButtonOffset_X; - case XINPUT_GAMEPAD_Y: return kGamepadButtonOffset_Y; - case 0x9: return kGamepadButtonOffset_LT; - case 0xA: return kGamepadButtonOffset_RT; - default: return kMaxMacros; // Invalid - } -} - -UInt32 InputMap::GamepadKeycodeToMask(UInt32 keyCode) -{ - switch (keyCode) - { - case kGamepadButtonOffset_DPAD_UP: return XINPUT_GAMEPAD_DPAD_UP; - case kGamepadButtonOffset_DPAD_DOWN: return XINPUT_GAMEPAD_DPAD_DOWN; - case kGamepadButtonOffset_DPAD_LEFT: return XINPUT_GAMEPAD_DPAD_LEFT; - case kGamepadButtonOffset_DPAD_RIGHT: return XINPUT_GAMEPAD_DPAD_RIGHT; - case kGamepadButtonOffset_START: return XINPUT_GAMEPAD_START; - case kGamepadButtonOffset_BACK: return XINPUT_GAMEPAD_BACK; - case kGamepadButtonOffset_LEFT_THUMB: return XINPUT_GAMEPAD_LEFT_THUMB; - case kGamepadButtonOffset_RIGHT_THUMB: return XINPUT_GAMEPAD_RIGHT_THUMB; - case kGamepadButtonOffset_LEFT_SHOULDER: return XINPUT_GAMEPAD_LEFT_SHOULDER; - case kGamepadButtonOffset_RIGHT_SHOULDER: return XINPUT_GAMEPAD_RIGHT_SHOULDER; - case kGamepadButtonOffset_A: return XINPUT_GAMEPAD_A; - case kGamepadButtonOffset_B: return XINPUT_GAMEPAD_B; - case kGamepadButtonOffset_X: return XINPUT_GAMEPAD_X; - case kGamepadButtonOffset_Y: return XINPUT_GAMEPAD_Y; - case kGamepadButtonOffset_LT: return 0x9; - case kGamepadButtonOffset_RT: return 0xA; - default: return 0xFF; // Invalid - } -} diff --git a/source/fs.dll/skse64/skse64/InputMap.h b/source/fs.dll/skse64/skse64/InputMap.h deleted file mode 100644 index ac8e20f1..00000000 --- a/source/fs.dll/skse64/skse64/InputMap.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -namespace InputMap -{ - -enum -{ - // first 256 for keyboard, then 8 mouse buttons, then mouse wheel up, wheel down, then 16 gamepad buttons - kMacro_KeyboardOffset = 0, // not actually used, just for self-documentation - kMacro_NumKeyboardKeys = 256, - - kMacro_MouseButtonOffset = kMacro_NumKeyboardKeys, // 256 - kMacro_NumMouseButtons = 8, - - kMacro_MouseWheelOffset = kMacro_MouseButtonOffset + kMacro_NumMouseButtons, // 264 - kMacro_MouseWheelDirections = 2, - - kMacro_GamepadOffset = kMacro_MouseWheelOffset + kMacro_MouseWheelDirections, // 266 - kMacro_NumGamepadButtons = 16, - - kMaxMacros = kMacro_GamepadOffset + kMacro_NumGamepadButtons // 282 -}; - -enum -{ - kGamepadButtonOffset_DPAD_UP = kMacro_GamepadOffset, // 266 - kGamepadButtonOffset_DPAD_DOWN, - kGamepadButtonOffset_DPAD_LEFT, - kGamepadButtonOffset_DPAD_RIGHT, - kGamepadButtonOffset_START, - kGamepadButtonOffset_BACK, - kGamepadButtonOffset_LEFT_THUMB, - kGamepadButtonOffset_RIGHT_THUMB, - kGamepadButtonOffset_LEFT_SHOULDER, - kGamepadButtonOffset_RIGHT_SHOULDER, - kGamepadButtonOffset_A, - kGamepadButtonOffset_B, - kGamepadButtonOffset_X, - kGamepadButtonOffset_Y, - kGamepadButtonOffset_LT, - kGamepadButtonOffset_RT // 281 -}; - -UInt32 GamepadMaskToKeycode(UInt32 keyMask); -UInt32 GamepadKeycodeToMask(UInt32 keyCode); - -} diff --git a/source/fs.dll/skse64/skse64/InternalSerialization.cpp b/source/fs.dll/skse64/skse64/InternalSerialization.cpp deleted file mode 100644 index db96210e..00000000 --- a/source/fs.dll/skse64/skse64/InternalSerialization.cpp +++ /dev/null @@ -1,356 +0,0 @@ -#include -#include -#include -#include -#include - -#include "common/IFileStream.h" -#include "skse64/PluginAPI.h" -#include "skse64/InternalSerialization.h" -#include "skse64/GameData.h" -#include "skse64/Serialization.h" -#include "PapyrusEvents.h" -#include "PapyrusDelayFunctors.h" -#include "PapyrusObjects.h" - -// Internal - -static std::unordered_map s_savedModIndexMap; - -void LoadModList(SKSESerializationInterface * intfc) -{ - _MESSAGE("Loading mod list:"); - - DataHandler * dhand = DataHandler::GetSingleton(); - - char name[0x104] = { 0 }; - UInt16 nameLen = 0; - - UInt8 numSavedMods = 0; - intfc->ReadRecordData(&numSavedMods, sizeof(numSavedMods)); - for (UInt32 i = 0; i < numSavedMods; i++) - { - intfc->ReadRecordData(&nameLen, sizeof(nameLen)); - intfc->ReadRecordData(&name, nameLen); - name[nameLen] = 0; - - const ModInfo * modInfo = dhand->LookupModByName(name); - if (modInfo) { - UInt32 newIndex = modInfo->GetPartialIndex(); - s_savedModIndexMap[i] = newIndex; - _MESSAGE("\t(%d -> %d)\t%s", i, newIndex, &name); - } - else { - s_savedModIndexMap[i] = 0xFF; - } - } -} - -void SavePluginsList(SKSESerializationInterface * intfc) -{ - DataHandler * dhand = DataHandler::GetSingleton(); - - struct IsActiveFunctor - { - bool Accept(ModInfo * modInfo) - { - return modInfo && modInfo->IsActive(); - } - }; - struct LoadedModVisitor - { - LoadedModVisitor(std::function func) : modInfoVisitor(func) { } - bool Accept(ModInfo * modInfo) - { - return modInfoVisitor(modInfo); - } - std::function modInfoVisitor; - }; - - UInt16 modCount = dhand->modList.modInfoList.CountIf(IsActiveFunctor()); - - intfc->OpenRecord('PLGN', 0); - intfc->WriteRecordData(&modCount, sizeof(modCount)); - - _MESSAGE("Saving plugin list:"); - - - dhand->modList.modInfoList.Visit(LoadedModVisitor([&](ModInfo* modInfo) - { - if (modInfo && modInfo->IsActive()) - { - intfc->WriteRecordData(&modInfo->modIndex, sizeof(modInfo->modIndex)); - if (modInfo->modIndex == 0xFE) { - intfc->WriteRecordData(&modInfo->lightIndex, sizeof(modInfo->lightIndex)); - } - - UInt16 nameLen = strlen(modInfo->name); - intfc->WriteRecordData(&nameLen, sizeof(nameLen)); - intfc->WriteRecordData(modInfo->name, nameLen); - if (modInfo->modIndex != 0xFE) - { - _MESSAGE("\t[%d]\t%s", modInfo->modIndex, &modInfo->name); - } - else - { - _MESSAGE("\t[FE:%d]\t%s", modInfo->lightIndex, &modInfo->name); - } - } - return true; // Continue - })); -} - -void LoadPluginList(SKSESerializationInterface * intfc) -{ - DataHandler * dhand = DataHandler::GetSingleton(); - - _MESSAGE("Loading plugin list:"); - - char name[0x104] = { 0 }; - UInt16 nameLen = 0; - - UInt16 modCount = 0; - intfc->ReadRecordData(&modCount, sizeof(modCount)); - for (UInt32 i = 0; i < modCount; i++) - { - UInt8 modIndex = 0xFF; - UInt16 lightModIndex = 0xFFFF; - intfc->ReadRecordData(&modIndex, sizeof(modIndex)); - if (modIndex == 0xFE) { - intfc->ReadRecordData(&lightModIndex, sizeof(lightModIndex)); - } - - intfc->ReadRecordData(&nameLen, sizeof(nameLen)); - intfc->ReadRecordData(&name, nameLen); - name[nameLen] = 0; - - UInt32 newIndex = 0xFF; - UInt32 oldIndex = modIndex == 0xFE ? (0xFE000 | lightModIndex) : modIndex; - - const ModInfo * modInfo = dhand->LookupModByName(name); - if (modInfo) { - newIndex = modInfo->GetPartialIndex(); - } - - s_savedModIndexMap[oldIndex] = newIndex; - - _MESSAGE("\t(%d -> %d)\t%s", oldIndex, newIndex, name); - } -} - -UInt32 ResolveModIndex(UInt32 modIndex) -{ - auto it = s_savedModIndexMap.find(modIndex); - if (it != s_savedModIndexMap.end()) - { - return it->second; - } - - return 0xFF; -} - -enum LightModVersion -{ - kVersion1 = 1, - kVersion2 = 2 -}; - -void LoadLightModList(SKSESerializationInterface * intfc, UInt32 version) -{ - _MESSAGE("Loading light mod list:"); - - DataHandler * dhand = DataHandler::GetSingleton(); - - char name[0x104] = { 0 }; - UInt16 nameLen = 0; - - UInt16 numSavedMods = 0; - if (version == kVersion1) - { - intfc->ReadRecordData(&numSavedMods, sizeof(UInt8)); - } - else if (version == kVersion2) - { - intfc->ReadRecordData(&numSavedMods, sizeof(UInt16)); - } - - for (UInt32 i = 0; i < numSavedMods; i++) - { - intfc->ReadRecordData(&nameLen, sizeof(nameLen)); - intfc->ReadRecordData(&name, nameLen); - name[nameLen] = 0; - - UInt32 lightIndex = 0xFE000 | i; - - const ModInfo * modInfo = dhand->LookupModByName(name); - if (modInfo) { - - UInt32 newIndex = modInfo->GetPartialIndex(); - s_savedModIndexMap[lightIndex] = newIndex; - _MESSAGE("\t(%d -> %d)\t%s", lightIndex, newIndex, &name); - } - else { - s_savedModIndexMap[lightIndex] = 0xFF; - } - _MESSAGE("\t(%d -> %d)\t%s", lightIndex, s_savedModIndexMap[lightIndex], &name); - } -} - -//// Callbacks - -void Core_RevertCallback(SKSESerializationInterface * intfc) -{ - s_savedModIndexMap.clear(); - g_menuOpenCloseRegs.Clear(); - g_inputKeyEventRegs.Clear(); - g_inputControlEventRegs.Clear(); - g_modCallbackRegs.Clear(); - g_crosshairRefEventRegs.Clear(); - g_cameraEventRegs.Clear(); - g_actionEventRegs.Clear(); - g_ninodeUpdateEventRegs.Clear(); - - SKSEDelayFunctorManagerInstance().OnRevert(); - - SKSEObjectStorageInstance().ClearAndRelease(); -} - -void Core_SaveCallback(SKSESerializationInterface * intfc) -{ - using Serialization::SaveClassHelper; - - SavePluginsList(intfc); - - _MESSAGE("Saving menu open/close event registrations..."); - g_menuOpenCloseRegs.Save(intfc, 'MENR', 1); - - _MESSAGE("Saving key input event registrations..."); - g_inputKeyEventRegs.Save(intfc, 'KEYR', 1); - - _MESSAGE("Saving control input event registrations..."); - g_inputControlEventRegs.Save(intfc, 'CTLR', 1); - - _MESSAGE("Saving mod callback event registrations..."); - g_modCallbackRegs.Save(intfc, 'MCBR', 1); - - _MESSAGE("Saving crosshair ref event registrations..."); - g_crosshairRefEventRegs.Save(intfc, 'CHRR', 1); - - _MESSAGE("Saving camera event registrations..."); - g_cameraEventRegs.Save(intfc, 'CAMR', 1); - - _MESSAGE("Saving actor action event registrations..."); - g_actionEventRegs.Save(intfc, 'AACT', 1); - - _MESSAGE("Saving NiNode update event registrations..."); - g_ninodeUpdateEventRegs.Save(intfc, 'NINU', 1); - - _MESSAGE("Saving SKSEPersistentObjectStorage data..."); - SaveClassHelper(intfc, 'OBMG', SKSEObjectStorageInstance()); - - _MESSAGE("Saving SKSEDelayFunctorManager data..."); - SaveClassHelper(intfc, 'DFMG', SKSEDelayFunctorManagerInstance()); -} - -void Core_LoadCallback(SKSESerializationInterface * intfc) -{ - UInt32 type, version, length; - - while (intfc->GetNextRecordInfo(&type, &version, &length)) - { - switch (type) - { - // Plugins list - case 'PLGN': - LoadPluginList(intfc); - break; - - // Mod list - Deprecated - case 'MODS': - LoadModList(intfc); - break; - - // Legacy Light Mod list - This only supported 255 entries - case 'LMOD': - LoadLightModList(intfc, kVersion1); - break; - - // Light Mod list - Deprecated - case 'LIMD': - LoadLightModList(intfc, kVersion2); - break; - - // Menu open/close events - case 'MENR': - _MESSAGE("Loading menu open/close event registrations..."); - g_menuOpenCloseRegs.Load(intfc, 1); - break; - - // Key input events - case 'KEYR': - _MESSAGE("Loading key input event registrations..."); - g_inputKeyEventRegs.Load(intfc, 1); - break; - - // Control input events - case 'CTLR': - _MESSAGE("Loading control input event registrations..."); - g_inputControlEventRegs.Load(intfc, 1); - break; - - // Custom mod events - case 'MCBR': - _MESSAGE("Loading mod callback event registrations..."); - g_modCallbackRegs.Load(intfc, 1); - break; - - // Crosshair rev events - case 'CHRR': - _MESSAGE("Loading crosshair ref event registrations..."); - g_crosshairRefEventRegs.Load(intfc, 1); - break; - - // Camera events - case 'CAMR': - _MESSAGE("Loading camera event registrations..."); - g_cameraEventRegs.Load(intfc, 1); - break; - - // Actor Actions events - case 'AACT': - _MESSAGE("Loading actor action event registrations..."); - g_actionEventRegs.Load(intfc, 1); - break; - - // NiNode update events - case 'NINU': - _MESSAGE("Loading NiNode update event registrations..."); - g_ninodeUpdateEventRegs.Load(intfc, 1); - break; - - // SKSEPersistentObjectStorage - case 'OBMG': - _MESSAGE("Loading SKSEPersistentObjectStorage data..."); - SKSEObjectStorageInstance().Load(intfc, version); - break; - - // SKSEDelayFunctorManager - case 'DFMG': - _MESSAGE("Loading SKSEDelayFunctorManager data..."); - SKSEDelayFunctorManagerInstance().Load(intfc, version); - break; - - default: - _MESSAGE("Unhandled chunk type in Core_LoadCallback: %08X (%.4s)", type, &type); - continue; - } - } -} - -void Init_CoreSerialization_Callbacks() -{ - Serialization::SetUniqueID(0, 0); - Serialization::SetRevertCallback(0, Core_RevertCallback); - Serialization::SetSaveCallback(0, Core_SaveCallback); - Serialization::SetLoadCallback(0, Core_LoadCallback); -} diff --git a/source/fs.dll/skse64/skse64/InternalSerialization.h b/source/fs.dll/skse64/skse64/InternalSerialization.h deleted file mode 100644 index e6f4c575..00000000 --- a/source/fs.dll/skse64/skse64/InternalSerialization.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -UInt32 ResolveModIndex(UInt32 modIndex); -void Init_CoreSerialization_Callbacks(); diff --git a/source/fs.dll/skse64/skse64/InternalTasks.cpp b/source/fs.dll/skse64/skse64/InternalTasks.cpp deleted file mode 100644 index 14fc6f3e..00000000 --- a/source/fs.dll/skse64/skse64/InternalTasks.cpp +++ /dev/null @@ -1,312 +0,0 @@ -#include "skse64/InternalTasks.h" -#include "common/IMemPool.h" - -#include "common/ICriticalSection.h" -#include - -#include "skse64/GameAPI.h" -#include "skse64/GameReferences.h" -#include "skse64/GameData.h" -#include "skse64/GameForms.h" -#include "skse64/GameRTTI.h" - -#include "skse64/NiNodes.h" -#include "skse64/NiExtraData.h" - -#include "Hooks_Threads.h" - -IThreadSafeBasicMemPool s_updateTintMasksDelegatePool; -IThreadSafeBasicMemPool s_updateHairColorDelegatePool; -IThreadSafeBasicMemPool s_updateWeightDelegatePool; -IThreadSafeBasicMemPool s_regenHeadDelegatePool; -IThreadSafeBasicMemPool s_changeHeadPartDelegatePool; -IThreadSafeBasicMemPool s_updateWorldDataDelegatePool; -IThreadSafeBasicMemPool s_updateExpressionDelegatePool; -IThreadSafeBasicMemPool s_updateHarvestModelDelegatePool; - -void TaskInterface::UpdateTintMasks() -{ - SKSETaskUpdateTintMasks * cmd = s_updateTintMasksDelegatePool.Allocate(); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::UpdateHairColor() -{ - SKSETaskUpdateHairColor * cmd = s_updateHairColorDelegatePool.Allocate(); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::RegenerateHead(Actor * actor) -{ - SKSETaskRegenHead * cmd = SKSETaskRegenHead::Create(actor); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::ChangeHeadPart(Actor * actor, BGSHeadPart * oldPart, BGSHeadPart * newPart) -{ - SKSETaskChangeHeadPart * cmd = SKSETaskChangeHeadPart::Create(actor, oldPart, newPart); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::UpdateWeight(Actor * actor, float delta, UInt32 updateFlags, bool redrawWeapon) -{ - SKSETaskUpdateWeight * cmd = SKSETaskUpdateWeight::Create(actor, delta, updateFlags, redrawWeapon); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::UpdateWorldData(NiAVObject * object) -{ - SKSETaskUpdateWorldData * cmd = SKSETaskUpdateWorldData::Create(object); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::UpdateExpression(Actor * actor, UInt8 type, UInt16 index, float value) -{ - SKSETaskUpdateExpression * cmd = SKSETaskUpdateExpression::Create(actor, type, index, value); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - -void TaskInterface::UpdateHarvestModel(TESObjectREFR * refr) -{ - SKSETaskUpdateHarvestModel * cmd = SKSETaskUpdateHarvestModel::Create(refr); - if (cmd) { - TaskInterface::AddTask(cmd); - } -} - - -void SKSETaskUpdateTintMasks::Dispose(void) -{ - s_updateTintMasksDelegatePool.Free(this); -} - -void SKSETaskUpdateTintMasks::Run() -{ - (*g_thePlayer)->UpdateSkinColor(); - UpdatePlayerTints(); -} - -void SKSETaskUpdateHairColor::Run() -{ - (*g_thePlayer)->UpdateHairColor(); -} - -void SKSETaskUpdateHairColor::Dispose(void) -{ - s_updateHairColorDelegatePool.Free(this); -} - -SKSETaskRegenHead * SKSETaskRegenHead::Create(Actor * actor) -{ - SKSETaskRegenHead * cmd = s_regenHeadDelegatePool.Allocate(); - if (cmd) - { - cmd->m_actor = actor; - } - return cmd; -} - -void SKSETaskRegenHead::Dispose(void) -{ - s_regenHeadDelegatePool.Free(this); -} - -void SKSETaskRegenHead::Run() -{ - TESNPC * npc = DYNAMIC_CAST(m_actor->baseForm, TESForm, TESNPC); - BSFaceGenNiNode * faceNode = m_actor->GetFaceGenNiNode(); - BGSHeadPart * facePart = npc->GetCurrentHeadPartByType(BGSHeadPart::kTypeFace); - if (npc && faceNode && facePart) { - CALL_MEMBER_FN(FaceGen::GetSingleton(), RegenerateHead)(faceNode, facePart, npc); - } -} - - -SKSETaskChangeHeadPart * SKSETaskChangeHeadPart::Create(Actor * actor, BGSHeadPart* oldPart, BGSHeadPart* newPart) -{ - SKSETaskChangeHeadPart * cmd = s_changeHeadPartDelegatePool.Allocate(); - if (cmd) - { - cmd->m_actor = actor; - cmd->m_newPart = newPart; - cmd->m_oldPart = oldPart; - } - return cmd; -} - -void SKSETaskChangeHeadPart::Dispose(void) -{ - s_changeHeadPartDelegatePool.Free(this); -} - -void SKSETaskChangeHeadPart::Run() -{ - if (m_actor) { - ChangeActorHeadPart(m_actor, m_oldPart, m_newPart); - } -} - -SKSETaskUpdateWeight * SKSETaskUpdateWeight::Create(Actor * actor, float delta, UInt32 updateFlags, bool redrawWeapon) -{ - SKSETaskUpdateWeight * cmd = s_updateWeightDelegatePool.Allocate(); - if (cmd) - { - cmd->m_actor = actor; - cmd->m_delta = delta; - cmd->m_updateFlags = updateFlags; - cmd->m_redraw = redrawWeapon; - } - return cmd; -} - -void SKSETaskUpdateWeight::Dispose(void) -{ - s_updateWeightDelegatePool.Free(this); -} - -void SKSETaskUpdateWeight::Run() -{ - if (m_actor) { - TESNPC * npc = DYNAMIC_CAST(m_actor->baseForm, TESForm, TESNPC); - if (npc) { - BSFaceGenNiNode * faceNode = m_actor->GetFaceGenNiNode(); - if (faceNode) { - CALL_MEMBER_FN(faceNode, AdjustHeadMorph)(BSFaceGenNiNode::kAdjustType_Neck, 0, m_delta); - UpdateModelFace(faceNode); - } - - /*ActorWeightModel * lowModel = m_actor->GetWeightModel(ActorWeightModel::kWeightModel_Small); - if(lowModel && lowModel->weightData) - CALL_MEMBER_FN(lowModel->weightData, UpdateWeightData)(); - - ActorWeightModel * highModel = m_actor->GetWeightModel(ActorWeightModel::kWeightModel_Large); - if(highModel && highModel->weightData) - CALL_MEMBER_FN(highModel->weightData, UpdateWeightData)(); - - //UInt32 updateFlags = ActorEquipData::kFlags_Unk01 | ActorEquipData::kFlags_Unk02 | ActorEquipData::kFlags_Mobile; - // Resets ActorState - //updateFlags |= ActorEquipData::kFlags_DrawHead | ActorEquipData::kFlags_Reset; - UInt32 updateFlags = m_updateFlags; - - CALL_MEMBER_FN(m_actor->processManager, SetEquipFlag)(updateFlags); - CALL_MEMBER_FN(m_actor->processManager, UpdateEquipment)(m_actor);*/ - - // Force redraw weapon, weight model update causes weapon position to be reset - // Looking at DrawSheatheWeapon there is a lot of stuff going on, hard to find - // out how to just manually move the weapon to its intended position - if (m_redraw && m_actor->actorState.IsWeaponDrawn()) { - m_actor->DrawSheatheWeapon(false); - m_actor->DrawSheatheWeapon(true); - } - } - } -} - -SKSETaskUpdateWorldData * SKSETaskUpdateWorldData::Create(NiAVObject * object) -{ - SKSETaskUpdateWorldData * cmd = s_updateWorldDataDelegatePool.Allocate(); - if (cmd) - { - if (object) - object->IncRef(); - cmd->m_object = object; - } - return cmd; - return NULL; -} - -void SKSETaskUpdateWorldData::Dispose(void) -{ - if (m_object) - m_object->DecRef(); - s_updateWorldDataDelegatePool.Free(this); -} - -void SKSETaskUpdateWorldData::Run() -{ - NiAVObject::ControllerUpdateContext ctx; - m_object->UpdateWorldData(&ctx); -} - -SKSETaskUpdateHarvestModel * SKSETaskUpdateHarvestModel::Create(TESObjectREFR * reference) -{ - SKSETaskUpdateHarvestModel * cmd = s_updateHarvestModelDelegatePool.Allocate(); - if (cmd) - { - cmd->m_reference = reference; - } - return cmd; -} - -void SKSETaskUpdateHarvestModel::Dispose(void) -{ - s_updateHarvestModelDelegatePool.Free(this); -} - -void SKSETaskUpdateHarvestModel::Run() -{ - if (m_reference) { - NiNode * rootModel = m_reference->GetNiNode(); - if (rootModel) - UpdateHarvestModel(m_reference, rootModel); - } -} - -SKSETaskUpdateExpression * SKSETaskUpdateExpression::Create(Actor * actor, UInt8 type, UInt16 index, float value) -{ - SKSETaskUpdateExpression * cmd = s_updateExpressionDelegatePool.Allocate(); - if (cmd) - { - cmd->m_actor = actor; - cmd->m_type = type; - cmd->m_index = index; - if (value < 0.0f) - value = 0.0f; - if (value > 1.0f) - value = 1.0f; - cmd->m_value = value; - } - return cmd; -} - -void SKSETaskUpdateExpression::Dispose(void) -{ - s_updateExpressionDelegatePool.Free(this); -} - -void SKSETaskUpdateExpression::Run() -{ - BSFaceGenAnimationData * animationData = m_actor->GetFaceGenAnimationData(); - if (animationData) { - if (m_type != BSFaceGenAnimationData::kKeyframeType_Reset) { - FaceGen::GetSingleton()->isReset = 0; - BSFaceGenKeyframeMultiple * keyframe = &animationData->keyFrames[m_type]; - if (m_index >= keyframe->count) - return; - keyframe->values[m_index] = m_value; - keyframe->isUpdated = 0; - } - else { - animationData->overrideFlag = 0; - CALL_MEMBER_FN(animationData, Reset)(1.0, 1, 1, 0, 0); - FaceGen::GetSingleton()->isReset = 1; - } - NiNode * face = m_actor->GetFaceGenNiNode(); - if (face) - UpdateModelFace(face); - } -} diff --git a/source/fs.dll/skse64/skse64/InternalTasks.h b/source/fs.dll/skse64/skse64/InternalTasks.h deleted file mode 100644 index f98b8313..00000000 --- a/source/fs.dll/skse64/skse64/InternalTasks.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#include "skse64/GameThreads.h" - -class SKSETaskUpdateTintMasks : public TaskDelegate -{ -public: - virtual void Run(); - virtual void Dispose(); -}; - -class SKSETaskUpdateHairColor : public TaskDelegate -{ -public: - virtual void Run(); - virtual void Dispose(); -}; - -class SKSETaskRegenHead : public TaskDelegate -{ -public: - static SKSETaskRegenHead * Create(Actor * actor); - virtual void Run(); - virtual void Dispose(); - -private: - Actor* m_actor; -}; - -class SKSETaskChangeHeadPart : public TaskDelegate -{ -public: - static SKSETaskChangeHeadPart * Create(Actor * actor, BGSHeadPart* oldPart, BGSHeadPart* newPart); - virtual void Run(); - virtual void Dispose(); - -private: - Actor* m_actor; - BGSHeadPart* m_oldPart; - BGSHeadPart* m_newPart; -}; - -class SKSETaskUpdateWeight : public TaskDelegate -{ -public: - static SKSETaskUpdateWeight * Create(Actor * actor, float delta, UInt32 updateFlags, bool redrawWeapon); - virtual void Run(); - virtual void Dispose(); - -private: - Actor * m_actor; - float m_delta; - UInt32 m_updateFlags; - bool m_redraw; -}; - -class SKSETaskUpdateWorldData : public TaskDelegate -{ -public: - static SKSETaskUpdateWorldData * Create(NiAVObject * object); - virtual void Run(); - virtual void Dispose(); - -private: - NiAVObject * m_object; -}; - -class SKSETaskUpdateHarvestModel : public TaskDelegate -{ -public: - static SKSETaskUpdateHarvestModel * Create(TESObjectREFR * reference); - virtual void Run(); - virtual void Dispose(); - -private: - TESObjectREFR * m_reference; -}; - -class SKSETaskUpdateExpression : public TaskDelegate -{ -public: - static SKSETaskUpdateExpression * Create(Actor * actor, UInt8 type, UInt16 index, float value); - virtual void Run(); - virtual void Dispose(); - -private: - UInt8 m_type; - UInt16 m_index; - Actor * m_actor; - float m_value; -}; - -namespace TaskInterface -{ - void UpdateTintMasks(); - void UpdateHairColor(); - - void RegenerateHead(Actor * actor); - void ChangeHeadPart(Actor * actor, BGSHeadPart * oldPart, BGSHeadPart * newPart); - void UpdateWeight(Actor * actor, float delta, UInt32 updateFlags, bool redrawWeapon); - void UpdateWorldData(NiAVObject * object); - void UpdateExpression(Actor * actor, UInt8 type, UInt16 index, float value); - void UpdateHarvestModel(TESObjectREFR * refr); -}; diff --git a/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.cpp b/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.cpp deleted file mode 100644 index 70d68343..00000000 --- a/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/NiAdditionalGeometryData.h" diff --git a/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.h b/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.h deleted file mode 100644 index aea27926..00000000 --- a/source/fs.dll/skse64/skse64/NiAdditionalGeometryData.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "skse64/NiObjects.h" -#include "skse64/NiTypes.h" - -class NiAdditionalGeometryData : public NiObject -{ -public: - UInt32 m_uiRevID; // 08 - UInt16 m_usVertexCount; // 0C - UInt8 m_ucNumStreams; // 0E - UInt8 unk0F; // 0F - void * m_pkStreamEntries; // 10 - UInt32 unk14; // 14 - void * m_pkBlocks; // 18 - UInt8 m_ucNumBlocks; // 1C - UInt8 unk1D; // 1D - UInt8 unk1E; // 1E - UInt8 unk1F; // 1F -}; diff --git a/source/fs.dll/skse64/skse64/NiControllers.cpp b/source/fs.dll/skse64/skse64/NiControllers.cpp deleted file mode 100644 index 432a7e4c..00000000 --- a/source/fs.dll/skse64/skse64/NiControllers.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/NiControllers.h" diff --git a/source/fs.dll/skse64/skse64/NiControllers.h b/source/fs.dll/skse64/skse64/NiControllers.h deleted file mode 100644 index 9dada387..00000000 --- a/source/fs.dll/skse64/skse64/NiControllers.h +++ /dev/null @@ -1,166 +0,0 @@ -#pragma once - -#include "skse64/NiNodes.h" - -/**** controllers - * NiTimeController - * BSDoorHavokController - * BSPlayerDistanceCheckController - * NiD3DController - * NiControllerManager - * NiInterpController - * NiSingleInterpController - * NiTransformController - * NiPSysModifierCtlr - * NiPSysEmitterCtlr - * NiPSysModifierBoolCtlr - * NiPSysModifierActiveCtlr - * NiPSysModifierFloatCtlr - * NiPSysInitialRotSpeedVarCtlr - * NiPSysInitialRotSpeedCtlr - * NiPSysInitialRotAngleVarCtlr - * NiPSysInitialRotAngleCtlr - * NiPSysGravityStrengthCtlr - * NiPSysFieldMaxDistanceCtlr - * NiPSysFieldMagnitudeCtlr - * NiPSysFieldAttenuationCtlr - * NiPSysEmitterSpeedCtlr - * NiPSysEmitterPlanarAngleVarCtlr - * NiPSysEmitterPlanarAngleCtlr - * NiPSysEmitterLifeSpanCtlr - * NiPSysEmitterInitialRadiusCtlr - * NiPSysEmitterDeclinationVarCtlr - * NiPSysEmitterDeclinationCtlr - * NiPSysAirFieldSpreadCtlr - * NiPSysAirFieldInheritVelocityCtlr - * NiPSysAirFieldAirFrictionCtlr - * NiFloatInterpController - * NiFlipController - * NiAlphaController - * NiTextureTransformController - * NiLightDimmerController - * NiBoolInterpController - * NiVisController - * NiPoint3InterpController - * NiMaterialColorController - * NiLightColorController - * NiExtraDataController - * NiFloatsExtraDataPoint3Controller - * NiFloatsExtraDataController - * NiFloatExtraDataController - * NiColorExtraDataController - * NiMultiTargetTransformController - * NiGeomMorpherController - * bhkBlendController - * bhkForceController - * NiBSBoneLODController - * NiUVController - * NiPathController - * NiLookAtController - * NiKeyframeManager - * NiBoneLODController - * NiPSysUpdateCtlr - * NiPSysResetOnLoopCtlr - * NiFloatController - * NiRollController - */ - -class NiInterpolator; - -// 03C -class NiTimeController : public NiObject -{ -public: - NiTimeController(); - ~NiTimeController(); - - virtual void Start(float time); - virtual void Stop(void); - virtual void Update(float time) = 0; - virtual void SetTarget(NiObjectNET * node); - virtual bool Unk_17(void); - virtual bool Unk_18(void); - virtual void Unk_19(void); - virtual bool Unk_1A(void); - virtual bool Unk_1B(void); - virtual bool Unk_1C(void) = 0; - - enum - { - kAnimType_AppTime = 0 << 0, - kAnimType_AppInit = 1 << 0, - - kCycleType_Loop = 0 << 1, - kCycleType_Reverse = 1 << 1, - kCycleType_Clamp = 2 << 1, - - kActive = 1 << 3, - - kPlayBackwards = 1 << 4, - }; - - UInt16 flags; // 008 - UInt8 pad00A[2]; // 00A - float m_fFrequency; // 00C - float m_fPhase; // 010 - float m_fLoKeyTime; // 014 - float m_fHiKeyTime; // 018 - float m_fStartTime; // 01C - float m_fLastTime; // 020 - float unk024; // 024 - updated in Unk_19 - float unk028; // 028 - UInt8 unk02C; // 02C - UInt8 pad02D[3]; // 02D - NiObjectNET * next; // 030 - singly linked list of controllers - NiObject * m_pTarget; // 034 - type is a (wrong) guess; NET has a back controller pointer, but many children assume larger objects - UInt8 unk038; // 038 - UInt8 unk039[3]; // 039 -}; - -// 03C -class NiInterpController : public NiTimeController -{ -public: - NiInterpController(); - ~NiInterpController(); - - virtual UInt16 GetNumInterpolators(void) = 0; // 1D - virtual char * GetInterpolatorName(UInt16 idx) = 0; - virtual UInt16 GetInterpolatorIdx(char * name) = 0; - virtual NiInterpolator * GetInterpolator(UInt16 idx) = 0; - virtual void SetInterpolator(NiInterpolator * _interpolator, UInt16 idx) = 0; - virtual void Unk_22(void); - virtual char * GetName(void); - virtual void Unk_24(UInt16 idx) = 0; // create interpolators - virtual void Unk_25(void) = 0; - virtual void Unk_26(UInt16 idx) = 0; // create blend interpolators - virtual void Unk_27(void) = 0; - virtual void Unk_28(void * arg, UInt16 idx) = 0; - - enum - { - kIsManagerControlled = 1 << 5, - }; -}; - -// 040 -class NiSingleInterpController : public NiInterpController -{ -public: - NiSingleInterpController(); - ~NiSingleInterpController(); - - virtual bool Unk_29(void * arg) = 0; - - NiInterpolator * interpolator; // 03C -}; - -// 040 -class NiFloatInterpController : public NiSingleInterpController -{ -public: - NiFloatInterpController(); - ~NiFloatInterpController(); - - virtual void Unk_2A(float * out) = 0; -}; diff --git a/source/fs.dll/skse64/skse64/NiExtraData.cpp b/source/fs.dll/skse64/skse64/NiExtraData.cpp deleted file mode 100644 index 1c078fd0..00000000 --- a/source/fs.dll/skse64/skse64/NiExtraData.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "skse64/NiExtraData.h" -#include "skse64/NiGeometry.h" - -// ??_7BSFaceGenBaseMorphExtraData@@6B@ -RelocAddr s_BSFaceGenBaseMorphExtraDataVtbl(0x016F9F80); -// ??_7NiStringsExtraData@@6B@ -RelocAddr s_NiStringsExtraDataVtbl(0x01857ED0); -// ??_7NiBinaryExtraData@@6B@ -RelocAddr s_NiBinaryExtraDataVtbl(0x0185C7B8); -// ??_7NiBooleanExtraData@@6B@ -RelocAddr s_NiBooleanExtraDataVtbl(0x0185C970); - -NiExtraData* NiExtraData::Create(UInt32 size, uintptr_t vtbl) -{ - void* memory = Heap_Allocate(size); - memset(memory, 0, size); - NiExtraData* xData = (NiExtraData*)memory; - ((uintptr_t*)memory)[0] = vtbl; - return xData; -} - -NiStringsExtraData * NiStringsExtraData::Create(BSFixedString name, BSFixedString * stringData, UInt32 size) -{ - NiStringsExtraData* data = (NiStringsExtraData*)NiExtraData::Create(sizeof(NiStringsExtraData), s_NiStringsExtraDataVtbl.GetUIntPtr()); - data->m_pcName = const_cast(name.data); - data->m_data = (char**)Heap_Allocate(sizeof(char*) * size); - data->m_size = size; - - for (int i = 0; i < size; i++) - { - UInt32 strLength = strlen(stringData[i].data) + 1; - data->m_data[i] = (char*)Heap_Allocate(sizeof(char*) * strLength); - memcpy(data->m_data[i], stringData[i].data, sizeof(char) * strLength); - } - - return data; -} - -void NiStringsExtraData::SetData(BSFixedString * stringData, UInt32 size) -{ - if (size != m_size) - { - if (m_data) - { - for (int i = 0; i < size; i++) - { - Heap_Free(m_data[i]); - } - Heap_Free(m_data); - m_data = NULL; - } - if (size > 0) { - m_data = (char**)Heap_Allocate(sizeof(char*) * size); - } - - m_size = size; - } - - for (int i = 0; i < size; i++) - { - UInt32 strLength = strlen(stringData[i].data) + 1; - m_data[i] = (char*)Heap_Allocate(sizeof(char*) * strLength); - memcpy(m_data[i], stringData[i].data, sizeof(char) * strLength); - } -} - -NiBinaryExtraData * NiBinaryExtraData::Create(BSFixedString name, char * binary, UInt32 size) -{ - NiBinaryExtraData* data = (NiBinaryExtraData*)NiExtraData::Create(sizeof(NiBinaryExtraData), s_NiBinaryExtraDataVtbl.GetUIntPtr()); - data->m_pcName = const_cast(name.data); - if (size > 0) - { - data->m_data = (char*)Heap_Allocate(size); - memcpy(data->m_data, binary, size); - data->m_size = size; - } - else - { - data->m_data = NULL; - data->m_size = 0; - } - - return data; -} - -NiBooleanExtraData * NiBooleanExtraData::Create(BSFixedString name, bool value) -{ - NiBooleanExtraData* data = (NiBooleanExtraData*)NiExtraData::Create(sizeof(NiBooleanExtraData), s_NiBooleanExtraDataVtbl.GetUIntPtr()); - data->m_pcName = const_cast(name.data); - data->m_data = value; - return data; -} - -void NiBinaryExtraData::SetData(char * data, UInt32 size) -{ - if (m_data) - { - Heap_Free(m_data); - m_data = NULL; - } - - if (size > 0) - { - m_data = (char*)Heap_Allocate(size); - memcpy(m_data, data, size); - } - - m_size = size; -} - -BSFaceGenBaseMorphExtraData* BSFaceGenBaseMorphExtraData::Create(NiGeometryData * geometryData, bool copy) -{ - BSFaceGenBaseMorphExtraData* data = (BSFaceGenBaseMorphExtraData*)NiExtraData::Create(sizeof(BSFaceGenBaseMorphExtraData), s_BSFaceGenBaseMorphExtraDataVtbl.GetUIntPtr()); - data->m_pcName = const_cast(BSFixedString("FOD").data); - data->m_uiRefCount = 0; - data->modelVertexCount = 0; - data->vertexCount = 0; - data->vertexData = NULL; - - if (geometryData) { - data->vertexCount = geometryData->m_usVertices; - data->modelVertexCount = geometryData->m_usVertices; - - data->vertexData = (NiPoint3*)Heap_Allocate(sizeof(NiPoint3) * data->vertexCount); - if(copy) - memcpy(data->vertexData, geometryData->m_pkVertex, sizeof(NiPoint3) * data->vertexCount); - else - memset(data->vertexData, 0, sizeof(NiPoint3) * data->vertexCount); - } - - return data; -} diff --git a/source/fs.dll/skse64/skse64/NiExtraData.h b/source/fs.dll/skse64/skse64/NiExtraData.h deleted file mode 100644 index 7a149fff..00000000 --- a/source/fs.dll/skse64/skse64/NiExtraData.h +++ /dev/null @@ -1,279 +0,0 @@ -#pragma once - -#include "skse64/NiTypes.h" -#include "skse64/NiObjects.h" -#include "skse64/GameTypes.h" - -class NiGeometryData; - -// 8 -class BSFaceGenKeyframe -{ -public: - virtual ~BSFaceGenKeyframe(); - - virtual void Unk_01(void); // pure - virtual void Unk_02(void); // pure - virtual void Unk_03(void); // pure - virtual void Unk_04(UInt32 unk1); // pure - virtual void Unk_05(void); // pure - virtual void Unk_06(void); // pure - virtual void Unk_07(void); // pure - virtual void Unk_08(void); // pure - virtual void Unk_09(void); // pure - virtual void Unk_0A(void); // pure - virtual void Unk_0B(void); // pure - virtual void Unk_0C(void); - virtual void Unk_0D(void); -}; - -// 20 -class BSFaceGenKeyframeMultiple : public BSFaceGenKeyframe -{ -public: - UInt32 type; // 08 - UInt32 unk08; // 0C - - float * values; // 10 - UInt32 count; // 18 - UInt8 isUpdated; // 1C - Set to 0 for update request - UInt8 pad1D[3]; -}; -STATIC_ASSERT(sizeof(BSFaceGenKeyframeMultiple) == 0x20); - -// 18 -class NiExtraData : public NiObject -{ -public: - NiExtraData(); - ~NiExtraData(); - - char * m_pcName; // 10 - - static NiExtraData* Create(UInt32 size, uintptr_t vtbl); -}; -STATIC_ASSERT(sizeof(NiExtraData) == 0x18); - -// 20 -class NiBooleanExtraData : public NiExtraData -{ -public: - NiBooleanExtraData(); - ~NiBooleanExtraData(); - - bool m_data; // 18 - - static NiBooleanExtraData * Create(BSFixedString name, bool value); -}; - -// 20 -class NiStringExtraData : public NiExtraData -{ -public: - NiStringExtraData(); - ~NiStringExtraData(); - - char * m_pString; // 18 -}; - -// 20 -class NiIntegerExtraData : public NiExtraData -{ -public: - NiIntegerExtraData(); - ~NiIntegerExtraData(); - - SInt32 m_data; // 18 -}; - -// 20 -class NiFloatExtraData : public NiExtraData -{ -public: - NiFloatExtraData(); - ~NiFloatExtraData(); - - float m_data; // 18 -}; - -// 28 -class NiBinaryExtraData : public NiExtraData -{ -public: - NiBinaryExtraData(); - ~NiBinaryExtraData(); - - char * m_data; // 18 - UInt32 m_size; // 20 - - static NiBinaryExtraData * Create(BSFixedString name, char * data, UInt32 size); - void SetData(char * data, UInt32 size); -}; - -// 28 -class NiFloatsExtraData : public NiExtraData -{ -public: - NiFloatsExtraData(); - ~NiFloatsExtraData(); - - UInt32 m_size; // 18 - UInt32 pad; // 1C - float * m_data; // 20 -}; - -// 28 -class NiIntegersExtraData : public NiExtraData -{ -public: - NiIntegersExtraData(); - ~NiIntegersExtraData(); - - UInt32 m_size; // 18 - UInt32 pad; // 1C - SInt32 * m_data; // 20 -}; - -// 28 -class NiStringsExtraData : public NiExtraData -{ -public: - NiStringsExtraData(); - ~NiStringsExtraData(); - - UInt32 m_size; // 18 - UInt32 pad; // 1C - char ** m_data; // 20 - - static NiStringsExtraData * Create(BSFixedString name, BSFixedString * data, UInt32 size); - void SetData(BSFixedString * data, UInt32 size); -}; - -// 28 -class NiVectorExtraData : public NiExtraData -{ -public: - NiVectorExtraData(); - ~NiVectorExtraData(); - - float m_vector[4]; // 18 -}; - -// 1B4-230 -class BSFaceGenAnimationData : public NiExtraData -{ -public: - enum { - kKeyframeType_Expression = 0, - kKeyframeType_Unk1, - kKeyframeType_Modifier, - kKeyframeType_Phoneme, - kKeyframeType_Custom, - kKeyframeType_Reset = 255, - kNumKeyframes = 12 - }; - UInt64 unk018; // 18 - BSFaceGenKeyframeMultiple keyFrames[kNumKeyframes]; // 20 - float unk1A0; // 1A0 - float unk1A4; // 1A4 - float unk1A8; // 1A8 - UInt32 unk1AC; // 1AC - UInt32 unk1B0; // 1B0 - UInt32 unk1B4; // 1B4 - UInt32 unk1B8; // 1B8 - float unk1BC; // 1BC - float unk1C0; // 1C0 - UInt32 pad1C4; // 1C4 - UInt64 unk1C8; // 1C8 - UInt8 unk1D0; // 1D0 - UInt8 unk1D1; // 1D1 - UInt8 unk1D2; // 1D2 - UInt8 unk1D3; // 1D3 - UInt32 unk1D4; // 1D4 - UInt32 unk1D8; // 1D8 - UInt32 unk1DC; // 1DC - UInt32 unk1E0; // 1E0 - UInt32 unk1E4; // 1E4 - UInt32 unk1E8; // 1E8 - UInt32 unk1EC; // 1EC - UInt32 unk1F0; // 1F0 - UInt32 unk1F4; // 1F4 - UInt32 unk1F8; // 1F8 - UInt32 unk1FC; // 1FC - UInt32 unk200; // 200 - float unk204; // 204 - float unk208; // 208 - float unk20C; // 20C - float unk210; // 210 - UInt8 unk214; // 214 - UInt8 unk215; // 215 - init'd to 1 - UInt8 unk216; // 216 - UInt8 unk217; // 217 - UInt8 unk218; // 218 - UInt8 unk219; // 219 - UInt8 unk21A; // 21A - UInt8 unk21B; // 21B - UInt8 unk21C; // 21C - UInt8 unk21D; // 21D - UInt8 overrideFlag; // 21E - UInt8 unk21F; // 21F - UInt64 unk220[2]; // 220 - - MEMBER_FN_PREFIX(BSFaceGenAnimationData); - DEFINE_MEMBER_FN(SetExpression, void, 0x003DB7F0, UInt32 type, float value); - DEFINE_MEMBER_FN(Reset, void, 0x003DB0F0, float value, UInt8 unk1, UInt8 unk2, UInt8 unk3, UInt8 unk4); - - // Alternatives to inlined functions - void SetPhonome(UInt32 type, float value) - { - if (type < 16) - { - keyFrames[8].values[type] = value; - keyFrames[8].isUpdated = true; - } - } - - void SetModifier(UInt32 type, float value) - { - if (type < 17) - { - keyFrames[6].values[type] = value; - keyFrames[6].isUpdated = true; - } - } - - void SetCustom(UInt32 type, float value) - { - if (type < 1) - { - keyFrames[10].values[type] = value; - keyFrames[10].isUpdated = true; - } - } -}; - -STATIC_ASSERT(offsetof(BSFaceGenAnimationData, keyFrames) == 0x20); -STATIC_ASSERT(offsetof(BSFaceGenAnimationData, overrideFlag) == 0x21E); -STATIC_ASSERT(sizeof(BSFaceGenAnimationData) == 0x230); - - -// 60 (FMD) -class BSFaceGenModelExtraData : public NiExtraData -{ -public: - BSFaceGenModel* m_model; // 18 - BSFixedString bones[8]; // 20 - -}; -STATIC_ASSERT(sizeof(BSFaceGenModelExtraData) == 0x60); - -// 28 (FOD) -class BSFaceGenBaseMorphExtraData : public NiExtraData -{ -public: - NiPoint3 * vertexData; // 18 - UInt32 modelVertexCount; // 20 - Same as 14 if the tri model is correct - UInt32 vertexCount; // 24 - - static BSFaceGenBaseMorphExtraData* Create(NiGeometryData * data, bool copy = false); -}; diff --git a/source/fs.dll/skse64/skse64/NiGeometry.cpp b/source/fs.dll/skse64/skse64/NiGeometry.cpp deleted file mode 100644 index 6aae200f..00000000 --- a/source/fs.dll/skse64/skse64/NiGeometry.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "skse64/NiGeometry.h" -#include "skse64/GameAPI.h" - -// 4772884F2DDD41847925EAA949727085D82940A1+401 -RelocAddr<_CreateBSTriShape> CreateBSTriShape(0x00C90560); -// 4772884F2DDD41847925EAA949727085D82940A1+414 -RelocAddr<_CreateBSDynamicTriShape> CreateBSDynamicTriShape(0x00C9B850); - -// ??_7NiTriShape@@6B@ -static const RelocPtr s_NiTriShapeVtbl(0x0185E998); - -// ??_7NiTriStrips@@6B@ -static const RelocPtr s_NiTriStripsVtbl(0x0185EF50); - -void NiGeometryData::AllocateVerts(UInt32 numVerts) -{ - m_pkVertex = (NiPoint3 *)Heap_Allocate(sizeof(NiPoint3) * numVerts); - m_pkTexture = (NiPoint2 *)Heap_Allocate(sizeof(NiPoint2) * numVerts); - - memset(m_pkVertex, 0, sizeof(NiPoint3) * numVerts); - memset(m_pkTexture, 0, sizeof(NiPoint2) * numVerts); -} - -void NiGeometryData::AllocateNormals(UInt32 numVerts) -{ - m_pkNormal = (NiPoint3 *)Heap_Allocate(sizeof(NiPoint3) * numVerts); - memset(m_pkNormal, 0, sizeof(NiPoint3) * numVerts); -} - -void NiGeometryData::AllocateNBT(UInt32 numVerts) -{ - m_pkNormal = (NiPoint3 *)Heap_Allocate(sizeof(NiPoint3) * 3 * numVerts); - memset(m_pkNormal, 0, sizeof(NiPoint3) * 3 * numVerts); -} - -void NiGeometryData::AllocateColors(UInt32 numVerts) -{ - m_pkColor = (NiColorA *)Heap_Allocate(sizeof(NiColorA) * numVerts); - memset(m_pkColor, 0, sizeof(NiColorA) * numVerts); -} - -void NiSkinPartition::Partition::AllocateWeights(UInt32 numVerts) -{ - m_pfWeights = (float *)Heap_Allocate(sizeof(float) * 4 * numVerts); - m_pucBonePalette = (UInt8 *)Heap_Allocate(sizeof(UInt8) * 4 * numVerts); - - memset(m_pfWeights, 0, sizeof(float) * 4 * numVerts); - memset(m_pucBonePalette, 0, sizeof(UInt8) * 4 * numVerts); -} - -void NiSkinData::BoneData::AllocateWeights(UInt32 numWeights) -{ - m_pkBoneVertData = (BoneVertData *)Heap_Allocate(sizeof(BoneVertData) * numWeights); - memset(m_pkBoneVertData, 0, sizeof(BoneVertData) * numWeights); -} - -NiSkinInstance * NiSkinInstance::Create() -{ - void* memory = Heap_Allocate(sizeof(NiSkinInstance)); - memset(memory, 0, sizeof(NiSkinInstance)); - NiSkinInstance* xData = (NiSkinInstance*)memory; - CALL_MEMBER_FN(xData, ctor)(); - return xData; -} - -BSDismemberSkinInstance * BSDismemberSkinInstance::Create() -{ - typedef BSDismemberSkinInstance * (*_BSDismemberSkinInstance_Create)(); - // 4772884F2DDD41847925EAA949727085D82940A1+2E4 - static RelocAddr <_BSDismemberSkinInstance_Create> BSDismemberSkinInstance_Create(0x00C947A0); - - return BSDismemberSkinInstance_Create(); -} - -NiTriShape * NiTriShape::Create(NiTriShapeData * geometry) -{ - void* memory = Heap_Allocate(sizeof(NiTriShape)); - memset(memory, 0, sizeof(NiTriShape)); - NiTriShape* xData = (NiTriShape*)memory; - xData->ctor(geometry); - ((uintptr_t *)memory)[0] = s_NiTriShapeVtbl.GetUIntPtr(); - return xData; -} - - -NiTriStrips * NiTriStrips::Create(NiTriShapeData * geometry) -{ - void* memory = Heap_Allocate(sizeof(NiTriStrips)); - memset(memory, 0, sizeof(NiTriStrips)); - NiTriStrips* xData = (NiTriStrips*)memory; - xData->ctor(geometry); - ((uintptr_t *)memory)[0] = s_NiTriStripsVtbl.GetUIntPtr(); - return xData; -} - -NiSkinInstance * NiSkinInstance::Clone() -{ - NiSkinInstance * newSkinInstance = nullptr; - - EnterCriticalSection(&lock); - BSDismemberSkinInstance* srcSkin = ni_cast(this, BSDismemberSkinInstance); - if (srcSkin) - { - newSkinInstance = BSDismemberSkinInstance::Create(); - BSDismemberSkinInstance* dstSkin = ni_cast(newSkinInstance, BSDismemberSkinInstance); - dstSkin->numPartitions = srcSkin->numPartitions; - dstSkin->partitionFlags = (UInt32 *)Heap_Allocate(sizeof(UInt32) * srcSkin->numPartitions); - memcpy(dstSkin->partitionFlags, srcSkin->partitionFlags, sizeof(UInt32) * srcSkin->numPartitions); - dstSkin->unk98 = srcSkin->unk98; - memcpy(dstSkin->pad99, srcSkin->pad99, 7); - } - else - { - newSkinInstance = NiSkinInstance::Create(); - } - - newSkinInstance->m_spSkinData = m_spSkinData; - newSkinInstance->m_spSkinPartition = m_spSkinPartition; - newSkinInstance->m_pkRootParent = m_pkRootParent; - newSkinInstance->m_ppkBones = (NiAVObject**)Heap_Allocate(sizeof(NiAVObject*) * m_uiBoneNodes); - memcpy(newSkinInstance->m_ppkBones, this->m_ppkBones, sizeof(NiAVObject*) * m_uiBoneNodes); - newSkinInstance->unk38 = unk38; - newSkinInstance->m_uiBoneNodes = m_uiBoneNodes; - newSkinInstance->numFlags = numFlags; - if (flags) { - newSkinInstance->flags = (UInt32 *)Heap_Allocate(sizeof(UInt32) * numFlags); - } - else { - flags = nullptr; - } - newSkinInstance->unk44 = unk44; - memcpy(newSkinInstance->flags, flags, sizeof(UInt32) * numFlags); - if (unk50) { - newSkinInstance->unk50 = (UInt32 *)Heap_Allocate(sizeof(UInt32) * numFlags); - memcpy(newSkinInstance->unk50, unk50, sizeof(UInt32) * numFlags); - } - else { - unk50 = nullptr; - } - - NiSkinData * skinData = niptr_cast(newSkinInstance->m_spSkinData); - if (skinData) { - newSkinInstance->m_worldTransforms = (NiTransform**)Heap_Allocate(sizeof(NiTransform*) * skinData->m_uiBones); - memcpy(newSkinInstance->m_worldTransforms, this->m_worldTransforms, sizeof(NiTransform*) * skinData->m_uiBones); - } - -#if 0 - else - { - if (!newSkinInstance->flags && numFlags > 0) - { - newSkinInstance->numFlags = numFlags; - newSkinInstance->flags = (UInt32 *)Heap_Allocate(sizeof(UInt32) * numFlags); - memcpy(newSkinInstance->flags, flags, sizeof(UInt32) * numFlags); - } - - newSkinInstance->m_uiBoneNodes = m_uiBoneNodes; - newSkinInstance->unk38 = unk38; - newSkinInstance->unk44 = unk44; - newSkinInstance->unk50 = unk50; - newSkinInstance->unk54 = unk54; - } -#endif - LeaveCriticalSection(&lock); - return newSkinInstance; -} diff --git a/source/fs.dll/skse64/skse64/NiGeometry.h b/source/fs.dll/skse64/skse64/NiGeometry.h deleted file mode 100644 index b0c06235..00000000 --- a/source/fs.dll/skse64/skse64/NiGeometry.h +++ /dev/null @@ -1,448 +0,0 @@ -#pragma once - -#include "skse64/NiNodes.h" -#include "skse64/NiProperties.h" - -// NiGeometry, NiGeometryData and children -MAKE_NI_POINTER(NiGeometryData); -MAKE_NI_POINTER(NiAdditionalGeometryData); -MAKE_NI_POINTER(NiSkinInstance); -MAKE_NI_POINTER(NiProperty); -MAKE_NI_POINTER(NiSkinData); -MAKE_NI_POINTER(NiSkinPartition); - -class NiAdditionalGeometryData; -class NiTriShapeData; -class NiTriStripsData; - -struct ID3D11Buffer; - -// 138 -class NiGeometry : public NiAVObject -{ -public: - virtual void Unk_33(void); // call controller vtbl+0xA0? - virtual void Unk_34(void); // ret 0 - virtual void Unk_35(void); // same as Unk_33 - virtual void * Unk_36(void); // ret call m_spModelData vtbl+0x9C - virtual void SetGeometryData(NiGeometryData * unk1); // set and AddRef geometry data - virtual void * Unk_38(void); // ret call m_spModelData vtbl+0x94 - virtual UInt16 Unk_39(bool unk1); // ?? - - NiPropertyPtr m_spPropertyState; // 110 - NiPropertyPtr m_spEffectState; // 118 - NiGeometryDataPtr m_spModelData; // 120 - NiSkinInstancePtr m_spSkinInstance; // 128 - UInt64 unk130; // 130 -}; - -class NiTriBasedGeom : public NiGeometry -{ -public: - // 9D070CBFB7F7B861F270D5D29E210A479261131B+C2 - DEFINE_MEMBER_FN_1(ctor, NiTriBasedGeom *, 0x00CBD670, NiTriShapeData * geometry); -}; - -class NiTriShape : public NiTriBasedGeom -{ -public: - static NiTriShape * Create(NiTriShapeData * geometry); -}; - -class BSSegmentedTriShape : public NiTriShape -{ -public: -}; - -class NiTriStrips : public NiTriBasedGeom -{ -public: - static NiTriStrips * Create(NiTriShapeData * geometry); -}; - -class BSGeometryData -{ -public: - ID3D11Buffer * buffer1; // 00 - ID3D11Buffer * buffer2; // 08 - UInt16 unk10; // 10 - UInt16 unk12; // 12 - UInt16 unk14; // 14 - UInt16 unk16; // 16 - volatile UInt32 refCount; // 18 - UInt16 unk1C; // 1C - UInt16 unk1E; // 1E - UInt8 * vertices; // 20 - UInt8 * triangles; // 28 -}; - -// 158 -class BSGeometry : public NiAVObject -{ -public: - virtual ~BSGeometry(); - - enum ShapeType - { - kShapeType_TriShape = 3, - kShapeType_Dynamic = 4, - kShapeType_Particle = 11 - }; - - UInt64 unk110; // 110 - UInt64 unk118; // 118 - NiPropertyPtr m_spPropertyState; // 120 - NiPropertyPtr m_spEffectState; // 128 - NiSkinInstancePtr m_spSkinInstance; // 130 - BSGeometryData * geometryData; // 138 - UInt64 unk140; // 140 - UInt64 vertexDesc; // 148 - UInt8 shapeType; // 150 - type? 3, 4, 11 - UInt8 unk151; // 151 - UInt16 unk152; // 152 - UInt32 unk154; // 154 -}; - -// class 160 -class BSTriShape : public BSGeometry -{ -public: - virtual ~BSTriShape(); - - UInt16 unk158; // 158 - UInt16 numVertices; // 15A - UInt16 unk15C; // 15C - UInt16 unk15D; // 15D -}; - -typedef BSTriShape * (*_CreateBSTriShape)(); -extern RelocAddr<_CreateBSTriShape> CreateBSTriShape; - -// 180 -class BSDynamicTriShape : public BSTriShape -{ -public: - void * pDynamicData; // 160 - SimpleLock lock; // 168 - UInt32 dataSize; // 170 - UInt32 frameCount; // 174 - UInt32 unk178; // 178 - UInt32 unk17C; // 17C - - // - DEFINE_MEMBER_FN_0(ctor, BSDynamicTriShape *, 0x00C9B9D0); -}; -STATIC_ASSERT(sizeof(BSDynamicTriShape) == 0x180); - -typedef BSDynamicTriShape * (*_CreateBSDynamicTriShape)(); -extern RelocAddr<_CreateBSDynamicTriShape> CreateBSDynamicTriShape; - -// 48+ -class NiGeometryData : public NiObject -{ -public: - enum - { - kDataFlag_HasUVs = 1 << 0, - kDataFlag_HasNBT = 1 << 12, - }; - - enum - { - kConsistency_Mutable = 0, - kConsistency_Static = 0x4000, - kConsistency_Volatile = 0x8000, - kConsistency_Mask = 0xF000 - }; - - enum - { - kKeep_XYZ = 1 << 0, - kKeep_Norm = 1 << 1, - kKeep_Color = 1 << 2, - kKeep_UV = 1 << 3, - kKeep_Indices = 1 << 4, - kKeep_BoneData = 1 << 5, - kKeep_All = (kKeep_XYZ | kKeep_Norm | kKeep_Color | kKeep_UV | kKeep_Indices | kKeep_BoneData) - }; - - UInt16 m_usVertices; // 08 - UInt16 m_usID; // 0A - UInt16 m_usDirtyFlags; // 0C - UInt16 m_usDataFlags; // 0E - NiBound m_kBound; // 10 - NiPoint3 * m_pkVertex; // 20 - NiPoint3 * m_pkNormal; // 24 - all normals, then all binormals etc - NiColorA * m_pkColor; // 28 - yes really, floats (b g r a) - NiPoint2 * m_pkTexture; // 2C - UInt32 unk30; // 30 - UInt32 unk34; // 34 - UInt32 unkInt2; // 38 - NiAdditionalGeometryDataPtr m_spAdditionalGeomData; // 3C - UInt32 unk40; // 40 - UInt8 m_ucKeepFlags; // 44 - UInt8 m_ucCompressFlags; // 45 - UInt8 hasGeoData; // 46 - - void AllocateVerts(UInt32 numVerts); - void AllocateNormals(UInt32 numVerts); - void AllocateNBT(UInt32 numVerts); - void AllocateColors(UInt32 numVerts); - - struct Data0 - { - UInt32 unk00; - UInt32 unk04; - UInt32 unk08; - }; -}; - -// 70 -class NiTriBasedGeomData : public NiGeometryData -{ -public: - UInt16 m_usTriangles; // 68 - UInt16 m_usActiveTriangles; // 6A -}; - -// 80 -class NiTriShapeData : public NiTriBasedGeomData -{ -public: - UInt32 m_uiTriListLength; // 70 - UInt16 * m_pusTriList; // 78 -}; - -// 5C -class BSSharedVertexesTriShapeData : public NiTriShapeData -{ -public: - NiTriShapeData * m_refData; - UInt32 unk58; -}; - -class NiTriStripsData : public NiTriBasedGeomData -{ -public: - UInt16 m_usStrips; - UInt16 * m_pusStripLengths; - UInt16 * m_pusStripLists; -}; - -// 58 -class NiTriShapeDynamicData : public NiTriShapeData -{ -public: - struct SharedNormalArray - { - UInt16 m_usNumSharedNormals; - UInt16 * m_pusSharedNormalIndexArray; - }; - SharedNormalArray * m_pkSharedNormals; // 54 - UInt16 m_usSharedNormalsArraySize; // 56 -}; - -enum VertexAttribute : UInt8 -{ - VA_POSITION = 0x0, - VA_TEXCOORD0 = 0x1, - VA_TEXCOORD1 = 0x2, - VA_NORMAL = 0x3, - VA_BINORMAL = 0x4, - VA_COLOR = 0x5, - VA_SKINNING = 0x6, - VA_LANDDATA = 0x7, - VA_EYEDATA = 0x8, - VA_COUNT = 9 -}; - -enum VertexFlags : UInt16 -{ - VF_VERTEX = 1 << VA_POSITION, - VF_UV = 1 << VA_TEXCOORD0, - VF_UV_2 = 1 << VA_TEXCOORD1, - VF_NORMAL = 1 << VA_NORMAL, - VF_TANGENT = 1 << VA_BINORMAL, - VF_COLORS = 1 << VA_COLOR, - VF_SKINNED = 1 << VA_SKINNING, - VF_LANDDATA = 1 << VA_LANDDATA, - VF_EYEDATA = 1 << VA_EYEDATA, - VF_FULLPREC = 0x400 -}; - -enum VertexMasks : UInt64 -{ - DESC_MASK_VERT = 0xFFFFFFFFFFFFFFF0LL, - DESC_MASK_UVS = 0xFFFFFFFFFFFFFF0FLL, - DESC_MASK_NBT = 0xFFFFFFFFFFFFF0FFLL, - DESC_MASK_SKCOL = 0xFFFFFFFFFFFF0FFFLL, - DESC_MASK_DATA = 0xFFFFFFFFFFF0FFFFLL, - DESC_MASK_OFFSET = 0xFFFFFF0000000000LL, - DESC_MASK_FLAGS = ~(DESC_MASK_OFFSET) -}; - -// 28 -class NiSkinPartition : public NiObject -{ -public: - static UInt32 GetVertexAttributeOffset(UInt64 vertexDesc, VertexAttribute attr) { - return (vertexDesc >> (4 * (UInt8)attr + 2)) & 0x3C; - } - static VertexFlags GetVertexFlags(UInt64 vertexDesc) { - return VertexFlags((vertexDesc & DESC_MASK_OFFSET) >> 44); - } - static UInt32 GetVertexSize(UInt64 vertexDesc) - { - UInt32 vertexSize = 0; - VertexFlags flags = GetVertexFlags(vertexDesc); - if (flags & VF_VERTEX) - { - vertexSize += sizeof(float) * 4; - } - if (flags & VF_UV) - { - vertexSize += sizeof(UInt16) * 2; - } - if (flags & VF_UV_2) - { - vertexSize += sizeof(UInt16) * 2; - } - if (flags & VF_NORMAL) - { - vertexSize += sizeof(UInt16) * 2; - if (flags & VF_TANGENT) - { - vertexSize += sizeof(UInt16) * 2; - } - } - if (flags & VF_COLORS) - { - vertexSize += sizeof(UInt8) * 4; - } - if (flags & VF_SKINNED) - { - vertexSize += sizeof(UInt16) * 4 + sizeof(UInt8) * 4; - } - if (flags & VF_EYEDATA) - { - vertexSize += sizeof(float); - } - return vertexSize; - } - - // 30 - struct TriShape - { - struct ID3D11Buffer * m_VertexBuffer; - struct ID3D11Buffer * m_IndexBuffer; - uint64_t m_VertexDesc; - uint32_t m_RefCount; - UInt8 * m_RawVertexData; - UInt16 * m_RawIndexData; - }; - - // 50 - struct Partition - { - UInt64 vertexDesc; // 30 - UInt16 * m_pusBones; // 00 - float * m_pfWeights; // 08 - UInt16 * m_pusVertexMap; // 10 - UInt8 * m_pucBonePalette; // 18 - UInt16 * m_pusTriList; // 20 - UInt16 * m_pusStripLengths; // 28 - UInt16 m_usVertices; // 38 - UInt16 m_usTriangles; // 3A - UInt16 m_usBones; // 3C - UInt16 m_usStrips; // 3E - UInt16 m_usBonesPerVertex; // 40 - float unk44; // 44 - TriShape * shapeData; // 48 - - void AllocateWeights(UInt32 numVerts); - }; - - UInt32 m_uiPartitions; // 10 - UInt32 unk14; // 14 - Partition * m_pkPartitions; // 18 - UInt32 vertexCount; // 20 - UInt32 unk24; // 24 -}; - -// 48 -class NiSkinData : public NiObject -{ -public: - // 08 - struct BoneVertData - { - UInt16 m_usVert; // 00 - UInt8 pad02[2]; // 02 - float m_fWeight; // 04? - }; - - // 4C - struct BoneData - { - NiTransform m_kSkinToBone; // 00 - NiBound m_kBound; // 34 - BoneVertData * m_pkBoneVertData; // 44 - UInt16 m_usVerts; // 48 - UInt8 pad4A[2]; // 4A - - void AllocateWeights(UInt32 numVerts); - }; - - NiSkinPartition * m_spSkinPartition; // 08 - NiTransform m_kRootParentToSkin; // 0C - BoneData * m_pkBoneData; // 40 - UInt32 m_uiBones; // 44 -}; - -STATIC_ASSERT(sizeof(NiSkinData::BoneVertData) == 0x08); - -// 88 -class NiSkinInstance : public NiObject -{ -public: - NiSkinDataPtr m_spSkinData; // 10 - NiSkinPartitionPtr m_spSkinPartition; // 18 - NiAVObject * m_pkRootParent; // 20 - NiAVObject ** m_ppkBones; // 28 - - NiTransform ** m_worldTransforms;// 30 - SInt32 unk38; // 38 - UInt32 m_uiBoneNodes; // 3C - UInt32 numFlags; // 40 - UInt32 unk44; // 44 - UInt32 * flags; // 48 - UInt32 * unk50; // 50 - UInt64 unk58; // 58 - CRITICAL_SECTION lock; // 60 - - static NiSkinInstance * Create(); - - NiSkinInstance * Clone(); - - MEMBER_FN_PREFIX(NiSkinInstance); - DEFINE_MEMBER_FN(Copy, NiSkinInstance*, 0x00C7ACC0); - DEFINE_MEMBER_FN(ctor, NiSkinInstance *, 0x00CA8A00); -}; -STATIC_ASSERT(offsetof(NiSkinInstance, lock) == 0x60); -STATIC_ASSERT(sizeof(NiSkinInstance) == 0x88); - -// A0 -class BSDismemberSkinInstance : public NiSkinInstance -{ -public: - UInt32 numPartitions; // 88 - UInt32 unk8C; // 8C - UInt32 * partitionFlags; // 90 - UInt8 unk98; // 98 - UInt8 pad99[7]; // 99 - - static BSDismemberSkinInstance * Create(); - - // standalone constructor was inlined -}; -STATIC_ASSERT(sizeof(BSDismemberSkinInstance) == 0xA0); diff --git a/source/fs.dll/skse64/skse64/NiInterpolators.cpp b/source/fs.dll/skse64/skse64/NiInterpolators.cpp deleted file mode 100644 index 5a0de918..00000000 --- a/source/fs.dll/skse64/skse64/NiInterpolators.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "NiInterpolators.h" diff --git a/source/fs.dll/skse64/skse64/NiInterpolators.h b/source/fs.dll/skse64/skse64/NiInterpolators.h deleted file mode 100644 index a4df4a8f..00000000 --- a/source/fs.dll/skse64/skse64/NiInterpolators.h +++ /dev/null @@ -1,342 +0,0 @@ -#pragma once - -#include "skse64/NiObjects.h" -#include "skse64/NiTypes.h" - -/**** hierarchy **************************************************************** - * - * NiInterpolator - * NiBlendInterpolator - * NiBlendTransformInterpolator - * NiBlendFloatInterpolator - * NiBlendAccumTransformInterpolator - * BSBlendTreadTransfInterpolator - * NiBlendQuaternionInterpolator - * NiBlendPoint3Interpolator - * NiBlendColorInterpolator - * NiBlendBoolInterpolator - * NiKeyBasedInterpolator - * NiFloatInterpolator - * NiColorInterpolator - * NiPathInterpolator - * NiTransformInterpolator - * BSRotAccumTransfInterpolator - * BSTreadTransfInterpolator - * NiQuaternionInterpolator - * NiPoint3Interpolator - * NiBoolInterpolator - * NiBoolTimelineInterpolator - * NiLookAtInterpolator - * NiBSplineInterpolator - * NiBSplineTransformInterpolator - * NiBSplineCompTransformInterpolator - * NiBSplinePoint3Interpolator - * NiBSplineCompPoint3Interpolator - * NiBSplineFloatInterpolator - * NiBSplineCompFloatInterpolator - * NiBSplineColorInterpolator - * NiBSplineCompColorInterpolator - * - ****/ - -// NiInterpolator and children - -class NiObjectNET; -class NiQuaternion; -class NiPoint3; -class NiColorA; -class NiQuatTransform; -class NiAVObjectPalette; -class NiAnimationKey; -class NiFloatData; -class NiColorData; -class NiPosData; - -// 0C -class NiInterpolator : public NiObject -{ -public: - // work functions - - virtual bool Update(float delta, NiObjectNET * target, NiQuatTransform * data); - virtual bool Update(float delta, NiObjectNET * target, NiColorA * data); - virtual bool Update(float delta, NiObjectNET * target, NiPoint3 * data); - virtual bool Update(float delta, NiObjectNET * target, NiQuaternion * data); - virtual bool Update(float delta, NiObjectNET * target, float * data); - virtual bool Update(float delta, NiObjectNET * target, bool * data); - - // query functions - virtual bool IsBoolValueSupported(void) const; - virtual bool IsFloatValueSupported(void) const; - virtual bool IsQuaternionValueSupported(void) const; - virtual bool IsPoint3ValueSupported(void) const; - virtual bool IsColorAValueSupported(void) const; - virtual bool IsTransformValueSupported(void) const; - - virtual void Collapse(); // ?? - virtual void GetActiveTimeRange(float * start, float * end) const; - virtual void GuaranteeTimeRange(float start, float end); - virtual NiInterpolator * GetSequenceInterpolator(float start, float end); - virtual bool ResolveDependencies(NiAVObjectPalette * palette); - virtual bool SetUpDependencies(void); - virtual bool AlwaysUpdate(void) const; - virtual UInt32 Unk_34(void); - - float m_fLastTime; // 08 -}; - -// 30 -class NiBlendInterpolator : public NiInterpolator -{ -public: - virtual UInt8 AddInterpInfo(NiInterpolator * interpolator, float weight, SInt8 priority, float easeSpinner); - virtual NiPointer RemoveInterpInfo(UInt8 idx); - virtual bool InterpolatorIsCorrectType(NiInterpolator * interpolator); // pure virtual - virtual bool ReallocateArrays(void); - - // 18 - struct InterpArrayItem - { - NiPointer m_spInterpolator; // 00 - float m_fWeight; // 04 - float m_fNormalizedWeight; // 08 - UInt8 m_cPriority; // 0C - float m_fEaseSpinner; // 10 - float m_fUpdateTime; // 14 - }; - - UInt8 m_uFlags; // 0C - UInt8 m_ucArraySize; // 0D - UInt8 m_ucInterpCount; // 0E - UInt8 m_ucSingleIdx; // 0F - SInt8 m_cHighPriority; // 10 - SInt8 m_cNextHighPriority; // 11 - UInt8 pad12[2]; // 12 - - InterpArrayItem * m_pkInterpArray; // 14 - NiInterpolator * m_pkSingleInterpolator; // 18 - - float m_fWeightThreshold; // 1C - float m_fSingleTime; // 20 - float m_fHighSumOfWeights; // 24 - float m_fNextHighSumOfWeights; // 28 - float m_fHighEaseSpinner; // 2C -}; - -// 30 -class NiBlendTransformInterpolator : public NiBlendInterpolator -{ -public: -}; - -// 34 -class NiBlendFloatInterpolator : public NiBlendInterpolator -{ -public: - float m_fFloatValue; // 30 -}; - -// 58 -class NiBlendAccumTransformInterpolator : public NiBlendInterpolator -{ -public: - UInt8 unk30[0x58 - 0x30]; // 30 -}; - -// 34 -class BSBlendTreadTransfInterpolator : public NiBlendInterpolator -{ -public: - float unk30; // 30 -}; - -// 40 -class NiBlendQuaternionInterpolator : public NiBlendInterpolator -{ -public: - NiQuaternion m_kQuaternionValue; // 30 -}; - -// 40 -class NiBlendPoint3Interpolator : public NiBlendInterpolator -{ -public: - NiPoint3 m_kPoint3Value; // 30 - bool m_bValidValue; // 3C -}; - -// 44 -class NiBlendColorInterpolator : public NiBlendInterpolator -{ -public: - NiColorA m_kColorValue; // 30 - bool m_bValidValue; // 40 -}; - -// 34 -class NiBlendBoolInterpolator : public NiBlendInterpolator -{ -public: - bool m_bBoolValue; // 30 -}; - -// 0C -class NiKeyBasedInterpolator : public NiInterpolator -{ -public: - virtual UInt16 GetKeyChannelCount(void) const; - virtual UInt32 GetKeyCount(UInt16 channel) const; - virtual UInt32 GetKeyType(UInt16 channel) const; - virtual UInt32 GetKeyContent(UInt16 channel) const; - virtual NiAnimationKey * GetKeyArray(UInt16 channel) const; - virtual UInt8 GetKeyStride(UInt16 channel) const; - - virtual bool GetChannelPosed(UInt16 channel) const; -}; - -// 18 -class NiFloatInterpolator : public NiKeyBasedInterpolator -{ -public: - float m_fFloatValue; // 0C - NiPointer m_spFloatData; // 10 - UInt32 m_uiLastIdx; // 14 -}; - -// 24 -class NiColorInterpolator : public NiKeyBasedInterpolator -{ -public: - NiColorA m_kColorValue; // 0C - NiPointer m_spColorData; // 1C - UInt32 m_uiLastIdx; // 20 -}; - -// 5C -class NiPathInterpolator : public NiKeyBasedInterpolator -{ -public: - UInt16 m_uFlags; // 0C - UInt8 pad0E[2]; // 0E - UInt32 m_uiLastPathIdx; // 10 - UInt32 m_uiLastPctIdx; // 14 - NiPointer m_spPathData; // 18 - NiPointer m_spPctData; // 1C - mutable float * m_pfPartialLength; // 20 - mutable float m_fTotalLength; // 24 - float m_fBankAngle; // 28 - float m_fSmoothing; // 2C - UInt16 m_sFollowAxis; // 30 - UInt8 pad32[2]; // 32 - float m_fMaxCurvature; // 34 - UInt32 m_eBankDir; // 38 - NiQuaternion m_kRotation; // 3C - NiPoint3 m_kPosition; // 4C - float m_fLastTime; // 58 -}; - -//STATIC_ASSERT(sizeof(NiPathInterpolator) == 0x5C); - -// ### remainder are placeholder - -// 38 -class NiTransformInterpolator : public NiKeyBasedInterpolator -{ -public: -}; - -// 48 -class BSRotAccumTransfInterpolator : public NiTransformInterpolator -{ -public: -}; - -// 24 -class BSTreadTransfInterpolator : public NiKeyBasedInterpolator -{ -public: -}; - -// -class NiQuaternionInterpolator : public NiKeyBasedInterpolator -{ -public: -}; - -// -class NiPoint3Interpolator : public NiKeyBasedInterpolator -{ -public: -}; - -// -class NiBoolInterpolator : public NiKeyBasedInterpolator -{ -public: -}; - -// -class NiBoolTimelineInterpolator : public NiBoolInterpolator -{ -public: -}; - -// -class NiLookAtInterpolator : public NiInterpolator -{ -public: -}; - -// -class NiBSplineInterpolator : public NiInterpolator -{ -public: -}; - -// -class NiBSplineTransformInterpolator : public NiBSplineInterpolator -{ -public: -}; - -// -class NiBSplineCompTransformInterpolator : public NiBSplineTransformInterpolator -{ -public: -}; - -// -class NiBSplinePoint3Interpolator : public NiBSplineInterpolator -{ -public: -}; - -// -class NiBSplineCompPoint3Interpolator : public NiBSplinePoint3Interpolator -{ -public: -}; - -// -class NiBSplineFloatInterpolator : public NiBSplineInterpolator -{ -public: -}; - -// -class NiBSplineCompFloatInterpolator : public NiBSplineFloatInterpolator -{ -public: -}; - -// -class NiBSplineColorInterpolator : public NiBSplineInterpolator -{ -public: -}; - -// -class NiBSplineCompColorInterpolator : public NiBSplineColorInterpolator -{ -public: -}; diff --git a/source/fs.dll/skse64/skse64/NiLight.cpp b/source/fs.dll/skse64/skse64/NiLight.cpp deleted file mode 100644 index 91ed4e4b..00000000 --- a/source/fs.dll/skse64/skse64/NiLight.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/NiLight.h" diff --git a/source/fs.dll/skse64/skse64/NiLight.h b/source/fs.dll/skse64/skse64/NiLight.h deleted file mode 100644 index 0210f49e..00000000 --- a/source/fs.dll/skse64/skse64/NiLight.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include "skse64/NiTypes.h" -#include "skse64/NiObjects.h" - -// D4 -class NiLight : public NiAVObject -{ -public: - virtual ~NiLight(); - - float unkA8; - float unkAC; - float unkB0; - float unkB4; - float unkB8; - float unkBC; - float unkC0; - float unkC4; - float unkC8; - float unkCC; - UInt32 unkD0; -}; - -// D4 -class NiAmbientLight : public NiLight -{ -public: - virtual ~NiAmbientLight(); -}; - -// E0 -class NiPointLight : public NiLight -{ -public: - virtual ~NiPointLight(); - - float unkD4; - float unkD8; - float unkDC; -}; - -// EC -class NiDirectionalLight : public NiLight -{ -public: - virtual ~NiDirectionalLight(); - - float unkD4; - float unkD8; - float unkDC; - float unkE0; - float unkE4; - float unkE8; -}; diff --git a/source/fs.dll/skse64/skse64/NiMaterial.cpp b/source/fs.dll/skse64/skse64/NiMaterial.cpp deleted file mode 100644 index 12692b1d..00000000 --- a/source/fs.dll/skse64/skse64/NiMaterial.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "skse64/NiMaterial.h" -#include "skse64/GameAPI.h" -#include "skse64/GameObjects.h" - -// 96D2EFF152717F366F7EAAA62CAD7EB12855423D+47 -RelocAddr<_CreateShaderMaterial> CreateShaderMaterial(0x013F4670); - -RelocAddr<_CreateFacegenTintMaterial> CreateFacegenTintMaterial(0x013F7170); - -void BSLightingShaderMaterial::SetTextureSet(BSTextureSet * newSet) -{ - textureSet = newSet; -} diff --git a/source/fs.dll/skse64/skse64/NiMaterial.h b/source/fs.dll/skse64/skse64/NiMaterial.h deleted file mode 100644 index 5a608f47..00000000 --- a/source/fs.dll/skse64/skse64/NiMaterial.h +++ /dev/null @@ -1,231 +0,0 @@ -#pragma once - -#include "skse64/NiTextures.h" -#include "skse64/GameTypes.h" - -MAKE_NI_POINTER(BSTextureSet); -MAKE_NI_POINTER(NiTexture); - -// 30 -class BSShaderMaterial -{ -public: - virtual ~BSShaderMaterial(); - virtual BSShaderMaterial * Create(void); - virtual void Copy(BSShaderMaterial * source); // Must be same type - virtual bool Unk_03(void * unk1); - virtual SInt32 Unk_04(void * unk1); - virtual void * Unk_05(void); - virtual UInt32 GetShaderType(void); - virtual UInt32 Unk_07(void); // Always seems to be 2 - - enum { - kShaderType_Default = 0, - kShaderType_EnvironmentMap, - kShaderType_GlowMap, - kShaderType_Parallax, - kShaderType_FaceGen, - kShaderType_FaceGenRGBTint, - kShaderType_HairTint, - kShaderType_ParallaxOcc, - kShaderType_MultiTexLand, - kShaderType_LODLand, - kShaderType_Unknown1, - kShaderType_MultilayerParallax, - kShaderType_TreeAnim, - kShaderType_Unknown2, - kShaderType_MultiIndexTriShapeSnow, - kShaderType_LODObjectsHD, - kShaderType_Eye, - kShaderType_Cloud, - kShaderType_LODLandNoise, - kShaderType_MultiTexLandLODBlend - }; - - UInt32 unk04; // 08 BSIntrusiveRefCounted? - UInt32 unk08; // 0C inited to 0 - UInt32 unk10; // 10 inited to 0 - UInt32 unk14; // 14 inited to 0 - UInt32 unk18; // 18 inited to 0 - float unk1C; // 1C inited to 1.0 - float unk20; // 20 inited to 1.0 - float unk24; // 24 inited to 1.0 - float unk28; // 28 inited to 1.0 - UInt32 unk2C; // 2C inited to -1 flags? -}; - -// 30 -class BSShaderMaterialBase : public BSShaderMaterial -{ -public: - virtual ~BSShaderMaterialBase(); - - virtual void SetTexture(UInt32 index, BSTextureSet * texture, SInt32 unk1); - virtual void ReleaseTextures(void); // ReleaseRefs - virtual void Unk_0A(UInt8 unk1, UInt8 unk2, UInt8 unk3, UInt8 unk4, UInt8 unk5, UInt32 unk6, UInt32 unk7); // AddRefs - virtual void Unk_0B(void * unk1, UInt32 unk2); - virtual void * Unk_0C(void * unk1); - virtual void * Unk_0D(void * unk1); -}; - -class BSEffectShaderMaterial : public BSShaderMaterialBase -{ -public: - virtual ~BSEffectShaderMaterial(); - - float falloffStartAngle; // 30 - float falloffStopAngle; // 34 - float falloffStartOpacity; // 38 - float falloffStopOpacity; // 3C - NiColorA emissiveColor; // 40 - NiTexturePtr unk50; // 50 - NiTexturePtr unk54; // 54 - float softFalloffDepth; // 58 - float emissiveMultiple; // 5C - BSFixedString sourceTexture; // 60 - BSFixedString greyscaleTexture; // 64 -}; - -// A0 -class BSLightingShaderMaterial : public BSShaderMaterialBase -{ -public: - virtual ~BSLightingShaderMaterial(); - - float unk30; // 30 - float unk34; // 34 - float unk38; // 38 - float unk3C; // 3C - float unk40; // 40 - float unk44; // 44 - NiTexturePtr texture1; // 48 - SInt32 unk50; // 50 - UInt32 unk54; // 54 - NiTexturePtr texture2; // 58 - NiTexturePtr texture3; // 60 - NiTexturePtr texture4; // 68 - UInt32 unk70; // 70 - UInt32 unk74; // 74 - BSTextureSetPtr textureSet; // 78 - float alpha; // 80 - float unk58; // 84 - float glossiness; // 88 - float specularStrength; // 8C - float lightingEffect1; // 90 - float lightingEffect2; // 94 - UInt64 unk98; // 98 - - void SetTextureSet(BSTextureSet * textureSet); - - MEMBER_FN_PREFIX(BSLightingShaderMaterial); - DEFINE_MEMBER_FN(CopyFrom, void, 0x013F3AE0, BSLightingShaderMaterial * other); - DEFINE_MEMBER_FN(dtor_base, void, 0x013F3980); -}; -STATIC_ASSERT(sizeof(BSLightingShaderMaterial) == 0xA0); - -class BSLightingShaderMaterialEye : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialEye(); - - NiTexturePtr unkA0; // A0 inited to 0 - NiTexturePtr unkA8; // A8 inited to 0 - - // uses ??_7BSLightingShaderMaterialEye@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F5490); -}; - -class BSLightingShaderMaterialEnvmap : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialEnvmap(); - - NiTexturePtr unkA0; // A0 inited to 0 - NiTexturePtr unkA8; // A8 inited to 0 - - // 7EF3019D0F8B78F82664DFE78C15204CD5C8C2B9+392 - DEFINE_MEMBER_FN(dtor, void, 0x013F4DB0); -}; - -class BSLightingShaderMaterialFacegen : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialFacegen(); - - NiTexturePtr renderedTexture; // A0 inited to 0 - NiTexturePtr unkA8; // A8 inited to 0 - NiTexturePtr unkB0; // B0 inited to 0 - - // uses ??_7BSLightingShaderMaterialFacegen@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F6A80); -}; - -class BSLightingShaderMaterialGlowmap : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialGlowmap(); - - NiTexturePtr glowMap; // A0 - - // uses ??_7BSLightingShaderMaterialGlowmap@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F5B90); -}; - -class BSLightingShaderMaterialParallax : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialParallax(); - - NiTexturePtr unkA0; // A0 - - // uses ??_7BSLightingShaderMaterialParallax@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F6010); -}; - -class BSLightingShaderMaterialMultiLayerParallax : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialMultiLayerParallax(); - - NiTexturePtr unkA0; // A0 - NiTexturePtr unkA8; // A0 - NiTexturePtr unkB0; // A0 - - // uses ??_7BSLightingShaderMaterialMultiLayerParallax@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F84F0); -}; - -class BSLightingShaderMaterialParallaxOcc : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialParallaxOcc(); - - NiTexturePtr unkA0; // A0 - - // uses ??_7BSLightingShaderMaterialParallaxOcc@@6B@ at +17 - DEFINE_MEMBER_FN(dtor, void, 0x013F6490); -}; - -class BSLightingShaderMaterialFacegenTint : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialFacegenTint(); - - NiColor tintColor; // A0 -}; - -class BSLightingShaderMaterialHairTint : public BSLightingShaderMaterial -{ -public: - virtual ~BSLightingShaderMaterialHairTint(); - - NiColor tintColor; // A0 -}; - -// Beware that using this will cause leaks when using SetMaterial -typedef BSShaderMaterialBase * (* _CreateShaderMaterial)(UInt32 shaderType); -extern RelocAddr<_CreateShaderMaterial> CreateShaderMaterial; - -// This is actually vtable+8 but it has no dependency on the 'this' ptr -typedef BSLightingShaderMaterialFacegenTint * (*_CreateFacegenTintMaterial)(); -extern RelocAddr<_CreateFacegenTintMaterial> CreateFacegenTintMaterial; diff --git a/source/fs.dll/skse64/skse64/NiNodes.cpp b/source/fs.dll/skse64/skse64/NiNodes.cpp deleted file mode 100644 index 969ff56c..00000000 --- a/source/fs.dll/skse64/skse64/NiNodes.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "skse64/NiNodes.h" -#include "skse64/GameObjects.h" - -NiBoneNames * NiBoneNames::GetSingleton(void) -{ - // 33EBA690BF2A27ACE16840951CA740822F8A4756+9A - static RelocAddr addr(0x01F59E10); - return addr; -} - -NiNode * NiNode::Create(UInt16 arrBufLen) -{ - void* memory = Heap_Allocate(sizeof(NiNode)); - memset(memory, 0, sizeof(NiNode)); - NiNode* xData = (NiNode*)memory; - xData->ctor(arrBufLen); - return xData; -} - -BSFadeNode * BSFadeNode::Create() -{ - void* memory = Heap_Allocate(sizeof(BSFadeNode)); - memset(memory, 0, sizeof(BSFadeNode)); - BSFadeNode* xData = (BSFadeNode*)memory; - xData->ctor(); - return xData; -} diff --git a/source/fs.dll/skse64/skse64/NiNodes.h b/source/fs.dll/skse64/skse64/NiNodes.h deleted file mode 100644 index 247fc28f..00000000 --- a/source/fs.dll/skse64/skse64/NiNodes.h +++ /dev/null @@ -1,277 +0,0 @@ -#pragma once - -#include "skse64/NiTypes.h" -#include "skse64/NiObjects.h" - -#include "GameCamera.h" - -class BSFaceGenAnimationData; - -// 128 -class NiNode : public NiAVObject -{ -public: - virtual void AttachChild(NiAVObject * obj, bool firstAvail); - virtual void DetachChild(UInt32 unk1, NiAVObject * obj); - virtual void Unk_35(void); - virtual void RemoveChild(NiAVObject * obj); - virtual void Unk_37(void); - virtual void RemoveAt(UInt32 i); - virtual void Unk_39(void); - virtual void Unk_3A(void); - virtual void UpdateUpwardPass(void); - - NiTArray m_children; // 110 - - static NiNode * Create(UInt16 arrBufLen = 0); - - DEFINE_MEMBER_FN_1(ctor, NiNode*, 0x00C7FD70, UInt16 arrBufLen); -}; -STATIC_ASSERT(sizeof(NiNode) == 0x128); - -// 158 -class BSFadeNode : public NiNode -{ -public: - UInt32 unkB8[(0x158 - 0x128) >> 2]; - - static BSFadeNode * Create(); - - // 905B699D46B52EE8B3BD44B9DAFBC2F728A310B5+81 - DEFINE_MEMBER_FN_0(ctor, BSFadeNode *, 0x013B6440); -}; -STATIC_ASSERT(sizeof(BSFadeNode) == 0x158); - -// EC -class BSFaceGenNiNode : public NiNode -{ -public: - UInt32 unkB8; - UInt32 unkBC; - UInt32 unkC0; - UInt32 unkC4; - float unkC8; - UInt32 unkCC; - UInt32 unkD0; - UInt32 unkD4; - float unkD8; - BSFaceGenAnimationData * animData; - float unkE0; - UInt32 handle; // handle - UInt32 unkE8; - - enum { - kAdjustType_Unk0 = 0, - kAdjustType_Unk1 = 1, - kAdjustType_Unk2 = 2, - kAdjustType_Neck = 3, - }; - - MEMBER_FN_PREFIX(BSFaceGenNiNode); - DEFINE_MEMBER_FN(AdjustHeadMorph, void, 0x003F1300, UInt32 unk04, UInt32 unk08, float delta); -}; - -//STATIC_ASSERT(sizeof(BSFaceGenNiNode) == 0xEC); -//STATIC_ASSERT(offsetof(BSFaceGenNiNode, animData) == 0xDC); -//STATIC_ASSERT(offsetof(BSFaceGenNiNode, handle) == 0xE4); - - -class NiSwitchNode : public NiNode -{ -public: - // Nothing yet -}; - -// 110 ? -class NiCullingProcess -{ -public: - virtual ~NiCullingProcess(); - virtual void Unk_01(void); // 01 - 10 unused - virtual void Unk_02(void); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - virtual void Unk_08(void); - virtual void Unk_09(void); - virtual void Unk_0A(void); - virtual void Unk_0B(void); - virtual void Unk_0C(void); - virtual void Unk_0D(void); - virtual void Unk_0E(void); - virtual void Unk_0F(void); - virtual void Unk_10(void); - virtual void Unk_11(void); - virtual void Unk_12(void); - virtual void Unk_13(void); - - UInt8 unk04; // 04 Perhaps refcount? - UInt8 pad05[3]; - UInt32 visibleArray; // 08 NiVisibleArray * - UInt32 camera; // 0C NiCamera * - UInt32 fustrum[(0x30 - 0x10) >> 2]; // 10 NiFustrum - UInt32 fustrumPlanes[(0x90 - 0x30) >> 2]; // 2C NiFrustumPlanes - UInt32 activePlanes; // 90 - UInt32 unk94; // 94 - UInt32 unk98; // 98 - UInt32 fustrumPlanes2[(0x100 - 0x9C) >> 2]; // 9C NiFrustumPlanes - UInt32 activePlanes2; // 100 - UInt32 unk104; // 104 - UInt32 unk108; // 108 - UInt32 unk10C; // 10C -}; - -//STATIC_ASSERT(sizeof(NiCullingProcess) == 0x110); - -// 170 -class BSCullingProcess : public NiCullingProcess -{ -public: - virtual ~BSCullingProcess(); - virtual void Unk_14(void); - virtual void Unk_15(void); - virtual void Unk_16(void); - virtual void Unk_17(void); - virtual void Unk_18(void); - - UInt32 unk110[(0x170 - 0x110) >> 2]; -}; - -//STATIC_ASSERT(sizeof(BSCullingProcess) == 0x170); - -// 238 -class LocalMapCullingProcess : public BSCullingProcess -{ -public: - LocalMapCamera localMapCamera; // 170 - void * shaderAccumulator; // 1BC - BSRenderTargetGroup * localMapTexture; // 1C0 - UInt32 unk1C4[(0x230 - 0x1C4) >> 2]; // 1C4 - UInt32 width; // 230 - UInt32 height; // 234 - NiNode * niNode; // 238 - - MEMBER_FN_PREFIX(LocalMapCullingProcess); -}; - -//STATIC_ASSERT(offsetof(LocalMapCullingProcess, localMapCamera) == 0x170); -//STATIC_ASSERT(offsetof(LocalMapCullingProcess, niNode) == 0x238); - -class NiBoneNames -{ -public: - static NiBoneNames * GetSingleton(void); - - BSFixedString root; // 00 - BSFixedString npc; // 04 - BSFixedString head; // 08 - BSFixedString pelvis; // 0C - BSFixedString spine0; // 10 - BSFixedString spine1; // 14 - BSFixedString spine2; // 18 - BSFixedString lFoot; // 1C - BSFixedString rFoot; // 20 - BSFixedString lCalf; // 24 - BSFixedString rCalf; // 28 - BSFixedString specialIdleCast; // 2C - BSFixedString specialIdleAreaEffect; // 30 - BSFixedString attachSound; // 34 - BSFixedString soundMarker; // 38 - BSFixedString skinnedDecalNode; // 3C - BSFixedString decalNode; // 40 - BSFixedString modelSwapNode; // 44 - BSFixedString open; // 48 - BSFixedString close; // 4C - BSFixedString dvpg; // 50 - BSFixedString prn; // 54 - BSFixedString weapon; // 58 - BSFixedString weaponSword; // 5C - BSFixedString weaponDagger; // 60 - BSFixedString weaponAxe; // 64 - BSFixedString weaponMace; // 68 - BSFixedString shield; // 6C - BSFixedString weaponBack; // 70 - BSFixedString weaponBow; // 74 - BSFixedString quiver; // 78 - BSFixedString editorMarker; // 7C - BSFixedString editorMarker0; // 80 - BSFixedString editorMarker1; // 84 - BSFixedString editorMarker2; // 88 - BSFixedString arrowQuiver; // 8C - BSFixedString markerSource; // 90 - BSFixedString markerTarget; // 94 - BSFixedString attachLight; // 98 - BSFixedString skin; // 9C - BSFixedString faceGenEars; // A0 - BSFixedString unequip; // A4 - BSFixedString laserSight; // A8 - BSFixedString aimSight; // AC - BSFixedString decal; // B0 - BSFixedString permanentDecal; // B4 - BSFixedString grabLeft; // B8 - BSFixedString grabRight; // BC - BSFixedString arrow0; // C0 - BSFixedString arrowBone; // C4 - BSFixedString faceGenNiNodeSkinned; // C8 - BSFixedString entryPoint; // CC - BSFixedString lUpperArm; // D0 - BSFixedString lForearm; // D4 - BSFixedString rUpperArm; // D8 - BSFixedString lookNode; // DC - BSFixedString tail1; // E0 - BSFixedString tailHub; // E4 - BSFixedString npcPelvis; // E8 - BSFixedString talking; // EC - BSFixedString camera1st; // F0 - BSFixedString camera3rd; // F4 - BSFixedString headMeshForExport; // F8 - BSFixedString pinnedLimb; // FC - BSFixedString backpack; // 100 - BSFixedString projectileNode; // 104 - BSFixedString blastRadiusNode; // 108 - BSFixedString torchFire; // 10C - BSFixedString lightOn; // 110 - BSFixedString npcCom; // 114 - BSFixedString skinAttachment; // 118 - BSFixedString npcNeck; // 11C - BSFixedString nifRound; // 120 - BSFixedString scb; // 124 - BSFixedString upperBody; // 128 - BSFixedString lightOff; // 12C - BSFixedString headMagicNode; // 130 - BSFixedString lMagicNode; // 134 - BSFixedString rMagicNode; // 138 - BSFixedString magicLeft; // 13C - BSFixedString magicRight; // 140 - BSFixedString magicOther; // 144 - BSFixedString cameraControl; // 148 - BSFixedString npcRoot; // 14C - BSFixedString saddleBone; // 150 - BSFixedString perchFireNode; // 154 - BSFixedString animationGraphVariables[101]; -}; - -// this is just part of NiBoneNames starting at offset 0xB0 -class NiWeaponNodes -{ -public: - enum - { - kTypeWeapon1 = 0, - kTypeWeaponSword, - kTypeWeaponDagger, - kTypeWeaponAxe, - kTypeWeaponMace, - kTypeWeaponBack1, - kTypeWeaponBack2, - kTypeWeaponBow1, - kTypeWeapon2, - kTypeWeaponBow2, - kTypeUnknown, - kNumTypes - }; - - BSFixedString nodes[kNumTypes]; -}; diff --git a/source/fs.dll/skse64/skse64/NiObjects.cpp b/source/fs.dll/skse64/skse64/NiObjects.cpp deleted file mode 100644 index e27c98a1..00000000 --- a/source/fs.dll/skse64/skse64/NiObjects.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "skse64/NiObjects.h" -#include "skse64/NiExtraData.h" - -// 2789403034E226069B9EC04A8AC7BD367AF61384+BC -RelocPtr g_worldToCamMatrix(0x02FE8840); -// 2789403034E226069B9EC04A8AC7BD367AF61384+13E -RelocPtr> g_viewPort(0x02FE9DE8); - -RelocAddr<_WorldPtToScreenPt3_Internal> WorldPtToScreenPt3_Internal(0x00C8F5B0); - -RelocAddr<_NiAllocate> NiAllocate(0x00C4AF80); -RelocAddr<_NiFree> NiFree(0x00C4B220); - -void NiRefObject::IncRef(void) -{ - InterlockedIncrement(&m_uiRefCount); -} - -bool NiRefObject::Release(void) -{ - return InterlockedDecrement(&m_uiRefCount) == 0; -} - -void NiRefObject::DecRef(void) -{ - if (Release()) - DeleteThis(); -} - -int ExtraDataCompare(const void * ls, const void * rs) -{ - return (int)((*(NiExtraData**)ls)->m_pcName - (*(NiExtraData**)rs)->m_pcName); -} - -void NiObjectNET::AddExtraData(NiExtraData * extraData) -{ - extraData->IncRef(); - - // No capacity, allocate and grow - UInt32 newSize = 0; - if (m_extraDataCapacity == 0) { - newSize = 1; - NiExtraData ** extraDataList = (NiExtraData **)Heap_Allocate(newSize * sizeof(NiExtraData*)); - extraDataList[0] = extraData; - m_extraData = extraDataList; - m_extraDataCapacity = newSize; - m_extraDataLen = m_extraDataCapacity; - return; - } - - // Reached capacity, reallocate and grow - if (m_extraDataLen == m_extraDataCapacity) { - newSize = (m_extraDataCapacity * 2) + 1; - NiExtraData ** extraDataList = (NiExtraData **)Heap_Allocate(newSize * sizeof(NiExtraData*)); - // Copy the entries over - memcpy_s(extraDataList, newSize * sizeof(NiExtraData*), m_extraData, m_extraDataLen * sizeof(NiExtraData*)); - // Zero the allocated entries - for (UInt16 i = m_extraDataLen; i < newSize; i++) - extraDataList[i] = NULL; - - Heap_Free(m_extraData); - m_extraData = extraDataList; - m_extraDataCapacity = newSize; - } - - m_extraData[m_extraDataLen++] = extraData; - qsort(m_extraData, m_extraDataLen, sizeof(NiExtraData*), ExtraDataCompare); -} - -SInt32 NiObjectNET::GetIndexOf(NiExtraData * extraData) -{ - if (!extraData) - return -1; - if (!extraData->m_pcName) - return -1; - - SInt16 min = 0; - SInt16 max = (SInt16)m_extraDataLen - 1; - while (max >= min) { // Iterative binary search - SInt16 mid = (min + max) >> 1; - if (m_extraData[mid]->m_pcName == extraData->m_pcName) - return mid; // Found entry - else if (m_extraData[mid]->m_pcName < extraData->m_pcName) - min = mid + 1; - else - max = mid - 1; - } - - return -1; -} - -bool NiObjectNET::RemoveExtraData(NiExtraData * extraData) -{ - SInt32 index = GetIndexOf(extraData); - if (index >= 0) { // Remove the entry - extraData->DecRef(); - // Shift everything up - for (UInt16 i = index; i < m_extraDataLen - 1; i++) - m_extraData[i] = m_extraData[i + 1]; - // Remove the duplicate tail entry - m_extraData[--m_extraDataLen] = NULL; - if (m_extraDataLen == 0) - { - Heap_Free(m_extraData); - m_extraData = NULL; - m_extraDataLen = 0; - m_extraDataCapacity = 0; - } - return true; - } - - return false; -} - -// This should be a BSFixedString before passing to this -NiExtraData * NiObjectNET::GetExtraData(BSFixedString name) -{ - SInt16 min = 0; - SInt16 max = (SInt16)m_extraDataLen - 1; - - while (max >= min) { // Iterative binary search - SInt16 mid = (min + max) >> 1; - if (m_extraData[mid]->m_pcName == name.data) - return m_extraData[mid]; - else if (m_extraData[mid]->m_pcName < name.data) - min = mid + 1; - else - max = mid - 1; - } - - return NULL; -} diff --git a/source/fs.dll/skse64/skse64/NiObjects.h b/source/fs.dll/skse64/skse64/NiObjects.h deleted file mode 100644 index 5733d216..00000000 --- a/source/fs.dll/skse64/skse64/NiObjects.h +++ /dev/null @@ -1,359 +0,0 @@ -#pragma once - -#include "skse64/NiRTTI.h" -#include "skse64/NiTypes.h" -#include "skse64_common/Utilities.h" -#include "skse64/GameTypes.h" - -// NiRefObject/NiObject and important children -// generally other children should go in other files -// especially if they can be grouped - -class NiCloningProcess; -class NiStream; -class NiObjectGroup; -class NiExtraData; -class NiTimeController; -class NiNode; -class NiGeometry; -class BSGeometry; -class NiRenderedTexture; -class NiSwitchNode; -class NiTriBasedGeom; -class NiTriShape; -class NiTriStrips; -class BSSegmentedTriShape; -class NiRenderTargetGroup; -class NiProperty; -class NiSourceTexture; -class BSTriShape; -class TESObjectCELL; -class TESModelTri; -class BSFaceGenMorphData; -class TESObjectREFR; - -extern RelocPtr g_worldToCamMatrix; -extern RelocPtr> g_viewPort; - -typedef bool (* _WorldPtToScreenPt3_Internal)(float * worldToCamMatrix, NiRect * port, NiPoint3 * p_in, float * x_out, float * y_out, float * z_out, float zeroTolerance); -extern RelocAddr<_WorldPtToScreenPt3_Internal> WorldPtToScreenPt3_Internal; - -typedef void * (*_NiAllocate)(size_t size); -extern RelocAddr<_NiAllocate> NiAllocate; - -typedef void(*_NiFree)(void * ptr); -extern RelocAddr<_NiFree> NiFree; - -// 10 -class NiRefObject -{ -public: - NiRefObject(); - virtual ~NiRefObject(); - - virtual void DeleteThis(void); // calls virtual dtor - - void IncRef(void); - void DecRef(void); - bool Release(void); - -// void ** _vtbl; // 00 - volatile SInt32 m_uiRefCount; // 08 - UInt32 pad0C; // 0C -}; - -// ### not all of this is verified, I'm just assuming that little has changed from other -// ### games using previous versions of NetImmerse that have released .pdb files for reference - -// 10 -class NiObject : public NiRefObject -{ -public: - // standard NetImmerse - virtual NiRTTI* GetRTTI(void); - - // then a bunch of attempts to avoid dynamic_cast? - // unverified, do not use - virtual NiNode * GetAsNiNode(void); - virtual NiSwitchNode * GetAsNiSwitchNode(void); - virtual void * Unk_05(void); - virtual UInt32 Unk_06(void); - virtual BSGeometry * GetAsBSGeometry(void); - virtual void * Unk_08(void); - virtual BSTriShape * GetAsBSTriShape(void); - virtual void * Unk_0A(void); - virtual void * Unk_0B(void); - virtual void * Unk_0C(void); - virtual NiGeometry * GetAsNiGeometry(void); - virtual NiTriBasedGeom * GetAsNiTriBasedGeom(void); - virtual NiTriShape * GetAsNiTriShape(void); - virtual void * Unk_10(void); - virtual void * Unk_11(void); - virtual void * Unk_12(void); - - // SE: these 4 were added - virtual UInt32 Unk_13(void); - virtual UInt32 Unk_14(void); - virtual UInt32 Unk_15(void); - virtual UInt32 Unk_16(void); - - // then back to NetImmerse - virtual NiObject * CreateClone(NiCloningProcess cloner); - - virtual void LoadBinary(NiStream * stream); - virtual void LinkObject(NiStream * stream); - virtual bool RegisterStreamables(NiStream * stream); - virtual void SaveBinary(NiStream * stream); - virtual bool IsEqual(NiObject * object); - - // viewer appears to be disabled sadly - // why did you do that? it was really useful for figuring out class data - // and it's not like it totally bloated up the executa... er never mind - - virtual void ProcessClone(NiCloningProcess * cloner); - virtual void PostLinkObject(NiStream * stream); - virtual bool StreamCanSkip(void); - virtual const /*NiRTTI*/void * GetStreamableRTTI(void) const; - virtual UInt32 GetBlockAllocationSize(void) const; - virtual NiObjectGroup * GetGroup(void) const; - virtual void SetGroup(NiObjectGroup * group); - - // begin bethesda extensions? possibly just stuff we can't match up - virtual UInt32 Unk_20(void); // SE: function 24 - - - MEMBER_FN_PREFIX(NiObject); - DEFINE_MEMBER_FN(DeepCopy, NiStream *, 0x00C7AEB0, NiObject ** result); -}; -STATIC_ASSERT(sizeof(NiObject) == 0x10); - -// 30 -class NiObjectNET : public NiObject -{ -public: - const char * m_name; // 10 - - NiTimeController * m_controller; // 18 next pointer at +0x30 - - NiExtraData ** m_extraData; // 20 extra data - UInt16 m_extraDataLen; // 28 max valid entry - UInt16 m_extraDataCapacity; // 2A array len - UInt32 pad2C; - - // UNTESTED - void AddExtraData(NiExtraData * extraData); - bool RemoveExtraData(NiExtraData * extraData); - SInt32 GetIndexOf(NiExtraData * extraData); - NiExtraData * GetExtraData(BSFixedString name); -}; -STATIC_ASSERT(sizeof(NiObjectNET) == 0x30); - -// 110 -class NiAVObject : public NiObjectNET -{ -public: - enum - { - kFlag_SelectiveUpdate = 0x00000002, - kFlag_UpdatePropertyControllers = 0x00000004, - - kFlag_SelectiveUpdateRigid = 0x00000010, - - kFlag_OverrideSelectiveTransforms = 0x00000080, - }; - - struct ControllerUpdateContext - { - enum - { - kDirty = 1 << 0, - }; - - float delta; - UInt32 flags; - }; - - virtual void UpdateControllers(ControllerUpdateContext * ctx); // calls controller vtbl+0x8C - virtual void UpdateNodeBound(ControllerUpdateContext * ctx); - - // SE: one of these 4 functions was deleted. Until figuring out which one, assuming it was Unk_26 - virtual void ApplyTransform(NiMatrix33 * mtx, NiPoint3 * translate, bool postTransform); - virtual void SetPropertyState(NiProperty * prop); - virtual void Unk_25(UInt32 arg0); // SE: function 29 - //virtual void Unk_26(UInt32 arg0); - - - virtual NiAVObject * GetObjectByName(const char ** name); // BSFixedString? alternatively BSFixedString is a typedef of a netimmerse type - virtual void SetSelectiveUpdateFlags(bool * selectiveUpdate, bool selectiveUpdateTransforms, bool * rigid); - virtual void UpdateDownwardPass(ControllerUpdateContext * ctx, void *unk1); // SE: changed unk to void* - virtual void UpdateSelectedDownwardPass(ControllerUpdateContext * ctx, void *unk1); // SE: changed unk to void* - virtual void UpdateRigidDownwardPass(ControllerUpdateContext * ctx, void *unk1); // SE: changed unk to void* - virtual void UpdateWorldBound(void); - virtual void UpdateWorldData(ControllerUpdateContext * ctx); // SE: function 30 (vtable+0x180) - virtual void UpdateNoControllers(ControllerUpdateContext * ctx); - virtual void UpdateDownwardPassTempParent(NiNode * parent, ControllerUpdateContext * ctx); - virtual void Unk_30(void); // calls virtual function on parent - SE: function 33 - - // SE: one of these functions was deleted. Doesn't matter which, they are unks, assuming Unk_32. - virtual void Unk_31(UInt32 arg0); // SE: function 34 - //virtual void Unk_32(UInt32 arg0); - - NiNode * m_parent; // 30 - UInt32 unk038; // 38 - New in SE, init'd to FFFFFFFF - UInt32 pad03C; // 3C - NiAVObject * unk040; // 40 - NiTransform m_localTransform; // 48 - NiTransform m_worldTransform; // 7C - NiTransform m_oldWorldTransform; // B0 - SE: this one is new - float unkE4; // E4 - float unkE8; // E8 - float unkEC; // EC - float unkF0; // F0 - UInt32 m_flags; // F4 - bitfield - TESObjectREFR* m_owner; // F8 - float unk100; // 100 - New in SE? init's to 1.0 - UInt32 unk104; // 104 - New in SE? init'd to 0 - UInt8 unk108; // 108 - UInt8 unk109; // 109 - bitfield - UInt8 pad10A[6]; // 10A - - MEMBER_FN_PREFIX(NiAVObject); - // A5B2FC7D42E72BA4F6A679BAC0BAE17C12A4AFE1+E3 - DEFINE_MEMBER_FN(UpdateNode, void, 0x00C7EDA0, ControllerUpdateContext * ctx); -}; -STATIC_ASSERT(offsetof(NiAVObject, m_localTransform) == 0x48); -STATIC_ASSERT(offsetof(NiAVObject, m_worldTransform) == 0x7C); -STATIC_ASSERT(sizeof(NiAVObject) == 0x110); - - -MAKE_NI_POINTER(NiAVObject); - -// SE: TODO this class needs update, if it still exists -// Bethesda class, unknown name -class BSRenderTargetGroup : public NiObject -{ -public: - virtual ~BSRenderTargetGroup(); - - NiRenderTargetGroup * unk08[6]; // 08 - UInt32 unk20; // 20 - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C inited to FFFFFFFF - NiRenderedTexture * renderedTexture[4]; // 30 -}; - -// 20 -class BSFaceGenModel : public NiRefObject -{ -public: - struct Data10 - { - UInt32 unk00; // 00 - UInt32 pad04; // 04 - NiAVObject * unk08; // 08 - NiAVObject * unk10; // 10 - void * unk18; // 18 - BSFaceGenMorphData * unk20; // 20 - }; - - Data10 * unk10; // 10 - UInt32 unk18; // 18 - UInt32 pad1C; // 1C - - MEMBER_FN_PREFIX(BSFaceGenModel); - DEFINE_MEMBER_FN(ctor, void, 0x003EC1A0); - DEFINE_MEMBER_FN(CopyFrom, void, 0x003EC240, BSFaceGenModel * other); - DEFINE_MEMBER_FN(SetModelData, bool, 0x003EC9C0, const char * meshPath, void * unk1, UInt8 unk2); - DEFINE_MEMBER_FN(ApplyMorph, UInt8, 0x003EC820, BSFixedString * morphName, TESModelTri * triModel, NiAVObject ** headNode, float relative, UInt8 unk1); - DEFINE_MEMBER_FN(ApplyRaceMorph, UInt8, 0x003EC6D0, BSFixedString* morphName, TESModelTri* triModel, NiAVObject** headNode, float relative, UInt8 unk1); -}; - -// 18 -class BSFaceGenMorphData : public NiRefObject -{ -public: - void * unk10; // 10 - - - MEMBER_FN_PREFIX(BSFaceGenMorphData); - DEFINE_MEMBER_FN(ApplyMorph, UInt8, 0x003EF6C0, const char ** morphName, NiAVObject * faceTrishape, float relative, UInt8 unk2); -}; - -// 20 -class BSFaceGenModelMap : public NiRefObject -{ -public: - struct Entry - { - BSFaceGenModel * unk00; // 00 - UInt64 unk08; // 08 - }; - - Entry unk10; // 10 -}; - -// A0 -class LoadedAreaBound : public NiRefObject -{ -public: - virtual ~LoadedAreaBound(); - - UInt64 unk10[6]; // 10 - UInt64 unk40; // 40 - TESObjectCELL * cell; // 48 - UInt32 unk50; - UInt32 unk54; - UInt32 unk58; - UInt32 unk5C; - void* unk60; // 60 - inited 0xDEADBEEF - UInt64 unk68; - UInt64 unk70; - NiPoint3 boundsMax; // 78 - NiPoint3 boundsMin; // 84 - float unk90; // 90 - init'd from constructor arg (xmm1) - float unk94; // 94 - init'd from constructor arg (xmm2) - float unk98; // 98 - init'd from constructor arg (xmm3) - float unk9C; // 9C - init'd from constructor last arg (stack) -}; -STATIC_ASSERT(sizeof(LoadedAreaBound) == 0xA0); -STATIC_ASSERT(offsetof(LoadedAreaBound, boundsMax) == 0x78); - -// 68 -class BSFaceGenMorphDataHead : public BSFaceGenMorphData -{ -public: - - UInt8 unk18[0x50 - 0x18]; // 18 - 18-4A -> init'd to FF - - UInt64 unk50; - UInt64 unk58; - UInt32 unk60; -}; -STATIC_ASSERT(sizeof(BSFaceGenMorphDataHead) == 0x68); - -// 20 -class BSFaceGenMorphDataHair : public BSFaceGenMorphData -{ -public: - UInt32 unk18; - UInt32 pad; -}; -STATIC_ASSERT(sizeof(BSFaceGenMorphDataHair) == 0x20); - -// 188 -class NiCamera : public NiAVObject -{ -public: - float m_aafWorldToCam[4][4]; // 110 - NiFrustum m_frustum; // 150 - float m_fMinNearPlaneDist; // 16C - float m_fMaxFarNearRatio; // 170 - NiRect m_kPort; // 174 - float m_fLODAdjust; // 184 - - bool WorldPtToScreenPt3(NiPoint3 * p_in, float * x_out, float * y_out, float * z_out, float zeroTolerance = 1e-5); -}; -STATIC_ASSERT(offsetof(NiCamera, m_frustum) == 0x150); -STATIC_ASSERT(offsetof(NiCamera, m_fMinNearPlaneDist) == 0x16C); -STATIC_ASSERT(offsetof(NiCamera, m_fLODAdjust) == 0x184); diff --git a/source/fs.dll/skse64/skse64/NiProperties.cpp b/source/fs.dll/skse64/skse64/NiProperties.cpp deleted file mode 100644 index 60d17535..00000000 --- a/source/fs.dll/skse64/skse64/NiProperties.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/NiProperties.h" diff --git a/source/fs.dll/skse64/skse64/NiProperties.h b/source/fs.dll/skse64/skse64/NiProperties.h deleted file mode 100644 index d1fa3a46..00000000 --- a/source/fs.dll/skse64/skse64/NiProperties.h +++ /dev/null @@ -1,207 +0,0 @@ -#pragma once - -#include "skse64/NiObjects.h" -#include "skse64/NiMaterial.h" - -class NiProperty : public NiObjectNET -{ -public: - virtual ~NiProperty(); - - enum - { - kTypeAlpha = 0, - kTypeShade = 1 - }; - - virtual SInt32 GetType(void); -}; - -class NiAlphaProperty : public NiProperty -{ -public: - virtual ~NiAlphaProperty(); - - UInt16 alphaFlags; // 18 - UInt16 alphaThreshold; // 1A -}; - -class NiShadeProperty : public NiProperty -{ -public: - virtual ~NiShadeProperty(); - - virtual void Unk_23(void); -}; - -class BSShaderProperty : public NiShadeProperty -{ -public: - virtual ~BSShaderProperty(); - - virtual void Unk_24(UInt32 unk1, UInt32 unk2, UInt32 unk3); - virtual void Unk_25(UInt32 unk1, UInt32 unk2, UInt32 unk3); // ?? - virtual UInt32 Unk_26(void); // ret 1 - virtual void Unk_27(UInt32 unk1); // ?? - virtual bool Unk_28(UInt32 unk1); // ?? - virtual void Unk_29(float unk1); // set (material + 0x54) - virtual float Unk_2A(void); // get (material + 0x54) - virtual void Unk_2B(void); // ?? - virtual void * Unk_2C(void); // ?? - virtual UInt32 Unk_2D(void); // ?? - virtual UInt32 Unk_2E(void); // type of somekind? - virtual UInt32 Unk_2F(void); // ?? - virtual NiSourceTexture * Unk_30(void); // Gets first source texture from material - virtual UInt32 Unk_31(void); // ?? - virtual bool Unk_32(void); // ?? - virtual bool Unk_33(UInt32 unk1, UInt32 unk2, UInt32 unk3); // Texture related - virtual UInt32 Unk_34(UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4, UInt32 unk5, UInt32 unk6); - virtual UInt32 Unk_35(void); // Flags? - virtual SInt32 Unk_36(void); // ?? - - enum ShaderFlags1 - { - kSLSF1_Specular = 1 << 0, - kSLSF1_Skinned = 1 << 1, - kSLSF1_Temp_Refraction = 1 << 2, - kSLSF1_Vertex_Alpha = 1 << 3, - kSLSF1_Greyscale_To_PaletteColor = 1 << 4, - kSLSF1_Greyscale_To_PaletteAlpha = 1 << 5, - kSLSF1_Use_Falloff = 1 << 6, - kSLSF1_Environment_Mapping = 1 << 7, - kSLSF1_Recieve_Shadows = 1 << 8, - kSLSF1_Cast_Shadows = 1 << 9, - kSLSF1_Facegen_Detail_Map = 1 << 10, - kSLSF1_Parallax = 1 << 11, - kSLSF1_Model_Space_Normals = 1 << 12, - kSLSF1_Non_Projective_Shadows = 1 << 13, - kSLSF1_Landscape = 1 << 14, - kSLSF1_Refraction = 1 << 15, - kSLSF1_Fire_Refraction = 1 << 16, - kSLSF1_Eye_Environment_Mapping = 1 << 17, - kSLSF1_Hair_Soft_Lighting = 1 << 18, - kSLSF1_Screendoor_Alpha_Fade = 1 << 19, - kSLSF1_Localmap_Hide_Secret = 1 << 20, - kSLSF1_FaceGen_RGB_Tint = 1 << 21, - kSLSF1_Own_Emit = 1 << 22, - kSLSF1_Projected_UV = 1 << 23, - kSLSF1_Multiple_Textures = 1 << 24, - kSLSF1_Remappable_Textures = 1 << 25, - kSLSF1_Decal = 1 << 26, - kSLSF1_Dynamic_Decal = 1 << 27, - kSLSF1_Parallax_Occlusion = 1 << 28, - kSLSF1_External_Emittance = 1 << 29, - kSLSF1_Soft_Effect = 1 << 30, - kSLSF1_ZBuffer_Test = 1 << 31 - }; - - enum ShaderFlags2 - { - kSLSF2_ZBuffer_Write = 1 << 0, - kSLSF2_LOD_Landscape = 1 << 1, - kSLSF2_LOD_Objects = 1 << 2, - kSLSF2_No_Fade = 1 << 3, - kSLSF2_Double_Sided = 1 << 4, - kSLSF2_Vertex_Colors = 1 << 5, - kSLSF2_Glow_Map = 1 << 6, - kSLSF2_Assume_Shadowmask = 1 << 7, - kSLSF2_Packed_Tangent = 1 << 8, - kSLSF2_Multi_Index_Snow = 1 << 9, - kSLSF2_Vertex_Lighting = 1 << 10, - kSLSF2_Uniform_Scale = 1 << 11, - kSLSF2_Fit_Slope = 1 << 12, - kSLSF2_Billboard = 1 << 13, - kSLSF2_No_LOD_Land_Blend = 1 << 14, - kSLSF2_EnvMap_Light_Fade = 1 << 15, - kSLSF2_Wireframe = 1 << 16, - kSLSF2_Weapon_Blood = 1 << 17, - kSLSF2_Hide_On_Local_Map = 1 << 18, - kSLSF2_Premult_Alpha = 1 << 19, - kSLSF2_Cloud_LOD = 1 << 20, - kSLSF2_Anisotropic_Lighting = 1 << 21, - kSLSF2_No_Transparency_Multisampling = 1 << 22, - kSLSF2_Unused01 = 1 << 23, - kSLSF2_Multi_Layer_Parallax = 1 << 24, - kSLSF2_Soft_Lighting = 1 << 25, - kSLSF2_Rim_Lighting = 1 << 26, - kSLSF2_Back_Lighting = 1 << 27, - kSLSF2_Unused02 = 1 << 28, - kSLSF2_Tree_Anim = 1 << 29, - kSLSF2_Effect_Lighting = 1 << 30, - kSLSF2_HD_LOD_Objects = 1 << 31 - }; - - UInt32 unk18; // 30 - UInt32 unk1C; // 34 - UInt32 shaderFlags1; // 38 - UInt32 shaderFlags2; // 3C - UInt64 unk40; // 40 - UInt64 unk48; // 48 - UInt64 unk50; // 50 - UInt64 unk58; // 58 - UInt64 unk60; // 60 - UInt64 unk68; // 68 - UInt64 unk70; // 70 - BSLightingShaderMaterial * material; // 78 - UInt32 unk80; // 80 -}; -STATIC_ASSERT(offsetof(BSShaderProperty, material) == 0x78); - -// 100 -class BSEffectShaderProperty : public BSShaderProperty -{ -public: - virtual ~BSEffectShaderProperty(); - - UInt64 unk88; // 88 - UInt64 unk90; // 90 - UInt64 unk98; // 98 -}; - -// 160 -class BSLightingShaderProperty : public BSShaderProperty -{ -public: - virtual ~BSLightingShaderProperty(); - - UInt64 unk88[(0xF0 - 0x88) >> 3]; - NiColor * emissiveColor; // F0 - float emissiveMultiple; // F8 - float unk100; // 100 - float unk104; // 104 - float unk108; // 108 - UInt32 unk10C; // 10C - UInt64 unk110; // 110 - UInt32 unk118; // 118 - float unk11C; // 11C - float unk120; // 120 - float unk124; // 124 - float unk128; // 128 - SInt16 unk12C; // 12C - UInt32 unk130; // 130 - void * unk138; // 138 - UInt32 unk140; // 140 - float unk144; // 144 - UInt32 unk148; // 148 - float unk14C; // 14C - SInt32 unk150; // 150 - UInt32 unk154; // 154 - UInt8 unk158; // 158 - UInt8 pad159[7]; // 159 - - bool HasFlags(UInt8 flag) - { - return (shaderFlags2 & ((UInt64)(1LL << flag) >> 32)) || (shaderFlags1 & (UInt32)(1LL << flag)); - } - - // This function seems to fix weird lighting issues when creating armors internally - // Not particularly sure what it does but it seems to mess around with a lot material flags - MEMBER_FN_PREFIX(BSLightingShaderProperty); - DEFINE_MEMBER_FN(InitializeShader, UInt32, 0x013E9B20, BSGeometry * geometry); - DEFINE_MEMBER_FN(SetMaterial, UInt32, 0x013B8A20, BSLightingShaderMaterial * material, bool unk1); // unk1 usually 1 - DEFINE_MEMBER_FN(SetFlags, UInt64, 0x013B8910, UInt8 unk1, UInt8 unk2); - // InvalidateMaterial was inlined away - - DEFINE_MEMBER_FN(InvalidateTextures, void, 0x013E9ED0, UInt32 unk1); // unk1 usually 0, called after material Releases textures -}; -STATIC_ASSERT(offsetof(BSLightingShaderProperty, emissiveColor) == 0xF0); diff --git a/source/fs.dll/skse64/skse64/NiRTTI.cpp b/source/fs.dll/skse64/skse64/NiRTTI.cpp deleted file mode 100644 index 9effc04f..00000000 --- a/source/fs.dll/skse64/skse64/NiRTTI.cpp +++ /dev/null @@ -1,433 +0,0 @@ -#include "skse64/NiRTTI.h" -#include "skse64/NiObjects.h" - -NiObject * DoNiRTTICast(NiObject * src, const NiRTTI * typeInfo) -{ - uintptr_t typeAddr = uintptr_t(typeInfo) + RelocationManager::s_baseAddr; - if (src) - for (NiRTTI * iter = src->GetRTTI(); iter; iter = iter->parent) - if (iter == (NiRTTI *)typeAddr) - return src; - - return nullptr; -} - -bool IsType(NiRTTI * rtti, const NiRTTI * typeInfo) -{ - uintptr_t typeAddr = uintptr_t(typeInfo) + RelocationManager::s_baseAddr; - if (rtti) - return uintptr_t(rtti) == typeAddr; - - return false; -} - -const NiRTTI * NiRTTI_BGSDecalNode = (NiRTTI *)0x01F5FC20; -const NiRTTI * NiRTTI_BSAnimGroupSequence = (NiRTTI *)0x01F5FD80; -const NiRTTI * NiRTTI_BSSplatterExtraData = (NiRTTI *)0x02F60DD0; -const NiRTTI * NiRTTI_BGSAddonNodeSoundHandleExtra = (NiRTTI *)0x02F61238; -const NiRTTI * NiRTTI_REFRSyncController = (NiRTTI *)0x02F9B250; -const NiRTTI * NiRTTI_bhkCartTether = (NiRTTI *)0x02F9C9B8; -const NiRTTI * NiRTTI_bhkTiltPreventAction = (NiRTTI *)0x02F9C9C8; -const NiRTTI * NiRTTI_bhkWheelAction = (NiRTTI *)0x02F9C9D8; -const NiRTTI * NiRTTI_BSFaceGenAnimationData = (NiRTTI *)0x02F9D018; -const NiRTTI * NiRTTI_BSFaceGenModelExtraData = (NiRTTI *)0x02FA3540; -const NiRTTI * NiRTTI_BSFaceGenBaseMorphExtraData = (NiRTTI *)0x02FA3568; -const NiRTTI * NiRTTI_BSFaceGenMorphData = (NiRTTI *)0x02FA3578; -const NiRTTI * NiRTTI_BSFaceGenMorphDataHead = (NiRTTI *)0x02FA3588; -const NiRTTI * NiRTTI_BSFaceGenMorphDataHair = (NiRTTI *)0x02FA3598; -const NiRTTI * NiRTTI_BSFaceGenNiNode = (NiRTTI *)0x02FA35D8; -const NiRTTI * NiRTTI_BSTempEffect = (NiRTTI *)0x02FA89A8; -const NiRTTI * NiRTTI_BSTempEffectDebris = (NiRTTI *)0x02FA8A28; -const NiRTTI * NiRTTI_BSTempEffectGeometryDecal = (NiRTTI *)0x02FA8A48; -const NiRTTI * NiRTTI_BSTempEffectParticle = (NiRTTI *)0x02FA8AF8; -const NiRTTI * NiRTTI_BSTempEffectSimpleDecal = (NiRTTI *)0x02FA8B20; -const NiRTTI * NiRTTI_BSTempEffectSPG = (NiRTTI *)0x02FA8B38; -const NiRTTI * NiRTTI_bhkAutoWater = (NiRTTI *)0x02FBFF10; -const NiRTTI * NiRTTI_ModelReferenceEffect = (NiRTTI *)0x02FC1768; -const NiRTTI * NiRTTI_ReferenceEffect = (NiRTTI *)0x02FC17A0; -const NiRTTI * NiRTTI_ShaderReferenceEffect = (NiRTTI *)0x02FC17D0; -const NiRTTI * NiRTTI_SummonPlacementEffect = (NiRTTI *)0x02FC1800; -const NiRTTI * NiRTTI_SceneGraph = (NiRTTI *)0x02FD4878; -const NiRTTI * NiRTTI_BSDoorHavokController = (NiRTTI *)0x02FD6598; -const NiRTTI * NiRTTI_BSPlayerDistanceCheckController = (NiRTTI *)0x02FD65A8; -const NiRTTI * NiRTTI_BSSimpleScaleController = (NiRTTI *)0x02FD65B8; -const NiRTTI * NiRTTI_NiObject = (NiRTTI *)0x030AE130; -const NiRTTI * NiRTTI_NiAVObject = (NiRTTI *)0x030AE168; -const NiRTTI * NiRTTI_NiNode = (NiRTTI *)0x030AE188; -const NiRTTI * NiRTTI_NiObjectNET = (NiRTTI *)0x030AE308; -const NiRTTI * NiRTTI_NiLight = (NiRTTI *)0x030AE360; -const NiRTTI * NiRTTI_NiSwitchNode = (NiRTTI *)0x030AE370; -const NiRTTI * NiRTTI_NiStringsExtraData = (NiRTTI *)0x030AE380; -const NiRTTI * NiRTTI_NiCamera = (NiRTTI *)0x030AE390; -const NiRTTI * NiRTTI_BSTriShape = (NiRTTI *)0x030AE3A8; -const NiRTTI * NiRTTI_NiProperty = (NiRTTI *)0x030AE3B8; -const NiRTTI * NiRTTI_NiAlphaProperty = (NiRTTI *)0x030AE3D0; -const NiRTTI * NiRTTI_NiSourceTexture = (NiRTTI *)0x030AF408; -const NiRTTI * NiRTTI_BSFlattenedBoneTree = (NiRTTI *)0x030AF418; -const NiRTTI * NiRTTI_BSDismemberSkinInstance = (NiRTTI *)0x030AF460; -const NiRTTI * NiRTTI_NiStringExtraData = (NiRTTI *)0x030AF470; -const NiRTTI * NiRTTI_NiTimeController = (NiRTTI *)0x030AF480; -const NiRTTI * NiRTTI_NiExtraData = (NiRTTI *)0x030AF4A0; -const NiRTTI * NiRTTI_NiGeometryData = (NiRTTI *)0x030AF4B0; -const NiRTTI * NiRTTI_BSGeometry = (NiRTTI *)0x030AF4C8; -const NiRTTI * NiRTTI_BSDynamicTriShape = (NiRTTI *)0x030AF4E0; -const NiRTTI * NiRTTI_NiPointLight = (NiRTTI *)0x030AF4F0; -const NiRTTI * NiRTTI_NiDefaultAVObjectPalette = (NiRTTI *)0x030AF500; -const NiRTTI * NiRTTI_NiBillboardNode = (NiRTTI *)0x030AF528; -const NiRTTI * NiRTTI_NiDirectionalLight = (NiRTTI *)0x030AF538; -const NiRTTI * NiRTTI_NiCullingProcess = (NiRTTI *)0x030AF548; -const NiRTTI * NiRTTI_NiParticles = (NiRTTI *)0x030AF560; -const NiRTTI * NiRTTI_NiTexture = (NiRTTI *)0x030AF5A0; -const NiRTTI * NiRTTI_NiSkinPartition = (NiRTTI *)0x030AF6B0; -const NiRTTI * NiRTTI_NiVertWeightsExtraData = (NiRTTI *)0x030AF6C0; -const NiRTTI * NiRTTI_NiSkinInstance = (NiRTTI *)0x030AF6D0; -const NiRTTI * NiRTTI_NiAVObjectPalette = (NiRTTI *)0x030AF6E0; -const NiRTTI * NiRTTI_NiGeometry = (NiRTTI *)0x030AF6F0; -const NiRTTI * NiRTTI_NiSkinData = (NiRTTI *)0x030AF720; -const NiRTTI * NiRTTI_NiShadeProperty = (NiRTTI *)0x030AF730; -const NiRTTI * NiRTTI_NiAlphaAccumulator = (NiRTTI *)0x030AF748; -const NiRTTI * NiRTTI_NiAmbientLight = (NiRTTI *)0x030AF758; -const NiRTTI * NiRTTI_NiBinaryExtraData = (NiRTTI *)0x030AF768; -const NiRTTI * NiRTTI_NiBooleanExtraData = (NiRTTI *)0x030AF778; -const NiRTTI * NiRTTI_NiBSPNode = (NiRTTI *)0x030AF788; -const NiRTTI * NiRTTI_NiColorExtraData = (NiRTTI *)0x030AF798; -const NiRTTI * NiRTTI_NiFloatExtraData = (NiRTTI *)0x030AF7A8; -const NiRTTI * NiRTTI_NiFloatsExtraData = (NiRTTI *)0x030AF7B8; -const NiRTTI * NiRTTI_NiFogProperty = (NiRTTI *)0x030AF7C8; -const NiRTTI * NiRTTI_NiIntegerExtraData = (NiRTTI *)0x030AF7E0; -const NiRTTI * NiRTTI_NiIntegersExtraData = (NiRTTI *)0x030AF7F0; -const NiRTTI * NiRTTI_NiParticlesData = (NiRTTI *)0x030AF838; -const NiRTTI * NiRTTI_NiParticleMeshesData = (NiRTTI *)0x030AF848; -const NiRTTI * NiRTTI_NiParticleMeshes = (NiRTTI *)0x030AF858; -const NiRTTI * NiRTTI_NiSpotLight = (NiRTTI *)0x030AF868; -const NiRTTI * NiRTTI_NiSwitchStringExtraData = (NiRTTI *)0x030AF878; -const NiRTTI * NiRTTI_NiTriShapeData = (NiRTTI *)0x030AF888; -const NiRTTI * NiRTTI_NiTriShape = (NiRTTI *)0x030AF898; -const NiRTTI * NiRTTI_NiTriStripsData = (NiRTTI *)0x030AF8A8; -const NiRTTI * NiRTTI_NiTriStrips = (NiRTTI *)0x030AF8B8; -const NiRTTI * NiRTTI_NiVectorExtraData = (NiRTTI *)0x030AF8C8; -const NiRTTI * NiRTTI_BSLODTriShape = (NiRTTI *)0x030AF8F0; -const NiRTTI * NiRTTI_NiAdditionalGeometryData = (NiRTTI *)0x030AF900; -const NiRTTI * NiRTTI_BSSegmentedTriShape = (NiRTTI *)0x030AF918; -const NiRTTI * NiRTTI_NiBackToFrontAccumulator = (NiRTTI *)0x030AF950; -const NiRTTI * NiRTTI_NiAccumulator = (NiRTTI *)0x030AF960; -const NiRTTI * NiRTTI_NiTriBasedGeomData = (NiRTTI *)0x030AF970; -const NiRTTI * NiRTTI_NiTriBasedGeom = (NiRTTI *)0x030AF980; -const NiRTTI * NiRTTI_NiCollisionData = (NiRTTI *)0x030AF9C0; -const NiRTTI * NiRTTI_NiControllerManager = (NiRTTI *)0x030AFA58; -const NiRTTI * NiRTTI_NiControllerSequence = (NiRTTI *)0x030AFA78; -const NiRTTI * NiRTTI_NiBlendInterpolator = (NiRTTI *)0x030AFAA8; -const NiRTTI * NiRTTI_NiMultiTargetTransformController = (NiRTTI *)0x030AFAB8; -const NiRTTI * NiRTTI_BSMultiTargetTreadTransfController = (NiRTTI *)0x030AFAC8; -const NiRTTI * NiRTTI_NiInterpController = (NiRTTI *)0x030AFAD8; -const NiRTTI * NiRTTI_NiFloatData = (NiRTTI *)0x030B08A8; -const NiRTTI * NiRTTI_NiFloatInterpolator = (NiRTTI *)0x030B08B8; -const NiRTTI * NiRTTI_NiColorData = (NiRTTI *)0x030B08C8; -const NiRTTI * NiRTTI_NiColorInterpolator = (NiRTTI *)0x030B08D8; -const NiRTTI * NiRTTI_NiSingleInterpController = (NiRTTI *)0x030B08E8; -const NiRTTI * NiRTTI_NiTransformInterpolator = (NiRTTI *)0x030B08F8; -const NiRTTI * NiRTTI_NiPathInterpolator = (NiRTTI *)0x030B0908; -const NiRTTI * NiRTTI_NiBlendTransformInterpolator = (NiRTTI *)0x030B0928; -const NiRTTI * NiRTTI_NiBlendFloatInterpolator = (NiRTTI *)0x030B0938; -const NiRTTI * NiRTTI_NiFloatExtraDataController = (NiRTTI *)0x030B0948; -const NiRTTI * NiRTTI_NiTransformController = (NiRTTI *)0x030B0958; -const NiRTTI * NiRTTI_NiBlendAccumTransformInterpolator = (NiRTTI *)0x030B0968; -const NiRTTI * NiRTTI_NiInterpolator = (NiRTTI *)0x030B0980; -const NiRTTI * NiRTTI_BSBlendTreadTransfInterpolator = (NiRTTI *)0x030B09A0; -const NiRTTI * NiRTTI_NiKeyBasedInterpolator = (NiRTTI *)0x030B09B8; -const NiRTTI * NiRTTI_NiTransformData = (NiRTTI *)0x030B0A38; -const NiRTTI * NiRTTI_NiPosData = (NiRTTI *)0x030B0A48; -const NiRTTI * NiRTTI_NiBlendBoolInterpolator = (NiRTTI *)0x030B0A58; -const NiRTTI * NiRTTI_NiBlendColorInterpolator = (NiRTTI *)0x030B0A68; -const NiRTTI * NiRTTI_NiBlendPoint3Interpolator = (NiRTTI *)0x030B0A78; -const NiRTTI * NiRTTI_NiBlendQuaternionInterpolator = (NiRTTI *)0x030B0A88; -const NiRTTI * NiRTTI_NiBoolData = (NiRTTI *)0x030B0A98; -const NiRTTI * NiRTTI_NiBoolInterpolator = (NiRTTI *)0x030B0AA8; -const NiRTTI * NiRTTI_NiBoolTimelineInterpolator = (NiRTTI *)0x030B0AB8; -const NiRTTI * NiRTTI_NiBSplineBasisData = (NiRTTI *)0x030B0AC8; -const NiRTTI * NiRTTI_NiBSplineData = (NiRTTI *)0x030B0AD8; -const NiRTTI * NiRTTI_NiBSplineColorInterpolator = (NiRTTI *)0x030B0AE8; -const NiRTTI * NiRTTI_NiBSplineCompColorInterpolator = (NiRTTI *)0x030B0AF8; -const NiRTTI * NiRTTI_NiBSplineCompFloatInterpolator = (NiRTTI *)0x030B0B08; -const NiRTTI * NiRTTI_NiBSplineCompPoint3Interpolator = (NiRTTI *)0x030B0B18; -const NiRTTI * NiRTTI_NiBSplineCompTransformInterpolator = (NiRTTI *)0x030B0B28; -const NiRTTI * NiRTTI_NiBSplineFloatInterpolator = (NiRTTI *)0x030B0B38; -const NiRTTI * NiRTTI_NiBSplinePoint3Interpolator = (NiRTTI *)0x030B0B48; -const NiRTTI * NiRTTI_NiBSplineTransformInterpolator = (NiRTTI *)0x030B0B58; -const NiRTTI * NiRTTI_NiColorExtraDataController = (NiRTTI *)0x030B0B68; -const NiRTTI * NiRTTI_NiFloatsExtraDataController = (NiRTTI *)0x030B0B78; -const NiRTTI * NiRTTI_NiFloatsExtraDataPoint3Controller = (NiRTTI *)0x030B0B88; -const NiRTTI * NiRTTI_NiKeyframeManager = (NiRTTI *)0x030B0BA0; -const NiRTTI * NiRTTI_NiLightColorController = (NiRTTI *)0x030B0BB0; -const NiRTTI * NiRTTI_NiLightDimmerController = (NiRTTI *)0x030B0BC0; -const NiRTTI * NiRTTI_NiLookAtController = (NiRTTI *)0x030B0BD0; -const NiRTTI * NiRTTI_NiLookAtInterpolator = (NiRTTI *)0x030B0BE0; -const NiRTTI * NiRTTI_NiMorphData = (NiRTTI *)0x030B0BF0; -const NiRTTI * NiRTTI_NiPathController = (NiRTTI *)0x030B0C00; -const NiRTTI * NiRTTI_NiPoint3Interpolator = (NiRTTI *)0x030B0C10; -const NiRTTI * NiRTTI_NiQuaternionInterpolator = (NiRTTI *)0x030B0C20; -const NiRTTI * NiRTTI_NiRollController = (NiRTTI *)0x030B0C30; -const NiRTTI * NiRTTI_NiRotData = (NiRTTI *)0x030B0C40; -const NiRTTI * NiRTTI_NiSequence = (NiRTTI *)0x030B0C50; -const NiRTTI * NiRTTI_NiSequenceStreamHelper = (NiRTTI *)0x030B0C70; -const NiRTTI * NiRTTI_NiStringPalette = (NiRTTI *)0x030B0C80; -const NiRTTI * NiRTTI_NiTextKeyExtraData = (NiRTTI *)0x030B0C90; -const NiRTTI * NiRTTI_NiUVData = (NiRTTI *)0x030B0CA0; -const NiRTTI * NiRTTI_NiVisController = (NiRTTI *)0x030B0CB0; -const NiRTTI * NiRTTI_BSAnimNote = (NiRTTI *)0x030B0CC0; -const NiRTTI * NiRTTI_BSAnimNotes = (NiRTTI *)0x030B0CD0; -const NiRTTI * NiRTTI_BSGrabIKNote = (NiRTTI *)0x030B0CE0; -const NiRTTI * NiRTTI_BSLookIKNote = (NiRTTI *)0x030B0CF0; -const NiRTTI * NiRTTI_BSRotAccumTransfInterpolator = (NiRTTI *)0x030B0D00; -const NiRTTI * NiRTTI_BSTreadTransfInterpolator = (NiRTTI *)0x030B0D10; -const NiRTTI * NiRTTI_BSFrustumFOVController = (NiRTTI *)0x030B0D20; -const NiRTTI * NiRTTI_NiExtraDataController = (NiRTTI *)0x030B0DB8; -const NiRTTI * NiRTTI_NiBSplineInterpolator = (NiRTTI *)0x030B0DC8; -const NiRTTI * NiRTTI_NiPoint3InterpController = (NiRTTI *)0x030B0DD8; -const NiRTTI * NiRTTI_NiFloatInterpController = (NiRTTI *)0x030B0DE8; -const NiRTTI * NiRTTI_NiFloatController = (NiRTTI *)0x030B0DF8; -const NiRTTI * NiRTTI_NiBoolInterpController = (NiRTTI *)0x030B0E08; -const NiRTTI * NiRTTI_NiParticleSystem = (NiRTTI *)0x030B0E20; -const NiRTTI * NiRTTI_NiPSysEmitterCtlr = (NiRTTI *)0x030B0E30; -const NiRTTI * NiRTTI_NiPSysGravityModifier = (NiRTTI *)0x030B0E40; -const NiRTTI * NiRTTI_BSPSysHavokUpdateModifier = (NiRTTI *)0x030B0E50; -const NiRTTI * NiRTTI_NiMeshParticleSystem = (NiRTTI *)0x030B0E68; -const NiRTTI * NiRTTI_NiPSysCylinderEmitter = (NiRTTI *)0x030B0E80; -const NiRTTI * NiRTTI_BSStripParticleSystem = (NiRTTI *)0x030B0E90; -const NiRTTI * NiRTTI_NiPSysEmitter = (NiRTTI *)0x030B0EA0; -const NiRTTI * NiRTTI_NiPSysModifierCtlr = (NiRTTI *)0x030B0EB0; -const NiRTTI * NiRTTI_NiPSysModifier = (NiRTTI *)0x030B0EC8; -const NiRTTI * NiRTTI_NiPSysMeshUpdateModifier = (NiRTTI *)0x030B0ED8; -const NiRTTI * NiRTTI_NiPSysUpdateCtlr = (NiRTTI *)0x030B0EE8; -const NiRTTI * NiRTTI_NiMeshPSysData = (NiRTTI *)0x030B0EF8; -const NiRTTI * NiRTTI_NiPSysAirFieldAirFrictionCtlr = (NiRTTI *)0x030B0F08; -const NiRTTI * NiRTTI_NiPSysAirFieldInheritVelocityCtlr = (NiRTTI *)0x030B0F18; -const NiRTTI * NiRTTI_NiPSysAirFieldModifier = (NiRTTI *)0x030B0F28; -const NiRTTI * NiRTTI_NiPSysAirFieldSpreadCtlr = (NiRTTI *)0x030B0F38; -const NiRTTI * NiRTTI_NiPSysAgeDeathModifier = (NiRTTI *)0x030B0F48; -const NiRTTI * NiRTTI_NiPSysBombModifier = (NiRTTI *)0x030B0F58; -const NiRTTI * NiRTTI_NiPSysBoundUpdateModifier = (NiRTTI *)0x030B0F68; -const NiRTTI * NiRTTI_NiPSysBoxEmitter = (NiRTTI *)0x030B0F78; -const NiRTTI * NiRTTI_NiPSysColliderManager = (NiRTTI *)0x030B0F88; -const NiRTTI * NiRTTI_NiPSysColorModifier = (NiRTTI *)0x030B0F98; -const NiRTTI * NiRTTI_NiPSysData = (NiRTTI *)0x030B0FA8; -const NiRTTI * NiRTTI_NiPSysDragFieldModifier = (NiRTTI *)0x030B0FB8; -const NiRTTI * NiRTTI_NiPSysDragModifier = (NiRTTI *)0x030B0FC8; -const NiRTTI * NiRTTI_NiPSysEmitterCtlrData = (NiRTTI *)0x030B0FD8; -const NiRTTI * NiRTTI_NiPSysEmitterDeclinationCtlr = (NiRTTI *)0x030B0FE8; -const NiRTTI * NiRTTI_NiPSysEmitterDeclinationVarCtlr = (NiRTTI *)0x030B0FF8; -const NiRTTI * NiRTTI_NiPSysEmitterInitialRadiusCtlr = (NiRTTI *)0x030B1008; -const NiRTTI * NiRTTI_NiPSysEmitterLifeSpanCtlr = (NiRTTI *)0x030B1018; -const NiRTTI * NiRTTI_NiPSysEmitterPlanarAngleCtlr = (NiRTTI *)0x030B1028; -const NiRTTI * NiRTTI_NiPSysEmitterPlanarAngleVarCtlr = (NiRTTI *)0x030B1038; -const NiRTTI * NiRTTI_NiPSysEmitterSpeedCtlr = (NiRTTI *)0x030B1048; -const NiRTTI * NiRTTI_NiPSysFieldAttenuationCtlr = (NiRTTI *)0x030B1058; -const NiRTTI * NiRTTI_NiPSysFieldMagnitudeCtlr = (NiRTTI *)0x030B1068; -const NiRTTI * NiRTTI_NiPSysFieldMaxDistanceCtlr = (NiRTTI *)0x030B1078; -const NiRTTI * NiRTTI_NiPSysGravityFieldModifier = (NiRTTI *)0x030B1088; -const NiRTTI * NiRTTI_NiPSysGravityStrengthCtlr = (NiRTTI *)0x030B1098; -const NiRTTI * NiRTTI_NiPSysGrowFadeModifier = (NiRTTI *)0x030B10A8; -const NiRTTI * NiRTTI_NiPSysInitialRotAngleCtlr = (NiRTTI *)0x030B10B8; -const NiRTTI * NiRTTI_NiPSysInitialRotAngleVarCtlr = (NiRTTI *)0x030B10C8; -const NiRTTI * NiRTTI_NiPSysInitialRotSpeedCtlr = (NiRTTI *)0x030B10D8; -const NiRTTI * NiRTTI_NiPSysInitialRotSpeedVarCtlr = (NiRTTI *)0x030B10E8; -const NiRTTI * NiRTTI_NiPSysMeshEmitter = (NiRTTI *)0x030B10F8; -const NiRTTI * NiRTTI_NiPSysModifierActiveCtlr = (NiRTTI *)0x030B1128; -const NiRTTI * NiRTTI_NiPSysPlanarCollider = (NiRTTI *)0x030B1138; -const NiRTTI * NiRTTI_NiPSysPositionModifier = (NiRTTI *)0x030B1148; -const NiRTTI * NiRTTI_NiPSysRadialFieldModifier = (NiRTTI *)0x030B1158; -const NiRTTI * NiRTTI_NiPSysResetOnLoopCtlr = (NiRTTI *)0x030B1168; -const NiRTTI * NiRTTI_NiPSysRotationModifier = (NiRTTI *)0x030B1178; -const NiRTTI * NiRTTI_NiPSysSpawnModifier = (NiRTTI *)0x030B1188; -const NiRTTI * NiRTTI_NiPSysSphereEmitter = (NiRTTI *)0x030B1198; -const NiRTTI * NiRTTI_NiPSysSphericalCollider = (NiRTTI *)0x030B11A8; -const NiRTTI * NiRTTI_NiPSysTurbulenceFieldModifier = (NiRTTI *)0x030B11B8; -const NiRTTI * NiRTTI_NiPSysVortexFieldModifier = (NiRTTI *)0x030B11C8; -const NiRTTI * NiRTTI_BSStripPSysData = (NiRTTI *)0x030B11D8; -const NiRTTI * NiRTTI_BSPSysRecycleBoundModifier = (NiRTTI *)0x030B11F0; -const NiRTTI * NiRTTI_BSPSysInheritVelocityModifier = (NiRTTI *)0x030B1200; -const NiRTTI * NiRTTI_NiPSysVolumeEmitter = (NiRTTI *)0x030B1210; -const NiRTTI * NiRTTI_NiPSysModifierFloatCtlr = (NiRTTI *)0x030B1220; -const NiRTTI * NiRTTI_NiPSysFieldModifier = (NiRTTI *)0x030B1230; -const NiRTTI * NiRTTI_NiPSysModifierBoolCtlr = (NiRTTI *)0x030B1240; -const NiRTTI * NiRTTI_NiPSysCollider = (NiRTTI *)0x030B1250; -const NiRTTI * NiRTTI_BSMultiBound = (NiRTTI *)0x030B9508; -const NiRTTI * NiRTTI_BSMultiBoundRoom = (NiRTTI *)0x030B9518; -const NiRTTI * NiRTTI_BSMultiBoundAABB = (NiRTTI *)0x030B9530; -const NiRTTI * NiRTTI_BSMultiBoundOBB = (NiRTTI *)0x030B9548; -const NiRTTI * NiRTTI_BSXFlags = (NiRTTI *)0x030B9568; -const NiRTTI * NiRTTI_BSValueNode = (NiRTTI *)0x030B9580; -const NiRTTI * NiRTTI_BSWindModifier = (NiRTTI *)0x030BFB00; -const NiRTTI * NiRTTI_BSTempNodeManager = (NiRTTI *)0x030BFB20; -const NiRTTI * NiRTTI_BSTempNode = (NiRTTI *)0x030BFB30; -const NiRTTI * NiRTTI_BSOcclusionShape = (NiRTTI *)0x030BFB50; -const NiRTTI * NiRTTI_BSRangeNode = (NiRTTI *)0x030BFC48; -const NiRTTI * NiRTTI_BSBlastNode = (NiRTTI *)0x030BFE80; -const NiRTTI * NiRTTI_BSDebrisNode = (NiRTTI *)0x030BFE90; -const NiRTTI * NiRTTI_BSDamageStage = (NiRTTI *)0x030BFEA0; -const NiRTTI * NiRTTI_BSPSysArrayEmitter = (NiRTTI *)0x030BFEB0; -const NiRTTI * NiRTTI_PArrayPoint = (NiRTTI *)0x030BFEC0; -const NiRTTI * NiRTTI_BSMultiStreamInstanceTriShape = (NiRTTI *)0x030BFEE8; -const NiRTTI * NiRTTI_BSMultiBoundShape = (NiRTTI *)0x030BFF18; -const NiRTTI * NiRTTI_BSMultiBoundSphere = (NiRTTI *)0x030BFF28; -const NiRTTI * NiRTTI_BSOcclusionBox = (NiRTTI *)0x030BFF40; -const NiRTTI * NiRTTI_BSOcclusionPlane = (NiRTTI *)0x030BFF58; -const NiRTTI * NiRTTI_BSPortal = (NiRTTI *)0x030BFF68; -const NiRTTI * NiRTTI_BSPortalSharedNode = (NiRTTI *)0x030BFF78; -const NiRTTI * NiRTTI_BSBodyMorphOffsetsExtraData = (NiRTTI *)0x030BFF90; -const NiRTTI * NiRTTI_BSBehaviorGraphExtraData = (NiRTTI *)0x030BFFA0; -const NiRTTI * NiRTTI_NiBSBoneLODController = (NiRTTI *)0x030BFFB8; -const NiRTTI * NiRTTI_BSCullingProcess = (NiRTTI *)0x030BFFD8; -const NiRTTI * NiRTTI_BSParticleSystemManager = (NiRTTI *)0x030BFFF8; -const NiRTTI * NiRTTI_BSFurnitureMarkerNode = (NiRTTI *)0x030C0020; -const NiRTTI * NiRTTI_BSBound = (NiRTTI *)0x030C00A0; -const NiRTTI * NiRTTI_BSMultiBoundNode = (NiRTTI *)0x030C00C0; -const NiRTTI * NiRTTI_BSBoneMap = (NiRTTI *)0x030C00D0; -const NiRTTI * NiRTTI_BSAnimInteractionMarker = (NiRTTI *)0x030C00E8; -const NiRTTI * NiRTTI_BSSceneGraph = (NiRTTI *)0x030C0100; -const NiRTTI * NiRTTI_BSPSysMultiTargetEmitterCtlr = (NiRTTI *)0x030C0118; -const NiRTTI * NiRTTI_BSGeometryListCullingProcess = (NiRTTI *)0x030C0130; -const NiRTTI * NiRTTI_BSSubIndexTriShape = (NiRTTI *)0x030C0148; -const NiRTTI * NiRTTI_BSDistantObjectLargeRefExtraData = (NiRTTI *)0x030C0158; -const NiRTTI * NiRTTI_BSMasterParticleSystem = (NiRTTI *)0x030C1B20; -const NiRTTI * NiRTTI_BSProceduralLightningController = (NiRTTI *)0x030C1B48; -const NiRTTI * NiRTTI_BSInvMarker = (NiRTTI *)0x030C1B58; -const NiRTTI * NiRTTI_BSBoneLODExtraData = (NiRTTI *)0x030C1B70; -const NiRTTI * NiRTTI_BSReference = (NiRTTI *)0x030C1B90; -const NiRTTI * NiRTTI_BSNodeReferences = (NiRTTI *)0x030C1BA0; -const NiRTTI * NiRTTI_BSDecalPlacementVectorExtraData = (NiRTTI *)0x030C1BB0; -const NiRTTI * NiRTTI_BSParentVelocityModifier = (NiRTTI *)0x030C1BC0; -const NiRTTI * NiRTTI_BSWArray = (NiRTTI *)0x030C1BD0; -const NiRTTI * NiRTTI_BSMultiBoundCapsule = (NiRTTI *)0x030C1BE8; -const NiRTTI * NiRTTI_BSPSysStripUpdateModifier = (NiRTTI *)0x030C1BF8; -const NiRTTI * NiRTTI_BSPSysSubTexModifier = (NiRTTI *)0x030C1C08; -const NiRTTI * NiRTTI_BSPSysScaleModifier = (NiRTTI *)0x030C1C18; -const NiRTTI * NiRTTI_BSLagBoneController = (NiRTTI *)0x030C1C28; -const NiRTTI * NiRTTI_BSNonUniformScaleExtraData = (NiRTTI *)0x030C1C38; -const NiRTTI * NiRTTI_BSNiNode = (NiRTTI *)0x030C1C50; -const NiRTTI * NiRTTI_BSInstanceTriShape = (NiRTTI *)0x030C1C60; -const NiRTTI * NiRTTI_bhkWorldObject = (NiRTTI *)0x030C8158; -const NiRTTI * NiRTTI_bhkWorld = (NiRTTI *)0x030C8198; -const NiRTTI * NiRTTI_bhkRigidBody = (NiRTTI *)0x030C92D8; -const NiRTTI * NiRTTI_bhkCollisionObject = (NiRTTI *)0x030C92F0; -const NiRTTI * NiRTTI_bhkNiCollisionObject = (NiRTTI *)0x030C93A0; -const NiRTTI * NiRTTI_bhkAttachmentCollisionObject = (NiRTTI *)0x030C9420; -const NiRTTI * NiRTTI_WeaponObject = (NiRTTI *)0x030C9430; -const NiRTTI * NiRTTI_bhkRigidBodyT = (NiRTTI *)0x030C9458; -const NiRTTI * NiRTTI_bhkWorldM = (NiRTTI *)0x030C9468; -const NiRTTI * NiRTTI_bhkRefObject = (NiRTTI *)0x030C9490; -const NiRTTI * NiRTTI_bhkSerializable = (NiRTTI *)0x030C94A0; -const NiRTTI * NiRTTI_bhkShape = (NiRTTI *)0x030C94D0; -const NiRTTI * NiRTTI_bhkEntity = (NiRTTI *)0x030C94E8; -const NiRTTI * NiRTTI_bhkPhantom = (NiRTTI *)0x030C9500; -const NiRTTI * NiRTTI_bhkAabbPhantom = (NiRTTI *)0x030C9518; -const NiRTTI * NiRTTI_bhkSphereRepShape = (NiRTTI *)0x030C9530; -const NiRTTI * NiRTTI_bhkConvexShape = (NiRTTI *)0x030C9548; -const NiRTTI * NiRTTI_bhkPCollisionObject = (NiRTTI *)0x030C9558; -const NiRTTI * NiRTTI_hkPackedNiTriStripsData = (NiRTTI *)0x030C9568; -const NiRTTI * NiRTTI_bhkShapePhantom = (NiRTTI *)0x030C9580; -const NiRTTI * NiRTTI_bhkSimpleShapePhantom = (NiRTTI *)0x030C9598; -const NiRTTI * NiRTTI_bhkCapsuleShape = (NiRTTI *)0x030C95B0; -const NiRTTI * NiRTTI_bhkBoxShape = (NiRTTI *)0x030C95C8; -const NiRTTI * NiRTTI_bhkSphereShape = (NiRTTI *)0x030C95E0; -const NiRTTI * NiRTTI_bhkBvTreeShape = (NiRTTI *)0x030C95F8; -const NiRTTI * NiRTTI_bhkNiTriStripsShape = (NiRTTI *)0x030C9610; -const NiRTTI * NiRTTI_bhkPackedNiTriStripsShape = (NiRTTI *)0x030C9638; -const NiRTTI * NiRTTI_bhkBlendCollisionObject = (NiRTTI *)0x030C9650; -const NiRTTI * NiRTTI_bhkAvoidBox = (NiRTTI *)0x030C9670; -const NiRTTI * NiRTTI_bhkLimitedHingeConstraint = (NiRTTI *)0x030C9688; -const NiRTTI * NiRTTI_bhkMalleableConstraint = (NiRTTI *)0x030C96A0; -const NiRTTI * NiRTTI_bhkUnaryAction = (NiRTTI *)0x030C96B8; -const NiRTTI * NiRTTI_bhkConstraint = (NiRTTI *)0x030C96D0; -const NiRTTI * NiRTTI_bhkPrismaticConstraint = (NiRTTI *)0x030C96E8; -const NiRTTI * NiRTTI_bhkAction = (NiRTTI *)0x030C9700; -const NiRTTI * NiRTTI_bhkTriSampledHeightFieldBvTreeShape = (NiRTTI *)0x030C9718; -const NiRTTI * NiRTTI_bhkCachingShapePhantom = (NiRTTI *)0x030CA388; -const NiRTTI * NiRTTI_bhkRagdollTemplateData = (NiRTTI *)0x030CA3B0; -const NiRTTI * NiRTTI_bhkRagdollTemplate = (NiRTTI *)0x030CA3C0; -const NiRTTI * NiRTTI_bhkSPCollisionObject = (NiRTTI *)0x030CA3D0; -const NiRTTI * NiRTTI_bhkMouseSpringAction = (NiRTTI *)0x030CA3E8; -const NiRTTI * NiRTTI_bhkHingeConstraint = (NiRTTI *)0x030CA400; -const NiRTTI * NiRTTI_bhkCompressedMeshShape = (NiRTTI *)0x030CA478; -const NiRTTI * NiRTTI_bhkCompressedMeshShapeData = (NiRTTI *)0x030CA488; -const NiRTTI * NiRTTI_bhkConvexSweepShape = (NiRTTI *)0x030CA4A0; -const NiRTTI * NiRTTI_bhkConvexTransformShape = (NiRTTI *)0x030CA4B8; -const NiRTTI * NiRTTI_bhkConvexTranslateShape = (NiRTTI *)0x030CA4D0; -const NiRTTI * NiRTTI_bhkConvexVerticesShape = (NiRTTI *)0x030CA4E8; -const NiRTTI * NiRTTI_bhkCylinderShape = (NiRTTI *)0x030CA500; -const NiRTTI * NiRTTI_bhkMultiSphereShape = (NiRTTI *)0x030CA518; -const NiRTTI * NiRTTI_bhkPlaneShape = (NiRTTI *)0x030CA530; -const NiRTTI * NiRTTI_bhkTriangleShape = (NiRTTI *)0x030CA548; -const NiRTTI * NiRTTI_bhkMoppBvTreeShape = (NiRTTI *)0x030CA560; -const NiRTTI * NiRTTI_bhkTransformShape = (NiRTTI *)0x030CA578; -const NiRTTI * NiRTTI_bhkListShape = (NiRTTI *)0x030CA590; -const NiRTTI * NiRTTI_bhkBallAndSocketConstraint = (NiRTTI *)0x030CA5A8; -const NiRTTI * NiRTTI_bhkBallSocketConstraintChain = (NiRTTI *)0x030CA5C0; -const NiRTTI * NiRTTI_bhkGroupConstraint = (NiRTTI *)0x030CA5D8; -const NiRTTI * NiRTTI_bhkHingeLimitsConstraint = (NiRTTI *)0x030CA5F0; -const NiRTTI * NiRTTI_bhkFixedConstraint = (NiRTTI *)0x030CA608; -const NiRTTI * NiRTTI_bhkRagdollConstraint = (NiRTTI *)0x030CA620; -const NiRTTI * NiRTTI_bhkRagdollLimitsConstraint = (NiRTTI *)0x030CA638; -const NiRTTI * NiRTTI_bhkStiffSpringConstraint = (NiRTTI *)0x030CA650; -const NiRTTI * NiRTTI_bhkWheelConstraint = (NiRTTI *)0x030CA668; -const NiRTTI * NiRTTI_bhkBreakableConstraint = (NiRTTI *)0x030CA680; -const NiRTTI * NiRTTI_bhkAngularDashpotAction = (NiRTTI *)0x030CA698; -const NiRTTI * NiRTTI_bhkDashpotAction = (NiRTTI *)0x030CA6B0; -const NiRTTI * NiRTTI_bhkLiquidAction = (NiRTTI *)0x030CA6C8; -const NiRTTI * NiRTTI_bhkMotorAction = (NiRTTI *)0x030CA6E8; -const NiRTTI * NiRTTI_bhkOrientHingedBodyAction = (NiRTTI *)0x030CA700; -const NiRTTI * NiRTTI_bhkSpringAction = (NiRTTI *)0x030CA718; -const NiRTTI * NiRTTI_bhkBlendController = (NiRTTI *)0x030CA728; -const NiRTTI * NiRTTI_bhkExtraData = (NiRTTI *)0x030CA738; -const NiRTTI * NiRTTI_bhkPoseArray = (NiRTTI *)0x030CA748; -const NiRTTI * NiRTTI_bhkGenericConstraint = (NiRTTI *)0x030CA768; -const NiRTTI * NiRTTI_bhkCharControllerShape = (NiRTTI *)0x030CA778; -const NiRTTI * NiRTTI_bhkCollisionBox = (NiRTTI *)0x030CA790; -const NiRTTI * NiRTTI_bhkShapeCollection = (NiRTTI *)0x030CA7A8; -const NiRTTI * NiRTTI_bhkPositionConstraintMotor = (NiRTTI *)0x030CA810; -const NiRTTI * NiRTTI_bhkVelocityConstraintMotor = (NiRTTI *)0x030CA820; -const NiRTTI * NiRTTI_bhkSpringDamperConstraintMotor = (NiRTTI *)0x030CA830; -const NiRTTI * NiRTTI_bhkCharacterProxy = (NiRTTI *)0x030CB5E8; -const NiRTTI * NiRTTI_bhkCharacterRigidBody = (NiRTTI *)0x030CB600; -const NiRTTI * NiRTTI_bhkHeightFieldShape = (NiRTTI *)0x030CC908; -const NiRTTI * NiRTTI_bhkConstraintChain = (NiRTTI *)0x030CC920; -const NiRTTI * NiRTTI_bhkBinaryAction = (NiRTTI *)0x030CC938; -const NiRTTI * NiRTTI_bhkPointToPathConstraint = (NiRTTI *)0x030CC970; -const NiRTTI * NiRTTI_DebugTextExtraData = (NiRTTI *)0x030CE170; -const NiRTTI * NiRTTI_BSFadeNode = (NiRTTI *)0x0326C0E8; -const NiRTTI * NiRTTI_BSShaderProperty = (NiRTTI *)0x0326C118; -const NiRTTI * NiRTTI_BSLeafAnimNode = (NiRTTI *)0x0326C128; -const NiRTTI * NiRTTI_BSTreeNode = (NiRTTI *)0x0326C138; -const NiRTTI * NiRTTI_ShadowSceneNode = (NiRTTI *)0x0326C560; -const NiRTTI * NiRTTI_BSLightingShaderProperty = (NiRTTI *)0x0326CE30; -const NiRTTI * NiRTTI_BSGrassShaderProperty = (NiRTTI *)0x0326CE68; -const NiRTTI * NiRTTI_BSShaderAccumulator = (NiRTTI *)0x0326D080; -const NiRTTI * NiRTTI_BSEffectShaderProperty = (NiRTTI *)0x0326D220; -const NiRTTI * NiRTTI_BSWaterShaderProperty = (NiRTTI *)0x032CE048; -const NiRTTI * NiRTTI_BSBloodSplatterShaderProperty = (NiRTTI *)0x032CE058; -const NiRTTI * NiRTTI_BSParticleShaderProperty = (NiRTTI *)0x032CE448; -const NiRTTI * NiRTTI_BSTextureSet = (NiRTTI *)0x032CE798; -const NiRTTI * NiRTTI_BSShaderTextureSet = (NiRTTI *)0x032CE7A8; -const NiRTTI * NiRTTI_BSSkyShaderProperty = (NiRTTI *)0x032CEAA8; -const NiRTTI * NiRTTI_BSFadeNodeCuller = (NiRTTI *)0x0331EB30; -const NiRTTI * NiRTTI_BSDistantTreeShaderProperty = (NiRTTI *)0x0331EB60; -const NiRTTI * NiRTTI_BSCubeMapCamera = (NiRTTI *)0x0331ED40; -const NiRTTI * NiRTTI_BSFogProperty = (NiRTTI *)0x0331EDF8; -const NiRTTI * NiRTTI_BSClearZNode = (NiRTTI *)0x03530EB8; -const NiRTTI * NiRTTI_NiCollisionObject = (NiRTTI *)0x03530FD8; -const NiRTTI * NiRTTI_BSOrderedNode = (NiRTTI *)0x03530FE8; -const NiRTTI * NiRTTI_BSLines = (NiRTTI *)0x03530FF8; -const NiRTTI * NiRTTI_BSDynamicLines = (NiRTTI *)0x03531008; -const NiRTTI * NiRTTI_BSMultiIndexTriShape = (NiRTTI *)0x03531028; -const NiRTTI * NiRTTI_BSLightingShaderPropertyFloatController = (NiRTTI *)0x035310D0; -const NiRTTI * NiRTTI_BSLightingShaderPropertyUShortController = (NiRTTI *)0x035310E8; -const NiRTTI * NiRTTI_BSLightingShaderPropertyColorController = (NiRTTI *)0x03531100; -const NiRTTI * NiRTTI_BSEffectShaderPropertyFloatController = (NiRTTI *)0x03531138; -const NiRTTI * NiRTTI_BSEffectShaderPropertyColorController = (NiRTTI *)0x03531150; -const NiRTTI * NiRTTI_BSNiAlphaPropertyTestRefController = (NiRTTI *)0x03531160; -const NiRTTI * NiRTTI_BSPSysSimpleColorModifier = (NiRTTI *)0x03531170; -const NiRTTI * NiRTTI_BSPSysLODModifier = (NiRTTI *)0x03531180; -const NiRTTI * NiRTTI_BSParabolicCullingProcess = (NiRTTI *)0x03531608; -const NiRTTI * NiRTTI_BSMeshLODTriShape = (NiRTTI *)0x03531618; -const NiRTTI * NiRTTI_BSLODMultiIndexTriShape = (NiRTTI *)0x03531628; -const NiRTTI * NiRTTI_BSSubIndexLandTriShape = (NiRTTI *)0x03531640; diff --git a/source/fs.dll/skse64/skse64/NiRTTI.h b/source/fs.dll/skse64/skse64/NiRTTI.h deleted file mode 100644 index b9a647f5..00000000 --- a/source/fs.dll/skse64/skse64/NiRTTI.h +++ /dev/null @@ -1,849 +0,0 @@ -#pragma once - -/**** hierarchy **************************************************************** - * - * BSFaceGenMorphData - * BSFaceGenMorphDataHead - * BSFaceGenMorphDataHair - * - * BSTempEffect - * BSTempEffectDebris - * BSTempEffectGeometryDecal - * BSTempEffectParticle - * BSTempEffectSimpleDecal - * BSTempEffectSPG - * ReferenceEffect - * ModelReferenceEffect - * ShaderReferenceEffect - * SummonPlacementEffect - * - * NiObject - * NiObjectNET - * NiAVObject - * NiNode - * BGSDecalNode - * BSFaceGenNiNode - * NiSwitchNode - * BSFlattenedBoneTree - * NiBillboardNode - * NiBSPNode - * BSTempNodeManager - * BSTempNode - * BSPortalSharedNode - * BSParticleSystemManager - * BSSceneGraph - * SceneGraph - * BSMasterParticleSystem - * BSNiNode - * BSValueNode - * BSRangeNode - * BSBlastNode - * BSDebrisNode - * BSDamageStage - * BSMultiBoundNode - * BSOrderedNode - * BSFadeNode - * BSLeafAnimNode - * BSTreeNode - * ShadowSceneNode - * BSClearZNode - * NiLight - * NiPointLight - * NiSpotLight - * NiDirectionalLight - * NiAmbientLight - * NiCamera - * BSCubeMapCamera - * BSGeometry - * BSTriShape - * BSDynamicTriShape - * BSSubIndexTriShape - * BSSubIndexLandTriShape - * BSInstanceTriShape - * BSMultiStreamInstanceTriShape - * BSMultiIndexTriShape - * BSLODMultiIndexTriShape - * BSMeshLODTriShape - * NiParticles - * NiParticleMeshes - * NiParticleSystem - * NiMeshParticleSystem - * BSStripParticleSystem - * BSLines - * BSDynamicLines - * NiGeometry - * NiTriBasedGeom - * NiTriShape - * BSLODTriShape - * BSSegmentedTriShape - * NiTriStrips - * NiProperty - * NiAlphaProperty - * NiShadeProperty - * BSShaderProperty - * BSLightingShaderProperty - * BSGrassShaderProperty - * BSEffectShaderProperty - * BSWaterShaderProperty - * BSBloodSplatterShaderProperty - * BSParticleShaderProperty - * BSSkyShaderProperty - * BSDistantTreeShaderProperty - * NiFogProperty - * BSFogProperty - * NiSequenceStreamHelper - * BSDismemberSkinInstance - * NiTimeController - * REFRSyncController - * BSDoorHavokController - * BSPlayerDistanceCheckController - * BSSimpleScaleController - * NiControllerManager - * NiInterpController - * NiMultiTargetTransformController - * BSMultiTargetTreadTransfController - * NiSingleInterpController - * NiTransformController - * NiExtraDataController - * NiFloatExtraDataController - * NiColorExtraDataController - * NiFloatsExtraDataController - * NiFloatsExtraDataPoint3Controller - * NiPoint3InterpController - * NiLightColorController - * BSLightingShaderPropertyColorController - * BSEffectShaderPropertyColorController - * NiFloatInterpController - * NiLightDimmerController - * BSFrustumFOVController - * BSLightingShaderPropertyFloatController - * BSLightingShaderPropertyUShortController - * BSEffectShaderPropertyFloatController - * BSNiAlphaPropertyTestRefController - * NiBoolInterpController - * NiVisController - * NiPSysModifierCtlr - * NiPSysEmitterCtlr - * BSPSysMultiTargetEmitterCtlr - * NiPSysModifierFloatCtlr - * NiPSysAirFieldAirFrictionCtlr - * NiPSysAirFieldInheritVelocityCtlr - * NiPSysAirFieldSpreadCtlr - * NiPSysEmitterDeclinationCtlr - * NiPSysEmitterDeclinationVarCtlr - * NiPSysEmitterInitialRadiusCtlr - * NiPSysEmitterLifeSpanCtlr - * NiPSysEmitterPlanarAngleCtlr - * NiPSysEmitterPlanarAngleVarCtlr - * NiPSysEmitterSpeedCtlr - * NiPSysFieldAttenuationCtlr - * NiPSysFieldMagnitudeCtlr - * NiPSysFieldMaxDistanceCtlr - * NiPSysGravityStrengthCtlr - * NiPSysInitialRotAngleCtlr - * NiPSysInitialRotAngleVarCtlr - * NiPSysInitialRotSpeedCtlr - * NiPSysInitialRotSpeedVarCtlr - * NiPSysModifierBoolCtlr - * NiPSysModifierActiveCtlr - * BSProceduralLightningController - * NiKeyframeManager - * NiLookAtController - * NiPathController - * NiFloatController - * NiRollController - * NiPSysUpdateCtlr - * NiPSysResetOnLoopCtlr - * NiBSBoneLODController - * BSLagBoneController - * bhkBlendController - * NiExtraData - * BSSplatterExtraData - * BGSAddonNodeSoundHandleExtra - * BSFaceGenAnimationData - * BSFaceGenModelExtraData - * BSFaceGenBaseMorphExtraData - * NiStringsExtraData - * NiStringExtraData - * NiVertWeightsExtraData - * NiBinaryExtraData - * NiBooleanExtraData - * BSDistantObjectLargeRefExtraData - * NiColorExtraData - * NiFloatExtraData - * NiFloatsExtraData - * NiIntegerExtraData - * BSXFlags - * BSDecalPlacementVectorExtraData - * NiIntegersExtraData - * BSWArray - * NiSwitchStringExtraData - * NiVectorExtraData - * NiTextKeyExtraData - * PArrayPoint - * BSBodyMorphOffsetsExtraData - * BSBehaviorGraphExtraData - * BSFurnitureMarkerNode - * BSBound - * BSBoneMap - * BSAnimInteractionMarker - * BSInvMarker - * BSBoneLODExtraData - * BSNonUniformScaleExtraData - * bhkRagdollTemplate - * bhkExtraData - * DebugTextExtraData - * NiGeometryData - * NiTriBasedGeomData - * NiTriShapeData - * NiTriStripsData - * NiTexture - * NiSourceTexture - * NiSkinPartition - * NiSkinInstance - * NiAVObjectPalette - * NiDefaultAVObjectPalette - * NiSkinData - * NiParticlesData - * NiParticleMeshesData - * NiPSysData - * NiMeshPSysData - * BSStripPSysData - * NiAdditionalGeometryData - * NiAccumulator - * NiBackToFrontAccumulator - * NiAlphaAccumulator - * BSShaderAccumulator - * NiControllerSequence - * BSAnimGroupSequence - * NiFloatData - * NiColorData - * NiInterpolator - * NiBlendInterpolator - * NiBlendTransformInterpolator - * NiBlendFloatInterpolator - * NiBlendAccumTransformInterpolator - * BSBlendTreadTransfInterpolator - * NiBlendBoolInterpolator - * NiBlendColorInterpolator - * NiBlendPoint3Interpolator - * NiBlendQuaternionInterpolator - * NiKeyBasedInterpolator - * NiFloatInterpolator - * NiColorInterpolator - * NiTransformInterpolator - * BSRotAccumTransfInterpolator - * NiPathInterpolator - * NiBoolInterpolator - * NiBoolTimelineInterpolator - * NiPoint3Interpolator - * NiQuaternionInterpolator - * BSTreadTransfInterpolator - * NiLookAtInterpolator - * NiBSplineInterpolator - * NiBSplineColorInterpolator - * NiBSplineCompColorInterpolator - * NiBSplineFloatInterpolator - * NiBSplineCompFloatInterpolator - * NiBSplinePoint3Interpolator - * NiBSplineCompPoint3Interpolator - * NiBSplineTransformInterpolator - * NiBSplineCompTransformInterpolator - * NiTransformData - * NiPosData - * NiBoolData - * NiBSplineBasisData - * NiBSplineData - * NiMorphData - * NiRotData - * NiSequence - * NiStringPalette - * NiUVData - * BSAnimNote - * BSGrabIKNote - * BSLookIKNote - * BSAnimNotes - * NiPSysModifier - * NiPSysGravityModifier - * NiPSysEmitter - * NiPSysMeshEmitter - * NiPSysVolumeEmitter - * NiPSysCylinderEmitter - * NiPSysBoxEmitter - * NiPSysSphereEmitter - * BSPSysArrayEmitter - * NiPSysMeshUpdateModifier - * BSPSysHavokUpdateModifier - * NiPSysAgeDeathModifier - * NiPSysBombModifier - * NiPSysBoundUpdateModifier - * NiPSysColliderManager - * NiPSysColorModifier - * NiPSysDragModifier - * NiPSysGrowFadeModifier - * NiPSysPositionModifier - * NiPSysRotationModifier - * NiPSysSpawnModifier - * BSPSysRecycleBoundModifier - * BSPSysInheritVelocityModifier - * NiPSysFieldModifier - * NiPSysAirFieldModifier - * NiPSysDragFieldModifier - * NiPSysGravityFieldModifier - * NiPSysRadialFieldModifier - * NiPSysTurbulenceFieldModifier - * NiPSysVortexFieldModifier - * BSWindModifier - * BSParentVelocityModifier - * BSPSysStripUpdateModifier - * BSPSysSubTexModifier - * BSPSysScaleModifier - * BSPSysSimpleColorModifier - * BSPSysLODModifier - * NiPSysEmitterCtlrData - * NiPSysCollider - * NiPSysPlanarCollider - * NiPSysSphericalCollider - * BSMultiBound - * BSMultiBoundRoom - * BSOcclusionShape - * BSMultiBoundShape - * BSMultiBoundAABB - * BSMultiBoundOBB - * BSMultiBoundSphere - * BSMultiBoundCapsule - * BSOcclusionBox - * BSOcclusionPlane - * BSPortal - * BSReference - * BSNodeReferences - * bhkRefObject - * bhkWorld - * bhkWorldM - * bhkSerializable - * bhkWorldObject - * bhkEntity - * bhkRigidBody - * bhkRigidBodyT - * bhkPhantom - * bhkAabbPhantom - * bhkAutoWater - * bhkAvoidBox - * bhkShapePhantom - * bhkSimpleShapePhantom - * bhkCollisionBox - * bhkCachingShapePhantom - * bhkShape - * bhkSphereRepShape - * bhkConvexShape - * bhkCapsuleShape - * bhkBoxShape - * bhkSphereShape - * bhkConvexSweepShape - * bhkConvexTransformShape - * bhkConvexTranslateShape - * bhkConvexVerticesShape - * bhkCharControllerShape - * bhkCylinderShape - * bhkTriangleShape - * bhkMultiSphereShape - * bhkBvTreeShape - * bhkTriSampledHeightFieldBvTreeShape - * bhkMoppBvTreeShape - * bhkTransformShape - * bhkShapeCollection - * bhkNiTriStripsShape - * bhkPackedNiTriStripsShape - * bhkCompressedMeshShape - * bhkListShape - * bhkHeightFieldShape - * bhkPlaneShape - * bhkConstraint - * bhkLimitedHingeConstraint - * bhkMalleableConstraint - * bhkPrismaticConstraint - * bhkHingeConstraint - * bhkBallAndSocketConstraint - * bhkBallSocketConstraintChain - * bhkGroupConstraint - * bhkHingeLimitsConstraint - * bhkRagdollConstraint - * bhkRagdollLimitsConstraint - * bhkStiffSpringConstraint - * bhkWheelConstraint - * bhkBreakableConstraint - * bhkGenericConstraint - * bhkFixedConstraint - * bhkConstraintChain - * bhkPointToPathConstraint - * bhkAction - * bhkUnaryAction - * bhkTiltPreventAction - * bhkWheelAction - * bhkMouseSpringAction - * bhkLiquidAction - * bhkMotorAction - * bhkOrientHingedBodyAction - * bhkBinaryAction - * bhkAngularDashpotAction - * bhkDashpotAction - * bhkSpringAction - * bhkCharacterProxy - * bhkCharacterRigidBody - * hkPackedNiTriStripsData - * bhkRagdollTemplateData - * bhkCompressedMeshShapeData - * bhkPoseArray - * BSTextureSet - * BSShaderTextureSet - * NiCollisionObject - * NiCollisionData - * bhkNiCollisionObject - * bhkCollisionObject - * bhkCartTether - * bhkBlendCollisionObject - * bhkAttachmentCollisionObject - * WeaponObject - * bhkPCollisionObject - * bhkSPCollisionObject - * - * NiCullingProcess - * BSCullingProcess - * BSGeometryListCullingProcess - * BSParabolicCullingProcess - * BSFadeNodeCuller - * - * bhkPositionConstraintMotor - * - * bhkVelocityConstraintMotor - * - * bhkSpringDamperConstraintMotor - * - ****/ - -class NiObject; - -// 08 -class NiRTTI -{ -public: - const char * name; - NiRTTI * parent; -}; - -NiObject * DoNiRTTICast(NiObject * src, const NiRTTI * typeInfo); -bool IsType(NiRTTI * rtti, const NiRTTI * typeInfo); - -#define ni_cast(obj, type) (type *)DoNiRTTICast(obj, NiRTTI_##type) -#define ni_is_type(obj, type) IsType(obj, NiRTTI_##type) - -extern const NiRTTI * NiRTTI_BGSDecalNode; -extern const NiRTTI * NiRTTI_BSAnimGroupSequence; -extern const NiRTTI * NiRTTI_BSSplatterExtraData; -extern const NiRTTI * NiRTTI_BGSAddonNodeSoundHandleExtra; -extern const NiRTTI * NiRTTI_REFRSyncController; -extern const NiRTTI * NiRTTI_bhkCartTether; -extern const NiRTTI * NiRTTI_bhkTiltPreventAction; -extern const NiRTTI * NiRTTI_bhkWheelAction; -extern const NiRTTI * NiRTTI_BSFaceGenAnimationData; -extern const NiRTTI * NiRTTI_BSFaceGenModelExtraData; -extern const NiRTTI * NiRTTI_BSFaceGenBaseMorphExtraData; -extern const NiRTTI * NiRTTI_BSFaceGenMorphData; -extern const NiRTTI * NiRTTI_BSFaceGenMorphDataHead; -extern const NiRTTI * NiRTTI_BSFaceGenMorphDataHair; -extern const NiRTTI * NiRTTI_BSFaceGenNiNode; -extern const NiRTTI * NiRTTI_BSTempEffect; -extern const NiRTTI * NiRTTI_BSTempEffectDebris; -extern const NiRTTI * NiRTTI_BSTempEffectGeometryDecal; -extern const NiRTTI * NiRTTI_BSTempEffectParticle; -extern const NiRTTI * NiRTTI_BSTempEffectSimpleDecal; -extern const NiRTTI * NiRTTI_BSTempEffectSPG; -extern const NiRTTI * NiRTTI_bhkAutoWater; -extern const NiRTTI * NiRTTI_ModelReferenceEffect; -extern const NiRTTI * NiRTTI_ReferenceEffect; -extern const NiRTTI * NiRTTI_ShaderReferenceEffect; -extern const NiRTTI * NiRTTI_SummonPlacementEffect; -extern const NiRTTI * NiRTTI_SceneGraph; -extern const NiRTTI * NiRTTI_BSDoorHavokController; -extern const NiRTTI * NiRTTI_BSPlayerDistanceCheckController; -extern const NiRTTI * NiRTTI_BSSimpleScaleController; -extern const NiRTTI * NiRTTI_NiObject; -extern const NiRTTI * NiRTTI_NiAVObject; -extern const NiRTTI * NiRTTI_NiNode; -extern const NiRTTI * NiRTTI_NiObjectNET; -extern const NiRTTI * NiRTTI_NiLight; -extern const NiRTTI * NiRTTI_NiSwitchNode; -extern const NiRTTI * NiRTTI_NiStringsExtraData; -extern const NiRTTI * NiRTTI_NiCamera; -extern const NiRTTI * NiRTTI_BSTriShape; -extern const NiRTTI * NiRTTI_NiProperty; -extern const NiRTTI * NiRTTI_NiAlphaProperty; -extern const NiRTTI * NiRTTI_NiSourceTexture; -extern const NiRTTI * NiRTTI_BSFlattenedBoneTree; -extern const NiRTTI * NiRTTI_BSDismemberSkinInstance; -extern const NiRTTI * NiRTTI_NiStringExtraData; -extern const NiRTTI * NiRTTI_NiTimeController; -extern const NiRTTI * NiRTTI_NiExtraData; -extern const NiRTTI * NiRTTI_NiGeometryData; -extern const NiRTTI * NiRTTI_BSGeometry; -extern const NiRTTI * NiRTTI_BSDynamicTriShape; -extern const NiRTTI * NiRTTI_NiPointLight; -extern const NiRTTI * NiRTTI_NiDefaultAVObjectPalette; -extern const NiRTTI * NiRTTI_NiBillboardNode; -extern const NiRTTI * NiRTTI_NiDirectionalLight; -extern const NiRTTI * NiRTTI_NiCullingProcess; -extern const NiRTTI * NiRTTI_NiParticles; -extern const NiRTTI * NiRTTI_NiTexture; -extern const NiRTTI * NiRTTI_NiSkinPartition; -extern const NiRTTI * NiRTTI_NiVertWeightsExtraData; -extern const NiRTTI * NiRTTI_NiSkinInstance; -extern const NiRTTI * NiRTTI_NiAVObjectPalette; -extern const NiRTTI * NiRTTI_NiGeometry; -extern const NiRTTI * NiRTTI_NiSkinData; -extern const NiRTTI * NiRTTI_NiShadeProperty; -extern const NiRTTI * NiRTTI_NiAlphaAccumulator; -extern const NiRTTI * NiRTTI_NiAmbientLight; -extern const NiRTTI * NiRTTI_NiBinaryExtraData; -extern const NiRTTI * NiRTTI_NiBooleanExtraData; -extern const NiRTTI * NiRTTI_NiBSPNode; -extern const NiRTTI * NiRTTI_NiColorExtraData; -extern const NiRTTI * NiRTTI_NiFloatExtraData; -extern const NiRTTI * NiRTTI_NiFloatsExtraData; -extern const NiRTTI * NiRTTI_NiFogProperty; -extern const NiRTTI * NiRTTI_NiIntegerExtraData; -extern const NiRTTI * NiRTTI_NiIntegersExtraData; -extern const NiRTTI * NiRTTI_NiParticlesData; -extern const NiRTTI * NiRTTI_NiParticleMeshesData; -extern const NiRTTI * NiRTTI_NiParticleMeshes; -extern const NiRTTI * NiRTTI_NiSpotLight; -extern const NiRTTI * NiRTTI_NiSwitchStringExtraData; -extern const NiRTTI * NiRTTI_NiTriShapeData; -extern const NiRTTI * NiRTTI_NiTriShape; -extern const NiRTTI * NiRTTI_NiTriStripsData; -extern const NiRTTI * NiRTTI_NiTriStrips; -extern const NiRTTI * NiRTTI_NiVectorExtraData; -extern const NiRTTI * NiRTTI_BSLODTriShape; -extern const NiRTTI * NiRTTI_NiAdditionalGeometryData; -extern const NiRTTI * NiRTTI_BSSegmentedTriShape; -extern const NiRTTI * NiRTTI_NiBackToFrontAccumulator; -extern const NiRTTI * NiRTTI_NiAccumulator; -extern const NiRTTI * NiRTTI_NiTriBasedGeomData; -extern const NiRTTI * NiRTTI_NiTriBasedGeom; -extern const NiRTTI * NiRTTI_NiCollisionData; -extern const NiRTTI * NiRTTI_NiControllerManager; -extern const NiRTTI * NiRTTI_NiControllerSequence; -extern const NiRTTI * NiRTTI_NiBlendInterpolator; -extern const NiRTTI * NiRTTI_NiMultiTargetTransformController; -extern const NiRTTI * NiRTTI_BSMultiTargetTreadTransfController; -extern const NiRTTI * NiRTTI_NiInterpController; -extern const NiRTTI * NiRTTI_NiFloatData; -extern const NiRTTI * NiRTTI_NiFloatInterpolator; -extern const NiRTTI * NiRTTI_NiColorData; -extern const NiRTTI * NiRTTI_NiColorInterpolator; -extern const NiRTTI * NiRTTI_NiSingleInterpController; -extern const NiRTTI * NiRTTI_NiTransformInterpolator; -extern const NiRTTI * NiRTTI_NiPathInterpolator; -extern const NiRTTI * NiRTTI_NiBlendTransformInterpolator; -extern const NiRTTI * NiRTTI_NiBlendFloatInterpolator; -extern const NiRTTI * NiRTTI_NiFloatExtraDataController; -extern const NiRTTI * NiRTTI_NiTransformController; -extern const NiRTTI * NiRTTI_NiBlendAccumTransformInterpolator; -extern const NiRTTI * NiRTTI_NiInterpolator; -extern const NiRTTI * NiRTTI_BSBlendTreadTransfInterpolator; -extern const NiRTTI * NiRTTI_NiKeyBasedInterpolator; -extern const NiRTTI * NiRTTI_NiTransformData; -extern const NiRTTI * NiRTTI_NiPosData; -extern const NiRTTI * NiRTTI_NiBlendBoolInterpolator; -extern const NiRTTI * NiRTTI_NiBlendColorInterpolator; -extern const NiRTTI * NiRTTI_NiBlendPoint3Interpolator; -extern const NiRTTI * NiRTTI_NiBlendQuaternionInterpolator; -extern const NiRTTI * NiRTTI_NiBoolData; -extern const NiRTTI * NiRTTI_NiBoolInterpolator; -extern const NiRTTI * NiRTTI_NiBoolTimelineInterpolator; -extern const NiRTTI * NiRTTI_NiBSplineBasisData; -extern const NiRTTI * NiRTTI_NiBSplineData; -extern const NiRTTI * NiRTTI_NiBSplineColorInterpolator; -extern const NiRTTI * NiRTTI_NiBSplineCompColorInterpolator; -extern const NiRTTI * NiRTTI_NiBSplineCompFloatInterpolator; -extern const NiRTTI * NiRTTI_NiBSplineCompPoint3Interpolator; -extern const NiRTTI * NiRTTI_NiBSplineCompTransformInterpolator; -extern const NiRTTI * NiRTTI_NiBSplineFloatInterpolator; -extern const NiRTTI * NiRTTI_NiBSplinePoint3Interpolator; -extern const NiRTTI * NiRTTI_NiBSplineTransformInterpolator; -extern const NiRTTI * NiRTTI_NiColorExtraDataController; -extern const NiRTTI * NiRTTI_NiFloatsExtraDataController; -extern const NiRTTI * NiRTTI_NiFloatsExtraDataPoint3Controller; -extern const NiRTTI * NiRTTI_NiKeyframeManager; -extern const NiRTTI * NiRTTI_NiLightColorController; -extern const NiRTTI * NiRTTI_NiLightDimmerController; -extern const NiRTTI * NiRTTI_NiLookAtController; -extern const NiRTTI * NiRTTI_NiLookAtInterpolator; -extern const NiRTTI * NiRTTI_NiMorphData; -extern const NiRTTI * NiRTTI_NiPathController; -extern const NiRTTI * NiRTTI_NiPoint3Interpolator; -extern const NiRTTI * NiRTTI_NiQuaternionInterpolator; -extern const NiRTTI * NiRTTI_NiRollController; -extern const NiRTTI * NiRTTI_NiRotData; -extern const NiRTTI * NiRTTI_NiSequence; -extern const NiRTTI * NiRTTI_NiSequenceStreamHelper; -extern const NiRTTI * NiRTTI_NiStringPalette; -extern const NiRTTI * NiRTTI_NiTextKeyExtraData; -extern const NiRTTI * NiRTTI_NiUVData; -extern const NiRTTI * NiRTTI_NiVisController; -extern const NiRTTI * NiRTTI_BSAnimNote; -extern const NiRTTI * NiRTTI_BSAnimNotes; -extern const NiRTTI * NiRTTI_BSGrabIKNote; -extern const NiRTTI * NiRTTI_BSLookIKNote; -extern const NiRTTI * NiRTTI_BSRotAccumTransfInterpolator; -extern const NiRTTI * NiRTTI_BSTreadTransfInterpolator; -extern const NiRTTI * NiRTTI_BSFrustumFOVController; -extern const NiRTTI * NiRTTI_NiExtraDataController; -extern const NiRTTI * NiRTTI_NiBSplineInterpolator; -extern const NiRTTI * NiRTTI_NiPoint3InterpController; -extern const NiRTTI * NiRTTI_NiFloatInterpController; -extern const NiRTTI * NiRTTI_NiFloatController; -extern const NiRTTI * NiRTTI_NiBoolInterpController; -extern const NiRTTI * NiRTTI_NiParticleSystem; -extern const NiRTTI * NiRTTI_NiPSysEmitterCtlr; -extern const NiRTTI * NiRTTI_NiPSysGravityModifier; -extern const NiRTTI * NiRTTI_BSPSysHavokUpdateModifier; -extern const NiRTTI * NiRTTI_NiMeshParticleSystem; -extern const NiRTTI * NiRTTI_NiPSysCylinderEmitter; -extern const NiRTTI * NiRTTI_BSStripParticleSystem; -extern const NiRTTI * NiRTTI_NiPSysEmitter; -extern const NiRTTI * NiRTTI_NiPSysModifierCtlr; -extern const NiRTTI * NiRTTI_NiPSysModifier; -extern const NiRTTI * NiRTTI_NiPSysMeshUpdateModifier; -extern const NiRTTI * NiRTTI_NiPSysUpdateCtlr; -extern const NiRTTI * NiRTTI_NiMeshPSysData; -extern const NiRTTI * NiRTTI_NiPSysAirFieldAirFrictionCtlr; -extern const NiRTTI * NiRTTI_NiPSysAirFieldInheritVelocityCtlr; -extern const NiRTTI * NiRTTI_NiPSysAirFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysAirFieldSpreadCtlr; -extern const NiRTTI * NiRTTI_NiPSysAgeDeathModifier; -extern const NiRTTI * NiRTTI_NiPSysBombModifier; -extern const NiRTTI * NiRTTI_NiPSysBoundUpdateModifier; -extern const NiRTTI * NiRTTI_NiPSysBoxEmitter; -extern const NiRTTI * NiRTTI_NiPSysColliderManager; -extern const NiRTTI * NiRTTI_NiPSysColorModifier; -extern const NiRTTI * NiRTTI_NiPSysData; -extern const NiRTTI * NiRTTI_NiPSysDragFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysDragModifier; -extern const NiRTTI * NiRTTI_NiPSysEmitterCtlrData; -extern const NiRTTI * NiRTTI_NiPSysEmitterDeclinationCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterDeclinationVarCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterInitialRadiusCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterLifeSpanCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterPlanarAngleCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterPlanarAngleVarCtlr; -extern const NiRTTI * NiRTTI_NiPSysEmitterSpeedCtlr; -extern const NiRTTI * NiRTTI_NiPSysFieldAttenuationCtlr; -extern const NiRTTI * NiRTTI_NiPSysFieldMagnitudeCtlr; -extern const NiRTTI * NiRTTI_NiPSysFieldMaxDistanceCtlr; -extern const NiRTTI * NiRTTI_NiPSysGravityFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysGravityStrengthCtlr; -extern const NiRTTI * NiRTTI_NiPSysGrowFadeModifier; -extern const NiRTTI * NiRTTI_NiPSysInitialRotAngleCtlr; -extern const NiRTTI * NiRTTI_NiPSysInitialRotAngleVarCtlr; -extern const NiRTTI * NiRTTI_NiPSysInitialRotSpeedCtlr; -extern const NiRTTI * NiRTTI_NiPSysInitialRotSpeedVarCtlr; -extern const NiRTTI * NiRTTI_NiPSysMeshEmitter; -extern const NiRTTI * NiRTTI_NiPSysModifierActiveCtlr; -extern const NiRTTI * NiRTTI_NiPSysPlanarCollider; -extern const NiRTTI * NiRTTI_NiPSysPositionModifier; -extern const NiRTTI * NiRTTI_NiPSysRadialFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysResetOnLoopCtlr; -extern const NiRTTI * NiRTTI_NiPSysRotationModifier; -extern const NiRTTI * NiRTTI_NiPSysSpawnModifier; -extern const NiRTTI * NiRTTI_NiPSysSphereEmitter; -extern const NiRTTI * NiRTTI_NiPSysSphericalCollider; -extern const NiRTTI * NiRTTI_NiPSysTurbulenceFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysVortexFieldModifier; -extern const NiRTTI * NiRTTI_BSStripPSysData; -extern const NiRTTI * NiRTTI_BSPSysRecycleBoundModifier; -extern const NiRTTI * NiRTTI_BSPSysInheritVelocityModifier; -extern const NiRTTI * NiRTTI_NiPSysVolumeEmitter; -extern const NiRTTI * NiRTTI_NiPSysModifierFloatCtlr; -extern const NiRTTI * NiRTTI_NiPSysFieldModifier; -extern const NiRTTI * NiRTTI_NiPSysModifierBoolCtlr; -extern const NiRTTI * NiRTTI_NiPSysCollider; -extern const NiRTTI * NiRTTI_BSMultiBound; -extern const NiRTTI * NiRTTI_BSMultiBoundRoom; -extern const NiRTTI * NiRTTI_BSMultiBoundAABB; -extern const NiRTTI * NiRTTI_BSMultiBoundOBB; -extern const NiRTTI * NiRTTI_BSXFlags; -extern const NiRTTI * NiRTTI_BSValueNode; -extern const NiRTTI * NiRTTI_BSWindModifier; -extern const NiRTTI * NiRTTI_BSTempNodeManager; -extern const NiRTTI * NiRTTI_BSTempNode; -extern const NiRTTI * NiRTTI_BSOcclusionShape; -extern const NiRTTI * NiRTTI_BSRangeNode; -extern const NiRTTI * NiRTTI_BSBlastNode; -extern const NiRTTI * NiRTTI_BSDebrisNode; -extern const NiRTTI * NiRTTI_BSDamageStage; -extern const NiRTTI * NiRTTI_BSPSysArrayEmitter; -extern const NiRTTI * NiRTTI_PArrayPoint; -extern const NiRTTI * NiRTTI_BSMultiStreamInstanceTriShape; -extern const NiRTTI * NiRTTI_BSMultiBoundShape; -extern const NiRTTI * NiRTTI_BSMultiBoundSphere; -extern const NiRTTI * NiRTTI_BSOcclusionBox; -extern const NiRTTI * NiRTTI_BSOcclusionPlane; -extern const NiRTTI * NiRTTI_BSPortal; -extern const NiRTTI * NiRTTI_BSPortalSharedNode; -extern const NiRTTI * NiRTTI_BSBodyMorphOffsetsExtraData; -extern const NiRTTI * NiRTTI_BSBehaviorGraphExtraData; -extern const NiRTTI * NiRTTI_NiBSBoneLODController; -extern const NiRTTI * NiRTTI_BSCullingProcess; -extern const NiRTTI * NiRTTI_BSParticleSystemManager; -extern const NiRTTI * NiRTTI_BSFurnitureMarkerNode; -extern const NiRTTI * NiRTTI_BSBound; -extern const NiRTTI * NiRTTI_BSMultiBoundNode; -extern const NiRTTI * NiRTTI_BSBoneMap; -extern const NiRTTI * NiRTTI_BSAnimInteractionMarker; -extern const NiRTTI * NiRTTI_BSSceneGraph; -extern const NiRTTI * NiRTTI_BSPSysMultiTargetEmitterCtlr; -extern const NiRTTI * NiRTTI_BSGeometryListCullingProcess; -extern const NiRTTI * NiRTTI_BSSubIndexTriShape; -extern const NiRTTI * NiRTTI_BSDistantObjectLargeRefExtraData; -extern const NiRTTI * NiRTTI_BSMasterParticleSystem; -extern const NiRTTI * NiRTTI_BSProceduralLightningController; -extern const NiRTTI * NiRTTI_BSInvMarker; -extern const NiRTTI * NiRTTI_BSBoneLODExtraData; -extern const NiRTTI * NiRTTI_BSReference; -extern const NiRTTI * NiRTTI_BSNodeReferences; -extern const NiRTTI * NiRTTI_BSDecalPlacementVectorExtraData; -extern const NiRTTI * NiRTTI_BSParentVelocityModifier; -extern const NiRTTI * NiRTTI_BSWArray; -extern const NiRTTI * NiRTTI_BSMultiBoundCapsule; -extern const NiRTTI * NiRTTI_BSPSysStripUpdateModifier; -extern const NiRTTI * NiRTTI_BSPSysSubTexModifier; -extern const NiRTTI * NiRTTI_BSPSysScaleModifier; -extern const NiRTTI * NiRTTI_BSLagBoneController; -extern const NiRTTI * NiRTTI_BSNonUniformScaleExtraData; -extern const NiRTTI * NiRTTI_BSNiNode; -extern const NiRTTI * NiRTTI_BSInstanceTriShape; -extern const NiRTTI * NiRTTI_bhkWorldObject; -extern const NiRTTI * NiRTTI_bhkWorld; -extern const NiRTTI * NiRTTI_bhkRigidBody; -extern const NiRTTI * NiRTTI_bhkCollisionObject; -extern const NiRTTI * NiRTTI_bhkNiCollisionObject; -extern const NiRTTI * NiRTTI_bhkAttachmentCollisionObject; -extern const NiRTTI * NiRTTI_WeaponObject; -extern const NiRTTI * NiRTTI_bhkRigidBodyT; -extern const NiRTTI * NiRTTI_bhkWorldM; -extern const NiRTTI * NiRTTI_bhkRefObject; -extern const NiRTTI * NiRTTI_bhkSerializable; -extern const NiRTTI * NiRTTI_bhkShape; -extern const NiRTTI * NiRTTI_bhkEntity; -extern const NiRTTI * NiRTTI_bhkPhantom; -extern const NiRTTI * NiRTTI_bhkAabbPhantom; -extern const NiRTTI * NiRTTI_bhkSphereRepShape; -extern const NiRTTI * NiRTTI_bhkConvexShape; -extern const NiRTTI * NiRTTI_bhkPCollisionObject; -extern const NiRTTI * NiRTTI_hkPackedNiTriStripsData; -extern const NiRTTI * NiRTTI_bhkShapePhantom; -extern const NiRTTI * NiRTTI_bhkSimpleShapePhantom; -extern const NiRTTI * NiRTTI_bhkCapsuleShape; -extern const NiRTTI * NiRTTI_bhkBoxShape; -extern const NiRTTI * NiRTTI_bhkSphereShape; -extern const NiRTTI * NiRTTI_bhkBvTreeShape; -extern const NiRTTI * NiRTTI_bhkNiTriStripsShape; -extern const NiRTTI * NiRTTI_bhkPackedNiTriStripsShape; -extern const NiRTTI * NiRTTI_bhkBlendCollisionObject; -extern const NiRTTI * NiRTTI_bhkAvoidBox; -extern const NiRTTI * NiRTTI_bhkLimitedHingeConstraint; -extern const NiRTTI * NiRTTI_bhkMalleableConstraint; -extern const NiRTTI * NiRTTI_bhkUnaryAction; -extern const NiRTTI * NiRTTI_bhkConstraint; -extern const NiRTTI * NiRTTI_bhkPrismaticConstraint; -extern const NiRTTI * NiRTTI_bhkAction; -extern const NiRTTI * NiRTTI_bhkTriSampledHeightFieldBvTreeShape; -extern const NiRTTI * NiRTTI_bhkCachingShapePhantom; -extern const NiRTTI * NiRTTI_bhkRagdollTemplateData; -extern const NiRTTI * NiRTTI_bhkRagdollTemplate; -extern const NiRTTI * NiRTTI_bhkSPCollisionObject; -extern const NiRTTI * NiRTTI_bhkMouseSpringAction; -extern const NiRTTI * NiRTTI_bhkHingeConstraint; -extern const NiRTTI * NiRTTI_bhkCompressedMeshShape; -extern const NiRTTI * NiRTTI_bhkCompressedMeshShapeData; -extern const NiRTTI * NiRTTI_bhkConvexSweepShape; -extern const NiRTTI * NiRTTI_bhkConvexTransformShape; -extern const NiRTTI * NiRTTI_bhkConvexTranslateShape; -extern const NiRTTI * NiRTTI_bhkConvexVerticesShape; -extern const NiRTTI * NiRTTI_bhkCylinderShape; -extern const NiRTTI * NiRTTI_bhkMultiSphereShape; -extern const NiRTTI * NiRTTI_bhkPlaneShape; -extern const NiRTTI * NiRTTI_bhkTriangleShape; -extern const NiRTTI * NiRTTI_bhkMoppBvTreeShape; -extern const NiRTTI * NiRTTI_bhkTransformShape; -extern const NiRTTI * NiRTTI_bhkListShape; -extern const NiRTTI * NiRTTI_bhkBallAndSocketConstraint; -extern const NiRTTI * NiRTTI_bhkBallSocketConstraintChain; -extern const NiRTTI * NiRTTI_bhkGroupConstraint; -extern const NiRTTI * NiRTTI_bhkHingeLimitsConstraint; -extern const NiRTTI * NiRTTI_bhkFixedConstraint; -extern const NiRTTI * NiRTTI_bhkRagdollConstraint; -extern const NiRTTI * NiRTTI_bhkRagdollLimitsConstraint; -extern const NiRTTI * NiRTTI_bhkStiffSpringConstraint; -extern const NiRTTI * NiRTTI_bhkWheelConstraint; -extern const NiRTTI * NiRTTI_bhkBreakableConstraint; -extern const NiRTTI * NiRTTI_bhkAngularDashpotAction; -extern const NiRTTI * NiRTTI_bhkDashpotAction; -extern const NiRTTI * NiRTTI_bhkLiquidAction; -extern const NiRTTI * NiRTTI_bhkMotorAction; -extern const NiRTTI * NiRTTI_bhkOrientHingedBodyAction; -extern const NiRTTI * NiRTTI_bhkSpringAction; -extern const NiRTTI * NiRTTI_bhkBlendController; -extern const NiRTTI * NiRTTI_bhkExtraData; -extern const NiRTTI * NiRTTI_bhkPoseArray; -extern const NiRTTI * NiRTTI_bhkGenericConstraint; -extern const NiRTTI * NiRTTI_bhkCharControllerShape; -extern const NiRTTI * NiRTTI_bhkCollisionBox; -extern const NiRTTI * NiRTTI_bhkShapeCollection; -extern const NiRTTI * NiRTTI_bhkPositionConstraintMotor; -extern const NiRTTI * NiRTTI_bhkVelocityConstraintMotor; -extern const NiRTTI * NiRTTI_bhkSpringDamperConstraintMotor; -extern const NiRTTI * NiRTTI_bhkCharacterProxy; -extern const NiRTTI * NiRTTI_bhkCharacterRigidBody; -extern const NiRTTI * NiRTTI_bhkHeightFieldShape; -extern const NiRTTI * NiRTTI_bhkConstraintChain; -extern const NiRTTI * NiRTTI_bhkBinaryAction; -extern const NiRTTI * NiRTTI_bhkPointToPathConstraint; -extern const NiRTTI * NiRTTI_DebugTextExtraData; -extern const NiRTTI * NiRTTI_BSFadeNode; -extern const NiRTTI * NiRTTI_BSShaderProperty; -extern const NiRTTI * NiRTTI_BSLeafAnimNode; -extern const NiRTTI * NiRTTI_BSTreeNode; -extern const NiRTTI * NiRTTI_ShadowSceneNode; -extern const NiRTTI * NiRTTI_BSLightingShaderProperty; -extern const NiRTTI * NiRTTI_BSGrassShaderProperty; -extern const NiRTTI * NiRTTI_BSShaderAccumulator; -extern const NiRTTI * NiRTTI_BSEffectShaderProperty; -extern const NiRTTI * NiRTTI_BSWaterShaderProperty; -extern const NiRTTI * NiRTTI_BSBloodSplatterShaderProperty; -extern const NiRTTI * NiRTTI_BSParticleShaderProperty; -extern const NiRTTI * NiRTTI_BSTextureSet; -extern const NiRTTI * NiRTTI_BSShaderTextureSet; -extern const NiRTTI * NiRTTI_BSSkyShaderProperty; -extern const NiRTTI * NiRTTI_BSFadeNodeCuller; -extern const NiRTTI * NiRTTI_BSDistantTreeShaderProperty; -extern const NiRTTI * NiRTTI_BSCubeMapCamera; -extern const NiRTTI * NiRTTI_BSFogProperty; -extern const NiRTTI * NiRTTI_BSClearZNode; -extern const NiRTTI * NiRTTI_NiCollisionObject; -extern const NiRTTI * NiRTTI_BSOrderedNode; -extern const NiRTTI * NiRTTI_BSLines; -extern const NiRTTI * NiRTTI_BSDynamicLines; -extern const NiRTTI * NiRTTI_BSMultiIndexTriShape; -extern const NiRTTI * NiRTTI_BSLightingShaderPropertyFloatController; -extern const NiRTTI * NiRTTI_BSLightingShaderPropertyUShortController; -extern const NiRTTI * NiRTTI_BSLightingShaderPropertyColorController; -extern const NiRTTI * NiRTTI_BSEffectShaderPropertyFloatController; -extern const NiRTTI * NiRTTI_BSEffectShaderPropertyColorController; -extern const NiRTTI * NiRTTI_BSNiAlphaPropertyTestRefController; -extern const NiRTTI * NiRTTI_BSPSysSimpleColorModifier; -extern const NiRTTI * NiRTTI_BSPSysLODModifier; -extern const NiRTTI * NiRTTI_BSParabolicCullingProcess; -extern const NiRTTI * NiRTTI_BSMeshLODTriShape; -extern const NiRTTI * NiRTTI_BSLODMultiIndexTriShape; -extern const NiRTTI * NiRTTI_BSSubIndexLandTriShape; diff --git a/source/fs.dll/skse64/skse64/NiRenderer.cpp b/source/fs.dll/skse64/skse64/NiRenderer.cpp deleted file mode 100644 index 82e6c205..00000000 --- a/source/fs.dll/skse64/skse64/NiRenderer.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "skse64/NiRenderer.h" - -// 984B8D46444288152A10744FB7226DC9943D175E+57 -RelocPtr g_renderManager(0x030C3C40); - -BSRenderManager * BSRenderManager::GetSingleton() -{ - return g_renderManager; -} - -// 56C98A6AC471728E145A8629B087CE2BE81252C1+CC -RelocPtr g_shaderResourceManager(0x030AF4C0); diff --git a/source/fs.dll/skse64/skse64/NiRenderer.h b/source/fs.dll/skse64/skse64/NiRenderer.h deleted file mode 100644 index 237595f5..00000000 --- a/source/fs.dll/skse64/skse64/NiRenderer.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "skse64/NiObjects.h" -#include "skse64/NiTextures.h" - -#include "skse64/GameTypes.h" - -struct ID3D11Device; -struct ID3D11DeviceContext; -struct IDXGISwapChain4; -struct ID3D11RenderTargetView1; -struct ID3D11ShaderResourceView1; - -// Unknown class name, No RTTI -class BSRenderManager -{ -public: - static BSRenderManager * GetSingleton(); - - UInt64 unk00[0x48 >> 3]; // 00 - ID3D11Device * forwarder; // 48 - Actually CID3D11Forwarder - ID3D11DeviceContext * context; // 50 - ID3D11DeviceContext4 - UInt64 unk58; // 58 - UInt64 unk60; // 60 - UInt64 unk68; // 68 - IDXGISwapChain4 * swapChain; // 70 - UInt64 unk78; // 78 - UInt64 unk80; // 80 - ID3D11RenderTargetView1 * renderView; // 88 - ID3D11ShaderResourceView1 * resourceView; // 90 - UInt64 unk2788[(0x2788 - 0x90) >> 3]; - CRITICAL_SECTION lock; // 2790 - - // 141415050 - CreateRenderTargets - - DEFINE_MEMBER_FN_2(CreateRenderTexture, NiTexture::RendererData *, 0x00DAA470, UInt32 width, UInt32 height); -}; - -extern RelocPtr g_renderManager; - -class BSShaderResourceManager -{ -public: - virtual ~BSShaderResourceManager(); -}; -extern RelocPtr g_shaderResourceManager; diff --git a/source/fs.dll/skse64/skse64/NiSerialization.cpp b/source/fs.dll/skse64/skse64/NiSerialization.cpp deleted file mode 100644 index d7db35a7..00000000 --- a/source/fs.dll/skse64/skse64/NiSerialization.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/NiSerialization.h" diff --git a/source/fs.dll/skse64/skse64/NiSerialization.h b/source/fs.dll/skse64/skse64/NiSerialization.h deleted file mode 100644 index f2491f97..00000000 --- a/source/fs.dll/skse64/skse64/NiSerialization.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/NiTypes.h" - -class NiBinaryStream; -class NiObject; - -// 620+ -class NiStream -{ -public: - NiStream(); - virtual ~NiStream(); - - virtual bool LoadStream(NiBinaryStream * stream); - virtual bool LoadBuf(char * buf, UInt32 len); - virtual bool LoadPath(const char * path); - virtual bool SaveStream(NiBinaryStream * stream); - virtual bool SaveBuf(char ** buf, UInt32 * len); - virtual bool SavePath(const char * path); - - MEMBER_FN_PREFIX(NiStream); - DEFINE_MEMBER_FN(ctor, NiStream *, 0x00C81DB0); - DEFINE_MEMBER_FN(dtor, void, 0x00C82010); - DEFINE_MEMBER_FN(AddObject, void, 0x00C82210, NiObject * object); - -// void ** _vtbl; // 000 - UInt64 pad004[(0x218 - 0x008) >> 3]; // 008 - NiTLargeArray m_objects; // 218 - NiTLargeArray m_objectSizes; // 238 - NiTLargeArray m_rootObjects; // 258 - NiTLargeArray m_stringTable; // 278 - UInt64 unk298; // 298 - UInt64 unk2A0; // 2A0 - UInt64 unk2A8; // 2A8 - NiTMap m_pointerMap; // 2B0 - UInt64 unk2D0[(0x300 - 0x2D0) >> 3]; // 2D0 - UInt32 unk300; // 300 - SInt32 unk304; // 304 - UInt32 unk308; // 308 - char unk30C[MAX_PATH]; // 30C - UInt32 unk410; - UInt32 unk414; - UInt64 unk418[(0x518 - 0x418) >> 3]; // 418 - char unk518[MAX_PATH]; // 518 -}; -STATIC_ASSERT(offsetof(NiStream, m_objects) == 0x218); -STATIC_ASSERT(offsetof(NiStream, m_objectSizes) == 0x238); -STATIC_ASSERT(offsetof(NiStream, m_rootObjects) == 0x258); -STATIC_ASSERT(offsetof(NiStream, m_stringTable) == 0x278); - -// 638 -class BSStream : public NiStream -{ -public: - MEMBER_FN_PREFIX(BSStream); - DEFINE_MEMBER_FN(dtor, void, 0x001557C0); - - UInt64 unk620; - UInt64 unk628; - UInt64 unk630; -}; - -class DeepCopyStream : public NiStream -{ -public: - DeepCopyStream(); - virtual ~DeepCopyStream(); - - MEMBER_FN_PREFIX(DeepCopyStream); - DEFINE_MEMBER_FN(SaveStream, bool, 0x00C826B0, char ** buffer, UInt32 * length); - DEFINE_MEMBER_FN(LoadStream, bool, 0x00C82660, char * buffer, UInt32 length); -}; diff --git a/source/fs.dll/skse64/skse64/NiTextures.cpp b/source/fs.dll/skse64/skse64/NiTextures.cpp deleted file mode 100644 index 681296ad..00000000 --- a/source/fs.dll/skse64/skse64/NiTextures.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "skse64/NiTextures.h" - -RelocAddr<_CreateSourceTexture> CreateSourceTexture(0x00C91F70); -RelocAddr<_LoadTexture> LoadTexture(0x013BCA60); diff --git a/source/fs.dll/skse64/skse64/NiTextures.h b/source/fs.dll/skse64/skse64/NiTextures.h deleted file mode 100644 index fd0db58d..00000000 --- a/source/fs.dll/skse64/skse64/NiTextures.h +++ /dev/null @@ -1,204 +0,0 @@ -#pragma once - -#include "skse64/NiObjects.h" -#include "skse64/GameAPI.h" -#include "skse64_common/Utilities.h" -#include "skse64/GameTypes.h" - -class BSResourceStream; - -struct ID3D11Texture2D; -struct ID3D11ShaderResourceView; - -// 44 -class NiPixelFormat -{ -public: - // 0C - class NiComponentSpec - { - public: - UInt32 type; // 00 - UInt32 format; // 04 - UInt8 bits; // 08 - UInt8 isSigned; // 09 - UInt8 pad0A; // 0A - UInt8 pad0B; // 0B - }; - - UInt8 flags; // 00 - UInt8 bpp; // 01 - UInt8 srgb; // 02 - UInt8 pad03; // 03 - UInt32 format; // 04 - UInt32 tiling; // 08 - UInt32 rendererHint; // 0C - UInt32 extraData; // 10 - - NiComponentSpec components[4]; // 14 -}; - - -class NiPersistentSrcTextureRendererData : public NiObject -{ -public: - virtual ~NiPersistentSrcTextureRendererData(); -}; - -MAKE_NI_POINTER(NiPersistentSrcTextureRendererData); - -class NiDX9PersistentSrcTextureRendererData : public NiPersistentSrcTextureRendererData -{ -public: - virtual ~NiDX9PersistentSrcTextureRendererData(); -}; - -class NiPixelData : public NiObject -{ -public: - virtual ~NiPixelData(); - - NiPixelFormat pixelFormat; // 08 - void * unk0C; // 4C - - UInt8 * m_pucPixels; // 50 [mipmapLevels] - UInt32 * m_puiWidth; // 54 [mipmapLevels] - UInt32 * m_puiHeight; // 58 [mipmapLevels] - UInt32 * m_puiOffset; // 5C [mipmapLevels + 1] - - UInt32 m_uiMipmapLevels; // 60 - UInt32 m_uiPixelStride; // 64 - - UInt32 unk68; // 68 - UInt32 m_uiFaces; // 6C - UInt8 unk70; // 70 - UInt8 pad71[3]; // 71 - - UInt32 GetWidth(UInt32 mipmapLevel) - { - return m_puiWidth[mipmapLevel]; - } - - UInt32 GetHeight(UInt32 mipmapLevel) - { - return m_puiHeight[mipmapLevel]; - } - - UInt8 * GetPixels(UInt32 uiMipmapLevel = 0, UInt32 uiFace = 0) - { - return m_pucPixels + uiFace*m_puiOffset[uiMipmapLevel] + - m_puiOffset[uiMipmapLevel]; - }; -}; - -MAKE_NI_POINTER(NiPixelData); - -// 14 -class Ni2DBuffer : public NiObject -{ -public: - virtual ~Ni2DBuffer(); - - UInt32 width; // 08 - UInt32 height; // 0C - void * rendererData; // 10 -}; - -// 24 -class NiTexture : public NiObject -{ -public: - virtual ~NiTexture(); - - virtual void Unk_25(void); - virtual void Unk_26(void); - virtual void Unk_27(void); - virtual void Unk_28(UInt32 * unk1, UInt32 * unk2, UInt32 * unk3, UInt32 * unk4); - virtual void Unk_29(void); - virtual void Unk_2A(void); - virtual void Unk_2B(void); - - // 28 - class RendererData - { - public: - RendererData(UInt32 w, UInt32 h) - : texture(nullptr) - , unk08(0) - , resourceView(nullptr) - , width(w) - , height(h) - , unk1C(1) - , unk1D(0x1C) - , unk1E(0) - , unk20(1) - , unk24(0x00130012) - {} - - ID3D11Texture2D * texture; // 00 - UInt64 unk08; // 08 - ID3D11ShaderResourceView * resourceView; // 10 - UInt16 width; // 18 - UInt16 height; // 1A - UInt8 unk1C; // 1C - UInt8 unk1D; // 1D - UInt16 unk1E; // 1E - UInt32 unk20; // 20 - UInt32 unk24; // 24 - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free); - }; - - UInt32 unk10; // 10 - 6 - UInt32 unk14; // 14 - 3 - UInt32 unk18; // 18 - 2 - UInt32 unk1C; // 1C - const char * name; // 20 - UInt32 unk28; // 28 - FFFFFF - UInt32 unk2C; // 2C - NiTexture * prevTexture; // 30 - NiTexture * nextTexture; // 38 - BSResourceStream * resourceData; // 40 - RendererData * rendererData; // 48 -}; - -// ?? -class NiRenderedTexture : public NiTexture -{ -public: - virtual ~NiRenderedTexture(); - - MEMBER_FN_PREFIX(NiRenderedTexture); - DEFINE_MEMBER_FN(ctor, void, 0x00000000); - DEFINE_MEMBER_FN(UpdateVirtualImage, void, 0x00F113F0, NiRenderedTexture * newTexture); - DEFINE_MEMBER_FN(AddVirtualImage, UInt8, 0x00F114C0, BSFixedString linkageName); - DEFINE_MEMBER_FN(ReleaseVirtualImage, void, 0x00F11380); -}; - -// 58 -class NiRenderedCubeMap : public NiRenderedTexture -{ -public: - virtual ~NiRenderedCubeMap(); - - UInt32 unk3C; // 3C - UInt32 unk40; // 40 - UInt32 unk44; // 44 - UInt32 unk48; // 48 - UInt32 unk4C; // 4C - UInt32 unk50; // 50 - UInt32 unk54; // 54 -}; - -// 34 -class NiSourceTexture : public NiTexture -{ -public: - UInt8 flags; // 50 - C (normal), 8 (rendered) -}; - -typedef NiTexture * (*_CreateSourceTexture)(const BSFixedString & name); -extern RelocAddr<_CreateSourceTexture> CreateSourceTexture; - -typedef void (*_LoadTexture)(const char * path, UInt8 unk1, NiPointer & texture, bool unk2); -extern RelocAddr<_LoadTexture> LoadTexture; diff --git a/source/fs.dll/skse64/skse64/NiTypes.cpp b/source/fs.dll/skse64/skse64/NiTypes.cpp deleted file mode 100644 index 587fef6f..00000000 --- a/source/fs.dll/skse64/skse64/NiTypes.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#include "skse64/NiTypes.h" - -NiPoint3::NiPoint3() -{ - x = 0.0f; - y = 0.0f; - z = 0.0f; -} - -NiPoint3 NiPoint3::operator- () const -{ - return NiPoint3(-x, -y, -z); -} - -NiPoint3 NiPoint3::operator+ (const NiPoint3& pt) const -{ - return NiPoint3(x + pt.x, y + pt.y, z + pt.z); -} - -NiPoint3 NiPoint3::operator- (const NiPoint3& pt) const -{ - return NiPoint3(x - pt.x, y - pt.y, z - pt.z); -} - -NiPoint3& NiPoint3::operator+= (const NiPoint3& pt) -{ - x += pt.x; - y += pt.y; - z += pt.z; - return *this; -} -NiPoint3& NiPoint3::operator-= (const NiPoint3& pt) -{ - x -= pt.x; - y -= pt.y; - z -= pt.z; - return *this; -} - -// Scalar operations -NiPoint3 NiPoint3::operator* (float scalar) const -{ - return NiPoint3(scalar * x, scalar * y, scalar * z); -} -NiPoint3 NiPoint3::operator/ (float scalar) const -{ - float invScalar = 1.0f / scalar; - return NiPoint3(invScalar * x, invScalar * y, invScalar * z); -} - -NiPoint3& NiPoint3::operator*= (float scalar) -{ - x *= scalar; - y *= scalar; - z *= scalar; - return *this; -} -NiPoint3& NiPoint3::operator/= (float scalar) -{ - float invScalar = 1.0f / scalar; - x *= invScalar; - y *= invScalar; - z *= invScalar; - return *this; -} - -void NiMatrix33::Identity() -{ - data[0][0] = 1.0f; - data[0][1] = 0.0f; - data[0][2] = 0.0f; - data[1][0] = 0.0f; - data[1][1] = 1.0f; - data[1][2] = 0.0f; - data[2][0] = 0.0f; - data[2][1] = 0.0f; - data[2][2] = 1.0f; -} - -NiMatrix33 NiMatrix33::operator* (const NiMatrix33& rhs) const -{ - NiMatrix33 tmp; - tmp.data[0][0] = - data[0][0]*rhs.data[0][0]+ - data[0][1]*rhs.data[1][0]+ - data[0][2]*rhs.data[2][0]; - tmp.data[1][0] = - data[1][0]*rhs.data[0][0]+ - data[1][1]*rhs.data[1][0]+ - data[1][2]*rhs.data[2][0]; - tmp.data[2][0] = - data[2][0]*rhs.data[0][0]+ - data[2][1]*rhs.data[1][0]+ - data[2][2]*rhs.data[2][0]; - tmp.data[0][1] = - data[0][0]*rhs.data[0][1]+ - data[0][1]*rhs.data[1][1]+ - data[0][2]*rhs.data[2][1]; - tmp.data[1][1] = - data[1][0]*rhs.data[0][1]+ - data[1][1]*rhs.data[1][1]+ - data[1][2]*rhs.data[2][1]; - tmp.data[2][1] = - data[2][0]*rhs.data[0][1]+ - data[2][1]*rhs.data[1][1]+ - data[2][2]*rhs.data[2][1]; - tmp.data[0][2] = - data[0][0]*rhs.data[0][2]+ - data[0][1]*rhs.data[1][2]+ - data[0][2]*rhs.data[2][2]; - tmp.data[1][2] = - data[1][0]*rhs.data[0][2]+ - data[1][1]*rhs.data[1][2]+ - data[1][2]*rhs.data[2][2]; - tmp.data[2][2] = - data[2][0]*rhs.data[0][2]+ - data[2][1]*rhs.data[1][2]+ - data[2][2]*rhs.data[2][2]; - return tmp; -} - -NiMatrix33 NiMatrix33::operator* (float scalar) const -{ - NiMatrix33 result; - result.data[0][0] = data[0][0] * scalar; - result.data[0][1] = data[0][1] * scalar; - result.data[0][2] = data[0][2] * scalar; - result.data[1][0] = data[1][0] * scalar; - result.data[1][1] = data[1][1] * scalar; - result.data[1][2] = data[1][2] * scalar; - result.data[2][0] = data[2][0] * scalar; - result.data[2][1] = data[2][1] * scalar; - result.data[2][2] = data[2][2] * scalar; - return result; -} - -NiPoint3 NiMatrix33::operator* (const NiPoint3& pt) const -{ - return NiPoint3 - ( - data[0][0]*pt.x+data[0][1]*pt.y+data[0][2]*pt.z, - data[1][0]*pt.x+data[1][1]*pt.y+data[1][2]*pt.z, - data[2][0]*pt.x+data[2][1]*pt.y+data[2][2]*pt.z - ); -} - -NiMatrix33 NiMatrix33::Transpose() const -{ - NiMatrix33 result; - result.data[0][0] = data[0][0]; - result.data[0][1] = data[1][0]; - result.data[0][2] = data[2][0]; - result.data[1][0] = data[0][1]; - result.data[1][1] = data[1][1]; - result.data[1][2] = data[2][1]; - result.data[2][0] = data[0][2]; - result.data[2][1] = data[1][2]; - result.data[2][2] = data[2][2]; - return result; -} - -// Converted from Java to C -// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm -void NiMatrix33::GetEulerAngles(float * heading, float * attitude, float * bank) -{ - if (data[1][0] > 0.998) { // singularity at north pole - *heading = atan2(data[0][2], data[2][2]); - *attitude = MATH_PI / 2; - *bank = 0; - } - else if (data[1][0] < -0.998) { // singularity at south pole - *heading = atan2(data[0][2], data[2][2]); - *attitude = -MATH_PI / 2; - *bank = 0; - } - else { - *heading = atan2(-data[2][0], data[0][0]); - *bank = atan2(-data[1][2], data[1][1]); - *attitude = asin(data[1][0]); - } -} - -// Converted from Java to C -// http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToMatrix/index.htm -void NiMatrix33::SetEulerAngles(float heading, float attitude, float bank) -{ - double ch = cos(heading); - double sh = sin(heading); - double ca = cos(attitude); - double sa = sin(attitude); - double cb = cos(bank); - double sb = sin(bank); - - data[0][0] = ch * ca; - data[0][1] = sh * sb - ch * sa * cb; - data[0][2] = ch * sa * sb + sh * cb; - data[1][0] = sa; - data[1][1] = ca * cb; - data[1][2] = -ca * sb; - data[2][0] = -sh * ca; - data[2][1] = sh * sa * cb + ch * sb; - data[2][2] = -sh * sa * sb + ch * cb; -} - -NiTransform::NiTransform() -{ - rot.Identity(); - scale = 1.0f; -} - -NiTransform NiTransform::operator*(const NiTransform &rhs) const -{ - NiTransform tmp; - tmp.scale = scale * rhs.scale; - tmp.rot = rot * rhs.rot; - tmp.pos = pos + (rot * rhs.pos) * scale; - return tmp; -} - -NiPoint3 NiTransform::operator*(const NiPoint3 & pt) const -{ - return (((rot * pt) * scale) + pos); -} - -void NiTransform::Invert(NiTransform& kDest) const -{ - kDest.rot = rot.Transpose(); - kDest.scale = 1.0f / scale; - kDest.pos = (kDest.rot * -pos) * kDest.scale; -} diff --git a/source/fs.dll/skse64/skse64/NiTypes.h b/source/fs.dll/skse64/skse64/NiTypes.h deleted file mode 100644 index 82797058..00000000 --- a/source/fs.dll/skse64/skse64/NiTypes.h +++ /dev/null @@ -1,419 +0,0 @@ -#pragma once - -// 4 -template -class NiPointer -{ -public: - T * m_pObject; // 00 - - inline NiPointer(const NiPointer& rhs) : - m_pObject(rhs.m_pObject) - { - if (m_pObject) { - m_pObject->IncRef(); - } - } - - inline NiPointer(T* pObject = (T*) 0) - { - m_pObject = pObject; - if(m_pObject) m_pObject->IncRef(); - } - - inline ~NiPointer() - { - if(m_pObject) m_pObject->DecRef(); - } - - inline operator T *() const - { - return m_pObject; - } - - inline T & operator*() const - { - return *m_pObject; - } - - inline T * operator->() const - { - return m_pObject; - } - - inline NiPointer & operator=(const NiPointer & rhs) - { - if(m_pObject != rhs.m_pObject) - { - if(rhs) rhs.m_pObject->IncRef(); - if(m_pObject) m_pObject->DecRef(); - - m_pObject = rhs.m_pObject; - } - - return *this; - } - - inline NiPointer & operator=(T * rhs) - { - if(m_pObject != rhs) - { - if(rhs) rhs->IncRef(); - if(m_pObject) m_pObject->DecRef(); - - m_pObject = rhs; - } - - return *this; - } - - inline bool operator==(T * pObject) const - { - return m_pObject == pObject; - } - - inline bool operator!=(T * pObject) const - { - return m_pObject != pObject; - } - - inline bool operator==(const NiPointer & ptr) const - { - return m_pObject == ptr.m_pObject; - } - - inline bool operator!=(const NiPointer & ptr) const - { - return m_pObject != ptr.m_pObject; - } - - inline T* get() - { - return m_pObject; - } -}; - -#define MAKE_NI_POINTER(x) class x; typedef NiPointer x##Ptr - -template -T_to * niptr_cast(const T_from & src) -{ - return static_cast (src.m_pObject); -} - -// 10 -template -class NiRect -{ -public: - T m_left; // 00 - T m_right; // 04 - T m_top; // 08 - T m_bottom; // 0C -}; - -// 1C -class NiFrustum -{ -public: - float m_fLeft; // 00 - float m_fRight; // 04 - float m_fTop; // 08 - float m_fBottom; // 0C - float m_fNear; // 10 - float m_fFar; // 14 - bool m_bOrtho; // 18 -}; - -// 10 -class NiQuaternion -{ -public: - // w is first - - float m_fW; // 0 - float m_fX; // 4 - float m_fY; // 8 - float m_fZ; // C -}; - -// 8 -class NiPoint2 -{ -public: - float x; // 0 - float y; // 4 -}; - -// C -class NiPoint3 -{ -public: - float x; // 0 - float y; // 4 - float z; // 8 - - NiPoint3(); - NiPoint3(float X, float Y, float Z) : x(X), y(Y), z(Z) { }; - - // Negative - NiPoint3 operator- () const; - - // Basic operations - NiPoint3 operator+ (const NiPoint3& pt) const; - NiPoint3 operator- (const NiPoint3& pt) const; - - NiPoint3& operator+= (const NiPoint3& pt); - NiPoint3& operator-= (const NiPoint3& pt); - - // Scalar operations - NiPoint3 operator* (float fScalar) const; - NiPoint3 operator/ (float fScalar) const; - - NiPoint3& operator*= (float fScalar); - NiPoint3& operator/= (float fScalar); -}; - -// 0C -class NiColor -{ -public: - float r; // 0 - float g; // 4 - float b; // 8 -}; - -// 10 -class NiColorA -{ -public: - float r; // 0 - float g; // 4 - float b; // 8 - float a; // C -}; - -// math.h -#define MATH_PI 3.14159265358979323846 - -// 24 -class NiMatrix33 -{ -public: - union - { - float data[3][3]; - float arr[9]; - }; - - void Identity(); - - // Addition/Subtraction - NiMatrix33 operator+(const NiMatrix33& mat) const; - NiMatrix33 operator-(const NiMatrix33& mat) const; - - // Matric mult - NiMatrix33 operator*(const NiMatrix33& mat) const; - - // Vector mult - NiPoint3 operator*(const NiPoint3& pt) const; - - // Scalar multiplier - NiMatrix33 operator*(float fScalar) const; - - NiMatrix33 Transpose() const; - - void GetEulerAngles(float * heading, float * attitude, float * bank); - void SetEulerAngles(float heading, float attitude, float bank); -}; - -STATIC_ASSERT(sizeof(NiMatrix33) == 0x24); - -// 34 -class NiTransform -{ -public: - NiMatrix33 rot; // 00 - NiPoint3 pos; // 24 - float scale; // 30 - - NiTransform(); - - // Multiply transforms - NiTransform operator*(const NiTransform &rhs) const; - - // Transform point - NiPoint3 operator*(const NiPoint3 &pt) const; - - // Invert - void Invert(NiTransform& kDest) const; -}; - -STATIC_ASSERT(sizeof(NiTransform) == 0x34); - -// 10 -class NiBound -{ -public: - NiPoint3 pos; - float radius; -}; - -STATIC_ASSERT(sizeof(NiBound) == 0x10); - -// 20 -// derives from NiTMapBase, we don't bother -template -class NiTMap -{ -public: - virtual ~NiTMap(); - - struct NiTMapItem - { - NiTMapItem * next; - T_key key; - T_data data; - }; - - T_data Get(T_key key) - { - UInt32 bucket = GetBucket(key); - - for(NiTMapItem * iter = buckets[bucket]; iter; iter = iter->next) - { - if(Compare(iter->key, key)) - { - return iter->data; - } - } - - return T_data(); - } - - virtual UInt32 GetBucket(T_key key); // return hash % numBuckets; - virtual bool Compare(T_key lhs, T_key rhs); // return lhs == rhs; - virtual void FillItem(NiTMapItem * item, T_key key, T_data data); - // item->key = key; item->data = data; - virtual void Fn_04(UInt32 arg); // nop - virtual NiTMapItem * AllocItem(void); // return new NiTMapItem; - virtual void FreeItem(NiTMapItem * item); // item->data = 0; delete item; - -// void ** _vtbl; // 00 - UInt32 numBuckets; // 08 - UInt32 unk0C; // 0C - NiTMapItem ** buckets; // 10 - UInt32 numEntries; // 18 - UInt32 unk1C; // 1C -}; - -// 10 -template -class NiTPointerMap : NiTMap -{ -public: -}; - -// 18 -template -class NiTArray -{ -public: - NiTArray(); - virtual ~NiTArray(); - - // sparse array, can have NULL entries that should be skipped - // iterate from 0 to m_emptyRunStart - 1 - -// void ** _vtbl; // 00 - T * m_data; // 08 - UInt16 m_arrayBufLen; // 10 - max elements storable in m_data - UInt16 m_emptyRunStart; // 12 - index of beginning of empty slot run - UInt16 m_size; // 14 - number of filled slots - UInt16 m_growSize; // 16 - number of slots to grow m_data by -}; -STATIC_ASSERT(sizeof(NiTArray ) == 0x18); - -// 20 -template -class NiTLargeArray -{ -public: - NiTLargeArray(); - virtual ~NiTLargeArray(); - - // fast, doesn't search for empty slots - void NiTLargeArray::Append(T item) - { - if(m_emptyRunStart == m_arrayBufLen) - { - // need to expand the array - Resize(m_arrayBufLen + 1); - } - - m_data[m_emptyRunStart] = item; - m_emptyRunStart++; - m_size++; - } - - void NiTLargeArray::Resize(UInt32 size) - { - // not reclaiming memory yet - if(size <= m_size) return; - - ASSERT(m_growSize); - - // obey min grow size - UInt32 growSize = size - m_size; - if(growSize < m_growSize) - growSize = m_growSize; - - size = m_arrayBufLen + growSize; - - // create new array - T * newData = (T *)FormHeap_Allocate(sizeof(T) * size); - - for(UInt32 i = 0; i < size; i++) - { - new (&newData[i]) T; - newData[i] = 0; - } - - // copy over data, compacting as we go - UInt32 iter = 0; - - for(UInt32 i = 0; i < m_emptyRunStart; i++) - { - if(m_data[i]) - { - newData[iter] = m_data[i]; - iter++; - } - } - - // update pointers - T * oldData = m_data; - UInt32 oldDataLen = m_emptyRunStart; - - m_data = newData; - m_arrayBufLen = size; - m_emptyRunStart = m_size; - - // delete old array - if(oldData) - { - for(UInt32 i = 0; i < oldDataLen; i++) - if(oldData[i]) - oldData[i].~T(); - - FormHeap_Free(oldData); - } - } - -// void ** _vtbl; // 00 - T * m_data; // 08 - UInt32 m_arrayBufLen; // 10 - max elements storable in m_data - UInt32 m_emptyRunStart; // 14 - index of beginning of empty slot run - UInt32 m_size; // 18 - number of filled slots - UInt32 m_growSize; // 1C - number of slots to grow m_data by -}; diff --git a/source/fs.dll/skse64/skse64/ObScript.cpp b/source/fs.dll/skse64/skse64/ObScript.cpp deleted file mode 100644 index 1c61d96a..00000000 --- a/source/fs.dll/skse64/skse64/ObScript.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "ObScript.h" -#include "skse64_common\Relocation.h" - -// B0061DDA35158B8956EF9CFBDD3D63C5B4C96A8D+33 -RelocPtr g_firstObScriptCommand(0x01E4D9B0); -// B0061DDA35158B8956EF9CFBDD3D63C5B4C96A8D+F -RelocPtr g_firstConsoleCommand(0x01E5C000); - -// 42E5B9018CCF84B813403067F1D963D8C753ED8D+4C -RelocAddr <_ObScript_ExtractArgs> ObScript_ExtractArgs(0x002FC800); diff --git a/source/fs.dll/skse64/skse64/ObScript.h b/source/fs.dll/skse64/skse64/ObScript.h deleted file mode 100644 index 41402062..00000000 --- a/source/fs.dll/skse64/skse64/ObScript.h +++ /dev/null @@ -1,139 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" - -class TESObjectREFR; -class Script; -class ScriptLocals; -class ScriptLineBuffer; -class ScriptBuffer; - -// 0C -struct ObScriptParam -{ - enum Type - { - kType_String = 0x0, - kType_Integer = 0x1, - kType_Float = 0x2, - kType_ObjectReference = 0x4, - kType_ActorValue = 0x5, - kType_Actor = 0x6, - kType_SpellItem = 0x7, - kType_Axis = 0x8, - kType_Cell = 0x9, - kType_AnimationGroup = 0x0A, - kType_MagicItem = 0x0B, - kType_Sound = 0x0C, - kType_Topic = 0x0D, - kType_Quest = 0x0E, - kType_Race = 0x0F, - kType_Class = 0x10, - kType_Faction = 0x11, - kType_Sex = 0x12, - kType_Object = 0x15, - kType_VariableName = 0x16, - kType_QuestStage = 0x17, - kType_MapMarker = 0x18, - kType_ActorBase = 0x19, - kType_Coontainer = 0x1A, - kType_WorldSpace = 0x1B, - kType_CrimeType = 0x1C, - kType_Package = 0x1D, - kType_MagicEffect = 0x1F, - kType_Weather = 0x21, - kType_Owner = 0x23, - kType_EffectShader = 0x24, - kType_FormList = 0x25, - kType_Perk = 0x27, - kType_Note = 0x28, - kType_MiscellaneousStat = 0x29, - kType_ImagespaceModifier = 0x2A, - kType_EventFunction = 0x2E, - kType_EventMember = 0x2F, - kType_EventData = 0x30, - kType_Voice = 0x31, - kType_EncounterZone = 0x32, - kType_Message = 0x34, - kType_ObjectID = 0x35, - kType_Alignment = 0x36, - kType_EquipType = 0x37, - kType_Music = 0x39, - kType_Keyword = 0x3B, - kType_RefType = 0x3C, - kType_Location = 0x3D, - kType_Form = 0x3E, - kType_QuestAlias = 0x3F, - kType_Shout = 0x40, - kType_WordOfPower = 0x41, - kType_Scene = 0x43, - kType_Hand = 0x44, - kType_AssociationType = 0x45, - kType_WardState = 0x46, - kType_PackageData_PossiblyNull = 0x47, - kType_PackageData_Numeric = 0x48, - kType_FurnitureAnimType = 0x49, - kType_FurnitureEntryType = 0x4A, - kType_VMVariableName = 0x4C, - kType_PackageData = 0x4E, - kType_KnowableForm = 0x51, - kType_Region = 0x52 - }; - - - const char * typeStr; // 00 - UInt32 typeID; // 04 - UInt32 isOptional; // 08 -}; - -struct ScriptData -{ - // members - UInt16 opcode; // 00 - UInt16 chunkSize; // 02 - UInt16 numParams; // 04 -}; - -typedef bool (* ObScript_Execute)(const ObScriptParam * paramInfo, ScriptData * scriptData, TESObjectREFR * thisObj, TESObjectREFR* containingObj, Script* scriptObj, ScriptLocals* locals, double& result, UInt32& opcodeOffsetPtr); -typedef bool (* ObScript_Parse)(UInt32 numParams, const ObScriptParam* paramInfo, ScriptLineBuffer* lineBuf, ScriptBuffer* scriptBuf); -typedef bool (* ObScript_Eval)(TESObjectREFR* thisObj, void* arg1, void* arg2, double& result); - -typedef bool(* _ObScript_ExtractArgs)(const ObScriptParam * paramInfo, ScriptData * scriptData, UInt32& opcodeOffsetPtr, TESObjectREFR * thisObj, TESObjectREFR* containingObj, Script* scriptObj, ScriptLocals* locals, void* args1, void* args2); -extern RelocAddr<_ObScript_ExtractArgs> ObScript_ExtractArgs; - -// 02E8400 - -// 50 -struct ObScriptCommand -{ - const char * longName; // 00 - const char * shortName; // 08 - UInt32 opcode; // 10 - UInt32 pad14; // 14 - const char * helpText; // 18 - UInt8 needsParent; // 20 - UInt8 pad21; // 21 - UInt16 numParams; // 22 - UInt32 pad24; // 24 - ObScriptParam * params; // 28 - - // handlers - ObScript_Execute execute; // 30 - ObScript_Parse parse; // 38 - ObScript_Eval eval; // 40 - - UInt32 flags; // 48 - UInt32 pad4C; // 4C -}; - -enum -{ - kObScript_NumObScriptCommands = 0x02E0, - kObScript_NumConsoleCommands = 0x01B4, - - kObScript_ScriptOpBase = 0x1000, - kObScript_ConsoleOpBase = 0x0100, -}; - -extern RelocPtr g_firstObScriptCommand; -extern RelocPtr g_firstConsoleCommand; diff --git a/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.cpp b/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.cpp deleted file mode 100644 index 14982cfb..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#include "PapyrusActiveMagicEffect.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" -#include "PapyrusEvents.h" - -namespace papyrusActiveMagicEffect -{ - float GetTimeElapsed(ActiveEffect* effect) - { - return (effect) ? effect->elapsed : 0.0; - } - - float GetDuration(ActiveEffect* effect) - { - return (effect) ? effect->duration : 0.0; - } - - float GetMagnitude(ActiveEffect* effect) - { - return (effect) ? effect->magnitude : 0.0; - } - - void RegisterForKey(ActiveEffect * effect, UInt32 key) - { - if(!effect) - return; - g_inputKeyEventRegs.Register(key, ActiveEffect::kTypeID, effect); - } - - void UnregisterForKey(ActiveEffect * effect, UInt32 key) - { - if(!effect) - return; - g_inputKeyEventRegs.Unregister(key, ActiveEffect::kTypeID, effect); - } - - void UnregisterForAllKeys(ActiveEffect * effect) - { - if(!effect) - return; - g_inputKeyEventRegs.UnregisterAll(ActiveEffect::kTypeID, effect); - } - - void RegisterForControl(ActiveEffect * effect, BSFixedString control) - { - if(!effect) - return; - g_inputControlEventRegs.Register(control, ActiveEffect::kTypeID, effect); - } - - void UnregisterForControl(ActiveEffect * effect, BSFixedString control) - { - if(!effect) - return; - g_inputControlEventRegs.Unregister(control, ActiveEffect::kTypeID, effect); - } - - void UnregisterForAllControls(ActiveEffect * effect) - { - if(!effect) - return; - g_inputControlEventRegs.UnregisterAll(ActiveEffect::kTypeID, effect); - } - - void RegisterForMenu(ActiveEffect * effect, BSFixedString menuName) - { - if(!effect || !menuName.data) - return; - - g_menuOpenCloseRegs.Register(menuName, ActiveEffect::kTypeID, effect); - } - - void UnregisterForMenu(ActiveEffect * effect, BSFixedString menuName) - { - if(!effect || !menuName.data) - return; - - g_menuOpenCloseRegs.Unregister(menuName, ActiveEffect::kTypeID, effect); - } - - void UnregisterForAllMenus(ActiveEffect * effect) - { - if(!effect) - return; - - g_menuOpenCloseRegs.UnregisterAll(ActiveEffect::kTypeID, effect); - } - - void RegisterForModEvent(ActiveEffect * effect, BSFixedString eventName, BSFixedString callbackName) - { - if(!effect || !eventName.data || !callbackName.data) - return; - - ModCallbackParameters params; - params.callbackName = callbackName; - - g_modCallbackRegs.Register(eventName, ActiveEffect::kTypeID, effect, ¶ms); - } - - void UnregisterForModEvent(ActiveEffect * effect, BSFixedString eventName) - { - if(!effect || !eventName.data) - return; - - g_modCallbackRegs.Unregister(eventName, ActiveEffect::kTypeID, effect); - } - - void UnregisterForAllModEvents(ActiveEffect * effect) - { - g_modCallbackRegs.UnregisterAll(ActiveEffect::kTypeID, effect); - } - - void SendModEvent(ActiveEffect * thisForm, BSFixedString eventName, BSFixedString strArg, float numArg) - { - if (!eventName.data) - return; - - SKSEModCallbackEvent evn(eventName, strArg, numArg, NULL); - g_modCallbackEventDispatcher.SendEvent(&evn); - } - - void RegisterForCameraState(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Register(ActiveEffect::kTypeID, thisForm); - } - - void UnregisterForCameraState(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Unregister(ActiveEffect::kTypeID, thisForm); - } - - void RegisterForCrosshairRef(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Register(ActiveEffect::kTypeID, thisForm); - } - - void UnregisterForCrosshairRef(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Unregister(ActiveEffect::kTypeID, thisForm); - } - - void RegisterForActorAction(ActiveEffect * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Register(actionType, ActiveEffect::kTypeID, thisForm); - } - - void UnregisterForActorAction(ActiveEffect * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Unregister(actionType, ActiveEffect::kTypeID, thisForm); - } - - void UnregisterForNiNodeUpdate(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Unregister(ActiveEffect::kTypeID, thisForm); - } - - void RegisterForNiNodeUpdate(ActiveEffect * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Register(ActiveEffect::kTypeID, thisForm); - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusActiveMagicEffect::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetTimeElapsed", "ActiveMagicEffect", papyrusActiveMagicEffect::GetTimeElapsed, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetDuration", "ActiveMagicEffect", papyrusActiveMagicEffect::GetDuration, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMagnitude", "ActiveMagicEffect", papyrusActiveMagicEffect::GetMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForKey", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForKey", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllKeys", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForAllKeys, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForMenu", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForMenu", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllMenus", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForAllMenus, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("RegisterForModEvent", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForModEvent", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllModEvents", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForAllModEvents, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SendModEvent", "ActiveMagicEffect", papyrusActiveMagicEffect::SendModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForControl", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForControl", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllControls", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForAllControls, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCameraState", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCameraState", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCrosshairRef", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCrosshairRef", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForActorAction", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForActorAction", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForNiNodeUpdate", "ActiveMagicEffect", papyrusActiveMagicEffect::RegisterForNiNodeUpdate, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForNiNodeUpdate", "ActiveMagicEffect", papyrusActiveMagicEffect::UnregisterForNiNodeUpdate, registry)); - - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForAllKeys", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForAllMenus", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForAllModEvents", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "SendModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForAllControls", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "RegisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActiveMagicEffect", "UnregisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.h b/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.h deleted file mode 100644 index cd79bfe9..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActiveMagicEffect.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" - -class ActiveEffect; -class VMClassRegistry; -class TESForm; - -namespace papyrusActiveMagicEffect -{ - void RegisterFuncs(VMClassRegistry* registry); - - float GetTimeElapsed(ActiveEffect* effect); - float GetDuration(ActiveEffect* effect); - float GetMagnitude(ActiveEffect* effect); - - void RegisterForKey(ActiveEffect * effect, UInt32 key); - void UnregisterForKey(ActiveEffect * effect, UInt32 key); - void UnregisterForAllKeys(ActiveEffect * effect); - - void RegisterForControl(ActiveEffect * effect, BSFixedString control); - void UnregisterForControl(ActiveEffect * effect, BSFixedString control); - void UnregisterForAllControls(ActiveEffect * effect); - - void RegisterForMenu(ActiveEffect * effect, BSFixedString menuName); - void UnregisterForMenu(ActiveEffect * effect, BSFixedString menuName); - void UnregisterForAllMenus(ActiveEffect * effect); - - void RegisterForModEvent(ActiveEffect * effect, BSFixedString eventName, BSFixedString callbackName); - void UnregisterForModEvent(ActiveEffect * effect, BSFixedString eventName); - void UnregisterForAllModEvents(ActiveEffect * effect); - - void SendModEvent(ActiveEffect * thisForm, BSFixedString eventName, BSFixedString strArg, float numArg); - - void RegisterForCameraState(ActiveEffect * thisForm); - void UnregisterForCameraState(ActiveEffect * thisForm); - - void RegisterForCrosshairRef(ActiveEffect * thisForm); - void UnregisterForCrosshairRef(ActiveEffect * thisForm); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActor.cpp b/source/fs.dll/skse64/skse64/PapyrusActor.cpp deleted file mode 100644 index ab3af28b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActor.cpp +++ /dev/null @@ -1,715 +0,0 @@ -#include "PapyrusActor.h" -#include "PapyrusArgs.h" - -#include "GameForms.h" -#include "GameData.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "GameExtraData.h" -#include "GameRTTI.h" -#include "GameThreads.h" -#include "HashUtil.h" - -#include "NiExtraData.h" -#include "InternalTasks.h" - -#include - -class MatchBySlot : public FormMatcher -{ - UInt32 m_mask; -public: - MatchBySlot(UInt32 slot) : - m_mask(slot) - { - - } - - bool Matches(TESForm* pForm) const { - if (pForm) { - BGSBipedObjectForm* pBip = DYNAMIC_CAST(pForm, TESForm, BGSBipedObjectForm); - if (pBip) { - return (pBip->data.parts & m_mask) != 0; - } - } - return false; - } -}; - -class MatchByForm : public FormMatcher -{ - TESForm * m_form; -public: - MatchByForm(TESForm * form) : m_form(form) {} - - bool Matches(TESForm* pForm) const { return m_form == pForm; } -}; - -typedef std::set FactionRankSet; -class CollectUniqueFactions : public Actor::FactionVisitor -{ -public: - CollectUniqueFactions::CollectUniqueFactions(FactionRankSet * rankSet, SInt8 min, SInt8 max) : m_rankSet(rankSet), m_min(min), m_max(max) { } - virtual bool Accept(TESFaction * faction, SInt8 rank) - { - if(rank >= m_min && rank <= m_max) - m_rankSet->insert(faction); - return false; - } - -private: - SInt8 m_min; - SInt8 m_max; - FactionRankSet * m_rankSet; -}; - -bool CanEquipBothHands(Actor* actor, TESForm * item) -{ - BGSEquipType * equipType = DYNAMIC_CAST(item, TESForm, BGSEquipType); - if (!equipType) - return false; - - BGSEquipSlot * equipSlot = equipType->GetEquipSlot(); - if (!equipSlot) - return false; - - // 2H - if (equipSlot == GetEitherHandSlot()) - { - return true; - } - // 1H - else if (equipSlot == GetLeftHandSlot() || equipSlot == GetRightHandSlot()) - { - return (actor->race->data.raceFlags & TESRace::kRace_CanDualWield) && item->IsWeapon(); - } - - return false; -} - -BGSEquipSlot * GetEquipSlotById(SInt32 slotId) -{ - enum - { - kSlotId_Default = 0, - kSlotId_Right = 1, - kSlotId_Left = 2 - }; - - if (slotId == kSlotId_Right) - return GetRightHandSlot(); - else if (slotId == kSlotId_Left) - return GetLeftHandSlot(); - else - return NULL; -} - -SInt32 CalcItemId(TESForm * form, BaseExtraList * extraList) -{ - if (!form || !extraList) - return 0; - - const char * name = extraList->GetDisplayName(form); - - // No name in extra data? Use base form name - if (!name) - { - TESFullName* pFullName = DYNAMIC_CAST(form, TESForm, TESFullName); - if (pFullName) - name = pFullName->name.data; - } - - if (!name) - return 0; - - return (SInt32)HashUtil::CRC32(name, form->formID & 0x00FFFFFF); -} - -namespace papyrusActor -{ - - TESForm* GetWornForm(Actor* thisActor, UInt32 mask) - { - MatchBySlot matcher(mask); - ExtraContainerChanges* pContainerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - EquipData eqD = pContainerChanges->FindEquipped(matcher); - return eqD.pForm; - } - return NULL; - } - - SInt32 GetWornItemId(Actor* thisActor, UInt32 mask) - { - ExtraContainerChanges* containerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - if (!containerChanges) - return 0; - - MatchBySlot matcher(mask); - EquipData equipData = containerChanges->FindEquipped(matcher); - - return CalcItemId(equipData.pForm, equipData.pExtraData); - } - - TESForm * GetEquippedObject(Actor * thisActor, UInt32 slot) - { - if(!thisActor) return NULL; - - enum - { - kSlotID_Left = 0, - kSlotID_Right, - kSlotID_Voice, - }; - - if(slot == kSlotID_Voice) - return thisActor->equippedShout; - else - return thisActor->GetEquippedObject(slot == kSlotID_Left); - } - - SInt32 GetEquippedItemId(Actor * thisActor, UInt32 slot) - { - enum - { - kSlotID_Left = 0, - kSlotID_Right - }; - - if (!thisActor) - return NULL; - - TESForm * equippedForm = thisActor->GetEquippedObject(slot == kSlotID_Left); - if (!equippedForm) - return 0; - - ExtraContainerChanges* containerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - if (!containerChanges) - return 0; - - MatchByForm matcher(equippedForm); - EquipData equipData = containerChanges->FindEquipped(matcher, slot == kSlotID_Right, slot == kSlotID_Left); - - return CalcItemId(equipData.pForm, equipData.pExtraData); - } - - UInt32 GetSpellCount(Actor* thisActor) - { - if(!thisActor) return NULL; - - return thisActor->addedSpells.Length(); - } - - SpellItem* GetNthSpell(Actor* thisActor, UInt32 n) - { - if(!thisActor) return NULL; - - return thisActor->addedSpells.Get(n); - } - -#ifdef _AEFFECTS - UInt32 GetNumActiveEffects(Actor* thisActor) - { - if(thisActor) - { - tList * effects = thisActor->magicTarget.GetActiveEffects(); - if(effects) { - UInt32 count = effects->Count(); - _MESSAGE("Total Effects: %d", count); - return count; - } - } - return 0; - } - - ActiveEffect* GetNthActiveEffect(Actor* thisActor, UInt32 n) - { - if(thisActor) { - tList * effects = thisActor->magicTarget.GetActiveEffects(); - if(effects) { - UInt32 count = effects->Count(); - ActiveEffect * effect = effects->GetNthItem(n); - _MESSAGE("Dumping n: %d Total: %d", n, count); // Test - DumpClass(effect, 20); - return (effects && n < count) ? effect : NULL; - } - } - - return NULL; - } -#endif - - void EquipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventUnequip, bool equipSound) - { - if (!item) - return; - - if (!item->Has3D()) - return; - - EquipManager* equipManager = EquipManager::GetSingleton(); - if (!equipManager) - return; - - ExtraContainerChanges* containerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - ExtraContainerChanges::Data* containerData = containerChanges ? containerChanges->data : NULL; - if (!containerData) - return; - - // Copy/merge of extraData and container base. Free after use. - InventoryEntryData* entryData = containerData->CreateEquipEntryData(item); - if (!entryData) - return; - - BGSEquipSlot * targetEquipSlot = GetEquipSlotById(slotId); - - SInt32 itemCount = entryData->countDelta; - - // For ammo, use count, otherwise always equip 1 - SInt32 equipCount = item->IsAmmo() ? itemCount : 1; - - bool isTargetSlotInUse = false; - - // Need at least 1 (maybe 2 for dual wield, checked later) - bool hasItemMinCount = itemCount > 0; - - BaseExtraList * rightEquipList = NULL; - BaseExtraList * leftEquipList = NULL; - - BaseExtraList * curEquipList = NULL; - BaseExtraList * enchantList = NULL; - - if (hasItemMinCount) - { - entryData->GetExtraWornBaseLists(&rightEquipList, &leftEquipList); - - // Case 1: Already equipped in both hands. - if (leftEquipList && rightEquipList) - { - isTargetSlotInUse = true; - curEquipList = (targetEquipSlot == GetLeftHandSlot()) ? leftEquipList : rightEquipList; - enchantList = NULL; - } - // Case 2: Already equipped in right hand. - else if (rightEquipList) - { - isTargetSlotInUse = targetEquipSlot == GetRightHandSlot(); - curEquipList = rightEquipList; - enchantList = NULL; - } - // Case 3: Already equipped in left hand. - else if (leftEquipList) - { - isTargetSlotInUse = targetEquipSlot == GetLeftHandSlot(); - curEquipList = leftEquipList; - enchantList = NULL; - } - // Case 4: Not equipped yet. - else - { - isTargetSlotInUse = false; - curEquipList = NULL; - enchantList = entryData->extendDataList->GetNthItem(0); - } - } - - // Free temp equip entryData - entryData->Delete(); - - // Normally EquipManager would update CannotWear, if equip is skipped we do it here - if (isTargetSlotInUse) - { - BSExtraData* xCannotWear = curEquipList->GetByType(kExtraData_CannotWear); - if (xCannotWear && !preventUnequip) - curEquipList->Remove(kExtraData_CannotWear, xCannotWear); - else if (!xCannotWear && preventUnequip) - curEquipList->Add(kExtraData_CannotWear, ExtraCannotWear::Create()); - - // Slot in use, nothing left to do - return; - } - - // For dual wield, prevent that 1 item can be equipped in two hands if its already equipped - bool isEquipped = (rightEquipList || leftEquipList); - if (targetEquipSlot && isEquipped && CanEquipBothHands(thisActor, item)) - hasItemMinCount = itemCount > 1; - - if (!isTargetSlotInUse && hasItemMinCount) - CALL_MEMBER_FN(equipManager, EquipItem)(thisActor, item, enchantList, equipCount, targetEquipSlot, equipSound, preventUnequip, false, NULL); - } - - void EquipItemById(Actor* thisActor, TESForm* item, SInt32 itemId, SInt32 slotId, bool preventUnequip /*unused*/, bool equipSound) - { - if (!item || !item->Has3D() || itemId == 0) - return; - - // Can't be improved or enchanted, no need for itemId - if (item->IsAmmo()) - { - EquipItemEx(thisActor, item, slotId, preventUnequip, equipSound); - return; - } - - EquipManager* equipManager = EquipManager::GetSingleton(); - if (!equipManager) - return; - - ExtraContainerChanges* containerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - ExtraContainerChanges::Data* containerData = containerChanges ? containerChanges->data : NULL; - if (!containerData) - return; - - InventoryEntryData::EquipData itemData; - containerData->GetEquipItemData(itemData, item, itemId); - - BGSEquipSlot * targetEquipSlot = GetEquipSlotById(slotId); - bool isTargetSlotInUse = false; - - SInt32 itemCount = itemData.itemCount; - - // Need at least 1 (maybe 2 for dual wield, checked later) - bool hasItemMinCount = itemCount > 0; - bool canDualWield = false; - - BaseExtraList * newEquipList = itemData.itemExtraList; - - if (hasItemMinCount) - { - // Case 1: Type already equipped in both hands. - if (itemData.isTypeWorn && itemData.isTypeWornLeft) - { - isTargetSlotInUse = true; - } - // Case 2: Type already equipped in right hand. - else if (itemData.isTypeWorn) - { - isTargetSlotInUse = targetEquipSlot == GetRightHandSlot() || targetEquipSlot == NULL; - } - // Case 3: Type already equipped in left hand. - else if (itemData.isTypeWornLeft) - { - isTargetSlotInUse = targetEquipSlot == GetLeftHandSlot(); - } - // Case 4: Type not equipped yet. - else - { - isTargetSlotInUse = false; - } - } - - // This also returns if the target slot is in use by another weapon of the same type. - // Could handle this, but switching them here causes a bug (0 damage) for some reason. - // So we just skip it. Can be handled on the Papyrus side. - if (isTargetSlotInUse || !hasItemMinCount) - return; - - bool isItemEquipped = itemData.isItemWorn || itemData.isItemWornLeft; - - // Does this item qualify for dual wield? - if (item->IsWeapon() && targetEquipSlot && isItemEquipped && CanEquipBothHands(thisActor, item)) - canDualWield = true; - - // Not enough items to dual wield, weapon has to swap hands - if (canDualWield && itemCount < 2) - { - BaseExtraList* unequipList = itemData.isItemWornLeft ? itemData.wornLeftExtraList : itemData.wornExtraList; - - // Unequip might destroy passed list (return value indicates that). - newEquipList = CALL_MEMBER_FN(equipManager, UnequipItem)(thisActor, item, unequipList, 1, 0, false, false, true, false, NULL) ? NULL : unequipList; - } - - CALL_MEMBER_FN(equipManager, EquipItem)(thisActor, item, newEquipList, 1, targetEquipSlot, equipSound, preventUnequip, false, NULL); - } - - void UnequipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventEquip) - { - if (!item) - return; - - if (!item->Has3D()) - return; - - EquipManager* equipManager = EquipManager::GetSingleton(); - if (!equipManager) - return; - - ExtraContainerChanges* containerChanges = static_cast(thisActor->extraData.GetByType(kExtraData_ContainerChanges)); - ExtraContainerChanges::Data* containerData = containerChanges ? containerChanges->data : NULL; - if (!containerData) - return; - - InventoryEntryData* entryData = containerData->FindItemEntry(item); - if (!entryData) - return; - - BGSEquipSlot * targetEquipSlot = GetEquipSlotById(slotId); - - SInt32 itemCount = entryData->countDelta; - - // For ammo, use count, otherwise always equip 1 - SInt32 equipCount = item->IsAmmo() ? itemCount : 1; - - BaseExtraList * rightEquipList = NULL; - BaseExtraList * leftEquipList = NULL; - - entryData->GetExtraWornBaseLists(&rightEquipList, &leftEquipList); - - bool unequipRight = false; - bool unequipLeft = false; - - if (targetEquipSlot == GetRightHandSlot()) - unequipRight = true; - else if (targetEquipSlot == GetLeftHandSlot()) - unequipLeft = true; - else - unequipRight = unequipLeft = true; - - if (rightEquipList && unequipRight) - { - BSExtraData* xCannotWear = rightEquipList->GetByType(kExtraData_CannotWear); - if (xCannotWear) - rightEquipList->Remove(kExtraData_CannotWear, xCannotWear); - - CALL_MEMBER_FN(equipManager, UnequipItem)(thisActor, item, rightEquipList, equipCount, GetRightHandSlot(), true, preventEquip, true, false, NULL); - } - - if (leftEquipList && unequipLeft) - { - BSExtraData* xCannotWear = leftEquipList->GetByType(kExtraData_CannotWear); - if (xCannotWear) - leftEquipList->Remove(kExtraData_CannotWear, xCannotWear); - - CALL_MEMBER_FN(equipManager, UnequipItem)(thisActor, item, leftEquipList, equipCount, GetLeftHandSlot(), true, preventEquip, true, false, NULL); - } - } - - void QueueNiNodeUpdate(Actor* thisActor) - { - Character * pChar = DYNAMIC_CAST(thisActor, Actor, Character); - if(pChar) { - CALL_MEMBER_FN(pChar, QueueNiNodeUpdate)(false); // False makes this allow weapons to not be auto holstered apparently - } - } - - void RegenerateHead(Actor * thisActor) - { - TaskInterface::RegenerateHead(thisActor); - } - - void ChangeHeadPart(Actor * thisActor, BGSHeadPart * newPart) - { - if(!thisActor || !newPart) - return; - - TESNPC* npc = DYNAMIC_CAST(thisActor->baseForm, TESForm, TESNPC); - if(npc) { - if(newPart->type != BGSHeadPart::kTypeMisc) { - BGSHeadPart * oldPart = npc->GetCurrentHeadPartByType(newPart->type); - - // Alters the ActorBase's HeadPart list - CALL_MEMBER_FN(npc, ChangeHeadPart)(newPart); - - // Alters the loaded mesh - TaskInterface::ChangeHeadPart(thisActor, oldPart, newPart); - } - } - } - - void ReplaceHeadPart(Actor * thisActor, BGSHeadPart * oldPart, BGSHeadPart * newPart) - { - if(!thisActor || !newPart) - return; - - TESNPC* npc = DYNAMIC_CAST(thisActor->baseForm, TESForm, TESNPC); - if(npc) { - if(!oldPart) { - oldPart = npc->GetCurrentHeadPartByType(newPart->type); - } - if(newPart->type != BGSHeadPart::kTypeMisc && oldPart && oldPart->type == newPart->type) { - TaskInterface::ChangeHeadPart(thisActor, oldPart, newPart); - } - } - } - - void UpdateWeight(Actor * thisActor, float neckDelta) - { - CALL_MEMBER_FN(thisActor, QueueNiNodeUpdate)(true); - TaskInterface::UpdateWeight(thisActor, neckDelta, 0, true); - } - - bool IsAIEnabled(Actor * thisActor) - { - if (!thisActor) - return false; - - return (thisActor->flags1 & Actor::kFlags_AIEnabled) == Actor::kFlags_AIEnabled; - } - - void ResetAI(Actor * thisActor) - { - if (!thisActor) - return; - - UInt32 flags = thisActor->flags; - - if (!(flags & TESForm::kFlagUnk_0x800) && - !(flags & TESForm::kFlagIsDeleted)) - CALL_MEMBER_FN(thisActor,ResetAI)(0,1); - } - - bool IsSwimming(Actor * thisActor) - { - if (!thisActor) - return false; - - return (thisActor->actorState.flags04 & ActorState::kState_Swimming) == ActorState::kState_Swimming; - } - - void SheatheWeapon(Actor * thisActor) - { - if (thisActor) { - thisActor->DrawSheatheWeapon(false); - } - } - - TESObjectREFR * GetFurnitureReference(Actor * thisActor) - { - if(!thisActor) - return NULL; - ActorProcessManager * processManager = thisActor->processManager; - if(!processManager) - return NULL; - MiddleProcess * middleProcess = processManager->middleProcess; - if(!middleProcess) - return NULL; - - NiPointer refr; - UInt32 furnitureHandle = middleProcess->furnitureHandle; - if(furnitureHandle == (*g_invalidRefHandle) || furnitureHandle == 0) - return NULL; - - LookupREFRByHandle(furnitureHandle, refr); - return refr; - } - - void SetExpressionPhoneme(Actor * thisActor, UInt32 index, float value) - { - TaskInterface::UpdateExpression(thisActor, BSFaceGenAnimationData::kKeyframeType_Phoneme, index, value); - } - - void SetExpressionModifier(Actor * thisActor, UInt32 index, float value) - { - TaskInterface::UpdateExpression(thisActor, BSFaceGenAnimationData::kKeyframeType_Modifier, index, value); - } - - void ResetExpressionOverrides(Actor * thisActor) - { - TaskInterface::UpdateExpression(thisActor, BSFaceGenAnimationData::kKeyframeType_Reset, 0, 0); - } - - VMResultArray GetFactions(Actor* thisActor, SInt32 gte, SInt32 lte) - { - VMResultArray factions; - if(thisActor) { - if(gte > SCHAR_MAX) - gte = SCHAR_MAX; - if(gte < SCHAR_MIN) - gte = SCHAR_MIN; - if(lte < SCHAR_MIN) - lte = SCHAR_MIN; - if(lte > SCHAR_MAX) - lte = SCHAR_MAX; - FactionRankSet rankSet; - CollectUniqueFactions factionVisitor(&rankSet, gte, lte); - thisActor->VisitFactions(factionVisitor); - - for(FactionRankSet::iterator it = rankSet.begin(); it != rankSet.end(); ++it) - factions.push_back(*it); - } - - return factions; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusActor::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetWornForm", "Actor", papyrusActor::GetWornForm, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetEquippedObject", "Actor", papyrusActor::GetEquippedObject, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSpellCount", "Actor", papyrusActor::GetSpellCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthSpell", "Actor", papyrusActor::GetNthSpell, registry)); - -#ifdef _AEFFECTS - registry->RegisterFunction( - new NativeFunction0 ("GetNumActiveEffects", "Actor", papyrusActor::GetNumActiveEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthActiveEffect", "Actor", papyrusActor::GetNthActiveEffect, registry)); -#endif - - registry->RegisterFunction( - new NativeFunction4 ("EquipItemEx", "Actor", papyrusActor::EquipItemEx, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("UnequipItemEx", "Actor", papyrusActor::UnequipItemEx, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("QueueNiNodeUpdate", "Actor", papyrusActor::QueueNiNodeUpdate, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ChangeHeadPart", "Actor", papyrusActor::ChangeHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("ReplaceHeadPart", "Actor", papyrusActor::ReplaceHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegenerateHead", "Actor", papyrusActor::RegenerateHead, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UpdateWeight", "Actor", papyrusActor::UpdateWeight, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsAIEnabled", "Actor", papyrusActor::IsAIEnabled, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("ResetAI", "Actor", papyrusActor::ResetAI, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsSwimming", "Actor", papyrusActor::IsSwimming, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("SheatheWeapon", "Actor", papyrusActor::SheatheWeapon, registry)); - - registry->RegisterFunction( - new NativeFunction5 ("EquipItemById", "Actor", papyrusActor::EquipItemById, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetEquippedItemId", "Actor", papyrusActor::GetEquippedItemId, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetWornItemId", "Actor", papyrusActor::GetWornItemId, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetFurnitureReference", "Actor", papyrusActor::GetFurnitureReference, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetExpressionPhoneme", "Actor", papyrusActor::SetExpressionPhoneme, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetExpressionModifier", "Actor", papyrusActor::SetExpressionModifier, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("ResetExpressionOverrides", "Actor", papyrusActor::ResetExpressionOverrides, registry)); - - registry->RegisterFunction( - new NativeFunction2 , SInt32, SInt32>("GetFactions", "Actor", papyrusActor::GetFactions, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActor.h b/source/fs.dll/skse64/skse64/PapyrusActor.h deleted file mode 100644 index 48c4dae9..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActor.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -class TESForm; -class TESObjectWEAP; -class Actor; -class SpellItem; -class ActiveEffect; -class VMClassRegistry; -class BGSHeadPart; -class TESObjectREFR; - -namespace papyrusActor -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESForm* GetWornForm(Actor* thisActor, UInt32 slot); - void QueueNiNodeUpdate(Actor* thisActor); - UInt32 GetSpellCount(Actor* thisActor); - SpellItem* GetNthSpell(Actor* thisActor, UInt32 n); - -#ifdef _AEFFECTS - UInt32 GetNumActiveEffects(Actor* thisActor); - ActiveEffect* GetNthActiveEffect(Actor* thisActor, UInt32 n); -#endif - - void EquipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventUnequip, bool equipSound); - void UnequipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventEquip); - - //void ReplaceHeadPart(Actor * thisActor, BGSHeadPart * oldPart, BGSHeadPart* newPart); - //void ChangeHeadPart(Actor * thisActor, BGSHeadPart * newPart); - //void RegenerateHead(Actor * thisActor); - //void UpdateWeight(Actor * thisActor, float neckDelta); - - bool IsAIEnabled(Actor * thisActor); - bool IsSwimming(Actor * thisActor); - void SheatheWeapon(Actor * thisActor); - - void EquipItemById(Actor* thisActor, TESForm* item, SInt32 itemId, SInt32 slotId, bool preventUnequip, bool equipSound); - TESObjectREFR * GetFurnitureReference(Actor * thisActor); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActorBase.cpp b/source/fs.dll/skse64/skse64/PapyrusActorBase.cpp deleted file mode 100644 index 603e938e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActorBase.cpp +++ /dev/null @@ -1,365 +0,0 @@ -#include "PapyrusActorBase.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "GameExtraData.h" -#include "GameData.h" -#include "GameRTTI.h" - -namespace papyrusActorBase -{ - TESCombatStyle* GetCombatStyle(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->combatStyle : NULL; - } - - void SetCombatStyle(TESNPC* thisNPC, TESCombatStyle* cs) - { - if (thisNPC && cs) { - thisNPC->combatStyle = cs; - } - } - - BGSOutfit* GetOutfit(TESNPC* thisNPC, bool bSleepOutfit) - { - if (!thisNPC) - return NULL; - return bSleepOutfit ? thisNPC->sleepOutfit : thisNPC->defaultOutfit; - } - - void SetClass(TESNPC* thisNPC, TESClass* nuClass) - { - if (thisNPC && nuClass) { - thisNPC->npcClass = nuClass; - } - } - - UInt32 GetSpellCount(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->spellList.GetSpellCount() : 0; - } - - SpellItem* GetNthSpell(TESNPC* thisNPC, UInt32 n) - { - return (thisNPC) ? thisNPC->spellList.GetNthSpell(n) : NULL; - } - - BGSVoiceType* GetVoiceType(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->actorData.voiceType : NULL; - } - - void SetVoiceType(TESNPC* thisNPC, BGSVoiceType * newVoice) - { - if (thisNPC) { - thisNPC->actorData.voiceType = newVoice; - } - } - - float GetWeight(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->weight : 0.0; - } - - void SetWeight(TESNPC* thisNPC, float weight) - { - if (thisNPC) { - thisNPC->weight = weight; - } - } - - float GetHeight(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->height : 0.0; - } - - void SetHeight(TESNPC* thisNPC, float height) - { - if (thisNPC) { - thisNPC->height = height; - } - } - - UInt32 GetNumHeadParts(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->numHeadParts : 0; - } - - BGSHeadPart* GetNthHeadPart(TESNPC* thisNPC, UInt32 n) - { - return (thisNPC && thisNPC->headparts && n < thisNPC->numHeadParts) ? thisNPC->headparts[n] : NULL; - } - - void SetNthHeadPart(TESNPC* thisNPC, BGSHeadPart* headPart, UInt32 n ) - { - if (thisNPC && n < thisNPC->numHeadParts) { - if (headPart && thisNPC->headparts) { - thisNPC->headparts[n] = headPart; - } - } - } - - // Convenience function to return a headPart's index by type - SInt32 GetIndexOfHeadPartByType(TESNPC* thisNPC, UInt32 type) - { - if (thisNPC && thisNPC->headparts) { - for(int i = 0; i < thisNPC->numHeadParts; i++) { - if(thisNPC->headparts[i] && thisNPC->headparts[i]->type == type && !thisNPC->headparts[i]->IsExtraPart()) { - return i; - } - } - } - - return -1; - } - - UInt32 GetNumOverlayHeadParts(TESNPC* thisNPC) - { - return (thisNPC) ? GetNumActorBaseOverlays(thisNPC) : 0; - } - - BGSHeadPart* GetNthOverlayHeadPart(TESNPC* thisNPC, UInt32 n) - { - if (!thisNPC) - return NULL; - - UInt32 numOverlays = GetNumActorBaseOverlays(thisNPC); - if(n >= numOverlays) - return NULL; - - BGSHeadPart ** overlays = GetActorBaseOverlays(thisNPC); - return overlays[n]; - } - - // Convenience function to return a headPart's index by type - SInt32 GetIndexOfOverlayHeadPartByType(TESNPC* thisNPC, UInt32 type) - { - if (!thisNPC) - return NULL; - - UInt32 numOverlays = GetNumActorBaseOverlays(thisNPC); - BGSHeadPart ** overlays = GetActorBaseOverlays(thisNPC); - for(UInt32 i = 0; i < numOverlays; i++) - { - if(overlays[i] && overlays[i]->type == type && !overlays[i]->IsExtraPart()) - return i; - } - - return -1; - } - - float GetFaceMorph(TESNPC* thisNPC, UInt32 index) - { - return (thisNPC && thisNPC->faceMorph && index < TESNPC::FaceMorphs::kNumOptions) ? thisNPC->faceMorph->option[index] : 0.0; - } - - void SetFaceMorph(TESNPC* thisNPC, float value, UInt32 index) - { - if (thisNPC && thisNPC->faceMorph && index < TESNPC::FaceMorphs::kNumOptions) { - thisNPC->faceMorph->option[index] = value; - } - } - - UInt32 GetFacePreset(TESNPC* thisNPC, UInt32 index) - { - return (thisNPC && thisNPC->faceMorph && index < TESNPC::FaceMorphs::kNumPresets) ? thisNPC->faceMorph->presets[index] : 0; - } - - void SetFacePreset(TESNPC* thisNPC, UInt32 value, UInt32 index) - { - if (thisNPC && thisNPC->faceMorph && index < TESNPC::FaceMorphs::kNumPresets) { - thisNPC->faceMorph->presets[index] = value; - } - } - - // Hair Color - BGSColorForm* GetHairColor(TESNPC* thisNPC) - { - return (thisNPC && thisNPC->headData) ? thisNPC->headData->hairColor : NULL; - } - - void SetHairColor(TESNPC* thisNPC, BGSColorForm* colorForm) - { - if (thisNPC && colorForm && thisNPC->headData) { - thisNPC->headData->hairColor = colorForm; - } - } - - BGSTextureSet * GetFaceTextureSet(TESNPC* thisNPC) - { - return (thisNPC && thisNPC->headData) ? thisNPC->headData->headTexture : NULL; - } - - void SetFaceTextureSet(TESNPC* thisNPC, BGSTextureSet * textureSet) - { - if (thisNPC) { - thisNPC->SetFaceTexture(textureSet); - } - } - - TESObjectARMO * GetSkin(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->skinForm.skin : NULL; - } - - void SetSkin(TESNPC* thisNPC, TESObjectARMO * skin) - { - if (thisNPC) { - thisNPC->skinForm.skin = skin; - } - } - - TESObjectARMO * GetSkinFar(TESNPC* thisNPC) - { - return (thisNPC) ? thisNPC->skinFar : NULL; - } - - void SetSkinFar(TESNPC* thisNPC, TESObjectARMO * skin) - { - if (thisNPC) { - thisNPC->skinFar = skin; - } - } - - TESNPC* GetTemplate(TESNPC* thisNPC) - { - return thisNPC ? thisNPC->GetRootTemplate() : NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusActorBase::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetCombatStyle", "ActorBase", papyrusActorBase::GetCombatStyle, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCombatStyle", "ActorBase", papyrusActorBase::SetCombatStyle, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetOutfit", "ActorBase", papyrusActorBase::GetOutfit, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetClass", "ActorBase", papyrusActorBase::SetClass, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSpellCount", "ActorBase", papyrusActorBase::GetSpellCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthSpell", "ActorBase", papyrusActorBase::GetNthSpell, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetVoiceType", "ActorBase", papyrusActorBase::GetVoiceType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetVoiceType", "ActorBase", papyrusActorBase::SetVoiceType, registry)); - - // Character Creation Information - - registry->RegisterFunction( - new NativeFunction0 ("GetHeight", "ActorBase", papyrusActorBase::GetHeight, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetHeight", "ActorBase", papyrusActorBase::SetHeight, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWeight", "ActorBase", papyrusActorBase::GetWeight, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWeight", "ActorBase", papyrusActorBase::SetWeight, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumHeadParts", "ActorBase", papyrusActorBase::GetNumHeadParts, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthHeadPart", "ActorBase", papyrusActorBase::GetNthHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetNthHeadPart", "ActorBase", papyrusActorBase::SetNthHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetIndexOfHeadPartByType", "ActorBase", papyrusActorBase::GetIndexOfHeadPartByType, registry)); - - - registry->RegisterFunction( - new NativeFunction0 ("GetNumOverlayHeadParts", "ActorBase", papyrusActorBase::GetNumOverlayHeadParts, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthOverlayHeadPart", "ActorBase", papyrusActorBase::GetNthOverlayHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetIndexOfOverlayHeadPartByType", "ActorBase", papyrusActorBase::GetIndexOfOverlayHeadPartByType, registry)); - - - registry->RegisterFunction( - new NativeFunction1 ("GetFaceMorph", "ActorBase", papyrusActorBase::GetFaceMorph, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetFaceMorph", "ActorBase", papyrusActorBase::SetFaceMorph, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetFacePreset", "ActorBase", papyrusActorBase::GetFacePreset, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetFacePreset", "ActorBase", papyrusActorBase::SetFacePreset, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetHairColor", "ActorBase", papyrusActorBase::GetHairColor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetHairColor", "ActorBase", papyrusActorBase::SetHairColor, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetFaceTextureSet", "ActorBase", papyrusActorBase::GetFaceTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFaceTextureSet", "ActorBase", papyrusActorBase::SetFaceTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSkin", "ActorBase", papyrusActorBase::GetSkin, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSkin", "ActorBase", papyrusActorBase::SetSkin, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSkinFar", "ActorBase", papyrusActorBase::GetSkinFar, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSkinFar", "ActorBase", papyrusActorBase::SetSkinFar, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetTemplate", "ActorBase", papyrusActorBase::GetTemplate, registry)); - - registry->SetFunctionFlags("ActorBase", "GetCombatStyle", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetCombatStyle", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetOutfit", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetClass", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetSpellCount", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetNthSpell", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorBase", "GetHeight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetHeight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetWeight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetWeight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetNumHeadParts", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetNthHeadPart", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetNthHeadPart", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetIndexOfHeadPartByType", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetNumOverlayHeadParts", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetNthOverlayHeadPart", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetIndexOfOverlayHeadPartByType", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetFaceMorph", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetFaceMorph", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetFacePreset", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetFacePreset", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetHairColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetHairColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetFaceTextureSet", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetFaceTextureSet", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetSkin", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "SetSkin", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorBase", "GetTemplate", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActorBase.h b/source/fs.dll/skse64/skse64/PapyrusActorBase.h deleted file mode 100644 index df796e5d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActorBase.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESForm; -class TESNPC; -class TESCombatStyle; -class BGSOutfit; -class TESClass; -class SpellItem; -class BGSHeadPart; -class BGSTextureSet; -class TESObjectARMO; - -namespace papyrusActorBase { - void RegisterFuncs(VMClassRegistry* registry); - - TESCombatStyle* GetCombatStyle(TESNPC* thisNPC); - void SetCombatStyle(TESNPC* thisNPC, TESCombatStyle* cs); - - BGSOutfit* GetOutfit(TESNPC* thisNPC, bool bSleepOutfit = false); - - void SetClass(TESNPC* thisNPC, TESClass* nuClass); - - float GetHeight(TESNPC* thisNPC); - void SetHeight(TESNPC* thisNPC, float height); - float GetWeight(TESNPC* thisNPC); - void SetWeight(TESNPC* thisNPC, float weight); - - UInt32 GetNumHeadParts(TESNPC* thisNPC); - BGSHeadPart* GetNthHeadPart(TESNPC* thisNPC, UInt32 n); - void SetNthHeadPart(TESNPC* thisNPC, BGSHeadPart* headPart, UInt32 n ); - SInt32 GetIndexOfHeadPartByType(TESNPC* thisNPC, UInt32 type); - - UInt32 GetNumOverlayHeadParts(TESNPC* thisNPC); - BGSHeadPart* GetNthOverlayHeadPart(TESNPC* thisNPC, UInt32 n); - SInt32 GetIndexOfOverlayHeadPartByType(TESNPC* thisNPC, UInt32 type); - - float GetFaceMorph(TESNPC* thisNPC, UInt32 index); - void SetFaceMorph(TESNPC* thisNPC, float value, UInt32 index); - BGSTextureSet * GetFaceTextureSet(TESNPC* thisNPC); - void SetFaceTextureSet(TESNPC* thisNPC, BGSTextureSet * textureSet); - - UInt32 GetSpellCount(TESNPC* thisNPC); - SpellItem* GetNthSpell(TESNPC* thisNPC, UInt32 n); - - TESObjectARMO * GetSkin(TESNPC* thisNPC); - void SetSkin(TESNPC* thisNPC, TESObjectARMO * skin); - TESObjectARMO * GetSkinFar(TESNPC* thisNPC); - void SetSkinFar(TESNPC* thisNPC, TESObjectARMO * skin); - TESNPC* GetTemplate(TESNPC* thisNPC); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.cpp b/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.cpp deleted file mode 100644 index 871bc6e3..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.cpp +++ /dev/null @@ -1,379 +0,0 @@ -#include "PapyrusActorValueInfo.h" -#include "GameObjects.h" -#include "GameData.h" -#include "GameSettings.h" - -#include "PapyrusArgs.h" - -class MatchSkillPerks : public BGSSkillPerkTreeNode::PerkVisitor -{ - Actor * m_actor; - bool m_unowned; // Only perks the actor doesn't own, or only perks the actor does own - bool m_allRanks; // Walk all ranks for all perks -public: - MatchSkillPerks(Actor * actor, bool unowned, bool allRanks) : m_actor(actor), m_unowned(unowned), m_allRanks(allRanks) {} - - virtual bool Accept(BGSPerk * perk) - { - if(perk) - { - bool addPerk = true; - if(m_actor) { - if(!CALL_MEMBER_FN(m_actor, HasPerk)(perk)) - addPerk = m_unowned; - else - addPerk = !m_unowned; - } - - if(addPerk) { - AddPerk(perk); - } - - if(m_allRanks) { - BGSPerk * nextPerk = perk->nextPerk; - while(nextPerk) { - addPerk = true; - if(m_actor) { - if(!CALL_MEMBER_FN(m_actor, HasPerk)(nextPerk)) - addPerk = m_unowned; - else - addPerk = !m_unowned; - } - - if(addPerk) { - AddPerk(nextPerk); - } - - nextPerk = nextPerk->nextPerk; - } - } - } - - return false; - } - virtual void AddPerk(BGSPerk * perk) = 0; -}; - -class PerkFormListVisitor : public MatchSkillPerks -{ - BGSListForm * m_formList; -public: - PerkFormListVisitor::PerkFormListVisitor(BGSListForm * list, Actor * actor, bool unowned, bool allRanks) : MatchSkillPerks(actor, unowned, allRanks) - { - m_formList = list; - } - - virtual void AddPerk(BGSPerk * perk) - { - CALL_MEMBER_FN(m_formList, AddFormToList)(perk); - } -}; - -class PerkArrayVisitor : public MatchSkillPerks -{ - VMResultArray * m_perks; -public: - PerkArrayVisitor::PerkArrayVisitor(VMResultArray * perkArray, Actor * actor, bool unowned, bool allRanks) : MatchSkillPerks(actor, unowned, allRanks) - { - m_perks = perkArray; - } - virtual void AddPerk(BGSPerk * perk) - { - m_perks->push_back(perk); - } -}; - -namespace papyrusActorValueInfo -{ - ActorValueInfo * GetActorValueInfoByName(StaticFunctionTag * base, BSFixedString avName) - { - UInt32 actorValue = LookupActorValueByName(avName.data); - ActorValueList * avList = ActorValueList::GetSingleton(); - if(!avList) - return NULL; - - return avList->GetActorValue(actorValue); - } - - ActorValueInfo * GetActorValueInfoByID(StaticFunctionTag * base, UInt32 actorValue) - { - ActorValueList * avList = ActorValueList::GetSingleton(); - if(!avList) - return NULL; - - return avList->GetActorValue(actorValue); - } - - bool IsSkill(ActorValueInfo * info) - { - return (info && info->skillUsages) ? true : false; - } - - float GetSkillUseMult(ActorValueInfo * info) - { - return (info && info->skillUsages) ? info->skillUsages[ActorValueInfo::kSkillUseMult] : 0.0; - } - - void SetSkillUseMult(ActorValueInfo * info, float value) - { - if(info && info->skillUsages) - info->skillUsages[ActorValueInfo::kSkillUseMult] = value; - } - - float GetSkillOffsetMult(ActorValueInfo * info) - { - return (info && info->skillUsages) ? info->skillUsages[ActorValueInfo::kSkillOffsetMult] : 0.0; - } - - void SetSkillOffsetMult(ActorValueInfo * info, float value) - { - if(info && info->skillUsages) - info->skillUsages[ActorValueInfo::kSkillOffsetMult] = value; - } - - float GetSkillImproveMult(ActorValueInfo * info) - { - return (info && info->skillUsages) ? info->skillUsages[ActorValueInfo::kSkillImproveMult] : 0.0; - } - - void SetSkillImproveMult(ActorValueInfo * info, float value) - { - if(info && info->skillUsages) - info->skillUsages[ActorValueInfo::kSkillImproveMult] = value; - } - - float GetSkillImproveOffset(ActorValueInfo * info) - { - return (info && info->skillUsages) ? info->skillUsages[ActorValueInfo::kSkillImproveOffset] : 0.0; - } - - void SetSkillImproveOffset(ActorValueInfo * info, float value) - { - if(info && info->skillUsages) - info->skillUsages[ActorValueInfo::kSkillImproveOffset] = value; - } - - float GetSkillExperience(ActorValueInfo * info) - { - PlayerCharacter* pPC = (*g_thePlayer); - return (info && pPC->skills) ? pPC->skills->GetSkillPoints(info->name) : 0.0; - } - - void SetSkillExperience(ActorValueInfo * info, float points) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(info && pPC->skills) { - pPC->skills->SetSkillPoints(info->name, points); - } - } - - void AddSkillExperience(ActorValueInfo * info, float points) - { - if(info) { - UInt32 actorValue = LookupActorValueByName(info->name); - if(actorValue < ActorValueList::kNumActorValues) { - PlayerCharacter* pPC = (*g_thePlayer); - pPC->AdvanceSkill(actorValue, points, 0, 0); - } - } - } - - float GetExperienceForLevel(ActorValueInfo * info, UInt32 level) - { - if(!info || !info->skillUsages) - return 0.0; - - double fSkillUseCurve = 0.0; - SettingCollectionMap * settings = *g_gameSettingCollection; - if(!settings) - return 0.0; - - Setting * skillUseCurve = settings->Get("fSkillUseCurve"); - if(skillUseCurve) - skillUseCurve->GetDouble(&fSkillUseCurve); - - return info->skillUsages[ActorValueInfo::kSkillImproveMult] * pow(level, fSkillUseCurve) + info->skillUsages[ActorValueInfo::kSkillImproveOffset]; - } - - SInt32 GetSkillLegendaryLevel(ActorValueInfo * info) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC && info && pPC->skills) { - return pPC->skills->GetSkillLegendaryLevel(info->name); - } - - return -1; - } - - void SetSkillLegendaryLevel(ActorValueInfo * info, UInt32 level) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC && info && pPC->skills) { - pPC->skills->SetSkillLegendaryLevel(info->name, level); - } - } - - void GetPerkTree(ActorValueInfo * info, BGSListForm * formList, Actor * actor, bool unowned, bool allRanks) - { - if(info && formList) { - BGSSkillPerkTreeNode * root = info->perkTree; - if(root) { - PerkFormListVisitor matcher(formList, actor, unowned, allRanks); - root->VisitPerks(matcher); - } - } - } - - VMResultArray GetPerks(ActorValueInfo * info, Actor * actor, bool unowned, bool allRanks) - { - VMResultArray result; - if(info) { - BGSSkillPerkTreeNode * root = info->perkTree; - if(root) { - PerkArrayVisitor matcher(&result, actor, unowned, allRanks); - root->VisitPerks(matcher); - } - } - return result; - } - - float GetCurrentValue(ActorValueInfo * info, Actor * actor) - { - if(info && actor) { - UInt32 actorValue = LookupActorValueByName(info->name); - if(actorValue < ActorValueList::kNumActorValues) { - return actor->actorValueOwner.GetCurrent(actorValue); - } - } - return 0.0; - } - - float GetBaseValue(ActorValueInfo * info, Actor * actor) - { - if(info && actor) { - UInt32 actorValue = LookupActorValueByName(info->name); - if(actorValue < ActorValueList::kNumActorValues) { - return actor->actorValueOwner.GetBase(actorValue); - } - } - return 0.0; - } - - float GetMaximumValue(ActorValueInfo * info, Actor * actor) - { - if(info && actor) { - UInt32 actorValue = LookupActorValueByName(info->name); - if(actorValue < ActorValueList::kNumActorValues) { - return actor->actorValueOwner.GetMaximum(actorValue); - } - } - return 0.0; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusActorValueInfo::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(ActorValueInfo::kTypeID, "ActorValueInfo"); - - registry->RegisterFunction( - new NativeFunction1("GetActorValueInfoByName", "ActorValueInfo", papyrusActorValueInfo::GetActorValueInfoByName, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetActorValueInfoByID", "ActorValueInfo", papyrusActorValueInfo::GetActorValueInfoByID, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsSkill", "ActorValueInfo", papyrusActorValueInfo::IsSkill, registry)); - - // Skill Usage - registry->RegisterFunction( - new NativeFunction0("GetSkillUseMult", "ActorValueInfo", papyrusActorValueInfo::GetSkillUseMult, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillUseMult", "ActorValueInfo", papyrusActorValueInfo::SetSkillUseMult, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetSkillOffsetMult", "ActorValueInfo", papyrusActorValueInfo::GetSkillOffsetMult, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillOffsetMult", "ActorValueInfo", papyrusActorValueInfo::SetSkillOffsetMult, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetSkillImproveMult", "ActorValueInfo", papyrusActorValueInfo::GetSkillImproveMult, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillImproveMult", "ActorValueInfo", papyrusActorValueInfo::SetSkillImproveMult, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetSkillImproveOffset", "ActorValueInfo", papyrusActorValueInfo::GetSkillImproveOffset, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillImproveOffset", "ActorValueInfo", papyrusActorValueInfo::SetSkillImproveOffset, registry)); - - // Skills - registry->RegisterFunction( - new NativeFunction0("GetSkillExperience", "ActorValueInfo", papyrusActorValueInfo::GetSkillExperience, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillExperience", "ActorValueInfo", papyrusActorValueInfo::SetSkillExperience, registry)); - - registry->RegisterFunction( - new NativeFunction1("AddSkillExperience", "ActorValueInfo", papyrusActorValueInfo::AddSkillExperience, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetExperienceForLevel", "ActorValueInfo", papyrusActorValueInfo::GetExperienceForLevel, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSkillLegendaryLevel", "ActorValueInfo", papyrusActorValueInfo::GetSkillLegendaryLevel, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSkillLegendaryLevel", "ActorValueInfo", papyrusActorValueInfo::SetSkillLegendaryLevel, registry)); - - - // Perk Tree - registry->RegisterFunction( - new NativeFunction4 ("GetPerkTree", "ActorValueInfo", papyrusActorValueInfo::GetPerkTree, registry)); - - registry->RegisterFunction( - new NativeFunction3 , Actor*, bool, bool>("GetPerks", "ActorValueInfo", papyrusActorValueInfo::GetPerks, registry)); - - - - // Value Info - registry->RegisterFunction( - new NativeFunction1 ("GetCurrentValue", "ActorValueInfo", papyrusActorValueInfo::GetCurrentValue, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetBaseValue", "ActorValueInfo", papyrusActorValueInfo::GetBaseValue, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetMaximumValue", "ActorValueInfo", papyrusActorValueInfo::GetMaximumValue, registry)); - - - registry->SetFunctionFlags("ActorValueInfo", "GetActorValueInfoByName", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "GetActorValueInfoByID", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillUseMult", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillUseMult", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillOffsetMult", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillOffsetMult", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillImproveMult", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillImproveMult", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillImproveOffset", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillImproveOffset", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillLegendaryLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillLegendaryLevel", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetSkillExperience", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "SetSkillExperience", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "AddSkillExperience", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ActorValueInfo", "GetExperienceForLevel", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("ActorValueInfo", "GetPerkTree", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.h b/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.h deleted file mode 100644 index 7bf78698..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusActorValueInfo.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -class VMClassRegistry; -class ActorValueInfo; -struct StaticFunctionTag; -class BGSListForm; -class Actor; - -#include "GameTypes.h" - -namespace papyrusActorValueInfo -{ - void RegisterFuncs(VMClassRegistry* registry); - - ActorValueInfo * GetActorValueInfoByName(StaticFunctionTag * base, BSFixedString avName); - ActorValueInfo * GetActorValueInfoByID(StaticFunctionTag * base, UInt32 actorValue); - - bool IsSkill(ActorValueInfo * info); - - float GetSkillUseMult(ActorValueInfo * info); - void SetSkillUseMult(ActorValueInfo * info, float value); - - float GetSkillOffsetMult(ActorValueInfo * info); - void SetSkillOffsetMult(ActorValueInfo * info, float value); - - float GetSkillImproveMult(ActorValueInfo * info); - void SetSkillImproveMult(ActorValueInfo * info, float value); - - float GetSkillImproveOffset(ActorValueInfo * info); - void SetSkillImproveOffset(ActorValueInfo * info, float value); - - float GetSkillExperience(ActorValueInfo * info); - void SetSkillExperience(ActorValueInfo * info, float points); - void AddSkillExperience(ActorValueInfo * info, float points); - float GetExperienceForLevel(ActorValueInfo * info, UInt32 level); - - SInt32 GetSkillLegendaryLevel(ActorValueInfo * info); - void SetSkillLegendaryLevel(ActorValueInfo * info, UInt32 level); - - - - void GetPerkTree(ActorValueInfo * info, BGSListForm * formList, Actor * actor, bool unowned, bool allRanks); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusAlias.cpp b/source/fs.dll/skse64/skse64/PapyrusAlias.cpp deleted file mode 100644 index 4485e154..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusAlias.cpp +++ /dev/null @@ -1,275 +0,0 @@ -#include "PapyrusAlias.h" - -#include "GameForms.h" -#include "PapyrusEvents.h" - -namespace papyrusAlias -{ - BSFixedString GetName(BGSBaseAlias* thisAlias) - { - return (thisAlias) ? thisAlias->name.data : NULL; - } - - UInt32 GetId(BGSBaseAlias* thisAlias) - { - return (thisAlias) ? thisAlias->aliasId : -1; - } - - void RegisterForKey(BGSBaseAlias * thisAlias, UInt32 key) - { - if(!thisAlias) - return; - g_inputKeyEventRegs.Register(key, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForKey(BGSBaseAlias * thisAlias, UInt32 key) - { - if(!thisAlias) - return; - g_inputKeyEventRegs.Unregister(key, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForAllKeys(BGSBaseAlias * thisAlias) - { - if(!thisAlias) - return; - g_inputKeyEventRegs.UnregisterAll(BGSBaseAlias::kTypeID, thisAlias); - } - - void RegisterForControl(BGSBaseAlias * thisAlias, BSFixedString control) - { - if(!thisAlias) - return; - g_inputControlEventRegs.Register(control, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForControl(BGSBaseAlias * thisAlias, BSFixedString control) - { - if(!thisAlias) - return; - g_inputControlEventRegs.Unregister(control, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForAllControls(BGSBaseAlias * thisAlias) - { - if(!thisAlias) - return; - g_inputControlEventRegs.UnregisterAll(BGSBaseAlias::kTypeID, thisAlias); - } - - void RegisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName) - { - if(!thisAlias || !menuName.data) - return; - - g_menuOpenCloseRegs.Register(menuName, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName) - { - if(!thisAlias || !menuName.data) - return; - - g_menuOpenCloseRegs.Unregister(menuName, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForAllMenus(BGSBaseAlias * thisAlias) - { - if(!thisAlias) - return; - - g_menuOpenCloseRegs.UnregisterAll(BGSBaseAlias::kTypeID, thisAlias); - } - - void RegisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString callbackName) - { - if(!thisAlias || !eventName.data || !callbackName.data) - return; - - ModCallbackParameters params; - params.callbackName = callbackName; - - g_modCallbackRegs.Register(eventName, BGSBaseAlias::kTypeID, thisAlias, ¶ms); - } - - void UnregisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName) - { - if(!thisAlias || !eventName.data) - return; - - g_modCallbackRegs.Unregister(eventName, BGSBaseAlias::kTypeID, thisAlias); - } - - void UnregisterForAllModEvents(BGSBaseAlias * thisAlias) - { - g_modCallbackRegs.UnregisterAll(BGSBaseAlias::kTypeID, thisAlias); - } - - void SendModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString strArg, float numArg) - { - if (!thisAlias || !eventName.data) - return; - - SKSEModCallbackEvent evn(eventName, strArg, numArg, thisAlias->owner); - g_modCallbackEventDispatcher.SendEvent(&evn); - } - - void RegisterForCameraState(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Register(BGSBaseAlias::kTypeID, thisForm); - } - - void UnregisterForCameraState(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Unregister(BGSBaseAlias::kTypeID, thisForm); - } - - void RegisterForCrosshairRef(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Register(BGSBaseAlias::kTypeID, thisForm); - } - - void UnregisterForCrosshairRef(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Unregister(BGSBaseAlias::kTypeID, thisForm); - } - - void RegisterForActorAction(BGSBaseAlias * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Register(actionType, BGSBaseAlias::kTypeID, thisForm); - } - - void UnregisterForActorAction(BGSBaseAlias * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Unregister(actionType, BGSBaseAlias::kTypeID, thisForm); - } - - void UnregisterForNiNodeUpdate(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Unregister(BGSBaseAlias::kTypeID, thisForm); - } - - void RegisterForNiNodeUpdate(BGSBaseAlias * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Register(BGSBaseAlias::kTypeID, thisForm); - } -} - - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusAlias::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetName", "Alias", papyrusAlias::GetName, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetId", "Alias", papyrusAlias::GetId, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForKey", "Alias", papyrusAlias::RegisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForKey", "Alias", papyrusAlias::UnregisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllKeys", "Alias", papyrusAlias::UnregisterForAllKeys, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForMenu", "Alias", papyrusAlias::RegisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForMenu", "Alias", papyrusAlias::UnregisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllMenus", "Alias", papyrusAlias::UnregisterForAllMenus, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("RegisterForModEvent", "Alias", papyrusAlias::RegisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForModEvent", "Alias", papyrusAlias::UnregisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllModEvents", "Alias", papyrusAlias::UnregisterForAllModEvents, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SendModEvent", "Alias", papyrusAlias::SendModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForControl", "Alias", papyrusAlias::RegisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForControl", "Alias", papyrusAlias::UnregisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllControls", "Alias", papyrusAlias::UnregisterForAllControls, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCameraState", "Alias", papyrusAlias::RegisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCameraState", "Alias", papyrusAlias::UnregisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCrosshairRef", "Alias", papyrusAlias::RegisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCrosshairRef", "Alias", papyrusAlias::UnregisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForActorAction", "Alias", papyrusAlias::RegisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForActorAction", "Alias", papyrusAlias::UnregisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForNiNodeUpdate", "Alias", papyrusAlias::RegisterForNiNodeUpdate, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForNiNodeUpdate", "Alias", papyrusAlias::UnregisterForNiNodeUpdate, registry)); - - registry->SetFunctionFlags("Alias", "RegisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForAllKeys", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForAllMenus", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForAllModEvents", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "SendModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForAllControls", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "RegisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Alias", "UnregisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusAlias.h b/source/fs.dll/skse64/skse64/PapyrusAlias.h deleted file mode 100644 index b9ba7553..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusAlias.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class BGSBaseAlias; -class VMClassRegistry; - -namespace papyrusAlias -{ - void RegisterFuncs(VMClassRegistry* registry); - - BSFixedString GetName(BGSBaseAlias* thisAlias); - UInt32 GetId(BGSBaseAlias* thisAlias); - - void RegisterForKey(BGSBaseAlias * thisAlias, UInt32 key); - void UnregisterForKey(BGSBaseAlias * thisAlias, UInt32 key); - void UnregisterForAllKeys(BGSBaseAlias * thisAlias); - - void RegisterForControl(BGSBaseAlias * thisAlias, BSFixedString control); - void UnregisterForControl(BGSBaseAlias * thisAlias, BSFixedString control); - void UnregisterForAllControls(BGSBaseAlias * thisAlias); - - void RegisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName); - void UnregisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName); - void UnregisterForAllMenus(BGSBaseAlias * thisAlias); - - void RegisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString callbackName); - void UnregisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName); - void UnregisterForAllModEvents(BGSBaseAlias * thisAlias); - - void SendModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString strArg, float numArg); - - void RegisterForCameraState(BGSBaseAlias * thisForm); - void UnregisterForCameraState(BGSBaseAlias * thisForm); - - void RegisterForCrosshairRef(BGSBaseAlias * thisForm); - void UnregisterForCrosshairRef(BGSBaseAlias * thisForm); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusAmmo.cpp b/source/fs.dll/skse64/skse64/PapyrusAmmo.cpp deleted file mode 100644 index d2c7c31b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusAmmo.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "PapyrusAmmo.h" -#include "GameObjects.h" - -namespace papyrusAmmo -{ - bool IsBolt(TESAmmo * thisAmmo) - { - return (thisAmmo) ? thisAmmo->isBolt() : false; - } - - BGSProjectile * GetProjectile(TESAmmo * thisAmmo) - { - return (thisAmmo) ? thisAmmo->settings.projectile : NULL; - } - - float GetDamage(TESAmmo * thisAmmo) - { - return (thisAmmo) ? thisAmmo->settings.damage : 0.0f; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusAmmo::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("IsBolt", "Ammo", papyrusAmmo::IsBolt, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetProjectile", "Ammo", papyrusAmmo::GetProjectile, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetDamage", "Ammo", papyrusAmmo::GetDamage, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusAmmo.h b/source/fs.dll/skse64/skse64/PapyrusAmmo.h deleted file mode 100644 index 9f3a4741..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusAmmo.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -class VMClassRegistry; -class BGSSoundDescriptorForm; -class TESAmmo; -class BGSProjectile; - -namespace papyrusAmmo -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool IsPlayable(TESAmmo * thisAmmo); - bool IsBolt(TESAmmo * thisAmmo); - BGSProjectile * GetProjectile(TESAmmo * thisAmmo); - float GetDamage(TESAmmo * thisAmmo); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusArgs.cpp b/source/fs.dll/skse64/skse64/PapyrusArgs.cpp deleted file mode 100644 index babb81d9..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArgs.cpp +++ /dev/null @@ -1,292 +0,0 @@ -#include "skse64/PapyrusArgs.h" -#include "skse64/PapyrusNativeFunctions.h" -#include "skse64/PapyrusVM.h" -#include "skse64/GameForms.h" - -//// type -> VMValue - -template <> void PackValue (VMValue * dst, void * src, VMClassRegistry * registry) -{ - dst->SetNone(); -} - -template <> void PackValue (VMValue * dst, UInt32 * src, VMClassRegistry * registry) -{ - dst->SetInt(*src); -} - -template <> void PackValue (VMValue * dst, SInt32 * src, VMClassRegistry * registry) -{ - dst->SetInt(*src); -} - -template <> void PackValue (VMValue * dst, float * src, VMClassRegistry * registry) -{ - dst->SetFloat(*src); -} - -template <> void PackValue (VMValue * dst, bool * src, VMClassRegistry * registry) -{ - dst->SetBool(*src); -} - -template <> void PackValue (VMValue * dst, BSFixedString * src, VMClassRegistry * registry) -{ - dst->SetString(src->data); -} - -void BindID(VMIdentifier ** identifier, void * srcData, VMClassRegistry * registry, IObjectHandlePolicy * handlePolicy, UInt32 typeID) -{ - UInt32 unk = 0; - - VMClassInfo * classInfo = (*identifier)->m_type; - if(classInfo) - classInfo->AddRef(); - - if(registry->Unk_0D(&classInfo->name, &unk)) - { - UInt64 handle = handlePolicy->Create(typeID, srcData); - - if( handlePolicy->IsType(unk, handle) || - (handle == handlePolicy->GetInvalidHandle())) - { - CALL_MEMBER_FN(registry->GetObjectBindPolicy(), BindObject)(identifier, handle); - } - } - - if(classInfo) - classInfo->Release(); -} - -void PackHandle(VMValue * dst, void * src, UInt32 typeID, VMClassRegistry * registry) -{ - dst->SetNone(); - - if(!src) return; - - VMClassInfo * classInfo = NULL; - - // get class info - if(registry->GetFormTypeClass(typeID, &classInfo)) - if(classInfo) - classInfo->Release(); - - if(!classInfo) return; - - IObjectHandlePolicy * handlePolicy = registry->GetHandlePolicy(); - - UInt64 handle = handlePolicy->Create(typeID, src); - VMIdentifier * identifier = NULL; - - // find existing identifier - if(!registry->Unk_1C(handle, classInfo->name.data, &identifier)) - { - if(registry->Unk_15(&classInfo->name, &identifier)) - { - if(identifier) - { - BindID(&identifier, src, registry, handlePolicy, typeID); - } - } - } - - // copy the identifier out - if(identifier) - { - VMValue tempValue; - - tempValue.SetIdentifier(classInfo); - - CALL_MEMBER_FN(dst, Set)(&tempValue); - dst->SetIdentifier(&identifier); - } - - // release our reference - if(identifier) - { - if(!identifier->DecrementLock()) - { - identifier->Destroy(); - } - } -} - -//// VMValue -> type - -template <> void UnpackValue (float * dst, VMValue * src) -{ - switch(src->type) - { - case VMValue::kType_Int: - *dst = src->data.i; - break; - - case VMValue::kType_Float: - *dst = src->data.f; - break; - - case VMValue::kType_Bool: - *dst = src->data.b; - break; - - default: - *dst = 0; - break; - } -} - -template <> void UnpackValue (UInt32 * dst, VMValue * src) -{ - switch(src->type) - { - case VMValue::kType_Int: - *dst = src->data.u; - break; - - case VMValue::kType_Float: - *dst = src->data.f; - break; - - case VMValue::kType_Bool: - *dst = src->data.b; - break; - - default: - *dst = 0; - break; - } -} - -template <> void UnpackValue (SInt32 * dst, VMValue * src) -{ - switch(src->type) - { - case VMValue::kType_Int: - *dst = src->data.u; - break; - - case VMValue::kType_Float: - *dst = src->data.f; - break; - - case VMValue::kType_Bool: - *dst = src->data.b; - break; - - default: - *dst = 0; - break; - } -} - -template <> void UnpackValue (bool * dst, VMValue * src) -{ - switch(src->type) - { - case VMValue::kType_Int: - *dst = src->data.u != 0; - break; - - case VMValue::kType_Float: - *dst = src->data.f != 0; - break; - - case VMValue::kType_Bool: - *dst = src->data.b; - break; - - default: - *dst = 0; - break; - } -} - -template <> void UnpackValue (BSFixedString * dst, VMValue * src) -{ - const char * data = NULL; - - if(src->type == VMValue::kType_String) - data = src->data.str; - - CALL_MEMBER_FN(dst, Set)(data); -} - -template <> void UnpackValue >(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, VMValue::kType_IntArray); -} - -template <> void UnpackValue >(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, VMValue::kType_IntArray); -} - -template <> void UnpackValue >(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, VMValue::kType_FloatArray); -} - -template <> void UnpackValue >(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, VMValue::kType_BoolArray); -} - -template <> void UnpackValue >(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, VMValue::kType_StringArray); -} - -void * UnpackHandle(VMValue * src, UInt32 typeID) -{ - if(!src->IsIdentifier()) return NULL; - if(!src->data.id) return NULL; - - UInt64 handle = src->data.id->GetHandle(); - - if(!(*g_objectHandlePolicy)->IsType(typeID, handle)) return NULL; - if(!(*g_objectHandlePolicy)->Unk_02(handle)) return NULL; - - return (*g_objectHandlePolicy)->Resolve(typeID, handle); -} - -//// type -> type ID - -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_None; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_Int; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_Int; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_Int; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_Float; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_Bool; } -template <> UInt64 GetTypeID (VMClassRegistry * registry) { return VMValue::kType_String; } - -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_FloatArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_BoolArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_StringArray; } - -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_IntArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_FloatArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_BoolArray; } -template <> UInt64 GetTypeID >(VMClassRegistry * registry) { return VMValue::kType_StringArray; } - -UInt64 GetTypeIDFromFormTypeID(UInt32 formTypeID, VMClassRegistry * registry) -{ - UInt64 result = 0; - VMClassInfo * info = NULL; - - if(registry->GetFormTypeClass(formTypeID, &info)) - { - if(info) - { - result = (UInt64)info; - - info->Release(); // yes, really - } - } - - return result; -} diff --git a/source/fs.dll/skse64/skse64/PapyrusArgs.h b/source/fs.dll/skse64/skse64/PapyrusArgs.h deleted file mode 100644 index 719b790f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArgs.h +++ /dev/null @@ -1,212 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/PapyrusVM.h" - -#include - -class VMState; -class VMValue; -class VMClassRegistry; -struct StaticFunctionTag; -class EffectSetting; - -class VMArgList -{ -public: - VMArgList(); - ~VMArgList(); - - MEMBER_FN_PREFIX(VMArgList); - DEFINE_MEMBER_FN(GetOffset, UInt32, 0x0136F0E0, VMState * state); - // FB33603AEC8921D8A9361F52478B667E583E54A1+20 - DEFINE_MEMBER_FN(Get, VMValue *, 0x0136F150, VMState * state, UInt32 idx, UInt32 offset); -}; - -template -class VMArray -{ -public: - VMValue::ArrayData * arr; - UInt32 Length() const { return arr ? arr->len : 0; } - void Get(T * dst, const UInt32 idx) { UnpackValue(dst, arr->GetData()+idx); } - void Set(T * src, const UInt32 idx) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - PackValue(arr->GetData()+idx, src, registry); - } -}; - -template -class VMResultArray : public std::vector -{ -public: - void PackArray(VMValue::ArrayData * data, VMClassRegistry * registry) - { - // Copy the contents from the reference array to the VM array - UInt32 i = 0; - for(std::vector::iterator it = begin(); it != end(); ++it, i++) { - VMValue * value = data->GetData() + i; - PackValue(value, (T*)&(*it), registry); - value->type = GetTypeID(registry); // Always pack the type, even if empty data - } - } -}; - -template -void PackValue(VMValue * dst, VMResultArray * src, VMClassRegistry * registry) -{ - // Clear out old contents if any - dst->SetNone(); - if(src->size() > 0) { - VMValue::ArrayData * data = NULL; - // Request the VM allocate a new array - registry->CreateArray(dst, src->size(), &data); - if(data) { - src->PackArray(data, registry); - - // Set the appropriate TypeID and assign the new data array - dst->type = GetTypeID>(registry); - dst->data.arr = data; - } - } - - // Clear the temp contents of the reference array - src->clear(); -} - -template -void UnpackValue(VMArray * dst, VMValue * src) -{ - UnpackArray(dst, src, GetTypeIDFromFormTypeID(T::kTypeID, (*g_skyrimVM)->GetClassRegistry()) | VMValue::kType_Identifier); -} - -template -void PackValue(VMValue * dst, T * src, VMClassRegistry * registry); - -template -void UnpackValue(T * dst, VMValue * src); - -template <> void PackValue (VMValue * dst, void * src, VMClassRegistry * registry); -template <> void PackValue (VMValue * dst, UInt32 * src, VMClassRegistry * registry); -template <> void PackValue (VMValue * dst, SInt32 * src, VMClassRegistry * registry); -template <> void PackValue (VMValue * dst, float * src, VMClassRegistry * registry); -template <> void PackValue (VMValue * dst, bool * src, VMClassRegistry * registry); -template <> void PackValue (VMValue * dst, BSFixedString * src, VMClassRegistry * registry); - -void PackHandle(VMValue * dst, void * src, UInt32 typeID, VMClassRegistry * registry); - -template -void PackValue(VMValue * dst, T ** src, VMClassRegistry * registry) -{ - typedef std::remove_pointer ::type BaseType; - PackHandle(dst, *src, BaseType::kTypeID, registry); -} - -template <> void UnpackValue (float * dst, VMValue * src); -template <> void UnpackValue (UInt32 * dst, VMValue * src); -template <> void UnpackValue (SInt32 * dst, VMValue * src); -template <> void UnpackValue (bool * dst, VMValue * src); -template <> void UnpackValue (BSFixedString * dst, VMValue * src); - -template <> void UnpackValue >(VMArray * dst, VMValue * src); -template <> void UnpackValue >(VMArray * dst, VMValue * src); -template <> void UnpackValue >(VMArray * dst, VMValue * src); -template <> void UnpackValue >(VMArray * dst, VMValue * src); -template <> void UnpackValue >(VMArray * dst, VMValue * src); - -void * UnpackHandle(VMValue * src, UInt32 typeID); - -template -void UnpackValue(T ** dst, VMValue * src) -{ - *dst = (T *)UnpackHandle(src, T::kTypeID); -} - -template -void UnpackArray(VMArray * dst, VMValue * src, const UInt64 type) -{ - VMValue::ArrayData * arrData; - - if (src->type != type || (arrData = src->data.arr, !arrData)) - { - dst->arr = NULL; - return; - } - - dst->arr = arrData; -} - -UInt64 GetTypeIDFromFormTypeID(UInt32 formTypeID, VMClassRegistry * registry); - -template -struct IsArrayType -{ - enum { value = 0 }; - typedef T TypedArg; -}; - -template -struct IsArrayType> -{ - enum { value = 1 }; - typedef T TypedArg; -}; - -template -struct IsArrayType> -{ - enum { value = 1 }; - typedef T TypedArg; -}; - -template -auto GetTypeID(VMClassRegistry* registry) -> std::enable_if_t::value && !IsArrayType::value, UInt64>; - -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); -template <> UInt64 GetTypeID (VMClassRegistry * registry); - -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); - -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); -template <> UInt64 GetTypeID >(VMClassRegistry * registry); - -template -auto GetTypeID(VMClassRegistry * registry) --> std::enable_if_t::value, UInt64> -{ - return GetTypeIDFromFormTypeID(IsArrayType::TypedArg::kTypeID, registry) | VMValue::kType_Identifier; -} - -template -auto GetTypeID(VMClassRegistry * registry) --> std::enable_if_t::value && !IsArrayType>::value, UInt64> -{ - return GetTypeIDFromFormTypeID(std::remove_pointer::type::kTypeID, registry); -} - -template -struct IsStaticType -{ - enum { value = 0 }; -}; - -template <> -struct IsStaticType -{ - enum { value = 1 }; -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusArmor.cpp b/source/fs.dll/skse64/skse64/PapyrusArmor.cpp deleted file mode 100644 index 35853d7e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArmor.cpp +++ /dev/null @@ -1,208 +0,0 @@ -#include "PapyrusArmor.h" - -#include "GameObjects.h" - -namespace papyrusArmor -{ - UInt32 GetArmorRating(TESObjectARMO* thisArmor) - { - return (thisArmor) ? thisArmor->armorValTimes100 / 100 : 0; - } - - void SetArmorRating(TESObjectARMO* thisArmor, UInt32 nuAR) - { - if (thisArmor) { - thisArmor->armorValTimes100 = nuAR * 100; - } - } - - void ModArmorRating(TESObjectARMO* thisArmor, SInt32 modBy) - { - if (thisArmor) { - SInt32 nuAR = thisArmor->armorValTimes100 + (modBy * 100); - if (nuAR < 0) - nuAR = 0; - thisArmor->armorValTimes100 = nuAR; - } - } - - UInt32 GetSlotMask(TESObjectARMO* thisArmor) - { - return (thisArmor) ? thisArmor->bipedObject.GetSlotMask() : 0; - } - - void SetSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask) - { - if (thisArmor) { - thisArmor->bipedObject.SetSlotMask(slotMask); - } - } - - UInt32 AddSlotToMask(TESObjectARMO* thisArmor, UInt32 slot) - { - return (thisArmor) ? thisArmor->bipedObject.AddSlotToMask(slot) : 0; - - } - - UInt32 RemoveSlotFromMask(TESObjectARMO* thisArmor, UInt32 slot) - { - return (thisArmor) ? thisArmor->bipedObject.RemoveSlotFromMask(slot) : 0; - } - - UInt32 GetMaskForSlot(StaticFunctionTag*, UInt32 slot) - { - if (slot < 29 || slot > 61) - return 0; - - return (1 << (slot - 30)); - } - - BSFixedString GetModelPath(TESObjectARMO* thisArmor, bool bFemale) - { - return (thisArmor) ? thisArmor->bipedModel.textureSwap[bFemale ? 1 : 0].GetModelName() : NULL; - } - - void SetModelPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale) - { - if (thisArmor) { - thisArmor->bipedModel.textureSwap[bFemale ? 1 : 0].SetModelName(nuPath.data); - } - } - - BSFixedString GetIconPath(TESObjectARMO* thisArmor, bool bFemale) - { - return (thisArmor) ? thisArmor->bipedModel.icon[bFemale ? 1 : 0].str : NULL; - } - - void SetIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale) - { - if (thisArmor) { - thisArmor->bipedModel.icon[bFemale ? 1 : 0].str = nuPath.data; - } - } - - BSFixedString GetMessageIconPath(TESObjectARMO* thisArmor, bool bFemale) - { - return (thisArmor) ? thisArmor->bipedModel.messageIcon[bFemale ? 1 : 0].icon.str : NULL; - } - - void SetMessageIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale) - { - if (thisArmor) { - thisArmor->bipedModel.messageIcon[bFemale ? 1 : 0].icon.str = nuPath.data; - } - } - - UInt32 GetWeightClass(TESObjectARMO* thisArmor) - { - return (thisArmor) ? thisArmor->bipedObject.data.weightClass : BGSBipedObjectForm::kWeight_None; - } - - void SetWeightClass(TESObjectARMO* thisArmor, UInt32 nuWeightClass) - { - if (thisArmor && nuWeightClass <=2) - thisArmor->bipedObject.data.weightClass = nuWeightClass; - } - - EnchantmentItem* GetEnchantment(TESObjectARMO* thisArmor) - { - return (thisArmor) ? thisArmor->enchantable.enchantment : NULL; - } - - void SetEnchantment(TESObjectARMO* thisArmor, EnchantmentItem* enchantment) - { - if (thisArmor) { - thisArmor->enchantable.enchantment = enchantment; - } - } - - UInt32 GetNumArmorAddons(TESObjectARMO* thisArmor) - { - return (thisArmor) ? thisArmor->armorAddons.count : 0; - } - - TESObjectARMA* GetNthArmorAddon(TESObjectARMO* thisArmor, UInt32 n) - { - if(!thisArmor) - return NULL; - - TESObjectARMA * addon = NULL; - if(thisArmor->armorAddons.GetNthItem(n, addon)) - return addon; - - return NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusArmor::RegisterFuncs(VMClassRegistry* registry) -{ - // Armor Rating - registry->RegisterFunction( - new NativeFunction0 ("GetArmorRating", "Armor", papyrusArmor::GetArmorRating, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetArmorRating", "Armor", papyrusArmor::SetArmorRating, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ModArmorRating", "Armor", papyrusArmor::ModArmorRating, registry)); - - // Slot Mask - registry->RegisterFunction( - new NativeFunction0 ("GetSlotMask", "Armor", papyrusArmor::GetSlotMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSlotMask", "Armor", papyrusArmor::SetSlotMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("AddSlotToMask", "Armor", papyrusArmor::AddSlotToMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RemoveSlotFromMask", "Armor", papyrusArmor::RemoveSlotFromMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetMaskForSlot", "Armor", papyrusArmor::GetMaskForSlot, registry)); - - // World Model - registry->RegisterFunction( - new NativeFunction1 ("GetModelPath", "Armor", papyrusArmor::GetModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetModelPath", "Armor", papyrusArmor::SetModelPath, registry)); - - // Icon - registry->RegisterFunction( - new NativeFunction1 ("GetIconPath", "Armor", papyrusArmor::GetIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetIconPath", "Armor", papyrusArmor::SetIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetMessageIconPath", "Armor", papyrusArmor::GetMessageIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetMessageIconPath", "Armor", papyrusArmor::SetMessageIconPath, registry)); - - // Weight Class - registry->RegisterFunction( - new NativeFunction0 ("GetWeightClass", "Armor", papyrusArmor::GetWeightClass, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWeightClass", "Armor", papyrusArmor::SetWeightClass, registry)); - - // Enchantments - registry->RegisterFunction( - new NativeFunction0 ("GetEnchantment", "Armor", papyrusArmor::GetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEnchantment", "Armor", papyrusArmor::SetEnchantment, registry)); - - // Armor Addons - registry->RegisterFunction( - new NativeFunction0 ("GetNumArmorAddons", "Armor", papyrusArmor::GetNumArmorAddons, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthArmorAddon", "Armor", papyrusArmor::GetNthArmorAddon, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusArmor.h b/source/fs.dll/skse64/skse64/PapyrusArmor.h deleted file mode 100644 index 0458a28b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArmor.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "GameTypes.h" -class TESObjectARMO; -struct StaticFunctionTag; -class VMClassRegistry; -class EnchantmentItem; -class TESObjectARMA; - - -namespace papyrusArmor -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetArmorRating(TESObjectARMO* thisArmor); - void SetArmorRating(TESObjectARMO* thisArmor, UInt32 nuAR); - void ModArmorRating(TESObjectARMO* thisArmor, SInt32 modBy); - - UInt32 GetSlotMask(TESObjectARMO* thisArmor); - void SetSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); - UInt32 AddToSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); - UInt32 RemoveFromSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); - - UInt32 GetMaskForSlot(StaticFunctionTag*, UInt32 slot); - - BSFixedString GetModelPath(TESObjectARMO* thisArmor, bool bFemale); - void SetModelPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); - - BSFixedString GetIconPath(TESObjectARMO* thisArmor, bool bFemale); - void SetIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); - - BSFixedString GetMessageIconPath(TESObjectARMO* thisArmor, bool bFemale); - void SetMessageIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); - - UInt32 GetWeightClass(TESObjectARMO* thisArmor); - void SetWeightClass(TESObjectARMO* thisArmor, UInt32 nuWeightClass); - - EnchantmentItem* GetEnchantment(TESObjectARMO* thisArmor); - void SetEnchantment(TESObjectARMO* thisArmor, EnchantmentItem* enchantment); - - UInt32 GetNumArmorAddons(TESObjectARMO* thisArmor); - TESObjectARMA* GetNthArmorAddon(TESObjectARMO* thisArmor, UInt32 n); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusArmorAddon.cpp b/source/fs.dll/skse64/skse64/PapyrusArmorAddon.cpp deleted file mode 100644 index 03c6ae25..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArmorAddon.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include "PapyrusArmorAddon.h" - -#include "GameObjects.h" - -namespace papyrusArmorAddon -{ - BSFixedString GetModelPath(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale) - { - return (thisArmorAddon) ? thisArmorAddon->models[bFirst][bFemale].GetModelName() : NULL; - } - - void SetModelPath(TESObjectARMA* thisArmorAddon, BSFixedString nuPath, bool bFirst, bool bFemale) - { - if(thisArmorAddon) { - thisArmorAddon->models[bFirst][bFemale].SetModelName(nuPath.data); - } - } - - UInt32 GetModelNumTextureSets(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale) - { - return (thisArmorAddon) ? thisArmorAddon->models[bFirst][bFemale].count : 0; - } - - BGSTextureSet* GetModelNthTextureSet(TESObjectARMA* thisArmorAddon, UInt32 n, bool bFirst, bool bFemale) - { - if(!thisArmorAddon) - return NULL; - - TESModelTextureSwap * tex = &thisArmorAddon->models[bFirst][bFemale]; - - if(!tex->swaps || n >= tex->count) - return NULL; - - return tex->swaps[n].textureSet; - } - - void SetModelNthTextureSet(TESObjectARMA* thisArmorAddon, BGSTextureSet* textureSet, UInt32 n, bool bFirst, bool bFemale) - { - if(!thisArmorAddon || !textureSet) - return; - - TESModelTextureSwap * tex = &thisArmorAddon->models[bFirst][bFemale]; - - if(!tex->swaps || n >= tex->count) - return; - - tex->swaps[n].textureSet = textureSet; - } - - UInt32 GetNumAdditionalRaces(TESObjectARMA* thisArmorAddon) - { - return (thisArmorAddon) ? thisArmorAddon->additionalRaces.count : 0; - } - - TESRace* GetNthAdditionalRace(TESObjectARMA* thisArmorAddon, UInt32 n) - { - if(!thisArmorAddon || (n >= thisArmorAddon->additionalRaces.count)) - return NULL; - - TESRace * race = NULL; - if(!thisArmorAddon->additionalRaces.GetNthItem(n, race)) - return NULL; - - return race; - } - - UInt32 GetSlotMask(TESObjectARMA* thisArmorAddon) - { - return (thisArmorAddon) ? thisArmorAddon->biped.GetSlotMask() : 0; - } - - void SetSlotMask(TESObjectARMA* thisArmorAddon, UInt32 slotMask) - { - if (thisArmorAddon) { - thisArmorAddon->biped.SetSlotMask(slotMask); - } - } - - UInt32 AddSlotToMask(TESObjectARMA* thisArmorAddon, UInt32 slot) - { - return (thisArmorAddon) ? thisArmorAddon->biped.AddSlotToMask(slot) : 0; - - } - - UInt32 RemoveSlotFromMask(TESObjectARMA* thisArmorAddon, UInt32 slot) - { - return (thisArmorAddon) ? thisArmorAddon->biped.RemoveSlotFromMask(slot) : 0; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusArmorAddon::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(TESObjectARMA::kTypeID, "ArmorAddon"); - - // Model - registry->RegisterFunction( - new NativeFunction2 ("GetModelPath", "ArmorAddon", papyrusArmorAddon::GetModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetModelPath", "ArmorAddon", papyrusArmorAddon::SetModelPath, registry)); - - // Textures - registry->RegisterFunction( - new NativeFunction2 ("GetModelNumTextureSets", "ArmorAddon", papyrusArmorAddon::GetModelNumTextureSets, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("GetModelNthTextureSet", "ArmorAddon", papyrusArmorAddon::GetModelNthTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction4 ("SetModelNthTextureSet", "ArmorAddon", papyrusArmorAddon::SetModelNthTextureSet, registry)); - - // Races - registry->RegisterFunction( - new NativeFunction0 ("GetNumAdditionalRaces", "ArmorAddon", papyrusArmorAddon::GetNumAdditionalRaces, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthAdditionalRace", "ArmorAddon", papyrusArmorAddon::GetNthAdditionalRace, registry)); - - // Slot Mask - registry->RegisterFunction( - new NativeFunction0 ("GetSlotMask", "ArmorAddon", papyrusArmorAddon::GetSlotMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSlotMask", "ArmorAddon", papyrusArmorAddon::SetSlotMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("AddSlotToMask", "ArmorAddon", papyrusArmorAddon::AddSlotToMask, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RemoveSlotFromMask", "ArmorAddon", papyrusArmorAddon::RemoveSlotFromMask, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusArmorAddon.h b/source/fs.dll/skse64/skse64/PapyrusArmorAddon.h deleted file mode 100644 index 6b59c97c..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArmorAddon.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "GameTypes.h" -class TESObjectARMA; -class VMClassRegistry; -class TESRace; -class BGSTextureSet; - -namespace papyrusArmorAddon -{ - void RegisterFuncs(VMClassRegistry* registry); - - BSFixedString GetModelPath(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale); - void SetModelPath(TESObjectARMA* thisArmorAddon, BSFixedString nuPath, bool bFirst, bool bFemale); - - UInt32 GetModelNumTextureSets(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale); - BGSTextureSet* GetModelNthTextureSet(TESObjectARMA* thisArmorAddon, UInt32 n, bool bFirst, bool bFemale); - - UInt32 GetNumAdditionalRaces(TESObjectARMA* thisArmorAddon); - TESRace* GetNthAdditionalRace(TESObjectARMA* thisArmorAddon, UInt32 n); - - UInt32 GetSlotMask(TESObjectARMA* thisArmorAddon); - void SetSlotMask(TESObjectARMA* thisArmorAddon, UInt32 slotMask); - UInt32 AddSlotToMask(TESObjectARMA* thisArmorAddon, UInt32 slot); - UInt32 RemoveSlotFromMask(TESObjectARMA* thisArmorAddon, UInt32 slot); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusArt.cpp b/source/fs.dll/skse64/skse64/PapyrusArt.cpp deleted file mode 100644 index 97ec9d42..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArt.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "PapyrusArt.h" - -#include "GameObjects.h" -#include "GameData.h" - -namespace papyrusArt -{ - BSFixedString GetModelPath(BGSArtObject* thisArt) - { - return (thisArt) ? thisArt->texSwap.GetModelName() : NULL; - } - - void SetModelPath(BGSArtObject* thisArt, BSFixedString nuPath) - { - if(thisArt) { - thisArt->texSwap.SetModelName(nuPath.data); - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusArt::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSArtObject::kTypeID, "Art"); - - registry->RegisterFunction( - new NativeFunction0 ("GetModelPath", "Art", papyrusArt::GetModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetModelPath", "Art", papyrusArt::SetModelPath, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusArt.h b/source/fs.dll/skse64/skse64/PapyrusArt.h deleted file mode 100644 index ba8314a6..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusArt.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class VMClassRegistry; - -namespace papyrusArt -{ - void RegisterFuncs(VMClassRegistry* registry); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusBook.cpp b/source/fs.dll/skse64/skse64/PapyrusBook.cpp deleted file mode 100644 index 8f78837d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusBook.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "PapyrusBook.h" - -#include "GameObjects.h" - -namespace papyrusBook -{ - UInt32 GetSkill(TESObjectBOOK * thisBook) - { - if(thisBook && thisBook->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Skill) - return thisBook->data.teaches.skill; - - return 0; - } - - SpellItem * GetSpell(TESObjectBOOK * thisBook) - { - if(thisBook && thisBook->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Spell) - return thisBook->data.teaches.spell; - - return NULL; - } - - bool IsRead(TESObjectBOOK * thisBook) - { - return (thisBook) ? ((thisBook->data.flags & TESObjectBOOK::Data::kType_Read) == TESObjectBOOK::Data::kType_Read) : false; - } - - bool IsTakeable(TESObjectBOOK * thisBook) - { - return (thisBook) ? ((thisBook->data.flags & TESObjectBOOK::Data::kType_CantBeTaken) == 0) : false; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusBook::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetSkill", "Book", papyrusBook::GetSkill, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetSpell", "Book", papyrusBook::GetSpell, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsRead", "Book", papyrusBook::IsRead, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsTakeable", "Book", papyrusBook::IsTakeable, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusBook.h b/source/fs.dll/skse64/skse64/PapyrusBook.h deleted file mode 100644 index b13e64ae..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusBook.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -class TESObjectBOOK; -class SpellItem; -class VMClassRegistry; - -namespace papyrusBook -{ - void RegisterFuncs(VMClassRegistry * registry); - - UInt32 GetSkill(TESObjectBOOK * thisBook); - SpellItem * GetSpell(TESObjectBOOK * thisBook); - bool IsRead(TESObjectBOOK * thisBook); - bool IsTakeable(TESObjectBOOK * thisBook); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusCamera.cpp b/source/fs.dll/skse64/skse64/PapyrusCamera.cpp deleted file mode 100644 index 0c11c566..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCamera.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "PapyrusCamera.h" -#include "GameReferences.h" -#include "GameCamera.h" - -namespace papyrusCamera -{ - SInt32 GetCameraState(StaticFunctionTag * base) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - for(int i = 0; i < PlayerCamera::kNumCameraStates; i++) { - if(playerCamera->cameraState == playerCamera->cameraStates[i]) - return i; - } - } - - return -1; - } - - void UpdateThirdPerson(StaticFunctionTag * base) - { - PlayerCharacter* pPC = (*g_thePlayer); - PlayerCamera * camera = PlayerCamera::GetSingleton(); - if(pPC && camera) { - CALL_MEMBER_FN(camera, UpdateThirdPerson)(pPC->actorState.IsWeaponDrawn()); - } - } - - float GetWorldFieldOfView(StaticFunctionTag * base) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - return playerCamera->worldFOV; - } - - return 0; - } - - void SetWorldFieldOfView(StaticFunctionTag * base, float fov) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - playerCamera->worldFOV = fov; - } - } - - float GetFirstPersonFieldOfView(StaticFunctionTag * base) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - return playerCamera->firstPersonFOV; - } - - return 0; - } - - void SetFirstPersonFieldOfView(StaticFunctionTag * base, float fov) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - playerCamera->firstPersonFOV = fov; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusCamera::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetCameraState", "Camera", papyrusCamera::GetCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UpdateThirdPerson", "Camera", papyrusCamera::UpdateThirdPerson, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWorldFieldOfView", "Camera", papyrusCamera::GetWorldFieldOfView, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWorldFieldOfView", "Camera", papyrusCamera::SetWorldFieldOfView, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetFirstPersonFieldOfView", "Camera", papyrusCamera::GetFirstPersonFieldOfView, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFirstPersonFieldOfView", "Camera", papyrusCamera::SetFirstPersonFieldOfView, registry)); - - registry->SetFunctionFlags("Camera", "GetCameraState", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusCamera.h b/source/fs.dll/skse64/skse64/PapyrusCamera.h deleted file mode 100644 index 2a9517de..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCamera.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusCamera -{ - void RegisterFuncs(VMClassRegistry* registry); - - SInt32 GetCameraState(StaticFunctionTag * base); - void UpdateThirdPerson(StaticFunctionTag * base); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusCell.cpp b/source/fs.dll/skse64/skse64/PapyrusCell.cpp deleted file mode 100644 index 352846a0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCell.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "PapyrusCell.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameReferences.h" - -namespace papyrusCell -{ - UInt32 GetNumRefs(TESObjectCELL* thisCell, UInt32 formType) - { - // SE: new implementation. objectList is not longer reliable and it is NULL in most cells. - - if (!thisCell) - return 0; - - if (formType == 0) - return thisCell->refData.maxSize - thisCell->refData.freeEntries; - - UInt32 numRefs = 0; - - for (UInt32 i = 0; i < thisCell->refData.maxSize; i++) - { - if (thisCell->refData.refArray[i].unk08 && thisCell->refData.refArray[i].ref) - { - if (thisCell->refData.refArray[i].ref->baseForm->formType == formType) - { - numRefs++; - } - } - } - - return numRefs; - } - - TESObjectREFR * GetNthRef(TESObjectCELL * thisCell, UInt32 index, UInt32 formType) - { - // SE: new implementation. objectList is not longer reliable and it is NULL in most cells. - - if (!thisCell) - return NULL; - - for (UInt32 i = 0, n = 0; i < thisCell->refData.maxSize; i++) - { - if (thisCell->refData.refArray[i].unk08 && thisCell->refData.refArray[i].ref) - { - if (formType == 0 || thisCell->refData.refArray[i].ref->baseForm->formType == formType) - { - if (n++ == index) - { - return thisCell->refData.refArray[i].ref; - } - } - } - } - return NULL; - } - - float GetWaterLevel(TESObjectCELL * thisCell) - { - if (!thisCell) - return LONG_MIN; - - return thisCell->waterLevel; - } - - float GetActualWaterLevel(TESObjectCELL * thisCell) - { - if (!thisCell) - return LONG_MIN; - - if (thisCell->waterLevel == FLT_MAX && thisCell->worldSpace) - return thisCell->worldSpace->landData.defaultWaterHeight; - - return thisCell->waterLevel; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusCell::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetNumRefs", "Cell", papyrusCell::GetNumRefs, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetNthRef", "Cell", papyrusCell::GetNthRef, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWaterLevel", "Cell", papyrusCell::GetWaterLevel, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetActualWaterLevel", "Cell", papyrusCell::GetActualWaterLevel, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusCell.h b/source/fs.dll/skse64/skse64/PapyrusCell.h deleted file mode 100644 index 06811433..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCell.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -class TESObjectCELL; -class TESObjectREFR; -class VMClassRegistry; - -namespace papyrusCell -{ - void RegisterFuncs(VMClassRegistry* registry); - UInt32 GetNumRefs(TESObjectCELL* thisCell, UInt32 formType); - TESObjectREFR* GetNthRef(TESObjectCELL* thisCell, UInt32 index, UInt32 formType); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusClass.cpp b/source/fs.dll/skse64/skse64/PapyrusClass.cpp deleted file mode 100644 index dda28397..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusClass.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "PapyrusClass.h" diff --git a/source/fs.dll/skse64/skse64/PapyrusClass.h b/source/fs.dll/skse64/skse64/PapyrusClass.h deleted file mode 100644 index c8d7876b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusClass.h +++ /dev/null @@ -1,179 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" - -// SkyrimScript::Store, derived from BSScript::IStore, derived from BSStorage, derived from BSIntrusiveRefCounted -class VMDataStore -{ -public: - virtual ~VMDataStore(); - virtual void Unk_01(void); - virtual void Unk_02(void); - virtual bool Seek(SInt32 offset, UInt32 base); - virtual bool Read(UInt32 len, void * buf); - virtual bool Write(UInt32 len, void * buf); - - // BSScript::IStore - virtual bool Open(const char * name); - virtual void Unk_07(void); - virtual void Unk_08(void); // called on error - virtual void Unk_09(void); - virtual void Unk_0A(void); - virtual void Unk_0B(void); - -// void ** _vtbl; // 00 - UInt32 refCount; // 04 - UInt8 byteSwapped; // 08 - UInt8 pad09[3]; // 09 -}; - -// 20 -//template -struct VMHashTable -{ - typedef void * Item; - typedef void * Key; - - typedef tHashSet Table; - - UInt32 unk00; // 00 - not init'd - Table data; // 04 -}; - -// 58 -class VMFunction -{ -public: - BSFixedString returnType; // 00 - BSFixedString docString; // 04 - UInt8 unk08; // 08 - UInt8 unk09; // 09 - UInt8 pad0A[2]; // 0A - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - not init'd - UInt32 unk14; // 14 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - UInt32 unk20; // 20 - cleared via fn - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - UInt32 unk30; // 30 - cleared via fn - UInt32 unk34; // 34 - UInt32 unk38; // 38 - UInt32 unk3C; // 3C - UInt32 unk40; // 40 - cleared via fn - UInt32 unk44; // 44 - UInt32 unk48; // 48 - UInt32 unk4C; // 4C - UInt32 unk50; // 50 - cleared via fn - - // +2C -}; - -// 130+ -class VMClass -{ -public: - // 18 - struct DebugInfo - { - // 10 - struct Unk08 - { - // 1C - struct Unk00 - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - void * unk08; // 08 - UInt32 unk0C; // 0C - UInt32 unk10; // 10 - UInt32 unk14; // 14 - UInt32 unk18; // 18 - }; - - Unk00 * unk00; // 00 - UInt32 unk04; // 04 - UInt32 unk08; // 08 - UInt32 unk0C; // 0C - }; - - time_t srcModTime; // 00 - Unk08 unk08; // 08 - }; - - BSFixedString name; // 000 - UInt32 unk004; // 004 - not init'd - time_t buildTime; // 008 - BSFixedString buildUser; // 010 - BSFixedString buildMachine; // 014 - UInt8 debugFlags; // 018 - UInt8 pad019[3]; // 019 - UInt32 unk01C; // 01C - not init'd - DebugInfo debugInfo; // 020 - VMHashTable userFlagTable; // 038 - BSFixedString objectName; // 058 - BSFixedString parentName; // 05C - BSFixedString docString; // 060 - UInt32 userFlags; // 064 - VMHashTable varTable; // 068 - VMHashTable propertyTable; // 088 - VMHashTable stateTable1; // 0A8 - VMHashTable stateTable2; // 0C8 - VMHashTable stateTable3; // 0E8 - UInt32 unk108; // 108 - VMHashTable varTable2; // 10C - BSFixedString autoStateName; // 12C -}; - -//STATIC_ASSERT(sizeof(time_t) == 8); -//STATIC_ASSERT(sizeof(VMClass) == 0x130); -//STATIC_ASSERT(offsetof(VMClass, objectName) == 0x058); -//STATIC_ASSERT(offsetof(VMClass, autoStateName) == 0x12C); - -// 20 -class VMClassLoader -{ -public: - virtual ~VMClassLoader(); - virtual VMClassLoader * Create(void); - virtual void SetDataStore(VMDataStore ** dataStoreHandle); // probably a safe ptr - virtual bool Load(const char * name, VMClass * out); - - bool Load_Hook(const char * name, VMClass * out); - - // 10 - struct StringTable - { - // 100C - struct Page - { - char data[0x1000]; // 0000 - char * begin; // 1000 - char * end; // 1004 - Page * next; // 1008 - }; - - char ** stringData; // 00 - Page * dataPage; // 04 - BSFixedString * fixedStrings; // 08 - populated on lookup - UInt16 numStrings; // 0C - UInt8 pad0E[2]; // 0E - }; - -// void ** _vtbl; // 00 - void * unk04; // 04 - VMDataStore * dataStore; // 08 - StringTable stringTable; // 0C - UInt8 verMajor; // 1C - UInt8 verMinor; // 1D - UInt8 flags; // 1E - UInt8 pad1F; // 1F - - MEMBER_FN_PREFIX(VMClassLoader); - DEFINE_MEMBER_FN(Load_Impl, bool, 0x00000000, const char * name, VMClass * out); -}; - -//STATIC_ASSERT(sizeof(VMClassLoader::StringTable::Page) == 0x100C); -//STATIC_ASSERT(sizeof(VMClassLoader::StringTable) == 0x10); diff --git a/source/fs.dll/skse64/skse64/PapyrusColorForm.cpp b/source/fs.dll/skse64/skse64/PapyrusColorForm.cpp deleted file mode 100644 index 1a7c6e94..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusColorForm.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "PapyrusColorForm.h" - -#include "Colors.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" - -namespace papyrusColorComponent -{ - UInt32 GetAlpha(StaticFunctionTag* base, UInt32 argb) - { - return COLOR_ALPHA(argb); - } - UInt32 GetRed(StaticFunctionTag* base, UInt32 argb) - { - return COLOR_RED(argb); - } - UInt32 GetGreen(StaticFunctionTag* base, UInt32 argb) - { - return COLOR_GREEN(argb); - } - UInt32 GetBlue(StaticFunctionTag* base, UInt32 argb) - { - return COLOR_BLUE(argb); - } - float GetHue(StaticFunctionTag* base, UInt32 argb) - { - ARGBColor rgb(argb); - return rgb.GetHue(); - } - float GetSaturation(StaticFunctionTag* base, UInt32 argb) - { - ARGBColor color(argb); - return color.GetSaturation(); - } - float GetValue(StaticFunctionTag* base, UInt32 argb) - { - ARGBColor color(argb); - return color.GetValue(); - } - UInt32 SetColor(StaticFunctionTag* base, UInt32 red, UInt32 green, UInt32 blue, UInt32 alpha) - { - return MAKE_COLOR(alpha, red, green, blue); - } - UInt32 SetAlpha(StaticFunctionTag* base, UInt32 argb, UInt32 alpha) - { - return (argb & ~0xFF000000) | (alpha << 24); - } - UInt32 SetRed(StaticFunctionTag* base, UInt32 argb, UInt32 red) - { - return (argb & ~0x00FF0000) | (red << 16); - } - UInt32 SetGreen(StaticFunctionTag* base, UInt32 argb, UInt32 green) - { - return (argb & ~0x0000FF00) | (green << 8); - } - UInt32 SetBlue(StaticFunctionTag* base, UInt32 argb, UInt32 blue) - { - return (argb & ~0x000000FF) | blue; - } - UInt32 SetHue(StaticFunctionTag* base, UInt32 argb, float hue) - { - ARGBColor color(argb); - color.SetHue(hue); - return color.GetColor(); - } - UInt32 SetSaturation(StaticFunctionTag* base, UInt32 argb, float sat) - { - ARGBColor color(argb); - color.SetSaturation(sat); - return color.GetColor(); - } - UInt32 SetValue(StaticFunctionTag* base, UInt32 argb, float val) - { - ARGBColor color(argb); - color.SetValue(val); - return color.GetColor(); - } -}; - -namespace papyrusColorForm -{ - UInt32 GetColor(BGSColorForm* colorForm) - { - return (colorForm) ? (MACRO_SWAP32(colorForm->abgr) >> 8) | (colorForm->color.alpha << 24) : 0; - } - - void SetColor(BGSColorForm* colorForm, UInt32 color) - { - if(colorForm) { - colorForm->color.red = COLOR_RED(color); - colorForm->color.green = COLOR_GREEN(color); - colorForm->color.blue = COLOR_BLUE(color); - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusColorComponent::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetAlpha", "ColorComponent", papyrusColorComponent::GetRed, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetRed", "ColorComponent", papyrusColorComponent::GetRed, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetGreen", "ColorComponent", papyrusColorComponent::GetGreen, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetBlue", "ColorComponent", papyrusColorComponent::GetBlue, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetHue", "ColorComponent", papyrusColorComponent::GetHue, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetSaturation", "ColorComponent", papyrusColorComponent::GetSaturation, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetValue", "ColorComponent", papyrusColorComponent::GetValue, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetAlpha", "ColorComponent", papyrusColorComponent::SetAlpha, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetRed", "ColorComponent", papyrusColorComponent::SetRed, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetGreen", "ColorComponent", papyrusColorComponent::SetGreen, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetBlue", "ColorComponent", papyrusColorComponent::SetBlue, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetHue", "ColorComponent", papyrusColorComponent::SetHue, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetSaturation", "ColorComponent", papyrusColorComponent::SetSaturation, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetValue", "ColorComponent", papyrusColorComponent::SetValue, registry)); - - registry->SetFunctionFlags("ColorComponent", "GetAlpha", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetRed", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetGreen", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetBlue", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetHue", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetSaturation", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "GetValue", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetAlpha", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetRed", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetGreen", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetBlue", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetHue", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetSaturation", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorComponent", "SetValue", VMClassRegistry::kFunctionFlag_NoWait); -} - -void papyrusColorForm::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSColorForm::kTypeID, "ColorForm"); - - registry->RegisterFunction( - new NativeFunction0 ("GetColor", "ColorForm", papyrusColorForm::GetColor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetColor", "ColorForm", papyrusColorForm::SetColor, registry)); - - registry->SetFunctionFlags("ColorForm", "GetColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ColorForm", "SetColor", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusColorForm.h b/source/fs.dll/skse64/skse64/PapyrusColorForm.h deleted file mode 100644 index 3631b300..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusColorForm.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -class BGSColorForm; -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusColorComponent -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetAlpha(StaticFunctionTag* base, UInt32 argb); - UInt32 GetRed(StaticFunctionTag* base, UInt32 argb); - UInt32 GetGreen(StaticFunctionTag* base, UInt32 argb); - UInt32 GetBlue(StaticFunctionTag* base, UInt32 argb); - - float GetHue(StaticFunctionTag* base, UInt32 argb); - float GetSaturation(StaticFunctionTag* base, UInt32 argb); - float GetValue(StaticFunctionTag* base, UInt32 argb); - - UInt32 SetColor(StaticFunctionTag* base, UInt32 red, UInt32 green, UInt32 blue, UInt32 alpha); - UInt32 SetAlpha(StaticFunctionTag* base, UInt32 argb, UInt32 alpha); - UInt32 SetRed(StaticFunctionTag* base, UInt32 argb, UInt32 red); - UInt32 SetGreen(StaticFunctionTag* base, UInt32 argb, UInt32 green); - UInt32 SetBlue(StaticFunctionTag* base, UInt32 argb, UInt32 blue); - UInt32 SetHue(StaticFunctionTag* base, UInt32 argb, float hue); - UInt32 SetSaturation(StaticFunctionTag* base, UInt32 argb, float sat); - UInt32 SetValue(StaticFunctionTag* base, UInt32 argb, float val); -} - -namespace papyrusColorForm -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetColor(BGSColorForm* colorForm); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusCombatStyle.cpp b/source/fs.dll/skse64/skse64/PapyrusCombatStyle.cpp deleted file mode 100644 index 2e57905c..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCombatStyle.cpp +++ /dev/null @@ -1,517 +0,0 @@ -#include "PapyrusCombatStyle.h" - -#include "GameForms.h" - -namespace papyrusCombatStyle -{ - - float GetOffensiveMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.offensiveMult : 0.0; - } - - void SetOffensiveMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.offensiveMult = nuVal; - } - } - - float GetDefensiveMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.defensiveMult : 0.0; - } - - void SetDefensiveMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.defensiveMult = nuVal; - } - } - - float GetGroupOffensiveMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.groupOffensiveMult : 0.0; - } - - void SetGroupOffensiveMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.groupOffensiveMult = nuVal; - } - } - - float GetMeleeMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.meleeMult : 0.0; - } - - void SetMeleeMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.meleeMult = nuVal; - } - } - - float GetRangedMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.rangedMult : 0.0; - } - - void SetRangedMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.rangedMult = nuVal; - } - } - - float GetMagicMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.magicMult : 0.0; - } - - void SetMagicMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.magicMult = nuVal; - } - } - - float GetShoutMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.shoutMult : 0.0; - } - - void SetShoutMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.shoutMult = nuVal; - } - } - - float GetStaffMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.staffMult : 0.0; - } - - void SetStaffMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.staffMult = nuVal; - } - } - - float GetUnarmedMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.unarmedMult : 0.0; - } - - void SetUnarmedMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.unarmedMult = nuVal; - } - } - - float GetAvoidThreatChance(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->general.avoidThreatChance : 0.0; - } - - void SetAvoidThreatChance(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->general.avoidThreatChance = nuVal; - } - } - - float GetMeleeAttackStaggeredMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.attackStaggeredMult : 0.0; - } - - void SetMeleeAttackStaggeredMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.attackStaggeredMult = nuVal; - } - } - - float GetMeleePowerAttackStaggeredMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.powerAttackStaggeredMult : 0.0; - } - - void SetMeleePowerAttackStaggeredMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.powerAttackStaggeredMult = nuVal; - } - } - - float GetMeleePowerAttackBlockingMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.powerAttackBlockingMult : 0.0; - } - - void SetMeleePowerAttackBlockingMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.powerAttackBlockingMult = nuVal; - } - } - - float GetMeleeBashMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.bashMult : 0.0; - } - - void SetMeleeBashMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.bashMult = nuVal; - } - } - - float GetMeleeBashRecoiledMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.bashRecoiledMult : 0.0; - } - - void SetMeleeBashRecoiledMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.bashRecoiledMult = nuVal; - } - } - - float GetMeleeBashAttackMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.bashAttackMult : 0.0; - } - - void SetMeleeBashAttackMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.bashAttackMult = nuVal; - } - } - - float GetMeleeBashPowerAttackMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.bashPowerAttackMult : 0.0; - } - - void SetMeleeBashPowerAttackMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.bashPowerAttackMult = nuVal; - } - } - - float GetMeleeSpecialAttackMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->melee.specialAttackMult : 0.0; - } - - void SetMeleeSpecialAttackMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->melee.specialAttackMult = nuVal; - } - } - - float GetCloseRangeDuelingCircleMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->closeRange.duelingCircleMult : 0.0; - } - - void SetCloseRangeDuelingCircleMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->closeRange.duelingCircleMult = nuVal; - } - } - - float GetCloseRangeDuelingFallbackMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->closeRange.duelingFallbackMult : 0.0; - } - - void SetCloseRangeDuelingFallbackMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->closeRange.duelingFallbackMult = nuVal; - } - } - - float GetCloseRangeFlankingFlankDistance(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->closeRange.flankingFlankDistance : 0.0; - } - - void SetCloseRangeFlankingFlankDistance(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->closeRange.flankingFlankDistance = nuVal; - } - } - - float GetCloseRangeFlankingStalkTime(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->closeRange.flankingStalkTime : 0.0; - } - - void SetCloseRangeFlankingStalkTime(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->closeRange.flankingStalkTime = nuVal; - } - } - - float GetLongRangeStrafeMult(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->longRange.strafeMult : 0.0; - } - - void SetLongRangeStrafeMult(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->longRange.strafeMult = nuVal; - } - } - - - float GetFlightHoverChance(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->flight.hoverChance : 0.0; - } - - void SetFlightHoverChance(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->flight.hoverChance = nuVal; - } - } - - float GetFlightDiveBombChance(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->flight.diveBombChance : 0.0; - } - - void SetFlightDiveBombChance(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->flight.diveBombChance = nuVal; - } - } - - // undecoded - float GetFlightFlyingAttackChance(TESCombatStyle* thisCombatStyle) - { - return (thisCombatStyle) ? thisCombatStyle->flight.flyingAttackChance : 0.0; - } - - void SetFlightFlyingAttackChance(TESCombatStyle* thisCombatStyle, float nuVal) - { - if (thisCombatStyle) { - thisCombatStyle->flight.flyingAttackChance = nuVal; - } - } - - bool GetAllowDualWielding(TESCombatStyle* thisCombatStyle) - { - if (!thisCombatStyle) - return false; - return (thisCombatStyle->flags & TESCombatStyle::kFlag_AllowDualWielding) == TESCombatStyle::kFlag_AllowDualWielding ? true : false; - } - - void SetAllowDualWielding(TESCombatStyle* thisCombatStyle, bool bAllow) - { - if (thisCombatStyle) { - if(bAllow) - thisCombatStyle->flags |= TESCombatStyle::kFlag_AllowDualWielding; - else - thisCombatStyle->flags &= ~TESCombatStyle::kFlag_AllowDualWielding; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusCombatStyle::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(TESCombatStyle::kTypeID, "CombatStyle"); - - // get general tab - registry->RegisterFunction( - new NativeFunction0 ("GetOffensiveMult", "CombatStyle", papyrusCombatStyle::GetOffensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetDefensiveMult", "CombatStyle", papyrusCombatStyle::GetDefensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetGroupOffensiveMult", "CombatStyle", papyrusCombatStyle::GetGroupOffensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetAvoidThreatChance", "CombatStyle", papyrusCombatStyle::GetAvoidThreatChance, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeMult", "CombatStyle", papyrusCombatStyle::GetMeleeMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetRangedMult", "CombatStyle", papyrusCombatStyle::GetRangedMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMagicMult", "CombatStyle", papyrusCombatStyle::GetMagicMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetShoutMult", "CombatStyle", papyrusCombatStyle::GetShoutMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetStaffMult", "CombatStyle", papyrusCombatStyle::GetStaffMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetUnarmedMult", "CombatStyle", papyrusCombatStyle::GetUnarmedMult, registry)); - - // set general tab values - registry->RegisterFunction( - new NativeFunction1 ("SetOffensiveMult", "CombatStyle", papyrusCombatStyle::SetOffensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetDefensiveMult", "CombatStyle", papyrusCombatStyle::SetDefensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetGroupOffensiveMult", "CombatStyle", papyrusCombatStyle::SetGroupOffensiveMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetAvoidThreatChance", "CombatStyle", papyrusCombatStyle::SetAvoidThreatChance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeMult", "CombatStyle", papyrusCombatStyle::SetMeleeMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetRangedMult", "CombatStyle", papyrusCombatStyle::SetRangedMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMagicMult", "CombatStyle", papyrusCombatStyle::SetMagicMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetShoutMult", "CombatStyle", papyrusCombatStyle::SetShoutMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetStaffMult", "CombatStyle", papyrusCombatStyle::SetStaffMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetUnarmedMult", "CombatStyle", papyrusCombatStyle::SetUnarmedMult, registry)); - - // get melee tab values - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeAttackStaggeredMult", "CombatStyle", papyrusCombatStyle::GetMeleeAttackStaggeredMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleePowerAttackStaggeredMult", "CombatStyle", papyrusCombatStyle::GetMeleePowerAttackStaggeredMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleePowerAttackBlockingMult", "CombatStyle", papyrusCombatStyle::GetMeleePowerAttackBlockingMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeBashMult", "CombatStyle", papyrusCombatStyle::GetMeleeBashMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeBashRecoiledMult", "CombatStyle", papyrusCombatStyle::GetMeleeBashRecoiledMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeBashAttackMult", "CombatStyle", papyrusCombatStyle::GetMeleeBashAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeBashPowerAttackMult", "CombatStyle", papyrusCombatStyle::GetMeleeBashPowerAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMeleeSpecialAttackMult", "CombatStyle", papyrusCombatStyle::GetMeleeSpecialAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetAllowDualWielding", "CombatStyle", papyrusCombatStyle::GetAllowDualWielding, registry)); - - // set melee tab values - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeAttackStaggeredMult", "CombatStyle", papyrusCombatStyle::SetMeleeAttackStaggeredMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleePowerAttackStaggeredMult", "CombatStyle", papyrusCombatStyle::SetMeleePowerAttackStaggeredMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleePowerAttackBlockingMult", "CombatStyle", papyrusCombatStyle::SetMeleePowerAttackBlockingMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeBashMult", "CombatStyle", papyrusCombatStyle::SetMeleeBashMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeBashRecoiledMult", "CombatStyle", papyrusCombatStyle::SetMeleeBashRecoiledMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeBashAttackMult", "CombatStyle", papyrusCombatStyle::SetMeleeBashAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeBashPowerAttackMult", "CombatStyle", papyrusCombatStyle::SetMeleeBashPowerAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMeleeSpecialAttackMult", "CombatStyle", papyrusCombatStyle::SetMeleeSpecialAttackMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetAllowDualWielding", "CombatStyle", papyrusCombatStyle::SetAllowDualWielding, registry)); - - // get Close Range tab values - registry->RegisterFunction( - new NativeFunction0 ("GetCloseRangeDuelingCircleMult", "CombatStyle", papyrusCombatStyle::GetCloseRangeDuelingCircleMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCloseRangeDuelingFallbackMult", "CombatStyle", papyrusCombatStyle::GetCloseRangeDuelingFallbackMult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCloseRangeFlankingFlankDistance", "CombatStyle", papyrusCombatStyle::GetCloseRangeFlankingFlankDistance, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCloseRangeFlankingStalkTime", "CombatStyle", papyrusCombatStyle::GetCloseRangeFlankingStalkTime, registry)); - - // set Close Range tab values - registry->RegisterFunction( - new NativeFunction1 ("SetCloseRangeDuelingCircleMult", "CombatStyle", papyrusCombatStyle::SetCloseRangeDuelingCircleMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCloseRangeDuelingFallbackMult", "CombatStyle", papyrusCombatStyle::SetCloseRangeDuelingFallbackMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCloseRangeFlankingFlankDistance", "CombatStyle", papyrusCombatStyle::SetCloseRangeFlankingFlankDistance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCloseRangeFlankingStalkTime", "CombatStyle", papyrusCombatStyle::SetCloseRangeFlankingStalkTime, registry)); - - // get/set long range tab values - registry->RegisterFunction( - new NativeFunction0 ("GetLongRangeStrafeMult", "CombatStyle", papyrusCombatStyle::GetLongRangeStrafeMult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetLongRangeStrafeMult", "CombatStyle", papyrusCombatStyle::SetLongRangeStrafeMult, registry)); - - // get flight tab values - registry->RegisterFunction( - new NativeFunction0 ("GetFlightHoverChance", "CombatStyle", papyrusCombatStyle::GetFlightHoverChance, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetFlightDiveBombChance", "CombatStyle", papyrusCombatStyle::GetFlightDiveBombChance, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetFlightFlyingAttackChance", "CombatStyle", papyrusCombatStyle::GetFlightFlyingAttackChance, registry)); - - // set flight tab values - registry->RegisterFunction( - new NativeFunction1 ("SetFlightHoverChance", "CombatStyle", papyrusCombatStyle::SetFlightHoverChance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFlightDiveBombChance", "CombatStyle", papyrusCombatStyle::SetFlightDiveBombChance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFlightFlyingAttackChance", "CombatStyle", papyrusCombatStyle::SetFlightFlyingAttackChance, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusCombatStyle.h b/source/fs.dll/skse64/skse64/PapyrusCombatStyle.h deleted file mode 100644 index c974c83e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusCombatStyle.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -class TESCombatStyle; -class VMClassRegistry; - -namespace papyrusCombatStyle -{ - void RegisterFuncs(VMClassRegistry* registry); - - float GetOffensiveMult(TESCombatStyle* thisCombatStyle); - void SetOffensiveMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetDefensiveMult(TESCombatStyle* thisCombatStyle); - void SetDefensiveMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetGroupOffensiveMult(TESCombatStyle* thisCombatStyle); - void SetGroupOffensiveMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeMult(TESCombatStyle* thisCombatStyle); - void SetMeleeMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetRangedMult(TESCombatStyle* thisCombatStyle); - void SetRangedMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMagicMult(TESCombatStyle* thisCombatStyle); - void SetMagicMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetShoutMult(TESCombatStyle* thisCombatStyle); - void SetShoutMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetStaffMult(TESCombatStyle* thisCombatStyle); - void SetStaffMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetUnarmedMult(TESCombatStyle* thisCombatStyle); - void SetUnarmedMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetAvoidThreatChance(TESCombatStyle* thisCombatStyle); - void SetAvoidThreatChance(TESCombatStyle* thisCombatStyle, float nuVal); - - float GetMeleeAttackStaggeredMult(TESCombatStyle* thisCombatStyle); - void SetMeleeAttackStaggeredMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleePowerAttackStaggeredMult(TESCombatStyle* thisCombatStyle); - void SetMeleePowerAttackStaggeredMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleePowerAttackBlockingMult(TESCombatStyle* thisCombatStyle); - void SetMeleePowerAttackBlockingMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeBashMult(TESCombatStyle* thisCombatStyle); - void SetMeleeBashMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeBashRecoiledMult(TESCombatStyle* thisCombatStyle); - void SetMeleeBashRecoiledMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeBashAttackMult(TESCombatStyle* thisCombatStyle); - void SetMeleeBashAttackMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeBashPowerAttackMult(TESCombatStyle* thisCombatStyle); - void SetMeleeBashPowerAttackMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetMeleeSpecialAttackMult(TESCombatStyle* thisCombatStyle); - void SetMeleeSpecialAttackMult(TESCombatStyle* thisCombatStyle, float nuVal); - - float GetCloseRangeDuelingCircleMult(TESCombatStyle* thisCombatStyle); - void SetCloseRangeDuelingCircleMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetCloseRangeDuelingFallbackMult(TESCombatStyle* thisCombatStyle); - void SetCloseRangeDuelingFallbackMult(TESCombatStyle* thisCombatStyle, float nuVal); - float GetCloseRangeFlankingFlankDistance(TESCombatStyle* thisCombatStyle); - void SetCloseRangeFlankingFlankDistance(TESCombatStyle* thisCombatStyle, float nuVal); - float GetCloseRangeFlankingStalkTime(TESCombatStyle* thisCombatStyle); - void SetCloseRangeFlankingStalkTime(TESCombatStyle* thisCombatStyle, float nuVal); - - float GetLongRangeStrafeMult(TESCombatStyle* thisCombatStyle); - void SetLongRangeStrafeMult(TESCombatStyle* thisCombatStyle, float nuVal); - - float GetFlightHoverChance(TESCombatStyle* thisCombatStyle); - void SetFlightHoverChance(TESCombatStyle* thisCombatStyle, float nuVal); - float GetFlightDiveBombChance(TESCombatStyle* thisCombatStyle); - void SetFlightDiveBombChance(TESCombatStyle* thisCombatStyle, float nuVal); - // undecoded - float GetFlightFlyingAttackChance(TESCombatStyle* thisCombatStyle); - void SetFlightFlyingAttackChance(TESCombatStyle* thisCombatStyle, float nuVal); - bool GetAllowDuelWielding(TESCombatStyle* thisCombatStyle); - void SetAllowDuelWielding(TESCombatStyle* thisCombatStyle, float nuVal); - -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.cpp b/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.cpp deleted file mode 100644 index 7fa8e925..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "PapyrusConstructibleObject.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" - -namespace papyrusConstructibleObject -{ - TESForm* GetResult(BGSConstructibleObject* recipe) - { - if(!recipe || !recipe->createdObject) - return NULL; - - return recipe->createdObject; - } - - void SetResult(BGSConstructibleObject* recipe, TESForm* form) - { - if(recipe && form) { - TESBoundObject* result = DYNAMIC_CAST(form, TESForm, TESBoundObject); // Only Base Objects allowed - if(result) { - recipe->createdObject = result; - } - } - } - - UInt32 GetResultQuantity(BGSConstructibleObject* recipe) - { - if(!recipe || !recipe->createdObject) - return 0; - - return (UInt32)recipe->quantity; - } - - void SetResultQuantity(BGSConstructibleObject* recipe, UInt32 quantity) - { - if(recipe && quantity < USHRT_MAX) { - recipe->quantity = quantity; - } - } - - UInt32 GetNumIngredients(BGSConstructibleObject* recipe) - { - if(!recipe) - return 0; - - return recipe->container.numEntries; - } - - TESForm* GetNthIngredient(BGSConstructibleObject* recipe, UInt32 n) - { - if(!recipe || n > recipe->container.numEntries) - return NULL; - - return recipe->container.entries[n]->form; - } - - void SetNthIngredient(BGSConstructibleObject* recipe, TESForm* form, UInt32 n) - { - if(recipe && form && n <= recipe->container.numEntries) { - TESBoundObject* result = DYNAMIC_CAST(form, TESForm, TESBoundObject); // Only Base Objects allowed - if(result) { - recipe->container.entries[n]->form = result; - } - } - } - - UInt32 GetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 n) - { - if(!recipe || n > recipe->container.numEntries) - return 0; - - return recipe->container.entries[n]->count; - } - - void SetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 value, UInt32 n) - { - if(recipe && n <= recipe->container.numEntries) { - recipe->container.entries[n]->count = value; - } - } - - BGSKeyword* GetWorkbenchKeyword(BGSConstructibleObject* recipe) - { - if(!recipe) - return NULL; - - return recipe->wbKeyword; - } - - void SetWorkbenchKeyword(BGSConstructibleObject* recipe, BGSKeyword* keyword) - { - if(recipe && keyword) { - recipe->wbKeyword = keyword; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusConstructibleObject::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetResult", "ConstructibleObject", papyrusConstructibleObject::GetResult, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetResult", "ConstructibleObject", papyrusConstructibleObject::SetResult, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetResultQuantity", "ConstructibleObject", papyrusConstructibleObject::GetResultQuantity, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetResultQuantity", "ConstructibleObject", papyrusConstructibleObject::SetResultQuantity, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumIngredients", "ConstructibleObject", papyrusConstructibleObject::GetNumIngredients, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthIngredient", "ConstructibleObject", papyrusConstructibleObject::GetNthIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetNthIngredient", "ConstructibleObject", papyrusConstructibleObject::SetNthIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthIngredientQuantity", "ConstructibleObject", papyrusConstructibleObject::GetNthIngredientQuantity, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetNthIngredientQuantity", "ConstructibleObject", papyrusConstructibleObject::SetNthIngredientQuantity, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWorkbenchKeyword", "ConstructibleObject", papyrusConstructibleObject::GetWorkbenchKeyword, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWorkbenchKeyword", "ConstructibleObject", papyrusConstructibleObject::SetWorkbenchKeyword, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.h b/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.h deleted file mode 100644 index f49a5853..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusConstructibleObject.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -class TESForm; -class BGSConstructibleObject; -class BGSKeyword; -class VMClassRegistry; - -namespace papyrusConstructibleObject -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESForm* GetResult(BGSConstructibleObject* recipe); - void SetResult(BGSConstructibleObject* recipe, TESForm* result); - UInt32 GetResultQuantity(BGSConstructibleObject* recipe); - void SetResultQuantity(BGSConstructibleObject* recipe, UInt32 quantity); - UInt32 GetNumIngredients(BGSConstructibleObject* recipe); - TESForm* GetNthIngredient(BGSConstructibleObject* recipe, UInt32 n); - void SetNthIngredient(BGSConstructibleObject* recipe, TESForm* form, UInt32 n); - UInt32 GetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 n); - void SetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 value, UInt32 n); - BGSKeyword* GetWorkbenchKeyword(BGSConstructibleObject* recipe); - void SetWorkbenchKeyword(BGSConstructibleObject* recipe, BGSKeyword* keyword); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.cpp b/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.cpp deleted file mode 100644 index 7f1ccbd0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "skse64/PapyrusDefaultObjectManager.h" -#include "skse64/GameObjects.h" -#include "skse64/GameData.h" - -namespace papyrusDefaultObjectManager -{ - void SetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch, TESForm * form) - { - if(objectManager) { - UInt32 size = strlen(keySearch.data); - if(size == 4) { - UInt32 key = toupper(keySearch.data[3]) << 24 | toupper(keySearch.data[2]) << 16 | toupper(keySearch.data[1]) << 8 | toupper(keySearch.data[0]); - - DefaultObjectList * defaultList = DefaultObjectList::GetSingleton(); - if(defaultList) - { - for(UInt32 i = 0; i < DefaultObjectList::kNumDefaultObjects; i++) - { - if(key == defaultList->objects[i].key) { - objectManager->objects[i] = form; - } - } - } - } - } - } - - TESForm * GetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch) - { - if(!objectManager) - return NULL; - - UInt32 size = strlen(keySearch.data); - if(size != 4) { - return NULL; - } - - UInt32 key = toupper(keySearch.data[3]) << 24 | toupper(keySearch.data[2]) << 16 | toupper(keySearch.data[1]) << 8 | toupper(keySearch.data[0]); - - DefaultObjectList * defaultList = DefaultObjectList::GetSingleton(); - if(defaultList) - { - for(UInt32 i = 0; i < DefaultObjectList::kNumDefaultObjects; i++) - { - if(key == defaultList->objects[i].key) { - return objectManager->objects[i]; - } - } - } - - return NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusDefaultObjectManager::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSDefaultObjectManager::kTypeID, "DefaultObjectManager"); - - registry->RegisterFunction( - new NativeFunction1("GetForm", "DefaultObjectManager", papyrusDefaultObjectManager::GetForm, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetForm", "DefaultObjectManager", papyrusDefaultObjectManager::SetForm, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.h b/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.h deleted file mode 100644 index 88a1ae0b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusDefaultObjectManager.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESForm; -class BGSDefaultObjectManager; - -#include "skse64/GameTypes.h" - -namespace papyrusDefaultObjectManager -{ - void RegisterFuncs(VMClassRegistry* registry); - - void SetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch, TESForm * form); - TESForm * GetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.cpp b/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.cpp deleted file mode 100644 index 8a1083b0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.cpp +++ /dev/null @@ -1,547 +0,0 @@ -#include "PapyrusDelayFunctors.h" - -#include - -#include "GameAPI.h" -#include "PapyrusVM.h" -#include "Serialization.h" - -/// -/// LatentSKSEDelayFunctor -/// - -LatentSKSEDelayFunctor::LatentSKSEDelayFunctor(UInt32 stackId) : - stackId_( stackId ) -{} - -LatentSKSEDelayFunctor::LatentSKSEDelayFunctor(SerializationTag) : - stackId_( 0 ) -{} - -bool LatentSKSEDelayFunctor::ShouldReschedule(SInt32& delayMSOut) -{ - return false; -} - -bool LatentSKSEDelayFunctor::ShouldResumeStack(UInt32& stackIdOut) -{ - stackIdOut = stackId_; - return true; -} - -bool LatentSKSEDelayFunctor::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - WriteData(intfc, &stackId_); - - //_MESSAGE("Serialized STACKID %d", stackId_); - - return true; -} - -bool LatentSKSEDelayFunctor::Load(SKSESerializationInterface* intfc, UInt32 version) -{ - using namespace Serialization; - - if (! ReadData(intfc, &stackId_)) - return false; - - //_MESSAGE("De-serialized STACKID %d", stackId_); - - return true; -} - -void* LatentSKSEDelayFunctor::operator new(std::size_t size) -{ - return Heap_Allocate(size); -} - -void* LatentSKSEDelayFunctor::operator new(std::size_t size, const std::nothrow_t&) -{ - return Heap_Allocate(size); -} - -// placement new -void* LatentSKSEDelayFunctor::operator new(std::size_t size, void* ptr) -{ - return ptr; -} - -void LatentSKSEDelayFunctor::operator delete(void* ptr) -{ - Heap_Free(ptr); -} - -void LatentSKSEDelayFunctor::operator delete(void* ptr, const std::nothrow_t&) -{ - Heap_Free(ptr); -} - -void LatentSKSEDelayFunctor::operator delete(void*, void*) -{ - // placement delete -} - -/// -/// SKSEDelayFunctorQueue -/// - -SKSEDelayFunctorQueue::~SKSEDelayFunctorQueue() -{ - ClearAndRelease(); -} - -void SKSEDelayFunctorQueue::Push(ISKSEDelayFunctor* func) -{// lock_ - IScopedCriticalSection scopedLock( &lock_ ); - - data_.push_back(func); -}// ~lock_ - -ISKSEDelayFunctor* SKSEDelayFunctorQueue::Pop() -{ - ISKSEDelayFunctor* result = NULL; - - {// lock_ - IScopedCriticalSection scopedLock( &lock_ ); - - if (! data_.empty()) - { - result = data_.front(); - data_.pop_front(); - } - }// ~lock_ - - return result; -} - -void SKSEDelayFunctorQueue::ClearAndRelease() -{ - for (DataT::iterator it = data_.begin(); it != data_.end(); ++it) - delete *it; - - data_.clear(); -} - -bool SKSEDelayFunctorQueue::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - // Save data - UInt32 dataSize = data_.size(); - if (! WriteData(intfc,&dataSize)) - return false; - - for (UInt32 i=0; i(obj); - if (functor == NULL) - { - // Throw the loaded object away. - delete obj; - continue; - } - - data_.push_back(functor); - } - - return true; -} - -/// -/// SKSEDelayFunctorWaitList -/// - -SKSEDelayFunctorWaitList::SKSEDelayFunctorWaitList() : - lastTickTime_( GetPerfCounter() ) -{ - LARGE_INTEGER freq; - QueryPerformanceFrequency(&freq); - freq.QuadPart /= 1000; - - msToCountMult_ = freq.QuadPart; -} - -SKSEDelayFunctorWaitList::~SKSEDelayFunctorWaitList() -{ - ClearAndRelease(); -} - -void SKSEDelayFunctorWaitList::Add(SInt32 delayMS, ISKSEDelayFunctor* func) -{// inLock_ - IScopedCriticalSection scopedLock( &inLock_ ); - - WaitEntryT t( msToCountMult_ * delayMS, func ); - inData_.push_back(t); -}// ~inLock_ - -void SKSEDelayFunctorWaitList::Update() -{ - // Move items from thread-safe input buffer to non-thread safe main queue - - {// inLock_ - IScopedCriticalSection scopedLock( &inLock_ ); - - waitData_.insert(waitData_.end(), inData_.begin(), inData_.end()); - inData_.clear(); - }// ~inLock - - SInt64 curTime = GetPerfCounter(); - SInt64 dt = curTime - lastTickTime_; - - lastTickTime_ = curTime; - - if (dt <= 0) - return; - - // Decrement wait times by time delta - for (WaitDataT::iterator it = waitData_.begin(); it != waitData_.end(); ++it) - if (it->first > 0) - it->first -= dt; - - struct IsStillWaiting_ - { - bool operator()(const WaitEntryT& e) { return e.first > 0; } - }; - IsStillWaiting_ pred; - - // Swap all ready entries to end of the vector#1, add them to vector#2, and truncate #1 - WaitDataT::iterator r = std::partition(waitData_.begin(), waitData_.end(), pred); - - for (WaitDataT::iterator it = r; it != waitData_.end(); ++it) - readyData_.push_back(it->second ); - - waitData_.resize(std::distance(waitData_.begin(), r)); -} - -ISKSEDelayFunctor* SKSEDelayFunctorWaitList::PopReady() -{ - ISKSEDelayFunctor* result = NULL; - - if (! readyData_.empty()) - { - result = readyData_.back(); - readyData_.pop_back(); - } - - return result; -} - -void SKSEDelayFunctorWaitList::ClearAndRelease() -{ - for (WaitDataT::iterator it = inData_.begin(); it != inData_.end(); ++it) - delete it->second; - - inData_.clear(); - - for (WaitDataT::iterator it = waitData_.begin(); it != waitData_.end(); ++it) - delete it->second; - - waitData_.clear(); - - for (ReadyDataT::iterator it = readyData_.begin(); it != readyData_.end(); ++it) - delete *it; - - readyData_.clear(); - - // Avoid interval spanning two sessions - lastTickTime_= GetPerfCounter(); -} - -bool SKSEDelayFunctorWaitList::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - // inData_ - UInt32 inDataSize = inData_.size(); - if (! WriteData(intfc,&inDataSize)) - return false; - - for (UInt32 i=0; i(obj); - if (functor == NULL) - { - // Throw the loaded object away. - delete obj; - continue; - } - - SInt64 delay; - if (! ReadData(intfc, &delay)) - return false; - - WaitEntryT t( delay, functor ); - inData_.push_back(t); - } - - // waitData_ - UInt32 waitDataSize; - if (! ReadData(intfc,&waitDataSize)) - return false; - - waitData_.reserve(waitDataSize); - - for (UInt32 i=0; i(obj); - if (functor == NULL) - { - // Throw the loaded object away. - delete obj; - continue; - } - - SInt64 delay; - if (! ReadData(intfc, &delay)) - return false; - - WaitEntryT t( delay, functor ); - waitData_.push_back(t); - } - - // readyData_ - UInt32 readyDataSize; - if (! ReadData(intfc,&readyDataSize)) - return false; - - readyData_.reserve(readyDataSize); - - for (UInt32 i=0; i(obj); - if (functor == NULL) - { - // Throw the loaded object away. - delete obj; - continue; - } - - readyData_.push_back(functor); - } - - return true; -} - -/// -/// SKSEDelayFunctorManager -/// - -SKSEDelayFunctorManager::SKSEDelayFunctorManager() -{ - LARGE_INTEGER t; - QueryPerformanceFrequency(&t); - budgetFreqScale_ = double(t.QuadPart) * 0.001; -} - -void SKSEDelayFunctorManager::Enqueue(ISKSEDelayFunctor* func, SInt32 delayMS) -{ - if (delayMS < 0) - queue_.Push(func); - else - waitList_.Add(delayMS, func); -} - -void SKSEDelayFunctorManager::OnPreTick() -{ - waitList_.Update(); - - ISKSEDelayFunctor* func; - while ((func = waitList_.PopReady()) != NULL) - queue_.Push(func); -} - -void SKSEDelayFunctorManager::OnTick(SInt64 startTime, float budget) -{ - SInt64 budgetTime = budget * budgetFreqScale_; - - do - { - ISKSEDelayFunctor* functor = queue_.Pop(); - if (functor == NULL) - break; - - VMValue result; - functor->Run(result); - - SInt32 delayMS; - if (functor->ShouldReschedule(delayMS)) - { - if (delayMS > 0) - waitList_.Add(delayMS, functor); - else - queue_.Push(functor); - continue; - } - - UInt32 stackId; - if (functor->ShouldResumeStack(stackId)) - { - (*g_skyrimVM)->GetClassRegistry()->ResumeStack(stackId, &result); - } - - delete functor; - } - while (GetPerfCounter() - startTime <= budgetTime); -} - -void SKSEDelayFunctorManager::OnRevert() -{ - queue_.ClearAndRelease(); - waitList_.ClearAndRelease(); -} - -bool SKSEDelayFunctorManager::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - if (! SaveClassHelper(intfc, 'FUNQ', queue_)) - return false; - - if (! SaveClassHelper(intfc, 'WLST', waitList_)) - return false; - - intfc->OpenRecord('____', 1); - - return true; -} - -bool SKSEDelayFunctorManager::Load(SKSESerializationInterface* intfc, UInt32 loadedVersion) -{ - using namespace Serialization; - - UInt32 type, length, version; - - while (intfc->GetNextRecordInfo(&type, &version, &length)) - { - switch (type) - { - case 'FUNQ': - if (! queue_.Load(intfc, version)) - return false; - break; - - case 'WLST': - if (! waitList_.Load(intfc, version)) - return false; - break; - - // Done - case '____': - return true; - - default: - _MESSAGE("Error loading unexpected chunk type %08X (%.4s)", type, &type); - break; - } - } - - _MESSAGE("Missing record data for SKSEDelayFunctorManager"); - return false; -} - -/// -/// Global instances -/// - -SKSEDelayFunctorManager& SKSEDelayFunctorManagerInstance() -{ - static SKSEDelayFunctorManager instance; - return instance; -} diff --git a/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.h b/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.h deleted file mode 100644 index bc8b2efd..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusDelayFunctors.h +++ /dev/null @@ -1,168 +0,0 @@ -#pragma once - -#include "common/ICriticalSection.h" - -#include "PapyrusObjects.h" - -#include -#include -#include -#include - - -class VMValue; -struct SKSESerializationInterface; - -/// -/// ISKSEDelayFunctor -/// -class ISKSEDelayFunctor : public ISKSEObject -{ -public: - virtual ~ISKSEDelayFunctor() {} - - virtual void Run(VMValue& resultOut) = 0; - - virtual bool ShouldReschedule(SInt32& delayMSOut) = 0; - virtual bool ShouldResumeStack(UInt32& stackIdOut) = 0; -}; - -/// -/// LatentSKSEDelayFunctor -/// -class LatentSKSEDelayFunctor : public ISKSEDelayFunctor -{ -public: - explicit LatentSKSEDelayFunctor(UInt32 stackId); - - explicit LatentSKSEDelayFunctor(SerializationTag); - - virtual ~LatentSKSEDelayFunctor() {} - - virtual const char* ClassName() const = 0; - virtual UInt32 ClassVersion() const = 0; - - virtual void Run(VMValue& resultOut) = 0; - - virtual bool ShouldReschedule(SInt32& delayMSOut); - virtual bool ShouldResumeStack(UInt32& stackIdOut); - - virtual bool Save(SKSESerializationInterface* intfc); - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version); - - UInt32 StackId() const { return stackId_; } - - // Redirect to formheap - // Note: this is not required, but why not - static void* operator new(std::size_t size); - static void* operator new(std::size_t size, const std::nothrow_t&); - static void* operator new(std::size_t size, void* ptr); - - static void operator delete(void* ptr); - static void operator delete(void* ptr, const std::nothrow_t&); - static void operator delete(void*, void*); - -protected: - UInt32 stackId_; -}; - -/// -/// SKSEDelayFunctorQueue -/// - -class SKSEDelayFunctorQueue -{ - typedef std::deque DataT; - -public: - ~SKSEDelayFunctorQueue(); - - void Push(ISKSEDelayFunctor* func); - ISKSEDelayFunctor* Pop(); - - void ClearAndRelease(); - - enum { kSaveVersion = 1 }; - - bool Save(SKSESerializationInterface* intfc); - bool Load(SKSESerializationInterface* intfc, UInt32 version); - -private: - ICriticalSection lock_; - DataT data_; -}; - -/// -/// SKSEDelayFunctorWaitList -/// - -class SKSEDelayFunctorWaitList -{ -private: - typedef std::pair WaitEntryT; - typedef std::vector WaitDataT; - typedef std::vector ReadyDataT; - -public: - SKSEDelayFunctorWaitList(); - - ~SKSEDelayFunctorWaitList(); - - void Add(SInt32 delayMS, ISKSEDelayFunctor* func); - - // 1. Update - // 2. PopReady until NULL - - void Update(); - ISKSEDelayFunctor* PopReady(); - - void ClearAndRelease(); - - enum { kSaveVersion = 1 }; - - bool Save(SKSESerializationInterface* intfc); - bool Load(SKSESerializationInterface* intfc, UInt32 version); - -private: - SInt64 lastTickTime_; - SInt64 msToCountMult_; - - ICriticalSection inLock_; - WaitDataT inData_; - WaitDataT waitData_; - ReadyDataT readyData_; -}; - -/// -/// SKSEDelayFunctorManager -/// - -class SKSEDelayFunctorManager -{ -public: - SKSEDelayFunctorManager(); - - // Takes ownership of passed pointer. - virtual void Enqueue(ISKSEDelayFunctor* func, SInt32 delayMS = 0); - - void OnPreTick(); - void OnTick(SInt64 startTime, float budget); - void OnRevert(); - - enum { kSaveVersion = 1 }; - - bool Save(SKSESerializationInterface* intfc); - bool Load(SKSESerializationInterface* intfc, UInt32 version); - -private: - float budgetFreqScale_; - - SKSEDelayFunctorQueue queue_; - SKSEDelayFunctorWaitList waitList_; -}; - -/// -/// Global instances -/// - -SKSEDelayFunctorManager& SKSEDelayFunctorManagerInstance(); diff --git a/source/fs.dll/skse64/skse64/PapyrusEnchantment.cpp b/source/fs.dll/skse64/skse64/PapyrusEnchantment.cpp deleted file mode 100644 index 5bddd89d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEnchantment.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "PapyrusEnchantment.h" -#include "PapyrusSpell.h" -#include "GameObjects.h" - -namespace papyrusEnchantment -{ - - UInt32 GetNumEffects(EnchantmentItem* thisMagic) - { return magicItemUtils::GetNumEffects(thisMagic); } - - float GetNthEffectMagnitude(EnchantmentItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagnitude(thisMagic, index); } - - UInt32 GetNthEffectArea(EnchantmentItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectArea(thisMagic, index); } - - UInt32 GetNthEffectDuration(EnchantmentItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectDuration(thisMagic, index); } - - EffectSetting* GetNthEffectMagicEffect(EnchantmentItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagicEffect(thisMagic, index); } - - UInt32 GetCostliestEffectIndex(EnchantmentItem* thisMagic) - { return magicItemUtils::GetCostliestEffectIndex(thisMagic); } - - void SetNthEffectMagnitude(EnchantmentItem* thisMagic, UInt32 index, float value) - { magicItemUtils::SetNthEffectMagnitude(thisMagic, index, value); } - - void SetNthEffectArea(EnchantmentItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectArea(thisMagic, index, value); } - - void SetNthEffectDuration(EnchantmentItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectDuration(thisMagic, index, value); } - - EnchantmentItem * GetBaseEnchantment(EnchantmentItem* thisMagic) - { - return thisMagic ? thisMagic->data.baseEnchantment : NULL; - } - - BGSListForm * GetKeywordRestrictions(EnchantmentItem* thisMagic) - { - return thisMagic ? thisMagic->data.restrictions : NULL; - } - - void SetKeywordRestrictions(EnchantmentItem* thisMagic, BGSListForm * list) - { - if(thisMagic) { - thisMagic->data.restrictions = list; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusEnchantment::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNumEffects", "Enchantment", papyrusEnchantment::GetNumEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagnitude", "Enchantment", papyrusEnchantment::GetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectArea", "Enchantment", papyrusEnchantment::GetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectDuration", "Enchantment", papyrusEnchantment::GetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagicEffect", "Enchantment", papyrusEnchantment::GetNthEffectMagicEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCostliestEffectIndex", "Enchantment", papyrusEnchantment::GetCostliestEffectIndex, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetBaseEnchantment", "Enchantment", papyrusEnchantment::GetBaseEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetKeywordRestrictions", "Enchantment", papyrusEnchantment::GetKeywordRestrictions, registry)); - - // Sets - registry->RegisterFunction( - new NativeFunction2("SetNthEffectMagnitude", "Enchantment", papyrusEnchantment::SetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectArea", "Enchantment", papyrusEnchantment::SetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectDuration", "Enchantment", papyrusEnchantment::SetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetKeywordRestrictions", "Enchantment", papyrusEnchantment::SetKeywordRestrictions, registry)); - - registry->SetFunctionFlags("Enchantment", "GetNumEffects", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "GetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "GetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "GetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "GetNthEffectMagicEffect", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "GetCostliestEffectIndex", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Enchantment", "GetBaseEnchantment", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Enchantment", "SetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "SetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Enchantment", "SetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusEnchantment.h b/source/fs.dll/skse64/skse64/PapyrusEnchantment.h deleted file mode 100644 index 0353280a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEnchantment.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -class EnchantmentItem; -class MagicItem; -class EffectSetting; -class VMClassRegistry; - -namespace papyrusEnchantment -{ - void RegisterFuncs(VMClassRegistry* registry); - - // MagicItem funcs - UInt32 GetNumEffects(EnchantmentItem* thisMagic); - float GetNthEffectMagnitude(EnchantmentItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(EnchantmentItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(EnchantmentItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(EnchantmentItem* thisMagic, UInt32 index); - //UInt32 GetCostliestEffectIndex(EnchantmentItem* thisMagic); - EnchantmentItem * GetBaseEnchantment(EnchantmentItem* thisMagic); - - void SetNthEffectMagnitude(EnchantmentItem* thisSpell, UInt32 index, float value); - void SetNthEffectArea(EnchantmentItem* thisSpell, UInt32 index, UInt32 value); - void SetNthEffectDuration(EnchantmentItem* thisSpell, UInt32 index, UInt32 value); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusEquipSlot.cpp b/source/fs.dll/skse64/skse64/PapyrusEquipSlot.cpp deleted file mode 100644 index 74cc2502..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEquipSlot.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "PapyrusEquipSlot.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" - -namespace papyrusEquipSlot -{ - UInt32 GetNumParents(BGSEquipSlot* equipSlot) - { - return (equipSlot) ? equipSlot->parentSlots.count : 0; - } - - BGSEquipSlot* GetNthParent(BGSEquipSlot* equipSlot, UInt32 n) - { - if(equipSlot) { - BGSEquipSlot* nthSlot = NULL; - equipSlot->parentSlots.GetNthItem(n, nthSlot); - if(nthSlot) - return nthSlot; - } - - return NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusEquipSlot::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSEquipSlot::kTypeID, "EquipSlot"); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumParents", "EquipSlot", papyrusEquipSlot::GetNumParents, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthParent", "EquipSlot", papyrusEquipSlot::GetNthParent, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusEquipSlot.h b/source/fs.dll/skse64/skse64/PapyrusEquipSlot.h deleted file mode 100644 index c51e8976..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEquipSlot.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -class BGSEquipSlot; -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusEquipSlot -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetNumParents(BGSEquipSlot* equipSlot); - BGSEquipSlot* GetNthParent(BGSEquipSlot* equipSlot, UInt32 n); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusEventFunctor.h b/source/fs.dll/skse64/skse64/PapyrusEventFunctor.h deleted file mode 100644 index 84502f4e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEventFunctor.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include - -#include "skse64/PapyrusVM.h" -#include "skse64/PapyrusArgs.h" - -template -class EventQueueFunctor : public IFunctionArguments -{ - static const UInt32 size = sizeof...(T_values); -public: - EventQueueFunctor(BSFixedString & a_eventName, T_values... args) - : m_eventName(a_eventName.data), m_args(args...) {} - - template - void SendEvent(T_Base* base) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy* policy = registry->GetHandlePolicy(); - UInt64 handle = policy->Create(T_Base::kTypeID, base); - - registry->QueueEvent(handle, &m_eventName, this); - } - - virtual bool Copy(Output * dst) - { - dst->Resize(size); - for_each_in_tuple(dst, m_args); - return true; - } - -private: - template - typename std::enable_if::type - for_each_in_tuple(Output * dst, std::tuple & parts) - { - - } - - template - typename std::enable_if::type - for_each_in_tuple(Output * dst, std::tuple & parts) - { - PackValue(dst->Get(I), &std::get(parts), (*g_skyrimVM)->GetClassRegistry()); - for_each_in_tuple(dst, parts); - } - - BSFixedString m_eventName; - std::tuple m_args; -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusEvents.cpp b/source/fs.dll/skse64/skse64/PapyrusEvents.cpp deleted file mode 100644 index 65077f90..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEvents.cpp +++ /dev/null @@ -1,331 +0,0 @@ -#include "PapyrusEvents.h" -#include "GameMenus.h" -#include "GameReferences.h" -#include "GameRTTI.h" -#include -#include "PapyrusArgs.h" -#include "Hooks_Scaleform.h" - -#include "PapyrusEventFunctor.h" - -//// Global instances - -RegistrationMapHolder g_menuOpenCloseRegs; -RegistrationMapHolder g_inputKeyEventRegs; -RegistrationMapHolder g_inputControlEventRegs; -RegistrationMapHolder g_modCallbackRegs; - -RegistrationSetHolder g_cameraEventRegs; -RegistrationSetHolder g_crosshairRefEventRegs; -RegistrationMapHolder g_actionEventRegs; -RegistrationSetHolder g_ninodeUpdateEventRegs; - -EventDispatcher g_modCallbackEventDispatcher; -EventDispatcher g_cameraEventDispatcher; -EventDispatcher g_crosshairRefEventDispatcher; -EventDispatcher g_actionEventDispatcher; -EventDispatcher g_ninodeUpdateEventDispatcher; - -MenuEventHandler g_menuEventHandler; -InputEventHandler g_inputEventHandler; -ModCallbackEventHandler g_modCallbackEventHandler; -CameraEventHandler g_cameraEventHandler; -CrosshairRefEventHandler g_crosshairRefEventHandler; -ActionEventHandler g_actionEventHandler; -NiNodeUpdateEventHandler g_ninodeUpdateEventHandler; - -//// Generic functors - -template void SetVMValue(VMValue * val, T arg) -{ - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - PackValue(val, &arg, registry); -} - -template <> void SetVMValue (VMValue * val, bool arg) { val->SetBool(arg); } -template <> void SetVMValue (VMValue * val, SInt32 arg) { val->SetInt(arg); } -template <> void SetVMValue (VMValue * val, float arg) { val->SetFloat(arg); } -template <> void SetVMValue (VMValue * val, BSFixedString arg) { val->SetString(arg.data); } - - -template -class EventQueueFunctor1 : public IFunctionArguments -{ -public: - EventQueueFunctor1(BSFixedString & a_eventName, T1 a_arg1) - : eventName(a_eventName.data), arg1(a_arg1) {} - - virtual bool Copy(Output * dst) - { - dst->Resize(1); - SetVMValue(dst->Get(0), arg1); - - return true; - } - - void operator() (const EventRegistration & reg) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - registry->QueueEvent(reg.handle, &eventName, this); - } - -private: - BSFixedString eventName; - T1 arg1; -}; - -template -class EventQueueFunctor2 : public IFunctionArguments -{ -public: - EventQueueFunctor2(BSFixedString & a_eventName, T1 a_arg1, T2 a_arg2) - : eventName(a_eventName.data), arg1(a_arg1), arg2(a_arg2) {} - - virtual bool Copy(Output * dst) - { - dst->Resize(2); - SetVMValue(dst->Get(0), arg1); - SetVMValue(dst->Get(1), arg2); - - return true; - } - - void operator() (const EventRegistration & reg) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - registry->QueueEvent(reg.handle, &eventName, this); - } - -private: - BSFixedString eventName; - T1 arg1; - T2 arg2; -}; - -template -class EventQueueFunctor4 : public IFunctionArguments -{ -public: - EventQueueFunctor4(BSFixedString & a_eventName, T1 a_arg1, T2 a_arg2, T3 a_arg3, T4 a_arg4) - : eventName(a_eventName.data), arg1(a_arg1), arg2(a_arg2), arg3(a_arg3), arg4(a_arg4) {} - - virtual bool Copy(Output * dst) - { - dst->Resize(4); - SetVMValue(dst->Get(0), arg1); - SetVMValue(dst->Get(1), arg2); - SetVMValue(dst->Get(2), arg3); - SetVMValue(dst->Get(3), arg4); - return true; - } - - void operator() (const EventRegistration & reg) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - registry->QueueEvent(reg.handle, &eventName, this); - } - -private: - BSFixedString eventName; - T1 arg1; - T2 arg2; - T3 arg3; - T4 arg4; -}; - -//// Specific functors - -class ModCallbackEventFunctor : public IFunctionArguments -{ -public: - ModCallbackEventFunctor(BSFixedString & a_eventName, TESForm * a_sender, BSFixedString & a_strArg, float a_numArg) - : eventName(a_eventName.data), strArg(a_strArg.data), numArg(a_numArg), sender(a_sender) {} - - virtual bool Copy(Output * dst) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - - dst->Resize(4); - dst->Get(0)->SetString(eventName.data); - dst->Get(1)->SetString(strArg.data); - dst->Get(2)->SetFloat(numArg); - PackValue(dst->Get(3), &sender, registry); - - return true; - } - - void operator() (const EventRegistration & reg) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - registry->QueueEvent(reg.handle, ®.params.callbackName, this); - } - -private: - BSFixedString eventName; - BSFixedString strArg; - float numArg; - TESForm * sender; -}; - - -//// Event handlers - -EventResult MenuEventHandler::ReceiveEvent(MenuOpenCloseEvent * evn, EventDispatcher * dispatcher) -{ - BSFixedString eventName = evn->opening ? BSFixedString("OnMenuOpen") : BSFixedString("OnMenuClose"); - - g_menuOpenCloseRegs.ForEach( - evn->menuName, - EventQueueFunctor1(eventName, evn->menuName) - ); - - return kEvent_Continue; -} - -EventResult InputEventHandler::ReceiveEvent(InputEvent ** evns, InputEventDispatcher * dispatcher) -{ - // Function is called periodically, if no buttons pressed/held *evns == NULL - if (! *evns) - return kEvent_Continue; - - for (InputEvent * e = *evns; e; e = e->next) - { - switch(e->eventType) - { - case InputEvent::kEventType_Button: - { - ButtonEvent * t = DYNAMIC_CAST(e, InputEvent, ButtonEvent); - - - UInt32 keyCode; - UInt32 deviceType = t->deviceType; - UInt32 keyMask = t->keyMask; - - // Mouse - if (deviceType == kDeviceType_Mouse) - keyCode = InputMap::kMacro_MouseButtonOffset + keyMask; - // Gamepad - else if (deviceType == kDeviceType_Gamepad) - keyCode = InputMap::GamepadMaskToKeycode(keyMask); - // Keyboard - else - keyCode = keyMask; - - // Valid scancode? - if (keyCode >= InputMap::kMaxMacros) - continue; - - BSFixedString control = *t->GetControlID(); - float timer = t->timer; - - bool isDown = t->flags != 0 && timer == 0.0; - bool isUp = t->flags == 0 && timer != 0; - - if (isDown) - { - // Used by scaleform skse.GetLastControl - SetLastControlDown(control.data, keyCode); - - g_inputKeyEventRegs.ForEach( - keyCode, - EventQueueFunctor1(BSFixedString("OnKeyDown"), (SInt32)keyCode) - ); - g_inputControlEventRegs.ForEach( - control, - EventQueueFunctor1(BSFixedString("OnControlDown"), control) - ); - } - else if (isUp) - { - SetLastControlUp(control.data, keyCode); - - g_inputKeyEventRegs.ForEach( - keyCode, - EventQueueFunctor2(BSFixedString("OnKeyUp"), (SInt32)keyCode, timer) - ); - g_inputControlEventRegs.ForEach( - control, - EventQueueFunctor2(BSFixedString("OnControlUp"), control, timer) - ); - } - } - break; - - /*case InputEvent::kEventType_Thumbstick: - { - ThumbstickEvent * t = DYNAMIC_CAST(e, InputEvent, ThumbstickEvent); - _MESSAGE("Moved %s Stick X: %f Y: %f", t->keyMask == 0x0B ? "Left" : "Right", t->x, t->y); - } - break;*/ - } - } - - return kEvent_Continue; -} - -EventResult ModCallbackEventHandler::ReceiveEvent(SKSEModCallbackEvent * evn, EventDispatcher * dispatcher) -{ - const char * eventNameData = evn->eventName.data; - - g_modCallbackRegs.ForEach( - evn->eventName, - ModCallbackEventFunctor(evn->eventName, evn->sender, evn->strArg, evn->numArg) - ); - - return kEvent_Continue; -} - -EventResult CameraEventHandler::ReceiveEvent(SKSECameraEvent * evn, EventDispatcher * dispatcher) -{ - SInt32 oldState = -1; - SInt32 newState = -1; - - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if(playerCamera) { - for(int i = 0; i < PlayerCamera::kNumCameraStates; i++) { - if(evn->oldState == playerCamera->cameraStates[i]) - oldState = i; - if(evn->newState == playerCamera->cameraStates[i]) - newState = i; - } - } - - g_cameraEventRegs.ForEach( - EventQueueFunctor2(BSFixedString("OnPlayerCameraState"), oldState, newState) - ); - - return kEvent_Continue; -} - -SKSECrosshairRefEvent::SKSECrosshairRefEvent(NiPointer & a_crosshairRef) : crosshairRef(a_crosshairRef) -{ - -} - -EventResult CrosshairRefEventHandler::ReceiveEvent(SKSECrosshairRefEvent * evn, EventDispatcher * dispatcher) -{ - g_crosshairRefEventRegs.ForEach( - EventQueueFunctor1(BSFixedString("OnCrosshairRefChange"), evn->crosshairRef) - ); - - return kEvent_Continue; -} - -EventResult ActionEventHandler::ReceiveEvent(SKSEActionEvent * evn, EventDispatcher * dispatcher) -{ - g_actionEventRegs.ForEach( - evn->type, - EventQueueFunctor4(BSFixedString("OnActorAction"), evn->type, evn->actor, evn->sourceForm, evn->slot) - ); - - return kEvent_Continue; -} - -EventResult NiNodeUpdateEventHandler::ReceiveEvent(SKSENiNodeUpdateEvent * evn, EventDispatcher * dispatcher) -{ - g_ninodeUpdateEventRegs.ForEach( - EventQueueFunctor1(BSFixedString("OnNiNodeUpdate"), evn->reference) - ); - - return kEvent_Continue; -} diff --git a/source/fs.dll/skse64/skse64/PapyrusEvents.h b/source/fs.dll/skse64/skse64/PapyrusEvents.h deleted file mode 100644 index 47c83bd0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusEvents.h +++ /dev/null @@ -1,654 +0,0 @@ -#pragma once - -#include "GameForms.h" -#include "GameTypes.h" -#include "GameEvents.h" -#include "GameInput.h" -#include "GameCamera.h" -#include -#include -#include "Serialization.h" -#include "PapyrusVM.h" - -template -class EventRegistration -{ -public: - - UInt64 handle; - D params; - - bool operator<(const EventRegistration & rhs) const { return handle < rhs.handle; } - - bool Save(SKSESerializationInterface * intfc, UInt32 version) const - { - if (! intfc->WriteRecordData(&handle, sizeof(handle))) - return false; - if (! params.Save(intfc, version)) - return false; - return true; - } - - bool Load(SKSESerializationInterface * intfc, UInt32 version) - { - if (! intfc->ReadRecordData(&handle, sizeof(handle))) - return false; - if (! params.Load(intfc, version)) - return false; - return true; - } - - void Dump(void) - { - _MESSAGE("> handle:\t%016I64x", handle); - params.Dump(); - } -}; - -class NullParameters -{ -public: - bool Save(SKSESerializationInterface * intfc, UInt32 version) const { return true; } - bool Load(SKSESerializationInterface * intfc, UInt32 version) { return true; } - void Dump(void) {} -}; - -class ModCallbackParameters -{ -public: - BSFixedString callbackName; - - bool Save(SKSESerializationInterface * intfc, UInt32 version) const - { - return Serialization::WriteData(intfc, &callbackName); - } - - bool Load(SKSESerializationInterface * intfc, UInt32 version) - { - return Serialization::ReadData(intfc, &callbackName); - } - - void Dump(void) - { - _MESSAGE("> callbackName:\t%s", callbackName); - } -}; - -template -class RegistrationMapHolder : public SafeDataHolder>>> -{ - typedef std::set> RegSet; - typedef std::map RegMap; - -public: - - void Register(K & key, UInt64 handle, D * params = NULL) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = handle; - if (params) - reg.params = *params; - - Lock(); - - if (m_data[key].insert(reg).second) - policy->AddRef(handle); - - Release(); - } - - template - void Register(K & key, UInt32 type, T * classType, D * params = NULL) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = policy->Create(type, (void *)classType); - if (params) - reg.params = *params; - -#ifdef _DEBUG - _MESSAGE("Executed PapyrusEvents::Register - %016llX", reg.handle); -#endif - - Lock(); - - if (m_data[key].insert(reg).second) - policy->AddRef(reg.handle); - - Release(); - } - - void Unregister(K & key, UInt64 handle) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = handle; - - Lock(); - - if (m_data[key].erase(reg)) - policy->Release(handle); - - Release(); - } - - template - void Unregister(K & key, UInt32 type, T * classType) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = policy->Create(type, (void *)classType); - - Lock(); - - if (m_data[key].erase(reg)) - policy->Release(reg.handle); - - Release(); - } - - void UnregisterAll(UInt64 handle) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = handle; - - Lock(); - - for (RegMap::iterator iter = m_data.begin(); iter != m_data.end(); ++iter) - if (iter->second.erase(reg)) - policy->Release(handle); - - Release(); - } - - template - void UnregisterAll(UInt32 type, T * classType) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = policy->Create(type, (void *)classType); - - Lock(); - - for (RegMap::iterator iter = m_data.begin(); iter != m_data.end(); ++iter) - if (iter->second.erase(reg)) - policy->Release(reg.handle); - - Release(); - } - - template - void ForEach(K & key, F & functor) - { - Lock(); - - RegMap::iterator handles = m_data.find(key); - - if (handles != m_data.end()) - for (RegSet::iterator iter = handles->second.begin(); iter != handles->second.end(); ++iter) - functor(*iter); - - Release(); - } - - void Clear(void) - { - Lock(); - m_data.clear(); - Release(); - } - - bool Save(SKSESerializationInterface * intfc, UInt32 type, UInt32 version) - { - intfc->OpenRecord(type, version); - - Lock(); - - for (RegMap::iterator iter = m_data.begin(); iter != m_data.end(); ++iter) - { - UInt32 numRegs = iter->second.size(); - - if (!numRegs) - continue; - - intfc->OpenRecord('REGS', version); - - // Key - Serialization::WriteData(intfc, &iter->first); - // Reg count - intfc->WriteRecordData(&numRegs, sizeof(numRegs)); - // Regs - for (RegSet::iterator elems = iter->second.begin(); elems != iter->second.end(); ++elems) - elems->Save(intfc, version); - } - - intfc->OpenRecord('REGE', version); - - Release(); - - return true; - } - - bool Load(SKSESerializationInterface* intfc, UInt32 version) - { - UInt32 type, length, curVersion; - - while (intfc->GetNextRecordInfo(&type, &curVersion, &length)) - { - switch (type) - { - case 'REGS': - { - K curKey; - // Key - if (! Serialization::ReadData(intfc, &curKey)) - { - _MESSAGE("Error loading reg key"); - return false; - } - - // Reg count - UInt32 numRegs = 0; - if (! intfc->ReadRecordData(&numRegs, sizeof(numRegs))) - { - _MESSAGE("Error loading reg count"); - return false; - } - - for (UInt32 i=0; i reg; - if (reg.Load(intfc, version)) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - UInt64 newHandle = 0; - - // Skip if handle is no longer valid. - if (! intfc->ResolveHandle(reg.handle, &newHandle)) - continue; - - reg.handle = newHandle; - - Lock(); - - if (m_data[curKey].insert(reg).second) - policy->AddRef(reg.handle); - - Release(); - - } - else - { - _MESSAGE("Error loading regs"); - return false; - } - } - - break; - } - case 'REGE': - { - return true; - } - default: - { - _MESSAGE("Error loading unexpected chunk type %08X (%.4s)", type, &type); - return false; - } - } - } - - _MESSAGE("Missing record data for type %08X (%.4s)", type, &type); - return false; - } -}; - -template -class RegistrationSetHolder : public SafeDataHolder>> -{ - typedef std::set> RegSet; - -public: - - void Register(UInt64 handle, D * params = NULL) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = handle; - if (params) - reg.params = *params; - - Lock(); - - if (m_data.insert(reg).second) - policy->AddRef(handle); - - Release(); - } - - template - void Register(UInt32 type, T * classType, D * params = NULL) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = policy->Create(type, (void *)classType); - if (params) - reg.params = *params; - - Lock(); - - if (m_data.insert(reg).second) - policy->AddRef(reg.handle); - - Release(); - } - - void Unregister(UInt64 handle) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = handle; - - Lock(); - - if (m_data.erase(reg)) - policy->Release(handle); - - Release(); - } - - template - void Unregister(UInt32 type, T * classType) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - EventRegistration reg; - reg.handle = policy->Create(type, (void *)classType); - - Lock(); - - if (m_data.erase(reg)) - policy->Release(reg.handle); - - Release(); - } - - template - void ForEach(F & functor) - { - Lock(); - - for (RegSet::iterator iter = m_data.begin(); iter != m_data.end(); ++iter) - functor(*iter); - - Release(); - } - - void Clear(void) - { - Lock(); - m_data.clear(); - Release(); - } - - bool Save(SKSESerializationInterface * intfc, UInt32 type, UInt32 version) - { - intfc->OpenRecord(type, version); - - Lock(); - - UInt32 numRegs = m_data.size(); - - // Reg count - intfc->WriteRecordData(&numRegs, sizeof(numRegs)); - - // Regs - for (RegSet::iterator iter = m_data.begin(); iter != m_data.end(); ++iter) - iter->Save(intfc, version); - - Release(); - - return true; - } - - bool Load(SKSESerializationInterface* intfc, UInt32 version) - { - // Reg count - UInt32 numRegs = 0; - if (! intfc->ReadRecordData(&numRegs, sizeof(numRegs))) - { - _MESSAGE("Error loading reg count"); - return false; - } - - for (UInt32 i=0; i reg; - if (reg.Load(intfc, version)) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - UInt64 newHandle = 0; - - // Skip if handle is no longer valid. - if (! intfc->ResolveHandle(reg.handle, &newHandle)) - continue; - - reg.handle = newHandle; - - Lock(); - - if (m_data.insert(reg).second) - policy->AddRef(reg.handle); - - Release(); - - } - else - { - _MESSAGE("Error loading regs"); - return false; - } - } - - return true; - } -}; - -extern RegistrationMapHolder g_menuOpenCloseRegs; -extern RegistrationMapHolder g_inputKeyEventRegs; -extern RegistrationMapHolder g_inputControlEventRegs; -extern RegistrationMapHolder g_modCallbackRegs; - -extern RegistrationSetHolder g_cameraEventRegs; -extern RegistrationSetHolder g_crosshairRefEventRegs; -extern RegistrationMapHolder g_actionEventRegs; -extern RegistrationSetHolder g_ninodeUpdateEventRegs; - -struct SKSEModCallbackEvent -{ - BSFixedString eventName; - BSFixedString strArg; - float numArg; - TESForm * sender; - - SKSEModCallbackEvent(BSFixedString a_eventName, BSFixedString a_strArg, float a_numArg, TESForm * a_sender) : - eventName(a_eventName.data), strArg(a_strArg.data), numArg(a_numArg), sender(a_sender) {} -}; - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(SKSEModCallbackEvent * evn, EventDispatcher * dispatcher) = 0; -}; - -extern EventDispatcher g_modCallbackEventDispatcher; - -struct SKSECameraEvent -{ - TESCameraState * oldState; - TESCameraState * newState; - - SKSECameraEvent(TESCameraState * a_oldState, TESCameraState * a_newState) : - oldState(a_oldState), newState(a_newState) {} -}; - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(SKSECameraEvent * evn, EventDispatcher * dispatcher) = 0; -}; - -extern EventDispatcher g_cameraEventDispatcher; - -struct SKSECrosshairRefEvent -{ - NiPointer crosshairRef; - - SKSECrosshairRefEvent(NiPointer & a_crosshairRef); -}; - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(SKSECrosshairRefEvent * evn, EventDispatcher * dispatcher) = 0; -}; - -extern EventDispatcher g_crosshairRefEventDispatcher; - -struct SKSEActionEvent -{ - enum { - kType_WeaponSwing = 0, - kType_SpellCast = 1, - kType_SpellFire = 2, - kType_VoiceCast = 3, - kType_VoiceFire = 4, - kType_BowDraw = 5, - kType_BowRelease = 6, - kType_BeginDraw = 7, - kType_EndDraw = 8, - kType_BeginSheathe = 9, - kType_EndSheathe = 10 - }; - enum { - kSlot_Left = 0, - kSlot_Right = 1, - kSlot_Voice = 2 - }; - UInt32 type; - Actor * actor; - TESForm * sourceForm; - UInt32 slot; - - SKSEActionEvent(UInt32 a_type, Actor * a_actor, TESForm * a_source, UInt32 a_slot) : - type(a_type), actor(a_actor), sourceForm(a_source), slot(a_slot) {} -}; - -struct SKSENiNodeUpdateEvent -{ - TESObjectREFR * reference; - - SKSENiNodeUpdateEvent(TESObjectREFR * a_reference) : reference(a_reference) {} -}; - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(SKSENiNodeUpdateEvent * evn, EventDispatcher * dispatcher) = 0; -}; - -extern EventDispatcher g_ninodeUpdateEventDispatcher; - -template <> -class BSTEventSink -{ -public: - virtual ~BSTEventSink() {}; // todo? - virtual EventResult ReceiveEvent(SKSEActionEvent * evn, EventDispatcher * dispatcher) = 0; -}; - -extern EventDispatcher g_actionEventDispatcher; - - -class MenuEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(MenuOpenCloseEvent * evn, EventDispatcher * dispatcher); -}; - -class InputEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(InputEvent ** evns, InputEventDispatcher * dispatcher); -}; - -class ModCallbackEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(SKSEModCallbackEvent * evn, EventDispatcher * dispatcher); -}; - -class CameraEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(SKSECameraEvent * evn, EventDispatcher * dispatcher); -}; - -class CrosshairRefEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(SKSECrosshairRefEvent * evn, EventDispatcher * dispatcher); -}; - -class ActionEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(SKSEActionEvent * evn, EventDispatcher * dispatcher); -}; - -class NiNodeUpdateEventHandler : public BSTEventSink -{ -public: - virtual EventResult ReceiveEvent(SKSENiNodeUpdateEvent * evn, EventDispatcher * dispatcher); -}; - -extern MenuEventHandler g_menuEventHandler; -extern InputEventHandler g_inputEventHandler; -extern ModCallbackEventHandler g_modCallbackEventHandler; -extern CameraEventHandler g_cameraEventHandler; -extern CrosshairRefEventHandler g_crosshairRefEventHandler; -extern ActionEventHandler g_actionEventHandler; -extern NiNodeUpdateEventHandler g_ninodeUpdateEventHandler; diff --git a/source/fs.dll/skse64/skse64/PapyrusFaction.cpp b/source/fs.dll/skse64/skse64/PapyrusFaction.cpp deleted file mode 100644 index 1da01c59..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFaction.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "PapyrusFaction.h" - -#include "GameObjects.h" -#include "GameData.h" - -namespace papyrusFaction -{ - bool IsFactionFlagSet(TESFaction* thisFaction, UInt32 flag) - { - return (thisFaction) ? (thisFaction->factionFlags & flag) == flag : false; - } - - void SetFactionFlag(TESFaction* thisFaction, UInt32 flag) - { - if (thisFaction) { - thisFaction->factionFlags |= flag; - } - } - - void ClearFactionFlag(TESFaction* thisFaction, UInt32 flag) - { - if (thisFaction) { - thisFaction->factionFlags &= ~flag; - } - } - - bool OnlyBuysStolenItems(TESFaction* thisFaction) - { - return (thisFaction) ? (thisFaction->vendorData.onlyBuysStolenItems == 1) : false; - } - - void SetOnlyBuysStolenItems(TESFaction* thisFaction, bool buystolen) - { - if(thisFaction) { - thisFaction->vendorData.onlyBuysStolenItems = (buystolen ? 1 : 0); - } - } - - UInt32 GetVendorStartHour(TESFaction* thisFaction) - { - return (thisFaction) ? thisFaction->vendorData.startHour : 0; - } - - void SetVendorStartHour(TESFaction* thisFaction, UInt32 hour) - { - if(thisFaction) { - if(hour > USHRT_MAX) - hour = USHRT_MAX; - thisFaction->vendorData.startHour = hour; - } - } - - UInt32 GetVendorEndHour(TESFaction* thisFaction) - { - return (thisFaction) ? thisFaction->vendorData.endHour : 0; - } - - void SetVendorEndHour(TESFaction* thisFaction, UInt32 hour) - { - if(thisFaction) { - if(hour > USHRT_MAX) - hour = USHRT_MAX; - thisFaction->vendorData.endHour = hour; - } - } - - UInt32 GetVendorRadius(TESFaction* thisFaction) - { - return (thisFaction) ? thisFaction->vendorData.radius : 0; - } - - void SetVendorRadius(TESFaction* thisFaction, UInt32 radius) - { - if(thisFaction) { - if(radius > USHRT_MAX) - radius = USHRT_MAX; - thisFaction->vendorData.radius = radius; - } - } - - TESObjectREFR * GetMerchantContainer(TESFaction* thisFaction) - { - return (thisFaction) ? thisFaction->vendorData.merchantContainer : NULL; - } - - void SetMerchantContainer(TESFaction* thisFaction, TESObjectREFR * reference) - { - if(thisFaction && reference) { - thisFaction->vendorData.merchantContainer = reference; - } - } - - bool IsNotSellBuy(TESFaction* thisFaction) - { - return (thisFaction) ? (thisFaction->vendorData.notSellBuy == 1) : false; - } - - void SetNotSellBuy(TESFaction* thisFaction, bool notSellBuy) - { - if(thisFaction) { - thisFaction->vendorData.notSellBuy = (notSellBuy ? 1 : 0); - } - } - - BGSListForm * GetBuySellList(TESFaction* thisFaction) - { - return (thisFaction) ? thisFaction->vendorData.buySellList : NULL; - } - - void SetBuySellList(TESFaction* thisFaction, BGSListForm * vendorList) - { - if(thisFaction && vendorList) { - thisFaction->vendorData.buySellList = vendorList; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusFaction::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("IsFactionFlagSet", "Faction", papyrusFaction::IsFactionFlagSet, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFactionFlag", "Faction", papyrusFaction::SetFactionFlag, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ClearFactionFlag", "Faction", papyrusFaction::ClearFactionFlag, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("OnlyBuysStolenItems", "Faction", papyrusFaction::OnlyBuysStolenItems, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetOnlyBuysStolenItems", "Faction", papyrusFaction::SetOnlyBuysStolenItems, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetVendorStartHour", "Faction", papyrusFaction::GetVendorStartHour, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetVendorStartHour", "Faction", papyrusFaction::SetVendorStartHour, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetVendorEndHour", "Faction", papyrusFaction::GetVendorEndHour, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetVendorEndHour", "Faction", papyrusFaction::SetVendorEndHour, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetVendorRadius", "Faction", papyrusFaction::GetVendorRadius, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetVendorRadius", "Faction", papyrusFaction::SetVendorRadius, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMerchantContainer", "Faction", papyrusFaction::GetMerchantContainer, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMerchantContainer", "Faction", papyrusFaction::SetMerchantContainer, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsNotSellBuy", "Faction", papyrusFaction::IsNotSellBuy, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetNotSellBuy", "Faction", papyrusFaction::SetNotSellBuy, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetBuySellList", "Faction", papyrusFaction::GetBuySellList, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetBuySellList", "Faction", papyrusFaction::SetBuySellList, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusFaction.h b/source/fs.dll/skse64/skse64/PapyrusFaction.h deleted file mode 100644 index 1513b9cf..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFaction.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class TESFaction; -class TESObjectREFR; -class BGSListForm; - -class VMClassRegistry; - -namespace papyrusFaction -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool OnlyBuysStolenItems(TESFaction* thisFaction); - void SetOnlyBuysStolenItems(TESFaction* thisFaction, bool buystolen); - - UInt32 GetVendorStartHour(TESFaction* thisFaction); - void SetVendorStartHour(TESFaction* thisFaction, UInt32 hour); - - UInt32 GetVendorEndHour(TESFaction* thisFaction); - void SetVendorEndHour(TESFaction* thisFaction, UInt32 hour); - - UInt32 GetVendorRadius(TESFaction* thisFaction); - void SetVendorRadius(TESFaction* thisFaction, UInt32 radius); - - TESObjectREFR * GetMerchantContainer(TESFaction* thisFaction); - void SetMerchantContainer(TESFaction* thisFaction, TESObjectREFR * reference); - - - bool IsNotSellBuy(TESFaction* thisFaction); - void SetNotSellBuy(TESFaction* thisFaction, bool notSellBuy); - - BGSListForm * GetBuySellList(TESFaction* thisFaction); - void SetBuySellList(TESFaction* thisFaction, BGSListForm * vendorList); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusFlora.cpp b/source/fs.dll/skse64/skse64/PapyrusFlora.cpp deleted file mode 100644 index 79825f25..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFlora.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "PapyrusFlora.h" -#include "GameObjects.h" - -namespace papyrusFlora -{ - TESForm * GetIngredient(TESFlora* thisFlora) - { - return (thisFlora) ? thisFlora->produce.produce : NULL; - } - - void SetIngredient(TESFlora* thisFlora, TESForm* ingredient) - { - if (thisFlora) { - thisFlora->produce.produce = ingredient; - } - } - - BGSSoundDescriptorForm * GetHarvestSound(TESFlora* thisFlora) - { - return (thisFlora) ? thisFlora->produce.harvestSound : NULL; - } - - void SetHarvestSound(TESFlora* thisFlora, BGSSoundDescriptorForm * sound) - { - if (thisFlora) { - thisFlora->produce.harvestSound = sound; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusFlora::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetIngredient", "Flora", papyrusFlora::GetIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetIngredient", "Flora", papyrusFlora::SetIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetHarvestSound", "Flora", papyrusFlora::GetHarvestSound, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetHarvestSound", "Flora", papyrusFlora::SetHarvestSound, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusFlora.h b/source/fs.dll/skse64/skse64/PapyrusFlora.h deleted file mode 100644 index d1d79c57..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFlora.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -class VMClassRegistry; -class BGSSoundDescriptorForm; -class TESFlora; -class TESForm; - -namespace papyrusFlora -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESForm * GetIngredient(TESFlora* thisFlora); - void SetIngredient(TESFlora* thisFlora, TESForm* ingredient); - - BGSSoundDescriptorForm * GetHarvestSound(TESFlora* thisFlora); - void SetHarvestSound(TESFlora* thisFlora, BGSSoundDescriptorForm * sound); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusForm.cpp b/source/fs.dll/skse64/skse64/PapyrusForm.cpp deleted file mode 100644 index 988bcdeb..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusForm.cpp +++ /dev/null @@ -1,597 +0,0 @@ -#include "PapyrusForm.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" -#include "PapyrusVM.h" -#include "PapyrusEvents.h" -#include "PapyrusArgs.h" -//#include "GameMenus.h" - -#include -#include - -namespace papyrusForm -{ - UInt32 GetType(TESForm* thisForm) - { - return (thisForm) ? thisForm->GetFormType() : 0; - } - - BSFixedString GetName(TESForm* thisForm) - { - if (!thisForm) - return NULL; - - TESFullName* pFullName = DYNAMIC_CAST(thisForm, TESForm, TESFullName); - if (pFullName) - return pFullName->name.data; - return NULL; - } - - void SetName(TESForm* thisForm, BSFixedString nuName) - { - TESFullName* pFullName = DYNAMIC_CAST(thisForm, TESForm, TESFullName); - // is a const string, so have to just reassign it. - if (pFullName) { - pFullName->name = nuName; - } - } - - float GetWeight(TESForm* thisForm) - { - if (!thisForm) - return 0.0; - - TESWeightForm* pWeight = DYNAMIC_CAST(thisForm, TESForm, TESWeightForm); - if (pWeight) - return pWeight->weight; - return 0.0; - } - - void SetWeight(TESForm* thisForm, float nuWeight) - { - if (!thisForm) - return; - - TESWeightForm* pWeight = DYNAMIC_CAST(thisForm, TESForm, TESWeightForm); - if (pWeight) - pWeight->weight = nuWeight; - } - - UInt32 GetBaseDamage(TESForm* thisForm) - { - if (!thisForm) - return 0; - TESAttackDamageForm* pAttack = DYNAMIC_CAST(thisForm, TESForm, TESAttackDamageForm); - if (pAttack) - return pAttack->GetAttackDamage(); - return 0; - } - - UInt32 GetValue(TESForm* thisForm) - { - if (!thisForm) - return 0; - TESValueForm* pValue = DYNAMIC_CAST(thisForm, TESForm, TESValueForm); - if (pValue) - return pValue->value; - else { - AlchemyItem* alchemyItem = DYNAMIC_CAST(thisForm, TESForm, AlchemyItem); - if(alchemyItem && (alchemyItem->itemData.flags & AlchemyItem::kFlag_ManualCalc) == AlchemyItem::kFlag_ManualCalc) - return alchemyItem->itemData.value; - } - return 0; - } - - void SetGoldValue(TESForm* thisForm, UInt32 value) - { - if (!thisForm) - return; - TESValueForm* pValue = DYNAMIC_CAST(thisForm, TESForm, TESValueForm); - if (pValue) - pValue->value = value; - else { - AlchemyItem* alchemyItem = DYNAMIC_CAST(thisForm, TESForm, AlchemyItem); - if(alchemyItem && (alchemyItem->itemData.flags & AlchemyItem::kFlag_ManualCalc) == AlchemyItem::kFlag_ManualCalc) - alchemyItem->itemData.value = value; - } - } - - UInt32 GetNumKeywords(TESForm* thisForm) - { - if (!thisForm) - return 0; - BGSKeywordForm* pKeywords = DYNAMIC_CAST(thisForm, TESForm, BGSKeywordForm); - if (pKeywords) - return pKeywords->numKeywords; - return 0; - } - - BGSKeyword* GetNthKeyword(TESForm* thisForm, UInt32 index) - { - if (!thisForm) - return NULL; - BGSKeywordForm* pKeywords = DYNAMIC_CAST(thisForm, TESForm, BGSKeywordForm); - if (pKeywords && index < pKeywords->numKeywords) { - return pKeywords->keywords[index]; - } - return NULL; - } - - typedef std::set HandleList; - typedef std::map RegisteredKeyMap; - - VMResultArray GetKeywords(TESForm* thisForm) - { - VMResultArray result; - if (!thisForm) - return result; - - BGSKeywordForm* pKeywords = DYNAMIC_CAST(thisForm, TESForm, BGSKeywordForm); - if (pKeywords) { - for(UInt32 i = 0; i < pKeywords->numKeywords; i++) - { - if(pKeywords->keywords[i]) - result.push_back(pKeywords->keywords[i]); - } - } - return result; - } - - void SetPlayerKnows(TESForm * thisForm, bool knows) - { - if(!thisForm) - return; - - knows ? thisForm->flags |= TESForm::kFlagPlayerKnows : thisForm->flags &= ~TESForm::kFlagPlayerKnows; - } - - void RegisterForKey(TESForm * thisForm, UInt32 key) - { - if(!thisForm) - return; - g_inputKeyEventRegs.Register(key, thisForm->GetFormType(), thisForm); - } - - void UnregisterForKey(TESForm * thisForm, UInt32 key) - { - if(!thisForm) - return; - g_inputKeyEventRegs.Unregister(key, thisForm->GetFormType(), thisForm); - } - - void UnregisterForAllKeys(TESForm * thisForm) - { - if(!thisForm) - return; - g_inputKeyEventRegs.UnregisterAll(thisForm->GetFormType(), thisForm); - } - - - void RegisterForControl(TESForm * thisForm, BSFixedString control) - { - if(!thisForm) - return; - g_inputControlEventRegs.Register(control, thisForm->GetFormType(), thisForm); - } - - void UnregisterForControl(TESForm * thisForm, BSFixedString control) - { - if(!thisForm) - return; - g_inputControlEventRegs.Unregister(control, thisForm->GetFormType(), thisForm); - } - - void UnregisterForAllControls(TESForm * thisForm) - { - if(!thisForm) - return; - g_inputControlEventRegs.UnregisterAll(thisForm->GetFormType(), thisForm); - } - -#if 0 - void UpdateKeys(UInt8 * data) - { - /*static UInt8 oldState[0x100] = { 0 }; - - if(!*g_skyrimVM) return; - - // ### this is off because it's a super temp hack - - BSFixedString eventName("OnKeyDown"); - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - - for(UInt32 i = 0; i < 0x100; i++) - { - if(!oldState[i] && data[i]) - { - RegisteredKeyMap::iterator registeredHandles = g_regKeyMap.find(i); - if(registeredHandles != g_regKeyMap.end()) - { - for(HandleList::iterator iter = registeredHandles->second.begin(); iter != registeredHandles->second.end(); ++iter) - { - OneIntArg args(i); - - registry->QueueEvent(*iter, &eventName, &args); - } - } - } - - oldState[i] = data[i]; - }*/ - } -#endif - - void RegisterForMenu(TESForm * thisForm, BSFixedString menuName) - { - if(!thisForm || !menuName.data) - return; - - g_menuOpenCloseRegs.Register(menuName, thisForm->GetFormType(), thisForm); - } - - void UnregisterForMenu(TESForm * thisForm, BSFixedString menuName) - { - if(!thisForm || !menuName.data) - return; - - g_menuOpenCloseRegs.Unregister(menuName, thisForm->GetFormType(), thisForm); - } - - void UnregisterForAllMenus(TESForm * thisForm) - { - if(!thisForm) - return; - - g_menuOpenCloseRegs.UnregisterAll(thisForm->GetFormType(), thisForm); - } - - void RegisterForModEvent(TESForm * thisForm, BSFixedString eventName, BSFixedString callbackName) - { - if(!thisForm || !eventName.data || !callbackName.data) - return; - - ModCallbackParameters params; - params.callbackName = callbackName; - - g_modCallbackRegs.Register(eventName, thisForm->GetFormType(), thisForm, ¶ms); - } - - void UnregisterForModEvent(TESForm * thisForm, BSFixedString eventName) - { - if(!thisForm || !eventName.data) - return; - - g_modCallbackRegs.Unregister(eventName, thisForm->GetFormType(), thisForm); - } - - void UnregisterForAllModEvents(TESForm * thisForm) - { - g_modCallbackRegs.UnregisterAll(thisForm->GetFormType(), thisForm); - } - - void SendModEvent(TESForm * thisForm, BSFixedString eventName, BSFixedString strArg, float numArg) - { - if (!eventName.data) - return; - - SKSEModCallbackEvent evn(eventName, strArg, numArg, thisForm); - g_modCallbackEventDispatcher.SendEvent(&evn); - } - - void RegisterForCameraState(TESForm * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Register(thisForm->GetFormType(), thisForm); - } - - void UnregisterForCameraState(TESForm * thisForm) - { - if(!thisForm) - return; - - g_cameraEventRegs.Unregister(thisForm->GetFormType(), thisForm); - } - - void RegisterForCrosshairRef(TESForm * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Register(thisForm->GetFormType(), thisForm); - } - - void UnregisterForCrosshairRef(TESForm * thisForm) - { - if(!thisForm) - return; - - g_crosshairRefEventRegs.Unregister(thisForm->GetFormType(), thisForm); - } - - void RegisterForActorAction(TESForm * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Register(actionType, thisForm->GetFormType(), thisForm); - } - - void UnregisterForActorAction(TESForm * thisForm, UInt32 actionType) - { - if(!thisForm) - return; - - g_actionEventRegs.Unregister(actionType, thisForm->GetFormType(), thisForm); - } - - - TESForm * TempClone(TESForm * thisForm) - { - TESForm * result = NULL; - - if(thisForm) - { - IFormFactory * factory = IFormFactory::GetFactoryForType(thisForm->formType); - if(factory) - { - result = factory->Create(); - if(result) - { - result->Init(); - result->CopyFrom(thisForm); - result->CopyFromEx(thisForm); - } - else - { - _ERROR("Form::TempClone: factory for type %02X failed", thisForm->formType); - } - } - else - { - _MESSAGE("Form::TempClone: tried to clone form %08X (type %02X), no factory found", thisForm->formID, thisForm->formType); - } - } - - return result; - } - - bool HasWorldModel(TESForm * thisForm) - { - if(thisForm) { - TESModel* pWorldModel = DYNAMIC_CAST(thisForm, TESForm, TESModel); - if (pWorldModel) - return true; - } - - return false; - } - - BSFixedString GetWorldModelPath(TESForm * thisForm) - { - if(!thisForm) - return NULL; - - TESModel* pWorldModel = DYNAMIC_CAST(thisForm, TESForm, TESModel); - if (!pWorldModel) - return NULL; - - return pWorldModel->GetModelName(); - } - - void SetWorldModelPath(TESForm * thisForm, BSFixedString nuPath) - { - if(thisForm) { - TESModel* pWorldModel = DYNAMIC_CAST(thisForm, TESForm, TESModel); - if(pWorldModel) - pWorldModel->SetModelName(nuPath.data); - } - } - - UInt32 GetWorldModelNumTextureSets(TESForm * thisForm) - { - if(!thisForm) - return 0; - - TESModelTextureSwap* pTextSwap = DYNAMIC_CAST(thisForm, TESForm, TESModelTextureSwap); - if (!pTextSwap) - return 0; - - return pTextSwap->count; - } - - BGSTextureSet* GetWorldModelNthTextureSet(TESForm * thisForm, UInt32 n) - { - if(!thisForm) - return NULL; - - TESModelTextureSwap* pTextSwap = DYNAMIC_CAST(thisForm, TESForm, TESModelTextureSwap); - if (!pTextSwap) - return NULL; - - if(!pTextSwap->swaps || n >= pTextSwap->count) - return NULL; - - return pTextSwap->swaps[n].textureSet; - } - - void SetWorldModelNthTextureSet(TESForm * thisForm, BGSTextureSet* textureSet, UInt32 n) - { - if(thisForm && thisForm) { - TESModelTextureSwap* pTextSwap = DYNAMIC_CAST(thisForm, TESForm, TESModelTextureSwap); - if (pTextSwap) { - if(pTextSwap->swaps && n < pTextSwap->count) { - pTextSwap->swaps[n].textureSet = textureSet; - } - } - } - } - - bool IsPlayable(TESForm * thisForm) - { - return (thisForm) ? thisForm->IsPlayable() : false; - } - - void RegisterForNiNodeUpdate(TESForm * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Register(thisForm->GetFormType(), thisForm); - } - - void UnregisterForNiNodeUpdate(TESForm * thisForm) - { - if(!thisForm) - return; - - g_ninodeUpdateEventRegs.Unregister(thisForm->GetFormType(), thisForm); - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusForm::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetType", "Form", papyrusForm::GetType, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetName", "Form", papyrusForm::GetName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetName", "Form", papyrusForm::SetName, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWeight", "Form", papyrusForm::GetWeight, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWeight", "Form", papyrusForm::SetWeight, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetGoldValue", "Form", papyrusForm::SetGoldValue, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumKeywords", "Form", papyrusForm::GetNumKeywords, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthKeyword", "Form", papyrusForm::GetNthKeyword, registry)); - - registry->RegisterFunction( - new NativeFunction0 > ("GetKeywords", "Form", papyrusForm::GetKeywords, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetPlayerKnows", "Form", papyrusForm::SetPlayerKnows, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForKey", "Form", papyrusForm::RegisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForKey", "Form", papyrusForm::UnregisterForKey, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllKeys", "Form", papyrusForm::UnregisterForAllKeys, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForMenu", "Form", papyrusForm::RegisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForMenu", "Form", papyrusForm::UnregisterForMenu, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllMenus", "Form", papyrusForm::UnregisterForAllMenus, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("RegisterForModEvent", "Form", papyrusForm::RegisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SendModEvent", "Form", papyrusForm::SendModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForModEvent", "Form", papyrusForm::UnregisterForModEvent, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllModEvents", "Form", papyrusForm::UnregisterForAllModEvents, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("TempClone", "Form", papyrusForm::TempClone, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForControl", "Form", papyrusForm::RegisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForControl", "Form", papyrusForm::UnregisterForControl, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForAllControls", "Form", papyrusForm::UnregisterForAllControls, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCameraState", "Form", papyrusForm::RegisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCameraState", "Form", papyrusForm::UnregisterForCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForCrosshairRef", "Form", papyrusForm::RegisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForCrosshairRef", "Form", papyrusForm::UnregisterForCrosshairRef, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("RegisterForActorAction", "Form", papyrusForm::RegisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("UnregisterForActorAction", "Form", papyrusForm::UnregisterForActorAction, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("RegisterForNiNodeUpdate", "Form", papyrusForm::RegisterForNiNodeUpdate, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UnregisterForNiNodeUpdate", "Form", papyrusForm::UnregisterForNiNodeUpdate, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("HasWorldModel", "Form", papyrusForm::HasWorldModel, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWorldModelPath", "Form", papyrusForm::GetWorldModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWorldModelPath", "Form", papyrusForm::SetWorldModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWorldModelNumTextureSets", "Form", papyrusForm::GetWorldModelNumTextureSets, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetWorldModelNthTextureSet", "Form", papyrusForm::GetWorldModelNthTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetWorldModelNthTextureSet", "Form", papyrusForm::SetWorldModelNthTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsPlayable", "Form", papyrusForm::IsPlayable, registry)); - - registry->SetFunctionFlags("Form", "SetPlayerKnows", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForAllKeys", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForAllMenus", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "SendModEvent", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForAllModEvents", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForControl", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForAllControls", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForCrosshairRef", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "RegisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "UnregisterForActorAction", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Form", "HasWorldModel", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusForm.h b/source/fs.dll/skse64/skse64/PapyrusForm.h deleted file mode 100644 index 4d11267e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusForm.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" - -class TESForm; -class BGSKeyword; -class VMClassRegistry; -class BGSTextureSet; - -namespace papyrusForm -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetType(TESForm* thisForm); - BSFixedString GetName(TESForm* thisForm); - void SetName(TESForm* thisForm, BSFixedString nuName); - float GetWeight(TESForm* thisForm); - void SetWeight(TESForm* thisForm, float nuWeight); - UInt32 GetBaseDamage(TESForm* thisForm); - UInt32 GetValue(TESForm* thisForm); - void SetGoldValue(TESForm* thisForm, UInt32 value); - UInt32 GetNumKeywords(TESForm* thisForm); - BGSKeyword* GetNthKeyword(TESForm* thisForm, UInt32 index); - void SetPlayerKnows(TESForm * thisForm, bool knows); - - //void UpdateKeys(UInt8 * data); - - void RegisterForMenu(TESForm * thisForm, BSFixedString menuName); - void UnregisterForMenu(TESForm * thisForm, BSFixedString menuName); - void UnregisterForAllMenus(TESForm * thisForm); - - //void RegisterForModEvent(TESForm * thisForm, BSFixedString eventName, BSFixedString callbackName); - //void UnregisterForModEvent(TESForm * thisForm, BSFixedString eventName); - //void UnregisterForAllModEvents(TESForm * thisForm); - //void SendModEvent(TESForm * thisForm, BSFixedString eventName, BSFixedString strArg, float numArg); - - void RegisterForKey(TESForm * thisForm, UInt32 key); - void UnregisterForKey(TESForm * thisForm, UInt32 key); - void UnregisterForAllKeys(TESForm * thisForm); - - void RegisterForControl(TESForm * thisForm, BSFixedString control); - void UnregisterForControl(TESForm * thisForm, UInt32 control); - void UnregisterForAllControls(TESForm * thisForm); - - //void RegisterForCameraState(TESForm * thisForm); - //void UnregisterForCameraState(TESForm * thisForm); - - void RegisterForCrosshairRef(TESForm * thisForm); - void UnregisterForCrosshairRef(TESForm * thisForm); - - bool HasWorldModel(TESForm * thisForm); - BSFixedString GetWorldModelPath(TESForm * thisForm); - void SetWorldModelPath(TESForm * thisForm, BSFixedString nuPath); - UInt32 GetWorldModelNumTextureSets(TESForm * thisForm); - BGSTextureSet* GetWorldModelNthTextureSet(TESForm * thisForm, UInt32 n); - void SetWorldModelNthTextureSet(TESForm * thisForm, BGSTextureSet* textureSet, UInt32 n); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusFormList.cpp b/source/fs.dll/skse64/skse64/PapyrusFormList.cpp deleted file mode 100644 index d11d95f7..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFormList.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "PapyrusFormList.h" -#include "PapyrusArgs.h" - -#include "GameForms.h" - -class FormListArray : public BGSListForm::Visitor -{ -public: - FormListArray(VMResultArray * result) : m_result(result) { } - - virtual bool Accept(TESForm * form) - { - m_result->push_back(form); - return false; - } - -private: - VMResultArray * m_result; -}; - -namespace papyrusFormList -{ - VMResultArray ToArray(BGSListForm * list) - { - VMResultArray result; - if(!list) - return result; - - FormListArray visitor(&result); - list->Visit(visitor); - return result; - } - - void AddForms(BGSListForm * list, VMArray forms) - { - if(list) - { - for(UInt32 i = 0; i < forms.Length(); i++) - { - TESForm * form = NULL; - forms.Get(&form, i); - if(form) - CALL_MEMBER_FN(list, AddFormToList)(form); - } - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusFormList::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 > ("ToArray", "FormList", papyrusFormList::ToArray, registry)); - - registry->RegisterFunction( - new NativeFunction1 > ("AddForms", "FormList", papyrusFormList::AddForms, registry)); - - registry->SetFunctionFlags("FormList", "ToArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("FormList", "AddForms", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusFormList.h b/source/fs.dll/skse64/skse64/PapyrusFormList.h deleted file mode 100644 index 235c39b3..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusFormList.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" -#include "skse64/PapyrusArgs.h" - -class BGSListForm; -class VMClassRegistry; - -namespace papyrusFormList -{ - void RegisterFuncs(VMClassRegistry* registry); - - VMResultArray ToArray(BGSListForm * list); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusGame.cpp b/source/fs.dll/skse64/skse64/PapyrusGame.cpp deleted file mode 100644 index f39f2628..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusGame.cpp +++ /dev/null @@ -1,975 +0,0 @@ -#include "PapyrusGame.h" -#include "PapyrusColorForm.h" - -#include "GameRTTI.h" -#include "GameAPI.h" -#include "GameReferences.h" -#include "GameData.h" -#include "GameSettings.h" -#include "GameForms.h" -#include "GameCamera.h" -#include "GameMenus.h" -#include "GameThreads.h" -#include "GameExtraData.h" - -#include "NiNodes.h" -#include "Colors.h" -#include "InternalTasks.h" - -#include "Hooks_Gameplay.h" -#include "Hooks_UI.h" - -namespace papyrusGame -{ - UInt32 GetPerkPoints(StaticFunctionTag*) - { - PlayerCharacter* pPC = (*g_thePlayer); - return pPC->numPerkPoints; - } - - void SetPerkPoints(StaticFunctionTag*, UInt32 points) - { - if(points > 255) // Not sure if signed or unsigned but this was only a byte in size - points = 255; - - PlayerCharacter* pPC = (*g_thePlayer); - pPC->numPerkPoints = points; - } - - void ModPerkPoints(StaticFunctionTag*, SInt32 points) - { - PlayerCharacter* pPC = (*g_thePlayer); - SInt32 nuPerkPoints = pPC->numPerkPoints + points; - if (nuPerkPoints < 0) - nuPerkPoints = 0; - else if (nuPerkPoints > 255) - nuPerkPoints = 255; - - pPC->numPerkPoints = nuPerkPoints; - } - - void SetPlayerExperience(StaticFunctionTag*, float points) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC->skills) { - pPC->skills->data->levelPoints = points; - } - } - - void SetPlayerLevel(StaticFunctionTag*, SInt32 level) - { - PlayerCharacter* pc = *g_thePlayer; - if (pc && pc->skills) - CALL_MEMBER_FN(pc->skills, SetLevel)(level); - } - - float GetPlayerExperience(StaticFunctionTag*) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC->skills) - return pPC->skills->data->levelPoints; - - return 0.0; - } - - float GetExperienceForLevel(StaticFunctionTag*, UInt32 level) - { - // fXPLevelUpMult * level + fXPLevelUpBase - double fXPLevelUpMult = 0.0; - double fXPLevelUpBase = 0.0; - SettingCollectionMap * settings = *g_gameSettingCollection; - if(settings) - { - Setting * levelUpBase = settings->Get("fXPLevelUpBase"); - if(levelUpBase) - levelUpBase->GetDouble(&fXPLevelUpBase); - Setting * levelUpMult = settings->Get("fXPLevelUpMult"); - if(levelUpMult) - levelUpMult->GetDouble(&fXPLevelUpMult); - } - - return fXPLevelUpBase + fXPLevelUpMult * level; - } - - UInt32 GetModCount(StaticFunctionTag*) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - return pDataHandler->modList.loadedMods.count; - } - - static const int LIGHT_MOD_OFFSET = 0x100; - - UInt32 GetModByName(StaticFunctionTag*, BSFixedString name) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = pDataHandler->LookupModByName(name.data); - if (!modInfo || !modInfo->IsActive()) - return 0xFF; - - if (modInfo->IsLight()) - return modInfo->lightIndex + LIGHT_MOD_OFFSET; - - return modInfo->modIndex; - } - - BSFixedString GetModName(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - ModInfo* modInfo = nullptr; - if (index > 0xFF) { - UInt32 adjusted = index - LIGHT_MOD_OFFSET; - if (adjusted >= pDataHandler->modList.loadedCCMods.count) - return ""; - pDataHandler->modList.loadedCCMods.GetNthItem(adjusted, modInfo); - - } else { - if (index >= pDataHandler->modList.loadedMods.count) - return ""; - pDataHandler->modList.loadedMods.GetNthItem(index, modInfo); - } - - return (modInfo) ? modInfo->name : ""; - } - - BSFixedString GetModAuthor(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - ModInfo* modInfo = nullptr; - if (index > 0xFF) { - UInt32 adjusted = index - LIGHT_MOD_OFFSET; - if (adjusted >= pDataHandler->modList.loadedCCMods.count) - return ""; - pDataHandler->modList.loadedCCMods.GetNthItem(adjusted, modInfo); - - } - else { - if (index >= pDataHandler->modList.loadedMods.count) - return ""; - pDataHandler->modList.loadedMods.GetNthItem(index, modInfo); - } - - return (modInfo) ? modInfo->author.Get() : ""; - } - - BSFixedString GetModDescription(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - ModInfo* modInfo = nullptr; - if (index > 0xFF) { - UInt32 adjusted = index - LIGHT_MOD_OFFSET; - if (adjusted >= pDataHandler->modList.loadedCCMods.count) - return ""; - pDataHandler->modList.loadedCCMods.GetNthItem(adjusted, modInfo); - - } - else { - if (index >= pDataHandler->modList.loadedMods.count) - return ""; - pDataHandler->modList.loadedMods.GetNthItem(index, modInfo); - } - return (modInfo) ? modInfo->description.Get() : ""; - } - - UInt32 GetModDependencyCount(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - ModInfo* modInfo = nullptr; - if (index > 0xFF) { - UInt32 adjusted = index - LIGHT_MOD_OFFSET; - if (adjusted >= pDataHandler->modList.loadedCCMods.count) - return 0; - pDataHandler->modList.loadedCCMods.GetNthItem(adjusted, modInfo); - - } - else { - if (index >= pDataHandler->modList.loadedMods.count) - return 0; - pDataHandler->modList.loadedMods.GetNthItem(index, modInfo); - } - return (modInfo) ? modInfo->numRefMods : 0; - } - - UInt32 GetNthModDependency(StaticFunctionTag*, UInt32 index, UInt32 dep_index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - ModInfo* modInfo = nullptr; - if (index > 0xFF) { - UInt32 adjusted = index - LIGHT_MOD_OFFSET; - if (adjusted >= pDataHandler->modList.loadedCCMods.count) - return 0; - pDataHandler->modList.loadedCCMods.GetNthItem(adjusted, modInfo); - - } - else { - if (index >= pDataHandler->modList.loadedMods.count) - return 0; - pDataHandler->modList.loadedMods.GetNthItem(index, modInfo); - } - return (modInfo && dep_index < modInfo->numRefMods) ? modInfo->refModInfo[dep_index]->modIndex : 0; - } - - UInt32 GetLightModCount(StaticFunctionTag*) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - return pDataHandler->modList.loadedCCMods.count; - } - - UInt32 GetLightModByName(StaticFunctionTag*, BSFixedString name) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = pDataHandler->LookupModByName(name.data); - if (!modInfo || !modInfo->IsActive() || !modInfo->IsLight()) - return 0xFFFF; - - return modInfo->lightIndex; - } - - BSFixedString GetLightModName(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - if (index >= pDataHandler->modList.loadedCCMods.count) - return ""; - - ModInfo* modInfo = nullptr; - pDataHandler->modList.loadedCCMods.GetNthItem(index, modInfo); - return (modInfo) ? modInfo->name : NULL; - } - - BSFixedString GetLightModAuthor(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - if (index >= pDataHandler->modList.loadedCCMods.count) - return ""; - - ModInfo* modInfo = NULL; - pDataHandler->modList.loadedCCMods.GetNthItem(index, modInfo); - return (modInfo) ? modInfo->author.Get() : NULL; - } - - BSFixedString GetLightModDescription(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - if (index >= pDataHandler->modList.loadedCCMods.count) - return ""; - - ModInfo* modInfo = NULL; - pDataHandler->modList.loadedCCMods.GetNthItem(index, modInfo); - return (modInfo) ? modInfo->description.Get() : NULL; - } - - UInt32 GetLightModDependencyCount(StaticFunctionTag*, UInt32 index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - if (index >= pDataHandler->modList.loadedCCMods.count) - return 0; - - ModInfo* modInfo = NULL; - pDataHandler->modList.loadedCCMods.GetNthItem(index, modInfo); - return (modInfo) ? modInfo->numRefMods : 0; - } - - UInt32 GetNthLightModDependency(StaticFunctionTag*, UInt32 index, UInt32 dep_index) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - if (index >= pDataHandler->modList.loadedCCMods.count) - return 0; - - ModInfo* modInfo = NULL; - pDataHandler->modList.loadedCCMods.GetNthItem(index, modInfo); - return (modInfo && dep_index < modInfo->numRefMods) ? modInfo->refModInfo[dep_index]->modIndex : 0; - } - - bool IsPluginInstalled(StaticFunctionTag*, BSFixedString name) - { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - - const ModInfo * modInfo = pDataHandler->LookupModByName(name.data); - if (modInfo) - return modInfo->IsActive(); - - return false; - } - - void SetGameSettingFloat(StaticFunctionTag * base, BSFixedString name, float value) - { - SettingCollectionMap * settings = *g_gameSettingCollection; - - if(settings) - { - Setting * setting = settings->Get(name.data); - if(setting) - { - if(!setting->SetDouble(value)) - { - _WARNING("SetGameSettingFloat: %s is not a float", name.data); - } - } - else - { - _WARNING("SetGameSettingFloat: %s not found", name.data); - } - } - } - - void SetGameSettingInt(StaticFunctionTag * base, BSFixedString name, UInt32 value) - { - SettingCollectionMap * settings = *g_gameSettingCollection; - - if(settings) - { - Setting * setting = settings->Get(name.data); - if(setting) - { - if(setting->GetType() == Setting::kType_Integer) - { - setting->data.u32 = value; - } - else - { - _WARNING("SetGameSettingInt: %s is not an int", name.data); - } - } - else - { - _WARNING("SetGameSettingInt: %s not found", name.data); - } - } - } - - void SetGameSettingBool(StaticFunctionTag * base, BSFixedString name, bool value) - { - SettingCollectionMap * settings = *g_gameSettingCollection; - - if(settings) - { - Setting * setting = settings->Get(name.data); - if(setting) - { - if(setting->GetType() == Setting::kType_Bool) - { - setting->data.u8 = value; - } - else - { - _WARNING("SetGameSettingBool: %s is not a bool", name.data); - } - } - else - { - _WARNING("SetGameSettingBool: %s not found", name.data); - } - } - } - - void SetGameSettingString(StaticFunctionTag * base, BSFixedString name, BSFixedString value) - { - SettingCollectionMap * settings = *g_gameSettingCollection; - - if(settings) - { - Setting * setting = settings->Get(name.data); - if(setting) - { - if(!setting->SetString(value.data)) - { - _WARNING("SetGameSettingString: %s is not a string", name.data); - } - } - else - { - _WARNING("SetGameSettingString: %s not found", name.data); - } - } - } - - void SaveGame(StaticFunctionTag * base, BSFixedString name) - { - BGSSaveLoadManager * mgr = BGSSaveLoadManager::GetSingleton(); - if(!mgr) - return; - - mgr->RequestSave(name.data); - } - - void LoadGame(StaticFunctionTag * base, BSFixedString name) - { - BGSSaveLoadManager * mgr = BGSSaveLoadManager::GetSingleton(); - if(!mgr) - return; - - mgr->RequestLoad(name.data); - } - - UInt32 GetNumTintMasks(StaticFunctionTag * base) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return 0; - } - return pPC->tintMasks.count; - } - - UInt32 GetNthTintMaskColor(StaticFunctionTag * base, UInt32 n) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return 0; - } - TintMask * tintMask = NULL; - if(pPC->tintMasks.GetNthItem(n, tintMask)) { - return tintMask->ToARGB(); - } - return 0; - } - - UInt32 GetNthTintMaskType(StaticFunctionTag * base, UInt32 n) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return 0; - } - TintMask * tintMask = NULL; - if(pPC->tintMasks.GetNthItem(n, tintMask)) { - return tintMask->tintType; - } - return 0; - } - - BSFixedString GetNthTintMaskTexturePath(StaticFunctionTag * base, UInt32 n) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return NULL; - } - TintMask * tintMask = NULL; - if(pPC->tintMasks.GetNthItem(n, tintMask)) { - if(tintMask->texture) { - return tintMask->texture->str; - } - } - - return NULL; - } - - void SetNthTintMaskTexturePath(StaticFunctionTag * base, BSFixedString path, UInt32 n) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC) { - TintMask * tintMask = NULL; - if(pPC->tintMasks.GetNthItem(n, tintMask)) { - if(tintMask->texture) { - tintMask->texture->str = path; - } - } - if(pPC->overlayTintMasks) { - if(pPC->overlayTintMasks->GetNthItem(n, tintMask)) { - if(tintMask->texture) { - tintMask->texture->str = path; - } - } - } - } - } - - void SetPlayerTintMaskColor(TESNPC* actorBase, TintMask * tintMask, UInt32 argb) - { - ARGBColor color(argb); - float alpha = color.GetAlpha() / 255.0; - if(alpha > 1.0) - alpha = 1.0; - if(alpha < 0.0) - alpha = 0.0; - - tintMask->color.red = color.GetRed(); - tintMask->color.green = color.GetGreen(); - tintMask->color.blue = color.GetBlue(); - tintMask->alpha = alpha; - - // Compute skintone - if(tintMask->tintType == TintMask::kMaskType_SkinTone) { - NiColorA colorResult; - CALL_MEMBER_FN(actorBase, SetSkinFromTint)(&colorResult, tintMask, true); - } - } - - void SetNthTintMaskColor(StaticFunctionTag * base, UInt32 n, UInt32 color) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC) { - TESNPC* npc = DYNAMIC_CAST(pPC->baseForm, TESForm, TESNPC); - if(npc) { - TintMask * tintMask = NULL; - if(pPC->tintMasks.GetNthItem(n, tintMask)) { - SetPlayerTintMaskColor(npc, tintMask, color); - } - if(pPC->overlayTintMasks) { - if(pPC->overlayTintMasks->GetNthItem(n, tintMask)) { - SetPlayerTintMaskColor(npc, tintMask, color); - } - } - } - } - } - - UInt32 GetNumTintMasksByType(StaticFunctionTag * base, UInt32 tintType) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return 0; - } - return CALL_MEMBER_FN(pPC, GetNumTints)(tintType); - } - - UInt32 GetTintMaskColor(StaticFunctionTag * base, UInt32 tintType, UInt32 index) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return 0; - } - - UInt32 color = 0; - TintMask * tintMask = CALL_MEMBER_FN(pPC, GetTintMask)(tintType, index); - if(tintMask) { - color = tintMask->ToARGB(); - } - - - return color; - } - - void SetTintMaskColor(StaticFunctionTag * base, UInt32 color, UInt32 tintType, UInt32 index) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC) { - TESNPC* npc = DYNAMIC_CAST(pPC->baseForm, TESForm, TESNPC); - if(npc) { - TintMask * tintMask = CALL_MEMBER_FN(pPC, GetTintMask)(tintType, index); - if(tintMask) { - SetPlayerTintMaskColor(npc, tintMask, color); - } - if(pPC->overlayTintMasks) { // Overlays don't always have types for some dumb reason - TintMask * overlayMask = pPC->GetOverlayTintMask(tintMask); - if(overlayMask) { - SetPlayerTintMaskColor(npc, overlayMask, color); - } - } - } - } - } - - BSFixedString GetTintMaskTexturePath(StaticFunctionTag * base, UInt32 tintType, UInt32 index) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC) { - return NULL; - } - TintMask * tintMask = CALL_MEMBER_FN(pPC, GetTintMask)(tintType, index); - if(tintMask && tintMask->texture) { - return tintMask->texture->str; - } - - return NULL; - } - - void SetTintMaskTexturePath(StaticFunctionTag * base, BSFixedString path, UInt32 tintType, UInt32 index) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC) { - TintMask * tintMask = CALL_MEMBER_FN(pPC, GetTintMask)(tintType, index); - if(tintMask && tintMask->texture) { - tintMask->texture->str = path; - } - if(pPC->overlayTintMasks) { - TintMask * overlayMask = pPC->GetOverlayTintMask(tintMask); - if(overlayMask && overlayMask->texture) { - overlayMask->texture->str = path; - } - } - } - } - - void UpdateTintMaskColors(StaticFunctionTag * base) - { - TaskInterface::UpdateTintMasks(); - } - - void UpdateHairColor(StaticFunctionTag * base) - { - TaskInterface::UpdateHairColor(); - } - - SInt32 GetCameraState(StaticFunctionTag * base) - { - PlayerCamera * playerCamera = PlayerCamera::GetSingleton(); - if (playerCamera) { - for (int i = 0; i < PlayerCamera::kNumCameraStates; i++) { - if (playerCamera->cameraState == playerCamera->cameraStates[i]) - return i; - } - } - - return -1; - } - - void SetMiscStat(StaticFunctionTag * base, BSFixedString name, UInt32 value) - { - MiscStatManager::MiscStat * stat = MiscStatManager::GetSingleton()->Get(name.data); - - if(stat) - stat->value = value; - else - _MESSAGE("SetMiscStat: could not find stat (%s)", name.data); - } - - void SetPlayersLastRiddenHorse(StaticFunctionTag * base, Actor* actor) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC) { - if(!actor) { - pPC->lastRiddenHorseHandle = 0; - } else { - pPC->lastRiddenHorseHandle = actor->CreateRefHandle(); - } - } - } - - bool GetPlayerMovementMode(StaticFunctionTag * base) - { - PlayerControls * controls = PlayerControls::GetSingleton(); - if(controls) { - return controls->runMode == 1; - } - - return false; - } - - void UpdateThirdPerson(StaticFunctionTag * base) - { - PlayerCharacter* pPC = (*g_thePlayer); - PlayerCamera * camera = PlayerCamera::GetSingleton(); - if (pPC && camera) { - CALL_MEMBER_FN(camera, UpdateThirdPerson)(pPC->actorState.IsWeaponDrawn()); - } - } - - void UnbindObjectHotkey(StaticFunctionTag * base, SInt32 hotkey) - { - MagicFavorites * magicFavorites = MagicFavorites::GetSingleton(); - if(magicFavorites) { - magicFavorites->ClearHotkey(hotkey); - } - - PlayerCharacter* pPC = (*g_thePlayer); - if(pPC && hotkey >= 0) { - ExtraContainerChanges* pContainerChanges = static_cast(pPC->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - HotkeyData data = pContainerChanges->FindHotkey(hotkey); - if(data.pHotkey) - data.pHotkey->hotkey = -1; - } - } - } - - TESForm * GetHotkeyBoundObject(StaticFunctionTag * base, SInt32 hotkey) - { - PlayerCharacter* pPC = (*g_thePlayer); - if(!pPC || hotkey < 0) - return NULL; - - MagicFavorites * magicFavorites = MagicFavorites::GetSingleton(); - if(magicFavorites) { - TESForm * form = magicFavorites->GetSpell(hotkey); - if(form) - return form; - } - - ExtraContainerChanges* pContainerChanges = static_cast(pPC->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - HotkeyData data = pContainerChanges->FindHotkey(hotkey); - if(data.pForm) - return data.pForm; - } - - return NULL; - } - - bool IsObjectFavorited(StaticFunctionTag * base, TESForm * form) - { - PlayerCharacter* player = (*g_thePlayer); - if (!player || !form) - return false; - - UInt8 formType = form->formType; - - // Spell or shout - check MagicFavorites - if (formType == kFormType_Spell || formType == kFormType_Shout) - { - MagicFavorites * magicFavorites = MagicFavorites::GetSingleton(); - - return magicFavorites && magicFavorites->IsFavorited(form); - } - // Other - check ExtraHotkey. Any hotkey data (including -1) means favorited - else - { - bool result = false; - - ExtraContainerChanges* pContainerChanges = static_cast(player->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - HotkeyData data = pContainerChanges->FindHotkey(form); - if (data.pHotkey) - result = true; - } - - return result; - } - } - - TESForm* GetFormEx(StaticFunctionTag * base, UInt32 formId) - { - return LookupFormByID(formId); - } - - TESObjectREFR * GetDialogueTarget(StaticFunctionTag * base) - { - MenuTopicManager * topicManager = MenuTopicManager::GetSingleton(); - return topicManager ? topicManager->GetDialogueTarget() : NULL; - } - - TESObjectREFR * GetCurrentCrosshairRef(StaticFunctionTag * base) - { - return Hooks_Gameplay_GetCrosshairRef(); - } - - TESObjectREFR * GetCurrentConsoleRef(StaticFunctionTag * base) - { - UInt32 handle = (*g_consoleHandle); - NiPointer refr; - if(handle != 0 && handle != (*g_invalidRefHandle)) { - LookupREFRByHandle(handle, refr); - return refr; - } - - return NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusGame::RegisterFuncs(VMClassRegistry* registry) -{ - // Perk Points - registry->RegisterFunction( - new NativeFunction0 ("GetPerkPoints", "Game", papyrusGame::GetPerkPoints, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetPerkPoints", "Game", papyrusGame::SetPerkPoints, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ModPerkPoints", "Game", papyrusGame::ModPerkPoints, registry)); - - - registry->RegisterFunction( - new NativeFunction0 ("GetPlayerExperience", "Game", papyrusGame::GetPlayerExperience, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetPlayerExperience", "Game", papyrusGame::SetPlayerExperience, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetExperienceForLevel", "Game", papyrusGame::GetExperienceForLevel, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetPlayerLevel", "Game", papyrusGame::SetPlayerLevel, registry)); - - - // Mods - registry->RegisterFunction( - new NativeFunction0 ("GetModCount", "Game", papyrusGame::GetModCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetModByName", "Game", papyrusGame::GetModByName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetModName", "Game", papyrusGame::GetModName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetModAuthor", "Game", papyrusGame::GetModAuthor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetModDescription", "Game", papyrusGame::GetModDescription, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetModDependencyCount", "Game", papyrusGame::GetModDependencyCount, registry)); - - // Light Mods - registry->RegisterFunction( - new NativeFunction0 ("GetLightModCount", "Game", papyrusGame::GetLightModCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetLightModByName", "Game", papyrusGame::GetLightModByName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetLightModName", "Game", papyrusGame::GetLightModName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetLightModAuthor", "Game", papyrusGame::GetLightModAuthor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetLightModDescription", "Game", papyrusGame::GetLightModDescription, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetLightModDependencyCount", "Game", papyrusGame::GetLightModDependencyCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsPluginInstalled", "Game", papyrusGame::IsPluginInstalled, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetNthLightModDependency", "Game", papyrusGame::GetNthLightModDependency, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetGameSettingFloat", "Game", papyrusGame::SetGameSettingFloat, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetGameSettingInt", "Game", papyrusGame::SetGameSettingInt, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetGameSettingBool", "Game", papyrusGame::SetGameSettingBool, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetGameSettingString", "Game", papyrusGame::SetGameSettingString, registry)); - - // Save/Load - registry->RegisterFunction( - new NativeFunction1 ("SaveGame", "Game", papyrusGame::SaveGame, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("LoadGame", "Game", papyrusGame::LoadGame, registry)); - - // Tintmasks - registry->RegisterFunction( - new NativeFunction0 ("GetNumTintMasks", "Game", papyrusGame::GetNumTintMasks, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthTintMaskColor", "Game", papyrusGame::GetNthTintMaskColor, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetNthTintMaskColor", "Game", papyrusGame::SetNthTintMaskColor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthTintMaskType", "Game", papyrusGame::GetNthTintMaskType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthTintMaskTexturePath", "Game", papyrusGame::GetNthTintMaskTexturePath, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetNthTintMaskTexturePath", "Game", papyrusGame::SetNthTintMaskTexturePath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNumTintsByType", "Game", papyrusGame::GetNumTintMasksByType, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetTintMaskColor", "Game", papyrusGame::GetTintMaskColor, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetTintMaskColor", "Game", papyrusGame::SetTintMaskColor, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetTintMaskTexturePath", "Game", papyrusGame::GetTintMaskTexturePath, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetTintMaskTexturePath", "Game", papyrusGame::SetTintMaskTexturePath, registry)); - - // Misc - registry->RegisterFunction( - new NativeFunction0 ("GetCameraState", "Game", papyrusGame::GetCameraState, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetMiscStat", "Game", papyrusGame::SetMiscStat, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetPlayersLastRiddenHorse", "Game", papyrusGame::SetPlayersLastRiddenHorse, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetPlayerMovementMode", "Game", papyrusGame::GetPlayerMovementMode, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UpdateThirdPerson", "Game", papyrusGame::UpdateThirdPerson, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetFormEx", "Game", papyrusGame::GetFormEx, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UpdateTintMaskColors", "Game", papyrusGame::UpdateTintMaskColors, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("UpdateHairColor", "Game", papyrusGame::UpdateHairColor, registry)); - - // Hotkeys - registry->RegisterFunction( - new NativeFunction1 ("UnbindObjectHotkey", "Game", papyrusGame::UnbindObjectHotkey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetHotkeyBoundObject", "Game", papyrusGame::GetHotkeyBoundObject, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsObjectFavorited", "Game", papyrusGame::IsObjectFavorited, registry)); - - // Dialogue - registry->RegisterFunction( - new NativeFunction0 ("GetDialogueTarget", "Game", papyrusGame::GetDialogueTarget, registry)); - - // Crosshair ref - registry->RegisterFunction( - new NativeFunction0 ("GetCurrentCrosshairRef", "Game", papyrusGame::GetCurrentCrosshairRef, registry)); - - // Console ref - registry->RegisterFunction( - new NativeFunction0 ("GetCurrentConsoleRef", "Game", papyrusGame::GetCurrentConsoleRef, registry)); - - // Mod - registry->SetFunctionFlags("Game", "GetModCount", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetModByName", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetModName", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetModAuthor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetModDescription", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetModDependencyCount", VMClassRegistry::kFunctionFlag_NoWait); - //registry->SetFunctionFlags("Game", "GetNthModDependency", VMClassRegistry::kFunctionFlag_NoWait); - - // GameSettings - registry->SetFunctionFlags("Game", "SetGameSettingFloat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetGameSettingInt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetGameSettingBool", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetGameSettingString", VMClassRegistry::kFunctionFlag_NoWait); - - // Save/Load - registry->SetFunctionFlags("Game", "SaveGame", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "LoadGame", VMClassRegistry::kFunctionFlag_NoWait); - - // Tintmasks - registry->SetFunctionFlags("Game", "GetNumTintMasks", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetNthTintMaskColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetNthTintMaskColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetNthTintMaskType", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetNthTintMaskTexturePath", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetNthTintMaskTexturePath", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetNumTintsByType", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetTintMaskColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetTintMaskColor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetTintMaskTexturePath", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetTintMaskTexturePath", VMClassRegistry::kFunctionFlag_NoWait); - - // Misc - registry->SetFunctionFlags("Game", "SetMiscStat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetCameraState", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetPlayersLastRiddenHorse", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetFormEx", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Game", "GetPlayerExperience", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "SetPlayerExperience", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Game", "GetExperienceForLevel", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Game", "GetDialogueTarget", VMClassRegistry::kFunctionFlag_NoWait); - - //registry->SetFunctionFlags("Game", "UpdateTintMaskColors", VMClassRegistry::kFunctionFlag_NoWait); - //registry->SetFunctionFlags("Game", "UpdateHairColor", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusGame.h b/source/fs.dll/skse64/skse64/PapyrusGame.h deleted file mode 100644 index 3233d3cc..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusGame.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -struct StaticFunctionTag; -class VMClassRegistry; -class Setting; -class Actor; -class TESForm; -class TESObjectREFR; - -#include "GameTypes.h" - -namespace papyrusGame -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetPerkPoints(StaticFunctionTag*); - void SetPerkPoints(StaticFunctionTag*, UInt32 perkPoints); - void ModPerkPoints(StaticFunctionTag*, SInt32 modPerkPointsBy); - - void SetPlayerLevelPoints(StaticFunctionTag*, float points); - float GetPlayerLevelPoints(StaticFunctionTag*); - float GetPointsForLevel(StaticFunctionTag*, UInt32 level); - - UInt32 GetModCount(StaticFunctionTag*); - UInt32 GetModByName(StaticFunctionTag*, BSFixedString name); - BSFixedString GetModName(StaticFunctionTag*, UInt32 index); - BSFixedString GetModAuthor(StaticFunctionTag*, UInt32 index); - BSFixedString GetModDescription(StaticFunctionTag*, UInt32 index); - UInt32 GetModDependencyCount(StaticFunctionTag*, UInt32 index); - UInt32 GetNthModDependency(StaticFunctionTag*, UInt32 index, UInt32 dep_index); - - void SetGameSettingFloat(StaticFunctionTag * base, BSFixedString name, float value); - void SetGameSettingInt(StaticFunctionTag * base, BSFixedString name, UInt32 value); - void SetGameSettingBool(StaticFunctionTag * base, BSFixedString name, bool value); - void SetGameSettingString(StaticFunctionTag * base, BSFixedString name, BSFixedString value); - - UInt32 GetNumTintMasks(StaticFunctionTag * base); - UInt32 GetNthTintMaskColor(StaticFunctionTag * base, UInt32 n); - void SetNthTintMaskColor(StaticFunctionTag * base, UInt32 n, UInt32 color); - UInt32 GetNthTintMaskType(StaticFunctionTag * base, UInt32 n); - BSFixedString GetNthTintMaskTexturePath(StaticFunctionTag * base, UInt32 n); - void SetNthTintMaskTexturePath(StaticFunctionTag * base, BSFixedString path, UInt32 n); - - UInt32 GetNumTintMasksByType(StaticFunctionTag * base, UInt32 tintType); - UInt32 GetTintMaskColor(StaticFunctionTag * base, UInt32 tintType, UInt32 index); - void SetTintMaskColor(StaticFunctionTag * base, UInt32 color, UInt32 tintType, UInt32 index); - BSFixedString GetTintMaskTexturePath(StaticFunctionTag * base, UInt32 tintType, UInt32 index); - void SetTintMaskTexturePath(StaticFunctionTag * base, BSFixedString path, UInt32 tintType, UInt32 index); - - void UpdateTintMaskColors(StaticFunctionTag * base); - - void SetMiscStat(StaticFunctionTag * base, BSFixedString name, UInt32 value); - void SetPlayersLastRiddenHorse(StaticFunctionTag * base, Actor* actor); - bool GetPlayerMovementMode(StaticFunctionTag * base); - - void UnbindObjectHotkey(StaticFunctionTag * base, SInt32 hotkey); - bool IsObjectHotkeyBound(StaticFunctionTag * base, SInt32 hotkey); - TESForm * GetHotkeyBoundObject(StaticFunctionTag * base, SInt32 hotkey); - - SInt32 GetSkillLegendaryLevel(StaticFunctionTag * base, BSFixedString actorValue); - void SetSkillLegendaryLevel(StaticFunctionTag * base, BSFixedString actorValue, UInt32 level); - - bool IsObjectFavorited(StaticFunctionTag * base, TESForm * form); - - TESForm* GetFormEx(StaticFunctionTag * base, UInt32 formId); - - TESObjectREFR* GetCurrentCrosshairRef(StaticFunctionTag * base); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusGameData.cpp b/source/fs.dll/skse64/skse64/PapyrusGameData.cpp deleted file mode 100644 index 2db28c7d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusGameData.cpp +++ /dev/null @@ -1,414 +0,0 @@ -#include "PapyrusGameData.h" - -#include "skse64/GameFormComponents.h" -#include "skse64/GameData.h" -#include "skse64/GameRTTI.h" -#include "skse64/GameForms.h" -#include "skse64/GameObjects.h" -#include "skse64/GameReferences.h" - -#include "skse64/PapyrusArgs.h" - -#include - -enum WeaponTypes -{ - kFilterType_HandToHandMelee = (1 << 0), - kFilterType_OneHandSword = (1 << 1), - kFilterType_OneHandDagger = (1 << 2), - kFilterType_OneHandAxe = (1 << 3), - kFilterType_OneHandMace = (1 << 4), - kFilterType_TwoHandSword = (1 << 5), - kFilterType_TwoHandAxe = (1 << 6), - kFilterType_Bow = (1 << 7), - kFilterType_Staff = (1 << 8), - kFilterType_CrossBow = (1 << 9) -}; - -#define IS_TYPE(weaponTypes, weapon, t, h, s) ((weaponTypes & t) == t) && (weapon->gameData.type == h || weapon->gameData.type == s) - -bool VerifyKeywords(TESForm * form, VMArray * keywords) -{ - if (keywords->Length() > 0) { - BGSKeywordForm* pKeywords = DYNAMIC_CAST(form, TESForm, BGSKeywordForm); - if (pKeywords) { - bool failed = false; - BGSKeyword * keyword = NULL; - for (UInt32 k = 0; k < keywords->Length(); k++) { - keywords->Get(&keyword, k); - if (keyword && !pKeywords->HasKeyword(keyword)) { - failed = true; - break; - } - } - - if (failed) - return false; - } - } - - return true; -} - -namespace papyrusGameData -{ - VMResultArray GetAllWeapons(StaticFunctionTag*, BSFixedString modName, VMArray keywords, bool playable, bool ignoreTemplates, bool ignoreEnchantments, bool onlyEnchanted, UInt32 weaponTypes) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - TESObjectWEAP * weapon = NULL; - for (UInt32 i = 0; i < dataHandler->weapons.count; i++) - { - dataHandler->weapons.GetNthItem(i, weapon); - - if (!modInfo->IsFormInMod(weapon->formID)) - continue; - if (playable != weapon->IsPlayable()) - continue; - if (ignoreTemplates && weapon->templateForm) - continue; - if (ignoreEnchantments && weapon->enchantable.enchantment) - continue; - if (onlyEnchanted && !weapon->enchantable.enchantment) - continue; - - if (!VerifyKeywords(weapon, &keywords)) - continue; - - bool accept = false; - if (IS_TYPE(weaponTypes, weapon, kFilterType_HandToHandMelee, TESObjectWEAP::GameData::kType_HandToHandMelee, TESObjectWEAP::GameData::kType_H2H)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_OneHandSword, TESObjectWEAP::GameData::kType_OneHandSword, TESObjectWEAP::GameData::kType_1HS)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_OneHandDagger, TESObjectWEAP::GameData::kType_OneHandDagger, TESObjectWEAP::GameData::kType_1HD)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_OneHandAxe, TESObjectWEAP::GameData::kType_OneHandAxe, TESObjectWEAP::GameData::kType_1HA)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_OneHandMace, TESObjectWEAP::GameData::kType_OneHandMace, TESObjectWEAP::GameData::kType_1HM)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_TwoHandSword, TESObjectWEAP::GameData::kType_TwoHandSword, TESObjectWEAP::GameData::kType_2HS)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_TwoHandAxe, TESObjectWEAP::GameData::kType_TwoHandAxe, TESObjectWEAP::GameData::kType_2HA)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_Bow, TESObjectWEAP::GameData::kType_Bow, TESObjectWEAP::GameData::kType_Bow2)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_Staff, TESObjectWEAP::GameData::kType_Staff, TESObjectWEAP::GameData::kType_Staff2)) - accept = true; - if (IS_TYPE(weaponTypes, weapon, kFilterType_CrossBow, TESObjectWEAP::GameData::kType_CrossBow, TESObjectWEAP::GameData::kType_CBow)) - accept = true; - if (!accept) - continue; - - result.push_back(weapon); - } - - return result; - } - - VMResultArray GetAllArmor(StaticFunctionTag*, BSFixedString modName, VMArray keywords, bool playable, bool ignoreTemplates, bool ignoreEnchantments, bool onlyEnchanted, bool ignoreSkin) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - std::set exclude; - if (ignoreSkin) { - TESRace * race = NULL; - for (UInt32 i = 0; i < dataHandler->races.count; i++) - { - dataHandler->races.GetNthItem(i, race); - if (race->skin.skin) - exclude.insert(race->skin.skin); - } - - TESNPC * npc = NULL; - for (UInt32 i = 0; i < dataHandler->npcs.count; i++) - { - dataHandler->npcs.GetNthItem(i, npc); - if (npc->skinForm.skin) - exclude.insert(npc->skinForm.skin); - } - } - - TESObjectARMO * armor = NULL; - for (UInt32 i = 0; i < dataHandler->armors.count; i++) - { - dataHandler->armors.GetNthItem(i, armor); - - if (!modInfo->IsFormInMod(armor->formID)) - continue; - if (ignoreSkin && exclude.find(armor) != exclude.end()) - continue; - if (playable != armor->IsPlayable()) - continue; - if (ignoreTemplates && armor->templateArmor) - continue; - if (ignoreEnchantments && armor->enchantable.enchantment) - continue; - if (onlyEnchanted && !armor->enchantable.enchantment) - continue; - if (!VerifyKeywords(armor, &keywords)) - continue; - - result.push_back(armor); - } - - - return result; - } - - VMResultArray GetAllAmmo(StaticFunctionTag*, BSFixedString modName, VMArray keywords, bool playable) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - - TESAmmo * ammo = NULL; - for (UInt32 i = 0; i < dataHandler->ammo.count; i++) - { - dataHandler->ammo.GetNthItem(i, ammo); - - if (!modInfo->IsFormInMod(ammo->formID)) - continue; - if (playable != ammo->IsPlayable()) - continue; - if (!VerifyKeywords(ammo, &keywords)) - continue; - - result.push_back(ammo); - } - - return result; - } - - VMResultArray GetAllBooks(StaticFunctionTag*, BSFixedString modName, VMArray keywords, bool regular, bool spellBook, bool skillBook) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - TESObjectBOOK * book = NULL; - for (UInt32 i = 0; i < dataHandler->books.count; i++) - { - dataHandler->books.GetNthItem(i, book); - - if (!modInfo->IsFormInMod(book->formID)) - continue; - - if (!VerifyKeywords(book, &keywords)) - continue; - - bool isSkillBook = book->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Skill; - bool isSpellBook = book->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Spell; - - bool accept = false; - if (regular && !isSkillBook && !isSpellBook) - accept = true; - if (spellBook && isSpellBook) - accept = true; - if (skillBook && isSkillBook) - accept = true; - if (!accept) - continue; - - - result.push_back(book); - } - - return result; - } - - VMResultArray GetAllPotions(StaticFunctionTag*, BSFixedString modName, VMArray keywords, bool potions, bool food, bool poison) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - AlchemyItem * potion = NULL; - for (UInt32 i = 0; i < dataHandler->potions.count; i++) - { - dataHandler->potions.GetNthItem(i, potion); - - if (!modInfo->IsFormInMod(potion->formID)) - continue; - - if (!VerifyKeywords(potion, &keywords)) - continue; - - bool isFood = potion->IsFood(); - bool isPoison = potion->IsPoison(); - - bool accept = false; - if (potions && !isFood && !isPoison) - accept = true; - if (food && isFood) - accept = true; - if (poison && isPoison) - accept = true; - if (!accept) - continue; - - - result.push_back(potion); - } - - return result; - } - - VMResultArray GetAllIngredients(StaticFunctionTag*, BSFixedString modName, VMArray keywords) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - IngredientItem * ingredient = NULL; - for (UInt32 i = 0; i < dataHandler->ingredients.count; i++) - { - dataHandler->ingredients.GetNthItem(i, ingredient); - - if (!modInfo->IsFormInMod(ingredient->formID)) - continue; - - if (!VerifyKeywords(ingredient, &keywords)) - continue; - - result.push_back(ingredient); - } - - return result; - } - - VMResultArray GetAllScrolls(StaticFunctionTag*, BSFixedString modName, VMArray keywords) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - ScrollItem * scroll = NULL; - for (UInt32 i = 0; i < dataHandler->scrolls.count; i++) - { - dataHandler->scrolls.GetNthItem(i, scroll); - - if (!modInfo->IsFormInMod(scroll->formID)) - continue; - - if (!VerifyKeywords(scroll, &keywords)) - continue; - - result.push_back(scroll); - } - - return result; - } - - VMResultArray GetAllKeys(StaticFunctionTag*, BSFixedString modName, VMArray keywords) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - - TESKey * key = NULL; - for (UInt32 i = 0; i < dataHandler->keys.count; i++) - { - dataHandler->keys.GetNthItem(i, key); - - if (!modInfo->IsFormInMod(key->formID)) - continue; - - if (!VerifyKeywords(key, &keywords)) - continue; - - result.push_back(key); - } - - return result; - } - - VMResultArray GetAllMiscItems(StaticFunctionTag*, BSFixedString modName, VMArray keywords) - { - VMResultArray result; - - DataHandler * dataHandler = DataHandler::GetSingleton(); - const ModInfo * modInfo = dataHandler->LookupModByName(modName.data); - if (!modInfo || !modInfo->IsActive()) - return result; - - TESObjectMISC * misc = NULL; - for (UInt32 i = 0; i < dataHandler->miscObjects.count; i++) - { - dataHandler->miscObjects.GetNthItem(i, misc); - - if (!modInfo->IsFormInMod(misc->formID)) - continue; - - if (!VerifyKeywords(misc, &keywords)) - continue; - - result.push_back(misc); - } - - return result; - } -} - -#include "skse64/PapyrusVM.h" -#include "skse64/PapyrusNativeFunctions.h" - -void papyrusGameData::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction7, BSFixedString, VMArray, bool, bool, bool, bool, UInt32>("GetAllWeapons", "GameData", papyrusGameData::GetAllWeapons, registry)); - - registry->RegisterFunction( - new NativeFunction7, BSFixedString, VMArray, bool, bool, bool, bool, bool>("GetAllArmor", "GameData", papyrusGameData::GetAllArmor, registry)); - - registry->RegisterFunction( - new NativeFunction3, BSFixedString, VMArray, bool>("GetAllAmmo", "GameData", papyrusGameData::GetAllAmmo, registry)); - - registry->RegisterFunction( - new NativeFunction5, BSFixedString, VMArray, bool, bool, bool>("GetAllBooks", "GameData", papyrusGameData::GetAllBooks, registry)); - - registry->RegisterFunction( - new NativeFunction5, BSFixedString, VMArray, bool, bool, bool>("GetAllPotions", "GameData", papyrusGameData::GetAllPotions, registry)); - - registry->RegisterFunction( - new NativeFunction2, BSFixedString, VMArray>("GetAllIngredients", "GameData", papyrusGameData::GetAllIngredients, registry)); - - registry->RegisterFunction( - new NativeFunction2, BSFixedString, VMArray>("GetAllScrolls", "GameData", papyrusGameData::GetAllScrolls, registry)); - - registry->RegisterFunction( - new NativeFunction2, BSFixedString, VMArray>("GetAllKeys", "GameData", papyrusGameData::GetAllKeys, registry)); - - registry->RegisterFunction( - new NativeFunction2, BSFixedString, VMArray>("GetAllMiscItems", "GameData", papyrusGameData::GetAllMiscItems, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusGameData.h b/source/fs.dll/skse64/skse64/PapyrusGameData.h deleted file mode 100644 index 9fba4366..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusGameData.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -class VMClassRegistry; -struct StaticFunctionTag; - -#include "skse64/GameTypes.h" - -namespace papyrusGameData -{ - void RegisterFuncs(VMClassRegistry* registry); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusHeadPart.cpp b/source/fs.dll/skse64/skse64/PapyrusHeadPart.cpp deleted file mode 100644 index aa286f4f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusHeadPart.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "PapyrusHeadPart.h" - -#include "GameObjects.h" -#include "GameData.h" - -#include "common/ICriticalSection.h" - -namespace papyrusHeadPart -{ - ICriticalSection s_headPartCacheLock; - typedef std::map HeadPartCache; - static HeadPartCache s_headPartCache; - - BGSHeadPart* GetHeadPart(StaticFunctionTag*, BSFixedString editorID) - { - s_headPartCacheLock.Enter(); - - if (s_headPartCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& headParts = pDataHandler->headParts; - for (UInt32 n = 0; n < headParts.count; n++) { - BGSHeadPart* pHeadPart = NULL; - headParts.GetNthItem(n, pHeadPart); - if (pHeadPart) { - s_headPartCache.insert(HeadPartCache::value_type(BSFixedString(pHeadPart->partName), pHeadPart)); - } - } - } - - s_headPartCacheLock.Leave(); - - HeadPartCache::iterator it = s_headPartCache.find(editorID); - BGSHeadPart* pHeadPart = (it != s_headPartCache.end()) ? it->second : NULL; - return pHeadPart; - } - - UInt32 GetType(BGSHeadPart* thisPart) - { - if(!thisPart) - return 0; - return thisPart->type; - } - - UInt32 GetNumExtraParts(BGSHeadPart* thisPart) - { - return (thisPart) ? thisPart->extraParts.count : 0; - } - - BGSHeadPart* GetNthExtraPart(BGSHeadPart* thisPart, UInt32 n) - { - BGSHeadPart* headPart; - if(!thisPart || !thisPart->extraParts.GetNthItem(n, headPart)) - return NULL; - - return headPart; - } - - bool IsExtraPart(BGSHeadPart* thisPart) - { - return (thisPart && thisPart->IsExtraPart()) ? true : false; - } - - bool HasExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart) - { - return (thisPart && thisPart->extraParts.GetItemIndex(extraPart) != -1) ? true : false; - } - - UInt32 GetIndexOfExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart) - { - return (thisPart) ? thisPart->extraParts.GetItemIndex(extraPart) : 0; - } - - BGSListForm* GetValidRaces(BGSHeadPart* thisPart) - { - return (thisPart) ? thisPart->validRaces : NULL; - } - - void SetValidRaces(BGSHeadPart* thisPart, BGSListForm* raceList) - { - if(thisPart && raceList) { - thisPart->validRaces = raceList; - } - } - - BSFixedString GetPartName(BGSHeadPart* thisPart) - { - return thisPart ? thisPart->partName : ""; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusHeadPart::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSHeadPart::kTypeID, "HeadPart"); - - registry->RegisterFunction( - new NativeFunction1("GetHeadPart", "HeadPart", papyrusHeadPart::GetHeadPart, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetType", "HeadPart", papyrusHeadPart::GetType, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumExtraParts", "HeadPart", papyrusHeadPart::GetNumExtraParts, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthExtraPart", "HeadPart", papyrusHeadPart::GetNthExtraPart, registry)); - - registry->RegisterFunction( - new NativeFunction1("HasExtraPart", "HeadPart", papyrusHeadPart::HasExtraPart, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsExtraPart", "HeadPart", papyrusHeadPart::IsExtraPart, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetIndexOfExtraPart", "HeadPart", papyrusHeadPart::GetIndexOfExtraPart, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetValidRaces", "HeadPart", papyrusHeadPart::GetValidRaces, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetValidRaces", "HeadPart", papyrusHeadPart::SetValidRaces, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetPartName", "HeadPart", papyrusHeadPart::GetPartName, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusHeadPart.h b/source/fs.dll/skse64/skse64/PapyrusHeadPart.h deleted file mode 100644 index f0114b01..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusHeadPart.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class BGSHeadPart; -class BGSListForm; -class VMClassRegistry; -struct StaticFunctionTag; - -namespace papyrusHeadPart -{ - void RegisterFuncs(VMClassRegistry* registry); - - BGSHeadPart* GetHeadPart(StaticFunctionTag*, BSFixedString editorID); - UInt32 GetType(BGSHeadPart* thisPart); - UInt32 GetNumExtraParts(BGSHeadPart* thisPart); - BGSHeadPart* GetNthExtraPart(BGSHeadPart* thisPart, UInt32 n); - bool HasExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart); - UInt32 GetIndexOfExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart); - BGSListForm* GetValidRaces(BGSHeadPart* thisPart); - void SetValidRaces(BGSHeadPart* thisPart, BGSListForm* raceList); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusIngredient.cpp b/source/fs.dll/skse64/skse64/PapyrusIngredient.cpp deleted file mode 100644 index 55249073..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusIngredient.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "PapyrusIngredient.h" -#include "PapyrusSpell.h" -#include "GameObjects.h" - -namespace papyrusIngredient -{ - - UInt32 GetNumEffects(IngredientItem* thisMagic) - { return magicItemUtils::GetNumEffects(thisMagic); } - - float GetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagnitude(thisMagic, index); } - - UInt32 GetNthEffectArea(IngredientItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectArea(thisMagic, index); } - - UInt32 GetNthEffectDuration(IngredientItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectDuration(thisMagic, index); } - - EffectSetting* GetNthEffectMagicEffect(IngredientItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagicEffect(thisMagic, index); } - - UInt32 GetCostliestEffectIndex(IngredientItem* thisMagic) - { return magicItemUtils::GetCostliestEffectIndex(thisMagic); } - - void SetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index, float value) - { magicItemUtils::SetNthEffectMagnitude(thisMagic, index, value); } - - void SetNthEffectArea(IngredientItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectArea(thisMagic, index, value); } - - void SetNthEffectDuration(IngredientItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectDuration(thisMagic, index, value); } - - // ahzaab 8-25-13 - bool GetIsNthEffectKnown(IngredientItem* thisMagic, UInt32 index) - { - bool isKnown = false; - if (!thisMagic) - return false; - switch (index) - { - case 0: - isKnown = ((thisMagic->knownEffects & IngredientItem::kType_FirstEffect) == IngredientItem::kType_FirstEffect); - break; - case 1: - isKnown = ((thisMagic->knownEffects & IngredientItem::kType_SecondEffect) == IngredientItem::kType_SecondEffect); - break; - case 2: - isKnown = ((thisMagic->knownEffects & IngredientItem::kType_ThirdEffect) == IngredientItem::kType_ThirdEffect); - break; - case 3: - isKnown = ((thisMagic->knownEffects & IngredientItem::kType_FourthEffect) == IngredientItem::kType_FourthEffect); - break; - default: - break; - } - return isKnown; - } - - VMResultArray GetEffectMagnitudes(IngredientItem* thisMagic) { return magicItemUtils::GetEffectMagnitudes(thisMagic); } - VMResultArray GetEffectAreas(IngredientItem* thisMagic) { return magicItemUtils::GetEffectAreas(thisMagic); } - VMResultArray GetEffectDurations(IngredientItem* thisMagic) { return magicItemUtils::GetEffectDurations(thisMagic); } - VMResultArray GetMagicEffects(IngredientItem* thisMagic) { return magicItemUtils::GetMagicEffects(thisMagic); } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusIngredient::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNumEffects", "Ingredient", papyrusIngredient::GetNumEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagnitude", "Ingredient", papyrusIngredient::GetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectArea", "Ingredient", papyrusIngredient::GetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectDuration", "Ingredient", papyrusIngredient::GetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagicEffect", "Ingredient", papyrusIngredient::GetNthEffectMagicEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCostliestEffectIndex", "Ingredient", papyrusIngredient::GetCostliestEffectIndex, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetIsNthEffectKnown", "Ingredient", papyrusIngredient::GetIsNthEffectKnown, registry)); - - // Sets - registry->RegisterFunction( - new NativeFunction2("SetNthEffectMagnitude", "Ingredient", papyrusIngredient::SetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectArea", "Ingredient", papyrusIngredient::SetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectDuration", "Ingredient", papyrusIngredient::SetNthEffectDuration, registry)); - - // Array gets - registry->RegisterFunction( - new NativeFunction0 >("GetEffectMagnitudes", "Ingredient", papyrusIngredient::GetEffectMagnitudes, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectAreas", "Ingredient", papyrusIngredient::GetEffectAreas, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectDurations", "Ingredient", papyrusIngredient::GetEffectDurations, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetMagicEffects", "Ingredient", papyrusIngredient::GetMagicEffects, registry)); - - registry->SetFunctionFlags("Ingredient", "GetNumEffects", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetNthEffectMagicEffect", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetCostliestEffectIndex", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetIsNthEffectKnown", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Ingredient", "SetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "SetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "SetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Ingredient", "GetEffectMagnitudes", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetEffectAreas", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetEffectDurations", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Ingredient", "GetMagicEffects", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusIngredient.h b/source/fs.dll/skse64/skse64/PapyrusIngredient.h deleted file mode 100644 index 004fbb46..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusIngredient.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -class IngredientItem; -class MagicItem; -class EffectSetting; -class VMClassRegistry; - -namespace papyrusIngredient -{ - void RegisterFuncs(VMClassRegistry* registry); - - // MagicItem funcs - UInt32 GetNumEffects(IngredientItem* thisMagic); - float GetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(IngredientItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(IngredientItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(IngredientItem* thisMagic, UInt32 index); - UInt32 GetCostliestEffectIndex(IngredientItem* thisMagic); - bool GetIsNthEffectKnown(IngredientItem* thisMagic, UInt32 index); - - void SetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index, float value); - void SetNthEffectArea(IngredientItem* thisMagic, UInt32 index, UInt32 value); - void SetNthEffectDuration(IngredientItem* thisMagic, UInt32 index, UInt32 value); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusInput.cpp b/source/fs.dll/skse64/skse64/PapyrusInput.cpp deleted file mode 100644 index f70718d9..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusInput.cpp +++ /dev/null @@ -1,204 +0,0 @@ -#include "skse64/PapyrusInput.h" -#include "skse64/GameInput.h" -#include "Hooks_DirectInput8Create.h" - -namespace papyrusInput -{ - bool IsKeyPressed(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - return DIHookControl::GetSingleton().IsKeyPressed(dxKeycode); - } - - void TapKey(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - //DIHookControl::GetSingleton().TapKey(dxKeycode); - DIHookControl::GetSingleton().BufferedKeyTap(dxKeycode); - } - - void HoldKey(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - //DIHookControl::GetSingleton().SetKeyHeldState(dxKeycode, true); - DIHookControl::GetSingleton().BufferedKeyPress(dxKeycode); - } - - void ReleaseKey(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - //DIHookControl::GetSingleton().SetKeyHeldState(dxKeycode, false); - DIHookControl::GetSingleton().BufferedKeyRelease(dxKeycode); - } - - bool IsKeyHeld(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - return DIHookControl::GetSingleton().IsKeyHeld(dxKeycode); - } - - void DisableKey(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - DIHookControl::GetSingleton().SetKeyDisableState(dxKeycode, true, 0); - } - - void EnableKey(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - DIHookControl::GetSingleton().SetKeyDisableState(dxKeycode, false, 0); - } - - bool IsKeyDisabled(StaticFunctionTag* thisInput, UInt32 dxKeycode) - { - return DIHookControl::GetSingleton().IsKeyDisabled(dxKeycode); - } - - UInt32 GetNumKeysPressed(StaticFunctionTag* thisInput) - { - return DIHookControl::GetSingleton().GetNumKeysPressed(); - } - - SInt32 GetNthKeyPressed(StaticFunctionTag* thisInput, UInt32 which) - { - return DIHookControl::GetSingleton().GetNthKeyPressed(which); - } - - //UInt32 GetNumMouseButtonsPressed(StaticFunctionTag* thisInput); - //UInt32 GetMouseButtonPressed(StaticFunctionTag* thisInput, UInt32 which); - - //void DisableMouse(StaticFunctionTag* thisInput); - //void EnableMouse(StaticFunctionTag* thisInput); - //bool IsMouseDisabled(StaticFunctionTag* thisInput); - - SInt32 GetMappedKey(StaticFunctionTag* thisInput, BSFixedString name, UInt32 deviceType) - { - InputManager * inputManager = InputManager::GetSingleton(); - if (!inputManager) - return -1; - - UInt32 key = 0xFF; - - // Manual device selection - if (deviceType != 0xFF) - { - key = inputManager->GetMappedKey(name, deviceType, InputManager::kContext_Gameplay); - } - // Auto-selected device - else - { - // Gamepad - InputEventDispatcher *inputEventDispatcher = InputEventDispatcher::GetSingleton(); - if (inputEventDispatcher && inputEventDispatcher->IsGamepadEnabled()) - { - deviceType = kDeviceType_Gamepad; - key = inputManager->GetMappedKey(name, kDeviceType_Gamepad, InputManager::kContext_Gameplay); - } - // Mouse + Keyboard - else - { - deviceType = kDeviceType_Keyboard; - key = inputManager->GetMappedKey(name, deviceType, InputManager::kContext_Gameplay); - if (key == 0xFF) - { - deviceType = kDeviceType_Mouse; - key = inputManager->GetMappedKey(name, deviceType, InputManager::kContext_Gameplay); - } - } - } - - if (key == 0xFF) - return -1; - - // Map to common value space - if (deviceType == kDeviceType_Mouse) - { - return key + InputMap::kMacro_MouseButtonOffset; - } - else if (deviceType == kDeviceType_Gamepad) - { - UInt32 mapped = InputMap::GamepadMaskToKeycode(key); - return (mapped != InputMap::kMaxMacros ? mapped : -1); - } - else - { - return key; - } - } - - BSFixedString GetMappedControl(StaticFunctionTag* thisInput, SInt32 keyCode) - { - if (keyCode < 0 || keyCode >= InputMap::kMaxMacros) - return BSFixedString(); - - InputManager * inputManager = InputManager::GetSingleton(); - if (!inputManager) - return BSFixedString(); - - UInt32 buttonID; - UInt32 deviceType; - - if (keyCode >= InputMap::kMacro_GamepadOffset) - { - buttonID = InputMap::GamepadKeycodeToMask(keyCode); - deviceType = kDeviceType_Gamepad; - } - else if (keyCode >= InputMap::kMacro_MouseButtonOffset) - { - buttonID = keyCode - InputMap::kMacro_MouseButtonOffset; - deviceType = kDeviceType_Mouse; - } - else - { - buttonID = keyCode; - deviceType = kDeviceType_Keyboard; - } - - return inputManager->GetMappedControl(buttonID, deviceType, InputManager::kContext_Gameplay); - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusInput::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("IsKeyPressed", "Input", papyrusInput::IsKeyPressed, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("TapKey", "Input", papyrusInput::TapKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("HoldKey", "Input", papyrusInput::HoldKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ReleaseKey", "Input", papyrusInput::ReleaseKey, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumKeysPressed", "Input", papyrusInput::GetNumKeysPressed, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthKeyPressed", "Input", papyrusInput::GetNthKeyPressed, registry)); - - - //registry->RegisterFunction( - // new NativeFunction1 ("IsKeyHeld", "Input", papyrusInput::IsKeyHeld, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("IsKeyDisabeld", "Input", papyrusInput::IsKeyDisabled, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("DisableKey", "Input", papyrusInput::DisableKey, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("EnableKey", "Input", papyrusInput::EnableKey, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetMappedKey", "Input", papyrusInput::GetMappedKey, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetMappedControl", "Input", papyrusInput::GetMappedControl, registry)); - - registry->SetFunctionFlags("Input", "IsKeyPressed", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "TapKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "HoldKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "ReleaseKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "GetNumKeysPressed", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "GetNthKeyPressed", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "GetMappedKey", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Input", "GetMappedControl", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusInput.h b/source/fs.dll/skse64/skse64/PapyrusInput.h deleted file mode 100644 index 08a79c2a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusInput.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -struct StaticFunctionTag; - -class VMClassRegistry; - -namespace papyrusInput -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool IsKeyPressed(StaticFunctionTag* thisInput, UInt32 dxKeycode); - - void TapKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); - - void HoldKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); - void ReleaseKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); - bool IsKeyHeld(StaticFunctionTag* thisInput, UInt32 dxKeycode); - - void DisableKey(StaticFunctionTag* thisInput, UInt32 dxKeyode); - void EnableKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); - bool IsKeyDisabled(StaticFunctionTag* thisInput, UInt32 dxKeycode); - - UInt32 GetNumKeysPressed(StaticFunctionTag* thisInput); - SInt32 GetNthKeyPressed(StaticFunctionTag* thisInput, UInt32 which); - - //UInt32 GetNumMouseButtonsPressed(Input* thisInput); - //UInt32 GetMouseButtonPressed(Input* thisInput, UInt32 which); - - //void DisableMouse(Input* thisInput); - //void EnableMouse(Input* thisInput); - //bool IsMouseDisabled(Input* thisInput); - - SInt32 GetMappedKey(StaticFunctionTag* thisInput, BSFixedString name, UInt32 deviceType); - BSFixedString GetMappedControl(StaticFunctionTag* thisInput, SInt32 keyCode); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusInterfaces.cpp b/source/fs.dll/skse64/skse64/PapyrusInterfaces.cpp deleted file mode 100644 index 904a8af7..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusInterfaces.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "skse64/PapyrusInterfaces.h" - -// B085C9577FC3BACF4719EF79E3613E2327537C10+4F -RelocPtr g_objectHandlePolicy(0x0326BBB0); diff --git a/source/fs.dll/skse64/skse64/PapyrusInterfaces.h b/source/fs.dll/skse64/skse64/PapyrusInterfaces.h deleted file mode 100644 index f535ac3f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusInterfaces.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include "skse64_common/Relocation.h" -#include "skse64_common/Utilities.h" - -class VMIdentifier; - -class IObjectHandlePolicy -{ -public: - IObjectHandlePolicy(); - virtual ~IObjectHandlePolicy(); - - // this code heavily uses 64-bit values, so many of these arguments may be paired 64-bit (eax/edx) - virtual bool IsType(UInt32 typeID, UInt64 handle); - virtual bool Unk_02(UInt64 handle); - virtual UInt64 GetInvalidHandle(void); - virtual UInt64 Create(UInt32 typeID, void * srcData); - virtual bool IsREFR(UInt64 handle); // return IsType(TESObjectREFR::kTypeID, handle); - virtual UInt64 Unk_06(UInt32 unk0, UInt32 unk1); - virtual UInt64 Unk_07(UInt32 unk0, UInt32 unk1); - virtual void * Resolve(UInt32 typeID, UInt64 handle); - virtual void AddRef(UInt64 handle); - virtual void Release(UInt64 handle); - virtual void GetName(UInt64 handle, void * outStr); - - // void ** _vtbl; // 00 -}; - -extern RelocPtr g_objectHandlePolicy; - -class ObjectBindPolicy -{ -public: - ObjectBindPolicy(); - virtual ~ObjectBindPolicy(); - - virtual void Unk_01(UInt64 unk); - virtual void Unk_02(UInt64 unk); - virtual void Unk_03(UInt64 unk); - virtual void Unk_04(void); - virtual UInt32 Unk_05(UInt32 unk0, UInt32 unk1); - virtual void Unk_06(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); - virtual void Unk_07(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4, UInt32 unk5); - virtual bool Unk_08(void); - virtual void Unk_09(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); - virtual void Unk_0A(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); - virtual void Unk_0B(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4); - virtual void Unk_0C(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4); - - // void ** _vtbl; // 00 - - MEMBER_FN_PREFIX(ObjectBindPolicy); - DEFINE_MEMBER_FN(BindObject, void, 0x0135A430, VMIdentifier ** identifier, UInt64 handle); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusKeyword.cpp b/source/fs.dll/skse64/skse64/PapyrusKeyword.cpp deleted file mode 100644 index 9eaad0ce..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusKeyword.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "PapyrusKeyword.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameData.h" - -#include "common/ICriticalSection.h" - -//extern UInt32 g_invalidateKeywordCache; - -namespace papyrusKeyword -{ - typedef std::map KeywordCache; - - static ICriticalSection s_keywordCacheLock; - static KeywordCache s_keywordCache; - - BGSKeyword* GetKeyword(StaticFunctionTag*, BSFixedString keyword) - { - s_keywordCacheLock.Enter(); - - //if(g_invalidateKeywordCache == 1) { - //s_keywordCache.clear(); - //g_invalidateKeywordCache = 0; - //} - - if (s_keywordCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& keywords = pDataHandler->keywords; - for (UInt32 n = 0; n < keywords.count; n++) { - BGSKeyword* pKeyword = NULL; - keywords.GetNthItem(n, pKeyword); - if (pKeyword) { - s_keywordCache.insert(KeywordCache::value_type(BSFixedString(pKeyword->keyword.Get()), pKeyword)); - } - } - } - - s_keywordCacheLock.Leave(); - - KeywordCache::iterator it = s_keywordCache.find(keyword); - BGSKeyword* pKeyword = (it != s_keywordCache.end()) ? it->second : NULL; - return pKeyword; - } - - - BSFixedString GetString(BGSKeyword* thisKeyword) - { - return (thisKeyword) ? thisKeyword->keyword.Get() : NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusKeyword::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetString", "Keyword", papyrusKeyword::GetString, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetKeyword", "Keyword", papyrusKeyword::GetKeyword, registry)); - -} diff --git a/source/fs.dll/skse64/skse64/PapyrusKeyword.h b/source/fs.dll/skse64/skse64/PapyrusKeyword.h deleted file mode 100644 index 1140494f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusKeyword.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class BGSKeyword; -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusKeyword -{ - void RegisterFuncs(VMClassRegistry* registry); - - BGSKeyword* GetKeyword(StaticFunctionTag*, BSFixedString keyword); - BSFixedString GetString(BGSKeyword* thisKeyword); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledActor.cpp b/source/fs.dll/skse64/skse64/PapyrusLeveledActor.cpp deleted file mode 100644 index 9027c2a9..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledActor.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "PapyrusLeveledActor.h" -#include "PapyrusLeveledItem.h" -#include "GameObjects.h" - -namespace papyrusLeveledActor -{ - UInt32 GetNumForms(TESLevCharacter * leveledItem) - { return leveledItemUtils::GetNumForms(&leveledItem->leveledList); } - - TESForm * GetNthForm(TESLevCharacter * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthForm(&leveledItem->leveledList, n); } - - UInt32 GetNthLevel(TESLevCharacter * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthLevel(&leveledItem->leveledList, n); } - - void SetNthLevel(TESLevCharacter * leveledItem, UInt32 n, UInt32 level) - { return leveledItemUtils::SetNthLevel(&leveledItem->leveledList, n, level); } - - UInt32 GetNthCount(TESLevCharacter * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthCount(&leveledItem->leveledList, n); } - - void SetNthCount(TESLevCharacter * leveledItem, UInt32 n, UInt32 count) - { return leveledItemUtils::SetNthCount(&leveledItem->leveledList, n, count); } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusLeveledActor::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNumForms", "LeveledActor", papyrusLeveledActor::GetNumForms, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthForm", "LeveledActor", papyrusLeveledActor::GetNthForm, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthLevel", "LeveledActor", papyrusLeveledActor::GetNthLevel, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthLevel", "LeveledActor", papyrusLeveledActor::SetNthLevel, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthCount", "LeveledActor", papyrusLeveledActor::GetNthCount, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthCount", "LeveledActor", papyrusLeveledActor::SetNthCount, registry)); - - registry->SetFunctionFlags("LeveledActor", "GetNumForms", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledActor", "GetNthForm", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledActor", "GetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledActor", "SetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledActor", "GetNthCount", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledActor", "SetNthCount", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledActor.h b/source/fs.dll/skse64/skse64/PapyrusLeveledActor.h deleted file mode 100644 index 2394dcd2..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledActor.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESLevCharacter; -class TESGlobal; -class TESForm; - -namespace papyrusLeveledActor -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetChanceNone(TESLevCharacter * leveledItem); - void SetChanceNone(TESLevCharacter * leveledItem, UInt32 chanceNone); - - UInt32 GetNumForms(TESLevCharacter * leveledItem); - TESForm * GetNthForm(TESLevCharacter * leveledItem, UInt32 n); - UInt32 GetNthLevel(TESLevCharacter * leveledItem, UInt32 n); - void SetNthLevel(TESLevCharacter * leveledItem, UInt32 n, UInt32 level); -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledItem.cpp b/source/fs.dll/skse64/skse64/PapyrusLeveledItem.cpp deleted file mode 100644 index c8eb4e48..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledItem.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include "PapyrusLeveledItem.h" - -#include "GameObjects.h" -#include "GameReferences.h" - -namespace papyrusLeveledItem -{ - UInt32 GetChanceNone(TESLevItem * leveledItem) - { return leveledItemUtils::GetChanceNone(&leveledItem->leveledList); } - - void SetChanceNone(TESLevItem * leveledItem, UInt32 chanceNone) - { leveledItemUtils::SetChanceNone(&leveledItem->leveledList, chanceNone); } - - TESGlobal * GetChanceGlobal(TESLevItem * leveledItem) - { return leveledItemUtils::GetChanceGlobal(&leveledItem->leveledList); } - - void SetChanceGlobal(TESLevItem * leveledItem, TESGlobal * globalVar) - { leveledItemUtils::SetChanceGlobal(&leveledItem->leveledList, globalVar); } - - UInt32 GetNumForms(TESLevItem * leveledItem) - { return leveledItemUtils::GetNumForms(&leveledItem->leveledList); } - - TESForm * GetNthForm(TESLevItem * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthForm(&leveledItem->leveledList, n); } - - UInt32 GetNthLevel(TESLevItem * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthLevel(&leveledItem->leveledList, n); } - - void SetNthLevel(TESLevItem * leveledItem, UInt32 n, UInt32 level) - { return leveledItemUtils::SetNthLevel(&leveledItem->leveledList, n, level); } - - UInt32 GetNthCount(TESLevItem * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthCount(&leveledItem->leveledList, n); } - - void SetNthCount(TESLevItem * leveledItem, UInt32 n, UInt32 count) - { return leveledItemUtils::SetNthCount(&leveledItem->leveledList, n, count); } -} - -namespace leveledItemUtils -{ - UInt32 GetChanceNone(TESLeveledList * leveledList) - { - return leveledList->chanceValue; - } - - void SetChanceNone(TESLeveledList * leveledList, UInt32 chanceNone) - { - leveledList->chanceValue = chanceNone; - } - - TESGlobal * GetChanceGlobal(TESLeveledList * leveledList) - { - return leveledList->chanceGlobal; - } - - void SetChanceGlobal(TESLeveledList * leveledList, TESGlobal * globalVar) - { - leveledList->chanceGlobal = globalVar; - } - - UInt32 GetNumForms(TESLeveledList * leveledList) - { - return leveledList->length; - } - - TESForm * GetNthForm(TESLeveledList * leveledList, UInt32 n) - { - return (n < leveledList->length) ? leveledList->entries[n].form : NULL; - } - - UInt32 GetNthLevel(TESLeveledList * leveledList, UInt32 n) - { - return (n < leveledList->length) ? leveledList->entries[n].level : 0; - } - - void SetNthLevel(TESLeveledList * leveledList, UInt32 n, UInt32 level) - { - if(n < leveledList->length) { - if(level > 0xFFFF) - level = 0xFFFF; - - leveledList->entries[n].level = level; - } - } - - UInt32 GetNthCount(TESLeveledList * leveledList, UInt32 n) - { - return (n < leveledList->length) ? leveledList->entries[n].count : 0; - } - - void SetNthCount(TESLeveledList * leveledList, UInt32 n, UInt32 count) - { - if(n < leveledList->length) { - if(count > 0xFFFF) - count = 0xFFFF; - - leveledList->entries[n].count = count; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusLeveledItem::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetChanceNone", "LeveledItem", papyrusLeveledItem::GetChanceNone, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetChanceNone", "LeveledItem", papyrusLeveledItem::SetChanceNone, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetChanceGlobal", "LeveledItem", papyrusLeveledItem::GetChanceGlobal, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetChanceGlobal", "LeveledItem", papyrusLeveledItem::SetChanceGlobal, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetNumForms", "LeveledItem", papyrusLeveledItem::GetNumForms, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthForm", "LeveledItem", papyrusLeveledItem::GetNthForm, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthLevel", "LeveledItem", papyrusLeveledItem::GetNthLevel, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthLevel", "LeveledItem", papyrusLeveledItem::SetNthLevel, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthCount", "LeveledItem", papyrusLeveledItem::GetNthCount, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthCount", "LeveledItem", papyrusLeveledItem::SetNthCount, registry)); - - registry->SetFunctionFlags("LeveledItem", "GetChanceNone", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "SetChanceNone", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("LeveledItem", "GetChanceGlobal", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "SetChanceGlobal", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("LeveledItem", "GetNumForms", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "GetNthForm", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "GetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "SetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "GetNthCount", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledItem", "SetNthCount", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledItem.h b/source/fs.dll/skse64/skse64/PapyrusLeveledItem.h deleted file mode 100644 index e981f5c5..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledItem.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESLeveledList; -class TESLevItem; -class TESGlobal; -class TESForm; - -namespace papyrusLeveledItem -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetChanceNone(TESLevItem * leveledItem); - void SetChanceNone(TESLevItem * leveledItem, UInt32 chanceNone); - - TESGlobal * GetChanceGlobal(TESLevItem * leveledItem); - void SetChanceGlobal(TESLevItem * leveledItem, TESGlobal * globalVar); - - UInt32 GetNumForms(TESLevItem * leveledItem); - TESForm * GetNthForm(TESLevItem * leveledItem, UInt32 n); - UInt32 GetNthLevel(TESLevItem * leveledItem, UInt32 n); - void SetNthLevel(TESLevItem * leveledItem, UInt32 n, UInt32 level); - UInt32 GetNthCount(TESLevItem * leveledItem, UInt32 n); - void SetNthCount(TESLevItem * leveledItem, UInt32 n, UInt32 count); -}; - -namespace leveledItemUtils { - UInt32 GetChanceNone(TESLeveledList * leveledList); - void SetChanceNone(TESLeveledList * leveledList, UInt32 chanceNone); - TESGlobal * GetChanceGlobal(TESLeveledList * leveledList); - void SetChanceGlobal(TESLeveledList * leveledList, TESGlobal * globalVar); - UInt32 GetNumForms(TESLeveledList * leveledList); - TESForm * GetNthForm(TESLeveledList * leveledList, UInt32 n); - UInt32 GetNthLevel(TESLeveledList * leveledList, UInt32 n); - void SetNthLevel(TESLeveledList * leveledList, UInt32 n, UInt32 level); - UInt32 GetNthCount(TESLeveledList * leveledList, UInt32 n); - void SetNthCount(TESLeveledList * leveledList, UInt32 n, UInt32 count); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.cpp b/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.cpp deleted file mode 100644 index 2b17b4b3..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "PapyrusLeveledSpell.h" -#include "PapyrusLeveledItem.h" -#include "GameObjects.h" - -namespace papyrusLeveledSpell -{ - UInt32 GetChanceNone(TESLevSpell * leveledItem) - { return leveledItemUtils::GetChanceNone(&leveledItem->leveledList); } - - void SetChanceNone(TESLevSpell * leveledItem, UInt32 chanceNone) - { leveledItemUtils::SetChanceNone(&leveledItem->leveledList, chanceNone); } - - UInt32 GetNumForms(TESLevSpell * leveledItem) - { return leveledItemUtils::GetNumForms(&leveledItem->leveledList); } - - TESForm * GetNthForm(TESLevSpell * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthForm(&leveledItem->leveledList, n); } - - UInt32 GetNthLevel(TESLevSpell * leveledItem, UInt32 n) - { return leveledItemUtils::GetNthLevel(&leveledItem->leveledList, n); } - - void SetNthLevel(TESLevSpell * leveledItem, UInt32 n, UInt32 level) - { return leveledItemUtils::SetNthLevel(&leveledItem->leveledList, n, level); } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusLeveledSpell::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetChanceNone", "LeveledSpell", papyrusLeveledSpell::GetChanceNone, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetChanceNone", "LeveledSpell", papyrusLeveledSpell::SetChanceNone, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumForms", "LeveledSpell", papyrusLeveledSpell::GetNumForms, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthForm", "LeveledSpell", papyrusLeveledSpell::GetNthForm, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthLevel", "LeveledSpell", papyrusLeveledSpell::GetNthLevel, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthLevel", "LeveledSpell", papyrusLeveledSpell::SetNthLevel, registry)); - - registry->SetFunctionFlags("LeveledSpell", "GetChanceNone", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledSpell", "SetChanceNone", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("LeveledSpell", "GetNumForms", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledSpell", "GetNthForm", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledSpell", "GetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("LeveledSpell", "SetNthLevel", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.h b/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.h deleted file mode 100644 index 26e6ec31..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLeveledSpell.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESLevSpell; -class TESGlobal; -class TESForm; - -namespace papyrusLeveledSpell -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetChanceNone(TESLevSpell * leveledItem); - void SetChanceNone(TESLevSpell * leveledItem, UInt32 chanceNone); - - UInt32 GetNumForms(TESLevSpell * leveledItem); - TESForm * GetNthForm(TESLevSpell * leveledItem, UInt32 n); - UInt32 GetNthLevel(TESLevSpell * leveledItem, UInt32 n); - void SetNthLevel(TESLevSpell * leveledItem, UInt32 n, UInt32 level); -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusLocation.cpp b/source/fs.dll/skse64/skse64/PapyrusLocation.cpp deleted file mode 100644 index 58393f9b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLocation.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "PapyrusLocation.h" - -#include "GameForms.h" - -namespace papyrusLocation -{ - BGSLocation * GetParent(BGSLocation* thisLocation) - { - return thisLocation ? thisLocation->parentLoc : NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusLocation::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetParent", "Location", papyrusLocation::GetParent, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusLocation.h b/source/fs.dll/skse64/skse64/PapyrusLocation.h deleted file mode 100644 index 5fe3a36a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusLocation.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -class VMClassRegistry; -class BGSLocation; - -namespace papyrusLocation -{ - BGSLocation * GetParent(BGSLocation* thisLocation); - void RegisterFuncs(VMClassRegistry* registry); -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusMagicEffect.cpp b/source/fs.dll/skse64/skse64/PapyrusMagicEffect.cpp deleted file mode 100644 index 494a5a1a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMagicEffect.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "PapyrusMagicEffect.h" -#include "PapyrusArgs.h" - -#include "GameData.h" -#include "GameObjects.h" -#include "GameReferences.h" - -namespace papyrusMagicEffect -{ - bool IsEffectFlagSet(EffectSetting* thisEffect, UInt32 flag) - { - return (thisEffect) ? (thisEffect->properties.flags & flag) == flag : false; - } - - void SetEffectFlag(EffectSetting* thisEffect, UInt32 flag) - { - if (thisEffect) - thisEffect->properties.flags |= flag; - } - - void ClearEffectFlag(EffectSetting* thisEffect, UInt32 flag) - { - if (thisEffect) - thisEffect->properties.flags &= ~flag; - } - - float GetCastTime(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.castingTime : 0.0; - } - - void SetCastTime(EffectSetting* thisEffect, float castTime) - { - if(thisEffect) - thisEffect->properties.castingTime = castTime; - } - - UInt32 GetSkillLevel(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.level : 0; - } - - void SetSkillLevel(EffectSetting* thisEffect, UInt32 level) - { - if(thisEffect) - thisEffect->properties.level = level; - } - - UInt32 GetArea(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.area : 0; - } - - void SetArea(EffectSetting* thisEffect, UInt32 area) - { - if(thisEffect) - thisEffect->properties.area = area; - } - - float GetSkillUsageMult(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.skillUsageMult : 0.0; - } - - void SetSkillUsageMult(EffectSetting* thisEffect, float skillMult) - { - if(thisEffect) - thisEffect->properties.skillUsageMult = skillMult; - } - - float GetBaseCost(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.baseCost : 0.0; - } - - void SetBaseCost(EffectSetting* thisEffect, float baseCost) - { - if(thisEffect) - thisEffect->properties.baseCost = baseCost; - } - - void SetAssociatedSkill(EffectSetting* thisEffect, BSFixedString school) - { - if (thisEffect) { - UInt32 actorValue = ActorValueList::ResolveActorValueByName(school.data); - thisEffect->properties.school = actorValue; - } - } - - BSFixedString GetResistance(EffectSetting* thisEffect) - { - if(!thisEffect) - return ""; - - ActorValueList * avList = ActorValueList::GetSingleton(); - if(!avList) - return ""; - - ActorValueInfo * info = avList->GetActorValue(thisEffect->properties.resistance); - if(!info) - return ""; - - return info->name; - } - - void SetResistance(EffectSetting* thisEffect, BSFixedString resistance) - { - if (thisEffect) { - UInt32 actorValue = ActorValueList::ResolveActorValueByName(resistance.data); - thisEffect->properties.resistance = actorValue; - } - } - - TESObjectLIGH* GetLight(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.light : NULL; - } - - void SetLight(EffectSetting* thisEffect, TESObjectLIGH * obj) - { - if(thisEffect) - thisEffect->properties.light = obj; - } - - TESEffectShader* GetHitShader(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.hitShader : NULL; - } - - void SetHitShader(EffectSetting* thisEffect, TESEffectShader * obj) - { - if(thisEffect) - thisEffect->properties.hitShader = obj; - } - - TESEffectShader* GetEnchantShader(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.enchantShader : NULL; - } - - void SetEnchantShader(EffectSetting* thisEffect, TESEffectShader * obj) - { - if(thisEffect) - thisEffect->properties.enchantShader = obj; - } - - BGSProjectile* GetProjectile(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.projectile : NULL; - } - - void SetProjectile(EffectSetting* thisEffect, BGSProjectile * obj) - { - if(thisEffect) - thisEffect->properties.projectile = obj; - } - - BGSExplosion* GetExplosion(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.explosion : NULL; - } - - void SetExplosion(EffectSetting* thisEffect, BGSExplosion * obj) - { - if(thisEffect) - thisEffect->properties.explosion = obj; - } - - BGSArtObject* GetCastingArt(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.castingArt : NULL; - } - - void SetCastingArt(EffectSetting* thisEffect, BGSArtObject * obj) - { - if(thisEffect) - thisEffect->properties.castingArt = obj; - } - - BGSArtObject* GetHitEffectArt(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.hitEffectArt : NULL; - } - - void SetHitEffectArt(EffectSetting* thisEffect, BGSArtObject * obj) - { - if(thisEffect) - thisEffect->properties.hitEffectArt = obj; - } - - BGSImpactDataSet* GetImpactDataSet(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.impactDataSet : NULL; - } - - void SetImpactDataSet(EffectSetting* thisEffect, BGSImpactDataSet * obj) - { - if(thisEffect) - thisEffect->properties.impactDataSet = obj; - } - - BGSArtObject* GetEnchantArt(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.enchantArt : NULL; - } - - void SetEnchantArt(EffectSetting* thisEffect, BGSArtObject * obj) - { - if(thisEffect) - thisEffect->properties.enchantArt = obj; - } - - SpellItem* GetEquipAbility(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.equipAbility : NULL; - } - - void SetEquipAbility(EffectSetting* thisEffect, SpellItem * obj) - { - if(thisEffect) - thisEffect->properties.equipAbility = obj; - } - - TESImageSpaceModifier* GetImageSpaceMod(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.imageSpaceMod : NULL; - } - - void SetImageSpaceMod(EffectSetting* thisEffect, TESImageSpaceModifier * obj) - { - if(thisEffect) - thisEffect->properties.imageSpaceMod = obj; - } - - BGSPerk* GetPerk(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.perk : NULL; - } - - void SetPerk(EffectSetting* thisEffect, BGSPerk * obj) - { - if(thisEffect) - thisEffect->properties.perk = obj; - } - - UInt32 GetCastingType(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.castType : 0; - } - - UInt32 GetDeliveryType(EffectSetting* thisEffect) - { - return (thisEffect) ? thisEffect->properties.deliveryType : 0; - } - - VMResultArray GetSounds(EffectSetting* thisEffect) - { - VMResultArray sounds; - sounds.resize(EffectSetting::SoundInfo::kNumSounds, NULL); - if(thisEffect) - { - for(UInt32 i = 0; i < thisEffect->sounds.count; i++) - { - EffectSetting::SoundInfo sInfo; - thisEffect->sounds.GetNthItem(i, sInfo); - if(sInfo.index < sounds.size()) - sounds.at(sInfo.index) = sInfo.sound; - } - } - - return sounds; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusMagicEffect::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("IsEffectFlagSet", "MagicEffect", papyrusMagicEffect::IsEffectFlagSet, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEffectFlag", "MagicEffect", papyrusMagicEffect::SetEffectFlag, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ClearEffectFlag", "MagicEffect", papyrusMagicEffect::ClearEffectFlag, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetCastTime", "MagicEffect", papyrusMagicEffect::GetCastTime, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetCastTime", "MagicEffect", papyrusMagicEffect::SetCastTime, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetSkillLevel", "MagicEffect", papyrusMagicEffect::GetSkillLevel, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillLevel", "MagicEffect", papyrusMagicEffect::SetSkillLevel, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetArea", "MagicEffect", papyrusMagicEffect::GetArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetArea", "MagicEffect", papyrusMagicEffect::SetArea, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetSkillUsageMult", "MagicEffect", papyrusMagicEffect::GetSkillUsageMult, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetSkillUsageMult", "MagicEffect", papyrusMagicEffect::SetSkillUsageMult, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetBaseCost", "MagicEffect", papyrusMagicEffect::GetBaseCost, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetBaseCost", "MagicEffect", papyrusMagicEffect::SetBaseCost, registry)); - - - registry->RegisterFunction( - new NativeFunction1("SetAssociatedSkill", "MagicEffect", papyrusMagicEffect::SetAssociatedSkill, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetResistance", "MagicEffect", papyrusMagicEffect::GetResistance, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetResistance", "MagicEffect", papyrusMagicEffect::SetResistance, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetLight", "MagicEffect", papyrusMagicEffect::GetLight, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetLight", "MagicEffect", papyrusMagicEffect::SetLight, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetHitShader", "MagicEffect", papyrusMagicEffect::GetHitShader, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetHitShader", "MagicEffect", papyrusMagicEffect::SetHitShader, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetEnchantShader", "MagicEffect", papyrusMagicEffect::GetEnchantShader, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetEnchantShader", "MagicEffect", papyrusMagicEffect::SetEnchantShader, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetProjectile", "MagicEffect", papyrusMagicEffect::GetProjectile, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetProjectile", "MagicEffect", papyrusMagicEffect::SetProjectile, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetExplosion", "MagicEffect", papyrusMagicEffect::GetExplosion, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetExplosion", "MagicEffect", papyrusMagicEffect::SetExplosion, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetCastingArt", "MagicEffect", papyrusMagicEffect::GetCastingArt, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetCastingArt", "MagicEffect", papyrusMagicEffect::SetCastingArt, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetHitEffectArt", "MagicEffect", papyrusMagicEffect::GetHitEffectArt, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetHitEffectArt", "MagicEffect", papyrusMagicEffect::SetHitEffectArt, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetEnchantArt", "MagicEffect", papyrusMagicEffect::GetEnchantArt, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetEnchantArt", "MagicEffect", papyrusMagicEffect::SetEnchantArt, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetImpactDataSet", "MagicEffect", papyrusMagicEffect::GetImpactDataSet, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetImpactDataSet", "MagicEffect", papyrusMagicEffect::SetImpactDataSet, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetEquipAbility", "MagicEffect", papyrusMagicEffect::GetEquipAbility, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetEquipAbility", "MagicEffect", papyrusMagicEffect::SetEquipAbility, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetImageSpaceMod", "MagicEffect", papyrusMagicEffect::GetImageSpaceMod, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetImageSpaceMod", "MagicEffect", papyrusMagicEffect::SetImageSpaceMod, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetPerk", "MagicEffect", papyrusMagicEffect::GetPerk, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetPerk", "MagicEffect", papyrusMagicEffect::SetPerk, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCastingType", "MagicEffect", papyrusMagicEffect::GetCastingType, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetDeliveryType", "MagicEffect", papyrusMagicEffect::GetDeliveryType, registry)); - - registry->RegisterFunction( - new NativeFunction0>("GetSounds", "MagicEffect", papyrusMagicEffect::GetSounds, registry)); - - - registry->SetFunctionFlags("MagicEffect", "IsEffectFlagSet", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetEffectFlag", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "ClearEffectFlag", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("MagicEffect", "GetCastTime", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetCastTime", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetSkillLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetSkillLevel", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetSkillUsageMult", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetSkillUsageMult", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetBaseCost", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetBaseCost", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetAssociatedSkill", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetResistance", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetResistance", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetLight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetLight", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetHitShader", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetHitShader", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetEnchantShader", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetEnchantShader", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetProjectile", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetProjectile", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetExplosion", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetExplosion", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetCastingArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetCastingArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetHitEffectArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetHitEffectArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetImpactDataSet", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetImpactDataSet", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetEnchantArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetEnchantArt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetEquipAbility", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetEquipAbility", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetImageSpaceMod", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetImageSpaceMod", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetPerk", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "SetPerk", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetCastingType", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("MagicEffect", "GetDeliveryType", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusMagicEffect.h b/source/fs.dll/skse64/skse64/PapyrusMagicEffect.h deleted file mode 100644 index fa97319f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMagicEffect.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class EffectSetting; -class VMClassRegistry; -class TESObjectLIGH; -class TESEffectShader; -class BGSProjectile; -class BGSArtObject; -class BGSImpactDataSet; -class SpellItem; -class TESImageSpaceModifier; -class BGSPerk; -class BGSExplosion; - -namespace papyrusMagicEffect -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool IsEffectFlagSet(EffectSetting* thisEffect, UInt32 flag); - void SetEffectFlag(EffectSetting* thisEffect, UInt32 flag); - void ClearEffectFlag(EffectSetting* thisEffect, UInt32 flag); - - float GetCastTime(EffectSetting* thisEffect); - void SetCastTime(EffectSetting* thisEffect, float castTime); - UInt32 GetSkillLevel(EffectSetting* thisEffect); - void SetSkillLevel(EffectSetting* thisEffect, UInt32 level); - UInt32 GetArea(EffectSetting* thisEffect); - void SetArea(EffectSetting* thisEffect, UInt32 area); - float GetSkillUsageMult(EffectSetting* thisEffect); - void SetSkillUsageMult(EffectSetting* thisEffect, float skillMult); - float GetBaseCost(EffectSetting* thisEffect); - void SetBaseCost(EffectSetting* thisEffect, float baseCost); - //void SetAssociatedSkill(EffectSetting* thisEffect, BSFixedString school); - //BSFixedString GetResistance(EffectSetting* thisEffect); - //void SetResistance(EffectSetting* thisEffect, BSFixedString resistance); - TESObjectLIGH* GetLight(EffectSetting* thisEffect); - void SetLight(EffectSetting* thisEffect, TESObjectLIGH * obj); - TESEffectShader* GetHitShader(EffectSetting* thisEffect); - void SetHitShader(EffectSetting* thisEffect, TESEffectShader * obj); - TESEffectShader* GetEnchantShader(EffectSetting* thisEffect); - void SetEnchantShader(EffectSetting* thisEffect, TESEffectShader * obj); - BGSProjectile* GetProjectile(EffectSetting* thisEffect); - void SetProjectile(EffectSetting* thisEffect, BGSProjectile * obj); - BGSExplosion* GetExplosion(EffectSetting* thisEffect); - void SetExplosion(EffectSetting* thisEffect, BGSExplosion * obj); - BGSArtObject* GetCastingArt(EffectSetting* thisEffect); - void SetCastingArt(EffectSetting* thisEffect, BGSArtObject * obj); - BGSArtObject* GetHitEffectArt(EffectSetting* thisEffect); - void SetHitEffectArt(EffectSetting* thisEffect, BGSArtObject * obj); - BGSImpactDataSet* GetImpactDataSet(EffectSetting* thisEffect); - void SetImpactDataSet(EffectSetting* thisEffect, BGSImpactDataSet * obj); - BGSArtObject* GetEnchantArt(EffectSetting* thisEffect); - void SetEnchantArt(EffectSetting* thisEffect, BGSArtObject * obj); - SpellItem* GetEquipAbility(EffectSetting* thisEffect); - void SetEquipAbility(EffectSetting* thisEffect, SpellItem * obj); - //TESImageSpaceModifier* GetImageSpaceMod(EffectSetting* thisEffect); - //void SetImageSpaceMod(EffectSetting* thisEffect, TESImageSpaceModifier * obj); - BGSPerk* GetPerk(EffectSetting* thisEffect); - void SetPerk(EffectSetting* thisEffect, BGSPerk * obj); - UInt32 GetCastingType(EffectSetting* thisEffect); - UInt32 GetDeliveryType(EffectSetting* thisEffect); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusMath.cpp b/source/fs.dll/skse64/skse64/PapyrusMath.cpp deleted file mode 100644 index f863f5e5..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMath.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "PapyrusMath.h" -#include - -namespace papyrusMath -{ - UInt32 LeftShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy) - { - return (shiftBy >= 32) ? 0 : value << shiftBy; - } - - UInt32 RightShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy) - { - return (shiftBy >= 32) ? 0 : value >> shiftBy; - } - - UInt32 LogicalAnd(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2) - { - return arg1 & arg2; - } - - UInt32 LogicalOr(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2) - { - return arg1 | arg2; - } - - UInt32 LogicalXor(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2) - { - return arg1 ^ arg2; - } - - UInt32 LogicalNot(StaticFunctionTag* base, UInt32 arg1) - { - return ~arg1; - } - - float Log(StaticFunctionTag* base, float arg1) - { - return log(arg1); - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusMath::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction2 ("LeftShift", "Math", papyrusMath::LeftShift, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("RightShift", "Math", papyrusMath::RightShift, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("LogicalAnd", "Math", papyrusMath::LogicalAnd, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("LogicalOr", "Math", papyrusMath::LogicalOr, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("LogicalXor", "Math", papyrusMath::LogicalXor, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("LogicalNot", "Math", papyrusMath::LogicalNot, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Log", "Math", papyrusMath::Log, registry)); - - registry->SetFunctionFlags("Math", "LeftShift", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "RightShift", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "LogicalAnd", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "LogicalOr", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "LogicalXor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "LogicalNot", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Math", "Log", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusMath.h b/source/fs.dll/skse64/skse64/PapyrusMath.h deleted file mode 100644 index 62f350a4..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMath.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusMath -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 LeftShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy); - UInt32 RightShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy); - UInt32 LogicalAnd(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); - UInt32 LogicalOr(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); - UInt32 LogicalXor(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); - UInt32 LogicalNot(StaticFunctionTag* base, UInt32 arg1); - float Log(StaticFunctionTag* base, float arg1); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusMisc.cpp b/source/fs.dll/skse64/skse64/PapyrusMisc.cpp deleted file mode 100644 index 0865a667..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMisc.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "PapyrusMisc.h" - -#include "GameForms.h" -#include "GameObjects.h" - -namespace papyrusSoulGem -{ - UInt32 GetSoulSize(TESSoulGem* thisGem) - { - if (!thisGem) - return 0; - return thisGem->soulSize; - } - - UInt32 GetGemSize(TESSoulGem* thisGem) - { - if (!thisGem) - return 0; - return thisGem->gemSize; - } -} - -namespace papyrusApparatus -{ - UInt32 GetQuality(BGSApparatus* thisApparatus) - { - if (!thisApparatus) - return 0; - return thisApparatus->quality.quality; - } - - void SetQuality(BGSApparatus* thisApparatus, UInt32 nuQuality) - { - if (thisApparatus) { - thisApparatus->quality.quality = nuQuality; - } - } -} - -namespace papyrusOutfit -{ - UInt32 GetNumParts(BGSOutfit* thisOutfit) - { - return thisOutfit ? thisOutfit->armorOrLeveledItemArray.count : 0; - } - - TESForm* GetNthPart(BGSOutfit* thisOutfit, UInt32 n) - { - TESForm* pForm = NULL; - if (thisOutfit) { - thisOutfit->armorOrLeveledItemArray.GetNthItem(n, pForm); - } - return pForm; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusSoulGem::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetSoulSize", "SoulGem", papyrusSoulGem::GetGemSize, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetGemSize", "SoulGem", papyrusSoulGem::GetGemSize, registry)); -} - -void papyrusApparatus::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetQuality", "Apparatus", papyrusApparatus::GetQuality, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetQuality", "Apparatus", papyrusApparatus::SetQuality, registry)); -} - -void papyrusOutfit::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetNumParts", "Outfit", papyrusOutfit::GetNumParts, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthPart", "Outfit", papyrusOutfit::GetNthPart, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusMisc.h b/source/fs.dll/skse64/skse64/PapyrusMisc.h deleted file mode 100644 index 22747aae..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusMisc.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -class TESSoulGem; -class BGSApparatus; -class BGSOutfit; -class TESForm; -class VMClassRegistry; -class BGSKeyword; - -#include "GameTypes.h" - -namespace papyrusSoulGem -{ - void RegisterFuncs(VMClassRegistry* registry); - UInt32 GetSoulSize(TESSoulGem* thisGem); - UInt32 GetGemSize(TESSoulGem* thisGem); -} - -namespace papyrusApparatus -{ - void RegisterFuncs(VMClassRegistry* registry); - UInt32 GetQuality(BGSApparatus* thisApparatus); - void SetQuality(BGSApparatus* thisApparatus, UInt32 nuQuality); -} - -namespace papyrusOutfit -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetNumParts(BGSOutfit* thisOutfit); - TESForm* GetNthPart(BGSOutfit* thisOutfit, UInt32 n); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusModEvent.cpp b/source/fs.dll/skse64/skse64/PapyrusModEvent.cpp deleted file mode 100644 index 622e7e95..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusModEvent.cpp +++ /dev/null @@ -1,332 +0,0 @@ -#include "PapyrusModEvent.h" - -#include - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -#include "PapyrusEvents.h" -#include "PapyrusObjects.h" -#include "PapyrusArgs.h" - -/// -/// PapyrusModEvent -/// - -namespace -{ - class PapyrusModEvent : - public ISKSEObject, - public IFunctionArguments - { - private: - struct Argument - { - enum - { - kType_None = 0, - kType_Int = 1, - kType_Float = 2, - kType_Bool = 3, - kType_String = 4, - kType_Form = 5 - }; - - Argument() : type(kType_None) {} - - explicit Argument(SInt32 arg) : type(kType_Int) { data.i = arg; } - explicit Argument(float arg) : type(kType_Float) { data.f = arg; } - explicit Argument(bool arg) : type(kType_Bool) { data.b = arg; } - explicit Argument(BSFixedString arg) : type(kType_String) { data.str = arg.data; } - explicit Argument(TESForm* arg) : type(kType_Form) { data.form = arg; } - - UInt32 type; - - union Data - { - SInt32 i; - float f; - bool b; - const char* str; - TESForm* form; - } - data; - }; - - public: - typedef std::vector ArgVectorT; - - explicit PapyrusModEvent(BSFixedString name) : - eventName_( name ) - {} - - explicit PapyrusModEvent(SerializationTag) - {} - - virtual ~PapyrusModEvent() - { - // LOL - CALL_MEMBER_FN(&eventName_, Release)(); - } - - // ISKSEObject - virtual const char* ClassName() const { return "PapyrusModEvent"; } - virtual UInt32 ClassVersion() const { return 1; } - - virtual bool Save(SKSESerializationInterface* intfc); - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version); - // ~ISKSEObject - - // IFunctionArguments - virtual bool Copy(Output * dst) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - - UInt32 i = 0; - //dst->Resize(1 + args_.size()); - dst->Resize(args_.size()); - - //dst->Get(i++)->SetString(eventName_.data); - - for (ArgVectorT::iterator it = args_.begin(); it != args_.end(); ++it, ++i) - { - switch (it->type) - { - case Argument::kType_Int: - dst->Get(i)->SetInt(it->data.i); - break; - case Argument::kType_Float: - dst->Get(i)->SetFloat(it->data.f); - break; - case Argument::kType_Bool: - dst->Get(i)->SetBool(it->data.b); - break; - case Argument::kType_String: - dst->Get(i)->SetString(it->data.str); - break; - case Argument::kType_Form: - PackValue(dst->Get(i), &it->data.form, registry); - break; - }; - } - - return true; - } - // ~IFunctionArguments - - template - void PushArg(T arg) - { - args_.push_back(Argument(arg)); - } - - void operator() (const EventRegistration& reg) - { - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - registry->QueueEvent(reg.handle, ®.params.callbackName, this); - } - - BSFixedString EventName() const { return eventName_; } - - private: - BSFixedString eventName_; - std::vector args_; - }; - - bool PapyrusModEvent::Save(SKSESerializationInterface* intfc) - { - using namespace Serialization; - - if (! WriteData(intfc, &eventName_)) - return false; - - UInt32 argsSize = args_.size(); - if (! WriteData(intfc, &argsSize)) - return false; - - for (UInt32 i=0; iformID)) - return false; - break; - } - } - - return true; - } - - bool PapyrusModEvent::Load(SKSESerializationInterface* intfc, UInt32 version) - { - using namespace Serialization; - - if (! ReadData(intfc, &eventName_)) - return false; - - UInt32 argsSize; - if (! ReadData(intfc, &argsSize)) - return false; - - for (UInt32 i=0; iResolveFormId(formId, &fixedFormId)) - formId = fixedFormId; - - e.data.form = LookupFormByID(formId); - break; - } - } - - args_.push_back(e); - } - - return true; - } -} - -/// -/// Native functions -/// - -namespace papyrusModEvent -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString eventName) - { - ERROR_AND_RETURN_0_IF(!eventName.data, "Event name must not be empty.", registry, stackId) - - PapyrusModEvent* evn = new PapyrusModEvent(eventName); - - SInt32 handle = SKSEObjectStorageInstance().StoreObject(evn, stackId); - return handle; - } - - bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle) - { - ERROR_AND_RETURN_0_IF(handle <= 0, "Invalid handle.", registry, stackId) - - PapyrusModEvent* evn = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_0_IF(evn == NULL, "Failed to lookup object for given handle.", registry, stackId) - - g_modCallbackRegs.ForEach(evn->EventName(), *evn); - - // Stuff has been copied, we can delete this - delete evn; - - return true; - } - - void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - PapyrusModEvent* evn = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_IF(evn == NULL, "Failed to lookup object for given handle.", registry, stackId) - - delete evn; - } - - template - void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - PapyrusModEvent* evn = SKSEObjectStorageInstance().AccessObject(handle); - - ERROR_AND_RETURN_IF(evn == NULL, "Failed to lookup object for given handle.", registry, stackId) - - evn->PushArg(arg); - } -} - -void papyrusModEvent::RegisterFuncs(VMClassRegistry* registry) -{ - SKSEObjectRegistry& skseObjRegistry = SKSEObjectRegistryInstance(); - skseObjRegistry.RegisterClass(); - - registry->RegisterFunction( - new NativeFunction1 ("Create", "ModEvent", papyrusModEvent::Create, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Send", "ModEvent", papyrusModEvent::Send, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Release", "ModEvent", papyrusModEvent::Release, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushBool", "ModEvent", papyrusModEvent::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushInt", "ModEvent", papyrusModEvent::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushFloat", "ModEvent", papyrusModEvent::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushString", "ModEvent", papyrusModEvent::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushForm", "ModEvent", papyrusModEvent::Push, registry)); - - registry->SetFunctionFlags("ModEvent", "Create", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "Send", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "Release", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "PushBool", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "PushInt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "PushFloat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "PushString", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("ModEvent", "PushForm", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusModEvent.h b/source/fs.dll/skse64/skse64/PapyrusModEvent.h deleted file mode 100644 index 87002217..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusModEvent.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -struct StaticFunctionTag; -class VMClassRegistry; - -namespace papyrusModEvent -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString eventName); - bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); - void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); - - template - void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg); - - void RegisterFuncs(VMClassRegistry* registry); - -} diff --git a/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef.inl b/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef.inl deleted file mode 100644 index 143b3888..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef.inl +++ /dev/null @@ -1,29 +0,0 @@ -// Native - -#define CLASS_NAME __MACRO_JOIN__(NativeFunction, NUM_PARAMS) -#define LATENT_SPEC 0 - -#define VOID_SPEC 0 -#include "skse64/PapyrusNativeFunctionDef_Base.inl" - -#define VOID_SPEC 1 -#include "skse64/PapyrusNativeFunctionDef_Base.inl" - -#undef LATENT_SPEC -#undef CLASS_NAME - -// Latent native - -#define CLASS_NAME __MACRO_JOIN__(LatentNativeFunction, NUM_PARAMS) -#define LATENT_SPEC 1 - -#define VOID_SPEC 0 -#include "skse64/PapyrusNativeFunctionDef_Base.inl" - -#define VOID_SPEC 1 -#include "skse64/PapyrusNativeFunctionDef_Base.inl" - -#undef LATENT_SPEC -#undef CLASS_NAME - -#undef NUM_PARAMS diff --git a/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef_Base.inl b/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef_Base.inl deleted file mode 100644 index 0dc50477..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNativeFunctionDef_Base.inl +++ /dev/null @@ -1,416 +0,0 @@ -#if NUM_PARAMS > 10 -#error PapyrusNativeFunctionDef: too many params -#endif - -template = 1 -,typename T_Arg0 -#endif -#if NUM_PARAMS >= 2 -,typename T_Arg1 -#endif -#if NUM_PARAMS >= 3 -,typename T_Arg2 -#endif -#if NUM_PARAMS >= 4 -,typename T_Arg3 -#endif -#if NUM_PARAMS >= 5 -,typename T_Arg4 -#endif -#if NUM_PARAMS >= 6 -,typename T_Arg5 -#endif -#if NUM_PARAMS >= 7 -,typename T_Arg6 -#endif -#if NUM_PARAMS >= 8 -,typename T_Arg7 -#endif -#if NUM_PARAMS >= 9 -,typename T_Arg8 -#endif -#if NUM_PARAMS >= 10 -,typename T_Arg9 -#endif - -> - -class CLASS_NAME -#if VOID_SPEC - - = 1 - , T_Arg0 -#endif -#if NUM_PARAMS >= 2 - , T_Arg1 -#endif -#if NUM_PARAMS >= 3 - , T_Arg2 -#endif -#if NUM_PARAMS >= 4 - , T_Arg3 -#endif -#if NUM_PARAMS >= 5 - , T_Arg4 -#endif -#if NUM_PARAMS >= 6 - , T_Arg5 -#endif -#if NUM_PARAMS >= 7 - , T_Arg6 -#endif -#if NUM_PARAMS >= 8 - , T_Arg7 -#endif -#if NUM_PARAMS >= 9 - , T_Arg8 -#endif -#if NUM_PARAMS >= 10 - , T_Arg9 -#endif - - > - -#endif - : public NativeFunction -{ -public: - -// Callback with short signature - typedef -#if LATENT_SPEC - bool -#elif VOID_SPEC - void -#else - T_Result -#endif - (* CallbackType)(T_Base * base -#if NUM_PARAMS >= 1 - , T_Arg0 arg0 -#endif -#if NUM_PARAMS >= 2 - , T_Arg1 arg1 -#endif -#if NUM_PARAMS >= 3 - , T_Arg2 arg2 -#endif -#if NUM_PARAMS >= 4 - , T_Arg3 arg3 -#endif -#if NUM_PARAMS >= 5 - , T_Arg4 arg4 -#endif -#if NUM_PARAMS >= 6 - , T_Arg5 arg5 -#endif -#if NUM_PARAMS >= 7 - , T_Arg6 arg6 -#endif -#if NUM_PARAMS >= 8 - , T_Arg7 arg7 -#endif -#if NUM_PARAMS >= 9 - , T_Arg8 arg8 -#endif -#if NUM_PARAMS >= 10 - , T_Arg9 arg9 -#endif - ); - -// Callback with long signature - typedef -#if LATENT_SPEC - bool -#elif VOID_SPEC - void -#else - T_Result -#endif - (* CallbackType_LongSig)(VMClassRegistry* registry, UInt32 stackId, T_Base * base -#if NUM_PARAMS >= 1 - , T_Arg0 arg0 -#endif -#if NUM_PARAMS >= 2 - , T_Arg1 arg1 -#endif -#if NUM_PARAMS >= 3 - , T_Arg2 arg2 -#endif -#if NUM_PARAMS >= 4 - , T_Arg3 arg3 -#endif -#if NUM_PARAMS >= 5 - , T_Arg4 arg4 -#endif -#if NUM_PARAMS >= 6 - , T_Arg5 arg5 -#endif -#if NUM_PARAMS >= 7 - , T_Arg6 arg6 -#endif -#if NUM_PARAMS >= 8 - , T_Arg7 arg7 -#endif -#if NUM_PARAMS >= 9 - , T_Arg8 arg8 -#endif -#if NUM_PARAMS >= 10 - , T_Arg9 arg9 -#endif - ); - - // Short signature - CLASS_NAME(const char * fnName, const char * className, CallbackType callback, VMClassRegistry * registry) - :NativeFunction(fnName, className, IsStaticType ::value, NUM_PARAMS) - { - // store callback - m_callback = (void *)callback; - - m_bUseLongSignature = false; - - InitParams(registry); - } - - // Long signature - CLASS_NAME(const char * fnName, const char * className, CallbackType_LongSig callback, VMClassRegistry * registry) - :NativeFunction(fnName, className, IsStaticType ::value, NUM_PARAMS) - { - // store callback - m_callback = (void *)callback; - - m_bUseLongSignature = true; - - InitParams(registry); - } - - void InitParams(VMClassRegistry * registry) - { -#if NUM_PARAMS >= 1 - m_params.data[0].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 2 - m_params.data[1].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 3 - m_params.data[2].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 4 - m_params.data[3].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 5 - m_params.data[4].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 6 - m_params.data[5].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 7 - m_params.data[6].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 8 - m_params.data[7].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 9 - m_params.data[8].type = GetTypeID (registry); -#endif -#if NUM_PARAMS >= 10 - m_params.data[9].type = GetTypeID (registry); -#endif - -#if VOID_SPEC - m_retnType = GetTypeID (registry); -#else - m_retnType = GetTypeID (registry); -#endif - -#if LATENT_SPEC - m_isLatent = true; -#endif - } - - virtual ~CLASS_NAME() { } - - virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, UInt32 stackId, VMValue * resultValue, VMState * state) - { -#if _DEBUG - DebugRunHook(baseValue, registry, stackId, resultValue, state); -#endif - - // get argument list - UInt32 argOffset = CALL_MEMBER_FN(state->argList, GetOffset)(state); - - T_Base * base = NULL; - - // extract base object pointer for non-static types - if (! IsStaticType ::value) - { - UnpackValue(&base, baseValue); - if (!base) return false; - } - - // extract parameters -#if NUM_PARAMS >= 1 - T_Arg0 arg0; - UnpackValue(&arg0, CALL_MEMBER_FN(state->argList, Get)(state, 0, argOffset)); -#endif -#if NUM_PARAMS >= 2 - T_Arg1 arg1; - UnpackValue(&arg1, CALL_MEMBER_FN(state->argList, Get)(state, 1, argOffset)); -#endif -#if NUM_PARAMS >= 3 - T_Arg2 arg2; - UnpackValue(&arg2, CALL_MEMBER_FN(state->argList, Get)(state, 2, argOffset)); -#endif -#if NUM_PARAMS >= 4 - T_Arg3 arg3; - UnpackValue(&arg3, CALL_MEMBER_FN(state->argList, Get)(state, 3, argOffset)); -#endif -#if NUM_PARAMS >= 5 - T_Arg4 arg4; - UnpackValue(&arg4, CALL_MEMBER_FN(state->argList, Get)(state, 4, argOffset)); -#endif -#if NUM_PARAMS >= 6 - T_Arg5 arg5; - UnpackValue(&arg5, CALL_MEMBER_FN(state->argList, Get)(state, 5, argOffset)); -#endif -#if NUM_PARAMS >= 7 - T_Arg6 arg6; - UnpackValue(&arg6, CALL_MEMBER_FN(state->argList, Get)(state, 6, argOffset)); -#endif -#if NUM_PARAMS >= 8 - T_Arg7 arg7; - UnpackValue(&arg7, CALL_MEMBER_FN(state->argList, Get)(state, 7, argOffset)); -#endif -#if NUM_PARAMS >= 9 - T_Arg8 arg8; - UnpackValue(&arg8, CALL_MEMBER_FN(state->argList, Get)(state, 8, argOffset)); -#endif -#if NUM_PARAMS >= 10 - T_Arg9 arg9; - UnpackValue(&arg9, CALL_MEMBER_FN(state->argList, Get)(state, 9, argOffset)); -#endif - - // long signature - if (m_bUseLongSignature) - { - // call the callback -#if LATENT_SPEC - bool result = -#elif !VOID_SPEC - T_Result result = -#endif - ((CallbackType_LongSig)m_callback)(registry, stackId, base -#if NUM_PARAMS >= 1 - , arg0 -#endif -#if NUM_PARAMS >= 2 - , arg1 -#endif -#if NUM_PARAMS >= 3 - , arg2 -#endif -#if NUM_PARAMS >= 4 - , arg3 -#endif -#if NUM_PARAMS >= 5 - , arg4 -#endif -#if NUM_PARAMS >= 6 - , arg5 -#endif -#if NUM_PARAMS >= 7 - , arg6 -#endif -#if NUM_PARAMS >= 8 - , arg7 -#endif -#if NUM_PARAMS >= 9 - , arg8 -#endif -#if NUM_PARAMS >= 10 - , arg9 -#endif - ); - - // pack the result -#if LATENT_SPEC - resultValue->SetBool(result); -#elif VOID_SPEC - resultValue->SetNone(); -#else - PackValue(resultValue, &result, registry); -#endif - } - - // Short signature - else - { - // call the callback -#if LATENT_SPEC - bool result = -#elif !VOID_SPEC - T_Result result = -#endif - ((CallbackType)m_callback)(base -#if NUM_PARAMS >= 1 - , arg0 -#endif -#if NUM_PARAMS >= 2 - , arg1 -#endif -#if NUM_PARAMS >= 3 - , arg2 -#endif -#if NUM_PARAMS >= 4 - , arg3 -#endif -#if NUM_PARAMS >= 5 - , arg4 -#endif -#if NUM_PARAMS >= 6 - , arg5 -#endif -#if NUM_PARAMS >= 7 - , arg6 -#endif -#if NUM_PARAMS >= 8 - , arg7 -#endif -#if NUM_PARAMS >= 9 - , arg8 -#endif -#if NUM_PARAMS >= 10 - , arg9 -#endif - ); - - // pack the result -#if LATENT_SPEC - resultValue->SetBool(result); -#elif VOID_SPEC - resultValue->SetNone(); -#else - PackValue(resultValue, &result, registry); -#endif - } - - return true; - } - -private: - // hide - CLASS_NAME(); - - // Temporary workaround until refactoring - bool m_bUseLongSignature; -}; - -#undef VOID_SPEC diff --git a/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.cpp b/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.cpp deleted file mode 100644 index d3d11552..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "skse64/PapyrusNativeFunctions.h" - -void NativeFunction::DebugRunHook(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state) -{ - // -} diff --git a/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.h b/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.h deleted file mode 100644 index 1ac9f579..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNativeFunctions.h +++ /dev/null @@ -1,218 +0,0 @@ -#pragma once - -#include "skse64/GameTypes.h" -#include "skse64/GameAPI.h" -#include "skse64/PapyrusArgs.h" -#include "skse64/PapyrusVM.h" - -// native function bindings for papyrus - -// all of this is originally in namespace BSScript - -// use this for T_Base when there is no base -struct StaticFunctionTag -{ - enum { kTypeID = 0 }; -}; - -// stack frame? -class VMState -{ -public: - VMState(); - ~VMState(); - - VMArgList * argList; // 00 - UInt64 pad08[(0x38 - 0x08) >> 3]; // 08 - UInt32 numArgs; // 38 -}; - -// 08 -class IFunction -{ -public: - IFunction() { } - virtual ~IFunction() { } - -// void ** _vtbl; // 00 - BSIntrusiveRefCounted refCount; // 08 - - virtual BSFixedString * GetName(void) = 0; - virtual BSFixedString * GetClassName(void) = 0; - virtual BSFixedString * GetStr10(void) = 0; - virtual UInt64 * GetReturnType(UInt64 * dst) = 0; - virtual UInt64 GetNumParams(void) = 0; - virtual UInt64 * GetParam(UInt32 idx, BSFixedString * nameOut, UInt64 * typeOut) = 0; - virtual UInt64 GetNumParams2(void) = 0; - virtual bool IsNative(void) = 0; - virtual UInt8 GetUnk40(void) = 0; - virtual bool Unk_0A(void) = 0; - virtual UInt32 Unk_0B(void) = 0; - virtual UInt32 GetUnk44(void) = 0; - virtual BSFixedString * GetStr48(void) = 0; - virtual void Unk_0E(UInt32 unk) = 0; - virtual UInt32 Invoke(UInt64 unk0, UInt64 unk1, VMClassRegistry * registry, VMState * unk3) = 0; - virtual BSFixedString * Unk_10(void) = 0; - virtual bool Unk_11(UInt32 unk0, UInt32 * unk1) = 0; - virtual bool GetParamName(UInt32 idx, UInt64 out) = 0; // param list stuff - virtual UInt8 GetUnk41(void) = 0; - virtual void SetUnk41(UInt8 arg) = 0; - virtual bool HasCallback(void) = 0; - virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state) = 0; // unique to each type combination -}; - -// BSScript::NF_util::NativeFunctionBase -// 2C -class NativeFunctionBase : public IFunction -{ -public: - NativeFunctionBase() { } - virtual ~NativeFunctionBase() { } - - // 08 - struct ParameterInfo - { - // 08 - struct Entry - { - StringCache::Ref name; // 00 - - union - { - UInt64 type; // 08 - shared with VMValue::type - VMClassInfo * typePtr; // 08 - }; - }; - - Entry * data; // 00 length = numParams + unk0A - UInt16 numParams; // 08 - UInt16 unk0A; // 0A - }; - - virtual BSFixedString * GetName(void) override { return &m_fnName; } - virtual BSFixedString * GetClassName(void) override { return &m_className; } - virtual BSFixedString * GetStr10(void) override { return &unk10; } - virtual UInt64 * GetReturnType(UInt64 * dst) override { *dst = m_retnType; return dst; } - virtual UInt64 GetNumParams(void) override { return m_params.unk0A; } - virtual UInt64 * GetParam(UInt32 idx, BSFixedString * nameOut, UInt64 * typeOut) - { return CALL_MEMBER_FN(this, Impl_GetParam)(idx, nameOut, typeOut); } - virtual UInt64 GetNumParams2(void) override { return m_params.unk0A; } - virtual bool IsNative(void) override { return true; } - virtual UInt8 GetUnk40(void) override { return unk40; } - virtual bool Unk_0A(void) override { return false; } - virtual UInt32 Unk_0B(void) override { return 0; } - virtual UInt32 GetUnk44(void) override { return unk44; } - virtual BSFixedString * GetStr48(void) override { return &unk48; } - virtual void Unk_0E(UInt32 unk) override { } // always nop? - virtual UInt32 Invoke(UInt64 unk0, UInt64 unk1, VMClassRegistry * registry, VMState * unk3) override - { return CALL_MEMBER_FN(this, Impl_Invoke)(unk0, unk1, registry, unk3); } - virtual BSFixedString * Unk_10(void) override { return CALL_MEMBER_FN(this, Impl_Fn10)(); } - virtual bool Unk_11(UInt32 unk0, UInt32 * unk1) override - { *unk1 = 0; return false; } - virtual bool GetParamName(UInt32 idx, UInt64 out) override // ### param list stuff - { return CALL_MEMBER_FN(this, Impl_Fn12)(idx, out); } - virtual UInt8 GetUnk41(void) override { return unk41; } - virtual void SetUnk41(UInt8 arg) override { unk41 = arg; } - virtual bool HasCallback(void) = 0; - virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state) = 0; - - MEMBER_FN_PREFIX(NativeFunctionBase); - DEFINE_MEMBER_FN(Impl_dtor, void, 0x0137AD80); - // ??_7?$NativeFunction1@VActiveEffect@@XPEAVTESForm@@@BSScript@@6B@ entry 6 - DEFINE_MEMBER_FN(Impl_GetParam, UInt64 *, 0x0137A450, UInt32 idx, BSFixedString * nameOut, UInt64 * typeOut); - DEFINE_MEMBER_FN(Impl_Invoke, UInt32, 0x0137A650, UInt64 unk0, UInt64 unk1, VMClassRegistry * registry, VMState * unk3); - // ??_7?$NativeFunction1@VActiveEffect@@XPEAVTESForm@@@BSScript@@6B@ entry 0x10 - DEFINE_MEMBER_FN(Impl_Fn10, BSFixedString *, 0x0137A530); - // ??_7?$NativeFunction1@VActiveEffect@@XPEAVTESForm@@@BSScript@@6B@ entry 0x12 - DEFINE_MEMBER_FN(Impl_Fn12, bool, 0x0137A550, UInt32 idx, UInt64 out); - - DEFINE_STATIC_HEAP(Heap_Allocate, Heap_Free); - -protected: - BSFixedString m_fnName; // 10 - BSFixedString m_className; // 18 - BSFixedString unk10; // 20 - UInt64 m_retnType; // 28 - return type - ParameterInfo m_params; // 30 - UInt8 unk40; // 40 - related to extra entries in m_params - UInt8 unk41; // 41 - UInt8 m_isLatent; // 42 - UInt8 pad43; // 43 - UInt32 unk44; // 44 - BSFixedString unk48; // 48 -}; - -// 30 -// this should be fully functional for deriving -class NativeFunction : public NativeFunctionBase -{ -public: - NativeFunction(const char * fnName, const char * className, UInt8 isStatic, UInt32 numParams) - { CALL_MEMBER_FN(this, Impl_ctor)(fnName, className, isStatic, numParams); } - // lower class destructors are invoked by this call - virtual ~NativeFunction() { CALL_MEMBER_FN(this, Impl_dtor)(); } - - virtual bool HasCallback(void) { return m_callback != 0; } - virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state) = 0; - - MEMBER_FN_PREFIX(NativeFunction); - DEFINE_MEMBER_FN(Impl_ctor, NativeFunction *, 0x0137AB30, const char * fnName, const char * className, UInt32 unk0, UInt32 numParams); - DEFINE_MEMBER_FN(Impl_dtor, void, 0x0137AD80); // same as NativeFunctionBase dtor - - void DebugRunHook(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state); - -protected: - void * m_callback; // 2C - - // hide - NativeFunction(); -}; - -#define NUM_PARAMS 0 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 1 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 2 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 3 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 4 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 5 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 6 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 7 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 8 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 9 -#include "skse64/PapyrusNativeFunctionDef.inl" - -#define NUM_PARAMS 10 -#include "skse64/PapyrusNativeFunctionDef.inl" - -// Less boilerplate for checking of input parameters in native function callbacks. - -#define ERROR_AND_RETURN_IF(condition, message, registry, stackId) \ - if (condition) \ - { \ - registry->LogError(message, stackId); \ - return; \ - } - -#define ERROR_AND_RETURN_0_IF(condition, message, registry, stackId) \ - if (condition) \ - { \ - registry->LogError(message, stackId); \ - return 0; \ - } diff --git a/source/fs.dll/skse64/skse64/PapyrusNetImmerse.cpp b/source/fs.dll/skse64/skse64/PapyrusNetImmerse.cpp deleted file mode 100644 index 0f29e27d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNetImmerse.cpp +++ /dev/null @@ -1,468 +0,0 @@ -#include "PapyrusNetImmerse.h" - -#include "GameAPI.h" -#include "GameForms.h" -#include "GameRTTI.h" -#include "GameReferences.h" -#include "GameObjects.h" -#include "GameThreads.h" - -#include "NiNodes.h" -#include "NiGeometry.h" - -#include "InternalTasks.h" - -#include "PapyrusArgs.h" - -namespace papyrusNetImmerse -{ - NiAVObject * ResolveNode(TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - if(!obj) return NULL; - - NiAVObject * result = obj->GetNiNode(); - - // special-case for the player, switch between first/third-person - PlayerCharacter * player = DYNAMIC_CAST(obj, TESObjectREFR, PlayerCharacter); - if(player && player->loadedState) - result = firstPerson ? player->firstPersonSkeleton : player->loadedState->node; - - // name lookup - if(obj && nodeName.data[0] && result) - result = result->GetObjectByName(&nodeName.data); - - return result; - } - - bool HasNode(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object != NULL; - } - - float GetNodeWorldPositionX(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_worldTransform.pos.x : 0; - } - - float GetNodeWorldPositionY(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_worldTransform.pos.y : 0; - } - - float GetNodeWorldPositionZ(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_worldTransform.pos.z : 0; - } - - bool GetNodeWorldPosition(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - inArray.Set(&object->m_worldTransform.pos.x, 0); - inArray.Set(&object->m_worldTransform.pos.y, 1); - inArray.Set(&object->m_worldTransform.pos.z, 2); - return true; - } - - return false; - } - - float GetNodeLocalPositionX(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_localTransform.pos.x : 0; - } - - float GetNodeLocalPositionY(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_localTransform.pos.y : 0; - } - - float GetNodeLocalPositionZ(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_localTransform.pos.z : 0; - } - - bool GetNodeLocalPosition(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - inArray.Set(&object->m_localTransform.pos.x, 0); - inArray.Set(&object->m_localTransform.pos.y, 1); - inArray.Set(&object->m_localTransform.pos.z, 2); - return true; - } - - return false; - } - - float GetRelativeNodePositionX(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeNameA, BSFixedString nodeNameB, bool firstPerson) - { - NiAVObject * objectA = ResolveNode(obj, nodeNameA, firstPerson); - NiAVObject * objectB = ResolveNode(obj, nodeNameB, firstPerson); - - return (objectA && objectB) ? objectB->m_worldTransform.pos.x - objectA->m_worldTransform.pos.x : 0; - } - - float GetRelativeNodePositionY(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeNameA, BSFixedString nodeNameB, bool firstPerson) - { - NiAVObject * objectA = ResolveNode(obj, nodeNameA, firstPerson); - NiAVObject * objectB = ResolveNode(obj, nodeNameB, firstPerson); - - return (objectA && objectB) ? objectB->m_worldTransform.pos.y - objectA->m_worldTransform.pos.y : 0; - } - - float GetRelativeNodePositionZ(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeNameA, BSFixedString nodeNameB, bool firstPerson) - { - NiAVObject * objectA = ResolveNode(obj, nodeNameA, firstPerson); - NiAVObject * objectB = ResolveNode(obj, nodeNameB, firstPerson); - - return (objectA && objectB) ? objectB->m_worldTransform.pos.z - objectA->m_worldTransform.pos.z : 0; - } - - bool GetRelativeNodePosition(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeNameA, BSFixedString nodeNameB, VMArray inArray, bool firstPerson) - { - NiAVObject * objectA = ResolveNode(obj, nodeNameA, firstPerson); - NiAVObject * objectB = ResolveNode(obj, nodeNameB, firstPerson); - if(objectA && objectB && inArray.Length() == 3) { - float x = objectB->m_worldTransform.pos.x - objectA->m_worldTransform.pos.x; - float y = objectB->m_worldTransform.pos.y - objectA->m_worldTransform.pos.y; - float z = objectB->m_worldTransform.pos.z - objectA->m_worldTransform.pos.z; - inArray.Set(&x, 0); - inArray.Set(&y, 1); - inArray.Set(&z, 2); - return true; - } - - return false; - } - - float GetNodeScale(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - return object ? object->m_localTransform.scale : 0; - } - - void SetNodeLocalPositionX(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - if(object) - { - object->m_localTransform.pos.x = value; - TaskInterface::UpdateWorldData(object); - } - } - - void SetNodeLocalPositionY(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - if(object) - { - object->m_localTransform.pos.y = value; - TaskInterface::UpdateWorldData(object); - } - } - - void SetNodeLocalPositionZ(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - if(object) - { - object->m_localTransform.pos.z = value; - TaskInterface::UpdateWorldData(object); - } - } - - bool SetNodeLocalPosition(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - inArray.Get(&object->m_localTransform.pos.x, 0); - inArray.Get(&object->m_localTransform.pos.y, 1); - inArray.Get(&object->m_localTransform.pos.z, 2); - - TaskInterface::UpdateWorldData(object); - - return true; - } - - return false; - } - - bool GetNodeLocalRotationEuler(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - float heading, attitude, bank; - - object->m_localTransform.rot.GetEulerAngles(&heading, &attitude, &bank); - - // Radians to degrees - heading *= 180 / MATH_PI; - attitude *= 180 / MATH_PI; - bank *= 180 / MATH_PI; - - inArray.Set(&heading, 0); - inArray.Set(&attitude, 1); - inArray.Set(&bank, 2); - return true; - } - - return false; - } - - - bool GetNodeWorldRotationEuler(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - float heading, attitude, bank; - object->m_worldTransform.rot.GetEulerAngles(&heading, &attitude, &bank); - - // Radians to degrees - heading *= 180 / MATH_PI; - attitude *= 180 / MATH_PI; - bank *= 180 / MATH_PI; - - inArray.Set(&heading, 0); - inArray.Set(&attitude, 1); - inArray.Set(&bank, 2); - return true; - } - - return false; - } - - - bool SetNodeLocalRotationEuler(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 3) { - float heading, attitude, bank; - - inArray.Get(&heading, 0); - inArray.Get(&attitude, 1); - inArray.Get(&bank, 2); - - // Degrees to radians - heading *= MATH_PI / 180; - attitude *= MATH_PI / 180; - bank *= MATH_PI / 180; - - object->m_localTransform.rot.SetEulerAngles(heading, attitude, bank); - - TaskInterface::UpdateWorldData(object); - - return true; - } - - return false; - } - - bool SetNodeLocalRotationMatrix(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 9) { - inArray.Get(&object->m_localTransform.rot.data[0][0], 0); - inArray.Get(&object->m_localTransform.rot.data[0][1], 1); - inArray.Get(&object->m_localTransform.rot.data[0][2], 2); - - inArray.Get(&object->m_localTransform.rot.data[1][0], 3); - inArray.Get(&object->m_localTransform.rot.data[1][1], 4); - inArray.Get(&object->m_localTransform.rot.data[1][2], 5); - - inArray.Get(&object->m_localTransform.rot.data[2][0], 6); - inArray.Get(&object->m_localTransform.rot.data[2][1], 7); - inArray.Get(&object->m_localTransform.rot.data[2][2], 8); - - TaskInterface::UpdateWorldData(object); - - return true; - } - - return false; - } - - bool GetNodeLocalRotationMatrix(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 9) { - inArray.Set(&object->m_localTransform.rot.data[0][0], 0); - inArray.Set(&object->m_localTransform.rot.data[0][1], 1); - inArray.Set(&object->m_localTransform.rot.data[0][2], 2); - - inArray.Set(&object->m_localTransform.rot.data[1][0], 3); - inArray.Set(&object->m_localTransform.rot.data[1][1], 4); - inArray.Set(&object->m_localTransform.rot.data[1][2], 5); - - inArray.Set(&object->m_localTransform.rot.data[2][0], 6); - inArray.Set(&object->m_localTransform.rot.data[2][1], 7); - inArray.Set(&object->m_localTransform.rot.data[2][2], 8); - return true; - } - - return false; - } - - bool GetNodeWorldRotationMatrix(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray inArray, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - if(object && inArray.Length() == 9) { - inArray.Set(&object->m_worldTransform.rot.data[0][0], 0); - inArray.Set(&object->m_worldTransform.rot.data[0][1], 1); - inArray.Set(&object->m_worldTransform.rot.data[0][2], 2); - - inArray.Set(&object->m_worldTransform.rot.data[1][0], 3); - inArray.Set(&object->m_worldTransform.rot.data[1][1], 4); - inArray.Set(&object->m_worldTransform.rot.data[1][2], 5); - - inArray.Set(&object->m_worldTransform.rot.data[2][0], 6); - inArray.Set(&object->m_worldTransform.rot.data[2][1], 7); - inArray.Set(&object->m_worldTransform.rot.data[2][2], 8); - return true; - } - - return false; - } - - void SetNodeScale(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson) - { - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - if(object) - { - object->m_localTransform.scale = value; - TaskInterface::UpdateWorldData(object); - } - } - - void SetNodeTextureSet(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, BGSTextureSet * textureSet, bool firstPerson) - { - if(!textureSet) return; - - NiAVObject * object = ResolveNode(obj, nodeName, firstPerson); - - if(object) - { - BSGeometry * geometry = object->GetAsBSGeometry(); - if(geometry) - { - BSTaskPool * taskPool = BSTaskPool::GetSingleton(); - if(taskPool) - { - CALL_MEMBER_FN(taskPool, SetNiGeometryTexture)(geometry, textureSet); - } - } - } - } -}; - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusNetImmerse::RegisterFuncs(VMClassRegistry* registry) -{ - // NiNode Manipulation - registry->RegisterFunction( - new NativeFunction3("HasNode", "NetImmerse", papyrusNetImmerse::HasNode, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeWorldPositionX", "NetImmerse", papyrusNetImmerse::GetNodeWorldPositionX, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeWorldPositionY", "NetImmerse", papyrusNetImmerse::GetNodeWorldPositionY, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeWorldPositionZ", "NetImmerse", papyrusNetImmerse::GetNodeWorldPositionZ, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeWorldPosition", "NetImmerse", papyrusNetImmerse::GetNodeWorldPosition, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeLocalPositionX", "NetImmerse", papyrusNetImmerse::GetNodeLocalPositionX, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeLocalPositionY", "NetImmerse", papyrusNetImmerse::GetNodeLocalPositionY, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeLocalPositionZ", "NetImmerse", papyrusNetImmerse::GetNodeLocalPositionZ, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeLocalPosition", "NetImmerse", papyrusNetImmerse::GetNodeLocalPosition, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNodeScale", "NetImmerse", papyrusNetImmerse::GetNodeScale, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetNodeScale", "NetImmerse", papyrusNetImmerse::SetNodeScale, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetNodeLocalPositionX", "NetImmerse", papyrusNetImmerse::SetNodeLocalPositionX, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetNodeLocalPositionY", "NetImmerse", papyrusNetImmerse::SetNodeLocalPositionY, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetNodeLocalPositionZ", "NetImmerse", papyrusNetImmerse::SetNodeLocalPositionZ, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("SetNodeLocalPosition", "NetImmerse", papyrusNetImmerse::SetNodeLocalPosition, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeLocalRotationEuler", "NetImmerse", papyrusNetImmerse::GetNodeLocalRotationEuler, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("SetNodeLocalRotationEuler", "NetImmerse", papyrusNetImmerse::SetNodeLocalRotationEuler, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeLocalRotationMatrix", "NetImmerse", papyrusNetImmerse::GetNodeLocalRotationMatrix, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("SetNodeLocalRotationMatrix", "NetImmerse", papyrusNetImmerse::SetNodeLocalRotationMatrix, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeWorldRotationEuler", "NetImmerse", papyrusNetImmerse::GetNodeWorldRotationEuler, registry)); - - registry->RegisterFunction( - new NativeFunction4, bool>("GetNodeWorldRotationMatrix", "NetImmerse", papyrusNetImmerse::GetNodeWorldRotationMatrix, registry)); - - - registry->RegisterFunction( - new NativeFunction4("SetNodeTextureSet", "NetImmerse", papyrusNetImmerse::SetNodeTextureSet, registry)); - - registry->RegisterFunction( - new NativeFunction4("GetRelativeNodePositionX", "NetImmerse", papyrusNetImmerse::GetRelativeNodePositionX, registry)); - - registry->RegisterFunction( - new NativeFunction4("GetRelativeNodePositionY", "NetImmerse", papyrusNetImmerse::GetRelativeNodePositionY, registry)); - - registry->RegisterFunction( - new NativeFunction4("GetRelativeNodePositionZ", "NetImmerse", papyrusNetImmerse::GetRelativeNodePositionZ, registry)); - - registry->RegisterFunction( - new NativeFunction5, bool>("GetRelativeNodePosition", "NetImmerse", papyrusNetImmerse::GetRelativeNodePosition, registry)); - - /*registry->SetFunctionFlags("NetImmerse", "HasNode", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("NetImmerse", "GetNodePositionX", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("NetImmerse", "GetNodePositionY", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("NetImmerse", "GetNodePositionZ", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("NetImmerse", "GetNodeScale", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("NetImmerse", "SetNodeScale", VMClassRegistry::kFunctionFlag_NoWait);*/ -} diff --git a/source/fs.dll/skse64/skse64/PapyrusNetImmerse.h b/source/fs.dll/skse64/skse64/PapyrusNetImmerse.h deleted file mode 100644 index 42bc8dab..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusNetImmerse.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class VMClassRegistry; -struct StaticFunctionTag; -class TESObjectREFR; -class TESForm; -class BGSTextureSet; - -namespace papyrusNetImmerse -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool HasNode(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); - float GetNodePositionX(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); - float GetNodePositionY(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); - float GetNodePositionZ(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); - float GetNodeScale(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); - void SetNodeScale(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson); - void SetNodeTextureSet(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, BGSTextureSet * textureSet, bool firstPerson); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusObjectReference.cpp b/source/fs.dll/skse64/skse64/PapyrusObjectReference.cpp deleted file mode 100644 index 29b121af..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusObjectReference.cpp +++ /dev/null @@ -1,657 +0,0 @@ -#include "PapyrusObjectReference.h" -#include "PapyrusWornObject.h" -#include "PapyrusForm.h" - -#include "GameAPI.h" -#include "GameFormComponents.h" -#include "GameForms.h" -#include "GameRTTI.h" -#include "GameObjects.h" -#include "GameExtraData.h" -#include "GameData.h" -#include "GameThreads.h" - -#include "InternalTasks.h" - -//#include "NiNodes.h" - -#include -#include - -typedef std::vector ExtraDataVec; -typedef std::map ExtraContainerMap; - -class ExtraContainerReceiver -{ -public: - virtual void AddFormToReceiver(TESForm * form) = 0; -}; - -class ExtraContainerFormList : public ExtraContainerReceiver -{ - BGSListForm * m_formList; -public: - ExtraContainerFormList::ExtraContainerFormList(BGSListForm * list) : m_formList(list) { } - - virtual void AddFormToReceiver(TESForm * form) - { - CALL_MEMBER_FN(m_formList, AddFormToList)(form); - } -}; - -class ExtraContainerArray : public ExtraContainerReceiver -{ - VMResultArray * m_array; -public: - ExtraContainerArray::ExtraContainerArray(VMResultArray * list) : m_array(list) { } - - virtual void AddFormToReceiver(TESForm * form) - { - m_array->push_back(form); - } -}; - -class ExtraContainerInfo -{ - ExtraDataVec m_vec; - ExtraContainerMap m_map; -public: - ExtraContainerInfo(EntryDataList * entryList) : m_map(), m_vec() - { - m_vec.reserve(128); - if (entryList) { - entryList->Visit(*this); - } - } - - bool Accept(InventoryEntryData* data) - { - if (data) { - m_vec.push_back(data); - m_map[data->type] = m_vec.size()-1; - } - return true; - } - - bool IsValidEntry(TESContainer::Entry* pEntry, SInt32& numObjects) - { - if (pEntry) { - numObjects = pEntry->count; - TESForm* pForm = pEntry->form; - - if (DYNAMIC_CAST(pForm, TESForm, TESLevItem)) - return false; - - ExtraContainerMap::iterator it = m_map.find(pForm); - ExtraContainerMap::iterator itEnd = m_map.end(); - if (it != itEnd) { - UInt32 index = it->second; - InventoryEntryData* pXData = m_vec[index]; - if (pXData) { - numObjects += pXData->countDelta; - } - // clear the object from the vector so we don't bother to look for it - // in the second step - m_vec[index] = NULL; - } - - if (numObjects > 0) { - //if (IsConsoleMode()) { - // PrintItemType(pForm); - //} - return true; - } - } - return false; - } - - // returns the count of items left in the vector - UInt32 CountItems() { - UInt32 count = 0; - ExtraDataVec::iterator itEnd = m_vec.end(); - ExtraDataVec::iterator it = m_vec.begin(); - while (it != itEnd) { - InventoryEntryData* extraData = (*it); - if (extraData && (extraData->countDelta > 0)) { - count++; - //if (IsConsoleMode()) { - // PrintItemType(extraData->type); - //} - } - ++it; - } - return count; - } - - // returns the weight of items left in the vector - float GetTotalWeight() { - float weight = 0.0; - ExtraDataVec::iterator itEnd = m_vec.end(); - ExtraDataVec::iterator it = m_vec.begin(); - while (it != itEnd) { - InventoryEntryData* extraData = (*it); - if (extraData && (extraData->countDelta > 0)) { - weight += papyrusForm::GetWeight(extraData->type) * extraData->countDelta; - } - ++it; - } - return weight; - } - - void GetRemainingForms(ExtraContainerReceiver * receiver) { - ExtraDataVec::iterator itEnd = m_vec.end(); - ExtraDataVec::iterator it = m_vec.begin(); - while (it != itEnd) { - InventoryEntryData* extraData = (*it); - if (extraData && (extraData->countDelta > 0)) { - receiver->AddFormToReceiver(extraData->type); - } - ++it; - } - } - - InventoryEntryData* GetNth(UInt32 n, UInt32 count) { - ExtraDataVec::iterator itEnd = m_vec.end(); - ExtraDataVec::iterator it = m_vec.begin(); - while (it != itEnd) { - InventoryEntryData* extraData = (*it); - if (extraData && (extraData->countDelta > 0)) { - if(count == n) - { - return extraData; - } - count++; - } - ++it; - } - return NULL; - } - -}; - - -class ContainerCountIf -{ - ExtraContainerInfo& m_info; -public: - ContainerCountIf(ExtraContainerInfo& info) : m_info(info) { } - - bool Accept(TESContainer::Entry* pEntry) const - { - SInt32 numObjects = 0; // not needed in this count - return m_info.IsValidEntry(pEntry, numObjects); - } -}; - -class ContainerFindNth -{ - ExtraContainerInfo& m_info; - UInt32 m_findIndex; - UInt32 m_curIndex; -public: - ContainerFindNth(ExtraContainerInfo& info, UInt32 findIndex) : m_info(info), m_findIndex(findIndex), m_curIndex(0) { } - - bool Accept(TESContainer::Entry* pEntry) - { - SInt32 numObjects = 0; - if (m_info.IsValidEntry(pEntry, numObjects)) { - if (m_curIndex == m_findIndex) { - return true; - } - m_curIndex++; - } - return false; - } - - UInt32 GetCurIdx() { return m_curIndex; } -}; - -class ContainerTotalWeight -{ - ExtraContainerInfo& m_info; - float m_totalWeight; -public: - ContainerTotalWeight(ExtraContainerInfo& info) : m_info(info), m_totalWeight(0.0) { } - - bool Accept(TESContainer::Entry* pEntry) - { - SInt32 numObjects = 0; - if (m_info.IsValidEntry(pEntry, numObjects)) { - m_totalWeight += papyrusForm::GetWeight(pEntry->form) * numObjects; - } - - return true; - } - - float GetTotalWeight() { return m_totalWeight; } -}; - -class ExtraContainerFiller -{ - ExtraContainerInfo& m_info; - ExtraContainerReceiver * m_receiver; -public: - ExtraContainerFiller(ExtraContainerInfo& info, ExtraContainerReceiver * receiver) : m_info(info), m_receiver(receiver) { } - - bool Accept(TESContainer::Entry* pEntry) - { - SInt32 numObjects = 0; - if (m_info.IsValidEntry(pEntry, numObjects)) { - m_receiver->AddFormToReceiver(pEntry->form); - } - - return true; - } -}; - -namespace papyrusObjectReference -{ - UInt32 GetNumItems(TESObjectREFR* pContainerRef) - { - if (!pContainerRef) - return 0; - - TESContainer* pContainer = NULL; - TESForm* pBaseForm = pContainerRef->baseForm; - if (pBaseForm) { - pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer); - } - if (!pContainer) - return 0; - - UInt32 count = 0; - - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL); - - - // first walk the base container - if (pContainer) { - ContainerCountIf counter(info); - count = pContainer->CountIf(counter); - } - - // now count the remaining items - count += info.CountItems(); - - return count; - } - - - TESForm* GetNthForm(TESObjectREFR* pContainerRef, UInt32 n) - { - if (!pContainerRef) - return NULL; - - TESContainer* pContainer = NULL; - TESForm* pBaseForm = pContainerRef->baseForm; - if (pBaseForm) { - pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer); - } - if (!pContainer) - return NULL; - - UInt32 count = 0; - - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL); - - // first look in the base container - if (pContainer) { - ContainerFindNth finder(info, n); - TESContainer::Entry* pFound = pContainer->Find(finder); - if (pFound) { - return pFound->form; - } else { - count = finder.GetCurIdx(); - } - } - - // now walk the remaining items in the map - InventoryEntryData* pEntryData = info.GetNth(n, count); - if (pEntryData) { - return pEntryData->type; - } - return NULL; - } - - float GetTotalItemWeight(TESObjectREFR* pContainerRef) - { - if (!pContainerRef) - return 0; - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - if (!pXContainerChanges) - return 0.0; - - // skyrim keeps track of the player's total item weight - if (pContainerRef == *g_thePlayer) - return pXContainerChanges->data->totalWeight; - - // Compute the weight for non-players - float weight = 0.0; - TESContainer* pContainer = NULL; - TESForm* pBaseForm = pContainerRef->baseForm; - if (pBaseForm) { - pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer); - } - - if (!pContainer) - return 0; - - ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL); - - // first walk the base container - if (pContainer) { - ContainerTotalWeight weightCounter(info); - pContainer->Visit(weightCounter); - weight = weightCounter.GetTotalWeight(); - } - - // now sum the remaining weight - weight += info.GetTotalWeight(); - return weight; - } - - float GetTotalArmorWeight(TESObjectREFR* pContainerRef) - { - if (!pContainerRef) - return 0; - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - return (pXContainerChanges) ? pXContainerChanges->data->armorWeight : 0.0; - } - - bool IsHarvested(TESObjectREFR* pProduceRef) - { - if(!pProduceRef) - return false; - - UInt8 formType = pProduceRef->baseForm->formType; - if (formType == kFormType_Tree || formType == kFormType_Flora) { - return (pProduceRef->flags & TESObjectREFR::kFlag_Harvested) != 0; - } - return false; - } - - void SetHarvested(TESObjectREFR * pProduceRef, bool isHarvested) - { - if(pProduceRef) { - UInt8 formType = pProduceRef->baseForm->formType; - if (formType == kFormType_Tree || formType == kFormType_Flora) { - if(isHarvested) - { - pProduceRef->flags |= TESObjectREFR::kFlag_Harvested; - pProduceRef->MarkChanged(TESObjectREFR::kChange_IsEmpty); - } - else - { - pProduceRef->flags &= ~TESObjectREFR::kFlag_Harvested; - pProduceRef->ClearChanged(TESObjectREFR::kChange_IsEmpty); - } - } - - TaskInterface::UpdateHarvestModel(pProduceRef); - } - } - - void SetItemHealthPercent(TESObjectREFR* object, float value) - { - // Object must be a weapon, or armor - if(object) { - referenceUtils::SetItemHealthPercent(object->baseForm, &object->extraData, value); - } - } - - float GetItemMaxCharge(TESObjectREFR* object) - { - if (!object) - return 0.0; - - return referenceUtils::GetItemMaxCharge(object->baseForm, &object->extraData); - } - - void SetItemMaxCharge(TESObjectREFR* object, float maxCharge) - { - if (object) { - referenceUtils::SetItemMaxCharge(object->baseForm, &object->extraData, maxCharge); - } - } - - float GetItemCharge(TESObjectREFR* object) - { - if (!object) - return 0.0; - - return referenceUtils::GetItemCharge(object->baseForm, &object->extraData); - } - - void SetItemCharge(TESObjectREFR* object, float value) - { - // Object must be an enchanted weapon - if(object) { - referenceUtils::SetItemCharge(object->baseForm, &object->extraData, value); - } - } - - EnchantmentItem * GetEnchantment(TESObjectREFR* object) - { - if (!object) - return NULL; - - return referenceUtils::GetEnchantment(&object->extraData); - } - - void CreateEnchantment(TESObjectREFR* object, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations) - { - if(object) { - referenceUtils::CreateEnchantment(object->baseForm, &object->extraData, maxCharge, effects, magnitudes, areas, durations); - } - } - - void SetEnchantment(TESObjectREFR* object, EnchantmentItem * enchantment, float maxCharge) - { - if(object) { - referenceUtils::SetEnchantment(object->baseForm, &object->extraData, enchantment, maxCharge); - } - } - - AlchemyItem * GetPoison(TESObjectREFR* object) - { - if (!object) - return NULL; - - return referenceUtils::GetPoison(&object->extraData); - } - - - void ResetInventory(TESObjectREFR * obj) - { - obj->ResetInventory(false); - } - - bool IsOffLimits(TESObjectREFR * obj) - { - return CALL_MEMBER_FN(obj, IsOffLimits)(); - } - - BSFixedString GetDisplayName(TESObjectREFR* object) - { - return (object) ? CALL_MEMBER_FN(object, GetReferenceName)() : ""; - } - - bool SetDisplayName(TESObjectREFR* object, BSFixedString value, bool force) - { - return referenceUtils::SetDisplayName(&object->extraData, value, force); - } - - TESObjectREFR * GetEnableParent(TESObjectREFR* object) - { - if(!object) - return NULL; - - ExtraEnableStateParent* xEnableParent = static_cast(object->extraData.GetByType(kExtraData_EnableStateParent)); - if(!xEnableParent) - return NULL; - - return xEnableParent->GetReference(); - } - - UInt32 GetNumReferenceAliases(TESObjectREFR* object) - { - if(!object) - return 0; - - return referenceUtils::GetNumReferenceAliases(&object->extraData); - } - - BGSRefAlias * GetNthReferenceAlias(TESObjectREFR* object, UInt32 n) - { - if(!object) - return 0; - - return referenceUtils::GetNthReferenceAlias(&object->extraData, n); - } - - VMResultArray GetReferenceAliases(TESObjectREFR* object) - { - VMResultArray result; - if(!object) - return result; - - return referenceUtils::GetReferenceAliases(&object->extraData); - } - - void GetAllForms(TESObjectREFR* pContainerRef, BGSListForm * list) - { - if(pContainerRef && list) { - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - if (pXContainerChanges) { - TESContainer* pContainer = NULL; - TESForm* pBaseForm = pContainerRef->baseForm; - if (pBaseForm) - pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer); - - ExtraContainerFormList formContainer(list); - ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL); - // first walk the base container - if (pContainer) { - ExtraContainerFiller formFiller(info, &formContainer); - pContainer->Visit(formFiller); - } - - info.GetRemainingForms(&formContainer); - } - } - } - - VMResultArray GetContainerForms(TESObjectREFR* pContainerRef) - { - VMResultArray result; - if(pContainerRef) { - ExtraContainerChanges* pXContainerChanges = static_cast(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges)); - if (pXContainerChanges) { - TESContainer* pContainer = NULL; - TESForm* pBaseForm = pContainerRef->baseForm; - if (pBaseForm) - pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer); - - // Declare the container to receive the forms - ExtraContainerArray formContainer(&result); - ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL); - // first walk the base container - if (pContainer) { - // Fill the container - ExtraContainerFiller formFiller(info, &formContainer); - pContainer->Visit(formFiller); - } - - // Fill the container with remaining forms - info.GetRemainingForms(&formContainer); - } - } - - return result; - } -}; - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusObjectReference::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNumItems", "ObjectReference", papyrusObjectReference::GetNumItems, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthForm", "ObjectReference", papyrusObjectReference::GetNthForm, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetTotalItemWeight", "ObjectReference", papyrusObjectReference::GetTotalItemWeight, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetTotalArmorWeight", "ObjectReference", papyrusObjectReference::GetTotalArmorWeight, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsHarvested", "ObjectReference", papyrusObjectReference::IsHarvested, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetHarvested", "ObjectReference", papyrusObjectReference::SetHarvested, registry)); - - // Item modifications, Tempering/Charges - registry->RegisterFunction( - new NativeFunction1("SetItemHealthPercent", "ObjectReference", papyrusObjectReference::SetItemHealthPercent, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetItemMaxCharge", "ObjectReference", papyrusObjectReference::GetItemMaxCharge, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetItemMaxCharge", "ObjectReference", papyrusObjectReference::SetItemMaxCharge, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetItemCharge", "ObjectReference", papyrusObjectReference::GetItemCharge, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetItemCharge", "ObjectReference", papyrusObjectReference::SetItemCharge, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetEnchantment", "ObjectReference", papyrusObjectReference::GetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetEnchantment", "ObjectReference", papyrusObjectReference::SetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction5, VMArray, VMArray, VMArray>("CreateEnchantment", "ObjectReference", papyrusObjectReference::CreateEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetPoison", "ObjectReference", papyrusObjectReference::GetPoison, registry)); - - - registry->RegisterFunction( - new NativeFunction0("GetDisplayName", "ObjectReference", papyrusObjectReference::GetDisplayName, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetDisplayName", "ObjectReference", papyrusObjectReference::SetDisplayName, registry)); - - registry->RegisterFunction( - new NativeFunction0("ResetInventory", "ObjectReference", papyrusObjectReference::ResetInventory, registry)); - - registry->RegisterFunction( - new NativeFunction0("IsOffLimits", "ObjectReference", papyrusObjectReference::IsOffLimits, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetEnableParent", "ObjectReference", papyrusObjectReference::GetEnableParent, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumReferenceAliases", "ObjectReference", papyrusObjectReference::GetNumReferenceAliases, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthReferenceAlias", "ObjectReference", papyrusObjectReference::GetNthReferenceAlias, registry)); - - registry->RegisterFunction( - new NativeFunction0>("GetReferenceAliases", "ObjectReference", papyrusObjectReference::GetReferenceAliases, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetAllForms", "ObjectReference", papyrusObjectReference::GetAllForms, registry)); - - registry->RegisterFunction( - new NativeFunction0>("GetContainerForms", "ObjectReference", papyrusObjectReference::GetContainerForms, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusObjectReference.h b/source/fs.dll/skse64/skse64/PapyrusObjectReference.h deleted file mode 100644 index 3bba2f77..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusObjectReference.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "GameTypes.h" -#include "PapyrusArgs.h" - -class TESObjectREFR; -class TESForm; -class EnchantmentItem; -class VMClassRegistry; -class EffectSetting; -class BGSListForm; - -namespace papyrusObjectReference -{ - void RegisterFuncs(VMClassRegistry* registry); - UInt32 GetNumItems(TESObjectREFR* pContainerRef); - TESForm* GetNthForm(TESObjectREFR* pContainerRef, UInt32 n); - float GetTotalItemWeight(TESObjectREFR* pContainerRef); - float GetTotalArmorWeight(TESObjectREFR* pContainerRef); - - void SetItemHealthPercent(TESObjectREFR* object, float value); - float GetItemCharge(TESObjectREFR* object); - float GetItemMaxCharge(TESObjectREFR* object); - void SetItemCharge(TESObjectREFR* object, float value); - EnchantmentItem * GetEnchantment(TESObjectREFR* object); - - void CreateEnchantment(TESObjectREFR* object, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations); - void SetEnchantment(TESObjectREFR* object, EnchantmentItem * form, float maxCharge); - - void ResetInventory(TESObjectREFR * obj); - bool IsOffLimits(TESObjectREFR * obj); - BSFixedString GetDisplayName(TESObjectREFR* object); - bool SetDisplayName(TESObjectREFR* object, BSFixedString value, bool force); - TESObjectREFR * GetEnableParent(TESObjectREFR* object); - - bool IsHarvested(TESObjectREFR* pProduceRef); - - bool HasNiNode(TESObjectREFR * obj, BSFixedString nodeName); - float GetNiNodePositionX(TESObjectREFR * obj, BSFixedString nodeName); - float GetNiNodePositionY(TESObjectREFR * obj, BSFixedString nodeName); - float GetNiNodePositionZ(TESObjectREFR * obj, BSFixedString nodeName); - float GetNiNodeScale(TESObjectREFR * obj, BSFixedString nodeName); - void SetNiNodeScale(TESObjectREFR * obj, BSFixedString nodeName, float value); - - void GetAllForms(TESObjectREFR* pContainerRef, BGSListForm * list); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusObjects.cpp b/source/fs.dll/skse64/skse64/PapyrusObjects.cpp deleted file mode 100644 index da0303a0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusObjects.cpp +++ /dev/null @@ -1,337 +0,0 @@ -#include "PapyrusObjects.h" - -#include "Serialization.h" - -#include "PapyrusVM.h" -#include - -namespace -{ - static const size_t kMaxNameLen = 1024; -} - -/// -/// SKSEObjectRegistry -/// - -void SKSEObjectRegistry::RegisterFactory(ISKSEObjectFactory * factory) -{ - uintptr_t vtbl = *reinterpret_cast(factory); - std::string className( factory->ClassName() ); - factoryMap_[className] = vtbl; -} - -const ISKSEObjectFactory* SKSEObjectRegistry::GetFactoryByName(const char* name) const -{ - std::string t( name ); - - const ISKSEObjectFactory* result = NULL; - - FactoryMapT::const_iterator it = factoryMap_.find(t); - if (it != factoryMap_.end()) - { - result = reinterpret_cast(&it->second); - } - - return result; -} - -/// -/// SKSEPersistentObjectStorage -/// - -void SKSEPersistentObjectStorage::CleanDroppedStacks() -{ - VMClassRegistry* registry = (*g_skyrimVM)->GetClassRegistry(); - - for (UInt32 i=0; iGetStackInfo(e.owningStackId) != NULL) - continue; - - // Stack no longer active, drop this entry - - delete e.obj; - e.obj = NULL; - - freeIndices_.push_back(i); - - _MESSAGE("SKSEPersistentObjectStorage::CleanDroppedStacks: Freed object at index %d.", i); - } -} - -void SKSEPersistentObjectStorage::ClearAndRelease() -{ - freeIndices_.clear(); - - for (DataT::iterator it = data_.begin(); it != data_.end(); ++it) - { - Entry& e = *it; - if (e.obj != NULL) - delete e.obj; - } - - data_.clear(); -} - -bool SKSEPersistentObjectStorage::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - // Before saving, purge entries whose owning stack is no longer running. - // This can happen if someone forgot to release an object. - // We don't want these resource leaks to pile up in the co-save. - CleanDroppedStacks(); - - // Save data - UInt32 dataSize = data_.size(); - if (! WriteData(intfc, &dataSize)) - return false; - - UInt32 filledSize = data_.size() - freeIndices_.size(); - if (! WriteData(intfc, &filledSize)) - return false; - - for (UInt32 i=0; i= data_.size()) - { - _MESSAGE("SKSEPersistentObjectStorage::AccessObject(%d): Invalid handle.", handle); - return NULL; - } - - Entry& e = data_[index]; - - if (e.obj == NULL) - { - _MESSAGE("SKSEPersistentObjectStorage::AccessObject(%d): Object was NULL.", handle); - return NULL; - } - - ISKSEObject* result = e.obj; - if (result == NULL) - { - _MESSAGE("SKSEPersistentObjectStorage::AccessObject(%d): Invalid type (%s).", handle, e.obj->ClassName()); - return NULL; - } - - return result; -} - -ISKSEObject* SKSEPersistentObjectStorage::Take(SInt32 handle) -{ - IScopedCriticalSection scopedLock( &lock_ ); - - SInt32 index = handle - 1; - - if (index < 0 || index >= data_.size()) - { - _MESSAGE("SKSEPersistentObjectStorage::AccessObject(%d): Invalid handle.", handle); - return NULL; - } - - Entry& e = data_[index]; - - if (e.obj == NULL) - { - _MESSAGE("SKSEPersistentObjectStorage::TakeObject(%d): Object was NULL.", handle); - return NULL; - } - - ISKSEObject* result = e.obj; - if (result != NULL) - { - e.obj = NULL; - freeIndices_.push_back(index); - } - else - { - _MESSAGE("SKSEPersistentObjectStorage::TakeObject(%d): Invalid type (%s).", handle, e.obj->ClassName()); - return NULL; - } - - return result; -} - -/// -/// Serialization helpers -/// - -bool WriteSKSEObject(SKSESerializationInterface* intfc, ISKSEObject* obj) -{ - using namespace Serialization; - - const char* name = obj->ClassName(); - const UInt32 version = obj->ClassVersion(); - - intfc->OpenRecord('OBJE', version); - - size_t rawLen = strlen(name); - UInt32 len = (std::min)(rawLen, kMaxNameLen); - - if (! WriteData(intfc, &len)) - return false; - - if (! intfc->WriteRecordData(name, len)) - return false; - - return obj->Save(intfc); -} - -bool ReadSKSEObject(SKSESerializationInterface* intfc, ISKSEObject*& objOut) -{ - UInt32 type, length, objVersion; - - if (! intfc->GetNextRecordInfo(&type, &objVersion, &length)) - return false; - - if (type != 'OBJE') - { - _MESSAGE("ReadSKSEObject: Error loading unexpected chunk type %08X (%.4s)", type, &type); - return false; - } - - // Read the name of the serialized class - UInt32 len; - if (! intfc->ReadRecordData(&len, sizeof(len))) - return false; - - if (len > kMaxNameLen) - { - _MESSAGE("ReadSKSEObject: Serialization error. Class name len extended kMaxNameLen."); - return false; - } - - char buf[kMaxNameLen+1] = { 0 }; - if (! intfc->ReadRecordData(&buf, len)) - return false; - - // Get the factory - const ISKSEObjectFactory* factory = SKSEObjectRegistryInstance().GetFactoryByName(buf); - if (factory == NULL) - { - _MESSAGE("ReadSKSEObject: Serialization error. Factory missing for %s.", &buf); - return false; - } - - // Intantiate and load the actual data - ISKSEObject* obj = factory->Create(); - if (! obj->Load(intfc, objVersion)) - { - // Load failed. clean up. - objOut = NULL; - delete obj; - - return false; - } - - objOut = obj; - return true; -} - -/// -/// Global instances -/// - -SKSEObjectRegistry& SKSEObjectRegistryInstance() -{ - static SKSEObjectRegistry instance; - return instance; -} - -SKSEPersistentObjectStorage& SKSEObjectStorageInstance() -{ - static SKSEPersistentObjectStorage instance; - return instance; -} diff --git a/source/fs.dll/skse64/skse64/PapyrusObjects.h b/source/fs.dll/skse64/skse64/PapyrusObjects.h deleted file mode 100644 index 27546b87..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusObjects.h +++ /dev/null @@ -1,165 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "common/ICriticalSection.h" - -struct SKSESerializationInterface; -class TESForm; -class VMClassRegistry; - -// Serializable classes deriving from ISKSEObject must define a -// serialization constructor that takes SerializationTag as the single argument. -// After it has been called, either Load() is used to fill in the data, -// or in case the load failed, the instance is destroyed again. -struct SerializationTag {}; - -/// -/// ISKSEObject - Interface for a heap allocated, co-save serializable object. -/// - -class ISKSEObject -{ -public: - virtual ~ISKSEObject() {} - - virtual const char* ClassName() const = 0; - virtual UInt32 ClassVersion() const = 0; - - virtual bool Save(SKSESerializationInterface* intfc) = 0; - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version) = 0; -}; - -/// -/// SKSEObjectFactory -/// - -class ISKSEObjectFactory -{ -public: - virtual ~ISKSEObjectFactory() {} - - virtual ISKSEObject* Create() const = 0; - virtual const char* ClassName() const = 0; -}; - -template -class ConcreteSKSEObjectFactory : public ISKSEObjectFactory -{ -public: - virtual ISKSEObject* Create() const - { - SerializationTag tag; - return new T( tag ); - } - virtual const char* ClassName() const - { - SerializationTag tag; - T tempInstance(tag); - return tempInstance.ClassName(); - } -}; - -/// -/// SKSEObjectRegistry -/// - -class SKSEObjectRegistry -{ -private: - typedef std::map FactoryMapT; - -public: - template - bool RegisterClass() - { - ConcreteSKSEObjectFactory factory; - RegisterFactory(&factory); - return true; - } - - virtual void RegisterFactory(ISKSEObjectFactory * factory); - virtual const ISKSEObjectFactory* GetFactoryByName(const char* name) const; - -private: - // Stores the vtables directly - FactoryMapT factoryMap_; -}; - -/// -/// SKSEPersistentObjectStorage -/// - -class SKSEPersistentObjectStorage -{ - struct Entry; - - // Note: handle = index + 1 - // +1, because in previous versions the invalid handle was 0 so people - // might test for != 0 -public: - - // Transfer ownership to registry - template - SInt32 StoreObject(T* obj, UInt32 owningStackId) - {// lock_ - return Store(obj, owningStackId); - }// ~lock_ - - // Access object while keeping in storage - template - T* AccessObject(SInt32 handle) - {// lock_ - return reinterpret_cast(Access(handle)); - }// ~lock_ - - // Remove object from storage and take ownership of the pointer - template - T* TakeObject(SInt32 handle) - {// lock_ - return reinterpret_cast(Take(handle)); - }// lock_ - - virtual SInt32 Store(ISKSEObject* obj, UInt32 owningStackId); - virtual ISKSEObject* Access(SInt32 handle); - virtual ISKSEObject* Take(SInt32 handle); - - bool Save(SKSESerializationInterface* intfc); - bool Load(SKSESerializationInterface* intfc, UInt32 version); - - void CleanDroppedStacks(); - void ClearAndRelease(); - - enum { kSaveVersion = 1 }; - -private: - struct Entry - { - ISKSEObject* obj; - UInt32 owningStackId; - }; - - typedef std::vector DataT; - typedef std::vector IndexCacheT; - - ICriticalSection lock_; - DataT data_; - IndexCacheT freeIndices_; -}; - -/// -/// Serialization helpers -/// - -bool WriteSKSEObject(SKSESerializationInterface* intfc, ISKSEObject* obj); -bool ReadSKSEObject(SKSESerializationInterface* intfc, ISKSEObject*& objOut); - -/// -/// Global instances -/// - -SKSEObjectRegistry& SKSEObjectRegistryInstance(); - -SKSEPersistentObjectStorage& SKSEObjectStorageInstance(); diff --git a/source/fs.dll/skse64/skse64/PapyrusPerk.cpp b/source/fs.dll/skse64/skse64/PapyrusPerk.cpp deleted file mode 100644 index c1b8aca1..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusPerk.cpp +++ /dev/null @@ -1,407 +0,0 @@ -#include "PapyrusPerk.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameRTTI.h" - -namespace papyrusPerk -{ - BGSPerk * GetNextPerk(BGSPerk * perk) - { - return (perk) ? perk->nextPerk : NULL; - } - - UInt32 GetNumEntries(BGSPerk * perk) - { - return (perk) ? perk->perkEntries.count : 0; - } - - UInt32 GetNthEntryRank(BGSPerk * perk, UInt32 n) - { - if(!perk) - return 0; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return 0; - - return perkEntry->rank; - } - - UInt32 GetNthEntryPriority(BGSPerk * perk, UInt32 n) - { - if(!perk) - return 0; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return 0; - - return perkEntry->priority; - } - - // Quest Perk Entry - TESQuest * GetNthEntryQuest(BGSPerk * perk, UInt32 n) - { - if(!perk) - return NULL; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return NULL; - - BGSQuestPerkEntry * questEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSQuestPerkEntry); - if(!questEntry) - return NULL; - - return questEntry->quest; - } - - UInt32 GetNthEntryStage(BGSPerk * perk, UInt32 n) - { - if(!perk) - return 0; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return 0; - - BGSQuestPerkEntry * questEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSQuestPerkEntry); - if(!questEntry) - return 0; - - return questEntry->stage; - } - - // Ability Perk Entry - // EntryPoint Perk Entry - SpellItem * GetNthEntrySpell(BGSPerk * perk, UInt32 n) - { - if(!perk) - return NULL; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return NULL; - - BGSAbilityPerkEntry * abilityEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSAbilityPerkEntry); - if(abilityEntry) - return abilityEntry->spellItem; - - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataSpellItem * functionDataSpell = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataSpellItem); - if(functionDataSpell) - return functionDataSpell->spellItem; - - BGSEntryPointFunctionDataActivateChoice * functionDataActivation = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataActivateChoice); - if(functionDataActivation) - return functionDataActivation->appliedSpell; - } - - return NULL; - } - - TESLevItem * GetNthEntryLeveledList(BGSPerk * perk, UInt32 n) - { - if(!perk) - return NULL; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return NULL; - - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataLeveledList * functionDataLeveledList = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataLeveledList); - if(functionDataLeveledList) - return functionDataLeveledList->leveledList; - } - - return NULL; - } - - BSFixedString GetNthEntryText(BGSPerk * perk, UInt32 n) - { - if(!perk) - return NULL; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return NULL; - - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataText * functionDataText = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataText); - if(functionDataText) - return functionDataText->text; - - BGSEntryPointFunctionDataActivateChoice * functionDataActivation = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataActivateChoice); - if(functionDataActivation) - return functionDataActivation->label; - - BGSEntryPointFunctionDataBooleanGraphVariable * functionDataGraphVar = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataBooleanGraphVariable); - if(functionDataGraphVar) - return functionDataGraphVar->variable; - } - - return NULL; - } - - float GetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i) - { - if(!perk || i >= BGSEntryPointFunctionDataTwoValue::kNumValues) - return 0.0; - - BGSPerkEntry * perkEntry; - if(!perk->perkEntries.GetNthItem(n, perkEntry)) - return 0.0; - - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataOneValue * functionOne = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataOneValue); - if(functionOne) - return functionOne->value; - - BGSEntryPointFunctionDataTwoValue * functionTwo = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataTwoValue); - if(functionTwo) - return functionTwo->value[i]; - } - - return 0.0; - } - - bool SetNthEntryRank(BGSPerk * perk, UInt32 n, UInt32 value) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - perkEntry->rank = value; - return true; - } - - return false; - } - - bool SetNthEntryPriority(BGSPerk * perk, UInt32 n, UInt32 value) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - perkEntry->priority = value; - return true; - } - - return false; - } - - // Quest Perk Entry - bool SetNthEntryQuest(BGSPerk * perk, UInt32 n, TESQuest * quest) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSQuestPerkEntry * questEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSQuestPerkEntry); - if(questEntry) { - questEntry->quest = quest; - return true; - } - } - - return false; - } - - bool SetNthEntryStage(BGSPerk * perk, UInt32 n, UInt32 stage) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSQuestPerkEntry * questEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSQuestPerkEntry); - if(questEntry) { - questEntry->stage = stage; - return true; - } - } - - return false; - } - - // Ability Perk Entry - // EntryPoint Perk Entry - bool SetNthEntrySpell(BGSPerk * perk, UInt32 n, SpellItem * spell) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSAbilityPerkEntry * abilityEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSAbilityPerkEntry); - if(abilityEntry) { - abilityEntry->spellItem = spell; - return true; - } - - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataSpellItem * functionDataSpell = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataSpellItem); - if(functionDataSpell) { - functionDataSpell->spellItem = spell; - return true; - } - - BGSEntryPointFunctionDataActivateChoice * functionDataActivation = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataActivateChoice); - if(functionDataActivation) { - functionDataActivation->appliedSpell = spell; - return true; - } - } - } - - return false; - } - - bool SetNthEntryLeveledList(BGSPerk * perk, UInt32 n, TESLevItem * leveledList) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataLeveledList * functionDataLeveledList = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataLeveledList); - if(functionDataLeveledList) { - functionDataLeveledList->leveledList = leveledList; - return true; - } - } - } - - return false; - } - - bool SetNthEntryText(BGSPerk * perk, UInt32 n, BSFixedString str) - { - if(!perk) - return false; - - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataText * functionDataText = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataText); - if(functionDataText) { - functionDataText->text = str; - return true; - } - - BGSEntryPointFunctionDataActivateChoice * functionDataActivation = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataActivateChoice); - if(functionDataActivation) { - functionDataActivation->label = str; - return true; - } - - BGSEntryPointFunctionDataBooleanGraphVariable * functionDataGraphVar = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataBooleanGraphVariable); - if(functionDataGraphVar) { - functionDataGraphVar->variable = str; - return true; - } - } - } - - return false; - } - - bool SetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i, float value) - { - if(perk && i < BGSEntryPointFunctionDataTwoValue::kNumValues) { - BGSPerkEntry * perkEntry; - if(perk->perkEntries.GetNthItem(n, perkEntry)) { - BGSEntryPointPerkEntry * entryPointEntry = DYNAMIC_CAST(perkEntry, BGSPerkEntry, BGSEntryPointPerkEntry); - if(entryPointEntry) { - BGSEntryPointFunctionDataOneValue * functionOne = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataOneValue); - if(functionOne) { - functionOne->value = value; - return true; - } - - BGSEntryPointFunctionDataTwoValue * functionTwo = DYNAMIC_CAST(entryPointEntry->data, BGSEntryPointFunctionData, BGSEntryPointFunctionDataTwoValue); - if(functionTwo) { - functionTwo->value[i] = value; - return true; - } - } - } - } - - return false; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusPerk::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNextPerk", "Perk", papyrusPerk::GetNextPerk, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumEntries", "Perk", papyrusPerk::GetNumEntries, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryRank", "Perk", papyrusPerk::GetNthEntryRank, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryPriority", "Perk", papyrusPerk::GetNthEntryPriority, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryQuest", "Perk", papyrusPerk::GetNthEntryQuest, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryStage", "Perk", papyrusPerk::GetNthEntryStage, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntrySpell", "Perk", papyrusPerk::GetNthEntrySpell, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryLeveledList", "Perk", papyrusPerk::GetNthEntryLeveledList, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEntryText", "Perk", papyrusPerk::GetNthEntryText, registry)); - - registry->RegisterFunction( - new NativeFunction2("GetNthEntryValue", "Perk", papyrusPerk::GetNthEntryValue, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryRank", "Perk", papyrusPerk::SetNthEntryRank, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryPriority", "Perk", papyrusPerk::SetNthEntryPriority, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryQuest", "Perk", papyrusPerk::SetNthEntryQuest, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryStage", "Perk", papyrusPerk::SetNthEntryStage, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntrySpell", "Perk", papyrusPerk::SetNthEntrySpell, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryLeveledList", "Perk", papyrusPerk::SetNthEntryLeveledList, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEntryText", "Perk", papyrusPerk::SetNthEntryText, registry)); - - registry->RegisterFunction( - new NativeFunction3("SetNthEntryValue", "Perk", papyrusPerk::SetNthEntryValue, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusPerk.h b/source/fs.dll/skse64/skse64/PapyrusPerk.h deleted file mode 100644 index ab4eb7f8..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusPerk.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -class SpellItem; -class TESQuest; -class TESLevItem; -class BGSPerk; -class VMClassRegistry; - -#include "GameTypes.h" - -namespace papyrusPerk -{ - void RegisterFuncs(VMClassRegistry* registry); - - BGSPerk * GetNextPerk(BGSPerk * perk); - UInt32 GetNumEntries(BGSPerk * perk); - UInt32 GetNthEntryRank(BGSPerk * perk, UInt32 n); - UInt32 GetNthEntryPriority(BGSPerk * perk, UInt32 n); - TESQuest * GetNthEntryQuest(BGSPerk * perk, UInt32 n); - UInt32 GetNthEntryStage(BGSPerk * perk, UInt32 n); - SpellItem * GetNthEntrySpell(BGSPerk * perk, UInt32 n); - TESLevItem * GetNthEntryLeveledList(BGSPerk * perk, UInt32 n); - BSFixedString GetNthEntryText(BGSPerk * perk, UInt32 n); - float GetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i); - - bool SetNthEntryRank(BGSPerk * perk, UInt32 n, UInt32 value); - bool SetNthEntryPriority(BGSPerk * perk, UInt32 n, UInt32 value); - bool SetNthEntryQuest(BGSPerk * perk, UInt32 n, TESQuest * quest); - bool SetNthEntryStage(BGSPerk * perk, UInt32 n, UInt32 stage); - bool SetNthEntrySpell(BGSPerk * perk, UInt32 n, SpellItem * spell); - bool SetNthEntryLeveledList(BGSPerk * perk, UInt32 n, TESLevItem * leveledList); - bool SetNthEntryText(BGSPerk * perk, UInt32 n, BSFixedString str); - bool SetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i, float value); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusPotion.cpp b/source/fs.dll/skse64/skse64/PapyrusPotion.cpp deleted file mode 100644 index 6fc5b8ed..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusPotion.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "PapyrusPotion.h" -#include "PapyrusSpell.h" -#include "GameObjects.h" - -namespace papyrusPotion -{ - bool IsFood(AlchemyItem* thisPotion) - { - return (thisPotion) ? thisPotion->IsFood() : false; - } - - bool IsPoison(AlchemyItem* thisPotion) - { - return (thisPotion) ? thisPotion->IsPoison() : false; - } - - BGSSoundDescriptorForm* GetUseSound(AlchemyItem* thisPotion) - { - return (thisPotion) ? thisPotion->itemData.useSound : NULL; - } - - UInt32 GetNumEffects(AlchemyItem* thisMagic) - { return magicItemUtils::GetNumEffects(thisMagic); } - - float GetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagnitude(thisMagic, index); } - - UInt32 GetNthEffectArea(AlchemyItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectArea(thisMagic, index); } - - UInt32 GetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectDuration(thisMagic, index); } - - EffectSetting* GetNthEffectMagicEffect(AlchemyItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagicEffect(thisMagic, index); } - - UInt32 GetCostliestEffectIndex(AlchemyItem* thisMagic) - { return magicItemUtils::GetCostliestEffectIndex(thisMagic); } - - void SetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index, float value) - { magicItemUtils::SetNthEffectMagnitude(thisMagic, index, value); } - - void SetNthEffectArea(AlchemyItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectArea(thisMagic, index, value); } - - void SetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectDuration(thisMagic, index, value); } - - VMResultArray GetEffectMagnitudes(AlchemyItem* thisMagic) { return magicItemUtils::GetEffectMagnitudes(thisMagic); } - VMResultArray GetEffectAreas(AlchemyItem* thisMagic) { return magicItemUtils::GetEffectAreas(thisMagic); } - VMResultArray GetEffectDurations(AlchemyItem* thisMagic) { return magicItemUtils::GetEffectDurations(thisMagic); } - VMResultArray GetMagicEffects(AlchemyItem* thisMagic) { return magicItemUtils::GetMagicEffects(thisMagic); } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusPotion::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("IsFood", "Potion", papyrusPotion::IsFood, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsPoison", "Potion", papyrusPotion::IsPoison, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumEffects", "Potion", papyrusPotion::GetNumEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagnitude", "Potion", papyrusPotion::GetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectArea", "Potion", papyrusPotion::GetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectDuration", "Potion", papyrusPotion::GetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagicEffect", "Potion", papyrusPotion::GetNthEffectMagicEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCostliestEffectIndex", "Potion", papyrusPotion::GetCostliestEffectIndex, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetUseSound", "Potion", papyrusPotion::GetUseSound, registry)); - - // Sets - registry->RegisterFunction( - new NativeFunction2("SetNthEffectMagnitude", "Potion", papyrusPotion::SetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectArea", "Potion", papyrusPotion::SetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectDuration", "Potion", papyrusPotion::SetNthEffectDuration, registry)); - - // Array gets - registry->RegisterFunction( - new NativeFunction0 >("GetEffectMagnitudes", "Potion", papyrusPotion::GetEffectMagnitudes, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectAreas", "Potion", papyrusPotion::GetEffectAreas, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectDurations", "Potion", papyrusPotion::GetEffectDurations, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetMagicEffects", "Potion", papyrusPotion::GetMagicEffects, registry)); - - registry->SetFunctionFlags("Potion", "IsFood", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetNumEffects", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetNthEffectMagicEffect", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetCostliestEffectIndex", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Potion", "SetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "SetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "SetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Potion", "GetEffectMagnitudes", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetEffectAreas", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetEffectDurations", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Potion", "GetMagicEffects", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusPotion.h b/source/fs.dll/skse64/skse64/PapyrusPotion.h deleted file mode 100644 index 4581d074..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusPotion.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -class AlchemyItem; -class BGSPerk; -class EffectSetting; -class BGSSoundDescriptorForm; -class VMClassRegistry; - -namespace papyrusPotion -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool IsFood(AlchemyItem* thisPotion); - bool IsPoison(AlchemyItem* thisPotion); - UInt32 GetNumEffects(AlchemyItem* thisMagic); - float GetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(AlchemyItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(AlchemyItem* thisMagic, UInt32 index); - UInt32 GetCostliestEffectIndex(AlchemyItem* thisMagic); - BGSSoundDescriptorForm* GetUseSound(AlchemyItem* thisPotion); - - void SetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index, float value); - void SetNthEffectArea(AlchemyItem* thisMagic, UInt32 index, UInt32 value); - void SetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index, UInt32 value); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusQuest.cpp b/source/fs.dll/skse64/skse64/PapyrusQuest.cpp deleted file mode 100644 index 2b3da9fb..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusQuest.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "PapyrusQuest.h" -#include "PapyrusArgs.h" - -#include "GameForms.h" -#include "GameData.h" - -#include - -#include "common/ICriticalSection.h" - -// needs to be extern and set appropriately when a Quest is constructed -UInt32 g_invalidateQuestCache; - -namespace papyrusQuest -{ - ICriticalSection s_questCacheLock; - typedef std::map QuestCache; - static QuestCache s_questCache; - - TESQuest* GetQuest(StaticFunctionTag*, BSFixedString editorID) - { - s_questCacheLock.Enter(); - - if(g_invalidateQuestCache == 1) { - g_invalidateQuestCache = 0; - s_questCache.clear(); - } - - if (s_questCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& quests = pDataHandler->quests; - for (UInt32 n = 0; n < quests.count; n++) { - TESQuest* pQuest = NULL; - quests.GetNthItem(n, pQuest); - if (pQuest) { - s_questCache.insert(QuestCache::value_type(BSFixedString(pQuest->questID.Get()), pQuest)); - } - } - } - - s_questCacheLock.Leave(); - - QuestCache::iterator it = s_questCache.find(editorID); - TESQuest* pQuest = (it != s_questCache.end()) ? it->second : NULL; - return pQuest; - } - - BSFixedString GetId(TESQuest* thisQuest) - { - return (thisQuest) ? thisQuest->questID.Get() : NULL; - } - - UInt32 GetPriority(TESQuest* thisQuest) - { - return (thisQuest) ? thisQuest->unk0D8.priority : 0; - } - - UInt32 GetNumAliases(TESQuest* thisQuest) - { - return (thisQuest) ? thisQuest->aliases.count : 0; - } - - BGSBaseAlias* GetNthAlias(TESQuest* thisQuest, UInt32 n) - { - if(!thisQuest || n > thisQuest->aliases.count) - return NULL; - - BGSBaseAlias* alias = NULL; - thisQuest->aliases.GetNthItem(n, alias); - if(alias) { - return alias; - } - - return NULL; - } - - BGSBaseAlias* GetAliasByName(TESQuest* thisQuest, BSFixedString s) - { - if(!thisQuest || !s.data) - return NULL; - - for(UInt32 n = 0; n < thisQuest->aliases.count; n++) { - BGSBaseAlias* alias = NULL; - thisQuest->aliases.GetNthItem(n, alias); - if(alias && alias->name == s) { - return alias; - } - } - - return NULL; - } - - VMResultArray GetAliases(TESQuest* thisQuest) - { - VMResultArray foundAliases; - if(!thisQuest) - return foundAliases; - - for(UInt32 n = 0; n < thisQuest->aliases.count; n++) { - BGSBaseAlias* alias = NULL; - thisQuest->aliases.GetNthItem(n, alias); - if(alias) { - foundAliases.push_back(alias); - } - } - - return foundAliases; - } - - BGSBaseAlias* GetAliasById(TESQuest* thisQuest, UInt32 aliasId) - { - if(!thisQuest) - return NULL; - - for(UInt32 n = 0; n < thisQuest->aliases.count; n++) { - BGSBaseAlias* alias = NULL; - thisQuest->aliases.GetNthItem(n, alias); - if(alias && alias->aliasId == aliasId) { - return alias; - } - } - - return NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusQuest::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetQuest", "Quest", papyrusQuest::GetQuest, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetId", "Quest", papyrusQuest::GetId, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetPriority", "Quest", papyrusQuest::GetPriority, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumAliases", "Quest", papyrusQuest::GetNumAliases, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthAlias", "Quest", papyrusQuest::GetNthAlias, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetAliasByName", "Quest", papyrusQuest::GetAliasByName, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetAliasById", "Quest", papyrusQuest::GetAliasById, registry)); - - registry->RegisterFunction( - new NativeFunction0 > ("GetAliases", "Quest", papyrusQuest::GetAliases, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusQuest.h b/source/fs.dll/skse64/skse64/PapyrusQuest.h deleted file mode 100644 index 929644ba..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusQuest.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class TESQuest; -class BGSBaseAlias; -class VMClassRegistry; -struct StaticFunctionTag; - -namespace papyrusQuest -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESQuest* GetQuest(StaticFunctionTag* thisInput, BSFixedString editorID); - - BSFixedString GetId(TESQuest* thisQuest); - UInt32 GetPriority(TESQuest* thisQuest); - UInt32 GetNumAliases(TESQuest* thisQuest); - BGSBaseAlias* GetNthAlias(TESQuest* thisQuest, UInt32 n); - BGSBaseAlias* GetAliasByName(TESQuest* thisQuest, BSFixedString s); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusRace.cpp b/source/fs.dll/skse64/skse64/PapyrusRace.cpp deleted file mode 100644 index 0cf81323..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusRace.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "PapyrusRace.h" - -#include "GameObjects.h" -#include "GameFormComponents.h" -#include "GameForms.h" -#include "GameData.h" -#include - -#include "common/ICriticalSection.h" - -UInt32 g_invalidatePlayableRaceCache = 0; -UInt32 g_invalidateRaceCache = 0; - -namespace papyrusRace -{ - typedef std::map RaceCache; - static ICriticalSection s_raceCacheLock; - static RaceCache s_raceCache; - - TESRace* GetRace(StaticFunctionTag*, BSFixedString editorID) - { - s_raceCacheLock.Enter(); - - if(g_invalidateRaceCache == 1) { - s_raceCache.clear(); - g_invalidateRaceCache = 0; - } - - if (s_raceCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& races = pDataHandler->races; - for (UInt32 n = 0; n < races.count; n++) { - TESRace* pRace = NULL; - races.GetNthItem(n, pRace); - if (pRace) { - s_raceCache.insert(RaceCache::value_type(pRace->editorId, pRace)); - } - } - } - - s_raceCacheLock.Leave(); - - RaceCache::iterator it = s_raceCache.find(editorID); - TESRace* pRace = (it != s_raceCache.end()) ? it->second : NULL; - return pRace; - } - - typedef std::vector PlayableRaceCache; - static ICriticalSection s_playableRaceCacheLock; - static PlayableRaceCache s_playableRaceCache; - - UInt32 GetNumPlayableRaces(StaticFunctionTag * base) - { - s_playableRaceCacheLock.Enter(); - - if(g_invalidatePlayableRaceCache == 1) { - s_playableRaceCache.clear(); - g_invalidatePlayableRaceCache = 0; - } - - if (s_playableRaceCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& races = pDataHandler->races; - for (UInt32 n = 0; n < races.count; n++) { - TESRace* pRace = NULL; - races.GetNthItem(n, pRace); - if (pRace && IsRaceFlagSet(pRace, TESRace::kRace_Playable)) { - s_playableRaceCache.push_back(pRace); - } - } - } - - s_playableRaceCacheLock.Leave(); - return s_playableRaceCache.size(); - } - - TESRace * GetNthPlayableRace(StaticFunctionTag * base, UInt32 n) - { - if(n < 0) { - return NULL; - } - - s_playableRaceCacheLock.Enter(); - - if(g_invalidatePlayableRaceCache == 1) { - s_playableRaceCache.clear(); - g_invalidatePlayableRaceCache = 0; - } - - if (s_playableRaceCache.empty()) { - DataHandler* pDataHandler = DataHandler::GetSingleton(); - tArray& races = pDataHandler->races; - for (UInt32 n = 0; n < races.count; n++) { - TESRace* pRace = NULL; - races.GetNthItem(n, pRace); - if (pRace && IsRaceFlagSet(pRace, TESRace::kRace_Playable)) { - s_playableRaceCache.push_back(pRace); - } - } - } - - s_playableRaceCacheLock.Leave(); - return (n < s_playableRaceCache.size()) ? s_playableRaceCache.at(n) : NULL; - } - - UInt32 GetSpellCount(TESRace* thisRace) - { - return (thisRace)? thisRace->spellList.GetSpellCount() : 0; - } - - SpellItem* GetNthSpell(TESRace* thisRace, UInt32 n) - { - return (thisRace) ? thisRace->spellList.GetNthSpell(n) : NULL; - } - - bool IsRaceFlagSet(TESRace* thisRace, UInt32 flag) - { - return (thisRace) ? (thisRace->data.raceFlags & flag) == flag : false; - } - - void SetRaceFlag(TESRace* thisRace, UInt32 flag) - { - if (thisRace) { - thisRace->data.raceFlags |= flag; - if((flag & TESRace::kRace_Playable) == TESRace::kRace_Playable) - g_invalidatePlayableRaceCache = 1; - } - } - - void ClearRaceFlag(TESRace* thisRace, UInt32 flag) - { - if (thisRace) { - thisRace->data.raceFlags &= ~flag; - if((flag & TESRace::kRace_Playable) == TESRace::kRace_Playable) - g_invalidatePlayableRaceCache = 1; - } - } - - BGSVoiceType* GetDefaultVoiceType(TESRace* thisRace, bool female) - { - return (thisRace) ? thisRace->voiceTypes[female] : NULL; - } - - void SetDefaultVoiceType(TESRace* thisRace, bool female, BGSVoiceType* voiceType) - { - if(thisRace) { - thisRace->voiceTypes[female] = voiceType; - } - } - - TESObjectARMO * GetSkin(TESRace* thisRace) - { - return (thisRace) ? thisRace->skin.skin : NULL; - } - - void SetSkin(TESRace* thisRace, TESObjectARMO * skin) - { - if(thisRace) { - thisRace->skin.skin = skin; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusRace::RegisterFuncs(VMClassRegistry* registry) -{ - - registry->RegisterFunction( - new NativeFunction0 ("GetSpellCount", "Race", papyrusRace::GetSpellCount, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthSpell", "Race", papyrusRace::GetNthSpell, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsRaceFlagSet", "Race", papyrusRace::IsRaceFlagSet, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetRaceFlag", "Race", papyrusRace::SetRaceFlag, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("ClearRaceFlag", "Race", papyrusRace::ClearRaceFlag, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetDefaultVoiceType", "Race", papyrusRace::GetDefaultVoiceType, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("SetDefaultVoiceType", "Race", papyrusRace::SetDefaultVoiceType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetRace", "Race", papyrusRace::GetRace, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetNumPlayableRaces", "Race", papyrusRace::GetNumPlayableRaces, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetNthPlayableRace", "Race", papyrusRace::GetNthPlayableRace, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSkin", "Race", papyrusRace::GetSkin, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSkin", "Race", papyrusRace::SetSkin, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusRace.h b/source/fs.dll/skse64/skse64/PapyrusRace.h deleted file mode 100644 index c55bc6fc..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusRace.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -class TESRace; -class SpellItem; -class BGSVoiceType; -class VMClassRegistry; -struct StaticFunctionTag; -class TESObjectARMO; - -namespace papyrusRace -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetSpellCount(TESRace* thisRace); - SpellItem* GetNthSpell(TESRace* thisRace, UInt32 n); - - bool IsRaceFlagSet(TESRace* thisRace, UInt32 flag); - void SetRaceFlag(TESRace* thisRace, UInt32 flag); - void ClearRaceFlag(TESRace* thisRace, UInt32 flag); - - UInt32 GetNumPlayableRaces(StaticFunctionTag * base); - TESRace * GetNthPlayableRace(StaticFunctionTag * base, UInt32 n); - - BGSVoiceType* GetDefaultVoiceType(TESRace* thisRace, bool female); - void SetDefaultVoiceType(TESRace* thisRace, bool female, BGSVoiceType* voiceType); - - TESObjectARMO * GetSkin(TESRace* thisRace); - void SetSkin(TESRace* thisRace, TESObjectARMO * skin); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.cpp b/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.cpp deleted file mode 100644 index c3b6c6ef..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "PapyrusReferenceAlias.h" - -#include "GameForms.h" -#include "GameExtraData.h" -#include "GameFormComponents.h" -#include "GameRTTI.h" - -class MatchBySlot : public FormMatcher -{ - UInt32 m_mask; -public: - MatchBySlot(UInt32 slot) : - m_mask(slot) - { - - } - - bool Matches(TESForm* pForm) const { - if (pForm) { - BGSBipedObjectForm* pBip = DYNAMIC_CAST(pForm, TESForm, BGSBipedObjectForm); - if (pBip) { - return (pBip->data.parts & m_mask) != 0; - } - } - return false; - } -}; - -namespace papyrusReferenceAlias -{ - bool ForceRefToWornItem(BGSRefAlias * alias, TESObjectREFR * reference, UInt32 mask) - { - if(!reference || !alias) - return false; - - MatchBySlot matcher(mask); - ExtraContainerChanges* pContainerChanges = static_cast(reference->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - EquipData eqD = pContainerChanges->FindEquipped(matcher); - NiPointer foundReference; - ExtraReferenceHandle* xReference = static_cast(eqD.pExtraData->GetByType(kExtraData_ReferenceHandle)); - if(xReference) { // Persistent Ref exists, acquire it - UInt32 handleIn = xReference->handle; - LookupREFRByHandle(handleIn, foundReference); - _MESSAGE("Found Reference %08X", foundReference->formID); - } else { // No Persistent Ref, Create One - /*IFormFactory * factory = IFormFactory::GetFactoryForType(TESObjectREFR::kTypeID); - if(factory) { - foundReference = (TESObjectREFR*)factory->Create(); - if(foundReference) { - foundReference->Init(); - foundReference->baseForm = eqD.pForm; - } - } - if(foundReference) { - ExtraReferenceHandle* newHandle = ExtraReferenceHandle::Create(); - UInt32 handleOut = 0; - CreateRefHandleByREFR(&handleOut, foundReference); - newHandle->handle = handleOut; - eqD.pExtraData->Add(kExtraData_ReferenceHandle, newHandle); - _MESSAGE("Created Reference %08X", foundReference->formID); - }*/ - } - - if(foundReference) - { - _MESSAGE("Forced Reference to %08X", foundReference->formID); - CALL_MEMBER_FN(alias->owner, ForceRefTo)(alias->aliasId, foundReference); - return true; - } - else - { - _MESSAGE("Forced Reference to "); - } - } - - return false; - } -} - - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusReferenceAlias::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction2 ("ForceRefToWornItem", "ReferenceAlias", papyrusReferenceAlias::ForceRefToWornItem, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.h b/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.h deleted file mode 100644 index 4c4d7ec4..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusReferenceAlias.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class BGSRefAlias; -class TESObjectREFR; -class VMClassRegistry; - -namespace papyrusReferenceAlias -{ - void RegisterFuncs(VMClassRegistry* registry); - - bool ForceRefToWornItem(BGSRefAlias * alias, TESObjectREFR * reference, UInt32 mask); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusSKSE.cpp b/source/fs.dll/skse64/skse64/PapyrusSKSE.cpp deleted file mode 100644 index b25e98af..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSKSE.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "PapyrusSKSE.h" -#include "PluginManager.h" - -#include "skse64_common/skse_version.h" - - -namespace papyrusSKSE { - - UInt32 GetVersion(StaticFunctionTag* base) - { - return SKSE_VERSION_INTEGER; - } - UInt32 GetVersionMinor(StaticFunctionTag* base) - { - return SKSE_VERSION_INTEGER_MINOR; - } - - UInt32 GetVersionBeta(StaticFunctionTag* base) - { - return SKSE_VERSION_INTEGER_BETA; - } - - UInt32 GetVersionRelease(StaticFunctionTag* base) - { - return SKSE_VERSION_RELEASEIDX; - } - - UInt32 GetPluginVersion(StaticFunctionTag* base, BSFixedString name) - { - PluginInfo * info = g_pluginManager.GetInfoByName(name.data); - if (info) { - return info->version; - } - - return -1; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusSKSE::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetVersion", "SKSE", papyrusSKSE::GetVersion, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetVersionMinor", "SKSE", papyrusSKSE::GetVersionMinor, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetVersionBeta", "SKSE", papyrusSKSE::GetVersionBeta, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetVersionRelease", "SKSE", papyrusSKSE::GetVersionRelease, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetPluginVersion", "SKSE", papyrusSKSE::GetPluginVersion, registry)); - - registry->SetFunctionFlags("SKSE", "GetVersion", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SKSE", "GetVersionMinor", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SKSE", "GetVersionBeta", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SKSE", "GetVersionRelease", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SKSE", "GetPluginVersion", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSKSE.h b/source/fs.dll/skse64/skse64/PapyrusSKSE.h deleted file mode 100644 index a67cd89f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSKSE.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -class VMClassRegistry; -struct StaticFunctionTag; - -#include "skse64/GameTypes.h" - -namespace papyrusSKSE -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetVersion(StaticFunctionTag* base); - UInt32 GetVersionMinor(StaticFunctionTag* base); - UInt32 GetVersionBeta(StaticFunctionTag* base); - UInt32 GetVersionRelease(StaticFunctionTag* base); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusScroll.cpp b/source/fs.dll/skse64/skse64/PapyrusScroll.cpp deleted file mode 100644 index 8d5845f8..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusScroll.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "PapyrusScroll.h" -#include "PapyrusSpell.h" -#include "GameObjects.h" - -namespace papyrusScroll -{ - float GetCastTime(ScrollItem* thisSpell) - { - return (thisSpell)? thisSpell->data.castTime : 0.0; - } - - BGSPerk* GetPerk(ScrollItem* thisSpell) - { - return (thisSpell) ? thisSpell->data.spellPerk : NULL; - } - - UInt32 GetNumEffects(ScrollItem* thisMagic) - { return magicItemUtils::GetNumEffects(thisMagic); } - - float GetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagnitude(thisMagic, index); } - - UInt32 GetNthEffectArea(ScrollItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectArea(thisMagic, index); } - - UInt32 GetNthEffectDuration(ScrollItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectDuration(thisMagic, index); } - - EffectSetting* GetNthEffectMagicEffect(ScrollItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagicEffect(thisMagic, index); } - - UInt32 GetCostliestEffectIndex(ScrollItem* thisMagic) - { return magicItemUtils::GetCostliestEffectIndex(thisMagic); } - - void SetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index, float value) - { magicItemUtils::SetNthEffectMagnitude(thisMagic, index, value); } - - void SetNthEffectArea(ScrollItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectArea(thisMagic, index, value); } - - void SetNthEffectDuration(ScrollItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectDuration(thisMagic, index, value); } - - BGSEquipSlot * GetEquipType(ScrollItem* thisMagic) - { - if (thisMagic) { - return thisMagic->equipType.GetEquipSlot(); - } - - // Invalid EquipSlot - return NULL; - } - - void SetEquipType(ScrollItem* thisMagic, BGSEquipSlot * slot) - { - if (thisMagic && slot) { - thisMagic->equipType.SetEquipSlot(slot); - } - } - - VMResultArray GetEffectMagnitudes(ScrollItem* thisMagic) { return magicItemUtils::GetEffectMagnitudes(thisMagic); } - VMResultArray GetEffectAreas(ScrollItem* thisMagic) { return magicItemUtils::GetEffectAreas(thisMagic); } - VMResultArray GetEffectDurations(ScrollItem* thisMagic) { return magicItemUtils::GetEffectDurations(thisMagic); } - VMResultArray GetMagicEffects(ScrollItem* thisMagic) { return magicItemUtils::GetMagicEffects(thisMagic); } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusScroll::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetCastTime", "Scroll", papyrusScroll::GetCastTime, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumEffects", "Scroll", papyrusScroll::GetNumEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagnitude", "Scroll", papyrusScroll::GetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectArea", "Scroll", papyrusScroll::GetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectDuration", "Scroll", papyrusScroll::GetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagicEffect", "Scroll", papyrusScroll::GetNthEffectMagicEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCostliestEffectIndex", "Scroll", papyrusScroll::GetCostliestEffectIndex, registry)); - - // Sets - registry->RegisterFunction( - new NativeFunction2("SetNthEffectMagnitude", "Scroll", papyrusScroll::SetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectArea", "Scroll", papyrusScroll::SetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectDuration", "Scroll", papyrusScroll::SetNthEffectDuration, registry)); - - // EquipType - registry->RegisterFunction( - new NativeFunction0 ("GetEquipType", "Scroll", papyrusScroll::GetEquipType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEquipType", "Scroll", papyrusScroll::SetEquipType, registry)); - - // Array gets - registry->RegisterFunction( - new NativeFunction0 >("GetEffectMagnitudes", "Scroll", papyrusScroll::GetEffectMagnitudes, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectAreas", "Scroll", papyrusScroll::GetEffectAreas, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectDurations", "Scroll", papyrusScroll::GetEffectDurations, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetMagicEffects", "Scroll", papyrusScroll::GetMagicEffects, registry)); - - registry->SetFunctionFlags("Scroll", "GetCastTime", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetNumEffects", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetNthEffectMagicEffect", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetCostliestEffectIndex", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetEquipType", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Scroll", "SetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "SetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "SetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "SetEquipType", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Scroll", "GetEffectMagnitudes", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetEffectAreas", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetEffectDurations", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Scroll", "GetMagicEffects", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusScroll.h b/source/fs.dll/skse64/skse64/PapyrusScroll.h deleted file mode 100644 index 0dcf51a3..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusScroll.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -class ScrollItem; -class BGSPerk; -class EffectSetting; -class VMClassRegistry; -class BGSEquipSlot; - -namespace papyrusScroll -{ - void RegisterFuncs(VMClassRegistry* registry); - - float GetCastTime(ScrollItem* thisSpell); - BGSPerk* GetPerk(ScrollItem* thisSpell); - - UInt32 GetNumEffects(ScrollItem* thisMagic); - float GetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(ScrollItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(ScrollItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(ScrollItem* thisMagic, UInt32 index); - UInt32 GetCostliestEffectIndex(ScrollItem* thisMagic); - - void SetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index, float value); - void SetNthEffectArea(ScrollItem* thisMagic, UInt32 index, UInt32 value); - void SetNthEffectDuration(ScrollItem* thisMagic, UInt32 index, UInt32 value); - - BGSEquipSlot * GetEquipType(ScrollItem* thisMagic); - void SetEquipType(ScrollItem* thisMagic, BGSEquipSlot * slot); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusShout.cpp b/source/fs.dll/skse64/skse64/PapyrusShout.cpp deleted file mode 100644 index 552578d8..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusShout.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "PapyrusShout.h" -#include "GameObjects.h" - -namespace papyrusShout -{ - TESWordOfPower * GetNthWordOfPower(TESShout * thisShout, UInt32 n) - { - return (thisShout && n < TESShout::Words::kNumWords) ? thisShout->words[n].word : NULL; - } - SpellItem * GetNthSpell(TESShout * thisShout, UInt32 n) - { - return (thisShout && n < TESShout::Words::kNumWords) ? thisShout->words[n].spell : NULL; - } - float GetNthRecoveryTime(TESShout * thisShout, UInt32 n) - { - return (thisShout && n < TESShout::Words::kNumWords) ? thisShout->words[n].recoverytime : 0.0; - } - - void SetNthWordOfPower(TESShout * thisShout, UInt32 n, TESWordOfPower * woop) - { - if(thisShout && n < TESShout::Words::kNumWords) { - thisShout->words[n].word = woop; - } - } - void SetNthSpell(TESShout * thisShout, UInt32 n, SpellItem * spell) - { - if(thisShout && n < TESShout::Words::kNumWords) { - thisShout->words[n].spell = spell; - } - } - void SetNthRecoveryTime(TESShout * thisShout, UInt32 n, float time) - { - if(thisShout && n < TESShout::Words::kNumWords) { - thisShout->words[n].recoverytime = time; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusShout::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1("GetNthWordOfPower", "Shout", papyrusShout::GetNthWordOfPower, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthSpell", "Shout", papyrusShout::GetNthSpell, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthRecoveryTime", "Shout", papyrusShout::GetNthRecoveryTime, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthWordOfPower", "Shout", papyrusShout::SetNthWordOfPower, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthSpell", "Shout", papyrusShout::SetNthSpell, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthRecoveryTime", "Shout", papyrusShout::SetNthRecoveryTime, registry)); - - registry->SetFunctionFlags("Shout", "GetNthWordOfPower", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Shout", "GetNthSpell", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Shout", "GetNthRecoveryTime", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Shout", "SetNthWordOfPower", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Shout", "SetNthSpell", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Shout", "SetNthRecoveryTime", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusShout.h b/source/fs.dll/skse64/skse64/PapyrusShout.h deleted file mode 100644 index 4737c374..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusShout.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -class TESShout; -class SpellItem; -class TESWordOfPower; -class VMClassRegistry; - -namespace papyrusShout -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESWordOfPower * GetNthWordOfPower(TESShout * thisShout, UInt32 n); - SpellItem * GetNthSpell(TESShout * thisShout, UInt32 n); - float GetNthRecoveryTime(TESShout * thisShout, UInt32 n); - - void SetNthWordOfPower(TESShout * thisShout, UInt32 n, TESWordOfPower * woop); - void SetNthSpell(TESShout * thisShout, UInt32 n, SpellItem * spell); - void SetNthRecoveryTime(TESShout * thisShout, UInt32 n, float time); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusSound.cpp b/source/fs.dll/skse64/skse64/PapyrusSound.cpp deleted file mode 100644 index 6e8fb65d..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSound.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "PapyrusSound.h" - -#include "GameFormComponents.h" -#include "GameForms.h" -#include "GameObjects.h" - -namespace papyrusSound -{ - BGSSoundDescriptorForm * GetDescriptor(TESSound* thisSound) - { - return (thisSound) ? thisSound->descriptor : NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusSound::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetDescriptor", "Sound", papyrusSound::GetDescriptor, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSound.h b/source/fs.dll/skse64/skse64/PapyrusSound.h deleted file mode 100644 index 7272d47a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSound.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESSound; -class BGSSoundDescriptorForm; - -namespace papyrusSound -{ - BGSSoundDescriptorForm * GetDescriptor(TESSound* thisSound); - void RegisterFuncs(VMClassRegistry* registry); -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.cpp b/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.cpp deleted file mode 100644 index 6bb27d35..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "PapyrusSoundDescriptor.h" - -#include "GameFormComponents.h" -#include "GameForms.h" -#include "GameObjects.h" - -namespace papyrusSoundDescriptor -{ - float GetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor) - { - return (thisDescriptor && thisDescriptor->standardSoundDef) ? (thisDescriptor->standardSoundDef->soundCharacteristics.dbAttenuation / 100.0) : 0.0; - } - - void SetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor, float dbAttenuation) - { - if(thisDescriptor && thisDescriptor->standardSoundDef) { - thisDescriptor->standardSoundDef->soundCharacteristics.dbAttenuation = (UInt16)(dbAttenuation * 100); - } - } - - UInt32 GetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor) - { - return (thisDescriptor && thisDescriptor->standardSoundDef) ? thisDescriptor->standardSoundDef->soundCharacteristics.dbVariance : 0; - } - - void SetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 dbVariance) - { - if(thisDescriptor && thisDescriptor->standardSoundDef && dbVariance < 255) { - thisDescriptor->standardSoundDef->soundCharacteristics.dbVariance = dbVariance; - } - } - - UInt32 GetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor) - { - return (thisDescriptor && thisDescriptor->standardSoundDef) ? thisDescriptor->standardSoundDef->soundCharacteristics.frequencyVariance : 0; - } - - void SetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqVariance) - { - if(thisDescriptor && thisDescriptor->standardSoundDef && freqVariance < 255) { - thisDescriptor->standardSoundDef->soundCharacteristics.frequencyVariance = freqVariance; - } - } - - UInt32 GetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor) - { - return (thisDescriptor && thisDescriptor->standardSoundDef) ? thisDescriptor->standardSoundDef->soundCharacteristics.frequencyShift : 0; - } - - void SetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqShift) - { - if(thisDescriptor && thisDescriptor->standardSoundDef && freqShift < 255) { - thisDescriptor->standardSoundDef->soundCharacteristics.frequencyShift = freqShift; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusSoundDescriptor::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(BGSSoundDescriptorForm::kTypeID, "SoundDescriptor"); - - // Decibel Attenuation - registry->RegisterFunction( - new NativeFunction0 ("GetDecibelAttenuation", "SoundDescriptor", papyrusSoundDescriptor::GetDecibelAttenuation, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetDecibelAttenuation", "SoundDescriptor", papyrusSoundDescriptor::SetDecibelAttenuation, registry)); - - // Decibel Variance - registry->RegisterFunction( - new NativeFunction0 ("GetDecibelVariance", "SoundDescriptor", papyrusSoundDescriptor::GetDecibelVariance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetDecibelVariance", "SoundDescriptor", papyrusSoundDescriptor::SetDecibelVariance, registry)); - - // Frequency Variance - registry->RegisterFunction( - new NativeFunction0 ("GetFrequencyVariance", "SoundDescriptor", papyrusSoundDescriptor::GetFrequencyVariance, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFrequencyVariance", "SoundDescriptor", papyrusSoundDescriptor::SetFrequencyVariance, registry)); - - // Frequency Shift - registry->RegisterFunction( - new NativeFunction0 ("GetFrequencyShift", "SoundDescriptor", papyrusSoundDescriptor::GetFrequencyShift, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetFrequencyShift", "SoundDescriptor", papyrusSoundDescriptor::SetFrequencyShift, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.h b/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.h deleted file mode 100644 index 699e4a9e..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSoundDescriptor.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -class VMClassRegistry; -class BGSSoundDescriptorForm; - -namespace papyrusSoundDescriptor -{ - float GetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor); - void SetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor, float dbAttenuation); - - UInt32 GetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor); - void SetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 dbVariance); - - UInt32 GetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor); - void SetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqVariance); - - UInt32 GetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor); - void SetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqShift); - - void RegisterFuncs(VMClassRegistry* registry); -}; \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.cpp b/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.cpp deleted file mode 100644 index c36d8304..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.cpp +++ /dev/null @@ -1,268 +0,0 @@ -#include "PapyrusSpawnerTask.h" - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -#include "GameForms.h" -#include "GameReferences.h" -#include "NiTypes.h" - -#include "PapyrusObjects.h" -#include "PapyrusDelayFunctors.h" -#include "Serialization.h" - -#include - - -namespace -{ -/// -/// SpawnerTaskFunctor -/// - - class SpawnerTaskFunctor : public LatentSKSEDelayFunctor - { - struct SpawnData; - - public: - explicit SpawnerTaskFunctor(UInt32 stackId) : - LatentSKSEDelayFunctor( stackId ) - {} - - explicit SpawnerTaskFunctor(SerializationTag tag) : - LatentSKSEDelayFunctor( tag ) - {} - - virtual const char* ClassName() const { return "SpawnerTaskFunctor"; } - virtual UInt32 ClassVersion() const { return 1; } - - virtual bool Save(SKSESerializationInterface* intfc); - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version); - - virtual void Run(VMValue& resultValue) - { - VMClassRegistry* registry = (*g_skyrimVM)->GetClassRegistry(); - - UInt32 nullHandle = *g_invalidRefHandle; - - VMResultArray allSpawned; - - for (size_t i=0; i target; - LookupREFRByHandle(e.targetRefrHandle, target); - if (target == NULL) - continue; - - // Spawn - TESObjectREFR* spawned = PlaceAtMe_Native(registry, this->stackId_, target, spawnForm, e.count, e.bForcePersist, e.bInitiallyDisabled); - if (spawned == NULL) - continue; - - // Position - TESObjectCELL* parentCell = spawned->parentCell; - TESWorldSpace* worldspace = CALL_MEMBER_FN(spawned,GetWorldspace)(); - - NiPoint3 finalPos( e.pos ); - finalPos += target->pos; - - MoveRefrToPosition(spawned, &nullHandle, parentCell, worldspace, &finalPos, &e.rot); - - // Save spawned for result - allSpawned.push_back(spawned); - } - - PackValue(&resultValue, &allSpawned, registry); - } - - void AddSpawn(TESForm* form, TESObjectREFR* target, const NiPoint3& pos, const NiPoint3& rot, - UInt32 count, bool bForcePersist, bool bInitiallyDisabled) - { - UInt32 formId = form->formID; - UInt32 targetRefrHandle = GetOrCreateRefrHandle(target); - - if (targetRefrHandle == *g_invalidRefHandle) - return; - - SpawnData t = { formId, targetRefrHandle, pos, rot, count, bForcePersist, bInitiallyDisabled }; - data_.push_back(t); - } - - private: - struct SpawnData - { - UInt32 spawnFormId; - UInt32 targetRefrHandle; - NiPoint3 pos; - NiPoint3 rot; - UInt32 count; - bool bForcePersist; - bool bInitiallyDisabled; - }; - - std::vector data_; - }; - - bool SpawnerTaskFunctor::Save(SKSESerializationInterface* intfc) - { - using namespace Serialization; - - if (! LatentSKSEDelayFunctor::Save(intfc)) - return false; - - UInt32 dataSize = data_.size(); - - if (! WriteData(intfc, &dataSize)) - return false; - - for (UInt32 i=0; iResolveFormId(e.spawnFormId, &fixedFormId)) - { - _MESSAGE("SpawnerTaskFunctor::Load: FormID of spawn %i could not be resolved, skipping."); - continue; - } - - e.spawnFormId = fixedFormId; - - data_.push_back(e); - } - - return true; - } -} - -/// -/// Native functions -/// - -namespace papyrusSpawnerTask -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*) - { - SpawnerTaskFunctor* func = new SpawnerTaskFunctor(stackId); - - UInt32 handle = SKSEObjectStorageInstance().StoreObject(func, stackId); - return handle; - } - - void AddSpawn(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle, TESForm* form, TESObjectREFR* target, - VMArray position, VMArray rotation, SInt32 count, bool bForcePersist, bool bInitiallyDisabled) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - ERROR_AND_RETURN_IF(form == NULL, "FormToPlace parameter must not be none.", registry, stackId) - ERROR_AND_RETURN_IF(target == NULL, "Target parameter must not be none.", registry, stackId) - ERROR_AND_RETURN_IF(count <= 0, "Count parameter must be greater zero.", registry, stackId) - ERROR_AND_RETURN_IF(position.Length() != 3, "Position parameter must be an array of length 3.", registry, stackId) - ERROR_AND_RETURN_IF(rotation.Length() != 3, "Rotation parameter must be an array of length 3.", registry, stackId) - - SpawnerTaskFunctor* func = SKSEObjectStorageInstance().AccessObject(handle); - - ERROR_AND_RETURN_IF(func == NULL, "Failed to lookup object for given handle.", registry, stackId) - - NiPoint3 pos; - position.Get(&pos.x, 0); - position.Get(&pos.y, 1); - position.Get(&pos.z, 2); - - NiPoint3 rot; - rotation.Get(&rot.x, 0); - rotation.Get(&rot.y, 1); - rotation.Get(&rot.z, 2); - - func->AddSpawn(form, target, pos, rot, count, bForcePersist, bInitiallyDisabled); - } - - bool Run(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle) - { - ERROR_AND_RETURN_0_IF(handle <= 0, "Invalid handle.", registry, stackId) - - SpawnerTaskFunctor* func = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_0_IF(func == NULL, "Failed to lookup object for given handle.", registry, stackId) - - if (stackId != func->StackId()) - { - registry->LogError("Tried to run SpawnerTaskFunctor from non-owning stack.", stackId); - - delete func; - return false; - } - - SKSEDelayFunctorManagerInstance().Enqueue(func); - - return true; - } - - void Cancel(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - SpawnerTaskFunctor* func = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_IF(func == NULL, "Failed to lookup object for given handle.", registry, stackId) - - delete func; - } -} - -void papyrusSpawnerTask::RegisterFuncs(VMClassRegistry* registry) -{ - SKSEObjectRegistry& skseObjRegistry = SKSEObjectRegistryInstance(); - skseObjRegistry.RegisterClass(); - - registry->RegisterFunction( - new NativeFunction0 ("Create", "SpawnerTask", papyrusSpawnerTask::Create, registry)); - - registry->RegisterFunction( - new NativeFunction8 , VMArray, SInt32, bool, bool>("AddSpawn", "SpawnerTask", papyrusSpawnerTask::AddSpawn, registry)); - - registry->RegisterFunction( - new LatentNativeFunction1 , SInt32>("Run", "SpawnerTask", papyrusSpawnerTask::Run, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Cancel", "SpawnerTask", papyrusSpawnerTask::Cancel, registry)); - - registry->SetFunctionFlags("SpawnerTask", "Create", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SpawnerTask", "AddSpawn", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("SpawnerTask", "Cancel", VMClassRegistry::kFunctionFlag_NoWait); - -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.h b/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.h deleted file mode 100644 index 49589496..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSpawnerTask.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -struct StaticFunctionTag; -class TESForm; -class TESObjectREFR; -class VMClassRegistry; -template class VMArray; - -namespace papyrusSpawnerTask -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*); - - void AddSpawn(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle, TESForm* form, TESObjectREFR* target, - VMArray offset, VMArray rotation, SInt32 count, bool bForcePersist, bool bInitiallyDisabled); - - // Latent - returns VMResultArray - bool Run(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle); - - void RegisterFuncs(VMClassRegistry* registry); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSpell.cpp b/source/fs.dll/skse64/skse64/PapyrusSpell.cpp deleted file mode 100644 index a4ba06f5..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSpell.cpp +++ /dev/null @@ -1,309 +0,0 @@ -#include "PapyrusSpell.h" - -#include "GameObjects.h" -#include "GameReferences.h" - -namespace papyrusSpell -{ - float GetCastTime(SpellItem* thisSpell) - { - return (thisSpell) ? thisSpell->data.castTime : 0.0; - } - - BGSPerk* GetPerk(SpellItem* thisSpell) - { - return (thisSpell) ? thisSpell->data.spellPerk : NULL; - } - - UInt32 GetNumEffects(SpellItem* thisMagic) - { return magicItemUtils::GetNumEffects(thisMagic); } - - float GetNthEffectMagnitude(SpellItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagnitude(thisMagic, index); } - - UInt32 GetNthEffectArea(SpellItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectArea(thisMagic, index); } - - UInt32 GetNthEffectDuration(SpellItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectDuration(thisMagic, index); } - - EffectSetting* GetNthEffectMagicEffect(SpellItem* thisMagic, UInt32 index) - { return magicItemUtils::GetNthEffectMagicEffect(thisMagic, index); } - - UInt32 GetCostliestEffectIndex(SpellItem* thisMagic) - { return magicItemUtils::GetCostliestEffectIndex(thisMagic); } - - UInt32 GetMagickaCost(SpellItem* thisSpell) - { - return thisSpell ? thisSpell->GetMagickaCost() : 0; - } - - UInt32 GetEffectiveMagickaCost(SpellItem* thisSpell, Character* caster) - { - return thisSpell ? CALL_MEMBER_FN(thisSpell,GetEffectiveMagickaCost)(caster) : 0; - } - - void SetNthEffectMagnitude(SpellItem* thisMagic, UInt32 index, float value) - { magicItemUtils::SetNthEffectMagnitude(thisMagic, index, value); } - - void SetNthEffectArea(SpellItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectArea(thisMagic, index, value); } - - void SetNthEffectDuration(SpellItem* thisMagic, UInt32 index, UInt32 value) - { magicItemUtils::SetNthEffectDuration(thisMagic, index, value); } - - BGSEquipSlot * GetEquipType(SpellItem* thisMagic) - { - if (thisMagic) { - return thisMagic->equipType.GetEquipSlot(); - } - - // Invalid EquipSlot - return NULL; - } - - void SetEquipType(SpellItem* thisMagic, BGSEquipSlot * slot) - { - if (thisMagic && slot) { - thisMagic->equipType.SetEquipSlot(slot); - } - } - - VMResultArray GetEffectMagnitudes(SpellItem* thisMagic) { return magicItemUtils::GetEffectMagnitudes(thisMagic); } - VMResultArray GetEffectAreas(SpellItem* thisMagic) { return magicItemUtils::GetEffectAreas(thisMagic); } - VMResultArray GetEffectDurations(SpellItem* thisMagic) { return magicItemUtils::GetEffectDurations(thisMagic); } - VMResultArray GetMagicEffects(SpellItem* thisMagic) { return magicItemUtils::GetMagicEffects(thisMagic); } -} - -namespace magicItemUtils -{ - UInt32 GetNumEffects(MagicItem* thisMagic) - { - return thisMagic ? thisMagic->effectItemList.count : 0; - } - - float GetNthEffectMagnitude(MagicItem* thisMagic, UInt32 index) - { - if (!thisMagic) - return 0.0; - - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - return (pEI) ? pEI->magnitude : 0.0; - } - - UInt32 GetNthEffectArea(MagicItem* thisMagic, UInt32 index) - { - if (!thisMagic) - return 0; - - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - return (pEI) ? pEI->area : 0; - } - - UInt32 GetNthEffectDuration(MagicItem* thisMagic, UInt32 index) - { - if (!thisMagic) - return 0; - - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - return (pEI) ? pEI->duration : 0; - } - - EffectSetting* GetNthEffectMagicEffect(MagicItem* thisMagic, UInt32 index) - { - if (!thisMagic) - return NULL; - - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - return (pEI) ? pEI->mgef : NULL; - } - - void SetNthEffectMagnitude(MagicItem* thisMagic, UInt32 index, float value) - { - if(thisMagic) - { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - if(pEI) - pEI->magnitude = value; - } - } - - void SetNthEffectArea(MagicItem* thisMagic, UInt32 index, UInt32 value) - { - if (thisMagic) { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - if(pEI) - pEI->area = value; - } - } - - void SetNthEffectDuration(MagicItem* thisMagic, UInt32 index, UInt32 value) - { - if (thisMagic) { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(index, pEI); - if(pEI) - pEI->duration = value; - } - } - - UInt32 GetCostliestEffectIndex(MagicItem* thisMagic) - { - if (!thisMagic) - return 0; - - MagicItem::EffectItem * pEI = CALL_MEMBER_FN(thisMagic, GetCostliestEffectItem)(5, false); - return pEI ? thisMagic->effectItemList.GetItemIndex(pEI) : 0; - } - - VMResultArray GetEffectMagnitudes(MagicItem* thisMagic) - { - VMResultArray result; - for(UInt32 i = 0; i < thisMagic->effectItemList.count; i++) - { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(i, pEI); - if(pEI) - result.push_back(pEI->magnitude); - else - result.push_back(0.0f); - } - return result; - } - VMResultArray GetEffectAreas(MagicItem* thisMagic) - { - VMResultArray result; - for(UInt32 i = 0; i < thisMagic->effectItemList.count; i++) - { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(i, pEI); - if(pEI) - result.push_back(pEI->area); - else - result.push_back(0); - } - return result; - } - VMResultArray GetEffectDurations(MagicItem* thisMagic) - { - VMResultArray result; - for(UInt32 i = 0; i < thisMagic->effectItemList.count; i++) - { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(i, pEI); - if(pEI) - result.push_back(pEI->duration); - else - result.push_back(0); - } - return result; - } - VMResultArray GetMagicEffects(MagicItem* thisMagic) - { - VMResultArray result; - for(UInt32 i = 0; i < thisMagic->effectItemList.count; i++) - { - MagicItem::EffectItem* pEI = NULL; - thisMagic->effectItemList.GetNthItem(i, pEI); - if(pEI) - result.push_back(pEI->mgef); - else - result.push_back(NULL); - } - return result; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusSpell::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetCastTime", "Spell", papyrusSpell::GetCastTime, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetPerk", "Spell", papyrusSpell::GetPerk, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetNumEffects", "Spell", papyrusSpell::GetNumEffects, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagnitude", "Spell", papyrusSpell::GetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectArea", "Spell", papyrusSpell::GetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectDuration", "Spell", papyrusSpell::GetNthEffectDuration, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthEffectMagicEffect", "Spell", papyrusSpell::GetNthEffectMagicEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetCostliestEffectIndex", "Spell", papyrusSpell::GetCostliestEffectIndex, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetMagickaCost", "Spell", papyrusSpell::GetMagickaCost, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetEffectiveMagickaCost", "Spell", papyrusSpell::GetEffectiveMagickaCost, registry)); - - // Sets - registry->RegisterFunction( - new NativeFunction2("SetNthEffectMagnitude", "Spell", papyrusSpell::SetNthEffectMagnitude, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectArea", "Spell", papyrusSpell::SetNthEffectArea, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthEffectDuration", "Spell", papyrusSpell::SetNthEffectDuration, registry)); - - // EquipType - registry->RegisterFunction( - new NativeFunction0 ("GetEquipType", "Spell", papyrusSpell::GetEquipType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEquipType", "Spell", papyrusSpell::SetEquipType, registry)); - - // Array gets - registry->RegisterFunction( - new NativeFunction0 >("GetEffectMagnitudes", "Spell", papyrusSpell::GetEffectMagnitudes, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectAreas", "Spell", papyrusSpell::GetEffectAreas, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetEffectDurations", "Spell", papyrusSpell::GetEffectDurations, registry)); - - registry->RegisterFunction( - new NativeFunction0 >("GetMagicEffects", "Spell", papyrusSpell::GetMagicEffects, registry)); - - registry->SetFunctionFlags("Spell", "GetCastTime", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetPerk", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetNumEffects", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetNthEffectMagicEffect", VMClassRegistry::kFunctionFlag_NoWait); -// registry->SetFunctionFlags("Spell", "GetCostliestEffectIndex", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetMagickaCost", VMClassRegistry::kFunctionFlag_NoWait); -// registry->SetFunctionFlags("Spell", "GetEffectiveMagickaCost", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetEquipType", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Spell", "SetNthEffectMagnitude", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "SetNthEffectArea", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "SetNthEffectDuration", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "SetEquipType", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Spell", "GetEffectMagnitudes", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetEffectAreas", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetEffectDurations", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Spell", "GetMagicEffects", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusSpell.h b/source/fs.dll/skse64/skse64/PapyrusSpell.h deleted file mode 100644 index 8059b2b2..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusSpell.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include "PapyrusArgs.h" - -class SpellItem; -class MagicItem; -class BGSPerk; -class EffectSetting; -class VMClassRegistry; -class Character; -class BGSEquipSlot; - -namespace papyrusSpell -{ - void RegisterFuncs(VMClassRegistry* registry); - - float GetCastTime(SpellItem* thisSpell); - BGSPerk* GetPerk(SpellItem* thisSpell); - - // MagicItem funcs - UInt32 GetNumEffects(SpellItem* thisMagic); - float GetNthEffectMagnitude(SpellItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(SpellItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(SpellItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(SpellItem* thisMagic, UInt32 index); - UInt32 GetCostliestEffectIndex(SpellItem* thisMagic); - UInt32 GetMagickaCost(SpellItem* thisMagic); - UInt32 GetEffectiveMagickaCost(SpellItem* thisSpell, Character* caster); - - void SetNthEffectMagnitude(SpellItem* thisSpell, UInt32 index, float value); - void SetNthEffectArea(SpellItem* thisSpell, UInt32 index, UInt32 value); - void SetNthEffectDuration(SpellItem* thisSpell, UInt32 index, UInt32 value); - - BGSEquipSlot * GetEquipType(SpellItem* thisMagic); - void SetEquipType(SpellItem* thisMagic, BGSEquipSlot * n); -}; - -namespace magicItemUtils { - UInt32 GetNumEffects(MagicItem* thisMagic); - float GetNthEffectMagnitude(MagicItem* thisMagic, UInt32 index); - UInt32 GetNthEffectArea(MagicItem* thisMagic, UInt32 index); - UInt32 GetNthEffectDuration(MagicItem* thisMagic, UInt32 index); - EffectSetting* GetNthEffectMagicEffect(MagicItem* thisMagic, UInt32 index); - UInt32 GetCostliestEffectIndex(MagicItem* thisMagic); - - void SetNthEffectMagnitude(MagicItem* thisMagic, UInt32 index, float value); - void SetNthEffectArea(MagicItem* thisMagic, UInt32 index, UInt32 value); - void SetNthEffectDuration(MagicItem* thisMagic, UInt32 index, UInt32 value); - - VMResultArray GetEffectMagnitudes(MagicItem* thisMagic); - VMResultArray GetEffectAreas(MagicItem* thisMagic); - VMResultArray GetEffectDurations(MagicItem* thisMagic); - VMResultArray GetMagicEffects(MagicItem* thisMagic); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusStringUtil.cpp b/source/fs.dll/skse64/skse64/PapyrusStringUtil.cpp deleted file mode 100644 index 9b5c99f0..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusStringUtil.cpp +++ /dev/null @@ -1,218 +0,0 @@ -#include "PapyrusStringUtil.h" -#include "PapyrusArgs.h" - -#include -#include - -namespace papyrusStringUtil -{ - - UInt32 GetLength(StaticFunctionTag* thisInput, BSFixedString theString) - { - return strlen(theString.data); - } - - struct SingleCharStar - { - char m_c[2]; - SingleCharStar(char c) { m_c[0] = c; m_c[1] = '\0';} - SingleCharStar& operator=(char c) { - m_c[0] = c; - return *this; - } - const char* c_str() { return m_c; } - }; - - BSFixedString GetNthChar(StaticFunctionTag* thisInput, BSFixedString theString, UInt32 index) - { - if (index < 0 || index >= strlen(theString.data)) - return NULL; - return SingleCharStar(theString.data[index]).c_str(); - } - - bool IsUppercase(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return (isupper(s.data[0])) ? true : false; - } - - bool IsLowercase(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return islower(s.data[0]) ? true : false; - } - - bool IsLetter(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return isalpha(s.data[0]) ? true : false; - } - bool IsDigit(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return isdigit(s.data[0]) ? true : false; - } - bool IsPunctuation(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return ispunct(s.data[0]) ? true : false; - } - bool IsPrintable(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return false; - return isprint(s.data[0]) ? true : false; - } - BSFixedString ToUpper(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return NULL; - - return SingleCharStar(toupper(s.data[0])).c_str(); - } - - BSFixedString ToLower(StaticFunctionTag* thisInput, BSFixedString s) - { - if (!s.data) - return NULL; - return SingleCharStar(tolower(s.data[0])).c_str(); - } - - UInt32 AsOrd(StaticFunctionTag* thisInput, BSFixedString s) - { - return s.data[0]; - } - - BSFixedString AsChar(StaticFunctionTag* thisInput, UInt32 c) - { - if (c > 255) - return NULL; - return SingleCharStar(c).c_str(); - } - - - - SInt32 Find(StaticFunctionTag* thisInput, BSFixedString theString, BSFixedString toFind, UInt32 startIndex) - { - if (startIndex < 0) - startIndex = 0; - - std::string s(theString.data); - if (startIndex >= s.length()) - return -1; - - std::transform(s.begin(), s.end(), s.begin(), toupper); - - std::string f(toFind.data); - std::transform(f.begin(), f.end(), f.begin(), toupper); - - std::string::size_type pos = s.find(f, startIndex); - return (pos == std::string::npos) ? -1 : pos; - } - - BSFixedString Substring(StaticFunctionTag* thisInput, BSFixedString theString, UInt32 startIndex, UInt32 len) - { - if (startIndex < 0) - return NULL; - - std::string tmpStr(theString.data); - if (startIndex >= tmpStr.length()) - return NULL; - - std::string sub = (len) ? tmpStr.substr(startIndex, len) : tmpStr.substr(startIndex); - return sub.c_str(); - } - - VMResultArray Split(StaticFunctionTag* thisInput, BSFixedString theString, BSFixedString theDelimiter) - { - VMResultArray result; - - std::string str(theString.data); - std::string delimiters(theDelimiter.data); - - std::string f(str); // Eliminate case sensitivity during find - std::transform(f.begin(), f.end(), f.begin(), toupper); - std::transform(delimiters.begin(), delimiters.end(), delimiters.begin(), toupper); - - std::string::size_type lastPos = f.find_first_not_of(delimiters, 0); - std::string::size_type pos = f.find_first_of(delimiters, lastPos); - - while (std::string::npos != pos || std::string::npos != lastPos) - { - std::string token = str.substr(lastPos, pos - lastPos); // Pull from original string - result.push_back(BSFixedString(token.c_str())); - lastPos = f.find_first_not_of(delimiters, pos); - pos = f.find_first_of(delimiters, lastPos); - } - - return result; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusStringUtil::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetLength", "StringUtil", papyrusStringUtil::GetLength, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetNthChar", "StringUtil", papyrusStringUtil::GetNthChar, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("IsUppercase", "StringUtil", papyrusStringUtil::IsUppercase, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("IsLowercase", "StringUtil", papyrusStringUtil::IsLowercase, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsLetter", "StringUtil", papyrusStringUtil::IsLetter, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsDigit", "StringUtil", papyrusStringUtil::IsDigit, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsPunctuation", "StringUtil", papyrusStringUtil::IsPunctuation, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsPrintable", "StringUtil", papyrusStringUtil::IsPrintable, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("ToUpper", "StringUtil", papyrusStringUtil::ToUpper, registry)); - - //registry->RegisterFunction( - // new NativeFunction1 ("ToLower", "StringUtil", papyrusStringUtil::ToLower, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("Find", "StringUtil", papyrusStringUtil::Find, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("Substring", "StringUtil", papyrusStringUtil::Substring, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("AsOrd", "StringUtil", papyrusStringUtil::AsOrd, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("AsChar", "StringUtil", papyrusStringUtil::AsChar, registry)); - - registry->RegisterFunction( - new NativeFunction2 , BSFixedString, BSFixedString> ("Split", "StringUtil", papyrusStringUtil::Split, registry)); - - registry->SetFunctionFlags("StringUtil", "GetLength", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "GetNthChar", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "IsLetter", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "IsDigit", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "IsPunctuation", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "IsPrintable", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "Find", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "Substring", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "AsOrd", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "AsChar", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("StringUtil", "Split", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusStringUtil.h b/source/fs.dll/skse64/skse64/PapyrusStringUtil.h deleted file mode 100644 index 57f2ff3a..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusStringUtil.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once -#include "GameTypes.h" - -struct StaticFunctionTag; -class VMClassRegistry; - - -namespace papyrusStringUtil -{ - void RegisterFuncs(VMClassRegistry* registry); - - - UInt32 GetLength(StaticFunctionTag* thisInput, BSFixedString s); - BSFixedString GetNthChar(StaticFunctionTag* thisInput, BSFixedString s, UInt32 index); - - bool IsUppercase(StaticFunctionTag* thisInput, BSFixedString s); - bool IsLowercase(StaticFunctionTag* thisInput, BSFixedString s); - bool IsLetter(StaticFunctionTag* thisInput, BSFixedString s); - bool IsDigit(StaticFunctionTag* thisInput, BSFixedString s); - bool IsPunctuation(StaticFunctionTag* thisInput, BSFixedString s); - bool IsPrintable(StaticFunctionTag* thisInput, BSFixedString s); - BSFixedString ToUpper(StaticFunctionTag* thisInput, BSFixedString s); - BSFixedString ToLower(StaticFunctionTag* thisInput, BSFixedString s); - - SInt32 Find(StaticFunctionTag* thisInput, BSFixedString theString, BSFixedString toFind, UInt32 startIndex = 0); - BSFixedString Substring(StaticFunctionTag* thisInput, BSFixedString s, UInt32 startIndex, UInt32 len = 0); - - UInt32 AsOrd(StaticFunctionTag* thisInput, BSFixedString s); - BSFixedString AsChar(StaticFunctionTag* thisInput, UInt32 c); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusTextureSet.cpp b/source/fs.dll/skse64/skse64/PapyrusTextureSet.cpp deleted file mode 100644 index bc13274f..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusTextureSet.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "PapyrusTextureSet.h" - -#include "GameObjects.h" - -namespace papyrusTextureSet -{ - UInt32 GetNumTexturePaths(BGSTextureSet * thisTextureSet) - { - return thisTextureSet ? BGSTextureSet::kNumTextures : NULL; - } - - BSFixedString GetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n) - { - return (thisTextureSet && n < BGSTextureSet::kNumTextures) ? thisTextureSet->texturePaths[n].str : NULL; - } - - void SetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n, BSFixedString texturePath) - { - if(thisTextureSet && n < BGSTextureSet::kNumTextures) { - thisTextureSet->texturePaths[n].str = texturePath; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusTextureSet::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0("GetNumTexturePaths", "TextureSet", papyrusTextureSet::GetNumTexturePaths, registry)); - - registry->RegisterFunction( - new NativeFunction1("GetNthTexturePath", "TextureSet", papyrusTextureSet::GetNthTexturePath, registry)); - - registry->RegisterFunction( - new NativeFunction2("SetNthTexturePath", "TextureSet", papyrusTextureSet::SetNthTexturePath, registry)); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusTextureSet.h b/source/fs.dll/skse64/skse64/PapyrusTextureSet.h deleted file mode 100644 index e40720fb..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusTextureSet.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -class BGSTextureSet; -class VMClassRegistry; - -namespace papyrusTextureSet -{ - void RegisterFuncs(VMClassRegistry * registry); - - UInt32 GetNumTexturePaths(BGSTextureSet * thisTextureSet); - BSFixedString GetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n); - void SetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n, BSFixedString texturePath); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusTree.cpp b/source/fs.dll/skse64/skse64/PapyrusTree.cpp deleted file mode 100644 index 099f3521..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusTree.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "PapyrusTree.h" -#include "GameObjects.h" - -namespace papyrusTree -{ - TESForm * GetIngredient(TESObjectTREE* thisTree) - { - return (thisTree) ? thisTree->produce.produce : NULL; - } - - void SetIngredient(TESObjectTREE* thisTree, TESForm* ingredient) - { - if (thisTree) { - thisTree->produce.produce = ingredient; - } - } - - BGSSoundDescriptorForm * GetHarvestSound(TESObjectTREE* thisTree) - { - return (thisTree) ? thisTree->produce.harvestSound : NULL; - } - - void SetHarvestSound(TESObjectTREE* thisTree, BGSSoundDescriptorForm * sound) - { - if (thisTree) { - thisTree->produce.harvestSound = sound; - } - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusTree::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterForm(TESObjectTREE::kTypeID, "TreeObject"); - - registry->RegisterFunction( - new NativeFunction0("GetIngredient", "TreeObject", papyrusTree::GetIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetIngredient", "TreeObject", papyrusTree::SetIngredient, registry)); - - registry->RegisterFunction( - new NativeFunction0("GetHarvestSound", "TreeObject", papyrusTree::GetHarvestSound, registry)); - - registry->RegisterFunction( - new NativeFunction1("SetHarvestSound", "TreeObject", papyrusTree::SetHarvestSound, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusTree.h b/source/fs.dll/skse64/skse64/PapyrusTree.h deleted file mode 100644 index d541e7d8..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusTree.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -class VMClassRegistry; -class BGSSoundDescriptorForm; -class TESObjectTREE; -class TESForm; - -namespace papyrusTree -{ - void RegisterFuncs(VMClassRegistry* registry); - - TESForm * GetIngredient(TESObjectTREE* thisTree); - void SetIngredient(TESObjectTREE* thisTree, TESForm* ingredient); - - BGSSoundDescriptorForm * GetHarvestSound(TESObjectTREE* thisTree); - void SetHarvestSound(TESObjectTREE* thisTree, BGSSoundDescriptorForm * sound); -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusUI.cpp b/source/fs.dll/skse64/skse64/PapyrusUI.cpp deleted file mode 100644 index 77940c95..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUI.cpp +++ /dev/null @@ -1,427 +0,0 @@ -#include "PapyrusUI.h" -#include "PapyrusVM.h" -#include "ScaleformCallbacks.h" -#include "ScaleformMovie.h" -#include "ScaleformAPI.h" -#include "ScaleformExtendedData.h" -#include "GameMenus.h" -#include "GameEvents.h" -#include "GameForms.h" -#include "GameInput.h" -#include "CustomMenu.h" -#include - -#include "Serialization.h" - -template <> void SetGFxValue (GFxValue * val, bool arg) { val->SetBool(arg); } -template <> void SetGFxValue (GFxValue * val, float arg) { val->SetNumber(arg); } -template <> void SetGFxValue (GFxValue * val, UInt32 arg) { val->SetNumber(arg); } -template <> void SetGFxValue (GFxValue * val, SInt32 arg) { val->SetNumber(arg); } -template <> void SetGFxValue (GFxValue * val, BSFixedString arg) -{ - // lifetime of this string will not be managed by the scaleform runtime - val->SetString(arg.data); -} - -template <> bool GetGFxValue (GFxValue * val) { return (val->GetType() == GFxValue::kType_Bool ? val->GetBool() : false); } -template <> float GetGFxValue (GFxValue * val) { return (val->GetType() == GFxValue::kType_Number ? val->GetNumber() : 0); } -template <> UInt32 GetGFxValue (GFxValue * val) { return (val->GetType() == GFxValue::kType_Number ? (UInt32)val->GetNumber() : 0); } -template <> SInt32 GetGFxValue (GFxValue * val) { return (val->GetType() == GFxValue::kType_Number ? (SInt32)val->GetNumber() : 0); } -template <> BSFixedString GetGFxValue (GFxValue * val) -{ - return (val->GetType() == GFxValue::kType_String ? BSFixedString(val->GetString()) : BSFixedString()); -} - -/// -/// UIInvokeDelegate -/// - -UIInvokeDelegate::UIInvokeDelegate(const char * nameBuf, const char * targetBuf) : - menuName_( nameBuf ), - target_( targetBuf ) -{} - -UIInvokeDelegate::UIInvokeDelegate(SerializationTag tag) -{} - -void UIInvokeDelegate::Run() -{ - MenuManager * mm = MenuManager::GetSingleton(); - if (!mm) - return; - - BSFixedString t(menuName_.c_str()); - GFxMovieView * view = mm->GetMovieView(&t); - if (!view) - return; - - GFxValue * value = NULL; - if (args.size() > 0) - value = &args[0]; - - view->Invoke(target_.c_str(), NULL, value, args.size()); -} - -bool UIInvokeDelegate::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - if (! WriteData(intfc, &menuName_)) - return false; - - if (! WriteData(intfc, &target_)) - return false; - - UInt32 argsSize = args.size(); - - if (! WriteData(intfc, &argsSize)) - return false; - - for (UInt32 i=0; iGetClassRegistry(); - IObjectHandlePolicy* policy = registry->GetHandlePolicy(); - - TESForm* form = (TESForm*) policy->Resolve(type_, handle_); - if (!form) - return; - - MenuManager* mm = MenuManager::GetSingleton(); - if (!mm) - return; - - BSFixedString t(menuName_.c_str()); - GFxMovieView * view = mm->GetMovieView(&t); - if (!view) - return; - - GFxValue args; - view->CreateObject(&args); - scaleformExtend::FormData(&args, view, form, false, false); - - view->Invoke(target_.c_str(), NULL, &args, 1); -} - -bool UIInvokeFormDelegate::Save(SKSESerializationInterface* intfc) -{ - using namespace Serialization; - - if (! WriteData(intfc, &menuName_)) - return false; - - if (! WriteData(intfc, &target_)) - return false; - - if (! WriteData(intfc, &type_)) - return false; - - if (! WriteData(intfc, &handle_)) - return false; - - return true; -} - -bool UIInvokeFormDelegate::Load(SKSESerializationInterface* intfc, UInt32 version) -{ - using namespace Serialization; - - if (! ReadData(intfc, &menuName_)) - return false; - - if (! ReadData(intfc, &target_)) - return false; - - if (! ReadData(intfc, &type_)) - return false; - - if (! ReadData(intfc, &handle_)) - return false; - - UInt64 fixedHandle; - if (intfc->ResolveHandle(handle_, &fixedHandle)) - handle_ = fixedHandle; - - return true; -} - -/// -/// Native functions -/// -namespace papyrusUI -{ - template - void SetT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, T value) - { - if (!menuName.data || !targetStr.data) - return; - - MenuManager * mm = MenuManager::GetSingleton(); - if (!mm) - return; - - GFxMovieView * view = mm->GetMovieView(&menuName); - if (!view) - return; - - GFxValue fxValue; - SetGFxValue(&fxValue, value); - - view->SetVariable(targetStr.data, &fxValue, 1); - } - - template - T GetT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString sourceStr) - { - if (!menuName.data || !sourceStr.data) - return 0; - - MenuManager * mm = MenuManager::GetSingleton(); - if (!mm) - return 0; - - GFxMovieView * view = mm->GetMovieView(&menuName); - if (!view) - return 0; - - GFxValue fxResult; - if (! view->GetVariable(&fxResult, sourceStr.data)) - return 0; - - return GetGFxValue(&fxResult); - } - - template - void InvokeArgT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, T arg) - { - if (!menuName.data || !targetStr.data) - return; - - UIManager* uiManager = UIManager::GetSingleton(); - if (!uiManager) - return; - - UIInvokeDelegate* cmd = new UIInvokeDelegate(menuName.data, targetStr.data); - - cmd->args.resize(1); - SetGFxValue(&cmd->args[0], arg); - - uiManager->QueueCommand(cmd); - } - - template - void InvokeArrayT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, VMArray args) - { - if (!menuName.data || !targetStr.data) - return; - - UIManager* uiManager = UIManager::GetSingleton(); - if (!uiManager) - return; - - UInt32 argCount = args.Length(); - - UIInvokeDelegate* cmd = new UIInvokeDelegate(menuName.data, targetStr.data); - - cmd->args.resize(argCount); - for (UInt32 i=0; i(&cmd->args[i], arg); - } - - uiManager->QueueCommand(cmd); - } - - void InvokeForm(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, TESForm * form) - { - if (!form || !menuName.data || !targetStr.data) - return; - - UIManager * uiManager = UIManager::GetSingleton(); - if (!uiManager) - return; - - VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); - IObjectHandlePolicy * policy = registry->GetHandlePolicy(); - - UInt64 handle = policy->Create(form->formType, form); - if (handle == policy->GetInvalidHandle()) - return; - - UIInvokeFormDelegate * cmd = new UIInvokeFormDelegate( - menuName.data, targetStr.data, form->formType, handle); - - uiManager->QueueCommand(cmd); - } - - bool IsMenuOpen(StaticFunctionTag* thisInput, BSFixedString menuName) - { - if (!menuName.data) - return 0; - - MenuManager * mm = MenuManager::GetSingleton(); - if (!mm) - return false; - - return mm->IsMenuOpen(&menuName); - } - - bool IsTextInputEnabled(StaticFunctionTag * thisInput) - { - InputManager * inputManager = InputManager::GetSingleton(); - - if(!inputManager) return false; - - return inputManager->allowTextInput != 0; - } - - void OpenCustomMenu(StaticFunctionTag* thisInput, BSFixedString swfPath, SInt32 flags) - { - CustomMenuCreator::SetSwfPath(swfPath.data); - - BSFixedString s("CustomMenu"); - CALL_MEMBER_FN(UIManager::GetSingleton(), AddMessage)(&s, UIMessage::kMessage_Open, NULL); - } - - void CloseCustomMenu(StaticFunctionTag* thisInput) - { - BSFixedString s("CustomMenu"); - CALL_MEMBER_FN(UIManager::GetSingleton(), AddMessage)(&s, UIMessage::kMessage_Close, NULL); - } -}; - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusUI::RegisterFuncs(VMClassRegistry* registry) -{ - SKSEObjectRegistry& skseObjRegistry = SKSEObjectRegistryInstance(); - skseObjRegistry.RegisterClass(); - skseObjRegistry.RegisterClass(); - - MenuManager * mm = MenuManager::GetSingleton(); - if (mm) - mm->Register("CustomMenu", CustomMenuCreator::Create); - - registry->RegisterFunction( - new NativeFunction3 ("SetBool", "UI", papyrusUI::SetT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetInt", "UI", papyrusUI::SetT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetFloat", "UI", papyrusUI::SetT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("SetString", "UI", papyrusUI::SetT, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetBool", "UI", papyrusUI::GetT, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetInt", "UI", papyrusUI::GetT, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetFloat", "UI", papyrusUI::GetT, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetString", "UI", papyrusUI::GetT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("InvokeBool", "UI", papyrusUI::InvokeArgT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("InvokeFloat", "UI", papyrusUI::InvokeArgT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("InvokeInt", "UI", papyrusUI::InvokeArgT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("InvokeString", "UI", papyrusUI::InvokeArgT, registry)); - - registry->RegisterFunction( - new NativeFunction3 > ("InvokeBoolA", "UI", papyrusUI::InvokeArrayT, registry)); - - registry->RegisterFunction( - new NativeFunction3 > ("InvokeIntA", "UI", papyrusUI::InvokeArrayT, registry)); - - registry->RegisterFunction( - new NativeFunction3 > ("InvokeFloatA", "UI", papyrusUI::InvokeArrayT, registry)); - - registry->RegisterFunction( - new NativeFunction3 > ("InvokeStringA", "UI", papyrusUI::InvokeArrayT, registry)); - - registry->RegisterFunction( - new NativeFunction3 ("InvokeForm", "UI", papyrusUI::InvokeForm, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("IsMenuOpen", "UI", papyrusUI::IsMenuOpen, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("IsTextInputEnabled", "UI", papyrusUI::IsTextInputEnabled, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("OpenCustomMenu", "UI", papyrusUI::OpenCustomMenu, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("CloseCustomMenu", "UI", papyrusUI::CloseCustomMenu, registry)); - - registry->SetFunctionFlags("UI", "InvokeBool", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeInt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeFloat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeString", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeBoolA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeIntA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeFloatA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeStringA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "InvokeForm", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "IsTextInputEnabled", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "OpenCustomMenu", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UI", "CloseCustomMenu", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusUI.h b/source/fs.dll/skse64/skse64/PapyrusUI.h deleted file mode 100644 index efdec1ce..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUI.h +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once - -#include "GameMenus.h" -#include "ScaleformCallbacks.h" -#include "ScaleformMovie.h" - -#include "PapyrusObjects.h" - -#include -#include - -struct StaticFunctionTag; -class VMClassRegistry; -template class VMArray; - -struct SKSESerializationInterface; - -/// -/// Helpers -/// - -template void SetGFxValue(GFxValue * val, T arg); -template <> void SetGFxValue (GFxValue * val, bool arg); -template <> void SetGFxValue (GFxValue * val, float arg); -template <> void SetGFxValue (GFxValue * val, UInt32 arg); -template <> void SetGFxValue (GFxValue * val, SInt32 arg); -template <> void SetGFxValue (GFxValue * val, BSFixedString arg); - -template T GetGFxValue(GFxValue * val); -template <> bool GetGFxValue (GFxValue * val); -template <> float GetGFxValue (GFxValue * val); -template <> UInt32 GetGFxValue (GFxValue * val); -template <> SInt32 GetGFxValue (GFxValue * val); -template <> BSFixedString GetGFxValue (GFxValue * val); - -/// -/// UIDelegate -/// - -class UIDelegate : public ISKSEObject -{ -public: - virtual ~UIDelegate() {} - - virtual void Run() = 0; -}; - -/// -/// UIInvokeDelegate -/// - -class UIInvokeDelegate : public UIDelegate -{ -public: - UIInvokeDelegate(const char* nameBuf, const char* targetBuf); - explicit UIInvokeDelegate(SerializationTag tag); - - virtual const char* ClassName() const { return "UIInvokeDelegate"; } - virtual UInt32 ClassVersion() const { return 1; } - - virtual bool Save(SKSESerializationInterface* intfc); - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version); - - virtual void Run(); - - std::vector args; - -private: - std::string menuName_; - std::string target_; -}; - -/// -/// UIInvokeFormDelegate -/// - -class UIInvokeFormDelegate : public UIDelegate -{ -public: - UIInvokeFormDelegate(const char* nameBuf, const char* targetBuf, UInt32 type, UInt64 handle); - explicit UIInvokeFormDelegate(SerializationTag tag); - - virtual const char* ClassName() const { return "UIInvokeFormDelegate"; } - virtual UInt32 ClassVersion() const { return 1; } - - virtual bool Save(SKSESerializationInterface* intfc); - virtual bool Load(SKSESerializationInterface* intfc, UInt32 version); - - virtual void Run(void); - -private: - std::string menuName_; - std::string target_; - - UInt32 type_; - UInt64 handle_; -}; - -/// -/// Native functions -/// -namespace papyrusUI -{ - // Template functions declared here for reference only - template - void SetT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, T value); - - template - T GetT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString sourceStr); - - template - void InvokeArgT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, T arg); - - template - void InvokeArrayT(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, VMArray args); - - bool IsMenuOpen(StaticFunctionTag* thisInput, BSFixedString menuName); - - void InvokeForm(StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr, TESForm * form); - - void OpenCustomMenu(StaticFunctionTag* thisInput, BSFixedString swfPath, SInt32 flags); - void CloseCustomMenu(StaticFunctionTag* thisInput); - - void RegisterFuncs(VMClassRegistry* registry); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusUICallback.cpp b/source/fs.dll/skse64/skse64/PapyrusUICallback.cpp deleted file mode 100644 index 0578ac72..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUICallback.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include "PapyrusUICallback.h" - -#include "common/ICriticalSection.h" - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -#include "PapyrusArgs.h" -#include "PapyrusUI.h" -#include "PapyrusObjects.h" - -/// -/// Native functions -/// - -namespace papyrusUICallback -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr) - { - ERROR_AND_RETURN_0_IF(!menuName.data, "Menu name must not be empty.", registry, stackId) - ERROR_AND_RETURN_0_IF(!targetStr.data, "Target name must not be empty.", registry, stackId) - - UIInvokeDelegate* cmd = new UIInvokeDelegate(menuName.data, targetStr.data); - - UInt32 handle = SKSEObjectStorageInstance().StoreObject(cmd, stackId); - return handle; - } - - bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle) - { - ERROR_AND_RETURN_0_IF(handle <= 0, "Invalid handle.", registry, stackId) - - UIManager* uiManager = UIManager::GetSingleton(); - if (!uiManager) - return false; - - UIInvokeDelegate* cmd = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_0_IF(cmd == NULL, "Failed to lookup object for given handle.", registry, stackId) - - // Transfers ownership to UIManager - uiManager->QueueCommand(cmd); - - return true; - } - - void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - UIInvokeDelegate* cmd = SKSEObjectStorageInstance().TakeObject(handle); - - ERROR_AND_RETURN_IF(cmd == NULL, "Failed to lookup object for given handle.", registry, stackId) - - delete cmd; - } - - template - void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - UIInvokeDelegate* cmd = SKSEObjectStorageInstance().AccessObject(handle); - - ERROR_AND_RETURN_IF(cmd == NULL, "Failed to lookup object for given handle.", registry, stackId) - - GFxValue value; - SetGFxValue(&value, arg); - cmd->args.push_back(value); - } - - template - void PushArray(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, VMArray args) - { - ERROR_AND_RETURN_IF(handle <= 0, "Invalid handle.", registry, stackId) - - UIInvokeDelegate* cmd = SKSEObjectStorageInstance().AccessObject(handle); - - ERROR_AND_RETURN_IF(cmd == NULL, "Failed to lookup object for given handle.", registry, stackId) - - UInt32 argCount = args.Length(); - - UInt32 offset = cmd->args.size(); - UInt32 newArgCount = offset + argCount; - - cmd->args.resize(newArgCount); - for (UInt32 i=0; i(&cmd->args[offset], arg); - } - } -} - -void papyrusUICallback::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction2 ("Create", "UICallback", papyrusUICallback::Create, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Send", "UICallback", papyrusUICallback::Send, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("Release", "UICallback", papyrusUICallback::Release, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushBool", "UICallback", papyrusUICallback::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushInt", "UICallback", papyrusUICallback::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushFloat", "UICallback", papyrusUICallback::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("PushString", "UICallback", papyrusUICallback::Push, registry)); - - registry->RegisterFunction( - new NativeFunction2 > ("PushBoolA", "UICallback", papyrusUICallback::PushArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 > ("PushIntA", "UICallback", papyrusUICallback::PushArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 > ("PushFloatA", "UICallback", papyrusUICallback::PushArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 > ("PushStringA", "UICallback", papyrusUICallback::PushArray, registry)); - - registry->SetFunctionFlags("UICallback", "Create", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "Send", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "Release", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushBool", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushInt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushFloat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushString", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushBoolA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushIntA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushFloatA", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("UICallback", "PushStringA", VMClassRegistry::kFunctionFlag_NoWait); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusUICallback.h b/source/fs.dll/skse64/skse64/PapyrusUICallback.h deleted file mode 100644 index d70bc0ef..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUICallback.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "GameTypes.h" - -struct StaticFunctionTag; -class VMClassRegistry; -template class VMArray; - -namespace papyrusUICallback -{ - SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr); - bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); - void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); - - template - void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg); - - template - void PushArray(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, VMArray args); - - void RegisterFuncs(VMClassRegistry* registry); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusUtility.cpp b/source/fs.dll/skse64/skse64/PapyrusUtility.cpp deleted file mode 100644 index 2edfc8be..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUtility.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include "PapyrusUtility.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "GameExtraData.h" -#include "GameRTTI.h" -#include "GameSettings.h" - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -namespace papyrusUtility -{ - float GetINIFloat(StaticFunctionTag* base, BSFixedString ini) - { - Setting * setting = GetINISetting(ini.data); - if(!setting || setting->GetType() != Setting::kType_Float) - return 0.0; - - return setting->data.f32; - } - - UInt32 GetINIInt(StaticFunctionTag* base, BSFixedString ini) - { - Setting * setting = GetINISetting(ini.data); - if(!setting || setting->GetType() != Setting::kType_Integer) - return 0; - - return setting->data.s32; - } - - bool GetINIBool(StaticFunctionTag* base, BSFixedString ini) - { - Setting * setting = GetINISetting(ini.data); - if(!setting || setting->GetType() != Setting::kType_Bool) - return false; - - return setting->data.u8 >= 1 ? true : false; - } - - BSFixedString GetINIString(StaticFunctionTag* base, BSFixedString ini) - { - Setting * setting = GetINISetting(ini.data); - if(!setting || setting->GetType() != Setting::kType_String) - return NULL; - - return setting->data.s; - } - - template - VMResultArray CreateArray(StaticFunctionTag* base, UInt32 size, T fillValue) - { - VMResultArray data; - data.resize(size, fillValue); - return data; - } - - template - VMResultArray ResizeArray(StaticFunctionTag* base, VMArray inArray, UInt32 size, T fillValue) - { - VMResultArray data; - data.resize(size, fillValue); - UInt32 arrayLength = min(inArray.Length(), size); - for(UInt32 i = 0; i < arrayLength; i++) - { - T value; - inArray.Get(&value, i); - data[i] = value; - } - return data; - } -} - -void papyrusUtility::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction1 ("GetINIFloat", "Utility", papyrusUtility::GetINIFloat, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetINIInt", "Utility", papyrusUtility::GetINIInt, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetINIBool", "Utility", papyrusUtility::GetINIBool, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("GetINIString", "Utility", papyrusUtility::GetINIString, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, float>("CreateFloatArray", "Utility", papyrusUtility::CreateArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, SInt32>("CreateIntArray", "Utility", papyrusUtility::CreateArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, bool>("CreateBoolArray", "Utility", papyrusUtility::CreateArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, BSFixedString>("CreateStringArray", "Utility", papyrusUtility::CreateArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, TESForm*>("CreateFormArray", "Utility", papyrusUtility::CreateArray, registry)); - - registry->RegisterFunction( - new NativeFunction2 , UInt32, BGSBaseAlias*>("CreateAliasArray", "Utility", papyrusUtility::CreateArray, registry)); - - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, float>("ResizeFloatArray", "Utility", papyrusUtility::ResizeArray, registry)); - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, SInt32>("ResizeIntArray", "Utility", papyrusUtility::ResizeArray, registry)); - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, bool>("ResizeBoolArray", "Utility", papyrusUtility::ResizeArray, registry)); - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, BSFixedString>("ResizeStringArray", "Utility", papyrusUtility::ResizeArray, registry)); - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, TESForm*>("ResizeFormArray", "Utility", papyrusUtility::ResizeArray, registry)); - - registry->RegisterFunction( - new NativeFunction3 , VMArray, UInt32, BGSBaseAlias*>("ResizeAliasArray", "Utility", papyrusUtility::ResizeArray, registry)); - - - registry->SetFunctionFlags("Utility", "GetINIFloat", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "GetINIInt", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "GetINIBool", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "GetINIString", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Utility", "CreateFloatArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "CreateIntArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "CreateBoolArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "CreateStringArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "CreateFormArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "CreateAliasArray", VMClassRegistry::kFunctionFlag_NoWait); - - registry->SetFunctionFlags("Utility", "ResizeFloatArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "ResizeIntArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "ResizeBoolArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "ResizeStringArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "ResizeFormArray", VMClassRegistry::kFunctionFlag_NoWait); - registry->SetFunctionFlags("Utility", "ResizeAliasArray", VMClassRegistry::kFunctionFlag_NoWait); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusUtility.h b/source/fs.dll/skse64/skse64/PapyrusUtility.h deleted file mode 100644 index 7b74107b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusUtility.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include "GameTypes.h" - -struct StaticFunctionTag; - -class VMClassRegistry; - -namespace papyrusUtility { - - void RegisterFuncs(VMClassRegistry* registry); - - float GetINIFloat(StaticFunctionTag* base, BSFixedString ini); - UInt32 GetINIInt(StaticFunctionTag* base, BSFixedString ini); - bool GetINIBool(StaticFunctionTag* base, BSFixedString ini); - BSFixedString GetINIString(StaticFunctionTag* base, BSFixedString ini); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusVM.cpp b/source/fs.dll/skse64/skse64/PapyrusVM.cpp deleted file mode 100644 index 08ccc729..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusVM.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "PapyrusVM.h" -#include "GameAPI.h" - -// 3740B7AD44E615CF1BB4401806BB6F9DB42DA46D+12 -RelocPtr g_skyrimVM(0x01F5F4F8); - -void VMClassInfo::AddRef(void) -{ - InterlockedIncrement(&refCount); -} - -void VMClassInfo::Release(void) -{ - if(!InterlockedDecrement(&refCount)) - { - CALL_MEMBER_FN(this, Destroy)(); - Heap_Free(this); - } -} - -UInt64 VMIdentifier::GetHandle(void) -{ - UInt64 result = (*g_objectHandlePolicy)->GetInvalidHandle(); - - SInt32 oldLock = Lock(); - result = m_handle; - Unlock(oldLock); - - return result; -} - -SInt32 VMIdentifier::Lock(void) -{ - UInt32 spinCount = 0; - SInt32 lockValue; - - while(true) - { - lockValue = m_lock; - - if(lockValue & kLockBit) - { - // someone else is holding the lock, sleep - if(spinCount <= kFastSpinThreshold) - { - Sleep(0); - spinCount++; - } - else - { - Sleep(1); - } - } - else - { - // try to take the lock - if(InterlockedCompareExchange(&m_lock, lockValue | kLockBit, lockValue) == lockValue) - break; - } - } - - return lockValue; -} - -void VMIdentifier::Unlock(SInt32 oldLock) -{ - m_lock = oldLock; -} - -// try to increment the lock -// on 1 -> 2, call IObjectHandlePolicy::Unk_09(m_handle) with the lock held -void VMIdentifier::IncrementLock(void) -{ - UInt32 spinCount = 0; - - while(true) - { - SInt32 lockValue = m_lock; - - if(lockValue & kLockBit) - { - if(spinCount <= kFastSpinThreshold) - { - Sleep(0); - spinCount++; - } - else - { - Sleep(1); - } - } - else - { - if(lockValue == 1) - { - if(InterlockedCompareExchange(&m_lock, lockValue | kLockBit, lockValue) == lockValue) - { - (*g_objectHandlePolicy)->AddRef(m_handle); - m_lock = 2; - break; - } - } - else - { - if(InterlockedCompareExchange(&m_lock, lockValue + 1, lockValue) == lockValue) - break; - } - } - } -} - -// try to decrement the lock -// on 2 -> 1, call IObjectHandlePolicy::Unk_0A(m_handle) with the lock held -SInt32 VMIdentifier::DecrementLock(void) -{ - UInt32 spinCount = 0; - - while(true) - { - SInt32 lockValue = m_lock; - - if(lockValue & kLockBit) - { - if(spinCount <= kFastSpinThreshold) - { - Sleep(0); - spinCount++; - } - else - { - Sleep(1); - } - } - else - { - if(lockValue == 2) - { - if(InterlockedCompareExchange(&m_lock, lockValue | kLockBit, lockValue) == lockValue) - { - (*g_objectHandlePolicy)->Release(m_handle); - m_lock = 1; - return 1; - } - } - else - { - if(InterlockedCompareExchange(&m_lock, lockValue - 1, lockValue) == lockValue) - return lockValue - 1; - } - } - } -} - -void VMIdentifier::Destroy(void) -{ - CALL_MEMBER_FN(this, Destroy_Internal)(); - Heap_Free(this); -} - -UInt32 VMValue::GetUnmangledType(void) -{ - if(type <= 0x0F) - return type; - - return (type & 1) ? kType_Unk0B : kType_Identifier; -} - -VMStackInfo* VMClassRegistry::GetStackInfo(UInt32 stackId) -{ - VMStackInfo* result = NULL; - - stackLock.Lock(); - - VMStackTableItem* item = allStacks.Find(&stackId); - - if (item != NULL && - item->data != NULL && - item->data->unkData != NULL) - { - result = item->data->unkData->stackInfo; - } - - stackLock.Release(); - - return result; -} - -UInt32 SkyrimVM::ClearInvalidRegistrations(void) -{ - IObjectHandlePolicy * policy = m_classRegistry->GetHandlePolicy(); - UInt64 invalidHandle = policy->GetInvalidHandle(); - - m_updateLock.Lock(); - - UInt32 count = 0; - while(m_updateRegHolder.Remove(invalidHandle) == true) - count++; - - while(m_updateGameTimeRegHolder.Remove(invalidHandle) == true) - count++; - - m_updateLock.Release(); - - return count; -} diff --git a/source/fs.dll/skse64/skse64/PapyrusVM.h b/source/fs.dll/skse64/skse64/PapyrusVM.h deleted file mode 100644 index 0480ce42..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusVM.h +++ /dev/null @@ -1,444 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/GameTypes.h" -#include "skse64/GameUtilities.h" - -#include "skse64/PapyrusValue.h" -#include "skse64/PapyrusInterfaces.h" - -class IFunction; -class VMIdentifier; -class VMValue; -class VMClassRegistry; -class IFunctionArguments; -class DelayFunctor; - - -class VMClassFunctionVisitor -{ -public: - virtual bool Accept(IFunction * func) = 0; -}; - -// ?? -class VMClassInfo -{ -public: - SInt32 refCount; // 00 - UInt32 unk04; // 04 - StringCache::Ref name; // 08 - VMClassInfo * parent; // 10 - StringCache::Ref * unk0C; // 18 - // ... More - - //UInt32 unk10; // 10 - //UInt32 unk14; // 14 - //UInt32 numFuncs; // 18 - //UInt32 funcPtr; // 1C - - /*IFunction** GetFunctions() const - { - return (IFunction**)(funcPtr + - 4 * ( - ((unk14 >> 10) & 0x3FF) * 10 + - ((unk10 >> 8) & 0x3FF) * 2 + - ((unk10 >> 2) & 0x3F) + - (unk14 & 0x3FF) * 3 - ) - ); - } - - UInt32 GetNumMemberFunctions() const - { - return numFuncs & 0x1FF; - } - - UInt32 GetNumGlobalFunctions() const - { - return (unk14 >> 20) & 0x1FF; - } - - void Visit(VMClassFunctionVisitor & visitor) - { - UInt32 globalFns = GetNumGlobalFunctions(); - UInt32 memberFns = GetNumMemberFunctions(); - - IFunction ** funcPtr = GetFunctions(); - for(UInt32 i = 0; i < globalFns + memberFns; i++) { - IFunction * func = funcPtr[i]; - if(func) { - if(visitor.Accept(func)) - break; - } - } - }*/ - - void AddRef(void); - void Release(void); - - MEMBER_FN_PREFIX(VMClassInfo); - DEFINE_MEMBER_FN(Destroy, void, 0x013626F0); - DEFINE_MEMBER_FN(GetVariable, SInt32, 0x01363980, BSFixedString * name); - // - DEFINE_MEMBER_FN(GetFunction, IFunction*, 0x013670C0, const char * fnName); -}; - -// This type is not fully decoded or correctly sized, just enough to use the functor -class VMScriptInstance -{ -public: - UInt32 unk00; - VMClassInfo * classInfo; - void * unk08; - UInt32 unk0C; - UInt32 formId; - UInt32 unk14; - UInt32 unk18; -}; - -// 04 -class IForEachScriptObjectFunctor -{ -public: - IForEachScriptObjectFunctor(){}; - virtual ~IForEachScriptObjectFunctor() {}; - - // return true to continue - virtual bool Visit(VMScriptInstance * arg, void * arg2) { return false; }; - -// void ** _vtbl; // 00 -}; - -// 48+ -class VMUnlinkedClassList -{ - virtual ~VMUnlinkedClassList() { } - virtual VMUnlinkedClassList * Create(void); - virtual void SetUnk0C(void * arg); - virtual bool Link(StringCache::Ref * className); - -// void ** _vtbl; // 00 - VMClassRegistry * unk04; // 04 - void * unk08; // 08 - void * unk0C; // 0C - loader - UInt8 unk10; // 10 - UInt8 pad11[3]; // 11 - UInt32 unk14; // 14 - UInt32 unk18; // 18 - UInt32 unk1C; // 1C - void * unk20; // 20 - UInt32 unk24; // 24 - UInt32 unk28; // 28 - UInt32 unk2C; // 2C - void * unk30; // 30 - UInt32 unk34; // 34 - UInt32 unk38; // 38 - UInt32 unk3C; // 3C - void * unk40; // 40 - UInt32 unk44; // 44 -}; - -// 044 -class VMStackInfo -{ -public: - virtual ~VMStackInfo(); - - // more virtual functions ... - - //void** _vtbl; // 000 - SInt32 refCount; // 004 - const char* rootCallName; // 008 - not sure if BSFixedString - const char* scriptName; // 00C - not sure if BSFixedString - // ... - -}; - -// ?? -class UnkVMStackData1 -{ -public: - UInt32 unk000; // 000 - void* unk004; // 004 - UInt32 unk008; // 008 - - VMStackInfo* stackInfo; // 00C - // ... -}; - -// ?? -class UnkVMStackData2 -{ -public: - UInt32 unk000; // 000 - refCount? - void* unk004; // 004 - UInt32 unk008; // 008 - UInt32 unk00C; // 00C - - UnkVMStackData1* unkData; // 010 - // ... -}; - -// 00C -class VMStackTableItem -{ -public: - UInt32 stackId; - UnkVMStackData2* data; - - operator UInt32() const { return stackId; } - - static inline UInt32 GetHash(UInt32* pStackId) - { - UInt32 hash; - CalculateCRC32_32(&hash, *pStackId); - return hash; - } -}; - -// 4B04 -// this does more than hold on to class registrations, but for now that's all we care about -class VMClassRegistry -{ -public: - enum - { - kFunctionFlag_NoWait = 0x01 // set this only if your function is thread-safe - }; - - enum - { - kLogLevel_Info = 0, - kLogLevel_Warning, - kLogLevel_Error, - kLogLevel_Fatal - }; - - typedef tHashSet StackTableT; - - VMClassRegistry(); - virtual ~VMClassRegistry(); - - // ### indices are from 1.5.26 - - virtual void Unk_01(void); - virtual void PrintToDebugLog(const char* text, UInt32 stackId, UInt32 logLevel); - virtual void Unk_03(void); - virtual void Unk_04(void); - virtual void Unk_05(void); - virtual void Unk_06(void); - virtual void Unk_07(void); - virtual void RegisterForm(UInt32 typeID, const char * papyrusClassName); - virtual void Unk_09(void); - virtual bool GetFormTypeClass(UInt32 formType, VMClassInfo ** outClass); - virtual void Unk_0B(void); - virtual void Unk_0C(void); - virtual bool Unk_0D(StringCache::Ref * className, UInt32 * unk); - virtual void Unk_0E(void); - virtual void Unk_0F(void); - virtual void Unk_10(void); - virtual void Unk_11(void); - virtual void Unk_12(void); - virtual void Unk_13(void); - virtual void Unk_14(void); - virtual bool Unk_15(StringCache::Ref * className, VMIdentifier ** identifier); - virtual bool CreateArray(VMValue * value, UInt32 size, VMValue::ArrayData ** unk1); - virtual void Unk_17(void); - virtual void RegisterFunction(IFunction * fn); - virtual void SetFunctionFlagsEx(const char * className, UInt32 unk0, const char * fnName, UInt32 flags); - virtual void SetFunctionFlags(const char * className, const char * fnName, UInt32 flags); - virtual void VisitScripts(UInt64 handle, IForEachScriptObjectFunctor * functor); - virtual bool Unk_1C(UInt64 handle, const char * className, VMIdentifier ** identifier); - virtual void Unk_1D(void); - virtual void Unk_1E(void); - virtual void Unk_1F(void); - virtual void Unk_20(void); - virtual void Unk_21(void); - virtual void Unk_22(void); - virtual bool ExtractValue(UInt64 handle, StringCache::Ref * className, SInt32 variableIndex, VMValue * out); // unk probably script context object? - virtual void QueueEvent(UInt64 handle, const StringCache::Ref * eventName, IFunctionArguments * args); - virtual void Unk_25(void); - virtual void Unk_26(void); - virtual void Unk_27(void); - virtual void Unk_28(void); - virtual void Unk_29(void); - virtual void Unk_2A(void); - virtual void ResumeStack(UInt32 stackId, VMValue* result); - virtual void Unk_2C(void); - virtual IObjectHandlePolicy * GetHandlePolicy(void); - virtual void Unk_2E(void); - virtual ObjectBindPolicy * GetObjectBindPolicy(void); - virtual void Unk_30(void); - virtual void Unk_31(void); - virtual void Unk_32(void); - virtual void Unk_33(void); - virtual void Unk_34(void); - virtual void Unk_35(void); - -// void ** _vtbl; // 0000 - UInt64 unk0008; // 0008 - refcount? - void ** vtbl0008; // 0010 - void ** vtbl000C; // 0018 - void ** vtbl0010; // 0020 - - UInt64 unk9310[(0x9310 - 0x20) >> 3]; // 9310 - - SimpleLock stackLock; // 9318 - StackTableT allStacks; // 9320 - StackTableT waitingStacks; // 9350 - - // More... - - VMStackInfo* GetStackInfo(UInt32 stackId); - - void LogError(const char* message, UInt32 stackId) { PrintToDebugLog(message, stackId, kLogLevel_Error); } - void LogWarning(const char* message, UInt32 stackId) { PrintToDebugLog(message, stackId, kLogLevel_Warning); } -}; -STATIC_ASSERT(offsetof(VMClassRegistry, stackLock) == 0x9318); -STATIC_ASSERT(offsetof(VMClassRegistry, allStacks) == 0x9320); -STATIC_ASSERT(offsetof(VMClassRegistry, waitingStacks) == 0x9350); - -class IStackCallbackSaveInterface -{ -public: - virtual ~IStackCallbackSaveInterface(); - - virtual void Unk_01(void); - virtual void Unk_02(void); -}; - -// 45D0 -class SkyrimVM -{ -public: - SkyrimVM(); - virtual ~SkyrimVM(); - - virtual void Unk_01(void); - - enum - { - kEventSink_Activate = 0, - kEventSink_ActiveEffectApplyRemove, - kEventSink_ActorLocationChange, - kEventSink_BookRead, - kEventSink_CellAttachDetach, - kEventSink_CellFullyLoaded, - kEventSink_Combat, - kEventSink_ContainerChanged, - kEventSink_Death, - kEventSink_DestructionStateChanged, - kEventSink_EnterBleedout, - kEventSink_Equip, - kEventSink_FormDelete, - kEventSink_Furniture, - kEventSink_GrabRelease, - kEventSink_Hit, - kEventSink_InitScript, - kEventSink_LoadGame, - kEventSink_LockChanged, - kEventSink_MagicEffectApply, - kEventSink_MagicWardHit, - kEventSink_MoveAttachDetach, - kEventSink_ObjectLoaded, - kEventSink_ObjectREFRTranslation, - kEventSink_OpenClose, - kEventSink_Package, - kEventSink_PerkEntryRun, - kEventSink_QuestInit, - kEventSink_QuestStage, - kEventSink_Reset, - kEventSink_ResolveNPCTemplates, - kEventSink_Scene, - kEventSink_SceneAction, - kEventSink_ScenePhase, - kEventSink_Sell, - kEventSink_SleepStart, - kEventSink_SleepStop, - kEventSink_SpellCast, - kEventSink_TopicInfo, - kEventSink_TrackedStats, - kEventSink_TrapHit, - kEventSink_Trigger, - kEventSink_TriggerEnter, - kEventSink_TriggerLeave, - kEventSink_UniqueIDChange, - kEventSink_SwitchRaceComplete, - kEventSink_PlayerBowShot, - kEventSink_FastTravelEnd, // added in 1.5.3 - kEventSink_PositionPlayer, - kEventSink_Stats, - kEventSink_NumEvents - }; - -// void ** _vtbl; // 0000 - IStackCallbackSaveInterface m_callbackSaveInterface; // 0008 - void * eventSinks[kEventSink_NumEvents]; // 0010 - UInt64 unk1A0[(0x200 - 0x1A0) >> 3]; // 01A0 - VMClassRegistry * m_classRegistry; // 0200 - UInt8 pad200[0x714 - 0x208]; // 0208 - SimpleLock m_updateLock; // 0714 - UInt8 pad71C[0x720 - 0x71C]; // 071C - UpdateRegistrationHolder m_updateRegHolder; // 0720 - UpdateRegistrationHolder m_updateGameTimeRegHolder; // 0738 - - VMClassRegistry * GetClassRegistry(void) { return m_classRegistry; } - - UInt32 ClearInvalidRegistrations(void); - - MEMBER_FN_PREFIX(SkyrimVM); - - // Used by Hooks_Papyrus - // - DEFINE_MEMBER_FN(UnregisterFromSleep_Internal, void, 0x009520A0, UInt64 handle); // AE: using one function earlier due to inlining - DEFINE_MEMBER_FN(RevertGlobalData_Internal, bool, 0x0095BD90); - // 4DF4B0288419C72FBF262CE2DBBAAFE7D9713C51+390 - DEFINE_MEMBER_FN(SaveRegSleepEventHandles_Internal, bool, 0x0095D150, void * handleReaderWriter, void * saveStorageWrapper); - // 4F9ECB23ABD5935D4160213D8A06DB7A94E6B988+2FB - DEFINE_MEMBER_FN(LoadRegSleepEventHandles_Internal, bool, 0x0095E3F0, void * handleReaderWriter, void * loadStorageWrapper); // AE: using one function earlier due to inlining - - // 96B4034421813AABF0DBF8B2B00A84CC25FB9CA0+112 - DEFINE_MEMBER_FN(QueueDelayFunctor_Internal, bool, 0x00952F10, void** pFunctor); - - bool QueueDelayFunctor(void** pFunctor) - { - return CALL_MEMBER_FN(this, QueueDelayFunctor_Internal)(pFunctor); - } - - void OnFormDelete_Hook(UInt64 handle); - void RevertGlobalData_Hook(void); - bool SaveGlobalData_Hook(void * handleReaderWriter, void * saveStorageWrapper); - bool LoadGlobalData_Hook(void * handleReaderWriter, void * loadStorageWrapper); -}; -STATIC_ASSERT(offsetof(SkyrimVM, m_classRegistry) == 0x200); -STATIC_ASSERT(offsetof(SkyrimVM, m_updateLock) == 0x714); -STATIC_ASSERT(offsetof(SkyrimVM, m_updateRegHolder) == 0x720); -STATIC_ASSERT(offsetof(SkyrimVM, m_updateGameTimeRegHolder) == 0x738); - -extern RelocPtr g_skyrimVM; - -// ?? -class IFunctionArguments -{ -public: - virtual ~IFunctionArguments() { } - - // ?? - struct Output - { - UInt32 unk00; // 00 - UInt32 unk04; // 04 - VMValue * m_data; // 08 - confirmed offset - UInt64 unk08; // 10 - UInt32 m_size; // 18 - confirmed offset - - void Resize(UInt32 len) { CALL_MEMBER_FN(this, Resize)(len); } - VMValue * Get(UInt32 idx) { return (idx < m_size) ? &m_data[idx] : NULL; } - - MEMBER_FN_PREFIX(Output); - DEFINE_MEMBER_FN(Resize, bool, 0x0094D7B0, UInt32 len); - }; - - virtual bool Copy(Output * dst) = 0; -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusValue.cpp b/source/fs.dll/skse64/skse64/PapyrusValue.cpp deleted file mode 100644 index 3471a9f6..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusValue.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "skse64/PapyrusValue.h" diff --git a/source/fs.dll/skse64/skse64/PapyrusValue.h b/source/fs.dll/skse64/skse64/PapyrusValue.h deleted file mode 100644 index e14156b3..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusValue.h +++ /dev/null @@ -1,205 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/GameTypes.h" - -class VMClassInfo; - -// ?? -class VMIdentifier -{ -public: - enum - { - kLockBit = 0x80000000, - kFastSpinThreshold = 10000 - }; - - SInt32 m_refCount; // 00 - UInt32 unk04; // 04 - VMClassInfo * m_type; // 08 - void * unk08; // 10 - void * unk0C; // 18 - volatile UInt64 m_handle; // 20 - volatile SInt32 m_lock; // 28 - - UInt64 GetHandle(void); - - SInt32 Lock(void); - void Unlock(SInt32 oldLock); - - // lock and refcount? - void IncrementLock(void); - SInt32 DecrementLock(void); - - void Destroy(void); - - MEMBER_FN_PREFIX(VMIdentifier); - DEFINE_MEMBER_FN(Destroy_Internal, void, 0x0135EA90); -}; - -// 10 -class VMValue -{ -public: - VMValue() :type(kType_None) { data.p = 0; } - ~VMValue() { CALL_MEMBER_FN(this, Destroy)(); } - - VMValue(const VMValue & other) - { - if (&other != this) - { - type = kType_None; - data.p = nullptr; - CALL_MEMBER_FN(this, Set)(&other); - } - } - VMValue& operator=(const VMValue& other) - { - if (&other == this) - return *this; - - CALL_MEMBER_FN(this, Set)(&other); - return *this; - } - - enum - { - kType_None = 0, - kType_Identifier = 1, - kType_String = 2, - kType_Int = 3, - kType_Float = 4, - kType_Bool = 5, - - kType_Unk0B = 0x0B, - kType_ArraysStart = 11, - kType_StringArray = 12, - kType_IntArray = 13, - kType_FloatArray = 14, - kType_BoolArray = 15, - kType_ArraysEnd = 16, - - kNumLiteralArrays = 4 - }; - - // 18+ - struct ArrayData - { - volatile SInt32 refCount; // 00 - UInt32 unk04; // 04 - UInt64 unk08; // 08 - UInt32 len; // 10 - UInt32 unk14; // 14 - UInt64 unk18; // 18 - //VMValue data[0]; // 20 - - VMValue * GetData(void) { return (VMValue *)(this + 1); } - - MEMBER_FN_PREFIX(ArrayData); - DEFINE_MEMBER_FN(Destroy, void, 0x0136C5D0); - }; - - UInt64 type; // 00 - - union - { - SInt32 i; - UInt32 u; - float f; - bool b; - void * p; - ArrayData * arr; - VMIdentifier * id; - const char * str; // BSFixedString - - BSFixedString * GetStr(void) { return (BSFixedString *)(&str); } - } data; // 04 - - MEMBER_FN_PREFIX(VMValue); - DEFINE_MEMBER_FN(Set, void, 0x013623F0, const VMValue * src); - DEFINE_MEMBER_FN(Destroy, void, 0x013622F0); - DEFINE_MEMBER_FN(SetArray, void, 0x01361320, ArrayData * data); - - bool IsIdentifierArray() - { - return (type >= kType_ArraysEnd && type & kType_Identifier); - } - - bool IsLiteralArray() - { - return type - kType_ArraysStart <= kNumLiteralArrays; - } - - bool IsArray() - { - return IsLiteralArray() || IsIdentifierArray(); - } - - void SetNone(void) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = kType_None; - data.u = 0; - } - - void SetInt(SInt32 i) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = kType_Int; - data.i = i; - } - - void SetFloat(float f) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = kType_Float; - data.f = f; - } - - void SetBool(bool b) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = kType_Bool; - data.b = b; - } - - void SetIdentifier(VMClassInfo * classInfo) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = (UInt64)classInfo; - data.id = NULL; - } - - void SetIdentifier(VMIdentifier ** identifier) - { - if (GetUnmangledType() == kType_Identifier) - { - CALL_MEMBER_FN(this, Destroy)(); - - if (*identifier) - (*identifier)->IncrementLock(); - - data.id = *identifier; - } - } - - void SetString(const char * str) - { - CALL_MEMBER_FN(this, Destroy)(); - - type = kType_String; - CALL_MEMBER_FN(data.GetStr(), Set)(str); - } - - // 00-0F are untouched - // 10+ alternate between 0x01 and 0x0B - UInt32 GetUnmangledType(void); - - bool IsIdentifier(void) { return GetUnmangledType() == kType_Identifier; } -}; diff --git a/source/fs.dll/skse64/skse64/PapyrusWeapon.cpp b/source/fs.dll/skse64/skse64/PapyrusWeapon.cpp deleted file mode 100644 index 4581497b..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWeapon.cpp +++ /dev/null @@ -1,413 +0,0 @@ -#include "PapyrusWeapon.h" - -#include "GameObjects.h" -#include "GameData.h" - -namespace papyrusWeapon -{ - UInt32 GetBaseDamage(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->damage.GetAttackDamage() : 0; - } - - void SetBaseDamage(TESObjectWEAP* thisWeapon, UInt32 nuDamage) - { - if (thisWeapon) { - thisWeapon->damage.attackDamage = nuDamage; - } - } - - UInt32 GetCritDamage(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->critDamage() : 0; - } - - void SetCritDamage(TESObjectWEAP* thisWeapon, UInt32 critDamage) - { - if (thisWeapon) { - thisWeapon->critData.critDamage = critDamage; - } - } - - float GetReach(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->reach() : 0; - } - - void SetReach(TESObjectWEAP* thisWeapon, float nuReach) - { - if(thisWeapon) { - thisWeapon->gameData.reach = nuReach; - } - } - - float GetSpeed(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->speed() : 0.0; - } - - void SetSpeed(TESObjectWEAP* thisWeapon, float speed) - { - if (thisWeapon) { - thisWeapon->gameData.speed = speed; - } - } - - float GetStagger(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->stagger() : 0.0; - } - - void SetStagger(TESObjectWEAP* thisWeapon, float stagger) - { - if (thisWeapon) { - thisWeapon->gameData.stagger = stagger; - } - } - - float GetMinRange(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->minRange() : 0.0; - } - - void SetMinRange(TESObjectWEAP* thisWeapon, float minRange) - { - if (thisWeapon) { - thisWeapon->gameData.minRange = minRange; - } - } - - float GetMaxRange(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->maxRange() : 0.0; - } - - void SetMaxRange(TESObjectWEAP* thisWeapon, float maxRange) - { - if (thisWeapon) { - thisWeapon->gameData.maxRange = maxRange; - } - } - - UInt32 GetWeaponType(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->type() : 0; - } - - void SetWeaponType(TESObjectWEAP* thisWeapon, UInt32 nuType) - { - if(thisWeapon) { - thisWeapon->gameData.type = nuType; - } - } - - - BSFixedString GetModelPath(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->texSwap.GetModelName() : NULL; - } - - void SetModelPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath) - { - if(thisWeapon) { - thisWeapon->texSwap.SetModelName(nuPath.data); - } - } - - BSFixedString GetIconPath(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->icon.str : NULL; - } - - void SetIconPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath) - { - if(thisWeapon) { - thisWeapon->icon.str = nuPath.data; - } - } - - BSFixedString GetMessageIconPath(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->messageIcon.icon.str : NULL; - } - - void SetMessageIconPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath) - { - if(thisWeapon) { - thisWeapon->messageIcon.icon.str = nuPath.data; - } - } - - EnchantmentItem* GetEnchantment(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->enchantable.enchantment : NULL; - } - - void SetEnchantment(TESObjectWEAP* thisWeapon, EnchantmentItem* enchantment) - { - if (thisWeapon) { - thisWeapon->enchantable.enchantment = enchantment; - } - } - - UInt32 GetEnchantmentValue(TESObjectWEAP* thisWeapon) - { - return (thisWeapon && thisWeapon->enchantable.enchantment) ? thisWeapon->enchantable.maxCharge : 0; - } - - void SetEnchantmentValue(TESObjectWEAP* thisWeapon, UInt32 value) - { - if (thisWeapon && thisWeapon->enchantable.enchantment) { - thisWeapon->enchantable.maxCharge = value; - } - } - - TESObjectSTAT * GetEquippedModel(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->model : NULL; - } - - void SetEquippedModel(TESObjectWEAP* thisWeapon, TESObjectSTAT * model) - { - if (thisWeapon) { - thisWeapon->model = model; - } - } - - BGSEquipSlot * GetEquipType(TESObjectWEAP* thisWeapon) - { - if (thisWeapon) { - return thisWeapon->equipType.equipSlot; -// return thisWeapon->equipType.GetEquipSlot(); - } - - // Invalid EquipSlot - return NULL; - } - - void SetEquipType(TESObjectWEAP* thisWeapon, BGSEquipSlot * slot) - { - if (thisWeapon && slot) { - thisWeapon->equipType.SetEquipSlot(slot); - } - } - - - BSFixedString GetSkill(TESObjectWEAP* thisWeapon) - { - if(!thisWeapon) - return ""; - - ActorValueList * avList = ActorValueList::GetSingleton(); - if(!avList) - return ""; - - ActorValueInfo * info = avList->GetActorValue(thisWeapon->gameData.skill); - if(!info) - return ""; - - return info->name; - } - - void SetSkill(TESObjectWEAP* thisWeapon, BSFixedString skill) - { - if(thisWeapon) { - UInt32 actorValue = ActorValueList::ResolveActorValueByName(skill.data); - thisWeapon->gameData.skill = actorValue; - } - } - - BSFixedString GetResist(TESObjectWEAP* thisWeapon) - { - if(!thisWeapon) - return ""; - - ActorValueList * avList = ActorValueList::GetSingleton(); - if(!avList) - return ""; - - ActorValueInfo * info = avList->GetActorValue(thisWeapon->gameData.resist); - if(!info) - return ""; - - return info->name; - } - - void SetResist(TESObjectWEAP* thisWeapon, BSFixedString resist) - { - if(thisWeapon) { - UInt32 actorValue = ActorValueList::ResolveActorValueByName(resist.data); - thisWeapon->gameData.resist = actorValue; - } - } - - SpellItem * GetCritEffect(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->critData.critEffect : NULL; - } - - void SetCritEffect(TESObjectWEAP* thisWeapon, SpellItem * spell) - { - if(thisWeapon) { - thisWeapon->critData.critEffect = spell; - } - } - - bool GetCritEffectOnDeath(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? (thisWeapon->critData.effectOnDeath != 0) : false; - } - - void SetCritEffectOnDeath(TESObjectWEAP* thisWeapon, bool critOnDeath) - { - if(thisWeapon) { - thisWeapon->critData.effectOnDeath = (UInt8)critOnDeath; - } - } - - float GetCritMultiplier(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->critData.critMult : 0.0; - } - - void SetCritMultiplier(TESObjectWEAP* thisWeapon, float critMult) - { - if(thisWeapon) { - thisWeapon->critData.critMult = critMult; - } - } - - TESObjectWEAP* GetTemplate(TESObjectWEAP* thisWeapon) - { - return (thisWeapon) ? thisWeapon->templateForm : NULL; - } -} - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusWeapon::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetTemplate", "Weapon", papyrusWeapon::GetTemplate, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWeaponType", "Weapon", papyrusWeapon::GetWeaponType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetWeaponType", "Weapon", papyrusWeapon::SetWeaponType, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetBaseDamage", "Weapon", papyrusWeapon::GetBaseDamage, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetBaseDamage", "Weapon", papyrusWeapon::SetBaseDamage, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCritDamage", "Weapon", papyrusWeapon::GetCritDamage, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCritDamage", "Weapon", papyrusWeapon::SetCritDamage, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetReach", "Weapon", papyrusWeapon::GetReach, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetReach", "Weapon", papyrusWeapon::SetReach, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMinRange", "Weapon", papyrusWeapon::GetMinRange, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMinRange", "Weapon", papyrusWeapon::SetMinRange, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMaxRange", "Weapon", papyrusWeapon::GetMaxRange, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMaxRange", "Weapon", papyrusWeapon::SetMaxRange, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSpeed", "Weapon", papyrusWeapon::GetSpeed, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSpeed", "Weapon", papyrusWeapon::SetSpeed, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetStagger", "Weapon", papyrusWeapon::GetStagger, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetStagger", "Weapon", papyrusWeapon::SetStagger, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetModelPath", "Weapon", papyrusWeapon::GetModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetModelPath", "Weapon", papyrusWeapon::SetModelPath, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetIconPath", "Weapon", papyrusWeapon::GetIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetIconPath", "Weapon", papyrusWeapon::SetIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetMessageIconPath", "Weapon", papyrusWeapon::GetMessageIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetMessageIconPath", "Weapon", papyrusWeapon::SetMessageIconPath, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetEnchantment", "Weapon", papyrusWeapon::GetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEnchantment", "Weapon", papyrusWeapon::SetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetEnchantmentValue", "Weapon", papyrusWeapon::GetEnchantmentValue, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEnchantmentValue", "Weapon", papyrusWeapon::SetEnchantmentValue, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetEquippedModel", "Weapon", papyrusWeapon::GetEquippedModel, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEquippedModel", "Weapon", papyrusWeapon::SetEquippedModel, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetEquipType", "Weapon", papyrusWeapon::GetEquipType, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetEquipType", "Weapon", papyrusWeapon::SetEquipType, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSkill", "Weapon", papyrusWeapon::GetSkill, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetSkill", "Weapon", papyrusWeapon::SetSkill, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetResist", "Weapon", papyrusWeapon::GetResist, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetResist", "Weapon", papyrusWeapon::SetResist, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCritEffect", "Weapon", papyrusWeapon::GetCritEffect, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCritEffect", "Weapon", papyrusWeapon::SetCritEffect, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCritEffectOnDeath", "Weapon", papyrusWeapon::GetCritEffectOnDeath, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCritEffectOnDeath", "Weapon", papyrusWeapon::SetCritEffectOnDeath, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetCritMultiplier", "Weapon", papyrusWeapon::GetCritMultiplier, registry)); - - registry->RegisterFunction( - new NativeFunction1 ("SetCritMultiplier", "Weapon", papyrusWeapon::SetCritMultiplier, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusWeapon.h b/source/fs.dll/skse64/skse64/PapyrusWeapon.h deleted file mode 100644 index b60f0a55..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWeapon.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -class TESObjectWEAP; -class VMClassRegistry; -class EnchantmentItem; -class TESObjectSTAT; -class SpellItem; -class BGSEquipSlot; - -#include "GameTypes.h" - -namespace papyrusWeapon -{ - void RegisterFuncs(VMClassRegistry* registry); - - UInt32 GetBaseDamage(TESObjectWEAP* thisWeapon); - void SetBaseDamage(TESObjectWEAP* thisWeapon, UInt32 nuDamage); - UInt32 GetCritDamage(TESObjectWEAP* thisWeapon); - void SetCritDamage(TESObjectWEAP* thisWeapon, UInt32 critDamage); - float GetReach(TESObjectWEAP* thisWeapon); - void SetReach(TESObjectWEAP* thisWeapon, float nuReach); - UInt32 GetWeaponType(TESObjectWEAP* thisWeapon); - void SetWeaponType(TESObjectWEAP* thisWeapon, UInt32 nuType); - float GetSpeed(TESObjectWEAP* thisWeapon); - void SetSpeed(TESObjectWEAP* thisWeapon, float speed); - float GetStagger(TESObjectWEAP* thisWeapon); - void SetStagger(TESObjectWEAP* thisWeapon, float stagger); - float GetMinRange(TESObjectWEAP* thisWeapon); - void SetMinRange(TESObjectWEAP* thisWeapon, float minRange); - float GetMaxRange(TESObjectWEAP* thisWeapon); - void SetMaxRange(TESObjectWEAP* thisWeapon, float maxRange); - - BSFixedString GetModelPath(TESObjectWEAP* thisWeapon); - void SetModelPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath); - - BSFixedString GetIconPath(TESObjectWEAP* thisWeapon); - void SetIconPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath); - - BSFixedString GetMessageIconPath(TESObjectWEAP* thisWeapon); - void SetMessageIconPath(TESObjectWEAP* thisWeapon, BSFixedString nuPath); - - EnchantmentItem* GetEnchantment(TESObjectWEAP* thisWeapon); - void SetEnchantment(TESObjectWEAP* thisWeapon, EnchantmentItem* enchantment); - - UInt32 GetEnchantmentValue(TESObjectWEAP* thisWeapon); - void SetEnchantmentValue(TESObjectWEAP* thisWeapon, UInt32 value); - - TESObjectSTAT * GetEquippedModel(TESObjectWEAP* thisWeapon); - void SetEquippedModel(TESObjectWEAP* thisWeapon, TESObjectSTAT * model); - - BGSEquipSlot * GetEquipType(TESObjectWEAP* thisWeapon); - void SetEquipType(TESObjectWEAP* thisWeapon, BGSEquipSlot * slot); - - //BSFixedString GetSkill(TESObjectWEAP* thisWeapon); - //void SetSkill(TESObjectWEAP* thisWeapon, BSFixedString skill); - - //BSFixedString GetResist(TESObjectWEAP* thisWeapon); - //void SetResist(TESObjectWEAP* thisWeapon, BSFixedString resist); - - SpellItem * GetCritEffect(TESObjectWEAP* thisWeapon); - void SetCritEffect(TESObjectWEAP* thisWeapon, SpellItem * spell); - - bool GetCritEffectOnDeath(TESObjectWEAP* thisWeapon); - void SetCritEffectOnDeath(TESObjectWEAP* thisWeapon, bool critOnDeath); - - float GetCritMultiplier(TESObjectWEAP* thisWeapon); - void SetCritMultiplier(TESObjectWEAP* thisWeapon, float critMult); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusWeather.cpp b/source/fs.dll/skse64/skse64/PapyrusWeather.cpp deleted file mode 100644 index 099e2b57..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWeather.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "PapyrusWeather.h" - -#include "GameForms.h" - -namespace papyrusWeather -{ - float GetSunGlare(TESWeather* thisWeather) - { - return (thisWeather) ? (thisWeather->general.sunGlare / 256.0) : 0.0; - } - - float GetSunDamage(TESWeather* thisWeather) - { - return (thisWeather) ? (thisWeather->general.sunDamage / 256.0) : 0.0; - } - - float GetWindDirection(TESWeather* thisWeather) - { - return (thisWeather) ? (thisWeather->general.windDirection / (256.0 / 360.0)) : 0.0; - } - - float GetWindDirectionRange(TESWeather* thisWeather) - { - return (thisWeather) ? (thisWeather->general.windDirRange / (256.0 / 180.0)) : 0.0; - } - - float GetFogDistance(TESWeather* thisWeather, bool day, UInt32 fdType) - { - if(!thisWeather) - return 0.0; - - switch(fdType) - { - case 0: - return day ? thisWeather->fogDistance.nearDay : thisWeather->fogDistance.nearNight; - break; - case 1: - return day ? thisWeather->fogDistance.farDay : thisWeather->fogDistance.farNight; - break; - case 2: - return day ? thisWeather->fogDistance.powerDay : thisWeather->fogDistance.powerNight; - break; - case 3: - return day ? thisWeather->fogDistance.maxDay : thisWeather->fogDistance.maxNight; - break; - } - - return 0.0; - } -}; - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusWeather::RegisterFuncs(VMClassRegistry* registry) -{ - registry->RegisterFunction( - new NativeFunction0 ("GetSunGlare", "Weather", papyrusWeather::GetSunGlare, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetSunDamage", "Weather", papyrusWeather::GetSunDamage, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWindDirection", "Weather", papyrusWeather::GetWindDirection, registry)); - - registry->RegisterFunction( - new NativeFunction0 ("GetWindDirectionRange", "Weather", papyrusWeather::GetWindDirectionRange, registry)); - - registry->RegisterFunction( - new NativeFunction2 ("GetFogDistance", "Weather", papyrusWeather::GetFogDistance, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusWeather.h b/source/fs.dll/skse64/skse64/PapyrusWeather.h deleted file mode 100644 index 6b0948ba..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWeather.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -class VMClassRegistry; - -class TESWeather; - -namespace papyrusWeather -{ - float GetSunGlare(TESWeather* thisWeather); - float GetSunDamage(TESWeather* thisWeather); - float GetWindDirection(TESWeather* thisWeather); - float GetWindDirectionRange(TESWeather* thisWeather); - float GetFogDistance(TESWeather* thisWeather, bool day, UInt32 fdType); - - void RegisterFuncs(VMClassRegistry* registry); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PapyrusWornObject.cpp b/source/fs.dll/skse64/skse64/PapyrusWornObject.cpp deleted file mode 100644 index 01d4c704..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWornObject.cpp +++ /dev/null @@ -1,566 +0,0 @@ -#include "PapyrusWornObject.h" - -#include "GameForms.h" -#include "GameObjects.h" -#include "GameFormComponents.h" -#include "GameExtraData.h" -#include "GameBSExtraData.h" -#include "GameRTTI.h" -#include "GameData.h" - -class MatchByEquipSlot : public FormMatcher -{ - UInt32 m_mask; - UInt32 m_hand; - Actor * m_actor; -public: - MatchByEquipSlot(Actor * actor, UInt32 hand, UInt32 slot) : - m_hand(hand), - m_mask(slot), - m_actor(actor) - { - - } - - enum - { - kSlotID_Left = 0, - kSlotID_Right - }; - - bool Matches(TESForm* pForm) const { - if (pForm) { - if(pForm->formType != TESObjectWEAP::kTypeID) { // If not a weapon use mask - BGSBipedObjectForm* pBip = DYNAMIC_CAST(pForm, TESForm, BGSBipedObjectForm); - if (pBip) - return (pBip->data.parts & m_mask) != 0; - } else if(m_mask == 0) { // Use hand if no mask specified - TESForm * equippedForm = m_actor->GetEquippedObject(m_hand == kSlotID_Left); - return (equippedForm && equippedForm == pForm); - } - } - return false; - } -}; - -namespace referenceUtils -{ - - bool HasItemAbility(Actor * actor, TESForm* baseForm, BaseExtraList * extraData) - { - if(actor && baseForm) { - tList * effects = actor->magicTarget.GetActiveEffects(); - for(UInt32 i = 0; i < effects->Count(); i++) { - ActiveEffect* effect = effects->GetNthItem(i); - if(effect->sourceItem == baseForm) { // Check the item - EnchantmentItem * enchantment = NULL; - TESEnchantableForm * enchantable = DYNAMIC_CAST(baseForm, TESForm, TESEnchantableForm); - if(enchantable) { // Check the item for a base enchantment - enchantment = enchantable->enchantment; - } - if(extraData) { // Check the extra data for enchantment - ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment)); - if(extraEnchant) { - enchantment = extraEnchant->enchant; - } - } - - if(effect->item == enchantment) { - return true; - } - } - } - } - - return false; - } - - void UpdateItemAbility(Actor * actor, TESForm* baseForm, BaseExtraList * extraData, bool bLeftHand) - { - if(actor && baseForm) { - if(baseForm->formType == TESObjectWEAP::kTypeID) - CALL_MEMBER_FN(actor, UpdateWeaponAbility)(baseForm, extraData, bLeftHand); - else if(baseForm->formType == TESObjectARMO::kTypeID) - CALL_MEMBER_FN(actor, UpdateArmorAbility)(baseForm, extraData); - } - } - - float GetItemHealthPercent(TESForm * baseForm, BaseExtraList* extraData) - { - // Object must be a weapon, or armor - if(baseForm) { - if(baseForm->formType == TESObjectWEAP::kTypeID || baseForm->formType == TESObjectARMO::kTypeID) { - ExtraHealth* xHealth = static_cast(extraData->GetByType(kExtraData_Health)); - if(xHealth) { - return xHealth->health; - } - } - } - - return 1.0; - } - - void SetItemHealthPercent(TESForm * baseForm, BaseExtraList* extraData, float value) - { - // Object must be a weapon, or armor - if(baseForm) { - if(baseForm->formType == TESObjectWEAP::kTypeID || baseForm->formType == TESObjectARMO::kTypeID) { - ExtraHealth* xHealth = static_cast(extraData->GetByType(kExtraData_Health)); - if(xHealth) { - xHealth->health = value; - } else { - ExtraHealth* newHealth = ExtraHealth::Create(); - newHealth->health = value; - extraData->Add(kExtraData_Health, newHealth); - } - } - } - } - - float GetItemMaxCharge(TESForm * baseForm, BaseExtraList* extraData) - { - if (!baseForm) - return 0.0; - TESObjectWEAP * weapon = DYNAMIC_CAST(baseForm, TESForm, TESObjectWEAP); - if(!weapon) // Object is not a weapon - return 0.0; - float maxCharge = 0; - if(weapon->enchantable.enchantment != NULL) // Base enchant - maxCharge = (float)weapon->enchantable.maxCharge; - else if(ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment))) // Enchanted - maxCharge = (float)extraEnchant->maxCharge; - return maxCharge; - } - - void SetItemMaxCharge(TESForm * baseForm, BaseExtraList* extraData, float maxCharge) - { - if (baseForm) { - TESObjectWEAP * weapon = DYNAMIC_CAST(baseForm, TESForm, TESObjectWEAP); - if(weapon) { - if(maxCharge > USHRT_MAX) - maxCharge = USHRT_MAX; - - if(ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment))) // Enchanted - extraEnchant->maxCharge = (UInt16)maxCharge; - } - } - } - - float GetItemCharge(TESForm * baseForm, BaseExtraList* extraData) - { - if (!baseForm) - return 0.0; - - if(baseForm->formType != TESObjectWEAP::kTypeID) // Object is not a weapon - return 0.0; - - ExtraCharge* xCharge = static_cast(extraData->GetByType(kExtraData_Charge)); - return (xCharge) ? xCharge->charge : GetItemMaxCharge(baseForm, extraData); // When charge value is not present on an enchanted weapon, maximum charge is assumed - } - - void SetItemCharge(TESForm * baseForm, BaseExtraList* extraData, float value) - { - // Object must be an enchanted weapon - if(baseForm) { - TESObjectWEAP * weapon = DYNAMIC_CAST(baseForm, TESForm, TESObjectWEAP); - if(weapon && ((extraData->GetByType(kExtraData_Enchantment) || weapon->enchantable.enchantment != NULL))) { - ExtraCharge* xCharge = static_cast(extraData->GetByType(kExtraData_Charge)); - if(xCharge) { - xCharge->charge = value; - } else { - ExtraCharge* newCharge = ExtraCharge::Create(); - newCharge->charge = value; - extraData->Add(kExtraData_Charge, newCharge); - } - } - } - } - - BSFixedString GetDisplayName(TESForm * baseForm, BaseExtraList* extraData) - { - const char * displayName = NULL; - if(baseForm) { - displayName = extraData->GetDisplayName(baseForm); - if(!displayName) { - TESFullName* pFullName = DYNAMIC_CAST(baseForm, TESForm, TESFullName); - if (pFullName) - displayName = pFullName->name.data; - } - } - - return displayName; - } - - bool SetDisplayName(BaseExtraList* extraData, BSFixedString value, bool force) - { - bool renamed = false; - ExtraTextDisplayData* xTextData = static_cast(extraData->GetByType(kExtraData_TextDisplayData)); - if(xTextData) { - bool inUse = xTextData->message || xTextData->owner; - if(inUse && force) { - xTextData->message = NULL; - xTextData->owner = NULL; - } - renamed = (inUse == false || force); - CALL_MEMBER_FN(xTextData, SetName_Internal)(value.data); - } else { - ExtraTextDisplayData* newTextData = ExtraTextDisplayData::Create(); - CALL_MEMBER_FN(newTextData, SetName_Internal)(value.data); - extraData->Add(kExtraData_TextDisplayData, newTextData); - renamed = true; - } - - return renamed; - } - - EnchantmentItem * GetEnchantment(BaseExtraList * extraData) - { - ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment)); - return extraEnchant ? extraEnchant->enchant : NULL; - } - - void CreateEnchantment(TESForm* baseForm, BaseExtraList * extraData, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations) - { - if(baseForm && (baseForm->formType == TESObjectWEAP::kTypeID || baseForm->formType == TESObjectARMO::kTypeID)) { - EnchantmentItem * enchantment = NULL; - if(effects.Length() > 0 && magnitudes.Length() == effects.Length() && areas.Length() == effects.Length() && durations.Length() == effects.Length()) { - tArray effectItems; - effectItems.Allocate(effects.Length()); - - UInt32 j = 0; - for(UInt32 i = 0; i < effects.Length(); i++) { - EffectSetting * magicEffect = NULL; - effects.Get(&magicEffect, i); - if(magicEffect) { // Only add effects that actually exist - magnitudes.Get(&effectItems[j].magnitude, i); - areas.Get(&effectItems[j].area, i); - durations.Get(&effectItems[j].duration, i); - effectItems[j].mgef = magicEffect; - j++; - } - } - effectItems.count = j; // Set count to existing count - - if(baseForm->formType == TESObjectWEAP::kTypeID) - enchantment = CALL_MEMBER_FN(PersistentFormManager::GetSingleton(), CreateOffensiveEnchantment)(&effectItems); - else - enchantment = CALL_MEMBER_FN(PersistentFormManager::GetSingleton(), CreateDefensiveEnchantment)(&effectItems); - - Heap_Free(effectItems.entries); - } - - if(enchantment) { - if(maxCharge > 0xFFFF) // Charge exceeds uint16 clip it - maxCharge = 0xFFFF; - - ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment)); - if(extraEnchant) { - PersistentFormManager::GetSingleton()->DecRefEnchantment(extraEnchant->enchant); - extraEnchant->enchant = enchantment; - PersistentFormManager::GetSingleton()->IncRefEnchantment(extraEnchant->enchant); - - extraEnchant->maxCharge = (UInt16)maxCharge; - } else { - ExtraEnchantment* extraEnchant = ExtraEnchantment::Create(); - extraEnchant->enchant = enchantment; - extraEnchant->maxCharge = (UInt16)maxCharge; - extraData->Add(kExtraData_Enchantment, extraEnchant); - } - } - } - } - - void SetEnchantment(TESForm* baseForm, BaseExtraList * extraData, EnchantmentItem * enchantment, float maxCharge) - { - if(baseForm && (baseForm->formType == TESObjectWEAP::kTypeID || baseForm->formType == TESObjectARMO::kTypeID)) { - if(!enchantment) { // Null form, remove enchantment and it's extraData - ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment)); - if(extraEnchant) - extraData->Remove(kExtraData_Enchantment, extraEnchant); - - PersistentFormManager::GetSingleton()->DecRefEnchantment(extraEnchant->enchant); - Heap_Free(extraEnchant); - } else { // Non-null form, accept Enchantment - if(maxCharge > 0xFFFF) // Charge exceeds uint16 clip it - maxCharge = 0xFFFF; - - ExtraEnchantment* extraEnchant = static_cast(extraData->GetByType(kExtraData_Enchantment)); - if(extraEnchant) { - PersistentFormManager::GetSingleton()->DecRefEnchantment(extraEnchant->enchant); - extraEnchant->enchant = enchantment; - PersistentFormManager::GetSingleton()->IncRefEnchantment(extraEnchant->enchant); - - extraEnchant->maxCharge = (UInt16)maxCharge; - } else { - ExtraEnchantment* extraEnchant = ExtraEnchantment::Create(); - extraEnchant->enchant = enchantment; - extraEnchant->maxCharge = (UInt16)maxCharge; - extraData->Add(kExtraData_Enchantment, extraEnchant); - } - } - } - } - - AlchemyItem * GetPoison(BaseExtraList * extraData) - { - ExtraPoison* extraPoison = static_cast(extraData->GetByType(kExtraData_Poison)); - return extraPoison ? extraPoison->poison : NULL; - } - - UInt32 GetNumReferenceAliases(BaseExtraList * extraData) - { - ExtraAliasInstanceArray* xAliases = static_cast(extraData->GetByType(kExtraData_AliasInstanceArray)); - if(!xAliases) - return NULL; - - return xAliases->aliases.count; - } - - VMResultArray GetReferenceAliases(BaseExtraList* extraData) - { - VMResultArray result; - ExtraAliasInstanceArray* xAliases = static_cast(extraData->GetByType(kExtraData_AliasInstanceArray)); - if(!xAliases) - return result; - - ExtraAliasInstanceArray::AliasInfo * info = NULL; - for(UInt32 n = 0; n < xAliases->aliases.count; n++) - { - BGSRefAlias * alias = NULL; - if(xAliases->aliases.GetNthItem(n, info)) - alias = DYNAMIC_CAST(info->alias, BGSBaseAlias, BGSRefAlias); - - result.push_back(alias); - } - - return result; - } - - BGSRefAlias * GetNthReferenceAlias(BaseExtraList * extraData, UInt32 n) - { - ExtraAliasInstanceArray* xAliases = static_cast(extraData->GetByType(kExtraData_AliasInstanceArray)); - if(!xAliases) - return NULL; - - ExtraAliasInstanceArray::AliasInfo * info = NULL; - xAliases->aliases.GetNthItem(n, info); - if(!info) - return NULL; - - return (BGSRefAlias*)info->alias; - } - - EquipData ResolveEquippedObject(Actor * actor, UInt32 weaponSlot, UInt32 slotMask) - { - EquipData foundData; - foundData.pForm = NULL; - foundData.pExtraData = NULL; - if(!actor) - return foundData; - - MatchByEquipSlot matcher(actor, weaponSlot, slotMask); - ExtraContainerChanges* pContainerChanges = static_cast(actor->extraData.GetByType(kExtraData_ContainerChanges)); - if (pContainerChanges) { - foundData = pContainerChanges->FindEquipped(matcher, weaponSlot == MatchByEquipSlot::kSlotID_Right || slotMask != 0, weaponSlot == MatchByEquipSlot::kSlotID_Left); - return foundData; - } - - return foundData; - } -}; - -namespace papyrusWornObject -{ - float GetItemHealthPercent(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetItemHealthPercent(equipData.pForm, equipData.pExtraData); - } - - return 1.0; - } - - void SetItemHealthPercent(WORNOBJECT_PARAMS, float value) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - referenceUtils::SetItemHealthPercent(equipData.pForm, equipData.pExtraData, value); - } - } - float GetItemMaxCharge(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetItemMaxCharge(equipData.pForm, equipData.pExtraData); - } - - return 0.0; - } - - void SetItemMaxCharge(WORNOBJECT_PARAMS, float maxCharge) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - referenceUtils::SetItemMaxCharge(equipData.pForm, equipData.pExtraData, maxCharge); - } - } - - float GetItemCharge(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetItemCharge(equipData.pForm, equipData.pExtraData); - } - - return 0.0; - } - /*void SetItemCharge(WORNOBJECT_PARAMS, float value) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - referenceUtils::SetItemCharge(equipData.pForm, equipData.pExtraData, value); - } - }*/ - - BSFixedString GetDisplayName(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetDisplayName(equipData.pForm, equipData.pExtraData); - } - - return ""; - } - bool SetDisplayName(WORNOBJECT_PARAMS, BSFixedString value, bool force) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::SetDisplayName(equipData.pExtraData, value, force); - } - - return false; - } - - EnchantmentItem * GetEnchantment(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetEnchantment(equipData.pExtraData); - } - - return NULL; - } - - void CreateEnchantment(WORNOBJECT_PARAMS, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - referenceUtils::CreateEnchantment(equipData.pForm, equipData.pExtraData, maxCharge, effects, magnitudes, areas, durations); - if(actor) - referenceUtils::UpdateItemAbility(actor, equipData.pForm, equipData.pExtraData, weaponSlot == MatchByEquipSlot::kSlotID_Left); - } - } - - void SetEnchantment(WORNOBJECT_PARAMS, EnchantmentItem * enchantment, float maxCharge) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - referenceUtils::SetEnchantment(equipData.pForm, equipData.pExtraData, enchantment, maxCharge); - if(actor) - referenceUtils::UpdateItemAbility(actor, equipData.pForm, equipData.pExtraData, weaponSlot == MatchByEquipSlot::kSlotID_Left); - } - } - - AlchemyItem * GetPoison(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetPoison(equipData.pExtraData); - } - - return NULL; - } - - UInt32 GetNumReferenceAliases(WORNOBJECT_PARAMS) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetNumReferenceAliases(equipData.pExtraData); - } - - return 0; - } - BGSRefAlias * GetNthReferenceAlias(WORNOBJECT_PARAMS, UInt32 n) - { - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - return referenceUtils::GetNthReferenceAlias(equipData.pExtraData, n); - } - - return NULL; - } - - VMResultArray GetReferenceAliases(WORNOBJECT_PARAMS) - { - VMResultArray result; - EquipData equipData = referenceUtils::ResolveEquippedObject(actor, weaponSlot, slotMask); - if(equipData.pForm && equipData.pExtraData) { - result = referenceUtils::GetReferenceAliases(equipData.pExtraData); - } - - return result; - } -}; - -#include "PapyrusVM.h" -#include "PapyrusNativeFunctions.h" - -void papyrusWornObject::RegisterFuncs(VMClassRegistry* registry) -{ - // Item modifications, Tempering/Charges - registry->RegisterFunction( - new NativeFunction3("GetItemHealthPercent", "WornObject", papyrusWornObject::GetItemHealthPercent, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetItemHealthPercent", "WornObject", papyrusWornObject::SetItemHealthPercent, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetItemMaxCharge", "WornObject", papyrusWornObject::GetItemMaxCharge, registry)); - - registry->RegisterFunction( - new NativeFunction4("SetItemMaxCharge", "WornObject", papyrusWornObject::SetItemMaxCharge, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetItemCharge", "WornObject", papyrusWornObject::GetItemCharge, registry)); - - /*registry->RegisterFunction( - new NativeFunction4("SetItemCharge", "WornObject", papyrusWornObject::SetItemCharge, registry));*/ - - registry->RegisterFunction( - new NativeFunction3("GetEnchantment", "WornObject", papyrusWornObject::GetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction5("SetEnchantment", "WornObject", papyrusWornObject::SetEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction8, VMArray, VMArray, VMArray>("CreateEnchantment", "WornObject", papyrusWornObject::CreateEnchantment, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetPoison", "WornObject", papyrusWornObject::GetPoison, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetDisplayName", "WornObject", papyrusWornObject::GetDisplayName, registry)); - - registry->RegisterFunction( - new NativeFunction5("SetDisplayName", "WornObject", papyrusWornObject::SetDisplayName, registry)); - - registry->RegisterFunction( - new NativeFunction3("GetNumReferenceAliases", "WornObject", papyrusWornObject::GetNumReferenceAliases, registry)); - - registry->RegisterFunction( - new NativeFunction4("GetNthReferenceAlias", "WornObject", papyrusWornObject::GetNthReferenceAlias, registry)); - - registry->RegisterFunction( - new NativeFunction3, WORNOBJECT_TEMPLATE>("GetReferenceAliases", "WornObject", papyrusWornObject::GetReferenceAliases, registry)); -} diff --git a/source/fs.dll/skse64/skse64/PapyrusWornObject.h b/source/fs.dll/skse64/skse64/PapyrusWornObject.h deleted file mode 100644 index 6ad3bb88..00000000 --- a/source/fs.dll/skse64/skse64/PapyrusWornObject.h +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once - -class VMClassRegistry; -class TESForm; -class BaseExtraList; -class TESObjectREFR; -class BGSRefAlias; -class EnchantmentItem; -class AlchemyItem; -class Actor; -class EffectSetting; - -#include "GameExtraData.h" - -#include "PapyrusArgs.h" -#include "GameTypes.h" - -namespace referenceUtils -{ - EquipData ResolveEquippedObject(Actor * actor, UInt32 weaponSlot, UInt32 slotMask); - - float GetItemHealthPercent(TESForm * baseForm, BaseExtraList* extraData); - void SetItemHealthPercent(TESForm * baseForm, BaseExtraList* extraData, float value); - - float GetItemMaxCharge(TESForm * baseForm, BaseExtraList* extraData); - void SetItemMaxCharge(TESForm * baseForm, BaseExtraList* extraData, float maxCharge); - - float GetItemCharge(TESForm * baseForm, BaseExtraList* extraData); - void SetItemCharge(TESForm * baseForm, BaseExtraList* extraData, float value); - - BSFixedString GetDisplayName(TESForm * baseForm, BaseExtraList* extraData); - bool SetDisplayName(BaseExtraList* extraData, BSFixedString value, bool force); - - EnchantmentItem * GetEnchantment(BaseExtraList * extraData); - void CreateEnchantment(TESForm* baseForm, BaseExtraList * extraData, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations); - void SetEnchantment(TESForm* baseForm, BaseExtraList * extraData, EnchantmentItem * enchantment, float maxCharge); - - AlchemyItem * GetPoison(BaseExtraList * extraData); - - UInt32 GetNumReferenceAliases(BaseExtraList * extraData); - BGSRefAlias * GetNthReferenceAlias(BaseExtraList * extraData, UInt32 n); - - VMResultArray GetReferenceAliases(BaseExtraList* extraData); - - bool HasItemAbility(Actor * actor, TESForm* baseForm, BaseExtraList * extraData); - void UpdateItemAbility(Actor * actor, TESForm* baseForm, BaseExtraList * extraData, bool bLeftHand); -}; - -#define WORNOBJECT_PARAMS StaticFunctionTag*, Actor * actor, UInt32 weaponSlot, UInt32 slotMask -#define WORNOBJECT_TEMPLATE Actor*, UInt32, UInt32 - -namespace papyrusWornObject -{ - void RegisterFuncs(VMClassRegistry* registry); - - float GetItemHealthPercent(WORNOBJECT_PARAMS); - void SetItemHealthPercent(WORNOBJECT_PARAMS, float value); - float GetItemMaxCharge(WORNOBJECT_PARAMS); - void SetItemMaxCharge(WORNOBJECT_PARAMS, float maxCharge); - float GetItemCharge(WORNOBJECT_PARAMS); - - BSFixedString GetDisplayName(WORNOBJECT_PARAMS); - bool SetDisplayName(WORNOBJECT_PARAMS, BSFixedString value, bool force); - EnchantmentItem * GetEnchantment(WORNOBJECT_PARAMS); - void CreateEnchantment(WORNOBJECT_PARAMS, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations); - void SetEnchantment(WORNOBJECT_PARAMS, EnchantmentItem * enchantment, float maxCharge); - UInt32 GetNumReferenceAliases(WORNOBJECT_PARAMS); - BGSRefAlias * GetNthReferenceAlias(WORNOBJECT_PARAMS, UInt32 n); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/PluginAPI.h b/source/fs.dll/skse64/skse64/PluginAPI.h deleted file mode 100644 index 7f4058b3..00000000 --- a/source/fs.dll/skse64/skse64/PluginAPI.h +++ /dev/null @@ -1,349 +0,0 @@ -#pragma once - -typedef UInt32 PluginHandle; // treat this as an opaque type -class GFxMovieView; -class GFxValue; -class TaskDelegate; -class UIDelegate_v1; -class InventoryEntryData; -class SKSEDelayFunctorManager; -class SKSEObjectRegistry; -class SKSEPersistentObjectStorage; -class BranchTrampoline; - -struct PluginInfo -{ - enum - { - kInfoVersion = 1 - }; - - UInt32 infoVersion; - const char * name; - UInt32 version; -}; - -enum -{ - kPluginHandle_Invalid = 0xFFFFFFFF -}; - -enum -{ - kInterface_Invalid = 0, - kInterface_Scaleform, - kInterface_Papyrus, - kInterface_Serialization, - kInterface_Task, - kInterface_Messaging, - kInterface_Object, - kInterface_Trampoline, - kInterface_Max, -}; - -struct SKSEInterface -{ - UInt32 skseVersion; - UInt32 runtimeVersion; - UInt32 editorVersion; - UInt32 isEditor; - void * (* QueryInterface)(UInt32 id); - - // call during your Query or Load functions to get a PluginHandle uniquely identifying your plugin - // invalid if called at any other time, so call it once and save the result - PluginHandle (* GetPluginHandle)(void); - - // returns the SKSE build's release index - UInt32 (* GetReleaseIndex)(void); - - // Minimum SKSE version 2.0.18 - // returns the plugin info structure for a plugin by name, only valid to be called after PostLoad message - const PluginInfo* (* GetPluginInfo)(const char* name); -}; - -struct SKSEScaleformInterface -{ - enum - { - kInterfaceVersion = 2 - }; - - UInt32 interfaceVersion; - - // This callback will be called once for every new menu that is created. - // Create your objects relative to the 'root' GFxValue parameter. - typedef bool (* RegisterCallback)(GFxMovieView * view, GFxValue * root); - typedef void (* RegisterInventoryCallback)(GFxMovieView * view, GFxValue * object, InventoryEntryData * item); - - // Register your plugin's scaleform API creation callback here. - // The "name" parameter will be used to create an object with the path: - // "skse.plugins.name" that will be passed to the callback. - // Make sure that the memory it points to is valid from the point the callback - // is registered until the game exits. - bool (* Register)(const char * name, RegisterCallback callback); - - // Registers your plugin for when item data is extended to the UI - // either favorites menu, or inventory menu - void (* RegisterForInventory)(RegisterInventoryCallback callback); -}; - -struct SKSESerializationInterface -{ - enum - { - kVersion = 4, - }; - - typedef void (* EventCallback)(SKSESerializationInterface * intfc); - - typedef void (* FormDeleteCallback)(UInt64 handle); - - UInt32 version; - - void (* SetUniqueID)(PluginHandle plugin, UInt32 uid); - - void (* SetRevertCallback)(PluginHandle plugin, EventCallback callback); - void (* SetSaveCallback)(PluginHandle plugin, EventCallback callback); - void (* SetLoadCallback)(PluginHandle plugin, EventCallback callback); - void (* SetFormDeleteCallback)(PluginHandle plugin, FormDeleteCallback callback); - - bool (* WriteRecord)(UInt32 type, UInt32 version, const void * buf, UInt32 length); - bool (* OpenRecord)(UInt32 type, UInt32 version); - bool (* WriteRecordData)(const void * buf, UInt32 length); - - bool (* GetNextRecordInfo)(UInt32 * type, UInt32 * version, UInt32 * length); - UInt32 (* ReadRecordData)(void * buf, UInt32 length); - bool (* ResolveHandle)(UInt64 handle, UInt64 * handleOut); - bool (* ResolveFormId)(UInt32 formId, UInt32 * formIdOut); -}; - -struct SKSETaskInterface -{ - enum - { - kInterfaceVersion = 2 - }; - - UInt32 interfaceVersion; - - // Derive your type from TaskDelegate or UIDelegate - // Allocate before adding - // Define your Run function - // Delete your object in the Dispose call - void (* AddTask)(TaskDelegate * task); - void (* AddUITask)(UIDelegate_v1 * task); -}; - -class VMClassRegistry; - -struct SKSEPapyrusInterface -{ - enum - { - kInterfaceVersion = 1 - }; - UInt32 interfaceVersion; - typedef bool (* RegisterFunctions)(VMClassRegistry * registry); - bool (* Register)(RegisterFunctions callback); -}; - -/**** Messaging API docs ******************************************************************** - * - * Messaging API allows inter-plugin communication at run-time. A plugin may register - * one callback for each plugin from which it wishes to receive messages, specifying - * the sender by name in the call to RegisterListener(). RegisterListener returns false - * if the specified plugin is not loaded, true otherwise. Any messages dispatched by - * the specified plugin will then be forwarded to the listener as they occur. Passing NULL as - * the sender registers the calling plugin as a listener to every loaded plugin. - * - * Messages may be dispatched via Dispatch() to either a specific listener (specified - * by name) or to all listeners (with NULL passed as the receiver). The contents and format of - * messageData are left up to the sender, and the receiver is responsible for casting the message - * to the expected type. If no plugins are registered as listeners for the sender, - * Dispatch() returns false, otherwise it returns true. - * - * Calling RegisterListener() or Dispatch() during plugin load is not advised as the requested plugin - * may not yet be loaded at that point. Instead, if you wish to register as a listener or dispatch a - * message immediately after plugin load, use RegisterListener() during load to register to receive - * messages from SKSE (sender name: "SKSE"). You will then receive a message from SKSE once - * all plugins have been loaded, at which point it is safe to establish communications between - * plugins. - * - * Some plugin authors may wish to use strings instead of integers to denote message type. In - * that case the receiver can pass the address of the string as an integer and require the receiver - * to cast it back to a char* on receipt. - * - *********************************************************************************************/ - -struct SKSEMessagingInterface -{ - struct Message { - const char * sender; - UInt32 type; - UInt32 dataLen; - void * data; - }; - - typedef void (* EventCallback)(Message* msg); - - enum { - kInterfaceVersion = 2 - }; - - // SKSE messages - enum { - kMessage_PostLoad, // sent to registered plugins once all plugins have been loaded (no data) - kMessage_PostPostLoad, // sent right after kMessage_PostLoad to facilitate the correct dispatching/registering of messages/listeners - kMessage_PreLoadGame, // dispatched immediately before savegame is read by Fallout - // dataLen: length of file path, data: char* file path of .ess savegame file - kMessage_PostLoadGame, //dispatched after an attempt to load a saved game has finished (the game's LoadGame() routine - //has returned). You will probably want to handle this event if your plugin uses a Preload callback - //as there is a chance that after that callback is invoked the game will encounter an error - //while loading the saved game (eg. corrupted save) which may require you to reset some of your - //plugin state. - //data: bool, true if game successfully loaded, false otherwise - // plugins may register as listeners during the first callback while deferring dispatches until the next - kMessage_SaveGame, - kMessage_DeleteGame, // sent right before deleting the .skse cosave and the .ess save. - // dataLen: length of file path, data: char* file path of .ess savegame file - kMessage_InputLoaded, // sent right after game input is loaded, right before the main menu initializes - kMessage_NewGame, // sent after a new game is created, before the game has loaded (Sends CharGen TESQuest pointer) - kMessage_DataLoaded // send after the data handler has loaded all its forms - }; - - UInt32 interfaceVersion; - bool (* RegisterListener)(PluginHandle listener, const char* sender, EventCallback handler); - bool (* Dispatch)(PluginHandle sender, UInt32 messageType, void * data, UInt32 dataLen, const char* receiver); - - enum - { - kDispatcher_ModEvent = 0, - kDispatcher_CameraEvent, - kDispatcher_CrosshairEvent, - kDispatcher_ActionEvent, - kDispatcher_NiNodeUpdateEvent - }; - - // Use this to acquire SKSE's internal EventDispatchers so that you can sink to them - void * (* GetEventDispatcher)(UInt32 dispatcherId); -}; - -struct SKSEObjectInterface -{ - enum - { - kInterfaceVersion = 1 - }; - - UInt32 interfaceVersion; - - SKSEDelayFunctorManager & (* GetDelayFunctorManager)(); - SKSEObjectRegistry & (* GetObjectRegistry)(); - SKSEPersistentObjectStorage & (* GetPersistentObjectStorage)(); -}; - -struct SKSETrampolineInterface -{ - enum - { - kInterfaceVersion = 1 - }; - - UInt32 interfaceVersion; - - void* (*AllocateFromBranchPool)(PluginHandle plugin, size_t size); - void* (*AllocateFromLocalPool)(PluginHandle plugin, size_t size); -}; - -typedef bool(*_SKSEPlugin_Load)(const SKSEInterface * skse); - -/**** plugin versioning ******************************************************** - * - * The AE version of Skyrim SE broke plugin versioning as many were written - * with the assumption that the Address Library would always be valid. - * These always report that they are compatible, then exit on startup because - * they cannot find their address library file. - * - * To work around this problem, version checking has been reimplemented and - * no longer calls any code. Plugins declare their compatibility, and SKSE - * determines whether to load the plugin. Setting this up is simple, just - * add something like this to your project: - * - -extern "C" { -__declspec(dllexport) SKSEPluginVersionData SKSEPlugin_Version = -{ - SKSEPluginVersionData::kVersion, - - 1, - "my awesome plugin", - - "my name", - "support@example.com", - - 0, // not version independent - { RUNTIME_VERSION_1_6_318, 0 }, // compatible with 1.6.318 - - 0, // works with any version of the script extender. you probably do not need to put anything here -}; -}; - - * - ******************************************************************************/ - -struct SKSEPluginVersionData -{ - enum - { - kVersion = 1, - }; - - enum - { - // set this if you are using a (potential at this time of writing) post-AE version of the Address Library - kVersionIndependent_AddressLibraryPostAE = 1 << 0, - // set this if you exclusively use signature matching to find your addresses and have NO HARDCODED ADDRESSES - kVersionIndependent_Signatures = 1 << 1, - }; - - UInt32 dataVersion; // set to kVersion - - UInt32 pluginVersion; // version number of your plugin - char name[256]; // null-terminated ASCII plugin name - - char author[256]; // null-terminated ASCII plugin author name (can be empty) - char supportEmail[256]; // null-terminated ASCII support email address (can be empty) - // this is not for showing to users, it's in case I need to contact you about - // a compatibility problem with your plugin - - // version compatibility - UInt32 versionIndependence; // set to one of the kVersionIndependent_ enums or zero - UInt32 compatibleVersions[16]; // zero-terminated list of RUNTIME_VERSION_ defines your plugin is compatible with - - UInt32 seVersionRequired; // minimum version of the script extender required, compared against PACKED_SKSE_VERSION - // you probably should just set this to 0 unless you know what you are doing -}; - -/**** plugin API docs ********************************************************** - * - * The base API is pretty simple. Add version data as shown in the - * SKSEPluginVersionData docs above, and export this function: - * - * bool SKSEPlugin_Load(const SKSEInterface * skse) - * - * In this function, use the interfaces above to register your commands, patch - * memory, generally do whatever you need to for integration with the runtime. - * - * At this time, or at any point forward you can call the QueryInterface - * callback to retrieve an interface structure for the base services provided - * by the SKSE core. - * - * You may optionally return false from this function to unload your plugin, - * but make sure that you DO NOT register any commands if you do. - * - * Note that all structure versions are backwards-compatible, so you only need - * to check against the latest version that you need. New fields will be only - * added to the end, and all old fields will remain compatible with their - * previous implementations. - * - ******************************************************************************/ diff --git a/source/fs.dll/skse64/skse64/PluginLoadErrorDialog.rc b/source/fs.dll/skse64/skse64/PluginLoadErrorDialog.rc deleted file mode 100644 index 2f4352b0..00000000 --- a/source/fs.dll/skse64/skse64/PluginLoadErrorDialog.rc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:561f840f1f55a4556a0d53ebeddfea78014d16f68973b164918b19b7ea61b096 -size 702 diff --git a/source/fs.dll/skse64/skse64/PluginManager.cpp b/source/fs.dll/skse64/skse64/PluginManager.cpp deleted file mode 100644 index b5aca125..00000000 --- a/source/fs.dll/skse64/skse64/PluginManager.cpp +++ /dev/null @@ -1,968 +0,0 @@ -#include "skse64/PluginManager.h" -#include "common/IDirectoryIterator.h" -#include "common/IFileStream.h" -#include "skse64/GameAPI.h" -#include "skse64_common/Utilities.h" -#include "skse64/Serialization.h" -#include "skse64_common/skse_version.h" -#include "skse64/PapyrusEvents.h" -#include "skse64_common/BranchTrampoline.h" -#include "resource.h" - -PluginManager g_pluginManager; - -PluginManager::LoadedPlugin * PluginManager::s_currentLoadingPlugin = NULL; -PluginHandle PluginManager::s_currentPluginHandle = 0; -UInt32 s_trampolineLog = 1; - -extern EventDispatcher g_modCallbackEventDispatcher; -extern EventDispatcher g_cameraEventDispatcher; -extern EventDispatcher g_crosshairRefEventDispatcher; -extern EventDispatcher g_actionEventDispatcher; - -BranchTrampolineManager g_branchTrampolineManager(g_branchTrampoline); -BranchTrampolineManager g_localTrampolineManager(g_localTrampoline); - -static const SKSEInterface g_SKSEInterface = -{ - PACKED_SKSE_VERSION, - -#ifdef RUNTIME - RUNTIME_VERSION, - 0, - 0, -#else - 0, - EDITOR_VERSION, - 1, -#endif - - PluginManager::QueryInterface, - PluginManager::GetPluginHandle, - PluginManager::GetReleaseIndex, - PluginManager::GetPluginInfo -}; - -#ifdef RUNTIME - -#include "Hooks_Scaleform.h" - -static const SKSEScaleformInterface g_SKSEScaleformInterface = -{ - SKSEScaleformInterface::kInterfaceVersion, - - RegisterScaleformPlugin, - RegisterScaleformInventory -}; - -#include "Hooks_Threads.h" - -static const SKSETaskInterface g_SKSETaskInterface = -{ - SKSETaskInterface::kInterfaceVersion, - - TaskInterface::AddTask, - TaskInterface::AddUITask -}; - -#include "skse64/Hooks_Papyrus.h" -#include "skse64/PapyrusVM.h" - -static const SKSEPapyrusInterface g_SKSEPapyrusInterface = -{ - SKSEPapyrusInterface::kInterfaceVersion, - RegisterPapyrusPlugin -}; - -static SKSEMessagingInterface g_SKSEMessagingInterface = -{ - SKSEMessagingInterface::kInterfaceVersion, - PluginManager::RegisterListener, - PluginManager::Dispatch_Message, - PluginManager::GetEventDispatcher, -}; - -#include "skse64/PapyrusDelayFunctors.h" -#include "skse64/PapyrusObjects.h" - -static const SKSEObjectInterface g_SKSEObjectInterface = -{ - SKSEObjectInterface::kInterfaceVersion, - SKSEDelayFunctorManagerInstance, - SKSEObjectRegistryInstance, - SKSEObjectStorageInstance -}; - -static const SKSETrampolineInterface g_SKSETrampolineInterface = -{ - SKSETrampolineInterface::kInterfaceVersion, - AllocateFromSKSEBranchPool, - AllocateFromSKSELocalPool -}; -#endif - -PluginManager::PluginManager() -{ - // -} - -PluginManager::~PluginManager() -{ - DeInit(); -} - -PluginManager::LoadedPlugin::LoadedPlugin() - :handle(0) - ,load(nullptr) -{ - memset(&info, 0, sizeof(info)); - memset(&version, 0, sizeof(version)); -} - -bool PluginManager::Init(void) -{ - bool result = false; - - if(FindPluginDirectory()) - { - _MESSAGE("plugin directory = %s", m_pluginDirectory.c_str()); - - // avoid realloc - m_plugins.reserve(5); - - __try - { - ScanPlugins(); - InstallPlugins(); - - result = true; - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - // something very bad happened - _ERROR("exception occurred while loading plugins"); - } - } - - ReportPluginErrors(); - - return result; -} - -void PluginManager::DeInit(void) -{ - for(LoadedPluginList::iterator iter = m_plugins.begin(); iter != m_plugins.end(); ++iter) - { - LoadedPlugin * plugin = &(*iter); - - if(plugin->handle) - { - FreeLibrary(plugin->handle); - } - } - - m_plugins.clear(); -} - -UInt32 PluginManager::GetNumPlugins(void) -{ - UInt32 numPlugins = m_plugins.size(); - - // is one currently loading? - if(s_currentLoadingPlugin) numPlugins++; - - return numPlugins; -} - -PluginInfo * PluginManager::GetInfoByName(const char * name) -{ - for(LoadedPluginList::iterator iter = m_plugins.begin(); iter != m_plugins.end(); ++iter) - { - LoadedPlugin * plugin = &(*iter); - - if(plugin->info.name && !_stricmp(name, plugin->info.name)) - return &plugin->info; - } - - return NULL; -} - -void * PluginManager::QueryInterface(UInt32 id) -{ - void * result = NULL; - -#ifdef RUNTIME - switch(id) - { - case kInterface_Papyrus: - result = (void *)&g_SKSEPapyrusInterface; - break; - case kInterface_Serialization: - result = (void *)&g_SKSESerializationInterface; - break; - case kInterface_Messaging: - result = (void *)&g_SKSEMessagingInterface; - break; - case kInterface_Scaleform: - result = (void *)&g_SKSEScaleformInterface; - break; - case kInterface_Task: - result = (void *)&g_SKSETaskInterface; - break; - case kInterface_Object: - result = (void *)&g_SKSEObjectInterface; - break; - case kInterface_Trampoline: - result = (void *)&g_SKSETrampolineInterface; - break; - - default: - _WARNING("unknown QueryInterface %08X", id); - break; - } -#else - _WARNING("unknown QueryInterface %08X", id); -#endif - - return result; -} - -PluginHandle PluginManager::GetPluginHandle(void) -{ - ASSERT_STR(s_currentPluginHandle, "A plugin has called SKSEInterface::GetPluginHandle outside of its Query/Load handlers"); - - return s_currentPluginHandle; -} - -UInt32 PluginManager::GetReleaseIndex( void ) -{ - return SKSE_VERSION_RELEASEIDX; -} - -const PluginInfo* PluginManager::GetPluginInfo(const char* name) -{ - return g_pluginManager.GetInfoByName(name); -} - -bool PluginManager::FindPluginDirectory(void) -{ - bool result = false; - - // find the path /data/skse/ - std::string runtimeDirectory = GetRuntimeDirectory(); - - if(!runtimeDirectory.empty()) - { - m_pluginDirectory = runtimeDirectory + "Data\\SKSE\\Plugins\\"; - result = true; - } - - return result; -} - -void PluginManager::ScanPlugins(void) -{ - _MESSAGE("scanning plugin directory %s", m_pluginDirectory.c_str()); - - UInt32 handleIdx = 1; // start at 1, 0 is reserved for internal use - - for(IDirectoryIterator iter(m_pluginDirectory.c_str(), "*.dll"); !iter.Done(); iter.Next()) - { - std::string pluginPath = iter.GetFullPath(); - - LoadedPlugin plugin; - plugin.dllName = iter.Get()->cFileName; - - _MESSAGE("checking plugin %s", plugin.dllName.c_str()); - - HMODULE resourceHandle = (HMODULE)LoadLibraryEx(pluginPath.c_str(), nullptr, LOAD_LIBRARY_AS_IMAGE_RESOURCE); - if(resourceHandle) - { - if(Is64BitDLL(resourceHandle)) - { - auto * version = (const SKSEPluginVersionData *)GetResourceLibraryProcAddress(resourceHandle, "SKSEPlugin_Version"); - if(version) - { - plugin.version = *version; - Sanitize(&plugin.version); - - auto * loadStatus = CheckPluginCompatibility(plugin.version); - if(!loadStatus) - { - // compatible, add to list - - plugin.internalHandle = handleIdx; - handleIdx++; - - m_plugins.push_back(plugin); - } - else - { - LogPluginLoadError(plugin, loadStatus); - } - } - else - { - LogPluginLoadError(plugin, "no version data", 0, false); - } - } - else - { - LogPluginLoadError(plugin, "LE plugin cannot be used with SE"); - } - - FreeLibrary(resourceHandle); - } - else - { - LogPluginLoadError(plugin, "couldn't load plugin", GetLastError()); - } - } -} - -const char * PluginManager::CheckAddressLibrary(void) -{ - static bool s_checked = false; - static const char * s_status = nullptr; - - if(s_checked) - { - return s_status; - } - - char fileName[256]; - _snprintf_s(fileName, 256, "Data\\SKSE\\Plugins\\versionlib-%d-%d-%d-%d.bin", - GET_EXE_VERSION_MAJOR(RUNTIME_VERSION), - GET_EXE_VERSION_MINOR(RUNTIME_VERSION), - GET_EXE_VERSION_BUILD(RUNTIME_VERSION), - 0); - - IFileStream versionLib; - if(!versionLib.Open(fileName)) - { - m_oldAddressLibrary = true; - s_status = "disabled, address library needs to be updated"; - } - - s_checked = true; - - return s_status; -} - -void PluginManager::InstallPlugins(void) -{ - for(size_t i = 0; i < m_plugins.size(); i++) - { - auto & plugin = m_plugins[i]; - - _MESSAGE("loading plugin \"%s\"", plugin.version.name); - - s_currentLoadingPlugin = &plugin; - s_currentPluginHandle = plugin.internalHandle; - - std::string pluginPath = m_pluginDirectory + plugin.dllName; - - plugin.handle = (HMODULE)LoadLibrary(pluginPath.c_str()); - if(plugin.handle) - { - bool success = false; - - plugin.load = (_SKSEPlugin_Load)GetProcAddress(plugin.handle, "SKSEPlugin_Load"); - if(plugin.load) - { - const char * loadStatus = NULL; - - loadStatus = SafeCallLoadPlugin(&plugin, &g_SKSEInterface); - - if(!loadStatus) - { - success = true; - loadStatus = "loaded correctly"; - } - - ASSERT(loadStatus); - - if(success) - { - _MESSAGE("plugin %s (%08X %s %08X) %s (handle %d)", - plugin.dllName.c_str(), - plugin.version.dataVersion, - plugin.version.name, - plugin.version.pluginVersion, - loadStatus, - s_currentPluginHandle); - } - else - { - LogPluginLoadError(plugin, loadStatus); - } - } - else - { - LogPluginLoadError(plugin, "does not appear to be an SKSE plugin"); - } - - if(!success) - { - // failed, unload the library - FreeLibrary(plugin.handle); - - // and remove from plugins list - m_plugins.erase(m_plugins.begin() + i); - - // fix iterator - i--; - } - } - else - { - LogPluginLoadError(plugin, "couldn't load plugin", GetLastError()); - } - } - - s_currentLoadingPlugin = NULL; - s_currentPluginHandle = 0; - - // make fake PluginInfo structs after m_plugins is locked - for(auto & plugin : m_plugins) - { - plugin.info.infoVersion = PluginInfo::kInfoVersion; - plugin.info.name = plugin.version.name; - plugin.info.version = plugin.version.pluginVersion; - } - - // alert any listeners that plugin load has finished - Dispatch_Message(0, SKSEMessagingInterface::kMessage_PostLoad, NULL, 0, NULL); - // second post-load dispatch - Dispatch_Message(0, SKSEMessagingInterface::kMessage_PostPostLoad, NULL, 0, NULL); -} - -const char * PluginManager::SafeCallLoadPlugin(LoadedPlugin * plugin, const SKSEInterface * skse) -{ - __try - { - if(!plugin->load(skse)) - { - return "reported as incompatible during load"; - } - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - // something very bad happened - return "disabled, fatal error occurred while loading plugin"; - } - - return NULL; -} - -void PluginManager::Sanitize(SKSEPluginVersionData * version) -{ - version->name[sizeof(version->name) - 1] = 0; - version->author[sizeof(version->author) - 1] = 0; - version->supportEmail[sizeof(version->supportEmail) - 1] = 0; -} - -enum -{ - kCompat_BlockFromRuntime = 1 << 0, - kCompat_BlockFromEditor = 1 << 1, -}; - -struct MinVersionEntry -{ - const char * name; - UInt32 minVersion; - const char * reason; - UInt32 compatFlags; -}; - -static const MinVersionEntry kMinVersionList[] = -{ - { NULL, 0, NULL } -}; - -const char * PluginManager::CheckPluginCompatibility(const SKSEPluginVersionData & version) -{ - __try - { - // basic validity - if(version.dataVersion != SKSEPluginVersionData::kVersion) - { - return "disabled, bad version data"; - } - - if(!version.name[0]) - { - return "disabled, no name specified"; - } - - // check for 'known bad' versions of plugins - for(const MinVersionEntry * iter = kMinVersionList; iter->name; ++iter) - { - if(!strcmp(iter->name, version.name)) - { - if(version.pluginVersion < iter->minVersion) - { -#ifdef RUNTIME - if(iter->compatFlags & kCompat_BlockFromRuntime) - { - return iter->reason; - } -#endif - -#ifdef EDITOR - if(iter->compatFlags & kCompat_BlockFromEditor) - { - return iter->reason; - } -#endif - } - - break; - } - } - - // version compatibility - const UInt32 kIndependentMask = - SKSEPluginVersionData::kVersionIndependent_AddressLibraryPostAE | - SKSEPluginVersionData::kVersionIndependent_Signatures; - - if(version.versionIndependence & ~kIndependentMask) - { - return "disabled, unsupported version independence method"; - } - - if(version.versionIndependence & SKSEPluginVersionData::kVersionIndependent_AddressLibraryPostAE) - { - const char * result = CheckAddressLibrary(); - if(result) return result; - } - else if(!version.versionIndependence) - { - bool found = false; - - for(UInt32 i = 0; i < _countof(version.compatibleVersions); i++) - { - UInt32 compatibleVersion = version.compatibleVersions[i]; - - if(compatibleVersion == RUNTIME_VERSION) - { - found = true; - break; - } - else if(!compatibleVersion) - { - break; - } - } - - if(!found) - { - return "disabled, incompatible with current runtime version"; - } - } - - // SE version compatibility - if(version.seVersionRequired > PACKED_SKSE_VERSION) - { - return "disabled, requires newer script extender"; - } - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - // paranoia - return "disabled, fatal error occurred while checking plugin compatibility"; - } - - return nullptr; -} - -void PluginManager::LogPluginLoadError(const LoadedPlugin & pluginSrc, const char * errStr, UInt32 errCode, bool isError) -{ - LoadedPlugin plugin = pluginSrc; - - plugin.errorState = errStr; - plugin.errorCode = errCode; - - if(isError) - m_erroredPlugins.push_back(plugin); - - _MESSAGE("plugin %s (%08X %s %08X) %s %d (handle %d)", - plugin.dllName.c_str(), - plugin.version.dataVersion, - plugin.version.name, - plugin.version.pluginVersion, - plugin.errorState, - plugin.errorCode, - s_currentPluginHandle); -} - -void PluginManager::ReportPluginErrors() -{ -#if 0 - PluginErrorDialogBox dialog(*this); - dialog.Show(); - - return; -#endif - - if(m_erroredPlugins.empty()) - return; - - if(m_oldAddressLibrary) - UpdateAddressLibraryPrompt(); - - // With this plugin DLL load error, the thread of prophecy is severed. Update your plugins to restore the weave of fate, or persist in the doomed world you have created - - std::string message = "A DLL plugin has failed to load correctly. If a new version of Skyrim was just released, the plugin needs to be updated. Please check the mod's webpage for updates.\n"; - - for(auto & plugin : m_erroredPlugins) - { - message += "\n"; - message += plugin.dllName + ": " + plugin.errorState; - - if(plugin.errorCode) - { - char codeStr[128]; - sprintf_s(codeStr, "%08X", plugin.errorCode); - - message += " ("; - message += codeStr; - message += ")"; - } - } - - message += "\n\nContinuing to load may result in lost save data or other undesired behavior."; - message += "\nExit game? (yes highly suggested)"; - - int result = MessageBox(0, message.c_str(), "SKSE Plugin Loader", MB_YESNO); - - if(result == IDYES) - { - TerminateProcess(GetCurrentProcess(), 0); - } -} - -void PluginManager::UpdateAddressLibraryPrompt() -{ - int result = MessageBox(0, - "DLL plugins you have installed require a new version of the Address Library. Either this is a new install, or Skyrim was just updated. Visit the Address Library webpage for updates?", - "SKSE Plugin Loader", MB_YESNO); - - if(result == IDYES) - { - ShellExecute(0, nullptr, "https://www.nexusmods.com/skyrimspecialedition/mods/32444", nullptr, nullptr, 0); - TerminateProcess(GetCurrentProcess(), 0); - } -} - -void * PluginManager::GetEventDispatcher(UInt32 dispatcherId) -{ - void * result = nullptr; - -#ifdef RUNTIME - switch(dispatcherId) - { - case SKSEMessagingInterface::kDispatcher_ModEvent: - result = (void *)&g_modCallbackEventDispatcher; - break; - case SKSEMessagingInterface::kDispatcher_CameraEvent: - result = (void *)&g_cameraEventDispatcher; - break; - case SKSEMessagingInterface::kDispatcher_CrosshairEvent: - result = (void *)&g_crosshairRefEventDispatcher; - break; - case SKSEMessagingInterface::kDispatcher_ActionEvent: - result = (void *)&g_actionEventDispatcher; - break; - case SKSEMessagingInterface::kDispatcher_NiNodeUpdateEvent: - result = (void *)&g_ninodeUpdateEventDispatcher; - break; - - default: - _WARNING("unknown EventDispatcher %08X", dispatcherId); - break; - } -#else - _WARNING("unknown EventDispatcher %08X", id); -#endif - - return result; -} - -// Plugin communication interface -struct PluginListener { - PluginHandle listener; - SKSEMessagingInterface::EventCallback handleMessage; -}; - -typedef std::vector > PluginListeners; -static PluginListeners s_pluginListeners; - -bool PluginManager::RegisterListener(PluginHandle listener, const char* sender, SKSEMessagingInterface::EventCallback handler) -{ - // because this can be called while plugins are loading, gotta make sure number of plugins hasn't increased - UInt32 numPlugins = g_pluginManager.GetNumPlugins() + 1; - if (s_pluginListeners.size() < numPlugins) - { - s_pluginListeners.resize(numPlugins + 5); // add some extra room to avoid unnecessary re-alloc - } - - _MESSAGE("registering plugin listener for %s at %u of %u", sender, listener, numPlugins); - - // handle > num plugins = invalid - if (listener > g_pluginManager.GetNumPlugins() || !handler) - { - return false; - } - - if (sender) - { - // is target loaded? - PluginHandle target = g_pluginManager.LookupHandleFromName(sender); - if (target == kPluginHandle_Invalid) - { - return false; - } - // is listener already registered? - for (std::vector::iterator iter = s_pluginListeners[target].begin(); iter != s_pluginListeners[target].end(); ++iter) - { - if (iter->listener == listener) - { - return true; - } - } - - // register new listener - PluginListener newListener; - newListener.handleMessage = handler; - newListener.listener = listener; - - s_pluginListeners[target].push_back(newListener); - } - else - { - // register listener to every loaded plugin - UInt32 idx = 0; - for(PluginListeners::iterator iter = s_pluginListeners.begin(); iter != s_pluginListeners.end(); ++iter) - { - // don't add the listener to its own list - if (idx && idx != listener) - { - bool skipCurrentList = false; - for (std::vector::iterator iterEx = iter->begin(); iterEx != iter->end(); ++iterEx) - { - // already registered with this plugin, skip it - if (iterEx->listener == listener) - { - skipCurrentList = true; - break; - } - } - if (skipCurrentList) - { - continue; - } - PluginListener newListener; - newListener.handleMessage = handler; - newListener.listener = listener; - - iter->push_back(newListener); - } - idx++; - } - } - - return true; -} - -bool PluginManager::Dispatch_Message(PluginHandle sender, UInt32 messageType, void * data, UInt32 dataLen, const char* receiver) -{ - _MESSAGE("dispatch message (%d) to plugin listeners", messageType); - UInt32 numRespondents = 0; - PluginHandle target = kPluginHandle_Invalid; - - if (!s_pluginListeners.size()) // no listeners yet registered - { - _MESSAGE("no listeners registered"); - return false; - } - else if (sender >= s_pluginListeners.size()) - { - _MESSAGE("sender is not in the list"); - return false; - } - - if (receiver) - { - target = g_pluginManager.LookupHandleFromName(receiver); - if (target == kPluginHandle_Invalid) - return false; - } - - const char* senderName = g_pluginManager.GetPluginNameFromHandle(sender); - if (!senderName) - return false; - for (std::vector::iterator iter = s_pluginListeners[sender].begin(); iter != s_pluginListeners[sender].end(); ++iter) - { - SKSEMessagingInterface::Message msg; - msg.data = data; - msg.type = messageType; - msg.sender = senderName; - msg.dataLen = dataLen; - - if (target != kPluginHandle_Invalid) // sending message to specific plugin - { - if (iter->listener == target) - { - iter->handleMessage(&msg); - return true; - } - } - else - { - _DMESSAGE("sending message type %u to plugin %u", messageType, iter->listener); - iter->handleMessage(&msg); - numRespondents++; - } - } - _DMESSAGE("dispatched message."); - return numRespondents ? true : false; -} - -const char * PluginManager::GetPluginNameFromHandle(PluginHandle handle) -{ - if (handle > 0 && handle <= m_plugins.size()) - return (m_plugins[handle - 1].version.name); - else if (handle == 0) - return "SKSE"; - - return NULL; -} - -PluginHandle PluginManager::LookupHandleFromName(const char* pluginName) -{ - if (!_stricmp("SKSE", pluginName)) - return 0; - - UInt32 idx = 1; - for(LoadedPluginList::iterator iter = m_plugins.begin(); iter != m_plugins.end(); ++iter) - { - LoadedPlugin * plugin = &(*iter); - if(!_stricmp(plugin->version.name, pluginName)) - { - return idx; - } - idx++; - } - return kPluginHandle_Invalid; -} - -void PluginErrorDialogBox::Show() -{ - extern HINSTANCE g_moduleHandle; - - CreateDialogParam(g_moduleHandle, MAKEINTRESOURCE(IDD_PLUGINERROR), NULL, _DialogProc, (LPARAM)this); - UInt32 err = GetLastError(); -} - -INT_PTR PluginErrorDialogBox::_DialogProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam) -{ - INT_PTR result = 0; - PluginErrorDialogBox * context = nullptr; - - if(msg == WM_INITDIALOG) - { - context = (PluginErrorDialogBox *)lParam; - context->m_window = window; - SetWindowLongPtr(window, GWLP_USERDATA, lParam); - } - else - { - context = (PluginErrorDialogBox *)GetWindowLongPtr(window, GWLP_USERDATA); - } - - if(context) - result = context->DialogProc(msg, wParam, lParam); - - return result; -} - -INT_PTR PluginErrorDialogBox::DialogProc(UINT msg, WPARAM wParam, LPARAM lParam) -{ - INT_PTR result = FALSE; - - switch(msg) - { - case WM_INITDIALOG: - result = TRUE; - break; - - case WM_COMMAND: - { - bool done = false; - - switch(LOWORD(wParam)) - { - case IDCANCEL: - done = true; - m_exitGame = true; - break; - - case IDOK: - done = true; - break; - } - - if(done) - { - DestroyWindow(m_window); - } - } - break; - - default: - result = FALSE; - break; - } - - return result; -} - -inline void * BranchTrampolineManager::Allocate(PluginHandle plugin, size_t size) -{ - auto mem = m_trampoline.Allocate(size); - if (mem) { - std::lock_guard locker(m_lock); - - auto findIt = m_stats.find(plugin); - if (findIt != m_stats.end()) { - findIt->second += size; - } - else { - auto insIt = m_stats.insert(std::make_pair(plugin, size)); - ASSERT(insIt.second); // insertion failed - } - } - else { - ASSERT(false); // alloc failed - } - return mem; -} - - -void * AllocateFromSKSEBranchPool(PluginHandle plugin, size_t size) -{ - if (s_trampolineLog) { - _DMESSAGE("plugin %d allocated %lld bytes from branch pool", plugin, size); - } - return g_branchTrampolineManager.Allocate(plugin, size); -} - -void * AllocateFromSKSELocalPool(PluginHandle plugin, size_t size) -{ - if (s_trampolineLog) { - _DMESSAGE("plugin %d allocated %lld bytes from local pool", plugin, size); - } - return g_localTrampolineManager.Allocate(plugin, size); -} diff --git a/source/fs.dll/skse64/skse64/PluginManager.h b/source/fs.dll/skse64/skse64/PluginManager.h deleted file mode 100644 index e4c763b2..00000000 --- a/source/fs.dll/skse64/skse64/PluginManager.h +++ /dev/null @@ -1,124 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "skse64/PluginAPI.h" - -class PluginManager -{ -public: - PluginManager(); - ~PluginManager(); - - bool Init(void); - void DeInit(void); - - PluginInfo * GetInfoByName(const char * name); - const char * GetPluginNameFromHandle(PluginHandle handle); - - PluginHandle LookupHandleFromName(const char* pluginName); - - UInt32 GetNumPlugins(void); - - static void * QueryInterface(UInt32 id); - static PluginHandle GetPluginHandle(void); - static UInt32 GetReleaseIndex(void); - static const PluginInfo* GetPluginInfo(const char* name); - - static void * GetEventDispatcher(UInt32 dispatcherId); - - static bool Dispatch_Message(PluginHandle sender, UInt32 messageType, void * data, UInt32 dataLen, const char* receiver); - static bool RegisterListener(PluginHandle listener, const char* sender, SKSEMessagingInterface::EventCallback handler); - -private: - struct LoadedPlugin - { - LoadedPlugin(); - - std::string dllName; - - HMODULE handle = 0; - PluginInfo info; - UInt32 internalHandle = 0; - - SKSEPluginVersionData version; - - _SKSEPlugin_Load load = nullptr; - - const char * errorState = nullptr; - UInt32 errorCode = 0; - }; - - bool FindPluginDirectory(void); - void ScanPlugins(void); - void InstallPlugins(void); - - const char * SafeCallLoadPlugin(LoadedPlugin * plugin, const SKSEInterface * skse); - - void Sanitize(SKSEPluginVersionData * version); - const char * CheckPluginCompatibility(const SKSEPluginVersionData & version); - const char * CheckAddressLibrary(void); - - void LogPluginLoadError(const LoadedPlugin & plugin, const char * errStr, UInt32 errCode = 0, bool isError = true); - void ReportPluginErrors(); - void UpdateAddressLibraryPrompt(); - - typedef std::vector LoadedPluginList; - - std::string m_pluginDirectory; - LoadedPluginList m_plugins; - - LoadedPluginList m_erroredPlugins; - - bool m_oldAddressLibrary = false; - - static LoadedPlugin * s_currentLoadingPlugin; - static PluginHandle s_currentPluginHandle; -}; - -class PluginErrorDialogBox -{ -public: - PluginErrorDialogBox() = delete; - PluginErrorDialogBox(const PluginManager & mgr) - :m_owner(mgr) { } - - void Show(); - - bool ShouldExitGame() { return m_exitGame; } - -private: - static INT_PTR _DialogProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam); - INT_PTR DialogProc(UINT msg, WPARAM wParam, LPARAM lParam); - - HWND m_window = 0; - bool m_exitGame = false; - - const PluginManager & m_owner; -}; - -class BranchTrampolineManager -{ -public: - inline BranchTrampolineManager(BranchTrampoline& trampoline) : - m_trampoline(trampoline) - {} - - inline void* Allocate(PluginHandle plugin, size_t size); - -private: - BranchTrampoline& m_trampoline; - std::mutex m_lock; - std::unordered_map m_stats; -}; - -extern BranchTrampolineManager g_branchTrampolineManager; -extern BranchTrampolineManager g_localTrampolineManager; - -void* AllocateFromSKSEBranchPool(PluginHandle plugin, size_t size); -void* AllocateFromSKSELocalPool(PluginHandle plugin, size_t size); - -extern PluginManager g_pluginManager; diff --git a/source/fs.dll/skse64/skse64/Postbuild.props b/source/fs.dll/skse64/skse64/Postbuild.props deleted file mode 100644 index 95fb84fb..00000000 --- a/source/fs.dll/skse64/skse64/Postbuild.props +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y - Installing DLL... - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/ScaleformAPI.cpp b/source/fs.dll/skse64/skse64/ScaleformAPI.cpp deleted file mode 100644 index fe385243..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformAPI.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "ScaleformAPI.h" - -class ScaleformHeap -{ -public: - virtual void Fn_00(void); - virtual void Fn_01(void); - virtual void Fn_02(void); - virtual void Fn_03(void); - virtual void Fn_04(void); - virtual void Fn_05(void); - virtual void Fn_06(void); - virtual void Fn_07(void); - virtual void Fn_08(void); - virtual void Fn_09(void); - virtual void * Allocate(size_t size, UInt32 unk = 0); // unk is probably align, maybe flags (haven't traced) - virtual void Fn_0B(void); - virtual void Free(void * ptr); -}; - -// ED9B05AE7833EE13354B2DFB8CD6E79144EE0D7E+3B -RelocPtr g_scaleformHeap(0x030CD880); - -void * ScaleformHeap_Allocate(UInt32 size) -{ - return (*(g_scaleformHeap))->Allocate(size); -} - -void ScaleformHeap_Free(void * ptr) -{ - (*(g_scaleformHeap))->Free(ptr); -} - -RelocAddr<_InvokeFunction> InvokeFunction(0x00F1F300); -RelocAddr<_GFxAllocateHeap> GFxAllocateHeap(0x00F919E0); diff --git a/source/fs.dll/skse64/skse64/ScaleformAPI.h b/source/fs.dll/skse64/skse64/ScaleformAPI.h deleted file mode 100644 index cfda8d09..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformAPI.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "skse64_common/Relocation.h" - -class GFxMovieView; -class FxResponseArgsBase; -class ScaleformAllocator; - -void * ScaleformHeap_Allocate(UInt32 size); -void ScaleformHeap_Free(void * ptr); - -typedef void * (* _InvokeFunction)(GFxMovieView * movie, const char * fnName, FxResponseArgsBase * arguments); -extern RelocAddr<_InvokeFunction> InvokeFunction; - -struct HeapDesc -{ - enum - { - kHeap_ThreadUnsafe = (1 << 0), - kHeap_FastTinyBlocks = (1 << 1), - kHeap_FixedGranularity = (1 << 2), - kHeap_Root = (1 << 3), - kHeap_NoDebugInfo = (1 << 4), - kHeap_UserDebug = (1 << 12) - }; - UInt32 flags; - UInt32 granularity; - UInt32 reserve; - UInt32 threshold; - UInt32 limit; - UInt32 heapId; - UInt32 arena; -}; - -typedef void * (* _GFxAllocateHeap)(HeapDesc * heap, ScaleformAllocator * allocator); -extern RelocAddr<_GFxAllocateHeap> GFxAllocateHeap; diff --git a/source/fs.dll/skse64/skse64/ScaleformCallbacks.cpp b/source/fs.dll/skse64/skse64/ScaleformCallbacks.cpp deleted file mode 100644 index a20020a2..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformCallbacks.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "ScaleformCallbacks.h" -#include - -UInt32 g_GFxFunctionHandler_count = 0; - -GFxFunctionHandler::GFxFunctionHandler() -{ - g_GFxFunctionHandler_count++; -} - -GFxFunctionHandler::~GFxFunctionHandler() -{ - g_GFxFunctionHandler_count--; -} - -FunctionHandlerCache g_functionHandlerCache; - -RelocAddr PlaySoundCallback(0x0090A8F0); - -FxResponseArgsList::FxResponseArgsList() -{ - args.values = nullptr; - args.size = 0; - args.capacity = 0; -} -FxResponseArgsList::~FxResponseArgsList() -{ - Clear(); -} - -void FxResponseArgsList::Clear() -{ - if (args.values) { - for (UInt32 i = 0; i < args.size; i++) - args.values[i].CleanManaged(); - ScaleformHeap_Free(args.values); - args.values = NULL; - args.size = 0; - } -} diff --git a/source/fs.dll/skse64/skse64/ScaleformCallbacks.h b/source/fs.dll/skse64/skse64/ScaleformCallbacks.h deleted file mode 100644 index 8699eef1..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformCallbacks.h +++ /dev/null @@ -1,172 +0,0 @@ -#pragma once - -#include "skse64/ScaleformAPI.h" -#include "skse64/ScaleformTypes.h" -#include "skse64/ScaleformValue.h" -#include "skse64_common/Utilities.h" -#include -#include - -// see RakNet/DependentExtensions/GFx3/FxGameDelegate.h - -class FxDelegateHandler; -class GFxMovieView; -class GFxMovieRoot; - -// the double in GFxValue is causing very weird alignment issues -//#pragma pack (push, 4) - - -//STATIC_ASSERT(sizeof(GFxValue) == 0x18); - -//#pragma pack (pop) - -class GFxFunctionHandler : public GRefCountBase -{ -public: - GFxFunctionHandler(); - virtual ~GFxFunctionHandler(); - - // 1C - class Args - { - public: - GFxValue * result; // 00 - GFxMovieView * movie; // 04 - GFxValue * thisObj; // 08 - GFxValue * unk0C; // 0C - GFxValue * args; // 10 - UInt32 numArgs; // 14 - void * refCon; // 18 - }; - - virtual void Invoke(Args * args) = 0; - - MEMBER_FN_PREFIX(GFxFunctionHandler); -}; - -typedef std::map FunctionHandlerCache; -extern FunctionHandlerCache g_functionHandlerCache; - -template -void RegisterFunction(GFxValue * dst, GFxMovieView * movie, const char * name) -{ - // either allocate the object or retrieve an existing instance from the cache - GFxFunctionHandler * fn = NULL; - - // check the cache - FunctionHandlerCache::iterator iter = g_functionHandlerCache.find(&typeid(T)); - if(iter != g_functionHandlerCache.end()) - fn = iter->second; - - if(!fn) - { - // not found, allocate a new one - fn = new T; - - // add it to the cache - // cache now owns the object as far as refcounting goes - g_functionHandlerCache[&typeid(T)] = fn; - } - - // create the function object - GFxValue fnValue; - movie->CreateFunction(&fnValue, fn); - - // register it - dst->SetMember(name, &fnValue); -} - -// 08 -class FxResponseArgsBase -{ -public: - FxResponseArgsBase() { }; - virtual ~FxResponseArgsBase() { }; - - virtual UInt32 GetValues(GFxValue ** params) = 0; -// void ** _vtbl; // 00 -}; - -// 08 + T_numArgs * 0x10 -template -class FxResponseArgs : public FxResponseArgsBase -{ -public: - FxResponseArgs() : curArg(T_numArgs + 1) { }; - virtual ~FxResponseArgs() { }; - - virtual UInt32 GetValues(GFxValue ** params) - { - *params = &args[0]; - return curArg; - } - - GFxValue args[T_numArgs + 1]; // 08 - first entry must be empty for some reason - UInt32 curArg; // 20 - offsets assume one argument -}; - -// ? -class FxResponseArgsList : public FxResponseArgsBase -{ -public: - FxResponseArgsList(); - virtual ~FxResponseArgsList(); - - void Clear(); - - virtual UInt32 GetValues(GFxValue ** params) - { - *params = args.values; - return args.size; - } - - GArray args; -}; - -// 20 -class FxDelegateArgs -{ -public: - FxDelegateArgs(); - ~FxDelegateArgs(); - - GFxValue responseID; - FxDelegateHandler * menu; // 10 - GFxMovieView * movie; // 14 - GFxValue * args; // 18 - UInt32 numArgs; // 1C -}; - -// 08 -class FxDelegateHandler : public GRefCountBase -{ -public: - //FxDelegateHandler(); - //~FxDelegateHandler(); - - typedef void (* Callback)(const FxDelegateArgs & params); - - class CallbackProcessor - { - public: - CallbackProcessor(); - virtual ~CallbackProcessor(); - - virtual void Process(const GString & name, Callback method); - }; - - class AddCallbackVisitor : public CallbackProcessor - { - public: - AddCallbackVisitor(); - virtual ~AddCallbackVisitor(); - - FxDelegateHandler * parent; - void * callbackHashTable; - }; - - virtual void Accept(CallbackProcessor * processor) = 0; -}; - -extern RelocAddr PlaySoundCallback; diff --git a/source/fs.dll/skse64/skse64/ScaleformExtendedData.cpp b/source/fs.dll/skse64/skse64/ScaleformExtendedData.cpp deleted file mode 100644 index 351d3e9d..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformExtendedData.cpp +++ /dev/null @@ -1,902 +0,0 @@ -#include "ScaleformCallbacks.h" -#include "ScaleformMovie.h" -#include "ScaleformExtendedData.h" -#include "GameData.h" -#include "GameForms.h" -#include "GameObjects.h" -#include "GameReferences.h" -#include "GameExtraData.h" -#include "GameRTTI.h" -#include "GameMenus.h" - -// Helpers -double round(double r) -{ - return (r >= 0.0) ? floor(r + 0.5) : ceil(r - 0.5); -} - -void RegisterUnmanagedString(GFxValue * dst, const char * name, const char * str) -{ - GFxValue fxValue; - - fxValue.SetString(str); - - dst->SetMember(name, &fxValue); -} - -void RegisterString(GFxValue * dst, GFxMovieView * view, const char * name, const char * str) -{ - GFxValue fxValue; - - view->CreateString(&fxValue, str); - - dst->SetMember(name, &fxValue); -} - -void RegisterWideString(GFxValue * dst, GFxMovieView * view, const char * name, const wchar_t * str) -{ - GFxValue fxValue; - - view->CreateWideString(&fxValue, str); - - dst->SetMember(name, &fxValue); -} - -void RegisterNumber(GFxValue * dst, const char * name, double value) -{ - GFxValue fxValue; - - fxValue.SetNumber(value); - - dst->SetMember(name, &fxValue); -} - -void RegisterBool(GFxValue * dst, const char * name, bool value) -{ - GFxValue fxValue; - fxValue.SetBool(value); - dst->SetMember(name, &fxValue); -} - -void RegisterKeywords(GFxValue * pFxVal, GFxMovieView * view, BGSKeywordForm * keywordForm) -{ - GFxValue keywordRoot; - view->CreateObject(&keywordRoot); - - // Add all keywords as boolean properties with value true - - UInt32 count = keywordForm->numKeywords; - BGSKeyword ** keywords = keywordForm->keywords; - if(keywords) - { - for(int i = 0; i < count; i++) - { - BGSKeyword * pKey = keywords[i]; - if(pKey) - { - const char * keyString = pKey->keyword.Get(); - if(keyString) - { - RegisterBool(&keywordRoot, keyString, true); - } - } - } - } - - pFxVal->SetMember("keywords", &keywordRoot); -} - -class FormListExtender : public BGSListForm::Visitor -{ - GFxValue * m_array; - GFxMovieView * m_movie; - bool m_bExtra; - bool m_bRecursive; - -public: - FormListExtender::FormListExtender(GFxValue * formArray, GFxMovieView * movie, bool bExtra, bool bRecursive) : m_array(formArray), m_movie(movie), m_bExtra(bExtra), m_bRecursive(bRecursive) { } - virtual bool Accept(TESForm * form) - { - if(form) { - GFxValue arrArg; - m_movie->CreateObject(&arrArg); - scaleformExtend::FormData(&arrArg, m_movie, form, m_bRecursive ? m_bExtra : false, m_bRecursive); - m_array->PushBack(&arrArg); - } - return false; - }; -}; - -// Data extensions -namespace scaleformExtend -{ - void CommonItemData(GFxValue* pFxVal, TESForm * pForm) - { - if(!pFxVal || !pForm || !pFxVal->IsObject()) - return; - - RegisterNumber(pFxVal, "formType", (double)pForm->GetFormType()); - RegisterNumber(pFxVal, "formId", (double)pForm->formID); - } - - void StandardItemData(GFxValue * pFxVal, TESForm * pForm, InventoryEntryData * pEntry) - { - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - switch(pForm->GetFormType()) - { - case kFormType_Armor: - { - TESObjectARMO * pArmor = DYNAMIC_CAST(pForm, TESForm, TESObjectARMO); - if(pArmor) - { - RegisterNumber(pFxVal, "partMask", pArmor->bipedObject.data.parts); - RegisterNumber(pFxVal, "weightClass", pArmor->bipedObject.data.weightClass); - } - } - break; - - case kFormType_Ammo: - { - TESAmmo * pAmmo = DYNAMIC_CAST(pForm, TESForm, TESAmmo); - if(pAmmo) - { - RegisterNumber(pFxVal, "flags", pAmmo->settings.flags); - } - } - break; - - case kFormType_Weapon: - { - TESObjectWEAP * pWeapon = DYNAMIC_CAST(pForm, TESForm, TESObjectWEAP); - if(pWeapon) - { - RegisterNumber(pFxVal, "subType", pWeapon->type()); // DEPRECATED - RegisterNumber(pFxVal, "weaponType", pWeapon->type()); - RegisterNumber(pFxVal, "speed", pWeapon->speed()); - RegisterNumber(pFxVal, "reach", pWeapon->reach()); - RegisterNumber(pFxVal, "stagger", pWeapon->stagger()); - RegisterNumber(pFxVal, "critDamage", pWeapon->critDamage()); - RegisterNumber(pFxVal, "minRange", pWeapon->minRange()); - RegisterNumber(pFxVal, "maxRange", pWeapon->maxRange()); - RegisterNumber(pFxVal, "baseDamage", pWeapon->damage.GetAttackDamage()); - - BGSEquipSlot * equipSlot = pWeapon->equipType.GetEquipSlot(); - if (equipSlot) - RegisterNumber(pFxVal, "equipSlot", equipSlot->formID); - } - } - break; - - case kFormType_SoulGem: - { - TESSoulGem * soulGem = DYNAMIC_CAST(pForm, TESForm, TESSoulGem); - if(soulGem) - { - RegisterNumber(pFxVal, "gemSize", soulGem->gemSize); - RegisterNumber(pFxVal, "soulSize", pEntry ? CALL_MEMBER_FN(pEntry,GetSoulLevel)() : soulGem->soulSize); - } - } - break; - - case kFormType_Potion: - { - AlchemyItem * pAlchemy = DYNAMIC_CAST(pForm, TESForm, AlchemyItem); - if(pAlchemy) - { - RegisterNumber(pFxVal, "flags", pAlchemy->itemData.flags); - } - } - break; - - case kFormType_Book: - { - TESObjectBOOK * pBook = DYNAMIC_CAST(pForm, TESForm, TESObjectBOOK); - if(pBook) - { - RegisterNumber(pFxVal, "flags", pBook->data.flags); - RegisterNumber(pFxVal, "bookType", pBook->data.type); - switch(pBook->data.GetSanitizedType()) - { - case TESObjectBOOK::Data::kType_Skill: - RegisterNumber(pFxVal, "teachesSkill", pBook->data.teaches.skill); - break; - - case TESObjectBOOK::Data::kType_Spell: - { - double formID = -1; - - if(pBook->data.teaches.spell) - formID = pBook->data.teaches.spell->formID; - - RegisterNumber(pFxVal, "teachesSpell", formID); - } - break; - } - } - } - break; - - default: - break; - } - } - - - void MagicItemData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive) - { - if(!pFxVal || !pForm || !pFxVal->IsObject()) - return; - - switch(pForm->GetFormType()) - { - case kFormType_Spell: - case kFormType_ScrollItem: - case kFormType_Ingredient: - case kFormType_Potion: - case kFormType_Enchantment: - { - MagicItem * pMagicItem = DYNAMIC_CAST(pForm, TESForm, MagicItem); - if(pMagicItem) - { - if(pMagicItem->fullName.name.data) - RegisterUnmanagedString(pFxVal, "spellName", pMagicItem->fullName.name.data); - - MagicItem::EffectItem * pEffect = CALL_MEMBER_FN(pMagicItem, GetCostliestEffectItem)(5, false); - if(pEffect && pEffect->mgef) - { - RegisterNumber(pFxVal, "magnitude", pEffect->magnitude); - RegisterNumber(pFxVal, "duration", pEffect->duration); - RegisterNumber(pFxVal, "area", pEffect->area); - - // PLB: Normally I'd have this as a separate object but SkyUI is already using this - scaleformExtend::MagicItemData(pFxVal, movieView, pEffect->mgef, bRecursive ? bExtra : false, bRecursive); - } - } - - SpellItem * pSpellItem = DYNAMIC_CAST(pMagicItem, MagicItem, SpellItem); - if(pSpellItem) - { - RegisterNumber(pFxVal, "spellType", pSpellItem->data.type); - RegisterNumber(pFxVal, "trueCost", pSpellItem->GetMagickaCost()); - - BGSEquipSlot * equipSlot = pSpellItem->equipType.GetEquipSlot(); - if (equipSlot) - RegisterNumber(pFxVal, "equipSlot", equipSlot->formID); - } - - AlchemyItem * pAlchemyItem = DYNAMIC_CAST(pMagicItem, MagicItem, AlchemyItem); - if(pAlchemyItem) - { - if(pAlchemyItem->itemData.useSound) { - GFxValue useSound; - movieView->CreateObject(&useSound); - scaleformExtend::FormData(&useSound, movieView, pAlchemyItem->itemData.useSound, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("useSound", &useSound); - } - } - - EnchantmentItem * pEnchantItem = DYNAMIC_CAST(pMagicItem, MagicItem, EnchantmentItem); - if(pEnchantItem) - { - RegisterNumber(pFxVal, "flags", (double)pMagicItem->flags); - - GFxValue baseEnchant; - movieView->CreateObject(&baseEnchant); - scaleformExtend::FormData(&baseEnchant, movieView, pEnchantItem->data.baseEnchantment, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("baseEnchant", &baseEnchant); - - GFxValue restrictions; - movieView->CreateObject(&restrictions); - scaleformExtend::FormData(&restrictions, movieView, pEnchantItem->data.restrictions, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("restrictions", &restrictions); - } - } - break; - - case kFormType_EffectSetting: - { - EffectSetting * pEffectSetting = DYNAMIC_CAST(pForm, TESForm, EffectSetting); - if(pEffectSetting) - { - if(pEffectSetting->fullName.name.data) - RegisterUnmanagedString(pFxVal, "effectName", pEffectSetting->fullName.name.data); - - RegisterNumber(pFxVal, "subType", pEffectSetting->school()); // DEPRECATED - RegisterNumber(pFxVal, "effectFlags", pEffectSetting->properties.flags); - RegisterNumber(pFxVal, "school", pEffectSetting->school()); - RegisterNumber(pFxVal, "skillLevel", pEffectSetting->level()); - RegisterNumber(pFxVal, "archetype", pEffectSetting->properties.archetype); - RegisterNumber(pFxVal, "deliveryType", pEffectSetting->properties.deliveryType); - RegisterNumber(pFxVal, "castTime", pEffectSetting->properties.castingTime); - RegisterNumber(pFxVal, "delayTime", pEffectSetting->properties.delayTime); - RegisterNumber(pFxVal, "actorValue", pEffectSetting->properties.primaryValue); - RegisterNumber(pFxVal, "castType", pEffectSetting->properties.castType); - RegisterNumber(pFxVal, "magicType", pEffectSetting->properties.resistance); - } - } - break; - case kFormType_Shout: - { - TESShout * pShout = DYNAMIC_CAST(pForm, TESForm, TESShout); - if(pShout) - { - if(pShout->fullName.name.data) - RegisterUnmanagedString(pFxVal, "fullName", pShout->fullName.name.data); - - // Words - GFxValue words; - movieView->CreateArray(&words); - for(int i = 0; i < pShout->Words::kNumWords; i++) - { - GFxValue word; - movieView->CreateObject(&word); - - if(pShout->words[i].word && pShout->words[i].word->fullName.name.data) - RegisterUnmanagedString(&word, "word", pShout->words[i].word->fullName.name.data); - - if(pShout->words[i].word && pShout->words[i].word->word.data) - RegisterUnmanagedString(&word, "fullName", pShout->words[i].word->word.data); - - RegisterNumber(&word, "recoveryTime", pShout->words[i].recoverytime); - - // Spell Object - scaleformExtend::FormData(&word, movieView, pShout->words[i].spell, bRecursive ? bExtra : false, bRecursive); - words.PushBack(&word); - } - pFxVal->SetMember("words", &words); - } - } - break; - - default: - break; - } - } - - void ActorData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive) - { - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - switch(pForm->GetFormType()) - { - case kFormType_Race: - { - TESRace * pRace = DYNAMIC_CAST(pForm, TESForm, TESRace); - if(pRace) - { - if(pRace->fullName.name.data) - RegisterUnmanagedString(pFxVal, "fullName", pRace->fullName.name.data); - - if(pRace->editorId.data) - RegisterUnmanagedString(pFxVal, "editorId", pRace->editorId.data); - - // Spells - GFxValue spells; - movieView->CreateArray(&spells); - for(int i = 0; i < pRace->spellList.GetSpellCount(); i++) - { - GFxValue spell; - movieView->CreateObject(&spell); - scaleformExtend::FormData(&spell, movieView, pRace->spellList.GetNthSpell(i), bRecursive ? bExtra : false, bRecursive); - spells.PushBack(&spell); - } - pFxVal->SetMember("spells", &spells); - - // Shouts - GFxValue shouts; - movieView->CreateArray(&shouts); - for(int i = 0; i < pRace->spellList.GetShoutCount(); i++) - { - GFxValue shout; - movieView->CreateObject(&shout); - scaleformExtend::FormData(&shout, movieView, pRace->spellList.GetNthShout(i), bRecursive ? bExtra : false, bRecursive); - shouts.PushBack(&shout); - } - pFxVal->SetMember("shouts", &shouts); - - GFxValue bonuses; - movieView->CreateArray(&bonuses); - for(int i = 0; i < TESRace::kRace_NumSkillBonuses; i++) - { - GFxValue skillBonus; - movieView->CreateObject(&skillBonus); - RegisterNumber(&skillBonus, "skill", pRace->data.skillBonus[i].skill); - RegisterNumber(&skillBonus, "bonus", pRace->data.skillBonus[i].bonus); - bonuses.PushBack(&skillBonus); - } - pFxVal->SetMember("skillBonuses", &bonuses); - } - } - break; - case kFormType_NPC: - { - TESNPC * pNPC = DYNAMIC_CAST(pForm, TESForm, TESNPC); - if(pNPC) - { - if(pNPC->fullName.name.data) - RegisterUnmanagedString(pFxVal, "fullName", pNPC->fullName.name.data); - if(pNPC->shortName.data) - RegisterUnmanagedString(pFxVal, "shortName", pNPC->shortName.data); - - RegisterNumber(pFxVal, "weight", pNPC->weight); - - bool isLevelMult = (pNPC->actorData.flags & TESActorBaseData::kFlag_PCLevelMult) == TESActorBaseData::kFlag_PCLevelMult; - if(isLevelMult) - RegisterNumber(pFxVal, "levelMult", (double)pNPC->actorData.level / 1000.0); - else - RegisterNumber(pFxVal, "level", (double)pNPC->actorData.level); - - RegisterNumber(pFxVal, "minLevel", (double)pNPC->actorData.minLevel); - RegisterNumber(pFxVal, "maxLevel", (double)pNPC->actorData.maxLevel); - - GFxValue race; - movieView->CreateObject(&race); - scaleformExtend::FormData(&race, movieView, pNPC->race.race, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("race", &race); - - // Spells - GFxValue spells; - movieView->CreateArray(&spells); - for(int i = 0; i < pNPC->spellList.GetSpellCount(); i++) - { - GFxValue spell; - movieView->CreateObject(&spell); - scaleformExtend::FormData(&spell, movieView, pNPC->spellList.GetNthSpell(i), bRecursive ? bExtra : false, bRecursive); - spells.PushBack(&spell); - } - pFxVal->SetMember("spells", &spells); - - // Shouts - GFxValue shouts; - movieView->CreateArray(&shouts); - for(int i = 0; i < pNPC->spellList.GetShoutCount(); i++) - { - GFxValue shout; - movieView->CreateObject(&shout); - scaleformExtend::FormData(&shout, movieView, pNPC->spellList.GetNthShout(i), bRecursive ? bExtra : false, bRecursive); - shouts.PushBack(&shout); - } - pFxVal->SetMember("shouts", &shouts); - } - } - break; - - case kFormType_Character: - { - Actor * pActor = DYNAMIC_CAST(pForm, TESForm, Actor); - if(pActor) - { - // ActorBase as Object - GFxValue actorBase; - movieView->CreateObject(&actorBase); - - scaleformExtend::FormData(&actorBase, movieView, pActor->baseForm, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("actorBase", &actorBase); - - RegisterUnmanagedString(pFxVal, "fullName", CALL_MEMBER_FN(pActor, GetReferenceName)()); - - // Spells as Array - GFxValue addedSpells; - movieView->CreateArray(&addedSpells); - - for(int i = 0; i < pActor->addedSpells.Length(); i++) - { - GFxValue spell; - movieView->CreateObject(&spell); - scaleformExtend::FormData(&spell, movieView, pActor->addedSpells.Get(i), bRecursive ? bExtra : false, bRecursive); - addedSpells.PushBack(&spell); - } - - pFxVal->SetMember("spells", &addedSpells); - - // ActiveEffects as Array - GFxValue activeEffects; - movieView->CreateArray(&activeEffects); - - tList * effects = pActor->magicTarget.GetActiveEffects(); - if(effects) - { - for(int i = 0; i < effects->Count(); i++) - { - GFxValue effect; - movieView->CreateObject(&effect); - - ActiveEffect * pEffect = effects->GetNthItem(i); - - if(pEffect->item) - scaleformExtend::MagicItemData(&effect, movieView, pEffect->item, bRecursive ? bExtra : false, bRecursive); - - RegisterNumber(&effect, "elapsed", pEffect->elapsed); - RegisterNumber(&effect, "duration", pEffect->duration); - RegisterNumber(&effect, "magnitude", pEffect->magnitude); - RegisterBool(&effect, "inactive", (pEffect->flags & ActiveEffect::kFlag_Inactive) == ActiveEffect::kFlag_Inactive); - - // ActiveEffect - if(pEffect->effect && pEffect->effect->mgef) - scaleformExtend::MagicItemData(&effect, movieView, pEffect->effect->mgef, bRecursive ? bExtra : false, bRecursive); - - activeEffects.PushBack(&effect); - } - } - pFxVal->SetMember("activeEffects", &activeEffects); - - GFxValue actorValues; - movieView->CreateArray(&actorValues); - - for(int i = 0; i < ActorValueList::kNumActorValues; i++) - { - GFxValue actorValue; - movieView->CreateObject(&actorValue); - RegisterNumber(&actorValue, "current", pActor->actorValueOwner.GetCurrent(i)); - RegisterNumber(&actorValue, "maximum", pActor->actorValueOwner.GetMaximum(i)); - RegisterNumber(&actorValue, "base", pActor->actorValueOwner.GetBase(i)); - actorValues.PushBack(&actorValue); - } - - pFxVal->SetMember("actorValues", &actorValues); - } - PlayerCharacter* pPC = DYNAMIC_CAST(pForm, TESForm, PlayerCharacter); - if(pPC) - { - RegisterNumber(pFxVal, "perkPoints", (double)pPC->numPerkPoints); - } - } - break; - - default: - break; - } - } - - void FormListData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive) - { - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - switch(pForm->GetFormType()) - { - case kFormType_List: - { - BGSListForm * formList = DYNAMIC_CAST(pForm, TESForm, BGSListForm); - if(formList) - { - GFxValue formArray; - movieView->CreateArray(&formArray); - - FormListExtender extender(&formArray, movieView, bExtra, bRecursive); - formList->Visit(extender); - - pFxVal->SetMember("forms", &formArray); - } - } - break; - default: - break; - } - } - - void MiscData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive) - { - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - switch(pForm->GetFormType()) - { - case kFormType_Message: - { - BGSMessage * message = DYNAMIC_CAST(pForm, TESForm, BGSMessage); - if(message) - { - GFxValue btnArray; - movieView->CreateArray(&btnArray); - BSFixedString * btnText; - for(int i = 0; i < message->buttons.Count(); i++) - { - GFxValue fxValue; - btnText = message->buttons.GetNthItem(i); - if(btnText) { - fxValue.SetString(btnText->data); - btnArray.PushBack(&fxValue); - } - } - - pFxVal->SetMember("buttons", &btnArray); - RegisterUnmanagedString(pFxVal, "message", message->GetDescription().c_str()); - } - } - break; - case kFormType_Quest: - { - TESQuest * quest = DYNAMIC_CAST(pForm, TESForm, TESQuest); - if(quest) - { - RegisterUnmanagedString(pFxVal, "fullName", quest->fullName.name.data); - RegisterNumber(pFxVal, "flags", quest->unk0D8.flags); - RegisterNumber(pFxVal, "priority", quest->unk0D8.priority); - RegisterUnmanagedString(pFxVal, "editorId", quest->questID.Get()); - - GFxValue aliasArray; - - movieView->CreateArray(&aliasArray); - - for(int i = 0; i < quest->aliases.count; i++) - { - BGSBaseAlias* alias; - if(quest->aliases.GetNthItem(i, alias)) { - GFxValue arrArg; - movieView->CreateObject(&arrArg); - RegisterUnmanagedString(&arrArg, "name", alias->name.data); - RegisterNumber(&arrArg, "id", alias->aliasId); - RegisterNumber(&arrArg, "flags", alias->flags); - aliasArray.PushBack(&arrArg); - } - } - - pFxVal->SetMember("aliases", &aliasArray); - } - } - break; - case kFormType_HeadPart: - { - BGSHeadPart * headPart = DYNAMIC_CAST(pForm, TESForm, BGSHeadPart); - if(headPart) - { - RegisterUnmanagedString(pFxVal, "fullName", headPart->fullName.name.data); - RegisterUnmanagedString(pFxVal, "partName", headPart->partName.data); - RegisterNumber(pFxVal, "partFlags", headPart->partFlags); - RegisterNumber(pFxVal, "partType", headPart->type); - - RegisterUnmanagedString(pFxVal, "modelPath", headPart->model.GetModelName()); - RegisterUnmanagedString(pFxVal, "chargenMorphPath", headPart->chargenMorph.GetModelName()); - RegisterUnmanagedString(pFxVal, "raceMorphPath", headPart->raceMorph.GetModelName()); - - GFxValue extraParts; - movieView->CreateArray(&extraParts); - for(int i = 0; i < headPart->extraParts.count; i++) - { - BGSHeadPart* extraPart; - if(headPart->extraParts.GetNthItem(i, extraPart)) { - GFxValue arrArg; - movieView->CreateObject(&arrArg); - scaleformExtend::FormData(&arrArg, movieView, extraPart, bRecursive ? bExtra : false, bRecursive); - extraParts.PushBack(&arrArg); - } - } - - pFxVal->SetMember("extraParts", &extraParts); - - GFxValue validRaces; - movieView->CreateObject(&validRaces); - scaleformExtend::FormData(&validRaces, movieView, headPart->validRaces, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("validRaces", &validRaces); - - GFxValue textureSet; - movieView->CreateObject(&textureSet); - scaleformExtend::FormData(&textureSet, movieView, headPart->textureSet, bRecursive ? bExtra : false, bRecursive); - pFxVal->SetMember("textureSet", &textureSet); - } - } - break; - case kFormType_TextureSet: - { - BGSTextureSet * textureSet = DYNAMIC_CAST(pForm, TESForm, BGSTextureSet); - if(textureSet) - { - GFxValue textureArray; - movieView->CreateArray(&textureArray); - for(int i = 0; i < BGSTextureSet::kNumTextures; i++) - { - GFxValue strArg; - strArg.SetString(textureSet->texturePaths[i].str.data); - textureArray.PushBack(&strArg); - } - - pFxVal->SetMember("textures", &textureArray); - } - } - break; - default: - break; - } - } - - // Convenience function, maybe combine all other functions into this one anyway? - // bExtra - Adds all extra data other than FormId and FormType - // bRecursive - Processes child forms - void FormData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive) - { - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - scaleformExtend::CommonItemData(pFxVal, pForm); - if(bExtra) { - scaleformExtend::StandardItemData(pFxVal, pForm); - scaleformExtend::MagicItemData(pFxVal, movieView, pForm, bExtra, bRecursive); - scaleformExtend::ActorData(pFxVal, movieView, pForm, bExtra, bRecursive); - scaleformExtend::MiscData(pFxVal, movieView, pForm, bExtra, bRecursive); - } - scaleformExtend::FormListData(pFxVal, movieView, pForm, bExtra, bRecursive); - } - - void InventoryData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * objDesc) - { - TESForm * pForm = objDesc->type; - - if(!pForm || !pFxVal || !pFxVal->IsObject()) - return; - - PlayerCharacter * pPC = *g_thePlayer; - - BGSKeywordForm * keywords = DYNAMIC_CAST(pForm, TESForm, BGSKeywordForm); - if(keywords) - RegisterKeywords(pFxVal, movieView, keywords); - - switch(pForm->GetFormType()) - { - case kFormType_Armor: - { - TESObjectARMO * pArmor = DYNAMIC_CAST(pForm, TESForm, TESObjectARMO); - if(pArmor) - { - double armorValue = CALL_MEMBER_FN(pPC, GetArmorValue)(objDesc); - armorValue = round(armorValue); - RegisterNumber(pFxVal, "armor", armorValue); - } - } - break; - - case kFormType_Weapon: - { - TESObjectWEAP * pWeapon = DYNAMIC_CAST(pForm, TESForm, TESObjectWEAP); - if(pWeapon) - { - double damage = CALL_MEMBER_FN(pPC, GetDamage)(objDesc); - damage = round(damage); - RegisterNumber(pFxVal, "damage", damage); - } - } - break; - - case kFormType_Ammo: - { - TESAmmo * pAmmo = DYNAMIC_CAST(pForm, TESForm, TESAmmo); - if(pAmmo) - { - double damage = CALL_MEMBER_FN(pPC, GetDamage)(objDesc); - damage = round(damage); - RegisterNumber(pFxVal, "damage", damage); - } - } - break; - - default: - break; - } - } - - // SkyUI currently uses the itemcard info in ItemMenus to retrieve this data. - // This should replace the hack in future menus. - void ItemInfoData(GFxValue* pFxVal, InventoryEntryData * pEntry) - { - if(!pFxVal || !pEntry || !pFxVal->IsObject()) - return; - - RegisterNumber(pFxVal, "value", (double)CALL_MEMBER_FN(pEntry,GetValue)()); - RegisterNumber(pFxVal, "weight", GetFormWeight(pEntry->type)); - RegisterNumber(pFxVal, "isStolen", ! CALL_MEMBER_FN(pEntry,IsOwnedBy)(*g_thePlayer, 1)); - } - - void CraftDisenchantData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * pEntry) - { - if(!pEntry || !pEntry->type || !pFxVal || !pFxVal->IsObject()) - return; - - EnchantmentItem* enchantment = NULL; - - TESEnchantableForm * enchantable = DYNAMIC_CAST(pEntry->type, TESForm, TESEnchantableForm); - if (enchantable && enchantable->enchantment) - { - enchantment = enchantable->enchantment; - } - else if (pEntry->extendDataList) - { - for (ExtendDataList::Iterator it = pEntry->extendDataList->Begin(); !it.End(); ++it) - { - BaseExtraList * pExtraDataList = it.Get(); - - if (pExtraDataList) - { - ExtraEnchantment* extraEnchant = static_cast(pExtraDataList->GetByType(kExtraData_Enchantment)); - if (extraEnchant) - { - enchantment = extraEnchant->enchant; - break; - } - } - } - } - - if (enchantment) - { - RegisterUnmanagedString(pFxVal, "effectName", enchantment->fullName.name.data); - } - } - - enum - { - kCustomAlchemyFlag_None = 0x0, - kCustomAlchemyFlag_Any = 0x1, - kCustomAlchemyFlag_Beneficial = 0x2, - kCustomAlchemyFlag_Harmful = 0x4, - kCustomAlchemyFlag_Other = 0x8 - }; - - void AlchemyCategoryArgs(AlchemyEffectCategory* effectArray, GFxValue * args, UInt32 numArgs) - { - AlchemyEffectCategory* curEffect = effectArray; - - // Replace the "flag" value (at offset 1) with a new value. - // Previously, flag was just an incrementing number 1 to N+1, no special cases. - // We can easily calculate this number in AS, so flag can be used for other things. - - const UInt32 kStride = 3; - const UInt32 kFlagOffset = 1; - - // Start at kStride, because [0 .. kStride-1] is the "INGREDIENTS" entry - for (UInt32 i=kStride + kFlagOffset; iformId); - - UInt32 newFlag = kCustomAlchemyFlag_None; - - EffectSetting * effect = DYNAMIC_CAST(form, TESForm, EffectSetting); - if (effect) - { - UInt32 archetype = effect->properties.archetype; - UInt32 bDetrimental = (effect->properties.flags & EffectSetting::Properties::kEffectType_Detrimental) != 0; - - switch (archetype) - { - case EffectSetting::Properties::kArchetype_ValueMod: - case EffectSetting::Properties::kArchetype_DualValueMod: - case EffectSetting::Properties::kArchetype_PeakValueMod: - { - newFlag = bDetrimental ? kCustomAlchemyFlag_Harmful : kCustomAlchemyFlag_Beneficial; - break; - } - case EffectSetting::Properties::kArchetype_Absorb: - case EffectSetting::Properties::kArchetype_CureDisease: - case EffectSetting::Properties::kArchetype_Invisibility: - case EffectSetting::Properties::kArchetype_CureParalysis: - case EffectSetting::Properties::kArchetype_CureAddiction: - case EffectSetting::Properties::kArchetype_CurePoison: - case EffectSetting::Properties::kArchetype_Dispel: - { - newFlag = kCustomAlchemyFlag_Beneficial; - break; - } - case EffectSetting::Properties::kArchetype_Frenzy: - case EffectSetting::Properties::kArchetype_Calm: - case EffectSetting::Properties::kArchetype_Demoralize: - case EffectSetting::Properties::kArchetype_Paralysis: - { - newFlag = kCustomAlchemyFlag_Harmful; - break; - } - default: - { - newFlag = kCustomAlchemyFlag_Other; - break; - } - } - } - - args[i].SetNumber(newFlag); - - curEffect++; - } - } -} diff --git a/source/fs.dll/skse64/skse64/ScaleformExtendedData.h b/source/fs.dll/skse64/skse64/ScaleformExtendedData.h deleted file mode 100644 index 5ed948b8..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformExtendedData.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -class TESForm; -class ActiveEffect; -class GFxMovieView; -class GFxValue; -class BGSKeywordForm; -class InventoryEntryData; -struct AlchemyEffectCategory; - -#include "GameReferences.h" - -void RegisterNumber(GFxValue * dst, const char * name, double value); -void RegisterBool(GFxValue * dst, const char * name, bool value); -void RegisterString(GFxValue * dst, GFxMovieView * view, const char * name, const char * str); -void RegisterKeywords(GFxValue * pFxVal, GFxMovieView * view, BGSKeywordForm * keywordForm); - -// Item Card Extensions -namespace scaleformExtend -{ - void CommonItemData(GFxValue* pFxVal, TESForm * pForm); - void StandardItemData(GFxValue* pFxVal, TESForm * pForm, InventoryEntryData * pEntry = NULL); - void MagicItemData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); - void ActorData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); - void FormListData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); - void MiscData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); - void FormData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); - void InventoryData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * objDesc); - - void ItemInfoData(GFxValue* pFxVal, InventoryEntryData * pEntry); - - void CraftDisenchantData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * pEntry); - void AlchemyCategoryArgs(AlchemyEffectCategory* effectArray, GFxValue * args, UInt32 numArgs); -}; diff --git a/source/fs.dll/skse64/skse64/ScaleformLoader.cpp b/source/fs.dll/skse64/skse64/ScaleformLoader.cpp deleted file mode 100644 index efb0c2dd..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformLoader.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "ScaleformLoader.h" - -#include "skse64_common/Relocation.h" - -GFxLoader * GFxLoader::GetSingleton() -{ - // D73FE972523296E269125B9E6F076AD967D7970C+F9 - RelocPtr g_GFxLoader(0x02FC0DB8); - return *g_GFxLoader; -} diff --git a/source/fs.dll/skse64/skse64/ScaleformLoader.h b/source/fs.dll/skse64/skse64/ScaleformLoader.h deleted file mode 100644 index f2b68e82..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformLoader.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "skse64/ScaleformState.h" - -class NiTexture; -class IMenu; -class GImageInfoBase; - -class GFxImageLoader : public GFxState -{ -public: - virtual GImageInfoBase* LoadImage(const char * url) = 0; -}; - -class BSScaleformImageLoader : public GFxImageLoader -{ -public: - virtual ~BSScaleformImageLoader(); - virtual GImageInfoBase* LoadImage(const char * url); - - DEFINE_MEMBER_FN_1(AddVirtualImage, UInt8, 0x00F8E4C0, NiTexture ** texture); - DEFINE_MEMBER_FN_1(ReleaseVirtualImage, UInt8, 0x00F8E940, NiTexture ** texture); -}; - -class GFxLoader -{ -public: - UInt64 unk00; // 00 - GFxStateBag * stateBag; // 08 - UInt64 unk08; // 10 - UInt64 unk10; // 18 - BSScaleformImageLoader * imageLoader; // 20 - - static GFxLoader * GetSingleton(); - - MEMBER_FN_PREFIX(GFxLoader); - DEFINE_MEMBER_FN(ctor, GFxLoader *, 0x00F11530); - - DEFINE_MEMBER_FN(LoadMovie, bool, 0x00F11C60, IMenu* menu, GFxMovieView** viewOut, const char* name, int scaleMode, float backGroundAlpha); // probably in subclass -}; diff --git a/source/fs.dll/skse64/skse64/ScaleformMovie.cpp b/source/fs.dll/skse64/skse64/ScaleformMovie.cpp deleted file mode 100644 index d0f1864f..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformMovie.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "ScaleformMovie.h" diff --git a/source/fs.dll/skse64/skse64/ScaleformMovie.h b/source/fs.dll/skse64/skse64/ScaleformMovie.h deleted file mode 100644 index 1a41f460..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformMovie.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include "skse64/ScaleformTypes.h" - -class GFxValue; -class GFxFunctionHandler; - -class GFxMovieView : public GRefCountBase -{ -public: - GFxMovieView(); - virtual ~GFxMovieView(); - - enum ScaleModeType - { - kNoScale, // The size of SWF content is fixed - kShowAll, // Makes the entire SWF content visible in the viewport without distortion while maintaining the original aspect ratio - kExactFit, // Makes the entire SWF content visible in the viewport without trying to preserve the original aspect ratio - kNoBorder // Scales the SWF content to fill whole viewport area, without distortion but possibly with some cropping while maintaining original aspect ratio - }; - - virtual UInt32 Unk_01(void); - virtual UInt32 Unk_02(void); - virtual UInt32 Unk_03(void); - virtual void GotoFrame(UInt32 idx); - virtual bool GotoLabeledFrame(const char * label, UInt32 unk); - virtual void SetPause(UInt32 pause); - virtual UInt32 GetPause(void); - virtual void Unk_08(UInt32 unk); - virtual UInt32 Unk_09(void); - virtual bool Unk_0A(void); - virtual void CreateString(GFxValue * value, const char * str); - virtual void CreateWideString(GFxValue * value, const wchar_t * str); - virtual void CreateObject(GFxValue * value, const char * className = NULL, GFxValue * args = NULL, UInt32 numArgs = 0); - virtual void CreateArray(GFxValue * value); - virtual void CreateFunction(GFxValue * value, GFxFunctionHandler * callback, void * refcon = NULL); - virtual void SetVariable(const char * name, GFxValue * value, UInt32 flags); - virtual bool GetVariable(GFxValue * value, const char * name); - virtual bool SetArray(UInt32 type, const char * name, UInt32 offset, void * buf, UInt32 len, UInt32 flags); - virtual bool ResizeArray(const char * name, UInt32 len, UInt32 flags); - virtual UInt32 GetArrayLen(const char * name); // 050 - virtual bool GetArray(UInt32 type, const char * name, UInt32 offset, void * buf, UInt32 len); - virtual bool Invoke(const char * name, GFxValue * result, GFxValue * args, UInt32 numArgs); - virtual bool Invoke(const char * name, GFxValue * result, const char * fmt, ...); - virtual bool Invoke_v(const char * name, GFxValue * result, const char * fmt, va_list args); // 060 - virtual void SetViewport(const GViewport & viewDesc); - virtual void GetViewport(GViewport *pviewDesc) const; - virtual void Unk_1B(UInt32 unk); // SE: 0D8 (Skyrim32: 06C) - virtual void Unk_1C(void); // 070 - virtual void Unk_1D(void); - virtual void Unk_1E(void); - virtual GRectF GetVisibleFrameRect(void); - virtual void Unk_20(void); // 080 - virtual void Unk_21(void); - virtual void Unk_22(void); - virtual void Unk_23(void); - virtual void Unk_24(void); // 090 - virtual void Unk_25(void); - virtual void Render(void); - virtual void Unk_27(void); - virtual void Unk_28(void); // 0A0 - virtual void Unk_29(void); - virtual void Unk_2A(void); - virtual void Unk_2B(void); - virtual void Unk_2C(void); // 0B0 - virtual UInt32 HandleEvent(void* data); - virtual void Unk_2E(void); - virtual void Unk_2F(void); - virtual void Unk_30(void); - virtual void Unk_31(void); - virtual void Unk_32(void); - virtual void Unk_33(void); - virtual void Unk_34(void); - virtual void Unk_35(void); - virtual void Unk_36(void); - virtual void Unk_37(void); - virtual void Unk_38(void); - virtual void Unk_39(void); - virtual void Unk_3A(void); - virtual void Unk_3B(void); - virtual void Unk_3C(void); - virtual void Unk_3D(void); - virtual void Unk_3E(void); - virtual void Unk_3F(void); - virtual void Unk_40(void); - virtual void Unk_41(void); - virtual void Unk_42(void); - virtual void Unk_43(void); - virtual void Unk_44(void); - virtual void ForceCollectGarbage(void); - // more -}; diff --git a/source/fs.dll/skse64/skse64/ScaleformState.cpp b/source/fs.dll/skse64/skse64/ScaleformState.cpp deleted file mode 100644 index bc7c5e2d..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformState.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "ScaleformState.h" -#include "skse64/GameAPI.h" - -RelocAddr BSScaleformTranslator::GetCachedString(0x00C50510); - -void SKSEGFxLogger::LogMessageVarg(UInt32 messageType, const char* fmt, va_list args) -{ - gLog.Log(IDebugLog::kLevel_Message, fmt, args); -} diff --git a/source/fs.dll/skse64/skse64/ScaleformState.h b/source/fs.dll/skse64/skse64/ScaleformState.h deleted file mode 100644 index 06a98341..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformState.h +++ /dev/null @@ -1,126 +0,0 @@ -#pragma once - -#include "skse64/ScaleformTypes.h" -#include "skse64/GameTypes.h" -#include "skse64/GameUtilities.h" - -class GFxState : public GRefCountBase -{ -public: - enum - { - kInterface_None = 0x00, - kInterface_Translator = 0x03, - kInterface_Log = 0x04, - kInterface_ImageLoader = 0x05, - kInterface_External = 0x09, - kInterface_FileOpener = 0x0A, - kInterface_ZlibSupport = 0x1E, - }; - - UInt32 interfaceType; // 08 -}; - -class GFxLogBase -{ -public: - virtual ~GFxLogBase () { } - - virtual bool IsVerboseActionErrors() const { return true; } -}; - -class SKSEGFxLogger : public GFxState, public GFxLogBase -{ -public: - SKSEGFxLogger() : GFxState() { interfaceType = kInterface_Log; } - virtual ~SKSEGFxLogger () { } - - enum - { - Log_Channel_General = 0x10, - Log_Channel_Script = 0x20, - Log_Channel_Parse = 0x30, - Log_Channel_Action = 0x40, - Log_Channel_Debug = 0x50, - Log_Channel_Mask = 0xF0, - Log_MessageType_Error = 0, - Log_MessageType_Warning = 1, - Log_MessageType_Message = 2, - Log_Error = Log_Channel_General | Log_MessageType_Error, - Log_Warning = Log_Channel_General | Log_MessageType_Warning, - Log_Message = Log_Channel_General | Log_MessageType_Message, - Log_ScriptError = Log_Channel_Script | Log_MessageType_Error, - Log_ScriptWarning = Log_Channel_Script | Log_MessageType_Warning, - Log_ScriptMessage = Log_Channel_Script | Log_MessageType_Message, - Log_Parse = Log_Channel_Parse | 0, - Log_ParseShape = Log_Channel_Parse | 1, - Log_ParseMorphShape = Log_Channel_Parse | 2, - Log_ParseAction = Log_Channel_Parse | 3, - Log_Action = Log_Channel_Action | 0 - - }; - - virtual void LogMessageVarg(UInt32 messageType, const char* pfmt, va_list argList); -}; - -// 08 -class TranslationTableItem -{ -public: - wchar_t * key; - wchar_t * translation; - - TranslationTableItem(wchar_t * a_key, wchar_t * a_translation) - : key(a_key), translation(a_translation) {} - - bool operator==(const TranslationTableItem & rhs) const { return key == rhs.key; } - bool operator==(const wchar_t * a_key) const { return key == a_key; } - operator const wchar_t *() const { return key; } - - static inline UInt32 GetHash(const wchar_t ** key) - { - UInt32 hash; - CalculateCRC32_64(&hash, (UInt64)*key); - return hash; - } - - void Dump(void) - { - _MESSAGE("\t\tkey: %S ", key); - _MESSAGE("\t\ttranslation: %S", translation); - } -}; - -typedef tHashSet TranslationTable; - -// These are incomplete and only decoded to get the translation table yet. -class BSScaleformTranslator -{ - UInt64 unk_000; - UInt64 unk_008; - UInt64 unk_010; - UInt64 unk_018; - -public: - // SE note: by the looks of the disassembler -in the call to F266F0(1.4.2)- , it may look like the address of translations is 0x28 - // But the call is done on offset 8 of translations. Correct address is 0x20. - TranslationTable translations; // 020 - - typedef void (* _GetCachedString)(wchar_t ** pOut, wchar_t * bufIn, UInt32 unused); - static RelocAddr<_GetCachedString> GetCachedString; -}; -STATIC_ASSERT(offsetof(BSScaleformTranslator, translations) == 0x20); - -class GFxStateBag -{ -protected: - virtual GFxStateBag * GetStateBagImpl(void); - -public: - virtual ~GFxStateBag(); - virtual void SetState(UInt32 type, void * ptr); - virtual void * GetStateAddRef(UInt32 type); - //more - - inline BSScaleformTranslator * GetTranslator() { return (BSScaleformTranslator*)GetStateAddRef(GFxState::kInterface_Translator); } -}; diff --git a/source/fs.dll/skse64/skse64/ScaleformTypes.cpp b/source/fs.dll/skse64/skse64/ScaleformTypes.cpp deleted file mode 100644 index bfb13a49..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformTypes.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "ScaleformTypes.h" -#include "ScaleformAPI.h" - -GString::Data * GString::GetData(void) -{ - return (Data *)(data.heapInfo & ~kHeapInfoMask); -} - -UInt32 GString::GetHeapInfo(void) -{ - return data.heapInfo & kHeapInfoMask; -} - -void GString::Destroy(void) -{ - GString::Data * data = GetData(); - - data->Release(); -} - -void GString::Data::IncRef(void) -{ - InterlockedExchangeAdd(&refCount, 1); -} - -void GString::Data::Release(void) -{ - SInt32 oldRefCount = InterlockedExchangeAdd(&refCount, -1); // decref - - // all references gone? - if(oldRefCount == 1) - { - ScaleformHeap_Free(this); - } -} diff --git a/source/fs.dll/skse64/skse64/ScaleformTypes.h b/source/fs.dll/skse64/skse64/ScaleformTypes.h deleted file mode 100644 index df83401b..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformTypes.h +++ /dev/null @@ -1,198 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "skse64/ScaleformAPI.h" - -// not sure why they nest it like this, but whatever -class GRefCountImplCore -{ -public: - GRefCountImplCore() :refCount(1) { } - virtual ~GRefCountImplCore() { } - -// void ** _vtbl; // 00 - volatile SInt32 refCount; // 04 - - // redirect new/delete to the scaleform heap - static void * operator new(std::size_t size) - { - return ScaleformHeap_Allocate(size); - } - - static void * operator new(std::size_t size, const std::nothrow_t &) - { - return ScaleformHeap_Allocate(size); - } - - // placement new - static void * operator new(std::size_t size, void * ptr) - { - return ptr; - } - - static void operator delete(void * ptr) - { - ScaleformHeap_Free(ptr); - } - - // placement delete - static void operator delete(void *, void *) - { - // - } - - void AddRef(void) - { - InterlockedIncrement(&refCount); - } - - void Release(void) - { - if(InterlockedDecrement(&refCount) == 0) - { - delete this; - } - } -}; - -class GRefCountImpl : public GRefCountImplCore -{ -public: - GRefCountImpl() { } - virtual ~GRefCountImpl() { } -}; - -class GRefCountBaseStatImpl : public GRefCountImpl -{ -public: - GRefCountBaseStatImpl() { } - virtual ~GRefCountBaseStatImpl() { } -}; - -class GRefCountBase : public GRefCountBaseStatImpl -{ -public: - GRefCountBase() { } - virtual ~GRefCountBase() { } -}; - -#pragma warning (push) -#pragma warning (disable : 4200) - -class GString -{ -public: - GString() { } - GString(const char * string) { CALL_MEMBER_FN(this, ctor)(string); } - ~GString() { } - - enum - { - kHeapInfoMask = 3, - }; - - struct Data - { - UInt32 len; - SInt32 refCount; - char data[0]; - - void IncRef(void); - void Release(void); - }; - - union - { - Data * ptr; // do not use directly, clear lower 3 bits first - UInt32 heapInfo; - } data; - - Data * GetData(void); - UInt32 GetHeapInfo(void); - - void Destroy(void); - - MEMBER_FN_PREFIX(GString); - DEFINE_MEMBER_FN(ctor, GString *, 0x00F1BB50, const char * string); - -}; - -#pragma warning (pop) - -template -class GRect -{ -public: - T left; - T top; - T right; - T bottom; -}; - -class GMatrix3D -{ -public: - float m[4][4]; -}; - -typedef GRect GRectF; - -template -class GArray -{ -public: - T * values; // 00 - UInt64 size; // 08 - UInt64 capacity; // 10 -}; - -class GViewport -{ -public: - enum - { - kFlags_IsRenderTexture = 1 << 0, - kFlags_AlphaComposite = 1 << 1, - kFlags_UseScissorRect = 1 << 2, - kFlags_NoSetState = 1 << 3, - kFlags_RenderTextureAlpha = kFlags_IsRenderTexture|kFlags_AlphaComposite - }; - - SInt32 bufferWidth; - SInt32 bufferHeight; - SInt32 left; - SInt32 top; - SInt32 width; - SInt32 height; - SInt32 scissorLeft; - SInt32 scissorTop; - SInt32 scissorWidth; - SInt32 scissorHeight; - float scale; - float aspectRatio; - UInt32 flags; -}; - -class GSysAllocBase -{ -public: - virtual ~GSysAllocBase(); - - virtual void Unk_01(void); - virtual void Unk_02(void); -}; - -class GSysAlloc : public GSysAllocBase -{ -public: - virtual ~GSysAlloc(); -}; - -class ScaleformAllocator : public GSysAlloc -{ -public: - virtual ~ScaleformAllocator(); - - virtual void Unk_03(void); - virtual void Unk_04(void); -}; diff --git a/source/fs.dll/skse64/skse64/ScaleformVM.cpp b/source/fs.dll/skse64/skse64/ScaleformVM.cpp deleted file mode 100644 index bea325d1..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformVM.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "ScaleformVM.h" diff --git a/source/fs.dll/skse64/skse64/ScaleformVM.h b/source/fs.dll/skse64/skse64/ScaleformVM.h deleted file mode 100644 index 39e9b347..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformVM.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "skse64/ScaleformTypes.h" diff --git a/source/fs.dll/skse64/skse64/ScaleformValue.cpp b/source/fs.dll/skse64/skse64/ScaleformValue.cpp deleted file mode 100644 index 7a676c9a..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformValue.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "skse64/ScaleformValue.h" - -GFxValue::~GFxValue() -{ - CleanManaged(); -} - -void GFxValue::AddManaged(void) -{ - if (IsManaged()) - objectInterface->AddManaged_Internal(this, data.obj); -} - -void GFxValue::CleanManaged(void) -{ - if (IsManaged()) - { - objectInterface->ReleaseManaged_Internal(this, data.obj); - - objectInterface = NULL; - type = kType_Undefined; - } -} - -void GFxValue::SetUndefined(void) -{ - CleanManaged(); - - type = kType_Undefined; -} - -void GFxValue::SetNull(void) -{ - CleanManaged(); - - type = kType_Null; -} - -void GFxValue::SetBool(bool value) -{ - CleanManaged(); - - type = kType_Bool; - data.boolean = value; -} - -void GFxValue::SetNumber(double value) -{ - CleanManaged(); - - type = kType_Number; - data.number = value; -} - -void GFxValue::SetString(const char * value) -{ - CleanManaged(); - - type = kType_String; - data.string = value; -} - -void GFxValue::SetWideString(const wchar_t * value) -{ - CleanManaged(); - - type = kType_WideString; - data.wideString = value; -} - -bool GFxValue::GetBool(void) const -{ - switch (GetType()) - { - case kType_Bool: return data.boolean; - case kType_Number: return data.number != 0; - default: HALT("GFxValue::GetBool: bad type"); return false; - } -} - -const char * GFxValue::GetString(void) const -{ - if (GetType() != kType_String) - return NULL; - - if (IsManaged()) - return *data.managedString; - else - return data.string; -} - -const wchar_t * GFxValue::GetWideString(void) const -{ - if (GetType() != kType_WideString) - return NULL; - - if (IsManaged()) - return *data.managedWideString; - else - return data.wideString; -} - -double GFxValue::GetNumber(void) const -{ - switch (GetType()) - { - case kType_Number: return data.number; - case kType_Bool: return data.boolean ? 1 : 0; - default: HALT("GFxValue::GetNumber: bad type"); return 0; - } -} - -bool GFxValue::HasMember(const char * name) -{ - return objectInterface->HasMember(data.obj, name, IsDisplayObject()); -} - -bool GFxValue::SetMember(const char * name, GFxValue * value) -{ - return objectInterface->SetMember(data.obj, name, value, IsDisplayObject()); -} - -bool GFxValue::GetMember(const char * name, GFxValue * value) -{ - return objectInterface->GetMember(data.obj, name, value, IsDisplayObject()); -} - -bool GFxValue::DeleteMember(const char * name) -{ - return objectInterface->DeleteMember(data.obj, name, IsDisplayObject()); -} - -bool GFxValue::Invoke(const char * name, GFxValue * result, GFxValue * args, UInt32 numArgs) -{ - return objectInterface->Invoke(data.obj, result, name, args, numArgs, IsDisplayObject()); -} - -bool GFxValue::PushBack(GFxValue * value) -{ - return objectInterface->PushBack(data.obj, value); -} - -UInt32 GFxValue::GetArraySize() -{ - return objectInterface->GetArraySize(data.obj); -} - -bool GFxValue::GetElement(UInt32 index, GFxValue * value) -{ - return objectInterface->GetElement(data.obj, index, value); -} - -bool GFxValue::GetDisplayInfo(DisplayInfo * displayInfo) -{ - return objectInterface->GetDisplayInfo(data.obj, displayInfo); -} - -bool GFxValue::SetDisplayInfo(DisplayInfo * displayInfo) -{ - return objectInterface->SetDisplayInfo(data.obj, displayInfo); -} - -bool GFxValue::SetText(const char * text, bool html) -{ - return objectInterface->SetText(data.obj, text, html); -} diff --git a/source/fs.dll/skse64/skse64/ScaleformValue.h b/source/fs.dll/skse64/skse64/ScaleformValue.h deleted file mode 100644 index 150a1a4f..00000000 --- a/source/fs.dll/skse64/skse64/ScaleformValue.h +++ /dev/null @@ -1,186 +0,0 @@ -#pragma once - -#include "skse64/ScaleformTypes.h" -#include "skse64_common/Utilities.h" - -class GFxMovieRoot; - -// 10 -class GFxValue -{ -public: - GFxValue() - :objectInterface(NULL), type(kType_Undefined) { } - ~GFxValue(); - - enum - { - kType_Undefined = 0, - kType_Null, - kType_Bool, - kType_Number, - kType_String, - kType_WideString, - kType_Object, - kType_Array, - kType_DisplayObject, - - kTypeFlag_Managed = 1 << 6, - - kMask_Type = 0x8F, // not sure why it checks the top bit - }; - - union Data - { - double number; - bool boolean; - const char * string; - const char ** managedString; - const wchar_t * wideString; - const wchar_t ** managedWideString; - void * obj; - }; - - //#pragma pack (push, 8) - class DisplayInfo - { - public: - DisplayInfo() : _varsSet(0) {} - enum - { - kChange_x = (1 << 0), - kChange_y = (1 << 1), - kChange_rotation = (1 << 2), - kChange_xscale = (1 << 3), - kChange_yscale = (1 << 4), - kChange_alpha = (1 << 5), - kChange_visible = (1 << 6), - kChange_z = (1 << 7), - kChange_xrotation = (1 << 8), - kChange_yrotation = (1 << 9), - kChange_zscale = (1 << 10), - kChange_FOV = (1 << 11), - kChange_projMatrix3D = (1 << 12), - kChange_viewMatrix3D = (1 << 13) - }; - - double _x; - double _y; - double _rotation; - double _xScale; - double _yScale; - double _alpha; - bool _visible; - double _z; - double _xRotation; - double _yRotation; - double _zScale; - double _perspFOV; - GMatrix3D _viewMatrix3D; - GMatrix3D _perspectiveMatrix3D; - UInt16 _varsSet; - - void SetX(double x) { SetFlags(kChange_x); _x = x; } - void SetY(double y) { SetFlags(kChange_y); _y = y; } - void SetRotation(double degrees) { SetFlags(kChange_rotation); _rotation = degrees; } - void SetXScale(double xscale) { SetFlags(kChange_xscale); _xScale = xscale; } - void SetYScale(double yscale) { SetFlags(kChange_yscale); _yScale = yscale; } - void SetAlpha(double alpha) { SetFlags(kChange_alpha); _alpha = alpha; } - void SetVisible(bool visible) { SetFlags(kChange_visible); _visible = visible; } - void SetZ(double z) { SetFlags(kChange_z); _z = z; } - void SetXRotation(double degrees) { SetFlags(kChange_xrotation); _xRotation = degrees; } - void SetYRotation(double degrees) { SetFlags(kChange_yrotation); _yRotation = degrees; } - void SetZScale(double zscale) { SetFlags(kChange_zscale); _zScale = zscale; } - void SetFOV(double fov) { SetFlags(kChange_FOV); _perspFOV = fov; } - void SetProjectionMatrix3D(const GMatrix3D *pmat) - { - if (pmat) { - SetFlags(kChange_projMatrix3D); - _perspectiveMatrix3D = *pmat; - } - else - ClearFlags(kChange_projMatrix3D); - } - void SetViewMatrix3D(const GMatrix3D *pmat) - { - if (pmat) { - SetFlags(kChange_viewMatrix3D); - _viewMatrix3D = *pmat; - } - else - ClearFlags(kChange_viewMatrix3D); - } - - // Convenience functions - void SetPosition(double x, double y) { SetFlags(kChange_x | kChange_y); _x = x; _y = y; } - void SetScale(double xscale, double yscale) { SetFlags(kChange_xscale | kChange_yscale); _xScale = xscale; _yScale = yscale; } - - void SetFlags(UInt32 flags) { _varsSet |= flags; } - void ClearFlags(UInt32 flags) { _varsSet &= ~flags; } - }; - //#pragma pack (pop) - - // 4 - class ObjectInterface - { - public: - GFxMovieRoot * root; - - DEFINE_MEMBER_FN_3(HasMember, bool, 0x00F0DBC0, void * obj, const char * name, bool isDisplayObj); - DEFINE_MEMBER_FN_4(SetMember, bool, 0x00F10020, void * obj, const char * name, GFxValue * value, bool isDisplayObj); - DEFINE_MEMBER_FN_3(DeleteMember, bool, 0x00F0CAA0, void * obj, const char * name, bool isDisplayObj); - DEFINE_MEMBER_FN_4(GetMember, bool, 0x00F0D710, void * obj, const char * name, GFxValue * value, bool isDisplayObj); - DEFINE_MEMBER_FN_6(Invoke, bool, 0x00F0DE30, void * obj, GFxValue * result, const char * name, GFxValue * args, UInt32 numArgs, bool isDisplayObj); - DEFINE_MEMBER_FN_6(AttachMovie, bool, 0x00F0B870, void * obj, GFxValue * value, const char * symbolName, const char * instanceName, SInt32 depth, void * initArgs); - DEFINE_MEMBER_FN_2(PushBack, bool, 0x00F0E780, void * obj, GFxValue * value); - DEFINE_MEMBER_FN_3(SetText, bool, 0x00F10120, void * obj, const char * text, bool html); - //DEFINE_MEMBER_FN(PopBack, bool, 0x00000000, void * obj, GFxValue * value); - DEFINE_MEMBER_FN_1(GetArraySize, UInt32, 0x00F0D170, void * obj); - //DEFINE_MEMBER_FN(SetArraySize, bool, 0x00000000, void * obj, UInt32 size); - DEFINE_MEMBER_FN_3(GetElement, bool, 0x00F0D4F0, void * obj, UInt32 index, GFxValue * value); - //DEFINE_MEMBER_FN(SetElement, bool, 0x00000000, void * obj, UInt32 index, GFxValue * value); - DEFINE_MEMBER_FN_3(GotoLabeledFrame, bool, 0x00F0DB20, void * obj, const char * frameLabel, bool stop); - //DEFINE_MEMBER_FN(GotoFrame, bool, 0x00000000, void * obj, UInt32 frameNumber, bool stop); - DEFINE_MEMBER_FN_2(GetDisplayInfo, bool, 0x00F0D1D0, void * obj, DisplayInfo * displayInfo); - DEFINE_MEMBER_FN_2(SetDisplayInfo, bool, 0x00F0F000, void * obj, DisplayInfo * displayInfo); - - DEFINE_MEMBER_FN_2(AddManaged_Internal, void, 0x00F0E500, GFxValue * value, void * obj); - DEFINE_MEMBER_FN_2(ReleaseManaged_Internal, void, 0x00F0E560, GFxValue * value, void * obj); - }; - - ObjectInterface * objectInterface; // 00 - UInt32 type; // 08 - Data data; // 10 - - UInt32 GetType(void) const { return type & kMask_Type; } - bool IsManaged(void) const { return (type & kTypeFlag_Managed) != 0; } - void CleanManaged(void); - void AddManaged(void); - - bool IsObject(void) const { return GetType() == kType_Object; } - bool IsDisplayObject(void) const { return GetType() == kType_DisplayObject; } - - bool GetBool(void) const; - const char * GetString(void) const; - const wchar_t * GetWideString(void) const; - double GetNumber(void) const; - - void SetUndefined(void); - void SetNull(void); - void SetBool(bool value); - void SetNumber(double value); - void SetString(const char * value); - void SetWideString(const wchar_t * value); - - UInt32 GetArraySize(); - bool GetElement(UInt32 index, GFxValue * value); - bool HasMember(const char * name); - bool SetMember(const char * name, GFxValue * value); - bool GetMember(const char * name, GFxValue * value); - bool DeleteMember(const char * name); - bool Invoke(const char * name, GFxValue * result, GFxValue * args, UInt32 numArgs); - bool PushBack(GFxValue * value); - bool GetDisplayInfo(DisplayInfo * displayInfo); - bool SetDisplayInfo(DisplayInfo * displayInfo); - bool SetText(const char * text, bool html); -}; diff --git a/source/fs.dll/skse64/skse64/Serialization.cpp b/source/fs.dll/skse64/skse64/Serialization.cpp deleted file mode 100644 index 51048f3a..00000000 --- a/source/fs.dll/skse64/skse64/Serialization.cpp +++ /dev/null @@ -1,716 +0,0 @@ -#include "skse64/Serialization.h" -#include "common/IFileStream.h" -#include "skse64/PluginManager.h" -#include "GameAPI.h" -#include "skse64_common/skse_version.h" -#include -#include -#include "GameData.h" -#include "skse64/InternalSerialization.h" -#include "skse64/GameSettings.h" -#include "skse64/ScaleformCallbacks.h" - -namespace Serialization -{ - const char * kSavegamePath = "\\My Games\\Skyrim Special Edition\\"; - - // file format internals - - // general format: - // Header header - // PluginHeader plugin[header.numPlugins] - // ChunkHeader chunk[plugin.numChunks] - // UInt8 data[chunk.length] - - struct Header - { - enum - { - kSignature = MACRO_SWAP32('SKSE'), // endian-swapping so the order matches - kVersion = 1, - - kVersion_Invalid = 0 - }; - - UInt32 signature; - UInt32 formatVersion; - UInt32 skseVersion; - UInt32 runtimeVersion; - UInt32 numPlugins; - }; - - struct PluginHeader - { - UInt32 signature; - UInt32 numChunks; - UInt32 length; // length of following data including ChunkHeader - }; - - struct ChunkHeader - { - UInt32 type; - UInt32 version; - UInt32 length; - }; - - // locals - - std::string s_savePath; - IFileStream s_currentFile; - - typedef std::vector PluginCallbackList; - PluginCallbackList s_pluginCallbacks; - - PluginHandle s_currentPlugin = 0; - - Header s_fileHeader = { 0 }; - - UInt64 s_pluginHeaderOffset = 0; - PluginHeader s_pluginHeader = { 0 }; - - bool s_chunkOpen = false; - UInt64 s_chunkHeaderOffset = 0; - ChunkHeader s_chunkHeader = { 0 }; - - // utilities - - // make full path from save name - std::string MakeSavePath(std::string name, const char * extension) - { - char path[MAX_PATH]; - ASSERT(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, path))); - - std::string result = path; - result += kSavegamePath; - Setting* localSavePath = GetINISetting("sLocalSavePath:General"); - if(localSavePath && (localSavePath->GetType() == Setting::kType_String)) - result += localSavePath->data.s; - else - result += "Saves\\"; - - result += "\\"; - result += name; - if (extension) - result += extension; - return result; - } - - PluginCallbacks * GetPluginInfo(PluginHandle plugin) - { - if(plugin >= s_pluginCallbacks.size()) - s_pluginCallbacks.resize(plugin + 1); - - return &s_pluginCallbacks[plugin]; - } - - // plugin API - void SetUniqueID(PluginHandle plugin, UInt32 uid) - { - // check existing plugins - for(PluginCallbackList::iterator iter = s_pluginCallbacks.begin(); iter != s_pluginCallbacks.end(); ++iter) - { - if(iter->hadUID && (iter->uid == uid)) - { - UInt32 collidingID = iter - s_pluginCallbacks.begin(); - - _ERROR("plugin serialization UID collision (uid = %08X, plugins = %d %d)", plugin, uid, collidingID); - } - } - - PluginCallbacks * info = GetPluginInfo(plugin); - - ASSERT(!info->hadUID); - - info->uid = uid; - info->hadUID = true; - } - - void SetRevertCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback) - { - GetPluginInfo(plugin)->revert = callback; - } - - void SetSaveCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback) - { - GetPluginInfo(plugin)->save = callback; - } - - void SetLoadCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback) - { - GetPluginInfo(plugin)->load = callback; - } - - void SetFormDeleteCallback(PluginHandle plugin, SKSESerializationInterface::FormDeleteCallback callback) - { - GetPluginInfo(plugin)->formDelete = callback; - } - - void SetSaveName(const char * name) - { - if(name) - { - std::string save_name(name); - - if (save_name.length() >= 4 && _stricmp(name+save_name.length()-4, ".ess") == 0) - save_name = save_name.substr(0, save_name.length() - 4); - - _MESSAGE("save name is %s", save_name.c_str()); - s_savePath = MakeSavePath(save_name, ".skse"); - _MESSAGE("full save path: %s", s_savePath.c_str()); - } - else - { - _MESSAGE("cleared save path"); - s_savePath.clear(); - } - } - - bool WriteRecord(UInt32 type, UInt32 version, const void * buf, UInt32 length) - { - if(!OpenRecord(type, version)) - return false; - - return WriteRecordData(buf, length); - } - - // flush a chunk header to the file if one is currently open - static void FlushWriteChunk(void) - { - if(!s_chunkOpen) - return; - - UInt64 curOffset = s_currentFile.GetOffset(); - UInt64 chunkSize = curOffset - s_chunkHeaderOffset - sizeof(s_chunkHeader); - - ASSERT(chunkSize < 0x80000000); // stupidity check - - s_chunkHeader.length = (UInt32)chunkSize; - - s_currentFile.SetOffset(s_chunkHeaderOffset); - s_currentFile.WriteBuf(&s_chunkHeader, sizeof(s_chunkHeader)); - - s_currentFile.SetOffset(curOffset); - - s_pluginHeader.length += chunkSize + sizeof(s_chunkHeader); - - s_chunkOpen = false; - } - - bool OpenRecord(UInt32 type, UInt32 version) - { - if(!s_pluginHeader.numChunks) - { - ASSERT(!s_chunkOpen); - - s_pluginHeaderOffset = s_currentFile.GetOffset(); - s_currentFile.Skip(sizeof(s_pluginHeader)); - } - - FlushWriteChunk(); - - s_chunkHeaderOffset = s_currentFile.GetOffset(); - s_currentFile.Skip(sizeof(s_chunkHeader)); - - s_pluginHeader.numChunks++; - - s_chunkHeader.type = type; - s_chunkHeader.version = version; - s_chunkHeader.length = 0; - - s_chunkOpen = true; - - return true; - } - - bool WriteRecordData(const void * buf, UInt32 length) - { - s_currentFile.WriteBuf(buf, length); - - return true; - } - - static void FlushReadRecord(void) - { - if(s_chunkOpen) - { - if(s_chunkHeader.length) - { - // _WARNING("plugin didn't finish reading chunk"); - s_currentFile.Skip(s_chunkHeader.length); - } - - s_chunkOpen = false; - } - } - - bool GetNextRecordInfo(UInt32 * type, UInt32 * version, UInt32 * length) - { - FlushReadRecord(); - - if(!s_pluginHeader.numChunks) - return false; - - s_pluginHeader.numChunks--; - - s_currentFile.ReadBuf(&s_chunkHeader, sizeof(s_chunkHeader)); - - *type = s_chunkHeader.type; - *version = s_chunkHeader.version; - *length = s_chunkHeader.length; - - s_chunkOpen = true; - - return true; - } - - UInt32 ReadRecordData(void * buf, UInt32 length) - { - ASSERT(s_chunkOpen); - - if(length > s_chunkHeader.length) - length = s_chunkHeader.length; - - s_currentFile.ReadBuf(buf, length); - - s_chunkHeader.length -= length; - - return length; - } - - bool ResolveFormId(UInt32 formId, UInt32 * formIdOut) - { - UInt32 modID = formId >> 24; - if (modID == 0xFF) - { - *formIdOut = formId; - return true; - } - - if (modID == 0xFE) - { - modID = formId >> 12; - } - - UInt32 loadedModID = ResolveModIndex(modID); - if (loadedModID < 0xFF) - { - *formIdOut = (formId & 0x00FFFFFF) | (((UInt32)loadedModID) << 24); - return true; - } - else if (loadedModID > 0xFF) - { - *formIdOut = (loadedModID << 12) | (formId & 0x00000FFF); - return true; - } - return false; - } - - bool ResolveHandle(UInt64 handle, UInt64 * handleOut) - { - UInt32 modID = (handle & 0xFF000000) >> 24; - if (modID == 0xFF) - { - *handleOut = handle; - return true; - } - - if (modID == 0xFE) - { - modID = (handle >> 12) & 0xFFFFF; - } - - UInt64 loadedModID = (UInt64)ResolveModIndex(modID); - if (loadedModID < 0xFF) - { - *handleOut = (handle & 0xFFFFFFFF00FFFFFF) | (((UInt64)loadedModID) << 24); - return true; - } - else if (loadedModID > 0xFF) - { - *handleOut = (handle & 0xFFFFFFFF00000FFF) | (loadedModID << 12); - return true; - } - return false; - } - - // internal event handlers - void HandleRevertGlobalData(void) - { - for(UInt32 i = 0; i < s_pluginCallbacks.size(); i++) - if(s_pluginCallbacks[i].revert) - s_pluginCallbacks[i].revert(&g_SKSESerializationInterface); - } - - void HandleSaveGlobalData(void) - { - _MESSAGE("creating co-save"); - - DeleteFile(s_savePath.c_str()); - - if(!s_currentFile.Create(s_savePath.c_str())) - { - _ERROR("HandleSaveGlobalData: couldn't create save file (%s)", s_savePath.c_str()); - return; - } - - try - { - // init header - s_fileHeader.signature = Header::kSignature; - s_fileHeader.formatVersion = Header::kVersion; - s_fileHeader.skseVersion = PACKED_SKSE_VERSION; - s_fileHeader.runtimeVersion = RUNTIME_VERSION; - s_fileHeader.numPlugins = 0; - - s_currentFile.Skip(sizeof(s_fileHeader)); - - // iterate through plugins - for(UInt32 i = 0; i < s_pluginCallbacks.size(); i++) - { - PluginCallbacks * info = &s_pluginCallbacks[i]; - - if(info->save && info->hadUID) - { - // set up header info - s_currentPlugin = i; - - s_pluginHeader.signature = info->uid; - s_pluginHeader.numChunks = 0; - s_pluginHeader.length = 0; - - s_chunkOpen = false; - - // call the plugin - try - { - info->save(&g_SKSESerializationInterface); - } - catch( ... ) - { - _ERROR("HandleSaveGlobalData: exception occurred saving %08X at %016I64X data may be corrupt.", s_pluginHeader.signature, s_currentFile.GetOffset()); - } - - // flush the remaining chunk data - FlushWriteChunk(); - - if(s_pluginHeader.numChunks) - { - UInt64 curOffset = s_currentFile.GetOffset(); - - s_currentFile.SetOffset(s_pluginHeaderOffset); - s_currentFile.WriteBuf(&s_pluginHeader, sizeof(s_pluginHeader)); - - s_currentFile.SetOffset(curOffset); - - s_fileHeader.numPlugins++; - } - } - } - - // write header - s_currentFile.SetOffset(0); - s_currentFile.WriteBuf(&s_fileHeader, sizeof(s_fileHeader)); - } - catch(...) - { - _ERROR("HandleSaveGame: exception during save"); - } - - s_currentFile.Close(); - } - - void HandleLoadGlobalData(void) - { - _MESSAGE("loading co-save"); - - if(!s_currentFile.Open(s_savePath.c_str())) - { - return; - } - - try - { - Header header; - - s_currentFile.ReadBuf(&header, sizeof(header)); - - if(header.signature != Header::kSignature) - { - _ERROR("HandleLoadGame: invalid file signature (found %08X expected %08X)", header.signature, Header::kSignature); - goto done; - } - - if(header.formatVersion <= Header::kVersion_Invalid) - { - _ERROR("HandleLoadGame: version invalid (%08X)", header.formatVersion); - goto done; - } - - if(header.formatVersion > Header::kVersion) - { - _ERROR("HandleLoadGame: version too new (found %08X current %08X)", header.formatVersion, Header::kVersion); - goto done; - } - - // reset flags - for(PluginCallbackList::iterator iter = s_pluginCallbacks.begin(); iter != s_pluginCallbacks.end(); ++iter) - iter->hadData = false; - - // iterate through plugin data chunks - while(s_currentFile.GetRemain() >= sizeof(PluginHeader)) - { - s_currentFile.ReadBuf(&s_pluginHeader, sizeof(s_pluginHeader)); - - UInt64 pluginChunkStart = s_currentFile.GetOffset(); - - UInt32 pluginIdx = kPluginHandle_Invalid; - - for(PluginCallbackList::iterator iter = s_pluginCallbacks.begin(); iter != s_pluginCallbacks.end(); ++iter) - if(iter->hadUID && (iter->uid == s_pluginHeader.signature)) - pluginIdx = iter - s_pluginCallbacks.begin(); - - try - { - if(pluginIdx != kPluginHandle_Invalid) - { - PluginCallbacks * info = &s_pluginCallbacks[pluginIdx]; - - info->hadData = true; - - if(info->load) - { - s_chunkOpen = false; - info->load(&g_SKSESerializationInterface); - } - } - else - { - _WARNING("HandleLoadGame: plugin with signature %08X not loaded", s_pluginHeader.signature); - } - } - catch( ... ) - { - _ERROR("HandleLoadGame: exception occurred loading %08X", s_pluginHeader.signature); - } - - // if plugin failed to read all its data or threw exception, jump to the next chunk - UInt64 expectedOffset = pluginChunkStart + s_pluginHeader.length; - if(s_currentFile.GetOffset() != expectedOffset) - { - _WARNING("HandleLoadGame: plugin did not read all of its data (at %016I64X expected %016I64X)", s_currentFile.GetOffset(), expectedOffset); - s_currentFile.SetOffset(expectedOffset); - } - } - - // call load on plugins that had no data - for(PluginCallbackList::iterator iter = s_pluginCallbacks.begin(); iter != s_pluginCallbacks.end(); ++iter) { - if(!iter->hadData && iter->load) { - iter->load(&g_SKSESerializationInterface); - } - } - } - catch(...) - { - _ERROR("HandleLoadGame: exception during load"); - - // ### this could be handled better, individually catch around each plugin so one plugin can't mess things up for everyone else - } - - done: - s_currentFile.Close(); - } - - void HandleDeleteSave(std::string saveName) - { - std::string savePath = MakeSavePath(saveName, NULL); - std::string coSavePath = savePath; - savePath += ".ess"; - coSavePath += ".skse"; - - // Old save file really gone? - IFileStream saveFile; - if (!saveFile.Open(savePath.c_str())) - { - _MESSAGE("deleting co-save %s", coSavePath.c_str()); - DeleteFile(coSavePath.c_str()); - } - else - { - _MESSAGE("skipped delete of co-save %s", coSavePath.c_str()); - } - } - - void HandleDeletedForm(UInt64 handle) - { - for(UInt32 i = 0; i < s_pluginCallbacks.size(); i++) - if(s_pluginCallbacks[i].formDelete) - s_pluginCallbacks[i].formDelete(handle); - } - - template <> - bool WriteData(SKSESerializationInterface * intfc, const BSFixedString * str) - { - return WriteData(intfc, str->data); - } - - template <> - bool ReadData(SKSESerializationInterface * intfc, BSFixedString * str) - { - char buf[257] = { 0 }; - UInt16 len = 0; - - if (! intfc->ReadRecordData(&len, sizeof(len))) - return false; - - if (len > 256) - return false; - - if (! intfc->ReadRecordData(buf, len)) - return false; - - *str = BSFixedString(buf); - return true; - } - - template <> - bool WriteData(SKSESerializationInterface * intfc, const std::string * str) - { - UInt16 len = str->length(); - if (len > 256) - return false; - - if (! intfc->WriteRecordData(&len, sizeof(len))) - return false; - if (! intfc->WriteRecordData(str->data(), len)) - return false; - return true; - } - - template <> - bool ReadData(SKSESerializationInterface * intfc, std::string * str) - { - char buf[257] = { 0 }; - UInt16 len = 0; - - if (! intfc->ReadRecordData(&len, sizeof(len))) - return false; - - if (len > 256) - return false; - - if (! intfc->ReadRecordData(buf, len)) - return false; - - *str = std::string(buf); - return true; - } - - template <> - bool WriteData(SKSESerializationInterface * intfc, const char* str) - { - UInt16 len = strlen(str); - if (len > 256) - return false; - - if (! intfc->WriteRecordData(&len, sizeof(len))) - return false; - if (! intfc->WriteRecordData(str, len)) - return false; - return true; - } - - template <> - bool WriteData(SKSESerializationInterface* intfc, const GFxValue* val) - { - UInt32 type = val->GetType(); - if (! WriteData(intfc, &type)) - return false; - - switch (type) - { - case GFxValue::kType_Bool: - { - bool t = val->GetBool(); - return WriteData(intfc, &t); - } - case GFxValue::kType_Number: - { - double t = val->GetNumber(); - return WriteData(intfc, &t); - } - case GFxValue::kType_String: - { - const char* t = val->GetString(); - return WriteData(intfc, &t); - } - default: - // Unsupported - return false; - } - - return false; - } - - template <> - bool ReadData(SKSESerializationInterface* intfc, GFxValue* val) - { - UInt32 type; - if (! ReadData(intfc, &type)) - return false; - - switch (type) - { - case GFxValue::kType_Bool: - { - bool t; - if (! ReadData(intfc, &t)) - return false; - val->SetBool(t); - return true; - } - case GFxValue::kType_Number: - { - double t; - if (! ReadData(intfc, &t)) - return false; - val->SetNumber(t); - return true; - } - case GFxValue::kType_String: - { - // As usual, using string cache to manage strings - BSFixedString t; - if (! ReadData(intfc, &t)) - return false; - val->SetString(t.data); - return true; - } - default: - // Unsupported - return false; - } - - return false; - } -} - -SKSESerializationInterface g_SKSESerializationInterface = -{ - SKSESerializationInterface::kVersion, - - Serialization::SetUniqueID, - - Serialization::SetRevertCallback, - Serialization::SetSaveCallback, - Serialization::SetLoadCallback, - Serialization::SetFormDeleteCallback, - - Serialization::WriteRecord, - Serialization::OpenRecord, - Serialization::WriteRecordData, - - Serialization::GetNextRecordInfo, - Serialization::ReadRecordData, - Serialization::ResolveHandle, - Serialization::ResolveFormId -}; diff --git a/source/fs.dll/skse64/skse64/Serialization.h b/source/fs.dll/skse64/skse64/Serialization.h deleted file mode 100644 index 5cc329b3..00000000 --- a/source/fs.dll/skse64/skse64/Serialization.h +++ /dev/null @@ -1,98 +0,0 @@ -#pragma once - -#include "skse64/PluginAPI.h" -#include "skse64/GameTypes.h" - -#include - -class GFxValue; - -extern SKSESerializationInterface g_SKSESerializationInterface; - -namespace Serialization -{ - struct PluginCallbacks - { - PluginCallbacks() - :revert(NULL) - ,save(NULL) - ,load(NULL) - ,formDelete(NULL) - ,uid(0) - ,hadData(false) - ,hadUID(false) { } - - SKSESerializationInterface::EventCallback revert; - SKSESerializationInterface::EventCallback save; - SKSESerializationInterface::EventCallback load; - SKSESerializationInterface::FormDeleteCallback formDelete; - - UInt32 uid; - - bool hadData; - bool hadUID; - }; - - // plugin API - void SetUniqueID(PluginHandle plugin, UInt32 uid); - void SetRevertCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback); - void SetSaveCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback); - void SetLoadCallback(PluginHandle plugin, SKSESerializationInterface::EventCallback callback); - void SetFormDeleteCallback(PluginHandle plugin, SKSESerializationInterface::FormDeleteCallback callback); - - void SetSaveName(const char * name); - bool WriteRecord(UInt32 type, UInt32 version, const void * buf, UInt32 length); - bool OpenRecord(UInt32 type, UInt32 version); - bool WriteRecordData(const void * buf, UInt32 length); - - bool GetNextRecordInfo(UInt32 * type, UInt32 * version, UInt32 * length); - UInt32 ReadRecordData(void * buf, UInt32 length); - - bool ResolveFormId(UInt32 formId, UInt32 * formIdOut); - bool ResolveHandle(UInt64 handle, UInt64 * handleOut); - - // internal event handlers - void HandleRevertGlobalData(void); - void HandleSaveGlobalData(void); - void HandleLoadGlobalData(void); - - void HandleDeleteSave(std::string saveName); - void HandleDeletedForm(UInt64 handle); - - // template helper functions - template - bool WriteData(SKSESerializationInterface * intfc, const T * data) - { - return intfc->WriteRecordData(data, sizeof(T)); - } - - template - bool ReadData(SKSESerializationInterface * intfc, T * data) - { - return intfc->ReadRecordData(data, sizeof(T)) > 0; - } - - template <> bool WriteData(SKSESerializationInterface * intfc, const BSFixedString * data); - template <> bool ReadData(SKSESerializationInterface * intfc, BSFixedString * data); - - template <> bool WriteData(SKSESerializationInterface * intfc, const std::string * data); - template <> bool ReadData(SKSESerializationInterface * intfc, std::string * data); - - // Note: Read would have to allocate somehow. You have to do that manually. - template <> bool WriteData(SKSESerializationInterface * intfc, const char* data); - - template <> - bool WriteData(SKSESerializationInterface* intfc, const GFxValue* val); - - template <> - bool ReadData(SKSESerializationInterface* intfc, GFxValue* val); - - template - bool SaveClassHelper(SKSESerializationInterface* intfc, UInt32 type, T& instance) - { - if (! intfc->OpenRecord(type, T::kSaveVersion)) - return false; - - return instance.Save(intfc); - } -} diff --git a/source/fs.dll/skse64/skse64/Translation.cpp b/source/fs.dll/skse64/skse64/Translation.cpp deleted file mode 100644 index 7b89e24f..00000000 --- a/source/fs.dll/skse64/skse64/Translation.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "Translation.h" - -#include "common/IFileStream.h" -#include -#include -#include "GameStreams.h" -#include "GameSettings.h" -#include "ScaleformState.h" - -namespace Translation -{ - void ParseTranslation(BSScaleformTranslator * translator, std::string & name) - { - Setting * setting = GetINISetting("sLanguage:General"); - std::string path = "Interface\\Translations\\"; - - // Construct translation filename - path += name; - path += "_"; - path += (setting && setting->GetType() == Setting::kType_String) ? setting->data.s : "ENGLISH"; - path += ".txt"; - - BSResourceNiBinaryStream fileStream(path.c_str()); - if(!fileStream.IsValid()) - return; - else - _MESSAGE("Reading translations from %s...", path.c_str()); - - // Check if file is empty, if not check if the BOM is UTF-16 - UInt16 bom = 0; - UInt32 ret = fileStream.Read(&bom, sizeof(UInt16)); - if(ret == 0) { - _MESSAGE("Empty translation file."); - return; - } - if(bom != 0xFEFF) { - _MESSAGE("BOM Error, file must be encoded in UCS-2 LE."); - return; - } - - while(true) - { - wchar_t buf[512]; - - UInt32 len = fileStream.ReadLine_w(buf, sizeof(buf) / sizeof(buf[0]), '\n'); - if(len == 0) // End of file - return; - - // at least $ + wchar_t + \t + wchar_t - if(len < 4 || buf[0] != '$') - continue; - - wchar_t last = buf[len - 1]; - if(last == '\r') - len--; - - // null terminate - buf[len] = 0; - - UInt32 delimIdx = 0; - for(UInt32 i = 0; i < len; i++) - if(buf[i] == '\t') - delimIdx = i; - - // at least $ + wchar_t - if(delimIdx < 2) - continue; - - // replace \t by \0 - buf[delimIdx] = 0; - - wchar_t * key = NULL; - wchar_t * translation = NULL; - BSScaleformTranslator::GetCachedString(&key, buf, 0); - BSScaleformTranslator::GetCachedString(&translation, &buf[delimIdx + 1], 0); - TranslationTableItem item(key, translation); - translator->translations.Add(&item); - } - } - - void ImportTranslationFiles(BSScaleformTranslator * translator) - { - char appdataPath[MAX_PATH]; - ASSERT(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdataPath))); - - std::string modlistPath = appdataPath; - modlistPath += "\\Skyrim Special Edition\\plugins.txt"; - - // Parse mod list file to acquire translation filenames - IFileStream modlistFile; - if(modlistFile.Open(modlistPath.c_str())) - { - while(!modlistFile.HitEOF()) - { - char buf[512]; - modlistFile.ReadString(buf, 512, '\n', '\r'); - - // skip comments - if(buf[0] == '#') - continue; - - // Determine extension type - std::string line = buf; - - // SE: added this - if (line.length() > 0) - { - if (line.front() != '*') - continue; // Skip not enabled files - - line = line.substr(1); // Remove the * from name - } - - std::string::size_type lastDelim = line.rfind('.'); - if(lastDelim != std::string::npos) - { - std::string ext = line.substr(lastDelim); - - if(_stricmp(ext.c_str(), ".ESM") == 0 || _stricmp(ext.c_str(),".ESP") == 0 || _stricmp(ext.c_str(), ".ESL") == 0) - { - std::string name = line.substr(0, lastDelim); - ParseTranslation(translator, name); - } - } - } - } - - modlistFile.Close(); - } -} diff --git a/source/fs.dll/skse64/skse64/Translation.h b/source/fs.dll/skse64/skse64/Translation.h deleted file mode 100644 index e77e6137..00000000 --- a/source/fs.dll/skse64/skse64/Translation.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -class BSScaleformTranslator; - -namespace Translation -{ - void ImportTranslationFiles(BSScaleformTranslator * translator); -} diff --git a/source/fs.dll/skse64/skse64/gamethreads.h b/source/fs.dll/skse64/skse64/gamethreads.h deleted file mode 100644 index 27d771d5..00000000 --- a/source/fs.dll/skse64/skse64/gamethreads.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "skse64_common/Utilities.h" -#include "GameAPI.h" - -class Actor; -class BGSHeadPart; -class NiAVObject; -class BGSTextureSet; -class NiAVObject; -class TESObjectREFR; - -class TaskDelegate -{ -public: - virtual void Run() = 0; - virtual void Dispose() = 0; -}; - -class BSTaskPool -{ -public: - MEMBER_FN_PREFIX(BSTaskPool); - DEFINE_MEMBER_FN(SetNiGeometryTexture, UInt32, 0x005EB9F0, NiAVObject * geometry, BGSTextureSet * textureSet); - - void ProcessTasks(void); - - DEFINE_MEMBER_FN(ProcessTaskQueue_HookTarget, void, 0x005E9530); - - static BSTaskPool * GetSingleton(void); -}; diff --git a/source/fs.dll/skse64/skse64/resource.h b/source/fs.dll/skse64/skse64/resource.h deleted file mode 100644 index e9e28246..00000000 --- a/source/fs.dll/skse64/skse64/resource.h +++ /dev/null @@ -1,19 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by PluginLoadErrorDialog.rc -// -#define VS_VERSION_INFO 1 -#define IDD_PLUGINERROR 2 -#define IDC_PLUGINERROR_ERRORLIST 1001 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/source/fs.dll/skse64/skse64/skse64.cpp b/source/fs.dll/skse64/skse64/skse64.cpp deleted file mode 100644 index 341d3be6..00000000 --- a/source/fs.dll/skse64/skse64/skse64.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include "skse64_common/skse_version.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/Relocation.h" -#include "skse64_common/BranchTrampoline.h" -#include "skse64_common/SafeWrite.h" -#include "skse64/PluginManager.h" -#include -#include "common/IFileStream.h" -#include "Hooks_ObScript.h" -#include "Hooks_Papyrus.h" -#include "Hooks_SaveLoad.h" -#include "Hooks_Gameplay.h" -#include "Hooks_Data.h" -#include "Hooks_Debug.h" -#include "Hooks_Event.h" -#include "Hooks_Camera.h" -#include "Hooks_NetImmerse.h" -#include "Hooks_Handlers.h" -#include "Hooks_Threads.h" -#include "Hooks_UI.h" -#include "Hooks_Scaleform.h" -#include "Hooks_DirectInput8Create.h" -#include "Hooks_Diagnostics.h" -#include "InternalSerialization.h" - -IDebugLog gLog; -HINSTANCE g_moduleHandle = nullptr; - -void WaitForDebugger(void) -{ - while(!IsDebuggerPresent()) - { - Sleep(10); - } - - Sleep(1000 * 2); -} - -static bool isInit = false; - -void SKSE64_Initialize(void) -{ - if(isInit) return; - isInit = true; - - gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim Special Edition\\SKSE\\skse64.log"); - -#ifndef _DEBUG - __try { -#endif - - FILETIME now; - GetSystemTimeAsFileTime(&now); - - _MESSAGE("SKSE64 runtime: initialize (version = %d.%d.%d %08X %08X%08X, os = %s)", - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA, RUNTIME_VERSION, - now.dwHighDateTime, now.dwLowDateTime, GetOSInfoStr().c_str()); - - _MESSAGE("imagebase = %016I64X", GetModuleHandle(NULL)); - _MESSAGE("reloc mgr imagebase = %016I64X", RelocationManager::s_baseAddr); - -#ifdef _DEBUG - SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); - - WaitForDebugger(); -#endif - - if(!g_branchTrampoline.Create(1024 * 64)) - { - _ERROR("couldn't create branch trampoline. this is fatal. skipping remainder of init process."); - return; - } - - if(!g_localTrampoline.Create(1024 * 64, g_moduleHandle)) - { - _ERROR("couldn't create codegen buffer. this is fatal. skipping remainder of init process."); - return; - } - - // Add Hooks_XXX_Init calls here - Hooks_Debug_Init(); - Hooks_ObScript_Init(); - Hooks_Papyrus_Init(); - Hooks_NetImmerse_Init(); - Hooks_Threads_Init(); - Hooks_Handlers_Init(); - - g_pluginManager.Init(); - - // Add Hooks_XXX_Commit calls here in the same order - Hooks_Debug_Commit(); - Hooks_ObScript_Commit(); - Hooks_Papyrus_Commit(); - Hooks_UI_Commit(); - Hooks_Camera_Commit(); - Hooks_NetImmerse_Commit(); - Hooks_Threads_Commit(); - Hooks_Handlers_Commit(); - Hooks_Scaleform_Commit(); - Hooks_Gameplay_Commit(); - Hooks_Event_Commit(); - Hooks_SaveLoad_Commit(); - Hooks_Data_Commit(); - Init_CoreSerialization_Callbacks(); - Hooks_DirectInput_Commit(); - - FlushInstructionCache(GetCurrentProcess(), NULL, 0); - -#ifndef _DEBUG - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - _ERROR("exception thrown during startup"); - } -#endif - - _MESSAGE("init complete"); -} - -extern "C" { - - void StartSKSE(void) - { - SKSE64_Initialize(); - } - - BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) - { - switch(dwReason) - { - case DLL_PROCESS_ATTACH: - g_moduleHandle = (HINSTANCE)hDllHandle; - break; - - case DLL_PROCESS_DETACH: - break; - }; - - return TRUE; - } - -}; diff --git a/source/fs.dll/skse64/skse64/skse64.def b/source/fs.dll/skse64/skse64/skse64.def deleted file mode 100644 index 5663c9da..00000000 --- a/source/fs.dll/skse64/skse64/skse64.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS -StartSKSE @1 \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/skse64.vcxproj b/source/fs.dll/skse64/skse64/skse64.vcxproj deleted file mode 100644 index abfe88e0..00000000 --- a/source/fs.dll/skse64/skse64/skse64.vcxproj +++ /dev/null @@ -1,537 +0,0 @@ - - - - - Debug_Lib_VC142 - x64 - - - Debug_VC142 - x64 - - - Debug - x64 - - - Release_Lib_VC142 - x64 - - - Release_VC142 - x64 - - - Release - x64 - - - - {7028B79C-06E3-4D9A-B38C-1DC3680B1BDB} - Win32Proj - skse64 - 10.0 - - - - DynamicLibrary - true - v142 - MultiByte - - - DynamicLibrary - true - v142 - MultiByte - - - StaticLibrary - true - v142 - MultiByte - - - StaticLibrary - false - v143 - true - MultiByte - - - DynamicLibrary - false - v142 - true - MultiByte - - - StaticLibrary - false - v142 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - true - - - false - false - - - false - - - false - - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Windows - true - - - - - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Windows - true - - - - - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Windows - true - - - - - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - MultiThreaded - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories);$(SolutionDir)skse64 - - - Windows - true - true - true - - - - - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - MultiThreaded - true - - - Windows - true - true - true - - - - - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - MultiThreaded - true - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {472e19ab-def0-42df-819b-18722e8dc822} - - - {5fd1c08d-db80-480c-a1c6-f0920005cd13} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/skse64.vcxproj.filters b/source/fs.dll/skse64/skse64/skse64.vcxproj.filters deleted file mode 100644 index 51753b35..00000000 --- a/source/fs.dll/skse64/skse64/skse64.vcxproj.filters +++ /dev/null @@ -1,882 +0,0 @@ - - - - - - api - - - api - - - api - - - api - - - api - - - hooks - - - netimmerse - - - papyrus\vm - - - papyrus\vm - - - papyrus\vm - - - api - - - papyrus\vm - - - papyrus\vm - - - hooks - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - api - - - api - - - api - - - netimmerse - - - internal - - - internal - - - internal - - - api - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\vm - - - hooks - - - hooks - - - hooks - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - api - - - api - - - api - - - api - - - api - - - api - - - api - - - internal - - - internal - - - internal - - - internal - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - api - - - api - - - api - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - netimmerse - - - netimmerse - - - internal - - - papyrus\vm - - - papyrus\vm - - - api - - - scaleform - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - internal - - - hooks - - - internal - - - netimmerse - - - papyrus\functions - - - - - api - - - api - - - api - - - api - - - api - - - hooks - - - netimmerse - - - papyrus\vm - - - papyrus\vm - - - papyrus\vm - - - api - - - papyrus\vm - - - papyrus\vm - - - hooks - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - api - - - api - - - api - - - netimmerse - - - internal - - - internal - - - internal - - - internal - - - api - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\vm - - - hooks - - - hooks - - - hooks - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - scaleform - - - api - - - api - - - api - - - api - - - api - - - api - - - api - - - internal - - - internal - - - internal - - - internal - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - hooks - - - api - - - api - - - api - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - papyrus\functions - - - netimmerse - - - netimmerse - - - internal - - - papyrus\vm - - - papyrus\vm - - - api - - - scaleform - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - netimmerse - - - internal - - - hooks - - - internal - - - papyrus\vm - - - netimmerse - - - papyrus\functions - - - - - {55dc6620-fd72-40de-aff2-4567bae5958f} - - - {99f94223-5d76-4e67-a879-1e6a8c755601} - - - {cf5ab4aa-9ddd-4544-a02d-5e883aaddb4a} - - - {dfbc7ea1-1be7-4640-bcfb-34672add1211} - - - {d203668c-7be8-49ff-816e-6367173c5de5} - - - {41151838-834c-453d-b20b-de6e8ef8ee64} - - - {2ce64f3f-f75e-4c8d-a833-a0f7e9dc9de7} - - - {b33ba6c7-8944-4c2a-9f73-aaa4950fc6ee} - - - - - papyrus\vm - - - papyrus\vm - - - api - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64/skse64.vcxproj.user b/source/fs.dll/skse64/skse64/skse64.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/source/fs.dll/skse64/skse64/skse64.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_common/BranchTrampoline.cpp b/source/fs.dll/skse64/skse64_common/BranchTrampoline.cpp deleted file mode 100644 index 5cb76019..00000000 --- a/source/fs.dll/skse64/skse64_common/BranchTrampoline.cpp +++ /dev/null @@ -1,255 +0,0 @@ -#include "BranchTrampoline.h" -#include "SafeWrite.h" -#include - -BranchTrampoline g_branchTrampoline; -BranchTrampoline g_localTrampoline; - -BranchTrampoline::BranchTrampoline() - :m_base(nullptr) - , m_len(0) - , m_allocated(0) - , m_curAlloc(nullptr) -{ - // -} - -BranchTrampoline::~BranchTrampoline() -{ - Destroy(); -} - -bool BranchTrampoline::Create(size_t len, void * module) -{ - if (!module) module = GetModuleHandle(NULL); - - // search backwards from module base - uintptr_t moduleBase = uintptr_t(module); - uintptr_t addr = moduleBase; - uintptr_t maxDisplacement = 0x80000000 - (1024 * 1024 * 128); // largest 32-bit displacement with 128MB scratch space - uintptr_t lowestOKAddress = (moduleBase >= maxDisplacement) ? moduleBase - maxDisplacement : 0; - addr--; - - while (!m_base) - { - MEMORY_BASIC_INFORMATION info; - - if (!VirtualQuery((void *)addr, &info, sizeof(info))) - { - _ERROR("VirtualQuery failed: %08X", GetLastError()); - break; - } - - if (info.State == MEM_FREE) - { - // free block, big enough? - if (info.RegionSize >= len) - { - // try to allocate it - addr = ((uintptr_t)info.BaseAddress) + info.RegionSize - len; - - m_base = (void *)VirtualAlloc((void *)addr, len, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); - if (m_base) - { - m_len = len; - m_allocated = 0; - } - else - { - _WARNING("trampoline alloc %016I64Xx%016I64X failed (%08X)", addr, len, GetLastError()); - } - } - } - - // move back and try again - if (!m_base) - { - addr = ((uintptr_t)info.BaseAddress) - 1; - } - - if (addr < lowestOKAddress) - { - _ERROR("couldn't allocate trampoline, no free space before image"); - break; - } - } - - return m_base != nullptr; -} - -void BranchTrampoline::Destroy() -{ - if (m_base) - { - VirtualFree(m_base, 0, MEM_RELEASE); - m_base = nullptr; - } -} - -void BranchTrampoline::SetBase(size_t len, void * base) -{ - ASSERT(!m_base); - m_base = base; - m_len = len; - m_allocated = 0; - m_curAlloc = nullptr; -} - -void * BranchTrampoline::StartAlloc() -{ - ASSERT(m_base); - ASSERT(!m_curAlloc); - - m_curAlloc = ((UInt8 *)m_base) + m_allocated; - - return m_curAlloc; -} - -void BranchTrampoline::EndAlloc(const void * end) -{ - ASSERT(m_base); - ASSERT(m_curAlloc); - - size_t len = uintptr_t(end) - uintptr_t(m_curAlloc); - ASSERT(len <= Remain()); - - m_allocated += len; - m_curAlloc = nullptr; -} - -void * BranchTrampoline::Allocate(size_t size) -{ - ASSERT(m_base); - - void * result = nullptr; - - if (size <= Remain()) - { - result = ((UInt8 *)m_base) + m_allocated; - m_allocated += size; - } - - return result; -} - -bool BranchTrampoline::Write6Branch(uintptr_t src, uintptr_t dst) -{ - return Write6Branch_Internal(src, dst, 0x25); -} - -bool BranchTrampoline::Write6Call(uintptr_t src, uintptr_t dst) -{ - return Write6Branch_Internal(src, dst, 0x15); -} - -bool BranchTrampoline::Write5Branch(uintptr_t src, uintptr_t dst) -{ - return Write5Branch_Internal(src, dst, 0xE9); -} - -bool BranchTrampoline::Write5Call(uintptr_t src, uintptr_t dst) -{ - return Write5Branch_Internal(src, dst, 0xE8); -} - -bool BranchTrampoline::Write6Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op) -{ - bool result = false; - - uintptr_t * trampoline = (uintptr_t *)Allocate(); - if (trampoline) - { - uintptr_t trampolineAddr = (uintptr_t)trampoline; - uintptr_t nextInstr = src + 6; - ptrdiff_t trampolineDispl = trampolineAddr - nextInstr; - - if ((trampolineDispl >= _I32_MIN) && (trampolineDispl <= _I32_MAX)) - { - UInt8 code[6]; - - // jmp [rip+imm32] - code[0] = 0xFF; - code[1] = op; - *((SInt32 *)&code[2]) = (SInt32)trampolineDispl; - - SafeWriteBuf(src, code, sizeof(code)); - - *trampoline = dst; - - result = true; - } - } - - // do this for now so it's obvious when something goes wrong - ASSERT(result); - - return result; -} - -bool BranchTrampoline::Write5Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op) -{ - bool result = false; - -#pragma pack(push, 1) - // code placed in trampoline - struct TrampolineCode - { - // jmp [rip] - UInt8 escape; // FF - UInt8 modrm; // 25 - UInt32 displ; // 00000000 - // rip points here - UInt64 dst; // target - - void Init(uintptr_t _dst) - { - escape = 0xFF; - modrm = 0x25; - displ = 0; - dst = _dst; - } - }; - - struct HookCode - { - // jmp disp32 - UInt8 op; // E9 for jmp, E8 for call - SInt32 displ; // - - void Init(SInt32 _displ, UInt8 _op) - { - op = _op; - displ = _displ; - } - }; -#pragma pack(pop) - - STATIC_ASSERT(sizeof(TrampolineCode) == 14); - STATIC_ASSERT(sizeof(HookCode) == 5); - - TrampolineCode * trampolineCode = (TrampolineCode *)Allocate(sizeof(TrampolineCode)); - if (trampolineCode) - { - trampolineCode->Init(dst); - - HookCode hookCode; - - uintptr_t trampolineAddr = uintptr_t(trampolineCode); - uintptr_t nextInstr = src + sizeof(hookCode); - ptrdiff_t trampolineDispl = trampolineAddr - nextInstr; - - // should never fail because we're branching in to the trampoline - ASSERT((trampolineDispl >= _I32_MIN) && (trampolineDispl <= _I32_MAX)); - - hookCode.Init(trampolineDispl, op); - - SafeWriteBuf(src, &hookCode, sizeof(hookCode)); - - result = true; - } - - // do this for now so it's obvious when something goes wrong - ASSERT(result); - - return result; -} diff --git a/source/fs.dll/skse64/skse64_common/BranchTrampoline.h b/source/fs.dll/skse64/skse64_common/BranchTrampoline.h deleted file mode 100644 index 1c38676f..00000000 --- a/source/fs.dll/skse64/skse64_common/BranchTrampoline.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -class BranchTrampoline -{ -public: - BranchTrampoline(); - ~BranchTrampoline(); - - bool Create(size_t len, void * module = NULL); - void Destroy(); - void SetBase(size_t len, void* base); - - // allocate unsized - void * StartAlloc(); - void EndAlloc(const void * end); - - void * Allocate(size_t size = sizeof(void *)); - - size_t Remain() { return m_len - m_allocated; } - - // takes 6 bytes of space at src, 8 bytes in trampoline - bool Write6Branch(uintptr_t src, uintptr_t dst); - bool Write6Call(uintptr_t src, uintptr_t dst); - - // takes 5 bytes of space at src, 14 bytes in trampoline - bool Write5Branch(uintptr_t src, uintptr_t dst); - bool Write5Call(uintptr_t src, uintptr_t dst); - -private: - // takes 6 bytes of space at src, 8 bytes in trampoline - bool Write6Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op); - - // takes 5 bytes of space at src, 14 bytes in trampoline - bool Write5Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op); - - void * m_base; - size_t m_len; // bytes - size_t m_allocated; // bytes - - void * m_curAlloc; // currently active StartAlloc base -}; - -extern BranchTrampoline g_branchTrampoline; -extern BranchTrampoline g_localTrampoline; diff --git a/source/fs.dll/skse64/skse64_common/CMakeLists.txt b/source/fs.dll/skse64/skse64_common/CMakeLists.txt deleted file mode 100644 index aecda2bf..00000000 --- a/source/fs.dll/skse64/skse64_common/CMakeLists.txt +++ /dev/null @@ -1,108 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/versioning.cmake) - -project( - skse64_common - VERSION ${SKSE_VERSION_MAJOR}.${SKSE_VERSION_MINOR}.${SKSE_VERSION_PATCH} - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Dependencies ---- - -find_package(common REQUIRED CONFIG) - -# ---- Add source files ---- - -include(cmake/headerlist.cmake) -include(cmake/sourcelist.cmake) - -source_group( - ${PROJECT_NAME} - FILES - ${headers} - ${sources} - skse_version.rc -) - -# ---- Create library ---- - -add_library( - ${PROJECT_NAME} - STATIC - ${headers} - ${sources} - skse_version.rc -) - -add_library(skse64::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -target_compile_features( - ${PROJECT_NAME} - PUBLIC - cxx_std_11 -) - -target_include_directories( - ${PROJECT_NAME} - PUBLIC - $ - $ -) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC - xse::common -) - -# ---- Create an installable target ---- - -include(GNUInstallDirs) - -install( - TARGETS - ${PROJECT_NAME} - EXPORT - ${PROJECT_NAME}-targets -) - -install( - FILES - ${headers} - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -) - -configure_file( - cmake/config.cmake.in - ${PROJECT_NAME}-config.cmake - @ONLY -) - -install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -install( - EXPORT - ${PROJECT_NAME}-targets - NAMESPACE - skse64:: - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) diff --git a/source/fs.dll/skse64/skse64_common/Relocation.cpp b/source/fs.dll/skse64/skse64_common/Relocation.cpp deleted file mode 100644 index baca1a83..00000000 --- a/source/fs.dll/skse64/skse64_common/Relocation.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "Relocation.h" - -// the goal of this file is to support pointers in to a relocated binary with as little runtime overhead, code bloat, and hassle as possible -// -// since the main executable will always be loaded before the dll, the easiest solution is to perform the relocation in the constructor of -// a pointer class that supports conversion to T*. however, since we can't control anything about initialization order, each constructor -// must call GetModuleHandle(NULL) locally, which sucks. each pointer will need an entry in the static init table, and nothing can be done -// with the pointers in any other static constructors. -// -// one solution to this problem is init_seg(lib). any objects constructed in a file containing this pragma will be constructed before standard -// 'user' level code. this means we can use the constructor of that object to call GetModuleHandle once and initialize a global with the load -// address, which the pointer class constructor then references to fix up the addresses. this still creates an entry in the static init table -// for each pointer, but only calls GetModuleHandle once. pointers are not fixed up until all static init has finished, so other static ctors -// can't safely use pointers. -// -// the problem can't be solved further without moving the RelocPtr constructors in to init_seg(lib), which doesn't appear to be possible -// without forcing all pointers to be defined in a file with init_seg(lib). that is really ugly and doesn't seem like a good idea. - -// anything in this file will initialized after the crt but before any user code -#pragma warning(disable: 4073) // yes this is intentional -#pragma init_seg(lib) - -static RelocationManager s_relocMgr; - -uintptr_t RelocationManager::s_baseAddr = 0; - -RelocationManager::RelocationManager() -{ - s_baseAddr = reinterpret_cast(GetModuleHandle(NULL)); -} diff --git a/source/fs.dll/skse64/skse64_common/Relocation.h b/source/fs.dll/skse64/skse64_common/Relocation.h deleted file mode 100644 index 1d17aac6..00000000 --- a/source/fs.dll/skse64/skse64_common/Relocation.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -class RelocationManager -{ -public: - RelocationManager(); - - static uintptr_t s_baseAddr; -}; - -// use this for addresses that represent pointers to a type T -template -class RelocPtr -{ -public: - RelocPtr(uintptr_t offset) - :m_offset(offset + RelocationManager::s_baseAddr) - { - // - } - - operator T *() const - { - return GetPtr(); - } - - T * operator->() const - { - return GetPtr(); - } - - T * GetPtr() const - { - return reinterpret_cast (m_offset); - } - - const T * GetConst() const - { - return reinterpret_cast (m_offset); - } - - uintptr_t GetUIntPtr() const - { - return m_offset; - } - -private: - uintptr_t m_offset; - - // hide - RelocPtr(); - RelocPtr(RelocPtr & rhs); - RelocPtr & operator=(RelocPtr & rhs); -}; - -// use this for direct addresses to types T. needed to avoid ambiguity -template -class RelocAddr -{ -public: - RelocAddr(uintptr_t offset) - :m_offset(reinterpret_cast (offset + RelocationManager::s_baseAddr)) - { - // - } - - operator T() - { - return reinterpret_cast (m_offset); - } - - uintptr_t GetUIntPtr() const - { - return reinterpret_cast (m_offset); - } - -private: - // apparently you can't reinterpret_cast from a type to the same type - // that's kind of stupid and makes it impossible to use this for uintptr_ts if I use the same type - // so we make a new type by storing the data in a pointer to this useless struct - // at least this is hidden by a wrapper - struct BlockConversionType { }; - BlockConversionType * m_offset; - - // hide - RelocAddr(); - RelocAddr(RelocAddr & rhs); - RelocAddr & operator=(RelocAddr & rhs); -}; diff --git a/source/fs.dll/skse64/skse64_common/SafeWrite.cpp b/source/fs.dll/skse64/skse64_common/SafeWrite.cpp deleted file mode 100644 index 2118c325..00000000 --- a/source/fs.dll/skse64/skse64_common/SafeWrite.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "SafeWrite.h" - -void SafeWriteBuf(uintptr_t addr, void * data, size_t len) -{ - UInt32 oldProtect; - - VirtualProtect((void *)addr, len, PAGE_EXECUTE_READWRITE, &oldProtect); - memcpy((void *)addr, data, len); - VirtualProtect((void *)addr, len, oldProtect, &oldProtect); -} - -void SafeWrite8(uintptr_t addr, UInt8 data) -{ - SafeWriteBuf(addr, &data, sizeof(data)); -} - -void SafeWrite16(uintptr_t addr, UInt16 data) -{ - SafeWriteBuf(addr, &data, sizeof(data)); -} - -void SafeWrite32(uintptr_t addr, UInt32 data) -{ - SafeWriteBuf(addr, &data, sizeof(data)); -} - -void SafeWrite64(uintptr_t addr, UInt64 data) -{ - SafeWriteBuf(addr, &data, sizeof(data)); -} - -static bool SafeWriteJump_Internal(uintptr_t src, uintptr_t dst, UInt8 op) -{ -#pragma pack(push, 1) - struct Code - { - UInt8 op; - SInt32 displ; - }; -#pragma pack(pop) - - STATIC_ASSERT(sizeof(Code) == 5); - - ptrdiff_t delta = dst - (src + sizeof(Code)); - if((delta < INT_MIN) || (delta > INT_MAX)) - return false; - - Code code; - - code.op = op; - code.displ = delta; - - SafeWriteBuf(src, &code, sizeof(code)); - - return true; -} - -bool SafeWriteJump(uintptr_t src, uintptr_t dst) -{ - return SafeWriteJump_Internal(src, dst, 0xE9); -} - -bool SafeWriteCall(uintptr_t src, uintptr_t dst) -{ - return SafeWriteJump_Internal(src, dst, 0xE8); -} diff --git a/source/fs.dll/skse64/skse64_common/SafeWrite.h b/source/fs.dll/skse64/skse64_common/SafeWrite.h deleted file mode 100644 index 709e38b5..00000000 --- a/source/fs.dll/skse64/skse64_common/SafeWrite.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -void SafeWriteBuf(uintptr_t addr, void * data, size_t len); -void SafeWrite8(uintptr_t addr, UInt8 data); -void SafeWrite16(uintptr_t addr, UInt16 data); -void SafeWrite32(uintptr_t addr, UInt32 data); -void SafeWrite64(uintptr_t addr, UInt64 data); - -// ### warning: if you try to branch more than +/- 2GB with these, they will fail and return false -// ### this is a limitation of the 'jmp' instruction and more generally the x64 ISA -// 5 bytes written to src -bool SafeWriteJump(uintptr_t src, uintptr_t dst); -bool SafeWriteCall(uintptr_t src, uintptr_t dst); diff --git a/source/fs.dll/skse64/skse64_common/Utilities.cpp b/source/fs.dll/skse64/skse64_common/Utilities.cpp deleted file mode 100644 index b1017854..00000000 --- a/source/fs.dll/skse64/skse64_common/Utilities.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include "Utilities.h" -#include - -std::string GetRuntimePath() -{ - static char appPath[4096] = { 0 }; - - if(appPath[0]) - return appPath; - - ASSERT(GetModuleFileName(GetModuleHandle(NULL), appPath, sizeof(appPath))); - - return appPath; -} - -std::string GetRuntimeName() -{ - std::string appPath = GetRuntimePath(); - - std::string::size_type slashOffset = appPath.rfind('\\'); - if(slashOffset == std::string::npos) - return appPath; - - return appPath.substr(slashOffset + 1); -} - -const std::string & GetRuntimeDirectory() -{ - static std::string s_runtimeDirectory; - - if(s_runtimeDirectory.empty()) - { - std::string runtimePath = GetRuntimePath(); - - // truncate at last slash - std::string::size_type lastSlash = runtimePath.rfind('\\'); - if(lastSlash != std::string::npos) // if we don't find a slash something is VERY WRONG - { - s_runtimeDirectory = runtimePath.substr(0, lastSlash + 1); - } - else - { - _WARNING("no slash in runtime path? (%s)", runtimePath.c_str()); - } - } - - return s_runtimeDirectory; -} - -const std::string & GetConfigPath() -{ - static std::string s_configPath; - - if(s_configPath.empty()) - { - std::string runtimePath = GetRuntimeDirectory(); - if(!runtimePath.empty()) - { - s_configPath = runtimePath + "Data\\SKSE\\skse.ini"; - - _MESSAGE("config path = %s", s_configPath.c_str()); - } - } - - return s_configPath; -} - -std::string GetConfigOption(const char * section, const char * key) -{ - std::string result; - - const std::string & configPath = GetConfigPath(); - if(!configPath.empty()) - { - char resultBuf[256]; - resultBuf[0] = 0; - - UInt32 resultLen = GetPrivateProfileString(section, key, NULL, resultBuf, sizeof(resultBuf), configPath.c_str()); - - result = resultBuf; - } - - return result; -} - -bool GetConfigOption_UInt32(const char * section, const char * key, UInt32 * dataOut) -{ - std::string data = GetConfigOption(section, key); - if(data.empty()) - return false; - - return (sscanf_s(data.c_str(), "%u", dataOut) == 1); -} - -const std::string & GetOSInfoStr() -{ - static std::string result; - - if(result.empty()) - { - OSVERSIONINFO info; - - info.dwOSVersionInfoSize = sizeof(info); - -#pragma warning (disable : 4996) - if(GetVersionEx(&info)) - { - char buf[256]; - - sprintf_s(buf, sizeof(buf), "%d.%d (%d)", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber); - - result = buf; - } - else - { - result = "unknown"; - } - } - - return result; -} - -void * GetIATAddr(void * module, const char * searchDllName, const char * searchImportName) -{ - UInt8 * base = (UInt8 *)module; - IMAGE_DOS_HEADER * dosHeader = (IMAGE_DOS_HEADER *)base; - IMAGE_NT_HEADERS * ntHeader = (IMAGE_NT_HEADERS *)(base + dosHeader->e_lfanew); - IMAGE_IMPORT_DESCRIPTOR * importTable = - (IMAGE_IMPORT_DESCRIPTOR *)(base + ntHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress); - - for(; importTable->Characteristics; ++importTable) - { - const char * dllName = (const char *)(base + importTable->Name); - - if(!_stricmp(dllName, searchDllName)) - { - // found the dll - - IMAGE_THUNK_DATA * thunkData = (IMAGE_THUNK_DATA *)(base + importTable->OriginalFirstThunk); - uintptr_t * iat = (uintptr_t *)(base + importTable->FirstThunk); - - for(; thunkData->u1.Ordinal; ++thunkData, ++iat) - { - if(!IMAGE_SNAP_BY_ORDINAL(thunkData->u1.Ordinal)) - { - IMAGE_IMPORT_BY_NAME * importInfo = (IMAGE_IMPORT_BY_NAME *)(base + thunkData->u1.AddressOfData); - - if(!_stricmp((char *)importInfo->Name, searchImportName)) - { - // found the import - return iat; - } - } - } - - return NULL; - } - } - - return NULL; -} - -const void * GetResourceLibraryProcAddress(const HMODULE module, const char * exportName) -{ - auto * base = (const UInt8 *)(uintptr_t(module) & ~3); - auto * dosHeader = (const IMAGE_DOS_HEADER *)base; - auto * ntHeader = (const IMAGE_NT_HEADERS *)(base + dosHeader->e_lfanew); - auto * exportTable = - (const IMAGE_EXPORT_DIRECTORY *)(base + ntHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress); - - auto * exportAddresses = (const UInt32 *)(base + exportTable->AddressOfFunctions); // RVA array - auto * exportNameOrdinals = (const UInt16 *)(base + exportTable->AddressOfNameOrdinals); // index in to exportNames - auto * exportNames = (const UInt32 *)(base + exportTable->AddressOfNames); // RVA array - - const void * result = nullptr; - - for(UInt32 i = 0; i < exportTable->NumberOfFunctions; i++) - { - UInt32 nameOrdinal = exportNameOrdinals[i]; - if(nameOrdinal < exportTable->NumberOfNames) - { - UInt32 nameRVA = exportNames[nameOrdinal]; - auto * name = (const char *)(base + nameRVA); - - if(!strcmp(exportName, name)) - { - UInt32 addrRVA = exportAddresses[i]; - result = (const void *)(base + addrRVA); - - break; - } - } - } - - return result; -} - -bool Is64BitDLL(const HMODULE module) -{ - auto * base = (const UInt8 *)(uintptr_t(module) & ~3); - auto * dosHeader = (const IMAGE_DOS_HEADER *)base; - auto * ntHeader = (const IMAGE_NT_HEADERS *)(base + dosHeader->e_lfanew); - - // FileHeader is PE32/64 independent - return ntHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64; -} - -#pragma warning (push) -#pragma warning (disable : 4200) -struct RTTIType -{ - void * typeInfo; - UInt64 data; - char name[0]; -}; - -struct RTTILocator -{ - UInt32 sig, offset, cdOffset; - UInt32 typeDesc; - UInt32 classDesc; -}; -#pragma warning (pop) - -// use the RTTI information to return an object's class name -const char * GetObjectClassName(void * objBase) -{ - const char * result = ""; - __try - { - void ** obj = (void **)objBase; - RTTILocator ** vtbl = (RTTILocator **)obj[0]; - RTTILocator * rtti = vtbl[-1]; - UInt64 typeDesc = rtti->typeDesc; - RelocPtr type(typeDesc); - - // starts with ,? - if((type->name[0] == '.') && (type->name[1] == '?')) - { - // is at most 100 chars long - for(UInt32 i = 0; i < 100; i++) - { - if(type->name[i] == 0) - { - // remove the .?AV - result = type->name + 4; - break; - } - } - } - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - // return the default - } - - return result; -} - -void DumpClass(void * theClassPtr, UInt64 nIntsToDump) -{ - UInt64* basePtr = (UInt64*)theClassPtr; - - _MESSAGE("DumpClass: %016I64X", basePtr); - - gLog.Indent(); - - if (!theClassPtr) return; - for (UInt64 ix = 0; ix < nIntsToDump; ix++ ) { - UInt64* curPtr = basePtr+ix; - const char* curPtrName = NULL; - UInt64 otherPtr = 0; - float otherFloat1 = 0.0; - float otherFloat2 = 0.0; - const char* otherPtrName = NULL; - if (curPtr) { - curPtrName = GetObjectClassName((void*)curPtr); - - __try - { - otherPtr = *curPtr; - UInt32 lowerFloat = otherPtr & 0xFFFFFFFF; - UInt32 upperFloat = (otherPtr >> 32) & 0xFFFFFFFF; - otherFloat1 = *(float*)&lowerFloat; - otherFloat2 = *(float*)&upperFloat; - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - // - } - - if (otherPtr) { - otherPtrName = GetObjectClassName((void*)otherPtr); - } - } - - _MESSAGE("%3d +%03X ptr: 0x%016I64X: %32s *ptr: 0x%016I64x | %f, %f: %32s", ix, ix*8, curPtr, curPtrName, otherPtr, otherFloat2, otherFloat1, otherPtrName); - } - - gLog.Outdent(); -} \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_common/Utilities.h b/source/fs.dll/skse64/skse64_common/Utilities.h deleted file mode 100644 index ddcea551..00000000 --- a/source/fs.dll/skse64/skse64_common/Utilities.h +++ /dev/null @@ -1,204 +0,0 @@ -#pragma once - -#include "skse64_common/Relocation.h" - -// this has been tested to work for non-varargs functions -// varargs functions end up with 'this' passed as the last parameter (ie. probably broken) -// do NOT use with classes that have multiple inheritance - -// if many member functions are to be declared, use MEMBER_FN_PREFIX to create a type with a known name -// so it doesn't need to be restated throughout the member list - -// all of the weirdness with the _GetType function is because you can't declare a static const pointer -// inside the class definition. we sadly can't inline anymore because of relocation. - -// RelocPtr only works at a global scope, which we can't handle or we'd be bypassing the function route altogether - -#define MEMBER_FN_PREFIX(className) \ - typedef className _MEMBER_FN_BASE_TYPE - -#define DEFINE_MEMBER_FN_LONG(className, functionName, retnType, address, ...) \ - typedef retnType (className::* _##functionName##_type)(__VA_ARGS__); \ - \ - static const std::uintptr_t functionName##_Address = address; \ - inline _##functionName##_type * _##functionName##_GetPtr(void) \ - { \ - static uintptr_t _address; \ - _address = address + RelocationManager::s_baseAddr; \ - return (_##functionName##_type *)&_address; \ - } - -#define DEFINE_MEMBER_FN(functionName, retnType, address, ...) \ - DEFINE_MEMBER_FN_LONG(_MEMBER_FN_BASE_TYPE, functionName, retnType, address, __VA_ARGS__) - -#define DEFINE_STATIC_HEAP(staticAllocate, staticFree) \ - static void * operator new(std::size_t size) \ - { \ - return staticAllocate(size); \ - } \ - static void * operator new(std::size_t size, const std::nothrow_t &) \ - { \ - return staticAllocate(size); \ - } \ - static void * operator new(std::size_t size, void * ptr) \ - { \ - return ptr; \ - } \ - static void operator delete(void * ptr) \ - { \ - staticFree(ptr); \ - } \ - static void operator delete(void * ptr, const std::nothrow_t &) \ - { \ - staticFree(ptr); \ - } \ - static void operator delete(void *, void *) \ - { \ - } - -#define CALL_MEMBER_FN(obj, fn) \ - ((*(obj)).*(*((obj)->_##fn##_GetPtr()))) - -// Using the original implementation does very broken things in a Release build -#define FORCE_INLINE __forceinline -#define DEFINE_MEMBER_FN_0(fnName, retnType, addr) \ - static const std::uintptr_t fnName##_Address = addr; \ - FORCE_INLINE retnType fnName() { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(); \ - } -#define DEFINE_MEMBER_FN_1(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1); \ - } -#define DEFINE_MEMBER_FN_2(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2); \ - } -#define DEFINE_MEMBER_FN_3(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3); \ - } -#define DEFINE_MEMBER_FN_4(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4); \ - } -#define DEFINE_MEMBER_FN_5(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5); \ - } -#define DEFINE_MEMBER_FN_6(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6); \ - } -#define DEFINE_MEMBER_FN_7(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7); \ - } -#define DEFINE_MEMBER_FN_8(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8); \ - } -#define DEFINE_MEMBER_FN_9(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8, T9 && t9) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8, t9); \ - } -#define DEFINE_MEMBER_FN_10(fnName, retnType, addr, ...) \ - static const std::uintptr_t fnName##_Address = addr; \ - template \ - FORCE_INLINE retnType fnName(T1 && t1, T2 && t2, T3 && t3, T4 && t4, T5 && t5, T6 && t6, T7 && t7, T8 && t8, T9 && t9, T10 && t10) { \ - struct empty_struct {}; \ - typedef retnType(empty_struct::*_##fnName##_type)(__VA_ARGS__); \ - const static uintptr_t address = fnName##_Address + RelocationManager::s_baseAddr; \ - _##fnName##_type fn = *(_##fnName##_type*)&address; \ - return (reinterpret_cast(this)->*fn)(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); \ - } - -// this is the solution to getting a pointer-to-member-function pointer -template -uintptr_t GetFnAddr(T src) -{ - union - { - uintptr_t u; - T t; - } data; - - data.t = src; - - return data.u; -} - -std::string GetRuntimePath(); -std::string GetRuntimeName(); -const std::string & GetRuntimeDirectory(); - -const std::string & GetConfigPath(); -std::string GetConfigOption(const char * section, const char * key); -bool GetConfigOption_UInt32(const char * section, const char * key, UInt32 * dataOut); - -const std::string & GetOSInfoStr(); - -void * GetIATAddr(void * module, const char * searchDllName, const char * searchImportName); -const void * GetResourceLibraryProcAddress(const HMODULE module, const char * exportName); -bool Is64BitDLL(const HMODULE module); - -const char * GetObjectClassName(void * objBase); -void DumpClass(void * theClassPtr, UInt64 nIntsToDump); diff --git a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj b/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj deleted file mode 100644 index f018cf03..00000000 --- a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug_VC142 - x64 - - - Debug - x64 - - - Release_VC142 - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - {472e19ab-def0-42df-819b-18722e8dc822} - - - - {5FD1C08D-DB80-480C-A1C6-F0920005CD13} - Win32Proj - skse64_common - 10.0 - - - - StaticLibrary - true - v142 - MultiByte - - - StaticLibrary - true - v142 - MultiByte - - - StaticLibrary - false - v143 - true - MultiByte - - - StaticLibrary - false - v142 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreadedDebug - - - Windows - - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreadedDebug - - - Windows - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories);$(SolutionDir)skse64 - common/IPrefix.h - MultiThreaded - - - Windows - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreaded - - - Windows - true - true - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.filters b/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.filters deleted file mode 100644 index 57c845ab..00000000 --- a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.user b/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/source/fs.dll/skse64/skse64_common/skse64_common.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_common/skse_version.h b/source/fs.dll/skse64/skse64_common/skse_version.h deleted file mode 100644 index 1e674468..00000000 --- a/source/fs.dll/skse64/skse64_common/skse_version.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef __SKSE_VERSION_H__ -#define __SKSE_VERSION_H__ - -// these have to be macros so they can be used in the .rc -#define SKSE_VERSION_INTEGER 2 -#define SKSE_VERSION_INTEGER_MINOR 1 -#define SKSE_VERSION_INTEGER_BETA 5 -#define SKSE_VERSION_VERSTRING "0, 2, 1, 5" -#define SKSE_VERSION_PADDEDSTRING "0001" -#define SKSE_VERSION_RELEASEIDX 66 - -#define MAKE_EXE_VERSION_EX(major, minor, build, sub) ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | (((build) & 0xFFF) << 4) | ((sub) & 0xF)) -#define MAKE_EXE_VERSION(major, minor, build) MAKE_EXE_VERSION_EX(major, minor, build, 0) - -#define GET_EXE_VERSION_MAJOR(a) (((a) & 0xFF000000) >> 24) -#define GET_EXE_VERSION_MINOR(a) (((a) & 0x00FF0000) >> 16) -#define GET_EXE_VERSION_BUILD(a) (((a) & 0x0000FFF0) >> 4) -#define GET_EXE_VERSION_SUB(a) (((a) & 0x0000000F) >> 0) - -#define RUNTIME_VERSION_1_1_47 MAKE_EXE_VERSION(1, 1, 47) // 0x010102F0 initial version released on steam, has edit-and-continue enabled -#define RUNTIME_VERSION_1_1_51 MAKE_EXE_VERSION(1, 1, 51) // 0x01010330 initial version released on steam, has edit-and-continue enabled -#define RUNTIME_VERSION_1_2_36 MAKE_EXE_VERSION(1, 2, 36) // 0x01020240 edit-and-continue disabled -#define RUNTIME_VERSION_1_2_39 MAKE_EXE_VERSION(1, 2, 39) // 0x01020270 edit-and-continue disabled -#define RUNTIME_VERSION_1_3_5 MAKE_EXE_VERSION(1, 3, 5) // 0x01030050 -#define RUNTIME_VERSION_1_3_9 MAKE_EXE_VERSION(1, 3, 9) // 0x01030090 -#define RUNTIME_VERSION_1_4_2 MAKE_EXE_VERSION(1, 4, 2) // 0x01040020 -#define RUNTIME_VERSION_1_5_3 MAKE_EXE_VERSION(1, 5, 3) // 0x01050030 creation club -#define RUNTIME_VERSION_1_5_16 MAKE_EXE_VERSION(1, 5, 16) // 0x01050100 creation club cleanup (thanks) -#define RUNTIME_VERSION_1_5_23 MAKE_EXE_VERSION(1, 5, 23) // 0x01050170 creation club -#define RUNTIME_VERSION_1_5_39 MAKE_EXE_VERSION(1, 5, 39) // 0x01050270 creation club -#define RUNTIME_VERSION_1_5_50 MAKE_EXE_VERSION(1, 5, 50) // 0x01050320 creation club -#define RUNTIME_VERSION_1_5_53 MAKE_EXE_VERSION(1, 5, 53) // 0x01050350 creation club -#define RUNTIME_VERSION_1_5_62 MAKE_EXE_VERSION(1, 5, 62) // 0x010503E0 creation club -#define RUNTIME_VERSION_1_5_73 MAKE_EXE_VERSION(1, 5, 73) // 0x01050490 creation club -#define RUNTIME_VERSION_1_5_80 MAKE_EXE_VERSION(1, 5, 80) // 0x01050500 creation club - no code or data differences -#define RUNTIME_VERSION_1_5_97 MAKE_EXE_VERSION(1, 5, 97) // 0x01050610 creation club -#define RUNTIME_VERSION_1_6_317 MAKE_EXE_VERSION(1, 6, 317) // 0x010613D0 anniversary edition -#define RUNTIME_VERSION_1_6_318 MAKE_EXE_VERSION(1, 6, 318) // 0x010613E0 -#define RUNTIME_VERSION_1_6_323 MAKE_EXE_VERSION(1, 6, 323) // 0x01061430 -#define RUNTIME_VERSION_1_6_342 MAKE_EXE_VERSION(1, 6, 342) // 0x01061560 -#define RUNTIME_VERSION_1_6_353 MAKE_EXE_VERSION(1, 6, 353) // 0x01061610 - -#define PACKED_SKSE_VERSION MAKE_EXE_VERSION(SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA) - -// information about the state of the game at the time of release -#define SKSE_TARGETING_BETA_VERSION 0 -#define CURRENT_RELEASE_RUNTIME RUNTIME_VERSION_1_6_353 -#define CURRENT_RELEASE_SKSE_STR "2.1.5" - -#endif /* __SKSE_VERSION_H__ */ diff --git a/source/fs.dll/skse64/skse64_common/skse_version.rc b/source/fs.dll/skse64/skse64_common/skse_version.rc deleted file mode 100644 index d2c57437..00000000 --- a/source/fs.dll/skse64/skse64_common/skse_version.rc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6db02cc66fd2935564d13019bf0f156e2c055e120ef66c1638263ffcfffdce91 -size 897 diff --git a/source/fs.dll/skse64/skse64_license.txt b/source/fs.dll/skse64/skse64_license.txt deleted file mode 100644 index 30b5dab1..00000000 --- a/source/fs.dll/skse64/skse64_license.txt +++ /dev/null @@ -1,3 +0,0 @@ -These notes apply to all of the files in src/skse64: - -Due to continued intentional copyright infringement and total disrespect for modder etiquette, the Skyrim Online/Skyrim Together team is explicitly disallowed from using any of these files for any purpose. \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_loader/CMakeLists.txt b/source/fs.dll/skse64/skse64_loader/CMakeLists.txt deleted file mode 100644 index c7fdb7da..00000000 --- a/source/fs.dll/skse64/skse64_loader/CMakeLists.txt +++ /dev/null @@ -1,97 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/versioning.cmake) - -project( - skse64_loader - VERSION ${SKSE_VERSION_MAJOR}.${SKSE_VERSION_MINOR}.${SKSE_VERSION_PATCH} - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Build options ---- - -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) - -# ---- Dependencies ---- - -if (NOT TARGET skse64_common) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../skse64_common skse64_common) # bundled -endif() - -if (NOT TARGET skse64_loader_common) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../skse64_loader_common skse64_loader_common) # bundled -endif() - -find_package(common REQUIRED CONFIG) - -# ---- Add source files ---- - -include(cmake/headerlist.cmake) -include(cmake/sourcelist.cmake) - -source_group( - ${PROJECT_NAME} - FILES - ${headers} - ${sources} -) - -# ---- Create library ---- - -add_executable( - ${PROJECT_NAME} - ${headers} - ${sources} - ${skse64_common_SOURCE_DIR}/skse_version.rc -) - -add_executable(skse64::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/configuration.cmake) - -target_compile_features( - ${PROJECT_NAME} - PUBLIC - cxx_std_11 -) - -target_include_directories( - ${PROJECT_NAME} - PUBLIC - $ - $ -) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC - skse64::skse64_common - skse64::skse64_loader_common - Shlwapi.lib - Version.lib - xse::common -) - -# ---- Configure all targets ---- - -set_target_properties( - ${PROJECT_NAME} - skse64_common - skse64_loader_common - PROPERTIES - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" -) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/installation.cmake) diff --git a/source/fs.dll/skse64/skse64_loader/Options.cpp b/source/fs.dll/skse64/skse64_loader/Options.cpp deleted file mode 100644 index dec3af33..00000000 --- a/source/fs.dll/skse64/skse64_loader/Options.cpp +++ /dev/null @@ -1,243 +0,0 @@ -#include "Options.h" - -Options g_options; - -Options::Options() - :m_launchCS(false) - ,m_setPriority(false) - ,m_priority(0) - ,m_crcOnly(false) - ,m_optionsOnly(false) - ,m_waitForClose(false) - ,m_verbose(false) - ,m_moduleInfo(false) - ,m_skipLauncher(true) - ,m_launchSteam(false) - ,m_noTimeout(false) - ,m_forceSteamLoader(false) - ,m_affinity(0) -{ - // -} - -Options::~Options() -{ - // -} - -// disable "switch statement contains 'default' but no 'case' labels" -#pragma warning (push) -#pragma warning (disable : 4065) - -bool Options::Read(int argc, char ** argv) -{ - if(argc >= 1) - { - // remove app name - argc--; - argv++; - - int freeArgCount = 0; - - while(argc > 0) - { - char * arg = *argv++; - argc--; - - if(arg[0] == '-') - { - // switch - arg++; - - if(!_stricmp(arg, "editor")) - { - m_launchCS = true; - } - else if(!_stricmp(arg, "priority")) - { - if(argc >= 1) - { - arg = *argv++; - argc--; - - m_setPriority = true; - - if(!_stricmp(arg, "above_normal")) - { - m_priority = ABOVE_NORMAL_PRIORITY_CLASS; - } - else if(!_stricmp(arg, "below_normal")) - { - m_priority = BELOW_NORMAL_PRIORITY_CLASS; - } - else if(!_stricmp(arg, "high")) - { - m_priority = HIGH_PRIORITY_CLASS; - } - else if(!_stricmp(arg, "idle")) - { - m_priority = IDLE_PRIORITY_CLASS; - } - else if(!_stricmp(arg, "normal")) - { - m_priority = NORMAL_PRIORITY_CLASS; - } - else if(!_stricmp(arg, "realtime")) - { - m_priority = REALTIME_PRIORITY_CLASS; - } - else - { - m_setPriority = false; - - _ERROR("couldn't read priority argument (%s)", arg); - return false; - } - } - else - { - _ERROR("priority not specified"); - return false; - } - } - else if(!_stricmp(arg, "altexe")) - { - if(argc >= 1) - { - m_altEXE = *argv++; - argc--; - } - else - { - _ERROR("exe path not specified"); - return false; - } - } - else if(!_stricmp(arg, "altdll")) - { - if(argc >= 1) - { - m_altDLL = *argv++; - argc--; - } - else - { - _ERROR("dll path not specified"); - return false; - } - } - else if(!_stricmp(arg, "crconly")) - { - m_crcOnly = true; - } - else if(!_stricmp(arg, "h") || !_stricmp(arg, "help")) - { - m_optionsOnly = true; - } - else if(!_stricmp(arg, "waitforclose")) - { - m_waitForClose = true; - } - else if(!_stricmp(arg, "v")) - { - m_verbose = true; - } - else if(!_stricmp(arg, "minfo")) - { - m_moduleInfo = true; - } - else if(!_stricmp(arg, "noskiplauncher")) - { - m_skipLauncher = false; - } - else if(!_stricmp(arg, "launchsteam")) - { - m_launchSteam = true; - } - else if(!_stricmp(arg, "notimeout")) - { - m_noTimeout = true; - } - else if(!_stricmp(arg, "affinity")) - { - if(argc >= 1) - { - const char * maskStr = *argv++; - argc--; - - if(sscanf_s(maskStr, "%I64i", &m_affinity) != 1) - { - _ERROR("couldn't read affinity mask as an integer (%s)", maskStr); - return false; - } - } - else - { - _ERROR("affinity mask not specified"); - return false; - } - } - else if(!_stricmp(arg, "forcesteamloader")) - { - m_forceSteamLoader = true; - } - else - { - _ERROR("unknown switch (%s)", arg); - return false; - } - } - else - { - // free arg - - switch(freeArgCount) - { - default: - _ERROR("too many free args (%s)", arg); - return false; - } - } - } - } - - return Verify(); -} - -#pragma warning (pop) - -void Options::PrintUsage(void) -{ - gLog.SetPrintLevel(IDebugLog::kLevel_VerboseMessage); - - _MESSAGE("usage: skse64_loader [options]"); - _MESSAGE(""); - _MESSAGE("options:"); - _MESSAGE(" -h, -help - print this options list"); - _MESSAGE(" -editor - launch the construction set"); - _MESSAGE(" -priority - set the launched program\'s priority"); - _MESSAGE(" above_normal"); - _MESSAGE(" below_normal"); - _MESSAGE(" high"); - _MESSAGE(" idle"); - _MESSAGE(" normal"); - _MESSAGE(" realtime"); - _MESSAGE(" -altexe - set alternate exe path"); - _MESSAGE(" -altdll - set alternate dll path"); - _MESSAGE(" -crconly - just identify the EXE, don't launch anything"); - _MESSAGE(" -waitforclose - wait for the launched program to close"); - _MESSAGE(" -v - print verbose messages to the console"); - _MESSAGE(" -minfo - log information about the DLLs loaded in to the target process"); - _MESSAGE(" -noskiplauncher - does not skip the default Bethesda launcher window"); - _MESSAGE(" note: specifying this option may cause compatibility problems"); - _MESSAGE(" -launchsteam - attempt to launch steam if it is not running"); - _MESSAGE(" -affinity - set the processor affinity mask"); - _MESSAGE(" -forcesteamloader - override exe type detection and use steam loader"); -} - -bool Options::Verify(void) -{ - // nothing to verify currently - - return true; -} diff --git a/source/fs.dll/skse64/skse64_loader/Options.h b/source/fs.dll/skse64/skse64_loader/Options.h deleted file mode 100644 index 42d5ec2d..00000000 --- a/source/fs.dll/skse64/skse64_loader/Options.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -class Options -{ -public: - Options(); - ~Options(); - - bool Read(int argc, char ** argv); - - void PrintUsage(void); - - bool m_launchCS; - - bool m_setPriority; - DWORD m_priority; - - bool m_optionsOnly; - bool m_crcOnly; - bool m_waitForClose; - bool m_verbose; - bool m_moduleInfo; - bool m_skipLauncher; - bool m_launchSteam; - bool m_noTimeout; - bool m_forceSteamLoader; - - UInt64 m_affinity; - - std::string m_altEXE; - std::string m_altDLL; - -private: - bool Verify(void); -}; - -extern Options g_options; diff --git a/source/fs.dll/skse64/skse64_loader/main.cpp b/source/fs.dll/skse64/skse64_loader/main.cpp deleted file mode 100644 index 0b6f5d73..00000000 --- a/source/fs.dll/skse64/skse64_loader/main.cpp +++ /dev/null @@ -1,386 +0,0 @@ -#include -#include "skse64_common/skse_version.h" -#include "skse64_common/Utilities.h" -#include "skse64_loader_common/LoaderError.h" -#include "skse64_loader_common/IdentifyEXE.h" -#include "skse64_loader_common/Steam.h" -#include "skse64_loader_common/Inject.h" -#include -#include "common/IFileStream.h" -#include -#include "Options.h" - -IDebugLog gLog; - -static void PrintModuleInfo(UInt32 procID); -static void PrintProcessInfo(); - -int main(int argc, char ** argv) -{ - gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim Special Edition\\SKSE\\skse64_loader.log"); - gLog.SetPrintLevel(IDebugLog::kLevel_FatalError); - gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage); - - FILETIME now; - GetSystemTimeAsFileTime(&now); - - _MESSAGE("skse64 loader %08X %08X%08X %s", - PACKED_SKSE_VERSION, now.dwHighDateTime, now.dwLowDateTime, GetOSInfoStr().c_str()); - - if(!g_options.Read(argc, argv)) - { - PrintLoaderError("Couldn't read arguments."); - g_options.PrintUsage(); - - return 1; - } - - if(g_options.m_optionsOnly) - { - g_options.PrintUsage(); - return 0; - } - - if(g_options.m_verbose) - gLog.SetPrintLevel(IDebugLog::kLevel_VerboseMessage); - - if(g_options.m_launchCS) - { - PrintLoaderError("The editor should be launched directly."); - - return 1; - } - - // get process/dll names - bool dllHasFullPath = false; - const char * baseDllName = g_options.m_launchCS ? "skse64_editor" : "skse64"; - bool usedCustomRuntimeName = false; - - std::string procName; - - if(g_options.m_launchCS) - { - procName = "CreationKit.exe"; - } - else - { - procName = GetConfigOption("Loader", "RuntimeName"); - if(!procName.empty()) - { - _MESSAGE("using runtime name from config: %s", procName.c_str()); - usedCustomRuntimeName = true; - } - else - { - procName = "SkyrimSE.exe"; - - // simple check to see if someone kludge-patched the EXE - // don't kludge the EXE, use the .ini file RIGHT ABOVE HERE - UInt32 procNameCheck = - (procName[0] << 8) | - (procName[1] << 24) | - (procName[2] << 16) | - (procName[3] << 0); - - if(procNameCheck != 'kySr') - { - _ERROR("### someone kludged the default process name to (%s), don't ask me for support with your install ###", procName.c_str()); - } - - // check to see if someone screwed up their install - std::string appName = GetRuntimeName(); - if(!_stricmp(appName.c_str(), procName.c_str())) - { - PrintLoaderError("You have renamed skse64_loader and have not specified the name of the runtime."); - - return 1; - } - } - } - - const std::string & runtimeDir = GetRuntimeDirectory(); - std::string procPath = runtimeDir + "\\" + procName; - - if(g_options.m_altEXE.size()) - { - procPath = g_options.m_altEXE; - _MESSAGE("launching alternate exe (%s)", procPath.c_str()); - } - - _MESSAGE("procPath = %s", procPath.c_str()); - - // check if the exe exists - { - IFileStream fileCheck; - if(!fileCheck.Open(procPath.c_str())) - { - if(usedCustomRuntimeName) - { - // hurr durr - PrintLoaderError("Couldn't find %s. You have customized the runtime name via SKSE64's .ini file, and that file does not exist. This can usually be fixed by removing the RuntimeName line from the .ini file.)", procName.c_str()); - } - else - { - PrintLoaderError("Couldn't find %s.", procName.c_str()); - } - - return 1; - } - } - - _MESSAGE("launching: %s (%s)", procName.c_str(), procPath.c_str()); - - if(g_options.m_altDLL.size()) - { - baseDllName = g_options.m_altDLL.c_str(); - _MESSAGE("launching alternate dll (%s)", baseDllName); - - dllHasFullPath = true; - } - - std::string dllSuffix; - ProcHookInfo procHookInfo; - - // check exe version - if(!IdentifyEXE(procPath.c_str(), g_options.m_launchCS, &dllSuffix, &procHookInfo)) - { - _ERROR("unknown exe"); - - if(usedCustomRuntimeName) - { - // hurr durr - PrintLoaderError("You have customized the runtime name via SKSE64's .ini file. Version errors can usually be fixed by removing the RuntimeName line from the .ini file."); - } - - return 1; - } - - if(g_options.m_crcOnly) - return 0; - - // build dll path - std::string dllPath; - if(dllHasFullPath) - { - dllPath = baseDllName; - } - else - { - dllPath = runtimeDir + "\\" + baseDllName + "_" + dllSuffix + ".dll"; - } - - _MESSAGE("dll = %s", dllPath.c_str()); - - // check to make sure the dll exists - { - IFileStream tempFile; - - if(!tempFile.Open(dllPath.c_str())) - { - PrintLoaderError("Couldn't find SKSE64 DLL (%s). Please make sure you have installed SKSE64 correctly and are running it from your Skyrim SE folder.", dllPath.c_str()); - return 1; - } - } - - // steam setup - if(procHookInfo.procType == kProcType_Steam) - { - if(g_options.m_launchSteam) - { - // if steam isn't running, launch it - if(!SteamCheckPassive()) - { - _MESSAGE("steam not running, launching it"); - - if(!SteamLaunch()) - { - _WARNING("failed to launch steam"); - } - } - } - - // same for standard and nogore - const char * kAppID = (g_options.m_launchCS == false ? "489830" : "???"); - - // set this no matter what to work around launch issues - SetEnvironmentVariable("SteamGameId", kAppID); - - if(g_options.m_skipLauncher) - { - SetEnvironmentVariable("SteamAppID", kAppID); - } - } - - // launch the app (suspended) - STARTUPINFO startupInfo = { 0 }; - PROCESS_INFORMATION procInfo = { 0 }; - - startupInfo.cb = sizeof(startupInfo); - - DWORD createFlags = CREATE_SUSPENDED; - if(g_options.m_setPriority) - createFlags |= g_options.m_priority; - - if(!CreateProcess( - procPath.c_str(), - NULL, // no args - NULL, // default process security - NULL, // default thread security - FALSE, // don't inherit handles - createFlags, - NULL, // no new environment - NULL, // no new cwd - &startupInfo, &procInfo)) - { - if(GetLastError() == 740) - { - PrintLoaderError("Launching %s failed (%d). Please try running skse64_loader as an administrator.", procPath.c_str(), GetLastError()); - } - else - { - PrintLoaderError("Launching %s failed (%d).", procPath.c_str(), GetLastError()); - } - - return 1; - } - - _MESSAGE("main thread id = %d", procInfo.dwThreadId); - - // set affinity if requested - if(g_options.m_affinity) - { - _MESSAGE("setting affinity mask to %016I64X", g_options.m_affinity); - - if(!SetProcessAffinityMask(procInfo.hProcess, g_options.m_affinity)) - { - _WARNING("couldn't set affinity mask (%08X)", GetLastError()); - } - } - - bool injectionSucceeded = false; - UInt32 procType = procHookInfo.procType; - - if(g_options.m_forceSteamLoader) - { - _MESSAGE("forcing steam loader"); - procType = kProcType_Steam; - } - - // inject the dll - switch(procType) - { - case kProcType_Steam: - { - std::string steamHookDllPath = runtimeDir + "\\skse64_steam_loader.dll"; - - injectionSucceeded = InjectDLLThread(&procInfo, steamHookDllPath.c_str(), true, g_options.m_noTimeout); - } - break; - - case kProcType_Normal: - injectionSucceeded = InjectDLLThread(&procInfo, dllPath.c_str(), true, g_options.m_noTimeout); - break; - - default: - HALT("impossible"); - } - - // start the process if successful - if(!injectionSucceeded) - { - PrintLoaderError("Couldn't inject DLL."); - - _ERROR("terminating process"); - - TerminateProcess(procInfo.hProcess, 0); - } - else - { - _MESSAGE("launching"); - - if(!ResumeThread(procInfo.hThread)) - { - _WARNING("WARNING: something has started the runtime outside of skse64_loader's control."); - _WARNING("SKSE64 will probably not function correctly."); - _WARNING("Try running skse64_loader as an administrator, or check for conflicts with a virus scanner."); - } - - if(g_options.m_moduleInfo) - { - Sleep(1000 * 3); // wait 3 seconds - - PrintModuleInfo(procInfo.dwProcessId); - PrintProcessInfo(); - } - - if(g_options.m_waitForClose) - WaitForSingleObject(procInfo.hProcess, INFINITE); - } - - // clean up - CloseHandle(procInfo.hProcess); - CloseHandle(procInfo.hThread); - - return 0; -} - -static void PrintModuleInfo(UInt32 procID) -{ - HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, procID); - if(snap != INVALID_HANDLE_VALUE) - { - MODULEENTRY32 module; - - module.dwSize = sizeof(module); - - if(Module32First(snap, &module)) - { - do - { - _MESSAGE("%08Xx%08X %08X %s %s", module.modBaseAddr, module.modBaseSize, module.hModule, module.szModule, module.szExePath); - } - while(Module32Next(snap, &module)); - } - else - { - _ERROR("PrintModuleInfo: Module32First failed (%d)", GetLastError()); - } - - CloseHandle(snap); - } - else - { - _ERROR("PrintModuleInfo: CreateToolhelp32Snapshot failed (%d)", GetLastError()); - } -} - -static void PrintProcessInfo() -{ - HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if(snap != INVALID_HANDLE_VALUE) - { - PROCESSENTRY32 proc; - - proc.dwSize = sizeof(PROCESSENTRY32); - - if(Process32First(snap, &proc)) - { - do - { - _MESSAGE("%s", proc.szExeFile); - proc.dwSize = sizeof(PROCESSENTRY32); - } - while (Process32Next(snap, &proc)); - } - else - { - _ERROR("PrintProcessInfo: Process32First failed (%d)", GetLastError()); - } - - CloseHandle(snap); - } - else - { - _ERROR("PrintProcessInfo: CreateToolhelp32Snapshot failed (%d)", GetLastError()); - } -} diff --git a/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj b/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj deleted file mode 100644 index eea155e7..00000000 --- a/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - - {6BDD43E4-A8D9-49CA-9F76-954718F295EE} - Win32Proj - skse64_loader - 8.1 - - - - - - - - - - Application - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - - - - - - - - - - - - - true - - - false - - - - - - Level3 - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreadedDebug - - - Console - true - version.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y - - - Installing Loader... - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreaded - - - Console - true - true - true - version.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y - - - Installing Loader... - - - - - - - - - - - - {472e19ab-def0-42df-819b-18722e8dc822} - - - {5fd1c08d-db80-480c-a1c6-f0920005cd13} - - - {fb6e1aeb-69b7-496e-a02c-9776fc0d6e0d} - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj.filters b/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj.filters deleted file mode 100644 index 06ebb096..00000000 --- a/source/fs.dll/skse64/skse64_loader/skse64_loader.vcxproj.filters +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_loader_common/CMakeLists.txt b/source/fs.dll/skse64/skse64_loader_common/CMakeLists.txt deleted file mode 100644 index 8583eb85..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/CMakeLists.txt +++ /dev/null @@ -1,113 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/versioning.cmake) - -project( - skse64_loader_common - VERSION ${SKSE_VERSION_MAJOR}.${SKSE_VERSION_MINOR}.${SKSE_VERSION_PATCH} - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Dependencies ---- - -find_package(common REQUIRED CONFIG) - -# ---- Add source files ---- - -include(cmake/headerlist.cmake) -include(cmake/sourcelist.cmake) - -source_group( - ${PROJECT_NAME} - FILES - ${headers} - ${sources} -) - -# ---- Create library ---- - -add_library( - ${PROJECT_NAME} - STATIC - ${headers} - ${sources} -) - -add_library(skse64::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -target_compile_definitions( - ${PROJECT_NAME} - PRIVATE - RUNTIME - RUNTIME_VERSION=${RUNTIME_VERSION_PACKED} -) - -target_compile_features( - ${PROJECT_NAME} - PUBLIC - cxx_std_11 -) - -target_include_directories( - ${PROJECT_NAME} - PUBLIC - $ - $ -) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC - xse::common -) - -# ---- Create an installable target ---- - -include(GNUInstallDirs) - -install( - TARGETS - ${PROJECT_NAME} - EXPORT - ${PROJECT_NAME}-targets -) - -install( - FILES - ${headers} - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -) - -configure_file( - cmake/config.cmake.in - ${PROJECT_NAME}-config.cmake - @ONLY -) - -install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -install( - EXPORT - ${PROJECT_NAME}-targets - NAMESPACE - skse64:: - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) diff --git a/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.cpp b/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.cpp deleted file mode 100644 index 16bf02d0..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.cpp +++ /dev/null @@ -1,360 +0,0 @@ -#include "IdentifyEXE.h" -#include "LoaderError.h" -#include "skse64_common/skse_version.h" -#include - -static bool GetFileVersion(const char * path, VS_FIXEDFILEINFO * info, std::string * outProductName, std::string * outProductVersion) -{ - bool result = false; - - UInt32 versionSize = GetFileVersionInfoSize(path, NULL); - if(!versionSize) - { - _ERROR("GetFileVersionInfoSize failed (%08X)", GetLastError()); - return false; - } - - UInt8 * versionBuf = new UInt8[versionSize]; - if(versionBuf) - { - if(GetFileVersionInfo(path, NULL, versionSize, versionBuf)) - { - VS_FIXEDFILEINFO * retrievedInfo = NULL; - UInt32 realVersionSize = sizeof(VS_FIXEDFILEINFO); - - if(VerQueryValue(versionBuf, "\\", (void **)&retrievedInfo, (PUINT)&realVersionSize) && retrievedInfo) - { - *info = *retrievedInfo; - result = true; - } - else - { - _ERROR("VerQueryValue failed (%08X)", GetLastError()); - } - - if(outProductName) - { - // try to get the product name, failure is ok - char * productName = NULL; - UInt32 productNameLen = 0; - if(VerQueryValue(versionBuf, "\\StringFileInfo\\040904B0\\ProductName", (void **)&productName, (PUINT)&productNameLen) && productNameLen && productName) - { - *outProductName = productName; - } - } - - { - char * productVersion = NULL; - UInt32 productVersionLen = 0; - if (VerQueryValue(versionBuf, "\\StringFileInfo\\040904B0\\ProductVersion", (void **)&productVersion, (PUINT)&productVersionLen) && productVersionLen && productVersion) - { - *outProductVersion = productVersion; - } - } - } - else - { - _ERROR("GetFileVersionInfo failed (%08X)", GetLastError()); - } - - delete [] versionBuf; - } - - return result; -} - -static bool VersionStrToInt(const std::string & verStr, UInt64 * out) -{ - UInt64 result = 0; - int parts[4]; - - if (sscanf_s(verStr.c_str(), "%d.%d.%d.%d", &parts[0], &parts[1], &parts[2], &parts[3]) != 4) - return false; - - for (int i = 0; i < 4; i++) - { - if (parts[i] > 0xFFFF) - return false; - - result <<= 16; - result |= parts[i]; - } - - *out = result; - - return true; -} - -static bool GetFileVersionData(const char * path, UInt64 * out, std::string * outProductName) -{ - std::string productVersionStr; - VS_FIXEDFILEINFO versionInfo; - if(!GetFileVersion(path, &versionInfo, outProductName, &productVersionStr)) - return false; - - _MESSAGE("dwSignature = %08X", versionInfo.dwSignature); - _MESSAGE("dwStrucVersion = %08X", versionInfo.dwStrucVersion); - _MESSAGE("dwFileVersionMS = %08X", versionInfo.dwFileVersionMS); - _MESSAGE("dwFileVersionLS = %08X", versionInfo.dwFileVersionLS); - _MESSAGE("dwProductVersionMS = %08X", versionInfo.dwProductVersionMS); - _MESSAGE("dwProductVersionLS = %08X", versionInfo.dwProductVersionLS); - _MESSAGE("dwFileFlagsMask = %08X", versionInfo.dwFileFlagsMask); - _MESSAGE("dwFileFlags = %08X", versionInfo.dwFileFlags); - _MESSAGE("dwFileOS = %08X", versionInfo.dwFileOS); - _MESSAGE("dwFileType = %08X", versionInfo.dwFileType); - _MESSAGE("dwFileSubtype = %08X", versionInfo.dwFileSubtype); - _MESSAGE("dwFileDateMS = %08X", versionInfo.dwFileDateMS); - _MESSAGE("dwFileDateLS = %08X", versionInfo.dwFileDateLS); - _MESSAGE("productVersionStr = %s", productVersionStr.c_str()); - - UInt64 version = 0; - if (!VersionStrToInt(productVersionStr, &version)) - return false; - - *out = version; - - return true; -} - -const IMAGE_SECTION_HEADER * GetImageSection(const UInt8 * base, const char * name) -{ - const IMAGE_DOS_HEADER * dosHeader = (IMAGE_DOS_HEADER *)base; - const IMAGE_NT_HEADERS * ntHeader = (IMAGE_NT_HEADERS *)(base + dosHeader->e_lfanew); - const IMAGE_SECTION_HEADER * sectionHeader = IMAGE_FIRST_SECTION(ntHeader); - - for(UInt32 i = 0; i < ntHeader->FileHeader.NumberOfSections; i++) - { - const IMAGE_SECTION_HEADER * section = §ionHeader[i]; - - if(!strcmp((const char *)section->Name, name)) - { - return section; - } - } - - return NULL; -} - -// steam EXE will have the .bind section -bool IsSteamImage(const UInt8 * base) -{ - return GetImageSection(base, ".bind") != NULL; -} - -bool IsUPXImage(const UInt8 * base) -{ - return GetImageSection(base, "UPX0") != NULL; -} - -bool IsWinStoreImage(const UInt8 * base) -{ - return GetImageSection(base, ".xbld") != NULL; -} - -bool ScanEXE(const char * path, ProcHookInfo * hookInfo) -{ - // open and map the file in to memory - HANDLE file = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(file == INVALID_HANDLE_VALUE) - { - _ERROR("ScanEXE: couldn't open file (%d)", GetLastError()); - return false; - } - - bool result = false; - - HANDLE mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); - if(mapping) - { - const UInt8 * fileBase = (const UInt8 *)MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); - if(fileBase) - { - // scan for packing type - bool isSteam = IsSteamImage(fileBase); - bool isUPX = IsUPXImage(fileBase); - bool isWinStore = IsWinStoreImage(fileBase); - - if(isUPX) - { - hookInfo->procType = kProcType_Packed; - } - else if(isSteam) - { - hookInfo->procType = kProcType_Steam; - } - else if(isWinStore) - { - hookInfo->procType = kProcType_WinStore; - } - else - { - hookInfo->procType = kProcType_Normal; - } - - result = true; - - UnmapViewOfFile(fileBase); - } - else - { - _ERROR("ScanEXE: couldn't map file (%d)", GetLastError()); - } - - CloseHandle(mapping); - } - else - { - _ERROR("ScanEXE: couldn't create file mapping (%d)", GetLastError()); - } - - CloseHandle(file); - - return result; -} - -bool IdentifyEXE(const char * procName, bool isEditor, std::string * dllSuffix, ProcHookInfo * hookInfo) -{ - UInt64 version; - std::string productName; - - // check file version - if(!GetFileVersionData(procName, &version, &productName)) - { - PrintLoaderError("Couldn't retrieve EXE version information."); - return false; - } - - _MESSAGE("version = %016I64X", version); - _MESSAGE("product name = %s", productName.c_str()); - - if(productName == "SKSE64") - { - _MESSAGE("found an SKSE64 component"); - return false; - } - - if(productName == "The Elder Scrolls V: Skyrim Special Edition Launcher") - { - PrintLoaderError("You have instructed skse64_loader to run the vanilla launcher, which cannot work. Most likely you have renamed files incorrectly."); - return false; - } - - // check protection type - if(!ScanEXE(procName, hookInfo)) - { - PrintLoaderError("Failed to identify EXE type."); - return false; - } - - switch(hookInfo->procType) - { - case kProcType_Steam: _MESSAGE("steam exe"); break; - case kProcType_Normal: _MESSAGE("normal exe"); break; - case kProcType_Packed: _MESSAGE("packed exe"); break; - case kProcType_WinStore: _MESSAGE("winstore exe"); break; - case kProcType_Unknown: - default: _MESSAGE("unknown exe type"); break; - } - - if(hookInfo->procType == kProcType_WinStore) - { - PrintLoaderError("The Windows Store (gamepass) version of Skyrim is not supported."); - return false; - } - - bool result = false; - - const UInt64 kCurVersion = - (UInt64(GET_EXE_VERSION_MAJOR(RUNTIME_VERSION)) << 48) | - (UInt64(GET_EXE_VERSION_MINOR(RUNTIME_VERSION)) << 32) | - (UInt64(GET_EXE_VERSION_BUILD(RUNTIME_VERSION)) << 16); - - // convert version resource to internal version format - UInt32 versionInternal = MAKE_EXE_VERSION(version >> 48, version >> 32, version >> 16); - - if(version < kCurVersion) - { -#if SKSE_TARGETING_BETA_VERSION - if(versionInternal == CURRENT_RELEASE_RUNTIME) - PrintLoaderError( - "You are using the version of SKSE64 intended for the Steam beta branch (%d.%d.%d).\n" - "Download and install the non-beta branch version (%s) from http://skse.silverlock.org/.", - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA, CURRENT_RELEASE_SKSE_STR); - else - PrintLoaderError( - "You are using Skyrim version %d.%d.%d, which is out of date and incompatible with this version of SKSE64 (%d.%d.%d). Update to the latest beta version.", - GET_EXE_VERSION_MAJOR(versionInternal), GET_EXE_VERSION_MINOR(versionInternal), GET_EXE_VERSION_BUILD(versionInternal), - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA); -#else - PrintLoaderError( - "You are using Skyrim version %d.%d.%d, which is out of date and incompatible with this version of SKSE64 (%d.%d.%d). Update to the latest version.", - GET_EXE_VERSION_MAJOR(versionInternal), GET_EXE_VERSION_MINOR(versionInternal), GET_EXE_VERSION_BUILD(versionInternal), - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA); -#endif - } - else if(version > kCurVersion) - { - PrintLoaderError( - "You are using a newer version of Skyrim than this version of SKSE64 supports.\n" - "If this version just came out, please be patient while we update our code.\n" - "In the meantime, please check http://skse.silverlock.org for updates.\n" - "Do not email about this!\n" - "Runtime: %d.%d.%d\n" - "SKSE64: %d.%d.%d", - GET_EXE_VERSION_MAJOR(versionInternal), GET_EXE_VERSION_MINOR(versionInternal), GET_EXE_VERSION_BUILD(versionInternal), - SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA); - } - else if(isEditor) - { - switch(hookInfo->procType) - { - case kProcType_Steam: - case kProcType_Normal: - case kProcType_WinStore: - *dllSuffix = ""; - - result = true; - - break; - case kProcType_Unknown: - default: - PrintLoaderError("Unsupported editor executable type."); - break; - } - } - else - { - char versionStr[256]; - sprintf_s(versionStr, "%d_%d_%d", GET_EXE_VERSION_MAJOR(versionInternal), GET_EXE_VERSION_MINOR(versionInternal), GET_EXE_VERSION_BUILD(versionInternal)); - - switch(hookInfo->procType) - { - case kProcType_Steam: - case kProcType_Normal: - *dllSuffix = versionStr; - - result = true; - - break; - - case kProcType_WinStore: - *dllSuffix = versionStr; - *dllSuffix += "_winstore"; - - result = true; - - break; - - case kProcType_Packed: - PrintLoaderError("Packed versions of Skyrim are not supported."); - break; - - case kProcType_Unknown: - default: - PrintLoaderError("Unknown executable type."); - break; - } - } - - return result; -} diff --git a/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.h b/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.h deleted file mode 100644 index 88fdf817..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/IdentifyEXE.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -enum -{ - kProcType_Steam, - kProcType_Normal, - kProcType_WinStore, - - kProcType_Packed, - - kProcType_Unknown -}; - -struct ProcHookInfo -{ - UInt64 version; - UInt32 procType; -}; - -bool IdentifyEXE(const char * procName, bool isEditor, std::string * dllSuffix, ProcHookInfo * hookInfo); diff --git a/source/fs.dll/skse64/skse64_loader_common/Inject.cpp b/source/fs.dll/skse64/skse64_loader_common/Inject.cpp deleted file mode 100644 index f1b61f0d..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/Inject.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "LoaderError.h" -#include "IdentifyEXE.h" -#include "common/IFileStream.h" - -// remote thread creation - -static bool DoInjectDLLThread(PROCESS_INFORMATION * info, const char * dllPath, bool sync, bool noTimeout); - -bool InjectDLLThread(PROCESS_INFORMATION * info, const char * dllPath, bool sync, bool noTimeout) -{ - bool result = false; - - // wrap DLL injection in SEH, if it crashes print a message - __try { - result = DoInjectDLLThread(info, dllPath, sync, noTimeout); - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - PrintLoaderError("DLL injection failed. In most cases, this is caused by an overly paranoid software firewall or antivirus package. Disabling either of these may solve the problem."); - result = false; - } - - return result; -} - -/* - 48:83EC 28 | sub rsp, 28 | - 48:8BD9 | mov rbx,rcx | save to non-volatile register - 48:8D4B 10 | lea rcx,qword ptr ds:[rbx+10] | offsetof(InjectDLLThreadData, dllPath) - FF13 | call qword ptr ds:[rbx] | offsetof(InjectDLLThreadData, loadLibraryA) - 48:8BC8 | mov rcx,rax | - BA 01000000 | mov edx,1 | - FF53 08 | call qword ptr ds:[rbx+8] | offsetof(InjectDLLThreadData, getProcAddress) - FFD0 | call rax | - 48:83C4 28 | add rsp, 28 | - C3 | ret | -*/ - -struct InjectDLLThreadData -{ - InjectDLLThreadData(uintptr_t _loadLibraryA, uintptr_t _getProcAddress, const char * _dllPath) - { - memset(this, 0, sizeof(*this)); - loadLibraryA = _loadLibraryA; - getProcAddress = _getProcAddress; - strcpy_s(dllPath, sizeof(dllPath), _dllPath); - - static const UInt8 kCode[] = - { - 0x48, 0x83, 0xEC, 0x28, - 0x48, 0x8B, 0xD9, - 0x48, 0x8D, 0x4B, 0x10, - 0xFF, 0x13, - 0x48, 0x8B, 0xC8, - 0xBA, 0x01, 0x00, 0x00, 0x00, - 0xFF, 0x53, 0x08, - 0xFF, 0xD0, - 0x48, 0x83, 0xC4, 0x28, - 0xC3, - }; - - memcpy(code, kCode, sizeof(kCode)); - } - - uintptr_t loadLibraryA; // 00 - uintptr_t getProcAddress; // 08 - char dllPath[2048]; // 10 - UInt8 code[128]; // 810 -}; - -static bool DoInjectDLLThread(PROCESS_INFORMATION * info, const char * dllPath, bool sync, bool noTimeout) -{ - bool result = false; - - // make sure the dll exists - IFileStream fileCheck; - if(!fileCheck.Open(dllPath)) - { - PrintLoaderError("Couldn't find %s.", dllPath); - return false; - } - - fileCheck.Close(); - - HANDLE process = OpenProcess( - PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, FALSE, info->dwProcessId); - if(process) - { - uintptr_t hookBase = (uintptr_t)VirtualAllocEx(process, NULL, 8192, MEM_COMMIT, PAGE_EXECUTE_READWRITE); - if(hookBase) - { - // safe because kernel32 is loaded at the same address in all processes - // (can change across restarts) - uintptr_t loadLibraryAAddr = (uintptr_t)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); - uintptr_t getProcAddressAddr = (uintptr_t)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProcAddress"); - - _MESSAGE("hookBase = %016I64X", hookBase); - _MESSAGE("loadLibraryAAddr = %016I64X", loadLibraryAAddr); - _MESSAGE("getProcAddressAddr = %016I64X", getProcAddressAddr); - - InjectDLLThreadData data(loadLibraryAAddr, getProcAddressAddr, dllPath); - - size_t bytesWritten; - WriteProcessMemory(process, (LPVOID)hookBase, (void *)&data, sizeof(data), &bytesWritten); - - auto * remoteData = (InjectDLLThreadData *)hookBase; - - HANDLE thread = CreateRemoteThread(process, NULL, 0, (LPTHREAD_START_ROUTINE)(&remoteData->code), (void *)remoteData, 0, NULL); - if(thread) - { - if(sync) - { - switch(WaitForSingleObject(thread, noTimeout ? INFINITE : 1000 * 60)) // timeout = one minute - { - case WAIT_OBJECT_0: - _MESSAGE("hook thread complete"); - result = true; - break; - - case WAIT_ABANDONED: - _ERROR("Process::InstallHook: waiting for thread = WAIT_ABANDONED"); - break; - - case WAIT_TIMEOUT: - _ERROR("Process::InstallHook: waiting for thread = WAIT_TIMEOUT"); - break; - } - } - else - result = true; - - CloseHandle(thread); - } - else - _ERROR("CreateRemoteThread failed (%d)", GetLastError()); - - VirtualFreeEx(process, (LPVOID)hookBase, 0, MEM_RELEASE); - } - else - _ERROR("Process::InstallHook: couldn't allocate memory in target process"); - - CloseHandle(process); - } - else - _ERROR("Process::InstallHook: couldn't get process handle"); - - return result; -} diff --git a/source/fs.dll/skse64/skse64_loader_common/Inject.h b/source/fs.dll/skse64/skse64_loader_common/Inject.h deleted file mode 100644 index 49c73cb2..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/Inject.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "skse64_loader_common/IdentifyEXE.h" - -bool InjectDLL(PROCESS_INFORMATION * info, const char * dllPath, ProcHookInfo * hookInfo); -bool InjectDLLThread(PROCESS_INFORMATION * info, const char * dllPath, bool sync, bool noTimeout); diff --git a/source/fs.dll/skse64/skse64_loader_common/LoaderError.cpp b/source/fs.dll/skse64/skse64_loader_common/LoaderError.cpp deleted file mode 100644 index 10d9b0c4..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/LoaderError.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "LoaderError.h" -#include - -void PrintLoaderError(const char * fmt, ...) -{ - char buf[4096]; - - va_list args; - - va_start(args, fmt); - gLog.Log(IDebugLog::kLevel_FatalError, fmt, args); - va_end(args); - - va_start(args, fmt); - vsprintf_s(buf, sizeof(buf), fmt, args); - va_end(args); - - MessageBox(NULL, buf, "SKSE64 Loader", MB_OK | MB_ICONEXCLAMATION); -} diff --git a/source/fs.dll/skse64/skse64_loader_common/LoaderError.h b/source/fs.dll/skse64/skse64_loader_common/LoaderError.h deleted file mode 100644 index 4957f461..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/LoaderError.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void PrintLoaderError(const char * fmt, ...); diff --git a/source/fs.dll/skse64/skse64_loader_common/Steam.cpp b/source/fs.dll/skse64/skse64_loader_common/Steam.cpp deleted file mode 100644 index 8acc9695..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/Steam.cpp +++ /dev/null @@ -1,195 +0,0 @@ -#include "Steam.h" -#include "skse64_loader_common/LoaderError.h" -#include -#include - -std::string GetRegKey(HKEY root, const char * path, char * value) -{ - std::string result; - HKEY key; - - UInt32 err = RegOpenKeyEx(root, path, 0, KEY_READ, &key); - if(!err) - { - UInt32 dataLen = 0; - - // lol race condition - err = RegQueryValueEx(key, value, NULL, NULL, NULL, &dataLen); - if(!err) - { - result.resize(dataLen); - - err = RegQueryValueEx(key, value, NULL, NULL, (BYTE *)&result[0], &dataLen); - if(!err) - { - // trim null terminator - if(result.length() > 0) - result.resize(result.length() - 1); - } - else - { - _ERROR("GetRegKey: error getting value (%08X)", err); - } - } - else - { - _ERROR("GetRegKey: error querying value length (%08X)", err); - } - - RegCloseKey(key); - } - else - { - _ERROR("GetRegKey: registry key not found (%08X)", err); - } - - return result; -} - -std::string GetSteamRoot(void) -{ - return GetRegKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Valve\\Steam", "InstallPath"); -} - -std::string GetSteamClientDLLPath(void) -{ - return GetRegKey(HKEY_CURRENT_USER, "SOFTWARE\\Valve\\Steam\\ActiveProcess", "SteamClientDll"); -} - -bool SteamCheckPassive(void) -{ - bool result = false; - HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if(snap != INVALID_HANDLE_VALUE) - { - PROCESSENTRY32 proc; - - proc.dwSize = sizeof(proc); - - if(Process32First(snap, &proc)) - { - do - { - if(!_stricmp(proc.szExeFile, "steam.exe")) - { - _MESSAGE("found steam"); - result = true; - break; - } - } - while(Process32Next(snap, &proc)); - } - else - { - _ERROR("SteamCheck: Module32First failed (%d)", GetLastError()); - result = true; - } - - CloseHandle(snap); - } - else - { - _ERROR("SteamCheck: CreateToolhelp32Snapshot failed (%d)", GetLastError()); - result = true; // if for whatever reason we can't scan, assume steam is running - } - - return result; -} - -static bool SteamCheckActive(void) -{ - bool result = false; - - HMODULE steamAPI = LoadLibrary("steam_api.dll"); - if(steamAPI) - { - typedef bool (* _SteamAPI_IsSteamRunning)(void); - - _SteamAPI_IsSteamRunning SteamAPI_IsSteamRunning = NULL; - - // this just checks HKCU\Software\Valve\Steam\ActiveProcess\pid - // to see if it's running, however process IDs can be reused and it doesn't clean the registry key - // on exit - SteamAPI_IsSteamRunning = (_SteamAPI_IsSteamRunning)GetProcAddress(steamAPI, "SteamAPI_IsSteamRunning"); - - if(SteamAPI_IsSteamRunning) - { - UInt32 startTime = GetTickCount(); - const UInt32 kSteamTimeout = 10 * 1000; // 10 seconds - - while((GetTickCount() - startTime) >= kSteamTimeout) - { - if(SteamAPI_IsSteamRunning()) - { - result = true; - break; - } - - Sleep(100); - } - - if(!result) - { - _ERROR("timed out waiting for steam boot"); - } - } - else - { - _ERROR("couldn't get steam API ptr"); - } - - FreeLibrary(steamAPI); - } - else - { - _ERROR("couldn't load steam API DLL (%08X)", GetLastError()); - } - - return result; -} - -bool SteamLaunch(void) -{ - std::string steamRoot = GetSteamRoot(); - _MESSAGE("steam root = %s", steamRoot.c_str()); - - if(steamRoot.empty()) - return false; - - std::string steamEXEPath = steamRoot + "\\Steam.exe"; - - STARTUPINFO startupInfo = { 0 }; - PROCESS_INFORMATION procInfo = { 0 }; - - startupInfo.cb = sizeof(startupInfo); - - if(!CreateProcess( - steamEXEPath.c_str(), - NULL, // no args - NULL, // default process security - NULL, // default thread security - FALSE, // don't inherit handles - 0, // no options - NULL, // no new environment block - steamRoot.c_str(), // new cwd - &startupInfo, &procInfo)) - { - PrintLoaderError("Launching Steam failed (%08X).", GetLastError()); - return false; - } - - // this doesn't do anything useful - // bool result = SteamCheckActive(); - - // this is an ugly hack. wait for steam to start pumping messages - WaitForInputIdle(procInfo.hProcess, INFINITE); - - // and then you know some more just because even then it isn't ready - Sleep(1000 * 5); - - // clean up - CloseHandle(procInfo.hProcess); - CloseHandle(procInfo.hThread); - - return true; -} diff --git a/source/fs.dll/skse64/skse64_loader_common/Steam.h b/source/fs.dll/skse64/skse64_loader_common/Steam.h deleted file mode 100644 index 50143a48..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/Steam.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -bool SteamCheckPassive(void); -bool SteamLaunch(void); diff --git a/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj b/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj deleted file mode 100644 index f622aa7f..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - {472e19ab-def0-42df-819b-18722e8dc822} - - - {5fd1c08d-db80-480c-a1c6-f0920005cd13} - - - - {FB6E1AEB-69B7-496E-A02C-9776FC0D6E0D} - Win32Proj - skse64_loader_common - 8.1 - - - - StaticLibrary - true - v140 - MultiByte - - - StaticLibrary - false - v140 - true - MultiByte - - - - - - - - - - - - - - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreadedDebug - - - Windows - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreaded - - - Windows - true - true - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj.filters b/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj.filters deleted file mode 100644 index b1dcb096..00000000 --- a/source/fs.dll/skse64/skse64_loader_common/skse64_loader_common.vcxproj.filters +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_steam_loader/CMakeLists.txt b/source/fs.dll/skse64/skse64_steam_loader/CMakeLists.txt deleted file mode 100644 index 18d28dd6..00000000 --- a/source/fs.dll/skse64/skse64_steam_loader/CMakeLists.txt +++ /dev/null @@ -1,96 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/versioning.cmake) - -project( - skse64_steam_loader - VERSION ${SKSE_VERSION_MAJOR}.${SKSE_VERSION_MINOR}.${SKSE_VERSION_PATCH} - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Build options ---- - -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) - -# ---- Dependencies ---- - -if (NOT TARGET skse64_common) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../skse64_common skse64_common) # bundled -endif() - -if (NOT TARGET skse64_loader_common) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../skse64_loader_common skse64_loader_common) # bundled -endif() - -# ---- Add source files ---- - -include(cmake/headerlist.cmake) -include(cmake/sourcelist.cmake) - -source_group( - ${PROJECT_NAME} - FILES - ${headers} - ${sources} - skse64_steam_loader.def -) - -# ---- Create library ---- - -add_library( - ${PROJECT_NAME} - SHARED - ${headers} - ${sources} - skse64_steam_loader.def - ${skse64_common_SOURCE_DIR}/skse_version.rc -) - -add_library(skse64::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/configuration.cmake) - -target_compile_features( - ${PROJECT_NAME} - PUBLIC - cxx_std_11 -) - -target_include_directories( - ${PROJECT_NAME} - PUBLIC - $ - $ -) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC - skse64::skse64_common - skse64::skse64_loader_common - Version.lib -) - -# ---- Configure all targets ---- - -set_target_properties( - ${PROJECT_NAME} - skse64_common - skse64_loader_common - PROPERTIES - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" -) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/installation.cmake) diff --git a/source/fs.dll/skse64/skse64_steam_loader/main.cpp b/source/fs.dll/skse64/skse64_steam_loader/main.cpp deleted file mode 100644 index 9ba957d1..00000000 --- a/source/fs.dll/skse64/skse64_steam_loader/main.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "skse64_common/skse_version.h" -#include "skse64_common/Utilities.h" -#include "skse64_common/SafeWrite.h" -#include "skse64_loader_common/IdentifyEXE.h" -#include -#include -#include - -IDebugLog gLog; -HANDLE g_dllHandle; - -static void OnAttach(void); -static void HookMain(void * retAddr); -static void HookIAT(); - -BOOL WINAPI DllMain(HANDLE procHandle, DWORD reason, LPVOID reserved) -{ - if(reason == DLL_PROCESS_ATTACH) - { - g_dllHandle = procHandle; - } - - return TRUE; -} - -static void OnAttach(void) -{ - gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim Special Edition\\SKSE\\skse64_steam_loader.log"); - gLog.SetPrintLevel(IDebugLog::kLevel_Error); - gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage); - - FILETIME now; - GetSystemTimeAsFileTime(&now); - - _MESSAGE("skse64 loader %08X (steam) %08X%08X %s", PACKED_SKSE_VERSION, now.dwHighDateTime, now.dwLowDateTime, GetOSInfoStr().c_str()); - _MESSAGE("loader base addr = %016I64X", g_dllHandle); - _MESSAGE("exe base addr = %016I64X", GetModuleHandle(NULL)); - - // hook an imported function early so we can inject our code - HookIAT(); -} - -// api-ms-win-crt-runtime-l1-1-0.dll -typedef char * (*__get_narrow_winmain_command_line)(); -__get_narrow_winmain_command_line _get_narrow_winmain_command_line_Original = NULL; - -static char * _get_narrow_winmain_command_line_Hook() -{ - HookMain(_ReturnAddress()); - - return _get_narrow_winmain_command_line_Original(); -} - -static void HookIAT() -{ - __get_narrow_winmain_command_line * iat = (__get_narrow_winmain_command_line *)GetIATAddr(GetModuleHandle(NULL), "api-ms-win-crt-runtime-l1-1-0.dll", "_get_narrow_winmain_command_line"); - if(iat) - { - _MESSAGE("found iat at %016I64X", iat); - - _get_narrow_winmain_command_line_Original = *iat; - _MESSAGE("original thunk %016I64X", _get_narrow_winmain_command_line_Original); - - SafeWrite64(uintptr_t(iat), (UInt64)_get_narrow_winmain_command_line_Hook); - _MESSAGE("patched iat"); - } - else - { - _MESSAGE("couldn't find _get_narrow_winmain_command_line"); - } -} - -bool hookInstalled = false; -std::string g_dllPath; - -static void HookMain(void * retAddr) -{ - if(hookInstalled) - return; - else - hookInstalled = true; - - _MESSAGE("HookMain: thread = %d retaddr = %016I64X", GetCurrentThreadId(), retAddr); - - std::string runtimePath = GetRuntimePath(); - _MESSAGE("runtimePath = %s", runtimePath.c_str()); - - bool isEditor = false; - - // check version etc - std::string dllSuffix; - ProcHookInfo procHookInfo; - - if(!IdentifyEXE(runtimePath.c_str(), isEditor, &dllSuffix, &procHookInfo)) - { - _ERROR("unknown exe"); - return; - } - - const char * dllPrefix = (isEditor == false) ? "\\skse64_" : "\\skse64_editor_"; - - g_dllPath = GetRuntimeDirectory() + dllPrefix + dllSuffix + ".dll"; - _MESSAGE("dll = %s", g_dllPath.c_str()); - - HMODULE dll = LoadLibrary(g_dllPath.c_str()); - if(dll) - { - typedef void (* EntryPoint)(void); - EntryPoint entryPoint = (EntryPoint)GetProcAddress(dll, "StartSKSE"); - if(entryPoint) - { - entryPoint(); - } - else - { - _ERROR("entry point not found"); - } - } - else - { - _ERROR("couldn't load DLL"); - } -} - -extern "C" -{ - void InitSKSESteamLoader() - { - OnAttach(); - } -} diff --git a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.def b/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.def deleted file mode 100644 index d8f54a95..00000000 --- a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS -InitSKSESteamLoader @1 \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj b/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj deleted file mode 100644 index d4d37bc5..00000000 --- a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - - {F592B749-2333-4C63-9E97-0EB8FEC4D734} - Win32Proj - skse64_steam_loader - 8.1 - - - - DynamicLibrary - true - v140 - MultiByte - - - DynamicLibrary - false - v140 - true - MultiByte - - - - - - - - - - - - - - - true - - - false - - - - - - Level3 - Disabled - _DEBUG;_WINDOWS;_USRDLL;SKSE64_STEAM_LOADER_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreadedDebug - - - Windows - true - version.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y - - - Installing Steam Loader... - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_WINDOWS;_USRDLL;SKSE64_STEAM_LOADER_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) - common/IPrefix.h - MultiThreaded - - - Windows - true - true - true - version.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y - - - Installing Steam Loader... - - - - - - - - {472e19ab-def0-42df-819b-18722e8dc822} - - - {5fd1c08d-db80-480c-a1c6-f0920005cd13} - - - {fb6e1aeb-69b7-496e-a02c-9776fc0d6e0d} - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj.filters b/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj.filters deleted file mode 100644 index e3fe79bf..00000000 --- a/source/fs.dll/skse64/skse64_steam_loader/skse64_steam_loader.vcxproj.filters +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/source/fs.dll/skse64/xbyak/CMakeLists.txt b/source/fs.dll/skse64/xbyak/CMakeLists.txt deleted file mode 100644 index ca90bf4c..00000000 --- a/source/fs.dll/skse64/xbyak/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -# ---- Project ---- - -project( - xbyak - VERSION 4.87 - LANGUAGES CXX -) - -# ---- Include guards ---- - -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message( - FATAL_ERROR - "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." -) -endif() - -# ---- Create library ---- - -include(GNUInstallDirs) - -add_library(${PROJECT_NAME} INTERFACE) -add_library(Xbyak::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - -target_include_directories( - ${PROJECT_NAME} - INTERFACE - $ - $ -) - -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}_Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -include(CMakePackageConfigHelpers) -write_basic_package_version_file( - "${PROJECT_NAME}ConfigVersion.cmake" - VERSION ${PROJECT_VERSION} - COMPATIBILITY AnyNewerVersion -) - -configure_package_config_file( - "${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - INSTALL_DESTINATION - ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake -) - -install( - EXPORT ${PROJECT_NAME}_Targets - FILE ${PROJECT_NAME}-targets.cmake - NAMESPACE Xbyak:: - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake -) - -install( - FILES - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake -) - -install( - FILES - xbyak.h - xbyak_bin2hex.h - xbyak_mnemonic.h - xbyak_util.h - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -) diff --git a/source/fs.dll/skse64/xbyak/COPYRIGHT b/source/fs.dll/skse64/xbyak/COPYRIGHT deleted file mode 100644 index 6840f2c3..00000000 --- a/source/fs.dll/skse64/xbyak/COPYRIGHT +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:727715fe05148c221bd921c1ba653945b104822eb9a4f65530ef42608b09c511 -size 3449 diff --git a/source/fs.dll/skse64/xbyak/xbyak.h b/source/fs.dll/skse64/xbyak/xbyak.h deleted file mode 100644 index f8835e69..00000000 --- a/source/fs.dll/skse64/xbyak/xbyak.h +++ /dev/null @@ -1,2234 +0,0 @@ -#pragma once -#ifndef XBYAK_XBYAK_H_ -#define XBYAK_XBYAK_H_ -/*! - @file xbyak.h - @brief Xbyak ; JIT assembler for x86(IA32)/x64 by C++ - @author herumi - @url https://github.com/herumi/xbyak, http://homepage1.nifty.com/herumi/soft/xbyak_e.html - @note modified new BSD license - http://opensource.org/licenses/BSD-3-Clause -*/ -#ifndef XBYAK_NO_OP_NAMES - #if not +0 // trick to detect whether 'not' is operator or not - #error "use -fno-operator-names option if you want to use and(), or(), xor(), not() as function names, Or define XBYAK_NO_OP_NAMES and use and_(), or_(), xor_(), not_()." - #endif -#endif - -#include // for debug print -#include -#include -#include -#include -#ifndef NDEBUG -#include -#endif - -//#define XBYAK_USE_MMAP_ALLOCATOR -#if !defined(__GNUC__) || defined(__MINGW32__) - #undef XBYAK_USE_MMAP_ALLOCATOR -#endif - -// This covers -std=(gnu|c)++(0x|11|1y), -stdlib=libc++, and modern Microsoft. -#if ((defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) ||\ - ((__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__))) - #include - #define XBYAK_STD_UNORDERED_MAP std::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::unordered_multimap - -// Clang/llvm-gcc and ICC-EDG in 'GCC-mode' always claim to be GCC 4.2, using -// libstdcxx 20070719 (from GCC 4.2.1, the last GPL 2 version). -// These headers have been expanded/fixed in various forks. -// In F.S.F. 'real' GCC, issues with the tr headers were resolved in GCC 4.5. -#elif defined(__GNUC__) && (__GNUC__ >= 4) && ((__GNUC_MINOR__ >= 5) || \ - ((__GLIBCXX__ >= 20070719) && (__GNUC_MINOR__ >= 2) && \ - (defined(__INTEL_COMPILER) || defined(__llvm__)))) - #include - #define XBYAK_STD_UNORDERED_MAP std::tr1::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::tr1::unordered_multimap - -#elif defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1600) - #include - #define XBYAK_STD_UNORDERED_MAP std::tr1::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::tr1::unordered_multimap - -#else - #include - #define XBYAK_STD_UNORDERED_MAP std::map - #define XBYAK_STD_UNORDERED_MULTIMAP std::multimap -#endif -#ifdef _WIN32 - #include - #include - #include -#elif defined(__GNUC__) - #include - #include - #include -#endif -#if !defined(_MSC_VER) || (_MSC_VER >= 1600) - #include -#endif - -#if defined(_WIN64) || defined(__MINGW64__) || (defined(__CYGWIN__) && defined(__x86_64__)) - #define XBYAK64_WIN -#elif defined(__x86_64__) - #define XBYAK64_GCC -#endif -#if !defined(XBYAK64) && !defined(XBYAK32) - #if defined(XBYAK64_GCC) || defined(XBYAK64_WIN) - #define XBYAK64 - #else - #define XBYAK32 - #endif -#endif - -#if (__cplusplus >= 201103) || (_MSC_VER >= 1800) - #define XBYAK_VARIADIC_TEMPLATE -#endif - -#ifdef _MSC_VER - #pragma warning(push) - #pragma warning(disable : 4514) /* remove inline function */ - #pragma warning(disable : 4786) /* identifier is too long */ - #pragma warning(disable : 4503) /* name is too long */ - #pragma warning(disable : 4127) /* constant expresison */ -#endif - -namespace Xbyak { - -#include "xbyak_bin2hex.h" - -enum { - DEFAULT_MAX_CODE_SIZE = 4096, - VERSION = 0x4870 /* 0xABCD = A.BC(D) */ -}; - -#ifndef MIE_INTEGER_TYPE_DEFINED -#define MIE_INTEGER_TYPE_DEFINED -#ifdef _MSC_VER - typedef unsigned __int64 uint64; - typedef __int64 sint64; -#else - typedef uint64_t uint64; - typedef int64_t sint64; -#endif -typedef unsigned int uint32; -typedef unsigned short uint16; -typedef unsigned char uint8; -#endif - -#ifndef MIE_ALIGN - #ifdef _MSC_VER - #define MIE_ALIGN(x) __declspec(align(x)) - #else - #define MIE_ALIGN(x) __attribute__((aligned(x))) - #endif -#endif -#ifndef MIE_PACK // for shufps - #define MIE_PACK(x, y, z, w) ((x) * 64 + (y) * 16 + (z) * 4 + (w)) -#endif - -enum { - ERR_NONE = 0, - ERR_BAD_ADDRESSING, - ERR_CODE_IS_TOO_BIG, - ERR_BAD_SCALE, - ERR_ESP_CANT_BE_INDEX, - ERR_BAD_COMBINATION, - ERR_BAD_SIZE_OF_REGISTER, - ERR_IMM_IS_TOO_BIG, - ERR_BAD_ALIGN, - ERR_LABEL_IS_REDEFINED, - ERR_LABEL_IS_TOO_FAR, - ERR_LABEL_IS_NOT_FOUND, - ERR_CODE_ISNOT_COPYABLE, - ERR_BAD_PARAMETER, - ERR_CANT_PROTECT, - ERR_CANT_USE_64BIT_DISP, - ERR_OFFSET_IS_TOO_BIG, - ERR_MEM_SIZE_IS_NOT_SPECIFIED, - ERR_BAD_MEM_SIZE, - ERR_BAD_ST_COMBINATION, - ERR_OVER_LOCAL_LABEL, // not used - ERR_UNDER_LOCAL_LABEL, - ERR_CANT_ALLOC, - ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW, - ERR_BAD_PROTECT_MODE, - ERR_BAD_PNUM, - ERR_BAD_TNUM, - ERR_BAD_VSIB_ADDRESSING, - ERR_CANT_CONVERT, - ERR_LABEL_ISNOT_SET_BY_L, - ERR_LABEL_IS_ALREADY_SET_BY_L, - ERR_BAD_LABEL_STR, - ERR_MUNMAP, - ERR_INTERNAL -}; - -class Error : public std::exception { - int err_; -public: - explicit Error(int err) : err_(err) - { - if (err_ < 0 || err_ > ERR_INTERNAL) { - fprintf(stderr, "bad err=%d in Xbyak::Error\n", err_); - exit(1); - } - } - operator int() const { return err_; } - const char *what() const throw() - { - static const char *errTbl[] = { - "none", - "bad addressing", - "code is too big", - "bad scale", - "esp can't be index", - "bad combination", - "bad size of register", - "imm is too big", - "bad align", - "label is redefined", - "label is too far", - "label is not found", - "code is not copyable", - "bad parameter", - "can't protect", - "can't use 64bit disp(use (void*))", - "offset is too big", - "MEM size is not specified", - "bad mem size", - "bad st combination", - "over local label", - "under local label", - "can't alloc", - "T_SHORT is not supported in AutoGrow", - "bad protect mode", - "bad pNum", - "bad tNum", - "bad vsib addressing", - "can't convert", - "label is not set by L()", - "label is already set by L()", - "bad label string", - "err munmap", - "internal error", - }; - assert((size_t)err_ < sizeof(errTbl) / sizeof(*errTbl)); - return errTbl[err_]; - } -}; - -inline const char *ConvertErrorToString(Error err) -{ - return err.what(); -} - -inline void *AlignedMalloc(size_t size, size_t alignment) -{ -#ifdef __MINGW32__ - return __mingw_aligned_malloc(size, alignment); -#elif defined(_WIN32) - return _aligned_malloc(size, alignment); -#else - void *p; - int ret = posix_memalign(&p, alignment, size); - return (ret == 0) ? p : 0; -#endif -} - -inline void AlignedFree(void *p) -{ -#ifdef __MINGW32__ - __mingw_aligned_free(p); -#elif defined(_MSC_VER) - _aligned_free(p); -#else - free(p); -#endif -} - -template -inline const To CastTo(From p) throw() -{ - return (const To)(size_t)(p); -} -namespace inner { - -static const size_t ALIGN_PAGE_SIZE = 4096; - -inline bool IsInDisp8(uint32 x) { return 0xFFFFFF80 <= x || x <= 0x7F; } -inline bool IsInInt32(uint64 x) { return ~uint64(0x7fffffffu) <= x || x <= 0x7FFFFFFFU; } - -inline uint32 VerifyInInt32(uint64 x) -{ -#ifdef XBYAK64 - if (!IsInInt32(x)) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - return static_cast(x); -} - -enum LabelMode { - LasIs, // as is - Labs, // absolute - LaddTop // (addr + top) for mov(reg, label) with AutoGrow -}; - -} // inner - -/* - custom allocator -*/ -struct Allocator { - virtual uint8 *alloc(size_t size) { return reinterpret_cast(AlignedMalloc(size, inner::ALIGN_PAGE_SIZE)); } - virtual void free(uint8 *p) { AlignedFree(p); } - virtual ~Allocator() {} - /* override to return false if you call protect() manually */ - virtual bool useProtect() const { return true; } -}; - -#ifdef XBYAK_USE_MMAP_ALLOCATOR -class MmapAllocator : Allocator { - typedef XBYAK_STD_UNORDERED_MAP SizeList; - SizeList sizeList_; -public: - uint8 *alloc(size_t size) - { - const size_t alignedSizeM1 = inner::ALIGN_PAGE_SIZE - 1; - size = (size + alignedSizeM1) & ~alignedSizeM1; -#ifdef MAP_ANONYMOUS - const int mode = MAP_PRIVATE | MAP_ANONYMOUS; -#elif defined(MAP_ANON) - const int mode = MAP_PRIVATE | MAP_ANON; -#else - #error "not supported" -#endif - void *p = mmap(NULL, size, PROT_READ | PROT_WRITE, mode, -1, 0); - if (p == MAP_FAILED) throw Error(ERR_CANT_ALLOC); - assert(p); - sizeList_[(uintptr_t)p] = size; - return (uint8*)p; - } - void free(uint8 *p) - { - if (p == 0) return; - SizeList::iterator i = sizeList_.find((uintptr_t)p); - if (i == sizeList_.end()) throw Error(ERR_BAD_PARAMETER); - if (munmap((void*)i->first, i->second) < 0) throw Error(ERR_MUNMAP); - sizeList_.erase(i); - } -}; -#endif - -class Operand { -private: - uint8 idx_; // 0..15, MSB = 1 if spl/bpl/sil/dil - uint8 kind_; - uint16 bit_; -public: - enum Kind { - NONE = 0, - MEM = 1 << 1, - IMM = 1 << 2, - REG = 1 << 3, - MMX = 1 << 4, - XMM = 1 << 5, - FPU = 1 << 6, - YMM = 1 << 7 - }; - enum Code { -#ifdef XBYAK64 - RAX = 0, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15, - R8D = 8, R9D, R10D, R11D, R12D, R13D, R14D, R15D, - R8W = 8, R9W, R10W, R11W, R12W, R13W, R14W, R15W, - R8B = 8, R9B, R10B, R11B, R12B, R13B, R14B, R15B, - SPL = 4, BPL, SIL, DIL, -#endif - EAX = 0, ECX, EDX, EBX, ESP, EBP, ESI, EDI, - AX = 0, CX, DX, BX, SP, BP, SI, DI, - AL = 0, CL, DL, BL, AH, CH, DH, BH - }; - Operand() : idx_(0), kind_(0), bit_(0) { } - Operand(int idx, Kind kind, int bit, bool ext8bit = 0) - : idx_(static_cast(idx | (ext8bit ? 0x80 : 0))) - , kind_(static_cast(kind)) - , bit_(static_cast(bit)) - { - assert((bit_ & (bit_ - 1)) == 0); // bit must be power of two - } - Kind getKind() const { return static_cast(kind_); } - int getIdx() const { return idx_ & 15; } - bool isNone() const { return kind_ == 0; } - bool isMMX() const { return is(MMX); } - bool isXMM() const { return is(XMM); } - bool isYMM() const { return is(YMM); } - bool isREG(int bit = 0) const { return is(REG, bit); } - bool isMEM(int bit = 0) const { return is(MEM, bit); } - bool isFPU() const { return is(FPU); } - bool isExt8bit() const { return (idx_ & 0x80) != 0; } - // ah, ch, dh, bh? - bool isHigh8bit() const - { - if (!isBit(8)) return false; - if (isExt8bit()) return false; - const int idx = getIdx(); - return AH <= idx && idx <= BH; - } - // any bit is accetable if bit == 0 - bool is(int kind, uint32 bit = 0) const - { - return (kind_ & kind) && (bit == 0 || (bit_ & bit)); // cf. you can set (8|16) - } - bool isBit(uint32 bit) const { return (bit_ & bit) != 0; } - uint32 getBit() const { return bit_; } - const char *toString() const - { - const int idx = getIdx(); - if (kind_ == REG) { - if (isExt8bit()) { - static const char *tbl[4] = { "spl", "bpl", "sil", "dil" }; - return tbl[idx - 4]; - } - static const char *tbl[4][16] = { - { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }, - { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }, - { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }, - { "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }, - }; - return tbl[bit_ == 8 ? 0 : bit_ == 16 ? 1 : bit_ == 32 ? 2 : 3][idx]; - } else if (isYMM()) { - static const char *tbl[16] = { "ym0", "ym1", "ym2", "ym3", "ym4", "ym5", "ym6", "ym7", "ym8", "ym9", "ym10", "ym11", "ym12", "ym13", "ym14", "ym15" }; - return tbl[idx]; - } else if (isXMM()) { - static const char *tbl[16] = { "xm0", "xm1", "xm2", "xm3", "xm4", "xm5", "xm6", "xm7", "xm8", "xm9", "xm10", "xm11", "xm12", "xm13", "xm14", "xm15" }; - return tbl[idx]; - } else if (isMMX()) { - static const char *tbl[8] = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" }; - return tbl[idx]; - } else if (isFPU()) { - static const char *tbl[8] = { "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7" }; - return tbl[idx]; - } - throw Error(ERR_INTERNAL); - } - bool isSameNotInherited(const Operand& rhs) const { return idx_ == rhs.idx_ && kind_ == rhs.kind_ && bit_ == rhs.bit_; } - bool operator==(const Operand& rhs) const; - bool operator!=(const Operand& rhs) const { return !operator==(rhs); } -}; - -class Label; - -struct Reg8; -struct Reg16; -struct Reg32; -#ifdef XBYAK64 -struct Reg64; -#endif -class Reg : public Operand { - bool hasRex() const { return isExt8bit() | isREG(64) | isExtIdx(); } -public: - Reg() { } - Reg(int idx, Kind kind, int bit = 0, bool ext8bit = false) : Operand(idx, kind, bit, ext8bit) { } - Reg changeBit(int bit) const { return Reg(getIdx(), getKind(), bit, isExt8bit()); } - bool isExtIdx() const { return getIdx() > 7; } - uint8 getRex(const Reg& base = Reg()) const - { - return (hasRex() || base.hasRex()) ? uint8(0x40 | ((isREG(64) | base.isREG(64)) ? 8 : 0) | (isExtIdx() ? 4 : 0)| (base.isExtIdx() ? 1 : 0)) : 0; - } - Reg8 cvt8() const; - Reg16 cvt16() const; - Reg32 cvt32() const; -#ifdef XBYAK64 - Reg64 cvt64() const; -#endif -}; - -struct Reg8 : public Reg { - explicit Reg8(int idx = 0, bool ext8bit = false) : Reg(idx, Operand::REG, 8, ext8bit) { } -}; - -struct Reg16 : public Reg { - explicit Reg16(int idx = 0) : Reg(idx, Operand::REG, 16) { } -}; - -struct Mmx : public Reg { - explicit Mmx(int idx = 0, Kind kind = Operand::MMX, int bit = 64) : Reg(idx, kind, bit) { } -}; - -struct Xmm : public Mmx { - explicit Xmm(int idx = 0, Kind kind = Operand::XMM, int bit = 128) : Mmx(idx, kind, bit) { } -}; - -struct Ymm : public Xmm { - explicit Ymm(int idx = 0) : Xmm(idx, Operand::YMM, 256) { } -}; - -struct Fpu : public Reg { - explicit Fpu(int idx = 0) : Reg(idx, Operand::FPU, 32) { } -}; - -struct Reg32e : public Reg { - explicit Reg32e(int idx, int bit) : Reg(idx, Operand::REG, bit) {} -}; -struct Reg32 : public Reg32e { - explicit Reg32(int idx = 0) : Reg32e(idx, 32) {} -}; -#ifdef XBYAK64 -struct Reg64 : public Reg32e { - explicit Reg64(int idx = 0) : Reg32e(idx, 64) {} -}; -struct RegRip { - sint64 disp_; - Label* label_; - explicit RegRip(sint64 disp = 0, Label* label = 0) : disp_(disp), label_(label) {} - friend const RegRip operator+(const RegRip& r, sint64 disp) { - return RegRip(r.disp_ + disp, r.label_); - } - friend const RegRip operator-(const RegRip& r, sint64 disp) { - return RegRip(r.disp_ - disp, r.label_); - } - friend const RegRip operator+(const RegRip& r, Label& label) { - if (r.label_) throw Error(ERR_BAD_ADDRESSING); - return RegRip(r.disp_, &label); - } -}; -#endif - -inline Reg8 Reg::cvt8() const -{ - const int idx = getIdx(); - if (isBit(8)) return Reg8(idx, isExt8bit()); -#ifdef XBYAK32 - if (idx >= 4) throw Error(ERR_CANT_CONVERT); -#endif - return Reg8(idx, 4 <= idx && idx < 8); -} - -inline Reg16 Reg::cvt16() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg16(idx); -} - -inline Reg32 Reg::cvt32() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg32(idx); -} - -#ifdef XBYAK64 -inline Reg64 Reg::cvt64() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg64(idx); -} -#endif - -#ifndef XBYAK_DISABLE_SEGMENT -// not derived from Reg -class Segment { - int idx_; -public: - enum { - es, cs, ss, ds, fs, gs - }; - Segment(int idx) : idx_(idx) { assert(0 <= idx_ && idx_ < 6); } - int getIdx() const { return idx_; } - const char *toString() const - { - static const char tbl[][3] = { - "es", "cs", "ss", "ds", "fs", "gs" - }; - return tbl[idx_]; - } -}; -#endif - -class RegExp { -public: - struct SReg { - uint16 bit:9; // 32/64/128/256 none if 0 - uint16 idx:7; - SReg() : bit(0), idx(0) { } - void set(const Reg& r) { this->bit = uint16(r.getBit()); this->idx = uint16(r.getIdx()); } - bool operator==(const SReg& rhs) const { return bit == rhs.bit && idx == rhs.idx; } - }; - RegExp(size_t disp = 0) : disp_(disp), scale_(0) { } - RegExp(const Reg& r, int scale = 1) - : disp_(0) - , scale_(scale) - { - if (!r.is(Reg::REG, 32|64) && !r.is(Reg::XMM|Reg::YMM)) throw Error(ERR_BAD_SIZE_OF_REGISTER); - if (scale != 1 && scale != 2 && scale != 4 && scale != 8) throw Error(ERR_BAD_SCALE); - if (r.getBit() >= 128 || scale != 1) { // xmm/ymm is always index - index_.set(r); - } else { - base_.set(r); - } - } - bool isVsib() const { return index_.bit >= 128; } - bool isYMM() const { return index_.bit >= 256; } - RegExp optimize() const // select smaller size - { - // [reg * 2] => [reg + reg] - if (!isVsib() && !base_.bit && index_.bit && scale_ == 2) { - RegExp ret = *this; - ret.base_ = index_; - ret.scale_ = 1; - return ret; - } - return *this; - } - bool operator==(const RegExp& rhs) const - { - return base_ == rhs.base_ && index_ == rhs.index_ && disp_ == rhs.disp_; - } - const SReg& getBase() const { return base_; } - const SReg& getIndex() const { return index_; } - int getScale() const { return scale_; } - uint32 getDisp() const { return uint32(disp_); } - void verify() const - { - if (base_.bit >= 128) throw Error(ERR_BAD_SIZE_OF_REGISTER); - if (index_.bit && index_.bit <= 64) { - if (index_.idx == Operand::ESP) throw Error(ERR_ESP_CANT_BE_INDEX); - if (base_.bit && base_.bit != index_.bit) throw Error(ERR_BAD_SIZE_OF_REGISTER); - } - } -private: - friend RegExp operator+(const RegExp& a, const RegExp& b); - friend RegExp operator-(const RegExp& e, size_t disp); - /* - [base_ + index_ * scale_ + disp_] - base : Reg32e, index : Reg32e(w/o esp), Xmm, Ymm - */ - size_t disp_; - int scale_; - SReg base_; - SReg index_; -}; - -inline RegExp operator+(const RegExp& a, const RegExp& b) -{ - if (a.index_.bit && b.index_.bit) throw Error(ERR_BAD_ADDRESSING); - RegExp ret = a; - if (!ret.index_.bit) { ret.index_ = b.index_; ret.scale_ = b.scale_; } - if (b.base_.bit) { - if (ret.base_.bit) { - if (ret.index_.bit) throw Error(ERR_BAD_ADDRESSING); - // base + base => base + index * 1 - ret.index_ = b.base_; - // [reg + esp] => [esp + reg] - if (ret.index_.idx == Operand::ESP) std::swap(ret.base_, ret.index_); - ret.scale_ = 1; - } else { - ret.base_ = b.base_; - } - } - ret.disp_ += b.disp_; - return ret; -} -inline RegExp operator*(const Reg& r, int scale) -{ - return RegExp(r, scale); -} -inline RegExp operator-(const RegExp& e, size_t disp) -{ - RegExp ret = e; - ret.disp_ -= disp; - return ret; -} - -// 2nd parameter for constructor of CodeArray(maxSize, userPtr, alloc) -void *const AutoGrow = (void*)1; - -class CodeArray { - enum Type { - USER_BUF = 1, // use userPtr(non alignment, non protect) - ALLOC_BUF, // use new(alignment, protect) - AUTO_GROW // automatically move and grow memory if necessary - }; - CodeArray(const CodeArray& rhs); - void operator=(const CodeArray&); - bool isAllocType() const { return type_ == ALLOC_BUF || type_ == AUTO_GROW; } - struct AddrInfo { - size_t codeOffset; // position to write - size_t jmpAddr; // value to write - int jmpSize; // size of jmpAddr - inner::LabelMode mode; - AddrInfo(size_t _codeOffset, size_t _jmpAddr, int _jmpSize, inner::LabelMode _mode) - : codeOffset(_codeOffset), jmpAddr(_jmpAddr), jmpSize(_jmpSize), mode(_mode) {} - uint64 getVal(const uint8 *top) const - { - uint64 disp = (mode == inner::LaddTop) ? jmpAddr + size_t(top) : (mode == inner::LasIs) ? jmpAddr : jmpAddr - size_t(top); - if (jmpSize == 4) disp = inner::VerifyInInt32(disp); - return disp; - } - }; - typedef std::list AddrInfoList; - AddrInfoList addrInfoList_; - const Type type_; -#ifdef XBYAK_USE_MMAP_ALLOCATOR - MmapAllocator defaultAllocator_; -#else - Allocator defaultAllocator_; -#endif - Allocator *alloc_; -protected: - size_t maxSize_; - uint8 *top_; - size_t size_; - - /* - allocate new memory and copy old data to the new area - */ - void growMemory() - { - const size_t newSize = (std::max)(DEFAULT_MAX_CODE_SIZE, maxSize_ * 2); - uint8 *newTop = alloc_->alloc(newSize); - if (newTop == 0) throw Error(ERR_CANT_ALLOC); - for (size_t i = 0; i < size_; i++) newTop[i] = top_[i]; - alloc_->free(top_); - top_ = newTop; - maxSize_ = newSize; - } - /* - calc jmp address for AutoGrow mode - */ - void calcJmpAddress() - { - for (AddrInfoList::const_iterator i = addrInfoList_.begin(), ie = addrInfoList_.end(); i != ie; ++i) { - uint64 disp = i->getVal(top_); - rewrite(i->codeOffset, disp, i->jmpSize); - } - if (alloc_->useProtect() && !protect(top_, size_, true)) throw Error(ERR_CANT_PROTECT); - } -public: - explicit CodeArray(size_t maxSize, void *userPtr = 0, Allocator *allocator = 0) - : type_(userPtr == AutoGrow ? AUTO_GROW : userPtr ? USER_BUF : ALLOC_BUF) - , alloc_(allocator ? allocator : (Allocator*)&defaultAllocator_) - , maxSize_(maxSize) - , top_(type_ == USER_BUF ? reinterpret_cast(userPtr) : alloc_->alloc((std::max)(maxSize, 1))) - , size_(0) - { - if (maxSize_ > 0 && top_ == 0) throw Error(ERR_CANT_ALLOC); - if ((type_ == ALLOC_BUF && alloc_->useProtect()) && !protect(top_, maxSize, true)) { - alloc_->free(top_); - throw Error(ERR_CANT_PROTECT); - } - } - virtual ~CodeArray() - { - if (isAllocType()) { - if (alloc_->useProtect()) protect(top_, maxSize_, false); - alloc_->free(top_); - } - } - void resetSize() - { - size_ = 0; - addrInfoList_.clear(); - } - void db(int code) - { - if (size_ >= maxSize_) { - if (type_ == AUTO_GROW) { - growMemory(); - } else { - throw Error(ERR_CODE_IS_TOO_BIG); - } - } - top_[size_++] = static_cast(code); - } - void db(const uint8 *code, int codeSize) - { - for (int i = 0; i < codeSize; i++) db(code[i]); - } - void db(uint64 code, int codeSize) - { - if (codeSize > 8) throw Error(ERR_BAD_PARAMETER); - for (int i = 0; i < codeSize; i++) db(static_cast(code >> (i * 8))); - } - void dw(uint32 code) { db(code, 2); } - void dd(uint32 code) { db(code, 4); } - void dq(uint64 code) { db(code, 8); } - const uint8 *getCode() const { return top_; } - template - const F getCode() const { return CastTo(top_); } - const uint8 *getCurr() const { return &top_[size_]; } - template - const F getCurr() const { return CastTo(&top_[size_]); } - size_t getSize() const { return size_; } - void setSize(size_t size) - { - if (size > maxSize_) throw Error(ERR_OFFSET_IS_TOO_BIG); - size_ = size; - } - void dump() const - { - const uint8 *p = getCode(); - size_t bufSize = getSize(); - size_t remain = bufSize; - for (int i = 0; i < 4; i++) { - size_t disp = 16; - if (remain < 16) { - disp = remain; - } - for (size_t j = 0; j < 16; j++) { - if (j < disp) { - printf("%02X", p[i * 16 + j]); - } - } - putchar('\n'); - remain -= disp; - if (remain <= 0) { - break; - } - } - } - /* - @param offset [in] offset from top - @param disp [in] offset from the next of jmp - @param size [in] write size(1, 2, 4, 8) - */ - void rewrite(size_t offset, uint64 disp, size_t size) - { - assert(offset < maxSize_); - if (size != 1 && size != 2 && size != 4 && size != 8) throw Error(ERR_BAD_PARAMETER); - uint8 *const data = top_ + offset; - for (size_t i = 0; i < size; i++) { - data[i] = static_cast(disp >> (i * 8)); - } - } - void save(size_t offset, size_t val, int size, inner::LabelMode mode) - { - addrInfoList_.push_back(AddrInfo(offset, val, size, mode)); - } - bool isAutoGrow() const { return type_ == AUTO_GROW; } - /** - change exec permission of memory - @param addr [in] buffer address - @param size [in] buffer size - @param canExec [in] true(enable to exec), false(disable to exec) - @return true(success), false(failure) - */ - static inline bool protect(const void *addr, size_t size, bool canExec) - { -#if defined(_WIN32) - DWORD oldProtect; - return VirtualProtect(const_cast(addr), size, canExec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldProtect) != 0; -#elif defined(__GNUC__) - size_t pageSize = sysconf(_SC_PAGESIZE); - size_t iaddr = reinterpret_cast(addr); - size_t roundAddr = iaddr & ~(pageSize - static_cast(1)); - int mode = PROT_READ | PROT_WRITE | (canExec ? PROT_EXEC : 0); - return mprotect(reinterpret_cast(roundAddr), size + (iaddr - roundAddr), mode) == 0; -#else - return true; -#endif - } - /** - get aligned memory pointer - @param addr [in] address - @param alingedSize [in] power of two - @return aligned addr by alingedSize - */ - static inline uint8 *getAlignedAddress(uint8 *addr, size_t alignedSize = 16) - { - return reinterpret_cast((reinterpret_cast(addr) + alignedSize - 1) & ~(alignedSize - static_cast(1))); - } -}; - -class Address : public Operand { - mutable uint8 top_[6]; // 6 = 1(ModRM) + 1(SIB) + 4(disp) - uint8 size_; - uint8 rex_; - size_t disp_; - const Label* label_; - bool isOnlyDisp_; - bool is64bitDisp_; - bool is32bit_; - mutable bool isVsib_; - bool isYMM_; - void verify() const { if (isVsib_) throw Error(ERR_BAD_VSIB_ADDRESSING); } -public: - Address(uint32 sizeBit, bool isOnlyDisp, size_t disp, bool is32bit, bool is64bitDisp = false, bool isVsib = false, bool isYMM = false) - : Operand(0, MEM, sizeBit) - , size_(0) - , rex_(0) - , disp_(disp) - , label_(0) - , isOnlyDisp_(isOnlyDisp) - , is64bitDisp_(is64bitDisp) - , is32bit_(is32bit) - , isVsib_(isVsib) - , isYMM_(isYMM) - { - } - void db(int code) - { - if (size_ >= sizeof(top_)) throw Error(ERR_CODE_IS_TOO_BIG); - top_[size_++] = static_cast(code); - } - void dd(uint32 code) { for (int i = 0; i < 4; i++) db(code >> (i * 8)); } - const uint8 *getCode() const { return top_; } - size_t getSize() const { return size_; } - void updateRegField(uint8 regIdx) const - { - *top_ = (*top_ & B11000111) | ((regIdx << 3) & B00111000); - } - void setVsib(bool isVsib) const { isVsib_ = isVsib; } - bool isVsib() const { return isVsib_; } - bool isYMM() const { return isYMM_; } - bool is32bit() const { verify(); return is32bit_; } - bool isOnlyDisp() const { verify(); return isOnlyDisp_; } // for mov eax - size_t getDisp() const { verify(); return disp_; } - uint8 getRex() const { verify(); return rex_; } - bool is64bitDisp() const { verify(); return is64bitDisp_; } // for moffset - void setRex(uint8 rex) { rex_ = rex; } - void setLabel(const Label* label) { label_ = label; } - const Label* getLabel() const { return label_; } - bool operator==(const Address& rhs) const - { - return getBit() == rhs.getBit() && size_ == rhs.size_ && rex_ == rhs.rex_ && disp_ == rhs.disp_ && label_ == rhs.label_ && isOnlyDisp_ == rhs.isOnlyDisp_ - && is64bitDisp_ == rhs.is64bitDisp_ && is32bit_ == rhs.is32bit_ && isVsib_ == rhs.isVsib_ && isYMM_ == rhs.isYMM_; - } - bool operator!=(const Address& rhs) const { return !operator==(rhs); } -}; - -inline bool Operand::operator==(const Operand& rhs) const -{ - if (isMEM() && rhs.isMEM()) return static_cast(*this) == static_cast(rhs); - return isSameNotInherited(rhs); -} - -class AddressFrame { -private: - void operator=(const AddressFrame&); - Address makeAddress(const RegExp& e) const - { - e.verify(); - const bool isVsib = e.isVsib(); - const bool isYMM = e.isYMM(); - const RegExp::SReg& base = e.getBase(); - const RegExp::SReg& index = e.getIndex(); - const uint32 disp = e.getDisp(); - Address frame(bit_, (!base.bit && !index.bit), disp, base.bit == 32 || index.bit == 32, false, isVsib, isYMM); - enum { - mod00 = 0, mod01 = 1, mod10 = 2 - }; - int mod; - if (!base.bit || ((base.idx & 7) != Operand::EBP && disp == 0)) { - mod = mod00; - } else if (inner::IsInDisp8(disp)) { - mod = mod01; - } else { - mod = mod10; - } - const int baseIdx = base.bit ? (base.idx & 7) : Operand::EBP; - /* ModR/M = [2:3:3] = [Mod:reg/code:R/M] */ - bool hasSIB = index.bit || (base.idx & 7) == Operand::ESP; -#ifdef XBYAK64 - if (!base.bit && !index.bit) hasSIB = true; -#endif - if (hasSIB) { - frame.db((mod << 6) | Operand::ESP); - /* SIB = [2:3:3] = [SS:index:base(=rm)] */ - const int indexIdx = index.bit ? (index.idx & 7) : Operand::ESP; - const int scale = e.getScale(); - const int ss = (scale == 8) ? 3 : (scale == 4) ? 2 : (scale == 2) ? 1 : 0; - frame.db((ss << 6) | (indexIdx << 3) | baseIdx); - } else { - frame.db((mod << 6) | baseIdx); - } - if (mod == mod01) { - frame.db(disp); - } else if (mod == mod10 || (mod == mod00 && !base.bit)) { - frame.dd(disp); - } - int rex = ((index.idx >> 3) << 1) | (base.idx >> 3); - if (rex) rex |= 0x40; - frame.setRex(uint8(rex)); - return frame; - } -public: - const uint32 bit_; - explicit AddressFrame(uint32 bit) : bit_(bit) { } - Address operator[](const void *disp) const - { - size_t adr = reinterpret_cast(disp); -#ifdef XBYAK64 - if (adr > 0xFFFFFFFFU) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - RegExp e(static_cast(adr)); - return operator[](e); - } -#ifdef XBYAK64 - Address operator[](uint64 disp) const - { - return Address(64, true, disp, false, true); - } - Address operator[](const RegRip& addr) const - { - Address frame(bit_, true, addr.disp_, false); - frame.db(0x05); - if (addr.label_) { - frame.setLabel(addr.label_); - } else { - frame.dd(inner::VerifyInInt32(addr.disp_)); - } - return frame; - } -#endif - Address operator[](const RegExp& e) const - { - return makeAddress(e.optimize()); - } -}; - -struct JmpLabel { - size_t endOfJmp; /* offset from top to the end address of jmp */ - int jmpSize; - inner::LabelMode mode; - size_t disp; // disp for [rip + disp] - explicit JmpLabel(size_t endOfJmp = 0, int jmpSize = 0, inner::LabelMode mode = inner::LasIs, size_t disp = 0) - : endOfJmp(endOfJmp), jmpSize(jmpSize), mode(mode), disp(disp) - { - } -}; - -class LabelManager; - -class Label { - mutable LabelManager *mgr; - mutable int id; - friend class LabelManager; -public: - Label() : mgr(0), id(0) {} - Label(const Label& rhs); - Label& operator=(const Label& rhs); - ~Label(); - int getId() const { return id; } - - // backward compatibility - static std::string toStr(int num) - { - char buf[16]; -#ifdef _MSC_VER - _snprintf_s -#else - snprintf -#endif - (buf, sizeof(buf), ".%08x", num); - return buf; - } -}; - -class LabelManager { - // for string label - struct SlabelVal { - size_t offset; - SlabelVal(size_t offset) : offset(offset) {} - }; - typedef XBYAK_STD_UNORDERED_MAP SlabelDefList; - typedef XBYAK_STD_UNORDERED_MULTIMAP SlabelUndefList; - struct SlabelState { - SlabelDefList defList; - SlabelUndefList undefList; - }; - typedef std::list StateList; - // for Label class - struct ClabelVal { - ClabelVal(size_t offset = 0) : offset(offset), refCount(1) {} - size_t offset; - int refCount; - }; - typedef XBYAK_STD_UNORDERED_MAP ClabelDefList; - typedef XBYAK_STD_UNORDERED_MULTIMAP ClabelUndefList; - - CodeArray *base_; - // global : stateList_.front(), local : stateList_.back() - StateList stateList_; - mutable int labelId_; - ClabelDefList clabelDefList_; - ClabelUndefList clabelUndefList_; - - int getId(const Label& label) const - { - if (label.id == 0) label.id = labelId_++; - return label.id; - } - template - void define_inner(DefList& defList, UndefList& undefList, const T& labelId, size_t addrOffset) - { - // add label - typename DefList::value_type item(labelId, addrOffset); - std::pair ret = defList.insert(item); - if (!ret.second) throw Error(ERR_LABEL_IS_REDEFINED); - // search undefined label - for (;;) { - typename UndefList::iterator itr = undefList.find(labelId); - if (itr == undefList.end()) break; - const JmpLabel *jmp = &itr->second; - const size_t offset = jmp->endOfJmp - jmp->jmpSize; - size_t disp; - if (jmp->mode == inner::LaddTop) { - disp = addrOffset; - } else if (jmp->mode == inner::Labs) { - disp = size_t(base_->getCurr()); - } else { - disp = addrOffset - jmp->endOfJmp + jmp->disp; -#ifdef XBYAK64 - if (jmp->jmpSize <= 4 && !inner::IsInInt32(disp)) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - if (jmp->jmpSize == 1 && !inner::IsInDisp8((uint32)disp)) throw Error(ERR_LABEL_IS_TOO_FAR); - } - if (base_->isAutoGrow()) { - base_->save(offset, disp, jmp->jmpSize, jmp->mode); - } else { - base_->rewrite(offset, disp, jmp->jmpSize); - } - undefList.erase(itr); - } - } - template - bool getOffset_inner(const DefList& defList, size_t *offset, const T& label) const - { - typename DefList::const_iterator i = defList.find(label); - if (i == defList.end()) return false; - *offset = i->second.offset; - return true; - } - friend class Label; - void incRefCount(int id) { clabelDefList_[id].refCount++; } - void decRefCount(int id) - { - ClabelDefList::iterator i = clabelDefList_.find(id); - if (i == clabelDefList_.end()) return; - if (i->second.refCount == 1) { - clabelDefList_.erase(id); - } else { - --i->second.refCount; - } - } - template - bool hasUndefinedLabel_inner(const T& list) const - { -#ifndef NDEBUG - for (typename T::const_iterator i = list.begin(); i != list.end(); ++i) { - std::cerr << "undefined label:" << i->first << std::endl; - } -#endif - return !list.empty(); - } -public: - LabelManager() - { - reset(); - } - void reset() - { - base_ = 0; - labelId_ = 1; - stateList_.clear(); - stateList_.push_back(SlabelState()); - stateList_.push_back(SlabelState()); - clabelDefList_.clear(); - clabelUndefList_.clear(); - } - void enterLocal() - { - stateList_.push_back(SlabelState()); - } - void leaveLocal() - { - if (stateList_.size() <= 2) throw Error(ERR_UNDER_LOCAL_LABEL); - if (hasUndefinedLabel_inner(stateList_.back().undefList)) throw Error(ERR_LABEL_IS_NOT_FOUND); - stateList_.pop_back(); - } - void set(CodeArray *base) { base_ = base; } - void defineSlabel(std::string label) - { - if (label == "@b" || label == "@f") throw Error(ERR_BAD_LABEL_STR); - if (label == "@@") { - SlabelDefList& defList = stateList_.front().defList; - SlabelDefList::iterator i = defList.find("@f"); - if (i != defList.end()) { - defList.erase(i); - label = "@b"; - } else { - i = defList.find("@b"); - if (i != defList.end()) { - defList.erase(i); - } - label = "@f"; - } - } - SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - define_inner(st.defList, st.undefList, label, base_->getSize()); - } - void defineClabel(const Label& label) - { - define_inner(clabelDefList_, clabelUndefList_, getId(label), base_->getSize()); - label.mgr = this; - } - void assign(Label& dst, const Label& src) - { - ClabelDefList::const_iterator i = clabelDefList_.find(src.id); - if (i == clabelDefList_.end()) throw Error(ERR_LABEL_ISNOT_SET_BY_L); - define_inner(clabelDefList_, clabelUndefList_, dst.id, i->second.offset); - dst.mgr = this; - } - bool getOffset(size_t *offset, std::string& label) const - { - const SlabelDefList& defList = stateList_.front().defList; - if (label == "@b") { - if (defList.find("@f") != defList.end()) { - label = "@f"; - } else if (defList.find("@b") == defList.end()) { - throw Error(ERR_LABEL_IS_NOT_FOUND); - } - } else if (label == "@f") { - if (defList.find("@f") != defList.end()) { - label = "@b"; - } - } - const SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - return getOffset_inner(st.defList, offset, label); - } - bool getOffset(size_t *offset, const Label& label) const - { - return getOffset_inner(clabelDefList_, offset, getId(label)); - } - void addUndefinedLabel(const std::string& label, const JmpLabel& jmp) - { - SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - st.undefList.insert(SlabelUndefList::value_type(label, jmp)); - } - void addUndefinedLabel(const Label& label, const JmpLabel& jmp) - { - clabelUndefList_.insert(ClabelUndefList::value_type(label.id, jmp)); - } - bool hasUndefSlabel() const - { - for (StateList::const_iterator i = stateList_.begin(), ie = stateList_.end(); i != ie; ++i) { - if (hasUndefinedLabel_inner(i->undefList)) return true; - } - return false; - } - bool hasUndefClabel() const { return hasUndefinedLabel_inner(clabelUndefList_); } -}; - -inline Label::Label(const Label& rhs) -{ - id = rhs.id; - mgr = rhs.mgr; - if (mgr) mgr->incRefCount(id); -} -inline Label& Label::operator=(const Label& rhs) -{ - if (id) throw Error(ERR_LABEL_IS_ALREADY_SET_BY_L); - id = rhs.id; - mgr = rhs.mgr; - if (mgr) mgr->incRefCount(id); - return *this; -} -inline Label::~Label() -{ - if (id && mgr) mgr->decRefCount(id); -} - -class CodeGenerator : public CodeArray { -public: - enum LabelType { - T_SHORT, - T_NEAR, - T_AUTO // T_SHORT if possible - }; -private: - CodeGenerator operator=(const CodeGenerator&); // don't call -#ifdef XBYAK64 - enum { i32e = 32 | 64, BIT = 64 }; - static const size_t dummyAddr = (size_t(0x11223344) << 32) | 55667788; - typedef Reg64 NativeReg; -#else - enum { i32e = 32, BIT = 32 }; - static const size_t dummyAddr = 0x12345678; - typedef Reg32 NativeReg; -#endif - // (XMM, XMM|MEM) - static inline bool isXMM_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isXMM() || op2.isMEM()); - } - // (MMX, MMX|MEM) or (XMM, XMM|MEM) - static inline bool isXMMorMMX_MEM(const Operand& op1, const Operand& op2) - { - return (op1.isMMX() && (op2.isMMX() || op2.isMEM())) || isXMM_XMMorMEM(op1, op2); - } - // (XMM, MMX|MEM) - static inline bool isXMM_MMXorMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isMMX() || op2.isMEM()); - } - // (MMX, XMM|MEM) - static inline bool isMMX_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isMMX() && (op2.isXMM() || op2.isMEM()); - } - // (XMM, REG32|MEM) - static inline bool isXMM_REG32orMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isREG(i32e) || op2.isMEM()); - } - // (REG32, XMM|MEM) - static inline bool isREG32_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isREG(i32e) && (op2.isXMM() || op2.isMEM()); - } - // (REG32, REG32|MEM) - static inline bool isREG32_REG32orMEM(const Operand& op1, const Operand& op2) - { - return op1.isREG(i32e) && ((op2.isREG(i32e) && op1.getBit() == op2.getBit()) || op2.isMEM()); - } - void rex(const Operand& op1, const Operand& op2 = Operand()) - { - uint8 rex = 0; - const Operand *p1 = &op1, *p2 = &op2; - if (p1->isMEM()) std::swap(p1, p2); - if (p1->isMEM()) throw Error(ERR_BAD_COMBINATION); - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - if (BIT == 64 && addr.is32bit()) db(0x67); - rex = addr.getRex() | static_cast(*p1).getRex(); - } else { - // ModRM(reg, base); - rex = static_cast(op2).getRex(static_cast(op1)); - } - // except movsx(16bit, 32/64bit) - if ((op1.isBit(16) && !op2.isBit(i32e)) || (op2.isBit(16) && !op1.isBit(i32e))) db(0x66); - if (rex) db(rex); - } - enum AVXtype { - PP_NONE = 1 << 0, - PP_66 = 1 << 1, - PP_F3 = 1 << 2, - PP_F2 = 1 << 3, - MM_RESERVED = 1 << 4, - MM_0F = 1 << 5, - MM_0F38 = 1 << 6, - MM_0F3A = 1 << 7 - }; - void vex(bool r, int idx, bool is256, int type, bool x = false, bool b = false, int w = 1) - { - uint32 pp = (type & PP_66) ? 1 : (type & PP_F3) ? 2 : (type & PP_F2) ? 3 : 0; - uint32 vvvv = (((~idx) & 15) << 3) | (is256 ? 4 : 0) | pp; - if (!b && !x && !w && (type & MM_0F)) { - db(0xC5); db((r ? 0 : 0x80) | vvvv); - } else { - uint32 mmmm = (type & MM_0F) ? 1 : (type & MM_0F38) ? 2 : (type & MM_0F3A) ? 3 : 0; - db(0xC4); db((r ? 0 : 0x80) | (x ? 0 : 0x40) | (b ? 0 : 0x20) | mmmm); db((w << 7) | vvvv); - } - } - LabelManager labelMgr_; - bool isInDisp16(uint32 x) const { return 0xFFFF8000 <= x || x <= 0x7FFF; } - uint8 getModRM(int mod, int r1, int r2) const { return static_cast((mod << 6) | ((r1 & 7) << 3) | (r2 & 7)); } - void opModR(const Reg& reg1, const Reg& reg2, int code0, int code1 = NONE, int code2 = NONE) - { - rex(reg2, reg1); - db(code0 | (reg1.isBit(8) ? 0 : 1)); if (code1 != NONE) db(code1); if (code2 != NONE) db(code2); - db(getModRM(3, reg1.getIdx(), reg2.getIdx())); - } - void opModM(const Address& addr, const Reg& reg, int code0, int code1 = NONE, int code2 = NONE, int immSize = 0) - { - if (addr.is64bitDisp()) throw Error(ERR_CANT_USE_64BIT_DISP); - rex(addr, reg); - db(code0 | (reg.isBit(8) ? 0 : 1)); if (code1 != NONE) db(code1); if (code2 != NONE) db(code2); - addr.updateRegField(static_cast(reg.getIdx())); - opAddr(addr, immSize); - } - void makeJmp(uint32 disp, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref) - { - const int shortJmpSize = 2; - const int longHeaderSize = longPref ? 2 : 1; - const int longJmpSize = longHeaderSize + 4; - if (type != T_NEAR && inner::IsInDisp8(disp - shortJmpSize)) { - db(shortCode); db(disp - shortJmpSize); - } else { - if (type == T_SHORT) throw Error(ERR_LABEL_IS_TOO_FAR); - if (longPref) db(longPref); - db(longCode); dd(disp - longJmpSize); - } - } - template - void opJmp(T& label, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref) - { - if (isAutoGrow() && size_ + 16 >= maxSize_) growMemory(); /* avoid splitting code of jmp */ - size_t offset = 0; - if (labelMgr_.getOffset(&offset, label)) { /* label exists */ - makeJmp(inner::VerifyInInt32(offset - size_), type, shortCode, longCode, longPref); - } else { - int jmpSize = 0; - if (type == T_NEAR) { - jmpSize = 4; - if (longPref) db(longPref); - db(longCode); dd(0); - } else { - jmpSize = 1; - db(shortCode); db(0); - } - JmpLabel jmp(size_, jmpSize, inner::LasIs); - labelMgr_.addUndefinedLabel(label, jmp); - } - } - void opJmpAbs(const void *addr, LabelType type, uint8 shortCode, uint8 longCode) - { - if (isAutoGrow()) { - if (type != T_NEAR) throw Error(ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW); - if (size_ + 16 >= maxSize_) growMemory(); - db(longCode); - dd(0); - save(size_ - 4, size_t(addr) - size_, 4, inner::Labs); - } else { - makeJmp(inner::VerifyInInt32(reinterpret_cast(addr) - getCurr()), type, shortCode, longCode, 0); - } - - } - // immSize is the size for immediate value - void opAddr(const Address &addr, int immSize = 0) - { - db(addr.getCode(), static_cast(addr.getSize())); - if (addr.getLabel()) { // [rip + Label] - putL_inner(*addr.getLabel(), true, addr.getDisp() - immSize); - } - } - /* preCode is for SSSE3/SSE4 */ - void opGen(const Operand& reg, const Operand& op, int code, int pref, bool isValid(const Operand&, const Operand&), int imm8 = NONE, int preCode = NONE) - { - if (isValid && !isValid(reg, op)) throw Error(ERR_BAD_COMBINATION); - if (pref != NONE) db(pref); - if (op.isMEM()) { - opModM(static_cast(op), static_cast(reg), 0x0F, preCode, code, (imm8 != NONE) ? 1 : 0); - } else { - opModR(static_cast(reg), static_cast(op), 0x0F, preCode, code); - } - if (imm8 != NONE) db(imm8); - } - void opMMX_IMM(const Mmx& mmx, int imm8, int code, int ext) - { - if (mmx.isXMM()) db(0x66); - opModR(Reg32(ext), mmx, 0x0F, code); - db(imm8); - } - void opMMX(const Mmx& mmx, const Operand& op, int code, int pref = 0x66, int imm8 = NONE, int preCode = NONE) - { - opGen(mmx, op, code, mmx.isXMM() ? pref : NONE, isXMMorMMX_MEM, imm8, preCode); - } - void opMovXMM(const Operand& op1, const Operand& op2, int code, int pref) - { - if (pref != NONE) db(pref); - if (op1.isXMM() && op2.isMEM()) { - opModM(static_cast(op2), static_cast(op1), 0x0F, code); - } else if (op1.isMEM() && op2.isXMM()) { - opModM(static_cast(op1), static_cast(op2), 0x0F, code | 1); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opExt(const Operand& op, const Mmx& mmx, int code, int imm, bool hasMMX2 = false) - { - if (hasMMX2 && op.isREG(i32e)) { /* pextrw is special */ - if (mmx.isXMM()) db(0x66); - opModR(static_cast(op), mmx, 0x0F, B11000101); db(imm); - } else { - opGen(mmx, op, code, 0x66, isXMM_REG32orMEM, imm, B00111010); - } - } - void opR_ModM(const Operand& op, int bit, int ext, int code0, int code1 = NONE, int code2 = NONE, bool disableRex = false, int immSize = 0) - { - int opBit = op.getBit(); - if (disableRex && opBit == 64) opBit = 32; - if (op.isREG(bit)) { - opModR(Reg(ext, Operand::REG, opBit), static_cast(op).changeBit(opBit), code0, code1, code2); - } else if (op.isMEM()) { - opModM(static_cast(op), Reg(ext, Operand::REG, opBit), code0, code1, code2, immSize); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opShift(const Operand& op, int imm, int ext) - { - verifyMemHasSize(op); - opR_ModM(op, 0, ext, (B11000000 | ((imm == 1 ? 1 : 0) << 4)), NONE, NONE, false, (imm != 1) ? 1 : 0); - if (imm != 1) db(imm); - } - void opShift(const Operand& op, const Reg8& _cl, int ext) - { - if (_cl.getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); - opR_ModM(op, 0, ext, B11010010); - } - void opModRM(const Operand& op1, const Operand& op2, bool condR, bool condM, int code0, int code1 = NONE, int code2 = NONE, int immSize = 0) - { - if (condR) { - opModR(static_cast(op1), static_cast(op2), code0, code1, code2); - } else if (condM) { - opModM(static_cast(op2), static_cast(op1), code0, code1, code2, immSize); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opShxd(const Operand& op, const Reg& reg, uint8 imm, int code, const Reg8 *_cl = 0) - { - if (_cl && _cl->getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); - opModRM(reg, op, (op.isREG(16 | i32e) && op.getBit() == reg.getBit()), op.isMEM() && (reg.isREG(16 | i32e)), 0x0F, code | (_cl ? 1 : 0), NONE, _cl ? 0 : 1); - if (!_cl) db(imm); - } - // (REG, REG|MEM), (MEM, REG) - void opRM_RM(const Operand& op1, const Operand& op2, int code) - { - if (op1.isREG() && op2.isMEM()) { - opModM(static_cast(op2), static_cast(op1), code | 2); - } else { - opModRM(op2, op1, op1.isREG() && op1.getKind() == op2.getKind(), op1.isMEM() && op2.isREG(), code); - } - } - // (REG|MEM, IMM) - void opRM_I(const Operand& op, uint32 imm, int code, int ext) - { - verifyMemHasSize(op); - uint32 immBit = inner::IsInDisp8(imm) ? 8 : isInDisp16(imm) ? 16 : 32; - if (op.isBit(8)) immBit = 8; - if (op.getBit() < immBit) throw Error(ERR_IMM_IS_TOO_BIG); - if (op.isBit(32|64) && immBit == 16) immBit = 32; /* don't use MEM16 if 32/64bit mode */ - if (op.isREG() && op.getIdx() == 0 && (op.getBit() == immBit || (op.isBit(64) && immBit == 32))) { // rax, eax, ax, al - rex(op); - db(code | 4 | (immBit == 8 ? 0 : 1)); - } else { - int tmp = immBit < (std::min)(op.getBit(), 32U) ? 2 : 0; - opR_ModM(op, 0, ext, B10000000 | tmp, NONE, NONE, false, immBit / 8); - } - db(imm, immBit / 8); - } - void opIncDec(const Operand& op, int code, int ext) - { - verifyMemHasSize(op); -#ifndef XBYAK64 - if (op.isREG() && !op.isBit(8)) { - rex(op); db(code | op.getIdx()); - return; - } -#endif - code = B11111110; - if (op.isREG()) { - opModR(Reg(ext, Operand::REG, op.getBit()), static_cast(op), code); - } else { - opModM(static_cast(op), Reg(ext, Operand::REG, op.getBit()), code); - } - } - void opPushPop(const Operand& op, int code, int ext, int alt) - { - if (op.isREG()) { - if (op.isBit(16)) db(0x66); - if (static_cast(op).getIdx() >= 8) db(0x41); - db(alt | (op.getIdx() & 7)); - } else if (op.isMEM()) { - opModM(static_cast(op), Reg(ext, Operand::REG, op.getBit()), code); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void verifyMemHasSize(const Operand& op) const - { - if (op.isMEM() && op.getBit() == 0) throw Error(ERR_MEM_SIZE_IS_NOT_SPECIFIED); - } - void opMovxx(const Reg& reg, const Operand& op, uint8 code) - { - if (op.isBit(32)) throw Error(ERR_BAD_COMBINATION); - int w = op.isBit(16); -#ifdef XBYAK64 - if (op.isHigh8bit()) throw Error(ERR_BAD_COMBINATION); -#endif - bool cond = reg.isREG() && (reg.getBit() > op.getBit()); - opModRM(reg, op, cond && op.isREG(), cond && op.isMEM(), 0x0F, code | w); - } - void opFpuMem(const Address& addr, uint8 m16, uint8 m32, uint8 m64, uint8 ext, uint8 m64ext) - { - if (addr.is64bitDisp()) throw Error(ERR_CANT_USE_64BIT_DISP); - uint8 code = addr.isBit(16) ? m16 : addr.isBit(32) ? m32 : addr.isBit(64) ? m64 : 0; - if (!code) throw Error(ERR_BAD_MEM_SIZE); - if (m64ext && addr.isBit(64)) ext = m64ext; - - rex(addr, st0); - db(code); - addr.updateRegField(ext); - opAddr(addr); - } - // use code1 if reg1 == st0 - // use code2 if reg1 != st0 && reg2 == st0 - void opFpuFpu(const Fpu& reg1, const Fpu& reg2, uint32 code1, uint32 code2) - { - uint32 code = reg1.getIdx() == 0 ? code1 : reg2.getIdx() == 0 ? code2 : 0; - if (!code) throw Error(ERR_BAD_ST_COMBINATION); - db(uint8(code >> 8)); - db(uint8(code | (reg1.getIdx() | reg2.getIdx()))); - } - void opFpu(const Fpu& reg, uint8 code1, uint8 code2) - { - db(code1); db(code2 | reg.getIdx()); - } - void opVex(const Reg& r, const Operand *p1, const Operand *p2, int type, int code, int w, int imm8 = NONE) - { - bool x, b; - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - uint8 rex = addr.getRex(); - x = (rex & 2) != 0; - b = (rex & 1) != 0; - if (BIT == 64 && addr.is32bit()) db(0x67); - if (BIT == 64 && w == -1) w = (rex & 4) ? 1 : 0; - } else { - x = false; - b = static_cast(*p2).isExtIdx(); - } - if (w == -1) w = 0; - vex(r.isExtIdx(), p1 ? p1->getIdx() : 0, r.isYMM(), type, x, b, w); - db(code); - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - addr.updateRegField(static_cast(r.getIdx())); - opAddr(addr, (imm8 != NONE) ? 1 : 0); - } else { - db(getModRM(3, r.getIdx(), p2->getIdx())); - } - if (imm8 != NONE) db(imm8); - } - // (r, r, r/m) if isR_R_RM - // (r, r/m, r) - void opGpr(const Reg32e& r, const Operand& op1, const Operand& op2, int type, uint8 code, bool isR_R_RM, int imm8 = NONE) - { - const Operand *p1 = &op1; - const Operand *p2 = &op2; - if (!isR_R_RM) std::swap(p1, p2); - const unsigned int bit = r.getBit(); - if (p1->getBit() != bit || (p2->isREG() && p2->getBit() != bit)) throw Error(ERR_BAD_COMBINATION); - int w = bit == 64; - opVex(r, p1, p2, type, code, w, imm8); - } - void opAVX_X_X_XM(const Xmm& x1, const Operand& op1, const Operand& op2, int type, int code0, bool supportYMM, int w = -1, int imm8 = NONE) - { - const Xmm *x2; - const Operand *op; - if (op2.isNone()) { - x2 = &x1; - op = &op1; - } else { - if (!(op1.isXMM() || (supportYMM && op1.isYMM()))) throw Error(ERR_BAD_COMBINATION); - x2 = static_cast(&op1); - op = &op2; - } - // (x1, x2, op) - if (!((x1.isXMM() && x2->isXMM()) || (supportYMM && x1.isYMM() && x2->isYMM()))) throw Error(ERR_BAD_COMBINATION); - opVex(x1, x2, op, type, code0, w, imm8); - } - // if cvt then return pointer to Xmm(idx) (or Ymm(idx)), otherwise return op - void opAVX_X_X_XMcvt(const Xmm& x1, const Operand& op1, const Operand& op2, bool cvt, Operand::Kind kind, int type, int code0, bool supportYMM, int w = -1, int imm8 = NONE) - { - // use static_cast to avoid calling unintentional copy constructor on gcc - opAVX_X_X_XM(x1, op1, cvt ? kind == Operand::XMM ? static_cast(Xmm(op2.getIdx())) : static_cast(Ymm(op2.getIdx())) : op2, type, code0, supportYMM, w, imm8); - } - // support (x, x/m, imm), (y, y/m, imm) - void opAVX_X_XM_IMM(const Xmm& x, const Operand& op, int type, int code, bool supportYMM, int w = -1, int imm8 = NONE) - { - opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, op, type, code, supportYMM, w, imm8); - } - // QQQ:need to refactor - void opSp1(const Reg& reg, const Operand& op, uint8 pref, uint8 code0, uint8 code1) - { - if (reg.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); - bool is16bit = reg.isREG(16) && (op.isREG(16) || op.isMEM()); - if (!is16bit && !(reg.isREG(i32e) && (op.isREG(reg.getBit()) || op.isMEM()))) throw Error(ERR_BAD_COMBINATION); - if (is16bit) db(0x66); - db(pref); opModRM(reg.changeBit(i32e == 32 ? 32 : reg.getBit()), op, op.isREG(), true, code0, code1); - } - void opGather(const Xmm& x1, const Address& addr, const Xmm& x2, int type, uint8 code, int w, int mode) - { - if (!addr.isVsib()) throw Error(ERR_BAD_VSIB_ADDRESSING); - const int y_vx_y = 0; - const int y_vy_y = 1; -// const int x_vy_x = 2; - const bool isAddrYMM = addr.isYMM(); - if (!x1.isXMM() || isAddrYMM || !x2.isXMM()) { - bool isOK = false; - if (mode == y_vx_y) { - isOK = x1.isYMM() && !isAddrYMM && x2.isYMM(); - } else if (mode == y_vy_y) { - isOK = x1.isYMM() && isAddrYMM && x2.isYMM(); - } else { // x_vy_x - isOK = !x1.isYMM() && isAddrYMM && !x2.isYMM(); - } - if (!isOK) throw Error(ERR_BAD_VSIB_ADDRESSING); - } - addr.setVsib(false); - opAVX_X_X_XM(isAddrYMM ? Ymm(x1.getIdx()) : x1, isAddrYMM ? Ymm(x2.getIdx()) : x2, addr, type, code, true, w); - addr.setVsib(true); - } -public: - unsigned int getVersion() const { return VERSION; } - using CodeArray::db; - const Mmx mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7; - const Xmm xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; - const Ymm ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7; - const Xmm &xm0, &xm1, &xm2, &xm3, &xm4, &xm5, &xm6, &xm7; - const Ymm &ym0, &ym1, &ym2, &ym3, &ym4, &ym5, &ym6, &ym7; - const Reg32 eax, ecx, edx, ebx, esp, ebp, esi, edi; - const Reg16 ax, cx, dx, bx, sp, bp, si, di; - const Reg8 al, cl, dl, bl, ah, ch, dh, bh; - const AddressFrame ptr, byte, word, dword, qword; - const Fpu st0, st1, st2, st3, st4, st5, st6, st7; -#ifdef XBYAK64 - const Reg64 rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15; - const Reg32 r8d, r9d, r10d, r11d, r12d, r13d, r14d, r15d; - const Reg16 r8w, r9w, r10w, r11w, r12w, r13w, r14w, r15w; - const Reg8 r8b, r9b, r10b, r11b, r12b, r13b, r14b, r15b; - const Reg8 spl, bpl, sil, dil; - const Xmm xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15; - const Ymm ymm8, ymm9, ymm10, ymm11, ymm12, ymm13, ymm14, ymm15; - const Xmm &xm8, &xm9, &xm10, &xm11, &xm12, &xm13, &xm14, &xm15; // for my convenience - const Ymm &ym8, &ym9, &ym10, &ym11, &ym12, &ym13, &ym14, &ym15; - const RegRip rip; -#endif -#ifndef XBYAK_DISABLE_SEGMENT - const Segment es, cs, ss, ds, fs, gs; -#endif - void L(const std::string& label) { labelMgr_.defineSlabel(label); } - void L(const Label& label) { labelMgr_.defineClabel(label); } - /* - assign src to dst - require - dst : does not used by L() - src : used by L() - */ - void assignL(Label& dst, const Label& src) { labelMgr_.assign(dst, src); } - void inLocalLabel() { labelMgr_.enterLocal(); } - void outLocalLabel() { labelMgr_.leaveLocal(); } - void jmp(std::string label, LabelType type = T_AUTO) - { - opJmp(label, type, B11101011, B11101001, 0); - } - void jmp(const Label& label, LabelType type = T_AUTO) - { - opJmp(label, type, B11101011, B11101001, 0); - } - void jmp(const char *label, LabelType type = T_AUTO) { jmp(std::string(label), type); } - void jmp(const void *addr, LabelType type = T_AUTO) - { - opJmpAbs(addr, type, B11101011, B11101001); - } - void jmp(const Operand& op) - { - opR_ModM(op, BIT, 4, 0xFF, NONE, NONE, true); - } - void call(const Operand& op) - { - opR_ModM(op, 16 | i32e, 2, 0xFF, NONE, NONE, true); - } - // (REG|MEM, REG) - void test(const Operand& op, const Reg& reg) - { - opModRM(reg, op, op.isREG() && (op.getKind() == reg.getKind()), op.isMEM(), B10000100); - } - // (REG|MEM, IMM) - void test(const Operand& op, uint32 imm) - { - verifyMemHasSize(op); - int immSize = (std::min)(op.getBit() / 8, 4U); - if (op.isREG() && op.getIdx() == 0) { // al, ax, eax - rex(op); - db(B10101000 | (op.isBit(8) ? 0 : 1)); - } else { - opR_ModM(op, 0, 0, B11110110, NONE, NONE, false, immSize); - } - db(imm, immSize); - } - void ret(int imm = 0) - { - if (imm) { - db(B11000010); dw(imm); - } else { - db(B11000011); - } - } - // (REG16|REG32, REG16|REG32|MEM) - void imul(const Reg& reg, const Operand& op) - { - opModRM(reg, op, op.isREG() && (reg.getKind() == op.getKind()), op.isMEM(), 0x0F, B10101111); - } - void imul(const Reg& reg, const Operand& op, int imm) - { - int s = inner::IsInDisp8(imm) ? 1 : 0; - int immSize = s ? 1 : reg.isREG(16) ? 2 : 4; - opModRM(reg, op, op.isREG() && (reg.getKind() == op.getKind()), op.isMEM(), B01101001 | (s << 1), NONE, NONE, immSize); - db(imm, immSize); - } - void pop(const Operand& op) - { - opPushPop(op, B10001111, 0, B01011000); - } - void push(const Operand& op) - { - opPushPop(op, B11111111, 6, B01010000); - } - void push(const AddressFrame& af, uint32 imm) - { - if (af.bit_ == 8 && inner::IsInDisp8(imm)) { - db(B01101010); db(imm); - } else if (af.bit_ == 16 && isInDisp16(imm)) { - db(0x66); db(B01101000); dw(imm); - } else { - db(B01101000); dd(imm); - } - } - /* use "push(word, 4)" if you want "push word 4" */ - void push(uint32 imm) - { - if (inner::IsInDisp8(imm)) { - push(byte, imm); - } else { - push(dword, imm); - } - } -#ifndef XBYAK_DISABLE_SEGMENT - void push(const Segment& seg) - { - switch (seg.getIdx()) { - case Segment::es: db(0x06); break; - case Segment::cs: db(0x0e); break; - case Segment::ss: db(0x16); break; - case Segment::ds: db(0x1e); break; - case Segment::fs: db(0x0f); db(0xa0); break; - case Segment::gs: db(0x0f); db(0xa8); break; - default: - assert(0); - } - } - void pop(const Segment& seg) - { - switch (seg.getIdx()) { - case Segment::es: db(0x07); break; - case Segment::cs: throw Error(ERR_BAD_COMBINATION); - case Segment::ss: db(0x17); break; - case Segment::ds: db(0x1f); break; - case Segment::fs: db(0x0f); db(0xa1); break; - case Segment::gs: db(0x0f); db(0xa9); break; - default: - assert(0); - } - } -#endif - void bswap(const Reg32e& reg) - { - opModR(Reg32(1), reg, 0x0F); - } - void mov(const Operand& reg1, const Operand& reg2) - { - const Reg *reg = 0; - const Address *addr = 0; - uint8 code = 0; - if (reg1.isREG() && reg1.getIdx() == 0 && reg2.isMEM()) { // mov eax|ax|al, [disp] - reg = &static_cast(reg1); - addr= &static_cast(reg2); - code = B10100000; - } else - if (reg1.isMEM() && reg2.isREG() && reg2.getIdx() == 0) { // mov [disp], eax|ax|al - reg = &static_cast(reg2); - addr= &static_cast(reg1); - code = B10100010; - } -#ifdef XBYAK64 - if (addr && addr->is64bitDisp()) { - if (code) { - rex(*reg); - db(reg1.isREG(8) ? 0xA0 : reg1.isREG() ? 0xA1 : reg2.isREG(8) ? 0xA2 : 0xA3); - db(addr->getDisp(), 8); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } else -#else - if (code && addr->isOnlyDisp()) { - rex(*reg, *addr); - db(code | (reg->isBit(8) ? 0 : 1)); - dd(static_cast(addr->getDisp())); - } else -#endif - { - opRM_RM(reg1, reg2, B10001000); - } - } -private: - /* - mov(r, imm) = db(imm, mov_imm(r, imm)) - */ - int mov_imm(const Reg& reg, size_t imm) - { - int bit = reg.getBit(); - const int idx = reg.getIdx(); - int code = B10110000 | ((bit == 8 ? 0 : 1) << 3); - if (bit == 64 && (imm & ~size_t(0xffffffffu)) == 0) { - rex(Reg32(idx)); - bit = 32; - } else { - rex(reg); - if (bit == 64 && inner::IsInInt32(imm)) { - db(B11000111); - code = B11000000; - bit = 32; - } - } - db(code | (idx & 7)); - return bit / 8; - } - template - void putL_inner(T& label, bool relative = false, size_t disp = 0) - { - const int jmpSize = relative ? 4 : (int)sizeof(size_t); - if (isAutoGrow() && size_ + 16 >= maxSize_) growMemory(); - size_t offset = 0; - if (labelMgr_.getOffset(&offset, label)) { - if (relative) { - db(inner::VerifyInInt32(offset + disp - size_ - jmpSize), jmpSize); - } else if (isAutoGrow()) { - db(uint64(0), jmpSize); - save(size_ - jmpSize, offset, jmpSize, inner::LaddTop); - } else { - db(size_t(top_) + offset, jmpSize); - } - return; - } - db(uint64(0), jmpSize); - JmpLabel jmp(size_, jmpSize, (relative ? inner::LasIs : isAutoGrow() ? inner::LaddTop : inner::Labs), disp); - labelMgr_.addUndefinedLabel(label, jmp); - } -public: - void mov(const Operand& op, size_t imm) - { - if (op.isREG()) { - const int size = mov_imm(static_cast(op), imm); - db(imm, size); - } else if (op.isMEM()) { - verifyMemHasSize(op); - int immSize = op.getBit() / 8; - if (immSize <= 4) { - sint64 s = sint64(imm) >> (immSize * 8); - if (s != 0 && s != -1) throw Error(ERR_IMM_IS_TOO_BIG); - } else { - if (!inner::IsInInt32(imm)) throw Error(ERR_IMM_IS_TOO_BIG); - immSize = 4; - } - opModM(static_cast(op), Reg(0, Operand::REG, op.getBit()), B11000110, NONE, NONE, immSize); - db(static_cast(imm), immSize); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void mov(const NativeReg& reg, const char *label) // can't use std::string - { - if (label == 0) { - mov(static_cast(reg), 0); // call imm - return; - } - mov_imm(reg, dummyAddr); - putL(label); - } - void mov(const NativeReg& reg, const Label& label) - { - mov_imm(reg, dummyAddr); - putL(label); - } -#ifndef XBYAK_DISABLE_SEGMENT - void putSeg(const Segment& seg) - { - switch (seg.getIdx()) { - case Segment::es: db(0x2e); break; - case Segment::cs: db(0x36); break; - case Segment::ss: db(0x3e); break; - case Segment::ds: db(0x26); break; - case Segment::fs: db(0x64); break; - case Segment::gs: db(0x65); break; - default: - assert(0); - } - } - void mov(const Operand& op, const Segment& seg) - { - opModRM(Reg8(seg.getIdx()), op, op.isREG(16|i32e), op.isMEM(), 0x8C); - } - void mov(const Segment& seg, const Operand& op) - { - opModRM(Reg8(seg.getIdx()), op.isREG(16|i32e) ? static_cast(static_cast(op).cvt32()) : op, op.isREG(16|i32e), op.isMEM(), 0x8E); - } -#endif - void movbe(const Reg& reg, const Address& addr) { opModM(addr, reg, 0x0F, 0x38, 0xF0); } - void movbe(const Address& addr, const Reg& reg) { opModM(addr, reg, 0x0F, 0x38, 0xF1); } - /* - put address of label to buffer - @note the put size is 4(32-bit), 8(64-bit) - */ - void putL(std::string label) { putL_inner(label); } - void putL(const Label& label) { putL_inner(label); } - void adcx(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0x66, isREG32_REG32orMEM, NONE, 0x38); } - void adox(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0xF3, isREG32_REG32orMEM, NONE, 0x38); } - void cmpxchg8b(const Address& addr) { opModM(addr, Reg32(1), 0x0F, B11000111); } -#ifdef XBYAK64 - void cmpxchg16b(const Address& addr) { opModM(addr, Reg64(1), 0x0F, B11000111); } -#endif - void xadd(const Operand& op, const Reg& reg) - { - opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, B11000000 | (reg.isBit(8) ? 0 : 1)); - } - void cmpxchg(const Operand& op, const Reg& reg) - { - opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, 0xb0 | (reg.isBit(8) ? 0 : 1)); - } - void xchg(const Operand& op1, const Operand& op2) - { - const Operand *p1 = &op1, *p2 = &op2; - if (p1->isMEM() || (p2->isREG(16 | i32e) && p2->getIdx() == 0)) { - p1 = &op2; p2 = &op1; - } - if (p1->isMEM()) throw Error(ERR_BAD_COMBINATION); - if (p2->isREG() && (p1->isREG(16 | i32e) && p1->getIdx() == 0) -#ifdef XBYAK64 - && (p2->getIdx() != 0 || !p1->isREG(32)) -#endif - ) { - rex(*p2, *p1); db(0x90 | (p2->getIdx() & 7)); - return; - } - opModRM(*p1, *p2, (p1->isREG() && p2->isREG() && (p1->getBit() == p2->getBit())), p2->isMEM(), B10000110 | (p1->isBit(8) ? 0 : 1)); - } - void call(std::string label) { opJmp(label, T_NEAR, 0, B11101000, 0); } - // call(string label) - void call(const char *label) { call(std::string(label)); } - void call(const Label& label) { opJmp(label, T_NEAR, 0, B11101000, 0); } - // call(function pointer) -#ifdef XBYAK_VARIADIC_TEMPLATE - template - void call(Ret(*func)(Params...)) { call(CastTo(func)); } -#endif - void call(const void *addr) { opJmpAbs(addr, T_NEAR, 0, B11101000); } - // special case - void movd(const Address& addr, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, B01111110); - } - void movd(const Reg32& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01111110); - } - void movd(const Mmx& mmx, const Address& addr) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, B01101110); - } - void movd(const Mmx& mmx, const Reg32& reg) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01101110); - } - void movq2dq(const Xmm& xmm, const Mmx& mmx) - { - db(0xF3); opModR(xmm, mmx, 0x0F, B11010110); - } - void movdq2q(const Mmx& mmx, const Xmm& xmm) - { - db(0xF2); opModR(mmx, xmm, 0x0F, B11010110); - } - void movq(const Mmx& mmx, const Operand& op) - { - if (mmx.isXMM()) db(0xF3); - opModRM(mmx, op, (mmx.getKind() == op.getKind()), op.isMEM(), 0x0F, mmx.isXMM() ? B01111110 : B01101111); - } - void movq(const Address& addr, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, mmx.isXMM() ? B11010110 : B01111111); - } -#ifdef XBYAK64 - void movq(const Reg64& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01111110); - } - void movq(const Mmx& mmx, const Reg64& reg) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01101110); - } - void pextrq(const Operand& op, const Xmm& xmm, uint8 imm) - { - if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, B00111010); // force to 64bit - } - void pinsrq(const Xmm& xmm, const Operand& op, uint8 imm) - { - if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, B00111010); // force to 64bit - } - void movsxd(const Reg64& reg, const Operand& op) - { - if (!op.isBit(32)) throw Error(ERR_BAD_COMBINATION); - opModRM(reg, op, op.isREG(), op.isMEM(), 0x63); - } -#endif - // MMX2 : pextrw : reg, mmx/xmm, imm - // SSE4 : pextrw, pextrb, pextrd, extractps : reg/mem, mmx/xmm, imm - void pextrw(const Operand& op, const Mmx& xmm, uint8 imm) { opExt(op, xmm, 0x15, imm, true); } - void pextrb(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x14, imm); } - void pextrd(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x16, imm); } - void extractps(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x17, imm); } - void pinsrw(const Mmx& mmx, const Operand& op, int imm) - { - if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(mmx, op, B11000100, mmx.isXMM() ? 0x66 : NONE, 0, imm); - } - void insertps(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, B00111010); } - void pinsrb(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, B00111010); } - void pinsrd(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, B00111010); } - - void pmovmskb(const Reg32e& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(reg, mmx, 0x0F, B11010111); - } - void maskmovq(const Mmx& reg1, const Mmx& reg2) - { - if (!reg1.isMMX() || !reg2.isMMX()) throw Error(ERR_BAD_COMBINATION); - opModR(reg1, reg2, 0x0F, B11110111); - } - void lea(const Reg32e& reg, const Address& addr) { opModM(addr, reg, B10001101); } - - void movmskps(const Reg32e& reg, const Xmm& xmm) { opModR(reg, xmm, 0x0F, B01010000); } - void movmskpd(const Reg32e& reg, const Xmm& xmm) { db(0x66); movmskps(reg, xmm); } - void movntps(const Address& addr, const Xmm& xmm) { opModM(addr, Mmx(xmm.getIdx()), 0x0F, B00101011); } - void movntdqa(const Xmm& xmm, const Address& addr) { db(0x66); opModM(addr, xmm, 0x0F, 0x38, 0x2A); } - void lddqu(const Xmm& xmm, const Address& addr) { db(0xF2); opModM(addr, xmm, 0x0F, B11110000); } - void movnti(const Address& addr, const Reg32e& reg) { opModM(addr, reg, 0x0F, B11000011); } - void movntq(const Address& addr, const Mmx& mmx) - { - if (!mmx.isMMX()) throw Error(ERR_BAD_COMBINATION); - opModM(addr, mmx, 0x0F, B11100111); - } - void crc32(const Reg32e& reg, const Operand& op) - { - if (reg.isBit(32) && op.isBit(16)) db(0x66); - db(0xF2); - opModRM(reg, op, op.isREG(), op.isMEM(), 0x0F, 0x38, 0xF0 | (op.isBit(8) ? 0 : 1)); - } - void rdrand(const Reg& r) { if (r.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); opModR(Reg(6, Operand::REG, r.getBit()), r, 0x0f, 0xc7); } - void rdseed(const Reg& r) { if (r.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); opModR(Reg(7, Operand::REG, r.getBit()), r, 0x0f, 0xc7); } - void rorx(const Reg32e& r, const Operand& op, uint8 imm) { opGpr(r, op, Reg32e(0, r.getBit()), MM_0F3A | PP_F2, 0xF0, false, imm); } - enum { NONE = 256 }; - CodeGenerator(size_t maxSize = DEFAULT_MAX_CODE_SIZE, void *userPtr = 0, Allocator *allocator = 0) - : CodeArray(maxSize, userPtr, allocator) - , mm0(0), mm1(1), mm2(2), mm3(3), mm4(4), mm5(5), mm6(6), mm7(7) - , xmm0(0), xmm1(1), xmm2(2), xmm3(3), xmm4(4), xmm5(5), xmm6(6), xmm7(7) - , ymm0(0), ymm1(1), ymm2(2), ymm3(3), ymm4(4), ymm5(5), ymm6(6), ymm7(7) - , xm0(xmm0), xm1(xmm1), xm2(xmm2), xm3(xmm3), xm4(xmm4), xm5(xmm5), xm6(xmm6), xm7(xmm7) // for my convenience - , ym0(ymm0), ym1(ymm1), ym2(ymm2), ym3(ymm3), ym4(ymm4), ym5(ymm5), ym6(ymm6), ym7(ymm7) // for my convenience - , eax(Operand::EAX), ecx(Operand::ECX), edx(Operand::EDX), ebx(Operand::EBX), esp(Operand::ESP), ebp(Operand::EBP), esi(Operand::ESI), edi(Operand::EDI) - , ax(Operand::AX), cx(Operand::CX), dx(Operand::DX), bx(Operand::BX), sp(Operand::SP), bp(Operand::BP), si(Operand::SI), di(Operand::DI) - , al(Operand::AL), cl(Operand::CL), dl(Operand::DL), bl(Operand::BL), ah(Operand::AH), ch(Operand::CH), dh(Operand::DH), bh(Operand::BH) - , ptr(0), byte(8), word(16), dword(32), qword(64) - , st0(0), st1(1), st2(2), st3(3), st4(4), st5(5), st6(6), st7(7) -#ifdef XBYAK64 - , rax(Operand::RAX), rcx(Operand::RCX), rdx(Operand::RDX), rbx(Operand::RBX), rsp(Operand::RSP), rbp(Operand::RBP), rsi(Operand::RSI), rdi(Operand::RDI), r8(Operand::R8), r9(Operand::R9), r10(Operand::R10), r11(Operand::R11), r12(Operand::R12), r13(Operand::R13), r14(Operand::R14), r15(Operand::R15) - , r8d(Operand::R8D), r9d(Operand::R9D), r10d(Operand::R10D), r11d(Operand::R11D), r12d(Operand::R12D), r13d(Operand::R13D), r14d(Operand::R14D), r15d(Operand::R15D) - , r8w(Operand::R8W), r9w(Operand::R9W), r10w(Operand::R10W), r11w(Operand::R11W), r12w(Operand::R12W), r13w(Operand::R13W), r14w(Operand::R14W), r15w(Operand::R15W) - , r8b(Operand::R8B), r9b(Operand::R9B), r10b(Operand::R10B), r11b(Operand::R11B), r12b(Operand::R12B), r13b(Operand::R13B), r14b(Operand::R14B), r15b(Operand::R15B) - , spl(Operand::SPL, true), bpl(Operand::BPL, true), sil(Operand::SIL, true), dil(Operand::DIL, true) - , xmm8(8), xmm9(9), xmm10(10), xmm11(11), xmm12(12), xmm13(13), xmm14(14), xmm15(15) - , ymm8(8), ymm9(9), ymm10(10), ymm11(11), ymm12(12), ymm13(13), ymm14(14), ymm15(15) - , xm8(xmm8), xm9(xmm9), xm10(xmm10), xm11(xmm11), xm12(xmm12), xm13(xmm13), xm14(xmm14), xm15(xmm15) // for my convenience - , ym8(ymm8), ym9(ymm9), ym10(ymm10), ym11(ymm11), ym12(ymm12), ym13(ymm13), ym14(ymm14), ym15(ymm15) // for my convenience - , rip() -#endif -#ifndef XBYAK_DISABLE_SEGMENT - , es(Segment::es), cs(Segment::cs), ss(Segment::ss), ds(Segment::ds), fs(Segment::fs), gs(Segment::gs) -#endif - { - labelMgr_.set(this); - } - void reset() - { - resetSize(); - labelMgr_.reset(); - labelMgr_.set(this); - } - bool hasUndefinedLabel() const { return labelMgr_.hasUndefSlabel() || labelMgr_.hasUndefClabel(); } - /* - call ready() to complete generating code on AutoGrow - */ - void ready() - { - if (hasUndefinedLabel()) throw Error(ERR_LABEL_IS_NOT_FOUND); - calcJmpAddress(); - } -#ifdef XBYAK_TEST - void dump(bool doClear = true) - { - CodeArray::dump(); - if (doClear) size_ = 0; - } -#endif - -#ifndef XBYAK_DONT_READ_LIST -#include "xbyak_mnemonic.h" - void align(int x = 16) - { - if (x == 1) return; - if (x < 1 || (x & (x - 1))) throw Error(ERR_BAD_ALIGN); - if (isAutoGrow() && x > (int)inner::ALIGN_PAGE_SIZE) fprintf(stderr, "warning:autoGrow mode does not support %d align\n", x); - while (size_t(getCurr()) % x) { - nop(); - } - } -#endif -}; - -namespace util { -static const Mmx mm0(0), mm1(1), mm2(2), mm3(3), mm4(4), mm5(5), mm6(6), mm7(7); -static const Xmm xmm0(0), xmm1(1), xmm2(2), xmm3(3), xmm4(4), xmm5(5), xmm6(6), xmm7(7); -static const Ymm ymm0(0), ymm1(1), ymm2(2), ymm3(3), ymm4(4), ymm5(5), ymm6(6), ymm7(7); -static const Reg32 eax(Operand::EAX), ecx(Operand::ECX), edx(Operand::EDX), ebx(Operand::EBX), esp(Operand::ESP), ebp(Operand::EBP), esi(Operand::ESI), edi(Operand::EDI); -static const Reg16 ax(Operand::AX), cx(Operand::CX), dx(Operand::DX), bx(Operand::BX), sp(Operand::SP), bp(Operand::BP), si(Operand::SI), di(Operand::DI); -static const Reg8 al(Operand::AL), cl(Operand::CL), dl(Operand::DL), bl(Operand::BL), ah(Operand::AH), ch(Operand::CH), dh(Operand::DH), bh(Operand::BH); -static const AddressFrame ptr(0), byte(8), word(16), dword(32), qword(64); -static const Fpu st0(0), st1(1), st2(2), st3(3), st4(4), st5(5), st6(6), st7(7); -#ifdef XBYAK64 -static const Reg64 rax(Operand::RAX), rcx(Operand::RCX), rdx(Operand::RDX), rbx(Operand::RBX), rsp(Operand::RSP), rbp(Operand::RBP), rsi(Operand::RSI), rdi(Operand::RDI), r8(Operand::R8), r9(Operand::R9), r10(Operand::R10), r11(Operand::R11), r12(Operand::R12), r13(Operand::R13), r14(Operand::R14), r15(Operand::R15); -static const Reg32 r8d(Operand::R8D), r9d(Operand::R9D), r10d(Operand::R10D), r11d(Operand::R11D), r12d(Operand::R12D), r13d(Operand::R13D), r14d(Operand::R14D), r15d(Operand::R15D); -static const Reg16 r8w(Operand::R8W), r9w(Operand::R9W), r10w(Operand::R10W), r11w(Operand::R11W), r12w(Operand::R12W), r13w(Operand::R13W), r14w(Operand::R14W), r15w(Operand::R15W); -static const Reg8 r8b(Operand::R8B), r9b(Operand::R9B), r10b(Operand::R10B), r11b(Operand::R11B), r12b(Operand::R12B), r13b(Operand::R13B), r14b(Operand::R14B), r15b(Operand::R15B), spl(Operand::SPL, 1), bpl(Operand::BPL, 1), sil(Operand::SIL, 1), dil(Operand::DIL, 1); -static const Xmm xmm8(8), xmm9(9), xmm10(10), xmm11(11), xmm12(12), xmm13(13), xmm14(14), xmm15(15); -static const Ymm ymm8(8), ymm9(9), ymm10(10), ymm11(11), ymm12(12), ymm13(13), ymm14(14), ymm15(15); -static const RegRip rip; -#endif -#ifndef XBYAK_DISABLE_SEGMENT -static const Segment es(Segment::es), cs(Segment::cs), ss(Segment::ss), ds(Segment::ds), fs(Segment::fs), gs(Segment::gs); -#endif -} // util - -#ifdef _MSC_VER - #pragma warning(pop) -#endif - -} // end of namespace - -#endif // XBYAK_XBYAK_H_ diff --git a/source/fs.dll/skse64/xbyak/xbyak_bin2hex.h b/source/fs.dll/skse64/xbyak/xbyak_bin2hex.h deleted file mode 100644 index 69ecdbfe..00000000 --- a/source/fs.dll/skse64/xbyak/xbyak_bin2hex.h +++ /dev/null @@ -1,258 +0,0 @@ -enum { - B00000000= 0, - B00000001= 1, - B00000010= 2, - B00000011= 3, - B00000100= 4, - B00000101= 5, - B00000110= 6, - B00000111= 7, - B00001000= 8, - B00001001= 9, - B00001010= 10, - B00001011= 11, - B00001100= 12, - B00001101= 13, - B00001110= 14, - B00001111= 15, - B00010000= 16, - B00010001= 17, - B00010010= 18, - B00010011= 19, - B00010100= 20, - B00010101= 21, - B00010110= 22, - B00010111= 23, - B00011000= 24, - B00011001= 25, - B00011010= 26, - B00011011= 27, - B00011100= 28, - B00011101= 29, - B00011110= 30, - B00011111= 31, - B00100000= 32, - B00100001= 33, - B00100010= 34, - B00100011= 35, - B00100100= 36, - B00100101= 37, - B00100110= 38, - B00100111= 39, - B00101000= 40, - B00101001= 41, - B00101010= 42, - B00101011= 43, - B00101100= 44, - B00101101= 45, - B00101110= 46, - B00101111= 47, - B00110000= 48, - B00110001= 49, - B00110010= 50, - B00110011= 51, - B00110100= 52, - B00110101= 53, - B00110110= 54, - B00110111= 55, - B00111000= 56, - B00111001= 57, - B00111010= 58, - B00111011= 59, - B00111100= 60, - B00111101= 61, - B00111110= 62, - B00111111= 63, - B01000000= 64, - B01000001= 65, - B01000010= 66, - B01000011= 67, - B01000100= 68, - B01000101= 69, - B01000110= 70, - B01000111= 71, - B01001000= 72, - B01001001= 73, - B01001010= 74, - B01001011= 75, - B01001100= 76, - B01001101= 77, - B01001110= 78, - B01001111= 79, - B01010000= 80, - B01010001= 81, - B01010010= 82, - B01010011= 83, - B01010100= 84, - B01010101= 85, - B01010110= 86, - B01010111= 87, - B01011000= 88, - B01011001= 89, - B01011010= 90, - B01011011= 91, - B01011100= 92, - B01011101= 93, - B01011110= 94, - B01011111= 95, - B01100000= 96, - B01100001= 97, - B01100010= 98, - B01100011= 99, - B01100100= 100, - B01100101= 101, - B01100110= 102, - B01100111= 103, - B01101000= 104, - B01101001= 105, - B01101010= 106, - B01101011= 107, - B01101100= 108, - B01101101= 109, - B01101110= 110, - B01101111= 111, - B01110000= 112, - B01110001= 113, - B01110010= 114, - B01110011= 115, - B01110100= 116, - B01110101= 117, - B01110110= 118, - B01110111= 119, - B01111000= 120, - B01111001= 121, - B01111010= 122, - B01111011= 123, - B01111100= 124, - B01111101= 125, - B01111110= 126, - B01111111= 127, - B10000000= 128, - B10000001= 129, - B10000010= 130, - B10000011= 131, - B10000100= 132, - B10000101= 133, - B10000110= 134, - B10000111= 135, - B10001000= 136, - B10001001= 137, - B10001010= 138, - B10001011= 139, - B10001100= 140, - B10001101= 141, - B10001110= 142, - B10001111= 143, - B10010000= 144, - B10010001= 145, - B10010010= 146, - B10010011= 147, - B10010100= 148, - B10010101= 149, - B10010110= 150, - B10010111= 151, - B10011000= 152, - B10011001= 153, - B10011010= 154, - B10011011= 155, - B10011100= 156, - B10011101= 157, - B10011110= 158, - B10011111= 159, - B10100000= 160, - B10100001= 161, - B10100010= 162, - B10100011= 163, - B10100100= 164, - B10100101= 165, - B10100110= 166, - B10100111= 167, - B10101000= 168, - B10101001= 169, - B10101010= 170, - B10101011= 171, - B10101100= 172, - B10101101= 173, - B10101110= 174, - B10101111= 175, - B10110000= 176, - B10110001= 177, - B10110010= 178, - B10110011= 179, - B10110100= 180, - B10110101= 181, - B10110110= 182, - B10110111= 183, - B10111000= 184, - B10111001= 185, - B10111010= 186, - B10111011= 187, - B10111100= 188, - B10111101= 189, - B10111110= 190, - B10111111= 191, - B11000000= 192, - B11000001= 193, - B11000010= 194, - B11000011= 195, - B11000100= 196, - B11000101= 197, - B11000110= 198, - B11000111= 199, - B11001000= 200, - B11001001= 201, - B11001010= 202, - B11001011= 203, - B11001100= 204, - B11001101= 205, - B11001110= 206, - B11001111= 207, - B11010000= 208, - B11010001= 209, - B11010010= 210, - B11010011= 211, - B11010100= 212, - B11010101= 213, - B11010110= 214, - B11010111= 215, - B11011000= 216, - B11011001= 217, - B11011010= 218, - B11011011= 219, - B11011100= 220, - B11011101= 221, - B11011110= 222, - B11011111= 223, - B11100000= 224, - B11100001= 225, - B11100010= 226, - B11100011= 227, - B11100100= 228, - B11100101= 229, - B11100110= 230, - B11100111= 231, - B11101000= 232, - B11101001= 233, - B11101010= 234, - B11101011= 235, - B11101100= 236, - B11101101= 237, - B11101110= 238, - B11101111= 239, - B11110000= 240, - B11110001= 241, - B11110010= 242, - B11110011= 243, - B11110100= 244, - B11110101= 245, - B11110110= 246, - B11110111= 247, - B11111000= 248, - B11111001= 249, - B11111010= 250, - B11111011= 251, - B11111100= 252, - B11111101= 253, - B11111110= 254, - B11111111= 255 -}; diff --git a/source/fs.dll/skse64/xbyak/xbyak_mnemonic.h b/source/fs.dll/skse64/xbyak/xbyak_mnemonic.h deleted file mode 100644 index ac5be960..00000000 --- a/source/fs.dll/skse64/xbyak/xbyak_mnemonic.h +++ /dev/null @@ -1,1461 +0,0 @@ -const char *getVersionString() const { return "4.87"; } -void packssdw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6B); } -void packsswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x63); } -void packuswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x67); } -void pand(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDB); } -void pandn(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDF); } -void pmaddwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF5); } -void pmulhuw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE4); } -void pmulhw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE5); } -void pmullw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD5); } -void por(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEB); } -void punpckhbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x68); } -void punpckhwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x69); } -void punpckhdq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6A); } -void punpcklbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x60); } -void punpcklwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x61); } -void punpckldq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x62); } -void pxor(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEF); } -void pavgb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE0); } -void pavgw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE3); } -void pmaxsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEE); } -void pmaxub(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDE); } -void pminsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEA); } -void pminub(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDA); } -void psadbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF6); } -void paddq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD4); } -void pmuludq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF4); } -void psubq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFB); } -void paddb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFC); } -void paddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFD); } -void paddd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFE); } -void paddsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEC); } -void paddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xED); } -void paddusb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDC); } -void paddusw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDD); } -void pcmpeqb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x74); } -void pcmpeqw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x75); } -void pcmpeqd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x76); } -void pcmpgtb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x64); } -void pcmpgtw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x65); } -void pcmpgtd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x66); } -void psllw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF1); } -void pslld(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF2); } -void psllq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF3); } -void psraw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE1); } -void psrad(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE2); } -void psrlw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD1); } -void psrld(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD2); } -void psrlq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD3); } -void psubb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF8); } -void psubw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF9); } -void psubd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFA); } -void psubsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE8); } -void psubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE9); } -void psubusb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD8); } -void psubusw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD9); } -void psllw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 6); } -void pslld(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 6); } -void psllq(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x73, 6); } -void psraw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 4); } -void psrad(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 4); } -void psrlw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 2); } -void psrld(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 2); } -void psrlq(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x73, 2); } -void pslldq(const Xmm& xmm, int imm8) { opMMX_IMM(xmm, imm8, 0x73, 7); } -void psrldq(const Xmm& xmm, int imm8) { opMMX_IMM(xmm, imm8, 0x73, 3); } -void pshufw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x00, imm8); } -void pshuflw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF2, imm8); } -void pshufhw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF3, imm8); } -void pshufd(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x66, imm8); } -void movdqa(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x6F, 0x66); } -void movdqa(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x7F); } -void movdqu(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x6F, 0xF3); } -void movdqu(const Address& addr, const Xmm& xmm) { db(0xF3); opModM(addr, xmm, 0x0F, 0x7F); } -void movaps(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x28, 0x100); } -void movaps(const Address& addr, const Xmm& xmm) { opModM(addr, xmm, 0x0F, 0x29); } -void movss(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0xF3); } -void movss(const Address& addr, const Xmm& xmm) { db(0xF3); opModM(addr, xmm, 0x0F, 0x11); } -void movups(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x100); } -void movups(const Address& addr, const Xmm& xmm) { opModM(addr, xmm, 0x0F, 0x11); } -void movapd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x28, 0x66); } -void movapd(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x29); } -void movsd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0xF2); } -void movsd(const Address& addr, const Xmm& xmm) { db(0xF2); opModM(addr, xmm, 0x0F, 0x11); } -void movupd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x66); } -void movupd(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x11); } -void addps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x100, isXMM_XMMorMEM); } -void addss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0xF3, isXMM_XMMorMEM); } -void addpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x66, isXMM_XMMorMEM); } -void addsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0xF2, isXMM_XMMorMEM); } -void andnps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x100, isXMM_XMMorMEM); } -void andnpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x66, isXMM_XMMorMEM); } -void andps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x100, isXMM_XMMorMEM); } -void andpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x66, isXMM_XMMorMEM); } -void cmpps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x100, isXMM_XMMorMEM, imm8); } -void cmpss(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF3, isXMM_XMMorMEM, imm8); } -void cmppd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x66, isXMM_XMMorMEM, imm8); } -void cmpsd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF2, isXMM_XMMorMEM, imm8); } -void divps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x100, isXMM_XMMorMEM); } -void divss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF3, isXMM_XMMorMEM); } -void divpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x66, isXMM_XMMorMEM); } -void divsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF2, isXMM_XMMorMEM); } -void maxps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0x100, isXMM_XMMorMEM); } -void maxss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0xF3, isXMM_XMMorMEM); } -void maxpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0x66, isXMM_XMMorMEM); } -void maxsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0xF2, isXMM_XMMorMEM); } -void minps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0x100, isXMM_XMMorMEM); } -void minss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0xF3, isXMM_XMMorMEM); } -void minpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0x66, isXMM_XMMorMEM); } -void minsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0xF2, isXMM_XMMorMEM); } -void mulps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x100, isXMM_XMMorMEM); } -void mulss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0xF3, isXMM_XMMorMEM); } -void mulpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x66, isXMM_XMMorMEM); } -void mulsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0xF2, isXMM_XMMorMEM); } -void orps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x100, isXMM_XMMorMEM); } -void orpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x66, isXMM_XMMorMEM); } -void rcpps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x53, 0x100, isXMM_XMMorMEM); } -void rcpss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x53, 0xF3, isXMM_XMMorMEM); } -void rsqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0x100, isXMM_XMMorMEM); } -void rsqrtss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0xF3, isXMM_XMMorMEM); } -void shufps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x100, isXMM_XMMorMEM, imm8); } -void shufpd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x66, isXMM_XMMorMEM, imm8); } -void sqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x100, isXMM_XMMorMEM); } -void sqrtss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0xF3, isXMM_XMMorMEM); } -void sqrtpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x66, isXMM_XMMorMEM); } -void sqrtsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0xF2, isXMM_XMMorMEM); } -void subps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x100, isXMM_XMMorMEM); } -void subss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0xF3, isXMM_XMMorMEM); } -void subpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x66, isXMM_XMMorMEM); } -void subsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0xF2, isXMM_XMMorMEM); } -void unpckhps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x100, isXMM_XMMorMEM); } -void unpckhpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x66, isXMM_XMMorMEM); } -void unpcklps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x100, isXMM_XMMorMEM); } -void unpcklpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x66, isXMM_XMMorMEM); } -void xorps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x100, isXMM_XMMorMEM); } -void xorpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x66, isXMM_XMMorMEM); } -void maskmovdqu(const Xmm& reg1, const Xmm& reg2) { db(0x66); opModR(reg1, reg2, 0x0F, 0xF7); } -void movhlps(const Xmm& reg1, const Xmm& reg2) { opModR(reg1, reg2, 0x0F, 0x12); } -void movlhps(const Xmm& reg1, const Xmm& reg2) { opModR(reg1, reg2, 0x0F, 0x16); } -void punpckhqdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x6D, 0x66, isXMM_XMMorMEM); } -void punpcklqdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x6C, 0x66, isXMM_XMMorMEM); } -void comiss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2F, 0x100, isXMM_XMMorMEM); } -void ucomiss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2E, 0x100, isXMM_XMMorMEM); } -void comisd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2F, 0x66, isXMM_XMMorMEM); } -void ucomisd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2E, 0x66, isXMM_XMMorMEM); } -void cvtpd2ps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0x66, isXMM_XMMorMEM); } -void cvtps2pd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0x100, isXMM_XMMorMEM); } -void cvtsd2ss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0xF2, isXMM_XMMorMEM); } -void cvtss2sd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0xF3, isXMM_XMMorMEM); } -void cvtpd2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0xF2, isXMM_XMMorMEM); } -void cvttpd2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0x66, isXMM_XMMorMEM); } -void cvtdq2pd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0xF3, isXMM_XMMorMEM); } -void cvtps2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0x66, isXMM_XMMorMEM); } -void cvttps2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0xF3, isXMM_XMMorMEM); } -void cvtdq2ps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0x100, isXMM_XMMorMEM); } -void addsubpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xD0, 0x66, isXMM_XMMorMEM); } -void addsubps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xD0, 0xF2, isXMM_XMMorMEM); } -void haddpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0x66, isXMM_XMMorMEM); } -void haddps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0xF2, isXMM_XMMorMEM); } -void hsubpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7D, 0x66, isXMM_XMMorMEM); } -void hsubps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7D, 0xF2, isXMM_XMMorMEM); } -void movddup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x12, 0xF2, isXMM_XMMorMEM); } -void movshdup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x16, 0xF3, isXMM_XMMorMEM); } -void movsldup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x12, 0xF3, isXMM_XMMorMEM); } -void cvtpi2ps(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0x100, isXMM_MMXorMEM); } -void cvtps2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0x100, isMMX_XMMorMEM); } -void cvtsi2ss(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0xF3, isXMM_REG32orMEM); } -void cvtss2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0xF3, isREG32_XMMorMEM); } -void cvttps2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0x100, isMMX_XMMorMEM); } -void cvttss2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0xF3, isREG32_XMMorMEM); } -void cvtpi2pd(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0x66, isXMM_MMXorMEM); } -void cvtpd2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0x66, isMMX_XMMorMEM); } -void cvtsi2sd(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0xF2, isXMM_REG32orMEM); } -void cvtsd2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0xF2, isREG32_XMMorMEM); } -void cvttpd2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0x66, isMMX_XMMorMEM); } -void cvttsd2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0xF2, isREG32_XMMorMEM); } -void prefetcht0(const Address& addr) { opModM(addr, Reg32(1), 0x0F, B00011000); } -void prefetcht1(const Address& addr) { opModM(addr, Reg32(2), 0x0F, B00011000); } -void prefetcht2(const Address& addr) { opModM(addr, Reg32(3), 0x0F, B00011000); } -void prefetchnta(const Address& addr) { opModM(addr, Reg32(0), 0x0F, B00011000); } -void movhps(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x16, 0x100); } -void movlps(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x12, 0x100); } -void movhpd(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x16, 0x66); } -void movlpd(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x12, 0x66); } -void cmovo(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 0); } -void jo(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x70, 0x80, 0x0F); } -void jo(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x70, 0x80, 0x0F); } -void seto(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 0); } -void cmovno(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 1); } -void jno(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x71, 0x81, 0x0F); } -void jno(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x71, 0x81, 0x0F); } -void setno(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 1); } -void cmovb(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jb(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jb(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setb(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jc(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jc(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setc(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovnae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jnae(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jnae(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setnae(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovnb(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jnb(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jnb(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setnb(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmovae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jae(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jae(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setae(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmovnc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jnc(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jnc(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setnc(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmove(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 4); } -void je(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void je(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void sete(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 4); } -void cmovz(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 4); } -void jz(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void jz(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void setz(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 4); } -void cmovne(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 5); } -void jne(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void jne(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void setne(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 5); } -void cmovnz(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 5); } -void jnz(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void jnz(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void setnz(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 5); } -void cmovbe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 6); } -void jbe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void jbe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void setbe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 6); } -void cmovna(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 6); } -void jna(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void jna(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void setna(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 6); } -void cmovnbe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 7); } -void jnbe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void jnbe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void setnbe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 7); } -void cmova(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 7); } -void ja(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void ja(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void seta(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 7); } -void cmovs(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 8); } -void js(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x78, 0x88, 0x0F); } -void js(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x78, 0x88, 0x0F); } -void sets(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 8); } -void cmovns(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 9); } -void jns(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x79, 0x89, 0x0F); } -void jns(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x79, 0x89, 0x0F); } -void setns(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 9); } -void cmovp(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 10); } -void jp(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void jp(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void setp(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 10); } -void cmovpe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 10); } -void jpe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void jpe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void setpe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 10); } -void cmovnp(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 11); } -void jnp(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void jnp(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void setnp(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 11); } -void cmovpo(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 11); } -void jpo(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void jpo(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void setpo(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 11); } -void cmovl(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 12); } -void jl(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void jl(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void setl(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 12); } -void cmovnge(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 12); } -void jnge(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void jnge(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void setnge(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 12); } -void cmovnl(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 13); } -void jnl(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void jnl(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void setnl(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 13); } -void cmovge(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 13); } -void jge(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void jge(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void setge(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 13); } -void cmovle(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 14); } -void jle(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void jle(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void setle(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 14); } -void cmovng(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 14); } -void jng(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void jng(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void setng(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 14); } -void cmovnle(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 15); } -void jnle(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void jnle(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void setnle(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 15); } -void cmovg(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 15); } -void jg(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void jg(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void setg(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 15); } -#ifdef XBYAK32 -void jcxz(std::string label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jcxz(const Label& label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(std::string label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(const Label& label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -#else -void jecxz(std::string label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(const Label& label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jrcxz(std::string label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jrcxz(const Label& label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -#endif -#ifdef XBYAK64 -void cdqe() { db(0x48); db(0x98); } -void cqo() { db(0x48); db(0x99); } -#else -void aaa() { db(0x37); } -void aad() { db(0xD5); db(0x0A); } -void aam() { db(0xD4); db(0x0A); } -void aas() { db(0x3F); } -void daa() { db(0x27); } -void das() { db(0x2F); } -void popad() { db(0x61); } -void popfd() { db(0x9D); } -void pusha() { db(0x60); } -void pushad() { db(0x60); } -void pushfd() { db(0x9C); } -void popa() { db(0x61); } -#endif -void cbw() { db(0x66); db(0x98); } -void cdq() { db(0x99); } -void clc() { db(0xF8); } -void cld() { db(0xFC); } -void cli() { db(0xFA); } -void cmc() { db(0xF5); } -void cpuid() { db(0x0F); db(0xA2); } -void cwd() { db(0x66); db(0x99); } -void cwde() { db(0x98); } -void lahf() { db(0x9F); } -void lock() { db(0xF0); } -void nop() { db(0x90); } -void sahf() { db(0x9E); } -void stc() { db(0xF9); } -void std() { db(0xFD); } -void sti() { db(0xFB); } -void emms() { db(0x0F); db(0x77); } -void pause() { db(0xF3); db(0x90); } -void sfence() { db(0x0F); db(0xAE); db(0xF8); } -void lfence() { db(0x0F); db(0xAE); db(0xE8); } -void mfence() { db(0x0F); db(0xAE); db(0xF0); } -void monitor() { db(0x0F); db(0x01); db(0xC8); } -void mwait() { db(0x0F); db(0x01); db(0xC9); } -void rdmsr() { db(0x0F); db(0x32); } -void rdpmc() { db(0x0F); db(0x33); } -void rdtsc() { db(0x0F); db(0x31); } -void rdtscp() { db(0x0F); db(0x01); db(0xF9); } -void ud2() { db(0x0F); db(0x0B); } -void wait() { db(0x9B); } -void fwait() { db(0x9B); } -void wbinvd() { db(0x0F); db(0x09); } -void wrmsr() { db(0x0F); db(0x30); } -void xlatb() { db(0xD7); } -void popf() { db(0x9D); } -void pushf() { db(0x9C); } -void stac() { db(0x0F); db(0x01); db(0xCB); } -void vzeroall() { db(0xC5); db(0xFC); db(0x77); } -void vzeroupper() { db(0xC5); db(0xF8); db(0x77); } -void xgetbv() { db(0x0F); db(0x01); db(0xD0); } -void f2xm1() { db(0xD9); db(0xF0); } -void fabs() { db(0xD9); db(0xE1); } -void faddp() { db(0xDE); db(0xC1); } -void fchs() { db(0xD9); db(0xE0); } -void fcom() { db(0xD8); db(0xD1); } -void fcomp() { db(0xD8); db(0xD9); } -void fcompp() { db(0xDE); db(0xD9); } -void fcos() { db(0xD9); db(0xFF); } -void fdecstp() { db(0xD9); db(0xF6); } -void fdivp() { db(0xDE); db(0xF9); } -void fdivrp() { db(0xDE); db(0xF1); } -void fincstp() { db(0xD9); db(0xF7); } -void finit() { db(0x9B); db(0xDB); db(0xE3); } -void fninit() { db(0xDB); db(0xE3); } -void fld1() { db(0xD9); db(0xE8); } -void fldl2t() { db(0xD9); db(0xE9); } -void fldl2e() { db(0xD9); db(0xEA); } -void fldpi() { db(0xD9); db(0xEB); } -void fldlg2() { db(0xD9); db(0xEC); } -void fldln2() { db(0xD9); db(0xED); } -void fldz() { db(0xD9); db(0xEE); } -void fmulp() { db(0xDE); db(0xC9); } -void fnop() { db(0xD9); db(0xD0); } -void fpatan() { db(0xD9); db(0xF3); } -void fprem() { db(0xD9); db(0xF8); } -void fprem1() { db(0xD9); db(0xF5); } -void fptan() { db(0xD9); db(0xF2); } -void frndint() { db(0xD9); db(0xFC); } -void fscale() { db(0xD9); db(0xFD); } -void fsin() { db(0xD9); db(0xFE); } -void fsincos() { db(0xD9); db(0xFB); } -void fsqrt() { db(0xD9); db(0xFA); } -void fsubp() { db(0xDE); db(0xE9); } -void fsubrp() { db(0xDE); db(0xE1); } -void ftst() { db(0xD9); db(0xE4); } -void fucom() { db(0xDD); db(0xE1); } -void fucomp() { db(0xDD); db(0xE9); } -void fucompp() { db(0xDA); db(0xE9); } -void fxam() { db(0xD9); db(0xE5); } -void fxch() { db(0xD9); db(0xC9); } -void fxtract() { db(0xD9); db(0xF4); } -void fyl2x() { db(0xD9); db(0xF1); } -void fyl2xp1() { db(0xD9); db(0xF9); } -void adc(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x10); } -void adc(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x10, 2); } -void add(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x00); } -void add(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x00, 0); } -void and_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x20); } -void and_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x20, 4); } -#ifndef XBYAK_NO_OP_NAMES -void and(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x20); } -void and(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x20, 4); } -#endif -void cmp(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x38); } -void cmp(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x38, 7); } -void or_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x08); } -void or_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x08, 1); } -#ifndef XBYAK_NO_OP_NAMES -void or(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x08); } -void or(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x08, 1); } -#endif -void sbb(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x18); } -void sbb(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x18, 3); } -void sub(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x28); } -void sub(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x28, 5); } -void xor_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x30); } -void xor_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); } -#ifndef XBYAK_NO_OP_NAMES -void xor(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x30); } -void xor(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); } -#endif -void dec(const Operand& op) { opIncDec(op, 0x48, 1); } -void inc(const Operand& op) { opIncDec(op, 0x40, 0); } -void bt(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xa3); } -void bt(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 4, 0x0f, 0xba, NONE, false, 1); db(imm); } -void bts(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xab); } -void bts(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 5, 0x0f, 0xba, NONE, false, 1); db(imm); } -void btr(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xb3); } -void btr(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 6, 0x0f, 0xba, NONE, false, 1); db(imm); } -void btc(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xbb); } -void btc(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 7, 0x0f, 0xba, NONE, false, 1); db(imm); } -void div(const Operand& op) { opR_ModM(op, 0, 6, 0xF6); } -void idiv(const Operand& op) { opR_ModM(op, 0, 7, 0xF6); } -void imul(const Operand& op) { opR_ModM(op, 0, 5, 0xF6); } -void mul(const Operand& op) { opR_ModM(op, 0, 4, 0xF6); } -void neg(const Operand& op) { opR_ModM(op, 0, 3, 0xF6); } -void not_(const Operand& op) { opR_ModM(op, 0, 2, 0xF6); } -#ifndef XBYAK_NO_OP_NAMES -void not(const Operand& op) { opR_ModM(op, 0, 2, 0xF6); } -#endif -void rcl(const Operand& op, int imm) { opShift(op, imm, 2); } -void rcl(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 2); } -void rcr(const Operand& op, int imm) { opShift(op, imm, 3); } -void rcr(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 3); } -void rol(const Operand& op, int imm) { opShift(op, imm, 0); } -void rol(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 0); } -void ror(const Operand& op, int imm) { opShift(op, imm, 1); } -void ror(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 1); } -void sar(const Operand& op, int imm) { opShift(op, imm, 7); } -void sar(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 7); } -void shl(const Operand& op, int imm) { opShift(op, imm, 4); } -void shl(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 4); } -void shr(const Operand& op, int imm) { opShift(op, imm, 5); } -void shr(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 5); } -void sal(const Operand& op, int imm) { opShift(op, imm, 4); } -void sal(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 4); } -void shld(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xA4); } -void shld(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xA4, &_cl); } -void shrd(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xAC); } -void shrd(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xAC, &_cl); } -void bsf(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0xBC); } -void bsr(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0xBD); } -void popcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xB8); } -void tzcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xBC); } -void lzcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xBD); } -void pshufb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x00, 0x66, NONE, 0x38); } -void phaddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x01, 0x66, NONE, 0x38); } -void phaddd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x02, 0x66, NONE, 0x38); } -void phaddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x03, 0x66, NONE, 0x38); } -void pmaddubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x04, 0x66, NONE, 0x38); } -void phsubw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x05, 0x66, NONE, 0x38); } -void phsubd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x06, 0x66, NONE, 0x38); } -void phsubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x07, 0x66, NONE, 0x38); } -void psignb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x08, 0x66, NONE, 0x38); } -void psignw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x09, 0x66, NONE, 0x38); } -void psignd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x0A, 0x66, NONE, 0x38); } -void pmulhrsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x0B, 0x66, NONE, 0x38); } -void pabsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1C, 0x66, NONE, 0x38); } -void pabsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1D, 0x66, NONE, 0x38); } -void pabsd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1E, 0x66, NONE, 0x38); } -void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast(imm), 0x3a); } -void blendvpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void blendvps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void packusdw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2B, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pblendvb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x10, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pcmpeqq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x29, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void ptest(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x17, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x20, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x22, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxwd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x23, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxwq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x24, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x25, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x30, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x31, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x32, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxwd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x33, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxwq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x34, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x35, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminsb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x38, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x39, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3A, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminud(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3B, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxsb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3C, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3D, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3E, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxud(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3F, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmuldq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x28, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmulld(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void phminposuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pcmpgtq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x37, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesdec(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDE, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesdeclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesenc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDC, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesenclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDD, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesimc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDB, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void blendpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0D, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void blendps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0C, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void dppd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void dpps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void mpsadbw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x42, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pblendw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0E, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x08, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x09, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundss(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0A, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundsd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0B, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpestrm(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x60, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpestri(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x61, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpistrm(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x62, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpistri(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x63, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pclmulqdq(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x44, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void aeskeygenassist(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pclmullqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x00); } -void pclmulhqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x01); } -void pclmullqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x10); } -void pclmulhqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x11); } -void ldmxcsr(const Address& addr) { opModM(addr, Reg32(2), 0x0F, 0xAE); } -void stmxcsr(const Address& addr) { opModM(addr, Reg32(3), 0x0F, 0xAE); } -void clflush(const Address& addr) { opModM(addr, Reg32(7), 0x0F, 0xAE); } -void fldcw(const Address& addr) { opModM(addr, Reg32(5), 0xD9, 0x100); } -void fstcw(const Address& addr) { db(0x9B); opModM(addr, Reg32(7), 0xD9, NONE); } -void movntpd(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0x2B); } -void movntdq(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0xE7); } -void movsx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xBE); } -void movzx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xB6); } -void fadd(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 0, 0); } -void fiadd(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 0, 0); } -void fcom(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 2, 0); } -void fcomp(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 3, 0); } -void fdiv(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 6, 0); } -void fidiv(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 6, 0); } -void fdivr(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 7, 0); } -void fidivr(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 7, 0); } -void ficom(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 2, 0); } -void ficomp(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 3, 0); } -void fild(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDF, 0, 5); } -void fist(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0x00, 2, 0); } -void fistp(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDF, 3, 7); } -void fisttp(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDD, 1, 0); } -void fld(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 0, 0); } -void fmul(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 1, 0); } -void fimul(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 1, 0); } -void fst(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 2, 0); } -void fstp(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 3, 0); } -void fsub(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 4, 0); } -void fisub(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 4, 0); } -void fsubr(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 5, 0); } -void fisubr(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 5, 0); } -void fadd(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8C0, 0xDCC0); } -void fadd(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8C0, 0xDCC0); } -void faddp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEC0); } -void faddp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEC0); } -void fcmovb(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAC0, 0x00C0); } -void fcmovb(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAC0, 0x00C0); } -void fcmove(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAC8, 0x00C8); } -void fcmove(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAC8, 0x00C8); } -void fcmovbe(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAD0, 0x00D0); } -void fcmovbe(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAD0, 0x00D0); } -void fcmovu(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAD8, 0x00D8); } -void fcmovu(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAD8, 0x00D8); } -void fcmovnb(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBC0, 0x00C0); } -void fcmovnb(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBC0, 0x00C0); } -void fcmovne(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBC8, 0x00C8); } -void fcmovne(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBC8, 0x00C8); } -void fcmovnbe(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBD0, 0x00D0); } -void fcmovnbe(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBD0, 0x00D0); } -void fcmovnu(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBD8, 0x00D8); } -void fcmovnu(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBD8, 0x00D8); } -void fcomi(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBF0, 0x00F0); } -void fcomi(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBF0, 0x00F0); } -void fcomip(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDFF0, 0x00F0); } -void fcomip(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDFF0, 0x00F0); } -void fucomi(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBE8, 0x00E8); } -void fucomi(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBE8, 0x00E8); } -void fucomip(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDFE8, 0x00E8); } -void fucomip(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDFE8, 0x00E8); } -void fdiv(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8F0, 0xDCF8); } -void fdiv(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8F0, 0xDCF8); } -void fdivp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEF8); } -void fdivp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEF8); } -void fdivr(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8F8, 0xDCF0); } -void fdivr(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8F8, 0xDCF0); } -void fdivrp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEF0); } -void fdivrp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEF0); } -void fmul(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8C8, 0xDCC8); } -void fmul(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8C8, 0xDCC8); } -void fmulp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEC8); } -void fmulp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEC8); } -void fsub(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8E0, 0xDCE8); } -void fsub(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8E0, 0xDCE8); } -void fsubp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEE8); } -void fsubp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEE8); } -void fsubr(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8E8, 0xDCE0); } -void fsubr(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8E8, 0xDCE0); } -void fsubrp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEE0); } -void fsubrp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEE0); } -void fcom(const Fpu& reg) { opFpu(reg, 0xD8, 0xD0); } -void fcomp(const Fpu& reg) { opFpu(reg, 0xD8, 0xD8); } -void ffree(const Fpu& reg) { opFpu(reg, 0xDD, 0xC0); } -void fld(const Fpu& reg) { opFpu(reg, 0xD9, 0xC0); } -void fst(const Fpu& reg) { opFpu(reg, 0xDD, 0xD0); } -void fstp(const Fpu& reg) { opFpu(reg, 0xDD, 0xD8); } -void fucom(const Fpu& reg) { opFpu(reg, 0xDD, 0xE0); } -void fucomp(const Fpu& reg) { opFpu(reg, 0xDD, 0xE8); } -void fxch(const Fpu& reg) { opFpu(reg, 0xD9, 0xC8); } -void vaddpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x58, true); } -void vaddps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x58, true); } -void vaddsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x58, false); } -void vaddss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x58, false); } -void vsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5C, true); } -void vsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5C, true); } -void vsubsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5C, false); } -void vsubss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5C, false); } -void vmulpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x59, true); } -void vmulps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x59, true); } -void vmulsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x59, false); } -void vmulss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x59, false); } -void vdivpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5E, true); } -void vdivps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5E, true); } -void vdivsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5E, false); } -void vdivss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5E, false); } -void vmaxpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5F, true); } -void vmaxps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5F, true); } -void vmaxsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5F, false); } -void vmaxss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5F, false); } -void vminpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5D, true); } -void vminps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5D, true); } -void vminsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5D, false); } -void vminss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5D, false); } -void vandpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x54, true); } -void vandps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x54, true); } -void vandnpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x55, true); } -void vandnps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x55, true); } -void vorpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x56, true); } -void vorps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x56, true); } -void vxorpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x57, true); } -void vxorps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x57, true); } -void vblendpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0D, true, 0, imm); } -void vblendpd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0D, true, 0, imm); } -void vblendps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0C, true, 0, imm); } -void vblendps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0C, true, 0, imm); } -void vdppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x41, false, 0, imm); } -void vdppd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x41, false, 0, imm); } -void vdpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x40, true, 0, imm); } -void vdpps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x40, true, 0, imm); } -void vmpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x42, true, 0, imm); } -void vmpsadbw(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x42, true, 0, imm); } -void vpblendw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0E, true, 0, imm); } -void vpblendw(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0E, true, 0, imm); } -void vpblendd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x02, true, 0, imm); } -void vpblendd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x02, true, 0, imm); } -void vroundsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0B, false, 0, imm); } -void vroundsd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0B, false, 0, imm); } -void vroundss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0A, false, 0, imm); } -void vroundss(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0A, false, 0, imm); } -void vpclmulqdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x44, false, 0, imm); } -void vpclmulqdq(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x44, false, 0, imm); } -void vpermilps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0C, true, 0); } -void vpermilpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0D, true, 0); } -void vpsllvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x47, true, 0); } -void vpsllvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x47, true, 1); } -void vpsravd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x46, true, 0); } -void vpsrlvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x45, true, 0); } -void vpsrlvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x45, true, 1); } -void vcmppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xC2, true, -1, imm); } -void vcmppd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xC2, true, -1, imm); } -void vcmpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0xC2, true, -1, imm); } -void vcmpps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0xC2, true, -1, imm); } -void vcmpsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0xC2, false, -1, imm); } -void vcmpsd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0xC2, false, -1, imm); } -void vcmpss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0xC2, false, -1, imm); } -void vcmpss(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0xC2, false, -1, imm); } -void vcvtsd2ss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x5A, false, -1); } -void vcvtsd2ss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0x5A, false, -1); } -void vcvtss2sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x5A, false, -1); } -void vcvtss2sd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x5A, false, -1); } -void vinsertps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x21, false, 0, imm); } -void vinsertps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x21, false, 0, imm); } -void vpacksswb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x63, true, -1); } -void vpacksswb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x63, true, -1); } -void vpackssdw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6B, true, -1); } -void vpackssdw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6B, true, -1); } -void vpackuswb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x67, true, -1); } -void vpackuswb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x67, true, -1); } -void vpackusdw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x2B, true, -1); } -void vpackusdw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x2B, true, -1); } -void vpaddb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFC, true, -1); } -void vpaddb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFC, true, -1); } -void vpaddw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFD, true, -1); } -void vpaddw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFD, true, -1); } -void vpaddd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFE, true, -1); } -void vpaddd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFE, true, -1); } -void vpaddq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD4, true, -1); } -void vpaddq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD4, true, -1); } -void vpaddsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEC, true, -1); } -void vpaddsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEC, true, -1); } -void vpaddsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xED, true, -1); } -void vpaddsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xED, true, -1); } -void vpaddusb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDC, true, -1); } -void vpaddusb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDC, true, -1); } -void vpaddusw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDD, true, -1); } -void vpaddusw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDD, true, -1); } -void vpalignr(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0F, true, -1, imm); } -void vpalignr(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0F, true, -1, imm); } -void vpand(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDB, true, -1); } -void vpand(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDB, true, -1); } -void vpandn(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDF, true, -1); } -void vpandn(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDF, true, -1); } -void vpavgb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE0, true, -1); } -void vpavgb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE0, true, -1); } -void vpavgw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE3, true, -1); } -void vpavgw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE3, true, -1); } -void vpcmpeqb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x74, true, -1); } -void vpcmpeqb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x74, true, -1); } -void vpcmpeqw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x75, true, -1); } -void vpcmpeqw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x75, true, -1); } -void vpcmpeqd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x76, true, -1); } -void vpcmpeqd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x76, true, -1); } -void vpcmpeqq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x29, true, -1); } -void vpcmpeqq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x29, true, -1); } -void vpcmpgtb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x64, true, -1); } -void vpcmpgtb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x64, true, -1); } -void vpcmpgtw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x65, true, -1); } -void vpcmpgtw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x65, true, -1); } -void vpcmpgtd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x66, true, -1); } -void vpcmpgtd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x66, true, -1); } -void vpcmpgtq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x37, true, -1); } -void vpcmpgtq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x37, true, -1); } -void vphaddw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x01, true, -1); } -void vphaddw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x01, true, -1); } -void vphaddd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x02, true, -1); } -void vphaddd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x02, true, -1); } -void vphaddsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x03, true, -1); } -void vphaddsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x03, true, -1); } -void vphsubw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x05, true, -1); } -void vphsubw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x05, true, -1); } -void vphsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x06, true, -1); } -void vphsubd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x06, true, -1); } -void vphsubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x07, true, -1); } -void vphsubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x07, true, -1); } -void vpmaddwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF5, true, -1); } -void vpmaddwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF5, true, -1); } -void vpmaddubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x04, true, -1); } -void vpmaddubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x04, true, -1); } -void vpmaxsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3C, true, -1); } -void vpmaxsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3C, true, -1); } -void vpmaxsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEE, true, -1); } -void vpmaxsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEE, true, -1); } -void vpmaxsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3D, true, -1); } -void vpmaxsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3D, true, -1); } -void vpmaxub(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDE, true, -1); } -void vpmaxub(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDE, true, -1); } -void vpmaxuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3E, true, -1); } -void vpmaxuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3E, true, -1); } -void vpmaxud(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3F, true, -1); } -void vpmaxud(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3F, true, -1); } -void vpminsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x38, true, -1); } -void vpminsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x38, true, -1); } -void vpminsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEA, true, -1); } -void vpminsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEA, true, -1); } -void vpminsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x39, true, -1); } -void vpminsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x39, true, -1); } -void vpminub(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDA, true, -1); } -void vpminub(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDA, true, -1); } -void vpminuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3A, true, -1); } -void vpminuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3A, true, -1); } -void vpminud(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3B, true, -1); } -void vpminud(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3B, true, -1); } -void vpmulhuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE4, true, -1); } -void vpmulhuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE4, true, -1); } -void vpmulhrsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0B, true, -1); } -void vpmulhrsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x0B, true, -1); } -void vpmulhw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE5, true, -1); } -void vpmulhw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE5, true, -1); } -void vpmullw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD5, true, -1); } -void vpmullw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD5, true, -1); } -void vpmulld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x40, true, -1); } -void vpmulld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x40, true, -1); } -void vpmuludq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF4, false, -1); } -void vpmuludq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF4, false, -1); } -void vpmuldq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x28, true, -1); } -void vpmuldq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x28, true, -1); } -void vpor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEB, true, -1); } -void vpor(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEB, true, -1); } -void vpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF6, true, -1); } -void vpsadbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF6, true, -1); } -void vpshufb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x00, true, -1); } -void vpsignb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x08, true, -1); } -void vpsignb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x08, true, -1); } -void vpsignw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x09, true, -1); } -void vpsignw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x09, true, -1); } -void vpsignd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0A, true, -1); } -void vpsignd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x0A, true, -1); } -void vpsllw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF1, true, -1); } -void vpsllw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF1, true, -1); } -void vpslld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF2, true, -1); } -void vpslld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF2, true, -1); } -void vpsllq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF3, true, -1); } -void vpsllq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF3, true, -1); } -void vpsraw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE1, true, -1); } -void vpsraw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE1, true, -1); } -void vpsrad(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE2, true, -1); } -void vpsrad(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE2, true, -1); } -void vpsrlw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD1, true, -1); } -void vpsrlw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD1, true, -1); } -void vpsrld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD2, true, -1); } -void vpsrld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD2, true, -1); } -void vpsrlq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD3, true, -1); } -void vpsrlq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD3, true, -1); } -void vpsubb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF8, true, -1); } -void vpsubb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF8, true, -1); } -void vpsubw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF9, true, -1); } -void vpsubw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF9, true, -1); } -void vpsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFA, true, -1); } -void vpsubd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFA, true, -1); } -void vpsubq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFB, true, -1); } -void vpsubq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFB, true, -1); } -void vpsubsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE8, true, -1); } -void vpsubsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE8, true, -1); } -void vpsubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE9, true, -1); } -void vpsubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE9, true, -1); } -void vpsubusb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD8, true, -1); } -void vpsubusb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD8, true, -1); } -void vpsubusw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD9, true, -1); } -void vpsubusw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD9, true, -1); } -void vpunpckhbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x68, true, -1); } -void vpunpckhbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x68, true, -1); } -void vpunpckhwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x69, true, -1); } -void vpunpckhwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x69, true, -1); } -void vpunpckhdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6A, true, -1); } -void vpunpckhdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6A, true, -1); } -void vpunpckhqdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6D, true, -1); } -void vpunpckhqdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6D, true, -1); } -void vpunpcklbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x60, true, -1); } -void vpunpcklbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x60, true, -1); } -void vpunpcklwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x61, true, -1); } -void vpunpcklwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x61, true, -1); } -void vpunpckldq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x62, true, -1); } -void vpunpckldq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x62, true, -1); } -void vpunpcklqdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6C, true, -1); } -void vpunpcklqdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6C, true, -1); } -void vpxor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEF, true, -1); } -void vpxor(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEF, true, -1); } -void vrcpss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x53, false, -1); } -void vrcpss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x53, false, -1); } -void vrsqrtss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x52, false, -1); } -void vrsqrtss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x52, false, -1); } -void vshufpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xC6, true, -1, imm); } -void vshufpd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xC6, true, -1, imm); } -void vshufps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0xC6, true, -1, imm); } -void vshufps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0xC6, true, -1, imm); } -void vsqrtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x51, false, -1); } -void vsqrtsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0x51, false, -1); } -void vsqrtss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x51, false, -1); } -void vsqrtss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x51, false, -1); } -void vunpckhpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x15, true, -1); } -void vunpckhpd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x15, true, -1); } -void vunpckhps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0x15, true, -1); } -void vunpckhps(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0x15, true, -1); } -void vunpcklpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x14, true, -1); } -void vunpcklpd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x14, true, -1); } -void vunpcklps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0x14, true, -1); } -void vunpcklps(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0x14, true, -1); } -void vaeskeygenassist(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0xDF, false, 0, imm); } -void vroundpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x09, true, 0, imm); } -void vroundps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x08, true, 0, imm); } -void vpermilpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x05, true, 0, imm); } -void vpermilps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x04, true, 0, imm); } -void vpcmpestri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x61, false, 0, imm); } -void vpcmpestrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x60, false, 0, imm); } -void vpcmpistri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x63, false, 0, imm); } -void vpcmpistrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x62, false, 0, imm); } -void vtestps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x0E, true, 0); } -void vtestpd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x0F, true, 0); } -void vcomisd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x2F, false, -1); } -void vcomiss(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x2F, false, -1); } -void vcvtdq2ps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x5B, true, -1); } -void vcvtps2dq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x5B, true, -1); } -void vcvttps2dq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x5B, true, -1); } -void vmovapd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x28, true, -1); } -void vmovaps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x28, true, -1); } -void vmovddup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F2, 0x12, true, -1); } -void vmovdqa(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x6F, true, -1); } -void vmovdqu(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x6F, true, -1); } -void vmovshdup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x16, true, -1); } -void vmovsldup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x12, true, -1); } -void vmovupd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x10, true, -1); } -void vmovups(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x10, true, -1); } -void vpabsb(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1C, true, -1); } -void vpabsw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1D, true, -1); } -void vpabsd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1E, true, -1); } -void vphminposuw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x41, false, -1); } -void vpmovsxbw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x20, true, -1); } -void vpmovsxbd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x21, true, -1); } -void vpmovsxbq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x22, true, -1); } -void vpmovsxwd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x23, true, -1); } -void vpmovsxwq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x24, true, -1); } -void vpmovsxdq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x25, true, -1); } -void vpmovzxbw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x30, true, -1); } -void vpmovzxbd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x31, true, -1); } -void vpmovzxbq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x32, true, -1); } -void vpmovzxwd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x33, true, -1); } -void vpmovzxwq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x34, true, -1); } -void vpmovzxdq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x35, true, -1); } -void vpshufd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x70, true, -1, imm); } -void vpshufhw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x70, true, -1, imm); } -void vpshuflw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F2, 0x70, true, -1, imm); } -void vptest(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x17, false, -1); } -void vrcpps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x53, true, -1); } -void vrsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x52, true, -1); } -void vsqrtpd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x51, true, -1); } -void vsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x51, true, -1); } -void vucomisd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x2E, false, -1); } -void vucomiss(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x2E, false, -1); } -void vmovapd(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x29, true, -1); } -void vmovaps(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F, 0x29, true, -1); } -void vmovdqa(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x7F, true, -1); } -void vmovdqu(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_F3, 0x7F, true, -1); } -void vmovupd(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x11, true, -1); } -void vmovups(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F, 0x11, true, -1); } -void vaddsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0xD0, true, -1); } -void vaddsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0xD0, true, -1); } -void vhaddpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x7C, true, -1); } -void vhaddps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x7C, true, -1); } -void vhsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x7D, true, -1); } -void vhsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x7D, true, -1); } -void vaesenc(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDC, false, 0); } -void vaesenclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDD, false, 0); } -void vaesdec(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDE, false, 0); } -void vaesdeclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDF, false, 0); } -void vmaskmovps(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x2C, true, 0); } -void vmaskmovps(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x2E, true, 0); } -void vmaskmovpd(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x2D, true, 0); } -void vmaskmovpd(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x2F, true, 0); } -void vpmaskmovd(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x8C, true, 0); } -void vpmaskmovd(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x8E, true, 0); } -void vpmaskmovq(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x8C, true, 1); } -void vpmaskmovq(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x8E, true, 1); } -void vpermd(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, MM_0F38 | PP_66, 0x36, true, 0); } -void vpermps(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, MM_0F38 | PP_66, 0x16, true, 0); } -void vpermq(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, MM_0F3A | PP_66, 0x00, true, 1, imm); } -void vpermpd(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, MM_0F3A | PP_66, 0x01, true, 1, imm); } -void cmpeqpd(const Xmm& x, const Operand& op) { cmppd(x, op, 0); } -void vcmpeqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 0); } -void vcmpeqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 0); } -void cmpltpd(const Xmm& x, const Operand& op) { cmppd(x, op, 1); } -void vcmpltpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 1); } -void vcmpltpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 1); } -void cmplepd(const Xmm& x, const Operand& op) { cmppd(x, op, 2); } -void vcmplepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 2); } -void vcmplepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 2); } -void cmpunordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 3); } -void vcmpunordpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 3); } -void vcmpunordpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 3); } -void cmpneqpd(const Xmm& x, const Operand& op) { cmppd(x, op, 4); } -void vcmpneqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 4); } -void vcmpneqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 4); } -void cmpnltpd(const Xmm& x, const Operand& op) { cmppd(x, op, 5); } -void vcmpnltpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 5); } -void vcmpnltpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 5); } -void cmpnlepd(const Xmm& x, const Operand& op) { cmppd(x, op, 6); } -void vcmpnlepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 6); } -void vcmpnlepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 6); } -void cmpordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 7); } -void vcmpordpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 7); } -void vcmpordpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 7); } -void vcmpeq_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 8); } -void vcmpeq_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 8); } -void vcmpngepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 9); } -void vcmpngepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 9); } -void vcmpngtpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 10); } -void vcmpngtpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 10); } -void vcmpfalsepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 11); } -void vcmpfalsepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 11); } -void vcmpneq_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 12); } -void vcmpneq_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 12); } -void vcmpgepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 13); } -void vcmpgepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 13); } -void vcmpgtpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 14); } -void vcmpgtpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 14); } -void vcmptruepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 15); } -void vcmptruepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 15); } -void vcmpeq_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 16); } -void vcmpeq_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 16); } -void vcmplt_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 17); } -void vcmplt_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 17); } -void vcmple_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 18); } -void vcmple_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 18); } -void vcmpunord_spd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 19); } -void vcmpunord_spd(const Xmm& x, const Operand& op) { vcmppd(x, op, 19); } -void vcmpneq_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 20); } -void vcmpneq_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 20); } -void vcmpnlt_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 21); } -void vcmpnlt_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 21); } -void vcmpnle_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 22); } -void vcmpnle_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 22); } -void vcmpord_spd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 23); } -void vcmpord_spd(const Xmm& x, const Operand& op) { vcmppd(x, op, 23); } -void vcmpeq_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 24); } -void vcmpeq_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 24); } -void vcmpnge_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 25); } -void vcmpnge_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 25); } -void vcmpngt_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 26); } -void vcmpngt_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 26); } -void vcmpfalse_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 27); } -void vcmpfalse_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 27); } -void vcmpneq_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 28); } -void vcmpneq_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 28); } -void vcmpge_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 29); } -void vcmpge_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 29); } -void vcmpgt_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 30); } -void vcmpgt_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 30); } -void vcmptrue_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 31); } -void vcmptrue_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 31); } -void cmpeqps(const Xmm& x, const Operand& op) { cmpps(x, op, 0); } -void vcmpeqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 0); } -void vcmpeqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 0); } -void cmpltps(const Xmm& x, const Operand& op) { cmpps(x, op, 1); } -void vcmpltps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 1); } -void vcmpltps(const Xmm& x, const Operand& op) { vcmpps(x, op, 1); } -void cmpleps(const Xmm& x, const Operand& op) { cmpps(x, op, 2); } -void vcmpleps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 2); } -void vcmpleps(const Xmm& x, const Operand& op) { vcmpps(x, op, 2); } -void cmpunordps(const Xmm& x, const Operand& op) { cmpps(x, op, 3); } -void vcmpunordps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 3); } -void vcmpunordps(const Xmm& x, const Operand& op) { vcmpps(x, op, 3); } -void cmpneqps(const Xmm& x, const Operand& op) { cmpps(x, op, 4); } -void vcmpneqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 4); } -void vcmpneqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 4); } -void cmpnltps(const Xmm& x, const Operand& op) { cmpps(x, op, 5); } -void vcmpnltps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 5); } -void vcmpnltps(const Xmm& x, const Operand& op) { vcmpps(x, op, 5); } -void cmpnleps(const Xmm& x, const Operand& op) { cmpps(x, op, 6); } -void vcmpnleps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 6); } -void vcmpnleps(const Xmm& x, const Operand& op) { vcmpps(x, op, 6); } -void cmpordps(const Xmm& x, const Operand& op) { cmpps(x, op, 7); } -void vcmpordps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 7); } -void vcmpordps(const Xmm& x, const Operand& op) { vcmpps(x, op, 7); } -void vcmpeq_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 8); } -void vcmpeq_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 8); } -void vcmpngeps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 9); } -void vcmpngeps(const Xmm& x, const Operand& op) { vcmpps(x, op, 9); } -void vcmpngtps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 10); } -void vcmpngtps(const Xmm& x, const Operand& op) { vcmpps(x, op, 10); } -void vcmpfalseps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 11); } -void vcmpfalseps(const Xmm& x, const Operand& op) { vcmpps(x, op, 11); } -void vcmpneq_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 12); } -void vcmpneq_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 12); } -void vcmpgeps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 13); } -void vcmpgeps(const Xmm& x, const Operand& op) { vcmpps(x, op, 13); } -void vcmpgtps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 14); } -void vcmpgtps(const Xmm& x, const Operand& op) { vcmpps(x, op, 14); } -void vcmptrueps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 15); } -void vcmptrueps(const Xmm& x, const Operand& op) { vcmpps(x, op, 15); } -void vcmpeq_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 16); } -void vcmpeq_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 16); } -void vcmplt_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 17); } -void vcmplt_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 17); } -void vcmple_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 18); } -void vcmple_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 18); } -void vcmpunord_sps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 19); } -void vcmpunord_sps(const Xmm& x, const Operand& op) { vcmpps(x, op, 19); } -void vcmpneq_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 20); } -void vcmpneq_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 20); } -void vcmpnlt_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 21); } -void vcmpnlt_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 21); } -void vcmpnle_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 22); } -void vcmpnle_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 22); } -void vcmpord_sps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 23); } -void vcmpord_sps(const Xmm& x, const Operand& op) { vcmpps(x, op, 23); } -void vcmpeq_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 24); } -void vcmpeq_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 24); } -void vcmpnge_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 25); } -void vcmpnge_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 25); } -void vcmpngt_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 26); } -void vcmpngt_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 26); } -void vcmpfalse_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 27); } -void vcmpfalse_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 27); } -void vcmpneq_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 28); } -void vcmpneq_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 28); } -void vcmpge_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 29); } -void vcmpge_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 29); } -void vcmpgt_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 30); } -void vcmpgt_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 30); } -void vcmptrue_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 31); } -void vcmptrue_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 31); } -void cmpeqsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 0); } -void vcmpeqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 0); } -void vcmpeqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 0); } -void cmpltsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 1); } -void vcmpltsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 1); } -void vcmpltsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 1); } -void cmplesd(const Xmm& x, const Operand& op) { cmpsd(x, op, 2); } -void vcmplesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 2); } -void vcmplesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 2); } -void cmpunordsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 3); } -void vcmpunordsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 3); } -void vcmpunordsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 3); } -void cmpneqsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 4); } -void vcmpneqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 4); } -void vcmpneqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 4); } -void cmpnltsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 5); } -void vcmpnltsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 5); } -void vcmpnltsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 5); } -void cmpnlesd(const Xmm& x, const Operand& op) { cmpsd(x, op, 6); } -void vcmpnlesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 6); } -void vcmpnlesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 6); } -void cmpordsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 7); } -void vcmpordsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 7); } -void vcmpordsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 7); } -void vcmpeq_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 8); } -void vcmpeq_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 8); } -void vcmpngesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 9); } -void vcmpngesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 9); } -void vcmpngtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 10); } -void vcmpngtsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 10); } -void vcmpfalsesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 11); } -void vcmpfalsesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 11); } -void vcmpneq_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 12); } -void vcmpneq_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 12); } -void vcmpgesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 13); } -void vcmpgesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 13); } -void vcmpgtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 14); } -void vcmpgtsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 14); } -void vcmptruesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 15); } -void vcmptruesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 15); } -void vcmpeq_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 16); } -void vcmpeq_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 16); } -void vcmplt_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 17); } -void vcmplt_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 17); } -void vcmple_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 18); } -void vcmple_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 18); } -void vcmpunord_ssd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 19); } -void vcmpunord_ssd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 19); } -void vcmpneq_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 20); } -void vcmpneq_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 20); } -void vcmpnlt_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 21); } -void vcmpnlt_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 21); } -void vcmpnle_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 22); } -void vcmpnle_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 22); } -void vcmpord_ssd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 23); } -void vcmpord_ssd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 23); } -void vcmpeq_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 24); } -void vcmpeq_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 24); } -void vcmpnge_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 25); } -void vcmpnge_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 25); } -void vcmpngt_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 26); } -void vcmpngt_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 26); } -void vcmpfalse_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 27); } -void vcmpfalse_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 27); } -void vcmpneq_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 28); } -void vcmpneq_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 28); } -void vcmpge_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 29); } -void vcmpge_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 29); } -void vcmpgt_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 30); } -void vcmpgt_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 30); } -void vcmptrue_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 31); } -void vcmptrue_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 31); } -void cmpeqss(const Xmm& x, const Operand& op) { cmpss(x, op, 0); } -void vcmpeqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 0); } -void vcmpeqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 0); } -void cmpltss(const Xmm& x, const Operand& op) { cmpss(x, op, 1); } -void vcmpltss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 1); } -void vcmpltss(const Xmm& x, const Operand& op) { vcmpss(x, op, 1); } -void cmpless(const Xmm& x, const Operand& op) { cmpss(x, op, 2); } -void vcmpless(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 2); } -void vcmpless(const Xmm& x, const Operand& op) { vcmpss(x, op, 2); } -void cmpunordss(const Xmm& x, const Operand& op) { cmpss(x, op, 3); } -void vcmpunordss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 3); } -void vcmpunordss(const Xmm& x, const Operand& op) { vcmpss(x, op, 3); } -void cmpneqss(const Xmm& x, const Operand& op) { cmpss(x, op, 4); } -void vcmpneqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 4); } -void vcmpneqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 4); } -void cmpnltss(const Xmm& x, const Operand& op) { cmpss(x, op, 5); } -void vcmpnltss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 5); } -void vcmpnltss(const Xmm& x, const Operand& op) { vcmpss(x, op, 5); } -void cmpnless(const Xmm& x, const Operand& op) { cmpss(x, op, 6); } -void vcmpnless(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 6); } -void vcmpnless(const Xmm& x, const Operand& op) { vcmpss(x, op, 6); } -void cmpordss(const Xmm& x, const Operand& op) { cmpss(x, op, 7); } -void vcmpordss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 7); } -void vcmpordss(const Xmm& x, const Operand& op) { vcmpss(x, op, 7); } -void vcmpeq_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 8); } -void vcmpeq_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 8); } -void vcmpngess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 9); } -void vcmpngess(const Xmm& x, const Operand& op) { vcmpss(x, op, 9); } -void vcmpngtss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 10); } -void vcmpngtss(const Xmm& x, const Operand& op) { vcmpss(x, op, 10); } -void vcmpfalsess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 11); } -void vcmpfalsess(const Xmm& x, const Operand& op) { vcmpss(x, op, 11); } -void vcmpneq_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 12); } -void vcmpneq_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 12); } -void vcmpgess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 13); } -void vcmpgess(const Xmm& x, const Operand& op) { vcmpss(x, op, 13); } -void vcmpgtss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 14); } -void vcmpgtss(const Xmm& x, const Operand& op) { vcmpss(x, op, 14); } -void vcmptruess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 15); } -void vcmptruess(const Xmm& x, const Operand& op) { vcmpss(x, op, 15); } -void vcmpeq_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 16); } -void vcmpeq_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 16); } -void vcmplt_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 17); } -void vcmplt_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 17); } -void vcmple_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 18); } -void vcmple_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 18); } -void vcmpunord_sss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 19); } -void vcmpunord_sss(const Xmm& x, const Operand& op) { vcmpss(x, op, 19); } -void vcmpneq_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 20); } -void vcmpneq_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 20); } -void vcmpnlt_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 21); } -void vcmpnlt_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 21); } -void vcmpnle_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 22); } -void vcmpnle_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 22); } -void vcmpord_sss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 23); } -void vcmpord_sss(const Xmm& x, const Operand& op) { vcmpss(x, op, 23); } -void vcmpeq_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 24); } -void vcmpeq_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 24); } -void vcmpnge_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 25); } -void vcmpnge_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 25); } -void vcmpngt_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 26); } -void vcmpngt_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 26); } -void vcmpfalse_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 27); } -void vcmpfalse_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 27); } -void vcmpneq_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 28); } -void vcmpneq_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 28); } -void vcmpge_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 29); } -void vcmpge_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 29); } -void vcmpgt_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 30); } -void vcmpgt_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 30); } -void vcmptrue_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 31); } -void vcmptrue_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 31); } -void vmovhpd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F | PP_66, 0x16, false); } -void vmovhpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x17, false); } -void vmovhps(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F, 0x16, false); } -void vmovhps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F, 0x17, false); } -void vmovlpd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F | PP_66, 0x12, false); } -void vmovlpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x13, false); } -void vmovlps(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F, 0x12, false); } -void vmovlps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F, 0x13, false); } -void vfmadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x98, true, 1); } -void vfmadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA8, true, 1); } -void vfmadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB8, true, 1); } -void vfmadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x98, true, 0); } -void vfmadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA8, true, 0); } -void vfmadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB8, true, 0); } -void vfmadd132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x99, false, 1); } -void vfmadd213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA9, false, 1); } -void vfmadd231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB9, false, 1); } -void vfmadd132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x99, false, 0); } -void vfmadd213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA9, false, 0); } -void vfmadd231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB9, false, 0); } -void vfmaddsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x96, true, 1); } -void vfmaddsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA6, true, 1); } -void vfmaddsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB6, true, 1); } -void vfmaddsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x96, true, 0); } -void vfmaddsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA6, true, 0); } -void vfmaddsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB6, true, 0); } -void vfmsubadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x97, true, 1); } -void vfmsubadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA7, true, 1); } -void vfmsubadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB7, true, 1); } -void vfmsubadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x97, true, 0); } -void vfmsubadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA7, true, 0); } -void vfmsubadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB7, true, 0); } -void vfmsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9A, true, 1); } -void vfmsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAA, true, 1); } -void vfmsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBA, true, 1); } -void vfmsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9A, true, 0); } -void vfmsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAA, true, 0); } -void vfmsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBA, true, 0); } -void vfmsub132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9B, false, 1); } -void vfmsub213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAB, false, 1); } -void vfmsub231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBB, false, 1); } -void vfmsub132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9B, false, 0); } -void vfmsub213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAB, false, 0); } -void vfmsub231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBB, false, 0); } -void vfnmadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9C, true, 1); } -void vfnmadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAC, true, 1); } -void vfnmadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBC, true, 1); } -void vfnmadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9C, true, 0); } -void vfnmadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAC, true, 0); } -void vfnmadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBC, true, 0); } -void vfnmadd132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9D, false, 1); } -void vfnmadd213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAD, false, 1); } -void vfnmadd231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBD, false, 1); } -void vfnmadd132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9D, false, 0); } -void vfnmadd213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAD, false, 0); } -void vfnmadd231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBD, false, 0); } -void vfnmsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9E, true, 1); } -void vfnmsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAE, true, 1); } -void vfnmsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBE, true, 1); } -void vfnmsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9E, true, 0); } -void vfnmsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAE, true, 0); } -void vfnmsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBE, true, 0); } -void vfnmsub132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9F, false, 1); } -void vfnmsub213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAF, false, 1); } -void vfnmsub231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBF, false, 1); } -void vfnmsub132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9F, false, 0); } -void vfnmsub213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAF, false, 0); } -void vfnmsub231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBF, false, 0); } -void vaesimc(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0xDB, false, 0); } -void vbroadcastf128(const Ymm& y, const Address& addr) { opAVX_X_XM_IMM(y, addr, MM_0F38 | PP_66, 0x1A, true, 0); } -void vbroadcasti128(const Ymm& y, const Address& addr) { opAVX_X_XM_IMM(y, addr, MM_0F38 | PP_66, 0x5A, true, 0); } -void vbroadcastsd(const Ymm& y, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(y, op, MM_0F38 | PP_66, 0x19, true, 0); } -void vbroadcastss(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x18, true, 0); } -void vpbroadcastb(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x78, true, 0); } -void vpbroadcastw(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x79, true, 0); } -void vpbroadcastd(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x58, true, 0); } -void vpbroadcastq(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x59, true, 0); } -void vextractf128(const Operand& op, const Ymm& y, uint8 imm) { opAVX_X_X_XMcvt(y, y.isXMM() ? xm0 : ym0, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x19, true, 0, imm); } -void vextracti128(const Operand& op, const Ymm& y, uint8 imm) { opAVX_X_X_XMcvt(y, y.isXMM() ? xm0 : ym0, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x39, true, 0, imm); } -void vextractps(const Operand& op, const Xmm& x, uint8 imm) { if (!(op.isREG(32) || op.isMEM()) || x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, op.isREG(), Operand::XMM, MM_0F3A | PP_66, 0x17, false, 0, imm); } -void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XMcvt(y1, y2, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x18, true, 0, imm); } -void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XMcvt(y1, y2, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x38, true, 0, imm); } -void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, MM_0F3A | PP_66, 0x06, true, 0, imm); } -void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, MM_0F3A | PP_66, 0x46, true, 0, imm); } -void vlddqu(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_F2, 0xF0, true, 0); } -void vldmxcsr(const Address& addr) { opAVX_X_X_XM(xm2, xm0, addr, MM_0F, 0xAE, false, -1); } -void vstmxcsr(const Address& addr) { opAVX_X_X_XM(xm3, xm0, addr, MM_0F, 0xAE, false, -1); } -void vmaskmovdqu(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, MM_0F | PP_66, 0xF7, false, -1); } -void vpextrb(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(i32e) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x14, false, -1, imm); } -void vpextrw(const Reg& r, const Xmm& x, uint8 imm) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, x, MM_0F | PP_66, 0xC5, false, r.isBit(64) ? 1 : 0, imm); } -void vpextrw(const Address& addr, const Xmm& x, uint8 imm) { opAVX_X_X_XM(x, xm0, addr, MM_0F3A | PP_66, 0x15, false, -1, imm); } -void vpextrd(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x16, false, 0, imm); } -void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x20, false, -1, imm); } -void vpinsrb(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x20, false, -1, imm); } -void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F | PP_66, 0xC4, false, -1, imm); } -void vpinsrw(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F | PP_66, 0xC4, false, -1, imm); } -void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 0, imm); } -void vpinsrd(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 0, imm); } -void vpmovmskb(const Reg32e& r, const Xmm& x) { bool isYMM= x.isYMM(); opAVX_X_X_XM(isYMM ? Ymm(r.getIdx()) : Xmm(r.getIdx()), isYMM ? ym0 : xm0, x, MM_0F | PP_66, 0xD7, true); } -void vpslldq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym7 : xm7, x1, x2, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpslldq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym7 : xm7, x, x, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsrldq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym3 : xm3, x1, x2, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsrldq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym3 : xm3, x, x, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsllw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpsllw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpslld(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpslld(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpsllq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsllq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsraw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym4 : xm4, x1, x2, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpsraw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym4 : xm4, x, x, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpsrad(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym4 : xm4, x1, x2, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpsrad(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym4 : xm4, x, x, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpsrlw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpsrlw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x71, true, -1, imm); } -void vpsrld(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpsrld(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x72, true, -1, imm); } -void vpsrlq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x73, true, -1, imm); } -void vpsrlq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x73, true, -1, imm); } -void vblendvpd(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4B, true, -1, x4.getIdx() << 4); } -void vblendvpd(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4B, true, -1, x4.getIdx() << 4); } -void vblendvps(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4A, true, -1, x4.getIdx() << 4); } -void vblendvps(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4A, true, -1, x4.getIdx() << 4); } -void vpblendvb(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4C, false, -1, x4.getIdx() << 4); } -void vpblendvb(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4C, false, -1, x4.getIdx() << 4); } -void vmovd(const Xmm& x, const Reg32& reg) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x6E, false, 0); } -void vmovd(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x6E, false, 0); } -void vmovd(const Reg32& reg, const Xmm& x) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x7E, false, 0); } -void vmovd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x7E, false, 0); } -void vmovq(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x7E, false, -1); } -void vmovq(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0xD6, false, -1); } -void vmovq(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, MM_0F | PP_F3, 0x7E, false, -1); } -void vmovhlps(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F, 0x12, false); } -void vmovlhps(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F, 0x16, false); } -void vmovmskpd(const Reg& r, const Xmm& x) { if (!r.isBit(i32e)) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x.isXMM() ? Xmm(r.getIdx()) : Ymm(r.getIdx()), x.isXMM() ? xm0 : ym0, x, MM_0F | PP_66, 0x50, true, 0); } -void vmovmskps(const Reg& r, const Xmm& x) { if (!r.isBit(i32e)) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x.isXMM() ? Xmm(r.getIdx()) : Ymm(r.getIdx()), x.isXMM() ? xm0 : ym0, x, MM_0F, 0x50, true, 0); } -void vmovntdq(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_66, 0xE7, true); } -void vmovntpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_66, 0x2B, true); } -void vmovntps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F, 0x2B, true); } -void vmovntdqa(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ymm0, addr, MM_0F38 | PP_66, 0x2A, true); } -void vmovsd(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x10, false); } -void vmovsd(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F2, 0x10, false); } -void vmovsd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F2, 0x11, false); } -void vmovss(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x10, false); } -void vmovss(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x10, false); } -void vmovss(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x11, false); } -void vcvtss2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2D, false, 0); } -void vcvttss2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2C, false, 0); } -void vcvtsd2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2D, false, 0); } -void vcvttsd2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2C, false, 0); } -void vcvtsi2ss(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !(op2.isREG(i32e) || op2.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, op1, op2, op2.isREG(), Operand::XMM, MM_0F | PP_F3, 0x2A, false, (op1.isMEM() || op2.isMEM()) ? -1 : (op1.isREG(32) || op2.isREG(32)) ? 0 : 1); } -void vcvtsi2sd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !(op2.isREG(i32e) || op2.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, op1, op2, op2.isREG(), Operand::XMM, MM_0F | PP_F2, 0x2A, false, (op1.isMEM() || op2.isMEM()) ? -1 : (op1.isREG(32) || op2.isREG(32)) ? 0 : 1); } -void vcvtps2pd(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, !op.isMEM(), x.isXMM() ? Operand::XMM : Operand::YMM, MM_0F, 0x5A, true); } -void vcvtdq2pd(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, !op.isMEM(), x.isXMM() ? Operand::XMM : Operand::YMM, MM_0F | PP_F3, 0xE6, true); } -void vcvtpd2ps(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_66, 0x5A, true); } -void vcvtpd2dq(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_F2, 0xE6, true); } -void vcvttpd2dq(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_66, 0xE6, true); } -void vcvtph2ps(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opVex(x, NULL, &op, MM_0F38 | PP_66, 0x13, 0); } -void vcvtps2ph(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opVex(x, NULL, &op, MM_0F3A | PP_66, 0x1d, 0, imm); } -#ifdef XBYAK64 -void vmovq(const Xmm& x, const Reg64& reg) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x6E, false, 1); } -void vmovq(const Reg64& reg, const Xmm& x) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x7E, false, 1); } -void vpextrq(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x16, false, 1, imm); } -void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 1, imm); } -void vpinsrq(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 1, imm); } -void vcvtss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2D, false, 1); } -void vcvttss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2C, false, 1); } -void vcvtsd2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2D, false, 1); } -void vcvttsd2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2C, false, 1); } -#endif -void andn(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38, 0xf2, true); } -void mulx(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F2, 0xf6, true); } -void pdep(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F2, 0xf5, true); } -void pext(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F3, 0xf5, true); } -void bextr(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38, 0xf7, false); } -void bzhi(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38, 0xf5, false); } -void sarx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_F3, 0xf7, false); } -void shlx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_66, 0xf7, false); } -void shrx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_F2, 0xf7, false); } -void blsi(const Reg32e& r, const Operand& op) { opGpr(Reg32e(3, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void blsmsk(const Reg32e& r, const Operand& op) { opGpr(Reg32e(2, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void blsr(const Reg32e& r, const Operand& op) { opGpr(Reg32e(1, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void vgatherdpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x92, 1, 0); } -void vgatherqpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x93, 1, 1); } -void vgatherdps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x92, 0, 1); } -void vgatherqps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x93, 0, 2); } -void vpgatherdd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x90, 0, 1); } -void vpgatherqd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x91, 0, 2); } -void vpgatherdq(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x90, 1, 0); } -void vpgatherqq(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x91, 1, 1); } diff --git a/source/fs.dll/skse64/xbyak/xbyak_util.h b/source/fs.dll/skse64/xbyak/xbyak_util.h deleted file mode 100644 index 3a7c2c21..00000000 --- a/source/fs.dll/skse64/xbyak/xbyak_util.h +++ /dev/null @@ -1,533 +0,0 @@ -#ifndef XBYAK_XBYAK_UTIL_H_ -#define XBYAK_XBYAK_UTIL_H_ - -/** - utility class and functions for Xbyak - Xbyak::util::Clock ; rdtsc timer - Xbyak::util::Cpu ; detect CPU - @note this header is UNDER CONSTRUCTION! -*/ -#include "xbyak.h" - -#ifdef _MSC_VER - #if (_MSC_VER < 1400) && defined(XBYAK32) - static inline __declspec(naked) void __cpuid(int[4], int) - { - __asm { - push ebx - push esi - mov eax, dword ptr [esp + 4 * 2 + 8] // eaxIn - cpuid - mov esi, dword ptr [esp + 4 * 2 + 4] // data - mov dword ptr [esi], eax - mov dword ptr [esi + 4], ebx - mov dword ptr [esi + 8], ecx - mov dword ptr [esi + 12], edx - pop esi - pop ebx - ret - } - } - #else - #include // for __cpuid - #endif -#else - #ifndef __GNUC_PREREQ - #define __GNUC_PREREQ(major, minor) ((((__GNUC__) << 16) + (__GNUC_MINOR__)) >= (((major) << 16) + (minor))) - #endif - #if __GNUC_PREREQ(4, 3) && !defined(__APPLE__) - #include - #else - #if defined(__APPLE__) && defined(XBYAK32) // avoid err : can't find a register in class `BREG' while reloading `asm' - #define __cpuid(eaxIn, a, b, c, d) __asm__ __volatile__("pushl %%ebx\ncpuid\nmovl %%ebp, %%esi\npopl %%ebx" : "=a"(a), "=S"(b), "=c"(c), "=d"(d) : "0"(eaxIn)) - #define __cpuid_count(eaxIn, ecxIn, a, b, c, d) __asm__ __volatile__("pushl %%ebx\ncpuid\nmovl %%ebp, %%esi\npopl %%ebx" : "=a"(a), "=S"(b), "=c"(c), "=d"(d) : "0"(eaxIn), "2"(ecxIn)) - #else - #define __cpuid(eaxIn, a, b, c, d) __asm__ __volatile__("cpuid\n" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eaxIn)) - #define __cpuid_count(eaxIn, ecxIn, a, b, c, d) __asm__ __volatile__("cpuid\n" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eaxIn), "2"(ecxIn)) - #endif - #endif -#endif - -#ifdef _MSC_VER -extern "C" unsigned __int64 __xgetbv(int); -#endif - -namespace Xbyak { namespace util { - -/** - CPU detection class -*/ -class Cpu { - uint64 type_; - unsigned int get32bitAsBE(const char *x) const - { - return x[0] | (x[1] << 8) | (x[2] << 16) | (x[3] << 24); - } - unsigned int mask(int n) const - { - return (1U << n) - 1; - } - void setFamily() - { - unsigned int data[4]; - getCpuid(1, data); - stepping = data[0] & mask(4); - model = (data[0] >> 4) & mask(4); - family = (data[0] >> 8) & mask(4); - // type = (data[0] >> 12) & mask(2); - extModel = (data[0] >> 16) & mask(4); - extFamily = (data[0] >> 20) & mask(8); - if (family == 0x0f) { - displayFamily = family + extFamily; - } else { - displayFamily = family; - } - if (family == 6 || family == 0x0f) { - displayModel = (extModel << 4) + model; - } else { - displayModel = model; - } - } -public: - int model; - int family; - int stepping; - int extModel; - int extFamily; - int displayFamily; // family + extFamily - int displayModel; // model + extModel - static inline void getCpuid(unsigned int eaxIn, unsigned int data[4]) - { -#ifdef _MSC_VER - __cpuid(reinterpret_cast(data), eaxIn); -#else - __cpuid(eaxIn, data[0], data[1], data[2], data[3]); -#endif - } - static inline void getCpuidEx(unsigned int eaxIn, unsigned int ecxIn, unsigned int data[4]) - { -#ifdef _MSC_VER - __cpuidex(reinterpret_cast(data), eaxIn, ecxIn); -#else - __cpuid_count(eaxIn, ecxIn, data[0], data[1], data[2], data[3]); -#endif - } - static inline uint64 getXfeature() - { -#ifdef _MSC_VER - return __xgetbv(0); -#else - unsigned int eax, edx; - // xgetvb is not support on gcc 4.2 -// __asm__ volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); - __asm__ volatile(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0)); - return ((uint64)edx << 32) | eax; -#endif - } - typedef uint64 Type; - static const Type NONE = 0; - static const Type tMMX = 1 << 0; - static const Type tMMX2 = 1 << 1; - static const Type tCMOV = 1 << 2; - static const Type tSSE = 1 << 3; - static const Type tSSE2 = 1 << 4; - static const Type tSSE3 = 1 << 5; - static const Type tSSSE3 = 1 << 6; - static const Type tSSE41 = 1 << 7; - static const Type tSSE42 = 1 << 8; - static const Type tPOPCNT = 1 << 9; - static const Type tAESNI = 1 << 10; - static const Type tSSE5 = 1 << 11; - static const Type tOSXSAVE = 1 << 12; - static const Type tPCLMULQDQ = 1 << 13; - static const Type tAVX = 1 << 14; - static const Type tFMA = 1 << 15; - - static const Type t3DN = 1 << 16; - static const Type tE3DN = 1 << 17; - static const Type tSSE4a = 1 << 18; - static const Type tRDTSCP = 1 << 19; - static const Type tAVX2 = 1 << 20; - static const Type tBMI1 = 1 << 21; // andn, bextr, blsi, blsmsk, blsr, tzcnt - static const Type tBMI2 = 1 << 22; // bzhi, mulx, pdep, pext, rorx, sarx, shlx, shrx - static const Type tLZCNT = 1 << 23; - - static const Type tINTEL = 1 << 24; - static const Type tAMD = 1 << 25; - - static const Type tENHANCED_REP = 1 << 26; // enhanced rep movsb/stosb - static const Type tRDRAND = 1 << 27; - static const Type tADX = 1 << 28; // adcx, adox - static const Type tRDSEED = 1 << 29; // rdseed - static const Type tSMAP = 1 << 30; // stac - static const Type tHLE = uint64(1) << 31; // xacquire, xrelease, xtest - static const Type tRTM = uint64(1) << 32; // xbegin, xend, xabort - static const Type tF16C = uint64(1) << 33; // vcvtph2ps, vcvtps2ph - static const Type tMOVBE = uint64(1) << 34; // mobve - - Cpu() - : type_(NONE) - { - unsigned int data[4]; - getCpuid(0, data); - const unsigned int maxNum = data[0]; - static const char intel[] = "ntel"; - static const char amd[] = "cAMD"; - if (data[2] == get32bitAsBE(amd)) { - type_ |= tAMD; - getCpuid(0x80000001, data); - if (data[3] & (1U << 31)) type_ |= t3DN; - if (data[3] & (1U << 15)) type_ |= tCMOV; - if (data[3] & (1U << 30)) type_ |= tE3DN; - if (data[3] & (1U << 22)) type_ |= tMMX2; - if (data[3] & (1U << 27)) type_ |= tRDTSCP; - } - if (data[2] == get32bitAsBE(intel)) { - type_ |= tINTEL; - getCpuid(0x80000001, data); - if (data[3] & (1U << 27)) type_ |= tRDTSCP; - if (data[2] & (1U << 5)) type_ |= tLZCNT; - } - getCpuid(1, data); - if (data[2] & (1U << 0)) type_ |= tSSE3; - if (data[2] & (1U << 9)) type_ |= tSSSE3; - if (data[2] & (1U << 19)) type_ |= tSSE41; - if (data[2] & (1U << 20)) type_ |= tSSE42; - if (data[2] & (1U << 22)) type_ |= tMOVBE; - if (data[2] & (1U << 23)) type_ |= tPOPCNT; - if (data[2] & (1U << 25)) type_ |= tAESNI; - if (data[2] & (1U << 1)) type_ |= tPCLMULQDQ; - if (data[2] & (1U << 27)) type_ |= tOSXSAVE; - if (data[2] & (1U << 30)) type_ |= tRDRAND; - if (data[2] & (1U << 29)) type_ |= tF16C; - - if (data[3] & (1U << 15)) type_ |= tCMOV; - if (data[3] & (1U << 23)) type_ |= tMMX; - if (data[3] & (1U << 25)) type_ |= tMMX2 | tSSE; - if (data[3] & (1U << 26)) type_ |= tSSE2; - - if (type_ & tOSXSAVE) { - // check XFEATURE_ENABLED_MASK[2:1] = '11b' - uint64 bv = getXfeature(); - if ((bv & 6) == 6) { - if (data[2] & (1U << 28)) type_ |= tAVX; - if (data[2] & (1U << 12)) type_ |= tFMA; - } - } - if (maxNum >= 7) { - getCpuidEx(7, 0, data); - if (type_ & tAVX && data[1] & 0x20) type_ |= tAVX2; - if (data[1] & (1U << 3)) type_ |= tBMI1; - if (data[1] & (1U << 8)) type_ |= tBMI2; - if (data[1] & (1U << 9)) type_ |= tENHANCED_REP; - if (data[1] & (1U << 18)) type_ |= tRDSEED; - if (data[1] & (1U << 19)) type_ |= tADX; - if (data[1] & (1U << 20)) type_ |= tSMAP; - if (data[1] & (1U << 4)) type_ |= tHLE; - if (data[1] & (1U << 11)) type_ |= tRTM; - } - setFamily(); - } - void putFamily() - { - printf("family=%d, model=%X, stepping=%d, extFamily=%d, extModel=%X\n", - family, model, stepping, extFamily, extModel); - printf("display:family=%X, model=%X\n", displayFamily, displayModel); - } - bool has(Type type) const - { - return (type & type_) != 0; - } -}; - -class Clock { -public: - static inline uint64 getRdtsc() - { -#ifdef _MSC_VER - return __rdtsc(); -#else - unsigned int eax, edx; - __asm__ volatile("rdtsc" : "=a"(eax), "=d"(edx)); - return ((uint64)edx << 32) | eax; -#endif - } - Clock() - : clock_(0) - , count_(0) - { - } - void begin() - { - clock_ -= getRdtsc(); - } - void end() - { - clock_ += getRdtsc(); - count_++; - } - int getCount() const { return count_; } - uint64 getClock() const { return clock_; } - void clear() { count_ = 0; clock_ = 0; } -private: - uint64 clock_; - int count_; -}; - -#ifdef XBYAK64 -const int UseRCX = 1 << 6; -const int UseRDX = 1 << 7; - -class Pack { - static const size_t maxTblNum = 10; - const Xbyak::Reg64 *tbl_[maxTblNum]; - size_t n_; -public: - Pack() : n_(0) {} - Pack(const Xbyak::Reg64 *tbl, size_t n) { init(tbl, n); } - Pack(const Pack& rhs) - : n_(rhs.n_) - { - if (n_ > maxTblNum) throw Error(ERR_INTERNAL); - for (size_t i = 0; i < n_; i++) tbl_[i] = rhs.tbl_[i]; - } - Pack(const Xbyak::Reg64& t0) - { n_ = 1; tbl_[0] = &t0; } - Pack(const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 2; tbl_[0] = &t0; tbl_[1] = &t1; } - Pack(const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 3; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; } - Pack(const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 4; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; } - Pack(const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 5; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; } - Pack(const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 6; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; } - Pack(const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 7; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; } - Pack(const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 8; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; } - Pack(const Xbyak::Reg64& t8, const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 9; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; tbl_[8] = &t8; } - Pack(const Xbyak::Reg64& t9, const Xbyak::Reg64& t8, const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 10; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; tbl_[8] = &t8; tbl_[9] = &t9; } - Pack& append(const Xbyak::Reg64& t) - { - if (n_ == 10) { - fprintf(stderr, "ERR Pack::can't append\n"); - throw Error(ERR_BAD_PARAMETER); - } - tbl_[n_++] = &t; - return *this; - } - void init(const Xbyak::Reg64 *tbl, size_t n) - { - if (n > maxTblNum) { - fprintf(stderr, "ERR Pack::init bad n=%d\n", (int)n); - throw Error(ERR_BAD_PARAMETER); - } - n_ = n; - for (size_t i = 0; i < n; i++) { - tbl_[i] = &tbl[i]; - } - } - const Xbyak::Reg64& operator[](size_t n) const - { - if (n >= n_) { - fprintf(stderr, "ERR Pack bad n=%d\n", (int)n); - throw Error(ERR_BAD_PARAMETER); - } - return *tbl_[n]; - } - size_t size() const { return n_; } - /* - get tbl[pos, pos + num) - */ - Pack sub(size_t pos, size_t num = size_t(-1)) const - { - if (num == size_t(-1)) num = n_ - pos; - if (pos + num > n_) { - fprintf(stderr, "ERR Pack::sub bad pos=%d, num=%d\n", (int)pos, (int)num); - throw Error(ERR_BAD_PARAMETER); - } - Pack pack; - pack.n_ = num; - for (size_t i = 0; i < num; i++) { - pack.tbl_[i] = tbl_[pos + i]; - } - return pack; - } - void put() const - { - for (size_t i = 0; i < n_; i++) { - printf("%s ", tbl_[i]->toString()); - } - printf("\n"); - } -}; - -class StackFrame { -#ifdef XBYAK64_WIN - static const int noSaveNum = 6; - static const int rcxPos = 0; - static const int rdxPos = 1; -#else - static const int noSaveNum = 8; - static const int rcxPos = 3; - static const int rdxPos = 2; -#endif - Xbyak::CodeGenerator *code_; - int pNum_; - int tNum_; - bool useRcx_; - bool useRdx_; - int saveNum_; - int P_; - bool makeEpilog_; - Xbyak::Reg64 pTbl_[4]; - Xbyak::Reg64 tTbl_[10]; - Pack p_; - Pack t_; - StackFrame(const StackFrame&); - void operator=(const StackFrame&); -public: - const Pack& p; - const Pack& t; - /* - make stack frame - @param sf [in] this - @param pNum [in] num of function parameter(0 <= pNum <= 4) - @param tNum [in] num of temporary register(0 <= tNum <= 10, with UseRCX, UseRDX) - @param stackSizeByte [in] local stack size - @param makeEpilog [in] automatically call close() if true - - you can use - rax - gp0, ..., gp(pNum - 1) - gt0, ..., gt(tNum-1) - rcx if tNum & UseRCX - rdx if tNum & UseRDX - rsp[0..stackSizeByte - 1] - */ - StackFrame(Xbyak::CodeGenerator *code, int pNum, int tNum = 0, int stackSizeByte = 0, bool makeEpilog = true) - : code_(code) - , pNum_(pNum) - , tNum_(tNum & ~(UseRCX | UseRDX)) - , useRcx_((tNum & UseRCX) != 0) - , useRdx_((tNum & UseRDX) != 0) - , saveNum_(0) - , P_(0) - , makeEpilog_(makeEpilog) - , p(p_) - , t(t_) - { - using namespace Xbyak; - if (pNum < 0 || pNum > 4) throw Error(ERR_BAD_PNUM); - const int allRegNum = pNum + tNum_ + (useRcx_ ? 1 : 0) + (useRdx_ ? 1 : 0); - if (allRegNum < pNum || allRegNum > 14) throw Error(ERR_BAD_TNUM); - const Reg64& _rsp = code->rsp; - const AddressFrame& _ptr = code->ptr; - saveNum_ = (std::max)(0, allRegNum - noSaveNum); - const int *tbl = getOrderTbl() + noSaveNum; - P_ = saveNum_ + (stackSizeByte + 7) / 8; - if (P_ > 0 && (P_ & 1) == 0) P_++; // here (rsp % 16) == 8, then increment P_ for 16 byte alignment - P_ *= 8; - if (P_ > 0) code->sub(_rsp, P_); -#ifdef XBYAK64_WIN - for (int i = 0; i < (std::min)(saveNum_, 4); i++) { - code->mov(_ptr [_rsp + P_ + (i + 1) * 8], Reg64(tbl[i])); - } - for (int i = 4; i < saveNum_; i++) { - code->mov(_ptr [_rsp + P_ - 8 * (saveNum_ - i)], Reg64(tbl[i])); - } -#else - for (int i = 0; i < saveNum_; i++) { - code->mov(_ptr [_rsp + P_ - 8 * (saveNum_ - i)], Reg64(tbl[i])); - } -#endif - int pos = 0; - for (int i = 0; i < pNum; i++) { - pTbl_[i] = Xbyak::Reg64(getRegIdx(pos)); - } - for (int i = 0; i < tNum_; i++) { - tTbl_[i] = Xbyak::Reg64(getRegIdx(pos)); - } - if (useRcx_ && rcxPos < pNum) code_->mov(code_->r10, code_->rcx); - if (useRdx_ && rdxPos < pNum) code_->mov(code_->r11, code_->rdx); - p_.init(pTbl_, pNum); - t_.init(tTbl_, tNum_); - } - /* - make epilog manually - @param callRet [in] call ret() if true - */ - void close(bool callRet = true) - { - using namespace Xbyak; - const Reg64& _rsp = code_->rsp; - const AddressFrame& _ptr = code_->ptr; - const int *tbl = getOrderTbl() + noSaveNum; -#ifdef XBYAK64_WIN - for (int i = 0; i < (std::min)(saveNum_, 4); i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ + (i + 1) * 8]); - } - for (int i = 4; i < saveNum_; i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ - 8 * (saveNum_ - i)]); - } -#else - for (int i = 0; i < saveNum_; i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ - 8 * (saveNum_ - i)]); - } -#endif - if (P_ > 0) code_->add(_rsp, P_); - - if (callRet) code_->ret(); - } - ~StackFrame() - { - if (!makeEpilog_) return; - try { - close(); - } catch (std::exception& e) { - printf("ERR:StackFrame %s\n", e.what()); - exit(1); - } catch (...) { - printf("ERR:StackFrame otherwise\n"); - exit(1); - } - } -private: - const int *getOrderTbl() const - { - using namespace Xbyak; - static const int tbl[] = { -#ifdef XBYAK64_WIN - Operand::RCX, Operand::RDX, Operand::R8, Operand::R9, Operand::R10, Operand::R11, Operand::RDI, Operand::RSI, -#else - Operand::RDI, Operand::RSI, Operand::RDX, Operand::RCX, Operand::R8, Operand::R9, Operand::R10, Operand::R11, -#endif - Operand::RBX, Operand::RBP, Operand::R12, Operand::R13, Operand::R14, Operand::R15 - }; - return &tbl[0]; - } - int getRegIdx(int& pos) const - { - assert(pos < 14); - using namespace Xbyak; - const int *tbl = getOrderTbl(); - int r = tbl[pos++]; - if (useRcx_) { - if (r == Operand::RCX) { return Operand::R10; } - if (r == Operand::R10) { r = tbl[pos++]; } - } - if (useRdx_) { - if (r == Operand::RDX) { return Operand::R11; } - if (r == Operand::R11) { return tbl[pos++]; } - } - return r; - } -}; -#endif - -} } // end of util -#endif diff --git a/source/scripts/_00e_func_checkdependencies.psc b/source/scripts/_00e_func_checkdependencies.psc index 9c902ef5..8485244b 100644 --- a/source/scripts/_00e_func_checkdependencies.psc +++ b/source/scripts/_00e_func_checkdependencies.psc @@ -3,7 +3,7 @@ Scriptname _00E_Func_CheckDependencies Hidden Function CheckDependencies() global ; If Enderal - Forgotten Stories.esm is not loaded, kick the player back to main menu - if (Game.GetFormFromFile(0x0004320E, "Skyrim.esm") as GlobalVariable).GetValueInt() != 1 + if (Game.GetForm(0x4320E) as GlobalVariable).GetValue() as Int != 1 Utility.wait(2.0) Game.QuitToMainMenu() Debug.MessageBox("Enderal - Forgotten Stories.esm is not loaded! The game will not run properly. Open Data Files and enable it.") @@ -25,7 +25,7 @@ Function CheckDependencies() global Return endif - Quest bSkyUI = Game.GetFormFromFile(0x00000802, "SkyUI_SE.esp") as Quest + Quest bSkyUI = Game.GetFormFromFile(0x802, "SkyUI_SE.esp") as Quest If bSkyUI == None Utility.wait(2.0) @@ -34,10 +34,10 @@ Function CheckDependencies() global Return EndIf - if SKSE.GetPluginVersion("fs_skse_functions") == -1 + if SKSE.GetPluginVersion("EnderalSE") == -1 Utility.wait(2.0) Game.QuitToMainMenu() - Debug.MessageBox("fs.dll is not loaded! The game will not run properly. Verify integrity of your files.\n\nThis may also happen, if your version of SKSE or Enderal is too old. In this case, it is advised to upgrade.") + Debug.MessageBox("EnderalSE.dll is not loaded! The game will not run properly. Verify integrity of your files.\n\nThis may also happen, if your version of SKSE or Enderal is too old. In this case, it is advised to upgrade.") Return endif diff --git a/source/scripts/_00e_mqp01_functions.psc b/source/scripts/_00e_mqp01_functions.psc index 7dc73e15..6c7fc0ab 100644 --- a/source/scripts/_00e_mqp01_functions.psc +++ b/source/scripts/_00e_mqp01_functions.psc @@ -21,7 +21,7 @@ Function SetUpScene() Wait(5.0) Game.EnablePlayerControls() - if EnderalLib.NewGameCount() > 1 + if EnderalFunctions.GetNewGameCount() > 1 Game.QuitToMainMenu() Debug.MessageBox("Due to an engine bug, new game should not be started after quitting to the main menu. Please, restart Enderal first.") return diff --git a/source/scripts/_00e_phasmalist_apparationinventory.psc b/source/scripts/_00e_phasmalist_apparationinventory.psc index da19633e..a2fe1ad4 100644 --- a/source/scripts/_00e_phasmalist_apparationinventory.psc +++ b/source/scripts/_00e_phasmalist_apparationinventory.psc @@ -4,8 +4,6 @@ Scriptname _00E_Phasmalist_ApparationInventory extends ReferenceAlias ; script that manages the spectralizing process. It is attached to the alias that contains the spectralizing container. ; this alias is filled and the functions of this script are called mainly from _00E_Phasmalist_Workbench. -import EnderalLib - Message Property spectralizingCost auto Message Property cannotSpectralize auto Message Property updateCostCannotPay auto @@ -76,7 +74,7 @@ Function AddItemsToPlayer() EndFunction Float Function CalculateInventoryStrength() - Return EnderalLib.calculateContentStrength(Self.GetRef()) + Return EnderalFunctions.CalculateContentStrength(Self.GetRef()) EndFunction Function UpdateCost() diff --git a/source/scripts/_00e_theriantrophist_alchemycontrol.psc b/source/scripts/_00e_theriantrophist_alchemycontrol.psc index ef052b29..aa2a0535 100644 --- a/source/scripts/_00e_theriantrophist_alchemycontrol.psc +++ b/source/scripts/_00e_theriantrophist_alchemycontrol.psc @@ -120,7 +120,7 @@ Function _UpdatePotion(Potion item, Int count) Bool bIsTheriantrophistPotion = item.HasKeyword(_00E_Theriantrophist_Effect) MagicEffect firstTheriantrophistEffect = None - If bIsTheriantrophistPotion && EnderalLib.IsDLLLoaded() ; FRESHLY BREWN THERIANTROPHIST POTION + If bIsTheriantrophistPotion && EnderalFunctions.IsDLLLoaded() ; FRESHLY BREWN THERIANTROPHIST POTION PlayerREF.removeItem(item, count, abSilent = true) @@ -194,7 +194,7 @@ Function _UpdatePotion(Potion item, Int count) EndIf EndIf - Potion newPotion = EnderalLib.CreatePotion(newEffects, newMagnitudes, newAreas, newDurations, nNewEffects) + Potion newPotion = EnderalFunctions.CreatePotion(newEffects, newMagnitudes, newAreas, newDurations, nNewEffects) If bHasJContainers && JFormMap.hasKey(RenamedPotions, newPotion) == False _RenamePotion(newPotion, newEffects, nNewEffects, bRemoveTheriantrophistEffects) @@ -376,7 +376,7 @@ Function _InitAchemyControl() bHasJContainers = ( (SKSE.GetPluginVersion("JContainers64") != -1) || (SKSE.GetPluginVersion("JContainersVR") != -1) ) && JContainers.isInstalled() - if ! bHasJContainers && ! EnderalLib.IsDLLLoaded() + if ! bHasJContainers && ! EnderalFunctions.IsDLLLoaded() ; Both required components are missing, do not update version and disable everything UnregisterForAllMenus() Debug.Trace("JContainers and fs.dll are not loaded, _00E_Theriantrophist_AlchemyControl is disabled.") diff --git a/source/scripts/_00e_theriantrophist_chymikum.psc b/source/scripts/_00e_theriantrophist_chymikum.psc index 5ed57145..fded1e08 100644 --- a/source/scripts/_00e_theriantrophist_chymikum.psc +++ b/source/scripts/_00e_theriantrophist_chymikum.psc @@ -4,8 +4,6 @@ Scriptname _00E_Theriantrophist_Chymikum extends _00E_Theriantrophist_WerewolfPo ; and OnChymikumEffectEnd, optionally they can also override OnPlayerLoadGame and OnCombatHit ; if this functionality is required -import EnderalLib - _00E_Theriantrophist_PlayerAsWerewolf Property playerWhileTransformedAlias Auto Message Property _00E_Theriantrophist_CannotDrinkPotion Auto Message Property _00E_Theriantrophist_TooManyChyimkums Auto @@ -87,7 +85,7 @@ Function OnChymikumEffectStart(Actor target) areas[0] = 0 int[] durations = new int[1] durations[0] = 100 - Potion pot = EnderalLib.createPotion(effects, magnitudes, areas, durations, 1) + Potion pot = EnderalFunctions.CreatePotion(effects, magnitudes, areas, durations, 1) Game.getPlayer().addItem(pot) If !FS_NQ11.IsObjectiveCompleted(25) diff --git a/source/scripts/_00e_theriantrophist_transformsc.psc b/source/scripts/_00e_theriantrophist_transformsc.psc index 203686ba..8f3f9139 100644 --- a/source/scripts/_00e_theriantrophist_transformsc.psc +++ b/source/scripts/_00e_theriantrophist_transformsc.psc @@ -29,7 +29,7 @@ Event OnEffectStart(Actor akTarget, Actor akCaster) if _00E_FS_Theriantrophist_AllowTemporaryTransform.GetValueInt() == 0 if !playerWhileTransformedAlias.CanBeTransformed(akTarget.getCurrentLocation()) - if EnderalLib.IsDLLLoaded() + if EnderalFunctions.IsDLLLoaded() Debug.Notification(_00E_Theriantrophist_ForceTransformBackMessage.getName()) _RestorePotion() else diff --git a/source/scripts/_00e_theriantrophist_werewolfpotion.psc b/source/scripts/_00e_theriantrophist_werewolfpotion.psc index 8c74e774..ece09d5f 100644 --- a/source/scripts/_00e_theriantrophist_werewolfpotion.psc +++ b/source/scripts/_00e_theriantrophist_werewolfpotion.psc @@ -1,7 +1,5 @@ Scriptname _00E_Theriantrophist_WerewolfPotion extends activemagiceffect -import EnderalLib - Float Property AdditionalArcaneFever = 6 Autoreadonly Hidden Float Property ArcaneFeverReductionPerk01 = 0.17 Autoreadonly Hidden Float Property ArcaneFeverReductionPerk02 = 0.16 Autoreadonly Hidden @@ -48,6 +46,6 @@ Function _RestorePotion() durations[0] = self.getDuration() as Int areas[0] = 0 - Potion toRestore = EnderalLib.CreatePotion(effects, magnitudes, areas, durations, 1) + Potion toRestore = EnderalFunctions.CreatePotion(effects, magnitudes, areas, durations, 1) PlayerREF.addItem(toRestore, abSilent = true) EndFunction diff --git a/source/scripts/enderalfunctions.psc b/source/scripts/enderalfunctions.psc new file mode 100644 index 00000000..ea4b8c8b --- /dev/null +++ b/source/scripts/enderalfunctions.psc @@ -0,0 +1,13 @@ +Scriptname EnderalFunctions Hidden + +float function CalculateContentStrength(ObjectReference container) native global + +Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global + +ObjectReference function GetCurrentContainer() native global + +int function GetNewGameCount() native global + +bool function IsDLLLoaded() global + return (SKSE.GetPluginVersion("EnderalSE") != -1) +endfunction diff --git a/source/scripts/enderallib.psc b/source/scripts/enderallib.psc deleted file mode 100644 index 5feba6de..00000000 --- a/source/scripts/enderallib.psc +++ /dev/null @@ -1,11 +0,0 @@ -Scriptname EnderalLib Hidden - -float function calculateContentStrength(ObjectReference container) native global - -Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global - -int function NewGameCount() native global - -bool function IsDLLLoaded() global - return (SKSE.GetPluginVersion("fs_skse_functions") != -1) -endfunction