Search found 719 matches

by Gonzo
Dec 06, 2012 14:07
Forum: General
Topic: Need advice: cast(integer, float)
Replies: 21
Views: 2579

Re: Need advice: cast(integer, float)

xmm (sse2): cvttss2si 0x4(%esp), %eax ; truncation ret modern (x86 sse3): sub $0x4,%esp flds 0x8(%esp) ; can be removed if already in register fisttpl (%esp) mov (%esp),%eax add $0x4,%esp ret classic (x86 pre-2004): sub $0x8, %esp ; allocate stack space fnstcw 0x6(%esp) ; save floating-point control...
by Gonzo
Dec 05, 2012 21:52
Forum: Projects
Topic: Proper Chess Engine with networked CPUs & LAN play
Replies: 134
Views: 11459

Re: Proper Chess Engine with networked CPUs & LAN play

good luck finding programmers willing to do a momentous task for nothing i look on gamedev each day, and theres no shortage of artists looking for programmers to create their vision there's also no shortage on programmers wanting artists to visualize their vision and idea guys are a dime a dozen, al...
by Gonzo
Dec 05, 2012 21:18
Forum: General
Topic: Squares
Replies: 6841
Views: 393501

Re: Squares

it's good now =) still quite a bit of aliasing though, and as im sure you can imagine, you will take a huge performance hit with a big image in a small window because the bound tests aren't limiting to the bounding rect another small nitpick is timer() is double (and will make game deltatime jumpy w...
by Gonzo
Dec 05, 2012 14:58
Forum: Hardware Interfaces / Communication
Topic: Starting out with winsock
Replies: 10
Views: 3178

Re: Starting out with winsock

i know, i'm just not a big fan of spamming threads.. but it\s what everyone else does it''s annoying, and cheap programming, but for personal purposes its quite ok =) http://fbcraft.fwsnet.net/threads.jpg one example: tortoiseSVN which does absolutely nothing, has 30 threads in contrast, FBedit uses...
by Gonzo
Dec 05, 2012 9:17
Forum: Hardware Interfaces / Communication
Topic: Starting out with winsock
Replies: 10
Views: 3178

Re: Starting out with winsock

Yes socket select is the key. (of course on linux too) None blocking sockets are a bad idea. Joshy why? i'd say blocking is a bad idea for anything non-basic other than that the sockets could die at any time, for any reason, it's just way better design :) i wish they never made blocking sockets to ...
by Gonzo
Dec 05, 2012 8:46
Forum: General
Topic: Need advice: cast(integer, float)
Replies: 21
Views: 2579

Re: Need advice: cast(integer, float)

i'm not using int() in many places in my code, the problem is the rounding! one of many things that make me insane: (1.99) \ 2 should return 0, but returns 1 (huge debug fest) sometimes it matters, sometimes it matters not, but who expects their conversions to be rounded at all! (i'm not trying to d...
by Gonzo
Dec 05, 2012 1:47
Forum: General
Topic: Need advice: cast(integer, float)
Replies: 21
Views: 2579

Need advice: cast(integer, float)

In C you get the floor and fractional of a float or double (assuming it never is negative) in simple and fast ways: int integral = (int)fl; float fractional = fl - integral; how do you do this in freebasic? every time i work with numbers in freebasic i have to be extra careful to avoid rounding erro...
by Gonzo
Dec 04, 2012 23:54
Forum: General
Topic: Squares
Replies: 6841
Views: 393501

Re: Squares

Hi, going back to the image scaling problem there's something that I've realised, it might be really obvious but I hadn't thought much about it before. Bilinear and the bicubic that I was looking at have a problem, in the situation of doubling the image each pixel is divided in to 4 (2*2), with the...
by Gonzo
Dec 04, 2012 22:17
Forum: General
Topic: Squares
Replies: 6841
Views: 393501

Re: Squares

very nice, dafhi, you are writing better (and readable) code i can't give you full score, because the number #1 rule states: there's no better explanation given than code that explains itself use self-explanatory variable names, and you can avoid many comments (and instead document usage and pitfall...
by Gonzo
Dec 04, 2012 21:03
Forum: General
Topic: ?? Suspicious pointer assignment ??
Replies: 14
Views: 899

Re: ?? Suspicious pointer assignment ??

consistency is king =)
if it doesn't make sense, don't do it, even if qb says otherwise
at least, i wish that was the official mantra :(

obligatory mentioning of missing feature: sizeof(a())
by Gonzo
Dec 04, 2012 20:03
Forum: General
Topic: ?? Suspicious pointer assignment ??
Replies: 14
Views: 899

Re: ?? Suspicious pointer assignment ??

Because #PRINT TYPEOF(M-t) is an UINTEGER. A Pointer is just a UInteger value. If you're using operators on it, it seems to see it as UInteger and therefore returns an UInteger. So VAR makes 'a' an UInteger. that makes absolutely no sense, especially when the manual (ptrdiff_t) explicitly says it m...
by Gonzo
Dec 04, 2012 18:02
Forum: Community Discussion
Topic: Abstract/Virtual destructor/method behaviour
Replies: 229
Views: 36798

Re: Abstract/Virtual destructor/method behaviour

I agree.. i didn't understand the specifics but abstract has only one usage anyways An abstract super-class can also implement an interface without actually implementing it Thus children must implement that interface to work it can get quite complicated for the compiler.. is this supported? Note: in...
by Gonzo
Dec 04, 2012 17:41
Forum: General
Topic: ?? Suspicious pointer assignment ??
Replies: 14
Views: 899

Re: ?? Suspicious pointer assignment ??

crap :) dkl is right as explained here: ptrdiff_t <cstddef> Result of pointer subtraction This is the type returned by the subtraction operation between two pointers. This is a signed integral type, and as such can be casted to compatible fundamental data types. http://www.cplusplus.com/reference/cs...
by Gonzo
Dec 04, 2012 16:31
Forum: General
Topic: ?? Suspicious pointer assignment ??
Replies: 14
Views: 899

Re: ?? Suspicious pointer assignment ??

strange bug =) i can't see anything wrong since var is defined as a type implied from its initializer, there is no doubt that all the results must be integer ptr i still don't understand your preference for var, which creates ambigous code for human reading but that's another matter you can regret w...
by Gonzo
Dec 02, 2012 14:06
Forum: Projects
Topic: Procedural block world project
Replies: 310
Views: 73112

Re: Procedural block world project

Launcher: it's not made by me, but i've told the guy who makes it that it crashes on first start the world size is unfortunately not changeable, simply because it's impossible to generate this kind of world in one-shots it can't be done realtime, so it needs to be generated in passes.. in the future...

Go to advanced search