-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
DisplacementInfo Neighbours aren’t mapped yet #75
Comments
Just kidding, everything is padded automatically /* chaos_bsp.c */
typedef struct { float x, y, z; } Vector;
struct DispSubNeighbor_t {
unsigned int neighbor;
unsigned char neighborOrient;
unsigned char span;
unsigned char neighborSpan;
};
struct DispNeighbor_t {
struct DispSubNeighbor_t neighbors[2];
};
struct DispCornerNeighbors_t {
unsigned int neighbors[4];
unsigned char neighborCount;
};
#define ALLOWEDVERTS_SIZE 10
struct ddispinfo_t {
Vector startPosition;
int m_iDispVertStart;
int m_iDispTriStart;
int power;
int minTess;
float smoothingAngle;
int contents;
unsigned int m_iMapFace;
int m_iLightmapAlphaStart;
int m_iLightmapSamplePositionStart;
struct DispNeighbor_t m_EdgeNeighbors[4];
struct DispCornerNeighbors_t m_CornerNeighbors[4];
unsigned int m_AllowedVerts[ALLOWEDVERTS_SIZE];
};
int main(int argc, char *argv[]) {
#define SHOW_SIZE(s) printf("%32s | %lu\n", #s, sizeof(s))
SHOW_SIZE(struct DispSubNeighbor_t);
SHOW_SIZE(struct DispNeighbor_t);
SHOW_SIZE(struct DispCornerNeighbors_t);
SHOW_SIZE(struct ddispinfo_t);
#undef SHOW_SIZE
return 0;
}
So, we only have to add padding members to each child struct & hook up classes |
Though I would like to make sure the LumpClasses use inheritance & add |
|
We need more robust testing on how displacements are parsed, especially neighbours valid enum & |
The We could even mimic the nice code comment diagrams from the Source SDK |
Displacement Neighbour sub-structs aren't mapped yet
They're also nasty to pack / unpack, as they don't match the byte alignment of their parent
Look at #74 & #73 for then arguments in favour of using inheritance to simplify this nightmare
(
valve.source.DisplacementInfo
can do the black magic and the others can copy)Test Maps
valve.orange_box_x360.DisplacementInfo
(Not Implemented)[Test Maps]
orange_box_x360
#60Xbox360/The Orange Box/shack.360.bsp
valve.source.DisplacementInfo
[Test Maps]
source
#63Team Fortress 2/test2.bsp
Team Fortress 2/test_decompile_displacement.bsp
nexon.vindictus.DisplacementInfo
[Test Maps]
vindictus
#40nexon.cso2_2018.DisplacementInfo
[Test Maps]
cso2_2018
#38strata.strata.DisplacementInfo
[Test Maps]
strata
#72Enjoy the pain
The text was updated successfully, but these errors were encountered: