Added missing files from previous CL.

This commit is contained in:
Justin Marshall
2020-07-05 20:26:23 -07:00
parent 318cfe0cfc
commit f1e75e4a63
5 changed files with 28 additions and 0 deletions
+9
View File
@@ -1030,6 +1030,15 @@ bool CellClass::ScreenCoordsToIsoTile(int x, int y, int &tileX, int &tileY) {
return true;
}
void CellClass::ConvertIsoCoordsToScreen(int& x, int& y) {
int tileX, tileY;
if (!CellClass::ScreenCoordsToIsoTile(x, y, tileX, tileY)) {
return;
}
x = tileX * CELL_PIXEL_W;
y = tileY * CELL_PIXEL_H;
}
bool CellClass::ScreenCoordsToIsoCoords(COORDINATE screenCoord, COORDINATE& isoCoord) {
int x, y;
Map.Coord_To_Pixel(screenCoord, x, y);
+1
View File
@@ -277,6 +277,7 @@ class CellClass
void Decode_Pointers(void);
static void ConvertCoordsToIsometric(int& x, int& y);
static void ConvertIsoCoordsToScreen(int& x, int& y);
static bool ScreenCoordsToIsoTile(int x, int y, int& tileX, int& tileY);
static bool ScreenCoordsToIsoCoords(COORDINATE screenCoord, COORDINATE& isoCoord);
+14
View File
@@ -88,6 +88,20 @@ void GL_FillRect(int color, int x, int y, int width, int height) {
}
}
void GL_FillRect(int _r, int _g, int _b, int x, int y, int width, int height) {
ImVec2 mi(x, y);
ImVec2 ma(x + width, y + height);
float r = _r / 255.0f;
float g = _g / 255.0f;
float b = _b / 255.0f;
if (forceForgegroundRender) {
ImGui::GetForegroundDrawList()->AddRectFilled(mi, ma, ImGui::ColorConvertFloat4ToU32(ImVec4(r, g, b, 1)));
}
else {
ImGui::GetBackgroundDrawList()->AddRectFilled(mi, ma, ImGui::ColorConvertFloat4ToU32(ImVec4(r, g, b, 1)));
}
}
void GL_DrawText(int color, int x, int y, char* text) {
ImVec2 pos(x, y);
if (color == 0 || color == 160) { // This is a hack!
+1
View File
@@ -6,6 +6,7 @@ void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int col
void GL_RenderForeGroundImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0);
void GL_DrawText(int color, int x, int y, char* text);
void GL_FillRect(int color, int x, int y, int width, int height);
void GL_FillRect(int _r, int _g, int _b, int x, int y, int width, int height);
void GL_DrawLine(int color, int x, int y, int dx, int dy);
void GL_ResetClipRect(void);
void GL_SetClipRect(int x, int y, int width, int height);
+3
View File
@@ -110,6 +110,9 @@ class RGBClass
int Blue_Component(void) const {return((Blue << 2) | (Blue >> 6));};
void Set(int color) const;
unsigned char GetRawRed() { return Red; }
unsigned char GetRawGreen() { return Green; }
unsigned char GetRawBlue() { return Blue; }
private:
friend class PaletteClass;