# Copyright (c) 2007 SIEGE Development Team
# All rights reserved.
#
# This file is part of libSIEGE.
#
# This software is copyrighted work licensed under the terms of the
# 2-clause BSD license. Please consult the file "license.txt" for
# details.
#
# If you did not recieve the file with this program, please email
# Tim Chas <darkuranium@gmail.com>.

from siege.common cimport *
from texture cimport *

cdef extern from "siege/graphics/sprite.h":
    struct SGSprite:
        SGulong tick
        
        float xoffset
        float yoffset
        SGbool extimages
        SGuint numimages
        SGTexture** subimages
        float image
        float speed
    
    SGSprite* sgSpriteCreateTexture2f(SGTexture* texture, float xoffset, float yoffset)
    SGSprite* sgSpriteCreateTexture(SGTexture* texture)
    SGSprite* sgSpriteCreateFile2f(char* fname, float xoffset, float yoffset)
    SGSprite* sgSpriteCreateFile(char* fname)
    void sgSpriteDestroy(SGSprite* sprite)
    
    void sgSpriteDrawRads3f2f1f(SGSprite* sprite, float x, float y, float z, float xscale, float yscale, float angle)
    void sgSpriteDrawDegs3f2f1f(SGSprite* sprite, float x, float y, float z, float xscale, float yscale, float angle)
    void sgSpriteDrawRads2f2f1f(SGSprite* sprite, float x, float y, float xscale, float yscale, float angle)
    void sgSpriteDrawDegs2f2f1f(SGSprite* sprite, float x, float y, float xscale, float yscale, float angle)
    void sgSpriteDrawRads3f1f(SGSprite* sprite, float x, float y, float z, float angle)
    void sgSpriteDrawDegs3f1f(SGSprite* sprite, float x, float y, float z, float angle)
    void sgSpriteDrawRads2f1f(SGSprite* sprite, float x, float y, float angle)
    void sgSpriteDrawDegs2f1f(SGSprite* sprite, float x, float y, float angle)
    
    void sgSpriteDraw3f2f(SGSprite* sprite, float x, float y, float z, float xscale, float yscale)
    void sgSpriteDraw2f2f(SGSprite* sprite, float x, float y, float xscale, float yscale)
    void sgSpriteDraw3f(SGSprite* sprite, float x, float y, float z)
    void sgSpriteDraw2f(SGSprite* sprite, float x, float y)
    
    void sgSpriteGetSize(SGSprite* sprite, SGuint* width, SGuint* height)
    SGuint sgSpriteGetWidth(SGSprite* sprite)
    SGuint sgSpriteGetHeight(SGSprite* sprite)

cdef class Sprite:
    cdef SGSprite* handle

    cpdef destroy(self)
    cpdef drawRads(self, x, y, z = ?, xscale = ?, yscale = ?, angle = ?)
    cpdef drawDegs(self, x, y, z = ?, xscale = ?, yscale = ?, angle = ?)
    cpdef draw(self, x, y, z = ?, xscale = ?, yscale = ?)
