particle_manager.cpp File Reference

#include "particle_manager.h"
#include "particle_effect.h"
#include "particle_system.h"
#include "particle_keyframe.h"
#include "video.h"
#include "script.h"
#include <iostream>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>

Include dependency graph for particle_manager.cpp:

Go to the source code of this file.

Namespaces

namespace  hoa_video
namespace  hoa_video::private_video

Defines

#define LOAD_BOOL(str, var)
#define LOAD_COLOR(str, var)
#define LOAD_FLOAT(str, var)
#define LOAD_INT(str, var)
#define LOAD_STRING(str, var)

Functions

bool hoa_video::private_video::TEMP_LoadEffectHelper (const string &filename, lua_State *L, ParticleEffectDef *def)


Define Documentation

#define LOAD_BOOL ( str,
var   ) 

Value:

{ \
  lua_pushstring(L, str); \
  lua_gettable(L, -2); \
  if(!lua_isnumber(L, -1))  \
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: could not load parameter " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  (var) = (bool)lua_tonumber(L, -1);\
  lua_pop(L, 1); \
}

Definition at line 60 of file particle_manager.cpp.

Referenced by hoa_video::private_video::TEMP_LoadEffectHelper().

#define LOAD_COLOR ( str,
var   ) 

Value:

{ \
  lua_pushstring(L, str); \
  lua_gettable(L, -2); \
  if(!lua_istable(L, -1))  \
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: could not load parameter " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  int32 num_color_components = luaL_getn(L, -1); \
  if(num_color_components != 4)\
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: wrong number of components while loading color " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  for(int32 cmp = 1; cmp <= 4; ++cmp) \
  {\
    lua_rawgeti(L, -1, cmp);\
    if(!lua_isnumber(L, -1)) \
    {\
      if(VIDEO_DEBUG) \
        cerr << "VIDEO ERROR: lua_isnumber() returned false while trying to load " << str << " in ParticleManager::LoadEffect()!" << endl; \
      return false; \
    }\
    var[cmp-1] = (float)lua_tonumber(L, -1);\
    lua_pop(L, 1);\
  }\
  lua_pop(L, 1); \
}

Definition at line 90 of file particle_manager.cpp.

Referenced by hoa_video::private_video::TEMP_LoadEffectHelper().

#define LOAD_FLOAT ( str,
var   ) 

Value:

{ \
  lua_pushstring(L, str); \
  lua_gettable(L, -2); \
  if(!lua_isnumber(L, -1))  \
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: could not load parameter " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  (var) = (float)lua_tonumber(L, -1);\
  lua_pop(L, 1); \
}

Definition at line 45 of file particle_manager.cpp.

Referenced by hoa_video::private_video::TEMP_LoadEffectHelper().

#define LOAD_INT ( str,
var   ) 

Value:

{ \
  lua_pushstring(L, str); \
  lua_gettable(L, -2); \
  if(!lua_isnumber(L, -1))  \
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: could not load parameter " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  (var) = (int32)lua_tonumber(L, -1);\
  lua_pop(L, 1); \
}

Definition at line 30 of file particle_manager.cpp.

Referenced by hoa_video::private_video::TEMP_LoadEffectHelper().

#define LOAD_STRING ( str,
var   ) 

Value:

{ \
  lua_pushstring(L, str); \
  lua_gettable(L, -2); \
  if(!lua_isstring(L, -1))  \
  {\
    if(VIDEO_DEBUG) \
      cerr << "VIDEO ERROR: could not load parameter " << str << " in ParticleManager::LoadEffect()!" << endl; \
    return false; \
  }\
  var = string(lua_tostring(L, -1));\
  lua_pop(L, 1); \
}

Definition at line 75 of file particle_manager.cpp.

Referenced by hoa_video::private_video::TEMP_LoadEffectHelper().


Generated on Fri Jul 6 23:12:04 2007 for Hero of Allacrost by  doxygen 1.5.1