mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
changes to prepare revgraphics
This commit is contained in:
@@ -48,8 +48,7 @@ void Logger::log(Fw::LogLevel level, std::string message)
|
||||
|
||||
if(level == Fw::LogFatal) {
|
||||
m_terminated = true;
|
||||
g_platform.displayFatalError(message);
|
||||
exit(-1);
|
||||
throw std::runtime_error(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -30,10 +30,10 @@
|
||||
#include <list>
|
||||
|
||||
struct LogMessage {
|
||||
LogMessage(Fw::LogLevel level, const std::string& message, std::size_t when) : level(level), message(message), when(when) { }
|
||||
Fw::LogLevel level;
|
||||
std::string message;
|
||||
std::size_t when;
|
||||
LogMessage(Fw::LogLevel level, const std::string& message, std::size_t when) : level(level), message(message), when(when) { }
|
||||
Fw::LogLevel level;
|
||||
std::string message;
|
||||
std::size_t when;
|
||||
};
|
||||
|
||||
class Logger
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <framework/platform/platform.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <framework/thirdparty/glext.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
PFNGLGENFRAMEBUFFERSPROC oglGenFramebuffers = 0;
|
||||
PFNGLBINDFRAMEBUFFERPROC oglBindFramebuffer = 0;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <framework/graphics/texture.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <framework/thirdparty/glext.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
Graphics g_graphics;
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "graphics.h"
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <framework/thirdparty/glext.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
Texture::Texture()
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ class OTMLNode : public std::enable_shared_from_this<OTMLNode>
|
||||
public:
|
||||
virtual ~OTMLNode() { }
|
||||
|
||||
static OTMLNodePtr create(std::string tag = Fw::empty_string, bool unique = false);
|
||||
static OTMLNodePtr create(std::string tag = "", bool unique = false);
|
||||
static OTMLNodePtr create(std::string tag, std::string value);
|
||||
|
||||
std::string tag() const { return m_tag; }
|
||||
|
11486
src/framework/thirdparty/glext.h
vendored
11486
src/framework/thirdparty/glext.h
vendored
File diff suppressed because it is too large
Load Diff
@@ -29,10 +29,22 @@
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <cxxabi.h>
|
||||
#include <chrono>
|
||||
#include <unistd.h>
|
||||
#include "types.h"
|
||||
|
||||
namespace Fw {
|
||||
|
||||
inline int getTicks() {
|
||||
static auto firstTick = std::chrono::high_resolution_clock::now();
|
||||
auto tickNow = std::chrono::high_resolution_clock::now();
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(tickNow - firstTick).count();
|
||||
}
|
||||
|
||||
inline void sleep(int ms) {
|
||||
usleep(ms);
|
||||
}
|
||||
|
||||
// read utilities for istream
|
||||
inline uint8 getU8(std::istream& in) {
|
||||
uint8 tmp;
|
||||
@@ -256,9 +268,6 @@ inline std::string ip2str(uint32 ip) {
|
||||
return std::string(host);
|
||||
}
|
||||
|
||||
// an empty string to use anywhere needed
|
||||
const static std::string empty_string;
|
||||
|
||||
}
|
||||
|
||||
// shortcut for Fw::dump
|
||||
|
@@ -43,6 +43,8 @@
|
||||
|
||||
void OTClient::registerLuaFunctions()
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
|
||||
g_lua.bindGlobalFunction("exit", std::bind(&OTClient::exit, &g_client));
|
||||
g_lua.bindGlobalFunction("setOnClose", std::bind(&OTClient::setOnClose, &g_client, _1));
|
||||
g_lua.bindGlobalFunction("importDat", std::bind(&ThingsType::load, &g_thingsType, _1));
|
||||
|
@@ -147,7 +147,7 @@ void OTClient::run()
|
||||
g_platform.swapBuffers();
|
||||
} else {
|
||||
// sleeps until next poll to avoid massive cpu usage
|
||||
g_platform.sleep(POLL_CYCLE_DELAY+1);
|
||||
Fw::sleep(POLL_CYCLE_DELAY+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user