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

Enhancement: Clean up the Stdafx.h usage #989

Merged

Conversation

BenjamenMeyer
Copy link
Member

Do not use a precompiled header.

NOTE: This is the first step for a refactor of the headers. The next step would be to reduce what headers are used in any given implementation or header file.

Thank you for submitting a pull request and becoming a contributor to the Vega Strike Core Engine.

Please answer the following:

Code Changes:

Issues:

Purpose:

  • What is this pull request trying to do? Remove Stdafx.h and get rid of precompiled headers entirely
  • What release is this for? 0.10.x
  • Is there a project or milestone we should apply this to? 0.10.x

Do not use a precompiled header.

NOTE: This is the first step for a refactor of the headers. The
next step would be to reduce what headers are used in any given
implementation or header file.
@BenjamenMeyer BenjamenMeyer added this to the 0.10.x milestone Jan 14, 2025
@BenjamenMeyer BenjamenMeyer self-assigned this Jan 14, 2025
@BenjamenMeyer
Copy link
Member Author

still trying to figure out the vegasettings crash issue; but this compiles and behaves the same. It's all header changes and just simplifying things. Some testing still needed.

#include "CSopcodecollider.h"
#include "opcodeqsqrt.h"
#include "opcodeqint.h"
#include "vs_vector.h"
Copy link
Contributor

@stephengtuggy stephengtuggy Jan 14, 2025

Choose a reason for hiding this comment

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

I actually just got rid of vs_vector a few days ago in one of my PRs. vs_vector was a mistake from the beginning. It inherits from std::vector, which is not intended to be inherited from. (std::vector doesn't have a virtual destructor.)

vs_vector was only ever used in one place (in this file). It can be replaced with std::vector again, I think. Then if we want to enforce bounds checking (which we probably should) we can change all occurrences of operator[] to .at().

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is #987, which is waiting on #974.

@BenjamenMeyer
Copy link
Member Author

Looks like the expected builds failed.

Copy link
Contributor

@royfalk royfalk left a comment

Choose a reason for hiding this comment

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

I don't have anything to contribute here. It seems pretty straightforward.
I can try and squeeze a quick playthrough to test things, early next week.

Copy link
Contributor

@stephengtuggy stephengtuggy left a comment

Choose a reason for hiding this comment

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

LGTM

@stephengtuggy stephengtuggy merged commit b865591 into vegastrike:master Jan 20, 2025
16 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.

Do away with Stdafx.h?
3 participants