Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 85102f19b52813267b4c81062d7ccd37938c96dc @japeq committed Dec 4, 2011
Showing with 69,507 additions and 0 deletions.
  1. +13 −0 .gitignore
  2. +10 −0 BlackBeltSorviHero.desktop
  3. +502 −0 COPYING.LGPL
  4. +4 −0 CodingStyle
  5. +13 −0 Makefile
  6. +23 −0 Makefile.common
  7. +12 −0 Makefile.mingw
  8. +25 −0 Makefile.n900
  9. +135 −0 README
  10. BIN Vera.ttf
  11. +368 −0 chisel.cc
  12. +85 −0 chisel.h
  13. +508 −0 common.cc
  14. +186 −0 common.h
  15. +14 −0 control.in
  16. +39 −0 create-pack.py
  17. +32 −0 data/akseli.mtl
  18. +3,020 −0 data/akseli.obj
  19. BIN data/alle60.png
  20. BIN data/awwyeah.ogg
  21. BIN data/back_button.png
  22. +12 −0 data/basic.mtl
  23. +355 −0 data/basic.obj
  24. BIN data/basic_icon.png
  25. BIN data/brick.png
  26. BIN data/buy.ogg
  27. BIN data/buy_button.png
  28. +52 −0 data/chainsaw.mtl
  29. +2,947 −0 data/chainsaw.obj
  30. BIN data/checked.png
  31. BIN data/coin.ogg
  32. BIN data/continue_button.png
  33. BIN data/cutting.ogg
  34. +32 −0 data/deadhand.mtl
  35. +2,853 −0 data/deadhand.obj
  36. BIN data/digits.png
  37. BIN data/endgame.png
  38. BIN data/entername.png
  39. BIN data/explosion.ogg
  40. BIN data/failed.png
  41. BIN data/finished.png
  42. BIN data/floor.png
  43. BIN data/hand_icon.png
  44. BIN data/hayjoo.ogg
  45. BIN data/help.png
  46. BIN data/highscores.png
  47. +42 −0 data/lightsaber.mtl
  48. +9,394 −0 data/lightsaber.obj
  49. BIN data/lightsaber_icon.png
  50. BIN data/lightsaberalways.ogg
  51. BIN data/lightsaberhit.ogg
  52. BIN data/lightsaberpop.ogg
  53. BIN data/lobby.ogg
  54. BIN data/logo.png
  55. BIN data/lux.png
  56. BIN data/magix.png
  57. BIN data/menu_credits.png
  58. BIN data/menu_help.png
  59. BIN data/menu_high.png
  60. BIN data/menu_quit.png
  61. BIN data/menu_settings.png
  62. BIN data/menu_start.png
  63. BIN data/mission.png
  64. BIN data/motor.ogg
  65. BIN data/noise.png
  66. BIN data/overheated.ogg
  67. BIN data/pench.png
  68. +12 −0 data/pro.mtl
  69. +355 −0 data/pro.obj
  70. BIN data/pro_icon.png
  71. BIN data/refused.png
  72. +384 −0 data/room.mtl
  73. +26,485 −0 data/room.obj
  74. BIN data/sanding.ogg
  75. +52 −0 data/scifi.mtl
  76. +4,394 −0 data/scifi.obj
  77. BIN data/scifi_icon.png
  78. BIN data/shop.png
  79. BIN data/shop_button.png
  80. BIN data/smoke.png
  81. BIN data/snake.png
  82. +74 −0 data/sorvi.mtl
  83. +8,259 −0 data/sorvi.obj
  84. BIN data/sorvipop.ogg
  85. BIN data/ss.png
  86. BIN data/start_button.png
  87. BIN data/stop_button.png
  88. +42 −0 data/support.mtl
  89. +582 −0 data/support.obj
  90. BIN data/talttapop.ogg
  91. BIN data/truck.png
  92. +56 −0 data/ultimate.mtl
  93. +2,241 −0 data/ultimate.obj
  94. BIN data/ultimate_icon.png
  95. BIN data/wood.png
  96. +1,197 −0 gl.cc
  97. +247 −0 gl.h
  98. +210 −0 gles_compat.cc
  99. +9 −0 gles_compat.h
  100. +95 −0 highscore/submit.php
  101. +292 −0 http.cc
  102. +4 −0 http.h
  103. +1,092 −0 main.cc
  104. +908 −0 menus.cc
  105. +5 −0 menus.h
  106. BIN models/chainsaw.blend
  107. BIN models/deadhand.blend
  108. BIN models/handle.blend
  109. BIN models/lightsaber.blend
  110. BIN models/room.blend
  111. BIN models/scifi.blend
  112. BIN models/sorvi.blend
  113. BIN models/ultimate.blend
  114. +151 −0 sha1.cc
  115. +16 −0 sha1.h
  116. +358 −0 shop.cc
  117. +2 −0 shop.h
  118. +265 −0 sound.cc
  119. +18 −0 sound.h
  120. +20 −0 utils.cc
  121. +299 −0 utils.h
  122. +6 −0 version.cc.in
  123. +3 −0 version.h
  124. +657 −0 wood.cc
  125. +41 −0 wood.h
