Beispiel #1
0
static bool tcInit(void)
{
    SDL_Init(0);

    if (setup.Debug >= ERR_DEBUG) {
        pcErrOpen(ERR_OUTPUT_TO_DISK, "debug.txt");
    } else {
        pcErrOpen(ERR_NO_OUTPUT, NULL);
    }

    InitAudio();

    StdBuffer1 = TCAllocMem(STD_BUFFER1_SIZE, true);
    StdBuffer0 = TCAllocMem(STD_BUFFER0_SIZE, true);

    if (!StdBuffer0 || !StdBuffer1) {
        return false;
    }

    if (setup.CDAudio) {
        if ((CDRomInstalled = CDROM_Install())) {
            CDROM_WaitForMedia();
            return false;
        }
    }

    gfxInit();
    SDL_WM_SetCaption("Der Clou!", NULL);

    sndInit();

    if (!(GamePlayMode & GP_NO_SAMPLES))
        sndInitFX();

    ShowIntro();

    /* Start game. */
    inpOpenAllInputDevs();

    txtInit(AutoDetectLanguage());

    AutoDetectVersion();

    InitAnimHandler();

    dbInit();
    plInit();

    gfxCollToMem(128, &StdRP0InMem);    /* cache Menu in StdRP0InMem */
    gfxCollToMem(129, &StdRP1InMem);    /* cache Bubbles in StdRP1InMem */

    CurrentBackground = BGD_LONDON;
    return true;
}
Beispiel #2
0
Player* newPlayer(World* W)
{
	Player* P = (Player*) malloc(sizeof(Player));
	plInit(P, W);
	return P;
}