OpenXcom Forum

Contributions => Programming => Recycle Bin => Topic started by: Skybuck on May 16, 2022, 02:44:28 am

Title: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 02:44:28 am
Is there a way to make the game switch to true 24 bit ( or  32 bit) color ?

I tried setting _bpp of screen class to 24 and also tried 32 but this produced gray and miss-scaled screen when running/debugging game.

(I did notice some scalers/filters or something seem to be using 32 bits, perhaps it's necessary to enable those to switch to 32 bit ? I would prefer if that is not necessary just to keep the look of the game without any scalers or filters or smoothing or whatever, maybe later I try again with setting those scalers/options)
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 16, 2022, 11:01:05 am
you need rewrite handling of most code that now expect only 8bit colors.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 08:32:57 pm
I think what needs to happen is this:

1. All pixel offset/index/position calculations need to be multiplied by 4.

(To correct the width of the image)
(This will then at least produce a proper image, I expect the entire screen to then look reddish, since only the first byte would be set)

2. To correct the reddish look

A palette/table lookup should be done for the palette index, to acquire a R,G,B, the A (alpha) could be ignored or set to zero or one or 255 not sure which.

I saw the code already has a "deferred palette", what is this ?

(It would be really helpfull if somebody else can work on this problem, that would save me some time so I can work on other things, which are very interesting believe me)
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 16, 2022, 09:07:34 pm
I long ago make experimental branch that switch to 24bit, you can search for it on github.

"It would be really helpfull if somebody else can work on this problem"
If you want somting you need do it yourself.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 09:24:51 pm
I long ago make experimental branch that switch to 24bit, you can search for it on github.

"It would be really helpfull if somebody else can work on this problem"
If you want somting you need do it yourself.

Can you provide any search terms ? Because the ammount of git commits to go through is huge.

Currently I can only see three branches on Main openXCom:
https://github.com/OpenXcom/OpenXcom
master
modio
sdl2

However now I am beginning to understand which branches you are referring to on your own github account/fork/repository:
https://github.com/Yankes/OpenXcom
engine-verify
engine-verify-oxce
stash/big-unit-draw-order
stash/move-cost
fix-bug-in-master
change-random-damage
stash/rule-checks
stash/unit-state-refactor
stash/light-speedup
throw-bug
stash/vector-load-helpers
stash/tallyUnits
stash/end-turn-error-fix
stash/upgrade-facilites
stash/workInProgress
stash/oxce
fixSomeTurnErrors
stash/visibilitySpeedImprovments
stash/fasterDraw
stash/tileSmallSpeedUp
ufoDetectionScripts
stash/cpp17andOtherRandomChanges
constantsLoadingRefactor
stash/globeShadows
updateResorceLoad
stash/surface-refactor
stash/gcc-bug
stash/experimient
stash/movment-refactor
stash/transparencyUnFix
stash/androidTestMerge
stash/expGrainInScripts
stash/rawSurfaces
OpenXcomExtended
stash/testCommit
stash/hangarAndItemUse
ImproveMoveOrder
stash/full32blit

Updated 7 years ago by Yankes
2040
62

old/ColorScript2014Version

XCOM1_sse2

I think you may be referring to: stash/full32blit ???

If not then which brings would I need to search ? or what search terms to search for ?
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 16, 2022, 10:12:15 pm
Because I would need search for it my self where it was, and as you want this, I left it for you as I have different things to do.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 10:26:54 pm
May laptop not so fast, 2.7 ghz.

Perhaps your computer is faster, try this:

git rev-list --all | xargs git grep "search term"

:)

or

git grep "search term" `git show-ref -s --heads`

to search only heads.

When I search for 32bit it does turn up something, not yet sure how to show which branch it is on... investigating...

Better, this does show branch:

git branch -a | cut -c3- | cut -d' ' -f 1 | xargs git grep "string"

From:

# Search in local branches
git branch | cut -c3- | xargs git grep "string"

# Search in remote branches
git branch -r | cut -c3- | xargs git grep "string"

# Search in all (local and remote) branches
git branch -a | cut -c3- | cut -d' ' -f 1 | xargs git grep "string"

# Search in branches, and tags
git show-ref | grep -v "refs/stash" | cut -d' ' -f2 | xargs git grep "string"


Possibly best:
git show-ref | grep -v "refs/stash" | cut -d' ' -f2 | xargs git grep "string"

This turns up something:

new@new-PC MINGW64 /e/SourceCode/OpenXcomYankes (master)
$ git show-ref | grep -v "refs/stash" | cut -d' ' -f2 | xargs git grep "_bpp = 32"
refs/remotes/origin/TFTD:src/Engine/Screen.cpp: _bpp = 32;
refs/remotes/origin/stash/androidTestMerge:src/Engine/Screen.cpp:       _bpp = 32;
refs/remotes/origin/stash/full32blit:src/Engine/Screen.cpp:     _bpp = 32;


Tried:
git checkout origin/stash/full32blit
git branch full32bit
git switch full32bit

Then trying to build in visual studio 2019:

