Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Faster "Map Production" for the Signet Series. Help Needed
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • September 20, 2019, 02:14:07 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Faster "Map Production" for the Signet Series. Help Needed  (Read 1401 times)
0 Members and 1 Guest are viewing this topic.
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« on: December 04, 2006, 09:54:44 AM »

Hello everyone,

Ernesto has been working on a way to make the map system more efficient for the signet series; but I don't know enough to say whether what he's proposing will make it run faster. I just wanted some opinions from the programmers here to confirm that his method works better.

Here's what is currently done:

Code:
$mapkey2="<table style=\"height: 130px; width: 110px; text-align: left;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td style=\"vertical-align: top;\">";
$mapkey="";
for ($i=0;$i<1326;$i++){
$keymap=ltrim($maze[$i]);
$mazemap=$keymap;
$mazemap.="maze.gif";
if ($i==$locale-1){
$mapkey.="<img src=\"./modules/signetimg/mcyan.gif\" title=\"\" alt=\"\" style=\"width: 10px; height: 10px;\">";
}else{
if ($i==1278){
$mapkey.="<img src=\"./modules/signetimg/mgreen.gif\" title=\"\" alt=\"\" style=\"width: 10px; height: 10px;\">";
}elseif ($i==898 && $allprefs['loc899']==0){
$mapkey.="<img src=\"./modules/signetimg/mred.gif\" title=\"\" alt=\"\" style=\"width: 10px; height: 10px;\">";
}else{
$mapkey.="<img src=\"./modules/signetimg/$mazemap\" title=\"\" alt=\"\" style=\"width: 10px; height: 10px;\">";
}
}
if ($i==33 or $i==67 or $i==101 or $i==135 ...){
$mapkey="`n".$mapkey;
$mapkey2=$mapkey.$mapkey2;
$mapkey="";
}
}
$mapkey2.="</td></tr></tbody></table>";
output_notl($mapkey2,true);

Here is what Ernesto has proposed:
Code:
rawoutput("<table style=\"height: 130px; width: 350px; text-align: absmiddle; line-height: 10px; border-style: solid 1px; border-color: #777777; font-size: 8px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td colspan=\"34\"></td>");
$mapkey="";
for ($i=0;$i<1326;$i++){
$keymap=ltrim($maze[$i]);
$mazemap=$keymap;
$mazemap.="maze.gif";
if ($keymap < 16 or $keymap==26) $mazebg="CCCCCC";
else $mazebg="000000";
if ($i==$locale-1){
$mapkey.="<td style=\"width: 10px; height: 10px; padding-right: 0px; background-color: cyan;\">&nbsp;</td>";
}else{
if ($i==1278){
$mapkey.="<td style=\"width: 10px; height: 10px; padding-right: 0px; background-color: green;\">&nbsp;</td>";
}elseif ($i==112 && $allprefs['loc113b']==0){
$mapkey.="<td style=\"width: 10px; height: 10px; padding-right: 0px;\"><img src=\"./modules/signetimg/mred.gif\" title=\"\" alt=\"\" style=\"width: 10px; height: 10px;\"></td>";
}else{
$mapkey.="<td style=\"width: 10px; height: 10px; padding-right: 0px; background-color: #".$mazebg.";\">&nbsp;</td>";
}
}
if ($i==33 or $i==67 or $i==101 or $i==135){
$mapkey="</tr><tr>".$mapkey;
$mapkey2=$mapkey.$mapkey2;
$mapkey="";
}
}
output_notl($mapkey2,true);
output_notl("</table>",true);

I have tested both... they both work, but my question is:

Which version should be used to make it as efficient as possible?
Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
83 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search