This commit is contained in:
Daveo 2000-11-02 15:46:17 +00:00
parent 2518a438e2
commit 23d9f79f4c
11 changed files with 283 additions and 164 deletions

View file

@ -13,6 +13,7 @@
//#include "MapEditDoc.h"
//#include "MapEditView.h"
#include "Core.h"
#include "Layer.h"
#include "Utils.h"
@ -20,7 +21,7 @@
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
CLayer::CLayer()
CLayer::CLayer(CCore *_Core)
{
}
@ -29,6 +30,16 @@ CLayer::~CLayer()
{
}
/*****************************************************************************/
void CLayer::InitLayer(CCore *_Core)
{
int Width=Map.GetWidth();
int Height=Map.GetHeight();
Core=_Core;
TRACE3("%i x %i = %i\t",Width,Height,Width*Height);
}
/*****************************************************************************/
void CLayer::Render(Vec &MapPos,BOOL Is3d)
{
@ -39,22 +50,23 @@ void CLayer::Render(Vec &MapPos,BOOL Is3d)
}
/*****************************************************************************/
extern GLint TestTile;
void CLayer::Render2d(Vec &MapPos)
{
float XYDiv=GetLayerZPosDiv();
return;
int Width=Map.GetWidth();
int Height=Map.GetHeight();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(MapPos.x/XYDiv,MapPos.y/XYDiv,MapPos.z);
glBegin(GL_QUADS);
SetTestColor();
BuildGLQuad(-1,LayerWidth+1,-1,0,0); // Bottom
BuildGLQuad(-1,LayerWidth+1,LayerHeight+1,LayerHeight,0); // Top
BuildGLQuad(-1,0,LayerHeight,0,0); // Left
BuildGLQuad(LayerWidth,LayerWidth+1,LayerHeight,0,0); // Right
BuildGLQuad(-1,Width+1,-1,0,0); // Bottom
BuildGLQuad(-1,Width+1,Height+1,Height,0); // Top
BuildGLQuad(-1,0,Height,0,0); // Left
BuildGLQuad(Width,Width+1,Height,0,0); // Right
glEnd();
@ -65,14 +77,31 @@ float asd=0;
void CLayer::Render3d(Vec &MapPos)
{
float XYDiv=GetLayerZPosDiv();
float X,Y;
int XX=0;
int YY=0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(MapPos.x/XYDiv,MapPos.y/XYDiv,MapPos.z);
glRotatef(asd,0,1,0);
asd+=0.5;
glCallList(TestTile);
Y=MapPos.y;
for (YY=0; YY<3; YY++)
{
X=MapPos.x;
for (XX=0; XX<3; XX++)
{
glLoadIdentity();
glTranslatef(X/XYDiv,Y/XYDiv,MapPos.z);
// glRotatef(asd,0,1,0);
// asd+=0.5;
// glCallList(Core->GetTile(0,2));
glCallList(Core->GetTile(0,XX+(YY*3)));
X+=1.0f;
}
Y+=1.0f;
}
}