1
1
forked from 0ad/0ad

CinemaTrack: Avoided crashing in certain cases.

dll_ver: Fixed invalid free when running with OpenGL 1.1 drivers on
Vista.
GameSetup: Fixed spaces between sentences in error message.

This was SVN commit r4820.
This commit is contained in:
Ykkrosh 2007-01-29 17:46:28 +00:00
parent 248e4ef4dc
commit 41cf5c6139
3 changed files with 14 additions and 7 deletions

View File

@ -381,6 +381,13 @@ void CCinemaManager::OverrideTrack(const CStrW& name)
void CCinemaManager::SetAllTracks( const std::map<CStrW, CCinemaTrack>& tracks)
{
m_Tracks = tracks;
// TODO: this just assumes that if you had any track selected, it was the
// first. (We need to change m_CurrentTrack because it was pointing into
// the old m_Tracks.)
if (m_CurrentTrack)
m_CurrentTrack = (tracks.empty() ? NULL : &m_Tracks.begin()->second);
for ( std::map<CStrW, CCinemaTrack>::iterator it=m_Tracks.begin();
it != m_Tracks.end(); ++it )
{
@ -409,7 +416,7 @@ bool CCinemaManager::HasTrack(const CStrW& name) const
void CCinemaManager::DrawAllSplines() const
{
if ( !(m_DrawAllSplines || m_DrawCurrentSpline) )
if ( !(m_DrawAllSplines || m_DrawCurrentSpline) || !m_CurrentTrack )
return;
static const int smoothness = 200;

View File

@ -89,7 +89,7 @@ static LibError get_ver(const char* module_path, char* out_ver, size_t out_ver_l
WARN_IF_FALSE(ok);
}
void* mem;
void* mem = NULL;
LibError ret = get_ver_impl(module_path, out_ver, out_ver_len, mem);
free(mem);

View File

@ -1006,9 +1006,9 @@ void Init(const CmdLineArgs& args, uint flags)
{
wchar_t buf[500];
const wchar_t* fmt =
L"The %hs extension doesn't appear to be available on your computer. "
L"The game may still work, though - you are welcome to try at your own risk. "
L"If not or it doesn't look right, upgrade your graphics card.";
L"The %hs extension doesn't appear to be available on your computer."
L" The game may still work, though - you are welcome to try at your own risk."
L" If not or it doesn't look right, upgrade your graphics card.";
swprintf(buf, ARRAY_SIZE(buf), fmt, missing);
DISPLAY_ERROR(buf);
// TODO: i18n
@ -1018,8 +1018,8 @@ void Init(const CmdLineArgs& args, uint flags)
{
DISPLAY_ERROR(
L"The GL_ARB_texture_env_crossbar extension doesn't appear to be available on your computer."
L"Shadows are not available and overall graphics quality might suffer."
L"You are advised to try installing newer drivers and/or upgrade your graphics card.");
L" Shadows are not available and overall graphics quality might suffer."
L" You are advised to try installing newer drivers and/or upgrade your graphics card.");
g_Shadows = false;
}