Thanks for the detailed bug report, very helpful.
The problem is that Proton handles surfaces like this:
- All surfaces with the same file name are shared internally with the same SurfaceAnim
- Grid settings for how a surface is cut-up for an anim is saved in the SurfaceAnim, and not send it for the blit, like frameXY is.
- Changing the grid settings breaks any previous grid settings set by other people sharing the Surface/SurfaceAnim
I'll have to give this some thought on the best way to fix it. Possibly I'll just change it so OverlayComponents set the grid size every frame.
For now, here is a work around - create a new surface for the second piece. This does waste extra texture memory for no reason though.
Code:
Entity* TmpE1 = CreateOverlayEntity(pGUIEnt, "testE1", "interface/numbers.rttex", 0,0);
SetupAnimEntity(TmpE1 , 4, 4, 0, 0);
//let's force the second instance to keep its own copy, so we won't overwrite its grid setup
Entity* TmpE2 = CreateOverlayEntity(pGUIEnt, "testE2", "", 256,256);
//get access to the overlay component inside the entity we just created above
OverlayRenderComponent *pOverlay = (OverlayRenderComponent*)TmpE2->GetComponentByName("OverlayRender");
//create a new surface manually
SurfaceAnim *pCustomSurface = new SurfaceAnim;
pCustomSurface->LoadFile("interface/numbers.rttex");
//feed it into the SurfaceOverlay to use, and tell it to delete it when done with it
pOverlay->SetSurface(pCustomSurface, true);
SetupAnimEntity(TmpE2 , 2, 2, 0, 0); //now this will work on our custom surface without affecting the first one
Bookmarks