Back to the Vavoom Forum Archives


Forum

[Closed] Command line info; Z_ChangeTag error

Thu, 10 Jun 2004 16:03:45

GregLee

I'm working on s_sdl.cpp again, and here are a couple of problems I haven't been able to solve.  (1) How can I get values that were entered on Vavoom's command line?  Specifically, when "mix_channels 6" or something similar is given, I want to get the value "6".  "mix_channels" is declared as<br><br>static TCvarI mix_channels ("mix_channels",  "2", CVAR_ARCHIVE);<br><br>From the command line I've tried variations "-mix_channels 6", "+mix_channels 6", but the value of mix_channels remains 2.  I also tried, in the program, i = M_CheckParm("-mix_channels");, and I do get something back, but with "-mix_channels 6" on the command line, the variable i gets the value 8!  Very odd.<br><br>And (2), the other problem crops up when I open SDL_mixer with format unsigned 8 bit audio.  The music plays ok, but as soon as an effect is played, Vavoom exits with the message "Z_ChangeTag: freed a pointer without ZONEID".  I don't know where this comes from.  There are no Z_ChangeTag statements in s_sdl.cpp.  There are some in s_sdlm.cpp, but I temporarily disabled the music playing, and I still get the same error.  I tried commenting out all the Z_Free statements in s_sdl.cpp, but I still get the error.  None of the Z_Malloc statements in s_sdl.cpp uses a zoneid.<br><br>Grateful for any help.<br>
Thu, 10 Jun 2004 17:17:08

Janis Legzdinsh

(1) These console variables are wrong design by the author of the original SDL code. It's because configure scripts and command line commands are executed after initializing the system.<br><br>The value returned by M_CheckParm is it's index in myargv array, the value will be the next param and by using atoi() you can get the value.<br><br>(2) This error message means that you are trying to use Z_ChangeTag with pointer that is not a valid pointer previously returned by Z_Malloc. It can be a null pointer too.
Fri, 11 Jun 2004 07:29:16

GregLee

I should have looked at the existing code more carefully for the command line thing.  I changed it according to your suggestion, and emailed you a copy.<br><br>The Z_ChangeTag error is still with me, but I've only encountered it when initializing output to 6 channels and unsigned 8 bit format.  It's even ok with 4 channels.  Using more than 2 channels depends on my own patches to SDL and SDL_mixer, which may never make their way into the SDL distribution, so I guess I'll just let it go, for now.<br><br>Thanks,<br>Greg

Back to the Vavoom Forum Archives