1

Topic: [QUESTION] Minimize TW on MAC?

hello,

I jsut want to know if there is any button to press that Teeworlds minimize? tongue

2 (edited by buffer[] 2010-01-12 18:54:47)

Re: [QUESTION] Minimize TW on MAC?

Ask Mac user, but in Windows the minimize all action do it (Windows + D).
Dunno if there is a equivalent for Mac.

Look there

|ZPote| buffer[]'s posterous

3 (edited by ghost 2010-01-13 16:07:57)

Re: [QUESTION] Minimize TW on MAC?

Actually there was a function like this some time ago and it is reimplemented in the refactor branch, but in teeworlds-0.5.2 it is not available. If you are able to compile teeworlds yourself, here is a patch that adds this command to teeworlds-0.5.2.

Syntax of the command in f1 console:

minimize

You might want to bind it to some key:

bind f11 minimize

Patch:

diff -Nru teeworlds-0.5.2-src/src/engine/client/ec_client.c teeworlds-0.5.2-minimize-src/src/engine/client/ec_client.c
--- teeworlds-0.5.2-src/src/engine/client/ec_client.c    2009-10-26 19:04:31.000000000 +0100
+++ teeworlds-0.5.2-minimize-src/src/engine/client/ec_client.c    2010-01-13 15:20:18.282777000 +0100
@@ -1870,6 +1870,11 @@
     client_quit();
 }
 
