ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Character.c
(Generate patch)

Comparing Daodan/src/Daodan_Character.c (file contents):
Revision 434 by gumby, Thu Jul 16 21:23:52 2009 UTC vs.
Revision 446 by gumby, Mon Jul 20 02:06:23 2009 UTC

# Line 1 | Line 1
1   #include <stdlib.h>
2   #include "Daodan_Character.h"
3   #include "Oni_Character.h"
4 + #include "BFW_Utility.h"
5 + #include "Oni.h"
6  
7   int DDr_TeamToTeamID(const char* team_string) //Already something like this in the engine, but I'm reimplementing it...
8   {
# Line 15 | Line 17 | int DDr_TeamToTeamID(const char* team_st
17          return team_neutral; //if you enter a bad teamname, return Neutral.....
18   }
19  
20 + uint32_t DDrGetCharacterIndexFromName(char* input) {
21 +        Character **characterlist;                                                              //pointer to array of Character pointers
22 +        characterlist = ONgGameState + 0x00167500;                              //Character List
23 +        int* total_characters = ONgGameState + 0x00167700;              //Max number of characters
24 +        int i;
25 +        for(i = 0; i < *total_characters; i++) {
26 +                if (characterlist[i] != 0)                                                      //anti Blam!
27 +                        if (!strcmp(characterlist[i]->Name, input)) {   //checks for the same name
28 +                        return characterlist[i]->Number;
29 +                        }
30 +        }
31 + return -1;                                                                                                      //not found :(
32 + }
33 +
34 + OniRectangle TestRect;
35   void CHARTest()
36   {
37 +        
38          CharacterObject* TestCHAR = malloc(sizeof(CharacterObject));
39          memset(TestCHAR, 0, sizeof(CharacterObject));
40          
# Line 24 | Line 42 | void CHARTest()
42          TestCHAR->Header.Type = type;
43          memcpy(TestCHAR->OSD.Name, "Gumby", 6);
44          memcpy(TestCHAR->OSD.Class, "striker_easy_1", 15);
45 <        memcpy(TestCHAR->OSD.ScriptSpawn, "dmsg", 20);
46 <        TestCHAR->OSD.Options = chr_unkillable;
45 >        memcpy(TestCHAR->OSD.ScriptSpawn, "dmsg", 20);  
46 >        //TestCHAR->OSD.Options = chr_unkillable;
47          TestCHAR->OSD.TeamID = team_syndicate;
48 +        //int* ptr = 0x005ECE70;
49 +        TestRect.Top = 10;
50 +        TestRect.Left = 10;
51 +        TestRect.Right = 100;
52 +        TestRect.Bottom = 100;
53          
54 <
55 <        ONrGameState_NewCharacter(TestCHAR, NULL, NULL, NULL);
54 >        char str[5] = "hi";
55 >        str[2] = '\0';
56 >        AUrMessageBox(0, "%8x", &TestRect);
57 >        int16_t a = TSrContext_DrawText(TestContext, str, 0xFF, &TestRect, &TestRect);
58 >        //ONrGameState_NewCharacter(TestCHAR, NULL, NULL, NULL);
59 >        return;
60   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)