-
Notifications
You must be signed in to change notification settings - Fork 3
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
Tricoll and props #8
Conversation
also adds visual studio files to git ignore
I'm just gonna merge this as is, I'll fix the Linux build myself later |
|
||
struct mstudiopertrihdr_t | ||
{ | ||
short version; // game requires this to be 2 or else it errors |
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.
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; |
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.
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') |
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.
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 |
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.
Tricoll_Header
isn't consistent with how other structs are named
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.
mixing CamelCase
& snake_case
is pretty cursed
static_assert(offsetof(Tricoll_Header,scale)==0x28); | ||
|
||
|
||
struct CMGrid{ |
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.
CMGrid
isn't consistent either
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.
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; |
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.
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); | |||
|
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.
None of these structs are in the Source Engine
they should all be in titanfall.hpp
bitsReadFromBuffer = startBit & 0x1F; | ||
|
||
} | ||
uint32_t Read10() { |
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.
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) \ |
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.
why?
default: // copy raw lump bytes | ||
memcpy(outfile.rawdata(write_cursor), r1bsp.file_.rawdata(r1lump.offset), r1lump.length); | ||
|
||
case titanfall::GAME_LUMP: { // NULLED OUT |
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.
these comments aren't relevant anymore
|
||
auto r1GameLump = r1bsp.get_lump<char>(titanfall::GAME_LUMP); | ||
|
||
|
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.
huge whitespace
Converts Tricoll indices.
Converts StaticProps to v13
Adds StaticProps to CollisionGrid