From 1918cc89bf954db83d079cfe4566a719fdc65237 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 16 May 2011 15:24:00 -0400 Subject: [PATCH] changed loadfile and loadtexture to load() params --- WFObj.cc | 17 +++++++++-------- WFObj.h | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/WFObj.cc b/WFObj.cc index 030fc93..5c308c7 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -99,14 +99,8 @@ static void checkGLErrorLine(const char * function, int line) /****** WFObj functions ******/ -WFObj::WFObj(loadfile_t lf, loadtexture_t lt) +WFObj::WFObj() { - m_loadfile = lf; - m_loadtexture = lt; - if (m_loadfile == NULL) - { - m_loadfile = loadfile; - } if (m_valid) { glDeleteBuffers(1, &m_data_vbo); @@ -131,8 +125,15 @@ void WFObj::clear() m_current_material_name = ""; } -bool WFObj::load(const char *fname) +bool WFObj::load(const char *fname, loadfile_t lf, loadtexture_t lt) { + m_loadfile = lf; + m_loadtexture = lt; + if (m_loadfile == NULL) + { + m_loadfile = loadfile; + } + clear(); Buffer buff; diff --git a/WFObj.h b/WFObj.h index 32d0caa..dac8fea 100644 --- a/WFObj.h +++ b/WFObj.h @@ -60,11 +60,11 @@ public: enum { VERTEX, VERTEX_TEXTURE, VERTEX_NORMAL, VERTEX_TYPES }; /* constructors */ - WFObj(loadfile_t lf = NULL, loadtexture_t lt = NULL); + WFObj(); ~WFObj(); /* methods */ - bool load(const char *fname); + bool load(const char *fname, loadfile_t lf = NULL, loadtexture_t lt = NULL); bool load(const Buffer &buff); const float * const getAABB() { return m_aabb; } size_t getStride() { return sizeof(GLfloat) * m_n_floats_per_vref; }