mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Added missing files from previous CL.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user