/*
 * $Id: bg_rect.h,v 1.1 2003/02/07 18:15:44 wheeler Exp $
 *
 * $Log: bg_rect.h,v $
 * Revision 1.1  2003/02/07 18:15:44  wheeler
 * Fox's version of libultra and friends.
 *
 * Revision 1.9  1996/11/21  06:00:01  hayakawa
 * インクルードするべきファイルをインクルードしていなかった
 *
 * Revision 1.8  1996/10/29  12:42:17  hayakawa
 * スプライトマイクロコードテスト
 *
 * Revision 1.7  1996/10/20  09:05:58  hayakawa
 * _LANGUAGE_C_PLUS_PLUS を __cplusplus に変更
 *
 */

#ifndef __BG_RECT_H_
#define __BG_RECT_H_

#include "ultra64.h"
#include "bg_bitmap1x.h"

#define TEXRECT_FRAC 2		/* gSPTextureRectangle の 表示座標の小数桁数 */
#define TEXCOORD_FRAC 5		/* gSPTextureRectangle の s, t座標の小数桁数 */
#define DELTA_FRAC 10		/* gSPTextureRectangle の dsdx,dtdyの小数桁数 */

#ifdef __cplusplus
extern "C" {
#endif

void
dual_texture_draw(
    Gfx **glistpp,
    BG_Bitmap1x *bm1,
    int nm1,
    BG_Bitmap1x *bm2,
    int nm2,
    int xpos,			/* Ｘ座標 */
    int ypos,			/* Ｙ座標 */
    float xscale,		/* Ｘスケール（負の値は反転） */
    float yscale		/* Ｙスケール（負の値は反転） */
);

void
bg_drawbitmap1_tile4(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    unsigned char *timg,	/* テクスチャの先頭アドレス */
    int	fmt,			/* テクセルのフォーマット(RGBA,CI,IA,I) */
    int siz,			/* １テクセルのサイズ(4,8,16,32) */
    int xDot,			/* テクスチャの横サイズ */
    int yDot,			/* テクスチャの縦サイズ */
    int xPos,			/* Ｘ座標 */
    int yPos,			/* Ｙ座標 */
    float xScale,		/* Ｘスケール（負の値は反転） */
    float yScale		/* Ｙスケール（負の値は反転） */
);
void
bg_drawbitmap1_tile44(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    unsigned char *timg,	/* テクスチャの先頭アドレス */
    int	fmt,			/* テクセルのフォーマット(RGBA,CI,IA,I) */
    int siz,			/* １テクセルのサイズ(4,8,16,32) */
    int xDotW,			/* テクスチャのぶつり横サイズ */
    int xdelta,			/* 横補正値(バウンダリ対策用) */
    int delta_s,		/* 横補正値(１/３２スクロール用) */
    int xDot,			/* テクスチャの横サイズ */
    int yDot,			/* テクスチャの縦サイズ */
    float xPos,			/* Ｘ座標 */
    float yPos,			/* Ｙ座標 */
    float xScale,		/* Ｘスケール（負の値は反転）0.03125-1024.0 */
    float yScale		/* Ｙスケール（負の値は反転）0.03125-1024.0 */
);
void
bg_drawbitmap1_tile45(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    unsigned char *timg,	/* テクスチャの先頭アドレス */
    int	fmt,			/* テクセルのフォーマット(RGBA,CI,IA,I) */
    int siz,			/* １テクセルのサイズ(4,8,16,32) */
    int xDotW,			/* テクスチャのぶつり横サイズ */
    int xdelta,			/* 横補正値(バウンダリ対策用) */
    int delta_s,		/* 横補正値(１/３２スクロール用) */
    int xDot,			/* テクスチャの横サイズ */
    int yDot,			/* テクスチャの縦サイズ */
    float xPos,			/* Ｘ座標 */
    float yPos,			/* Ｙ座標 */
    float xScale,		/* Ｘスケール（負の値は反転）0.03125-1024.0 */
    float yScale		/* Ｙスケール（負の値は反転）0.03125-1024.0 */,
    void *tlut
);
void
bg_drawbitmap1_tile5(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    unsigned char *timg,	/* テクスチャの先頭アドレス */
    int	fmt,			/* テクセルのフォーマット(RGBA,CI,IA,I) */
    int siz,			/* １テクセルのサイズ(4,8,16,32) */
    int xDot,			/* テクスチャの横サイズ */
    int yDot,			/* テクスチャの縦サイズ */
    int xPos,			/* Ｘ座標 */
    int yPos,			/* Ｙ座標 */
    float xScale,		/* Ｘスケール（負の値は反転） */
    float yScale		/* Ｙスケール（負の値は反転） */
);

void
guSPScisTextureRectangle(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    int ulx,			/* 左上座標Ｘ 10.2 (負数も受け付ける) */
    int uly,			/* 左上座標Ｙ 10.2 (負数も受け付ける) */
    int lrx,			/* 左上座標Ｘ 10.2 (負数も受け付ける) */
    int lry,			/* 左上座標Ｙ 10.2 (負数も受け付ける) */
    int tile,			/*  = G_TX_RENDERTILE; */
    int s,			/* テクスチャ座標 s S10.5 */
    int t,			/* テクスチャ座標 t S10.5 */
    int dsdx,			/* Ｘスケール S5.10 */
    int dtdy			/* Ｙスケール S5.10 */
);

void
guSPScisTextureRectangle_CopyMode(
    Gfx **glistpp,		/* ディスプレイリストへのポインタのポインタ */
    int ulx,			/* 左上座標Ｘ 10.2 (負数も受け付ける) */
    int uly,			/* 左上座標Ｙ 10.2 (負数も受け付ける) */
    int lrx,			/* 左上座標Ｘ 10.2 (負数も受け付ける) */
    int lry,			/* 左上座標Ｙ 10.2 (負数も受け付ける) */
    int tile,			/*  = G_TX_RENDERTILE; */
    int s,			/* テクスチャ座標 s S10.5 */
    int t,			/* テクスチャ座標 t S10.5 */
    int dsdx,			/* Ｘスケール S5.10 */
    int dtdy			/* Ｙスケール S5.10 */
);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
