Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-13-2005, 05:35 PM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

Quote:
Originally Posted by Branks
accessing multi dimensional arrays, ive heard this is slow enough to be avoided when its possible, however some situations such as Mob::SpellEffect which various cases within, will need to access the array which holds AA spell IDs and recourses of AA spell Ids, would it be better to store these commonly checked spell IDs in global variables? instead of accessing the array each pass?
This has no overhead at all in C or C++. It may in Java or other languages, but in C the entire multidimensional array is stored linearly in one block of memory with each row immediately after the previous row. He said you could store it as a single dimensional array and refer to it with [column +(row*num_columns)] and you can if you want, but that is exactly what the program does when you put [row][column]. You can even declare it as two dimension and type cast it to one dimension and refer to it interchangably. So the only over head is a pointer look up and an addition and multiplication, if you worry over that then you should see a shrink.

Quote:
Originally Posted by Branks
also, the question about static variables declared within a class method, are these created for every instance of a class or does every instance of a class use the same method and therefor the static variables only exsist once?
I don't think you can declare a static variable inside a method, and even if you can it will do absolutely nothing because variables declared in a method cease to exist once the method stops running. Of course if you have two instances of the method running at the same time it may make them share the variables, but I have no idea.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:56 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3