Build started...
1>------ Build started: Project: OpenXcom, Configuration: Debug Win32 ------
1>pch.cpp
1>E:\SourceCode\OpenXcomYankes\src\pch.cpp(1,10): fatal error C1083: Cannot open include file: 'yaml-cpp/yaml.h': No such file or directory
1>Done building project "OpenXcom.2010.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I am starting to fear this code may be to old to be compiled/build by me ?!

So far I have only be able to build/compile OpenXcom which has the nice "dep" (dependency) folder where I can just copy some build dlls to, like sdl and such.

Anyway how to solve this compile problem ?

The source code might still be usuable, maybe a merge into a recent branch or otherwise a copy & paste operation.

But first I would like to determine if this code is somewhat good/usuable for 32 bit surfaces, especially for map draw terrain purposes.

Perhaps you can assist in that ? Since this is yout code perhaps you can compile it on your side ? Or perhaps zip it all up and upload it somewhere so I can download your building project state of 2015.

(Do you use visual studio or something else to build it ?)

I think I have solved it by:

1. Copieing the dep folder of recent builds into this older build.
2. Adding the special file "dep/yaml-cpp.natvis" to the openxcom solution.

Here is a video about it:
https://www.youtube.com/watch?v=hjElvkUSVGc

Now it's building.

(3. also copy game files ofcourse to bin/ufo)
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 11:04:50 pm
Some failures when trying to build this from 2015:

Build started...
1>------ Build started: Project: OpenXcom, Configuration: Debug Win32 ------

<snip>

1>E:\SourceCode\OpenXcomYankes\src\Engine\FlcPlayer.cpp(436,3): error C3861: 'assert': identifier not found
1>E:\SourceCode\OpenXcomYankes\src\Engine\FlcPlayer.cpp(441,2): error C3861: 'assert': identifier not found
1>E:\SourceCode\OpenXcomYankes\src\Engine\FlcPlayer.cpp(749,4): error C3861: 'assert': identifier not found

<snip>

1>E:\SourceCode\OpenXcomYankes\src\Engine\OptionInfo.cpp(112,7): error C2039: 'transform': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\array(20): message : see declaration of 'std'
1>E:\SourceCode\OpenXcomYankes\src\Engine\OptionInfo.cpp(112,16): error C3861: 'transform': identifier not found

1>E:\SourceCode\OpenXcomYankes\src\Engine\Surface.cpp(124,2): error C3861: 'assert': identifier not found

<snip>

1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(217,8): error C2039: 'sort': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\array(20): message : see declaration of 'std'
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(217,12): error C2064: term does not evaluate to a function taking 3 arguments
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(220,8): error C2039: 'sort': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\array(20): message : see declaration of 'std'
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(220,12): error C2064: term does not evaluate to a function taking 3 arguments
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(223,8): error C2039: 'sort': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\array(20): message : see declaration of 'std'
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(223,12): error C2064: term does not evaluate to a function taking 3 arguments
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(226,8): error C2039: 'sort': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\array(20): message : see declaration of 'std'
1>E:\SourceCode\OpenXcomYankes\src\Menu\ListGamesState.cpp(226,12): error C2064: term does not evaluate to a function taking 3 arguments

<snip>

1>Done building project "OpenXcom.2010.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Kinda strange isn't it ?!

Seems like C/C++ language or runtime changed or something ?
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 11:07:53 pm
After disabling/commenting the build errors new problem:

1>------ Build started: Project: OpenXcom, Configuration: Debug Win32 ------
1>FlcPlayer.cpp
1>OptionInfo.cpp
1>Surface.cpp
1>ListGamesState.cpp
1>OpenXcom.rc(11): fatal error RC1015: cannot open include file 'afxres.h'.
1>
1>Done building project "OpenXcom.2010.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


After replacing
//#include "afxres.h"
with
#include <windows.h>

New problems:

uild started...
1>------ Build started: Project: OpenXcom, Configuration: Debug Win32 ------
1>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Vehicle.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Waypoint.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>WeightedOptions.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>MissionSite.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Tile.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Transfer.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Ufo.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Soldier.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Node.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SoldierDeath.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Target.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>ResearchProject.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SaveConverter.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SavedBattleGame.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SavedGame.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>ItemContainer.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>MovingTarget.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Production.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Region.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Craft.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>CraftWeapon.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>EquipmentLayoutItem.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>GameTime.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>BaseFacility.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>BattleItem.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>BattleUnit.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Country.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>AlienBase.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>AlienStrategy.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>AlienMission.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Base.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleUfo.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleTerrain.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SoldierNamePool.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>UfoTrajectory.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleRegion.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleResearch.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Ruleset.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleSoldier.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleCraftWeapon.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleInventory.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleItem.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleManufacture.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Armor.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleBaseFacility.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleCountry.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleCraft.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>SoundDefinition.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>StatString.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleInterface.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Unit.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>AlienRace.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>RuleGlobe.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)

and so forth < snip >

1>Done building project "OpenXcom.2010.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 16, 2022, 11:13:10 pm
I am not good with c/c++ libraries, I hate it and causes nothing but frustration for me.

How to fix this ?

I think some kind of yaml library needs to be added to solution settings somewhere ???

