Spastic Hamburger

Forum Replies Created

Viewing 20 posts – 121 through 140 (of 1,289 total)
  • Author
    Posts
  • in reply to: MWEdit #5156

    Messed up the include order for several files. I’ll fix it when I go back through to add the correct headers for the Windows macros.

    All of this is necessary work even if it’s tedious and not at all exciting

    Still need to get an issue open regarding visual styles. Shouldn’t be hard to implement and it’ll be a nice upgrade until we switch GUI toolkits. Just been buried under tracking down all of these symbols

    Haven’t given much thought to TES3Gecko either for similar reasons (or even browsed the TES4Gecko code) but were still a long ways off from even having MWEdit ready for that sort of thing

    in reply to: MWEdit #5148

    Thanks! Will try that if adding just what we need doesn’t do the trick 🙂

    There are also some comments suggesting that the long types may in fact be intended as short integers so we’ll definitely want to do an investigation to determine what they should be. Yep, std::atol would do the trick for 64-bit integers. There’s no corresponding function for 16-bit integers so we may want to see if we can set the control to a limiter if we do in fact need 16-bit integers after the investigation just to make sure we don’t get an integer overflow or out of range bug. The other option would be to first convert them to a 32-bit integer and then check to see if they are out of range for a 16-bit one. If so, we set it to the max or min allowed for the type. The limiter would be cleaner in that case, though.

    Edit:

    snprintf() in common/dl_str.h is almost identical to std::snprintf() in cstdio save for the fact that the former uses TCHAR * instead of char *. We may be able to swap it out for swprintf() in cwchar without issue since TCHAR is just a type-def for wchar_t. Other changes may be doable as well but that is a 1-for-1 swap down the road.

    Edit 2:

    Also found this doc which could be useful: https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types

    Will start adding the headers for those types as I go and will go back through later and add it to the ones I missed at some point. It’s a shame a lot of this information is hard to track down.

    in reply to: MWEdit #5143

    Ugh…those includes in common may 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_t or std::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.

    in reply to: MWEdit #5135

    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 cctype so 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.h so 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. 🙂

    in reply to: MWEdit #5127

    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 _DEBUG flag 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 🙂

    in reply to: MWEdit #5123

    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

    in reply to: MWEdit #5118

    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 .manifest files like it does for resource files so I’ll try adding the file to the target_sources command first. stdafx.h would be nice but it broke when I turned on WIN32_LEAN_AND_MEAN for some reason.
    Failing CMake, we should be able to tell the CI to run the manifest embedding command. No idea how to use InitCommonControls() 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 .rc and .manifest files 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 MSVC check instead of a WIN32 check 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.

    in reply to: MWEdit #5111

    ui/cust_rich_edit.cc and its header will need to be reviewed at some point. There are some symbols that I was unable to properly track down, such as GetSel(), so I’m not entirely sure if I’ve got the correct header files. There may be a few that we don’t need

    Another 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 up SetWindowPosition() 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.

    in reply to: Random #5110

    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

    in reply to: Veg #5108

    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.

    in reply to: Hardware Relics #5106

    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.

    in reply to: Random #5105

    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!

    in reply to: MWEdit #5104

    And devakm just uploaded the code!

    in reply to: MWEdit #5100

    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.h isn’t used much and CString is used more predominantly so we may be able to mark it for removal. Ultimately, the plan is to replace the nonstandard string types with std::string but that will take some time to retool the code to use the functions in the C++ standard

    Still 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 🙂

    in reply to: MWEdit #5098

    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 javac compiles the files and you run them with java. Should be the same in OpenJDK.

    in reply to: Films & TV Shows #5094

    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.

    in reply to: MWEdit #5093

    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. 🙂

    in reply to: MWEdit #5085

    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.

    in reply to: Random #5081

    Doom now runs on an earbud: https://doombuds.com/

    in reply to: Hardware Relics #5080

    Ugh. BIOS issues like that are no fun. Definitely an odd one 🙁

Viewing 20 posts – 121 through 140 (of 1,289 total)