+static void con_minimize(void *result, void *user_data)
+{
+    gfx_minimize();
+}
+
 static void con_ping(void *result, void *user_data)
 {
     msg_pack_start_system(NETMSG_PING, 0);
@@ -1972,6 +1977,7 @@
 
 static void client_register_commands()
 {
+    MACRO_REGISTER_COMMAND("minimize", "", CFGFLAG_CLIENT, con_minimize, 0x0, "Minimize Teeworlds");
     MACRO_REGISTER_COMMAND("quit", "", CFGFLAG_CLIENT, con_quit, 0x0, "Quit Teeworlds");
     MACRO_REGISTER_COMMAND("exit", "", CFGFLAG_CLIENT, con_quit, 0x0, "Quit Teeworlds");
     MACRO_REGISTER_COMMAND("connect", "s", CFGFLAG_CLIENT, con_connect, 0x0, "Connect to the specified host/ip");

How to apply the patch:
1. Copy the patch into a file named minimize.patch somewhere on your computer.
2. Enter the following in a console:

cd /path/to/teeworlds-0.5.2-src/
patch -p1 < /path/to/minimize.patch

This function will work on any OS(including mac), as it is using the minimize feature of the SDL library.

However, if you are not able to compile, the refactoring of teeworlds will probably be done quite soon, thus the problem of the missing minimize command will be solved.

4

Re: [QUESTION] Minimize TW on MAC?

Ahh okey tongue

ehm..I can compile,
but i forgot how to patch xD

Patch -p0 < patch.patch | ? was it like this xD

and have i to put the patch in a txt editor and name it .patch? yes or?

xD -Stripe

5

Re: [QUESTION] Minimize TW on MAC?

hmm i get an error or something

(Stripping trailing CRs from patch.)
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Nru release-0.5.2rc1/src/engine/client/ec_client.c release-0.5.2rc1-minimize/src/engine/client/ec_client.c
|--- release-0.5.2rc1/src/engine/client/ec_client.c    2010-01-12 18:04:10.813458000 +0100
|+++ tw-0.5.1-minimize/src/engine/client/ec_client.c    2010-01-11 16:11:29.442526000 +0100
--------------------------
File to patch:
Skip this patch? [y] y 
Skipping patch.
patch unexpectedly ends in middle of line
2 out of 2 hunks ignored

6 (edited by ghost 2010-01-12 21:41:48)

Re: [QUESTION] Minimize TW on MAC?

Yes, put the patch in a file named minimize.patch or similar. Then cd to teeworlds-0.0.5-src. Then use:

patch -p1 < /path/to/the/patchfile/minimize.patch

This should do it, at least it does on my pc.

7

Re: [QUESTION] Minimize TW on MAC?

hm now this

***-***-MacBook-Pro:tw ***$ patch -p0 < /Users/***/***/TW/Compile/tw mini.patch
patch: **** read error : Is a directory

*** is my name with 3 ***

8

Re: [QUESTION] Minimize TW on MAC?

Wooho, thanks ghost91 for this snippet, very useful!

Stripe, if you cant apply the patch just do it by hand, those 5 lines are not to much tongue

9

Re: [QUESTION] Minimize TW on MAC?

I can`t Code C++ or C or something else and i dont know where i have to write it tongue

but You can make it for me and send me i skype smile

That would be so nice *_*

10

Re: [QUESTION] Minimize TW on MAC?

hm...about c++ a question, does someone know where i can learn this...are there a page where a tutorial is for example or is it so complex?

Ingame Name: //w®a* DøñE
Clanpage of //w®a*
Clanmovie of //w®a*

11 (edited by ghost 2010-01-12 23:47:07)

Re: [QUESTION] Minimize TW on MAC?

Stripe wrote:

***-***-MacBook-Pro:tw ***$ patch -p0 < /Users/***/***/TW/Compile/tw mini.patch
patch: **** read error : Is a directory

Why are u using a whitespace here? Maybe that's the problem: patch thinks you want to use the directory
/Users/***/***/TW/Compile/tw as patch. And be sure to write p1 and not p0, otherwise it won't work.
You should type that:

patch -p1 < /Users/***/***/TW/Compile/tw/mini.patch

@ELO~281:
http://www.cplusplus.com/doc/tutorial/

You can get the basics there, if you want to learn coding tw, take some time looking to the sourcecode wink
(btw. this might not be the correct topic for your question)

12

Re: [QUESTION] Minimize TW on MAC?

ghost91 wrote:

(btw. this might not be the correct topic for your question)

Sry, i know...but stripe mentioned C++ so i take the situation to ask wink

Ingame Name: //w®a* DøñE
Clanpage of //w®a*
Clanmovie of //w®a*

13 (edited by MertenNor 2010-01-13 01:31:25)

Re: [QUESTION] Minimize TW on MAC?

I get this error wen I try to apply the patch file:

patching file src/engine/client/ec_client.c
Hunk #1 succeeded at 1870 with fuzz 1.
patch unexpectedly ends in middle of line
patch: **** unexpected end of file in patch

going to try it manually then..

EDIT:
I get the "minimize" up in F1 but wen I do the command nothing happens..

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

14

Re: [QUESTION] Minimize TW on MAC?

@MertenNor : It works on Windows... ^^

|ZPote| buffer[]'s posterous

15 (edited by ghost 2010-01-13 12:29:17)

Re: [QUESTION] Minimize TW on MAC?

About those patch errors: it might be those accur, because I was using svn version of teeworlds-0.5.2 (/tags/teeworlds-0.5.2rc1)
I edited my first post, so it contains a patch that has been created with the sourcecode of teeworlds that you can get from the download section here.
Also now there is an explanation about how to apply the patch.

@ MertenNor: If you have applied the patch correctly and it still does not work, I have no idea what the problem might be as the code is actually the same as in the refactor branch, only it is written in the old style. Maybe you try it again with the updated patch. You should now be able to patch automatically without any errors. Pls tell me, whether it works correctly then, or not.

16

Re: [QUESTION] Minimize TW on MAC?

ghost I check, lines don't change between both version.
Anyway can't make your patch working.

If somebody still need it, I'll put sources or just the file.

|ZPote| buffer[]'s posterous

17

Re: [QUESTION] Minimize TW on MAC?

I get error like Merten.. hmm

can you put the source here please?

18

Re: [QUESTION] Minimize TW on MAC?

ec_client.c

(Only this file change, just compile it with the last teeworlds sources)

|ZPote| buffer[]'s posterous

19 (edited by MertenNor 2010-01-13 19:51:15)

Re: [QUESTION] Minimize TW on MAC?

@ghost91
wen I try the new patch.. I get this error:

patching file src/engine/client/ec_client.c
Hunk #1 succeeded at 1870 with fuzz 1.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 1977.
1 out of 2 hunks FAILED -- saving rejects to file src/engine/client/ec_client.c.rej

@buffer[]
wen I apply the "ec_client.c" it only minimizes in Window mode and not in fullscreen..

but what about Hide the Teeworlds instead ?

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

20

Re: [QUESTION] Minimize TW on MAC?

at me it dotn work sad

i write minimize in console but nothing happens.. hmm Merten can you sent me youres? pls

21

Re: [QUESTION] Minimize TW on MAC?

Works very well in Windows big_smile

Search for SDL & Mac, that bug isn't related to Teeworlds code.

|ZPote| buffer[]'s posterous

22

Re: [QUESTION] Minimize TW on MAC?

Stripe wrote:

at me it dotn work sad

i write minimize in console but nothing happens.. hmm Merten can you sent me youres? pls

here but it only works to minimize it wen it is in Window mode.. xD

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

23

Re: [QUESTION] Minimize TW on MAC?

buffer[] is right. If it does not work on Mac, it is a problem if the sdl implementation in mac.

24

Re: [QUESTION] Minimize TW on MAC?

Merten..ehmm I cant open it just with text edit.. hmm upload the other teeworlds...

25

Re: [QUESTION] Minimize TW on MAC?

Stripe wrote:

Merten..ehmm I cant open it just with text edit.. hmm upload the other teeworlds...

that is the client file.. put it in side your Teeworlds.app smile you might want to backup the original file..

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway