]> de.git.xonotic.org Git - xonotic/netradiant.git/log
xonotic/netradiant.git
3 years agoradiant/texwindow: fix a minor typo
Thomas Debesse [Wed, 10 Mar 2021 12:03:06 +0000 (13:03 +0100)]
radiant/texwindow: fix a minor typo

3 years agomacos: workaround the laggy XY/Camera window mouse pointer recentering
Thomas Debesse [Wed, 10 Mar 2021 06:25:34 +0000 (07:25 +0100)]
macos: workaround the laggy XY/Camera window mouse pointer recentering

On macOS, a huge lag occurs when the pointer is recentered.
This happens when calling GTK functions to set the pointer
at the center of the widget so it looks to be a lag in GTK
or in underlayer macOS technology GTK relies on.

When that mouse pointer recenter is disabled, one can drag
infinitely without lag BUT then comes weird bugs because
the “released right mouse button” event is only read when
the mouse is over the widget, so if one releases over
another widget, the mouse pointer is not released
and if one do another right mouse click on another XY widget,
the internal state becomes corrupted and a crash is
expected to happen soon.

So the idea of that workaround is to only reposition
the pointer when an edge of the XY/Camera window is reached,
so the user does not experience lag for the whole size
of the XY window, experiencing the lag only when a
whole dimension is moved. To optimize the distance
the user can move without lag, when an edge is reached
the pointer is repositioned on the opposite edge.

It was noticed the pointer is not hidden on macOS when
moving the map, so the pointer being visible during
all the move operation is not restored to the initial
position when it is released, but keep the position
currently seen by the user at right mouse button release
time.

Note: It was noticed it is possible to esscape the capturing
widnow when the render is slow and framerate is low, it
may also occurs with touch screens (like virtual machines has)
to move the pointer out of the XY/Camera widget and get the
internal state corruption problem.

3 years agoradiant/cursor: get the display from the widget, attempt to support multiple displays...
Thomas Debesse [Wed, 10 Mar 2021 07:08:09 +0000 (08:08 +0100)]
radiant/cursor: get the display from the widget, attempt to support multiple displays and screens

3 years agoradiant/cursor: get/set cursor position from widget instead of window
Thomas Debesse [Wed, 10 Mar 2021 05:03:11 +0000 (06:03 +0100)]
radiant/cursor: get/set cursor position from widget instead of window

3 years agoradiant/cursor: factorise a bit the code
Thomas Debesse [Wed, 10 Mar 2021 05:03:11 +0000 (06:03 +0100)]
radiant/cursor: factorise a bit the code

3 years agorevert 0574802, the glwidget has to not be hidden for the macos hack to work
Thomas Debesse [Wed, 10 Mar 2021 04:07:48 +0000 (05:07 +0100)]
revert 0574802, the glwidget has to not be hidden for the macos hack to work

revert 057480298a2d8b73f1a49c6e8d8d162b09c276d4
and add a comment to make it obvious to future readers

3 years agocmake/gtkglext: rewrite the way it is built
Thomas Debesse [Tue, 9 Mar 2021 13:21:40 +0000 (14:21 +0100)]
cmake/gtkglext: rewrite the way it is built

3 years agomacos: add ssasc to deps, it's required to build the GTK theme
Thomas Debesse [Tue, 9 Mar 2021 04:53:06 +0000 (05:53 +0100)]
macos: add ssasc to deps, it's required to build the GTK theme

3 years agolinux: more knowledge about stripping and non-PIE binaries
Thomas Debesse [Mon, 8 Mar 2021 16:05:28 +0000 (17:05 +0100)]
linux: more knowledge about stripping and non-PIE binaries

3 years agodaemonmap: sync submodule reference
Thomas Debesse [Mon, 8 Mar 2021 14:44:42 +0000 (15:44 +0100)]
daemonmap: sync submodule reference

3 years agolinux: do not strip binaries (does not work well with the non-PIE hack)
Thomas Debesse [Mon, 8 Mar 2021 13:25:43 +0000 (14:25 +0100)]
linux: do not strip binaries (does not work well with the non-PIE hack)

3 years agoradiant: build PIE linux binary on FHS installation
Thomas Debesse [Mon, 8 Mar 2021 13:10:22 +0000 (14:10 +0100)]
radiant: build PIE linux binary on FHS installation

3 years agoeasy-builder: always sync before doing serious things to prevent issues happening...
Thomas Debesse [Mon, 8 Mar 2021 08:31:53 +0000 (09:31 +0100)]
easy-builder: always sync before doing serious things to prevent issues happening with slow I/O on macOS

errors like that:

> CMakeFiles/gtktheme-mojave.dir/build.make:73: CMakeFiles/gtkglext.dir/build.make:73: CMakeFiles/gtktheme-mojave.dir/progress.make: No such file or directory

> ginstall: cannot change permissions of 'netradiant/build/lib/gtkglext-1.0/include/gdkglext-config.h': No such file or directory

