Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dxvk-glm changes #2

Open
wants to merge 55 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e391f6d
lsl: move lslVariantm, lslMath and r3dMath to new MathLib
q4a Jun 13, 2021
ec50208
add clang-format
q4a Jun 14, 2021
f0d7814
cmake: fill 3 vars CMAKE_RUNTIME_OUTPUT_DIRECTORY*
q4a Oct 21, 2022
f503324
Add dxvk as ExternalProject. Replace d3d/d3dx9math.h with d3dx9math.cpp
q4a Jun 3, 2022
aa54ee9
gitignore: add cmake-build-*
q4a Oct 21, 2022
7bac510
clang-format: UseTab ForIndentation
q4a Oct 22, 2022
3685f89
linux: move platform files to XPlatform and
q4a Oct 22, 2022
1c7d22a
linux: fix build lslSerializable.cpp, add sprintf_s, replace auto_ptr
q4a Oct 22, 2022
2958ca6
linux: fix build all files from LexStd
q4a Oct 23, 2022
6bff74a
ci: save builded artifact
q4a Jun 15, 2021
3640acc
math: replace D3DXVECTOR2 with glm::vec2 in LexStd, MathLib and Rock3…
q4a Jun 14, 2021
0b870c8
ci: fix build with cmake+glm
q4a Jun 14, 2021
5f58ca6
math: replace D3DXVECTOR2 with glm::vec2 in Rock3dEngine part2 and Ne…
q4a Jun 14, 2021
3ada20c
math: auto replace D3DXVECTOR2 with glm::vec2 in Rock3dGame
q4a Jun 14, 2021
ea52f74
math: fix build Rock3dGame with glm::vec2
q4a Jun 15, 2021
32cd32f
math: restore all projects builds, D3DXVECTOR2 replaced with glm::vec…
q4a Jun 15, 2021
6987217
math: replace D3DXQUATERNION with glm::quat in LexStd and MathLib
q4a Jun 20, 2021
d2c0b05
clang-format: UseTab AlignWithSpaces
q4a Jun 20, 2021
c5b5ce8
math: replace D3DXQUATERNION with glm::quat in NetLib
q4a Jun 20, 2021
008da75
math: auto replace D3DXQUATERNION with glm::quat in Rock3dEngine
q4a Jun 20, 2021
958b146
math: fix Matrix4GlmToDx, fix incorrect spaces and tabs
q4a Jun 20, 2021
b447ca6
math: fix build Rock3dEngine with glm::quat
q4a Jun 20, 2021
a4f52ee
math: auto replace D3DXQUATERNION with glm::quat in Rock3dGame
q4a Jun 20, 2021
0e09b65
math: fix build Rock3dGame with glm::quat
q4a Jun 21, 2021
30fb2b5
math: restore all projects builds, D3DXQUATERNION replaced with glm::…
q4a Jun 21, 2021
859b7a5
math: fix multiplication order
q4a Jun 22, 2021
2f27927
math: fix items rotation in main menu
q4a Jun 26, 2021
9745c15
math: fix car rotation, replace glm::mix with glm::slerp
q4a Jun 26, 2021
9304d9d
trim spaces in the end of source code files
q4a Jun 26, 2021
9accaf4
replace spaces with tabs
q4a Jun 26, 2021
4777f62
remove duplicate empty lines
q4a Jun 26, 2021
2f830e6
use DXVK_NATIVE_INCLUDE_DIRS in Linux and clean d3dx9math.h
q4a Oct 24, 2022
2b4e160
math: auto replace D3DXVECTOR3 with glm::vec3 in src/*.h,*.cpp,*.inl
q4a Oct 26, 2022
98d3880
math: fix build after replace D3DXVECTOR3 with glm::vec3
q4a Oct 28, 2022
b26d479
math: replace reinterpret_cast with glm::value_ptr
q4a Oct 28, 2022
c4b2f06
math: simplify code after replace D3DXVECTOR3 with glm::vec3
q4a Oct 28, 2022
6c86783
math: auto replace D3DXVECTOR4 with glm::vec4 in src/*.h,*.cpp
q4a Oct 28, 2022
4fe2a64
math: fix build after replace D3DXVECTOR4 with glm::vec4
q4a Oct 28, 2022
56379af
math: auto replace D3DXCOLOR with glm::vec4 in src/*.h,*.cpp,*.inl
q4a Oct 29, 2022
e0f64d5
math: fix build after replace D3DXCOLOR, but has black 3d scene
q4a Oct 30, 2022
ae19eab
math: fix black 3d scene after replace D3DXCOLOR with glm::vec4
q4a Oct 30, 2022
ab76f8a
math: auto replace D3DXPLANE with glm::vec4 in src/*.h,*.cpp,*.inl
q4a Oct 30, 2022
1b34cfa
math: fix build after replace D3DXPLANE with glm::vec4
q4a Oct 31, 2022
f3411f7
math: replace D3DX_PI with glm::pi, glm::half_pi and so on
q4a Oct 31, 2022
de1d36b
math: unification of output variable names in lslMath.inl
q4a Nov 1, 2022
5847702
math: replace all D3DXPLANE and D3DX* (except D3DXMATRIX) ftom .inl
q4a Nov 1, 2022
951e302
math: replace D3DX* functs part 1, remove d3dx9math.cpp
q4a Nov 1, 2022
0a3502d
math: auto replace D3DXMATRIX with D3DMATRIX in src/*.h,*.cpp,*.inl
q4a Nov 1, 2022
fa966f2
math: replace D3DX* functs part 2, fix build after replace D3DXMATRIX
q4a Nov 1, 2022
2476606
math: replace abs with std::abs (fixes warnings in Linux)
q4a Nov 1, 2022
54859d6
linux: fix include INetPlayer.h and MAXUINT define
q4a Nov 1, 2022
8085564
linux: fix path separators in include files
q4a Nov 1, 2022
3b42abc
linux: add FIX_LINUX Sleep, IP_ADAPTER_ADDRESSES, ID3DXMesh, ID3DXFont
q4a Nov 2, 2022
c15e42b
linux: add FIX_LINUX D3DXHANDLE, ID3DXInclude, ID3DXEffect
q4a Nov 2, 2022
bfbde0d
physics: comment out class FxPhysicsEmitter
q4a Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
BasedOnStyle: Microsoft

# To apply code style please run:
# find ./src -iname *.h -o -iname *.cpp | xargs clang-format -i

# To dump Microsoft style options run:
# clang-format -style=microsoft -dump-config > .clang-format
# ---
# Language: Cpp
# AccessModifierOffset: -2
# AlignAfterOpenBracket: Align
# AlignConsecutiveMacros: false
# AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlines: Right
# AlignOperands: true
# AlignTrailingComments: true
# AllowAllArgumentsOnNextLine: true
# AllowAllConstructorInitializersOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: None
# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: MultiLine
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
# AfterCaseLabel: false
# AfterClass: true
# AfterControlStatement: true
# AfterEnum: true
# AfterFunction: true
# AfterNamespace: true
# AfterObjCDeclaration: true
# AfterStruct: true
# AfterUnion: false
# AfterExternBlock: true
# BeforeCatch: true
# BeforeElse: true
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
# BreakBeforeBraces: Custom
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
# BreakConstructorInitializers: BeforeColon
# BreakAfterJavaFieldAnnotations: false
# BreakStringLiterals: true
# ColumnLimit: 120
# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DeriveLineEnding: true
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IncludeBlocks: Preserve
# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# SortPriority: 0
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
# Priority: 3
# SortPriority: 0
# - Regex: '.*'
# Priority: 1
# SortPriority: 0
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentCaseLabels: false
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentWidth: 4
# IndentWrappedFunctionNames: false
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# ObjCBinPackProtocolList: Auto
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 1000
# PointerAlignment: Right
# ReflowComments: true
# SortIncludes: true
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# Standard: Latest
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
# TabWidth: 4
# UseCRLF: false
UseTab: AlignWithSpaces
# ...

7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Windows libs
shell: cmd
run: |
curl -LJO https://github.com/q4a/rrr3d/releases/download/1.3.1-dev2/extern.7z
curl -LJO https://github.com/q4a/rrr3d/releases/download/1.3.1-dev3/extern.7z
7z x extern.7z
dir
- uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -30,3 +30,8 @@ jobs:
useVcpkgToolchainFile: false
buildDirectory: '${{ github.workspace }}/build'
configurationRegexFilter: '${{ matrix.configuration }}'
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: rrr3d.${{ matrix.configuration }}
path: bin
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build*
cmake-build-*
bin
extern
.vs
Expand Down
38 changes: 37 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
cmake_policy(VERSION 3.12)

set(RRR3D_VERSION "1.3.1")
project(rrr3d VERSION ${RRR3D_VERSION} LANGUAGES CXX)

include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake)

### Set up output paths
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug)

if (MSVC)
# DirectX SDK libs
include_directories("${CMAKE_SOURCE_DIR}/extern/directx/include")
else()
# Non Windows target specifics

include(ExternalProject)

# DXVK-native wrapper lib retrieval and building
ExternalProject_Add(dxvk-native
GIT_REPOSITORY https://github.com/Joshua-Ashton/dxvk-native
GIT_TAG origin/master
GIT_SHALLOW ON
BUILD_ALWAYS OFF
CONFIGURE_COMMAND meson ../dxvk-native
BUILD_COMMAND ninja
INSTALL_COMMAND ""
)
ExternalProject_Get_property(dxvk-native SOURCE_DIR BINARY_DIR)
set(DXVK_NATIVE_INCLUDE_DIRS
"${SOURCE_DIR}/include/native/directx"
"${SOURCE_DIR}/include/native/windows"
)
set(DXVK_NATIVE_D3D9_LIB ${BINARY_DIR}/src/d3d9/libdxvk_d3d9.so)
include_directories(
"${CMAKE_SOURCE_DIR}/src/Platform"
"${DXVK_NATIVE_INCLUDE_DIRS}"
)
ADD_CUSTOM_TARGET(dependencies ALL DEPENDS dxvk-native)
endif()

add_subdirectory(src)
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ if (MSVC)
add_compile_options(/W3) # Warning level

add_compile_options("$<$<CONFIG:Release>:/Gy>") # Enable Function-Level Linking
else()
add_compile_options(-fPIC)
endif()

add_subdirectory(LexStd)
add_subdirectory(MathLib)
add_subdirectory(NetLib)
add_subdirectory(Rock3dEngine)
add_subdirectory(Rock3dGame)
Expand Down
3 changes: 1 addition & 2 deletions src/LexStd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_definitions(-DNOMINMAX) # Use std::max()/std::min()

list(APPEND PROJECT_DIRS
"header"
"header/d3d"
"source"
)
add_dir("${PROJECT_DIRS}" "${PROJECT_NAME}")
Expand All @@ -17,8 +16,8 @@ add_library(${PROJECT_NAME} STATIC

target_include_directories(${PROJECT_NAME} PRIVATE
header
${CMAKE_SOURCE_DIR}/src/XPlatform/header
${CMAKE_SOURCE_DIR}/extern/tinyxml/include
${CMAKE_SOURCE_DIR}/extern/directx/include
)

target_link_libraries(${PROJECT_NAME})
10 changes: 5 additions & 5 deletions src/LexStd/header/EulerAngles.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**** EulerAngles.h - Support for 24 angle schemes ****/
/* Ken Shoemake, 1993 */
#ifndef _H_EulerAngles
#define _H_EulerAngles
#define _H_EulerAngles

