コード例 #1
0
ファイル: main.cpp プロジェクト: laume17/sifteo
void main()
{

	void* buff;
	if (totalTouchCount.readObject(buff,0) <= 0)
	{
	   //no data has been saved previously
	   totalTouchCount.writeObject(0);
       LOG("\ntotalTouchCount has been written to\n");

	} else {
        LOG("\ntotalTouchCount hasn't been written to\n");
    }

    Colormap colourList;
    colourList.setEGA();
    vid.setMode(SOLID_MODE);
    vid.colormap[0].set(colourList[1].get());

    Events::cubeTouch.set(&onTouch);

    while(1)
    {
        System::paint();
        int temp = 0;
        totalTouchCount.readObject(temp,0);
        LOG("%d \n",temp);
    }

}
コード例 #2
0
ファイル: main.cpp プロジェクト: laume17/sifteo
void main()
{
    assetConfig.append(MainSlot, BetterflowAssets);
    loader.init();

    for (CubeID cube : CubeSet::connected())
    {
        onConnect(NULL, cube);
    }
    Events::cubeConnect.set(&onConnect);

    gVideo[0].setMode(BG0);

    MainMenu gameMenu(&gVideo[0]);

    int colour;
    Colormap colourList;
    colourList.setEGA();

    

    while(1)
    {
        colour = gameMenu.runMenu();

        gVideo[0].setMode(SOLID_MODE);

        gVideo[0].colormap[0].set(colourList[colour].get());
        System::paint();

        TimeStep ts;
        TimeTicker ticker = TimeTicker(1);
        int tickIncr;
        int tickCount  = 0;
        do
        {
            tickIncr = ticker.tick( ts.delta() );
            ts.next();
            tickCount += tickIncr;
        } while (tickCount < 3);

        gVideo[0].setMode(BG0);
        gVideo[0].bg0.erase(StripeTile);
    }

}