OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
play_view.h
Go to the documentation of this file.
1// What a running world looks like this frame: its live mesh actors (animated) and movers, as world-space triangles
2// for the renderer. No GL here.
3#pragma once
4#include <map>
5#include <memory>
6#include <tuple>
7#include <vector>
8
9#include "mesh.h"
10#include "scene.h"
11#include "world.h"
12
13namespace ut {
14
15class PlayView {
16public:
17 PlayView(World& world, Vm& vm, PackageSet& set) : world_(world), vm_(vm), set_(set) {}
18 // Actors with DrawType DT_Mesh (a LodMesh, frame from AnimSequence / AnimFrame) or DT_Brush (movers), not hidden.
19 const std::vector<LiveBatch>& build();
20 size_t drawn = 0; // actors in the last build
21
22private:
23 bool behind_view(); // the player looks at itself (PlayerPawn.bBehindView)
24 const LodMesh* mesh(const Obj* m);
25 const Image* image(const Package* p, const Export* e, bool masked); // nullptr export: the checker
26 void add_mesh(Obj* actor, const LodMesh& m, const Obj* mesh_obj);
27 void add_brush(Obj* mover);
28 size_t batch(const Image* image, uint32_t flags); // index into out_
29
30 World& world_;
31 Vm& vm_;
32 PackageSet& set_;
33 std::map<const Obj*, std::unique_ptr<LodMesh>> meshes_; // nullptr: not a readable LodMesh
34 std::map<std::tuple<const Export*, bool>, std::unique_ptr<Image>> images_;
35 struct BrushPart {
36 const Image* image;
37 uint32_t flags;
38 std::vector<Vertex> local; // brush space
39 };
40 std::map<const Obj*, std::vector<BrushPart>> brushes_; // by Brush model object
41 std::map<std::pair<const Image*, uint32_t>, size_t> slots_;
42 std::vector<LiveBatch> out_;
43};
44
45} // namespace ut
Definition packages.h:16
PlayView(World &world, Vm &vm, PackageSet &set)
Definition play_view.h:17
size_t drawn
Definition play_view.h:20
const std::vector< LiveBatch > & build()
Definition play_view.cpp:77
Definition vm.h:83
Definition world.h:34
Definition collision.cpp:7
Definition upkg.h:32
Definition texture.h:10
Definition mesh.h:16
Definition vm.h:35
Definition upkg.h:39