diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-02-24 03:25:05 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-02-24 03:25:05 +0000 |
commit | 172056e7598d3447c682a694d824041076f3255e (patch) | |
tree | 3ba150866d6bbcc337932e3fc59a3af9715d0d85 | |
parent | 8cb1a0f4fcf8e7ecd54134e8d6f431b613c69091 (diff) | |
download | bullet-lab-remix-172056e7598d3447c682a694d824041076f3255e.tar.xz |
M trunk/CHANGELOG.TXT
M trunk/background.h
M trunk/effects.h
M trunk/global.h
M trunk/hge/CxImage/ximagif.cpp
M trunk/hge/CxImage/ximaint.cpp
M trunk/hge/CxImage/ximapng.cpp
M trunk/hge/graphics.cpp
M trunk/hge/input.cpp
M trunk/hge/resource.cpp
M trunk/hge/sound.cpp
M trunk/hge/system.cpp
M trunk/hgehelp/hgefont.cpp
M trunk/levels.h
M trunk/libcgh.h
M trunk/libcghEx.cpp
M trunk/menuitem.cpp
M trunk/menuitem.h
M trunk/menus.h
M trunk/music.h
M trunk/scorec.h
M trunk/scoresystem.h
M trunk/towernbullet.h
-rwxr-xr-x | CHANGELOG.TXT | 1 | ||||
-rw-r--r-- | background.h | 27 | ||||
-rw-r--r-- | effects.h | 3 | ||||
-rw-r--r-- | global.h | 8 | ||||
-rw-r--r-- | hge/CxImage/ximagif.cpp | 64 | ||||
-rw-r--r-- | hge/CxImage/ximaint.cpp | 87 | ||||
-rw-r--r-- | hge/CxImage/ximapng.cpp | 6 | ||||
-rw-r--r-- | hge/graphics.cpp | 10 | ||||
-rw-r--r-- | hge/input.cpp | 6 | ||||
-rw-r--r-- | hge/resource.cpp | 3 | ||||
-rw-r--r-- | hge/sound.cpp | 12 | ||||
-rw-r--r-- | hge/system.cpp | 13 | ||||
-rw-r--r-- | hgehelp/hgefont.cpp | 4 | ||||
-rw-r--r-- | levels.h | 4 | ||||
-rw-r--r-- | libcgh.h | 4 | ||||
-rw-r--r-- | libcghEx.cpp | 6 | ||||
-rw-r--r-- | menuitem.cpp | 6 | ||||
-rw-r--r-- | menuitem.h | 4 | ||||
-rw-r--r-- | menus.h | 42 | ||||
-rw-r--r-- | music.h | 4 | ||||
-rw-r--r-- | scorec.h | 30 | ||||
-rw-r--r-- | scoresystem.h | 2 | ||||
-rw-r--r-- | towernbullet.h | 11 |
23 files changed, 186 insertions, 171 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 22314b3..ebcbadc 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -7,6 +7,7 @@ More new things? Pre-Released versions: 0.7.1-6_PR (b69) Fusion bullet first work draft. +Fix some of the warnings from the compiler. Adjust level difficulty. It was indeed too easy... 0.7.1-5_PR (b68) diff --git a/background.h b/background.h index 62c8424..62fe7a2 100644 --- a/background.h +++ b/background.h @@ -63,7 +63,6 @@ public: void Update() { double tx,ty,dt; - DWORD tcol; if (onfadein)DoFadeIn(); if (onfadeout)DoFadeOut(); dt=hge->Timer_GetDelta(); @@ -159,6 +158,11 @@ public: //3D-sky Background //Based on a hge tutorial //******************************************** +static const DWORD skyTopColors[3] = {0xFF15092A, 0xFF6C6480, 0xFF89B9D0}; +static const DWORD skyBtmColors[3] = {0xFF303E57, 0xFFAC7963, 0xFFCAD7DB}; +static const DWORD seaTopColors[3] = {0xFF3D546B, 0xFF927E76, 0xFF86A2AD}; +static const DWORD seaBtmColors[3] = {0xFF1E394C, 0xFF2F4E64, 0xFF2F4E64}; +static const int skyseq[9]={0, 0, 1, 2, 2, 2, 1, 0, 0}; class TDSky { #define ScreenWidth 800 @@ -169,11 +173,6 @@ class TDSky #define StarsHeight (SkyHeight*0.9f) #define OrbitRadius (ScreenWidth*0.43f) private: - const DWORD skyTopColors[3] = {0xFF15092A, 0xFF6C6480, 0xFF89B9D0}; - const DWORD skyBtmColors[3] = {0xFF303E57, 0xFFAC7963, 0xFFCAD7DB}; - const DWORD seaTopColors[3] = {0xFF3D546B, 0xFF927E76, 0xFF86A2AD}; - const DWORD seaBtmColors[3] = {0xFF1E394C, 0xFF2F4E64, 0xFF2F4E64}; - const int seq[9]={0, 0, 1, 2, 2, 2, 1, 0, 0}; HTEXTURE skyitem; hgeSprite *sky,*sun,*moon,*glow,*seaglow,*star; hgeDistortionMesh *sea,*skylyr; @@ -289,17 +288,17 @@ public: seq_id=(int)(timet/3); seq_residue=timet/3-seq_id; zenith=-(timet/12.0f*pi-pi/2.0f); - col1.SetHWColor(skyTopColors[seq[seq_id]]); - col2.SetHWColor(skyTopColors[seq[seq_id+1]]); + col1.SetHWColor(skyTopColors[skyseq[seq_id]]); + col2.SetHWColor(skyTopColors[skyseq[seq_id+1]]); colSkyTop=col2*seq_residue + col1*(1.0f-seq_residue); - col1.SetHWColor(skyBtmColors[seq[seq_id]]); - col2.SetHWColor(skyBtmColors[seq[seq_id+1]]); + col1.SetHWColor(skyBtmColors[skyseq[seq_id]]); + col2.SetHWColor(skyBtmColors[skyseq[seq_id+1]]); colSkyBtm=col2*seq_residue + col1*(1.0f-seq_residue); - col1.SetHWColor(seaTopColors[seq[seq_id]]); - col2.SetHWColor(seaTopColors[seq[seq_id+1]]); + col1.SetHWColor(seaTopColors[skyseq[seq_id]]); + col2.SetHWColor(seaTopColors[skyseq[seq_id+1]]); colSeaTop=col2*seq_residue + col1*(1.0f-seq_residue); - col1.SetHWColor(seaBtmColors[seq[seq_id]]); - col2.SetHWColor(seaBtmColors[seq[seq_id+1]]); + col1.SetHWColor(seaBtmColors[skyseq[seq_id]]); + col2.SetHWColor(seaBtmColors[skyseq[seq_id+1]]); colSeaBtm=col2*seq_residue + col1*(1.0f-seq_residue); if(seq_id>=6 || seq_id<2) for(int i=0; i<Stars; ++i) @@ -2,7 +2,7 @@ //Effects Implementations //"Copyleft" Chrisoft 2013 #define NO_FREE 1 -static const char* EFFECTS_H_FN="effects.h"; +//static const char* EFFECTS_H_FN="effects.h"; void SCEffect_Attatch() { @@ -58,7 +58,6 @@ void SCEffect_Process(int i) //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor. //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor. } - double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet if (GETA(bullet[i].sccolor)<=0x0A||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) { bullet[i].exist=false; @@ -238,10 +238,12 @@ struct Target//An annoying circle if (isonshow)TargShowProc();if(isonhide)TargHideProc(); targspr->RenderEx(targpos.x+7,targpos.y+7,rot,0.8); if (!DisableAllTower) + { if (LOWFPS) rot+=17*rotspd; else rot+=rotspd; + } } }ATarg,BTarg; int bulcnt=0,towcnt=0,linecnt=0; @@ -290,7 +292,7 @@ void Throw(char *Filename,char *Info) fprintf(stderr,"%s: %s\n",Filename,Info); hge->System_Log("%s: %s\n",Filename,Info); } -void Error(char EC[],bool hgecreated=false) +void Error(const char *EC,bool hgecreated=false) { #ifndef WIN32 fprintf(stderr,"%s\n",EC); @@ -320,7 +322,7 @@ void Error(char EC[],bool hgecreated=false) #endif exit(0); } -void ShowTip(char *tip) +void ShowTip(const char *tip) { if (strcmp(tip,lasttip)!=0) { @@ -487,6 +489,7 @@ TextureRect GetTextureRect(int type,TColors color) case orange:return TextureRect(72,0,24,24); case grey:return TextureRect(96,0,24,24); case circle:return TextureRect(24,24,24,24); + default:return TextureRect(0,0,0,0); } } if (type==1) @@ -501,6 +504,7 @@ TextureRect GetTextureRect(int type,TColors color) case white:return TextureRect(136,24,44,44); case dblue:return TextureRect(0,92,44,44); case orange:return TextureRect(0,180,44,44); + default:return TextureRect(0,0,0,0); } } return TextureRect(0,0,0,0); diff --git a/hge/CxImage/ximagif.cpp b/hge/CxImage/ximagif.cpp index b225f47..8c94b9e 100644 --- a/hge/CxImage/ximagif.cpp +++ b/hge/CxImage/ximagif.cpp @@ -95,7 +95,7 @@ bool CxImageGIF::Decode(CxFile *fp) // Global colour map?
if (dscgif.pflds & 0x80)
fp->Read(TabCol.paleta,sizeof(struct rgb_color)*TabCol.sogct,1);
- else
+ else
bTrueColor++; //first chance for a truecolor gif
int32_t first_transparent_index = 0;
@@ -145,9 +145,9 @@ bool CxImageGIF::Decode(CxFile *fp) if ((iImage==0) && (image.w != dscgif.scrwidth) && (image.h != dscgif.scrheight))
bTrueColor++;
- rgb_color locpal[256]; //Local Palette
- rgb_color* pcurpal = TabCol.paleta; //Current Palette
- int16_t palcount = TabCol.sogct; //Current Palette color count
+ rgb_color locpal[256]; //Local Palette
+ rgb_color* pcurpal = TabCol.paleta; //Current Palette
+ int16_t palcount = TabCol.sogct; //Current Palette color count
// Local colour map?
if (image.pf & 0x80) {
@@ -208,13 +208,13 @@ bool CxImageGIF::Decode(CxFile *fp) if ((image.pf & 0x80) || (dscgif.pflds & 0x80)) {
uint8_t r[256], g[256], b[256];
- int32_t i, has_white = 0;
+ int32_t i;//, has_white = 0;
for (i=0; i < palcount; i++) {
r[i] = pcurpal[i].r;
g[i] = pcurpal[i].g;
b[i] = pcurpal[i].b;
- if (RGB(r[i],g[i],b[i]) == 0xFFFFFF) has_white = 1;
+ //if (RGB(r[i],g[i],b[i]) == 0xFFFFFF) has_white = 1;
}
// Force transparency colour white...
@@ -223,7 +223,7 @@ bool CxImageGIF::Decode(CxFile *fp) // Fill in with white // AD
if (info.nBkgndIndex >= 0) {
while (i < 256) {
- has_white = 1;
+ //has_white = 1;
r[i] = g[i] = b[i] = 255;
i++;
}
@@ -579,7 +579,7 @@ void CxImageGIF::EncodeHeader(CxFile *fp) if (head.biClrUsed!=0){
RGBQUAD* pPal = GetPalette();
- for(uint32_t i=0; i<head.biClrUsed; ++i)
+ for(uint32_t i=0; i<head.biClrUsed; ++i)
{
fp->PutC(pPal[i].rgbRed);
fp->PutC(pPal[i].rgbGreen);
@@ -598,7 +598,7 @@ void CxImageGIF::EncodeExtension(CxFile *fp) gifgce.flags |= ((info.nBkgndIndex != -1) ? 1 : 0);
gifgce.flags |= ((GetDisposalMethod() & 0x7) << 2);
gifgce.delaytime = (uint16_t)info.dwFrameDelay;
- gifgce.transpcolindex = (uint8_t)info.nBkgndIndex;
+ gifgce.transpcolindex = (uint8_t)info.nBkgndIndex;
//Invert byte order in case we use a byte order arch, then set it back <AMSN>
gifgce.delaytime = m_ntohs(gifgce.delaytime);
@@ -618,9 +618,9 @@ void CxImageGIF::EncodeLoopExtension(CxFile *fp) fp->Write("NETSCAPE2.0",11,1);
fp->PutC(3); //byte 15 : 3 (hex 0x03) Length of Data Sub-Block (three bytes of data to follow)
fp->PutC(1); //byte 16 : 1 (hex 0x01)
- Putword(m_loops,fp); //bytes 17 to 18 : 0 to 65535, an unsigned integer in lo-hi byte format.
+ Putword(m_loops,fp); //bytes 17 to 18 : 0 to 65535, an unsigned integer in lo-hi byte format.
//This indicate the number of iterations the loop should be executed.
- fp->PutC(0); //bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator.
+ fp->PutC(0); //bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator.
}
////////////////////////////////////////////////////////////////////////////////
void CxImageGIF::EncodeBody(CxFile *fp, bool bLocalColorMap)
@@ -643,7 +643,7 @@ void CxImageGIF::EncodeBody(CxFile *fp, bool bLocalColorMap) if (bLocalColorMap){
Flags|=0x87;
RGBQUAD* pPal = GetPalette();
- for(uint32_t i=0; i<head.biClrUsed; ++i)
+ for(uint32_t i=0; i<head.biClrUsed; ++i)
{
fp->PutC(pPal[i].rgbRed);
fp->PutC(pPal[i].rgbGreen);
@@ -778,12 +778,12 @@ void CxImageGIF::compressNONE( int32_t init_bits, CxFile* outfile) output( (code_int)ClearCode );
- while ( ent != EOF ) {
+ while ( ent != EOF ) {
c = GifNextPixel();
output ( (code_int) ent );
ent = c;
- if ( free_ent < maxmaxcode ) {
+ if ( free_ent < maxmaxcode ) {
free_ent++;
} else {
free_ent=(int16_t)(ClearCode+2);
@@ -834,7 +834,7 @@ void CxImageGIF::compressLZW( int32_t init_bits, CxFile* outfile) cl_hash((int32_t)HSIZE); /* clear hash table */
output( (code_int)ClearCode );
- while ( (c = GifNextPixel( )) != EOF ) {
+ while ( (c = GifNextPixel( )) != EOF ) {
fcode = (int32_t) (((int32_t) c << MAXBITSCODES) + ent);
i = (((code_int)c << hshift) ^ ent); /* xor hashing */
@@ -853,7 +853,7 @@ probe: nomatch:
output ( (code_int) ent );
ent = c;
- if ( free_ent < maxmaxcode ) {
+ if ( free_ent < maxmaxcode ) {
CodeTabOf (i) = free_ent++; /* code -> hashtable */
HashTabOf (i) = fcode;
} else {
@@ -909,7 +909,7 @@ void CxImageGIF::output( code_int code) maxcode = (int16_t)MAXCODE(n_bits);
}
}
-
+
if( code == EOFCode ) {
// At EOF, write the rest of the buffer.
while( cur_bits > 0 ) {
@@ -917,7 +917,7 @@ void CxImageGIF::output( code_int code) cur_accum >>= 8;
cur_bits -= 8;
}
-
+
flush_char();
g_outfile->Flush();
@@ -953,7 +953,7 @@ void CxImageGIF::cl_hash(int32_t hsize) *(htab_p-3)=m1;
*(htab_p-2)=m1;
*(htab_p-1)=m1;
-
+
htab_p-=16;
} while ((i-=16) >=0);
@@ -1334,7 +1334,7 @@ int32_t CxImageGIF::get_num_frames(CxFile *fp,struct_TabCol* TabColSrc,struct_ds } else {
fp->Seek(-(ibfmax - ibf - 1), SEEK_CUR);
}
-
+
break;
}
case ';': //terminator
@@ -1411,22 +1411,22 @@ void CxImageGIF::GifMix(CxImage & imgsrc2, struct_image & imgdesc) * documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
- * documentation. This software is provided "AS IS." The Hutchison Avenue
- * Software Corporation disclaims all warranties, either express or implied,
- * including but not limited to implied warranties of merchantability and
+ * documentation. This software is provided "AS IS." The Hutchison Avenue
+ * Software Corporation disclaims all warranties, either express or implied,
+ * including but not limited to implied warranties of merchantability and
* fitness for a particular purpose, with respect to this code and accompanying
- * documentation.
- *
- * The miGIF compression routines do not, strictly speaking, generate files
- * conforming to the GIF spec, since the image data is not LZW-compressed
- * (this is the point: in order to avoid transgression of the Unisys patent
- * on the LZW algorithm.) However, miGIF generates data streams that any
+ * documentation.
+ *
+ * The miGIF compression routines do not, strictly speaking, generate files
+ * conforming to the GIF spec, since the image data is not LZW-compressed
+ * (this is the point: in order to avoid transgression of the Unisys patent
+ * on the LZW algorithm.) However, miGIF generates data streams that any
* reasonably sane LZW decompresser will decompress to what we want.
*
- * miGIF compression uses run length encoding. It compresses horizontal runs
+ * miGIF compression uses run length encoding. It compresses horizontal runs
* of pixels of the same color. This type of compression gives good results
- * on images with many runs, for example images with lines, text and solid
- * shapes on a solid-colored background. It gives little or no compression
+ * on images with many runs, for example images with lines, text and solid
+ * shapes on a solid-colored background. It gives little or no compression
* on images with few runs, for example digital or scanned photos.
*
* der Mouse
diff --git a/hge/CxImage/ximaint.cpp b/hge/CxImage/ximaint.cpp index 0acedff..5f93038 100644 --- a/hge/CxImage/ximaint.cpp +++ b/hge/CxImage/ximaint.cpp @@ -1,5 +1,5 @@ // xImaInt.cpp : interpolation functions
-/* 02/2004 - Branko Brevensek
+/* 02/2004 - Branko Brevensek
* CxImage version 7.0.0 31/Dec/2010 - Davide Pizzolato - www.xdp.it
*/
@@ -15,7 +15,7 @@ *
* \param x, y - coordinates of pixel
* \param ofMethod - overflow method
- *
+ *
* \return x, y - new coordinates (pixel (x,y) now lies inside image)
*
* \author ***bd*** 2.2004
@@ -50,7 +50,7 @@ void CxImage::OverflowCoordinates(int32_t &x, int32_t &y, OverflowMethod const o ////////////////////////////////////////////////////////////////////////////////
/**
- * See OverflowCoordinates for integer version
+ * See OverflowCoordinates for integer version
* \author ***bd*** 2.2004
*/
void CxImage::OverflowCoordinates(float &x, float &y, OverflowMethod const ofMethod)
@@ -162,14 +162,14 @@ RGBQUAD CxImage::GetPixelColorWithOverflow(int32_t x, int32_t y, OverflowMethod * as (1,1). Center of first pixel is at (0,0) and center of pixel right to it is (1,0).
* (0.5,0) is half way between these two pixels.
* \param inMethod - interpolation (reconstruction) method (kernel) to use:
- * - IM_NEAREST_NEIGHBOUR - returns colour of nearest lying pixel (causes stairy look of
+ * - IM_NEAREST_NEIGHBOUR - returns colour of nearest lying pixel (causes stairy look of
* processed images)
* - IM_BILINEAR - interpolates colour from four neighbouring pixels (softens image a bit)
* - IM_BICUBIC - interpolates from 16 neighbouring pixels (can produce "halo" artifacts)
- * - IM_BICUBIC2 - interpolates from 16 neighbouring pixels (perhaps a bit less halo artifacts
+ * - IM_BICUBIC2 - interpolates from 16 neighbouring pixels (perhaps a bit less halo artifacts
than IM_BICUBIC)
* - IM_BSPLINE - interpolates from 16 neighbouring pixels (softens image, washes colours)
- * (As far as I know, image should be prefiltered for this method to give
+ * (As far as I know, image should be prefiltered for this method to give
* good results... some other time :) )
* This method uses bicubic interpolation kernel from CXImage 5.99a and older
* versions.
@@ -180,13 +180,13 @@ RGBQUAD CxImage::GetPixelColorWithOverflow(int32_t x, int32_t y, OverflowMethod * (and other modes if colour can't calculated in a specified way)
*
* \return interpolated color value (including interpolated alpha value, if image has alpha layer)
- *
+ *
* \author ***bd*** 2.2004
*/
RGBQUAD CxImage::GetPixelColorInterpolated(
- float x,float y,
- InterpolationMethod const inMethod,
- OverflowMethod const ofMethod,
+ float x,float y,
+ InterpolationMethod const inMethod,
+ OverflowMethod const ofMethod,
RGBQUAD* const rplColor)
{
//calculate nearest pixel
@@ -224,8 +224,8 @@ RGBQUAD CxImage::GetPixelColorInterpolated( wbb=wa*(*pxptr++); wgg=wa*(*pxptr++); wrr=wa*(*pxptr++);
wbb+=wb*(*pxptr++); wgg+=wb*(*pxptr++); wrr+=wb*(*pxptr);
pxptr+=(info.dwEffWidth-5); //move to next row
- wbb+=wc*(*pxptr++); wgg+=wc*(*pxptr++); wrr+=wc*(*pxptr++);
- wbb+=wd*(*pxptr++); wgg+=wd*(*pxptr++); wrr+=wd*(*pxptr);
+ wbb+=wc*(*pxptr++); wgg+=wc*(*pxptr++); wrr+=wc*(*pxptr++);
+ wbb+=wd*(*pxptr++); wgg+=wd*(*pxptr++); wrr+=wd*(*pxptr);
color.rgbRed=(uint8_t) (wrr>>8); color.rgbGreen=(uint8_t) (wgg>>8); color.rgbBlue=(uint8_t) (wbb>>8);
#if CXIMAGE_SUPPORT_ALPHA
if (pAlpha) {
@@ -266,7 +266,7 @@ RGBQUAD CxImage::GetPixelColorInterpolated( return color;
}//if
}//default
- case IM_BICUBIC:
+ case IM_BICUBIC:
case IM_BICUBIC2:
case IM_BSPLINE:
case IM_BOX:
@@ -393,7 +393,8 @@ RGBQUAD CxImage::GetPixelColorInterpolated( kernelx[i]=KernelPower((float)(xi+i-1-x));
kernely[i]=KernelPower((float)(yi+i-1-y));
}//for i
- break;
+ break; + default:break;
}//switch
rr=gg=bb=aa=0;
if (((xi+2)<head.biWidth) && xi>=1 && ((yi+2)<head.biHeight) && (yi>=1) && !IsIndexed()) {
@@ -519,7 +520,7 @@ RGBQUAD CxImage::GetPixelColorInterpolated( if (gg>255) gg=255; if (gg<0) gg=0; color.rgbGreen=(uint8_t) gg;
if (bb>255) bb=255; if (bb<0) bb=0; color.rgbBlue=(uint8_t) bb;
#if CXIMAGE_SUPPORT_ALPHA
- if (aa>255) aa=255; if (aa<0) aa=0; color.rgbReserved=(uint8_t) aa;
+ if (aa>255) aa=255; if (aa<0) aa=0; color.rgbReserved=(uint8_t) aa;
#else
color.rgbReserved = 0;
#endif
@@ -542,12 +543,12 @@ void CxImage::AddAveragingCont(RGBQUAD const &color, float const surf, float &rr }
////////////////////////////////////////////////////////////////////////////////
/**
- * This method is similar to GetPixelColorInterpolated, but this method also properly handles
+ * This method is similar to GetPixelColorInterpolated, but this method also properly handles
* subsampling.
- * If you need to sample original image with interval of more than 1 pixel (as when shrinking an image),
+ * If you need to sample original image with interval of more than 1 pixel (as when shrinking an image),
* you should use this method instead of GetPixelColorInterpolated or aliasing will occur.
* When area width and height are both less than pixel, this method gets pixel color by interpolating
- * color of frame center with selected (inMethod) interpolation by calling GetPixelColorInterpolated.
+ * color of frame center with selected (inMethod) interpolation by calling GetPixelColorInterpolated.
* If width and height are more than 1, method calculates color by averaging color of pixels within area.
* Interpolation method is not used in this case. Pixel color is interpolated by averaging instead.
* If only one of both is more than 1, method uses combination of interpolation and averaging.
@@ -555,7 +556,7 @@ void CxImage::AddAveragingCont(RGBQUAD const &color, float const surf, float &rr * between IM_BILINEAR (perhaps best for this case) and better methods. IM_NEAREST_NEIGHBOUR again
* leads to aliasing artifacts.
* This method is a bit slower than GetPixelColorInterpolated and when aliasing is not a problem, you should
- * simply use the later.
+ * simply use the later.
*
* \param xc, yc - center of (rectangular) area
* \param w, h - width and height of area
@@ -566,13 +567,13 @@ void CxImage::AddAveragingCont(RGBQUAD const &color, float const surf, float &rr * \author ***bd*** 2.2004
*/
RGBQUAD CxImage::GetAreaColorInterpolated(
- float const xc, float const yc, float const w, float const h,
- InterpolationMethod const inMethod,
- OverflowMethod const ofMethod,
+ float const xc, float const yc, float const w, float const h,
+ InterpolationMethod const inMethod,
+ OverflowMethod const ofMethod,
RGBQUAD* const rplColor)
{
RGBQUAD color; //calculated colour
-
+
if (h<=1 && w<=1) {
//both width and height are less than one... we will use interpolation of center point
return GetPixelColorInterpolated(xc, yc, inMethod, ofMethod, rplColor);
@@ -581,11 +582,11 @@ RGBQUAD CxImage::GetAreaColorInterpolated( CxRect2 area(xc-w/2.0f, yc-h/2.0f, xc+w/2.0f, yc+h/2.0f); //area
int32_t xi1=(int32_t)(area.botLeft.x+0.49999999f); //low x
int32_t yi1=(int32_t)(area.botLeft.y+0.49999999f); //low y
-
-
+
+
int32_t xi2=(int32_t)(area.topRight.x+0.5f); //top x
int32_t yi2=(int32_t)(area.topRight.y+0.5f); //top y (for loops)
-
+
float rr,gg,bb,aa; //red, green, blue and alpha components
rr=gg=bb=aa=0;
int32_t x,y; //loop counters
@@ -601,7 +602,7 @@ RGBQUAD CxImage::GetAreaColorInterpolated( hBL=intBL.Height(); //height of bottom left...
wTR=intTR.Width(); //width of top right...
hTR=intTR.Height(); //height of top right...
-
+
AddAveragingCont(GetPixelColorWithOverflow(xi1,yi1,ofMethod,rplColor), wBL*hBL, rr, gg, bb, aa); //bottom left pixel
AddAveragingCont(GetPixelColorWithOverflow(xi2,yi1,ofMethod,rplColor), wTR*hBL, rr, gg, bb, aa); //bottom right pixel
AddAveragingCont(GetPixelColorWithOverflow(xi1,yi2,ofMethod,rplColor), wBL*hTR, rr, gg, bb, aa); //top left pixel
@@ -617,7 +618,7 @@ RGBQUAD CxImage::GetAreaColorInterpolated( AddAveragingCont(GetPixelColorWithOverflow(xi2,y,ofMethod,rplColor), wTR, rr, gg, bb, aa); //right column
}
for (y=yi1+1; y<yi2; y++) {
- for (x=xi1+1; x<xi2; x++) {
+ for (x=xi1+1; x<xi2; x++) {
color=GetPixelColorWithOverflow(x,y,ofMethod,rplColor);
rr+=color.rgbRed;
gg+=color.rgbGreen;
@@ -644,9 +645,9 @@ RGBQUAD CxImage::GetAreaColorInterpolated( aa+=color.rgbReserved*cps;
#endif
}//for x
- }//for y
+ }//for y
}//if
-
+
s=area.Surface();
rr/=s; gg/=s; bb/=s; aa/=s;
if (rr>255) rr=255; if (rr<0) rr=0; color.rgbRed=(uint8_t) rr;
@@ -673,7 +674,7 @@ float CxImage::KernelBSpline(const float x) if ((xp2) <= 0.0f) a = 0.0f; else a = xp2*xp2*xp2; // Only float, not float -> double -> float
if ((xp1) <= 0.0f) b = 0.0f; else b = xp1*xp1*xp1;
- if (x <= 0) c = 0.0f; else c = x*x*x;
+ if (x <= 0) c = 0.0f; else c = x*x*x;
if ((xm1) <= 0.0f) d = 0.0f; else d = xm1*xm1*xm1;
return (0.16666666666666666667f * (a - (4.0f * b) + (6.0f * c) - (4.0f * d)));
@@ -710,7 +711,7 @@ float CxImage::KernelLinear(const float t) // if (0<=t && t<=1) return 1-t;
// if (-1<=t && t<0) return 1+t;
// return 0;
-
+
//<Vladimír Kloucek>
if (t < -1.0f)
return 0.0f;
@@ -841,9 +842,9 @@ float CxImage::KernelBlackman(const float x) float CxImage::KernelBessel_J1(const float x)
{
double p, q;
-
+
register int32_t i;
-
+
static const double
Pone[] =
{
@@ -869,7 +870,7 @@ float CxImage::KernelBessel_J1(const float x) 0.1606931573481487801970916749e+4,
0.1e+1
};
-
+
p = Pone[8];
q = Qone[8];
for (i=7; i >= 0; i--)
@@ -883,9 +884,9 @@ float CxImage::KernelBessel_J1(const float x) float CxImage::KernelBessel_P1(const float x)
{
double p, q;
-
+
register int32_t i;
-
+
static const double
Pone[] =
{
@@ -905,7 +906,7 @@ float CxImage::KernelBessel_P1(const float x) 0.2030775189134759322293574e+3,
0.1e+1
};
-
+
p = Pone[5];
q = Qone[5];
for (i=4; i >= 0; i--)
@@ -919,9 +920,9 @@ float CxImage::KernelBessel_P1(const float x) float CxImage::KernelBessel_Q1(const float x)
{
double p, q;
-
+
register int32_t i;
-
+
static const double
Pone[] =
{
@@ -941,7 +942,7 @@ float CxImage::KernelBessel_Q1(const float x) 0.1038187585462133728776636e+3,
0.1e+1
};
-
+
p = Pone[5];
q = Qone[5];
for (i=4; i >= 0; i--)
@@ -955,7 +956,7 @@ float CxImage::KernelBessel_Q1(const float x) float CxImage::KernelBessel_Order1(float x)
{
float p, q;
-
+
if (x == 0.0)
return (0.0f);
p = x;
@@ -1006,7 +1007,7 @@ float CxImage::KernelMitchell(const float x) #define KM_Q1 ((-12.0f * KM_B - 48.0f * KM_C) / 6.0f)
#define KM_Q2 (( 6.0f * KM_B + 30.0f * KM_C) / 6.0f)
#define KM_Q3 (( -1.0f * KM_B - 6.0f * KM_C) / 6.0f)
-
+
if (x < -2.0)
return(0.0f);
if (x < -1.0)
diff --git a/hge/CxImage/ximapng.cpp b/hge/CxImage/ximapng.cpp index b732491..2e39d1b 100644 --- a/hge/CxImage/ximapng.cpp +++ b/hge/CxImage/ximapng.cpp @@ -85,7 +85,7 @@ bool CxImagePNG::Decode(CxFile *hFile) png_read_info(png_ptr, info_ptr);
png_uint_32 _width,_height;
- int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type;
+ int _bit_depth,_color_type,_interlace_type/*,_compression_type,_filter_type*/;
#if PNG_LIBPNG_VER > 10399
png_get_IHDR(png_ptr,info_ptr,&_width,&_height,&_bit_depth,&_color_type,
&_interlace_type,&_compression_type,&_filter_type);
@@ -95,8 +95,8 @@ bool CxImagePNG::Decode(CxFile *hFile) _bit_depth=info_ptr->bit_depth;
_color_type=info_ptr->color_type;
_interlace_type=info_ptr->interlace_type;
- _compression_type=info_ptr->compression_type;
- _filter_type=info_ptr->filter_type;
+ //_compression_type=info_ptr->compression_type;
+ //_filter_type=info_ptr->filter_type;
#endif
if (info.nEscape == -1){
diff --git a/hge/graphics.cpp b/hge/graphics.cpp index 20fc634..0bab75a 100644 --- a/hge/graphics.cpp +++ b/hge/graphics.cpp @@ -589,7 +589,7 @@ static inline bool _IsPowerOfTwo(const GLuint x) static inline GLuint _NextPowerOfTwo(GLuint x) { x--; - for (int i = 1; i < (sizeof(GLuint) * 8); i *= 2) + for (unsigned i = 1; i < (sizeof(GLuint) * 8); i <<= 1) x |= x >> i; return x + 1; } @@ -859,7 +859,7 @@ DWORD * CALL HGE_Impl::Texture_Lock(HTEXTURE tex, bool bReadOnly, int left, int { int w, h; pTex->pixels = _DecodeImage(data, pTex->filename, size, w, h); - if ((w != pTex->width) || (h != pTex->height)) // yikes, file changed? + if ((w != (int)pTex->width) || (h != (int)pTex->height)) // yikes, file changed? { delete[] pTex->pixels; pTex->pixels = NULL; @@ -889,9 +889,9 @@ DWORD * CALL HGE_Impl::Texture_Lock(HTEXTURE tex, bool bReadOnly, int left, int // !!! FIXME: do something with this? assert(width > 0); - assert(width <= pTex->width); + assert(width <= (int)pTex->width); assert(height > 0); - assert(height <= pTex->height); + assert(height <= (int)pTex->height); assert(left >= 0); assert(left <= width); assert(top >= 0); @@ -1345,7 +1345,7 @@ void HGE_Impl::_Resize(int width, int height) void HGE_Impl::_GfxDone() { - CRenderTargetList *target=pTargets; + //CRenderTargetList *target=pTargets; while(textures) Texture_Free(textures->tex); while(pTargets) Target_Free((HTARGET) pTargets); diff --git a/hge/input.cpp b/hge/input.cpp index 4392edd..4cd2c97 100644 --- a/hge/input.cpp +++ b/hge/input.cpp @@ -264,7 +264,7 @@ void HGE_Impl::_BuildEvent(int type, int key, int scan, int flags, int x, int y) if(type==INPUT_KEYDOWN) { key = SDLKeyToHGEKey(key); - if ( (key < 0) || (key > (sizeof (keyz) / sizeof (keyz[0]))) ) return; + if ( (key < 0) || (key > (int)(sizeof (keyz) / sizeof (keyz[0]))) ) return; keyz[key] |= 4; if((flags & HGEINP_REPEAT) == 0) keyz[key] |= 1; eptr->event.chr = (char) ((key >= 32) && (key <= 127)) ? key : 0; // these map to ASCII in sdl. @@ -272,7 +272,7 @@ void HGE_Impl::_BuildEvent(int type, int key, int scan, int flags, int x, int y) if(type==INPUT_KEYUP) { key = SDLKeyToHGEKey(key); - if ( (key < 0) || (key > (sizeof (keyz) / sizeof (keyz[0]))) ) return; + if ( (key < 0) || (key > (int)(sizeof (keyz) / sizeof (keyz[0]))) ) return; keyz[key] &= ~4; keyz[key] |= 2; eptr->event.chr = (char) ((key >= 32) && (key <= 127)) ? key : 0; // these map to ASCII in sdl. @@ -349,7 +349,7 @@ void HGE_Impl::_ClearQueue() CInputEventList *nexteptr, *eptr=queue; //memset(&keyz, 0, sizeof(keyz)); - for (int i = 0; i < sizeof (keyz) / sizeof (keyz[0]); i++) + for (int i = 0; i < (int)(sizeof (keyz) / sizeof (keyz[0])); i++) keyz[i] &= ~3; // only reset some of the bits. while(eptr) diff --git a/hge/resource.cpp b/hge/resource.cpp index 0fb7051..4937ee1 100644 --- a/hge/resource.cpp +++ b/hge/resource.cpp @@ -245,9 +245,8 @@ static int locateOneElement(char *buf) static int locateCorrectCase(char *buf) { char *ptr = buf; - char *prevptr = buf; - while (ptr = strchr(ptr + 1, '/')) + while ((ptr = strchr(ptr + 1, '/'))) { *ptr = '\0'; /* block this path section off */ if (!locateOneElement(buf)) diff --git a/hge/sound.cpp b/hge/sound.cpp index bd9a8d7..5880b5a 100644 --- a/hge/sound.cpp +++ b/hge/sound.cpp @@ -23,7 +23,7 @@ #include "AL/alext.h" #include "ogg/ogg.h" #include "vorbis/vorbisfile.h" -static const char* SOUND_SRC_FN="hge/sound_openal.cpp"; +static const char* SOUND_SRC_FN="hge/sound.cpp"; struct oggcbdata { const BYTE *data; @@ -113,7 +113,7 @@ static void *decompress_vorbis(const BYTE *data, const DWORD size, ALsizei *deco if (rc > 0) { *decompressed_size += rc; - if (*decompressed_size >= allocated) + if ((unsigned)*decompressed_size >= allocated) { allocated *= 2; ALubyte *tmp = (ALubyte *) realloc(retval, allocated); @@ -162,7 +162,7 @@ static ALuint get_source() HEFFECT CALL HGE_Impl::Effect_Load(const char *filename, DWORD size) { - DWORD _size, length, samples; + DWORD _size; void *data; if(hOpenAL) @@ -192,17 +192,17 @@ HEFFECT CALL HGE_Impl::Effect_Load(const char *filename, DWORD size) ALenum fmt = AL_FORMAT_STEREO16; if (isOgg) { - if (alIsExtensionPresent((const ALchar *) "AL_EXT_vorbis")) + /*if (alIsExtensionPresent((const ALchar *) "AL_EXT_vorbis"))//useless { fmt = alGetEnumValue((const ALchar *) "AL_FORMAT_VORBIS_EXT"); decompressed = data; decompressed_size = _size; } else - { + {*/ allocation_decompressed = decompress_vorbis((const BYTE *) data, _size, &decompressed_size, &fmt, &freq); decompressed = allocation_decompressed; - } + //} } ALuint bid = 0; diff --git a/hge/system.cpp b/hge/system.cpp index 96a2d37..5ec280a 100644 --- a/hge/system.cpp +++ b/hge/system.cpp @@ -17,7 +17,7 @@ #define LOWORDINT(n) ((int)((signed short)(LOWORD(n)))) #define HIWORDINT(n) ((int)((signed short)(HIWORD(n)))) -static char* SYSTEM_SRC_FN="hge/system.cpp"; +static const char* SYSTEM_SRC_FN="hge/system.cpp"; int nRef=0; HGE_Impl* pHGE=0; @@ -56,7 +56,6 @@ void CALL HGE_Impl::Release() bool CALL HGE_Impl::System_Initiate() { - int width, height; // Log system info @@ -421,6 +420,7 @@ void CALL HGE_Impl::System_SetStateBool(hgeBoolState state, bool value) #ifdef DEMO case HGE_SHOWSPLASH: bDMO=value; break; #endif + default:break; } } @@ -434,6 +434,7 @@ void CALL HGE_Impl::System_SetStateFunc(hgeFuncState state, hgeCallback value) case HGE_FOCUSGAINFUNC: procFocusGainFunc=value; break; case HGE_GFXRESTOREFUNC: procGfxRestoreFunc=value; break; case HGE_EXITFUNC: procExitFunc=value; break; + default:break; } } @@ -449,6 +450,7 @@ void CALL HGE_Impl::System_SetStateHwnd(hgeHwndState state, HWND value) if(!hwnd) hwndParent=value; break; + default:break; } } @@ -483,6 +485,7 @@ void CALL HGE_Impl::System_SetStateInt(hgeIntState state, int value) if(nHGEFPS>0) nFixedDelta=int(1000.0f/value); else nFixedDelta=0; break; + default:break; } } @@ -511,6 +514,7 @@ void CALL HGE_Impl::System_SetStateString(hgeStringState state, const char *valu } else szLogFile[0]=0; break; + default:break; } } @@ -528,6 +532,7 @@ bool CALL HGE_Impl::System_GetStateBool(hgeBoolState state) #ifdef DEMO case HGE_SHOWSPLASH: return bDMO; #endif + default:break; } return false; @@ -542,6 +547,7 @@ hgeCallback CALL HGE_Impl::System_GetStateFunc(hgeFuncState state) case HGE_FOCUSLOSTFUNC: return procFocusLostFunc; case HGE_FOCUSGAINFUNC: return procFocusGainFunc; case HGE_EXITFUNC: return procExitFunc; + default:break; } return NULL; @@ -553,6 +559,7 @@ HWND CALL HGE_Impl::System_GetStateHwnd(hgeHwndState state) { case HGE_HWND: return hwnd; case HGE_HWNDPARENT: return hwndParent; + default:break; } return 0; @@ -573,6 +580,7 @@ int CALL HGE_Impl::System_GetStateInt(hgeIntState state) case HGE_STREAMVOLUME: return nStreamVolume; case HGE_FPS: return nHGEFPS; case HGE_POWERSTATUS: return nPowerStatus; + default:break; } return 0; @@ -586,6 +594,7 @@ const char* CALL HGE_Impl::System_GetStateString(hgeStringState state) { else return 0; case HGE_LOGFILE: if(szLogFile[0]) return szLogFile; else return 0; + default:break; } return NULL; diff --git a/hgehelp/hgefont.cpp b/hgehelp/hgefont.cpp index 80fdd47..309a773 100644 --- a/hgehelp/hgefont.cpp +++ b/hgehelp/hgefont.cpp @@ -70,7 +70,7 @@ hgeFont::hgeFont(const char *szFont, bool bMipmap) // Parse font description - while(pdesc = _get_line(pdesc,linebuf)) + while((pdesc = _get_line(pdesc,linebuf))) { if(!strncmp(linebuf, FNTBITMAPTAG, sizeof(FNTBITMAPTAG)-1 )) { @@ -334,4 +334,4 @@ char *hgeFont::_get_line(char *file, char *line) while(file[i] && (file[i]=='\n' || file[i]=='\r')) i++; return file + i; -}
\ No newline at end of file +} @@ -60,7 +60,7 @@ int pnt1,pnt2; double towers[16];int tcnt; double dscroll,roll; bool sout,tendone;bool dmt[16]; -static const char* LEVEL_H_FN="levels.h"; +//static const char* LEVEL_H_FN="levels.h"; void Level1Part1() { //Level procedure @@ -1073,7 +1073,7 @@ void Level4Part22() IfShowTip=false; FadeTip=false; Current_Position=2; - ShowTip("Have problem breathing?\n\...so try this!"); + ShowTip("Have problem breathing?\n...so try this!"); } if (Current_Position==1) { @@ -12,7 +12,7 @@ #define libcgh_H #define pi 3.1415926535 #define sqr(x) ((x)*(x)) -static const char* LIBCGH_H_FN="libcgh.h"; +//static const char* LIBCGH_H_FN="libcgh.h"; struct vector2d { @@ -99,7 +99,7 @@ private: bool done; public: bool Active(); - void Init(char *Font,char *_Text,double _tlim,double _alim,double _dlim,DWORD _color=0x00FFFFFF); + void Init(const char *Font,const char *_Text,double _tlim,double _alim,double _dlim,DWORD _color=0x00FFFFFF); void Launch(vector2d pos); void Process(double DT); }; diff --git a/libcghEx.cpp b/libcghEx.cpp index f959e19..7ae9aa5 100644 --- a/libcghEx.cpp +++ b/libcghEx.cpp @@ -4,7 +4,7 @@ #include "libcgh.h" #include <cmath> #include <cstring> -static const char* LIBCGH_SRC_FN="libcghEx.cpp"; +//static const char* LIBCGH_SRC_FN="libcghEx.cpp"; void CircleIndicator::Init(double _r,double _thk,BYTE _a,bool _gr,HTEXTURE _Texture,TextureRect _TR,DWORD _cc) { @@ -64,10 +64,10 @@ double LinearProgresser::GetDelta(){return val-a;} double LinearProgresser::GetElapsed(){return Elapsed;} bool HangUpText::Active(){return TFont&&!done;} -void HangUpText::Init(char *Font,char *_Text,double _tlim,double _alim,double _dlim,DWORD _color) +void HangUpText::Init(const char *Font,const char *_Text,double _tlim,double _alim,double _dlim,DWORD _color) { TFont=new hgeFont(Font); - memcpy(Text,_Text,sizeof(_Text)); + strcpy(Text,_Text); Limit=_tlim;alim=_alim;dlim=_dlim;TFont->SetColor(_color); Progresser.Init(0,dlim,Limit);Progalpha.Init(0,255,Limit/2); } diff --git a/menuitem.cpp b/menuitem.cpp index 55317d3..0b6c0b2 100644 --- a/menuitem.cpp +++ b/menuitem.cpp @@ -12,11 +12,11 @@ #include "menuitem.h" #define UnfocColor 0xFFCCCC40 #define FocColor 0xFFFFCC66 -static const char* MENUITEM_SRC_FN="menuitem.cpp"; +//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, char *_title) +hgeGUIMenuItem::hgeGUIMenuItem(int _id, hgeFont *_fnt, HEFFECT _snd, float _x, float _y, float _delay, const char *_title) { float w; @@ -24,7 +24,7 @@ hgeGUIMenuItem::hgeGUIMenuItem(int _id, hgeFont *_fnt, HEFFECT _snd, float _x, f fnt=_fnt; snd=_snd; delay=_delay; - title=_title; + title=(char*)_title; color.SetHWColor(UnfocColor); shadow.SetHWColor(0x30000000); @@ -13,13 +13,13 @@ #include "hgegui.h" #include "hgefont.h" #include "hgecolor.h" -static const char* MENUITEM_H_FN="menuitem.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, char *title); + hgeGUIMenuItem(int id, hgeFont *fnt, HEFFECT snd, float x, float y, float delay, const char *title); virtual void Render(); virtual void Update(float dt); @@ -3,7 +3,7 @@ //"Copyleft" Chrisoft 2013 //[Perfect Freeze]: Code for menus won't change... until ...? // --Announcement from Chirsno -static const char* MENUS_H_FN="menus.h"; +//static const char* MENUS_H_FN="menus.h"; hgeGUI *StartGUI,*DeathGUI,*CompleteGUI,*HighScoreGUI; hgeGUI *HSViewGUI,*HSDetailGUI,*PauseGUI,*BkTTitleGUI; @@ -399,69 +399,69 @@ void HSViewGUI_Init() { case 1: HSViewGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Highscore - Easy")); - for (int i=1;i<=Ecnt;++i) + for (unsigned i=1;i<=Ecnt;++i) { #ifdef WIN32 - sprintf(HSVstr[i],"%d. %s - %I64d",i,ERec[i].name,ERec[i].score); + sprintf(HSVstr[i],"%u. %s - %I64d",i,ERec[i].name,ERec[i].score); #else - sprintf(HSVstr[i],"%d. %s - %d",i,ERec[i].name,ERec[i].score); + 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 (int i=Ecnt+1;i<=5;++i) + for (unsigned i=Ecnt+1;i<=5;++i) { - sprintf(HSVstr[i],"%d. ----------",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 (int i=1;i<=Ncnt;++i) + for (unsigned i=1;i<=Ncnt;++i) { #ifdef WIN32 - sprintf(HSVstr[i],"%d. %s - %I64d",i,NRec[i].name,NRec[i].score); + sprintf(HSVstr[i],"%u. %s - %I64d",i,NRec[i].name,NRec[i].score); #else - sprintf(HSVstr[i],"%d. %s - %lld",i,NRec[i].name,NRec[i].score); + 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 (int i=Ncnt+1;i<=5;++i) + for (unsigned i=Ncnt+1;i<=5;++i) { - sprintf(HSVstr[i],"%d. ----------",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 (int i=1;i<=Excnt;++i) + for (unsigned i=1;i<=Excnt;++i) { #ifdef WIN32 - sprintf(HSVstr[i],"%d. %s - %I64d",i,ExRec[i].name,ExRec[i].score); + sprintf(HSVstr[i],"%u. %s - %I64d",i,ExRec[i].name,ExRec[i].score); #else - sprintf(HSVstr[i],"%d. %s - %lld",i,ExRec[i].name,ExRec[i].score); + sprintf(HSVstr[i],"%u. %s - %lld",i,ExRec[i].name,ExRec[i].score); #endif HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i])); } - for (int i=Excnt+1;i<=5;++i) + for (unsigned i=Excnt+1;i<=5;++i) { - sprintf(HSVstr[i],"%d. ----------",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 (int i=1;i<=FPMcnt;++i) + for (unsigned i=1;i<=FPMcnt;++i) { #ifdef WIN32 - sprintf(HSVstr[i],"%d. %s - %I64d",i,FPMRec[i].name,FPMRec[i].score); + sprintf(HSVstr[i],"%u. %s - %I64d",i,FPMRec[i].name,FPMRec[i].score); #else - sprintf(HSVstr[i],"%d. %s - %lld",i,FPMRec[i].name,FPMRec[i].score); + sprintf(HSVstr[i],"%u. %s - %lld",i,FPMRec[i].name,FPMRec[i].score); #endif HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i])); } - for (int i=FPMcnt+1;i<=5;++i) + for (unsigned i=FPMcnt+1;i<=5;++i) { - sprintf(HSVstr[i],"%d. ----------",i); + sprintf(HSVstr[i],"%u. ----------",i); HSViewGUI->AddCtrl(new hgeGUIMenuItem(i+1,fnt,snd,400,200+30*i,0.1f*i,HSVstr[i])); } break; @@ -4,9 +4,9 @@ HEFFECT Mus; HCHANNEL Muc; int lpst,lped; -static const char* MUSIC_H_FN="music.h"; +//static const char* MUSIC_H_FN="music.h"; -void Music_Init(char* file) +void Music_Init(const char* file) { Mus=hge->Effect_Load(file); } @@ -1,7 +1,7 @@ //Chrisoft Bullet Lab Remix HGE //Score Recording Implementations //"Copyleft" Chrisoft 2013 -static const char* SCOREC_H_FN="scorec.h"; +//static const char* SCOREC_H_FN="scorec.h"; struct TRecord { @@ -18,7 +18,8 @@ unsigned int Getuint() { unsigned int c1,c2,c3,c4,res; c1=c2=c3=c4=0; - scanf("%c%c%c%c",&c1,&c2,&c3,&c4); + //scanf("%c%c%c%c",&c1,&c2,&c3,&c4); + c1=getchar();c2=getchar();c3=getchar();c4=getchar(); res=(c1<<24)+(c2<<16)+(c3<<8)+c4; return res; } @@ -30,7 +31,9 @@ long long Getll() { long long c1,c2,c3,c4,c5,c6,c7,c8,res; c1=c2=c3=c4=c5=c6=c7=c8=0; - scanf("%c%c%c%c%c%c%c%c",&c1,&c2,&c3,&c4,&c5,&c6,&c7,&c8); + //scanf("%c%c%c%c%c%c%c%c",&c1,&c2,&c3,&c4,&c5,&c6,&c7,&c8); + c1=getchar();c2=getchar();c3=getchar();c4=getchar(); + c5=getchar();c6=getchar();c7=getchar();c8=getchar(); res=(c1<<56)+(c2<<48)+(c3<<40)+(c4<<32)+(c5<<24)+(c6<<16)+(c7<<8)+c8; return res; } @@ -126,7 +129,7 @@ void Score_Init() } int CheckHighScore() { - int i; + unsigned i; switch (mode) { case 4: @@ -158,6 +161,7 @@ int CheckHighScore() return i; break; } + return 100; } void Score_Write() { @@ -165,19 +169,19 @@ void Score_Write() Putuint(0x3b424c53); Putuint(0xd1ffa0c0); Putint(Ecnt); - for (int i=1;i<=Ecnt;++i) + for (unsigned i=1;i<=Ecnt;++i) PutTRecord(ERec[i]); Putuint(0xd1ffa0c1); Putint(Ncnt); - for (int i=1;i<=Ncnt;++i) + for (unsigned i=1;i<=Ncnt;++i) PutTRecord(NRec[i]); Putuint(0xd1ffa0c2); Putint(Excnt); - for (int i=1;i<=Excnt;++i) + for (unsigned i=1;i<=Excnt;++i) PutTRecord(ExRec[i]); Putuint(0xd1ffa0c3); Putint(FPMcnt); - for (int i=1;i<=FPMcnt;++i) + for (unsigned i=1;i<=FPMcnt;++i) PutTRecord(FPMRec[i]); fclose(stdout); } @@ -193,12 +197,12 @@ void Score_Initailize() } void InsertHighScore() { - int pos=CheckHighScore(); + unsigned pos=CheckHighScore(); switch (mode) { case 4: if (pos<=Ecnt) - for (int i=5;i>pos;--i) + for (unsigned i=5;i>pos;--i) ERec[i]=ERec[i-1]; else ++Ecnt; if (Ecnt<5)++Ecnt; @@ -212,7 +216,7 @@ void InsertHighScore() break; case 1: if (pos<=Ncnt) - for (int i=5;i>pos;--i) + for (unsigned i=5;i>pos;--i) NRec[i]=NRec[i-1]; if (Ncnt<5)++Ncnt; NRec[pos].score=score; @@ -225,7 +229,7 @@ void InsertHighScore() break; case 2: if (pos<=Excnt) - for (int i=5;i>pos;--i) + for (unsigned i=5;i>pos;--i) ExRec[i]=ExRec[i-1]; if (Excnt<5)++Excnt; ExRec[pos].score=score; @@ -238,7 +242,7 @@ void InsertHighScore() break; case 3: if (pos<=FPMcnt) - for (int i=5;i>pos;--i) + for (unsigned i=5;i>pos;--i) FPMRec[i]=FPMRec[i-1]; if (FPMcnt<5)++FPMcnt; FPMRec[pos].score=score; diff --git a/scoresystem.h b/scoresystem.h index 12c249c..3807e45 100644 --- a/scoresystem.h +++ b/scoresystem.h @@ -5,7 +5,7 @@ CircleIndicator MultTimer; hgeFont *MultFnt; hgeSprite *MB; int valbrk; -static const char* SCORESYSTEM_H_FN="scoresystem.h"; +//static const char* SCORESYSTEM_H_FN="scoresystem.h"; //Multiplier Indicator diff --git a/towernbullet.h b/towernbullet.h index 7dad226..ab0c2b6 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -8,7 +8,7 @@ //I found the rendering code stupid so I MUST rewrite it RIGHT NOW. // --Announcement from Chirsno #include "effects.h" -static const char* TOWERNBULLET_H_FN="towernbullet.h"; +//static const char* TOWERNBULLET_H_FN="towernbullet.h"; void DirectBullet(Bullet &a,double rad) { @@ -1394,8 +1394,10 @@ void ProcessTower8() } int pnt=CreateBullet8(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect); if (Dis8ref) - if (tower[i].towerpos.y<300) - DirectBullet(bullet[pnt],-pi/2);else DirectBullet(bullet[pnt],pi/2); + { + if (tower[i].towerpos.y<300) + DirectBullet(bullet[pnt],-pi/2);else DirectBullet(bullet[pnt],pi/2); + } if (tower[i].curshotcount==tower[i].shotcount) tower[i].tdir=bullet[pnt].bulletdir; else @@ -1846,7 +1848,6 @@ public: { Bullets[i].bulletpos=vector2d(3+Centre.x+range*sin(radian-i*(2*pi/BCnt))-6, 3+Centre.y-range*cos(radian-i*(2*pi/BCnt))-6); - TextureRect rct=GetTextureRect(0,_Col); Bullets[i].aC=_Col;Bullets[i].aC2=_Col2; Bullets[i].rot=0; } @@ -1874,7 +1875,6 @@ class BulletSine private: Bullet headb; vector2d a,b,lastgenerated; - double theta; Bullet* generated[400]; int gencnt; bool OutOfBound() @@ -1889,7 +1889,6 @@ public: a=_a;b=_b;lastgenerated=_a; CreateBullet2(headb,a.x,a.y,6,0); headb.redir(b); - theta=(a.y-b.y,a.x-b.x); active=true;memset(generated,0,sizeof(generated)); gencnt=0; } |