From a33f7bfa2589dafd13384a73b1a29d8bacc8feaf Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Sun, 12 Jul 2020 09:01:36 -0700 Subject: [PATCH] Added new blend types, added lighting to first soviet mission. --- SCU01EA.INI | 23 ++++++++++++++++++++++- code/redalert/light.cpp | 2 +- code/redalert/newblit.cpp | 8 ++++++-- code/redalert/newblit.h | 3 ++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/SCU01EA.INI b/SCU01EA.INI index a0ea673..82d3fd4 100644 --- a/SCU01EA.INI +++ b/SCU01EA.INI @@ -137,6 +137,27 @@ FillSilos=no TruckCrate=no Percent=0 +[Lights] +0=light0,1015035008,1.000000,1.000000,1.000000,75.000000,1 +1=light1,994063296,1.000000,1.000000,1.000000,75.000000,1 +2=light2,1031812736,1.000000,1.000000,1.000000,75.000000,1 +3=light3,1069561280,1.000000,1.000000,1.000000,75.000000,1 +4=light4,1119892800,1.000000,1.000000,1.000000,75.000000,1 +5=light5,1019230528,1.000000,1.000000,1.000000,75.000000,1 +6=light6,1027620032,1.000000,1.000000,1.000000,75.000000,1 +7=light7,1010839616,1.000000,1.000000,1.000000,75.000000,1 +8=light8,1019227072,1.000000,1.000000,1.000000,75.000000,1 +9=light9,1027614528,1.000000,1.000000,1.000000,75.000000,1 +10=light10,968898112,1.000000,1.000000,1.000000,75.000000,1 +11=light11,918566336,1.000000,1.000000,1.000000,75.000000,1 +12=light12,868234688,1.000000,1.000000,1.000000,75.000000,1 +13=light13,826291648,1.000000,1.000000,1.000000,75.000000,1 +14=light14,792737344,1.000000,1.000000,1.000000,75.000000,1 +15=light15,750794176,1.000000,1.000000,1.000000,75.000000,1 +16=light16,717239744,1.000000,1.000000,1.000000,75.000000,1 +17=light17,679490944,1.000000,1.000000,1.000000,75.000000,1 +18=light18,641742272,1.000000,1.000000,1.000000,75.000000,1 + [Map] Theater=SNOW X=16 @@ -263,5 +284,5 @@ Count=0 4=lesson. [Digest] -1=7835Am9csNI1jFgHaaJZovKwZmk= +1=2eLvkdtgyT5wfldTXfgciPaU78g= diff --git a/code/redalert/light.cpp b/code/redalert/light.cpp index a9a9ae8..381331d 100644 --- a/code/redalert/light.cpp +++ b/code/redalert/light.cpp @@ -68,7 +68,7 @@ void LightManager::RenderLights(void) { GL_SetRenderTexture(NULL); - GL_EnableBlend(GL_BLEND_MULT); + GL_EnableBlend(GL_BLEND_ADD); GL_RenderImage(hdrLightBufferTexture, 0, 0, ScreenWidth, ScreenHeight); GL_EnableBlend(GL_BLEND_NONE); } diff --git a/code/redalert/newblit.cpp b/code/redalert/newblit.cpp index 8dd2628..527938e 100644 --- a/code/redalert/newblit.cpp +++ b/code/redalert/newblit.cpp @@ -19,7 +19,7 @@ static void GL_SetRenderTextureCallback(const ImDrawList* parent_list, const ImD } else { renderTexture->MakeCurrent(); - glClearColor(0.5, 0.5, 0.5, 1.0); + glClearColor(0.45, 0.45, 0.45, 1.0); glClear(GL_COLOR_BUFFER_BIT); } } @@ -31,10 +31,14 @@ static void GL_EnableBlendCallback(const ImDrawList* parent_list, const ImDrawCm glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - else { + else if(blendType == GL_BLEND_ADD) { glBlendEquation(GL_ADD); glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); } + else { + glBlendEquation(GL_MULT); + glBlendFunc(GL_DST_COLOR, GL_ZERO); + } } void GL_EnableBlend(GLBlendType blendType) { diff --git a/code/redalert/newblit.h b/code/redalert/newblit.h index c7b4723..5c1b748 100644 --- a/code/redalert/newblit.h +++ b/code/redalert/newblit.h @@ -6,7 +6,8 @@ class RenderTexture; enum GLBlendType { GL_BLEND_NONE = 0, - GL_BLEND_MULT + GL_BLEND_MULT, + GL_BLEND_ADD }; void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0);