#ifndef _RW_LOG_H
#define _RW_LOG_H

#ifdef DISABLE_RW_LOG
#define RWLOG(event, entry)
#else
#define RWLOG(event, entry) LOG(RW_LOG_ON, event,entry)
#endif

#include "workrec.h"
#include "log.h"
#include "frustum.h"
#include "logentry.h"
#include "vec4.h"

class RW_UseKDTree_End_Entry {
public:
  Vec4 _R, _D;
  int _x, _y;
  _KDTreeNode *_startcell;
  Hit _givenhit;
  
  RW_UseKDTree_End_Entry (const Ray &ray, 
			   int x, int y, 
			    _KDTreeNode *kdtreestartcell, Hit &givenhit) : _R (ray.R()), _D (ray.D()), _x (x), _y(y), _startcell (kdtreestartcell), _givenhit (givenhit) {}
};

class RW_UseKDTree_Start_Entry {
public:
  Vec4 _R, _D;
  int _x, _y;
  _KDTreeNode *_startcell;
  Hit _givenhit;
  
  RW_UseKDTree_Start_Entry (const Ray &ray, 
			   int x, int y, 
			    _KDTreeNode *kdtreestartcell, Hit &givenhit) : _R (ray.R()), _D (ray.D()), _x (x), _y(y), _startcell (kdtreestartcell), _givenhit (givenhit) {}
};

class RW_DoOneRayFC_Start_Entry {
public:
  WorkRec *_WR;
  Vec4 _R, _D;
  int _x, _y;
  int _alltheway;
  _KDTreeNode *_next_cell;
  
  RW_DoOneRayFC_Start_Entry(WorkRec *WR, const Ray &ray, int x, int y, 
			    int alltheway,
			    _KDTreeNode *next_cell) : _WR (WR), _R (ray.R()),
    _D (ray.D()), _x (x), _y(y), _alltheway (alltheway),
    _next_cell (next_cell) {}
								    
};

class RW_DoOneRayFC_End_Entry {
public:
  WorkRec *_WR;
  Vec4 _R, _D;
  int _x, _y;
  int _alltheway;
  _KDTreeNode *_next_cell;
  
  Hit _hit;
  
  RW_DoOneRayFC_End_Entry(Hit &hit, WorkRec *WR, const Ray &ray, int x, int y, 
			    int alltheway,
			    _KDTreeNode *next_cell) : _WR (WR), _R (ray.R()),
    _D (ray.D()), _x (x), _y(y), _alltheway (alltheway),
    _next_cell (next_cell), _hit (hit) {}
};

class RW_Work_Start_Entry {
public:
  WorkRec *_WR;
  Frustum _f;
  
  RW_Work_Start_Entry (WorkRec *WR) : _WR (WR), _f (WR->_frustum) {}
};


class RW_Work_CastRay_Entry {
public:
  WorkRec *_WR;
  Vec4 _R, _D;
  int _x, _y;
  int _confirm; //whether we're confirming it too.
  
  RW_Work_CastRay_Entry (WorkRec *WR, const Ray &ray, int x, int y, int confirm) : _confirm (confirm), _WR (WR), _R (ray.R()), _D (ray.D()), _x (x), _y (y) {}
};

class RW_Work_ConfirmRay_Entry {
public:
  WorkRec *_WR;
  int _x, _y;
  
  RW_Work_ConfirmRay_Entry (WorkRec *WR, int x, int y) : _WR (WR), _x (x), _y (y) {}
};

class RW_Work_End_Entry {
public:
  Frustum _f;
  WorkRec *_WR;
  
  RW_Work_End_Entry (WorkRec *WR) : _WR (WR), _f (WR->_frustum) {}

};

#endif
