QW-Group / ezquake-source

main ezQuake source code base
https://www.ezquake.com/
GNU General Public License v2.0
265 stars 122 forks source link

BUG: +mlook not working on OSX #134

Closed markandrewj closed 8 years ago

markandrewj commented 8 years ago

Hello,

After watching QuakeCon this year I thought it would be fun to play a bit of QuakeWorld. I was able to get the game running using nQuake, but +mlook did not work and it would often crash while loading. I am on El Capitan 10.11.6, which is way past the current hosted release of ezQuake currently on the site, so I built ezQuake from source. The issue of crashing while loading stopped, but I was still unable to use +mlook (can not look up, down, left, or right using mouse). I am using a Logitech G502 if it is of any significance.

meag commented 8 years ago

Haven't heard of this problem before - have you tried /freelook 1 ?

markandrewj commented 8 years ago

Yes, I did try /freelook 1, it is weird because I can still use the mouse for menu selection, but not in game. I tried it under Windows in Virtual Box it worked, but it was not very playable in Virtual Box. I thought maybe it was my second monitor messing it up, but I unplugged my second monitor today and had the same issue. I tried a fresh install of nQuake today and compiled from source again. I noticed brew had an update for some of the tools to compile nQuake and thought maybe it would fix the problems if I recompiled. I still had the same results though. I am using an old pak file and not the steam file, I'm not sure if that would matter. My experience with id and most versions of quake though is that the pak files are cross compatible. I added my compile log, because there are depreciated declarations. It might be caused by sv_move.c

WARNING: Couldn't detect ezQuake version.
WARNING: Couldn't detect ezQuake version.
[CC] .ezquake/cmodel.o
[CC] .ezquake/cmd.o
[CC] .ezquake/com_msg.o
[CC] .ezquake/common.o
common.c:372:8: warning: 'tempnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
        tmp = tempnam(path, "ezq");
              ^
/usr/include/stdio.h:391:7: note: 'tempnam' has been explicitly marked deprecated here
char    *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam);
         ^
1 warning generated.
[CC] .ezquake/crc.o
[CC] .ezquake/cvar.o
[CC] .ezquake/fs.o
[CC] .ezquake/vfs_os.o
[CC] .ezquake/vfs_pak.o
[CC] .ezquake/vfs_zip.o
[CC] .ezquake/vfs_tcp.o
[CC] .ezquake/vfs_gzip.o
[CC] .ezquake/vfs_doomwad.o
[CC] .ezquake/vfs_mmap.o
[CC] .ezquake/vfs_tar.o
[CC] .ezquake/hash.o
[CC] .ezquake/host.o
[CC] .ezquake/mathlib.o
[CC] .ezquake/md4.o
[CC] .ezquake/net.o
[CC] .ezquake/net_chan.o
[CC] .ezquake/q_shared.o
[CC] .ezquake/version.o
[CC] .ezquake/zone.o
[CC] .ezquake/pmove.o
[CC] .ezquake/pmovetst.o
[CC] .ezquake/pr_cmds.o
[CC] .ezquake/pr_edict.o
[CC] .ezquake/pr_exec.o
[CC] .ezquake/pr2_cmds.o
[CC] .ezquake/pr2_edict.o
[CC] .ezquake/pr2_exec.o
[CC] .ezquake/pr2_vm.o
[CC] .ezquake/sv_ccmds.o
[CC] .ezquake/sv_ents.o
[CC] .ezquake/sv_init.o
[CC] .ezquake/sv_main.o
[CC] .ezquake/sv_master.o
[CC] .ezquake/sv_move.o
sv_move.c:316:28: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        if ( ((rand()&3) & 1) ||  abs(deltay)>abs(deltax))
                                  ^
sv_move.c:316:28: note: use function 'fabsf' instead
        if ( ((rand()&3) & 1) ||  abs(deltay)>abs(deltax))
                                  ^~~
                                  fabsf
sv_move.c:316:40: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        if ( ((rand()&3) & 1) ||  abs(deltay)>abs(deltax))
                                              ^
