| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This is more prep for OE, as it will allow us to change how the call is
forwarded for the other ABI (albeit in what looks like it'll be a fairly
involved way) without requiring a bunch of extra code at every call
site. It's maybe a little less efficient since the global has to be
loaded every time, but coloured logging isn't exactly a bottleneck.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since this codebase is already extremely nonportable, I've decided to
relax the obsessive ifdef-else-error usage around all the extensions.
From now on, if there's no alternative to using an extension, we can
just use that extension. If it's possible to do something in a
relatively portable way, we can still try to do that in order to make
the code somewhat reusable, in contexts where that makes sense.
I also decided to use langext.h for naked functions and tail calls. If
that's used in another codebase build with a different compiler, those
just won't work, but that's fine. The benefit is really just that
there's less ceremony in places where those are used, because it's
likely there'll be a few more such places in the future, and it gets
annoying reading all the double-underscore stuff all over the place.
I still kind of want to do something about all the _WIN32 ifdefs too,
but I've realised that doing so will lead to almost nothing actually
being built on Linux. Then again, none of it currently runs on Linux so
I guess that's a moot point. Will worry about it later, anyway.
|
|
|
|
|
|
|
| |
Turns out, there's no need for the trailing underscores. Plus, glibc
does some stupid stuff with __attribute__ for non-GCC compilers. Not
that that matters here, but it seems like a good practice just to use
the forms that never have such problems. And it's shorter too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is a step towards making command hooks work in OE, once OE is
supported.
Not the most ideal or efficient thing in the world, but it works okay
until we come up with something better, I suppose. Not a fan of the argv
copying but avoiding that would make the API a lot less ergonomic.
Not the easiest problem to solve, really...
|
| |
|
|
|
|
|
| |
Don't worry about the fact I typed l4 instead 14 for the last release
btw. No idea how that happened but I guess it doesn't matter anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a stopgap solution approved by the Portal moderators until we
have a better way to handle timing and verifying closing/restarting the
game mid-run.
Essentially, the agreed-upon short-term solution is to somewhat emulate
restarting the game by simply turning off the glitch and sending the
player back to the main menu.
Committer's note: this wasn't added to the Linux compile script since it
doesn't work and I honestly just couldn't be bothered adding in the
usual ifdef-errors. And in fact I'm starting to wonder if we should just
be leaving out features that don't work on Linux to avoid all the
ifdefs, but that can happen later because the main goal of committing
this is to get a release out, so I don't want to faff about with that
right now.
|
|
|
|
|
|
|
|
|
|
| |
This took longer to debug than one might like to admit. In some very
specific cases, the loop condition would fail before the return
condition, causing the rest of the logic to proceed with out-of-bounds
accesses to indents and exprs (which are zero-initialised), in turn
leading to garbage getting dumped into the generated header.
The garbage in question would be line 0, and [argv[0]
|
|
|
|
|
| |
The code I'm about to commit appears to generate a call to this. Funny
we never needed it until now...
|
|
|
|
|
| |
This doesn't allow us to support OE in and of itself but is part of the
groundwork necessary to do so in the future.
|
|
|
|
|
|
| |
This improves the ergonomics of a few different things, and sets us up
somewhat for the fact OE had a different interface for commands too
(it was v1 only and had a separate API call for getting the args).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Most notably, don't just silently return when no parameter is provided;
allow the default handler to print the usual error message.
Also, don't raise the PluginLoaded/PluginUnloaded events when nothing
has actually happened. And rearrange the v1/v2 union so we don't need to
spell out `v2.common`.
Error message issue pointed out by Evan Lin - thanks!
|
|
|
|
|
|
| |
Turns out, some stuff that was done virtually and/or indirectly and/or
conditionally to match the engine never really needed to be done as
such. Considering this codebase is in fact not part of the engine.
|
|
|
|
|
| |
I think this might actually be the last of the gluegen regressions now,
for real, maybe, perhaps.
|
| |
|
|
|
|
|
| |
Avoids crashing if we couldn't get the interface for whatever reason.
Apparently bill ran into such a case.
|
| |
|
|
|
|
| |
I inverted the condition, d'oh!
|
|
|
|
| |
On the plus side, SST's release cadence has never been so lively!
|
|
|
|
|
|
|
|
|
|
| |
Sorry Hayden. My next project for SST is a testing system. Because I
*royally* screwed up this release cycle.
Anyway I just inlined that function because it was evidently a
sufficient source of confusion that I managed to totally screw up
basically every part of call boundary. Truly catastrophically bungled
the thing. I must have been really tired...
|
|
|
|
| |
Inconsequential at the moment, but still worth fixing.
|
|
|
|
|
| |
Every. Single. Time. And having screwed up the zip dates was just a
bonus I suppose.
|
|
|
|
|
|
| |
I think memcpy might have been returning the wrong thing before,
actually, but I guess it didn't matter in practice. Who the hell uses
the return value from memcpy?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically when building in debug mode, we now:
* Display all features on load, including skipped and internal ones,
sorted by internal name instead of display name.
* Print the names of all matched gametype tags after the feature list.
* Add an sst_dbg_getcmdcb command to get the address of a command
callback for quick breakpoint insertion or Ghidra lookup.
* Add an sst_dbg_sendtables command to dump out the full ServerClass
tree to help get names for entprops.txt. Note: this output is very
long so you'll likely need to log console output to a file to be able
to read it all.
There's a bunch of developer experience and debug help stuff I want to
get done eventually. This is just a very small piece, but it's a start.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With apologies to Hayden, whose code was mostly fine until my quest to
make it neater ended up bungling stuff. I wanted it reviewed and tested
before pushing it anywhere public but people have limited free time -
how dare they!!!! - and at some point I kind of impatiently just sent
it because I had a pile of unrelated changes I didn't want to untangle.
I didn't really know how to reproduce the bad performance myself to test
the fix here properly, so I was kind of unfairly relying on him to do
it, even though he'd already tested his own code and made sure it worked
*before* I decided to break it.
My bad.
Don't worry though, I was never actually going actually release SST in
such a broken state. I mean, I have released it in worse states before,
but I wasn't gonna do it on this occasion. :^)
Now this is definitely done correctly, I think, and I've done yet
another pass over the comments, I'm pretty confident that 0.9 is around
the corner. Just a few more commits of entirely non-user facing stuff to
get out of the way first...
|
|
|
|
|
|
|
|
|
|
|
|
| |
This probably should have been the design from the start.
It's still possible to use void pointers, and this is done in a couple
of places for simplicity, but wherever possible, we have actual structs
for things now.
Additionally, in places where vtables are fiddled with, e.g. vtable
hooks, we have actual struct definitions with vtable pointers so there's
need for pointer-casting horror.
|
|
|
|
|
|
| |
These gamedata entries are always available, but there's no reason not
to check for them in case that changes in future. As-is now, the checks
will be trivial for the compiler to optimise out.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had this hunch that Intel's strong memory model wouldn't actually
require anything like this, and some cursory research suggests this is
correct even across threads, or at least definitely within the same
thread which is what we care about.
I kind of don't know why FlushInstructionCache() even exists in that
case. Maybe it's for other architectures or maybe it's just for the
benefit of debuggers. Microsoft's documentation helpfully asserts that
it is necessary to call it even though it isn't, and doesn't elaborate
further. Of course.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This both simplifies and complicates things, but probably hopefully
maybe simplifies things overall. Certainly in cases like the L4D1 demo
thing where there's 3 inline hooks at once, it seems simpler to be able
to batch the fallible stuff to avoid rollbacks. In cases where you only
need one hook, it's a bit more verbose, but what can you do.
Thanks bill for discussing this with me pretty exhaustively and giving a
lot of good input.
I think both of us still kind of hate it actually.
|
| |
|
|
|
|
| |
Also pointed out by bill. D'oh, guess I'm fired.
|
|
|
|
|
|
|
|
|
|
| |
I had at one point tried to macrofy the repetitive functions. After
being talked down from that madness, I LSP-expanded all the macros out
and went through rewriting the crazy expressions into constants.
Except those two for some reason, because I'm blind I guess.
Thanks bill for pointing this out.
|
| |
|
|
|
|
|
| |
Doesn't matter how many history rewrites I do before pushing my local
branch, there will always be something I still got wrong.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out this was fixed in version 2112 (October 2012), so it was
fairly easy to isolate in Ghidra (I had previously thought this was
fixed by TLS). The CDirector::FinaleEscapeState member is used in
CDirector::IsFinaleWon (and maybe another function, I don't remember).
Prior to Valve's fix, the value was never reset to 0 after finishing a
campaign, so when the Swamp (or Crash Course) "minifinale" events ran,
the game would behave as though the player was entering the
end-of-finale cutscene and block votes, make players invincible etc.
2112 fixed this bug by setting the member back to 0 in CDirector::Reset,
so here we just set it to 0 when quickreset is used, since that is
essentially the recommended way to start a run at this point.
Now co-op hosts won't need to restart their game after finishing
a campaign anymore!
|
|
|
|
|
|
|
|
| |
They're legally unnecessary as far as I know, and kind of annoying to
maintain on a long-term basis.
This was done with the consent of all 3 other contributors, in case
anyone was wondering.
|
|
|
|
|
|
| |
Confusingly, the old matchmaking interface refers to No Mercy as
apartments (plural), but refers to the first level as apartment
(singular). Good meme.
|
| |
|
| |
|
|
|
|
|
|
| |
This isn't useful to us at all, but might be useful to someone else.
I always try to write code for multiple compilers for this reason, even
if SST ultimately still requires Clang.
|
| |
|
|
|
|
|
| |
This probably works for basically every game, but it was only tested for
L4D/L4D2/L4D:S/Portal 2.
|
|
|
|
|
|
|
|
|
|
| |
1022 is the update that adds Mac support and introduces some of the
already known vtable changes (this update is similar to 2040 for L4D2 in
that regard), the tag will also see some use in some upcoming features.
The 1015 tag is questionably necessary, but will be used for at least
one feature (it's also the update that adds the newer matchmaking
interfaces used in l4dreset.c, but having the tag available doesn't
help anything there).
|
|
|
|
|
|
|
| |
Turns out the cvar we use to detect 2147 was actually added in 2125.
Since renaming it doesn't currently break anything (and 2125 was a
fairly notable code shuffling update, given it was the first update with
a native Linux build of the game), it makes most sense to just do this.
|