Thread
:
Dynamic allocation Of 2D arrays
View Single Post
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
02-22-2018 , 14:21 Re: Dynamic allocation Of 2D arrays
#
2
I'm not sure if you're meant to have C code in SourceMod tutorials section, but regardless I'm just gonna say that I prefer using 1D array then mapping to 2D so that I don't get into the allocation aids. Just 1 malloc (size=width*height)/free and thats it.
Then to access an element at x/y you can do array[x + y*width]
Last edited by hmmmmm; 02-22-2018 at
14:21
.
hmmmmm
View Public Profile
Send a private message to hmmmmm
Find More Posts by hmmmmm