mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Initial Prism zap support.
This commit is contained in:
@@ -67,6 +67,17 @@ void GL_ResetClipRect(void) {
|
||||
ImGui::GetBackgroundDrawList()->PopClipRect();
|
||||
}
|
||||
|
||||
void GL_RenderLine(int x1, int y1, int x2, int y2, int r, int g, int b, float thickness) {
|
||||
ImVec2 p1(x1, y1);
|
||||
ImVec2 p2(x2, y2);
|
||||
|
||||
float _r = r / 255.0f;
|
||||
float _g = g / 255.0f;
|
||||
float _b = b / 255.0f;
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddLine(p1, p2, ImGui::ColorConvertFloat4ToU32(ImVec4(_r, _g, _b, 1)), thickness);
|
||||
}
|
||||
|
||||
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId, bool ignoreOutOfScreenPixels, bool flipUV) {
|
||||
if (!ignoreOutOfScreenPixels)
|
||||
{
|
||||
|
||||
@@ -24,4 +24,5 @@ void GL_DrawForegroundText(int color, float fontsize, float r, float g, float b,
|
||||
void GL_SetColor(float r, float g, float b);
|
||||
void GL_SetRenderTexture(RenderTexture* renderTexture);
|
||||
void GL_EnableBlend(GLBlendType blendType);
|
||||
void GL_DrawText(int color, float fontsize, float r, float g, float b, int x, int y, char* text);
|
||||
void GL_DrawText(int color, float fontsize, float r, float g, float b, int x, int y, char* text);
|
||||
void GL_RenderLine(int x1, int y1, int x2, int y2, int r, int g, int b, float thickness);
|
||||
@@ -703,6 +703,8 @@ bool RulesClass::Heap_Maximums(CCINIClass & ini)
|
||||
new WeaponTypeClass("AirAssault");
|
||||
#endif
|
||||
|
||||
new WeaponTypeClass("PrismZap");
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -3023,6 +3023,15 @@ bool TechnoClass::Electric_Zap(COORDINATE target_coord, int which, WindowNumberT
|
||||
gonnadraw = true;
|
||||
}
|
||||
|
||||
TechnoTypeClass const& tclass = *Techno_Type_Class();
|
||||
WeaponTypeClass const* weapon = (which == 0) ? tclass.PrimaryWeapon : tclass.SecondaryWeapon;
|
||||
if (weapon->Prism) {
|
||||
CellClass::ConvertCoordsToIsometric(x, y);
|
||||
CellClass::ConvertCoordsToIsometric(x1, y1);
|
||||
GL_RenderLine(x, y, x1, y1, 163, 203, 205, 3.0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int _shape[]={ 2, 3, 1, 0, 2, 3, 1, 0};
|
||||
static int _xadd[8][8]={
|
||||
{ 0, 8, 8, 8, 0, 0, 0, 0},
|
||||
@@ -3091,6 +3100,7 @@ bool TechnoClass::Electric_Zap(COORDINATE target_coord, int which, WindowNumberT
|
||||
int xx = x;
|
||||
int yy = y;
|
||||
CellClass::ConvertCoordsToIsometric(xx, yy);
|
||||
|
||||
if (remap != NULL) {
|
||||
CC_Draw_Shape(this, "LITNING", LightningShapes, _shape[facing]+(shots ? 4 : 0), xx, yy, (window != WINDOW_PARTIAL) ? window : WINDOW_TACTICAL, SHAPE_FADING|SHAPE_CENTER|SHAPE_WIN_REL, remap);
|
||||
} else {
|
||||
|
||||
@@ -211,6 +211,7 @@ bool WeaponTypeClass::Read_INI(CCINIClass & ini)
|
||||
Anim = ini.Get_AnimType(Name(), "Anim", Anim);
|
||||
IsCamera = ini.Get_Bool(Name(), "Camera", IsCamera);
|
||||
IsElectric = ini.Get_Bool(Name(), "Charges", IsElectric);
|
||||
Prism = ini.Get_Bool(Name(), "Prism", 0);
|
||||
IsTurboBoosted = ini.Get_Bool(Name(), "TurboBoost", IsTurboBoosted);
|
||||
|
||||
WarheadType wtype = (WarheadPtr != NULL) ? WarheadType(WarheadPtr->ID) : WARHEAD_NONE;
|
||||
|
||||
@@ -154,6 +154,9 @@ class WeaponTypeClass
|
||||
** This is the animation to display at the firing coordinate.
|
||||
*/
|
||||
AnimType Anim;
|
||||
|
||||
// Is this a prism weapon.
|
||||
unsigned Prism:1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user