# cPortalDat Class Reference

List of all members.

## Static Public Member Functions

static void | LoadStartingInfo (cAvatar *pcAvatar)
static void | LoadItemModel (cObject *pcObject, DWORD dwModelID, DWORD dwColorID=0, double dblColorValue=-1)
static int | CalcPalette (int numPalettes, double palValue=-1)
static void | Load_PortalDat (UCHAR *&buf, char file[9])

## Member Function Documentation

int cPortalDat::CalcPalette | ( | int | numPalettes,
|  | double | palValue = `-1` |
| ) |  |  | `[static]`

Determines the CLUT (0x04000000 object in the portal.dat) to be used.

The palette to use is determined by rounding the value of numPalettes minus one (as the palettes are zero-indexed) multiplied by the palValue value.

Parameters:

  | numPalettes | - The number of palettes in the palette list.
  | palValue | - The shading value used to determine the palette (between 0 and 1).

Returns:
  palette - The palette index (beginning with 0) to use.

static void cPortalDat::Load_PortalDat | ( | UCHAR *& | buf,
|  | char | file[9] |
| ) |  |  | `[inline, static]`

Loads the portal.dat information for the specified file.

Calls FetchPortalFilePos to find a file's position. Calls FetchPortalFile to fetch a file from its found position.

Parameters:

  | &buf | - The address of the buffer that should receive the file information.
  | file | - The file to be loaded from the portal.dat.

void cPortalDat::LoadItemModel | ( | cObject * | pcObject,
|  | DWORD | dwModelID,
|  | DWORD | dwColorID = `0`,
|  | double | dblColorValue = `-1` |
| ) |  |  | `[static]`

Handles the loading of item models (palette, texture, and model information).

Called whenever an object's p/t/m information should be initialized or updated.

Parameters:

  | *pcObject | - A pointer to the object whose p/t/m information will be initialized or updated.
  | dwModelID | - The item model to be used (world, male, female) for the object.
  | dwColorID | - The color of the object.
  | dblColorValue | - The color shade of the object.

void cPortalDat::LoadStartingInfo | ( | cAvatar * | pcAvatar | ) | `[static]`

Navigates the Character Creation Information (0x0E000002) file in the portal.dat. This file contains the starting locations, race- and gender-specific clothing and color selections, and the male and female palette, texture, and model information. This model information includes the female/male models, skin shade, hair color, hair shade, hair style, eye color, forehead style, chin style, and nose style.

Parameters:

  | *pcAvatar | - A pointer to the avatar whose information should be loaded or updated.

Author: eLeM

The documentation for this class was generated from the following files:

- E:/uas2/Server/DatFile.h
- E:/uas2/Server/DatFile.cpp