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

Linux port #17

Closed
16 tasks done
JanSimek opened this issue May 26, 2022 · 3 comments · Fixed by #25
Closed
16 tasks done

Linux port #17

JanSimek opened this issue May 26, 2022 · 3 comments · Fixed by #25

Comments

@JanSimek
Copy link
Contributor

JanSimek commented May 26, 2022

The project compiles and runs under linux after some changes and commenting out the audio code. Below is the list of functions and macros that need to be reimplemented for linux:

  • _splitpath
  • filelength
  • stricmp → alias to strcasecmp
  • strnicmp
  • strupr
  • strlwr
  • itoa
  • CopyFileA
  • timeGetTime
  • GetTickCount
  • min → macro #define MIN(a, b) (((a) < (b)) ? (a) : (b))
  • max → macro #define MAX(a, b) (((a) > (b)) ? (a) : (b))
  • _MAX_DIR → ?
  • _MAX_FNAMEFILENAME_MAX
  • _MAX_EXT → ?
  • MAX_PATHPATH_MAX

Also, what about the mutexes? I don't understand what the autorun.c/h file is for except preventing multiple instances of the game being run.

@Risu
Copy link

Risu commented May 26, 2022

For help with audio you can take a look at falltergeist implementation: Mixer.cpp

alexbatalov added a commit that referenced this issue May 28, 2022
alexbatalov added a commit that referenced this issue May 28, 2022
alexbatalov added a commit that referenced this issue May 28, 2022
alexbatalov added a commit that referenced this issue May 28, 2022
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 28, 2022
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 28, 2022
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 28, 2022
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 28, 2022
alexbatalov added a commit that referenced this issue May 28, 2022
Fixes AppleClang complaints.

See #17
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 29, 2022
@alexbatalov alexbatalov mentioned this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
alexbatalov added a commit that referenced this issue May 29, 2022
JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue May 30, 2022
@k3tamina
Copy link
Contributor

k3tamina commented Jun 2, 2022

Also, what about the mutexes? I don't understand what the autorun.c/h file is for except preventing multiple instances of the game being run.

Aside the fact that a Windows mutex is not a mutex but is instead an interprocess sync primitive, I think that they are being used:

  1. in autorunMutexCreate to prevent multiple instances of the same process, mutex is freed at the end of falloutMain by calling autorunMutexClose
  2. in programWindowSetTitle to prevent multiple initialization of the window title, mutex is freed in windowManagerExit being called twice by calling gameExit > _windowExit at the end of falloutMain and redundantly at exit by calling atexit(windowManagerExit) in windowManagerInit
  3. in main but freed almost immediately in windowManagerInit, I don't understand why

To make number 1 cross platform I think the most effective way is to implement file locking, either by using a well maintained library (such as boost) or by hardcoding for each platform (linux example).

In my opinion number 2 shouldn't be needed, it can be replaced by introducing well thought global variables.
Number 3 might not be needed, until we figure out what's it needed for.

@alexbatalov
Copy link
Owner

I don't think we need them at all. I've checked a couple of open source games, there are no locks or mutexes to prevent multiple instances.

JanSimek added a commit to JanSimek/fallout2-ce that referenced this issue Jun 5, 2022
Fixes restoring desktop resolution on linux after game exit. See alexbatalov#17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants