2010-10-17 09:42:49 +00:00
|
|
|
/* ZZ Open GL graphics plugin
|
|
|
|
* Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
|
|
|
|
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2010-11-23 03:35:01 +00:00
|
|
|
#ifndef ZZOGLDRAWING_H_INCLUDED
|
|
|
|
#define ZZOGLDRAWING_H_INCLUDED
|
2010-10-17 09:42:49 +00:00
|
|
|
|
2010-10-23 08:15:39 +00:00
|
|
|
#include "Util.h"
|
2010-10-17 09:42:49 +00:00
|
|
|
#include "GS.h"
|
|
|
|
|
2011-04-27 17:49:34 +00:00
|
|
|
// extern bool __forceinline NoHighlights(int i);
|
|
|
|
|
|
|
|
// return true if triangle SHOULD be painted.
|
|
|
|
// Hackish and should be replaced.
|
|
|
|
// Previous version was an inlined function but gcc-4.6 does not want to inline it.
|
|
|
|
// Because the code is in the middle of vertex which are very often call,
|
|
|
|
// a basic macro is more effective -- Gregory
|
|
|
|
#define NoHighlights(I) (!(conf.settings().xenosaga_spec) || !vb[(I)].zbuf.zmsk || prim->iip)
|
2010-10-17 09:42:49 +00:00
|
|
|
|
2010-10-23 23:02:19 +00:00
|
|
|
enum PRIM_TYPE {
|
|
|
|
PRIM_POINT = 0,
|
|
|
|
PRIM_LINE,
|
|
|
|
PRIM_LINE_STRIP,
|
|
|
|
PRIM_TRIANGLE,
|
|
|
|
PRIM_TRIANGLE_STRIP,
|
|
|
|
PRIM_TRIANGLE_FAN,
|
|
|
|
PRIM_SPRITE,
|
|
|
|
PRIM_DUMMY
|
|
|
|
};
|
|
|
|
|
2010-10-23 08:15:39 +00:00
|
|
|
class Kick
|
|
|
|
{
|
|
|
|
private:
|
2010-10-25 18:31:38 +00:00
|
|
|
// template<bool DO_Z_FOG> void Set_Vertex(VertexGPU *p, int i);
|
|
|
|
template<bool DO_Z_FOG> void Set_Vertex(VertexGPU *p, Vertex &gsvertex);
|
2010-10-24 10:23:06 +00:00
|
|
|
void Output_Vertex(VertexGPU vert, u32 id);
|
2010-10-26 21:14:15 +00:00
|
|
|
bool ValidPrevPrim;
|
2010-10-23 08:15:39 +00:00
|
|
|
public:
|
2012-05-26 09:58:37 +00:00
|
|
|
Kick() : ValidPrevPrim(false) { }
|
2010-10-23 08:15:39 +00:00
|
|
|
~Kick() { }
|
|
|
|
|
|
|
|
void KickVertex(bool adc);
|
2010-11-06 06:28:45 +00:00
|
|
|
|
2010-10-23 23:02:19 +00:00
|
|
|
void DrawPrim(u32 i);
|
2010-10-26 21:14:15 +00:00
|
|
|
|
|
|
|
inline void DirtyValidPrevPrim() {
|
|
|
|
ValidPrevPrim = 0;
|
|
|
|
}
|
2010-10-23 08:15:39 +00:00
|
|
|
};
|
|
|
|
extern Kick* ZZKick;
|
2010-10-17 15:49:34 +00:00
|
|
|
|
2010-11-23 03:35:01 +00:00
|
|
|
#endif // ZZOGLDRAWING_H_INCLUDED
|