Browse Source

Use Pillow throughout

James Bowman 6 years ago
parent
commit
fbf48063e3
5 changed files with 13 additions and 14 deletions
  1. 1 2
      .travis.yml
  2. 8 5
      default_assets.h
  3. 2 1
      gameduino2/convert.py
  4. 1 1
      gameduino2/remote.py
  5. 1 5
      unit.py

+ 1 - 2
.travis.yml

@@ -1,6 +1,5 @@
 before_install:
-  - sudo apt-get update -qq
-  - sudo apt-get install -qq python-imaging
+  - sudo pip install Pillow
 language: python
 python:
   - "2.6"

+ 8 - 5
default_assets.h

@@ -1,3 +1,6 @@
+// This file was generated with the command-line:
+//    /usr/local/bin/gd3asset -f xxx testdata/felix.png,format=L2 testdata/Hobby-of-night.ttf testdata/0.wav Aurek-Besh.ttf
+
 #define FELIX_HANDLE 0
 #define FELIX_WIDTH 320
 #define FELIX_HEIGHT 200
@@ -6,14 +9,14 @@
 #define HOBBY_OF_NIGHT_WIDTH 10
 #define HOBBY_OF_NIGHT_HEIGHT 16
 #define HOBBY_OF_NIGHT_CELLS 96
-#define 0 71832UL
+#define 0 23832UL
 #define 0_LENGTH 3272
 #define 0_FREQ 8000
 #define AUREK_BESH_HANDLE 2
 #define AUREK_BESH_WIDTH 21
 #define AUREK_BESH_HEIGHT 15
 #define AUREK_BESH_CELLS 96
-#define ASSETS_END 91092UL
+#define ASSETS_END 43092UL
 #define LOAD_ASSETS()  (GD.safeload("xxx"), GD.loadptr = ASSETS_END)
 
 static const shape_t FELIX_SHAPE = {0, 320, 200, 0};
@@ -24,7 +27,7 @@ struct {
   Bitmap hobby_of_night;
   Bitmap aurek_besh;
 } bitmaps = {
- /*            felix */  {{320, 200}, {160, 100},      0x0UL,  4,  0},
- /*   hobby_of_night */  {{ 10,  16}, {  5,   8},   0xfa00UL,  2,  1},
- /*       aurek_besh */  {{ 21,  15}, { 10,   7},  0x12560UL,  2,  2}
+ /*            felix */  {{320, 200}, {160, 100},      0x0UL, 17,  0},
+ /*   hobby_of_night */  {{ 10,  16}, {  5,   8},   0x3e80UL,  2,  1},
+ /*       aurek_besh */  {{ 21,  15}, { 10,   7},   0x69e0UL,  2,  2}
 };

+ 2 - 1
gameduino2/convert.py

@@ -1,7 +1,8 @@
-import Image
 import array
 import random
 
+from PIL import Image
+
 from gameduino2.registers import *
 from gameduino2.imbytes import imbytes
 

+ 1 - 1
gameduino2/remote.py

@@ -1,10 +1,10 @@
 import array
 import StringIO
 import zlib
-import Image
 import struct
 import time
 
+from PIL import Image
 import convert
 
 def pad4(s):

+ 1 - 5
unit.py

@@ -1,12 +1,8 @@
 import unittest
-try:
-    import Image
-except ImportError:
-    from PIL import Image
+from PIL import Image
 
 import gameduino2 as gd2
 
-
 class TestPreptools(unittest.TestCase):
     def test_tile_magicland(self):
         class Tiledemo(gd2.prep.AssetBin):