Remove old code

This commit is contained in:
Simon Robertshaw
2012-11-17 19:43:59 +00:00
parent fb43f7d23e
commit e3594aba9e
178 changed files with 0 additions and 45173 deletions

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
.gitattributes export-ignore
.gitignore export-ignore

31
.gitignore vendored
View File

@@ -1,31 +0,0 @@
*.*.swp
.directory
powder.def
powder.pref
gmon.out
*.*.orig
build/stamps/*
*~
*.pyc
utils/*
*.log
build/*
src/python/stdlib/*
*.exe
*.dll
*.srv
*.bat
*.o
*.me
.DS_Store
*.lproj
*.xcodeproj
*.plist
*.vcxproj
*.user
*.filter
*.sln
*.suo
*.manifest
*.manifest.res
*.pdb

458
Changelog
View File

@@ -1,458 +0,0 @@
* Version 81.6 Build 189
o Fix zoom in decorations mode
* Version 81.5 Build 188
o Allow Lua Key event function to override keys used by stickman and zoom
o Hide intro text when opened by PTSave link
o Added Console button to quick menu
* Version 81.4 Build 187
o Fixed issues with saving current menu (Walls is now a valid menu)
o Fixed crash when pasting long text strings
o Disable decorations in save thumbnails
* Version 81.3 Build 186
o Stickmen can now shoot plasma
* Version 81.3 Build 185
o Reduced lag created by PLNT
o Optimisations to improve speed with GOL
o Added more checks for invalid elements
o Added brush size to Lua environment (tpt.brushx, tpt.brushy)
o Added brush "Alt Selected" element to Lua environment (tpt.selecteda)
o Added mouse wheel to mouse event arguments (mouseX, mouseY, mouseButton, mouseWheel)
o SALT will only melt ICE if the ICE if above salt-water freezing temperature
o Updated README and LICENSE files
* Version 81.2 Build 184
o Fix bug in saving code when there are no signs
* Version 81.1 Build 183
o C5 neighbouring cold insulators no longer explodes
o Fixed issue where clicking on a stack of save signs will cause an unstoppable torrent of save open windows
o Prevent acid from eating broken glass
o Stickman should no longer be able to walk on the bottom of the screen
o VOID and BHOL should eat stickman
o Reduced rate of lighting creation by CLNE
o INST can now be sparked directly using the brush
o Lightning should now be affected by gravity fields
o Fix crash when sparking INST
* Version 81.0 Build 182
o Many things causing BHOL formation have been fixed
o Stickmen no longer fall through some powders
o Fireworks work with different gravity modes and Newtonian gravity
o Freezing point for SLTW corrected to -21.1 °C
o SING formation removed from fusion
* Version 80.4 Build 179
o VINE grows along WOOD
o changes to FRZZ
o Adding neutrons to EXOT makes it turn into whatever element it touches
o Clone remembers the ctype of lava (can now clone molten metal etc, instead of just molten stone)
o Compressed particles turn into BHOL
* Version 80.3 Build 178
o Fix session check on startup
* Version 80.3 Build 177
o TTAN only blocks pressure when adjacent to at least two more TTAN particles (or anytime with a .tmp of 1)
* Version 80.2 Build 176
o Minor EXOT fix
* Version 80.1 Build 175
o EXOT uses heat view's rainbow color scale
* Version 80.1 Build 174
o No change - not in beta anymore
* Version 80.0 Beta Build 173
o New Element: EXOT
o WARP element changes - now completely invisible
* Version 79.7 Build 172
o Fix a TRON flag
* Version 79.6 Beta Build 171
o Fix FIGH not spawning
* Version 79.5 Beta Build 170
o Fix bug where snow melted without taking it's ctype into account
o Fix PROP_NEUTPENETRATE
o Add a setting to draw a wall frame around the screen
o Fix flashing dust glitch
o Fix command line save opening
* Version 79.4 Beta Build 169
o Fix ptsave parsing if there is no '#'
o Download progress bar for save opening
o Soap bubbles easily formed, also their links inherit soap's decoration color
o Don't show disabled elements in the search
o Fix saltwater boiling temp typo
* Version 79.3 Beta Build 168
o Fix emp flash
o Live parts rendering in deco editor
o Oxygen fusion and other fusion fixes
o Prevent infinite loops in Lua
o Fix some decoration editor and console bugs
o Custom graphics functions with lua using tpt.graphics_func()
o VOID and PVOD can be set to only eat their ctype
o New feature, Element search (press 'e' on the keyboard)
o Fix bug with BOMB not deleting correctly
o Fix issue that cause the gravity walls to not update
o Handling of ptsave protocol so you can create links to open games in Powder toy
* Version 79.2 Beta Build 167
o Fix minor spelling errors
o Fix crash when using flood-fill or a lot of INST
o Fix an issue that made it impossible to change the Windows size from the options screen
* Version 79.1 Beta Build 166
o Prevent changing of Window size if the screen is too small.
o Fix bug that caused pressure to leak from TTAN when pausing/framestepping
o Fix crash when opening display options
* Version 79.0 Beta Build 165
o Fix Titanium only conducting once
o Better colour options preview.
* Version 79.0 Beta Build 164
o Fix a problem with GPMP that caused gravity to depend on air pressure
o Fix TNT sometimes not exploding if multiple TNT particles are in the same place
o Fix PUMP not generating negative pressure if it is next to a wall
o New element: titanium (in the solids menu), which completely blocks air and absorbs some neutrons
* Version 78.1 Build 163
o Fix bug that created "weaponised explosive GEL"
o Changes to License (GPLv2 to GPLv3)
o Fix bug that caused thumbnail caching to not work
o Remove unused debug output of thumbnail cache
o Plasma can now travel through portals and PIPE
o Fix file opening on Mac OS X
* Version 78.0 Beta Build 162
o Fixes when moving signs
o Line snapping in the decoration editor
o Changes to SING to prevent it from exploding through walls
o Save soap bubbles
o Changes to GEL, will no longer absorb water when saturated
o FILT not heated by photons with ambient heat on
o New save format: OPS, allows saving of almost all data within the simulation
* Version 77.0 Build 159
o tmp2 support for old console
o save tmp2 for TRON
* Version 76.0 Build 158
o GEL won't try to move solids anymore
* Version 76.0 Build 157
o Fixes for GEL and TRON
o Fix sponge bug
* Version 76.0 Beta Build 156
o New element: TRON
* Version 75.0 Beta Build 155
o New element: GEL
* Version 74.2 Build 154
o Walls don't trigger automatic pipe pattern generation
o BCOL uses COAL's graphics function
o Report icon
o Fix unmeltable ice
* Version 74.1 Build 152
o Fix ice with ctype of 0
* Version 74.1 Build 151
o BRAY glows in fancy display mode
* Version 74.1 Build 150
o Icon for Force Elements
o Allow DEST to be used with clone elements.
* Version 74.0
o Fixes for Triangle brush and minor electron bug
o Debug lines for WiFi, Portal and Soap
o Fusion for H2 at high temperature+high pressure
o Ambient heat and Newtonian Gravity in Quick Options menu.
o Smudge tool
o Speed improvements for particle drawing
* Version 73.0
o New elements: FRAY - Similar to ARAY but applies force, RPEL - Attract and repel particles
o DEUT can be compressed by gravitational fields
o Fix for "bumpy" streams of photons coming from PCLN
o Lua methods for writing and reading the bmap and emap
* Version 72.0
o More consistent spark speed (possibly affects existing circuits)
o BRAY fire speed (Only shoots once per spark)
o DLAY blocked by INSL
o WIFI will always take one frame to transmit SPRK
o Ambient heat blocked by walls.
* Version 71.3
o OPS format fixes
o Figh drawn correctly in stamps
* Version 71.2
o Enable use of caching server to improve performance or thumbnail retrieval
* Version 71.1
o Fixes to OPS format
o Fix issue where LRBD/RBDM isn't ignited by WATR
o Fix crash on rotating a stamp with walls as wide as the window
o Fix Invisible photons
o Fix bug where WARP+SING destroys DMND
o Fix issue where Lua can't create photons in glass
* Version 71.0
o Update can_move, recount menu items, and clear graphics cache when tpt.el is changed
o Fix creation of invalid sign walls
o Added OPS format, disabled and not used
* Version 70.1
o Support element names and hex constants in PROP tool
o Fix TNT bug
o Fix crash in clear_sim if gravity is not initialized
* Version 70.0
o New element: ignition cord
o Stickmen and fighter fixes
* Version 69.1
o New Lua API features, ability to edit particle properties from tpt.el... array, particles are exposed as an array now
* Version 69.0
o New element: TNT
o Bug fix for LCRY and ELEC
o Restore old LCRY/DECO rendering
o Fix display modes on number hotkeys not saving correctly
* Version 68.7
o Additions to Lua API:
o tpt.el: Table of element types, tpt.el.none = 0, tpt.el.dust = 1, etc.
o tpt.version: Table of version info, tpt.el.major, minor, build
o int tpt.element(string name): returns numeric ID of given element name, tpt.element("WATR") = tpt.el.watr
o tpt.element_func(function func, int element, [boolean replace]) : Sets the update function for a specific element
o tpt.element_func has the following args: (int index, int x, int y, int surround, int nt)
* Version 68.6
o Add back number key hotkeys to change display modes
o Add back blob and heat gradient display
o Correct icons in render_ui
o Add back portal effects
* Version 68.5
o Fix decorations
* Version 68.4
o Stamp browser fixes
o Remove some stuff from HUD to make it fit
o Fix grid mode
o Replace cmode with flexible render options
* Version 68.3
o Pixel grid and cursor in zoom
* Version 68.1
o CAUS killes stickmen they can also have gas powers now
o Fix air inversion
* Version 68.0
o Decorations appear on gases
o Stickmen and fighter fixes
o Fixed WIRE graphics
o New elements: ACEL and DCEL, accelerate nearby photons
* Version 67.0
o New element: ELEC
o Changed now LCRY works
* Version 66.1
o Massive overhaul of graphics code, appearance of many elements changed
* Version 65.5
o Elements from Maksprog's mod
o LIGH - Lightning
o DEST - Variation of BOMB
o TESC - Tesla coil, creates lightning
o EMP - Destroys electronic components
o Fix bug with infinite temperature
o Fix beta enrolling
o Add a new mode to filter, subtract (tmp of 3)
o Quick options menu in top right, can toggle various options quickly
o Lots and lots of fixes
* Version 64.3
o Decoration editor tool menu, with lighten and darken tools
o Can type in decoration editor color boxes for specific RGB values, hit enter after typing a number to confirm
o SOAP removes decoration, opposite of BIZR
o Water equalization, turn on in options menu, or with tpt.watertest()
o BUBW changes to be more realistic, can explode
o New element CAUS, an acid like gas, created from ACID+WTRV
o Can see selected elements from Lua, tpt.selectedl or tpt.selectedr
o Saved settings are in JSON format, replaces powder.def
o Can opt in to receive beta updates
o QRTZ scatters photons.
o New Tool, PROP, edit properties easily without console.
o FILT has modes with .tmp (0,1,2). 0 is convert (old method). 1 will filter (only close color can pass). 2 is add color
o 'Sign out' button in the login menu, instead of submitting blank data
o Fancy colored powders, hit 'n' to toggle
* Version 61.2
o Fixed a Lua mouse event bug
o Can set decoration layer "dcolour" property
o Fixed some possible cases where particles disappear randomly
* Version 61.1
o Fix some memory leaks
o STOR will absorb anything when no ctype set, and it's ctype can't be a solid element
* Version 61.0
o Added energy only wall (Photons, Neutrons, etc.) as replacement for gas only wall fix
o STOR will change appearance when it holds a particle
* Version 60.1
o Tools menu for AIR, HEAT, COOL, etc.
o tpt.getscript() to download from official script repository (not used)
o tpt.setwindowsize(scale,fullscreen) to change scale (1 or 2) and fullscreen (0 or 1)
o Selection for stamp/copy now by pixel
o Water puts out fire better
o New elements: CO2, BUBW, DRIC, STOR, PVOD, CONV
o Zoom toggle: alt+z
o BIZR acts as a dye
o Many other various fixes and improvements
* Version 57.5
o Fix Lua keyevent function
* Version 57.4
o Fix STKM2 spaz
o Fix bug where electrode (ETRD) would delete particles in replace mode
* Version 57.3
o Fix coal being invisible when first drawn
* Version 57.2
o Allow scrolling in the special menu
* Version 57.1
o Stops the client launching DDos attack on server when checking for updates
* Version 57
o Gravity tools (NGRV and PGRV)
o Allow reloading of directly opened files
o Graphical changes to coal
* Version 56
o New element: GBMB (gravity bomb), requires newtonian gravity
* Version 55
o New element: WIRE
o Extra line tool info if you type tpt.setdebug(4) into the console
* Version 53.3
o New Lua API functions to get keyboard/mouse presses
* Version 53.1
o Fix old GOL + clone saves and other life visual imprivements
o Fancy lensing for mewtonian gravity in fancy (7) display
o New element: DLAY
o New Lua API functions from me4502
* Version 47.3
o Enhanced visual effects for Portals
o Glow now has more stimuli (Green: Pressure, Blue: Movement, Red: Heat)
o Python console (Unavailable in current beta)
o Fixed issue where you appear to be logged in but aren't.
o Changes to Quartz (Grows like crystal when exposed to salt water)
o Singularity explodes upon death
o Save ID shown after saving and on Open Dialog
o Rearrangement of some elements (Photons in Radioactive, Thunder in Explosive, etc)
* Version 46.3
o Major game engine and performance improvements.
o New GOL elements.
o More secure login system
* Version 45.2
o Important! Fix for Auto-update in Linux.
* Version 45.1
o Small bugfix for Lava and Portals.
o Fix crash when 2 of the same stickman are somehow placed.
* Version 45.0
o Fix bug where description would persist after a reset
o ARAY now passes through INWR without interracting.
o INST has been fixed and placed in the Electronics menu
o Photons turn into neutrons when passing through INVS
o Other small bug fixes.
* Version 44.7
o Fix login and dialog text box issues.
o Small bugfixes to some elements.
o Additional 'debug' information.
o Increase WIFI channels
o Add missing icons for menus and display modes.
* Version 44.6
o Fix for brush issues when using small brushes.
o Pause state saving modifications.
* Version 44.5
o Fix corruption issues with FAN wall.
* Version 44.4
o Many new elements from cracker64s mod.
o Pause state is saved.
o Particle properties are saved more accurately.
o Improved search and save viewing, added descriptions and comments.
* Version 42.3
o Changed internal temperature scale to kelvin.
o Fixed physics bug with certain powders.
o Fixed bug when loading saves with stickman in.
o Added save history, the ability to view previous versions of saves.
* Version 42.0
o New Elements: Brick, Glow, Diesel, many others.
o Source code seperation
o Lots of other stuff that I can't remember.
* Version 41.3
o Fixes bug where Insulation would burst into flames randomly
o Moves fancy new effects into a separate colour mode.
* Version 39.0
o New element: Liquid Crystal
o New element: Battery
o New element: Noble Gas
o Copy, cut and paste
* Version 38.0
o New element: Nitrogen Ice
o New element: Electrode (Allows currents to jump)
o Adds a lock icon to private saves.
o Binds the '[' and ']' keys to decrease/increase the cursor size for those without scroll wheels.
o Fixes wall menu issue where walls would be selected by accident.
* Version 37.0
o New element: Plasma
o New element: Thunder/Lighting
o New wall: Allows only gas
o Fixes HUD bug.
* Version 36.3
o Introduced public & private saving (more info here)
* Version 36.2
o Fixes bug where rating would appear as Zero in search.
* Version 36.1
o Feature: Particle sampling with middle click
o Feature: Download from website, for information, see the "Announcement" forum section.
* Version 36.0
o Changes to the menu
o New elements for electronics
o New voting system
o Added functions for moderating
* Version 35.0
o Added elements: White Hole, Black Hole, Rubidium and Liquid Rubidium
o Fixed the OSX version
o Some other bug fixes that I forgot.
* Version 34.0
o Fixed certain graphical glitches
o Changed menu categories
o Increased menu hover size
* Version 33.2
o Photons can now ignite flammable materials.
o Distilled water will turn into water on contact with water.
o Fixes burning broken metal
* Version 34.0 (Beta 6)
o New element menu layout
o New element: Liquid Nitrogen
* Version 34.0 (Beta 5)
o Improvements to stamp browser
o Added Glyphs for Blob and Heat view
o Fixed bug that caused a crash on Windows systems when using the wall tool in the window edges.(Fixed more than last time)
o Decreased/Increased Min/Max Temperatures.
* Version 34.0 (Beta 4)
o Cool, heat and Air no longer crash upon flood fill
o Fixed bug that caused a crash on Windows systems when using the wall tool in the window edges.
o Stamp browser now allows multiple pages.
o Improved the zoom features, allowing inspection.
o Modification to temperature simulation, pressure is now taken into account with transitions from liquid to gas and vice-versa
o Fixed bug where Salt-water would not leave salt upon evaporation
* Version 34.0 (Beta 3)
o Bug fixes for uranium
o Fixed bug where extremely hot objects would show as black
o Fixed but where stamps would not be loaded
* Version 34.0 (Beta 2)
o Bug fixes
o Legacy Mode state is now saved and loaded
o Fix "Cool" and "Heat" when drawing on walls.
o Air now works.
* Version 34.0 (Beta 1)
o Bug fixes
o Legacy Mode (Older saves will load with legacy mode, preserving the functionality of the older powder toy)
o Heat and Cool elements. (Air is broken until next beta.)
* Version 34.0 (Beta)
o Heat Simulation (With free bugs and glitches)
o New Element: Uranium, heats up when pressurised.
o New button, AIR, provides instant air, the Alt+Click and Middle Click can be used as a shortcut
* Version 33.1
o Masses of bug fixes
o Broken metal and breakable metal fixed (conduction)
o Liquid collisions fixed.
* Version 33.0
o Added Photons, particles similar to neutrons that travel in straight lines
o Added destructable metal
o Fixed a glitch with diamond that would make it appear invisible to air pressure.
* Version 32.0
o Added Diamond (Thanks to ief014)
o Fixed packaging errors for the Windows release
* Version 31.0
o Plutonium more powerful
o Changes to the handling of lava (Now solidifies into the same material it was melted from).
o New element: Salt.
o New element: Salt water
* Version 30.0
o Added the ability to change the zoom strength
o Increased the maximum pen size.
o New element: Concrete, tougher than stone, stackable.
o New element: Distilled water, similar to water, but doesn't conduct electricity
o Changed menu layout, walls at the bottom, elements at the top (to allow for more future elements)
o 32bit colour for Macintosh versions.
* Version 28.4
o Fixes crash when loading a save with acid.
o Another tiny change for acid colour in blob mode
* Version 28.3
o Fixes acid colour in blob mode
o Fixes blob mode colour on Macintosh and 16bit colour systems
* Version 28.2
o Quit confirmation dialogue when using the escape key
o Walls are "blobbed" in Blob view
* Version 28.1
o Steam rises
o Acid drastically changed, now dilutes itself when dissolving other particles
* Version 28.0
o "Yellow wall" bug fix, doesn't absorb particles when placed above another wall type.
o New wall type added: E-Hole, absorbs particles when unpowered, released them when powered.

674
LICENSE
View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

172
Makefile
View File

@@ -1,172 +0,0 @@
SOURCES := $(wildcard src/*.c src/elements/*.c)
HEADERS := $(wildcard includes/*.h)
OBJS := $(patsubst src/%.c,build/obj/%.o,$(SOURCES))
CFLAGS := -w -std=c99 -D_POSIX_C_SOURCE=200112L -DLUACONSOLE -DGRAVFFT -Iincludes/ -D_GNU_SOURCE
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
LFLAGS := -lpthread -lSDL -lfftw3f -lm -lbz2 -lX11 -llua5.1 -lrt
LFLAGS_X := -lm -lbz2 -lSDLmain
LFLAGS_WIN := -lmingw32 -lgnurx -lws2_32 -lSDLmain -lpthread -lSDL -lfftw3f -lm -lbz2 -llua5.1
MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=native -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -pg -g
COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
WIN32_TARG := powder-sse.exe powder-sse2.exe
CC := gcc
CC_WIN := i686-w64-mingw32-gcc
WIN_RES := i686-w64-mingw32-windres
powder: build/powder
powder-debug: build/powder-debug
powder-sse3: build/powder-sse3
powder-sse2: build/powder-sse2
powder-sse: build/powder-sse
powder-sse3-opengl: build/powder-sse3-opengl
powder-64-sse3: build/powder-64-sse3
powder-64-sse2: build/powder-64-sse2
powder-debug-64: build/powder-debug-64
powder-64-sse3-opengl: build/powder-64-sse3-opengl
powder-sse3.exe: build/powder-sse3.exe
powder-sse2.exe: build/powder-sse2.exe
powder-sse.exe: build/powder-sse.exe
# general compiler flags
build/powder: CFLAGS += -DINTERNAL -DLIN64 $(OFLAGS)
build/powder-debug: CFLAGS += -m32 -DLIN32 $(FLAGS_DBUG)
build/powder-sse3 build/powder-sse2 build/powder-sse build/powder-sse3-opengl: CFLAGS += -m32 -DLIN32 $(OFLAGS)
build/powder-64-sse3 build/powder-64-sse2 build/powder-64-sse3-opengl: CFLAGS += -m64 -DLIN64 $(OFLAGS)
build/powder-debug-64: CFLAGS += -m64 -DLIN64 $(FLAGS_DBUG)
build/powder-sse3.exe build/powder-sse2.exe build/powder-sse.exe: CFLAGS += -mwindows -DWIN32 $(OFLAGS)
build/powder-64-sse3-opengl build/powder-sse3-opengl: CFLAGS += -DOGLR -DPIX32OGL -DPIXALPHA
# SSE flags:
build/powder build/powder-sse3 build/powder-sse3-opengl build/powder-64-sse3 build/powder-64-sse3-opengl build/powder-debug build/powder-debug-64 build/powder-sse3.exe: CFLAGS += -march=native -DX86 -DX86_SSE3 -msse3
build/powder-sse2 build/powder-64-sse2 build/powder-sse2.exe: CFLAGS += -march=native -DX86 -DX86_SSE2 -msse2
build/powder-sse build/powder-sse.exe: CFLAGS += -march=native -DX86 -DX86_SSE
# libs:
build/powder build/powder-debug build/powder-sse3 build/powder-sse2 build/powder-sse build/powder-sse3-opengl build/powder-debug-64 build/powder-64-sse3 build/powder-64-sse2 build/powder-64-sse3-opengl: LIBS += $(LFLAGS)
build/powder-sse3.exe build/powder-sse2.exe build/powder-sse.exe: LIBS += $(LFLAGS_WIN)
build/powder-64-sse3-opengl build/powder-sse3-opengl: LIBS += -lGL
# extra windows stuff
build/powder-sse3.exe build/powder-sse2.exe build/powder-sse.exe: EXTRA_OBJS += build/obj/powder-res.o
build/powder-sse3.exe build/powder-sse2.exe build/powder-sse.exe: CC := $(CC_WIN)
build/powder-sse3.exe build/powder-sse2.exe build/powder-sse.exe: build/obj/powder-res.o
build/powder: $(patsubst build/obj/%.o,build/obj/%.powder.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder.o,$(OBJS)) $(LIBS) -o $@
build/obj/%.powder.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-debug: $(patsubst build/obj/%.o,build/obj/%.powder-debug.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-debug.o,$(OBJS)) $(LIBS) -o $@
build/obj/%.powder-debug.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-sse3: $(patsubst build/obj/%.o,build/obj/%.powder-sse3.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse3.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-sse3.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-sse2: $(patsubst build/obj/%.o,build/obj/%.powder-sse2.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse2.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-sse2.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-sse: $(patsubst build/obj/%.o,build/obj/%.powder-sse.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-sse.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-sse3-opengl: $(patsubst build/obj/%.o,build/obj/%.powder-sse3-opengl.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse3-opengl.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-sse3-opengl.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-64-sse3: $(patsubst build/obj/%.o,build/obj/%.powder-64-sse3.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-64-sse3.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-64-sse3.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-64-sse2: $(patsubst build/obj/%.o,build/obj/%.powder-64-sse2.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-64-sse2.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-64-sse2.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-debug-64: $(patsubst build/obj/%.o,build/obj/%.powder-debug-64.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-debug-64.o,$(OBJS)) $(LIBS) -o $@
build/obj/%.powder-debug-64.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-64-sse3-opengl: $(patsubst build/obj/%.o,build/obj/%.powder-64-sse3-opengl.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-64-sse3-opengl.o,$(OBJS)) $(LIBS) -o $@
strip $@
build/obj/%.powder-64-sse3-opengl.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/powder-sse3.exe: $(patsubst build/obj/%.o,build/obj/%.powder-sse3.exe.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse3.exe.o,$(OBJS)) $(LIBS) -o $@
strip $@
chmod 0644 $@
build/obj/%.powder-sse3.exe.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
# Extra compiler flag to fix stack alignment
# When Windows creates the gravity calculation thread, it has 4 byte stack alignment
# But we need 16 byte alignment so that SSE instructions in FFTW work without crashing
build/obj/gravity.powder-sse3.exe.o: src/gravity.c $(HEADERS)
$(CC) -c $(CFLAGS) -mincoming-stack-boundary=2 -o $@ $<
build/powder-sse2.exe: $(patsubst build/obj/%.o,build/obj/%.powder-sse2.exe.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse2.exe.o,$(OBJS)) $(LIBS) -o $@
strip $@
chmod 0644 $@
build/obj/%.powder-sse2.exe.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/obj/gravity.powder-sse2.exe.o: src/gravity.c $(HEADERS)
$(CC) -c $(CFLAGS) -mincoming-stack-boundary=2 -o $@ $<
build/powder-sse.exe: $(patsubst build/obj/%.o,build/obj/%.powder-sse.exe.o,$(OBJS))
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(patsubst build/obj/%.o,build/obj/%.powder-sse.exe.o,$(OBJS)) $(LIBS) -o $@
strip $@
chmod 0644 $@
build/obj/%.powder-sse.exe.o: src/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
build/obj/gravity.powder-sse.exe.o: src/gravity.c $(HEADERS)
$(CC) -c $(CFLAGS) -mincoming-stack-boundary=2 -o $@ $<
.PHONY: clean
clean:
rm -f build/obj/*.o
rm -f build/obj/elements/*.o
powder-icc: $(SOURCES)
/opt/intel/Compiler/11.1/073/bin/intel64/icc -m64 -o$@ -Iincludes/ -O2 -march=core2 -msse3 -mfpmath=sse -lSDL -lbz2 -lm -xW $(SOURCES) -std=c99 -D_POSIX_C_SOURCE=200112L
build/obj/powder-res.o: src/Resources/powder-res.rc src/Resources/powder.ico src/Resources/document.ico
cd src/Resources && $(WIN_RES) powder-res.rc powder-res.o
mv src/Resources/powder-res.o build/obj/powder-res.o
powder-x: $(SOURCES)
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS_X) $(MFLAGS) $(SOURCES) -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -framework SDL
strip $@
mv $@ build
powder-x-ogl: $(SOURCES)
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS_X) $(MFLAGS) $(SOURCES) -DOpenGL -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -framework SDL -framework OpenGL
strip $@
mv $@ build

97
README
View File

@@ -1,97 +0,0 @@
The Powder Toy - August 2012
Get latest version here: http://powdertoy.co.uk/Download.html
To use online features such as saving, you need to register at: http://powdertoy.co.uk/Register.html
Thanks:
---------------------------------------------------------------------------
Stanislaw K Skowronek - Designed the original
Simon Robertshaw
Skresanov Savely
cracker64
Bryan Hoyle
Nathan Cousins
jacksonmj
Lieuwe Mosch
Anthony Boot
Matthew Miller
jacob1
Instructions:
---------------------------------------------------------------------------
Click on the elements with the mouse and draw in the field, like in MS Paint. The rest of the game is learning what happens next.
Controls:
---------------------------------------------------------------------------
Caps Lock Specific Element Erase
Insert Replace mode
TAB Switch between circle/square/triangle brush
Space Pause
Q Quit
Esc Quit
Z Zoom
S Save stamp (+ Ctrl when STK2 is out)
L Load last saved stamp
K Stamp library
C Cycle view mode
1-9 Set view mode
P Save screenshot to .ppm
F Pause and go to next frame
G Grid
H Show/Hide HUD
Ctrl + H Show intro text
F1 Show intro text
D Debug mode (+ Shift when STK2 is out)
I Invert Pressure and Velocity map
T Vine mode
W Toggle gravity modes (+ Ctrl when STK2 is out)
Y Toggle air modes
R Reset LIFE generation
N "Sand effect" for drawing powders
B Decoration editor
Ctrl + B Toggle decorations on/off
U Toggle ambient heat on/off
M switch left and right selected elements
N Toggle pretty powders
Ctrl + I Install powder toy for loading saves/stamps by double clicking
~ Console
= Reset pressure and velocity map
[ Decrease brush size
] Increase brush size
Alt + [ Decrease brush size by 1
Alt + ] Increase brush size by 1
Ctrl + C/V/X Copy/Paste/Cut
Ctrl + Z Undo
Ctrl + Cursor drag Rectangle
Shift + Cursor drag Line
MMB / Alt + LMB click Sample element
Mouse scroll Change brush size
Ctrl + Mouse scroll Change vertical brush size
Shift + Mouse scroll Change horizontal brush size
Shift + Ctrl + R Horizontal mirror for selected area
Ctrl + R Rotate selected area counterclockwise
Ctrl + Left Alt Select element for Specific Element erase
Ctrl + = Reset Electricity
Command Line:
---------------------------------------------------------------------------
scale:1 Normal window resolution
scale:2 Doubled window resolution
kiosk Fullscreen mode
proxy:server[:port] Proxy server to use [Example: proxy:wwwcache.lancs.ac.uk:8080]
open <file> Opens the file as a stamp or game save
ddir <directory> Directory used for saving stamps and preferences
nohud Disables the hud
sound Enable sound to be played from console
scripts Enable scripts to be run from old console
ptsave:<save id>#<name(Optional)> (ex. ptsave:2198#Destroyable_city_5_wth_metro~dima-gord)

View File

View File

View File

@@ -1,20 +0,0 @@
editor: editor.c
gcc -oeditor -DSCALE=2 -DFONTEDITOR editor.c -lSDL -lm -O3 -ffast-math -march=k8 -Wall -std=c99
editor.exe: editor.c
gcc -oeditor.exe -DSCALE=2 -DFONTEDITOR editor.c -lmingw32 -lm -lSDLmain -lSDL -O3 -ffast-math -march=k8 -Wall -std=c99 -mwindows
packer: packer.c
gcc -opacker -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8 -Wall -std=c99
packer.exe: packer.c
gcc -opacker.exe -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8 -Wall -std=c99
unpacker: unpacker.c
gcc -ounpacker -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8 -Wall -std=c99
unpacker.exe: unpacker.c
gcc -ounpacker.exe -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8 -Wall -std=c99
clean:
rm -f editor packer unpacker editor.exe packer.exe unpacker.exe

View File

@@ -1,288 +0,0 @@
#ifdef FONTEDITOR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <SDL/SDL.h>
#define CELLW 12
#define CELLH 10
#define XRES 800
#define YRES 600
char xsize=CELLW, ysize=CELLH;
char base=7, top=2;
char font[256][CELLH][CELLW];
char width[256];
void blendpixel(unsigned *vid, int x, int y, int r, int g, int b, int a)
{
int t;
if(x<0 || y<0 || x>=XRES || y>=YRES)
return;
if(a!=255) {
t = vid[y*XRES+x];
r = (a*r + (255-a)*((t>>16)&255)) >> 8;
g = (a*g + (255-a)*((t>>8)&255)) >> 8;
b = (a*b + (255-a)*(t&255)) >> 8;
}
vid[y*XRES+x] = (r<<16)|(g<<8)|b;
}
int drawchar(unsigned *vid, int x, int y, int c, int r, int g, int b)
{
int i, j;
for(j=0; j<CELLH; j++)
for(i=0; i<width[c]; i++)
blendpixel(vid, x+i, y+j, r, g, b, (font[c][j][i]*255)/3);
return x + width[c];
}
int drawtext(unsigned *vid, int x, int y, char *s, int r, int g, int b)
{
for(;*s;s++)
x = drawchar(vid, x, y, *s, r, g, b);
return x;
}
void drawline(unsigned *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a)
{
int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy;
float e, de;
if(cp) {
y = x1;
x1 = y1;
y1 = y;
y = x2;
x2 = y2;
y2 = y;
}
if(x1 > x2) {
y = x1;
x1 = x2;
x2 = y;
y = y1;
y1 = y2;
y2 = y;
}
dx = x2 - x1;
dy = abs(y2 - y1);
e = 0.0f;
de = dy/(float)dx;
y = y1;
sy = (y1<y2) ? 1 : -1;
for(x=x1; x<=x2; x++) {
if(cp)
blendpixel(vid, y, x, r, g, b, a);
else
blendpixel(vid, x, y, r, g, b, a);
e += de;
if(e >= 0.5f) {
y += sy;
e -= 1.0f;
}
}
}
void drawcell(unsigned *vid, int i, int j, int c, int m)
{
int x,y,x0=i*32+64,y0=j*32+64;
for(y=1;y<32;y++)
for(x=1;x<32;x++)
blendpixel(vid, x0+x, y0+y, 127*m, 127*m, 127*m, c);
for(x=0;x<32;x+=2) {
if(!j)
blendpixel(vid, x0+x, y0, 64*m, 64*m, 64*m, 255);
if(!i)
blendpixel(vid, x0, y0+x, 64*m, 64*m, 64*m, 255);
blendpixel(vid, x0+x, y0+32, 64*m, 64*m, 64*m, 255);
blendpixel(vid, x0+32, y0+x, 64*m, 64*m, 64*m, 255);
}
}
/***********************************************************
* SDL OUTPUT *
***********************************************************/
SDL_Surface *sdl_scrn;
int sdl_key;
void sdl_open(void)
{
if(SDL_Init(SDL_INIT_VIDEO)<0) {
fprintf(stderr, "Initializing SDL: %s\n", SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
sdl_scrn=SDL_SetVideoMode(XRES*SCALE,YRES*SCALE + 40*SCALE,32,SDL_SWSURFACE);
if(!sdl_scrn) {
fprintf(stderr, "Creating window: %s\n", SDL_GetError());
exit(1);
}
}
void sdl_blit(int x, int y, int w, int h, unsigned int *src, int pitch)
{
unsigned *dst,i,j,k;
if(SDL_MUSTLOCK(sdl_scrn))
if(SDL_LockSurface(sdl_scrn)<0)
return;
dst=(unsigned *)sdl_scrn->pixels+y*sdl_scrn->pitch/4+x;
for(j=0;j<h;j++) {
for(k=0;k<SCALE;k++) {
for(i=0;i<w*SCALE;i++)
dst[i]=src[i/SCALE];
dst+=sdl_scrn->pitch/4;
}
src+=pitch/4;
}
if(SDL_MUSTLOCK(sdl_scrn))
SDL_UnlockSurface(sdl_scrn);
SDL_UpdateRect(sdl_scrn,0,0,0,0);
}
int frame_idx=0;
void dump_frame(unsigned int *src, int w, int h, int pitch)
{
char frame_name[32];
unsigned j,i,c;
FILE *f;
sprintf(frame_name,"frame%04d.ppm",frame_idx);
f=fopen(frame_name,"w");
fprintf(f,"P6\n%d %d\n255\n",w,h);
for(j=0;j<h;j++) {
for(i=0;i<w;i++) {
c=((src[i]&0xFF0000)>>16)|(src[i]&0x00FF00)|((src[i]&0x0000FF)<<16);
fwrite(&c,3,1,f);
}
src+=pitch/4;
}
fclose(f);
frame_idx++;
}
int sdl_poll(void)
{
SDL_Event event;
sdl_key=0;
while(SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
sdl_key=event.key.keysym.sym;
break;
case SDL_QUIT:
return 1;
}
}
return 0;
}
/***********************************************************
* MAIN PROGRAM *
***********************************************************/
char *tag = "(c) 2008 Stanislaw Skowronek";
int main(int argc, char *argv[])
{
unsigned *vid_buf = calloc(XRES*YRES, sizeof(unsigned));
int x, y, b = 0, lb, c = 0xA0, i, j, dc = 0;
int mode = 0;
FILE *f;
f = fopen("font.bin", "r");
if(f) {
fread(&xsize, 1, 1, f);
fread(&ysize, 1, 1, f);
fread(&base, 1, 1, f);
fread(&top, 1, 1, f);
fread(width, 1, 256, f);
fread(font, CELLW*CELLH, 256, f);
fclose(f);
}
sdl_open();
while(!sdl_poll()) {
if(sdl_key=='q' || sdl_key==SDLK_ESCAPE)
break;
if(sdl_key==' ' || sdl_key=='=') {
c++;
printf("Current: %02X '%c'\n", c, c);
}
if(sdl_key=='\b' || sdl_key=='-') {
c--;
printf("Current: %02X '%c'\n", c, c);
}
lb = b;
b = SDL_GetMouseState(&x, &y);
if(b) {
x /= SCALE;
y /= SCALE;
}
i = x/32-2;
j = y/32-2;
if(!lb && b && (i<0 || i>=CELLW)) {
if(abs(j-base) < abs(j-top))
mode = 2; // BASE
else
mode = 3; // TOP
} else if(!lb && b && (j<0 || j>=CELLH))
mode = 4; // LEFT
else if(!lb && b) {
mode = 1; // DRAW
if(b==1)
dc = (font[c][j][i]+3)%4;
else
dc = (font[c][j][i]+1)%4;
}
if(b)
switch(mode) {
case 1:
if(i>=0 && j>=0 && i<CELLW && j<CELLH)
font[c][j][i] = dc;
break;
case 2:
base = j;
break;
case 3:
top = j;
break;
case 4:
width[c] = i;
break;
}
memset(vid_buf, 0, XRES*YRES*4);
for(j=0; j<CELLH; j++)
for(i=0; i<CELLW; i++)
drawcell(vid_buf, i, j, (font[c][j][i]*255)/3, i>=width[c]?1:2);
drawline(vid_buf, 32, 64+base*32, 128+32*CELLW, 64+base*32, 128, 255, 128, 255);
drawline(vid_buf, 32, 64+top*32, 128+32*CELLW, 64+top*32, 128, 128, 255, 255);
drawline(vid_buf, 64+width[c]*32, 32, 64+width[c]*32, 128+32*CELLH, 255, 128, 128, 255);
drawtext(vid_buf, 64, 192+32*CELLH, "A quick brown fox jumps over the lazy dog.", 255, 255, 255);
drawtext(vid_buf, 64, 192+33*CELLH, "A QUICK BROWN FOX JUMPS OVER THE LAZY DOG.", 255, 255, 255);
drawtext(vid_buf, 64, 192+34*CELLH, "0123456789 ~`!@#$%^&*()-=_+[]{}\\|;:'\",./<>?", 255, 255, 255);
drawchar(vid_buf, 32, 192+32*CELLH, c, 255, 255, 255);
sdl_blit(0, 0, XRES, YRES, vid_buf, XRES*4);
}
f = fopen("font.bin", "w");
fwrite(&xsize, 1, 1, f);
fwrite(&ysize, 1, 1, f);
fwrite(&base, 1, 1, f);
fwrite(&top, 1, 1, f);
fwrite(width, 1, 256, f);
fwrite(font, CELLW*CELLH, 256, f);
fclose(f);
return 0;
}
#endif

Binary file not shown.

View File

@@ -1,111 +0,0 @@
#ifdef FONTEDITOR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define CELLW 12
#define CELLH 10
char xsize=CELLW, ysize=CELLH;
char base=7, top=2;
char font[256][CELLH][CELLW];
char width[256];
int bits_n = 0, bits_a = 0;
int flush_bits(void)
{
if(bits_n) {
bits_a >>= 8-bits_n;
printf("0x%02X, ", bits_a);
bits_a = 0;
bits_n = 0;
return 1;
}
return 0;
}
int stock_bits(int b, int nb)
{
bits_a >>= nb;
bits_a |= b << (8-nb);
bits_n += nb;
if(bits_n >= 8) {
printf("0x%02X, ", bits_a);
bits_a = 0;
bits_n = 0;
return 1;
}
return 0;
}
int save_char(int c)
{
int nb = 1;
int x, y;
if(!width[c])
return 0;
printf(" 0x%02X, ", width[c]);
for(y=0; y<CELLH; y++)
for(x=0; x<width[c]; x++)
nb += stock_bits(font[c][y][x]&3, 2);
nb += flush_bits();
printf("\n");
return nb;
}
char *tag = "(c) 2008 Stanislaw Skowronek";
int main(int argc, char *argv[])
{
FILE *f;
int c, p[256], n = 0;
memset(p, 0, 256*4);
f = fopen("font.bin", "r");
fread(&xsize, 1, 1, f);
fread(&ysize, 1, 1, f);
fread(&base, 1, 1, f);
fread(&top, 1, 1, f);
fread(width, 1, 256, f);
fread(font, CELLW*CELLH, 256, f);
fclose(f);
printf("#ifndef FONT_H_CHECK\n");
printf("#define FONT_H_CHECK\n");
printf("#define FONT_H %d\n", ysize);
printf("#ifdef INCLUDE_FONTDATA\n");
printf("char font_data[] = {\n");
for(c=0; c<256; c++) {
p[c] = n;
n += save_char(c);
}
printf("};\n");
printf("short font_ptrs[] = {\n");
for(c=0; c<256; c++) {
if(!(c%8))
printf(" ");
printf("0x%04X,", p[c]);
if((c%8)==7)
printf("\n");
else
printf(" ");
}
printf("};\n");
printf("#endif\n#endif\n");
return 0;
}
#endif

View File

@@ -1,113 +0,0 @@
#ifdef FONTEDITOR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define INCLUDE_FONTDATA
#include "font.h"
#define CELLW 12
#define CELLH 10
char xsize=CELLW, ysize=CELLH;
char base=7, top=2;
char font[256][CELLH][CELLW];
char width[256];
int bits_n = 0, bits_a = 0;
int flush_bits(void)
{
if(bits_n) {
bits_a >>= 8-bits_n;
printf("0x%02X, ", bits_a);
bits_a = 0;
bits_n = 0;
return 1;
}
return 0;
}
int stock_bits(int b, int nb)
{
bits_a >>= nb;
bits_a |= b << (8-nb);
bits_n += nb;
if(bits_n >= 8) {
printf("0x%02X, ", bits_a);
bits_a = 0;
bits_n = 0;
return 1;
}
return 0;
}
int save_char(int c)
{
int nb = 1;
int x, y;
if(!width[c])
return 0;
printf(" 0x%02X, ", width[c]);
for(y=0; y<CELLH; y++)
for(x=0; x<width[c]; x++)
nb += stock_bits(font[c][y][x]&3, 2);
nb += flush_bits();
printf("\n");
return nb;
}
void load_char(int c)
{
unsigned char *start = font_data + font_ptrs[c];
int x, y, w, b;
w = *(start ++);
if(!w)
return;
b = 0;
for(y=0; y<CELLH; y++)
for(x=0; x<w; x++) {
font[c][y][x] = ((*start) >> b) & 3;
b += 2;
if(b >= 8) {
start ++;
b = 0;
}
}
width[c] = w;
printf("%02x: %d\n", c, w);
}
char *tag = "(c) 2011 Stanislaw Skowronek";
int main(int argc, char *argv[])
{
FILE *f;
int i;
for(i=0; i<sizeof(font_ptrs)/sizeof(short); i++)
load_char(i);
f = fopen("font.bin", "w");
fwrite(&xsize, 1, 1, f);
fwrite(&ysize, 1, 1, f);
fwrite(&base, 1, 1, f);
fwrite(&top, 1, 1, f);
fwrite(width, 1, 256, f);
fwrite(font, CELLW*CELLH, 256, f);
fclose(f);
return 0;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#ifndef _SDLMain_h_
#define _SDLMain_h_
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@end
#endif /* _SDLMain_h_ */

View File

@@ -1,44 +0,0 @@
/**
* Powder Toy - air simulation (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AIR_H
#define AIR_H
#include "defines.h"
extern float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
extern float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL];
extern float pv[YRES/CELL][XRES/CELL], opv[YRES/CELL][XRES/CELL];
extern unsigned char bmap_blockair[YRES/CELL][XRES/CELL];
extern unsigned char bmap_blockairh[YRES/CELL][XRES/CELL];
extern float cb_vx[YRES/CELL][XRES/CELL];
extern float cb_vy[YRES/CELL][XRES/CELL];
extern float cb_pv[YRES/CELL][XRES/CELL];
extern float cb_hv[YRES/CELL][XRES/CELL];
extern float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL];
extern float hv[YRES/CELL][XRES/CELL], ohv[YRES/CELL][XRES/CELL]; // Ambient Heat
extern float kernel[9];
void make_kernel(void);
void update_airh(void);
void update_air(void);
#endif

View File

@@ -1,127 +0,0 @@
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr();
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull();
extern cJSON *cJSON_CreateTrue();
extern cJSON *cJSON_CreateFalse();
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray();
extern cJSON *cJSON_CreateObject();
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,31 +0,0 @@
/**
* Powder Toy - simple console (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONSOLE_H
#define CONSOLE_H
#include <defines.h>
extern char console_more;
extern char console_error[];
extern int file_script;
int console_parse_coords(char *txt, int *x, int *y, char *err);
int console_parse_type(char *txt, int *element, char *err);
int console_parse_partref(char *txt, int *which, char *err);
int process_command_old(pixel *vid_buf, char *console, char *console_error);
#endif

View File

@@ -1,276 +0,0 @@
/**
* Powder Toy - Main source
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEFINE_H
#define DEFINE_H
#ifdef WIN32
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
#endif
//VersionInfoStart
#define SAVE_VERSION 83
#define MINOR_VERSION 0
#define BUILD_NUM 205
//VersionInfoEnd
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter
#define MTOS_EXPAND(str) #str
#define MTOS(str) MTOS_EXPAND(str)
#define SERVER "powdertoy.co.uk"
#define SCRIPTSERVER "powdertoy.co.uk"
#define STATICSERVER "static.powdertoy.co.uk"
#define LOCAL_SAVE_DIR "Saves"
#define APPDATA_SUBDIR "\\HardWIRED"
#define THUMB_CACHE_SIZE 256
#ifndef M_PI
#define M_PI 3.14159265f
#endif
#ifndef M_GRAV
#define M_GRAV 6.67300e-1
#endif
#define IMGCONNS 3
#define TIMEOUT 100
#define HTTP_TIMEOUT 10
#ifdef RENDERER
#define MENUSIZE 0
#define BARSIZE 0
#else
#define MENUSIZE 40
#define BARSIZE 17
#endif
#define XRES 612
#define YRES 384
#define NPART XRES*YRES
#define XCNTR 306
#define YCNTR 192
#define MAX_DISTANCE sqrt(pow(XRES, 2)+pow(YRES, 2))
#define GRAV_DIFF
#define MAXSIGNS 16
#define TAG_MAX 256
#define ZSIZE_D 16
#define ZFACTOR_D 8
extern unsigned char ZFACTOR;
extern unsigned char ZSIZE;
#define CELL 4
#define ISTP (CELL/2)
#define CFDS (4.0f/CELL)
#define AIR_TSTEPP 0.3f
#define AIR_TSTEPV 0.4f
#define AIR_VADV 0.3f
#define AIR_VLOSS 0.999f
#define AIR_PLOSS 0.9999f
#define GRID_X 5
#define GRID_Y 4
#define GRID_P 3
#define GRID_S 6
#define GRID_Z 3
#define CATALOGUE_X 4
#define CATALOGUE_Y 3
#define CATALOGUE_S 6
#define CATALOGUE_Z 3
#define STAMP_MAX 240
#define SAVE_OPS
//#define REALISTIC
#define NGOL 25
#define NGOLALT 24 //NGOL should be 24, but use this var until I find out why
#define CIRCLE_BRUSH 0
#define SQUARE_BRUSH 1
#define TRI_BRUSH 2
#define BRUSH_NUM 3
#ifdef PIX16
typedef unsigned short pixel;
#else
typedef unsigned int pixel;
#endif
#define SURF_RANGE 10
#define NORMAL_MIN_EST 3
#define NORMAL_INTERP 20
#define NORMAL_FRAC 16
#define REFRACT 0x80000000
/* heavy flint glass, for awesome refraction/dispersion
this way you can make roof prisms easily */
#define GLASS_IOR 1.9
#define GLASS_DISP 0.07
#ifdef WIN32
#define strcasecmp stricmp
#endif
#if defined(WIN32) && !defined(__GNUC__)
#define fmin min
#define fminf min
#define fmax max
#define fmaxf max
#endif
#if defined(WIN32) && !defined(__GNUC__)
#define TPT_INLINE _inline
#else
#define TPT_INLINE inline
#endif
#define SDEUT
//#define REALHEAT
#define DEBUG_PARTS 0x0001
#define DEBUG_PARTCOUNT 0x0002
#define DEBUG_DRAWTOOL 0x0004
#define DEBUG_PERFORMANCE_CALC 0x0008
#define DEBUG_PERFORMANCE_FRAME 0x0010
typedef unsigned char uint8;
extern int saveURIOpen;
extern char * saveDataOpen;
extern int saveDataOpenSize;
extern int amd;
extern int FPSB;
int NUM_PARTS;
int GRAV;
int GRAV_R;
int GRAV_G;
int GRAV_B;
int GRAV_R2;
int GRAV_G2;
int GRAV_B2;
extern int legacy_enable;
extern int sound_enable;
extern int kiosk_enable;
extern int aheat_enable;
extern int decorations_enable;
extern int active_menu;
extern int hud_enable;
extern int pretty_powder;
extern int drawgrav_enable;
extern int ngrav_enable;
extern char bframe;
int limitFPS;
int water_equal_test;
extern int quickoptions_tooltip_fade;
extern int loop_time;
extern int debug_flags;
#define DEBUG_PERF_FRAMECOUNT 256
extern int debug_perf_istart;
extern int debug_perf_iend;
extern long debug_perf_frametime[DEBUG_PERF_FRAMECOUNT];
extern long debug_perf_partitime[DEBUG_PERF_FRAMECOUNT];
extern long debug_perf_time;
extern int active_menu;
extern int sys_pause;
extern int framerender;
extern int mousex, mousey;
struct sign
{
int x,y,ju;
char text[256];
};
typedef struct sign sign;
struct stamp
{
char name[11];
pixel *thumb;
int thumb_w, thumb_h, dodelete;
};
typedef struct stamp stamp;
int frameidx;
int MSIGN;
int CGOL;
int ISGOL;
int ISLOVE;
int ISLOLZ;
int ISGRAV;
int ISWIRE;
int GSPEED;
int love[XRES/9][YRES/9];
int lolz[XRES/9][YRES/9];
unsigned char gol[YRES][XRES];
unsigned char gol2[YRES][XRES][NGOL+1];
int SEC;
int SEC2;
int console_mode;
int REPLACE_MODE;
int CURRENT_BRUSH;
int GRID_MODE;
int VINE_MODE;
int DEBUG_MODE;
int GENERATION;
int ISSPAWN1;
int ISSPAWN2;
extern sign signs[MAXSIGNS];
extern stamp stamps[STAMP_MAX];
extern int stamp_count;
extern int itc;
extern char itc_msg[64];
extern int do_open;
extern int sys_pause;
extern int sys_shortcuts;
extern int legacy_enable; //Used to disable new features such as heat, will be set by commandline or save.
extern int framerender;
extern pixel *vid_buf;
extern unsigned char last_major, last_minor, update_flag, last_build;
extern char http_proxy_string[256];
//Functions in main.c
void thumb_cache_inval(char *id);
void thumb_cache_add(char *id, void *thumb, int size);
int thumb_cache_find(char *id, void **thumb, int *size);
void clear_sim(void);
void del_stamp(int d);
void sdl_seticon(void);
void play_sound(char *file);
int set_scale(int scale, int kiosk);
#endif

View File

@@ -1,27 +0,0 @@
/**
* Powder Toy - header for all element files
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ELEMENT_H
#define ELEMENT_H
// This header should be included by all files in src/elements/
#include "powder.h"
#include "gravity.h"
#include "misc.h"
#include "math.h"
#include "powdergraphics.h"
#endif

View File

@@ -1,314 +0,0 @@
/**
* Powder Toy - font data
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FONT_H_CHECK
#define FONT_H_CHECK
#define FONT_H 10
#ifdef INCLUDE_FONTDATA
char font_data[] = {
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xC7, 0x31, 0x0C, 0x02, 0x70, 0x04, 0x00, 0x00,
0x05, 0xCC, 0x74, 0x23, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x80, 0x19, 0xCC, 0xE0, 0x3F, 0xCC, 0xF0, 0x2F, 0xCC, 0x90, 0x09, 0x00, 0x00, 0x00,
0x06, 0x30, 0xD0, 0x3F, 0x33, 0xE1, 0x07, 0xF4, 0x12, 0x33, 0xFF, 0x00, 0x03, 0x00, 0x00, 0x00,
0x07, 0x2D, 0xCE, 0xCC, 0xE1, 0x1D, 0xC0, 0x03, 0x74, 0x4B, 0x33, 0xB3, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x7D, 0x30, 0x0C, 0x13, 0xD0, 0x32, 0xB3, 0x33, 0x1C, 0x7D, 0x07, 0x00, 0x00, 0x00, 0x00,
0x03, 0x4C, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x34, 0x1D, 0x07, 0x03, 0x07, 0x1D, 0x34, 0x00, 0x00, 0x00,
0x04, 0x07, 0x1D, 0x34, 0x30, 0x34, 0x1D, 0x07, 0x00, 0x00, 0x00,
0x06, 0x44, 0xD0, 0x1C, 0x64, 0xF0, 0x3F, 0x64, 0xD0, 0x1C, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x02, 0x30, 0xE0, 0x2F, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0D, 0x03, 0x00,
0x05, 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00, 0x00,
0x06, 0x80, 0x02, 0x0C, 0xA0, 0x00, 0x03, 0x28, 0xC0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0xF8, 0xE0, 0x39, 0x07, 0x33, 0x32, 0x03, 0xB3, 0x38, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x30, 0xF0, 0x60, 0x03, 0x0C, 0x30, 0xC0, 0x40, 0x07, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFC, 0xB1, 0x34, 0x41, 0x03, 0x0A, 0x2C, 0x70, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFC, 0x71, 0x34, 0x01, 0x03, 0x1E, 0x00, 0x33, 0x34, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xC0, 0x03, 0x37, 0x1C, 0x73, 0x34, 0xBF, 0x03, 0x30, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x33, 0x00, 0x57, 0xE0, 0x2F, 0x00, 0x13, 0x30, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xF4, 0xD3, 0x00, 0x07, 0xF0, 0x1F, 0x03, 0x33, 0x34, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x07, 0x34, 0x80, 0x03, 0x0E, 0x38, 0xD0, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFC, 0xB1, 0x34, 0x03, 0xD3, 0x1F, 0x03, 0x73, 0x34, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFC, 0xB1, 0x34, 0x03, 0xC3, 0x3F, 0x40, 0x23, 0x30, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x70, 0x04, 0x40, 0x70, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x1C, 0x04, 0x00, 0x0C, 0x0D, 0x03, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0xC0, 0xC3, 0x0B, 0x1B, 0xC0, 0x0B, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x0F, 0x90, 0x83, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFD, 0x71, 0x30, 0x81, 0x03, 0x0E, 0x34, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0xF8, 0x0F, 0x1D, 0x30, 0xE7, 0x37, 0x73, 0x1C, 0xE3, 0x2F, 0x07, 0x00, 0xFD, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x74, 0xD0, 0x1D, 0x47, 0x33, 0x30, 0xFF, 0x33, 0x30, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00,
0x06, 0xBF, 0x30, 0x38, 0x43, 0xF3, 0x1F, 0x43, 0x33, 0x34, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xF4, 0xD1, 0x34, 0x03, 0x31, 0x00, 0x03, 0x70, 0x34, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0x7F, 0x30, 0x1D, 0x43, 0x33, 0x30, 0x03, 0x33, 0x34, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x32, 0x00, 0x03, 0xF0, 0x0B, 0x03, 0x30, 0x10, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x33, 0x10, 0x03, 0xF0, 0x0B, 0x03, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0xF4, 0xD1, 0x34, 0x03, 0x30, 0x3E, 0x03, 0x73, 0x34, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0x47, 0x33, 0x30, 0x03, 0xF3, 0x3F, 0x03, 0x33, 0x30, 0x47, 0x03, 0x00, 0x00, 0x00, 0x00,
0x04, 0x1D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1D, 0x00, 0x00, 0x00,
0x06, 0xD0, 0x01, 0x0C, 0xC0, 0x00, 0x0C, 0xC0, 0x10, 0x0D, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x47, 0xC3, 0x34, 0x70, 0x03, 0xBC, 0x00, 0xB3, 0xC0, 0xB0, 0x70, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x07, 0x30, 0x00, 0x03, 0x30, 0x00, 0x03, 0x30, 0x10, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x00,
0x08, 0x03, 0x30, 0x1F, 0x3D, 0x7B, 0x3B, 0xE3, 0x32, 0x83, 0x30, 0x03, 0x30, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x07, 0xCD, 0x03, 0x73, 0xC3, 0x8C, 0x32, 0xC3, 0xCD, 0xC0, 0x33, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0xF4, 0x41, 0xC7, 0x71, 0xD0, 0x0C, 0x30, 0x03, 0xCD, 0xD1, 0xD1, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x7F, 0x30, 0x1D, 0x43, 0x73, 0x34, 0xFF, 0x31, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0xF4, 0x41, 0xD3, 0x71, 0xD0, 0x0C, 0x30, 0xC3, 0xCD, 0xD1, 0xD1, 0xDF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x31, 0x34, 0x03, 0xF3, 0x0F, 0xD7, 0x30, 0x34, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFC, 0xB1, 0x31, 0x07, 0xD0, 0x0F, 0x90, 0x23, 0x34, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00,
0x06, 0xFF, 0x13, 0x13, 0x30, 0x00, 0x03, 0x30, 0x00, 0x03, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x03, 0xCC, 0x00, 0x33, 0xC0, 0x0C, 0x30, 0x03, 0xCD, 0xD2, 0xD1, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x03, 0x33, 0x30, 0x03, 0xB3, 0x38, 0xCD, 0xC1, 0x0D, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x03, 0x30, 0x43, 0x30, 0xC7, 0x34, 0xCD, 0x1C, 0xED, 0x1E, 0x2C, 0x0E, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x03, 0x4C, 0xC3, 0x81, 0x3B, 0xD0, 0x03, 0xDC, 0x42, 0xC3, 0x31, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x03, 0xB3, 0x38, 0xDC, 0x40, 0x07, 0x30, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0xFF, 0x0F, 0xD0, 0x02, 0x2C, 0xC0, 0x02, 0x2D, 0xC0, 0x06, 0xF0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x2F, 0x03, 0x03, 0x03, 0x03, 0x03, 0x2F, 0x00, 0x00, 0x00,
0x05, 0x03, 0x28, 0xC0, 0x00, 0x0A, 0x30, 0x80, 0x02, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x04, 0x3E, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3E, 0x00, 0x00, 0x00,
0x04, 0x1D, 0x37, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
0x03, 0x83, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0x47, 0x30, 0xFC, 0x0C, 0xD3, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x05, 0x07, 0x0C, 0xF0, 0xC7, 0x35, 0xC3, 0x0C, 0xF3, 0x07, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xC3, 0x25, 0x03, 0x4C, 0xD2, 0x03, 0x00, 0x00, 0x00, 0x00,
0x05, 0xD0, 0x00, 0x83, 0x8F, 0x33, 0xC3, 0x1C, 0xD3, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xC7, 0x30, 0xBF, 0x0C, 0xD0, 0x0B, 0x00, 0x00, 0x00, 0x00,
0x04, 0x3D, 0x07, 0x03, 0x2F, 0x03, 0x03, 0x07, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xC0, 0xCB, 0x32, 0xC3, 0xF4, 0x03, 0x4C, 0x30, 0x7E, 0x00, 0x00,
0x05, 0x03, 0x0C, 0xF0, 0xC7, 0x39, 0xC3, 0x0C, 0x73, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x04, 0x04, 0x1C, 0x00, 0x0D, 0x0C, 0x0C, 0x1D, 0x00, 0x00, 0x00,
0x04, 0x00, 0x30, 0x00, 0x34, 0x30, 0x30, 0x30, 0x30, 0x1E, 0x00,
0x05, 0x03, 0x0C, 0x31, 0xCE, 0x0E, 0x1F, 0xCC, 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x47, 0x3D, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x9B, 0x71, 0x37, 0x33, 0x33, 0x32, 0x43, 0x03, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xF0, 0xC7, 0x31, 0xC3, 0x0C, 0x33, 0x0D, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xC7, 0x31, 0xC3, 0x4C, 0xD3, 0x07, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xF0, 0xC7, 0x31, 0xC3, 0x4C, 0xF3, 0xC7, 0x00, 0x03, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xDF, 0x31, 0xC3, 0x4C, 0xD3, 0x0F, 0x30, 0xC0, 0x00, 0x05,
0x04, 0x00, 0x00, 0x33, 0x1F, 0x07, 0x03, 0x03, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xC0, 0xC7, 0x10, 0x3C, 0x04, 0xF3, 0x03, 0x00, 0x00, 0x00, 0x00,
0x04, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x1C, 0x74, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x70, 0xDC, 0x30, 0xC3, 0x4C, 0xD3, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x30, 0xCC, 0x30, 0xD3, 0xDC, 0xC2, 0x02, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x47, 0x33, 0x32, 0x33, 0x73, 0x37, 0xCD, 0x01, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x30, 0xCD, 0x32, 0x7D, 0x8C, 0x73, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x30, 0xCC, 0x30, 0xC7, 0x74, 0x43, 0x07, 0x0C, 0x1F, 0x00, 0x00,
0x05, 0x00, 0x00, 0xF0, 0x4F, 0x2C, 0x2C, 0x2C, 0xF1, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x04, 0x38, 0x0C, 0x0C, 0x03, 0x0C, 0x0C, 0x38, 0x00, 0x00, 0x00,
0x02, 0x32, 0x33, 0x33, 0x13, 0x00,
0x04, 0x0B, 0x0C, 0x0C, 0x30, 0x0C, 0x0C, 0x0B, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x1D, 0x72, 0x37, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x07, 0x00, 0x1F, 0x00, 0x7F, 0x00, 0xFF, 0x01, 0xFF, 0x07, 0xFF, 0x1F, 0xFF, 0x7F, 0xFF, 0x1B, 0xBF, 0x01, 0x1B, 0x00,
0x0C, 0x00, 0x40, 0xFF, 0x00, 0x00, 0xF8, 0xF0, 0x3F, 0xEE, 0x2C, 0x30, 0xCB, 0x0B, 0x30, 0x42, 0xC3, 0x33, 0x00, 0x03, 0x30, 0x00, 0xF3, 0x33, 0x00, 0x03, 0x30, 0x00, 0xFF, 0x3F, 0x00,
0x0C, 0xC2, 0x00, 0x00, 0xCB, 0x00, 0x00, 0xEE, 0xC0, 0xFF, 0xF8, 0xB0, 0xC0, 0xFF, 0x2C, 0xC0, 0x00, 0x0C, 0xCF, 0x00, 0x0C, 0xC0, 0x00, 0xCC, 0xCF, 0x00, 0x0C, 0xC0, 0x00, 0xFC, 0xFF,
0x0A, 0x00, 0x00, 0x0D, 0x00, 0x70, 0x00, 0x00, 0xF3, 0xFF, 0xD3, 0x03, 0xE0, 0x3C, 0x3F, 0x38, 0x03, 0xD0, 0x33, 0xFF, 0x38, 0x03, 0xE0, 0xF0, 0xFF, 0x03,
0x0C, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x8B, 0xF7, 0x0C, 0x13, 0x9F, 0x3B, 0x37, 0x00, 0xC0, 0x23, 0xFF, 0xFF, 0x8B, 0x03, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0xD0, 0x7F, 0x80, 0x03, 0x2C, 0x0D, 0x00, 0x37, 0x00, 0xC0, 0xF3, 0xFF, 0x3C, 0xFF, 0xCF, 0x03, 0x00, 0xDC, 0x00, 0x70, 0x38, 0xC0, 0x02, 0xFD, 0x07,
0x0A, 0x00, 0x00, 0x00, 0xFC, 0x03, 0xF0, 0xFF, 0xC0, 0xFF, 0x3F, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F, 0xFC, 0xFF, 0x03, 0xFF, 0x0F, 0xC0, 0x3F, 0x00, 0x00, 0x00,
0x0A, 0xFF, 0xFF, 0x3F, 0x00, 0xC0, 0x03, 0x00, 0x3C, 0xF0, 0xC0, 0xC3, 0x3A, 0x3C, 0x0B, 0xCE, 0x2B, 0x80, 0x7E, 0x00, 0xD0, 0x03, 0x00, 0xFC, 0xFF, 0xFF,
0x0A, 0x00, 0x00, 0xC0, 0xFF, 0x3F, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F, 0xFC, 0xFF, 0x03, 0x00, 0x00,
0x0A, 0xD0, 0x7F, 0x80, 0x03, 0x2C, 0x0D, 0x0F, 0x37, 0xF0, 0xC0, 0xF3, 0xFF, 0x3C, 0xFF, 0xCF, 0x03, 0x0F, 0xDC, 0xF0, 0x70, 0x38, 0xC0, 0x02, 0xFD, 0x07,
0x0A, 0x40, 0x1F, 0x00, 0xAD, 0x07, 0xB0, 0xC5, 0x00, 0x17, 0x0C, 0x70, 0xD0, 0x00, 0x0C, 0x03, 0xBC, 0xEF, 0xB3, 0x11, 0xE0, 0x07, 0x05, 0x3C, 0x52, 0xC8,
0x0A, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x3F, 0x00, 0xFC, 0x03, 0xC0, 0x3F, 0x00, 0xF0, 0x00, 0xC0, 0x30, 0xC0, 0xFF, 0x3F, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F,
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0xFC, 0xFF, 0x0F, 0xFC, 0xFF, 0x3F, 0xFC, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0xB8, 0xE0, 0x2F, 0xFF, 0xE3, 0x2F, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0xD0, 0x7F, 0x80, 0xFF, 0x2F, 0xFD, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0x7F, 0xF8, 0xFF, 0x02, 0xFD, 0x07,
0x0A, 0x40, 0x01, 0x00, 0x02, 0x00, 0xC8, 0x07, 0x10, 0xC3, 0x00, 0x31, 0x0D, 0x00, 0xFD, 0x01, 0x00, 0x74, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0xF0, 0xF0, 0x00, 0x0F, 0x0F, 0xF0, 0xF0, 0x00, 0x0F, 0x0F, 0xF0, 0xF0, 0x00, 0x0F, 0x0F, 0xF0, 0xF0, 0x00, 0x00, 0x00,
0x0A, 0x40, 0x05, 0x80, 0xFF, 0x8B, 0x1E, 0xD0, 0x2E, 0x00, 0xF0, 0x00, 0xE0, 0xFF, 0x0B, 0x00, 0x0F, 0x00, 0xB8, 0x03, 0xB0, 0xE2, 0xFF, 0x02, 0x50, 0x01,
0x08, 0xFF, 0x07, 0x03, 0x1E, 0x03, 0x73, 0x03, 0xEF, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0xFF, 0xFF,
0x0B, 0x00, 0x00, 0x00, 0xE4, 0x2F, 0xE0, 0x1B, 0x0C, 0x1D, 0x00, 0xFF, 0x03, 0xBE, 0xF0, 0xC1, 0x01, 0xAD, 0x34, 0xC0, 0x36, 0x0B, 0x30, 0xDC, 0xE4, 0x07, 0xFD, 0x1B, 0x00,
0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA8, 0x02, 0xA0, 0xAA, 0x00, 0xA8, 0xC2, 0x0F, 0x2A, 0xFF, 0x03, 0xCA, 0x3F, 0x80, 0xFC, 0x0F, 0x20, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x0C, 0x00, 0xC0, 0x01, 0x00, 0xC0, 0x07, 0xAA, 0xEA, 0x1F, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xAA, 0xEA, 0x1F, 0x00, 0xC0, 0x07, 0x00, 0xC0, 0x01, 0x00, 0x00, 0x00,
0x0C, 0x40, 0x03, 0x00, 0xD0, 0x03, 0x00, 0xF4, 0xAB, 0xAA, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF4, 0xAB, 0xAA, 0xD0, 0x03, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00,
0x09, 0xFE, 0xFF, 0xE3, 0xFF, 0x0F, 0xAA, 0x3E, 0x0A, 0xF8, 0x2E, 0xE0, 0xBF, 0x80, 0xFF, 0xAA, 0xFE, 0xFF, 0xE2, 0xFF, 0x02, 0x02, 0x00, 0x00,
0x09, 0x00, 0x80, 0x04, 0xD0, 0xE2, 0xFF, 0x02, 0x00, 0x00, 0xFF, 0x6F, 0x00, 0x40, 0xE6, 0xAF, 0x50, 0x00, 0x09, 0x00, 0x20, 0x00, 0x64, 0x00,
0x09, 0xE0, 0x3F, 0x70, 0x60, 0x63, 0xC0, 0xE4, 0x80, 0xC2, 0x03, 0x07, 0x0F, 0x1E, 0x6C, 0xFF, 0x27, 0xFF, 0x3F, 0xE0, 0x2F, 0x00, 0x00, 0x00,
0x09, 0x44, 0x44, 0x00, 0x12, 0x41, 0x88, 0x04, 0x21, 0x21, 0x84, 0x48, 0x20, 0x23, 0xC2, 0xCC, 0x08, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x1D, 0x00, 0x1D, 0x00, 0x78, 0x00, 0xB4, 0x07, 0xF0, 0x2F, 0xC0, 0xFB, 0x00, 0xBE, 0x02, 0xF4, 0x07, 0xFD, 0xFF, 0x01, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, 0x00, 0x19, 0x00, 0xA8, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0xF0, 0xDC, 0xCB, 0x03, 0x00, 0xFF, 0xFF, 0x4F, 0x07, 0x40, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x0F, 0xFF, 0x3F, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0xFF, 0xFF, 0x3F, 0x00, 0xC0, 0x07, 0x00, 0xBD, 0x02, 0xE8, 0xB3, 0xE0, 0x3C, 0xAC, 0xC3, 0x03, 0x0F, 0x3C, 0x00, 0xC0, 0x03, 0x00, 0xFC, 0xFF, 0xFF,
0x0B, 0xC0, 0xC8, 0xC0, 0x91, 0x1B, 0xCD, 0x36, 0xE7, 0x00, 0x47, 0x03, 0xA7, 0x80, 0x36, 0xFD, 0xFF, 0xC1, 0x9B, 0xF9, 0xB8, 0xB8, 0xB8, 0xB7, 0x99, 0xF7, 0xFF, 0xFF, 0x0F,
0x0B, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xF0, 0x03, 0x00, 0xFC, 0x00, 0xC0, 0xFF, 0x00, 0xF0, 0x3F, 0x00, 0xFF, 0x3F, 0xF0, 0xFF, 0x3F, 0xFC, 0xFF, 0xCF, 0xFF, 0xFF, 0x0F,
0x08, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x1F, 0xCB, 0x30, 0xC3, 0x3F, 0xC7, 0x00, 0x7E, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0xFC, 0xFF, 0xC3, 0xFF, 0x3F, 0x0C, 0x00, 0xC3, 0xFC, 0x33, 0x0C, 0x24, 0xC3, 0xC0, 0x31, 0x0C, 0x06, 0xC3, 0x30, 0x30, 0x0C, 0x00, 0xC3, 0xFF, 0x3F,
0x0A, 0xFF, 0x3F, 0x30, 0x00, 0x03, 0xC3, 0x30, 0x30, 0x3F, 0xFF, 0xFF, 0x3F, 0x3C, 0x00, 0xFF, 0xFF, 0xFF, 0x0C, 0x0C, 0xC3, 0xC0, 0x00, 0x0C, 0xFC, 0xFF,
0x0A, 0x00, 0x00, 0xC0, 0xFF, 0x00, 0xFC, 0x0F, 0xC0, 0xFF, 0x00, 0xFC, 0x0F, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x3C, 0x00, 0xC0, 0x03, 0xF0, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x00,
0x09, 0xE0, 0x2F, 0xF0, 0xFF, 0xE3, 0xB8, 0xEC, 0x9B, 0xF9, 0xBF, 0xF8, 0xBF, 0x99, 0xEF, 0xB8, 0x2C, 0xFF, 0x3F, 0xE0, 0x2F, 0x00, 0x00, 0x00,
0x04, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x03, 0x87, 0x87, 0xC3, 0x30, 0x0C, 0xE3, 0xDE, 0x01,
0x03, 0x74, 0xBB, 0x0C, 0xC3, 0x30, 0x2C, 0x2D, 0x0D,
0x05, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0F,
0x05, 0x00, 0x00, 0xD0, 0xC7, 0x34, 0xC3, 0x0C, 0x73, 0x4C, 0x1F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x39, 0xC0, 0x00, 0x43, 0x2F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0x87, 0x30, 0x60, 0x60, 0x60, 0xC0, 0x3F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0x87, 0x30, 0xB8, 0x00, 0x23, 0x4C, 0x1F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x0E, 0x36, 0xC6, 0xFC, 0x03, 0x0C, 0x30, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xF0, 0xCB, 0x00, 0x7F, 0x40, 0x13, 0x8C, 0x1F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xCB, 0x10, 0x2F, 0x4C, 0x33, 0x4C, 0x1F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xF0, 0x0F, 0x30, 0x60, 0x60, 0xC0, 0x00, 0x03, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xC7, 0x30, 0x7D, 0x4C, 0x33, 0x4C, 0x1F, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0xD0, 0xC7, 0x30, 0xC6, 0xE0, 0x03, 0x8C, 0x1F, 0x00, 0x00, 0x00,
0x04, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x03, 0xC0, 0xF0, 0x3C, 0xCF, 0xF3, 0x3C, 0x03, 0x00,
0x03, 0x00, 0xCC, 0xF3, 0x3C, 0xCF, 0xF3, 0x30, 0x00,
0x05, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x03, 0x30, 0xC0, 0x0F, 0x30, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0xD0, 0x7F, 0x40, 0xFF, 0x1F, 0xFC, 0xFF, 0x43, 0xFF, 0x1F, 0x40, 0x15, 0x00, 0x00, 0x00,
0x0A, 0xE4, 0x06, 0x90, 0x91, 0x01, 0x06, 0x24, 0x30, 0x90, 0x1B, 0x46, 0x6E, 0x96, 0xB9, 0x91, 0xE4, 0x06, 0x0C, 0x18, 0x90, 0x40, 0x46, 0x06, 0x90, 0x1B,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3F, 0x02, 0xC2, 0xAB, 0xAA, 0x3E, 0x20, 0xE0, 0xAB, 0xAA, 0x3E, 0x02, 0xC2, 0xFF, 0xFF, 0x0F, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x08, 0x02, 0xC0, 0x30, 0x00, 0x0C, 0x03, 0xF0, 0xFF, 0x00, 0xFE, 0x0B, 0xD0, 0x7F, 0x00, 0xA4, 0x01, 0x00, 0x0A, 0x00, 0xA0, 0x00,
0x0A, 0x00, 0x80, 0x00, 0x81, 0x24, 0x10, 0x85, 0x00, 0x20, 0x66, 0x40, 0x15, 0x45, 0x62, 0x90, 0x4D, 0xD0, 0xF1, 0x23, 0x01, 0xFD, 0x41, 0x41, 0x07, 0x00,
0x0A, 0x00, 0x05, 0x00, 0xA0, 0x00, 0x40, 0x1F, 0x00, 0xF8, 0x02, 0xD0, 0x7F, 0x00, 0xFE, 0x0B, 0xF0, 0xEF, 0x00, 0xFF, 0x0D, 0xD0, 0x77, 0x00, 0xF4, 0x01,
0x0A, 0x00, 0x20, 0x00, 0x00, 0x3C, 0x00, 0xD4, 0x01, 0xD0, 0x06, 0x40, 0x7F, 0x00, 0xFD, 0x01, 0xF4, 0x07, 0xD0, 0x1F, 0x00, 0x7F, 0x00, 0xD0, 0x01, 0x00,
0x0A, 0x40, 0x15, 0x00, 0xFE, 0x0B, 0x88, 0x2F, 0x52, 0xF0, 0x50, 0x01, 0x0A, 0xD4, 0xAF, 0x7F, 0xFD, 0xF5, 0xC7, 0x0B, 0x3E, 0x70, 0xD0, 0x00, 0xA8, 0x02,
0x0A, 0x80, 0x2F, 0x80, 0x5F, 0x2F, 0x0C, 0x00, 0xC3, 0x00, 0x30, 0x0C, 0x00, 0xC3, 0x01, 0x34, 0x34, 0xC0, 0x01, 0x07, 0x0D, 0xD0, 0x75, 0x00, 0xF4, 0x01,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xF4, 0x01, 0xC0, 0x3F, 0x00, 0xF0, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xE0, 0xEF, 0x00, 0xBB, 0x0B, 0xA0, 0xAA, 0x00, 0xAA, 0x0A, 0x80, 0x19, 0x00, 0x64, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0x2D, 0x80, 0xE7, 0x0B, 0xBE, 0xF8, 0xFA, 0x02, 0xFE, 0x0B, 0x80, 0x2F, 0x00, 0x50, 0x00,
0x0A, 0x00, 0x05, 0x00, 0xF8, 0x02, 0xE0, 0xBF, 0x80, 0xAF, 0x2F, 0xBE, 0xE0, 0xDB, 0x02, 0x78, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x05, 0x00, 0xA0, 0x00, 0x40, 0x1F, 0x50, 0xFE, 0x5B, 0xFD, 0xFF, 0x47, 0xFF, 0x1F, 0xE0, 0xBF, 0x00, 0xFE, 0x0B, 0xF0, 0xF5, 0x40, 0x01, 0x14,
0x0A, 0x40, 0x1A, 0x00, 0x09, 0x06, 0x20, 0x80, 0x00, 0x02, 0x08, 0xFC, 0xFF, 0xC3, 0x00, 0x30, 0x0C, 0x00, 0xC3, 0x00, 0x30, 0x0C, 0x00, 0xC3, 0xFF, 0x3F,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x0A, 0xF0, 0xFF, 0x00, 0xAA, 0x0A, 0xF0, 0xFF, 0x00, 0x00, 0x00,
0x09, 0xE0, 0x2F, 0xF0, 0xFF, 0xE3, 0xFF, 0xED, 0xFF, 0xE1, 0xDF, 0xE1, 0x2F, 0xE1, 0xEF, 0xE2, 0x2F, 0xEF, 0x3F, 0xE0, 0x2F, 0x00, 0x00, 0x00,
0x0A, 0xC0, 0x31, 0x00, 0x30, 0x01, 0x40, 0x34, 0x00, 0xCC, 0x00, 0x00, 0x0A, 0x00, 0xF8, 0x02, 0xE0, 0xBF, 0x80, 0xFF, 0x2F, 0xFE, 0xFF, 0xFB, 0xFF, 0xFF,
0x0A, 0x00, 0x00, 0x80, 0xFF, 0x2F, 0xFC, 0xFF, 0xC3, 0x07, 0x3D, 0x3C, 0xC0, 0xC3, 0x03, 0x3C, 0x7C, 0xD0, 0xC3, 0xFF, 0x3F, 0xF8, 0xFF, 0x02, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0xC0, 0xF3, 0x3C, 0x3C, 0xCF, 0x03, 0x00, 0x00,
0x0A, 0xB9, 0x91, 0xE3, 0x46, 0x2E, 0x1B, 0xB9, 0x61, 0xE4, 0x06, 0x91, 0x1B, 0x41, 0x6E, 0x24, 0xB9, 0x91, 0xE3, 0x46, 0x2E, 0x1B, 0xB9, 0x01, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x0C, 0xC0, 0x23, 0x00, 0x80, 0x08, 0x00, 0x20, 0x0F, 0xC0, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0xE0, 0x2F, 0xC0, 0x01, 0x0D, 0x06, 0x40, 0x32, 0x00, 0x30, 0x03, 0x00, 0x33, 0x00, 0x30, 0x06, 0x40, 0xC2, 0x01, 0x0D, 0xE0, 0x2F, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x23, 0x80, 0x32, 0x0A, 0x0D, 0xC3, 0xD1, 0x10, 0x1C, 0x0D, 0xC0, 0x81, 0x02, 0x0A, 0xE0, 0x2F, 0x00, 0x54, 0x00,
0x0A, 0x00, 0x00, 0x00, 0xFC, 0x03, 0xB0, 0xE0, 0x00, 0x03, 0x0C, 0x30, 0xC0, 0x00, 0x0B, 0x0E, 0xC0, 0x3F, 0x00, 0xAC, 0x03, 0xC0, 0x3A, 0x00, 0xAC, 0x03,
0x05, 0x6F, 0xBC, 0xF1, 0xC6, 0x1B, 0x6F, 0xBC, 0xF1, 0xC6, 0x1B, 0x6F, 0x00, 0x00,
0x08, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0xE4, 0x6F, 0x00, 0x00,
0x09, 0x00, 0xE4, 0x03, 0x90, 0x0F, 0x40, 0x3E, 0x00, 0xF9, 0x00, 0xE4, 0x03, 0x90, 0x0F, 0x40, 0x3E, 0x00, 0xF9, 0x00, 0xE4, 0x03, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0xFF, 0x03, 0xF0, 0x3F, 0x00, 0xFF, 0x03, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x08, 0x82, 0xE0, 0xBA, 0x2E, 0x08, 0x82, 0x80, 0x20, 0x08, 0xAE, 0xEB, 0x82, 0x20, 0x08, 0x08, 0x82, 0xE0, 0xBA, 0x2E, 0x08, 0x82, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x30, 0x00, 0x00, 0x03, 0x30, 0xFC, 0x00, 0x43, 0x07, 0xFC, 0x20, 0x40, 0x07, 0x30, 0x20, 0x00, 0x03, 0x00, 0xFC, 0x00, 0x40, 0x07, 0x00, 0x20,
0x0A, 0x00, 0x43, 0xC0, 0x20, 0x1D, 0x20, 0x61, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x84, 0x01, 0x24, 0xB4, 0xF1, 0x01, 0xFE, 0x0F, 0xD0, 0x0F, 0x00, 0xFC,
0x0A, 0x00, 0x00, 0x00, 0x54, 0x00, 0x90, 0x1A, 0x40, 0xFE, 0x06, 0xE4, 0x6F, 0x40, 0xFE, 0x06, 0x90, 0x1A, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x88, 0x88, 0x88, 0x55, 0x55, 0x55, 0xFF, 0x00, 0x54, 0x55, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x64, 0x00, 0xA5, 0x6B, 0x01, 0x64, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0xC0, 0x00, 0x00, 0xFF, 0x86, 0xC0, 0x00, 0x2C, 0x40, 0xFE, 0x0B, 0xE4, 0xBF, 0x0C, 0xC0, 0xF2, 0x6F, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x05, 0x00, 0xF4, 0x01, 0xC0, 0x30, 0x00, 0x0D, 0x07, 0xF0, 0xF0, 0x40, 0x5F, 0x1F, 0xFC, 0xFA, 0xD3, 0xFF, 0x7F, 0xFF, 0xF0, 0xDF, 0xFF, 0x7F,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x05, 0x74, 0x30, 0xC3, 0x0D, 0x33, 0xDC, 0x30, 0x93, 0xD9, 0xC0, 0x89, 0xD1, 0x01,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
0x06, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07,
};
short font_ptrs[] = {
0x0000, 0x000E, 0x001C, 0x002A, 0x0038, 0x0046, 0x0054, 0x0062,
0x0070, 0x007E, 0x008C, 0x009A, 0x00A8, 0x00B6, 0x00C4, 0x00D2,
0x00E0, 0x00EE, 0x00FC, 0x010A, 0x0118, 0x0126, 0x0134, 0x0142,
0x0150, 0x015E, 0x016C, 0x017A, 0x0188, 0x0196, 0x01A4, 0x01B2,
0x01C0, 0x01CE, 0x01D7, 0x01E5, 0x01F5, 0x0205, 0x0218, 0x0228,
0x0231, 0x023C, 0x0247, 0x0257, 0x0267, 0x0272, 0x0280, 0x0289,
0x0299, 0x02A9, 0x02B7, 0x02C7, 0x02D7, 0x02E7, 0x02F7, 0x0307,
0x0317, 0x0327, 0x0337, 0x0340, 0x034B, 0x035B, 0x036B, 0x037B,
0x038B, 0x03A0, 0x03B0, 0x03C0, 0x03D0, 0x03E0, 0x03F0, 0x0400,
0x0410, 0x0420, 0x042B, 0x043B, 0x044E, 0x045E, 0x0473, 0x0486,
0x0499, 0x04A9, 0x04BC, 0x04CC, 0x04DC, 0x04EC, 0x04FF, 0x050F,
0x0524, 0x0537, 0x0547, 0x055A, 0x0565, 0x0573, 0x057E, 0x0589,
0x0599, 0x05A2, 0x05B0, 0x05BE, 0x05CC, 0x05DA, 0x05E8, 0x05F3,
0x0601, 0x060F, 0x061A, 0x0625, 0x0633, 0x063E, 0x064E, 0x065C,
0x066A, 0x0678, 0x0686, 0x0691, 0x069F, 0x06AA, 0x06B8, 0x06C6,
0x06D6, 0x06E4, 0x06F2, 0x0700, 0x070B, 0x0711, 0x071C, 0x072C,
0x0737, 0x074C, 0x076B, 0x078A, 0x07A4, 0x07C3, 0x07DD, 0x07F7,
0x0811, 0x082B, 0x0845, 0x085F, 0x0879, 0x0898, 0x08A8, 0x08C2,
0x08DC, 0x08F6, 0x0910, 0x0925, 0x0942, 0x095F, 0x097E, 0x099D,
0x09B5, 0x09CD, 0x09E5, 0x09FD, 0x0A15, 0x0A2D, 0x0A45, 0x0A5D,
0x0A75, 0x0A8D, 0x0AA5, 0x0ABF, 0x0ADC, 0x0AF9, 0x0B0E, 0x0B28,
0x0B42, 0x0B5C, 0x0B76, 0x0B8E, 0x0B99, 0x0BA2, 0x0BAB, 0x0BB9,
0x0BC7, 0x0BD5, 0x0BE3, 0x0BF1, 0x0BFF, 0x0C0D, 0x0C1B, 0x0C29,
0x0C37, 0x0C45, 0x0C50, 0x0C59, 0x0C62, 0x0C70, 0x0C80, 0x0C90,
0x0CAA, 0x0CC4, 0x0CDE, 0x0CF8, 0x0D12, 0x0D2C, 0x0D46, 0x0D60,
0x0D7A, 0x0D94, 0x0DAE, 0x0DC8, 0x0DE2, 0x0DFC, 0x0E16, 0x0E30,
0x0E48, 0x0E62, 0x0E7C, 0x0E96, 0x0EB0, 0x0ECA, 0x0EE4, 0x0EFE,
0x0F18, 0x0F26, 0x0F3B, 0x0F53, 0x0F6D, 0x0F87, 0x0FA1, 0x0FBB,
0x0FD5, 0x0FF2, 0x100C, 0x1026, 0x1040, 0x1050, 0x1060, 0x1070,
0x1080, 0x1090, 0x10A0, 0x10B0, 0x10BE, 0x10CE, 0x10DE, 0x10EE,
0x10FE, 0x110E, 0x111E, 0x112E, 0x113E, 0x114E, 0x115E, 0x116E,
0x117E, 0x118E, 0x119E, 0x11AE, 0x11BE, 0x11CE, 0x11DE, 0x11EE,
};
#endif
#endif

View File

@@ -1,358 +0,0 @@
/**
* Powder Toy - graphics (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <SDL/SDL.h>
#include "defines.h"
#ifdef PIX16
#define PIXELSIZE 2
#define PIXPACK(x) ((((x)>>8)&0xF800)|(((x)>>5)&0x07E0)|(((x)>>3)&0x001F))
#define PIXRGB(r,g,b) ((((r)<<8)&0xF800)|(((g)<<3)&0x07E0)|(((b)>>3)&0x001F))
#define PIXR(x) (((x)>>8)&0xF8)
#define PIXG(x) (((x)>>3)&0xFC)
#define PIXB(x) (((x)<<3)&0xF8)
#else
#define PIXELSIZE 4
#ifdef PIX32BGR
#define PIXPACK(x) ((((x)>>16)&0x0000FF)|((x)&0x00FF00)|(((x)<<16)&0xFF0000))
#define PIXRGB(r,g,b) (((b)<<16)|((g)<<8)|((r)))// (((b)<<16)|((g)<<8)|(r))
#define PIXR(x) ((x)&0xFF)
#define PIXG(x) (((x)>>8)&0xFF)
#define PIXB(x) ((x)>>16)
#else
#ifdef PIX32BGRA
#define PIXPACK(x) ((((x)>>8)&0x0000FF00)|(((x)<<8)&0x00FF0000)|(((x)<<24)&0xFF000000))
#define PIXRGB(r,g,b) (((b)<<24)|((g)<<16)|((r)<<8))
#define PIXR(x) (((x)>>8)&0xFF)
#define PIXG(x) (((x)>>16)&0xFF)
#define PIXB(x) (((x)>>24))
#elif defined(PIX32OGL)
#define PIXPACK(x) (0xFF000000|((x)&0xFFFFFF))
#define PIXRGB(r,g,b) (0xFF000000|((r)<<16)|((g)<<8)|((b)))// (((b)<<16)|((g)<<8)|(r))
#define PIXRGBA(r,g,b,a) (((a)<<24)|((r)<<16)|((g)<<8)|((b)))// (((b)<<16)|((g)<<8)|(r))
#define PIXA(x) (((x)>>24)&0xFF)
#define PIXR(x) (((x)>>16)&0xFF)
#define PIXG(x) (((x)>>8)&0xFF)
#define PIXB(x) ((x)&0xFF)
#else
#define PIXPACK(x) (x)
#define PIXRGB(r,g,b) (((r)<<16)|((g)<<8)|(b))
#define PIXR(x) ((x)>>16)
#define PIXG(x) (((x)>>8)&0xFF)
#define PIXB(x) ((x)&0xFF)
#endif
#endif
#endif
extern int emp_decor;
extern unsigned int *render_modes;
extern unsigned int render_mode;
extern unsigned int colour_mode;
extern unsigned int *display_modes;
extern unsigned int display_mode;
extern SDL_Surface *sdl_scrn;
extern int sdl_scale;
extern int sandcolour_r;
extern int sandcolour_g;
extern int sandcolour_b;
extern int sandcolour_frame;
extern unsigned char fire_r[YRES/CELL][XRES/CELL];
extern unsigned char fire_g[YRES/CELL][XRES/CELL];
extern unsigned char fire_b[YRES/CELL][XRES/CELL];
extern unsigned int fire_alpha[CELL*3][CELL*3];
extern pixel *pers_bg;
extern char * flm_data;
extern int flm_data_points;
extern pixel flm_data_colours[];
extern float flm_data_pos[];
extern char * plasma_data;
extern int plasma_data_points;
extern pixel plasma_data_colours[];
extern float plasma_data_pos[];
struct gcache_item
{
int isready;
int pixel_mode;
int cola, colr, colg, colb;
int firea, firer, fireg, fireb;
};
typedef struct gcache_item gcache_item;
gcache_item *graphicscache;
void prepare_graphicscache();
char * generate_gradient(pixel * colours, float * points, int pointcount, int size);
void draw_other(pixel *vid);
void draw_rgba_image(pixel *vid, unsigned char *data, int x, int y, float a);
void *ptif_pack(pixel *src, int w, int h, int *result_size);
pixel *ptif_unpack(void *datain, int size, int *w, int *h);
pixel *resample_img_nn(pixel *src, int sw, int sh, int rw, int rh);
pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh);
pixel *rescale_img(pixel *src, int sw, int sh, int *qw, int *qh, int f);
void render_gravlensing(pixel *src, pixel * dst);
void sdl_blit_1(int x, int y, int w, int h, pixel *src, int pitch);
void sdl_blit_2(int x, int y, int w, int h, pixel *src, int pitch);
void sdl_blit(int x, int y, int w, int h, pixel *src, int pitch);
void drawblob(pixel *vid, int x, int y, unsigned char cr, unsigned char cg, unsigned char cb);
void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswall);
int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc);
void draw_menu(pixel *vid_buf, int i, int hover);
void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
int addchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a);
int drawtext_outline(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a, int or, int og, int ob, int oa);
int drawtextwrap(pixel *vid, int x, int y, int w, const char *s, int r, int g, int b, int a);
void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);
void fillrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);
void clearrect(pixel *vid, int x, int y, int w, int h);
void drawdots(pixel *vid, int x, int y, int h, int r, int g, int b, int a);
int textwidth(char *s);
int drawtextmax(pixel *vid, int x, int y, int w, char *s, int r, int g, int b, int a);
int textnwidth(char *s, int n);
void textnpos(char *s, int n, int w, int *cx, int *cy);
int textwidthx(char *s, int w);
int textposxy(char *s, int width, int w, int h);
int textwrapheight(char *s, int width);
void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
void draw_icon(pixel *vid_buf, int x, int y, char ch, int flag);
void draw_air(pixel *vid);
void draw_grav_zones(pixel *vid);
void draw_grav(pixel *vid);
void draw_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
void addpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
void xor_pixel(int x, int y, pixel *vid);
void xor_line(int x1, int y1, int x2, int y2, pixel *vid);
void xor_rect(pixel *vid, int x, int y, int w, int h);
void blend_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
void render_parts(pixel *vid);
void render_before(pixel *part_vbuf);
void render_after(pixel *part_vbuf, pixel *vid_buf);
#ifdef OGLR
void draw_parts_fbo();
#endif
void draw_parts(pixel *vid);
void draw_walls(pixel *vid);
void create_decorations(int x, int y, int rx, int ry, int r, int g, int b, int click, int tool);
void create_decoration(int x, int y, int r, int g, int b, int click, int tool);
void line_decorations(int x1, int y1, int x2, int y2, int rx, int ry, int r, int g, int b, int click, int tool);
void box_decorations(int x1, int y1, int x2, int y2, int r, int g, int b, int click, int tool);
void draw_color_menu(pixel *vid_buf, int i, int hover);
void draw_wavelengths(pixel *vid, int x, int y, int h, int wl);
void render_signs(pixel *vid_buf);
void render_fire(pixel *dst);
void prepare_alpha(int size, float intensity);
void draw_image(pixel *vid, pixel *img, int x, int y, int w, int h, int a);
void dim_copy(pixel *dst, pixel *src);
void dim_copy_pers(pixel *dst, pixel *src);
void render_zoom(pixel *img);
int render_thumb(void *thumb, int size, int bzip2, pixel *vid_buf, int px, int py, int scl);
void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry);
int sdl_open(void);
int draw_debug_info(pixel* vid, int lm, int lx, int ly, int cx, int cy, int line_x, int line_y);
void init_display_modes();
void update_display_modes();
#ifdef OGLR
void clearScreen(float alpha);
void ogl_blit(int x, int y, int w, int h, pixel *src, int pitch, int scale);
#endif
#endif
#ifdef INCLUDE_SHADERS
#ifndef SHADERS_H
#define SHADERS_H
const char * fireFragment = "#version 120\n\
uniform sampler2D fireAlpha;\
void main () {\
vec4 texColor = texture2D(fireAlpha, gl_PointCoord);\
gl_FragColor = vec4(gl_Color.rgb, texColor.a*gl_Color.a);\
}";
const char * fireVertex = "#version 120\n\
void main(void)\
{\
gl_Position = ftransform();;\
gl_FrontColor = gl_Color;\
}";
const char * lensFragment = "#version 120\n\
uniform sampler2D pTex;\
uniform sampler2D tfX;\
uniform sampler2D tfY;\
uniform float xres;\
uniform float yres;\
void main () {\
vec4 transformX = texture2D(tfX, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t));\
vec4 transformY = texture2D(tfY, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t));\
transformX.r /= xres/4.0;\
transformY.g /= yres/4.0;\
vec4 texColor1 = vec4(\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.90, transformY.g*0.90)).r,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.80, transformY.g*0.80)).g,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.70, transformY.g*0.70)).b,\
1.0\
);\
vec4 texColor2 = vec4(\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.95, transformY.g*0.95)).r,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.85, transformY.g*0.85)).g,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.75, transformY.g*0.75)).b,\
1.0\
);\
vec4 texColor3 = vec4(\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.85, transformY.g*0.85)).r,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.75, transformY.g*0.75)).g,\
texture2D(pTex, gl_TexCoord[0].st-vec2(transformX.r*0.65, transformY.g*0.65)).b,\
1.0\
);\
vec4 texColor = texColor1*0.6 + texColor2*0.2 + texColor3*0.2;\
gl_FragColor = texColor;\
}";
const char * lensVertex = "#version 120\n\
void main(void)\
{\
gl_TexCoord[0] = gl_MultiTexCoord0;\
gl_Position = ftransform();;\
gl_FrontColor = gl_Color;\
}";
const char * airVFragment = "#version 120\n\
uniform sampler2D airX;\
uniform sampler2D airY;\
uniform sampler2D airP;\
void main () {\
vec4 texX = texture2D(airX, gl_TexCoord[0].st);\
vec4 texY = texture2D(airY, gl_TexCoord[0].st);\
vec4 texP = texture2D(airP, gl_TexCoord[0].st);\
gl_FragColor = vec4(abs(texX.r)/2.0, texP.b/2.0, abs(texY.g)/2.0, 1.0);\
}";
const char * airVVertex = "#version 120\n\
void main(void)\
{\
gl_TexCoord[0] = gl_MultiTexCoord0;\
gl_Position = ftransform();;\
gl_FrontColor = gl_Color;\
}";
const char * airPFragment = "#version 120\n\
uniform sampler2D airX;\
uniform sampler2D airY;\
uniform sampler2D airP;\
void main () {\
vec4 texP = texture2D(airP, gl_TexCoord[0].st);\
gl_FragColor = vec4(max(texP.b/2.0, 0), 0, abs(min(texP.b/2.0, 0)), 1.0);\
}";
const char * airPVertex = "#version 120\n\
void main(void)\
{\
gl_TexCoord[0] = gl_MultiTexCoord0;\
gl_Position = ftransform();;\
gl_FrontColor = gl_Color;\
}";
const char * airCFragment = "#version 120\n\
uniform sampler2D airX;\
uniform sampler2D airY;\
uniform sampler2D airP;\
void main () {\
vec4 texX = texture2D(airX, gl_TexCoord[0].st);\
vec4 texY = texture2D(airY, gl_TexCoord[0].st);\
vec4 texP = texture2D(airP, gl_TexCoord[0].st);\
gl_FragColor = vec4(max(texP.b/2.0, 0), 0, abs(min(texP.b/2.0, 0)), 1.0) + vec4(abs(texX.r)/8.0, abs(texX.r)/8.0, abs(texX.r)/8.0, 1.0) + vec4(abs(texY.g)/8.0, abs(texY.g)/8.0, abs(texY.g)/8.0, 1.0);\
}";
const char * airCVertex = "#version 120\n\
void main(void)\
{\
gl_TexCoord[0] = gl_MultiTexCoord0;\
gl_Position = ftransform();;\
gl_FrontColor = gl_Color;\
}";
#endif
#endif

View File

@@ -1,54 +0,0 @@
/**
* Powder Toy - Newtonian gravity (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRAVITY_H
#define GRAVITY_H
#include "defines.h"
extern int ngrav_enable; //Newtonian gravity
extern int gravwl_timeout;
extern int gravityMode;
float *gravmap;//Maps to be used by the main thread
float *gravp;
float *gravy;
float *gravx;
unsigned *gravmask;
float *th_ogravmap;// Maps to be processed by the gravity thread
float *th_gravmap;
float *th_gravx;
float *th_gravy;
float *th_gravp;
void gravity_init();
void gravity_cleanup();
void gravity_update_async();
void start_grav_async();
void stop_grav_async();
void update_grav();
void gravity_mask();
void bilinear_interpolation(float *src, float *dst, int sw, int sh, int rw, int rh);
#ifdef GRAVFFT
void grav_fft_init();
void grav_fft_cleanup();
#endif
#endif

File diff suppressed because one or more lines are too long

View File

@@ -1,40 +0,0 @@
/**
* Powder Toy - HTTP Library (Header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HTTP_H
#define HTTP_H
void http_init(char *proxy);
void http_done(void);
char *http_simple_get(char *uri, int *ret, int *len);
char *http_auth_get(char *uri, char *user, char *pass, char * session_id, int *ret, int *len);
char *http_simple_post(char *uri, char *data, int dlen, int *ret, int *len);
void http_auth_headers(void *ctx, char *user, char *pass, char * session_id);
void *http_async_req_start(void *ctx, char *uri, char *data, int dlen, int keep);
void http_async_add_header(void *ctx, char *name, char *data);
int http_async_req_status(void *ctx);
void http_async_get_length(void *ctx, int *total, int *done);
char *http_async_req_stop(void *ctx, int *ret, int *len);
void http_async_req_close(void *ctx);
char *http_multipart_post(char *uri, char **names, char **parts, int *plens, char *user, char *pass, char * session_id, int *ret, int *len);
char *http_ret_text(int ret);
#endif

File diff suppressed because one or more lines are too long

View File

@@ -1,133 +0,0 @@
/**
* Powder Toy - document icons
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
static unsigned char icon_doc_32_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd, 0xa7, 0x93,
0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13,
0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdb, 0x04,
0x06, 0x11, 0x21, 0x0c, 0xfc, 0x0b, 0x2f, 0xdf, 0x00, 0x00, 0x04, 0x65, 0x49, 0x44, 0x41, 0x54,
0x58, 0xc3, 0xb5, 0x96, 0x7f, 0x4c, 0xd4, 0x65, 0x1c, 0xc7, 0x5f, 0xcf, 0x73, 0xdf, 0xe3, 0x7e,
0x90, 0x8b, 0x98, 0xb8, 0x36, 0x12, 0xb8, 0x38, 0x69, 0x03, 0x4c, 0x64, 0xec, 0x6a, 0xa2, 0xd3,
0xb5, 0x74, 0x78, 0x4c, 0x42, 0x33, 0x51, 0xda, 0x5c, 0xe3, 0x97, 0x72, 0x79, 0xcc, 0x5c, 0xfd,
0x53, 0xcb, 0x50, 0x69, 0x93, 0xda, 0x9a, 0x3a, 0x0d, 0x0d, 0x99, 0xf3, 0x9f, 0x3b, 0x98, 0x89,
0x72, 0x14, 0x64, 0xb2, 0x62, 0x2b, 0x56, 0xad, 0x56, 0x20, 0xbf, 0x06, 0x3a, 0xe1, 0x1c, 0x8b,
0xed, 0x86, 0x89, 0x77, 0x96, 0x7f, 0x30, 0xf6, 0xed, 0x0f, 0xb9, 0x1b, 0xe6, 0x1d, 0x7c, 0x39,
0xe8, 0xb3, 0x3d, 0x7b, 0xbe, 0xcf, 0xb3, 0xef, 0xf3, 0x7c, 0x5f, 0xcf, 0xfb, 0xf3, 0xe3, 0xf9,
0x0a, 0x9e, 0xb4, 0xd5, 0x40, 0x0a, 0x0b, 0x37, 0x3f, 0x30, 0x0a, 0x78, 0x17, 0xb2, 0x48, 0x09,
0x33, 0x97, 0x52, 0x52, 0x52, 0xe2, 0x11, 0x42, 0xa0, 0xaa, 0x2a, 0x42, 0x08, 0x80, 0xd0, 0xb3,
0xaa, 0xaa, 0xa1, 0x17, 0x55, 0x55, 0x45, 0x55, 0x55, 0xcc, 0x66, 0x33, 0x05, 0x05, 0x05, 0x3e,
0xa7, 0xd3, 0x59, 0x73, 0xf3, 0xe6, 0xcd, 0xd6, 0x19, 0x90, 0xa8, 0x01, 0xa4, 0x10, 0x82, 0xce,
0xce, 0x4e, 0x4d, 0x1b, 0x5c, 0xe8, 0xed, 0x61, 0x6f, 0x7a, 0x26, 0x89, 0x89, 0x89, 0x2b, 0xda,
0xdb, 0xdb, 0x3f, 0xcd, 0xcb, 0xcb, 0xd3, 0xdf, 0xba, 0x75, 0xab, 0x59, 0x2b, 0x84, 0x0c, 0x33,
0xa7, 0x9f, 0x7d, 0xca, 0xf9, 0xec, 0xfc, 0xa9, 0xd3, 0x08, 0x21, 0x68, 0x68, 0x68, 0xc0, 0xe7,
0xf3, 0x19, 0x3a, 0x3a, 0x3a, 0x6a, 0xad, 0x56, 0xeb, 0x0e, 0xad, 0x6e, 0x94, 0x91, 0x14, 0xd0,
0xd2, 0x00, 0xba, 0xea, 0xeb, 0x11, 0x42, 0x30, 0x35, 0x35, 0x45, 0x57, 0x57, 0x17, 0x89, 0x89,
0x89, 0x4a, 0x5b, 0x5b, 0x5b, 0xad, 0xc5, 0x62, 0x79, 0x5d, 0x0b, 0x84, 0x24, 0x4a, 0xeb, 0x77,
0x55, 0x86, 0x20, 0x84, 0x10, 0x48, 0x29, 0x19, 0x1e, 0x1e, 0x46, 0x4a, 0x49, 0x52, 0x52, 0x92,
0xd2, 0xda, 0xda, 0x7a, 0x5c, 0x0b, 0x44, 0xd4, 0x00, 0x19, 0xc5, 0x75, 0xa1, 0x8f, 0x03, 0x48,
0x29, 0x19, 0x1f, 0x1f, 0x0f, 0xc1, 0x58, 0x2c, 0x16, 0xa5, 0xb9, 0xb9, 0x79, 0x5e, 0x25, 0xa2,
0x06, 0x98, 0x6d, 0x41, 0x97, 0x04, 0x01, 0x14, 0x45, 0x41, 0x51, 0x14, 0x52, 0x53, 0x53, 0x75,
0x4d, 0x4d, 0x4d, 0xb5, 0xc9, 0xc9, 0xc9, 0x11, 0x21, 0x16, 0x05, 0x30, 0xe0, 0x7e, 0xfb, 0x31,
0x08, 0x9f, 0xcf, 0x47, 0x42, 0x42, 0x02, 0xf1, 0xf1, 0xf1, 0x58, 0xad, 0x56, 0xb2, 0xb3, 0xb3,
0x71, 0x3a, 0x9d, 0x3a, 0x87, 0xc3, 0x71, 0x24, 0x21, 0x21, 0xe1, 0x9d, 0x70, 0x10, 0x32, 0xd2,
0x89, 0xe6, 0x8d, 0x01, 0xb7, 0x83, 0xf4, 0x3d, 0x67, 0x1e, 0x5b, 0xa3, 0xd7, 0xeb, 0x31, 0x9b,
0xcd, 0xc4, 0xc6, 0xc6, 0x32, 0x3d, 0x3d, 0x4d, 0x20, 0x10, 0x60, 0x64, 0x64, 0x84, 0x93, 0x27,
0x4f, 0xc6, 0x66, 0x66, 0x66, 0x96, 0x6a, 0x06, 0x98, 0x2d, 0x6b, 0xb8, 0x76, 0x65, 0x70, 0x90,
0xcc, 0xe2, 0xba, 0xd0, 0x78, 0xc0, 0xed, 0x08, 0xf9, 0x3e, 0x26, 0x26, 0x06, 0xa3, 0xd1, 0x88,
0xc1, 0x60, 0xc0, 0x64, 0x32, 0x61, 0x30, 0x18, 0x1e, 0x15, 0x1c, 0x45, 0x89, 0x05, 0xe2, 0x16,
0xed, 0x82, 0x6a, 0xcf, 0x55, 0x76, 0xa4, 0xa7, 0x87, 0xc6, 0x6f, 0x1c, 0x3b, 0xfa, 0x44, 0x40,
0x06, 0x61, 0xa4, 0x94, 0xe8, 0x74, 0x3a, 0xf4, 0x7a, 0x3d, 0x26, 0x93, 0x09, 0x40, 0xa7, 0xa5,
0x12, 0x22, 0x65, 0x64, 0xae, 0xea, 0x82, 0xc2, 0xc7, 0xc6, 0x97, 0x3e, 0x3c, 0xfc, 0x84, 0x72,
0xb3, 0x4b, 0xb8, 0x94, 0x12, 0x55, 0x55, 0x31, 0x1a, 0x8d, 0x61, 0x0f, 0xac, 0xf0, 0x3f, 0xd8,
0x7f, 0x21, 0x66, 0x5c, 0x00, 0x20, 0x16, 0x1d, 0x03, 0x59, 0x7b, 0x76, 0xa3, 0xb5, 0x52, 0x06,
0x9b, 0x94, 0x32, 0x08, 0xc0, 0xa2, 0xb3, 0xa0, 0xa7, 0xb1, 0x29, 0xf4, 0x5c, 0x7a, 0xea, 0x04,
0xfd, 0x2e, 0x07, 0x73, 0xed, 0x11, 0xec, 0x75, 0x3a, 0x9d, 0xe6, 0xdb, 0x10, 0xad, 0x97, 0x51,
0x43, 0xd5, 0x41, 0x1a, 0xe6, 0x71, 0x45, 0xd0, 0x22, 0x01, 0x44, 0x5d, 0x07, 0xa2, 0xa9, 0x94,
0x0b, 0xaa, 0x84, 0x5a, 0xfd, 0xbb, 0xab, 0xe6, 0x98, 0xa6, 0x5b, 0x33, 0x52, 0x66, 0x45, 0xad,
0x40, 0xb5, 0xe7, 0x2a, 0xa5, 0xa7, 0x4e, 0x60, 0x2f, 0x2c, 0x5c, 0x7a, 0x05, 0xe6, 0x02, 0x08,
0x06, 0xdd, 0xd8, 0xa8, 0x97, 0x86, 0xaa, 0x83, 0xd8, 0x7a, 0xcf, 0x92, 0xb5, 0xbb, 0x48, 0x13,
0x84, 0x66, 0x80, 0xb9, 0x82, 0x70, 0x5f, 0xe7, 0x14, 0x17, 0x7a, 0x7b, 0xe8, 0xfc, 0xe6, 0x1a,
0xab, 0xf2, 0xed, 0x68, 0x0d, 0x97, 0x48, 0x7b, 0x2a, 0x0b, 0x91, 0xcc, 0xba, 0x75, 0x2b, 0x5d,
0xf5, 0xe7, 0xe9, 0xaa, 0x3f, 0xcf, 0x85, 0x1b, 0x3d, 0x20, 0xa0, 0xb8, 0xe6, 0x63, 0xfe, 0x0e,
0x04, 0xd8, 0x75, 0xec, 0x28, 0x97, 0x0e, 0x7f, 0xb4, 0x34, 0x0a, 0x44, 0x32, 0xcf, 0x5e, 0x0b,
0xd5, 0x9e, 0x16, 0x06, 0xdc, 0x0e, 0x6c, 0x7d, 0xe7, 0x98, 0xbc, 0x37, 0x49, 0x4e, 0x6e, 0x2e,
0x4f, 0x2d, 0x5b, 0x86, 0x7d, 0xfb, 0x76, 0xaa, 0x3d, 0x57, 0xb1, 0xda, 0xed, 0x54, 0x7b, 0x5a,
0x34, 0xef, 0xa9, 0x09, 0x20, 0xe8, 0xe3, 0x8a, 0xef, 0xa7, 0x00, 0x95, 0xa1, 0x35, 0x07, 0xb8,
0xfe, 0x5c, 0x11, 0x5b, 0xc6, 0x9a, 0x58, 0x99, 0x92, 0xc2, 0x2b, 0xf9, 0xf9, 0xd8, 0x7a, 0xcf,
0xd2, 0xe2, 0x72, 0x03, 0x2a, 0x63, 0xa3, 0xa3, 0xac, 0xaf, 0x28, 0xd7, 0xa4, 0x80, 0xa2, 0x45,
0xae, 0xee, 0xc6, 0x26, 0xd6, 0xee, 0x2e, 0xa2, 0xcc, 0xe9, 0xc4, 0x7b, 0xfb, 0x36, 0x69, 0xdd,
0xa7, 0x39, 0xf7, 0xbb, 0x09, 0xef, 0x6a, 0x1b, 0x65, 0x0f, 0xae, 0x71, 0xc4, 0xfb, 0x2c, 0x5f,
0xae, 0xd9, 0x42, 0x61, 0x31, 0xec, 0x7c, 0xf0, 0x2d, 0x30, 0xc4, 0x91, 0x95, 0x2b, 0x97, 0x46,
0x81, 0x0d, 0xfb, 0x2a, 0x38, 0x74, 0xf1, 0x22, 0x55, 0x1f, 0xbc, 0x8f, 0xad, 0xef, 0x2c, 0x77,
0xbc, 0x5e, 0xf6, 0x77, 0x4e, 0xb1, 0xaf, 0xa4, 0x14, 0x21, 0x04, 0xc3, 0x59, 0x07, 0x58, 0xb7,
0x69, 0x23, 0x57, 0x5c, 0x6e, 0x9e, 0x8e, 0x7b, 0x06, 0x21, 0x1e, 0x05, 0xea, 0x56, 0x0d, 0xe9,
0x39, 0x67, 0x1a, 0x0a, 0x21, 0xd8, 0x50, 0x51, 0x4e, 0xc0, 0xef, 0xa7, 0x2c, 0xe6, 0x17, 0x4a,
0x5e, 0xcc, 0x22, 0xa3, 0xb8, 0x8e, 0xa1, 0xbe, 0x3e, 0x02, 0x81, 0x00, 0x3f, 0xfc, 0xf6, 0x2b,
0xdf, 0xb5, 0xb5, 0xe1, 0xbd, 0x3b, 0x41, 0x5f, 0x77, 0x0f, 0x39, 0xb9, 0xeb, 0x38, 0x73, 0xbc,
0x96, 0x8c, 0xe2, 0x3a, 0x6c, 0xeb, 0xd7, 0x73, 0x67, 0x64, 0x84, 0x55, 0xf9, 0x76, 0xec, 0xef,
0xbd, 0x3b, 0x67, 0x5a, 0x47, 0x54, 0x20, 0xb7, 0xbc, 0x8c, 0x07, 0x7e, 0x3f, 0x69, 0x19, 0x19,
0xbc, 0xe9, 0xf9, 0x8b, 0x7e, 0x57, 0x25, 0xcd, 0x03, 0x03, 0x6c, 0xde, 0xb6, 0x0d, 0x57, 0x41,
0x3c, 0x83, 0x37, 0x7a, 0x71, 0xbf, 0xb6, 0x9c, 0x2d, 0x63, 0x8d, 0xe4, 0xbf, 0xba, 0x99, 0x43,
0xcb, 0x87, 0x10, 0x42, 0xd0, 0xef, 0xaa, 0xc4, 0x7f, 0x7f, 0x92, 0xfb, 0x93, 0x93, 0x6c, 0xcc,
0xcb, 0x23, 0xe0, 0xf7, 0xcf, 0x59, 0x09, 0x23, 0xfe, 0x0f, 0x7c, 0x51, 0xf8, 0x02, 0x8d, 0xe3,
0x71, 0xdc, 0x9b, 0xb8, 0xcb, 0x8a, 0xac, 0x2c, 0xba, 0x9f, 0xdf, 0xc4, 0x1f, 0x1d, 0xd7, 0x11,
0x42, 0xf0, 0xd9, 0xc4, 0x0a, 0xf6, 0xbf, 0xb5, 0x93, 0x31, 0x9d, 0x0e, 0xef, 0xf8, 0x9f, 0x74,
0x7b, 0x5a, 0x90, 0xf9, 0x0e, 0x3e, 0xa9, 0x85, 0xcf, 0xbf, 0xfe, 0x0a, 0x23, 0x0f, 0xc9, 0xb1,
0xbd, 0xc4, 0xda, 0xbb, 0x3f, 0xa2, 0xa6, 0xa6, 0xd1, 0x5d, 0xf2, 0x13, 0x6d, 0x97, 0x2f, 0x87,
0x4f, 0xcf, 0x30, 0x73, 0x2f, 0x03, 0x99, 0x80, 0x69, 0x89, 0xff, 0x53, 0x1e, 0x02, 0x7d, 0xc0,
0xcf, 0xf3, 0x01, 0x98, 0x81, 0x65, 0x33, 0xfd, 0x52, 0xda, 0x3f, 0x40, 0x60, 0xa6, 0x0f, 0xd9,
0xbf, 0x2f, 0x89, 0x69, 0x46, 0x25, 0x68, 0x1c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};
static unsigned char icon_doc_16_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd, 0xa7, 0x93,
0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13,
0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdb, 0x04,
0x06, 0x11, 0x21, 0x22, 0x20, 0xdd, 0x22, 0x10, 0x00, 0x00, 0x01, 0x95, 0x49, 0x44, 0x41, 0x54,
0x38, 0xcb, 0x95, 0x93, 0x3d, 0x4b, 0x82, 0x51, 0x14, 0xc7, 0x7f, 0xc7, 0x24, 0x4d, 0x7c, 0x96,
0x96, 0x50, 0x48, 0x14, 0x8a, 0x86, 0x16, 0x23, 0x28, 0xea, 0x23, 0xd8, 0xd0, 0xcb, 0x20, 0x86,
0x6b, 0x11, 0xb4, 0xd8, 0x10, 0x6d, 0x81, 0xbd, 0x7c, 0x02, 0x5b, 0xa2, 0x10, 0x47, 0x6b, 0x2a,
0xa7, 0x1c, 0x0b, 0x24, 0xb3, 0xa9, 0xf7, 0xa1, 0x25, 0xb2, 0x20, 0xe4, 0x59, 0xad, 0xd0, 0xb2,
0xdb, 0x50, 0x8f, 0x3c, 0xbe, 0x3c, 0x50, 0x07, 0x2e, 0xdc, 0x73, 0xef, 0x39, 0xff, 0xf3, 0x3b,
0x87, 0x7b, 0x45, 0x29, 0x05, 0x80, 0x88, 0x0c, 0x02, 0x1a, 0x16, 0xa6, 0x94, 0x3a, 0x6b, 0x77,
0x6e, 0x37, 0xed, 0xb5, 0x68, 0x34, 0x9a, 0x37, 0x1c, 0x8f, 0xcf, 0xc7, 0x4b, 0xb1, 0x08, 0x40,
0xa9, 0x54, 0x42, 0x44, 0xc6, 0xda, 0x89, 0x98, 0x05, 0x04, 0xa0, 0x50, 0x28, 0x10, 0xcf, 0x1c,
0x12, 0x9f, 0x9c, 0xaa, 0x5f, 0xf4, 0x0e, 0x05, 0xd1, 0x75, 0x3d, 0x2f, 0x22, 0xe3, 0x4a, 0xa9,
0xbc, 0x59, 0xc0, 0x66, 0x76, 0x44, 0x04, 0xa0, 0x21, 0x19, 0xe0, 0xfe, 0x34, 0x8f, 0xcb, 0xe5,
0x42, 0xd7, 0xf5, 0x53, 0x11, 0x19, 0xb3, 0x12, 0x10, 0x43, 0xa4, 0x79, 0x01, 0x38, 0x1c, 0x0e,
0xb3, 0xc8, 0x78, 0xdb, 0x16, 0x8c, 0xe0, 0xe0, 0x6c, 0x84, 0x8b, 0xf4, 0x5e, 0x03, 0x99, 0xd7,
0xeb, 0x05, 0x20, 0x10, 0x08, 0xd4, 0x8b, 0x35, 0x13, 0xd8, 0x8c, 0x8a, 0x97, 0x7b, 0xfb, 0xf5,
0xea, 0xf3, 0x5b, 0x09, 0x1e, 0x0e, 0x96, 0xd1, 0x34, 0x0d, 0x4d, 0xd3, 0xf0, 0xfb, 0xfd, 0x0d,
0x79, 0x2d, 0x04, 0x06, 0x85, 0x61, 0xc9, 0xd8, 0x12, 0x49, 0xc0, 0x6e, 0xff, 0x09, 0x75, 0x3a,
0x9d, 0x96, 0x04, 0xd2, 0x9c, 0xdc, 0xce, 0x7e, 0x63, 0xe4, 0x5f, 0x43, 0x0c, 0x6f, 0xac, 0xd3,
0x44, 0xf7, 0x37, 0x82, 0x78, 0x26, 0xc3, 0x5c, 0x22, 0x41, 0x68, 0x7a, 0xfa, 0x4f, 0x04, 0xf5,
0x21, 0xde, 0xa5, 0x17, 0x11, 0x11, 0x9e, 0x8b, 0x8f, 0x24, 0x63, 0x31, 0x46, 0x6f, 0xb6, 0x19,
0x9a, 0x8d, 0x98, 0x29, 0x6c, 0x96, 0x2d, 0x00, 0x2c, 0x1c, 0x7f, 0x92, 0xba, 0xbe, 0xe2, 0x24,
0x9b, 0xa5, 0x7f, 0x22, 0x64, 0xbe, 0x6a, 0x89, 0x6d, 0x79, 0xca, 0x7d, 0xa1, 0x10, 0xb9, 0x9d,
0x5d, 0x72, 0x3b, 0xbb, 0xa4, 0xae, 0xaf, 0x00, 0x88, 0x6e, 0x6e, 0xf2, 0x5a, 0x2e, 0x13, 0x5e,
0x5f, 0xe3, 0xe9, 0x28, 0x6b, 0x29, 0x40, 0xad, 0x56, 0x63, 0xb8, 0xf3, 0x8b, 0x81, 0x99, 0x19,
0xdc, 0x5f, 0x6f, 0x64, 0x57, 0x57, 0x78, 0xb3, 0xbb, 0xe9, 0xa9, 0x54, 0xa8, 0x54, 0x3f, 0xa8,
0xde, 0xde, 0xd1, 0xed, 0xf1, 0x34, 0xa2, 0x98, 0xbe, 0xf3, 0x08, 0xe0, 0x01, 0xba, 0x00, 0x37,
0xe0, 0x00, 0x3a, 0x0c, 0x6d, 0xa0, 0x02, 0x94, 0x81, 0x77, 0xe0, 0x45, 0x29, 0x75, 0x0e, 0xf0,
0x0d, 0xff, 0x1c, 0x7a, 0x37, 0x5c, 0xfd, 0x46, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};

File diff suppressed because one or more lines are too long

View File

@@ -1,372 +0,0 @@
/**
* Powder Toy - user interface (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_H
#define INTERFACE_H
#include <SDL/SDL.h>
#if (defined(LIN32) || defined(LIN64)) && defined(SDL_VIDEO_DRIVER_X11)
#include <SDL/SDL_syswm.h>
#endif
#include "graphics.h"
struct menu_section
{
char *icon;
const char *name;
int itemcount;
int doshow;
};
typedef struct menu_section menu_section;
#define QM_TOGGLE 1
struct quick_option
{
char *icon;
const char *name;
int type;
int *variable;
};
typedef struct quick_option quick_option;
struct menu_wall
{
pixel colour;
const char *descs;
};
typedef struct menu_wall menu_wall;
#define SC_WALL 0
#define SC_ELEC 1
#define SC_POWERED 2
#define SC_FORCE 3
#define SC_EXPLOSIVE 4
#define SC_GAS 5
#define SC_LIQUID 6
#define SC_POWDERS 7
#define SC_SOLIDS 8
#define SC_NUCLEAR 9
#define SC_SPECIAL 10
#define SC_LIFE 11
#define SC_TOOL 12
#define SC_CRACKER 13
#define SC_CRACKER2 14
#define SC_TOTAL 13
static menu_section msections[] = //doshow does not do anything currently.
{
{"\xC1", "Walls", 0, 1},
{"\xC2", "Electronics", 0, 1},
{"\xD6", "Powered Materials", 0, 1},
{"\xE2", "Force Creating", 0, 1},
{"\xC3", "Explosives", 0, 1},
{"\xC5", "Gases", 0, 1},
{"\xC4", "Liquids", 0, 1},
{"\xD0", "Powders", 0, 1},
{"\xD1", "Solids", 0, 1},
{"\xC6", "Radioactive", 0, 1},
{"\xCC", "Special", 0, 1},
{"\xD2", "Life", 0, 1},
{"\xD7", "Tools", 0, 1},
{"\xD2", "More Life", 0, 1},
{"\xC8", "", 0, 0},
{"\xC8", "Cracker", 0, 0},
{"\xC8", "Cracker!", 0, 0},
};
static quick_option quickmenu[] =
{
{"P", "Sand effect", QM_TOGGLE, &pretty_powder},
{"G", "Draw gravity grid", QM_TOGGLE, &drawgrav_enable},
{"D", "Show decorations", QM_TOGGLE, &decorations_enable},
{"N", "Newtonian gravity", QM_TOGGLE, &ngrav_enable},
{"A", "Ambient heat", QM_TOGGLE, &aheat_enable},
{"C", "Show Console", QM_TOGGLE, &console_mode},
{NULL}
};
static menu_section colorsections[] = //doshow does not do anything currently.
{
{"\xC4", "Colors", 7, 1},
{"\xD7", "Tools", 0, 1},
};
#define DECO_SECTIONS 2
static menu_wall colorlist[] =
{
{PIXPACK(0xFF0000), "Red"},
{PIXPACK(0x00FF00), "Green"},
{PIXPACK(0x0000FF), "Blue"},
{PIXPACK(0xFFFF00), "Yellow"},
{PIXPACK(0xFF00FF), "Pink"},
{PIXPACK(0x00FFFF), "Cyan"},
{PIXPACK(0xFFFFFF), "White"},
};
#define DECO_DRAW 0
#define DECO_LIGHTEN 1
#define DECO_DARKEN 2
#define DECO_SMUDGE 3
static menu_wall toollist[] =
{
{PIXPACK(0xFF0000), "Draw"},
{PIXPACK(0xDDDDDD), "Lighten"},
{PIXPACK(0x111111), "Darken"},
{PIXPACK(0x00FF00), "Smudge"},
};
struct ui_edit
{
int x, y, w, nx, h;
char str[256],*def;
int focus, cursor, hide, multiline;
};
typedef struct ui_edit ui_edit;
struct ui_list
{
int x, y, w, h;
char str[256],*def,**items;
int selected, focus, count;
};
typedef struct ui_list ui_list;
struct ui_copytext
{
int x, y, width, height;
char text[256];
int state, hover;
};
typedef struct ui_copytext ui_copytext;
struct save_info
{
char *title;
char *name;
char *author;
char *date;
char *description;
int publish;
int voteup;
int votedown;
int vote;
int myvote;
int downloadcount;
int myfav;
char *tags;
int comment_count;
char *comments[6];
char *commentauthors[6];
};
typedef struct save_info save_info;
struct ui_checkbox
{
int x, y;
int focus, checked;
};
typedef struct ui_checkbox ui_checkbox;
struct ui_richtext
{
int x, y;
char str[512];
char printstr[512];
int regionss[6];
int regionsf[6];
char action[6];
char actiondata[6][256];
char actiontext[6][256];
};
typedef struct ui_richtext ui_richtext;
int SLALT;
extern SDLMod sdl_mod;
extern int sdl_key, sdl_rkey, sdl_wheel, sdl_ascii, sdl_zoom_trig;
#if (defined(LIN32) || defined(LIN64)) && defined(SDL_VIDEO_DRIVER_X11)
extern SDL_SysWMinfo sdl_wminfo;
extern Atom XA_CLIPBOARD, XA_TARGETS;
#endif
extern char *shift_0;
extern char *shift_1;
extern int svf_messages;
extern int svf_login;
extern int svf_admin;
extern int svf_mod;
extern char svf_user[64];
extern char svf_pass[64];
extern char svf_user_id[64];
extern char svf_session_id[64];
extern char svf_filename[255];
extern int svf_fileopen;
extern int svf_open;
extern int svf_own;
extern int svf_myvote;
extern int svf_publish;
extern char svf_id[16];
extern char svf_name[64];
extern char svf_tags[256];
extern char svf_description[255];
extern void *svf_last;
extern int svf_lsize;
extern char *search_ids[GRID_X*GRID_Y];
extern char *search_dates[GRID_X*GRID_Y];
extern int search_votes[GRID_X*GRID_Y];
extern int search_publish[GRID_X*GRID_Y];
extern int search_scoredown[GRID_X*GRID_Y];
extern int search_scoreup[GRID_X*GRID_Y];
extern char *search_names[GRID_X*GRID_Y];
extern char *search_owners[GRID_X*GRID_Y];
extern void *search_thumbs[GRID_X*GRID_Y];
extern int search_thsizes[GRID_X*GRID_Y];
extern int search_own;
extern int search_fav;
extern int search_date;
extern int search_page;
extern char search_expr[256];
extern char *tag_names[TAG_MAX];
extern int tag_votes[TAG_MAX];
extern int zoom_en;
extern int zoom_x, zoom_y;
extern int zoom_wx, zoom_wy;
void menu_count(void);
void quickoptions_menu(pixel *vid_buf, int b, int bq, int x, int y);
void prop_edit_ui(pixel *vid_buf, int x, int y);
void get_sign_pos(int i, int *x0, int *y0, int *w, int *h);
void add_sign_ui(pixel *vid_buf, int mx, int my);
void ui_edit_draw(pixel *vid_buf, ui_edit *ed);
void ui_edit_process(int mx, int my, int mb, ui_edit *ed);
void ui_list_draw(pixel *vid_buf, ui_list *ed);
void ui_list_process(pixel * vid_buf, int mx, int my, int mb, ui_list *ed);
void ui_checkbox_draw(pixel *vid_buf, ui_checkbox *ed);
void ui_checkbox_process(int mx, int my, int mb, int mbq, ui_checkbox *ed);
void ui_copytext_draw(pixel *vid_buf, ui_copytext *ed);
void ui_copytext_process(int mx, int my, int mb, int mbq, ui_copytext *ed);
void ui_richtext_draw(pixel *vid_buf, ui_richtext *ed);
void ui_richtext_settext(char *text, ui_richtext *ed);
void ui_richtext_process(int mx, int my, int mb, int mbq, ui_richtext *ed);
void draw_svf_ui(pixel *vid_buf, int alternate);
void error_ui(pixel *vid_buf, int err, char *txt);
void element_search_ui(pixel *vid_buf, int * sl, int * sr);
void info_ui(pixel *vid_buf, char *top, char *txt);
void copytext_ui(pixel *vid_buf, char *top, char *txt, char *copytxt);
void info_box(pixel *vid_buf, char *msg);
void info_box_overlay(pixel *vid_buf, char *msg);
char *input_ui(pixel *vid_buf, char *title, char *prompt, char *text, char *shadow);
int confirm_ui(pixel *vid_buf, char *top, char *msg, char *btn);
void login_ui(pixel *vid_buf);
int stamp_ui(pixel *vid_buf);
void tag_list_ui(pixel *vid_buf);
int save_name_ui(pixel *vid_buf);
int save_filename_ui(pixel *vid_buf);
void menu_ui(pixel *vid_buf, int i, int *sl, int *sr);
void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *su, int *dae, int b, int bq, int mx, int my);
int color_menu_ui(pixel *vid_buf, int i, int *cr, int *cg, int *cb, int b, int bq, int mx, int my, int * tool);
int sdl_poll(void);
void stickmen_keys();
void set_cmode(int cm);
char *download_ui(pixel *vid_buf, char *uri, int *len);
int search_ui(pixel *vid_buf);
int open_ui(pixel *vid_buf, char *save_id, char *save_date);
void catalogue_ui(pixel * vid_buf);
int info_parse(char *info_data, save_info *info);
int search_results(char *str, int votes);
int execute_tagop(pixel *vid_buf, char *op, char *tag);
void execute_save(pixel *vid_buf);
int execute_delete(pixel *vid_buf, char *id);
int execute_report(pixel *vid_buf, char *id, char *reason);
void execute_submit(pixel *vid_buf, char *id, char *message);
void execute_fav(pixel *vid_buf, char *id);
void execute_unfav(pixel *vid_buf, char *id);
int execute_vote(pixel *vid_buf, char *id, char *action);
void open_link(char *uri);
int report_ui(pixel *vid_buf, char *save_id);
char *console_ui(pixel *vid_buf, char error[255],char console_more);
void render_ui(pixel *vid_buf, int xcoord, int ycoord, int orientation);
void simulation_ui(pixel *vid_buf);
unsigned int decorations_ui(pixel *vid_buf, int *bsx, int *bsy, unsigned int savedColor);
Uint8 mouse_get_state(int *x, int *y);
void mouse_coords_window_to_sim(int *sim_x, int *sim_y, int window_x, int window_y);
#endif

View File

@@ -1,127 +0,0 @@
/**
* Powder Toy - Lua console (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LUACONSOLEH
#define LUACONSOLEH
#ifdef LUA_R_INCL
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#else
#include <lua5.1/lua.h>
#include <lua5.1/lauxlib.h>
#include <lua5.1/lualib.h>
#endif
#include <defines.h>
#define LOCAL_LUA_DIR "Lua"
#define LUACON_MDOWN 1
#define LUACON_MUP 2
#define LUACON_MPRESS 3
#define LUACON_KDOWN 1
#define LUACON_KUP 2
//Bitmasks for things that might need recalculating after changes to tpt.el
#define LUACON_EL_MODIFIED_CANMOVE 0x1
#define LUACON_EL_MODIFIED_GRAPHICS 0x2
#define LUACON_EL_MODIFIED_MENUS 0x4
int *lua_el_func, *lua_el_mode, *lua_gr_func;
void luacon_open();
int luacon_step(int mx, int my, int selectl, int selectr, int bsx, int bsy);
int luacon_mouseevent(int mx, int my, int mb, int event, int mouse_wheel);
int luacon_keyevent(int key, int modifier, int event);
int luacon_eval(char *command);
int luacon_part_update(int t, int i, int x, int y, int surround_space, int nt);
int luacon_graphics_update(int t, int i, int *pixel_mode, int *cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb);
char *luacon_geterror();
void luacon_close();
int luacon_partsread(lua_State* l);
int luacon_partswrite(lua_State* l);
int luacon_partread(lua_State* l);
int luacon_partwrite(lua_State* l);
int luacon_elementread(lua_State* l);
int luacon_elementwrite(lua_State* l);
int luacon_transitionread(lua_State* l);
int luacon_transitionwrite(lua_State* l);
int luacon_particle_getproperty(char * key, int * format);
int luacon_transition_getproperty(char * key, int * format);
int luacon_element_getproperty(char * key, int * format, unsigned int * modified_stuff);
int process_command_lua(pixel *vid_buf, char *console, char *console_error);
void lua_hook(lua_State *L, lua_Debug *ar);
int getPartIndex_curIdx;
//TPT Interface
int luatpt_test(lua_State* l);
int luatpt_getelement(lua_State *l);
int luatpt_element_func(lua_State *l);
int luatpt_graphics_func(lua_State *l);
int luatpt_drawtext(lua_State* l);
int luatpt_create(lua_State* l);
int luatpt_setpause(lua_State* l);
int luatpt_togglepause(lua_State* l);
int luatpt_togglewater(lua_State* l);
int luatpt_setconsole(lua_State* l);
int luatpt_log(lua_State* l);
int luatpt_set_pressure(lua_State* l);
int luatpt_set_gravity(lua_State* l);
int luatpt_reset_gravity_field(lua_State* l);
int luatpt_reset_velocity(lua_State* l);
int luatpt_reset_spark(lua_State* l);
int luatpt_set_property(lua_State* l);
int luatpt_get_property(lua_State* l);
int luatpt_set_wallmap(lua_State* l);
int luatpt_get_wallmap(lua_State* l);
int luatpt_set_elecmap(lua_State* l);
int luatpt_get_elecmap(lua_State* l);
int luatpt_drawpixel(lua_State* l);
int luatpt_drawrect(lua_State* l);
int luatpt_fillrect(lua_State* l);
int luatpt_drawline(lua_State* l);
int luatpt_textwidth(lua_State* l);
int luatpt_get_name(lua_State* l);
int luatpt_set_shortcuts(lua_State* l);
int luatpt_delete(lua_State* l);
int luatpt_register_step(lua_State* l);
int luatpt_unregister_step(lua_State* l);
int luatpt_register_mouseclick(lua_State* l);
int luatpt_unregister_mouseclick(lua_State* l);
int luatpt_register_keypress(lua_State* l);
int luatpt_unregister_keypress(lua_State* l);
int luatpt_input(lua_State* l);
int luatpt_message_box(lua_State* l);
int luatpt_get_numOfParts(lua_State* l);
int luatpt_start_getPartIndex(lua_State* l);
int luatpt_getPartIndex(lua_State* l);
int luatpt_next_getPartIndex(lua_State* l);
int luatpt_hud(lua_State* l);
int luatpt_gravity(lua_State* l);
int luatpt_airheat(lua_State* l);
int luatpt_active_menu(lua_State* l);
int luatpt_decorations_enable(lua_State* l);
int luatpt_cmode_set(lua_State* l);
int luatpt_error(lua_State* l);
int luatpt_heat(lua_State* l);
int luatpt_setfire(lua_State* l);
int luatpt_setdebug(lua_State* l);
int luatpt_setfpscap(lua_State* l);
int luatpt_getscript(lua_State* l);
int luatpt_setwindowsize(lua_State* l);
int luatpt_screenshot(lua_State* l);
#endif

View File

@@ -1,18 +0,0 @@
#ifndef MD5_H
#define MD5_H
struct md5_context
{
unsigned buf[4];
unsigned bits[2];
unsigned char in[64];
};
void md5_init(struct md5_context *context);
void md5_update(struct md5_context *context, unsigned char const *buf, unsigned len);
void md5_final(unsigned char digest[16], struct md5_context *context);
void md5_transform(unsigned buf[4], const unsigned char in[64]);
void md5_ascii(char *result, unsigned char const *buf, unsigned len);
#endif

View File

@@ -1,125 +0,0 @@
/**
* Powder Toy - miscellaneous functions (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTILS_H
#define UTILS_H
#include <stdio.h>
#include <stdlib.h>
#if defined(WIN32) && !defined(__GNUC__)
#define x86_cpuid(func,af,bf,cf,df) \
do {\
__asm mov eax, func\
__asm cpuid\
__asm mov af, eax\
__asm mov bf, ebx\
__asm mov cf, ecx\
__asm mov df, edx\
} while(0)
#else
#define x86_cpuid(func,af,bf,cf,df) \
__asm__ __volatile ("cpuid":\
"=a" (af), "=b" (bf), "=c" (cf), "=d" (df) : "a" (func));
#endif
static char hex[] = "0123456789ABCDEF";
//Signum function
int isign(float i);
unsigned clamp_flt(float f, float min, float max);
float restrict_flt(float f, float min, float max);
char *mystrdup(char *s);
struct strlist
{
char *str;
struct strlist *next;
};
void strlist_add(struct strlist **list, char *str);
int strlist_find(struct strlist **list, char *str);
void strlist_free(struct strlist **list);
void save_presets(int do_update);
void clean_text(char *text, int vwidth);
void load_presets(void);
void save_string(FILE *f, char *str);
int sregexp(const char *str, char *pattern);
int load_string(FILE *f, char *str, int max);
void strcaturl(char *dst, char *src);
void strappend(char *dst, char *src);
void *file_load(char *fn, int *size);
void clipboard_push_text(char * text);
void draw_bframe();
void erase_bframe();
char * clipboard_pull_text();
extern char *clipboard_text;
int register_extension();
int cpu_check(void);
void HSV_to_RGB(int h,int s,int v,int *r,int *g,int *b);
void RGB_to_HSV(int r,int g,int b,int *h,int *s,int *v);
void membwand(void * dest, void * src, size_t destsize, size_t srcsize);
// a b
// c d
struct matrix2d {
float a,b,c,d;
};
typedef struct matrix2d matrix2d;
// column vector
struct vector2d {
float x,y;
};
typedef struct vector2d vector2d;
matrix2d m2d_multiply_m2d(matrix2d m1, matrix2d m2);
vector2d m2d_multiply_v2d(matrix2d m, vector2d v);
matrix2d m2d_multiply_float(matrix2d m, float s);
vector2d v2d_multiply_float(vector2d v, float s);
vector2d v2d_add(vector2d v1, vector2d v2);
vector2d v2d_sub(vector2d v1, vector2d v2);
matrix2d m2d_new(float me0, float me1, float me2, float me3);
vector2d v2d_new(float x, float y);
extern vector2d v2d_zero;
extern matrix2d m2d_identity;
#endif

View File

@@ -1,855 +0,0 @@
/**
* Powder Toy - particle simulation (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef POWDER_H
#define POWDER_H
#include "air.h"
#include "graphics.h"
#include "defines.h"
#include "interface.h"
#include "misc.h"
#define CM_COUNT 11
#define CM_CRACK 10
#define CM_LIFE 9
#define CM_GRAD 8
#define CM_NOTHING 7
#define CM_FANCY 6
#define CM_HEAT 5
#define CM_BLOB 4
#define CM_FIRE 3
#define CM_PERS 2
#define CM_PRESS 1
#define CM_VEL 0
#define BRUSH_REPLACEMODE 0x1
#define BRUSH_SPECIFIC_DELETE 0x2
#define UI_WALLSTART 222
#define UI_ACTUALSTART 122
#define UI_WALLCOUNT 25
#define WL_WALLELEC 122
#define WL_EWALL 123
#define WL_DETECT 124
#define WL_STREAM 125
#define WL_SIGN 126
#define WL_FAN 127
#define WL_FANHELPER 255
#define WL_ALLOWLIQUID 128
#define WL_DESTROYALL 129
#define WL_ERASE 130
#define WL_WALL 131
#define WL_ALLOWAIR 132
#define WL_ALLOWSOLID 133
#define WL_ALLOWALLELEC 134
#define WL_EHOLE 135
#define SPC_AIR 236
#define SPC_HEAT 237
#define SPC_COOL 238
#define SPC_VACUUM 239
#define SPC_WIND 241
#define SPC_PGRV 243
#define SPC_NGRV 244
#define SPC_PROP 246
#define WL_ALLOWGAS 140
#define WL_GRAV 142
#define WL_ALLOWENERGY 145
#define PT_NONE 0
#define PT_DUST 1
#define PT_WATR 2
#define PT_OIL 3
#define PT_FIRE 4
#define PT_STNE 5
#define PT_LAVA 6
#define PT_GUNP 7
#define PT_NITR 8
#define PT_CLNE 9
#define PT_GAS 10
#define PT_PLEX 11
#define PT_GOO 12
#define PT_ICEI 13
#define PT_METL 14
#define PT_SPRK 15
#define PT_SNOW 16
#define PT_WOOD 17
#define PT_NEUT 18
#define PT_PLUT 19
#define PT_PLNT 20
#define PT_ACID 21
#define PT_VOID 22
#define PT_WTRV 23
#define PT_CNCT 24
#define PT_DSTW 25
#define PT_SALT 26
#define PT_SLTW 27
#define PT_DMND 28
#define PT_BMTL 29
#define PT_BRMT 30
#define PT_PHOT 31
#define PT_URAN 32
#define PT_WAX 33
#define PT_MWAX 34
#define PT_PSCN 35
#define PT_NSCN 36
#define PT_LNTG 37
#define PT_INSL 38
#define PT_BHOL 39
#define PT_WHOL 40
#define PT_RBDM 41
#define PT_LRBD 42
#define PT_NTCT 43
#define PT_SAND 44
#define PT_GLAS 45
#define PT_PTCT 46
#define PT_BGLA 47
#define PT_THDR 48
#define PT_PLSM 49
#define PT_ETRD 50
#define PT_NICE 51
#define PT_NBLE 52
#define PT_BTRY 53
#define PT_LCRY 54
#define PT_STKM 55
#define PT_SWCH 56
#define PT_SMKE 57
#define PT_DESL 58
#define PT_COAL 59
#define PT_LO2 60
#define PT_O2 61
#define PT_INWR 62
#define PT_YEST 63
#define PT_DYST 64
#define PT_THRM 65
#define PT_GLOW 66
#define PT_BRCK 67
#define PT_HFLM 68
#define PT_FIRW 69
#define PT_FUSE 70
#define PT_FSEP 71
#define PT_AMTR 72
#define PT_BCOL 73
#define PT_PCLN 74
#define PT_HSWC 75
#define PT_IRON 76
#define PT_MORT 77
#define PT_LIFE 78
#define PT_DLAY 79
#define PT_CO2 80
#define PT_DRIC 81
#define PT_CBNW 82
#define PT_STOR 83
#define PT_PVOD 84
#define PT_CONV 85
#define PT_CAUS 86
#define PT_LIGH 87
#define PT_TESC 88
#define PT_DEST 89
#define PT_SPNG 90
#define PT_RIME 91
#define PT_FOG 92
#define PT_BCLN 93
#define PT_LOVE 94
#define PT_DEUT 95
#define PT_WARP 96
#define PT_PUMP 97
#define PT_FWRK 98
#define PT_PIPE 99
#define PT_FRZZ 100
#define PT_FRZW 101
#define PT_GRAV 102
#define PT_BIZR 103
#define PT_BIZRG 104
#define PT_BIZRS 105
#define PT_INST 106
#define PT_ISOZ 107
#define PT_ISZS 108
#define PT_PRTI 109
#define PT_PRTO 110
#define PT_PSTE 111
#define PT_PSTS 112
#define PT_ANAR 113
#define PT_VINE 114
#define PT_INVIS 115
#define PT_EQUALVEL 116 //all particles equal their velocities
#define PT_SPAWN2 117
#define PT_SPAWN 118
#define PT_SHLD1 119
#define PT_SHLD2 120
#define PT_SHLD3 121
#define PT_SHLD4 122
#define PT_LOLZ 123
#define PT_WIFI 124
#define PT_FILT 125
#define PT_ARAY 126
#define PT_BRAY 127
#define PT_STKM2 128
#define PT_BOMB 129
#define PT_C5 130
#define PT_SING 131
#define PT_QRTZ 132
#define PT_PQRT 133
#define PT_EMP 134
#define PT_BREL 135
#define PT_ELEC 136
#define PT_ACEL 137
#define PT_DCEL 138
#define PT_BANG 139
#define PT_IGNT 140
#define PT_BOYL 141
#define PT_GEL 142
#define PT_TRON 143
#define PT_TTAN 144
#define PT_EXOT 145
#define OLD_PT_WIND 147
#define PT_EMBR 147
#define PT_H2 148
#define PT_SOAP 149
#define PT_NBHL 150
#define PT_NWHL 151
#define PT_MERC 152
#define PT_PBCN 153
#define PT_GPMP 154
#define PT_CLST 155
#define PT_WIRE 156
#define PT_GBMB 157
#define PT_FIGH 158
#define PT_FRAY 159
#define PT_REPL 160
#define PT_PPIP 161
#define PT_DTEC 162
#define PT_NUM 163
#define R_TEMP 22
#define MAX_TEMP 9999
#define MIN_TEMP 0
#define O_MAX_TEMP 3500
#define O_MIN_TEMP -273
#define ST_NONE 0
#define ST_SOLID 1
#define ST_LIQUID 2
#define ST_GAS 3
/*
TODO: We should start to implement these.
*/
#define TYPE_PART 0x00001 //1 Powders
#define TYPE_LIQUID 0x00002 //2 Liquids
#define TYPE_SOLID 0x00004 //4 Solids
#define TYPE_GAS 0x00008 //8 Gases (Includes plasma)
#define TYPE_ENERGY 0x00010 //16 Energy (Thunder, Light, Neutrons etc.)
#define PROP_CONDUCTS 0x00020 //32 Conducts electricity
#define PROP_BLACK 0x00040 //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
#define PROP_NEUTPENETRATE 0x00080 //128 Penetrated by neutrons
#define PROP_NEUTABSORB 0x00100 //256 Absorbs neutrons, reflect is default
#define PROP_NEUTPASS 0x00200 //512 Neutrons pass through, such as with glass
#define PROP_DEADLY 0x00400 //1024 Is deadly for stickman
#define PROP_HOT_GLOW 0x00800 //2048 Hot Metal Glow
#define PROP_LIFE 0x01000 //4096 Is a GoL type
#define PROP_RADIOACTIVE 0x02000 //8192 Radioactive
#define PROP_LIFE_DEC 0x04000 //2^14 Life decreases by one every frame if > zero
#define PROP_LIFE_KILL 0x08000 //2^15 Kill when life value is <= zero
#define PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to<= zero
#define PROP_SPARKSETTLE 0x20000 //2^17 Allow Sparks/Embers to settle
#define PROP_NOAMBHEAT 0x40000 //2^18 Don't transfer or receive heat from ambient heat.
#define FLAG_STAGNANT 1
#define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT
#define FLAG_MOVABLE 0x4 // if can move
#define GRAPHICS_FUNC_ARGS particle *cpart, int nx, int ny, int *pixel_mode, int* cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb
#define GRAPHICS_FUNC_SUBCALL_ARGS cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb
struct particle
{
int type;
int life, ctype;
float x, y, vx, vy;
#ifdef OGLR
float lastX, lastY;
#endif
float temp;
float pavg[2];
int flags;
int tmp;
int tmp2;
unsigned int dcolour;
};
typedef struct particle particle;
int graphics_DEFAULT(GRAPHICS_FUNC_ARGS);
int graphics_FIRE(GRAPHICS_FUNC_ARGS);
int graphics_SMKE(GRAPHICS_FUNC_ARGS);
int graphics_PLSM(GRAPHICS_FUNC_ARGS);
int graphics_DEUT(GRAPHICS_FUNC_ARGS);
int graphics_PHOT(GRAPHICS_FUNC_ARGS);
int graphics_NEUT(GRAPHICS_FUNC_ARGS);
int graphics_LAVA(GRAPHICS_FUNC_ARGS);
int graphics_SPRK(GRAPHICS_FUNC_ARGS);
int graphics_QRTZ(GRAPHICS_FUNC_ARGS);
int graphics_CLST(GRAPHICS_FUNC_ARGS);
int graphics_CBNW(GRAPHICS_FUNC_ARGS);
int graphics_SPNG(GRAPHICS_FUNC_ARGS);
int graphics_LIFE(GRAPHICS_FUNC_ARGS);
int graphics_GRAV(GRAPHICS_FUNC_ARGS);
int graphics_WIFI(GRAPHICS_FUNC_ARGS);
int graphics_PRTI(GRAPHICS_FUNC_ARGS);
int graphics_PRTO(GRAPHICS_FUNC_ARGS);
int graphics_BIZR(GRAPHICS_FUNC_ARGS);
int graphics_PIPE(GRAPHICS_FUNC_ARGS);
int graphics_INVS(GRAPHICS_FUNC_ARGS);
int graphics_ACID(GRAPHICS_FUNC_ARGS);
int graphics_FILT(GRAPHICS_FUNC_ARGS);
int graphics_BRAY(GRAPHICS_FUNC_ARGS);
int graphics_SWCH(GRAPHICS_FUNC_ARGS);
int graphics_THDR(GRAPHICS_FUNC_ARGS);
int graphics_GLOW(GRAPHICS_FUNC_ARGS);
int graphics_LCRY(GRAPHICS_FUNC_ARGS);
int graphics_PCLN(GRAPHICS_FUNC_ARGS);
int graphics_PBCN(GRAPHICS_FUNC_ARGS);
int graphics_DLAY(GRAPHICS_FUNC_ARGS);
int graphics_HSWC(GRAPHICS_FUNC_ARGS);
int graphics_PVOD(GRAPHICS_FUNC_ARGS);
int graphics_STOR(GRAPHICS_FUNC_ARGS);
int graphics_PUMP(GRAPHICS_FUNC_ARGS);
int graphics_GPMP(GRAPHICS_FUNC_ARGS);
int graphics_HFLM(GRAPHICS_FUNC_ARGS);
int graphics_FIRW(GRAPHICS_FUNC_ARGS);
int graphics_BOMB(GRAPHICS_FUNC_ARGS);
int graphics_GBMB(GRAPHICS_FUNC_ARGS);
int graphics_COAL(GRAPHICS_FUNC_ARGS);
int graphics_STKM(GRAPHICS_FUNC_ARGS);
int graphics_DEST(GRAPHICS_FUNC_ARGS);
int graphics_EMP(GRAPHICS_FUNC_ARGS);
int graphics_LIGH(GRAPHICS_FUNC_ARGS);
int graphics_ELEC(GRAPHICS_FUNC_ARGS);
int graphics_WIRE(GRAPHICS_FUNC_ARGS);
int graphics_ACEL(GRAPHICS_FUNC_ARGS);
int graphics_DCEL(GRAPHICS_FUNC_ARGS);
int graphics_GEL(GRAPHICS_FUNC_ARGS);
int graphics_TRON(GRAPHICS_FUNC_ARGS);
int graphics_SOAP(GRAPHICS_FUNC_ARGS);
int graphics_EXOT(GRAPHICS_FUNC_ARGS);
int graphics_WARP(GRAPHICS_FUNC_ARGS);
int graphics_EMBR(GRAPHICS_FUNC_ARGS);
int graphics_BRCK(GRAPHICS_FUNC_ARGS);
int graphics_WOOD(GRAPHICS_FUNC_ARGS);
int graphics_PLNT(GRAPHICS_FUNC_ARGS);
void TRON_init_graphics();
#define UPDATE_FUNC_ARGS int i, int x, int y, int surround_space, int nt
// to call another update function with same arguments:
#define UPDATE_FUNC_SUBCALL_ARGS i, x, y, surround_space, nt
struct playerst
{
char comm; //command cell
char pcomm; //previous command
int elem; //element power
float legs[16]; //legs' positions
float accs[8]; //accelerations
char spwn; //if stick man was spawned
unsigned int frames; //frames since last particle spawn - used when spawning LIGH
};
typedef struct playerst playerst;
int update_ACID(UPDATE_FUNC_ARGS);
int update_ANAR(UPDATE_FUNC_ARGS);
int update_AMTR(UPDATE_FUNC_ARGS);
int update_ARAY(UPDATE_FUNC_ARGS);
int update_BCLN(UPDATE_FUNC_ARGS);
int update_BCOL(UPDATE_FUNC_ARGS);
int update_BMTL(UPDATE_FUNC_ARGS);
int update_BRMT(UPDATE_FUNC_ARGS);
int update_BOMB(UPDATE_FUNC_ARGS);
int update_BOYL(UPDATE_FUNC_ARGS);
int update_BTRY(UPDATE_FUNC_ARGS);
int update_C5(UPDATE_FUNC_ARGS);
int update_CLNE(UPDATE_FUNC_ARGS);
int update_COAL(UPDATE_FUNC_ARGS);
int update_DEUT(UPDATE_FUNC_ARGS);
int update_DSTW(UPDATE_FUNC_ARGS);
int update_DTEC(UPDATE_FUNC_ARGS);
int update_EMBR(UPDATE_FUNC_ARGS);
int update_FOG(UPDATE_FUNC_ARGS);
int update_FRZW(UPDATE_FUNC_ARGS);
int update_FRZZ(UPDATE_FUNC_ARGS);
int update_FSEP(UPDATE_FUNC_ARGS);
int update_FUSE(UPDATE_FUNC_ARGS);
int update_FIRW(UPDATE_FUNC_ARGS);
int update_FWRK(UPDATE_FUNC_ARGS);
int update_GEL(UPDATE_FUNC_ARGS);
int update_GLAS(UPDATE_FUNC_ARGS);
int update_GLOW(UPDATE_FUNC_ARGS);
int update_GOO(UPDATE_FUNC_ARGS);
int update_HSWC(UPDATE_FUNC_ARGS);
int update_IRON(UPDATE_FUNC_ARGS);
int update_ICEI(UPDATE_FUNC_ARGS);
int update_ISZ(UPDATE_FUNC_ARGS);
int update_LCRY(UPDATE_FUNC_ARGS);
int update_MORT(UPDATE_FUNC_ARGS);
int update_NBLE(UPDATE_FUNC_ARGS);
int update_NEUT(UPDATE_FUNC_ARGS);
int update_NPTCT(UPDATE_FUNC_ARGS);
int update_PCLN(UPDATE_FUNC_ARGS);
int update_PHOT(UPDATE_FUNC_ARGS);
int update_PIPE(UPDATE_FUNC_ARGS);
int update_PLNT(UPDATE_FUNC_ARGS);
int update_PLUT(UPDATE_FUNC_ARGS);
int update_PRTI(UPDATE_FUNC_ARGS);
int update_PRTO(UPDATE_FUNC_ARGS);
int update_PYRO(UPDATE_FUNC_ARGS);
int update_PUMP(UPDATE_FUNC_ARGS);
int update_QRTZ(UPDATE_FUNC_ARGS);
int update_RIME(UPDATE_FUNC_ARGS);
int update_SHLD1(UPDATE_FUNC_ARGS);
int update_SHLD2(UPDATE_FUNC_ARGS);
int update_SHLD3(UPDATE_FUNC_ARGS);
int update_SHLD4(UPDATE_FUNC_ARGS);
int update_SING(UPDATE_FUNC_ARGS);
int update_SLTW(UPDATE_FUNC_ARGS);
int update_SPAWN(UPDATE_FUNC_ARGS);
int update_SPAWN2(UPDATE_FUNC_ARGS);
int update_SPNG(UPDATE_FUNC_ARGS);
int update_SPRK(UPDATE_FUNC_ARGS);
int update_STKM(UPDATE_FUNC_ARGS);
int update_STKM2(UPDATE_FUNC_ARGS);
int update_SWCH(UPDATE_FUNC_ARGS);
int update_THDR(UPDATE_FUNC_ARGS);
int update_THRM(UPDATE_FUNC_ARGS);
int update_URAN(UPDATE_FUNC_ARGS);
int update_VINE(UPDATE_FUNC_ARGS);
int update_WARP(UPDATE_FUNC_ARGS);
int update_WATR(UPDATE_FUNC_ARGS);
int update_WIFI(UPDATE_FUNC_ARGS);
int update_WOOD(UPDATE_FUNC_ARGS);
int update_WTRV(UPDATE_FUNC_ARGS);
int update_YEST(UPDATE_FUNC_ARGS);
int update_SOAP(UPDATE_FUNC_ARGS);
int update_O2(UPDATE_FUNC_ARGS);
int update_H2(UPDATE_FUNC_ARGS);
int update_NBHL(UPDATE_FUNC_ARGS);
int update_NWHL(UPDATE_FUNC_ARGS);
int update_MERC(UPDATE_FUNC_ARGS);
int update_PBCN(UPDATE_FUNC_ARGS);
int update_GPMP(UPDATE_FUNC_ARGS);
int update_CLST(UPDATE_FUNC_ARGS);
int update_DLAY(UPDATE_FUNC_ARGS);
int update_WIRE(UPDATE_FUNC_ARGS);
int update_GBMB(UPDATE_FUNC_ARGS);
int update_CO2(UPDATE_FUNC_ARGS);
int update_CBNW(UPDATE_FUNC_ARGS);
int update_STOR(UPDATE_FUNC_ARGS);
int update_BIZR(UPDATE_FUNC_ARGS);
int update_PVOD(UPDATE_FUNC_ARGS);
int update_CONV(UPDATE_FUNC_ARGS);
int update_CAUS(UPDATE_FUNC_ARGS);
int update_DEST(UPDATE_FUNC_ARGS);
int update_EMP(UPDATE_FUNC_ARGS);
int update_LIGH(UPDATE_FUNC_ARGS);
int update_FIGH(UPDATE_FUNC_ARGS);
int update_ELEC(UPDATE_FUNC_ARGS);
int update_ACEL(UPDATE_FUNC_ARGS);
int update_DCEL(UPDATE_FUNC_ARGS);
int update_BANG(UPDATE_FUNC_ARGS);
int update_IGNT(UPDATE_FUNC_ARGS);
int update_FRAY(UPDATE_FUNC_ARGS);
int update_REPL(UPDATE_FUNC_ARGS);
int update_TRON(UPDATE_FUNC_ARGS);
int update_TTAN(UPDATE_FUNC_ARGS);
int update_BREL(UPDATE_FUNC_ARGS);
int update_EXOT(UPDATE_FUNC_ARGS);
int update_MISC(UPDATE_FUNC_ARGS);
int update_legacy_PYRO(UPDATE_FUNC_ARGS);
int update_legacy_all(UPDATE_FUNC_ARGS);
int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS);
void STKM_init_legs(playerst* playerp, int i);
void STKM_interact(playerst* playerp, int i, int x, int y);
void PPIP_flood_trigger(int x, int y, int sparkedBy);
struct part_type
{
char *name;
pixel pcolors;
float advection;
float airdrag;
float airloss;
float loss;
float collision;
float gravity;
float diffusion;
float hotair;
int falldown;
int flammable;
int explosive;
int meltable;
int hardness;
int menu;
int enabled;
int weight;
int menusection;
float heat;
unsigned char hconduct;
char *descs;
char state;
unsigned int properties;
int (*update_func) (UPDATE_FUNC_ARGS);
int (*graphics_func) (GRAPHICS_FUNC_ARGS);
};
typedef struct part_type part_type;
struct part_transition
{
float plv; // transition occurs if pv is lower than this
int plt;
float phv; // transition occurs if pv is higher than this
int pht;
float tlv; // transition occurs if t is lower than this
int tlt;
float thv; // transition occurs if t is higher than this
int tht;
};
typedef struct part_transition part_transition;
// TODO: falldown, properties, state - should at least one of these be removed?
extern part_type ptypes[PT_NUM];
extern unsigned int platent[PT_NUM];
// temporarily define abbreviations for impossible p/t values
#define IPL -257.0f
#define IPH 257.0f
#define ITL MIN_TEMP-1
#define ITH MAX_TEMP+1
// no transition (PT_NONE means kill part)
#define NT -1
// special transition - lava ctypes etc need extra code, which is only found and run if ST is given
#define ST PT_NUM
extern part_transition ptransitions[PT_NUM];
//Old IDs for GOL types
#define GT_GOL 78
#define GT_HLIF 79
#define GT_ASIM 80
#define GT_2x2 81
#define GT_DANI 82
#define GT_AMOE 83
#define GT_MOVE 84
#define GT_PGOL 85
#define GT_DMOE 86
#define GT_34 87
#define GT_LLIF 88
#define GT_STAN 89
#define GT_SEED 134
#define GT_MAZE 135
#define GT_COAG 136
#define GT_WALL 137
#define GT_GNAR 138
#define GT_REPL 139
#define GT_MYST 140
#define GT_LOTE 142
#define GT_FRG2 143
#define GT_STAR 144
#define GT_FROG 145
#define GT_BRAN 146
//New IDs for GOL types
#define NGT_GOL 0
#define NGT_HLIF 1
#define NGT_ASIM 2
#define NGT_2x2 3
#define NGT_DANI 4
#define NGT_AMOE 5
#define NGT_MOVE 6
#define NGT_PGOL 7
#define NGT_DMOE 8
#define NGT_34 9
#define NGT_LLIF 10
#define NGT_STAN 11
#define NGT_SEED 12
#define NGT_MAZE 13
#define NGT_COAG 14
#define NGT_WALL 15
#define NGT_GNAR 16
#define NGT_REPL 17
#define NGT_MYST 18
#define NGT_LOTE 19
#define NGT_FRG2 20
#define NGT_STAR 21
#define NGT_FROG 22
#define NGT_BRAN 23
struct gol_menu
{
const char *name;
pixel colour;
int goltype;
const char *description;
};
typedef struct gol_menu gol_menu;
static gol_menu gmenu[NGOL] =
{
{"GOL", PIXPACK(0x0CAC00), 0, "Game Of Life B3/S23"},
{"HLIF", PIXPACK(0xFF0000), 1, "High Life B36/S23"},
{"ASIM", PIXPACK(0x0000FF), 2, "Assimilation B345/S4567"},
{"2x2", PIXPACK(0xFFFF00), 3, "2x2 B36/S125"},
{"DANI", PIXPACK(0x00FFFF), 4, "Day and Night B3678/S34678"},
{"AMOE", PIXPACK(0xFF00FF), 5, "Amoeba B357/S1358"},
{"MOVE", PIXPACK(0xFFFFFF), 6, "'Move' particles. Does not move things.. it is a life type B368/S245"},
{"PGOL", PIXPACK(0xE05010), 7, "Pseudo Life B357/S238"},
{"DMOE", PIXPACK(0x500000), 8, "Diamoeba B35678/S5678"},
{"34", PIXPACK(0x500050), 9, "34 B34/S34"},
{"LLIF", PIXPACK(0x505050), 10, "Long Life B345/S5"},
{"STAN", PIXPACK(0x5000FF), 11, "Stains B3678/S235678"},
{"SEED", PIXPACK(0xFBEC7D), 12, "B2/S"},
{"MAZE", PIXPACK(0xA8E4A0), 13, "B3/S12345"},
{"COAG", PIXPACK(0x9ACD32), 14, "B378/S235678"},
{"WALL", PIXPACK(0x0047AB), 15, "B45678/S2345"},
{"GNAR", PIXPACK(0xE5B73B), 16, "B1/S1"},
{"REPL", PIXPACK(0x259588), 17, "B1357/S1357"},
{"MYST", PIXPACK(0x0C3C00), 18, "B3458/S05678"},
{"LOTE", PIXPACK(0xFF0000), 19, "Behaves kinda like Living on the Edge S3458/B37/4"},
{"FRG2", PIXPACK(0x00FF00), 20, "Like Frogs rule S124/B3/3"},
{"STAR", PIXPACK(0x0000FF), 21, "Like Star Wars rule S3456/B278/6"},
{"FROG", PIXPACK(0x00AA00), 22, "Frogs S12/B34/3"},
{"BRAN", PIXPACK(0xCCCC00), 23, "Brian 6 S6/B246/3"}
};
static int grule[NGOL+1][10] =
{
// 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing
{0,0,0,0,0,0,0,0,0,2},//blank
{0,0,1,3,0,0,0,0,0,2},//GOL
{0,0,1,3,0,0,2,0,0,2},//HLIF
{0,0,0,2,3,3,1,1,0,2},//ASIM
{0,1,1,2,0,1,2,0,0,2},//2x2
{0,0,0,3,1,0,3,3,3,2},//DANI
{0,1,0,3,0,3,0,2,1,2},//AMOE
{0,0,1,2,1,1,2,0,2,2},//MOVE
{0,0,1,3,0,2,0,2,1,2},//PGOL
{0,0,0,2,0,3,3,3,3,2},//DMOE
{0,0,0,3,3,0,0,0,0,2},//34
{0,0,0,2,2,3,0,0,0,2},//LLIF
{0,0,1,3,0,1,3,3,3,2},//STAN
{0,0,2,0,0,0,0,0,0,2},//SEED
{0,1,1,3,1,1,0,0,0,2},//MAZE
{0,0,1,3,0,1,1,3,3,2},//COAG
{0,0,1,1,3,3,2,2,2,2},//WALL
{0,3,0,0,0,0,0,0,0,2},//GNAR
{0,3,0,3,0,3,0,3,0,2},//REPL
{1,0,0,2,2,3,1,1,3,2},//MYST
{0,0,0,3,1,1,0,2,1,4},//LOTE
{0,1,1,2,1,0,0,0,0,3},//FRG2
{0,0,2,1,1,1,1,2,2,6},//STAR
{0,1,1,2,2,0,0,0,0,3},//FROG
{0,0,2,0,2,0,3,0,0,3},//BRAN
};
static int goltype[NGOL] =
{
GT_GOL,
GT_HLIF,
GT_ASIM,
GT_2x2,
GT_DANI,
GT_AMOE,
GT_MOVE,
GT_PGOL,
GT_DMOE,
GT_34,
GT_LLIF,
GT_STAN,
GT_SEED,
GT_MAZE,
GT_COAG,
GT_WALL,
GT_GNAR,
GT_REPL,
GT_MYST,
GT_LOTE,
GT_FRG2,
GT_STAR,
GT_FROG,
GT_BRAN,
};
static int loverule[9][9] =
{
{0,0,1,1,0,0,0,0,0},
{0,1,0,0,1,1,0,0,0},
{1,0,0,0,0,0,1,0,0},
{1,0,0,0,0,0,0,1,0},
{0,1,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,1,0},
{1,0,0,0,0,0,1,0,0},
{0,1,0,0,1,1,0,0,0},
{0,0,1,1,0,0,0,0,0},
};
static int lolzrule[9][9] =
{
{0,0,0,0,0,0,0,0,0},
{1,0,0,0,0,0,1,0,0},
{1,0,0,0,0,0,1,0,0},
{1,0,0,1,1,0,0,1,0},
{1,0,1,0,0,1,0,1,0},
{1,0,1,0,0,1,0,1,0},
{0,1,0,1,1,0,0,1,0},
{0,1,0,0,0,0,0,1,0},
{0,1,0,0,0,0,0,1,0},
};
struct wall_type
{
pixel colour;
pixel eglow; // if emap set, add this to fire glow
int drawstyle;
const char *descs;
};
typedef struct wall_type wall_type;
static wall_type wtypes[] =
{
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 0, "Wall. Indestructible. Blocks everything. Conductive."},
{PIXPACK(0x808080), PIXPACK(0x808080), 0, "E-Wall. Becomes transparent when electricity is connected."},
{PIXPACK(0xFF8080), PIXPACK(0xFF2008), 1, "Detector. Generates electricity when a particle is inside."},
{PIXPACK(0x808080), PIXPACK(0x000000), 0, "Streamline. Set start point of a streamline."},
{PIXPACK(0x808080), PIXPACK(0x000000), 0, "Sign. Click on a sign to edit it or anywhere else to place a new one."},
{PIXPACK(0x8080FF), PIXPACK(0x000000), 1, "Fan. Accelerates air. Use line tool to set direction and strength."},
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 2, "Wall. Blocks most particles but lets liquids through. Conductive."},
{PIXPACK(0x808080), PIXPACK(0x000000), 1, "Wall. Absorbs particles but lets air currents through."},
{PIXPACK(0x808080), PIXPACK(0x000000), 0, "Erases walls."},
{PIXPACK(0x808080), PIXPACK(0x000000), 3, "Wall. Indestructible. Blocks everything."},
{PIXPACK(0x3C3C3C), PIXPACK(0x000000), 1, "Wall. Indestructible. Blocks particles, allows air"},
{PIXPACK(0x575757), PIXPACK(0x000000), 1, "Wall. Indestructible. Blocks liquids and gases, allows powders"},
{PIXPACK(0xFFFF22), PIXPACK(0x101010), 2, "Conductor, allows particles, conducts electricity"},
{PIXPACK(0x242424), PIXPACK(0x101010), 0, "E-Hole, absorbs particles, release them when powered"},
{PIXPACK(0xFFFFFF), PIXPACK(0x000000), -1, "Air, creates airflow and pressure"},
{PIXPACK(0xFFBB00), PIXPACK(0x000000), -1, "Heats the targeted element."},
{PIXPACK(0x00BBFF), PIXPACK(0x000000), -1, "Cools the targeted element."},
{PIXPACK(0x303030), PIXPACK(0x000000), -1, "Vacuum, reduces air pressure."},
{PIXPACK(0x579777), PIXPACK(0x000000), 1, "Wall. Indestructible. Blocks liquids and solids, allows gases"},
{PIXPACK(0x000000), PIXPACK(0x000000), -1, "Drag tool"},
{PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, "Gravity wall"},
{PIXPACK(0x0000BB), PIXPACK(0x000000), -1, "Positive gravity tool."},
{PIXPACK(0x000099), PIXPACK(0x000000), -1, "Negative gravity tool."},
{PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, "Energy wall, allows only energy type particles to pass"},
{PIXPACK(0xFFAA00), PIXPACK(0xAA5500), -1, "Property edit tool"},
};
#define CHANNELS ((int)(MAX_TEMP-73)/100+2)
particle portalp[CHANNELS][8][80];
const particle emptyparticle;
int wireless[CHANNELS][2];
extern int portal_rx[8];
extern int portal_ry[8];
extern int wire_placed;
extern int force_stacking_check;
extern int ppip_changed;
extern playerst player;
extern playerst player2;
extern playerst fighters[256];
extern unsigned char fighcount;
extern int airMode;
extern particle *parts;
extern particle *cb_parts;
extern int parts_lastActiveIndex;
extern unsigned char bmap[YRES/CELL][XRES/CELL];
extern unsigned char emap[YRES/CELL][XRES/CELL];
extern unsigned char cb_bmap[YRES/CELL][XRES/CELL];
extern unsigned char cb_emap[YRES/CELL][XRES/CELL];
extern int pfree;
extern unsigned pmap[YRES][XRES];
unsigned cb_pmap[YRES][XRES];
unsigned photons[YRES][XRES];
int do_move(int i, int x, int y, float nxf, float nyf);
int try_move(int i, int x, int y, int nx, int ny);
int eval_move(int pt, int nx, int ny, unsigned *rr);
void init_can_move();
static void create_cherenkov_photon(int pp);
static void create_gain_photon(int pp);
void kill_part(int i);
int flood_prop(int x, int y, size_t propoffset, void * propvalue, int proptype);
void detach(int i);
void part_change_type(int i, int x, int y, int t);
void get_gravity_field(int x, int y, float particleGrav, float newtonGrav, float *pGravX, float *pGravY);
int InCurrentBrush(int i, int j, int rx, int ry);
int get_brush_flags();
int create_part(int p, int x, int y, int t);
void delete_part(int x, int y, int flags);
int is_wire(int x, int y);
int is_wire_off(int x, int y);
void set_emap(int x, int y);
int parts_avg(int ci, int ni, int t);
void create_arc(int sx, int sy, int dx, int dy, int midpoints, int variance, int type, int flags);
int nearest_part(int ci, int t, int max_d);
void update_particles_i(pixel *vid, int start, int inc);
void update_particles(pixel *vid);
void rotate_area(int area_x, int area_y, int area_w, int area_h, int invert);
void clear_area(int area_x, int area_y, int area_w, int area_h);
void create_box(int x1, int y1, int x2, int y2, int c, int flags);
int flood_parts(int x, int y, int c, int cm, int bm, int flags);
int flood_INST(int x, int y, int fullc, int cm);
int create_parts(int x, int y, int rx, int ry, int c, int flags, int fill);
void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags);
void orbitalparts_get(int block1, int block2, int resblock1[], int resblock2[]);
void orbitalparts_set(int *block1, int *block2, int resblock1[], int resblock2[]);
#endif

