plugins/include/nextmap.inc
author David Anderson <dvander@alliedmods.net>
Fri Aug 15 05:22:26 2008 +0000 (2008-08-15)
changeset 2226 d10b38524be3
parent 2203 159ab9bad58c
permissions -rw-r--r--
Landed sourcepawn-1.2. The big changes:

1) JIT compilation/optimization now occurs per-function, and only when functions are first used. We're now officially a whole-method JIT rather than an AOT compiler (albiet, still a simple JIT). This has two implications: Functions are now much better abstracted internally, and loading a plugin is now much less expensive. If a function contains calls to other functions, THOSE functions are only compiled when they're invoked as well.

2) I've removed debug mode. We always show full backtraces now, as there was a very cheap way to implement this which really cleaned up everything. This is great for a number of reasons -- there's less code, the JIT is better designed, we don't need to relocate debug tables, and best of all we no longer have to tell users to enable debug mode at their own expense.
pred@2077
     1
/**
pred@2077
     2
 * vim: set ts=4 :
pred@2077
     3
 * =============================================================================
pred@2077
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
pred@2077
     5
 * =============================================================================
pred@2077
     6
 *
pred@2077
     7
 * This file is part of the SourceMod/SourcePawn SDK.
pred@2077
     8
 *
pred@2077
     9
 * This program is free software; you can redistribute it and/or modify it under
pred@2077
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
pred@2077
    11
 * Free Software Foundation.
pred@2077
    12
 * 
pred@2077
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
pred@2077
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
pred@2077
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
pred@2077
    16
 * details.
pred@2077
    17
 *
pred@2077
    18
 * You should have received a copy of the GNU General Public License along with
pred@2077
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
pred@2077
    20
 *
pred@2077
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
pred@2077
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
pred@2077
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
pred@2077
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
pred@2077
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
pred@2077
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
pred@2077
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
pred@2077
    28
 * or <http://www.sourcemod.net/license.php>.
pred@2077
    29
 *
pred@2077
    30
 * Version: $Id$
pred@2077
    31
 */
pred@2077
    32
pred@2077
    33
#if defined _nextmap_included_
pred@2077
    34
  #endinput
pred@2077
    35
#endif
pred@2077
    36
#define _nextmap_included_
pred@2077
    37
pred@2077
    38
/**
pred@2077
    39
 * Sets SourceMod's internal nextmap. 
pred@2077
    40
 * Equivalent to changing sm_nextmap but with an added validity check.
pred@2077
    41
 *
pred@2077
    42
 * @param map		Next map to set.
pred@2077
    43
 * @return			True if the nextmap was set, false if map was invalid.
pred@2077
    44
 */
pred@2077
    45
native bool:SetNextMap(const String:map[]);
pred@2077
    46
pred@2077
    47
/**
pred@2077
    48
 * Returns SourceMod's internal nextmap.
pred@2077
    49
 *
pred@2077
    50
 * @param map		Buffer to store the nextmap name.
pred@2077
    51
 * @param maxlen	Maximum length of the map buffer.
pred@2077
    52
 * @return			True if a Map was found and copied, false if no nextmap is set (map will be unchanged).
pred@2077
    53
 */
pred@2203
    54
native bool:GetNextMap(String:map[], maxlen);
pred@2203
    55
pred@2203
    56
/**
pred@2203
    57
 * Changes the current map and records the reason for the change with maphistory
pred@2203
    58
 *
pred@2203
    59
 * @param map		Map to change to.
pred@2203
    60
 * @param reason	Reason for change.
pred@2203
    61
 * @noreturn
pred@2203
    62
 */
pred@2203
    63
native ForceChangeLevel(const String:map[], const String:reason[]);
pred@2203
    64
pred@2203
    65
/**
pred@2203
    66
 * Gets the current number of maps in the map history
pred@2203
    67
 *
pred@2203
    68
 * @return			Number of maps.
pred@2203
    69
 */
pred@2203
    70
native GetMapHistorySize();
pred@2203
    71
pred@2203
    72
/**
pred@2203
    73
 * Retrieves a map from the map history list.
pred@2203
    74
 * 
pred@2203
    75
 * @param item			Item number. Must be 0 or greater and less than GetMapHistorySize().
pred@2203
    76
 * @param map			Buffer to store the map name.
pred@2203
    77
 * @param mapLen		Length of map buffer.
pred@2203
    78
 * @param reason		Buffer to store the change reason.
pred@2203
    79
 * @param reasonLen		Length of the reason buffer.
pred@2203
    80
 * @param startTime		Time the map started.
pred@2203
    81
 * @noreturn
pred@2203
    82
 * @error				Invalid item number.	
pred@2203
    83
 */
pred@2203
    84
native GetMapHistory(item, String:map[], mapLen, String:reason[], reasonLen, &startTime);