PolitikerNEU jpg and png support! ( currently linux only ? )

Some little changes where I forgot to integrate the playername
Mousescroll is not longer super fast
This commit is contained in:
Titus Tscharntke
2010-03-23 23:32:25 +00:00
parent f18c73d371
commit ecc39ea911
24 changed files with 1454 additions and 100 deletions

View File

@@ -414,6 +414,15 @@ string extractDirectoryPathFromFile(string filename)
return filename.substr( 0, filename.rfind("/")+1 );
}
string extractExtension(const string& filepath) {
size_t lastPoint = filepath.find_last_of('.');
size_t lastDirectory = filepath.find_last_of('/');
if (lastPoint == string::npos || (lastDirectory != string::npos && lastDirectory > lastPoint)) {
return "";
}
return filepath.substr(lastPoint+1);
}
void createDirectoryPaths(string Path)
{
char DirName[256]="";

View File

@@ -270,13 +270,13 @@ bool isdir(const char *path)
bool EndsWith(const string &str, const string& key)
{
bool result = false;
if (str.length() > key.length()) {
result = (0 == str.compare (str.length() - key.length(), key.length(), key));
}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] result [%d] str = [%s] key = [%s]\n",__FILE__,__FUNCTION__,result,str.c_str(),key.c_str());
return result;
bool result = false;
if (str.length() > key.length()) {
result = (0 == str.compare (str.length() - key.length(), key.length(), key));
}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] result [%d] str = [%s] key = [%s]\n",__FILE__,__FUNCTION__,result,str.c_str(),key.c_str());
return result;
}
//finds all filenames like path and gets their checksum of all files combined
@@ -449,6 +449,17 @@ string extractDirectoryPathFromFile(string filename)
return filename.substr( 0, filename.rfind("/")+1 );
}
string extractExtension(const string& filepath) {
size_t lastPoint = filepath.find_last_of('.');
size_t lastDirectory_Win = filepath.find_last_of('\\');
size_t lastDirectory_Lin = filepath.find_last_of('/');
size_t lastDirectory = (lastDirectory_Win<lastDirectory_Lin)?lastDirectory_Lin:lastDirectory_Win;
if (lastPoint == string::npos || (lastDirectory != string::npos && lastDirectory > lastPoint)) {
return "";
}
return filepath.substr(lastPoint+1);
}
void createDirectoryPaths(string Path)
{
char DirName[256]="";
@@ -469,30 +480,30 @@ void createDirectoryPaths(string Path)
}
_mkdir(DirName);
}
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
// Get the current video hardware information
//const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
//colorBits = vidInfo->vfmt->BitsPerPixel;
//screenWidth = vidInfo->current_w;
/*
//screenHeight = vidInfo->current_h;
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
// Get the current video hardware information
//const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
//colorBits = vidInfo->vfmt->BitsPerPixel;
//screenWidth = vidInfo->current_w;
/*
//screenHeight = vidInfo->current_h;
int cx = GetSystemMetrics(SM_CXVIRTUALSCREEN);
// height
int cy = GetSystemMetrics(SM_CYVIRTUALSCREEN);
printf("cx = %d, cy = %d\n",cx,cy);
if(cx > screenWidth) {
screenWidth = cx;
screenHeight = cy;
}
*/
int iMaxWidth = -1;
int iMaxHeight = -1;
int iMaxBits = -1;
printf("cx = %d, cy = %d\n",cx,cy);
if(cx > screenWidth) {
screenWidth = cx;
screenHeight = cy;
}
*/
int iMaxWidth = -1;
int iMaxHeight = -1;
int iMaxBits = -1;
DEVMODE devMode;
for (int i=0; EnumDisplaySettings(NULL, i, &devMode) ;i++){
@@ -506,11 +517,11 @@ void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
}
}
if(iMaxWidth > 0) {
colorBits = iMaxBits;
screenWidth = iMaxWidth;
screenHeight = iMaxHeight;
}
}
colorBits = iMaxBits;
screenWidth = iMaxWidth;
screenHeight = iMaxHeight;
}
}
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
DEVMODE devMode;