Commit Graph

48 Commits

Author SHA1 Message Date
Max Horn
477d6233c3 ENGINES: Change 2nd param of Engine::saveGameState to Common::String 2011-06-02 18:31:59 +02:00
Max Horn
668ae0363e DRACI: Remove all instances of s(n)printf 2011-06-02 10:46:29 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02: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
David Turner
3d961469fd DRACI: Added basic debugging console to engine
Since DRACI uses Debug Channels, this allows for the interactive setting of debugflags as well as providing a base for adding further debugging commands.

svn-id: r54116
2010-11-07 15:03:54 +00:00
Johannes Schickel
1ed0051fce DRACI: Switch to the new play time counting of the Engine class.
svn-id: r53925
2010-10-29 16:54:10 +00:00
Max Horn
4ccce19876 ENGINES: Enhance namespace comments a bit
svn-id: r53484
2010-10-15 12:48:19 +00:00
Max Horn
d78dba3bca COMMON: Move Common::RandomSource to common/random.*
svn-id: r48279
2010-03-18 15:07:11 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Max Horn
df651bf20f Added Doxygen comments for the various engine namespaces (currently mostly without details; help filling these out is welcome)
svn-id: r46128
2009-11-24 22:10:14 +00:00
Max Horn
e34f1415db DRACI: Reduce header interdependency
svn-id: r46117
2009-11-23 23:54:20 +00:00
Robert Špalek
793761c695 Fixed Script::icoStat()
svn-id: r45850
2009-11-12 03:09:15 +00:00
Robert Špalek
c17e4f1b68 Subtitles are positioned correctly in the inventory
svn-id: r45849
2009-11-12 00:57:38 +00:00
Robert Špalek
354d7f6366 Debugged smooth walking except for 1 bug.
Adjusting to the edge is done such that it respects slight sideways movements of the dragon.
Fixed rounding issues in the whole game.  Improved debug messages.  Made sure that the dragon
does not turn like crazy around when clicking on the same pixel: the final point is always the
clicked one although the middle points made by shifted to make the animations smooth, and
preserve the dragons direction if he has not walked.

There is a bug with running turning animations as they seem to disappear for 1 frame and have
incorrect Z coordinate.  Will investigate it next.

svn-id: r45742
2009-11-08 03:16:22 +00:00
Robert Špalek
14f2685134 Implemented and debugged the walking framework.
The hero does not walk yet (it still teleports to the target immediately),
but that is just because the actual walking algorithm is left trivial first.
However, the main game loop, callbacks, and waiting all already work with
the general framework.

svn-id: r45648
2009-11-04 00:42:37 +00:00
Robert Špalek
6411125f39 Moved all one-line getters/setters to the header files
svn-id: r45524
2009-10-30 06:11:04 +00:00
Robert Špalek
8d8b4dc50a Enabled music.
Several TODO's added.

svn-id: r45298
2009-10-21 08:41:57 +00:00
Robert Špalek
e779284403 Sound effects are now correctly played.
Dubbing is not yet played.

svn-id: r45000
2009-10-12 22:27:23 +00:00
Robert Špalek
c4563616ae Added support for sound archives.
We initialize them in the DraciEngine constructor, but don't play any sounds
yet.  Checked that it works for all existing sound files (required several
work-arounds against unspoken specification).

When copying the interface from barchive.h, I decided to remove some const's
from there, because getFile() wasn't really behaving like const.

Removed some static Common::String instances.

svn-id: r44953
2009-10-11 22:30:40 +00:00
Robert Špalek
b6d7da6927 Implement all boilerplate concerning Global Main Menu.
All currently defined featues will be supported.  I have implemented 
everything boilerplatish, except for the actual game saving/loading (which
will come in the next commit), getting volumes from the configuration
(because we don't play sounds yet), and changing subtitles.

svn-id: r44583
2009-10-04 03:50:10 +00:00
Robert Špalek
3035ca2fd3 Let Ctrl-Left click behave like Right lick in Dragon History.
Also, started implementing Advanced Engine Features:
- pause support
- RTL support

svn-id: r44575
2009-10-03 22:07:18 +00:00
Robert Špalek
24d649b972 Clean up room changing code and support returning from the map.
Completely changed the interface, removing unused methods and attributes,
renaming other ones to reflect what they do, and moving some methods into the
private section.  Code changing the location, originally scattered over many
pieces of code, has been unified into one place.  Remember the previous room
when entering the map so that one can return there.

Also, the event handler processes one event at a time, preventing lost clicks
on touchpads.

svn-id: r44508
2009-10-01 08:32:35 +00:00
Max Horn
cc54ad650d Remove trailing whitespaces
svn-id: r44493
2009-09-30 16:04:21 +00:00
Johannes Schickel
c9ca057ae2 - Adapt parts of the Draci code to match our code formatting guidelines
- Remove use of tabs for formatting, now in nearly all cases tabs are only used for indentation
- Use "uint" instead of "unsigned int" in the whole engine for consistency's sake
- Strip some trailing tabs and leading whitespaces

svn-id: r44478
2009-09-30 10:45:14 +00:00
Filippos Karapetis
e296cef9be Created a macro for lround(), for non-C99 compilers, and used that in places where lround() is used
svn-id: r44337
2009-09-25 09:48:43 +00:00
Denis Kasak
2d1df86f69 Added the strings archive to DraciEngine.
svn-id: r42989
2009-08-02 03:16:44 +00:00
Denis Kasak
52a1c5df91 Added archives for item descriptions and images.
svn-id: r42970
2009-08-01 02:49:40 +00:00
Denis Kasak
e9669b8e2b * Moved event handling to DraciEngine::handleEvents()
* Added Game::start() method which is called from DraciEngine::go()
* Made Game::loop() suitable for calling from other places (like GPL scripts) by handling events, redrawing the screen, etc from inside. This way it doesn't freeze the game if it doesn't return immediately.
* Added Game::shouldQuit() and Game::setQuit() which can be used to signal the engine to quit.
* Fixed race condition related to mouse buttons not getting released.
* Instead of deleting frames for the title animation and adding a new one, reset the text for its frame.

svn-id: r42875
2009-07-29 01:11:53 +00:00
Denis Kasak
d28658984d * Added DraciEngine::_initArchive and made Game use it. Fixes a memory bug because Game uses pointers from the init archive which should outlive it (but didn't previously).
* Added support for setting loop status to Game.
* Made some GPL commands check whether we are in the correct loop status before executing.

svn-id: r42731
2009-07-25 03:28:04 +00:00
Denis Kasak
652acfc4ca * Added WalkingMaps class
* Added DraciEngine::walkingMapsArchive
* Made Game::loadRoom() read in the current walking map

svn-id: r42541
2009-07-16 18:31:15 +00:00
Denis Kasak
e031709989 Added _iconsArchive to DraciEngine and modified the Mouse class to use it.
svn-id: r42535
2009-07-16 16:06:29 +00:00
Denis Kasak
a4a3ad123c Renamed Font::setFont() to loadFont(). Removed DraciEngine::_font and added _smallFont and _bigFont so each font can be handled separately.
svn-id: r42514
2009-07-15 18:16:54 +00:00
Denis Kasak
218a15d890 Made _rnd member of DraciEngine public.
svn-id: r42190
2009-07-06 19:22:13 +00:00
Denis Kasak
8e341ee968 Renaming Animation -> AnimationManager and AnimObj -> Animation in light of the new API change.
svn-id: r42133
2009-07-05 11:52:17 +00:00
Denis Kasak
b1d6377aa1 Added _animationsArchive member to DraciEngine.
svn-id: r42091
2009-07-04 14:54:22 +00:00
Denis Kasak
1853d594b8 Enabled loading room number 1 as a test.
svn-id: r42071
2009-07-03 17:55:28 +00:00
Denis Kasak
52642e2dc9 Added two more debug levels (logic and animation).
svn-id: r42065
2009-07-03 16:35:04 +00:00
Denis Kasak
cac39d8295 Added rooms and overlays archives.
svn-id: r42035
2009-07-02 19:57:09 +00:00
Denis Kasak
be3c0461d6 DraciEngine now opens and stores pointers to essential archives. Changed code that used those archives to use that instead of opening them manually. Replaced BArchive::operator[] functionality with BArchive::getFile() to prevent ugliness when accessing archives via pointers.
svn-id: r42031
2009-07-02 16:15:32 +00:00
Denis Kasak
1e70f25fcf Added Script instance to DraciEngine. Restored disassembling of a demo script on engine startup (previously via gpldisasm(), now via _script->run()).
svn-id: r41921
2009-06-27 15:26:33 +00:00
Denis Kasak
0430939006 Added Game's constructor. Added the Person struct and made Game constructor read in the list of persons from INIT.DFW. Added Game instance to DraciEngine.
svn-id: r41907
2009-06-27 01:04:24 +00:00
Denis Kasak
c87f05b14c Started work on the Mouse class.
svn-id: r41840
2009-06-24 23:58:30 +00:00
Denis Kasak
0ff3c1945f Changed _screenWidth and _screenHeight from member variables to constants because the screen size doesn't change.
svn-id: r41620
2009-06-18 00:33:16 +00:00
Denis Kasak
491800c19a Changed the _font DraciEngine member from a Font instance to a pointer to an instance. This way the default constructor is invoked in DraciEngine::init() and can properly initialize the fonts because the game data paths are set.
svn-id: r41612
2009-06-17 21:07:59 +00:00
Denis Kasak
997b37eff1 Began work on the Screen class. Modified the demo animation to use the it.
svn-id: r41604
2009-06-17 04:48:48 +00:00
Denis Kasak
718f84fb97 Added a Font _font variable to the engine instance. Fixed font colour handling by replacing the appropriate colours before drawing. Added Font::setColour() method for changing the current font colour. Added include guards to draci/font.h. Moved kFontBig and kFontSmall constants to draci/font.cpp to prevent redefinition errors.
svn-id: r41524
2009-06-14 18:59:31 +00:00
Denis Kasak
2c00d65501 Added an additional debuglevel "archiver" to facilitate displaying debug info from the BAR archiver. Also adjusted numeric debug levels.
svn-id: r41436
2009-06-10 18:18:09 +00:00
Denis Kasak
39a8c71f77 Adding Draci Historie engine skeleton (engine stub, BAR archiver, rudimentary GPL disassembler)
svn-id: r41390
2009-06-08 22:18:52 +00:00