Skip to content

Commit

Permalink
Update rust-g, use spritesheet asset for design icons (#5315)
Browse files Browse the repository at this point in the history
* Update rust-g and fix spritesheet icon cache problem

* Convert design_icons to spritesheet, from 1618 images to 8

* Update rust-g in the CI as well

* Push ci suite to ubuntu 22.04 so that rust-g stops complaining

* Update libssl too... oh jeez.

* Fix PyYaml

* Include rust-g in repo for CI

* Stop CRASHing whenever the asset cache encounters a bad entry, it guarantees everything else will break

* A whole bunch of bullshit to make IconForge work

Ports BeeStation/BeeStation-Hornet#10404

* whoops this should be in the example config
  • Loading branch information
ShadowLarkens authored May 30, 2024
1 parent 3393203 commit 966d34b
Show file tree
Hide file tree
Showing 45 changed files with 1,575 additions and 600 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
run_linters:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Run Linters
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
concurrency:
group: run_linters-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
compile_all_maps:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Compile Maps
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
concurrency:
group: compile_all_maps-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -76,7 +76,7 @@ jobs:
run_all_tests:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Integration Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:latest
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
sudo apt install zlib1g-dev:i386
bash tools/ci/install_rust_g.sh
- name: Compile Tests
run: |
Expand All @@ -127,7 +127,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && always()"
needs: [run_all_tests]
name: Compare Screenshot Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# If we ever add more artifacts, this is going to break, but it'll be obvious.
Expand Down
33 changes: 33 additions & 0 deletions code/__DEFINES/_tick.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//Percentage of tick to leave for master controller to run
#define MAPTICK_MC_MIN_RESERVE 70
//internal_tick_usage is updated every tick
#if DM_VERSION > 513
#define MAPTICK_LAST_INTERNAL_TICK_USAGE world.map_cpu
#else
#define MAPTICK_LAST_INTERNAL_TICK_USAGE 50
#endif

// Tick limit while running normally
#define TICK_BYOND_RESERVE 2
#define TICK_LIMIT_RUNNING (max(100 - TICK_BYOND_RESERVE - MAPTICK_LAST_INTERNAL_TICK_USAGE, MAPTICK_MC_MIN_RESERVE))
// Tick limit used to resume things in stoplag
#define TICK_LIMIT_TO_RUN 70
// Tick limit for MC while running
#define TICK_LIMIT_MC 70
// Tick limit while initializing
#define TICK_LIMIT_MC_INIT_DEFAULT (100 - TICK_BYOND_RESERVE)

//for general usage
#define TICK_USAGE world.tick_usage
//to be used where the result isn't checked
#define TICK_USAGE_REAL world.tick_usage

// Returns true if tick_usage is above the limit
#define TICK_CHECK ( TICK_USAGE > Master.current_ticklimit )
// runs stoplag if tick_usage is above the limit
#define CHECK_TICK ( TICK_CHECK ? stoplag() : 0 )

// Returns true if tick usage is above 95, for high priority usage
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 )
// runs stoplag if tick_usage is above 95, for high priority usage
#define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY? stoplag() : 0 )
16 changes: 16 additions & 0 deletions code/__DEFINES/assets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define ASSET_CROSS_ROUND_CACHE_DIRECTORY "data/spritesheets/legacy_cache"
#define ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY "data/spritesheets/smart_cache"

/// When sending mutiple assets, how many before we give the client a quaint little sending resources message
#define ASSET_CACHE_TELL_CLIENT_AMOUNT 8

/// How many assets can be sent at once during legacy asset transport
#define SLOW_ASSET_SEND_RATE 6

/// Constructs a universal icon. This is done in the same manner as the icon() BYOND proc.
/// "color" will not do anything if a transform is provided. Blend it yourself or use color_transform().
/// Do note that transforms are NOT COPIED, and are internally lists. So take care not to re-use transforms.
/// This is a DEFINE for performance reasons.
/// Parameters (in order):
/// icon_file, icon_state, dir, frame, transform, color
#define uni_icon(I, icon_state, rest...) new /datum/universal_icon(I, icon_state, ##rest)
8 changes: 8 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,11 @@
#define isMultitool(A) istype(A, /obj/item/tool/multitool)

#define isCrowbar(A) istype(A, /obj/item/tool/crowbar)

/// isnum() returns TRUE for NaN. Also, NaN != NaN. Checkmate, BYOND.
#define isnan(x) ( (x) != (x) )

#define isinf(x) (isnum((x)) && (((x) == SYSTEM_TYPE_INFINITY) || ((x) == -SYSTEM_TYPE_INFINITY)))

/// NaN isn't a number, damn it. Infinity is a problem too.
#define isnum_safe(x) ( isnum((x)) && !isnan((x)) && !isinf((x)) )
9 changes: 8 additions & 1 deletion code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// This file is quadruple wrapped for your pleasure
// (

//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks
//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio)
//collapsed to percent_of_tick_used * tick_lag
#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag)
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage))

#define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol).
#define ONE_ATMOSPHERE 101.325 // kPa.
#define IDEAL_GAS_ENTROPY_CONSTANT 1164 // (mol^3 * s^3) / (kg^3 * L).
Expand All @@ -23,7 +29,8 @@
#define NUM_E 2.71828183

#define M_PI 3.1416
#define INFINITY 1.#INF
#define INFINITY 1.#INF // tg uses 1e31, not ready to change this
#define SYSTEM_TYPE_INFINITY 1.#INF //only for isinf check

#define SHORT_REAL_LIMIT 16777216

Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
//distance
#define RANGE_ADJACENT -1

//#define UNTIL(X) while(!(X)) stoplag() old one

//Core implants
#define CORE_ACTIVATED /datum/core_module/activatable
Expand Down
Loading

0 comments on commit 966d34b

Please sign in to comment.