diff options
Diffstat (limited to 'engines/sci/gfx/gfx_resmgr.cpp')
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index b6e13e2bd0..0307fec026 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -50,18 +50,18 @@ struct param_struct { }; GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager) : - _options(options), _driver(driver), _resourceManager(resManager), + _options(options), _driver(driver), _resMan(resManager), _lockCounter(0), _tagLockCounter(0), _staticPalette(0) { gfxr_init_static_palette(); _portBounds = Common::Rect(0, 10, 320, 200); // default value, with a titlebar of 10px - if (!_resourceManager->isVGA()) { + if (!_resMan->isVGA()) { _staticPalette = gfx_sci0_pic_colors->getref(); - } else if (_resourceManager->sciVersion() == SCI_VERSION_1_1) { + } else if (_resMan->sciVersion() == SCI_VERSION_1_1) { debugC(2, kDebugLevelGraphics, "Palettes are not yet supported in this SCI version\n"); #ifdef ENABLE_SCI32 - } else if (_resourceManager->sciVersion() >= SCI_VERSION_2) { + } else if (_resMan->sciVersion() >= SCI_VERSION_2) { debugC(2, kDebugLevelGraphics, "Palettes are not yet supported in this SCI version\n"); #endif } else { @@ -77,7 +77,7 @@ GfxResManager::~GfxResManager() { } int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic, int flags, int default_palette, int nr) { - Resource *res = _resourceManager->findResource(ResourceId(kResourceTypePic, nr), 0); + Resource *res = _resMan->findResource(ResourceId(kResourceTypePic, nr), 0); int need_unscaled = unscaled_pic != NULL; gfxr_pic0_params_t style, basic_style; @@ -96,21 +96,21 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic return GFX_ERROR; if (need_unscaled) { - if (_resourceManager->sciVersion() == SCI_VERSION_1_1) + if (_resMan->sciVersion() == SCI_VERSION_1_1) gfxr_draw_pic11(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _staticPalette, _portBounds); else - gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resourceManager->getViewType(), _staticPalette, _portBounds); + gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resMan->getViewType(), _staticPalette, _portBounds); } if (scaled_pic && scaled_pic->undithered_buffer) memcpy(scaled_pic->visual_map->index_data, scaled_pic->undithered_buffer, scaled_pic->undithered_buffer_size); - if (_resourceManager->sciVersion() == SCI_VERSION_1_1) + if (_resMan->sciVersion() == SCI_VERSION_1_1) gfxr_draw_pic11(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _staticPalette, _portBounds); else - gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resourceManager->getViewType(), _staticPalette, _portBounds); + gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resMan->getViewType(), _staticPalette, _portBounds); - if (_resourceManager->sciVersion() <= SCI_VERSION_1_EGA) { + if (_resMan->sciVersion() <= SCI_VERSION_1_EGA) { if (need_unscaled) gfxr_remove_artifacts_pic0(scaled_pic, unscaled_pic); @@ -146,7 +146,7 @@ int GfxResManager::getOptionsHash(gfx_resource_type_t type) { case GFX_RESOURCE_TYPE_PIC: #ifdef CUSTOM_GRAPHICS_OPTIONS - if (_resourceManager->isVGA()) + if (_resMan->isVGA()) // NOTE: here, it is assumed that the upper port bound is always 10, but this doesn't seem to matter for the // generated options hash anyway return 10; @@ -159,7 +159,7 @@ int GfxResManager::getOptionsHash(gfx_resource_type_t type) { (_options->pic0_brush_mode << 4) | (_options->pic0_line_mode); #else - if (_resourceManager->isVGA()) + if (_resMan->isVGA()) return 10; else #if 0 @@ -352,12 +352,12 @@ gfxr_pic_t *GfxResManager::getPic(int num, int maps, int flags, int default_pale #ifdef CUSTOM_GRAPHICS_OPTIONS if (_options->pic0_unscaled) { need_unscaled = 0; - pic = gfxr_init_pic(&mode_1x1_color_index, GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resourceManager->isVGA()); + pic = gfxr_init_pic(&mode_1x1_color_index, GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resMan->isVGA()); } else - pic = gfxr_init_pic(_driver->getMode(), GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resourceManager->isVGA()); + pic = gfxr_init_pic(_driver->getMode(), GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resMan->isVGA()); #else need_unscaled = 0; - pic = gfxr_init_pic(_driver->getMode(), GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resourceManager->isVGA()); + pic = gfxr_init_pic(_driver->getMode(), GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resMan->isVGA()); #endif if (!pic) { @@ -368,7 +368,7 @@ gfxr_pic_t *GfxResManager::getPic(int num, int maps, int flags, int default_pale gfxr_clear_pic0(pic, SCI_TITLEBAR_SIZE); if (need_unscaled) { - unscaled_pic = gfxr_init_pic(&mode_1x1_color_index, GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resourceManager->isVGA()); + unscaled_pic = gfxr_init_pic(&mode_1x1_color_index, GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _resMan->isVGA()); if (!unscaled_pic) { error("Failed to allocate unscaled pic"); return NULL; @@ -536,15 +536,15 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) { res = resMap.contains(nr) ? resMap[nr] : NULL; if (!res || res->mode != hash) { - Resource *viewRes = _resourceManager->findResource(ResourceId(kResourceTypeView, nr), 0); + Resource *viewRes = _resMan->findResource(ResourceId(kResourceTypeView, nr), 0); if (!viewRes || !viewRes->data) return NULL; int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr); - ViewType viewType = _resourceManager->getViewType(); + ViewType viewType = _resMan->getViewType(); if (viewType == kViewEga) { - int pal = (_resourceManager->sciVersion() <= SCI_VERSION_01) ? -1 : palette; + int pal = (_resMan->sciVersion() <= SCI_VERSION_01) ? -1 : palette; view = getEGAView(resid, viewRes->data, viewRes->size, pal); } else { view = getVGAView(resid, viewRes->data, viewRes->size, viewType); @@ -629,13 +629,13 @@ gfx_bitmap_font_t *GfxResManager::getFont(int num, bool scaled) { // Workaround: lsl1sci mixes its own internal fonts with the global // SCI ones, so we translate them here, by removing their extra bits - if (!resMap.contains(num) && !_resourceManager->testResource(ResourceId(kResourceTypeFont, num))) + if (!resMap.contains(num) && !_resMan->testResource(ResourceId(kResourceTypeFont, num))) num = num & 0x7ff; res = resMap.contains(num) ? resMap[num] : NULL; if (!res || res->mode != hash) { - Resource *fontRes = _resourceManager->findResource(ResourceId(kResourceTypeFont, num), 0); + Resource *fontRes = _resMan->findResource(ResourceId(kResourceTypeFont, num), 0); if (!fontRes || !fontRes->data) return NULL; @@ -672,17 +672,17 @@ gfx_pixmap_t *GfxResManager::getCursor(int num) { res = resMap.contains(num) ? resMap[num] : NULL; if (!res || res->mode != hash) { - Resource *cursorRes = _resourceManager->findResource(ResourceId(kResourceTypeCursor, num), 0); + Resource *cursorRes = _resMan->findResource(ResourceId(kResourceTypeCursor, num), 0); if (!cursorRes || !cursorRes->data) return NULL; - if (_resourceManager->sciVersion() >= SCI_VERSION_1_1) { + if (_resMan->sciVersion() >= SCI_VERSION_1_1) { warning("[GFX] Attempt to retrieve cursor in SCI1.1 or later"); return NULL; } gfx_pixmap_t *cursor = gfxr_draw_cursor(GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, num), - cursorRes->data, cursorRes->size, _resourceManager->sciVersion() > SCI_VERSION_01); + cursorRes->data, cursorRes->size, _resMan->sciVersion() > SCI_VERSION_01); if (!cursor) return NULL; |