Browse Source

Don't store timestamp in the asset file, as that is silly

Josh Engebretson 10 years ago
parent
commit
b0d7771c4a

+ 2 - 0
Script/TypeScript/Atomic.d.ts

@@ -8048,6 +8048,8 @@ declare module Atomic {
 
 
       applyAttributes(): void;
       applyAttributes(): void;
       getComponentFile(): JSComponentFile;
       getComponentFile(): JSComponentFile;
+      // Match script name
+      matchScriptName(path: string): boolean;
       // Handle enabled/disabled state change. Changes update event subscription.
       // Handle enabled/disabled state change. Changes update event subscription.
       onSetEnabled(): void;
       onSetEnabled(): void;
       // Set what update events should be subscribed to. Use this for optimization: by default all are in use. Note that this is not an attribute and is not saved or network-serialized, therefore it should always be called eg. in the subclass constructor.
       // Set what update events should be subscribed to. Use this for optimization: by default all are in use. Note that this is not an attribute and is not saved or network-serialized, therefore it should always be called eg. in the subclass constructor.

+ 1 - 0
Script/TypeScript/Editor.d.ts

@@ -75,6 +75,7 @@ declare module Editor {
       // Construct.
       // Construct.
       constructor();
       constructor();
 
 
+      launchedByEditor(): boolean;
 
 
    }
    }
 
 

+ 0 - 2
Script/TypeScript/ToolCore.d.ts

@@ -236,7 +236,6 @@ declare module ToolCore {
       path: string;
       path: string;
       relativePath: string;
       relativePath: string;
       cachePath: string;
       cachePath: string;
-      timestamp: number;
       importerType: string;
       importerType: string;
       importerTypeName: string;
       importerTypeName: string;
       importer: AssetImporter;
       importer: AssetImporter;
@@ -256,7 +255,6 @@ declare module ToolCore {
       // Get the path relative to project
       // Get the path relative to project
       getRelativePath(): string;
       getRelativePath(): string;
       getCachePath(): string;
       getCachePath(): string;
-      getTimestamp(): number;
       getImporterType(): string;
       getImporterType(): string;
       getImporterTypeName(): string;
       getImporterTypeName(): string;
       getImporter(): AssetImporter;
       getImporter(): AssetImporter;

+ 0 - 14
Source/ToolCore/Assets/Asset.cpp

@@ -113,20 +113,12 @@ bool Asset::Load()
 
 
     db->RegisterGUID(guid_);
     db->RegisterGUID(guid_);
 
 
-    timestamp_ = root.GetUInt("timestamp");
-
     dirty_ = false;
     dirty_ = false;
     if (!CheckCacheFile())
     if (!CheckCacheFile())
     {
     {
         LOGINFOF("CheckCacheFile:false - %s", path_.CString());
         LOGINFOF("CheckCacheFile:false - %s", path_.CString());
         dirty_ = true;
         dirty_ = true;
     }
     }
-    else if (timestamp_ < fs->GetLastModifiedTime(path_))
-    {
-        LOGINFOF("Timestamp:false - %u vs modified %u - %s", timestamp_, fs->GetLastModifiedTime(path_), path_.CString());
-        dirty_ = true;
-    }
-
 
 
     // handle import
     // handle import
 
 
@@ -152,11 +144,6 @@ bool Asset::Save()
     root.SetInt("version", ASSET_VERSION);
     root.SetInt("version", ASSET_VERSION);
     root.SetString("guid", guid_);
     root.SetString("guid", guid_);
 
 
-    // update this where?
-    timestamp_ = fs->GetLastModifiedTime(path_);
-
-    root.SetUInt("timestamp", timestamp_);
-
     // handle import
     // handle import
 
 
     if (importer_.NotNull())
     if (importer_.NotNull())
@@ -288,7 +275,6 @@ bool Asset::SetPath(const String& path)
     {
     {
         dirty_ = true;
         dirty_ = true;
         guid_ = db->GenerateAssetGUID();
         guid_ = db->GenerateAssetGUID();
-        timestamp_ = fs->GetLastModifiedTime(path);
 
 
         Save();
         Save();
     }
     }

+ 0 - 2
Source/ToolCore/Assets/Asset.h

@@ -35,7 +35,6 @@ public:
     /// Get the path relative to project
     /// Get the path relative to project
     String GetRelativePath();
     String GetRelativePath();
     String GetCachePath() const;
     String GetCachePath() const;
-    unsigned GetTimestamp() const { return timestamp_; }
 
 
     const StringHash GetImporterType() { return importer_.Null() ? String::EMPTY : importer_->GetType(); }
     const StringHash GetImporterType() { return importer_.Null() ? String::EMPTY : importer_->GetType(); }
     const String& GetImporterTypeName() { return importer_.Null() ? String::EMPTY : importer_->GetTypeName(); }
     const String& GetImporterTypeName() { return importer_.Null() ? String::EMPTY : importer_->GetTypeName(); }
@@ -68,7 +67,6 @@ private:
     // can change
     // can change
     String path_;
     String path_;
     String name_;
     String name_;
-    unsigned timestamp_;
 
 
     bool dirty_;
     bool dirty_;
     bool isFolder_;
     bool isFolder_;