Commit Graph

123 Commits

Author SHA1 Message Date
Julien
1cc7faa242 DRACI: Replace abort() call by error() 2011-06-23 15:11:36 +08:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
84184aabc0 ALL: colour -> color 2011-04-14 14:12:35 +02:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
a008d14055 ENGINES: Do not use MemoryReadStream where (Seekable)ReadStream suffices; avoid using 'using'
svn-id: r54323
2010-11-18 16:38:03 +00:00
Eugene Sandulenko
2a3f985566 DRACI: Fix warnings
svn-id: r52144
2010-08-17 10:59:11 +00:00
Robert Špalek
0fd3558986 Finish support of compressed dubbing
Now even the length of a compressed stream is measured precisely and
the dubbing sounds exactly like the original.

svn-id: r50618
2010-07-03 05:05:28 +00:00
Robert Špalek
76b8c33aaf Fade palette in/out when entering/leaving a location
svn-id: r50409
2010-06-28 04:59:13 +00:00
Robert Špalek
c7554c267e Implement shortcuts for switching items in the inventory
slash: switch between the last held item and normal mouse
comma, period: replace the currently held item with the previous/next item in the inventory

Also, commented a bit better what happens when ESCAPE is present with respect to map
programs and cut-scenes.

svn-id: r50407
2010-06-28 04:04:16 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Johannes Schickel
e3d1d914ac Attempt to fix MSVC warning C4121.
svn-id: r46299
2009-12-08 22:07:17 +00:00
Robert Špalek
95d4c62efb Fixed breaking long lines instead of using smaller font (which is sometimes not enough)
svn-id: r46101
2009-11-23 06:44:40 +00:00
Robert Špalek
0ee8f879fa Fix positioning of one-time hero animations.
With the previous code, the position of the animation was doubled (due to
counting the position twice, the second time being a relative shift), which
put it mostly outside the screen.  This is because one-time hero animations
are actually stored using absolute coordinates.

svn-id: r46057
2009-11-22 05:10:31 +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
d281fe4717 Added runWrapper() calling run() and some actions around it.
This simplifies a lot of code calling run().  Also, scripts called from the
inventory are now called with disabled mouse and title, as desired.

svn-id: r45848
2009-11-12 00:45:28 +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
ed348133d1 GPL2 callbacks accept const Array& instead of Queue&
svn-id: r45771
2009-11-09 04:27:08 +00:00
Robert Špalek
8edfd6b56c Updated the list of TODOs
svn-id: r45768
2009-11-08 22:48:27 +00:00
Robert Špalek
99037380ee Removed old hack for cyclic animations.
This makes the hero's walk even smoother.

svn-id: r45763
2009-11-08 21:35:19 +00:00
Robert Špalek
abbb3dccd7 Items put into inventory are placed correctly.
Also, named correctly GPL2 parameter types.

This fixes all FIXMEs

svn-id: r45762
2009-11-08 21:26:04 +00:00
Robert Špalek
4341a36641 Implement QuickHero walking.
Pressing Q during the game enables/disables faster walking; all animation
phases are flipped after one refresh instead of after given delay.

svn-id: r45748
2009-11-08 06:46:24 +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
0b67aa406e Debugged updating the position of the hero during walking.
I project the hero immediately to the end of each edge for the time being
though.

svn-id: r45722
2009-11-07 11:45:13 +00:00
Robert Špalek
fdad4e7b54 Done research on ignored animation flags and commented the code
svn-id: r45711
2009-11-07 00:36:23 +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
b506b9f7c2 Removed an old FIXME
svn-id: r45642
2009-11-03 21:34:38 +00:00
Robert Špalek
0071829aee Implement properly stayOn instead of using walkOn
svn-id: r45641
2009-11-03 21:30:24 +00:00
Robert Špalek
c45f0343f4 Refactored running loop().
- shouldExitLoop() is a bool again and introduced new flag isReloaded() instead
  of adding special hacky value 2
- loop() accepts 2 parameters: loop substatus and shouldExit flag, because each
  caller previously had to set and restore these manually.  loop() now also
  tests whether the substatuses are properly nested.  reordered the
  loop-exitting code.
- renamed loop substatuses to logical names
- enterNewRoom() returns bool whether loop() should continue so that start()
  doesn't have to test and clear shouldEndProgram().  it doesn't need
  force_reload as a parameter anymore.
- dialog selections use new inner substatus instead of outer substatus, for
  consistency

svn-id: r45607
2009-11-02 02:28:43 +00:00
Robert Špalek
f77446a500 Commented on loop() before refactoring.
svn-id: r45604
2009-11-01 23:04:56 +00:00
Robert Špalek
f3700a23e9 Move WalkingMap instance to Game, and clean up parameters
svn-id: r45516
2009-10-30 02:15:41 +00:00
Robert Špalek
d662c4aa20 Remove the last 2 default parameter values.
They usually just add unnecessary confusion and this is definitely such
an example.  Removal will clarify the code.

svn-id: r45512
2009-10-30 01:56:52 +00:00
Robert Špalek
c778efaca5 Remove most of default parameter values.
Also, add comments to the last commit.

svn-id: r45511
2009-10-30 01:41:57 +00:00
Robert Špalek
a20e42efb9 Move WalkingMap into new module.
Also, fix a bug when loading the default walking map (wasn't implemented)
and setting font size.  The reason I move this code into a new module is
because I will augment it with other walking-related algorithms soon.

svn-id: r45510
2009-10-30 00:52:05 +00:00
Robert Špalek
403668898f Implement flipping the QuickHero and SpeedText flags in GPL2.
All GPL2 callbacks are now fully implemented.  It remains to implement
proper walking.

svn-id: r45501
2009-10-29 15:26:48 +00:00
Robert Špalek
25b3e687a7 Fix several palette fading bugs.
svn-id: r45497
2009-10-29 01:55:06 +00:00
Robert Špalek
c781f01321 Implement palette fading
svn-id: r45455
2009-10-28 07:34:17 +00:00
Robert Špalek
74da9e5e3b Fix Escape in the intro, and switching map and the inventory
svn-id: r45389
2009-10-26 04:59:52 +00:00
Robert Špalek
819449d099 Implemented GPL2 commands for music.
Debugged everything.

svn-id: r45330
2009-10-22 07:34:43 +00:00
Robert Špalek
baec8c2421 Set all sound/subtitle-related parameters from ConfMan.
Made it intelligent so that when, for example, the dubbing file doesn't exist,
we don't fail, but instead always show subtitles even if the GUI settings
says dubbing only, etc.

svn-id: r45002
2009-10-13 05:38:45 +00:00
Robert Špalek
7c311057c1 Dubbing is played.
I haven't implemented switching dubbing and subtitles on/off according to
the config manager nor the speed of the subtitles, yet.

svn-id: r45001
2009-10-13 04:44:22 +00:00
Robert Špalek
43437eecb8 Dragon looks into the requested direction.
Parsing _lookDir and _useDir, and passing it all the way around to walkHero().

Also, added playHeroAnimation() to reduce code duplication.

svn-id: r44965
2009-10-12 03:08:28 +00:00
Robert Špalek
1a4dcd3c82 Implemented GPL commands JustTalk and JustStay.
The basic commands are done.  It remains to implement handling music (after
we play it at all), fading palette, and controlling the quick-hero and
speed-text flags (after I find out what they do).

Now the dragon switches between talking and staying during dialogs.  However,
the left/right direction doesn't work yet, because we don't respect _lookDir
and _useDir yet.

svn-id: r44964
2009-10-12 01:16:13 +00:00
Robert Špalek
ca35af2697 Fixed funcActPhase()
svn-id: r44963
2009-10-12 00:39:49 +00:00
Robert Špalek
b99e69f4d9 Fix indexing of the dragon's animations.
After inspection, I assert that it isn't true that the _anim array needs to
be sorted.  In fact, sorting ruins the ordering of the dragon's animations,
which corresponds to enum Movement.

After fixing this, let the dragon have a rest instead of constantly walking
down.

svn-id: r44962
2009-10-12 00:32:51 +00:00
Robert Špalek
3ef5145b41 Reduced huge code duplication by introducing Game::stopObjectAnimations()
svn-id: r44961
2009-10-12 00:15:34 +00:00
Robert Špalek
6aaf99ec67 Disambiguated _anims.
It's both a pointer to an AnimationManager and list of animation ID's fo
each object.  The latter renamed to _anim so that I can easily search for
them.

Also, fixed the bug promised in the previous commit.

svn-id: r44960
2009-10-12 00:01:39 +00:00
Robert Špalek
6768065f14 Reduced code duplication and fixed one deletion bug.
svn-id: r44959
2009-10-11 23:54:44 +00:00
Robert Špalek
62cebbb51e Implemented a few more harmless GPL2 commands
svn-id: r44958
2009-10-11 23:28:40 +00:00
Robert Špalek
f71b32dd96 Loading and caching sound samples in memory.
The sounds are not played yet, but the infrastructure is getting ready.

svn-id: r44957
2009-10-11 23:01:59 +00:00