forked from ValveSoftware/source-sdk-2013
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Small mapbase fixes #322
Open
z33ky
wants to merge
5
commits into
mapbase-source:develop
Choose a base branch
from
z33ky:small-mapbase-fixes
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Small mapbase fixes #322
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This function is used to color impact particles. On Linux I've noticed that this function sometimes is not successful on retrieving the surface color, leaving an odd color to render the particles with. The engine function TraceLineMaterialAndLighting() even has a boolean return value indicating success. GetModelMaterialColorAndLighting() does not though, but I still observe failures (the color parameter is not modified). The color is initialized with an invalid value. If it detects that retrieving the color failed (engine function said so or the invalid value was left in place), this now hamfistedly assumes a lightish grey color, but at least still correctly (presumably) incorporates lighting information. When this situation is detected, a warning is also printed to the console. Because why not.
…Data() GCC warns about attempting to delete a void-pointer, since it will not be able to invoke its destructor. Fix by casing it to the expected type.
Crashes on Linux. Apparently returns incorrect values on Windows.
z33ky
commented
Sep 5, 2024
@@ -1001,7 +1001,11 @@ class CSoundEmitterSystem : public CBaseGameSystem | |||
|
|||
if ( duration ) | |||
{ | |||
*duration = enginesound->GetSoundDuration( pSample ); | |||
if ( Q_stristr( pSample, ".mp3" ) ) { |
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.
Like the commit message states, this crashes on Linux. I guess it doesn't on Windows, but doesn't return reliable values, taking the following comment from https://www.moddb.com/mods/sourceworld (scripts/vscript/music_manager.nut):
// The price for not using WAV format for looped music, ladies and gents. Manually writing all durations because the engine can't read duration of mp3s correctly.
::SW_MUS<-{}
::SW_MUS.DurTable<-{
hordeslayer_01=5.6411
hordeslayer_02=5.6411
hl2_song1=60
...
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A couple of small, unrelated fixes that should be pretty uncontroversial.
Does this PR close any issues?
PR Checklist
develop
branch OR targets another branch with a specific goal in mind