Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Linux Port for 1.01+ #188

Closed
wants to merge 16 commits into from
Closed

Updated Linux Port for 1.01+ #188

wants to merge 16 commits into from

Commits on Jan 17, 2023

  1. OpenGL/screenCapture: fix random crashes on init

    On startup, screenCapture will cause random crashed because
    of uninitialized m_capures member.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    45af380 View commit details
    Browse the repository at this point in the history
  2. Fix crashes in Allocator code

    When freeing items with allocator_free, at some point all
    members of the Allocator become ALLOC_INVALID_PTR, then
    allcator_getHead crashes due to trying to derefence an invalid
    Allocator::head pointer.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    1b994f6 View commit details
    Browse the repository at this point in the history
  3. Explicity initialize Archive type at class creation time

    The GobMemoryArchive does not define an ARCHIVE_GOB type anywhere.
    To fix this, add a new constructor to the base class to set the
    archive type at instantiation time.
    This fixes a crash on Linux with Mods (quitting while running a
    mod, or loading a savegame away from a mod, where the memory gob
    freeing causes a crash).
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    5da7525 View commit details
    Browse the repository at this point in the history
  4. MIDI: fix length of the PROGRAM_CHANGE message

    TFE sends 3 bytes for every MIDI message; however there are
    some, among them PROGRAM CHANGE (to define instrument to use),
    which only have 1 argument byte instead of 2.
    The Linux ALSA midi parser gets confused by the 3rd byte.
    So adhere to MIDI and only send 2 byte messages for PROGRAM CHANGE.
    (there are other midi messages with only 2 bytes, but TFE doesn't
    use them).
    
    This fixes the piano-only output on Linux.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    26329d0 View commit details
    Browse the repository at this point in the history
  5. Fix ImGui usage bug in Input Settings page

    There are 2 BeginChild() that are close with End(), fix that.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    a49e8bd View commit details
    Browse the repository at this point in the history
  6. imuse: fix int to pointer cast warning

    gcc and clang complain about the 2nd parameter to ImSetSoundTrigger();
    Fix with a reinterpret_cast<>
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    78be16d View commit details
    Browse the repository at this point in the history
  7. fix build with clang

    clang-15 stops build with this error:
    TheForceEngine/TFE_Jedi/IMuse/imDigitalSound.cpp:61:13: error: copying variable of type 'atomic_s32' (aka 'atomic<int>') invokes deleted constructor
            atomic_s32 s_digitalPause = 0;
    
    Remove the explicit initialization.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    37990ba View commit details
    Browse the repository at this point in the history
  8. replace windows-only functions with portable ones

    - _strlwr()/_strupr() are Windows CRT only, roll our own and use them
      throughout the codebase.
    - replace the windows-oly *_s() string functions with portable
      equivalents
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    9c8fefd View commit details
    Browse the repository at this point in the history
  9. Archives: fix size of members on 64bit linux/unix

    Windows and Linux/Posix have different opinions on the length of
    "(unsigned) long" and other C types on 64bit:  Windows compilers
    keep 32bit and 64bit identical, while they differ on POSIX.
    
    Work around this by using the explicitly sized types, and letting
    the compiler sort it out.
    Matthew Gilmore authored and mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    f532c08 View commit details
    Browse the repository at this point in the history
  10. rework some macro usage to make gcc/clang happy.

    gcc-13 is picky about preprocessor macros and missing arguments
    in place of VA_ARGS.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    bc59696 View commit details
    Browse the repository at this point in the history
  11. include missing C++ header files

    unlike previous versions, gcc-13 does no longer implicitly include
    a lot of c++ header files.  Add them to the files that need them.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    65d3522 View commit details
    Browse the repository at this point in the history
  12. fix multiple definitions in TFE_DarkForces/GameUI/pda.cpp

    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    5343e33 View commit details
    Browse the repository at this point in the history
  13. RenderBackend: call SDL_SetWindowFullscreen

    Fixes fullscreen on Linux Window managers.
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    0e2ab6e View commit details
    Browse the repository at this point in the history
  14. fix template specialization errors in filestream/memorystream

    GCC complains about an invalid explicit specialization outside
    a namespace scope:
    filestream.h:67:19: error: explicit specialization in non-namespace scope 'class FileStream'
    
    Work around by explicitly implementing the template.
    
    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    92b49b8 View commit details
    Browse the repository at this point in the history
  15. Add posix mutexes to audio devices support

    Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
    Matthew Gilmore authored and mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    7ee7926 View commit details
    Browse the repository at this point in the history
  16. Linux bits

    Implement missing pieces for Linux support:
    - CMake buildsystem
    - posix/linux specific file- and pathhandling bits.
      this implementation also takes case-sensitivity of
      unix filesystems into account.
    - add infrastructure to look up system files (shaders, doc,
      fonts, ...) independently from the main binary (for distro
      packaging).
    - fix up the linux thread implementation.
    - fix up 32bit target build.
    - crash handler skeleton.
    - can look for game data files in local Steam installation on
      multiple libraries.
      (GOG linux games do not leave trails about their installation
       paths in any central location, so gog detection is missing).
    
    based partly on previous work by Matthew Gilmore.
    mlauss2 committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    84f7879 View commit details
    Browse the repository at this point in the history