Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
typo in keys.c template #333521
07/16/10 22:19
07/16/10 22:19
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
There is a type in the new keys.c
Code:
byte _keys_down[256];

// returns nonzero when the given key was hit since the last call
function key_hit(var num)
{
	if (num <= 0 || num >= 256) return 0;
	if(!_keys_down[num] && key_pressed(num))
	{ 
		_keys_down[num] = 1;
		return 1;
	} 
	_keys_down[num] = key_pressed(num);
	return 0;
}

// returns nonzero when the key with the given name was hit
function key_hit(STRING* keystr)
{
	return key_hit(key_for_str(keystr));
}


As you can see there a two key_hit() functions.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: typo in keys.c template [Re: Nidhogg] #333528
07/16/10 22:30
07/16/10 22:30
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Technically, there is no problem with that, that's called overloading functions. If you use a var as parameter, the first one is used and if you use a string as parameter, the second one is used. I guess they are meant to have the same name, as they are documented with the same name:
http://www.conitec.net/beta/keys_c.htm

Re: typo in keys.c template [Re: Lukas] #333628
07/17/10 19:15
07/17/10 19:15
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Oh ok, thanks for explaining.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1