> mkdir: netradiant/build/registry: Operation not permitted

> clang: error: no such file or directory: '../../libs/libcm.a'

3 years agoeasy-builder: the immediate build retry does not fix the random linking issue on...
Thomas Debesse [Mon, 8 Mar 2021 08:52:05 +0000 (09:52 +0100)]
easy-builder: the immediate build retry does not fix the random linking issue on macOS that usually desappear on rebuilding

Unfortunately retrying immediately does not help, while doing it by hand some time later does, I have no proper explanation yet:

```
[100%] Linking CXX executable ../netradiant
Undefined symbols for architecture x86_64:
  "_gdk_gl_config_new", referenced from:
      glconfig_new() in libgtkutil.a(glwidget.cpp.o)
      glconfig_new_with_depth() in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_config_new_by_mode", referenced from:
      glconfig_new() in libgtkutil.a(glwidget.cpp.o)
      glconfig_new_with_depth() in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_get_type", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_gl_begin", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_swap_buffers", referenced from:
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_get_gl_context", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_get_gl_window", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_is_gl_capable", referenced from:
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_set_gl_capability", referenced from:
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [netradiant] Error 1
make[1]: *** [radiant/CMakeFiles/netradiant.dir/all] Error 2
make: *** [all] Error 2
+ task_build
+ make -j8
[  0%] Built target cm
[  0%] Built target filematch
[  1%] Built target archivepak
[  3%] Built target mathlib
[  3%] Built target fastlz
[  3%] Built target l_net
[  6%] Built target recast
[  8%] Built target detour
[  9%] Built target ddslib
[  9%] Built target archivewad
[  9%] Built target archivezip
[ 10%] Built target etclib
[ 10%] Built target imagehl
[ 10%] Built target imagepng
[ 11%] Built target imageq2
[ 12%] Built target imagewebp
[ 12%] Built target xmllib
[ 14%] Built target entity
[ 15%] Built target mapq3
[ 15%] Built target iqmmodel
[ 18%] Built target md3model
[ 18%] Built target shaders
[ 19%] Built target container
[ 19%] Built target cmdlib
[ 20%] Built target debugging
[ 24%] Built target generic
[ 25%] Built target picomodel
[ 25%] Built target uilib
[ 25%] Built target math
[ 25%] Built target memory
[ 25%] Built target os
[ 25%] Built target modulesystem
[ 26%] Built target profile
[ 26%] Built target script
[ 26%] Built target signal
[ 26%] Built target stream
[ 27%] Built target string
[ 29%] Built target includes
[ 30%] Built target splines
[ 30%] Built target libs
[ 37%] Built target qdata3
[ 39%] Built target image
[ 40%] Built target crnrgba
[ 41%] Built target vfspk3
[ 50%] Built target q3data
[ 54%] Built target q2map
[ 55%] Built target daemonmap
[ 56%] Built target h2data
[ 58%] Built target model
[ 58%] Built target mapxml
[ 59%] Built target imagecrn
[ 59%] Built target modules
[ 72%] Built target gtkutil
[ 75%] Built target q3map2
[ 75%] Built target shaderplug
[ 75%] Built target sunplug
[ 76%] Built target prtview
[ 77%] Built target ufoaiplug
[ 78%] Built target brushexport
[ 83%] Built target bobtoolz
[ 84%] Linking CXX executable ../netradiant
Undefined symbols for architecture x86_64:
  "_gdk_gl_config_new", referenced from:
      glconfig_new() in libgtkutil.a(glwidget.cpp.o)
      glconfig_new_with_depth() in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_config_new_by_mode", referenced from:
      glconfig_new() in libgtkutil.a(glwidget.cpp.o)
      glconfig_new_with_depth() in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_get_type", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_gl_begin", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gdk_gl_drawable_swap_buffers", referenced from:
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_get_gl_context", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_get_gl_window", referenced from:
      _glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_make_current(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
      glwidget_context_created(ui::GLArea, void*) in libgtkutil.a(glwidget.cpp.o)
      glwidget_swap_buffers(ui::GLArea) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_is_gl_capable", referenced from:
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
  "_gtk_widget_set_gl_capability", referenced from:
      glwidget_enable_gl(ui::GLArea, ui::Widget, void*) in libgtkutil.a(glwidget.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [netradiant] Error 1
make[1]: *** [radiant/CMakeFiles/netradiant.dir/all] Error 2
make: *** [all] Error 2
```

3 years agoeasy-builder: use make directly because cmake on macOS does not return error code...
Thomas Debesse [Mon, 8 Mar 2021 08:30:41 +0000 (09:30 +0100)]
easy-builder: use make directly because cmake on macOS does not return error code on build failure

3 years agosubmodules: sync daemonmap reference
Thomas Debesse [Sun, 7 Mar 2021 09:35:42 +0000 (10:35 +0100)]
submodules: sync daemonmap reference

3 years agoeasy-builder: don't forget submodules
Thomas Debesse [Sun, 7 Mar 2021 09:33:10 +0000 (10:33 +0100)]
easy-builder: don't forget submodules

3 years agomacos: properly set GL_SILENCE_DEPRECATION when building gtkglext
Thomas Debesse [Sun, 7 Mar 2021 09:09:29 +0000 (10:09 +0100)]
macos: properly set GL_SILENCE_DEPRECATION when building gtkglext

3 years agoradiant: build netradiant as non-PIE binary on Linux to workaround a mime-type bug
Thomas Debesse [Sun, 7 Mar 2021 05:33:31 +0000 (06:33 +0100)]
radiant: build netradiant as non-PIE binary on Linux to workaround a mime-type bug

PIE executables were wrongly recognized as shared libraries on Linux
because of a mistake in the mime-type library.
Because of that it was not possible to launch such executables from
the file browser.

While the problem is fixed upstream, most distributions still ship
with a faulty mime-type library and may do for a long time.

See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11

3 years agolibrary-bundler: only call rmdir on empty directories when cleaning-up useless stuff
Thomas Debesse [Sun, 7 Mar 2021 05:15:23 +0000 (06:15 +0100)]
library-bundler: only call rmdir on empty directories when cleaning-up useless stuff

3 years agomacos: set GL_SILENCE_DEPRECATION when building radiant
Thomas Debesse [Sun, 7 Mar 2021 05:14:50 +0000 (06:14 +0100)]
macos: set GL_SILENCE_DEPRECATION when building radiant

3 years agomacos: just restart the build when it failed
Thomas Debesse [Sun, 7 Mar 2021 03:35:37 +0000 (04:35 +0100)]
macos: just restart the build when it failed

Sometime linking fails on macOS with this message:

ld: symbol(s) not found for architecture x86_64

and restarting the build process just work.

3 years agoreadme: wording
Thomas Debesse [Sun, 7 Mar 2021 00:16:13 +0000 (01:16 +0100)]
readme: wording

3 years agoreadme: add instructions for freebsd and more knowledge about it
Thomas Debesse [Sun, 7 Mar 2021 00:11:30 +0000 (01:11 +0100)]
readme: add instructions for freebsd and more knowledge about it

3 years agofreebsd: exclude more libraries when bundling
Thomas Debesse [Sat, 6 Mar 2021 23:24:50 +0000 (00:24 +0100)]
freebsd: exclude more libraries when bundling

3 years agofreebsd: enable bundling
Thomas Debesse [Sat, 6 Mar 2021 23:07:02 +0000 (00:07 +0100)]
freebsd: enable bundling

Also always prevent cmake to patch rpath when bundling,
this is done by library-bundler instead.

3 years agofreebsd: do not strip binaries when installing, that breaks them (truncated ELF file)
Thomas Debesse [Sat, 6 Mar 2021 23:03:22 +0000 (00:03 +0100)]
freebsd: do not strip binaries when installing, that breaks them (truncated ELF file)

Note: I have not tried to strip binaries that had not rpath being patched,
but for sure stripping breaks binaries produced with the current toolchain.

$ ldd netradiant
elf_load_section: truncated ELF file
nr: signal 6

./netradiant
elf_load_section: truncated ELF file
Abort trap

3 years agofreebsd: add freebsd support to library-bundler
Thomas Debesse [Sat, 6 Mar 2021 22:55:05 +0000 (23:55 +0100)]
freebsd: add freebsd support to library-bundler

- use gsed/gcp (from coreutils) like macos
- use ldd/patchelf like linux
- use linux library filtering like linux for now (may be improved)

3 years agoradiant/about: set focus on OK button
Thomas Debesse [Sat, 6 Mar 2021 07:55:41 +0000 (08:55 +0100)]
radiant/about: set focus on OK button

3 years agobuild/about: reword a bit the about message
Thomas Debesse [Sat, 6 Mar 2021 07:42:07 +0000 (08:42 +0100)]
build/about: reword a bit the about message

also add more links, including one to Xonotic

3 years agoradiant/about: do not use full height empty lines between paragraphs
Thomas Debesse [Sat, 6 Mar 2021 07:37:12 +0000 (08:37 +0100)]
radiant/about: do not use full height empty lines between paragraphs

3 years agomacos: also call to hide the gl widget (even if that does not work, at least we ask to)
Thomas Debesse [Sat, 6 Mar 2021 06:38:02 +0000 (07:38 +0100)]
macos: also call to hide the gl widget (even if that does not work, at least we ask to)

3 years agoradiant/texwindow: fix crash when assigning a tag, fix #146 174/head
Thomas Debesse [Fri, 5 Mar 2021 05:16:15 +0000 (06:16 +0100)]
radiant/texwindow: fix crash when assigning a tag, fix #146

Fix crash when assigning a tag, fix #146

Seems to be a bug introduced by @TimePath
in 0203ac024e9396ebc180d9721da40b90b7c33dc6 (Wrap more GTK)

It was probably a typo, this is the change for which a revert fixes the bug:

-gboolean TextureBrowser_tagMoveHelper( ui::TreeModel model, ui::TreePath path, GtkTreeIter* iter, GSList** selected ){
+gboolean TextureBrowser_tagMoveHelper( ui::TreeModel model, ui::TreePath path, GtkTreeIter iter, GSList** selected ){

The commit just re-add the pointer mark.

3 years agoq3map2: implement symlink resolution 173/head
Thomas Debesse [Thu, 25 Feb 2021 01:12:23 +0000 (02:12 +0100)]
q3map2: implement symlink resolution

Ported from Dæmon engine implementation by slipher
which was a complete rewrite of one I did on Dæmon
by taking inspiration from Darkplaces engine.

- https://github.com/DaemonEngine/Daemon/blob/master/src/common/FileSystem.cpp
- https://gitlab.com/xonotic/darkplaces/-/blob/div0-stable/fs.c

3 years agonetradiant: implement symlink resolution
Thomas Debesse [Wed, 24 Feb 2021 21:57:06 +0000 (22:57 +0100)]
netradiant: implement symlink resolution

Ported from Dæmon engine implementation by slipher
which was a complete rewrite of one I did on Dæmon
by taking inspiration from Darkplaces engine.

- https://github.com/DaemonEngine/Daemon/blob/master/src/common/FileSystem.cpp
- https://gitlab.com/xonotic/darkplaces/-/blob/div0-stable/fs.c

3 years agoq3map2: better use strncpy instead of strcpy
Thomas Debesse [Thu, 25 Feb 2021 14:30:55 +0000 (15:30 +0100)]
q3map2: better use strncpy instead of strcpy

3 years agoq3map2: fix a leak (an allocated string not being freed before returning)
Thomas Debesse [Thu, 25 Feb 2021 01:28:16 +0000 (02:28 +0100)]
q3map2: fix a leak (an allocated string not being freed before returning)

3 years agonetradiant: some bikeshedding (whitespace, wording)
Thomas Debesse [Wed, 24 Feb 2021 21:57:22 +0000 (22:57 +0100)]
netradiant: some bikeshedding (whitespace, wording)

3 years agoq3map2: dds/ prefix, print log at the right time, when image is found
Thomas Debesse [Thu, 25 Feb 2021 01:15:36 +0000 (02:15 +0100)]
q3map2: dds/ prefix, print log at the right time, when image is found

3 years agonetradiant: dds/ prefix, use makeQuoted() in log printing
Thomas Debesse [Thu, 25 Feb 2021 13:58:22 +0000 (14:58 +0100)]
netradiant: dds/ prefix, use makeQuoted() in log printing

3 years agopreferences: onlrework the path page
Thomas Debesse [Fri, 5 Mar 2021 02:13:21 +0000 (03:13 +0100)]
preferences: onlrework the path page

- only ask for the basic options (engine path) on first startup
- mark other options as advanced and add some notes to discourage
  people not knowing what pakpath is to use it by mistake.
- just name Pak Path as Pak Path, no need to display the number,
  also makes code simpler.

3 years agoradiant/build menu: reword Commandline as Command line
Thomas Debesse [Tue, 2 Mar 2021 19:45:17 +0000 (20:45 +0100)]
radiant/build menu: reword Commandline as Command line

3 years agoq3map2: accept -bsp stage option name without complaining
Thomas Debesse [Fri, 26 Feb 2021 23:11:42 +0000 (00:11 +0100)]
q3map2: accept -bsp stage option name without complaining

- using it is far more consistent with other stages,
- makes reading options less prone to errors:
  reading “q3map3 -meta” may induce to human
  reader that meta is a stage while in fact
  it's “q3map2 -bsp -meta” and meta is an
  option for the bsp stage,
- it is not bad to use the explicit -bsp stage option,
- there is no reason to recommend to not use it.

3 years agomacos: delete now useless gitignore file in setup/
Thomas Debesse [Fri, 26 Feb 2021 22:16:25 +0000 (23:16 +0100)]
macos: delete now useless gitignore file in setup/

3 years agomacos: set NSHighResolutionCapable to true
Thomas Debesse [Fri, 26 Feb 2021 22:15:34 +0000 (23:15 +0100)]
macos: set NSHighResolutionCapable to true

3 years agodaemonmap: sync submodule
Thomas Debesse [Mon, 22 Feb 2021 21:09:17 +0000 (22:09 +0100)]
daemonmap: sync submodule

3 years agocmake: fix whitespace
Thomas Debesse [Mon, 22 Feb 2021 19:02:00 +0000 (20:02 +0100)]
cmake: fix whitespace

3 years agomacos: ignore warnings about OpenGL being deprecated
Thomas Debesse [Mon, 22 Feb 2021 18:49:53 +0000 (19:49 +0100)]
macos: ignore warnings about OpenGL being deprecated

hide those warnings on maCOS:

warning: 'glBegin' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)

3 years agomacos: rework the plist and rename apple to macos in repository
Thomas Debesse [Mon, 22 Feb 2021 18:17:00 +0000 (19:17 +0100)]
macos: rework the plist and rename apple to macos in repository

3 years agolibrary-bundler: don't use -a, it may fail on network shares
Thomas Debesse [Mon, 22 Feb 2021 18:22:18 +0000 (19:22 +0100)]
library-bundler: don't use -a, it may fail on network shares

also there is no need to preserve owner

3 years agoquake3: delete dead strupr
Thomas Debesse [Sat, 20 Feb 2021 20:38:50 +0000 (21:38 +0100)]
quake3: delete dead strupr

3 years agoquake2,heretic2: attempt to fix undeclared strupr, <3 Kai
Thomas Debesse [Sat, 20 Feb 2021 20:09:08 +0000 (21:09 +0100)]
quake2,heretic2: attempt to fix undeclared strupr, <3 Kai

Attempt to fix this:

netradiant/tools/heretic2/h2data/tmix.c:292:5: error: implicit declaration of function 'strupr' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
                                strupr( buffer );
                                ^

3 years agolibrary-bundler: rely on gcp instead of cp on macos
Thomas Debesse [Sat, 20 Feb 2021 13:23:41 +0000 (14:23 +0100)]
library-bundler: rely on gcp instead of cp on macos

3 years agolibrary-bundler: fix path
Thomas Debesse [Sat, 20 Feb 2021 13:20:28 +0000 (14:20 +0100)]
library-bundler: fix path

path starting with // does not work on msys2
this was introduced by mistake anyway

3 years agowindows: reword a bit the gtkglext workaround
Thomas Debesse [Sat, 20 Feb 2021 00:43:25 +0000 (01:43 +0100)]
windows: reword a bit the gtkglext workaround

3 years agomacos: set NSHighResolutionCapable to file in plist to attempt to avoid to render...
Thomas Debesse [Sat, 20 Feb 2021 19:38:10 +0000 (20:38 +0100)]
macos: set NSHighResolutionCapable to file in plist to attempt to avoid to render only the square of the GL viewport

3 years agomacos: also read arguments
Thomas Debesse [Sat, 20 Feb 2021 16:41:58 +0000 (17:41 +0100)]
macos: also read arguments

3 years agomacos: don't run in background
Thomas Debesse [Sat, 20 Feb 2021 10:36:26 +0000 (11:36 +0100)]
macos: don't run in background

3 years agomacos: remove undefined value in plist
Thomas Debesse [Sat, 20 Feb 2021 01:02:28 +0000 (02:02 +0100)]
macos: remove undefined value in plist

3 years agomacos: introduce ugly packing hack to attempt to reduce the size of the residual...
Thomas Debesse [Fri, 19 Feb 2021 20:17:08 +0000 (21:17 +0100)]
macos: introduce ugly packing hack to attempt to reduce the size of the residual GL viewport when another tab is expected to be above

HACK: The OpenGL viewport is reduced to one line on the bottom of the window when other tabs are displayed,
so the rectangle is not drawn over the window but a non-bostructing bottom line instead.

3 years agomacos: support for macOS-like GTK theme with light and dark variant selection
Thomas Debesse [Fri, 19 Feb 2021 10:28:12 +0000 (11:28 +0100)]
macos: support for macOS-like GTK theme with light and dark variant selection

3 years agoeasy-builder: get number of cpus on macOS a better way
Thomas Debesse [Fri, 19 Feb 2021 10:26:31 +0000 (11:26 +0100)]
easy-builder: get number of cpus on macOS a better way

3 years agoq3map2: also look for .dds file in dds/ prefix like Doom3 or Darkplaces 172/head
Thomas Debesse [Thu, 18 Feb 2021 19:46:01 +0000 (20:46 +0100)]
q3map2: also look for .dds file in dds/ prefix like Doom3 or Darkplaces

also tell user which image file is found for the given texture path

3 years agonetradiant: also look for .dds file in dds/ prefix like Doom3 or DarkPlaces
Thomas Debesse [Thu, 18 Feb 2021 19:08:11 +0000 (20:08 +0100)]
netradiant: also look for .dds file in dds/ prefix like Doom3 or DarkPlaces

also tell user which image file is found for the given texture path

3 years agoabout: minor spacing fixes
Thomas Debesse [Sat, 20 Feb 2021 12:15:30 +0000 (13:15 +0100)]
about: minor spacing fixes

3 years agoMake About window message more explicit about maintainer and latest build 171/head
Thomas Debesse [Thu, 18 Feb 2021 09:41:18 +0000 (10:41 +0100)]
Make About window message more explicit about maintainer and latest build

3 years agoMerge branch 'max' into 'master'
Thomas Debesse [Mon, 15 Feb 2021 09:50:45 +0000 (09:50 +0000)]
Merge branch 'max' into 'master'

bump MAX_IMAGES, MAX_MODELS

See merge request xonotic/netradiant!170

3 years agobump MAX_IMAGES, MAX_MODELS 170/head
Garux [Tue, 9 Feb 2021 21:20:32 +0000 (00:20 +0300)]
bump MAX_IMAGES, MAX_MODELS

3 years agoMerge branch 'dds' into 'master'
Thomas Debesse [Mon, 15 Feb 2021 09:18:12 +0000 (09:18 +0000)]
Merge branch 'dds' into 'master'

fix dds loading in 64 bit

See merge request xonotic/netradiant!169

3 years agofix dds loading in 64 bit 169/head
Garux [Sat, 23 Jan 2021 08:23:04 +0000 (11:23 +0300)]
fix dds loading in 64 bit

3 years agoreadme: update with macOS and bundling instructions
Thomas Debesse [Wed, 23 Dec 2020 02:17:40 +0000 (03:17 +0100)]
readme: update with macOS and bundling instructions

3 years agoplugin/vfspk3: prevent buffer overflow/stack smashing
Thomas Debesse [Wed, 23 Dec 2020 01:46:27 +0000 (02:46 +0100)]
plugin/vfspk3: prevent buffer overflow/stack smashing

This isssue:

```
netradiant/plugins/vfspk3/vfs.cpp:595:7: warning: array index 1024 is past the end of the array (which contains 1024 elements)
      [-Warray-bounds]
                                                tmppath[PATH_MAX] = '\0';
                                                ^       ~~~~~~~~
netradiant/plugins/vfspk3/vfs.cpp:587:5: note: array 'tmppath' declared here
                                char tmppath[PATH_MAX];
                                ^
netradiant/plugins/vfspk3/vfs.cpp:607:7: warning: array index 1024 is past the end of the array (which contains 1024 elements)
      [-Warray-bounds]
                                                tmppath[PATH_MAX] = '\0';
                                                ^       ~~~~~~~~
netradiant/plugins/vfspk3/vfs.cpp:587:5: note: array 'tmppath' declared here
                                char tmppath[PATH_MAX];
```

is producing this (on macOS):

```
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff58f4f2c6 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff58f4f2c6 <+10>: jae    0x7fff58f4f2d0            ; <+20>
    0x7fff58f4f2c8 <+12>: movq   %rax, %rdi
    0x7fff58f4f2cb <+15>: jmp    0x7fff58f49457            ; cerror_nocancel
    0x7fff58f4f2d0 <+20>: retq
Target 0: (netradiant) stopped.
(lldb) thread backtrace all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff58f4f2c6 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff5900abf1 libsystem_pthread.dylib`pthread_kill + 284
    frame #2: 0x00007fff58eb9745 libsystem_c.dylib`__abort + 144
    frame #3: 0x00007fff58eb9ff3 libsystem_c.dylib`__stack_chk_fail + 205
    frame #4: 0x000000010a8a7e59 libvfspk3.so`InitDirectory(char const*, Modules<_QERArchiveTable>&) + 7689
    frame #5: 0x00000001000e0a57 netradiant`QE_InitVFS() + 1351
    frame #6: 0x0000000100094673 netradiant`VFSModuleObserver::realise() + 19
    frame #7: 0x000000010009478a netradiant`HomePathsModuleObserver::realise() + 58
    frame #8: 0x000000010008906a netradiant`EnginePath_Realise() + 58
    frame #9: 0x00000001000d3f5f netradiant`Radiant::Radiant() + 351
    frame #10: 0x00000001000d15d1 netradiant`Radiant_Construct(ModuleServer&) + 353
    frame #11: 0x000000010008a84a netradiant`Radiant_Initialise() + 42
    frame #12: 0x0000000100088087 netradiant`main + 535
    frame #13: 0x00007fff58e143d5 libdyld.dylib`start + 1
  thread #2
    frame #0: 0x00007fff58f4abfe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff59007636 libsystem_pthread.dylib`_pthread_wqthread + 458
    frame #2: 0x00007fff590073fd libsystem_pthread.dylib`start_wqthread + 13
  thread #3
    frame #0: 0x00007fff58f4abfe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff59007636 libsystem_pthread.dylib`_pthread_wqthread + 458
    frame #2: 0x00007fff590073fd libsystem_pthread.dylib`start_wqthread + 13
  thread #4
    frame #0: 0x00007fff58f4abfe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #&1: 0x00007fff590076e6 libsystem_pthread.dylib`_pthread_wqthread + 634
    frame #2: 0x00007fff590073fd libsystem_pthread.dylib`start_wqthread + 13
```

3 years agoMerge branch 'illwieckz/gtkglext' into 'master'
Thomas Debesse [Tue, 22 Dec 2020 23:27:19 +0000 (23:27 +0000)]
Merge branch 'illwieckz/gtkglext' into 'master'

Make possible to build custom GtkGLExt and build macOS bundle

See merge request xonotic/netradiant!168

3 years agocmake: minor tweaks
Thomas Debesse [Tue, 22 Dec 2020 22:14:58 +0000 (23:14 +0100)]
cmake: minor tweaks

3 years agomacos: produce working NetRadiant.app
Thomas Debesse [Tue, 22 Dec 2020 22:12:02 +0000 (23:12 +0100)]
macos: produce working NetRadiant.app

3 years agomacos: rename radiant to netradiant
Thomas Debesse [Tue, 22 Dec 2020 19:27:09 +0000 (20:27 +0100)]
macos: rename radiant to netradiant

3 years agobundle: bundle macos binaries (no .app file done yet)
Thomas Debesse [Tue, 22 Dec 2020 17:37:36 +0000 (18:37 +0100)]
bundle: bundle macos binaries (no .app file done yet)

3 years agotools: update daemonmap submodule
Thomas Debesse [Mon, 21 Dec 2020 16:16:26 +0000 (17:16 +0100)]
tools: update daemonmap submodule

3 years agotools: no need for minizip/ directory, pkg-config tells it
Thomas Debesse [Mon, 21 Dec 2020 16:13:34 +0000 (17:13 +0100)]
tools: no need for minizip/ directory, pkg-config tells it

3 years agoeasy-builder: also build builtins, make macos use builtin gtkglext
Thomas Debesse [Mon, 21 Dec 2020 16:12:51 +0000 (17:12 +0100)]
easy-builder: also build builtins, make macos use builtin gtkglext

3 years agomacos: disable drawing xorrectangle (rectangle selection feedback)
Thomas Debesse [Tue, 22 Dec 2020 19:08:31 +0000 (20:08 +0100)]
macos: disable drawing xorrectangle (rectangle selection feedback)

disable drawing xorrectangle (rectangle selection feedback)
to workaround crash, selection still works

3 years agomacos: workaround faulty destructor
Thomas Debesse [Mon, 21 Dec 2020 13:34:33 +0000 (14:34 +0100)]
macos: workaround faulty destructor

3 years agogtkglext: build macos non-x11 gtkglext
Thomas Debesse [Mon, 21 Dec 2020 00:47:21 +0000 (01:47 +0100)]
gtkglext: build macos non-x11 gtkglext

3 years agogtkglext: build and bundle built-in gtkglext
Thomas Debesse [Thu, 17 Dec 2020 20:54:29 +0000 (21:54 +0100)]
gtkglext: build and bundle built-in gtkglext

There is a chicken-and-egg problem, so the build must be done in two steps,

First build built-in libraries:

cmake -G "Unix Makefiles" -S. -Bbuild -DBUILTIN_GTKGLEXT=ON -DBUNDLE_LIBRARIES=ON
cmake --build build --parallel $(nproc) -- builtins

Then detect the built-in libraries and build netradiant and install the bundle as usual:

cmake -S. -Bbuild
cmake --build build --parallel $(nproc) install

There is no need to set cmake options on second step but cmake still has to be called again to detect the new files.

3 years agobundler: detect missing libraries
Thomas Debesse [Thu, 17 Dec 2020 18:47:59 +0000 (19:47 +0100)]
bundler: detect missing libraries

3 years agogtkglext: build builtin GtkGLExt as cmake external project
Thomas Debesse [Tue, 15 Dec 2020 12:21:38 +0000 (13:21 +0100)]
gtkglext: build builtin GtkGLExt as cmake external project

Do:

cmake -G "Unix Makefiles" -S. -Bbuild -DBUILTIN_GTKGLEXT=ON
cmake --build build --parallel $(nproc)

A GtkGLExt tree knonn to build will be downloaded into:

build/gtkglext-prefix/src/gtkglext

and installed into:

build/external

NetRadiant does not build against this builtin GtkGLExt yet.

3 years agoq3map2/light_bounce: prevent infinite loop on obscure bias compute 167/head
Thomas Debesse [Wed, 1 Jul 2020 16:20:25 +0000 (18:20 +0200)]
q3map2/light_bounce: prevent infinite loop on obscure bias compute

New code produces same result without loop at all, so
it cannot fall in infinite loop, and it is faster in
use cases requiring more than one loop in previous code.

The Unvanquished vega map is known to trigger the bug:
https://github.com/UnvanquishedAssets/map-vega_src.dpkdir
I reproduced it multiple time on various hardware (8 core FX-9590,
12 core/24 thread Ryzen 9 3900X) with commit af40508 and using
final compilation profile edited to use -fastbounce instead
of -fast option.

The symptom is simple, q3map2 stucks there:

--- Radiosity (bounce 1 of 8) ---
--- RadCreateDiffuseLights ---
0...1...2...3..

Or somewhere else in that progression bar given your hardware
and the amount of core your CPU has.

When stuck, all the CPU cores are running 100% but the thread
never returns (a strace can reveals it, a gdb backtrace too).

Thanks to @slipher for the precious advices and improving my first
attempt to fix it.

For more information on the issue, I asked:

> which negative value never can become positive
> when incremented infinitely?

slipher said:

> for a double, any value less than -2^53 would have this property
> don't know for float off the top of my head

But then, it means that's theorically verified this loop was able
to run forever in some case.

I don't know what this code is doing anyway, but at least we can
keep the behaviour without requiring to understand it.

3 years agoq3map2 * fix: do not affect styled lightmaps by floodlight
Garux [Wed, 25 Mar 2020 18:21:07 +0000 (21:21 +0300)]
q3map2 * fix: do not affect styled lightmaps by floodlight
port of https://github.com/id-tech-3-tools/map-compiler/pull/12
https://github.com/id-tech-3-tools/map-compiler/commit/87b8589a3a5069c482243bb33c587fc18911746c

3 years agogamepacks: add Alien Arena (GPL)
Thomas Debesse [Sat, 23 May 2020 12:31:16 +0000 (14:31 +0200)]
gamepacks: add Alien Arena (GPL)

3 years agoMerge branch 'vfs' into 'master'
Thomas Debesse [Mon, 25 May 2020 08:54:22 +0000 (08:54 +0000)]
Merge branch 'vfs' into 'master'

Some VFS fixes: attempt to load .pak and .wad, load png fallback even if game does not support png, do not load engine path twice

Closes #141 and #139

See merge request xonotic/netradiant!166

3 years agoradiant/texwindow: use TextureBrowser_showWads when possible 166/head
Thomas Debesse [Fri, 22 May 2020 16:17:35 +0000 (18:17 +0200)]
radiant/texwindow: use TextureBrowser_showWads when possible

instead of doing alternatively:
- !string_empty( g_pGameDescription->getKeyValue( "show_wads" ) )
- TextureBrowser_showWads()

the last one calling:
- !string_empty( g_pGameDescription->getKeyValue( "show_wads" ) )

3 years agoradiant/texwindow: only show per-wad textures, update texture window title with wad...
Thomas Debesse [Fri, 22 May 2020 16:06:50 +0000 (18:06 +0200)]
radiant/texwindow: only show per-wad textures, update texture window title with wad name

3 years agoradiant/texwindow: beautify wad list
Thomas Debesse [Fri, 22 May 2020 15:04:29 +0000 (17:04 +0200)]
radiant/texwindow: beautify wad list

3 years agoradiant/texwindow: test .wad file extension case-insensitively on all systems, fix...
Thomas Debesse [Fri, 22 May 2020 12:58:11 +0000 (14:58 +0200)]
radiant/texwindow: test .wad file extension case-insensitively on all systems, fix #139

3 years agoradiant/image: load fallback images with png loader even if game does not support...
Thomas Debesse [Thu, 21 May 2020 22:43:20 +0000 (00:43 +0200)]
radiant/image: load fallback images with png loader even if game does not support png, fix #141

Current implementation has a minor issue, when "Hide Fallback" option is
disabled, the fallback image does not appear in texture browser before radiant
makes use of it (for example creating a brush before selecting a texture).

Since "Hide Fallback" option is enabled by default and it never makes sense
to apply those fallback intentionally, I don't care for the moment.

I would like to see a better implementation that would work for all
editor images (like the one set with `qer_editorImage` shader keyword).

3 years agoradiant/vfs: do not load enginepath twice
Thomas Debesse [Fri, 22 May 2020 08:34:43 +0000 (10:34 +0200)]
radiant/vfs: do not load enginepath twice

Do not load engine path twice when the home path and the engine path is the same,
This happens when a game does not have home path.

Also rework a bit that code, and prints useful information on console.

3 years agoradiant/vfs: rework vfs loading, attempt to load wads and paks, ref #139
Thomas Debesse [Thu, 21 May 2020 18:22:26 +0000 (20:22 +0200)]
radiant/vfs: rework vfs loading, attempt to load wads and paks, ref #139

Also load .pak extracted as .pakdir (can be done using unpak).
NOTE: that feature would have to be supported by map compilers to
be useful. This is still handy for testing purpose so I'm keeping it.

Also prints on console the opened pak directories.

3 years agoFixing compilation with -DBUILD_SHARED_LIBS=ON
Azamat H. Hackimov [Thu, 21 May 2020 01:08:39 +0000 (04:08 +0300)]
Fixing compilation with -DBUILD_SHARED_LIBS=ON

Libraries under libs should be forced STATIC since there circular
dependencies and implicit linking with external libraries. Otherwise
compilation will fails with underlinking errors.

3 years agodaemonmap: update submodule for fixes for compilation with '-DBUILD_SHARED_LIBS=ON'
Thomas Debesse [Thu, 21 May 2020 09:24:59 +0000 (11:24 +0200)]
daemonmap: update submodule for fixes for compilation with '-DBUILD_SHARED_LIBS=ON'

3 years agoMerge branch 'illwieckz/gcc10' into 'master'
Thomas Debesse [Sun, 17 May 2020 15:53:01 +0000 (15:53 +0000)]
Merge branch 'illwieckz/gcc10' into 'master'

Fix compilation with GCC 10, <3 @SpiKe, fix #140

Closes #140

See merge request xonotic/netradiant!163