예제 #1
0
FrameInjection::FrameInjection(ThreadInfo *&info, CStrRef cls,
                               const char *name, ObjectData *obj, int fs)
    : m_class(cls), m_name(name),
      m_object(obj), m_line(0), m_flags(fs),
      m_staticClass(NULL), m_callingObject(NULL) {
  info = doCommon();
  hotProfilerInit(info, name);
  injection_check(info);
}
예제 #2
0
// constructors without hot profiler
FrameInjection::FrameInjection(ThreadInfo *&info, CStrRef cls,
                               const char *name, bool unused)
    : m_class(cls), m_name(name),
      m_object(NULL), m_line(0), m_flags(0),
      m_staticClass(NULL), m_callingObject(NULL) {
  info = doCommon();
#ifdef HOTPROFILER
  m_prof = false;
#endif
  injection_check(info);
}
FrameInjection::FrameInjection(CStrRef cls, const char *name, int fs)
    : m_class(cls), m_name(name), m_object(NULL),
#ifdef ENABLE_LATE_STATIC_BINDING
      m_staticClass(NULL), m_callingObject(NULL),
#endif
      m_line(0), m_flags(fs) {
  m_info = ThreadInfo::s_threadInfo.getNoCheck();
  injection_check(m_info);
  doCommon();
  hotProfilerInit(m_info, name);
}
// constructors without hot profiler
FrameInjection::FrameInjection(CStrRef cls, const char *name, bool unused)
    : m_class(cls), m_name(name), m_object(NULL),
#ifdef ENABLE_LATE_STATIC_BINDING
      m_staticClass(NULL), m_callingObject(NULL),
#endif
      m_line(0), m_flags(0) {
  m_info = ThreadInfo::s_threadInfo.getNoCheck();
  injection_check(m_info);
  doCommon();
#ifdef HOTPROFILER
  m_prof = false;
#endif
}
예제 #5
0
void Reflective1::doReflectionsEnabled(::Camera& camera, const TileList& tl, const EntityList& el) {
	ATTRIB_PUSH(__FUNCTION__, GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
	{
		doCommon(camera, tl, el);
		// Enable blending.
		auto& renderer = Renderer::get();
		// Enable blending.
		renderer.setBlendingEnabled(true);
		renderer.setBlendFunction(BlendFunction::SourceAlpha, BlendFunction::One);

		// reduce texture hashing by loading up each texture only once
		if (tl._mesh) {
			Internal::render_fans_by_list(*tl._mesh, tl._reflective);
		}
	}
	ATTRIB_POP(__FUNCTION__);
}
예제 #6
0
/**
 * @todo We could re-use Ego::Graphics::RenderPasses::NonReflective for that.
 *       However, things will evolve soon enough ... Egoboo's whole way of
 *       rendering needs to be improved (at least we've improved structure &
 *       terminology for now).
 */
void Reflective1::doReflectionsDisabled(::Camera& camera, const TileList& tl, const EntityList& el) {
	ATTRIB_PUSH(__FUNCTION__, GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
	{
		doCommon(camera, tl, el);
		auto& renderer = Renderer::get();
		// Disable blending.
		renderer.setBlendingEnabled(false);
		// Do not display the completely transparent portion:
		// Use alpha test to allow the thatched roof tiles to look like thatch.
		renderer.setAlphaTestEnabled(true);
		// Speed-up drawing of surfaces with alpha = 0.0f sections
		renderer.setAlphaFunction(CompareFunction::Greater, 0.0f);

		// reduce texture hashing by loading up each texture only once
		if (tl._mesh) {
			Internal::render_fans_by_list(*tl._mesh, tl._reflective);
		}
	}
	ATTRIB_POP(__FUNCTION__);
}