/*
	Ninja Library
	
	COPYRIGHT (C) SEGA ENTERSRISES,LTD.
*/

#ifndef	_NINJA_VAL2_H_
#define	_NINJA_VAL2_H_

extern Int volatile  _nj_eor_flag_;
extern Int volatile  _nj_eov_flag_;

extern	KMSURFACEDESC	_nj_framebuffer_surface0_;
extern	KMSURFACEDESC	_nj_framebuffer_surface1_;

extern	KMVERTEXCONTEXT	_nj_context_[NJD_CONTEXT_MAX];
extern	KMVERTEXCONTEXT	*_nj_current_ctx_;
extern	Uint32			_nj_ctx_color_mode_[NJD_CONTEXT_MAX];
extern	Uint32			*_nj_color_mode_;
extern	KMVERTEXBUFFDESC	_nj_vertex_buffer_;
extern	KMVERTEXCONTEXT	_nj_background_ctx_;

/******************************/
/* Global Variable for Motion */

/*			Motion			*/
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_data_func_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_shape_data_func_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_data_func_table_[5];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shape_data_func_table_[4];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shape_int_func_table_[2];
extern NJF_MOTION_INT_F_FUNC	*_nj_motion_int_f_func_table_[2];
extern NJF_MOTION_INT_A_FUNC	*_nj_motion_int_a_func_table_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_translate_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_rotate_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_scale_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_rotate_zxy_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_shape_;
extern NJF_MOTION_INT_A_FUNC	*_nj_motion_int_a_func_table_old_[2];
extern NJS_MOTION_MDATA_INFO	_nj_motion_data_info_, _nj_shape_data_info_;
extern Uint16	_nj_mot_data_cnt_, _nj_mot_data_type_;
extern Uint16	_nj_mot_shape_data_cnt_, _nj_mot_shape_data_type_;

/*			MotionLink		*/
extern NJF_MOTION_OBJECT_FUNC	*_nj_motlink_data_func_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shapelink_data_func_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_motlink_data_func_table_[5];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shapelink_data_func_table_[4];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shapelink_int_func_table_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_shapelink_int_func_table[2];
extern NJF_MOTION_INT_F_FUNC	*_nj_motlink_int_f_func_table_[2];
extern NJF_MOTION_INT_A_FUNC	*_nj_motlink_int_a_func_table_[2];
extern NJF_MOTION_ROTATE_FUNC	*_nj_rotate_func_;
extern NJF_INT_F_FUNC	*_nj_int_f_func_table_[2];
extern NJF_INT_A_FUNC	*_nj_int_a_func_table_[2];
extern NJF_INT_F_FUNC	*_nj_int_f_func_;
extern NJF_INT_A_FUNC	*_nj_int_a_func_;
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_translate_data_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_rotate_data_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_scale_data_[2];
extern NJF_MOTION_OBJECT_FUNC	*_nj_motion_shape_data_[2];
extern NJF_MOTION_INT_A_FUNC	*_nj_motlink_int_a_func_table_old_[2];
extern NJF_INT_A_FUNC	*_nj_int_a_func_table_old_[2];
extern NJS_MOTION_MDATA_INFO	_nj_motlink_data_info_[2], _nj_shapelink_data_info_[2];
extern Uint16	_nj_motlink_data_cnt_[2], _nj_motlink_data_type_[2];
extern Uint16	_nj_motlink_shape_data_cnt_[2], _nj_motlink_shape_data_type_[2];
extern Uint16	_nj_mot_current_data_;
extern Float	_nj_mot_current_frame_;
extern Uint16	_nj_pos_int_flag_, _nj_ang_int_flag_, _nj_scl_int_flag_;
extern Uint16	_nj_pnt_int_flag_, _nj_nml_int_flag_;
extern Float	_nj_motion_link_pos_[12], _nj_motion_link_scl_[12];
extern Angle	_nj_motion_link_ang_[12];
extern NJS_POINT3	*_nj_shape_link_point_[4];
extern NJS_VECTOR	*_nj_shape_link_normal_[4];

/*		Motion & MotionLink		*/
extern NJF_MOTION_INT_F_FUNC	*_nj_motion_int_f_func_;
extern NJF_MOTION_INT_A_FUNC	*_nj_motion_int_a_func_;
extern NJF_MOTION_MODEL_FUNC	*_nj_draw_model_sub_;
extern Uint16	_nj_mot_spline_cnt_, _nj_mot_shape_spline_cnt_;
extern Float *_nj_shape_buf_;


/******************************/
/* Global Variable for Light  */

extern	NJS_LIGHT_CONTROLLER	_nj_light_control_;	/* a controller of Lights */
extern	NJS_LIGHT_QUEUE			_nj_light_queue_;	/* the queue of Lights */

/******************************/
/* Global Variable for Texture */
extern char fileext[][5];
extern NJS_TEXSURFACE		_nj_tex_err_surface;
extern NJS_LOADTFUNC f[3];
extern Uint32 ImageByteSize[12];
extern Sint32 _nj_tex_ext_;

/******************************/
/* Global Variable for Matrix */
extern Int _nj_matrix_flag_;         /* flag for 2nd Matrix  1: Use    0: Not Use */


/*	Call Back	*/
extern	void (*_nj_motion_callback_)(NJS_OBJECT *obj);

/******************************/
/* Global Variable for Camera */
extern NJS_MATRIX _nj_camera_matrix_;
#endif
