~vladh/peony

peony/src/pack.hpp -rw-r--r-- 527 bytes
7fc9922bVlad-Stefan Harbuz changes shaders namespace into class a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
  Peony Game Engine
  Copyright (C) 2020 Vlad-Stefan Harbuz <vlad@vladh.net>
  All rights reserved.
*/

#pragma once

#include "types.hpp"

namespace pack {
  constexpr uint16 ELEMENT_SIZE = 4;
  constexpr uint16 MAX_LENGTH  = (64 / ELEMENT_SIZE);
  constexpr uint16 COUNTER_IDX  = (MAX_LENGTH - 1);

  typedef uint64 Pack;

  void init(Pack *pack);
  void set(Pack *pack, uint8 value, uint8 idx);
  uint8 get(Pack *pack, uint8 idx);
  uint8 get_count(Pack *pack);
  void push(Pack *pack, uint8 value);
}

using pack::Pack;