Isometric tiles now render the entire screen. Off screen tiles will not be rendered.

This commit is contained in:
Justin Marshall
2020-07-02 21:10:52 -07:00
parent a1687554cc
commit e2fcb059ec
4 changed files with 110 additions and 31 deletions
+2
View File
@@ -1008,10 +1008,12 @@ void CellClass::ConvertCoordsToIsometric(int& x, int& y) {
y = sy;// + (CELL_PIXEL_W / 2);
x = x + (ScreenWidth / 2);
y = y - (ScreenWidth / 4);
}
bool CellClass::ScreenCoordsToIsoTile(int x, int y, int &tileX, int &tileY) {
x = x - (ScreenWidth / 2);
y = y + (ScreenWidth / 4);
float tempPt_x = (2 * y + x) / 2;
float tempPt_y = (2 * y - x) / 2;
+2 -2
View File
@@ -571,10 +571,10 @@ short const * DisplayClass::Text_Overlap_List(char const * text, int x, int y) c
void DisplayClass::Set_View_Dimensions(int x, int y, int width, int height)
{
if (width == -1) width = SeenBuff.Get_Width();
TacLeptonWidth = Pixel_To_Lepton( width - x) * 2;
TacLeptonWidth = Pixel_To_Lepton( width - x) * 2.5;
if (height == -1) height = SeenBuff.Get_Height();
TacLeptonHeight = Pixel_To_Lepton(height - y) * 2;
TacLeptonHeight = Pixel_To_Lepton(height - y) * 4;
/*
** Adjust the tactical cell if it is now in an invalid position
+8
View File
@@ -25,6 +25,14 @@ void GL_ResetClipRect(void) {
}
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId) {
if(x < 0 || y < 0) {
return;
}
if(x >= ScreenWidth || y >= ScreenHeight) {
return;
}
ImVec2 mi(x, y);
ImVec2 ma(x + width, y + height);