• What are you working on?
    1,001 replies, posted
I'm working on a syncing utility and a little script which creates a shortcut on the desktop when my external hard drive is plugged in (where the external HDD is hosting the script), both which are written in batch. I was somewhat disappointed at WD's syncing utility, so I formatted the drive and I am writing my own, so far it's 367 lines, about 1/3 of the way in. Thank god for %~d0. Here's some source for the shortcut script, it uses hstart to not have an ugly console window show up, shortcut.exe to generate a shortcut based on the drive letter (so it works on any computer that allows autoplay), and rfshdktp.dll to refresh the desktop after the shortcut was deleted, as it keeps a "ghost" link which can't be deleted or used, but it goes away on refresh, so... :v: The initial script, hosted on the drive: [cpp]@echo off cls "%~d0\autorun\shortcut" /f:"%USERPROFILE%\Desktop\EVERYTHING.lnk" /a:c /t:"%~d0" %~d0 cd autorun if not exist "C:\everything_auto" md C:\everything_auto robocopy everything_auto C:\everything_auto hstart /nowindow "C:\everything_auto\detect.bat" %~d0 exit [/cpp] That copies over a directory with another script, to remove the shortcut and refresh the desktop when the drive is ejected. (For some reason it doesn't delete the shortcut, I will have that fixed soon) [cpp]@echo off cls :loop IF NOT EXIST %1 GOTO cont goto loop :cont del "%userprofile\desktop\everything.lnk" C: cd everything_auto rundll32 rfshdktp,refreshDesktop rd "C:\everything_auto" /s /q exit[/cpp] Edit: Oh wait, stupid mistake. The reason this doesn't work perfectly is because I missed the second % after userprofile in the second script :buddy:
Got rotation working. Here's a screen.. [IMG]http://i28.tinypic.com/mc97cj.png[/IMG] For anyone who needs to rotate something.. [cpp] void RotatePoint( int x, int y, int cx, int cy, int angle, int* tx, int* ty ) { double s = sin( D3DXToRadian( angle ) ); double c = cos( D3DXToRadian( angle ) ); *tx = cx + ( c * ( x - cx ) - s * ( y - cy ) ); *ty = cy + ( s * ( x - cx ) + c * ( y - cy ) ); } [/cpp]
Started on a gui system. [img]http://img33.imageshack.us/img33/1914/sidebary.png[/img]
[QUOTE=VoiDeD;16049499]If you want Botch to become the next Halo PC. This is one of the major reasons I don't want to implement networking into my current engine, the network compensation that the source engine does is beautifully choreographed and incredibly complex. Making my own version of that would be a major hassle.[/QUOTE] It really isn't complex at all. When it receives a client packet it moves everything back to where it was when the client sent the packet, runs that packet, then moves everything back.
[QUOTE=jmanmc;16051112]Started on a gui system. [img]http://img33.imageshack.us/img33/1914/sidebary.png[/img][/QUOTE] heh, that's pretty slick.
[QUOTE=Nevec;16050692]Got rotation working. Here's a screen.. [IMG]http://i28.tinypic.com/mc97cj.png[/IMG] For anyone who needs to rotate something.. [cpp] void RotatePoint( int x, int y, int cx, int cy, int angle, int* tx, int* ty ) { double s = sin( D3DXToRadian( angle ) ); double c = cos( D3DXToRadian( angle ) ); *tx = cx + ( c * ( x - cx ) - s * ( y - cy ) ); *ty = cy + ( s * ( x - cx ) + c * ( y - cy ) ); } [/cpp][/QUOTE] Couldn't you just transform it with the rotation matrix? Also, how do you print the debug text on top of the rendering? Might come in use for me. ^^
I'm using the pretransformed fvf which apparently is the only combination that actually renders.. and matrices don't apply to that format. For the debug text, I'm just drawing it after everything else. [url=http://msdn.microsoft.com/en-us/library/bb173961%28VS.85%29.aspx]ID3DXFont[/url] has everything you need.
I've got an approach which works with local coordinates. [cpp]b2Vec2 physics::transformVertex( b2Vec2 locals, float angle ) { float localangle = atan2( locals.y, locals.x ); float tangle = localangle + angle; float dist = sqrtf( locals.x * locals.x + locals.y * locals.y ); return b2Vec2( cosf( tangle ) * dist, sinf( tangle ) * dist ); }[/cpp] Also, here's the code you're gonna need for drawing circles: [cpp]void render::circleVertices( float x, float y, float radius, int segments, D3DCOLOR col, vertex circle[], float offsetAngle ) { float degPerSegment = 360.0f / (float)segments; float deg; for ( int i = 0; i < segments; i++ ) { deg = degPerSegment * i; circle[i].x = x + cos( (float)( deg * 3.1415926f / 180 + offsetAngle ) ) * radius; circle[i].y = y + sin( (float)( deg * 3.1415926f / 180 + offsetAngle ) ) * radius; circle[i].color = col; } }[/cpp]
Use 3.1415926f instead of 3.1415926, else it'll case into double although you clearly just need/use float-precision.
Yay, my window class is finished. I used the Derma window design as an example design, I'll make my own soon. The windows are draggable and closeable [img]http://i89.photobucket.com/albums/k237/dryer-lint/3.gif[/img]. Now I can start working on the controls. [img]http://i26.tinypic.com/20r78fa.png[/img]
[QUOTE=Overv;16057049]Yay, my window class is finished. I used the Derma window design as an example design, I'll make my own soon. The windows are draggable and closeable [img]http://i89.photobucket.com/albums/k237/dryer-lint/3.gif[/img]. Now I can start working on the controls. *image*[/QUOTE] Cool! :D I've been thinking about working on window system too, oh well one thing at a time.
Where does the 'derma' style come from? Did Garry make it?
[QUOTE=qurl;16057837]Where does the 'derma' style come from? Did Garry make it?[/QUOTE] Yeah, the Derma Initiative's thingy on Google Code explicitly states it's a "Skin and GUI Control collection for GMLua". Wait, is it skin and GUI *control* collection or skin *and* gui control collection?
[QUOTE=qurl;16057837]Where does the 'derma' style come from? Did Garry make it?[/QUOTE] Have you ever played Garrysmod?
[QUOTE=raccoon12;16057850]Have you ever played Garrysmod?[/QUOTE] ofc, don't see what that has to do with anything. I'm asking if the style was Garry's idea or something someone already made.
[QUOTE=qurl;16057867]ofc, don't see what that has to do with anything. I'm asking if the style was Garry's idea or something someone already made.[/QUOTE] Actually, I think it states Garry Newman as the author there, too. Change your skin and check there.
[QUOTE=HubmaN V2;16057877]Actually, I think it states Garry Newman as the author there, too. Change your skin and check there.[/QUOTE] My skin?
[QUOTE=qurl;16057913]My skin?[/QUOTE] [img]http://www.cubeupload.com/files/70ee00untitled.jpg[/img]
[QUOTE=Overv;16057049]Yay, my window class is finished. I used the Derma window design as an example design, I'll make my own soon. The windows are draggable and closeable [img]http://i89.photobucket.com/albums/k237/dryer-lint/3.gif[/img]. Now I can start working on the controls. [img]http://i26.tinypic.com/20r78fa.png[/img][/QUOTE] Are you using 9 slice to have different sized windows?
[QUOTE=HubmaN V2;16058000][img]http://www.cubeupload.com/files/70ee00untitled.jpg[/img][/QUOTE] what's up your ass? you act like garry's mod was created with things ONLY made by garry. also, no one claimed the derma style was theirs... so calm down.
[QUOTE=efeX;16058211]what's up your ass? you act like garry's mod was created with things ONLY made by garry. also, no one claimed the derma style was theirs... so calm down.[/QUOTE] Well, it says "Garry Newman" there - I doubt he'd steal something without crediting them.
[QUOTE=efeX;16058211]what's up your ass? you act like garry's mod was created with things ONLY made by garry. also, no one claimed the derma style was theirs... so calm down.[/QUOTE] he was just showing me that the theme was made by garry (although it just looks like valves ui base) Which I think it is based off.
[QUOTE=qurl;16058122]Are you using 9 slice to have different sized windows?[/QUOTE] 9 slice? I'm just drawing a rectangle shaped polygon.
[QUOTE=Overv;16058311]9 slice? I'm just drawing a rectangle shaped polygon.[/QUOTE] Oh, thought you were using textures
[QUOTE=HubmaN V2;16058238]Well, it says "Garry Newman" there - I doubt he'd steal something without crediting them.[/QUOTE] ... Can you read? I didn't say garry stole derma.
[QUOTE=Overv;16057049]Yay, my window class is finished. I used the Derma window design as an example design, I'll make my own soon. The windows are draggable and closeable [img]http://i89.photobucket.com/albums/k237/dryer-lint/3.gif[/img]. Now I can start working on the controls. [img]http://i26.tinypic.com/20r78fa.png[/img][/QUOTE] I don't mean to be overcritical, this is just out of interest: Why is the top of the "W" somewhat cut off?
I was wondering that too,
Started coding a Textbox for my gui system. I hate it. Just gonna code the bare minimum for now. The caret is always gonna be at the end. I only really need it for chat input right now, so no big problem.
[QUOTE=garry;16063010]Started coding a Textbox for my gui system. I hate it. Just gonna code the bare minimum for now. The caret is always gonna be at the end. I only really need it for chat input right now, so no big problem.[/QUOTE] I hate coding a text box, too. I still haven't done highlighting. Why are you coding one, though? Can't you use an external text box?
The furthest I got with my text input was everything except highlighting. Cut / Copy / Paste worked but you'd copy / cut the entire input buffer. Worked well enough for me.
Sorry, you need to Log In to post a reply to this thread.