/* * B_Responder */ boolean B_Responder(event_t *ev) { binding_t *bnd; int i; // We won't even bother with axis data. if(ev->type == ev_mouse || ev->type == ev_joystick) return false; // Check all the bindings and execute the necessary commands. for(i = 0, bnd = binds; i < numBinds; i++, bnd++) { // Do we need to execute the command? if(B_EventMatch(ev, &bnd->event)) { Con_Execute(bnd->command, true); // Only one binding per event, unless mouse or joystick buttons // are involved. Several bindings may match their button masks, // you see. /* if(ev->type != ev_mousebdown && ev->type != ev_mousebup && ev->type != ev_joybdown && ev->type != ev_joybup) return true; */ } } return false; }
//=========================================================================== // P_SetState // 'statenum' must be a valid state (not null!). //=========================================================================== void P_SetState(mobj_t *mobj, int statenum) { state_t *st = states + statenum; boolean spawning = (mobj->state == 0); ded_ptcgen_t *pg; #if _DEBUG if(statenum < 0 || statenum >= defs.count.states.num) Con_Error("P_SetState: statenum %i out of bounds.\n", statenum); #endif mobj->state = st; mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; // Check for a ptcgen trigger. for(pg = st->ptrigger; statenum && pg; pg = pg->state_next) { if(!(pg->flags & PGF_SPAWN_ONLY) || spawning) { // We are allowed to spawn the generator. P_SpawnParticleGen(pg, mobj); } } if(defs.states[statenum].execute) Con_Execute(defs.states[statenum].execute, true); }
DENG_EXTERN_C void R_SetupFog(float start, float end, float density, float *rgb) { Con_Execute(CMDS_DDAY, "fog on", true, false); Con_Executef(CMDS_DDAY, true, "fog start %f", start); Con_Executef(CMDS_DDAY, true, "fog end %f", end); Con_Executef(CMDS_DDAY, true, "fog density %f", density); Con_Executef(CMDS_DDAY, true, "fog color %.0f %.0f %.0f", rgb[0] * 255, rgb[1] * 255, rgb[2] * 255); }
/** * Return to default system state. */ void Sys_Shutdown(void) { // We are now shutting down. appShutdown = true; // Time to unload *everything*. if(App_GameLoaded()) Con_Execute(CMDS_DDAY, "unload", true, false); Net_Shutdown(); // Let's shut down sound first, so Windows' HD-hogging doesn't jam // the MUS player (would produce horrible bursts of notes). S_Shutdown(); #ifdef __CLIENT__ GL_Shutdown(); DD_ClearEvents(); #endif DD_DestroyGames(); }
DENG_EXTERN_C void R_SetupFogDefaults() { // Go with the defaults. Con_Execute(CMDS_DDAY,"fog off", true, false); }