MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / VirtualFunctionConstant

Method VirtualFunctionConstant

neo/game/script/Script_Compiler.cpp:288–298  ·  view source on GitHub ↗

============ idCompiler::VirtualFunctionConstant Creates a def for an index into a virtual function table ============ */

Source from the content-addressed store, hash-verified

286============
287*/
288ID_INLINE idVarDef *idCompiler::VirtualFunctionConstant( idVarDef *func ) {
289 eval_t eval;
290
291 memset( &eval, 0, sizeof( eval ) );
292 eval._int = func->scope->TypeDef()->GetFunctionNumber( func->value.functionPtr );
293 if ( eval._int < 0 ) {
294 Error( "Function '%s' not found in scope '%s'", func->Name(), func->scope->Name() );
295 }
296
297 return GetImmediate( &type_virtualfunction, &eval, "" );
298}
299
300/*
301============

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.50
GetFunctionNumberMethod · 0.45
TypeDefMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected