aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2010-11-16COMMON: Make Common::Singleton::_singleton protected instead of publicMax Horn
svn-id: r54257
2010-11-15CONFIGMAN: added defragmentation methods for one-plugin-at-a-timeYotam Barnoy
One-plugin-at-a-time can have fragmentation caused by the ConfigManager if a game changes any configuration value. By reallocating and copying over the ConfigManager, we avoid this problem. svn-id: r54243
2010-11-13COMMON: Fix TranslationManagerThierry Crozat
Revision 54206 broke translations support because it uncovered a bug in the TranslationManager when reading the translations.dat file. In that file all the stored string lengths include the terminating 0 but Common::String expect a length without the terminating 0. Therefore all String objects created from reading the translations.dat file had an incorrect size. This caused the font file names to be wrong after adding the charset. svn-id: r54235
2010-11-11COMMON: Fix compilation when translation support is disabled (regression ↵Johannes Schickel
from r54207). svn-id: r54209
2010-11-11COMMON: Cleanup translation manager code; add FIXMEMax Horn
svn-id: r54206
2010-11-08COMMON: Push #include audiocd.h in system.h out to .cpp filesMax Horn
svn-id: r54148
2010-11-08BACKENDS: Partial merge of gsoc2010-opengl: Audio CD changes onlyMax Horn
This commit contains the AudioCDManager changes from the gsoc2010-opengl branch. The other changes in that branch are restricted to the backends directory only (plus configure). The Nintendo DS and Dreamcast ports still need to be ported over to the new Audio CD system, but that should be fairly easy to do. svn-id: r54147
2010-11-08COMMON: Make KeyState::hasFlags constMax Horn
svn-id: r54146
2010-11-07COMMON: Add const qualifiers and remove Common:: prefix in MacResManager codeMax Horn
svn-id: r54122
2010-11-07COMMON: Rename and tweak MD5 functionsMax Horn
* names now comply to our naming conventions * the function computeStreamMD5AsString which computes the MD5 as a hex string now returns it as a Common::String * add doxygen comments svn-id: r54121
2010-11-04COMMON: Undo changes to common/ptr.h, remove Common::ScopedPtrCMax Horn
The deletePointer() method approach cannot work, as it is called by the destructor of the base class. A possible correct solution would be to enhance ScopedPtr with a "deleter" object like SharedPtr. But this seems overkill as long as we need it in only one place. svn-id: r54057
2010-11-03Merge from gsoc2010-pluginsYotam Barnoy
This merge was extremely difficult to carry out. It wasn't entirely SVN's fault -- there were several merges to the branch that were done by hand. Please check for any issues and regressions. Also note that the DS makefile was not copied over since the "one at a time" plugin mode currently has too much fragmentation ie. it doesn't work. svn-id: r54051
2010-11-01COMMON: Get rid of the debug() output formatterMax Horn
Now Engine::errorString is only used by error(), as its name suggests. This also resolves the inconsistency between debug & debugN. svn-id: r54023
2010-11-01COMMON: Disable DEBUG_HASH_COLLISIONS (oops)Max Horn
svn-id: r54013
2010-11-01COMMON: Switch hexdump() to debugN instead of printfMax Horn
Rational: hexdump() is used for debug output. An even better alternative might be to change it to return a string, instead of printing anything. This way, it could be used inside e.g. GUI debug consoles. This is left as an exercise to the interested developer :). svn-id: r54010
2010-11-01COMMON: Switch ConfigManager::setInt & ConfigManager::registerDefault to use ↵Max Horn
String::format svn-id: r54009
2010-11-01COMMON: Add debugN variant without level parameterMax Horn
This makes our various debug*() functions fully symmetric, for now. svn-id: r54008
2010-11-01COMMON: Rename String::printf() to String::format()Max Horn
This is a first step towards getting rid of all uses of regular printf, fprintf, vprintf, vfprintf, puts, fputs, etc. in our codebase. The name format() reflects the purpose of the function, and parallels String.format() in Java, boost::format, and others. svn-id: r54004
2010-11-01COMMON: Change some (f)printf to debug calls; clenaup hashmap.hMax Horn
svn-id: r54003
2010-10-31COMMON: Document forbidden.hMax Horn
svn-id: r53990
2010-10-31COMMON: Allow forbidden symbols in debug.cpp and textconsole.cppMax Horn
This is currently necessary for the PS2 port and possibly others. svn-id: r53989
2010-10-31Updated with latest from trunkYotam Barnoy
svn-id: r53976
2010-10-30ALL: Add code to help stop people from accidentally using "bad" APIsMax Horn
A new header file common/forbidden.h is included by scummsys.h and it re-#defines numerous symbols like fopen(), fread(), system(), etc. with garbage, in order to provoke compile errors in any code using them. If a .cpp file really *must* use any of these (e.g. because it is a backend file), then these redefinitions can be disabled by #defining FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever this is done, an explanatory comment should be added. Note that this system cannot catch all "bad" usages (notably the Lua code in the sword25 engine), as it can only work if scummsys.h is included. svn-id: r53961
2010-10-30COMMON: Add SCUMMVM_CURRENT_FUNCTION macro (useful for debugging)Max Horn
svn-id: r53931
2010-10-24ALL: Fix various typos (patch #3093266)Max Horn
svn-id: r53762
2010-10-18Revert "COMMON: Implement Common::vprintf(). Patch by littleboy"Eugene Sandulenko
svn-id: r53586
2010-10-18COMMON: Implement Common::vprintf(). Patch by littleboyEugene Sandulenko
svn-id: r53576
2010-10-15COMMON: Made some constructors explicit, where we wouldn't really like ↵Johannes Schickel
implicit conversion. svn-id: r53508
2010-10-15COMMON: Extend workaround in HashMap code for sgi IRIX MIPSpro to also apply ↵Johannes Schickel
for Intel's C++ compiler. svn-id: r53507
2010-10-15COMMON: Revert attempt to silence MSVC warning in Common::gcd.Johannes Schickel
svn-id: r53506
2010-10-15COMMON: Silence gcc warning introduced with r53496.Johannes Schickel
svn-id: r53497
2010-10-15COMMON: Attempt to silence MSVC warning in Common::gcd.Johannes Schickel
svn-id: r53496
2010-10-15COMMON: Move XMLParser method impls to .cpp file; make skipComments non-virtualMax Horn
svn-id: r53480
2010-10-15COMMON: Add XMLParser::parseIntegerKey variant accepting a Common::StringMax Horn
Almost all places where we used XMLParser::parseIntegerKey were using it like this: XMLParser::parseIntegerKey(str.c_str(), ...) Since this makes the code harder to read, I overloaded the method to also accept Commmon::String directly. Also removed all .c_str() invocations where necessary. svn-id: r53479
2010-10-13OPENGL: Merged from trunk, from rev 52105 to 53396.Johannes Schickel
This includes an rather hacky attempt to merge all the recent gp2x backend changes into the branch. I suppose the gp2x backend and probably all new backends, i.e. gph, dingux etc., might not compile anymore. Since I have no way of testing those it would be nice if porters could look into getting those up to speed in this branch. svn-id: r53399
2010-10-12JANITORAL: Clean trailing whitespaces.Jordi Vilalta Prat
svn-id: r53160
2010-10-10COMMON: work around different vsnprintf behaviour on IRIXJoost Peters
The return value of vsnprintf when the provided buffer is not large enough to hold the formatted string is implementation-dependent: C99: The size the formatted string would take up. MSVC: -1, with no indication of how large the buffer should be. IRIX: The number of characters actually written, which is at most the size of the buffer minus one, as the string is truncated to fit. This means the only way to be sure the entire string is written is if the return value is less than the capacity - 1. This change means that whenever we try to format a string where the size is 1 below the built-in capacity, that the capacity will be needlessly increased. If this turns out to be problematic we could make this behaviour __sgi conditional. svn-id: r53143
2010-10-03SCI: Allow multiple word groups in parserWillem Jan Palenstijn
In SCI01 and up, each typed word may be interpreted as multiple class,group pairs. This patch adds support to the vocabulary and parser. It uses the matcher support added in r52985. This fixes parser issues in German LSL3, but needs testing. svn-id: r52989
2010-10-01GUI: Fix bug #3075649 (Fonts not found with built-in theme)Thierry Crozat
When switching to a theme that do not have the fonts needed to properly display the current language, it now revert to the previously used theme and display an error message telling the user to change the language first if he wants to use the theme he selected. svn-id: r52969
2010-09-20PSP: switch from wrapping memcpy to defining our own memcpyYotam Barnoy
The advantage is that we get to do inlining and even use lwl and lwr instructions where appropriate. We have to do it ourselves because the PSP doesn't tolerate built-in instructions, but also we have a more efficient memcpy than the lib's. svn-id: r52817
2010-09-17COMMON: Extend getting a Mac resource fork resource with a nameMatthew Hoops
Resource names can be the same across types (ie. 'PICT' "Foo" and 'snd ' "Foo"), so this ensures that the right type is chosen in those cases. svn-id: r52756
2010-09-14COMMON: remove virtual functions from BufferedStreamsYotam Barnoy
As Max pointed out to me, they don't work as expected when called from constructors/destructors. svn-id: r52724
2010-09-14COMMON: Remove dangerous virtual keywords.Willem Jan Palenstijn
See r52722. svn-id: r52723
2010-09-11COMMON: Fix int-Rational operatorsSven Hesse
svn-id: r52675
2010-09-07COMMON: Fix edge case for wildcard in matchStringWillem Jan Palenstijn
svn-id: r52618
2010-09-07COMMON: Remove Rational::operator int/doubleWillem Jan Palenstijn
This prevents accidental implicit rounding and might also fix compilation on AmigaOS4 (bug #3060981). svn-id: r52616
2010-09-06COMMON: Add a debugPrint function to RationalMatthew Hoops
svn-id: r52593
2010-09-06PLUGINS: used variation of ScopedPtr to clean up load() functionYotam Barnoy
svn-id: r52592
2010-09-04COMMON: Fix Rational::operator!=(int)Matthew Hoops
svn-id: r52535
2010-09-01COMMON: changed read/write endian function to use __may_alias__ attributeYotam Barnoy
This is a better solution for the gcc aliasing problem that happens when aliasing a struct onto something else. What happens is that the compiler assumes no aliasing can happen when -O2 and -O3 are activated, and a call to READ_UINT32() followed by WRITE_UINT32() and another READ_UINT32() will be optimized to return the original read value instead of re-reading. svn-id: r52480