sv_move.c:316:40: note: use function 'fabsf' instead
        if ( ((rand()&3) & 1) ||  abs(deltay)>abs(deltax))
                                              ^~~
                                              fabsf
2 warnings generated.
[CC] .ezquake/sv_nchan.o
[CC] .ezquake/sv_phys.o
[CC] .ezquake/sv_save.o
[CC] .ezquake/sv_send.o
[CC] .ezquake/sv_user.o
sv_user.c:2218:68: warning: address of array 'sv_client->login' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if ((int)sv_forcenick.value && (int)sv_login.value && sv_client->login)
                                                                   ~~ ~~~~~~~~~~~^~~~~
1 warning generated.
[CC] .ezquake/sv_world.o
[CC] .ezquake/sv_demo.o
[CC] .ezquake/sv_demo_misc.o
[CC] .ezquake/sv_demo_qtv.o
[CC] .ezquake/sv_login.o
sv_login.c:650:38: warning: address of array 'cl->login' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if ((int)sv_forcenick.value && cl->login)
                                            ~~ ~~~~^~~~~
1 warning generated.
[CC] .ezquake/sv_mod_frags.o
[JS] .ezquake/help_variables.o
[JS] .ezquake/help_commands.o
[CC] .ezquake/ioapi.o
[CC] .ezquake/unzip.o
[CC] .ezquake/Ctrl.o
[CC] .ezquake/Ctrl_EditBox.o
[CC] .ezquake/Ctrl_PageViewer.o
[CC] .ezquake/Ctrl_ScrollBar.o
[CC] .ezquake/Ctrl_Tab.o
[CC] .ezquake/EX_FileList.o
EX_FileList.c:548:10: warning: comparison of array 'fl->current_archive' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (fl->current_archive != NULL)
            ~~~~^~~~~~~~~~~~~~~    ~~~~
1 warning generated.
[CC] .ezquake/EX_browser.o
[CC] .ezquake/EX_browser_net.o
[CC] .ezquake/EX_browser_pathfind.o
[CC] .ezquake/EX_browser_ping.o
[CC] .ezquake/EX_browser_qtvlist.o
[CC] .ezquake/EX_browser_sources.o
[CC] .ezquake/EX_qtvlist.o
[CC] .ezquake/ez_controls.o
[CC] .ezquake/ez_scrollbar.o
[CC] .ezquake/ez_scrollpane.o
[CC] .ezquake/ez_label.o
[CC] .ezquake/ez_slider.o
[CC] .ezquake/ez_button.o
[CC] .ezquake/ez_window.o
[CC] .ezquake/cl_cam.o
[CC] .ezquake/cl_cmd.o
cl_cmd.c:854:37: warning: address of array 'cl.serverinfo' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (cls.state >= ca_onserver && cl.serverinfo)
                                     ~~ ~~~^~~~~~~~~~
