![]() |
TRACE_TEXTURE weirdnesses
Got another one for you all:
I'm using TRACE_TEXTURE to determine the texture a player is standing on (for hearing purposes, as covered in a thread from last week). However, it seems to be doing strange things to the stack: depending on how much code follows it, my return values get all messed up. I'm guessing it's a stack corruption because adding a LOG_CONSOLE to track my return value "fixed" the problem, that is, until I added some more code, at which point it went haywire again. Has anybody every experienced this before? Here's a snippet of my code where the actual call happens: Code:
-JB |
Re: TRACE_TEXTURE weirdnesses
What are you doing with pTextureName in the rest of that function?
You're not trying to return pTextureName back from the function are you? That would cause problems because pTextureName is a local variable on the stack frame of that function. botman |
Re: TRACE_TEXTURE weirdnesses
Nope, not returning any local variables, I'm just comparing the texture name to a few known textures that I want to cause sound when walked upon.
Any other thoughts? Have you all used TRACE_TEXTURE successfully? -JB |
Re: TRACE_TEXTURE weirdnesses
To check what sort of footstep sound belongs to a texture, call the PM_FindTextureType() function in the Game DLL interface. Any MOD code should feature this function. You feed it with the texture name char pointer, and it will return the character describing what type of material it is, according to what's specified in your materials.txt file.
Here's what I am doing: Code:
// ask the engine for the texture name on pGroundEntity under the player's feet |
All times are GMT +2. The time now is 17:37. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.