Recent Posts

Pages: [1] 2 3 ... 10
1
OpenXcom Extended (OXCE) / Re: Converting OXCE to rapidyaml
« Last post by Meridian on Today at 11:14:36 am »
Some more updates:

1. cross-compilation for windows in MXE was successful... but the game silently crashes without any errors on loading 'standard' mods, i.e. xcom1

2. linux appimage compilation was successful... but I can't test it yet, will test when I get back home next week

3. compilation for ios in xcode: I had some trial and error to do with project settings, but I managed to add rapidyaml and also set up header file search paths so that I don't get "file not found" errors. The compilation started, but failed somewhere in the middle on something that looks like linker errors? Don't know how to continue... see attached screenshot
2
XPiratez / Re: [MAIN] XPiratez - N9.7.7 12-Sep-2024 Second Coming
« Last post by Juku121 on Today at 03:33:01 am »
Yes, but it's not very well supported UI-wise.
3
OpenXcom Extended (OXCE) / Re: Converting OXCE to rapidyaml
« Last post by Yankes on Today at 01:40:35 am »
@Yankes

https://github.com/Delian0/OpenXcom/commit/e88396630c8a8d596f906faef42413b4062033c7

Meh, I just added all the missing constructors. Some throw exceptions tho ::)

Code: [Select]
YamlNodeReader::YamlNodeReader(const YamlNodeReader&& other) noexceptthis is wrong signature for move constructor. `const&&` is the crazy uncle nobody talks about in C++ community :)
Proper signature do not have `const` as whole point of move constructor is rip out all internals of other object and leave carcass that only job is
to dispose gracefully.

overall I push some commits that fix bugs:
https://github.com/Yankes/OpenXcom/commits/rapidyam/
first one I reported, I simply fix by using proper RVO, this mean by code like:
Code: [Select]
return YAML::YamlRootNodeReader{data, size, fullpath};
and delete of `data` was moved to constructor.
This is not perfect solution as this "steal" this memory but as far I see this was only one use of this constructor.

Second fix was:
Code: [Select]
str = ryml::csubstr(data, str.find("\n---") + 1); // "safe" when file do not have "---", it will crop out whole file but it should be invalid anyway
your version had three problems:
`\r\n` and line like `foo: bar---` both would break save. Not to mention some random file that do not have any `---` in it.
My version handle all cases (in last one trim whole file but this probably will not be problem).



if you do not want some functions to exists, you can mark them as `= deleted;` when compiler would try call them, it will break compilation.


another thought, how much of runtime of loading files is spend on allocations? because we allocate buffer copy content to it and then read from it and delete it.
we could probably in many cases skip this, or at least reuse this memory.
I had helper class `class RawData` that could be good tool for handling memory like this, `YamlRootNodeReader` could even store it and use to implicate parsing.
As free benefits, your class would stop being copyable and only movable because of `std::unique_ptr`.

Another thing would be make all members of `YamlRootNodeReader` as values, not pointers. With this `Parse` would become delegated constructor.


[ps]
For default copy-construcotrs, is seems I miss remember this:
https://en.cppreference.com/w/cpp/language/copy_constructor#Implicitly-defined_copy_constructor

said this is only "deprecated" when you define destructor, this mean we need go "rule of 5" or "rule of 0"

https://en.cppreference.com/w/cpp/language/rule_of_three
4
OpenXcom Extended (OXCE) / Re: Converting OXCE to rapidyaml
« Last post by Delian on November 20, 2024, 10:47:13 pm »
@Yankes

https://github.com/Delian0/OpenXcom/commit/e88396630c8a8d596f906faef42413b4062033c7

Meh, I just added all the missing constructors. Some throw exceptions tho ::)

@Meridian
Researching...
...it seems rapidyaml is trying to forward declare certain std types (like std::string) for some reason. But the macro logic isn't able to determine which standard library it is.

Edit:
"Android NDK uses LLVM's libc++, with support for _LIBCPP_ABI_NAMESPACE inline namespace. Older versions of the Android NDK supported GNU libstdc++, indicated by __GLIBCXX__ or __GLIBCPP__."

You shouldn't have gotten the "unknown standard library" error, because the conditions check for those specific macros. I don't get it...
5
OpenXcom Extended (OXCE) / Re: Converting OXCE to rapidyaml
« Last post by Yankes on November 20, 2024, 10:00:07 pm »
Does memory allocation and freeing work ok now? If you add breakpoints inside s_allocate and s_free, do they get called?

Ok, how about this. Instead of
Code: [Select]
const auto& reader = frec->getYAML();

try
Code: [Select]
YAML::YamlRootNodeReader reader(frec->fullpath);


The code does exactly the same, but without any movement through return values.
I didn't want to add a move constructor to those classes because that allowed me to spot if any copy/move accidentally took place.
The problem is, there's a lot of other places in the code that have a YamlNodeReader as a return value. So if Copy elision doesn't work, I'd most likely have to add a move constructor to all the classes. Maybe you can add a flag to your compiler which applies move elision more aggressively?
this is not problem with memory allocation, this is pure compiler clobbering return value object, second destructor is called on garbage where should be returned object. I did not make minimal test case to say what go wrong. IMHO compiler should return error ("you try return unmovable type") instead of creating UB.
One solution is not try use NRVO but RVO that allow return anything when using`return X{ };` and we can make your code work this way.

Another thing is add fake constructor. because NRVO is allowed only when you have one, but whole point is that is never called, this mean never linked too.
This mean if you have only declaration but not definition (aka no body) then every thing will work, but if it try copy object, linking will fail.

I checkout this more today. Maybe I will find some easy solution.
6
OpenXcom Extended (OXCE) / Re: Converting OXCE to rapidyaml
« Last post by Meridian on November 20, 2024, 09:27:55 pm »
Another update, the Android build was not successful.

What I did so far:
1. merged main branch into android branch -- that was actually pretty easy, only a few merge conflicts
2. updated cmake in the android project -- see screenshot 1
3. build failed -- see screnshot 2
4. I looked at the source code line indicated in the error message, but don't really know what to do -- see screenshot 3

Trying to solve it with Yankes atm.
7
The X-Com Files / Re: The X-Com Files - 3.5: Whispers In The Dark
« Last post by Mathel on November 20, 2024, 08:52:03 pm »
I don't repack it. I just drop the mods into the /mods folder. However, since it is a simple .zip archive, anything even slightly capable of packaging should work. Master Commander (what I use to browse files on my disk) takes 3 minutes to zip the main mod (XComFiles) up.
8
XPiratez / Re: Tribute song
« Last post by ZoA on November 20, 2024, 08:44:20 pm »
I have trouble getting Suno to reliably generate female vocals. This is is closest I got and she sounds like she is juicing on anavar, but that actually might be setting appropriate  ;D

9
OXCE Suggestions NEW / Re: (QoL) View soldier stats from the sell screen
« Last post by Meridian on November 20, 2024, 08:15:32 pm »
You can sack soldiers directly from the soldier stats screen, no need to go anywhere.
10
OXCE Suggestions NEW / (QoL) Quick Goto soldier who can see target
« Last post by Zesty on November 20, 2024, 08:01:33 pm »
Clicking the green/red 1/2/3/4 etc for enemies takes you to them. It would be nice if you could control click or right click or something on those icons to go to a soldier who can see them (ideally I'd choose to have it go to whoever has the most TUs remaining). If no soldiers can currently see the enemy then do nothing.
Pages: [1] 2 3 ... 10