コード例 #1
0
ファイル: x_api.c プロジェクト: roman313/Doomsday-Engine
/**
 * Register the game modes supported by this plugin.
 */
int G_RegisterGames(int hookType, int param, void* data)
{
#define CONFIGDIR       "hexen"
#define STARTUPPK3      PLUGIN_NAMETEXT2 ".pk3"

    GameDef const deathkingsDef = {
        "hexen-dk", CONFIGDIR,
        "Hexen: Deathkings of the Dark Citadel", "Raven Software"
    };
    GameDef const hexenDef = {
        "hexen", CONFIGDIR, "Hexen", "Raven Software"
    };
    GameDef const hexenDemoDef = {
        "hexen-demo", CONFIGDIR, "Hexen 4-map Demo", "Raven Software"
    };
    GameDef const hexenBetaDemoDef = {
        "hexen-betademo", CONFIGDIR, "Hexen 4-map Beta Demo", "Raven Software"
    };
    GameDef const hexenV10Def = {
        "hexen-v10", CONFIGDIR, "Hexen v1.0", "Raven Software"
    };

    DENG_UNUSED(hookType); DENG_UNUSED(param); DENG_UNUSED(data);

    /* Hexen (Death Kings) */
    gameIds[hexen_deathkings] = DD_DefineGame(&deathkingsDef);
    DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, FF_STARTUP, "hexdd.wad", "MAP59;MAP60");
    DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER");
    DD_AddGameResource(GID(hexen_deathkings), RC_DEFINITION, 0, "hexen-dk.ded", 0);

    /* Hexen */
    gameIds[hexen] = DD_DefineGame(&hexenDef);
    DD_AddGameResource(GID(hexen), RC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER");
    DD_AddGameResource(GID(hexen), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(hexen), RC_DEFINITION, 0, "hexen.ded", 0);

    /* Hexen (v1.0) */
    gameIds[hexen_v10] = DD_DefineGame(&hexenV10Def);
    DD_AddGameResource(GID(hexen_v10), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(hexen_v10), RC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;MAP41;TINTTAB;FOGMAP;DARTA1;ARTIPORK;SKYFOG;GROVER");
    DD_AddGameResource(GID(hexen_v10), RC_DEFINITION, 0, "hexen-v10.ded", 0);

    /* Hexen (Demo) */
    gameIds[hexen_demo] = DD_DefineGame(&hexenDemoDef);
    DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, FF_STARTUP, "hexendemo.wad;machexendemo.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;DEMO3==18150");
    DD_AddGameResource(GID(hexen_demo), RC_DEFINITION, 0, "hexen-demo.ded", 0);

    /* Hexen (Beta Demo) */
    gameIds[hexen_betademo] = DD_DefineGame(&hexenBetaDemoDef);
    DD_AddGameResource(GID(hexen_betademo), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(hexen_betademo), RC_PACKAGE, FF_STARTUP, "hexendemo.wad;machexendemo.wad;hexenbeta.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;AFLYA0;DEMO3==13866");
    DD_AddGameResource(GID(hexen_betademo), RC_DEFINITION, 0, "hexen-demo.ded", 0);

    return true;

#undef STARTUPPK3
#undef CONFIGDIR
}
コード例 #2
0
void Sys_MessageBox(messageboxtype_t type, const char* title, const char* msg, const char* detailedMsg)
{
    DENG_UNUSED(type);
    DENG_UNUSED(title);
    DENG_UNUSED(msg);
    DENG_UNUSED(detailedMsg);
}
コード例 #3
0
ファイル: net_demo.cpp プロジェクト: roman313/Doomsday-Engine
/**
 * Open a demo file and begin recording.
 * Returns false if the recording can't be begun.
 */
