Loading
#openttdcoop - Paste
Archives
Trending
Docs
Login
ABAP
ActionScript
ActionScript 3
Ada
AIMMS3
ALGOL 68
Apache configuration
AppleScript
Apt sources
ARM ASSEMBLER
ASM
ASP
asymptote
Autoconf
Autohotkey
AutoIt
AviSynth
awk
BASCOM AVR
Bash
Basic4GL
BibTeX
BlitzBasic
bnf
Boo
Brainfuck
C
C#
C (LoadRunner)
C (Mac)
C (WinAPI)
C++
C++ (Qt)
C++ (WinAPI)
CAD DCL
CAD Lisp
CFDG
ChaiScript
Chapel
CIL
Clojure
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
Dart
DCL
DCPU-16 Assembly
DCS
Delphi
Diff
DIV
DOS
dot
E
ECMAScript
Eiffel
eMail (mbox)
EPC
Erlang
Euphoria
EZT
F#
Falcon
FO (abas-ERP)
Formula One
Fortran
FreeBasic
FreeSWITCH
GADV 4CS
GAMBAS
GDB
genero
Genie
glSlang
GML
GNU/Octave
GNU Gettext
GNU make
Gnuplot
Go
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML
HTML5
Icon
INI
Inno
INTERCAL
Io
ISPF Panel
J
Java
Java(TM) 2 Platform Standard Edition 5.0
Javascript
JCL
jQuery
KiXtart
KLone C
KLone C++
LaTeX
LDIF
Liberty BASIC
Lisp
LLVM Intermediate Representation
Locomotive Basic
Logtalk
LOLcode
Lotus Notes @Formulas
LotusScript
LScript
LSL2
Lua
MagikSF
MapBasic
Matlab M
Microchip Assembler
Microsoft Registry
mIRC Scripting
MMIX
Modula-2
Modula-3
MOS 6502 (6510) ACME Cross Assembler format
MOS 6502 (6510) Kick Assembler format
MOS 6502 (6510) TASM/64TASS 1.46 Assembler format
Motorola 68000 - HiSoft Devpac ST 2 Assembler format
Motorola 68000 Assembler
MXML
MySQL
Nagios
NetRexx
newlisp
nginx
Nimrod
NML NewGRF Meta Language
NSIS
Oberon-2
Objeck Programming Language
Objective-C
OCaml
OCaml (brief)
ooRexx
OpenBSD Packet Filter
OpenOffice.org Basic
Oracle 8 SQL
Oracle 11 SQL
Oxygene
OZ
ParaSail
PARI/GP
Pascal
PCRE
per
Perl
Perl 6
PHP
PHP (brief)
PIC16
Pike
Pixel Bender 1.0
PL/I
PL/SQL
PostgreSQL
PostScript
POVRAY
PowerBuilder
PowerShell
ProFTPd configuration
Progress
Prolog
PROPERTIES
ProvideX
Puppet
PureBasic
Python
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
R / S+
Racket
Rails
RBScript
REBOL
rexx
robots.txt
RPM Specification File
Ruby
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty
SPARK
SPARQL
SQL
Squirrel Script
Squirrel Script with OpenTTD AI/GS
StandardML
StoneScript
SystemVerilog
T-SQL
TCL
Tera Term Macro
Text
thinBasic
TypoScript
Unicon (Unified Extended Dialect of Icon)
Uno Idl
Unreal Script
UPC
Urbi
Vala
vb.net
VBScript
Vedit macro language
Verilog
VHDL
Vim Script
Visual Basic
Visual Fox Pro
Visual Prolog
Whitespace
Whois (RPSL format)
Winbatch
X++
XBasic
XML
Xorg configuration
YAML
ZiLOG Z80 Assembler
ZXBasic
/** Data of an animation group. */ class AnimGroupData { public: AnimGroupData(); AnimGroupData(const AnimGroupData &ag); AnimGroupData &operator=(const AnimGroupData &ag); int m_iTileSize; ///< Size of a tile for this animation group. int m_iAnimLength; ///< Number of frames in an animation of this group. std::string m_sName; ///< Name of the animation group. int m_aFirstFrames[4]; ///< Index into AnimationStorage::m_vFrames of the first frame, else \c -1. }; /** Data of a frame in an animation. */ class FrameData { public: FrameData(); FrameData(const FrameData &fd); FrameData &operator=(const FrameData &fd); int m_iSound; ///< If non-zero, sound to play. int m_iNumberElements; ///< Number of sprite elements in the frame. int m_iFirstElement; ///< Index of the first sprite element in AnimationStorage::m_vElements. }; /** Flags of a sprite element. */ enum ElementFlags { ELM_FLIP_VERT = 0x1, ///< Flip sprite vertically. ELM_FLIP_HOR = 0x2, ///< Flip sprite horizontally. ELM_ALPHA_50 = 0x4, ///< Apply alpha 50%. ELM_ALPHA_75 = 0x8, ///< Apply alpha 75%. }; /** Data of a sprite element in a frame. */ class ElementData { public: ElementData(); ElementData(const ElementData &ed); ElementData &operator=(const ElementData &ed); int m_iSprite; int m_iXoffset; int m_iYoffset; int m_iLayerClass; ///< Class of the display condition. int m_iLayerId; ///< Value of the display condition. int m_iFlags; ///< Flags, @see ElementFlags for the fields. }; /** Data of a sprite, used in an element. */ class SpriteData { public: SpriteData(); SpriteData(const SpriteData &sd); SpriteData &operator=(const SpriteData &sd); int m_iWidth; int m_iHeight; int m_iDataLength; ///< Number of bytes in AnimationStorage::m_pSpriteData for this sprite. int m_iDataOffset; ///< Offset of the first byte in AnimationStorage::m_pSpriteData. }; class AnimationStorage { public: AnimationStorage(); bool LoadFile(Input &oInput); std::vector<AnimGroupData> m_vGroupedAnims; std::vector<FrameData> m_vFrames; std::vector<ElementData> m_vElements; std::vector<SpriteData> m_vSprites; unsigned char *m_pSpriteData; size_t m_iSpriteDataSize; private: bool LoadAnimGroup(AnimGroupData &oAnimGrp, int iFramesUsed, Input &oInput); bool LoadFrame(FrameData &oFrame, int &iElementsUsed, int iSpritesUsed, Input &oInput); bool LoadSprite(SpriteData &oSprite, int &iSpriteDataUsed, oInput &oInput); };
Mark as private
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
forever