Lunatic: for '(display)rand*', use math.floor(); correct create_additive_trans() help.

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4816 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-12-14 20:48:05 +00:00
parent 52b58dde26
commit 3db594912f
2 changed files with 10 additions and 7 deletions

View File

@ -24,6 +24,8 @@ local band, bor = bit.band, bit.bor
local rshift = bit.rshift
local tobit = bit.tobit
local floor = math.floor
local assert = assert
local error = error
local ipairs = ipairs
@ -460,11 +462,11 @@ end
--- Legacy operators ---
function _rand(x)
return tobit((ffiC.krand()*(x+1))/65536)
return floor((ffiC.krand()*(x+1))/65536)
end
function _displayrand(x)
return tobit((math.random(0, 32767)*(x+1))/32768)
return floor((math.random(0, 32767)*(x+1))/32768)
end
do
@ -2100,7 +2102,7 @@ local function gamearray_file_common(qnum, writep)
end
end
return f, math.floor(fsize/4), isnewgar, fn
return f, floor(fsize/4), isnewgar, fn
end
local function check_gamearray_idx(gar, idx, addstr)
@ -2137,7 +2139,7 @@ local gamearray_methods = {
error("invalid new array size "..newsize, 2)
end
local MAXELTS = math.floor(0x7fffffff/4)
local MAXELTS = floor(0x7fffffff/4)
if (newsize > MAXELTS) then
-- mainly for some sanity with kread() (which we don't use, but still)
error("new array size "..newsize.." too large (max="..MAXELTS.." elements)", 2)

View File

@ -570,7 +570,7 @@ formatHelp
<____________________________________________________________________>
Creates <numtables> blending tables of smooth alpha translucency,
starting with the blending number <startblend>, with fractions
starting with the blending number <startblend>, with values of alpha
1/(2\255<numtables>), 2/(2\255<numtables>) ... <numtables>/(2\255<numtables>).
@ -596,9 +596,10 @@ formatHelp
<____________________________________________________________________>
Creates <numtables> blending tables of smooth additive translucency,
starting with the blending number <startbl>, with fractions
starting with the blending number <startbl>, with factors for the
background color
1/(2\255<numtables>), 2/(2\255<numtables>) ... <numtables>/(2\255<numtables>).
1/<numtables>, 2/<numtables> ... <numtables>/<numtables>.
<numtables> must be a power of two in [1 .. 128].