Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
5d1ae85a
Commit
5d1ae85a
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Hand-picked Mac OSX cursor and bundle path fixes from
https://bitbucket.org/toabi/minetest-mac
parent
13f46907
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/game.cpp
+8
-2
8 additions, 2 deletions
src/game.cpp
src/porting.cpp
+21
-3
21 additions, 3 deletions
src/porting.cpp
with
29 additions
and
5 deletions
src/game.cpp
+
8
−
2
View file @
5d1ae85a
...
...
@@ -1366,7 +1366,11 @@ void the_game(
if
((
device
->
isWindowActive
()
&&
noMenuActive
())
||
random_input
)
{
if
(
!
random_input
)
device
->
getCursorControl
()
->
setVisible
(
false
);
{
// Mac OSX gets upset if this is set every frame
if
(
device
->
getCursorControl
()
->
isVisible
())
device
->
getCursorControl
()
->
setVisible
(
false
);
}
if
(
first_loop_after_window_activation
){
//std::cout<<"window active, first loop"<<std::endl;
...
...
@@ -1397,7 +1401,9 @@ void the_game(
input
->
setMousePos
(
displaycenter
.
X
,
displaycenter
.
Y
);
}
else
{
device
->
getCursorControl
()
->
setVisible
(
true
);
// Mac OSX gets upset if this is set every frame
if
(
device
->
getCursorControl
()
->
isVisible
()
==
false
)
device
->
getCursorControl
()
->
setVisible
(
true
);
//std::cout<<"window inactive"<<std::endl;
first_loop_after_window_activation
=
true
;
...
...
This diff is collapsed.
Click to expand it.
src/porting.cpp
+
21
−
3
View file @
5d1ae85a
...
...
@@ -214,10 +214,28 @@ void initializePaths()
*/
#elif defined(__APPLE__)
#include
<unistd.h>
#include
"CoreFoundation/CoreFoundation.h"
// Code based on
// http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c
CFBundleRef
main_bundle
=
CFBundleGetMainBundle
();
CFURLRef
resources_url
=
CFBundleCopyResourcesDirectoryURL
(
main_bundle
);
char
path
[
PATH_MAX
];
if
(
CFURLGetFileSystemRepresentation
(
resources_url
,
TRUE
,
(
UInt8
*
)
path
,
PATH_MAX
))
{
dstream
<<
"Bundle resource path: "
<<
path
<<
std
::
endl
;
//chdir(path);
path_data
=
std
::
string
(
path
)
+
"/data"
;
}
else
{
// error!
dstream
<<
"WARNING: Could not determine bundle resource path"
<<
std
::
endl
;
}
CFRelease
(
resources_url
);
path_userdata
=
std
::
string
(
getenv
(
"HOME"
))
+
"/Library/Application Support/"
+
APPNAME
;
path_data
=
std
::
string
(
"minetest-mac.app/Contents/Resources/data/"
);
#endif
#endif // RUN_IN_PLACE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment