aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-17 23:43:32 +0000
committerFilippos Karapetis2009-03-17 23:43:32 +0000
commit5a77b89f92b8dd9aa8c102d334a54d8c6388e450 (patch)
treea0e3f2367f1b129f36b532afc6b5701beb2bbaaa
parent4c498d34561b4f2fdc9c7f43d15e104d24fd22df (diff)
downloadscummvm-rg350-5a77b89f92b8dd9aa8c102d334a54d8c6388e450.tar.gz
scummvm-rg350-5a77b89f92b8dd9aa8c102d334a54d8c6388e450.tar.bz2
scummvm-rg350-5a77b89f92b8dd9aa8c102d334a54d8c6388e450.zip
Cleanup
svn-id: r39501
-rw-r--r--engines/sci/gfx/resmgr.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/engines/sci/gfx/resmgr.cpp b/engines/sci/gfx/resmgr.cpp
index 24dea732d2..890e5842d2 100644
--- a/engines/sci/gfx/resmgr.cpp
+++ b/engines/sci/gfx/resmgr.cpp
@@ -502,11 +502,7 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
view = res->unscaled_data.view;
}
- if (*loop < 0)
- *loop = 0;
- else
- if (*loop >= view->loops_nr)
- *loop = view->loops_nr - 1;
+ *loop = CLIP<int>(*loop, 0, view->loops_nr - 1);
if (*loop < 0) {
GFXWARN("View %d has no loops\n", nr);
@@ -519,12 +515,7 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
return NULL;
}
- if (*cel < 0) {
- sciprintf("Resetting cel! %d\n", *cel);
- *cel = 0;
- } else
- if (*cel >= loop_data->cels_nr)
- *cel = loop_data->cels_nr - 1;
+ *cel = CLIP<int>(*cel, 0, loop_data->cels_nr - 1);
if (*cel < 0) {
GFXWARN("View %d loop %d has no cels\n", nr, *loop);