gfxPrimitivesSetFontRotation function

void gfxPrimitivesSetFontRotation(
  1. int rotation
)

Implementation

void gfxPrimitivesSetFontRotation(int rotation) {
  int i;

  rotation = rotation & 3;
  if (charRotation != rotation) {
    /* Store rotation */
    charRotation = rotation;

    /* Maybe flip width/height for rendering */
    if ((charRotation == 1) || (charRotation == 3)) {
      charWidthLocal = charHeight;
      charHeightLocal = charWidth;
    } else {
      charWidthLocal = charWidth;
      charHeightLocal = charHeight;
    }

    /* Clear character cache */
    for (i = 0; i < 256; i++) {
      if (gfxPrimitivesFont[i] != nullptr) {
        sdlDestroyTexture(gfxPrimitivesFont[i]);
        gfxPrimitivesFont[i] = nullptr;
      }
    }
  }
}