forked from 0ad/0ad
debug_out -> debug_printf; MICROLOG moved to ps/Pyrogenesis.h
This was SVN commit r2285.
This commit is contained in:
parent
122b3aeb86
commit
fd4eb91e93
@ -175,7 +175,7 @@ bool CObjectEntry::BuildRandomVariant(CObjectBase::variation_key& vars, CObjectB
|
|||||||
if (AnimNameLC == "decay")
|
if (AnimNameLC == "decay")
|
||||||
m_CorpseAnim = m_Animations[t].m_AnimData;
|
m_CorpseAnim = m_Animations[t].m_AnimData;
|
||||||
//else
|
//else
|
||||||
// debug_out("Invalid animation name '%s'\n", (const char*)AnimNameLC);
|
// debug_printf("Invalid animation name '%s'\n", (const char*)AnimNameLC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1020,7 +1020,7 @@ void CGUI::Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile)
|
|||||||
XMBElementList children = Element.getChildNodes();
|
XMBElementList children = Element.getChildNodes();
|
||||||
for (int i=0; i<children.Count; ++i)
|
for (int i=0; i<children.Count; ++i)
|
||||||
{
|
{
|
||||||
//debug_out("Object %d\n", i);
|
//debug_printf("Object %d\n", i);
|
||||||
XMBElement child = children.item(i);
|
XMBElement child = children.item(i);
|
||||||
|
|
||||||
if (child.getNodeName() == el_script)
|
if (child.getNodeName() == el_script)
|
||||||
|
@ -518,7 +518,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, CStr &SpriteName, CRect
|
|||||||
int nBlockUse;
|
int nBlockUse;
|
||||||
long lRequest;
|
long lRequest;
|
||||||
};
|
};
|
||||||
debug_out("%d %s\n", s.pBlockHeader->lRequest, SpriteName.c_str());
|
debug_printf("%d %s\n", s.pBlockHeader->lRequest, SpriteName.c_str());
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ static void* thread_func(void* arg)
|
|||||||
const int action = rand_up_to(4);
|
const int action = rand_up_to(4);
|
||||||
const uintptr_t key = rand_up_to(100);
|
const uintptr_t key = rand_up_to(100);
|
||||||
const int sleep_duration_ms = rand_up_to(100);
|
const int sleep_duration_ms = rand_up_to(100);
|
||||||
debug_out("thread %d: %s\n", thread_number, action_strings[action]);
|
debug_printf("thread %d: %s\n", thread_number, action_strings[action]);
|
||||||
|
|
||||||
//
|
//
|
||||||
pthread_mutex_lock(&mutex);
|
pthread_mutex_lock(&mutex);
|
||||||
|
@ -86,9 +86,9 @@ void oglCheck()
|
|||||||
unsigned int err = glGetError();
|
unsigned int err = glGetError();
|
||||||
if (err != GL_NO_ERROR)
|
if (err != GL_NO_ERROR)
|
||||||
{
|
{
|
||||||
debug_out("GL errors!\n");
|
debug_printf("GL errors!\n");
|
||||||
|
|
||||||
#define E(e) case e: debug_out("%s\n", #e); break;
|
#define E(e) case e: debug_printf("%s\n", #e); break;
|
||||||
switch (err)
|
switch (err)
|
||||||
{
|
{
|
||||||
E(GL_INVALID_ENUM)
|
E(GL_INVALID_ENUM)
|
||||||
@ -107,7 +107,7 @@ void oglCheck()
|
|||||||
|
|
||||||
void oglPrintErrors()
|
void oglPrintErrors()
|
||||||
{
|
{
|
||||||
#define E(e) case e: debug_out("%s\n", #e); break;
|
#define E(e) case e: debug_printf("%s\n", #e); break;
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
switch(glGetError())
|
switch(glGetError())
|
||||||
|
@ -251,7 +251,7 @@ fail:
|
|||||||
debug_warn("file_rel_chdir failed");
|
debug_warn("file_rel_chdir failed");
|
||||||
if(msg)
|
if(msg)
|
||||||
{
|
{
|
||||||
debug_out("file_rel_chdir: %s\n", msg);
|
debug_printf("file_rel_chdir: %s\n", msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ static int file_validate(const uint line, File* f)
|
|||||||
|
|
||||||
// failed somewhere - err is the error code,
|
// failed somewhere - err is the error code,
|
||||||
// or -1 if not set specifically above.
|
// or -1 if not set specifically above.
|
||||||
debug_out("file_validate at line %d failed: %s\n", line, msg);
|
debug_printf("file_validate at line %d failed: %s\n", line, msg);
|
||||||
debug_warn("file_validate failed");
|
debug_warn("file_validate failed");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -656,7 +656,7 @@ int file_start_io(File* f, off_t ofs, size_t size, void* p, FileIO* io)
|
|||||||
memset(io, 0, sizeof(FileIO));
|
memset(io, 0, sizeof(FileIO));
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_start_io: ofs=%d size=%d\n", ofs, size);
|
debug_printf("file_start_io: ofs=%d size=%d\n", ofs, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -706,13 +706,13 @@ int file_start_io(File* f, off_t ofs, size_t size, void* p, FileIO* io)
|
|||||||
cb->aio_offset = ofs;
|
cb->aio_offset = ofs;
|
||||||
cb->aio_nbytes = size;
|
cb->aio_nbytes = size;
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_start_io: io=%p nbytes=%d\n", io, cb->aio_nbytes);
|
debug_printf("file_start_io: io=%p nbytes=%d\n", io, cb->aio_nbytes);
|
||||||
#endif
|
#endif
|
||||||
int err = lio_listio(LIO_NOWAIT, &cb, 1, (struct sigevent*)0);
|
int err = lio_listio(LIO_NOWAIT, &cb, 1, (struct sigevent*)0);
|
||||||
if(err < 0)
|
if(err < 0)
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_start_io: lio_listio: %d, %d[%s]\n", err, errno, strerror(errno));
|
debug_printf("file_start_io: lio_listio: %d, %d[%s]\n", err, errno, strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
file_discard_io(io);
|
file_discard_io(io);
|
||||||
return err;
|
return err;
|
||||||
@ -741,7 +741,7 @@ int file_io_complete(FileIO* io)
|
|||||||
int file_wait_io(FileIO* io, void*& p, size_t& size)
|
int file_wait_io(FileIO* io, void*& p, size_t& size)
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_wait_io: hio=%p\n", io);
|
debug_printf("file_wait_io: hio=%p\n", io);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// zero output params in case something (e.g. H_DEREF) fails.
|
// zero output params in case something (e.g. H_DEREF) fails.
|
||||||
@ -758,7 +758,7 @@ debug_out("file_wait_io: hio=%p\n", io);
|
|||||||
// query number of bytes transferred (-1 if the transfer failed)
|
// query number of bytes transferred (-1 if the transfer failed)
|
||||||
const ssize_t bytes_transferred = aio_return(cb);
|
const ssize_t bytes_transferred = aio_return(cb);
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_wait_io: bytes_transferred=%d aio_nbytes=%d\n",
|
debug_printf("file_wait_io: bytes_transferred=%d aio_nbytes=%d\n",
|
||||||
bytes_transferred, cb->aio_nbytes);
|
bytes_transferred, cb->aio_nbytes);
|
||||||
#endif
|
#endif
|
||||||
// (size was clipped to EOF in file_io => this is an actual IO error)
|
// (size was clipped to EOF in file_io => this is an actual IO error)
|
||||||
@ -909,7 +909,7 @@ static ssize_t block_issue(File* f, IOSlot* slot, const off_t issue_ofs, void* b
|
|||||||
if(slot->cached_block)
|
if(slot->cached_block)
|
||||||
goto skip_issue;
|
goto skip_issue;
|
||||||
|
|
||||||
//debug_out("%x miss\n", issue_ofs);
|
//debug_printf("%x miss\n", issue_ofs);
|
||||||
|
|
||||||
// allocate temp buffer
|
// allocate temp buffer
|
||||||
if(!buf)
|
if(!buf)
|
||||||
@ -977,7 +977,7 @@ ssize_t file_io(File* f, off_t data_ofs, size_t data_size, void* data_buf,
|
|||||||
FileIOCB cb, uintptr_t ctx) // optional
|
FileIOCB cb, uintptr_t ctx) // optional
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_io fd=%d size=%d ofs=%d\n", f->fd, data_size, data_ofs);
|
debug_printf("file_io fd=%d size=%d ofs=%d\n", f->fd, data_size, data_ofs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CHECK_FILE(f);
|
CHECK_FILE(f);
|
||||||
@ -1084,7 +1084,7 @@ debug_out("file_io fd=%d size=%d ofs=%d\n", f->fd, data_size, data_ofs);
|
|||||||
void* buf = (temp)? 0 : (char*)actual_buf + issue_cnt;
|
void* buf = (temp)? 0 : (char*)actual_buf + issue_cnt;
|
||||||
ssize_t issued = block_issue(f, slot, issue_ofs, buf);
|
ssize_t issued = block_issue(f, slot, issue_ofs, buf);
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_io: block_issue: %d\n", issued);
|
debug_printf("file_io: block_issue: %d\n", issued);
|
||||||
#endif
|
#endif
|
||||||
if(issued < 0)
|
if(issued < 0)
|
||||||
err = issued;
|
err = issued;
|
||||||
@ -1176,7 +1176,7 @@ if(from_cache && !temp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("file_io: err=%d, actual_transferred_cnt=%d\n", err, actual_transferred_cnt);
|
debug_printf("file_io: err=%d, actual_transferred_cnt=%d\n", err, actual_transferred_cnt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// failed (0 means callback reports it's finished)
|
// failed (0 means callback reports it's finished)
|
||||||
|
@ -380,7 +380,7 @@ static void remove_key(uintptr_t key, H_Type type)
|
|||||||
// currently cannot fail.
|
// currently cannot fail.
|
||||||
static int h_free_idx(i32 idx, HDATA* hd)
|
static int h_free_idx(i32 idx, HDATA* hd)
|
||||||
{
|
{
|
||||||
// debug_out("free %s %s\n", type->name, hd->fn);
|
// debug_printf("free %s %s\n", type->name, hd->fn);
|
||||||
|
|
||||||
// only decrement if refcount not already 0.
|
// only decrement if refcount not already 0.
|
||||||
if(hd->refs > 0)
|
if(hd->refs > 0)
|
||||||
@ -448,7 +448,7 @@ void h_mgr_shutdown()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// if(hd->refs != 0)
|
// if(hd->refs != 0)
|
||||||
// debug_out("leaked %s from %s\n", hd->type->name, hd->fn);
|
// debug_printf("leaked %s from %s\n", hd->type->name, hd->fn);
|
||||||
|
|
||||||
// disable caching; we need to release the resource now.
|
// disable caching; we need to release the resource now.
|
||||||
hd->keep_open = 0;
|
hd->keep_open = 0;
|
||||||
@ -519,7 +519,7 @@ Handle h_alloc(H_Type type, const char* fn, uint flags, ...)
|
|||||||
key = fnv_hash(fn);
|
key = fnv_hash(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug_out("alloc %s %s\n", type->name, fn);
|
//debug_printf("alloc %s %s\n", type->name, fn);
|
||||||
|
|
||||||
// no key => can never be found. disallow caching
|
// no key => can never be found. disallow caching
|
||||||
if(!key)
|
if(!key)
|
||||||
|
@ -110,7 +110,7 @@ static void al_check(const char* caller = "(unknown)")
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const char* str = (const char*)alGetString(err);
|
const char* str = (const char*)alGetString(err);
|
||||||
debug_out("openal error: %s; called from %s\n", str, caller);
|
debug_printf("openal error: %s; called from %s\n", str, caller);
|
||||||
debug_warn("OpenAL error");
|
debug_warn("OpenAL error");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ static int alc_init()
|
|||||||
ALCenum err = alcGetError(alc_dev);
|
ALCenum err = alcGetError(alc_dev);
|
||||||
if(err != ALC_NO_ERROR || !alc_dev || !alc_ctx)
|
if(err != ALC_NO_ERROR || !alc_dev || !alc_ctx)
|
||||||
{
|
{
|
||||||
debug_out("alc_init failed. alc_dev=%p alc_ctx=%p alc_dev_name=%s err=%d\n", alc_dev, alc_ctx, alc_dev_name, err);
|
debug_printf("alc_init failed. alc_dev=%p alc_ctx=%p alc_dev_name=%s err=%d\n", alc_dev, alc_ctx, alc_dev_name, err);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ static int dds_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
{
|
{
|
||||||
err = "header not completely read";
|
err = "header not completely read";
|
||||||
fail:
|
fail:
|
||||||
debug_out("dds_decode: %s: %s\n", fn, err);
|
debug_printf("dds_decode: %s: %s\n", fn, err);
|
||||||
return ERR_CORRUPTED;
|
return ERR_CORRUPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ static int tga_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
{
|
{
|
||||||
err = "header not completely read";
|
err = "header not completely read";
|
||||||
fail:
|
fail:
|
||||||
debug_out("tga_decode: %s: %s\n", fn, err);
|
debug_printf("tga_decode: %s: %s\n", fn, err);
|
||||||
return ERR_CORRUPTED;
|
return ERR_CORRUPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ static int bmp_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
{
|
{
|
||||||
err = "header not completely read";
|
err = "header not completely read";
|
||||||
fail:
|
fail:
|
||||||
debug_out("bmp_decode: %s: %s\n", fn, err);
|
debug_printf("bmp_decode: %s: %s\n", fn, err);
|
||||||
return ERR_CORRUPTED;
|
return ERR_CORRUPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -873,7 +873,7 @@ static int raw_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_out("raw_decode: %s: %s\n", fn, "no matching format found");
|
debug_printf("raw_decode: %s: %s\n", fn, "no matching format found");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -975,7 +975,7 @@ static int png_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
fail:
|
fail:
|
||||||
mem_free(img);
|
mem_free(img);
|
||||||
|
|
||||||
debug_out("png_decode: %s: %s\n", fn, msg? msg : "unknown");
|
debug_printf("png_decode: %s: %s\n", fn, msg? msg : "unknown");
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1090,7 +1090,7 @@ static int png_encode(TexInfo* t, const char* fn, u8* img, size_t img_size)
|
|||||||
if(setjmp(png_jmpbuf(png_ptr)))
|
if(setjmp(png_jmpbuf(png_ptr)))
|
||||||
{
|
{
|
||||||
fail:
|
fail:
|
||||||
debug_out("png_encode: %s: %s\n", fn, msg? msg : "unknown");
|
debug_printf("png_encode: %s: %s\n", fn, msg? msg : "unknown");
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1204,7 +1204,7 @@ static int jp2_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
err = "channel precision != 8";
|
err = "channel precision != 8";
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
debug_out("jp2_decode: %s: %s\n", fn, err);
|
debug_printf("jp2_decode: %s: %s\n", fn, err);
|
||||||
// TODO: destroy image
|
// TODO: destroy image
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1311,7 +1311,7 @@ METHODDEF(void) jpg_error_exit(j_common_ptr cinfo)
|
|||||||
JpgErrMgr* err_mgr = (JpgErrMgr*)cinfo->err;
|
JpgErrMgr* err_mgr = (JpgErrMgr*)cinfo->err;
|
||||||
|
|
||||||
// "output" error message (i.e. store in JpgErrMgr;
|
// "output" error message (i.e. store in JpgErrMgr;
|
||||||
// call_site is responsible for displaying it via debug_out)
|
// call_site is responsible for displaying it via debug_printf)
|
||||||
(*cinfo->err->output_message)(cinfo);
|
(*cinfo->err->output_message)(cinfo);
|
||||||
|
|
||||||
// jump back to call site, i.e. jpg_(de|en)code
|
// jump back to call site, i.e. jpg_(de|en)code
|
||||||
@ -1373,7 +1373,7 @@ static int jpg_decode(TexInfo* t, const char* fn, u8* file, size_t file_size)
|
|||||||
fail:
|
fail:
|
||||||
// either JPEG has raised an error, or code below failed.
|
// either JPEG has raised an error, or code below failed.
|
||||||
// warn user, and skip to cleanup code.
|
// warn user, and skip to cleanup code.
|
||||||
debug_out("jpg_decode: %s: %s\n", fn, msg? msg : "unknown");
|
debug_printf("jpg_decode: %s: %s\n", fn, msg? msg : "unknown");
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1469,7 +1469,7 @@ fail:
|
|||||||
// is not possible with the mem data source.
|
// is not possible with the mem data source.
|
||||||
|
|
||||||
if(jerr.pub.num_warnings != 0)
|
if(jerr.pub.num_warnings != 0)
|
||||||
debug_out("jpg_decode: corrupt-data warning(s) occurred\n");
|
debug_printf("jpg_decode: corrupt-data warning(s) occurred\n");
|
||||||
|
|
||||||
// store image info
|
// store image info
|
||||||
mem_free_h(t->hm);
|
mem_free_h(t->hm);
|
||||||
@ -1531,7 +1531,7 @@ static int jpg_encode(TexInfo* t, const char* fn, u8* img, size_t img_size)
|
|||||||
fail:
|
fail:
|
||||||
// either JPEG has raised an error, or code below failed.
|
// either JPEG has raised an error, or code below failed.
|
||||||
// warn user, and skip to cleanup code.
|
// warn user, and skip to cleanup code.
|
||||||
debug_out("jpg_encode: %s: %s\n", fn, msg? msg : "unknown");
|
debug_printf("jpg_encode: %s: %s\n", fn, msg? msg : "unknown");
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1600,7 +1600,7 @@ fail:
|
|||||||
jpeg_finish_compress(&cinfo);
|
jpeg_finish_compress(&cinfo);
|
||||||
|
|
||||||
if(jerr.pub.num_warnings != 0)
|
if(jerr.pub.num_warnings != 0)
|
||||||
debug_out("jpg_encode: corrupt-data warning(s) occurred\n");
|
debug_printf("jpg_encode: corrupt-data warning(s) occurred\n");
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ void glvwprintf(const wchar_t* fmt, va_list args)
|
|||||||
wchar_t buf[buf_size];
|
wchar_t buf[buf_size];
|
||||||
|
|
||||||
if(vswprintf(buf, buf_size-1, fmt, args) < 0)
|
if(vswprintf(buf, buf_size-1, fmt, args) < 0)
|
||||||
debug_out("glwprintf failed (buffer size exceeded?)\n");
|
debug_printf("glwprintf failed (buffer size exceeded?)\n");
|
||||||
|
|
||||||
// Make sure there's always null termination
|
// Make sure there's always null termination
|
||||||
buf[buf_size-1] = 0;
|
buf[buf_size-1] = 0;
|
||||||
|
@ -992,7 +992,7 @@ static int VFile_reload(VFile* vf, const char* v_path, Handle)
|
|||||||
if(err < 0)
|
if(err < 0)
|
||||||
{
|
{
|
||||||
// don't CHECK_ERR - this happens often and the dialog is annoying
|
// don't CHECK_ERR - this happens often and the dialog is annoying
|
||||||
debug_out("lookup failed for %s\n", v_path);
|
debug_printf("lookup failed for %s\n", v_path);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1046,7 +1046,7 @@ Handle vfs_open(const char* v_fn, uint file_flags)
|
|||||||
// pass file flags to init
|
// pass file flags to init
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("vfs_open fn=%s %llx\n", v_fn, h);
|
debug_printf("vfs_open fn=%s %llx\n", v_fn, h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
@ -1057,7 +1057,7 @@ debug_out("vfs_open fn=%s %llx\n", v_fn, h);
|
|||||||
int vfs_close(Handle& h)
|
int vfs_close(Handle& h)
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("vfs_close %llx\n", h);
|
debug_printf("vfs_close %llx\n", h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return h_free(h, H_VFile);
|
return h_free(h, H_VFile);
|
||||||
@ -1087,7 +1087,7 @@ debug_out("vfs_close %llx\n", h);
|
|||||||
ssize_t vfs_io(const Handle hf, const size_t size, void** p, FileIOCB cb, uintptr_t ctx)
|
ssize_t vfs_io(const Handle hf, const size_t size, void** p, FileIOCB cb, uintptr_t ctx)
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("vfs_io size=%d\n", size);
|
debug_printf("vfs_io size=%d\n", size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
H_DEREF(hf, VFile, vf);
|
H_DEREF(hf, VFile, vf);
|
||||||
@ -1125,7 +1125,7 @@ static double dt;
|
|||||||
static double totaldata;
|
static double totaldata;
|
||||||
void dump()
|
void dump()
|
||||||
{
|
{
|
||||||
debug_out("TOTAL TIME IN VFS_IO: %f\nthroughput: %f MiB/s\n\n", dt, totaldata/dt/1e6);
|
debug_printf("TOTAL TIME IN VFS_IO: %f\nthroughput: %f MiB/s\n\n", dt, totaldata/dt/1e6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t vfs_timed_io(const Handle hf, const size_t size, void** p, FileIOCB cb = 0, uintptr_t ctx = 0)
|
static ssize_t vfs_timed_io(const Handle hf, const size_t size, void** p, FileIOCB cb = 0, uintptr_t ctx = 0)
|
||||||
@ -1155,7 +1155,7 @@ static ssize_t vfs_timed_io(const Handle hf, const size_t size, void** p, FileIO
|
|||||||
Handle vfs_load(const char* v_fn, void*& p, size_t& size, uint flags /* default 0 */)
|
Handle vfs_load(const char* v_fn, void*& p, size_t& size, uint flags /* default 0 */)
|
||||||
{
|
{
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
debug_out("vfs_load v_fn=%s\n", v_fn);
|
debug_printf("vfs_load v_fn=%s\n", v_fn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p = 0; size = 0; // zeroed in case vfs_open or H_DEREF fails
|
p = 0; size = 0; // zeroed in case vfs_open or H_DEREF fails
|
||||||
@ -1222,7 +1222,7 @@ ret:
|
|||||||
p = 0, size = 0;
|
p = 0, size = 0;
|
||||||
|
|
||||||
if (hm == 0)
|
if (hm == 0)
|
||||||
debug_out("hm == 0!!\n");
|
debug_printf("hm == 0!!\n");
|
||||||
|
|
||||||
return hm;
|
return hm;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ int path_validate(const uint line, const char* path)
|
|||||||
// failed somewhere - err is the error code,
|
// failed somewhere - err is the error code,
|
||||||
// or -1 if not set specifically above.
|
// or -1 if not set specifically above.
|
||||||
fail:
|
fail:
|
||||||
debug_out("path_validate at line %d failed: %s (error code %d)\n", line, msg, err);
|
debug_printf("path_validate at line %d failed: %s (error code %d)\n", line, msg, err);
|
||||||
debug_warn("path_validate failed");
|
debug_warn("path_validate failed");
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -783,7 +783,7 @@ static double total_inf_time;
|
|||||||
|
|
||||||
static void dump()
|
static void dump()
|
||||||
{
|
{
|
||||||
debug_out("TOTAL INFLATE TIME: %g\n", total_inf_time);
|
debug_printf("TOTAL INFLATE TIME: %g\n", total_inf_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -928,7 +928,7 @@ static int zfile_validate(uint line, ZFile* zf)
|
|||||||
|
|
||||||
// failed somewhere - err is the error code,
|
// failed somewhere - err is the error code,
|
||||||
// or -1 if not set specifically above.
|
// or -1 if not set specifically above.
|
||||||
debug_out("zfile_validate at line %d failed: %s\n", line, msg);
|
debug_printf("zfile_validate at line %d failed: %s\n", line, msg);
|
||||||
debug_warn("zfile_validate failed");
|
debug_warn("zfile_validate failed");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1224,7 +1224,7 @@ ssize_t zip_read(ZFile* zf, off_t ofs, size_t size, void* p, FileIOCB cb, uintpt
|
|||||||
double t1 = get_time();
|
double t1 = get_time();
|
||||||
file_io(&za->f,0, xsize, 0, io_cb, (uintptr_t)&xparams);
|
file_io(&za->f,0, xsize, 0, io_cb, (uintptr_t)&xparams);
|
||||||
double t2 = get_time();
|
double t2 = get_time();
|
||||||
debug_out("\n\ntime to load whole archive %f\nthroughput %f MiB/s\n", t2-t1, xsize / (t2-t1) / 1e6);
|
debug_printf("\n\ntime to load whole archive %f\nthroughput %f MiB/s\n", t2-t1, xsize / (t2-t1) / 1e6);
|
||||||
mem_free(xbuf);
|
mem_free(xbuf);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
// raise a debug warning if <len> is the size of a pointer.
|
// raise a debug warning if <len> is the size of a pointer.
|
||||||
// catches bugs such as: tchar* s = ..; tcpy_s(s, sizeof(s), T(".."));
|
// catches bugs such as: tchar* s = ..; tcpy_s(s, sizeof(s), T(".."));
|
||||||
// if warnings get annoying, replace with debug_out. usable as a statement.
|
// if warnings get annoying, replace with debug_printf. usable as a statement.
|
||||||
#define WARN_IF_PTR_LEN(len) STMT( \
|
#define WARN_IF_PTR_LEN(len) STMT( \
|
||||||
if(len == sizeof(char*)) \
|
if(len == sizeof(char*)) \
|
||||||
debug_warn("make sure string buffer size is correct");\
|
debug_warn("make sure string buffer size is correct");\
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "sysdep/debug.h" // debug_out
|
#include "sysdep/debug.h" // debug_printf
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
else if(dt > 1e-3)
|
else if(dt > 1e-3)
|
||||||
scale = 1e3, unit = 'm';
|
scale = 1e3, unit = 'm';
|
||||||
|
|
||||||
debug_out("TIMER %s: %g %cs\n", name.c_str(), dt*scale, unit);
|
debug_printf("TIMER %s: %g %cs\n", name.c_str(), dt*scale, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// no copy ctor, since some members are const
|
// no copy ctor, since some members are const
|
||||||
|
@ -209,7 +209,7 @@ double t1 = get_time();
|
|||||||
get_snd_info();
|
get_snd_info();
|
||||||
get_mem_status();
|
get_mem_status();
|
||||||
double t2 = get_time();
|
double t2 = get_time();
|
||||||
debug_out("SYS DETECT TIME %g\n\n", t2-t1);
|
debug_printf("SYS DETECT TIME %g\n\n", t2-t1);
|
||||||
|
|
||||||
|
|
||||||
struct utsname un;
|
struct utsname un;
|
||||||
@ -847,7 +847,7 @@ TIMER(InitVfs)
|
|||||||
TIMER(rebuild);
|
TIMER(rebuild);
|
||||||
vfs_rebuild();
|
vfs_rebuild();
|
||||||
}
|
}
|
||||||
debug_out("%f\n\n\n", get_time()-t0);
|
debug_printf("%f\n\n\n", get_time()-t0);
|
||||||
exit(1134);
|
exit(1134);
|
||||||
/**/
|
/**/
|
||||||
// don't try vfs_display yet: SDL_Init hasn't yet redirected stdout
|
// don't try vfs_display yet: SDL_Init hasn't yet redirected stdout
|
||||||
@ -1131,7 +1131,7 @@ static void Init(int argc, char* argv[], bool setup_gfx = true)
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
u64 TSC=rdtsc();
|
u64 TSC=rdtsc();
|
||||||
debug_out(
|
debug_printf(
|
||||||
"----------------------------------------\n"\
|
"----------------------------------------\n"\
|
||||||
"INITIALIZING\n"\
|
"INITIALIZING\n"\
|
||||||
"----------------------------------------\n");
|
"----------------------------------------\n");
|
||||||
@ -1335,7 +1335,7 @@ TIMER(init_after_InitRenderer);
|
|||||||
|
|
||||||
g_Console->RegisterFunc(Testing, L"Testing");
|
g_Console->RegisterFunc(Testing, L"Testing");
|
||||||
|
|
||||||
debug_out(
|
debug_printf(
|
||||||
"----------------------------------------\n"\
|
"----------------------------------------\n"\
|
||||||
"READY (elapsed = %f ms)\n"\
|
"READY (elapsed = %f ms)\n"\
|
||||||
"----------------------------------------\n"
|
"----------------------------------------\n"
|
||||||
@ -1411,7 +1411,7 @@ static void Frame()
|
|||||||
float* dir = &orientation._data[8];
|
float* dir = &orientation._data[8];
|
||||||
float* up = &orientation._data[4];
|
float* up = &orientation._data[4];
|
||||||
if(snd_update(pos, dir, up) < 0)
|
if(snd_update(pos, dir, up) < 0)
|
||||||
debug_out("snd_update failed\n");
|
debug_printf("snd_update failed\n");
|
||||||
PROFILE_END( "sound update" );
|
PROFILE_END( "sound update" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1420,7 +1420,7 @@ static void Frame()
|
|||||||
// a game. This is basically just to keep script timers running.
|
// a game. This is basically just to keep script timers running.
|
||||||
g_Scheduler.update((uint)(TimeSinceLastFrame*1000));
|
g_Scheduler.update((uint)(TimeSinceLastFrame*1000));
|
||||||
if(snd_update(0, 0, 0) < 0)
|
if(snd_update(0, 0, 0) < 0)
|
||||||
debug_out("snd_update (pos=0 version) failed\n");
|
debug_printf("snd_update (pos=0 version) failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILE_END( "game logic" );
|
PROFILE_END( "game logic" );
|
||||||
|
@ -423,7 +423,7 @@ void CConsole::InsertMessage(const wchar_t* szMessage, ...)
|
|||||||
va_start(args, szMessage);
|
va_start(args, szMessage);
|
||||||
if (vswprintf(szBuffer, CONSOLE_MESSAGE_SIZE, szMessage, args) == -1)
|
if (vswprintf(szBuffer, CONSOLE_MESSAGE_SIZE, szMessage, args) == -1)
|
||||||
{
|
{
|
||||||
debug_out("Error printfing console message (buffer size exceeded?)\n");
|
debug_printf("Error printfing console message (buffer size exceeded?)\n");
|
||||||
|
|
||||||
// Make it obvious that the text was trimmed (assuming it was)
|
// Make it obvious that the text was trimmed (assuming it was)
|
||||||
wcscpy(szBuffer+CONSOLE_MESSAGE_SIZE-4, L"...");
|
wcscpy(szBuffer+CONSOLE_MESSAGE_SIZE-4, L"...");
|
||||||
|
@ -112,7 +112,7 @@ void CLogger::WriteMessage(const char *message, int interestedness)
|
|||||||
void CLogger::WriteError(const char *message, int interestedness)
|
void CLogger::WriteError(const char *message, int interestedness)
|
||||||
{
|
{
|
||||||
m_NumberOfErrors++;
|
m_NumberOfErrors++;
|
||||||
debug_out("ERROR: %s\n", message);
|
debug_printf("ERROR: %s\n", message);
|
||||||
if (interestedness >= 1)
|
if (interestedness >= 1)
|
||||||
{
|
{
|
||||||
if (g_Console) g_Console->InsertMessage(L"ERROR: %hs", message);
|
if (g_Console) g_Console->InsertMessage(L"ERROR: %hs", message);
|
||||||
|
@ -200,7 +200,7 @@ CGame::CGame():
|
|||||||
m_pLocalPlayer(NULL),
|
m_pLocalPlayer(NULL),
|
||||||
m_GameStarted(false)
|
m_GameStarted(false)
|
||||||
{
|
{
|
||||||
debug_out("CGame::CGame(): Game object CREATED; initializing..\n");
|
debug_printf("CGame::CGame(): Game object CREATED; initializing..\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -211,7 +211,7 @@ CGame::~CGame()
|
|||||||
{
|
{
|
||||||
// Again, the in-game call tree is going to be different to the main menu one.
|
// Again, the in-game call tree is going to be different to the main menu one.
|
||||||
g_Profiler.StructuralReset();
|
g_Profiler.StructuralReset();
|
||||||
debug_out("CGame::~CGame(): Game object DESTROYED\n");
|
debug_printf("CGame::~CGame(): Game object DESTROYED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ PSRETURN CGame::ReallyStartGame()
|
|||||||
assert(ok);
|
assert(ok);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
debug_out("GAME STARTED, ALL INIT COMPLETE\n");
|
debug_printf("GAME STARTED, ALL INIT COMPLETE\n");
|
||||||
m_GameStarted=true;
|
m_GameStarted=true;
|
||||||
|
|
||||||
// The call tree we've built for pregame probably isn't useful in-game.
|
// The call tree we've built for pregame probably isn't useful in-game.
|
||||||
|
@ -240,7 +240,7 @@ int LDR_ProgressiveLoad(double time_budget, wchar_t* description,
|
|||||||
// either finished entirely, or failed => remove from queue.
|
// either finished entirely, or failed => remove from queue.
|
||||||
if(ret == 0 || ret < 0)
|
if(ret == 0 || ret < 0)
|
||||||
{
|
{
|
||||||
debug_out("LOADER: completed %ls in %g ms; estimate was %g ms\n", lr.description.c_str(), task_elapsed_time*1e3, estimated_duration*1e3);
|
debug_printf("LOADER: completed %ls in %g ms; estimate was %g ms\n", lr.description.c_str(), task_elapsed_time*1e3, estimated_duration*1e3);
|
||||||
task_elapsed_time = 0.0;
|
task_elapsed_time = 0.0;
|
||||||
estimated_duration_tally += estimated_duration;
|
estimated_duration_tally += estimated_duration;
|
||||||
load_requests.pop_front();
|
load_requests.pop_front();
|
||||||
@ -294,7 +294,7 @@ done:
|
|||||||
new_description = load_requests.front().description.c_str();
|
new_description = load_requests.front().description.c_str();
|
||||||
wcscpy_s(description, max_chars, new_description);
|
wcscpy_s(description, max_chars, new_description);
|
||||||
|
|
||||||
debug_out("LDR_ProgressiveLoad RETURNING; desc=%ls progress=%d\n", description, *progress_percent);
|
debug_printf("LDR_ProgressiveLoad RETURNING; desc=%ls progress=%d\n", description, *progress_percent);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,7 @@ DECLARE_ERROR(PS_OK);
|
|||||||
DECLARE_ERROR(PS_FAIL);
|
DECLARE_ERROR(PS_FAIL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define MICROLOG debug_wprintf_mem
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "Pyrogenesis.h"
|
||||||
#include "res/ogl_tex.h"
|
#include "res/ogl_tex.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
#include "PatchRData.h"
|
#include "PatchRData.h"
|
||||||
|
@ -355,7 +355,7 @@ void ScriptingHost::ErrorReporter(JSContext * context, const char * message, JSE
|
|||||||
{
|
{
|
||||||
UNUSED(context);
|
UNUSED(context);
|
||||||
|
|
||||||
debug_out("%s(%d) : %s\n", report->filename, report->lineno, message);
|
debug_printf("%s(%d) : %s\n", report->filename, report->lineno, message);
|
||||||
|
|
||||||
if (g_Console)
|
if (g_Console)
|
||||||
{
|
{
|
||||||
|
@ -224,14 +224,14 @@ CEventProjectileMiss::CEventProjectileMiss( CEntity* Originator, const CVector3D
|
|||||||
CProjectileManager::CProjectileManager()
|
CProjectileManager::CProjectileManager()
|
||||||
{
|
{
|
||||||
m_LastTurnLength = 0;
|
m_LastTurnLength = 0;
|
||||||
debug_out( "CProjectileManager CREATED\n" );
|
debug_printf( "CProjectileManager CREATED\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
CProjectileManager::~CProjectileManager()
|
CProjectileManager::~CProjectileManager()
|
||||||
{
|
{
|
||||||
while( m_Projectiles.size() )
|
while( m_Projectiles.size() )
|
||||||
delete( m_Projectiles[0] );
|
delete( m_Projectiles[0] );
|
||||||
debug_out( "CProjectileManager DESTROYED\n" );
|
debug_printf( "CProjectileManager DESTROYED\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
CProjectile* CProjectileManager::AddProjectile( const CModel* Actor, const CVector3D& Position, const CVector3D& Target, float Speed, CEntity* Originator, const CScriptObject& ImpactScript, const CScriptObject& MissScript )
|
CProjectile* CProjectileManager::AddProjectile( const CModel* Actor, const CVector3D& Position, const CVector3D& Target, float Speed, CEntity* Originator, const CScriptObject& ImpactScript, const CScriptObject& MissScript )
|
||||||
|
@ -43,7 +43,7 @@ void CPlayList::list()
|
|||||||
{
|
{
|
||||||
for(unsigned int i = 0; i < tracks.size(); i++)
|
for(unsigned int i = 0; i < tracks.size(); i++)
|
||||||
{
|
{
|
||||||
debug_out("%s\n", tracks.at(i).c_str());
|
debug_printf("%s\n", tracks.at(i).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user