Skip to content

Commit 77de853

Browse files
committed
Removed all warnings
1 parent 7023dea commit 77de853

11 files changed

+38
-17
lines changed

src/Graphics/Animation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class Animation : public Entity
3030
time = 0;
3131
this->drawMode = drawMode;
3232
}
33+
34+
virtual ~Animation()
35+
{
36+
}
3337

3438
bool act(int dt)
3539
{

src/Graphics/Font.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class Font
1616
public:
1717
const int firstChar;
1818
const int charCount;
19+
const unsigned char *pixels;
1920
const int charWidth;
2021
const int charHeight;
21-
const unsigned char *pixels;
2222
Font(int charWidth, int charHeight, const unsigned char *pixels, int firstChar = 32, int charCount = 96)
2323
:firstChar(firstChar),
2424
charCount(charCount),

src/Graphics/GraphicsR1G1B1A1.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,39 +54,45 @@ class GraphicsR1G1B1A1: public Graphics<unsigned char>
5454
virtual void dot(int x, int y, Color color)
5555
{
5656
if ((unsigned int)x < xres && (unsigned int)y < yres)
57+
{
5758
if(x & 1)
5859
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf) | (color << 4);
5960
else
6061
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf0) | (color & 0xf);
62+
}
6163
}
6264

6365
virtual void dotAdd(int x, int y, Color color)
6466
{
6567
if ((unsigned int)x < xres && (unsigned int)y < yres)
68+
{
6669
if(x & 1)
6770
backBuffer[y][x >> 1] = backBuffer[y][x >> 1] | (color << 4);
6871
else
6972
backBuffer[y][x >> 1] = backBuffer[y][x >> 1] | (color & 0xf);
73+
}
7074
}
7175

7276
virtual void dotMix(int x, int y, Color color)
7377
{
7478
if ((unsigned int)x < xres && (unsigned int)y < yres && (color & 8) != 0)
7579
{
7680
if(x & 1)
77-
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf) | color << 4;
81+
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf) | (color << 4);
7882
else
79-
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf0) | color & 0xf;
83+
backBuffer[y][x >> 1] = (backBuffer[y][x >> 1] & 0xf0) | (color & 0xf);
8084
}
8185
}
8286

8387
virtual Color get(int x, int y)
8488
{
8589
if ((unsigned int)x < xres && (unsigned int)y < yres)
90+
{
8691
if(x & 1)
8792
return backBuffer[y][x >> 1] = backBuffer[y][x >> 1] >> 4;
8893
else
8994
return backBuffer[y][x >> 1] = backBuffer[y][x >> 1] & 0xf;
95+
}
9096
return 0;
9197
}
9298

src/Graphics/GraphicsR1G1B1A1X2S2Swapped.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ class GraphicsR1G1B1A1X2S2Swapped: public Graphics<unsigned char>
8686

8787
virtual Color** allocateFrameBuffer()
8888
{
89-
Graphics<Color>::allocateFrameBuffer(xres, yres, (Color)SBits);
89+
return Graphics<Color>::allocateFrameBuffer(xres, yres, (Color)SBits);
9090
}
9191
};

src/Graphics/ImageDrawer.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class ImageDrawer
2525
case Image::R5G5B4A2:
2626
imageR5G5B4A2(image, x, y, srcX, srcY, srcXres, srcYres);
2727
break;
28+
default:
29+
break;
2830
}
2931
}
3032

@@ -35,6 +37,8 @@ class ImageDrawer
3537
case Image::R5G5B4A2:
3638
imageAddR5G5B4A2(image, x, y, srcX, srcY, srcXres, srcYres);
3739
break;
40+
default:
41+
break;
3842
}
3943
}
4044

@@ -45,6 +49,8 @@ class ImageDrawer
4549
case Image::R5G5B4A2:
4650
imageMixR5G5B4A2(image, x, y, srcX, srcY, srcXres, srcYres);
4751
break;
52+
default:
53+
break;
4854
}
4955
}
5056

@@ -55,6 +61,8 @@ class ImageDrawer
5561
case Image::R5G5B4A2:
5662
imageR5G5B4A2(image, x, y, 0, 0, image.xres, image.yres);
5763
break;
64+
default:
65+
break;
5866
}
5967
}
6068

@@ -65,6 +73,8 @@ class ImageDrawer
6573
case Image::R5G5B4A2:
6674
imageAddR5G5B4A2(image, x, y, 0, 0, image.xres, image.yres);
6775
break;
76+
default:
77+
break;
6878
}
6979
}
7080

