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

Windows project files / fixes #5

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

Conversation

TTimo
Copy link

@TTimo TTimo commented Oct 7, 2012

A few fixes and new/rebuilt MSVC project files. Binaries are included in GtkRadiant 1.6.3 builds. See TTimo/GtkRadiant#63 for details.

TTimo and others added 30 commits October 7, 2012 15:24
The settings in cfgq3.c had diverged from the actual fields and defaults in
these ways:
- extra field phys_maxacceleration
- missing fields phys_walkaccelerate, phys_swimaccelerate, rs_maxfallheight
- different defaults for phys_airaccelerate, phys_maxstep, phys_maxwaterjump

Also the code in aas_cfg.[ch] for reading the settings was missing
rs_maxfallheight.

It's brittle to require multiple different files to agree on these fields, but
rather than fix that issue this is just a band-aid to bring things back into
alignment so that custom configs based on the example file can be used again.
AAS_LoadAASLump will return 0/NULL in an error case. However it will also
return the input buffer pointer if length is 0, and the input buffer pointer
may be 0/NULL in the case where AAS_LoadAASLump is meant to allocate memory.

This means that it can return 0/NULL in a perfectly legal case where the lump
length is 0. Since AAS_LoadAASFile inteprets this as a fatal error, that's
bad.

I'm not sure how to best disambiguate this, but a low-touch fix is for the
caller of AAS_LoadAASLump to be OK with a returned NULL pointer if the lump
length is 0.

Also: added a missing break statement to avoid a spurious "don't know what to
do" message when using the aasinfo switch.
With bspc built on OS X or Centos, a generated aas file for a given bsp
is exactly the same as when generated on Windows, except for the
checksum.

The reason is that on those platforms, the UINT4 data type defined in
md4.c is 8 bytes in size rather than 4 bytes.

Changing that type definition from "unsigned long int" to "unsigned int"
makes the data type 4 bytes in size on all three platforms, resulting in
correct & identical aas files for all three.

It's not a bulletproof way of specifying a 4-byte int, but as far as I
know it should be 4 bytes on any current platform that could build & run
bspc.
fix checksum calculation on non-Windows platforms
update fields in the example custom config file
make AAS_LoadAASFile work with zero-sized lumps
Add FBSP support to bspc and squash a few bugs along the way
A bunch of x64/WIN64 fixes
[l_bsp_hl.c] Reactivate (and fix) FastChecksum function
[l_bsp_{q1,q2,sin}.c] Fix undefined behaviour in array access
[bspc.c] Delete dead code and commented code
[l_bsp_{hl,q1}.c] Fix erroneous use of comma operator
[bspc.c] Change directory variables to have static storage
TTimo and others added 6 commits August 20, 2016 17:50
…than size-1 arrays.

The arrays were always meant to be variably sized, and objects are only ever allocated dynamically. Object size computations are simplified with this change.

Flexible arrays were introduced in C99, so this change means that we will require a C99-conforming compiler henceforth.
Use flexible array members
Some of the variables in l_bsc_{hl,sin,q1,q2}.c had not been made
unique with the game-specific prefix, which led to ODR
violations. Previously, some permissive compilers allowed this and
considered the tentative definitions to declare the _same_ entity, but
newer compilers rightfully reject this. The solution is to ensure that
distinct variables really are distinct.
Fix duplicate definitions by renaming variables.
@rawr51919 rawr51919 mentioned this pull request Aug 13, 2023
@rawr51919
Copy link

A few fixes and new/rebuilt MSVC project files. Binaries are included in GtkRadiant 1.6.3 builds. See TTimo/GtkRadiant#63 for details.

This fixes #4 and #8

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.

6 participants