Just ran the code base through cpplint. There’s some overlap but it does do a good job of picking up stuff that needs modernization whereas cppcheck mostly looks for potential problems.
Here’s the log: https://stearnvault.com/wp-content/uploads/2025/02/cpplint.zip
I tried to suppress the style warnings but wasn’t able to suppress the readability/braces warning. At some point, I may run the code base through astyle to help ensure that the style is consistent throughout. 🙂
For the updated directory structure, we can draw inspiration from GNOME: https://gitlab.gnome.org/explore
Their projects aren’t entirely consistent but they’re pretty good about following the best practices used in the open source community
GIMP’s in particular is worth a look: https://gitlab.gnome.org/GNOME/gimp
Down the road, it may be a good idea to look at translation support using something like gettext
Another note:
We’ll want to make sure we compile the Windows executable as a static executable. This is important as, unlike *nix systems, Windows doesn’t have a central repository on system for libraries so each program needs to bundle its DLLs with them if built dynamically. The distribution can get a bit messy. Makes it harder to update libraries but the end users aren’t likely to simply download an updated library file anyways
With CMake, this is easily done by checking to see if it’s being run on Windows. Will need to check about Meson.
Edit:
This what Meson uses: https://mesonbuild.com/Compiler-properties.html#system-information
Okay, my finger is healed enough to work now so I’ve reached out to rfuzzo about the warnings 🙂
For reference, this is how I ran cpplint:
./cpplint --filter=-whitespace,-readabiltiy/braces --recursive ~/Code/mwedit/
rfuzzo says they had trouble with the script-editor so we may want to look at possibly adding in Scintilla support. Absolutely no experience with it but we can certainly add it to the list.
They also say that there’s some wonkiness with the GUI with how the modern Windows controls handle it.
Forgot to mention that they also confirmed that their changes were to mostly satisfy changes to the Windows API over the last twenty years.
Here’s the updated run on rfuzzo’s repository: https://stearnvault.com/wp-content/uploads/2025/03/cppcheck-cpplint.zip
cpplint is much better while cppcheck hasn’t changed at all. However, the cpplint changes look due to it actually respecting the braces filter this go around. The first time I ran it, it ignored me when I told it to ignore the style of braces. Still something to look at improving though, I just didn’t want it to clutter up the log with brace suggestions when that was going to be done anyways 🙂
Other than that, the output is mostly the same
The guis and dialogs are for the old Windows themes as well, all have to be updated. Got the IDE up yet?
Geany’s all ready to go. I’ll make more tweaks to the settings as I need to. All I really need is a text-editor with syntax highlighting 🙂
Fun fact, I used Notepad for Java initially as I hated the IDE we were made to use and I wasn’t allowed to install Notepad++ on the school computers. 😛
Found out this morning as I shutting down Linux that my EDITOR environment variable isn’t set so I’ll need to fix that when I configure Git. Probably forgot that when I had to reinstall last summer. Sorry, been a while since I set things up from scratch.
Windows development is completely foreign to me so I’ll probably need some help on that front until we get things working cross-platform. Speaking of which, that reminds me that I still haven’t installed MinGW so I’ll need to fix that so that I can make Windows binaries on *nix.
Supposedly, clang can do it all but I’ve never been able to figure out how to use it
I may also reach out to the OpenMW team. Since there’s quite a bit of overlap, they may be interested in chipping in. 🙂
Once the Windows GUI library is swapped out for gtkmm, the GUI should go more smoothly. Still not sure how much work that’ll be, though.
Edit:
We also should add documentation to the files to say what everything does as we figure it out. Some of the names are weird
I’m gearing up to run the entire project through astyle. I think I just finished configuring my local astyle settings file but I’ll take another look another day to see if anything else stands out. The style is pretty inconsistent so I figure that I’ll try running it through the styler this go around instead of doing it manually like I did with BOSS. While fun, it did take me a few months. 🙂
Out of interest, this is what I’m going with:
#Attach braces
style-attach
attach-extern-c
#Use tab for indentation and spaces for alignment
indent=tab=4
indent-switches
indent-modifiers
indent-preproc-block
#Attach closing while of a loop to the closing brace
attach-closing-while
#Padding
break-blocks
pad-oper
pad-include
pad-header
align-pointer=name
delete-empty-lines
squeeze-ws
remove-braces
attach-return-type
convert-tabs
close-templates
max-code-length=100
Just did an initial test run on a couple of files and Astyle 3.1 (from 2018 and what’s in the repos here) works pretty well but there will be some fine tuning after the runs from the looks of it.
Here are the updated settings:
#Attach braces
style=attach
attach-extern-c
#Use tab for indentation and spaces for alignment
indent=tab=4
indent-switches
indent-modifiers
indent-preproc-block
indent-preproc-define
min-conditional-indent=0
max-continuation-indent=60
#Attach closing while of a loop to the closing brace
attach-closing-while
#Padding
break-blocks
pad-oper
#pad-include
pad-header
align-pointer=name
delete-empty-lines
#squeeze-ws
break-one-line-headers
add-braces
#remove-braces
attach-return-type
convert-tabs
close-templates
max-code-length=100
Will do a full run soon. It definitely helps make the code easier to understand 🙂
Unfortunately, 3.1 doesn’t support squeeze-ws so the extra white-space will need to be adjusted manually
Working on running astyle on the project. It’s being a tad troublesome in that it also wants to edit binary files. For some reason, its built-in filters aren’t working (could be the version as I went ahead and built 3.6.7) so I’m going to need to set up some exclusion lists to pass to it. Otherwise, the run seems to have gone well. I’m doing all of this in a new branch in case things break 🙂
Edit:
Fixed it. Had to do individual runs for each folder in the root for the .cpp files and then the same thing for the .h files. Bit annoying having to run it twelve times but we won’t be running it much, if again. Anyways, here’s the commit log of the new branch if you want to check out the changes: https://github.com/deathssoul/MWEdit/commits/astyle/
May need to do the resource file in the project folder, too. Will take a look at that later 🙂
Edit 2:
The repo could use some version tags. Will take care of that. At the bare minimum, Nimrod’s initial commit needs to be tagged as well as their final changes. The rest aren’t enough to warrant a version bump just yet
Looks good, watching. 🙂
Great! I’ll get it merged into the main branch and then I need to take care of a few repo things before moving on to the cpplint log. The cppcheck log is vaguer so I’ll start with the former to whittle it down 🙂
Regarding the 100 character line length: I feel the old standard of 80 is archaic. It goes back to the days of 800×600 resolution monitors. These days (in fact, beginning around 2010 or so), there are much fewer of those around so it’s time to bump up the line length. Why 100? It also lets you shrink the window to look at other things such as documentation. It doesn’t need the window maximized to see it in full but still looks better on today’s better screens.
Okay, got the thread posted on the OpenMW forums. Just waiting for the moderators to approve it. I’ll post the link when it goes live 🙂
Thread is now live: https://forum.openmw.org/viewtopic.php?t=8280
🙂
Edit:
A bug list is included in the repo. I think it’s included in the docs folder but I can verify when I’m back on the computer. These, along with the new ones that have come about since, should probably be migrated to a proper issue tracker like GitHub’s to make discussion easier. On that note, I need to make sure the issue tracker is actually enabled in the group (which I need to link to in this thread…). It was disabled for rfuzzo’s and the fork on my page
Drat, issues are disabled. Will fix that.
Okay, the GitHub issue tracker has been enabled. Sorry about that everyone!
And the new repo link: https://github.com/Walrus-Tech/MWEdit 🙂
Edit:
More notes! There’s a lot of stuff in here that’s been superseded by updates to the standard and a lot of stuff should be split up so that the source files are only including the stuff they actually need, improving readability
Also, the Windows folder has a header/source pair with the wrong case that was never updated, likely due to the Windows file system not caring about case
Oh, and the contents of the readme in the docs folder should probably be combined with the one in the root folder somehow. Not sure what’ll look best
Copied over the contents of the original readme into the one at the root of the repository. The formatting needs work but I don’t know Markdown yet so will need to do some reading 😛
Also set up the tags for the important points in the commit history. 🙂
Astyle didn’t catch all of the pointer symbols so I’ll need to correct them at some point line by line.
Currently working on copying the bug list from the text file over to the issue tracker. The current versions aren’t pretty but I’ll clean things up after the initial pass.
Edit:
Copied over the bug list. The bottom two sections seem to be notes on the base game so I’m not sure they’re relevant to MWEdit but may be relevant to OpenMW if they haven’t fixed them yet
Cool! 🙂
It’ll be a bit awkward determining for example what they meant by Wonky UI Behavior according to OS/Launch settings, inclusion of a date of original submission might help in any case.
Just curious as to now the repo being forked from the base, would it make sense to archive the base with a link onto the fork in the Readme?
Yeah, not too sure of the UI stuff. rfuzzo just said there were some weird glitches that were probably related to MFC but, yeah, everything definitely needs fleshing out
So my initial thinking was to set things up so the group code is separate from the individuals with having to pull the individual branches in with pull requests. Though, that may be overcomplicating things. I’m not sure. Handling branches for merging would be more complex by using the organization and would make merge conflicts more difficult to resolve but doing pull requests for every change for group members would get messy in a hurry and would stall progress since literally everything would need to be reviewed. However, it would make handling merge conflicts tidier and would allow for more discussion on changes before they’re brought in to the mainline branch. Yeah, there are definitely growing pains trying to move to working as a group. All the large projects I’ve worked on, I inherited the code base and wound up being the lone developer on. 😛
Okay, got the Readme updated with additional content about the goals and a little bit about its history 🙂
It will need additional updates regarding the build process as we test and update the code. It still mentions VS 6 but since it hasn’t been fully tested yet on other versions, it’s still accurate.
Also cleaned up the formatting for a couple of issues I missed.
