Skip to content

Clean-room reverse engineered SDK headers, part 1 #2194

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

freed00m21
Copy link

Partially resolves #63

int frameCount;
struct model_s *pFollowModel;
struct particle_s *particles;
FBEAM_STARTENTITY = 1 << 0,
Copy link
Member

Choose a reason for hiding this comment

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

@SNMetamorph
Copy link
Member

Nice work! Though, it's very helpful in terms of licensing issues

@a1batross
Copy link
Member

I'm not sure that clean room means generate data types from DWARF. But it's better than nothing.

I would add static assertions on struct sizes though, at least for ILP32 model (aka 32-bit). It does not guarantee compatibility, but again better than nothing.


typedef struct dlight_s dlight_t;

struct dlight_s {
Copy link
Member

Choose a reason for hiding this comment

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

As far as I remember, compatible dlight struct can be taken from Quake.

@freed00m21
Copy link
Author

I made changes, is anything else required?

@a1batross
Copy link
Member

a1batross commented Jun 24, 2025

As it builds now, I should check it that nothing potentially got broken, and then merge it. Thanks.

@a1batross
Copy link
Member

After all, I'm quite suspicious if clean-room definition applies to the generated code from DWARF debugging information.

Not only that, it's also weird that preprocessor variables only got refactored into the enumeration, retaining same names. Preprocessing is only the first stage of compiling C code and while some of it information gets preserved in debugging info, like included files, the defines unfortunately do not and I don't know any other sources of information where they could be taken from.

@SNMetamorph
Copy link
Member

@freed00m21 i need to clarify some things, so I have some questions for you:

  1. Have you even been familiar with Xash3D or HLSDK source code before doing this pull request?
  2. In your code we found things that couldn't be obtained directly from binaries, as some bit flags, like FBEAM_*.
    Where did you get these data? It's ok as long as it's obtained from some another clean-room reverse-engineering project, so we need to know exact source of that data to be completely sure.

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.

License issues
4 participants