Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-roguelike/scourge/files/, games-roguelike/scourge/
Date: Mon, 03 May 2021 09:06:34
Message-Id: 1620032787.9dd2d8a9aefa61716da5cf16780d0a67c70449fa.slyfox@gentoo
1 commit: 9dd2d8a9aefa61716da5cf16780d0a67c70449fa
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 3 09:00:41 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Mon May 3 09:06:27 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dd2d8a9
7
8 games-roguelike/scourge: tweak for gcc-11
9
10 Reported-by: Toralf Förster
11 Closes: https://bugs.gentoo.org/787845
12 Package-Manager: Portage-3.0.18, Repoman-3.0.3
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 .../scourge/files/scourge-0.21.1-gcc-11.patch | 62 ++++++++++++++++++++++
16 games-roguelike/scourge/scourge-0.21.1-r1.ebuild | 1 +
17 2 files changed, 63 insertions(+)
18
19 diff --git a/games-roguelike/scourge/files/scourge-0.21.1-gcc-11.patch b/games-roguelike/scourge/files/scourge-0.21.1-gcc-11.patch
20 new file mode 100644
21 index 00000000000..7e5dc45199c
22 --- /dev/null
23 +++ b/games-roguelike/scourge/files/scourge-0.21.1-gcc-11.patch
24 @@ -0,0 +1,62 @@
25 +https://bugs.gentoo.org/787845
26 +--- a/src/common/constants.h
27 ++++ b/src/common/constants.h
28 +@@ -970,7 +970,7 @@ struct t3DModel {
29 +
30 + char *getAn( const char *name );
31 +
32 +-typedef unsigned char byte;
33 ++typedef unsigned char scourge_byte;
34 +
35 + extern void ComputeNormals( t3DModel *pModel );
36 + extern void CreateTexture( GLuint textureArray[], char *strFileName, int textureID );
37 +--- a/src/render/Md2.h
38 ++++ b/src/render/Md2.h
39 +@@ -52,8 +52,8 @@ struct tMd2Header {
40 +
41 + /// This is used to store the vertices that are read in for the current frame.
42 + struct tMd2AliasTriangle {
43 +- byte vertex[3];
44 +- byte lightNormalIndex;
45 ++ scourge_byte vertex[3];
46 ++ scourge_byte lightNormalIndex;
47 + };
48 +
49 + /// This stores the animation scale, translation and name information for a frame, plus verts.
50 +--- a/src/render/glshape.cpp
51 ++++ b/src/render/glshape.cpp
52 +@@ -35,7 +35,7 @@ class Map;
53 + // poor man's dynamic lightmaps: shaded sides
54 + static GLuint lightmap_tex_num = 0;
55 + static GLuint lightmap_tex_num2 = 0;
56 +-static unsigned char data[LIGHTMAP_SIZE * LIGHTMAP_SIZE * 3];
57 ++static unsigned char data1[LIGHTMAP_SIZE * LIGHTMAP_SIZE * 3];
58 + static unsigned char data2[LIGHTMAP_SIZE * LIGHTMAP_SIZE * 3];
59 +
60 + GLShape::GLShape( Texture tex[], int width, int depth, int height, char const* name, int descriptionGroup,
61 +@@ -514,11 +514,11 @@ void GLShape::createDarkTexture( WallTheme *theme ) {
62 + if ( !theme || !theme->getMultiTexSmooth( 0 ) ) d = Util::roll( 127.0f, 255.0f );
63 +
64 + // purple
65 +- data[i * LIGHTMAP_SIZE * 3 + j * 3 + 0] =
66 ++ data1[i * LIGHTMAP_SIZE * 3 + j * 3 + 0] =
67 + ( unsigned char )( d * tmp * ( theme ? theme->getMultiTexRed( 0 ) : 0.8f ) );
68 +- data[i * LIGHTMAP_SIZE * 3 + j * 3 + 1] =
69 ++ data1[i * LIGHTMAP_SIZE * 3 + j * 3 + 1] =
70 + ( unsigned char )( d * tmp * ( theme ? theme->getMultiTexGreen( 0 ) : 0.4f ) );
71 +- data[i * LIGHTMAP_SIZE * 3 + j * 3 + 2] =
72 ++ data1[i * LIGHTMAP_SIZE * 3 + j * 3 + 2] =
73 + ( unsigned char )( d * tmp * ( theme ? theme->getMultiTexBlue( 0 ) : 1.0f ) );
74 +
75 + d = 255.0f;
76 +@@ -542,8 +542,8 @@ void GLShape::createDarkTexture( WallTheme *theme ) {
77 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
78 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
79 + glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
80 +- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, LIGHTMAP_SIZE, LIGHTMAP_SIZE, 0, GL_RGB, GL_UNSIGNED_BYTE, data );
81 +- gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGB, LIGHTMAP_SIZE, LIGHTMAP_SIZE, GL_RGB, GL_UNSIGNED_BYTE, data );
82 ++ glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, LIGHTMAP_SIZE, LIGHTMAP_SIZE, 0, GL_RGB, GL_UNSIGNED_BYTE, data1 );
83 ++ gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGB, LIGHTMAP_SIZE, LIGHTMAP_SIZE, GL_RGB, GL_UNSIGNED_BYTE, data1 );
84 +
85 + glBindTexture( GL_TEXTURE_2D, lightmap_tex_num2 );
86 + glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
87
88 diff --git a/games-roguelike/scourge/scourge-0.21.1-r1.ebuild b/games-roguelike/scourge/scourge-0.21.1-r1.ebuild
89 index 9d4f7eec6a2..a0ae342f3b0 100644
90 --- a/games-roguelike/scourge/scourge-0.21.1-r1.ebuild
91 +++ b/games-roguelike/scourge/scourge-0.21.1-r1.ebuild
92 @@ -38,6 +38,7 @@ PATCHES=(
93 "${FILESDIR}"/${P}-freetype_pkgconfig.patch
94 "${FILESDIR}"/${P}-Wc++11-narrowing.patch
95 "${FILESDIR}"/${PN}-0.21.1-respect-AR.patch
96 + "${FILESDIR}"/${P}-gcc-11.patch
97 )
98
99 src_prepare() {