Commit Graph

7 Commits (6ff8db93e83d06926d182c4d9d66874667ae2cb8)

Author SHA1 Message Date
whitequark 1442ee5ec3 Refactor InitPlatform.
This commit performs three related cleanups:
  * The slvs library no longer uses explicit platform initialization
    (which drags in the side effects of InitPlatform that are not
    desirable in a library). Instead, it just ensures that it has
    the temporary heap, which is what it was callingInitPlatform for.
  * InitPlatform is simplified and moved to platform.cpp, next to
    other path related functions.
  * InitPlatform is renamed to InitCli and is called from InitGui
    implementations. GUI toolkits sometimes have options they use
    internally (that's the case for for GTK and Cocoa at least),
    and we shouldn't try to parse those as a file to open.
2020-05-10 08:29:25 +00:00
whitequark 911c67b2d8 Fix benchmark harness after e2e74762. 2017-03-17 15:24:32 +00:00
whitequark 4a0b4fd8d3 Win32: unbreak solvespace-cli.
It was broken because of three bugs:
  * Uninitialized variables in RunCommand;
  * Trying to use (OEM-encoded) main() argc/argv arguments instead
    of GetCommandLineW();
  * Trying to pass relative paths directly into ssfopen.
2016-12-05 01:24:17 +00:00
whitequark 47244c5e89 Implement a command-line interface.
This commit adds a basic command-line interface. This interface
allows rendering thumbnails and exporting data in batch mode.
2016-11-29 04:01:07 +00:00
EvilSpirit dbc567ed89 Reload linked files before upgrading legacy data.
Before this commit, if constraints with newly introduced params were
loaded from a file that linked other files, the upgrade code would
attempt to look up a non-existent entity.
2016-11-28 16:58:31 +00:00
whitequark 9301dec98d Use the same code for loading resources in all executables.
All of our executables need resources; e.g. the vector font is
a resource and it is necessary for generation. Before this commit,
the GUI executable loaded the resources in a nice way, and everything
else did it in a very ad-hoc, fragile way.

After this commit, all executables are placed in <build>/bin and
follow the same algorithm:
  * On Windows, resources are compiled and linked into every
    executable.
  * On Linux, resources are copied into <build>/res (which is
    tried first) and <prefix>/share/solvespace (which is tried
    second).
  * On macOS, resources are copied into <build>/res (which is
    tried first) and <build>/bin/solvespace.app/Contents/Resources
    (which is tried second).

In practice this means that we can add as many executables as we want
without duplicating lots of code. In addition, on macOS, we can
place supplementary executables into the bundle, and they can use
resources from the bundle transparently.
2016-11-28 06:18:42 +00:00
whitequark 0ae0343fc7 Add a simple benchmarking harness. 2016-11-18 13:55:24 +00:00