Commit Graph

207 Commits

Author SHA1 Message Date
Johannes Schickel
ed40653105 CGE: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Strangerke
a1ab4cb062 CGE: Reduce the scope of some variables 2014-02-09 11:22:21 +01:00
D G Turner
ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
Strangerke
2f333f997b CGE: Ensure string copy don't overrun. Fix CID 1003674 to 1003678 2013-11-10 09:57:42 +01:00
Johannes Schickel
c874721109 CGE: Take advantage of Surface::getPixels. 2013-08-03 04:02:50 +02:00
Johannes Schickel
1f0832b4f2 CGE: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 02:52:32 +02:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Strangerke
6472ef86bb CGE: Fix bug #3557904 - Shadow at wrong position 2012-09-05 08:12:14 +02:00
Strangerke
5c522575c7 CGE: Keep Soltys' position when saving 2012-08-05 22:24:32 +02:00
Strangerke
de752a5336 CGE: Fix bug #3547274 - missing travel buttons after save 2012-08-04 23:51:27 +02:00
Strangerke
b1cc34a080 CGE: Remove hack used to store keycode in CGEEvent 2012-07-05 21:31:42 +02:00
Strangerke
d73ed91051 CGE: Remove unused Demo text id 2012-06-28 07:25:56 +02:00
Strangerke
647bc59f99 CGE: Rename variable 2012-06-28 07:19:54 +02:00
Strangerke
f32c9a7735 CGE: Fix bug 3538039 - level buttons not pressed 2012-06-27 01:15:32 +02:00
Strangerke
ad2b898eb3 CGE: Remove dead code originally used to load a savegame when starting the game 2012-06-18 20:59:52 +02:00
D G Turner
b01d712a63 CGE: Close memory leak in savegame loading. 2012-03-28 01:51:56 +01:00
D G Turner
83d4eeadc6 CGE: Close memory leak in savegame thumbnail loading. 2012-03-28 00:10:56 +01:00
Thierry Crozat
b419f73973 CGE: Fix issue with music not stopping when reloading game
If you turn off the music and then save a game, then turn on the music
again and then load the saved game, the music from the scene continue
to play despite the _music flag being false. So the first time you click on
the music on/off button the music restart and only the second time
does it stop. This fixes the bug by stoping the music before reloading
a game.
2011-12-07 07:59:19 +00:00
Strangerke
14cdd034a8 CGE: Fix an assert in intro 2011-12-03 18:25:10 +01:00
Strangerke
816b65ff2c CGE: Soltys - Fix initialization of a couple of bool variables 2011-12-03 17:52:05 +01:00
Strangerke
ab2e5015af CGE: Soltys - Fix for bug #3448836 (losing scene number display after loading and changing scene) 2011-12-03 14:55:04 +01:00
Strangerke
22263bd763 CGE: Only skips animations when pressing ESC.
This should allow tsoliman to see the end of the intro
2011-11-30 21:21:34 +01:00
Strangerke
a12ba5f6a6 CGE: Simplify keyboard handling 2011-11-30 19:52:19 +01:00
Strangerke
7320066113 CGE: Remove key sound in System::touch().
ALTering dice no longer is no longer noisy
2011-11-29 23:27:35 +01:00
Paul Gilbert
37756c9ffe CGE: Better fix for restoring savegames when a cut-scene is active 2011-11-27 22:16:52 +11:00
Strangerke
3d59d9a137 CGE: Add RTL, hook Main Menu to right click on audio button 2011-11-16 00:00:07 +01:00
Strangerke
d2027b0290 CGE: Rename a structure member using double-underscore (reserved)
Also removed a useless comment
2011-11-14 18:24:46 +01:00
Strangerke
c6c9620ff2 CGE: Remove some useless constants 2011-11-13 12:48:09 +01:00
Paul Gilbert
17027a7afc CGE: Properly stop player moving when saving or restoring 2011-11-09 19:34:43 +11:00
Eugene Sandulenko
558a499a02 CGE: Fix warning 2011-11-03 00:03:04 +00:00
Strangerke
727afcf4bd CGE: Add some doxygen comments 2011-10-22 06:30:04 +02:00
Strangerke
2d882fdf18 CGE: Rename Snail into CommandHandler, plus some associated renamings 2011-09-18 11:25:34 +02:00
Strangerke
17802f8903 CGE: Fix a potential bug in insertCommand(), some renaming 2011-09-17 23:04:12 +02:00
Strangerke
ff0185d038 CGE: Remove a use reference to g_engine
Thanks fuzzie for mentioning it
2011-09-17 18:22:35 +02:00
Strangerke
d574cfe272 CGE: Move _talk and _text to CGEEngine 2011-09-17 17:27:05 +02:00
Strangerke
3583c949f2 CGE: Move some more globals to CGEEngine 2011-09-17 17:17:22 +02:00
Strangerke
38deee5a88 CGE: some more cleanup 2011-09-17 11:09:32 +02:00
Strangerke
4778ff720c CGE: Move some more globals to CGEEngine 2011-09-17 10:54:50 +02:00
Strangerke
f5eca79658 CGE: Move 4 global to CGEEngine 2011-09-17 10:08:52 +02:00
Strangerke
0668a56f69 CGE: Move _vga to CGEEngine 2011-09-16 23:54:08 +02:00
Strangerke
938c08ae58 CGE: Get rid of some more global functions and static members 2011-09-16 20:31:39 +02:00
Strangerke
70c5b695df CGE: move two global functions to Vga 2011-09-16 07:55:50 +02:00
Strangerke
15bf8050b8 CGE: Move two globals functions to CGEEngine 2011-09-16 06:45:53 +02:00
Strangerke
c993108207 CGE: Transform some static and globals into class members 2011-09-15 08:00:54 +02:00
Strangerke
d28ac81a12 CGE: Rename cave into scene 2011-09-14 08:15:30 +02:00
Strangerke
dd0e077bd7 CGE: Remove useless function 2011-09-14 00:21:10 +02:00
Strangerke
82e0b6fc4b CGE: Rewrite fileIO 2011-09-14 00:10:59 +02:00
Strangerke
dd75ebd96b CGE: Remove dead code reported by clang++
Thanks LordHoto and salty-horse for reporting the problem
2011-09-13 00:48:01 +02:00
Strangerke
5d8bbc2f48 CGE: Remove IoBuf and CFile 2011-09-13 00:07:00 +02:00
Strangerke
5c256f9689 CGE: Remove some more VFiles 2011-09-11 22:13:00 +02:00