Commit a019b12b authored by bitplane's avatar bitplane

Made the GUI editor use MAKE_IRR_ID for its own event types instead of using...

Made the GUI editor use MAKE_IRR_ID for its own event types instead of using user events, and forced EEVENT_TYPE to 32-bit so this always works for users.

Renamed VC8 GUI editor and font tool project files. Disabled vector fonts since there's still no loader.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1618 dfc29bdd-3216-0410-991c-e03cc46cb475
parent dee929e0
......@@ -52,7 +52,12 @@ namespace irr
casted to s32 and used as UserData1 and UserData2.
MacOS: Not yet implemented
*/
EET_USER_EVENT
EET_USER_EVENT,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
EGUIET_FORCE_32_BIT = 0x7fffffff
};
//! Enumeration for all mouse input events
......
......@@ -22,7 +22,7 @@ namespace irr
namespace gui
{
const u32 ATTRIBEDIT_ATTRIB_CHANGED=0xA77ED17; // hopefully nobody else is using this number
const u32 ATTRIBEDIT_ATTRIB_CHANGED=MAKE_IRR_ID('A','T','T','R');
class CGUIAttribute : public IGUIElement
{
......@@ -133,10 +133,9 @@ namespace gui
{
// build event and pass to parent
SEvent event;
event.EventType = EET_USER_EVENT;
event.UserEvent.UserData1 = ATTRIBEDIT_ATTRIB_CHANGED;
event.UserEvent.UserData2 = MyParentID;
event.UserEvent.UserData3 = (f32)Index;
event.EventType = (EEVENT_TYPE)ATTRIBEDIT_ATTRIB_CHANGED;
event.UserEvent.UserData1 = MyParentID;
event.UserEvent.UserData2 = Index;
return Parent->OnEvent(event);
}
......
......@@ -224,14 +224,10 @@ bool CGUIEditWorkspace::OnEvent(const SEvent &e)
IGUIFileOpenDialog* dialog=0;
switch(e.EventType)
{
case EET_USER_EVENT:
case (EEVENT_TYPE)ATTRIBEDIT_ATTRIB_CHANGED:
{
switch (e.UserEvent.UserData1)
{
case ATTRIBEDIT_ATTRIB_CHANGED:
{
switch (e.UserEvent.UserData2)
{
case EGUIEDCE_ATTRIB_EDITOR:
{
// update selected items attributes
......@@ -257,10 +253,6 @@ bool CGUIEditWorkspace::OnEvent(const SEvent &e)
}
break;
}
}
break;
case EET_KEY_INPUT_EVENT:
if (!e.KeyInput.PressedDown)
{
......
......@@ -24,10 +24,9 @@ namespace gui
// custom events
enum EGUIEDIT_CUSTOM_EVENTS
{
EGUIEDCE_ATTRIB_EDITOR=0xED17, // some number hopefully nobody else is using
EGUIEDCE_OPTION_EDITOR,
EGUIEDCE_ENV_EDITOR,
EGUIEDCE_COUNT
EGUIEDCE_ATTRIB_EDITOR = MAKE_IRR_ID('g','A','t','t'),
EGUIEDCE_OPTION_EDITOR = MAKE_IRR_ID('g','O','p','t'),
EGUIEDCE_ENV_EDITOR = MAKE_IRR_ID('g','E','n','v')
};
class CGUIEditWorkspace : public IGUIElement
......
......@@ -650,7 +650,7 @@ bool CFontTool::saveBitmapFont(const c8 *filename, const c8* format)
c[0] = (*it).getKey();
c[1] = L'\0';
core::stringw area, under, over, image;
area = fa.rectangle.UpperLeftCorner.X;
area = core::stringw(fa.rectangle.UpperLeftCorner.X);
area += L", ";
area += fa.rectangle.UpperLeftCorner.Y;
area += L", ";
......@@ -668,7 +668,7 @@ bool CFontTool::saveBitmapFont(const c8 *filename, const c8* format)
// image number
if (fa.sourceimage != 0)
{
image = (s32) fa.sourceimage;
image = core::stringw(fa.sourceimage);
names.push_back(core::stringw(L"i"));
values.push_back(image);
}
......@@ -678,13 +678,13 @@ bool CFontTool::saveBitmapFont(const c8 *filename, const c8* format)
if (fa.underhang != 0)
{
under = fa.underhang;
under = core::stringw(fa.underhang);
names.push_back(core::stringw(L"u"));
values.push_back(under);
}
if (fa.overhang != 0)
{
over = fa.overhang;
over = core::stringw(fa.overhang);
names.push_back(core::stringw(L"o"));
values.push_back(over);
}
......
......@@ -1059,8 +1059,8 @@ public:
c[0] = chars[n];
c[1] = L'\0';
core::stringw area, under, over;
area = fa.rectangle.LowerRightCorner.X-
fa.rectangle.UpperLeftCorner.X;
area = core::stringw(fa.rectangle.LowerRightCorner.X-
fa.rectangle.UpperLeftCorner.X);
area += L", ";
area += fa.rectangle.LowerRightCorner.Y-
fa.rectangle.UpperLeftCorner.Y;
......@@ -1087,13 +1087,13 @@ public:
if (fa.underhang != 0)
{
under = fa.underhang;
under = core::stringw(fa.underhang);
names.push_back(core::stringw(L"u"));
values.push_back(under);
}
if (fa.overhang != 0)
{
over = fa.overhang;
over = core::stringw(fa.overhang);
names.push_back(core::stringw(L"o"));
values.push_back(over);
}
......@@ -1105,7 +1105,7 @@ public:
// write vertex data
core::stringw data, count;
data = L"";
count = triangles.positions.size();
count = core::stringw(triangles.positions.size());
for (u32 i=0; i<triangles.positions.size(); ++i)
{
if (i!=0)
......@@ -1119,7 +1119,7 @@ public:
// write index list
data = L"";
count = triangles.indexes.size();
count = core::stringw(triangles.indexes.size());
for (u32 i=0; i<triangles.indexes.size(); i+=3)
{
if (i!=0)
......

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_v8.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
......@@ -196,8 +196,9 @@ public:
chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_ANTIALIAS,true);
bool aa = chk->isChecked();
chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
bool vec = chk->isChecked();
// vector fonts disabled
//chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
bool vec = false;//chk->isChecked();
FontTool->makeBitmapFont(fontname, charset, FontTool->FontSizes[fontsize], texturesizes[texwidth], texturesizes[texheight], bold, italic, aa, alpha);
......@@ -254,8 +255,9 @@ public:
IGUIComboBox *fmt = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FORMAT,true);
core::stringc format = fmt->getItem(fmt->getSelected());
// vector fonts disabled
IGUICheckBox *chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
bool vec = chk->isChecked();
bool vec = false; // chk->isChecked();
if (vec && VecTool)
VecTool->saveVectorFont(name.c_str(), format.c_str());
......@@ -358,7 +360,10 @@ void createGUI(IrrlichtDevice* device, CFontTool* fc)
xp = xs;
yp += (s32)(h*1.5f);
/*
// vector fonts can't be loaded yet
env->addCheckBox(false, core::rect<s32>(xp,yp,xp+200,yp+h),win, MYGUI_VECTOR, L"Vector Font");
*/
yp += (s32)(h*1.5f);
......@@ -460,11 +465,11 @@ int main()
}
}
device->drop();
// drop the font tool and resources
fc->drop();
device->drop();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment