diff --git a/mk/cmake/Modules/FindLIBVLC.cmake b/mk/cmake/Modules/FindLIBVLC.cmake index 11e7c0b9f..b27a92240 100644 --- a/mk/cmake/Modules/FindLIBVLC.cmake +++ b/mk/cmake/Modules/FindLIBVLC.cmake @@ -77,7 +77,7 @@ find_library(LIBVLCCORE_LIBRARY NAMES ${LIBVLC_LIB_CORE_NAMES}) set(LIBVLC_VERSION ${PC_LIBVLC_VERSION}) if (NOT LIBVLC_VERSION) -# TODO: implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...) +# implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...) endif (NOT LIBVLC_VERSION) if (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY) @@ -86,7 +86,7 @@ endif (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY) if (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}") message(WARNING "LibVLC version not found: version searched: ${LIBVLC_MIN_VERSION}, found ${LIBVLC_VERSION}\nUnless you are on Windows this is bound to fail.") -# TODO: only activate once version detection can be garunteed (which is currently not the case on windows) +# only activate once version detection can be garunteed (which is currently not the case on windows) # set(LIBVLC_FOUND FALSE) endif (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}") diff --git a/mk/cmake/Modules/FindwxWidgets.cmake b/mk/cmake/Modules/FindwxWidgets.cmake index 75866fea7..c00444ab5 100644 --- a/mk/cmake/Modules/FindwxWidgets.cmake +++ b/mk/cmake/Modules/FindwxWidgets.cmake @@ -115,7 +115,6 @@ # Jan Woetzel (FindwxWindows.cmake), # Jorgen Bodde and Jerry Fath (FindwxWin.cmake). -# TODO/ideas # # (1) Option/Setting to use all available wx libs # In contrast to expert developer who lists the diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index d466028f0..eab304b74 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1170,7 +1170,6 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { } } else if (checkBoxAdvanced.mouseClick(x, y)) { - //TODO } else if(listBoxTileset.mouseClick(x, y,advanceToItemStartingWith)) { MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 9b40a569f..fa0488c78 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -1595,7 +1595,6 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxPoint& pos) { m_sizerText = NULL; - // TODO: should we use main frame as parent by default here? if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, style) ) { diff --git a/source/glest_map_editor/program.cpp b/source/glest_map_editor/program.cpp index 7e3cfc590..4c70945e9 100644 --- a/source/glest_map_editor/program.cpp +++ b/source/glest_map_editor/program.cpp @@ -180,7 +180,6 @@ int Program::getResource(int x, int y) { } } -// TODO: move editor-specific code from shared_lib to here. void Program::glestChangeMapHeight(int x, int y, int Height, int radius) { if(map) map->glestChangeHeight((x - ofsetX) / cellSize, (y + ofsetY) / cellSize, Height, radius); } diff --git a/source/glest_map_editor/program.h b/source/glest_map_editor/program.h index d2229e95c..22b69f1da 100644 --- a/source/glest_map_editor/program.h +++ b/source/glest_map_editor/program.h @@ -48,7 +48,7 @@ class UndoPoint { private: // Only keep a certain number of undo points in memory otherwise // Big projects could hog a lot of memory - const static int MAX_UNDO_LIST_SIZE = 100; // TODO get feedback on this value + const static int MAX_UNDO_LIST_SIZE = 100; static int undoCount; ChangeType change; diff --git a/source/shared_lib/include/graphics/FileReader.h b/source/shared_lib/include/graphics/FileReader.h index 122a849de..bfe289af6 100644 --- a/source/shared_lib/include/graphics/FileReader.h +++ b/source/shared_lib/include/graphics/FileReader.h @@ -148,7 +148,7 @@ static inline T* readFromFileReaders(vector const *>* readers, con #else ifstream file(filepath.c_str(), ios::in | ios::binary); #endif - if (!file.is_open()) { //An error occured; TODO: Which one - throw an exception, print error message? + if (!file.is_open()) { throw megaglest_runtime_error("[#1] Could not open file " + filepath); } for (typename vector const *>::const_iterator i = readers->begin(); i != readers->end(); ++i) { @@ -158,10 +158,10 @@ static inline T* readFromFileReaders(vector const *>* readers, con FileReader const * reader = *i; ret = reader->read(file, filepath); //It is guaranteed that at least the filepath matches ... } - catch (megaglest_runtime_error &ex) { //TODO: Specific exceptions + catch (megaglest_runtime_error &ex) { throw; } - catch (...) { //TODO: Specific exceptions + catch (...) { continue; } if (ret != NULL) { @@ -191,7 +191,7 @@ static inline T* readFromFileReaders(vector const *>* readers, con #else ifstream file(filepath.c_str(), ios::in | ios::binary); #endif - if (!file.is_open()) { //An error occured; TODO: Which one - throw an exception, print error message? + if (!file.is_open()) { #if defined(WIN32) && !defined(__MINGW32__) DWORD error = GetLastError(); throw megaglest_runtime_error("[#2] Could not open file, result: " + intToStr(error) + " - " + intToStr(fileErrno) + " [" + filepath + "]"); @@ -206,10 +206,10 @@ static inline T* readFromFileReaders(vector const *>* readers, con FileReader const * reader = *i; ret = reader->read(file, filepath, object); //It is guaranteed that at least the filepath matches ... } - catch (megaglest_runtime_error &ex) { //TODO: Specific exceptions + catch (megaglest_runtime_error &ex) { throw; } - catch (...) { //TODO: Specific exceptions + catch (...) { continue; } if (ret != NULL) { @@ -329,7 +329,7 @@ bool FileReader::canRead(ifstream& file) const { delete wouldRead; return ret; } - catch (megaglest_runtime_error &ex) { //TODO: Specific exceptions + catch (megaglest_runtime_error &ex) { throw; } catch (...) { @@ -350,7 +350,7 @@ T* FileReader::read(const string& filepath) const { #else ifstream file(filepath.c_str(), ios::in | ios::binary); #endif - if (!file.is_open()) { //An error occured; TODO: Which one - throw an exception, print error message? + if (!file.is_open()) { throw megaglest_runtime_error("[#3] Could not open file " + filepath); } T* ret = read(file,filepath); @@ -375,7 +375,7 @@ T* FileReader::read(const string& filepath, T* object) const { #else ifstream file(filepath.c_str(), ios::in | ios::binary); #endif - if (!file.is_open()) { //An error occured; TODO: Which one - throw an exception, print error message? + if (!file.is_open()) { throw megaglest_runtime_error("[#4] Could not open file " + filepath); } T* ret = read(file,filepath,object); diff --git a/source/shared_lib/include/platform/sdl/data_types.h b/source/shared_lib/include/platform/sdl/data_types.h index 8a7d37481..3d43cfc17 100644 --- a/source/shared_lib/include/platform/sdl/data_types.h +++ b/source/shared_lib/include/platform/sdl/data_types.h @@ -41,7 +41,7 @@ #define MG_I64_SPECIFIER "%" PRId64"" #define MG_I64U_SPECIFIER "%" PRIu64"" #else - // TODO figure out which to use. + #if NUMBITS == 32 #define MG_SIZE_T_SPECIFIER "%lu" #define MG_SSIZE_T_SPECIFIER "%ld" diff --git a/source/shared_lib/include/streflop/CMakeLists.txt b/source/shared_lib/include/streflop/CMakeLists.txt index 54e969f35..710e5fed7 100644 --- a/source/shared_lib/include/streflop/CMakeLists.txt +++ b/source/shared_lib/include/streflop/CMakeLists.txt @@ -13,4 +13,3 @@ ADD_LIBRARY(streflop STATIC EXCLUDE_FROM_ALL ${libm_flt32_source} ) set_target_properties(streflop PROPERTIES COMPILE_FLAGS "${PIC_FLAG}") -#TODO do not use -fPIC for streflop (decreases performance) diff --git a/source/shared_lib/include/streflop/System.h b/source/shared_lib/include/streflop/System.h index ee04aeb42..d204c132e 100644 --- a/source/shared_lib/include/streflop/System.h +++ b/source/shared_lib/include/streflop/System.h @@ -19,7 +19,7 @@ #define __BYTE_ORDER 1234 #define __FLOAT_WORD_ORDER 1234 -// Softfloat or other unknown FPU. TODO: Try some header autodetect? +// Softfloat or other unknown FPU. #else #define __BYTE_ORDER 1234 diff --git a/source/shared_lib/include/xml/rapidxml/rapidxml.hpp b/source/shared_lib/include/xml/rapidxml/rapidxml.hpp index fa7a79d62..48ce5f5ea 100644 --- a/source/shared_lib/include/xml/rapidxml/rapidxml.hpp +++ b/source/shared_lib/include/xml/rapidxml/rapidxml.hpp @@ -1519,7 +1519,7 @@ namespace rapidxml if (Flags & parse_no_utf8) { // Insert 8-bit ASCII character - // Todo: possibly verify that code is less than 256 and use replacement char otherwise? + // possibly verify that code is less than 256 and use replacement char otherwise? text[0] = static_cast(code); text += 1; } diff --git a/source/shared_lib/sources/feathery_ftp/ftpCmds.c b/source/shared_lib/sources/feathery_ftp/ftpCmds.c index cb99e7844..d55f613b9 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpCmds.c +++ b/source/shared_lib/sources/feathery_ftp/ftpCmds.c @@ -232,8 +232,6 @@ LOCAL int ftpCmdPort(int sessionId, const char* args, int len) break; } } - // TODO Derzeit wird die übergebene IP nicht beachtet, sondern nur die IP des Control-Sockets verwendet - //clientIp[0] = clientIp[0]; if(ftpGetSession(sessionId)->passiveDataSocket >= 0) { if(VERBOSE_MODE_ENABLED) printf("In ftpCmdPort about to Close socket = %d for sessionId = %d\n",ftpGetSession(sessionId)->passiveDataSocket,sessionId); diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c index 6eb7fc84e..fba3057a0 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c @@ -480,7 +480,6 @@ int ftpUntrackSocket(socket_t s) { FD_CLR(s, &watchedSockets); } - // TODO hier sollte eine Möglichkeit geschaffen werden um maxSockNr anzupassen return 0; } diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 83f1ed811..f10f51be5 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -514,7 +514,6 @@ int ftpUntrackSocket(socket_t s) { FD_CLR(s, &watchedSockets); } - // TODO hier sollte eine Möglichkeit geschaffen werden um maxSockNr anzupassen return 0; } diff --git a/source/shared_lib/sources/graphics/JPGReader.cpp b/source/shared_lib/sources/graphics/JPGReader.cpp index e7d944819..6af184e20 100644 --- a/source/shared_lib/sources/graphics/JPGReader.cpp +++ b/source/shared_lib/sources/graphics/JPGReader.cpp @@ -139,8 +139,8 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const int picComponents = (ret->getComponents() == -1)?cinfo.num_components:ret->getComponents(); //std::cout << "JPG-Components: Pic: " << picComponents << " old: " << (ret->getComponents()) << " File: " << cinfo.num_components << std::endl; //picComponents = 4; - //TODO: Irrlicht has some special CMYK-handling - maybe needed too? - /* Start decompression jpeg here */ + + // Start decompression jpeg here jpeg_start_decompress( &cinfo ); ret->init(cinfo.image_width, cinfo.image_height, picComponents); uint8* pixels = ret->getPixels(); @@ -175,7 +175,7 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const a = row_pointer[0][xFile+3]; break; default: - //TODO: Error + // Possible Error case 1: r = g = b = l = row_pointer[0][xFile]; a = 255; @@ -198,7 +198,7 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const pixels[location+xPic+i] = l; } break; - //TODO: Error + // Possible Error } } } diff --git a/source/shared_lib/sources/graphics/PNGReader.cpp b/source/shared_lib/sources/graphics/PNGReader.cpp index f8a004d79..1544f8a78 100644 --- a/source/shared_lib/sources/graphics/PNGReader.cpp +++ b/source/shared_lib/sources/graphics/PNGReader.cpp @@ -165,7 +165,7 @@ Pixmap2D* PNGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const a = row_pointers[y][xFile+3]; break; default: - //TODO: Error + // Possible Error case 1: r = g = b = l = row_pointers[y][xFile]; a = 255; @@ -188,7 +188,7 @@ Pixmap2D* PNGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const pixels[location+xPic+i] = l; } break; - //TODO: Error + // Possible Error } } } @@ -322,7 +322,7 @@ Pixmap3D* PNGReader3D::read(ifstream& is, const string& path, Pixmap3D* ret) con a = row_pointers[y][xFile+3]; break; default: - //TODO: Error + // Possible Error case 1: r = g = b = l = row_pointers[y][xFile]; a = 255; @@ -345,7 +345,7 @@ Pixmap3D* PNGReader3D::read(ifstream& is, const string& path, Pixmap3D* ret) con pixels[location+xPic+i] = l; } break; - //TODO: Error + // Possible Error } } } diff --git a/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c b/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c index 4dcdc8ab4..0430cc418 100644 --- a/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c +++ b/source/shared_lib/sources/graphics/freetype-gl/edtaa3func.c @@ -86,7 +86,7 @@ void computegradient(double *img, int w, int h, double *gx, double *gy) } } } - // TODO: Compute reasonable values for gx, gy also around the image edges. + // Compute reasonable values for gx, gy also around the image edges. // (These are zero now, which reduces the accuracy for a 1-pixel wide region // around the image edge.) 2x2 kernels would be suitable for this. } diff --git a/source/shared_lib/sources/graphics/texture.cpp b/source/shared_lib/sources/graphics/texture.cpp index b8903a3a8..07d65f716 100644 --- a/source/shared_lib/sources/graphics/texture.cpp +++ b/source/shared_lib/sources/graphics/texture.cpp @@ -60,7 +60,7 @@ void Texture1D::load(const string &path){ this->path= path; if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] this->path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->path.c_str()); - if (pixmap.getComponents() == -1) { //TODO: look where you really need that + if (pixmap.getComponents() == -1) { pixmap.init(defaultComponents); } pixmap.load(path); @@ -179,8 +179,9 @@ std::pair Texture2D::CreateSDLSurface(bool newPixel int ybegin = 0; int yend = image->h - 1; - // TODO: consider if this lock is legal/appropriate - if (SDL_MUSTLOCK(image)) { SDL_LockSurface(image); } + if (SDL_MUSTLOCK(image)) { + SDL_LockSurface(image); + } while (ybegin < yend) { memcpy(line, pixels + pitch*ybegin, pitch); memcpy(pixels + pitch*ybegin, pixels + pitch*yend, pitch); @@ -188,7 +189,9 @@ std::pair Texture2D::CreateSDLSurface(bool newPixel ybegin++; yend--; } - if (SDL_MUSTLOCK(image)) { SDL_UnlockSurface(image); } + if (SDL_MUSTLOCK(image)) { + SDL_UnlockSurface(image); + } // if (freeSource) { // SDL_FreeSurface(surface); diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 5421a32da..9e866a913 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -1754,7 +1754,6 @@ bool isKeyDown(int virtualKey) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = %d\n",__FILE__,__FUNCTION__,__LINE__,key); - // kinda hack and wrong... if(key >= 0) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] keystate[key] = %d\n",__FILE__,__FUNCTION__,__LINE__,keystate[(unsigned char)key]); diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index deb4e35dc..5376fb152 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -37,9 +37,8 @@ namespace Shared{ namespace Platform{ // WINDOW // ======================================= -// ========== STATIC INICIALIZATIONS ========== +// ========== STATIC INITIALIZATIONS ========== -// Matze: hack for now... static Window* global_window = 0; static int oldX=0,oldY=0; int64 Window::lastMouseEvent = 0; /** for use in mouse hover calculations */ diff --git a/source/shared_lib/sources/streflop/SMath.cpp b/source/shared_lib/sources/streflop/SMath.cpp index ceb4def24..feec25fdf 100644 --- a/source/shared_lib/sources/streflop/SMath.cpp +++ b/source/shared_lib/sources/streflop/SMath.cpp @@ -18,13 +18,13 @@ namespace streflop { const Simple SimpleZero(0.0f); const Simple SimplePositiveInfinity = Simple(1.0f) / SimpleZero; const Simple SimpleNegativeInfinity = Simple(-1.0f) / SimpleZero; - // TODO: non-signaling version + // non-signaling version const Simple SimpleNaN = SimplePositiveInfinity + SimpleNegativeInfinity; const Double DoubleZero(0.0f); const Double DoublePositiveInfinity = Double(1.0f) / DoubleZero; const Double DoubleNegativeInfinity = Double(-1.0f) / DoubleZero; - // TODO: non-signaling version + // non-signaling version const Double DoubleNaN = DoublePositiveInfinity + DoubleNegativeInfinity; // Extended are not always available @@ -33,7 +33,7 @@ namespace streflop { const Extended ExtendedZero(0.0f); const Extended ExtendedPositiveInfinity = Extended(1.0f) / ExtendedZero; const Extended ExtendedNegativeInfinity = Extended(-1.0f) / ExtendedZero; - // TODO: non-signaling version + // non-signaling version const Extended ExtendedNaN = ExtendedPositiveInfinity + ExtendedNegativeInfinity; #endif diff --git a/source/shared_lib/sources/util/string_utils.cpp b/source/shared_lib/sources/util/string_utils.cpp index 3cb39860f..750517471 100644 --- a/source/shared_lib/sources/util/string_utils.cpp +++ b/source/shared_lib/sources/util/string_utils.cpp @@ -102,10 +102,8 @@ namespace Shared { namespace Util { // Empty the container if (emptyBefore) out.clear(); - // TODO This method should be rewritten for better performance String s(*this); - while (!s.empty()) - { + while (!s.empty()) { String::size_type i = s.find_first_of(separators); if (i == std::string::npos) { @@ -126,10 +124,8 @@ namespace Shared { namespace Util { // Empty the container if (emptyBefore) out.clear(); - // TODO This method should be rewritten for better performance String s(*this); - while (!s.empty()) - { + while (!s.empty()) { String::size_type i = s.find_first_of(separators); if (i == std::string::npos) { @@ -488,7 +484,7 @@ namespace Shared { namespace Util { char* ret = ConvertToUTF8(s.c_str(), s.size()); if (ret) { - String s(ret); // TODO Find a way to not use a temporary string + String s(ret); delete[] ret; return s; }