mirror of
https://github.com/brues-code/TwitchEmotes.git
synced 2026-10-09 07:30:01 +00:00
Slow catJAM to its source speed, emit integer texcoords
The source emote is 158 frames at 25fps, a 6.32s loop; this sheet holds 60 of those frames but kept a framerate of 15, running the loop in 4.0s. A fractional rate would have matched it exactly, but the engine splits the |T payload on ':' and atoi's each field, so a coordinate carrying a decimal point truncates and crops the wrong rect - the emote renders as the whole sheet squeezed into its box. The animator now formats the payload with %d so the frame math can never leak a float into it, and the rate stays a whole number: 10fps, a 6.0s loop.
This commit is contained in:
+1
-1
@@ -8927,7 +8927,7 @@ TwitchEmotes_animation_metadata = {
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\Clap.tga"] = {["nFrames"] = 2, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=64, ["framerate"] = 6},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\modCheck.tga"] = {["nFrames"] = 28, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=1024, ["framerate"] = 9},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\goinginsane.tga"] = {["nFrames"] = 47, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 25},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\catJAM.tga"] = {["nFrames"] = 60, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 15},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\catJAM.tga"] = {["nFrames"] = 60, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 10},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\ratJAM.tga"] = {["nFrames"] = 16, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 15},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\BTTV+FFZ\\haHAA.tga"] = {["nFrames"] = 14, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 34},
|
||||
["Interface\\AddOns\\TwitchEmotes\\Emotes\\Pepes\\PepeMeltdown.tga"] = {["nFrames"] = 10, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 34},
|
||||
|
||||
@@ -40,11 +40,14 @@ local function CropToCurrentFrame(tex, animdata)
|
||||
top / animdata.imageHeight, bottom / animdata.imageHeight)
|
||||
end
|
||||
|
||||
-- The engine splits the payload on ':' and atoi's each field, so a coordinate
|
||||
-- carrying a decimal point silently truncates and crops the wrong rect (a
|
||||
-- fractional framerate is enough to leak one in). Format them as integers.
|
||||
local function BuildFrameString(imagepath, animdata, framenum, w, h)
|
||||
local left, right, top, bottom = GetFrameRect(animdata, framenum)
|
||||
return "|T" .. imagepath .. ":" .. w .. ":" .. h .. ":0:0:" ..
|
||||
animdata.imageWidth .. ":" .. animdata.imageHeight .. ":" ..
|
||||
left .. ":" .. right .. ":" .. top .. ":" .. bottom .. "|t"
|
||||
return ("|T%s:%d:%d:0:0:%d:%d:%d:%d:%d:%d|t"):format(imagepath, w, h,
|
||||
animdata.imageWidth, animdata.imageHeight,
|
||||
left, right, top, bottom)
|
||||
end
|
||||
|
||||
-- escape the pattern-magic chars that can appear in an emote escape (paths use
|
||||
|
||||
Reference in New Issue
Block a user