[Scummvm-cvs-logs] SF.net SVN: scummvm: [22783] scummvm/trunk/engines/agi
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Tue May 30 13:10:05 CEST 2006
Revision: 22783
Author: wjpalenstijn
Date: 2006-05-30 12:48:47 -0700 (Tue, 30 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22783&view=rev
Log Message:
-----------
cleanup
Modified Paths:
--------------
scummvm/trunk/engines/agi/sprite.cpp
scummvm/trunk/engines/agi/sprite.h
Modified: scummvm/trunk/engines/agi/sprite.cpp
===================================================================
--- scummvm/trunk/engines/agi/sprite.cpp 2006-05-30 18:55:41 UTC (rev 22782)
+++ scummvm/trunk/engines/agi/sprite.cpp 2006-05-30 19:48:47 UTC (rev 22783)
@@ -30,6 +30,22 @@
namespace Agi {
+/**
+ * Sprite structure.
+ * This structure holds information on visible and priority data of
+ * a rectangular area of the AGI screen. Sprites are chained in two
+ * circular lists, one for updating and other for non-updating sprites.
+ */
+struct sprite {
+ vt_entry *v; /**< pointer to view table entry */
+ int16 x_pos; /**< x coordinate of the sprite */
+ int16 y_pos; /**< y coordinate of the sprite */
+ int16 x_size; /**< width of the sprite */
+ int16 y_size; /**< height of the sprite */
+ uint8 *buffer; /**< buffer to store background data */
+ uint8 *hires; /**< buffer for hi-res background */
+};
+
SpritesMan *_sprites;
/*
@@ -37,7 +53,9 @@
*/
#undef ALLOC_DEBUG
+
#define POOL_SIZE 68000 /* Gold Rush mine room needs > 50000 */
+ /* Speeder bike challenge needs > 67000 */
void *SpritesMan::pool_alloc(int size) {
uint8 *x;
@@ -285,10 +303,10 @@
/**
* Condition to determine whether a sprite will be in the 'updating' list.
*/
-int SpritesMan::test_updating(vt_entry *v) {
+static bool test_updating(vt_entry *v) {
/* Sanity check (see bug #779302) */
if (~game.dir_view[v->current_view].flags & RES_LOADED)
- return 0;
+ return false;
return (v->flags & (ANIMATED | UPDATE | DRAWN)) == (ANIMATED | UPDATE | DRAWN);
}
@@ -296,10 +314,10 @@
/**
* Condition to determine whether a sprite will be in the 'non-updating' list.
*/
-int SpritesMan::test_not_updating(vt_entry *v) {
+static bool test_not_updating(vt_entry *v) {
/* Sanity check (see bug #779302) */
if (~game.dir_view[v->current_view].flags & RES_LOADED)
- return 0;
+ return false;
return (v->flags & (ANIMATED | UPDATE | DRAWN)) == (ANIMATED | DRAWN);
}
@@ -353,7 +371,7 @@
/**
* Sort sprites from lower y values to build a sprite list.
*/
-void SpritesMan::build_list(SpriteList& l, int (SpritesMan::*test) (vt_entry *)) {
+void SpritesMan::build_list(SpriteList& l, bool (*test) (vt_entry *)) {
int i, j, k;
vt_entry *v;
vt_entry *entry[0x100];
@@ -365,7 +383,7 @@
*/
i = 0;
for (v = game.view_table; v < &game.view_table[MAX_VIEWTABLE]; v++) {
- if ((this->*(test))(v)) {
+ if ((*test)(v)) {
entry[i] = v;
y_val[i] = v->flags & FIXED_PRIORITY ? prio_to_y(v->priority) : v->y_pos;
i++;
Modified: scummvm/trunk/engines/agi/sprite.h
===================================================================
--- scummvm/trunk/engines/agi/sprite.h 2006-05-30 18:55:41 UTC (rev 22782)
+++ scummvm/trunk/engines/agi/sprite.h 2006-05-30 19:48:47 UTC (rev 22783)
@@ -29,27 +29,12 @@
namespace Agi {
-/**
- * Sprite structure.
- * This structure holds information on visible and priority data of
- * a rectangular area of the AGI screen. Sprites are chained in two
- * circular lists, one for updating and other for non-updating sprites.
- */
-struct sprite {
- vt_entry *v; /**< pointer to view table entry */
- int16 x_pos; /**< x coordinate of the sprite */
- int16 y_pos; /**< y coordinate of the sprite */
- int16 x_size; /**< width of the sprite */
- int16 y_size; /**< height of the sprite */
- uint8 *buffer; /**< buffer to store background data */
- uint8 *hires; /**< buffer for hi-res background */
-};
+struct sprite;
typedef Common::List<sprite*> SpriteList;
class SpritesMan {
private:
- /* Speeder bike challenge needs > 67000 */
uint8 *sprite_pool;
uint8 *pool_top;
@@ -67,13 +52,11 @@
int blit_cel(int x, int y, int spr, view_cel *c);
void objs_savearea(sprite *s);
void objs_restorearea(sprite *s);
- int test_updating(vt_entry *v);
- int test_not_updating(vt_entry *v);
FORCEINLINE int prio_to_y(int p);
sprite *new_sprite(vt_entry *v);
void spr_addlist(SpriteList& l, vt_entry *v);
- void build_list(SpriteList& l, int (SpritesMan::*test) (vt_entry *));
+ void build_list(SpriteList& l, bool (*test) (vt_entry *));
void build_upd_blitlist();
void build_nonupd_blitlist();
void free_list(SpriteList& l);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list