aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver/sprite.cpp
AgeCommit message (Collapse)Author
2005-12-20If drawSurface() is called with no clip rect, clip to the screen size. ThisTorbjörn Andersson
prevents the subtitles-only cutscenes fallback from drawing outside the screen. svn-id: r19813
2005-10-18Update FSF address. Eek. Actually that took place on May 1, 2005Eugene Sandulenko
svn-id: r19142
2005-07-30Remove trailing whitespaces.Eugene Sandulenko
svn-id: r18604
2005-05-12Whitespace: "(type *)something" instead of "(type *) something", becauseTorbjörn Andersson
that's how we write it in most other places. svn-id: r18069
2005-05-02Don't let drawSprite() modify the SpriteInfo struct.Torbjörn Andersson
svn-id: r17897
2005-05-02Cleanup. Most of is simply moves the credits code out of Logic and intoTorbjörn Andersson
Screen. I've also added an unused "splash screen" function that displays the image that used to be shown by CacheNewCluster() while copying a data file from CD to hard disk. ScummVM doesn't do that, but it's a nice image that I wish we could do something useful with, and it's easier to have the code here for reference than having to dig through old revisions of the resource manager. svn-id: r17894
2005-02-27Got rid of all the .h files but one in the 'driver' directory. They wereTorbjörn Andersson
either very small or, in the case of driver96.h, a disorganized jumbles. svn-id: r16952
2005-02-19This is the second part of the BS2 restructuring. There are two newTorbjörn Andersson
classes: Screen and Mouse. Screen handles most of the drawing, except the mouse cursor and in-game menus. The old Graphics class is no more. I've also fixed some "reverse stereo" regressions from the first part of the restructuring. I'm not sure what the next step will be, but hopefully it will be smaller than this one was. svn-id: r16812
2005-01-17Updated copyright header, as discussed on the mailing list.Torbjörn Andersson
svn-id: r16580
2005-01-01Updated copyright year.Torbjörn Andersson
svn-id: r16397
2004-06-09Cleaned up the palette handling a bit. Renamed _palCopy to _palette since ITorbjörn Andersson
found the old name misleading (there is only one array that stores the palette in the engine, though it could be argued that it's a copy of the one used by the backend), and removed some code that I'm almost certain was never used. (I've added assert()s to trigger in the cases where it would have been used.) svn-id: r13949
2004-06-07Added comment.Torbjörn Andersson
svn-id: r13946
2004-06-06Cleaned up sprite scaling.Torbjörn Andersson
svn-id: r13944
2004-05-09When drawing lines and points, mark the corresponding screen area as dirtyTorbjörn Andersson
so that it gets properly redrawn. Only the debugging code uses these drawing primitives, so it's no big deal, but it's still the right thing to do. svn-id: r13811
2004-04-23Major revamping of the BS2 memory manager and, some small changes to theTorbjörn Andersson
resource manager. All new code! All new bugs! svn-id: r13603
2004-02-05Removed some of the #includes from sword2.hTorbjörn Andersson
svn-id: r12739
2004-01-06It's a new year in BS2 land, too!Torbjörn Andersson
svn-id: r12181
2004-01-04Adapted LavosSpawn's idea for more efficient screen updating. It stillTorbjörn Andersson
renders the entire screen every frame, but it tries to update (i.e. copy to the backend) only the parts of the screen that actually changed. At least approximately so. svn-id: r12142
2003-12-28Hopefully the last big renaming. Now the datatypes have names likeTorbjörn Andersson
"StandardHeader" instead of "_standardHeader". svn-id: r11997
2003-12-10Sprite surfaces (as opposed to standard sprites) are always displayTorbjörn Andersson
aligned, never flipped and never RLE16-compressed. Simplified the code accordingly. (Displaying the restore dialog when specifying an unused save slot from the command-line works again now.) Plus some minor cleanups. svn-id: r11550
2003-12-09I've played through the whole game, and I've scanned through the clusterTorbjörn Andersson
files with a primitive and incomplete tool to present resource information. (It may evolve into something useful and/or presentable later. Much later.) I've found no evidence whatsoever that the mysterious blend & 0x02 case is ever used. Since the code makes no sense to me, I've removed it. svn-id: r11538
2003-11-16More cleanup. I've eliminated all the temporary global variables I've addedTorbjörn Andersson
over the past few weeks, except for g_sword2. (Of course, this doesn't necessarily make the code any prettier, but we can work on that later.) svn-id: r11309
2003-11-11Moved low-level keyboard and mouse handling to a new Input class, andTorbjörn Andersson
renamed the Display class Graphics for no better reason than me liking the phrase "sound and graphics" better than "sound and display". svn-id: r11258
2003-11-08Removed some now redundant header files.Torbjörn Andersson
svn-id: r11209
2003-10-28bs2 -> sword2Max Horn
svn-id: r10997
2003-10-15Dumped most of the remaining "driver" code into a new "Display" class. ThisTorbjörn Andersson
touches a lot of the code, of course, and adds yet another global variable (temporarily, I hope), but everything still seems to work. Knock on wood. svn-id: r10806
2003-10-04Changed to use #include "bs2/..." and removed the inclusion of standard CTorbjörn Andersson
headers. Most (all?) of the ones we need should probably come from stdafx.h instead. svn-id: r10588
2003-10-04added namespace Sword2Max Horn
svn-id: r10581
2003-10-02renamed namespace ScummVM to CommonMax Horn
svn-id: r10544
2003-10-02Cleanups, mostly related to sound effects.Torbjörn Andersson
svn-id: r10532
2003-09-29cleanup (I meant to do this in my previous commit)Torbjörn Andersson
svn-id: r10485
2003-09-29cleanupTorbjörn Andersson
svn-id: r10484
2003-09-29cleanupTorbjörn Andersson
svn-id: r10483
2003-09-28More cleanup, plus support for cutscene leadout music. For now, we onlyTorbjörn Andersson
play that music for cutscenes that have subtitles. svn-id: r10460
2003-09-23Removed unused / replaced source code. This turned out to be most of theTorbjörn Andersson
file. :-) svn-id: r10385
2003-09-23Removed ancient version history. Much of it doesn't apply to us, and wasTorbjörn Andersson
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-16Removed some unnecessary #includes and #defines.Torbjörn Andersson
svn-id: r10264
2003-09-08Updated comment.Torbjörn Andersson
svn-id: r10100
2003-09-08Added some code to display the subtitles for the Smacker movies, whenTorbjörn Andersson
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-08Complete rewrite of the in-game dialogs (quit, restart, settings, save andTorbjörn Andersson
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-08-30Fixed sprite clipping issues, I hope.Torbjörn Andersson
svn-id: r9920
2003-08-29Added some code to stop producing interpolation frames if the scene hasTorbjörn Andersson
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-28Removed the Surface class in favor of small struct specially made for theTorbjörn Andersson
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-27Added code for smoothing upscaled sprites (for the highest detail setting).Torbjörn Andersson
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-26The graphics detail settings partially work now. They only affect howTorbjörn Andersson
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-23Unstubbed the Create/Draw/DeleteSurface() functions, and removed someTorbjörn Andersson
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-22Added light mask support (in the demo this is most visible when walkingTorbjörn Andersson
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-20Lots of cleanup.Torbjörn Andersson
Oh, and the menus should work now. :-) svn-id: r9804
2003-08-20Cleaned up DrawSprite() and added scaling, based on the "line doubling"Torbjörn Andersson
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-19Remove a bunch of unneeded cruft - but barely the surface of it. This code ↵James Brown
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