This commit is contained in:
parent
80cb6d30d8
commit
8aa783b27b
10 changed files with 63 additions and 73 deletions
|
@ -658,4 +658,6 @@ CExportPSX Exp(ExportName);
|
|||
Layer[FindActionLayer()]->Export(this,Exp);
|
||||
|
||||
Exp.ExportTiles(this);
|
||||
Exp.ExportTexList(this);
|
||||
|
||||
}
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include <Vector>
|
||||
#include "mapedit.h"
|
||||
|
||||
#include "Quantize.h"
|
||||
#include "list.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -16,6 +18,7 @@
|
|||
/*****************************************************************************/
|
||||
class CCore;
|
||||
class CMap;
|
||||
|
||||
class CTile;
|
||||
|
||||
class CExport
|
||||
|
@ -32,7 +35,9 @@ protected:
|
|||
char Drive[_MAX_DRIVE],Path[_MAX_DIR],Name[_MAX_FNAME],Ext[_MAX_EXT];
|
||||
FILE *File;
|
||||
int Count;
|
||||
std::vector<sMapElem> UsedTileList;
|
||||
|
||||
CList<sMapElem> UsedTileList;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -188,11 +188,11 @@ int Height=ThisMap.GetHeight();
|
|||
|
||||
if (Alpha<1)
|
||||
{
|
||||
glColor4f(0.5,0.5,0.5,Alpha);
|
||||
glColor4f(1,1,1,Alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
glColor3f(1,1,1);
|
||||
}
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
@ -229,9 +229,9 @@ float OverVal=0.5;
|
|||
|
||||
glBegin(GL_LINES);
|
||||
if (Active)
|
||||
glColor3ub(255,255,255);
|
||||
glColor3f(1,1,1);
|
||||
else
|
||||
glColor3ub(127,127,127);
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
|
||||
for (int YLoop=0; YLoop<Height+1; YLoop++)
|
||||
{
|
||||
|
|
|
@ -12,6 +12,12 @@ struct sMapElem
|
|||
int Set;
|
||||
int Tile;
|
||||
int Flags;
|
||||
|
||||
BOOL operator==(sMapElem const &v1) // Doesnt Check flags
|
||||
{
|
||||
return(Set==v1.Set && Tile==v1.Tile);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CNewMapGUI
|
||||
LastClass=CProgressDlg
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "mapedit.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=13
|
||||
ClassCount=14
|
||||
Class1=CChildFrame
|
||||
Class2=CGLEnabledView
|
||||
Class3=CMainFrame
|
||||
|
@ -18,22 +18,23 @@ Class6=CMapEditDoc
|
|||
Class7=CMapEditView
|
||||
|
||||
ResourceCount=11
|
||||
Resource1=IDD_LAYER_LIST_DIALOG
|
||||
Resource2=IDD_MULTIBAR (English (U.S.))
|
||||
Resource3=IDD_MAPSIZE
|
||||
Resource1=IDR_MAINFRAME (English (U.S.))
|
||||
Resource2=IDR_TOOLBAR (English (U.S.))
|
||||
Resource3=IDD_MULTIBAR (English (U.S.))
|
||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||
Resource5=IDR_TOOLBAR (English (U.S.))
|
||||
Resource5=IDD_LAYERTILE_GUI
|
||||
Class8=CMultiBar
|
||||
Resource6=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource6=IDD_NEW_LAYER
|
||||
Resource7=IDR_MAPEDITYPE (English (U.S.))
|
||||
Class9=CLayerList
|
||||
Class10=CMapSizeDlg
|
||||
Resource8=IDD_NEW_LAYER
|
||||
Resource8=IDD_LAYER_LIST_DIALOG
|
||||
Class11=CGfxToolBar
|
||||
Class12=CLayerTileGUI
|
||||
Resource9=IDD_LAYERTILE_GUI
|
||||
Resource10=IDR_MAINFRAME (English (U.S.))
|
||||
Resource9=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource10=IDD_MAPSIZE
|
||||
Class13=CNewMapGUI
|
||||
Class14=CProgressDlg
|
||||
Resource11=IDD_NEWMAP
|
||||
|
||||
[CLS:CChildFrame]
|
||||
|
@ -305,6 +306,15 @@ HeaderFile=NewMapGUI.h
|
|||
ImplementationFile=NewMapGUI.cpp
|
||||
BaseClass=CDialog
|
||||
Filter=D
|
||||
LastObject=IDC_MAPSIZE_WIDTH
|
||||
LastObject=CNewMapGUI
|
||||
VirtualFilter=dWC
|
||||
|
||||
[CLS:CProgressDlg]
|
||||
Type=0
|
||||
HeaderFile=ProgressDlg.h
|
||||
ImplementationFile=ProgressDlg.cpp
|
||||
BaseClass=CDialog
|
||||
Filter=D
|
||||
LastObject=IDC_EDIT1
|
||||
VirtualFilter=dWC
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ CFileDialog Dlg(FALSE,"*.pme",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,Filter
|
|||
char Filename[256];
|
||||
sprintf(Filename,"%s",Dlg.GetPathName());
|
||||
|
||||
Core.ExportAGB(Filename);
|
||||
Core.ExportPSX(Filename);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
|
|
@ -42,7 +42,7 @@ sRGBData ThisRGB;
|
|||
{
|
||||
int Idx=GetTexIdx(NewTex); // Is already loaded?
|
||||
if (Idx!=-1) return(Idx);
|
||||
// sprintf(NewTex.Filename,"%s%s",Path,TexName);
|
||||
|
||||
TRACE1("Loading Texture %s\n",NewTex.Filename);
|
||||
LoadBMP(NewTex.Filename,ThisRGB);
|
||||
RGBData=&ThisRGB;
|
||||
|
@ -100,25 +100,6 @@ void CTexCache::FreeBMP(sRGBData &RGBData)
|
|||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
/*
|
||||
for (int i=0;i<Size;i++)
|
||||
{
|
||||
u8 R=*RgbPtr++;
|
||||
u8 G=*RgbPtr++;
|
||||
u8 B=*RgbPtr++;
|
||||
u8 A=255;
|
||||
if ((R==BlankRGB.rgbRed && G==BlankRGB.rgbGreen && B==BlankRGB.rgbBlue)) // Create alpha for transparent pixels (flagged with PINK!!)
|
||||
{
|
||||
A=0;
|
||||
}
|
||||
|
||||
Buffer[(i*4)+0]=R;
|
||||
Buffer[(i*4)+1]=G;
|
||||
Buffer[(i*4)+2]=B;
|
||||
Buffer[(i*4)+3]=A;
|
||||
}
|
||||
*/
|
||||
|
||||
void CTexCache::LoadTex(sTex &ThisTex,sRGBData *TexData)
|
||||
{
|
||||
std::vector<u8> Buffer;
|
||||
|
@ -127,19 +108,18 @@ int TexHeight=TexData->Height;
|
|||
int GLWidth=AlignSize(TexWidth);
|
||||
int GLHeight=AlignSize(TexHeight);
|
||||
u8 *Src,*Dst;
|
||||
u8 R,G,B,A;
|
||||
|
||||
// create RGB & alpha texture & ensuse texture is correct size for GL
|
||||
|
||||
Buffer.resize(GLWidth*GLHeight*4);
|
||||
Src=TexData->RGB;
|
||||
Dst=&Buffer[0];
|
||||
for (int Y=0; Y<GLHeight; Y++)
|
||||
for (int Y=0; Y<TexHeight; Y++)
|
||||
{
|
||||
for (int X=0; X<GLWidth; X++)
|
||||
for (int X=0; X<TexWidth; X++)
|
||||
{
|
||||
u8 R,G,B,A;
|
||||
|
||||
if (X<=TexWidth && Y<=TexHeight)
|
||||
{
|
||||
Src=(u8*)&TexData->RGB[((Y*TexWidth)+X)*3];
|
||||
R=*Src++;
|
||||
G=*Src++;
|
||||
B=*Src++;
|
||||
|
@ -148,32 +128,21 @@ u8 R,G,B,A;
|
|||
{
|
||||
A=0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
R=255;
|
||||
G=0;
|
||||
B=255;
|
||||
A=255;
|
||||
}
|
||||
*Dst++=R;
|
||||
*Dst++=G;
|
||||
*Dst++=B;
|
||||
*Dst++=A;
|
||||
}
|
||||
Dst+=(GLWidth-TexWidth)*4;
|
||||
}
|
||||
|
||||
ThisTex.TexWidth=TexWidth;
|
||||
ThisTex.TexHeight=TexHeight;
|
||||
ThisTex.GLWidth=GLWidth;
|
||||
ThisTex.GLHeight=GLHeight;
|
||||
ThisTex.dW=1.0f/(GLWidth/16);
|
||||
ThisTex.dW=((float)TexWidth/(float)GLWidth)/(GLWidth/16);
|
||||
ThisTex.dH=((float)TexHeight/(float)GLHeight)/(GLHeight/16);
|
||||
|
||||
ThisTex.dW=(1.0f)/(float)(GLWidth/16.0f);
|
||||
ThisTex.dH=(1.0f)/(float)(GLHeight/16.0f);
|
||||
|
||||
glGenTextures(1, &ThisTex.TexID);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, ThisTex.TexID);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, 4, GLWidth, GLHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, &Buffer[0]);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
|
||||
|
|
|
@ -24,11 +24,9 @@ struct sRGBData
|
|||
struct sTex
|
||||
{
|
||||
char Filename[_MAX_PATH];
|
||||
// char Name[_MAX_FNAME];
|
||||
GLuint TexID;
|
||||
int Flags;
|
||||
int TexWidth,TexHeight;
|
||||
int GLWidth,GLHeight;
|
||||
float dW,dH;
|
||||
BOOL Loaded;
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ BOOL ValidTile=TRUE;
|
|||
ValidTile=IsTileValid(TileID);
|
||||
if (TileID && ValidTile)
|
||||
{
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
glColor3f(1,1,1);
|
||||
Tile[TileID].Render(0,Render3d);
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ BOOL ValidTile=TRUE;
|
|||
if (!ValidTile)
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
glColor3ub(255,255,255);
|
||||
glColor3f(1,1,1);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY1,0);
|
||||
|
@ -540,7 +540,7 @@ BOOL ValidTile=TRUE;
|
|||
CPoint Pos=GetTilePos(TileID);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glColor3ub(255,255,255);
|
||||
glColor3f(1,1,1);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY0,0);
|
||||
|
@ -621,7 +621,7 @@ int TileID=1; // Dont bother with blank, its sorted
|
|||
glTranslatef(CamPos.x+Pos.x*(1+TileBrowserGap),CamPos.y-Pos.y*(1+TileBrowserGap),CamPos.z);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glColor3ub(255,255,255);
|
||||
glColor3f(1,1,1);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY0,0);
|
||||
|
|
|
@ -64,9 +64,9 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 169
|
||||
#define _APS_NEXT_RESOURCE_VALUE 172
|
||||
#define _APS_NEXT_COMMAND_VALUE 32797
|
||||
#define _APS_NEXT_CONTROL_VALUE 1048
|
||||
#define _APS_NEXT_CONTROL_VALUE 1053
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue