This commit is contained in:
parent
9576f3dc94
commit
124a15101b
@ -281,7 +281,6 @@ BOOL RedrawFlag=FALSE;
|
||||
/*****************************************************************************/
|
||||
void CCore::MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
LastMousePos=point;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -324,7 +323,7 @@ void CCore::MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt)
|
||||
if (zDelta>0)
|
||||
Zoom(View,+1.0f);
|
||||
else
|
||||
Zoom(View,+1.0f);
|
||||
Zoom(View,-1.0f);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -336,23 +335,23 @@ Vector3 &ThisCam=GetCam();
|
||||
Ofs.Zero();
|
||||
if (theApp.GetCurrent()!=View->GetDocument()) return;
|
||||
|
||||
|
||||
CurrentMousePos=point;
|
||||
|
||||
// Handle Drag Movement
|
||||
if (nFlags & MK_MBUTTON)
|
||||
if (nFlags & MK_MBUTTON || nFlags & MK_SHIFT)
|
||||
{
|
||||
float XS,YS;
|
||||
RECT ThisRect;
|
||||
|
||||
View->GetWindowRect(&ThisRect);
|
||||
XS=ThisCam.z*4;//*Layer[ActiveLayer]->GetLayerZPos();
|
||||
YS=ThisCam.z*4;//*Layer[ActiveLayer]->GetLayerZPos();
|
||||
XS=ThisCam.z*4;
|
||||
YS=ThisCam.z*4;
|
||||
XS/=((ThisRect.right-ThisRect.left));
|
||||
YS/=((ThisRect.bottom-ThisRect.top));
|
||||
|
||||
Ofs.x=LastMousePos.x-CurrentMousePos.x;
|
||||
Ofs.y=LastMousePos.y-CurrentMousePos.y;
|
||||
LastMousePos=CurrentMousePos;
|
||||
|
||||
Ofs.x*=XS;
|
||||
Ofs.y*=YS;
|
||||
@ -382,7 +381,7 @@ Vector3 &ThisCam=GetCam();
|
||||
}
|
||||
View->Invalidate(); // Mouse still moved, so need to redraw windows, to get CursorPos (And pos render)
|
||||
}
|
||||
|
||||
LastMousePos=CurrentMousePos;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMapEditDoc
|
||||
LastClass=CMapEditView
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "mapedit.h"
|
||||
@ -77,7 +77,7 @@ Type=0
|
||||
BaseClass=CDocument
|
||||
HeaderFile=MapEditDoc.h
|
||||
ImplementationFile=MapEditDoc.cpp
|
||||
LastObject=ID_ZOOM_OUT
|
||||
LastObject=CMapEditDoc
|
||||
Filter=N
|
||||
VirtualFilter=DC
|
||||
|
||||
@ -86,7 +86,7 @@ Type=0
|
||||
BaseClass=CGLEnabledView
|
||||
HeaderFile=MapEditView.h
|
||||
ImplementationFile=MapEditView.cpp
|
||||
LastObject=ID_TOOLBAR_TILEPALETTE
|
||||
LastObject=CMapEditView
|
||||
Filter=C
|
||||
VirtualFilter=VWC
|
||||
|
||||
|
@ -180,4 +180,3 @@ void CMapEditView::OnActivebrushRight() {GetDocument()->ActiveBrushRight
|
||||
void CMapEditView::OnMapSetSize() {GetDocument()->MapSetSize(this);}
|
||||
|
||||
void CMapEditView::On2d3dToggle() {GetDocument()->Toggle2d3d(this);}
|
||||
|
||||
|
@ -3,11 +3,10 @@
|
||||
/*********************/
|
||||
|
||||
#include "stdafx.h"
|
||||
//#include "gl3d.h"
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
#include <gl\glut.h>
|
||||
#include <gl\glaux.h> // Header File For The Glaux Library
|
||||
#include <frame.hpp>
|
||||
#include <Vector>
|
||||
|
||||
#include "TexCache.h"
|
||||
@ -80,14 +79,15 @@ int CTexCache::AlignSize(int Size)
|
||||
/**************************************************************************************/
|
||||
void CTexCache::LoadBMP(char *Filename,sRGBData &RGBData)
|
||||
{
|
||||
FILE *File=NULL;
|
||||
AUX_RGBImageRec *Aux;
|
||||
Frame ThisFrame;
|
||||
|
||||
Aux=auxDIBImageLoad(Filename);
|
||||
RGBData.Width=Aux->sizeX;
|
||||
RGBData.Height=Aux->sizeY;
|
||||
RGBData.RGB=Aux->data;
|
||||
free(Aux); // Safe to free aux now, contents copied (I HATE AUX)
|
||||
ThisFrame.LoadBMP(Filename);
|
||||
|
||||
RGBData.Width=ThisFrame.GetWidth();
|
||||
RGBData.Height=ThisFrame.GetHeight();
|
||||
RGBData.RGB=(u8*)malloc(RGBData.Width*RGBData.Height*3);
|
||||
ThisFrame.FlipY();
|
||||
ThisFrame.MakeRGB(RGBData.RGB);
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
@ -95,14 +95,14 @@ void CTexCache::FreeBMP(sRGBData &RGBData)
|
||||
{
|
||||
if (RGBData.RGB)
|
||||
{
|
||||
free((unsigned char*)RGBData.RGB);
|
||||
free(RGBData.RGB);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
void CTexCache::LoadTex(sTex &ThisTex,sRGBData *TexData)
|
||||
{
|
||||
std::vector<u8> Buffer;
|
||||
u8 *Buffer;
|
||||
int TexWidth=TexData->Width;
|
||||
int TexHeight=TexData->Height;
|
||||
int GLWidth=AlignSize(TexWidth);
|
||||
@ -111,7 +111,7 @@ u8 *Src,*Dst;
|
||||
|
||||
// create RGB & alpha texture & ensuse texture is correct size for GL
|
||||
|
||||
Buffer.resize(GLWidth*GLHeight*4);
|
||||
Buffer=(u8*)malloc(GLWidth*GLHeight*4);
|
||||
Src=TexData->RGB;
|
||||
Dst=&Buffer[0];
|
||||
for (int Y=0; Y<TexHeight; Y++)
|
||||
@ -148,6 +148,7 @@ u8 *Src,*Dst;
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
free(Buffer);
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user