- Fixed compilation with FMOD 4.38+. The removal of hardware voices and EAX was a fairly
major change, so I'm making no provisions for using older FMOD DLLs when compiled with the
4.38 API. However, sound positioning is still broken like in 4.28, so you are recommended
to continue building with 4.26. Also, the Freeverb-based DSP unit is no longer present in
FMOD, so the underwater effect is currently unavailable when using 4.38 until I can figure
out how to make it work with the SFX Reverb unit instead. (And on that topic, the Freeverb
DSP was officially only for stereo outputs, so I really shouldn't have been using it in the
first place.)
- Since I would like to eventually figure out the sound positioning issues with the newer
FMODs, the following have been added:
* snd_drawoutput now labels its outputs with the speakers they represent.
* DCanvas::DrawTextA was added as an alias for DrawText, since the Windows headers #define
DrawText to a Unicode/non-Unicode variant.
* The loopsound console command was added to spawn an actor at the player's location and
have it loop a sound infinitely.
Hopefully I can figure it out. FMOD's 3D example works, so I assume the problem lies with
my code, though I don't really know where to begin looking for the problem.
SVN r3350 (trunk)
This commit is contained in:
parent
5d7ee4dbfd
commit
68fbd75897
9 changed files with 545 additions and 368 deletions
|
|
@ -78,11 +78,11 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B
|
|||
//
|
||||
// Write a string using the given font
|
||||
//
|
||||
void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, const char *string, ...)
|
||||
void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag1, va_list taglist)
|
||||
{
|
||||
va_list tags;
|
||||
DWORD tag;
|
||||
INTBOOL boolval;
|
||||
va_list tags;
|
||||
uint32 tag;
|
||||
|
||||
int maxstrlen = INT_MAX;
|
||||
int w, maxwidth;
|
||||
|
|
@ -117,8 +117,12 @@ void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, c
|
|||
maxwidth = Width;
|
||||
scalex = scaley = 1;
|
||||
|
||||
va_start (tags, string);
|
||||
tag = va_arg (tags, DWORD);
|
||||
#ifndef NO_VA_COPY
|
||||
va_copy(tags, taglist);
|
||||
#else
|
||||
tags = taglist;
|
||||
#endif
|
||||
tag = tag1;
|
||||
|
||||
while (tag != TAG_DONE)
|
||||
{
|
||||
|
|
@ -203,7 +207,7 @@ void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, c
|
|||
height = va_arg (tags, int);
|
||||
break;
|
||||
}
|
||||
tag = va_arg (tags, DWORD);
|
||||
tag = va_arg (tags, uint32);
|
||||
}
|
||||
|
||||
height *= scaley;
|
||||
|
|
@ -233,8 +237,12 @@ void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, c
|
|||
|
||||
if (NULL != (pic = font->GetChar (c, &w)))
|
||||
{
|
||||
va_list taglist;
|
||||
va_start (taglist, string);
|
||||
#ifndef NO_VA_COPY
|
||||
va_copy(tags, taglist);
|
||||
#else
|
||||
tags = taglist;
|
||||
#endif
|
||||
tag = tag1;
|
||||
if (forcedwidth)
|
||||
{
|
||||
w = forcedwidth;
|
||||
|
|
@ -242,20 +250,35 @@ void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, c
|
|||
DTA_Translation, range,
|
||||
DTA_DestWidth, forcedwidth,
|
||||
DTA_DestHeight, height,
|
||||
TAG_MORE, &taglist);
|
||||
TAG_MORE, &tags);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawTexture (pic, cx, cy,
|
||||
DTA_Translation, range,
|
||||
TAG_MORE, &taglist);
|
||||
TAG_MORE, &tags);
|
||||
}
|
||||
va_end (taglist);
|
||||
va_end (tags);
|
||||
}
|
||||
cx += (w + kerning) * scalex;
|
||||
}
|
||||
}
|
||||
|
||||
void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...)
|
||||
{
|
||||
va_list tags;
|
||||
va_start(tags, tag);
|
||||
DrawTextV(font, normalcolor, x, y, string, tag, tags);
|
||||
}
|
||||
|
||||
// A synonym so that this can still be used in files that #include Windows headers
|
||||
void STACK_ARGS DCanvas::DrawTextA (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...)
|
||||
{
|
||||
va_list tags;
|
||||
va_start(tags, tag);
|
||||
DrawTextV(font, normalcolor, x, y, string, tag, tags);
|
||||
}
|
||||
|
||||
//
|
||||
// Find string width using this font
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue