Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - AClockWorkLemon

Pages: [1]
1
Python / PySFML hanging on initiation. (pysfml-cython)
« on: May 02, 2012, 04:41:33 am »
Hey all.

Was hoping you could help on this issue. Recently, PySFML has been creating an infinite hang when imported. Some details:

>>> import PySFML
>>> dir(PySFML)
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>> for attr in dir(PySFML):
        print attr, getattr(PySFML, attr)

       
__all__ ['sf']
__builtins__ {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'memoryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright (c) 2001-2012 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'NameError': <type 'exceptions.NameError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'dict': <type 'dict'>, 'input': <built-in function input>, 'oct': <built-in function oct>, 'bin': <built-in function bin>, 'SystemExit': <type 'exceptions.SystemExit'>, 'StandardError': <type 'exceptions.StandardError'>, 'format': <built-in function format>, 'repr': <built-in function repr>, 'sorted': <built-in function sorted>, 'False': False, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'list': <type 'list'>, 'iter': <built-in function iter>, 'reload': <built-in function reload>, 'Warning': <type 'exceptions.Warning'>, '__package__': None, 'round': <built-in function round>, 'dir': <built-in function dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 'bytes': <type 'str'>, 'reduce': <built-in function reduce>, 'intern': <built-in function intern>, 'issubclass': <built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError': <type 'exceptions.EOFError'>, 'locals': <built-in function locals>, 'BufferError': <type 'exceptions.BufferError'>, 'slice': <type 'slice'>, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'getattr': <built-in function getattr>, 'abs': <built-in function abs>, 'exit': Use exit() or Ctrl-Z plus Return to exit, 'print': <built-in function print>, 'True': True, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'None': None, 'hash': <built-in function hash>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'len': <built-in function len>, 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information., 'frozenset': <type 'frozenset'>, '__name__': '__builtin__', 'ord': <built-in function ord>, 'super': <type 'super'>, '_': ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'], 'TypeError': <type 'exceptions.TypeError'>, 'license': Type license() to see the full license text, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'filter': <built-in function filter>, 'range': <built-in function range>, 'staticmethod': <type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>, 'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in function pow>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'float': <type 'float'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'globals': <built-in function globals>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 'LookupError': <type 'exceptions.LookupError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-Z plus Return to exit, 'basestring': <type 'basestring'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'zip': <built-in function zip>, 'hex': <built-in function hex>, 'long': <type 'long'>, 'next': <built-in function next>, 'ImportError': <type 'exceptions.ImportError'>, 'chr': <built-in function chr>, 'xrange': <type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", 'Exception': <type 'exceptions.Exception'>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'IOError': <type 'exceptions.IOError'>, 'hasattr': <built-in function hasattr>, 'delattr': <built-in function delattr>, 'setattr': <built-in function setattr>, 'raw_input': <built-in function raw_input>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'compile': <built-in function compile>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'str': <type 'str'>, 'property': <type 'property'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'int': <type 'int'>, '__import__': <built-in function __import__>, 'KeyError': <type 'exceptions.KeyError'>, 'coerce': <built-in function coerce>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'file': <type 'file'>, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr': <built-in function unichr>, 'id': <built-in function id>, 'OSError': <type 'exceptions.OSError'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'min': <built-in function min>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'execfile': <built-in function execfile>, 'any': <built-in function any>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 'ValueError': <type 'exceptions.ValueError'>, 'NotImplemented': NotImplemented, 'map': <built-in function map>, 'buffer': <type 'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>, 'TabError': <type 'exceptions.TabError'>, 'callable': <built-in function callable>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, 'eval': <built-in function eval>, '__debug__': True, 'IndentationError': <type 'exceptions.IndentationError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'classmethod': <type 'classmethod'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'OverflowError': <type 'exceptions.OverflowError'>, 'WindowsError': <type 'exceptions.WindowsError'>}
__doc__ None
__file__ C:\Python27\lib\site-packages\PySFML\__init__.pyc
__name__ PySFML
__package__ None
__path__ ['C:\\Python27\\lib\\site-packages\\PySFML']
>>> from PySFML import sf
(hangs here)
 

I've just reinstalled a clean copy of python, and copied across a clean build of PySFML which i know has worked previously.

If you need any more info, just ask :)

Any help would be greatly appreciated!
I would be moving across to PySFML2-cython, however i'm on a bit of a tight schedule, and don't have the time to recode large parts of my helper libs.