@@ -75,6 +85,8 @@ class ImageDrawer
7585
case Image::R5G5B4A2:
7686
imageMixR5G5B4A2(image, x, y, 0, 0, image.xres, image.yres);
7787
break;
88+
default:
89+
break;
7890
}
7991
}
8092
};

src/Graphics/Mesh.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ class Mesh
2020
public:
2121
typedef typename Graphics::Color Color;
2222
int vertexCount;
23-
int triangleCount;
2423
int edgeCount;
24+
int triangleCount;
2525
const float (*vertices)[3];
26+
const unsigned short (*edges)[2];
27+
const unsigned short (*triangles)[3];
2628
const float (*triangleNormals)[3];
2729
short (*tvertices)[3];
2830
signed char (*tTriNormals)[3];
29-
const unsigned short (*triangles)[3];
30-
const unsigned short (*edges)[2];
3131

3232
typedef Color (*triangleShader)(int trinangleNo, short *v0, short *v1, short *v2, const signed char *normal, Color color);
3333

3434
Mesh(int vertCount, const float verts[][3], int edgeCount_ = 0, const unsigned short edges_[][2] = 0, int triCount = 0, const unsigned short tris[][3] = 0, const float triNorms[][3] = 0)
3535
: vertexCount(vertCount),
36-
vertices(verts),
3736
edgeCount(edgeCount_),
38-
edges(edges_),
3937
triangleCount(triCount),
38+
vertices(verts),
39+
edges(edges_),
4040
triangles(tris),
4141
triangleNormals(triNorms)
4242
{

src/Graphics/Sprites.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Sprites
6363
this->count = count;
6464
this->sprites = new Sprite[count];
6565
for (int i = 0; i < count; i++)
66-
this->sprites[i].init(resolutions[i][0], resolutions[i][1], pixels + offsets[i], pointOffsets[i + 1] - pointOffsets[i], &points[pointOffsets[i]], pixelFormat);
66+
this->sprites[i].init(resolutions[i][0], resolutions[i][1], (unsigned char*)pixels + offsets[i], pointOffsets[i + 1] - pointOffsets[i], &points[pointOffsets[i]], pixelFormat);
6767
}
6868

6969
void draw(ImageDrawer &g, int sprite, int x, int y)

src/Math/Matrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Vector
3636
return *this;
3737
}
3838

39-
const float operator[](int i)
39+
float operator[](int i) const
4040
{
4141
return v[i];
4242
}

src/VGA/Mode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class Mode
2222
int vSync;
2323
int vBack;
2424
int vRes;
25-
int activeLineCount;
2625
int vDiv;
2726
unsigned long pixelClock;
2827
int hSyncPolarity;
2928
int vSyncPolarity;
3029
float aspect;
30+
int activeLineCount;
3131
Mode(
3232
const int hFront = 0,
3333
const int hSync = 0,

src/VGA/VGA14BitI.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class VGA14BitI : public VGA, public GraphicsR5G5B4A2
101101
void interruptPixelLine(int y, unsigned long *pixels, unsigned long syncBits)
102102
{
103103
unsigned short *line = frontBuffer[y];
104-
static int c = 0;
105104
for (int i = 0; i < mode.hRes / 2; i++)
106105
{
107106
//writing two pixels improves speed drastically (avoids memory reads)

src/VGA/VGA3BitI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ class VGA3BitI : public VGA, public GraphicsR1G1B1A1
8787
unsigned long base, baseh;
8888
if (currentLine >= mode.vFront && currentLine < mode.vFront + mode.vSync)
8989
{
90-
baseh = syncBits(true, true);//(vsyncBit | hsyncBit) | ((vsyncBit | hsyncBit) << 16);
91-
base = syncBits(false, true);//(vsyncBit | hsyncBitI) | ((vsyncBit | hsyncBitI) << 16);
90+
baseh = syncBits(true, true);
91+
base = syncBits(false, true);
9292
}
9393
else
9494
{
95-
baseh = syncBits(true, false);(vsyncBitI | hsyncBit) | ((vsyncBitI | hsyncBit) << 16);
96-
base = syncBits(false, false);(vsyncBitI | hsyncBitI) | ((vsyncBitI | hsyncBitI) << 16);
95+
baseh = syncBits(true, false);
96+
base = syncBits(false, false);
9797
}
9898
for (int i = 0; i < mode.hSync / 4; i++)
9999
signal[i] = baseh;

0 commit comments

Comments
 (0)