View File

@@ -1,70 +0,0 @@
/**
* Powder Toy - particle graphics header
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PGRAPHICS_H
#define PGRAPHICS_H
#define PMODE 0x00000FFF
#define PMODE_NONE 0x00000000
#define PMODE_FLAT 0x00000001
#define PMODE_BLOB 0x00000002
#define PMODE_BLUR 0x00000004
#define PMODE_GLOW 0x00000008
#define PMODE_SPARK 0x00000010
#define PMODE_FLARE 0x00000020
#define PMODE_LFLARE 0x00000040
#define PMODE_ADD 0x00000080
#define PMODE_BLEND 0x00000100
#define PSPEC_STICKMAN 0x00000200
#define OPTIONS 0x0000F000
#define NO_DECO 0x00001000
#define DECO_FIRE 0x00002000
#define FIREMODE 0x00FF0000
#define FIRE_ADD 0x00010000
#define FIRE_BLEND 0x00020000
#define EFFECT 0xFF000000
#define EFFECT_GRAVIN 0x01000000
#define EFFECT_GRAVOUT 0x02000000
#define EFFECT_LINES 0x04000000
#define RENDER_EFFE OPTIONS | PSPEC_STICKMAN | EFFECT | PMODE_SPARK | PMODE_FLARE | PMODE_LFLARE
#define RENDER_FIRE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | FIREMODE
#define RENDER_GLOW OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_GLOW | PMODE_ADD | PMODE_BLEND
#define RENDER_BLUR OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_BLUR | PMODE_ADD | PMODE_BLEND
#define RENDER_BLOB OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_BLOB | PMODE_ADD | PMODE_BLEND
#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND
#define RENDER_NONE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT
#define COLOUR_HEAT 0x00000001
#define COLOUR_LIFE 0x00000002
#define COLOUR_GRAD 0x00000004
#define COLOUR_BASC 0x00000008
#define COLOUR_DEFAULT 0x00000000
#define DISPLAY_AIRC 0x00000001
#define DISPLAY_AIRP 0x00000002
#define DISPLAY_AIRV 0x00000004
#define DISPLAY_AIRH 0x00000008
#define DISPLAY_AIR 0x0000000F
#define DISPLAY_WARP 0x00000010
#define DISPLAY_PERS 0x00000020
#define DISPLAY_EFFE 0x00000040
#endif

View File

@@ -1,41 +0,0 @@
/**
* Powder Toy - saving and loading functions header
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SAVE_H
#define SAVE_H
void *transform_save(void *odata, int *size, matrix2d transform, vector2d translate);
void *build_thumb(int *size, int bzip2);
pixel *prerender_save(void *save, int size, int *width, int *height);
void *build_save(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h, unsigned char bmap[YRES/CELL][XRES/CELL], float vx[YRES/CELL][XRES/CELL], float vy[YRES/CELL][XRES/CELL], float pv[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr);
int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float vx[YRES/CELL][XRES/CELL], float vy[YRES/CELL][XRES/CELL], float pv[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]);
pixel *prerender_save_OPS(void *save, int size, int *width, int *height);
void *build_save_OPS(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h, unsigned char bmap[YRES/CELL][XRES/CELL], float vx[YRES/CELL][XRES/CELL], float vy[YRES/CELL][XRES/CELL], float pv[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr);
int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float vx[YRES/CELL][XRES/CELL], float vy[YRES/CELL][XRES/CELL], float pv[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]);
//Old save parsers, readers
pixel *prerender_save_PSv(void *save, int size, int *width, int *height);
int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]);
#endif

View File

@@ -1,25 +0,0 @@
/**
* Powder Toy - Update Helper (header)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UPDATE_H
#define UPDATE_H
char *exe_name(void);
int update_start(char *data, int len);
int update_finish(void);
void update_cleanup(void);
#endif

1122
src/BSON.c

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1,4 +0,0 @@
#define IDI_ICON1 101
#define IDI_ICON2 102
IDI_ICON1 ICON DISCARDABLE "powder.ico"
IDI_ICON2 ICON DISCARDABLE "document.ico"

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,416 +0,0 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#include <SDL/SDL.h>
#include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h>
#include "defines.h"
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
const NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface NSApplication (SDLApplication)
@end
@implementation NSApplication (SDLApplication)
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
chdir(parentdir); /* chdir to the binary app's parent */
}
CFRelease(url);
CFRelease(url2);
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
}
#else
static void setApplicationMenu(void)
{
/* warning: this code is very odd */
NSMenu *appleMenu;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
appName = getApplicationName();
appleMenu = [[NSMenu alloc] initWithTitle:@""];
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
}
/* Create a window menu */
static void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
static void CustomApplicationMain (int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[NSApplication sharedApplication];
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[NSApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Start the main event loop */
[NSApp run];
[sdlMain release];
[pool release];
}
#endif
void *file_load(char *fn, int *size);
/*
* Catch document open requests...this lets us notice files when the app
* was launched by double-clicking a document, or when a document was
* dragged/dropped on the app's icon. You need to have a
* CFBundleDocumentsType section in your Info.plist to get this message,
* apparently.
*
* Files are added to gArgv, so to the app, they'll look like command line
* arguments. Previously, apps launched from the finder had nothing but
* an argv[0].
*
* This message may be received multiple times to open several docs on launch.
*
* This message is ignored once the app's mainline has been called.
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
/*const char *temparg;
size_t arglen;
char *arg;
char **newargv;
if (!gFinderLaunch)
return FALSE;
if (gCalledAppMainline)
return FALSE;
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 3));
if (newargv == NULL)
{
SDL_free(arg);
return FALSE;
}
gArgv = newargv;
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = "open";
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
return TRUE;*/
const char * tempArg;
char * arg;
size_t argLen;
tempArg = [filename UTF8String];
argLen = SDL_strlen(tempArg)+1;
arg = (char *) SDL_malloc(argLen);
if (arg == NULL)
return FALSE;
SDL_strlcpy(arg, tempArg, argLen);
saveDataOpen = file_load(arg, &saveDataOpenSize);
if(saveDataOpen)
return TRUE;
saveDataOpen = NULL;
saveDataOpenSize = 0;
return FALSE;
}
- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
int tempSaveOpen = [[url host] intValue];
if(tempSaveOpen > 0)
saveURIOpen = tempSaveOpen;
}
-(void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
}
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */
gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
NSDeallocateMemoryPages(buffer, bufferSize);
return result;
}
@end
#ifdef main
# undef main
#endif
/* Main entry point to executable - should *not* be SDL_main! */
int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
} else {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}

