Ok since I backed off from the new rules stuff ( for now) I was thinking about doing (what I thought) something simpler.
Currently the game creates Icons around a city when a franchise is created etc. I wanted to create code that would let me push a file through and create an icon in the mod possibility of religions, or just re doing my showonmap for wonders or buildings and a few other ideas anyways the code currently works like this:
Something happens (say franchise) it sets a bool in CityData.cpp then tiledraw.cpp accesses that bool in the tiledraw:: DrawCityNames function which then uses tiledraw:: DrawCityIcons.
the Icons are a predetermine set of icons in the code. Hard coded. I creatd some code in drawcity icons for buildings (its at the end but I'll leave some original code):
I tried to access a file like martin set up for citystyles in scenarioeditor.cpp (using the CPIcon name). But my code here causes this problem:
So I hope my problem is smple. Basically the drawing code only recognizezs these Pixel16 icon files but the way Martin called CPIcon was to use a char. Is there a way I can get it to draw the file? Or do I have to create a whole new drawing function?
thanks.
Currently the game creates Icons around a city when a franchise is created etc. I wanted to create code that would let me push a file through and create an icon in the mod possibility of religions, or just re doing my showonmap for wonders or buildings and a few other ideas anyways the code currently works like this:
Something happens (say franchise) it sets a bool in CityData.cpp then tiledraw.cpp accesses that bool in the tiledraw:: DrawCityNames function which then uses tiledraw:: DrawCityIcons.
the Icons are a predetermine set of icons in the code. Hard coded. I creatd some code in drawcity icons for buildings (its at the end but I'll leave some original code):
Code:
void TiledMap:: DrawCityIcons(aui_Surface *surf, MapPoint const & pos, sint32 owner, bool fog, RECT &popRect, BOOL isBioInfected, BOOL isNanoInfected, BOOL isConverted, BOOL isFranchised, BOOL isInjoined, BOOL wasHappinessAttacked, sint32 bioInfectedOwner, sint32 nanoInfectedOwner, sint32 convertedOwner, sint32 franchiseOwner, sint32 injoinedOwner, sint32 happinessAttackOwner, uint32 slaveBits, BOOL isRioting, BOOL hasAirport, BOOL hasSleepingUnits, BOOL isWatchful) { TileSet * tileSet = GetTileSet(); POINT iconDim = tileSet->GetMapIconDimensions(MAPICON_BIODISEASE); RECT iconRect; iconRect.left = popRect.right + 3; iconRect.right = iconRect.left + iconDim.x + 1; iconRect.top = popRect.top; iconRect.bottom = iconRect.top + iconDim.y + 1; if (iconRect.left < 0 || iconRect.top < 0 || iconRect.right >= surf->Width() || iconRect.bottom >= surf->Height()) return; Pixel16 color = GetPlayerColor(owner, fog); Pixel16 * cityIcon; [i]...a bunch of bools like Watchful...[/i] if (isWatchful) { cityIcon = tileSet->GetMapIconData(MAPICON_WATCHFUL); Assert(cityIcon); if (!cityIcon) return; cityIcon = tileSet->GetMapIconData(MAPICON_WATCHFUL); iconDim = tileSet->GetMapIconDimensions(MAPICON_WATCHFUL); color = GetColor(COLOR_YELLOW, fog); DrawColorizedOverlay(cityIcon, surf, iconRect.left, iconRect.top, color); AddDirtyRectToMix(iconRect); iconRect.left += iconDim.x; iconRect.right += iconDim.x; } //emod to draw city icons for wonders and buildings [b] for(sint32 b = 0; b < g_theBuildingDB->NumRecords(); b++){ Unit unit; CityData *cityData = unit.GetData()->GetCityData(); UnseenCellCarton ucell; owner = ucell.m_unseenCell->GetCityOwner(); if(cityData->GetImprovements() & ((uint64)1 << b)){ const BuildingRecord *rec = g_theBuildingDB->Get(b, g_player[owner]->GetGovernmentType()); MBCHAR const * iconName; cityIcon = if (rec->GetShowAsIcon(iconName))[/b] { color = GetColor(COLOR_YELLOW, fog); DrawColorizedOverlay(iconName, surf, iconRect.left, iconRect.top, color); AddDirtyRectToMix(iconRect); iconRect.left += iconDim.x; iconRect.right += iconDim.x; } } } //end emod }
I tried to access a file like martin set up for citystyles in scenarioeditor.cpp (using the CPIcon name). But my code here causes this problem:
Code:
tiledraw.cpp(4216) : error C2664: 'DrawColorizedOverlay' : cannot convert parameter 1 from 'const char *' to 'unsigned short *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
thanks.
Comment