Packages

  • package root
    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package github
    Definition Classes
    io
  • package memo33
    Definition Classes
    github
  • package scdbpf

    Provides methods for accessing and modifying the contents of DBPF formatted files.

    Provides methods for accessing and modifying the contents of DBPF formatted files. Currently, only DBPF version 1.0 is supported (used by SimCity 4).

    DBPF files are accessed via DbpfFiles, a container of DbpfEntries. The content of a DbpfEntry can be accessed from BufferedEntries in decoded form as DbpfType, such as Exemplar, Fsh or Sc4Path.

    This package object provides additional type aliases for DbpfExceptions.

    Examples

    To get started, it is easiest to start the REPL via sbt console, which loads all the dependencies and useful initial import statements. Reading a DBPF file, sorting its entries by TGI and writing back to the same file could be achieved like this:

    val dbpf = DbpfFile.read(new File("foobar.dat"))
    dbpf.write(dbpf.entries.sortBy(_.tgi))

    This example shifts the GIDs of all LTexts by +3:

    dbpf.write(dbpf.entries.map { e =>
      if (e.tgi matches Tgi.LText)
        e.copy(e.tgi.copy(gid = e.tgi.gid + 3))
      else
        e
    })

    Another example: This decodes all the Sc4Path entries and rotates them by 90 degree.

    val writeList = for (e <- dbpf.entries) yield {
      if (e.tgi matches Tgi.Sc4Path) {
        val be = e.toBufferedEntry.convertContentTo(Sc4Path)
        be.copy(content = be.content * RotFlip.R1F0)
      } else {
        e
      }
    }
    dbpf.write(writeList)

    The following example finds the first entry that is an exemplar and contains a property with a specific ID. (Note the view to avoid unnecessary decoding if the exemplar is already among the first entries.)

    val id = UInt(0x12345678)
    dbpf.entries.view.
      filter(_.tgi matches Tgi.Exemplar).
      map(_.toBufferedEntry.convertContentTo(Exemplar)).
      find(_.content.properties.contains(id))
    Definition Classes
    memo33
  • package compat
    Definition Classes
    scdbpf
  • BufferedEntry
  • DbpfEntry
  • DbpfExceptions
  • DbpfFile
  • DbpfPackager
  • DbpfProperty
  • DbpfType
  • DbpfTypeCompanion
  • DbpfUtil
  • Exemplar
  • Experimental
  • Fsh
  • LText
  • RawEntry
  • RawType
  • S3d
  • Sc4Path
  • StreamedEntry
  • Tgi
  • TgiMask
  • WithContentConverter

object S3d extends DbpfTypeCompanion[S3d]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. S3d
  2. DbpfTypeCompanion
  3. WithContentConverter
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class AnimGroup(vertBlock: IndexedSeq[Int], indxBlock: IndexedSeq[Int], primBlock: IndexedSeq[Int], matsBlock: IndexedSeq[Int], name: Option[String] = None, flags: Int = 0) extends S3dGroup with Product with Serializable
  2. case class AnimSection(numFrames: Short, frameRate: Short, playMode: PlayMode.Value, displacement: Float, groups: IndexedSeq[AnimGroup]) extends IndexedSeqProxy[AnimGroup] with Product with Serializable
  3. case class IndxGroup(indxs: IndexedSeq[Int]) extends IndexedSeqProxy[Int] with S3dGroup with Product with Serializable
  4. case class Material(id: Int, wrapU: WrapMode.Value, wrapV: WrapMode.Value, magFilter: MagnifFilter.Value, minFilter: MinifFilter.Value, animRate: Short = 0, animMode: Short = 0, name: Option[String]) extends Product with Serializable

    A material referencing a specific ID.

    A material referencing a specific ID.

    animRate

    0 or 33

    animMode

    0 or 2

  5. case class MatsGroup(flags: MatsFlags.ValueSet, alphaFunc: MatsFunc.Value = MatsFunc.Greater, depthFunc: MatsFunc.Value = MatsFunc.LessEqual, sourceBlend: MatsBlend.Value = MatsBlend.One, destBlend: MatsBlend.Value = MatsBlend.Zero, alphaThreshold: Short, matClass: Int = 0, reserved: Byte = 0, materials: IndexedSeq[Material]) extends S3dGroup with Product with Serializable

    Settings of a material.

    Settings of a material.

    alphaFunc

    greater

    depthFunc

    less equal

    sourceBlend

    one

    destBlend

    zero

    alphaThreshold

    0, 0xFF or 0x7FF

    matClass

    0

    reserved

    0

    materials

    usually has length 1 (or 0).

  6. case class Orientation(x: Float, y: Float, z: Float, w: Float) extends Product with Serializable
  7. case class Prim(primType: PrimType.Value, firstIndx: Int, numIndxs: Int) extends Product with Serializable
  8. case class PrimGroup(prims: IndexedSeq[Prim]) extends IndexedSeqProxy[Prim] with S3dGroup with Product with Serializable
  9. case class PropGroup(meshIndex: Short, frameIndex: Short, assignmentType: String, assignedValue: String) extends S3dGroup with Product with Serializable
  10. case class RegpGroup(name: String, translations: IndexedSeq[Translation], orientations: IndexedSeq[Orientation]) extends S3dGroup with Product with Serializable
  11. case class Translation(x: Float, y: Float, z: Float) extends Product with Serializable
  12. case class Vert(x: Float, y: Float, z: Float, u: Float, v: Float) extends IndexedSeq[Float] with Product with Serializable
  13. case class VertGroup(verts: IndexedSeq[Vert]) extends IndexedSeqProxy[Vert] with S3dGroup with Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(vert: IndexedSeq[VertGroup], indx: IndexedSeq[IndxGroup], prim: IndexedSeq[PrimGroup], mats: IndexedSeq[MatsGroup], anim: IndexedSeq[AnimGroup], prop: IndexedSeq[PropGroup] = IndexedSeq.empty, regp: IndexedSeq[RegpGroup] = IndexedSeq.empty): S3d

    Construct a new S3D model (shorthand for non-animated models).

  5. def apply(vert: IndexedSeq[VertGroup], indx: IndexedSeq[IndxGroup], prim: IndexedSeq[PrimGroup], mats: IndexedSeq[MatsGroup], anim: AnimSection, prop: IndexedSeq[PropGroup], regp: IndexedSeq[RegpGroup]): S3d

    Construct a new S3D model.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def contentConverter: Converter[BufferedEntry[DbpfType], BufferedEntry[S3d]]
  9. implicit val converter: Converter[DbpfType, S3d]
    Definition Classes
    S3dDbpfTypeCompanion
  10. def defaultMats(transparency: S3d.Transparency.Value, id: Int, name: Option[String] = None, mipmap: Boolean = false, wrapU: S3d.WrapMode.Value = WrapMode.Clamp, wrapV: S3d.WrapMode.Value = WrapMode.Clamp): MatsGroup

    Commonly used settings for materials.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  25. object AnimGroup extends Serializable
  26. object MagnifFilter extends Enumeration
  27. object MatsBlend extends Enumeration
  28. object MatsFlags extends Enumeration
  29. object MatsFunc extends Enumeration
  30. object MinifFilter extends Enumeration
  31. object PlayMode extends Enumeration
  32. object PrimType extends Enumeration
  33. object Transparency extends Enumeration
  34. object WrapMode extends Enumeration

Inherited from DbpfTypeCompanion[S3d]

Inherited from WithContentConverter[S3d]

Inherited from AnyRef

Inherited from Any

Ungrouped