/**** QuatTypes.h - Basic type declarations ****/
#ifndef _H_QuatTypes
Expand All @@ -11,7 +11,7 @@ typedef struct {float x, y, z, w;} Quat; /* Quaternion */
enum QuatPart {X, Y, Z, W};
typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
typedef Quat EulerAngles; /* (x,y,z)=ang 1,2,3, w=order code */
#endif
#endif

/*** Order type constants, constructors, extractors ***/
/* There are 24 possible conventions, designated by: */
Expand All @@ -26,8 +26,8 @@ typedef Quat EulerAngles; /* (x,y,z)=ang 1,2,3, w=order code */
/* {a,b,c,ord} means Rz(c)Ry(b)Rx(a), where Rz(c)v */
/* rotates v around Z by c radians. */
#define EulFrmS 0
#define EulFrmR 1
#define EulFrm(ord) ((unsigned)(ord)&1)
#define EulFrmR 1
#define EulFrm(ord) ((unsigned)(ord)&1)
#define EulRepNo 0
#define EulRepYes 1
#define EulRep(ord) (((unsigned)(ord)>>1)&1)
Expand Down Expand Up @@ -77,4 +77,4 @@ Quat Eul_ToQuat(EulerAngles ea);
void Eul_ToHMatrix(EulerAngles ea, HMatrix M);
EulerAngles Eul_FromHMatrix(HMatrix M, int order);
EulerAngles Eul_FromQuat(Quat q, int order);
#endif
#endif
Loading