Compare commits
29 Commits
laser-tank
...
4550e15838
Author | SHA1 | Date | |
---|---|---|---|
4550e15838 | |||
cc867a0bb8 | |||
16a0ef9543 | |||
51b150c9aa | |||
c18da5afae | |||
cd1c2ce969 | |||
d7795a8961 | |||
b948491fb3 | |||
03cfdeb50f | |||
e4cd8a4d74 | |||
75b6663ce0 | |||
df0c5d8f48 | |||
fcb9f49785 | |||
d6c44c6570 | |||
b8a1487bab | |||
00c2cfbcfc | |||
c398a2bbf4 | |||
58cf25fe43 | |||
8da45bab3e | |||
5abc319817 | |||
ff625706c0 | |||
81dafb3025 | |||
58e2d0b844 | |||
7720e38868 | |||
02b2395ef1 | |||
293e1d195a | |||
5cf6c3baf9 | |||
8376fed87d | |||
22d572f789 |
@@ -76,22 +76,15 @@ jobs:
|
||||
g++ -o /home/autobuild/tools/win32/bin/objconv -O2 *.cpp
|
||||
chmod +x /home/autobuild/tools/win32/bin/objconv
|
||||
|
||||
- name: Build and install kerpack
|
||||
- name: Build and install kerpack and kpack
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
export PATH=/home/autobuild/tools/win32/bin:$PATH
|
||||
cd ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/
|
||||
make
|
||||
chmod +x kerpack
|
||||
mv kerpack /home/autobuild/tools/win32/bin/.
|
||||
|
||||
- name: Build and install kpack
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
export PATH=/home/autobuild/tools/win32/bin:$PATH
|
||||
cd ${{ gitea.workspace }}/programs/other/kpack/linux/
|
||||
bash build.sh
|
||||
chmod +x kpack
|
||||
mv kerpack /home/autobuild/tools/win32/bin/.
|
||||
mv kpack /home/autobuild/tools/win32/bin/.
|
||||
|
||||
- name: Build and install clink
|
||||
|
71
CONTRIBUTING.md
Normal file
71
CONTRIBUTING.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Contributing guide
|
||||
|
||||
## Type of contributing
|
||||
|
||||
There are two main types of contributions accepted to the main KolibriOS repository:
|
||||
|
||||
- Submitting issues about problems in the project
|
||||
- Submitting code to the project via pull requests
|
||||
|
||||
Both these types are described in detail below.
|
||||
|
||||
## Issues
|
||||
|
||||
You can help us by submitting issues about problems found in the system. Currently, there are two main ways of submitting an issue in the project: **Bug Reports** and **Feature Requests**:
|
||||
|
||||
- Bug Reports are suitable if you find a **bug** (crash, error, unexpected behavior) in some part of the system (kernel, drivers, apps, etc.) and want to report it
|
||||
- Feature Requests are used, when you want to propose some **improvement** to the system (missing features, improved user experience, etc.)
|
||||
|
||||
## Pull requests
|
||||
|
||||
You can also help us by submitting code via pull requests. The process of submitting a pull request consists of the following steps:
|
||||
|
||||
1. Find what you want to implement or improve
|
||||
2. Make a fork of kolibrios (or other needed) repository
|
||||
3. Create a branch with a name that matches your changes
|
||||
4. Implement and test the changes
|
||||
5. Create commits according to the [accepted style](#commit-style)
|
||||
6. Create and submit a pull request into `main` branch
|
||||
7. Wait for CI/CD pipelines and code review to pass
|
||||
|
||||
When a pull request is submitted, at least two project participants must conduct a code review, after which the proposed changes need to be corrected (if requested) and merged into the project.
|
||||
|
||||
## Commit style
|
||||
|
||||
### Message pattern
|
||||
|
||||
The commit message should look like this:
|
||||
|
||||
```test
|
||||
Commit message header
|
||||
|
||||
Commit message body, if needed
|
||||
```
|
||||
|
||||
- Commit message header and body should reflect changes made in commit
|
||||
- Commit message body should be separated from the header by one empty line
|
||||
|
||||
### Length
|
||||
|
||||
Maximum number of characters in a commit header is **72** (standard for **Git**). Also, **72** is the maximum length of a line in a commit body.
|
||||
|
||||
### Multiple authors
|
||||
|
||||
If you are making a commit together with another developer, you need to add:
|
||||
|
||||
```
|
||||
Co-authored-by: ANOTHER-NAME <ANOTHER-NAME@EXAMPLE.COM>
|
||||
```
|
||||
|
||||
to the end commit message body on a new line.
|
||||
|
||||
### Merge commits
|
||||
|
||||
> [!WARNING]
|
||||
> Merge commits are **prohibited** in the project
|
||||
|
||||
Use **rebase** to keep your branch up to date.
|
||||
|
||||
## Conclusion
|
||||
|
||||
We hope this small instructions will help you to get familiar with KolibriOS contribution rules and inspire you to participate in the life of our project.
|
338
COPYING.TXT
Normal file
338
COPYING.TXT
Normal file
@@ -0,0 +1,338 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
<https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) 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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
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 Program or any portion
|
||||
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
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 Program, 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 Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) 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; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, 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 executable. However, as a
|
||||
special exception, the source code 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.
|
||||
|
||||
If distribution of executable or 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 counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||
|
||||
5. 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 Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program 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 to
|
||||
this License.
|
||||
|
||||
7. 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 Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program 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 Program.
|
||||
|
||||
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.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program 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.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 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 Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, 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
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
12. 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 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.
|
||||
|
||||
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
|
||||
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 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 2 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision 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, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Moe Ghoul>, 1 April 1989
|
||||
Moe Ghoul, President of Vice
|
||||
|
||||
This 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.
|
22
README.md
Normal file
22
README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# KolibriOS
|
||||
|
||||
[](./COPYING.TXT)
|
||||
[](https://git.kolibrios.org/KolibriOS/kolibrios/actions)
|
||||
|
||||
KolibriOS is a hobby operating system for x86-compatible computers, which is currently being developed by a small but passionate team of enthusiasts.
|
||||
|
||||
Its kernel, most drivers, and many programs are written entirely in [FASM](https://flatassembler.net/) assembly language, making them very compact and lean on system resources.
|
||||
|
||||
Based on [MenuetOS](https://www.menuetos.net/), it uses its own standards and is NOT fully POSIX or UNIX compliant.
|
||||
|
||||
## Contributing
|
||||
|
||||
We would appreciate any participation in the project and always welcome new users and contributors.
|
||||
|
||||
Detailed instructions for the contribution process can be found in the [contributing guide](./CONTRIBUTING.md).
|
||||
|
||||
Common list of tasks, issues and enhancement proposals can be found on [this page](https://git.kolibrios.org/KolibriOS/kolibrios/issues).
|
||||
|
||||
## Special thanks
|
||||
|
||||
The KolibriOS team expresses special thanks to the author of the 32-bit **MenuetOS**, [Ville Turjanmaa](https://www.menuetos.net/contact.htm). We also want to note that all **MenuetOS** copyrights have been preserved.
|
@@ -49,8 +49,6 @@ img_files = {
|
||||
{"MEDIA/IMGF/INVSOL.OBJ", "common/media/ImgF/invSol.obj"},
|
||||
{"MEDIA/PIXIESKN.PNG", SRC_PROGS .. "/cmm/pixie2/pixieskn.png"},
|
||||
{"NETWORK/FTPC.INI", SRC_PROGS .. "/network/ftpc/ftpc.ini"},
|
||||
{"NETWORK/FTPC_SYS.PNG", SRC_PROGS .. "/network/ftpc/ftpc_sys.png"},
|
||||
{"NETWORK/FTPC_NOD.PNG", SRC_PROGS .. "/network/ftpc/ftpc_nod.png"},
|
||||
{"NETWORK/FTPD.INI", "common/network/ftpd.ini"},
|
||||
{"NETWORK/KNMAP", "common/network/knmap"},
|
||||
{"NETWORK/USERS.INI", "common/network/users.ini"},
|
||||
@@ -85,6 +83,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
|
||||
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
|
||||
{"SETTINGS/SYSPANEL.INI", "ru_RU/settings/syspanel.ini"},
|
||||
}) elseif build_type == "en_US" then tup.append_table(img_files, {
|
||||
{"WELCOME.HTM", VAR_DATA .. "/" .. build_type .. "/welcome.htm.kpack"},
|
||||
{"EXAMPLE.ASM", SRC_PROGS .. "/develop/examples/example/trunk/example.asm"},
|
||||
{"DEVELOP/BACKY", SRC_PROGS .. "/develop/backy/Backy"},
|
||||
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
|
||||
@@ -156,7 +155,7 @@ extra_files = {
|
||||
{"kolibrios/3D/info3ds/OBJECTS.PNG", SRC_PROGS .. "/develop/info3ds/objects.png"},
|
||||
{"kolibrios/3D/info3ds/TOOLBAR.PNG", SRC_PROGS .. "/develop/info3ds/toolbar.png"},
|
||||
{"kolibrios/3D/info3ds/FONT8X9.BMP", SRC_PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
|
||||
{"kolibrios/3D/blocks/", "../programs/bcc32/games/blocks/bin/*"},
|
||||
{"kolibrios/3D/blocks/blocks.kex", "../programs/bcc32/games/blocks/bin/blocks.kex"},
|
||||
{"kolibrios/3D/blocks/models/", "../programs/bcc32/games/blocks/models/*"},
|
||||
{"kolibrios/3D/md2view/", "common/3d/md2view/*"},
|
||||
{"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"},
|
||||
@@ -411,6 +410,7 @@ tup.append_table(img_files, {
|
||||
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
|
||||
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
||||
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
||||
{"CALCPLUS", VAR_PROGS .. "/other/calcplus/calcplus"},
|
||||
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
||||
{"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"},
|
||||
{"CROPFLAT", VAR_PROGS .. "/system/cropflat/cropflat"},
|
||||
@@ -428,7 +428,7 @@ tup.append_table(img_files, {
|
||||
{"KPACK", VAR_PROGS .. "/other/kpack/trunk/kpack"},
|
||||
{"LAUNCHER", VAR_PROGS .. "/system/launcher/trunk/launcher"},
|
||||
{"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/demos/magnify/trunk/magnify"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"},
|
||||
{"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"},
|
||||
{"MOUSEMUL", VAR_PROGS .. "/system/mousemul/trunk/mousemul"},
|
||||
{"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"},
|
||||
@@ -604,6 +604,7 @@ tup.append_table(extra_files, {
|
||||
{"kolibrios/3D/voxel_utilites/VOX_CREATOR" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_creator"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_MOVER" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_mover"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_TGL" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
|
||||
{"kolibrios/demos/flag", VAR_PROGS .. "/demos/flag/flag"},
|
||||
{"kolibrios/demos/life3", VAR_PROGS .. "/games/life3/life3"},
|
||||
{"kolibrios/demos/qjulia", VAR_PROGS .. "/demos/qjulia/trunk/qjulia"},
|
||||
{"kolibrios/develop/koldbg", VAR_PROGS .. "/develop/koldbg/koldbg"},
|
||||
@@ -627,13 +628,12 @@ tup.append_table(extra_files, {
|
||||
{"kolibrios/media/zsea/plugins/rotate.obj", VAR_PROGS .. "/media/zsea/plugins/rotate/rotate.obj"},
|
||||
{"kolibrios/media/zsea/plugins/scaling.obj", VAR_PROGS .. "/media/zsea/plugins/scaling/scaling.obj"},
|
||||
{"kolibrios/utils/AMDtemp", VAR_PROGS .. "/system/amd_temp_view/AMDtemp"},
|
||||
{"kolibrios/utils/calcplus", VAR_PROGS .. "/other/calcplus/calcplus"},
|
||||
{"kolibrios/utils/kfm/kfm", VAR_PROGS .. "/fs/kfm/trunk/kfm"},
|
||||
{"kolibrios/utils/tedit/t_edit", VAR_PROGS .. "/other/t_edit/t_edit"},
|
||||
{"kolibrios/3D/blocks/block.bin", VAR_PROGS .. "/bcc32/games/blocks/block.bin"}
|
||||
})
|
||||
-- For russian build, add russian-only programs.
|
||||
if build_type == "ru_RU" then tup.append_table(img_files, {
|
||||
{"PERIOD", VAR_PROGS .. "/other/period/trunk/period"},
|
||||
{"GAMES/KLAVISHA", VAR_PROGS .. "/games/klavisha/klavisha"},
|
||||
{"DEVELOP/EXAMPLES/TESTCON2", VAR_PROGS .. "/develop/libraries/console_coff/examples/testcon2_rus"},
|
||||
}) else tup.append_table(img_files, {
|
||||
@@ -641,6 +641,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
|
||||
}) end
|
||||
|
||||
if build_type == "ru_RU" then tup.append_table(extra_files, {
|
||||
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/trunk/period"},
|
||||
{"kolibrios/games/Dungeons/Dungeons", VAR_PROGS .. "/games/Dungeons/Dungeons"},
|
||||
}) end
|
||||
|
||||
@@ -666,6 +667,7 @@ tup.append_table(img_files, {
|
||||
{"EASYSHOT", VAR_PROGS .. "/cmm/misc/easyshot.com"},
|
||||
{"MOUSECFG", VAR_PROGS .. "/cmm/mousecfg/mousecfg.com"},
|
||||
{"BARSCFG", VAR_PROGS .. "/cmm/barscfg/barscfg.com"},
|
||||
{"SEARCH", VAR_PROGS .. "/cmm/misc/search.com"},
|
||||
{"SYSPANEL", VAR_PROGS .. "/cmm/misc/software_widget.com"},
|
||||
{"SYSMON", VAR_PROGS .. "/cmm/sysmon/sysmon.com"},
|
||||
{"TMPDISK", VAR_PROGS .. "/cmm/tmpdisk/tmpdisk.com"},
|
||||
|
@@ -29,7 +29,6 @@ Dicty=/k/utils/DICTY.KEX,79
|
||||
fNav=/k/utils/fNav/fNav,93
|
||||
CncEditor=/k/utils/cnc_editor/cnc_editor,15
|
||||
Life=/k/demos/life2,13
|
||||
Calc+=/k/utils/calcplus,4
|
||||
TinyBasic=/k/develop/TinyBasic/TinyBasic,91
|
||||
THashView=/k/utils/thashview,124
|
||||
Notes=/k/utils/notes,117
|
||||
|
2
data/en_US/Tupfile.lua
Normal file
2
data/en_US/Tupfile.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("welcome.htm", "cp %f %o" .. tup.getconfig("KPACK_CMD"), "welcome.htm.kpack")
|
@@ -235,8 +235,8 @@ ico=58
|
||||
x=68
|
||||
y=68
|
||||
[21]
|
||||
name=CALC
|
||||
path=CALC
|
||||
name=CALC+
|
||||
path=CALCPLUS
|
||||
param=
|
||||
ico=4
|
||||
x=204
|
||||
|
@@ -12,6 +12,7 @@
|
||||
23 Game Center |allgames
|
||||
60 System panel |syspanel
|
||||
18 Documentation |docpack
|
||||
49 Search |search
|
||||
53 Run |run
|
||||
04 Shut down |end
|
||||
#1 **** DEMOS
|
||||
@@ -91,6 +92,7 @@
|
||||
59 Screen keyboard |zkey
|
||||
#10 **** DATA PROCESSING
|
||||
16 Calculator |calc
|
||||
16 Calculator+ |calcplus
|
||||
03 Tinypad |tinypad
|
||||
28 CodeEdit |develop/cedit
|
||||
21 Table processor |table
|
||||
|
@@ -1,78 +1,95 @@
|
||||
<html><title>Welcome notes</title><body bgcolor=#fff>
|
||||
<html>
|
||||
<title>Welcome notes</title>
|
||||
|
||||
<h1><font color=1BB71A>Welcome to KolibriOS</font> 0.8.0.0 beta</h1>
|
||||
<pre>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
<h1>
|
||||
<font color=1BB71A>Welcome to KolibriOS</font>
|
||||
</h1>
|
||||
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
|
||||
Dear friends,
|
||||
|
||||
What you see now is the most compact operating system in the whole world. Kolibri is a piece of programming art that is based on logic and coffee.
|
||||
What you see now is the most compact operating system in the whole world. KolibriOS is a piece of programming art that is based on logic and coffee.
|
||||
|
||||
As no one reads manuals, I'm here to help with the most common issues that new users of KolibriOS are facing. This document is also a required read for any <b>YouTube blogger</b> who wants to make a review of the system :)
|
||||
As no one reads manuals, I'm here to help with the most common issues that new users of KolibriOS are facing. This document is also required to read for any <b>YouTube blogger</b> who wants to make a review of the system :)
|
||||
|
||||
<dd><h3><kosicon n=5>Floppy version</h3>
|
||||
<dd><h3><kosicon n=5> Floppy version</h3>
|
||||
The asterisk [*] in the Menu means the app isn't available in the Floppy version, only in the Big distro (Flash/ISO/UEFI-HDD). Not all programs are available via Menu to encourage you to explore KolibriOS files by yourself.
|
||||
|
||||
<h3><kosicon n=25>If you have problems with USB</h3>
|
||||
Only USB1.1 and USB2 ports are supported, not USB3+. And yep, the USB driver is written entirely in assembler. Some motherboards have options like "USB Legacy Support" or something similar, which may help the system detect your device. Also, some ports on your motherboard may work while others may not, only G-d knows why. So, play with the BIOS/UEFI settings and try different ports.
|
||||
<h3><kosicon n=25> If you have problems with USB</h3>
|
||||
Only USB 1.1 and USB 2.0 ports are supported, not USB 3+. And yep, the USB driver is written entirely in assembler. Some motherboards have options like "USB Legacy Support" or something similar, which may help the system detect your device. Also, some ports on your motherboard may work while others may not, only G-d knows why. So, play with the BIOS/UEFI settings and try different ports.
|
||||
|
||||
<h3><kosicon n=7>Sound</h3>
|
||||
<h3><kosicon n=7> Sound</h3>
|
||||
List of supported devices:
|
||||
- Most AC97 cards: Intel, nForce, VIA
|
||||
- A variety of HD Audio devices: Intel, Realtek...
|
||||
- SIS PCI audio (Sis 7012)
|
||||
- Creative labs EMU10K1X (Dell OEM)
|
||||
- Media Forte FM801
|
||||
- ISA Sound Blaster 16. Only THIS particular model works, not other SB cards that have software SB16-emulation
|
||||
- ISA Sound Blaster 16
|
||||
<i>Only THIS particular model works,
|
||||
not other cards that have software SB16-emulation</i>
|
||||
|
||||
<h3><kosicon n=61>Video</h3>
|
||||
By default, you can change the resolution only on the blue boot screen. The modes listed there are provided by the video card's BIOS. It is impossible to 'simply add additional screen modes to the list'. If video card's BIOS doesn't provide some modes then you need a driver. It is not possible to write a generic video card driver. Each driver must be written for a specific video card model.
|
||||
Intel and AMD drivers for some video cards are ported from Linux and are available in the Big distro. Check SYSPANEL. Features: change resolution in Kolibri, hardware cursor (not actual anymore), bit-blit operations accelerated.
|
||||
<h3><kosicon n=61> Video</h3>
|
||||
By default, you can change the resolution only on the blue boot screen. The modes listed there are provided by the video card's BIOS. It is impossible to 'simply add additional screen modes to the list'. If video card's BIOS doesn't provide some modes then you need a driver. It is not possible to write a generic video card driver. Separate driver must be written for each specific video card model.
|
||||
Intel and AMD drivers for some video cards are ported from Linux and are available in the Big distro.
|
||||
|
||||
<h3><kosicon n=25>Wi-Fi</h3>
|
||||
Not supported. You have to know that the Wi-Fi specification is so complex that it is almost impossible to write the code for it from scratch. Only big OSes like Windows / Linux / BSD have it. MacOS and Haiku just ported the BSD drivers. I don't say porting them in KolibiOS is not possible, but the required effort is going to be tremendous.
|
||||
Check SYSPANEL. Features: ability to change resolution in KolibriOS, hardware cursor (not actual anymore), bit-blit operations acceleration.
|
||||
|
||||
<h3><kosicon n=25>LAN/Ethernet</h3>
|
||||
Supported devices:
|
||||
3c59x 3Com Fast EtherLink (3c59x/450/555/556/575/900/905/980)
|
||||
ar81xx Atheros 8161/8162/8171/8172
|
||||
dec21x4x* Accton en1207B-TX, DEC 21140,.., VirtualPC
|
||||
forcedeth* nVidia nForce chipset integrated ethernet
|
||||
i8255x Intel eepro/100 (i8255x, i82562, i82801,..), QEMU
|
||||
i8254x Intel PRO/1000 (i8254x), Virtualbox, BOCHS, QEMU
|
||||
mtd80x Myson MTD803
|
||||
pcnet32 AMD PCnet (79c970, 79c978, 79c973,..), Virtualbox, QEMU
|
||||
r6040 RDC Semiconductors R6040
|
||||
rhine VIA Rhine II and III
|
||||
rtl8029 Realtek 8029/8019, ne2000 PCI, BOCHS, QEMU
|
||||
rtl8139 Realtek 8139 and clones, QEMU
|
||||
rtl8169 Realtek 8110/8111/8167/8168/8169
|
||||
sis900 SiS900, 7016
|
||||
* - in development.
|
||||
Blessed be our Flemish friend Jeffrey, who has written most of the Network staff by himself: stack, drivers, and a lot of apps (except WebView).
|
||||
<h3><kosicon n=25> Wi-Fi</h3>
|
||||
Not supported. You have to know that the Wi-Fi specification is so complex that it is almost impossible to write the code for it from scratch. Only big OSes like Windows / Linux / BSD have it. MacOS and Haiku just ported the BSD drivers. I don't say porting them to KolibiOS is not possible, but the required effort is going to be tremendous.
|
||||
|
||||
<h3><kosicon n=12>WebView</h3>
|
||||
It was never intended to be a browser but rather a Help Center that uses HTML markup. It fits well this purpose, doesn't it? According to current WebView's codebase (that was my first app ever) it will never become a normal web-browser. Please help us and write/port smth good. Good undertake will be to finish Netsurf port.
|
||||
<h3><kosicon n=25> LAN/Ethernet</h3>
|
||||
List of supported devices:
|
||||
- 3c59x 3Com Fast EtherLink (3c59x/450/555/556/575/900/905/980)
|
||||
- ar81xx Atheros 8131/8132/8151/8152/8161/8162/8171/8172
|
||||
Killer E2200/E2400/E2500
|
||||
- dec21x4x* Accton en1207B-TX, DEC 21140, ..., VirtualPC
|
||||
- forcedeth* Nvidia nForce chipset integrated Ethernet
|
||||
- i8255x Intel eepro/100 (i8255x, i82562, i82801, ...), QEMU
|
||||
- i8254x Intel PRO/1000 (i8254x), Virtualbox, BOCHS, QEMU
|
||||
- mtd80x Myson MTD803
|
||||
- pcnet32 AMD PCnet (79c970, 79c978, 79c973, ...), Virtualbox, QEMU
|
||||
- r6040 RDC Semiconductors R6040
|
||||
- rhine VIA Rhine II and III
|
||||
- rtl8029 Realtek 8029/8019, ne2000 PCI, BOCHS, QEMU
|
||||
- rtl8139 Realtek 8139 and clones, QEMU
|
||||
- rtl8169 Realtek 8110/8111/8167/8168/8169
|
||||
- sis900 SiS900, 7016
|
||||
|
||||
<h3><kosicon n=9>How did you achieve so much while being so small?</h3>
|
||||
- Kernel, almost all drivers and most applications are written in assembly.
|
||||
- Files in IMG are packed via the LZMA algorithm from 7-Zip. They are unpacked to RAM when accessed.
|
||||
- Images are manually optimized by hand: postering, dithering and other techniques were used.
|
||||
* - in development
|
||||
|
||||
Blessed be our Flemish friend Jeffrey, who has written most of the Network staff by him: stack, drivers, and a lot of apps (except WebView).
|
||||
|
||||
<h3><kosicon n=12> WebView</h3>
|
||||
It was never intended to be a browser, but rather a Help Center that uses HTML markup. It fits this purpose well, doesn't it? According to current WebView's codebase (that was my first app ever) it will never become a normal web browser. Please help us and write/port something good. For example, it will be nice try to finish Netsurf port.
|
||||
|
||||
<h3><kosicon n=9> How did you achieve so much while being so small?</h3>
|
||||
- Kernel, almost all drivers and most applications are written in assembly language
|
||||
- Files in IMG are packed via the LZMA algorithm from 7-Zip. They are unpacked to RAM when accessed
|
||||
- Most of the images are manually optimized: posterization, dithering and other techniques were used
|
||||
- Files names in IMG fit 8.3 naming convention (name.extension) which doesn't use additional FAT12 space
|
||||
- Image files are combined into a single file
|
||||
- Compact binary header of applications, no sections
|
||||
- Resources are reused, and file duplication is avoided, for example:
|
||||
~ Shared libraries
|
||||
~ KFM2 is an Eolite just with another appearance
|
||||
~ Memory app uses system icons as images
|
||||
~ one app for APP+, Games and System panel
|
||||
~ Many apps use shared libraries
|
||||
~ KFM2 and Eolite are a single app, just with different appearance
|
||||
~ APP+, Games Center and System Panel are a single app also
|
||||
~ Memory Blocks game uses system icons as images
|
||||
|
||||
|
||||
See more <a href=http://wiki.kolibrios.org/wiki/Hardware_Support>http://wiki.kolibrios.org/wiki/Hardware_Support</a>
|
||||
</dd>
|
||||
|
||||
<h3><kosicon n=13>Last words</h3>
|
||||
<font bg=#F9F0A3>We want to express our gratitude to every KolibriOS contributor. Also we would like to give special thanks to Ville M. Turjanmaa, the author of MenuetOS, the predecessor of our system. Finally, we want to thank you, the brave and curious users, we are doing it all for you!
|
||||
<h3><kosicon n=13> Last words</h3>
|
||||
<font bg=#F9F0A3>We want to express our gratitude to every KolibriOS contributor. Also, we would like to give special thanks to Ville M. Turjanmaa, the author of MenuetOS, the predecessor of our system.
|
||||
|
||||
Finally, we want to thank you, brave and curious users, as we are doing it all for you!
|
||||
|
||||
Have fun!</font>
|
||||
|
||||
Sincerely yours,
|
||||
KolibriOS Team
|
||||
|
||||
<img src=/kolibrios/res/system/signs.png alt="You have to use Big Distro to see this image!">
|
||||
<!-- Somewhere deep in the Galaxy stars light up and go out, empires are born and turn to dust. In this impenetrable darkness and decadence, there are people who are still working on Kolibri. Many years will pass and perhaps you and I will no longer be here, and our great-grandchildren will ask "Who were those insane who made such an incredible OS?" -->
|
||||
<!-- Somewhere deep in the Galaxy stars light up and go out, empires are born and turn to dust. In this impenetrable darkness and decadence, there are people who are still working on KolibriOS. Many years will pass and perhaps you and I will no longer be here, and our great-grandchildren will ask "Who were those insane who made such an incredible OS?" -->
|
@@ -235,8 +235,8 @@ ico=58
|
||||
x=68
|
||||
y=68
|
||||
[21]
|
||||
name=CALC
|
||||
path=CALC
|
||||
name=CALC+
|
||||
path=CALCPLUS
|
||||
param=
|
||||
ico=4
|
||||
x=204
|
||||
|
@@ -13,6 +13,7 @@
|
||||
16 Centro de juegos |allgames
|
||||
60 System panel |syspanel
|
||||
18 Ayuda |docpack
|
||||
49 Buscar |search
|
||||
53 Ejecutar aplicaci<63>n |run
|
||||
04 Apagar |end
|
||||
#1 **** DEMOS
|
||||
@@ -95,6 +96,7 @@
|
||||
24 NDN * |/kolibrios/utils/ndn/ndn
|
||||
#11 **** PROCESO DE DATOS
|
||||
16 Calculadora |calc
|
||||
16 Calculadora+ |calcplus
|
||||
16 Tinypad |tinypad
|
||||
16 CodeEdit |develop/cedit
|
||||
16 Procesador de tablas |table
|
||||
|
@@ -235,8 +235,8 @@ ico=58
|
||||
x=68
|
||||
y=68
|
||||
[21]
|
||||
name=CALC
|
||||
path=CALC
|
||||
name=CALC+
|
||||
path=CALCPLUS
|
||||
param=
|
||||
ico=4
|
||||
x=204
|
||||
|
@@ -80,6 +80,7 @@
|
||||
65 NDN * |/kolibrios/utils/ndn/ndn
|
||||
#11 **** DATA PROCESSING ****
|
||||
16 Kalkulaator |calc
|
||||
16 Kalkulaator+ |calcplus
|
||||
16 Teksti redaktor |tinypad
|
||||
16 CodeEdit |develop/cedit
|
||||
16 Tabelarvutus |table
|
||||
|
@@ -235,8 +235,8 @@ ico=58
|
||||
x=68
|
||||
y=68
|
||||
[21]
|
||||
name=CALC
|
||||
path=CALC
|
||||
name=CALC+
|
||||
path=CALCPLUS
|
||||
param=
|
||||
ico=4
|
||||
x=204
|
||||
|
@@ -79,6 +79,7 @@
|
||||
65 NDN * |/kolibrios/utils/ndn/ndn
|
||||
#11 **** DATA PROCESSING
|
||||
16 Calcolatrice |calc
|
||||
16 Calcolatrice+ |calcplus
|
||||
16 Tinypad |tinypad
|
||||
16 CodeEdit |develop/cedit
|
||||
16 Table Processor |table
|
||||
|
@@ -235,8 +235,8 @@ ico=58
|
||||
x=68
|
||||
y=68
|
||||
[21]
|
||||
name=CALC
|
||||
path=CALC
|
||||
name=CALC+
|
||||
path=CALCPLUS
|
||||
param=
|
||||
ico=4
|
||||
x=204
|
||||
|
@@ -12,6 +12,7 @@
|
||||
23 <20><><EFBFBD><E0AEA2> 業<><E6A5AD> |allgames
|
||||
60 <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |syspanel
|
||||
18 <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |docpack
|
||||
49 <20><><EFBFBD><EFBFBD><EFBFBD> |search
|
||||
53 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> |run
|
||||
04 <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> ࠡ<><E0A0A1><EFBFBD> |end
|
||||
#1 **** 2D <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -89,6 +90,7 @@
|
||||
59 <20><>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |zkey
|
||||
#10 **** <20><><EFBFBD><EFBFBD>
|
||||
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |calc
|
||||
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+ |calcplus
|
||||
03 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Tinypad |tinypad
|
||||
28 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CodeEdit |develop/cedit
|
||||
21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |table
|
||||
@@ -118,7 +120,7 @@
|
||||
45 <20><><EFBFBD><EFBFBD>⮩ <20><>ਭ<EFBFBD><E0A8AD><EFBFBD><EFBFBD><EFBFBD> |easyshot
|
||||
29 FB2 <20><>⠫<EFBFBD><E2A0AB> |fb2read
|
||||
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> |aclock
|
||||
21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |period
|
||||
21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |/kolibrios/utils/period
|
||||
59 <20>७<EFBFBD><E0A5AD><EFBFBD><EFBFBD> KJ|ABuIIIA |games/klavisha
|
||||
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> |demos/bcdclk
|
||||
53 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |timer
|
||||
|
@@ -668,6 +668,8 @@ socket_accept:
|
||||
|
||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_accept: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi
|
||||
|
||||
push edx esi
|
||||
|
||||
call socket_num_to_ptr
|
||||
test eax, eax
|
||||
jz .invalid
|
||||
@@ -696,6 +698,24 @@ socket_accept:
|
||||
mov ebx, [ebx + APPDATA.tid]
|
||||
mov [eax + SOCKET.TID], ebx
|
||||
|
||||
pop esi edx
|
||||
|
||||
test edx, edx
|
||||
jz .skip_sockaddr
|
||||
|
||||
mov word[edx], 0 ; unknown domain
|
||||
cmp esi, 8 ; domain + port + ipv4
|
||||
jb .skip_sockaddr
|
||||
|
||||
mov word[edx], AF_INET4
|
||||
mov esi, edx
|
||||
mov edx, [eax + IP_SOCKET.RemoteIP]
|
||||
mov [esi + sockaddr.ip], edx
|
||||
|
||||
mov dx, [eax + TCP_SOCKET.RemotePort]
|
||||
mov [esi + sockaddr.port], dx
|
||||
|
||||
.skip_sockaddr:
|
||||
; Return socket number to caller
|
||||
mov eax, [eax + SOCKET.Number]
|
||||
mov [esp + SYSCALL_STACK.eax], eax
|
||||
@@ -711,16 +731,19 @@ socket_accept:
|
||||
.wouldblock:
|
||||
mov dword[esp + SYSCALL_STACK.ebx], EWOULDBLOCK
|
||||
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||
pop esi edx
|
||||
ret
|
||||
|
||||
.invalid:
|
||||
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||
pop esi edx
|
||||
ret
|
||||
|
||||
.notsupp:
|
||||
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||
pop esi edx
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------;
|
||||
|
2
programs/bcc32/games/blocks/Tupfile.lua
Normal file
2
programs/bcc32/games/blocks/Tupfile.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("block.asm", "fasm -m 65636 %f %o " .. tup.getconfig("KPACK_CMD"), "block.bin")
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
229
programs/bcc32/games/blocks/models/model_8911_bird.bjs
Normal file
229
programs/bcc32/games/blocks/models/model_8911_bird.bjs
Normal file
@@ -0,0 +1,229 @@
|
||||
// block name, color, step, coord: x,y,z, rotation: x,y,z
|
||||
|
||||
const m1=16711680;
|
||||
const m2=16776960;
|
||||
const m3=655615;
|
||||
const m4=65315;
|
||||
const m5=16777215;
|
||||
const m6=16756655;
|
||||
const m7=16776367;
|
||||
const m8=0;
|
||||
const m9=65498;
|
||||
|
||||
model_list=[
|
||||
['b2x3x1', m1, 0, 4,-20, 3, 0,0,90],
|
||||
['b2x3x1', m1, 0, 4,-12, 3, 0,0,90],
|
||||
['b2x3x1', m1, 0, 4, -4, 3, 0,0,90],
|
||||
['b2x3x1', m1, 0, 4, 4, 3, 0,0,90],
|
||||
['b2x3x1', m1, 0, 4, 12, 3, 0,0,90],
|
||||
['t2x3x1', m1, 0, 0, 20, 3, 0,0,90],
|
||||
['b1x1x1', m1, 0, 0, 28, 3, 0,0,0],
|
||||
['b1x1x1', m1, 0, -8,-16, 3, 0,0,0],
|
||||
['b1x1x1', m1, 0, 8,-16, 3, 0,0,0],
|
||||
['b2x4x1', m1, 0,-12,-12, 3, 0,0,0],
|
||||
['b2x4x1', m1, 0, 8,-12, 3, 0,0,0],
|
||||
['l2x2x1', m1, 0, -8, 4, 3, 0,0,90],
|
||||
['l2x2x1', m1, 0, 8, 4, 3, 0,0,0],
|
||||
['b1x6x1', m1, 1, 0, 20, 6, 0,0,0],
|
||||
['b1x6x1', m1, 1, -4, 16, 6, 0,0,0],
|
||||
['b1x6x1', m1, 1, 4, 16, 6, 0,0,0],
|
||||
['b1x10x1', m1, 1, 0,-24, 6, 0,0,0],
|
||||
['b2x8x1', m1, 1, -8,-16, 6, 0,0,0],
|
||||
['b2x8x1', m1, 1, 4,-16, 6, 0,0,0],
|
||||
['b2x3x1', m1, 1,-16, -8, 6, 0,0,0],
|
||||
['b2x3x1', m1, 1, 12, -8, 6, 0,0,0],
|
||||
['l2x2x1', m1, 1, -4,-20, 6, 0,0,-180],
|
||||
['l2x2x1', m1, 1,-12,-12, 6, 0,0,-180],
|
||||
['l2x2x1', m1, 1,-12, 4, 6, 0,0,90],
|
||||
['l2x2x1', m1, 1, 12, 4, 6, 0,0,0],
|
||||
['l2x2x1', m1, 1, 12,-12, 6, 0,0,-90],
|
||||
['l2x2x1', m1, 1, 4,-20, 6, 0,0,-90],
|
||||
['b2x3x1', m1, 2, 4,-24, 9, 0,0,90],
|
||||
['b1x3x1', m1, 2, -8,-24, 9, 0,0,0],
|
||||
['b1x3x1', m1, 2, 8,-24, 9, 0,0,0],
|
||||
['b1x4x1', m1, 2,-12,-20, 9, 0,0,0],
|
||||
['b1x4x1', m1, 2, 12,-20, 9, 0,0,0],
|
||||
['b1x6x1', m1, 2,-16,-16, 9, 0,0,0],
|
||||
['b1x6x1', m1, 2, 16,-16, 9, 0,0,0],
|
||||
['t2x3x1', m1, 2,-12, 8, 9, 0,0,90],
|
||||
['t2x3x1', m1, 2, 12, 8, 9, 0,0,90],
|
||||
['b2x4x1', m1, 2, 4, 12, 9, 0,0,90],
|
||||
['b1x2x1', m1, 2, 8, 12, 9, 0,0,0],
|
||||
['b1x3x1', m2, 2, 4, 20, 9, 0,0,90],
|
||||
['b1x3x1', m3, 2, 4, 24, 9, 0,0,90],
|
||||
['t2x3x1', m3, 2, 0, 28, 9, 0,0,90],
|
||||
['b2x3x1', m1, 3, 0,-28, 12, 0,0,90],
|
||||
['b2x2x1', m1, 3, 4,-28, 12, 0,0,0],
|
||||
['l2x2x1', m1, 3,-12,-20, 12, 0,0,-180],
|
||||
['l2x2x1', m1, 3, 12,-20, 12, 0,0,-90],
|
||||
['b2x4x1', m1, 3,-16,-16, 12, 0,0,0],
|
||||
['b2x4x1', m1, 3, 12,-16, 12, 0,0,0],
|
||||
['b1x3x1', m1, 3,-16, 0, 12, 0,0,0],
|
||||
['b1x3x1', m1, 3, 16, 0, 12, 0,0,0],
|
||||
['l2x2x1', m1, 3,-12, 12, 12, 0,0,-90],
|
||||
['l2x2x1', m1, 3, 12, 12, 12, 0,0,180],
|
||||
['b1x2x1', m2, 3, -4, 16, 12, 0,0,90],
|
||||
['b1x2x1', m2, 3, 8, 16, 12, 0,0,90],
|
||||
['t2x3x1', m3, 3, 0, 20, 12, 0,0,90],
|
||||
['b1x3x1', m1, 4, 4,-28, 15, 0,0,90],
|
||||
['l2x2x1', m1, 4, -8,-24, 15, 0,0,180],
|
||||
['l2x2x1', m1, 4, 8,-24, 15, 0,0,-90],
|
||||
['b1x2x1', m1, 4,-12,-20, 15, 0,0,90],
|
||||
['b1x2x1', m1, 4, 16,-20, 15, 0,0,90],
|
||||
['c1x2x1', m4, 4,-16,-16, 15, 0,0,90],
|
||||
['c1x2x1', m4, 4, 20,-16, 15, 0,0,90],
|
||||
['b1x4x1', m1, 4,-16,-12, 15, 0,0,0],
|
||||
['b1x4x1', m1, 4, 16,-12, 15, 0,0,0],
|
||||
['l2x2x1', m1, 4,-12, 4, 15, 0,0,90],
|
||||
['l2x2x1', m1, 4, 12, 4, 15, 0,0,0],
|
||||
['b1x1x1', m1, 4,-12, 12, 15, 0,0,0],
|
||||
['b1x1x1', m1, 4, 12, 12, 15, 0,0,0],
|
||||
['l2x2x1', m2, 4, -4, 12, 15, 0,0,90],
|
||||
['l2x2x1', m2, 4, 4, 12, 15, 0,0,0],
|
||||
['b1x2x1', m2, 4, 0, 16, 15, 0,0,0],
|
||||
['b1x6x1', m1, 5,-16,-20, 18, 0,0,0],
|
||||
['b1x6x1', m1, 5, 16,-20, 18, 0,0,0],
|
||||
['b1x3x1', m1, 5, -8, 4, 18, 0,0,90],
|
||||
['b1x3x1', m1, 5, 16, 4, 18, 0,0,90],
|
||||
['l2x2x1', m1, 5, -8, 12, 18, 0,0,-90],
|
||||
['l2x2x1', m1, 5, 8, 12, 18, 0,0,-180],
|
||||
['b1x3x1', m2, 5, 4, 16, 18, 0,0,90],
|
||||
['b1x2x1', m1, 5,-12,-24, 18, 0,0,0],
|
||||
['b1x2x1', m1, 5, 12,-24, 18, 0,0,0],
|
||||
['b2x3x1', m1, 5, 0,-28, 18, 0,0,90],
|
||||
['b2x2x1', m1, 5, 4,-28, 18, 0,0,0],
|
||||
['t2x3x1', m1, 6, 0,-28, 21, 0,0,90],
|
||||
['l2x2x1', m1, 6, -8,-24, 21, 0,0,0],
|
||||
['l2x2x1', m1, 6,-16,-20, 21, 0,0,0],
|
||||
['l2x2x1', m1, 6, 8,-24, 21, 0,0,90],
|
||||
['l2x2x1', m1, 6, 16,-20, 21, 0,0,90],
|
||||
['b1x3x1', m1, 6,-16,-12, 21, 0,0,0],
|
||||
['b1x3x1', m1, 6, 16,-12, 21, 0,0,0],
|
||||
['l2x2x1', m1, 6,-12, 0, 21, 0,0,90],
|
||||
['l2x2x1', m1, 6, -8, 8, 21, 0,0,-90],
|
||||
['l2x2x1', m1, 6, 12, 0, 21, 0,0,0],
|
||||
['l2x2x1', m1, 6, 8, 8, 21, 0,0,-180],
|
||||
['b1x3x1', m1, 6, -4, 12, 21, 0,0,-90],
|
||||
['b1x1x1', m1, 7, -8, 8, 24, 0,0,0],
|
||||
['b2x3x1', m1, 7, -4, 12, 24, 0,0,-90],
|
||||
['b1x1x1', m1, 7, 8, 8, 24, 0,0,0],
|
||||
['l2x2x1', m1, 7,-12, 4, 24, 0,0,-90],
|
||||
['l2x2x1', m1, 7, 12, 4, 24, 0,0,-180],
|
||||
['b1x3x1', m1, 7,-16, 0, 24, 0,0,180],
|
||||
['b1x3x1', m1, 7, 16, 0, 24, 0,0,180],
|
||||
['l2x2x1', m1, 7,-16,-16, 24, 0,0,0],
|
||||
['l2x2x1', m1, 7, 16,-16, 24, 0,0,90],
|
||||
['l2x2x1', m1, 7, -8,-20, 24, 0,0,180],
|
||||
['l2x2x1', m1, 7, 8,-20, 24, 0,0,-90],
|
||||
['b1x3x1', m3, 7, 4,-24, 24, 0,0,90],
|
||||
['b2x2x1', m5, 8, -8,-24, 27, 0,0,0],
|
||||
['b2x3x1', m5, 8, 8,-24, 27, 0,0,90],
|
||||
['b1x3x1', m1, 8,-12,-24, 27, 0,0,0],
|
||||
['b1x3x1', m1, 8, 12,-24, 27, 0,0,0],
|
||||
['b1x4x1', m1, 8,-16,-20, 27, 0,0,0],
|
||||
['b1x4x1', m1, 8, 16,-20, 27, 0,0,0],
|
||||
['l2x2x1', m1, 8,-16, 0, 27, 0,0,-90],
|
||||
['l2x2x1', m1, 8, 16, 0, 27, 0,0,-180],
|
||||
['l2x2x1', m1, 8, 8, 4, 27, 0,0,0],
|
||||
['b2x4x1', m1, 8, 4, 4, 27, 0,0,90],
|
||||
['b1x1x1', m1, 8,-12, 4, 27, 0,0,0],
|
||||
['r1x1x1', m5, 9,-16,-20, 30, 0,0,0],
|
||||
['r1x1x1', m5, 9, 16,-20, 30, 0,0,0],
|
||||
['b1x2x1', m5, 9, -8,-20, 30, 0,0,90],
|
||||
['b1x2x1', m5, 9, 12,-20, 30, 0,0,90],
|
||||
['t2x3x1', m5, 9, 0,-20, 30, 0,0,-90],
|
||||
['r1x1x1', m6, 9,-12,-24, 30, 0,0,0],
|
||||
['r1x1x1', m6, 9, 12,-24, 30, 0,0,0],
|
||||
['r1x2x1', m7, 9, -4,-28, 30, 0,0,0],
|
||||
['r1x2x1', m7, 9, 4,-28, 30, 0,0,0],
|
||||
['b1x4x1', m1, 9,-16,-16, 30, 0,0,0],
|
||||
['b1x4x1', m1, 9, 16,-16, 30, 0,0,0],
|
||||
['l2x2x1', m1, 9,-12, 0, 30, 0,0,90],
|
||||
['l2x2x1', m1, 9, 12, 0, 30, 0,0,0],
|
||||
['l2x2x1', m1, 9, 8, 8, 30, 0,0,-180],
|
||||
['b2x3x1', m1, 9, 0, 4, 30, 0,0,90],
|
||||
['l2x2x1', m5, 10, -4,-20, 33, 0,0,-180],
|
||||
['l2x2x1', m5, 10,-12,-16, 33, 0,0,-180],
|
||||
['l2x2x1', m5, 10, 4,-20, 33, 0,0,-90],
|
||||
['l2x2x1', m5, 10, 12,-16, 33, 0,0,-90],
|
||||
['a1x2x2', m7, 10, 0,-24, 30, 0,0,-180],
|
||||
['r1x2x1', m7, 10, 0,-24, 33, 0,0,0],
|
||||
['b1x2x1', m1, 10,-16,-12, 33, 0,0,0],
|
||||
['l2x2x1', m1, 10,-16, 0, 33, 0,0,-90],
|
||||
['b1x1x1', m1, 10,-12, 4, 33, 0,0,0],
|
||||
['b2x4x1', m1, 10, 4, 4, 33, 0,0,90],
|
||||
['l2x2x1', m1, 10, 8, 4, 33, 0,0,0],
|
||||
['b2x4x1', m1, 10, 12,-12, 33, 0,0,0],
|
||||
['b1x1x1', m1, 11, 0,-24, 36, 0,0,0],
|
||||
['b1x1x1', m5, 11, -4,-24, 36, 0,0,0],
|
||||
['b1x1x1', m5, 11, 4,-24, 36, 0,0,0],
|
||||
['b1x1x3', m8, 11, -8,-24, 30, 0,0,0],
|
||||
['b1x1x3', m8, 11, 8,-24, 30, 0,0,0],
|
||||
['l2x2x1', m5, 11,-12,-20, 36, 0,0,0],
|
||||
['l2x2x1', m5, 11, 12,-20, 36, 0,0,90],
|
||||
['r1x1x1', m5, 11,-16,-16, 36, 0,0,90],
|
||||
['r1x1x1', m5, 11, 16,-16, 36, 0,0,90],
|
||||
['b1x4x1', m1, 11,-16,-12, 36, 0,0,0],
|
||||
['b2x4x1', m1, 11, 12,-12, 36, 0,0,0],
|
||||
['b2x3x1', m1, 11, 4, 0, 36, 0,0,0],
|
||||
['l2x2x1', m1, 11, -8, 0, 36, 0,0,90],
|
||||
['b1x3x1', m1, 11, 0, 8, 36, 0,0,90],
|
||||
['b1x3x1', m1, 12, 4,-24, 39, 0,0,90],
|
||||
['r1x1x1', m5, 12, -8,-24, 39, 0,0,0],
|
||||
['r1x1x1', m5, 12, 8,-24, 39, 0,0,0],
|
||||
['b1x1x1', m5, 12,-12,-20, 39, 0,0,0],
|
||||
['b1x6x1', m5, 12, 12,-20, 39, 0,0,90],
|
||||
['b1x1x1', m1, 12,-12,-16, 39, 0,0,0],
|
||||
['l2x2x1', m1, 12,-16,-12, 39, 0,0,0],
|
||||
['l2x2x1', m1, 12,-12, -4, 39, 0,0,90],
|
||||
['b1x1x1', m1, 12, -8, 0, 39, 0,0,0],
|
||||
['l2x2x1', m1, 12, -4, 4, 39, 0,0,90],
|
||||
['l2x2x1', m1, 12, 4, 8, 39, 0,0,-180],
|
||||
['b1x1x1', m1, 12, 8, 4, 39, 0,0,0],
|
||||
['l2x2x1', m1, 12, 12, 0, 39, 0,0,-180],
|
||||
['b1x2x1', m1, 12, 16, -8, 39, 0,0,0],
|
||||
['l2x2x1', m1, 12, 12,-12, 39, 0,0,-90],
|
||||
['l2x2x1', m1, 13, 4,-20, 42, 0,0,-90],
|
||||
['l2x2x1', m1, 13, -4,-24, 42, 0,0,0],
|
||||
['b2x6x1', m1, 13,-12,-20, 42, 0,0,0],
|
||||
['b1x3x1', m1, 13, 0, 4, 42, 0,0,90],
|
||||
['b2x2x1', m1, 13, 4, 0, 42, 0,0,0],
|
||||
['b1x6x1', m1, 13, 12,-20, 42, 0,0,0],
|
||||
['b1x4x1', m1, 14,-12,-16, 45, 0,0,0],
|
||||
['b2x4x1', m1, 14, 4,-20, 45, 0,0,90],
|
||||
['b2x6x1', m1, 14, 12,-12, 45, 0,0,90],
|
||||
['b2x4x1', m1, 14, 4, -4, 45, 0,0,90],
|
||||
['b1x3x1', m1, 14, 4, 4, 45, 0,0,90],
|
||||
['l2x2x1', m1, 14, 8, -4, 45, 0,0,0],
|
||||
['l2x2x1', m1, 14, 8,-16, 45, 0,0,-90],
|
||||
['b2x4x1', m1, 15, -4,-16, 48, 0,0,0],
|
||||
['b1x3x1', m1, 15, -8,-12, 48, 0,0,0],
|
||||
['b1x3x1', m1, 15, 4, 0, 48, 0,0,90],
|
||||
['b2x2x1', m1, 15, 4, -8, 48, 0,0,0],
|
||||
['l2x2x1', m1, 15, 4,-12, 48, 0,0,-90],
|
||||
['b1x3x1', m2, 16, 8,-12, 0, 0,0,0],
|
||||
['b1x3x1', m2, 16, -8,-12, 0, 0,0,0],
|
||||
['c1x2x1', m9, 17, 20,-16, 12, 0,0,0],
|
||||
['b1x6x1', m4, 17, 0, 8, 0, 0,0,0, 1],
|
||||
['b1x6x1', m9, 17, 0, 4, -3, 0,0,0, 1],
|
||||
['b1x3x1', m4, 18, 0, 4, 3, 0,0,0, 1],
|
||||
['b1x3x1', m2, 18, 0, 16, 3, 0,0,0, 1],
|
||||
['c1x2x1', m4, 18, 0, 0, 6, 0,0,0, 1],
|
||||
['b1x1x1', m4, 18, 0, 8, 6, 0,0,0, 1],
|
||||
['b1x2x1', m2, 18, 0, 12, 6, 0,0,0, 1],
|
||||
['b1x3x1', m2, 18, 0, 4, 9, 0,0,0, 1],
|
||||
['c1x2x1', m9, 17, -20,-16, 12, 0,0,0],
|
||||
['b1x6x1', m4, 17, 0, 8, 0, 0,0,0, 1],
|
||||
['b1x6x1', m9, 17, 0, 4, -3, 0,0,0, 1],
|
||||
['b1x3x1', m4, 18, 0, 4, 3, 0,0,0, 1],
|
||||
['b1x3x1', m2, 18, 0, 16, 3, 0,0,0, 1],
|
||||
['c1x2x1', m4, 18, 0, 0, 6, 0,0,0, 1],
|
||||
['b1x1x1', m4, 18, 0, 8, 6, 0,0,0, 1],
|
||||
['b1x2x1', m2, 18, 0, 12, 6, 0,0,0, 1],
|
||||
['b1x3x1', m2, 18, 0, 4, 9, 0,0,0, 1],
|
||||
];
|
||||
|
||||
model_animat=[
|
||||
[192,'rotation','z','Left', -1.570796327, 0, 0.017453293],
|
||||
[201,'rotation','z','Right', 0, 1.570796327, 0.017453293],
|
||||
];
|
@@ -0,0 +1,531 @@
|
||||
// block name, color, step, coord: x,y,z, rotation: x,y,z
|
||||
|
||||
const m1=32768;
|
||||
const m2=9474192;
|
||||
const m3=16777215;
|
||||
const m4=2164260863;
|
||||
const m5=655615;
|
||||
const m6=255;
|
||||
const m7=16776960;
|
||||
const m8=10824234;
|
||||
const m9=16384;
|
||||
const m10=0xc97e3b;
|
||||
|
||||
model_list=[
|
||||
['b2x4x1', m2, 0,-28, -4, 6, 0,0,90],
|
||||
['b2x3x1', m2, 0,-40, 4, 6, 0,0,0],
|
||||
['b2x3x1', m2, 0,-32, 8, 6, 0,0,0],
|
||||
['b2x6x1', m2, 0, -4, 8, 6, 0,0,90],
|
||||
['b1x3x1', m2, 0, -4, 4, 6, 0,0,90],
|
||||
['b2x4x1', m2, 0, -4, -4, 6, 0,0,90],
|
||||
['b1x2x1', m2, 0, -8, -8, 6, 0,0,90],
|
||||
['b2x3x1', m2, 0,-24, -8, 6, 0,0,0],
|
||||
['b2x4x1', m2, 1,-12, -8, 9, 0,0,0],
|
||||
['b2x2x1', m2, 1,-20, -4, 9, 0,0,0],
|
||||
['b1x2x1', m2, 1,-20, -8, 9, 0,0,90],
|
||||
['b2x3x1', m2, 1,-24, -4, 9, 0,0,90],
|
||||
['b2x3x1', m2, 1,-40, -4, 9, 0,0,0],
|
||||
['b1x2x1', m2, 1,-40, 8, 9, 0,0,0],
|
||||
['b2x4x1', m2, 1,-24, 8, 9, 0,0,90],
|
||||
['b1x2x1', m2, 1,-28, 16, 9, 0,0,90],
|
||||
['l2x2x1', m2, 2, 0,-12, 6, 0,0,-90],
|
||||
['l2x2x1', m2, 2, 8,-12, 6, 0,0,-90],
|
||||
['b2x4x1', m2, 2, 12, -8, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 12, 0, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 12, 8, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 12, 16, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 28, 16, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 28, 8, 6, 0,0,90],
|
||||
['b2x4x1', m2, 2, 28, 0, 6, 0,0,90],
|
||||
['b1x4x1', m2, 2, 28, -4, 6, 0,0,90],
|
||||
['b1x2x1', m2, 2, 24, -8, 6, 0,0,90],
|
||||
['b2x2x1', m3, 3, 20, 16, 9, 0,0,0],
|
||||
['b2x2x1', m2, 3, 12, 16, 9, 0,0,0],
|
||||
['b1x3x1', m2, 3, 20, 12, 9, 0,0,90],
|
||||
['b1x2x1', m2, 3, 20, 4, 9, 0,0,0],
|
||||
['b1x3x1', m2, 3, 20, -8, 9, 0,0,0],
|
||||
['l2x2x1', m2, 3, 24, -4, 9, 0,0,-90],
|
||||
['b2x4x1', m2, 3, 12, -4, 9, 0,0,0],
|
||||
['b2x6x1', m2, 3, 4, -4, 9, 0,0,0],
|
||||
['b1x2x1', m2, 3, 8, 20, 9, 0,0,90],
|
||||
['b1x2x1', m2, 3, 0, 16, 9, 0,0,0],
|
||||
['b2x6x1', m2, 3, 0, 8, 9, 0,0,90],
|
||||
['b2x3x1', m2, 3, -4, -4, 9, 0,0,0],
|
||||
['b2x4x1', m2, 3, 12,-12, 9, 0,0,90],
|
||||
['b1x1x1', m2, 3, 8,-16, 9, 0,0,0],
|
||||
['b1x1x1', m2, 3, 0,-16, 9, 0,0,0],
|
||||
['b1x4x1', m2, 4,-28, -4, 3, 0,0,90],
|
||||
['b1x4x1', m2, 4,-40, 0, 3, 0,0,0],
|
||||
['b1x4x1', m2, 4,-24, 12, 3, 0,0,90],
|
||||
['b1x2x1', m2, 4,-28, 16, 3, 0,0,90],
|
||||
['b1x4x1', m2, 4, -8, 12, 3, 0,0,90],
|
||||
['l2x2x1', m2, 4, 0, 12, 3, 0,0,90],
|
||||
['b1x4x1', m2, 4, 12, 20, 3, 0,0,90],
|
||||
['b1x3x1', m2, 4, 24, 20, 3, 0,0,90],
|
||||
['b1x3x1', m2, 4, 28, 12, 3, 0,0,0],
|
||||
['b1x3x1', m2, 4, 28, 0, 3, 0,0,0],
|
||||
['b1x4x1', m2, 4, 28, -4, 3, 0,0,90],
|
||||
['b1x2x1', m2, 4, 24, -8, 3, 0,0,90],
|
||||
['b1x3x1', m2, 4, 12,-12, 3, 0,0,0],
|
||||
['l2x2x1', m2, 4, 8,-12, 3, 0,0,-180],
|
||||
['b1x4x1', m2, 4, 0,-16, 3, 0,0,0],
|
||||
['b1x2x1', m2, 4, -4, -4, 3, 0,0,90],
|
||||
['b1x2x1', m2, 4, -8, -8, 3, 0,0,90],
|
||||
['b1x4x1', m2, 4,-12, -4, 3, 0,0,90],
|
||||
['b1x2x1', m2, 4,-20, -8, 3, 0,0,90],
|
||||
['b20x20x1', m1, 5,-40,-40, 0, 0,0,0],
|
||||
['b1x4x1', m3, 6,-28, -4, 12, 0,0,90],
|
||||
['b2x4x1', m2, 6,-40, 0, 12, 0,0,0],
|
||||
['b2x4x1', m2, 6,-32, 4, 12, 0,0,0],
|
||||
['b2x6x1', m2, 6,-24, -8, 12, 0,0,0],
|
||||
['b2x4x1', m2, 6, -4, 8, 12, 0,0,90],
|
||||
['b2x4x1', m2, 6, -4, -4, 12, 0,0,90],
|
||||
['b1x2x1', m2, 6, -8, -8, 12, 0,0,90],
|
||||
['b1x3x1', m2, 6, 0, -8, 12, 0,0,0],
|
||||
['b1x2x1', m2, 6, 0,-16, 12, 0,0,0],
|
||||
['b1x2x1', m2, 6, 4,-12, 12, 0,0,0],
|
||||
['b1x4x1', m2, 6, 8,-16, 12, 0,0,0],
|
||||
['b1x4x1', m2, 6, 12,-12, 12, 0,0,0],
|
||||
['b1x2x1', m2, 6, 20, -4, 12, 0,0,90],
|
||||
['b1x2x1', m2, 6, 24, -8, 12, 0,0,90],
|
||||
['b2x4x1', m2, 6, 16, 0, 12, 0,0,0],
|
||||
['b1x2x1', m2, 6, 16, 16, 12, 0,0,0],
|
||||
['b2x2x1', m3, 6, 20, 16, 12, 0,0,0],
|
||||
['b2x4x1', m2, 6, 8, 8, 12, 0,0,0],
|
||||
['b2x4x1', m2, 6, 0, 8, 12, 0,0,0],
|
||||
['b2x6x1', m3, 7, 24, 16, 15, 0,0,90],
|
||||
['b1x2x1', m3, 7, 0, 16, 15, 0,0,0],
|
||||
['b1x4x1', m2, 7, 20, 0, 15, 0,0,0],
|
||||
['b1x4x1', m2, 7, 16, 12, 15, 0,0,90],
|
||||
['b2x4x1', m2, 7, 16, 4, 15, 0,0,90],
|
||||
['b2x4x1', m2, 7, 16, -4, 15, 0,0,90],
|
||||
['b2x4x1', m2, 7, -4, 0, 15, 0,0,0],
|
||||
['b1x4x1', m2, 7, -8, 12, 15, 0,0,90],
|
||||
['b1x4x1', m3, 7,-24, 12, 15, 0,0,90],
|
||||
['b1x3x1', m3, 7,-40, 4, 15, 0,0,0],
|
||||
['l2x2x1', m3, 7,-40, -4, 15, 0,0,0],
|
||||
['b1x4x1', m3, 7,-20, -4, 15, 0,0,90],
|
||||
['l2x2x1', m2, 7,-12, -4, 15, 0,0,180],
|
||||
['l2x2x1', m2, 7, -8, -4, 15, 0,0,-90],
|
||||
['b1x4x1', m2, 7, 0,-16, 15, 0,0,0],
|
||||
['b1x2x1', m2, 7, 4,-12, 15, 0,0,0],
|
||||
['b1x2x1', m2, 7, 8,-16, 15, 0,0,0],
|
||||
['b1x2x1', m2, 7, 12,-12, 15, 0,0,0],
|
||||
['b1x1x1', m3, 8, 24, 16, 18, 0,0,0],
|
||||
['c1x1x1', m4, 8, 24, 20, 18, 0,0,0],
|
||||
['b2x2x1', m3, 8, 16, 16, 18, 0,0,0],
|
||||
['c1x1x1', m4, 8, 12, 20, 18, 0,0,0],
|
||||
['c1x1x1', m4, 8, 12, 16, 18, 0,0,0],
|
||||
['b1x2x1', m3, 8, 8, 16, 18, 0,0,0],
|
||||
['c1x1x1', m4, 8, 4, 20, 18, 0,0,0],
|
||||
['c1x1x1', m4, 8, 4, 16, 18, 0,0,0],
|
||||
['b1x2x1', m3, 8, 0, 16, 18, 0,0,0],
|
||||
['b1x2x1', m3, 8, -4, 12, 18, 0,0,90],
|
||||
['b1x4x1', m3, 8,-12, 12, 18, 0,0,90],
|
||||
['b1x4x1', m3, 8,-28, 12, 18, 0,0,90],
|
||||
['b1x4x1', m3, 8,-40, -4, 18, 0,0,0],
|
||||
['b1x4x1', m3, 8,-24, -4, 18, 0,0,90],
|
||||
['b1x2x1', m3, 8,-16, -4, 18, 0,0,90],
|
||||
['b2x2x1', m3, 8,-12, -8, 18, 0,0,0],
|
||||
['b1x4x1', m3, 8, -4, -4, 18, 0,0,0],
|
||||
['b2x4x1', m3, 8, 12,-12, 18, 0,0,90],
|
||||
['b1x1x1', m3, 8, 0,-16, 18, 0,0,0],
|
||||
['b1x1x1', m3, 8, 8,-16, 18, 0,0,0],
|
||||
['b2x2x1', m3, 9, 20, 16, 21, 0,0,0],
|
||||
['b1x2x1', m5, 9, 16, 16, 21, 0,0,0],
|
||||
['b2x2x1', m3, 9, 8, 16, 21, 0,0,0],
|
||||
['b2x2x1', m5, 9, 0, 16, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9, -4, 12, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9, -8, 12, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9,-12, 12, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9,-16, 12, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9,-20, 12, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9,-24, 12, 21, 0,0,0],
|
||||
['b1x2x1', m3, 9,-28, 12, 21, 0,0,90],
|
||||
['c1x1x1', m4, 9,-36, 12, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9,-40, 12, 21, 0,0,0],
|
||||
['b2x3x1', m3, 9,-44, 0, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9,-40, -4, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9,-36, -4, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9,-32, -4, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9,-28, -4, 21, 0,0,0],
|
||||
['b1x2x1', m3, 9,-20, -4, 21, 0,0,90],
|
||||
['c1x1x1', m4, 9,-16, -4, 21, 0,0,0],
|
||||
['b1x2x1', m3, 9,-12, -8, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9, -8, -8, 21, 0,0,0],
|
||||
['b1x2x1', m3, 9, -4, -4, 21, 0,0,90],
|
||||
['c1x1x1', m4, 9, -4, 0, 21, 0,0,0],
|
||||
['b1x1x1', m3, 9, -4, 4, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9, -4, 8, 21, 0,0,0],
|
||||
['b2x4x1', m3, 9, 12,-12, 21, 0,0,90],
|
||||
['c1x1x1', m4, 9, 0,-16, 21, 0,0,0],
|
||||
['c1x1x1', m4, 9, 8,-16, 21, 0,0,0],
|
||||
['c1x1x1', m4, 10, 24, 20, 24, 0,0,0],
|
||||
['l2x2x1', m3, 10, 20, 16, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10, 12, 20, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10, 8, 20, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10, 8, 16, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10, 12, 16, 24, 0,0,0],
|
||||
['b1x4x1', m3, 10, -4, 0, 24, 0,0,0],
|
||||
['b1x4x1', m3, 10, -8, 12, 24, 0,0,90],
|
||||
['b1x4x1', m3, 10,-24, 12, 24, 0,0,90],
|
||||
['b1x4x1', m3, 10,-40, 0, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10,-44, 8, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10,-44, 4, 24, 0,0,0],
|
||||
['c1x1x1', m4, 10,-44, 0, 24, 0,0,0],
|
||||
['b1x2x1', m3, 10,-36, -4, 24, 0,0,90],
|
||||
['b1x4x1', m3, 10,-20, -4, 24, 0,0,90],
|
||||
['b1x4x1', m3, 10, -4, -4, 24, 0,0,90],
|
||||
['b1x2x1', m3, 10, -8, -8, 24, 0,0,90],
|
||||
['l2x2x1', m3, 10, 4, -8, 24, 0,0,180],
|
||||
['b1x2x1', m5, 10, 0,-16, 24, 0,0,0],
|
||||
['l2x2x1', m3, 10, 12, -8, 24, 0,0,180],
|
||||
['b1x2x1', m5, 10, 8,-16, 24, 0,0,0],
|
||||
['b2x2x1', m3, 11, 24, 16, 27, 0,0,90],
|
||||
['b2x2x1', m5, 11, 8, 16, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11, -4, 12, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11, -8, 12, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11,-12, 12, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11,-16, 12, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11,-20, 12, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11,-24, 12, 27, 0,0,0],
|
||||
['b1x2x1', m3, 11,-28, 12, 27, 0,0,90],
|
||||
['c1x1x1', m4, 11,-36, 12, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11,-40, 12, 27, 0,0,0],
|
||||
['b2x3x1', m3, 11,-44, 0, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11,-40, -4, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11,-36, -4, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11,-32, -4, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11,-28, -4, 27, 0,0,0],
|
||||
['b1x2x1', m3, 11,-20, -4, 27, 0,0,90],
|
||||
['c1x1x1', m4, 11,-16, -4, 27, 0,0,0],
|
||||
['b1x2x1', m3, 11,-12, -8, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11, -8, -8, 27, 0,0,0],
|
||||
['b1x2x1', m3, 11, -4, -4, 27, 0,0,90],
|
||||
['c1x1x1', m4, 11, -4, 0, 27, 0,0,0],
|
||||
['b1x1x1', m3, 11, -4, 4, 27, 0,0,0],
|
||||
['c1x1x1', m4, 11, -4, 8, 27, 0,0,0],
|
||||
['b1x2x1', m5, 11, 0,-12, 27, 0,0,0],
|
||||
['c1x1x1', m5, 11, 0,-16, 27, 0,0,0],
|
||||
['f1x2x1', m5, 11, 4,-12, 27, 0,0,0],
|
||||
['f1x2x1', m5, 11, 8,-12, 27, 0,0,0],
|
||||
['c1x1x1', m5, 11, 8,-16, 27, 0,0,0],
|
||||
['b1x2x1', m5, 11, 12,-12, 27, 0,0,0],
|
||||
['b2x2x1', m3, 12, 20, 16, 30, 0,0,0],
|
||||
['b1x4x1', m3, 12, -4, 0, 30, 0,0,0],
|
||||
['b1x4x1', m3, 12, -8, 12, 30, 0,0,90],
|
||||
['b1x4x1', m3, 12,-24, 12, 30, 0,0,90],
|
||||
['b1x4x1', m3, 12,-40, 0, 30, 0,0,0],
|
||||
['c1x1x1', m4, 12,-44, 8, 30, 0,0,0],
|
||||
['c1x1x1', m4, 12,-44, 4, 30, 0,0,0],
|
||||
['c1x1x1', m4, 12,-44, 0, 30, 0,0,0],
|
||||
['b1x2x1', m3, 12,-36, -4, 30, 0,0,90],
|
||||
['b1x4x1', m3, 12,-20, -4, 30, 0,0,90],
|
||||
['b1x4x1', m3, 12, -4, -4, 30, 0,0,90],
|
||||
['b1x2x1', m3, 12, -8, -8, 30, 0,0,90],
|
||||
['b1x2x1', m5, 12, 8,-10, 30, 0,0,90],
|
||||
['b2x2x1', m3, 13, -4, 12, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13, -8, 12, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13,-12, 12, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13,-16, 12, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13,-20, 12, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13,-24, 12, 33, 0,0,0],
|
||||
['b1x2x1', m3, 13,-28, 12, 33, 0,0,90],
|
||||
['c1x1x1', m4, 13,-36, 12, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13,-40, 12, 33, 0,0,0],
|
||||
['b2x3x1', m3, 13,-44, 0, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13,-40, -4, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13,-36, -4, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13,-32, -4, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13,-28, -4, 33, 0,0,0],
|
||||
['b1x2x1', m3, 13,-20, -4, 33, 0,0,90],
|
||||
['c1x1x1', m4, 13,-16, -4, 33, 0,0,0],
|
||||
['b1x2x1', m3, 13,-12, -8, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13, -8, -8, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13, -8, -4, 33, 0,0,90],
|
||||
['c1x1x1', m4, 13, -4, 0, 33, 0,0,0],
|
||||
['b1x1x1', m3, 13, -4, 4, 33, 0,0,0],
|
||||
['c1x1x1', m4, 13, -4, 8, 33, 0,0,0],
|
||||
['b2x2x1', m3, 13, -4, -8, 33, 0,0,0],
|
||||
['b2x4x1', m3, 13, 28, 16, 33, 0,0,90],
|
||||
['b1x2x1', m3, 14, 24, 12, 33, 0,0,90],
|
||||
['b1x2x1', m3, 14, 24, 24, 33, 0,0,90],
|
||||
['b2x4x1', m6, 14, 20, 12, 36, 0,0,0],
|
||||
['b1x2x1', m6, 14, 28, 16, 36, 0,0,0],
|
||||
['b1x2x1', m6, 14, 16, 16, 36, 0,0,0],
|
||||
['c1x1x1', m4, 14, 0, 16, 36, 0,0,0],
|
||||
['b1x1x1', m3, 14, -4, 16, 36, 0,0,0],
|
||||
['b1x1x1', m3, 14, 0, 12, 36, 0,0,0],
|
||||
['b1x4x1', m3, 14, -8, 12, 36, 0,0,90],
|
||||
['b1x4x1', m3, 14,-24, 12, 36, 0,0,90],
|
||||
['b1x4x1', m3, 14,-40, 0, 36, 0,0,0],
|
||||
['b1x2x1', m3, 14,-36, -4, 36, 0,0,90],
|
||||
['b1x4x1', m3, 14,-20, -4, 36, 0,0,90],
|
||||
['b1x4x1', m3, 14, -4, -4, 36, 0,0,90],
|
||||
['b1x4x1', m3, 14, -4, 0, 36, 0,0,0],
|
||||
['b1x1x1', m3, 14, 0, -4, 36, 0,0,0],
|
||||
['c1x1x1', m4, 14, 0, -8, 36, 0,0,0],
|
||||
['b1x1x1', m3, 14, -4, -8, 36, 0,0,0],
|
||||
['b1x2x1', m6, 14, -8, -8, 36, 0,0,90],
|
||||
['b2x2x1', m3, 15, -4, 12, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15, -8, 12, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-12, 12, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-16, 12, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-20, 12, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-24, 12, 39, 0,0,0],
|
||||
['b1x2x1', m3, 15,-28, 12, 39, 0,0,90],
|
||||
['c1x1x1', m4, 15,-36, 12, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-40, 12, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-40, 4, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-40, -4, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-36, -4, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-32, -4, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-28, -4, 39, 0,0,0],
|
||||
['b1x2x1', m3, 15,-20, -4, 39, 0,0,90],
|
||||
['c1x1x1', m4, 15,-16, -4, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15,-12, -4, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-40, 8, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15, -4, 0, 39, 0,0,0],
|
||||
['b1x1x1', m3, 15, -4, 4, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15, -4, 8, 39, 0,0,0],
|
||||
['b2x2x1', m3, 15, -4, -8, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15,-40, 0, 39, 0,0,0],
|
||||
['c1x1x1', m4, 15, -8, -4, 39, 0,0,0],
|
||||
['c1x1x1', m4, 16, 0, 16, 42, 0,0,0],
|
||||
['b1x1x1', m3, 16, -4, 16, 42, 0,0,0],
|
||||
['b1x1x1', m3, 16, 0, 12, 42, 0,0,0],
|
||||
['b1x4x1', m3, 16, -8, 12, 42, 0,0,90],
|
||||
['b1x4x1', m3, 16,-24, 12, 42, 0,0,90],
|
||||
['b1x4x1', m3, 16,-40, 0, 42, 0,0,0],
|
||||
['b1x2x1', m3, 16,-36, -4, 42, 0,0,90],
|
||||
['b1x4x1', m3, 16,-20, -4, 42, 0,0,90],
|
||||
['b1x4x1', m3, 16, -4, -4, 42, 0,0,90],
|
||||
['b1x4x1', m3, 16, -4, 0, 42, 0,0,0],
|
||||
['b1x1x1', m3, 16, 0, -4, 42, 0,0,0],
|
||||
['c1x1x1', m4, 16, 0, -8, 42, 0,0,0],
|
||||
['b1x1x1', m3, 16, -4, -8, 42, 0,0,0],
|
||||
['b2x2x1', m3, 17, -4, 12, 45, 0,0,0],
|
||||
['b2x3x1', m6, 17, -8, 12, 45, 0,0,90],
|
||||
['b2x2x1', m6, 17,-24, 12, 45, 0,0,0],
|
||||
['b1x2x1', m6, 17,-28, 12, 45, 0,0,90],
|
||||
['b2x2x1', m6, 17,-40, 12, 45, 0,0,0],
|
||||
['b1x1x1', m3, 17,-40, 8, 45, 0,0,0],
|
||||
['c1x1x1', m4, 17,-40, 4, 45, 0,0,0],
|
||||
['b1x1x1', m3, 17,-40, 0, 45, 0,0,0],
|
||||
['b2x4x1', m6, 17,-28, -8, 45, 0,0,90],
|
||||
['b1x2x1', m6, 17,-20, -4, 45, 0,0,90],
|
||||
['b2x3x1', m6, 17, -8, -8, 45, 0,0,90],
|
||||
['b2x2x1', m3, 17, -4, -8, 45, 0,0,0],
|
||||
['b1x1x1', m3, 17, -4, 0, 45, 0,0,0],
|
||||
['c1x1x1', m4, 17, -4, 4, 45, 0,0,0],
|
||||
['b1x1x1', m3, 17, -4, 8, 45, 0,0,0],
|
||||
['c1x1x1', m3, 18,-24, -8, 15, 0,0,0],
|
||||
['c1x1x1', m3, 18,-20, -8, 15, 0,0,0],
|
||||
['c1x1x1', m3, 18,-32, 16, 15, 0,0,0],
|
||||
['c1x1x1', m3, 18,-28, 16, 15, 0,0,0],
|
||||
['c1x1x1', m3, 18,-24, -8, 18, 0,0,0],
|
||||
['c1x1x1', m3, 18,-20, -8, 18, 0,0,0],
|
||||
['c1x1x1', m3, 18,-32, 16, 18, 0,0,0],
|
||||
['c1x1x1', m3, 18,-28, 16, 18, 0,0,0],
|
||||
['c1x1x1', m3, 18,-24, -8, 21, 0,0,0],
|
||||
['c1x1x1', m3, 18,-20, -8, 21, 0,0,0],
|
||||
['c1x1x1', m3, 18,-32, 16, 21, 0,0,0],
|
||||
['c1x1x1', m3, 18,-28, 16, 21, 0,0,0],
|
||||
['c1x1x1', m4, 19,-24, -8, 24, 0,0,0],
|
||||
['c1x1x1', m4, 19,-20, -8, 24, 0,0,0],
|
||||
['c1x1x1', m4, 19,-32, 16, 24, 0,0,0],
|
||||
['c1x1x1', m4, 19,-28, 16, 24, 0,0,0],
|
||||
['c1x1x1', m3, 19,-24, -8, 27, 0,0,0],
|
||||
['c1x1x1', m3, 19,-20, -8, 27, 0,0,0],
|
||||
['c1x1x1', m3, 19,-32, 16, 27, 0,0,0],
|
||||
['c1x1x1', m3, 19,-28, 16, 27, 0,0,0],
|
||||
['c1x1x1', m3, 19,-24, -8, 30, 0,0,0],
|
||||
['c1x1x1', m3, 19,-20, -8, 30, 0,0,0],
|
||||
['c1x1x1', m3, 19,-32, 16, 30, 0,0,0],
|
||||
['c1x1x1', m3, 19,-28, 16, 30, 0,0,0],
|
||||
['c1x1x1', m4, 20,-24, -8, 33, 0,0,0],
|
||||
['c1x1x1', m4, 20,-20, -8, 33, 0,0,0],
|
||||
['c1x1x1', m4, 20,-32, 16, 33, 0,0,0],
|
||||
['c1x1x1', m4, 20,-28, 16, 33, 0,0,0],
|
||||
['c1x1x1', m3, 20,-24, -8, 36, 0,0,0],
|
||||
['c1x1x1', m3, 20,-20, -8, 36, 0,0,0],
|
||||
['c1x1x1', m3, 20,-32, 16, 36, 0,0,0],
|
||||
['c1x1x1', m3, 20,-28, 16, 36, 0,0,0],
|
||||
['c1x1x1', m3, 20,-24, -8, 39, 0,0,0],
|
||||
['c1x1x1', m3, 20,-20, -8, 39, 0,0,0],
|
||||
['c1x1x1', m3, 20,-32, 16, 39, 0,0,0],
|
||||
['c1x1x1', m3, 20,-28, 16, 39, 0,0,0],
|
||||
['c1x1x1', m4, 21,-24, -8, 42, 0,0,0],
|
||||
['c1x1x1', m4, 21,-20, -8, 42, 0,0,0],
|
||||
['c1x1x1', m4, 21,-32, 16, 42, 0,0,0],
|
||||
['c1x1x1', m4, 21,-28, 16, 42, 0,0,0],
|
||||
['c1x1x1', m3, 21,-24, -8, 45, 0,0,0],
|
||||
['c1x1x1', m3, 21,-20, -8, 45, 0,0,0],
|
||||
['c1x1x1', m3, 21,-32, 16, 45, 0,0,0],
|
||||
['c1x1x1', m3, 21,-28, 16, 45, 0,0,0],
|
||||
['c1x1x1', m3, 21,-24, -8, 48, 0,0,0],
|
||||
['c1x1x1', m3, 21,-20, -8, 48, 0,0,0],
|
||||
['c1x1x1', m3, 21,-32, 16, 48, 0,0,0],
|
||||
['c1x1x1', m3, 21,-28, 16, 48, 0,0,0],
|
||||
['c1x1x1', m3, 22, 20, 16, 39, 0,0,0],
|
||||
['c1x1x1', m3, 22, 24, 16, 39, 0,0,0],
|
||||
['c1x1x1', m3, 22, 24, 20, 39, 0,0,0],
|
||||
['c1x1x1', m3, 22, 20, 20, 39, 0,0,0],
|
||||
['b2x2x1', m3, 22, 20, 16, 42, 0,0,0],
|
||||
['f1x2x1', m6, 22, 20, 16, 45, 0,0,0],
|
||||
['f1x2x1', m6, 22, 24, 16, 45, 0,0,0],
|
||||
['f1x2x1', m6, 23, 24, 18, 48, 0,0,90],
|
||||
['c1x1x1', m6, 23, 0, 16, 48, 0,0,0],
|
||||
['b1x3x1', m6, 23, -4, 12, 48, 0,0,90],
|
||||
['b1x1x1', m3, 23, -8, 16, 48, 0,0,0],
|
||||
['b2x4x1', m6, 23,-16, 8, 48, 0,0,90],
|
||||
['b1x3x1', m6, 23,-32, 12, 48, 0,0,90],
|
||||
['b1x1x1', m3, 23,-40, 16, 48, 0,0,0],
|
||||
['b1x3x1', m3, 23,-40, 0, 48, 0,0,0],
|
||||
['b1x3x1', m6, 23,-32, -4, 48, 0,0,90],
|
||||
['b1x1x1', m3, 23,-40, -8, 48, 0,0,0],
|
||||
['b2x4x1', m6, 23,-16, -4, 48, 0,0,90],
|
||||
['b1x3x1', m6, 23, -4, -4, 48, 0,0,90],
|
||||
['b1x1x1', m3, 23, -8, -8, 48, 0,0,0],
|
||||
['c1x1x1', m6, 23, 0, -8, 48, 0,0,0],
|
||||
['b1x3x1', m3, 23, -4, 0, 48, 0,0,0],
|
||||
['c1x1x1', m6, 24, 22, 18, 51, 0,0,0],
|
||||
['c1x1x1', m6, 24, 0, 16, 51, 0,0,90],
|
||||
['c1x1x1', m6, 24, -8, 16, 51, 0,0,0],
|
||||
['b2x6x1', m6, 24, -4, 8, 51, 0,0,90],
|
||||
['b1x2x1', m6, 24,-28, 8, 51, 0,0,90],
|
||||
['b2x2x1', m3, 24,-32, 12, 51, 0,0,0],
|
||||
['b2x2x1', m6, 24,-40, 8, 51, 0,0,0],
|
||||
['c1x1x1', m6, 24,-40, 16, 51, 0,0,0],
|
||||
['b1x1x1', m3, 24,-40, 4, 51, 0,0,0],
|
||||
['b2x4x1', m6, 24,-28, -4, 51, 0,0,90],
|
||||
['c1x1x1', m6, 24,-40, -8, 51, 0,0,0],
|
||||
['b1x2x1', m6, 24,-20, 0, 51, 0,0,90],
|
||||
['b2x2x1', m3, 24,-24, -8, 51, 0,0,0],
|
||||
['b2x4x1', m6, 24, -4, -4, 51, 0,0,90],
|
||||
['c1x1x1', m6, 24, -8, -8, 51, 0,0,0],
|
||||
['c1x1x1', m6, 24, 0, -8, 51, 0,0,0],
|
||||
['b1x1x1', m3, 24, -4, 4, 51, 0,0,0],
|
||||
['c1x1x1', m7, 25, 22, 18, 54, 0,0,0],
|
||||
['b1x1x1', m3, 25, -4, 4, 54, 0,0,0],
|
||||
['b1x3x1', m5, 25, -4, 8, 54, 0,0,90],
|
||||
['b1x3x1', m5, 25, -4, 0, 54, 0,0,90],
|
||||
['b2x3x1', m5, 25,-20, 0, 54, 0,0,0],
|
||||
['b2x3x1', m5, 25,-28, 0, 54, 0,0,0],
|
||||
['b1x3x1', m5, 25,-32, 8, 54, 0,0,90],
|
||||
['b1x1x1', m3, 25,-40, 4, 54, 0,0,0],
|
||||
['b1x3x1', m5, 25,-32, 0, 54, 0,0,90],
|
||||
['c1x1x1', m3, 25,-32, 12, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-28, 12, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-28, 16, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-32, 16, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-24, -4, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-20, -4, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-20, -8, 54, 0,0,0],
|
||||
['c1x1x1', m3, 25,-24, -8, 54, 0,0,0],
|
||||
['c1x1x1', m3, 26,-32, 12, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-28, 12, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-28, 16, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-32, 16, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-24, -4, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-20, -4, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-20, -8, 57, 0,0,0],
|
||||
['c1x1x1', m3, 26,-24, -8, 57, 0,0,0],
|
||||
['f1x2x1', m6, 27,-20, -8, 60, 0,0,90],
|
||||
['f1x2x1', m6, 27,-20, -4, 60, 0,0,90],
|
||||
['f1x2x1', m6, 27,-22, -8, 63, 0,0,0],
|
||||
['c1x1x1', m6, 27,-22, -6, 66, 0,0,0],
|
||||
['c1x1x1', m7, 27,-22, -6, 69, 0,0,0],
|
||||
['b2x2x1', m3, 28,-32, 12, 60, 0,0,0],
|
||||
['b2x2x1', m5, 28,-32, 12, 63, 0,0,0],
|
||||
['c1x1x1', m3, 28,-32, 12, 66, 0,0,0],
|
||||
['c1x1x1', m3, 28,-28, 12, 66, 0,0,0],
|
||||
['c1x1x1', m3, 28,-28, 16, 66, 0,0,0],
|
||||
['c1x1x1', m3, 28,-32, 16, 66, 0,0,0],
|
||||
['b2x2x1', m3, 28,-32, 12, 69, 0,0,0],
|
||||
['f1x2x1', m5, 29,-28, 12, 72, 0,0,90],
|
||||
['f1x2x1', m5, 29,-28, 16, 72, 0,0,90],
|
||||
['f1x2x1', m5, 29,-30, 12, 75, 0,0,0],
|
||||
['c1x1x1', m5, 29,-30, 12, 78, 0,0,0],
|
||||
['c1x1x1', m5, 29,-30, 12, 81, 0,0,0],
|
||||
['c1x1x1', m7, 29,-30, 12, 84, 0,0,0],
|
||||
['b2x3x1', m5, 30, -8, 0, 57, 0,0,0],
|
||||
['b2x3x1', m5, 30,-16, 0, 57, 0,0,0],
|
||||
['b2x3x1', m5, 30,-24, 0, 57, 0,0,0],
|
||||
['b2x3x1', m5, 30,-32, 0, 57, 0,0,0],
|
||||
['b2x3x1', m5, 30,-40, 0, 57, 0,0,0],
|
||||
['b1x4x1', m5, 30, -4, 4, 60, 0,0,90],
|
||||
['b1x2x1', m5, 30,-20, 4, 60, 0,0,90],
|
||||
['b1x4x1', m5, 30,-28, 4, 60, 0,0,90],
|
||||
['b1x3x1', m5, 31, -4, 4, 63, 0,0,90],
|
||||
['b1x4x1', m5, 31,-16, 4, 63, 0,0,90],
|
||||
['b1x3x1', m5, 31,-32, 4, 63, 0,0,90],
|
||||
['c1x1x1', m7, 31, -4, 4, 66, 0,0,0],
|
||||
['c1x1x1', m7, 31,-40, 4, 66, 0,0,0],
|
||||
['c1x1x1', m8, 32,-32,-36, 3, 0,0,0],
|
||||
['b1x2x1', m9, 32, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 32, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 32, 0, 0, 9, 0,0,45, 1],
|
||||
['c1x1x1', m9, 32, 0, 0, 12, 0,0,0, 1],
|
||||
['c1x1x1', m8, 33,-12,-24, 3, 0,0,0],
|
||||
['b1x2x1', m9, 33, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 33, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 33, 0, 0, 9, 0,0,45, 1],
|
||||
['b1x2x1', m9, 33, 0, 0, 12, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 33, 0, 0, 15, 0,0,45, 1],
|
||||
['c1x1x1', m9, 33, 0, 0, 18, 0,0,0, 1],
|
||||
['c1x1x1', m8, 34, 16,-36, 3, 0,0,0],
|
||||
['b1x2x1', m9, 34, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 34, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 34, 0, 0, 9, 0,0,45, 1],
|
||||
['c1x1x1', m9, 34, 0, 0, 12, 0,0,0, 1],
|
||||
['c1x1x1', m8, 35, 32,-24, 3, 0,0,0],
|
||||
['b1x2x1', m9, 35, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 35, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 35, 0, 0, 9, 0,0,45, 1],
|
||||
['b1x2x1', m9, 35, 0, 0, 12, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 35, 0, 0, 15, 0,0,45, 1],
|
||||
['c1x1x1', m9, 35, 0, 0, 18, 0,0,0, 1],
|
||||
['c1x1x1', m8, 36,-20, 28, 3, 0,0,0],
|
||||
['b1x2x1', m9, 36, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 36, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 36, 0, 0, 9, 0,0,45, 1],
|
||||
['b1x2x1', m9, 36, 0, 0, 12, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 36, 0, 0, 15, 0,0,45, 1],
|
||||
['c1x1x1', m9, 36, 0, 0, 18, 0,0,0, 1],
|
||||
['c1x1x1', m8, 37, 16, 32, 3, 0,0,0],
|
||||
['b1x2x1', m9, 37, 0, 0, 3, 0,0,45, 1],
|
||||
['b1x2x1', m9, 37, 0, 0, 6, 0,0,-45, 1],
|
||||
['b1x2x1', m9, 37, 0, 0, 9, 0,0,45, 1],
|
||||
['c1x1x1', m9, 37, 0, 0, 12, 0,0,0, 1],
|
||||
['c1x1x1', m3, 38, 36, -4, 3, 0,0,0],
|
||||
['b1x2x1', m10, 38, 36, 0, 3, 0,0,90],
|
||||
['b1x2x1', m10, 38, 36, 12, 3, 0,0,90],
|
||||
['c1x1x1', m3, 38, 36, 16, 3, 0,0,0],
|
||||
['c1x1x1', m3, 39, 36, -4, 6, 0,0,0],
|
||||
['b1x2x1', m10, 39, 36, 0, 6, 0,0,90],
|
||||
['b1x2x1', m10, 39, 36, 12, 6, 0,0,90],
|
||||
['c1x1x1', m3, 39, 36, 16, 6, 0,0,0],
|
||||
['c1x1x1', m3, 40, 36, -4, 9, 0,0,0],
|
||||
['b1x2x1', m10, 40, 36, 0, 9, 0,0,90],
|
||||
['b1x2x1', m10, 40, 36, 12, 9, 0,0,90],
|
||||
['c1x1x1', m3, 40, 36, 16, 9, 0,0,0],
|
||||
['c1x1x1', m3, 41, 36, -4, 12, 0,0,0],
|
||||
['b1x2x1', m10, 41, 36, 0, 12, 0,0,90],
|
||||
['b1x2x1', m10, 41, 36, 12, 12, 0,0,90],
|
||||
['c1x1x1', m3, 41, 36, 16, 12, 0,0,0],
|
||||
['b2x2x1', m3, 41, 32, 4, 12, 0,0,0],
|
||||
['c1x1x1', m3, 42, 36, -4, 15, 0,0,0],
|
||||
['b2x4x1', m10, 42, 32, 0, 15, 0,0,0],
|
||||
['c1x1x1', m3, 42, 36, 16, 15, 0,0,0],
|
||||
['b1x1x1', m3, 43, 36, -4, 18, 0,0,0],
|
||||
['b1x2x1', m6, 43, 36, 0, 18, 0,0,90],
|
||||
['b1x2x1', m6, 43, 36, 12, 18, 0,0,90],
|
||||
['b1x1x1', m3, 43, 36, 16, 18, 0,0,0],
|
||||
['b2x2x1', m10, 43, 32, 4, 18, 0,0,0],
|
||||
['c1x1x1', m6, 44, 36, -4, 21, 0,0,0],
|
||||
['c1x1x1', m6, 44, 36, 16, 21, 0,0,0],
|
||||
['f1x2x1', m6, 44, 36, 4, 21, 0,0,0],
|
||||
['f1x2x1', m6, 44, 32, 4, 21, 0,0,0],
|
||||
['f1x2x1', m6, 44, 36, 6, 24, 0,0,90],
|
||||
];
|
@@ -692,6 +692,15 @@ struct TinyGLContext
|
||||
long int dx, dy, x, y;
|
||||
};
|
||||
|
||||
struct GLUquadricObj
|
||||
{
|
||||
GLenum DrawStyle; // GLU_FILL, LINE, SILHOUETTE, or POINT
|
||||
GLenum Orientation; // GLU_INSIDE or GLU_OUTSIDE
|
||||
GLboolean TextureFlag; // Generate texture coords?
|
||||
GLenum Normals; // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
|
||||
void (__stdcall* ErrorFunc)(GLenum err); // Error handler callback function
|
||||
};
|
||||
|
||||
//
|
||||
// tinygl - import table
|
||||
//
|
||||
@@ -748,7 +757,7 @@ void (__stdcall* glEdgeFlag)(int flag) = (void (__stdcall*)(int))&"glEdgeFlag";
|
||||
void (__stdcall* glMatrixMode)(int mode) = (void (__stdcall*)(int))&"glMatrixMode";
|
||||
void (__stdcall* glLoadMatrixf)(const float* m) = (void (__stdcall*)(const float*))&"glLoadMatrixf";
|
||||
void (__stdcall* glLoadIdentity)() = (void (__stdcall*)())&"glLoadIdentity";
|
||||
//void (__stdcall* glMultMatrixf)(...) = (void (__stdcall*)(...))&"glMultMatrixf";
|
||||
void (__stdcall* glMultMatrixf)(const GLfloat *m) = (void (__stdcall*)(const GLfloat*))&"glMultMatrixf";
|
||||
void (__stdcall* glPushMatrix)() = (void (__stdcall*)())&"glPushMatrix";
|
||||
void (__stdcall* glPopMatrix)() = (void (__stdcall*)())&"glPopMatrix";
|
||||
void (__stdcall* glRotatef)(float angle, float x, float y, float z) = (void (__stdcall*)(float, float, float, float))&"glRotatef";
|
||||
@@ -763,7 +772,7 @@ void (__stdcall* glEndList)() = (void (__stdcall*)())&"glEndList";
|
||||
void (__stdcall* glCallList)(unsigned int list) = (void (__stdcall*)(unsigned int))&"glCallList";
|
||||
void (__stdcall* glClear)(int mask) = (void (__stdcall*)(int))&"glClear";
|
||||
void (__stdcall* glClearColor)(float r, float g, float b, float a) = (void (__stdcall*)(float, float, float, float))&"glClearColor";
|
||||
//void (__stdcall* glClearDepth)(...) = (void (__stdcall*)(...))&"glClearDepth";
|
||||
void (__stdcall* glClearDepth)(double depth) = (void (__stdcall*)(double))&"glClearDepth";
|
||||
void (__stdcall* glRenderMode)(int mode) = (void (__stdcall*)(int))&"glRenderMode";
|
||||
//void (__stdcall* glSelectBuffer)(...) = (void (__stdcall*)(...))&"glSelectBuffer";
|
||||
//void (__stdcall* glInitNames)(...) = (void (__stdcall*)(...))&"glInitNames";
|
||||
@@ -799,18 +808,22 @@ void (__stdcall* glColorPointer)(GLint size, GLenum type, GLsizei stride, const
|
||||
void (__stdcall* glNormalPointer)(GLenum type, GLsizei stride, const GLvoid* pointer) = (void (__stdcall*)(GLenum, GLsizei, const GLvoid*))&"glNormalPointer";
|
||||
void (__stdcall* glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) = (void (__stdcall*)(GLint, GLenum, GLsizei, const GLvoid*))&"glTexCoordPointer";
|
||||
//void (__stdcall* glPolygonOffset)(...) = (void (__stdcall*)(...))&"glPolygonOffset";
|
||||
//void (__stdcall* glOrtho)(...) = (void (__stdcall*)(...))&"glOrtho";
|
||||
void (__stdcall* glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) = (void (__stdcall*)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble))&"glOrtho";
|
||||
//void (__stdcall* glDebug)(...) = (void (__stdcall*)(...))&"glDebug";
|
||||
//void (__stdcall* glInit)(...) = (void (__stdcall*)(...))&"glInit";
|
||||
//void (__stdcall* glClose)(...) = (void (__stdcall*)(...))&"glClose";
|
||||
//void (__stdcall* gluPerspective)(...) = (void (__stdcall*)(...))&"gluPerspective";
|
||||
//void (__stdcall* gluNewQuadric)(...) = (void (__stdcall*)(...))&"gluNewQuadric";
|
||||
//void (__stdcall* gluDeleteQuadric)(...) = (void (__stdcall*)(...))&"gluDeleteQuadric";
|
||||
//void (__stdcall* gluQuadricDrawStyle)(...) = (void (__stdcall*)(...))&"gluQuadricDrawStyle";
|
||||
//void (__stdcall* gluQuadricOrientation)(...) = (void (__stdcall*)(...))&"gluQuadricOrientation";
|
||||
//void (__stdcall* gluQuadricTexture)(...) = (void (__stdcall*)(...))&"gluQuadricTexture";
|
||||
//void (__stdcall* gluCylinder)(...) = (void (__stdcall*)(...))&"gluCylinder";
|
||||
//void (__stdcall* gluSphere)(...) = (void (__stdcall*)(...))&"gluSphere";
|
||||
void (__stdcall* gluPerspective)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) = (void (__stdcall*)(GLdouble, GLdouble, GLdouble, GLdouble))&"gluPerspective";
|
||||
GLUquadricObj* (__stdcall* gluNewQuadric)() = (GLUquadricObj* (__stdcall*)())&"gluNewQuadric";
|
||||
void (__stdcall* gluDeleteQuadric)(GLUquadricObj *state) = (void (__stdcall*)(GLUquadricObj*))&"gluDeleteQuadric";
|
||||
void (__stdcall* gluQuadricDrawStyle)(GLUquadricObj *quadObject, GLenum drawStyle) = (void (__stdcall*)(GLUquadricObj*, GLenum))&"gluQuadricDrawStyle";
|
||||
void (__stdcall* gluQuadricOrientation)(GLUquadricObj *quadObject, GLenum orientation) = (void (__stdcall*)(GLUquadricObj*, GLenum))&"gluQuadricOrientation";
|
||||
void (__stdcall* gluQuadricTexture)(GLUquadricObj *quadObject, GLboolean textureCoords) = (void (__stdcall*)(GLUquadricObj*, GLboolean))&"gluQuadricTexture";
|
||||
void (__stdcall* gluCylinder)(GLUquadricObj *qobj,
|
||||
GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks) = (void (__stdcall*)(GLUquadricObj*, GLdouble, GLdouble, GLdouble, GLint, GLint))&"gluCylinder";
|
||||
void (__stdcall* gluDisk)(GLUquadricObj *qobj,
|
||||
GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) = (void (__stdcall*)(GLUquadricObj*, GLdouble, GLdouble, GLint, GLint))&"gluDisk";
|
||||
void (__stdcall* gluSphere)(GLUquadricObj *qobj,
|
||||
GLdouble radius, GLint slices, GLint stacks) = (void (__stdcall*)(GLUquadricObj*, GLdouble, GLint, GLint))&"gluSphere";
|
||||
void (__stdcall* kosglMakeCurrent)(long l, long t, long w, long h, TinyGLContext*) = (void (__stdcall*)(long, long, long, long, TinyGLContext*))&"kosglMakeCurrent";
|
||||
void (__stdcall* kosglSwapBuffers)() = (void (__stdcall*)())&"kosglSwapBuffers";
|
||||
asm{
|
||||
|
@@ -85,6 +85,7 @@ struct TWebBrowser {
|
||||
void tag_table();
|
||||
void tag_td();
|
||||
void tag_tr();
|
||||
void reset_font_style();
|
||||
};
|
||||
|
||||
#include "TWB\render.h"
|
||||
@@ -94,16 +95,16 @@ void TWebBrowser::SetPageDefaults()
|
||||
{
|
||||
t_html = t_body = link = false;
|
||||
style.reset();
|
||||
reset_font_style();
|
||||
link_color_default = 0x0000FF;
|
||||
link_color_active = 0xFF0000;
|
||||
style.cur_line_h = list.item_h;
|
||||
links.clear();
|
||||
anchors.clear();
|
||||
img_url.drop();
|
||||
text_colors.drop();
|
||||
text_colors.add(0);
|
||||
if (secondrun) {
|
||||
canvas.Init(list.x, list.y, list.w, math.max(list.visible, list.count));
|
||||
canvas.Init(list.x, list.y, list.w, math.max(list.visible, list.count)+200);
|
||||
canvas.Fill(0, bg_colors.get(0));
|
||||
}
|
||||
bg_colors.drop();
|
||||
@@ -114,7 +115,6 @@ void TWebBrowser::SetPageDefaults()
|
||||
draw_w = list.w - BODY_MARGIN - BODY_MARGIN;
|
||||
linebuf = 0;
|
||||
redirect = '\0';
|
||||
list.SetFont(8, 14, 10011000b);
|
||||
tag_table_reset();
|
||||
is_html = true;
|
||||
if (!strstri(bufpointer, "<body")) {
|
||||
|
@@ -49,14 +49,14 @@ void TWebBrowser::RenderLine(dword _line)
|
||||
pc = text_colors.get_last();
|
||||
if (link) && (pc == text_colors.get(0)) pc = link_color_default;
|
||||
|
||||
canvas.WriteText(draw_x, draw_y, list.font_type, pc, _line, NULL);
|
||||
if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, _line, NULL);
|
||||
canvas.WriteText(draw_x, draw_y+1, list.font_type, pc, _line, NULL);
|
||||
if (style.b) canvas.WriteText(draw_x+1, draw_y+1, list.font_type, pc, _line, NULL);
|
||||
if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc);
|
||||
if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc);
|
||||
if (style.u) canvas.DrawBar(draw_x, draw_y + list.font_h, pw, zoom, pc);
|
||||
if (link) {
|
||||
if (ESBYTE[_line]==' ') && (ESBYTE[_line+1]==NULL) {} else {
|
||||
canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default);
|
||||
links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom);
|
||||
canvas.DrawBar(draw_x, draw_y + list.font_h, pw, zoom, link_color_default);
|
||||
links.add_text(draw_x, draw_y + list.y, pw, list.font_h, zoom);
|
||||
}
|
||||
}
|
||||
_SKIP_DRAW:
|
||||
|
@@ -208,9 +208,20 @@ void TWebBrowser::tag_li()
|
||||
void TWebBrowser::tag_hr()
|
||||
{
|
||||
dword hrcol = 0x00777777;
|
||||
if (tag.get_value_of("color")) hrcol = GetColor(tag.value);
|
||||
dword hr_width = draw_w-BODY_MARGIN-BODY_MARGIN;
|
||||
dword hr_size = 1;
|
||||
if (tag.get_value_of("color")) {
|
||||
hrcol = GetColor(tag.value);
|
||||
}
|
||||
if (tag.get_value_of("width")) && (!strchr(tag.value, '%')) {
|
||||
hr_width = math.min(hr_width, tag.get_number_of("width"));
|
||||
}
|
||||
if (tag.get_number_of("size")) {
|
||||
hr_size = math.min(500, tag.number);
|
||||
}
|
||||
if (draw_x != left_gap) NewLine();
|
||||
if (secondrun) canvas.DrawBar(5+left_gap, style.cur_line_h / 2 + draw_y - 1, draw_w-10, 1, hrcol);
|
||||
if (secondrun) canvas.DrawBar(left_gap, style.cur_line_h / 2 + draw_y - 1, hr_width, hr_size, hrcol);
|
||||
draw_y += hr_size - 3;
|
||||
draw_x++;
|
||||
NewLine();
|
||||
return;
|
||||
@@ -235,6 +246,12 @@ void TWebBrowser::tag_q()
|
||||
chrncat(#linebuf, '\"', sizeof(TWebBrowser.linebuf));
|
||||
}
|
||||
|
||||
void TWebBrowser::reset_font_style()
|
||||
{
|
||||
list.SetFont(BASIC_CHAR_W, 14, 10011000b);
|
||||
style.cur_line_h = list.item_h = list.font_h + 5;
|
||||
}
|
||||
|
||||
void TWebBrowser::tag_h1234_caption()
|
||||
{
|
||||
if (ESBYTE[#tag.name+1]=='4') {
|
||||
@@ -250,19 +267,18 @@ void TWebBrowser::tag_h1234_caption()
|
||||
NewLine();
|
||||
}
|
||||
if (tag.is("h1")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+13, 10011001b);
|
||||
style.b = true;
|
||||
} else if (tag.is("h2")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+13, 10011001b);
|
||||
} else {
|
||||
list.SetFont(6*2, 9+7, 10001001b);
|
||||
list.SetFont(6*2, 9+8, 10001001b);
|
||||
}
|
||||
style.cur_line_h = list.item_h = list.font_h + 2;
|
||||
style.cur_line_h = list.item_h = list.font_h + 3;
|
||||
} else {
|
||||
if (tag.is("h1")) style.b = false;
|
||||
NewLine();
|
||||
list.SetFont(BASIC_CHAR_W, 14, 10011000b);
|
||||
style.cur_line_h = list.item_h = BASIC_LINE_H;
|
||||
reset_font_style();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,11 +286,15 @@ void TWebBrowser::tag_h1234_caption()
|
||||
void TWebBrowser::tag_kosicon()
|
||||
{
|
||||
dword imgbuf[44];
|
||||
dword maxicon;
|
||||
dword shared_i18 = memopen("ICONS18", NULL, SHM_READ);
|
||||
maxicon = EDX / 18 / 18 / 4;
|
||||
if (shared_i18) && (tag.get_number_of("n")) {
|
||||
if (draw_x + 18 > canvas.bufw) NewLine();
|
||||
canvas.DrawImage(draw_x, draw_y-2, 18, 18, 18*18*4*tag.number+shared_i18);
|
||||
draw_x += 22;
|
||||
if (tag.number < maxicon) {
|
||||
if (draw_x + 18 > canvas.bufw) NewLine();
|
||||
canvas.DrawImage(draw_x, draw_y-1, 18, 18, 18*18*4*tag.number+shared_i18);
|
||||
draw_x += 22;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -571,10 +571,10 @@ void OpenPage(dword _open_URL)
|
||||
//INTERNAL PAGE
|
||||
history.add(#new_url);
|
||||
WB1.custom_encoding = -1;
|
||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home)-1);
|
||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test)-1);
|
||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home));
|
||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test));
|
||||
else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
|
||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
|
||||
} else if (!strncmp(#new_url,"http:",5)) || (!strncmp(#new_url,"https:",6)) {
|
||||
//WEB PAGE
|
||||
@@ -589,7 +589,7 @@ void OpenPage(dword _open_URL)
|
||||
|
||||
if (!http.transfer) {
|
||||
history.add(#new_url);
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
}
|
||||
} else {
|
||||
//LOCAL PAGE
|
||||
@@ -712,7 +712,7 @@ void EventSubmitOmnibox()
|
||||
|
||||
void LoadInternalPage(dword _bufdata, _in_bufsize){
|
||||
if (!_bufdata) || (!_in_bufsize) {
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
} else {
|
||||
WB1.list.first = 0; //scroll page to the top
|
||||
DrawOmnibox();
|
||||
|
@@ -112,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
||||
|
||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||
|
||||
char version[]="WebView 3.85";
|
||||
char version[]="WebView 3.91";
|
@@ -1,7 +1,7 @@
|
||||
#ifdef LANG_RUS
|
||||
#define HISTORY_HEADER "<html><title><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title><body><b><3E><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></b><br>"
|
||||
#define HISTORY_HEADER "<html><title><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title><body bgcolor=#fff><h3><3E><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></h3><br>"
|
||||
#else
|
||||
#define HISTORY_HEADER "<html><title>History</title><body><b>Visited pages</b><br>"
|
||||
#define HISTORY_HEADER "<html><title>History</title><body bgcolor=#fff><h3>Visited pages</h3><br>"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ ShowHistory()
|
||||
|
||||
for (i=0; i<history.items.count-1; i++) //if (cache.type.get(i) == PAGE)
|
||||
{
|
||||
strcat(history_pointer, "<a href='");
|
||||
strcat(history_pointer, "<kosicon n=3><a href='");
|
||||
strcat(history_pointer, history.items.get(i));
|
||||
strcat(history_pointer, "'>");
|
||||
strcat(history_pointer, history.items.get(i));
|
||||
|
@@ -1,17 +1,49 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Homepage</title>
|
||||
</head>
|
||||
<body><pre>Welcome to WebView a Text-Based Browser.
|
||||
<html><head><title>New tab</title></head>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
KolibriOS Bookmarks:
|
||||
1. <a href=//kolibrios.org>Homepage</a>
|
||||
2. <a href="//builds.kolibrios.org">Night-builds</a>
|
||||
3. <a href="//ftp.kolibrios.org">FTP Server</a>
|
||||
<table><tr><td width=20><td width=220><pre>
|
||||
_____________________
|
||||
|# : : #|
|
||||
| : WebView : |
|
||||
| : for : |
|
||||
| : KolibriOS : |
|
||||
| : : |
|
||||
| :_______________: |
|
||||
| ____________ |
|
||||
| | __ | |
|
||||
| || | | |
|
||||
\_____||__|________|__|<font color=#DDD>lc</font>
|
||||
|
||||
<font bg=#F8F15B>By the way,</font>
|
||||
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatable
|
||||
<font bg=#3CE7FF> </font></font></font></font>
|
||||
<td>
|
||||
|
||||
</pre>
|
||||
<kosicon n=58><a href=//kolibrios.org>Homepage</a>
|
||||
<kosicon n=50><a href="//builds.kolibrios.org">Night-builds</a>
|
||||
<kosicon n=50><a href="//ftp.kolibrios.org">FTP Server</a>
|
||||
<pre>
|
||||
|
||||
By the way,
|
||||
<font color="#555555">• You can check for browser updates from the main menu.
|
||||
• To run a web search, type a text in the adress box and press Ctrl+Enter.
|
||||
• To run a web search, type a text in the adress box and press Ctrl+Enter.
|
||||
• Pressing F6 moves a text cursor to the omnibox.
|
||||
• Click on a label in the bottom right corner to change the encoding of a page.
|
||||
</font>
|
||||
• You can manually change the encoding of a page by clicking on a label in the bottom right corner.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~+
|
||||
|
||||
* +
|
||||
' |
|
||||
() .-.,="``"=. - o -
|
||||
'=/_ \ |
|
||||
* | '=._ |
|
||||
\ `=./`, '
|
||||
. '=.__.=' `=' *
|
||||
+ +
|
||||
O * ' .<font color=#DDD>jgs</font>
|
@@ -1,15 +1,49 @@
|
||||
<html><head><meta charset="cp-866">
|
||||
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></title></head>
|
||||
<body><pre><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD>㧥<EFBFBD> WebView!
|
||||
<html><head><title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title></head>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KolibriOS:<ol>
|
||||
<li><a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᠩ<></a>
|
||||
<li><a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
||||
<li><a href="//ftp.kolibrios.org">FTP <20><>ࢥ<EFBFBD></a></ol>
|
||||
<table><tr><td width=20><td width=220><pre>
|
||||
_____________________
|
||||
|# : : #|
|
||||
| : WebView : |
|
||||
| : for : |
|
||||
| : KolibriOS : |
|
||||
| : : |
|
||||
| :_______________: |
|
||||
| ____________ |
|
||||
| | __ | |
|
||||
| || | | |
|
||||
\_____||__|________|__|<font color=#DDD>lc</font>
|
||||
|
||||
<font bg=#F8F15B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,</font>
|
||||
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatable
|
||||
<font bg=#3CE7FF> </font></font></font></font>
|
||||
<td>
|
||||
|
||||
</pre>
|
||||
<kosicon n=58><a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᠩ<></a>
|
||||
<kosicon n=50><a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
||||
<kosicon n=50><a href="//ftp.kolibrios.org">FTP <20><>ࢥ<EFBFBD></a>
|
||||
<pre>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
<font color="#555555">• <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
• <20><><EFBFBD> <20><><EFBFBD>᪠ <20> Google <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>᭮<EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+Enter
|
||||
• <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> F6 <20><>६<EFBFBD>頥<EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
• <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>, <20><><EFBFBD> <20>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ࠢ<EFBFBD><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㣫<> <20><><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~+
|
||||
|
||||
* +
|
||||
' |
|
||||
() .-.,="``"=. - o -
|
||||
'=/_ \ |
|
||||
* | '=._ |
|
||||
\ `=./`, '
|
||||
. '=.__.=' `=' *
|
||||
+ +
|
||||
O * ' .<font color=#DDD>jgs</font>
|
@@ -5,12 +5,19 @@
|
||||
<title>Тест Acid 0.1</title>
|
||||
</head>
|
||||
<body bgcolor="#000000" link="#0066FF" text="#FFFFFF">
|
||||
<h1 align=center>Это тестовая страница для проверки WebViewer</h1>
|
||||
<br />
|
||||
<p>WebViewer является текстовым браузером и поддерживает все популярные кодировки (cp1251, koi-8, cp866, unicode)
|
||||
и некоторые теги. Поддержка таблииц (<table>), CSS, Javascript'a и Контактика пока не реализована :)
|
||||
<h1 align=center>Тест Acid 0.1</h1>
|
||||
<br>
|
||||
<b>Это тестовая страница для проверки текстового браузера <s>HTML Viewer</s> WebView</b>
|
||||
|
||||
<p>Из кодировок поддерживаются: CP866(DOS), CP1251(Windows), CP1252(Latin legacy), KOI8, и конечно UTF8. CSS и Javascript пока не реализованы (ахахаха). Поддержка тега <table> крайне базовая, поддержки вложенных таблиц нет.
|
||||
</p>
|
||||
<br />
|
||||
|
||||
<h3>История</h3>
|
||||
|
||||
Ранее программа называлась <b >HTMLv (HTML Viewer)</b> и изначально задумывалась как <q>Центр справки и поддержки</q>. Чтобы не изобретать велосипед и одновременно исполнить мечту многих, форматом просматриваемых страниц был выбран html.
|
||||
Первоначальный автор Veliant, затем разработка была подхвачена дизайнером Leency. Это была моя вторая программа после файлового менеджера Eolite.<br>
|
||||
|
||||
<span> <br />
|
||||
|
||||
<b>
|
||||
<font color="#FF0000">K</font>
|
||||
@@ -33,7 +40,8 @@
|
||||
</b>
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<table>
|
||||
<td>
|
||||
<bg bgcolor=#333>
|
||||
Небольшой список:<ol>
|
||||
<li><q>Этот текст в кавычках</q></li>
|
||||
@@ -46,17 +54,14 @@
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
|
||||
Басе
|
||||
</pre>
|
||||
<!-- комментарий: этого текста здесь <нет> -->
|
||||
|
||||
<br>
|
||||
|
||||
<img alt="нет картинки, просто alt">
|
||||
|
||||
<img src = http://wiby.org/about/wibyplex.gif>
|
||||
|
||||
<a href="http://kolibrios.org/i/logo.png"><img id="2.1.4" src="http://kolibrios.org/i/logo.png" alt="logo"><br>Открыть</a><br>
|
||||
|
||||
<br>
|
||||
@@ -65,10 +70,25 @@
|
||||
<a href='/sys/index.htm'>Незакрытый тег а - index.htm<br>
|
||||
<a href="/sys/calc">/sys/calc</a><br>
|
||||
<a href="#2.1.4">#2.1.4</a><br>
|
||||
<a href="http://bash.im">http://bash.im</a><br>
|
||||
<a href="http://kolibrios.org">http://kolibrios.org</a><br>
|
||||
<a href="mailto:leency@mail.ru">Mail to Leency</a><br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<h1><a href=#>Link H1</a> <u>Underline H1</u></h1>
|
||||
<h2><a href=#>Link H2</a> <u>Underline H2</u></h2>
|
||||
<h3><a href=#>Link H3</a> <u>Underline H2</u></h3>
|
||||
<a href=#>Link</a> <u>Underline</u>
|
||||
|
||||
<td>
|
||||
|
||||
<pre>
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
|
||||
Басе
|
||||
|
||||
</pre><br>
|
||||
|
||||
В этом тексте есть переход на следующую строку, но браузер
|
||||
его должен проигнорировать. Еще много пробелов. А тут есть
|
||||
@@ -80,8 +100,19 @@
|
||||
корпус на территории НТУ «ХПИ»
|
||||
</p>
|
||||
|
||||
<pre><font color="#000">
|
||||
<font bg=#FFED00 style="background-color:#FFED00"> Заметки </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Речка на Жукова </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Heroes 3 </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Рисостерон, куринабол </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> </font>
|
||||
</font></pre>
|
||||
|
||||
</table>
|
||||
|
||||
<hr color="#758999">
|
||||
<center>Zhitomyr 2008-2015</center>
|
||||
<center>Zhytomyr 2008-2025</center>
|
||||
|
||||
|
||||
</body>
|
||||
|
@@ -1,9 +1,8 @@
|
||||
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2022
|
||||
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2025
|
||||
//GNU GPL license.
|
||||
|
||||
/*
|
||||
BUGS:
|
||||
- F1 in KFM (move Properties to an external app)
|
||||
- Ctrl+1+2+3+4 in KFM
|
||||
- Highlight another commands on Ctrl|Shift in KFM like in Classic KFM
|
||||
TODO:
|
||||
@@ -11,9 +10,9 @@ TODO:
|
||||
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
||||
*/
|
||||
|
||||
#define ABOUT_TITLE "EOLITE 5.29"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.29"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.29";
|
||||
#define ABOUT_TITLE "Eolite 5.32"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.32"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.32";
|
||||
|
||||
#define MEMSIZE 1024 * 250
|
||||
#include "../lib/clipboard.h"
|
||||
@@ -26,12 +25,15 @@ TODO:
|
||||
#include "../lib/kfont.h"
|
||||
#include "../lib/collection.h"
|
||||
#include "../lib/copyf.h"
|
||||
#include "../lib/dll.h"
|
||||
|
||||
#include "../lib/obj/libini.h"
|
||||
#include "../lib/obj/box_lib.h"
|
||||
#include "../lib/obj/libimg.h"
|
||||
#include "../lib/obj/proc_lib.h"
|
||||
|
||||
#include "../lib/patterns/history.h"
|
||||
#include "../lib/patterns/select_list.h"
|
||||
|
||||
#include "imgs/images.h"
|
||||
#include "include/const.h"
|
||||
@@ -110,6 +112,8 @@ edit_box popin_text = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x1000000
|
||||
|
||||
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
|
||||
|
||||
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
|
||||
|
||||
#include "include\settings.h"
|
||||
#include "include\gui.h"
|
||||
#include "include\progress_dialog.h"
|
||||
@@ -121,6 +125,8 @@ PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #t
|
||||
#include "include\about.h"
|
||||
#include "include\properties.h"
|
||||
|
||||
#include "search.c"
|
||||
|
||||
void handle_param()
|
||||
{
|
||||
//-p <path> : just show file/folder properties dialog
|
||||
@@ -146,6 +152,14 @@ void handle_param()
|
||||
|
||||
if (ESBYTE[p]=='\0') return;
|
||||
|
||||
if (ESBYTE[p]=='\\') switch (ESBYTE[p+1])
|
||||
{
|
||||
case 's':
|
||||
strcpy(path, p + 3);
|
||||
SearchThread();
|
||||
ExitProcess();
|
||||
}
|
||||
|
||||
if (ESBYTE[p]=='-') switch (ESBYTE[p+1])
|
||||
{
|
||||
case 'p':
|
||||
@@ -429,6 +443,9 @@ void main()
|
||||
}
|
||||
EventDriveClick(key_scancode);
|
||||
break;
|
||||
case SCAN_CODE_KEY_P:
|
||||
EventCopyItemPath();
|
||||
break;
|
||||
case SCAN_CODE_KEY_X:
|
||||
CopyFilesListToClipboard(CUT);
|
||||
break;
|
||||
@@ -438,6 +455,9 @@ void main()
|
||||
case SCAN_CODE_KEY_G:
|
||||
EventOpenConsoleHere();
|
||||
break;
|
||||
case SCAN_CODE_KEY_F:
|
||||
EventOpenSearch();
|
||||
break;
|
||||
case SCAN_CODE_KEY_V:
|
||||
EventPaste(path);
|
||||
break;
|
||||
@@ -698,7 +718,7 @@ void DrawFilePanels()
|
||||
DrawButtonsAroundList();
|
||||
path = location[active_panel^1];
|
||||
active_panel ^= 1;
|
||||
OpenDir2(WITH_REDRAW);
|
||||
OpenDir_without_unselect(WITH_REDRAW);
|
||||
active_panel ^= 1;
|
||||
if (!getSelectedCount()) files_inactive.count = files.count;
|
||||
llist_copy(#files, #files_active);
|
||||
@@ -711,38 +731,22 @@ void DrawFilePanels()
|
||||
|
||||
DrawButtonsAroundList();
|
||||
path = location[active_panel];
|
||||
OpenDir2(WITH_REDRAW);
|
||||
OpenDir_without_unselect(WITH_REDRAW);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenDir2(char redraw){
|
||||
if (buf) free(buf);
|
||||
if (GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
|
||||
Write_Error(EAX);
|
||||
history.add(path);
|
||||
EventHistoryGoBack();
|
||||
return;
|
||||
}
|
||||
SetCurDir(path);
|
||||
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
|
||||
files.visible = math.min(files.h / files.item_h, files.count);
|
||||
if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4))
|
||||
dir_at_fat16 = true; else dir_at_fat16 = false;
|
||||
Sorting();
|
||||
SystemDiscs.Draw();
|
||||
list_full_redraw = true;
|
||||
List_ReDraw();
|
||||
DrawPathBar();
|
||||
}
|
||||
|
||||
|
||||
void OpenDir(char redraw){
|
||||
int errornum;
|
||||
void OpenDir(char redraw) {
|
||||
unselectAll();
|
||||
OpenDir_without_unselect(redraw);
|
||||
}
|
||||
|
||||
|
||||
void OpenDir_without_unselect(char redraw) {
|
||||
int errornum;
|
||||
|
||||
if (buf) free(buf);
|
||||
if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
|
||||
history.add(path);
|
||||
//EventHistoryGoBack();
|
||||
Dir_Up();
|
||||
Write_Error(errornum);
|
||||
return;
|
||||
@@ -1037,7 +1041,6 @@ void EventHistoryGoForward()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShowOpenWithDialog()
|
||||
{
|
||||
byte open_param[4097];
|
||||
@@ -1131,6 +1134,7 @@ void ShowPopinForm(byte _popin_type)
|
||||
break;
|
||||
case POPIN_DELETE:
|
||||
if (!files.count) return;
|
||||
popin_string[0] = -1;
|
||||
if (!getSelectedCount()) && (!strncmp(#file_name,"..",2)) return;
|
||||
popinx = DrawEolitePopup(T_YES, T_NO);
|
||||
WriteTextCenter(popinx, 178, POPIN_W, sc.work_text, T_DELETE_FILE);
|
||||
@@ -1322,6 +1326,18 @@ void EventOpenConsoleHere()
|
||||
RunProgram("/sys/shell", #param);
|
||||
}
|
||||
|
||||
void EventOpenSearch()
|
||||
{
|
||||
sprintf(#param, "\\s %s", path);
|
||||
RunProgram(#program_path, #param);
|
||||
}
|
||||
|
||||
|
||||
void EventCopyItemPath()
|
||||
{
|
||||
Clipboard__CopyText(#file_path);
|
||||
}
|
||||
|
||||
void ProceedMouseGestures()
|
||||
{
|
||||
char stats;
|
||||
|
@@ -1,16 +1,8 @@
|
||||
if tup.getconfig("NO_CMM") ~= "" then return end
|
||||
if tup.getconfig("NO_TCC") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_tcc.lua")
|
||||
|
||||
if tup.getconfig("LANG") == "ru_RU"
|
||||
then C_LANG = "LANG_RUS"
|
||||
else C_LANG = "LANG_ENG" -- this includes default case without config
|
||||
end
|
||||
|
||||
LFLAGS = LFLAGS .. " -stack=20480"
|
||||
LIBS += " ../../develop/ktcc/trunk/bin/lib/tiny.o -nostdlib -lbox_lib -lini -limg"
|
||||
|
||||
tup.rule("Eolite.c", "c-- -coff /D=" .. C_LANG .. " /OPATH=%o %f", "%B.obj")
|
||||
tup.rule("Eolite.obj", "objconv -felf32 %f %o", "%B.o")
|
||||
link_tcc("Eolite.o", "%B.com")
|
||||
tup.rule("Eolite.c", "c-- /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "Eolite.com")
|
||||
|
@@ -1,4 +1,3 @@
|
||||
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
|
||||
|
||||
struct ICONS_INI {
|
||||
collection exts;
|
||||
|
@@ -4,9 +4,11 @@ char file_actions[]=
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Enter
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+Ent
|
||||
-
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+C
|
||||
<EFBFBD><EFBFBD>१<EFBFBD><EFBFBD><EFBFBD> |Ctrl+X
|
||||
<EFBFBD><EFBFBD>⠢<EFBFBD><EFBFBD><EFBFBD> |Ctrl+V
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+P
|
||||
-
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+C
|
||||
<EFBFBD><EFBFBD>१<EFBFBD><EFBFBD><EFBFBD>|Ctrl+X
|
||||
<EFBFBD><EFBFBD>⠢<EFBFBD><EFBFBD><EFBFBD>|Ctrl+V
|
||||
-
|
||||
<EFBFBD><EFBFBD>२<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |F2
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Del
|
||||
@@ -15,8 +17,10 @@ char empty_folder_actions[]=
|
||||
"<EFBFBD><EFBFBD>⠢<EFBFBD><EFBFBD><EFBFBD> |Ctrl+V";
|
||||
char burger_menu_items[] =
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>|Ctrl+N
|
||||
-
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>᮫<EFBFBD>|Ctrl+G
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+R
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+F
|
||||
-
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD>|F10
|
||||
<EFBFBD> <EFBFBD>ணࠬ<EFBFBD><EFBFBD>";
|
||||
|
||||
@@ -25,6 +29,8 @@ char file_actions[]=
|
||||
"Ava |Enter
|
||||
Ava ... |Ctrl+Ent
|
||||
-
|
||||
Copy path |Ctrl+P
|
||||
-
|
||||
Kopeeri |Ctrl+C
|
||||
L<EFBFBD>ika |Ctrl+X
|
||||
Aseta |Ctrl+V
|
||||
@@ -36,8 +42,10 @@ char empty_folder_actions[]=
|
||||
"Aseta |Ctrl+V";
|
||||
char burger_menu_items[] =
|
||||
"New window|Ctrl+N
|
||||
-
|
||||
Open console here|Ctrl+G
|
||||
V<EFBFBD>rskenda|Ctrl+R
|
||||
Search|Ctrl+F
|
||||
-
|
||||
Settings|F10
|
||||
About";
|
||||
|
||||
@@ -46,6 +54,8 @@ char file_actions[]=
|
||||
"Open |Enter
|
||||
Open with... |Ctrl+Ent
|
||||
-
|
||||
Copy path |Ctrl+P
|
||||
-
|
||||
Copy |Ctrl+C
|
||||
Cut |Ctrl+X
|
||||
Paste |Ctrl+V
|
||||
@@ -57,8 +67,10 @@ char empty_folder_actions[]=
|
||||
"Paste |Ctrl+V";
|
||||
char burger_menu_items[] =
|
||||
"New window|Ctrl+N
|
||||
-
|
||||
Open console here|Ctrl+G
|
||||
Refresh folder|Ctrl+R
|
||||
Search|Ctrl+F
|
||||
-
|
||||
Settings|F10
|
||||
About";
|
||||
#endif
|
||||
@@ -76,17 +88,18 @@ void EventMenuClick(dword _id)
|
||||
if (active_menu == MENU_FILE) switch(_id) {
|
||||
case 1: EventOpen(0); break;
|
||||
case 2: ShowOpenWithDialog(); break;
|
||||
case 3: CopyFilesListToClipboard(COPY); break;
|
||||
case 4: CopyFilesListToClipboard(CUT); break;
|
||||
case 5: EventPaste(path); break;
|
||||
case 6: FnProcess(2); break;
|
||||
case 7: ShowPopinForm(POPIN_DELETE); break;
|
||||
case 8: FnProcess(1); break;
|
||||
case 3: EventCopyItemPath(); break;
|
||||
case 4: CopyFilesListToClipboard(COPY); break;
|
||||
case 5: CopyFilesListToClipboard(CUT); break;
|
||||
case 6: EventPaste(path); break;
|
||||
case 7: FnProcess(2); break;
|
||||
case 8: ShowPopinForm(POPIN_DELETE); break;
|
||||
case 9: FnProcess(1); break;
|
||||
}
|
||||
if (active_menu == MENU_BURGER) switch(_id) {
|
||||
case 1: EventOpenNewEolite(); break;
|
||||
case 2: EventOpenConsoleHere(); break;
|
||||
case 3: EventRefreshDisksAndFolders(); break;
|
||||
case 3: EventOpenSearch(); break;
|
||||
case 4: FnProcess(10); break;
|
||||
case 5: EventShowAbout(); break;
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ void settings_dialog()
|
||||
case evKey:
|
||||
GetKeys();
|
||||
if (key_scancode==SCAN_CODE_ESC) ExitSettings();
|
||||
edit_box_key_c stdcall (#path_start_ed,key_ascii << 8);
|
||||
edit_box_key_c stdcall (#path_start_ed,key_editbox);
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
|
@@ -1,13 +1,3 @@
|
||||
#define MEMSIZE 100*1000
|
||||
|
||||
#include "../lib/fs.h"
|
||||
#include "../lib/gui.h"
|
||||
#include "../lib/list_box.h"
|
||||
#include "../lib/obj/box_lib.h"
|
||||
#include "../lib/obj/proc_lib.h"
|
||||
#include "../lib/obj/libini.h"
|
||||
#include "../lib/patterns/select_list.h"
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
// DATA //
|
||||
@@ -34,11 +24,11 @@ enum {
|
||||
BTN_CHOOSE_PATH
|
||||
};
|
||||
|
||||
proc_info Form;
|
||||
#define TOOLBAR_H 100
|
||||
|
||||
edit_box edit_name = {230,13, 30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(search_name)-2,#search_name,0, ed_focus,0,0};
|
||||
edit_box edit_path = {310,260,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(search_path)-2,#search_path,0, 0b,0,0};
|
||||
dword mouse_dd;
|
||||
edit_box edit_name = {230,13, 30,0xffffff,0x94AECE,0xffffff,0xffffff,
|
||||
0x10000000,sizeof(search_name)-2,#search_name,#mouse_dd, ed_focus,0,0};
|
||||
edit_box edit_path = {310,260,30,0xffffff,0x94AECE,0xffffff,0xffffff,
|
||||
0x10000000,sizeof(search_path)-2,#search_path,#mouse_dd, 0b,0,0};
|
||||
|
||||
opendialog open_folder_dialog =
|
||||
{
|
||||
@@ -49,7 +39,7 @@ opendialog open_folder_dialog =
|
||||
0, //dword opendir_path,
|
||||
#search_path, //dword dir_default_path,
|
||||
#open_dialog_path,
|
||||
#draw_window,
|
||||
#draw_window_search,
|
||||
0,
|
||||
#search_path, //dword openfile_path,
|
||||
0, //dword filename_area,
|
||||
@@ -97,47 +87,72 @@ void RESULTS::drop()
|
||||
// //
|
||||
//===================================================//
|
||||
|
||||
void main()
|
||||
void SearchThread()
|
||||
{
|
||||
int prev_first, prev_cur_y;
|
||||
load_dll(boxlib, #box_lib_init,0);
|
||||
load_dll(libini, #lib_init,1);
|
||||
|
||||
load_dll(Proc_lib, #OpenDialog_init,0);
|
||||
OpenDialog_init stdcall (#open_folder_dialog);
|
||||
|
||||
edit_box_set_text stdcall (#edit_name, ".ini");
|
||||
edit_box_set_text stdcall (#edit_path, "/kolibrios");
|
||||
if (!ESBYTE[path]) strcpy(path, "/sys");
|
||||
edit_box_set_text stdcall (#edit_path, path);
|
||||
|
||||
@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||
loop() switch(@WaitEvent())
|
||||
{
|
||||
case evMouse:
|
||||
|
||||
edit_box_mouse stdcall (#edit_name);
|
||||
edit_box_mouse stdcall (#edit_path);
|
||||
|
||||
|
||||
prev_cur_y = select_list.cur_y;
|
||||
|
||||
if (SelectList_ProcessMouse()) {
|
||||
SelectList_Draw();
|
||||
} else {
|
||||
SelectList_DrawLine(select_list.cur_y);
|
||||
}
|
||||
if (mouse.key&MOUSE_RIGHT) && (mouse.up) && (select_list.MouseOver()) EventOpenFile(false);
|
||||
break;
|
||||
|
||||
if (select_list.MouseOver(mouse.x, mouse.y))
|
||||
{
|
||||
if (mouse.key&MOUSE_LEFT) && (mouse.up) {
|
||||
if (prev_cur_y == select_list.cur_y) EventRunFile();
|
||||
}
|
||||
|
||||
if (mouse.key&MOUSE_RIGHT) && (mouse.up) {
|
||||
EventShowFileInFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case evButton:
|
||||
switch (@GetButtonID()) {
|
||||
case 1: @ExitProcess(); break;
|
||||
case BTN_SEARCH: EventSearch(); break;
|
||||
case BTN_CHOOSE_PATH: EventChooseSearchInPath();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
break;
|
||||
case evKey:
|
||||
@GetKeys();
|
||||
edit_box_key stdcall (#edit_name);
|
||||
edit_box_key stdcall (#edit_path);
|
||||
GetKeys();
|
||||
edit_box_key_c stdcall (#edit_name, key_editbox);
|
||||
edit_box_key_c stdcall (#edit_path, key_editbox);
|
||||
if (key_scancode == SCAN_CODE_TAB) {
|
||||
if (edit_name.flags & ed_focus) {
|
||||
edit_name.flags >< edit_path.flags;
|
||||
} else if (edit_path.flags & ed_focus) {
|
||||
edit_path.flags -= ed_focus;
|
||||
} else {
|
||||
edit_name.flags += ed_focus;
|
||||
}
|
||||
draw_window_search();
|
||||
break;
|
||||
}
|
||||
if (edit_name.flags & ed_focus) || (edit_path.flags & ed_focus) {
|
||||
if (SCAN_CODE_ENTER == key_scancode) EventSearch();
|
||||
} else {
|
||||
if (SCAN_CODE_ENTER == key_scancode) EventOpenFile(true);
|
||||
if (SCAN_CODE_ENTER == key_scancode) EventRunFile();
|
||||
prev_first = select_list.first;
|
||||
prev_cur_y = select_list.cur_y;
|
||||
if (select_list.ProcessKey(key_scancode)) {
|
||||
@@ -152,33 +167,37 @@ void main()
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
sc.get();
|
||||
DefineAndDrawWindow(screen.w-600/2,100,640,600,0x73,sc.work,T_WINDOW_HEADER,0);
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
IF (Form.status_window&ROLLED_UP) break;
|
||||
if (Form.width < 370) { MoveSize(OLD,OLD,370,OLD); break; }
|
||||
if (Form.height < 250) { MoveSize(OLD,OLD,OLD,250); break; }
|
||||
draw_window_search();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void draw_window()
|
||||
#define TOOLBAR_H 100
|
||||
#define PAD 10
|
||||
#define LISTX PAD
|
||||
#define LISTY TOOLBAR_H
|
||||
|
||||
void draw_window_search()
|
||||
{
|
||||
sc.get();
|
||||
DefineAndDrawWindow(screen.w-600/2,100,640,600,0x73,sc.work,T_WINDOW_HEADER,0);
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
IF (Form.status_window&ROLLED_UP) return;
|
||||
if (Form.width < 270) { MoveSize(OLD,OLD,270,OLD); return; }
|
||||
if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); return; }
|
||||
SelectList_Init( 0, TOOLBAR_H,
|
||||
Form.cwidth-scroll1.size_x-1,
|
||||
Form.cheight-TOOLBAR_H-1);
|
||||
SelectList_Init(LISTX, LISTY, Form.cwidth-scroll1.size_x-LISTX-LISTX, Form.cheight-TOOLBAR_H-PAD);
|
||||
SelectList_Draw();
|
||||
DrawBar(0, TOOLBAR_H-1, Form.cwidth, 1, sc.line);
|
||||
DrawWideRectangle(0, LISTY-PAD-1, Form.cwidth, Form.cheight-TOOLBAR_H+PAD+1, 9, sc.work);
|
||||
DrawRectangle(PAD-1, LISTY-1, select_list.w+1, select_list.h+1, sc.line);
|
||||
|
||||
DrawBar(0, 0, Form.cwidth, TOOLBAR_H-1, sc.work);
|
||||
DrawEditBox(#edit_name);
|
||||
WriteText(edit_name.left-2, edit_name.top-20, 0x90, sc.work_text, T_SEARCH_NAME);
|
||||
edit_path.width = Form.cwidth - 314;
|
||||
DrawStandartCaptButton(PAD, 63, BTN_SEARCH, T_BUTTON_SEARCH);
|
||||
DrawFileBox(#edit_path, T_SEARCH_PATH, BTN_CHOOSE_PATH);
|
||||
DrawStandartCaptButton(10, 63, BTN_SEARCH, T_BUTTON_SEARCH);
|
||||
}
|
||||
|
||||
_ini ini = { "/sys/File managers/icons.ini", "icons16" };
|
||||
void SelectList_DrawLine(dword i)
|
||||
{
|
||||
int yyy = i*select_list.item_h+select_list.y;
|
||||
@@ -201,16 +220,19 @@ void SelectList_DrawLine(dword i)
|
||||
} else {
|
||||
strcpy(#tname, results.name.get(select_list.first + i));
|
||||
strlwr(#tname);
|
||||
icon = ini.GetInt(#tname + strrchr(#tname, '.'), 2);
|
||||
icons_ini.section = "icons16";
|
||||
icon = icons_ini.GetInt(#tname + strrchr(#tname, '.'), 2);
|
||||
}
|
||||
|
||||
#define ICONX 7
|
||||
DrawBar(select_list.x, yyy, ICONX-1, select_list.item_h, 0xFFFfff);
|
||||
DrawBar(select_list.x+ICONX+18, yyy, select_list.w-ICONX-18, select_list.item_h, bg);
|
||||
draw_icon_16(select_list.x+ICONX, yyy+1, icon);
|
||||
DrawBar(LISTX, yyy, ICONX, select_list.item_h, 0xFFFfff);
|
||||
DrawBar(LISTX+ICONX, yyy, 18, 1, 0xFFFfff);
|
||||
DrawBar(LISTX+ICONX, yyy + select_list.item_h-1, 18, 1, 0xFFFfff);
|
||||
DrawBar(LISTX+ICONX+18, yyy, select_list.w-ICONX-18, select_list.item_h, bg);
|
||||
draw_icon_16(LISTX+ICONX, yyy+1, icon);
|
||||
|
||||
WriteText(select_list.x + ICONX+18+4,yyy+select_list.text_y,0x90, col, results.name.get(select_list.first + i));
|
||||
WriteText(select_list.x + ICONX+18+206,yyy+select_list.text_y,0x90, col, results.path.get(select_list.first + i));
|
||||
WriteText(LISTX + ICONX+18+4,yyy+select_list.text_y,0x90, col, results.name.get(select_list.first + i));
|
||||
WriteText(LISTX + ICONX+18+206,yyy+select_list.text_y,0x90, col, results.path.get(select_list.first + i));
|
||||
}
|
||||
|
||||
void SelectList_LineChanged()
|
||||
@@ -218,6 +240,12 @@ void SelectList_LineChanged()
|
||||
return;
|
||||
}
|
||||
|
||||
void getfullpath(dword to, path, name) {
|
||||
strcpy(to, path);
|
||||
chrcat(to, '/');
|
||||
strcat(to, name);
|
||||
}
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
// EVENTS //
|
||||
@@ -232,22 +260,21 @@ void EventChooseSearchInPath()
|
||||
}
|
||||
}
|
||||
|
||||
void getfullpath(dword to, path, name) {
|
||||
strcpy(to, path);
|
||||
chrcat(to, '/');
|
||||
strcat(to, name);
|
||||
}
|
||||
|
||||
void EventOpenFile(int run_file_not_show_in_folder)
|
||||
void EventShowFileInFolder()
|
||||
{
|
||||
char full_path[4096];
|
||||
int pos = select_list.cur_y;
|
||||
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
|
||||
if (run_file_not_show_in_folder) {
|
||||
RunProgram("/sys/@open", #full_path);
|
||||
} else {
|
||||
RunProgram("/sys/file managers/eolite", #full_path);
|
||||
}
|
||||
RunProgram(#program_path, #full_path);
|
||||
}
|
||||
|
||||
void EventRunFile()
|
||||
{
|
||||
char full_path[4096];
|
||||
int pos = select_list.cur_y;
|
||||
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
|
||||
if (dir_exists(#full_path)) chrcat(#full_path, '/');
|
||||
RunProgram("/sys/@open", #full_path);
|
||||
}
|
||||
|
||||
void EventSearch()
|
||||
@@ -289,6 +316,4 @@ void find_loop(dword way)
|
||||
}
|
||||
}
|
||||
|
||||
stop:
|
||||
|
||||
|
@@ -9,7 +9,6 @@
|
||||
#pragma option -CPA
|
||||
#initallvar 0
|
||||
|
||||
#ifndef __COFF__
|
||||
#jumptomain FALSE
|
||||
|
||||
#startaddress 0
|
||||
@@ -30,17 +29,6 @@ dword I_Param = #param;
|
||||
dword I_Path = #program_path;
|
||||
char param[4096];
|
||||
char program_path[4096];
|
||||
#else
|
||||
extern dword __argv;
|
||||
extern dword __path;
|
||||
|
||||
dword I_Param = #__argv;
|
||||
dword I_Path = #__path;
|
||||
|
||||
#define param __argv
|
||||
#define program_path __path
|
||||
#define ______INIT______ start
|
||||
#endif
|
||||
|
||||
#define bool int
|
||||
|
||||
@@ -403,6 +391,7 @@ inline fastcall int TestBit( EAX, CL)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#define MINIMIZED 0x02
|
||||
#define ROLLED_UP 0x04
|
||||
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
|
||||
{
|
||||
|
@@ -116,17 +116,10 @@
|
||||
EAX = 37;
|
||||
EBX = 2;
|
||||
$int 64
|
||||
$mov ebx, eax
|
||||
$mov ecx, eax
|
||||
key = EAX;
|
||||
$and eax, 0x00000001
|
||||
$shr ebx, 1
|
||||
$and ebx, 0x00000001
|
||||
$shr ecx, 2
|
||||
$and ecx, 0x00000001
|
||||
lkm = EAX;
|
||||
pkm = EBX;
|
||||
mkm = ECX;
|
||||
lkm = EAX&MOUSE_LEFT;
|
||||
pkm = EAX&MOUSE_RIGHT;
|
||||
mkm = EAX&MOUSE_MIDDLE;
|
||||
|
||||
//when you release the MOUSE button
|
||||
// Mouse Move Event
|
||||
|
@@ -6,37 +6,6 @@
|
||||
#include "../lib/kolibri.h"
|
||||
#endif
|
||||
|
||||
#ifdef __COFF__
|
||||
extern dword edit_box_draw;
|
||||
extern dword edit_box_key_safe;
|
||||
extern dword edit_box_mouse;
|
||||
extern dword edit_box_set_text;
|
||||
|
||||
extern dword scrollbar_v_draw;
|
||||
extern dword scrollbar_v_mouse;
|
||||
extern dword scrollbar_h_draw;
|
||||
extern dword scrollbar_h_mouse;
|
||||
|
||||
extern dword PathShow_prepare;
|
||||
extern dword PathShow_draw;
|
||||
|
||||
extern dword progressbar_draw;
|
||||
extern dword progressbar_progress;
|
||||
|
||||
extern dword frame_draw;
|
||||
|
||||
/*
|
||||
Legacy support
|
||||
For new programs need to use edit_box_key_safe (or edit_box_key_c
|
||||
with a define below)
|
||||
TODO: change in all cmm programs edit_box_key to edit_box_key_safe (edit_box_key_c)
|
||||
See examples in eolite and imgedit
|
||||
|
||||
This define changed all edit_box_key_c to edit_box_key_safe identifier's
|
||||
*/
|
||||
#define edit_box_key_c edit_box_key_safe
|
||||
|
||||
#else
|
||||
#ifndef INCLUDE_DLL_H
|
||||
#include "../lib/dll.h"
|
||||
#endif
|
||||
@@ -242,5 +211,3 @@ struct frame
|
||||
frame_draw stdcall (#frame123);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
@@ -44,15 +44,14 @@ signed SelectList_ProcessMouse()
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mouse.up) && (mouse.click)
|
||||
if (select_list.ProcessMouse(mouse.x, mouse.y)) {
|
||||
SelectList_LineChanged();
|
||||
return true;
|
||||
}
|
||||
if (mouse.up) && (select_list.ProcessMouse(mouse.x, mouse.y)) {
|
||||
SelectList_LineChanged();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SelectList_DrawBorder() {
|
||||
:void SelectList_DrawBorder() {
|
||||
DrawRectangle3D(select_list.x-2, select_list.y-2,
|
||||
select_list.w+3+scroll1.size_x, select_list.h+3,
|
||||
sc.dark, sc.light);
|
||||
@@ -61,8 +60,8 @@ void SelectList_DrawBorder() {
|
||||
|
||||
void SelectList_DrawScroller()
|
||||
{
|
||||
scroll1.bckg_col = MixColors(sc.work, 0xBBBbbb, 80);
|
||||
scroll1.frnt_col = MixColors(sc.work,0xFFFfff,120);
|
||||
scroll1.bckg_col = sc.dark; // MixColors(sc.work, 0xBBBbbb, 80);
|
||||
scroll1.frnt_col = sc.light; // MixColors(sc.work,0xFFFfff,120);
|
||||
scroll1.line_col = sc.line;
|
||||
|
||||
scroll1.max_area = select_list.count;
|
||||
|
13
programs/cmm/misc/search.c
Normal file
13
programs/cmm/misc/search.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#define MEMSIZE 1024*20
|
||||
#define ENTRY_POINT #main
|
||||
|
||||
#include "../lib/fs.h"
|
||||
|
||||
void main()
|
||||
{
|
||||
char param2[4096];
|
||||
strcpy(#param2, "\\s ");
|
||||
strncpy(#param2 + 3, #param, sizeof(param2) - 2 - 3);
|
||||
RunProgram("/sys/File managers/Eolite", #param2);
|
||||
ExitProcess();
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
if tup.getconfig("NO_CMM") ~= "" then return end
|
||||
if tup.getconfig("LANG") == "ru_RU"
|
||||
then C_LANG = "LANG_RUS"
|
||||
else C_LANG = "LANG_ENG" -- this includes default case without config
|
||||
end
|
||||
tup.rule("search.c", "c-- /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "search.com")
|
@@ -1,10 +0,0 @@
|
||||
@del search
|
||||
@c-- /D=LANG_ENG search.c
|
||||
@rename search.com search
|
||||
@del warning.txt
|
||||
|
||||
if exist search (
|
||||
@exit
|
||||
) else (
|
||||
@pause
|
||||
)
|
@@ -1,10 +0,0 @@
|
||||
@del search
|
||||
@c-- /D=LANG_RUS search.c
|
||||
@rename search.com search
|
||||
@del warning.txt
|
||||
|
||||
if exist search (
|
||||
@exit
|
||||
) else (
|
||||
@pause
|
||||
)
|
2
programs/demos/flag/Tupfile.lua
Normal file
2
programs/demos/flag/Tupfile.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("flag.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "flag")
|
306
programs/demos/flag/flag.asm
Normal file
306
programs/demos/flag/flag.asm
Normal file
@@ -0,0 +1,306 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Flag - demo program shows a flag with the inscription 'KolibriOS'
|
||||
; Copyright (C) 2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
|
||||
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../dll.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/kosgl.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/examples/fps.inc'
|
||||
|
||||
@use_library
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
mcall SF_SET_EVENTS_MASK, 0x27
|
||||
|
||||
; *** init ***
|
||||
stdcall [kosglMakeCurrent], 0,15,600,380,ctx1
|
||||
|
||||
stdcall [glMatrixMode], GL_MODELVIEW
|
||||
call [glLoadIdentity]
|
||||
|
||||
stdcall [glClearColor], 0.549, 0.549, 0.588, 1.0
|
||||
|
||||
stdcall [glEnable], GL_LIGHTING
|
||||
stdcall [glLightf], GL_LIGHT0, GL_SPOT_EXPONENT, 0.0
|
||||
stdcall [glLightf], GL_LIGHT0, GL_SPOT_CUTOFF, 180.0
|
||||
stdcall [glEnable], GL_LIGHT0
|
||||
|
||||
stdcall [glLightfv], GL_LIGHT0, GL_POSITION, lightpos
|
||||
stdcall [glLightfv], GL_LIGHT0, GL_SPOT_DIRECTION, lightdirect
|
||||
|
||||
stdcall [glEnable], GL_COLOR_MATERIAL
|
||||
|
||||
glpush p3
|
||||
stdcall [glClearDepth]
|
||||
stdcall [glEnable], GL_CULL_FACE
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
|
||||
fninit
|
||||
|
||||
stdcall reshape, 600,380
|
||||
; *** end init ***
|
||||
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
mcall SF_THREAD_INFO, procinfo,-1
|
||||
mov eax,dword[procinfo.box.height]
|
||||
cmp eax,120
|
||||
jge @f
|
||||
mov eax,120 ;min size
|
||||
@@:
|
||||
sub eax,43
|
||||
mov ebx,dword[procinfo.box.width]
|
||||
cmp ebx,200
|
||||
jge @f
|
||||
mov ebx,200
|
||||
@@:
|
||||
sub ebx,10
|
||||
stdcall reshape, ebx,eax
|
||||
|
||||
align 16
|
||||
still:
|
||||
call draw_3d
|
||||
cmp dword[stop],1
|
||||
je @f
|
||||
stdcall Fps, 365,4
|
||||
|
||||
mov dword[esp-4],eax
|
||||
fild dword[esp-4]
|
||||
fmul dword[delt_3]
|
||||
fchs
|
||||
fadd dword[dangle]
|
||||
fstp dword[dangle] ;dangle -= 0.01*Fps(x,y)
|
||||
|
||||
mcall SF_WAIT_EVENT_TIMEOUT, 1
|
||||
jmp .end0
|
||||
align 4
|
||||
@@:
|
||||
mcall SF_WAIT_EVENT
|
||||
.end0:
|
||||
cmp al, EV_REDRAW
|
||||
jz red_win
|
||||
cmp al, EV_KEY
|
||||
jz key
|
||||
cmp al, EV_BUTTON
|
||||
jz button
|
||||
|
||||
jmp still
|
||||
|
||||
|
||||
; new window size or exposure
|
||||
align 4
|
||||
proc reshape, width:dword, height:dword
|
||||
locals
|
||||
dxy dq ?
|
||||
endl
|
||||
stdcall [glViewport], 0, 0, [width], [height]
|
||||
stdcall [glMatrixMode], GL_PROJECTION
|
||||
call [glLoadIdentity]
|
||||
fild dword[width]
|
||||
fidiv dword[height]
|
||||
fstp qword[dxy] ;dxy = width/height
|
||||
glpush p4
|
||||
glpush p3
|
||||
glpush dxy
|
||||
glpush p1
|
||||
call [gluPerspective] ;28.0, width/height, 1.0, 40.0
|
||||
|
||||
stdcall [glMatrixMode], GL_MODELVIEW
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_CREATE_WINDOW, (50 shl 16)+609,(30 shl 16)+425,0x33404040,,title1
|
||||
call [kosglSwapBuffers]
|
||||
|
||||
;Title
|
||||
mcall SF_DRAW_TEXT, (338 shl 16)+4, 0xc0c0c0, fps, fps.end-fps
|
||||
mcall SF_DRAW_TEXT, (8 shl 16)+4, 0xc0c0c0, title2, title2.end-title2
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall SF_GET_KEY
|
||||
|
||||
cmp ah,27 ;Esc
|
||||
je button.exit
|
||||
|
||||
cmp ah,112 ;P
|
||||
jne @f
|
||||
xor dword[stop],1
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
|
||||
align 4
|
||||
title1: db 'TinyGL in KolibriOS'
|
||||
.end: db 0
|
||||
title2: db 'ESC - exit, P - pause'
|
||||
.end: db 0
|
||||
fps: db 'FPS:'
|
||||
.end: db 0
|
||||
|
||||
align 16
|
||||
proc draw_3d uses ebx ecx edx esi edi
|
||||
locals
|
||||
z dd ?
|
||||
endl
|
||||
call [glLoadIdentity]
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT
|
||||
stdcall [glTranslatef], 0.0, 0.0, -2.0
|
||||
stdcall [glRotatef], 10.0, 0.0, 0.0, 1.0
|
||||
stdcall [glRotatef], 43.0, 0.0, 1.0, 0.0
|
||||
stdcall [glTranslatef], -0.6, -0.2, -0.1
|
||||
|
||||
mov edi, logo+9*41 ;edi = logo[9][0]
|
||||
mov esi, 41 ;esi = i
|
||||
align 4
|
||||
.cycle0: ;for(int i=0;i<41;i++)
|
||||
stdcall [glTranslatef], 0.045, 0.0, 0.0
|
||||
call [glPushMatrix]
|
||||
fld dword[angle]
|
||||
fsin
|
||||
fmul dword[delt_1]
|
||||
fstp dword[z] ;= 0.08*sin(angle)
|
||||
|
||||
fld dword[angle]
|
||||
fadd dword[delt_2]
|
||||
fstp dword[angle] ;angle += 0.2
|
||||
|
||||
mov ecx, 9
|
||||
mov ebx, edi
|
||||
|
||||
; ecx = j
|
||||
.cycle1: ;for(int j=9;j>=0;j--)
|
||||
cmp byte[ebx],0 ;if(logo[j][i])
|
||||
je @f
|
||||
push 0.0 ;b
|
||||
push 0.0 ;g
|
||||
push 1.0 ;r
|
||||
jmp .end_c2
|
||||
@@:
|
||||
push 0.945 ;b
|
||||
push 0.855 ;g
|
||||
push 0.859 ;r
|
||||
.end_c2:
|
||||
call [glColor3f]
|
||||
stdcall [glTranslatef], 0.0, 0.045, 0.0
|
||||
stdcall [glBegin], GL_QUADS
|
||||
stdcall [glVertex3f], 0.0, -0.04,[z]
|
||||
stdcall [glVertex3f], 0.04,-0.04,[z]
|
||||
stdcall [glVertex3f], 0.04, 0.0, [z]
|
||||
stdcall [glVertex3f], 0.0, 0.0, [z]
|
||||
call [glEnd]
|
||||
add ebx, -41
|
||||
dec ecx
|
||||
jnz .cycle1
|
||||
|
||||
call [glPopMatrix]
|
||||
inc edi ;edi = logo[9][i]
|
||||
dec esi
|
||||
jnz .cycle0
|
||||
|
||||
mov edx,dword[dangle]
|
||||
mov dword[angle],edx
|
||||
call [kosglSwapBuffers]
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
p1 dq 28.0
|
||||
p3 dq 1.0
|
||||
p4 dq 40.0
|
||||
|
||||
delt_1 dd 0.08
|
||||
delt_2 dd 0.2
|
||||
delt_3 dd 0.01
|
||||
|
||||
lightpos dd 2.0, 0.0, -2.5, 1.0
|
||||
lightdirect dd 0.0, 0.0, -0.7
|
||||
angle dd 0.0
|
||||
dangle dd 0.0
|
||||
|
||||
stop dd 0
|
||||
|
||||
;[10][41]
|
||||
logo db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
db 0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,0,1,1,1,0,0,0,1,1,1,0,0,0,\
|
||||
0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,\
|
||||
0,0,1,0,1,0,0,0,0,1,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,1,1,0,0,0,0,\
|
||||
0,0,1,1,1,0,0,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,\
|
||||
0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,\
|
||||
0,0,1,0,0,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,0,0,1,1,1,0,0,0
|
||||
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 TinyGLContext
|
||||
procinfo process_information
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
@@ -1,7 +0,0 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
add_include(tup.getvariantdir())
|
||||
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
|
||||
tup.rule({"magnify.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "magnify")
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,156 +0,0 @@
|
||||
;---------------------------------------------------------------------
|
||||
; MAGNIFY SCREEN v1.0
|
||||
;
|
||||
; Version for KolibriOS 2005-2011
|
||||
;
|
||||
; Version for Menuet to 2005
|
||||
;---------------------------------------------------------------------
|
||||
; last update: 08/18/2011
|
||||
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: Checking for "rolled up" window
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 1 ; header version
|
||||
dd START ; program start
|
||||
dd I_END ; program image size
|
||||
dd 0x1000 ; required amount of memory
|
||||
dd 0x1000 ; esp
|
||||
dd 0, 0 ; no parameters, no path
|
||||
;---------------------------------------------------------------------
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '..\..\..\macros.inc'
|
||||
delay equ 20
|
||||
|
||||
magnify_width = 40
|
||||
magnify_height = 30
|
||||
;---------------------------------------------------------------------
|
||||
START: ; start of execution
|
||||
redraw:
|
||||
call draw_window
|
||||
still:
|
||||
call draw_magnify
|
||||
wtevent:
|
||||
mcall 23,delay ; wait here for event with timeout
|
||||
dec eax
|
||||
js still
|
||||
jz redraw
|
||||
dec eax
|
||||
jnz button
|
||||
; key in buffer
|
||||
mov al, 2
|
||||
mcall
|
||||
jmp wtevent
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
; we have only one button, close
|
||||
or eax, -1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
|
||||
mov al, 48 ; function 48 : graphics parameters
|
||||
mov bl, 4 ; subfunction 4 : get skin height
|
||||
mcall
|
||||
; DRAW WINDOW
|
||||
mov ebx, 100*65536 + 8*magnify_width + 8
|
||||
lea ecx, [eax + 100*65536 + 8*magnify_height + 3]
|
||||
mov edx, 0x34000000 ; color of work area RRGGBB
|
||||
mov edi, labelt ; header
|
||||
xor eax, eax ; function 0 : define and draw window
|
||||
mcall
|
||||
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_magnify:
|
||||
mcall 9,procinfo,-1
|
||||
mov eax,[procinfo+70] ;status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
|
||||
mcall 14 ; get screen size
|
||||
movzx ecx, ax
|
||||
inc ecx
|
||||
mov [size_y], ecx
|
||||
shr eax, 16
|
||||
inc eax
|
||||
mov [size_x], eax
|
||||
|
||||
xor ebx, ebx
|
||||
mcall 37 ; get mouse coordinates
|
||||
mov ecx, eax
|
||||
shr ecx, 16 ; ecx = x
|
||||
movzx edx, ax ; edx = y
|
||||
inc ecx
|
||||
mov [m_xe], ecx
|
||||
inc edx
|
||||
mov [m_ye], edx
|
||||
sub ecx, magnify_width
|
||||
sub edx, magnify_height
|
||||
mov [m_x], ecx
|
||||
mov [m_y], edx
|
||||
.loop_y:
|
||||
.loop_x:
|
||||
xor eax, eax ; assume black color for invalid pixels
|
||||
test ecx, ecx
|
||||
js .nopix
|
||||
cmp ecx, [size_x]
|
||||
jge .nopix
|
||||
test edx, edx
|
||||
js .nopix
|
||||
cmp edx, [size_y]
|
||||
jge .nopix
|
||||
mov ebx, edx
|
||||
imul ebx, [size_x]
|
||||
add ebx, ecx
|
||||
mcall 35 ; read pixel
|
||||
.nopix:
|
||||
push ecx edx
|
||||
sub ecx, [m_x]
|
||||
sub edx, [m_y]
|
||||
mov ebx, ecx
|
||||
shl ebx, 3+16
|
||||
mov bl, 8
|
||||
mov ecx, edx
|
||||
shl ecx, 3+16
|
||||
mov cl, 8
|
||||
mov edx, eax
|
||||
mcall 13
|
||||
pop edx ecx
|
||||
inc ecx
|
||||
cmp ecx, [m_xe]
|
||||
jnz .loop_x
|
||||
mov ecx, [m_x]
|
||||
inc edx
|
||||
cmp edx, [m_ye]
|
||||
jnz .loop_y
|
||||
.end:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; DATA AREA
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
labelt:
|
||||
db 'Magnifier - <20><>࠭<EFBFBD><E0A0AD><EFBFBD> <20>㯠', 0
|
||||
else ; Default to en_US
|
||||
labelt:
|
||||
db 'Magnifier', 0
|
||||
end if
|
||||
|
||||
I_END:
|
||||
align 4
|
||||
m_x dd ?
|
||||
m_y dd ?
|
||||
m_xe dd ?
|
||||
m_ye dd ?
|
||||
size_x dd ?
|
||||
size_y dd ?
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
Binary file not shown.
@@ -28,7 +28,7 @@ IMPORT
|
||||
RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar;
|
||||
|
||||
CONST
|
||||
HEADER = "CEdit (27-feb-2025)";
|
||||
HEADER = "CEdit (30-apr-2025)";
|
||||
|
||||
ShellFilter = "";
|
||||
EditFilter = "sh|inc|txt|asm|ob07|c|cpp|h|pas|pp|lua|ini|json";
|
||||
@@ -1320,7 +1320,7 @@ BEGIN
|
||||
|menuBoard:
|
||||
K.Run("/sys/develop/board", "")
|
||||
|menuSysFunc:
|
||||
K.Run("/sys/docpack", "f")
|
||||
K.Run("/sys/docpack", "e")
|
||||
|menuLineNumbers:
|
||||
T.toggleNumbers;
|
||||
Ini.setInt("settings", "line_numbers", ORD(T.lineNumbers))
|
||||
|
@@ -1,2 +1,4 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("charsets.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "charsets")
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
tup.rule("charsets.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
|
||||
|
@@ -31,3 +31,19 @@ Development history
|
||||
- Renamed to Charsets Viewer/Charsets
|
||||
- Symbol highlight UI tweaks
|
||||
- Fixed rolled up bug
|
||||
|
||||
30.03.2025 - 0.4.0
|
||||
- Localization for all system languages
|
||||
- Display all character scales
|
||||
- Abolity to copy character codes
|
||||
- Block on charpage 00 for CP866
|
||||
- New character code half markers
|
||||
- Navigation using keys (see hotkeys.txt)
|
||||
|
||||
03.04.2025 - 0.4.1
|
||||
- Fixed bug with codes color subscription
|
||||
|
||||
04.04.2025 - 0.4.2
|
||||
- Fixed bug with resetting UTF charpage to zero on double charset swap to CP866
|
||||
- Improved charpage blocking for CP866 UX
|
||||
- Improved char codes copying UI
|
||||
|
File diff suppressed because it is too large
Load Diff
12
programs/develop/charsets/hotkeys.txt
Normal file
12
programs/develop/charsets/hotkeys.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
Control hotkeys
|
||||
|
||||
- Navigate inside charpage:
|
||||
- Arrows
|
||||
- Num2/4/6/8
|
||||
|
||||
- Navigation between charpages:
|
||||
- PgDN, PgUP - previous/next page
|
||||
- Num0, Home - reset page to zero
|
||||
|
||||
- Change symbol scale:
|
||||
- Num- and Num+
|
@@ -12,6 +12,7 @@ include '../../develop/libraries/libs-dev/libimg/libimg.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/kosgl.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include 'info_fun_float.inc'
|
||||
@@ -235,7 +236,7 @@ start:
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -1082,7 +1083,7 @@ l_libs_start:
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_box_lib
|
||||
lib_3 l_libs lib_name_3, file_name, system_dir_3, import_buf2d
|
||||
lib_4 l_libs lib_name_4, file_name, system_dir_4, import_libkmenu
|
||||
lib_5 l_libs lib_name_5, file_name, system_dir_5, import_lib_tinygl
|
||||
lib_5 l_libs lib_name_5, file_name, system_dir_5, import_tinygl
|
||||
lib_6 l_libs lib_name_6, file_name, system_dir_6, import_libini
|
||||
l_libs_end:
|
||||
|
||||
@@ -1287,16 +1288,20 @@ dd 0,0
|
||||
akmenuitem_draw db 'kmenuitem_draw',0
|
||||
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
|
||||
@@ -1343,7 +1348,7 @@ buf_1:
|
||||
align 4
|
||||
el_focus dd tree1
|
||||
tree1 tree_list size_one_list,300+2, tl_key_no_edit+tl_draw_par_line,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x400040, 5,35,195-16,250, 16,list_offs_text,0,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x10400040, 5,35,195-16,250, 16,list_offs_text,0,\
|
||||
el_focus,w_scr_t1,0
|
||||
|
||||
align 4
|
||||
@@ -1362,14 +1367,14 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
|
||||
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> 䮭<><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20>ᢥ饭<E1A2A5><E9A5AD>
|
||||
|
||||
if lang eq ru_RU
|
||||
capt db 'info 3ds <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 29.09.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
capt db 'info 3ds <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 04.05.25',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
else ; Default to en_US
|
||||
capt db 'info 3ds version 29.09.20',0 ;window caption
|
||||
capt db 'info 3ds version 04.05.25',0 ;window caption
|
||||
end if
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
procinfo process_information
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
|
@@ -1408,7 +1408,7 @@ buf_1:
|
||||
align 4
|
||||
el_focus dd tree1
|
||||
tree1 tree_list size_one_list,300+2, tl_key_no_edit+tl_draw_par_line,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x400040, 5,47,195-16,250, 16,list_offs_text,0, el_focus,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x10400040, 5,47,195-16,250, 16,list_offs_text,0, el_focus,\
|
||||
w_scr_t1,0
|
||||
|
||||
align 4
|
||||
@@ -1427,9 +1427,9 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
|
||||
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> 䮭<><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20>ᢥ饭<E1A2A5><E9A5AD>
|
||||
|
||||
if lang eq ru_RU
|
||||
capt db 'info 3ds [user] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 29.09.20',0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
capt db 'info 3ds [user] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 14.04.25',0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
else ; Default to en_US
|
||||
capt db 'info 3ds [user] version 29.09.20',0 ; Window caption
|
||||
capt db 'info 3ds [user] version 14.04.25',0 ; Window caption
|
||||
end if
|
||||
|
||||
align 16
|
||||
|
@@ -306,7 +306,7 @@ align 4
|
||||
faddp
|
||||
fild dword[rad_c]
|
||||
fdivp ;radius=(size.x+size.y)/rad_c
|
||||
fstp dword[sph_radius]
|
||||
fstp qword[sph_radius]
|
||||
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠡ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> x <EFBFBD> y, <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>蠫<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ய<EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࠦ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
fld dword[edi+obj_3d.y_scale]
|
||||
@@ -812,9 +812,8 @@ proc draw_3d uses eax ebx ecx edi, o_data:dword
|
||||
@@:
|
||||
stdcall [glDisable],GL_LIGHTING
|
||||
.end_l:
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5 ;correct for z
|
||||
stdcall [glScalef], [edi+obj_3d.x_scale],[edi+obj_3d.y_scale],[edi+obj_3d.z_scale]
|
||||
stdcall [glScalef], 1.0,1.0,0.7 ;correct for z
|
||||
stdcall [glScalef], 1.0,1.0,1.4 ;correct for z
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
@@ -976,7 +975,10 @@ if version_edit eq 1
|
||||
stdcall [glColor3ub],[color_select+2],[color_select+1],[color_select]
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
||||
stdcall [gluSphere], [qObj], [sph_radius], 8,8
|
||||
push 8
|
||||
push 8
|
||||
glpush sph_radius
|
||||
stdcall [gluSphere], [qObj]
|
||||
call [glPopMatrix]
|
||||
@@:
|
||||
|
||||
@@ -997,7 +999,10 @@ align 4
|
||||
mov eax,[eax]
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
||||
stdcall [gluSphere], [qObj], [sph_radius], 4,4
|
||||
push 4
|
||||
push 4
|
||||
glpush sph_radius
|
||||
stdcall [gluSphere], [qObj]
|
||||
call [glPopMatrix]
|
||||
dec ecx
|
||||
jz .end_select
|
||||
@@ -1345,5 +1350,5 @@ delt_size dd 3.0 ;
|
||||
mouse_drag dd 0 ;०<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>業<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD>饭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mouse_x dd 0
|
||||
mouse_y dd 0
|
||||
sph_radius dd 0 ;ࠤ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⨢<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>窨
|
||||
sph_radius dq 0 ;radius of the sphere for selecting the active point
|
||||
|
||||
|
@@ -951,13 +951,12 @@ endl
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glClearDepth uses eax, depth:dword
|
||||
proc glClearDepth uses eax, depth:qword
|
||||
locals
|
||||
p rd 2
|
||||
endl
|
||||
mov dword[p],OP_ClearDepth
|
||||
mov eax,[depth]
|
||||
fld qword[eax]
|
||||
fld qword[depth]
|
||||
fstp dword[p+4]
|
||||
|
||||
lea eax,[ebp-8] ;=sizeof(dd)*2
|
||||
|
@@ -23,8 +23,7 @@ endl
|
||||
imul ecx,ebx
|
||||
shl ecx,2
|
||||
add ecx,[eax+GLContext.color_array] ;ecx = &context.color_array[i]
|
||||
mov ebx,ebp
|
||||
sub ebx,20 ;=sizeof(dd)*5
|
||||
lea ebx,[ebp-20] ;=sizeof(dd)*5
|
||||
mov edx,[ecx]
|
||||
mov [ebx+4],edx
|
||||
mov edx,[ecx+4]
|
||||
@@ -48,8 +47,7 @@ endl
|
||||
imul esi,ebx
|
||||
shl esi,2
|
||||
add esi,[eax+GLContext.normal_array] ;esi = &normal_array[ebx * (3 + c->normal_array_stride)]
|
||||
mov edi,eax
|
||||
add edi,GLContext.current_normal
|
||||
lea edi,[eax+GLContext.current_normal]
|
||||
mov ecx,3
|
||||
rep movsd
|
||||
mov dword[edi],0.0
|
||||
@@ -92,8 +90,7 @@ endl
|
||||
imul ecx,ebx
|
||||
shl ecx,2
|
||||
add ecx,[eax+GLContext.vertex_array] ;ecx = &context.vertex_array[i]
|
||||
mov ebx,ebp
|
||||
sub ebx,20 ;=sizeof(dd)*5
|
||||
lea ebx,[ebp-20] ;=sizeof(dd)*5
|
||||
mov edx,[ecx]
|
||||
mov [ebx+4],edx
|
||||
mov edx,[ecx+4]
|
||||
@@ -130,8 +127,7 @@ endl
|
||||
mov eax,[i]
|
||||
mov dword[p+4],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,8 ;=sizeof(dd)*2
|
||||
lea eax,[ebp-8] ;=sizeof(dd)*2
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -139,10 +135,9 @@ endp
|
||||
align 4
|
||||
proc glopDrawArrays, context:dword, param:dword
|
||||
locals
|
||||
vi dd ?
|
||||
idx dd ?
|
||||
states dd ?
|
||||
size dd ?
|
||||
a_size dd ?
|
||||
p rd 8 ;функция glopColor требует 8 параметров, другие функции требуют меньше, берем по максимуму что-бы не портить стек
|
||||
endl
|
||||
pushad
|
||||
@@ -155,132 +150,19 @@ pushad
|
||||
mov [idx],eax ;param[2].i
|
||||
mov eax,[ebx+4]
|
||||
mov [p+4],eax ;p[1].i = param[1].i
|
||||
mov eax,ebp
|
||||
sub eax,32 ;=sizeof(dd)*8
|
||||
lea eax,[ebp-32] ;=sizeof(dd)*8
|
||||
stdcall glopBegin, edx,eax
|
||||
|
||||
mov dword[vi],0
|
||||
cmp ecx,1
|
||||
jl @f
|
||||
align 4
|
||||
.cycle_0: ;for (int vi=0; vi<count; vi++)
|
||||
cmp dword[vi],ecx
|
||||
jge .cycle_0_end
|
||||
bt dword[states],1 ;2^1=COLOR_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.color_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.color_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.color_array] ;esi = &context.color_array[i]
|
||||
mov edi,ebp
|
||||
sub edi,28 ;edi = &p[1]
|
||||
mov ebx,[esi+8]
|
||||
mov [edi],ebx ;p[1].f = context.color_array[i+2]
|
||||
mov ebx,[esi+4]
|
||||
mov [edi+4],ebx ;p[2].f = context.color_array[i+1]
|
||||
mov ebx,[esi]
|
||||
mov [edi+8],ebx ;p[3].f = context.color_array[i]
|
||||
add edi,12
|
||||
cmp dword[size],3
|
||||
jle .e1
|
||||
add esi,12
|
||||
movsd
|
||||
jmp .e2
|
||||
.e1:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
.e2:
|
||||
mov edi,ebp
|
||||
sub edi,32 ;edi = &p[0]
|
||||
mov ebx,ebp
|
||||
sub ebx,12 ;ebp-12 = &p[5]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-8 = &p[6]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-4 = &p[7]
|
||||
push ebx
|
||||
stdcall RGBFtoRGBI,[edi+12],[edi+8],[edi+4] ;call: r,g,b,&p[7],&p[6],&p[5]
|
||||
stdcall glopColor, edx,edi ;(context, p(op,rf,gf,bf,af,ri,gi,bi))
|
||||
@@:
|
||||
bt dword[states],2 ;2^2=NORMAL_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.normal_array_stride]
|
||||
add esi,3
|
||||
imul esi,[idx]
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.normal_array] ;esi = &context.normal_array[ idx * (3 + context.normal_array_stride) ]
|
||||
mov edi,edx
|
||||
add edi,GLContext.current_normal
|
||||
movsd ;context.current_normal.X = context.normal_array[i]
|
||||
movsd
|
||||
movsd
|
||||
mov dword[edi],0.0 ;context.current_normal.W = 0.0f
|
||||
@@:
|
||||
bt dword[states],3 ;2^3=TEXCOORD_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.texcoord_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.texcoord_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.texcoord_array] ;esi = &context.texcoord_array[i]
|
||||
mov edi,edx
|
||||
add edi,GLContext.current_tex_coord
|
||||
movsd ;context.current_tex_coord.X = ccontext.texcoord_array[i]
|
||||
movsd
|
||||
cmp dword[size],2
|
||||
jle .e3
|
||||
movsd
|
||||
jmp .e4
|
||||
.e3:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
.e4:
|
||||
cmp dword[size],3
|
||||
jle .e5
|
||||
movsd
|
||||
jmp @f
|
||||
.e5:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
@@:
|
||||
bt dword[states],0 ;2^0=VERTEX_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.vertex_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.vertex_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.vertex_array] ;esi = &context.vertex_array[i]
|
||||
mov edi,ebp
|
||||
sub edi,28 ;edi = &p[1]
|
||||
movsd ;p[1].f = context.vertex_array[i]
|
||||
movsd
|
||||
cmp dword[size],2
|
||||
jle .e6
|
||||
movsd
|
||||
jmp .e7
|
||||
.e6:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
jmp .e8 ;и 4-й тоже ставим по умолчанию
|
||||
.e7:
|
||||
cmp dword[size],3
|
||||
jle .e8
|
||||
movsd
|
||||
sub edi,20 ;edi=&p[0]
|
||||
jmp .e9
|
||||
.e8:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
sub edi,16 ;edi=&p[0]
|
||||
.e9:
|
||||
stdcall glopVertex, edx,edi
|
||||
@@:
|
||||
call CopyArrayElementByIndex
|
||||
inc dword[idx]
|
||||
inc dword[vi]
|
||||
jmp .cycle_0
|
||||
.cycle_0_end:
|
||||
loop .cycle_0
|
||||
@@:
|
||||
|
||||
;mov eax,ebp
|
||||
;sub eax,32 ;=sizeof(dd)*8
|
||||
lea eax,[ebp-32] ;=sizeof(dd)*8
|
||||
stdcall glopEnd, edx,eax
|
||||
popad
|
||||
ret
|
||||
@@ -299,8 +181,7 @@ endl
|
||||
mov eax,[count]
|
||||
mov dword[p+12],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,16 ;=sizeof(dd)*4
|
||||
lea eax,[ebp-16] ;=sizeof(dd)*4
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -308,12 +189,12 @@ endp
|
||||
align 4
|
||||
proc glopDrawElements, context:dword, param:dword
|
||||
locals
|
||||
type dd ?
|
||||
indices dd ? ;указатель на 16 или 32 битные индексы
|
||||
ii dd ?
|
||||
idx dd ?
|
||||
states dd ?
|
||||
type dd ?
|
||||
size dd ?
|
||||
indices dd ? ;указатель на 16 или 32 битные индексы
|
||||
a_size dd ?
|
||||
p rd 8
|
||||
endl
|
||||
pushad
|
||||
@@ -328,8 +209,7 @@ pushad
|
||||
mov [type],eax ;type = param[3].i
|
||||
mov eax,[ebx+16]
|
||||
mov [indices],eax ;*indices = param[4].p
|
||||
mov eax,ebp
|
||||
sub eax,32 ;=sizeof(dd)*8
|
||||
lea eax,[ebp-32] ;=sizeof(dd)*8
|
||||
stdcall glopBegin, edx,eax
|
||||
|
||||
mov dword[ii],0
|
||||
@@ -351,127 +231,133 @@ align 4
|
||||
.end_0:
|
||||
mov [idx],esi
|
||||
|
||||
bt dword[states],1 ;2^1=COLOR_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.color_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.color_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.color_array] ;esi = &context.color_array[i]
|
||||
mov edi,ebp
|
||||
sub edi,28 ;edi = &p[1]
|
||||
mov ebx,[esi+8]
|
||||
mov [edi],ebx ;p[1].f = context.color_array[i+2]
|
||||
mov ebx,[esi+4]
|
||||
mov [edi+4],ebx ;p[2].f = context.color_array[i+1]
|
||||
mov ebx,[esi]
|
||||
mov [edi+8],ebx ;p[3].f = context.color_array[i]
|
||||
add edi,12
|
||||
cmp dword[size],3
|
||||
jle .e1
|
||||
add esi,12
|
||||
movsd
|
||||
jmp .e2
|
||||
.e1:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
.e2:
|
||||
mov edi,ebp
|
||||
sub edi,32 ;edi = &p[0]
|
||||
mov ebx,ebp
|
||||
sub ebx,12 ;ebp-12 = &p[5]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-8 = &p[6]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-4 = &p[7]
|
||||
push ebx
|
||||
stdcall RGBFtoRGBI,[edi+12],[edi+8],[edi+4] ;call: r,g,b,&p[7],&p[6],&p[5]
|
||||
stdcall glopColor, edx,edi ;(context, p(op,rf,gf,bf,af,ri,gi,bi))
|
||||
@@:
|
||||
bt dword[states],2 ;2^2=NORMAL_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.normal_array_stride]
|
||||
add esi,3
|
||||
imul esi,[idx] ;esi = idx * (3 + context.normal_array_stride)
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.normal_array]
|
||||
mov edi,edx
|
||||
add edi,GLContext.current_normal
|
||||
movsd ;context.current_normal.X = context.normal_array[i]
|
||||
movsd
|
||||
movsd
|
||||
mov dword[edi],0.0 ;context.current_normal.W = 0.0f
|
||||
@@:
|
||||
bt dword[states],3 ;2^3=TEXCOORD_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.texcoord_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.texcoord_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.texcoord_array] ;esi = &context.texcoord_array[i]
|
||||
mov edi,edx
|
||||
add edi,GLContext.current_tex_coord
|
||||
movsd ;context.current_tex_coord.X = ccontext.texcoord_array[i]
|
||||
movsd
|
||||
cmp dword[size],2
|
||||
jle .e3
|
||||
movsd
|
||||
jmp .e4
|
||||
.e3:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
.e4:
|
||||
cmp dword[size],3
|
||||
jle .e5
|
||||
movsd
|
||||
jmp @f
|
||||
.e5:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
@@:
|
||||
bt dword[states],0 ;2^0=VERTEX_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.vertex_array_size]
|
||||
mov [size],esi
|
||||
add esi,[edx+GLContext.vertex_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.vertex_array] ;esi = &context.vertex_array[i]
|
||||
mov edi,ebp
|
||||
sub edi,28 ;edi = &p[1]
|
||||
movsd ;p[1].f = context.vertex_array[i]
|
||||
movsd
|
||||
cmp dword[size],2
|
||||
jle .e6
|
||||
movsd
|
||||
jmp .e7
|
||||
.e6:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
jmp .e8 ;и 4-й тоже ставим по умолчанию
|
||||
.e7:
|
||||
cmp dword[size],3
|
||||
jle .e8
|
||||
movsd
|
||||
sub edi,20 ;edi=&p[0]
|
||||
jmp .e9
|
||||
.e8:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
sub edi,16 ;edi=&p[0]
|
||||
.e9:
|
||||
stdcall glopVertex, edx,edi
|
||||
@@:
|
||||
call CopyArrayElementByIndex
|
||||
inc dword[ii]
|
||||
jmp .cycle_0
|
||||
.cycle_0_end:
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,32 ;=sizeof(dd)*8
|
||||
lea eax,[ebp-32] ;=sizeof(dd)*8
|
||||
stdcall glopEnd, edx,eax
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
; edx - GLContext
|
||||
idx equ ebp-44
|
||||
states equ ebp-40
|
||||
a_size equ ebp-36
|
||||
align 4
|
||||
CopyArrayElementByIndex:
|
||||
bt dword[states],1 ;2^1=COLOR_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.color_array_size]
|
||||
mov [a_size],esi
|
||||
add esi,[edx+GLContext.color_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.color_array] ;esi = &context.color_array[i]
|
||||
lea edi,[ebp-28] ;edi = &p[1]
|
||||
mov ebx,[esi+8]
|
||||
mov [edi],ebx ;p[1].f = context.color_array[i+2]
|
||||
mov ebx,[esi+4]
|
||||
mov [edi+4],ebx ;p[2].f = context.color_array[i+1]
|
||||
mov ebx,[esi]
|
||||
mov [edi+8],ebx ;p[3].f = context.color_array[i]
|
||||
add edi,12
|
||||
cmp dword[a_size],3
|
||||
jle .e1
|
||||
add esi,12
|
||||
movsd
|
||||
jmp .e2
|
||||
.e1:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
.e2:
|
||||
lea edi,[ebp-32] ;edi = &p[0]
|
||||
lea ebx,[ebp-12] ;ebp-12 = &p[5]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-8 = &p[6]
|
||||
push ebx
|
||||
add ebx,4 ;ebp-4 = &p[7]
|
||||
push ebx
|
||||
stdcall RGBFtoRGBI,[edi+12],[edi+8],[edi+4] ;call: r,g,b,&p[7],&p[6],&p[5]
|
||||
stdcall glopColor, edx,edi ;(context, p(op,rf,gf,bf,af,ri,gi,bi))
|
||||
@@:
|
||||
bt dword[states],2 ;2^2=NORMAL_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.normal_array_stride]
|
||||
add esi,3
|
||||
imul esi,[idx] ;esi = idx * (3 + context.normal_array_stride)
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.normal_array] ;esi = &context.normal_array[ idx * (3 + context.normal_array_stride) ]
|
||||
lea edi,[edx+GLContext.current_normal]
|
||||
movsd ;context.current_normal.X = context.normal_array[i]
|
||||
movsd
|
||||
movsd
|
||||
mov dword[edi],0.0 ;context.current_normal.W = 0.0f
|
||||
@@:
|
||||
bt dword[states],3 ;2^3=TEXCOORD_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.texcoord_array_size]
|
||||
mov [a_size],esi
|
||||
add esi,[edx+GLContext.texcoord_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.texcoord_array] ;esi = &context.texcoord_array[i]
|
||||
lea edi,[edx+GLContext.current_tex_coord]
|
||||
movsd ;context.current_tex_coord.X = ccontext.texcoord_array[i]
|
||||
movsd
|
||||
cmp dword[a_size],2
|
||||
jle .e3
|
||||
movsd
|
||||
jmp .e4
|
||||
.e3:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
.e4:
|
||||
cmp dword[a_size],3
|
||||
jle .e5
|
||||
movsd
|
||||
jmp @f
|
||||
.e5:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
@@:
|
||||
bt dword[states],0 ;2^0=VERTEX_ARRAY
|
||||
jnc @f
|
||||
mov esi,[edx+GLContext.vertex_array_size]
|
||||
mov [a_size],esi
|
||||
add esi,[edx+GLContext.vertex_array_stride]
|
||||
imul esi,[idx] ;esi = i
|
||||
shl esi,2
|
||||
add esi,[edx+GLContext.vertex_array] ;esi = &context.vertex_array[i]
|
||||
lea edi,[ebp-28] ;edi = &p[1]
|
||||
movsd ;p[1].f = context.vertex_array[i]
|
||||
movsd
|
||||
cmp dword[a_size],2
|
||||
jle .e6
|
||||
movsd
|
||||
jmp .e7
|
||||
.e6:
|
||||
mov dword[edi],0.0 ;если задано 2 параметра, то 3-й ставим по умолчанию 0.0
|
||||
add edi,4
|
||||
jmp .e8 ;и 4-й тоже ставим по умолчанию
|
||||
.e7:
|
||||
cmp dword[a_size],3
|
||||
jle .e8
|
||||
movsd
|
||||
sub edi,20 ;edi=&p[0]
|
||||
jmp .e9
|
||||
.e8:
|
||||
mov dword[edi],1.0 ;если задано 3 параметра, то 4-й ставим по умолчанию 1.0
|
||||
sub edi,16 ;edi=&p[0]
|
||||
.e9:
|
||||
stdcall glopVertex, edx,edi
|
||||
@@:
|
||||
ret
|
||||
purge idx
|
||||
purge states
|
||||
purge a_size
|
||||
|
||||
align 4
|
||||
proc glDrawElements uses eax, mode:dword, count:dword, type:dword, indices:dword
|
||||
locals
|
||||
@@ -488,8 +374,7 @@ endl
|
||||
mov eax,[indices]
|
||||
mov dword[p+16],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,20 ;=sizeof(dd)*5
|
||||
lea eax,[ebp-20] ;=sizeof(dd)*5
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -533,8 +418,7 @@ endl
|
||||
;assert(0);
|
||||
.end_f:
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,8 ;=sizeof(dd)*2
|
||||
lea eax,[ebp-8] ;=sizeof(dd)*2
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -578,8 +462,7 @@ endl
|
||||
;assert(0);
|
||||
.end_f:
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,8 ;=sizeof(dd)*2
|
||||
lea eax,[ebp-8] ;=sizeof(dd)*2
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -612,8 +495,7 @@ endl
|
||||
mov eax,[pointer]
|
||||
mov dword[p+12],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,16 ;=sizeof(dd)*4
|
||||
lea eax,[ebp-16] ;=sizeof(dd)*4
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -646,8 +528,7 @@ endl
|
||||
mov eax,[pointer]
|
||||
mov dword[p+12],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,16 ;=sizeof(dd)*4
|
||||
lea eax,[ebp-16] ;=sizeof(dd)*4
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -676,8 +557,7 @@ endl
|
||||
mov eax,[pointer]
|
||||
mov dword[p+8],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,12 ;=sizeof(dd)*3
|
||||
lea eax,[ebp-12] ;=sizeof(dd)*3
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
@@ -710,8 +590,7 @@ endl
|
||||
mov eax,[pointer]
|
||||
mov dword[p+12],eax
|
||||
|
||||
mov eax,ebp
|
||||
sub eax,16 ;=sizeof(dd)*4
|
||||
lea eax,[ebp-16] ;=sizeof(dd)*4
|
||||
stdcall gl_add_op,eax
|
||||
ret
|
||||
endp
|
||||
|
@@ -21,7 +21,7 @@ proc gl_transform_to_viewport uses eax ebx ecx, context:dword,v:dword
|
||||
fmul st0,st1
|
||||
fmul dword[eax+GLContext.viewport+GLViewport.scale+offs_X]
|
||||
fadd dword[eax+GLContext.viewport+GLViewport.trans+offs_X]
|
||||
fistp dword[ebx+GLVertex.zp] ;v.zp.x = st0, st0 = st1
|
||||
fistp dword[ebx+GLVertex.zp+ZBufferPoint.x] ;v.zp.x = st0, st0 = st1
|
||||
|
||||
fld dword[ebx+GLVertex.pc+offs_Y] ;st0 = v.pc.Y
|
||||
fmul st0,st1
|
||||
@@ -62,14 +62,14 @@ align 4
|
||||
je @f
|
||||
mov eax,[eax+GLContext.current_texture] ;eax = &context.current_texture
|
||||
mov eax,[eax] ;eax = context.current_texture
|
||||
;[eax+offs_text_images] = im = &context.current_texture.images[0]
|
||||
;[eax+GLTexture.images] = im = &context.current_texture.images[0]
|
||||
|
||||
fild dword[eax+offs_text_images+offs_imag_s_bound]
|
||||
fild dword[eax+GLTexture.images+GLImage.s_bound]
|
||||
fmul dword[ebx+GLVertex.tex_coord+offs_X]
|
||||
fistp dword[ebx+GLVertex.zp+ZBufferPoint.s]
|
||||
;v.zp.s=(int)(v.tex_coord.X * im.s_bound)
|
||||
|
||||
fild dword[eax+offs_text_images+offs_imag_t_bound]
|
||||
fild dword[eax+GLTexture.images+GLImage.t_bound]
|
||||
fmul dword[ebx+GLVertex.tex_coord+offs_Y]
|
||||
fistp dword[ebx+GLVertex.zp+ZBufferPoint.t]
|
||||
;v.zp.t=(int)(v.tex_coord.Y * im.t_bound)
|
||||
@@ -138,12 +138,12 @@ macro interpolate q, p0, p1, t
|
||||
{
|
||||
fld dword[t]
|
||||
|
||||
; интерполяция по координатам
|
||||
fld dword[p1+GLVertex.pc]
|
||||
fsub dword[p0+GLVertex.pc]
|
||||
; interpolation by coordinates
|
||||
fld dword[p1+GLVertex.pc+offs_X]
|
||||
fsub dword[p0+GLVertex.pc+offs_X]
|
||||
fmul st0,st1
|
||||
fadd dword[p0+GLVertex.pc]
|
||||
fstp dword[q+GLVertex.pc] ;q.pc.X = p0.pc.X + (p1.pc.X - p0.pc.X) * t
|
||||
fadd dword[p0+GLVertex.pc+offs_X]
|
||||
fstp dword[q+GLVertex.pc+offs_X] ;q.pc.X = p0.pc.X + (p1.pc.X - p0.pc.X) * t
|
||||
|
||||
fld dword[p1+GLVertex.pc+offs_Y]
|
||||
fsub dword[p0+GLVertex.pc+offs_Y]
|
||||
@@ -163,7 +163,7 @@ macro interpolate q, p0, p1, t
|
||||
fadd dword[p0+GLVertex.pc+offs_W]
|
||||
fstp dword[q+GLVertex.pc+offs_W]
|
||||
|
||||
; интерполяция по цвету
|
||||
; color interpolation
|
||||
fld dword[p1+GLVertex.color]
|
||||
fsub dword[p0+GLVertex.color]
|
||||
fmul st0,st1
|
||||
@@ -228,7 +228,7 @@ align 4
|
||||
fstsw ax
|
||||
sahf
|
||||
jae .r1_f1
|
||||
fstp dword[ebx] ;if (t<*tmin) *tmax=t
|
||||
fstp dword[ebx] ;if (t<*tmax) *tmax=t
|
||||
jmp .r1
|
||||
align 4
|
||||
.els_1: ;else if (num>0)
|
||||
@@ -1028,9 +1028,11 @@ if PROFILE eq 1
|
||||
end if
|
||||
mov eax,[edx+GLContext.current_texture]
|
||||
mov eax,[eax] ;переход по указателю
|
||||
;так как offs_text_images+offs_imag_pixmap = 0 то context.current_texture.images[0].pixmap = [eax]
|
||||
stdcall ZB_setTexture, [edx+GLContext.zb], [eax],\
|
||||
[eax+offs_imag_s_bound],[eax+offs_imag_t_bound],[eax+offs_imag_xsize_log2]
|
||||
stdcall ZB_setTexture, [edx+GLContext.zb],\
|
||||
[eax+GLTexture.images+GLImage.pixmap],\
|
||||
[eax+GLTexture.images+GLImage.s_bound],\
|
||||
[eax+GLTexture.images+GLImage.t_bound],\
|
||||
[eax+GLTexture.images+GLImage.xsize_log2]
|
||||
mov eax,[p0]
|
||||
add eax,GLVertex.zp
|
||||
push ecx
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Gears - 3D gear wheels
|
||||
; Copyright (C) 2014-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,6 +12,7 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include 'fps.inc'
|
||||
|
||||
@@ -18,7 +23,7 @@ macro matr_cell c_funct,c_param,funct,param, dia
|
||||
dia dword[esp-4*(c_param*(c_funct-funct)+(1+c_param-param))]
|
||||
}
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
;Macro for double type parameters (8 bytes)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
@@ -83,8 +88,7 @@ red_win:
|
||||
mov ebx,200
|
||||
@@:
|
||||
sub ebx,10
|
||||
stdcall reshape, ebx,eax
|
||||
.end0:
|
||||
stdcall reshape, ebx,eax
|
||||
|
||||
align 16
|
||||
still:
|
||||
@@ -165,8 +169,7 @@ draw_window:
|
||||
|
||||
;Title
|
||||
mcall SF_DRAW_TEXT,(338 shl 16)+4,0xc0c0c0,fps, fps.end-fps
|
||||
mcall SF_DRAW_TEXT,(8 shl 16)+4,0xc0c0c0,title3,title3.end-title3
|
||||
;mcall SF_DRAW_TEXT,(180 shl 16)+4,0xc0c0c0,title2,title2.end-title2
|
||||
mcall SF_DRAW_TEXT,(8 shl 16)+4,0xc0c0c0,title2,title2.end-title2
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
@@ -247,9 +250,7 @@ button:
|
||||
align 4
|
||||
title1: db 'TinyGL in KolibriOS'
|
||||
.end: db 0
|
||||
;title2: db 'F full screen'
|
||||
;.end: db 0
|
||||
title3: db 'ESC - exit, Arrow keys - rotate, +/- zoom, P - pause'
|
||||
title2: db 'ESC - exit, Arrow keys - rotate, +/- zoom, P - pause'
|
||||
.end: db 0
|
||||
fps: db 'FPS:'
|
||||
.end: db 0
|
||||
@@ -922,8 +923,7 @@ name_tgl db 'tinygl.obj',0
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
procinfo process_information
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
|
@@ -12,6 +12,15 @@ include '../opengl_const.inc'
|
||||
|
||||
@use_library
|
||||
|
||||
;Constants describing the house.3ds file (obtained using the info_3ds program)
|
||||
VERTICES_OFFSET = 0x33 ;offset along which the coordinates of the vertices go
|
||||
FACES_COUNT = 0x162 ;number of faces
|
||||
FACES_OFFSET = 0x96b ;offset along which information about the edges goes
|
||||
|
||||
HOUSE_FILE_SIZE = 5297
|
||||
txt_error_file_size db '"House.3ds file size does not match" -tE',0
|
||||
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
@@ -20,20 +29,20 @@ start:
|
||||
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
;заполняем массив индексов из файла house.3ds (который вшит внутрь данной программы)
|
||||
;we fill the array of indices from the house.3ds file (which is embedded inside this program)
|
||||
mov esi,house_3ds
|
||||
add esi,0x1798 ;смещение по которому идет информация о гранях в файле 3ds (получено с использованием программы info_3ds)
|
||||
add esi,FACES_OFFSET
|
||||
mov edi,Indices
|
||||
mov eax,0x1a6 ;число граней в файле 3ds (получено с использованием программы info_3ds)
|
||||
mov eax,FACES_COUNT
|
||||
@@:
|
||||
movsd
|
||||
movsw
|
||||
add esi,2 ;пропускаем свойства грани
|
||||
add esi,2 ;skip face properties
|
||||
dec eax
|
||||
or eax,eax
|
||||
jnz @b
|
||||
|
||||
;первоначальные настройки контекста tinygl
|
||||
;tinygl initial context settings
|
||||
stdcall [kosglMakeCurrent], 10,10,400,350,ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glClearColor], 0.0,0.0,0.0,0.0
|
||||
@@ -48,13 +57,13 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
@@ -140,29 +149,34 @@ caption db 'Test opengl 1.1 arrays, [Esc] - exit, [<-],[->],[Up],[Down] - rotate
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;clear the color and depth buffer
|
||||
mov eax,house_3ds.end-house_3ds
|
||||
cmp eax,HOUSE_FILE_SIZE
|
||||
je @f
|
||||
notify_window_run txt_error_file_size
|
||||
ret
|
||||
@@:
|
||||
call [glPushMatrix]
|
||||
|
||||
;масштаб и повороты
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
;scale and rotations
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
|
||||
;рисование через индексный массив
|
||||
mov eax,house_3ds ;начало внедренного файла 3ds
|
||||
add eax,0xeb ;смещение по которому идут координаты вершин (получено с использованием программы info_3ds)
|
||||
stdcall [glVertexPointer], 3, GL_FLOAT, 0, eax ;задаем массив для вершин, 3 - число координат для одной вершины
|
||||
stdcall [glEnableClientState], GL_VERTEX_ARRAY ;включаем режим рисования вершин
|
||||
stdcall [glDrawElements], GL_TRIANGLES, 0x1a6*3, GL_UNSIGNED_SHORT, Indices ;mode, count, type, *indices
|
||||
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;отключаем режим рисования вершин
|
||||
;drawing via index array
|
||||
mov eax,house_3ds ;start of embedded 3ds file
|
||||
add eax,VERTICES_OFFSET
|
||||
stdcall [glVertexPointer], 3, GL_FLOAT, 0, eax ;we set an array for the vertices, 3 is the number of coordinates for one vertex
|
||||
stdcall [glEnableClientState], GL_VERTEX_ARRAY ;turn on the vertex drawing mode
|
||||
stdcall [glDrawElements], GL_TRIANGLES, FACES_COUNT*3, GL_UNSIGNED_SHORT, Indices ;mode, count, type, *indices
|
||||
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;disable vertex drawing mode
|
||||
|
||||
call [glPopMatrix]
|
||||
ret
|
||||
|
||||
align 4
|
||||
scale dd 0.0065 ;начальный масштаб (в идеальном случае должен вычислятся, но для даного примера подобран в ручную на глаз)
|
||||
scale dd 0.07 ;initial scale (ideally should be calculated)
|
||||
delt_sc dd 0.0005
|
||||
angle_z dd 90.0
|
||||
angle_y dd 90.0
|
||||
@@ -170,10 +184,11 @@ angle_x dd 0.0
|
||||
delt_size dd 3.0
|
||||
|
||||
align 4
|
||||
house_3ds: ;внедряем файл внутрь программы (в идеальном случае должен открыватся через окно диалога, но для облегчения примера вшит внутрь)
|
||||
house_3ds: ;we embed the file inside the program (ideally it should open through a dialog box)
|
||||
file '../../../../../demos/view3ds/3ds_objects/House.3ds'
|
||||
.end:
|
||||
align 4
|
||||
Indices rb 0x1a6*6 ;0x1a6 - число граней, на каждую грань по 3 точки, индекс точки 2 байта
|
||||
Indices rb FACES_COUNT*6 ;3 points per edge, point index 2 bytes
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Test glu0 - gluSphere functionality testing
|
||||
; Copyright (C) 2014-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,6 +12,7 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@use_library
|
||||
@@ -36,13 +41,13 @@ red_win:
|
||||
align 16
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
@@ -131,9 +136,6 @@ button:
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
|
||||
align 4
|
||||
caption db 'Test gluSphere, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
@@ -141,25 +143,37 @@ stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим б
|
||||
stdcall [glColor3f], 1.0, 1.0, 0.0
|
||||
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [gluSphere], [qObj], 1.0, 16,16
|
||||
push 16
|
||||
push 16
|
||||
glpush rad1
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 1.0, 0.0, 0.0
|
||||
stdcall [glTranslatef], -1.6,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 8,8
|
||||
push 8
|
||||
push 8
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 0.0, 0.0, 1.0
|
||||
stdcall [glTranslatef], 3.2,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 8,8
|
||||
push 8
|
||||
push 8
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
call [glPopMatrix]
|
||||
ret
|
||||
|
||||
align 4
|
||||
qObj dd 0
|
||||
caption db 'Test gluSphere, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.55
|
||||
|
||||
scale dd 0.4
|
||||
delt_sc dd 0.05
|
||||
@@ -173,13 +187,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -190,7 +208,8 @@ name_tgl db 'tinygl.obj',0
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
qObj dd 0
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 2048
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Test glu1 - gluCylinder and gluDisk functionality testing
|
||||
; Copyright (C) 2014-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,24 +12,24 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
3d_wnd_l equ 0 ;tinygl buffer left indent
|
||||
3d_wnd_t equ 30 ;tinygl buffer top indent
|
||||
3d_wnd_w equ 500
|
||||
3d_wnd_h equ 400
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;проверка на сколько удачно загузились библиотеки
|
||||
;checking how successfully the libraries were loaded
|
||||
mov ebp,lib_0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
@@ -39,16 +43,24 @@ load_libraries l_libs_start,l_libs_end
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
finit
|
||||
fild dword[buf_ogl.w]
|
||||
fdiv dword[fl_180]
|
||||
fstp dword[angle_dzm]
|
||||
fild dword[buf_ogl.h]
|
||||
fdiv dword[fl_180]
|
||||
fstp dword[angle_dym]
|
||||
|
||||
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов
|
||||
stdcall [glEnable], GL_NORMALIZE ;normals of the same size to avoid artifacts
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
|
||||
stdcall [glClearColor], 0.25,0.25,0.25,0.0
|
||||
stdcall [glShadeModel], GL_SMOOTH
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -60,6 +72,15 @@ load_libraries l_libs_start,l_libs_end
|
||||
stdcall [buf2d_convert_text_matrix], buf_1
|
||||
|
||||
load_image_file 'toolb_1.png', image_data_toolbar
|
||||
|
||||
fld dword[scale]
|
||||
stdcall update_number, txt_scale.v
|
||||
fld dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
fld dword[angle_z]
|
||||
stdcall update_number, txt_angle_z.v
|
||||
|
||||
call SetLight
|
||||
call draw_3d
|
||||
|
||||
align 4
|
||||
@@ -69,19 +90,30 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,EV_MOUSE
|
||||
jne still
|
||||
call mouse
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov ebx,[buf_ogl.w]
|
||||
add ebx,(50 shl 16)+9
|
||||
mov ecx,[buf_ogl.h]
|
||||
add ecx,(30 shl 16)+4
|
||||
add ecx,eax
|
||||
add cx,[buf_ogl.t]
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffff,,caption
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;вершины вкл.
|
||||
@@ -128,11 +160,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -143,11 +171,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -158,11 +182,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -173,11 +193,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
;jmp still
|
||||
@@ -220,6 +236,104 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
mouse:
|
||||
push eax ebx
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
|
||||
bt eax,0
|
||||
jnc .end_m
|
||||
;mouse l. but. move
|
||||
cmp dword[mouse_drag],1
|
||||
jne .end_m
|
||||
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
sar ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
jg @f
|
||||
mov ebx,3d_wnd_l
|
||||
@@:
|
||||
sub ebx,3d_wnd_l
|
||||
cmp ebx,3d_wnd_w
|
||||
jle @f
|
||||
mov ebx,3d_wnd_w
|
||||
@@:
|
||||
movsx eax,ax ;mouse.y
|
||||
cmp eax,3d_wnd_t
|
||||
jg @f
|
||||
mov eax,3d_wnd_t
|
||||
@@:
|
||||
sub eax,3d_wnd_t
|
||||
cmp eax,3d_wnd_h
|
||||
jle @f
|
||||
mov eax,3d_wnd_h
|
||||
@@:
|
||||
finit
|
||||
fild dword[mouse_y]
|
||||
mov [mouse_y],eax
|
||||
fisub dword[mouse_y]
|
||||
fdiv dword[angle_dzm] ;if the cursor moves along the y-axis (up or down)
|
||||
fadd dword[angle_z]
|
||||
fst dword[angle_z]
|
||||
stdcall update_number, txt_angle_z.v
|
||||
|
||||
fild dword[mouse_x]
|
||||
mov [mouse_x],ebx
|
||||
fisub dword[mouse_x]
|
||||
fdiv dword[angle_dym] ;if the cursor moves along the z-axis (left or right)
|
||||
fadd dword[angle_y]
|
||||
fst dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp .end_d
|
||||
.end_m:
|
||||
bt eax,16
|
||||
jnc @f
|
||||
;mouse l. but. up
|
||||
mov dword[mouse_drag],0
|
||||
jmp .end_d
|
||||
@@:
|
||||
bt eax,8
|
||||
jnc .end_d
|
||||
;mouse l. but. press
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
sar ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
jl .end_d
|
||||
sub ebx,3d_wnd_l
|
||||
cmp ebx,3d_wnd_w
|
||||
jg .end_d
|
||||
movsx eax,ax ;mouse.y
|
||||
cmp eax,3d_wnd_t
|
||||
jl .end_d
|
||||
sub eax,3d_wnd_t
|
||||
cmp eax,3d_wnd_h
|
||||
jg .end_d
|
||||
mov dword[mouse_drag],1
|
||||
mov dword[mouse_x],ebx
|
||||
mov dword[mouse_y],eax
|
||||
.end_d:
|
||||
|
||||
pop ebx eax
|
||||
ret
|
||||
|
||||
;input:
|
||||
; st0 - number
|
||||
; txt_addr - pointer to text buffer
|
||||
align 4
|
||||
proc update_number uses eax, txt_addr:dword
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov eax,[txt_addr]
|
||||
mov byte[eax],0
|
||||
stdcall str_cat, eax,Data_String
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_st_point:
|
||||
stdcall [gluQuadricDrawStyle], [qObj],GLU_POINT
|
||||
@@ -255,11 +369,7 @@ but_zoom_p:
|
||||
fld dword[sc_max]
|
||||
@@:
|
||||
fst dword[scale]
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_scale.v],0
|
||||
stdcall str_cat, txt_scale.v,Data_String
|
||||
stdcall update_number, txt_scale.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
@@ -278,50 +388,54 @@ but_zoom_m:
|
||||
fld dword[sc_min]
|
||||
@@:
|
||||
fst dword[scale]
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_scale.v],0
|
||||
stdcall str_cat, txt_scale.v,Data_String
|
||||
stdcall update_number, txt_scale.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
caption db 'Test gluCylinder, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.55
|
||||
rad3 dq 0.15
|
||||
hei1 dq 2.0 ;высота цилиндра
|
||||
hei2 dq 1.25
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
|
||||
call [glPushMatrix]
|
||||
call SetLight
|
||||
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
stdcall [glScalef], 1.0, 1.0, 0.5
|
||||
|
||||
stdcall [glColor3f], 1.0, 1.0, 0.0
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glTranslatef], 0.0,0.0,-1.0 ;опускаем цилинды вниз
|
||||
stdcall [gluCylinder], [qObj], rad1,rad1,hei1, 32,8
|
||||
push 8
|
||||
push 32
|
||||
glpush hei1
|
||||
glpush rad1
|
||||
glpush rad1
|
||||
stdcall [gluCylinder], [qObj]
|
||||
|
||||
stdcall [glTranslatef], 0.0,0.0,2.0
|
||||
push 4
|
||||
push 32
|
||||
glpush rad1
|
||||
glpush rad3
|
||||
stdcall [gluDisk], [qObj]
|
||||
|
||||
stdcall [glColor3f], 1.0, 0.0, 0.0
|
||||
stdcall [glTranslatef], -1.6,0.0,0.0
|
||||
stdcall [gluCylinder], [qObj], rad2,rad3,hei2, 16,8
|
||||
stdcall [glTranslatef], -1.6,0.0,-2.0
|
||||
push 8
|
||||
push 16
|
||||
glpush hei2
|
||||
glpush rad3
|
||||
glpush rad2
|
||||
stdcall [gluCylinder], [qObj]
|
||||
|
||||
stdcall [glColor3f], 0.0, 0.0, 1.0
|
||||
stdcall [glTranslatef], 3.2,0.0,0.0
|
||||
stdcall [gluCylinder], [qObj], rad2,rad3,hei2, 16,8
|
||||
push 8
|
||||
push 16
|
||||
glpush hei2
|
||||
glpush rad3
|
||||
glpush rad2
|
||||
stdcall [gluCylinder], [qObj]
|
||||
call [glPopMatrix]
|
||||
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00
|
||||
@@ -347,10 +461,22 @@ SetLight:
|
||||
stdcall [glEnable],GL_LIGHT0
|
||||
ret
|
||||
|
||||
scale dd 0.4 ;начальный масштаб
|
||||
sc_delt dd 0.05 ;изменение масштаба при нажатии
|
||||
sc_min dd 0.1 ;минимальный масштаб
|
||||
sc_max dd 1.1 ;максимальный масштаб
|
||||
align 4
|
||||
caption db 'Test gluCylinder and gluDisk, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.55
|
||||
rad3 dq 0.15
|
||||
hei1 dq 2.0 ;высота цилиндра
|
||||
hei2 dq 1.25
|
||||
|
||||
fl_180 dd 180.0
|
||||
|
||||
scale dd 0.4 ;initial scale
|
||||
sc_delt dd 0.05 ;zoom on click
|
||||
sc_min dd 0.1 ;minimum scale
|
||||
sc_max dd 1.1 ;maximum scale
|
||||
angle_z dd -45.0
|
||||
angle_y dd -150.0
|
||||
delt_size dd 3.0
|
||||
@@ -369,13 +495,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -493,28 +623,23 @@ lib_name_2 db 'libimg.obj',0
|
||||
|
||||
txt_scale:
|
||||
db 'Scale: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_z:
|
||||
db 'Rotate z: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_y:
|
||||
db 'Rotate y: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
align 4
|
||||
buf_ogl:
|
||||
dd 0 ;указатель на буфер изображения
|
||||
dw 10,10 ;+4 left,top
|
||||
.w: dd 400
|
||||
.h: dd 350
|
||||
dw 3d_wnd_l ;+4 left
|
||||
.t: dw 3d_wnd_t ;+6 top
|
||||
.w: dd 3d_wnd_w
|
||||
.h: dd 3d_wnd_h
|
||||
dd 0,24 ;+16 color,bit in pixel
|
||||
|
||||
align 4
|
||||
@@ -533,9 +658,14 @@ l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
mouse_drag dd 0 ;scene rotation mode based on mouse cursor movement
|
||||
mouse_x dd 0
|
||||
mouse_y dd 0
|
||||
angle_dzm dd 0 ;~ 3d_wnd_w/180 - adding scene rotation angles when rotating the mouse
|
||||
angle_dym dd 0 ;~ 3d_wnd_h/180
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Test glu2 - gluSphere functionality testing
|
||||
; Copyright (C) 2015-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,24 +12,24 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
3d_wnd_l equ 0 ;tinygl buffer left indent
|
||||
3d_wnd_t equ 30 ;tinygl buffer top indent
|
||||
3d_wnd_w equ 500
|
||||
3d_wnd_h equ 400
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;проверка на сколько удачно загузились библиотеки
|
||||
;checking how successfully the libraries were loaded
|
||||
mov ebp,lib_0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
@@ -39,16 +43,24 @@ load_libraries l_libs_start,l_libs_end
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
finit
|
||||
fild dword[buf_ogl.w]
|
||||
fdiv dword[fl_180]
|
||||
fstp dword[angle_dzm]
|
||||
fild dword[buf_ogl.h]
|
||||
fdiv dword[fl_180]
|
||||
fstp dword[angle_dym]
|
||||
|
||||
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов
|
||||
stdcall [glEnable], GL_NORMALIZE ;normals of the same size to avoid artifacts
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
|
||||
stdcall [glClearColor], 0.25,0.25,0.25,0.0
|
||||
stdcall [glShadeModel], GL_SMOOTH
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -60,6 +72,15 @@ load_libraries l_libs_start,l_libs_end
|
||||
stdcall [buf2d_convert_text_matrix], buf_1
|
||||
|
||||
load_image_file 'toolb_1.png', image_data_toolbar
|
||||
|
||||
fld dword[scale]
|
||||
stdcall update_number, txt_scale.v
|
||||
fld dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
fld dword[angle_z]
|
||||
stdcall update_number, txt_angle_z.v
|
||||
|
||||
call SetLight
|
||||
call draw_3d
|
||||
|
||||
align 4
|
||||
@@ -69,19 +90,30 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,EV_MOUSE
|
||||
jne still
|
||||
call mouse
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov ebx,[buf_ogl.w]
|
||||
add ebx,(50 shl 16)+9
|
||||
mov ecx,[buf_ogl.h]
|
||||
add ecx,(30 shl 16)+4
|
||||
add ecx,eax
|
||||
add cx,[buf_ogl.t]
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffff,,caption
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;вершины вкл.
|
||||
@@ -128,11 +160,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -143,11 +171,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -158,11 +182,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp still
|
||||
@@ -173,11 +193,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
;jmp still
|
||||
@@ -220,6 +236,104 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
mouse:
|
||||
push eax ebx
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
|
||||
bt eax,0
|
||||
jnc .end_m
|
||||
;mouse l. but. move
|
||||
cmp dword[mouse_drag],1
|
||||
jne .end_m
|
||||
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
sar ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
jg @f
|
||||
mov ebx,3d_wnd_l
|
||||
@@:
|
||||
sub ebx,3d_wnd_l
|
||||
cmp ebx,3d_wnd_w
|
||||
jle @f
|
||||
mov ebx,3d_wnd_w
|
||||
@@:
|
||||
movsx eax,ax ;mouse.y
|
||||
cmp eax,3d_wnd_t
|
||||
jg @f
|
||||
mov eax,3d_wnd_t
|
||||
@@:
|
||||
sub eax,3d_wnd_t
|
||||
cmp eax,3d_wnd_h
|
||||
jle @f
|
||||
mov eax,3d_wnd_h
|
||||
@@:
|
||||
finit
|
||||
fild dword[mouse_y]
|
||||
mov [mouse_y],eax
|
||||
fisub dword[mouse_y]
|
||||
fdiv dword[angle_dzm] ;if the cursor moves along the y-axis (up or down)
|
||||
fadd dword[angle_z]
|
||||
fst dword[angle_z]
|
||||
stdcall update_number, txt_angle_z.v
|
||||
|
||||
fild dword[mouse_x]
|
||||
mov [mouse_x],ebx
|
||||
fisub dword[mouse_x]
|
||||
fdiv dword[angle_dym] ;if the cursor moves along the z-axis (left or right)
|
||||
fadd dword[angle_y]
|
||||
fst dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
jmp .end_d
|
||||
.end_m:
|
||||
bt eax,16
|
||||
jnc @f
|
||||
;mouse l. but. up
|
||||
mov dword[mouse_drag],0
|
||||
jmp .end_d
|
||||
@@:
|
||||
bt eax,8
|
||||
jnc .end_d
|
||||
;mouse l. but. press
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
sar ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
jl .end_d
|
||||
sub ebx,3d_wnd_l
|
||||
cmp ebx,3d_wnd_w
|
||||
jg .end_d
|
||||
movsx eax,ax ;mouse.y
|
||||
cmp eax,3d_wnd_t
|
||||
jl .end_d
|
||||
sub eax,3d_wnd_t
|
||||
cmp eax,3d_wnd_h
|
||||
jg .end_d
|
||||
mov dword[mouse_drag],1
|
||||
mov dword[mouse_x],ebx
|
||||
mov dword[mouse_y],eax
|
||||
.end_d:
|
||||
|
||||
pop ebx eax
|
||||
ret
|
||||
|
||||
;input:
|
||||
; st0 - number
|
||||
; txt_addr - pointer to text buffer
|
||||
align 4
|
||||
proc update_number uses eax, txt_addr:dword
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov eax,[txt_addr]
|
||||
mov byte[eax],0
|
||||
stdcall str_cat, eax,Data_String
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_st_point:
|
||||
stdcall [gluQuadricDrawStyle], [qObj],GLU_POINT
|
||||
@@ -255,11 +369,7 @@ but_zoom_p:
|
||||
fld dword[sc_max]
|
||||
@@:
|
||||
fst dword[scale]
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_scale.v],0
|
||||
stdcall str_cat, txt_scale.v,Data_String
|
||||
stdcall update_number, txt_scale.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
@@ -278,41 +388,40 @@ but_zoom_m:
|
||||
fld dword[sc_min]
|
||||
@@:
|
||||
fst dword[scale]
|
||||
mov word[NumberSymbolsAD],3
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_scale.v],0
|
||||
stdcall str_cat, txt_scale.v,Data_String
|
||||
stdcall update_number, txt_scale.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
caption db 'Test gluSphere, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
|
||||
call [glPushMatrix]
|
||||
call SetLight
|
||||
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
|
||||
stdcall [glColor3f], 1.0, 1.0, 0.0
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [gluSphere], [qObj], 1.0, 32,32
|
||||
push 32
|
||||
push 32
|
||||
glpush rad1
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 1.0, 0.0, 0.0
|
||||
stdcall [glTranslatef], -1.6,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 16,16
|
||||
push 16
|
||||
push 16
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 0.0, 0.0, 1.0
|
||||
stdcall [glTranslatef], 3.2,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 16,16
|
||||
push 16
|
||||
push 16
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
call [glPopMatrix]
|
||||
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00
|
||||
@@ -338,10 +447,19 @@ SetLight:
|
||||
stdcall [glEnable],GL_LIGHT0
|
||||
ret
|
||||
|
||||
scale dd 0.4 ;начальный масштаб
|
||||
sc_delt dd 0.05 ;изменение масштаба при нажатии
|
||||
sc_min dd 0.1 ;минимальный масштаб
|
||||
sc_max dd 1.1 ;максимальный масштаб
|
||||
align 4
|
||||
caption db 'Test gluSphere, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.55
|
||||
|
||||
fl_180 dd 180.0
|
||||
|
||||
scale dd 0.4 ;initial scale
|
||||
sc_delt dd 0.05 ;zoom on click
|
||||
sc_min dd 0.1 ;minimum scale
|
||||
sc_max dd 1.1 ;maximum scale
|
||||
angle_z dd 0.0
|
||||
angle_y dd 0.0
|
||||
delt_size dd 3.0
|
||||
@@ -360,13 +478,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -484,28 +606,23 @@ lib_name_2 db 'libimg.obj',0
|
||||
|
||||
txt_scale:
|
||||
db 'Scale: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_z:
|
||||
db 'Rotate z: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_y:
|
||||
db 'Rotate y: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
align 4
|
||||
buf_ogl:
|
||||
dd 0 ;указатель на буфер изображения
|
||||
dw 10,10 ;+4 left,top
|
||||
.w: dd 400
|
||||
.h: dd 350
|
||||
dw 3d_wnd_l ;+4 left
|
||||
.t: dw 3d_wnd_t ;+6 top
|
||||
.w: dd 3d_wnd_w
|
||||
.h: dd 3d_wnd_h
|
||||
dd 0,24 ;+16 color,bit in pixel
|
||||
|
||||
align 4
|
||||
@@ -524,9 +641,14 @@ l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
mouse_drag dd 0 ;scene rotation mode based on mouse cursor movement
|
||||
mouse_x dd 0
|
||||
mouse_y dd 0
|
||||
angle_dzm dd 0 ;~ 3d_wnd_w/180 - adding scene rotation angles when rotating the mouse
|
||||
angle_dym dd 0 ;~ 3d_wnd_h/180
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Textures0 - example of texture mapping on a sphere and cube
|
||||
; Copyright (C) 2015-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,24 +12,24 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
3d_wnd_l equ 0 ;tinygl buffer left indent
|
||||
3d_wnd_t equ 30 ;tinygl buffer top indent
|
||||
3d_wnd_w equ 500
|
||||
3d_wnd_h equ 400
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;проверка на сколько удачно загузились библиотеки
|
||||
;checking how successfully the libraries were loaded
|
||||
mov ebp,lib_0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
@@ -39,9 +43,9 @@ load_libraries l_libs_start,l_libs_end
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов
|
||||
stdcall [glEnable], GL_NORMALIZE ;normals of the same size to avoid artifacts
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
stdcall [gluQuadricTexture], eax,GL_TRUE
|
||||
@@ -49,7 +53,7 @@ load_libraries l_libs_start,l_libs_end
|
||||
stdcall [glClearColor], 0.25,0.25,0.25,0.0
|
||||
stdcall [glShadeModel], GL_SMOOTH
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -63,6 +67,11 @@ load_libraries l_libs_start,l_libs_end
|
||||
load_image_file 'toolb_1.png', image_data_toolbar
|
||||
load_image_file 'text_1.png', texture, text_w,text_h ;открытие файла текстуры
|
||||
|
||||
fld dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
fld dword[angle_z]
|
||||
stdcall update_number, txt_angle_z.v
|
||||
|
||||
;* Setup texturing *
|
||||
stdcall [glTexEnvi], GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL
|
||||
|
||||
@@ -88,19 +97,27 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov ebx,[buf_ogl.w]
|
||||
add ebx,(50 shl 16)+9
|
||||
mov ecx,[buf_ogl.h]
|
||||
add ecx,(30 shl 16)+4
|
||||
add ecx,eax
|
||||
add cx,[buf_ogl.t]
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffff,,caption
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;сферы
|
||||
@@ -144,11 +161,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -158,11 +171,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -172,11 +181,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -186,11 +191,7 @@ key:
|
||||
fld dword[angle_z]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_z]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_z.v],0
|
||||
stdcall str_cat, txt_angle_z.v,Data_String
|
||||
stdcall update_number, txt_angle_z.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -227,6 +228,20 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
;input:
|
||||
; st0 - number
|
||||
; txt_addr - pointer to text buffer
|
||||
align 4
|
||||
proc update_number uses eax, txt_addr:dword
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov eax,[txt_addr]
|
||||
mov byte[eax],0
|
||||
stdcall str_cat, eax,Data_String
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_dr_0:
|
||||
mov dword[dr_figure],0
|
||||
@@ -287,15 +302,12 @@ but_zoom_m:
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
@@ -304,15 +316,24 @@ cmp dword[dr_figure],0
|
||||
jne @f
|
||||
; рисование сфер
|
||||
stdcall [glColor3f], 1.0, 1.0, 0.0
|
||||
stdcall [gluSphere], [qObj], 1.0, 32,32
|
||||
push 32
|
||||
push 32
|
||||
glpush rad1
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 1.0, 0.0, 0.0
|
||||
stdcall [glTranslatef], -1.6,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 16,16
|
||||
push 16
|
||||
push 16
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
|
||||
stdcall [glColor3f], 0.0, 0.0, 1.0
|
||||
stdcall [glTranslatef], 3.2,0.0,0.0
|
||||
stdcall [gluSphere], [qObj], 0.55, 16,16
|
||||
push 16
|
||||
push 16
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj]
|
||||
@@:
|
||||
cmp dword[dr_figure],1
|
||||
jne @f
|
||||
@@ -388,6 +409,13 @@ call [glPopMatrix]
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_y,5,25,0xffff00
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.55
|
||||
|
||||
scale dd 0.4 ;начальный масштаб
|
||||
sc_delt dd 0.05 ;изменение масштаба при нажатии
|
||||
sc_min dd 0.1 ;минимальный масштаб
|
||||
@@ -410,13 +438,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -534,28 +566,23 @@ lib_name_2 db 'libimg.obj',0
|
||||
|
||||
txt_scale:
|
||||
db 'Scale: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_z:
|
||||
db 'Rotate z: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_y:
|
||||
db 'Rotate y: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
align 4
|
||||
buf_ogl:
|
||||
dd 0 ;указатель на буфер изображения
|
||||
dw 10,10 ;+4 left,top
|
||||
.w: dd 400
|
||||
.h: dd 350
|
||||
dw 3d_wnd_l ;+4 left
|
||||
.t: dw 3d_wnd_t ;+6 top
|
||||
.w: dd 3d_wnd_w
|
||||
.h: dd 3d_wnd_h
|
||||
dd 0,24 ;+16 color,bit in pixel
|
||||
|
||||
align 4
|
||||
@@ -574,7 +601,7 @@ l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
image_data_toolbar dd 0
|
||||
dr_figure dd 0
|
||||
qObj dd 0
|
||||
|
@@ -1,3 +1,8 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Textures1 - drawing the earth with and without meridians.
|
||||
; Texture size 1024*512 pixels is used.
|
||||
; Copyright (C) 2015-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,24 +13,24 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
3d_wnd_l equ 0 ;tinygl buffer left indent
|
||||
3d_wnd_t equ 30 ;tinygl buffer top indent
|
||||
3d_wnd_w equ 450
|
||||
3d_wnd_h equ 400
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;проверка на сколько удачно загузились библиотеки
|
||||
;checking how successfully the libraries were loaded
|
||||
mov ebp,lib_0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
@@ -39,9 +44,9 @@ load_libraries l_libs_start,l_libs_end
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов
|
||||
stdcall [glEnable], GL_NORMALIZE ;normals of the same size to avoid artifacts
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
stdcall [gluQuadricTexture], eax,GL_TRUE
|
||||
@@ -49,7 +54,7 @@ load_libraries l_libs_start,l_libs_end
|
||||
stdcall [glClearColor], 0.0,0.0,0.0,0.0
|
||||
stdcall [glShadeModel], GL_SMOOTH
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -63,6 +68,11 @@ load_libraries l_libs_start,l_libs_end
|
||||
load_image_file 'toolb_1.png', image_data_toolbar
|
||||
load_image_file 'text_2.png', texture, text_w,text_h ;открытие файла текстуры
|
||||
|
||||
fld dword[angle_x]
|
||||
stdcall update_number, txt_angle_x.v
|
||||
fld dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
|
||||
;* Setup texturing *
|
||||
stdcall [glTexEnvi], GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL
|
||||
|
||||
@@ -88,19 +98,27 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov ebx,[buf_ogl.w]
|
||||
add ebx,(50 shl 16)+9
|
||||
mov ecx,[buf_ogl.h]
|
||||
add ecx,(30 shl 16)+4
|
||||
add ecx,eax
|
||||
add cx,[buf_ogl.t]
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffff,,caption
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;земля с меридиан.
|
||||
@@ -146,11 +164,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -160,11 +174,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -174,11 +184,7 @@ key:
|
||||
fld dword[angle_x]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_x]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_x.v],0
|
||||
stdcall str_cat, txt_angle_x.v,Data_String
|
||||
stdcall update_number, txt_angle_x.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -188,11 +194,7 @@ key:
|
||||
fld dword[angle_x]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_x]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_x.v],0
|
||||
stdcall str_cat, txt_angle_x.v,Data_String
|
||||
stdcall update_number, txt_angle_x.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -229,6 +231,20 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
;input:
|
||||
; st0 - number
|
||||
; txt_addr - pointer to text buffer
|
||||
align 4
|
||||
proc update_number uses eax, txt_addr:dword
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov eax,[txt_addr]
|
||||
mov byte[eax],0
|
||||
stdcall str_cat, eax,Data_String
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_dr_0:
|
||||
mov dword[dr_figure],0
|
||||
@@ -289,34 +305,40 @@ but_zoom_m:
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
stdcall [glScalef], 1.0, 1.0, 0.1 ;прижимаем сферу, что-бы сразу не вылазила при увеличении
|
||||
stdcall [glScalef], 1.0, 1.0, 0.2 ;прижимаем сферу, что-бы сразу не вылазила при увеличении
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
|
||||
cmp dword[dr_figure],0
|
||||
jne @f
|
||||
; рисование земли с меридианами
|
||||
; drawing earth with meridians
|
||||
stdcall [glColor3f], 0.0, 0.0, 1.0
|
||||
stdcall [gluQuadricDrawStyle], [qObj],GLU_LINE
|
||||
stdcall [gluSphere], [qObj], 1.0, 24,18 ;меридианы
|
||||
push 18
|
||||
push 24
|
||||
glpush rad1
|
||||
stdcall [gluSphere], [qObj] ;meridians
|
||||
stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL
|
||||
stdcall [gluSphere], [qObj], 0.995, 24,18 ;земля
|
||||
push 24
|
||||
push 18
|
||||
glpush rad2
|
||||
stdcall [gluSphere], [qObj] ;Earth
|
||||
@@:
|
||||
cmp dword[dr_figure],1
|
||||
jne @f
|
||||
; рисование земли
|
||||
; drawing the earth
|
||||
stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL
|
||||
stdcall [gluSphere], [qObj], 1.0, 64,64
|
||||
push 64
|
||||
push 64
|
||||
glpush rad1
|
||||
stdcall [gluSphere], [qObj]
|
||||
@@:
|
||||
call [glPopMatrix]
|
||||
|
||||
@@ -325,6 +347,13 @@ call [glPopMatrix]
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_x,5,25,0xffff00
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
rad1 dq 1.0
|
||||
rad2 dq 0.995
|
||||
|
||||
scale dd 0.95 ;начальный масштаб
|
||||
sc_delt dd 0.05 ;изменение масштаба при нажатии
|
||||
sc_min dd 0.1 ;минимальный масштаб
|
||||
@@ -340,13 +369,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -464,34 +497,27 @@ lib_name_2 db 'libimg.obj',0
|
||||
|
||||
txt_scale:
|
||||
db 'Scale: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_z:
|
||||
db 'Rotate z: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_x:
|
||||
db 'Rotate x: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_y:
|
||||
db 'Rotate y: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
align 4
|
||||
buf_ogl:
|
||||
dd 0 ;указатель на буфер изображения
|
||||
dw 10,10 ;+4 left,top
|
||||
.w: dd 400
|
||||
.h: dd 350
|
||||
dw 3d_wnd_l ;+4 left
|
||||
.t: dw 3d_wnd_t ;+6 top
|
||||
.w: dd 3d_wnd_w
|
||||
.h: dd 3d_wnd_h
|
||||
dd 0,24 ;+16 color,bit in pixel
|
||||
|
||||
align 4
|
||||
@@ -510,7 +536,7 @@ l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
image_data_toolbar dd 0
|
||||
dr_figure dd 0
|
||||
qObj dd 0
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Textures2 - example of creating a spherical panorama using texture
|
||||
; Copyright (C) 2015-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,24 +12,24 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
3d_wnd_l equ 0 ;tinygl buffer left indent
|
||||
3d_wnd_t equ 30 ;tinygl buffer top indent
|
||||
3d_wnd_w equ 450
|
||||
3d_wnd_h equ 400
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;проверка на сколько удачно загузились библиотеки
|
||||
;checking how successfully the libraries were loaded
|
||||
mov ebp,lib_0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
@@ -39,9 +43,9 @@ load_libraries l_libs_start,l_libs_end
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов
|
||||
stdcall [glEnable], GL_NORMALIZE ;normals of the same size to avoid artifacts
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
stdcall [gluQuadricDrawStyle], eax,GLU_FILL
|
||||
@@ -50,7 +54,7 @@ load_libraries l_libs_start,l_libs_end
|
||||
stdcall [glClearColor], 0.0,0.0,0.0,0.0
|
||||
stdcall [glShadeModel], GL_SMOOTH
|
||||
|
||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||
mov eax,[ctx1.gl_context]
|
||||
mov eax,[eax] ;eax -> ZBuffer
|
||||
mov eax,[eax+ZBuffer.pbuf]
|
||||
mov dword[buf_ogl],eax
|
||||
@@ -64,6 +68,11 @@ load_libraries l_libs_start,l_libs_end
|
||||
load_image_file 'toolb_1.png', image_data_toolbar
|
||||
load_image_file 'text_3.png', texture, text_w,text_h ;открытие файла текстуры
|
||||
|
||||
fld dword[angle_x]
|
||||
stdcall update_number, txt_angle_x.v
|
||||
fld dword[angle_y]
|
||||
stdcall update_number, txt_angle_y.v
|
||||
|
||||
;* Setup texturing *
|
||||
stdcall [glTexEnvi], GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL
|
||||
|
||||
@@ -89,19 +98,27 @@ red_win:
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
jmp still
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov ebx,[buf_ogl.w]
|
||||
add ebx,(50 shl 16)+9
|
||||
mov ecx,[buf_ogl.h]
|
||||
add ecx,(30 shl 16)+4
|
||||
add ecx,eax
|
||||
add cx,[buf_ogl.t]
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffff,,caption
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;масштаб +
|
||||
@@ -141,11 +158,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -155,11 +168,7 @@ key:
|
||||
fld dword[angle_y]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_y]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_y.v],0
|
||||
stdcall str_cat, txt_angle_y.v,Data_String
|
||||
stdcall update_number, txt_angle_y.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -169,11 +178,7 @@ key:
|
||||
fld dword[angle_x]
|
||||
fadd dword[delt_size]
|
||||
fst dword[angle_x]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_x.v],0
|
||||
stdcall str_cat, txt_angle_x.v,Data_String
|
||||
stdcall update_number, txt_angle_x.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -183,11 +188,7 @@ key:
|
||||
fld dword[angle_x]
|
||||
fsub dword[delt_size]
|
||||
fst dword[angle_x]
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov byte[txt_angle_x.v],0
|
||||
stdcall str_cat, txt_angle_x.v,Data_String
|
||||
stdcall update_number, txt_angle_x.v
|
||||
call draw_3d
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
@@ -214,6 +215,20 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
;input:
|
||||
; st0 - number
|
||||
; txt_addr - pointer to text buffer
|
||||
align 4
|
||||
proc update_number uses eax, txt_addr:dword
|
||||
mov word[NumberSymbolsAD],2
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
mov eax,[txt_addr]
|
||||
mov byte[eax],0
|
||||
stdcall str_cat, eax,Data_String
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_zoom_p:
|
||||
finit
|
||||
@@ -260,21 +275,25 @@ but_zoom_m:
|
||||
call [kosglSwapBuffers]
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
|
||||
call [glPushMatrix]
|
||||
stdcall [glTranslatef], 0.0,0.0,-1.0 ;двигаем сферу на себя, что-бы отсечь переднюю часть
|
||||
stdcall [glScalef], [scale], [scale], [scale]
|
||||
stdcall [glScalef], 1.0, 1.0, 0.1 ;прижимаем сферу, что-бы сразу не вылазила при увеличении
|
||||
stdcall [glScalef], 1.0, 1.0, 0.2 ;прижимаем сферу, что-бы сразу не вылазила при увеличении
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
|
||||
; рисование панорамы
|
||||
stdcall [gluSphere], [qObj], 1.0, 64,64
|
||||
push 64
|
||||
push 64
|
||||
add esp,-8
|
||||
fld1
|
||||
fstp qword[esp]
|
||||
stdcall [gluSphere], [qObj]
|
||||
call [glPopMatrix]
|
||||
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00
|
||||
@@ -282,6 +301,10 @@ call [glPopMatrix]
|
||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_x,5,25,0xffff00
|
||||
ret
|
||||
|
||||
align 4
|
||||
caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
|
||||
align 4
|
||||
scale dd 1.5 ;начальный масштаб
|
||||
sc_delt dd 0.05 ;изменение масштаба при нажатии
|
||||
sc_min dd 0.95 ;минимальный масштаб
|
||||
@@ -297,13 +320,17 @@ import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
@@ -421,34 +448,27 @@ lib_name_2 db 'libimg.obj',0
|
||||
|
||||
txt_scale:
|
||||
db 'Scale: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_z:
|
||||
db 'Rotate z: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_x:
|
||||
db 'Rotate x: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
txt_angle_y:
|
||||
db 'Rotate y: '
|
||||
.v:
|
||||
db 0
|
||||
rb 10
|
||||
.v: rb 11
|
||||
|
||||
align 4
|
||||
buf_ogl:
|
||||
dd 0 ;указатель на буфер изображения
|
||||
dw 10,10 ;+4 left,top
|
||||
.w: dd 400
|
||||
.h: dd 350
|
||||
dw 3d_wnd_l ;+4 left
|
||||
.t: dw 3d_wnd_t ;+6 top
|
||||
.w: dd 3d_wnd_w
|
||||
.h: dd 3d_wnd_h
|
||||
dd 0,24 ;+16 color,bit in pixel
|
||||
|
||||
align 4
|
||||
@@ -467,7 +487,7 @@ l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
|
||||
|
@@ -168,7 +168,8 @@ E_LIB gluQuadricDrawStyle
|
||||
E_LIB gluQuadricOrientation
|
||||
E_LIB gluQuadricTexture
|
||||
E_LIB gluCylinder ;(GLUquadricObj, double, double, double, int, int)
|
||||
E_LIB gluSphere ;(GLUquadricObj, float, int, int)
|
||||
E_LIB gluDisk ;(GLUquadricObj, double, double, int, int)
|
||||
E_LIB gluSphere ;(GLUquadricObj, double, int, int)
|
||||
|
||||
;
|
||||
; KolibriOS functions
|
||||
|
@@ -6,29 +6,9 @@ struct GLUquadricObj
|
||||
ErrorFunc dd ? ; Error handler callback function
|
||||
ends
|
||||
|
||||
offs_qobj_DrawStyle equ 0
|
||||
offs_qobj_Orientation equ 4
|
||||
offs_qobj_TextureFlag equ 8
|
||||
offs_qobj_Normals equ 12
|
||||
offs_qobj_ErrorFunc equ 16
|
||||
|
||||
;Так как некоторые извращенческие функции OpenGL воспринимают только параметры
|
||||
;типа double (8 байт) то придется пихать их в стек макросом glpush
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
;void drawTorus(float rc, int numc, float rt, int numt)
|
||||
;{
|
||||
;}
|
||||
|
||||
;static void normal3f(GLfloat x, GLfloat y, GLfloat z )
|
||||
;{
|
||||
;}
|
||||
|
||||
align 4
|
||||
an360f dd 360.0
|
||||
fl_0_5 dd 0.5
|
||||
fl_360 dd 360.0
|
||||
|
||||
align 16
|
||||
proc gluPerspective, fovy:qword, aspect:qword, zNear:qword, zFar:qword
|
||||
@@ -40,7 +20,7 @@ locals
|
||||
endl
|
||||
fldpi
|
||||
fmul qword[fovy]
|
||||
fdiv dword[an360f]
|
||||
fdiv dword[fl_360]
|
||||
fptan
|
||||
ffree st0 ;выкидываем 1.0 которая осталось после вычисления тангенса
|
||||
fincstp
|
||||
@@ -76,11 +56,11 @@ gluNewQuadric:
|
||||
stdcall gl_malloc, sizeof.GLUquadricObj
|
||||
or eax,eax
|
||||
jz @f
|
||||
mov dword[eax+offs_qobj_DrawStyle],GLU_FILL
|
||||
mov dword[eax+offs_qobj_Orientation],GLU_OUTSIDE
|
||||
mov dword[eax+offs_qobj_TextureFlag],GL_FALSE
|
||||
mov dword[eax+offs_qobj_Normals],GLU_SMOOTH
|
||||
mov dword[eax+offs_qobj_ErrorFunc],0 ;NULL
|
||||
mov dword[eax+GLUquadricObj.DrawStyle],GLU_FILL
|
||||
mov dword[eax+GLUquadricObj.Orientation],GLU_OUTSIDE
|
||||
mov dword[eax+GLUquadricObj.TextureFlag],GL_FALSE
|
||||
mov dword[eax+GLUquadricObj.Normals],GLU_SMOOTH
|
||||
mov dword[eax+GLUquadricObj.ErrorFunc],0 ;NULL
|
||||
@@:
|
||||
ret
|
||||
|
||||
@@ -114,7 +94,7 @@ proc gluQuadricDrawStyle uses eax ebx, qobj:dword, drawStyle:dword
|
||||
jmp .err_q
|
||||
align 4
|
||||
@@:
|
||||
mov dword[eax+offs_qobj_DrawStyle],ebx
|
||||
mov dword[eax+GLUquadricObj.DrawStyle],ebx
|
||||
jmp @f
|
||||
align 4
|
||||
.err_q:
|
||||
@@ -139,7 +119,7 @@ proc gluQuadricOrientation uses eax ebx, qobj:dword, orientation:dword
|
||||
jmp .err_q
|
||||
align 4
|
||||
@@:
|
||||
mov dword[eax+offs_qobj_Orientation],ebx
|
||||
mov dword[eax+GLUquadricObj.Orientation],ebx
|
||||
jmp @f
|
||||
align 4
|
||||
.err_q:
|
||||
@@ -159,7 +139,7 @@ proc gluQuadricTexture uses eax ebx, qobj:dword, texture:dword
|
||||
cmp ebx,GL_FALSE
|
||||
je @f
|
||||
@@:
|
||||
mov dword[eax+offs_qobj_TextureFlag],ebx
|
||||
mov dword[eax+GLUquadricObj.TextureFlag],ebx
|
||||
jmp @f
|
||||
align 4
|
||||
.err_q:
|
||||
@@ -169,7 +149,7 @@ align 4
|
||||
endp
|
||||
|
||||
align 16
|
||||
proc gluCylinder qobj:dword, baseRadius:dword, topRadius:dword, height:dword,\
|
||||
proc gluCylinder qobj:dword, baseRadius:qword, topRadius:qword, height:qword,\
|
||||
slices:dword, stacks:dword
|
||||
locals
|
||||
da dq ? ;double
|
||||
@@ -193,7 +173,7 @@ endl
|
||||
pushad
|
||||
mov edx,[qobj]
|
||||
fld1
|
||||
cmp dword[edx+offs_qobj_Orientation],GLU_INSIDE
|
||||
cmp dword[edx+GLUquadricObj.Orientation],GLU_INSIDE
|
||||
jne @f
|
||||
fchs
|
||||
@@:
|
||||
@@ -203,14 +183,12 @@ pushad
|
||||
fadd st0,st0
|
||||
fidiv dword[slices]
|
||||
fstp qword[da] ;da = 2.0*M_PI / slices
|
||||
mov ebx,[topRadius]
|
||||
fld qword[ebx]
|
||||
mov ecx,[baseRadius]
|
||||
fsub qword[ecx]
|
||||
fld qword[topRadius]
|
||||
fsub qword[baseRadius]
|
||||
fld st0 ;copy: topRadius-baseRadius
|
||||
fidiv dword[stacks]
|
||||
fstp qword[dr] ;dr = (topRadius-baseRadius) / stacks
|
||||
mov eax,[height]
|
||||
lea eax,[height]
|
||||
fld qword[eax]
|
||||
fidiv dword[stacks]
|
||||
fstp qword[dz] ;dz = height / stacks
|
||||
@@ -218,7 +196,7 @@ pushad
|
||||
fdiv qword[eax]
|
||||
fstp dword[nz] ;nz = (baseRadius-topRadius) / height ; Z component of normal vectors
|
||||
|
||||
cmp dword[edx+offs_qobj_DrawStyle],GLU_POINT
|
||||
cmp dword[edx+GLUquadricObj.DrawStyle],GLU_POINT
|
||||
jne .else0
|
||||
stdcall glBegin,GL_POINTS
|
||||
mov ebx,[slices]
|
||||
@@ -245,8 +223,7 @@ align 4
|
||||
call glNormal3f ;x*nsign, y*nsign, nz*nsign
|
||||
|
||||
mov dword[z],0.0
|
||||
mov ecx,[baseRadius]
|
||||
fld qword[ecx]
|
||||
fld qword[baseRadius]
|
||||
fstp qword[r] ;r = baseRadius
|
||||
mov ecx,[stacks]
|
||||
inc ecx
|
||||
@@ -277,16 +254,15 @@ align 4
|
||||
call glEnd
|
||||
jmp .end_f
|
||||
.else0:
|
||||
cmp dword[edx+offs_qobj_DrawStyle],GLU_LINE
|
||||
cmp dword[edx+GLUquadricObj.DrawStyle],GLU_LINE
|
||||
je @f
|
||||
cmp dword[edx+offs_qobj_DrawStyle],GLU_SILHOUETTE
|
||||
cmp dword[edx+GLUquadricObj.DrawStyle],GLU_SILHOUETTE
|
||||
je .else2
|
||||
jmp .else1
|
||||
@@:
|
||||
; Draw rings
|
||||
mov dword[z],0.0
|
||||
mov ecx,[baseRadius]
|
||||
fld qword[ecx]
|
||||
fld qword[baseRadius]
|
||||
fstp qword[r] ;r = baseRadius
|
||||
mov ecx,[stacks]
|
||||
inc ecx
|
||||
@@ -342,28 +318,100 @@ align 4
|
||||
align 4
|
||||
.else2:
|
||||
; draw one ring at each end
|
||||
; if (baseRadius!=0.0) {
|
||||
lea ecx,[baseRadius]
|
||||
fld qword[ecx]
|
||||
ftst
|
||||
fnstsw ax
|
||||
ffree st0
|
||||
fincstp
|
||||
sahf
|
||||
je .rad_b0
|
||||
stdcall glBegin,GL_LINE_LOOP
|
||||
mov ebx,[slices]
|
||||
mov dword[i],0
|
||||
align 4
|
||||
.cycle_4: ;for (i=0;i<slices;i++)
|
||||
; {
|
||||
; x = cos(i*da);
|
||||
; y = sin(i*da);
|
||||
; normal3f( x*nsign, y*nsign, nz*nsign );
|
||||
; glVertex3f( x*baseRadius, y*baseRadius, 0.0 );
|
||||
; }
|
||||
cmp [i],ebx
|
||||
jge .cycle_4_end
|
||||
fild dword[i]
|
||||
fmul qword[da]
|
||||
fld st0
|
||||
fcos
|
||||
fstp dword[x] ;x = cos(i*da)
|
||||
fsin
|
||||
fstp dword[y] ;y = sin(i*da)
|
||||
fld dword[nsign]
|
||||
fmul dword[nz]
|
||||
fstp dword[esp-4]
|
||||
fld dword[nsign]
|
||||
fmul dword[y]
|
||||
fstp dword[esp-8]
|
||||
fld dword[nsign]
|
||||
fmul dword[x]
|
||||
fstp dword[esp-12]
|
||||
add esp,-12
|
||||
call glNormal3f ;x*nsign, y*nsign, nz*nsign
|
||||
push 0.0
|
||||
fld qword[ecx]
|
||||
fmul dword[y]
|
||||
fstp dword[esp-4]
|
||||
fld qword[ecx]
|
||||
fmul dword[x]
|
||||
fstp dword[esp-8]
|
||||
add esp,-8
|
||||
call glVertex3f ;x*baseRadius, y*baseRadius, 0.0
|
||||
inc dword[i]
|
||||
jmp .cycle_4
|
||||
.cycle_4_end:
|
||||
call glEnd
|
||||
.rad_b0:
|
||||
lea ecx,[topRadius]
|
||||
fld qword[ecx]
|
||||
ftst
|
||||
fnstsw ax
|
||||
ffree st0
|
||||
fincstp
|
||||
sahf
|
||||
je .else2_end
|
||||
stdcall glBegin,GL_LINE_LOOP
|
||||
mov ebx,[slices]
|
||||
mov dword[i],0
|
||||
align 4
|
||||
.cycle_5: ;for (i=0;i<slices;i++)
|
||||
; {
|
||||
; x = cos(i*da);
|
||||
; y = sin(i*da);
|
||||
; normal3f( x*nsign, y*nsign, nz*nsign );
|
||||
; glVertex3f( x*topRadius, y*topRadius, height );
|
||||
; }
|
||||
cmp [i],ebx
|
||||
jge .cycle_5_end
|
||||
fild dword[i]
|
||||
fmul qword[da]
|
||||
fld st0
|
||||
fcos
|
||||
fstp dword[x] ;x = cos(i*da)
|
||||
fsin
|
||||
fstp dword[y] ;y = sin(i*da)
|
||||
fld dword[nsign]
|
||||
fmul dword[nz]
|
||||
fstp dword[esp-4]
|
||||
fld dword[nsign]
|
||||
fmul dword[y]
|
||||
fstp dword[esp-8]
|
||||
fld dword[nsign]
|
||||
fmul dword[x]
|
||||
fstp dword[esp-12]
|
||||
add esp,-12
|
||||
call glNormal3f ;x*nsign, y*nsign, nz*nsign
|
||||
fld qword[height]
|
||||
fstp dword[esp-4]
|
||||
fld qword[ecx]
|
||||
fmul dword[y]
|
||||
fstp dword[esp-8]
|
||||
fld qword[ecx]
|
||||
fmul dword[x]
|
||||
fstp dword[esp-12]
|
||||
add esp,-12
|
||||
call glVertex3f ;x*topRadius, y*topRadius, height
|
||||
inc dword[i]
|
||||
jmp .cycle_5
|
||||
.cycle_5_end:
|
||||
call glEnd
|
||||
; }
|
||||
.else2_end:
|
||||
; draw length lines
|
||||
stdcall glBegin,GL_LINES
|
||||
@@ -390,8 +438,7 @@ align 4
|
||||
sub esp,12
|
||||
call glNormal3f ;x*nsign, y*nsign, nz*nsign
|
||||
mov dword[esp-4],0.0
|
||||
mov ecx,[baseRadius]
|
||||
fld qword[ecx]
|
||||
fld qword[baseRadius]
|
||||
fld st0
|
||||
fmul dword[y]
|
||||
fstp dword[esp-8]
|
||||
@@ -399,11 +446,9 @@ align 4
|
||||
fstp dword[esp-12]
|
||||
sub esp,12
|
||||
call glVertex3f ;x*baseRadius, y*baseRadius, 0.0
|
||||
mov eax,[height]
|
||||
fld qword[eax]
|
||||
fld qword[height]
|
||||
fstp dword[esp-4]
|
||||
mov ecx,[topRadius]
|
||||
fld qword[ecx]
|
||||
fld qword[topRadius]
|
||||
fld st0
|
||||
fmul dword[y]
|
||||
fstp dword[esp-8]
|
||||
@@ -419,7 +464,7 @@ align 4
|
||||
jmp .end_f
|
||||
align 4
|
||||
.else1:
|
||||
cmp dword[edx+offs_qobj_DrawStyle],GLU_FILL
|
||||
cmp dword[edx+GLUquadricObj.DrawStyle],GLU_FILL
|
||||
jne .end_f
|
||||
fld1
|
||||
fidiv dword[slices]
|
||||
@@ -453,8 +498,7 @@ align 4
|
||||
fchs
|
||||
fstp dword[x2] ;x2 = -sin((i+1)*da)
|
||||
mov dword[z],0.0
|
||||
mov ecx,[baseRadius]
|
||||
fld qword[ecx]
|
||||
fld qword[baseRadius]
|
||||
fstp qword[r] ;r = baseRadius
|
||||
mov dword[tcy],0.0
|
||||
stdcall glBegin,GL_QUAD_STRIP
|
||||
@@ -479,7 +523,7 @@ align 4
|
||||
fstp dword[esp-12]
|
||||
sub esp,12
|
||||
call glNormal3f ;x1*nsign, y1*nsign, nz*nsign
|
||||
cmp dword[edx+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, [tcx],[tcy]
|
||||
@@:
|
||||
@@ -504,7 +548,7 @@ align 4
|
||||
fstp dword[esp-12]
|
||||
sub esp,12
|
||||
call glNormal3f ;x2*nsign, y2*nsign, nz*nsign
|
||||
cmp dword[edx+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
push dword[tcy]
|
||||
fld dword[tcx]
|
||||
@@ -535,7 +579,7 @@ align 4
|
||||
fstp dword[esp-12]
|
||||
sub esp,12
|
||||
call glNormal3f ;x2*nsign, y2*nsign, nz*nsign
|
||||
cmp dword[edx+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, [tcx],[tcy]
|
||||
@@:
|
||||
@@ -560,7 +604,7 @@ align 4
|
||||
fstp dword[esp-12]
|
||||
sub esp,12
|
||||
call glNormal3f ;x1*nsign, y1*nsign, nz*nsign
|
||||
cmp dword[edx+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
push dword[tcy]
|
||||
fld dword[tcx]
|
||||
@@ -605,18 +649,164 @@ endp
|
||||
|
||||
; Disk (adapted from Mesa)
|
||||
|
||||
;void gluDisk(GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops )
|
||||
;{
|
||||
;}
|
||||
align 16
|
||||
proc gluDisk uses eax ebx ecx edx esi, qobj:dword,\
|
||||
innerRadius:qword, outerRadius:qword, slices:dword, loops:dword
|
||||
locals
|
||||
a dq ?
|
||||
da dq ?
|
||||
dr dd ?
|
||||
r1 dd ?
|
||||
r2 dd ?
|
||||
dtc dd ?
|
||||
s dd ? ;int
|
||||
sa dd ?
|
||||
ca dd ?
|
||||
endl
|
||||
;ebx = s
|
||||
;ecx = l
|
||||
;esi = slices
|
||||
mov ecx,[loops]
|
||||
cmp ecx,1
|
||||
jl .end_f
|
||||
mov esi,[slices]
|
||||
cmp esi,1
|
||||
jl .end_f
|
||||
|
||||
mov edx,[qobj]
|
||||
cmp dword[edx+GLUquadricObj.DrawStyle],GLU_FILL
|
||||
jne .no_fill
|
||||
fld1
|
||||
cmp dword[edx+GLUquadricObj.Orientation],GLU_OUTSIDE
|
||||
je @f
|
||||
fchs
|
||||
@@:
|
||||
add esp,-4
|
||||
fstp dword[esp]
|
||||
stdcall glNormal3f,0.0,0.0
|
||||
|
||||
fldpi
|
||||
fadd st0,st0
|
||||
fidiv dword[slices]
|
||||
fstp qword[da] ;da = 2.0*M_PI / slices
|
||||
fld qword[outerRadius]
|
||||
fsub qword[innerRadius]
|
||||
fild dword[loops]
|
||||
fdivp st1,st
|
||||
fstp dword[dr] ;dr = (outerRadius-innerRadius) / loops
|
||||
|
||||
; texture of a gluDisk is a cut out of the texture unit square
|
||||
; x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] (linear mapping)
|
||||
fld1
|
||||
fadd st0,st0
|
||||
fmul qword[outerRadius]
|
||||
fstp dword[dtc] ;dtc = 2.0*outerRadius
|
||||
fld qword[innerRadius]
|
||||
fstp dword[r1]
|
||||
|
||||
align 4
|
||||
.cycle_0: ;for (l=loops;l>0;l--)
|
||||
fld dword[r1]
|
||||
fadd dword[dr]
|
||||
fstp dword[r2] ;r2 = r1 + dr
|
||||
stdcall glBegin,GL_QUAD_STRIP
|
||||
xor ebx,ebx
|
||||
.cycle_1: ;for (s=0;s<=slices;s++)
|
||||
cmp esi,ebx
|
||||
jne .u1
|
||||
fldz
|
||||
fstp qword[a]
|
||||
jmp .u2
|
||||
align 4
|
||||
.u1:
|
||||
mov [s],ebx
|
||||
fild dword[s]
|
||||
fmul qword[da]
|
||||
fstp qword[a]
|
||||
.u2:
|
||||
fld qword[a]
|
||||
fld st0
|
||||
fsin
|
||||
fstp dword[sa] ;sa = sin(a)
|
||||
fcos
|
||||
fstp dword[ca] ;ca = cos(a)
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0
|
||||
je @f
|
||||
fld dword[ca]
|
||||
fmul dword[r2]
|
||||
fdiv dword[dtc]
|
||||
fadd dword[fl_0_5]
|
||||
fstp dword[esp-4]
|
||||
fld dword[sa]
|
||||
fmul dword[r2]
|
||||
fdiv dword[dtc]
|
||||
fadd dword[fl_0_5]
|
||||
add esp,-8
|
||||
fstp dword[esp]
|
||||
call glTexCoord2f ;0.5+sa*r2/dtc,0.5+ca*r2/dtc
|
||||
@@:
|
||||
fld dword[r2]
|
||||
fmul dword[ca]
|
||||
fstp dword[esp-4]
|
||||
fld dword[r2]
|
||||
fmul dword[sa]
|
||||
add esp,-8
|
||||
fstp dword[esp]
|
||||
call glVertex2f ;r2*sa, r2*ca
|
||||
|
||||
cmp dword[edx+GLUquadricObj.TextureFlag],0
|
||||
je @f
|
||||
fld dword[ca]
|
||||
fmul dword[r1]
|
||||
fdiv dword[dtc]
|
||||
fadd dword[fl_0_5]
|
||||
fstp dword[esp-4]
|
||||
fld dword[sa]
|
||||
fmul dword[r1]
|
||||
fdiv dword[dtc]
|
||||
fadd dword[fl_0_5]
|
||||
add esp,-8
|
||||
fstp dword[esp]
|
||||
call glTexCoord2f ;0.5+sa*r1/dtc,0.5+ca*r1/dtc
|
||||
@@:
|
||||
fld dword[r1]
|
||||
fmul dword[ca]
|
||||
fstp dword[esp-4]
|
||||
fld dword[r1]
|
||||
fmul dword[sa]
|
||||
add esp,-8
|
||||
fstp dword[esp]
|
||||
call glVertex2f ;r1*sa, r1*ca
|
||||
inc ebx
|
||||
cmp esi,ebx
|
||||
jge .cycle_1
|
||||
.cycle_1_end:
|
||||
call glEnd
|
||||
mov eax,[r2]
|
||||
mov [r1],eax
|
||||
dec ecx
|
||||
jnz .cycle_0
|
||||
jmp .end_f
|
||||
align 4
|
||||
.no_fill:
|
||||
push [loops]
|
||||
push [slices]
|
||||
sub esp,8
|
||||
fldz
|
||||
fstp qword[esp]
|
||||
glpush innerRadius
|
||||
glpush outerRadius
|
||||
stdcall gluCylinder, [qobj]
|
||||
.end_f:
|
||||
ret
|
||||
endp
|
||||
|
||||
;
|
||||
; Sphere (adapted from Mesa)
|
||||
;
|
||||
|
||||
;input:
|
||||
; float radius, int slices, int stacks
|
||||
; double radius, int slices, int stacks
|
||||
align 16
|
||||
proc gluSphere qobj:dword, radius:dword, slices:dword, stacks:dword
|
||||
proc gluSphere qobj:dword, radius:qword, slices:dword, stacks:dword
|
||||
locals
|
||||
rho dd ? ;float
|
||||
drho dd ?
|
||||
@@ -638,7 +828,7 @@ endl
|
||||
pushad
|
||||
|
||||
mov eax,[qobj]
|
||||
cmp dword[eax+offs_qobj_Normals],GLU_NONE ;if (qobj.Normals==GLU_NONE)
|
||||
cmp dword[eax+GLUquadricObj.Normals],GLU_NONE ;if (qobj.Normals==GLU_NONE)
|
||||
jne .els_0
|
||||
mov dword[normals],GL_FALSE
|
||||
jmp @f
|
||||
@@ -646,7 +836,7 @@ align 4
|
||||
.els_0:
|
||||
mov dword[normals],GL_TRUE
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_Orientation],GLU_INSIDE ;if (qobj.Orientation==GLU_INSIDE)
|
||||
cmp dword[eax+GLUquadricObj.Orientation],GLU_INSIDE ;if (qobj.Orientation==GLU_INSIDE)
|
||||
jne .els_1
|
||||
mov dword[nsign],-1.0
|
||||
jmp @f
|
||||
@@ -666,7 +856,7 @@ align 4
|
||||
ffree st0
|
||||
fincstp
|
||||
|
||||
cmp dword[eax+offs_qobj_DrawStyle],GLU_FILL ;if (qobj.DrawStyle==GLU_FILL)
|
||||
cmp dword[eax+GLUquadricObj.DrawStyle],GLU_FILL ;if (qobj.DrawStyle==GLU_FILL)
|
||||
jne .if_glu_line
|
||||
|
||||
; draw +Z end as a triangle fan
|
||||
@@ -675,13 +865,13 @@ align 4
|
||||
jne @f
|
||||
stdcall glNormal3f, 0.0, 0.0, 1.0
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, 0.5,1.0
|
||||
@@:
|
||||
sub esp,4
|
||||
fld dword[nsign]
|
||||
fmul dword[radius]
|
||||
fmul qword[radius]
|
||||
fstp dword[esp]
|
||||
stdcall glVertex3f, 0.0, 0.0 ;, nsign * radius
|
||||
fld dword[drho]
|
||||
@@ -728,7 +918,7 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -754,7 +944,7 @@ align 4
|
||||
fstp dword[d_t] ;1.0 / stacks
|
||||
mov dword[t],1.0 ; because loop now runs from 0
|
||||
mov ebx,[stacks]
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je .els_2
|
||||
mov dword[i],0
|
||||
mov [imax],ebx
|
||||
@@ -820,11 +1010,11 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, [s],[t]
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -868,7 +1058,7 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
fld dword[t]
|
||||
fsub dword[d_t]
|
||||
@@ -879,7 +1069,7 @@ align 4
|
||||
fadd dword[d_s]
|
||||
fstp dword[s]
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -910,7 +1100,7 @@ align 4
|
||||
jne @f
|
||||
stdcall glNormal3f, 0.0, 0.0, -1.0
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, 0.5,0.0
|
||||
mov dword[s],1.0
|
||||
@@ -918,7 +1108,7 @@ align 4
|
||||
mov [t],ebx
|
||||
@@:
|
||||
sub esp,4
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fchs
|
||||
fmul dword[nsign]
|
||||
fstp dword[esp]
|
||||
@@ -970,14 +1160,14 @@ align 4
|
||||
fincstp
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
cmp dword[eax+offs_qobj_TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
cmp dword[eax+GLUquadricObj.TextureFlag],0 ;if (qobj.TextureFlag)
|
||||
je @f
|
||||
stdcall glTexCoord2f, [s],[t]
|
||||
fld dword[s]
|
||||
fsub dword[d_s]
|
||||
fstp dword[s]
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -998,9 +1188,9 @@ align 4
|
||||
|
||||
align 4
|
||||
.if_glu_line:
|
||||
cmp dword[eax+offs_qobj_DrawStyle],GLU_LINE ;if (qobj.DrawStyle==GLU_LINE)
|
||||
cmp dword[eax+GLUquadricObj.DrawStyle],GLU_LINE ;if (qobj.DrawStyle==GLU_LINE)
|
||||
je @f
|
||||
cmp dword[eax+offs_qobj_DrawStyle],GLU_SILHOUETTE ;if (qobj.DrawStyle==GLU_SILHOUETTE)
|
||||
cmp dword[eax+GLUquadricObj.DrawStyle],GLU_SILHOUETTE ;if (qobj.DrawStyle==GLU_SILHOUETTE)
|
||||
je @f
|
||||
jmp .if_glu_point
|
||||
align 4
|
||||
@@ -1056,7 +1246,7 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -1123,7 +1313,7 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
@@ -1148,7 +1338,7 @@ align 4
|
||||
|
||||
align 4
|
||||
.if_glu_point:
|
||||
cmp dword[eax+offs_qobj_DrawStyle],GLU_POINT ;if (qobj.DrawStyle==GLU_POINT)
|
||||
cmp dword[eax+GLUquadricObj.DrawStyle],GLU_POINT ;if (qobj.DrawStyle==GLU_POINT)
|
||||
jne .end_f
|
||||
|
||||
; top and bottom-most points
|
||||
@@ -1157,7 +1347,10 @@ align 4
|
||||
jne @f
|
||||
stdcall glNormal3f, 0.0,0.0,dword[nsign]
|
||||
@@:
|
||||
stdcall glVertex3f, 0.0,0.0,dword[radius]
|
||||
sub esp,4
|
||||
fld qword[radius]
|
||||
fstp dword[esp]
|
||||
stdcall glVertex3f, 0.0,0.0
|
||||
cmp dword[normals],GL_TRUE
|
||||
jne @f
|
||||
sub esp,4
|
||||
@@ -1167,7 +1360,7 @@ align 4
|
||||
stdcall glNormal3f, 0.0,0.0 ;,-nsign
|
||||
@@:
|
||||
sub esp,4
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fchs
|
||||
fstp dword[esp]
|
||||
stdcall glVertex3f, 0.0,0.0 ;,-radius
|
||||
@@ -1220,7 +1413,7 @@ align 4
|
||||
sub esp,12
|
||||
stdcall glNormal3f ;x*nsign, y*nsign, z*nsign
|
||||
@@:
|
||||
fld dword[radius]
|
||||
fld qword[radius]
|
||||
fld dword[z]
|
||||
fmul st0,st1
|
||||
fstp dword[esp-4]
|
||||
|
@@ -1,15 +1,6 @@
|
||||
; simple gl like driver for TinyGL and KolibriOS - porting iadn
|
||||
|
||||
|
||||
struct TinyGLContext
|
||||
gl_context dd ?
|
||||
xsize dd ? ;+4
|
||||
ysize dd ? ;+8
|
||||
d_x dd ? ;+12
|
||||
d_y dd ? ;+16
|
||||
x dd ? ;+20
|
||||
y dd ? ;+24
|
||||
ends
|
||||
include 'kosgl.inc'
|
||||
|
||||
;KOSGLContext kosglCreateContext(KOSGLContext shareList, int flags)
|
||||
;{
|
||||
|
15
programs/develop/libraries/TinyGL/asm_fork/kosgl.inc
Normal file
15
programs/develop/libraries/TinyGL/asm_fork/kosgl.inc
Normal file
@@ -0,0 +1,15 @@
|
||||
;Macro for double type parameters (8 bytes)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
struct TinyGLContext
|
||||
gl_context dd ?
|
||||
xsize dd ? ;+4
|
||||
ysize dd ? ;+8
|
||||
d_x dd ? ;+12
|
||||
d_y dd ? ;+16
|
||||
x dd ? ;+20
|
||||
y dd ? ;+24
|
||||
ends
|
@@ -1,5 +1,6 @@
|
||||
align 4
|
||||
sp128f dd 128.0
|
||||
fl_128 dd 128.0
|
||||
fl_1e_3 dd 1.0e-3
|
||||
|
||||
align 4
|
||||
proc glopMaterial uses eax ebx ecx edi esi, context:dword, p:dword
|
||||
@@ -11,8 +12,7 @@ proc glopMaterial uses eax ebx ecx edi esi, context:dword, p:dword
|
||||
cmp ecx,GL_FRONT_AND_BACK ;if (mode == GL_FRONT_AND_BACK)
|
||||
jne @f
|
||||
mov dword[ebx+4],GL_FRONT ;p[1].i=GL_FRONT
|
||||
lea edi,[ebp+12]
|
||||
stdcall glopMaterial,eax,edi
|
||||
stdcall glopMaterial,eax,ebx
|
||||
mov ecx,GL_BACK
|
||||
@@:
|
||||
lea edi,[eax+GLContext.materials]
|
||||
@@ -58,7 +58,7 @@ align 4
|
||||
add edi,GLMaterial.shininess
|
||||
movsd
|
||||
mov dword[edi],SPECULAR_BUFFER_RESOLUTION
|
||||
fdiv dword[sp128f]
|
||||
fdiv dword[fl_128]
|
||||
fimul dword[edi]
|
||||
fistp dword[edi] ;m.shininess_i = (v[0]/128.0f)*SPECULAR_BUFFER_RESOLUTION
|
||||
jmp .end_f
|
||||
@@ -185,15 +185,15 @@ align 4
|
||||
cmp ecx,GL_SPOT_EXPONENT
|
||||
jne @f
|
||||
mov ecx,[ebx+12]
|
||||
mov [edi+GLLight.spot_exponent],ecx ;l.spot_exponent=p[3]
|
||||
mov [edx+GLLight.spot_exponent],ecx ;l.spot_exponent=p[3]
|
||||
jmp .end_f
|
||||
align 4
|
||||
@@:
|
||||
cmp ecx,GL_SPOT_CUTOFF
|
||||
jne .end_spot_c
|
||||
fld dword[ebp+12] ;float a=v.v[0]
|
||||
fld dword[ebx+12] ;float a=v.v[0]
|
||||
; assert(a == 180 || (a>=0 && a<=90));
|
||||
fst dword[edi+GLLight.spot_cutoff] ;l.spot_cutoff=a
|
||||
fst dword[edx+GLLight.spot_cutoff] ;l.spot_cutoff=a
|
||||
fcom dword[an180f] ;if (a != 180)
|
||||
fstsw ax
|
||||
sahf
|
||||
@@ -202,7 +202,7 @@ align 4
|
||||
fmulp
|
||||
fdiv dword[an180f]
|
||||
fcos
|
||||
fstp dword[edi+GLLight.cos_spot_cutoff] ;l.cos_spot_cutoff=cos(a * M_PI / 180.0)
|
||||
fstp dword[edx+GLLight.cos_spot_cutoff] ;l.cos_spot_cutoff=cos(a * M_PI / 180.0)
|
||||
jmp .end_f
|
||||
@@:
|
||||
ffree st0
|
||||
@@ -213,21 +213,21 @@ align 4
|
||||
cmp ecx,GL_CONSTANT_ATTENUATION
|
||||
jne @f
|
||||
mov ecx,[ebx+12]
|
||||
mov [edi+GLLight.attenuation],ecx ;l->attenuation[0]=p[3]
|
||||
mov [edx+GLLight.attenuation],ecx ;l->attenuation[0]=p[3]
|
||||
jmp .end_f
|
||||
align 4
|
||||
@@:
|
||||
cmp ecx,GL_LINEAR_ATTENUATION
|
||||
jne @f
|
||||
mov ecx,[ebx+12]
|
||||
mov [edi+GLLight.attenuation+4],ecx ;l->attenuation[1]=p[3]
|
||||
mov [edx+GLLight.attenuation+4],ecx ;l->attenuation[1]=p[3]
|
||||
jmp .end_f
|
||||
align 4
|
||||
@@:
|
||||
cmp ecx,GL_QUADRATIC_ATTENUATION
|
||||
jne @f
|
||||
mov ecx,[ebx+12]
|
||||
mov [edi+GLLight.attenuation+8],ecx ;l->attenuation[2]=p[3]
|
||||
mov [edx+GLLight.attenuation+8],ecx ;l->attenuation[2]=p[3]
|
||||
jmp .end_f
|
||||
align 4
|
||||
@@: ;default:
|
||||
@@ -356,22 +356,18 @@ align 4
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
fl_1e_3 dd 1.0e-3
|
||||
|
||||
; non optimized lightening model
|
||||
align 16
|
||||
proc gl_shade_vertex, context:dword, v:dword
|
||||
locals
|
||||
R dd ? ;float ebp-96
|
||||
G dd ? ;float ebp-92
|
||||
B dd ? ;float ebp-88
|
||||
A dd ? ;float ebp-84
|
||||
s V3 ;ebp-80
|
||||
d V3 ;ebp-68
|
||||
tmp dd ? ;float ebp-56
|
||||
att dd ? ;float ebp-52
|
||||
dot_spot dd ? ;float ebp-48
|
||||
R dd ? ;float ebp-92
|
||||
G dd ? ;float ebp-88
|
||||
B dd ? ;float ebp-84
|
||||
A dd ? ;float ebp-80
|
||||
s V3 ;ebp-76
|
||||
d V3 ;ebp-64
|
||||
tmp dd ? ;float ebp-52
|
||||
att dd ? ;float ebp-48
|
||||
lR dd ? ;float ebp-44
|
||||
lB dd ? ;float ebp-40
|
||||
lG dd ? ;float ebp-36
|
||||
@@ -396,8 +392,7 @@ pushad
|
||||
|
||||
mov esi,[v]
|
||||
mov edx,[context]
|
||||
mov ecx,edx
|
||||
add ecx,GLContext.materials ;ecx(m) = &context.materials[0]
|
||||
lea ecx,[edx+GLContext.materials] ;ecx(m) = &context.materials[0]
|
||||
mov eax,[edx+GLContext.light_model_two_side]
|
||||
mov [twoside],eax
|
||||
|
||||
@@ -410,7 +405,7 @@ pushad
|
||||
|
||||
fld dword[edx+GLContext.ambient_light_model]
|
||||
fmul dword[ecx+GLMaterial.ambient]
|
||||
fadd dword[ecx] ;GLMaterial.emission=0
|
||||
fadd dword[ecx+GLMaterial.emission]
|
||||
fstp dword[R] ;R=m.emission.v[0]+m.ambient.v[0]*context.ambient_light_model.v[0]
|
||||
fld dword[edx+GLContext.ambient_light_model+4]
|
||||
fmul dword[ecx+GLMaterial.ambient+4]
|
||||
@@ -430,7 +425,7 @@ pushad
|
||||
|
||||
; ambient
|
||||
fld dword[ecx+GLMaterial.ambient]
|
||||
fmul dword[ebx] ;GLLight.ambient=0
|
||||
fmul dword[ebx+GLLight.ambient]
|
||||
fstp dword[lR] ;lR=l.ambient.v[0] * m.ambient.v[0]
|
||||
fld dword[ecx+GLMaterial.ambient+4]
|
||||
fmul dword[ebx+GLLight.ambient+4]
|
||||
@@ -447,8 +442,8 @@ pushad
|
||||
; light at infinity
|
||||
ffree st0 ;l.position.v[3]
|
||||
fincstp
|
||||
mov eax,[ebx+GLLight.norm_position]
|
||||
mov [d],eax ;d.X=l.norm_position.v[0]
|
||||
mov eax,[ebx+GLLight.norm_position+offs_X]
|
||||
mov [d+offs_X],eax ;d.X=l.norm_position.v[0]
|
||||
mov eax,[ebx+GLLight.norm_position+offs_Y]
|
||||
mov [d+offs_Y],eax ;d.Y=l.norm_position.v[1]
|
||||
mov eax,[ebx+GLLight.norm_position+offs_Z]
|
||||
@@ -460,9 +455,9 @@ align 4
|
||||
; distance attenuation
|
||||
ffree st0 ;l.position.v[3]
|
||||
fincstp
|
||||
fld dword[ebx+GLLight.position]
|
||||
fsub dword[esi+GLVertex.ec]
|
||||
fstp dword[d] ;d.X=l.position.v[0]-v.ec.v[0]
|
||||
fld dword[ebx+GLLight.position+offs_X]
|
||||
fsub dword[esi+GLVertex.ec+offs_X]
|
||||
fstp dword[d+offs_X] ;d.X=l.position.v[0]-v.ec.v[0]
|
||||
fld dword[ebx+GLLight.position+offs_Y]
|
||||
fsub dword[esi+GLVertex.ec+offs_Y]
|
||||
fstp dword[d+offs_Y] ;d.Y=l.position.v[1]-v.ec.v[1]
|
||||
@@ -484,9 +479,9 @@ align 4
|
||||
jbe @f ;if (dist>1.0e-3)
|
||||
fld1
|
||||
fdiv st0,st1
|
||||
fld dword[d]
|
||||
fld dword[d+offs_X]
|
||||
fmul st0,st1
|
||||
fstp dword[d]
|
||||
fstp dword[d+offs_X]
|
||||
fld dword[d+offs_Y]
|
||||
fmul st0,st1
|
||||
fstp dword[d+offs_Y]
|
||||
@@ -509,8 +504,8 @@ align 4
|
||||
ffree st0 ;dist
|
||||
fincstp
|
||||
.els_0_end:
|
||||
fld dword[d]
|
||||
fmul dword[n]
|
||||
fld dword[d+offs_X]
|
||||
fmul dword[n+offs_X]
|
||||
fld dword[d+offs_Y]
|
||||
fmul dword[n+offs_Y]
|
||||
faddp
|
||||
@@ -563,7 +558,6 @@ align 4
|
||||
fmul dword[d+offs_Z]
|
||||
faddp
|
||||
fchs
|
||||
fst dword[dot_spot]
|
||||
cmp dword[twoside],0 ;if (twoside && dot_spot < 0)
|
||||
je @f
|
||||
ftst ;if (dot_spot<0)
|
||||
@@ -702,7 +696,7 @@ align 4
|
||||
@@:
|
||||
shl dword[idx],2
|
||||
add edi,dword[idx]
|
||||
fld dword[edi+offs_spec_buf] ;dot_spec = specbuf.buf[idx]
|
||||
fld dword[edi+GLSpecBuf.buf] ;dot_spec = specbuf.buf[idx]
|
||||
fld dword[ebx+GLLight.specular]
|
||||
fmul st0,st1
|
||||
fmul dword[ecx+GLMaterial.specular]
|
||||
|
@@ -57,12 +57,13 @@ proc delete_list uses eax ebx ecx edx, context:dword, list:dword
|
||||
; free param buffer
|
||||
mov eax,[edx] ;eax = GLList.first_op_buffer
|
||||
@@:
|
||||
cmp eax,0
|
||||
je .end_w
|
||||
mov ecx,[eax+offs_gpbu_next]
|
||||
or eax,eax
|
||||
jz .end_w
|
||||
mov ecx,[eax+GLParamBuffer.next]
|
||||
stdcall gl_free,eax
|
||||
mov eax,ecx
|
||||
jmp @b
|
||||
align 4
|
||||
.end_w:
|
||||
|
||||
stdcall gl_free,edx
|
||||
@@ -79,10 +80,10 @@ proc alloc_list uses ebx ecx, context:dword, list:dword
|
||||
mov ecx,eax
|
||||
stdcall gl_zalloc,sizeof.GLList
|
||||
|
||||
mov dword[ecx+offs_gpbu_next],0 ;ob.next=NULL
|
||||
mov dword[ecx+GLParamBuffer.next],0 ;ob.next=NULL
|
||||
mov dword[eax],ecx ;l.first_op_buffer=ob
|
||||
|
||||
mov dword[ecx+offs_gpbu_ops],OP_EndList ;ob.ops[0].op=OP_EndList
|
||||
mov dword[ecx+GLParamBuffer.ops],OP_EndList ;ob.ops[0].op=OP_EndList
|
||||
|
||||
mov ebx,[context]
|
||||
mov ebx,[ebx+GLContext.shared_state]
|
||||
@@ -138,12 +139,12 @@ pushad
|
||||
jle @f
|
||||
mov edi,eax
|
||||
stdcall gl_zalloc,sizeof.GLParamBuffer
|
||||
mov dword[eax+offs_gpbu_next],0 ;=NULL
|
||||
mov dword[eax+GLParamBuffer.next],0 ;=NULL
|
||||
|
||||
mov dword[edi+offs_gpbu_next],eax
|
||||
mov dword[edi+GLParamBuffer.next],eax
|
||||
lea esi,[edi+4*ebx]
|
||||
mov dword[esi+offs_gpbu_ops],OP_NextBuffer
|
||||
mov dword[esi+offs_gpbu_ops+4],eax
|
||||
mov dword[esi+GLParamBuffer.ops],OP_NextBuffer
|
||||
mov dword[esi+GLParamBuffer.ops+4],eax
|
||||
|
||||
mov dword[edx+GLContext.current_op_buffer],eax
|
||||
xor ebx,ebx
|
||||
@@ -168,8 +169,8 @@ push edi esi
|
||||
mov ebx,[ebx]
|
||||
lea eax,[op_table_str]
|
||||
@@:
|
||||
cmp ebx,0
|
||||
je @f
|
||||
or ebx,ebx
|
||||
jz @f
|
||||
cmp byte[eax],0
|
||||
jne .no_dec
|
||||
dec ebx
|
||||
@@ -197,21 +198,24 @@ push edi esi
|
||||
add ebx,4
|
||||
inc esi
|
||||
|
||||
cmp byte[esi],'f'
|
||||
cmp byte[esi],'f' ;float
|
||||
jne @f
|
||||
fld dword[ebx]
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
stdcall str_cat, edi,Data_String
|
||||
@@:
|
||||
cmp byte[esi],'d'
|
||||
jne @f
|
||||
cmp byte[esi],'C' ;const
|
||||
je @f
|
||||
cmp byte[esi],'d' ;integer
|
||||
je @f
|
||||
jmp .no_param
|
||||
@@:
|
||||
stdcall str_len,edi
|
||||
add edi,eax
|
||||
sub ecx,eax
|
||||
mov eax,dword[ebx]
|
||||
stdcall convert_int_to_str,ecx
|
||||
@@:
|
||||
.no_param:
|
||||
inc esi
|
||||
cmp byte[esi],0
|
||||
@@ -307,8 +311,8 @@ proc glNewList uses eax ebx, list:dword, mode:dword
|
||||
; assert(ebx->compile_flag == 0);
|
||||
|
||||
stdcall find_list,ebx,[list]
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
stdcall delete_list,ebx,[list]
|
||||
@@:
|
||||
stdcall alloc_list,ebx,[list]
|
||||
@@ -347,8 +351,8 @@ align 4
|
||||
proc glIsList, list:dword
|
||||
call gl_get_context
|
||||
stdcall find_list, eax,[list]
|
||||
cmp eax,0 ;NULL
|
||||
je @f
|
||||
or eax,eax ;NULL
|
||||
jz @f
|
||||
mov eax,1
|
||||
@@:
|
||||
ret
|
||||
|
@@ -1,5 +1,5 @@
|
||||
;
|
||||
; функции для вычисления зеркального цвета (блики)
|
||||
; functions for calculating specular color (glare)
|
||||
;
|
||||
|
||||
align 4
|
||||
@@ -10,49 +10,41 @@ locals
|
||||
endl
|
||||
mov dword[f_inc],SPECULAR_BUFFER_SIZE
|
||||
mov ebx,[buf]
|
||||
add ebx,offs_spec_buf
|
||||
add ebx,GLSpecBuf.buf
|
||||
mov dword[ebx],0.0 ;buf.buf[0] = 0.0
|
||||
xor ecx,ecx
|
||||
inc ecx
|
||||
fld dword[shininess] ;сначала берем y
|
||||
fld1
|
||||
fidiv dword[f_inc]
|
||||
fst dword[f_inc] ;f_inc = 1.0f/SPECULAR_BUFFER_SIZE
|
||||
fst dword[val]
|
||||
fstp dword[f_inc] ;f_inc = 1.0f/SPECULAR_BUFFER_SIZE
|
||||
mov dword[val],0.0
|
||||
align 4
|
||||
.cycle_0: ;for (i = 1; i <= SPECULAR_BUFFER_SIZE; i++)
|
||||
.cycle_0: ;for (i = 1; i < SPECULAR_BUFFER_SIZE; i++)
|
||||
inc ecx
|
||||
cmp ecx,SPECULAR_BUFFER_SIZE
|
||||
jg @f
|
||||
;Вычисляем x^y
|
||||
jge @f
|
||||
fld dword[shininess]
|
||||
fld dword[val]
|
||||
fadd dword[f_inc]
|
||||
fst dword[val] ;val += f_inc
|
||||
;need to calculate pow(val, shininess)
|
||||
|
||||
fyl2x ;Стек FPU теперь содержит: st0=z=y*log2(x):
|
||||
;Теперь считаем 2**z:
|
||||
fld st0 ;Создаем еще одну копию z
|
||||
frndint ;Округляем
|
||||
fyl2x ;the FPU stack now contains: st0=z=y*log2(x):
|
||||
;now we count 2**z:
|
||||
fld st0 ;copy z
|
||||
frndint
|
||||
fsubr st0,st1 ;st1=z, st0=z-trunc(z)
|
||||
f2xm1 ;st1=z, st0=2**(z-trunc(z))-1
|
||||
fld1
|
||||
faddp ;st1=z, st0=2**(z-trunc(z))
|
||||
fscale ;st1=z, st0=(2**trunc(z))*(2**(z-trunc(z)))=2**t
|
||||
fxch st1
|
||||
fstp st ;Результат остается на вершине стека st0
|
||||
fstp st ;the result remains on the top of the stack st0
|
||||
|
||||
add ebx,4
|
||||
fstp dword[ebx] ;buf.buf[i] = pow(val, shininess)
|
||||
ffree st0 ;испорченный shininess
|
||||
fincstp
|
||||
|
||||
fld dword[shininess] ;сначала берем y
|
||||
fld dword[val]
|
||||
fadd dword[f_inc]
|
||||
fst dword[val] ;val += f_inc
|
||||
inc ecx
|
||||
jmp .cycle_0
|
||||
@@:
|
||||
ffree st0 ;val
|
||||
fincstp
|
||||
ffree st0 ;shininess
|
||||
fincstp
|
||||
mov dword[ebx+4],1.0
|
||||
ret
|
||||
endp
|
||||
|
||||
@@ -70,22 +62,22 @@ endl
|
||||
.cycle_0:
|
||||
or eax,eax ;while (found)
|
||||
jz @f
|
||||
cmp [eax+offs_spec_shininess_i],ebx ;while (found.shininess_i != shininess_i)
|
||||
cmp [eax+GLSpecBuf.shininess_i],ebx ;while (found.shininess_i != shininess_i)
|
||||
je @f
|
||||
mov ecx,[oldest]
|
||||
mov ecx,[ecx+offs_spec_last_used]
|
||||
cmp [eax+offs_spec_last_used],ecx ;if (found.last_used < oldest.last_used)
|
||||
mov ecx,[ecx+GLSpecBuf.last_used]
|
||||
cmp [eax+GLSpecBuf.last_used],ecx ;if (found.last_used < oldest.last_used)
|
||||
jge .end_0
|
||||
mov [oldest],eax ;oldest = found
|
||||
.end_0:
|
||||
mov eax,[eax+offs_spec_next] ;found = found.next
|
||||
mov eax,[eax+GLSpecBuf.next] ;found = found.next
|
||||
jmp .cycle_0
|
||||
@@:
|
||||
cmp dword[found],0 ;if (found) /* hey, found one! */
|
||||
je @f
|
||||
mov eax,[found]
|
||||
mov ecx,[edx+GLContext.specbuf_used_counter]
|
||||
mov [eax+offs_spec_last_used],ecx ;found.last_used = context.specbuf_used_counter
|
||||
mov [eax+GLSpecBuf.last_used],ecx ;found.last_used = context.specbuf_used_counter
|
||||
inc dword[edx+GLContext.specbuf_used_counter]
|
||||
jmp .end_f ;return found
|
||||
@@:
|
||||
@@ -102,21 +94,21 @@ endl
|
||||
@@:
|
||||
inc dword[edx+GLContext.specbuf_num_buffers]
|
||||
mov ecx,[edx+GLContext.specbuf_first]
|
||||
mov [eax+offs_spec_next],ecx
|
||||
mov [eax+GLSpecBuf.next],ecx
|
||||
mov [edx+GLContext.specbuf_first],eax
|
||||
mov ecx,[edx+GLContext.specbuf_used_counter]
|
||||
mov [eax+offs_spec_last_used],ecx
|
||||
mov [eax+GLSpecBuf.last_used],ecx
|
||||
inc dword[edx+GLContext.specbuf_used_counter]
|
||||
mov [eax+offs_spec_shininess_i],ebx
|
||||
mov [eax+GLSpecBuf.shininess_i],ebx
|
||||
stdcall calc_buf, eax,dword[shininess]
|
||||
jmp .end_f
|
||||
.end_1:
|
||||
; overwrite the lru buffer
|
||||
;tgl_trace("overwriting spec buffer :(\n");
|
||||
mov eax,[oldest]
|
||||
mov [eax+offs_spec_shininess_i],ebx
|
||||
mov [eax+GLSpecBuf.shininess_i],ebx
|
||||
mov ecx,[edx+GLContext.specbuf_used_counter]
|
||||
mov [eax+offs_spec_last_used],ecx
|
||||
mov [eax+GLSpecBuf.last_used],ecx
|
||||
inc dword[edx+GLContext.specbuf_used_counter]
|
||||
stdcall calc_buf, eax,dword[shininess]
|
||||
.end_f:
|
||||
|
@@ -17,9 +17,9 @@ proc find_texture uses ebx ecx, context:dword, h:dword
|
||||
cmp dword[eax],0
|
||||
je .no_found
|
||||
mov ebx,[eax]
|
||||
cmp dword[ebx+offs_text_handle],ecx
|
||||
cmp dword[ebx+GLTexture.handle],ecx
|
||||
je .found
|
||||
mov eax,[ebx+offs_text_next]
|
||||
mov eax,[ebx+GLTexture.next]
|
||||
jmp @b
|
||||
.no_found:
|
||||
xor eax,eax ;ret NULL
|
||||
@@ -32,36 +32,36 @@ proc free_texture uses eax ebx ecx edx, context:dword, h:dword
|
||||
mov edx,[context]
|
||||
|
||||
stdcall find_texture,edx,[h] ;t=find_texture(context,h)
|
||||
cmp dword[eax+offs_text_prev],0 ;if (t.prev==NULL)
|
||||
cmp dword[eax+GLTexture.prev],0 ;if (t.prev==NULL)
|
||||
jne .else
|
||||
mov edx,[edx+GLContext.shared_state+4] ;edx = &context.shared_state.texture_hash_table[0]
|
||||
mov ebx,[eax+offs_text_handle]
|
||||
mov ebx,[eax+GLTexture.handle]
|
||||
and ebx,0xff
|
||||
shl ebx,2
|
||||
add edx,ebx ;edx = &context.shared_state.texture_hash_table[t.handle % TEXTURE_HASH_TABLE_SIZE]
|
||||
mov ebx,[eax+offs_text_next]
|
||||
mov ebx,[eax+GLTexture.next]
|
||||
mov [edx],ebx ;*ht=t.next
|
||||
jmp @f
|
||||
.else:
|
||||
mov ebx,[eax+offs_text_prev]
|
||||
mov ecx,[eax+offs_text_next]
|
||||
mov [ebx+offs_text_next],ecx ;t.prev.next=t.next
|
||||
mov ebx,[eax+GLTexture.prev]
|
||||
mov ecx,[eax+GLTexture.next]
|
||||
mov [ebx+GLTexture.next],ecx ;t.prev.next=t.next
|
||||
@@:
|
||||
cmp dword[eax+offs_text_next],0 ;if (t.next!=NULL)
|
||||
cmp dword[eax+GLTexture.next],0 ;if (t.next!=NULL)
|
||||
je @f
|
||||
mov ebx,[eax+offs_text_next]
|
||||
mov ecx,[eax+offs_text_prev]
|
||||
mov [ebx+offs_text_prev],ecx ;t.next.prev=t.prev
|
||||
mov ebx,[eax+GLTexture.next]
|
||||
mov ecx,[eax+GLTexture.prev]
|
||||
mov [ebx+GLTexture.prev],ecx ;t.next.prev=t.prev
|
||||
@@:
|
||||
|
||||
xor ebx,ebx
|
||||
mov ecx,[eax+offs_text_images] ;im=&t.images[0]
|
||||
mov ecx,[eax+GLTexture.images] ;im=&t.images[0]
|
||||
.cycle_0: ;for(i=0;i<MAX_TEXTURE_LEVELS;i++)
|
||||
cmp ebx,MAX_TEXTURE_LEVELS
|
||||
jge .cycle_0_end
|
||||
cmp dword[ecx+offs_imag_pixmap],0 ;if (im.pixmap != NULL)
|
||||
cmp dword[ecx+GLImage.pixmap],0 ;if (im.pixmap != NULL)
|
||||
je @f
|
||||
stdcall gl_free,[ecx+offs_imag_pixmap]
|
||||
stdcall gl_free,[ecx+GLImage.pixmap]
|
||||
@@:
|
||||
add ecx,sizeof.GLImage
|
||||
inc ebx
|
||||
@@ -87,16 +87,16 @@ proc alloc_texture uses ebx ecx, context:dword, h:dword
|
||||
add ecx,ebx ;ecx = &context.shared_state.texture_hash_table[h % TEXTURE_HASH_TABLE_SIZE]
|
||||
|
||||
mov ebx,[ecx]
|
||||
mov [eax+offs_text_next],ebx
|
||||
mov dword[eax+offs_text_prev],0 ;NULL
|
||||
cmp dword[eax+offs_text_next],0 ;NULL
|
||||
mov [eax+GLTexture.next],ebx
|
||||
mov dword[eax+GLTexture.prev],0 ;NULL
|
||||
cmp dword[eax+GLTexture.next],0 ;NULL
|
||||
je @f
|
||||
mov [eax+offs_text_prev],eax
|
||||
mov [eax+GLTexture.prev],eax
|
||||
@@:
|
||||
mov [ecx],eax
|
||||
|
||||
mov ebx,[h]
|
||||
mov [eax+offs_text_handle],ebx
|
||||
mov [eax+GLTexture.handle],ebx
|
||||
|
||||
ret
|
||||
endp
|
||||
@@ -129,11 +129,11 @@ proc glGenTextures uses eax ebx ecx edx esi, n:dword, textures:dword
|
||||
.cycle_1: ;while (t!=NULL)
|
||||
or edx,edx
|
||||
jz .cycle_1_end
|
||||
cmp [edx+offs_text_handle],ebx ;if (t.handle>max)
|
||||
cmp [edx+GLTexture.handle],ebx ;if (t.handle>max)
|
||||
jle @f
|
||||
mov ebx,[edx+offs_text_handle] ;max=t.handle
|
||||
mov ebx,[edx+GLTexture.handle] ;max=t.handle
|
||||
@@:
|
||||
mov edx,[edx+offs_text_next] ;t=t.next
|
||||
mov edx,[edx+GLTexture.next] ;t=t.next
|
||||
jmp .cycle_1
|
||||
.cycle_1_end:
|
||||
inc ecx
|
||||
@@ -266,22 +266,22 @@ align 4
|
||||
|
||||
mov ecx,[context]
|
||||
mov ecx,[ecx+GLContext.current_texture]
|
||||
add ecx,offs_text_images
|
||||
add ecx,GLTexture.images
|
||||
imul ebx,sizeof.GLTexture
|
||||
add ecx,ebx ;ecx = &context.current_texture.images[level]
|
||||
mov [ecx+offs_imag_xsize],edx ;im.xsize=width
|
||||
mov [ecx+offs_imag_ysize],esi ;im.ysize=height
|
||||
mov [ecx+GLImage.xsize],edx ;im.xsize=width
|
||||
mov [ecx+GLImage.ysize],esi ;im.ysize=height
|
||||
mov ebx,edx
|
||||
dec ebx
|
||||
shl ebx,ZB_POINT_TEXEL_SIZE
|
||||
mov [ecx+offs_imag_s_bound],ebx ;im.s_bound = (unsigned int)(width-1)
|
||||
mov [ecx+GLImage.s_bound],ebx ;im.s_bound = (unsigned int)(width-1)
|
||||
shr ebx,ZB_POINT_TEXEL_SIZE
|
||||
|
||||
mov dword[ecx+offs_imag_xsize_log2],ZB_POINT_TEXEL_SIZE
|
||||
mov dword[ecx+GLImage.xsize_log2],ZB_POINT_TEXEL_SIZE
|
||||
or ebx,ebx
|
||||
jz .set_l2
|
||||
@@:
|
||||
dec dword[ecx+offs_imag_xsize_log2]
|
||||
dec dword[ecx+GLImage.xsize_log2]
|
||||
shr ebx,1
|
||||
or ebx,ebx
|
||||
jnz @b
|
||||
@@ -289,18 +289,18 @@ align 4
|
||||
;im.xsize_log2 = ZB_POINT_TEXEL_SIZE-log_2(width)
|
||||
dec esi
|
||||
shl esi,ZB_POINT_TEXEL_SIZE
|
||||
mov [ecx+offs_imag_t_bound],esi ;im.t_bound = (unsigned int)(height-1)
|
||||
mov [ecx+GLImage.t_bound],esi ;im.t_bound = (unsigned int)(height-1)
|
||||
shr esi,ZB_POINT_TEXEL_SIZE
|
||||
inc esi
|
||||
cmp dword[ecx+offs_imag_pixmap],0 ;if (im.pixmap!=NULL)
|
||||
cmp dword[ecx+GLImage.pixmap],0 ;if (im.pixmap!=NULL)
|
||||
je @f
|
||||
stdcall gl_free, [ecx+offs_imag_pixmap]
|
||||
stdcall gl_free, [ecx+GLImage.pixmap]
|
||||
@@:
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
imul edx,esi
|
||||
imul edx,3
|
||||
stdcall gl_malloc,edx
|
||||
mov [ecx+offs_imag_pixmap],eax ;im.pixmap = gl_malloc(width*height*3)
|
||||
mov [ecx+GLImage.pixmap],eax ;im.pixmap = gl_malloc(width*height*3)
|
||||
or eax,eax ;if(im.pixmap)
|
||||
jz @f
|
||||
mov edi,eax
|
||||
@@ -314,7 +314,7 @@ if TGL_FEATURE_RENDER_BITS eq 32
|
||||
imul edx,esi
|
||||
shl edx,2
|
||||
stdcall gl_malloc,edx
|
||||
mov [ecx+offs_imag_pixmap],eax ;im.pixmap = gl_malloc(width*height*4)
|
||||
mov [ecx+GLImage.pixmap],eax ;im.pixmap = gl_malloc(width*height*4)
|
||||
or eax,eax ;if(im.pixmap)
|
||||
jz @f
|
||||
;gl_convertRGB_to_8A8R8G8B(eax,[pixels1],ebx,esi)
|
||||
|
@@ -86,14 +86,14 @@ endl
|
||||
fdiv st0,st1 ;st0 = 0.5
|
||||
|
||||
fild dword[eax+GLViewport.xsize]
|
||||
fsub st0,st1
|
||||
fsub dword[fl_1e_3]
|
||||
fdiv st0,st2
|
||||
fst dword[eax+GLViewport.scale+offs_X]
|
||||
fiadd dword[eax+GLViewport.xmin]
|
||||
fstp dword[eax+GLViewport.trans+offs_X]
|
||||
|
||||
fild dword[eax+GLViewport.ysize]
|
||||
fsub st0,st1
|
||||
fsub dword[fl_1e_3]
|
||||
fdiv st0,st2
|
||||
fchs
|
||||
fst dword[eax+GLViewport.scale+offs_Y]
|
||||
@@ -134,21 +134,13 @@ endl
|
||||
|
||||
cmp dword[edx+GLContext.lighting_enabled],0 ;if(context.lighting_enabled)
|
||||
jne .if_0
|
||||
cmp dword[eax+GLContext.texture_2d_enabled],0
|
||||
jne .if_0
|
||||
jmp @f
|
||||
cmp dword[edx+GLContext.texture_2d_enabled],0
|
||||
je @f
|
||||
align 4
|
||||
.if_0:
|
||||
if DEBUG ;context.matrix_stack_ptr[0]
|
||||
stdcall gl_print_matrix,dword[edx+GLContext.matrix_stack_ptr],4
|
||||
end if
|
||||
; precompute inverse modelview
|
||||
lea ebx,[ebp-sizeof.M4]
|
||||
stdcall gl_M4_Inv, ebx,dword[edx+GLContext.matrix_stack_ptr]
|
||||
if DEBUG ;tmp
|
||||
stdcall dbg_print,txt_sp,txt_nl
|
||||
stdcall gl_print_matrix,ebx,4
|
||||
end if
|
||||
push ebx
|
||||
lea ebx,[edx+GLContext.matrix_model_view_inv]
|
||||
stdcall gl_M4_Transpose, ebx
|
||||
@@ -253,8 +245,7 @@ pushad
|
||||
cmp dword[eax+GLContext.lighting_enabled],0 ;if (context.lighting_enabled)
|
||||
jne @f
|
||||
cmp dword[eax+GLContext.texture_2d_enabled],0
|
||||
jne @f
|
||||
jmp .els_0
|
||||
je .els_0
|
||||
align 4
|
||||
@@:
|
||||
; eye coordinates needed for lighting
|
||||
|
@@ -51,16 +51,11 @@ struct GLSpecBuf
|
||||
next dd ? ;struct GLSpecBuf*
|
||||
ends
|
||||
|
||||
offs_spec_shininess_i equ 0
|
||||
offs_spec_last_used equ 4
|
||||
offs_spec_buf equ 8
|
||||
offs_spec_next equ 8+4*(SPECULAR_BUFFER_SIZE+1)
|
||||
|
||||
struct GLLight
|
||||
ambient V4
|
||||
diffuse V4
|
||||
ambient V4
|
||||
diffuse V4
|
||||
specular V4
|
||||
position V4
|
||||
position V4
|
||||
spot_direction V3
|
||||
spot_exponent dd ? ;float
|
||||
spot_cutoff dd ? ;float
|
||||
@@ -102,9 +97,6 @@ struct GLParamBuffer
|
||||
next dd ? ;struct GLParamBuffer*
|
||||
ends
|
||||
|
||||
offs_gpbu_ops equ 0
|
||||
offs_gpbu_next equ 4*OP_BUFFER_MAX_SIZE
|
||||
|
||||
struct GLList
|
||||
first_op_buffer dd ? ;GLParamBuffer*
|
||||
; TODO: extensions for an hash table or a better allocating scheme
|
||||
@@ -133,29 +125,17 @@ struct GLImage
|
||||
t_bound dd ? ;unsigned int
|
||||
ends
|
||||
|
||||
offs_imag_pixmap equ 0
|
||||
offs_imag_xsize equ 4
|
||||
offs_imag_ysize equ 8
|
||||
offs_imag_xsize_log2 equ 12
|
||||
offs_imag_s_bound equ 16
|
||||
offs_imag_t_bound equ 20
|
||||
|
||||
; textures
|
||||
|
||||
TEXTURE_HASH_TABLE_SIZE equ 256 ;должно быть кратное 2, в коде берется остаток от деления (через and быстрее чем div)
|
||||
|
||||
struct GLTexture
|
||||
images rb sizeof.GLImage * MAX_TEXTURE_LEVELS ;GLImage[MAX_TEXTURE_LEVELS]
|
||||
images rd (sizeof.GLImage * MAX_TEXTURE_LEVELS)/4 ;GLImage[MAX_TEXTURE_LEVELS]
|
||||
handle dd ? ;int
|
||||
next dd ? ;struct GLTexture*
|
||||
prev dd ? ;struct GLTexture*
|
||||
ends
|
||||
|
||||
offs_text_images equ 0
|
||||
offs_text_handle equ sizeof.GLImage*MAX_TEXTURE_LEVELS
|
||||
offs_text_next equ 4+offs_text_handle
|
||||
offs_text_prev equ 8+offs_text_handle
|
||||
|
||||
; shared state
|
||||
|
||||
struct GLSharedState
|
||||
|
@@ -17,7 +17,7 @@ proc ZB_plot uses eax ebx ecx edx edi, zb:dword, p:dword
|
||||
mov edi,[ebx+ZBufferPoint.z]
|
||||
shr edi,ZB_POINT_Z_FRAC_BITS
|
||||
cmp di,word[ecx]
|
||||
jl .end_f
|
||||
jb .end_f
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
mov eax,[ebx+ZBufferPoint.r]
|
||||
mov byte[edx],ah
|
||||
|
@@ -101,7 +101,7 @@ local .end_0
|
||||
mov [zz],eax
|
||||
mov ebx,[pz]
|
||||
cmp ax,word[ebx]
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
RGBPIXEL
|
||||
mov eax,dword[zz]
|
||||
mov ebx,[pz]
|
||||
@@ -114,9 +114,7 @@ end if
|
||||
|
||||
macro DRAWLINE d_x,d_y,inc_1,inc_2
|
||||
{
|
||||
local .mz_0
|
||||
local .mz_1
|
||||
local .mz_2
|
||||
|
||||
mov eax,d_x
|
||||
mov [n],eax
|
||||
@@ -124,26 +122,12 @@ if INTERP_Z eq 1
|
||||
mov ebx,[p1]
|
||||
mov eax,[p2]
|
||||
mov eax,[eax+ZBufferPoint.z]
|
||||
cmp eax,[ebx+ZBufferPoint.z]
|
||||
jg .mz_0
|
||||
je .mz_1
|
||||
;if(p2.z<p1.z)
|
||||
sub eax,[ebx+ZBufferPoint.z]
|
||||
neg eax
|
||||
inc eax
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
neg eax
|
||||
inc eax
|
||||
jmp .mz_2
|
||||
.mz_0:
|
||||
sub eax,[ebx+ZBufferPoint.z]
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
jmp .mz_2
|
||||
jz .mz_1
|
||||
;if(p2.z!=p1.z)
|
||||
cdq
|
||||
idiv dword[n]
|
||||
.mz_1:
|
||||
xor eax,eax
|
||||
.mz_2:
|
||||
mov [zinc],eax ;zinc=(p2.z-p1.z)/n
|
||||
end if
|
||||
shl dword d_y,1
|
||||
|
@@ -102,7 +102,7 @@ local .end_0
|
||||
mov [zz],eax
|
||||
mov ebx,[pz]
|
||||
cmp ax,word[ebx]
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
RGBPIXEL
|
||||
mov eax,dword[zz]
|
||||
mov ebx,[pz]
|
||||
@@ -115,18 +115,10 @@ end if
|
||||
|
||||
macro DRAWLINE d_x,d_y,inc_1,inc_2
|
||||
{
|
||||
local .mz_0
|
||||
local .mz_1
|
||||
local .mz_2
|
||||
local .mr_0
|
||||
local .mr_1
|
||||
local .mr_2
|
||||
local .mg_0
|
||||
local .mg_1
|
||||
local .mg_2
|
||||
local .mb_0
|
||||
local .mb_1
|
||||
local .mb_2
|
||||
|
||||
mov eax,d_x
|
||||
mov [n],eax
|
||||
@@ -135,103 +127,44 @@ local .mb_2
|
||||
mov ecx,[p2]
|
||||
if INTERP_Z eq 1
|
||||
mov eax,[ecx+ZBufferPoint.z]
|
||||
cmp eax,[ebx+ZBufferPoint.z]
|
||||
jg .mz_0
|
||||
je .mz_1
|
||||
;if(p2.z<p1.z)
|
||||
sub eax,[ebx+ZBufferPoint.z]
|
||||
neg eax
|
||||
inc eax
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
neg eax
|
||||
inc eax
|
||||
jmp .mz_2
|
||||
.mz_0:
|
||||
sub eax,[ebx+ZBufferPoint.z]
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
jmp .mz_2
|
||||
jz .mz_1
|
||||
;if(p2.z!=p1.z)
|
||||
cdq
|
||||
idiv dword[n]
|
||||
.mz_1:
|
||||
xor eax,eax
|
||||
.mz_2:
|
||||
mov [zinc],eax ;zinc=(p2.z-p1.z)/n
|
||||
end if
|
||||
|
||||
;ebx=&p1, ecx=&p2
|
||||
mov eax,[ecx+ZBufferPoint.r]
|
||||
cmp eax,[ebx+ZBufferPoint.r]
|
||||
jg .mr_0
|
||||
je .mr_1
|
||||
;if(p2.r<p1.r)
|
||||
sub eax,[ebx+ZBufferPoint.r]
|
||||
neg eax
|
||||
inc eax
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
neg eax
|
||||
inc eax
|
||||
jmp .mr_2
|
||||
.mr_0:
|
||||
sub eax,[ebx+ZBufferPoint.r]
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
jmp .mr_2
|
||||
jz .mr_1
|
||||
;if(p2.r!=p1.r)
|
||||
shl eax,8
|
||||
cdq
|
||||
idiv dword[n]
|
||||
.mr_1:
|
||||
xor eax,eax
|
||||
.mr_2:
|
||||
mov [rinc],eax ;rinc=((p2.r-p1.r)<<8)/n
|
||||
|
||||
mov eax,[ecx+ZBufferPoint.g]
|
||||
cmp eax,[ebx+ZBufferPoint.g]
|
||||
jg .mg_0
|
||||
je .mg_1
|
||||
;if(p2.g<p1.g)
|
||||
sub eax,[ebx+ZBufferPoint.g]
|
||||
neg eax
|
||||
inc eax
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
neg eax
|
||||
inc eax
|
||||
jmp .mg_2
|
||||
.mg_0:
|
||||
sub eax,[ebx+ZBufferPoint.g]
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
jmp .mg_2
|
||||
jz .mg_1
|
||||
;if(p2.g!=p1.g)
|
||||
shl eax,8
|
||||
cdq
|
||||
idiv dword[n]
|
||||
.mg_1:
|
||||
xor eax,eax
|
||||
.mg_2:
|
||||
mov [ginc],eax ;ginc=((p2.g-p1.g)<<8)/n
|
||||
|
||||
mov eax,[ecx+ZBufferPoint.b]
|
||||
cmp eax,[ebx+ZBufferPoint.b]
|
||||
jg .mb_0
|
||||
je .mb_1
|
||||
;if(p2.b<p1.b)
|
||||
sub eax,[ebx+ZBufferPoint.b]
|
||||
neg eax
|
||||
inc eax
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
neg eax
|
||||
inc eax
|
||||
jmp .mb_2
|
||||
.mb_0:
|
||||
sub eax,[ebx+ZBufferPoint.b]
|
||||
shl eax,8
|
||||
xor edx,edx
|
||||
div dword[n]
|
||||
jmp .mb_2
|
||||
jz .mb_1
|
||||
;if(p2.b!=p1.b)
|
||||
shl eax,8
|
||||
cdq
|
||||
idiv dword[n]
|
||||
.mb_1:
|
||||
xor eax,eax
|
||||
.mb_2:
|
||||
mov [binc],eax ;binc=((p2.b-p1.b)<<8)/n
|
||||
|
||||
shl dword d_y,1
|
||||
|
@@ -58,7 +58,7 @@ end if
|
||||
mov eax,[z]
|
||||
shr eax,ZB_POINT_Z_FRAC_BITS
|
||||
cmp ax,word[esi+2*_a] ;if (zz >= pz[_a])
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
;edi = pp
|
||||
mov word[esi+2*_a],ax ;пишем в буфер глубины новое значение
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
@@ -103,7 +103,7 @@ local .end_0
|
||||
mov eax,[z]
|
||||
shr eax,ZB_POINT_Z_FRAC_BITS
|
||||
cmp ax,word[esi+2*_a] ;if (zz >= pz[_a])
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
;edi = pp
|
||||
mov word[esi+2*_a],ax ;пишем в буфер глубины новое значение
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
@@ -171,7 +171,7 @@ local .end_0
|
||||
mov eax,[z]
|
||||
shr eax,ZB_POINT_Z_FRAC_BITS
|
||||
cmp ax,word[esi+2*_a] ;if (zz >= pz[_a])
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
;edi = pp
|
||||
mov word[esi+2*_a],ax ;пишем в буфер глубины новое значение
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
@@ -251,7 +251,7 @@ local .end_0
|
||||
mov eax,[z]
|
||||
shr eax,ZB_POINT_Z_FRAC_BITS
|
||||
cmp ax,word[esi+2*_a] ;if (zz >= pz[_a])
|
||||
jl .end_0
|
||||
jb .end_0
|
||||
;edi = pp
|
||||
mov word[esi+2*_a],ax ;пишем в буфер глубины новое значение
|
||||
if TGL_FEATURE_RENDER_BITS eq 24
|
||||
|
@@ -393,20 +393,9 @@ align 4
|
||||
mov [dx1],eax ;dx1 = l2.x - l1.x
|
||||
cmp edx,0 ;if (dy1 > 0)
|
||||
jle .els_3
|
||||
xor edx,edx
|
||||
cmp eax,0
|
||||
jl .otr_dx1
|
||||
shl eax,16
|
||||
div dword[dy1] ;eax = (dx1 << 16) / dy1
|
||||
jmp .end_3
|
||||
align 4
|
||||
.otr_dx1:
|
||||
neg eax
|
||||
inc eax
|
||||
shl eax,16
|
||||
div dword[dy1] ;eax = (-dx1 << 16) / dy1
|
||||
neg eax
|
||||
inc eax
|
||||
cdq
|
||||
idiv dword[dy1] ;eax = (dx1 << 16) / dy1
|
||||
jmp .end_3
|
||||
align 4
|
||||
.els_3:
|
||||
@@ -505,7 +494,6 @@ end if
|
||||
.end_upd_l:
|
||||
|
||||
; compute values for the right edge
|
||||
|
||||
cmp dword[update_right],0 ;if(update_right)
|
||||
je .end_upd_r
|
||||
mov ebx,[pr1]
|
||||
@@ -521,20 +509,9 @@ end if
|
||||
mov [dy2],edx ;dy2 = pr2.y - pr1.y
|
||||
cmp edx,0 ;if (dy2 > 0)
|
||||
jle .els_4
|
||||
xor edx,edx
|
||||
cmp eax,0
|
||||
jl .otr_dx2
|
||||
shl eax,16
|
||||
div dword[dy2] ;eax = (dx2 << 16) / dy2
|
||||
jmp .end_4
|
||||
align 4
|
||||
.otr_dx2:
|
||||
neg eax
|
||||
inc eax ;dx2 *= -1
|
||||
shl eax,16
|
||||
div dword[dy2] ;eax = (-dx2 << 16) / dy2
|
||||
neg eax
|
||||
inc eax
|
||||
cdq
|
||||
idiv dword[dy2] ;eax = (dx2 << 16) / dy2
|
||||
jmp .end_4
|
||||
align 4
|
||||
.els_4:
|
||||
|
@@ -1,7 +1,6 @@
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TreeList <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> box_lib.obj
|
||||
; <EFBFBD><EFBFBD> <20><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><>業<EFBFBD><E6A5AD><EFBFBD>
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> 12.01.2021 IgorA
|
||||
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; TreeList: used as a ListBox or Tree control (determined by settings)
|
||||
; Copyright (C) 2009-2025 IgorA <aie85playm@gmail.com>
|
||||
|
||||
struct TreeNode
|
||||
type dw ? ;+ 0 ⨯ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> 㧫<>
|
||||
@@ -14,6 +13,52 @@ struct TreeNode
|
||||
ends
|
||||
|
||||
|
||||
;input:
|
||||
; ecx - 0xXX...... font options
|
||||
;output:
|
||||
; eax - font height in pixels
|
||||
align 4
|
||||
proc get_font_h uses ebx
|
||||
mov eax,ecx
|
||||
shr eax,24
|
||||
bt eax,4
|
||||
jc @f
|
||||
bt eax,5
|
||||
jc @f
|
||||
mov ebx,9
|
||||
jmp .siz0
|
||||
@@:
|
||||
mov ebx,16
|
||||
.siz0:
|
||||
and eax,7
|
||||
inc eax
|
||||
imul eax,ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
; ecx - 0xXX...... font options
|
||||
;output:
|
||||
; eax - font width in pixels
|
||||
align 4
|
||||
proc get_font_w uses ebx
|
||||
mov eax,ecx
|
||||
shr eax,24
|
||||
bt eax,4
|
||||
jc @f
|
||||
bt eax,5
|
||||
jc @f
|
||||
mov ebx,6
|
||||
jmp .siz0
|
||||
@@:
|
||||
mov ebx,8
|
||||
.siz0:
|
||||
and eax,7
|
||||
inc eax
|
||||
imul eax,ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
;<3B>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20> <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ樨 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
align 16
|
||||
proc tl_data_init uses eax ecx edi, tlist:dword
|
||||
@@ -125,6 +170,7 @@ proc tl_key uses ebx ecx edi, tlist:dword
|
||||
cmp tl_on_press,0
|
||||
je @f
|
||||
call tl_on_press
|
||||
jmp .no_edit
|
||||
@@:
|
||||
cmp ah,byte[ecx+1] ;Space
|
||||
jne @f
|
||||
@@ -463,34 +509,24 @@ proc tl_draw, tlist:dword
|
||||
|
||||
cmp tl_capt_cy,9 ;9 - minimum caption height
|
||||
jl @f
|
||||
mov ebx,edi ;calculate cursor position
|
||||
mov eax,tl_cur_pos
|
||||
inc eax
|
||||
lea edi,[txt_capt_cur.v]
|
||||
stdcall tl_convert_to_str, 5
|
||||
|
||||
mov edi,ebx
|
||||
call tl_draw_caption_cur_pos
|
||||
mov eax,tl_tim_undo
|
||||
or eax,eax
|
||||
jz @f
|
||||
mov ebx,edi ;save edi
|
||||
lea edi,[txt_capt_otm.v]
|
||||
stdcall tl_convert_to_str, 5
|
||||
mov edi,ebx ;restore edi
|
||||
|
||||
mov eax,SF_DRAW_TEXT ;captions
|
||||
mov ebx,tl_box_left
|
||||
shl ebx,16
|
||||
add ebx,5*65536+3
|
||||
add ebx,tl_box_top
|
||||
mov ecx,tl_col_txt
|
||||
or ecx,0x80000000
|
||||
lea edx,[txt_capt_cur]
|
||||
int 0x40
|
||||
|
||||
mov ebx,tl_box_left
|
||||
shl ebx,16
|
||||
add ebx,100*65536+3
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0x00ffffff
|
||||
or ecx,0x80000000
|
||||
add ebx,tl_box_top
|
||||
lea edx,[txt_capt_otm]
|
||||
int 0x40
|
||||
mcall SF_DRAW_TEXT ;undo
|
||||
@@:
|
||||
|
||||
;cycle to nodes
|
||||
@@ -1163,10 +1199,11 @@ proc tl_draw_node_caption uses ebx ecx edx esi
|
||||
ror ecx,16
|
||||
mov ebx,ecx
|
||||
add bx,tl_img_cy ;<3B><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sub bx,9 ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0xffffff
|
||||
mcall SF_DRAW_TEXT
|
||||
call get_font_h
|
||||
sub bx,ax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
and ecx,0x37ffffff
|
||||
mcall SF_DRAW_TEXT ;node text
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
@@ -1179,13 +1216,15 @@ endp
|
||||
align 4
|
||||
proc tl_get_draw_text_len uses eax ecx edx
|
||||
mov esi,eax ;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
||||
mov ecx,tl_col_txt
|
||||
call get_font_w
|
||||
mov ecx,eax
|
||||
mov eax,tl_box_left
|
||||
add eax,tl_box_width
|
||||
cmp eax,ebx
|
||||
jle .text_null ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><>࠭<EFBFBD><E0A0AD>
|
||||
sub eax,ebx
|
||||
xor edx,edx
|
||||
mov ecx,6 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
div ecx ;ᬮ<>ਬ <>쪮 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>࠭<EFBFBD>
|
||||
cmp esi,eax
|
||||
jl @f
|
||||
@@ -1858,10 +1897,8 @@ pushad
|
||||
.po8:
|
||||
call tl_node_move_po8 ;㧫<> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>塞 8 <20><>뫮<EFBFBD>
|
||||
.cur_mov:
|
||||
push dword edi
|
||||
call tl_cur_perv
|
||||
push dword edi
|
||||
call tl_draw
|
||||
stdcall tl_cur_perv, edi
|
||||
stdcall tl_draw, edi
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
@@ -1981,10 +2018,11 @@ tl_draw_caption_cur_pos:
|
||||
add ebx,5*65536+3
|
||||
add ebx,tl_box_top
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0x00ffffff
|
||||
or ecx,0xc0000000 ;0x40000000 <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> 䮭 梥⮬ edi
|
||||
lea edx,[txt_capt_cur]
|
||||
mov edi,tl_col_zag
|
||||
mcall SF_DRAW_TEXT ;captions
|
||||
mcall SF_DRAW_TEXT ;row number
|
||||
popad
|
||||
@@:
|
||||
ret
|
||||
@@ -2253,6 +2291,6 @@ align 4
|
||||
jge @f
|
||||
or al,0x30 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 ᨬ<><E1A8AC><EFBFBD> '0'
|
||||
stosb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> al <20> <20>祪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [edi]
|
||||
mov byte[edi],0
|
||||
mov word[edi],' ' ;add space symbol and 0
|
||||
@@:
|
||||
ret
|
||||
|
@@ -6,7 +6,7 @@ MK_C_SYM(__ieee754_expf)
|
||||
fstl %st(1)
|
||||
frndint
|
||||
fstl %st(2)
|
||||
fsubrp
|
||||
fsubp
|
||||
f2xm1
|
||||
fld1
|
||||
faddp
|
||||
|
@@ -32,7 +32,6 @@ section '.flat' code readable align 16
|
||||
include "..\..\..\KOSfuncs.inc"
|
||||
include "..\..\..\proc32.inc"
|
||||
include "..\..\..\macros.inc"
|
||||
include "..\..\..\dll.inc"
|
||||
include "..\..\..\bcc32\include\kos_func.inc"
|
||||
include "..\..\..\bcc32\include\kos_heap.inc"
|
||||
|
||||
@@ -44,9 +43,9 @@ include "..\..\..\bcc32\include\kos_heap.inc"
|
||||
@@StrToInt$qpc equ @StrToInt$qpc
|
||||
@@StrToDouble$qpc equ @StrToDouble$qpc
|
||||
|
||||
mem.alloc dd ? ;функция для выделения памяти
|
||||
mem.free dd ? ;функция для освобождения памяти
|
||||
mem.realloc dd ? ;функция для перераспределения памяти
|
||||
mem.alloc dd ? ;memory allocation function
|
||||
mem.free dd ? ;function to free up memory
|
||||
mem.realloc dd ? ;function for memory reallocation
|
||||
dll.load dd ?
|
||||
|
||||
PRECISION equ 16
|
||||
@@ -54,20 +53,20 @@ NNP_FF_BIN equ 0x6e6962
|
||||
NNP_FF_JSON equ 0x6e6f736a
|
||||
|
||||
struct Layer
|
||||
c_size dd ? ;+ 0 curent size - число нейронов в текущем слое
|
||||
n_size dd ? ;+ 4 next size - число нейронов на следующем слое
|
||||
c_size dd ? ;+ 0 curent size - number of neurons in the current layer
|
||||
n_size dd ? ;+ 4 next size - number of neurons in the next layer
|
||||
neurons dd ? ;+ 8 []
|
||||
biases dd ? ;+12 []
|
||||
weights dd ? ;+16 [][]
|
||||
ends
|
||||
|
||||
struct NeuralNetwork
|
||||
learningRate dq ? ;+ 0 скорость обучения
|
||||
layers dd ? ;+ 8 [] слои
|
||||
layers_length dd ? ;+12 число слоев
|
||||
activation dd ? ;+16 указатель на функцию активации
|
||||
derivative dd ? ;+20 указатель на функцию
|
||||
errors dd ? ;+24 массив для вычислений
|
||||
learningRate dq ? ;+ 0
|
||||
layers dd ? ;+ 8 []
|
||||
layers_length dd ? ;+12 number of layers
|
||||
activation dd ? ;+16 pointer to activation function
|
||||
derivative dd ? ;+20 function pointer
|
||||
errors dd ? ;+24 array for calculations
|
||||
errorsNext dd ? ;+28
|
||||
gradients dd ? ;+32
|
||||
deltas dd ? ;+36
|
||||
@@ -113,11 +112,6 @@ proc lib_init
|
||||
mov [mem.free], ebx
|
||||
mov [mem.realloc], ecx
|
||||
mov [dll.load], edx
|
||||
|
||||
or edx, edx
|
||||
jz @f
|
||||
invoke dll.load, @IMPORT
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
|
||||
@@ -137,6 +131,21 @@ Math_random:
|
||||
@@:
|
||||
db 0,0,128,55 ;dd 1.0/65536.0
|
||||
|
||||
align 16
|
||||
ieee754_exp:
|
||||
fld qword[esp+4]
|
||||
fldl2e ;push log2(e) onto stack
|
||||
fmulp
|
||||
fst st1 ;copies st0 to st1
|
||||
frndint ;round to integer
|
||||
fst st2 ;copies st0 to st2
|
||||
fsubp ;subtraction with stack pop
|
||||
f2xm1 ;raises 2 to the power st0 and subtracts 1
|
||||
fld1
|
||||
faddp
|
||||
fscale ;scale by powers of two
|
||||
ret
|
||||
|
||||
align 16
|
||||
sigmoid:
|
||||
push ebp
|
||||
@@ -145,7 +154,7 @@ sigmoid:
|
||||
fld qword[ebp+8]
|
||||
fchs
|
||||
fstp qword[esp]
|
||||
call dword[_exp]
|
||||
call ieee754_exp
|
||||
add esp,8
|
||||
fadd dword[f_1_0]
|
||||
fdivr dword[f_1_0]
|
||||
@@ -190,7 +199,7 @@ Layer_Create:
|
||||
mov dword[esi+Layer.weights],eax
|
||||
xor ebx,ebx
|
||||
cmp edi,ebx
|
||||
jbe .end_f
|
||||
jbe .end_f
|
||||
@@:
|
||||
mov eax,[ebp+16]
|
||||
shl eax,3
|
||||
@@ -250,18 +259,18 @@ NNP_Create:
|
||||
mov eax,[ebp+28] ;sizes
|
||||
lea edx,[eax+4]
|
||||
mov dword[ebp-8],edx ;save &sizes[i+1]
|
||||
jmp .150
|
||||
jmp .3
|
||||
.cycle_0: ;for (i=0; i < sizes_length; i++)
|
||||
xor ecx,ecx
|
||||
mov dword[ebp-4],ecx ;nextSize = 0
|
||||
mov eax,[ebp+32] ;sizes_length
|
||||
dec eax
|
||||
cmp edi,eax
|
||||
jae .152
|
||||
jae @f
|
||||
mov edx,[ebp-8]
|
||||
mov ecx,[edx]
|
||||
mov dword[ebp-4],ecx ;nextSize = sizes[i+1]
|
||||
.152:
|
||||
@@:
|
||||
mov eax,[ebp-4]
|
||||
push eax
|
||||
mov edx,[ebp-8]
|
||||
@@ -277,7 +286,7 @@ NNP_Create:
|
||||
mov eax,[ebp-8]
|
||||
lea edx,[eax-4]
|
||||
mov dword[ebp-12],edx ;save &sizes[i]
|
||||
jmp .154
|
||||
jmp .2
|
||||
.cycle_1: ;for (j=0; j < sizes[i]; j++)
|
||||
call Math_random
|
||||
fmul dword[f_2_0]
|
||||
@@ -290,7 +299,7 @@ NNP_Create:
|
||||
fstp qword[ecx+8*esi]
|
||||
xor ebx,ebx ;k=0
|
||||
cmp ebx,[ebp-4]
|
||||
jae .157
|
||||
jae .1
|
||||
@@: ;for (k=0; k < nextSize; k++)
|
||||
call Math_random
|
||||
fmul dword[f_2_0]
|
||||
@@ -305,15 +314,15 @@ NNP_Create:
|
||||
inc ebx
|
||||
cmp ebx,[ebp-4]
|
||||
jb @b
|
||||
.157:
|
||||
.1:
|
||||
inc esi
|
||||
.154:
|
||||
.2:
|
||||
mov ecx,[ebp-12]
|
||||
cmp esi,[ecx]
|
||||
jb .cycle_1
|
||||
inc edi
|
||||
add dword[ebp-8],4
|
||||
.150:
|
||||
.3:
|
||||
cmp edi,[ebp+32] ;sizes_length
|
||||
jb .cycle_0
|
||||
;create errors array
|
||||
@@ -349,7 +358,7 @@ f_2_0:
|
||||
f_1_0:
|
||||
dd 1.0
|
||||
|
||||
;заполнение случайными числами
|
||||
;random number filling
|
||||
;+ 8 NeuralNetwork* o
|
||||
align 16
|
||||
NNP_Reset:
|
||||
@@ -413,7 +422,7 @@ NNP_Reset:
|
||||
pop ebp
|
||||
ret 4
|
||||
|
||||
;расчет входных и выходных нейронов
|
||||
;calculation of input and output neurons
|
||||
;+ 8 NeuralNetwork* o
|
||||
;+12 double* inputs
|
||||
align 16
|
||||
@@ -508,7 +517,7 @@ NNP_BackPropagation:
|
||||
add edi,[esi+NeuralNetwork.layers]
|
||||
xor ebx,ebx ;i=0
|
||||
mov eax,[ebp+12] ;eax = targets[]
|
||||
jmp .180
|
||||
jmp .1
|
||||
align 4
|
||||
.cycle_0:
|
||||
mov edx,[edi+Layer.neurons]
|
||||
@@ -518,7 +527,7 @@ align 4
|
||||
fstp qword[ecx+8*ebx]
|
||||
inc ebx
|
||||
add eax,8
|
||||
.180:
|
||||
.1:
|
||||
cmp ebx,[edi+Layer.c_size]
|
||||
jb .cycle_0
|
||||
dec dword[ebp-4] ;k--
|
||||
@@ -528,7 +537,7 @@ align 4
|
||||
.cycle_1:
|
||||
sub edi,sizeof.Layer
|
||||
xor ebx,ebx ;i=0
|
||||
jmp .186
|
||||
jmp .2
|
||||
align 4
|
||||
.cycle_2:
|
||||
mov eax,[edi+sizeof.Layer+Layer.neurons]
|
||||
@@ -541,12 +550,12 @@ align 4
|
||||
mov edx,[esi+NeuralNetwork.gradients]
|
||||
fstp qword[edx+8*ebx]
|
||||
inc ebx
|
||||
.186:
|
||||
.2:
|
||||
cmp ebx,[edi+sizeof.Layer+Layer.c_size]
|
||||
jb .cycle_2
|
||||
mov edx,[esi+NeuralNetwork.deltas]
|
||||
xor ebx,ebx
|
||||
jmp .189
|
||||
jmp .3
|
||||
align 4
|
||||
.cycle_3:
|
||||
mov eax,[edi+Layer.c_size]
|
||||
@@ -556,7 +565,7 @@ align 4
|
||||
pop ecx
|
||||
mov dword[edx],eax
|
||||
xor eax,eax ;j=0
|
||||
jmp .191
|
||||
jmp @f
|
||||
align 4
|
||||
.cycle_4:
|
||||
mov ecx,[esi+NeuralNetwork.gradients]
|
||||
@@ -566,16 +575,16 @@ align 4
|
||||
mov ecx,[edx]
|
||||
fstp qword[ecx+8*eax]
|
||||
inc eax
|
||||
.191:
|
||||
@@:
|
||||
cmp eax,[edi+Layer.c_size]
|
||||
jb .cycle_4
|
||||
inc ebx
|
||||
add edx,4
|
||||
.189:
|
||||
.3:
|
||||
cmp ebx,[edi+sizeof.Layer+Layer.c_size]
|
||||
jb .cycle_3
|
||||
xor ebx,ebx
|
||||
jmp .195
|
||||
jmp .4
|
||||
align 4
|
||||
.cycle_5:
|
||||
mov eax,[esi+NeuralNetwork.errorsNext]
|
||||
@@ -583,7 +592,7 @@ align 4
|
||||
mov dword[eax+8*ebx],edx
|
||||
mov dword[eax+8*ebx+4],edx
|
||||
xor eax,eax ;j=0
|
||||
jmp .197
|
||||
jmp @f
|
||||
align 4
|
||||
.cycle_6:
|
||||
mov edx,[edi+Layer.weights]
|
||||
@@ -595,11 +604,11 @@ align 4
|
||||
fadd qword[ecx+8*ebx]
|
||||
fstp qword[ecx+8*ebx]
|
||||
inc eax
|
||||
.197:
|
||||
@@:
|
||||
cmp eax,[edi+sizeof.Layer+Layer.c_size]
|
||||
jb .cycle_6
|
||||
inc ebx
|
||||
.195:
|
||||
.4:
|
||||
cmp ebx,[edi]
|
||||
jb .cycle_5
|
||||
;copy errors to next level
|
||||
@@ -610,7 +619,7 @@ align 4
|
||||
mov eax,[esi+NeuralNetwork.deltas]
|
||||
mov dword[ebp-12],eax
|
||||
xor ebx,ebx ;i=0
|
||||
jmp .201
|
||||
jmp .6
|
||||
align 4
|
||||
.cycle_7:
|
||||
mov ecx,[esi+NeuralNetwork.gradients]
|
||||
@@ -620,7 +629,7 @@ align 4
|
||||
fstp qword[eax+8*ebx]
|
||||
xor eax,eax ;j=0
|
||||
mov edx,[ebp-12] ;edx = deltas[i]
|
||||
jmp .203
|
||||
jmp .5
|
||||
align 4
|
||||
.cycle_8:
|
||||
; mov ecx,[edx]
|
||||
@@ -656,7 +665,7 @@ align 4
|
||||
; pop edx
|
||||
;@@:
|
||||
inc eax
|
||||
.203:
|
||||
.5:
|
||||
cmp eax,[edi+Layer.c_size]
|
||||
jb .cycle_8
|
||||
mov eax,[ebp-12]
|
||||
@@ -664,7 +673,7 @@ align 4
|
||||
pop ecx
|
||||
inc ebx
|
||||
add dword[ebp-12],4
|
||||
.201:
|
||||
.6:
|
||||
cmp ebx,[edi+sizeof.Layer+Layer.c_size]
|
||||
jb .cycle_7
|
||||
dec dword[ebp-4]
|
||||
@@ -693,8 +702,7 @@ NNP_GetMemData:
|
||||
jne .end_f
|
||||
mov esi,[ebp+16]
|
||||
mov byte[esi],0
|
||||
stdcall [_strcat], esi,txt_QlearningRateQ_
|
||||
add esp,8
|
||||
stdcall str_cat, esi,txt_QlearningRateQ_
|
||||
push 1
|
||||
push PRECISION
|
||||
mov eax,[ebp+8]
|
||||
@@ -702,12 +710,9 @@ NNP_GetMemData:
|
||||
push dword[eax+NeuralNetwork.learningRate]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_zap_nl
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_Qlayers_lengthQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
stdcall str_cat, esi,txt_zap_nl
|
||||
stdcall str_cat, esi,txt_Qlayers_lengthQ
|
||||
push 1
|
||||
push 0
|
||||
mov ecx,[ebp+8]
|
||||
@@ -716,23 +721,18 @@ NNP_GetMemData:
|
||||
fstp qword[esp]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_zap_nl
|
||||
add esp,8
|
||||
.230:
|
||||
stdcall [_strcat], esi,txt_QlayersQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
stdcall str_cat, esi,txt_zap_nl
|
||||
stdcall str_cat, esi,txt_QlayersQ
|
||||
xor edi,edi ;i=0
|
||||
jmp .232
|
||||
jmp .7
|
||||
align 4
|
||||
.cycle_0:
|
||||
push esi
|
||||
call @@strlen$qpxc
|
||||
pop ecx
|
||||
add esi,eax
|
||||
stdcall [_strcat], esi,txt_nl_t_Qc_sizeQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,txt_nl_t_Qc_sizeQ
|
||||
mov ebx,edi
|
||||
imul ebx,sizeof.Layer
|
||||
push 1
|
||||
@@ -748,10 +748,8 @@ align 4
|
||||
fstp qword[esp]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_zap_nl_t_Qn_sizeQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
stdcall str_cat, esi,txt_zap_nl_t_Qn_sizeQ
|
||||
push 1
|
||||
push 0
|
||||
mov ecx,[ebp+8]
|
||||
@@ -765,21 +763,17 @@ align 4
|
||||
fstp qword[esp]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_zap_nl
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_t_QneuronsQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
stdcall str_cat, esi,txt_zap_nl
|
||||
stdcall str_cat, esi,txt_t_QneuronsQ
|
||||
xor ebx,ebx ;j=0
|
||||
jmp .234
|
||||
jmp .1
|
||||
align 4
|
||||
.cycle_1:
|
||||
test ebx,ebx
|
||||
je .235
|
||||
stdcall [_strcat], esi,txt_zap_sp
|
||||
add esp,8
|
||||
.235:
|
||||
je @f
|
||||
stdcall str_cat, esi,txt_zap_sp
|
||||
@@:
|
||||
push 1
|
||||
push PRECISION
|
||||
mov eax,edi
|
||||
@@ -791,29 +785,25 @@ align 4
|
||||
push dword[eax+8*ebx]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
inc ebx
|
||||
.234:
|
||||
.1:
|
||||
mov ecx,edi
|
||||
imul ecx,sizeof.Layer
|
||||
mov eax,[ebp+8]
|
||||
add ecx,[eax+NeuralNetwork.layers]
|
||||
cmp ebx,[ecx+Layer.c_size]
|
||||
jb .cycle_1
|
||||
stdcall [_strcat], esi,txt_sqbr_zap_nl
|
||||
add esp,8
|
||||
stdcall [_strcat], esi,txt_t_QbiasesQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,txt_sqbr_zap_nl
|
||||
stdcall str_cat, esi,txt_t_QbiasesQ
|
||||
xor ebx,ebx ;j=0
|
||||
jmp .238
|
||||
jmp .2
|
||||
align 4
|
||||
.cycle_2:
|
||||
test ebx,ebx
|
||||
je .239
|
||||
stdcall [_strcat], esi,txt_zap_sp
|
||||
add esp,8
|
||||
.239:
|
||||
je @f
|
||||
stdcall str_cat, esi,txt_zap_sp
|
||||
@@:
|
||||
push 1
|
||||
push PRECISION
|
||||
mov eax,edi
|
||||
@@ -825,43 +815,38 @@ align 4
|
||||
push dword[eax+8*ebx]
|
||||
call @@DoubleToStr$qduso
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
inc ebx
|
||||
.238:
|
||||
.2:
|
||||
mov ecx,edi
|
||||
imul ecx,sizeof.Layer
|
||||
mov eax,[ebp+8]
|
||||
add ecx,[eax+NeuralNetwork.layers]
|
||||
cmp ebx,[ecx+Layer.c_size]
|
||||
jb .cycle_2
|
||||
stdcall [_strcat], esi,txt_sqbr_zap_t_QweightsQ
|
||||
add esp,8
|
||||
stdcall str_cat, esi,txt_sqbr_zap_t_QweightsQ
|
||||
mov eax,[ebp+8]
|
||||
mov ecx,edi
|
||||
imul ecx,sizeof.Layer
|
||||
add ecx,[eax+NeuralNetwork.layers]
|
||||
cmp dword[ecx+Layer.n_size],0
|
||||
je .241
|
||||
je .6
|
||||
xor ebx,ebx
|
||||
jmp .243
|
||||
.242:
|
||||
jmp .5
|
||||
.cycle_3:
|
||||
test ebx,ebx
|
||||
je .244
|
||||
stdcall [_strcat], esi,txt_zap_nl_t_t
|
||||
add esp,8
|
||||
.244:
|
||||
stdcall [_strcat], esi,txt_sqbro
|
||||
add esp,8
|
||||
je @f
|
||||
stdcall str_cat, esi,txt_zap_nl_t_t
|
||||
@@:
|
||||
stdcall str_cat, esi,txt_sqbro
|
||||
xor eax,eax
|
||||
mov dword[ebp-4],eax
|
||||
jmp .246
|
||||
.245:
|
||||
jmp .4
|
||||
.3:
|
||||
cmp dword[ebp-4],0
|
||||
je .247
|
||||
stdcall [_strcat], esi,txt_zap_sp
|
||||
add esp,8
|
||||
.247:
|
||||
je @f
|
||||
stdcall str_cat, esi,txt_zap_sp
|
||||
@@:
|
||||
push 1
|
||||
push PRECISION
|
||||
mov edx,edi
|
||||
@@ -875,43 +860,39 @@ align 4
|
||||
push dword[ecx+8*eax]
|
||||
@@:
|
||||
call @@DoubleToStr$qduso
|
||||
dec dword[esp+8] ;уменьшаем PRECISION
|
||||
jz @f ;для избежания зацикливания
|
||||
dec dword[esp+8] ;decrease PRECISION
|
||||
jz @f ;to avoid looping
|
||||
cmp word[eax],'#'
|
||||
je @b ;если число не поместилось пробуем перевести с меньшей точностью
|
||||
je @b ;if the number does not fit, we try to translate with less precision
|
||||
@@:
|
||||
add esp,16
|
||||
stdcall [_strcat], esi,eax
|
||||
add esp,8
|
||||
stdcall str_cat, esi,eax
|
||||
inc dword[ebp-4]
|
||||
.246:
|
||||
.4:
|
||||
mov ecx,edi
|
||||
imul ecx,sizeof.Layer
|
||||
mov eax,[ebp+8]
|
||||
add ecx,[eax+NeuralNetwork.layers]
|
||||
mov ecx,[ecx+Layer.n_size]
|
||||
cmp ecx,[ebp-4]
|
||||
ja .245
|
||||
stdcall [_strcat], esi,txt_sqbr
|
||||
add esp,8
|
||||
ja .3
|
||||
stdcall str_cat, esi,txt_sqbr
|
||||
inc ebx
|
||||
.243:
|
||||
.5:
|
||||
mov eax,edi
|
||||
imul eax,sizeof.Layer
|
||||
mov ecx,[ebp+8]
|
||||
add eax,[ecx+NeuralNetwork.layers]
|
||||
cmp ebx,[eax+Layer.c_size]
|
||||
jb .242
|
||||
.241:
|
||||
stdcall [_strcat], esi,txt_sqbr_fbr_zap
|
||||
add esp,8
|
||||
jb .cycle_3
|
||||
.6:
|
||||
stdcall str_cat, esi,txt_sqbr_fbr_zap
|
||||
inc edi
|
||||
.232:
|
||||
.7:
|
||||
mov eax,[ebp+8]
|
||||
cmp edi,[eax+NeuralNetwork.layers_length]
|
||||
jb .cycle_0
|
||||
stdcall [_strcat], esi,txt_nl_t_sqbr
|
||||
add esp,8
|
||||
stdcall str_cat, esi,txt_nl_t_sqbr
|
||||
.end_f:
|
||||
pop edi esi ebx
|
||||
mov esp,ebp
|
||||
@@ -963,12 +944,11 @@ NNP_SetMemData:
|
||||
mov eax,[ebp+16]
|
||||
mov edx,[ebp+12]
|
||||
; cmp edx,NNP_FF_BIN
|
||||
; jne .191
|
||||
; jne @f
|
||||
;...
|
||||
;.191:
|
||||
;@@:
|
||||
cmp edx,NNP_FF_JSON
|
||||
jne .198
|
||||
.199:
|
||||
jne .9
|
||||
stdcall @@strstr$qpxct1, eax,txt_learningRate
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
@@ -976,27 +956,27 @@ NNP_SetMemData:
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .200
|
||||
jne @f
|
||||
mov eax,1
|
||||
jmp .193
|
||||
.200:
|
||||
jmp .end_f
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, esi,':'
|
||||
add esp,8
|
||||
mov ebx,eax
|
||||
test ebx,ebx
|
||||
jne .201
|
||||
jne @f
|
||||
mov eax,2
|
||||
jmp .193
|
||||
.201:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc ebx
|
||||
stdcall @@strchr$qpxci, esi,','
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .202
|
||||
jne @f
|
||||
mov eax,3
|
||||
jmp .193
|
||||
.202:
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov byte[esi],0
|
||||
inc esi
|
||||
stdcall @@StrToInt$qpc, ebx
|
||||
@@ -1008,38 +988,38 @@ NNP_SetMemData:
|
||||
mov eax,[ebp+8]
|
||||
mov edx,[eax+12]
|
||||
cmp edx,[ebp-4]
|
||||
je .203
|
||||
je @f
|
||||
mov eax,txt_err_layers_neq
|
||||
jmp .193
|
||||
.203:
|
||||
jmp .end_f
|
||||
@@:
|
||||
xor edi,edi ;i=0
|
||||
jmp .205
|
||||
.204: ;for(i=0;i<o->layers_length;i++)
|
||||
jmp .8
|
||||
.cycle_0: ;for(i=0;i<o->layers_length;i++)
|
||||
stdcall @@strstr$qpxct1, esi,txt_c_size
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .206
|
||||
jne @f
|
||||
mov eax,txt_err_c_size
|
||||
jmp .193
|
||||
.206:
|
||||
jmp .end_f
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, esi,':'
|
||||
add esp,8
|
||||
mov ebx,eax
|
||||
test ebx,ebx
|
||||
jne .207
|
||||
jne @f
|
||||
mov eax,6
|
||||
jmp .193
|
||||
.207:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc ebx
|
||||
stdcall @@strchr$qpxci, esi,','
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .208
|
||||
jne @f
|
||||
mov eax,7
|
||||
jmp .193
|
||||
.208:
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov byte[esi],0
|
||||
inc esi
|
||||
stdcall @@StrToInt$qpc, ebx
|
||||
@@ -1049,27 +1029,27 @@ NNP_SetMemData:
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .209
|
||||
jne @f
|
||||
mov eax,8
|
||||
jmp .193
|
||||
.209:
|
||||
jmp .end_f
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, esi,':'
|
||||
add esp,8
|
||||
mov ebx,eax
|
||||
test ebx,ebx
|
||||
jne .210
|
||||
jne @f
|
||||
mov eax,9
|
||||
jmp .193
|
||||
.210:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc ebx
|
||||
stdcall @@strchr$qpxci, esi,','
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .211
|
||||
jne @f
|
||||
mov eax,10
|
||||
jmp .193
|
||||
.211:
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov byte[esi],0
|
||||
inc esi
|
||||
stdcall @@StrToInt$qpc,ebx
|
||||
@@ -1081,11 +1061,11 @@ NNP_SetMemData:
|
||||
add eax,[edx+NeuralNetwork.layers]
|
||||
mov edx,[eax+Layer.c_size]
|
||||
cmp edx,[ebp-4]
|
||||
jne .213
|
||||
jne @f
|
||||
mov edx,[eax+Layer.n_size]
|
||||
cmp edx,[ebp-8]
|
||||
je .214
|
||||
.213:
|
||||
je .1
|
||||
@@:
|
||||
mov ecx,[ebp+8]
|
||||
stdcall NNP_GetMaxLLen,ecx
|
||||
mov ecx,edi
|
||||
@@ -1106,10 +1086,10 @@ NNP_SetMemData:
|
||||
add eax,edx
|
||||
stdcall Layer_Create,eax
|
||||
cmp ebx,[ebp-4] ;if(n>s || k>s)
|
||||
jb .215
|
||||
jb @f
|
||||
cmp ebx,[ebp-8]
|
||||
jae .214
|
||||
.215:
|
||||
jae .1
|
||||
@@:
|
||||
mov edx,[ebp+8]
|
||||
mov ecx,[edx+NeuralNetwork.errors]
|
||||
cmp ecx,[edx+NeuralNetwork.errorsNext]
|
||||
@@ -1135,45 +1115,45 @@ NNP_SetMemData:
|
||||
stdcall [mem.realloc], [edx+NeuralNetwork.deltas],ebx
|
||||
mov edx,[ebp+8]
|
||||
mov dword[edx+NeuralNetwork.deltas],eax
|
||||
.214:
|
||||
.1:
|
||||
stdcall @@strstr$qpxct1, esi,txt_biases
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .216
|
||||
jne @f
|
||||
mov eax,11
|
||||
jmp .193
|
||||
.216:
|
||||
jmp .end_f
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, esi,'['
|
||||
add esp,8
|
||||
mov ebx,eax
|
||||
test ebx,ebx
|
||||
jne .217
|
||||
jne @f
|
||||
mov eax,txt_err_sqbrl_b1
|
||||
jmp .193
|
||||
.217:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc ebx
|
||||
xor edx,edx
|
||||
mov dword[ebp-8],edx
|
||||
jmp .219
|
||||
.218:
|
||||
jmp .4
|
||||
.2:
|
||||
dec edx
|
||||
cmp eax,edx
|
||||
jae .220
|
||||
jae @f
|
||||
stdcall @@strchr$qpxci, ebx,','
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
jmp .221
|
||||
.220:
|
||||
jmp .3
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, ebx,']'
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
.221:
|
||||
.3:
|
||||
test esi,esi
|
||||
jne .222
|
||||
jne @f
|
||||
mov eax,13
|
||||
jmp .193
|
||||
.222:
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov byte[esi],0
|
||||
stdcall @@StrToDouble$qpc,ebx
|
||||
pop ecx
|
||||
@@ -1186,7 +1166,7 @@ NNP_SetMemData:
|
||||
mov edx,[eax+edx+Layer.biases]
|
||||
fstp qword[edx+8*ecx]
|
||||
inc dword[ebp-8]
|
||||
.219:
|
||||
.4:
|
||||
mov edx,edi
|
||||
imul edx,sizeof.Layer
|
||||
mov ecx,[ebp+8]
|
||||
@@ -1194,29 +1174,29 @@ NNP_SetMemData:
|
||||
mov edx,[edx+Layer.c_size]
|
||||
mov eax,[ebp-8]
|
||||
cmp edx,eax
|
||||
ja .218
|
||||
ja .2
|
||||
mov esi,ebx
|
||||
stdcall @@strstr$qpxct1, esi,txt_weights
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .224
|
||||
jne @f
|
||||
mov eax,14
|
||||
jmp .193
|
||||
.224:
|
||||
jmp .end_f
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, esi,'['
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
test esi,esi
|
||||
jne .225
|
||||
jne @f
|
||||
mov eax,txt_err_sqbrl_w1
|
||||
jmp .193
|
||||
.225:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc esi
|
||||
xor edx,edx
|
||||
mov dword[ebp-8],edx ;k=0
|
||||
jmp .227
|
||||
.226: ;for(k=0;k<o->layers[i].c_size;k++)
|
||||
jmp .7
|
||||
.cycle_1: ;for(k=0;k<o->layers[i].c_size;k++)
|
||||
|
||||
mov eax,edi
|
||||
imul eax,sizeof.Layer
|
||||
@@ -1226,39 +1206,39 @@ NNP_SetMemData:
|
||||
or eax,eax
|
||||
jnz .end_null_we
|
||||
inc dword[ebp-8] ;k++
|
||||
jmp .227 ;if 'weights' is null array
|
||||
jmp .7 ;if 'weights' is null array
|
||||
.end_null_we:
|
||||
|
||||
stdcall @@strchr$qpxci, esi,'['
|
||||
add esp,8
|
||||
mov ebx,eax
|
||||
test ebx,ebx
|
||||
jne .228
|
||||
jne @f
|
||||
mov eax,txt_err_sqbrl_w2
|
||||
jmp .193
|
||||
.228:
|
||||
jmp .end_f
|
||||
@@:
|
||||
inc ebx
|
||||
xor edx,edx
|
||||
mov dword[ebp-12],edx ;j=0
|
||||
jmp .230
|
||||
.229: ;for(j=0;j<o->layers[i].n_size;j++)
|
||||
jmp .6
|
||||
.cycle_2: ;for(j=0;j<o->layers[i].n_size;j++)
|
||||
dec edx
|
||||
cmp eax,edx ;eax = j, edx = n_size-1
|
||||
jae .231
|
||||
jae @f
|
||||
stdcall @@strchr$qpxci, ebx,','
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
jmp .232
|
||||
.231:
|
||||
jmp .5
|
||||
@@:
|
||||
stdcall @@strchr$qpxci, ebx,']'
|
||||
add esp,8
|
||||
mov esi,eax
|
||||
.232:
|
||||
.5:
|
||||
test esi,esi
|
||||
jne .233
|
||||
jne @f
|
||||
mov eax,txt_err_sqbrr_w2
|
||||
jmp .193
|
||||
.233:
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov byte[esi],0
|
||||
stdcall @@StrToDouble$qpc,ebx
|
||||
pop ecx
|
||||
@@ -1273,7 +1253,7 @@ NNP_SetMemData:
|
||||
mov edx,[ebp-12]
|
||||
fstp qword[eax+8*edx]
|
||||
inc dword[ebp-12]
|
||||
.230:
|
||||
.6:
|
||||
mov edx,edi
|
||||
imul edx,sizeof.Layer
|
||||
mov ecx,[ebp+8]
|
||||
@@ -1281,27 +1261,27 @@ NNP_SetMemData:
|
||||
mov edx,[edx+Layer.n_size]
|
||||
mov eax,[ebp-12]
|
||||
cmp edx,eax
|
||||
ja .229
|
||||
ja .cycle_2
|
||||
mov esi,ebx
|
||||
inc dword[ebp-8]
|
||||
.227:
|
||||
.7:
|
||||
mov eax,edi
|
||||
imul eax,sizeof.Layer
|
||||
mov edx,[ebp+8]
|
||||
add eax,[edx+NeuralNetwork.layers]
|
||||
mov eax,[eax+Layer.c_size]
|
||||
cmp eax,[ebp-8]
|
||||
ja .226
|
||||
ja .cycle_1
|
||||
inc edi
|
||||
.205:
|
||||
.8:
|
||||
mov edx,[ebp+8]
|
||||
cmp edi,[edx+NeuralNetwork.layers_length]
|
||||
jb .204
|
||||
jb .cycle_0
|
||||
xor eax,eax
|
||||
jmp .193
|
||||
.198:
|
||||
jmp .end_f
|
||||
.9:
|
||||
mov eax,1000
|
||||
.193:
|
||||
.end_f:
|
||||
pop edi esi ebx
|
||||
mov esp,ebp
|
||||
pop ebp
|
||||
@@ -1320,20 +1300,19 @@ Layer_Destroy:
|
||||
call @$bdele$qpv
|
||||
pop ecx
|
||||
xor ebx,ebx
|
||||
jmp .143
|
||||
.142:
|
||||
jmp @f
|
||||
.cycle_1:
|
||||
mov eax,[esi+Layer.weights]
|
||||
push dword[eax+4*ebx]
|
||||
call @$bdele$qpv
|
||||
pop ecx
|
||||
inc ebx
|
||||
.143:
|
||||
@@:
|
||||
cmp ebx,[esi+Layer.c_size]
|
||||
jb .142
|
||||
jb .cycle_1
|
||||
push dword[esi+Layer.weights]
|
||||
call @$bdele$qpv
|
||||
pop ecx
|
||||
.145:
|
||||
pop esi ebx ebp
|
||||
ret 4
|
||||
|
||||
@@ -1344,17 +1323,17 @@ NNP_Destroy:
|
||||
push ebx esi
|
||||
mov esi,[ebp+8]
|
||||
xor ebx,ebx
|
||||
jmp .232
|
||||
.231:
|
||||
jmp @f
|
||||
.cycle_1:
|
||||
mov eax,ebx
|
||||
imul eax,sizeof.Layer
|
||||
add eax,[esi+NeuralNetwork.layers]
|
||||
push eax
|
||||
call Layer_Destroy
|
||||
inc ebx
|
||||
.232:
|
||||
@@:
|
||||
cmp ebx,[esi+NeuralNetwork.layers_length]
|
||||
jb .231
|
||||
jb .cycle_1
|
||||
push dword[esi+NeuralNetwork.layers]
|
||||
call @$bdele$qpv
|
||||
pop ecx
|
||||
@@ -1398,14 +1377,3 @@ EXPORTS:
|
||||
sz_getmemdata db 'NNP_GetMemData',0
|
||||
sz_setmemdata db 'NNP_SetMemData',0
|
||||
sz_destroy db 'NNP_Destroy',0
|
||||
|
||||
align 16
|
||||
@IMPORT:
|
||||
|
||||
library \
|
||||
libc, 'libc.obj'
|
||||
|
||||
import libc, \
|
||||
_strcat, 'strcat',\
|
||||
_exp, 'exp'
|
||||
;_scanf, 'scanf',\ ;???
|
||||
|
@@ -13,7 +13,7 @@ sz app_board ,'/sys/develop/board',0
|
||||
sz app_tinypad ,'/sys/tinypad',0
|
||||
sz app_docpak ,'/sys/docpack',0
|
||||
|
||||
sz sysfuncs_param,'f',0
|
||||
sz sysfuncs_param,'e',0
|
||||
|
||||
include 'tp-tables.inc'
|
||||
include 'tp-locale.inc'
|
||||
|
@@ -41,6 +41,7 @@ dd 1, start, init_end, end_mem, stack_top, params, 0
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), es_ES, en_US.
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include "../../string.inc"
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../dll.inc'
|
||||
;include '../../debug.inc'
|
||||
@@ -369,6 +370,12 @@ endl
|
||||
|
||||
mcall 30,4,,1
|
||||
jmp .n
|
||||
@@:
|
||||
stdcall string.length, pathOut
|
||||
add eax, pathOut
|
||||
cmpne [eax - 1], byte '/', @f
|
||||
mov [eax - 1], byte 0
|
||||
dec dword[edtUnpPath.size]
|
||||
@@:
|
||||
mcall 30,4,pathOut,1
|
||||
.n:
|
||||
|
5
programs/games/flood-it/build.bat
Normal file
5
programs/games/flood-it/build.bat
Normal file
@@ -0,0 +1,5 @@
|
||||
@del *.
|
||||
@For /R %%i In (*.c) Do c-- "%%i"
|
||||
@rename *.com *.
|
||||
@pause
|
||||
@del warning.txt
|
@@ -1,9 +0,0 @@
|
||||
@del lang.h--
|
||||
@echo #define LANG_ENG 1 >lang.h--
|
||||
C-- flood-it.c
|
||||
@del flood-it
|
||||
@rename flood-it.com flood-it
|
||||
@kpack flood-it
|
||||
@del lang.h--
|
||||
@del warning.txt
|
||||
@pause
|
@@ -1,9 +0,0 @@
|
||||
@del lang.h--
|
||||
@echo #define LANG_RUS 1 >lang.h--
|
||||
C-- flood-it.c
|
||||
@del flood-it
|
||||
@rename flood-it.com flood-it
|
||||
@kpack flood-it
|
||||
@del lang.h--
|
||||
@del warning.txt
|
||||
@pause
|
@@ -1,49 +1,44 @@
|
||||
//Leency 06.10.2011, Flood-it! v2.41, GPL
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// Flood-it! - Strategy game: Flood the board with one color, within a step limit.
|
||||
// Copyright (C) 2011-2025 Leency <lipatov.kiril@gmail.com>
|
||||
|
||||
#include "lib\kolibri.h"
|
||||
#include "lib\random.h"
|
||||
|
||||
#ifndef AUTOBUILD
|
||||
#include "lang.h--"
|
||||
#endif
|
||||
|
||||
system_colors sc;
|
||||
proc_info Form;
|
||||
dword stak[100]; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dword help_window_stak[100];
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int DIFFICULTY_LEV_PARAMS[]={ 28, 14, 25, //<2F><><EFBFBD><EFBFBD><EFBFBD>
|
||||
17, 28, 50}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
//<2F><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
int BLOCK_SIZE = 28; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int BLOCKS_NUM = 14; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20> <20><> Y
|
||||
int MAX_CLICKS = 25; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define DEFAULT_BLOCK_COUNT 14
|
||||
#define DEFAULT_MAX_CLICKS 25
|
||||
#define MAX_BLOCK_SIZE 28
|
||||
char board_size = -1;
|
||||
int BLOCK_SIZE; //cell size
|
||||
int BLOCKS_NUM; //number of cells by X and Y
|
||||
int MAX_CLICKS; //max clicks for win
|
||||
int CLICKS; //how many clicks user already did
|
||||
int game_end;
|
||||
|
||||
int CLICKS = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define USER_PANEL_WIDTH 144
|
||||
|
||||
#define USER_PANEL_WIDTH 119
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD> <20><><EFBFBD><EFBFBD>,
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dword FIELD_COLORS[]= {0xf18db6, 0x605ca8, 0xfddc80, 0xdc4a20, 0x46b1e2, 0x7e9d1e, 0x232323, 0};
|
||||
char *BOARD_SIZES[]={ "S", "L", 0 };
|
||||
//six colors are used in a game for a cells
|
||||
//and seventh color is used to mark a cell during filling process
|
||||
dword FIELD_COLORS[] = {0xf18db6, 0x605ca8, 0xfddc80, 0xdc4a20, 0x46b1e2, 0x7e9d1e, 0x232323};
|
||||
char BOARD_SIZES[] = "S\0L";
|
||||
|
||||
|
||||
#ifdef LANG_RUS
|
||||
char *BUTTON_CAPTIONS[]={ " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F2]", " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F1]", " <20><>室 [Esc]", 0};
|
||||
char CLICKS_TEXT[]=" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: /";
|
||||
char LEVELS_TEXT[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:";
|
||||
char CLICKS_TEXT[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: /";
|
||||
char LEVELS_TEXT[]=" <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:";
|
||||
|
||||
char HELP_WINDOW_CAPTION[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
char *HELP_TEXT[]={ "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Flood-it?",
|
||||
"",
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥⮬ <20><> <20><>࠭<EFBFBD>祭<EFBFBD><EFBFBD><EFBFBD> <20><> 室<><E5AEA4>.",
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>稭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>孥<EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨. <20>롥<EFBFBD><EBA1A5><EFBFBD><EFBFBD> 梥<>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>",
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>, <20> <EFBFBD><EFBFBD><EFBFBD>⪨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⨬ 梥⮬ - ⠪ <20><> <EFBFBD><EFBFBD><EFBFBD>ᮥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<EFBFBD><EFBFBD>ᥤ<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨ ⮩ <20><> <20><><EFBFBD><EFBFBD>᪨. <20><>墠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>㦭<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭮<EFBFBD>",
|
||||
"<EFBFBD><EFBFBD> 室<><E5AEA4>. <20><>蠣<EFBFBD><E8A0A3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⥣<EFBFBD><E2A5A3> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਭ樯<E0A8AD><E6A8AF> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,",
|
||||
"<EFBFBD>⮡<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!",
|
||||
"<EFBFBD>롥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<>, <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD><EFBFBD>. <20><><EFBFBD>⪨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<EFBFBD>⨬ 梥⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - ⠪ <20><> <20><><EFBFBD>ᮥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<EFBFBD><EFBFBD>ᥤ<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨ ⮩ <EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪨. <20><>墠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD> <20><>",
|
||||
"<EFBFBD><EFBFBD>࠭<EFBFBD>祭<EFBFBD><EFBFBD><EFBFBD> <20><> 室<><E5AEA4>. <20><><EFBFBD><EFBFBD>㯭<EFBFBD> <20><><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><>᪨.",
|
||||
"",
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⠪<><E2A0AA> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>蠬<EFBFBD>:",
|
||||
"[Q] [W] [E]",
|
||||
@@ -62,28 +57,25 @@ char *BOARD_SIZES[]={ "S", "L", 0 };
|
||||
"vajutades nuppudele vasakul. Kui sa muudad v<>rvi pragusel alal,",
|
||||
"siis iga kokkupuutuv sama v<>rv muutub samaks. Nii saad ujutada",
|
||||
"teised alad m<>nguv<75>ljal <20>le. Valida saad 2 m<>nguv<75>lja suuruse",
|
||||
"vahel. Proovi v<>li <20>le ujutada etteandtud k<>ikude arvuga!",
|
||||
"Kaasahaarav ja l<>bus!",
|
||||
"vahel.",
|
||||
"",
|
||||
"M<EFBFBD>ngida saab ka klaviatuuriga:",
|
||||
"[Q] [W] [E]",
|
||||
"[A] [S] [D]",
|
||||
0};
|
||||
#else
|
||||
char *BUTTON_CAPTIONS[]={ "New Game [F2]", "Help [F1]", "Exit [Esc]", 0};
|
||||
char *BUTTON_CAPTIONS[]={ "Restart [F2]", " Help [F1]", " Exit [Esc]", 0};
|
||||
char CLICKS_TEXT[]="Clicks: /";
|
||||
char LEVELS_TEXT[]="Board:";
|
||||
|
||||
char HELP_WINDOW_CAPTION[]="Help";
|
||||
char *HELP_TEXT[]={ "How to play Flood-it?",
|
||||
"",
|
||||
"Flood the whole board with one color within the allowed steps.",
|
||||
"You start from the top left corner and progress by selecting one",
|
||||
"You start from the TOP LEFT corner and progress by selecting one",
|
||||
"of the colored buttons on the left. When you change your current area",
|
||||
"color, every adjacent square with the same color also changes, that",
|
||||
"way you can flood other areas of the board. Select from 3 sizes of",
|
||||
"way you can flood other areas of the board. Select from 2 sizes of",
|
||||
"the board and try to flood-it in the least amount of steps!",
|
||||
"Addictive and Fun!",
|
||||
"",
|
||||
"You can also play with keyboard:",
|
||||
"[Q] [W] [E]",
|
||||
@@ -92,7 +84,7 @@ char *BOARD_SIZES[]={ "S", "L", 0 };
|
||||
#endif
|
||||
|
||||
|
||||
unsigned char color_matrix[28*28]; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
unsigned char color_matrix[28*28]; //our field
|
||||
|
||||
unsigned char loss_matrix[14*14]={
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
@@ -132,152 +124,162 @@ void main()
|
||||
{
|
||||
int key, id;
|
||||
|
||||
set_board_size(0); //small board by default
|
||||
new_game();
|
||||
|
||||
loop()
|
||||
loop() switch(WaitEvent())
|
||||
{
|
||||
switch(WaitEvent())
|
||||
{
|
||||
case evButton:
|
||||
id = GetButtonID();
|
||||
IF (id==1) || (id==4) ExitProcess();
|
||||
IF (id==2) goto _NEW_GAME_MARK;
|
||||
IF (id==3) goto _HELP_MARK;
|
||||
IF (id>=100)
|
||||
{
|
||||
make_turn(id-100);
|
||||
case evButton:
|
||||
id = GetButtonID();
|
||||
IF (id==1) || (id==4) ExitProcess();
|
||||
IF (id==2) goto _NEW_GAME_MARK;
|
||||
IF (id==3) goto _HELP_MARK;
|
||||
IF (id>=100) {
|
||||
make_turn(id-100);
|
||||
}
|
||||
if (id==10) set_board_size(0);
|
||||
if (id==11) set_board_size(1);
|
||||
break;
|
||||
case evKey:
|
||||
key = GetKeyScancode();
|
||||
IF (key==01) //Escape
|
||||
ExitProcess();
|
||||
IF (key==59) //F1
|
||||
{
|
||||
_HELP_MARK:
|
||||
CreateThread(#help_thread,#help_window_stak);
|
||||
break;
|
||||
}
|
||||
if (id>=10)
|
||||
{
|
||||
id=id-10*3;
|
||||
|
||||
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[id]) break; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
BLOCK_SIZE = DIFFICULTY_LEV_PARAMS[id]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
BLOCKS_NUM = DIFFICULTY_LEV_PARAMS[id+1]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20> <20><> Y
|
||||
MAX_CLICKS = DIFFICULTY_LEV_PARAMS[id+2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
}
|
||||
IF (key==60) //F2
|
||||
{
|
||||
_NEW_GAME_MARK:
|
||||
new_game();
|
||||
|
||||
MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14);
|
||||
}
|
||||
break;
|
||||
case evKey:
|
||||
key = GetKeyScancode();
|
||||
IF (key==01) //Escape
|
||||
ExitProcess();
|
||||
IF (key==59) //F1
|
||||
{
|
||||
_HELP_MARK:
|
||||
CreateThread(#help,#stak);
|
||||
}
|
||||
IF (key==60) //F2
|
||||
{
|
||||
_NEW_GAME_MARK:
|
||||
new_game();
|
||||
draw_clicks_num();
|
||||
draw_field();
|
||||
}
|
||||
IF (key==16) make_turn(0); //Q
|
||||
IF (key==17) make_turn(1); //W
|
||||
IF (key==18) make_turn(2); //E
|
||||
IF (key==30) make_turn(3); //A
|
||||
IF (key==31) make_turn(4); //S
|
||||
IF (key==32) make_turn(5); //D
|
||||
break;
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
}
|
||||
draw_clicks_num();
|
||||
draw_field();
|
||||
break;
|
||||
}
|
||||
IF (key==16) make_turn(0); //Q
|
||||
IF (key==17) make_turn(1); //W
|
||||
IF (key==18) make_turn(2); //E
|
||||
IF (key==30) make_turn(3); //A
|
||||
IF (key==31) make_turn(4); //S
|
||||
IF (key==32) make_turn(5); //D
|
||||
break;
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
}
|
||||
}
|
||||
|
||||
void set_board_size(char s)
|
||||
{
|
||||
if (board_size != s) {
|
||||
board_size = s;
|
||||
|
||||
BLOCKS_NUM = board_size + 1 * DEFAULT_BLOCK_COUNT;
|
||||
MAX_CLICKS = board_size + 1 * DEFAULT_MAX_CLICKS;
|
||||
|
||||
BLOCK_SIZE = GetScreenHeight() - 70 / BLOCKS_NUM;
|
||||
if (BLOCK_SIZE > MAX_BLOCK_SIZE) BLOCK_SIZE = MAX_BLOCK_SIZE;
|
||||
|
||||
new_game();
|
||||
|
||||
MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH,
|
||||
BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void make_turn(int turn_id)
|
||||
{
|
||||
IF (color_matrix[0]==turn_id) return; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
||||
IF (CLICKS>=MAX_CLICKS) return; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
CLICKS++;
|
||||
draw_clicks_num();
|
||||
|
||||
fill_field(turn_id);
|
||||
draw_field();
|
||||
check_for_end(); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (color_matrix[0]==turn_id) return; //ignore no-sence click: first item color is equal to a new color
|
||||
IF (!game_is_ended()) {
|
||||
CLICKS++;
|
||||
draw_clicks_num();
|
||||
fill_field(turn_id);
|
||||
if (!game_is_ended()) draw_field();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void draw_window()
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
#define BUTTON_SIZE 28
|
||||
|
||||
sc.get();
|
||||
|
||||
DefineAndDrawWindow(300,176, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14, 0x74,sc.work,0,0,"Flood-it!");
|
||||
DefineAndDrawWindow(300,176, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH,
|
||||
BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14, 0x74,0,"Flood-it!");
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Fix rolled-up bug
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
IF (Form.status_window==4) return;
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Fill background to reduce window redraw
|
||||
for (i=0;i<=4;i++)
|
||||
{
|
||||
IF (i<>4)
|
||||
DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, BLOCK_SIZE*BLOCKS_NUM+9-i-i, sc.work);
|
||||
else
|
||||
DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, BLOCK_SIZE*BLOCKS_NUM+9-i-i, sc.work_graph); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ESI = sc.work;
|
||||
IF (i==4) ESI = sc.work_graph;
|
||||
DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, ESI);
|
||||
}
|
||||
DrawBar(0,0, USER_PANEL_WIDTH-5, BLOCK_SIZE*BLOCKS_NUM+10, sc.work);
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// Main buttons to fill the board
|
||||
#define FILL_BUTTON_SIZE BUTTON_SIZE+8
|
||||
for (i=0;i<6;i++) {
|
||||
DefineButton(i%3*FILL_BUTTON_SIZE+17,calc(i/3)*FILL_BUTTON_SIZE+15,
|
||||
FILL_BUTTON_SIZE,FILL_BUTTON_SIZE, i+100,FIELD_COLORS[i]);
|
||||
}
|
||||
|
||||
// Menu buttons
|
||||
for (i=0;i<3;i++)
|
||||
{
|
||||
DefineButton(17,i*31+140, 13*8+6, 25, i+2,sc.work_button);
|
||||
WriteText(17+4,i*31+146,0x90,sc.work_button_text,BUTTON_CAPTIONS[i],0);
|
||||
}
|
||||
|
||||
// Board size
|
||||
WriteText(17,BLOCKS_NUM*BLOCK_SIZE-25+7,0x90,sc.work_text,#LEVELS_TEXT,0);
|
||||
for (i=0;i<2;i++)
|
||||
for (j=0;j<3;j++)
|
||||
DefineButton(j*BUTTON_SIZE+17,i*BUTTON_SIZE+15,BUTTON_SIZE,BUTTON_SIZE, i*3+j+100,FIELD_COLORS[i*3+j]);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
for (j=0;j<3;j++)
|
||||
{
|
||||
DefineButton(17,j*25+120, 13*6+6, 20, j+2,sc.work_button);
|
||||
WriteText(17+4,j*25+127,0x80,sc.work_button_text,BUTTON_CAPTIONS[j],0);
|
||||
}
|
||||
IF (board_size == i) {
|
||||
ESI=sc.work_button;
|
||||
EDI=sc.work_button_text;
|
||||
} ELSE {
|
||||
ESI = sc.work;
|
||||
EDI = sc.work_text;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
WriteText(17,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,sc.work_text,#LEVELS_TEXT,0);
|
||||
for (j=0;j<2;j++)
|
||||
{
|
||||
DefineButton(j*25+56,BLOCKS_NUM*BLOCK_SIZE-20, 20,20, j+10,sc.work_button);
|
||||
|
||||
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[j*3]) EDI=0x800080;
|
||||
else EDI=sc.work_button_text;
|
||||
|
||||
WriteText(j*25+56+8,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,EDI,BOARD_SIZES[j],0);
|
||||
WriteText(j*25+56+9,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,EDI,BOARD_SIZES[j],0);
|
||||
DefineButton(i*32+69,BLOCKS_NUM*BLOCK_SIZE-24, 26,25, i+10,ESI);
|
||||
WriteText(i*32+69+9,BLOCKS_NUM*BLOCK_SIZE-24+6,0x90,EDI,#BOARD_SIZES+i+i,0);
|
||||
$add ebx, 1<<16 //bold
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
draw_clicks_num();
|
||||
|
||||
draw_clicks_num();
|
||||
draw_field();
|
||||
|
||||
}
|
||||
|
||||
void randomly_fill_the_board()
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) {
|
||||
color_matrix[i] = random(6);
|
||||
}
|
||||
}
|
||||
|
||||
void new_game()
|
||||
{
|
||||
int i;
|
||||
|
||||
CLICKS = 0;
|
||||
|
||||
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++)
|
||||
color_matrix[i] = random(6);
|
||||
game_end = false;
|
||||
randomly_fill_the_board();
|
||||
}
|
||||
|
||||
|
||||
void fill_field(int new_color_id)
|
||||
{
|
||||
int i, j,
|
||||
old_color_id=color_matrix[0],
|
||||
restart;
|
||||
int cur_cell;
|
||||
#define MARKED 6
|
||||
|
||||
color_matrix[0]=MARKED;
|
||||
@@ -289,15 +291,16 @@ void fill_field(int new_color_id)
|
||||
for (i=0;i<BLOCKS_NUM;i++)
|
||||
for (j=0;j<BLOCKS_NUM;j++)
|
||||
{
|
||||
IF (color_matrix[i*BLOCKS_NUM+j]<>old_color_id) continue; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (color_matrix[i*BLOCKS_NUM+j]==MARKED) continue; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
cur_cell = i*BLOCKS_NUM+j;
|
||||
IF (color_matrix[cur_cell]<>old_color_id) continue; //if not a needed color then continue
|
||||
IF (color_matrix[cur_cell]==MARKED) continue; //if already marked then continue
|
||||
|
||||
IF (j>0) && (color_matrix[i*BLOCKS_NUM+j-1]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (i>0) && (color_matrix[i-1*BLOCKS_NUM+j]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (j<BLOCKS_NUM-1) && (color_matrix[i*BLOCKS_NUM+j+1]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (i<BLOCKS_NUM-1) && (color_matrix[i+1*BLOCKS_NUM+j]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (j>0) && (color_matrix[i*BLOCKS_NUM+j-1]==MARKED) color_matrix[cur_cell]=MARKED; //left
|
||||
IF (i>0) && (color_matrix[i-1*BLOCKS_NUM+j]==MARKED) color_matrix[cur_cell]=MARKED; //top
|
||||
IF (j<BLOCKS_NUM-1) && (color_matrix[i*BLOCKS_NUM+j+1]==MARKED) color_matrix[cur_cell]=MARKED; //right
|
||||
IF (i<BLOCKS_NUM-1) && (color_matrix[i+1*BLOCKS_NUM+j]==MARKED) color_matrix[cur_cell]=MARKED; //bottom
|
||||
|
||||
IF (color_matrix[i*BLOCKS_NUM+j]==MARKED) restart=1; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (color_matrix[cur_cell]==MARKED) restart=1;
|
||||
}
|
||||
IF (restart) goto _RESTART_MARK;
|
||||
|
||||
@@ -305,101 +308,83 @@ void fill_field(int new_color_id)
|
||||
IF (color_matrix[i]==MARKED) color_matrix[i]=new_color_id;
|
||||
}
|
||||
|
||||
|
||||
int check_for_end()
|
||||
void draw_win_or_loose_animation(dword matrix)
|
||||
{
|
||||
int i, j, ii, jj;
|
||||
|
||||
if (CLICKS>=MAX_CLICKS) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
IF (CLICKS==MAX_CLICKS) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (color_matrix[i]<>color_matrix[0]) goto _loss_MARK;
|
||||
goto _WIN_MARK;
|
||||
}
|
||||
|
||||
_loss_MARK:
|
||||
|
||||
for (i=0;i<14;i++)
|
||||
for (j=0;j<14;j++)
|
||||
{
|
||||
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[0])
|
||||
{
|
||||
ii=i;
|
||||
jj=j;
|
||||
}
|
||||
else
|
||||
{
|
||||
ii=i*2;
|
||||
jj=j*2;
|
||||
}
|
||||
color_matrix[ii*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
|
||||
color_matrix[ii*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
|
||||
draw_field();
|
||||
//Pause(5);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IF (color_matrix[i]<>color_matrix[0]) return 0;
|
||||
|
||||
//<2F><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MAX_CLICKS -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
_WIN_MARK:
|
||||
|
||||
for (i=0;i<25;i++)
|
||||
{
|
||||
new_game();
|
||||
draw_field();
|
||||
Pause(7);
|
||||
}
|
||||
|
||||
CLICKS=MAX_CLICKS;
|
||||
|
||||
for (i=0;i<14;i++)
|
||||
for (i=0;i<14;i++) {
|
||||
for (j=0;j<14;j++)
|
||||
{
|
||||
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[0]) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
ii=i;
|
||||
jj=j;
|
||||
}
|
||||
else
|
||||
{
|
||||
ii=i*2;
|
||||
jj=j*2;
|
||||
}
|
||||
color_matrix[ii*BLOCKS_NUM+jj]=win_matrix[i*14+j];
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj]=win_matrix[i*14+j];
|
||||
color_matrix[ii*BLOCKS_NUM+jj+1]=win_matrix[i*14+j];
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj+1]=win_matrix[i*14+j];
|
||||
ii = board_size * 2 + i;
|
||||
jj = board_size * 2 + j;
|
||||
color_matrix[ii*BLOCKS_NUM+jj]=
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj]=
|
||||
color_matrix[ii*BLOCKS_NUM+jj+1]=
|
||||
color_matrix[ii+1*BLOCKS_NUM+jj+1]=ESBYTE[i*14+j+matrix];
|
||||
draw_field();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int field_is_solid()
|
||||
{
|
||||
int i;
|
||||
if (game_end) return 1;
|
||||
game_end = 1;
|
||||
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) {
|
||||
IF (color_matrix[i]<>color_matrix[0]) game_end = 0;
|
||||
}
|
||||
return game_end;
|
||||
}
|
||||
|
||||
int game_is_ended()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (game_end) return 1;
|
||||
|
||||
if (CLICKS>=MAX_CLICKS) //check for game end via max_clicks
|
||||
{
|
||||
IF (CLICKS==MAX_CLICKS) //probably user won on the last step
|
||||
{
|
||||
if (field_is_solid()) goto _WIN_MARK;
|
||||
}
|
||||
draw_win_or_loose_animation(#loss_matrix);
|
||||
return 1;
|
||||
} else {
|
||||
if (!field_is_solid()) return 0;
|
||||
|
||||
//field is solid and CLICKS<MAX_CLICKS -> win
|
||||
|
||||
_WIN_MARK:
|
||||
|
||||
for (i=0;i<25;i++)
|
||||
{
|
||||
randomly_fill_the_board();
|
||||
draw_field();
|
||||
//Pause(5);
|
||||
}
|
||||
return 1;
|
||||
Pause(7);
|
||||
}
|
||||
|
||||
draw_win_or_loose_animation(#win_matrix);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void draw_clicks_num()
|
||||
{
|
||||
#define TEXT_X 21
|
||||
#define TEXT_Y 92
|
||||
#define TEXT_X 19
|
||||
#define TEXT_Y 100
|
||||
|
||||
DrawBar(TEXT_X, TEXT_Y, USER_PANEL_WIDTH-TEXT_X-3,9, sc.work);
|
||||
DrawBar(TEXT_X, TEXT_Y, USER_PANEL_WIDTH-TEXT_X-5,16, sc.work);
|
||||
|
||||
WriteText(TEXT_X,TEXT_Y,0x80,sc.work_text,#CLICKS_TEXT,0);
|
||||
WriteText(TEXT_X,TEXT_Y,0x90,sc.work_text,#CLICKS_TEXT,0);
|
||||
|
||||
IF (CLICKS<10) EBX=9*6+TEXT_X;
|
||||
else EBX=8*6+TEXT_X;
|
||||
IF (CLICKS<10) EBX=9*8+TEXT_X;
|
||||
else EBX=8*8+TEXT_X;
|
||||
|
||||
WriteText(EBX,TEXT_Y,0x80,sc.work_text,IntToStr(CLICKS),0);
|
||||
WriteText(EBX,TEXT_Y,0x90,sc.work_text,itoa_nosign(CLICKS),0);
|
||||
|
||||
WriteText(11*6+TEXT_X,TEXT_Y,0x80,sc.work_text,IntToStr(MAX_CLICKS),0);
|
||||
WriteText(11*8+TEXT_X,TEXT_Y,0x90,sc.work_text,itoa_nosign(MAX_CLICKS),0);
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +402,7 @@ void draw_field()
|
||||
}
|
||||
|
||||
|
||||
void help()
|
||||
void help_thread()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -429,10 +414,10 @@ void help()
|
||||
IF (GetKeyScancode()==001) ExitProcess(); //Esc
|
||||
break;
|
||||
case evReDraw:
|
||||
for (i=0; HELP_TEXT[i]<>0; i++;) {};
|
||||
DefineAndDrawWindow(400,200,610,i*19+25+GetSkinHeight(),0x34,sc.work,0,0,#HELP_WINDOW_CAPTION);
|
||||
WriteText(6,12,0x90,sc.work_text,HELP_TEXT[0],0); //<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
for (i=0; HELP_TEXT[i]<>0; i++;) WriteText(5,i*19+12,0x90,sc.work_text,HELP_TEXT[i],0);
|
||||
//for (i=0; HELP_TEXT[i]<>0; i++;) {}; //calculate line numbers, predefined i=12 used to reduce size
|
||||
DefineAndDrawWindow(400,200,612,12*19+25+GetSkinHeight(),0x34,sc.work,#HELP_WINDOW_CAPTION);
|
||||
WriteText(6,12,0x90,sc.work_text,HELP_TEXT[0],0); //for a bold text
|
||||
for (i=0; HELP_TEXT[i]<>0; i++;) WriteText(7,i*19+12,0x90,sc.work_text,HELP_TEXT[i],0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,12 @@ dword I_Path = 0;
|
||||
#define BT_HIDE 0x40000000
|
||||
#define BT_NOFRAME 0x20000000
|
||||
|
||||
#define bool char
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
inline fastcall dword calc(EAX) { return EAX; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -94,16 +100,11 @@ inline fastcall Pause(dword EBX)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
char buffer[11]="";
|
||||
inline fastcall dword IntToStr(dword ESI)
|
||||
char buffer[5];
|
||||
inline fastcall dword itoa_nosign(dword ESI)
|
||||
{
|
||||
$mov edi, #buffer
|
||||
$mov ecx, 10
|
||||
$test esi, esi
|
||||
$jns f1
|
||||
$mov al, '-'
|
||||
$stosb
|
||||
$neg esi
|
||||
f1:
|
||||
$mov eax, esi
|
||||
$push -'0'
|
||||
@@ -126,7 +127,7 @@ f3:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
|
||||
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,EDI)
|
||||
{
|
||||
EAX = 12; // function 12:tell os about windowdraw
|
||||
EBX = 1;
|
||||
@@ -135,7 +136,7 @@ void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaC
|
||||
EBX = x << 16 + sizeX;
|
||||
ECX = y << 16 + sizeY;
|
||||
EDX = mainAreaType << 24 | mainAreaColour;
|
||||
ESI = headerType << 24 | headerColour;
|
||||
ESI = 0;
|
||||
$xor eax,eax
|
||||
$int 0x40
|
||||
|
||||
@@ -166,6 +167,13 @@ dword GetSkinHeight()
|
||||
$pop ebx
|
||||
}
|
||||
|
||||
inline fastcall int GetScreenHeight()
|
||||
{
|
||||
$mov eax, 14
|
||||
$int 0x40
|
||||
$and eax,0x0000FFFF
|
||||
}
|
||||
|
||||
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
|
||||
{
|
||||
EAX = 4;
|
||||
@@ -190,12 +198,20 @@ void DefineButton(dword x,y,w,h,EDX,ESI)
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
void DrawRegion(dword x,y,width,height,EDX)
|
||||
void DrawRegion(dword x,y,s,EDX)
|
||||
{
|
||||
DrawBar(x,y,width,1,EDX);
|
||||
DrawBar(x,y+height,width,1,EDX);
|
||||
DrawBar(x,y,1,height,EDX);
|
||||
DrawBar(x+width,y,1,height+1,EDX);
|
||||
EAX = 13;
|
||||
EBX = x<<16+s;
|
||||
ECX = y<<16+1;
|
||||
$int 0x40
|
||||
ECX = y+s<<16+1;
|
||||
$int 0x40
|
||||
EBX = x<<16+1;
|
||||
ECX = y<<16+s;
|
||||
$int 0x40
|
||||
EBX = x+s<<16+1;
|
||||
ECX = y<<16+s+1;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall dword WriteDebug(dword EDX)
|
||||
|
@@ -1,5 +1,11 @@
|
||||
====Leency====
|
||||
|
||||
v0.62 (21/03/2025)
|
||||
- proper window rolling up fix
|
||||
- bigger cells and fonts
|
||||
- add icon to a new game button
|
||||
- better alignment of ui elements in header
|
||||
|
||||
v0.52 (16/12/2008)
|
||||
- window rolling up fix
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user