boolean Demo_BeginRecording(const char* fileName, int plrNum)
{
    DENG_UNUSED(fileName);
    DENG_UNUSED(plrNum);
    return false;

#if 0
    client_t* cl = &clients[plrNum];
    player_t* plr = &ddPlayers[plrNum];
    ddstring_t buf;

    // Is a demo already being recorded for this client?
    if(cl->recording || playback || (isDedicated && !plrNum) || !plr->shared.inGame)
        return false;

    // Compose the real file name.
    Str_InitStd(&buf);
    Str_Appendf(&buf, "%s%s", demoPath, fileName);
    F_ExpandBasePath(&buf, &buf);
    F_ToNativeSlashes(&buf, &buf);

    // Open the demo file.
    cl->demo = lzOpen(Str_Text(&buf), "wp");
    Str_Free(&buf);
    if(!cl->demo)
    {
        return false; // Couldn't open it!
    }

    cl->recording = true;
    cl->recordPaused = false;
    writeInfo[plrNum].first = true;
    writeInfo[plrNum].canwrite = false;
    writeInfo[plrNum].cameratimer = 0;
    writeInfo[plrNum].fov = -1; // Must be written in the first packet.

    if(isServer)
    {
        // Playing demos alters gametic. This'll make sure we're going to
        // get updates.
        clients[0].lastTransmit = -1;
        // Servers need to send a handshake packet.
        // It only needs to recorded in the demo file, though.
        allowSending = false;
        Sv_Handshake(plrNum, false);
        // Enable sending to network.
        allowSending = true;
    }
    else
    {
        // Clients need a Handshake packet.
        // Request a new one from the server.
        Cl_SendHello();
    }

    // The operation is a success.
    return true;
#endif
}
コード例 #4
0
/**
 * This function will be called ASAP after Doomsday has completed startup.
 * In this example, the function has been declared static to highlight that
 * it isn't exported from the plugin.
 *
 * @return  This operation should return non-zero if successful.
 */
static int ExampleHook(int hookType, int parm, void *data)
{
    DENG_UNUSED(hookType);
    DENG_UNUSED(parm);
    DENG_UNUSED(data);

    App_Log(DE2_LOG_DEV, "ExampleHook: Hook successful!");
    return true;
}
コード例 #5
0
static coord_t skyFixCeilZ(Plane const *frontCeil, Plane const *backCeil)
{
    DENG_UNUSED(backCeil);
    if(devRendSkyMode || P_IsInVoid(viewPlayer))
        return frontCeil->heightSmoothed();
    return frontCeil->map().skyFixCeiling();
}
コード例 #6
0
/**
 * Thread entry point for the synthesizer. Runs until the song is stopped.
 * @param parm  Not used.
 * @return Always zero.
 */
static int synthWorkThread(void* parm)
{
    DENG_UNUSED(parm);
    DENG_ASSERT(blockBuffer != 0);

    byte samples[BLOCK_SIZE];

    while(!workerShouldStop)
    {
        if(blockBuffer->availableForWriting() < BLOCK_SIZE)
        {
            // We should not or cannot produce samples right now, let's sleep for a while.
            Thread_Sleep(50);
            continue;
        }

        //DSFLUIDSYNTH_TRACE("Synthesizing next block using fsPlayer " << fsPlayer);

        // Synthesize a block of samples into our buffer.
        fluid_synth_write_s16(DMFluid_Synth(), BLOCK_SAMPLES, samples, 0, 2, samples, 1, 2);
        blockBuffer->write(samples, BLOCK_SIZE);

        //DSFLUIDSYNTH_TRACE("Block written.");
    }

    DSFLUIDSYNTH_TRACE("Synth worker dies.");
    return 0;
}
コード例 #7
0
ファイル: busymode.cpp プロジェクト: stefanbeeman/end-of-days
static void preBusySetup(int initialMode)
{
#ifdef __CLIENT__
    //ClientWindow::main().busy().renderTransitionFrame();

    // Are we doing a transition effect?
    busyWillAnimateTransition = animatedTransitionActive(initialMode);
    if(busyWillAnimateTransition)
    {
        Con_TransitionConfigure();
    }

    busyWasIgnoringInput = DD_IgnoreInput(true);

    // Load any resources needed beforehand.
    //BusyVisual_PrepareResources();

    //BusyVisual_PrepareFont();
    //BusyVisual_LoadTextures();

    // Limit frame rate to 60, no point pushing it any faster while busy.
    ClientApp::app().loop().setRate(60);   

    // Switch the window to busy mode UI.
    ClientWindowSystem::main().setMode(ClientWindow::Busy);

#else
    DENG_UNUSED(initialMode);
#endif
}
コード例 #8
0
ファイル: kdtree.c プロジェクト: cmbruns/Doomsday-Engine
static int deleteKdTreeNode(KdTreeNode *kdn, void *parameters)
{
    DENG_UNUSED(parameters);

    KdTreeNode_Delete(kdn);
    return false; // Continue iteration.
}
コード例 #9
0
ファイル: a_action.c プロジェクト: skyjake/Doomsday-Engine
dd_bool A_LocalQuake(byte* args, mobj_t* actor)
{
    mobj_t* focus, *target;
    int lastfound = 0;
    int success = false;

    DENG_UNUSED(actor);

    // Find all quake foci.
    do
    {
        if((target = P_FindMobjFromTID(args[4], &lastfound)))
        {
            if((focus = P_SpawnMobj(MT_QUAKE_FOCUS, target->origin, 0, 0)))
            {
                focus->args[0] = args[0];
                focus->args[1] = args[1] / 2; // Decremented every 2 tics.
                focus->args[2] = args[2];
                focus->args[3] = args[3];
                focus->args[4] = args[4];
                success = true;
            }
        }
    } while(target != NULL);

    return success;
}
コード例 #10
0
DENG_EXTERN_C void Plug_Notify(int notification, void* param)
{
    DENG_UNUSED(param);

#ifdef __CLIENT__
    switch(notification)
    {
    case DD_NOTIFY_GAME_SAVED:
        // If an update has been downloaded and is ready to go, we should
        // re-show the dialog now that the user has saved the game as
        // prompted.
        DEBUG_Message(("Plug_Notify: Game saved.\n"));
        Updater_RaiseCompletedDownloadDialog();
        break;
    }
#else
    DENG_UNUSED(notification);
#endif
}
コード例 #11
0
ファイル: d_api.c プロジェクト: cmbruns/Doomsday-Engine
/**
 * Register the game modes supported by this plugin.
 */
int G_RegisterGames(int hookType, int param, void* data)
{
#define CONFIGDIR       "doom64"
#define STARTUPPK3      PLUGIN_NAMETEXT2 ".pk3"

    GameDef const doom64Def = {
        "doom64", CONFIGDIR, "Doom 64", "Midway Software"
    };

    DENG_UNUSED(hookType); DENG_UNUSED(param); DENG_UNUSED(data);

    gameIds[doom64] = DD_DefineGame(&doom64Def);
    DD_AddGameResource(GID(doom64), RC_PACKAGE, FF_STARTUP, STARTUPPK3, 0);
    DD_AddGameResource(GID(doom64), RC_PACKAGE, FF_STARTUP, "doom64.wad", "MAP01;MAP020;MAP38;F_SUCK");
    DD_AddGameResource(GID(doom64), RC_DEFINITION, 0, PLUGIN_NAMETEXT ".ded", 0);
    return true;

#undef STARTUPPK3
#undef CONFIGDIR
}
コード例 #12
0
void C_DECL A_Saw(player_t *player, pspdef_t *psp)
{
    angle_t angle;
    int damage;
    float slope;

    DENG_UNUSED(psp);

    P_ShotAmmo(player);
    player->update |= PSF_AMMO;

    if(IS_CLIENT) return;

    damage = (float) (P_Random() % 10 + 1) * 2;
    angle = player->plr->mo->angle;
    angle += (P_Random() - P_Random()) << 18;

    // Use meleerange + 1 so the puff doesn't skip the flash.
    slope = P_AimLineAttack(player->plr->mo, angle, PLRMELEERANGE + 1);
    P_LineAttack(player->plr->mo, angle, PLRMELEERANGE + 1, slope, damage, MT_PUFF);

    if(!lineTarget)
    {
        S_StartSound(SFX_SAWFUL, player->plr->mo);
        return;
    }

    S_StartSound(SFX_SAWHIT, player->plr->mo);

    // Turn to face target.
    angle = M_PointToAngle2(player->plr->mo->origin, lineTarget->origin);
    if(angle - player->plr->mo->angle > ANG180)
    {
        if(angle - player->plr->mo->angle < -ANG90 / 32) // jd64 was "/ 20"
            player->plr->mo->angle = angle + ANG90 / 32; // jd64 was "/ 21"
        else
            player->plr->mo->angle -= ANG90 / 20;
    }
    else
    {
        if(angle - player->plr->mo->angle > ANG90 / 32) // jd64 was "/ 20"
            player->plr->mo->angle = angle - ANG90 / 32; // jd64 was "/ 21"
        else
            player->plr->mo->angle += ANG90 / 20;
    }
    player->plr->mo->flags |= MF_JUSTATTACKED;
}
コード例 #13
0
/**
 * Callback function for streaming out data to the SFX buffer. This is called
 * by the SFX driver when it wants more samples.
 *
 * @param buf   Buffer where the samples are being played in.
 * @param data  Data buffer for writing samples into.
 * @param size  Number of bytes to write.
 *
 * @return  Number of bytes written to @a data, or 0 if there are less than
 * the requested amount of data available.
 */
