https://cdn.discordapp.com/attachments/767590548013711391/784237620867235850/ban...
Thanks again for the explanation of the icons for ships at sea. But I just can't figure out how the function for the global map works. I will provide you with a video so that you can watch that I cannot make a normal display. None of my team members understand how it works.
The video shows that in the sea mode everything works out perfectly. And on the global map, the ship icon changes. I changed the number of rows in the GetTextureUVForShip function, as you said. For the texture 2048x2048 I made 32x32 rows and indicated this in the function. But for some reason it does not work as it should.
What are we doing wrong?
The code itself:
void GetTextureUVForShip(int nShipType, ref rLeft, ref rTop, ref rRight, ref rBottom)
{
float fLeft = 0.0;
float fTop = 0.0;
float fRight = 0.125;
float fBottom = 0.125;//0.25;
if( nShipType> -1 && nShipType<SHIP_TYPES_QUANTITY_WITH_FORT ) // <-- ugeen fix, для тартаны nShipType = 0 !!!!
{
ref rBaseShip = &ShipsTypes[nShipType];
SetShipPictureDataByShipTypeName( rBaseShip.name );
int nV = BI_intNRetValue[0] / 32;
int nH = BI_intNRetValue[0] - nV * 32;
fLeft = stf(nH) * 0.125;
fTop = stf(nV) * 0.125;//0.25;
fRight = fLeft + 0.125;
fBottom = fTop + 0.125;//0.25;
}
rLeft = fLeft;
rTop = fTop;
rRight = fRight;
rBottom = fBottom;
}