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

Tricoll and props #8

Merged
merged 4 commits into from
Apr 22, 2024
Merged

Conversation

RoyalBlue1
Copy link
Contributor

Converts Tricoll indices.
Converts StaticProps to v13
Adds StaticProps to CollisionGrid

@snake-biscuits snake-biscuits self-assigned this Apr 22, 2024
@snake-biscuits snake-biscuits added the enhancement New feature or request label Apr 22, 2024
@snake-biscuits
Copy link
Owner

I'm just gonna merge this as is, I'll fix the Linux build myself later

@snake-biscuits snake-biscuits self-requested a review April 22, 2024 10:32
@snake-biscuits snake-biscuits marked this pull request as ready for review April 22, 2024 10:33

struct mstudiopertrihdr_t
{
short version; // game requires this to be 2 or else it errors
Copy link
Owner

Choose a reason for hiding this comment

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

I'd prefer cstdint types to short etc. as they can be ambiguous

// if STUDIOHDR_FLAGS_CONSTANT_DIRECTIONAL_LIGHT_DOT is set,
// this value is used to calculate directional components of lighting
// on static props
BYTE constdirectionallightdot;
Copy link
Owner

Choose a reason for hiding this comment

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

BYTE is a Windows type
I'll replace this with uint8_t when I do the Linux fixes

@@ -4,7 +4,7 @@
#include <cstdint>


#define MAGIC_sprp MAGIC('s', 'p', 'r', 'p')
#define MAGIC_sprp MAGIC('p', 'r', 'p', 's')
Copy link
Owner

Choose a reason for hiding this comment

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

good catch
I musn't've been thinking when I wrote this

@@ -22,4 +22,67 @@ namespace source {
static_assert(offsetof(GameLumpHeader, version) == 0x6);
static_assert(offsetof(GameLumpHeader, offset) == 0x8);
static_assert(offsetof(GameLumpHeader, length) == 0xC);

struct Tricoll_Header
Copy link
Owner

Choose a reason for hiding this comment

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

Tricoll_Header isn't consistent with how other structs are named

Copy link
Owner

Choose a reason for hiding this comment

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

mixing CamelCase & snake_case is pretty cursed

static_assert(offsetof(Tricoll_Header,scale)==0x28);


struct CMGrid{
Copy link
Owner

Choose a reason for hiding this comment

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

CMGrid isn't consistent either

Copy link
Owner

@snake-biscuits snake-biscuits left a comment

Choose a reason for hiding this comment

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

Seriously appreciate the work you put into TriColl to get this all working

I am gonna change like 90% of your code for Linux fixes tho
No joke, my changes rn are 500+ 600-

@@ -8,17 +8,87 @@

namespace titanfall {
const int VERSION = 29;
const int sprp_VERSION = 13;
const int sprp_VERSION = 12;
Copy link
Owner

Choose a reason for hiding this comment

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

good catch

@@ -22,4 +22,67 @@ namespace source {
static_assert(offsetof(GameLumpHeader, version) == 0x6);
static_assert(offsetof(GameLumpHeader, offset) == 0x8);
static_assert(offsetof(GameLumpHeader, length) == 0xC);

Copy link
Owner

Choose a reason for hiding this comment

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

None of these structs are in the Source Engine
they should all be in titanfall.hpp

bitsReadFromBuffer = startBit & 0x1F;

}
uint32_t Read10() {
Copy link
Owner

Choose a reason for hiding this comment

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

no whitespace between functions, but huge whitespace at the start of the function
very hard to read

}
}
std::sort(lumps.begin(), lumps.end(), [](auto a, auto b) { return a.offset < b.offset; });

#define WRITE_NULLS(byte_count) \
#define WRITE_NULLS(byte_count) \
Copy link
Owner

Choose a reason for hiding this comment

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

why?

default: // copy raw lump bytes
memcpy(outfile.rawdata(write_cursor), r1bsp.file_.rawdata(r1lump.offset), r1lump.length);

case titanfall::GAME_LUMP: { // NULLED OUT
Copy link
Owner

Choose a reason for hiding this comment

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

these comments aren't relevant anymore


auto r1GameLump = r1bsp.get_lump<char>(titanfall::GAME_LUMP);


Copy link
Owner

Choose a reason for hiding this comment

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

huge whitespace

@snake-biscuits snake-biscuits merged commit 9cb93bc into snake-biscuits:main Apr 22, 2024
1 of 2 checks passed
This was referenced Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants