Forum Replies Created
-
AuthorPosts
-
Yep. Generally, macro functions are used sparingly in code as they’re harder to read and find information on than stuff in the standard but Common appears to use macros extensively. Not sure if it’ll be the same in the main code. Should be able to start looking at the main code either next week or the following. I’ve got about ten more files that need their whitespace adjusted in Common and then I’ll move on. 🙂
Oh, that’s no issue at all. C++, unlike other languages, is very flexible when it comes to style. You can even have all of the code on one line if you want or even split things across several lines. The biggest thing is to make sure you use the delimiters appropriately, either in your macros (so they’re properly expanded during the pre-processing stage) or your blocks/lines. Other than that, the sky is pretty much the limit 🙂
That’s part of what I love about it: I can adjust things to each situation for maximal readability 🙂
Getting close to being done looking through and adjusting the whitespace of the Common library as we’re now calling it after looking it over with some of the OpenMW folks. Once done with this task, I probably won’t focus too much on it as the growing consensus seems to be to remove as much of its use as possible from the main code. Once that’s done, what’s left may be brought in as self-contained code split up from Common as I’m really not liking what I’m seeing with Common.
The end bracket is supposedly inserted by the final function macro.
Here’s the definition in dl_base.h:#if defined(__MSDOS__) #define SYS_MSDOS(Cmd) Cmd #define SYS_WIN32(Cmd) #define SYS_UNIX(Cmd) #define SYS_NONE(Cmd) #elif defined(_WIN32) #define SYS_MSDOS(Cmd) #define SYS_WIN32(Cmd) Cmd #define SYS_UNIX(Cmd) #define SYS_NONE(Cmd) #else #define SYS_MSDOS(Cmd) #define SYS_WIN32(Cmd) #define SYS_UNIX(Cmd) #define SYS_NONE(Cmd) Cmd #endifIt is only ever used in tasktime and nowhere else. Can’t figure out how it works. In tasktime, it’s only used to pass regular code but never does anything else. Don’t see where it interacts with the system at all :/
Yeah, it’s doing all three of the function definitions. 😛
Thanks! Will plan on purging all instances of DEFINE_FUNCTION. 🙂
A lot of the code was set up using an old, old version of the VS class builder tool. Maybe some of this weirdness can be attributed to that?
Picked up the ground cover: https://en.wikipedia.org/wiki/Phyla_%28genus%29 🙂
Not sure of the specific species, though. Couldn’t get enough mimosa locally so I went with frog fruit instead.
Another oddity that’ll need investigation:
SYS_WIN32(m_TimerID = timeSetEvent(55, 22, l_Win32TimerProc, 0, TIME_PERIODIC)); SYS_WIN32(if (m_TimerID == 0) { ) SYS_WIN32( ErrorHandler.AddError(ERR_BADINPUT, "Failed to initialize the timer using SetTimer()!") ); SYS_WIN32( return (FALSE) ); SYS_WIN32( } )I have no idea how that’s supposed to work. The macro function’s ) is before the closing brace while the final macro function sets the closing brace. Not sure why it even uses a macro function, to be honest. For that matter, I’m not even sure what this file is for. It’s tasktime.cpp/tasktime.h. From the code, it sounds like it may be a re-implmentation of some Windows system stuff for handling processes but I don’t know why MWEdit would need such code. It’s a file editor, not a low-level program. There’s a good chance it’ll be slated for removal.
I’m a little nervous about touching it right now with how weird it’s set up: I don’t want to break anything.
There’s also custom code for running it in a console in Common/conapp.cpp even though it’s a GUI application. It’s starting to look like the Common directory was just a holding space for custom code for a variety of projects even if it didn’t necessarily pertain to the program.
I’m also seeing a lot of stuff like this:
DEFINE_FUNCTION("CreateBlockInfo(void*, size_t, char*)");
Just about every function has a similar line as the first line in the block where DEFINE_FUNCTION just repeats the function line. In some cases, it’s commented out. I’m assuming this is an old legacy artifact that can be safely removed?Started reading Rubicon yesterday and imagine my surprise when it was dedicated to a Warcraft III character 😛
Do you mean this one? Possibly if it’s a drop-in replacement
Haven’t gotten to the windowing code yet but, as I recall, DOS and Windows had totally different ways of handling that so they’d likely be incompatible. Removing it won’t change the binary at all but will reduce code cruft.
Sorry, meant prefixed. Will definitely need to get the standard library stuff prefixed with
std::to help make it clear where everything is coming from. The code uses an odd mixture of C89 and C++98 but that may be due to VS being behind the times. I know it had severe limitations compared to competitors at the time, which is why we were instructed to use Dev C++ (also behind but still ahead of VS) in class. Personally, I just used GCC and got yelled at by one instructor. The others were fine with it 😛Taking a bit of a break today. Adjusting whitespace for days gets very tedious 😛
Just realized I accidentally changed the formatting for the overloaded operators. They should still work but the style no longer matches common practices. These are mostly in classes that are reimplementations of features in the Standard Library so they may be getting removed during the overhaul but I still need to correct my boo-boo
Unrelated question but is Microsoft namespacing their APIs yet? That would help make the code a lot clearer if they are. Converting the code to use the std namespace is very much on my list. It will greatly help with readability, compatibility, and portability.
This isn’t exactly a note but more something interesting that I just found. Some of the files have conditional includes that check for DOS or regular Windows, even though DOS was mostly phased out in the mid-90s for the consumer (still used for kiosks at the time and since has been mostly superseded by kiosk mode)
#if defined(__MSDOS__) #include "dos.h" #include "dir.h" #include "time.h" #include "io.h" #elif defined(_WIN32) #include "io.h" #endif #if defined(_WIN32) && defined(__BORLANDC__) #include <windows.h> #include <time.h> #endifWe should be able to remove the DOS support without issue. It’s also interesting that Borland has some stuff in there even though the majority of the code was written to require Visual Studio and used its code generating functions. It does make me wonder: would Borland also compile the project? Not too familiar with it but it’s possible it has similar code generating.
We may need to sign up for Analytics and/or Search Console. I think the latter is what we would want for that but Google has a ton of tools. There is also a WordPress plugin that helps to integrate with them if we go that route.
On a slow connection, it’s supposed to passively download the site for offline viewing and update the contents as the connection is re-established. However, in my experience, it’s hit or miss. When my connection is acting up, sometimes it downloads the content but not the styles or images while 75% of the time you get to play with T-Rex. Highly recommended, by the way. He’s a blast!
https://en.wikipedia.org/wiki/Dinosaur_Game has a lot of information 🙂
The final season does move away from much of the lore into more standalone sketches but still fun 🙂
Caught up on the Scooby Doo Show, only ever saw half of the episodes. It does a wonderful job expanding on the existing lore. One of the best moments was when Fred randomly told Shaggy to use plan 47 and Shaggy sits in thin air digging through a book trying to figure out what Fred was talking about. It shows how Fred doesn’t keep everyone in the loop, which was hinted at in Where are you but never explored as the first incarnation was pretty much just monster of the week without too much depth. Yes, I’m in the mood to hyper analyze cartoons these days 😛
Huh, could be due to the rights holder aggressively defending the property. Nintendo does something similar. I’ll try to set a time to watch the show soon! 🙂
Been watching some of my favorite genre lately: 1950’s sci-fi! First up was Them! followed by Earth vs the Flying Saucers.
Also saw this gem. Very much a B-movie but they definitely had fun doing it. The jokes were a riot and made fun of a lot of the films in the genre.
Looks like Astyle missed the spacing around the parentheses for function parameters as well in addition to the pointer operands (I wonder if Uncrustify would have worked any better, didn’t think of it at the time) so I’m working on that now. This will take a bit as I need to go through each file and adjust things manually but we’ll get there! 🙂
Another item on the cleanup list is to clean up the returns. The return command is used inconsistently. Sometimes we see things like this:
return (true);
While other times we see this:
return true;
In some cases, the parentheses can be removed but will need to be done on a case-by-case basis to prevent the order of operations from getting messed up and giving us improper values. I’ll do that in a separate commit down the road. Side note: really wish we had syntax highlighting for the code tags. May look for a plugin for that at some pointThere’s a mixture of boolean variable types from throughout the standard’s history: BOOL, boolean, and the current bool. bool is the current form and everything should probably be brought up to date to ensure the code will work across many different compilers and continue to work unless the variable is ever changed again in the future. Will add it to the list of things to do. I’m thinking of saving much of the overhaul until after the cpplint and cppcheck tasks are done as they’ll help with the initial pass and should help keep it from getting too overwhelming 🙂
In post apocalyptic lore, the bunkers are often placed near the coastlines. See the Fallout universe, Silo, and The Walking Dead as US examples (not too familiar with the genre in other locales). This is problematic due in large part to the water table and soft ground (as was featured heavily in Silo: the bunkers kept flooding). My research has shown that Colorado would be uniquely positioned as the prime location for the bunkers. Stephen King in fact had his characters in The Stand migrate there. Why Colorado? It has a very low water table (about 500 feet on average), decreasing the chance of flooding. In contrast, Wyoming has a water table twice as high. It has good, solid rock to dig in to help the structures stand the test of time. The mountains, additionally, allow for you to transmit a long distance (but not receive) on account of being over two miles high in some locations. It also has geothermal energy reserves as evidenced by its hot springs. One issue would be water filtration on account of the mineral deposits so strong purification would need to be used.
In theory, the mountains would also be of benefit to solar cells but those degrade and would be harder to replace. However, the reflection of light off of the snow would help them work more efficiently.
Okay, stripped the extraneous characters and updated the repo. Geany’s function to strip trailing spaces apparently works on invisible control characters as well. Ran it on all of the documentation files. 🙂
Looking at the to-do list now, the items on it are pretty vague. Maybe we should wait on adding those items to the tracker until we understand them better?
If the docs are now pretty satisfactory, I’ll update the OpenMW thread 🙂
Edit:
More information regarding the image library stuff: DevIL is cross-platform but MWEdit is written to use the DLLs. In all of my experiments with DLLs, I never was able to figure them out. This could be fixed in a few ways, with the simplest being a static build as mentioned earlier. Another option would be to wrap the DLL code in a conditional compilation block for the Windows platform. The IL code is in the folder of the same name. Personally, I prefer the static option as it means we won’t need to deal with figuring out how to properly ship and use a bunch of different DLLs. Would make it more difficult to update the libraries since we’d need to ship out a new build each time but Windows doesn’t have a central repository for libraries like other systems
Ooh, the list of fun holidays is just the thing!
Metal horse here! Do find it interesting that Wiki doesn’t provide some details regarding the personality traits like they do on the place mats in Chinese restaurants.
Those are neat! Do miss Think Geek. They used to sell this sort of funky stuff.
Really like the pumpkin! Could be improved by using a real pumpkin 😛
We’re going to be getting fiber Internet in my area soon. Probably will switch when it’s available as it’ll be the same price as I’m paying now but will get a much better connection. They’re currently across the street and the neighborhood just got the letter a couple of weeks ago so it won’t be long now!
Okay, got the Features.txt file cleaned up 🙂
There’s also a to-do list in the docs folder that we’ll want to look through. Some of the items may be worth adding to the bug tracker
Somehow, some stray invisible characters wound up wandering in to the features file. Will try to take care of them. Not sure how to check if they exist in other files but they need to be banished if we can figure out how to track them all down.
Edit:
May need to use a hex viewer to track them down
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.
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. 😛
-
AuthorPosts
