Skip to content

align/merge vector and vector_array types#674

Merged
Lgt2x merged 1 commit intoDescentDevelopers:mainfrom
jopadan:main
Mar 6, 2025
Merged

align/merge vector and vector_array types#674
Lgt2x merged 1 commit intoDescentDevelopers:mainfrom
jopadan:main

Conversation

@jopadan
Copy link

@jopadan jopadan commented Feb 27, 2025

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes
    • Math changes

Description

The game Freespace 2 uses a more advanced Volition vecmat library than Descent 3.

  • introduce default scalar and aligned_vector type.
  • merge vector_array types with vector types using union.
  • add neutral/identity to vector/matrix types.

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

Copy link
Member

@Lgt2x Lgt2x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thanks for opening this PR. However I feel like some context is missing: could you please be more explicit about 1) the purpose of this change 2) the exact problem you are trying to solve. Did you find memory alignment issues in existing code?

@Lgt2x
Copy link
Member

Lgt2x commented Feb 28, 2025

The macos CI found new warnings caused by these changes : https://github.com/DescentDevelopers/Descent3/actions/runs/13578120176/job/38006605278?pr=674#step:14:179

Mac and Windows also have build failures:

Error: /Users/runner/work/Descent3/Descent3/lib/vecmat_external.h:61:41: error: unknown type name 'ssize_t'; did you mean 'size_t'?
constexpr static inline const angvec id(ssize_t i = -1)
                                        ^~~~~~~
                                        size_t

@jopadan
Copy link
Author

jopadan commented Feb 28, 2025

@Lgt2x: ssize_t and type initializer problems now fixed with:

typedef std::make_signed<size_t>::type ssize_t;
return matrix{(T)1,(T)2,(T)3};

@jopadan jopadan changed the title align/merge vector and vector types align/merge vector and vector_array types Feb 28, 2025
@jopadan jopadan closed this Feb 28, 2025
@jopadan jopadan reopened this Feb 28, 2025
@Lgt2x
Copy link
Member

Lgt2x commented Mar 6, 2025

The last comments from me are nitpicking from me, this is good enough. It plays fine on Linux. Thanks again @jopadan , this vector interface is much better than what we had!

@Lgt2x Lgt2x merged commit 037288e into DescentDevelopers:main Mar 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants