Skip to content

Commit 987bf9a

Browse files
committed
Merge branch 'main' of https://github.com/pygame-community/pygame-ce into events-in-python-2
2 parents a62e529 + c1cadfd commit 987bf9a

File tree

8 files changed

+328
-7
lines changed

8 files changed

+328
-7
lines changed

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|PyPiVersion| |PyPiLicense|
99
|Python3| |GithubCommits| |BlackFormatBadge|
1010

11-
**English** `简体中文`_ `Français`_ `فارسی`_ `Español`_
11+
**English** `简体中文`_ `繁體中文`_ `Français`_ `فارسی`_ `Español`_ `日本語`_
1212
---------------------------------------------------------------------------------------------------
1313

1414
Pygame_ is a free and open-source cross-platform library
@@ -215,6 +215,8 @@ See docs/licenses for licenses of dependencies.
215215
.. _wiki pages: https://github.com/pygame-community/pygame-ce/wiki
216216

217217
.. _简体中文: ./docs/readmes/README.zh-cn.rst
218+
.. _繁體中文: ./docs/readmes/README.zh-tw.rst
218219
.. _Français: ./docs/readmes/README.fr.rst
219220
.. _فارسی: ./docs/readmes/README.fa.rst
220221
.. _Español: ./docs/readmes/README.es.rst
222+
.. _日本語: ./docs/readmes/README.ja.rst

docs/readmes/README.es.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|PyPiVersion| |PyPiLicense|
88
|Python3| |GithubCommits| |BlackFormatBadge|
99

10-
`English`_ `简体中文`_ `Français`_ `فارسی`_ **Español**
10+
`English`_ `简体中文`_ `繁體中文`_ `Français`_ `فارسی`_ **Español** `日本語`_
1111
---------------------------------------------------------------------------------------------------------------------------------------------------
1212

1313
`Pygame`_ es una biblioteca multiplataforma, gratuita y de código abierto
@@ -165,6 +165,8 @@ Consulta docs/licenses para ver las licencias de dependencia.
165165
.. _GNU LGPL version 2.1: https://www.gnu.org/copyleft/lesser.html
166166

167167
.. _简体中文: README.zh-cn.rst
168+
.. _繁體中文: README.zh-tw.rst
168169
.. _English: ./../../README.rst
169170
.. _فارسی: README.fa.rst
170171
.. _Français: README.fr.rst
172+
.. _日本語: README.ja.rst

docs/readmes/README.fa.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|PyPiVersion| |PyPiLicense|
88
|Python3| |GithubCommits| |BlackFormatBadge|
99

10-
`English`_ `简体中文`_ `Français`_ **فارسی** `Español`_
10+
`English`_ `简体中文`_ `繁體中文`_ `Français`_ **فارسی** `Español`_ `日本語`_
1111
---------------------------------------------------------------------------------------------------
1212
کتابخانه
1313
Pygame_
@@ -252,5 +252,7 @@ LGPL-2.1-or-later **شناسه مجوز:**
252252

253253
.. _English: ./../../README.rst
254254
.. _简体中文: README.zh-cn.rst
255+
.. _繁體中文: README.zh-tw.rst
255256
.. _Français: README.fr.rst
256257
.. _Español: README.es.rst
258+
.. _日本語: README.ja.rst

docs/readmes/README.fr.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|PyPiVersion| |PyPiLicense|
88
|Python3| |GithubCommits| |BlackFormatBadge|
99

10-
`English`_ `简体中文`_ **Français** `فارسی`_ `Español`_
10+
`English`_ `简体中文`_ `繁體中文`_ **Français** `فارسی`_ `Español`_ `日本語`_
1111
---------------------------------------------------------------------------------------------------------------------------------------------------
1212

1313
`Pygame`_ est une bibliothèque multi-plateforme, libre et open-source
@@ -203,6 +203,8 @@ Voir les docs/licences pour les licences des dépendances.
203203
.. _GNU LGPL version 2.1: https://www.gnu.org/copyleft/lesser.html
204204

205205
.. _简体中文: README.zh-cn.rst
206+
.. _繁體中文: README.zh-tw.rst
206207
.. _English: ./../../README.rst
207208
.. _فارسی: README.fa.rst
208209
.. _Español: README.es.rst
210+
.. _日本語: README.ja.rst

docs/readmes/README.ja.rst

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
.. image:: https://raw.githubusercontent.com/pygame-community/pygame-ce/main/docs/reST/_static/pygame_ce_logo.svg
2+
:width: 800
3+
:alt: pygame
4+
:target: https://pyga.me/
5+
6+
7+
|DocsStatus|
8+
|PyPiVersion| |PyPiLicense|
9+
|Python3| |GithubCommits| |BlackFormatBadge|
10+
11+
`English` `简体中文`_ `繁體中文`_ `Français`_ `فارسی`_ `Español`_ **日本語**
12+
---------------------------------------------------------------------------------------------------
13+
14+
Pygame_ は、Pythonを使ってビデオゲームのようなマルチメディアアプリケーションを
15+
開発するための、フリーでオープンソースなクロスプラットフォームライブラリです。
16+
`Simple DirectMedia Layer library`_ や他のいくつかの有名なライブラリを使って、
17+
最も一般的な機能を抽象化して、これらのプログラムの作成をより直感的な作業にします。
18+
19+
このディストリビューションは **'pygame - Community Edition'** (略して 'pygame-ce')と呼ばれます。
20+
21+
22+
これは、以前のコア開発者たちによって作られた pygame プロジェクトのフォークであり、
23+
アップストリームの開発を継続できなくなるという困難な状況の後に作成されました。
24+
この新しいディストリビューションは、より頻繁なリリース、継続的なバグ修正や機能強化、
25+
そしてより民主的なガバナンスモデルを提供することを目指しています。
26+
27+
新しいコントリビュータは歓迎されています!
28+
29+
30+
インストール
31+
------------
32+
33+
::
34+
35+
pip install pygame-ce
36+
37+
38+
ヘルプ
39+
------
40+
41+
pygame を初めて使用する場合、すぐに開始できるはずです。
42+
Pygame には多くのチュートリアルや入門資料が付属しています。
43+
また、ライブラリ全体の完全なリファレンスドキュメントもあります。
44+
`docs page`_ でドキュメントを参照できます。
45+
46+
また、端末で ``python -m pygame.docs`` を実行することで、
47+
ドキュメントを参照することもできます。もしローカルのドキュメントが
48+
見つからない場合は、オンラインのウェブサイトが代わりに表示されます。
49+
50+
オンラインドキュメントは、github の pygame の開発版に最新の状態で
51+
追従しています。これは、あなたが使用している pygame のバージョンよりも
52+
少し新しいかもしれません。最新の完全リリースにアップグレードするには、
53+
端末で ``pip install pygame-ce --upgrade`` を実行してください。
54+
55+
56+
最も重要なことは、examples ディレクトリに多くのプレイ可能な
57+
小さなプログラムがあり、そのコードによって今すぐ使い始められることです。
58+
59+
すぐにコードを使い始めることができることです。
60+
61+
62+
ソースからのビルド
63+
------------------
64+
65+
現在開発中の機能を使用したい場合や、pygame-ce に貢献したい場合は、
66+
pip インストールするのではなく、ソースコードからローカルで
67+
pygame-ce をビルドする必要があります。
68+
69+
ソースからのインストールはかなり自動化されています。
70+
作業のほとんどは、pygame の依存関係をすべてコンパイルして
71+
インストールすることです。それが終われば、 ``setup.py`` スクリプトを
72+
実行してください。自動設定、ビルド、および pygame のインストールが
73+
試みられます。
74+
75+
インストールとコンパイルについてのより多くの情報は、
76+
`Compilation wiki page`_ にあります。
77+
78+
79+
謝辞
80+
----
81+
82+
このライブラリの開発に貢献して下さったすべての人に感謝します。
83+
84+
Special thanks:
85+
86+
* Marcus Von Appen: many changes, and fixes, 1.7.1+ freebsd maintainer
87+
* Lenard Lindstrom: the 1.8+ windows maintainer, many changes, and fixes
88+
* Brian Fisher for svn auto builder, bug tracker and many contributions
89+
* Rene Dudfield: many changes, and fixes, 1.7+ release manager/maintainer
90+
* Phil Hassey for his work on the pygame.org website
91+
* DR0ID for his work on the sprite module
92+
* Richard Goedeken for his smoothscale function
93+
* Ulf Ekström for his pixel perfect collision detection code
94+
* Pete Shinners: original author
95+
* David Clark for filling the right-hand-man position
96+
* Ed Boraas and Francis Irving: Debian packages
97+
* Maxim Sobolev: FreeBSD packaging
98+
* Bob Ippolito: macOS and OS X porting (much work!)
99+
* Jan Ekhol, Ray Kelm, and Peter Nicolai: putting up with early design ideas
100+
* Nat Pryce for starting our unit tests
101+
* Dan Richter for documentation work
102+
* TheCorruptor for his incredible logos and graphics
103+
* Nicholas Dudfield: many test improvements
104+
* Alex Folkner for pygame-ctypes
105+
106+
パッチやフィックスを送って下さった皆様: Niki Spahiev, Gordon
107+
Tyler, Nathaniel Pryce, Dave Wallace, John Popplewell, Michael Urman,
108+
Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen, Herve Cauwelier,
109+
James Mazer, Lalo Martins, Timothy Stranex, Chad Lester, Matthias
110+
Spiller, Bo Jangeborg, Dmitry Borisov, Campbell Barton, Diego Essaya,
111+
Eyal Lotem, Regis Desgroppes, Emmanuel Hainry, Randy Kaelber,
112+
Matthew L Daniel, Nirav Patel, Forrest Voight, Charlie Nolan,
113+
Frankie Robertson, John Krukoff, Lorenz Quack, Nick Irvine,
114+
Michael George, Saul Spatz, Thomas Ibbotson, Tom Rothamel, Evan Kroske,
115+
Cambell Barton.
116+
117+
そして卓越した我々のバグハンター: Angus, Guillaume Proux, Frank
118+
Raiser, Austin Henry, Kaweh Kazemi, Arturo Aldama, Mike Mulcheck,
119+
Michael Benfield, David Lau
120+
121+
他にも、多くのアイデアを提案したり、プロジェクトの進行を支えたり、
122+
我々の生活をより楽にして下さった方々がいます。ありがとう!
123+
124+
125+
ドキュメントにコメントを寄せて下さったり、 `pygame documentation`_ と
126+
`pygame-ce documentation`_ に追記して下さった方々にも感謝します。
127+
128+
また、ゲームを作成して、他の人が学んだり楽しんだりできるように
129+
pygame.org ウェブサイトに投稿して下さった方々にもとても感謝します。
130+
131+
132+
James Paige には、pygame の bugzilla をホスティングして下さったことを
133+
感謝します。
134+
135+
Roger Dingledine と SEUL.ORG のクルーにも、優れたホスティングを
136+
提供して下さったことを感謝します。
137+
138+
139+
依存関係
140+
--------
141+
142+
Pygame は、当然ながら SDL と Python に強く依存します。
143+
また、他のいくつかの小さなライブラリにもリンクしたり、埋め込まれています。
144+
フォントモジュールは SDL_ttf に依存しており、これは freetype に依存しています。
145+
ミキサー(および mixer.music)モジュールは SDL_mixer に依存しています。
146+
イメージモジュールは SDL_image に依存しています。
147+
Transform.rotozoom には SDL_rotozoom の埋め込みバージョンが含まれており、
148+
gfxdraw には SDL_gfx の埋め込みバージョンが含まれています。
149+
150+
依存バージョン:
151+
152+
+----------+------------------------+
153+
| CPython | >= 3.8 (Or use PyPy3) |
154+
+----------+------------------------+
155+
| SDL | >= 2.0.10 |
156+
+----------+------------------------+
157+
| SDL_mixer| >= 2.0.4 |
158+
+----------+------------------------+
159+
| SDL_image| >= 2.0.4 |
160+
+----------+------------------------+
161+
| SDL_ttf | >= 2.0.15 |
162+
+----------+------------------------+
163+
164+
165+
コントリビュータになるには
166+
--------------------------
167+
168+
最初に、pygame-ce のコントリビュータになることを考慮してくれたことに感謝します。
169+
あなたのような方のおかげで pygame-ce を素晴らしいライブラリにすることができます。
170+
まずは、以下のステップに従ってください:
171+
172+
1. `Contribution Guidelines`_ と `Many Ways to Contribute`_ wiki ページをお読みください
173+
2. `Opening A Pull Request`_ と `Opening a Great Pull Request`_ のドキュメントをお読みください
174+
3. `label and link reported issues`_ の How-to をお読みください
175+
4. `issue tracker`_ で興味のある issue があるかどうかをチェックするか、
176+
あなたのアイデアについての議論を開始するため、新しい issue を開いてください
177+
178+
`wiki pages`_ にもあなたのスタートを手助けするたくさんの資料があります。
179+
もし何か疑問があれば、issue を開くか、 `Pygame Community Discord Server`_ でお気軽にご質問ください。
180+
181+
182+
ライセンス
183+
----------
184+
185+
**License Identifier:** LGPL-2.1-or-later
186+
187+
188+
このライブラリは `GNU LGPL version 2.1`_ ライセンスで配布されています。
189+
ライセンスは ``docs/LGPL.txt`` にあります。我々はこのライブラリの
190+
将来のバージョンに異なるライセンスを適用する権利を保留しています。
191+
192+
これは、基本的にあなたは pygame をあらゆるプロジェクトで使用できることを
193+
意味しますが、あなたが pygame 自体に変更や追加を加えた場合、それらは
194+
互換性のあるライセンスでリリースされることが必要です。
195+
(できれば pygame-ce プロジェクトに送ってください)
196+
クローズドソースや商用ゲームで使用することができます。
197+
198+
``examples`` サブディレクトリに含まれるプログラムはパブリックドメインです。
199+
200+
ライセンスの依存関係については、docs/licenses を参照してください。
201+
202+
.. |PyPiVersion| image:: https://img.shields.io/pypi/v/pygame-ce.svg?v=1
203+
:target: https://pypi.python.org/pypi/pygame-ce
204+
205+
.. |PyPiLicense| image:: https://img.shields.io/pypi/l/pygame-ce.svg?v=1
206+
:target: https://pypi.python.org/pypi/pygame-ce
207+
208+
.. |Python3| image:: https://img.shields.io/badge/python-3-blue.svg?v=1
209+
210+
.. |GithubCommits| image:: https://img.shields.io/github/commits-since/pygame-community/pygame-ce/2.4.1.svg
211+
:target: https://github.com/pygame-community/pygame-ce/compare/2.4.1...main
212+
213+
.. |DocsStatus| image:: https://img.shields.io/website?down_message=offline&label=docs&up_message=online&url=https%3A%2F%2Fpyga.me%2Fdocs%2F
214+
:target: https://pyga.me/docs/
215+
216+
.. |BlackFormatBadge| image:: https://img.shields.io/badge/code%20style-black-000000.svg
217+
:target: https://github.com/psf/black
218+
219+
.. _Pygame: https://pyga.me
220+
.. _pygame-ce documentation: https://pyga.me/docs/
221+
.. _pygame documentation: https://www.pygame.org/docs/
222+
.. _Simple DirectMedia Layer library: https://www.libsdl.org
223+
.. _Compilation wiki page: https://github.com/pygame-community/pygame-ce/wiki#compiling
224+
.. _docs page: https://pyga.me/docs
225+
.. _GNU LGPL version 2.1: https://www.gnu.org/copyleft/lesser.html
226+
.. _Contribution Guidelines: https://github.com/pygame-community/pygame-ce/wiki/Contribution-guidelines
227+
.. _Many Ways to Contribute: https://github.com/pygame-community/pygame-ce/wiki/Many-ways-to-contribute
228+
.. _Opening A Pull Request: https://github.com/pygame-community/pygame-ce/wiki/Opening-a-pull-request
229+
.. _Opening a Great Pull Request: https://github.com/pygame-community/pygame-ce/wiki/Opening-a-great-pull-request
230+
.. _issue tracker: https://github.com/pygame-community/pygame-ce/issues
231+
.. _label and link reported issues: https://github.com/pygame-community/pygame-ce/wiki/Labelling-&-linking-reported-issues
232+
.. _Pygame Community Discord Server: https://discord.gg/pygame
233+
.. _wiki pages: https://github.com/pygame-community/pygame-ce/wiki
234+
235+
.. _简体中文: ./docs/readmes/README.zh-cn.rst
236+
.. _繁體中文: README.zh-tw.rst
237+
.. _Français: ./docs/readmes/README.fr.rst
238+
.. _فارسی: ./docs/readmes/README.fa.rst
239+
.. _Español: ./docs/readmes/README.es.rst

