From 3a51283329635021b839c8abbea4fac6bd7fe688 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Wed, 30 Apr 2014 08:20:45 +0000 Subject: Fix a critical bug in Score_Initailize. Modify level pinball. Drop "_PR" in version string. Partly rewrite the credit scene, displaying accurate version details. Remove some warnings from hgewin. A set of basic tests are done on a Intel+Nvidia desktop computer. Add a simple build script(instead of makefile). Reduce the Windows version executable size...(local work, recompile freetype using reduced features enabled.) Current tested (by me) and worked plantforms: Debian sid x86_64 @Intel core i7-2670QM, 8GiB RAM, Intel HD3000 & @Intel Core2 Quad Q8300, 8GiB RAM, nvidia GT320. Windows XP x64 @VirutalBox, Dualcore Virtual CPU, 1.5GiB RAM, VBox Addons installed. Windows XP @Intel core i3-3240, 4GiB RAM, Intel HD3000. --- ChangeLog | 18 ++++++++++++++++++ Readme | 6 ++++-- Readme.zh | 5 +++-- VERSION | 2 +- build | 36 ++++++++++++++++++++++++++++++++++++ global.h | 20 ++++++++++++++++---- hge/hge_impl.h | 1 + hgewin/hge_impl.h | 3 ++- hgewin/input.cpp | 2 +- hgewin/resource.cpp | 2 +- hgewin/system.cpp | 4 ++-- levels.h | 4 ++-- main.cpp | 14 +++++++++++++- scorec.h | 11 +++++------ 14 files changed, 105 insertions(+), 23 deletions(-) create mode 100755 build diff --git a/ChangeLog b/ChangeLog index 9cc2991..b8bba62 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,24 @@ Random segmentation fault in "Hyper-threading".(seen only once, can not reproduce now...) Pre-Released versions: +0.9.1-1 (r89) +Fix a critical bug in Score_Initailize. +Modify level pinball. +Drop "_PR" in version string. +Partly rewrite the credit scene, displaying accurate version +details. +Remove some warnings from hgewin. +A set of basic tests are done on a Intel+Nvidia desktop computer. +Add a simple build script(instead of makefile). +Reduce the Windows version executable size...(local work, recompile +freetype using reduced features enabled.) +Current tested (by me) and worked plantforms: +Debian sid x86_64 @Intel core i7-2670QM, 8GiB RAM, Intel HD3000 & +@Intel Core2 Quad Q8300, 8GiB RAM, nvidia GT320. +Windows XP x64 @VirutalBox, Dualcore Virtual CPU, 1.5GiB RAM, VBox +Addons installed. +Windows XP @Intel core i3-3240, 4GiB RAM, Intel HD3000. + 0.9.1-1_PR (r88) %lld seems to work with mingw-w64(also VS2005+)... So let's remove all %I64d. diff --git a/Readme b/Readme index 21d2a1a..93c0fb4 100644 --- a/Readme +++ b/Readme @@ -123,10 +123,12 @@ to continue... This mode kills your time silently. Assessment Mode -You are the frog being boiled. -Every levels get harder as time goes. +You are the frog being boiled: all levels get harder as time goes. You'll be brought to the next part if you had a collision. +Most levels are designed to be IMPOSSIBLE after the elapsed time have +exceeded a certain value. + Go for the highest score! Free Play Mode diff --git a/Readme.zh b/Readme.zh index 8556f8b..ea7f3ac 100644 --- a/Readme.zh +++ b/Readme.zh @@ -122,10 +122,11 @@ Classic 经典模式 这种模式会默默地浪费时间… Assessment Mode 评分/检测模式 -温水煮青蛙实验。 -所有的关卡都会随着时间流逝而变难。 +温水煮青蛙实验:所有的关卡都会随着时间流逝而变难。 如果你撞到了有判定的东西,就会进入下一关… +大多数的关卡最后都会变成无法通过的…(当时间超过某个设定好的值之后) + 试着撑过最长的时间吧! Free Play Mode 自由模式 diff --git a/VERSION b/VERSION index 003c297..4235450 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.1-1_PR (r88) \ No newline at end of file +0.9.1-1 (r89) \ No newline at end of file diff --git a/build b/build new file mode 100755 index 0000000..12c7578 --- /dev/null +++ b/build @@ -0,0 +1,36 @@ +#!/bin/bash +cd hge +cd CxImage +echo Compiling CxImage... +g++ -c *.cpp -D_LINUX +ar rcs libCxImage.a *.o +rm *.o +cd .. +mv ./CxImage/libCxImage.a libCxImage.a +cd ZLIB +echo Compiling zlib... +gcc -c *.c +ar rcs libz.a *.o +rm *.o +cd .. +mv ./ZLIB/libz.a libz.a +echo Compiling libhge... +g++ -c *.cpp -I/usr/include/SDL/ -I../include +ar rcs libhge.a *.o +rm *.o +cd .. +mv ./hge/*.a ./ +cd hgehelp +echo Compiling libhgehelp... +g++ -c *.cpp -I../include +ar rcs libhgehelp.a *.o +rm *.o +cd .. +mv ./hgehelp/libhgehelp.a libhgehelp.a +echo Compiling the main executable... +g++ *.cpp -I/usr/include/freetype2 -I./include \ +-lSDL -lvorbis -lvorbisfile -lopenal -ljpeg -lpng -lfreetype \ +-Wl,libhgehelp.a,libhge.a,libCxImage.a,libz.a -o BulletLabRemixII +rm *.a +strip BulletLabRemixII +cd .. \ No newline at end of file diff --git a/global.h b/global.h index a49ca90..68dc285 100644 --- a/global.h +++ b/global.h @@ -8,7 +8,7 @@ HGE *hge=0; HEFFECT snd,menuin,menuout; hgeQuad quad; -hgeFont *fnt; +hgeFont *fnt,*vdig,*bdig; hgeSprite *spr,*titlespr; int Current_Position;//Where we are now /*Scenes: @@ -308,7 +308,7 @@ fFristStartUp,fFast; int startLvl,startPrt,fFullScreen; char alterLog[64]; #ifdef WIN32 -static const int arFilecount=20; +static const int arFilecount=22; static const char* archive[]={ "./Resources/b_diff.png", "./Resources/b_inter.png", @@ -317,6 +317,8 @@ static const char* archive[]={ "./Resources/e_skyitem.png", "./Resources/blnsns.png", "./Resources/charmap.fnt", +"./Resources/vdig.fnt", +"./Resources/bdig.fnt", "./Resources/ss.png", "./Resources/menus.png", "./Resources/title.png", @@ -333,8 +335,18 @@ static const char* archive[]={ }; #endif //static const char* GLOBAL_H_FN="global.h"; -static const char* BLRVERSION="0.9.1-1_PR (r88)"; -static const char* BuiltDate=__DATE__; +static const char* BLRVERSION="0.9.1-1 (r89)"; +static const char *months="JanFebMarAprMayJunJulAugSepOctNovDec"; +char *parseDate(const char *date) +{ + char ms[8]; + int y,d,m;sscanf(date,"%s %d %d",ms,&d,&y); + m=(strstr(months,ms)-months)/3+1; + char *r=new char[16]; + sprintf(r,"%04d-%02d-%02d",y,m,d); + return r; +} +static char* BuiltDate=parseDate(__DATE__); void Throw(char *Filename,char *Info) { diff --git a/hge/hge_impl.h b/hge/hge_impl.h index c823b85..26cb850 100644 --- a/hge/hge_impl.h +++ b/hge/hge_impl.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /* ** Haaf's Game Engine 1.8 ** Copyright (C) 2003-2007, Relish Games diff --git a/hgewin/hge_impl.h b/hgewin/hge_impl.h index b3f0fe5..5acdcd4 100755 --- a/hgewin/hge_impl.h +++ b/hgewin/hge_impl.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /* ** Haaf's Game Engine 1.8 ** Copyright (C) 2003-2007, Relish Games @@ -199,7 +200,7 @@ public: static HGE_Impl* _Interface_Get(); void _FocusChange(bool bAct); - void _PostError(char *error); + void _PostError(const char *error); HINSTANCE hInstance; diff --git a/hgewin/input.cpp b/hgewin/input.cpp index 080f335..0610376 100755 --- a/hgewin/input.cpp +++ b/hgewin/input.cpp @@ -10,7 +10,7 @@ #include "hge_impl.h" -char *KeyNames[] = +const char *KeyNames[] = { "?", "Left Mouse Button", "Right Mouse Button", "?", "Middle Mouse Button", diff --git a/hgewin/resource.cpp b/hgewin/resource.cpp index fa1ddf9..6921dc6 100755 --- a/hgewin/resource.cpp +++ b/hgewin/resource.cpp @@ -82,7 +82,7 @@ void CALL HGE_Impl::Resource_RemoveAllPacks() #undef DWORD void* CALL HGE_Impl::Resource_Load(const char *filename, DWORD *size) { - static char *res_err="Can't load resource: %s"; + static const char *res_err="Can't load resource: %s"; CResourceList *resItem=res; char szName[_MAX_PATH]; diff --git a/hgewin/system.cpp b/hgewin/system.cpp index 9dfda86..2cbd741 100755 --- a/hgewin/system.cpp +++ b/hgewin/system.cpp @@ -77,7 +77,7 @@ bool CALL HGE_Impl::System_Initiate() System_Log("%s: HGE Started...",SYSTEM_SRC_FN); - System_Log("%s: hge-unix version: %X.%X", SYSTEM_SRC_FN, HGE_VERSION>>8, HGE_VERSION & 0xFF); + System_Log("%s: hge version: %X.%X", SYSTEM_SRC_FN, HGE_VERSION>>8, HGE_VERSION & 0xFF); GetLocalTime(&tm); System_Log("%s: Date: %02d.%02d.%d, %02d:%02d:%02d\n", SYSTEM_SRC_FN, tm.wDay, tm.wMonth, tm.wYear, tm.wHour, tm.wMinute, tm.wSecond); @@ -741,7 +741,7 @@ HGE_Impl::HGE_Impl() szAppPath[i+1]=0; } -void HGE_Impl::_PostError(char *error) +void HGE_Impl::_PostError(const char *error) { System_Log(error); strcpy(szError,error); diff --git a/levels.h b/levels.h index 2040903..4f3e4ec 100644 --- a/levels.h +++ b/levels.h @@ -3944,11 +3944,11 @@ void Levelm2Part18() tbrk-=hge->Timer_GetDelta(); if(tbrk<0) { - tbrk=1-0.5*assetime/120.0f;if(tbrk<0.5)tbrk=0.5; + tbrk=1.25-0.5*assetime/120.0f;if(tbrk<0.5)tbrk=0.5; for(int i=0;i<200;++i) if(pinballs[i].Getlifetime()==0||pinballs[i].Getlifetime()>=10) { - int lay=3+7*assetime/120.0f;if(lay>10)lay=10; + int lay=3+5*assetime/120.0f;if(lay>8)lay=re.NextInt(3,10); vector2d pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500)); while(GetDist(pos,playerpos)<100)pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500)); pinballs[i].Init(pos,lay); diff --git a/main.cpp b/main.cpp index 1505abf..c598192 100644 --- a/main.cpp +++ b/main.cpp @@ -590,7 +590,17 @@ void CallLevels() bool ProcessCurCred() { CreditsRail->RenderEx(400,300,0,4,1); + if(creditsp!=1) Credits->Render(creditfly,300); + else + { + Credits->SetTextureRect(4,209,230,76); + Credits->Render(creditfly,330); + Credits->SetTextureRect(9,290,140,47); + Credits->Render(creditfly,400); + vdig->printf(creditfly,240,HGETEXT_LEFT,"%s",BLRVERSION); + bdig->printf(creditfly,310,HGETEXT_LEFT,"%s",BuiltDate); + } int times=1;if (LOWFPS)times=17; if (credstop)credbrk+=hge->Timer_GetDelta(); if (credbrk>=4.5&&!creddone)creddone=true,credstop=false,creditacc=0,credbrk=0; @@ -604,7 +614,7 @@ void AboutScene() { if (ProcessCurCred()) creditfly=1200,creditacc=0,credstop=creddone=false,++creditsp, - Credits=new hgeSprite(TexCredits,0,creditsp*200,600,200), + Credits->SetTextureRect(0,creditsp*200,600,200), Credits->SetHotSpot(300,100); if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT||creditsp>11) { @@ -1262,6 +1272,8 @@ int main(int argc,char *argv[]) MenuFont=new hgeFont("./Resources/charmap.fnt"); TipFont=new hgeFont("./Resources/charmap.fnt"); MultFnt=new hgeFont("./Resources/charmap.fnt"); + vdig=new hgeFont("./Resources/vdig.fnt"); + bdig=new hgeFont("./Resources/bdig.fnt"); fnt->SetScale(0.8); MenuFont->SetScale(0.8); TipFont->SetScale(0.8); diff --git a/scorec.h b/scorec.h index 55c0bf8..3fe0b10 100644 --- a/scorec.h +++ b/scorec.h @@ -186,12 +186,11 @@ void Score_Write() void Score_Initailize() { freopen("score.cfg","w",stdout); - 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); + Putuint(0x3b424c53); + Putuint(0xd1ffa0c0);Putuint(0); + Putuint(0xd1ffa0c1);Putuint(0); + Putuint(0xd1ffa0c2);Putuint(0); + Putuint(0xd1ffa0c3);Putuint(0); fclose(stdout); } void InsertHighScore() -- cgit v1.2.3