- the keybinding control works again, this time fully scripted.
This commit is contained in:
parent
2e9c1ec3f3
commit
dbf3530696
19 changed files with 161 additions and 162 deletions
|
|
@ -5069,7 +5069,6 @@ FxExpression *FxNew::Resolve(FCompileContext &ctx)
|
|||
|
||||
ExpEmit FxNew::Emit(VMFunctionBuilder *build)
|
||||
{
|
||||
assert(ValueType == val->ValueType);
|
||||
ExpEmit from = val->Emit(build);
|
||||
from.Free(build);
|
||||
ExpEmit to(build, REGT_POINTER);
|
||||
|
|
@ -10167,6 +10166,8 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
|
|||
ScriptPosition.Message(MSG_OPTERROR,
|
||||
"Unknown class name '%s' of type '%s'",
|
||||
clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -882,6 +882,9 @@ void InitThingdef()
|
|||
fieldptr = new PField("CleanHeight_1", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&CleanHeight_1);
|
||||
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||
|
||||
fieldptr = new PField("menuactive", TypeSInt32, VARF_Native | VARF_Static, (intptr_t)&menuactive);
|
||||
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||
|
||||
fieldptr = new PField("OptionMenuSettings", NewStruct("FOptionMenuSettings", nullptr), VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&OptionSettings);
|
||||
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||
|
||||
|
|
|
|||
|
|
@ -785,8 +785,11 @@ begin:
|
|||
OP(NEW_K):
|
||||
OP(NEW):
|
||||
{
|
||||
PClass *cls = (PClass*)(pc->op == OP_NEW ? reg.a[C] : konsta[C].v);
|
||||
reg.a[B] = cls->CreateNew();
|
||||
b = B;
|
||||
PClass *cls = (PClass*)(pc->op == OP_NEW ? reg.a[b] : konsta[b].v);
|
||||
if (cls->ObjectFlags & OF_Abstract) ThrowAbortException(X_OTHER, "Cannot instantiate abstract class %s", cls->TypeName.GetChars());
|
||||
reg.a[a] = cls->CreateNew();
|
||||
reg.atag[a] = ATAG_OBJECT;
|
||||
NEXTOP;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -597,6 +597,10 @@ void ZCCCompiler::CreateClassTypes()
|
|||
c->cls->Type = nullptr;
|
||||
}
|
||||
}
|
||||
if (c->cls->Flags & ZCC_Abstract)
|
||||
{
|
||||
c->Type()->ObjectFlags |= OF_Abstract;
|
||||
}
|
||||
if (c->Type() == nullptr) c->cls->Type = parent->FindClassTentative(c->NodeName());
|
||||
c->Type()->bExported = true; // this class is accessible to script side type casts. (The reason for this flag is that types like PInt need to be skipped.)
|
||||
c->cls->Symbol = new PSymbolType(c->NodeName(), c->Type());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue