mirror of
https://github.com/edubart/otclient.git
synced 2025-12-03 16:36:51 +01:00
graphics optimization feature inspirated by diablo3 engine
* the rendering now consits of two panes - the background pane (for animated stuff like the map) - the foreground pane (for steady stuff, like UI) each pane has it own max FPS and works idependently this may increase graphics performance on many platforms
This commit is contained in:
@@ -31,5 +31,6 @@
|
||||
#include "math.h"
|
||||
#include "string.h"
|
||||
#include "dumper.h"
|
||||
#include "time.h"
|
||||
|
||||
#endif
|
||||
|
||||
41
src/framework/stdext/time.h
Normal file
41
src/framework/stdext/time.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2012 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 STDEXT_TIME_H
|
||||
#define STDEXT_TIME_H
|
||||
|
||||
#include "types.h"
|
||||
#include <chrono>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace stdext {
|
||||
|
||||
const static std::chrono::system_clock::time_point startup_time = std::chrono::high_resolution_clock::now();
|
||||
inline ticks_t millis() { return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - startup_time).count(); }
|
||||
inline ticks_t micros() { return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - startup_time).count(); }
|
||||
inline void millisleep(uint32 ms) { usleep(ms * 1000); };
|
||||
inline void microsleep(uint32 us) { usleep(us); };
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,8 +39,6 @@ typedef int32_t int32;
|
||||
typedef int16_t int16;
|
||||
typedef int8_t int8;
|
||||
|
||||
// note that on 32 bit platforms the max ticks will overflow for values above 2,147,483,647
|
||||
// thus this means that the app may cause unknown behavior after running 24 days without restarting
|
||||
typedef long ticks_t;
|
||||
typedef int64_t ticks_t;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user