本文整理汇总了C++中aurora::GFFStruct类的典型用法代码示例。如果您正苦于以下问题:C++ GFFStruct类的具体用法?C++ GFFStruct怎么用?C++ GFFStruct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GFFStruct类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: load
void Creature::load(const Aurora::GFFStruct &instance, const Aurora::GFFStruct *blueprint) {
assert(!_loaded);
// General properties
if (blueprint)
loadProperties(*blueprint); // Blueprint
loadProperties(instance); // Instance
// Appearance
if (_appearance == Aurora::kFieldIDInvalid)
throw Common::Exception("Creature without an appearance");
loadAppearance();
// Position
setPosition(instance.getDouble("XPosition"),
instance.getDouble("YPosition"),
instance.getDouble("ZPosition"));
// Orientation
float bearingX = instance.getDouble("XOrientation");
float bearingY = instance.getDouble("YOrientation");
float o[3];
Common::vector2orientation(bearingX, bearingY, o[0], o[1], o[2]);
setOrientation(o[0], o[1], o[2]);
_loaded = true;
}
开发者ID:gitter-badger,项目名称:xoreos,代码行数:35,代码来源:creature.cpp
示例2: createText
KotORWidget::Text KotORWidget::createText(const Aurora::GFFStruct &gff) {
Text text;
if (gff.hasField("TEXT")) {
const Aurora::GFFStruct &t = gff.getStruct("TEXT");
text.font = t.getString("FONT");
text.text = t.getString("TEXT");
text.strRef = t.getUint("STRREF", Aurora::kStrRefInvalid);
const uint32 alignment = t.getUint("ALIGNMENT");
t.getVector("COLOR", text.r, text.g, text.b);
text.pulsing = t.getBool("PULSING");
if (text.text == "(Unitialized)")
text.text.clear();
if (text.strRef != Aurora::kStrRefInvalid)
text.text = TalkMan.getString(text.strRef);
// TODO: KotORWidget::getText(): Alignment
if (alignment == 18) {
text.halign = 0.5;
text.valign = 0.5;
}
}
return text;
}
开发者ID:OrangeTide,项目名称:xoreos,代码行数:32,代码来源:kotorwidget.cpp
示例3: loadPortrait
void Situated::loadPortrait(const Aurora::GFFStruct &gff) {
uint32 portraitID = gff.getUint("PortraitId");
if (portraitID != 0) {
const Aurora::TwoDAFile &twoda = TwoDAReg.get("portraits");
Common::UString portrait = twoda.getRow(portraitID).getString("BaseResRef");
if (!portrait.empty())
_portrait = "po_" + portrait;
}
_portrait = gff.getString("Portrait", _portrait);
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:12,代码来源:situated.cpp
示例4: loadObject
void Door::loadObject(const Aurora::GFFStruct &gff) {
// Generic type
_genericType = gff.getUint("GenericType", _genericType);
// State
_state = (State) gff.getUint("AnimationState", (uint) _state);
// Linked to
_linkedToFlag = (LinkedToFlag) gff.getUint("LinkedToFlags", (uint) _linkedToFlag);
_linkedTo = gff.getString("LinkedTo");
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:14,代码来源:door.cpp
示例5: createExtend
KotORWidget::Extend KotORWidget::createExtend(const Aurora::GFFStruct &gff) {
Extend extend;
if (gff.hasField("EXTENT")) {
const Aurora::GFFStruct &e = gff.getStruct("EXTENT");
extend.x = (float) e.getSint("LEFT");
extend.y = (float) e.getSint("TOP");
extend.w = (float) e.getSint("WIDTH");
extend.h = (float) e.getSint("HEIGHT");
}
return extend;
}
开发者ID:OrangeTide,项目名称:xoreos,代码行数:14,代码来源:kotorwidget.cpp
示例6: loadProperties
void Creature::loadProperties(const Aurora::GFFStruct &gff) {
// Tag
_tag = gff.getString("Tag", _tag);
// Name
if (gff.hasField("LocName")) {
Aurora::LocString name;
gff.getLocString("LocName", name);
_name = name.getString();
}
// Description
if (gff.hasField("Description")) {
Aurora::LocString description;
gff.getLocString("Description", description);
_description = description.getString();
}
// Portrait
loadPortrait(gff);
// Appearance
_appearance = gff.getUint("Appearance_Type", _appearance);
// Static
_static = gff.getBool("Static", _static);
// Usable
_usable = gff.getBool("Useable", _usable);
}
开发者ID:gitter-badger,项目名称:xoreos,代码行数:32,代码来源:creature.cpp
示例7: loadProperties
void Area::loadProperties(const Aurora::GFFStruct &props) {
// Ambient sound
const Aurora::TwoDAFile &ambientSound = TwoDAReg.get("ambientsound");
uint32 ambientDay = props.getUint("AmbientSndDay" , Aurora::kStrRefInvalid);
uint32 ambientNight = props.getUint("AmbientSndNight", Aurora::kStrRefInvalid);
_ambientDay = ambientSound.getRow(ambientDay ).getString("Resource");
_ambientNight = ambientSound.getRow(ambientNight).getString("Resource");
uint32 ambientDayVol = CLIP<uint32>(props.getUint("AmbientSndDayVol" , 127), 0, 127);
uint32 ambientNightVol = CLIP<uint32>(props.getUint("AmbientSndNightVol", 127), 0, 127);
_ambientDayVol = 1.25 * (1.0 - (1.0 / powf(5.0, ambientDayVol / 127.0)));
_ambientNightVol = 1.25 * (1.0 - (1.0 / powf(5.0, ambientNightVol / 127.0)));
// TODO: PresetInstance0 - PresetInstance7
// Ambient music
const Aurora::TwoDAFile &ambientMusic = TwoDAReg.get("ambientmusic");
uint32 musicDay = props.getUint("MusicDay" , Aurora::kStrRefInvalid);
uint32 musicNight = props.getUint("MusicNight" , Aurora::kStrRefInvalid);
_musicDay = ambientMusic.getRow(musicDay ).getString("Resource");
_musicNight = ambientMusic.getRow(musicNight).getString("Resource");
// Battle music
uint32 musicBattle = props.getUint("MusicBattle", Aurora::kStrRefInvalid);
if (musicBattle != Aurora::kStrRefInvalid) {
_musicBattle = ambientMusic.getRow(musicBattle).getString("Resource");
// Battle stingers
Common::UString stinger[3];
stinger[0] = ambientMusic.getRow(musicBattle).getString("Stinger1");
stinger[1] = ambientMusic.getRow(musicBattle).getString("Stinger2");
stinger[2] = ambientMusic.getRow(musicBattle).getString("Stinger3");
for (int i = 0; i < 3; i++)
if (!stinger[i].empty())
_musicBattleStinger.push_back(stinger[i]);
}
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:49,代码来源:area.cpp
示例8: loadProperties
void Waypoint::loadProperties(const Aurora::GFFStruct &gff) {
// Tag
_tag = gff.getString("Tag", _tag);
// Map note
_hasMapNote = gff.getBool("MapNoteEnabled", _hasMapNote);
if (gff.hasField("MapNote")) {
Aurora::LocString mapNote;
gff.getLocString("MapNote", mapNote);
_mapNote = mapNote.getString();
}
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:15,代码来源:waypoint.cpp
示例9: loadARE
void Area::loadARE(const Aurora::GFFStruct &are) {
// Name
Aurora::LocString name;
are.getLocString("Name", name);
_name = name.getString();
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:8,代码来源:area.cpp
示例10: createBorder
KotORWidget::Border KotORWidget::createBorder(const Aurora::GFFStruct &gff) {
Border border;
if (gff.hasField("BORDER")) {
const Aurora::GFFStruct &b = gff.getStruct("BORDER");
border.corner = b.getString("CORNER");
border.edge = b.getString("EDGE");
border.fill = b.getString("FILL");
border.fillStyle = b.getUint("FILLSTYLE");
border.dimension = b.getUint("DIMENSION");
border.innerOffset = b.getUint("INNEROFFSET");
b.getVector("COLOR", border.r, border.g, border.b);
border.pulsing = b.getBool("PULSING");
}
return border;
}
开发者ID:OrangeTide,项目名称:xoreos,代码行数:20,代码来源:kotorwidget.cpp
示例11: loadGIT
void Area::loadGIT(const Aurora::GFFStruct &git) {
if (git.hasField("AreaProperties"))
loadProperties(git.getStruct("AreaProperties"));
if (git.hasField("Placeable List"))
loadPlaceables(git.getList("Placeable List"));
if (git.hasField("Door List"))
loadDoors(git.getList("Door List"));
if (git.hasField("Creature List"))
loadCreatures(git.getList("Creature List"));
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:13,代码来源:area.cpp
示例12: loadProperties
void Situated::loadProperties(const Aurora::GFFStruct &gff) {
// Tag
_tag = gff.getString("Tag", _tag);
// Name
if (gff.hasField("LocName")) {
Aurora::LocString name;
gff.getLocString("LocName", name);
_name = name.getString();
}
// Description
if (gff.hasField("Description")) {
Aurora::LocString description;
gff.getLocString("Description", description);
_description = description.getString();
}
// Portrait
loadPortrait(gff);
// Appearance
_appearanceID = gff.getUint("Appearance", _appearanceID);
// Conversation
_conversation = gff.getString("Conversation", _conversation);
// Static
_static = gff.getBool("Static", _static);
// Usable
_usable = gff.getBool("Useable", _usable);
// Locked
_locked = gff.getBool("Locked", _locked);
// Scripts
readScripts(gff);
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:41,代码来源:situated.cpp
示例13: load
void KotORWidget::load(const Aurora::GFFStruct &gff) {
gff.getVector("COLOR", _r, _g, _b);
_a = gff.getDouble("ALPHA", 1.0);
Extend extend = createExtend(gff);
_width = extend.w;
_height = extend.h;
Widget::setPosition(extend.x, extend.y, 0.0);
Border border = createBorder(gff);
_quad = new Graphics::Aurora::GUIQuad(border.fill, 0.0, 0.0, extend.w, extend.h);
_quad->setPosition(extend.x, extend.y, 0.0);
_quad->setTag(getTag());
_quad->setClickable(true);
if (border.fill.empty())
_quad->setColor(0.0, 0.0, 0.0, 0.0);
Text text = createText(gff);
if (!text.text.empty() && !text.font.empty()) {
_text = new Graphics::Aurora::HighlightableText(FontMan.get(text.font), text.text,
text.r, text.g, text.b, 1.0);
const float hspan = extend.w - _text->getWidth();
const float vspan = extend.h - _text->getHeight();
const float x = extend.x + text.halign * hspan;
const float y = extend.y + text.valign * vspan;
_text->setPosition(x, y, -1.0);
_text->setTag(getTag());
_text->setClickable(true);
}
}
开发者ID:OrangeTide,项目名称:xoreos,代码行数:39,代码来源:kotorwidget.cpp
示例14: load
void Waypoint::load(const Aurora::GFFStruct &instance, const Aurora::GFFStruct *blueprint) {
// General properties
if (blueprint)
loadProperties(*blueprint); // Blueprint
loadProperties(instance); // Instance
// Position
setPosition(instance.getDouble("XPosition"),
instance.getDouble("YPosition"),
instance.getDouble("ZPosition"));
// Orientation
float bearingX = instance.getDouble("XOrientation");
float bearingY = instance.getDouble("YOrientation");
float o[3];
Common::vector2orientation(bearingX, bearingY, o[0], o[1], o[2]);
setOrientation(o[0], o[1], o[2]);
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:23,代码来源:waypoint.cpp
示例15: load
void Placeable::load(const Aurora::GFFStruct &placeable) {
Common::UString temp = placeable.getString("TemplateResRef");
Aurora::GFFFile *utp = 0;
if (!temp.empty()) {
try {
utp = new Aurora::GFFFile(temp, Aurora::kFileTypeUTP, MKTAG('U', 'T', 'P', ' '));
} catch (...) {
}
}
Situated::load(placeable, utp ? &utp->getTopLevel() : 0);
delete utp;
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:15,代码来源:placeable.cpp
示例16: load
void Situated::load(const Aurora::GFFStruct &instance, const Aurora::GFFStruct *blueprint) {
// General properties
if (blueprint)
loadProperties(*blueprint); // Blueprint
loadProperties(instance); // Instance
// Specialized object properties
if (blueprint)
loadObject(*blueprint); // Blueprint
loadObject(instance); // Instance
// Appearance
if (_appearanceID == Aurora::kFieldIDInvalid)
throw Common::Exception("Situated object without an appearance");
loadAppearance();
loadSounds();
// Position
setPosition(instance.getDouble("X"),
instance.getDouble("Y"),
instance.getDouble("Z"));
// Orientation
float bearing = instance.getDouble("Bearing");
setOrientation(0.0, Common::rad2deg(bearing), 0.0);
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:36,代码来源:situated.cpp
示例17: load
void Door::load(const Aurora::GFFStruct &door) {
Common::UString temp = door.getString("TemplateResRef");
Aurora::GFFFile *utd = 0;
if (!temp.empty()) {
try {
utd = new Aurora::GFFFile(temp, Aurora::kFileTypeUTD, MKTAG('U', 'T', 'D', ' '));
} catch (...) {
}
}
Situated::load(door, utd ? &utd->getTopLevel() : 0);
delete utd;
setModelState();
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:17,代码来源:door.cpp
示例18: load
void Door::load(const Aurora::GFFStruct &door) {
Common::UString temp = door.getString("TemplateResRef");
Aurora::GFFFile *utd = 0;
if (!temp.empty()) {
try {
utd = new Aurora::GFFFile(temp, Aurora::kFileTypeUTD, MKTAG('U', 'T', 'D', ' '));
} catch (...) {
delete utd;
}
}
Situated::load(door, utd ? &utd->getTopLevel() : 0);
if (!utd)
warning("Door \"%s\" has no blueprint", _tag.c_str());
delete utd;
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:19,代码来源:door.cpp
示例19: load
void Placeable::load(const Aurora::GFFStruct &placeable) {
Common::UString temp = placeable.getString("TemplateResRef");
Aurora::GFFFile *utp = 0;
if (!temp.empty()) {
try {
utp = new Aurora::GFFFile(temp, Aurora::kFileTypeUTP, MKID_BE('UTP '));
} catch (...) {
delete utp;
}
}
Situated::load(placeable, utp ? &utp->getTopLevel() : 0);
if (!utp)
warning("Placeable \"%s\" has no blueprint", _tag.c_str());
delete utp;
}
开发者ID:Hellzed,项目名称:xoreos,代码行数:19,代码来源:placeable.cpp
示例20: loadObject
void Door::loadObject(const Aurora::GFFStruct &gff) {
_genericType = gff.getUint("GenericType", _genericType);
}
开发者ID:DeejStar,项目名称:xoreos,代码行数:3,代码来源:door.cpp
注:本文中的aurora::GFFStruct类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论