Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (maslone1, TipmyPip, Tails01, Aku_Aku), 2,415 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 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