Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F126458
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/sfml_game/ImageManager.cpp b/src/sfml_game/ImageManager.cpp
index 29117af..d67259e 100644
--- a/src/sfml_game/ImageManager.cpp
+++ b/src/sfml_game/ImageManager.cpp
@@ -1,58 +1,59 @@
/** This file is part of sfmlGame.
*
* FreeTumble is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FreeTumble is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FreeTumble. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ImageManager.h"
-#include <stdio.h>
+#include <iostream>
ImageManager::ImageManager()
{
}
ImageManager::~ImageManager()
{
- printf("Releasing video memory...\n");
+ std::cout << "Releasing video memory... ";
for (unsigned int i = 0; i < imageArray.size(); i++)
{
delete(imageArray[i]);
}
imageArray.clear();
+ std::cout << "OK" << std::endl;
}
ImageManager* ImageManager::getImageManager()
{
static ImageManager singleton;
return &singleton;
}
void ImageManager::addImage(char* fileName)
{
sf::Texture* newImage = new sf::Texture;
newImage->loadFromFile(fileName);
imageArray.push_back(newImage);
}
bool ImageManager::reloadImage(int n, const char* fileName)
{
sf::Texture* newImage = new sf::Texture;
bool result = newImage->loadFromFile(fileName);
imageArray[n] = newImage;
return result;
}
sf::Texture* ImageManager::getImage(int n)
{
return imageArray[n];
}
diff --git a/src/sfml_game/SoundManager.cpp b/src/sfml_game/SoundManager.cpp
index f82eeee..7cc52db 100644
--- a/src/sfml_game/SoundManager.cpp
+++ b/src/sfml_game/SoundManager.cpp
@@ -1,67 +1,68 @@
/** This file is part of sfmlGame.
*
* FreeTumble is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FreeTumble is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FreeTumble. If not, see <http://www.gnu.org/licenses/>.
*/
#include "SoundManager.h"
#include <iostream>
SoundManager::SoundManager()
{
}
SoundManager::~SoundManager()
{
- std::cout << "Releasing audio memory...\n";
+ std::cout << "Releasing audio memory... ";
for (unsigned int i = 0; i < soundBufferArray.size(); i++)
{
soundArray[i]->stop();
delete(soundArray[i]);
delete(soundBufferArray[i]);
}
soundArray.clear();
soundBufferArray.clear();
+ std::cout << "OK" << std::endl;
}
SoundManager* SoundManager::getSoundManager()
{
static SoundManager singleton;
return &singleton;
}
void SoundManager::addSound(char* fileName)
{
//std::cout << "Loading sound: " << fileName << "...\n";
sf::SoundBuffer* newSoundBuffer = new sf::SoundBuffer;
newSoundBuffer->loadFromFile(fileName);
soundBufferArray.push_back(newSoundBuffer);
sf::Sound* newSound = new sf::Sound;
newSound->setBuffer(*newSoundBuffer);
soundArray.push_back(newSound);
}
void SoundManager::playSound(int n)
{
if (soundArray[n]->getStatus() != sf::Sound::Playing)
soundArray[n]->play();
}
void SoundManager::stopSound(int n)
{
if (soundArray[n]->getStatus() == sf::Sound::Playing)
soundArray[n]->stop();
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 11, 11:40 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68826
Default Alt Text
(4 KB)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline