From 5db04f585eaf9833d293378340515a2ce8eb5988 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 20 Jun 2013 18:31:50 +0000 Subject: [PATCH] Lunatic: player method fadecol(), an improved palfrom. Also, an external 'minitext' with optional shade and pal. args and documentation for ps:padecol(). git-svn-id: https://svn.eduke32.com/eduke32@3893 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/bcheck.lua | 12 ++- polymer/eduke32/source/lunatic/control.lua | 11 ++- polymer/eduke32/source/lunatic/defs.ilua | 74 ++++++++++++++++++- .../eduke32/source/lunatic/doc/lunatic.txt | 47 ++++++++++-- polymer/eduke32/source/lunatic/test.elua | 64 ++++++++++++++++ .../source/lunatic/test/delmusicsfx.lua | 6 +- polymer/eduke32/source/player.c | 25 +++++++ polymer/eduke32/source/player.h | 2 + polymer/eduke32/source/premap.c | 14 +++- 9 files changed, 234 insertions(+), 21 deletions(-) diff --git a/polymer/eduke32/source/lunatic/bcheck.lua b/polymer/eduke32/source/lunatic/bcheck.lua index f6b80a0cf..2c8007a62 100644 --- a/polymer/eduke32/source/lunatic/bcheck.lua +++ b/polymer/eduke32/source/lunatic/bcheck.lua @@ -98,9 +98,15 @@ function bcheck.top_level(funcname) end end -function bcheck.number(val) - if (type(val)~="number") then - error("invalid argument: must be a number", 3) +function bcheck.number(val, errlev) + if (type(val)~="number" or val~=val) then + error("invalid argument: must be a non-NaN number", errlev or 3) + end +end + +function bcheck.type(val, typestr) + if (type(val)~=typestr) then + error("invalid argument: must be a "..typestr, 3) end end diff --git a/polymer/eduke32/source/lunatic/control.lua b/polymer/eduke32/source/lunatic/control.lua index 3edde16a7..cd58b136a 100644 --- a/polymer/eduke32/source/lunatic/control.lua +++ b/polymer/eduke32/source/lunatic/control.lua @@ -165,6 +165,7 @@ local check_tile_idx = bcheck.tile_idx local check_sprite_idx = bcheck.sprite_idx local check_player_idx = bcheck.player_idx local check_sound_idx = bcheck.sound_idx +local check_type = bcheck.type -- Will contain [