Skip to content

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

Open
freed00m21 wants to merge 4 commits into
FWGS:masterfrom
freed00m21:sdk-headers-1
Open

Clean-room reverse engineered SDK headers, part 1#2194
freed00m21 wants to merge 4 commits into
FWGS:masterfrom
freed00m21:sdk-headers-1

Conversation

@freed00m21

Copy link
Copy Markdown

Partially resolves #63

Comment thread common/beamdef.h
int frameCount;
struct model_s *pFollowModel;
struct particle_s *particles;
FBEAM_STARTENTITY = 1 << 0,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SNMetamorph

Copy link
Copy Markdown
Member

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

@a1batross

Copy link
Copy Markdown
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.

Comment thread common/dlight.h

typedef struct dlight_s dlight_t;

struct dlight_s {

Copy link
Copy Markdown
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
Copy Markdown
Author

I made changes, is anything else required?

@a1batross

a1batross commented Jun 24, 2025

Copy link
Copy Markdown
Member

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

@a1batross

Copy link
Copy Markdown
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
Copy Markdown
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.

@a1batross
a1batross force-pushed the master branch 2 times, most recently from 7a7cf1a to 8e450d8 Compare April 2, 2026 23:09
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