Search found 59 matches

by Johan_Haegg
Wed Jun 15, 2005 11:39 pm
Forum: Tricks 'n' Tips
Topic: computer speed independent programming
Replies: 50
Views: 16482

One thing i have found during my work with PureBasic and OpenGL (while writing 64kb intros) is that the ordinary way to use delay does not work.
One way is to use StartProgramCounter-CurrentCounter to get the time elapsed. This is however sometimes a pain, so i started using SetTimer_() to get a ...
by Johan_Haegg
Wed Jun 15, 2005 11:18 pm
Forum: Tricks 'n' Tips
Topic: Su Doku Solver
Replies: 2
Views: 2118

Su Doku Solver

Code updated For 5.20+

So, here is yet another game the computer beats us in.
Wrote this piece of code while working on a su doku generator/game.
I just had to write it when i came up with the idea to use OR to check
wich numbers could not be used.
Will probably release the finished product here ...
by Johan_Haegg
Sat Jun 19, 2004 11:33 pm
Forum: Coding Questions
Topic: Making a patcher
Replies: 6
Views: 1970

well, a basic filechange patcher would only be able to patch a file of a specific version, and if there are any deleted stuff it would go nuts and build a huge database. Well, a patch-datafile could look something like this:

Position.l, BytesToPatch.l, Data(BytesToPatch.l).b

To create a patchfile ...
by Johan_Haegg
Sat Jun 19, 2004 11:20 pm
Forum: Coding Questions
Topic: Scan for ip
Replies: 5
Views: 1893

Well, you will have to go through a lot of problem with WinPCAP if you just want to listen to all data transmitted over the network and then check for something specific for that program. You could just try to connect to every host on a port.
Here is an probably old and buggy version of a network ...
by Johan_Haegg
Sun Jun 13, 2004 3:58 pm
Forum: Game Programming
Topic: Acceptable game sizes
Replies: 28
Views: 7593

I use BMP while developing and then convert to PNG/JPEG when its time to publish.
It IS possible to use large OGG-files, however you need to encode them with the original OGG-Vorbis encoder and with a few special parameters. I have only got it to work with 22.05kHz however.
The problem seems to be ...
by Johan_Haegg
Wed Apr 28, 2004 10:55 am
Forum: Game Programming
Topic: Sprite To Image
Replies: 3
Views: 2307

Works like a charm and is faster than the not working method i used before. THANKS!
by Johan_Haegg
Tue Apr 27, 2004 5:45 pm
Forum: Game Programming
Topic: Sprite To Image
Replies: 3
Views: 2307

Sprite To Image

Is there any way to convert a sprite to an image?
Trying to create an AVI on the fly with AVIServ, but when not using SaveSprite & LoadImage (slow) it wont work...
Tried ImageOutput() and some other things, but nothing works!
[EDIT]
I am trying to save what is seen onscreen and i use GrabSprite to ...
by Johan_Haegg
Sun Mar 28, 2004 6:01 pm
Forum: Coding Questions
Topic: Write to a pipe not working?
Replies: 0
Views: 1089

Write to a pipe not working?

Well, not at the same time as networking...

Any idea?


; Redirect Outputs into Memory
; coded by Siegfried Rings march 2002
; redirected the pipes
; Modified by Johan Hägg March 2004
; BUG: Wont work with network =/
;
;see <http://support.microsoft.com/default.aspx?scid=kb;EN-US;q173085 ...
by Johan_Haegg
Sat Mar 06, 2004 12:41 am
Forum: Windows
Topic: CDROM Spinup problems
Replies: 2
Views: 1901

Thanks for pointing me in the right direction...
This code will NOT screw up the CDROM


mciOpenParms.MCI_OPEN_PARMS
mciStatus.MCI_STATUS_PARMS
a.s = "cdaudio"
mciOpenParms\lpstrDeviceType = @a.s
dwReturn = mciSendCommand_(0, #MCI_OPEN, #MCI_OPEN_TYPE, mciOpenParms)
wDeviceID = mciOpenParms ...
by Johan_Haegg
Fri Mar 05, 2004 10:26 pm
Forum: Windows
Topic: CDROM Spinup problems
Replies: 2
Views: 1901

CDROM Spinup problems

Windows 2000, writeing a program that will sense if there is a CDROM in a specific drive and then try to read a file from it. For detection i use this code:

Procedure WaitForCD()
Debug "WaitForInsert"
If CDAudioStatus() = -1
Repeat
CheckQ()
Delay(300)
Until CDAudioStatus() = 0
EndIf ...
by Johan_Haegg
Fri Feb 27, 2004 1:42 pm
Forum: Tricks 'n' Tips
Topic: Create terrains and textures for the CreateTerrain()function
Replies: 12
Views: 6339

Heightmap: 257x257x8bit (WinXP says 32bit)
http://www.wavelsoftware.com/pic2pic.htm <- converts nicely
Texture: 1024x1024 works good
CreateTerrain("Terrain\" + Terrain.s + ".png", MaterialID(LastMaterial()), 4, 0.6, 4, Screen\Precision) ;with this code, not directly in the demo however.
by Johan_Haegg
Fri Jan 02, 2004 10:41 am
Forum: Coding Questions
Topic: FTP access
Replies: 15
Views: 7849

Hm, i dont personaly like the FTPClient part of InternetExplorer, and i guess it uses that API :>

When developing client/server applications for existing protocols, please consult RFC

http://www.rfc-editor.org/

And its more fun to write your own without those APIs ;)
by Johan_Haegg
Thu Dec 18, 2003 12:14 am
Forum: Linux
Topic: Porting from Windows to Linux
Replies: 4
Views: 3251

Ill try that, as long as they do the same thing i dont have to rewrite loads and loads of code :>
by Johan_Haegg
Tue Dec 09, 2003 11:06 pm
Forum: Announcement
Topic: PureBasic 3.81 Released
Replies: 33
Views: 15340

YES! Cant wait to get my hands on the Linux version...
Fred is teh leet ;)