Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Simple region tools

 
Post new topic   Reply to topic Printable version
 View previous topic  Region solutions Post :: Post Flag Neuter  View next topic  
Author Message
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Jul 23, 2004 8:18 am    Post subject: Simple region tools Reply to topic Reply with quote

These are tools to help create single rectangles. Good for testing with regions or very square maps.

numtochar.c:
Code: Show/Hide

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "util.h"
#include "region.h"

int main(int argc, char *argv[])
{
   if (argc == 5)
   {
      rect_t r;
      char out[10];

      r.x = atoi(argv[1]);
      r.y = atoi(argv[2]);
      r.w = atoi(argv[3]);
      r.h = atoi(argv[4]);

      encode_rectangle(out, r);

      printf("x:%i y:%i w:%i h:%i\n", r.x, r.y, r.w, r.h);
      printf("%s\n", out);
      exit(0);
   }
   else
   {
      printf("usage: %s <x> <y> <w> <h>\n", argv[0]);
      exit(1);
   }
}



chartonum.c:
Code: Show/Hide

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "util.h"
#include "region.h"

int main(int argc, char *argv[])
{
   if (argc == 2)
   {
      if (strlen(argv[1]) != 9)
      {
         rect_t r;
         r = decode_rectangle(argv[1]);
         printf("x:%i y:%i w:%i h:%i\n", r.x, r.y, r.w, r.h);
         exit(0);
      }
      else
      {
         printf("Error: bad length.\n");
         exit(1);
      }
   }
   else
   {
      printf("usage: %s <chars>\n", argv[0]);
      exit(1);
   }
}

_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me




chartonum.c - 0 KB
File downloaded or viewed 32 time(s)

numtochar.c - 0 KB
File downloaded or viewed 29 time(s)
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 700 page(s) served in previous 5 minutes.

phpBB Created this page in 0.452212 seconds : 28 queries executed (95.1%): GZIP compression disabled