static int streamOutSamples(sfxbuffer_t* buf, void* data, unsigned int size)
{
    DENG_UNUSED(buf);
    DENG_ASSERT(buf == sfxBuf);

    if(blockBuffer->availableForReading() >= int(size))
    {
        //DSFLUIDSYNTH_TRACE("Streaming out " << size << " bytes.");
        blockBuffer->read(data, size);
        return size;
    }
    else
    {
        //DSFLUIDSYNTH_TRACE("Streaming out failed.");
        return 0; // Not enough data to fill the requested buffer.
    }
}
コード例 #14
0
void P_MobjRemove(mobj_t *mo, dd_bool noRespawn)
{
#if !defined(__JDOOM__) && !defined(__JDOOM64__)
    DENG_UNUSED(noRespawn);
#endif

    if(mo->ddFlags & DDMF_REMOTE)
        goto justDoIt;

#if __JDOOM__ || __JDOOM64__
    if(!noRespawn)
    {
        if(
# if __JDOOM__
            // Only respawn items in deathmatch 2 and optionally in coop.
           !(COMMON_GAMESESSION->rules().deathmatch != 2 &&
             (!cfg.coopRespawnItems || !IS_NETGAME || COMMON_GAMESESSION->rules().deathmatch)) &&
# endif /*#elif __JDOOM64__
           (spot->flags & MTF_RESPAWN) &&
# endif*/
           (mo->flags & MF_SPECIAL) && !(mo->flags & MF_DROPPED)
# if __JDOOM__ || __JDOOM64__
           && (mo->type != MT_INV) && (mo->type != MT_INS)
# endif
           )
        {
            P_DeferSpawnMobj3fv(RESPAWNTICS, mobjtype_t(mo->type),
                                mo->spawnSpot.origin, mo->spawnSpot.angle,
                                mo->spawnSpot.flags, P_SpawnTelefog, NULL);
        }
    }
#endif

#if __JHEXEN__
    if((mo->flags & MF_COUNTKILL) && (mo->flags & MF_CORPSE))
    {
        P_RemoveCorpseInQueue(mo);
    }

    P_MobjRemoveFromTIDList(mo);
#endif

justDoIt:
    Mobj_Destroy(mo);
}
コード例 #15
0
void Con_TransitionTicker(timespan_t t)
{
    DENG_UNUSED(t);
}
コード例 #16
0
DENG_EXTERN_C void R_ProjectSprite(struct mobj_s *mo)
{
    DENG_UNUSED(mo);
}
コード例 #17
0
static int loadPlugin(void* libraryFile, const char* fileName, const char* pluginPath, void* param)
{
    Library* plugin;
    PluginHandle* handle;
    void (*initializer)(void);
    filename_t name;
    pluginid_t plugId;

    DENG_UNUSED(libraryFile); // this is not C++...
    DENG_UNUSED(param);

    DENG_ASSERT(fileName && fileName[0]);
    DENG_ASSERT(pluginPath && pluginPath[0]);

    if(strcasestr("/bin/audio_", pluginPath))
    {
        // Do not touch audio plugins at this point.
        return true;
    }

    plugin = Library_New(pluginPath);
    if(!plugin)
    {
        Con_Message("  loadPlugin: Did not load \"%s\" (%s).", pluginPath, Library_LastError());
        return 0; // Continue iteration.
    }

    if(!strcmp(Library_Type(plugin), "deng-plugin/audio"))
    {
        // Audio plugins will be loaded later, on demand.
        Library_Delete(plugin);
        return 0;
    }

    initializer = de::function_cast<void (*)()>(Library_Symbol(plugin, "DP_Initialize"));
    if(!initializer)
    {
        DEBUG_Message(("  loadPlugin: \"%s\" does not export entrypoint DP_Initialize, ignoring.\n", pluginPath));

        // Clearly not a Doomsday plugin.
        Library_Delete(plugin);
        return 0; // Continue iteration.
    }

    // Assign a handle and ID to the plugin.
    handle = findFirstUnusedPluginHandle();
    plugId = handle - hInstPlug + 1;
    if(!handle)
    {
        DEBUG_Message(("  loadPlugin: Failed acquiring new handle for \"%s\", ignoring.\n", pluginPath));

        Library_Delete(plugin);
        return 0; // Continue iteration.
    }

    // This seems to be a Doomsday plugin.
    _splitpath(pluginPath, NULL, NULL, name, NULL);
    Con_Message("  (id:%i) %s", plugId, name);

    *handle = plugin;

    DD_SetActivePluginId(plugId);
    initializer();
    DD_SetActivePluginId(0);

    return 0; // Continue iteration.
}
コード例 #18
0
void R_SetBorderGfx(Uri const *const *paths)
{
    DENG_UNUSED(paths);
}
コード例 #19
0
void R_SkyParams(int layer, int param, void *data)
{
    DENG_UNUSED(layer);
    DENG_UNUSED(param);
    DENG_UNUSED(data);
}
コード例 #20
0
struct font_s* R_CreateFontFromDef(ded_compositefont_t* def)
{
    DENG_UNUSED(def);
    return 0;
}
コード例 #21
0
void R_RenderPlayerView(int num)
{
    DENG_UNUSED(num);
}
コード例 #22
0
void Rend_CacheForMobjType(int num)
{
    DENG_UNUSED(num);
}
コード例 #23
0
ファイル: fi_lib.c プロジェクト: cmbruns/Doomsday-Engine
int Hook_FinaleScriptStop(int hookType, int finaleId, void* parameters)
{
    gamestate_t initialGamestate;
    finale_mode_t mode;
    fi_state_t* s = stateForFinaleId(finaleId);

    DENG_UNUSED(hookType);
    DENG_UNUSED(parameters);

    if(IS_CLIENT && s == &remoteFinaleState)
    {
#ifdef _DEBUG
        Con_Message("Hook_FinaleScriptStop: Clientside script stopped, clearing remote state.");
        memset(&remoteFinaleState, 0, sizeof(remoteFinaleState));
#endif
        return true;
    }

    if(!s)
    {
        // Finale was not initiated by us...
        return true;
    }
    initialGamestate = s->initialGamestate;
    mode = s->mode;

    // Should we go back to NULL?
    if(finaleStackSize > 1)
    {   // Resume the next script on the stack.
        finaleStack = Z_Realloc(finaleStack, sizeof(*finaleStack) * --finaleStackSize, PU_GAMESTATIC);
        FI_ScriptResume(stackTop()->finaleId);
        return true;
    }

    /**
     * No more scripts are left.
     */
    Z_Free(finaleStack); finaleStack = 0;
    finaleStackSize = 0;

    // Return to the previous game state?
    if(FI_ScriptFlags(finaleId) & FF_LOCAL)
    {
        G_ChangeGameState(initialGamestate);
        return true;
    }

    // Go to the next game mode?
    if(mode == FIMODE_AFTER) // A map has been completed.
    {
        if(IS_CLIENT) return true;

        G_SetGameAction(GA_ENDDEBRIEFING);
    }
    else if(mode == FIMODE_BEFORE) // A briefing has ended.
    {
        // Its time to start the map; que music and begin!
        S_MapMusic(gameEpisode, gameMap);
        HU_WakeWidgets(-1 /* all players */);
        G_BeginMap();
        Pause_End(); // skip forced period
    }
    return true;
}
コード例 #24
0
void Rend_ConsoleResize(int force)
{
    DENG_UNUSED(force);
}
コード例 #25
0
void Rend_ConsoleMove(int y)
{
    DENG_UNUSED(y);
}
コード例 #26
0
void Rend_ConsoleOpen(int yes)
{
    DENG_UNUSED(yes);
}
コード例 #27
0
void UI_Ticker(timespan_t t)
{
    DENG_UNUSED(t);
}
コード例 #28
0
void Con_SetProgress(int progress)
{
    DENG_UNUSED(progress);
}