Commit Graph

1881 Commits

Author SHA1 Message Date
Lucas 62e8098f5b Fix forbidden conversion in remote.cpp
Conversion from std::string to char* is forbidden in ISO C++.
2018-04-03 16:00:45 -04:00
Zach Bacon edb2fd2601
Merge pull request #214 from Eleuin/name-fixes
Fix cmake directory in installdeps
2018-04-02 12:23:11 -04:00
Eleuin 9843af2b5a
Fix cmake directory in installdeps 2018-04-02 09:29:32 -04:00
Eleuin 80bcdab924 Fix draw height across rendering modes 2018-03-22 21:00:11 -04:00
Rafael Kitover f3f6ee7b1c fix compile errors with ffmpeg git
The FF_MIN_BUFFER_SIZE macro was renamed to AV_INPUT_BUFFER_MIN_SIZE at
some point, so check for the newer variant first.

The AVFMT_RAWPICTURE macro seems to be gone, but affected code was an
edge-case so compile it out if the macro is not present.
2018-03-19 19:36:00 -04:00
Rafael Kitover 5ae853a905 fix installdeps for OpenSUSE
Fix syntax error (calling functions from the wrong script) and add
openal-soft-devel to deps.
2018-03-19 02:52:53 -04:00
Rafael Kitover 8540860ab8 adjust changelog version regex for cur. version
Allow matching text after version and before date.

Matches current version 2.0.2 .
2018-03-17 12:32:27 -04:00
Zach Bacon 61e2f3b284
Merge pull request #204 from Eleuin/filter-bounds-fix
Fixed filter draw bounds
2018-03-15 10:15:54 -04:00
Eleuin d7a4eddb3c Fixed filter draw bounds 2018-03-15 10:00:26 -04:00
ZachBacon 92ba676632 update changelog for 2.0.2 release
Signed-off-by: ZachBacon <zachbacon@budgiemedia.rocks>
2018-03-13 23:49:17 -04:00
Rafael Kitover d5c9c6bac7 change default audio driver to SDL
A Linux user (Eleuin) has reported menu lockups with the default OpenAL
(probably thread related) and no lockups with SDL.

