Commit graph

1311 commits

Author SHA1 Message Date
Johannes Schickel
71bdb86e02 Merge pull request #16 "Add a PixelFormat to Graphics::Surface.".
For further discussion check here:
https://github.com/scummvm/scummvm/pull/16

Conflicts:
	graphics/png.cpp
2011-05-01 16:54:45 +02:00
D G Turner
96965b4896 PARALLACTION: Fix BRA Compilation After Common Header Changes. 2011-04-30 18:12:50 +01:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Ori Avtalion
cd6ee0589d JANITORIAL: Format forward declarations to follow convention 2011-04-28 12:20:34 +03:00
Max Horn
73f04118f3 COMMON: Rename Error to ErrorCode, introduce new Error class 2011-04-18 18:22:02 +02:00
Johannes Schickel
9734c7be64 PARALLACTION: Prefer Surface::create taking a PixelFormat over the one taking a byte depth. 2011-04-17 16:30:12 +02:00
Max Horn
0ce2ca4e00 COMMON: Replace MKID_BE by MKTAG
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.
2011-04-12 16:53:15 +02:00
Max Horn
7949d7c6de AUDIO: Move more common code to Audio::MidiPlayer
This also should fix some regressions from the previous
commits, related to MidiParser's either being leaked,
or being deleted and then used again (i.e., crashing).

I tested as many games as I had available, but further
testing of all affected engines is called for anyway.
2011-03-25 14:15:53 +01:00
Max Horn
9ffc4e0151 PARALLACTION: Move MidiDriver creation into MidiPlayer(_MSC) constructors 2011-03-25 14:15:47 +01:00
Max Horn
7cc04f25ff PARALLACTION: Change MidiPlayer impls to derive from Audio::MidiPlayer 2011-03-24 16:46:47 +01:00
Max Horn
e70fd59b35 ENGINES: Further simplify pseudo MidiDrivers; fix some regressions
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.

This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.
2011-03-23 16:49:41 +01:00
Max Horn
29847ea42d AUDIO: Change several fake MidiDrivers to MidiDriver_BASE subclasses
Many engines follow the advice in audio/midiparser.h and create a
"pseudo-MidiDriver" subclass. But MidiParser really only needs a tiny
subset of the MidiDriver capabilities, namely those found in
MidiDriver_BASE. So we try to subclass from that whenever possible; this
allows us to remove many stub methods, and enables further future
simplifications.
2011-03-23 15:25:47 +01:00
Max Horn
7b02dac3c5 ENGINES: Use Common::StackLock in more places 2011-03-23 15:25:46 +01:00
Max Horn
8982fff1b7 AUDIO: Add pure virtual MidiDriver::isOpen() method
This in turn enables modifying MidiDriver_MPU401::close() to allow
it to be called on a midi driver that has not yet been opened.

The specific issue that triggered me to make these changes was a
crash-upon-quit in HUGO, caused by it instantiating a midi driver,
then encountering an error (missing hugo.dat) *before* having
opened the new midi driver; the general cleanup code then tries
to close the (not yet opened) midi driver -> kaboom

Also fixed some engines which were leaking MidiDriver instances.
2011-03-22 23:51:47 +01:00
dhewg
5b6479c55a PARALLACTION: Init volume levels on startup 2011-03-19 16:04:55 +01:00
Johannes Schickel
e21d6e0d11 Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts:
	backends/platform/android/android.cpp
	engines/sci/graphics/screen.cpp
	engines/sci/graphics/transitions.cpp
2011-02-19 21:46:45 +01:00
Alyssa Milburn
145b0d83df PARALLACTION: Use signed math in fadeTo.
This fixes corruption during fades when low palette values end up negative.
2011-02-16 16:00:44 +01:00
Johannes Schickel
c44538a01e PARALLACTION: Fix half bright palette.
Thanks to peres for pointing this out to me.
2011-02-16 02:00:00 +01:00
Johannes Schickel
51c8871b9b PARALLACTION: Adapt to setPalette RGBA->RGB change.
This change is not tested, but should hopefully work fine.
2011-02-14 17:08:32 +01:00
Ori Avtalion
84a8bdc86b JANITORIAL: Remove duplicate #include's
svn-id: r55889
2011-02-12 10:00:52 +00:00
Max Horn
42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Nicola Mettifogo
1a525d1bb7 PARALLACTION: Avoid hiding overloaded virtual methods.
svn-id: r55820
2011-02-08 01:44:03 +00:00
Max Horn
2d1c8a3533 ALL: Fix whitespaces / indention
svn-id: r55818
2011-02-07 23:01:06 +00:00
Max Horn
41121be4d6 GUI: Rename SaveLoadChooser::runModal to runModalWithPluginAndTarget
This avoids hiding an overloaded virtual method, which in turn can
cause weird bugs (see also the next commit).

svn-id: r55815
2011-02-07 22:58:22 +00:00
Max Horn
ab039812e7 COMMON: OSystem now has a PaletteManager
svn-id: r55806
2011-02-07 17:52:38 +00:00
Nicola Mettifogo
ec03425c0f PARALLACTION: update MIDI driver commands description for BRA.
svn-id: r55792
2011-02-06 10:17:54 +00:00
Nicola Mettifogo
865f12a643 PARALLACTION: Use CursorMan to control cursor instead of backend functions.
svn-id: r55611
2011-01-29 10:42:56 +00:00
Nicola Mettifogo
d3ae7da133 PARALLACTION: Cleanup dialogue code.
Shorten long lines to increase readability.

svn-id: r55610
2011-01-29 10:42:40 +00:00
Torbjörn Andersson
bf01059be1 PARALLACTION: Add default case to silence GCC warning.
Not that I understand exactly what this function does, but since it's
a piece of debug code I figure I don't really have to.

