Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Power of 2 Converter  (Read 1907 times)
0 Members and 1 Guest are viewing this topic.
Offline pploco1996

Senior Newbie


Exp: 1 year



« Posted 2013-08-07 20:09:22 »

Hi Im new to the site but I want to help as much as I can.

I know this is the "Shared code" section but I didn't know where to put it.

Well, here it is: http://www.java-gaming.org/user-generated-content/members/238563/power-of-2-converter.jar

It is power of 2 conveter that I made. A lot of people (including myself) are having problems loading textures in LibGDX
because their graphics card doesn't support OpenGL 2.0 and the images most have a power of 2 resolution.

The images go to a folder on your desktop called "Power of 2". The program works very simple. It just adds translucent space at the right and bottom side of the image.

And the last thing you have to know is that the images most be in "PNG" format, otherwise it won't work.

That's it... Enjoy  Grin
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2013-08-08 05:56:09 »

This board is for sharing sourcecode. You should post the code of the method that does most of the work.

There is no reason to use filenames in your native language. Just consider how you'd feel about using a tool that would create a directory called "tot de tweede macht".

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline pploco1996

Senior Newbie


Exp: 1 year



« Reply #2 - Posted 2013-08-08 06:35:49 »

So just because you are north american you think you have the best language?

Show some respect, I'm just helping the comunity by giving them this tool for free.

Why don't you make the same program and change the name of the folder to whatever you want?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeremy
« Reply #3 - Posted 2013-08-08 06:46:27 »

So just because you are north american you think you have the best language?

Show some respect, I'm just helping the comunity by giving them this tool for free.

Why don't you make the same program and change the name of the folder to whatever you want?
Don't put words in his mouth.

This is a nativity English speaking forum - all he was saying is that when an application starts creating unidentifiable documents with foreign uninterpreted names, it makes them uneasy.

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2013-08-08 07:03:08 »

So just because you are north american you think you have the best language?

Show some respect, I'm just helping the comunity by giving them this tool for free.

I'm not 'North American' (there are a few million North American Canadians speaking French you know). Contrary to popular belief, I'm Dutch - I guess I'm rather multi-cultured because there are so few of us.

I don't understand Spanish, like you don't understand Dutch. That's why everybody here communicates in English. In technical terms, it's a protocol.

First, I'd like to remind you that this 'shared code' board is for shared sourcecode, posted on the forum - and second, what's up with the short fuse? It's so easy to rename a directory to an English name, for an audience that agreed to use English as their means of communication, that I don't know why you'd get insulted by a mere suggestion.

I'd hate you to think I was out to disrespect diss you, so I hope this cleared it up a bit.



Why don't you make the same program and change the name of the folder to whatever you want?
Okay.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
BufferedImage orig = ImageIO.readFile(new File(...));
int w2 = ceilToPOT(orig.getWidth());
int h2 = ceilToPOT(orig.getHeight());
BufferedImage full = new BufferedImage(w2, h2, BufferedImage.TYPE_RGBA_INT);
full.getGraphics().drawImage(orig, 0, 0, null);
ImageIO.writeFile(full, "PNG", new File(...));

int ceilToPOT(int v) { // safe for image dimension inputs
  for(int pot=1;; pot<<=1) {
      if(v <= pot) {
         return pot;
      }
   }
}

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline StumpyStrust
« Reply #5 - Posted 2013-08-08 07:11:27 »

Disrespect is not a verb. Sorry have to say it.

Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #6 - Posted 2013-08-08 12:07:09 »

You should likely be using texture packing rather than a texture per image.

Offline pploco1996

Senior Newbie


Exp: 1 year



« Reply #7 - Posted 2013-08-08 17:02:46 »

Alright I want to apologize to you and anyone who read my rude post. I admit totally overreacted.

In fact, for the sake of the comunity and to make peace with you, I will change the language of the program.

And about the fact that this is the sourcecode section, can somebody tell me where can I move it to?
Offline sproingie
« Reply #8 - Posted 2013-08-10 20:35:52 »

Disrespect is not a verb. Sorry have to say it.

Any noun can be verbed, and every verb has a nouning.
Offline quew8

JGO Coder


Medals: 23



« Reply #9 - Posted 2013-08-10 23:43:58 »

Disrespect is not a verb. Sorry have to say it.

Any noun can be verbed, and every verb has a nouning.


But it isn't always the same word:

"The force is strong with this one" "This one has much strength in the force"

"The husband hates his wife" "The wife feels a great hatred toward her husband"

Although in this case I think you are right.

Sorry again but I'm British and I love to talk about my language.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline HeroesGraveDev

JGO Kernel


Medals: 212
Projects: 11
Exp: 2 years


If it wasn't Awesome, it wasn't me.


« Reply #10 - Posted 2013-08-10 23:52:20 »

Disrespect is not a verb. Sorry have to say it.

To disrespect (verb) someone is to show disrespect (noun), which would make you disrespectful (adjective).

Offline StumpyStrust
« Reply #11 - Posted 2013-08-11 01:17:47 »

Can someone go disrespect for me? No? This is something that has change here in the states. They have now made it a verb when it never was. I am normally not a big grammar guy or one to argue with usage cases but for this one specific case I simply can't let it go. You can't disrespect someone. You can show disrespect to someone. Anyways, sorry to derail. I will shut up now.

Online jonjava
« Reply #12 - Posted 2013-08-11 01:35:02 »

<a href="http://www.youtube.com/v/hHQ2756cyD8?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/hHQ2756cyD8?version=3&amp;hl=en_US&amp;start=</a>

Offline HeroesGraveDev

JGO Kernel


Medals: 212
Projects: 11
Exp: 2 years


If it wasn't Awesome, it wasn't me.


« Reply #13 - Posted 2013-08-11 01:51:22 »

Can someone go disrespect for me? No.

Can someone go destroy for me? Pointing Same sentence. Different verb.
Doesn't mean destroy isn't a verb.

Both destroy and disrepect need a noun to make the sentence complete.

Can someone go disrespect/destroy [noun] for me? Yes.

Offline Cero
« Reply #14 - Posted 2013-08-11 04:19:08 »

Someone respects someone else.
Anna respects Bob.

That is obviously correct. Now, yes, the whole disrespect stuff came from hiphop I guess. Still if to respect sth/so is a verb, disrespect should be one too.

I do not respect that.
I (!respect) that
I disrespect that.

Just like "I disallow something."

Offline StumpyStrust
« Reply #15 - Posted 2013-08-11 10:13:45 »

Ahh I guess it is just a cultural thing. You are right. Still sounds wrong. I learned more traditional English I suppose or older. For an example, the Oxford comma. Bill, Tedd, and Jeffery or Tom, Franky and Margaret?  Grin

Offline nsigma
« Reply #16 - Posted 2013-08-11 11:37:30 »

For a example, the Oxford comma.

But unfortunately not the Oxford anGrin

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline pploco1996

Senior Newbie


Exp: 1 year



« Reply #17 - Posted 2013-08-11 18:39:06 »

This programming thread became a language thread  Grin
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (31 views)
2014-04-15 18:08:23

BurntPizza (28 views)
2014-04-15 03:46:01

UprightPath (43 views)
2014-04-14 17:39:50

UprightPath (25 views)
2014-04-14 17:35:47

Porlus (42 views)
2014-04-14 15:48:38

tom_mai78101 (64 views)
2014-04-10 04:04:31

BurntPizza (124 views)
2014-04-08 23:06:04

tom_mai78101 (223 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!