| 387 | } |
| 388 | |
| 389 | int RemoteGUIHelperTCP::uploadData(const unsigned char* data, int sizeInBytes, int slot) |
| 390 | { |
| 391 | int chunkSize = 1024;// GRAPHICS_SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE; |
| 392 | int remainingBytes = sizeInBytes; |
| 393 | int offset = 0; |
| 394 | |
| 395 | GraphicsSharedMemoryCommand* cmd = m_data->getAvailableSharedMemoryCommand(); |
| 396 | cmd->m_updateFlags = 0; |
| 397 | cmd->m_type = GFX_CMD_UPLOAD_DATA; |
| 398 | cmd->m_uploadDataCommand.m_numBytes = sizeInBytes; |
| 399 | cmd->m_uploadDataCommand.m_dataOffset = offset; |
| 400 | cmd->m_uploadDataCommand.m_dataSlot = slot; |
| 401 | m_data->submitClientCommand(*cmd); |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | const GraphicsSharedMemoryStatus* status = 0; |
| 407 | while ((status = m_data->processServerStatus()) == 0) |
| 408 | { |
| 409 | } |
| 410 | |
| 411 | while (remainingBytes > 0) |
| 412 | { |
| 413 | int curBytes = btMin(remainingBytes, chunkSize); |
| 414 | m_data->m_tcpSocket.Send((const uint8*)data+offset, curBytes); |
| 415 | if (gVerboseNetworkMessagesClient3) |
| 416 | printf("sending %d bytes\n", curBytes); |
| 417 | remainingBytes -= curBytes; |
| 418 | offset += curBytes; |
| 419 | } |
| 420 | if (gVerboseNetworkMessagesClient3) |
| 421 | printf("send all bytes!\n"); |
| 422 | |
| 423 | status = 0; |
| 424 | while ((status = m_data->processServerStatus()) == 0) |
| 425 | { |
| 426 | } |
| 427 | return 0; |
| 428 | } |
| 429 | |
| 430 | int RemoteGUIHelperTCP::registerTexture(const unsigned char* texels, int width, int height) |
| 431 | { |
nothing calls this directly
no test coverage detected