Many thanks in advance, AClockWorkLemon

2
Graphics / Image load error reporting incorrect size
« on: February 13, 2012, 08:14:58 am »
Heya!

In an application i'm working on, on some hardware it is throwing an error when trying to load high resolution errors
Code: [Select]
Failed to create image, its internal size is too high (4096x4096)

I've already googled around, and know that this is to do with the graphics card is not powerful enough to load such a large image, however none of the images themselves are 4096x4096. The particular image i was testing on is one of the largest, and is ~3000x~2000.

I realise that this most likely has no effect on the actual error, however i was wondering if anyone would be able to explain the incorrect reporting of the image size.

If it is of any help, i am running PySFML 1.6, compiled from the latest Trunk revision in python 32 bit.

3
Graphics / 'Blobby' fonts
« on: December 08, 2011, 01:13:43 pm »
Heya, was wondering if you guys could help.

Project i'm working on has need of fonts, however most text rendered seems to be coming out a little.. 'blobby'. Not sure really how to put it, so here's a picture:



The font is Gotham-book
This is the "Text" class i'm using to handle fonts etc:

Code: [Select]

class Drawable(object):
def render(self, win, offset=Point(), camera=Point()):
self.SetPosition(self.x+offset.x-camera.x, self.y+offset.y-camera.y)
win.Draw(self)

class Text(sf.String, Drawable):
def __init__(self, text, font, size):
self.font = GetFont(font, size)
sf.String.__init__(self, text, self.font, size)
self.x = 0
self.y = 0

fontCache = {}
def GetFont(loc, size):
try:
fnt = fontCache[loc]
old_size = fnt.GetCharacterSize()
if size < old_size:
return fnt
except KeyError: pass
Font = sf.Font()
if not Font.LoadFromFile(loc, size):
return None
fontCache[loc] = Font
return Font


If you need more, please feel free to ask ^_^

thanks in advance :)

4
Python / [Solved] How to load sf.Images in a separate Thread/process?
« on: October 14, 2011, 08:05:00 am »
Heya!

I was hoping someone could outline how to load images in a separate thread/process with PySFML. I gave Thread a go, and found that it was blocking the PySFML thread. After searching around for a bit, i found Process, which didn't block the main thread at all. However, i have been unable to send the data of the loaded images to any other threads. (Python interpreter complains about being unable to pickle the Image)

If anyone could help sort out this issue, it'd be greatly appreciated!

5
Python / PySFML 1.6 Fixed build (windows)
« on: October 06, 2011, 02:40:35 am »
Heya all!
For all of you who have been having trouble with PySFML1.6 (both the crash on exit error and the missing SetSmooth functions), this is for you!

This build is built from the 1.6 SVN Trunk, using MinGW32. To use, just replace all the files in your site-packages/PySFML folder with the files in the package (it should be possible to just replace the .pyd, but i cant promise anything)

Download link (Mediafire)

6
Python / [ignore] pysfml2-cython build request / weird errors
« on: October 05, 2011, 04:16:36 pm »
Hiya people!

I was just in the hopes that someone could build/provide their binaries for PySFML2, Python2.7.

Please do not take this as me being lazy! I would compile myself, however i both lack  something to compile on (my main computer is getting repairs, this computer i don't wish to install compilers on), and confidence.

Thanks in advance!

Ninja edit
Or, if possible, a version of PySFML 1.6 without that stupid Image.SetSmooth issue. that'd be eppppiiccc :D

again, thanks in advance

EDIT
PLEASE IGNORE THIS THREAD! I've got it all sorted now :)

7
Graphics / [solved] Issue with blurring
« on: October 02, 2011, 06:06:50 am »
Heya, first post here so sorry if i make a few mistakes.
I'm pretty new to SFML, but things seem to me (mostly) working out as-so-far. That said, i've run into an issue with drawing sprites onto the screen. The sprite is being drawn in the correct position, however it would seem to be slightly blurred. I'm guessing that this has something to do with the fact sprites are positioned with floats, but i'm not sure.
Here's a comparison between the Source image and the Output (I've scaled them up a bit so it's easy to see)

SOURCE

OUTPUT


If it's of any help, this is the snippet of code which renders it. If you need more code, feel free to ask :3
Code: [Select]

def Render(self, App, pos=(0, 0)):
self.SetPosition(self.x+pos[0], self.y+pos[1])
App.Draw(self)

Pages: [1]