示例#1
0
文件: main.cpp 项目: m3rcuriel/ages
int main() {
    srand(time(0));

    terrain* map = new terrain;
    genMap(map);
    
    RiverGen gen = RiverGen(map, MAP_WIDTH, MAP_HEIGHT);
    gen.edge_fill_oceans();
    gen.find_peaks();
    gen.find_water_sources();
    gen.river_alg();
    
    int out = 1;
    
    do{
        if (out == REGEN_MAP){
            genMap( map);
    
            gen = RiverGen(map, MAP_WIDTH, MAP_HEIGHT);
            gen.edge_fill_oceans();
        }
        
        out = graphicsLoop(map);
        
    } while (out == 2);
    
    delete[] map->features;
    delete map;
    map = nullptr;
    
    return 0;
}
//-----------------------------------------------------------------
void BaseGameManager::mainLoop()
{
    TimerInterface::start();

    inputLoop();
    graphicsLoop();
    simLoop();

    sleeping();
    TimerInterface::update();
}
//-----------------------------------------------------------------
bool BaseGameManager::mainLoop()
{
    TimerInterface::start();
    inputLoop();
    graphicsLoop();
    simLoop();

    sleeping();
    TimerInterface::update();

    return running;
}