306
src/air.c
View File

@@ -1,306 +0,0 @@
/**
* Powder Toy - air simulation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <math.h>
#include <air.h>
#include <powder.h>
#include <defines.h>
#include "gravity.h"
float kernel[9];
float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL];
float pv[YRES/CELL][XRES/CELL], opv[YRES/CELL][XRES/CELL];
unsigned char bmap_blockair[YRES/CELL][XRES/CELL];
unsigned char bmap_blockairh[YRES/CELL][XRES/CELL];
float cb_vx[YRES/CELL][XRES/CELL];
float cb_vy[YRES/CELL][XRES/CELL];
float cb_pv[YRES/CELL][XRES/CELL];
float cb_hv[YRES/CELL][XRES/CELL];
float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL];
float hv[YRES/CELL][XRES/CELL], ohv[YRES/CELL][XRES/CELL]; // For Ambient Heat
void make_kernel(void) //used for velocity
{
int i, j;
float s = 0.0f;
for (j=-1; j<2; j++)
for (i=-1; i<2; i++)
{
kernel[(i+1)+3*(j+1)] = expf(-2.0f*(i*i+j*j));
s += kernel[(i+1)+3*(j+1)];
}
s = 1.0f / s;
for (j=-1; j<2; j++)
for (i=-1; i<2; i++)
kernel[(i+1)+3*(j+1)] *= s;
}
void update_airh(void)
{
int x, y, i, j;
float odh, dh, dx, dy, f, tx, ty;
for (i=0; i<YRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
hv[i][0] = 295.15f;
hv[i][1] = 295.15f;
hv[i][XRES/CELL-3] = 295.15f;
hv[i][XRES/CELL-2] = 295.15f;
hv[i][XRES/CELL-1] = 295.15f;
}
for (i=0; i<XRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
hv[0][i] = 295.15f;
hv[1][i] = 295.15f;
hv[YRES/CELL-3][i] = 295.15f;
hv[YRES/CELL-2][i] = 295.15f;
hv[YRES/CELL-1][i] = 295.15f;
}
for (y=0; y<YRES/CELL; y++) //update velocity and pressure
{
for (x=0; x<XRES/CELL; x++)
{
dh = 0.0f;
dx = 0.0f;
dy = 0.0f;
for (j=-1; j<2; j++)
{
for (i=-1; i<2; i++)
{
if (y+j>0 && y+j<YRES/CELL-2 &&
x+i>0 && x+i<XRES/CELL-2 &&
!bmap_blockairh[y+j][x+i])
{
f = kernel[i+1+(j+1)*3];
dh += hv[y+j][x+i]*f;
dx += vx[y+j][x+i]*f;
dy += vy[y+j][x+i]*f;
}
else
{
f = kernel[i+1+(j+1)*3];
dh += hv[y][x]*f;
dx += vx[y][x]*f;
dy += vy[y][x]*f;
}
}
}
tx = x - dx*0.7f;
ty = y - dy*0.7f;
i = (int)tx;
j = (int)ty;
tx -= i;
ty -= j;
if (i>=2 && i<XRES/CELL-3 && j>=2 && j<YRES/CELL-3)
{
odh = dh;
dh *= 1.0f - AIR_VADV;
dh += AIR_VADV*(1.0f-tx)*(1.0f-ty)*(bmap_blockairh[j][i] ? odh : hv[j][i]);
dh += AIR_VADV*tx*(1.0f-ty)*(bmap_blockairh[j][i+1] ? odh : hv[j][i+1]);
dh += AIR_VADV*(1.0f-tx)*ty*(bmap_blockairh[j+1][i] ? odh : hv[j+1][i]);
dh += AIR_VADV*tx*ty*(bmap_blockairh[j+1][i+1] ? odh : hv[j+1][i+1]);
}
pv[y][x] += (dh-hv[y][x])/5000.0f;
if(!gravityMode){ //Vertical gravity only for the time being
float airdiff = hv[y-1][x]-hv[y][x];
if(airdiff>0 && !bmap_blockairh[y-1][x])
vy[y][x] -= airdiff/5000.0f;
}
ohv[y][x] = dh;
}
}
memcpy(hv, ohv, sizeof(hv));
}
void update_air(void)
{
int x, y, i, j;
float dp, dx, dy, f, tx, ty;
if (airMode != 4) { //airMode 4 is no air/pressure update
for (i=0; i<YRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
pv[i][0] = pv[i][0]*0.8f;
pv[i][1] = pv[i][1]*0.8f;
pv[i][2] = pv[i][2]*0.8f;
pv[i][XRES/CELL-2] = pv[i][XRES/CELL-2]*0.8f;
pv[i][XRES/CELL-1] = pv[i][XRES/CELL-1]*0.8f;
vx[i][0] = vx[i][1]*0.9f;
vx[i][1] = vx[i][2]*0.9f;
vx[i][XRES/CELL-2] = vx[i][XRES/CELL-3]*0.9f;
vx[i][XRES/CELL-1] = vx[i][XRES/CELL-2]*0.9f;
vy[i][0] = vy[i][1]*0.9f;
vy[i][1] = vy[i][2]*0.9f;
vy[i][XRES/CELL-2] = vy[i][XRES/CELL-3]*0.9f;
vy[i][XRES/CELL-1] = vy[i][XRES/CELL-2]*0.9f;
}
for (i=0; i<XRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
pv[0][i] = pv[0][i]*0.8f;
pv[1][i] = pv[1][i]*0.8f;
pv[2][i] = pv[2][i]*0.8f;
pv[YRES/CELL-2][i] = pv[YRES/CELL-2][i]*0.8f;
pv[YRES/CELL-1][i] = pv[YRES/CELL-1][i]*0.8f;
vx[0][i] = vx[1][i]*0.9f;
vx[1][i] = vx[2][i]*0.9f;
vx[YRES/CELL-2][i] = vx[YRES/CELL-3][i]*0.9f;
vx[YRES/CELL-1][i] = vx[YRES/CELL-2][i]*0.9f;
vy[0][i] = vy[1][i]*0.9f;
vy[1][i] = vy[2][i]*0.9f;
vy[YRES/CELL-2][i] = vy[YRES/CELL-3][i]*0.9f;
vy[YRES/CELL-1][i] = vy[YRES/CELL-2][i]*0.9f;
}
for (j=1; j<YRES/CELL; j++) //clear some velocities near walls
{
for (i=1; i<XRES/CELL; i++)
{
if (bmap_blockair[j][i])
{
vx[j][i] = 0.0f;
vx[j][i-1] = 0.0f;
vy[j][i] = 0.0f;
vy[j-1][i] = 0.0f;
}
}
}
for (y=1; y<YRES/CELL; y++) //pressure adjustments from velocity
for (x=1; x<XRES/CELL; x++)
{
dp = 0.0f;
dp += vx[y][x-1] - vx[y][x];
dp += vy[y-1][x] - vy[y][x];
pv[y][x] *= AIR_PLOSS;
pv[y][x] += dp*AIR_TSTEPP;
}
for (y=0; y<YRES/CELL-1; y++) //velocity adjustments from pressure
for (x=0; x<XRES/CELL-1; x++)
{
dx = dy = 0.0f;
dx += pv[y][x] - pv[y][x+1];
dy += pv[y][x] - pv[y+1][x];
vx[y][x] *= AIR_VLOSS;
vy[y][x] *= AIR_VLOSS;
vx[y][x] += dx*AIR_TSTEPV;
vy[y][x] += dy*AIR_TSTEPV;
if (bmap_blockair[y][x] || bmap_blockair[y][x+1])
vx[y][x] = 0;
if (bmap_blockair[y][x] || bmap_blockair[y+1][x])
vy[y][x] = 0;
}
for (y=0; y<YRES/CELL; y++) //update velocity and pressure
for (x=0; x<XRES/CELL; x++)
{
dx = 0.0f;
dy = 0.0f;
dp = 0.0f;
for (j=-1; j<2; j++)
for (i=-1; i<2; i++)
if (y+j>0 && y+j<YRES/CELL-1 &&
x+i>0 && x+i<XRES/CELL-1 &&
!bmap_blockair[y+j][x+i])
{
f = kernel[i+1+(j+1)*3];
dx += vx[y+j][x+i]*f;
dy += vy[y+j][x+i]*f;
dp += pv[y+j][x+i]*f;
}
else
{
f = kernel[i+1+(j+1)*3];
dx += vx[y][x]*f;
dy += vy[y][x]*f;
dp += pv[y][x]*f;
}
tx = x - dx*0.7f;
ty = y - dy*0.7f;
i = (int)tx;
j = (int)ty;
tx -= i;
ty -= j;
if (i>=2 && i<XRES/CELL-3 &&
j>=2 && j<YRES/CELL-3)
{
dx *= 1.0f - AIR_VADV;
dy *= 1.0f - AIR_VADV;
dx += AIR_VADV*(1.0f-tx)*(1.0f-ty)*vx[j][i];
dy += AIR_VADV*(1.0f-tx)*(1.0f-ty)*vy[j][i];
dx += AIR_VADV*tx*(1.0f-ty)*vx[j][i+1];
dy += AIR_VADV*tx*(1.0f-ty)*vy[j][i+1];
dx += AIR_VADV*(1.0f-tx)*ty*vx[j+1][i];
dy += AIR_VADV*(1.0f-tx)*ty*vy[j+1][i];
dx += AIR_VADV*tx*ty*vx[j+1][i+1];
dy += AIR_VADV*tx*ty*vy[j+1][i+1];
}
if (bmap[y][x] == WL_FAN)
{
dx += fvx[y][x];
dy += fvy[y][x];
}
// pressure/velocity caps
if (dp > 256.0f) dp = 256.0f;
if (dp < -256.0f) dp = -256.0f;
if (dx > 256.0f) dx = 256.0f;
if (dx < -256.0f) dx = -256.0f;
if (dy > 256.0f) dy = 256.0f;
if (dy < -256.0f) dy = -256.0f;
switch (airMode)
{
default:
case 0: //Default
break;
case 1: //0 Pressure
dp = 0.0f;
break;
case 2: //0 Velocity
dx = 0.0f;
dy = 0.0f;
break;
case 3: //0 Air
dx = 0.0f;
dy = 0.0f;
dp = 0.0f;
break;
case 4: //No Update
break;
}
ovx[y][x] = dx;
ovy[y][x] = dy;
opv[y][x] = dp;
}
memcpy(vx, ovx, sizeof(vx));
memcpy(vy, ovy, sizeof(vy));
memcpy(pv, opv, sizeof(pv));
}
}

View File

@@ -1,502 +0,0 @@
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* cJSON */
/* JSON parser in C. */
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <limits.h>
#include <ctype.h>
#include "cJSON.h"
static const char *ep;
const char *cJSON_GetErrorPtr() {return ep;}
static int cJSON_strcasecmp(const char *s1,const char *s2)
{
if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0;
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
}
static void *(*cJSON_malloc)(size_t sz) = malloc;
static void (*cJSON_free)(void *ptr) = free;
static char* cJSON_strdup(const char* str)
{
size_t len;
char* copy;
len = strlen(str) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copy,str,len);
return copy;
}
void cJSON_InitHooks(cJSON_Hooks* hooks)
{
if (!hooks) { /* Reset hooks */
cJSON_malloc = malloc;
cJSON_free = free;
return;
}
cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc;
cJSON_free = (hooks->free_fn)?hooks->free_fn:free;
}
/* Internal constructor. */
static cJSON *cJSON_New_Item()
{
cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON));
if (node) memset(node,0,sizeof(cJSON));
return node;
}
/* Delete a cJSON structure. */
void cJSON_Delete(cJSON *c)
{
cJSON *next;
while (c)
{
next=c->next;
if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
if (c->string) cJSON_free(c->string);
cJSON_free(c);
c=next;
}
}
/* Parse the input text to generate a number, and populate the result into item. */
static const char *parse_number(cJSON *item,const char *num)
{
double n=0,sign=1,scale=0;int subscale=0,signsubscale=1;
/* Could use sscanf for this? */
if (*num=='-') sign=-1,num++; /* Has sign? */
if (*num=='0') num++; /* is zero */
if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); /* Number? */
if (*num=='.') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} /* Fractional part? */
if (*num=='e' || *num=='E') /* Exponent? */
{ num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; /* With sign? */
while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); /* Number? */
}
n=sign*n*pow(10.0,(scale+subscale*signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */
item->valuedouble=n;
item->valueint=(int)n;
item->type=cJSON_Number;
return num;
}
/* Render the number nicely from the given item into a string. */
static char *print_number(cJSON *item)
{
char *str;
double d=item->valuedouble;
if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN)
{
str=(char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */
if (str) sprintf(str,"%d",item->valueint);
}
else
{
str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */
if (str)
{
if (fabs(floor(d)-d)<=DBL_EPSILON) sprintf(str,"%.0f",d);
else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d);
else sprintf(str,"%f",d);
}
}
return str;
}
/* Parse the input text into an unescaped cstring, and populate item. */
static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
static const char *parse_string(cJSON *item,const char *str)
{
const char *ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc;
if (*str!='\"') {ep=str;return 0;} /* not a string! */
while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */
out=(char*)cJSON_malloc(len+1); /* This is how long we need for the string, roughly. */
if (!out) return 0;
ptr=str+1;ptr2=out;
while (*ptr!='\"' && *ptr)
{
if (*ptr!='\\') *ptr2++=*ptr++;
else
{
ptr++;
switch (*ptr)
{
case 'b': *ptr2++='\b'; break;
case 'f': *ptr2++='\f'; break;
case 'n': *ptr2++='\n'; break;
case 'r': *ptr2++='\r'; break;
case 't': *ptr2++='\t'; break;
case 'u': /* transcode utf16 to utf8. DOES NOT SUPPORT SURROGATE PAIRS CORRECTLY. */
sscanf(ptr+1,"%4x",&uc); /* get the unicode char. */
len=3;if (uc<0x80) len=1;else if (uc<0x800) len=2;ptr2+=len;
switch (len) {
case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
case 1: *--ptr2 =(uc | firstByteMark[len]);
}
ptr2+=len;ptr+=4;
break;
default: *ptr2++=*ptr; break;
}
ptr++;
}
}
*ptr2=0;
if (*ptr=='\"') ptr++;
item->valuestring=out;
item->type=cJSON_String;
return ptr;
}
/* Render the cstring provided to an escaped version that can be printed. */
static char *print_string_ptr(const char *str)
{
const char *ptr;char *ptr2,*out;int len=0;unsigned char token;
if (!str) return cJSON_strdup("");
ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;}
out=(char*)cJSON_malloc(len+3);
if (!out) return 0;
ptr2=out;ptr=str;
*ptr2++='\"';
while (*ptr)
{
if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++;
else
{
*ptr2++='\\';
switch (token=*ptr++)
{
case '\\': *ptr2++='\\'; break;
case '\"': *ptr2++='\"'; break;
case '\b': *ptr2++='b'; break;
case '\f': *ptr2++='f'; break;
case '\n': *ptr2++='n'; break;
case '\r': *ptr2++='r'; break;
case '\t': *ptr2++='t'; break;
default: sprintf(ptr2,"u%04x",token);ptr2+=5; break; /* escape and print */
}
}
}
*ptr2++='\"';*ptr2++=0;
return out;
}
/* Invote print_string_ptr (which is useful) on an item. */
static char *print_string(cJSON *item) {return print_string_ptr(item->valuestring);}
/* Predeclare these prototypes. */
static const char *parse_value(cJSON *item,const char *value);
static char *print_value(cJSON *item,int depth,int fmt);
static const char *parse_array(cJSON *item,const char *value);
static char *print_array(cJSON *item,int depth,int fmt);
static const char *parse_object(cJSON *item,const char *value);
static char *print_object(cJSON *item,int depth,int fmt);
/* Utility to jump whitespace and cr/lf */
static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;}
/* Parse an object - create a new root, and populate. */
cJSON *cJSON_Parse(const char *value)
{
cJSON *c=cJSON_New_Item();
ep=0;
if (!c) return 0; /* memory fail */
if (!parse_value(c,skip(value))) {cJSON_Delete(c);return 0;}
return c;
}
/* Render a cJSON item/entity/structure to text. */
char *cJSON_Print(cJSON *item) {return print_value(item,0,1);}
char *cJSON_PrintUnformatted(cJSON *item) {return print_value(item,0,0);}
/* Parser core - when encountering text, process appropriately. */
static const char *parse_value(cJSON *item,const char *value)
{
if (!value) return 0; /* Fail on null. */
if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; }
if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; }
if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; }
if (*value=='\"') { return parse_string(item,value); }
if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); }
if (*value=='[') { return parse_array(item,value); }
if (*value=='{') { return parse_object(item,value); }
ep=value;return 0; /* failure. */
}
/* Render a value to text. */
static char *print_value(cJSON *item,int depth,int fmt)
{
char *out=0;
if (!item) return 0;
switch ((item->type)&255)
{
case cJSON_NULL: out=cJSON_strdup("null"); break;
case cJSON_False: out=cJSON_strdup("false");break;
case cJSON_True: out=cJSON_strdup("true"); break;
case cJSON_Number: out=print_number(item);break;
case cJSON_String: out=print_string(item);break;
case cJSON_Array: out=print_array(item,depth,fmt);break;
case cJSON_Object: out=print_object(item,depth,fmt);break;
}
return out;
}
/* Build an array from input text. */
static const char *parse_array(cJSON *item,const char *value)
{
cJSON *child;
if (*value!='[') {ep=value;return 0;} /* not an array! */
item->type=cJSON_Array;
value=skip(value+1);
if (*value==']') return value+1; /* empty array. */
item->child=child=cJSON_New_Item();
if (!item->child) return 0; /* memory fail */
value=skip(parse_value(child,skip(value))); /* skip any spacing, get the value. */
if (!value) return 0;
while (*value==',')
{
cJSON *new_item;
if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */
child->next=new_item;new_item->prev=child;child=new_item;
value=skip(parse_value(child,skip(value+1)));
if (!value) return 0; /* memory fail */
}
if (*value==']') return value+1; /* end of array */
ep=value;return 0; /* malformed. */
}
/* Render an array to text */
static char *print_array(cJSON *item,int depth,int fmt)
{
char **entries;
char *out=0,*ptr,*ret;int len=5;
cJSON *child=item->child;
int numentries=0,i=0,fail=0;
/* How many entries in the array? */
while (child) numentries++,child=child->next;
/* Allocate an array to hold the values for each */
entries=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!entries) return 0;
memset(entries,0,numentries*sizeof(char*));
/* Retrieve all the results: */
child=item->child;
while (child && !fail)
{
ret=print_value(child,depth+1,fmt);
entries[i++]=ret;
if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1;
child=child->next;
}
/* If we didn't fail, try to malloc the output string */
if (!fail) out=(char*)cJSON_malloc(len);
/* If that fails, we fail. */
if (!out) fail=1;
/* Handle failure. */
if (fail)
{
for (i=0;i<numentries;i++) if (entries[i]) cJSON_free(entries[i]);
cJSON_free(entries);
return 0;
}
/* Compose the output array. */
*out='[';
ptr=out+1;*ptr=0;
for (i=0;i<numentries;i++)
{
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
if (i!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;}
cJSON_free(entries[i]);
}
cJSON_free(entries);
*ptr++=']';*ptr++=0;
return out;
}
/* Build an object from the text. */
static const char *parse_object(cJSON *item,const char *value)
{
cJSON *child;
if (*value!='{') {ep=value;return 0;} /* not an object! */
item->type=cJSON_Object;
value=skip(value+1);
if (*value=='}') return value+1; /* empty array. */
item->child=child=cJSON_New_Item();
if (!item->child) return 0;
value=skip(parse_string(child,skip(value)));
if (!value) return 0;
child->string=child->valuestring;child->valuestring=0;
if (*value!=':') {ep=value;return 0;} /* fail! */
value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */
if (!value) return 0;
while (*value==',')
{
cJSON *new_item;
if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */
child->next=new_item;new_item->prev=child;child=new_item;
value=skip(parse_string(child,skip(value+1)));
if (!value) return 0;
child->string=child->valuestring;child->valuestring=0;
if (*value!=':') {ep=value;return 0;} /* fail! */
value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */
if (!value) return 0;
}
if (*value=='}') return value+1; /* end of array */
ep=value;return 0; /* malformed. */
}
/* Render an object to text. */
static char *print_object(cJSON *item,int depth,int fmt)
{
char **entries=0,**names=0;
char *out=0,*ptr,*ret,*str;int len=7,i=0,j;
cJSON *child=item->child;
int numentries=0,fail=0;
/* Count the number of entries. */
while (child) numentries++,child=child->next;
/* Allocate space for the names and the objects */
entries=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!entries) return 0;
names=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!names) {cJSON_free(entries);return 0;}
memset(entries,0,sizeof(char*)*numentries);
memset(names,0,sizeof(char*)*numentries);
/* Collect all the results into our arrays: */
child=item->child;depth++;if (fmt) len+=depth;
while (child)
{
names[i]=str=print_string_ptr(child->string);
entries[i++]=ret=print_value(child,depth,fmt);
if (str && ret) len+=strlen(ret)+strlen(str)+2+(fmt?2+depth:0); else fail=1;
child=child->next;
}
/* Try to allocate the output string */
if (!fail) out=(char*)cJSON_malloc(len);
if (!out) fail=1;
/* Handle failure */
if (fail)
{
for (i=0;i<numentries;i++) {if (names[i]) cJSON_free(names[i]);if (entries[i]) cJSON_free(entries[i]);}
cJSON_free(names);cJSON_free(entries);
return 0;
}
/* Compose the output: */
*out='{';ptr=out+1;if (fmt)*ptr++='\n';*ptr=0;
for (i=0;i<numentries;i++)
{
if (fmt) for (j=0;j<depth;j++) *ptr++='\t';
strcpy(ptr,names[i]);ptr+=strlen(names[i]);
*ptr++=':';if (fmt) *ptr++='\t';
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
if (i!=numentries-1) *ptr++=',';
if (fmt) *ptr++='\n';*ptr=0;
cJSON_free(names[i]);cJSON_free(entries[i]);
}
cJSON_free(names);cJSON_free(entries);
if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t';
*ptr++='}';*ptr++=0;
return out;
}
/* Get Array size/item / object item. */
int cJSON_GetArraySize(cJSON *array) {cJSON *c=array->child;int i=0;while(c)i++,c=c->next;return i;}
cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array->child; while (c && item>0) item--,c=c->next; return c;}
cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object->child; while (c && cJSON_strcasecmp(c->string,string)) c=c->next; return c;}
/* Utility for array list handling. */
static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;}
/* Utility for handling references. */
static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;}
/* Add item to array/object. */
void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}}
void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);}
void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;
if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;}
void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;}
void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
/* Replace array/object items with new ones. */
void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return;
newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem;
if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);}
void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}}
/* Create basic types: */
cJSON *cJSON_CreateNull() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;}
cJSON *cJSON_CreateTrue() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;}
cJSON *cJSON_CreateFalse() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;}
cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;}
cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;}
cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;}
cJSON *cJSON_CreateArray() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;}
cJSON *cJSON_CreateObject() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
/* Create Arrays: */
cJSON *cJSON_CreateIntArray(int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateFloatArray(float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateDoubleArray(double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateString(strings[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}

View File

@@ -1,638 +0,0 @@
/**
* Powder Toy - simple console
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <powder.h>
#include <console.h>
#include <math.h>
#ifdef PYCONSOLE
#include <pythonconsole.h>
#endif
char console_more=0;
char console_error[255] = "";
int file_script = 0;
//takes a a string and compares it to element names, and puts it value into element.
int console_parse_type(char *txt, int *element, char *err)
{
int i = -1;
// alternative names for some elements
if (strcasecmp(txt,"C4")==0) i = PT_PLEX;
else if (strcasecmp(txt,"C5")==0) i = PT_C5;
else if (strcasecmp(txt,"NONE")==0) i = PT_NONE;
if (i>=0 && i<PT_NUM && ptypes[i].enabled)
{
if (element) *element = i;
if (err) strcpy(err,"");
return 1;
}
for (i=1; i<PT_NUM; i++) {
if (strcasecmp(txt,ptypes[i].name)==0 && ptypes[i].enabled)
{
if (element) *element = i;
if (err) strcpy(err,"");
return 1;
}
}
if (err) strcpy(err, "Particle type not recognised");
return 0;
}
//takes a string of coords "x,y" and puts the values into x and y.
int console_parse_coords(char *txt, int *x, int *y, char *err)
{
int nx = -1, ny = -1;
if (sscanf(txt,"%d,%d",&nx,&ny)!=2 || nx<0 || nx>=XRES || ny<0 || ny>=YRES)
{
if (err) strcpy(err,"Invalid coordinates");
return 0;
}
*x = nx;
*y = ny;
return 1;
}
//takes a string of either coords or a particle number, and puts the particle number into *which
int console_parse_partref(char *txt, int *which, char *err)
{
int i = -1, nx, ny;
if (err) strcpy(err,"");
if (strchr(txt,',') && console_parse_coords(txt, &nx, &ny, err))
{
i = pmap[ny][nx];
if (!i)
i = -1;
else
i = i>>8;
}
else if (txt)
{
char *num = (char*)malloc(strlen(txt)+3);
i = atoi(txt);
sprintf(num,"%d",i);
if (!txt || strcmp(txt,num)!=0)
i = -1;
free(num);
}
if (i>=0 && i<NPART && parts[i].type)
{
*which = i;
if (err) strcpy(err,"");
return 1;
}
if (err && strcmp(err,"")==0) strcpy(err,"Particle does not exist");
return 0;
}
int process_command_old(pixel *vid_buf, char *console, char *console_error)
{
int y,x,nx,ny,i,j,k,m;
float f;
int do_next = 1;
char xcoord[10] = "";
char ycoord[10] = "";
char console2[15] = "";
char console3[15] = "";
char console4[15] = "";
char console5[15] = "";
//sprintf(console_error, "%s", console);
if (console && strcmp(console, "")!=0 && strncmp(console, " ", 1)!=0)
{
sscanf(console,"%14s %14s %14s %14s", console2, console3, console4, console5);//why didn't i know about this function?!
if (strcmp(console2, "quit")==0)
{
return -1;
}
else if (strcmp(console2, "file")==0 && console3[0])
{
if (file_script) {
int filesize;
char *fileread = file_load(console3, &filesize);
nx = 0;
ny = 0;
if (console4[0] && !console_parse_coords(console4, &nx , &ny, console_error))
{
free(fileread);
return 1;
}
if (fileread)
{
char pch[501];
char tokens[31];
int tokensize;
j = 0; // line start position in fileread
m = 0; // token start position in fileread
memset(pch,0,sizeof(pch));
for (i=0; i<filesize; i++)
{
if (fileread[i] != '\n' && i-m<30)
{
pch[i-j] = fileread[i];
if (fileread[i] != ' ')
tokens[i-m] = fileread[i];
}
if ((fileread[i] == ' ' || fileread[i] == '\n') && i-j<400)
{
if (sregexp(tokens,"^x.\\{0,1\\}[0-9]*,y.\\{0,1\\}[0-9]*")==0)
{
int starty = 0;
tokensize = strlen(tokens);
x = 0;
y = 0;
if (tokens[1]!=',')
sscanf(tokens,"x%d,y%d",&x,&y);
else
sscanf(tokens,"x,y%d",&y);
x += nx;
y += ny;
sprintf(xcoord,"%d",x);
sprintf(ycoord,"%d",y);
for (k = 0; k<strlen(xcoord); k++)//rewrite pch with numbers
{
pch[i-j-tokensize+k] = xcoord[k];
starty = k+1;
}
pch[i-j-tokensize+starty] = ',';
starty++;
for (k=0; k<strlen(ycoord); k++)
{
pch[i-j-tokensize+starty+k] = ycoord[k];
}
pch[i-j-tokensize +strlen(xcoord) +1 +strlen(ycoord)] = ' ';
j = j -tokensize +strlen(xcoord) +1 +strlen(ycoord);
}
memset(tokens,0,sizeof(tokens));
m = i+1;
}
if (fileread[i] == '\n')
{
if (do_next)
{
if (strcmp(pch,"else")==0)
do_next = 0;
else
do_next = process_command_old(vid_buf, pch, console_error);
}
else if (strcmp(pch,"endif")==0 || strcmp(pch,"else")==0)
do_next = 1;
memset(pch,0,sizeof(pch));
j = i+1;
}
}
free(fileread);
}
else
{
sprintf(console_error, "%s does not exist", console3);
}
}
else
{
sprintf(console_error, "Scripts are not enabled");
}
}
else if (strcmp(console2, "sound")==0 && console3[0])
{
if (sound_enable) play_sound(console3);
else strcpy(console_error, "Audio device not available - cannot play sounds");
}
#ifdef PYCONSOLE
else if (strcmp(console2, "python")==0)
if (pygood==1)
pyready=1;
else
strcpy(console_error, "python not ready. check stdout for more info.")
#endif
else if (strcmp(console2, "load")==0 && console3[0])
{
j = atoi(console3);
if (j)
{
open_ui(vid_buf, console3, NULL);
console_mode = 0;
}
}
else if (strcmp(console2, "if")==0 && console3[0])
{
if (strcmp(console3, "type")==0)//TODO: add more than just type, and be able to check greater/less than
{
if (console_parse_partref(console4, &i, console_error)
&& console_parse_type(console5, &j, console_error))
{
if (parts[i].type==j)
return 1;
else
return 0;
}
else
return 0;
}
}
else if (strcmp(console2, "create")==0 && console3[0] && console4[0])
{
if (console_parse_type(console3, &j, console_error)
&& console_parse_coords(console4, &nx, &ny, console_error))
{
if (!j)
strcpy(console_error, "Cannot create particle with type NONE");
else if (create_part(-1,nx,ny,j)<0)
strcpy(console_error, "Could not create particle");
}
}
else if (strcmp(console2, "bubble")==0 && console3[0])
{
if (console_parse_coords(console3, &nx, &ny, console_error))
{
int first, rem1, rem2;
first = create_part(-1, nx+18, ny, PT_SOAP);
rem1 = first;
for (i = 1; i<=30; i++)
{
rem2 = create_part(-1, nx+18*cosf(i/5.0), ny+18*sinf(i/5.0), PT_SOAP);
parts[rem1].ctype = 7;
parts[rem1].tmp = rem2;
parts[rem2].tmp2 = rem1;
rem1 = rem2;
}
parts[rem1].ctype = 7;
parts[rem1].tmp = first;
parts[first].tmp2 = rem1;
parts[first].ctype = 7;
}
}
else if ((strcmp(console2, "delete")==0 || strcmp(console2, "kill")==0) && console3[0])
{
if (console_parse_partref(console3, &i, console_error))
kill_part(i);
}
else if (strcmp(console2, "reset")==0 && console3[0])
{
if (strcmp(console3, "pressure")==0)
{
for (nx = 0; nx<XRES/CELL; nx++)
for (ny = 0; ny<YRES/CELL; ny++)
{
pv[ny][nx] = 0;
}
}
else if (strcmp(console3, "velocity")==0)
{
for (nx = 0; nx<XRES/CELL; nx++)
for (ny = 0; ny<YRES/CELL; ny++)
{
vx[ny][nx] = 0;
vy[ny][nx] = 0;
}
}
else if (strcmp(console3, "sparks")==0)
{
for (i=0; i<NPART; i++)
{
if (parts[i].type==PT_SPRK)
{
parts[i].type = parts[i].ctype;
parts[i].life = 4;
}
}
}
else if (strcmp(console3, "temp")==0)
{
for (i=0; i<NPART; i++)
{
if (parts[i].type)
{
parts[i].temp = ptypes[parts[i].type].heat;
}
}
}
}
else if (strcmp(console2, "set")==0 && console3[0] && console4[0] && console5[0])
{
if (strcmp(console3, "life")==0)
{
if (strcmp(console4, "all")==0)
{
j = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].life = j;
}
}
else if (console_parse_type(console4, &j, console_error))
{
k = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].life = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
j = atoi(console5);
parts[i].life = j;
}
}
}
else if (strcmp(console3, "type")==0)
{
if (strcmp(console4, "all")==0)
{
if (console_parse_type(console5, &j, console_error))
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].type = j;
}
}
else if (console_parse_type(console4, &j, console_error)
&& console_parse_type(console5, &k, console_error))
{
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].type = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error)
&& console_parse_type(console5, &j, console_error))
{
parts[i].type = j;
}
}
}
else if (strcmp(console3, "temp")==0)
{
if (strcmp(console4, "all")==0)
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].temp = f;
}
}
else if (console_parse_type(console4, &j, console_error))
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].temp= f;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
f = atof(console5);
parts[i].temp = f;
}
}
}
else if (strcmp(console3, "tmp")==0)
{
if (strcmp(console4, "all")==0)
{
j = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].tmp = j;
}
}
else if (console_parse_type(console4, &j, console_error))
{
k = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].tmp = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
j = atoi(console5);
parts[i].tmp = j;
}
}
}
else if (strcmp(console3, "tmp2")==0)
{
if (strcmp(console4, "all")==0)
{
j = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].tmp2 = j;
}
}
else if (console_parse_type(console4, &j, console_error))
{
k = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].tmp2 = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
j = atoi(console5);
parts[i].tmp2 = j;
}
}
}
else if (strcmp(console3, "x")==0)
{
if (strcmp(console4, "all")==0)
{
j = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].x = j;
}
}
else if (console_parse_type(console4, &j, console_error))
{
k = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].x = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
j = atoi(console5);
parts[i].x = j;
}
}
}
else if (strcmp(console3, "y")==0)
{
if (strcmp(console4, "all")==0)
{
j = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].y = j;
}
}
else if (console_parse_type(console4, &j, console_error))
{
k = atoi(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].y = k;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
j = atoi(console5);
parts[i].y = j;
}
}
}
else if (strcmp(console3, "ctype")==0)
{
if (strcmp(console4, "all")==0)
{
if (console_parse_type(console5, &j, console_error) || (j = atoi(console5)) || !strcmp(console5,"0") || !strcasecmp(console5,"NONE"))
{
strcpy(console_error, "");
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].ctype = j;
}
}
}
else if (console_parse_type(console4, &j, console_error))
{
if (console_parse_type(console5, &k, console_error) || (k = atoi(console5)) || !strcmp(console5,"0") || !strcasecmp(console5,"NONE"))
{
strcpy(console_error, "");
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].ctype = k;
}
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
if (console_parse_type(console5, &j, console_error) || (j = atoi(console5)) || !strcmp(console5,"0") || !strcasecmp(console5,"NONE"))
{
strcpy(console_error, "");
j = atoi(console5);
parts[i].ctype = j;
}
}
}
}
else if (strcmp(console3, "vx")==0)
{
if (strcmp(console4, "all")==0)
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].vx = f;
}
}
else if (console_parse_type(console4, &j, console_error))
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].vx = f;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
f = atof(console5);
parts[i].vx = f;
}
}
}
else if (strcmp(console3, "vy")==0)
{
if (strcmp(console4, "all")==0)
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type)
parts[i].vy = f;
}
}
else if (console_parse_type(console4, &j, console_error))
{
f = atof(console5);
for (i=0; i<NPART; i++)
{
if (parts[i].type == j)
parts[i].vy = f;
}
}
else
{
if (console_parse_partref(console4, &i, console_error))
{
f = atof(console5);
parts[i].vy = f;
}
}
}
else
strcpy(console_error, "Invalid property");
}
else
strcpy(console_error, "Invalid Command");
}
return 1;
}

View File

@@ -1,550 +0,0 @@
/**
* Powder Toy - element properties
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <powder.h>
/* Weight Help
* 1 = Gas ||
* 2 = Light || Liquids 0-49
* 98 = Heavy || Powder 50-99
* 100 = Solid ||
* -1 is Neutrons and Photons
*/
part_type ptypes[PT_NUM] =
{
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Use Weight Section H Ins Description
{"", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", ST_NONE, 0, NULL, NULL},
{"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", ST_SOLID, TYPE_PART, NULL, NULL},
{"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_WATR, NULL},
{"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, 1, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
#ifdef REALISTIC
{"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 1, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 1, "Ignites flammable materials. Heats air.", ST_GAS, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_PYRO, &graphics_FIRE},
#else
{"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 1, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air.", ST_GAS, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_PYRO, &graphics_FIRE},
#endif
{"STNE", PIXPACK(0xA0A0A0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable.", ST_SOLID, TYPE_PART, NULL, NULL},
{"LAVA", PIXPACK(0xE05010), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, 1, 45, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold.", ST_LIQUID, TYPE_LIQUID|PROP_LIFE_DEC, &update_PYRO, &graphics_LAVA},
{"GUN", PIXPACK(0xC0C0D0), 0.7f, 0.02f * CFDS, 0.94f, 0.80f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 600, 1, 0, 10, 1, 1, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", ST_SOLID, TYPE_PART, NULL, NULL},
{"NITR", PIXPACK(0x20E010), 0.5f, 0.02f * CFDS, 0.92f, 0.97f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 2, 1000, 2, 0, 3, 1, 1, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
{"CLNE", PIXPACK(0xFFD010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", ST_SOLID, TYPE_SOLID, &update_CLNE, NULL},
{"GAS", PIXPACK(0xE0FF20), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 600, 0, 0, 1, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquefies under pressure.", ST_GAS, TYPE_GAS, NULL, NULL},
{"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE, NULL, NULL},
{"GOO", PIXPACK(0x804000), 0.0f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_GOO, NULL},
{"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, 1, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_ICEI, NULL},
{"METL", PIXPACK(0x404060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL},
{"SPRK", PIXPACK(0xFFFF80), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SPRK, &graphics_SPRK},
{"SNOW", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, 1, 50, SC_POWDERS, R_TEMP-30.0f+273.15f, 46, "Light particles.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_ICEI, NULL},
{"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Solid. Flammable.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE, &update_WOOD, &graphics_WOOD},
{"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways.", ST_GAS, TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_NEUT, &graphics_NEUT},
{"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure.", ST_SOLID, TYPE_PART|PROP_NEUTPENETRATE|PROP_RADIOACTIVE, &update_PLUT, NULL},
{"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows.", ST_SOLID, TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC, &update_PLNT, &graphics_PLNT},
{"ACID", PIXPACK(0xED55FF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, 1, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", ST_LIQUID, TYPE_LIQUID|PROP_DEADLY, &update_ACID, &graphics_ACID},
{"VOID", PIXPACK(0x790B0B), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"WTRV", PIXPACK(0xA0A0FF), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, -0.1f, 0.75f, 0.0003f * CFDS, 0, 0, 0, 0, 4, 1, 1, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water.", ST_GAS, TYPE_GAS, &update_WTRV, NULL},
{"CNCT", PIXPACK(0xC0C0C0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", ST_SOLID, TYPE_PART|PROP_HOT_GLOW, NULL, NULL},
{"DSTW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 23, "Distilled water, does not conduct electricity.", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE, &update_DSTW, NULL},
{"SALT", PIXPACK(0xFFFFFF), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 1, 75, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water.", ST_SOLID, TYPE_PART, NULL, NULL},
{"SLTW", PIXPACK(0x4050F0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_SLTW, NULL},
{"DMND", PIXPACK(0xCCFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructible.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"BMTL", PIXPACK(0x505070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_BMTL, NULL},
{"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", ST_SOLID, TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_BRMT, NULL},
{"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_NUCLEAR, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", ST_GAS, TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_PHOT, &graphics_PHOT},
{"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", ST_SOLID, TYPE_PART | PROP_RADIOACTIVE, &update_URAN, NULL},
{"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, 1, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
{"PSCN", PIXPACK(0x805050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will not transfer current to P-Type Silicon.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 1, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", ST_SOLID, TYPE_LIQUID, NULL, NULL},
{"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"VACU", PIXPACK(0x303030), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Vacuum, sucks in other particles and heats up.", ST_NONE, TYPE_SOLID, NULL, NULL},
{"VENT", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "Air vent, creates pressure and pushes other particles away.", ST_NONE, TYPE_SOLID, NULL, NULL},
{"RBDM", PIXPACK(0xCCCCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 1, 50, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"LRBD", PIXPACK(0xAAAAAA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 1000, 1, 0, 2, 1, 1, 45, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"NTCT", PIXPACK(0x505040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, &update_NPTCT, NULL},
{"SAND", PIXPACK(0xFFD090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable.", ST_SOLID, TYPE_PART, NULL, NULL},
{"GLAS", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", ST_SOLID, TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE, &update_GLAS, NULL},
{"PTCT", PIXPACK(0x405050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 100C)", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, &update_NPTCT, NULL},
{"BGLA", PIXPACK(0x606060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 0, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels.", ST_SOLID, TYPE_PART | PROP_HOT_GLOW, NULL, NULL},
{"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_EXPLOSIVE, 9000.0f +273.15f, 1, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.", ST_NONE, TYPE_PART, &update_THDR, &graphics_THDR},
{"PLSM", PIXPACK(0xBB99FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.30f, 0.001f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, 10000.0f +273.15f, 5, "Plasma, extremely hot.", ST_NONE, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_PYRO, &graphics_PLSM},
{"ETRD", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)", ST_NONE, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, 1, 100, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"NBLE", PIXPACK(0xEB4917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when introduced to electricity", ST_GAS, TYPE_GAS|PROP_CONDUCTS|PROP_LIFE_DEC, &update_NBLE, NULL},
{"BTRY", PIXPACK(0x858505), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Generates Electricity.", ST_SOLID, TYPE_SOLID, &update_BTRY, NULL},
{"LCRY", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)", ST_SOLID, TYPE_SOLID, &update_LCRY, &graphics_LCRY},
{"STKM", PIXPACK(0xFFE0A0), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", ST_NONE, 0, &update_STKM, &graphics_STKM},
{"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)", ST_SOLID, TYPE_SOLID, &update_SWCH, &graphics_SWCH},
{"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 1, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke", ST_SOLID, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, NULL, &graphics_SMKE},
{"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0, 0, 5, 1, 1, 15, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Explodes under high pressure and temperatures", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
{"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly.", ST_SOLID, TYPE_SOLID, &update_COAL, &graphics_COAL},
{"LOXY", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, 1, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
{"OXYG", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", ST_GAS, TYPE_GAS, &update_O2, NULL},
{"INWR", PIXPACK(0x544141), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC, NULL, NULL},
{"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, 1, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", ST_SOLID, TYPE_PART, &update_YEST, NULL},
{"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, 1, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Dead Yeast.", ST_SOLID, TYPE_PART, NULL, NULL},
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremely high temperature.", ST_SOLID, TYPE_PART, &update_THRM, NULL},
{"GLOW", PIXPACK(0x445464), 0.3f, 0.02f * CFDS, 0.98f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, 1, 40, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure", ST_LIQUID, TYPE_LIQUID|PROP_LIFE_DEC, &update_GLOW, &graphics_GLOW},
{"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material.", ST_SOLID, TYPE_SOLID|PROP_HOT_GLOW, NULL, &graphics_BRCK},
{"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, 1, 2, SC_EXPLOSIVE, 0.0f, 88, "Sub-zero flame.", ST_LIQUID, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL, NULL, &graphics_HFLM},
{"FIRW", PIXPACK(0xFFA040), 0.2f, 0.01f * CFDS, 0.96f, 0.95f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 1, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_FIRW, &graphics_FIRW},
{"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.", ST_SOLID, TYPE_SOLID, &update_FUSE, NULL},
{"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 1, 70, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE.", ST_SOLID, TYPE_PART, &update_FSEP, NULL},
{"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", ST_NONE, TYPE_PART, &update_AMTR, NULL},
{"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", ST_SOLID, TYPE_PART, &update_BCOL, &graphics_COAL},
{"PCLN", PIXPACK(0x3B3B0A), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Solid. When activated, duplicates any particles it touches.", ST_NONE, TYPE_SOLID, &update_PCLN, &graphics_PCLN},
{"HSWC", PIXPACK(0x3B0A0A), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", ST_NONE, TYPE_SOLID, &update_HSWC, &graphics_HSWC},
{"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrolysis of WATR", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_IRON, NULL},
{"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_CRACKER2, R_TEMP+4.0f +273.15f, 60, "Steam Train.", ST_NONE, TYPE_PART, &update_MORT, NULL},
{"LIFE", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! B3/S23", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, &graphics_LIFE},
{"DLAY", PIXPACK(0x753590), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, 4.0f+273.15f, 0, "Conducts with temperature-dependent delay. (use HEAT/COOL).", ST_SOLID, TYPE_SOLID, &update_DLAY, &graphics_DLAY},
{"CO2", PIXPACK(0x666666), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.1f, 1.0f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+273.15f, 88, "Carbon Dioxide", ST_GAS, TYPE_GAS, &update_CO2, NULL},
{"DRIC", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, 1, 100, SC_SOLIDS, 172.65f, 2, "Dry Ice.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"BUBW", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Carbonated water. Conducts electricity. Freezes. Extinguishes fires.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_CBNW, &graphics_CBNW},
{"STOR", PIXPACK(0x50DFDF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 0, "Solid. Stores a single particle, releases when charged with PSCN, also passes to PIPE", ST_NONE, TYPE_SOLID, &update_STOR, &graphics_STOR},
{"PVOD", PIXPACK(0x792020), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Solid. When activated, destroys entering particles", ST_NONE, TYPE_SOLID, &update_PVOD, &graphics_PVOD},
{"CONV", PIXPACK(0x0AAB0A), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Converts whatever touches it into its ctype.", ST_NONE, TYPE_SOLID, &update_CONV, NULL},
{"CAUS", PIXPACK(0x80FFA0), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 1.50f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Caustic Gas, acts like Acid", ST_GAS, TYPE_GAS|PROP_DEADLY, &update_CAUS, NULL},
{"LIGH", PIXPACK(0xFFFFC0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "More realistic lightning. Set pen size to set the size of the lightning.", ST_SOLID, TYPE_SOLID, &update_LIGH, &graphics_LIGH},
{"TESC", PIXPACK(0x707040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Tesla coil!", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL},
{"DEST", PIXPACK(0xFF3311), -0.05f, 0.00f * CFDS, 0.95f, 0.95f, -0.1f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 101, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 150, "More destructive Bomb.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_DEST, &graphics_DEST},
{"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 0.0f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 30, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.", ST_SOLID, TYPE_SOLID, &update_SPNG, &graphics_SPNG},
{"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice", ST_SOLID, TYPE_SOLID, &update_RIME, NULL},
{"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 1, SC_CRACKER2, 243.15f, 100, "Not quite Steam", ST_GAS, TYPE_GAS|PROP_LIFE_DEC, &update_FOG, NULL},
{"BCLN", PIXPACK(0xFFD040), 0.0f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", ST_NONE, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_BCLN, NULL},
{"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER2, 373.0f, 40, "Love...", ST_GAS, TYPE_SOLID, &update_MISC, NULL},
{"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE, &update_DEUT, &graphics_DEUT},
{"WARP", PIXPACK(0x101010), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 1, SC_NUCLEAR, R_TEMP +273.15f, 100, "Displaces other elements.", ST_GAS, TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_WARP, &graphics_WARP},
{"PUMP", PIXPACK(0x0A0A3B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 1, 100, SC_POWERED, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", ST_SOLID, TYPE_SOLID, &update_PUMP, &graphics_PUMP},
{"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 1, 1, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_FWRK, NULL},
{"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_PIPE, &graphics_PIPE},
{"FRZZ", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, 1, 50, SC_POWDERS, 253.15f, 46, "Freeze powder. When melted, forms ice that always cools. Spreads with regular water.", ST_SOLID, TYPE_PART, &update_FRZZ, NULL},
{"FRZW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, SC_CRACKER2, 120.0f, 29, "Freeze water. Hybrid liquid formed when Freeze powder melts.", ST_LIQUID, TYPE_LIQUID||PROP_LIFE_DEC, &update_FRZW, NULL},
{"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", ST_SOLID, TYPE_PART, &update_MISC, &graphics_GRAV},
{"BIZR", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "Bizarre... contradicts the normal state changes.", ST_LIQUID, TYPE_LIQUID, &update_BIZR, &graphics_BIZR},
{"BIZG", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 1, SC_CRACKER2, R_TEMP-200.0f+273.15f, 42, "Bizarre gas", ST_GAS, TYPE_GAS, &update_BIZR, &graphics_BIZR},
{"BIZS", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_CRACKER2, R_TEMP+300.0f+273.15f, 251, "Bizarre solid", ST_SOLID, TYPE_SOLID, &update_BIZR, &graphics_BIZR},
{"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, PSCN to charge, NSCN to take.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, NULL, NULL},
{"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE, &update_ISZ, NULL},
{"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", ST_SOLID, TYPE_SOLID, &update_ISZ, NULL},
{"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Portal IN. Things go in here, now with channels (same as WIFI)", ST_SOLID, TYPE_SOLID, &update_PRTI, &graphics_PRTI},
{"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Portal OUT. Things come out here, now with channels (same as WIFI)", ST_SOLID, TYPE_SOLID, &update_PRTO, &graphics_PRTO},
{"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 31, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Colloid, Hardens under pressure", ST_LIQUID, TYPE_LIQUID, NULL, NULL},
{"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 1, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"ANAR", PIXPACK(0xFFFFEE), -0.7f, -0.02f * CFDS, 0.96f, 0.80f, 0.1f, -0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", ST_SOLID, TYPE_PART, &update_ANAR, NULL},
{"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", ST_SOLID, TYPE_SOLID, &update_VINE, NULL},
{"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", ST_SOLID, TYPE_SOLID | PROP_NEUTPASS, NULL, &graphics_INVS},
{"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 1, 85, SC_CRACKER2, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", ST_SOLID, TYPE_PART, NULL, NULL},
{"SPWN2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "STK2 spawn point", ST_SOLID, TYPE_SOLID, &update_SPAWN2, NULL},
{"SPWN", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "STKM spawn point", ST_SOLID, TYPE_SOLID, &update_SPAWN, NULL},
{"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SHLD1, NULL},
{"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SHLD2, NULL},
{"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SHLD3, NULL},
{"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SHLD4, NULL},
{"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", ST_GAS, TYPE_SOLID, &update_MISC, NULL},
{"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 2, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", ST_SOLID, TYPE_SOLID, &update_WIFI, &graphics_WIFI},
{"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", ST_SOLID, TYPE_SOLID | PROP_NOAMBHEAT, NULL, &graphics_FILT},
{"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Ray Emitter. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_ARAY, NULL},
{"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL, NULL, &graphics_BRAY},
{"STK2", PIXPACK(0x6464FF), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Second Stickman. Don't kill him!", ST_NONE, 0, &update_STKM2, &graphics_STKM},
{"BOMB", PIXPACK(0xFFF288), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE, &update_BOMB, &graphics_BOMB},
{"C-5", PIXPACK(0x2050E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Cold explosive", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE, &update_C5, NULL},
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 1, 86, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Singularity", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_SING, NULL},
{"QRTZ", PIXPACK(0xAADDDD), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", ST_SOLID, TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC, &update_QRTZ, &graphics_QRTZ},
{"PQRT", PIXPACK(0x88BBBB), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.27f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 3, "Broken quartz.", ST_SOLID, TYPE_PART| PROP_HOT_GLOW, &update_QRTZ, &graphics_QRTZ},
{"EMP", PIXPACK(0x66AAFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 3, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 121, "Breaks activated electronics.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_EMP, &graphics_EMP},
{"BREL", PIXPACK(0x707060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.18f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken electronics", ST_SOLID, TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_BREL, NULL},
{"ELEC", PIXPACK(0xDFEFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_NUCLEAR, R_TEMP+200.0f+273.15f, 251, "Electrons", ST_GAS, TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_ELEC, &graphics_ELEC},
{"ACEL", PIXPACK(0x0099CC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_FORCE, R_TEMP+0.0f +273.15f, 251, "Accelerator", ST_NONE, TYPE_SOLID, &update_ACEL, &graphics_ACEL},
{"DCEL", PIXPACK(0x99CC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_FORCE, R_TEMP+0.0f +273.15f, 251, "Decelerator", ST_NONE, TYPE_SOLID, &update_DCEL, &graphics_DCEL},
{"TNT", PIXPACK(0xC05050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Explosive.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE, &update_BANG, NULL},
{"IGNC", PIXPACK(0xC0B050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Ignition cord.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE | PROP_SPARKSETTLE | PROP_LIFE_KILL, &update_IGNT, NULL},
{"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", ST_GAS, TYPE_GAS, &update_BOYL, NULL},
{"GEL", PIXPACK(0xFF9900), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Gel. A liquid with variable viscosity and heat conductivity", ST_LIQUID, TYPE_LIQUID|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_GEL, &graphics_GEL},
{"TRON", PIXPACK(0xA9FF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, 0.0f, 40, "Smart particles, Travels in straight lines and avoids obstacles. Grows with time.", ST_NONE, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_TRON, &graphics_TRON},
{"TTAN", PIXPACK(0x909090), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Titanium, Higher melting temperature than other metals, blocks all air pressure", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC, &update_TTAN, NULL},
{"EXOT", PIXPACK(0x404040), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, 1, 46, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 250, "Exotic matter. Explodes with excess exposure to electrons.", ST_LIQUID, TYPE_LIQUID, &update_EXOT, &graphics_EXOT},
/*FREE*/{"BRAN", PIXPACK(0xCCCC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
{"EMBR", PIXPACK(0xFFF288), 0.4f, 0.001f * CFDS, 0.99f, 0.90f, 0.0f, 0.07f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 0, 1, 30, SC_EXPLOSIVE, 500.0f +273.15f, 29, "Sparks. Formed by explosions.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE, &update_EMBR, &graphics_EMBR},
{"HYGN", PIXPACK(0x5070FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.10f, 0.00f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 251, "Combines with O2 to make WATR", ST_GAS, TYPE_GAS, &update_H2, NULL},
{"SOAP", PIXPACK(0xF5F5DC), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Soap. Creates bubbles.", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE|PROP_LIFE_DEC, &update_SOAP, NULL},
{"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Black hole (Requires newtonian gravity)", ST_SOLID, TYPE_SOLID, &update_NBHL, NULL},
{"WHOL", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "White hole (Requires newtonian gravity)", ST_SOLID, TYPE_SOLID, &update_NWHL, NULL},
{"MERC", PIXPACK(0x736B6D), 0.4f, 0.04f * CFDS, 0.94f, 0.80f, 0.0f, 0.3f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 91, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Mercury. Volume changes with temperature, Conductive.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTABSORB|PROP_LIFE_DEC, &update_MERC, NULL},
{"PBCN", PIXPACK(0x3B1D0A), 0.0f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Powered breakable clone", ST_NONE, TYPE_SOLID, &update_PBCN, &graphics_PBCN},
{"GPMP", PIXPACK(0x0A3B3B), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, 0.0f +273.15f, 0, "Changes gravity to its temp when activated. (use HEAT/COOL).", ST_NONE, TYPE_SOLID, &update_GPMP, &graphics_GPMP},
{"CLST", PIXPACK(0xE4A4A4), 0.7f, 0.02f * CFDS, 0.94f, 0.95f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Clay dust. Produces paste when mixed with water.", ST_SOLID, TYPE_PART, &update_CLST, &graphics_CLST},
{"WIRE", PIXPACK(0xFFCC00), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 250, "WireWorld wires.",ST_SOLID,TYPE_SOLID,&update_WIRE, &graphics_WIRE},
{"GBMB", PIXPACK(0x1144BB), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Sticks to first object it touches then produces strong gravity push.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_GBMB, &graphics_GBMB},
{"FIGH", PIXPACK(0xFFE0A0), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Fighter. Tries to kill stickmen.", ST_NONE, 0, &update_FIGH, &graphics_STKM},
{"FRAY", PIXPACK(0x00BBFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_FORCE, 20.0f+0.0f +273.15f, 0, "Force Emitter. Push or pull objects based on temp value, use like ARAY", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_FRAY, NULL},
{"RPEL", PIXPACK(0x99CC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_FORCE, 20.0f+0.0f +273.15f, 0, "Repel or attract particles based on temp value.", ST_NONE, TYPE_SOLID, &update_REPL, NULL},
{"PPIP", PIXPACK(0x444466), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_POWERED, 273.15f, 0, "Powered pipe", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_PIPE, &graphics_PIPE},
{"DTEC", PIXPACK(0xFD9D18), 0.0f, 0.00f * CFDS, 0.96f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+273.15f, 0, "Creates a spark when something with its ctype is nearby", ST_SOLID, TYPE_SOLID, &update_DTEC, NULL},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Use Weight Section H Ins Description
};
// temporarily define abbreviations for impossible p/t values
#define IPL -257.0f
#define IPH 257.0f
#define ITL MIN_TEMP-1
#define ITH MAX_TEMP+1
// no transition (PT_NONE means kill part)
#define NT -1
// special transition - lava ctypes etc need extra code, which is only found and run if ST is given
#define ST PT_NUM
part_transition ptransitions[PT_NUM] =
{ // if low pressure if high pressure if low temperature if high temperature
// Name plv plt phv pht tlv tlt thv tht
/* NONE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* DUST */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WATR */ {IPL, NT, IPH, NT, 273.15f,PT_ICEI, 373.0f, PT_WTRV},
/* OIL */ {IPL, NT, IPH, NT, ITL, NT, 333.0f, PT_GAS},
/* FIRE */ {IPL, NT, IPH, NT, ITL, NT, 2773.0f,PT_PLSM},
/* STNE */ {IPL, NT, IPH, NT, ITL, NT, 983.0f, PT_LAVA},
/* LAVA */ {IPL, NT, IPH, NT, 2573.15f,ST, ITH, NT}, // 2573.15f is highest melt pt of possible ctypes
/* GUN */ {IPL, NT, IPH, NT, ITL, NT, 673.0f, PT_FIRE},
/* NITR */ {IPL, NT, IPH, NT, ITL, NT, 673.0f, PT_FIRE},
/* CLNE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GAS */ {IPL, NT, 6.0f, PT_OIL, ITL, NT, 573.0f, PT_FIRE},
/* C-4 */ {IPL, NT, IPH, NT, ITL, NT, 673.0f, PT_FIRE},
/* GOO */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ICE */ {IPL, NT, 0.8f, PT_SNOW, ITL, NT, 252.05f, ST},
/* METL */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_LAVA},
/* SPRK */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SNOW */ {IPL, NT, IPH, NT, ITL, NT, 273.0f, ST},
/* WOOD */ {IPL, NT, IPH, NT, ITL, NT, 873.0f, PT_FIRE},
/* NEUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PLUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PLNT */ {IPL, NT, IPH, NT, ITL, NT, 573.0f, PT_FIRE},
/* ACID */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* VOID */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WTRV */ {IPL, NT, IPH, NT, 371.0f, ST, ITH, NT},
/* CNCT */ {IPL, NT, IPH, NT, ITL, NT, 1123.0f,PT_LAVA},
/* DSTW */ {IPL, NT, IPH, NT, 273.15f,PT_ICEI, 373.0f, PT_WTRV},
/* SALT */ {IPL, NT, IPH, NT, ITL, NT, 1173.0f,PT_LAVA},
/* SLTW */ {IPL, NT, IPH, NT, 252.05f, PT_ICEI, 383.0f, ST},
/* DMND */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BMTL */ {IPL, NT, 1.0f, ST, ITL, NT, 1273.0f,PT_LAVA},
/* BRMT */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_LAVA},
/* PHOT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* URAN */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WAX */ {IPL, NT, IPH, NT, ITL, NT, 319.0f, PT_MWAX},
/* MWAX */ {IPL, NT, IPH, NT, 318.0f, PT_WAX, 673.0f, PT_FIRE},
/* PSCN */ {IPL, NT, IPH, NT, ITL, NT, 1687.0f,PT_LAVA},
/* NSCN */ {IPL, NT, IPH, NT, ITL, NT, 1687.0f,PT_LAVA},
/* LN2 */ {IPL, NT, IPH, NT, 63.0f, PT_NICE, 77.0f, PT_NONE},
/* INSL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* VACU */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* VENT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* RBDM */ {IPL, NT, IPH, NT, ITL, NT, 312.0f, PT_LRBD},
/* LRBD */ {IPL, NT, IPH, NT, 311.0f, PT_RBDM, 961.0f, PT_FIRE},
/* NTCT */ {IPL, NT, IPH, NT, ITL, NT, 1687.0f,PT_LAVA},
/* SAND */ {IPL, NT, IPH, NT, ITL, NT, 1973.0f,PT_LAVA},
/* GLAS */ {IPL, NT, IPH, NT, ITL, NT, 1973.0f,PT_LAVA},
/* PTCT */ {IPL, NT, IPH, NT, ITL, NT, 1414.0f,PT_LAVA},
/* BGLA */ {IPL, NT, IPH, NT, ITL, NT, 1973.0f,PT_LAVA},
/* THDR */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PLSM */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ETRD */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* NICE */ {IPL, NT, IPH, NT, ITL, NT, 63.1f, PT_LNTG},
/* NBLE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BTRY */ {IPL, NT, IPH, NT, ITL, NT, 2273.0f,PT_PLSM},
/* LCRY */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_BGLA},
/* STKM */ {IPL, NT, IPH, NT, ITL, NT, 620.0f, PT_FIRE},
/* SWCH */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SMKE */ {IPL, NT, IPH, NT, ITL, NT, 625.0f, PT_FIRE},
/* DESL */ {IPL, NT, 5.0f, PT_FIRE, ITL, NT, 335.0f, PT_FIRE},
/* COAL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* LO2 */ {IPL, NT, IPH, NT, ITL, NT, 90.1f, PT_O2},
/* O2 */ {IPL, NT, IPH, NT, 90.0f, PT_LO2, ITH, NT},
/* INWR */ {IPL, NT, IPH, NT, ITL, NT, 1687.0f,PT_LAVA},
/* YEST */ {IPL, NT, IPH, NT, ITL, NT, 373.0f, PT_DYST},
/* DYST */ {IPL, NT, IPH, NT, ITL, NT, 473.0f, PT_DUST},
/* THRM */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GLOW */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BRCK */ {IPL, NT, 8.8f, PT_STNE, ITL, NT, 1223.0f,PT_LAVA},
/* CFLM */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* FIRW */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* FUSE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* FSEP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* AMTR */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BCOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PCLN */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* HSWC */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* IRON */ {IPL, NT, IPH, NT, ITL, NT, 1687.0f,PT_LAVA},
/* MORT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* LIFE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* DLAY */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* CO2 */ {IPL, NT, IPH, NT, 194.65f,PT_DRIC, ITH, NT},
/* DRIC */ {IPL, NT, IPH, NT, ITL, NT, 195.65f,PT_CO2},
/* CBNW */ {IPL, NT, IPH, NT, 273.15f,PT_ICEI, 373.0f, PT_WTRV},
/* STOR */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* STOR */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SPNG */ {IPL, NT, IPH, NT, ITL, NT, 2730.0f,PT_FIRE},
/* RIME */ {IPL, NT, IPH, NT, ITL, NT, 273.15f,PT_WATR},
/* FOG */ {IPL, NT, IPH, NT, ITL, NT, 373.15f,PT_WTRV},
/* BCLN */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* LOVE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* DEUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WARP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PUMP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* FWRK */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PIPE */ {IPL, NT, 10.0f, PT_BRMT, ITL, NT, ITH, NT},
/* FRZZ */ {IPL, NT, 1.8f, PT_SNOW, 50.0f,PT_ICEI, 273.15f,PT_WATR},
/* FRZW */ {IPL, NT, IPH, NT, ITL, NT, 53.0f, PT_ICEI},
/* GRAV */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BIZR */ {IPL, NT, IPH, NT, 100.0f, PT_BIZRG, 400.0f, PT_BIZRS},
/* BIZRG*/ {IPL, NT, IPH, NT, ITL, NT, 100.0f, PT_BIZR},//, 400.0f, PT_BIZRS},
/* BIZRS*/ {IPL, NT, IPH, NT, 400.0f, PT_BIZR, ITH, NT},// 100.0f, PT_BIZRG},
/* INST */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ISOZ */ {IPL, NT, IPH, NT, 160.0f, PT_ISZS, ITH, NT},
/* ISZS */ {IPL, NT, IPH, NT, ITL, NT, 300.0f, PT_ISOZ},
/* PRTI */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PRTO */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PSTE */ {IPL, NT, 0.5f, PT_PSTS, ITL, NT, 747.0f, PT_BRCK},
/* PSTS */ {0.5f, PT_PSTE, IPH, NT, ITL, NT, ITH, NT},
/* ANAR */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* VINE */ {IPL, NT, IPH, NT, ITL, NT, 573.0f, PT_FIRE},
/* INVS */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* EQVE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SPWN2*/ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SPAWN*/ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SHLD1*/ {IPL, NT, 7.0f, PT_NONE, ITL, NT, ITH, NT},
/* SHLD2*/ {IPL, NT, 15.0f, PT_NONE, ITL, NT, ITH, NT},
/* SHLD3*/ {IPL, NT, 25.0f, PT_NONE, ITL, NT, ITH, NT},
/* SHLD4*/ {IPL, NT, 40.0f, PT_NONE, ITL, NT, ITH, NT},
/* LOlZ */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WIFI */ {IPL, NT, 15.0f, PT_BRMT, ITL, NT, ITH, NT},
/* FILT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ARAY */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BRAY */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* STKM2*/ {IPL, NT, IPH, NT, ITL, NT, 620.0f, PT_FIRE},
/* BOMB */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* C-5 */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SING */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* QRTZ */ {IPL, NT, IPH, NT, ITL, NT, 2573.15f,PT_LAVA},
/* PQRT */ {IPL, NT, IPH, NT, ITL, NT, 2573.15f,PT_LAVA},
/* EMP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BREL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ELEC */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* ACEL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* DCEL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* TNT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* IGNP */ {IPL, NT, IPH, NT, ITL, NT, 673.0f, PT_FIRE},
/* BOYL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GEL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* TRON */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* TTAN */ {IPL, NT, IPH, NT, ITL, NT, 1941.0f,PT_LAVA},
/* EXOT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* WIND */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* H2 */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* SOAP */ {IPL, NT, IPH, NT, ITL, NT, ITL, NT},
/* NBHL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* NWHL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* MERC */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PBCN */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GPMP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* CLST */ {IPL, NT, IPH, NT, ITL, NT, 1256.0f, PT_LAVA},
/* WIRE */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GBMB */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* FIGH */ {IPL, NT, IPH, NT, ITL, NT, 620.0f, PT_FIRE},
/* FRAY */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* REPL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PPIP */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* DTEC */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
};
// This is an enthalpy values table, converted into TPT imaginary units
// table value is - 750/226*enthalpy value of the material
unsigned int platent[PT_NUM] =
{
/* NONE */ 0,
/* DUST */ 0,
/* WATR */ 7500,
/* OIL */ 0,
/* FIRE */ 0,
/* STNE */ 0,
/* LAVA */ 0,
/* GUN */ 0,
/* NITR */ 0,
/* CLNE */ 0,
/* GAS */ 0,
/* C-4 */ 0,
/* GOO */ 0,
/* ICE */ 1095,
/* METL */ 919,
/* SPRK */ 0,
/* SNOW */ 1095,
/* WOOD */ 0,
/* NEUT */ 0,
/* PLUT */ 0,
/* PLNT */ 0,
/* ACID */ 0,
/* VOID */ 0,
/* WTRV */ 0,
/* CNCT */ 0,
/* DSTW */ 7500,
/* SALT */ 0,
/* SLTW */ 7500,
/* DMND */ 0,
/* BMTL */ 0,
/* BRMT */ 0,
/* PHOT */ 0,
/* URAN */ 0,
/* WAX */ 0,
/* MWAX */ 0,
/* PSCN */ 0,
/* NSCN */ 0,
/* LN2 */ 0,
/* INSL */ 0,
/* VACU */ 0,
/* VENT */ 0,
/* RBDM */ 0,
/* LRBD */ 0,
/* NTCT */ 0,
/* SAND */ 0,
/* GLAS */ 0,
/* PTCT */ 0,
/* BGLA */ 0,
/* THDR */ 0,
/* PLSM */ 0,
/* ETRD */ 0,
/* NICE */ 0,
/* NBLE */ 0,
/* BTRY */ 0,
/* LCRY */ 0,
/* STKM */ 0,
/* SWCH */ 0,
/* SMKE */ 0,
/* DESL */ 0,
/* COAL */ 0,
/* LO2 */ 0,
/* O2 */ 0,
/* INWR */ 0,
/* YEST */ 0,
/* DYST */ 0,
/* THRM */ 0,
/* GLOW */ 0,
/* BRCK */ 0,
/* CFLM */ 0,
/* FIRW */ 0,
/* FUSE */ 0,
/* FSEP */ 0,
/* AMTR */ 0,
/* BCOL */ 0,
/* PCLN */ 0,
/* HSWC */ 0,
/* IRON */ 0,
/* MORT */ 0,
/* LIFE */ 0,
/* DLAY */ 0,
/* CO2 */ 0,
/* DRIC */ 0,
/* CBNW */ 7500,
/* STOR */ 0,
/* STOR */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* SPNG */ 0,
/* RIME */ 0,
/* FOG */ 0,
/* BCLN */ 0,
/* LOVE */ 0,
/* DEUT */ 0,
/* WARP */ 0,
/* PUMP */ 0,
/* FWRK */ 0,
/* PIPE */ 0,
/* FRZZ */ 0,
/* FRZW */ 0,
/* GRAV */ 0,
/* BIZR */ 0,
/* BIZRG*/ 0,
/* BIZRS*/ 0,
/* INST */ 0,
/* ISOZ */ 0,
/* ISZS */ 0,
/* PRTI */ 0,
/* PRTO */ 0,
/* PSTE */ 0,
/* PSTS */ 0,
/* ANAR */ 0,
/* VINE */ 0,
/* INVS */ 0,
/* EQVE */ 0,
/* SPWN2*/ 0,
/* SPAWN*/ 0,
/* SHLD1*/ 0,
/* SHLD2*/ 0,
/* SHLD3*/ 0,
/* SHLD4*/ 0,
/* LOlZ */ 0,
/* WIFI */ 0,
/* FILT */ 0,
/* ARAY */ 0,
/* BRAY */ 0,
/* STKM2*/ 0,
/* BOMB */ 0,
/* C-5 */ 0,
/* SING */ 0,
/* QRTZ */ 0,
/* PQRT */ 0,
/* EMP */ 0,
/* BREL */ 0,
/* ELEC */ 0,
/* ACEL */ 0,
/* DCEL */ 0,
/* TNT */ 0,
/* IGNP */ 0,
/* BOYL */ 0,
/* GEL */ 0,
/* EXOT */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* FREE */ 0,
/* WIND */ 0,
/* H2 */ 0,
/* SOAP */ 0,
/* NBHL */ 0,
/* NWHL */ 0,
/* MERC */ 0,
/* PBCN */ 0,
/* GPMP */ 0,
/* CLST */ 0,
/* WIRE */ 0,
/* GBMB */ 0,
/* FIGH */ 0,
/* FRAY */ 0,
/* REPL */ 0,
/* PPIP */ 0,
/* DTEC */ 0,
};
#undef IPL
#undef IPH
#undef ITL
#undef ITH
#undef NT
#undef ST

View File

@@ -1,63 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_O2(UPDATE_FUNC_ARGS)
{
int r,rx,ry;
if (parts[i].temp < 9273.15)
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_FIRE)
{
parts[r>>8].temp+=(rand()/(RAND_MAX/100));
if(parts[r>>8].tmp&0x01)
parts[r>>8].temp=3473;
parts[r>>8].tmp |= 2;
}
if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM)
{
create_part(i,x,y,PT_FIRE);
parts[i].temp+=(rand()/(RAND_MAX/100));
parts[i].tmp |= 2;
}
}
}
else if (parts[i].temp > 9973.15 && pv[y/CELL][x/CELL] > 250.0f && fabsf(gravx[((y/CELL)*(XRES/CELL))+(x/CELL)]) + fabsf(gravy[((y/CELL)*(XRES/CELL))+(x/CELL)]) > 20)
{
if (rand()%5 < 1)
{
int j;
create_part(i,x,y,PT_BRMT);
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = 15000;
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT); if (j != -1) parts[j].temp = 15000;
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PLSM); if (j != -1) parts[j].temp = 15000;
parts[i].temp = 15000;
pv[y/CELL][x/CELL] += 300;
}
}
return 0;
}

View File

@@ -1,73 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_ACEL(UPDATE_FUNC_ARGS) {
int r, rx, ry;
parts[i].tmp = 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && !(rx && ry))
{
r = pmap[y+ry][x+rx];
if(!r)
r = photons[y+ry][x+rx];
if ((r>>8)>=NPART || !r)
continue;
if(ptypes[r&0xFF].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
{
parts[r>>8].vx *= 1.1f;
parts[r>>8].vy *= 1.1f;
parts[i].tmp = 1;
}
}
return 0;
}
int graphics_ACEL(GRAPHICS_FUNC_ARGS)
{
if(cpart->tmp)
*pixel_mode |= PMODE_GLOW;
return 0;
}
int update_DCEL(UPDATE_FUNC_ARGS) {
int r, rx, ry;
parts[i].tmp = 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && !(rx && ry))
{
r = pmap[y+ry][x+rx];
if(!r)
r = photons[y+ry][x+rx];
if ((r>>8)>=NPART || !r)
continue;
if(ptypes[r&0xFF].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
{
parts[r>>8].vx *= 0.9f;
parts[r>>8].vy *= 0.9f;
parts[i].tmp = 1;
}
}
return 0;
}
int graphics_DCEL(GRAPHICS_FUNC_ARGS)
{
if(cpart->tmp)
*pixel_mode |= PMODE_GLOW;
return 0;
}

View File

@@ -1,91 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_ACID(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_ACID && (r&0xFF)!=PT_CAUS)
{
if ((r&0xFF)==PT_PLEX || (r&0xFF)==PT_NITR || (r&0xFF)==PT_GUNP || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD)
{
part_change_type(i,x,y,PT_FIRE);
part_change_type(r>>8,x+rx,y+ry,PT_FIRE);
parts[i].life = 4;
parts[r>>8].life = 4;
}
else if ((r&0xFF)==PT_WTRV)
{
if(!(rand()%250))
{
part_change_type(i, x, y, PT_CAUS);
parts[i].life = (rand()%50)+25;
kill_part(r>>8);
}
}
else if (((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[r&0xFF].hardness>(rand()%1000))&&parts[i].life>=50)
{
if (parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid
{
float newtemp = ((60.0f-(float)ptypes[r&0xFF].hardness))*7.0f;
if(newtemp < 0){
newtemp = 0;
}
parts[i].temp += newtemp;
parts[i].life--;
kill_part(r>>8);
}
}
else if (parts[i].life<=50)
{
kill_part(i);
return 1;
}
}
}
for ( trade = 0; trade<2; trade ++)
{
rx = rand()%5-2;
ry = rand()%5-2;
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((r>>8)>=NPART || !r)
continue;
if ((r&0xFF)==PT_ACID&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion
{
int temp = parts[i].life - parts[r>>8].life;
if (temp ==1)
{
parts[r>>8].life ++;
parts[i].life --;
}
else if (temp>0)
{
parts[r>>8].life += temp/2;
parts[i].life -= temp/2;
}
}
}
}
return 0;
}

View File

@@ -1,43 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_AMTR(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL && (r&0xFF)!=PT_NBHL && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO)
{
parts[i].life++;
if (parts[i].life==4)
{
kill_part(i);
return 1;
}
if (10>(rand()/(RAND_MAX/100)))
create_part(r>>8, x+rx, y+ry, PT_PHOT);
else
kill_part(r>>8);
pv[y/CELL][x/CELL] -= 2.0f;
}
}
return 0;
}

View File

@@ -1,42 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_ANAR(UPDATE_FUNC_ARGS) {
int r, rx, ry;
//if (parts[i].temp >= 0.23)
// parts[i].temp --;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_HFLM)
{
if (1>rand()%22)
{
part_change_type(i,x,y,PT_HFLM);
parts[i].life = rand()%150+50;
parts[r>>8].temp = parts[i].temp = 0;
pv[y/CELL][x/CELL] -= 0.5;
}
}
}
return 0;
}

View File

@@ -1,118 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_ARAY(UPDATE_FUNC_ARGS) {
int r, nxx, nyy, docontinue, nxi, nyi, rx, ry, nr, ry1, rx1;
if (parts[i].life==0) {
int colored =0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SPRK && parts[r>>8].life==3) {
int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0;
int nostop = (parts[r>>8].ctype==PT_INST)?1:0;
for (docontinue = 1, nxx = 0, nyy = 0, nxi = rx*-1, nyi = ry*-1; docontinue; nyy+=nyi, nxx+=nxi) {
if (!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0)) {
break;
}
r = pmap[y+nyi+nyy][x+nxi+nxx];
if (!r) {
int nr = create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_BRAY);
if (nr!=-1) {
if (destroy) {//if it came from PSCN
parts[nr].tmp = 2;
parts[nr].life = 2;
} else
parts[nr].ctype = colored;
parts[nr].temp = parts[i].temp;
}
} else if (!destroy) {
if ((r&0xFF)==PT_BRAY&&parts[r>>8].tmp==0) {//if it hits another BRAY that isn't red
if (nyy!=0 || nxx!=0) {
parts[r>>8].life = 1020;//makes it last a while
parts[r>>8].tmp = 1;
if (!parts[r>>8].ctype)//and colors it if it isn't already
parts[r>>8].ctype = colored;
}
docontinue = 0;//then stop it
} else if ((r&0xFF)==PT_BRAY&&parts[r>>8].tmp==1) {//if it hits one that already was a long life, reset it
parts[r>>8].life = 1020;
//docontinue = 1;
} else if ((r&0xFF)==PT_FILT) {//get color if passed through FILT
colored = parts[r>>8].ctype;
//this if prevents BRAY from stopping on certain materials
} else if ((r&0xFF)!=PT_STOR && (r&0xFF)!=PT_INWR && ((r&0xFF)!=PT_SPRK || parts[r>>8].ctype!=PT_INWR) && (r&0xFF)!=PT_ARAY && (r&0xFF)!=PT_WIFI && !((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) {
if (nyy!=0 || nxx!=0) {
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
}
if (!(nostop && parts[r>>8].type==PT_SPRK && parts[r>>8].ctype >= 0 && parts[r>>8].ctype < PT_NUM && (ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))) {
docontinue = 0;
} else {
docontinue = 1;
}
} else if((r&0xFF)==PT_STOR) {
if(parts[r>>8].tmp)
{
//Cause STOR to release
for(ry1 = 1; ry1 >= -1; ry1--){
for(rx1 = 0; rx1 >= -1 && rx1 <= 1; rx1 = -rx1-rx1+1){
int np = create_part(-1, x+nxi+nxx+rx1, y+nyi+nyy+ry1, parts[r>>8].tmp);
if (np!=-1)
{
parts[np].temp = parts[r>>8].temp;
parts[np].life = parts[r>>8].tmp2;
parts[np].tmp = parts[r>>8].pavg[0];
parts[np].ctype = parts[r>>8].pavg[1];
parts[r>>8].tmp = 0;
parts[r>>8].life = 10;
break;
}
}
}
}
else
{
parts[r>>8].life = 10;
}
}
} else if (destroy) {
if ((r&0xFF)==PT_BRAY) {
parts[r>>8].life = 1;
docontinue = 1;
//this if prevents red BRAY from stopping on certain materials
} else if ((r&0xFF)==PT_STOR || (r&0xFF)==PT_INWR || ((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_INWR) || (r&0xFF)==PT_ARAY || (r&0xFF)==PT_WIFI || (r&0xFF)==PT_FILT || ((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) {
if((r&0xFF)==PT_STOR)
{
parts[r>>8].tmp = 0;
parts[r>>8].life = 0;
}
docontinue = 1;
} else {
docontinue = 0;
}
}
}
}
//parts[i].life = 4;
}
}
return 0;
}

View File

@@ -1,91 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BANG(UPDATE_FUNC_ARGS) {
int r, rx, ry, nb;
if(parts[i].tmp==0)
{
if(parts[i].temp>=673.0f)
parts[i].tmp = 1;
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM)
{
parts[i].tmp = 1;
}
else if ((r&0xFF)==PT_SPRK || (r&0xFF)==PT_LIGH)
{
parts[i].tmp = 1;
}
}
}
else if(parts[i].tmp==1)
{
int tempvalue = 2;
flood_prop(x, y, offsetof(particle, tmp), &tempvalue, 0);
parts[i].tmp = 2;
}
else if(parts[i].tmp==2)
{
parts[i].tmp = 3;
}
else if(parts[i].tmp>=3)
{
float otemp = parts[i].temp-275.13f;
//Explode!!
pv[y/CELL][x/CELL] += 0.5f;
parts[i].tmp = 0;
if(!(rand()%3))
{
if(!(rand()%2))
{
create_part(i, x, y, PT_FIRE);
parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
}
else
{
create_part(i, x, y, PT_SMKE);
parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
}
}
else
{
if(!(rand()%15))
{
create_part(i, x, y, PT_EMBR);
parts[i].tmp = 0;
parts[i].life = 50;
parts[i].temp = restrict_flt((MAX_TEMP/3)+otemp, MIN_TEMP, MAX_TEMP);
parts[i].vx = rand()%20-10;
parts[i].vy = rand()%20-10;
}
else
{
kill_part(i);
}
}
return 1;
}
return 0;
}

View File

@@ -1,63 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BCLN(UPDATE_FUNC_ARGS) {
if (!parts[i].life && pv[y/CELL][x/CELL]>4.0f)
parts[i].life = rand()%40+80;
if (parts[i].life)
{
float advection = 0.1f;
parts[i].vx += advection*vx[y/CELL][x/CELL];
parts[i].vy += advection*vy[y/CELL][x/CELL];
}
if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !ptypes[parts[i].ctype].enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOLALT)))
{
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = photons[y+ry][x+rx];
if (!r)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
(r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
(r&0xFF)<PT_NUM)
{
parts[i].ctype = r&0xFF;
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
parts[i].tmp = parts[r>>8].ctype;
}
}
}
else {
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0)
{
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0)
{
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
parts[np].ctype = parts[i].tmp;
}
}
}
return 0;
}

View File

@@ -1,83 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BCOL(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, temp;
if (parts[i].life<=0) {
create_part(i, x, y, PT_FIRE);
return 1;
} else if (parts[i].life < 100) {
parts[i].life--;
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE);
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
{
if (parts[i].life>100) {
parts[i].life = 99;
}
}
if ((r&0xFF)==PT_LAVA && 1>(rand()%500))
{
if (parts[r>>8].ctype == PT_IRON) {
parts[r>>8].ctype = PT_METL;
kill_part(i);
return 1;
}
}
}
/*if(100-parts[i].life > parts[i].tmp2)
parts[i].tmp2 = 100-parts[i].life;
if(parts[i].tmp2 < 0) parts[i].tmp2 = 0;
for ( trade = 0; trade<4; trade ++)
{
rx = rand()%5-2;
ry = rand()%5-2;
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_COAL || (r&0xFF)==PT_BCOL)&&(parts[i].tmp2>parts[r>>8].tmp2)&&parts[i].tmp2>0)//diffusion
{
int temp = parts[i].tmp2 - parts[r>>8].tmp2;
if(temp < 10)
continue;
if (temp ==1)
{
parts[r>>8].tmp2 ++;
parts[i].tmp2 --;
}
else if (temp>0)
{
parts[r>>8].tmp2 += temp/2;
parts[i].tmp2 -= temp/2;
}
}
}
}*/
if(parts[i].temp > parts[i].tmp2)
parts[i].tmp2 = parts[i].temp;
return 0;
}

View File

@@ -1,59 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
//Used by ALL 3 BIZR states
int update_BIZR(UPDATE_FUNC_ARGS) {
int r, rx, ry, nr, ng, nb, na;
float tr, tg, tb, ta, mr, mg, mb, ma;
float blend;
if(parts[i].dcolour){
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_BIZR && (r&0xFF)!=PT_BIZRG && (r&0xFF)!=PT_BIZRS)
{
blend = 0.95f;
tr = (parts[r>>8].dcolour>>16)&0xFF;
tg = (parts[r>>8].dcolour>>8)&0xFF;
tb = (parts[r>>8].dcolour)&0xFF;
ta = (parts[r>>8].dcolour>>24)&0xFF;
mr = (parts[i].dcolour>>16)&0xFF;
mg = (parts[i].dcolour>>8)&0xFF;
mb = (parts[i].dcolour)&0xFF;
ma = (parts[i].dcolour>>24)&0xFF;
nr = (tr*blend) + (mr*(1-blend));
ng = (tg*blend) + (mg*(1-blend));
nb = (tb*blend) + (mb*(1-blend));
na = (ta*blend) + (ma*(1-blend));
parts[r>>8].dcolour = nr<<16 | ng<<8 | nb | na<<24;
}
}
}
if(((r = photons[y][x])&0xFF)==PT_PHOT || ((r = pmap[y][x])&0xFF)==PT_PHOT)
{
part_change_type(r>>8, x, y, PT_ELEC);
parts[r>>8].ctype = 0;
}
return 0;
}

View File

@@ -1,44 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BMTL(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, tempFactor;
if (parts[i].tmp>1)
{
parts[i].tmp--;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = parts[r>>8].type;
if ((rt==PT_METL || rt==PT_IRON) && 1>(rand()/(RAND_MAX/100)))
{
part_change_type(r>>8,x+rx,y+ry,PT_BMTL);
parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100;
}
}
}
else if (parts[i].tmp==1 && 1>rand()%1000)
{
parts[i].tmp = 0;
part_change_type(i,x,y,PT_BRMT);
}
return 0;
}

View File

@@ -1,68 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BOMB(UPDATE_FUNC_ARGS) {
int r, rx, ry, nb;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_EMBR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_BCLN)
{
int rad = 8;
int nxi;
int nxj;
pmap[y][x] = 0;
for (nxj=-rad; nxj<=rad; nxj++)
for (nxi=-rad; nxi<=rad; nxi++)
if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1)
if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) {
delete_part(x+nxi, y+nxj, 0);
pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
nb = create_part(-3, x+nxi, y+nxj, PT_EMBR);
if (nb!=-1) {
parts[nb].tmp = 2;
parts[nb].life = 2;
parts[nb].temp = MAX_TEMP;
}
}
for (nxj=-(rad+1); nxj<=(rad+1); nxj++)
for (nxi=-(rad+1); nxi<=(rad+1); nxi++)
if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1 && !(pmap[y+nxj][x+nxi]&0xFF)) {
nb = create_part(-3, x+nxi, y+nxj, PT_EMBR);
if (nb!=-1) {
parts[nb].tmp = 0;
parts[nb].life = 50;
parts[nb].temp = MAX_TEMP;
parts[nb].vx = rand()%40-20;
parts[nb].vy = rand()%40-20;
}
}
kill_part(i);
return 1;
}
}
return 0;
}
int graphics_BOMB(GRAPHICS_FUNC_ARGS)
{
*pixel_mode |= PMODE_FLARE;
return 1;
}

View File

@@ -1,58 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BOYL(UPDATE_FUNC_ARGS) {
int r, rx, ry;
if (pv[y/CELL][x/CELL]<(parts[i].temp/100))
pv[y/CELL][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL]);
if (y+CELL<YRES && pv[y/CELL+1][x/CELL]<(parts[i].temp/100))
pv[y/CELL+1][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL+1][x/CELL]);
if (x+CELL<XRES)
{
pv[y/CELL][x/CELL+1] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL+1]);
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.001f*((parts[i].temp/100)-pv[y/CELL+1][x/CELL+1]);
}
if (y-CELL>=0 && pv[y/CELL-1][x/CELL]<(parts[i].temp/100))
pv[y/CELL-1][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL]);
if (x-CELL>=0)
{
pv[y/CELL][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL-1]);
if (y-CELL>=0)
pv[y/CELL-1][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL-1]);
}
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 &&
x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR && 1>rand()%30)
{
part_change_type(r>>8,x+rx,y+ry,PT_FOG);
}
else if ((r&0xFF)==PT_O2 && 1>rand()%9)
{
kill_part(r>>8);
part_change_type(i,x,y,PT_WATR);
pv[y/CELL][x/CELL] += 4.0;
}
}
return 0;
}

View File

@@ -1,30 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BREL(UPDATE_FUNC_ARGS) {
int np;
if (1>rand()%200 && (pv[y/CELL][x/CELL] > 30.0f) && parts[i].temp>9000 && parts[i].life>0)
{
part_change_type(i, x ,y ,PT_EXOT);
parts[i].life = 1000;
}
if ((pv[y/CELL][x/CELL] > 10.0f) && (parts[i].life>0)) {
parts[i].temp = parts[i].temp + (pv[y/CELL][x/CELL])/8;
}
return 0;
}

View File

@@ -1,49 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BRMT(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, tempFactor;
if (parts[i].temp > (250.0f+273.15f))
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = parts[r>>8].type;
tempFactor = 1000 - (((250.0f+273.15f)-parts[i].temp)*2);
if(tempFactor < 2)
tempFactor = 2;
if ((rt==PT_BREL) && 1 > (rand()%tempFactor))
{
if(rand()%2)
{
create_part(r>>8, x+rx, y+ry, PT_THRM);
}
else
{ create_part(i, x, y, PT_THRM);
}
return 1;
//part_change_type(r>>8,x+rx,y+ry,PT_BMTL);
//parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100;
}
}
}
return 0;
}

View File

@@ -1,39 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_BTRY(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = parts[r>>8].type;
if (parts_avg(i,r>>8,PT_INSL) != PT_INSL)
{
if ((ptypes[rt].properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && abs(rx)+abs(ry) < 4)
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
part_change_type(r>>8,x+rx,y+ry,PT_SPRK);
}
}
}
return 0;
}

View File

@@ -1,39 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_C5(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)!=PT_C5 && parts[r>>8].temp<100 && ptypes[r&0xFF].hconduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) || (r&0xFF)==PT_HFLM)
{
if (1>rand()%6)
{
part_change_type(i,x,y,PT_HFLM);
parts[r>>8].temp = parts[i].temp = 0;
parts[i].life = rand()%150+50;
pv[y/CELL][x/CELL] += 1.5;
}
}
}
return 0;
}

View File

@@ -1,50 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CAUS(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_ACID && (r&0xFF)!=PT_CAUS)
{
if (((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[r&0xFF].hardness>(rand()%1000))&&parts[i].life>=50)
{
if (parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid
{
float newtemp = ((60.0f-(float)ptypes[r&0xFF].hardness))*7.0f;
if(newtemp < 0){
newtemp = 0;
}
parts[i].temp += newtemp;
parts[i].life--;
kill_part(r>>8);
}
}
else if (parts[i].life<=50)
{
kill_part(i);
return 1;
}
}
}
return 0;
}

View File

@@ -1,105 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CBNW(UPDATE_FUNC_ARGS) {
int r, rx, ry, oldt;
oldt = parts[i].tmp;
if (pv[y/CELL][x/CELL]<=3)
{
if(20>(rand()%80000))
{
part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
pv[y/CELL][x/CELL] += 0.5f;
}
else if(pv[y/CELL][x/CELL]<=-0.5)
{
part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
pv[y/CELL][x/CELL] += 0.5f;
}
}
if (parts[i].tmp>0)
parts[i].tmp--;
if(!(rand()%200))
{
parts[i].tmp2 = rand()%40;
} else if(parts[i].tmp2!=20) {
parts[i].tmp2 -= (parts[i].tmp2>20)?1:-1;
}
if(oldt==1)
{
//Explode
if(rand()%4)
{
part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
pv[y/CELL][x/CELL] += 0.2f;
}
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (ptypes[r&0xFF].properties&TYPE_PART && parts[i].tmp == 0 && 1>(rand()%250))
{
//Start explode
parts[i].tmp = rand()%25;//(rand()%100)+50;
}
else if(ptypes[r&0xFF].properties&TYPE_SOLID && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_GLAS && parts[i].tmp == 0 && (2-pv[y/CELL][x/CELL])>(rand()%20000))
{
if(rand()%2)
{
part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
pv[y/CELL][x/CELL] += 0.2f;
}
}
if ((r&0xFF)==PT_CBNW)
{
if(!parts[i].tmp && parts[r>>8].tmp)
{
parts[i].tmp = parts[r>>8].tmp;
if((r>>8)>i) //If the other particle hasn't been life updated
parts[i].tmp--;
}
else if(parts[i].tmp && !parts[r>>8].tmp)
{
parts[r>>8].tmp = parts[i].tmp;
if((r>>8)>i) //If the other particle hasn't been life updated
parts[r>>8].tmp++;
}
}
if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (legacy_enable||parts[i].temp>(273.15f+12.0f)) && 1>(rand()%500))
{
part_change_type(i,x,y,PT_FIRE);
parts[i].life = 4;
parts[i].ctype = PT_WATR;
}
if ((r&0xFF)==PT_FIRE && parts[r>>8].ctype!=PT_WATR){
kill_part(r>>8);
if(1>(rand()%150)){
kill_part(i);
return 1;
}
}
}
return 0;
}

View File

@@ -1,55 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CLNE(UPDATE_FUNC_ARGS) {
if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !ptypes[parts[i].ctype].enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOLALT)))
{
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = photons[y+ry][x+rx];
if (!r)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
(r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
(r&0xFF)<PT_NUM)
{
parts[i].ctype = r&0xFF;
if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
parts[i].tmp = parts[r>>8].ctype;
}
}
}
else {
if (parts[i].ctype==PT_LIFE) create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8));
else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0)
{
int np = create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0)
{
if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && ptransitions[parts[i].tmp].tht==PT_LAVA)
parts[np].ctype = parts[i].tmp;
}
}
}
return 0;
}

View File

@@ -1,53 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CLST(UPDATE_FUNC_ARGS) {
int r, rx, ry;
float cxy;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR && 1>(rand()%1500))
{
part_change_type(i,x,y,PT_PSTS);
kill_part(r>>8);
}
if ((r&0xFF)==PT_NITR)
{
create_part(i, x, y, PT_BANG);
create_part(r>>8, x+rx, y+ry, PT_BANG);
}
if ((r&0xFF)==PT_CLST)
{
if(parts[i].temp <195)
cxy = 0.05;
if(parts[i].temp >= 195 && parts[i].temp <295)
cxy = 0.015;
if(parts[i].temp >= 295 && parts[i].temp <350)
cxy = 0.01;
if(parts[i].temp > 350)
cxy = 0.005;
parts[i].vx += cxy*rx;
parts[i].vy += cxy*ry;//These two can be set not to calculate over 350 later. They do virtually nothing over 0.005.
}
}
return 0;
}

View File

@@ -1,63 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CO2(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (parts[i].ctype==5 && 20>(rand()%40000))
{
if (create_part(-1, x+rx, y+ry, PT_WATR)>=0)
parts[i].ctype = 0;
}
if ((r>>8)>=NPART || !r)
continue;
if ((r&0xFF)==PT_FIRE){
kill_part(r>>8);
if(1>(rand()%150)){
kill_part(i);
return 1;
}
}
if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && 1>(rand()%250))
{
part_change_type(r>>8, x+rx, y+ry, PT_CBNW);
if (parts[i].ctype==5) //conserve number of water particles - ctype=5 means this CO2 hasn't released the water particle from BUBW yet
create_part(i, x, y, PT_WATR);
else
kill_part(i);
}
}
if (parts[i].temp > 9773.15 && pv[y/CELL][x/CELL] > 200.0f)
{
if (rand()%5 < 1)
{
int j;
create_part(i,x,y,PT_O2);
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = 15000;
if (!(rand()%50)) { j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = 15000; }
parts[i].temp = 15000;
pv[y/CELL][x/CELL] += 100;
}
}
return 0;
}

View File

@@ -1,90 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_COAL(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, temp;
if (parts[i].life<=0) {
create_part(i, x, y, PT_FIRE);
return 1;
} else if (parts[i].life < 100) {
parts[i].life--;
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE);
}
if ((pv[y/CELL][x/CELL] > 4.3f)&&parts[i].tmp>40)
parts[i].tmp=39;
else if (parts[i].tmp<40&&parts[i].tmp>0)
parts[i].tmp--;
else if (parts[i].tmp<=0) {
create_part(i, x, y, PT_BCOL);
return 1;
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
{
if (parts[i].life>100) {
parts[i].life = 99;
}
}
if ((r&0xFF)==PT_LAVA && 1>(rand()%500))
{
if (parts[r>>8].ctype == PT_IRON) {
parts[r>>8].ctype = PT_METL;
kill_part(i);
return 1;
}
}
}
/*if(100-parts[i].life > parts[i].tmp2)
parts[i].tmp2 = 100-parts[i].life;
if(parts[i].tmp2 < 0) parts[i].tmp2 = 0;
for ( trade = 0; trade<4; trade ++)
{
rx = rand()%5-2;
ry = rand()%5-2;
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_COAL || (r&0xFF)==PT_BCOL)&&(parts[i].tmp2>parts[r>>8].tmp2)&&parts[i].tmp2>0)//diffusion
{
int temp = parts[i].tmp2 - parts[r>>8].tmp2;
if(temp < 10)
continue;
if (temp ==1)
{
parts[r>>8].tmp2 ++;
parts[i].tmp2 --;
}
else if (temp>0)
{
parts[r>>8].tmp2 += temp/2;
parts[i].tmp2 -= temp/2;
}
}
}
}*/
if(parts[i].temp > parts[i].tmp2)
parts[i].tmp2 = parts[i].temp;
return 0;
}

View File

@@ -1,60 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_CONV(UPDATE_FUNC_ARGS) {
int r, rx, ry;
if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !ptypes[parts[i].ctype].enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOLALT)))
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = photons[y+ry][x+rx];
if (!r)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
(r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
(r&0xFF)!=PT_CONV && (r&0xFF)<PT_NUM)
{
parts[i].ctype = r&0xFF;
if ((r&0xFF)==PT_LIFE)
parts[i].tmp = parts[r>>8].ctype;
}
}
}
else if(parts[i].ctype>0 && parts[i].ctype<PT_NUM && ptypes[parts[i].ctype].enabled && parts[i].ctype!=PT_CONV) {
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = photons[y+ry][x+rx];
if (!r)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if((r&0xFF)!=PT_CONV && (r&0xFF)!=PT_DMND && (r&0xFF)!=parts[i].ctype)
{
if (parts[i].ctype==PT_LIFE) create_part(r>>8, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
else create_part(r>>8, x+rx, y+ry, parts[i].ctype);
}
}
}
return 0;
}

View File

@@ -1,81 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_DEST(UPDATE_FUNC_ARGS) {
int r,rx,ry,topv;
rx=rand()%5-2;
ry=rand()%5-2;
r = pmap[y+ry][x+rx];
if (!r || (r&0xFF)==PT_DEST || (r&0xFF)==PT_DMND || (r&0xFF)==PT_BCLN || (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_PBCN)
return 0;
if (parts[i].life<=0 || parts[i].life>37)
{
parts[i].life=30+rand()%20;
parts[i].temp+=20000;
pv[y/CELL][x/CELL]+=60.0f;
}
parts[i].temp+=10000;
if ((r&0xFF)==PT_PLUT || (r&0xFF)==PT_DEUT)
{
pv[y/CELL][x/CELL]+=20.0f;
parts[i].temp+=18000;
if (rand()%2==0)
{
float orig_temp = parts[r>>8].temp;
create_part(r>>8, x+rx, y+ry, PT_NEUT);
parts[r>>8].temp = restrict_flt(orig_temp+40000.0f, MIN_TEMP, MAX_TEMP);
pv[y/CELL][x/CELL] += 10.0f;
parts[i].life-=4;
}
}
else if ((r&0xFF)==PT_INSL)
{
create_part(r>>8, x+rx, y+ry, PT_PLSM);
}
else if (rand()%3==0)
{
kill_part(r>>8);
parts[i].life -= 4*((ptypes[r&0xFF].properties&TYPE_SOLID)?3:1);
if (parts[i].life<=0)
parts[i].life=1;
parts[i].temp+=10000;
}
else
{
if (ptypes[r&0xFF].hconduct) parts[r>>8].temp = restrict_flt(parts[r>>8].temp+10000.0f, MIN_TEMP, MAX_TEMP);
}
topv=pv[y/CELL][x/CELL]/9+parts[r>>8].temp/900;
if (topv>40.0f)
topv=40.0f;
pv[y/CELL][x/CELL]+=40.0f+topv;
parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
return 0;
}
int graphics_DEST(GRAPHICS_FUNC_ARGS)
{
if(cpart->life)
{
*pixel_mode |= PMODE_LFLARE;
}
else
{
*pixel_mode |= PMODE_SPARK;
}
return 0;
}

View File

@@ -1,109 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_DEUT(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, np;
float gravtot = fabs(gravy[(y/CELL)*(XRES/CELL)+(x/CELL)])+fabs(gravx[(y/CELL)*(XRES/CELL)+(x/CELL)]);
int maxlife = ((10000/(parts[i].temp + 1))-1);
if ((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1))
maxlife ++;
// Compress when Newtonian gravity is applied
// multiplier=1 when gravtot=0, multiplier -> 5 as gravtot -> inf
maxlife = maxlife*(5.0f - 8.0f/(gravtot+2.0f));
if (parts[i].life < maxlife)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r || (parts[i].life >=maxlife))
continue;
if ((r&0xFF)==PT_DEUT&&33>=rand()/(RAND_MAX/100)+1)
{
if ((parts[i].life + parts[r>>8].life + 1) <= maxlife)
{
parts[i].life += parts[r>>8].life + 1;
kill_part(r>>8);
}
}
}
}
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (parts[i].life<=maxlife)
continue;
if ((!r)&&parts[i].life>=1)//if nothing then create deut
{
np = create_part(-1,x+rx,y+ry,PT_DEUT);
if (np<0) continue;
parts[i].life--;
parts[np].temp = parts[i].temp;
parts[np].life = 0;
}
}
for ( trade = 0; trade<4; trade ++)
{
rx = rand()%5-2;
ry = rand()%5-2;
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_DEUT&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion
{
int temp = parts[i].life - parts[r>>8].life;
if (temp ==1)
{
parts[r>>8].life ++;
parts[i].life --;
}
else if (temp>0)
{
parts[r>>8].life += temp/2;
parts[i].life -= temp/2;
}
}
}
}
return 0;
}
int graphics_DEUT(GRAPHICS_FUNC_ARGS)
{
if(cpart->life>=240)
{
*firea = 60;
*firer = *colr += cpart->life*1;
*fireg = *colg += cpart->life*2;
*fireb = *colb += cpart->life*3;
*pixel_mode |= PMODE_GLOW | FIRE_ADD;
}
else
{
*colr += cpart->life*1;
*colg += cpart->life*2;
*colb += cpart->life*3;
*pixel_mode |= PMODE_BLUR;
}
return 0;
}

View File

@@ -1,63 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_DLAY(UPDATE_FUNC_ARGS) {
int r, rx, ry, oldl;
oldl = parts[i].life;
if (parts[i].life>0)
parts[i].life--;
//if (parts[i].life==1)
//{
if (parts[i].temp>=MAX_TEMP+273.15f)
parts[i].temp = MAX_TEMP+273.15f;
if (parts[i].temp<= 1.0f+273.15f)
parts[i].temp = 1.0f+273.15f;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r || parts_avg(r>>8, i,PT_INSL)==PT_INSL)
continue;
if ((r&0xFF)==PT_SPRK && parts[i].life==0 && parts[r>>8].life>0 && parts[r>>8].life<4 && parts[r>>8].ctype==PT_PSCN)
{
parts[i].life = (int)(parts[i].temp-273.15);
}
else if ((r&0xFF)==PT_DLAY)
{
if(!parts[i].life && parts[r>>8].life)
{
parts[i].life = parts[r>>8].life;
if((r>>8)>i) //If the other particle hasn't been life updated
parts[i].life--;
}
else if(parts[i].life && !parts[r>>8].life)
{
parts[r>>8].life = parts[i].life;
if((r>>8)>i) //If the other particle hasn't been life updated
parts[r>>8].life++;
}
}
else if((r&0xFF)==PT_NSCN && oldl==1)
{
create_part(-1, x+rx, y+ry, PT_SPRK);
}
}
//}
return 0;
}

View File

@@ -1,56 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_DSTW(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SALT && 1>(rand()%250))
{
part_change_type(i,x,y,PT_SLTW);
// on average, convert 3 DSTW to SLTW before SALT turns into SLTW
if (rand()%3==0)
part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
}
if (((r&0xFF)==PT_WATR||(r&0xFF)==PT_SLTW) && 1>(rand()%500))
{
part_change_type(i,x,y,PT_WATR);
}
if ((r&0xFF)==PT_SLTW && 1>(rand()%10000))
{
part_change_type(i,x,y,PT_SLTW);
}
if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (legacy_enable||parts[i].temp>12.0f) && 1>(rand()%500))
{
part_change_type(i,x,y,PT_FIRE);
parts[i].life = 4;
}
if ((r&0xFF)==PT_FIRE){
kill_part(r>>8);
if(1>(rand()%150)){
kill_part(i);
return 1;
}
}
}
return 0;
}

View File

@@ -1,59 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_DTEC(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, rd = parts[i].tmp2;
if (rd > 25) parts[i].tmp2 = rd = 25;
if (parts[i].life)
{
parts[i].life = 0;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = parts[r>>8].type;
if (parts_avg(i,r>>8,PT_INSL) != PT_INSL)
{
if ((ptypes[rt].properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && in_radius(rd, rx, ry))
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
part_change_type(r>>8,x+rx,y+ry,PT_SPRK);
}
}
}
}
for (rx=-rd; rx<rd+1; rx++)
for (ry=-rd; ry<rd+1; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (parts[r>>8].type == parts[i].ctype && (parts[i].ctype != PT_LIFE || parts[i].tmp == parts[r>>8].tmp))
parts[i].life = 1;
}
return 0;
}
int in_radius(int rd, int x, int y)
{
return (pow((double)x,2)*pow((double)rd,2)+pow((double)y,2)*pow((double)rd,2)<=pow((double)rd,2)*pow((double)rd,2));
}

View File

@@ -1,121 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_ELEC(UPDATE_FUNC_ARGS) {
int r, rt, rx, ry, nb, rrx, rry;
float rr, rrr;
parts[i].pavg[0] = x;
parts[i].pavg[1] = y;
if(pmap[y][x]==PT_GLOW)
{
part_change_type(i, x, y, PT_PHOT);
}
for (rx=-2; rx<=2; rx++)
for (ry=-2; ry<=2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
r = pmap[y+ry][x+rx];
if (!r)
r = photons[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_GLAS)
{
for (rrx=-1; rrx<=1; rrx++)
{
for (rry=-1; rry<=1; rry++)
{
if (x+rx+rrx>=0 && y+ry+rry>=0 && x+rx+rrx<XRES && y+ry+rry<YRES) {
nb = create_part(-1, x+rx+rrx, y+ry+rry, PT_EMBR);
if (nb!=-1) {
parts[nb].tmp = 0;
parts[nb].life = 50;
parts[nb].temp = parts[i].temp*0.8f;
parts[nb].vx = rand()%20-10;
parts[nb].vy = rand()%20-10;
}
}
}
}
fire_r[y/CELL][x/CELL] += rand()%200; //D: Doesn't work with OpenGL, also shouldn't be here
fire_g[y/CELL][x/CELL] += rand()%200;
fire_b[y/CELL][x/CELL] += rand()%200;
/* possible alternative, but doesn't work well at the moment because FIRE_ADD divides firea by 8, so the glow isn't strong enough
create_part(i, x, y, PT_EMBR);
parts[i].tmp = 2;
parts[i].life = 2;
parts[i].ctype = ((rand()%200)<<16) | ((rand()%200)<<8) | (rand()%200);
*/
kill_part(i);
return 1;
}
if ((r&0xFF)==PT_LCRY)
{
parts[r>>8].tmp2 = 5+rand()%5;
}
if ((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_CBNW)
{
if(rand()<RAND_MAX/3)
{
create_part(r>>8, x+rx, y+ry, PT_O2);
}
else
{
create_part(r>>8, x+rx, y+ry, PT_H2);
}
kill_part(i);
return 1;
}
if ((r&0xFF)==PT_NEUT && !pmap[y+ry][x+rx])
{
part_change_type(r>>8, x+rx, y+ry, PT_H2);
parts[r>>8].life = 0;
parts[r>>8].ctype = 0;
}
if ((r&0xFF)==PT_DEUT)
{
if(parts[r>>8].life < 6000)
parts[r>>8].life += 1;
parts[r>>8].temp = 0;
parts[i].temp = 0;
kill_part(i);
return 1;
}
if ((r&0xFF)==PT_EXOT)
{
parts[r>>8].tmp2 += 5;
parts[r>>8].life = 1000;
}
if (ptypes[r&0xFF].properties & PROP_CONDUCTS && ((r&0xFF)!=PT_NBLE||parts[i].temp<2273.15))
{
create_part(-1, x+rx, y+ry, PT_SPRK);
kill_part(i);
return 1;
}
}
return 0;
}
int graphics_ELEC(GRAPHICS_FUNC_ARGS)
{
*firea = 70;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
*pixel_mode |= FIRE_ADD;
return 0;
}

View File

@@ -1,27 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_MISC(UPDATE_FUNC_ARGS) {
int t = parts[i].type;
if (t==PT_LOVE)
ISLOVE=1;
else if (t==PT_LOLZ)
ISLOLZ=1;
else if (t==PT_GRAV)
ISGRAV=1;
return 0;
}

View File

@@ -1,94 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
/* ctype - colour RRGGBB (optional)
* life - decremented each frame, disappears when life reaches zero
* tmp - mode
* 0 - BOMB sparks
* 1 - firework sparks (colour defaults to white)
* 2 - flash (colour defaults to white)
*/
int update_EMBR(UPDATE_FUNC_ARGS) {
int r, rx, ry, nb;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((ptypes[r&0xFF].properties & (TYPE_SOLID | TYPE_PART | TYPE_LIQUID)) && !(ptypes[r&0xFF].properties & PROP_SPARKSETTLE))
{
kill_part(i);
return 1;
}
}
return 0;
}
int graphics_EMBR(GRAPHICS_FUNC_ARGS)
{
if (cpart->ctype&0xFFFFFF)
{
int maxComponent;
*colr = (cpart->ctype&0xFF0000)>>16;
*colg = (cpart->ctype&0x00FF00)>>8;
*colb = (cpart->ctype&0x0000FF);
maxComponent = *colr;
if (*colg>maxComponent) maxComponent = *colg;
if (*colb>maxComponent) maxComponent = *colb;
if (maxComponent<60)//make sure it isn't too dark to see
{
float multiplier = 60.0f/maxComponent;
*colr *= multiplier;
*colg *= multiplier;
*colb *= multiplier;
}
}
else if (cpart->tmp != 0)
{
*colr = *colg = *colb = 255;
}
if (decorations_enable && cpart->dcolour)
{
int a = (cpart->dcolour>>24)&0xFF;
*colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8;
*colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8;
*colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
}
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
if (cpart->tmp==1)
{
*pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW;
*firea = (cpart->life-15)*4;
*cola = (cpart->life+15)*4;
}
else if (cpart->tmp==2)
{
*pixel_mode = PMODE_FLAT | FIRE_ADD;
*firea = 255;
}
else
{
*pixel_mode = PMODE_SPARK | PMODE_ADD;
if (cpart->life<64) *cola = 4*cpart->life;
}
return 0;
}

View File

@@ -1,143 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_EMP(UPDATE_FUNC_ARGS) {
int r,rx,ry,ok=0,t,n,nx,ny;
if (parts[i].life)
return 0;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SPRK && parts[r>>8].life>0 && parts[r>>8].life<4)
{
ok=1;
break;
}
}
if (!ok)
return 0;
parts[i].life=220;
emp_decor+=3;
if (emp_decor>40)
emp_decor=40;
for (r=0; r<=parts_lastActiveIndex; r++)
{
t=parts[r].type;
rx=parts[r].x;
ry=parts[r].y;
if (t==PT_SPRK || (t==PT_SWCH && parts[r].life!=0 && parts[r].life!=10) || (t==PT_WIRE && parts[r].ctype>0))
{
int is_elec=0;
if ((parts[r].ctype==PT_PSCN || parts[r].ctype==PT_NSCN || parts[r].ctype==PT_PTCT ||
parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH) || t==PT_WIRE || t==PT_SWCH)
{
is_elec=1;
if (ptypes[parts[r].type].hconduct && rand()%100==0)
parts[r].temp = restrict_flt(parts[r].temp+3000.0f, MIN_TEMP, MAX_TEMP);
if (rand()%80==0)
part_change_type(r, rx, ry, PT_BREL);
else if (rand()%120==0)
part_change_type(r, rx, ry, PT_NTCT);
}
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; ny++)
if (rx+nx>=0 && ry+ny>=0 && rx+nx<XRES && ry+ny<YRES && (rx || ry))
{
n = pmap[ry+ny][rx+nx];
if (!n)
continue;
/*if ((n&0xFF)==PT_BTRY && rand()%60==0)
{
part_change_type(n>>8, rx+nx, ry+ny, PT_PLSM);
parts[n>>8].life=rand()%100+70;
parts[n>>8].temp+=3000;
}*/
//Some elements should only be affected by wire/swch, or by a spark on inst/semiconductor
//So not affected by spark on metl, watr etc
if (is_elec)
{
if (((n&0xFF)==PT_METL || (n&0xFF)==PT_BMTL) && rand()%280==0)
{
parts[n>>8].temp = restrict_flt(parts[n>>8].temp+3000.0f, MIN_TEMP, MAX_TEMP);
}
if ((n&0xFF)==PT_BMTL && rand()%160==0)
{
part_change_type(n>>8, rx+nx, ry+ny, PT_BMTL);//TODO: Redundant, was this meant to be BRMT or something?
parts[n>>8].temp = restrict_flt(parts[n>>8].temp+1000.0f, MIN_TEMP, MAX_TEMP);
}
if ((n&0xFF)==PT_METL && rand()%300==0)
{
part_change_type(n>>8, rx+nx, ry+ny, PT_BMTL);
}
if ((n&0xFF)==PT_WIFI && rand()%8==0)
{
//Randomise channel
parts[n>>8].temp = rand()%MAX_TEMP;
}
if ((n&0xFF)==PT_WIFI && rand()%16==0)
{
create_part(n>>8, rx+nx, ry+ny, PT_BREL);
parts[n>>8].temp = restrict_flt(parts[n>>8].temp+1000.0f, MIN_TEMP, MAX_TEMP);
}
}
if ((n&0xFF)==PT_SWCH && rand()%100==0)
{
part_change_type(n>>8, rx+nx, ry+ny, PT_BREL);
}
if ((n&0xFF)==PT_SWCH && rand()%100==0)
{
parts[n>>8].temp = restrict_flt(parts[n>>8].temp+2000.0f, MIN_TEMP, MAX_TEMP);
}
if ((n&0xFF)==PT_ARAY && rand()%60==0)
{
create_part(n>>8, rx+nx, ry+ny, PT_BREL);
parts[n>>8].temp = restrict_flt(parts[n>>8].temp+1000.0f, MIN_TEMP, MAX_TEMP);
}
if (t==PT_DLAY && rand()%70==0)
{
//Randomise delay
parts[n>>8].temp = (rand()%256) + 273.15f;
}
}
}
}
return 0;
}
int graphics_EMP(GRAPHICS_FUNC_ARGS)
{
if(cpart->life)
{
*colr = cpart->life*1.5;
*colg = cpart->life*1.5;
*colb = 200-(cpart->life);
if (*colr>255)
*colr = 255;
if (*colg>255)
*colg = 255;
if (*colb>255)
*colb = 255;
if (*colb<=0)
*colb = 0;
}
return 0;
}

View File

@@ -1,159 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_EXOT(UPDATE_FUNC_ARGS) {
int r, rt, rx, ry, nb, rrx, rry, trade, tym, t;
t = parts[i].type;
for (rx=-2; rx<=2; rx++)
for (ry=-2; ry<=2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WARP)
{
if (parts[r>>8].tmp2>2000)
if (1>rand()%100)
{
parts[i].tmp2 += 100;
}
}
if ((r&0xFF)==PT_EXOT && parts[r>>8].life==1500 && 1>rand()%1000)
parts[i].life = 1500;
if ((parts[i].tmp>245) && (parts[i].life>1000))
if ((r&0xFF)!=PT_EXOT && (r&0xFF)!=PT_BREL && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_NBHL && (r&0xFF)!=PT_WARP && (r&0xFF)!=PT_NEUT)
{
create_part(i, x, y, parts[r>>8].type);
return 0;
}
}
parts[i].tmp--;
parts[i].tmp2--;
if (parts[i].tmp<1 || parts[i].tmp>250)
parts[i].tmp = 250;
if (parts[i].tmp2<1)
parts[i].tmp2 = 1;
else if (parts[i].tmp2>6000)
{
parts[i].tmp2 = 10000;
if (parts[i].life<1001)
{
part_change_type(i, x, y, PT_WARP);
return 0;
}
}
else if (parts[i].life<1001)
pv[y/CELL][x/CELL] += (parts[i].tmp2*CFDS)/160000;
if (pv[y/CELL][x/CELL]>200 && parts[i].temp>9000 && parts[i].tmp2>200)
{
parts[i].tmp2 = 6000;
part_change_type(i, x, y, PT_WARP);
return 0;
}
if (parts[i].tmp2>100)
{
for ( trade = 0; trade<9; trade ++)
{
rx = rand()%5-2;
ry = rand()%5-2;
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==t && (parts[i].tmp2>parts[r>>8].tmp2) && parts[r>>8].tmp2>=0 )//diffusion
{
tym = parts[i].tmp2 - parts[r>>8].tmp2;
if (tym ==1)
{
parts[r>>8].tmp2 ++;
parts[i].tmp2 --;
break;
}
if (tym>0)
{
parts[r>>8].tmp2 += tym/2;
parts[i].tmp2 -= tym/2;
break;
}
}
}
}
}
if (parts[i].temp<273.15f)
{
parts[i].vx = 0;
parts[i].vy = 0;
pv[y/CELL][x/CELL] -= 0.01;
parts[i].tmp--;
}
return 0;
}
int graphics_EXOT(GRAPHICS_FUNC_ARGS)
{
int q = cpart->temp;
int b = cpart->tmp;
int c = cpart->tmp2;
if (cpart->life < 1001)
{
if ((cpart->tmp2 - 1)>rand()%1000)
{
float frequency = 0.04045;
*colr = (sin(frequency*c + 4) * 127 + 150);
*colg = (sin(frequency*c + 6) * 127 + 150);
*colb = (sin(frequency*c + 8) * 127 + 150);
*firea = 100;
*firer = 0;
*fireg = 0;
*fireb = 0;
*pixel_mode |= PMODE_FLAT;
*pixel_mode |= PMODE_FLARE;
}
else
{
float frequency = 0.00045;
*colr = (sin(frequency*q + 4) * 127 + (b/1.7));
*colg = (sin(frequency*q + 6) * 127 + (b/1.7));
*colb = (sin(frequency*q + 8) * 127 + (b/1.7));
*cola = cpart->tmp / 6;
*firea = *cola;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_BLUR;
}
}
else
{
float frequency = 0.01300;
*colr = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80));
*colg = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80));
*colb = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80));
*cola = cpart->tmp / 6;
*firea = *cola;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_BLUR;
}
return 0;
}

View File

@@ -1,105 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FIGH(UPDATE_FUNC_ARGS)
{
playerst* figh = &fighters[(unsigned char)parts[i].tmp];
unsigned int tarx, tary;
parts[i].tmp2 = 0; //0 - stay in place, 1 - seek a stick man
//Set target coords
if (player.spwn && player2.spwn)
{
if ((pow(player.legs[2]-x, 2) + pow(player.legs[3]-y, 2))<=
(pow(player2.legs[2]-x, 2) + pow(player2.legs[3]-y, 2)))
{
tarx = (unsigned int)player.legs[2];
tary = (unsigned int)player.legs[3];
}
else
{
tarx = (unsigned int)player2.legs[2];
tary = (unsigned int)player2.legs[3];
}
parts[i].tmp2 = 1;
}
else
{
if (player.spwn)
{
tarx = (unsigned int)player.legs[2];
tary = (unsigned int)player.legs[3];
parts[i].tmp2 = 1;
}
if (player2.spwn)
{
tarx = (unsigned int)player2.legs[2];
tary = (unsigned int)player2.legs[3];
parts[i].tmp2 = 1;
}
}
switch (parts[i].tmp2)
{
case 1:
if ((pow(tarx-x, 2) + pow(tary-y, 2))<600)
{
if (figh->elem == PT_LIGH || figh->elem == PT_NEUT
|| ptypes[figh->elem].properties&(PROP_DEADLY|PROP_RADIOACTIVE)
|| ptypes[figh->elem].heat>=323 || ptypes[figh->elem].heat<=243)
figh->comm = (int)figh->comm | 0x08;
}
else
if (tarx<x)
{
if(!(eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL)
&& eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+3, NULL)))
figh->comm = 0x01;
else
figh->comm = 0x02;
if (!eval_move(PT_FIGH, figh->legs[4]-4, figh->legs[5]-1, NULL)
|| !eval_move(PT_FIGH, figh->legs[12]-4, figh->legs[13]-1, NULL)
|| eval_move(PT_FIGH, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
else
{
if (!(eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL)
&& eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+3, NULL)))
figh->comm = 0x02;
else
figh->comm = 0x01;
if (!eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| !eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| eval_move(PT_FIGH, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
break;
default:
figh->comm = 0;
break;
}
figh->pcomm = figh->comm;
run_stickman(figh, UPDATE_FUNC_SUBCALL_ARGS);
return 0;
}

View File

@@ -1,34 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int graphics_FIRE(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)flm_data[caddress];
*colg = (unsigned char)flm_data[caddress+1];
*colb = (unsigned char)flm_data[caddress+2];
*firea = 255;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
*pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
*pixel_mode |= FIRE_ADD;
//Returning 0 means dynamic, do not cache
return 0;
}

View File

@@ -1,82 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
#include "hmap.h"
int update_FIRW(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, np;
if (parts[i].tmp<=0) {
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = parts[r>>8].type;
if (rt==PT_FIRE||rt==PT_PLSM||rt==PT_THDR)
{
float gx, gy, multiplier;
get_gravity_field(x, y, ptypes[PT_FIRW].gravity, 1.0f, &gx, &gy);
if (gx*gx+gy*gy < 0.001f)
{
float angle = (rand()%6284)*0.001f;//(in radians, between 0 and 2*pi)
gx += sinf(angle)*ptypes[PT_FIRW].gravity*0.5f;
gy += cosf(angle)*ptypes[PT_FIRW].gravity*0.5f;
}
parts[i].tmp = 1;
parts[i].life = rand()%10+20;
multiplier = (parts[i].life+20)*0.2f/sqrtf(gx*gx+gy*gy);
parts[i].vx -= gx*multiplier;
parts[i].vy -= gy*multiplier;
return 0;
}
}
}
else if (parts[i].tmp==1) {
if (parts[i].life<=0) {
parts[i].tmp=2;
} else {
parts[i].flags &= ~FLAG_STAGNANT;
}
}
else if (parts[i].tmp>=2) {
float angle, magnitude;
int caddress = (rand()%200)*3;
int n;
unsigned col = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2]));
for (n=0; n<40; n++)
{
np = create_part(-3, x, y, PT_EMBR);
if (np>-1)
{
magnitude = ((rand()%60)+40)*0.05f;
angle = (rand()%6284)*0.001f;//(in radians, between 0 and 2*pi)
parts[np].vx = parts[i].vx*0.5f + cosf(angle)*magnitude;
parts[np].vy = parts[i].vy*0.5f + sinf(angle)*magnitude;
parts[np].ctype = col;
parts[np].tmp = 1;
parts[np].life = rand()%40+70;
parts[np].temp = (rand()%500)+5750.0f;
parts[np].dcolour = parts[i].dcolour;
}
}
pv[y/CELL][x/CELL] += 8.0f;
kill_part(i);
return 1;
}
return 0;
}

View File

@@ -1,37 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FOG(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (ptypes[r&0xFF].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!((r&0xFF)==PT_CLNE||(r&0xFF)==PT_PCLN)) // TODO: should this also exclude BCLN?
{
part_change_type(i,x,y,PT_RIME);
}
if ((r&0xFF)==PT_SPRK)
{
parts[i].life += rand()%20;
}
}
return 0;
}

View File

@@ -1,44 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FRAY(UPDATE_FUNC_ARGS) {
int r, nxx, nyy, docontinue, len, nxi, nyi, rx, ry, nr, ry1, rx1;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SPRK) {
for (docontinue = 1, nxx = 0, nyy = 0, nxi = rx*-1, nyi = ry*-1, len = 0; docontinue; nyy+=nyi, nxx+=nxi, len++) {
if (!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0) || len>10) {
break;
}
r = pmap[y+nyi+nyy][x+nxi+nxx];
if (!r)
r = photons[y+nyi+nyy][x+nxi+nxx];
if (r && !(ptypes[r&0xFF].properties & TYPE_SOLID)){
parts[r>>8].vx += nxi*((parts[i].temp-273.15)/10.0f);
parts[r>>8].vy += nyi*((parts[i].temp-273.15)/10.0f);
}
}
}
}
return 0;
}

View File

@@ -1,45 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FRZW(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR&&5>rand()%70)
{
part_change_type(r>>8,x+rx,y+ry,PT_FRZW);
}
}
if (parts[i].life==0&&13>rand()%2500)
{
part_change_type(i,x,y,PT_ICEI);
parts[i].ctype=PT_FRZW;
parts[i].temp = restrict_flt(parts[i].temp-200.0f, MIN_TEMP, MAX_TEMP);
}
else if ((100-(parts[i].life))>rand()%50000)
{
part_change_type(i,x,y,PT_ICEI);
parts[i].ctype=PT_FRZW;
parts[i].temp = restrict_flt(parts[i].temp-200.0f, MIN_TEMP, MAX_TEMP);
}
return 0;
}

View File

@@ -1,40 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FRZZ(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR&&5>rand()%100)
{
part_change_type(r>>8,x+rx,y+ry,PT_FRZW);
parts[r>>8].life = 100;
parts[i].type = PT_NONE;
}
}
if (parts[i].type==PT_NONE) {
kill_part(i);
return 1;
}
return 0;
}

View File

@@ -1,50 +0,0 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <element.h>
int update_FSEP(UPDATE_FUNC_ARGS) {
int r, rx, ry;
if (parts[i].life<=0) {
r = create_part(i, x, y, PT_PLSM);
if (r!=-1)
parts[r].life = 50;
return 1;
} else if (parts[i].life < 40) {
parts[i].life--;
if ((rand()%10)==0) {
r = create_part(-1, (rx=x+rand()%3-1), (ry=y+rand()%3-1), PT_PLSM);
if (r!=-1)
parts[r].life = 50;
}
}
else {
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15))
{
if (parts[i].life>40) {
parts[i].life = 39;
}
}
}
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show More