Compare commits
No commits in common. "7390996c8f859845c98f4b4c4b8ace13438a49ca" and "3addf35a2c421bd99d5f081bb940253a8fdc68cc" have entirely different histories.
7390996c8f
...
3addf35a2c
2
.gitignore
vendored
2
.gitignore
vendored
@ -51,5 +51,3 @@ _deps
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
*.tar
|
||||
|
@ -100,7 +100,7 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links.
|
||||
<details>
|
||||
<summary><b>Linux (Ubuntu)</b></summary>
|
||||
|
||||
* Make sure you're using CMake 3.23 or newer - you may need to [add Kitware's APT repo](https://apt.kitware.com/) to install a newer version.
|
||||
* Make sure you're using CMake 3.19 or newer - you may need to [add Kitware's APT repo](https://apt.kitware.com/) to install a newer version.
|
||||
* Install dependencies:
|
||||
* `sudo apt-get install pkg-config libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libsdl2-dev python3-jinja2 ninja-build`
|
||||
* Clone [vcpkg](https://github.com/microsoft/vcpkg?tab=readme-ov-file#quick-start-unix) (outside the repo!) and bootstrap it with the linked instructions.
|
||||
@ -118,7 +118,7 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links.
|
||||
|
||||
Starbound in general is built from the ground up, with its own engine written in C++ on top of some basic libraries.
|
||||
|
||||
* CMake is a C++ build scenario generator and your first target. You need at least version 3.23. Where Ubuntu uses APT, Fedora uses DNF as package manager.
|
||||
* CMake is a C++ build scenario generator and your first target. You need at least version 3.19. Where Ubuntu uses APT, Fedora uses DNF as package manager.
|
||||
|
||||
1. `sudo dnf upgrade --refresh` to ensure your OS is up-to-date
|
||||
2. `sudo dnf install cmake`
|
||||
|
@ -1,13 +1,11 @@
|
||||
function patch(original)
|
||||
local image = original:process("?crop=0;0;1;1?scalenearest=236;166")
|
||||
image:copyInto({0, 28}, original)
|
||||
image:copyInto({0, 0}, original:process("?crop=0;0;236;96"))
|
||||
function patch(image)
|
||||
-- Camera Pan Speed
|
||||
image:copyInto({119, 68}, image:process("?crop=19;68;117;87"))
|
||||
local checkbox = image:process("?crop=19;26;117;35")
|
||||
image:copyInto({119, 26}, checkbox) -- Anti-Aliasing
|
||||
image:copyInto({19, 15}, checkbox) -- Object Lighting
|
||||
image:copyInto({119, 15}, checkbox) -- Hardware Cursor
|
||||
|
||||
image:copyInto({119, 68}, image:process("?crop=19;68;117;87")) -- Camera Pan Speed
|
||||
|
||||
return image
|
||||
-- Anti-Aliasing
|
||||
image:copyInto({119, 26}, checkbox)
|
||||
-- Object Lighting
|
||||
image:copyInto({19, 15}, checkbox)
|
||||
-- Hardware Cursor
|
||||
image:copyInto({119, 15}, checkbox)
|
||||
end
|
Binary file not shown.
Before Width: | Height: | Size: 740 B |
@ -1,8 +1,5 @@
|
||||
{
|
||||
"paneLayout" : {
|
||||
"panefeature" : {
|
||||
"anchor" : "center"
|
||||
},
|
||||
"voiceLabel" : {
|
||||
"type" : "label",
|
||||
"position" : [119, 202],
|
||||
|
@ -17,21 +17,14 @@ end
|
||||
function patch(config)
|
||||
local layout = config.paneLayout
|
||||
layout.panefeature.positionLocked = false
|
||||
layout.panefeature.anchor = "center"
|
||||
for i = 1, 32 do config.zoomList[i] = i end
|
||||
-- Create the camera pan speed widgets
|
||||
shift(clone(layout, "zoomLabel", "cameraSpeedLabel"), 100).value = "CAMERA PAN SPEED"
|
||||
shift(clone(layout, "zoomSlider", "cameraSpeedSlider"), 100)
|
||||
shift(clone(layout, "zoomValueLabel", "cameraSpeedValueLabel"), 100)
|
||||
-- Populate camera speed list
|
||||
config.cameraSpeedList = jarray()
|
||||
for i = 1, 50 do config.cameraSpeedList[i] = i / 10 end
|
||||
|
||||
-- Create the interface scale widgets
|
||||
shift(clone(layout, "zoomLabel", "interfaceScaleLabel"), 0, 28).value = "INTERFACE SCALE"
|
||||
shift(clone(layout, "zoomSlider", "interfaceScaleSlider"), 0, 28)
|
||||
shift(clone(layout, "zoomValueLabel", "interfaceScaleValueLabel"), 0, 28)
|
||||
config.interfaceScaleList = {0, 1, 2, 3, 4, 5, 6} -- 0 = AUTO!
|
||||
|
||||
for i = 1, 32 do config.zoomList[i] = i end
|
||||
-- Create anti-aliasing toggle
|
||||
shift(clone(layout, "multiTextureLabel", "antiAliasingLabel"), 98).value = "SUPER-SAMPLED AA"
|
||||
shift(clone(layout, "multiTextureCheckbox", "antiAliasingCheckbox"), 99)
|
||||
@ -41,10 +34,5 @@ function patch(config)
|
||||
-- Create hardware cursor toggle
|
||||
shift(clone(layout, "multiTextureLabel", "hardwareCursorLabel"), 98, -11).value = "HARDWARE CURSOR"
|
||||
shift(clone(layout, "multiTextureCheckbox", "hardwareCursorCheckbox"), 99, -11)
|
||||
|
||||
shift(layout.title, 0, 28)
|
||||
shift(layout.resLabel, 0, 28)
|
||||
shift(layout.resSlider, 0, 28)
|
||||
shift(layout.resValueLabel, 0, 28)
|
||||
return config
|
||||
end
|
349
lib/linux/include/jemalloc/jemalloc.h
vendored
349
lib/linux/include/jemalloc/jemalloc.h
vendored
@ -1,6 +1,5 @@
|
||||
#ifndef JEMALLOC_H_
|
||||
#define JEMALLOC_H_
|
||||
#pragma GCC system_header
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -11,31 +10,18 @@ extern "C" {
|
||||
/* Defined if alloc_size attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE
|
||||
|
||||
/* Defined if format_arg(...) attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_FORMAT_ARG
|
||||
|
||||
/* Defined if format(gnu_printf, ...) attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
|
||||
|
||||
/* Defined if format(printf, ...) attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF
|
||||
|
||||
/* Defined if fallthrough attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_FALLTHROUGH
|
||||
|
||||
/* Defined if cold attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_COLD
|
||||
|
||||
/* Defined if deprecated attribute is supported. */
|
||||
#define JEMALLOC_HAVE_ATTR_DEPRECATED
|
||||
|
||||
/*
|
||||
* Define overrides for non-standard allocator-related functions if they are
|
||||
* present on the system.
|
||||
*/
|
||||
#define JEMALLOC_OVERRIDE_MEMALIGN
|
||||
#define JEMALLOC_OVERRIDE_VALLOC
|
||||
#define JEMALLOC_OVERRIDE_PVALLOC
|
||||
|
||||
/*
|
||||
* At least Linux omits the "const" in:
|
||||
@ -70,33 +56,28 @@ extern "C" {
|
||||
* these macro definitions.
|
||||
*/
|
||||
#ifndef JEMALLOC_NO_RENAME
|
||||
# define je_aligned_alloc je_aligned_alloc
|
||||
# define je_calloc je_calloc
|
||||
# define je_dallocx je_dallocx
|
||||
# define je_free je_free
|
||||
# define je_free_sized je_free_sized
|
||||
# define je_free_aligned_sized je_free_aligned_sized
|
||||
# define je_mallctl je_mallctl
|
||||
# define je_mallctlbymib je_mallctlbymib
|
||||
# define je_mallctlnametomib je_mallctlnametomib
|
||||
# define je_malloc je_malloc
|
||||
# define je_malloc_conf je_malloc_conf
|
||||
# define je_malloc_conf_2_conf_harder je_malloc_conf_2_conf_harder
|
||||
# define je_malloc_message je_malloc_message
|
||||
# define je_malloc je_malloc
|
||||
# define je_calloc je_calloc
|
||||
# define je_posix_memalign je_posix_memalign
|
||||
# define je_aligned_alloc je_aligned_alloc
|
||||
# define je_realloc je_realloc
|
||||
# define je_free je_free
|
||||
# define je_mallocx je_mallocx
|
||||
# define je_rallocx je_rallocx
|
||||
# define je_xallocx je_xallocx
|
||||
# define je_sallocx je_sallocx
|
||||
# define je_dallocx je_dallocx
|
||||
# define je_sdallocx je_sdallocx
|
||||
# define je_nallocx je_nallocx
|
||||
# define je_mallctl je_mallctl
|
||||
# define je_mallctlnametomib je_mallctlnametomib
|
||||
# define je_mallctlbymib je_mallctlbymib
|
||||
# define je_malloc_stats_print je_malloc_stats_print
|
||||
# define je_malloc_usable_size je_malloc_usable_size
|
||||
# define je_mallocx je_mallocx
|
||||
# define je_smallocx_f9c0b5f7f8a917661db39289e38ec94d9d198f11 je_smallocx_f9c0b5f7f8a917661db39289e38ec94d9d198f11
|
||||
# define je_nallocx je_nallocx
|
||||
# define je_posix_memalign je_posix_memalign
|
||||
# define je_rallocx je_rallocx
|
||||
# define je_realloc je_realloc
|
||||
# define je_sallocx je_sallocx
|
||||
# define je_sdallocx je_sdallocx
|
||||
# define je_xallocx je_xallocx
|
||||
# define je_memalign je_memalign
|
||||
# define je_valloc je_valloc
|
||||
# define je_pvalloc je_pvalloc
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -105,52 +86,32 @@ extern "C" {
|
||||
#include <limits.h>
|
||||
#include <strings.h>
|
||||
|
||||
#define JEMALLOC_VERSION "5.3.0-182-gf9c0b5f7f8a917661db39289e38ec94d9d198f11"
|
||||
#define JEMALLOC_VERSION_MAJOR 5
|
||||
#define JEMALLOC_VERSION_MINOR 3
|
||||
#define JEMALLOC_VERSION_BUGFIX 0
|
||||
#define JEMALLOC_VERSION_NREV 182
|
||||
#define JEMALLOC_VERSION_GID "f9c0b5f7f8a917661db39289e38ec94d9d198f11"
|
||||
#define JEMALLOC_VERSION_GID_IDENT f9c0b5f7f8a917661db39289e38ec94d9d198f11
|
||||
#define JEMALLOC_VERSION "4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8"
|
||||
#define JEMALLOC_VERSION_MAJOR 4
|
||||
#define JEMALLOC_VERSION_MINOR 2
|
||||
#define JEMALLOC_VERSION_BUGFIX 1
|
||||
#define JEMALLOC_VERSION_NREV 0
|
||||
#define JEMALLOC_VERSION_GID "3de035335255d553bdb344c32ffdb603816195d8"
|
||||
|
||||
#define MALLOCX_LG_ALIGN(la) ((int)(la))
|
||||
#if LG_SIZEOF_PTR == 2
|
||||
# define MALLOCX_LG_ALIGN(la) ((int)(la))
|
||||
# if LG_SIZEOF_PTR == 2
|
||||
# define MALLOCX_ALIGN(a) ((int)(ffs((int)(a))-1))
|
||||
#else
|
||||
# else
|
||||
# define MALLOCX_ALIGN(a) \
|
||||
((int)(((size_t)(a) < (size_t)INT_MAX) ? ffs((int)(a))-1 : \
|
||||
ffs((int)(((size_t)(a))>>32))+31))
|
||||
#endif
|
||||
#define MALLOCX_ZERO ((int)0x40)
|
||||
# endif
|
||||
# define MALLOCX_ZERO ((int)0x40)
|
||||
/*
|
||||
* Bias tcache index bits so that 0 encodes "automatic tcache management", and 1
|
||||
* encodes MALLOCX_TCACHE_NONE.
|
||||
*/
|
||||
#define MALLOCX_TCACHE(tc) ((int)(((tc)+2) << 8))
|
||||
#define MALLOCX_TCACHE_NONE MALLOCX_TCACHE(-1)
|
||||
# define MALLOCX_TCACHE(tc) ((int)(((tc)+2) << 8))
|
||||
# define MALLOCX_TCACHE_NONE MALLOCX_TCACHE(-1)
|
||||
/*
|
||||
* Bias arena index bits so that 0 encodes "use an automatically chosen arena".
|
||||
*/
|
||||
#define MALLOCX_ARENA(a) ((((int)(a))+1) << 20)
|
||||
|
||||
/*
|
||||
* Use as arena index in "arena.<i>.{purge,decay,dss}" and
|
||||
* "stats.arenas.<i>.*" mallctl interfaces to select all arenas. This
|
||||
* definition is intentionally specified in raw decimal format to support
|
||||
* cpp-based string concatenation, e.g.
|
||||
*
|
||||
* #define STRINGIFY_HELPER(x) #x
|
||||
* #define STRINGIFY(x) STRINGIFY_HELPER(x)
|
||||
*
|
||||
* mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".purge", NULL, NULL, NULL,
|
||||
* 0);
|
||||
*/
|
||||
#define MALLCTL_ARENAS_ALL 4096
|
||||
/*
|
||||
* Use as arena index in "stats.arenas.<i>.*" mallctl interfaces to select
|
||||
* destroyed arenas.
|
||||
*/
|
||||
#define MALLCTL_ARENAS_DESTROYED 4097
|
||||
# define MALLOCX_ARENA(a) ((((int)(a))+1) << 20)
|
||||
|
||||
#if defined(__cplusplus) && defined(JEMALLOC_USE_CXX_THROW)
|
||||
# define JEMALLOC_CXX_THROW throw()
|
||||
@ -158,7 +119,7 @@ extern "C" {
|
||||
# define JEMALLOC_CXX_THROW
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER
|
||||
# define JEMALLOC_ATTR(s)
|
||||
# define JEMALLOC_ALIGNED(s) __declspec(align(s))
|
||||
# define JEMALLOC_ALLOC_SIZE(s)
|
||||
@ -170,9 +131,7 @@ extern "C" {
|
||||
# define JEMALLOC_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# define JEMALLOC_FORMAT_ARG(i)
|
||||
# define JEMALLOC_FORMAT_PRINTF(s, i)
|
||||
# define JEMALLOC_FALLTHROUGH
|
||||
# define JEMALLOC_NOINLINE __declspec(noinline)
|
||||
# ifdef __cplusplus
|
||||
# define JEMALLOC_NOTHROW __declspec(nothrow)
|
||||
@ -186,8 +145,6 @@ extern "C" {
|
||||
# else
|
||||
# define JEMALLOC_ALLOCATOR
|
||||
# endif
|
||||
# define JEMALLOC_COLD
|
||||
# define JEMALLOC_WARN_ON_USAGE(warning_message)
|
||||
#elif defined(JEMALLOC_HAVE_ATTR)
|
||||
# define JEMALLOC_ATTR(s) __attribute__((s))
|
||||
# define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
|
||||
@ -201,11 +158,6 @@ extern "C" {
|
||||
# ifndef JEMALLOC_EXPORT
|
||||
# define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
|
||||
# endif
|
||||
# ifdef JEMALLOC_HAVE_ATTR_FORMAT_ARG
|
||||
# define JEMALLOC_FORMAT_ARG(i) JEMALLOC_ATTR(__format_arg__(3))
|
||||
# else
|
||||
# define JEMALLOC_FORMAT_ARG(i)
|
||||
# endif
|
||||
# ifdef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
|
||||
# define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(gnu_printf, s, i))
|
||||
# elif defined(JEMALLOC_HAVE_ATTR_FORMAT_PRINTF)
|
||||
@ -213,26 +165,11 @@ extern "C" {
|
||||
# else
|
||||
# define JEMALLOC_FORMAT_PRINTF(s, i)
|
||||
# endif
|
||||
# ifdef JEMALLOC_HAVE_ATTR_FALLTHROUGH
|
||||
# define JEMALLOC_FALLTHROUGH JEMALLOC_ATTR(fallthrough)
|
||||
# else
|
||||
# define JEMALLOC_FALLTHROUGH
|
||||
# endif
|
||||
# define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
|
||||
# define JEMALLOC_NOTHROW JEMALLOC_ATTR(nothrow)
|
||||
# define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
|
||||
# define JEMALLOC_RESTRICT_RETURN
|
||||
# define JEMALLOC_ALLOCATOR
|
||||
# ifdef JEMALLOC_HAVE_ATTR_COLD
|
||||
# define JEMALLOC_COLD JEMALLOC_ATTR(__cold__)
|
||||
# else
|
||||
# define JEMALLOC_COLD
|
||||
# endif
|
||||
# ifdef JEMALLOC_HAVE_ATTR_DEPRECATED
|
||||
# define JEMALLOC_WARN_ON_USAGE(warning_message) JEMALLOC_ATTR(deprecated(warning_message))
|
||||
# else
|
||||
# define JEMALLOC_WARN_ON_USAGE(warning_message)
|
||||
# endif
|
||||
#else
|
||||
# define JEMALLOC_ATTR(s)
|
||||
# define JEMALLOC_ALIGNED(s)
|
||||
@ -240,20 +177,11 @@ extern "C" {
|
||||
# define JEMALLOC_ALLOC_SIZE2(s1, s2)
|
||||
# define JEMALLOC_EXPORT
|
||||
# define JEMALLOC_FORMAT_PRINTF(s, i)
|
||||
# define JEMALLOC_FALLTHROUGH
|
||||
# define JEMALLOC_NOINLINE
|
||||
# define JEMALLOC_NOTHROW
|
||||
# define JEMALLOC_SECTION(s)
|
||||
# define JEMALLOC_RESTRICT_RETURN
|
||||
# define JEMALLOC_ALLOCATOR
|
||||
# define JEMALLOC_COLD
|
||||
# define JEMALLOC_WARN_ON_USAGE(warning_message)
|
||||
#endif
|
||||
|
||||
#if (defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__linux__) && !defined(__GLIBC__))) && !defined(JEMALLOC_NO_RENAME)
|
||||
# define JEMALLOC_SYS_NOTHROW
|
||||
#else
|
||||
# define JEMALLOC_SYS_NOTHROW JEMALLOC_NOTHROW
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -262,31 +190,26 @@ extern "C" {
|
||||
* JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h).
|
||||
*/
|
||||
extern JEMALLOC_EXPORT const char *je_malloc_conf;
|
||||
extern JEMALLOC_EXPORT const char *je_malloc_conf_2_conf_harder;
|
||||
extern JEMALLOC_EXPORT void (*je_malloc_message)(void *cbopaque,
|
||||
const char *s);
|
||||
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_malloc(size_t size)
|
||||
void JEMALLOC_NOTHROW *je_malloc(size_t size)
|
||||
JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1);
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_calloc(size_t num, size_t size)
|
||||
void JEMALLOC_NOTHROW *je_calloc(size_t num, size_t size)
|
||||
JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE2(1, 2);
|
||||
JEMALLOC_EXPORT int JEMALLOC_SYS_NOTHROW je_posix_memalign(
|
||||
void **memptr, size_t alignment, size_t size) JEMALLOC_CXX_THROW
|
||||
JEMALLOC_ATTR(nonnull(1));
|
||||
JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_posix_memalign(void **memptr,
|
||||
size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(nonnull(1));
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_aligned_alloc(size_t alignment,
|
||||
void JEMALLOC_NOTHROW *je_aligned_alloc(size_t alignment,
|
||||
size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc)
|
||||
JEMALLOC_ALLOC_SIZE(2);
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_realloc(void *ptr, size_t size)
|
||||
void JEMALLOC_NOTHROW *je_realloc(void *ptr, size_t size)
|
||||
JEMALLOC_CXX_THROW JEMALLOC_ALLOC_SIZE(2);
|
||||
JEMALLOC_EXPORT void JEMALLOC_SYS_NOTHROW je_free(void *ptr)
|
||||
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free(void *ptr)
|
||||
JEMALLOC_CXX_THROW;
|
||||
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free_sized(void *ptr, size_t size);
|
||||
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free_aligned_sized(
|
||||
void *ptr, size_t alignment, size_t size);
|
||||
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_NOTHROW *je_mallocx(size_t size, int flags)
|
||||
@ -315,106 +238,76 @@ JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_malloc_stats_print(
|
||||
const char *opts);
|
||||
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size(
|
||||
JEMALLOC_USABLE_SIZE_CONST void *ptr) JEMALLOC_CXX_THROW;
|
||||
#ifdef JEMALLOC_HAVE_MALLOC_SIZE
|
||||
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_size(
|
||||
const void *ptr);
|
||||
#endif
|
||||
|
||||
#ifdef JEMALLOC_OVERRIDE_MEMALIGN
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_memalign(size_t alignment, size_t size)
|
||||
void JEMALLOC_NOTHROW *je_memalign(size_t alignment, size_t size)
|
||||
JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc);
|
||||
#endif
|
||||
|
||||
#ifdef JEMALLOC_OVERRIDE_VALLOC
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_valloc(size_t size) JEMALLOC_CXX_THROW
|
||||
void JEMALLOC_NOTHROW *je_valloc(size_t size) JEMALLOC_CXX_THROW
|
||||
JEMALLOC_ATTR(malloc);
|
||||
#endif
|
||||
|
||||
#ifdef JEMALLOC_OVERRIDE_PVALLOC
|
||||
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN
|
||||
void JEMALLOC_SYS_NOTHROW *je_pvalloc(size_t size) JEMALLOC_CXX_THROW
|
||||
JEMALLOC_ATTR(malloc);
|
||||
#endif
|
||||
|
||||
typedef struct extent_hooks_s extent_hooks_t;
|
||||
|
||||
/*
|
||||
* void *
|
||||
* extent_alloc(extent_hooks_t *extent_hooks, void *new_addr, size_t size,
|
||||
* size_t alignment, bool *zero, bool *commit, unsigned arena_ind);
|
||||
* chunk_alloc(void *new_addr, size_t size, size_t alignment, bool *zero,
|
||||
* bool *commit, unsigned arena_ind);
|
||||
*/
|
||||
typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *,
|
||||
bool *, unsigned);
|
||||
typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_dalloc(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* chunk_dalloc(void *chunk, size_t size, bool committed, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* chunk_commit(void *chunk, size_t size, size_t offset, size_t length,
|
||||
* unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* chunk_decommit(void *chunk, size_t size, size_t offset, size_t length,
|
||||
* unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* chunk_purge(void *chunk, size_t size, size_t offset, size_t length,
|
||||
* unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* chunk_split(void *chunk, size_t size, size_t size_a, size_t size_b,
|
||||
* bool committed, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool,
|
||||
unsigned);
|
||||
typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned);
|
||||
|
||||
/*
|
||||
* void
|
||||
* extent_destroy(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* bool
|
||||
* chunk_merge(void *chunk_a, size_t size_a, void *chunk_b, size_t size_b,
|
||||
* bool committed, unsigned arena_ind);
|
||||
*/
|
||||
typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool,
|
||||
unsigned);
|
||||
typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_commit(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* size_t offset, size_t length, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
|
||||
unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_decommit(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* size_t offset, size_t length, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t,
|
||||
size_t, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_purge(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* size_t offset, size_t length, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
|
||||
unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_split(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
* size_t size_a, size_t size_b, bool committed, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t,
|
||||
bool, unsigned);
|
||||
|
||||
/*
|
||||
* bool
|
||||
* extent_merge(extent_hooks_t *extent_hooks, void *addr_a, size_t size_a,
|
||||
* void *addr_b, size_t size_b, bool committed, unsigned arena_ind);
|
||||
*/
|
||||
typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t,
|
||||
bool, unsigned);
|
||||
|
||||
struct extent_hooks_s {
|
||||
extent_alloc_t *alloc;
|
||||
extent_dalloc_t *dalloc;
|
||||
extent_destroy_t *destroy;
|
||||
extent_commit_t *commit;
|
||||
extent_decommit_t *decommit;
|
||||
extent_purge_t *purge_lazy;
|
||||
extent_purge_t *purge_forced;
|
||||
extent_split_t *split;
|
||||
extent_merge_t *merge;
|
||||
};
|
||||
typedef struct {
|
||||
chunk_alloc_t *alloc;
|
||||
chunk_dalloc_t *dalloc;
|
||||
chunk_commit_t *commit;
|
||||
chunk_decommit_t *decommit;
|
||||
chunk_purge_t *purge;
|
||||
chunk_split_t *split;
|
||||
chunk_merge_t *merge;
|
||||
} chunk_hooks_t;
|
||||
|
||||
/*
|
||||
* By default application code must explicitly refer to mangled symbol names,
|
||||
@ -427,33 +320,28 @@ struct extent_hooks_s {
|
||||
# ifndef JEMALLOC_NO_DEMANGLE
|
||||
# define JEMALLOC_NO_DEMANGLE
|
||||
# endif
|
||||
# define aligned_alloc je_aligned_alloc
|
||||
# define calloc je_calloc
|
||||
# define dallocx je_dallocx
|
||||
# define free je_free
|
||||
# define free_sized je_free_sized
|
||||
# define free_aligned_sized je_free_aligned_sized
|
||||
# define mallctl je_mallctl
|
||||
# define mallctlbymib je_mallctlbymib
|
||||
# define mallctlnametomib je_mallctlnametomib
|
||||
# define malloc je_malloc
|
||||
# define malloc_conf je_malloc_conf
|
||||
# define malloc_conf_2_conf_harder je_malloc_conf_2_conf_harder
|
||||
# define malloc_message je_malloc_message
|
||||
# define malloc je_malloc
|
||||
# define calloc je_calloc
|
||||
# define posix_memalign je_posix_memalign
|
||||
# define aligned_alloc je_aligned_alloc
|
||||
# define realloc je_realloc
|
||||
# define free je_free
|
||||
# define mallocx je_mallocx
|
||||
# define rallocx je_rallocx
|
||||
# define xallocx je_xallocx
|
||||
# define sallocx je_sallocx
|
||||
# define dallocx je_dallocx
|
||||
# define sdallocx je_sdallocx
|
||||
# define nallocx je_nallocx
|
||||
# define mallctl je_mallctl
|
||||
# define mallctlnametomib je_mallctlnametomib
|
||||
# define mallctlbymib je_mallctlbymib
|
||||
# define malloc_stats_print je_malloc_stats_print
|
||||
# define malloc_usable_size je_malloc_usable_size
|
||||
# define mallocx je_mallocx
|
||||
# define smallocx_f9c0b5f7f8a917661db39289e38ec94d9d198f11 je_smallocx_f9c0b5f7f8a917661db39289e38ec94d9d198f11
|
||||
# define nallocx je_nallocx
|
||||
# define posix_memalign je_posix_memalign
|
||||
# define rallocx je_rallocx
|
||||
# define realloc je_realloc
|
||||
# define sallocx je_sallocx
|
||||
# define sdallocx je_sdallocx
|
||||
# define xallocx je_xallocx
|
||||
# define memalign je_memalign
|
||||
# define valloc je_valloc
|
||||
# define pvalloc je_pvalloc
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -464,33 +352,28 @@ struct extent_hooks_s {
|
||||
* and/or --with-jemalloc-prefix.
|
||||
*/
|
||||
#ifndef JEMALLOC_NO_DEMANGLE
|
||||
# undef je_aligned_alloc
|
||||
# undef je_calloc
|
||||
# undef je_dallocx
|
||||
# undef je_free
|
||||
# undef je_free_sized
|
||||
# undef je_free_aligned_sized
|
||||
# undef je_mallctl
|
||||
# undef je_mallctlbymib
|
||||
# undef je_mallctlnametomib
|
||||
# undef je_malloc
|
||||
# undef je_malloc_conf
|
||||
# undef je_malloc_conf_2_conf_harder
|
||||
# undef je_malloc_message
|
||||
# undef je_malloc
|
||||
# undef je_calloc
|
||||
# undef je_posix_memalign
|
||||
# undef je_aligned_alloc
|
||||
# undef je_realloc
|
||||
# undef je_free
|
||||
# undef je_mallocx
|
||||
# undef je_rallocx
|
||||
# undef je_xallocx
|
||||
# undef je_sallocx
|
||||
# undef je_dallocx
|
||||
# undef je_sdallocx
|
||||
# undef je_nallocx
|
||||
# undef je_mallctl
|
||||
# undef je_mallctlnametomib
|
||||
# undef je_mallctlbymib
|
||||
# undef je_malloc_stats_print
|
||||
# undef je_malloc_usable_size
|
||||
# undef je_mallocx
|
||||
# undef je_smallocx_f9c0b5f7f8a917661db39289e38ec94d9d198f11
|
||||
# undef je_nallocx
|
||||
# undef je_posix_memalign
|
||||
# undef je_rallocx
|
||||
# undef je_realloc
|
||||
# undef je_sallocx
|
||||
# undef je_sdallocx
|
||||
# undef je_xallocx
|
||||
# undef je_memalign
|
||||
# undef je_valloc
|
||||
# undef je_pvalloc
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
BIN
lib/linux/libcrypto.a
vendored
Normal file
BIN
lib/linux/libcrypto.a
vendored
Normal file
Binary file not shown.
BIN
lib/linux/libjemalloc.a
vendored
BIN
lib/linux/libjemalloc.a
vendored
Binary file not shown.
@ -1,15 +1,15 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
mkdir -p client_distribution
|
||||
mkdir -p client_distribution/assets
|
||||
mkdir -p client_distribution/assets/user
|
||||
mkdir client_distribution
|
||||
mkdir client_distribution/assets
|
||||
mkdir client_distribution/assets/user
|
||||
|
||||
./dist/asset_packer -c scripts/packing.config assets/opensb client_distribution/assets/opensb.pak
|
||||
|
||||
mkdir -p client_distribution/mods
|
||||
mkdir client_distribution/mods
|
||||
touch client_distribution/mods/mods_go_here
|
||||
|
||||
mkdir -p client_distribution/linux
|
||||
mkdir client_distribution/linux
|
||||
cp \
|
||||
dist/starbound \
|
||||
dist/btree_repacker \
|
||||
@ -23,15 +23,15 @@ cp \
|
||||
scripts/ci/linux/run-client.sh \
|
||||
client_distribution/linux/
|
||||
|
||||
mkdir -p server_distribution
|
||||
mkdir -p server_distribution/assets
|
||||
mkdir server_distribution
|
||||
mkdir server_distribution/assets
|
||||
|
||||
mkdir -p server_distribution/mods
|
||||
mkdir server_distribution/mods
|
||||
touch server_distribution/mods/mods_go_here
|
||||
|
||||
./dist/asset_packer -c scripts/packing.config -s assets/opensb server_distribution/assets/opensb.pak
|
||||
|
||||
mkdir -p server_distribution/linux
|
||||
mkdir server_distribution/linux
|
||||
|
||||
cp \
|
||||
dist/starbound_server \
|
||||
|
@ -17,8 +17,8 @@
|
||||
"VCPKG_OVERLAY_TRIPLETS": "${sourceParentDir}/triplets",
|
||||
"CMAKE_VERBOSE_MAKEFILE": true,
|
||||
"BUILD_TESTING": true,
|
||||
"STAR_ENABLE_STEAM_INTEGRATION": false,
|
||||
"STAR_ENABLE_DISCORD_INTEGRATION": false
|
||||
"STAR_ENABLE_STEAM_INTEGRATION": true,
|
||||
"STAR_ENABLE_DISCORD_INTEGRATION": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -371,7 +371,7 @@ StringList Assets::scan(String const& suffix) const {
|
||||
StringList Assets::scan(String const& prefix, String const& suffix) const {
|
||||
StringList result;
|
||||
if (suffix.beginsWith(".") && !suffix.substr(1).hasChar('.')) {
|
||||
auto& filesWithExtension = scanExtension(suffix);
|
||||
StringSet filesWithExtension = scanExtension(suffix);
|
||||
for (auto const& file : filesWithExtension) {
|
||||
if (file.beginsWith(prefix, String::CaseInsensitive))
|
||||
result.append(file);
|
||||
@ -386,11 +386,11 @@ StringList Assets::scan(String const& prefix, String const& suffix) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
const CaseInsensitiveStringSet NullExtensionScan;
|
||||
const StringSet NullStringSet;
|
||||
|
||||
CaseInsensitiveStringSet const& Assets::scanExtension(String const& extension) const {
|
||||
StringSet const& Assets::scanExtension(String const& extension) const {
|
||||
auto find = m_filesByExtension.find(extension.beginsWith(".") ? extension.substr(1) : extension);
|
||||
return find != m_filesByExtension.end() ? find->second : NullExtensionScan;
|
||||
return find != m_filesByExtension.end() ? find->second : NullStringSet;
|
||||
}
|
||||
|
||||
Json Assets::json(String const& path) const {
|
||||
@ -416,7 +416,7 @@ void Assets::queueJsons(StringList const& paths) const {
|
||||
}));
|
||||
}
|
||||
|
||||
void Assets::queueJsons(CaseInsensitiveStringSet const& paths) const {
|
||||
void Assets::queueJsons(StringSet const& paths) const {
|
||||
MutexLocker assetsLocker(m_assetsMutex);
|
||||
for (String const& path : paths) {
|
||||
auto components = AssetPath::split(path);
|
||||
@ -439,7 +439,7 @@ void Assets::queueImages(StringList const& paths) const {
|
||||
}));
|
||||
}
|
||||
|
||||
void Assets::queueImages(CaseInsensitiveStringSet const& paths) const {
|
||||
void Assets::queueImages(StringSet const& paths) const {
|
||||
MutexLocker assetsLocker(m_assetsMutex);
|
||||
for (String const& path : paths) {
|
||||
auto components = AssetPath::split(path);
|
||||
@ -482,7 +482,7 @@ void Assets::queueAudios(StringList const& paths) const {
|
||||
}));
|
||||
}
|
||||
|
||||
void Assets::queueAudios(CaseInsensitiveStringSet const& paths) const {
|
||||
void Assets::queueAudios(StringSet const& paths) const {
|
||||
MutexLocker assetsLocker(m_assetsMutex);
|
||||
for (String const& path : paths) {
|
||||
auto components = AssetPath::split(path);
|
||||
|
@ -190,7 +190,7 @@ public:
|
||||
// Scans all assets for files with the given extension, which is specially
|
||||
// indexed and much faster than a normal scan. Extension may contain leading
|
||||
// '.' character or it may be omitted.
|
||||
CaseInsensitiveStringSet const& scanExtension(String const& extension) const;
|
||||
StringSet const& scanExtension(String const& extension) const;
|
||||
|
||||
// Get json asset with an optional sub-path. The sub-path portion of the
|
||||
// path refers to a key in the top-level object, and may use dot notation
|
||||
@ -204,7 +204,7 @@ public:
|
||||
|
||||
// Load all the given jsons using background processing.
|
||||
void queueJsons(StringList const& paths) const;
|
||||
void queueJsons(CaseInsensitiveStringSet const& paths) const;
|
||||
void queueJsons(StringSet const& paths) const;
|
||||
|
||||
// Returns *either* an image asset or a sub-frame. Frame files are JSON
|
||||
// descriptor files that reference a particular image and label separate
|
||||
@ -216,7 +216,7 @@ public:
|
||||
ImageConstPtr image(AssetPath const& path) const;
|
||||
// Load images using background processing
|
||||
void queueImages(StringList const& paths) const;
|
||||
void queueImages(CaseInsensitiveStringSet const& paths) const;
|
||||
void queueImages(StringSet const& paths) const;
|
||||
// Return the given image *if* it is already loaded, otherwise queue it for
|
||||
// loading.
|
||||
ImageConstPtr tryImage(AssetPath const& path) const;
|
||||
@ -231,7 +231,7 @@ public:
|
||||
AudioConstPtr audio(String const& path) const;
|
||||
// Load audios using background processing
|
||||
void queueAudios(StringList const& paths) const;
|
||||
void queueAudios(CaseInsensitiveStringSet const& paths) const;
|
||||
void queueAudios(StringSet const& paths) const;
|
||||
// Return the given audio *if* it is already loaded, otherwise queue it for
|
||||
// loading.
|
||||
AudioConstPtr tryAudio(String const& path) const;
|
||||
@ -331,7 +331,7 @@ private:
|
||||
// Maps the source asset name to the source containing it
|
||||
CaseInsensitiveStringMap<AssetFileDescriptor> m_files;
|
||||
// Maps an extension to the files with that extension
|
||||
CaseInsensitiveStringMap<CaseInsensitiveStringSet> m_filesByExtension;
|
||||
CaseInsensitiveStringMap<StringSet> m_filesByExtension;
|
||||
|
||||
ByteArray m_digest;
|
||||
|
||||
|
@ -63,7 +63,6 @@ Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON(
|
||||
"antiAliasing" : false,
|
||||
"zoomLevel" : 3.0,
|
||||
"cameraSpeedFactor" : 1.0,
|
||||
"interfaceScale" : 0,
|
||||
"speechBubbles" : true,
|
||||
|
||||
"title" : {
|
||||
@ -372,9 +371,7 @@ void ClientApplication::render() {
|
||||
renderer->setMultiSampling(config->get("antiAliasing").optBool().value(false) ? 4 : 0);
|
||||
renderer->switchEffectConfig("interface");
|
||||
|
||||
if (auto interfaceScale = config->get("interfaceScale").optUInt().value())
|
||||
m_guiContext->setInterfaceScale(interfaceScale);
|
||||
else if (m_guiContext->windowWidth() >= m_crossoverRes[0] && m_guiContext->windowHeight() >= m_crossoverRes[1])
|
||||
if (m_guiContext->windowWidth() >= m_crossoverRes[0] && m_guiContext->windowHeight() >= m_crossoverRes[1])
|
||||
m_guiContext->setInterfaceScale(m_maxInterfaceScale);
|
||||
else
|
||||
m_guiContext->setInterfaceScale(m_minInterfaceScale);
|
||||
|
@ -359,8 +359,6 @@ struct CaseInsensitiveStringCompare {
|
||||
|
||||
typedef HashSet<String> StringSet;
|
||||
|
||||
typedef HashSet<String, CaseInsensitiveStringHash, CaseInsensitiveStringCompare> CaseInsensitiveStringSet;
|
||||
|
||||
template <typename MappedT, typename HashT = hash<String>, typename ComparatorT = std::equal_to<String>>
|
||||
using StringMap = HashMap<String, MappedT, HashT, ComparatorT>;
|
||||
|
||||
|
@ -77,9 +77,7 @@ void CharSelectionPane::updateCharacterPlates() {
|
||||
auto updatePlayerLine = [this](String name, unsigned scrollPosition) {
|
||||
auto charSelector = fetchChild<LargeCharPlateWidget>(name);
|
||||
if (auto playerUuid = m_playerStorage->playerUuidAt(scrollPosition)) {
|
||||
auto player = m_playerStorage->loadPlayer(*playerUuid);
|
||||
player->humanoid()->setFacingDirection(Direction::Right);
|
||||
charSelector->setPlayer(player);
|
||||
charSelector->setPlayer(m_playerStorage->loadPlayer(*playerUuid));
|
||||
charSelector->enableDelete([this, playerUuid](Widget*) { m_deleteCallback(*playerUuid); });
|
||||
} else {
|
||||
charSelector->setPlayer(PlayerPtr());
|
||||
|
@ -195,7 +195,7 @@ void ChatBubbleManager::addChatActions(List<ChatAction> chatActions, bool silent
|
||||
// bother me so bad if it weren't so fucking easy to do right.
|
||||
|
||||
// yea I agree
|
||||
m_guiContext->setTextStyle(m_textStyle, m_zoom);
|
||||
m_guiContext->setTextStyle(m_textStyle);
|
||||
auto result = m_guiContext->determineTextSize(sayAction.text, m_textTemplate);
|
||||
float textWidth = result.width() / m_zoom + m_textPadding[0];
|
||||
float textHeight = result.height() / m_zoom + m_textPadding[1];
|
||||
|
@ -28,11 +28,6 @@ GraphicsMenu::GraphicsMenu() {
|
||||
m_localChanges.set("fullscreenResolution", jsonFromVec2U(res));
|
||||
syncGui();
|
||||
});
|
||||
reader.registerCallback("interfaceScaleSlider", [=](Widget*) {
|
||||
auto interfaceScaleSlider = fetchChild<SliderBarWidget>("interfaceScaleSlider");
|
||||
m_localChanges.set("interfaceScale", (uint64_t)m_interfaceScaleList[interfaceScaleSlider->val()]);
|
||||
syncGui();
|
||||
});
|
||||
reader.registerCallback("zoomSlider", [=](Widget*) {
|
||||
auto zoomSlider = fetchChild<SliderBarWidget>("zoomSlider");
|
||||
m_localChanges.set("zoomLevel", m_zoomList[zoomSlider->val()]);
|
||||
@ -108,14 +103,12 @@ GraphicsMenu::GraphicsMenu() {
|
||||
|
||||
Json paneLayout = assets->json("/interface/windowconfig/graphicsmenu.config:paneLayout");
|
||||
|
||||
m_interfaceScaleList = jsonToIntList(assets->json("/interface/windowconfig/graphicsmenu.config:interfaceScaleList"));
|
||||
m_resList = jsonToVec2UList(assets->json("/interface/windowconfig/graphicsmenu.config:resolutionList"));
|
||||
m_zoomList = jsonToFloatList(assets->json("/interface/windowconfig/graphicsmenu.config:zoomList"));
|
||||
m_cameraSpeedList = jsonToFloatList(assets->json("/interface/windowconfig/graphicsmenu.config:cameraSpeedList"));
|
||||
|
||||
reader.construct(paneLayout, this);
|
||||
|
||||
fetchChild<SliderBarWidget>("interfaceScaleSlider")->setRange(0, m_interfaceScaleList.size() - 1, 1);
|
||||
fetchChild<SliderBarWidget>("resSlider")->setRange(0, m_resList.size() - 1, 1);
|
||||
fetchChild<SliderBarWidget>("zoomSlider")->setRange(0, m_zoomList.size() - 1, 1);
|
||||
fetchChild<SliderBarWidget>("cameraSpeedSlider")->setRange(0, m_cameraSpeedList.size() - 1, 1);
|
||||
@ -150,7 +143,6 @@ void GraphicsMenu::toggleFullscreen() {
|
||||
|
||||
StringList const GraphicsMenu::ConfigKeys = {
|
||||
"fullscreenResolution",
|
||||
"interfaceScale",
|
||||
"zoomLevel",
|
||||
"cameraSpeedFactor",
|
||||
"speechBubbles",
|
||||
@ -188,38 +180,27 @@ void GraphicsMenu::syncGui() {
|
||||
}
|
||||
fetchChild<LabelWidget>("resValueLabel")->setText(strf("{}x{}", res[0], res[1]));
|
||||
|
||||
auto interfaceScaleSlider = fetchChild<SliderBarWidget>("interfaceScaleSlider");
|
||||
auto interfaceScale = m_localChanges.get("interfaceScale").optUInt().value();
|
||||
auto interfaceScaleIt = std::lower_bound(m_interfaceScaleList.begin(), m_interfaceScaleList.end(), interfaceScale);
|
||||
if (interfaceScaleIt != m_interfaceScaleList.end()) {
|
||||
size_t scaleIndex = interfaceScaleIt - m_interfaceScaleList.begin();
|
||||
interfaceScaleSlider->setVal(std::min(scaleIndex, m_interfaceScaleList.size() - 1), false);
|
||||
} else {
|
||||
interfaceScaleSlider->setVal(m_interfaceScaleList.size() - 1);
|
||||
}
|
||||
fetchChild<LabelWidget>("interfaceScaleValueLabel")->setText(interfaceScale ? toString(interfaceScale) : "AUTO");
|
||||
|
||||
auto zoomSlider = fetchChild<SliderBarWidget>("zoomSlider");
|
||||
auto zoomLevel = m_localChanges.get("zoomLevel").toFloat();
|
||||
auto zoomIt = std::lower_bound(m_zoomList.begin(), m_zoomList.end(), zoomLevel);
|
||||
auto zoomIt = std::lower_bound(m_zoomList.begin(), m_zoomList.end(), m_localChanges.get("zoomLevel").toFloat());
|
||||
if (zoomIt != m_zoomList.end()) {
|
||||
size_t zoomIndex = zoomIt - m_zoomList.begin();
|
||||
zoomSlider->setVal(std::min(zoomIndex, m_zoomList.size() - 1), false);
|
||||
zoomIndex = std::min(zoomIndex, m_zoomList.size() - 1);
|
||||
zoomSlider->setVal(zoomIndex, false);
|
||||
} else {
|
||||
zoomSlider->setVal(m_zoomList.size() - 1);
|
||||
}
|
||||
fetchChild<LabelWidget>("zoomValueLabel")->setText(strf("{}x", zoomLevel));
|
||||
fetchChild<LabelWidget>("zoomValueLabel")->setText(strf("{}x", m_localChanges.get("zoomLevel").toFloat()));
|
||||
|
||||
auto cameraSpeedSlider = fetchChild<SliderBarWidget>("cameraSpeedSlider");
|
||||
auto cameraSpeedFactor = m_localChanges.get("cameraSpeedFactor").toFloat();
|
||||
auto speedIt = std::lower_bound(m_cameraSpeedList.begin(), m_cameraSpeedList.end(), cameraSpeedFactor);
|
||||
auto speedIt = std::lower_bound(m_cameraSpeedList.begin(), m_cameraSpeedList.end(), m_localChanges.get("cameraSpeedFactor").toFloat());
|
||||
if (speedIt != m_cameraSpeedList.end()) {
|
||||
size_t speedIndex = speedIt - m_cameraSpeedList.begin();
|
||||
cameraSpeedSlider->setVal(std::min(speedIndex, m_cameraSpeedList.size() - 1), false);
|
||||
speedIndex = std::min(speedIndex, m_cameraSpeedList.size() - 1);
|
||||
cameraSpeedSlider->setVal(speedIndex, false);
|
||||
} else {
|
||||
cameraSpeedSlider->setVal(m_cameraSpeedList.size() - 1);
|
||||
}
|
||||
fetchChild<LabelWidget>("cameraSpeedValueLabel")->setText(strf("{}x", cameraSpeedFactor));
|
||||
fetchChild<LabelWidget>("cameraSpeedValueLabel")->setText(strf("{}x", m_localChanges.get("cameraSpeedFactor").toFloat()));
|
||||
|
||||
fetchChild<ButtonWidget>("speechBubbleCheckbox")->setChecked(m_localChanges.get("speechBubbles").toBool());
|
||||
fetchChild<ButtonWidget>("interactiveHighlightCheckbox")->setChecked(m_localChanges.get("interactiveHighlight").toBool());
|
||||
|
@ -25,7 +25,6 @@ private:
|
||||
void applyWindowSettings();
|
||||
|
||||
List<Vec2U> m_resList;
|
||||
List<int> m_interfaceScaleList;
|
||||
List<float> m_zoomList;
|
||||
List<float> m_cameraSpeedList;
|
||||
|
||||
|
@ -220,10 +220,13 @@ void MainInterface::openMerchantWindow(Json const& config, EntityId sourceEntity
|
||||
}
|
||||
|
||||
bool openWithInventory = config.getBool("openWithInventory", true);
|
||||
bool closeWithInventory = config.getBool("closeWithInventory", !m_paneManager.registeredPaneIsDisplayed(MainInterfacePanes::Inventory));
|
||||
m_merchantWindow = make_shared<MerchantPane>(m_client->worldClient(), m_client->mainPlayer(), config, sourceEntityId);
|
||||
m_paneManager.displayPane(PaneLayer::Window, m_merchantWindow, [this, closeWithInventory](PanePtr const&) {
|
||||
if (closeWithInventory)
|
||||
m_paneManager.displayPane(PaneLayer::Window,
|
||||
m_merchantWindow,
|
||||
[this, openWithInventory](PanePtr const&) {
|
||||
if (auto player = m_client->mainPlayer())
|
||||
player->clearSwap();
|
||||
if (openWithInventory)
|
||||
m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory);
|
||||
});
|
||||
if (openWithInventory)
|
||||
@ -401,17 +404,13 @@ void MainInterface::handleInteractAction(InteractAction interactAction) {
|
||||
|
||||
m_containerInteractor->openContainer(containerEntity);
|
||||
|
||||
bool closeWithInventory = !m_paneManager.registeredPaneIsDisplayed(MainInterfacePanes::Inventory);
|
||||
m_paneManager.displayRegisteredPane(MainInterfacePanes::Inventory);
|
||||
|
||||
m_containerPane = make_shared<ContainerPane>(world, m_client->mainPlayer(), m_containerInteractor);
|
||||
m_paneManager.displayPane(PaneLayer::Window, m_containerPane, [this, closeWithInventory](PanePtr const&) {
|
||||
if (closeWithInventory)
|
||||
m_paneManager.displayPane(PaneLayer::Window, m_containerPane, [this](PanePtr const&) {
|
||||
if (auto player = m_client->mainPlayer())
|
||||
player->clearSwap();
|
||||
m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory);
|
||||
else {
|
||||
m_containerInteractor->closeContainer();
|
||||
m_containerPane = {};
|
||||
}
|
||||
});
|
||||
|
||||
m_paneManager.bringPaneAdjacent(m_paneManager.registeredPane(MainInterfacePanes::Inventory),
|
||||
@ -1581,9 +1580,9 @@ void MainInterface::displayScriptPane(ScriptPanePtr& scriptPane, EntityId source
|
||||
layer = PaneLayerNames.getLeft(*layerName);
|
||||
|
||||
if (scriptPane->openWithInventory()) {
|
||||
bool closeWithInventory = scriptPane->closeWithInventory();
|
||||
m_paneManager.displayPane(layer, scriptPane, [this, closeWithInventory](PanePtr const&) {
|
||||
if (closeWithInventory)
|
||||
m_paneManager.displayPane(layer, scriptPane, [this](PanePtr const&) {
|
||||
if (auto player = m_client->mainPlayer())
|
||||
player->clearSwap();
|
||||
m_paneManager.dismissRegisteredPane(MainInterfacePanes::Inventory);
|
||||
});
|
||||
m_paneManager.displayRegisteredPane(MainInterfacePanes::Inventory);
|
||||
|
@ -88,10 +88,6 @@ bool ScriptPane::openWithInventory() const {
|
||||
return m_config.getBool("openWithInventory", false);
|
||||
}
|
||||
|
||||
bool ScriptPane::closeWithInventory() const {
|
||||
return m_config.getBool("closeWithInventory", openWithInventory());
|
||||
}
|
||||
|
||||
EntityId ScriptPane::sourceEntityId() const {
|
||||
return m_sourceEntityId;
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ public:
|
||||
PanePtr createTooltip(Vec2I const& screenPosition) override;
|
||||
|
||||
bool openWithInventory() const;
|
||||
bool closeWithInventory() const;
|
||||
|
||||
EntityId sourceEntityId() const;
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
namespace Star {
|
||||
|
||||
String const SongPathPrefix = "/songs/";
|
||||
|
||||
SongbookInterface::SongbookInterface(PlayerPtr player) {
|
||||
m_player = std::move(player);
|
||||
|
||||
@ -62,16 +60,9 @@ bool SongbookInterface::play() {
|
||||
void SongbookInterface::refresh(bool reloadFiles) {
|
||||
if (reloadFiles) {
|
||||
m_files = Root::singleton().assets()->scanExtension(".abc").values();
|
||||
eraseWhere(m_files, [](String& song) {
|
||||
if (!song.beginsWith(SongPathPrefix, String::CaseInsensitive)) {
|
||||
Logger::warn("Song '{}' isn't in {}, ignoring", SongPathPrefix.size(), song);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
sort(m_files, [](String const& a, String const& b) -> bool { return b.compare(a, String::CaseInsensitive) > 0; });
|
||||
}
|
||||
auto& search = fetchChild<TextBoxWidget>("search")->getText();
|
||||
auto search = fetchChild<TextBoxWidget>("search")->getText();
|
||||
if (m_lastSearch != search || reloadFiles) {
|
||||
m_lastSearch = search;
|
||||
auto songList = fetchChild<ListWidget>("songs.list");
|
||||
@ -81,14 +72,12 @@ void SongbookInterface::refresh(bool reloadFiles) {
|
||||
auto widget = songList->addItem();
|
||||
widget->setData(i);
|
||||
auto songName = widget->fetchChild<LabelWidget>("songName");
|
||||
String const& song = m_files[i];
|
||||
songName->setText(song.substr(SongPathPrefix.size(), song.size() - (SongPathPrefix.size() + 4)));
|
||||
songName->setText(m_files[i]);
|
||||
widget->show();
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 0; i != m_files.size(); ++i) {
|
||||
StringView song = m_files[i];
|
||||
song = song.substr(SongPathPrefix.size(), song.size() - (SongPathPrefix.size() + 4));
|
||||
auto find = song.find(search, 0, String::CaseInsensitive);
|
||||
if (find != NPos) {
|
||||
auto widget = songList->addItem();
|
||||
|
@ -12,59 +12,51 @@ LargeCharPlateWidget::LargeCharPlateWidget(WidgetCallbackFunc mainCallback, Play
|
||||
setSize(ButtonWidget::size());
|
||||
|
||||
auto assets = Root::singleton().assets();
|
||||
m_config = assets->json("/interface.config:largeCharPlate");
|
||||
auto charPlateImage = m_config.getString("backingImage");
|
||||
auto charPlateImage = assets->json("/interface.config:largeCharPlate.backingImage").toString();
|
||||
|
||||
setCallback(mainCallback);
|
||||
setImages(charPlateImage);
|
||||
|
||||
m_playerPlate = charPlateImage;
|
||||
m_playerPlateHover = m_config.getString("playerHover");
|
||||
m_noPlayerPlate = m_config.getString("noPlayer");
|
||||
m_noPlayerPlateHover = m_config.getString("noPlayerHover");
|
||||
m_portraitOffset = jsonToVec2I(m_config.get("portraitOffset"));
|
||||
m_portraitScale = m_config.getFloat("portraitScale");
|
||||
m_playerPlateHover = assets->json("/interface.config:largeCharPlate.playerHover").toString();
|
||||
m_noPlayerPlate = assets->json("/interface.config:largeCharPlate.noPlayer").toString();
|
||||
m_noPlayerPlateHover = assets->json("/interface.config:largeCharPlate.noPlayerHover").toString();
|
||||
m_portraitOffset = jsonToVec2I(assets->json("/interface.config:largeCharPlate.portraitOffset"));
|
||||
m_portraitScale = assets->json("/interface.config:largeCharPlate.portraitScale").toFloat();
|
||||
|
||||
String switchText = m_config.getString("switchText");
|
||||
String createText = m_config.getString("createText");
|
||||
String switchText = assets->json("/interface.config:largeCharPlate.switchText").toString();
|
||||
String createText = assets->json("/interface.config:largeCharPlate.createText").toString();
|
||||
|
||||
m_portrait = make_shared<PortraitWidget>();
|
||||
m_portrait->setScale(m_portraitScale);
|
||||
m_portrait->setPosition(m_portraitOffset);
|
||||
m_portrait->setRenderHumanoid(true);
|
||||
addChild("portrait", m_portrait);
|
||||
|
||||
String modeLabelText = m_config.getString("modeText");
|
||||
m_regularTextColor = Color::rgb(jsonToVec3B(m_config.get("textColor")));
|
||||
m_disabledTextColor = Color::rgb(jsonToVec3B(m_config.get("textColorDisabled")));
|
||||
String modeLabelText = assets->json("/interface.config:largeCharPlate.modeText").toString();
|
||||
m_regularTextColor = Color::rgb(jsonToVec3B(assets->json("/interface.config:largeCharPlate.textColor")));
|
||||
m_disabledTextColor = Color::rgb(jsonToVec3B(assets->json("/interface.config:largeCharPlate.textColorDisabled")));
|
||||
|
||||
m_modeNameOffset = jsonToVec2I(m_config.get("modeNameOffset"));
|
||||
m_modeOffset = jsonToVec2I(m_config.get("modeOffset"));
|
||||
m_modeNameOffset = jsonToVec2I(assets->json("/interface.config:largeCharPlate.modeNameOffset"));
|
||||
m_modeOffset = jsonToVec2I(assets->json("/interface.config:largeCharPlate.modeOffset"));
|
||||
|
||||
auto modeNameHAnchor = HorizontalAnchorNames.getLeft(m_config.getString("modeNameHAnchor", "mid"));
|
||||
auto modeNameVAnchor = VerticalAnchorNames .getLeft(m_config.getString("modeNameVAnchor", "bottom"));
|
||||
m_modeName = make_shared<LabelWidget>(modeLabelText, Color::White, modeNameHAnchor);
|
||||
m_modeName = make_shared<LabelWidget>(modeLabelText, Color::White, HorizontalAnchor::HMidAnchor);
|
||||
addChild("modeName", m_modeName);
|
||||
m_modeName->setPosition(m_modeNameOffset);
|
||||
m_modeName->setAnchor(modeNameHAnchor, modeNameVAnchor);
|
||||
m_modeName->setAnchor(HorizontalAnchor::HMidAnchor, VerticalAnchor::BottomAnchor);
|
||||
|
||||
auto modeHAnchor = HorizontalAnchorNames.getLeft(m_config.getString("modeHAnchor", "left"));
|
||||
auto modeVAnchor = VerticalAnchorNames .getLeft(m_config.getString("modeVAnchor", "bottom"));
|
||||
m_mode = make_shared<LabelWidget>();
|
||||
addChild("mode", m_mode);
|
||||
m_mode->setPosition(m_modeOffset);
|
||||
m_mode->setAnchor(modeHAnchor, modeVAnchor);
|
||||
m_mode->setAnchor(HorizontalAnchor::LeftAnchor, VerticalAnchor::BottomAnchor);
|
||||
|
||||
m_createCharText = m_config.getString("noPlayerText");
|
||||
m_createCharTextColor = Color::rgb(jsonToVec3B(m_config.get("noPlayerTextColor")));
|
||||
m_playerNameOffset = jsonToVec2I(m_config.get("playerNameOffset"));
|
||||
m_createCharText = assets->json("/interface.config:largeCharPlate.noPlayerText").toString();
|
||||
m_createCharTextColor = Color::rgb(jsonToVec3B(assets->json("/interface.config:largeCharPlate.noPlayerTextColor")));
|
||||
m_playerNameOffset = jsonToVec2I(assets->json("/interface.config:largeCharPlate.playerNameOffset"));
|
||||
|
||||
auto playerNameHAnchor = HorizontalAnchorNames.getLeft(m_config.getString("playerNameHAnchor", "mid"));
|
||||
auto playerNameVAnchor = VerticalAnchorNames .getLeft(m_config.getString("playerNameVAnchor", "bottom"));
|
||||
m_playerName = make_shared<LabelWidget>();
|
||||
m_playerName->setColor(m_createCharTextColor);
|
||||
m_playerName->setPosition(m_playerNameOffset);
|
||||
m_playerName->setAnchor(playerNameHAnchor, playerNameVAnchor);
|
||||
m_playerName->setAnchor(HorizontalAnchor::HMidAnchor, VerticalAnchor::BottomAnchor);
|
||||
addChild("player", m_playerName);
|
||||
}
|
||||
|
||||
@ -129,12 +121,13 @@ void LargeCharPlateWidget::setPlayer(PlayerPtr player) {
|
||||
void LargeCharPlateWidget::enableDelete(WidgetCallbackFunc const& callback) {
|
||||
disableDelete();
|
||||
|
||||
auto trashButton = m_config.get("trashButton");
|
||||
auto baseImage = trashButton.getString("baseImage");
|
||||
auto hoverImage = trashButton.getString("hoverImage");
|
||||
auto pressedImage = trashButton.getString("pressedImage");
|
||||
auto disabledImage = trashButton.getString("disabledImage");
|
||||
auto offset = jsonToVec2I(trashButton.get("offset"));
|
||||
auto assets = Root::singleton().assets();
|
||||
|
||||
auto baseImage = assets->json("/interface.config:largeCharPlate.trashButton.baseImage").toString();
|
||||
auto hoverImage = assets->json("/interface.config:largeCharPlate.trashButton.hoverImage").toString();
|
||||
auto pressedImage = assets->json("/interface.config:largeCharPlate.trashButton.pressedImage").toString();
|
||||
auto disabledImage = assets->json("/interface.config:largeCharPlate.trashButton.disabledImage").toString();
|
||||
auto offset = jsonToVec2I(assets->json("/interface.config:largeCharPlate.trashButton.offset"));
|
||||
|
||||
m_delete = make_shared<ButtonWidget>(callback, baseImage, hoverImage, pressedImage, disabledImage);
|
||||
addChild("trashButton", m_delete);
|
||||
@ -164,21 +157,4 @@ bool LargeCharPlateWidget::sendEvent(InputEvent const& event) {
|
||||
return ButtonWidget::sendEvent(event);
|
||||
}
|
||||
|
||||
void LargeCharPlateWidget::update(float dt) {
|
||||
ButtonWidget::update(dt);
|
||||
|
||||
if (!m_player || !m_config.getBool("animatePortrait", true))
|
||||
return;
|
||||
|
||||
auto humanoid = m_player->humanoid();
|
||||
if (m_delete->isHovered()) {
|
||||
humanoid->setEmoteState(HumanoidEmote::Sad);
|
||||
humanoid->setState(Humanoid::Run);
|
||||
} else {
|
||||
humanoid->setEmoteState(HumanoidEmote::Idle);
|
||||
humanoid->setState(isHovered() ? Humanoid::Walk : Humanoid::Idle);
|
||||
}
|
||||
humanoid->animate(dt);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,14 +23,11 @@ public:
|
||||
|
||||
virtual bool sendEvent(InputEvent const& event) override;
|
||||
|
||||
void update(float dt) override;
|
||||
|
||||
protected:
|
||||
virtual void renderImpl() override;
|
||||
|
||||
private:
|
||||
PlayerPtr m_player;
|
||||
Json m_config;
|
||||
|
||||
PortraitWidgetPtr m_portrait;
|
||||
Vec2I m_portraitOffset;
|
||||
|
@ -223,7 +223,7 @@ void Pane::setDragActive(bool dragActive, Vec2I dragMouseOrigin) {
|
||||
|
||||
void Pane::drag(Vec2I mousePosition) {
|
||||
Vec2I delta = mousePosition - m_dragMouseOrigin;
|
||||
setPosition(relativePosition() + delta);
|
||||
setPosition(position() + delta);
|
||||
m_dragMouseOrigin += delta;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user