diff --git a/Common/util/wgt2allg.cpp b/Common/util/wgt2allg.cpp index cdab749a8a8..0926ca34f08 100644 --- a/Common/util/wgt2allg.cpp +++ b/Common/util/wgt2allg.cpp @@ -16,6 +16,37 @@ using namespace AGS::Common; + void __my_setcolor(int *ctset, int newcol, int wantColDep) + { + if (wantColDep == 8) + { + ctset[0] = newcol; + } + else if ((newcol >= 32) && (wantColDep > 16)) + { + // true-color + ctset[0] = makeacol32(getr16(newcol), getg16(newcol), getb16(newcol), 255); + } + else if (newcol >= 32) + { + // If it's 15-bit, convert the color + if (wantColDep == 15) + ctset[0] = (newcol & 0x001f) | ((newcol >> 1) & 0x7fe0); + else + ctset[0] = newcol; + } + else + { + // indexed color, use palette + ctset[0] = makecol_depth(wantColDep, col_lookups[newcol] >> 16, + (col_lookups[newcol] >> 8) & 0x000ff, col_lookups[newcol] & 0x000ff); + + // in case it's used on an alpha-channel sprite, make sure it's visible + if (wantColDep > 16) + ctset[0] |= 0xff000000; + } + } + void wsetrgb(int coll, int r, int g, int b, RGB * pall) { pall[coll].r = r; diff --git a/Editor/AGS.Native/NativeDLL.vcxproj b/Editor/AGS.Native/NativeDLL.vcxproj index 147ad4982cb..ebd84a9f6cd 100644 --- a/Editor/AGS.Native/NativeDLL.vcxproj +++ b/Editor/AGS.Native/NativeDLL.vcxproj @@ -331,7 +331,6 @@ copy "$(TargetPath)" "$(SolutionDir)..\Editor\References\x64" - diff --git a/Editor/AGS.Native/NativeDLL.vcxproj.filters b/Editor/AGS.Native/NativeDLL.vcxproj.filters index 95ee6a89d4f..75b6dcc5d42 100644 --- a/Editor/AGS.Native/NativeDLL.vcxproj.filters +++ b/Editor/AGS.Native/NativeDLL.vcxproj.filters @@ -52,9 +52,6 @@ Source Files - - Source Files - Source Files diff --git a/Editor/Native/color_native.cpp b/Editor/Native/color_native.cpp deleted file mode 100644 index 6187352845d..00000000000 --- a/Editor/Native/color_native.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//============================================================================= -// -// Adventure Game Studio (AGS) -// -// Copyright (C) 1999-2011 Chris Jones and 2011-2024 various contributors -// The full list of copyright holders can be found in the Copyright.txt -// file, which is part of this source code distribution. -// -// The AGS source code is provided under the Artistic License 2.0. -// A copy of this license can be found in the file License.txt and at -// https://opensource.org/license/artistic-2-0/ -// -//============================================================================= -// -// Implementation from wgt2allg.cpp specific to AGS.Native (Editor). -// -//============================================================================= - -#include "util/wgt2allg.h" -#include "gfx/bitmap.h" - -void __my_setcolor(int *ctset, int newcol, int wantColDep) -{ - if (wantColDep == 8) - ctset[0] = newcol; - else if (newcol & 0x40000000) // already calculated it - ctset[0] = newcol; - else if ((newcol >= 32) && (wantColDep > 16)) { - // true-color - ctset[0] = makeacol32(getr16(newcol), getg16(newcol), getb16(newcol), 255); - } - else if (newcol >= 32) { - // If it's 15-bit, convert the color - if (wantColDep == 15) - ctset[0] = (newcol & 0x001f) | ((newcol >> 1) & 0x7fe0); - else - ctset[0] = newcol; - } - else - { - ctset[0] = makecol_depth(wantColDep, col_lookups[newcol] >> 16, - (col_lookups[newcol] >> 8) & 0x000ff, col_lookups[newcol] & 0x000ff); - - // in case it's used on an alpha-channel sprite, make sure it's visible - if (wantColDep > 16) - ctset[0] |= 0xff000000; - } -} diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index 77c2b092716..7001d08f9f2 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -312,7 +312,6 @@ target_sources(engine gfx/ali3dsw.h gfx/blender.cpp gfx/blender.h - gfx/color_engine.cpp gfx/ddb.h gfx/gfx_util.cpp gfx/gfx_util.h diff --git a/Engine/gfx/color_engine.cpp b/Engine/gfx/color_engine.cpp deleted file mode 100644 index 5d6afb80f70..00000000000 --- a/Engine/gfx/color_engine.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//============================================================================= -// -// Adventure Game Studio (AGS) -// -// Copyright (C) 1999-2011 Chris Jones and 2011-2024 various contributors -// The full list of copyright holders can be found in the Copyright.txt -// file, which is part of this source code distribution. -// -// The AGS source code is provided under the Artistic License 2.0. -// A copy of this license can be found in the file License.txt and at -// https://opensource.org/license/artistic-2-0/ -// -//============================================================================= -// -// Implementation from wgt2allg.cpp specific to Engine runtime -// -//============================================================================= -#include -#include "util/wgt2allg.h" - -void __my_setcolor(int *ctset, int newcol, int wantColDep) - { - if (wantColDep == 8) - ctset[0] = newcol; - else if (newcol & 0x40000000) // already calculated it - ctset[0] = newcol; - else if ((newcol >= 32) && (wantColDep > 16)) { - // true-color -#ifdef SWAP_RB_HICOL_FOR_32to24_32 - ctset[0] = makeacol32(getb16(newcol), getg16(newcol), getr16(newcol), 255); -#else - ctset[0] = makeacol32(getr16(newcol), getg16(newcol), getb16(newcol), 255); -#endif - } - else if (newcol >= 32) { - - // If it's 15-bit, convert the color - if (wantColDep == 15) - ctset[0] = (newcol & 0x001f) | ((newcol >> 1) & 0x7fe0); - else - ctset[0] = newcol; - } - else - { - ctset[0] = makecol_depth(wantColDep, col_lookups[newcol] >> 16, - (col_lookups[newcol] >> 8) & 0x000ff, col_lookups[newcol] & 0x000ff); - - // in case it's used on an alpha-channel sprite, make sure it's visible - if (wantColDep > 16) - ctset[0] |= 0xff000000; - } - - // if it's 32-bit color, signify that the colour has been calculated - //if (wantColDep >= 24) -// ctset[0] |= 0x40000000; - } diff --git a/Solutions/Engine.App/Engine.App.vcxproj b/Solutions/Engine.App/Engine.App.vcxproj index 9d52b753850..dd0cc6a169a 100644 --- a/Solutions/Engine.App/Engine.App.vcxproj +++ b/Solutions/Engine.App/Engine.App.vcxproj @@ -593,7 +593,6 @@ - diff --git a/Solutions/Engine.App/Engine.App.vcxproj.filters b/Solutions/Engine.App/Engine.App.vcxproj.filters index ae3295820b5..cc7f9935b02 100644 --- a/Solutions/Engine.App/Engine.App.vcxproj.filters +++ b/Solutions/Engine.App/Engine.App.vcxproj.filters @@ -516,9 +516,6 @@ Source Files\gfx - - Source Files\gfx - Source Files\gfx