fix outfit glitches, init combobox, move shaders, remove unused particles files, create timer utility

This commit is contained in:
Eduardo Bart
2011-12-28 17:38:29 -02:00
parent 11bb365dce
commit 400afa9981
32 changed files with 273 additions and 269 deletions

View File

@@ -48,20 +48,5 @@ private:
extern Clock g_clock;
class Timer
{
public:
Timer() { restart(); }
void restart() { m_startTicks = g_clock.ticks(); }
ticks_t startTicks() { return m_startTicks; }
ticks_t ticksElapsed() { return g_clock.ticks() - m_startTicks; }
double timeElapsed() { return ticksElapsed()/1000.0; }
private:
ticks_t m_startTicks;
};
#endif

View File

@@ -30,7 +30,6 @@ void EventDispatcher::flush()
{
poll();
m_eventList.clear();
while(!m_scheduledEventList.empty())
m_scheduledEventList.pop();
}

View File

@@ -25,7 +25,7 @@
Logger g_logger;
Logger::Logger() : m_terminated(false)
Logger::Logger()
{
}

View File

@@ -48,7 +48,6 @@ public:
private:
std::list<LogMessage> m_logMessages;
OnLogCallback m_onLog;
bool m_terminated;
};
extern Logger g_logger;

View File

@@ -48,14 +48,14 @@ void Module::discover(const OTMLNodePtr& moduleNode)
// set onLoad callback
if(OTMLNodePtr node = moduleNode->get("onLoad")) {
g_lua.loadFunction(node->value<std::string>(), "@" + node->source() + "[" + node->tag() + "]");
g_lua.loadFunction(node->value(), "@" + node->source() + "[" + node->tag() + "]");
g_lua.useValue();
m_loadCallback = g_lua.polymorphicPop<BooleanCallback>();
}
// set onUnload callback
if(OTMLNodePtr node = moduleNode->get("onUnload")) {
g_lua.loadFunction(node->value<std::string>(), "@" + node->source() + "[" + node->tag() + "]");
g_lua.loadFunction(node->value(), "@" + node->source() + "[" + node->tag() + "]");
g_lua.useValue();
m_unloadCallback = g_lua.polymorphicPop<SimpleCallback>();
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "timer.h"
#include "clock.h"
void Timer::restart()
{
m_startTicks = g_clock.ticks();
}
ticks_t Timer::ticksElapsed()
{
return g_clock.ticks() - m_startTicks;
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef TIMER_H
#define TIMER_H
#include <framework/util/types.h>
class Timer
{
public:
Timer() { restart(); }
void restart();
ticks_t startTicks() { return m_startTicks; }
ticks_t ticksElapsed();
double timeElapsed() { return ticksElapsed()/1000.0; }
private:
ticks_t m_startTicks;
};
#endif