summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-04-10 13:36:48 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-04-10 13:36:48 +0000
commitf1f7b9177e2b2b693b9aa805c6aa6bf9bab5ab17 (patch)
tree7c17d0ee8e3ed6ffecc8593a146553bad8b54db1
parent4ce43d169aab845e52d7130d11d3e2fe2f36b7f5 (diff)
downloadbullet-lab-remix-f1f7b9177e2b2b693b9aa805c6aa6bf9bab5ab17.tar.xz
Port highscore view and details menu. Menu rewrite is almost done!
Disable select key while transferring. Fix "typo" caused bugs. Hopefully fix small bugs in the new menu system. Rename several files. Add some additional files. Remove legacy menu components.
-rw-r--r--COPYING51
-rwxr-xr-xChangeLog (renamed from CHANGELOG.TXT)8
-rw-r--r--FAQ97
-rw-r--r--FAQ.zh89
-rw-r--r--INSTALL29
-rw-r--r--Levels.txt211
-rw-r--r--Readme247
-rw-r--r--Readme.zh242
-rwxr-xr-xVERSION1
-rwxr-xr-xVERSION.TXT1
-rw-r--r--global.h1
-rw-r--r--main.cpp100
-rw-r--r--menuitem.cpp203
-rw-r--r--menuitem.h47
-rw-r--r--menus.h490
-rw-r--r--scorec.h12
16 files changed, 1316 insertions, 513 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..bf98efc
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,51 @@
+BLRII itself distributes under the terms of the BSD license.
+Varieties of hge-unix and hge included in the source code distribution are still zlib-licensed.
+Here's the text of the BSD license and the zlib license.
+==============================================================================================
+Copyright (c) 2014, Chris Xiong
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of "Chrisoft" nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL CHRIS XIONG BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+==============================================================================================
+Copyright (c) 2003-2008 Relish Games
+ 2011 Ryan C. Gordon
+ 2013-2014 Chris Xiong
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from
+the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
diff --git a/CHANGELOG.TXT b/ChangeLog
index 88ccdda..4610dd4 100755
--- a/CHANGELOG.TXT
+++ b/ChangeLog
@@ -8,6 +8,14 @@ Random segmentation fault in "Hyper-threading".(seen only once,
can not reproduce now...)
Pre-Released versions:
+0.9.1-1_PR (r86)
+Port highscore view and details menu. Menu rewrite is almost done!
+Disable select key while transferring.
+Fix "typo" caused bugs.
+Hopefully fix small bugs in the new menu system.
+Rename several files. Add some additional files.
+Remove legacy menu components.
+
0.9.1-0_PR (r85)
Port death menu, complete menu and new highscore menu to the new
menu code base.
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..a2638db
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,97 @@
+===Under Construction===
+In fact, these Q&A's are not asked frequently at all.
+They all came from the messed up mind of the author!
+
+Q: I JUST CAN'T start it! (I can't see even a window!)
+A: Something must went wrong. There are two general causes.
+ 1. Failed to load a shared library.
+ 2. Initialization Failure.
+If the first one happened, BLRLOG.TXT will not even be created.
+To solve it, install the required runtime libs.
+If the second one happened, you can find out what really happened in
+BLRLOG.txt.
+
+However, the first one is not likely to happen. The official Windows
+build doesn't have too much external dependencies.
+
+Q: It crashed!
+A: This program is *pretty unstable* and may crash at any time.
+ If it crashed, you can post your problem with BLRLOG.txt attatched
+ to google code issue tracker. I'll try to fix the problem if I can
+ reproduce it.
+
+Q: "Cannot decompress resources!" (Windows only)
+A: I've compressed the resources of the game for Windows. As the game
+ starts, it will create two folders and decompress the resources
+ into them. If that failed, this problem will be reported.
+ Restarting the game may solve the problem.
+
+Q: Your code cannot compile!
+A: I'm pretty sure that it CAN compile(on my machine).
+ Check if you have all required sdks.
+ Additionally, if you checked out an older revision from svn, I
+ cannot guarantee that it can compile!
+
+Q: You included in-game music in your package, but they are not played!
+A: The playing code is commented. You can figure it out yourself.
+
+Q: What are BLRData.dtp and BLRMusic.dtp?
+A: As the name tells, these are archives containing the game data.
+ You can decompress them with expand.exe (which may be found in
+ the mystery folder "system32").
+
+Q: It's blurred?
+A: The game was designed for 800x600, and if you are using a resolution
+ other than 800x600 or running in fullscreen, this problem may occur.
+
+Q: I don't think the graphics are being rendered correctly.
+A: I don't know much about DirectX, for I left hge DirectX untouched.
+ However it shouldn't differ too much from the OpenGL version.
+ All quads are rendered as triangles, and uses vertex buffer.
+ Maybe there are "graphics driver dependent" contents, I'll correct them
+ later.
+
+Q: Tell me the history.
+A: Changelog tracked a full history of this project (Although it's not
+ detailed).
+ By the way, this project started as a fork of BLR I, which is already
+ closed by me now.
+
+Q: Are there command line options?
+A: Yes. It's documented in README.txt.
+ BTW, --start and --fast came up for debug purpose only.
+ However they are a hidden bonus for cheaters.
+ So, I won't remove that in the final version. I promise.
+ (P.S.: misusage of --start may cause severe problems!)
+
+Q: Rankings of this game?
+A: If you can reach level 1~3...
+ --You are not suitable playing this sort of game.
+ If you can reach level 4~6...
+ --You are a normal human-being.
+ If you can pass level 6 or reach level 7...
+ --You are unusual.
+ If you can pass level 7...
+ --Are you "nobody"?
+ If you can pass level -1...
+ --Tell me the reason why you come to Earth...
+
+Q: Are there other awards?
+A: Sorry, no...
+ You won't get anything but the ranking even you've passed level -1 without
+ collisions.
+ So... enjoy it yourself.
+
+Q: What hardwares/softwares do you use?
+A: I'm using a Lenovo Ideapad Y570 with Intel Core i7-2670QM CPU.
+ It has 8GiB of RAM and HD3000+Nvidia GT 555M. However I've disabled
+ GT 555M in BIOS so that it won't heat too much. Additionally,
+ I've got a 256GiB Crucial M4 SSD (That's useless, uh?).
+ This game is mainly developed under GNU/Linux.
+ I use Debian sid as my main system. (Yes, that's one of the reasons why
+ I like to "live on the edge".) KDE is my current desktop environent.
+ Usually, I use Code::Blocks IDE. Sometimes I use vim/geany+gdb.
+ For windows version compile, I use Visual Studio 2013 express.
+ The game graphic resources are made with GIMP.
+ Musics are made with Rosegarden, synthed with fluidsynth(qsynth frontend),
+ recorded with jack.record.
diff --git a/FAQ.zh b/FAQ.zh
new file mode 100644
index 0000000..f66b7a8
--- /dev/null
+++ b/FAQ.zh
@@ -0,0 +1,89 @@
+===建设中===
+In fact, these Q&A's are not asked frequently at all.
+They all came from the messed up mind of the author!
+
+Q: 我就是不能启动它!(我连个窗口都看不见!)
+A: 一定有什么东西出错了。大约是以下两个原因中的一个:
+ 1. 无法加载某个共享库。
+ 2. 初始化失败。
+如果发生的情况是第一种,那么BLRLOG.txt甚至都不会被创建。
+解决方法是安装所需的运行库。
+如果第二种发生了,你可以从BLRLOG.txt中看到到底是什么出了问题。
+
+不过,第一种情况发生的可能性非常小。发布的Windows版没有那么多外部依赖。
+
+Q: 它崩溃了!
+A: 这个程序还处于「非常不稳定的阶段」并且*随时*都可能崩溃。
+ 如果它崩溃了,你可以将你的问题附上BLRLOG.txt一起发到google code的问题
+ 跟踪(大致就是一个类似bugzilla的东西?)上。如果我能重新制造出这个问题,我将会在以后
+ 试着去修正它。
+
+Q: "Cannot decompress resources!" (仅限Windows)
+A: 我将Windows版的游戏资源压缩了。当游戏启动时,它会建立两个文件夹并将数据
+ 解压在其中。如果这失败了,将会弹出这个错误框。
+ 重启游戏大概就能解决了。
+
+Q: 你的代码没法编译!
+A: 我非常肯定它(在我的机器上)*能*编译。
+ 检查你是不是已经获取了所有需要的SDK。
+ 另外,如果你使用的是一个从svn获取的较老的版本,我就不能保证它能编译了…
+
+Q: 你的包中有一些音乐,但是他们根本没有被播放?
+A: 播放的代码被注释掉了。你可以自己发现的。
+
+Q: BLRData.dtp和BLRMusic.dtp是什么?
+A: 正如名字说的,他们包含了游戏的数据。
+ 你可以用expand.exe解压这两个文件,expand.exe可以从神秘的system32文件夹
+ 下找到。
+
+Q: 看起来很模糊?
+A: 这个游戏是为800x600分辨率设计的。如果你在用其他的分辨率或者以全屏运行它,
+ 可能会出现这个问题。
+
+Q: 我认为图形绘制的有问题。
+A: 对于DirectX,我了解的不太多,因为我没有修改hge的DirectX版。
+ 但是它不应该和OpenGL版有太大的不同。
+ 四边形都是使用顶点缓冲用三角形绘制的。(好像现在所有显卡都支持顶点缓冲?)
+ 或许还有些跟显卡驱动有关的问题,我将会在以后修正它们。
+
+Q: 请告诉我历史。。。
+A: Changelog里面记录了这个项目的整个历史(虽然不是很完整)。
+ 顺带一说,这个工程起初只是BLR I的一个fork(),而BLR I现在已经完工了。
+
+Q: 有命令行选项吗?
+A: 有,在README.txt中有其说明。
+ 顺便,--start和--fast选项一开始是为调试而设置的。
+ 但是它们也是作弊者的一个隐藏福利…
+ 所以,我在最终版中不会移除它。我保证不会(?)。
+ (错误地使用--start可能会导致严重问题!)
+
+Q: 等级?
+A: 如果你能到Level 1~3...
+ --你不适合玩这种游戏。
+ 如果你能到Level 4~6...
+ --一般的水平。
+ 如果你能通过Level 6或者玩到Level 7...
+ --你不太一般啊…
+ 如果你能通过Level 7...
+ --你是“没有人”吗?
+ 如果你能通过Level -1...
+ --告诉我你来地球的目的…
+
+Q: 有其他奖励吗?
+A: 对不起,没有…
+ 即使你一个没有吃到一个子弹地通了Level -1你也不会得到任何东西。
+ 所以…自娱自乐吧。
+
+Q: What hardwares/softwares do you use?
+A: I'm using a Lenovo Ideapad Y570 with Intel Core i7-2670QM CPU.
+ It has 8GiB of RAM and HD3000+Nvidia GT 555M. However I've disabled
+ GT 555M in BIOS so that it won't heat too much. Additionally,
+ I've got a 256GiB Crucial M4 SSD (That's useless, uh?).
+ This game is mainly developed under GNU/Linux.
+ I use Debian sid as my main system. (Yes, that's one of the reasons why
+ I like to "live on the edge".) KDE is my current desktop environent.
+ Usually, I use Code::Blocks IDE. Sometimes I use vim/geany+gdb.
+ For windows version compile, I use Visual Studio 2013 express.
+ The game graphic resources are made with GIMP.
+ Musics are made with Rosegarden, synthed with fluidsynth(qsynth frontend),
+ recorded with jack.record. \ No newline at end of file
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..c48e870
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,29 @@
+Installing a game is really useless, isn't it?
+So just compile it!
+
+A brief guide for compiling BLR
+Required SDKs:
+OpenAL
+ogg
+vorbis
+DirectX(Windows only)
+OpenGL(Linux only)
+SDL(Linux only)
+
+Steps to do:
+1. Get the source code.
+ You can choose from svn or the official packaged release.
+ The code from svn will always be newer than the official
+ packaged release.
+2. Get required SDKs mentioned above.
+ Piece of cake.
+3. Use Visual Studio(Windows) or Code::Blocks(Linux), create
+ project. Configure it correctly.
+ If you'd like to do it, you can also write a Makefile
+ yourself.
+4. Hit build (or type make)!
+5. If it failed, check step 2 and 3, then repeat step 4...
+
+Warning:
+Some revisions in the svn repo has noticeable problems.
+Always build the latest svn revision or official release!
diff --git a/Levels.txt b/Levels.txt
new file mode 100644
index 0000000..affaa0a
--- /dev/null
+++ b/Levels.txt
@@ -0,0 +1,211 @@
+BulletLabRemixII Level index
+
+Level 1 2/180
+River levels 120
+-It's confusing... so much bullets for Level1?
+ However it's fairly easy. Do not seek for death.
+Double-directed labyrinth 60
+-Still very easy.
+
+Level 2 4/215
+Polygon-red 60
+-This is not hard...
+ Fake bullets aren't always annoying.
+Polygon-white 60
+-Make good use of precise mode!
+Polygon-white locked 65
+-Find a good position, e.g. near by a line.
+Polygon-both 30
+-This part doesn't make sense.
+
+Level 3 4/150
+Reflective 30
+-Just meet them, do not make big movements.
+ They are pretty friendly aren't they?
+*4 30
+-It's a little difficult... Keep away from the edges!
+Rotate ???? 60
+-Stay away from the rotating bullets and you'll pass this level.
+Wall of blues? 30
+-Rather easy. Do not try to earn too may semi-collisions unless
+ you are really skilled.
+ Looks awesome?
+
+Level 4 5/243
+Orange 30
+-Don't make big movements and stay away from the edges. (why?)
+ Those fast bullets are really annoying.
+ Answer to the question asked in the tip: TH06 Cirno?
+ In fact many level started as a copy of some spellcards in
+ TH...
+Orange trap 5+5+4+4+3+3+2+2+5
+-Do NOT press shift!
+Double spinner 60
+-An easy part for level 4.
+Squash-2 60
+-Enjoy it yourself.
+Circle-drawing 60
+-Just draw the circle.
+ If you have any problem, try BLR 1.
+
+Level 5 8/338
+CChase 30+30
+-Don't set player move speed to 1!
+Vortex of leaves 60
+-This is another annoying level, looks awesome and hard.
+ Keep away from those 'laser''s!
+Upstream flow 60
+-Rather easy.
+ Looks like something in level 3.
+High speed threaten 30
+-It's JUST threaten!
+ Precision is important.
+ Practice makes perfect.
+Crossing threaten 30
+-Appears very hard.
+ Choose the correct time to cross those bullets.
+Orange trap2 2+2+2+2
+-Just another level from level 4.
+Fish in the barrel 60
+-Where have I seen this...
+the Unbreakable jail 30
+-This is fairly hard. Use CLR if you need it.
+
+Level 6 7/390
+Snow WHITE 30
+-Incredible fast. Do not treat your CLR as a
+ £100,000,000 cheque.
+Photokeratitis 10+10+10+10+10
+-This is sickly hard...
+ Treat fast bullets and slow bullets separately.
+Squash-4(?) 60
+-Do not be trapped! You only need ONE CLR!...
+Avalanche 60
+-Do not stay at the screen bottom, it's very dangerous...
+Dangerous target 60
+-Keep moving!
+ It's a nightmare if you've choose a slow player...
+Hexagon loops 10+20+7+7+7+19
+-Step well back and watch the show.
+Hyperfluid 60
+-Also known as Superfluid.
+ Designed to be a spellcard(?) of someone who has the ability
+ to manipulate ice...
+ In fact, liquid helium is not cold enough. It's still several
+ Kelvin's degrees. I can make it even colder.
+
+Level 7 12/930+ Mapped levels
+Spring thunder storm - panic? 60 Thunder storm...
+-Although it's based on something from level 6, they are completely
+ different!
+ And this one is really easy.
+<Color Transform>
+Rainbow tower - color theory 90 rainbow tower
+-Basic level. Is it from BLR 1?
+Rainbow bullets - nauty photon 60 Lazy level;)
+-Similar to one part in level1, but a lot harder.
+ Luck is really required.
+Rainbow effect - appearance 60 draw a rainbow (of bullet)
+-Random bullets. You will remember this part at once when you see the part.
+ If you feel it hard, go to assessment mode.
+Rainbow effect - interference 120 as the name tells
+-This part is REALLY easy... but why?
+Rainbow effect - diffraction 120 as the name tells
+-Pretty hard. Those piles of shit may crash straight into you.
+ The code is pretty ugly too.
+Rainbow effect - photon school 60 "particalization"!
+-Pretty hard. Use CLR if necessary.
+ It may be easier if you stay near the edges.
+<Color Transform>
+Over the Rainbow - timeless challenge - great circles
+-Your goal is to reach the red block...
+ And, this one is also pretty hard...
+ If you're not well-skilled and you are working on FPM, try --suicide--!
+Trypophobia 120 another two classes: Tail & Pile
+-Very hard. You'll never know where they will go next.
+ However, they won't step on the same place twice.
+ Will this cause trypophobia?
+Photon fusion 90 Use a slightly modified tower8...
+-Directed bullets+random bullets.
+ Find a formula for it.
+Wave of Photon 60 class WOP+Lazy of particalization
+-Not very hard at the beginning...
+Return to void 90 return (void)(...);
+-VERY HARD!!!
+ I don't know where this came from.
+ CLR is useless but it will give you a short period during which you are invincible.
+Level -1(Extreme) 7/1020
+unknown circles*2 60*2
+-Pretty easy as they are only the beginning of nightmare...
+Spiky 120
+-Hard. Their behavior is not predictable.
+Achromatopsia 120(90+30)
+-Or we should call this "deuteranopia vs protanopia"?
+Quad thread 120
+-Do you humans really support it?
+Supernova(additive blending) 120
+-Awesome supernova!
+ I enjoy coding(easy parts)...
+yellow explosive 90
+-Yellow explosive are poisonous? IDK.
+Sink over the horizon 90
+-Strange. You might be trapped without noticing it.
+Gravity vortex 120
+-It has nothing to do with gravity at all.
+Incomplete Reflective 120
+-Start in peace, end in mess.
+
+Level -2(Assess) 10/?
+-No CLR
+-Collision and step to next level
+Directed bullet
+-A copy of a spellcard from someone...
+ Towers don't collide you, however they should do so.
+Random bullet
+-Pure random.
+ Are they getting faster?
+Constant patterns
+-Pretty awesome.
+ Doesn't look like anything.
+Crossing 1(L+R)
+-They started spinning!!!
+Crossing 2(C)
+-Used by Moriya Suwako...
+ Round bullets made me dizzy.
+Fake sink
+-Aren't those things from the centre annoying...
+Sine wave
+-Oscilloscope?
+ Find a good place to vibrate with the graph...
+Density test
+-Really high density.
+ And they may block you way!
+ Pleaz.. don't be hopeless...
+"Pinballs"
+-Why these pinballs don't collide each other?
+Road Blocks
+-You'll understand this one day.
+Extreme High speed
+-Copy of one part in level 5.
+Laser crosses
+-Only a show off of the Laser class.
+Bonus test: Lunatic Lunar!
+-May be the legacy of a vintage game...
+
+
+
+Level Enter Limits:
+Classic:
+Level 3: 1 restart(all)
+Level 4: 2 restarts
+Level 5: 3 restarts
+Level 6: 5 restarts
+Level 7: 8 restarts
+Level -1: 2 restarts
+FPM:
+Level 3: 10 collisions
+Level 4: 40 collisions
+Level 5: 75 collisions
+Level 6: 125 collisions
+Level 7: 200 collisions
+Level 8: 50 collisions \ No newline at end of file
diff --git a/Readme b/Readme
new file mode 100644
index 0000000..a64b32c
--- /dev/null
+++ b/Readme
@@ -0,0 +1,247 @@
+This text is encoded in UTF-8.
+NOTE: This is a pre-release version. That means:
+-The program may crash. It may even cause data loss.
+-The levels may be too hard.
+-There may be strange behavior.
+-Now menus are partly broken...
+-The in-game music is included but won't be played. (See FAQ.txt)
+-The code may not even compile!
+
+BulletLabRemix II readme
+
+Story
+------------------------------------------------------------------------------------
+THE STORY OF THE COLOURS
+Once upon a time the colors of the world started to quarrel, all claimed that they
+were the best the most important the most useful the favorite.
+GREEN said:
+「Clearly I am the most important. I am the sign of life and of hope. I was chosen
+for grass and trees leaves. Without me all animals would die. Look over the
+countryside and you will see that I am in the majority.」
+BLUE interrupted...
+「You only think about the earth but consider the sky and the sea. It is the water
+that is the basis of life and drawn up by the clouds from the deep sea. The sky
+gives space and peace and serenity. Without my peace you would all be nothing.」
+YELLOW chuckled:
+「You are all so serious. I bring laughter gaiety and warmth into the world. The
+sun is yellow, the moon is yellow and the stars are yellow. Every time you look at
+a sunflower, the whole world starts to smile. Without me there would be no fun.」
+ORANGE started next to blow her trumpet.
+「I am the color of health and strength. I may be scarce but I am precious, for I
+serve the needs of human life. I carry the most important vitamins. Think of
+carrots, pumpkins, oranges, mangoes and pawpaws. I don't hang around all the time
+but when I fill the sky at sunrise or sunset, my beauty is so striking that no one
+gives another thought to any of you.」
+RED could stand it no longer. He shouted out:
+「I am the ruler of all of you - I am
+blood - lifes blood I am the color of danger and of bravery. I am willing to fight
+for a cause. I bring fire into the blood. Without me the earth would be as empty as
+the moon. I am the color of passion and of love, the red rose, the poinsettia and
+the poppy.」
+PURPLE rose up to his full height. He was very tall and spoke with great pomp:
+「I am the color of royalty and power. Kings chiefs and bishops have always chosen
+me for I am the sign of authority and wisdom. People do not question me - they
+listen and obey.」
+Finally INDIGO spoke much more quietly than all the others but with just as much
+determination:
+「Think of me. I am the color of silence. You hardly notice me but without me you
+all become superficial. I represent thought and reflection twilight and deep water.
+You need me for balance and contrast for prayer and inner peace.」
+And so the colors went on boasting each convinced of his or her own superiority.
+Their quarreling became louder and louder. Suddenly there was a startling flash of
+bright lightening - thunder rolled and boomed. Rain started to pour down
+relentlessly. The colors crouched down in fear drawing close to one another for
+comfort.
+In the midst of the clamor rain began to speak:
+「You foolish colors fighting amongst yourselves, each trying to dominate the rest.
+Don't you know that you were each made for a special purpose, unique and different?
+Join hands with one another and come to me!」
+Doing as they were told, the colors united and joined hands. The rain continued:
+「From now on when it rains each of you will stretch across the sky in a great bow
+of color as a reminder that you can all live in peace. The rainbow is a sign of
+hope for tomorrow. And so whenever a good rain washes the world and a rainbow
+appears in the sky let us remember to appreciate one another.」
+------------------------------------------------------------------------------------
+Well, that was about hundreds of thousand years ago.
+After a catastrophic disaster, they found some of them were missing...
+------------------------------------------------------------------------------------
+
+Generic Information
+------------------------------------------------------------------------------------
+My own comment on this game...
+A "game" filled with the smell of mysterious science and imagination(3:2 approximately).
+(I worked on it for almost 9 months, after all.)
+Others comments...
+-PIECE OF SHIT!!!
+-The author must be suffering from serious mental problems.(I agree...)
+-(literally translated from Chinese) Revenge on society...
+
+Requirements & Recommends
+Basic environment:
+CPU: Atom 1.6GHz will even work.
+RAM: 1GiB
+GPU&VRAM: Not worse than Intel HD Graphics.
+OS: Windows XP+ & DirectX9+ / Linux kernel 2.6+ & OpenGL 1.2+
+Recommended environment:
+GPU&VRAM: Very fast graphic rendering.
+Sound: Ability to run OpenAL software version.
+
+MORE Recommends...
+-SERIOUSLY, NO Trypophobia!
+-CheatEngine(skip levels, obtain more Clear Range's, and more...)
+-Some editors or compilers(If you find this impossible and want to make it easier)
+-(Additionally for the last one)Ability to read non human-readable code.
+-Achromatopsia(<-strikethrough)
+
+If, suddenly, you can't run it one day...
+Remove blr.cfg (remember to backup your score.cfg first!) then restart the game.
+It will ask you for initial settings.
+If this can't solve your problem, read FAQ.TXT for more.
+
+If you think something went wrong...
+Go to FAQ.txt.
+
+To Dear Windows Users
+This game is developed and tested mostly under Linux. The official Windows version is also
+built under Linux(awesome, isn't it?). It's only briefly tested.
+
+Menus
+------------------------------------------------------------------------------------
+Main menu
+-----------------------------------------------------------------------
+Start Select a mode and start the game.
+Highscores View highscores(Currently out of maintenance)
+Options Settings and Options
+About A dull credits list.
+Exit Parents are coming!!
+
+Game Modes
+-----------------------------------------------------------------------
+Classic
+The game ends instantly if you get a collision. However you can choose
+to continue...
+
+This mode kills your time silently.
+
+Assessment Mode
+You are the frog being boiled.
+Every levels get harder as time goes.
+You'll be brought to the next part if you had a collision.
+
+Go for the highest score!
+
+Free Play Mode
+You'll never die! Enjoy!...
+
+Command line options
+------------------------------------------------------------------------------------
+Yes, it accept command line options! (And some of them may be very useful...)
+You can override your settings with them if you can't start it after changing the settings.
+However they may cause strange behavior or crashes. So use with caution.
+Invalid parameters may cause unexpected behavior, (e.g. --start with inappropriate parameters)
+they should be used for debug purpose. But if you use it for cheating, I'm not against it.
+If it's run without arguments, the game will start normally.
+Otherwise... see below.
+--help Print command line usage and exit.
+--version Print version and exit.
+--start=x,y Start free play mode directly from level x part y. The part must be valid.
+--nosound Forcibly use no sound.
+--fullscreen=1/0 Forcibly use fullscreen/windowed. This will override your configuration.
+--vidmode=0~4 Forcibly use specific video mode instead the one in the configuration.
+ 0 800x600 (native resolution)
+ 1 640x480
+ 2 960x720
+ 3 1024x768
+ 4 1280x960
+--firststartup Forcibly run first start up. This will reset the score file.
+--fast Fast mode. All levels are two times shorter.
+--logfile=... Use an alternate log file name instead of the default "BLRLOG.txt".
+--nohideconsole Do not hide console (Windows version only).
+
+About the author
+------------------------------------------------------------------------------------
+-Senseless(this word has multiple means...)
+-Often know nothing to do next. If I accidently got it, I would do it at once.
+(slowly, though)
+-「The perfect balance of code length and efficiency 」
+-One of those "who (like to) live on the edge". --according to Debian maintainers.
+-Strange (as many people say)
+
+This is my first(or second?) time making so big a project. So, this game is written
+for a "framework" rather than the game itself. However, the "framework" seems to be
+very incomplete till now. Everything is still code...(Maybe this is just the
+"framework"?)
+
+Well, one day textures may also become code... That is, all textures will be drawn
+to the memory during the initialization...
+
+"Black History"
+------------------------------------------------------------------------------------
+This game first started as an simple hge&c++ rewrite of the original game "BulletLab".
+For an unknown reason, it became bigger and bigger, the core of hge is even altered.
+Several months or so after the creation of the project, BLRI(aka "The Creature of
+Colour") released.
+
+As BLRI was being finished, BLRII was forked from the code base of BLRI.
+Several "testbed" version was created over the code base of BLRI.
+Then the pre-release version created. Almost all original code from BLRI is removed.
+Now it has reached a position that I've never expected...
+
+Brief History
+------------------------------------------------------------------------------------
+The file ChangeLog contains the full history of this project.
+Here's a list of milestones.
+
+0.9.1-0_PR (r85)
+Menu rewrite(still in progress).
+
+0.9.0-1_PR (b79/r79)
+Finish assessment mode.
+Extend laser class.
+Several modify and fix to HGE.
+
+0.8.1-1_PR (b77)
+Completing all levels for Classic Mode and Free Play Mode.
+Switch to mingw-w64 for building Windows version.
+Prepare for assessment mode.
+
+0.7.3-0_PR (b73)
+Completing level 7.
+Lots and lots of fixes.
+Laser revesion is now r5 and work perfectly.
+
+0.6.2-2_PR (b52)
+Level 6 is complete.
+Supporting new music interfaces and added in-game music.
+
+0.5.3-2_PR (b43)
+Finishing level 5.
+New clear range trigger method and fixes to clear range.
+
+0.4.4-0_PRG (b37a)
+Regression version from 0.5.2-0_PR (b37).
+Released to public. Including the complete level 4, and some levels of Level 5.
+Fixed two minor problems.
+
+0.3.2-0_PR (b27)
+Completing level 3.
+Avoid hidden bullets.
+
+0.2.9-2_PR (b22)
+Completing level 2.
+0.2.9-1_PR (b21) is released to public.
+
+0.1.7-2_PR (b16)
+Level 1 is finished.
+
+TB130907 (b10)
+Laser implementation rev 2.
+
+TB130827 (b8)
+Initial laser implementation.
+
+TB130620~TB130818 (b1~b7)
+New towers and new levels.
+
+TB130610 (b0)
+Creation of the Testbed version.
diff --git a/Readme.zh b/Readme.zh
new file mode 100644
index 0000000..35a0fea
--- /dev/null
+++ b/Readme.zh
@@ -0,0 +1,242 @@
+This text is encoded in UTF-8.
+这是一个提前发布的版本,这意味着:
+-它可能会崩溃,甚至导致数据丢失。
+-关卡太难。
+-奇怪的行为。
+-现在菜单处于部分报废状态…
+-无视背景音乐(见FAQ.txt)
+-代码都可能编译不了!
+
+BulletLabRemix II Readme - 一个类似机翻的中文版
+
+背景
+------------------------------------------------------------------------------------
+//听说已经是高中英语完型填空了,就偷懒不翻译了…
+THE STORY OF THE COLOURS
+Once upon a time the colors of the world started to quarrel, all claimed that they
+were the best the most important the most useful the favorite.
+GREEN said:
+「Clearly I am the most important. I am the sign of life and of hope. I was chosen
+for grass and trees leaves. Without me all animals would die. Look over the
+countryside and you will see that I am in the majority.」
+BLUE interrupted...
+「You only think about the earth but consider the sky and the sea. It is the water
+that is the basis of life and drawn up by the clouds from the deep sea. The sky
+gives space and peace and serenity. Without my peace you would all be nothing.」
+YELLOW chuckled:
+「You are all so serious. I bring laughter gaiety and warmth into the world. The
+sun is yellow, the moon is yellow and the stars are yellow. Every time you look at
+a sunflower, the whole world starts to smile. Without me there would be no fun.」
+ORANGE started next to blow her trumpet.
+「I am the color of health and strength. I may be scarce but I am precious, for I
+serve the needs of human life. I carry the most important vitamins. Think of
+carrots, pumpkins, oranges, mangoes and pawpaws. I don't hang around all the time
+but when I fill the sky at sunrise or sunset, my beauty is so striking that no one
+gives another thought to any of you.」
+RED could stand it no longer. He shouted out:
+「I am the ruler of all of you - I am
+blood - lifes blood I am the color of danger and of bravery. I am willing to fight
+for a cause. I bring fire into the blood. Without me the earth would be as empty as
+the moon. I am the color of passion and of love, the red rose, the poinsettia and
+the poppy.」
+PURPLE rose up to his full height. He was very tall and spoke with great pomp:
+「I am the color of royalty and power. Kings chiefs and bishops have always chosen
+me for I am the sign of authority and wisdom. People do not question me - they
+listen and obey.」
+Finally INDIGO spoke much more quietly than all the others but with just as much
+determination:
+「Think of me. I am the color of silence. You hardly notice me but without me you
+all become superficial. I represent thought and reflection twilight and deep water.
+You need me for balance and contrast for prayer and inner peace.」
+And so the colors went on boasting each convinced of his or her own superiority.
+Their quarreling became louder and louder. Suddenly there was a startling flash of
+bright lightening - thunder rolled and boomed. Rain started to pour down
+relentlessly. The colors crouched down in fear drawing close to one another for
+comfort.
+In the midst of the clamor rain began to speak:
+「You foolish colors fighting amongst yourselves, each trying to dominate the rest.
+Don't you know that you were each made for a special purpose, unique and different?
+Join hands with one another and come to me!」
+Doing as they were told, the colors united and joined hands. The rain continued:
+「From now on when it rains each of you will stretch across the sky in a great bow
+of color as a reminder that you can all live in peace. The rainbow is a sign of
+hope for tomorrow. And so whenever a good rain washes the world and a rainbow
+appears in the sky let us remember to appreciate one another.」
+------------------------------------------------------------------------------------
+Well, that was about hundreds of thousand years ago.
+After a catastrophic disaster, they found some of them were missing...
+------------------------------------------------------------------------------------
+
+概要
+------------------------------------------------------------------------------------
+本人对该游戏的看法
+一个充斥着神秘的科学和想象气息的「游戏」(大约有3:2?)
+(毕竟是9个月的工作啊)
+别人的看法…
+-「一坨屎!!!」
+-「作者有精神疾病?」(我同意…)
+-「报复社会?」
+
+运行环境要求&推荐项目
+必需环境:
+CPU: Atom 1.6GHz也能运行。
+RAM: 1GiB
+GPU&VRAM: 不能比Intel HD Graphics更差的吧?
+操作系统: Windows XP+ & DirectX9+ / Linux kernel 2.6+ & OpenGL 1.2+
+推荐环境:
+GPU&VRAM: 非常快的渲染速度。
+声音: 能够运行OpenAL软件版。
+
+×更多×推荐项目…:
+-严肃的一项:不能有密集恐惧症!
+-CheatEngine(跳关,获取更多CLR…)
+-编辑器和编译器(如果你发现它太难,想要让它变简单些)
+-(附加在上一条之上)能读懂及其丑陋的代码。
+-全色盲(<-删除线)
+
+如果有一天你突然无法运行它了…
+删掉blr.cfg(记得备份score.cfg!)然后重新运行。
+它会重新进行初始化设定。
+如果这样无法解决你的问题,去看看FAQ.TXT。。。
+
+如果你认为什么东西出错了…
+->FAQ.TXT
+
+致亲爱的Windows用户
+开发和测试基本是在Linux下进行的。发布的Windows版也是从Linux下编译的(听起来很厉害?),它仅被简单地测试过。
+
+菜单
+------------------------------------------------------------------------------------
+主菜单
+-----------------------------------------------------------------------
+Start 选择一个模式并开始游戏。
+Highscores 浏览高分记录。(当前没有维护该功能:()
+Options 设置和选项。
+About 一个无聊的制作人员名单。
+Exit ××来了!
+
+模式
+-----------------------------------------------------------------------
+Classic 经典模式
+一旦你碰到了任何有判定的东西就立刻结束游戏。不过你可以选择继续…
+
+这种模式会默默地浪费时间…
+
+Assessment Mode 评分/检测模式
+温水煮青蛙实验。
+所有的关卡都会随着时间流逝而变难。
+如果你撞到了有判定的东西,就会进入下一关…
+
+试着撑过最长的时间吧!
+
+Free Play Mode 自由模式
+永远不会死的模式~
+
+命令行选项
+------------------------------------------------------------------------------------
+是的,它还接受命令行选项!(而且它们中有些还可能比较有用…)
+如果你调整了设置后无法运行了,你可以用它们来覆盖你的设置。
+但是它们中一些可能导致奇怪的行为或者崩溃。所以要小心使用。
+不合法的参数可能会导致不希望得到的结果(例如--start+不合适的参数)
+它们本来只应该用于调试目的。但是如果你要用它们来作弊,我也不反对…
+如果不带任何参数运行,游戏会以正常模式启动。
+其他情况的话。。。:
+--help 输出命令行用法并退出。
+--version 输出版本信息并退出。
+--start=x,y 直接从x关y部分开始自由模式的游戏。这个部分必须合法。
+--nosound 强制无声。
+--fullscreen=1/0 强制使用全屏/窗口模式。指定该选项后,直接无视blr.cfg中的全屏选项。
+--vidmode=0~4 强制使用指定的窗口尺寸。
+ 0 800x600 (原生大小)
+ 1 640x480
+ 2 960x720
+ 3 1024x768
+ 4 1280x960
+--firststartup 假定是第一次运行。这样会清空分数记录文件。
+--fast 「快速」模式。所有关卡都会变短两倍。
+--logfile=... 使用指定的日志文件名。
+--nohideconsole 不隐藏命令行输出窗口。(仅限Windows版本。)
+
+关于作者
+------------------------------------------------------------------------------------
+-Senseless(this word has multiple means...)
+-Often know nothing to do next. If I accidently got it, I would do it at once.
+(slowly, though)
+-「The perfect balance of code length and efficiency 」
+-One of those "who (like to) live on the edge". --according to Debian maintainers.
+-Strange (as many people say)
+
+这是我第一次(或者是第二次?)搞这么大的一个工程。所以这次与其说是写一个游戏,还不如说只是写了一个
+“框架”。但是,这个“框架”到现在看起来还非常不完整。所有东西都还是代码…(或许这样也算是一种「框架」?)
+
+好吧,有一天贴图甚至都会变成代码了…到那时贴图会在初始化时被现画到内存里…
+
+历史
+------------------------------------------------------------------------------------
+这个工程本来只是作为一个BulletLab的hge&C++重写开始的。
+由于不明的原因,它越来越大,甚至都改变了hge的核心。
+工程开始几个月后,BLRI(The Creature of Colour)发布了。
+
+当BLRI快要完成的时候,BLRII从BLRI中fork了出来。
+当时在BLRI代码的基础上建立了几个测试版本。
+后来预发布版建立了,几乎所有来自BLRI的代码都被删掉了。
+现在它达到了一个我从未期望它能达到的阶段…
+
+简短的版本历史
+------------------------------------------------------------------------------------
+ChangeLog包含了该工程的全部历史。
+这里是一个「里程碑」的列表。
+
+0.9.1-0_PR (r85)
+Menu rewrite(still in progress).
+
+0.9.0-1_PR (b79/r79)
+Finish assessment mode.
+Extend laser class.
+Several modify and fix to HGE.
+
+0.8.1-1_PR (b77)
+Completing all levels for Classic Mode and Free Play Mode.
+Switch to mingw-w64 for building Windows version.
+Prepare for assessment mode.
+
+0.7.3-0_PR (b73)
+Completing level 7.
+Lots and lots of fixes.
+Laser revesion is now r5 and work perfectly.
+
+0.6.2-2_PR (b52)
+Level 6 is complete.
+Supporting new music interfaces and added in-game music.
+
+0.5.3-2_PR (b43)
+Finishing level 5.
+New clear range trigger method and fixes to clear range.
+
+0.4.4-0_PRG (b37a)
+Regression version from 0.5.2-0_PR (b37).
+Released to public. Including the complete level 4, and some levels of Level 5.
+Fixed two minor problems.
+
+0.3.2-0_PR (b27)
+Completing level 3.
+Avoid hidden bullets.
+
+0.2.9-2_PR (b22)
+Completing level 2.
+0.2.9-1_PR (b21) is released to public.
+
+0.1.7-2_PR (b16)
+Level 1 is finished.
+
+TB130907 (b10)
+Laser implementation rev 2.
+
+TB130827 (b8)
+Initial laser implementation.
+
+TB130620~TB130818 (b1~b7)
+New towers and new levels.
+
+TB130610 (b0)
+Creation of the Testbed version.
diff --git a/VERSION b/VERSION
new file mode 100755
index 0000000..3b378b8
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.9.1-1_PR (r86) \ No newline at end of file
diff --git a/VERSION.TXT b/VERSION.TXT
deleted file mode 100755
index 22703fc..0000000
--- a/VERSION.TXT
+++ /dev/null
@@ -1 +0,0 @@
-0.9.1-0_PR (r85) \ No newline at end of file
diff --git a/global.h b/global.h
index b888ea9..2e4b22c 100644
--- a/global.h
+++ b/global.h
@@ -3,7 +3,6 @@
//Copyright Chrisoft 2014
#include <hge.h>
#include <hgefont.h>
-#include <hgegui.h>
#define MaxRes 80
#define Resd 20.0f
HGE *hge=0;
diff --git a/main.cpp b/main.cpp
index 4f02d2f..bae7e80 100644
--- a/main.cpp
+++ b/main.cpp
@@ -52,7 +52,6 @@
#endif
#include "libcgh.h"
#include "hgeft.h"
-#include "menuitem.h"
#include "global.h"
#include "music.h"
#include "scoresystem.h"
@@ -625,7 +624,7 @@ bool FrameFunc()
static float t=0.0f;
float tx,ty;
if (Current_Position==1&&hge->Input_GetKeyState(HGEK_ESCAPE))pauseMenu.Init(-200);
- int MMR=-1,SMR=-1,OMR=-1,PPMR=-1,PMR=-1,RTTMR=-1,DMR=-1,CMR=-1;
+ int MMR=-1,SMR=-1,OMR=-1,PPMR=-1,PMR=-1,RTTMR=-1,DMR=-1,CMR=-1,HSMR=-1,HSVMR=-1,HSDMR=-1;
if (mainMenu.isActive())MMR=mainMenu.Update();
if (startMenu.isActive())SMR=startMenu.Update();
if (optionMenu.isActive())OMR=optionMenu.Update();
@@ -635,31 +634,38 @@ bool FrameFunc()
if (deathMenu.isActive())DMR=deathMenu.Update();
if (completeMenu.isActive())CMR=completeMenu.Update();
if (newHighScoreGUI.isActive())newHighScoreGUI.Update();
+ if (highScoreMenu.isActive())HSMR=highScoreMenu.Update();
+ if (highScoreViewMenu.isActive())HSVMR=highScoreViewMenu.Update();
+ if (highScoreDetailsMenu.isActive())HSDMR=highScoreDetailsMenu.Update();
if (Current_Position==0)
{
if(!mainMenu.isActive())return true;
- switch(MMR)
+ if(~MMR)
{
- case 0:Current_Position=3;startMenu.Init();mainMenu.Leave();break;
- case 2:
- Current_Position=13;
- optionMenu.Init(-200);
- mainMenu.Leave();
- break;
- case 3:
- Credits->SetHotSpot(300,100);
- CreditsRail->SetHotSpot(300,100);
- creditsp=0;
- Music_Init("./Resources/Music/BLR2_TR09.ogg");
- lpst=lped=0;
- Music_Play();
- creditfly=1200;creditacc=0;credstop=creddone=false;
- Current_Position=4;
- mainMenu.Leave();
- break;
- case 4:mainMenu.Leave();break;
+ switch(MMR)
+ {
+ case 0:Current_Position=3;startMenu.Init();mainMenu.Leave();break;
+ case 1:Current_Position=8;highScoreMenu.Init(-200);mainMenu.Leave();break;
+ case 2:
+ Current_Position=13;
+ optionMenu.Init(-200);
+ break;
+ case 3:
+ Credits->SetHotSpot(300,100);
+ CreditsRail->SetHotSpot(300,100);
+ creditsp=0;
+ Music_Init("./Resources/Music/BLR2_TR09.ogg");
+ lpst=lped=0;
+ Music_Play();
+ creditfly=1200;creditacc=0;credstop=creddone=false;
+ Current_Position=4;
+ mainMenu.Leave();
+ break;
+ case 4:break;
+ }
+ mainMenu.Leave();
+ return false;
}
- if(~MMR)return false;
}
if (Current_Position==3)
{
@@ -766,10 +772,40 @@ bool FrameFunc()
return false;
}
}
- //if (Current_Position==7)newHighScoreGUI.Update(); where to do it?
- if (Current_Position==8)HighScoreGUI_FrameFnk();
- if (Current_Position==9)HSViewGUI_FrameFnk();
- if (Current_Position==10)HSDetGUI_FrameFnk();
+ if (Current_Position==8)
+ {
+ if(~HSMR)
+ {
+ if(HSMR<=2)
+ {Current_Position=9;highScoreViewMenu.Init(-200,HSMR);}
+ if(HSMR==3)
+ {Current_Position=0;mainMenu.Init(-200);}
+ highScoreMenu.Leave();
+ return false;
+ }
+ }
+ if (Current_Position==9)
+ {
+ if(~HSVMR)
+ {
+ if(HSVMR<=highScoreViewMenu.GetViewCount()&&HSVMR)
+ {Current_Position=10;highScoreDetailsMenu.Init(-200,highScoreViewMenu.View(),HSVMR);}
+ if(HSVMR==6)
+ {Current_Position=8;highScoreMenu.Init(-200);}
+ if(HSVMR&&(HSVMR<=highScoreViewMenu.GetViewCount()||HSVMR==6))
+ highScoreViewMenu.Leave();
+ return false;
+ }
+ }
+ if (Current_Position==10)
+ {
+ if(~HSDMR)
+ {
+ highScoreViewMenu.Init(-200,highScoreDetailsMenu.View());
+ highScoreDetailsMenu.Leave();Current_Position=9;
+ return false;
+ }
+ }
if (Current_Position==11)
{
if(~PMR)
@@ -917,6 +953,9 @@ bool FrameFunc()
if(deathMenu.isActive())deathMenu.Render();
if(completeMenu.isActive())completeMenu.Render();
if(newHighScoreGUI.isActive())newHighScoreGUI.Render();
+ if(highScoreMenu.isActive())highScoreMenu.Render();
+ if(highScoreViewMenu.isActive())highScoreViewMenu.Render();
+ if(highScoreDetailsMenu.isActive())highScoreDetailsMenu.Render();
if (Current_Position==0||Current_Position==3||Current_Position==8||
Current_Position==9||Current_Position==10||Current_Position==13||Current_Position==14)
{
@@ -924,9 +963,6 @@ bool FrameFunc()
}
if (Current_Position==2)ShowTip(lasttip);
if (Current_Position==4)AboutScene();
- if (Current_Position==8)HighScoreGUI->Render();
- if (Current_Position==9)HSViewGUI->Render();
- if (Current_Position==10)HSDetailGUI->Render();
fnt->SetColor(0xFFFFFFFF);
rbPanelFont.UpdateString(L" FPS: %.2f",hge->Timer_GetFPSf());
rbPanelFont.Render(785,595,0xFFFFFFFF,1);
@@ -1007,7 +1043,7 @@ void parseArgs(int argc,char *argv[])
if(!strcmp(argv[i],"--version"))
{
printf("Bullet Lab Remix II %s\n",BLRVERSION);
- printf("Built Date: %s",BuiltDate);
+ printf("Built Date: %s\n",BuiltDate);
exit(0);
}
bool valid=false;
@@ -1250,8 +1286,8 @@ int main(int argc,char *argv[])
startMenu.Init_Once();optionMenu.Init_Once();
pauseMenu.Init_Once();returnToTitleMenu.Init_Once();
deathMenu.Init_Once();completeMenu.Init_Once();
- playerPreferenceMenu.Init_Once();
- if(LOWFPS)hge->System_Log("%s: Low FPS Mode Enabled.",MAIN_SRC_FN);
+ playerPreferenceMenu.Init_Once();highScoreMenu.Init_Once();
+ highScoreViewMenu.Init_Once();highScoreDetailsMenu.Init_Once();
if(fNoSound)hge->System_Log("%s: Sound is disabled.",MAIN_SRC_FN);
if(startLvl)
{
diff --git a/menuitem.cpp b/menuitem.cpp
deleted file mode 100644
index 0b6c0b2..0000000
--- a/menuitem.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
-** Haaf's Game Engine 1.7
-** Copyright (C) 2003-2007, Relish Games
-** hge.relishgames.com
-**
-** Tutorial 06 - Creating menus
-*/
-
-// In menuitem.cpp/h we define the
-// behaviour of our custom GUI control
-
-#include "menuitem.h"
-#define UnfocColor 0xFFCCCC40
-#define FocColor 0xFFFFCC66
-//static const char* MENUITEM_SRC_FN="menuitem.cpp";
-
-// This is a GUI control constructor,
-// we should initialize all the variables here
-hgeGUIMenuItem::hgeGUIMenuItem(int _id, hgeFont *_fnt, HEFFECT _snd, float _x, float _y, float _delay, const char *_title)
-{
- float w;
-
- id=_id;
- fnt=_fnt;
- snd=_snd;
- delay=_delay;
- title=(char*)_title;
-
- color.SetHWColor(UnfocColor);
- shadow.SetHWColor(0x30000000);
- offset=0.0f;
- timer=-1.0f;
- timer2=-1.0f;
-
- bStatic=false;
- bVisible=true;
- bEnabled=true;
-
- w=fnt->GetStringWidth(title);
- rect.Set(_x-w/2, _y, _x+w/2, _y+fnt->GetHeight());
-}
-
-// Reposition the item
-void hgeGUIMenuItem::RePos(float x,float y)
-{
- float w=fnt->GetStringWidth(title);
- rect.Set(x-w/2, y, x+w/2, y+fnt->GetHeight());
-}
-
-// This method is called when the control should be rendered
-void hgeGUIMenuItem::Render()
-{
- fnt->SetColor(shadow.GetHWColor());
- fnt->Render(rect.x1+offset+3, rect.y1+3, HGETEXT_LEFT, title);
- fnt->SetColor(color.GetHWColor());
- fnt->Render(rect.x1-offset, rect.y1-offset, HGETEXT_LEFT, title);
-}
-
-// This method is called each frame,
-// we should update the animation here
-void hgeGUIMenuItem::Update(float dt)
-{
- if(timer2 != -1.0f)
- {
- timer2+=dt;
- if(timer2 >= delay+0.1f)
- {
- color=scolor2+dcolor2;
- shadow=sshadow+dshadow;
- offset=0.0f;
- timer2=-1.0f;
- }
- else
- {
- if(timer2 < delay) { color=scolor2; shadow=sshadow; }
- else { color=scolor2+dcolor2*(timer2-delay)*10; shadow=sshadow+dshadow*(timer2-delay)*10; }
- }
- }
- else if(timer != -1.0f)
- {
- timer+=dt;
- if(timer >= 0.2f)
- {
- color=scolor+dcolor;
- offset=soffset+doffset;
- timer=-1.0f;
- }
- else
- {
- color=scolor+dcolor*timer*5;
- offset=soffset+doffset*timer*5;
- }
- }
-}
-
-// This method is called when the GUI
-// is about to appear on the screen
-void hgeGUIMenuItem::Enter()
-{
- hgeColor tcolor2;
-
- scolor2.SetHWColor(UnfocColor&0x00FFFFFF);
- tcolor2.SetHWColor(UnfocColor);
- dcolor2=tcolor2-scolor2;
-
- sshadow.SetHWColor(0x00000000);
- tcolor2.SetHWColor(0x30000000);
- dshadow=tcolor2-sshadow;
-
- timer2=0.0f;
-}
-
-// This method is called when the GUI
-// is about to disappear from the screen
-void hgeGUIMenuItem::Leave()
-{
- hgeColor tcolor2;
-
- scolor2.SetHWColor(UnfocColor);
- tcolor2.SetHWColor(UnfocColor&0x00FFFFFF);
- dcolor2=tcolor2-scolor2;
-
- sshadow.SetHWColor(0x30000000);
- tcolor2.SetHWColor(0x00000000);
- dshadow=tcolor2-sshadow;
-
- timer2=0.0f;
-}
-
-// This method is called to test whether the control
-// have finished it's Enter/Leave animation
-bool hgeGUIMenuItem::IsDone()
-{
- if(timer2==-1.0f) return true;
- else return false;
-}
-
-// This method is called when the control
-// receives or loses keyboard input focus
-void hgeGUIMenuItem::Focus(bool bFocused)
-{
- hgeColor tcolor;
-
- if(bFocused)
- {
- hge->Effect_Play(snd);
- scolor.SetHWColor(UnfocColor);
- tcolor.SetHWColor(FocColor);
- soffset=0;
- doffset=4;
- }
- else
- {
- scolor.SetHWColor(FocColor);
- tcolor.SetHWColor(UnfocColor);
- soffset=4;
- doffset=-4;
- }
-
- dcolor=tcolor-scolor;
- timer=0.0f;
-}
-
-// This method is called to notify the control
-// that the mouse cursor has entered or left it's area
-void hgeGUIMenuItem::MouseOver(bool bOver)
-{
- if(bOver) gui->SetFocus(id);
-}
-
-// This method is called to notify the control
-// that the left mouse button state has changed.
-// If it returns true - the caller will receive
-// the control's ID
-bool hgeGUIMenuItem::MouseLButton(bool bDown)
-{
- if(!bDown)
- {
- offset=4;
- return true;
- }
- else
- {
- hge->Effect_Play(snd);
- offset=0;
- return false;
- }
-}
-
-// This method is called to notify the
-// control that a key has been clicked.
-// If it returns true - the caller will
-// receive the control's ID
-bool hgeGUIMenuItem::KeyClick(int key, int chr)
-{
- if(key==HGEK_ENTER || key==HGEK_SPACE || key==HGEK_Z)
- {
- MouseLButton(true);
- return MouseLButton(false);
- }
-
- return false;
-}
diff --git a/menuitem.h b/menuitem.h
deleted file mode 100644
index c350beb..0000000
--- a/menuitem.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** Haaf's Game Engine 1.7
-** Copyright (C) 2003-2007, Relish Games
-** hge.relishgames.com
-**
-** Tutorial 06 - Creating menus
-*/
-
-// In menuitem.cpp/h we define the
-// behaviour of our custom GUI control
-
-#include "hge.h"
-#include "hgegui.h"
-#include "hgefont.h"
-#include "hgecolor.h"
-//static const char* MENUITEM_H_FN="menuitem.h";
-
-
-class hgeGUIMenuItem : public hgeGUIObject
-{
-public:
- hgeGUIMenuItem(int id, hgeFont *fnt, HEFFECT snd, float x, float y, float delay, const char *title);
-
- virtual void Render();
- virtual void Update(float dt);
-
- virtual void Enter();
- virtual void Leave();
- virtual bool IsDone();
- virtual void Focus(bool bFocused);
- virtual void MouseOver(bool bOver);
-
- virtual bool MouseLButton(bool bDown);
- virtual bool KeyClick(int key, int chr);
- virtual void RePos(float x,float y);
- char *title;
-
-private:
- hgeFont *fnt;
- HEFFECT snd;
- float delay;
-
- hgeColor scolor, dcolor, scolor2, dcolor2, sshadow, dshadow;
- hgeColor color, shadow;
- float soffset, doffset, offset;
- float timer, timer2;
-};
diff --git a/menus.h b/menus.h
index 03e52c0..6f80255 100644
--- a/menus.h
+++ b/menus.h
@@ -119,6 +119,12 @@ static const char *CMStr[]={
"Yes",
"No thanks..."
};
+static const char *HSMStr[]={
+ "Classic Mode",
+ "Assessment Mode",
+ "Free Play Mode",
+ "Back"
+};
class MainMenu
{
private:
@@ -178,6 +184,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
return -1;
@@ -275,6 +282,7 @@ public:
ConfigureQuad(&LowerGradient,0,400+yoffset,800,120);
ConfigureQuad(&LeftGradient,0,320+yoffset,100,200);
ConfigureQuad(&RightGradient,700,320+yoffset,100,200);
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
return -1;
@@ -358,6 +366,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT)return -1;
if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
{
@@ -597,6 +606,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT)return -1;
if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT)
{
@@ -818,6 +828,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT&&!onIn)return 1;
@@ -892,6 +903,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
return -1;
@@ -969,6 +981,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
return -1;
@@ -1055,6 +1068,7 @@ public:
if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
return selected;
return -1;
@@ -1176,253 +1190,281 @@ public:
TipFont->printf(200+xoffset,240,HGETEXT_LEFT,"%s_",newname);
}
}newHighScoreGUI;
-//==================================================================================
-//Here's where old code dies...
-hgeGUI *HighScoreGUI;
-hgeGUI *HSViewGUI,*HSDetailGUI;
-char HSVstr[7][255];
-char HSDetstr[10][255];
-int view,detv;
-void HSViewGUI_Init();
-void HighScoreGUI_Init();
-void HSDetGUI_Init()
+class HighScoreMenu
{
- HSDetailGUI=new hgeGUI();
- Current_Position=10;
- switch (view)
+private:
+ bool active,onIn,onOut;
+ int selected;
+ double xoffset,yoffset,dyoffset;
+ hgeSprite *Ribb,*HSTitle;
+ hgeQuad UpperGradient,LowerGradient;
+public:
+ bool isActive(){return active;}
+ void Init_Once()
{
- case 1:
- memset(HSDetstr,0,sizeof(HSDetstr));
- if (!ERec[detv].score)sprintf(HSDetstr[1],"Nothing here...");
- else
- {
- sprintf(HSDetstr[1],"No. %d of Easy Mode",detv);
-#ifdef WIN32
- sprintf(HSDetstr[2],"Scored %I64d by %s",ERec[detv].score,ERec[detv].name);
-#else
- sprintf(HSDetstr[2],"Scored %lld by %s",ERec[detv].score,ERec[detv].name);
-#endif
- sprintf(HSDetstr[3],"Restarts %d",ERec[detv].rescol);
- sprintf(HSDetstr[4],"Semi-Collisions %d",ERec[detv].scoll);
- sprintf(HSDetstr[5],"CLR Usage %d",ERec[detv].clrusg);
- sprintf(HSDetstr[6],"Average FPS %d.%d",ERec[detv].af_int,ERec[detv].af_fric);
- }
- for (int i=1;i<=6;++i)
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(i,fnt,snd,400,170+30*i,0.1f*i-0.1f,HSDetstr[i])),
- HSDetailGUI->EnableCtrl(i,false);
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,380,0.6f,"Back"));
- break;
- case 2:
- memset(HSDetstr,0,sizeof(HSDetstr));
- if (!NRec[detv].score)sprintf(HSDetstr[1],"Nothing here...");
- else
- {
- sprintf(HSDetstr[1],"No. %d of Normal Mode",detv);
-#ifdef WIN32
- sprintf(HSDetstr[2],"Scored %I64d by %s",NRec[detv].score,NRec[detv].name);
-#else
- sprintf(HSDetstr[2],"Scored %lld by %s",NRec[detv].score,NRec[detv].name);
-#endif
- sprintf(HSDetstr[3],"Restarts %d",NRec[detv].rescol);
- sprintf(HSDetstr[4],"Semi-Collisions %d",NRec[detv].scoll);
- sprintf(HSDetstr[5],"CLR Usage %d",NRec[detv].clrusg);
- sprintf(HSDetstr[6],"Average FPS %d.%d",NRec[detv].af_int,NRec[detv].af_fric);
- }
- for (int i=1;i<=6;++i)
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(i,fnt,snd,400,170+30*i,0.1f*i-0.1f,HSDetstr[i])),
- HSDetailGUI->EnableCtrl(i,false);
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,380,0.6f,"Back"));
- break;
- case 3:
- memset(HSDetstr,0,sizeof(HSDetstr));
- if (!ExRec[detv].score)sprintf(HSDetstr[1],"Nothing here...");
+ Ribb=new hgeSprite(MenuTex,256,350,64,16);
+ HSTitle=new hgeSprite(MenuTex,0,376,256,64);
+ Ribb->SetColor(0xCCFFFFFF);
+ }
+ void Init(double start)
+ {
+ xoffset=start;onIn=true;active=true;
+ selected=0;dyoffset=yoffset=-selected*30;
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,50);
+ UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF);
+ UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,100);
+ LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00);
+ LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF);
+ }
+ void Leave(){onOut=true;}
+ int Update()
+ {
+ if(onIn)
+ {
+ if(fabs(xoffset-500)<hge->Timer_GetDelta()*1600)return xoffset=500,onIn=false,-1;
+ if(xoffset<500)
+ xoffset+=hge->Timer_GetDelta()*1600;
else
- {
- sprintf(HSDetstr[1],"No. %d of Extreme Mode",detv);
-#ifdef WIN32
- sprintf(HSDetstr[2],"Scored %I64d by %s",ExRec[detv].score,ExRec[detv].name);
-#else
- sprintf(HSDetstr[2],"Scored %lld by %s",ExRec[detv].score,ExRec[detv].name);
-#endif
- sprintf(HSDetstr[3],"Restarts %d",ExRec[detv].rescol);
- sprintf(HSDetstr[4],"Semi-Collisions %d",ExRec[detv].scoll);
- sprintf(HSDetstr[5],"CLR Usage %d",ExRec[detv].clrusg);
- sprintf(HSDetstr[6],"Average FPS %d.%d",ExRec[detv].af_int,ExRec[detv].af_fric);
- }
- for (int i=1;i<=6;++i)
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(i,fnt,snd,400,170+30*i,0.1f*i-0.1f,HSDetstr[i])),
- HSDetailGUI->EnableCtrl(i,false);
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,380,0.6f,"Back"));
- break;
- case 4:
- memset(HSDetstr,0,sizeof(HSDetstr));
- if (!FPMRec[detv].score)sprintf(HSDetstr[1],"Nothing here...");
+ xoffset-=hge->Timer_GetDelta()*1600;
+ }
+ if(onOut)
+ {
+ xoffset+=hge->Timer_GetDelta()*1600;
+ if(xoffset>=850)active=onOut=false;
+ }
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,100);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,110);
+ if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected;
+ if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<4-1)++selected;
+ if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=4-1;
+ yoffset=-selected*30;
+ if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
+ if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
+ if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
+ if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
+ return selected;
+ return -1;
+ }
+ void Render()
+ {
+ for(int i=0;i<4;++i)
+ {
+ double calcy=i*30+dyoffset+400;
+ if(calcy>289.9&&calcy<540.1)
+ MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,HSMStr[i]);
+ }
+ Ribb->RenderEx(xoffset-50,395,0,4.5,1);
+ Ribb->RenderEx(xoffset-50,422,0,4.5,1);
+ hge->Gfx_RenderQuad(&UpperGradient);
+ hge->Gfx_RenderQuad(&LowerGradient);
+ HSTitle->Render(xoffset-250,300);
+ }
+}highScoreMenu;
+class HighScoreViewMenu
+{
+private:
+ bool active,onIn,onOut;
+ int selected,view;
+ double xoffset,yoffset,dyoffset;
+ hgeSprite *Ribb;
+ hgeQuad UpperGradient,LowerGradient;
+public:
+ int View(){return view;}
+ int GetViewCount(){return view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0;}
+ bool isActive(){return active;}
+ void Init_Once()
+ {
+ Ribb=new hgeSprite(MenuTex,256,350,64,16);
+ Ribb->SetColor(0xCCFFFFFF);
+ }
+ void Init(double start,int _v)
+ {
+ xoffset=start;onIn=true;active=true;
+ selected=1;dyoffset=yoffset=-selected*30;view=_v;
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,50);
+ UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF);
+ UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,120);
+ LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00);
+ LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF);
+ }
+ void Leave(){onOut=true;}
+ int Update()
+ {
+ if(onIn)
+ {
+ if(fabs(xoffset-400)<hge->Timer_GetDelta()*1600)return xoffset=400,onIn=false,-1;
+ if(xoffset<400)
+ xoffset+=hge->Timer_GetDelta()*1600;
else
+ xoffset-=hge->Timer_GetDelta()*1600;
+ }
+ if(onOut)
+ {
+ xoffset+=hge->Timer_GetDelta()*1600;
+ if(xoffset>=850)active=onOut=false;
+ }
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,100);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,120);
+ if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected;
+ if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<7-1)++selected;
+ if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=7-1;
+ yoffset=-selected*30;
+ if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
+ if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
+ if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
+ if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
+ return selected;
+ return -1;
+ }
+ void Render()
+ {
+ if(dyoffset+400>289.9)
+ MenuFont->printf(xoffset,dyoffset+400,HGETEXT_LEFT,"Highscore - %s",HSMStr[view]);
+#define WrapCnt \
+ (view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0)
+#define WrapRec\
+ (view==0?NRec:view==1?ExRec:view==2?FPMRec:FPMRec)
+ for(unsigned i=1;i<=5;++i)
+ {
+ double calcy=i*30+dyoffset+400;
+ if(calcy>289.9&&calcy<540.1)
{
- sprintf(HSDetstr[1],"No. %d of Free Play Mode",detv);
+ if(i<=WrapCnt)
+ MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"%u. %s - "
#ifdef WIN32
- sprintf(HSDetstr[2],"Scored %I64d by %s",FPMRec[detv].score,FPMRec[detv].name);
+ "%I64d"
#else
- sprintf(HSDetstr[2],"Scored %lld by %s",FPMRec[detv].score,FPMRec[detv].name);
+ "%lld"
#endif
- sprintf(HSDetstr[3],"Collisions %d",FPMRec[detv].rescol);
- sprintf(HSDetstr[4],"Semi-Collisions %d",FPMRec[detv].scoll);
- sprintf(HSDetstr[5],"CLR Usage %d",FPMRec[detv].clrusg);
- sprintf(HSDetstr[6],"Average FPS %d.%d",FPMRec[detv].af_int,FPMRec[detv].af_fric);
+ ,i,WrapRec[i].name,WrapRec[i].score);
+ else MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"%u. ----------",i);
}
- for (int i=1;i<=6;++i)
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(i,fnt,snd,400,170+30*i,0.1f*i-0.1f,HSDetstr[i])),
- HSDetailGUI->EnableCtrl(i,false);
- HSDetailGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,380,0.6f,"Back"));
- break;
+ }
+ double calcy=6*30+dyoffset+400;
+ if(calcy>289.9&&calcy<540.1)
+ MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"back");
+ Ribb->RenderEx(xoffset-50,395,0,7,1);
+ Ribb->RenderEx(xoffset-50,422,0,7,1);
+ hge->Gfx_RenderQuad(&UpperGradient);
+ hge->Gfx_RenderQuad(&LowerGradient);
}
- HSDetailGUI->SetCursor(spr);
- HSDetailGUI->SetNavMode(HGEGUI_UPDOWN);
- HSDetailGUI->SetFocus(7);
- HSDetailGUI->Enter();
-}
-void HSDetGUI_FrameFnk()
+}highScoreViewMenu;
+class HighScoreDetailsMenu
{
- float dt=hge->Timer_GetDelta();
- int id=HSDetailGUI->Update(dt);
- if (id)
+private:
+ bool active,onIn,onOut;
+ int selected,view,no;
+ double xoffset,yoffset,dyoffset;
+ hgeSprite *Ribb,*HSTitle;
+ hgeQuad UpperGradient,LowerGradient;
+public:
+ int View(){return view;}
+ bool isActive(){return active;}
+ void Init_Once()
+ {
+ Ribb=new hgeSprite(MenuTex,256,350,64,16);
+ HSTitle=new hgeSprite(MenuTex,0,448,256,64);
+ Ribb->SetColor(0xCCFFFFFF);
+ }
+ void Init(double start,int _v,int _n)
+ {
+ xoffset=start;onIn=true;active=true;no=_n;
+ selected=0;dyoffset=yoffset=-selected*30;view=_v;
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,50);
+ UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF);
+ UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,130);
+ LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00);
+ LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF);
+ }
+ void Leave(){onOut=true;}
+ int Update()
{
- switch (id)
+ if(onIn)
{
- case 7:Current_Position=9;HSDetailGUI->Leave();HSViewGUI->Enter();break;
+ if(fabs(xoffset-400)<hge->Timer_GetDelta()*1600)return xoffset=400,onIn=false,-1;
+ if(xoffset<400)
+ xoffset+=hge->Timer_GetDelta()*1600;
+ else
+ xoffset-=hge->Timer_GetDelta()*1600;
}
+ if(onOut)
+ {
+ xoffset+=hge->Timer_GetDelta()*1600;
+ if(xoffset>=850)active=onOut=false;
+ }
+ ConfigureQuad(&UpperGradient,xoffset-140,290,600,100);
+ ConfigureQuad(&LowerGradient,xoffset-140,440,600,130);
+ if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected;
+ if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<(view==1?5:7)-1)++selected;
+ if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=(view==1?5:7)-1;
+ yoffset=-selected*30;
+ if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset;
+ if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400;
+ if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400;
+ if(onIn||onOut)return -1;
+ if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)
+ return selected;
+ return -1;
}
-}
-void HSViewGUI_Init()
-{
- Current_Position=9;
- HSViewGUI=new hgeGUI();
- switch (view)
+ void Render()
{
- case 1:
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Highscore - Easy"));
- for (unsigned i=1;i<=Ecnt;++i)
- {
-#ifdef WIN32
- sprintf(HSVstr[i],"%u. %s - %I64d",i,ERec[i].name,ERec[i].score);
-#else
- sprintf(HSVstr[i],"%u. %s - %lld",i,ERec[i].name,ERec[i].score);
-#endif
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- for (unsigned i=Ecnt+1;i<=5;++i)
- {
- sprintf(HSVstr[i],"%u. ----------",i);
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- break;
- case 2:
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Highscore - Normal"));
- for (unsigned i=1;i<=Ncnt;++i)
- {
-#ifdef WIN32
- sprintf(HSVstr[i],"%u. %s - %I64d",i,NRec[i].name,NRec[i].score);
-#else
- sprintf(HSVstr[i],"%u. %s - %lld",i,NRec[i].name,NRec[i].score);
-#endif
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- for (unsigned i=Ncnt+1;i<=5;++i)
- {
- sprintf(HSVstr[i],"%u. ----------",i);
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- break;
- case 3:
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Highscore - Extreme"));
- for (unsigned i=1;i<=Excnt;++i)
- {
+#define WrapCnt \
+ (view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0)
+#define WrapRec\
+ (view==0?NRec:view==1?ExRec:view==2?FPMRec:FPMRec)
+ if(dyoffset+400>289.9)
+ MenuFont->printf(xoffset,dyoffset+400,HGETEXT_LEFT,"No. %d of %s",no,HSMStr[view]);
+ if(view==1)
+ {
+ if(dyoffset+430>289.9&&dyoffset+430<540.1)
+ MenuFont->printf(xoffset,dyoffset+430,HGETEXT_LEFT,"Scored "
#ifdef WIN32
- sprintf(HSVstr[i],"%u. %s - %I64d",i,ExRec[i].name,ExRec[i].score);
+ "%I64d"
#else
- sprintf(HSVstr[i],"%u. %s - %lld",i,ExRec[i].name,ExRec[i].score);
+ "%lld"
#endif
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- for (unsigned i=Excnt+1;i<=5;++i)
- {
- sprintf(HSVstr[i],"%u. ----------",i);
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- break;
- case 4:
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Highscore - Free Play Mode"));
- for (unsigned i=1;i<=FPMcnt;++i)
- {
+ " by %s",WrapRec[no].score,WrapRec[no].name);
+ if(dyoffset+460>289.9&&dyoffset+460<540.1)
+ MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Semi-Collisions %d",WrapRec[no].scoll);
+ if(dyoffset+490>289.9&&dyoffset+490<540.1)
+ MenuFont->printf(xoffset,dyoffset+490,HGETEXT_LEFT,"Average FPS %d.%d",WrapRec[no].af_int,WrapRec[no].af_fric);
+ }
+ else
+ {
+ if(dyoffset+430>289.9&&dyoffset+430<540.1)
+ MenuFont->printf(xoffset,dyoffset+430,HGETEXT_LEFT,"Scored "
#ifdef WIN32
- sprintf(HSVstr[i],"%u. %s - %I64d",i,FPMRec[i].name,FPMRec[i].score);
+ "%I64d"
#else
- sprintf(HSVstr[i],"%u. %s - %lld",i,FPMRec[i].name,FPMRec[i].score);
+ "%lld"
#endif
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
- }
- for (unsigned i=FPMcnt+1;i<=5;++i)
+ " by %s",WrapRec[no].score,WrapRec[no].name);
+ if(dyoffset+460>289.9&&dyoffset+460<540.1)
{
- sprintf(HSVstr[i],"%u. ----------",i);
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i]));
+ if(view==0)
+ MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Restarts %d",WrapRec[no].rescol);
+ else
+ MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Collisions %d",WrapRec[no].rescol);
}
- break;
- }
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,380,0.6f,"Select one record to view details."));
- HSViewGUI->AddCtrl(new hgeGUIMenuItem(8,fnt,snd,400,410,0.7f,"Back"));
- HSViewGUI->EnableCtrl(1,false);HSViewGUI->EnableCtrl(7,false);
- HSViewGUI->SetCursor(spr);
- HSViewGUI->SetNavMode(HGEGUI_UPDOWN|HGEGUI_CYCLED);
- HSViewGUI->SetFocus(2);
- HSViewGUI->Enter();
-}
-void HSViewGUI_FrameFnk()
-{
- float dt=hge->Timer_GetDelta();
- int id=HSViewGUI->Update(dt);
- if (id)
- {
- switch (id)
- {
- case 2:detv=1;HSDetGUI_Init();break;
- case 3:detv=2;HSDetGUI_Init();break;
- case 4:detv=3;HSDetGUI_Init();break;
- case 5:detv=4;HSDetGUI_Init();break;
- case 6:detv=5;HSDetGUI_Init();break;
- case 8:Current_Position=8;HSViewGUI->Leave();if (!HighScoreGUI)HighScoreGUI_Init();HighScoreGUI->Enter();break;
- }
- }
-}
-void HighScoreGUI_Init()
-{
- HighScoreGUI=new hgeGUI();
- Current_Position=8;
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,350,200,0.0f,"View Highscores && Records for..."));
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(2,fnt,snd,400,240,0.1f,"Classic"));
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(3,fnt,snd,400,280,0.2f,"Normal"));
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(4,fnt,snd,400,320,0.3f,"Assessment Mode"));
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(5,fnt,snd,400,360,0.4f,"Free Play Mode"));
- HighScoreGUI->AddCtrl(new hgeGUIMenuItem(6,fnt,snd,400,400,0.5f,"Back"));
- HighScoreGUI->EnableCtrl(1,false);
- HighScoreGUI->SetCursor(spr);
- HighScoreGUI->SetNavMode(HGEGUI_UPDOWN|HGEGUI_CYCLED);
- HighScoreGUI->SetFocus(7);
- HighScoreGUI->Enter();
-}
-void HighScoreGUI_FrameFnk()
-{
- float dt=hge->Timer_GetDelta();
- int id=HighScoreGUI->Update(dt);
- if (id)
- {
- switch (id)
- {
- case 2:view=1;HSViewGUI_Init();break;
- case 3:view=2;HSViewGUI_Init();break;
- case 4:view=3;HSViewGUI_Init();break;
- case 5:view=4;HSViewGUI_Init();break;
- case 6:Current_Position=0;HighScoreGUI->Leave();break;
+ if(dyoffset+490>289.9&&dyoffset+490<540.1)
+ MenuFont->printf(xoffset,dyoffset+490,HGETEXT_LEFT,"Semi-Collisions %d",WrapRec[no].scoll);
+ if(dyoffset+520>289.9&&dyoffset+520<540.1)
+ MenuFont->printf(xoffset,dyoffset+520,HGETEXT_LEFT,"CLR Usage %d",WrapRec[no].clrusg);
+ if(dyoffset+550>289.9&&dyoffset+550<540.1)
+ MenuFont->printf(xoffset,dyoffset+550,HGETEXT_LEFT,"Average FPS %d.%d",WrapRec[no].af_int,WrapRec[no].af_fric);
}
+ double calcy=(view==1?4:6)*30+dyoffset+400;
+ if(calcy>289.9&&calcy<540.1)
+ MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"back");
+ Ribb->RenderEx(xoffset-50,395,0,6,1);
+ Ribb->RenderEx(xoffset-50,422,0,6,1);
+ hge->Gfx_RenderQuad(&UpperGradient);
+ hge->Gfx_RenderQuad(&LowerGradient);
+ HSTitle->Render(xoffset-250,300);
}
-
-}
+}highScoreDetailsMenu;
diff --git a/scorec.h b/scorec.h
index e5ceb9a..92a2532 100644
--- a/scorec.h
+++ b/scorec.h
@@ -186,11 +186,12 @@ void Score_Write()
void Score_Initailize()
{
freopen("score.cfg","w",stdout);
- printf(";BLS");
- printf("%c%c%c%c",0xd1,0xff,0xa0,0xc0);printf("%c%c%c%c",0,0,0,0);
- printf("%c%c%c%c",0xd1,0xff,0xa0,0xc1);printf("%c%c%c%c",0,0,0,0);
- printf("%c%c%c%c",0xd1,0xff,0xa0,0xc2);printf("%c%c%c%c",0,0,0,0);
- printf("%c%c%c%c",0xd1,0xff,0xa0,0xc3);printf("%c%c%c%c",0,0,0,0);
+ puts(";BLS");
+ static const char *fourchar="%c%c%c%c";
+ printf(fourchar,0xd1,0xff,0xa0,0xc0);printf(fourchar,0,0,0,0);
+ printf(fourchar,0xd1,0xff,0xa0,0xc1);printf(fourchar,0,0,0,0);
+ printf(fourchar,0xd1,0xff,0xa0,0xc2);printf(fourchar,0,0,0,0);
+ printf(fourchar,0xd1,0xff,0xa0,0xc3);printf(fourchar,0,0,0,0);
fclose(stdout);
}
void InsertHighScore()
@@ -199,6 +200,7 @@ void InsertHighScore()
switch (mode)
{
case 4:
+ //deprecated...
if (pos<=Ecnt)
for (unsigned i=5;i>pos;--i)
ERec[i]=ERec[i-1];