docs/readmes/README.zh-cn.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|PyPiVersion| |PyPiLicense|
88
|Python3| |GithubCommits| |BlackFormatBadge|
99

10-
`English`_ **简体中文** `Français`_ `فارسی`_ `Español`_
10+
`English`_ **简体中文** `繁體中文`_ `Français`_ `فارسی`_ `Español`_ `日本語`_
1111
----
1212

1313
Pygame_ 是一款自由且开源的跨平台库,用于开发电子游戏等多媒体应用。Pygame基于 `Simple DirectMedia Layer library`_ 以及其他几个广受欢迎的库,汲取其中最常见的函数,让编写游戏成为更加符合直觉的事情。
@@ -158,6 +158,8 @@ pygame显然依赖于SDL和Python。此外pygame还嵌入了几个较小的库
158158
.. _GNU LGPL version 2.1: https://www.gnu.org/copyleft/lesser.html
159159

160160
.. _English: ./../../README.rst
161+
.. _繁體中文: README.zh-tw.rst
161162
.. _Français: README.fr.rst
162163
.. _فارسی: README.fa.rst
163164
.. _Español: README.es.rst
165+
.. _日本語: README.ja.rst

src_c/draw.c

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,15 +1126,42 @@ get_antialiased_color(SDL_Surface *surf, int x, int y, Uint32 original_color,
11261126
float brightness)
11271127
{
11281128
Uint8 color_part[4], background_color[4];
1129-
Uint32 *pixels = (Uint32 *)surf->pixels;
11301129
SDL_GetRGBA(original_color, surf->format, &color_part[0], &color_part[1],
11311130
&color_part[2], &color_part[3]);
11321131
if (x < surf->clip_rect.x || x >= surf->clip_rect.x + surf->clip_rect.w ||
11331132
y < surf->clip_rect.y || y >= surf->clip_rect.y + surf->clip_rect.h)
11341133
return original_color;
1135-
SDL_GetRGBA(pixels[(y * surf->w) + x], surf->format, &background_color[0],
1134+
1135+
Uint32 pixel = 0;
1136+
int bpp = PG_SURF_BytesPerPixel(surf);
1137+
Uint8 *pixels = (Uint8 *)surf->pixels + y * surf->pitch + x * bpp;
1138+
1139+
switch (bpp) {
1140+
case 1:
1141+
pixel = *pixels;
1142+
break;
1143+
1144+
case 2:
1145+
pixel = *((Uint16 *)pixels);
1146+
break;
1147+
1148+
case 3:
1149+
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
1150+
pixel = (pixels[0]) + (pixels[1] << 8) + (pixels[2] << 16);
1151+
#else /* SDL_BIG_ENDIAN */
1152+
pixel = (pixels[2]) + (pixels[1] << 8) + (pixels[0] << 16);
1153+
#endif /* SDL_BIG_ENDIAN */
1154+
break;
1155+
1156+
default: /* case 4: */
1157+
pixel = *((Uint32 *)pixels);
1158+
break;
1159+
}
1160+
1161+
SDL_GetRGBA(pixel, surf->format, &background_color[0],
11361162
&background_color[1], &background_color[2],
11371163
&background_color[3]);
1164+
11381165
color_part[0] = (Uint8)(brightness * color_part[0] +
11391166
(1 - brightness) * background_color[0]);
11401167
color_part[1] = (Uint8)(brightness * color_part[1] +

0 commit comments

Comments
 (0)