Skip to content

Commit

Permalink
[desktop] remove networking part from desktop export
Browse files Browse the repository at this point in the history
  • Loading branch information
ar2rsawseen committed Sep 5, 2015
1 parent 2fd2805 commit 42ebcdd
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions player/Sources/glcanvas.cpp
Expand Up @@ -127,8 +127,10 @@ GLCanvas::~GLCanvas() {
if (status.error()) {
errorDialog_.appendString(status.errorString());
errorDialog_.show();
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
}
}
}

Expand Down Expand Up @@ -172,14 +174,13 @@ void GLCanvas::setupProperties() {

application_->setPlayerMode(isPlayer_);
application_->enableExceptions();
application_->setPrintFunc(printToServer);

//if (isPlayer_) {
if (isPlayer_) {
application_->setPrintFunc(printToServer);
server_ = new Server(15000, ::getDeviceName().c_str());

// set the global server var to use in print to server function
g_server = server_;
//}
}

running_ = false;

Expand Down Expand Up @@ -231,8 +232,10 @@ void GLCanvas::paintGL() {

errorDialog_.appendString(status.errorString());
errorDialog_.show();
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
}

application_->deinitialize();
application_->initialize();
Expand Down Expand Up @@ -271,8 +274,12 @@ void GLCanvas::timerEvent(QTimerEvent *){
printf(".");
printf("%d\n", Referenced::instanceCount);
*/
if(!projectDir_.isEmpty()){
play(QDir(projectDir_));
projectDir_.clear();
}

//if(isPlayer_){
if(isPlayer_){
int dataTotal = 0;

while(true){
Expand Down Expand Up @@ -484,7 +491,7 @@ void GLCanvas::timerEvent(QTimerEvent *){
if(dataDelta == 0 || dataTotal > 1024)
break;
}
//}
}

update();
}
Expand All @@ -503,8 +510,10 @@ void GLCanvas::play(QDir directory){
if(status.error()){
errorDialog_.appendString(status.errorString());
errorDialog_.show();
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
}
return;
}
}
Expand Down Expand Up @@ -693,8 +702,10 @@ void GLCanvas::play(QString gapp) {
if (status.error()) {
errorDialog_.appendString(status.errorString());
errorDialog_.show();
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
}
return;
}
}
Expand Down Expand Up @@ -843,8 +854,10 @@ void GLCanvas::playLoadedFiles(std::vector<std::string> luafiles) {

errorDialog_.appendString(status.errorString());
errorDialog_.show();
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(status.errorString(), -1, NULL);
printToServer("\n", -1, NULL);
}
application_->deinitialize();
application_->initialize();
}
Expand Down Expand Up @@ -1285,8 +1298,10 @@ void GLCanvas::setExportedApp(bool exportedApp) {
}

void GLCanvas::printToOutput(const char* text) {
printToServer(text, -1, NULL);
printToServer("\n", -1, NULL);
if (isPlayer_) {
printToServer(text, -1, NULL);
printToServer("\n", -1, NULL);
}
}

/*
Expand Down

0 comments on commit 42ebcdd

Please sign in to comment.