fabiangreffrath / taradino

SDL2 port of Rise of the Triad
GNU General Public License v2.0
29 stars 8 forks source link

Detect ROTT data from digital storefronts #71

Closed erysdren closed 11 hours ago

erysdren commented 1 week ago

Here are some default *nix installation paths for ROTT on digital storefronts:

const char *homepaths[] = {
    /* steam */
    "%s/.steam/steam/steamapps/common/Rise of the Triad Dark War/Rise of the Triad - Dark War/",
    "%s/.steam/steam/steamapps/common/Rise of the Triad - Ludicrous Edition/assets/",
    /* heroic */
    "%s/Games/Heroic/Rise of the Triad/data/",
    /* gog */
    "%s/.wine/dosdevices/c:/GOG Games/Rise of the Triad/",
    "%s/GOG Games/Rise of the Triad Dark War/",
    /* other */
    "%s/.local/share/games/rott"
};

I was thinking that these could be queried to see if they exist, and if so, add them as a data path. Not all of them at once, just the one/s that exist. The Ironwail Quake sourceport does a similar thing with the Quake and Quake Remastered data from Steam.

Not sure what to do if the user has customized it. Under Windows, you could pull registry keys to find out the Steam library locations and iterate over them (maybe the same for GOG?). These paths will also be different under Mac OSX.

fabiangreffrath commented 1 week ago

We could borrow some relevant code from Chocolate Doom:

https://github.com/chocolate-doom/chocolate-doom/blob/master/src/d_iwad.c

erysdren commented 1 week ago

I'm also looking at Ironwail:

https://github.com/andrei-drexler/ironwail/blob/master/Quake/steam.c