CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TResource

Unit

Resources

Declaration

type TResource = class(TItem)

Description

Base resource class)

Hierarchy

TItem > TBaseItem

Methods

Overview

Publicconstructor Create(AManager: TItemsManager); override;
Publicdestructor Destroy; override;
Publicprocedure AddProperties(const Result: Props.TProperties); override;
Publicprocedure Allocate(ASize: Integer);
Protectedfunction Convert(OldFormat, NewFormat: Cardinal): Boolean; virtual;
Protectedfunction GetDataSizeInStream: Integer; virtual;
Publicfunction GetElementSize: Integer; virtual;
Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;
Publicclass function IsAbstract: Boolean; override;
Publicfunction Load(Stream: Basics.TStream): Boolean; override;
Protectedfunction LoadData(Stream: Basics.TStream): Boolean; virtual;
Publicfunction Save(Stream: Basics.TStream): Boolean; override;
Publicprocedure SetAllocated(ASize: Integer; AData: Pointer);
Protectedprocedure SetFormat(const Value: Cardinal);
Protectedprocedure SetLoaded(Value: Boolean); virtual;
Publicprocedure SetProperties(Properties: Props.TProperties); override;
Protectedprocedure UnloadData; virtual;

Description

Publicconstructor Create(AManager: TItemsManager); override;

 

Publicdestructor Destroy; override;

 

Publicprocedure AddProperties(const Result: Props.TProperties); override;

 

Publicprocedure Allocate(ASize: Integer);

Allocates an empty data buffer or changes allocated size of an existing one

Protectedfunction Convert(OldFormat, NewFormat: Cardinal): Boolean; virtual;

Should perform actual conversion from old format to a new one and return True if the conversion is possible and successful

Protectedfunction GetDataSizeInStream: Integer; virtual;

Returns number of bytes which should be allocated by the resource in a storage stream

Publicfunction GetElementSize: Integer; virtual;

Returns size of each element in resource

Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;

 

Publicclass function IsAbstract: Boolean; override;

 

Publicfunction Load(Stream: Basics.TStream): Boolean; override;

Loads the resource from a stream

Protectedfunction LoadData(Stream: Basics.TStream): Boolean; virtual;

Read resource's data from the specified stream

Publicfunction Save(Stream: Basics.TStream): Boolean; override;

Saves the resource to a stream

Publicprocedure SetAllocated(ASize: Integer; AData: Pointer);

Sets already allocated and probably ready to use data

Protectedprocedure SetFormat(const Value: Cardinal);

Calls Convert() and if it returns True sets the new format

Protectedprocedure SetLoaded(Value: Boolean); virtual;

Not used yet

Publicprocedure SetProperties(Properties: Props.TProperties); override;

 

Protectedprocedure UnloadData; virtual;

Not used yet

Properties

Overview

Publicproperty Data: Pointer;
Publicproperty DataSize: Integer;
Publicproperty DataSizeInStream: Integer;
Publicproperty Format: Cardinal;
Publicproperty Loaded: Boolean;
Publicproperty TotalElements: Integer;

Description

Publicproperty Data: Pointer;

Pointer to the resource's data

Publicproperty DataSize: Integer;

Data size in bytes

Publicproperty DataSizeInStream: Integer;

Data size in bytes in stream

Publicproperty Format: Cardinal;

Resource format

Publicproperty Loaded: Boolean;

Determines if the resource is loaded completely including its data

Publicproperty TotalElements: Integer;

Number of elements in the resource

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com