mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
ahn?
This commit is contained in:
@@ -22,9 +22,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "borderedimage.h"
|
||||
#include "graphics.h"
|
||||
#include "textures.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/borderedimage.h>
|
||||
#include <graphics/graphics.h>
|
||||
#include <graphics/textures.h>
|
||||
|
||||
BorderedImage::BorderedImage(TexturePtr texture,
|
||||
const Rect& left,
|
||||
|
@@ -25,9 +25,9 @@
|
||||
#ifndef BORDEREDIMAGE_H
|
||||
#define BORDEREDIMAGE_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "image.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/image.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
class BorderedImage : public Image
|
||||
{
|
||||
|
@@ -22,10 +22,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "font.h"
|
||||
#include "core/resources.h"
|
||||
#include "textures.h"
|
||||
#include "graphics.h"
|
||||
#include <prerequisites.h>
|
||||
#include <core/resources.h>
|
||||
#include <graphics/font.h>
|
||||
#include <graphics/textures.h>
|
||||
#include <graphics/graphics.h>
|
||||
|
||||
void Font::calculateGlyphsWidthsAutomatically(const Size& glyphSize)
|
||||
{
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#ifndef FONT_H
|
||||
#define FONT_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
enum EAlign {
|
||||
ALIGN_TOP = 1 << 0,
|
||||
|
@@ -22,8 +22,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "fonts.h"
|
||||
#include "core/resources.h"
|
||||
#include <prerequisites.h>
|
||||
#include <core/resources.h>
|
||||
#include <graphics/fonts.h>
|
||||
|
||||
Fonts g_fonts;
|
||||
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#ifndef FONTS_H
|
||||
#define FONTS_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "font.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/font.h>
|
||||
|
||||
class Fonts
|
||||
{
|
||||
|
@@ -21,9 +21,10 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "framebuffer.h"
|
||||
#include "core/platform.h"
|
||||
#include "graphics.h"
|
||||
#include <prerequisites.h>
|
||||
#include <core/platform.h>
|
||||
#include <graphics/framebuffer.h>
|
||||
#include <graphics/graphics.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef FRAMEBUFFER_H
|
||||
#define FRAMEBUFFER_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include <prerequisites.h>
|
||||
|
||||
class FrameBuffer
|
||||
{
|
||||
|
@@ -22,8 +22,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "graphics.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/graphics.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#ifndef GRAPHICS_H
|
||||
#define GRAPHICS_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
class Graphics
|
||||
{
|
||||
|
@@ -22,9 +22,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "image.h"
|
||||
#include "graphics.h"
|
||||
#include "textures.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/image.h>
|
||||
#include <graphics/graphics.h>
|
||||
#include <graphics/textures.h>
|
||||
|
||||
Image::Image(const std::string& texture)
|
||||
{
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#ifndef IMAGE_H
|
||||
#define IMAGE_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
class Image
|
||||
{
|
||||
|
@@ -22,9 +22,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "textarea.h"
|
||||
#include "graphics.h"
|
||||
#include "core/engine.h"
|
||||
#include <prerequisites.h>
|
||||
#include <core/engine.h>
|
||||
#include <graphics/textarea.h>
|
||||
#include <graphics/graphics.h>
|
||||
|
||||
TextArea::TextArea() :
|
||||
m_font(0),
|
||||
@@ -65,7 +66,7 @@ void TextArea::draw()
|
||||
if(m_cursorVisible && m_cursorPos >= 0) {
|
||||
assert(m_cursorPos <= textLength);
|
||||
const int delay = 500;
|
||||
int ticks = g_engine.getLastFrameTicks();
|
||||
int ticks = g_engine.getCurrentFrameTicks();
|
||||
// draw every 500ms
|
||||
if(ticks - m_cursorTicks <= delay) {
|
||||
Rect cursorRect;
|
||||
@@ -76,7 +77,7 @@ void TextArea::draw()
|
||||
cursorRect = Rect(m_glyphsCoords[m_cursorPos-1].right(), m_glyphsCoords[m_cursorPos-1].top(), 1, m_font->getGlyphHeight());
|
||||
g_graphics.drawFilledRect(cursorRect, m_color);
|
||||
} else if(ticks - m_cursorTicks >= 2*delay) {
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,7 +235,7 @@ void TextArea::setText(const std::string& text)
|
||||
m_text = text;
|
||||
if(m_cursorPos >= 0) {
|
||||
m_cursorPos = 0;
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
}
|
||||
recalculate();
|
||||
}
|
||||
@@ -273,7 +274,7 @@ void TextArea::enableCursor(bool enable)
|
||||
{
|
||||
if(enable) {
|
||||
m_cursorPos = 0;
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
} else
|
||||
m_cursorPos = -1;
|
||||
recalculate();
|
||||
@@ -286,7 +287,7 @@ void TextArea::appendCharacter(char c)
|
||||
tmp = c;
|
||||
m_text.insert(m_cursorPos, tmp);
|
||||
m_cursorPos++;
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
recalculate();
|
||||
}
|
||||
}
|
||||
@@ -298,7 +299,7 @@ void TextArea::removeCharacter(bool right)
|
||||
m_text.erase(m_text.begin() + m_cursorPos);
|
||||
else if((uint)m_cursorPos == m_text.length()) {
|
||||
m_text.erase(m_text.begin() + (--m_cursorPos));
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
}
|
||||
recalculate();
|
||||
}
|
||||
@@ -309,12 +310,12 @@ void TextArea::moveCursor(bool right)
|
||||
if(right) {
|
||||
if((uint)m_cursorPos+1 <= m_text.length()) {
|
||||
m_cursorPos++;
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
}
|
||||
} else {
|
||||
if(m_cursorPos-1 >= 0) {
|
||||
m_cursorPos--;
|
||||
m_cursorTicks = g_engine.getLastFrameTicks();
|
||||
m_cursorTicks = g_engine.getCurrentFrameTicks();
|
||||
}
|
||||
}
|
||||
recalculate();
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef TEXTAREA_H
|
||||
#define TEXTAREA_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include <prerequisites.h>
|
||||
#include "font.h"
|
||||
|
||||
class TextArea
|
||||
@@ -77,6 +77,4 @@ private:
|
||||
std::vector<Rect> m_glyphsTexCoords;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<TextArea> TextAreaPtr;
|
||||
|
||||
#endif // TEXTAREA_H
|
||||
|
@@ -22,7 +22,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
|
@@ -25,9 +25,7 @@
|
||||
#ifndef TEXTURE_H
|
||||
#define TEXTURE_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
|
||||
class Textures;
|
||||
#include <prerequisites.h>
|
||||
|
||||
class Texture
|
||||
{
|
||||
@@ -53,5 +51,6 @@ private:
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Texture> TexturePtr;
|
||||
typedef boost::weak_ptr<Texture> TextureWeakPtr;
|
||||
|
||||
#endif // TEXTURE_H
|
||||
|
@@ -22,8 +22,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "textureloader.h"
|
||||
#include "texture.h"
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/textureloader.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
#include <png.h>
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef TEXTURELOADER_H
|
||||
#define TEXTURELOADER_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include <prerequisites.h>
|
||||
|
||||
class Texture;
|
||||
|
||||
|
@@ -22,9 +22,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "textures.h"
|
||||
#include "core/resources.h"
|
||||
#include "textureloader.h"
|
||||
#include <prerequisites.h>
|
||||
#include <core/resources.h>
|
||||
#include <graphics/textures.h>
|
||||
#include <graphics/textureloader.h>
|
||||
|
||||
Textures g_textures;
|
||||
|
||||
|
@@ -25,10 +25,8 @@
|
||||
#ifndef TEXTURES_H
|
||||
#define TEXTURES_H
|
||||
|
||||
#include "prerequisites.h"
|
||||
#include "texture.h"
|
||||
|
||||
typedef boost::weak_ptr<Texture> TextureWeakPtr;
|
||||
#include <prerequisites.h>
|
||||
#include <graphics/texture.h>
|
||||
|
||||
class Textures
|
||||
{
|
||||
|
Reference in New Issue
Block a user