Commit Graph

29 Commits

Author SHA1 Message Date
Marcus Comstedt
40f9506163 The default keycolor for mouse pointers used to be 255.
This makes sense as a default for CLUT8 modes, but not really
for anything else.  As part of the gsoc2009-16bit merge, the
default was changed to "all ones", with extra code in the SDL
backend to truncate this to the depth of the mode.  However,
"all ones" (white) still isn't a very useful default for RGB modes.
So rather than jumping through hoops to provide a bad default,
it's better to remove the default altogether.  Engines which relied
on the old default of 255 have been updated to specify it explicitly.

svn-id: r47118
2010-01-07 15:07:36 +00:00
Johannes Schickel
2f372d79d5 Fix compilation for systems without USE_RGB_COLOR defined.
svn-id: r46323
2009-12-09 22:50:12 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Robert Špalek
e2ca397e63 Huge refactoring of data structures.
Replaced IDs of objects by pointers, which saves many lookups, each of which
is horribly ineffective.  Moved a lot of code into methods of structs now
turned into objects.

Tested the new code a lot and seems to work as well as the old code.

svn-id: r45799
2009-11-10 05:16:34 +00:00
Robert Špalek
ed87e5cd31 Don't change mouse cursors so ridiculously often.
svn-id: r45451
2009-10-27 23:51:32 +00:00
Robert Špalek
c8f002ae43 Removed Ctrl-Left Click treating as a Right Click
svn-id: r44633
2009-10-04 20:08:11 +00:00
Robert Špalek
df14027c41 Implemented rudimentary game loading/saving.
Fixed many bugs in the boilerplate.  Saving (only) things that really need to
be saved.  Loading seems to work modulo dialogs and (possibly) inventory.

svn-id: r44586
2009-10-04 05:44:23 +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
4a7cea6813 Fixed event handling. ValGrind fixups.
My yesterday's fix on handling 1 event per call caused the game to be
unbearably slow on Linux.  The old way was much faster.  I have solved too
fast a succession of mouse button down and up by not clearing the mouse flag
when the button goes up instead.

Fixed a memory leak and uninitialized variable after my refactoring of game
location changes; found by ValGrind.

svn-id: r44525
2009-10-01 16:47:34 +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
Robert Špalek
8a78e96838 Make getFile() return a const pointer and clean-up all uses of it.
svn-id: r44433
2009-09-28 03:51:23 +00:00
Robert Špalek
f51c81f344 Add const's to many interfaces of engines/draci/
svn-id: r44331
2009-09-25 08:13:39 +00:00
Denis Kasak
680bed134b * Set the _x and _y position for the mouse only when an EVENT_MOUSEMOVE happens.
* Stop calling Mouse::setPosition() on EVENT_MOUSEMOVE since it's not needed (the engine warps the mouse automatically; I still left the method for situations when we want to warp the mouse explicitly).

svn-id: r43484
2009-08-17 18:23:05 +00:00
Denis Kasak
d59d03e52f Multiply itemID by two before using it as an index into the item image archive because every item has a highlighted and a non-highlighted version.
svn-id: r43185
2009-08-09 20:33:58 +00:00
Denis Kasak
295ab7e6ff Added Mouse::loadItemCursor(). Removed hotspot FIXME as all cursors seem to use the same hotspot (the center of the sprite).
svn-id: r43158
2009-08-09 03:58:03 +00:00
Denis Kasak
c2dccaafcd Added method Mouse::isCursorOn().
svn-id: r43082
2009-08-06 04:48:43 +00:00
Denis Kasak
8e1f296308 Removed room switching hack from Mouse and re-added it to DraciEngine::go() (right arrow switches to the next room, left to the previous.
svn-id: r42577
2009-07-18 01:11:45 +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
7f3af129f2 mplemented changing rooms properly (overlays and objects' animations are deleted before a new room is loaded) and set up a quick demonstration (left click advances to the next room, right click goes back).
svn-id: r42224
2009-07-07 15:21:41 +00:00
Denis Kasak
b96b434446 * Added Game::init() and moved some functionality from Game::Game to it (loading objects, changing rooms)
* Made Game::load*(), Game::getObject() and Game::changeRoom() methods public
* Stopped specifying Z coordinate when creating some Sprites (which I forgot in my previous commit)

svn-id: r42101
2009-07-04 18:35:08 +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
cfadb6cc3d Made coordinate specification mandatory when constructing objects of type Sprite and Class. Made transforming from columnwise a default (since it was done most of the time anyway). Changed coordinates to use uint instead of uint16.
svn-id: r41996
2009-07-01 16:00:27 +00:00
Denis Kasak
f0fcd7fd8e Modified Sprite, Text and Drawable to handle data hiding properly since they're no longer just C-like struct containers. Implemented getters/setters accordingly and changed existing code that used those classes.
svn-id: r41995
2009-07-01 15:22:36 +00:00
Denis Kasak
9911026816 Oops, really fixed typo.
svn-id: r41874
2009-06-25 18:06:35 +00:00
Denis Kasak
09313ccebb Fixed typo.
svn-id: r41873
2009-06-25 17:56:14 +00:00
Denis Kasak
566dd20e4f Renamed *cursorNum identifiers in Mouse to *cursorType for consistency.
svn-id: r41866
2009-06-25 15:08:49 +00:00
Denis Kasak
02dadc70fc Implemented some more methods in Mouse so all mouse-related events are handled through it.
svn-id: r41861
2009-06-25 11:02:10 +00:00
Denis Kasak
c87f05b14c Started work on the Mouse class.
svn-id: r41840
2009-06-24 23:58:30 +00:00