nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
player_frame.h
Go to the documentation of this file.
1#ifndef NANOMMO_CLIENT_PLAYER_FRAME_H_
2#define NANOMMO_CLIENT_PLAYER_FRAME_H_
3
4#include <cstdint>
5#include <map>
6#include <utility>
7#include <vector>
8
9#include "client/animator.h"
10#include "client/offscreen.h"
11#include "client/renderer.h"
12#include "content/factions.h"
13#include "protocol/nanommo.pb.h"
14
15namespace nanommo {
16
17/// You, in the top left: your face in a ring, your name and level, your health
18/// and how far you are into your level, and the faction you've sworn to.
20 public:
21 explicit PlayerFrame(std::map<uint32_t, factions::Faction> factions)
22 : factions_(std::move(factions)) {}
23
24 /// The portrait's size, in pixels, twice what it's shown at on most
25 /// screens, so that it's sharp on the rest.
26 static constexpr int kPortraitPixels = 192;
27
28 /// Draws your head and shoulders into the portrait, before the frame, as
29 /// you look now.
30 void Render(const Renderer& renderer);
31
32 void Draw(const std::vector<Figure>& figures,
33 const protocol::World& world) const;
34
35 private:
36 std::map<uint32_t, factions::Faction> factions_;
38 bool rendered_ = false;
39};
40
41/// The monster you picked, by its id, or in a duel, the player, by theirs:
42/// its name, level and health, at the top in the middle, under the compass,
43/// while there's one.
44void DrawTargetFrame(const std::vector<Figure>& figures, uint32_t target,
45 uint32_t target_player = 0);
46
47} // namespace nanommo
48
49#endif // NANOMMO_CLIENT_PLAYER_FRAME_H_
void Draw(const std::vector< Figure > &figures, const protocol::World &world) const
PlayerFrame(std::map< uint32_t, factions::Faction > factions)
void Render(const Renderer &renderer)
static constexpr int kPortraitPixels
Definition chat.cc:9
void DrawTargetFrame(const std::vector< Figure > &figures, uint32_t target, uint32_t target_player)