Changeset 646

Show
Ignore:
Timestamp:
11/17/06 14:48:40 (2 years ago)
Author:
leo
Message:

Added Model menu and moved time variables to the model class.

Location:
trunk
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/keyboard.cpp

    r640 r646  
    2424    { LC_FILE_POVRAY, "Export POV-Ray", 0, 0, 0 }, 
    2525    { LC_FILE_WAVEFRONT, "Export Wavefront", 0, 0, 0 }, 
    26     { LC_FILE_PROPERTIES, "Project Properties", 0, 0, 0 }, 
    2726//  { LC_FILE_TERRAIN, "Terrain Editor", 0, 0, 0 }, 
    2827    { LC_FILE_LIBRARY, "Piece Library Manager", 0, 0, 0 }, 
     
    5352    { LC_PIECE_NEXT, "Piece Next Step", 0, 0, 0 }, 
    5453    { LC_VIEW_PREFERENCES, "Preferences", 0, 0, 0 }, 
     54    { LC_MODEL_NEW, "New Model", 0, 0, 0 }, 
     55    { LC_MODEL_DELETE, "Delete Properties", 0, 0, 0 }, 
     56    { LC_MODEL_PROPERTIES, "Model Properties", 0, 0, 0 }, 
    5557//  { LC_VIEW_ZOOM, "", 0, 0, 0 }, 
    5658    { LC_VIEW_ZOOMIN, "Zoom In", 0, 0, 0 }, 
  • trunk/common/lc_model.cpp

    r644 r646  
    77    m_Pieces = NULL; 
    88    m_Name = Name; 
    9     m_CurTime = 1; 
     9    m_CurFrame = 1; 
     10    m_TotalFrames = 1; 
    1011} 
    1112 
     
    6768{ 
    6869    for (Piece* piece = m_Pieces; piece; piece = (Piece*)piece->m_Next) 
    69         if ((piece->IsVisible(m_CurTime)) && piece->IsSelected()) 
     70        if ((piece->IsVisible(m_CurFrame)) && piece->IsSelected()) 
    7071            return true; 
    7172 
     
    7879 
    7980    for (Piece* piece = m_Pieces; piece; piece = (Piece*)piece->m_Next) 
    80         if (piece->IsVisible(m_CurTime)) 
     81        if (piece->IsVisible(m_CurFrame)) 
    8182            piece->Select(Select, FocusOnly); 
    8283} 
     
    8687    for (Piece* piece = m_Pieces; piece; piece = (Piece*)piece->m_Next) 
    8788    { 
    88         if (piece->IsVisible(m_CurTime)) 
     89        if (piece->IsVisible(m_CurFrame)) 
    8990        { 
    9091            if (piece->IsSelected()) 
  • trunk/common/lc_model.h

    r644 r646  
    33 
    44#include "str.h" 
     5#include "config.h" 
    56 
    67class Piece; 
     
    1314 
    1415public: 
     16    // Returns the model's name. 
     17    const String& GetName() const 
     18    { return m_Name; } 
     19 
    1520    // Adds a piece to this model. 
    1621    void AddPiece(Piece* NewPiece); 
     
    4348    // Making these public for now. 
    4449    Piece* m_Pieces; 
    45     int m_CurTime; 
     50 
     51    u32 m_CurFrame; 
     52    u32 m_TotalFrames; 
    4653 
    4754protected: 
  • trunk/common/project.cpp

    r644 r646  
    141141    SystemUpdateCurrentCamera(NULL, m_ActiveView->GetCamera(), m_pCameras); 
    142142    UpdateSelection(); 
    143     SystemUpdateTime(false, m_ActiveModel->m_CurTime, 255); 
     143    SystemUpdateTime(false, m_ActiveModel->m_CurFrame, 255); 
    144144 
    145145    for (int i = 0; i < m_ViewList.GetSize(); i++) 
     
    312312    m_fGradient2[2] = (float)((unsigned char) ((rgb) >> 16))/255; 
    313313    m_nFPS = Sys_ProfileLoadInt ("Default", "FPS", 24); 
    314     m_nTotalFrames = 100; 
    315314    SystemUpdateTime(false, 1, 255); 
    316315    m_nScene = Sys_ProfileLoadInt ("Default", "Scene", 0); 
     
    749748                file->ReadByte (&m_nFPS, 1); 
    750749                file->ReadLong (&i, 1); //m_nCurFrame = i; 
    751                 file->ReadShort (&m_nTotalFrames, 1); 
     750                file->ReadShort (&sh, 1); // m_nTotalFrames 
    752751                file->ReadLong (&i, 1); //m_nGridSize = i; 
    753752                file->ReadLong (&i, 1); //m_nMoveSnap = i; 
     
    760759                file->ReadByte (&m_nFPS, 1); 
    761760                file->ReadShort (&sh, 1); // m_nCurFrame 
    762                 file->ReadShort (&m_nTotalFrames, 1); 
     761                file->ReadShort (&sh, 1); // m_nTotalFrames 
    763762                file->ReadShort (&sh, 1); // m_nGridSize 
    764763                file->ReadShort (&sh, 1); 
     
    809808    SystemUpdateCurrentCamera(NULL, m_ActiveView->GetCamera(), m_pCameras); 
    810809    UpdateSelection(); 
    811     SystemUpdateTime(false, m_ActiveModel->m_CurTime, 255); 
     810    SystemUpdateTime(false, m_ActiveModel->m_CurFrame, 255); 
    812811    UpdateAllViews (); 
    813812 
     
    838837    i = m_nCurColor; file->WriteLong (&i, 1); 
    839838    i = m_nCurAction; file->WriteLong (&i, 1); 
    840     i = m_ActiveModel->m_CurTime; file->WriteLong (&i, 1); 
     839    i = m_ActiveModel->m_CurFrame; file->WriteLong (&i, 1); 
    841840    file->WriteLong (&m_nScene, 1); 
    842841 
     
    902901    file->WriteByte (&m_nFPS, 1); 
    903902    sh = 1; file->WriteShort (&sh, 1); // m_nCurFrame 
    904     file->WriteShort (&m_nTotalFrames, 1); 
     903    sh = 1; file->WriteShort (&sh, 1); // m_nTotalFrames 
    905904    sh = 10; file->WriteShort (&sh, 1); // m_nGridSize 
    906905    file->WriteShort (&m_nMoveSnap, 1); 
     
    928927            opts.format = LC_IMAGE_GIF; 
    929928 
    930             i = m_ActiveModel->m_CurTime; 
     929            i = m_ActiveModel->m_CurFrame; 
    931930            CreateImages(image, 120, 100, i, i, false); 
    932931            image[0].FileSave (*file, &opts); 
     
    14311430                FileReadLDraw(&file, &mat, &ok, m_nCurColor, &step, FileArray, FilePath); 
    14321431 
    1433             m_ActiveModel->m_CurTime = step; 
    1434             SystemUpdateTime(false, m_ActiveModel->m_CurTime, 255); 
     1432            m_ActiveModel->m_CurFrame = step; 
     1433            SystemUpdateTime(false, m_ActiveModel->m_CurFrame, 255); 
    14351434            SystemUpdateFocus(NULL); 
    14361435            UpdateSelection(); 
     
    19801979        lcMesh* Mesh = piece->GetMesh(); 
    19811980 
    1982         if (!piece->IsVisible(m_ActiveModel->m_CurTime)) 
     1981        if (!piece->IsVisible(m_ActiveModel->m_CurFrame)) 
    19831982            continue; 
    19841983 
     
    29672966 
    29682967    for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    2969         if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     2968        if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    29702969            pPiece->RenderBox(bHilite, m_fLineWidth); 
    29712970} 
     
    30823081    for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    30833082    { 
    3084         pPiece->UpdatePosition(m_ActiveModel->m_CurTime); 
     3083        pPiece->UpdatePosition(m_ActiveModel->m_CurFrame); 
    30853084        PieceCount++; 
    30863085    } 
     
    30913090    for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    30923091    { 
    3093         pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurTime, false, false); 
     3092        pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurFrame, false, false); 
    30943093        SytemStepProgressBar(); 
    30953094    } 
     
    30993098 
    31003099    for (pCamera = m_pCameras; pCamera; pCamera = (Camera*)pCamera->m_Next) 
    3101         pCamera->UpdatePosition(m_ActiveModel->m_CurTime); 
     3100        pCamera->UpdatePosition(m_ActiveModel->m_CurFrame); 
    31023101 
    31033102    for (pLight = m_pLights; pLight; pLight = (Light*)pLight->m_Next) 
    3104         pLight->UpdatePosition(m_ActiveModel->m_CurTime); 
     3103        pLight->UpdatePosition(m_ActiveModel->m_CurFrame); 
    31053104} 
    31063105 
     
    33363335    if (Frames) 
    33373336    { 
    3338         m_ActiveModel->m_CurTime += Frames; 
    3339         while (m_ActiveModel->m_CurTime > m_nTotalFrames) 
    3340             m_ActiveModel->m_CurTime -= m_nTotalFrames; 
     3337        m_ActiveModel->m_CurFrame += Frames; 
     3338        while (m_ActiveModel->m_CurFrame > m_ActiveModel->m_TotalFrames) 
     3339            m_ActiveModel->m_CurFrame -= m_ActiveModel->m_TotalFrames; 
    33413340 
    33423341        CalculateStep(); 
    3343         SystemUpdateTime(true, m_ActiveModel->m_CurTime, m_nTotalFrames); 
     3342        SystemUpdateTime(true, m_ActiveModel->m_CurFrame, m_ActiveModel->m_TotalFrames); 
    33443343 
    33453344        UpdateAllViews(); 
     
    33623361    void* render = Sys_StartMemoryRender (width, height); 
    33633362    unsigned char* buf = (unsigned char*)malloc (width*height*3); 
    3364     oldtime = m_ActiveModel->m_CurTime; 
     3363    oldtime = m_ActiveModel->m_CurFrame; 
    33653364 
    33663365    View view(this, NULL); 
     
    33753374    for (int i = from; i <= to; i++) 
    33763375    { 
    3377         m_ActiveModel->m_CurTime = i; 
     3376        m_ActiveModel->m_CurFrame = i; 
    33783377 
    33793378        if (hilite) 
     
    33933392    } 
    33943393 
    3395     m_ActiveModel->m_CurTime = (unsigned char)oldtime; 
     3394    m_ActiveModel->m_CurFrame = (unsigned char)oldtime; 
    33963395    CalculateStep(); 
    33973396    free (buf); 
     
    35173516 
    35183517            if (Pos != mod->Position) 
    3519                 pPiece->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->Position, LC_PK_POSITION); 
     3518                pPiece->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->Position, LC_PK_POSITION); 
    35203519 
    35213520            if (mod->Rotation[0] != Angles[0] || mod->Rotation[1] != Angles[1] || mod->Rotation[2] != Angles[2]) 
     
    35243523                Vector4 AxisAngle = MatrixToAxisAngle(mat); 
    35253524                AxisAngle[3] *= LC_RTOD; 
    3526                 pPiece->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, AxisAngle, LC_PK_ROTATION); 
     3525                pPiece->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, AxisAngle, LC_PK_ROTATION); 
    35273526            } 
    35283527 
     
    35373536            pPiece->SetName(mod->name); 
    35383537            pPiece->SetColor(mod->color); 
    3539             pPiece->UpdatePosition(m_ActiveModel->m_CurTime); 
    3540             pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurTime, false, true); 
     3538            pPiece->UpdatePosition(m_ActiveModel->m_CurFrame); 
     3539            pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurFrame, false, true); 
    35413540 
    35423541            SetModifiedFlag(true); 
     
    35613560 
    35623561            if (pCamera->GetEyePosition() != mod->Eye) 
    3563                 pCamera->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->Eye, LC_CK_EYE); 
     3562                pCamera->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->Eye, LC_CK_EYE); 
    35643563 
    35653564            if (pCamera->GetTargetPosition() != mod->Target) 
    3566                 pCamera->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->Target, LC_CK_TARGET); 
     3565                pCamera->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->Target, LC_CK_TARGET); 
    35673566 
    35683567            if (pCamera->GetRoll() != mod->Roll) 
    3569                 pCamera->SetRoll(mod->Roll, m_ActiveModel->m_CurTime, m_bAddKeys); 
     3568                pCamera->SetRoll(mod->Roll, m_ActiveModel->m_CurFrame, m_bAddKeys); 
    35703569 
    35713570            pCamera->SetName(mod->name); 
     
    35743573            pCamera->m_zFar = mod->zfar; 
    35753574 
    3576             pCamera->UpdatePosition(m_ActiveModel->m_CurTime); 
     3575            pCamera->UpdatePosition(m_ActiveModel->m_CurFrame); 
    35773576            UpdateAllViews(); 
    35783577        } break; 
     
    35893588 
    35903589            if (light->GetPosition() != mod->Position) 
    3591                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->Position, LC_LK_POSITION); 
     3590                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->Position, LC_LK_POSITION); 
    35923591 
    35933592            if (light->GetTargetPosition() != mod->Target) 
    3594                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->Target, LC_LK_TARGET); 
     3593                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->Target, LC_LK_TARGET); 
    35953594 
    35963595            if (light->GetAmbientColor() != mod->AmbientColor) 
    3597                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->AmbientColor, LC_LK_AMBIENT_COLOR); 
     3596                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->AmbientColor, LC_LK_AMBIENT_COLOR); 
    35983597 
    35993598            if (light->GetDiffuseColor() != mod->DiffuseColor) 
    3600                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->DiffuseColor, LC_LK_DIFFUSE_COLOR); 
     3599                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->DiffuseColor, LC_LK_DIFFUSE_COLOR); 
    36013600 
    36023601            if (light->GetSpecularColor() != mod->SpecularColor) 
    3603                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, mod->SpecularColor, LC_LK_SPECULAR_COLOR); 
     3602                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, mod->SpecularColor, LC_LK_SPECULAR_COLOR); 
    36043603 
    36053604            if (light->GetConstantAttenuation() != mod->ConstantAttenuation) 
    3606                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, &mod->ConstantAttenuation, LC_LK_CONSTANT_ATTENUATION); 
     3605                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, &mod->ConstantAttenuation, LC_LK_CONSTANT_ATTENUATION); 
    36073606 
    36083607            if (light->GetLinearAttenuation() != mod->LinearAttenuation) 
    3609                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, &mod->LinearAttenuation, LC_LK_LINEAR_ATTENUATION); 
     3608                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, &mod->LinearAttenuation, LC_LK_LINEAR_ATTENUATION); 
    36103609 
    36113610            if (light->GetQuadraticAttenuation() != mod->QuadraticAttenuation) 
    3612                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, &mod->QuadraticAttenuation, LC_LK_QUADRATIC_ATTENUATION); 
     3611                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, &mod->QuadraticAttenuation, LC_LK_QUADRATIC_ATTENUATION); 
    36133612 
    36143613            if (light->GetSpotCutoff() != mod->SpotCutoff) 
    3615                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, &mod->SpotCutoff, LC_LK_SPOT_CUTOFF); 
     3614                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, &mod->SpotCutoff, LC_LK_SPOT_CUTOFF); 
    36163615 
    36173616            if (light->GetSpotExponent() != mod->SpotExponent) 
    3618                 light->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, &mod->SpotExponent, LC_LK_SPOT_EXPONENT); 
     3617                light->ChangeKey(m_ActiveModel->m_CurFrame, m_bAddKeys, &mod->SpotExponent, LC_LK_SPOT_EXPONENT); 
    36193618 
    36203619            light->SetName(mod->name); 
    36213620 
    3622             light->UpdatePosition(m_ActiveModel->m_CurTime); 
     3621            light->UpdatePosition(m_ActiveModel->m_CurFrame); 
    36233622            UpdateAllViews(); 
    36243623        } break; 
     
    36933692            LC_IMAGEDLG_OPTS opts; 
    36943693            opts.from = 1; 
    3695             opts.to = m_nTotalFrames; 
     3694            opts.to = m_ActiveModel->m_TotalFrames; 
    36963695            opts.multiple = false; 
    36973696            opts.imopts.background[0] = (unsigned char)(m_fBackground[0]*255); 
     
    37143713                } 
    37153714                else 
    3716                     opts.from = opts.to = m_ActiveModel->m_CurTime; 
     3715                    opts.from = opts.to = m_ActiveModel->m_CurFrame; 
    37173716 
    37183717                Image* images = new Image[opts.to-opts.from+1]; 
     
    44054404        } break; 
    44064405 
    4407         case LC_FILE_PROPERTIES: 
     4406        case LC_MODEL_NEW: 
     4407        { 
     4408        } break; 
     4409 
     4410        case LC_MODEL_DELETE: 
     4411        { 
     4412        } break; 
     4413 
     4414        case LC_MODEL_PROPERTIES: 
    44084415        { 
    44094416            LC_PROPERTIESDLG_OPTS opts; 
     
    46424649                pPasted = (Piece*)pPasted->m_Next; 
    46434650                pPiece->CreateName(m_ActiveModel->m_Pieces); 
    4644                 pPiece->SetTimeShow(m_ActiveModel->m_CurTime); 
     4651                pPiece->SetTimeShow(m_ActiveModel->m_CurFrame); 
    46454652                AddPiece(pPiece); 
    46464653                pPiece->Select(true, false); 
     
    47224729            Piece* pPiece; 
    47234730            for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    4724                 if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     4731                if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    47254732                    pPiece->Select(true, false); 
    47264733 
     
    47424749            Piece* pPiece; 
    47434750            for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    4744                 if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     4751                if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    47454752                { 
    47464753                    if (pPiece->IsSelected()) 
     
    47644771 
    47654772            for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    4766                 if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     4773                if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    47674774                    i++; 
    47684775 
     
    47904797 
    47914798            for (pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    4792                 if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     4799                if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    47934800                { 
    47944801                    opts[i].name = pPiece->GetName(); 
     
    48954902                GetPieceInsertPosition(pLast, Pos, Rot); 
    48964903 
    4897                 pPiece->Initialize(Pos[0], Pos[1], Pos[2], m_ActiveModel->m_CurTime, m_nCurColor); 
    4898  
    4899                 pPiece->ChangeKey(m_ActiveModel->m_CurTime, false, Rot, LC_PK_ROTATION); 
    4900                 pPiece->UpdatePosition(m_ActiveModel->m_CurTime); 
     4904                pPiece->Initialize(Pos[0], Pos[1], Pos[2], m_ActiveModel->m_CurFrame, m_nCurColor); 
     4905 
     4906                pPiece->ChangeKey(m_ActiveModel->m_CurFrame, false, Rot, LC_PK_ROTATION); 
     4907                pPiece->UpdatePosition(m_ActiveModel->m_CurFrame); 
    49014908            } 
    49024909            else 
    4903                 pPiece->Initialize(0, 0, -m_pCurPiece->m_fDimensions[5], m_ActiveModel->m_CurTime, m_nCurColor); 
     4910                pPiece->Initialize(0, 0, -m_pCurPiece->m_fDimensions[5], m_ActiveModel->m_CurFrame, m_nCurColor); 
    49044911 
    49054912            SelectAndFocusNone(false); 
    49064913            pPiece->CreateName(m_ActiveModel->m_Pieces); 
    49074914            AddPiece(pPiece); 
    4908             pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurTime, true, true); 
     4915            pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurFrame, true, true); 
    49094916            pPiece->Select (true, true); 
    49104917            messenger->Dispatch (LC_MSG_FOCUS_CHANGED, pPiece); 
     
    49504957              Piece* pPiece = new Piece(wiz->m_Info[i]); 
    49514958 
    4952               pPiece->Initialize(wiz->m_Position[i][0], wiz->m_Position[i][1], wiz->m_Position[i][2], m_ActiveModel->m_CurTime, wiz->m_Colors[i]); 
     4959              pPiece->Initialize(wiz->m_Position[i][0], wiz->m_Position[i][1], wiz->m_Position[i][2], m_ActiveModel->m_CurFrame, wiz->m_Colors[i]); 
    49534960              pPiece->CreateName(m_ActiveModel->m_Pieces); 
    49544961              AddPiece(pPiece); 
     
    49564963 
    49574964              pPiece->ChangeKey(1, false, wiz->m_Rotation[i], LC_PK_ROTATION); 
    4958               pPiece->UpdatePosition(m_ActiveModel->m_CurTime); 
    4959               pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurTime, false, true); 
     4965              pPiece->UpdatePosition(m_ActiveModel->m_CurFrame); 
     4966              pPiece->CalculateConnections(m_pConnections, m_ActiveModel->m_CurFrame, false, true); 
    49604967 
    49614968              SystemPieceComboAdd(wiz->m_Info[i]->m_strDescription); 
     
    50865093                                pLast = pFirst = new Piece(pPiece->GetPieceInfo()); 
    50875094 
    5088                             pLast->Initialize(pos[0]+i*opts.fMove[0], pos[1]+i*opts.fMove[1], pos[2]+i*opts.fMove[2], m_ActiveModel->m_CurTime, pPiece->GetColor()); 
     5095                            pLast->Initialize(pos[0]+i*opts.fMove[0], pos[1]+i*opts.fMove[1], pos[2]+i*opts.fMove[2], m_ActiveModel->m_CurFrame, pPiece->GetColor()); 
    50895096                            pLast->ChangeKey(1, false, param, LC_PK_ROTATION); 
    50905097                        } 
     
    51065113 
    51075114                                pLast->Initialize(pos[0]+i*opts.fMove[0]+j*opts.f2D[0], pos[1]+i*opts.fMove[1]+j*opts.f2D[1], pos[2]+i*opts.fMove[2]+j*opts.f2D[2], 
    5108                                     m_ActiveModel->m_CurTime, pPiece->GetColor()); 
     5115                                    m_ActiveModel->m_CurFrame, pPiece->GetColor()); 
    51095116                                pLast->ChangeKey(1, false, param, LC_PK_ROTATION); 
    51105117                            } 
     
    51245131 
    51255132                                pLast->Initialize(pos[0]+i*opts.fMove[0]+j*opts.f2D[0]+k*opts.f3D[0], pos[1]+i*opts.fMove[1]+j*opts.f2D[1]+k*opts.f3D[1], pos[2]+i*opts.fMove[2]+j*opts.f2D[2]+k*opts.f3D[2], 
    5126                                     m_ActiveModel->m_CurTime, pPiece->GetColor()); 
     5133                                    m_ActiveModel->m_CurFrame, pPiece->GetColor()); 
    51275134                                pLast->ChangeKey(1, false, param, LC_PK_ROTATION); 
    51285135                            } 
     
    51355142                    pPiece = (Piece*)pFirst->m_Next; 
    51365143                    pFirst->CreateName(m_ActiveModel->m_Pieces); 
    5137                     pFirst->UpdatePosition(m_ActiveModel->m_CurTime); 
     5144                    pFirst->UpdatePosition(m_ActiveModel->m_CurFrame); 
    51385145                    AddPiece(pFirst); 
    5139                     pFirst->CalculateConnections(m_pConnections, m_ActiveModel->m_CurTime, false, true); 
     5146                    pFirst->CalculateConnections(m_pConnections, m_ActiveModel->m_CurFrame, false, true); 
    51405147                    pFirst = pPiece; 
    51415148                } 
     
    51595166                if (pPiece->IsSelected()) 
    51605167                { 
    5161                     pPiece->CalculateSingleKey (m_ActiveModel->m_CurTime, LC_PK_POSITION, move); 
    5162                     pPiece->ChangeKey(m_ActiveModel->m_CurTime, move, LC_PK_POSITION); 
    5163                     pPiece->ChangeKey(m_ActiveModel->m_CurTime, rot, LC_PK_ROTATION); 
     5168                    pPiece->CalculateSingleKey (m_ActiveModel->m_CurFrame, LC_PK_POSITION, move); 
     5169                    pPiece->ChangeKey(m_ActiveModel->m_CurFrame, move, LC_PK_POSITION); 
     5170                    pPiece->ChangeKey(m_ActiveModel->m_CurFrame, rot, LC_PK_ROTATION); 
    51645171                } 
    51655172 
     
    54255432                        pPiece->SetTimeShow(t+1); 
    54265433 
    5427                         if (pPiece->IsSelected () && t == m_ActiveModel->m_CurTime) 
     5434                        if (pPiece->IsSelected () && t == m_ActiveModel->m_CurFrame) 
    54285435                            pPiece->Select (false, false); 
    54295436                    } 
     
    54965503        case LC_VIEW_ZOOM: 
    54975504        { 
    5498             m_ActiveView->GetCamera()->DoZoom(nParam, m_nMouse, m_ActiveModel->m_CurTime, m_bAddKeys); 
     5505            m_ActiveView->GetCamera()->DoZoom(nParam, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys); 
    54995506            SystemUpdateFocus(NULL); 
    55005507            UpdateOverlayScale(); 
     
    55045511        case LC_VIEW_ZOOMIN: 
    55055512        { 
    5506             m_ActiveView->GetCamera()->DoZoom(-1, m_nMouse, m_ActiveModel->m_CurTime, m_bAddKeys); 
     5513            m_ActiveView->GetCamera()->DoZoom(-1, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys); 
    55075514            SystemUpdateFocus(NULL); 
    55085515            UpdateOverlayScale(); 
     
    55125519        case LC_VIEW_ZOOMOUT: 
    55135520        { 
    5514             m_ActiveView->GetCamera()->DoZoom(1, m_nMouse, m_ActiveModel->m_CurTime, m_bAddKeys); 
     5521            m_ActiveView->GetCamera()->DoZoom(1, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys); 
    55155522            SystemUpdateFocus(NULL); 
    55165523            UpdateOverlayScale(); 
     
    55275534 
    55285535            for (Piece* pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    5529                 if (pPiece->IsVisible(m_ActiveModel->m_CurTime)) 
     5536                if (pPiece->IsVisible(m_ActiveModel->m_CurFrame)) 
    55305537                    pPiece->CompareBoundingBox(bs); 
    55315538 
     
    55615568                Vector3 Front = Target - Eye; 
    55625569 
    5563                 camera->ChangeKey(m_ActiveModel->m_CurTime, m_bAddKeys, Eye, LC_CK_EYE); 
    5564                 camera-