-
Notifications
You must be signed in to change notification settings - Fork 54
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
Serialize pixelmap/material/model/actor structs to file #80
Conversation
src/BRSRC13/CORE/V1DB/v1dbfile.c
Outdated
br_file_struct br_face_F = { "br_face", BR_ASIZE(br_face_FM), br_face_FM, sizeof(br_face) }; | ||
|
||
br_file_struct_member br_old_face_1_FM[5] = { | ||
{ DF_TYPE_BR_UINT_16, offsetof(br_face, vertices) + 0 * sizeof(br_uint_16), "vertices[0]", NULL }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use the offsetof(br_face, vertices[1])
notation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can. I will add a commit.
v1->v[0] = f1; | ||
v1->v[1] = f2; | ||
v1->v[2] = f3; | ||
v1->v[0] = BR_SCALAR(f1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does the wrapping to BR_SCALAR(f1)
come from? Is it necessary? Are you interested in adding support for running brender in fixed
mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wrapping comes from MATH/fixed.h
.
It's not necessary, but I added it here to make it clear that a scalar is expected, not an explicit float/fixed.
I'm not that interested in getting fixed support working.
Getting dethrace working on current machines is a task big enough.
But I'd like to get our brender implementation sufficiently compatible with the brender used by carmageddon.
I would like to use our brender to link to the brender drivers and get good compatibility.
This pr add support for serializing pixelmaps, materials, models and actors:
the functions
BrXXXSave
andBrXXXSaveAll
now have a (working) implementation.To get there, this pr does:
regsupt
methods: it is now possible to enumerate/find/add/remove tables/maps/materials/models from the central registryBrPixelmapDirectLock
andBrPixelmapDirectUnlock
.BRENDER_FIX_BUGS
cmake option to fix brender oversights. The tests will fail when not defining it.brstddiag
functions. The message passed toBrFailure
will be printed to stdout.test_loading_ConvertPixToStripMap
on Linux. There was an issue with casings.\r\n
vs\n
).Result of running github actions on my fork: https://github.com/madebr/dethrace/actions/runs/1778285699