void CCharShape::PrintAction (size_t idx) const { if (idx >= numNodes) return; TCharAction *act = Nodes[idx]->action; PrintInt ((int)act->num); for (size_t i=0; i<act->num; i++) { PrintInt (act->type[i]); PrintDouble (act->dval[i]); PrintVector (act->vec[i]); } }
void CCharShape::PrintAction (int idx) { if (idx < 0 || idx >= numNodes) return; TCharAction *act = Actions[idx]; PrintInt (act->num); for (int i=0; i<act->num; i++) { PrintInt (act->type[i]); PrintDouble (act->dval[i]); PrintVector (act->vec[i]); } }
/* This function has a bit more overhead than most error functions so that it supports internationalization and thread-safe errors. */ Uint16 *SDL_GetErrorMsgUNICODE(Uint16 *errstr, unsigned int maxlen) { SDL_error *error; /* Clear the error string */ *errstr = 0; --maxlen; /* Get the thread-safe error, and print it out */ error = SDL_GetErrBuf(); if ( error->error ) { Uint16 translated[ERR_MAX_STRLEN], *fmt, *msg; int len; int argi; /* Print out the UNICODE error message */ SDL_LookupString(error->key, translated, sizeof(translated)); msg = errstr; argi = 0; for ( fmt=translated; *fmt && (maxlen > 0); ) { if ( *fmt == '%' ) { switch (fmt[1]) { case 'S': /* Special SKIP operand */ argi += (fmt[2] - '0'); ++fmt; break; case '%': *msg++ = '%'; maxlen -= 1; break; #if 0 /* What is a character anyway? (UNICODE issues) */ case 'c': *msg++ = (unsigned char) error->args[argi++].value_c; maxlen -= 1; break; #endif case 'd': len = PrintInt(msg, maxlen, error->args[argi++].value_i); msg += len; maxlen -= len; break; case 'f': len = PrintDouble(msg, maxlen, error->args[argi++].value_f); msg += len; maxlen -= len; break; case 'p': len = PrintPointer(msg, maxlen, error->args[argi++].value_ptr); msg += len; maxlen -= len; break; case 's': /* UNICODE string */ { Uint16 buf[ERR_MAX_STRLEN], *str; SDL_LookupString(error->args[argi++].buf, buf, sizeof(buf)); str = buf; while ( *str && (maxlen > 0) ) { *msg++ = *str++; maxlen -= 1; } } break; } fmt += 2; } else { *msg++ = *fmt++; maxlen -= 1; } } *msg = 0; /* NULL terminate the string */ } return(errstr); }