13 .gitignore
@@ -0,0 +1,13 @@
+*.o
+*.zip
+BlackBeltSorviHero.exe
+BlackBeltSorviHero.bin
+BlackBeltSorviHero.dat
+*.deb
+bin/
+gen/
+libs/
+obj/
+stdout.txt
+stderr.txt
+version.cc
10 BlackBeltSorviHero.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Type=Application
+Name=BlackBeltSorviHero
+Exec=/opt/BlackBeltSorviHero/BlackBeltSorviHero-n900
+Icon=BlackBeltSorviHero
+X-Osso-Type=application/x-executable
+Terminal=false
+Categories=Game;
502 COPYING.LGPL
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+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
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey 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 library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
4 CodingStyle
@@ -0,0 +1,4 @@
+Linux kernel coding style
+(http://www.kernel.org/doc/Documentation/CodingStyle) with C-style
+comments instead of C++ style. Also, extra braces around single line
+statements are recommended for clarity.
13 Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile for Linux
+#
+CXX = g++
+BINARY = $(NAME).bin
+VERSION = $(shell git describe --always --dirty) $(shell date -I)
+CXXFLAGS = -O2 -Wextra -Wall `sdl-config --cflags` -ansi -pedantic \
+ -Wno-variadic-macros
+LDFLAGS = -lGL -lGLU -lGLEW `sdl-config --libs` -lSDL_ttf -lvorbisfile \
+ -lpng -g
+
+include Makefile.common
+
23 Makefile.common
@@ -0,0 +1,23 @@
+OBJ += main.o gl.o sound.o common.o chisel.o wood.o shop.o utils.o \
+ menus.o http.o sha1.o
+
+NAME = BlackBeltSorviHero
+LINUX_BINARY = $(NAME).bin
+WIN32_BINARY = $(NAME).exe
+all: $(BINARY)
+
+$(BINARY): version.o
+ ./create-pack.py
+ $(CXX) $(OBJ) version.o -o $(BINARY) $(LDFLAGS)
+
+version.cc: $(OBJ)
+ sed -e "s|{VERSION}|$(VERSION)|" <version.cc.in >$@
+
+release: $(BINARY)
+ rm -f "$(NAME)-$(shell date -I).zip"
+ rm -rf $(NAME)
+ mkdir $(NAME)
+ cp -r $(WIN32_BINARY) $(LINUX_BINARY) \
+ $(NAME)-linux-64bit INTRO.txt $(NAME).dat *.dll libraries/ \
+ $(NAME)/
+ zip -r "$(NAME)-$(shell date -I).zip" $(NAME)/
12 Makefile.mingw
@@ -0,0 +1,12 @@
+#
+# Makefile for Windows on Fedora (see README)
+#
+CXX = i686-pc-mingw32-g++
+BINARY = $(NAME).exe
+VERSION = $(shell git describe --always --dirty) $(shell date -I)
+CXXFLAGS = -O2 -Wextra -Wall `/usr/i686-pc-mingw32/sys-root/mingw/bin/sdl-config --cflags` \
+ -Wno-variadic-macros -ffast-math -ansi -pedantic
+LDFLAGS = -lopengl32 -lglu32 -lglew32 `/usr/i686-pc-mingw32/sys-root/mingw/bin/sdl-config --libs` \
+ -lSDL_ttf -lvorbisfile -lpng14 -lwsock32 -g
+
+include Makefile.common
25 Makefile.n900
@@ -0,0 +1,25 @@
+#
+# Makefile for Nokia N900
+#
+CXX = arm-linux-gnueabi-g++
+BINARY = $(NAME)-n900
+VERSION = $(shell date -I)
+PACKAGEVERSION = 1.0.$(shell date +%Y%m%d)
+CXXFLAGS = -O2 -Wextra -Wall `sdl-config --cflags` -ffast-math -ansi -pedantic \
+ -Wno-variadic-macros -DCONFIG_GLES -DCONFIG_SDL_GLES -DCONFIG_N900
+LDFLAGS = -lEGL -lSDL_gles `sdl-config --libs` -lSDL_ttf -lvorbisfile \
+ -lpng -lGLES_CM -g
+OBJ += gles_compat.o
+
+include Makefile.common
+
+package: $(BINARY)
+ rm -rf dpkg
+ mkdir -p dpkg/usr/share/applications/hildon dpkg/opt/$(NAME) \
+ dpkg/usr/share/pixmaps dpkg/DEBIAN
+ sed "s/{VERSION}/$(PACKAGEVERSION)/" \
+ <control.in >dpkg/DEBIAN/control
+ cp $(NAME).png dpkg/usr/share/pixmaps/
+ cp *.desktop dpkg/usr/share/applications/hildon/
+ cp $(BINARY) Vera.ttf $(NAME).dat dpkg/opt/$(NAME)/
+ fakeroot dpkg-deb -b dpkg $(NAME)-n900-$(VERSION).deb
135 README
@@ -0,0 +1,135 @@
+Black Belt Sorvi Hero
+by Pizzalaatikko
+for Windows, Linux and Nokia N900.
+Can be also ported to Android with small effort.
+
+Copyright 2011 Janne Kulmala <janne.t.kulmala@iki.fi>,
+Antti Rajam�ki <amikaze@gmail.com>
+
+Winner of the game development competition at Assembly summer 2011.
+
+Program code and resources are licensed with GNU LGPL 2.1. See
+COPYING.LGPL file.
+
+
+Description
+-----------
+Are you able to handle the difficulties of turning? Your job is to carve
+a given shape out of wood with a chisel. The better you match the shape
+and more accure job you do, the better score you will get. With earned
+score you can buy new faster and stronger chisels. Watch out for going
+too fast, as you might overheat your chisel or break the wood!
+
+You can try to beat the high scores of other users on Internet by
+playing through all the levels!
+
+
+Credits
+-------
+Janne 'Japeq' Kulmala - Code, graphics, models
+Antti 'Amikaze' Rajam�ki - Models, graphics, sounds
+
+
+Required programs and libraries
+-------------------------------
+The following programs and libraries are required to compile the game:
+- GCC C++ compiler
+- SDL 1.2
+- SDL_ttf 2.0
+- GLEW >= 1.5
+- libvorbis
+- libpng
+- OpenGL
+
+Installing the required packages on Fedora (as root):
+ $ yum install gcc-c++ SDL-devel SDL_ttf-devel glew-devel libpng-devel \
+ libvorbis-devel mesa-libGL-devel mesa-libGLU-devel
+
+Installing the required packages on Ubuntu (as root):
+ $ apt-get install g++ libsdl1.2-dev libglew-dev libsdl-ttf2.0-dev \
+ libpng-dev libvorbis-dev libgl1-mesa-dev libglu1-mesa-dev
+
+
+Compiling
+---------
+Compiling on Linux:
+ $ rm *.o
+ $ make
+
+Will result in BlackBeltSorviHero.bin that can be executed.
+
+
+High scores
+-----------
+The high scores on the server are accessed with HTTP. The actual highscore
+list is stored as a text file, called 'BlackBeltSorviHero/highscores.txt'.
+The game submits new highscores to the server by doing a HTTP POST request
+to 'BlackBeltSorviHero/submit.php'. The game fetches the highscore list by
+fetching the text file with a HTTP GET. The host name of the highscore
+server is defined by HIGHSCORE_SERVER in 'menus.cc'.
+
+The validity of the highscore submissions is verified by a signature.
+The signature is sent in the POST request and includes the player's
+name, the score and a secret key. The server checks that it can produce
+the same signature as the game binary, and thus the game and the server
+should agree on the secret key. The secret key is stored in
+HIGHSCORE_SECRET_KEY in 'menu.cc' and 'submit.php'.
+
+
+Cross compiling for Windows on Fedora
+-------------------------------------
+You will need mingw installed on your system. Mingw can be installed with:
+ $ yum install mingw32-gcc-c++ mingw32-SDL mingw32-freetype mingw32-libpng \
+ mingw32-libvorbis
+
+Mingw packages for GLEW and SDL_ttf are not available on Fedora, and
+have to be compiled and installed separately.
+
+GLEW can be installed as follows:
+ 1. Download and extract glew-1.6.0.tgz
+ 2. Compile with:
+ $ make SYSTEM=mingw CC=i686-pc-mingw32-gcc LD=i686-pc-mingw32-gcc
+ 3. Install by executing as root:
+ $ cp lib/libglew32.a /usr/i686-pc-mingw32/lib/
+ $ cp include/GL/*.h /usr/i686-pc-mingw32/include/GL/
+
+SDL_ttf can be installed as follows:
+ 1. Mingw "freetype-config" is broken and can be fixed by executing as root:
+ $ sed -i -e 's/pkg-config/i686-pc-mingw32-pkg-config/g' \
+ /usr/i686-pc-mingw32/sys-root/mingw/bin/freetype-config
+ 2. Download and extract SDL_ttf-2.0.10.tar.gz
+ 3. Compile with:
+ $ ./configure --host=i686-pc-mingw32 \
+ --with-freetype-prefix=/usr/i686-pc-mingw32/sys-root/mingw/
+ $ make
+ 4. Install by executing as root:
+ $ cp SDL_ttf.h /usr/i686-pc-mingw32/sys-root/mingw/include/
+ $ cp libSDL_ttf.a /usr/i686-pc-mingw32/sys-root/mingw/lib/
+
+To compile, execute the following:
+ $ rm *.o
+ $ make -f Makefile.mingw
+
+To build a distributable zip package that includes the Linux and Windows
+versions, run the following. Both binaries must be built before hand and
+the required .dll files must be copied to the source directory.
+ $ make release
+
+
+Cross compiling to Nokia N900
+-----------------------------
+The game can be compiled to N900 inside Scratchbox environment. The game
+requires development files to compile. The files can be installed inside
+Scratchbox with:
+ $ apt-get install libsdl1.2-dev libglew-dev libsdl-ttf2.0-dev \
+ libpng-dev libvorbis-dev
+
+To compile, execute the following inside Scratchbox:
+ $ rm *.o
+ $ make -f Makefile.n900
+
+Installable Debian package can be created with:
+ $ make -f Makefile.n900 release
+
+
+END
BIN Vera.ttf
Binary file not shown.
368 chisel.cc
@@ -0,0 +1,368 @@
+/*
+ * Black Belt Sorvi Hero
+ *
+ * Copyright 2011 Janne Kulmala <janne.t.kulmala@iki.fi>,
+ * Antti Rajamäki <amikaze@gmail.com>
+ *
+ * Program code and resources are licensed with GNU LGPL 2.1. See
+ * COPYING.LGPL file.
+ *
+ * Chisel-related stuff, different chisels
+ */
+#include "chisel.h"
+#include "wood.h"
+#include "sound.h"
+#include <stdio.h>
+
+namespace {
+
+/*
+ int x1;
+ int x2;
+ float depth1;
+ float depth2;
+*/
+const Hole flat_blade[] = {
+ /* terminator */
+ {-1, 0, 0, 0, 0}
+};
+
+const Hole curve_blade[] = {
+ {HOLE_CURVE, 0, 15, 0, -0.1},
+
+ /* terminator */
+ {-1, 0, 0, 0, 0}
+};
+
+const Hole sharp_blade[] = {
+ {HOLE_LINEAR, 0, 8, 0, -0.1},
+ {HOLE_LINEAR, 8, 15, -0.1, 0},
+
+ /* terminator */
+ {-1, 0, 0, 0, 0}
+};
+
+const Hole lightsaber_blade[] = {
+ {HOLE_CURVE, 0, 30, 0, -0.2},
+
+ /* terminator */
+ {-1, 0, 0, 0, 0}
+};
+
+Vertex blade_vertex(const Blade *blade, const float *profile, int i)
+{
+ assert(i >= 0 && i < blade->width);
+
+ int l = i - 1;
+ if (l < 0)
+ l = 0;
+ int r = i + 1;
+ if (r >= blade->width)
+ r = blade->width - 1;
+
+ Vertex v;
+ v.norm = vec3((profile[l] - profile[r])*6, 0, r-l);
+ v.pos = vec3(i * PROFILE_STEP, BLADE_LEN, profile[i]*6);
+ return v;
+}
+
+Vertex blade_vertex2(const Blade *blade, const float *profile, int i)
+{
+ int l = i - 1;
+ if (l < 0)
+ l = 0;
+ int r = i + 1;
+ if (r >= blade->width)
+ r = blade->width - 1;
+
+ Vertex v;
+ v.norm = vec3((profile[l] - profile[r])*-6, 0, l-r);
+ v.pos = vec3(i * PROFILE_STEP, BLADE_LEN, profile[i]*6);
+ return v;
+}
+
+}
+
+float current_blade[MAX_BLADE_WIDTH];
+int blade_num;
+const Chisel *inventory[NUM_BLADES];
+float stress[NUM_BLADES];
+float blade_x = 0;
+Animator<float> blade_raise;
+Text chisel_name;
+bool cutting;
+Sound cutting_sound;
+Sound lightsaber_hit;
+Sound lightsaber_always;
+Sound sanding;
+
+const Blade blades[] = {
+ {flat_blade, 15, false},
+ {flat_blade, 15, false}, /* faster */
+ {curve_blade, 15, false},
+ {flat_blade, 30, false},
+ {sharp_blade, 15, false},
+ {flat_blade, 30, true}, /* sand */
+ {lightsaber_blade, 30, false},
+ {flat_blade, 5, false}, /* chainsaw */
+};
+
+/*
+ int type;
+ const char *name;
+ int handle;
+ float speed;
+ float max_stress;
+ int price;
+ int level;
+*/
+const Chisel chisels[] = {
+ {BLADE_FLAT,
+ "Basic flat",
+ "A basic chisel for amateurs.",
+ HANDLE_BASIC, 0.0001, 5, 100, 0},
+
+ {BLADE_CURVE,
+ "Basic curve",
+ "Curved chisel for rounded shapes.",
+ HANDLE_BASIC, 0.0001, 5, 500, 0},
+
+ {BLADE_WIDE,
+ "Basic wide flat",
+ "A wider version of the flat\n"
+ "chisel.",
+ HANDLE_BASIC, 0.0001, 5, 500, 0},
+
+ {BLADE_FLAT,
+ "Strong flat",
+ "Stronger flat-headed chisel.",
+ HANDLE_PRO, 0.0001, 10, 2000, 0},
+
+ {BLADE_SAND,
+ "Sanding hand",
+ "A special hand to smooth out edges.\n"
+ "Perfect for the small final touches.",
+ HANDLE_HAND, 0.00003, 5, 1000, 0},
+
+ {BLADE_SHARP,
+ "Basic sharp",
+ "Sharp-shaped chisel for\n"
+ "making sharp grooves.",
+ HANDLE_BASIC, 0.0001, 5, 1000, 1},
+
+ {BLADE_FAST,
+ "Ultimate flat",
+ "The best flat-headed chisel\n"
+ "there is.",
+ HANDLE_ULTIMATE, 0.0002, 15, 2000, 2},
+
+ {BLADE_CURVE,
+ "Ultimate curve",
+ "Improved version of the curved chisel\n"
+ "that can last higher temperatures.",
+ HANDLE_ULTIMATE, 0.0002, 15, 2000, 2},
+
+ {BLADE_WIDE,
+ "Samurai's revenge",
+ "The carving tool of the ancient\n"
+ "chinese. Extremely high quality.",
+ HANDLE_SCIFI, 0.0003, 15, 3000, 3},
+
+ {BLADE_SAND,
+ "Jedi's hand",
+ "The second best friend of a Jedi.\n"
+ "Excellent for smoothing out sharp\n"
+ "edges. Faster and more resistant.",
+ HANDLE_HAND, 0.0001, 10, 3000, 3},
+
+ {BLADE_LIGHTSABER,
+ "Lightsaber",
+ "The best friend of a Jedi!\n"
+ "Suitable for making large holes\n"
+ "fast! May the force be with you.",
+ HANDLE_LIGHTSABER, 0.0005, 30, 5000, 3},
+
+ {BLADE_CHAINSAW,
+ "Chainsaw",
+ "",
+ HANDLE_CHAINSAW, 0.0005, 30, 5000, 3},
+
+ {0, NULL, 0, 0, 0, 0, 0}
+};
+
+void create_hole(float *profile, int len, const Hole *hole)
+{
+ assert(hole->x2 > hole->x1);
+ switch (hole->type) {
+ case HOLE_CURVE:
+ for (int i = hole->x1; i < hole->x2; ++i) {
+ if (i >= 0 && i < len) {
+ float depth = hole->depth1
+ + sinf((i - hole->x1) * M_PI / (hole->x2 - hole->x1))
+ * (hole->depth2 - hole->depth1);
+ if (depth < profile[i])
+ profile[i] = depth;
+ }
+ }
+ break;
+ case HOLE_LINEAR:
+ for (int i = hole->x1; i < hole->x2; ++i) {
+ if (i >= 0 && i < len) {
+ float depth = hole->depth1
+ + float(i - hole->x1) / (hole->x2 - hole->x1)
+ * (hole->depth2 - hole->depth1);
+ if (depth < profile[i])
+ profile[i] = depth;
+ }
+ }
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+void begin_cutting()
+{
+ cutting = true;
+ if (blade_num == BLADE_LIGHTSABER) {
+ play_sound(&lightsaber_hit, LOOP_INFINITE);
+ } else if (blade_num == BLADE_SAND) {
+ play_sound(&sanding, LOOP_INFINITE);
+ } else {
+ play_sound(&cutting_sound, LOOP_INFINITE);
+ }
+}
+
+void end_cutting()
+{
+ cutting = false;
+ stop_sound(&lightsaber_hit);
+ stop_sound(&cutting_sound);
+ stop_sound(&sanding);
+}
+
+void switch_blade()
+{
+ assert(blade_num >= 0 && blade_num < NUM_BLADES);
+
+ const Chisel *chisel = inventory[blade_num];
+ const Blade *blade = &blades[blade_num];
+
+ cutting = false;
+ create_blade(blade, current_blade);
+ blade_raise.set_value(10);
+ chisel_name.init(font, chisel->name);
+
+ if (blade_num == BLADE_LIGHTSABER) {
+ play_sound(&lightsaber_always, LOOP_INFINITE);
+ }
+}
+
+void buy(const Chisel *chisel)
+{
+ assert(chisel->blade >= 0 && chisel->blade < NUM_BLADES);
+
+ if (chisel->price > score) {
+ return;
+ }
+ score -= chisel->price;
+ inventory[chisel->blade] = chisel;
+ stress[chisel->blade] = 0;
+}
+
+void create_blade(const Blade *blade, float *profile)
+{
+ assert(blade->width > 0 && blade->width <= MAX_BLADE_WIDTH);
+ memset(profile, 0, blade->width * sizeof(float));
+ for (int i = 0; blade->holes[i].type >= 0; ++i) {
+ create_hole(profile, blade->width, &blade->holes[i]);
+ }
+}
+
+void draw_chisel(const Chisel *chisel, const float *profile)
+{
+ static bool ready = false;
+ static Model handles[MAX_HANDLES];
+ if (!ready) {
+ ready = true;
+ handles[HANDLE_BASIC].load("basic.obj");
+ handles[HANDLE_PRO].load("pro.obj");
+ handles[HANDLE_ULTIMATE].load("ultimate.obj");
+ handles[HANDLE_SCIFI].load("scifi.obj");
+ handles[HANDLE_LIGHTSABER].load("lightsaber.obj");
+ handles[HANDLE_HAND].load("deadhand.obj");
+ handles[HANDLE_CHAINSAW].load("chainsaw.obj");
+ }
+
+ const Blade *blade = &blades[chisel->blade];
+
+ float color[] = {0.4, 0.4, 0.4, 1};
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color);
+
+ if (chisel->handle != HANDLE_LIGHTSABER &&
+ chisel->handle != HANDLE_HAND) {
+ GLState state;
+ state.enable(GL_LIGHTING);
+
+ GLMatrixScope matrix;
+ glTranslatef(blade->width * -PROFILE_STEP/2, 0, 0);
+
+ const float diffuse[4] = {0.5, 0.5, 0.7, 1};
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
+
+ Vertex vert[MAX_BLADE_WIDTH * 4 * 3];
+ int vi = 0;
+ vert[vi].norm = vec3(-1, 0, 0);
+ vert[vi++].pos = vec3(0, BLADE_LEN, profile[0]*6);
+ vert[vi].norm = vec3(-1, 0, 0);
+ vert[vi++].pos = vec3(0, 0, -0.2);
+ vert[vi].norm = vec3(-1, 0, 0);
+ vert[vi++].pos = vec3(0, 0, 0.2);
+
+ vert[vi].norm = vec3(1, 0, 0);
+ vert[vi++].pos = vec3((blade->width - 1) * PROFILE_STEP, BLADE_LEN,
+ profile[blade->width-1]*6);
+ vert[vi].norm = vec3(1, 0, 0);
+ vert[vi++].pos = vec3((blade->width - 1) * PROFILE_STEP, 0, 0.2);
+ vert[vi].norm = vec3(1, 0, 0);
+ vert[vi++].pos = vec3((blade->width - 1) * PROFILE_STEP, 0, -0.2);
+ draw_array(GL_TRIANGLES, vert, 2 * 3);
+
+ vi = 0;
+ for (int i = 0; i < blade->width - 1; ++i) {
+ vert[vi++] = blade_vertex(blade, profile, i + 1);
+ vert[vi++] = blade_vertex(blade, profile, i);
+ vert[vi].norm = vec3(0, 0, 1);
+ vert[vi++].pos = vec3((i + 1) * PROFILE_STEP, 0, 0.2);
+
+ vert[vi++] = blade_vertex(blade, profile, i);
+ vert[vi].norm = vec3(0, 0, 1);
+ vert[vi++].pos = vec3(i * PROFILE_STEP, 0, 0.2);
+ vert[vi].norm = vec3(0, 0, 1);
+ vert[vi++].pos = vec3((i + 1) * PROFILE_STEP, 0, 0.2);
+
+ vert[vi++] = blade_vertex2(blade, profile, i);
+ vert[vi++] = blade_vertex2(blade, profile, i + 1);
+ vert[vi].norm = vec3(0, 0, -1);
+ vert[vi++].pos = vec3(i * PROFILE_STEP, 0, -0.2);
+
+ vert[vi++] = blade_vertex2(blade, profile, i + 1);
+ vert[vi].norm = vec3(0, 0, -1);
+ vert[vi++].pos = vec3((i + 1) * PROFILE_STEP, 0, -0.2);
+ vert[vi].norm = vec3(0, 0, -1);
+ vert[vi++].pos = vec3(i * PROFILE_STEP, 0, -0.2);
+ }
+ draw_array(GL_TRIANGLES, vert, (blade->width - 1) * 4 * 3);
+ }
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black);
+
+ assert(chisel->handle >= 0 && chisel->handle < MAX_HANDLES);
+
+ GLMatrixScope matrix;
+ if (chisel->handle == HANDLE_HAND) {
+ glTranslatef(0, BLADE_LEN, 0);
+ }
+ handles[chisel->handle].draw();
+}
85 chisel.h
@@ -0,0 +1,85 @@
+#include "common.h" /* for Animator<> */
+
+const int MAX_BLADE_WIDTH = 64;
+const float BLADE_LEN = 10;
+const int MAX_SHOP_CHISELS = 20;
+
+enum {
+ HANDLE_BASIC,
+ HANDLE_PRO,
+ HANDLE_ULTIMATE,
+ HANDLE_SCIFI,
+ HANDLE_LIGHTSABER,
+ HANDLE_HAND,
+ HANDLE_CHAINSAW,
+ MAX_HANDLES
+};
+
+enum {
+ BLADE_FLAT,
+ BLADE_FAST,
+ BLADE_CURVE,
+ BLADE_WIDE,
+ BLADE_SHARP,
+ BLADE_SAND,
+ BLADE_LIGHTSABER,
+ BLADE_CHAINSAW,
+ NUM_BLADES
+};
+
+enum {
+ HOLE_CURVE = 1,
+ HOLE_LINEAR
+};
+
+struct Hole {
+ int type;
+ int x1;
+ int x2;
+ float depth1;
+ float depth2;
+};
+
+struct Blade {
+ const Hole *holes;
+ int width;
+ bool smooth;
+};
+
+struct Chisel {
+ int blade;
+ const char *name;
+ const char *descr;
+ int handle;
+ float speed;
+ float max_stress;
+ int price;
+ int level;
+};
+
+class Text;
+struct Sound;
+
+extern float current_blade[];
+extern int blade_num;
+extern const Chisel *inventory[];
+extern float stress[];
+extern float blade_x;
+extern Animator<float> blade_raise;
+extern Text chisel_name;
+extern bool cutting;
+extern Sound cutting_sound;
+extern Sound lightsaber_hit;
+extern Sound lightsaber_always;
+extern Sound sanding;
+
+extern const Blade blades[];
+extern const Chisel chisels[];
+
+void create_hole(float *profile, int len, const Hole *hole);
+void begin_cutting();
+void end_cutting();
+void switch_blade();
+void buy(const Chisel *chisel);
+void create_blade(const Blade *blade, float *profile);
+void draw_chisel(const Chisel *chisel, const float *profile);
508 common.cc
@@ -0,0 +1,508 @@
+/*
+ * Black Belt Sorvi Hero
+ *
+ * Copyright 2011 Janne Kulmala <janne.t.kulmala@iki.fi>,
+ * Antti Rajamäki <amikaze@gmail.com>
+ *
+ * Program code and resources are licensed with GNU LGPL 2.1. See
+ * COPYING.LGPL file.
+ *
+ *
+ * Common stuff: timer, events, window, settings
+ */
+#include "common.h"
+#include "sound.h"
+#include <fstream>
+#include <sstream>
+#include <stdexcept>
+#include <fcntl.h>
+#if !defined(_WIN32)
+#define O_BINARY 0
+#endif
+
+const float PARTICLE_TIME = 2;
+const float MAX_TIME_STEP = 0.2;
+
+namespace {
+
+struct Entry {
+ size_t offset;
+ size_t size;
+};
+
+#define SETTINGS_FILE "sorvi.cfg"
+
+std::list<Particle> particles;
+std::list<Particle> smoke;
+
+int pack_fd;
+std::map<std::string, Entry> entries;
+
+}
+
+const Setting setting_list[] = {
+#if !defined(CONFIG_GLES)
+ {&shaders_enabled, "shaders", "High quality (OpenGL 2.0 required)"},
+ {&fullscreen, "fullscreen", "Fullscreen (takes effect after a restart)"},
+#endif
+ {&music_enabled, "music", "Music enabled"},
+
+ /* terminator */
+ {NULL, NULL, NULL}
+};
+
+bool fullscreen = true;
+int scr_width = 1024;
+int scr_height = 768;
+TTF_Font *font = NULL;
+Model sorvi;
+Model room;
+Model akseli;
+Model support;
+int score = 0;
+const Level *level = NULL;
+int level_num;
+
+PackFile::PackFile(const char *fname)
+{
+ Entry entry = get(entries, std::string(fname));
+ m_begin = entry.offset;
+ m_offset = 0;
+ m_size = entry.size;
+}
+
+void PackFile::seek(size_t offset)
+{
+ m_offset = offset;
+ if (m_offset > m_size) {
+ m_offset = m_size;
+ }
+}
+
+size_t PackFile::read(void *buf, size_t len)
+{
+ if (m_offset + len > m_size) {
+ len = m_size - m_offset;
+ }
+ lseek(pack_fd, m_begin + m_offset, SEEK_SET);
+ if (::read(pack_fd, buf, len) < int(len)) {
+ throw std::runtime_error("Unable to read from pack file");
+ }
+ m_offset += len;
+ return len;
+}
+
+float randf(float min, float max)
+{
+ return rand() * (max - min) / RAND_MAX + min;
+}
+
+Timer::Timer() :
+ m_last_ticks(0)
+{
+}
+
+float Timer::get_dt()
+{
+ Uint32 ticks = SDL_GetTicks();
+ float dt = (ticks - m_last_ticks) / 1000.0;
+ m_last_ticks = ticks;
+ if (dt > MAX_TIME_STEP) dt = MAX_TIME_STEP;
+ if (dt < 0) dt = 0;
+ return dt;
+}
+
+void exit()
+{
+ save_settings();
+ SDL_Quit();
+ exit(0);
+}
+
+void hud_matrix()
+{
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, scr_width, scr_height, 0, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+void open_window()
+{
+ int width = scr_width;
+ int height = scr_height;
+ int flags = SDL_OPENGL|SDL_RESIZABLE;
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
+ if (fullscreen) {
+ width = 0;
+ height = 0;
+ flags |= SDL_FULLSCREEN;
+ }
+ SDL_Surface *screen = SDL_SetVideoMode(width, height, 0, flags);
+ if (screen == NULL) {
+ throw std::runtime_error(
+ std::string("Unable to create window: ")
+ + SDL_GetError());
+ }
+
+#if defined(CONFIG_SDL_GLES)
+ static SDL_GLES_Context *context = NULL;
+ if (context == NULL) {
+ SDL_GLES_SetAttribute(SDL_GLES_DEPTH_SIZE, 16);
+ context = SDL_GLES_CreateContext();
+ if (context == NULL) {
+ throw std::runtime_error("Can not create GLES context");
+ }
+ }
+ SDL_ShowCursor(SDL_DISABLE);
+
+ SDL_GLES_MakeCurrent(context);
+#endif
+
+ scr_width = screen->w;
+ scr_height = screen->h;
+ glViewport(0, 0, scr_width, scr_height);
+}
+
+bool get_event(SDL_Event *e)
+{
+ while (SDL_PollEvent(e)) {
+ switch (e->type) {
+ case SDL_QUIT:
+ exit();
+
+ case SDL_VIDEORESIZE:
+ scr_width = e->resize.w;
+ scr_height = e->resize.h;
+ if (!fullscreen)
+#if !defined(_WIN32)
+ open_window();
+#else
+ /* windows */
+ glViewport(0, 0, scr_width, scr_height);
+#endif
+ break;
+
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+ case SDL_WINDOWEVENT:
+ switch (e->window.event) {
+ case SDL_WINDOWEVENT_RESIZED:
+ scr_width = e->window.data1;
+ scr_height = e->window.data2;
+ glViewport(0, 0, scr_width, scr_height);
+ break;
+ }
+ break;
+#endif
+
+ case SDL_KEYDOWN:
+ switch (e->key.keysym.sym) {
+#if defined(DEBUG)
+ case SDLK_F5:
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ break;
+ case SDLK_F6:
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ break;
+ case SDLK_F7:
+ shaders_enabled = !shaders_enabled;
+ break;
+#endif
+ default:
+ /* pass up */
+ return true;
+ }
+ break;
+
+ default:
+ /* pass up */
+ return true;
+ }
+ }
+ return false;
+}
+
+void set_particles_light(bool bloom)
+{
+ vec3 pos(0, 0, 0);
+ float sum = 0;
+ color c;
+ for (const_list_iter<Particle> i(particles); i; ++i) {
+ float s = 1 - i->time / PARTICLE_TIME;
+ pos = pos + i->pos * s;
+ sum += s;
+ c = i->c;
+ }
+ if (sum > 0.1) {
+ c.r *= sum * 0.02;
+ c.g *= sum * 0.02;
+ c.b *= sum * 0.02;
+ set_light(pos * (1 / sum), c, bloom);
+ }
+}
+
+void update_particles(float dt)
+{
+ for (safe_list_iter<Particle> i(particles); i; ++i) {
+ vec3 accel = i->vel * -0.1 + vec3(0, 0, -50);
+ i->pos = i->pos + i->vel * dt + (accel * dt * dt * 0.5);
+ i->vel = i->vel + accel * dt;
+ i->time += dt;
+ if (i->time > PARTICLE_TIME) {
+ particles.erase(i.iter());
+ }
+ }
+
+ for (safe_list_iter<Particle> i(smoke); i; ++i) {
+ vec3 accel = i->vel * -0.1 + vec3(0, 0, 20)
+ + vec3(randf(-2, 2), randf(-2, 2), randf(-2, 2)) * dt;
+ vec3 v = i->vel;
+ i->pos = i->pos + v * dt;
+ i->vel = i->vel + accel * dt;
+ i->time += dt;
+ if (i->time > PARTICLE_TIME) {
+ smoke.erase(i.iter());
+ }
+ }
+}
+
+void draw_particles()
+{
+ std::vector<VertexColor> vert;
+ for (const_list_iter<Particle> i(particles); i; ++i) {
+ VertexColor v;
+ v.c = i->c;
+ v.c.a = 1 - i->time / PARTICLE_TIME;
+ v.pos = i->pos;
+ vert.push_back(v);
+ }
+
+ GLState state;
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ state.enable(GL_BLEND);
+ glPointSize(2);
+ draw_array(GL_POINTS, &vert[0], vert.size());
+ glPointSize(1);
+}
+
+void draw_smoke(const vec3 &camera)
+{
+ static GLuint smoke_tex = INVALID_TEXTURE;
+ if (smoke_tex == INVALID_TEXTURE) {
+ smoke_tex = load_texture("smoke.png");
+ }
+
+ GLState state;
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ state.enable(GL_BLEND);
+ glDepthMask(GL_FALSE);
+ glBindTexture(GL_TEXTURE_2D, smoke_tex);
+ state.enable(GL_TEXTURE_2D);
+
+ for (const_list_iter<Particle> i(smoke); i; ++i) {
+ vec3 n = camera - i->pos;
+ n = n * (1 / length(n));
+ vec3 a = cross(n, vec3(0, 0, 1));
+ vec3 b = cross(a, n) * (i->time / PARTICLE_TIME * 8);
+ a = a * (i->time / PARTICLE_TIME * 8);
+
+ color c = i->c;
+ c.a = 1 - i->time / PARTICLE_TIME;
+ glColor4fv(&c.r);
+
+ VertexTexCoord vert[2 * 3];
+ int vi = 0;
+ vert[vi].tc = vec2(0, 0);
+ vert[vi++].pos = i->pos - a - b;
+ vert[vi].tc = vec2(1, 0);
+ vert[vi++].pos = i->pos - a + b;
+ vert[vi].tc = vec2(0, 1);
+ vert[vi++].pos = i->pos + a - b;
+
+ vert[vi].tc = vec2(1, 0);
+ vert[vi++].pos = i->pos - a + b;
+ vert[vi].tc = vec2(1, 1);
+ vert[vi++].pos = i->pos + a + b;
+ vert[vi].tc = vec2(0, 1);
+ vert[vi++].pos = i->pos + a - b;
+ draw_array(GL_TRIANGLES, vert, 2 * 3);
+ }
+ glColor4fv(white);
+ glDepthMask(GL_TRUE);
+}
+
+void add_particle(Particle p)
+{
+ p.time = 0;
+ p.vel = p.vel + vec3(randf(-2, 2), randf(-2, 2), randf(-2, 2));
+ if (p.smoke)
+ smoke.push_back(p);
+ else
+ particles.push_back(p);
+}
+
+void kill_particles()
+{
+ smoke.clear();
+ particles.clear();
+}
+
+void draw_number(int v, int len)
+{
+ static GLuint digits = INVALID_TEXTURE;
+ if (digits == INVALID_TEXTURE) {
+ digits = load_texture("digits.png");
+ }
+
+ assert(v >= 0);
+
+ GLState state;
+ state.enable(GL_BLEND);
+ state.enable(GL_TEXTURE_2D);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glBindTexture(GL_TEXTURE_2D, digits);
+ Face faces[10 * 2];
+ for (int i = 0; i < len; ++i) {
+ vec3 o((len - i - 1) * DIGIT_WIDTH, 0, 0);
+
+ float x = v % 10 * 40.0 / 512;
+ faces[i * 2].vert[0].tc = vec2(x, 0);
+ faces[i * 2].vert[0].pos = o + vec3(0, 0, 0);
+ faces[i * 2].vert[1].tc = vec2(x, 1);
+ faces[i * 2].vert[1].pos = o + vec3(0, DIGIT_HEIGHT, 0);
+ faces[i * 2].vert[2].tc = vec2(x + 40.0 / 512, 0);
+ faces[i * 2].vert[2].pos = o + vec3(DIGIT_WIDTH, 0, 0);
+
+ faces[i * 2 + 1].vert[0].tc = vec2(x, 1);
+ faces[i * 2 + 1].vert[0].pos = o + vec3(0, DIGIT_HEIGHT, 0);
+ faces[i * 2 + 1].vert[1].tc = vec2(x + 40.0 / 512, 1);
+ faces[i * 2 + 1].vert[1].pos = o + vec3(DIGIT_WIDTH, DIGIT_HEIGHT, 0);
+ faces[i * 2 + 1].vert[2].tc = vec2(x + 40.0 / 512, 0);
+ faces[i * 2 + 1].vert[2].pos = o + vec3(DIGIT_WIDTH, 0, 0);
+
+ v /= 10;
+ }
+ draw_faces(faces, len * 2);
+}
+
+void open_pack(const char *fname)
+{
+ pack_fd = open(fname, O_RDONLY | O_BINARY);
+ if (pack_fd < 0) {
+ throw std::runtime_error(std::string("Unable to open: ")
+ + fname);
+ }
+
+ size_t i = 0;
+ std::string buf;
+
+ while (true) {
+ size_t j = buf.find('\n', i);
+ if (j == std::string::npos) {
+ buf.erase(buf.begin(), buf.begin() + i);
+ i = 0;
+
+ size_t pos = buf.size();
+ buf.resize(pos + 256, 0);
+ size_t got = read(pack_fd, &buf[pos], 256);
+ if (got <= 0)
+ break;
+ buf.resize(pos + got);
+ continue;
+ }
+
+ std::istringstream parser(buf.substr(i, j - i));
+
+ std::string name;
+ parser >> name;
+ if (name == "END")
+ break;
+
+ Entry entry;
+ parser >> entry.offset >> entry.size;
+ ins(entries, name, entry);
+
+ i = j + 1;
+ }
+}
+
+std::string get_settings_file()
+{
+#if defined(_WIN32)
+ return strf("%s\\" SETTINGS_FILE, getenv("APPDATA"));
+#elif defined(__ANDROID__)
+ return "/sdcard/" SETTINGS_FILE;
+#else
+ return strf("%s/." SETTINGS_FILE, getenv("HOME"));
+#endif
+}
+
+void load_settings()
+{
+ printf("load_settings()\n");
+
+ std::string fname = get_settings_file();
+ printf(" settings file: %s\n", fname.c_str());
+ std::ifstream f(fname.c_str());
+ if (!f) {
+ return;
+ }
+
+ std::string line;
+ Group group;
+ while (std::getline(f, line)) {
+ if (line.empty() || line[0] == '#')
+ continue;
+
+ std::istringstream parser(line);
+ std::string name;
+ std::string state;
+ parser >> name;
+ parser >> state;
+
+ const Setting *setting = NULL;
+ for (int i = 0; setting_list[i].ptr != NULL; ++i) {
+ setting = &setting_list[i];
+ if (setting->name == name) {
+ if (state == "yes")
+ *setting->ptr = true;
+ else if (state == "no")
+ *setting->ptr = false;
+ break;
+ }
+ }
+ if (setting == NULL) {
+ warning("unknown setting: %s\n", name.c_str());
+ }
+ }
+}
+
+void save_settings()
+{
+ std::string fname = get_settings_file();
+ FILE *f = fopen(fname.c_str(), "wb");
+ if (f == NULL) {
+ warning("Unable to save settings to %s\n", fname.c_str());
+ return;
+ }
+ for (int i = 0; setting_list[i].ptr != NULL; ++i) {
+ const Setting *setting = &setting_list[i];
+ fprintf(f, "%s %s\n", setting->name,
+ *setting->ptr ? "yes" : "no");
+ }
+ fclose(f);
+}
+
+void set_setting(const Setting *setting, bool state)
+{
+ *setting->ptr = state;
+ if (setting->ptr == &music_enabled && !state) {
+ play_music(NULL);
+ } else if(setting->ptr == &fullscreen) {
+#if !defined(_WIN32)
+ open_window();
+#endif
+ }
+}
186 common.h
@@ -0,0 +1,186 @@
+#if !defined(_COMMON_H)
+#define _COMMON_H
+
+#define NAME "Black Belt Sorvi Hero"
+#define DIR_NAME "BlackBeltSorviHero"
+
+#include <SDL.h>
+#if !defined(M_PI)
+#define M_PI 3.14159265358979323846
+#endif
+#include <string>
+#include "utils.h"
+#include "gl.h"
+
+class Shape;
+
+struct Level {
+ const Shape *shapes;
+ const char *descr;
+ const char *music;
+ int time_limit;
+ int min_score;
+};
+
+struct Particle {
+ bool smoke;
+ color c;
+ float time;
+ vec3 pos;
+ vec3 vel;
+};
+
+class Timer {
+public:
+ Timer();
+ float get_dt();
+
+private:
+ Uint32 m_last_ticks;
+};
+
+#if !defined(CONFIG_GLES)
+const int DIGIT_WIDTH = 40;
+const int DIGIT_HEIGHT = 64;
+#else
+const int DIGIT_WIDTH = 20;
+const int DIGIT_HEIGHT = 32;
+#endif
+
+template<class T>
+T zero()
+{
+ return 0;
+}
+
+template<>
+inline vec3 zero<vec3>()
+{
+ return vec3(0, 0, 0);
+}
+
+template<>
+inline vec2 zero<vec2>()
+{
+ return vec2(0, 0);
+}
+
+class Once {
+public:
+ Once() :
+ done(false)
+ {}
+
+ operator bool()
+ {
+ if (done)
+ return false;
+ done = true;
+ return true;
+ }
+
+private:
+ bool done;
+};
+
+template<class T>
+class Animator {
+public:
+ Animator(const T &val = zero<T>()) :
+ m_value(val), m_vel(zero<T>()), m_target(val)
+ {}
+
+ operator T() const { return m_value; }
+
+ T value() const { return m_value; }
+
+ void set_value(const T &val)
+ {
+ m_value = val;
+ m_vel = zero<T>();
+ m_target = val;
+ }
+ void set_target(const T &val)
+ {
+ m_target = val;
+ }
+
+ void update(float dt, float force)
+ {
+ const float MAX_STEP = 0.02;
+ float friction = sqrt(force) * 2;
+
+ while (dt > MAX_STEP) {
+ T accel = (m_target - m_value) * force - m_vel * friction;
+ m_value = m_value + m_vel * MAX_STEP;
+ m_vel = m_vel + accel * MAX_STEP;
+ dt -= MAX_STEP;
+ }
+ T accel = (m_target - m_value) * force - m_vel * friction;
+ m_value = m_value + m_vel * dt;
+ m_vel = m_vel + accel * dt;
+ }
+
+private:
+ T m_value;
+ T m_vel;
+ T m_target;
+};
+
+class PackFile {
+public:
+ PackFile() {}
+ PackFile(const char *fname);
+
+ size_t offset() const { return m_offset; }
+ size_t size() const { return m_size; }
+
+ void seek(size_t offset);
+
+ size_t read(void *buf, size_t len);
+
+private:
+ size_t m_begin;
+ size_t m_offset;
+ size_t m_size;
+};
+
+struct Setting {
+ bool *ptr;
+ const char *name;
+ const char *text;
+};
+
+class Model;
+
+extern int scr_width;
+extern int scr_height;
+extern bool fullscreen;
+extern TTF_Font *font;
+extern int score;
+extern Model sorvi;
+extern Model room;
+extern Model akseli;
+extern Model support;
+extern const Level *level;
+extern int level_num;
+extern const Setting setting_list[];
+
+float randf(float min, float max);
+void exit();
+void hud_matrix();
+void open_window();
+bool get_event(SDL_Event *e);
+void set_particles_light(bool bloom);
+void update_particles(float dt);
+void draw_particles();
+void draw_smoke(const vec3 &camera);
+void add_particle(Particle p);
+void kill_particles();
+void draw_number(int v, int len);
+void open_pack(const char *fname);
+void load_settings();
+void save_settings();
+void set_setting(const Setting *setting, bool state);
+
+#endif
14 control.in
@@ -0,0 +1,14 @@
+Package: BlackBeltSorviHero
+Version: {VERSION}-1
+Section: user/extras
+Priority: extra
+Architecture: armel
+Depends: libvorbisfile3, libsdl1.2, libsdl-ttf2.0, libsdl-gles1.2-1, libgles1-sgx-img
+Installed-Size: 16000
+Maintainer: Janne Kulmala <janne.t.kulmala@iki.fi>
+Description: Can you handle the difficulties of turning?
+ Your job is to carve a given shape out of wood with a chisel. The better
+ you match the shape and more accure job you do, the better score you
+ will get. With earned score you can buy new faster and stronger chisels.
+ Watch out for going too fast, as you might overheat your chisel or break
+ the wood!
39 create-pack.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+import os
+
+pack = open('BlackBeltSorviHero.dat', 'w')
+
+length = 0
+offset = 0
+for i in [1, 2]:
+ length = 0
+ for fname in os.listdir('data'):
+ f = open('data/' + fname)
+ f.seek(0, 2)
+ size = f.tell()
+ f.close()
+ length += len("%s %d %d\n" % (fname, offset, size))
+ offset += size
+ offset = length + 4
+
+for fname in os.listdir('data'):
+ f = open('data/' + fname)
+ f.seek(0, 2)
+ size = f.tell()
+ f.close()
+ pack.write("%s %d %d\n" % (fname, offset, size))
+ offset += size
+pack.write("END\n")
+
+for fname in os.listdir('data'):
+ f = open('data/' + fname)
+ while True:
+ s = f.read(4096)
+ if not s:
+ break
+ pack.write(s)
+ size = f.tell()
+ f.close()
+
+pack.close()
32 data/akseli.mtl
@@ -0,0 +1,32 @@
+
+
+newmtl Metalli
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.098505 0.107553 0.199743
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+spec
+
+
+newmtl Ruuvit
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.000000 0.000000 0.000000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+spec
+
+
+newmtl Tera
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.248645 0.245666 0.000000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+spec
+
+
3,020 data/akseli.obj
3,020 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
BIN data/alle60.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN data/awwyeah.ogg
Binary file not shown.
BIN data/back_button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 data/basic.mtl
@@ -0,0 +1,12 @@
+
+
+newmtl Material.001
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.000000 0.000000 0.800000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
355 data/basic.obj
@@ -0,0 +1,355 @@
+
+
+mtllib basic.mtl
+v 0.582367 -1.617934 -0.537043
+v 0.582367 -1.617934 0.562094
+v -0.582368 -1.617934 0.562094
+v -0.582367 -1.617934 -0.537043
+v 0.736060 -0.517363 -0.682079
+v 0.736059 -0.517363 0.707131
+v -0.736060 -0.517363 0.707130
+v -0.736060 -0.517363 -0.682079
+v -0.551650 -0.001195 0.564176
+v -0.551650 -0.001195 -0.539124
+v 0.551649 -0.001195 0.564176
+v 0.551650 -0.001195 -0.539124
+v 0.791196 -1.617934 0.012526
+v 0.000000 -1.617934 -0.778670
+v 0.000000 -1.617934 0.803721
+v -0.791196 -1.617934 0.012526
+v 1.000000 -0.517363 0.012526
+v 0.000000 -0.517363 -0.987474
+v -0.000001 -0.517362 1.012526
+v -1.000000 -0.517363 0.012526
+v -0.791196 -2.630188 0.012525
+v 0.000000 -2.630188 0.803721
+v 0.000000 -2.630188 -0.778670
+v 0.791196 -2.630188 0.012526
+v -0.582367 -2.630188 -0.537043
+v -0.582368 -2.630188 0.562094
+v 0.582367 -2.630188 0.562094
+v 0.582367 -2.630188 -0.537043
+v 0.736060 -3.726457 -0.682079
+v 0.736060 -3.726457 0.707130
+v -0.736060 -3.726457 0.707130
+v -0.736060 -3.726457 -0.682079
+v 1.000000 -3.726457 0.012526
+v 0.000000 -3.726457 -0.987475
+v 0.000000 -3.726457 1.012526
+v -1.000000 -3.726457 0.012525
+v 0.000000 -9.660665 0.012525
+v -1.000000 -9.660665 0.012525
+v 0.000000 -9.660665 1.012525
+v 0.000000 -9.660665 -0.987475
+v 1.000000 -9.660665 0.012525
+v -0.736060 -9.660665 -0.682080
+v -0.736060 -9.660665 0.707130
+v 0.736060 -9.660665 0.707130
+v 0.736060 -9.660665 -0.682080
+v 0.715459 -1.617934 -0.291759
+v 0.715459 -1.617934 0.316811
+v 0.303343 -1.617934 -0.729828
+v -0.303342 -1.617934 -0.729828
+v 0.303343 -1.617934 0.754880
+v -0.303343 -1.617934 0.754880
+v -0.715459 -1.617934 0.316810
+v -0.715459 -1.617934 -0.291759
+v 0.904276 -0.517363 -0.372062
+v 0.904276 -0.517363 0.397115
+v 0.383398 -0.517363 -0.925742
+v -0.383398 -0.517363 -0.925742
+v 0.383397 -0.517362 0.950794
+v -0.383398 -0.517362 0.950794
+v -0.904276 -0.517363 0.397114
+v -0.904276 -0.517363 -0.372063
+v -0.715459 -2.630188 -0.291759
+v -0.715459 -2.630188 0.316810
+v -0.303343 -2.630188 0.754880
+v 0.303343 -2.630188 0.754880
+v -0.303342 -2.630188 -0.729828
+v 0.303343 -2.630188 -0.729828
+v 0.715459 -2.630188 0.316811
+v 0.715459 -2.630188 -0.291759
+v 0.904276 -3.726457 -0.372063
+v 0.904276 -3.726457 0.397114
+v 0.383398 -3.726457 -0.925743
+v -0.383397 -3.726457 -0.925743
+v 0.383398 -3.726457 0.950794
+v -0.383398 -3.726457 0.950794
+v -0.904276 -3.726457 0.397114
+v -0.904276 -3.726457 -0.372063
+v -0.904276 -9.660665 -0.372064
+v -0.904276 -9.660665 0.397113
+v -0.383398 -9.660665 0.950793
+v 0.383398 -9.660665 0.950793
+v -0.383397 -9.660665 -0.925744
+v 0.383398 -9.660665 -0.925743
+v 0.904276 -9.660665 0.397113
+v 0.904276 -9.660665 -0.372064
+v 0.618030 -9.660665 0.609827
+v 0.618030 -9.660665 -0.584777
+v -0.618030 -9.660665 0.609827
+v -0.618030 -9.660665 -0.584778
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn -0.957732 0.287637 0.000000
+vn -0.454421 0.773095 0.442457
+vn -0.510697 0.701315 -0.497269
+vn 0.000000 0.165716 0.986145
+vn 0.510697 0.701315 0.497269
+vn 0.000000 0.165716 -0.986145
+vn 0.454421 0.773095 -0.442457
+vn 0.957732 0.287637 0.000000
+vn -0.709159 0.053926 -0.702933
+vn -0.931211 0.032655 -0.362957
+vn -0.931211 0.032655 0.362957
+vn -0.709159 0.053926 0.702933
+vn -0.373211 0.161962 0.913480
+vn 0.373211 0.161962 0.913480
+vn 0.709159 0.053926 0.702933
+vn 0.709159 0.053926 -0.702933
+vn 0.373211 0.161962 -0.913480
+vn -0.373211 0.161962 -0.913480
+vn 0.931211 0.032655 0.362957
+vn 0.931211 0.032655 -0.362957
+vn 0.933378 0.105502 -0.342998
+vn 0.995911 0.075106 0.049898
+vn 0.587725 -0.807550 -0.048738
+vn 0.760430 -0.557421 -0.333171
+vn 0.741142 0.095248 -0.664541
+vn 0.568590 -0.564135 -0.598651
+vn 0.920164 0.105502 0.377026
+vn 0.685568 0.094943 0.721763
+vn 0.656178 -0.564135 0.501114
+vn 0.785913 -0.557421 0.267556
+vn 0.413526 0.076113 -0.907285
+vn 0.249580 -0.563189 -0.787713
+vn 0.023072 0.107364 -0.993927
+vn -0.031892 -0.803247 -0.594775
+vn -0.329295 0.076113 -0.941130
+vn -0.364910 -0.563189 -0.741356
+vn -0.685568 0.094943 -0.721763
+vn -0.656178 -0.564135 -0.501114
+vn 0.329295 0.076113 0.941130
+vn -0.023072 0.107364 0.993927
+vn 0.031922 -0.803247 0.594775
+vn 0.364910 -0.563189 0.741356
+vn -0.413526 0.076113 0.907285
+vn -0.741142 0.095248 0.664541
+vn -0.568590 -0.564135 0.598651
+vn -0.249580 -0.563189 0.787713
+vn -0.933378 0.105502 0.342998
+vn -0.995911 0.075106 -0.049898
+vn -0.587725 -0.807550 0.048738
+vn -0.760430 -0.557421 0.333171
+vn -0.920164 0.105502 -0.377026
+vn -0.785913 -0.557421 -0.267556
+vn -0.928129 0.092318 -0.360546
+vn -0.791192 0.094607 -0.604175
+vn -0.995544 0.093997 0.000000
+vn -0.920011 0.073824 0.384808
+vn -0.740257 0.094882 0.665578
+vn -0.340373 0.108768 0.933958
+vn 0.000000 0.093966 0.995544
+vn 0.371166 0.095248 0.923643
+vn 0.791192 0.094607 0.604175
+vn -0.400555 0.108768 -0.909757
+vn 0.000000 0.062624 -0.998016
+vn 0.369854 0.126896 -0.920347
+vn 0.740257 0.094882 -0.665578
+vn 0.938505 0.073824 0.337168
+vn 0.993561 0.107334 -0.035646
+vn 0.920011 0.073824 -0.384808
+vn 0.938536 -0.073550 -0.337199
+vn 0.993622 -0.106937 0.035646
+vn 0.791223 -0.094241 -0.604205
+vn 0.920042 -0.073550 0.384808
+vn 0.740287 -0.094516 0.665578
+vn 0.371197 -0.094882 -0.923673
+vn 0.000000 -0.093600 -0.995605
+vn -0.340403 -0.108341 -0.933988
+vn -0.740287 -0.094516 -0.665578
+vn 0.369884 -0.126408 0.920408
+vn 0.000000 -0.062380 0.998047
+vn -0.400555 -0.108341 0.909818
+vn -0.791223 -0.094241 0.604205
+vn -0.938536 -0.073550 0.337199
+vn -0.992157 -0.124790 0.000000
+vn -0.930357 -0.061281 -0.361431
+usemtl Material.001
+s off
+f 37//1 89//1 40//1
+f 89//1 82//1 40//1
+f 38//1 78//1 89//1
+f 38//1 89//1 37//1
+f 42//1 82//1 89//1
+f 42//1 89//1 78//1
+f 37//1 88//1 38//1
+f 88//1 79//1 38//1
+f 39//1 80//1 88//1
+f 39//1 88//1 37//1
+f 43//1 79//1 88//1
+f 43//1 88//1 80//1
+f 37//1 87//1 41//1
+f 87//1 85//1 41//1
+f 40//1 83//1 87//1
+f 40//1 87//1 37//1
+f 45//1 85//1 87//1
+f 45//1 87//1 83//1
+f 37//1 86//1 39//1
+f 86//1 81//1 39//1
+f 41//1 84//1 86//1
+f 41//1 86//1 37//1
+f 44//1 81//1 86//1
+f 44//1 86//1 84//1
+f 9//2 11//2 12//2
+f 9//2 12//2 10//2
+s 1
+f 20//3 9//4 10//5
+f 19//6 11//7 9//4
+f 18//8 10//5 12//9
+f 17//10 12//9 11//7
+f 8//11 61//12 10//5
+f 61//12 20//3 10//5
+f 20//3 60//13 9//4
+f 60//13 7//14 9//4
+f 7//14 59//15 9//4
+f 59//15 19//6 9//4
+f 19//6 58//16 11//7
+f 58//16 6//17 11//7
+f 5//18 56//19 12//9
+f 56//19 18//8 12//9
+f 18//8 57//20 10//5
+f 57//20 8//11 10//5
+f 6//17 55//21 11//7
+f 55//21 17//10 11//7
+f 17//10 54//22 12//9
+f 54//22 5//18 12//9
+f 70//23 33//24 41//25
+f 70//23 41//25 85//26
+f 29//27 70//23 85//26
+f 29//27 85//26 45//28
+f 71//29 30//30 44//31
+f 71//29 44//31 84//32
+f 33//24 71//29 84//32
+f 33//24 84//32 41//25
+f 72//33 29//27 45//28
+f 72//33 45//28 83//34
+f 34//35 72//33 83//34
+f 34//35 83//34 40//36
+f 73//37 34//35 40//36
+f 73//37 40//36 82//38
+f 32//39 73//37 82//38
+f 32//39 82//38 42//40
+f 74//41 35//42 39//43
+f 74//41 39//43 81//44
+f 30//30 74//41 81//44
+f 30//30 81//44 44//31
+f 75//45 31//46 43//47
+f 75//45 43//47 80//48
+f 35//42 75//45 80//48
+f 35//42 80//48 39//43
+f 76//49 36//50 38//51
+f 76//49 38//51 79//52
+f 31//46 76//49 79//52
+f 31//46 79//52 43//47
+f 77//53 32//39 42//40
+f 77//53 42//40 78//54
+f 36//50 77//53 78//54
+f 36//50 78//54 38//51
+f 62//55 25//56 77//53
+f 25//56 32//39 77//53
+f 21//57 62//55 77//53
+f 21//57 77//53 36//50
+f 63//58 21//57 76//49
+f 21//57 36//50 76//49
+f 26//59 63//58 76//49
+f 26//59 76//49 31//46
+f 64//60 26//59 31//46
+f 64//60 31//46 75//45
+f 22//61 64//60 35//42
+f 64//60 75//45 35//42
+f 65//62 22//61 35//42
+f 65//62 35//42 74//41
+f 27//63 65//62 30//30
+f 65//62 74//41 30//30
+f 66//64 23//65 34//35
+f 66//64 34//35 73//37
+f 25//56 66//64 32//39
+f 66//64 73//37 32//39
+f 67//66 28//67 29//27
+f 67//66 29//27 72//33
+f 23//65 67//66 34//35
+f 67//66 72//33 34//35
+f 68//68 27//63 71//29
+f 27//63 30//30 71//29
+f 24//69 68//68 71//29
+f 24//69 71//29 33//24
+f 69//70 24//69 70//23
+f 24//69 33//24 70//23
+f 28//67 69//70 70//23
+f 28//67 70//23 29//27
+f 46//71 13//72 24//69
+f 46//71 24//69 69//70
+f 1//73 46//71 69//70
+f 1//73 69//70 28//67
+f 47//74 2//75 27//63
+f 47//74 27//63 68//68
+f 13//72 47//74 68//68
+f 13//72 68//68 24//69
+f 48//76 1//73 28//67
+f 48//76 28//67 67//66
+f 14//77 48//76 23//65
+f 48//76 67//66 23//65
+f 49//78 14//77 23//65
+f 49//78 23//65 66//64
+f 4//79 49//78 66//64
+f 4//79 66//64 25//56
+f 50//80 15//81 65//62
+f 15//81 22//61 65//62
+f 2//75 50//80 65//62
+f 2//75 65//62 27//63
+f 51//82 3//83 26//59
+f 51//82 26//59 64//60
+f 15//81 51//82 64//60
+f 15//81 64//60 22//61
+f 52//84 16//85 21//57
+f 52//84 21//57 63//58
+f 3//83 52//84 63//58
+f 3//83 63//58 26//59
+f 53//86 4//79 25//56
+f 53//86 25//56 62//55
+f 16//85 53//86 21//57
+f 53//86 62//55 21//57
+f 49//78 4//79 8//11
+f 49//78 8//11 57//20
+f 14//77 49//78 18//8
+f 49//78 57//20 18//8
+f 48//76 14//77 18//8
+f 48//76 18//8 56//19
+f 1//73 48//76 5//18
+f 48//76 56//19 5//18
+f 61//12 8//11 4//79
+f 61//12 4//79 53//86
+f 20//3 61//12 16//85
+f 61//12 53//86 16//85
+f 60//13 20//3 16//85
+f 60//13 16//85 52//84
+f 7//14 60//13 3//83