mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Removed old hook through prediction as 0.5.2 servers are no longer compatible
made it possible to load old maps Enumerated layers
This commit is contained in:
parent
5b27758650
commit
06afe36db4
|
@ -353,24 +353,10 @@ int CCollision::IsThrough(int x, int y)
|
||||||
int Findex = 0;
|
int Findex = 0;
|
||||||
if (m_pFront)
|
if (m_pFront)
|
||||||
Findex = m_pFront[Ny*m_Width+Nx].m_Index;
|
Findex = m_pFront[Ny*m_Width+Nx].m_Index;
|
||||||
if(!g_Config.m_ClPredictOldHookthrough)
|
if (Index == TILE_THROUGH)
|
||||||
{
|
return Index;
|
||||||
if (Index == TILE_THROUGH)
|
if (Findex == TILE_THROUGH)
|
||||||
return Index;
|
return Findex;
|
||||||
if (Findex == TILE_THROUGH)
|
|
||||||
return Findex;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Index == OLD_THROUGH1)
|
|
||||||
return Index;
|
|
||||||
if (Findex == OLD_THROUGH1)
|
|
||||||
return Findex;
|
|
||||||
if (Index == OLD_THROUGH2)
|
|
||||||
return Index;
|
|
||||||
if (Findex == OLD_THROUGH2)
|
|
||||||
return Findex;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||||
|
|
||||||
#include <base/tl/array.h>
|
|
||||||
|
|
||||||
#include <base/system.h>
|
#include <base/system.h>
|
||||||
|
|
||||||
#include <engine/shared/datafile.h>
|
#include <engine/shared/datafile.h>
|
||||||
|
@ -737,12 +735,12 @@ void CEditor::CallbackSaveMap(const char *pFileName, int StorageType, void *pUse
|
||||||
|
|
||||||
//TODO:DDRace:anyone find out why do we need to save twice for things to work!
|
//TODO:DDRace:anyone find out why do we need to save twice for things to work!
|
||||||
if(pEditor->Save(pFileName))
|
if(pEditor->Save(pFileName))
|
||||||
if(pEditor->Save(pFileName))
|
if(pEditor->Save(pFileName))
|
||||||
{
|
{
|
||||||
str_copy(pEditor->m_aFileName, pFileName, sizeof(pEditor->m_aFileName));
|
str_copy(pEditor->m_aFileName, pFileName, sizeof(pEditor->m_aFileName));
|
||||||
pEditor->m_ValidSaveFilename = StorageType == IStorage::TYPE_SAVE && pEditor->m_pFileDialogPath == pEditor->m_aFileDialogCurrentFolder;
|
pEditor->m_ValidSaveFilename = StorageType == IStorage::TYPE_SAVE && pEditor->m_pFileDialogPath == pEditor->m_aFileDialogCurrentFolder;
|
||||||
pEditor->m_Map.m_Modified = false;
|
pEditor->m_Map.m_Modified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEditor->m_Dialog = DIALOG_NONE;
|
pEditor->m_Dialog = DIALOG_NONE;
|
||||||
}
|
}
|
||||||
|
@ -971,7 +969,6 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
||||||
{
|
{
|
||||||
if(pT)
|
if(pT)
|
||||||
DoMapBorder();
|
DoMapBorder();
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
// do tele button
|
// do tele button
|
||||||
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
||||||
|
@ -1001,8 +998,6 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
||||||
{
|
{
|
||||||
static int s_SwitchPopupID = 0;
|
static int s_SwitchPopupID = 0;
|
||||||
UiInvokePopupMenu(&s_SwitchPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 36, PopupSwitch);
|
UiInvokePopupMenu(&s_SwitchPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 36, PopupSwitch);
|
||||||
=======
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1521,6 +1516,43 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
||||||
if(m_ShowTileInfo)
|
if(m_ShowTileInfo)
|
||||||
m_TilesetPicker.ShowInfo();
|
m_TilesetPicker.ShowInfo();
|
||||||
}
|
}
|
||||||
|
CLayerTele *pTelet = (CLayerTele *)GetSelectedLayerType(0, LAYERTYPE_TELE);
|
||||||
|
if(pTelet)
|
||||||
|
{
|
||||||
|
m_TilesetPicker.m_Image = pTelet->m_Image;
|
||||||
|
m_TilesetPicker.m_TexID = pTelet->m_TexID;
|
||||||
|
m_TilesetPicker.Render();
|
||||||
|
if(m_ShowTileInfo)
|
||||||
|
m_TilesetPicker.ShowInfo();
|
||||||
|
}
|
||||||
|
CLayerSpeedup *pSpeedupt = (CLayerSpeedup *)GetSelectedLayerType(0, LAYERTYPE_SPEEDUP);
|
||||||
|
if(pSpeedupt)
|
||||||
|
{
|
||||||
|
m_TilesetPicker.m_Image = pSpeedupt->m_Image;
|
||||||
|
m_TilesetPicker.m_TexID = pSpeedupt->m_TexID;
|
||||||
|
m_TilesetPicker.Render();
|
||||||
|
if(m_ShowTileInfo)
|
||||||
|
m_TilesetPicker.ShowInfo();
|
||||||
|
}
|
||||||
|
CLayerFront *pFrontt = (CLayerFront *)GetSelectedLayerType(0, LAYERTYPE_FRONT);
|
||||||
|
if(pFrontt)
|
||||||
|
{
|
||||||
|
m_TilesetPicker.m_Image = pFrontt->m_Image;
|
||||||
|
m_TilesetPicker.m_TexID = pFrontt->m_TexID;
|
||||||
|
m_TilesetPicker.Render();
|
||||||
|
if(m_ShowTileInfo)
|
||||||
|
m_TilesetPicker.ShowInfo();
|
||||||
|
}
|
||||||
|
CLayerSwitch *pSwitcht = (CLayerSwitch *)GetSelectedLayerType(0, LAYERTYPE_SWITCH);
|
||||||
|
if(pSwitcht)
|
||||||
|
{
|
||||||
|
m_TilesetPicker.m_Image = pSwitcht->m_Image;
|
||||||
|
m_TilesetPicker.m_TexID = pSwitcht->m_TexID;
|
||||||
|
m_TilesetPicker.Render();
|
||||||
|
if(m_ShowTileInfo)
|
||||||
|
m_TilesetPicker.ShowInfo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s_Operation = OP_NONE;
|
static int s_Operation = OP_NONE;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||||
|
|
||||||
#include <base/tl/array.h>
|
|
||||||
|
|
||||||
#include <engine/client.h>
|
#include <engine/client.h>
|
||||||
#include <engine/console.h>
|
#include <engine/console.h>
|
||||||
#include <engine/graphics.h>
|
#include <engine/graphics.h>
|
||||||
|
@ -295,19 +292,18 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
|
||||||
|
|
||||||
Item.m_Width = pLayer->m_Width;
|
Item.m_Width = pLayer->m_Width;
|
||||||
Item.m_Height = pLayer->m_Height;
|
Item.m_Height = pLayer->m_Height;
|
||||||
<<<<<<< HEAD
|
// Item.m_Flags = pLayer->m_Game ? TILESLAYERFLAG_GAME : 0;
|
||||||
//Item.m_Flags = pLayer->m_Game;
|
|
||||||
|
|
||||||
if(pLayer->m_Tele)
|
if(pLayer->m_Tele)
|
||||||
Item.m_Flags = 2;
|
Item.m_Flags = TILESLAYERFLAG_TELE;
|
||||||
else if(pLayer->m_Speedup)
|
else if(pLayer->m_Speedup)
|
||||||
Item.m_Flags = 4;
|
Item.m_Flags = TILESLAYERFLAG_SPEEDUP;
|
||||||
else if(pLayer->m_Front)
|
else if(pLayer->m_Front)
|
||||||
Item.m_Flags = 8;
|
Item.m_Flags = TILESLAYERFLAG_FRONT;
|
||||||
else if(pLayer->m_Switch)
|
else if(pLayer->m_Switch)
|
||||||
Item.m_Flags = 16;
|
Item.m_Flags = TILESLAYERFLAG_SWITCH;
|
||||||
else
|
else
|
||||||
Item.m_Flags = pLayer->m_Game;
|
Item.m_Flags = pLayer->m_Game ? TILESLAYERFLAG_GAME : 0;
|
||||||
|
|
||||||
Item.m_Image = pLayer->m_Image;
|
Item.m_Image = pLayer->m_Image;
|
||||||
if(pLayer->m_Tele)
|
if(pLayer->m_Tele)
|
||||||
|
@ -343,16 +339,11 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
|
||||||
delete[] Tiles;
|
delete[] Tiles;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Item.m_Data = df.AddData(pLayer->m_Width*pLayer->m_Height*sizeof(CTile), pLayer->m_pTiles);
|
|
||||||
=======
|
|
||||||
Item.m_Flags = pLayer->m_Game ? TILESLAYERFLAG_GAME : 0;
|
|
||||||
Item.m_Image = pLayer->m_Image;
|
|
||||||
Item.m_Data = df.AddData(pLayer->m_Width*pLayer->m_Height*sizeof(CTile), pLayer->m_pTiles);
|
Item.m_Data = df.AddData(pLayer->m_Width*pLayer->m_Height*sizeof(CTile), pLayer->m_pTiles);
|
||||||
|
|
||||||
// save layer name
|
// save layer name
|
||||||
StrToInts(Item.m_aName, sizeof(Item.m_aName)/sizeof(int), pLayer->m_aName);
|
StrToInts(Item.m_aName, sizeof(Item.m_aName)/sizeof(int), pLayer->m_aName);
|
||||||
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
df.AddItem(MAPITEMTYPE_LAYER, LayerCount, sizeof(Item), &Item);
|
df.AddItem(MAPITEMTYPE_LAYER, LayerCount, sizeof(Item), &Item);
|
||||||
|
|
||||||
GItem.m_NumLayers++;
|
GItem.m_NumLayers++;
|
||||||
|
@ -573,23 +564,35 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
||||||
MakeGameLayer(pTiles);
|
MakeGameLayer(pTiles);
|
||||||
MakeGameGroup(pGroup);
|
MakeGameGroup(pGroup);
|
||||||
}
|
}
|
||||||
else if(pTilemapItem->m_Flags&2)
|
else if(pTilemapItem->m_Flags&TILESLAYERFLAG_TELE)
|
||||||
{
|
{
|
||||||
|
if(pTilemapItem->m_Version <= 2)
|
||||||
|
pTilemapItem->m_Tele = *((int*)(pTilemapItem) + 15);
|
||||||
|
|
||||||
pTiles = new CLayerTele(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
pTiles = new CLayerTele(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
||||||
MakeTeleLayer(pTiles);
|
MakeTeleLayer(pTiles);
|
||||||
}
|
}
|
||||||
else if(pTilemapItem->m_Flags&4)
|
else if(pTilemapItem->m_Flags&TILESLAYERFLAG_SPEEDUP)
|
||||||
{
|
{
|
||||||
|
if(pTilemapItem->m_Version <= 2)
|
||||||
|
pTilemapItem->m_Speedup = *((int*)(pTilemapItem) + 16);
|
||||||
|
|
||||||
pTiles = new CLayerSpeedup(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
pTiles = new CLayerSpeedup(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
||||||
MakeSpeedupLayer(pTiles);
|
MakeSpeedupLayer(pTiles);
|
||||||
}
|
}
|
||||||
else if(pTilemapItem->m_Flags&8)
|
else if(pTilemapItem->m_Flags&TILESLAYERFLAG_FRONT)
|
||||||
{
|
{
|
||||||
|
if(pTilemapItem->m_Version <= 2)
|
||||||
|
pTilemapItem->m_Front = *((int*)(pTilemapItem) + 17);
|
||||||
|
|
||||||
pTiles = new CLayerFront(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
pTiles = new CLayerFront(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
||||||
MakeFrontLayer(pTiles);
|
MakeFrontLayer(pTiles);
|
||||||
}
|
}
|
||||||
else if(pTilemapItem->m_Flags&16)
|
else if(pTilemapItem->m_Flags&TILESLAYERFLAG_SWITCH)
|
||||||
{
|
{
|
||||||
|
if(pTilemapItem->m_Version <= 2)
|
||||||
|
pTilemapItem->m_Switch = *((int*)(pTilemapItem) + 18);
|
||||||
|
|
||||||
pTiles = new CLayerSwitch(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
pTiles = new CLayerSwitch(pTilemapItem->m_Width, pTilemapItem->m_Height);
|
||||||
MakeSwitchLayer(pTiles);
|
MakeSwitchLayer(pTiles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,8 +72,8 @@ void CLayerTiles::Render()
|
||||||
m_TexID = m_pEditor->m_Map.m_lImages[m_Image]->m_TexID;
|
m_TexID = m_pEditor->m_Map.m_lImages[m_Image]->m_TexID;
|
||||||
Graphics()->TextureSet(m_TexID);
|
Graphics()->TextureSet(m_TexID);
|
||||||
vec4 Color = vec4(m_Color.r/255.0f, m_Color.g/255.0f, m_Color.b/255.0f, m_Color.a/255.0f);
|
vec4 Color = vec4(m_Color.r/255.0f, m_Color.g/255.0f, m_Color.b/255.0f, m_Color.a/255.0f);
|
||||||
<<<<<<< HEAD
|
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT,
|
||||||
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT);
|
m_pEditor->EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
||||||
|
|
||||||
// Render DDRace Layers
|
// Render DDRace Layers
|
||||||
if(m_Tele)
|
if(m_Tele)
|
||||||
|
@ -82,10 +82,6 @@ void CLayerTiles::Render()
|
||||||
m_pEditor->RenderTools()->RenderSpeedupOverlay(((CLayerSpeedup*)this)->m_pSpeedupTile, m_Width, m_Height, 32.0f);
|
m_pEditor->RenderTools()->RenderSpeedupOverlay(((CLayerSpeedup*)this)->m_pSpeedupTile, m_Width, m_Height, 32.0f);
|
||||||
if(m_Switch)
|
if(m_Switch)
|
||||||
m_pEditor->RenderTools()->RenderSwitchOverlay(((CLayerSwitch*)this)->m_pSwitchTile, m_Width, m_Height, 32.0f);
|
m_pEditor->RenderTools()->RenderSwitchOverlay(((CLayerSwitch*)this)->m_pSwitchTile, m_Width, m_Height, 32.0f);
|
||||||
=======
|
|
||||||
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT,
|
|
||||||
m_pEditor->EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLayerTiles::ConvertX(float x) const { return (int)(x/32.0f); }
|
int CLayerTiles::ConvertX(float x) const { return (int)(x/32.0f); }
|
||||||
|
@ -250,20 +246,34 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
||||||
pGrabbed->m_SwitchDelay = m_pEditor->m_SwitchDelay;
|
pGrabbed->m_SwitchDelay = m_pEditor->m_SwitchDelay;
|
||||||
str_copy(pGrabbed->m_aFileName, m_pEditor->m_aFileName, sizeof(pGrabbed->m_aFileName));
|
str_copy(pGrabbed->m_aFileName, m_pEditor->m_aFileName, sizeof(pGrabbed->m_aFileName));
|
||||||
}
|
}
|
||||||
|
else if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pFrontLayer)
|
||||||
|
{
|
||||||
|
CLayerFront *pGrabbed = new CLayerFront(r.w, r.h);
|
||||||
|
pGrabbed->m_pEditor = m_pEditor;
|
||||||
|
pGrabbed->m_TexID = m_TexID;
|
||||||
|
pGrabbed->m_Image = m_Image;
|
||||||
|
pGrabbed->m_Game = m_Game;
|
||||||
|
pBrush->AddLayer(pGrabbed);
|
||||||
|
|
||||||
|
// copy the tiles
|
||||||
|
for(int y = 0; y < r.h; y++)
|
||||||
|
for(int x = 0; x < r.w; x++)
|
||||||
|
pGrabbed->m_pTiles[y*pGrabbed->m_Width+x] = m_pTiles[(r.y+y)*m_Width+(r.x+x)];
|
||||||
|
str_copy(pGrabbed->m_aFileName, m_pEditor->m_aFileName, sizeof(pGrabbed->m_aFileName));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLayerTiles *pGrabbed = new CLayerTiles(r.w, r.h);
|
CLayerTiles *pGrabbed = new CLayerTiles(r.w, r.h);
|
||||||
pGrabbed->m_pEditor = m_pEditor;
|
pGrabbed->m_pEditor = m_pEditor;
|
||||||
pGrabbed->m_TexID = m_TexID;
|
pGrabbed->m_TexID = m_TexID;
|
||||||
pGrabbed->m_Image = m_Image;
|
pGrabbed->m_Image = m_Image;
|
||||||
pGrabbed->m_Game = m_Game;
|
pGrabbed->m_Game = m_Game;
|
||||||
|
pBrush->AddLayer(pGrabbed);
|
||||||
|
|
||||||
pBrush->AddLayer(pGrabbed);
|
// copy the tiles
|
||||||
|
for(int y = 0; y < r.h; y++)
|
||||||
// copy the tiles
|
for(int x = 0; x < r.w; x++)
|
||||||
for(int y = 0; y < r.h; y++)
|
pGrabbed->m_pTiles[y*pGrabbed->m_Width+x] = m_pTiles[(r.y+y)*m_Width+(r.x+x)];
|
||||||
for(int x = 0; x < r.w; x++)
|
|
||||||
pGrabbed->m_pTiles[y*pGrabbed->m_Width+x] = m_pTiles[(r.y+y)*m_Width+(r.x+x)];
|
|
||||||
str_copy(pGrabbed->m_aFileName, m_pEditor->m_aFileName, sizeof(pGrabbed->m_aFileName));
|
str_copy(pGrabbed->m_aFileName, m_pEditor->m_aFileName, sizeof(pGrabbed->m_aFileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,9 +511,6 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
|
||||||
CUIRect Button;
|
CUIRect Button;
|
||||||
|
|
||||||
bool InGameGroup = !find_linear(m_pEditor->m_Map.m_pGameGroup->m_lLayers.all(), this).empty();
|
bool InGameGroup = !find_linear(m_pEditor->m_Map.m_pGameGroup->m_lLayers.all(), this).empty();
|
||||||
<<<<<<< HEAD
|
|
||||||
if(m_pEditor->m_Map.m_pGameLayer == this || m_pEditor->m_Map.m_pTeleLayer == this || m_pEditor->m_Map.m_pSpeedupLayer == this || m_pEditor->m_Map.m_pFrontLayer == this || m_pEditor->m_Map.m_pSwitchLayer == this)
|
|
||||||
=======
|
|
||||||
if(m_pEditor->m_Map.m_pGameLayer != this)
|
if(m_pEditor->m_Map.m_pGameLayer != this)
|
||||||
{
|
{
|
||||||
if(m_Image >= 0 && m_Image < m_pEditor->m_Map.m_lImages.size() && m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.IsLoaded())
|
if(m_Image >= 0 && m_Image < m_pEditor->m_Map.m_lImages.size() && m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.IsLoaded())
|
||||||
|
@ -521,8 +528,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(m_pEditor->m_Map.m_pGameLayer == this || m_pEditor->m_Map.m_pTeleLayer == this || m_pEditor->m_Map.m_pSpeedupLayer == this || m_pEditor->m_Map.m_pFrontLayer == this || m_pEditor->m_Map.m_pSwitchLayer == this)
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
InGameGroup = false;
|
InGameGroup = false;
|
||||||
|
|
||||||
if(InGameGroup)
|
if(InGameGroup)
|
||||||
|
@ -662,7 +668,8 @@ void CLayerTiles::ModifyEnvelopeIndex(INDEX_MODIFY_FUNC Func)
|
||||||
CLayerTele::CLayerTele(int w, int h)
|
CLayerTele::CLayerTele(int w, int h)
|
||||||
: CLayerTiles(w, h)
|
: CLayerTiles(w, h)
|
||||||
{
|
{
|
||||||
m_pTypeName = "Tele";
|
m_Type = LAYERTYPE_TELE;
|
||||||
|
str_copy(m_aName, "Tele", sizeof(m_aName));
|
||||||
m_Tele = 1;
|
m_Tele = 1;
|
||||||
|
|
||||||
m_pTeleTile = new CTeleTile[w*h];
|
m_pTeleTile = new CTeleTile[w*h];
|
||||||
|
@ -890,7 +897,8 @@ void CLayerTele::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
||||||
CLayerSpeedup::CLayerSpeedup(int w, int h)
|
CLayerSpeedup::CLayerSpeedup(int w, int h)
|
||||||
: CLayerTiles(w, h)
|
: CLayerTiles(w, h)
|
||||||
{
|
{
|
||||||
m_pTypeName = "Speedup";
|
m_Type = LAYERTYPE_SPEEDUP;
|
||||||
|
str_copy(m_aName, "Speedup", sizeof(m_aName));
|
||||||
m_Speedup = 1;
|
m_Speedup = 1;
|
||||||
|
|
||||||
m_pSpeedupTile = new CSpeedupTile[w*h];
|
m_pSpeedupTile = new CSpeedupTile[w*h];
|
||||||
|
@ -1141,7 +1149,8 @@ void CLayerSpeedup::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
||||||
CLayerFront::CLayerFront(int w, int h)
|
CLayerFront::CLayerFront(int w, int h)
|
||||||
: CLayerTiles(w, h)
|
: CLayerTiles(w, h)
|
||||||
{
|
{
|
||||||
m_pTypeName = "Front";
|
m_Type = LAYERTYPE_FRONT;
|
||||||
|
str_copy(m_aName, "Front", sizeof(m_aName));
|
||||||
m_Front = 1;
|
m_Front = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1219,7 +1228,8 @@ void CLayerFront::BrushDraw(CLayer *pBrush, float wx, float wy)
|
||||||
CLayerSwitch::CLayerSwitch(int w, int h)
|
CLayerSwitch::CLayerSwitch(int w, int h)
|
||||||
: CLayerTiles(w, h)
|
: CLayerTiles(w, h)
|
||||||
{
|
{
|
||||||
m_pTypeName = "Switch";
|
m_Type = LAYERTYPE_SWITCH;
|
||||||
|
str_copy(m_aName, "Switch", sizeof(m_aName));
|
||||||
m_Switch = 1;
|
m_Switch = 1;
|
||||||
|
|
||||||
m_pSwitchTile = new CSwitchTile[w*h];
|
m_pSwitchTile = new CSwitchTile[w*h];
|
||||||
|
|
|
@ -334,7 +334,8 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View)
|
||||||
}
|
}
|
||||||
|
|
||||||
// layer name
|
// layer name
|
||||||
if(pEditor->m_Map.m_pGameLayer != pEditor->GetSelectedLayer(0))
|
// if(pEditor->m_Map.m_pGameLayer != pEditor->GetSelectedLayer(0))
|
||||||
|
if(pEditor->m_Map.m_pGameLayer != pEditor->GetSelectedLayer(0) && pEditor->m_Map.m_pTeleLayer != pEditor->GetSelectedLayer(0) && pEditor->m_Map.m_pSpeedupLayer != pEditor->GetSelectedLayer(0) && pEditor->m_Map.m_pFrontLayer != pEditor->GetSelectedLayer(0) && pEditor->m_Map.m_pSwitchLayer != pEditor->GetSelectedLayer(0))
|
||||||
{
|
{
|
||||||
View.HSplitBottom(5.0f, &View, &Button);
|
View.HSplitBottom(5.0f, &View, &Button);
|
||||||
View.HSplitBottom(12.0f, &View, &Button);
|
View.HSplitBottom(12.0f, &View, &Button);
|
||||||
|
@ -365,7 +366,7 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View)
|
||||||
{0},
|
{0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// if(pEditor->m_Map.m_pGameLayer == pEditor->GetSelectedLayer(0)) // dont use Group and Detail from the selection if this is the game layer
|
||||||
if(pEditor->m_Map.m_pGameLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pTeleLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pSpeedupLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pFrontLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pSwitchLayer == pEditor->GetSelectedLayer(0)) // dont use Group and Detail from the selection if this is the game layer
|
if(pEditor->m_Map.m_pGameLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pTeleLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pSpeedupLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pFrontLayer == pEditor->GetSelectedLayer(0) || pEditor->m_Map.m_pSwitchLayer == pEditor->GetSelectedLayer(0)) // dont use Group and Detail from the selection if this is the game layer
|
||||||
{
|
{
|
||||||
aProps[0].m_Type = PROPTYPE_NULL;
|
aProps[0].m_Type = PROPTYPE_NULL;
|
||||||
|
@ -880,7 +881,46 @@ int CEditor::PopupSelectGameTileOpResult()
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
static int s_AutoMapConfigSelected = -1;
|
||||||
|
|
||||||
|
int CEditor::PopupSelectConfigAutoMap(CEditor *pEditor, CUIRect View)
|
||||||
|
{
|
||||||
|
CLayerTiles *pLayer = static_cast<CLayerTiles*>(pEditor->GetSelectedLayer(0));
|
||||||
|
CUIRect Button;
|
||||||
|
static int s_AutoMapperConfigButtons[256];
|
||||||
|
CAutoMapper *pAutoMapper = &pEditor->m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper;
|
||||||
|
|
||||||
|
for(int i = 0; i < pAutoMapper->ConfigNamesNum(); ++i)
|
||||||
|
{
|
||||||
|
View.HSplitTop(2.0f, 0, &View);
|
||||||
|
View.HSplitTop(12.0f, &Button, &View);
|
||||||
|
if(pEditor->DoButton_Editor(&s_AutoMapperConfigButtons[i], pAutoMapper->GetConfigName(i), 0, &Button, 0, 0))
|
||||||
|
s_AutoMapConfigSelected = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEditor::PopupSelectConfigAutoMapInvoke(float x, float y)
|
||||||
|
{
|
||||||
|
static int s_AutoMapConfigSelectID = 0;
|
||||||
|
s_AutoMapConfigSelected = -1;
|
||||||
|
CLayerTiles *pLayer = static_cast<CLayerTiles*>(GetSelectedLayer(0));
|
||||||
|
if(pLayer && pLayer->m_Image >= 0 && pLayer->m_Image < m_Map.m_lImages.size() &&
|
||||||
|
m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum())
|
||||||
|
UiInvokePopupMenu(&s_AutoMapConfigSelectID, 0, x, y, 120.0f, 12.0f+14.0f*m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum(), PopupSelectConfigAutoMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEditor::PopupSelectConfigAutoMapResult()
|
||||||
|
{
|
||||||
|
if(s_AutoMapConfigSelected < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
int Result = s_AutoMapConfigSelected;
|
||||||
|
s_AutoMapConfigSelected = -1;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
||||||
int CEditor::PopupTele(CEditor *pEditor, CUIRect View)
|
int CEditor::PopupTele(CEditor *pEditor, CUIRect View)
|
||||||
|
@ -905,29 +945,10 @@ int CEditor::PopupTele(CEditor *pEditor, CUIRect View)
|
||||||
|
|
||||||
if(Prop == PROP_TELE)
|
if(Prop == PROP_TELE)
|
||||||
pEditor->m_TeleNumber = clamp(NewVal, 0, 255);
|
pEditor->m_TeleNumber = clamp(NewVal, 0, 255);
|
||||||
=======
|
|
||||||
static int s_AutoMapConfigSelected = -1;
|
|
||||||
|
|
||||||
int CEditor::PopupSelectConfigAutoMap(CEditor *pEditor, CUIRect View)
|
|
||||||
{
|
|
||||||
CLayerTiles *pLayer = static_cast<CLayerTiles*>(pEditor->GetSelectedLayer(0));
|
|
||||||
CUIRect Button;
|
|
||||||
static int s_AutoMapperConfigButtons[256];
|
|
||||||
CAutoMapper *pAutoMapper = &pEditor->m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper;
|
|
||||||
|
|
||||||
for(int i = 0; i < pAutoMapper->ConfigNamesNum(); ++i)
|
|
||||||
{
|
|
||||||
View.HSplitTop(2.0f, 0, &View);
|
|
||||||
View.HSplitTop(12.0f, &Button, &View);
|
|
||||||
if(pEditor->DoButton_Editor(&s_AutoMapperConfigButtons[i], pAutoMapper->GetConfigName(i), 0, &Button, 0, 0))
|
|
||||||
s_AutoMapConfigSelected = i;
|
|
||||||
}
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
int CEditor::PopupSpeedup(CEditor *pEditor, CUIRect View)
|
int CEditor::PopupSpeedup(CEditor *pEditor, CUIRect View)
|
||||||
{
|
{
|
||||||
CUIRect Button;
|
CUIRect Button;
|
||||||
|
@ -990,24 +1011,4 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View)
|
||||||
pEditor->m_SwitchDelay = clamp(NewVal, 0, 255);
|
pEditor->m_SwitchDelay = clamp(NewVal, 0, 255);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
=======
|
|
||||||
void CEditor::PopupSelectConfigAutoMapInvoke(float x, float y)
|
|
||||||
{
|
|
||||||
static int s_AutoMapConfigSelectID = 0;
|
|
||||||
s_AutoMapConfigSelected = -1;
|
|
||||||
CLayerTiles *pLayer = static_cast<CLayerTiles*>(GetSelectedLayer(0));
|
|
||||||
if(pLayer && pLayer->m_Image >= 0 && pLayer->m_Image < m_Map.m_lImages.size() &&
|
|
||||||
m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum())
|
|
||||||
UiInvokePopupMenu(&s_AutoMapConfigSelectID, 0, x, y, 120.0f, 12.0f+14.0f*m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum(), PopupSelectConfigAutoMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEditor::PopupSelectConfigAutoMapResult()
|
|
||||||
{
|
|
||||||
if(s_AutoMapConfigSelected < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
int Result = s_AutoMapConfigSelected;
|
|
||||||
s_AutoMapConfigSelected = -1;
|
|
||||||
return Result;
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,14 +61,30 @@ void CLayers::Init(class IKernel *pKernel)
|
||||||
|
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
if(pTilemap->m_Flags&2)
|
if(pTilemap->m_Flags&TILESLAYERFLAG_TELE)
|
||||||
|
{
|
||||||
|
if(pTilemap->m_Version <= 2)
|
||||||
|
pTilemap->m_Tele = *((int*)(pTilemap) + 15);
|
||||||
m_pTeleLayer = pTilemap;
|
m_pTeleLayer = pTilemap;
|
||||||
if(pTilemap->m_Flags&4)
|
}
|
||||||
|
if(pTilemap->m_Flags&TILESLAYERFLAG_SPEEDUP)
|
||||||
|
{
|
||||||
|
if(pTilemap->m_Version <= 2)
|
||||||
|
pTilemap->m_Speedup = *((int*)(pTilemap) + 16);
|
||||||
m_pSpeedupLayer = pTilemap;
|
m_pSpeedupLayer = pTilemap;
|
||||||
if(pTilemap->m_Flags&8)
|
}
|
||||||
|
if(pTilemap->m_Flags&TILESLAYERFLAG_FRONT)
|
||||||
|
{
|
||||||
|
if(pTilemap->m_Version <= 2)
|
||||||
|
pTilemap->m_Front = *((int*)(pTilemap) + 17);
|
||||||
m_pFrontLayer = pTilemap;
|
m_pFrontLayer = pTilemap;
|
||||||
if(pTilemap->m_Flags&16)
|
}
|
||||||
|
if(pTilemap->m_Flags&TILESLAYERFLAG_SWITCH)
|
||||||
|
{
|
||||||
|
if(pTilemap->m_Version <= 2)
|
||||||
|
pTilemap->m_Switch = *((int*)(pTilemap) + 18);
|
||||||
m_pSwitchLayer = pTilemap;
|
m_pSwitchLayer = pTilemap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,10 @@ enum
|
||||||
LAYERTYPE_GAME, // not used
|
LAYERTYPE_GAME, // not used
|
||||||
LAYERTYPE_TILES,
|
LAYERTYPE_TILES,
|
||||||
LAYERTYPE_QUADS,
|
LAYERTYPE_QUADS,
|
||||||
|
LAYERTYPE_FRONT,
|
||||||
|
LAYERTYPE_TELE,
|
||||||
|
LAYERTYPE_SPEEDUP,
|
||||||
|
LAYERTYPE_SWITCH,
|
||||||
|
|
||||||
MAPITEMTYPE_VERSION=0,
|
MAPITEMTYPE_VERSION=0,
|
||||||
MAPITEMTYPE_INFO,
|
MAPITEMTYPE_INFO,
|
||||||
|
@ -141,10 +145,12 @@ enum
|
||||||
|
|
||||||
LAYERFLAG_DETAIL=1,
|
LAYERFLAG_DETAIL=1,
|
||||||
TILESLAYERFLAG_GAME=1,
|
TILESLAYERFLAG_GAME=1,
|
||||||
|
TILESLAYERFLAG_TELE=2,
|
||||||
|
TILESLAYERFLAG_SPEEDUP=4,
|
||||||
|
TILESLAYERFLAG_FRONT=8,
|
||||||
|
TILESLAYERFLAG_SWITCH=16,
|
||||||
|
|
||||||
ENTITY_OFFSET=255-16*4,
|
ENTITY_OFFSET=255-16*4,
|
||||||
OLD_THROUGH1=25,
|
|
||||||
OLD_THROUGH2=26
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CPoint
|
struct CPoint
|
||||||
|
@ -238,16 +244,14 @@ struct CMapItemLayerTilemap
|
||||||
int m_Image;
|
int m_Image;
|
||||||
int m_Data;
|
int m_Data;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
int m_aName[3];
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
||||||
int m_Tele;
|
int m_Tele;
|
||||||
int m_Speedup;
|
int m_Speedup;
|
||||||
int m_Front;
|
int m_Front;
|
||||||
int m_Switch;
|
int m_Switch;
|
||||||
=======
|
|
||||||
int m_aName[3];
|
|
||||||
>>>>>>> c56cfa12d511559b096579d4e7a80b7cb6bbb6fe
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
struct CMapItemLayerQuads
|
struct CMapItemLayerQuads
|
||||||
|
|
Loading…
Reference in a new issue