# 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 sprite cimport *
from texture cimport *

cdef extern from "siege/graphics/mask.h":
    struct SGMask:
        SGuint width
        SGuint height
        
        SGint xoffset
        SGint yoffset
        
        SGbool precise
        SGbool** field
    
    SGMask* sgMaskCreateSprite(SGSprite* sprite)
    SGMask* sgMaskCreateTexture2i(SGTexture* texture, SGint xoffset, SGint yoffset)
    SGMask* sgMaskCreateTexture(SGTexture* texture)
    SGMask* sgMaskCreateFile2i(char* fname, SGint xoffset, SGint yoffset)
    SGMask* sgMaskCreateFile(char* fname)
    void sgMaskDestroy(SGMask* mask)
    
    SGbool sgMaskCheckCollision(SGMask* m1, SGint x1, SGint y1, SGMask* m2, SGint x2, SGint y2)
    
    void sgMaskGetSize(SGMask* mask, SGuint* width, SGuint* height)
    SGuint sgMaskGetWidth(SGMask* mask)
    SGuint sgMaskGetHeight(SGMask* mask)
    
    void sgMaskDrawDBG(SGMask* mask, SGint x, SGint y, SGbool transparent)

cdef class Mask:
    cdef SGMask* handle

    cpdef destroy(self)
    cpdef checkCollision(self, SGint x1, SGint y1, Mask other, SGint x2, SGint y2)
    cpdef getSize(self)
    cpdef SGuint getWidth(self)
    cpdef SGuint getHeight(self)
    cpdef drawDBG(self, SGint x, SGint y, SGbool transparent = ?)
