Update of /cvsroot/planeshift/planeshift/src/eedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5625/src/eedit Modified Files: eeditapp.cpp eeditapp.h eeditcameratoolbox.cpp eeditediteffecttoolbox.cpp eeditloadeffecttoolbox.cpp eeditloadeffecttoolbox.h eeditpositiontoolbox.cpp eeditpositiontoolbox.h eeditrendertoolbox.cpp eeditselecteditanchor.cpp eeditselectfloat.cpp eeditselectyesno.cpp eedittargettoolbox.cpp eedittargettoolbox.h eedittoolbox.h eedittoolboxmanager.cpp pawseedit.cpp pawseedit.h pscal3dcallback.h Log Message: *** 2005-07-01 by Andrew Robberts - *** NOTE: effects format has changed quite a bit in this update, new effects will be in the svn server ASAP. *** - Added a billboard direction to effects so that you can achieve true billboards. - Added the ability to share art/resources between effects to save memory and loading. - Changed the effect format so that effects are now a library file. This allows much more flexibility when defining an effect. (ie, shader control, full mesh control, etc.) - Fixed some issues with effect lerp calculations. - Disabled culling for effects, they aren't very good candidates and culling only caused problems. - Added the ability to load a new arbitrary map in eedit. - Hardened eedit paws PostSetup functions to fail when things don't load properly. - Added a few example effects showing the proper way to use the effect system: * quad example (including all camera directions) * spire example * star example - The Load Effect list in eedit is now sorted - PNG issue with effects is fixed, if you don't use alpha mixmode then your PNGs CANNOT have an alpha channel. - Fixed the particle system usage in eedit. Effect particles work now. - Fixed a problem with spin and rotate actions in effects. - Effect particles can now have a user-selectable mixmode. - Modified the loading of effect keyframes so that it's easier to specify things. - Changed effect particles so that they don't explicitly load a file anymore, they now rely on the effect library to have specified the needed mesh factory. - Fixed quad, spire, and star material so that they don't explicitly load from file. Instead they rely on the effect library to specify the needed material. - Fixed effect mesh to get it's mesh wrapper from the effect library. - Removed use of psMaterialUtil from effects, it's useless with the new effect library loading. - Effects now use the "actions" volume slider from the config window as a master volume. - Fixed spell effects so that they actually work (as sent from the server). - Removed use of effects list by default, it's still an option, but the default behaviour is to search the effects directory for effect files. - Changed effect file extention from .xml to .eff. Index: eeditapp.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditapp.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** eeditapp.cpp 17 Jun 2005 14:09:54 -0000 1.24 --- eeditapp.cpp 1 Jul 2005 05:56:11 -0000 1.25 *************** *** 54,58 **** #include "util/pscssetup.h" - #include "util/psutil.h" #include "effects/pseffectmanager.h" --- 54,57 ---- *************** *** 69,72 **** --- 68,72 ---- #include "eeditloadeffecttoolbox.h" #include "eeditediteffecttoolbox.h" + #include "eeditloadmaptoolbox.h" const char * EEditApp::CONFIG_FILENAME = "/this/eedit.cfg"; *************** *** 74,78 **** const char * EEditApp::WINDOW_CAPTION = "Planeshift Effect Editor"; const char * EEditApp::KEY_DEFS_FILENAME = "/this/data/eedit/keys_def.xml"; - const char * EEditApp::TEMP_EFFECTS_LIST = "/this/data/effects/tmpeffectslist.xml"; CS_IMPLEMENT_APPLICATION --- 74,77 ---- *************** *** 95,103 **** inputboxManager = 0; - matUtil = 0; - effectManager = 0; currEffectID = 0; effectLoaded = false; - effectPaused = false; --- 94,99 ---- *************** *** 125,130 **** delete inputboxManager; - delete matUtil; - delete effectManager; delete controlManager; } --- 121,124 ---- *************** *** 243,255 **** "Application initialized successfully."); ! matUtil = new psMaterialUtil(object_reg); // effect stuff ! effectManager = new psEffectManager(matUtil); ! effectManager->LoadFromEffectsList("/this/data/effects/effectslist.xml", editWindow->GetView()); effectManager->Prepare(); pos_anchor = engine->CreateMeshWrapper("crystalspace.mesh.object.null", "pos_anchor", editWindow->GetView()->GetCamera()->GetSector(), csVector3(-33,0.1f,-194)); tar_anchor = engine->CreateMeshWrapper("crystalspace.mesh.object.null", "tar_anchor", editWindow->GetView()->GetCamera()->GetSector(), csVector3(-43,0.1f,-194)); ((EEditLoadEffectToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_LOAD_EFFECT))->FillList(effectManager); --- 237,251 ---- "Application initialized successfully."); ! ((EEditLoadMapToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_LOAD_MAP))->SetMapFile(editWindow->GetMapFile()); // effect stuff ! effectManager.AttachNew(new psEffectManager()); ! effectManager->LoadFromDirectory("/this/data/effects", true, editWindow->GetView()); ! //effectManager->LoadFromEffectsList("/this/data/effects/effectslist.xml", editWindow->GetView()); effectManager->Prepare(); pos_anchor = engine->CreateMeshWrapper("crystalspace.mesh.object.null", "pos_anchor", editWindow->GetView()->GetCamera()->GetSector(), csVector3(-33,0.1f,-194)); tar_anchor = engine->CreateMeshWrapper("crystalspace.mesh.object.null", "tar_anchor", editWindow->GetView()->GetCamera()->GetSector(), csVector3(-43,0.1f,-194)); + SetDefaultActorPositions(); ((EEditLoadEffectToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_LOAD_EFFECT))->FillList(effectManager); *************** *** 265,272 **** LoadTargetMesh("/this/art/eedit/gobble/gobble.cal3d"); ! CreateEffectPathList("/this/data/effects/effectslist.xml"); ! ! SetCurrEffect("marker"); ! RenderCurrentEffect(); return true; --- 261,265 ---- LoadTargetMesh("/this/art/eedit/gobble/gobble.cal3d"); ! CreateEffectPathList("/this/data/effects"); return true; *************** *** 404,410 **** bool EEditApp::ReloadCurrentEffect() { ! delete effectManager; ! effectManager = new psEffectManager(matUtil); ! effectManager->LoadFromEffectsList(TEMP_EFFECTS_LIST, editWindow->GetView()); if (!effectManager->Prepare()) { --- 397,405 ---- bool EEditApp::ReloadCurrentEffect() { ! effectLoaded = true; ! return true; ! ! effectManager->Clear(); ! effectManager->LoadEffects(currEffectLoc, editWindow->GetView()); if (!effectManager->Prepare()) { *************** *** 561,583 **** { // figure out where this effect is located ! csString effectLoc = ""; for (size_t a=0; a<effectPaths.Length(); ++a) { if (effectPaths[a].name == name) { ! effectLoc = effectPaths[a].path; break; } } - // make a temporary effectslist just for this file to speed up loading - csString xml; - - xml = "<effectsFileList>\n"; - xml += " <effectsFile file=\""; xml += effectLoc; xml += "\" />\n"; - xml += "</effectsFileList>\n"; - vfs->WriteFile(TEMP_EFFECTS_LIST, xml.GetData(), xml.Length()); - - currEffectName = name; //((EEditLoadEffectToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_LOAD_EFFECT))->FillList(effectManager); --- 556,569 ---- { // figure out where this effect is located ! currEffectLoc = ""; for (size_t a=0; a<effectPaths.Length(); ++a) { if (effectPaths[a].name == name) { ! currEffectLoc = effectPaths[a].path; break; } } currEffectName = name; //((EEditLoadEffectToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_LOAD_EFFECT))->FillList(effectManager); *************** *** 593,596 **** --- 579,604 ---- } + bool EEditApp::SetDefaultActorPositions() + { + iCamera * cam = editWindow->GetView()->GetCamera(); + pos_anchor->GetMovable()->SetSector(cam->GetSector()); + tar_anchor->GetMovable()->SetSector(cam->GetSector()); + csVector3 origin = cam->GetTransform().This2Other(csVector3(0,0,5)); + origin.y = 0; + ((EEditPositionToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_POSITION))->SetPosition(origin); + ((EEditTargetToolbox *)toolboxManager->GetToolbox(EEditToolbox::T_TARGET))->SetPosition(origin + csVector3(10, 0, 5)); + return true; + } + + bool EEditApp::LoadMap(const char * mapFile) + { + if (!editWindow->LoadMap(mapFile)) + { + Error2("Couldn't load map %s\n", mapFile); + return false; + } + return SetDefaultActorPositions(); + } + csVector2 EEditApp::GetMousePointer() { *************** *** 603,659 **** } ! bool EEditApp::CreateEffectPathList(const csString & fileName) { ! effectPaths.DeleteAll(); ! ! if (!vfs->Exists(fileName)) ! return false; ! csRef<iDocument> doc; ! csRef<iDocumentNodeIterator> xmlbinds; ! csRef<iDocumentSystem> xml; ! const char* error; ! csRef<iDataBuffer> buff = vfs->ReadFile(fileName); ! if (buff == 0) ! { ! Error2("Could not find file: %s", fileName.GetData()); ! return false; ! } ! xml = csPtr<iDocumentSystem>(new csTinyDocumentSystem); ! assert(xml); ! doc = xml->CreateDocument(); ! assert(doc); ! error = doc->Parse( buff ); ! if ( error ) { ! printf("Parse error in %s: %s", fileName.GetData(), error); return false; } - if (doc == 0) - return false; ! csRef<iDocumentNode> root = doc->GetRoot(); ! if (root == 0) { ! Error1("No root in XML"); return false; } ! bool isSuccess = true; ! csRef<iDocumentNode> listNode = root->GetNode("effectsFileList"); ! if (listNode != 0) { ! xmlbinds = listNode->GetNodes("effectsFile"); ! csRef<iDocumentNode> fileNode; ! while (xmlbinds->HasNext()) ! { ! fileNode = xmlbinds->Next(); ! csString effectFile = fileNode->GetAttributeValue("file"); ! if (vfs->Exists(effectFile)) ! { ! AppendEffectPathList(effectFile, fileName); ! } } } --- 611,654 ---- } ! bool EEditApp::CreateEffectPathList(const csString & path, bool clear) { ! if (clear) ! effectPaths.DeleteAll(); ! csRef<iVFS> vfs = CS_QUERY_REGISTRY (psCSSetup::object_reg, iVFS); ! assert(vfs); ! if (!vfs->Exists(path)) { ! Error2("Failed to load effects from directory; %s does not exist", path.GetData()); return false; } ! if (!vfs->ChDir(path)) { ! Error2("Failed to load effects from directory; %s read failed", path.GetData()); return false; } ! csRef<iStringArray> files = vfs->FindFiles("*"); ! for (size_t a=0; a<files->Length(); ++a) { ! const char * file = files->Get(a); ! if (file[0] == '.') ! continue; ! if (strcmp(file, path) == 0) ! continue; ! ! int len = strlen(file); ! char lastChar = file[len-1]; ! if (lastChar == '/' || lastChar == '\\') ! { ! if (!CreateEffectPathList(file, false)) ! return false; ! } ! else if (len > 4 && ((lastChar == 'f' || lastChar == 'F') && (file[len-2] == 'f' || file[len-2] == 'F') && (file[len-3] == 'e' || file[len-3] == 'E') && file[len-4] == '.')) ! { ! AppendEffectPathList(files->Get(a), path); } } *************** *** 697,701 **** } ! csRef<iDocumentNode> listNode = root->GetNode("effects"); if (listNode != 0) { --- 692,703 ---- } ! csRef<iDocumentNode> listNode = root->GetNode("library"); ! if (listNode == 0) ! { ! Error1("No <library> tag"); ! return false; ! } ! ! listNode = listNode->GetNode("addon"); if (listNode != 0) { Index: eeditapp.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditapp.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** eeditapp.h 17 Jun 2005 14:09:54 -0000 1.14 --- eeditapp.h 1 Jul 2005 05:56:11 -0000 1.15 *************** *** 51,55 **** class EEditInputboxManager; - class psMaterialUtil; class psEffectManager; class psCal3DCallbackLoader; --- 51,54 ---- *************** *** 261,264 **** --- 260,274 ---- unsigned int GetCurrEffectID() { return currEffectID; } + /** Sets the positions of the origin and target actors to defaults based on the map's camera. + * \return True on success. + */ + bool SetDefaultActorPositions(); + + /** Loads the given map file. + * \param mapFile Path to the map to load. + * \return True on success. + */ + bool LoadMap(const char * mapFile); + /** Gets the location of the mouse pointer. * @return the mouse position. *************** *** 273,279 **** /** Creates an effect name<->path mapping from an effectslist file. ! * @param fileName the location of the effectslist file. */ ! bool CreateEffectPathList(const csString & fileName); /** Appends to the current effect name<->path mapping from an effect file. --- 283,291 ---- /** Creates an effect name<->path mapping from an effectslist file. ! * \param path The path to search. ! * \param clear If true, this will replace the existing path list, otherwise it appends it. ! * \return True on success, false otherwise. */ ! bool CreateEffectPathList(const csString & path, bool clear=true); /** Appends to the current effect name<->path mapping from an effect file. *************** *** 316,319 **** --- 328,332 ---- csString currEffectName; + csString currEffectLoc; /// keeps track of whether the window is visible or not *************** *** 324,329 **** // effect stuff ! psMaterialUtil * matUtil; ! psEffectManager * effectManager; unsigned int currEffectID; bool effectLoaded; --- 337,341 ---- // effect stuff ! csRef<psEffectManager> effectManager; unsigned int currEffectID; bool effectLoaded; Index: eeditcameratoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditcameratoolbox.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** eeditcameratoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.4 --- eeditcameratoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.5 *************** *** 54,63 **** bool EEditCameraToolbox::PostSetup() { ! camLeft = (pawsButton *) FindWidget("cam_left"); ! camRight = (pawsButton *) FindWidget("cam_right"); ! camUp = (pawsButton *) FindWidget("cam_up"); ! camDown = (pawsButton *) FindWidget("cam_down"); ! camForward = (pawsButton *) FindWidget("cam_forward"); ! camBack = (pawsButton *) FindWidget("cam_back"); return true; } --- 54,63 ---- bool EEditCameraToolbox::PostSetup() { ! camLeft = (pawsButton *) FindWidget("cam_left"); CS_ASSERT(camLeft); ! camRight = (pawsButton *) FindWidget("cam_right"); CS_ASSERT(camRight); ! camUp = (pawsButton *) FindWidget("cam_up"); CS_ASSERT(camUp); ! camDown = (pawsButton *) FindWidget("cam_down"); CS_ASSERT(camDown); ! camForward = (pawsButton *) FindWidget("cam_forward"); CS_ASSERT(camForward); ! camBack = (pawsButton *) FindWidget("cam_back"); CS_ASSERT(camBack); return true; } Index: eeditediteffecttoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditediteffecttoolbox.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** eeditediteffecttoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.15 --- eeditediteffecttoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.16 *************** *** 137,141 **** bool EEditEditEffectToolbox::PostSetup() { ! effectItemsTree = (pawsTree *)FindWidget("EffectItemsTree"); if (!effectItemsTree) { --- 137,141 ---- bool EEditEditEffectToolbox::PostSetup() { ! effectItemsTree = (pawsTree *)FindWidget("EffectItemsTree"); CS_ASSERT(effectItemsTree); if (!effectItemsTree) { Index: eeditloadeffecttoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditloadeffecttoolbox.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** eeditloadeffecttoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.9 --- eeditloadeffecttoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.10 *************** *** 56,59 **** --- 56,77 ---- } + int EEditLoadEffectToolbox::SortTextBox(pawsWidget * widgetA, pawsWidget * widgetB) + { + pawsTextBox * textBoxA, * textBoxB; + const char * textA, * textB; + + textBoxA = dynamic_cast <pawsTextBox*> (widgetA); + textBoxB = dynamic_cast <pawsTextBox*> (widgetB); + assert(textBoxA && textBoxB); + textA = textBoxA->GetText(); + if (textA == NULL) + textA = ""; + textB = textBoxB->GetText(); + if (textB == NULL) + textB = ""; + + return strcmp(textA, textB); + } + void EEditLoadEffectToolbox::FillList(psEffectManager * effectManager) { *************** *** 85,88 **** --- 103,109 ---- ++a; } + effectList->SetSortingFunc(0, SortTextBox); + effectList->SetSortedColumn(0); + effectList->SortRows(); } *************** *** 100,105 **** bool EEditLoadEffectToolbox::PostSetup() { ! effectList = (pawsListBox *)FindWidget("EffectList"); ! openEffectButton = (pawsButton *)FindWidget("LoadEffectButton"); return true; --- 121,126 ---- bool EEditLoadEffectToolbox::PostSetup() { ! effectList = (pawsListBox *)FindWidget("EffectList"); CS_ASSERT(effectList); ! openEffectButton = (pawsButton *)FindWidget("LoadEffectButton"); CS_ASSERT(openEffectButton); return true; Index: eeditloadeffecttoolbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditloadeffecttoolbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** eeditloadeffecttoolbox.h 17 Jun 2005 14:09:55 -0000 1.5 --- eeditloadeffecttoolbox.h 1 Jul 2005 05:56:11 -0000 1.6 *************** *** 47,51 **** */ void SelectEffect(const csString & effectName); ! // inheritted from EEditToolbox virtual void Update(unsigned int elapsed); --- 47,51 ---- */ void SelectEffect(const csString & effectName); ! // inheritted from EEditToolbox virtual void Update(unsigned int elapsed); *************** *** 59,62 **** --- 59,65 ---- private: + // used by pawsListBox to sort the listbox + static int SortTextBox(pawsWidget * widgetA, pawsWidget * widgetB); + pawsListBox * effectList; pawsButton * openEffectButton; Index: eeditpositiontoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditpositiontoolbox.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** eeditpositiontoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.12 --- eeditpositiontoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.13 *************** *** 61,64 **** --- 61,71 ---- } + void EEditPositionToolbox::SetPosition(const csVector3 & pos) + { + posX->SetValue(pos.x); + posY->SetValue(pos.y); + posZ->SetValue(pos.z); + } + void EEditPositionToolbox::Update(unsigned int elapsed) { *************** *** 102,116 **** bool EEditPositionToolbox::PostSetup() { ! moreLessButton = (pawsButton *) FindWidget("more_less"); ! animButton = (pawsButton *) FindWidget("anim"); ! browseMesh = (pawsButton *) FindWidget("pos_mesh_browse"); ! meshFileText = (pawsEditTextBox *) FindWidget("pos_mesh_file"); ! posX = (pawsSpinBox *) FindWidget("pos_x"); ! posY = (pawsSpinBox *) FindWidget("pos_y"); ! posZ = (pawsSpinBox *) FindWidget("pos_z"); ! rot = (pawsSpinBox *) FindWidget("pos_rot"); ! posTypeNone = (pawsRadioButton *) FindWidget("pos_type_none"); ! posTypeAxis = (pawsRadioButton *) FindWidget("pos_type_axis"); ! posTypeCustom = (pawsRadioButton *) FindWidget("pos_type_custom"); animButton->Hide(); --- 109,123 ---- bool EEditPositionToolbox::PostSetup() { ! moreLessButton = (pawsButton *) FindWidget("more_less"); CS_ASSERT(moreLessButton); ! animButton = (pawsButton *) FindWidget("anim"); CS_ASSERT(animButton); ! browseMesh = (pawsButton *) FindWidget("pos_mesh_browse"); CS_ASSERT(browseMesh); ! meshFileText = (pawsEditTextBox *) FindWidget("pos_mesh_file"); CS_ASSERT(meshFileText); ! posX = (pawsSpinBox *) FindWidget("pos_x"); CS_ASSERT(posX); ! posY = (pawsSpinBox *) FindWidget("pos_y"); CS_ASSERT(posY); ! posZ = (pawsSpinBox *) FindWidget("pos_z"); CS_ASSERT(posZ); ! rot = (pawsSpinBox *) FindWidget("pos_rot"); CS_ASSERT(rot); ! posTypeNone = (pawsRadioButton *) FindWidget("pos_type_none"); CS_ASSERT(posTypeNone); ! posTypeAxis = (pawsRadioButton *) FindWidget("pos_type_axis"); CS_ASSERT(posTypeAxis); ! posTypeCustom = (pawsRadioButton *) FindWidget("pos_type_custom"); CS_ASSERT(posTypeCustom); animButton->Hide(); Index: eeditpositiontoolbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditpositiontoolbox.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** eeditpositiontoolbox.h 17 Jun 2005 14:09:55 -0000 1.11 --- eeditpositiontoolbox.h 1 Jul 2005 05:56:11 -0000 1.12 *************** *** 53,56 **** --- 53,61 ---- void FillAnimList(iSpriteCal3DState * cal3d); + /** Sets the position of the actor. + * \param pos The new position. + */ + void SetPosition(const csVector3 & pos); + // inheritted from EEditToolbox virtual void Update(unsigned int elapsed); Index: eeditrendertoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditrendertoolbox.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** eeditrendertoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.6 --- eeditrendertoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.7 *************** *** 54,61 **** bool EEditRenderToolbox::PostSetup() { ! renderButton = (pawsButton *) FindWidget("render"); ! loadButton = (pawsButton *) FindWidget("load"); ! pauseButton = (pawsButton *) FindWidget("pause"); ! cancelButton = (pawsButton *) FindWidget("stop"); return true; } --- 54,61 ---- bool EEditRenderToolbox::PostSetup() { ! renderButton = (pawsButton *) FindWidget("render"); CS_ASSERT(renderButton); ! loadButton = (pawsButton *) FindWidget("load"); CS_ASSERT(loadButton); ! pauseButton = (pawsButton *) FindWidget("pause"); CS_ASSERT(pauseButton); ! cancelButton = (pawsButton *) FindWidget("stop"); CS_ASSERT(cancelButton); return true; } Index: eeditselecteditanchor.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditselecteditanchor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eeditselecteditanchor.cpp 17 Jun 2005 14:09:55 -0000 1.3 --- eeditselecteditanchor.cpp 1 Jul 2005 05:56:11 -0000 1.4 *************** *** 61,67 **** bool EEditSelectEditAnchor::PostSetup() { ! newName = (pawsEditTextBox *) FindWidget("select_name"); ! changeName = (pawsButton *) FindWidget("change_name"); ! deleteAnchor = (pawsButton *) FindWidget("delete_anchor"); return true; --- 61,67 ---- bool EEditSelectEditAnchor::PostSetup() { ! newName = (pawsEditTextBox *) FindWidget("select_name"); CS_ASSERT(newName); ! changeName = (pawsButton *) FindWidget("change_name"); CS_ASSERT(changeName); ! deleteAnchor = (pawsButton *) FindWidget("delete_anchor"); CS_ASSERT(deleteAnchor); return true; Index: eeditselectfloat.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditselectfloat.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eeditselectfloat.cpp 17 Jun 2005 14:09:55 -0000 1.3 --- eeditselectfloat.cpp 1 Jul 2005 05:56:11 -0000 1.4 *************** *** 53,58 **** bool EEditSelectFloat::PostSetup() { ! value = (pawsSpinBox *) FindWidget("select_value"); ! ok = (pawsButton *) FindWidget("ok"); return true; --- 53,58 ---- bool EEditSelectFloat::PostSetup() { ! value = (pawsSpinBox *) FindWidget("select_value"); CS_ASSERT(value); ! ok = (pawsButton *) FindWidget("ok"); CS_ASSERT(ok); return true; Index: eeditselectyesno.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eeditselectyesno.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eeditselectyesno.cpp 17 Jun 2005 14:09:55 -0000 1.3 --- eeditselectyesno.cpp 1 Jul 2005 05:56:11 -0000 1.4 *************** *** 53,58 **** bool EEditSelectYesNo::PostSetup() { ! yes = (pawsRadioButton *) FindWidget("select_yes"); ! no = (pawsRadioButton *) FindWidget("select_no"); return true; --- 53,58 ---- bool EEditSelectYesNo::PostSetup() { ! yes = (pawsRadioButton *) FindWidget("select_yes"); CS_ASSERT(yes); ! no = (pawsRadioButton *) FindWidget("select_no"); CS_ASSERT(no); return true; Index: eedittargettoolbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eedittargettoolbox.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** eedittargettoolbox.cpp 17 Jun 2005 14:09:55 -0000 1.6 --- eedittargettoolbox.cpp 1 Jul 2005 05:56:11 -0000 1.7 *************** *** 61,64 **** --- 61,71 ---- } + void EEditTargetToolbox::SetPosition(const csVector3 & pos) + { + tarX->SetValue(pos.x); + tarY->SetValue(pos.y); + tarZ->SetValue(pos.z); + } + void EEditTargetToolbox::Update(unsigned int elapsed) { *************** *** 102,116 **** bool EEditTargetToolbox::PostSetup() { ! moreLessButton = (pawsButton *) FindWidget("more_less"); ! animButton = (pawsButton *) FindWidget("anim"); ! browseMesh = (pawsButton *) FindWidget("tar_mesh_browse"); ! meshFileText = (pawsEditTextBox *) FindWidget("tar_mesh_file"); ! tarX = (pawsSpinBox *) FindWidget("tar_x"); ! tarY = (pawsSpinBox *) FindWidget("tar_y"); ! tarZ = (pawsSpinBox *) FindWidget("tar_z"); ! rot = (pawsSpinBox *) FindWidget("tar_rot"); ! tarTypeNone = (pawsRadioButton *) FindWidget("tar_type_none"); ! tarTypeAxis = (pawsRadioButton *) FindWidget("tar_type_axis"); ! tarTypeCustom = (pawsRadioButton *) FindWidget("tar_type_custom"); animButton->Hide(); --- 109,123 ---- bool EEditTargetToolbox::PostSetup() { ! moreLessButton = (pawsButton *) FindWidget("more_less"); CS_ASSERT(moreLessButton); ! animButton = (pawsButton *) FindWidget("anim"); CS_ASSERT(animButton); ! browseMesh = (pawsButton *) FindWidget("tar_mesh_browse"); CS_ASSERT(browseMesh); ! meshFileText = (pawsEditTextBox *) FindWidget("tar_mesh_file"); CS_ASSERT(meshFileText); ! tarX = (pawsSpinBox *) FindWidget("tar_x"); CS_ASSERT(tarX); ! tarY = (pawsSpinBox *) FindWidget("tar_y"); CS_ASSERT(tarY); ! tarZ = (pawsSpinBox *) FindWidget("tar_z"); CS_ASSERT(tarZ); ! rot = (pawsSpinBox *) FindWidget("tar_rot"); CS_ASSERT(rot); ! tarTypeNone = (pawsRadioButton *) FindWidget("tar_type_none"); CS_ASSERT(tarTypeNone); ! tarTypeAxis = (pawsRadioButton *) FindWidget("tar_type_axis"); CS_ASSERT(tarTypeAxis); ! tarTypeCustom = (pawsRadioButton *) FindWidget("tar_type_custom"); CS_ASSERT(tarTypeCustom); animButton->Hide(); Index: eedittargettoolbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eedittargettoolbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** eedittargettoolbox.h 17 Jun 2005 14:09:55 -0000 1.5 --- eedittargettoolbox.h 1 Jul 2005 05:56:11 -0000 1.6 *************** *** 54,57 **** --- 54,62 ---- void FillAnimList(iSpriteCal3DState * cal3d); + /** Sets the position of the actor. + * \param pos The new position. + */ + void SetPosition(const csVector3 & pos); + // inheritted from EEditToolbox virtual void Update(unsigned int elapsed); Index: eedittoolbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eedittoolbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** eedittoolbox.h 17 Jun 2005 14:09:55 -0000 1.5 --- eedittoolbox.h 1 Jul 2005 05:56:11 -0000 1.6 *************** *** 35,38 **** --- 35,39 ---- T_LOAD_EFFECT, T_EDIT_EFFECT, + T_LOAD_MAP, T_COUNT Index: eedittoolboxmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/eedittoolboxmanager.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** eedittoolboxmanager.cpp 17 Jun 2005 14:09:55 -0000 1.7 --- eedittoolboxmanager.cpp 1 Jul 2005 05:56:11 -0000 1.8 *************** *** 31,34 **** --- 31,35 ---- #include "eeditloadeffecttoolbox.h" #include "eeditediteffecttoolbox.h" + #include "eeditloadmaptoolbox.h" bool RegisterToolboxFactories(PawsManager * paws) *************** *** 41,44 **** --- 42,46 ---- factory = new EEditLoadEffectToolboxFactory(paws); factory = new EEditEditEffectToolboxFactory(paws); + factory = new EEditLoadMapToolboxFactory(paws); return true; } *************** *** 55,58 **** --- 57,61 ---- widgetFiles[EEditToolbox::T_LOAD_EFFECT] = "data/eedit/loadeffect.xml"; widgetFiles[EEditToolbox::T_EDIT_EFFECT] = "data/eedit/editeffect.xml"; + widgetFiles[EEditToolbox::T_LOAD_MAP] = "data/eedit/loadmap.xml"; widgetNames[EEditToolbox::T_POSITION] = "PositionToolbox"; *************** *** 62,65 **** --- 65,69 ---- widgetNames[EEditToolbox::T_LOAD_EFFECT] = "LoadEffectToolbox"; widgetNames[EEditToolbox::T_EDIT_EFFECT] = "EditEffectToolbox"; + widgetNames[EEditToolbox::T_LOAD_MAP] = "LoadMapToolbox"; } Index: pawseedit.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/pawseedit.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pawseedit.cpp 17 Jun 2005 14:09:55 -0000 1.11 --- pawseedit.cpp 1 Jul 2005 05:56:11 -0000 1.12 *************** *** 51,57 **** } bool pawsEEdit::PostSetup() { ! preview = (pawsGenericView *) FindWidget("preview"); return true; --- 51,69 ---- } + const char * pawsEEdit::GetMapFile() const + { + if (preview) + return preview->GetMapName(); + return ""; + } + + bool pawsEEdit::LoadMap(const char * mapFile) + { + return preview->LoadMap(mapFile); + } + bool pawsEEdit::PostSetup() { ! preview = (pawsGenericView *) FindWidget("preview"); CS_ASSERT(preview); return true; Index: pawseedit.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/pawseedit.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pawseedit.h 17 Jun 2005 14:09:55 -0000 1.7 --- pawseedit.h 1 Jul 2005 05:56:11 -0000 1.8 *************** *** 40,43 **** --- 40,54 ---- iView *GetView(); + /** Returns the file path of the loaded map. + * \return The file path of the loaded map. + */ + const char * GetMapFile() const; + + /** Loads the given map. + * \param mapFile Path to the map to load. + * \return True on success. + */ + bool LoadMap(const char * mapFile); + // implemented virtual functions from pawsWidgets bool PostSetup(); Index: pscal3dcallback.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/eedit/pscal3dcallback.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pscal3dcallback.h 17 Jun 2005 14:09:55 -0000 1.3 --- pscal3dcallback.h 1 Jul 2005 05:56:11 -0000 1.4 *************** *** 46,50 **** // used to handle and parse the <addon> tags. csPtr<iBase> Parse(iDocumentNode * node, iLoaderContext * ldr_context, iBase * context); - }; --- 46,49 ---- |