Commit Graph

20 Commits

Author SHA1 Message Date
Torbjörn Andersson
6e59a2df00 Removed unused / replaced source code. This turned out to be most of the
file. :-)

svn-id: r10385
2003-09-23 17:24:45 +00:00
Torbjörn Andersson
4ae1674a44 Removed ancient version history. Much of it doesn't apply to us, and was
cluttering up the files anyway. (Though I do feel a slight twinge of guilt
for removing historical records like this. :-)

svn-id: r10384
2003-09-23 16:53:25 +00:00
Torbjörn Andersson
00c1fdce3a Removed some unnecessary #includes and #defines.
svn-id: r10264
2003-09-16 09:57:57 +00:00
Torbjörn Andersson
d0949b7035 Updated comment.
svn-id: r10100
2003-09-08 17:24:00 +00:00
Torbjörn Andersson
c2070e28fa Added some code to display the subtitles for the Smacker movies, when
available, since they are separate from the Smacker files themselves.

Next step will be to play the voice-over sounds as well, and to make sure
subtitles settings etc. are taken into account (if they aren't already).

svn-id: r10099
2003-09-08 17:18:38 +00:00
Torbjörn Andersson
0b86100456 Complete rewrite of the in-game dialogs (quit, restart, settings, save and
load). The new code is smaller, hopefully a bit easier to read and doesn't
use up all the CPU time.

Of course, it may some new and exciting bugs too. ;-)

svn-id: r10079
2003-09-08 06:38:16 +00:00
Torbjörn Andersson
23ba54ec92 Fixed sprite clipping issues, I hope.
svn-id: r9920
2003-08-30 10:23:40 +00:00
Torbjörn Andersson
ed698cb635 Added some code to stop producing interpolation frames if the scene has
already reached its scroll target. This keeps BS2 from using all available
CPU time all of the time.

It may still be that we need a mechanism for throttling the frame rate when
the scene is moving towards a scroll target, but my computer isn't really
fast enough to test that.

Two other bugs fixed in the process:

* I think the last frame of the render cycle was rendered, but not
  displayed. If so, that should be fixed now.

* I discovered that there are cases where we do need to clear the screen
  (e.g. at the "Meanwhile..." message when George has found out about the
  Glease Gallery), so I've re-enabled the function and disabled it in the
  render cycle.

svn-id: r9904
2003-08-29 06:42:34 +00:00
Torbjörn Andersson
f7ce39763e Removed the Surface class in favor of small struct specially made for the
block surfaces. (A block surface is a 64x64 tile of a parallax layer.)

I've also done a few things to try and optimize the drawing:

* The back buffer is no longer cleared between frames. This may cause
  regressions, but I do believe that the entire picture area is always
  completely re-rendered for each frame.

  As a result of this, the menu code is now responsible for clearing the
  icon areas itself.

* A few unnecessary copy_rect() calls were commented out in favor of one
  big copy_rect() in ServiceWindows().

* Completely opaque block surfaces are copied with memcpy(), one line at a
  time.

Unless we manage to add intelligent screen redrawing, I don't think it will
get that much faster than this, though there is some unnecessary data
copying in DrawSprite() that could be removed.

And the game is still a terrible CPU hog. I believe the animation runs at
approximately 12 fps. If there's still time left, it will pump out further
frames to get smooth scrolling. We ought to put a cap on that, and if it
has already reached the scroll target it should sleep for the rest of the
render cycle.

svn-id: r9886
2003-08-28 06:36:15 +00:00
Torbjörn Andersson
0119d6d642 Added code for smoothing upscaled sprites (for the highest detail setting).
I don't know if I got it right - the result doesn't look that great to me -
but at least the infrastructure is there.

This, I think, marks the point where BS2 graphics is pretty much done. Some
functions haven't been unstubbed yet, but I believe they're used for
debugging and/or profiling. I'm not sure they're worth the trouble.

Of course, there is still testing and clean-ups to make. For instance, I'd
like DrawSprite() to use malloc() a bit less.

svn-id: r9879
2003-08-27 07:17:12 +00:00
Torbjörn Andersson
8277c6cb79 The graphics detail settings partially work now. They only affect how
sprites are drawn, but I think that's how it should be.

1: No bells or whistles.
2: This setting adds sprite blending, e.g. the smoke at the docks or the
   display cases at the Glease Gallery.
3: This setting adds light map support, e.g. when walking under the shack
   at the docks.
4: This setting adds better scaling algorithms.

The first three settings should work fine now. In fact, the third setting
is what we used to implement. The fourth setting still needs work and
testing. I've added code for downscaling case, but frankly I'm not
convinced the result is any better than with the simpler scaler. I usually
can't even tell the difference.

Of course, my translation of the original code could very well be buggy.

svn-id: r9867
2003-08-26 06:53:00 +00:00
Torbjörn Andersson
df247cff62 Unstubbed the Create/Draw/DeleteSurface() functions, and removed some
unnecessary stuff from our own Surface class. The former allows the in-game
dialogs to at least sort of work, and the latter gained me a few frames per
second, according to the built-in FPS counter.

svn-id: r9825
2003-08-23 13:02:21 +00:00
Torbjörn Andersson
641d164e21 Added light mask support (in the demo this is most visible when walking
under the shack), plus some other cleanups. The s->blend & 0x02 case looks
bogus to me, but I don't know where it's used and I can't see that the
original did it differently.

svn-id: r9819
2003-08-22 07:04:50 +00:00
Torbjörn Andersson
8b9158817d Lots of cleanup.
Oh, and the menus should work now. :-)

svn-id: r9804
2003-08-20 21:17:23 +00:00
Torbjörn Andersson
1100a46242 Cleaned up DrawSprite() and added scaling, based on the "line doubling"
method in the original code.

There are still a few minor things missing, but it should work well enough
for now.

svn-id: r9788
2003-08-20 06:51:35 +00:00
James Brown
ec447fdfbb Remove a bunch of unneeded cruft - but barely the surface of it. This code is depressing and duplicated all over the place... I don't think I can bear to touch this code until it's undergone some MAJOR cleanup :)
svn-id: r9782
2003-08-19 14:57:26 +00:00
Jonathan Gray
b6ec652a49 patch #791032 from erik SWORD2: Sprite drawing (incomplete)
svn-id: r9780
2003-08-19 08:47:09 +00:00
Jonathan Gray
84bccaa83b substitute long int for LARGE_INTEGER
svn-id: r9236
2003-07-28 08:08:42 +00:00
Travis Howell
ccc40eecc9 Compiles on mingw now
svn-id: r9222
2003-07-28 03:12:49 +00:00
Jonathan Gray
dc6aa9912c bs2 driver
svn-id: r9212
2003-07-28 01:47:41 +00:00