A Windows user has reported popping noises with all audio drivers except
SDL (#178).

Change the audio driver default to SDL for the time being until these
issues can be looked into.
2018-02-28 17:53:55 -05:00
Eleuin 480541a205 Modify max_threads sanity check to better handle erroneous values 2018-02-28 17:18:52 -05:00
ZachBacon c7c6ad6a87
implemented the fix from nhdailey, should resolve #153. Will put up a
test build soon.
2018-02-25 13:38:25 -05:00
Rafael Kitover 66980934b2 add multi-platform build system
under `tools/` add some scripts to invoke the build system to build all
deps for vbam and vbam itself:

- `tools/linux/builder`

This builds a mostly static linux binary with a few dynamic deps for
xorg and wayland. Using gtk3. This will run on just about any dist.

- `tools/osx/builder`

Builds a static mac app targetting 10.7.

- `tools/win/linux-cross-builder`

Builds a static windows binary using the mingw-w64 toolchain.

- `tools/win/msys2-builder`

Builds a static windows binary in the MSYS2 environment, this may be
suffering from a few regressions.

Change some cmake code to support the build system, refactor a few
things in it.
2018-02-24 14:39:29 -05:00
orbea 3e052c943d cmake: Fix -DENABLE_FFMPEG=OFF 2018-01-18 13:18:35 -08:00
Rafael Kitover df0bd439fb fix deps submodule init on windows
`git submodule update --remote --recursive` must be called with `--init`
if the submodules have never been initialized, add the flag to the cmake
code that does this. If they are already initialized, it will not cause
any harm.
2017-10-25 06:25:29 -07:00
Rafael Kitover 420450255c mac build/builder improvements
Improve, refactor and clean up `tools/osx/builder` to build a relatively
full-featured ffmpeg as well. This requires lots of other dists. It's
kind of like a mini port system now. Will generalize it shortly to a
sourced library for using with both the mac and the mingw builds. Will
hopefully become a separate repo on github at some point.

Add perl dist support to the builder.

Add an `--env` flag to the builder to print the build environment
variables so that they can be read in with `eval` for debugging
purposes.

Also add the `FFMPEG_STATIC` cmake option to link static ffmpeg
libraries correctly.

Move the codesigning and zipping of the `.app` bundle to the builder
script and out of cmake, as this is something most users don't need.
2017-10-22 15:35:56 -07:00
ZachBacon f527d0a2a3 The not so finished builder script for windows. 2017-10-22 08:29:22 -04:00
Zach Bacon 7dca06979b Added some windows specific stuff to builder.
Still have much more to do.
2017-10-22 00:41:27 -04:00
Zach Bacon c3fc4e7edf Added basic windows script 2017-10-21 23:25:12 -04:00
Rafael Kitover 21926d6230 add -mfpmath=sse -msse2 compiler flags: x86/amd64
This may speed things up a little in some places, or maybe not, but
should be safe as few if any users are likely to be using a CPU without
SSE2.
2017-10-17 10:26:37 -07:00
Rafael Kitover afb1cd3dfc automate codesign/zip for mac build, add xz dep
Add POST_BUILD commands on Mac to codesign the `.app` and make a zip
file from it.

Also add xz/liblzma dist to `tools/osx/builder` because something
apparently wants liblzma.
2017-10-12 14:56:21 -07:00
Rafael Kitover 5e633984b8 mac builder refactor/improvements
Refactor the code in `tools/osx/builder` somewhat and make it cleaner.

Move a few table processing loops into functions to make things less
ugly.

Delete dists not listed in the table (e.g. when they are updated) and
when a dist is re-downloaded, delete the tree and the target file to
force a rebuild.

Use number version for gettext instead of `-latest`.

Specify full dist target, e.g. `lib/libfoo.a` instead of just
`libfoo.a`.
2017-10-12 14:31:23 -07:00
Rafael Kitover d7ff2afb80 add mac release builder script
Add `tools/osx/builder`, a POSIX sh script to build all dependant
libraries as static, targetted to OS X 10.7, and build the project with
them (also targetted to OS X 10.7.)

ffmpeg currently does not link, as recording functionality is currently
non-functional anyway, this will be fixed later.

MISC:

- set WORKING_DIRECTORY and ERROR_QUIET for all git commands, for the
  cases when the build directory is not under the git checkout

- #include <cerrno> in ConfigManager.cpp as it uses errno

- change `build*` in `.gitignore` to `build/*` so that files starting
  with "build" are not affected
2017-10-12 01:32:18 -07:00
Rafael Kitover 46486381f0 read version info from CHANGELOG.md if no git
If git tags are not available, set the version and revision by finding
the first version tag in `CHANGELOG.md` of the form

```
```

Where N.N.N is the number version (number of components can vary) and
the revision (as speicified by -REV) is optional.

TODO: support named revision without a version number of the form
`[REV]`.
2017-10-11 19:17:25 -07:00
Zach Bacon 30b6ecf1a5 Add a changelog
Gonna try and keep this up to date as often as possible.
2017-10-12 00:49:05 +00:00
Rafael Kitover 55fa9c69c0 refactor/cleanup GitTagVersion.cmake
Run just one `git tag` command instead of two (with tags and refs) and
break it into the form [tag0, ref0, tag1, ref1, ...]. Iterate over the
list with two counters for tag and ref.
2017-10-10 03:15:53 -07:00
Rafael Kitover 52439cee0e fix error and version info in shallow git clones
Fix `cmake/GitTagVersion.cmake` to not throw errors when in a shallow
git clone, or any git clone that has no tags.

And when either git or git tag version info is not available, set the
version variables to the defaults, which are:

```
VERSION         = '2.0.0'
REVISION        = 'unknown'
VERSION_RELEASE = 0
```
2017-10-07 18:17:52 -07:00
Rafael Kitover f5379ab806 read version and subversion info from Git
To get the version, find the last tag in git tag of the form "v2.0.0" or
"2.0.0". If this is the last tag and the current commit matches the ref
of this tag, the revision will be empty.

In the case that the current commit is not tagged with a version, to get
the revision, use the short sha unless the current commit is tagged with
something that is not a version string, e.g.  "feature-foo", in which
case the revision will be "feature-foo".

If the current commit is tagged as e.g. "v2.0.1-foo" or "2.0.1-foo" then
the version will be "2.0.1" and the revision will be "foo". Tags of this
form are also checked when finding the current version.

This is all done in cmake. If there is no git detected, the version will
be "2.0.0" and the revision will be "unknown".
2017-10-07 14:00:47 -07:00
Rafael Kitover 9c06c31814 deps: don't check result of apt-get update #154
On Debian-based distributions, people sometimes have bad sources in apt,
e.g. PPAs that no longer exist, or mirrors that no longer work, etc.. In
these cases, `apt-get update` will still likely fetch the main
distribution package lists, which is what we need, but return a non-zero
exit code.

Change `./installdeps` to not abort on non-zero exit status from
`apt-get -qq update`.
2017-10-05 18:28:42 -07:00
Rafael Kitover 1fc0966384 minor code cleanup
Change one instance of a dummy local variable to a C++11 temporary via
CLASS{param}.
2017-09-23 15:29:35 -07:00
Rafael Kitover f069f0c02d default LTO to OFF on 64 bit MinGW
64 bit MinGW (e.g. msys2 64 bit) produces a binary that immediately
segfaults when built with LTO.

Make ENABLE_LTO default to OFF on 64 bit MinGW (32 bit will still
default to ON.)
2017-09-22 00:42:49 -07:00
ZachBacon 75ef0aa26d Added executable extension
* Allows the SDL binary to be installed if it's cross compiled from
within linux or macOS for windows for packaging purposes.
2017-09-22 02:46:20 -04:00
Rafael Kitover e9a86c541d fix deadlock in SoundSDL::deinit() #139 #130
On SoundSDL destructor and `reset()`, there was a deadlock with Linux
pthreads, it happened sometimes that the reader thread would call
`SDL_SemWait(data_available)` while `deinit()` would destroy the
semaphore and the `SDL_SemWait()` would end up waiting forever on a null
semaphore.

Change the sequencing of deinit() to prevent this from happening, set
`initialized = false` at the beginning of the sequence to prevent
subsequent entries into the reader callback, and add an SDL_Delay(100)
between the final `SDL_SemPost()` and `SDL_UnlockMutex()`s and the
`SDL_DestroySemaphore()` and `SDL_DestroyMutex()`s to allow a running
reader to complete with a valid mutex and semaphores before they are
destroyed and the thread is joined.

Resetting the sound system also sometimes triggers a memory corruption
bug, but that's a separate issue.
2017-09-21 15:39:30 -07:00
Rafael Kitover 3d792457b2 fix huge app icon in Win volume settings #149 #121
We were setting the app icon based on the 256x256 xpm icon in the xrc,
and this triggered a bug where the app-specific icon in Windows volume
settings was huge:

https://stackoverflow.com/questions/17949693/windows-volume-mixer-icon-size-is-too-large/46310786#46310786

Adapt the code from that SO question to use Windows-specific code to
load and scale the icon appropriately using a Vista+ API, and fall back
to the normal Wx icon loading mechanism on XP.

Also generate a nice new `vbam.ico` Windows icon file based on the
`.svg` using the app from:

https://iconverticons.com
2017-09-19 16:28:23 -07:00
Rafael Kitover de89bd0561 use num cpu cores to parallelize LTO link with gcc
Use the `cmake` `ProcessorCount` module to determine the number of CPU
threads, and set the `-flto` flag for gcc to `-flto=${num_cpus}` if the
number of CPU threads is detected and is greater than `1`.

clang does not support this.
2017-09-19 06:58:48 -07:00
Rafael Kitover 268c638456 improve win32 dependencies git submodule handling
Use `git submodule update --remote --recursive` instead of `git
submodule update --init --recursive` so that the latest version of the
repo is always installed.

Run the command from cmake instead of throwing an error if the submodule
is not checked out. Only throw an error if the checkout failed or the
source tree is not a git checkout.

Don't add the `mingw-xaudio` include directory if using MSVC.

Remove the submodule check from src/wx/CMakeLists.txt, having it in the
main CMakeLists.txt is enough.
2017-09-19 06:11:41 -07:00
Rafael Kitover d3351a7575 remove doctoc title from README.md TOC
Remove the "generated with doctoc" title from the README.md table of
contents.

Need to run `doctoc --notitle`.
2017-09-18 01:02:33 -07:00
Rafael Kitover 42fb76bfcf update README.md
Note that LTO now defaults to ON, and ENABLE_ASM does not turn on
ENABLE_ASM_CORE.

Trim the wxLogDebug() section.

Titlecase headings.

Generate a TOC with `doctoc`.
2017-09-18 00:58:47 -07:00
Rafael Kitover 7f1fec88af work around gcc lto wrappers bug with gcc 7.x
gcc lto wrapper commands such as `gcc-ar` will segfault with some
versions of gcc 7.x when called via an absolute path, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717

Generalize the mechanism for compiling a small C program on the host
(currently used for bin2c for Wx resources) and use it to wrap the gcc
wrappers in a little executable that prepends their dirname to PATH and
runs them with `execvp()`.

Make LTO default to ON again, except on win32 with gcc < 7, because
those toolchains produce broken binaries with LTO enabled.

Also add `-ffat-lto-objects` to compiler flags for gcc when LTO is
enabled, this will increase the chances that the LTO build will succeed
even if there are issues with the binutils wrappers. Clang does not
support this.
2017-09-16 19:47:39 -07:00
Rafael Kitover b82cab14e2 rename CMakeScripts/ to cmake/
Most projects nowadays call the project specific cmake scripts directory
just `cmake/` and we will do so as well.
2017-09-13 20:30:33 -07:00
Rafael Kitover 02b3defcd0 restore wx 2.8 compat, improve string processing
Fix building with wx 2.8 by rewriting some more string related code.

Replace all calls to .c_str() with .mb_str().

Remove some of the .c_str()/.mb_str() calls where the target is already
wxString.

Move the split()/enum_idx() functions from opts.cpp into
str_split()/vec_find() in strutils.h/strutils.cpp for use in other
files.

Replace the C-style string parsing code in a couple of places in
wxvbam.cpp for processing possible command line options by splitting on
'='.

Also replace a couple of places that use pointer arithmetic in
widgets/joyedit.cpp and widgets/keyedit.cpp with wxString methods.
2017-09-13 05:32:44 -07:00
Rafael Kitover fa9afa4e18 cmake: wx and cross compiling fixes
When calling find_package(wxWidgets ...) allow the first call to fail
because the OpenGL library may not be found. A subsequent call without
listing the OpenGL library is done with REQUIRED.

And if the OpenGL library is not found, skip the OpenGL compile test.

When cross-compiling (e.g. with mxe or other mingw packages) skip the wx
ABI compatibility run tests.

When choosing which minhook lib to link to the wx ABI compat run test
program, check for 64 bit but fallback to 32 bit just in case.
2017-09-12 15:31:49 -07:00
Rafael Kitover 5691ac0c0e installdeps: fedora fixes, including m32
Fix some syntax errors and extraneous output in fedora_installdeps().

"Fix" the 32 bit deps installer to try to ignore file conflicts between
i686 and host rpms, by first using rpm --force to install the 32 bit
rpms and then overwriting them with the host ones using --force as well.
This is hackish and fragile, but there aren't any good alternatives
right now.
2017-09-12 13:47:56 -07:00
Rafael Kitover f5cb7b2b40 support Wx built with --enable-stl #134
When Wx is built with --enable-stl, wxString to wxChar*/char* implicit
conversions and vice-versa no longer work.

Change all wxChar* data members to wxString and change all pointer
arithmetic code (mostly in opts.cpp, cmdevents.cpp and
widgets/joyedit.cpp) to use wxString methods instead.

Also make mostly minor changes in various other files for all of this to
work.
2017-09-10 15:44:18 -07:00
Rafael Kitover 142dbc0aca cmake: use arch specific minhook trampoline libs
Use either the 32 bit or 64 bit MinHook trampoline static lib for the Wx
ABI tests, depending on the detected arch of the host/target.
2017-09-10 12:24:36 -07:00
Rafael Kitover de95c70547 fix Wx ABI check for Win32/MinGW
Fix error dialog boxes popping up when the Wx ABI compat tests are run
from cmake.

Wx 3.x is hardcoded to use MessageBox for wxLogFatalError(), even in a
console app, so use the minhook trampoline lib (added to dependencies)
to hook the Win32 API MessageBoxW and MessageBoxA (the second just in
case) so that no error dialogs pop up.

Details here:

https://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
2017-09-10 11:00:24 -07:00
Rafael Kitover 42f6c446ea minor improvements for Wx compile tests
Include `wx/wxprec.h` (precompiled header first in test programs to
possibly make the tests slightly faster.

For the ABI compat check, set a variable for the test program instead of
listing it twice.
2017-09-08 08:59:19 -07:00
Rafael Kitover ceef480e70 improve wx GCC ABI check #142
Following some suggestions from @ArtiiP, first check if there are no
issues without an -fabi-version flag, and then instead of incrementing
from 0, decrement from 15 to find the highest working ABI version.

This is very slow if the needed ABI version is 2 for example, but not
much to do about that for the time being.
2017-09-04 12:28:24 -07:00
Rafael Kitover b1937fe9cb improve Wx GCC ABI check #142
Start checking the ABI version at -fabi-version=0, which is the default,
and if that succeeds don't set the flag at all.

This will allow the code to work properly if and when Wx removes the ABI
check alltogether.
2017-09-02 18:52:01 -07:00