filename | src/util.c |
changeset | 586:2a3ba82cf243 |
prev | 535:7338e020b09b |
next | 674:377d987db8f2 |
author | nkeynes |
date | Thu Feb 14 13:54:11 2008 +0000 (16 years ago) |
branch | lxdream-render |
permissions | -rw-r--r-- |
last change | Commit render work in progress. Main changes: * Preliminary OSMesa support * Move the generic gl code out to pvr2/ * Implement scene data structure + reader * Remove the 1/z adjustments |
file | annotate | diff | log | raw |
1.1 --- a/src/util.c Tue Nov 20 09:40:49 2007 +00001.2 +++ b/src/util.c Thu Feb 14 13:54:11 2008 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: util.c,v 1.14 2007-11-08 11:54:16 nkeynes Exp $1.6 + * $Id$1.7 *1.8 * Miscellaneous utility functions.1.9 *1.10 @@ -31,7 +31,7 @@1.11 #include "dream.h"1.12 #include "display.h"1.13 #include "gui.h"1.14 -#include "sh4/sh4core.h"1.15 +#include "sh4/sh4.h"1.17 char *msg_levels[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };1.18 int global_msg_level = EMIT_WARN;1.19 @@ -278,6 +278,30 @@1.20 return buffer;1.21 }1.23 +int get_log_level_from_string( const gchar *str )1.24 +{1.25 + switch( tolower(str[0]) ) {1.26 + case 'd': return EMIT_DEBUG;1.27 + case 'e': return EMIT_ERR;1.28 + case 'f': return EMIT_FATAL;1.29 + case 'i': return EMIT_INFO;1.30 + case 't': return EMIT_TRACE;1.31 + case 'w': return EMIT_WARN;1.32 + default: return -1;1.33 + }1.34 +}1.35 +1.36 +gboolean set_global_log_level( const gchar *str )1.37 +{1.38 + int l = get_log_level_from_string(str);1.39 + if( l == -1 ) {1.40 + return FALSE;1.41 + } else {1.42 + global_msg_level = l;1.43 + return TRUE;1.44 + }1.45 +}1.46 +1.47 void log_message( void *ptr, int level, const gchar *source, const char *msg, ... )1.48 {1.49 char buf[20];
.