From 700d9cef0cf6d59f85341ebae2d220e9c564e86c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 21 Mar 2013 10:20:20 +0000 Subject: [PATCH] Lunatic: slightly cleaner weapondata_t access. Also, for the embedded translator: don't warn on unrecognized command line opt. git-svn-id: https://svn.eduke32.com/eduke32@3590 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/defs.ilua | 12 ++++++------ polymer/eduke32/source/lunatic/lunacon.lua | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index ffcc33b9b..8a82e5eef 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -377,6 +377,10 @@ typedef struct { int32_t shade; } hudweapon_t; +typedef +]].. WEAPONDATA_STRUCT ..[[ +weapondata_t; + typedef ]].. PROJECTILE_STRUCT ..[[ projectile_t; @@ -394,10 +398,6 @@ typedef struct { int16_t sect; } camera_t; -typedef struct { -]] .. table.concat(con_lang.wdata_members, ';')..';' .. [[ -} weapondata_t; - enum { MAXMOUSEBUTTONS = 10, @@ -738,7 +738,7 @@ end local actor_ptr_ct = ffi.typeof("$ *", ffi.typeof(strip_const(ACTOR_STRUCT))) local player_ptr_ct = ffi.typeof("$ *", ffi.typeof(strip_const(DUKEPLAYER_STRUCT))) local projectile_ptr_ct = ffi.typeof("$ *", ffi.typeof(strip_const(PROJECTILE_STRUCT))) -local weapondata_ptr_ct = ffi.typeof("$ *", ffi.typeof(strip_const(WEAPONDATA_STRUCT))) +local weapondata_ptr_ct = ffi.typeof("$ *", ffi.typeof((strip_const(WEAPONDATA_STRUCT):gsub(" _"," ")))) local con_action_ct = ffi.typeof("con_action_t") local con_move_ct = ffi.typeof("con_move_t") local con_ai_ct = ffi.typeof("con_ai_t") @@ -936,7 +936,7 @@ local weapondata_mt = { end end - ffi.cast(weapondata_ptr_ct, wd)['_'..member] = val + ffi.cast(weapondata_ptr_ct, wd)[member] = val end, } ffi.metatype("weapondata_t", weapondata_mt) diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index 62a52991f..1cb3265c4 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -3171,7 +3171,7 @@ local function handle_cmdline_arg(str) ok = true end - if (not ok) then + if (not ffi and not ok) then printf("Warning: Unrecognized option %s", str) end end