Exemplo n.º 1
0
void initstuff(void)
{
    win_openwindow("Map Editor V1.26", NULL);
    win_setmousemode(MOUSE_ALWAYS_HIDDEN);
    win_fullscreen = 1;
    setscreenmode();
    kbd_init();
    mou_init();
    if (!gfx_loadsprites(SPR_FONTS, "fonts.spr"))
    {
        win_messagebox("Sprite load error (FONTS.SPR)");
        exit(1);
    }
    if (!gfx_loadsprites(SPR_EDITOR, "editor.spr"))
    {
        win_messagebox("Sprite load error (FONTS.SPR)");
        exit(1);
    }
    io_setfilemode(0); /* Rest of file access happens without datafile */
}
Exemplo n.º 2
0
void initstuff(void)
{
    FILE *handle;

    win_openwindow("Block-info Editor V1.26", NULL);
    win_fullscreen = 1;
    win_setmousemode(MOUSE_ALWAYS_HIDDEN);
    setscreenmode();
    kbd_init();
    mou_init();
    if (!gfx_loadsprites(SPR_FONTS, "fonts.spr"))
    {
        win_messagebox("Sprite load error (FONTS.SPR)");
        exit(1);
    }
    if (!gfx_loadsprites(SPR_EDITOR, "editor.spr"))
    {
        win_messagebox("Sprite load error (EDITOR.SPR)");
        exit(1);
    }
    blkinfdata = malloc((MAXBLOCKS+1)*16);
    if (!blkinfdata)
    {
        win_messagebox("No memory for blockinfotable!");
        exit(1);
    }
    memset(blkinfdata, 0, (MAXBLOCKS+1)*16);

    io_setfilemode(0); // Rest of file access happens without datafile

    gfx_loadblocks(blkname);
    gfx_loadpalette(palname);
    gfx_calcpalette(64,0,0,0);
    gfx_setpalette();
    handle = fopen(infname, "rb");
    if (!handle) return;
    fread(&blkinfdata[0], (gfx_nblocks+1) * 16, 1, handle);
    fclose(handle);
}