Not exactly a modding question, but I figured this would be the best place to ask. If you prefer the question elsewhere, just say so and I move the post.
Anyway, I'm currently trying to merge your brilliant graphical paging feature into my mod. Unfortunately, I have encountered some problems:
- moving around on the game map a lot can lead to a memory allocation failure ("bad allocation")
- when moving the viewscreen by moving the mouse at the edges of the screen, tiles are not revealed as soon as they get into view. This is not a loading time issue, nothing happens until they've been further moved into the center of the screen.
So I'm wondering where I've made a mistake or left something out. I mostly copied the following methods over from the C2C sources:
CvGame
- m_iLastLookatX and m_iLastLookatY
- m_iXResolution and m_iYResolution
- m_bWasGraphicsPagingEnabled
plus getters/setters, initialization and serialization where appropriate
CvGlobals
- m_bGraphicalDetailPagingEnabled plus getter/setter
- getGraphicalDetailPageInRange()
CvPlot
- EvictGraphicsIfNecessary()
- pageGraphicsOut()
- notePageRenderStart(int iRenderArea)
- setShouldHaveFullGraphics(bool bShouldHaveFullGraphics)
- shouldHaveFullGraphics(void) const
- void destroyGraphics()
- inclusion of shouldHaveFullGraphics() checks into updateSymbolDisplay(), updateSymbolVisibility(), updateSymbols(), updateCenterUnit(), updateFeatureSymbolVisibility(), updateFeatureSymbol(), updateRouteSymbol(), updateRiverSymbol(), updateFlagSymbol() and updatePlotBuilder()
- pageGraphicsOut() in the CvPlot destructor
I did not copy over the shouldHaveGraphics() method, because it seems to be related to the viewports feature. Instead, I changed shouldHaveFullGraphics() to the following:
Can anybody help me out here? What did I do wrong?
Anyway, I'm currently trying to merge your brilliant graphical paging feature into my mod. Unfortunately, I have encountered some problems:
- moving around on the game map a lot can lead to a memory allocation failure ("bad allocation")
- when moving the viewscreen by moving the mouse at the edges of the screen, tiles are not revealed as soon as they get into view. This is not a loading time issue, nothing happens until they've been further moved into the center of the screen.
So I'm wondering where I've made a mistake or left something out. I mostly copied the following methods over from the C2C sources:
CvGame
- m_iLastLookatX and m_iLastLookatY
- m_iXResolution and m_iYResolution
- m_bWasGraphicsPagingEnabled
plus getters/setters, initialization and serialization where appropriate
CvGlobals
- m_bGraphicalDetailPagingEnabled plus getter/setter
- getGraphicalDetailPageInRange()
CvPlot
- EvictGraphicsIfNecessary()
- pageGraphicsOut()
- notePageRenderStart(int iRenderArea)
- setShouldHaveFullGraphics(bool bShouldHaveFullGraphics)
- shouldHaveFullGraphics(void) const
- void destroyGraphics()
- inclusion of shouldHaveFullGraphics() checks into updateSymbolDisplay(), updateSymbolVisibility(), updateSymbols(), updateCenterUnit(), updateFeatureSymbolVisibility(), updateFeatureSymbol(), updateRouteSymbol(), updateRiverSymbol(), updateFlagSymbol() and updatePlotBuilder()
- pageGraphicsOut() in the CvPlot destructor
I did not copy over the shouldHaveGraphics() method, because it seems to be related to the viewports feature. Instead, I changed shouldHaveFullGraphics() to the following:
Code:
bool CvPlot::shouldHaveFullGraphics(void) const
{
return (!GC.getGraphicalDetailPagingEnabled() || m_iGraphicsPageIndex != -1) && GC.IsGraphicsInitialized();
}
Can anybody help me out here? What did I do wrong?