mirror of
https://github.com/glest/glest-source.git
synced 2025-10-04 11:21:36 +02:00
- added ability to switch languages from nearly anywhere (and new hotkeys to do so):
CTRL+L shows language popup selection, CTRL+SHIFT+L toggles to next language automatically
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "graphics_interface.h"
|
||||
#include "graphics_factory.h"
|
||||
#include <stdexcept>
|
||||
#include "leak_dumper.h"
|
||||
|
||||
namespace Shared { namespace Graphics {
|
||||
@@ -40,6 +41,26 @@ Font3D *FontManager::newFont3D() {
|
||||
return font;
|
||||
}
|
||||
|
||||
void FontManager::endFont(Font *font,bool mustExistInList) {
|
||||
if(font != NULL) {
|
||||
bool found = false;
|
||||
for(unsigned int i=0; i < fonts.size(); ++i) {
|
||||
if(fonts[i] != NULL && font == fonts[i]) {
|
||||
found = true;
|
||||
fonts.erase(fonts.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false && mustExistInList == true) {
|
||||
throw std::runtime_error("found == false in endFont");
|
||||
}
|
||||
if(found == true) {
|
||||
font->end();
|
||||
delete font;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FontManager::init() {
|
||||
for(size_t i=0; i<fonts.size(); ++i) {
|
||||
if(fonts[i] != NULL) {
|
||||
|
Reference in New Issue
Block a user