Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Feb 2005
Offline Last Active Aug 04 2014 11:37 AM

Posts I've Made

In Topic: Git Hooks on Windows using batch

02 January 2013 - 03:54 PM

From what I understand you're wanting to have batch files execute based on git events such as post commit and pre commit?

The .git folder will be created when you initialize a git project. In the folder you'll have a folder called hooks. You will then see several files ending in .sample.

If you rename any of these files to strip the .sample off the end (so, for post-commit.sample you'd end up with post-commit) then git will see that you want to hook that particular event. Inside the file itself you can have your batch file execute by simply providing the path of the batch file.

I have a batch file called test.bat in .git/hooks/ and within post-commit I replaced ": nothing" with ./git/hooks/test.bat

My test.bat file merely contains "echo hurrah". Now whenever I do a commit in that particular project I see hurrah echoed in the console.

From the looks of things it seems that you'd have to set up hooks for every git project you're working with. However, it might be possible to set it up so the .git/hooks folder always has your batch files set up whenever you initialize a new git project.

In Topic: Shaders: Lighting has different brightness on different PCs

20 December 2012 - 08:41 PM

Check the value of your lighting variable on the other computer. From the code you've posted, only ambient lighting is applied when 'lighting' is equal to 1 (both ambient, and directional are applied when lighting is equal to 2).

I don't see where lighting is actually set anywhere in the code you posted but that's a good starting point to take a look at for you.

To reiterate, the reason it looks brighter on the other machine is probably because you're only applying ambient lighting when it runs on that machine.

In Topic: == comparison not working

13 December 2012 - 04:13 AM

Almost, but the important part is the ratio: 32 by 9 is not a 16:9 ratio.

Well spotted! Perhaps a sign for me to turn off the computer for the night and go to bed.

In Topic: == comparison not working

13 December 2012 - 04:02 AM

Ectara's right. Removing the poorly thought out suggestion.

In Topic: Merging adjacent boxes to produce smallest set?

15 November 2012 - 02:09 PM

Take a look at quadtrees. As your level format is already a 2D grid, this would be ideal for quickly determining the largest possible box you can make out of the smaller boxes. The idea is similar to Waterlimon's.

Starting from the root node, you would drill deeper into the tree until a node has no empty children or you've met a maximum depth. If all 4 children of a node contain data (boxes) then it's safe to represent that as a single block.

Here's a visual, interactive example - http://donar.umiacs.umd.edu/quadtree/regions/regionquad.html