This commit is contained in:
Eduardo Bart
2011-04-17 16:14:24 -03:00
93 changed files with 862 additions and 824 deletions

View File

@@ -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,

View File

@@ -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
{

View File

@@ -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)
{

View File

@@ -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,

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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>

View File

@@ -25,7 +25,7 @@
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
#include "prerequisites.h"
#include <prerequisites.h>
class FrameBuffer
{

View File

@@ -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>

View File

@@ -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
{

View File

@@ -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)
{

View File

@@ -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
{

View File

@@ -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();

View File

@@ -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

View File

@@ -22,7 +22,8 @@
*/
#include "texture.h"
#include <prerequisites.h>
#include <graphics/texture.h>
#include <GL/gl.h>
#include <GL/glext.h>

View File

@@ -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

View File

@@ -22,8 +22,9 @@
*/
#include "textureloader.h"
#include "texture.h"
#include <prerequisites.h>
#include <graphics/textureloader.h>
#include <graphics/texture.h>
#include <png.h>

View File

@@ -25,7 +25,7 @@
#ifndef TEXTURELOADER_H
#define TEXTURELOADER_H
#include "prerequisites.h"
#include <prerequisites.h>
class Texture;

View File

@@ -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;

View File

@@ -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
{