Forum Replies Created
-
AuthorPosts
-
Ugh…those includes in
commonmay be an issue. I’m trying to avoid using WinSock entirely as MWEdit doesn’t use any kind of network code and that would cause unneeded bloat. Can be added if needed, though, if things can’t be whittled down enough.Unless I’m mistaken, shouldn’t WinSock 2 be used after the basic Windows header so it overrides the old version? Of course, as we know, most OS-specific code is arcane to me as I rarely work on code that needs to interface directly with the underlying system.
Common will be rewritten eventually. The large integer union looks like an artifact from the days where 64-bit numbers were a novelty and can probably be replaced with
std::uint64_torstd::int64_t. As for the other stuff, that’ll need some additional investigation.Trying to get the Windows code working properly is beginning to get a little discouraging. 🙁
Edit:
Just opened a task item to fix the loss of precision in the UI code. We have stuff like this:
pEnchantData->MagMax = (short)(std::atoi(Buffer));
Here’s the struct for it:typedef struct { short EffectID; byte SkillID; byte AttributeID; long RangeType; long Area; long Duration; long MagMin; long MagMax; } enchanteffect_t;Essentially, it’s converting the string first to a 32-bit integer, then casting it as a 16-bit integer, and finally storing it in a 64-bit integer. This sort of thing occurs frequently in the code. That could cause some issues. Ideally, we’d convert the string directly to the correct type so that all data is properly preserved. We’ll want to investigate things to determine the correct integer types and change the code accordingly.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
Yeah, I’m not sure what the XML parser is for at the moment. Even in the other projects, I didn’t see anything that used it. From what I could tell, CSV was the only file parser that was used in the extra file support but I haven’t finished going through all of the code in detail yet (I’m currently on the undo stack support).
What does OpenMW use XML for? I must have missed that
Made some compatibility changes:
I swapped out a non-portable standard library extension with functions in the standard library:if (!(/*__iscsym(pUndo->GetChar())*/std::isalnum(pUndo->GetChar()) || (pUndo->GetChar() == '_'))) { break; }The commented function is what was there before. It was an extension to
cctypeso I removed it in favor of the combination that exists on all platforms. Minor change but I figured, “Why the hell not? I’m adding the include anyways”. 🙂Thanks. Will make a note of adding the control style commands 🙂
I haven’t been including
windows.hso we’ll see what happens with the Windows integer types (MSDN didn’t specify that I had to include that file for their type-defs). Was never a fan of how Microsoft made things more complicated than needed but we’ll get it sorted out. 🙂-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
Unfortunately, without that flag, it exposed a known bug in the Windows API where it tries to use WinSock 1 even though it’s unneeded where MFC needs version 2 and refused to build. Release had no issues so it’s something on Microsoft’s end with the
_DEBUGflag and disabling everything extra and manually adding only the stuff we use was the only way to fix it (I hope, we’ll find out once I finish adding the headers and try to build it). Here are the details. It’s a bit of a mess. If it gets too frustrating, I may fast track ripping out the Windows API but I hope to do that later once the code quality has improved more.Where do we need to call
InitCommonControlsEx?Thanks, I’ll work on getting together the control categories in use 🙂
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
Looks like MinGW supports them in resource files. Not sure about standalone ones but referencing them in the resource file with
#include "winuser.h" // required for RT_MANIFEST constant CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "application.manifest"should be fine. Not sure which method I prefer but it looks like it’ll work regardless for cross-compiling. Not sure if we’ll want anything else in the manifest. Maybe the runtime version since we’re using the newest? On Linux, that’s handled by the package manager settings file
Still need to research
InitCommonControlsEx(const INITCOMMONCONTROLSEX *picce)and figure out how that works-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
-
This reply was modified 2 months, 3 weeks ago by
Spastic Hamburger.
This could be a result of MFC updates over the years, where the old stuff was superseded by newer functions. Here’s a sample of what I’m looking at:
int CCustRichEdit::GetCurLineCharPos() { long StartChar; long EndChar; int CharPos; GetSel(StartChar, EndChar); CharPos = StartChar - LineIndex(-1); return CharPos; }GetSel() isn’t defined in MWEdit so it’s probably coming from MFC somewhere.
Edit: Looks like it’s coming from the parent class after all: https://learn.microsoft.com/en-us/cpp/mfc/reference/cricheditctrl-class?view=msvc-170#getsel
So I just missed it. That mystery has been solved.
CMake is supposed to have support for
.manifestfiles like it does for resource files so I’ll try adding the file to thetarget_sourcescommand first.stdafx.hwould be nice but it broke when I turned onWIN32_LEAN_AND_MEANfor some reason.
Failing CMake, we should be able to tell the CI to run the manifest embedding command. No idea how to useInitCommonControls()and its newer version (InitCommonControlsEx(const INITCOMMONCONTROLSEX *picce)) makes even less sense to me as they don’t provide examples but we’ll get there when we get there. Things may be different when we switch GUI toolkits but it doesn’t hurt to do the minor work needed to make the GUI look more pleasing in the time leading up to the GUI change 🙂The way the CMake script is being set up, it only worries about the
.rcand.manifestfiles on Windows and ignores them on other platforms so that won’t be an issue. The toolkit change will take care of the latter and we’ll need to come up with a solution for the former but we’ll get there!I could put the manifest bundling in an
MSVCcheck instead of aWIN32check so that it only tried to bundle it when VS is being used. MinGW supports resource files, not sure about manifest files. Will need to check on that.ui/cust_rich_edit.ccand its header will need to be reviewed at some point. There are some symbols that I was unable to properly track down, such asGetSel(), so I’m not entirely sure if I’ve got the correct header files. There may be a few that we don’t needAnother symbol in other files that is hard to track down is
POSITION. The difficulty comes from the fact that it’s such a generic symbol name. A search only turns upSetWindowPosition()instead.Additionally, I’m thinking about including tag files for the project to help with editors highlighting the symbols. It’d be nice to set that up on the CI end but I’m not sure how to do that just yet. Will add it to the research list.
And I’m going to try to add a manifest file to the project to see if I can get the GUI looking more modern as per this page once the debug build is working.
There are a few references to other shorts in there. The dog is a reference to one of the Marvin the Martian ones, for instance. It’s a lot of fun!
Ugh. And the AI response isn’t very helpful, either 😛
And had this come in the other day: https://phys.org/news/2026-02-reproduction-space-environment-hostile-human.html
Just one problem we’ll need to work out as we colonize space. One option would be setting up a station that spins very fast (small for safety reasons) just for reproduction purposes but that has its own problems
I really should use an actual compost bin. Instead, I just toss all of my biodegradables into a pile in the garden. All sorts of things sprout up from it. Though, most don’t survive long due to it not being the right environment. I’ve even had apple seeds sprout up in my coffee grounds 😛
May need to do some replanting next month. It all depends on how much I lost with the hard freeze over the weekend.
And 8k TVs can be added to the list: https://arstechnica.com/gadgets/2026/01/lg-joins-the-rest-of-the-world-accepts-that-people-dont-want-8k-tvs/
Not a big surprise, really. In order to even see the difference, one had to have a large viewing space and the TV had to be around 75-inches. Both of which were mighty impractical in a typical viewing space. 8k would have also required a lot of storage space for films, which would mean beefier streaming services or a new disc standard. That doesn’t even mention how large game files would need to be. With 4k, they’re already pushing 100 GBs.
Monitors are another matter entirely as it means more windows open and a larger workspace without losing detail.
We just finished having an extreme cold spell over here. Wind chill of below 10F! I loved it!
Not a clue. I don’t have any earbuds (can’t stand them and use headphones instead) so I can’t really test it. 😛
Better watch him in the garden! Don’t want him raiding the carrot patch!
And devakm just uploaded the code!
It looks like most of the ClassWizard notations in the files can be removed as it was just a marker for the GUI tool instead of something being done in the tool-chain? Not entirely sure but if so, that’ll help clean up the headers to be more readable.
Additionally, the custom string implementation in
common/string/sstring.hisn’t used much andCStringis used more predominantly so we may be able to mark it for removal. Ultimately, the plan is to replace the nonstandard string types withstd::stringbut that will take some time to retool the code to use the functions in the C++ standardStill need to update the tasks list from this thread more but I’d rather code than go through the thread and do that mindless work…. 😛
Adding the missing includes to the GUI files is coming along nicely and the code is becoming much more readable, as well 🙂
Also asked devakm about the TES4Gecko code 🙂
I’ll start by asking devakm about the original code. All that’s available publicly is the packaged JAR file.
AndalayBay still has some of the project files as they are currently working on a straight C# rewrite. No idea if they abandoned the previous attempts or not, though. As I recall, the Morrowind version wasn’t that far along but may still have something useful in it if we’re able to get permission. I’ll need to give that aspect some thought due to stuff in the past. In the meantime, I’ll talk to devakm 🙂
We may not need to actually run the code but time will tell. Don’t remember much about the tool-chain since I last worked with Java in 2010 (I switched to C++ as soon as I learned it) but I do remember that
javaccompiles the files and you run them withjava. Should be the same in OpenJDK.Spent the last few days watching old Addams Family reruns while recovering from the sinus issue. Was quite fun. It’s a shame the show didn’t go on longer as it had a lot of potential.
Also taking a break from Reincarnated as a Slime to watch How Not to Summon a Demon Lord. It’s another in the goofy anime genre that I really enjoy (Slime just wasn’t cutting it).
Probably should go back to watching old films and/or B-movies at some point but we’ll get there! Got a lot of good quality classics that I want to watch again, such as the Basil Rathbone Holmes films. Those were always enjoyable.
Okay, so we have permission to use TES4Gecko as inspiration for the algorithms with the only stipulation that we provide credit to Gecko for what we borrow. 🙂
Okay, started updating the includes for the UI stuff, which is where most of the missing stuff is. Some of them are a bit obscure but I’ve been adding each one individually. We’ve got things like this:
#include <afx.h> #include <afxdd_.h> #include <afxwin.h> #include <atlstr.h>Not exactly pretty and commenting them to explain what they’re for may be necessary as the names are a bit obscure.
Additionally, I’ve reached out to devakm regarding TES4Gecko. Since MWEdit will ultimately have a lot of feature overlap, I’ve asked them about the possibility of sharing information to reduce the need to come up with the same algorithms.
Doom now runs on an earbud: https://doombuds.com/
Ugh. BIOS issues like that are no fun. Definitely an odd one 🙁
Need to see The Thomas Crown Affair. Been on the list for years, just haven’t gotten there yet. Still reading a lot! 😛
But the Muppets are wonderful!
Been watching That Time I Got Reincarnated as a Slime. It’s not bad but I can’t seem to really get into it so I may move on soon
Wasn’t able to finish Date A Live: the mid-series OVAs weren’t dubbed and they cover critical aspects of the plot for the final season. 🙁
Yeah, it’s so big GitHub won’t load it. The MWEdit code is pretty crusty. 😛
In reality, most of those are memory alignment warnings in the Windows API. I think GCC ignores warnings in system includes by default (not sure, it’s been a while since I used it) and there may be a switch for VS to turn on.
The MFC stuff will be removed down the road when we make it system agnostic so explicitly defining them where they’re needed will also help with the porting 🙂
Sounds good. We can worry about the PCH stuff later on and focus on getting things working for now. GCC uses a different method than VS for PCH: you can simply have it compile the header files and then it’ll give them preference over the text-based headers without changing anything in the code.
-
This reply was modified 2 months, 3 weeks ago by
-
AuthorPosts
