NB_CONS() { if (is<Image>(v, 2)) setSelf(v, new GLESTexture(get<Image>(v, 2), opt<GLESTextureManager>(v, 3, NULL))); else setSelf(v, new GLESTexture(get<StreamSource>(v, 2), opt<GLESTextureManager>(v, 3, NULL))); return 0; }
Connector* Connector::connect(const std::string& luaMethod, lua_Object selfIndex) { if (!mConnector) { S_LOG_WARNING("Tried to connect the lua method '" << luaMethod << "' to a non existent signal."); } else { setSelf(selfIndex); mConnector->connect(luaMethod); } return this; }
petabricks::WorkerThread::WorkerThread(DynamicScheduler& ds) : _pool(ds.pool()) { static jalib::AtomicT lastId = -1; _id = (int)jalib::atomicIncrementReturn(&lastId); _randomNumState.z = _id * _id * 2; _randomNumState.w = _id + 1; setSelf(this); _pool.insert(this); #ifdef WORKERTHREAD_ONDECK _ondeck = NULL; #endif DEBUGONLY(_isWorking=false); }
Connector* Connector::connect(lua_Object luaMethod, lua_Object selfIndex) { if (!mConnector) { S_LOG_WARNING("Tried to connect lua method to a non existent signal."); } else { setSelf(selfIndex); //we need to get the correct lua function int luaType = lua_type(getState(), -1); if (luaType == LUA_TFUNCTION) { int index = luaL_ref(getState(), LUA_REGISTRYINDEX); mConnector->connect(index); } else { S_LOG_WARNING("No valid lua function sent as argument to Connector::connect"); } } return this; }
///// Initialize levelgen specific stuff bool LuaLevelGenerator::prepareEnvironment() { if(!LuaScriptRunner::prepareEnvironment()) return false; // Set this first so we have this object available in the helper functions in case we need overrides setSelf(L, this, "levelgen"); TNLAssert(lua_gettop(L) == 0 || dumpStack(L), "Stack dirty!"); if(!loadCompileRunEnvironmentScript("timer.lua") || !loadAndRunGlobalFunction(L, LEVELGEN_HELPER_FUNCTIONS_KEY, LevelgenContext)) return false; // Stack is dirty here TNLAssert(lua_gettop(L) == 0 || dumpStack(L), "Stack dirty!"); return true; }
BasePlusCommissionEmployee2::BasePlusCommissionEmployee2(const std::string& fn, const std::string& ln, const Date& bd, const std::string& ssn, double sales, double rate, double base) { setSelf(CommissionEmployee(fn, ln, bd, ssn, sales, rate)); setSalary(base); }