| Index: ports/xaos/nacl-ui-driver/ui_nacl.c
|
| diff --git a/ports/xaos/nacl-ui-driver/ui_nacl.c b/ports/xaos/nacl-ui-driver/ui_nacl.c
|
| index 10b28334812e2fed0cf3223daf8998772bf0ce3b..a370a039f4fd4b3c0953e2e6478dc275de72d7d4 100644
|
| --- a/ports/xaos/nacl-ui-driver/ui_nacl.c
|
| +++ b/ports/xaos/nacl-ui-driver/ui_nacl.c
|
| @@ -5,11 +5,13 @@
|
| */
|
|
|
| #include "aconfig.h"
|
| +#include "fconfig.h"
|
|
|
| #include "ui_nacl.h"
|
|
|
| /*includes */
|
| #include <ui.h>
|
| +#include <stdarg.h>
|
| #include <stdio.h>
|
| #include <stdlib.h>
|
| #include <string.h>
|
| @@ -25,6 +27,21 @@ int kill() {
|
| return -1;
|
| }
|
|
|
| +#ifdef NDEBUG
|
| +static int log_level = LOG_INFO;
|
| +#else
|
| +static int log_level = LOG_TRACE;
|
| +#endif
|
| +
|
| +void NaClLog(int level, char* fmt, ...) {
|
| + if (level > log_level)
|
| + return;
|
| + va_list ap;
|
| + va_start(ap, fmt);
|
| + vfprintf(stderr, fmt, ap);
|
| + va_end(ap);
|
| +}
|
| +
|
| struct {
|
| void* buffers[2];
|
| int current_buffer;
|
| @@ -42,20 +59,19 @@ static void nacl_print(int x, int y, CONST char* text) {
|
|
|
| static void nacl_flush(void) {
|
| void* data = VideoBuffers.buffers[VideoBuffers.current_buffer];
|
| - NaClLog(LOG_INFO, "nacl_flush %d %p\n", VideoBuffers.current_buffer, data);
|
| + NaClLog(LOG_TRACE, "nacl_flush %d\n", VideoBuffers.current_buffer);
|
| if (!data)
|
| return;
|
| - CHECK(data != NULL);
|
| CopyImageDataToVideo(data);
|
| }
|
|
|
| static void nacl_display() {
|
| - NaClLog(LOG_INFO, "nacl_display\n");
|
| + NaClLog(LOG_TRACE, "nacl_display\n");
|
| nacl_flush();
|
| }
|
|
|
| static void nacl_flip_buffers() {
|
| - NaClLog(LOG_INFO, "nacl_flip_buffers\n");
|
| + NaClLog(LOG_TRACE, "nacl_flip_buffers\n");
|
| VideoBuffers.current_buffer ^= 1;
|
| }
|
|
|
|
|