Class: Quake::Bsp::Reader
- Inherits:
-
Object
- Object
- Quake::Bsp::Reader
- Defined in:
- lib/quake/bsp/reader.rb
Constant Summary collapse
- BSP_VERSION =
29- LUMP_ENTITIES =
0- LUMP_PLANES =
1- LUMP_TEXTURES =
2- LUMP_VERTICES =
3- LUMP_VISIBILITY =
4- LUMP_NODES =
5- LUMP_TEXINFO =
6- LUMP_FACES =
7- LUMP_LIGHTING =
8- LUMP_CLIPNODES =
9- LUMP_LEAFS =
10- LUMP_MARKSURFACES =
11- LUMP_EDGES =
12- LUMP_SURFEDGES =
13- LUMP_MODELS =
14- NUM_LUMPS =
15
Instance Method Summary collapse
-
#initialize(data) ⇒ Reader
constructor
A new instance of Reader.
- #parse ⇒ Object
Constructor Details
#initialize(data) ⇒ Reader
Returns a new instance of Reader.
26 27 28 29 |
# File 'lib/quake/bsp/reader.rb', line 26 def initialize(data) @data = data @lumps = [] end |
Instance Method Details
#parse ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/quake/bsp/reader.rb', line 31 def parse parse_header @textures = parse_textures vertices = parse_vertices edges = parse_edges faces = parse_faces surfedges = parse_surfedges planes = parse_planes nodes = parse_nodes leafs = parse_leafs clipnodes = parse_clipnodes texinfo = parse_texinfo faces = build_surface_data(vertices, edges, faces, surfedges, texinfo) models = parse_models marksurfaces = parse_marksurfaces entities = parse_entities visibility = parse_visibility lighting = parse_lighting Level.new( vertices: vertices, edges: edges, faces: faces, surfedges: surfedges, planes: planes, nodes: nodes, leafs: leafs, clipnodes: clipnodes, texinfo: texinfo, models: models, marksurfaces: marksurfaces, entities: entities, visibility: visibility, lighting: lighting, textures: @textures ) end |