|
Lack of updates Posted by Steve on Thu 13 Jul 2006 08:37pm You might have noticed that this site isn't updated very often. I still check it at least once a day however, and I do have more articles I'm in the process of (very slowly) writing. Working/travelling 60 hour weeks doesn't leave me much free time.
I maintain a far more active blog on GameDev.Net, so feel free to go and read that if you want.
|
User-Agent stuff Posted by Steve on Wed 28 Jun 2006 08:08pm Since I've had a few spammers on my website spamming random links in replies in my blog, I've blocked the user-agent string "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)". If you try to post anonymously using that user-agent, you'll get an error messge.
HOORAY!
|
Damn it, Messenger Plus... Posted by Steve on Wed 15 Feb 2006 04:19pm Well, I found the reason for CreateWindow() screwing up. After I'd uninstalled Visual Studio, of course. Messenger Plus had an update recently, and it seems that one of the things in the update involves hooking calls to CreateWindow. When I run my apps through the debugger, it tries to load symbols from MessengerPlus.dll (or whatever the DLL was), and for some reason freezes for 5 seconds. So, I've uninstalled Messenger Plus for now.
I installed Visual Studio 2005 Express and the platform SDK, along with the latest DirectX SDK (February 2006 - Hooray for 3 day old SDKs :)), and then spent an hour or so converting some of my projects, and getting rid of all the new errors and warnings.
I've been doing a bit more programming on TEH MMORPG!!1 lately. It now has a nice splash screen at startup, with 3 splashes that get faded into/out of (With background texture loading and stuff so I don't hump my memory), and a login screen, which I'm working on as we speak. I was also thinking of making a FudgePacker UI, a bit like WinZip. Although the Windows console version "works", it doesn't give access to all the features; for instance you can't update a pack, or compress some files with one compression type, and some with another. I'll probably get around to making a FudgePacker UI at some point, I might do that on my laptop at work, which would make a nice lunch break project.
So, my intended features list (Well, some at least):
- Drag and drop files into the window to add them to the pack. Ask for compression type when they're added, and give the option to "Apply to all dropped files"
- Change the compression for each file in the pack
- Optional encryption
- "Time Decompression" option to allow a user to get a rough idea of access times (May be important for frequently accessed data, and will allow the user to decide e.g. between zlib (best) and zlib (fast)
- Drag and drop onto the .exe to open a pack or create a new one (if files are dropped)
That's all for now, but I'm sure I'll think of more stuff later on.
Another thing I've been toying with the idea of is getting Windows XP 64. I'd quite like to be able to create 64-bit programs (And run them, obviously). But I think I'll wait for XP64 to become a bit more stable. I've heard nothing but horror stories of it at work, such as it crashing and there being hardly any software support. Then again, I might just wait for Vista.
|
Network Printers are fun Posted by Steve on Thu 9 Feb 2006 07:07pm Well, it's been a while since an update, and I got a new toy today, so I may as well post. PC World has an HP Photosmart 2575 for £109.99 at the moment. It's a printer, scanner and copier, and it's network ready. £110 for a network ready printer scanner copier is pretty damn good. It took about 15 minutes to set up, including time for the print heads to align properly, and to install the software, and it works like a charm.
I tested it by printing a text document, and it just flew through it. Then I tried copying a photo. Under a minute, and the copy looked almost exactly like the original. The only difference was that the copy was slightly brighter. Easy enough to fix I reckon (Although I haven't tried). I also tried printing a sample image I have on my hard drive, and it printed perfectly. Here's the image (scaled to 33%):

Anyway, this printer gets a big thumbs up from me.
In other news... My copy of Visual Studio is playing up. Any call to CreateWindow(), direct or indirect (Such as in a call to MessageBox()), while in the debugger causes the debugger to pause for 5 seconds. It only happens if I have a breakpoint set in my program (so the debugger is active), and it only happens the first time I call the function. I'm going to install Visual Studio 2005 Express, which I downloaded last night, along with The Windows Server 2003 SP1 Platform SDK - April 2005 Edition and see if that helps. It works fine on my laptop for some reason.
I've also been rewriting my socket code (again) to use windows async sockets. It seems pretty nice, and since I have a hidden message-only window, my normal message pump deals with the socket messages. I'll probably be using these sockets in TEH MMORPG!!1, and I'm writing a very quick and dirty MUD, just as a framework for some code I can drop into TEH MMORPG!!1 (For instance; my socket class and database class).
Right, time to get some really serious drinking done, then head out to a club...
|
Funky Posted by Steve on Tue 17 Jan 2006 08:06pm Oh won't you take me down
To funky town
*dances*
In other news, I "finished" TEH MMORPG!!1's editor. You can now place and link portals together. Now I just need to do the game. I'm currently only working on it during my lunch breaks, which means I do about 45 minutes work on it each weekday (30 min lunch break at the weekends means I don't have time to code).
I'm playing Guild Wars too much the rest of the time, or I'll be working on The Magus Order Guild Site (Nothing much there at the moment, check the Forums).
Anyway, time for me to go and put my grandmother's bin out, and get my day's Guild Wars fix...
|
Woo, lappy Posted by Steve on Sat 17 Dec 2005 09:42pm Well, I decided to "invest" in a laptop. So, I got an Advent 7082 (Advent is PC World's own brand). It's a Sempron 2800, 512MB RAM, 40GB HDD, Wireless enabled, and ATI X200M graphics. Nothing too fancy, but for £450, it's not too bad at all. So, I'm setting it up so I can do coding on it, as well as MSN etc etc. Just your basic stuff.
I also tidied up my Lua binding code for TEH MMORPG!!1. It relies on horrible casting of function pointers and suchlike, but it looks far nicer. Basically, the only change is how the callback functions look. The function in my last post (see below) now looks like this:
1 int Omg(CStack theStack)
2 {
3 int nArgs = theStack.GetNumArgs();
4 int n = theStack.GetNumber(1);
5 theStack.PushString("I enjoy pies");
6 return 1;
7 }
Much nicer. Nice and oop-y. And a CStack class is just a lua_State*, and since there's no constructor or destructor, C++ doesn't try to do anything fancy to it.
Anyway, I'm away to carry on installing stuff on my lappy.
|
Everyone loves ugly wrapping code Posted by Steve on Wed 14 Dec 2005 04:44pm I added a bit more in the way of scripting support to TEH MMORPG!!1, so you can now call C functions from Lua. But to keep things portable, I needed to wrap all the lua functions up.
So, my script looks like this:
1 function Test(x, y)
2 z = Omg(x*2+y);
3 return z .. " lawl";
4 end
And my Omg() function (defined in C) looks like this:
1 int Omg(void* pState)
2 {
3 int nArgs = CScriptMgr::Get().CFGetNumArgs(pState);
4 int n = CScriptMgr::Get().CFGetNumber(pState,1);
5 CScriptMgr::Get().CFPushString(pState,"I enjoy pies");
6 return 1;
7 }
And my test code looks like this:
1 CScriptMgr::Get().Init();
2 CScriptMgr::Get().LoadScript("Data/Scripts/Test.txt");
3 CScriptMgr::Get().Compile();
4 CScriptMgr::Get().RegisterFunction("Omg",Omg);
5
6 CScriptMgr::Get().SetFunction("Test");
7 CScriptMgr::Get().AddParameter(11);
8 CScriptMgr::Get().AddParameter(13);
9 CScriptMgr::Get().Execute();
10 const char* sz = CScriptMgr::Get().GetString();
But it all works perfectly, at the end of all that, the sz variable contains "I enjoy pies lawl". It may be basic, but it'll be easy to build on. I can't be bothered doing any more at the moment, and it's freezing in here.
I got paid on Thursday, hooray. I'm working 40 hours a week until mid-January, so in about 4 weeks I'll get paid again. That'll allow me to work out if I can move out on 24 hours a week (What I'm contracted for at the moment), and/or the minimum hours I can work that will enable me to move out. Ideally, I'd like to do 30 - 40 hours a week, ober 4 or 5 days (preferably 4). That would give me enough cash to move out, and enough free time to enjoy myself. In theory.
In other news, I got to Abbadon's Mouth in Guild Wars. Yay me.
|
MMORPG stuffness Posted by Steve on Mon 5 Dec 2005 01:12am Well, I decided to do a little bit of work to TEH MMORPG!!1 today. It now has Lua scripting support. Yay!
Example usage:
1 CScriptMgr::Get().Init();
2 CScriptMgr::Get().LoadScript("Data/Scripts/Test.txt");
3 CScriptMgr::Get().Compile();
4 CScriptMgr::Get().SetFunction("Test");
5 CScriptMgr::Get().AddParameter(11);
6 CScriptMgr::Get().AddParameter(13);
7 CScriptMgr::Get().Execute();
8 const char* sz = CScriptMgr::Get().GetString();
I suppose it could be a bit neater, but this will do fine for now. I still need to get portals sorted in the editor, so I can get to work on transitions between maps and collision detection.
I'm also going to have to slightly modify my site code, so that news / blog items are displayed on several pages, not just one. Otherwise things will get silly. It'll only take a few minutes to do, I just can't be bothered at the moment.
Anyway, I'm working tomorrow morning, and it's 1am, so I'm off to bed.
|
Zomg, site updates Posted by Steve on Wed 30 Nov 2005 11:02pm Well, I made some minor updates to the site. The Image Of The Day and articles now track the number of views, just for something to do. I also slightly adjusted the site stats, so it ignores the www. prefix to URLs in referers. The end result is that if someone comes to my site from rav.efbnet.com or www.rav.efbnet.com, it shows up as from the same place, not two seperate sites as it used to. That might not work as expected on some sites, but it's a fix for the vast majority of sites.
I updated my J2ME "game" slightly, I can now play sound effects, and move a 24-bit PNG image around the screen nicely. Many thanks again to Kim Daniel Arthur for his GameDev.Net article. The sound code came from one of the J2ME SDK samples, slightly modified. And here it is:
1 private void playSound()
2 {
3 try
4 {
5 // Create the player if it doesn't exist
6 if(wavPlayer == null)
7 {
8
9 InputStream is = getClass().getResourceAsStream("/sound.wav");
10 wavPlayer = Manager.createPlayer(is,"audio/x-wav");
11 }
12 wavPlayer.start();
13 }
14 catch(Exception ex)
15 {
16 // Cleanup the player on error
17 if(wavPlayer != null)
18 {
19 wavPlayer.close();
20 wavPlayer = null;
21 }
22 }
23 }
Wow, exciting.
I did manage to see VNV Nation last Thursday, I arrived there at about 10:30, getting changed in the car en-route. And I had about 5 minutes (time to down a couple of pints) before VNV Nation came on. It was awesome. And they played Beloved, which was a plesant surprise, and they finished on Electronaut (Hooray!). I can't actually remember what else they played, aside from Chrome and Procession. No doubt you'll be able to google some results in a week or two, but there's none sourced just now.
I'm off work tomorrow (Yay), and I've requested Sunday off to go hill wandering and also to go out and about on Saturday night, but I'm not sure if I'll get it off. It's been hectic at the moment, with Sky doing their Computers @ Home vouchers, and people comming in buying PCs and laptops for christmas. Nothing particularly exciting to report, however.
Well, that's enough of a ramble for me. I'm going to bed.
|
Woo, J2ME Posted by Steve on Thu 24 Nov 2005 12:48am I decided to have another look at writing Java apps for my phone today. I tried before, but I couldn't find a way to get the Java apps from my PC to the phone. I had a look at my manual, and it said "Go to Settings -> Java Settings -> Java App Loader". But it wasn't there. I had a look on Motorola's website, and found that Motorola phones have it disabled for all except Developer phones. After signing up to 3 random sites, I got a bunch of programs that let me poke around in the phones memory, and enable the app loader that way.
Then I followed the GameDev.Net article on J2ME, and tinkered around with it, renaming it and using a custom icon.
So, to cut a long story short, my phone now has a game called "Rape Time" that lets you move a little sprite around the screen. Hooray. Well, it's not much, but it's a start. I'm sure I'll have Doom 3 on it tomorrow.
Also, it looks like I'm not going to be seeing VNV Nation. I went in to work today to try and change my shifts, and was told "I'm sorry, but it's not my fault that you got the dates wrong. Unless you can find someone to cover your shift, you'll have to come in". So I asked around with no success, and asked again today (There was one person who might have been able to do it). Still no joy.
So, I'm going to try and beg tomorrow, and see if I can get away at 9 instead of 10. In either case, my friend is going to text me to say when VNV Nation are on. The doors are at 8:30, so I guestimate that the support band will be on at 9:00, and VNV Nation around 10:00. My mother has offered to give me a lift there from work, so I might be able to make it in 30 mins, and get there for 10:30. My friend is going to see if there's tickets availiable at the door, and if so, grab me one hopefully.
Anyway, I might still manage (just)...
|
Whee, 14.5 hour shifts Posted by Steve on Mon 21 Nov 2005 11:39pm Well, I volunteered for staying on to help with an audit after my 9 hour shift on Sunday, so we got free pizza and coke. Yay! And then after 4 cans of coke I was bouncing off the walls. Anyway, we finished at 00:30 ish, 14 and a half hours later.
I got my TV card set up, and it works great. And it's awesome with dual monitors for obvious reasons. I also bought some Creative 5.1 surround sound speakers for £22, since they were ex-display, some of the speaker stands were missing, and my manager wanted rid of them. Awesome.
I'm off tomorrow and Wednesday, but I (still) need to go and get a copy of my locker key cut, and I need to go and get a bus pass. Also, I'm going to see VNV Nation on Thursday, but I thought it was on Tuesday. So I'm supposed to be working till 10pm on Thursday, but the gig starts at 8:30. So I'm going to have to go in and beg about getting away early or changing my shift or something.
A random thing I found out at work today: MS Office is £370 for the standard version at PC World. MS Works 8 is £110 or something. Instead of buying the standard version of office, you can buy MS Works 8 and the office upgrade, and it saves you around £100. Which is nice.
|
Update time Posted by Steve on Wed 16 Nov 2005 09:34pm Ok, I haven't had time to do much. At all. I've been working a fair bit at PC World. It's pretty good, although I kinda feel like I've been thrown in at the deep end. Although I guess that's a good way to learn stuff.
I get 10% staff discount, after 3 months, but PC World sells a TV card with freeview tuner for £40 at the moment, which seems pretty good to me. So I went and bought that, and there's a guy comming tomorrow to fix our ariels, since the signal is crap because the wiring is crap.
My dad got his PC back from Mesh. For the 8th time, but this time not only did they not fix the problem, they also charged him for picking the PC up and returning it. This time, the PC boots up and although the HDD is disabled in the BIOS, it tries to boot from it, and then complains that there's a missing system file. So my plan is to take all the components except the PSU, mobo and CPU and put them into my spare system (the CPU is an AMD64 and I don't have a AMD64 mobo). I don't know if the RAM will work in my mobo, I'll try it if it does.
If the PC works fine for a month or so, then I know that the mobo, CPU or PSU are at fault. I don't know if it's some peripheral that my dad's using that has dodgey drivers or something, or if Mesh are just useless. They say they've replaced every component, but I'm not sure if they have. Anyway, we'll find out on Saturday.
I fixed a minor bug on my site; it was sometimes displaying a bit funny in firefox. It turns out that my code blocks were at fault. I originally made them a fixed height, but then changed it so they're as tall as they need to be, and I forgot to remove the "overflow" CSS value (It was set to "auto" I think), which Firefox didn't seem to like very much. I also updated my stats page slightly, so I now log the page on my site that the person arrived at from the referer, and a full link for the referer (So google and other search engine links work). I still want to log the number of views of an article or image, but I should really do some sort of simple session managment for that to stop people refreshing a lot from screwing up the results. But that can wait. As can adding some more articles (I have a list of about 10 articles I'd like to add).
Also, I haven't had time to do much MVP stuff. A lot of the conferences and things are at 6pm, and I don't usually get in till 7pm or so thanks to rush hour traffic. I should really cycle to work...
Anyway, I've been working this week Sunday, Tuesday, Wednesday (today) and I will be working tomorrow and Friday, off Saturday, then in Sunday, probably at 6am. Yay.
So, in my one day off I have to:
- Go up Arthur's Seat with friends (A hill for you cretins)
- Clean out my fish, since it's getting almost impossible to see
- Fix my dads PC
- Install my new TV card
- Do some work on a site I'm doing for a friend (I think I mentioned it before)
And then I have to get some sleep, since I'll probably be up at 5am, no doubt when my sister and however many people she brings with her are getting in from The Mission. Oh yay.
Right. Bed.
|
I hate aptitude tests Posted by Steve on Wed 2 Nov 2005 09:36pm Well, ok - they're all right. Unless they're timed.
I had an aptitude test at PC world today. 26 questions in 30 minutes. And the questions were things like:
Quote: Since Cannon have introduced a money-back guarantee on their X-2341 camera, there have been no returns of the X-2341. What can be implied by the above statement:
- Most customers buy Cannon cameras
- Most customers return their cameras
- Cannon customers are happy
| Ok, that's a bad example, but they're those sort of questions.
Then there were the mathy ones, like there's 5 employees and a list of how many units of 5 types of printer they sold, and how much commision (%) an employee gets for each type of printer, and you're to say how much money Tom made in commission, and who made the most commission on printer A and B combined and other questions like that.
Overall, it wasn't that bad. But I have a habbit of looking at a question for a minute, then re-reading it, then answering it. Which you can't do with a little over a minute for each question...
In other news, my dad's been on at me to buy a suit. I need to get one before my next interview with Computer People. Although they were supposed to phone me back yesterday, and they haven't yet. I don't particularly want this job though, the interview was runnish.
- They sent me the address by E-mail. I arrived only to be told that they moved last year (from Castle Terrace to george street)
- I need to get a suit for the next interview
- I need to wear a suit to work
- On my CV, I have a list of completed software projects like a Bomberman clone, etc. I also have under my work experience a bit saying I did contract work as a PC Administrator for the Dixons group. The interviewer thought that all those "completed software projects" were contract work for my employer. What on earth would the Dixons group want with a bomberman clone?
- I was told that I can change from IT support to software development in the company. I can, but only after 5 years...
- It's in livingston apparently - an hours travel each way at least. Joy.
I really need to get a suit anyway, it's handy to have, and I'll need one no doubt.
Also, on my main page (Where you might be reading this from), for some reason the center bit of the page expands to twice its width, causing the IOTD and articles bit to be off the page. Refreshing seems to help sometimes. I've no idea why this happens though...
Anyway. My pizza is done...
|
Jack Thompson is an idiot Posted by Steve on Thu 27 Oct 2005 04:28am Just felt I should share this. It's in my random Quote Of The Day, but still:
"You know there are sociopaths everywhere; some of them are in government. Some of them are at Take-two. In fact, we got a bunch of sociopaths in Edinborough (sic), Scotland sitting around in kilts sipping their single malt whiskey spreading racial - hurtful - stereotypes in this country" -- Jack Thompson
ROFL.
And if you don't know who Jack Thompson is, there's a Wikipedia article or an Unencyclopedia article about him. Personally I prefer the Unencyclopedia version. It's far more entertaining. He's the lawyer who tried to say that GTA was a training game for terrorists (Or something along those lines). And last I heard, he was being investigated by the Florida bar. Awesome.
Here's some random facts from the unencyclopedia article, linked above:
- Thompson is fluent in Bullsh*t and has a Black Belt in Dumbf*ckery.
- Jack was awarded the "Best email grammar award of 2005" by prestigious MMORPG veteran 'n00braypor1337'
- Jack Thompson's internal organs are composed of 50% himself and 50% bovine excrement.
- Jack Thompson has died 17 times. Some of his deaths have been at the hands of famous people such as John Wilkes Booth, Wolverine, and Sephiroth. Jack Thompson was also raped and murdered by Pac-Man as a child.
- It is illegal to make fun of Jack Thompson. While constitutionally protected in the United States, parody, mockery, and satire of Jack Thompson is a felony in the independent nation of Thompsonia, a landlocked country solely contained within the confines of Jack Thompson's cranium.
- Jack makes it a point to use "Or Else" 684 times an hour. Also see Give me a Big Mac Or Else!
- Jack Thompson's Penis is non Existent. The story is said to have originated from Ethiopian mythology.
- Jack is also referred to as "Jackie-Boy" "Whacko-Jacko" and "The Grand Fuhrer of Richard Simmonsism"
- Jack Thompson is a SOLDIER of God.
- After word arose that Ultra Jesus needed a new fifth pilot, Jack Thompson applied for the role. However, he was turned down for "Being a tw*t."
Quote: Over the course of Jack Thompson's career, he has had a lot of sex with lots of animals, such as horses, cats, roosters, and lambs. Jack Thompson has also had intercourse with inanimate objects, such as trees, desks, and was raped by his Atari machine. Jack Thompson enjoys being a hypocrit and a dumbass who is uneducated and immature. American soldiers have attempted to destroy Jack Thompson. |
|
Yay, real programming on a website (Maybe) Posted by Steve on Thu 27 Oct 2005 02:05am The guy I've been making this site for (Well, one of them, there's apparently three; I really need to find out who's who...) asked if I'd be able to make a user control pannel to start/stop game servers. I said that I'd try, but I've not done this kind of thing before. So... I'm really not sure how to do this. I'll post on GameDev.Net tomorrow (when I'm sober :P) asking if anyone has done this sort of thing before, and has any pointers. AndrewRussell from TA suggested that I could use PHP's exec command to start the servers, and that I could "kill the processes" to stop the servers. That seems ugly as hell to stop them, but starting is fine. Most servers I've played on have a warning saying "The server will be shutting down in x minutes", which is what I'd like, since it's nicer for all concerned.
I was thinking that I could write some custom software that would communicate with the game server, and provide me with a standard PHP interface (via sockets probably). However, I'd probably be just as well (Actually, better) moving the server management code into PHP.
Again, from TA; apparently UT2k4's server has an HTTP admin port, so I can use that and submit HTTP requests to it to manage it. But I don't know about other games, like Halo.
Anyway, I'm gibbering. I'll find a way to do it, and it'll be really neat. Damnit.
And, I need to write a quick PHP script and phpbb mod so when I post in this forum, it submits a journal entry for me on GameDev.Net
|
Stuff and things Posted by Steve on Wed 26 Oct 2005 12:40am I added an article to the site, just as a placeholder really. I also now log referers on my stats page, so I can see who's linking to me.
I finished The Magus Order's IOTD mod, and started on this site that I'm getting paid for. It's a clone of Klan Wars, more or less. Anyway, that should keep me entertained for a while.
|
Yay! New site done! Posted by Steve on Sun 23 Oct 2005 11:22pm So, I've finally completed the new site. It's all nice an PHP-ified, and has a sexy little admin pannel for me to change pretty much everything.
The whole thing took around a week and a half to complete, from concept to completion.
So, let's list some features:
- News items are read from my phpbb forums, and the bbcode is all nicely parsed. In fact, the code tags are nicer than phpbb's :P
- Images Of The Day can be submitted by anyone, and I get an E-mail alert sent to me when one is submitted. I can approve or reject it from my admin pannel, and an auto response is sent to whoever uploaded the image, telling them if it was accepted or rejected.
- IOTD images are auto-thumbnailed and cached as needed. So I don't need to faff around resizing images manually.
- Projects can be added, removed or edited from my admin control pannel, and I can upload screenshots and data files. Again, all the images are auto-resized.
- Articles can be uploaded and updated from the admin pannel. Articles are stored as text files on my server, and are copy and pasted into the HTML document when viewed. The submission date is just the creation time of the file.
- Downloads are logged, so I can see how many times a file has been downloaded, and what bandwidth it cost me.
- I can modify the site configuration (currently just the address of it and the administrator e-mail address) from the admin pannel
That'll do for now. I'm sure there's other features that I'm missing out, but I'll mention them some other time if I remember what they are.
Lets have a look at my sexy code tags then:
1 bool COGGLoopStream::FillBuffer(BYTE* pBuffer, DWORD dwLength)
2 {
3 DWORD dwRemain = dwLength;
4 long lRet;
5 bool bEOF=false;
6
7 // Any data in the buffer already? //
8 if(m_dwBufferSize != 0)
9 {
10 DWORD dwCopyLen = min(dwRemain,
11 (m_dwBufferSize-m_dwBufferPos));
12 memcpy(pBuffer,m_byBuffer+m_dwBufferPos,dwCopyLen);
13 dwRemain -= dwCopyLen;
14 pBuffer += dwCopyLen;
15 }
16 m_dwBufferSize = 0;
17
18 // Read from the file into out buffer //
19 while(!bEOF)
20 {
21 // Read a 4k chunk //
22 lRet = ov_read(GetFile(),(char*)m_byBuffer,4096,0,2,1,NULL);
23 if(lRet == 0)
24 {
25 // If we're still reading the intro, swap to loop //
26 if(m_bPlayingIntro)
27 m_bPlayingIntro = false;
28
29 // Otherwise, go back to the start of the loop //
30 else
31 ov_raw_seek(&m_fileLoop,0);
32 }
33
34 // We read data OK //
35 else if(lRet > 0)
36 {
37 if((DWORD)lRet > dwRemain)
38 {
39 m_dwBufferSize = (DWORD)lRet;
40 m_dwBufferPos = dwRemain;
41 memcpy(pBuffer,m_byBuffer,dwRemain);
42 dwRemain = 0;
43 break;
44 }
45 else
46 {
47 memcpy(pBuffer,m_byBuffer,lRet);
48 dwRemain -= lRet;
49 pBuffer += lRet;
50 }
51 }
52
53 // Error //
54 else
55 return false;
56 }
57
58 // There shouldn't be any data left to fill //
59 assert(dwRemain == 0);
60 return true;
61 }
Repeat after me: "Ooh, ahh, that's nice". Yeah, I know it is.
Well, I'm off to play with The Magus Order website. I have to port my IOTD code and grapple with the phpbb source code to make an IOTD forum for it. Well, try to anyway.
|
|
|