changeset 2393:a29d9609f9b2

for console window text
author Ritor1
date Fri, 04 Jul 2014 13:58:09 +0600
parents 22cbc67a619e
children 2fe8feb3dcd1
files MediaPlayer.cpp VideoPlayer.cpp mm7_2.cpp
diffstat 3 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MediaPlayer.cpp	Fri Jul 04 09:26:50 2014 +0600
+++ b/MediaPlayer.cpp	Fri Jul 04 13:58:09 2014 +0600
@@ -20,6 +20,8 @@
 #include "stuff.h"
 #include "OpenALSoundProvider.h"
 
+#include "Log.h"
+
 #include "MediaPlayer.h"
 using namespace Media;
 
@@ -1031,9 +1033,11 @@
 ITrack *MPlayer::LoadTrack(const wchar_t *filename) //Загрузить mp3
 {
   auto track = new Track;
+  Log::Warning(L"allocation dynamic memory for Track\n");
   if (!track->LoadAudio(filename))
   {
     delete track;
+	Log::Warning(L"delete dynamic memory for Track\n");
     track = nullptr;
   }
   return track;
@@ -1042,9 +1046,11 @@
 IMovie *MPlayer::LoadMovie(const wchar_t *filename, int width, int height, int cache_ms)	//Загрузить видео
 {
   movie = new Movie;
+  Log::Warning(L"allocation dynamic memory for Movie\n");
   if (!movie->Load(filename, width, height, cache_ms))
   {
     delete movie;
+	Log::Warning(L"delete dynamic memory for Movie\n");
     movie = nullptr;
   }
   return movie;
@@ -1053,11 +1059,13 @@
 IMovie *MPlayer::LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height)
 {
 	movie = new Movie;
+	Log::Warning(L"allocation dynamic memory for Movie\n");
 	if (movie)
 	{
 		if (movie->LoadFromLOD(h, readFunction, seekFunction, width, height))
 			return movie;
 		delete movie;
+		Log::Warning(L"delete dynamic memory for Movie\n");
 	}
 	return nullptr;
 }
@@ -1094,12 +1102,15 @@
   if (!provider)
   {
     provider = new OpenALSoundProvider;
+	Log::Warning(L"allocation dynamic memory for provider\n");
     provider->Initialize();
   }
 }
 
 MPlayer::~MPlayer()
 {
+	delete provider;
+	Log::Warning(L"delete dynamic memory for provider\n");
 }
 
 void PlayAudio(const wchar_t * pFilename)
@@ -1118,6 +1129,7 @@
 {
   movie->Release();
   delete movie;
+  Log::Warning(L"delete dynamic memory for Movie\n");
   movie = nullptr;
 }
 
--- a/VideoPlayer.cpp	Fri Jul 04 09:26:50 2014 +0600
+++ b/VideoPlayer.cpp	Fri Jul 04 13:58:09 2014 +0600
@@ -255,6 +255,7 @@
   pEventTimer->Resume();
 
 	delete pMovie;
+	Log::Warning(L"delete dynamic memory for pMovie\n");
 	pMovie = nullptr;
 }
 
@@ -283,6 +284,7 @@
 
     SetFilePointer(hVidFile, uOffset, nullptr, FILE_BEGIN);
     pMovie = nullptr;
+	Log::Warning(L"reload pMovie");
     pMovie = pMediaPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, width, height);
 	end_current_file = false;
   }
@@ -449,6 +451,7 @@
   bStopBeforeSchedule = false;
   pResetflag = 0;
   pMediaPlayer = new Media::MPlayer;//создаётся плеер
+  Log::Warning(L"allocation dynamic memory for pMediaPlayer\n");
   pMovie = nullptr;
   //pBinkMovie = nullptr;
 }
--- a/mm7_2.cpp	Fri Jul 04 09:26:50 2014 +0600
+++ b/mm7_2.cpp	Fri Jul 04 13:58:09 2014 +0600
@@ -1414,7 +1414,7 @@
     Log::Warning(L"Checking for CD...");
     if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter))
       return false;
-    Log::Warning(L"...done.");
+    Log::Warning(L"...done.\n");
   }
 
 
@@ -2059,7 +2059,7 @@
   //Ritor1: include
   MMT_MainMenu_Loop();
 
-  Log::Warning(L"MM: entering main loop");
+  Log::Warning(L"MM: entering main loop \n");
   while ( 1 )
   {
     MainMenuWindow* main_menu_window = MainMenuWindow::Create();
@@ -2361,7 +2361,7 @@
 {
   sCurrentMenuID = uMenu;
 
-  Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu));
+  Log::Warning(L"CurrentMenu = %s \n", MENU_STATE_to_string(uMenu));
 }
 
 //----- (00466CA0) --------------------------------------------------------