some more fixes
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@157 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -64,12 +64,12 @@ void CGraphics::freemem(void)
|
||||
if (scrollbuffer)
|
||||
{
|
||||
delete[] scrollbuffer; scrollbuffer = NULL;
|
||||
g_pLogFile->ftextOut(BLACK,true," Scrollbuffer memory released to system.<br>");
|
||||
g_pLogFile->fltextOut(BLACK,true," Scrollbuffer memory released to system.<br>");
|
||||
}
|
||||
if (blitbuffer)
|
||||
{
|
||||
delete[] blitbuffer; blitbuffer = NULL;
|
||||
g_pLogFile->ftextOut(BLACK,true," Blitbuffer memory released to system.<br>");
|
||||
g_pLogFile->fltextOut(BLACK,true," Blitbuffer memory released to system.<br>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,13 @@ void CLogFile::WriteTopic(const char *Topic, int Size)
|
||||
|
||||
|
||||
// Now with colors
|
||||
void CLogFile::textOut(int Color, const char *Text)
|
||||
void CLogFile::textOut(FONTCOLORS Color, const char *Text)
|
||||
{
|
||||
textOut(Color, false, Text);
|
||||
}
|
||||
|
||||
// Now the entire definition (with list and color)
|
||||
void CLogFile::textOut(int Color, bool List, const char *Text)
|
||||
void CLogFile::textOut(FONTCOLORS Color, bool List, const char *Text)
|
||||
{
|
||||
if(List == true)
|
||||
textOut("<li>");
|
||||
@@ -128,7 +128,7 @@ void CLogFile::ftextOut(const char *Text, ...)
|
||||
textOut(buffer);
|
||||
}
|
||||
|
||||
void CLogFile::ftextOut(int Color, bool List, const char *Text, ...)
|
||||
void CLogFile::fltextOut(FONTCOLORS Color, bool List, const char *Text, ...)
|
||||
{
|
||||
char buffer[MAX_BUFFER];
|
||||
va_list pArgList;
|
||||
@@ -140,7 +140,7 @@ void CLogFile::ftextOut(int Color, bool List, const char *Text, ...)
|
||||
textOut(Color, List, buffer);
|
||||
}
|
||||
|
||||
void CLogFile::ftextOut(int Color, const char *Text, ...)
|
||||
void CLogFile::ftextOut(FONTCOLORS Color, const char *Text, ...)
|
||||
{
|
||||
char buffer[MAX_BUFFER];
|
||||
va_list pArgList;
|
||||
|
||||
@@ -33,11 +33,11 @@ public:
|
||||
void CreateLogfile (const char *LogName);
|
||||
void WriteTopic (const char *Topic, int Size);
|
||||
void textOut (const char *Text);
|
||||
void textOut (int Color, const char *Text);
|
||||
void textOut (int Color, bool List, const char *Text);
|
||||
void textOut (FONTCOLORS Color, const char *Text);
|
||||
void textOut (FONTCOLORS Color, bool List, const char *Text);
|
||||
void ftextOut (const char *Text, ...);
|
||||
void ftextOut (int Color, const char *Text, ...);
|
||||
void ftextOut (int Color, bool List, const char *Text, ...);
|
||||
void ftextOut (FONTCOLORS Color, const char *Text, ...);
|
||||
void fltextOut (FONTCOLORS Color, bool List, const char *Text, ...);
|
||||
void FunctionResult (const char *Name, bool Result);
|
||||
|
||||
private:
|
||||
|
||||
@@ -64,7 +64,7 @@ bool CHQBitmap::loadImage(const std::string& pFilename, int wsize, int hsize)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
SDL_GetError();
|
||||
}
|
||||
|
||||
return m_active;
|
||||
|
||||
@@ -40,10 +40,16 @@ short HQSndDrv_Load(SDL_AudioSpec *AudioSpec, stHQSound *psound, const std::stri
|
||||
g_pLogFile->textOut(PURPLE,"Sorry, OGG-Support is disabled!<br>");
|
||||
buf = "data/hqp/snd/"+ soundfile + ".WAV";
|
||||
|
||||
// Check, if it is a wav file or go back to classic sounds
|
||||
if (SDL_LoadWAV (buf.c_str(), &AudioFileSpec, &(psound->sound_buffer), &(psound->sound_len)) == NULL)
|
||||
std::string fullfname = GetFullFileName(buf);
|
||||
if(fullfname.size() == 0) {
|
||||
g_pLogFile->textOut(PURPLE,"Wave file not found: \"%s\". Trying to load the classical sound<br>", buf.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Check, if it is a wav file or go back to classic sounds
|
||||
if (SDL_LoadWAV (Utf8ToSystemNative(fullfname).c_str(), &AudioFileSpec, &(psound->sound_buffer), &(psound->sound_len)) == NULL)
|
||||
{
|
||||
g_pLogFile->textOut(PURPLE,"Wave file could not be opened: \"%s\". Trying to load the classical sound<br>", buf.c_str());
|
||||
g_pLogFile->textOut(PURPLE,"Wave file %s could not be opened: \"%s\". Trying to load the classical sound<br>", buf.c_str(), SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -60,7 +66,7 @@ short HQSndDrv_Load(SDL_AudioSpec *AudioSpec, stHQSound *psound, const std::stri
|
||||
// Check, if it is a wav file or go back to classic sounds
|
||||
if (SDL_LoadWAV (Utf8ToSystemNative(fullfname).c_str(), &AudioFileSpec, &(psound->sound_buffer), &(psound->sound_len)) == NULL)
|
||||
{
|
||||
g_pLogFile->textOut(PURPLE,"Wave file could not be opened: \"%s\". Trying to load the classical sounds<br>", buf.c_str());
|
||||
g_pLogFile->ftextOut(PURPLE, "Wave file %s could not be opened: \"%s\". Trying to load the classical sounds<br>", buf.c_str(), SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void cleanup(stCloneKeenPlus *CKP)
|
||||
{
|
||||
if(CKP->GameData){ delete[] CKP->GameData; CKP->GameData = NULL; }
|
||||
|
||||
g_pLogFile->ftextOut(BLACK,true," Freed %d strings.<br>", freestrings());
|
||||
g_pLogFile->fltextOut(BLACK,true," Freed %d strings.<br>", freestrings());
|
||||
|
||||
JoyDrv_Stop(&(CKP->Joystick));
|
||||
g_pLogFile->textOut(BLACK,true," Joystick driver shut down.<br>");
|
||||
@@ -77,11 +77,11 @@ void cleanup(stCloneKeenPlus *CKP)
|
||||
if (demofile)
|
||||
{
|
||||
fclose(demofile);
|
||||
g_pLogFile->ftextOut(BLACK,true," Demo file closed.<br>");
|
||||
g_pLogFile->fltextOut(BLACK,true," Demo file closed.<br>");
|
||||
}
|
||||
|
||||
g_pGraphics->stopGraphics();
|
||||
g_pLogFile->ftextOut(BLACK,true," Graphics driver shut down.<br>");
|
||||
g_pLogFile->fltextOut(BLACK,true," Graphics driver shut down.<br>");
|
||||
|
||||
g_pGraphics->freemem();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user