123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- #include <Bildschirm.h>
- #include <RenderThread.h>
- #include <KSGScript.h>
- #include <MausEreignis.h>
- #include <TastaturEreignis.h>
- #include <Schrift.h>
- #include <DateiSystem.h>
- #include <time.h>
- #include <Textfeld.h>
- #include <Datei.h>
- #include <M2Datei.h>
- #include <Model2D.h>
- #include <Bild.h>
- #include <Textur2D.h>
- #include <MiniGameV.h>
- #include "Minigames.h"
- #include <DateiSystem.h>
- #include "DLLDateien.h"
- #include <Network.h>
- #include <Globals.h>
- #include <iostream>
- #include <string>
- #include <XML.h>
- #include <Zeit.h>
- #include <WebSocket.h>
- #include <JSON.h>
- struct HINSTANCE__;
- using namespace Framework;
- void FClose( void *p, void *zF )
- {
- StopNachrichtenSchleife( ( (WFenster*)zF )->getFensterHandle() );
- }
- Bild *b1;
- Bild *b2;
- Bild *b3;
- class Alpha : public Zeichnung
- {
- public:
- void render( Bild &zRObj )
- {
- zRObj.setDrawOptions( getPosition(), Punkt( 1000, 1000 ) );
- Bild tmp;
- tmp.neuBild( 100, 100, 0 );
- tmp.drawBild( 0, 0, 100, 100, *b1 );
- tmp.alphaBildAssoz( 0, 0, 100, 100, *b2 );
- zRObj.drawBild( 0, 0, 100, 100, tmp );
- zRObj.drawBild( 0, 150, 100, 100, *b1 );
- zRObj.drawBild( 0, 250, 100, 100, *b2 );
- zRObj.releaseDrawOptions();
- }
- };
- class Alpha2 : public Zeichnung
- {
- public:
- void render( Bild &zRObj )
- {
- zRObj.setDrawOptions( getPosition(), Punkt( 1000, 1000 ) );
- Bild tmp;
- tmp.neuBild( 100, 100, 0 );
- tmp.drawBild( 0, 0, 100, 100, *b2 );
- tmp.alphaBildAssoz( 0, 0, 100, 100, *b1 );
- zRObj.drawBild( 0, 0, 100, 100, tmp );
- zRObj.drawBild( 0, 150, 100, 100, *b2 );
- zRObj.drawBild( 0, 250, 100, 100, *b1 );
- zRObj.releaseDrawOptions();
- }
- };
- void doStuff()
- {
- /*Text test( "{\"name\": \"LARS KELLNER\", \"internal_id\": 2, \"max_inventory_size\": 29118, \"skills\": {\"WELTZAUBER 190\": {\"type\": \"WELT\", \"target_shape\": \"- AOE (RW 2)\", \"is_active\": 1, \"affects_self\": null, \"min_range\": 1, \"max_range\": 3.7, \"given_by\": \"self\", \"given_by_modifier_id\": null, \"duration_remaining\": null, \"caused_by_skill_id\": null, \"caused_by_entity_id\": null, \"enabled\": 0}, \"BLUTZAUBER 191\": {\"type\": \"BLUT\", \"target_shape\": \"EINZELZIEL\", \"is_active\": 0, \"affects_self\": 0, \"min_range\": null, \"max_range\": null, \"given_by\": \"self\", \"given_by_modifier_id\": null, \"duration_remaining\": null, \"caused_by_skill_id\": null, \"caused_by_entity_id\": null, \"enabled\": 0}, \"LUFTZAUBER 195\": {\"type\": \"LUFT\", \"target_shape\": \"O AOE (RW 1)\", \"is_active\": 1, \"affects_self\": null, \"min_range\": 0, \"max_range\": 0, \"given_by\": \"self\", \"given_by_modifier_id\": null, \"duration_remaining\": null, \"caused_by_skill_id\": null, \"caused_by_entity_id\": null, \"enabled\": 0}}, \"stats\": {\"AUSDAUER\": {\"base_value\": 117, \"current_value\": 117, \"consumable_remaining\": 237, \"max_consumable_value\": 237}, \"BLITZMAGIE\": {\"base_value\": 90, \"current_value\": 90, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"BLITZPRÄZISION\": {\"base_value\": 103, \"current_value\": 103, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"BLITZRESISTENZ\": {\"base_value\": 105, \"current_value\": 105, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"BLUTMAGIE\": {\"base_value\": 104, \"current_value\": 104, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"BLUTPRÄZISION\": {\"base_value\": 96, \"current_value\": 96, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"BLUTRESISTENZ\": {\"base_value\": 106, \"current_value\": 106, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"ENERGIE\": {\"base_value\": 95, \"current_value\": 95, \"consumable_remaining\": 191, \"max_consumable_value\": 191}, \"FEUERMAGIE\": {\"base_value\": 113, \"current_value\": 113, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"FEUERPRÄZISION\": {\"base_value\": 96, \"current_value\": 96, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"FEUERRESISTENZ\": {\"base_value\": 99, \"current_value\": 99, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"FROSTMAGIE\": {\"base_value\": 106, \"current_value\": 106, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"FROSTPRÄZISION\": {\"base_value\": 100, \"current_value\": 100, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"FROSTRESISTENZ\": {\"base_value\": 111, \"current_value\": 111, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GESCHICKLICHKEIT\": {\"base_value\": 89, \"current_value\": 89, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GESCHLECHT\": {\"base_value\": 119, \"current_value\": 119, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GESCHWINDIGKEIT\": {\"base_value\": 98, \"current_value\": 98, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GESUNDHEIT\": {\"base_value\": 86, \"current_value\": 86, \"consumable_remaining\": 174, \"max_consumable_value\": 174}, \"GIFTMAGIE\": {\"base_value\": 86, \"current_value\": 86, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GIFTPRÄZISION\": {\"base_value\": 97, \"current_value\": 97, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GIFTRESISTENZ\": {\"base_value\": 101, \"current_value\": 101, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"GRÖ�SSE\": {\"base_value\": 97, \"current_value\": 97, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"HAARFARBE\": {\"base_value\": 88, \"current_value\": 88, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"HAUTFARBE\": {\"base_value\": 108, \"current_value\": 108, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"HOLZMAGIE\": {\"base_value\": 101, \"current_value\": 101, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"HOLZPR─ZISION\": {\"base_value\": 100, \"current_value\": 100, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"HOLZRESISTENZ\": {\"base_value\": 105, \"current_value\": 105, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"INTELLIGENZ\": {\"base_value\": 108, \"current_value\": 108, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LICHTMAGIE\": {\"base_value\": 97, \"current_value\": 97, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LICHTPRÄZISION\": {\"base_value\": 89, \"current_value\": 89, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LICHTRESISTENZ\": {\"base_value\": 114, \"current_value\": 114, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LUFTMAGIE\": {\"base_value\": 97, \"current_value\": 97, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LUFTPRÄZISION\": {\"base_value\": 99, \"current_value\": 99, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"LUFTRESISTENZ\": {\"base_value\": 102, \"current_value\": 102, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"METALLMAGIE\": {\"base_value\": 113, \"current_value\": 113, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"METALLPRÄZISION\": {\"base_value\": 92, \"current_value\": 92, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"METALLRESISTENZ\": {\"base_value\": 112, \"current_value\": 112, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"MUT\": {\"base_value\": 111, \"current_value\": 111, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"SCHATTENMAGIE\": {\"base_value\": 97, \"current_value\": 97, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"SCHATTENPRÄZISION\": {\"base_value\": 100, \"current_value\": 100, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"SCHATTENRESISTENZ\": {\"base_value\": 98, \"current_value\": 98, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"STEINMAGIE\": {\"base_value\": 96, \"current_value\": 96, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"STEINPRÄZISION\": {\"base_value\": 90, \"current_value\": 90, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"STEINRESISTENZ\": {\"base_value\": 99, \"current_value\": 99, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"STÄRKE\": {\"base_value\": 85, \"current_value\": 85, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"VERSTANDMAGIE\": {\"base_value\": 101, \"current_value\": 101, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"VERSTANDPRÄZISION\": {\"base_value\": 73, \"current_value\": 73, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"VERSTANDRESISTENZ\": {\"base_value\": 92, \"current_value\": 92, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WASSERMAGIE\": {\"base_value\": 90, \"current_value\": 90, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WASSERPRÄZISION\": {\"base_value\": 101, \"current_value\": 101, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WASSERRESISTENZ\": {\"base_value\": 92, \"current_value\": 92, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WELTMAGIE\": {\"base_value\": 110, \"current_value\": 110, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WELTPRÄZISION\": {\"base_value\": 98, \"current_value\": 98, \"consumable_remaining\": null, \"max_consumable_value\": null}, \"WELTRESISTENZ\": {\"base_value\": 101, \"current_value\": 101, \"consumable_remaining\": null, \"max_consumable_value\": null}}, \"estimated_hero_value\": 1795.6557198587986, \"recruit_price\": 1795, \"movement_range\": 4, \"type\": \"HERO\", \"modifiers\": []}|" );
- ZeitMesser zm;
- zm.messungStart();
- for( int i = 0; i < 10; i++ )
- {
- std::cout << test.getText() << "\n";
- JSON::JSONObject *obj = new JSON::JSONObject( test );
- obj->release();
- }
- zm.messungEnde();
- std::cout << "Time: " << zm.getSekunden() << "\n";
- getchar();*/
- /*Network::WebSocket::WebSocketClient client( "/test", "koljastrohm-games.com", 8083 );
- client.connect();
- Text test = "{\"data\":\"test\"}";
- client.send( test.getLength(), test, Network::WebSocket::TEXT );
- client.send( test.getLength(), test, Network::WebSocket::TEXT );
- client.warteAufThread( 2000 );*/
- WFenster *f = new WFenster();
- WNDCLASS fc = F_Normal( 0 );
- fc.lpszClassName = "Test";
- f->erstellen( WS_OVERLAPPEDWINDOW, fc );
- f->setSize( 800, 500 );
- f->setPosition( Punkt( 100, 100 ) );
- f->setVSchließAktion( FClose );
- f->setMausAktion( _ret1ME );
- f->setTastaturAktion( _ret1TE );
- f->setAnzeigeModus( 1 );
- Punkt bildschirmGröße = BildschirmGröße();
- bildschirmGröße.x++;
- bildschirmGröße.y++;
- f->setSize( bildschirmGröße );
- f->setPosition( Punkt( 0, 20 ) );
- Bildschirm *b = new Bildschirm3D( f->getThis() );
- f->setBildschirm( b->getThis() );
- b->setFillFarbe( 0xFF000000 );
- b->setTestRend( 0 );
- LTDSDatei sd;
- sd.setPfad( new Text( "normal.ltds" ) );
- sd.leseDaten();
- Schrift *schrift = sd.ladeSchrift();
- DLLDateien dlls;
- Bild tmp;
- tmp.neuBild( 500, 1000, 0x30FFFFFF );
- Bild tmp2;
- tmp2.neuBild( 1900, 1000, 0x80355768 );
- ZeitMesser m;
- //while( true )
- //{
- // m.messungStart();
- // for( int i = 0; i < 2000; i++ )
- // {
- // tmp2.alphaRegion( 0, 0, 500, 1000, 0x40468349 );
- // }
- // m.messungEnde();
- // std::cout << "time: " << m.getSekunden() << "\n";
- //}
- //API *api = new API( f );
- MiniGames *mGames = new MiniGames( schrift, dlls.getThis(), b, 0 );
- b->addMember( mGames->getThis() );
- //b1 = new Bild();
- //b1->neuBild( 100, 100, 0x7F0545FF );
- //b2 = new Bild();
- //b2->neuBild( 100, 100, 0x7F79FF45 );
- //b3 = new Bild();
- //b3->neuBild( 100, 100, 0x77FF2020 );
- //Alpha *a = new Alpha();
- //a->setPosition( 0, 0 );
- //a->setSize( 100, 100 );
- //b->addMember( a );
- //Alpha2 *a2 = new Alpha2();
- //a2->setPosition( 100, 0 );
- //a2->setSize( 100, 100 );
- //b->addMember( a2 );
- RenderTh *r = new RenderTh();
- r->setBildschirm( b->getThis() );
- r->setMaxFps( 400 );
- r->setTickFunktion( []( void*p, void*o, double t )
- {
- if( getTastenStand( T_F1 ) )
- std::cout << t << "\n";
- } );
- r->beginn();
- StartNachrichtenSchleife();
- r->beenden();
- r->release();
- mGames->release();
- f->setBildschirm( 0 );
- b->release();
- f->release();
- schrift->release();
- //delete api;
- }
- int main( int argc, char *argv[] )
- {
- #ifdef _DEBUG
- _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
- #endif
- initFramework();
- Network::Start( 1 );
- /*for( int i = 1; i < argc; i++ )
- {
- std::cout << argv[ i ] << " - Version: ";
- Datei d;
- d.setDatei( argv[ i ] );
- unsigned char version[4];
- for( int j = 0; j < 4; j++ )
- version[ j ] = 0;
- if( d.open( Datei::Style::lesen ) )
- {
- d.lese( (char*)version, 4 );
- d.close();
- }
- std::cout << (int)version[ 3 ] << "." << (int)version[ 2 ] << "." << (int)version[ 1 ] << "." << (int)version[ 0 ] << " --> ";
- if( version[ 0 ] == 255 )
- {
- version[ 0 ] = 0;
- if( version[ 1 ] == 255 )
- {
- version[ 1 ] = 0;
- if( version[ 2 ] == 255 )
- {
- version[ 2 ] = 0;
- version[ 3 ]++;
- }
- else
- version[ 2 ]++;
- }
- else
- version[ 1 ]++;
- }
- else
- version[ 0 ]++;
- if( d.open( Datei::Style::schreiben ) )
- {
- d.schreibe( (char *)version, 4 );
- d.close();
- }
- std::cout << (int)version[ 3 ] << "." << (int)version[ 2 ] << "." << (int)version[ 1 ] << "." << (int)version[ 0 ] << "\n";
- }*/
- doStuff();
- Network::Exit();
- releaseFramework();
- return 0;
- }
|