1 warning generated.
[CC] .ezquake/cl_demo.o
[CC] .ezquake/cl_nqdemo.o
cl_nqdemo.c:960:8: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                        if (abs(cent->current.origin[i] - cent->old_origin[i]) > 128) {
                            ^
cl_nqdemo.c:960:8: note: use function 'fabsf' instead
                        if (abs(cent->current.origin[i] - cent->old_origin[i]) > 128) {
                            ^~~
                            fabsf
cl_nqdemo.c:1028:11: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                                        if ( abs(old_origin[i] - ent.origin[i]) > 128)
                                             ^
cl_nqdemo.c:1028:11: note: use function 'fabsf' instead
                                        if ( abs(old_origin[i] - ent.origin[i]) > 128)
                                             ^~~
                                             fabsf
2 warnings generated.
[CC] .ezquake/cl_ents.o
[CC] .ezquake/cl_input.o
[CC] .ezquake/cl_main.o
[CC] .ezquake/cl_parse.o
[CC] .ezquake/cl_pred.o
[CC] .ezquake/cl_screen.o
cl_screen.c:814:43: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                strlcpy (str, SecondsToHourString((int) abs(timelimit - cl.gametime + scr_gameclock_offset.value)), sizeof(str));
                                                        ^
cl_screen.c:814:43: note: use function 'fabs' instead
                strlcpy (str, SecondsToHourString((int) abs(timelimit - cl.gametime + scr_gameclock_offset.value)), sizeof(str));
                                                        ^~~
                                                        fabs
cl_screen.c:4502:31: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^
cl_screen.c:4502:31: note: use function 'fabs' instead
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^~~
                                     fabs
./mathlib.h:202:21: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                    ^
cl_screen.c:4502:31: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^
cl_screen.c:4502:31: note: use function 'fabs' instead
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^~~
                                     fabs
./mathlib.h:202:38: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                     ^
cl_screen.c:4502:31: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^
cl_screen.c:4502:31: note: use function 'fabs' instead
        health_amount_width = Q_rint(abs((MV_HUD_HEALTH_WIDTH * health) / 100.0));
                                     ^~~
                                     fabs
./mathlib.h:202:58: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                                         ^
4 warnings generated.
[CC] .ezquake/cl_slist.o
[CC] .ezquake/cl_tcl.o
[CC] .ezquake/cl_tent.o
[CC] .ezquake/cl_view.o
cl_view.c:192:8: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
                if ( fabs(cl.frames[(cls.netchan.outgoing_sequence-1)&UPDATE_MASK].cmd.forwardmove) < 200)
                     ^
cl_view.c:192:8: note: use function 'abs' instead
                if ( fabs(cl.frames[(cls.netchan.outgoing_sequence-1)&UPDATE_MASK].cmd.forwardmove) < 200)
                     ^~~~
                     abs
1 warning generated.
[CC] .ezquake/common_draw.o
common_draw.c:809:46: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                strlcpy (str, SecondsToMinutesString((int) abs(timelimit - cl.gametime + *gameclockoffset)), sizeof(str));
                                                           ^
common_draw.c:809:46: note: use function 'fabs' instead
                strlcpy (str, SecondsToMinutesString((int) abs(timelimit - cl.gametime + *gameclockoffset)), sizeof(str));
                                                           ^~~
                                                           fabs
common_draw.c:1469:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((height * value) / max_value));
                                ^
common_draw.c:1469:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((height * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:21: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                    ^
common_draw.c:1469:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((height * value) / max_value));
                                ^
common_draw.c:1469:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((height * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:38: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                     ^
common_draw.c:1469:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((height * value) / max_value));
                                ^
common_draw.c:1469:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((height * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:58: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                                         ^
common_draw.c:1471:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((width * value) / max_value));
                                ^
common_draw.c:1471:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((width * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:21: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                    ^
common_draw.c:1471:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((width * value) / max_value));
                                ^
common_draw.c:1471:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((width * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:38: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                     ^
common_draw.c:1471:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                amount = Q_rint(abs((width * value) / max_value));
                                ^
common_draw.c:1471:19: note: use function 'fabsf' instead
                amount = Q_rint(abs((width * value) / max_value));
                                ^~~
                                fabsf
./mathlib.h:202:58: note: expanded from macro 'Q_rint'
#define Q_rint(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) - 0.5))
                                                         ^
7 warnings generated.
[CC] .ezquake/console.o
[CC] .ezquake/config_manager.o
[CC] .ezquake/demo_controls.o
[CC] .ezquake/document_rendering.o
[CC] .ezquake/fchecks.o
[CC] .ezquake/fmod.o
[CC] .ezquake/fragstats.o
[CC] .ezquake/help.o
[CC] .ezquake/help_files.o
[CC] .ezquake/hud.o
[CC] .ezquake/hud_common.o
hud_common.c:3982:21: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                map_height_diff = abs(cl.worldmodel->maxs[2] - cl.worldmodel->mins[2]);
                                  ^
hud_common.c:3982:21: note: use function 'fabsf' instead
                map_height_diff = abs(cl.worldmodel->maxs[2] - cl.worldmodel->mins[2]);
                                  ^~~
                                  fabsf
1 warning generated.
[CC] .ezquake/hud_editor.o
[CC] .ezquake/ignore.o
[CC] .ezquake/image.o
[CC] .ezquake/irc_filter.o
[CC] .ezquake/irc.o
[CC] .ezquake/keys.o
[CC] .ezquake/logging.o
[CC] .ezquake/match_tools.o
[CC] .ezquake/menu.o
[CC] .ezquake/menu_demo.o
[CC] .ezquake/menu_ingame.o
[CC] .ezquake/menu_mp3player.o
[CC] .ezquake/menu_multiplayer.o
[CC] .ezquake/menu_options.o
[CC] .ezquake/menu_proxy.o
[CC] .ezquake/modules.o
[CC] .ezquake/movie.o
[CC] .ezquake/mp3_player.o
[CC] .ezquake/mp3_audacious.o
[CC] .ezquake/mp3_xmms.o
[CC] .ezquake/mp3_xmms2.o
[CC] .ezquake/mp3_mpd.o
[CC] .ezquake/mp3_winamp.o
[CC] .ezquake/mvd_autotrack.o
[CC] .ezquake/mvd_utils.o
[CC] .ezquake/mvd_xmlstats.o
[CC] .ezquake/parser.o
[CC] .ezquake/qtv.o
[CC] .ezquake/r_part.o
[CC] .ezquake/rulesets.o
[CC] .ezquake/sbar.o
[CC] .ezquake/settings_page.o
[CC] .ezquake/sha1.o
[CC] .ezquake/skin.o
[CC] .ezquake/snd_main.o
[CC] .ezquake/snd_mem.o
[CC] .ezquake/snd_mix.o
[CC] .ezquake/snd_ov.o
[CC] .ezquake/stats_grid.o
[CC] .ezquake/teamplay.o
teamplay.c:2505:12: warning: address of array 'cp->name' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (!cp->name || !cp->name[0] || cp->spectator) continue;
                    ~~~~~^~~~
1 warning generated.
[CC] .ezquake/tp_msgs.o
[CC] .ezquake/tp_triggers.o
[CC] .ezquake/textencoding.o
[CC] .ezquake/utils.o
[CC] .ezquake/vx_tracker.o
[CC] .ezquake/wad.o
[CC] .ezquake/xsd.o
[CC] .ezquake/xsd_command.o
[CC] .ezquake/xsd_document.o
[CC] .ezquake/xsd_variable.o
[CC] .ezquake/collision.o
[CC] .ezquake/gl_draw.o
[CC] .ezquake/gl_bloom.o
[CC] .ezquake/gl_md3.o
[CC] .ezquake/gl_mesh.o
[CC] .ezquake/gl_model.o
[CC] .ezquake/gl_ngraph.o
[CC] .ezquake/gl_refrag.o
[CC] .ezquake/gl_rlight.o
[CC] .ezquake/gl_rmain.o
[CC] .ezquake/gl_rmisc.o
[CC] .ezquake/gl_rpart.o
[CC] .ezquake/gl_rsurf.o
gl_rsurf.c:631:69: warning: address of array 's->texinfo->texture->name' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (s &&s->texinfo && s->texinfo->texture && s->texinfo->texture->name )
                                                          ~~ ~~~~~~~~~~~~~~~~~~~~~^~~~
1 warning generated.
[CC] .ezquake/gl_texture.o
[CC] .ezquake/gl_warp.o
[CC] .ezquake/vx_camera.o
[CC] .ezquake/vx_coronas.o
[CC] .ezquake/vx_motiontrail.o
[CC] .ezquake/vx_stuff.o
[CC] .ezquake/vx_vertexlights.o
vx_vertexlights.c:64:19: warning: using floating point absolute value function 'fabsf' when argument is of integer type [-Wabsolute-value]
        pitchofs = fmodf(fabsf(pitchofs), 256);
                         ^
vx_vertexlights.c:64:19: note: use function 'abs' instead
        pitchofs = fmodf(fabsf(pitchofs), 256);
                         ^~~~~
                         abs
vx_vertexlights.c:65:17: warning: using floating point absolute value function 'fabsf' when argument is of integer type [-Wabsolute-value]
        yawofs = fmodf(fabsf(yawofs), 256);
                       ^
vx_vertexlights.c:65:17: note: use function 'abs' instead
        yawofs = fmodf(fabsf(yawofs), 256);
                       ^~~~~
                       abs
2 warnings generated.
[CC] .ezquake/vid_common_gl.o
[CC] .ezquake/cd_null.o
[CC] .ezquake/vid_sdl2.o
[CC] .ezquake/sys_sdl2.o
[CC] .ezquake/in_sdl2.o
[CC] .ezquake/localtime_posix.o
[CC] .ezquake/sys_posix.o
sys_posix.c:641:9: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
        return sem_init(sem, 0, value); // Don't share between processes
               ^
/usr/include/sys/semaphore.h:55:5: note: 'sem_init' has been explicitly marked deprecated here
int sem_init(sem_t *, int, unsigned int) __deprecated;
    ^
sys_posix.c:656:9: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]
        return sem_destroy(sem);
               ^
/usr/include/sys/semaphore.h:53:5: note: 'sem_destroy' has been explicitly marked deprecated here
int sem_destroy(sem_t *) __deprecated;
    ^
2 warnings generated.
[CC] .ezquake/linux_signals.o
[CC] .ezquake/in_osx.o
in_osx.c:119:2: warning: Race conditions'r'us [-W#warnings]
#warning Race conditions'r'us
 ^
1 warning generated.
[CC] .ezquake/sys_osx.o
[LD] ezquake-darwin-x86_64
markandrewj commented 8 years ago

I went through and changed the types to floating/double/int where it asked, it compiled fine, but it did not seem to resolve the issue. I haven't tried anything with the errors that were not type errors at the moment though.

jite commented 8 years ago

I started to believe that it has something to do with the input code for OSX which is a bit special (to avoid mouse accel), however if it doesn't work with version 2 of ezQuake that can't be the cause since it doesn't have that code.

Just to be sure, try in_raw 0, does it change anything? Moving the mouse does nothing? Tried changing /sensitivity in console?

markandrewj commented 8 years ago

In_raw 0 causes it to crash. I tried sensitivity, m_yaw, and m_pitch. I also tried an old IntelliMouse, the issue still persisted.

jite commented 8 years ago

This is weird, really weird. Are you using any form of mouse drivers? We're intercepting USB data because it's the only way to get rid of mouse acceleration on OSX. According to Tuna it doesn't work properly if you have other mouse drivers installed.

markandrewj commented 8 years ago

Hey, I got it to work. I did not really think about it, I am currently using seil (https://pqrs.org/osx/karabiner/seil.html.en) and karabiner (https://pqrs.org/osx/karabiner/) for keyboard remapping, there is also some mouse mapping you can do (that I don't normally use). I did a fresh compile and used +mlook and in_raw 0 with karabiner and seil disabled and it worked. This is the first time I have ever had any issues. Hopefully it can help anyone else out that may have the same issue in the future. If the issue resurfaces and turns out not to be karabiner or seil I well reopen the ticket, but for now I well close it. Thanks for the help.

markandrewj commented 8 years ago

I just wanted to mention, that if someone else has this problem with out the two apps I was using running. A solution might to put in_raw "0" in the config file directly instead of setting it in the console. I'm starting to think that I got lucky and in_raw "0" saved before crashing, and it was not the apps. My compiled copy seems to be running smooth now though. Would it be worth uploading my build, since there is no nightly builds for mac like windows?

When I pull over the patched files from nQuake it made things crash though, when I clear the config it runs. Not specific to this project, but possibly something people well run into.

matti commented 5 years ago

I had to uninstall karabiner elements to use mlook

SPGremlin commented 4 years ago

I stumbled upon the same problem in OS X Catalina (10.15.5) and was able to fix it. It was an access permissions issue.

System Settings -> Security and Privacy -> Input Monitoring -> "allow the apps below to monitor input from your keyboard even while using other apps", give a checkbox to "sh".

Note to developers: it would be cooler if the app presented itself as "ezQuake" rather then some ambigous "sh", it looked somewhat scary grant permissions to some "sh" binary. But it worked immediately - so I know that "sh" was in fact EZQuake...