summary refs log tree commit diff stats
path: root/src/systems
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-16 16:04:32 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-16 16:04:32 -0500
commited08b673c50b076042d8f0c49501372168142764 (patch)
tree18ecda99942ef11ce4023c3ad4437976f96b75da /src/systems
parent224645d1071c14b4829dbb3ae35870868fcff85a (diff)
downloadtherapy-ed08b673c50b076042d8f0c49501372168142764.tar.gz
therapy-ed08b673c50b076042d8f0c49501372168142764.tar.bz2
therapy-ed08b673c50b076042d8f0c49501372168142764.zip
Refactored renderer
Renderer is basically now more C++'y, as it makes more use of classes (a lot of GL types have been wrapped), and the renderer itself is now a class. The monitor mesh is also now indexed.

Tweaked the NTSC artifacting after inadvertently fixing a bug with the way the image was loaded.
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/animating.cpp3
-rw-r--r--src/systems/animating.h2
-rw-r--r--src/systems/mapping.cpp12
3 files changed, 13 insertions, 4 deletions
diff --git a/src/systems/animating.cpp b/src/systems/animating.cpp index 91fe925..22224c9 100644 --- a/src/systems/animating.cpp +++ b/src/systems/animating.cpp
@@ -51,8 +51,9 @@ void AnimatingSystem::render(Texture& texture)
51 transform.getH()}; 51 transform.getH()};
52 52
53 const AnimationSet& aset = sprite.getAnimationSet(); 53 const AnimationSet& aset = sprite.getAnimationSet();
54 texture.blit( 54 game_.getRenderer().blit(
55 aset.getTexture(), 55 aset.getTexture(),
56 texture,
56 aset.getFrameRect(sprite.getFrame()), 57 aset.getFrameRect(sprite.getFrame()),
57 dstrect); 58 dstrect);
58 } 59 }
diff --git a/src/systems/animating.h b/src/systems/animating.h index d6a89a5..548bff1 100644 --- a/src/systems/animating.h +++ b/src/systems/animating.h
@@ -3,7 +3,7 @@
3 3
4#include "system.h" 4#include "system.h"
5#include <string> 5#include <string>
6#include "renderer.h" 6#include "renderer/texture.h"
7 7
8class AnimatingSystem : public System { 8class AnimatingSystem : public System {
9public: 9public:
diff --git a/src/systems/mapping.cpp b/src/systems/mapping.cpp index 5b63ded..120a27a 100644 --- a/src/systems/mapping.cpp +++ b/src/systems/mapping.cpp
@@ -48,7 +48,11 @@ void MappingSystem::render(Texture& texture)
48 TILE_WIDTH, 48 TILE_WIDTH,
49 TILE_HEIGHT}; 49 TILE_HEIGHT};
50 50
51 texture.blit(mappable.getTileset(), std::move(src), std::move(dst)); 51 game_.getRenderer().blit(
52 mappable.getTileset(),
53 texture,
54 std::move(src),
55 std::move(dst));
52 } 56 }
53 } 57 }
54 58
@@ -67,7 +71,11 @@ void MappingSystem::render(Texture& texture)
67 TILE_WIDTH, 71 TILE_WIDTH,
68 TILE_HEIGHT}; 72 TILE_HEIGHT};
69 73
70 texture.blit(mappable.getFont(), std::move(src), std::move(dst)); 74 game_.getRenderer().blit(
75 mappable.getFont(),
76 texture,
77 std::move(src),
78 std::move(dst));
71 } 79 }
72 } 80 }
73} 81}