diff --git a/assets/gfx/emoji/100.png b/assets/gfx/emoji/100.png new file mode 100644 index 00000000..7e189c66 Binary files /dev/null and b/assets/gfx/emoji/100.png differ diff --git a/assets/gfx/emoji/666.png b/assets/gfx/emoji/666.png new file mode 100644 index 00000000..87f0c3ac Binary files /dev/null and b/assets/gfx/emoji/666.png differ diff --git a/assets/gfx/emoji/ROFL.png b/assets/gfx/emoji/ROFL.png new file mode 100644 index 00000000..229857f3 Binary files /dev/null and b/assets/gfx/emoji/ROFL.png differ diff --git a/assets/gfx/emoji/Shhh.png b/assets/gfx/emoji/Shhh.png new file mode 100644 index 00000000..92bb4413 Binary files /dev/null and b/assets/gfx/emoji/Shhh.png differ diff --git a/assets/gfx/emoji/XD.png b/assets/gfx/emoji/XD.png new file mode 100644 index 00000000..e207b366 Binary files /dev/null and b/assets/gfx/emoji/XD.png differ diff --git a/assets/gfx/emoji/Zzz.png b/assets/gfx/emoji/Zzz.png new file mode 100644 index 00000000..d0286b5c Binary files /dev/null and b/assets/gfx/emoji/Zzz.png differ diff --git a/assets/gfx/emoji/blackheart.png b/assets/gfx/emoji/blackheart.png new file mode 100644 index 00000000..830d22cd Binary files /dev/null and b/assets/gfx/emoji/blackheart.png differ diff --git a/assets/gfx/emoji/brain.png b/assets/gfx/emoji/brain.png new file mode 100644 index 00000000..80030bd8 Binary files /dev/null and b/assets/gfx/emoji/brain.png differ diff --git a/assets/gfx/emoji/clown.png b/assets/gfx/emoji/clown.png new file mode 100644 index 00000000..e4c457d6 Binary files /dev/null and b/assets/gfx/emoji/clown.png differ diff --git a/assets/gfx/emoji/cringe.png b/assets/gfx/emoji/cringe.png new file mode 100644 index 00000000..9c85deec Binary files /dev/null and b/assets/gfx/emoji/cringe.png differ diff --git a/assets/gfx/emoji/cross.png b/assets/gfx/emoji/cross.png new file mode 100644 index 00000000..1c57c190 Binary files /dev/null and b/assets/gfx/emoji/cross.png differ diff --git a/assets/gfx/emoji/cyber-arm.png b/assets/gfx/emoji/cyber-arm.png new file mode 100644 index 00000000..9862c8fd Binary files /dev/null and b/assets/gfx/emoji/cyber-arm.png differ diff --git a/assets/gfx/emoji/death.png b/assets/gfx/emoji/death.png new file mode 100644 index 00000000..83fba722 Binary files /dev/null and b/assets/gfx/emoji/death.png differ diff --git a/assets/gfx/emoji/devil.png b/assets/gfx/emoji/devil.png new file mode 100644 index 00000000..d314b909 Binary files /dev/null and b/assets/gfx/emoji/devil.png differ diff --git a/assets/gfx/emoji/doctor.png b/assets/gfx/emoji/doctor.png new file mode 100644 index 00000000..7a0506ce Binary files /dev/null and b/assets/gfx/emoji/doctor.png differ diff --git a/assets/gfx/emoji/emoji.cfg b/assets/gfx/emoji/emoji.cfg new file mode 100644 index 00000000..2e40fd3b --- /dev/null +++ b/assets/gfx/emoji/emoji.cfg @@ -0,0 +1,131 @@ +gauntlet +mg +sg +gl +rl +lg +rg +pg +bfg +hook +ga +ya +ra +shard +mh +50hp +25hp +5hp +quad +regen +invis +battlesuit +flight +haste +medkit +teleporter +accuracy +assist +capture +defend +excellent +frags +humiliation +impressive +victory +anarki +biker +hossman +cadavre +bitterman +bones +crash +doom +phobos +grunt +stripe +hunter +harpy +keel +keelpm +klesk +flisk +lucy +angel +major +daemia +mynx +orbb +ranger +wrack +razor +razor-patriot +razor-id +sarge +krusade +roderic +slash +yuriko +grrl +sorlag +tankjr +tankjrpm +uriel +zael +visor +gorre +xaero +quake3 +nightmare +Zzz +hearts +nails +hi +hand-down +cringe +nerd +fuck +shit +pentagram +XD +osp2be +doctor +clown +Shhh +vomit +upside-down +stars +cyber-arm +devil +skull +brain +fire +tear +hand-up +eyes +hand-right +blackheart +yoba +smile2 +ROFL +thumbs-down +100 +lier +death +prohibited +tick +hand-left +fist +osp2 +mind-blowing +wtf +melting +moonface +666 +cross +thumbs-up +you +rainbow +smile +heart +salut \ No newline at end of file diff --git a/assets/gfx/emoji/eyes.png b/assets/gfx/emoji/eyes.png new file mode 100644 index 00000000..51145611 Binary files /dev/null and b/assets/gfx/emoji/eyes.png differ diff --git a/assets/gfx/emoji/fire.png b/assets/gfx/emoji/fire.png new file mode 100644 index 00000000..79138165 Binary files /dev/null and b/assets/gfx/emoji/fire.png differ diff --git a/assets/gfx/emoji/fist.png b/assets/gfx/emoji/fist.png new file mode 100644 index 00000000..0b65af40 Binary files /dev/null and b/assets/gfx/emoji/fist.png differ diff --git a/assets/gfx/emoji/fuck.png b/assets/gfx/emoji/fuck.png new file mode 100644 index 00000000..4a1ba02b Binary files /dev/null and b/assets/gfx/emoji/fuck.png differ diff --git a/assets/gfx/emoji/hand-down.png b/assets/gfx/emoji/hand-down.png new file mode 100644 index 00000000..2c51f63f Binary files /dev/null and b/assets/gfx/emoji/hand-down.png differ diff --git a/assets/gfx/emoji/hand-left.png b/assets/gfx/emoji/hand-left.png new file mode 100644 index 00000000..791951ac Binary files /dev/null and b/assets/gfx/emoji/hand-left.png differ diff --git a/assets/gfx/emoji/hand-right.png b/assets/gfx/emoji/hand-right.png new file mode 100644 index 00000000..f826e1c5 Binary files /dev/null and b/assets/gfx/emoji/hand-right.png differ diff --git a/assets/gfx/emoji/hand-up.png b/assets/gfx/emoji/hand-up.png new file mode 100644 index 00000000..8f68c4fa Binary files /dev/null and b/assets/gfx/emoji/hand-up.png differ diff --git a/assets/gfx/emoji/heart.png b/assets/gfx/emoji/heart.png new file mode 100644 index 00000000..d976b24e Binary files /dev/null and b/assets/gfx/emoji/heart.png differ diff --git a/assets/gfx/emoji/hearts.png b/assets/gfx/emoji/hearts.png new file mode 100644 index 00000000..532947d8 Binary files /dev/null and b/assets/gfx/emoji/hearts.png differ diff --git a/assets/gfx/emoji/hi.png b/assets/gfx/emoji/hi.png new file mode 100644 index 00000000..b73afd2f Binary files /dev/null and b/assets/gfx/emoji/hi.png differ diff --git a/assets/gfx/emoji/lier.png b/assets/gfx/emoji/lier.png new file mode 100644 index 00000000..254f7e60 Binary files /dev/null and b/assets/gfx/emoji/lier.png differ diff --git a/assets/gfx/emoji/melting.png b/assets/gfx/emoji/melting.png new file mode 100644 index 00000000..7e4cf941 Binary files /dev/null and b/assets/gfx/emoji/melting.png differ diff --git a/assets/gfx/emoji/mind-blowing.png b/assets/gfx/emoji/mind-blowing.png new file mode 100644 index 00000000..c473f1a9 Binary files /dev/null and b/assets/gfx/emoji/mind-blowing.png differ diff --git a/assets/gfx/emoji/moonface.png b/assets/gfx/emoji/moonface.png new file mode 100644 index 00000000..2da454db Binary files /dev/null and b/assets/gfx/emoji/moonface.png differ diff --git a/assets/gfx/emoji/nails.png b/assets/gfx/emoji/nails.png new file mode 100644 index 00000000..651a501c Binary files /dev/null and b/assets/gfx/emoji/nails.png differ diff --git a/assets/gfx/emoji/nerd.png b/assets/gfx/emoji/nerd.png new file mode 100644 index 00000000..9d9af947 Binary files /dev/null and b/assets/gfx/emoji/nerd.png differ diff --git a/assets/gfx/emoji/osp2.png b/assets/gfx/emoji/osp2.png new file mode 100644 index 00000000..a26b32fd Binary files /dev/null and b/assets/gfx/emoji/osp2.png differ diff --git a/assets/gfx/emoji/osp2be.png b/assets/gfx/emoji/osp2be.png new file mode 100644 index 00000000..75b72069 Binary files /dev/null and b/assets/gfx/emoji/osp2be.png differ diff --git a/assets/gfx/emoji/pentagram.png b/assets/gfx/emoji/pentagram.png new file mode 100644 index 00000000..c7f2774a Binary files /dev/null and b/assets/gfx/emoji/pentagram.png differ diff --git a/assets/gfx/emoji/prohibited.png b/assets/gfx/emoji/prohibited.png new file mode 100644 index 00000000..07a7e407 Binary files /dev/null and b/assets/gfx/emoji/prohibited.png differ diff --git a/assets/gfx/emoji/rainbow.png b/assets/gfx/emoji/rainbow.png new file mode 100644 index 00000000..d4b41ece Binary files /dev/null and b/assets/gfx/emoji/rainbow.png differ diff --git a/assets/gfx/emoji/salut.png b/assets/gfx/emoji/salut.png new file mode 100644 index 00000000..1f20b843 Binary files /dev/null and b/assets/gfx/emoji/salut.png differ diff --git a/assets/gfx/emoji/shit.png b/assets/gfx/emoji/shit.png new file mode 100644 index 00000000..4056f63f Binary files /dev/null and b/assets/gfx/emoji/shit.png differ diff --git a/assets/gfx/emoji/skull.png b/assets/gfx/emoji/skull.png new file mode 100644 index 00000000..72859272 Binary files /dev/null and b/assets/gfx/emoji/skull.png differ diff --git a/assets/gfx/emoji/smile.png b/assets/gfx/emoji/smile.png new file mode 100644 index 00000000..a2424634 Binary files /dev/null and b/assets/gfx/emoji/smile.png differ diff --git a/assets/gfx/emoji/smile2.png b/assets/gfx/emoji/smile2.png new file mode 100644 index 00000000..c3e92f50 Binary files /dev/null and b/assets/gfx/emoji/smile2.png differ diff --git a/assets/gfx/emoji/stars.png b/assets/gfx/emoji/stars.png new file mode 100644 index 00000000..dd2e331a Binary files /dev/null and b/assets/gfx/emoji/stars.png differ diff --git a/assets/gfx/emoji/tear.png b/assets/gfx/emoji/tear.png new file mode 100644 index 00000000..bf97c5a0 Binary files /dev/null and b/assets/gfx/emoji/tear.png differ diff --git a/assets/gfx/emoji/thumbs-down.png b/assets/gfx/emoji/thumbs-down.png new file mode 100644 index 00000000..dc409182 Binary files /dev/null and b/assets/gfx/emoji/thumbs-down.png differ diff --git a/assets/gfx/emoji/thumbs-up.png b/assets/gfx/emoji/thumbs-up.png new file mode 100644 index 00000000..8aa4034e Binary files /dev/null and b/assets/gfx/emoji/thumbs-up.png differ diff --git a/assets/gfx/emoji/tick.png b/assets/gfx/emoji/tick.png new file mode 100644 index 00000000..77dea2ad Binary files /dev/null and b/assets/gfx/emoji/tick.png differ diff --git a/assets/gfx/emoji/upside-down.png b/assets/gfx/emoji/upside-down.png new file mode 100644 index 00000000..f257f584 Binary files /dev/null and b/assets/gfx/emoji/upside-down.png differ diff --git a/assets/gfx/emoji/vomit.png b/assets/gfx/emoji/vomit.png new file mode 100644 index 00000000..81b59555 Binary files /dev/null and b/assets/gfx/emoji/vomit.png differ diff --git a/assets/gfx/emoji/wtf.png b/assets/gfx/emoji/wtf.png new file mode 100644 index 00000000..a65b162b Binary files /dev/null and b/assets/gfx/emoji/wtf.png differ diff --git a/assets/gfx/emoji/yoba.png b/assets/gfx/emoji/yoba.png new file mode 100644 index 00000000..096ed98c Binary files /dev/null and b/assets/gfx/emoji/yoba.png differ diff --git a/assets/gfx/emoji/you.png b/assets/gfx/emoji/you.png new file mode 100644 index 00000000..161ddc2c Binary files /dev/null and b/assets/gfx/emoji/you.png differ diff --git a/assets/scripts/emoji.shader b/assets/scripts/emoji.shader new file mode 100644 index 00000000..adc82faf --- /dev/null +++ b/assets/scripts/emoji.shader @@ -0,0 +1,1441 @@ + +gfx/emoji/gauntlet +{ + nopicmip + nomipmaps + { + map icons/iconw_gauntlet.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/mg +{ + nopicmip + nomipmaps + { + map icons/iconw_machinegun.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/sg +{ + nopicmip + nomipmaps + { + map icons/iconw_shotgun.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/gl +{ + nopicmip + nomipmaps + { + map icons/iconw_grenade.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/rl +{ + nopicmip + nomipmaps + { + map icons/iconw_rocket.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/lg +{ + nopicmip + nomipmaps + { + map icons/iconw_lightning.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/rg +{ + nopicmip + nomipmaps + { + map icons/iconw_railgun.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/pg +{ + nopicmip + nomipmaps + { + map icons/iconw_plasma.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/bfg +{ + nopicmip + nomipmaps + { + map icons/iconw_bfg.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hook +{ + nopicmip + nomipmaps + { + map icons/iconw_grapple.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/ga +{ + nopicmip + nomipmaps + { + map icons/iconr_green.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/ya +{ + nopicmip + nomipmaps + { + map icons/iconr_yellow.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/ra +{ + nopicmip + nomipmaps + { + map icons/iconr_red.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/shard +{ + nopicmip + nomipmaps + { + map icons/iconr_shard.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/mh +{ + nopicmip + nomipmaps + { + map icons/iconh_mega.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/50hp +{ + nopicmip + nomipmaps + { + map icons/iconh_red.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/25hp +{ + nopicmip + nomipmaps + { + map icons/iconh_yellow.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/5hp +{ + nopicmip + nomipmaps + { + map icons/iconh_green.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/quad +{ + nopicmip + nomipmaps + { + map icons/quad.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/regen +{ + nopicmip + nomipmaps + { + map icons/regen.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/invis +{ + nopicmip + nomipmaps + { + map icons/invis.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/battlesuit +{ + nopicmip + nomipmaps + { + map icons/envirosuit.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/flight +{ + nopicmip + nomipmaps + { + map icons/flight.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/haste +{ + nopicmip + nomipmaps + { + map icons/haste.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/medkit +{ + nopicmip + nomipmaps + { + map icons/medkit.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/teleporter +{ + nopicmip + nomipmaps + { + map icons/teleporter.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/accuracy +{ + nopicmip + nomipmaps + { + map menu/medals/medal_accuracy.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/assist +{ + nopicmip + nomipmaps + { + map menu/medals/medal_assist.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/capture +{ + nopicmip + nomipmaps + { + map menu/medals/medal_capture.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/defend +{ + nopicmip + nomipmaps + { + map menu/medals/medal_defend.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/excellent +{ + nopicmip + nomipmaps + { + map menu/medals/medal_excellent.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/frags +{ + nopicmip + nomipmaps + { + map menu/medals/medal_frags.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/humiliation +{ + nopicmip + nomipmaps + { + map menu/medals/medal_gauntlet.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/impressive +{ + nopicmip + nomipmaps + { + map menu/medals/medal_impressive.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/victory +{ + nopicmip + nomipmaps + { + map menu/medals/medal_victory.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/anarki +{ + nopicmip + nomipmaps + { + map models/players/anarki/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/biker +{ + nopicmip + nomipmaps + { + map models/players/biker/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hossman +{ + nopicmip + nomipmaps + { + map models/players/biker/icon_hossman.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/cadavre +{ + nopicmip + nomipmaps + { + map models/players/biker/icon_cadavre.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/bitterman +{ + nopicmip + nomipmaps + { + map models/players/bitterman/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/bones +{ + nopicmip + nomipmaps + { + map models/players/bones/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/crash +{ + nopicmip + nomipmaps + { + map models/players/crash/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/doom +{ + nopicmip + nomipmaps + { + map models/players/doom/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/phobos +{ + nopicmip + nomipmaps + { + map models/players/doom/icon_phobos.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/grunt +{ + nopicmip + nomipmaps + { + map models/players/grunt/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/stripe +{ + nopicmip + nomipmaps + { + map models/players/grunt/icon_stripe.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hunter +{ + nopicmip + nomipmaps + { + map models/players/hunter/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/harpy +{ + nopicmip + nomipmaps + { + map models/players/hunter/icon_harpy.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/keel +{ + nopicmip + nomipmaps + { + map models/players/keel/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/keelpm +{ + nopicmip + nomipmaps + { + map models/players/keel/icon_pm.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/klesk +{ + nopicmip + nomipmaps + { + map models/players/klesk/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/flisk +{ + nopicmip + nomipmaps + { + map models/players/klesk/icon_flisk.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/lucy +{ + nopicmip + nomipmaps + { + map models/players/lucy/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/angel +{ + nopicmip + nomipmaps + { + map models/players/lucy/icon_angel.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/major +{ + nopicmip + nomipmaps + { + map models/players/major/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/daemia +{ + nopicmip + nomipmaps + { + map models/players/major/icon_daemia.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/mynx +{ + nopicmip + nomipmaps + { + map models/players/mynx/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/orbb +{ + nopicmip + nomipmaps + { + map models/players/orbb/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/ranger +{ + nopicmip + nomipmaps + { + map models/players/ranger/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/wrack +{ + nopicmip + nomipmaps + { + map models/players/ranger/icon_wrack.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/razor +{ + nopicmip + nomipmaps + { + map models/players/razor/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/razor-patriot +{ + nopicmip + nomipmaps + { + map models/players/razor/icon_patriot.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/razor-id +{ + nopicmip + nomipmaps + { + map models/players/razor/icon_id.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/sarge +{ + nopicmip + nomipmaps + { + map models/players/sarge/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/krusade +{ + nopicmip + nomipmaps + { + map models/players/sarge/icon_krusade.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/roderic +{ + nopicmip + nomipmaps + { + map models/players/sarge/icon_roderic.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/slash +{ + nopicmip + nomipmaps + { + map models/players/slash/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/yuriko +{ + nopicmip + nomipmaps + { + map models/players/slash/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/grrl +{ + nopicmip + nomipmaps + { + map models/players/slash/icon_grrl.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/sorlag +{ + nopicmip + nomipmaps + { + map models/players/sorlag/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/tankjr +{ + nopicmip + nomipmaps + { + map models/players/tankjr/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/tankjrpm +{ + nopicmip + nomipmaps + { + map models/players/tankjr/icon_pm.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/uriel +{ + nopicmip + nomipmaps + { + map models/players/uriel/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/zael +{ + nopicmip + nomipmaps + { + map models/players/uriel/icon_zael.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/visor +{ + nopicmip + nomipmaps + { + map models/players/visor/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/gorre +{ + nopicmip + nomipmaps + { + map models/players/visor/icon_gorre.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/xaero +{ + nopicmip + nomipmaps + { + map models/players/xaero/icon_default.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/quake3 +{ + nopicmip + nomipmaps + { + map menu/art/skill4.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/nightmare +{ + nopicmip + nomipmaps + { + map menu/art/skill5.tga + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/Zzz +{ + nopicmip + nomipmaps + { + map gfx/emoji/Zzz.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hearts +{ + nopicmip + nomipmaps + { + map gfx/emoji/hearts.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/nails +{ + nopicmip + nomipmaps + { + map gfx/emoji/nails.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hi +{ + nopicmip + nomipmaps + { + map gfx/emoji/hi.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hand-down +{ + nopicmip + nomipmaps + { + map gfx/emoji/hand-down.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/cringe +{ + nopicmip + nomipmaps + { + map gfx/emoji/cringe.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/nerd +{ + nopicmip + nomipmaps + { + map gfx/emoji/nerd.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/fuck +{ + nopicmip + nomipmaps + { + map gfx/emoji/fuck.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/shit +{ + nopicmip + nomipmaps + { + map gfx/emoji/shit.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/pentagram +{ + nopicmip + nomipmaps + { + map gfx/emoji/pentagram.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/XD +{ + nopicmip + nomipmaps + { + map gfx/emoji/XD.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/osp2be +{ + nopicmip + nomipmaps + { + map gfx/emoji/osp2be.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/doctor +{ + nopicmip + nomipmaps + { + map gfx/emoji/doctor.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/clown +{ + nopicmip + nomipmaps + { + map gfx/emoji/clown.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/Shhh +{ + nopicmip + nomipmaps + { + map gfx/emoji/Shhh.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/vomit +{ + nopicmip + nomipmaps + { + map gfx/emoji/vomit.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/upside-down +{ + nopicmip + nomipmaps + { + map gfx/emoji/upside-down.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/stars +{ + nopicmip + nomipmaps + { + map gfx/emoji/stars.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/cyber-arm +{ + nopicmip + nomipmaps + { + map gfx/emoji/cyber-arm.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/devil +{ + nopicmip + nomipmaps + { + map gfx/emoji/devil.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/skull +{ + nopicmip + nomipmaps + { + map gfx/emoji/skull.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/brain +{ + nopicmip + nomipmaps + { + map gfx/emoji/brain.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/fire +{ + nopicmip + nomipmaps + { + map gfx/emoji/fire.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/tear +{ + nopicmip + nomipmaps + { + map gfx/emoji/tear.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hand-up +{ + nopicmip + nomipmaps + { + map gfx/emoji/hand-up.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/eyes +{ + nopicmip + nomipmaps + { + map gfx/emoji/eyes.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hand-right +{ + nopicmip + nomipmaps + { + map gfx/emoji/hand-right.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/blackheart +{ + nopicmip + nomipmaps + { + map gfx/emoji/blackheart.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/yoba +{ + nopicmip + nomipmaps + { + map gfx/emoji/yoba.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/smile2 +{ + nopicmip + nomipmaps + { + map gfx/emoji/smile2.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/ROFL +{ + nopicmip + nomipmaps + { + map gfx/emoji/ROFL.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/thumbs-down +{ + nopicmip + nomipmaps + { + map gfx/emoji/thumbs-down.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/100 +{ + nopicmip + nomipmaps + { + map gfx/emoji/100.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/lier +{ + nopicmip + nomipmaps + { + map gfx/emoji/lier.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/death +{ + nopicmip + nomipmaps + { + map gfx/emoji/death.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/prohibited +{ + nopicmip + nomipmaps + { + map gfx/emoji/prohibited.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/tick +{ + nopicmip + nomipmaps + { + map gfx/emoji/tick.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/hand-left +{ + nopicmip + nomipmaps + { + map gfx/emoji/hand-left.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/fist +{ + nopicmip + nomipmaps + { + map gfx/emoji/fist.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/osp2 +{ + nopicmip + nomipmaps + { + map gfx/emoji/osp2.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/mind-blowing +{ + nopicmip + nomipmaps + { + map gfx/emoji/mind-blowing.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/wtf +{ + nopicmip + nomipmaps + { + map gfx/emoji/wtf.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/melting +{ + nopicmip + nomipmaps + { + map gfx/emoji/melting.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/moonface +{ + nopicmip + nomipmaps + { + map gfx/emoji/moonface.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/666 +{ + nopicmip + nomipmaps + { + map gfx/emoji/666.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/cross +{ + nopicmip + nomipmaps + { + map gfx/emoji/cross.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/thumbs-up +{ + nopicmip + nomipmaps + { + map gfx/emoji/thumbs-up.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/you +{ + nopicmip + nomipmaps + { + map gfx/emoji/you.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/rainbow +{ + nopicmip + nomipmaps + { + map gfx/emoji/rainbow.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/smile +{ + nopicmip + nomipmaps + { + map gfx/emoji/smile.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/heart +{ + nopicmip + nomipmaps + { + map gfx/emoji/heart.png + blendfunc blend + rgbgen vertex + } +} + +gfx/emoji/salut +{ + nopicmip + nomipmaps + { + map gfx/emoji/salut.png + blendfunc blend + rgbgen vertex + } +} diff --git a/build/library/Makefile b/build/library/Makefile index cd8ee0ee..c66a30f2 100644 --- a/build/library/Makefile +++ b/build/library/Makefile @@ -344,6 +344,7 @@ CGOBJ_ = \ $(B)/$(MOD)/cgame/cg_effects.o \ $(B)/$(MOD)/cgame/cg_ents.o \ $(B)/$(MOD)/cgame/cg_event.o \ + $(B)/$(MOD)/cgame/cg_emoji.o \ $(B)/$(MOD)/cgame/cg_info.o \ $(B)/$(MOD)/cgame/cg_localents.o \ $(B)/$(MOD)/cgame/cg_localevents.o \ diff --git a/build/qvm/srcs.mk b/build/qvm/srcs.mk index 29d1f74e..e5047730 100644 --- a/build/qvm/srcs.mk +++ b/build/qvm/srcs.mk @@ -46,6 +46,7 @@ CG_SRC = \ l_crc \ cg_chatfilter cg_crosshair\ cg_cvardescriptions\ + cg_emoji\ UI_SRC = \ ui_main $(UIDIR)/ui_syscalls.asm \ diff --git a/code/cgame/cg_drawtools.c b/code/cgame/cg_drawtools.c index 24ea7cfb..0043a392 100644 --- a/code/cgame/cg_drawtools.c +++ b/code/cgame/cg_drawtools.c @@ -426,7 +426,7 @@ void CG_OSPDrawStringPrepare(const char* from, char* to, int size) } -text_command_t* CG_CompileText(const char* in) +text_command_t* CG_CompileText(const char* in, int flags) { int b; text_command_t* commands; @@ -560,6 +560,7 @@ text_command_t* CG_CompileText(const char* in) ++i; text += 8; break; + default: if ((text[1] >= '0') && (text[1] <= '9')) { @@ -573,6 +574,25 @@ text_command_t* CG_CompileText(const char* in) break; } } + else if (flags & DS_EMOJI && text[0] == EMOJI_CHAR) + { + const emoji_t* emoji = CG_OSPGetEmoji(text); + if (emoji) + { + + commands[i].type = OSP_TEXT_CMD_SHADER; + commands[i].value.shader = emoji->shader; + ++i; + text += emoji->len; + } + else + { + commands[i].type = OSP_TEXT_CMD_CHAR; + commands[i].value.character = EMOJI_CHAR; + ++i; + ++text; + } + } else { commands[i].type = OSP_TEXT_CMD_CHAR; @@ -1008,9 +1028,9 @@ static float DrawCompiledStringLength(const text_command_t* cmd, float aw, int p if (curr->type == OSP_TEXT_CMD_CHAR) { - fm = &metrics[(unsigned char)curr->value.character ]; if (proportional) { + fm = &metrics[(unsigned char)curr->value.character ]; ax += fm->space1 * aw; // add extra space if required by metrics x_end = ax + fm->space2 * aw; // final position } @@ -1024,6 +1044,13 @@ static float DrawCompiledStringLength(const text_command_t* cmd, float aw, int p ax = x_end; } + else if (curr->type == OSP_TEXT_CMD_SHADER) + { + x_end = ax + aw; + + if (x_end >= cgs.glconfig.vidWidth) + break; + } else if (curr->type == OSP_TEXT_CMD_STOP) { break; @@ -2302,9 +2329,9 @@ static float RestrictCompiledString(text_command_t* cmd, float charWidth, qboole if (curr->type == OSP_TEXT_CMD_CHAR) { - fm = &metrics[(unsigned char)curr->value.character ]; if (proportional) { + fm = &metrics[(unsigned char)curr->value.character ]; ax += fm->space1 * charWidth; // add extra space if required by metrics x_end = ax + fm->space2 * charWidth; // final position } @@ -2314,16 +2341,21 @@ static float RestrictCompiledString(text_command_t* cmd, float charWidth, qboole } ax = x_end; - if (ax >= toWidth) - { - restricted = qtrue; - break; - } + } + else if (curr->type == OSP_TEXT_CMD_SHADER) + { + ax += charWidth; } else if (curr->type == OSP_TEXT_CMD_STOP) { break; } + + if (ax >= toWidth) + { + restricted = qtrue; + break; + } } /* replace tail with "..." */ @@ -2342,6 +2374,11 @@ static float RestrictCompiledString(text_command_t* cmd, float charWidth, qboole { erased_size += GetSymbolSize(curr->value.character, proportional, charWidth); } + else if (curr->type == OSP_TEXT_CMD_SHADER) + { + erased_size += charWidth; + } + } /* second, insert "..." */ @@ -2370,7 +2407,7 @@ int CG_OSPDrawStringLenPix(const char* string, float charWidth, int flags, int t return 0; } - text_commands = CG_CompileText(string); + text_commands = CG_CompileText(string, flags); if (!text_commands) { return 0; @@ -2403,7 +2440,7 @@ void CG_OSPDrawString(float x, float y, const char* string, const vec4_t setColo return; - text_commands = CG_CompileText(string); + text_commands = CG_CompileText(string, flags); if (!text_commands) { return; @@ -2486,6 +2523,13 @@ void CG_OSPDrawString(float x, float y, const char* string, const vec4_t setColo curr = &text_commands[i]; switch (curr->type) { + case OSP_TEXT_CMD_SHADER: + // use height for width to make it square + aw1 = ah; + x_end = ax + ah; + trap_R_DrawStretchPic(ax + xx_add, ay + yy_add, aw1, ah, 0, 0, 1, 1, curr->value.shader); + ax = x_end; + break; case OSP_TEXT_CMD_CHAR: fm = &metrics[(unsigned char)curr->value.character ]; if (proportional) @@ -2550,6 +2594,24 @@ void CG_OSPDrawString(float x, float y, const char* string, const vec4_t setColo curr = &text_commands[i]; switch (curr->type) { + case OSP_TEXT_CMD_SHADER: + // use height for width to make it square + aw1 = ah; + x_end = ax + ah; + if (ax >= cgs.glconfig.vidWidth) + { + break; + } + { + vec4_t tmp_color; + Vector4Copy(colorWhite, tmp_color); + tmp_color[3] = color[3]; + trap_R_SetColor(tmp_color); + } + trap_R_DrawStretchPic(ax, ay, aw1, ah, 0, 0, 1, 1, curr->value.shader); + trap_R_SetColor(color); + ax = x_end; + break; case OSP_TEXT_CMD_CHAR: { //avoid compiler bug diff --git a/code/cgame/cg_emoji.c b/code/cgame/cg_emoji.c new file mode 100644 index 00000000..b7350118 --- /dev/null +++ b/code/cgame/cg_emoji.c @@ -0,0 +1,198 @@ +#include "cg_local.h" +#include "../qcommon/qcommon.h" + +#define CG_EMOJI_PATH "gfx/emoji" +#define CG_EMOJI_CONFIG_NAME "gfx/emoji/emoji.cfg" +#define CG_EMOJI_HASH_SIZE 512 + +typedef struct emojiTable_s emojiTable_t; + +struct emojiTable_s +{ + emoji_t emoji; + emojiTable_t* next; + emojiTable_t* prev; +}; + +static emojiTable_t* emojiTable[CG_EMOJI_HASH_SIZE]; + +const emoji_t* CG_OSPGetEmoji(const char* name) +{ + char emoji_name[MAX_STRING_CHARS]; + const char* second_colon; + int emoji_len; + emojiTable_t* target; + + // If first character not EMOJI_CHAR it is not emoji + if (name[0] != EMOJI_CHAR) + { + return NULL; + } + + second_colon = strchr(&name[1], EMOJI_CHAR); + + // Not emoji if there is no second colon or no text + if (!second_colon || second_colon - name == 1) + { + return NULL; + } + + emoji_len = second_colon - name + 1; + + // Emoji name too long + if (emoji_len > MAX_STRING_CHARS - 1) + { + return NULL; + } + + memcpy(emoji_name, name, emoji_len); + + emoji_name[emoji_len] = 0; + + Q_strlwr(emoji_name); + + target = emojiTable[Com_GenerateHashValue(emoji_name, CG_EMOJI_HASH_SIZE)]; + + while (target && Q_stricmp(emoji_name, target->emoji.name)) + { + target = target->next; + } + + if (target == NULL) + { + return NULL; + } + + return Q_stricmp(emoji_name, target->emoji.name) == 0 ? &target->emoji : NULL; +} + +void CG_OSPAddEmoji(const char* name) +{ + /* store in the hash table */ + emojiTable_t** node; + emojiTable_t* new_emoji; + char shadername[MAX_NAME_LENGTH]; + + new_emoji = (emojiTable_t*)Z_Malloc(sizeof(emojiTable_t)); + OSP_MEMORY_CHECK(new_emoji); + + Q_strncpyz(shadername, va("%s/%s", CG_EMOJI_PATH, name), MAX_NAME_LENGTH); + Q_strncpyz(new_emoji->emoji.name, va("%c%s%c", EMOJI_CHAR, name, EMOJI_CHAR), MAX_NAME_LENGTH); + + Q_strlwr(new_emoji->emoji.name); + + new_emoji->emoji.shader = trap_R_RegisterShader(shadername); + if (!new_emoji->emoji.shader) + { + CG_Printf("Couldn't load emoji token: \"%s\" shader name: \"%s\"\n", name, shadername); + Z_Free(new_emoji); + return; + } + + new_emoji->emoji.len = strlen(new_emoji->emoji.name); + + node = &emojiTable[Com_GenerateHashValue(new_emoji->emoji.name, CG_EMOJI_HASH_SIZE)]; + if (*node == NULL) + { + *node = new_emoji; + } + else + { + //collision + while ((*node)->next) + { + node = &(*node)->next; + } + new_emoji->prev = *node; + (*node)->next = new_emoji; + } +} + +static const char* CG_OSPStringFindIfChar(const char* begin, const char* end, qboolean(*pred)(char string)) +{ + while (begin < end) + { + if (pred(*begin)) + { + return begin; + } + ++begin; + } + return end; +} + +static const char* CG_OSPStringFindIfNotChar(const char* begin, const char* end, qboolean(*pred)(char string)) +{ + while (begin < end) + { + if (!pred(*begin)) + { + return begin; + } + ++begin; + } + return end; +} + +static qboolean CG_OSPEmojiIsCharAllowed(char c) +{ + return (c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == '_' + || c == '-' + ; + +} + +void CG_OSPLoadEmoji(void) +{ + char text[16384]; + const char* begin; + const char* end; + char emoji_name[MAX_INFO_VALUE]; + fileHandle_t filehandle; + int file_size; + + file_size = trap_FS_FOpenFile(CG_EMOJI_CONFIG_NAME, &filehandle, 0); + if (file_size <= 0) + { + CG_Printf("\n*** ERROR: Could not open emoji config \"%s\"\n", CG_EMOJI_CONFIG_NAME); + } + else if (file_size >= 16384) + { + CG_Printf("\n*** Emoji config file \"%s\" too big! (%d bytes, max = %d)\n", CG_EMOJI_CONFIG_NAME, file_size, 16383); + trap_FS_FCloseFile(filehandle); + } + else if (filehandle) + { + trap_FS_Read(text, file_size, filehandle); + trap_FS_FCloseFile(filehandle); + /* Split file content to strings */ + begin = &text[0]; + end = &text[file_size]; + while (begin < end) + { + const char* name_begin; + const char* name_end; + int name_size; + + name_begin = CG_OSPStringFindIfChar(begin, end, CG_OSPEmojiIsCharAllowed); + name_end = CG_OSPStringFindIfNotChar(name_begin, end, CG_OSPEmojiIsCharAllowed); + + name_size = name_end - name_begin; + if (name_size > 0) + { + memcpy(emoji_name, name_begin, name_size); + emoji_name[name_size] = 0; + CG_OSPAddEmoji(emoji_name); + } + begin = name_end; + } + } +} + + + + + diff --git a/code/cgame/cg_local.h b/code/cgame/cg_local.h index 83ac8408..36c677e8 100644 --- a/code/cgame/cg_local.h +++ b/code/cgame/cg_local.h @@ -1635,6 +1635,7 @@ typedef enum OSP_TEXT_CMD_FADE, OSP_TEXT_CMD_TEXT_COLOR, OSP_TEXT_CMD_SHADOW_COLOR, + OSP_TEXT_CMD_SHADER, } text_command_type_t; typedef struct @@ -1645,10 +1646,11 @@ typedef struct char character; float fade; vec4_t color; + qhandle_t shader; } value; } text_command_t; -text_command_t* CG_CompileText(const char* text); +text_command_t* CG_CompileText(const char* text, int flags); void CG_CompiledTextDestroy(text_command_t* root); // flags for CG_DrawString @@ -1663,6 +1665,7 @@ enum DS_HRIGHT = 0x10,// horizontal right DS_VTOP = 0x20,// vertical top DS_VCENTER = 0x40,// vertical center + DS_EMOJI = 0x80,// allow emoji }; void CG_DrawString(float x, float y, const char* string, const vec4_t setColor, float charWidth, float charHeight, int maxChars, int flags); @@ -1832,7 +1835,20 @@ void CG_PositionEntityOnTag(refEntity_t* entity, const refEntity_t* parent, void CG_PositionRotatedEntityOnTag(refEntity_t* entity, const refEntity_t* parent, qhandle_t parentModel, char* tagName); +// +// cg_emoji.c +// +// +#define EMOJI_CHAR ':' +typedef struct +{ + int len; + char name[MAX_NAME_LENGTH]; + qhandle_t shader; +} emoji_t; +void CG_OSPLoadEmoji(void); +const emoji_t* CG_OSPGetEmoji(const char* name); // // cg_weapons.c diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 4336efdc..9731f09e 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -1770,6 +1770,8 @@ int CG_Init(int serverMessageNum, int serverCommandSequence, int clientNum) // init fonts CG_LoadFonts(); + // init emoji + CG_OSPLoadEmoji(); // get the gamestate from the client system trap_GetGameState(&cgs.gameState); diff --git a/code/cgame/cg_superhud_element_chat.c b/code/cgame/cg_superhud_element_chat.c index 987fe1f0..60db3ce0 100644 --- a/code/cgame/cg_superhud_element_chat.c +++ b/code/cgame/cg_superhud_element_chat.c @@ -20,6 +20,7 @@ static void* CG_SHUDElementChatCreate(const superhudConfig_t* config, int line) element->index = line; CG_SHUDTextMakeContext(&element->config, &element->ctx); element->ctx.width = (int)config->rect.value[2]; + element->ctx.flags |= DS_EMOJI; return element; } diff --git a/code/tests/test_osp_drawstring.cxx b/code/tests/test_osp_drawstring.cxx index 92e370f9..84730b88 100644 --- a/code/tests/test_osp_drawstring.cxx +++ b/code/tests/test_osp_drawstring.cxx @@ -52,11 +52,11 @@ TEST_CASE("Prepare string", "[cgame][cg_drawtools.c]") TEST_CASE("Text compiler", "[API][cg_drawtools.c]") { Com_InitZoneMemory(); - CHECK(CG_CompileText(NULL) == NULL); - CHECK(CG_CompileText("") == NULL); + CHECK(CG_CompileText(NULL, 0) == NULL); + CHECK(CG_CompileText("", 0) == NULL); { - text_command_t *commands = CG_CompileText("text"); + text_command_t *commands = CG_CompileText("text", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -77,7 +77,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("te^fxt"); + text_command_t *commands = CG_CompileText("te^fxt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -99,7 +99,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") { cg.time = 1023; - text_command_t *commands = CG_CompileText("te^Fxt"); + text_command_t *commands = CG_CompileText("te^Fxt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -120,7 +120,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("te^bxt"); + text_command_t *commands = CG_CompileText("te^bxt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -143,7 +143,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("te^Bxt"); + text_command_t *commands = CG_CompileText("te^Bxt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -166,7 +166,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("te^Bxt^N"); + text_command_t *commands = CG_CompileText("te^Bxt^N", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -192,7 +192,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") CG_CompiledTextDestroy(commands); } { - text_command_t *commands = CG_CompileText("^13"); + text_command_t *commands = CG_CompileText("^13", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_TEXT_COLOR); @@ -206,7 +206,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("te^X00FF00x^Nt"); + text_command_t *commands = CG_CompileText("te^X00FF00x^Nt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -233,7 +233,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("^xfebd36^n^x800000Kerrazzy"); + text_command_t *commands = CG_CompileText("^xfebd36^n^x800000Kerrazzy", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_SHADOW_COLOR); @@ -250,7 +250,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") CG_CompiledTextDestroy(commands); } { - text_command_t *commands = CG_CompileText("^x990000^bx0ry"); + text_command_t *commands = CG_CompileText("^x990000^bx0ry", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_SHADOW_COLOR); @@ -266,7 +266,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") CG_CompiledTextDestroy(commands); } { - text_command_t *commands = CG_CompileText("^0test^7"); + text_command_t *commands = CG_CompileText("^0test^7", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_TEXT_COLOR); @@ -284,7 +284,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("^b ^1x^2A^1"); + text_command_t *commands = CG_CompileText("^b ^1x^2A^1", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_FADE); @@ -308,7 +308,7 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") } { - text_command_t *commands = CG_CompileText("Xaero"); + text_command_t *commands = CG_CompileText("Xaero", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); @@ -333,11 +333,11 @@ TEST_CASE("Text compiler", "[API][cg_drawtools.c]") TEST_CASE("Text compiler: bug ^^0 ", "[API][cg_drawtools.c]") { Com_InitZoneMemory(); - CHECK(CG_CompileText(NULL) == NULL); - CHECK(CG_CompileText("") == NULL); + CHECK(CG_CompileText(NULL, 0) == NULL); + CHECK(CG_CompileText("", 0) == NULL); { - text_command_t *commands = CG_CompileText("te^^0xt"); + text_command_t *commands = CG_CompileText("te^^0xt", 0); REQUIRE(commands); CHECK(commands[0].type == OSP_TEXT_CMD_CHAR); diff --git a/docs/emoji.md b/docs/emoji.md new file mode 100644 index 00000000..a0fe9042 --- /dev/null +++ b/docs/emoji.md @@ -0,0 +1,133 @@ +# Available emoji + +`:gauntlet:` +`:mg:` +`:sg:` +`:gl:` +`:rl:` +`:lg:` +`:rg:` +`:pg:` +`:bfg:` +`:hook:` +`:ga:` +`:ya:` +`:ra:` +`:shard:` +`:mh:` +`:50hp:` +`:25hp:` +`:5hp:` +`:quad:` +`:regen:` +`:invis:` +`:battlesuit:` +`:flight:` +`:haste:` +`:medkit:` +`:teleporter:` +`:accuracy:` +`:assist:` +`:capture:` +`:defend:` +`:excellent:` +`:frags:` +`:humiliation:` +`:impressive:` +`:victory:` +`:anarki:` +`:biker:` +`:hossman:` +`:cadavre:` +`:bitterman:` +`:bones:` +`:crash:` +`:doom:` +`:phobos:` +`:grunt:` +`:stripe:` +`:hunter:` +`:harpy:` +`:keel:` +`:keelpm:` +`:klesk:` +`:flisk:` +`:lucy:` +`:angel:` +`:major:` +`:daemia:` +`:mynx:` +`:orbb:` +`:ranger:` +`:wrack:` +`:razor:` +`:razor-patriot:` +`:razor-id:` +`:sarge:` +`:krusade:` +`:roderic:` +`:slash:` +`:yuriko:` +`:grrl:` +`:sorlag:` +`:tankjr:` +`:tankjrpm:` +`:uriel:` +`:zael:` +`:visor:` +`:gorre:` +`:xaero:` +`:quake3:` +`:nightmare:` +`:Zzz:` +`:hearts:` +`:nails:` +`:hi:` +`:hand-down:` +`:cringe:` +`:nerd:` +`:fuck:` +`:shit:` +`:pentagram:` +`:XD:` +`:osp2be:` +`:doctor:` +`:clown:` +`:Shhh:` +`:vomit:` +`:upside-down:` +`:stars:` +`:cyber-arm:` +`:devil:` +`:skull:` +`:brain:` +`:fire:` +`:tear:` +`:hand-up:` +`:eyes:` +`:hand-right:` +`:blackheart:` +`:yoba:` +`:smile2:` +`:ROFL:` +`:thumbs-down:` +`:100:` +`:lier:` +`:death:` +`:prohibited:` +`:tick:` +`:hand-left:` +`:fist:` +`:osp2:` +`:mind-blowing:` +`:wtf:` +`:melting:` +`:moonface:` +`:666:` +`:cross:` +`:thumbs-up:` +`:you:` +`:rainbow:` +`:smile:` +`:heart:` +`:salut:` diff --git a/tools/generate_emoji_shaders.py b/tools/generate_emoji_shaders.py new file mode 100755 index 00000000..ab7dc29d --- /dev/null +++ b/tools/generate_emoji_shaders.py @@ -0,0 +1,145 @@ +#!/usr/bin/python3 +import os + +emoji_path = '../assets/gfx/emoji/' +shader_path = '../assets/scripts/' +contents = os.listdir(emoji_path) + +emoji_built_in = [ +('gauntlet', 'icons/iconw_gauntlet.tga'), +('mg', 'icons/iconw_machinegun.tga'), +('sg', 'icons/iconw_shotgun.tga'), +('gl', 'icons/iconw_grenade.tga'), +('rl', 'icons/iconw_rocket.tga'), +('lg', 'icons/iconw_lightning.tga'), +('rg', 'icons/iconw_railgun.tga'), +('pg', 'icons/iconw_plasma.tga'), +('bfg', 'icons/iconw_bfg.tga'), +('hook', 'icons/iconw_grapple.tga'), +('ga', 'icons/iconr_green.tga'), +('ya', 'icons/iconr_yellow.tga'), +('ra', 'icons/iconr_red.tga'), +('shard', 'icons/iconr_shard.tga'), +('mh', 'icons/iconh_mega.tga'), +('50hp', 'icons/iconh_red.tga'), +('25hp', 'icons/iconh_yellow.tga'), +('5hp', 'icons/iconh_green.tga'), +('quad', 'icons/quad.tga'), +('regen', 'icons/regen.tga'), +('invis', 'icons/invis.tga'), +('battlesuit', 'icons/envirosuit.tga'), +('flight', 'icons/flight.tga'), +('haste', 'icons/haste.tga'), +('medkit', 'icons/medkit.tga'), +('teleporter', 'icons/teleporter.tga'), +('accuracy', 'menu/medals/medal_accuracy.tga'), +('assist', 'menu/medals/medal_assist.tga'), +('capture', 'menu/medals/medal_capture.tga'), +('defend', 'menu/medals/medal_defend.tga'), +('excellent', 'menu/medals/medal_excellent.tga'), +('frags', 'menu/medals/medal_frags.tga'), +('humiliation', 'menu/medals/medal_gauntlet.tga'), +('impressive', 'menu/medals/medal_impressive.tga'), +('victory', 'menu/medals/medal_victory.tga'), +('anarki', 'models/players/anarki/icon_default.tga'), +('biker', 'models/players/biker/icon_default.tga'), +('hossman', 'models/players/biker/icon_hossman.tga'), +('cadavre', 'models/players/biker/icon_cadavre.tga'), +('bitterman', 'models/players/bitterman/icon_default.tga'), +('bones', 'models/players/bones/icon_default.tga'), +('crash', 'models/players/crash/icon_default.tga'), +('doom', 'models/players/doom/icon_default.tga'), +('phobos', 'models/players/doom/icon_phobos.tga'), +('grunt', 'models/players/grunt/icon_default.tga'), +('stripe', 'models/players/grunt/icon_stripe.tga'), +('hunter', 'models/players/hunter/icon_default.tga'), +('harpy', 'models/players/hunter/icon_harpy.tga'), +('keel', 'models/players/keel/icon_default.tga'), +('keelpm', 'models/players/keel/icon_pm.tga'), +('klesk', 'models/players/klesk/icon_default.tga'), +('flisk', 'models/players/klesk/icon_flisk.tga'), +('lucy', 'models/players/lucy/icon_default.tga'), +('angel', 'models/players/lucy/icon_angel.tga'), +('major', 'models/players/major/icon_default.tga'), +('daemia', 'models/players/major/icon_daemia.tga'), +('mynx', 'models/players/mynx/icon_default.tga'), +('orbb', 'models/players/orbb/icon_default.tga'), +('ranger', 'models/players/ranger/icon_default.tga'), +('wrack', 'models/players/ranger/icon_wrack.tga'), +('razor', 'models/players/razor/icon_default.tga'), +('razor-patriot', 'models/players/razor/icon_patriot.tga'), +('razor-id', 'models/players/razor/icon_id.tga'), +('sarge', 'models/players/sarge/icon_default.tga'), +('krusade', 'models/players/sarge/icon_krusade.tga'), +('roderic', 'models/players/sarge/icon_roderic.tga'), +('slash', 'models/players/slash/icon_default.tga'), +('yuriko', 'models/players/slash/icon_default.tga'), +('grrl', 'models/players/slash/icon_grrl.tga'), +('sorlag', 'models/players/sorlag/icon_default.tga'), +('tankjr', 'models/players/tankjr/icon_default.tga'), +('tankjrpm', 'models/players/tankjr/icon_pm.tga'), +('uriel', 'models/players/uriel/icon_default.tga'), +('zael', 'models/players/uriel/icon_zael.tga'), +('visor', 'models/players/visor/icon_default.tga'), +('gorre', 'models/players/visor/icon_gorre.tga'), +('xaero', 'models/players/xaero/icon_default.tga'), +('quake3', 'menu/art/skill4.tga'), +('nightmare', 'menu/art/skill5.tga')] + +def print_shader(name, path): + return '\n'\ + 'gfx/emoji/' + name + '\n' \ + '{\n' \ + ' nopicmip\n' \ + ' nomipmaps\n' \ + ' {\n' \ + ' map ' + path + '\n'\ + ' blendfunc blend\n' \ + ' rgbgen vertex\n' \ + ' }\n' \ + '}\n' + +def print_doc(name): + return '`:' + name + ':`\n' + +files_list = [] +for item in contents: + full_path = os.path.join(emoji_path, item) + if os.path.isfile(full_path) and (full_path.endswith('.png') or full_path.endswith('.PNG')) : + files_list.append(item) + + +emoji_config = "" +emoji_shaders = "" +emoji_doc = "# Available emoji\n\n" + +# built in emoji +for name, filename in emoji_built_in: + if emoji_config: + emoji_config = emoji_config + '\n' + emoji_config = emoji_config + name + emoji_shaders = emoji_shaders + print_shader(name, filename) + emoji_doc = emoji_doc + print_doc(name) + +# emoji from files +for filename in files_list: + no_ext = filename[:-4] + if emoji_config: + emoji_config = emoji_config + '\n' + emoji_config = emoji_config + no_ext + emoji_shaders = emoji_shaders + print_shader(no_ext, 'gfx/emoji/' + filename) + emoji_doc = emoji_doc + print_doc(no_ext) + +with open(emoji_path + "emoji.cfg", 'w') as file: + file.write(emoji_config) + +with open(shader_path + "emoji.shader", 'w') as file: + file.write(emoji_shaders) + +with open('../docs/emoji.md', 'w') as file: + file.write(emoji_doc) + + + + +