svn-id: r55608
2011-01-29 08:08:58 +00:00
Nicola Mettifogo
2856e959be PARALLACTION: Cleanup dialogue code.
Turned 'no answer selected' into a constant.

svn-id: r55607
2011-01-29 07:22:04 +00:00
Nicola Mettifogo
bcd18232ad PARALLACTION: Cleanup dialogue code.
Hide mood and balloon winding extraction into Question and Answer objects.

svn-id: r55606
2011-01-29 07:21:48 +00:00
Nicola Mettifogo
e1046d3eae PARALLACTION: Simplify text comparisons in dialogue code.
Encapsulate text comparison into string owners and removed some ugly
double negative logic.

svn-id: r55605
2011-01-29 07:21:31 +00:00
Nicola Mettifogo
c3698a2cd5 PARALLACTION: Clarify strategy for choosing (answer) dialogue paths.
svn-id: r55604
2011-01-29 07:21:13 +00:00
Nicola Mettifogo
d39d75779e PARALLACTION: Don't show 'null' answers in dialogues.
Skip a 'runanswer' state when the text of the only answer available is 'null'.

svn-id: r55603
2011-01-29 07:20:57 +00:00
Nicola Mettifogo
6d4d253ec4 PARALLACTION: Improve dialogue debug output.
Print out the current question or the available answers when debug level is 9.

svn-id: r55602
2011-01-29 07:20:42 +00:00
Nicola Mettifogo
cf4f041c63 PARALLACTION: encapsulate dialogue state changes to aid debugging.
svn-id: r55601
2011-01-29 07:20:26 +00:00
Nicola Mettifogo
7760628bdb PARALLACTION: Flexible monologues in BRA (patch #3021740 by fuzzie)
Some dialogue answers are set to the literal 'null', which is used in NS to
simulate a fixed monologue ('null' instructs the engine to jump to the first
entry in the list of available questions, which is always made of a single
item in this case).
BRA has flexible monologues that depend on the game state, so this patch goes
and checks all the available branches before picking the correct one.

svn-id: r55591
2011-01-28 14:19:39 +00:00
Nicola Mettifogo
dd7bc67f82 Replaced char* with Common::String in balloon code.
svn-id: r55590
2011-01-28 13:24:32 +00:00
David Turner
ccb1faef7e PARALLACTION: Removal of unecessary returns and whitespace fixes to saveload.*
svn-id: r55510
2011-01-25 01:58:26 +00:00
David Turner
0f07082a78 PARALLACTION: Improve safety of PathBuffer::getValue().
This will now avoid invalid memory reads and instead emit warnings if it is called with values outside of the expected data buffer or on a NULL buffer.

svn-id: r55492
2011-01-24 01:58:43 +00:00
David Turner
bbb1379def PARALLACTION: Minor Whitespace fixup in walk.cpp
svn-id: r55392
2011-01-21 20:08:11 +00:00
David Turner
14d74d2063 PARALLACTION: Fix Un-initialized Memory Errors and Leaks in Nippon Safes Amiga Demo.
These were found using Valgrind.

svn-id: r55369
2011-01-21 03:25:01 +00:00
David Turner
f042e398ea PARALLACTION: Fix Big Red Adventure Walking To Stop On Path Build Failure.
Walking now works correctly, with no valgrind issues, lockups or assertions.

svn-id: r55281
2011-01-18 00:22:47 +00:00
David Turner
c6750a7a65 PARALLACTION: Minor Whitespace and code complexity reduction in walk.*
svn-id: r55280
2011-01-17 23:12:59 +00:00
David Turner
3ebf1e5962 PARALLACTION: Some Improvements To Big Red Adventure Walk Code.
* Renamed and retyped "int _fieldC" to "bool _stillWalkingTowardsNode" to aid readability and clarity of code. Thanks to fuzzie for naming.
* Added assertion to prevent use of invalid memory as reported by Valgrind when walk point p is constructed from an empty list.
* Added code to stop walk if buildPath fails, though this causes an assertion instead currently.

svn-id: r55279
2011-01-17 23:00:52 +00:00
David Turner
81729b87e8 PARALLACTION: Add debug console command "showmouse".
This command forces the mouse state to Enabled and Visible.
This is intended to help playtesting in Big Red Adventure, which has an issue currently with the mouse pointer getting stuck in the hidden state in some cases.

svn-id: r55234
2011-01-14 03:25:39 +00:00
David Turner
28e7ea8c22 PARALLACTION: Fix Valgrind Error on Engine Exit.
The automatic destruction of engine member "_char" of type Character at end of the destructor causes an invalid read in the destruction of the AnimationPtr which is a SharedPtr. To stop this happening, the SharedPtr is reset() prior to the destruction of Gfx, so it's dependencies on Gfx are still present. This will affect Nippon Safes as well as Big Red Adventure, but is unlikely to cause any issues and it is likely this exists in NS as well.

Thanks to fuzzie for this code.

svn-id: r55233
2011-01-14 00:13:27 +00:00
David Turner
00d78dd3d5 PARALLACTION: Fix for DoorData Memory Leak in Big Red Adventure.
svn-id: r55232
2011-01-13 21:58:54 +00:00
David Turner
460f8c277b PARALLACTION: Fixed Limit Values in Big Red Adventure Walker Code.
This corrects the Valgrind invalid reads associated with the IS_PATH_CLEAR() check reading beyond the data buffer and probably improves the pathfinding behaviour.
Thanks to fuzzie for suggesting this patch.

svn-id: r55231
2011-01-13 20:06:23 +00:00
David Turner
9118d2915c PARALLACTION: Close Memory Leak in Big Red Adventure Subtitles.
svn-id: r55229
2011-01-13 17:26:00 +00:00