<commit_before>/*
* Author: BtheDestroyer
* SpriteTools is an open source 3DS Homebrew Library which can be found here:
* https://github.com/BtheDestroyer/SpriteTools
*/

#include <3ds.h>
#include <stdio.h>
#include <spritetools_spritesheet.h>

/****************************\
|*     Render Functions     *|
\****************************/
/* Inits rendering */
/* Returns 1 on success and 0 on failure */
int ST_RenderInit(void)
{
  if (!sf2d_init())
    return 0;
  sf2d_set_clear_color(RGBA8(0x20, 0xA0, 0x20, 0xFF));

  return 1;
}

/* Finishes rendering */
void ST_RenderFini(void)
{
  sf2d_fini();
}

/* Start frame */
/* Takes screen (GFX_TOP or GFX_BOTTOM) */
void ST_RenderStartFrame(gfxScreen_t screen)
{
  if (screen == GFX_TOP)
  {
    sf2d_start_frame(screen, GFX_LEFT);
  }
  else
  {
    sf2d_start_frame(screen, (gfx3dSide_t)NULL);
  }
}

/* Ends frame */
void ST_RenderEndRender(void)
{
  sf2d_swapbuffers();
}

/* Draw Spritesheet at Position */
/* Takes spritesheet and x and y of position to render on screen */
void ST_RenderSpritesheetPosition(st_spritesheet *spritesheet, int x, int y)
{
  sf2d_draw_texture(spritesheet, x, y);
}

/* Draw Spritesheet at 0,0 */
/* Takes spritesheet */<commit_msg>Included spritesheet.h and renamed comment headers<commit_after>/*
* Author: BtheDestroyer
* SpriteTools is an open source 3DS Homebrew Library which can be found here:
* https://github.com/BtheDestroyer/SpriteTools
*/

#include <3ds.h>
#include <spritetools_render.h>

/*****************************\
|*     General Functions     *|
\*****************************/
/* Inits rendering */
/* Returns 1 on success and 0 on failure */
int ST_RenderInit(void)
{
  if (!sf2d_init())
    return 0;
  sf2d_set_clear_color(RGBA8(0x20, 0xA0, 0x20, 0xFF));

  return 1;
}

/* Finishes rendering */
void ST_RenderFini(void)
{
  sf2d_fini();
}

/* Start frame */
/* Takes screen (GFX_TOP or GFX_BOTTOM) */
void ST_RenderStartFrame(gfxScreen_t screen)
{
  if (screen == GFX_TOP)
  {
    sf2d_start_frame(screen, GFX_LEFT);
  }
  else
  {
    sf2d_start_frame(screen, (gfx3dSide_t)NULL);
  }
}

/* Ends frame */
void ST_RenderEndRender(void)
{
  sf2d_swapbuffers();
}

/*******************************\
|*     Render Spritesheets     *|
\*******************************/
/* Draw Spritesheet at Position */
/* Takes spritesheet and x and y of position to render on screen */
void ST_RenderSpritesheetPosition(st_spritesheet *spritesheet, int x, int y)
{
  sf2d_draw_texture(spritesheet, x, y);
}

/* Draw Spritesheet at 0,0 */
/* Takes spritesheet */
{'fraction_non_alphanumeric': 0.18691222570532914, 'fraction_numerical': 0.02037617554858934, 'mean_word_length': 4.189024390243903, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '940371', 'n_tokens_mistral': 961, 'n_tokens_neox': 934, 'n_words': 219}