(I consider messing around with c/c++ project settings/libraries a major waste of time for me, cause I rarely understand it, so unless I get some help with this, the buck may end here ;))
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 17, 2022, 12:59:45 am
I have no idea how you manage to get this YAML errors, I would suggest to make clean build.

Beside what point was of grep-ing whole repo code?? last two commits on `stash/full32bit` show that they have something with full 32bit blitting, even if you need serach you simply should look by committer (me) and see what commits could be relevant.

Another think I do not ask your to compile it, only see it as reference how this could be done, I do not have time to analyze how your setup could be mess up or if 7 old version of OXC require some specific changes.

Even if this old do not compiler on your setup you can always try extract this changes and apply it on current version of OXC, there can be conflicts but probably most of logic stay same. One way to see all this:
https://github.com/Yankes/OpenXcom/compare/2fd3a90dc665b22cb71ab5ec7f4700dd5a164233..1d41fdf323ec9ed6af64da3fdc874d323405d9b4
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 19, 2022, 12:22:57 am
How would you normally at the yaml lib to the project/solution ? I think this is the problem, linker can't find the yaml lib ?
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 19, 2022, 11:45:49 am
I do not use VS, compare project file in git to see difference how its handled in new and old version.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 23, 2022, 03:48:19 am
The 32 bit surface code seems to be coming from here, attemping merge + (manual) conflict resolve right now:

https://github.com/AndO3131/OpenXcom/tree/32bit_Surface_Support

Failed for now, going back to Surface32bit branch above... however it again has these annoying yaml link errors ?!

How to add yaml to visual studio so that it does not produce link errors ??
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Yankes on May 23, 2022, 11:13:25 am
ALL version of OXC use yaml, old one and new one. only diffrece could be WHAT exact version of yaml-cpp is used. You already compiled new version of OXC, this means you have working example and you can compare with old to see why do not work.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 30, 2022, 05:43:01 am
Too much code to compare to see why master is working and the 32 bit surface branch is not working, yaml link errors, stack overflow mention some versions of yaml has link problems, perhaps that's it.
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on May 30, 2022, 11:09:25 pm
2015 openxcom version has problems:

1>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Ufo.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Vehicle.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Waypoint.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>WeightedOptions.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Target.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>TerrorSite.obj : error LNK2001: unresolved ext

This sucks hard:

https://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with

Not sure if this is main issue, cannot get yaml working as well ?!

Not including 2015 dependencies in GIT is apperently a major mistake ?!?!?!?
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on June 03, 2022, 03:54:07 am
Solution found for OpeXcom main/vanilla master branch (also my miniXcom branch can do it, tested on it, which has geoscape, basescape and ufopedia removed for faster compile times ;)):

(Main problem is zoom.cpp and scalars/SSE/SIMD code and flipWithZoom. Disabling SSE and Disabling flipWithZoom solves the problem for now, but loses some zoom functionality, game can still be run in different resolutions though and zoom options do have some effect on it like original x 2 or full display.)

// change surface to 32 bit in screen.cpp:
Code: [Select]
void Screen::resetDisplay(bool resetVideo)
{
...
...
...
// _surface = new Surface(_baseWidth, _baseHeight, 0, 0, Screen::use32bitScaler() ? 32 : 8); // only HQX/XBRZ needs 32bpp for this surface; the OpenGL class has its own 32bpp buffer
_surface = new Surface(_baseWidth, _baseHeight, 0, 0, 32); // only HQX/XBRZ needs 32bpp for this surface; the OpenGL class has its own 32bpp buffer
...
...
...
}



// zoom.cpp: disable this code:
Code: [Select]
bool Zoom::haveSSE2()
{
...
...
...
// return (CPUInfo[3] & 0x04000000) ? true : false;
return false;
}

// screen.cpp: disable this code:
Code: [Select]
// if (getWidth() != _baseWidth || getHeight() != _baseHeight || useOpenGL())
// {
// Zoom::flipWithZoom(_surface->getSurface(), _screen, _topBlackBand, _bottomBlackBand, _leftBlackBand, _rightBlackBand, &glOutput);
// }
// else

https://www.youtube.com/watch?v=D6gDZvkBGeE
Title: Re: Switch to true 24 bit (or 32 bit ) color ?
Post by: Skybuck on June 05, 2022, 03:38:29 am
I was kinda hoping that these changes would be enough. I was hoping the game would automatically create a 32 bit map.cpp. But it doesn't do that.

Trying to set it manually to 32 bit, but modifieing interactive surface, causes arrow->set palette( getpalette something) to crash because the palette is null in map::init.

So same problems as before, but now going through them apperently a step at time, very unfortunately reality.

Screen.cpp has some 'deferredPalette' for setPalette perhaps it can help... perhaps even a generic setPalette with deferred palette could be created to provide a generic solution for these kind of problems.

Or perhaps 5 global variables could be used, where in each the palettes for the game are stored and reference those instead of passing palette pointers around.

Instead each control just has to remember which palette number it should use... However this does not yet account for TFTD and/or mods which might have different palettes...

Futher investigations into how palettes are passed around and loaded initially might be required to shed some more light on this...