Exemplo n.º 1
0
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR pScmdLine,int iCmdShow)
{
	
	SystemClass* system = nullptr;

	bool result;

	system = new SystemClass;

	if (!system)
		result = false;

	result = system->Initialize();

	if (result)
	{
		system->Run();
	}

	system->Shutdown();

	delete system;

	system = nullptr;

}
Exemplo n.º 2
0
int main()
{
	//WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)

	SystemClass* system = nullptr; // could make a static ISystemClass* variable and make ISystemClass

#ifdef _WIN32
	system = &SystemClass::GetInstance();
#endif

	if (!system)
	{
		return 0;
	}

	// Initialise and run the system object
	bool result = system->Initialise();
	if (result)
	{
		system->Run();
	}

	// Shutdown and releasr the system object.
	system->Shutdown();

	return 0;



}
Exemplo n.º 3
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	SystemClass* System;
	bool result;

	AllocConsole();
	freopen("conin$","r",stdin);
	freopen("conout$","w",stdout);
	freopen("conout$","w",stderr);
	printf("Debugging Window:\n");
	
	// Create the system object.
	System = new SystemClass;
	if(!System)
	{
		return 0;
	}

	// Initialize and run the system object.
	result = System->Initialize();
	if(result)
	{
		System->Run();
	}

	// Shutdown and release the system object.
	System->Shutdown();
	delete System;
	System = 0;

	return 0;
}
Exemplo n.º 4
0
//应用程序入口main函数
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	SystemClass* System;
	bool result;

	// 创建一个system对象.
	System = new SystemClass;
	if (!System)
	{
		return 0;
	}

	// 初始化以及运行system对象.
	result = System->Initialize();
	if (result)
	{
		System->Run();
	}

	// 关闭以及释放system对象.
	System->Shutdown();
	delete System;
	System = 0;
	return 0;
}
Exemplo n.º 5
0
int APIENTRY _tWinMain( _In_ HINSTANCE hInstance,
                        _In_opt_ HINSTANCE hPrevInstance,
                        _In_ LPTSTR    lpCmdLine,
                        _In_ int       nCmdShow )
{
    // Create the system object.
    SystemClass* pSystem = new SystemClass;
    if ( !pSystem )
    {
        return 0;
    }

    // Initialize and run the system object.
    bool bResult = pSystem->Initialize();
    if ( bResult )
    {
        pSystem->Run();
    }

    // Shutdown and release the system object.
    pSystem->Shutdown();
    delete pSystem;
    pSystem = 0;

    return 0;
}
Exemplo n.º 6
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	SystemClass* System;
	bool result;
	
	
	// Create the system object.
	System = new SystemClass;
	if(!System)
	{
		return 0;
	}

	// Initialize and run the system object.
	result = System->Initialize();
	if(result)
	{
		System->Run();
	}

	// Shutdown and release the system object.
	System->Shutdown();
	delete System;
	System = 0;

	return 0;
}
Exemplo n.º 7
0
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
	SystemClass* System;

	// 创建System类
	System = new SystemClass;

	if (!System)
	{
		return 0;
	}

	// 初始化System类,主循环
	if (System->Initialze())
	{
		System->Run();
	}

	// 删除System类
	System->Shutdown();
	delete System;
	System = NULL;

	return 0;

}
Exemplo n.º 8
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	surfCameraInstance.Init("Photo5.jpg");

	while (true) {
		surfCameraInstance.Frame();
	}

	SystemClass* System;
	bool result;
	//int counter = 0;
	
	// Create the system object.
	System = new SystemClass;
	if(!System)
	{
		return 0;
	}

	// Initialize and run the system object.
	result = System->Initialize();
	if(result)
	{
		System->Run();
	}

	// Shutdown and release the system object.
	System->Shutdown();
	delete System;
	System = 0;

	return 0;
}
Exemplo n.º 9
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
    //FILELog::ReportingLevel() = logDEBUG3;
    //FILE* log_fd = fopen( "mylogfile.txt", "w" );
    //Output2FILE::Stream() = log_fd;
    SystemClass* System; //pointer to a System object
    bool result;

    System = new SystemClass; //create new System object where the pointer is pointing

    if(!System) //if system is null
    {
        return 0;
    }

    result = System->Initialize(); //run the initialize method in the object that System is pointing at
    if(result) //if it returned true
    {
        System->Run(); //start the program loop by running Run in the object that system is pointing at
    }

    System->Shutdown(); //clean System object
    delete System; //remove system object
    System = 0; //set pointer to null

    return 0; //exit da program
}
Exemplo n.º 10
0
int CALLBACK WinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR     /*lpCmdLine*/, int       /*nCmdShow*/)
{
    SystemClass* system = nullptr;
    bool result = true;

    //Create the system object
    system = new SystemClass();
    if (!system) 
    {
        return 0;
    }

    //Initialize and run the system object
    result = system->Initialize();
    if (result)
    {
        system->Run();
    }

    //Shutdown and release the system object.
    system->Shutdown();
    delete system;
    system = 0;

    return 0;
}
Exemplo n.º 11
0
void ClassesDatas::write(QJsonObject &json) const{
    QJsonArray jsonArray;
    for (int i = 0; i < m_model->invisibleRootItem()->rowCount(); i++){
        QJsonObject jsonCommon;
        SystemClass* sysClass = ((SystemClass*)m_model->item(i)
                                 ->data().value<quintptr>());
        sysClass->write(jsonCommon);
        jsonArray.append(jsonCommon);
    }
    json["classes"] = jsonArray;
}
Exemplo n.º 12
0
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pScmdline, int iCmdshow ) {
	SystemClass* system;
	bool result;
	system = new SystemClass;
	if ( !system ) return 0;
	result = system->Initialize( );
	if ( result ) system->Run();
	system->Shutdown( );
	delete system;
	system = 0;
	return 0;
}
Exemplo n.º 13
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	/*
     HINSTANCE hInstance  : handle of the applications current instance
	 HINSTANCE hPrevInstance : handle of the applications previous instance (should be NULL according to MSDN)
	 PSTR pScmdline : commandline arguments invoked with main (we won't use this)
	 int iCmdshow : An ID that specifies how the window should be shown

	 There is also a wWinMain(...) version with the same arguments that passes unicode characters for
	 the pScmdline argument rather than ANSI as WinMain does
	*/

	SystemClass* System; //system class encapsulates our overall app
	bool result;

	/*
	Allocate a "side car" console so we can write some debug information out to it
	*/
	if(use_debug_console) AllocConsole();
	writeToDebugConsole(L"Hello World\n");

	// Create the system object.
	System = new SystemClass;
	if(!System)
	{
		return 0; //our system object did not construct properly
	}


	// Initialize our system object and run the application by asking
	// the system object to run.
	result = System->Initialize();
	if(result)
	{
		System->Run();
	}

	// Shutdown and release the system object.
	System->Shutdown(); //give system a chance to clean up
	delete System;  //release the system object's memory
	System = 0;     //set system pointer to 0 so it is no longer valid

	return 0;
}
Exemplo n.º 14
0
Arquivo: Main.cpp Projeto: alycat/DSA2
int main(int argc, char **argv )
{	
	//Get System Instance
	SystemClass* pSystem = SystemClass::GetInstance();

	//Configure System Settings
	pSystem->WindowWidth = 1280;
	pSystem->WindowHeight = 720;
	pSystem->WindowName = "Application";

	//Init System & Rendering Context
	pSystem->InitRenderingContext(&argc, argv);

	//Get Application Instance
	App = ApplicationClass::GetInstance();
	
	//Configure System Callbacks
	pSystem->Display = &Display;
	pSystem->Reshape = &Reshape;
	pSystem->Idle = &Idle;
	pSystem->Keyboard = &Keyboard;
	pSystem->KeyboardUp = &KeyboardUp;
	pSystem->OnSpecial = &OnSpecial;
	pSystem->OnSpecialUp = &OnSpecialUp;
	pSystem->Mouse = &Mouse;
	pSystem->MouseWheel = &MouseWheel;

	//Init the callback calls
	pSystem->InitCallbacks();
	
	//Start the RenderLoop
	pSystem->StartRenderLoop();
	
	//Release App Information
	delete App->m_pCamera;
	delete App;
	delete pSystem;

	//Ending the program	
	//Function = &Function0;
	//Function();

	return 0;
}
Exemplo n.º 15
0
void ClassesDatas::read(const QJsonObject &json){

    // Clear
    SuperListItem::deleteModel(m_model, false);

    // Read
    QJsonArray jsonList = json["classes"].toArray();
    QStandardItem* item;
    SystemClass* sysClass;
    for (int i = 0; i < jsonList.size(); i++){
        item = new QStandardItem;
        sysClass= new SystemClass;
        sysClass->read(jsonList[i].toObject());
        item->setData(QVariant::fromValue(
                          reinterpret_cast<quintptr>(sysClass)));
        item->setFlags(item->flags() ^ (Qt::ItemIsDropEnabled));
        item->setText(sysClass->toString());
        m_model->appendRow(item);
    }
}
Exemplo n.º 16
0
Arquivo: main.cpp Projeto: Jaymz/DX10
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdShow) {
	SystemClass* systemClass;

	bool result;

	systemClass = new SystemClass;
	if (!systemClass) {
		return 0;
	}

	result = systemClass->Initialize();
	if (result) {
		systemClass->Run();
	}

	systemClass->Shutdown();
	delete systemClass;
	systemClass = 0;

	return 0;
}
Exemplo n.º 17
0
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR pCmdLine, int iCmdShow)
{
	SystemClass* system;
	bool result;

	system = new SystemClass;
	if (!system)
	{
		return -1;
	}

	result = system->Initialize();
	if (result)
	{
		system->Run();
	}

	system->Shutdown();
	delete system;
	system = NULL;
	return 0;
}
Exemplo n.º 18
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	SystemClass* System;
	bool result;

	System = new SystemClass;

	if(!System)
	{
		return 1;
	}

	if(System->Initialize())
	{
		System->Run();
	}

	System->Shutdown();
	delete System;
	System = 0;

	return 0;
}
Exemplo n.º 19
0
int WINAPI WinMain(HINSTANCE _Instance, HINSTANCE _PrevInstance, PSTR _CommandLine, int _CommandShow)
{
	bool Result;
	SystemClass *System;

	System = new SystemClass;

	if(!System)
	{
		return 0;
	}

	Result = System->Initialize();
	if(Result)
	{
		System->Run();
	}

	System->Shutdown();
	delete System;
	System = 0;

	return 0;
}
Exemplo n.º 20
0
void ClassesDatas::setDefault(QStandardItem *modelSkills,
                              QStandardItem *modelStatistics)
{
    SystemClass* sysClass;
    QStandardItem* item;
    SuperListItem* skill;
    SuperListItem* statistic;
    SystemStatisticProgression* statisticProgression;
    SystemClassSkill* classSkill;
    QList<QStandardItem *> row;
    QStandardItemModel* skills;
    QStandardItemModel* statisticsProgression;
    QString names[] = {"Knight", "Witch", "Mage", "Ninja", "Animal"};
    int initialLevels[] = {1, 1, 1, 1, 1};
    int maxLevels[] = {100, 100, 100, 100, 100};
    int expBases[] = {5, 5, 5, 5, 5};
    int expInflations[] = {20, 20, 20, 20, 20};
    QVector<int> idsStatistics[] = {
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12})
    };
    QVector<bool> isFix[] = {
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true})
    };
    QVector<int> initialValue[] = {
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({5, 10, 10, 1, 1, 1, 1, 0, 0, 1})
    };
    QVector<int> finalValue[] = {
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200})
    };
    QVector<QString> formula[] = {
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""})
    };
    QVector<int> skillIds[] = {
        QVector<int>({6}),
        QVector<int>({7}),
        QVector<int>({8, 9, 10, 11}),
        QVector<int>({12, 13}),
        QVector<int>({})
    };
    QVector<int> skillLevels[] = {
        QVector<int>({1}),
        QVector<int>({1}),
        QVector<int>({1,1,5,10}),
        QVector<int>({1, 5}),
        QVector<int>({})
    };

    int length = (sizeof(names)/sizeof(*names));

    for (int i = 0; i < length; i++){
        // Statistics progression
        statisticsProgression = new QStandardItemModel;
        for (int j = 0; j < idsStatistics[i].size(); j++){
            statistic = SuperListItem::getById(modelStatistics, idsStatistics[i]
                [j]);
            statisticProgression = new SystemStatisticProgression(statistic->id(),
                statistic->name(), new PrimitiveValue(finalValue[i][j]), isFix
                [i][j], new SystemProgressionTable(new PrimitiveValue(
                initialValue[i][j]), new PrimitiveValue(finalValue[i][j]), 0),
                new PrimitiveValue(0), new PrimitiveValue(formula[i][j]));
            row = statisticProgression->getModelRow();
            statisticsProgression->appendRow(row);
        }
        item = new QStandardItem();
        item->setText(SuperListItem::beginningText);
        statisticsProgression->appendRow(item);

        // Skills
        skills = new QStandardItemModel;
        for (int j = 0; j < skillIds[i].size(); j++){
            skill = SuperListItem::getById(modelSkills, skillIds[i][j]);
            classSkill = new SystemClassSkill(skill->id(), skill->name(),
                                              skillLevels[i][j]);
            row = classSkill->getModelRow();
            skills->appendRow(row);
        }
        item = new QStandardItem();
        item->setText(SuperListItem::beginningText);
        skills->appendRow(item);

        sysClass = new SystemClass(i + 1, new LangsTranslation(names[i]),
            initialLevels[i], maxLevels[i], expBases[i], expInflations[i],
            statisticsProgression, skills);
        item = new QStandardItem;
        item->setData(QVariant::fromValue(
                          reinterpret_cast<quintptr>(sysClass)));
        item->setText(sysClass->toString());
        m_model->appendRow(item);
    }
}
Exemplo n.º 21
0
SuperListItem* SystemClass::createCopy() const{
    SystemClass* super = new SystemClass;
    super->setCopy(*this);
    return super;
}
Exemplo n.º 22
0
void SystemClass::staticReadyHandler()
{
	System.readyHandler();
}