<commit_before>/* Copyright 2014 <NAME>.
   This file is part of Oubliette.  Oubliette is licensed under the terms
   of the 2-clause BSD license.  For more information, see LICENSE.txt. */
#include "graphics.hpp"
#include "state.hpp"
#include "defs.hpp"
#include "../defs.hpp"
#include "../rand.hpp"
namespace graphics {
using game::vec2;

static struct ::sprite::sprite SPRITES[] = {
#include "sprite_array.hpp"
    { nullptr, 0, 0, 0, 0 }
};

static int round_up_pow2(int x)
{
    unsigned v = x - 1;
    v |= v >> 1;
    v |= v >> 2;
    v |= v >> 4;
    v |= v >> 8;
    v |= v >> 16;
    return v + 1;
}

sprite treasure_sprite(int which, int state)
{
    if (which < 0 || which >= 3 || state < 0 || state >= 5)
        core::die("Invalid treasure");
    static const sprite ARR[3][5] = {
        { sprite::CIRCLE1,
          sprite::CIRCLE2,
          sprite::CIRCLE3,
          sprite::CIRCLE4,
          sprite::CIRCLE5 },
        { sprite::STAR1,
          sprite::STAR2,
          sprite::STAR3,
          sprite::STAR4,
          sprite::STAR5 },
        { sprite::DIAMOND1,
          sprite::DIAMOND2,
          sprite::DIAMOND3,
          sprite::DIAMOND4,
          sprite::DIAMOND5 }
    };
    return ARR[which][state];
}


// ======================================================================

common_data::common_data()
    : sprite("sprite", "sprite"),
      tv("tv", "tv"),
      plain("plain", "plain")
{ }

// ======================================================================

sprite_data::sprite_data()<commit_msg>Fix whitespace<commit_after>/* Copyright 2014 <NAME>.
   This file is part of Oubliette.  Oubliette is licensed under the terms
   of the 2-clause BSD license.  For more information, see LICENSE.txt. */
#include "graphics.hpp"
#include "state.hpp"
#include "defs.hpp"
#include "../defs.hpp"
#include "../rand.hpp"
namespace graphics {
using game::vec2;

static struct ::sprite::sprite SPRITES[] = {
#include "sprite_array.hpp"
    { nullptr, 0, 0, 0, 0 }
};

static int round_up_pow2(int x)
{
    unsigned v = x - 1;
    v |= v >> 1;
    v |= v >> 2;
    v |= v >> 4;
    v |= v >> 8;
    v |= v >> 16;
    return v + 1;
}

sprite treasure_sprite(int which, int state)
{
    if (which < 0 || which >= 3 || state < 0 || state >= 5)
        core::die("Invalid treasure");
    static const sprite ARR[3][5] = {
        { sprite::CIRCLE1,
          sprite::CIRCLE2,
          sprite::CIRCLE3,
          sprite::CIRCLE4,
          sprite::CIRCLE5 },
        { sprite::STAR1,
          sprite::STAR2,
          sprite::STAR3,
          sprite::STAR4,
          sprite::STAR5 },
        { sprite::DIAMOND1,
          sprite::DIAMOND2,
          sprite::DIAMOND3,
          sprite::DIAMOND4,
          sprite::DIAMOND5 }
    };
    return ARR[which][state];
}

// ======================================================================

common_data::common_data()
    : sprite("sprite", "sprite"),
      tv("tv", "tv"),
      plain("plain", "plain")
{ }

// ======================================================================

sprite_data::sprite_data()
{'fraction_non_alphanumeric': 0.2372333548804137, 'fraction_numerical': 0.025856496444731737, 'mean_word_length': 2.6368977673325498, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1963625', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1016, 'n_words': 244}