(2022/09/30)
TileMapとTileMapViewportで、HWAにも関わらずパフォーマンスが出ないという話があり、その不具合の検証と修正を行いました。


TileMapとTileMapViewportの HWA対応版
Extension



以下、変更点になります


Only two final changes were made. If the texture is re-created at the time of updateTexture When calling from multiple TileMapViewPort objects A phenomenon was observed in which a unique address was not stored. Since then, I don't know why. The texture address of the tileset referenced from DisplayRunObject is also constantly changing (and it is running as GDI) It was very heavy operation. ============================================================================================================== TileMap - Tileset.h - "void updateTexture()" ------------------- /* if (surface) { texture = new cSurface; texture->Create(surface->GetWidth(), surface->GetHeight(), getPrototype(surface->GetDepth(), renderMode)); copyBlit(*surface, *texture); texture->SetTransparentColor(surface->GetTransparentColor()); } */ ------------------- Remove texture regeneration UPDATE. ============================================================================================================== TileMapViewPort - DisplayRunObject.cpp - "short WINAPI DLLExport DisplayRunObject(LPRDATA rdPtr)" ------------------- // Cache all tileset pointers for faster access cSurface * tilesetCache[256] = {}; for (unsigned i = 0; i < rdPtr->p->tilesets->size(); ++i) { tilesetCache[i] = (*rdPtr->p->tilesets)[i].texture; if ( tilesetCache[i] == NULL) { LPSURFACE proto; GetSurfacePrototype(&proto, ps->GetDepth(), ST_HWA_ROMTEXTURE, ps->GetDriver()); tilesetCache[i] = new cSurface; tilesetCache[i]->Create((*rdPtr->p->tilesets)[i].surface->GetWidth(), (*rdPtr->p->tilesets)[i].surface->GetHeight(), proto); (*rdPtr->p->tilesets)[i].surface->Blit(*tilesetCache[i]); (*rdPtr->p->tilesets)[i].texture = tilesetCache[i]; } } ------------------- Changed to HWA cache generation at draw time. ============================================================================================================== Difference only https://github.com/clickteam-plugin/TileMap https://github.com/clickteam-plugin/TileMapViewport